Merge branch 'refs/heads/dev' into test
This commit is contained in:
@@ -40,7 +40,11 @@
|
|||||||
<artifactId>zt-module-erp-server</artifactId>
|
<artifactId>zt-module-erp-server</artifactId>
|
||||||
<version>${revision}</version>
|
<version>${revision}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.zt.plat</groupId>
|
||||||
|
<artifactId>zt-module-unit-management-server</artifactId>
|
||||||
|
<version>${revision}</version>
|
||||||
|
</dependency>
|
||||||
<!-- Web 相关 -->
|
<!-- Web 相关 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.zt.plat</groupId>
|
<groupId>com.zt.plat</groupId>
|
||||||
|
|||||||
1
pom.xml
1
pom.xml
@@ -12,6 +12,7 @@
|
|||||||
<module>zt-module-contract-order</module>
|
<module>zt-module-contract-order</module>
|
||||||
<module>zt-module-erp</module>
|
<module>zt-module-erp</module>
|
||||||
<module>base-server</module>
|
<module>base-server</module>
|
||||||
|
<module>zt-module-unit-management</module>
|
||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
<name>${project.artifactId}</name>
|
<name>${project.artifactId}</name>
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ public interface ErrorCodeConstants {
|
|||||||
ErrorCode COMPANY_RELATIVITY_NOT_EXISTS = new ErrorCode(1_001_000_001, "示例不存在");
|
ErrorCode COMPANY_RELATIVITY_NOT_EXISTS = new ErrorCode(1_001_000_001, "示例不存在");
|
||||||
ErrorCode WAREHOUSE_NOT_EXISTS = new ErrorCode(1_001_000_001, "示例不存在");
|
ErrorCode WAREHOUSE_NOT_EXISTS = new ErrorCode(1_001_000_001, "示例不存在");
|
||||||
ErrorCode FACTORY_NOT_EXISTS = new ErrorCode(1_001_000_001, "示例不存在");
|
ErrorCode FACTORY_NOT_EXISTS = new ErrorCode(1_001_000_001, "示例不存在");
|
||||||
|
ErrorCode TAX_NOT_EXISTS = new ErrorCode(1_001_000_001, "示例不存在");
|
||||||
|
|
||||||
|
|
||||||
ErrorCode BUSINESS_RULE_NOT_EXISTS = new ErrorCode(1_027_100_001, "规则模型不存在");
|
ErrorCode BUSINESS_RULE_NOT_EXISTS = new ErrorCode(1_027_100_001, "规则模型不存在");
|
||||||
|
|||||||
@@ -0,0 +1,105 @@
|
|||||||
|
package com.zt.plat.module.base.controller.admin.base;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog;
|
||||||
|
import com.zt.plat.framework.business.interceptor.BusinessControllerMarker;
|
||||||
|
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||||
|
import com.zt.plat.framework.common.pojo.PageParam;
|
||||||
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
|
import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO;
|
||||||
|
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||||
|
import com.zt.plat.framework.excel.core.util.ExcelUtils;
|
||||||
|
import com.zt.plat.module.base.controller.admin.base.vo.TaxPageReqVO;
|
||||||
|
import com.zt.plat.module.base.controller.admin.base.vo.TaxRespVO;
|
||||||
|
import com.zt.plat.module.base.controller.admin.base.vo.TaxSaveReqVO;
|
||||||
|
import com.zt.plat.module.base.dal.dataobject.base.TaxDO;
|
||||||
|
import com.zt.plat.module.base.service.base.TaxService;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
import jakarta.validation.Valid;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
|
||||||
|
import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
|
@Tag(name = "管理后台 - 税码信息")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/base/tax")
|
||||||
|
@Validated
|
||||||
|
public class TaxController implements BusinessControllerMarker {
|
||||||
|
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private TaxService taxService;
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
@Operation(summary = "创建税码信息")
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:tax:create')")
|
||||||
|
public CommonResult<TaxRespVO> createTax(@Valid @RequestBody TaxSaveReqVO createReqVO) {
|
||||||
|
return success(taxService.createTax(createReqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update")
|
||||||
|
@Operation(summary = "更新税码信息")
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:tax:update')")
|
||||||
|
public CommonResult<Boolean> updateTax(@Valid @RequestBody TaxSaveReqVO updateReqVO) {
|
||||||
|
taxService.updateTax(updateReqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete")
|
||||||
|
@Operation(summary = "删除税码信息")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:tax:delete')")
|
||||||
|
public CommonResult<Boolean> deleteTax(@RequestParam("id") Long id) {
|
||||||
|
taxService.deleteTax(id);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete-list")
|
||||||
|
@Parameter(name = "ids", description = "编号", required = true)
|
||||||
|
@Operation(summary = "批量删除税码信息")
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:tax:delete')")
|
||||||
|
public CommonResult<Boolean> deleteTaxList(@RequestBody BatchDeleteReqVO req) {
|
||||||
|
taxService.deleteTaxListByIds(req.getIds());
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get")
|
||||||
|
@Operation(summary = "获得税码信息")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:tax:query')")
|
||||||
|
public CommonResult<TaxRespVO> getTax(@RequestParam("id") Long id) {
|
||||||
|
TaxDO tax = taxService.getTax(id);
|
||||||
|
return success(BeanUtils.toBean(tax, TaxRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/page")
|
||||||
|
@Operation(summary = "获得税码信息分页")
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:tax:query')")
|
||||||
|
public CommonResult<PageResult<TaxRespVO>> getTaxPage(@Valid TaxPageReqVO pageReqVO) {
|
||||||
|
PageResult<TaxDO> pageResult = taxService.getTaxPage(pageReqVO);
|
||||||
|
return success(BeanUtils.toBean(pageResult, TaxRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/export-excel")
|
||||||
|
@Operation(summary = "导出税码信息 Excel")
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:tax:export')")
|
||||||
|
@ApiAccessLog(operateType = EXPORT)
|
||||||
|
public void exportTaxExcel(@Valid TaxPageReqVO pageReqVO,
|
||||||
|
HttpServletResponse response) throws IOException {
|
||||||
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||||
|
List<TaxDO> list = taxService.getTaxPage(pageReqVO).getList();
|
||||||
|
// 导出 Excel
|
||||||
|
ExcelUtils.write(response, "税码信息.xls", "数据", TaxRespVO.class,
|
||||||
|
BeanUtils.toBean(list, TaxRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
package com.zt.plat.module.base.controller.admin.base.vo;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.common.pojo.PageParam;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 税码信息分页 Request VO")
|
||||||
|
@Data
|
||||||
|
public class TaxPageReqVO extends PageParam {
|
||||||
|
|
||||||
|
@Schema(description = "类型(字典: SPLY_BSN_TP)", example = "2")
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
@Schema(description = "类别")
|
||||||
|
private String category;
|
||||||
|
|
||||||
|
@Schema(description = "税码")
|
||||||
|
private String taxCoding;
|
||||||
|
|
||||||
|
@Schema(description = "税码描述")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@Schema(description = "税率")
|
||||||
|
private BigDecimal tax;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime[] createTime;
|
||||||
|
|
||||||
|
@Schema(description = "是否启用")
|
||||||
|
private String isEnable;
|
||||||
|
|
||||||
|
@Schema(description = "公司编码")
|
||||||
|
private String customerNumber;
|
||||||
|
|
||||||
|
@Schema(description = "公司名称", example = "王五")
|
||||||
|
private String customerName;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
package com.zt.plat.module.base.controller.admin.base.vo;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 税码信息 Response VO")
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class TaxRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "26656")
|
||||||
|
@ExcelProperty("主键")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "类型(字典: SPLY_BSN_TP)", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||||
|
@ExcelProperty("类型(字典: SPLY_BSN_TP)")
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
@Schema(description = "类别", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("类别")
|
||||||
|
private String category;
|
||||||
|
|
||||||
|
@Schema(description = "税码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("税码")
|
||||||
|
private String taxCoding;
|
||||||
|
|
||||||
|
@Schema(description = "税码描述")
|
||||||
|
@ExcelProperty("税码描述")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@Schema(description = "税率")
|
||||||
|
@ExcelProperty("税率")
|
||||||
|
private BigDecimal tax;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("创建时间")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
@Schema(description = "是否启用")
|
||||||
|
@ExcelProperty("是否启用")
|
||||||
|
private String isEnable;
|
||||||
|
|
||||||
|
@Schema(description = "公司编码")
|
||||||
|
@ExcelProperty("公司编码")
|
||||||
|
private String customerNumber;
|
||||||
|
|
||||||
|
@Schema(description = "公司名称", example = "王五")
|
||||||
|
@ExcelProperty("公司名称")
|
||||||
|
private String customerName;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
package com.zt.plat.module.base.controller.admin.base.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import jakarta.validation.constraints.NotEmpty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 税码信息新增/修改 Request VO")
|
||||||
|
@Data
|
||||||
|
public class TaxSaveReqVO {
|
||||||
|
|
||||||
|
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "26656")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "类型(字典: SPLY_BSN_TP)", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||||
|
@NotEmpty(message = "类型(字典: SPLY_BSN_TP)不能为空")
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
@Schema(description = "类别", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotEmpty(message = "类别不能为空")
|
||||||
|
private String category;
|
||||||
|
|
||||||
|
@Schema(description = "税码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotEmpty(message = "税码不能为空")
|
||||||
|
private String taxCoding;
|
||||||
|
|
||||||
|
@Schema(description = "税码描述")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@Schema(description = "税率")
|
||||||
|
private BigDecimal tax;
|
||||||
|
|
||||||
|
@Schema(description = "是否启用")
|
||||||
|
private String isEnable;
|
||||||
|
|
||||||
|
@Schema(description = "公司编码")
|
||||||
|
private String customerNumber;
|
||||||
|
|
||||||
|
@Schema(description = "公司名称", example = "王五")
|
||||||
|
private String customerName;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -39,4 +39,19 @@ public class OnlyOfficeCallbackController {
|
|||||||
response.put("error", 0);
|
response.put("error", 0);
|
||||||
return new ResponseEntity<>(response, HttpStatus.OK);
|
return new ResponseEntity<>(response, HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处理OnlyOffice文档编辑服务发送的回调
|
||||||
|
*/
|
||||||
|
@PostMapping("/contract /callback/{id}")
|
||||||
|
@PermitAll
|
||||||
|
@TenantIgnore
|
||||||
|
public ResponseEntity<Map<String, Integer>> handleContractCallback(@RequestBody OnlyOfficeCallback callback, @PathVariable String id,@RequestParam("fileName") String fileName) {
|
||||||
|
// 处理回调逻辑
|
||||||
|
callbackService.processContractCallback(callback,id,fileName);
|
||||||
|
// 返回必须的响应,否则OnlyOffice会显示错误
|
||||||
|
Map<String, Integer> response = new HashMap<>();
|
||||||
|
response.put("error", 0);
|
||||||
|
return new ResponseEntity<>(response, HttpStatus.OK);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,4 +9,11 @@ public interface OnlyOfficeCallbackService {
|
|||||||
* @param callback 回调数据
|
* @param callback 回调数据
|
||||||
*/
|
*/
|
||||||
void processCallback(OnlyOfficeCallback callback,String id,String fileName);
|
void processCallback(OnlyOfficeCallback callback,String id,String fileName);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处理OnlyOffice回调
|
||||||
|
* @param callback 回调数据
|
||||||
|
*/
|
||||||
|
void processContractCallback(OnlyOfficeCallback callback,String id,String fileName);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -209,4 +209,159 @@ public class OnlyOfficeCallbackServiceImpl implements OnlyOfficeCallbackService
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void processContractCallback(OnlyOfficeCallback callback, String id, String fileName) {
|
||||||
|
log.info("收到OnlyOffice文档回调: {}", callback.getKey());
|
||||||
|
log.info("回调状态: {}", callback.getStatus());
|
||||||
|
|
||||||
|
// 根据不同的状态处理回调
|
||||||
|
switch (callback.getStatus()) {
|
||||||
|
case 1:
|
||||||
|
handleContractEditingStatus(callback, id,fileName);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
handleContractDocumentSaved(callback, id,fileName);
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
handleContractSaveError(callback, id,fileName);
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
handleContractDocumentClosedWithoutChanges(callback, id,fileName);
|
||||||
|
break;
|
||||||
|
case 6:
|
||||||
|
handleContractForcedSave(callback, id,fileName);
|
||||||
|
break;
|
||||||
|
case 7:
|
||||||
|
handleContractForcedSaveError(callback, id,fileName);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
log.warn("收到未知的回调状态: {}", callback.getStatus());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处理文档正在编辑的状态
|
||||||
|
*/
|
||||||
|
private void handleContractEditingStatus(OnlyOfficeCallback callback, String id,String fileName) {
|
||||||
|
log.info("文档 {} 正在被以下用户编辑: {}",
|
||||||
|
callback.getKey(), callback.getUsers());
|
||||||
|
|
||||||
|
// 处理用户操作(连接或断开连接)
|
||||||
|
if (callback.getActions() != null) {
|
||||||
|
for (Action action : callback.getActions()) {
|
||||||
|
String actionType = switch (action.getType()) {
|
||||||
|
case 0 -> "断开了连接";
|
||||||
|
case 1 -> "连接成功";
|
||||||
|
case 2 -> "在中点击了强制保存";
|
||||||
|
default -> "在中执行了未知操作";
|
||||||
|
};
|
||||||
|
log.info("用户 {} {}", action.getUserId(), actionType);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处理文档已保存的状态
|
||||||
|
*/
|
||||||
|
private void handleContractDocumentSaved(OnlyOfficeCallback callback, String id,String fileName) {
|
||||||
|
log.info("文档 {} 已准备好保存", callback.getKey());
|
||||||
|
saveContractDocument(callback, id,fileName);
|
||||||
|
|
||||||
|
// 处理历史记录
|
||||||
|
// handleHistoryChanges(callback,id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处理保存错误的状态
|
||||||
|
*/
|
||||||
|
private void handleContractSaveError(OnlyOfficeCallback callback, String id,String fileName) {
|
||||||
|
log.error("保存文档 {} 时出错", callback.getKey());
|
||||||
|
// 可以在这里添加错误处理逻辑,如发送通知等
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处理文档关闭且无更改的状态
|
||||||
|
*/
|
||||||
|
private void handleContractDocumentClosedWithoutChanges(OnlyOfficeCallback callback, String id,String fileName) {
|
||||||
|
log.info("文档 {} 已关闭,未做任何更改", callback.getKey());
|
||||||
|
// 可以在这里添加清理资源等逻辑
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处理强制保存的状态
|
||||||
|
*/
|
||||||
|
private void handleContractForcedSave(OnlyOfficeCallback callback, String id,String fileName) {
|
||||||
|
log.info("文档 {} 执行强制保存。类型: {}",
|
||||||
|
callback.getKey(), callback.getForceSaveType());
|
||||||
|
saveContractDocument(callback, id,fileName);
|
||||||
|
|
||||||
|
// 处理历史记录
|
||||||
|
handleHistoryChanges(callback, id);
|
||||||
|
|
||||||
|
// 如果是表单提交,处理表单数据
|
||||||
|
if (callback.getForceSaveType() == 3 && callback.getFormsDataUrl() != null) {
|
||||||
|
handleFormSubmission(callback, id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处理强制保存错误的状态
|
||||||
|
*/
|
||||||
|
private void handleContractForcedSaveError(OnlyOfficeCallback callback, String id,String fileName) {
|
||||||
|
log.error("文档 {} 强制保存时出错", callback.getKey());
|
||||||
|
// 可以在这里添加错误处理逻辑
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存文档到存储
|
||||||
|
*/
|
||||||
|
private void saveContractDocument(OnlyOfficeCallback callback, String id,String fileName) {
|
||||||
|
if (callback.getUrl() == null) {
|
||||||
|
log.error("文件路径为空");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
MultipartFile file = downloadFileAsMultipart(callback.getUrl());
|
||||||
|
// 1. 验证文件是否为空
|
||||||
|
|
||||||
|
String directory = "模版实例";
|
||||||
|
FileCreateReqDTO fileCreateReqDTO = new FileCreateReqDTO();
|
||||||
|
fileCreateReqDTO.setName(fileName);
|
||||||
|
fileCreateReqDTO.setContent(file.getBytes());
|
||||||
|
fileCreateReqDTO.setType(file.getContentType()); // 使用真实的MIME类型
|
||||||
|
fileCreateReqDTO.setDirectory(directory); // 设置文件存储目录
|
||||||
|
if (file.getSize() <=0){
|
||||||
|
log.error("文件大小为0");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// 7. 调用文件服务创建文件
|
||||||
|
CommonResult<FileRespDTO> result = fileApi.createFileWithReturn(fileCreateReqDTO);
|
||||||
|
if (result.isSuccess()) {
|
||||||
|
// 创建文件成功,处理结果
|
||||||
|
result.getData().setContent(null);
|
||||||
|
log.info("文件创建成功,文件ID:{}", result.getData());
|
||||||
|
// 创建文件成功,处理结果
|
||||||
|
FileRespDTO fileRespDTO = result.getData();
|
||||||
|
Map<String, Object> fileInfo = new HashMap<>();
|
||||||
|
fileInfo.put("id",String.valueOf(fileRespDTO.getId()));
|
||||||
|
fileInfo.put("name", fileRespDTO.getName());
|
||||||
|
fileInfo.put("directory", fileRespDTO.getDirectory());
|
||||||
|
templateInstanceService.updateTemplateInstanceFileUrlByInstanceId(id, JSONObject.toJSONString(fileInfo));
|
||||||
|
} else {
|
||||||
|
// 创建文件失败,处理错误
|
||||||
|
log.error("文件创建失败,错误信息:{}", result.getMsg());
|
||||||
|
}
|
||||||
|
log.info("文件创建结果:{}", result);
|
||||||
|
} catch (IOException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,74 @@
|
|||||||
|
package com.zt.plat.module.base.dal.dataobject.base;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
/**
|
||||||
|
* 税码信息 DO
|
||||||
|
*
|
||||||
|
* @author 后台管理-1
|
||||||
|
*/
|
||||||
|
@TableName("sply_tax")
|
||||||
|
@KeySequence("sply_tax_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
/**
|
||||||
|
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||||
|
*/
|
||||||
|
public class TaxDO extends BusinessBaseDO {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 类型(字典: SPLY_BSN_TP)
|
||||||
|
*/
|
||||||
|
@TableField("TP")
|
||||||
|
private String type;
|
||||||
|
/**
|
||||||
|
* 类别
|
||||||
|
*/
|
||||||
|
@TableField("CTGR")
|
||||||
|
private String category;
|
||||||
|
/**
|
||||||
|
* 税码
|
||||||
|
*/
|
||||||
|
@TableField("TAX_CDG")
|
||||||
|
private String taxCoding;
|
||||||
|
/**
|
||||||
|
* 税码描述
|
||||||
|
*/
|
||||||
|
@TableField("RMK")
|
||||||
|
private String remark;
|
||||||
|
/**
|
||||||
|
* 税率
|
||||||
|
*/
|
||||||
|
@TableField("TAX")
|
||||||
|
private BigDecimal tax;
|
||||||
|
/**
|
||||||
|
* 是否启用
|
||||||
|
*/
|
||||||
|
@TableField("IS_ENB")
|
||||||
|
private String isEnable;
|
||||||
|
/**
|
||||||
|
* 公司编码
|
||||||
|
*/
|
||||||
|
@TableField("CSTM_NUM")
|
||||||
|
private String customerNumber;
|
||||||
|
/**
|
||||||
|
* 公司名称
|
||||||
|
*/
|
||||||
|
@TableField("CSTM_NAME")
|
||||||
|
private String customerName;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
package com.zt.plat.module.base.dal.mysql.base;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
|
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
|
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
import com.zt.plat.module.base.dal.dataobject.base.TaxDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import com.zt.plat.module.base.controller.admin.base.vo.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 税码信息 Mapper
|
||||||
|
*
|
||||||
|
* @author 后台管理-1
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface TaxMapper extends BaseMapperX<TaxDO> {
|
||||||
|
|
||||||
|
default PageResult<TaxDO> selectPage(TaxPageReqVO reqVO) {
|
||||||
|
return selectPage(reqVO, new LambdaQueryWrapperX<TaxDO>()
|
||||||
|
.eqIfPresent(TaxDO::getType, reqVO.getType())
|
||||||
|
.eqIfPresent(TaxDO::getCategory, reqVO.getCategory())
|
||||||
|
.eqIfPresent(TaxDO::getTaxCoding, reqVO.getTaxCoding())
|
||||||
|
.eqIfPresent(TaxDO::getRemark, reqVO.getRemark())
|
||||||
|
.eqIfPresent(TaxDO::getTax, reqVO.getTax())
|
||||||
|
.betweenIfPresent(TaxDO::getCreateTime, reqVO.getCreateTime())
|
||||||
|
.eqIfPresent(TaxDO::getIsEnable, reqVO.getIsEnable())
|
||||||
|
.eqIfPresent(TaxDO::getCustomerNumber, reqVO.getCustomerNumber())
|
||||||
|
.likeIfPresent(TaxDO::getCustomerName, reqVO.getCustomerName())
|
||||||
|
.orderByDesc(TaxDO::getId));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,64 @@
|
|||||||
|
package com.zt.plat.module.base.service.base;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
|
import com.zt.plat.module.base.controller.admin.base.vo.TaxPageReqVO;
|
||||||
|
import com.zt.plat.module.base.controller.admin.base.vo.TaxRespVO;
|
||||||
|
import com.zt.plat.module.base.controller.admin.base.vo.TaxSaveReqVO;
|
||||||
|
import com.zt.plat.module.base.dal.dataobject.base.TaxDO;
|
||||||
|
import jakarta.validation.Valid;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 税码信息 Service 接口
|
||||||
|
*
|
||||||
|
* @author 后台管理-1
|
||||||
|
*/
|
||||||
|
public interface TaxService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建税码信息
|
||||||
|
*
|
||||||
|
* @param createReqVO 创建信息
|
||||||
|
* @return 编号
|
||||||
|
*/
|
||||||
|
TaxRespVO createTax(@Valid TaxSaveReqVO createReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新税码信息
|
||||||
|
*
|
||||||
|
* @param updateReqVO 更新信息
|
||||||
|
*/
|
||||||
|
void updateTax(@Valid TaxSaveReqVO updateReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除税码信息
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
*/
|
||||||
|
void deleteTax(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除税码信息
|
||||||
|
*
|
||||||
|
* @param ids 编号
|
||||||
|
*/
|
||||||
|
void deleteTaxListByIds(List<Long> ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得税码信息
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
* @return 税码信息
|
||||||
|
*/
|
||||||
|
TaxDO getTax(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得税码信息分页
|
||||||
|
*
|
||||||
|
* @param pageReqVO 分页查询
|
||||||
|
* @return 税码信息分页
|
||||||
|
*/
|
||||||
|
PageResult<TaxDO> getTaxPage(TaxPageReqVO pageReqVO);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,89 @@
|
|||||||
|
package com.zt.plat.module.base.service.base;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
|
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||||
|
import com.zt.plat.module.base.controller.admin.base.vo.TaxPageReqVO;
|
||||||
|
import com.zt.plat.module.base.controller.admin.base.vo.TaxRespVO;
|
||||||
|
import com.zt.plat.module.base.controller.admin.base.vo.TaxSaveReqVO;
|
||||||
|
import com.zt.plat.module.base.dal.dataobject.base.TaxDO;
|
||||||
|
import com.zt.plat.module.base.dal.mysql.base.TaxMapper;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
|
import static com.zt.plat.module.base.enums.ErrorCodeConstants.TAX_NOT_EXISTS;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 税码信息 Service 实现类
|
||||||
|
*
|
||||||
|
* @author 后台管理-1
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Validated
|
||||||
|
public class TaxServiceImpl implements TaxService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private TaxMapper taxMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TaxRespVO createTax(TaxSaveReqVO createReqVO) {
|
||||||
|
// 插入
|
||||||
|
TaxDO tax = BeanUtils.toBean(createReqVO, TaxDO.class);
|
||||||
|
taxMapper.insert(tax);
|
||||||
|
// 返回
|
||||||
|
return BeanUtils.toBean(tax, TaxRespVO.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateTax(TaxSaveReqVO updateReqVO) {
|
||||||
|
// 校验存在
|
||||||
|
validateTaxExists(updateReqVO.getId());
|
||||||
|
// 更新
|
||||||
|
TaxDO updateObj = BeanUtils.toBean(updateReqVO, TaxDO.class);
|
||||||
|
taxMapper.updateById(updateObj);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteTax(Long id) {
|
||||||
|
// 校验存在
|
||||||
|
validateTaxExists(id);
|
||||||
|
// 删除
|
||||||
|
taxMapper.deleteById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteTaxListByIds(List<Long> ids) {
|
||||||
|
// 校验存在
|
||||||
|
validateTaxExists(ids);
|
||||||
|
// 删除
|
||||||
|
taxMapper.deleteByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validateTaxExists(List<Long> ids) {
|
||||||
|
List<TaxDO> list = taxMapper.selectByIds(ids);
|
||||||
|
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
|
||||||
|
throw exception(TAX_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validateTaxExists(Long id) {
|
||||||
|
if (taxMapper.selectById(id) == null) {
|
||||||
|
throw exception(TAX_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TaxDO getTax(Long id) {
|
||||||
|
return taxMapper.selectById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<TaxDO> getTaxPage(TaxPageReqVO pageReqVO) {
|
||||||
|
return taxMapper.selectPage(pageReqVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -68,4 +68,11 @@ public interface TmplInscBsnRelService {
|
|||||||
* @param tmplInscBsnRelRespVO 类
|
* @param tmplInscBsnRelRespVO 类
|
||||||
*/
|
*/
|
||||||
void getTmplInscBsnRelDetails(TmplInscBsnRelRespVO tmplInscBsnRelRespVO);
|
void getTmplInscBsnRelDetails(TmplInscBsnRelRespVO tmplInscBsnRelRespVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 跟新cntt
|
||||||
|
*
|
||||||
|
* @param bsnId ,params
|
||||||
|
*/
|
||||||
|
void updateCntt(Long bsnId,String params);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -145,6 +145,20 @@ public class TmplInscBsnRelServiceImpl implements TmplInscBsnRelService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateCntt(Long bsnId, String params) {
|
||||||
|
List<TmplInscBsnRelDO> tmplInscBsnRelDOS = tmplInscBsnRelMapper.selectList(new LambdaQueryWrapper<TmplInscBsnRelDO>()
|
||||||
|
.eq(TmplInscBsnRelDO::getBsnId, bsnId).orderByDesc(TmplInscBsnRelDO::getVer)
|
||||||
|
);
|
||||||
|
if (tmplInscBsnRelDOS.isEmpty()) {
|
||||||
|
throw exception(TEMPLATE_INSTANCE_FILE_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
TmplInscBsnRelDO tmplInscBsnRelDO = tmplInscBsnRelDOS.get(0);
|
||||||
|
tmplInscBsnRelDO.setCntt( params);
|
||||||
|
tmplInscBsnRelMapper.updateById(tmplInscBsnRelDO);
|
||||||
|
log.info("更新业务实例cntt字段值成功");
|
||||||
|
}
|
||||||
|
|
||||||
//业务条款
|
//业务条款
|
||||||
private List<TmplInscItmBsnRespVO> setTmplInscItmBsnRespVOS(TmplInscBsnRelRespVO tmplInscBsnRelRespVO) {
|
private List<TmplInscItmBsnRespVO> setTmplInscItmBsnRespVOS(TmplInscBsnRelRespVO tmplInscBsnRelRespVO) {
|
||||||
List<TmplInscItmBsnRespVO> tmplInscItmBsnRespVOS = BeanUtils.toBean(SpringUtil.getBean(TmplInscItmBsnMapper.class).selectList(new LambdaQueryWrapper<TmplInscItmBsnDO>()
|
List<TmplInscItmBsnRespVO> tmplInscItmBsnRespVOS = BeanUtils.toBean(SpringUtil.getBean(TmplInscItmBsnMapper.class).selectList(new LambdaQueryWrapper<TmplInscItmBsnDO>()
|
||||||
@@ -152,7 +166,7 @@ public class TmplInscBsnRelServiceImpl implements TmplInscBsnRelService {
|
|||||||
), TmplInscItmBsnRespVO.class);
|
), TmplInscItmBsnRespVO.class);
|
||||||
tmplInscItmBsnRespVOS.forEach(tmplInscItmBsnRespVO -> {
|
tmplInscItmBsnRespVOS.forEach(tmplInscItmBsnRespVO -> {
|
||||||
tmplInscBsnRelRespVO.getInstanceItemRespVOS().forEach(instanceItemRespVO -> {
|
tmplInscBsnRelRespVO.getInstanceItemRespVOS().forEach(instanceItemRespVO -> {
|
||||||
if (tmplInscItmBsnRespVO.getInscItmId().equals(instanceItemRespVO.getId())){
|
if (tmplInscItmBsnRespVO.getInscItmId().equals(instanceItemRespVO.getId())) {
|
||||||
tmplInscItmBsnRespVO.setItmName(instanceItemRespVO.getItmName());
|
tmplInscItmBsnRespVO.setItmName(instanceItemRespVO.getItmName());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -273,4 +287,6 @@ public class TmplInscBsnRelServiceImpl implements TmplInscBsnRelService {
|
|||||||
log.info("删除业务实例条款值【{}】", ids);
|
log.info("删除业务实例条款值【{}】", ids);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.zt.plat.module.base.dal.mysql.base.TaxMapper">
|
||||||
|
|
||||||
|
<!--
|
||||||
|
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||||
|
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||||
|
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||||
|
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||||
|
-->
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package com.zt.plat.module.contractorder.enums.salesorder;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.common.exception.ErrorCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* contract-order 错误码枚举类
|
||||||
|
*
|
||||||
|
* contract-order 系统,使用 1-xxx-xxx-xxx 段
|
||||||
|
*
|
||||||
|
* @author ZT
|
||||||
|
*/
|
||||||
|
public interface ErrorCodeConstants {
|
||||||
|
|
||||||
|
// ========== 合同模块 1-027-000-000 ==========
|
||||||
|
ErrorCode SALES_ORDER_DETAIL_NOT_EXISTS = new ErrorCode(1_008_00_600, "消费订单不存在");
|
||||||
|
|
||||||
|
}
|
||||||
@@ -145,8 +145,8 @@ public class ContractController implements BusinessControllerMarker {
|
|||||||
@PostMapping("/submit/erp")
|
@PostMapping("/submit/erp")
|
||||||
@Operation(summary = "提交ERP")
|
@Operation(summary = "提交ERP")
|
||||||
@PreAuthorize("@ss.hasPermission('base:contract:erp')")
|
@PreAuthorize("@ss.hasPermission('base:contract:erp')")
|
||||||
public CommonResult<List<String>> submitErp(@RequestBody List<Long> ids) {
|
public CommonResult<JSONObject> submitErp(@RequestParam("id") Long id) {
|
||||||
return success(contractService.submitErp(ids));
|
return success(contractService.submitErp(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/list/up-not-relation")
|
@GetMapping("/list/up-not-relation")
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package com.zt.plat.module.contractorder.controller.admin.purchaseorder;
|
|||||||
import com.zt.plat.module.contractorder.api.ContractApiImpl;
|
import com.zt.plat.module.contractorder.api.ContractApiImpl;
|
||||||
import com.zt.plat.module.contractorder.api.dto.PurchaseOrderWithDetailsDTO;
|
import com.zt.plat.module.contractorder.api.dto.PurchaseOrderWithDetailsDTO;
|
||||||
import com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo.*;
|
import com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo.*;
|
||||||
|
import com.zt.plat.module.contractorder.controller.admin.salesorder.vo.SalesOrderSaveReqVO;
|
||||||
import com.zt.plat.module.contractorder.dal.dataobject.purchaseorder.PurchaseOrderDO;
|
import com.zt.plat.module.contractorder.dal.dataobject.purchaseorder.PurchaseOrderDO;
|
||||||
import com.zt.plat.module.contractorder.service.purchaseorder.PurchaseOrderService;
|
import com.zt.plat.module.contractorder.service.purchaseorder.PurchaseOrderService;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
@@ -19,6 +20,7 @@ import io.swagger.v3.oas.annotations.Operation;
|
|||||||
import jakarta.validation.constraints.*;
|
import jakarta.validation.constraints.*;
|
||||||
import jakarta.validation.*;
|
import jakarta.validation.*;
|
||||||
import jakarta.servlet.http.*;
|
import jakarta.servlet.http.*;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
@@ -27,11 +29,13 @@ import com.zt.plat.framework.common.pojo.PageParam;
|
|||||||
import com.zt.plat.framework.common.pojo.PageResult;
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||||
|
|
||||||
import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
import com.zt.plat.framework.excel.core.util.ExcelUtils;
|
import com.zt.plat.framework.excel.core.util.ExcelUtils;
|
||||||
|
|
||||||
import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog;
|
import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog;
|
||||||
|
|
||||||
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*;
|
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||||
|
|
||||||
|
|
||||||
@@ -75,7 +79,7 @@ public class PurchaseOrderController implements BusinessControllerMarker {
|
|||||||
@DeleteMapping("/delete-list")
|
@DeleteMapping("/delete-list")
|
||||||
@Parameter(name = "ids", description = "编号", required = true)
|
@Parameter(name = "ids", description = "编号", required = true)
|
||||||
@Operation(summary = "批量删除采购订单")
|
@Operation(summary = "批量删除采购订单")
|
||||||
@PreAuthorize("@ss.hasPermission('bse:purchase-order:delete')")
|
@PreAuthorize("@ss.hasPermission('bse:purchase-order:delete')")
|
||||||
public CommonResult<Boolean> deletePurchaseOrderList(@RequestBody BatchDeleteReqVO req) {
|
public CommonResult<Boolean> deletePurchaseOrderList(@RequestBody BatchDeleteReqVO req) {
|
||||||
purchaseOrderService.deletePurchaseOrderListByIds(req.getIds());
|
purchaseOrderService.deletePurchaseOrderListByIds(req.getIds());
|
||||||
return success(true);
|
return success(true);
|
||||||
@@ -83,12 +87,12 @@ public class PurchaseOrderController implements BusinessControllerMarker {
|
|||||||
|
|
||||||
@GetMapping("/get")
|
@GetMapping("/get")
|
||||||
@Operation(summary = "获得采购订单")
|
@Operation(summary = "获得采购订单")
|
||||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
@Parameter(name = "id", description = "id是订单主键,splyBsnTp是订单类型采购或者是消费", required = true, example = "1024")
|
||||||
@PreAuthorize("@ss.hasPermission('bse:purchase-order:query')")
|
@PreAuthorize("@ss.hasPermission('bse:purchase-order:query')")
|
||||||
public CommonResult<PurchaseOrderRespVO> getPurchaseOrder(@RequestParam("id") Long id) {
|
public CommonResult<PurchaseOrderRespVO> getPurchaseOrder(@RequestParam("id") Long id, @RequestParam(value = "splyBsnTp", required = false) String splyBsnTp) {
|
||||||
PurchaseOrderDO purchaseOrder = purchaseOrderService.getPurchaseOrder(id);
|
PurchaseOrderDO purchaseOrder = purchaseOrderService.getPurchaseOrder(id, splyBsnTp);
|
||||||
PurchaseOrderRespVO purchaseOrderRespVO = BeanUtils.toBean(purchaseOrder, PurchaseOrderRespVO.class);
|
PurchaseOrderRespVO purchaseOrderRespVO = BeanUtils.toBean(purchaseOrder, PurchaseOrderRespVO.class);
|
||||||
if (purchaseOrderRespVO == null){
|
if (purchaseOrderRespVO == null) {
|
||||||
return success(null);
|
return success(null);
|
||||||
}
|
}
|
||||||
purchaseOrderService.setOrderDetails(purchaseOrderRespVO);
|
purchaseOrderService.setOrderDetails(purchaseOrderRespVO);
|
||||||
@@ -100,7 +104,7 @@ public class PurchaseOrderController implements BusinessControllerMarker {
|
|||||||
@PreAuthorize("@ss.hasPermission('bse:purchase-order:query')")
|
@PreAuthorize("@ss.hasPermission('bse:purchase-order:query')")
|
||||||
public CommonResult<PageResult<PurchaseOrderRespVO>> getPurchaseOrderPage(@Valid PurchaseOrderPageReqVO pageReqVO) {
|
public CommonResult<PageResult<PurchaseOrderRespVO>> getPurchaseOrderPage(@Valid PurchaseOrderPageReqVO pageReqVO) {
|
||||||
PageResult<PurchaseOrderDO> pageResult = purchaseOrderService.getPurchaseOrderPage(pageReqVO);
|
PageResult<PurchaseOrderDO> pageResult = purchaseOrderService.getPurchaseOrderPage(pageReqVO);
|
||||||
PageResult<PurchaseOrderRespVO> purchaseOrderRespVOPageResult = BeanUtils.toBean(pageResult, PurchaseOrderRespVO.class);
|
PageResult<PurchaseOrderRespVO> purchaseOrderRespVOPageResult = BeanUtils.toBean(pageResult, PurchaseOrderRespVO.class);
|
||||||
purchaseOrderRespVOPageResult.getList().forEach(purchaseOrderRespVO -> purchaseOrderService.setOrderDetails(purchaseOrderRespVO));
|
purchaseOrderRespVOPageResult.getList().forEach(purchaseOrderRespVO -> purchaseOrderService.setOrderDetails(purchaseOrderRespVO));
|
||||||
return success(purchaseOrderRespVOPageResult);
|
return success(purchaseOrderRespVOPageResult);
|
||||||
}
|
}
|
||||||
@@ -110,12 +114,12 @@ public class PurchaseOrderController implements BusinessControllerMarker {
|
|||||||
@PreAuthorize("@ss.hasPermission('bse:purchase-order:export')")
|
@PreAuthorize("@ss.hasPermission('bse:purchase-order:export')")
|
||||||
@ApiAccessLog(operateType = EXPORT)
|
@ApiAccessLog(operateType = EXPORT)
|
||||||
public void exportPurchaseOrderExcel(@Valid PurchaseOrderPageReqVO pageReqVO,
|
public void exportPurchaseOrderExcel(@Valid PurchaseOrderPageReqVO pageReqVO,
|
||||||
HttpServletResponse response) throws IOException {
|
HttpServletResponse response) throws IOException {
|
||||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||||
List<PurchaseOrderDO> list = purchaseOrderService.getPurchaseOrderPage(pageReqVO).getList();
|
List<PurchaseOrderDO> list = purchaseOrderService.getPurchaseOrderPage(pageReqVO).getList();
|
||||||
// 导出 Excel
|
// 导出 Excel
|
||||||
ExcelUtils.write(response, "采购订单.xls", "数据", PurchaseOrderRespVO.class,
|
ExcelUtils.write(response, "采购订单.xls", "数据", PurchaseOrderRespVO.class,
|
||||||
BeanUtils.toBean(list, PurchaseOrderRespVO.class));
|
BeanUtils.toBean(list, PurchaseOrderRespVO.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
//提交订单审核
|
//提交订单审核
|
||||||
@@ -131,7 +135,7 @@ public class PurchaseOrderController implements BusinessControllerMarker {
|
|||||||
@Operation(summary = "批量提交订单审核")
|
@Operation(summary = "批量提交订单审核")
|
||||||
@PreAuthorize("@ss.hasPermission('bse:purchase-order:update')")
|
@PreAuthorize("@ss.hasPermission('bse:purchase-order:update')")
|
||||||
public CommonResult<Boolean> submitOrder(@RequestBody @Validated @NotEmpty(message = "采购订单id不能为空") List<String> ids) {
|
public CommonResult<Boolean> submitOrder(@RequestBody @Validated @NotEmpty(message = "采购订单id不能为空") List<String> ids) {
|
||||||
System.out.println("ids:"+ids);
|
System.out.println("ids:" + ids);
|
||||||
ids.forEach(id -> purchaseOrderService.submitOrder(Long.valueOf(id)));
|
ids.forEach(id -> purchaseOrderService.submitOrder(Long.valueOf(id)));
|
||||||
return success(true);
|
return success(true);
|
||||||
}
|
}
|
||||||
@@ -141,25 +145,27 @@ public class PurchaseOrderController implements BusinessControllerMarker {
|
|||||||
@Operation(summary = "推送ERP订单", description = "061')")
|
@Operation(summary = "推送ERP订单", description = "061')")
|
||||||
@PreAuthorize("@ss.hasPermission('bse:purchase-order:update')")
|
@PreAuthorize("@ss.hasPermission('bse:purchase-order:update')")
|
||||||
public CommonResult<?> submitErp061(@RequestBody @Validated @NotEmpty(message = "采购订单id不能为空") List<Long> ids) {
|
public CommonResult<?> submitErp061(@RequestBody @Validated @NotEmpty(message = "采购订单id不能为空") List<Long> ids) {
|
||||||
return success( purchaseOrderService.submitErp061(ids));
|
return success(purchaseOrderService.submitErp061(ids));
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/submit-erp062")
|
@PostMapping("/submit-erp062")
|
||||||
@Operation(summary = "推送ERP订单", description = "062当每次调更新接口后都需要调此接口")
|
@Operation(summary = "推送ERP订单", description = "062当每次调更新接口后都需要调此接口")
|
||||||
@PreAuthorize("@ss.hasPermission('bse:purchase-order:update')")
|
@PreAuthorize("@ss.hasPermission('bse:purchase-order:update')")
|
||||||
public CommonResult<?> submitErp062(@RequestParam @Validated @NotNull(message = "采购订单id不能为空") Long id) {
|
public CommonResult<?> submitErp062(@RequestParam @Validated @NotNull(message = "采购订单id不能为空") Long id) {
|
||||||
return success( purchaseOrderService.submitErp062(id));
|
return success(purchaseOrderService.submitErp062(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
//通过订单号查询订单信息
|
//通过订单号查询订单信息
|
||||||
@PostMapping("/get-order-by-order-no")
|
@PostMapping("/get-order-by-order-no")
|
||||||
@Operation(summary = "通过订单号查询订单信息", description = "通过订单号查询订单信息")
|
@Operation(summary = "通过订单号查询订单信息", description = "通过订单号查询订单信息")
|
||||||
public CommonResult<List<PurchaseOrderDetailsRespVO>> getOrderByOrderNo(@RequestBody @Validated @NotEmpty(message = "采购订单不能为空") List<String> orderNos){
|
public CommonResult<List<PurchaseOrderDetailsRespVO>> getOrderByOrderNo(@RequestBody @Validated @NotEmpty(message = "采购订单不能为空") List<String> orderNos) {
|
||||||
return success(purchaseOrderService.getOrderByOrderNo(orderNos));
|
return success(purchaseOrderService.getOrderByOrderNo(orderNos));
|
||||||
}
|
}
|
||||||
|
|
||||||
//根据订单id修改订单状态
|
//根据订单id修改订单状态
|
||||||
@PutMapping("/update-order-status")
|
@PutMapping("/update-order-status")
|
||||||
@Operation(summary = "批量修改订单状态", description = "sts取值于字典名称'采购订单状态',字典类型'PRCH_ORD_STS' 可以根据订单号和订单id修改")
|
@Operation(summary = "批量修改订单状态", description = "sts取值于字典名称'采购订单状态',字典类型'PRCH_ORD_STS' 可以根据订单号和订单id修改")
|
||||||
public CommonResult<Boolean> updateOrderStatus(@RequestBody @Validated PurchaseOrderStsReqVO req){
|
public CommonResult<Boolean> updateOrderStatus(@RequestBody @Validated PurchaseOrderStsReqVO req) {
|
||||||
purchaseOrderService.updateOrderStatusByIdOrOrderNo(req);
|
purchaseOrderService.updateOrderStatusByIdOrOrderNo(req);
|
||||||
return success(true);
|
return success(true);
|
||||||
}
|
}
|
||||||
@@ -168,26 +174,34 @@ public class PurchaseOrderController implements BusinessControllerMarker {
|
|||||||
@GetMapping("/material")
|
@GetMapping("/material")
|
||||||
@Operation(summary = "查询物料接口")
|
@Operation(summary = "查询物料接口")
|
||||||
public CommonResult<MaterialRespVO> getMaterialList(@RequestParam
|
public CommonResult<MaterialRespVO> getMaterialList(@RequestParam
|
||||||
@Schema(description = "采购订单号")
|
@Schema(description = "采购订单号")
|
||||||
@Validated
|
@Validated
|
||||||
@NotEmpty(message = "采购订单号不能为空")
|
@NotEmpty(message = "采购订单号不能为空")
|
||||||
String orderNo){
|
String orderNo) {
|
||||||
return purchaseOrderService.getMaterial(orderNo);
|
return purchaseOrderService.getMaterial(orderNo);
|
||||||
}
|
}
|
||||||
|
|
||||||
//关联订单
|
//关联订单
|
||||||
@PostMapping("/link-order")
|
@PostMapping("/link-order")
|
||||||
@Operation(summary = "关联订单")
|
@Operation(summary = "关联订单")
|
||||||
public CommonResult<Boolean> linkOrder(@RequestBody @Validated LinkOrderReqVO req){
|
public CommonResult<Boolean> linkOrder(@RequestBody @Validated LinkOrderReqVO req) {
|
||||||
return success(purchaseOrderService.linkOrder(req));
|
return success(purchaseOrderService.linkOrder(req));
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/order-pass-reject")
|
@PostMapping("/order-pass-reject")
|
||||||
@Operation(summary = "订单审核")
|
@Operation(summary = "订单审核")
|
||||||
public CommonResult<Boolean> orderPassReject(@RequestBody PurchaseorderReqVO reqVO){
|
public CommonResult<Boolean> orderPassReject(@RequestBody PurchaseorderReqVO reqVO) {
|
||||||
return success(purchaseOrderService.orderPassReject(reqVO));
|
return success(purchaseOrderService.orderPassReject(reqVO));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//根据订单id和方式获取上或下游订单
|
||||||
|
@PostMapping("/order-by-order-id-and-type")
|
||||||
|
@Operation(summary = "根据订单id和方式获取上或下游订单")
|
||||||
|
public CommonResult<Map<String, Object>> getOrderByOrderIdAndType(@RequestBody DownOrUpOrderReqVO reqVO) {
|
||||||
|
Map<String, Object> map = new HashMap<>();
|
||||||
|
map.put("unBindOrder", purchaseOrderService.getOrderByOrderIdAndType(reqVO));
|
||||||
|
map.put("bindOrder", purchaseOrderService.getBindOrderByOrder(reqVO));
|
||||||
|
return success(map);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import jakarta.validation.constraints.NotEmpty;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Schema(description = "上下级订单 请求 VO")
|
||||||
|
@Validated
|
||||||
|
public class DownOrUpOrderReqVO {
|
||||||
|
@Schema(description = "订单id")
|
||||||
|
private Long orderId;
|
||||||
|
@Schema(description = "订单类型")
|
||||||
|
@NotEmpty(message = "订单类型不能为空(上游 up ,下游 down)")
|
||||||
|
private String orderType;
|
||||||
|
@Schema(description = "订单号")
|
||||||
|
private String orderNo;
|
||||||
|
}
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
package com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Schema(description = "上下游订单 响应 VO")
|
||||||
|
public class DownOrUpOrderRespVO {
|
||||||
|
/**
|
||||||
|
* 订单编号
|
||||||
|
*/
|
||||||
|
@Schema(description = "订单编号")
|
||||||
|
private String orderNo;
|
||||||
|
/**
|
||||||
|
* 订单ID
|
||||||
|
*/
|
||||||
|
@Schema(description = "订单ID")
|
||||||
|
private String orderId;
|
||||||
|
/**
|
||||||
|
* 订单类型
|
||||||
|
*/
|
||||||
|
@Schema(description = "订单类型")
|
||||||
|
private String orderType;
|
||||||
|
/**
|
||||||
|
* 合同名称
|
||||||
|
*/
|
||||||
|
@Schema(description = "合同名称")
|
||||||
|
private String contractName;
|
||||||
|
/**
|
||||||
|
* 合同id
|
||||||
|
*/
|
||||||
|
@Schema(description = "合同id")
|
||||||
|
private String contractId;
|
||||||
|
/**
|
||||||
|
* 合同号
|
||||||
|
*/
|
||||||
|
@Schema(description = "合同号")
|
||||||
|
private String contractNumber;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -156,4 +156,6 @@ public class PrchOrdDtlPageReqVO extends PageParam {
|
|||||||
@Schema(description = "金属元素编码")
|
@Schema(description = "金属元素编码")
|
||||||
private String elemCdg;
|
private String elemCdg;
|
||||||
|
|
||||||
|
@Schema(description = "订单类型")
|
||||||
|
private String splyBsnTp;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -163,5 +163,7 @@ public class PrchOrdDtlSaveReqVO {
|
|||||||
|
|
||||||
@Schema(description = "金属元素编码")
|
@Schema(description = "金属元素编码")
|
||||||
private String elemCdg;
|
private String elemCdg;
|
||||||
|
@Schema(description = "税点")
|
||||||
|
private String taxRte;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,124 @@
|
|||||||
|
package com.zt.plat.module.contractorder.controller.admin.salesorder;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog;
|
||||||
|
import com.zt.plat.framework.business.interceptor.BusinessControllerMarker;
|
||||||
|
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||||
|
import com.zt.plat.framework.common.pojo.PageParam;
|
||||||
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
|
import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO;
|
||||||
|
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||||
|
import com.zt.plat.framework.excel.core.util.ExcelUtils;
|
||||||
|
import com.zt.plat.module.contractorder.api.ContractApiImpl;
|
||||||
|
import com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo.*;
|
||||||
|
import com.zt.plat.module.contractorder.controller.admin.salesorder.vo.SalesOrderPageReqVO;
|
||||||
|
import com.zt.plat.module.contractorder.controller.admin.salesorder.vo.SalesOrderRespVO;
|
||||||
|
import com.zt.plat.module.contractorder.controller.admin.salesorder.vo.SalesOrderSaveReqVO;
|
||||||
|
import com.zt.plat.module.contractorder.dal.dataobject.salesorder.SalesOrderDO;
|
||||||
|
import com.zt.plat.module.contractorder.service.purchaseorder.PurchaseOrderService;
|
||||||
|
import com.zt.plat.module.contractorder.service.salesorder.SalesOrderService;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
import jakarta.validation.Valid;
|
||||||
|
import jakarta.validation.constraints.NotEmpty;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
|
||||||
|
import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
|
|
||||||
|
@Tag(name = "管理后台 - 销售订单")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/base/sales-order")
|
||||||
|
@Validated
|
||||||
|
public class SalesOrderController implements BusinessControllerMarker {
|
||||||
|
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private SalesOrderService salesOrderService;
|
||||||
|
@Resource
|
||||||
|
private ContractApiImpl contractApi;
|
||||||
|
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
@Operation(summary = "创建采购订单")
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:sales-order:create')")
|
||||||
|
public CommonResult<SalesOrderRespVO> createSalesOrder(@Valid @RequestBody SalesOrderSaveReqVO createReqVO) {
|
||||||
|
return success(salesOrderService.createSalesOrder(createReqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update")
|
||||||
|
@Operation(summary = "更新采购订单")
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:sales-order:update')")
|
||||||
|
public CommonResult<Boolean> updateSalesOrder(@Valid @RequestBody SalesOrderSaveReqVO updateReqVO) {
|
||||||
|
salesOrderService.updateSalesOrder(updateReqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete")
|
||||||
|
@Operation(summary = "删除采购订单")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:sales-order:delete')")
|
||||||
|
public CommonResult<Boolean> deleteSalesOrder(@RequestParam("id") Long id) {
|
||||||
|
salesOrderService.deleteSalesOrder(id);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete-list")
|
||||||
|
@Parameter(name = "ids", description = "编号", required = true)
|
||||||
|
@Operation(summary = "批量删除采购订单")
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:sales-order:delete')")
|
||||||
|
public CommonResult<Boolean> deleteSalesOrderList(@RequestBody BatchDeleteReqVO req) {
|
||||||
|
salesOrderService.deleteSalesOrderListByIds(req.getIds());
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get")
|
||||||
|
@Operation(summary = "获得采购订单")
|
||||||
|
@Parameter(name = "id", description = "id是订单主键,splyBsnTp是订单类型采购或者是消费", required = true, example = "1024")
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:sales-order:query')")
|
||||||
|
public CommonResult<SalesOrderRespVO> getSalesOrder(@RequestParam("id") Long id,@RequestParam(value = "splyBsnTp",required = false) String splyBsnTp) {
|
||||||
|
SalesOrderDO purchaseOrder = salesOrderService.getSalesOrder(id, splyBsnTp);
|
||||||
|
SalesOrderRespVO salesOrderRespVO = BeanUtils.toBean(purchaseOrder, SalesOrderRespVO.class);
|
||||||
|
if (salesOrderRespVO == null){
|
||||||
|
return success(null);
|
||||||
|
}
|
||||||
|
//
|
||||||
|
return success(salesOrderRespVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/page")
|
||||||
|
@Operation(summary = "获得采购订单分页")
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:sales-order:query')")
|
||||||
|
public CommonResult<PageResult<SalesOrderRespVO>> getSalesOrderPage(@Valid SalesOrderPageReqVO pageReqVO) {
|
||||||
|
PageResult<SalesOrderDO> pageResult = salesOrderService.getSalesOrderPage(pageReqVO);
|
||||||
|
PageResult<SalesOrderRespVO> purchaseOrderRespVOPageResult = BeanUtils.toBean(pageResult, SalesOrderRespVO.class);
|
||||||
|
// purchaseOrderRespVOPageResult.getList().forEach(purchaseOrderRespVO -> salesOrderService.setOrderDetails(purchaseOrderRespVO));
|
||||||
|
return success(purchaseOrderRespVOPageResult);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/export-excel")
|
||||||
|
@Operation(summary = "导出采购订单 Excel")
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:sales-order:export')")
|
||||||
|
@ApiAccessLog(operateType = EXPORT)
|
||||||
|
public void exportSalesOrderExcel(@Valid SalesOrderPageReqVO pageReqVO,
|
||||||
|
HttpServletResponse response) throws IOException {
|
||||||
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||||
|
List<SalesOrderDO> list = salesOrderService.getSalesOrderPage(pageReqVO).getList();
|
||||||
|
// 导出 Excel
|
||||||
|
ExcelUtils.write(response, "采购订单.xls", "数据", PurchaseOrderRespVO.class,
|
||||||
|
BeanUtils.toBean(list, PurchaseOrderRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,118 @@
|
|||||||
|
package com.zt.plat.module.contractorder.controller.admin.salesorder;
|
||||||
|
|
||||||
|
import com.zt.plat.module.contractorder.controller.admin.salesorder.vo.SalesOrderDetailPageReqVO;
|
||||||
|
import com.zt.plat.module.contractorder.controller.admin.salesorder.vo.SalesOrderDetailRespVO;
|
||||||
|
import com.zt.plat.module.contractorder.controller.admin.salesorder.vo.SalesOrderDetailSaveReqVO;
|
||||||
|
import com.zt.plat.module.contractorder.dal.dataobject.salesorder.SalesOrderDetailDO;
|
||||||
|
import com.zt.plat.module.contractorder.service.salesorder.SalesOrderDetailService;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import com.zt.plat.framework.business.interceptor.BusinessControllerMarker;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
|
||||||
|
import jakarta.validation.constraints.*;
|
||||||
|
import jakarta.validation.*;
|
||||||
|
import jakarta.servlet.http.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO;
|
||||||
|
import com.zt.plat.framework.common.pojo.PageParam;
|
||||||
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
|
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||||
|
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||||
|
import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.excel.core.util.ExcelUtils;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog;
|
||||||
|
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Tag(name = "管理后台 - 销售订单明细")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/base/sales-order-detail")
|
||||||
|
@Validated
|
||||||
|
public class SalesOrderDetailController implements BusinessControllerMarker {
|
||||||
|
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private SalesOrderDetailService salesOrderDetailService;
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
@Operation(summary = "创建销售订单明细")
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:sales-order-detail:create')")
|
||||||
|
public CommonResult<SalesOrderDetailRespVO> createSalesOrderDetail(@Valid @RequestBody SalesOrderDetailSaveReqVO createReqVO) {
|
||||||
|
return success(salesOrderDetailService.createSalesOrderDetail(createReqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/create-batch")
|
||||||
|
@Operation(summary = "批量创建销售订单明细")
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:sales-order-detail:create')")
|
||||||
|
public CommonResult<List<SalesOrderDetailRespVO>> createSalesOrderDetail(@Valid @NotEmpty(message = "需要保存的数据为空") @RequestBody List<SalesOrderDetailSaveReqVO> createReqVOS) {
|
||||||
|
return success(salesOrderDetailService.createSalesOrderDetail(createReqVOS));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update")
|
||||||
|
@Operation(summary = "更新销售订单明细")
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:sales-order-detail:update')")
|
||||||
|
public CommonResult<Boolean> updateSalesOrderDetail(@Valid @RequestBody SalesOrderDetailSaveReqVO updateReqVO) {
|
||||||
|
salesOrderDetailService.updateSalesOrderDetail(updateReqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete")
|
||||||
|
@Operation(summary = "删除销售订单明细")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:sales-order-detail:delete')")
|
||||||
|
public CommonResult<Boolean> deleteSalesOrderDetail(@RequestParam("id") Long id) {
|
||||||
|
salesOrderDetailService.deleteSalesOrderDetail(id);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete-list")
|
||||||
|
@Parameter(name = "ids", description = "编号", required = true)
|
||||||
|
@Operation(summary = "批量删除销售订单明细")
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:sales-order-detail:delete')")
|
||||||
|
public CommonResult<Boolean> deleteSalesOrderDetailList(@RequestBody BatchDeleteReqVO req) {
|
||||||
|
salesOrderDetailService.deleteSalesOrderDetailListByIds(req.getIds());
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get")
|
||||||
|
@Operation(summary = "获得销售订单明细")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:sales-order-detail:query')")
|
||||||
|
public CommonResult<SalesOrderDetailRespVO> getSalesOrderDetail(@RequestParam("id") Long id) {
|
||||||
|
SalesOrderDetailDO salesOrderDetail = salesOrderDetailService.getSalesOrderDetail(id);
|
||||||
|
return success(BeanUtils.toBean(salesOrderDetail, SalesOrderDetailRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/page")
|
||||||
|
@Operation(summary = "获得销售订单明细分页")
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:sales-order-detail:query')")
|
||||||
|
public CommonResult<PageResult<SalesOrderDetailRespVO>> getSalesOrderDetailPage(@Valid SalesOrderDetailPageReqVO pageReqVO) {
|
||||||
|
PageResult<SalesOrderDetailDO> pageResult = salesOrderDetailService.getSalesOrderDetailPage(pageReqVO);
|
||||||
|
return success(BeanUtils.toBean(pageResult, SalesOrderDetailRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/export-excel")
|
||||||
|
@Operation(summary = "导出销售订单明细 Excel")
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:sales-order-detail:export')")
|
||||||
|
@ApiAccessLog(operateType = EXPORT)
|
||||||
|
public void exportSalesOrderDetailExcel(@Valid SalesOrderDetailPageReqVO pageReqVO,
|
||||||
|
HttpServletResponse response) throws IOException {
|
||||||
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||||
|
List<SalesOrderDetailDO> list = salesOrderDetailService.getSalesOrderDetailPage(pageReqVO).getList();
|
||||||
|
// 导出 Excel
|
||||||
|
ExcelUtils.write(response, "销售订单明细.xls", "数据", SalesOrderDetailRespVO.class,
|
||||||
|
BeanUtils.toBean(list, SalesOrderDetailRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,194 @@
|
|||||||
|
package com.zt.plat.module.contractorder.controller.admin.salesorder.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class SaleOrderDetailsRespVO {
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* ERP订单号
|
||||||
|
*/
|
||||||
|
private String orderSAPNumber;
|
||||||
|
/**
|
||||||
|
* 订单号
|
||||||
|
*/
|
||||||
|
private String systemOrderNumber;
|
||||||
|
/**
|
||||||
|
* 公司名称
|
||||||
|
*/
|
||||||
|
private String cpName;
|
||||||
|
/**
|
||||||
|
* 公司编码;推送ERP(必须)
|
||||||
|
*/
|
||||||
|
private String companyNumber;
|
||||||
|
/**
|
||||||
|
* 客商编码;推送ERP(必须)
|
||||||
|
*/
|
||||||
|
private String supplierNumber;
|
||||||
|
/**
|
||||||
|
* 客商名称
|
||||||
|
*/
|
||||||
|
private String supplierName;
|
||||||
|
/**
|
||||||
|
* 订单类型(字典:PRCH_ORD_TP);推送ERP(必须)
|
||||||
|
*/
|
||||||
|
private String type;
|
||||||
|
/**
|
||||||
|
* 凭证日期;推送ERP(必须)
|
||||||
|
*/
|
||||||
|
private LocalDateTime voucherDate;
|
||||||
|
/**
|
||||||
|
* 采购组织编码;推送ERP(必须)
|
||||||
|
*/
|
||||||
|
private String purchaseOrganizationCustomsDeclaration;
|
||||||
|
/**
|
||||||
|
* 收货工厂名称
|
||||||
|
*/
|
||||||
|
private String receiveFactoryName;
|
||||||
|
/**
|
||||||
|
* 收货工厂编码;推送ERP(必须)
|
||||||
|
*/
|
||||||
|
private String receiveFactoryNumber;
|
||||||
|
/**
|
||||||
|
* 收货库位名称
|
||||||
|
*/
|
||||||
|
private String receiveWarehouseName;
|
||||||
|
/**
|
||||||
|
* 收货库位编码;推送ERP
|
||||||
|
*/
|
||||||
|
private String receiveWarehouseNumber;
|
||||||
|
/**
|
||||||
|
* 采购组编码(字典:PRCH_GRP_TP);推送ERP(必须)
|
||||||
|
*/
|
||||||
|
private String purchaseGroup;
|
||||||
|
/**
|
||||||
|
* 货币码(字典:CUR);推送ERP(必须)
|
||||||
|
*/
|
||||||
|
private String currencyNumber;
|
||||||
|
/**
|
||||||
|
* 汇率;推送ERP
|
||||||
|
*/
|
||||||
|
private BigDecimal exchangeRate;
|
||||||
|
/**
|
||||||
|
* 合同纸质合同号;推送ERP(必须)
|
||||||
|
*/
|
||||||
|
private String paperContractNumber;
|
||||||
|
/**
|
||||||
|
* 小协议号;推送ERP
|
||||||
|
*/
|
||||||
|
private String agreementNumber;
|
||||||
|
/**
|
||||||
|
* 备注;推送ERP
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
/**
|
||||||
|
* 代理方编码;推送ERP
|
||||||
|
*/
|
||||||
|
private String agentNumber;
|
||||||
|
/**
|
||||||
|
* 代理方名称
|
||||||
|
*/
|
||||||
|
private String agentName;
|
||||||
|
/**
|
||||||
|
* 订单编码
|
||||||
|
*/
|
||||||
|
private String orderNumber;
|
||||||
|
/**
|
||||||
|
* 系统合同编号
|
||||||
|
*/
|
||||||
|
private String contractNumber;
|
||||||
|
/**
|
||||||
|
* 物料编码
|
||||||
|
*/
|
||||||
|
private String materialNumber;
|
||||||
|
/**
|
||||||
|
* 物料名称
|
||||||
|
*/
|
||||||
|
private String materialName;
|
||||||
|
/**
|
||||||
|
* 合同名称
|
||||||
|
*/
|
||||||
|
private String contractName;
|
||||||
|
/**
|
||||||
|
* 小户头号
|
||||||
|
*/
|
||||||
|
private String tenantNumber;
|
||||||
|
/**
|
||||||
|
* ERP公司编号
|
||||||
|
*/
|
||||||
|
private String erpPurchaseCompanyNumber;
|
||||||
|
/**
|
||||||
|
* ERP公司名称
|
||||||
|
*/
|
||||||
|
private String erpPurchaseCompanyName;
|
||||||
|
/**
|
||||||
|
* ERP客商公司编码
|
||||||
|
*/
|
||||||
|
private String erpSalesCompanyNumber;
|
||||||
|
/**
|
||||||
|
* ERP客商公司名称
|
||||||
|
*/
|
||||||
|
private String erpSalesCompanyName;
|
||||||
|
/**
|
||||||
|
* 采购组织名称
|
||||||
|
*/
|
||||||
|
private String purchaseOrganizationName;
|
||||||
|
/**
|
||||||
|
* ERP状态(字典: ERP_REQ_STS)
|
||||||
|
*/
|
||||||
|
private String erpStatus;
|
||||||
|
/**
|
||||||
|
* 请求ERP失败原因
|
||||||
|
*/
|
||||||
|
private String cause;
|
||||||
|
/**
|
||||||
|
* 订单状态(字典:PRCH_ORD_STS)
|
||||||
|
*/
|
||||||
|
|
||||||
|
private String status;
|
||||||
|
/**
|
||||||
|
* 采购组名称
|
||||||
|
*/
|
||||||
|
private String purchaseGroupName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程实例编号
|
||||||
|
*/
|
||||||
|
|
||||||
|
private String processInstanceId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程当前任务节点id
|
||||||
|
*/
|
||||||
|
|
||||||
|
private String taskId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审批意见
|
||||||
|
*/
|
||||||
|
|
||||||
|
private String reviewOpinion;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否需要审批
|
||||||
|
*/
|
||||||
|
private int isPush;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料类型
|
||||||
|
*/
|
||||||
|
private String mtrlTp;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 消费订单行项目
|
||||||
|
*/
|
||||||
|
private List<SalesOrderDetailRespVO> orderDetails;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,90 @@
|
|||||||
|
package com.zt.plat.module.contractorder.controller.admin.salesorder.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import com.zt.plat.framework.common.pojo.PageParam;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 销售订单明细分页 Request VO")
|
||||||
|
@Data
|
||||||
|
public class SalesOrderDetailPageReqVO extends PageParam {
|
||||||
|
|
||||||
|
@Schema(description = "订单主键", example = "9072")
|
||||||
|
private Long orderId;
|
||||||
|
|
||||||
|
@Schema(description = "行项目;推送ERP(必须)")
|
||||||
|
private Long lineNumber;
|
||||||
|
|
||||||
|
@Schema(description = "物料名称", example = "芋艿")
|
||||||
|
private String materialName;
|
||||||
|
|
||||||
|
@Schema(description = "物料编码;推送ERP(必须)")
|
||||||
|
private String materialNumber;
|
||||||
|
|
||||||
|
@Schema(description = "工厂名称", example = "芋艿")
|
||||||
|
private String factoryName;
|
||||||
|
|
||||||
|
@Schema(description = "工厂编码;推送ERP(必须)")
|
||||||
|
private String factoryNumber;
|
||||||
|
|
||||||
|
@Schema(description = "库位名称", example = "赵六")
|
||||||
|
private String warehouseName;
|
||||||
|
|
||||||
|
@Schema(description = "库位编码;推送ERP(必须)")
|
||||||
|
private String warehouseNumber;
|
||||||
|
|
||||||
|
@Schema(description = "计量单位;推送ERP(必须)")
|
||||||
|
private String unit;
|
||||||
|
|
||||||
|
@Schema(description = "开票类型;推送ERP(必须)", example = "2")
|
||||||
|
private String invoiceType;
|
||||||
|
|
||||||
|
@Schema(description = "暂估数量;推送ERP(必须)")
|
||||||
|
private BigDecimal quantity;
|
||||||
|
|
||||||
|
@Schema(description = "稅分类(字典:SALE_TAX);推送ERP(必须)")
|
||||||
|
private String taxAcctasscat;
|
||||||
|
|
||||||
|
@Schema(description = "项目类别;推送ERP")
|
||||||
|
private String projectCategory;
|
||||||
|
|
||||||
|
@Schema(description = "装运地点;推送ERP")
|
||||||
|
private String shippingPlace;
|
||||||
|
|
||||||
|
@Schema(description = "物料科目分配组;推送ERP(必须)")
|
||||||
|
private String metalAcctasscatGroup;
|
||||||
|
|
||||||
|
@Schema(description = "小协议号")
|
||||||
|
private String agreementNumber;
|
||||||
|
|
||||||
|
@Schema(description = "总价")
|
||||||
|
private BigDecimal gross;
|
||||||
|
|
||||||
|
@Schema(description = "金属元素缩写")
|
||||||
|
private String elementAbbreviation;
|
||||||
|
|
||||||
|
@Schema(description = "金属元素名称", example = "张三")
|
||||||
|
private String elementName;
|
||||||
|
|
||||||
|
@Schema(description = "金属元素编码")
|
||||||
|
private String elementNumber;
|
||||||
|
|
||||||
|
@Schema(description = "是否启用;处理明细中多个相同物料,只能允许一种物料启用")
|
||||||
|
private String isEnable;
|
||||||
|
|
||||||
|
@Schema(description = "价格条件详情;推送ERP(必须):JSON")
|
||||||
|
private String priceConditionDetail;
|
||||||
|
|
||||||
|
@Schema(description = "来料加工原料详情;推送ERP:订单类型(JSON)")
|
||||||
|
private String originDetail;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime[] createTime;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,119 @@
|
|||||||
|
package com.zt.plat.module.contractorder.controller.admin.salesorder.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.alibaba.excel.annotation.*;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 销售订单明细 Response VO")
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class SalesOrderDetailRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "28517")
|
||||||
|
@ExcelProperty("主键")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "订单主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "9072")
|
||||||
|
@ExcelProperty("订单主键")
|
||||||
|
private Long orderId;
|
||||||
|
|
||||||
|
@Schema(description = "行项目;推送ERP(必须)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("行项目;推送ERP(必须)")
|
||||||
|
private Long lineNumber;
|
||||||
|
|
||||||
|
@Schema(description = "物料名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
|
||||||
|
@ExcelProperty("物料名称")
|
||||||
|
private String materialName;
|
||||||
|
|
||||||
|
@Schema(description = "物料编码;推送ERP(必须)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("物料编码;推送ERP(必须)")
|
||||||
|
private String materialNumber;
|
||||||
|
|
||||||
|
@Schema(description = "工厂名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
|
||||||
|
@ExcelProperty("工厂名称")
|
||||||
|
private String factoryName;
|
||||||
|
|
||||||
|
@Schema(description = "工厂编码;推送ERP(必须)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("工厂编码;推送ERP(必须)")
|
||||||
|
private String factoryNumber;
|
||||||
|
|
||||||
|
@Schema(description = "库位名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六")
|
||||||
|
@ExcelProperty("库位名称")
|
||||||
|
private String warehouseName;
|
||||||
|
|
||||||
|
@Schema(description = "库位编码;推送ERP(必须)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("库位编码;推送ERP(必须)")
|
||||||
|
private String warehouseNumber;
|
||||||
|
|
||||||
|
@Schema(description = "计量单位;推送ERP(必须)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("计量单位;推送ERP(必须)")
|
||||||
|
private String unit;
|
||||||
|
|
||||||
|
@Schema(description = "开票类型;推送ERP(必须)", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||||
|
@ExcelProperty("开票类型;推送ERP(必须)")
|
||||||
|
private String invoiceType;
|
||||||
|
|
||||||
|
@Schema(description = "暂估数量;推送ERP(必须)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("暂估数量;推送ERP(必须)")
|
||||||
|
private BigDecimal quantity;
|
||||||
|
|
||||||
|
@Schema(description = "稅分类(字典:SALE_TAX);推送ERP(必须)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("稅分类(字典:SALE_TAX);推送ERP(必须)")
|
||||||
|
private String taxAcctasscat;
|
||||||
|
|
||||||
|
@Schema(description = "项目类别;推送ERP")
|
||||||
|
@ExcelProperty("项目类别;推送ERP")
|
||||||
|
private String projectCategory;
|
||||||
|
|
||||||
|
@Schema(description = "装运地点;推送ERP")
|
||||||
|
@ExcelProperty("装运地点;推送ERP")
|
||||||
|
private String shippingPlace;
|
||||||
|
|
||||||
|
@Schema(description = "物料科目分配组;推送ERP(必须)")
|
||||||
|
@ExcelProperty("物料科目分配组;推送ERP(必须)")
|
||||||
|
private String metalAcctasscatGroup;
|
||||||
|
|
||||||
|
@Schema(description = "小协议号")
|
||||||
|
@ExcelProperty("小协议号")
|
||||||
|
private String agreementNumber;
|
||||||
|
|
||||||
|
@Schema(description = "总价")
|
||||||
|
@ExcelProperty("总价")
|
||||||
|
private BigDecimal gross;
|
||||||
|
|
||||||
|
@Schema(description = "金属元素缩写")
|
||||||
|
@ExcelProperty("金属元素缩写")
|
||||||
|
private String elementAbbreviation;
|
||||||
|
|
||||||
|
@Schema(description = "金属元素名称", example = "张三")
|
||||||
|
@ExcelProperty("金属元素名称")
|
||||||
|
private String elementName;
|
||||||
|
|
||||||
|
@Schema(description = "金属元素编码")
|
||||||
|
@ExcelProperty("金属元素编码")
|
||||||
|
private String elementNumber;
|
||||||
|
|
||||||
|
@Schema(description = "是否启用;处理明细中多个相同物料,只能允许一种物料启用", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("是否启用;处理明细中多个相同物料,只能允许一种物料启用")
|
||||||
|
private String isEnable;
|
||||||
|
|
||||||
|
@Schema(description = "价格条件详情;推送ERP(必须):JSON", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("价格条件详情;推送ERP(必须):JSON")
|
||||||
|
private String priceConditionDetail;
|
||||||
|
|
||||||
|
@Schema(description = "来料加工原料详情;推送ERP:订单类型(JSON)")
|
||||||
|
@ExcelProperty("来料加工原料详情;推送ERP:订单类型(JSON)")
|
||||||
|
private String originDetail;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("创建时间")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
@Schema(description = "税率", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
private String taxRte;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,102 @@
|
|||||||
|
package com.zt.plat.module.contractorder.controller.admin.salesorder.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import jakarta.validation.constraints.*;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 销售订单明细新增/修改 Request VO")
|
||||||
|
@Data
|
||||||
|
public class SalesOrderDetailSaveReqVO {
|
||||||
|
|
||||||
|
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "28517")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "订单主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "9072")
|
||||||
|
@NotNull(message = "订单主键不能为空")
|
||||||
|
private Long orderId;
|
||||||
|
|
||||||
|
@Schema(description = "行项目;推送ERP(必须)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotNull(message = "行项目;推送ERP(必须)不能为空")
|
||||||
|
private Long lineNumber;
|
||||||
|
|
||||||
|
@Schema(description = "物料名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
|
||||||
|
@NotEmpty(message = "物料名称不能为空")
|
||||||
|
private String materialName;
|
||||||
|
|
||||||
|
@Schema(description = "物料编码;推送ERP(必须)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotEmpty(message = "物料编码;推送ERP(必须)不能为空")
|
||||||
|
private String materialNumber;
|
||||||
|
|
||||||
|
@Schema(description = "工厂名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
|
||||||
|
@NotEmpty(message = "工厂名称不能为空")
|
||||||
|
private String factoryName;
|
||||||
|
|
||||||
|
@Schema(description = "工厂编码;推送ERP(必须)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotEmpty(message = "工厂编码;推送ERP(必须)不能为空")
|
||||||
|
private String factoryNumber;
|
||||||
|
|
||||||
|
@Schema(description = "库位名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六")
|
||||||
|
@NotEmpty(message = "库位名称不能为空")
|
||||||
|
private String warehouseName;
|
||||||
|
|
||||||
|
@Schema(description = "库位编码;推送ERP(必须)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotEmpty(message = "库位编码;推送ERP(必须)不能为空")
|
||||||
|
private String warehouseNumber;
|
||||||
|
|
||||||
|
@Schema(description = "计量单位;推送ERP(必须)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotEmpty(message = "计量单位;推送ERP(必须)不能为空")
|
||||||
|
private String unit;
|
||||||
|
|
||||||
|
@Schema(description = "开票类型;推送ERP(必须)", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||||
|
@NotEmpty(message = "开票类型;推送ERP(必须)不能为空")
|
||||||
|
private String invoiceType;
|
||||||
|
|
||||||
|
@Schema(description = "暂估数量;推送ERP(必须)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotNull(message = "暂估数量;推送ERP(必须)不能为空")
|
||||||
|
private BigDecimal quantity;
|
||||||
|
|
||||||
|
@Schema(description = "稅分类(字典:SALE_TAX);推送ERP(必须)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotEmpty(message = "稅分类(字典:SALE_TAX);推送ERP(必须)不能为空")
|
||||||
|
private String taxAcctasscat;
|
||||||
|
|
||||||
|
@Schema(description = "项目类别;推送ERP")
|
||||||
|
private String projectCategory;
|
||||||
|
|
||||||
|
@Schema(description = "装运地点;推送ERP")
|
||||||
|
private String shippingPlace;
|
||||||
|
|
||||||
|
@Schema(description = "物料科目分配组;推送ERP(必须)")
|
||||||
|
private String metalAcctasscatGroup;
|
||||||
|
|
||||||
|
@Schema(description = "小协议号")
|
||||||
|
private String agreementNumber;
|
||||||
|
|
||||||
|
@Schema(description = "总价")
|
||||||
|
private BigDecimal gross;
|
||||||
|
|
||||||
|
@Schema(description = "金属元素缩写")
|
||||||
|
private String elementAbbreviation;
|
||||||
|
|
||||||
|
@Schema(description = "金属元素名称", example = "张三")
|
||||||
|
private String elementName;
|
||||||
|
|
||||||
|
@Schema(description = "金属元素编码")
|
||||||
|
private String elementNumber;
|
||||||
|
|
||||||
|
@Schema(description = "是否启用;处理明细中多个相同物料,只能允许一种物料启用", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotEmpty(message = "是否启用;处理明细中多个相同物料,只能允许一种物料启用不能为空")
|
||||||
|
private String isEnable;
|
||||||
|
|
||||||
|
@Schema(description = "价格条件详情;推送ERP(必须):JSON", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotEmpty(message = "价格条件详情;推送ERP(必须):JSON不能为空")
|
||||||
|
private String priceConditionDetail;
|
||||||
|
|
||||||
|
@Schema(description = "来料加工原料详情;推送ERP:订单类型(JSON)")
|
||||||
|
private String originDetail;
|
||||||
|
|
||||||
|
@Schema(description = "税率")
|
||||||
|
private String taxRte;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,137 @@
|
|||||||
|
package com.zt.plat.module.contractorder.controller.admin.salesorder.vo;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.common.pojo.PageParam;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 采购订单分页 Request VO")
|
||||||
|
@Data
|
||||||
|
public class SalesOrderPageReqVO extends PageParam {
|
||||||
|
|
||||||
|
@Schema(description = "ERP订单号")
|
||||||
|
private String orderSAPNumber;
|
||||||
|
|
||||||
|
@Schema(description = "订单号")
|
||||||
|
private String systemOrderNumber;
|
||||||
|
|
||||||
|
@Schema(description = "公司编码;推送ERP(必须)")
|
||||||
|
private String companyNumber;
|
||||||
|
|
||||||
|
@Schema(description = "客商编码;推送ERP(必须)")
|
||||||
|
private String supplierNumber;
|
||||||
|
|
||||||
|
@Schema(description = "客商名称", example = "芋艿")
|
||||||
|
private String supplierName;
|
||||||
|
|
||||||
|
@Schema(description = "订单类型(字典:PRCH_ORD_TP);推送ERP(必须)", example = "2")
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
@Schema(description = "凭证日期;推送ERP(必须)")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime[] voucherDate;
|
||||||
|
|
||||||
|
@Schema(description = "采购组织编码;推送ERP(必须)")
|
||||||
|
private String purchaseOrganizationCustomsDeclaration;
|
||||||
|
|
||||||
|
@Schema(description = "收货工厂名称", example = "芋艿")
|
||||||
|
private String receiveFactoryName;
|
||||||
|
|
||||||
|
@Schema(description = "收货工厂编码;推送ERP(必须)")
|
||||||
|
private String receiveFactoryNumber;
|
||||||
|
|
||||||
|
@Schema(description = "收货库位名称", example = "王五")
|
||||||
|
private String receiveWarehouseName;
|
||||||
|
|
||||||
|
@Schema(description = "收货库位编码;推送ERP")
|
||||||
|
private String receiveWarehouseNumber;
|
||||||
|
|
||||||
|
@Schema(description = "采购组编码(字典:PRCH_GRP_TP);推送ERP(必须)")
|
||||||
|
private String purchaseGroup;
|
||||||
|
|
||||||
|
@Schema(description = "计量单位")
|
||||||
|
private String unt;
|
||||||
|
|
||||||
|
@Schema(description = "货币码(字典:CUR);推送ERP(必须)")
|
||||||
|
private String currencyNumber;
|
||||||
|
|
||||||
|
@Schema(description = "汇率;推送ERP")
|
||||||
|
private BigDecimal exchangeRate;
|
||||||
|
|
||||||
|
@Schema(description = "合同纸质合同号;推送ERP(必须)")
|
||||||
|
private String paperContractNumber;
|
||||||
|
|
||||||
|
@Schema(description = "小协议号;推送ERP")
|
||||||
|
private String agreementNumber;
|
||||||
|
|
||||||
|
@Schema(description = "备注;推送ERP")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@Schema(description = "代理方编码;推送ERP")
|
||||||
|
private String agentNumber;
|
||||||
|
|
||||||
|
@Schema(description = "代理方名称", example = "张三")
|
||||||
|
private String agentName;
|
||||||
|
|
||||||
|
@Schema(description = "订单编码")
|
||||||
|
private String orderNumber;
|
||||||
|
|
||||||
|
@Schema(description = "系统合同编号")
|
||||||
|
private String contractNumber;
|
||||||
|
|
||||||
|
@Schema(description = "物料编码")
|
||||||
|
private String materialNumber;
|
||||||
|
|
||||||
|
@Schema(description = "物料名称", example = "王五")
|
||||||
|
private String materialName;
|
||||||
|
|
||||||
|
@Schema(description = "合同名称", example = "赵六")
|
||||||
|
private String contractName;
|
||||||
|
|
||||||
|
@Schema(description = "小户头号")
|
||||||
|
private String tenantNumber;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime[] createTime;
|
||||||
|
|
||||||
|
@Schema(description = "ERP公司编号")
|
||||||
|
private String erpPurchaseCompanyNumber;
|
||||||
|
|
||||||
|
@Schema(description = "ERP公司名称", example = "王五")
|
||||||
|
private String erpPurchaseCompanyName;
|
||||||
|
|
||||||
|
@Schema(description = "ERP客商公司编码")
|
||||||
|
private String erpSalesCompanyNumber;
|
||||||
|
|
||||||
|
@Schema(description = "ERP客商公司名称", example = "芋艿")
|
||||||
|
private String erpSalesCompanyName;
|
||||||
|
|
||||||
|
@Schema(description = "采购组织名称", example = "赵六")
|
||||||
|
private String purchaseOrganizationName;
|
||||||
|
|
||||||
|
@Schema(description = "ERP状态(字典: ERP_REQ_STS)", example = "2")
|
||||||
|
private String erpStatus;
|
||||||
|
|
||||||
|
@Schema(description = "请求ERP失败原因")
|
||||||
|
private String cause;
|
||||||
|
|
||||||
|
@Schema(description = "订单状态(字典:PRCH_ORD_STS)", example = "2")
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
@Schema(description = "采购组名称", example = "张三")
|
||||||
|
private String purchaseGroupName;
|
||||||
|
|
||||||
|
@Schema(description = "物料类型(字典:MTRL_TP)", example = "2")
|
||||||
|
private String mtrlTp;
|
||||||
|
|
||||||
|
@Schema(description = "订单分类")
|
||||||
|
private String splyBsnTp;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
package com.zt.plat.module.contractorder.controller.admin.salesorder.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import jakarta.validation.constraints.NotBlank;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 订单审核请求对象 Request VO")
|
||||||
|
@Data
|
||||||
|
public class SalesOrderReqVO {
|
||||||
|
|
||||||
|
@Schema(description = "合同主键ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotNull(message = "合同主键ID不能为空")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "审批意见", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotBlank(message = "审核意见不能为空")
|
||||||
|
private String reviewOpinion;
|
||||||
|
|
||||||
|
@Schema(description = "状态:待推送 WAIT_PUSH,已驳回 REJECTED", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotBlank(message = "审核状态不能为空")
|
||||||
|
private String status;
|
||||||
|
}
|
||||||
@@ -0,0 +1,201 @@
|
|||||||
|
package com.zt.plat.module.contractorder.controller.admin.salesorder.vo;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
import com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo.PrchOrdDtlRespVO;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 采购订单 Response VO")
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class SalesOrderRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "6074")
|
||||||
|
@ExcelProperty("主键")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "ERP订单号")
|
||||||
|
@ExcelProperty("ERP订单号")
|
||||||
|
private String orderSAPNumber;
|
||||||
|
|
||||||
|
@Schema(description = "订单号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("订单号")
|
||||||
|
private String systemOrderNumber;
|
||||||
|
|
||||||
|
@Schema(description = "公司编码;推送ERP(必须)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("公司编码;推送ERP(必须)")
|
||||||
|
private String companyNumber;
|
||||||
|
|
||||||
|
@Schema(description = "客商编码;推送ERP(必须)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("客商编码;推送ERP(必须)")
|
||||||
|
private String supplierNumber;
|
||||||
|
|
||||||
|
@Schema(description = "客商名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
|
||||||
|
@ExcelProperty("客商名称")
|
||||||
|
private String supplierName;
|
||||||
|
|
||||||
|
@Schema(description = "订单类型(字典:PRCH_ORD_TP);推送ERP(必须)", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||||
|
@ExcelProperty("订单类型(字典:PRCH_ORD_TP);推送ERP(必须)")
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
@Schema(description = "凭证日期;推送ERP(必须)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("凭证日期;推送ERP(必须)")
|
||||||
|
private LocalDateTime voucherDate;
|
||||||
|
|
||||||
|
@Schema(description = "采购组织编码;推送ERP(必须)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("采购组织编码;推送ERP(必须)")
|
||||||
|
private String purchaseOrganizationCustomsDeclaration;
|
||||||
|
|
||||||
|
@Schema(description = "收货工厂名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
|
||||||
|
@ExcelProperty("收货工厂名称")
|
||||||
|
private String receiveFactoryName;
|
||||||
|
|
||||||
|
@Schema(description = "收货工厂编码;推送ERP(必须)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("收货工厂编码;推送ERP(必须)")
|
||||||
|
private String receiveFactoryNumber;
|
||||||
|
|
||||||
|
@Schema(description = "收货库位名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
|
||||||
|
@ExcelProperty("收货库位名称")
|
||||||
|
private String receiveWarehouseName;
|
||||||
|
|
||||||
|
@Schema(description = "收货库位编码;推送ERP", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("收货库位编码;推送ERP")
|
||||||
|
private String receiveWarehouseNumber;
|
||||||
|
|
||||||
|
@Schema(description = "计量单位")
|
||||||
|
private String unt;
|
||||||
|
|
||||||
|
@Schema(description = "采购组编码(字典:PRCH_GRP_TP);推送ERP(必须)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("采购组编码(字典:PRCH_GRP_TP);推送ERP(必须)")
|
||||||
|
private String purchaseGroup;
|
||||||
|
|
||||||
|
@Schema(description = "货币码(字典:CUR);推送ERP(必须)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("货币码(字典:CUR);推送ERP(必须)")
|
||||||
|
private String currencyNumber;
|
||||||
|
|
||||||
|
@Schema(description = "汇率;推送ERP")
|
||||||
|
@ExcelProperty("汇率;推送ERP")
|
||||||
|
private BigDecimal exchangeRate;
|
||||||
|
|
||||||
|
@Schema(description = "合同纸质合同号;推送ERP(必须)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("合同纸质合同号;推送ERP(必须)")
|
||||||
|
private String paperContractNumber;
|
||||||
|
|
||||||
|
@Schema(description = "小协议号;推送ERP")
|
||||||
|
@ExcelProperty("小协议号;推送ERP")
|
||||||
|
private String agreementNumber;
|
||||||
|
|
||||||
|
@Schema(description = "备注;推送ERP")
|
||||||
|
@ExcelProperty("备注;推送ERP")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@Schema(description = "代理方编码;推送ERP")
|
||||||
|
@ExcelProperty("代理方编码;推送ERP")
|
||||||
|
private String agentNumber;
|
||||||
|
|
||||||
|
@Schema(description = "代理方名称", example = "张三")
|
||||||
|
@ExcelProperty("代理方名称")
|
||||||
|
private String agentName;
|
||||||
|
|
||||||
|
@Schema(description = "订单编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("订单编码")
|
||||||
|
private String orderNumber;
|
||||||
|
|
||||||
|
@Schema(description = "系统合同编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("系统合同编号")
|
||||||
|
private String contractNumber;
|
||||||
|
|
||||||
|
@Schema(description = "物料编码")
|
||||||
|
@ExcelProperty("物料编码")
|
||||||
|
private String materialNumber;
|
||||||
|
|
||||||
|
@Schema(description = "物料名称", example = "王五")
|
||||||
|
@ExcelProperty("物料名称")
|
||||||
|
private String materialName;
|
||||||
|
|
||||||
|
@Schema(description = "合同名称", example = "赵六")
|
||||||
|
@ExcelProperty("合同名称")
|
||||||
|
private String contractName;
|
||||||
|
|
||||||
|
@Schema(description = "小户头号")
|
||||||
|
@ExcelProperty("小户头号")
|
||||||
|
private String tenantNumber;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("创建时间")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
@Schema(description = "ERP公司编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("ERP公司编号")
|
||||||
|
private String erpPurchaseCompanyNumber;
|
||||||
|
|
||||||
|
@Schema(description = "ERP公司名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
|
||||||
|
@ExcelProperty("ERP公司名称")
|
||||||
|
private String erpPurchaseCompanyName;
|
||||||
|
|
||||||
|
@Schema(description = "ERP客商公司编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("ERP客商公司编码")
|
||||||
|
private String erpSalesCompanyNumber;
|
||||||
|
|
||||||
|
@Schema(description = "ERP客商公司名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
|
||||||
|
@ExcelProperty("ERP客商公司名称")
|
||||||
|
private String erpSalesCompanyName;
|
||||||
|
|
||||||
|
@Schema(description = "采购组织名称", example = "赵六")
|
||||||
|
@ExcelProperty("采购组织名称")
|
||||||
|
private String purchaseOrganizationName;
|
||||||
|
|
||||||
|
@Schema(description = "ERP状态(字典: ERP_REQ_STS)", example = "2")
|
||||||
|
@ExcelProperty("ERP状态(字典: ERP_REQ_STS)")
|
||||||
|
private String erpStatus;
|
||||||
|
|
||||||
|
@Schema(description = "请求ERP失败原因")
|
||||||
|
@ExcelProperty("请求ERP失败原因")
|
||||||
|
private String cause;
|
||||||
|
|
||||||
|
@Schema(description = "订单状态(字典:PRCH_ORD_STS)", example = "2")
|
||||||
|
@ExcelProperty("订单状态(字典:PRCH_ORD_STS)")
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
@Schema(description = "采购组名称", example = "张三")
|
||||||
|
@ExcelProperty("采购组名称")
|
||||||
|
private String purchaseGroupName;
|
||||||
|
|
||||||
|
@Schema(description = "订单明细")
|
||||||
|
@ExcelProperty("订单明细")
|
||||||
|
private List<PrchOrdDtlRespVO> prchOrdDtlRespVOS;
|
||||||
|
|
||||||
|
@Schema(description = "物料类型(字典:MTRL_TP)", example = "2")
|
||||||
|
@ExcelProperty("物料类型(字典:MTRL_TP)")
|
||||||
|
private String mtrlTp;
|
||||||
|
|
||||||
|
@Schema(description = "订单分类", example = "2")
|
||||||
|
@ExcelProperty("订单分类")
|
||||||
|
private String splyBsnTp;
|
||||||
|
|
||||||
|
@Schema(description = "公司名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
|
||||||
|
@ExcelProperty("公司名称")
|
||||||
|
private String cpName;
|
||||||
|
|
||||||
|
@Schema(description = "是否提交审核,value为0或1")
|
||||||
|
@ExcelProperty("是否提交审核")
|
||||||
|
private int isPush;
|
||||||
|
|
||||||
|
@Schema(description = "流程实例编号")
|
||||||
|
@ExcelProperty("流程实例编号")
|
||||||
|
private String processInstanceId;
|
||||||
|
|
||||||
|
@Schema(description = "流程当前任务节点id")
|
||||||
|
@ExcelProperty("流程当前任务节点id")
|
||||||
|
private String taskId;
|
||||||
|
|
||||||
|
@Schema(description = " 审批意见")
|
||||||
|
@ExcelProperty(" 审批意见")
|
||||||
|
private String reviewOpinion;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,182 @@
|
|||||||
|
package com.zt.plat.module.contractorder.controller.admin.salesorder.vo;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
import com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo.PrchOrdDtlSaveReqVO;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import jakarta.validation.constraints.NotEmpty;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 采购订单新增/修改 Request VO")
|
||||||
|
@Data
|
||||||
|
public class SalesOrderSaveReqVO {
|
||||||
|
|
||||||
|
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "6074")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "公司名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
|
||||||
|
@NotEmpty(message = "公司名称不能为空")
|
||||||
|
private String cpName;
|
||||||
|
|
||||||
|
@Schema(description = "ERP订单号")
|
||||||
|
private String orderSAPNumber;
|
||||||
|
|
||||||
|
// @Schema(description = "订单号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
// @NotEmpty(message = "订单号不能为空")
|
||||||
|
// private String systemOrderNumber;
|
||||||
|
|
||||||
|
@Schema(description = "公司编码;推送ERP(必须)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotEmpty(message = "公司编码;推送ERP(必须)不能为空")
|
||||||
|
private String companyNumber;
|
||||||
|
|
||||||
|
@Schema(description = "客商编码;推送ERP(必须)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotEmpty(message = "客商编码;推送ERP(必须)不能为空")
|
||||||
|
private String supplierNumber;
|
||||||
|
|
||||||
|
@Schema(description = "客商名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
|
||||||
|
@NotEmpty(message = "客商名称不能为空")
|
||||||
|
private String supplierName;
|
||||||
|
|
||||||
|
@Schema(description = "订单类型(字典:PRCH_ORD_TP);推送ERP(必须)", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||||
|
@NotEmpty(message = "订单类型(字典:PRCH_ORD_TP);推送ERP(必须)不能为空")
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
@Schema(description = "凭证日期;推送ERP(必须)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotNull(message = "凭证日期;推送ERP(必须)不能为空")
|
||||||
|
private LocalDateTime voucherDate;
|
||||||
|
|
||||||
|
@Schema(description = "采购组织编码;推送ERP(必须)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotEmpty(message = "采购组织编码;推送ERP(必须)不能为空")
|
||||||
|
private String purchaseOrganizationCustomsDeclaration;
|
||||||
|
|
||||||
|
@Schema(description = "收货工厂名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
|
||||||
|
@NotEmpty(message = "收货工厂名称不能为空")
|
||||||
|
private String receiveFactoryName;
|
||||||
|
|
||||||
|
@Schema(description = "收货工厂编码;推送ERP(必须)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotEmpty(message = "收货工厂编码;推送ERP(必须)不能为空")
|
||||||
|
private String receiveFactoryNumber;
|
||||||
|
|
||||||
|
@Schema(description = "收货库位名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
|
||||||
|
@NotEmpty(message = "收货库位名称不能为空")
|
||||||
|
private String receiveWarehouseName;
|
||||||
|
|
||||||
|
@Schema(description = "收货库位编码;推送ERP", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotEmpty(message = "收货库位编码;推送ERP不能为空")
|
||||||
|
private String receiveWarehouseNumber;
|
||||||
|
|
||||||
|
@Schema(description = "采购组编码(字典:PRCH_GRP_TP);推送ERP(必须)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotEmpty(message = "采购组编码(字典:PRCH_GRP_TP);推送ERP(必须)不能为空")
|
||||||
|
private String purchaseGroup;
|
||||||
|
|
||||||
|
@Schema(description = "货币码(字典:CUR);推送ERP(必须)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotEmpty(message = "货币码(字典:CUR);推送ERP(必须)不能为空")
|
||||||
|
private String currencyNumber;
|
||||||
|
|
||||||
|
@Schema(description = "汇率;推送ERP")
|
||||||
|
private BigDecimal exchangeRate;
|
||||||
|
|
||||||
|
@Schema(description = "合同纸质合同号;推送ERP(必须)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotEmpty(message = "合同纸质合同号;推送ERP(必须)不能为空")
|
||||||
|
private String paperContractNumber;
|
||||||
|
|
||||||
|
@Schema(description = "小协议号;推送ERP")
|
||||||
|
private String agreementNumber;
|
||||||
|
|
||||||
|
@Schema(description = "备注;推送ERP")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@Schema(description = "代理方编码;推送ERP")
|
||||||
|
private String agentNumber;
|
||||||
|
|
||||||
|
@Schema(description = "代理方名称", example = "张三")
|
||||||
|
private String agentName;
|
||||||
|
//
|
||||||
|
// @Schema(description = "订单编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
// @NotEmpty(message = "订单编码不能为空")
|
||||||
|
// private String orderNumber;
|
||||||
|
|
||||||
|
|
||||||
|
@Schema(description = "计量单位")
|
||||||
|
@NotEmpty(message = "计量单位(unt)不能为空")
|
||||||
|
private String unt;
|
||||||
|
|
||||||
|
@Schema(description = "系统合同编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotEmpty(message = "系统合同编号不能为空")
|
||||||
|
private String contractNumber;
|
||||||
|
|
||||||
|
@Schema(description = "物料编码")
|
||||||
|
private String materialNumber;
|
||||||
|
|
||||||
|
@Schema(description = "物料名称", example = "王五")
|
||||||
|
private String materialName;
|
||||||
|
|
||||||
|
@Schema(description = "合同名称", example = "赵六")
|
||||||
|
private String contractName;
|
||||||
|
|
||||||
|
@Schema(description = "小户头号")
|
||||||
|
private String tenantNumber;
|
||||||
|
|
||||||
|
@Schema(description = "ERP公司编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotEmpty(message = "ERP公司编号不能为空")
|
||||||
|
private String erpPurchaseCompanyNumber;
|
||||||
|
|
||||||
|
@Schema(description = "ERP公司名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
|
||||||
|
@NotEmpty(message = "ERP公司名称不能为空")
|
||||||
|
private String erpPurchaseCompanyName;
|
||||||
|
|
||||||
|
@Schema(description = "ERP客商公司编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotEmpty(message = "ERP客商公司编码不能为空")
|
||||||
|
private String erpSalesCompanyNumber;
|
||||||
|
|
||||||
|
@Schema(description = "ERP客商公司名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
|
||||||
|
@NotEmpty(message = "ERP客商公司名称不能为空")
|
||||||
|
private String erpSalesCompanyName;
|
||||||
|
|
||||||
|
@Schema(description = "采购组织名称", example = "赵六")
|
||||||
|
private String purchaseOrganizationName;
|
||||||
|
|
||||||
|
@Schema(description = "ERP状态(字典: ERP_REQ_STS)", example = "2")
|
||||||
|
private String erpStatus;
|
||||||
|
|
||||||
|
@Schema(description = "请求ERP失败原因")
|
||||||
|
private String cause;
|
||||||
|
|
||||||
|
@Schema(description = "订单状态(字典:PRCH_ORD_STS)", example = "2")
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
@Schema(description = "采购组名称", example = "张三")
|
||||||
|
private String purchaseGroupName;
|
||||||
|
|
||||||
|
@Schema(description = "订单明细")
|
||||||
|
@ExcelProperty("订单明细")
|
||||||
|
private List<SalesOrderDetailSaveReqVO> salesOrderDetailSaveReqVOS;
|
||||||
|
|
||||||
|
|
||||||
|
@Schema(description = "流程实例编号")
|
||||||
|
@ExcelProperty("流程实例编号")
|
||||||
|
private String processInstanceId;
|
||||||
|
|
||||||
|
@Schema(description = "流程当前任务节点id")
|
||||||
|
@ExcelProperty("流程当前任务节点id")
|
||||||
|
private String taskId;
|
||||||
|
|
||||||
|
@Schema(description = " 审批意见")
|
||||||
|
@ExcelProperty(" 审批意见")
|
||||||
|
private String reviewOpinion;
|
||||||
|
|
||||||
|
@Schema(description = "是否提交审核,value为0或1")
|
||||||
|
@ExcelProperty("是否提交审核")
|
||||||
|
private int isPush;
|
||||||
|
@Schema(description = "物料类别(字典:MTRL_TP)", example = "1")
|
||||||
|
@ExcelProperty("物料类别")
|
||||||
|
private String mtrlTp;
|
||||||
|
|
||||||
|
@Schema(description = "订单分类", example = "2")
|
||||||
|
@ExcelProperty("订单分类")
|
||||||
|
private String splyBsnTp;
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
package com.zt.plat.module.contractorder.controller.admin.salesorder.vo;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import jakarta.validation.constraints.NotEmpty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 采购订单状态 Request VO")
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class SalesOrderStsReqVO {
|
||||||
|
@Schema(description = "采购订单编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "26419")
|
||||||
|
private List<Long> ids;
|
||||||
|
@Schema(description = "采购订单状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||||
|
@NotEmpty(message = "采购订单状态不能为空")
|
||||||
|
private String sts;
|
||||||
|
@Schema(description = "采购订单号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||||
|
private List<String> orderNos;
|
||||||
|
}
|
||||||
@@ -270,5 +270,10 @@ public class PrchOrdDtlDO extends BusinessBaseDO {
|
|||||||
*/
|
*/
|
||||||
@TableField("ELEM_CDG")
|
@TableField("ELEM_CDG")
|
||||||
private String elemCdg;
|
private String elemCdg;
|
||||||
|
/**
|
||||||
|
* 税率
|
||||||
|
*/
|
||||||
|
@TableField("TAX_RTE")
|
||||||
|
private String taxRte;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -257,4 +257,25 @@ public class PurchaseOrderDO extends BusinessBaseDO {
|
|||||||
*/
|
*/
|
||||||
@TableField("SPLY_BSN_TP")
|
@TableField("SPLY_BSN_TP")
|
||||||
private String splyBsnTp;
|
private String splyBsnTp;
|
||||||
|
/**
|
||||||
|
* 产品组编码
|
||||||
|
*/
|
||||||
|
@TableField("PDT_GRP_CDG")
|
||||||
|
private String pdtGrpCdg;
|
||||||
|
/**
|
||||||
|
* 产品组名称
|
||||||
|
*/
|
||||||
|
@TableField("PDT_GRP_NAME")
|
||||||
|
private String pdtGrpName;
|
||||||
|
/**
|
||||||
|
* 分销聚道编码
|
||||||
|
*/
|
||||||
|
@TableField("SALE_ACS_CDG")
|
||||||
|
private String saleAcsCdg;
|
||||||
|
/**
|
||||||
|
* 分销聚道名称
|
||||||
|
*/
|
||||||
|
@TableField("SALE_ACS_NAME")
|
||||||
|
private String saleAcsName;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,268 @@
|
|||||||
|
package com.zt.plat.module.contractorder.dal.dataobject.salesorder;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 采购订单 DO
|
||||||
|
*
|
||||||
|
* @author 后台管理-1
|
||||||
|
*/
|
||||||
|
@TableName("bse_prch_ord")
|
||||||
|
@KeySequence("bse_prch_ord_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
/**
|
||||||
|
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||||
|
*/
|
||||||
|
public class SalesOrderDO extends BusinessBaseDO {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* ERP订单号
|
||||||
|
*/
|
||||||
|
@TableField("ORD_SAP_NUM")
|
||||||
|
private String orderSAPNumber;
|
||||||
|
/**
|
||||||
|
* 订单号
|
||||||
|
*/
|
||||||
|
@TableField("SYS_ORD_NUM")
|
||||||
|
private String systemOrderNumber;
|
||||||
|
/**
|
||||||
|
* 公司名称
|
||||||
|
*/
|
||||||
|
@TableField("CPN_NAME")
|
||||||
|
private String cpName;
|
||||||
|
/**
|
||||||
|
* 公司编码;推送ERP(必须)
|
||||||
|
*/
|
||||||
|
@TableField("CPN_NUM")
|
||||||
|
private String companyNumber;
|
||||||
|
/**
|
||||||
|
* 客商编码;推送ERP(必须)
|
||||||
|
*/
|
||||||
|
@TableField("SPLR_NUM")
|
||||||
|
private String supplierNumber;
|
||||||
|
/**
|
||||||
|
* 客商名称
|
||||||
|
*/
|
||||||
|
@TableField("SPLR_NAME")
|
||||||
|
private String supplierName;
|
||||||
|
/**
|
||||||
|
* 订单类型(字典:PRCH_ORD_TP);推送ERP(必须)
|
||||||
|
*/
|
||||||
|
@TableField("TP")
|
||||||
|
private String type;
|
||||||
|
/**
|
||||||
|
* 凭证日期;推送ERP(必须)
|
||||||
|
*/
|
||||||
|
@TableField("VCHR_DT")
|
||||||
|
private LocalDateTime voucherDate;
|
||||||
|
/**
|
||||||
|
* 采购组织编码;推送ERP(必须)
|
||||||
|
*/
|
||||||
|
@TableField("PRCH_ORGZ_CD")
|
||||||
|
private String purchaseOrganizationCustomsDeclaration;
|
||||||
|
/**
|
||||||
|
* 收货工厂名称
|
||||||
|
*/
|
||||||
|
@TableField("RCV_FACT_NAME")
|
||||||
|
private String receiveFactoryName;
|
||||||
|
/**
|
||||||
|
* 收货工厂编码;推送ERP(必须)
|
||||||
|
*/
|
||||||
|
@TableField("RCV_FACT_NUM")
|
||||||
|
private String receiveFactoryNumber;
|
||||||
|
/**
|
||||||
|
* 收货库位名称
|
||||||
|
*/
|
||||||
|
@TableField("RCV_WRH_NAME")
|
||||||
|
private String receiveWarehouseName;
|
||||||
|
/**
|
||||||
|
* 收货库位编码;推送ERP
|
||||||
|
*/
|
||||||
|
@TableField("RCV_WRH_NUM")
|
||||||
|
private String receiveWarehouseNumber;
|
||||||
|
/**
|
||||||
|
* 采购组编码(字典:PRCH_GRP_TP);推送ERP(必须)
|
||||||
|
*/
|
||||||
|
@TableField("PRCH_GRP")
|
||||||
|
private String purchaseGroup;
|
||||||
|
/**
|
||||||
|
* 货币码(字典:CUR);推送ERP(必须)
|
||||||
|
*/
|
||||||
|
@TableField("CUR_NUM")
|
||||||
|
private String currencyNumber;
|
||||||
|
/**
|
||||||
|
* 汇率;推送ERP
|
||||||
|
*/
|
||||||
|
@TableField("EXCH_RTE")
|
||||||
|
private BigDecimal exchangeRate;
|
||||||
|
/**
|
||||||
|
* 合同纸质合同号;推送ERP(必须)
|
||||||
|
*/
|
||||||
|
@TableField("PPR_CTRT_NUM")
|
||||||
|
private String paperContractNumber;
|
||||||
|
/**
|
||||||
|
* 小协议号;推送ERP
|
||||||
|
*/
|
||||||
|
@TableField("AGR_NUM")
|
||||||
|
private String agreementNumber;
|
||||||
|
/**
|
||||||
|
* 备注;推送ERP
|
||||||
|
*/
|
||||||
|
@TableField("RMK")
|
||||||
|
private String remark;
|
||||||
|
/**
|
||||||
|
* 代理方编码;推送ERP
|
||||||
|
*/
|
||||||
|
@TableField("AGT_NUM")
|
||||||
|
private String agentNumber;
|
||||||
|
/**
|
||||||
|
* 代理方名称
|
||||||
|
*/
|
||||||
|
@TableField("AGT_NAME")
|
||||||
|
private String agentName;
|
||||||
|
/**
|
||||||
|
* 订单编码
|
||||||
|
*/
|
||||||
|
// @TableField("ORD_NUM")
|
||||||
|
// private String orderNumber;
|
||||||
|
/**
|
||||||
|
* 系统合同编号
|
||||||
|
*/
|
||||||
|
@TableField("CTRT_NUM")
|
||||||
|
private String contractNumber;
|
||||||
|
/**
|
||||||
|
* 物料编码
|
||||||
|
*/
|
||||||
|
@TableField("MTRL_NUM")
|
||||||
|
private String materialNumber;
|
||||||
|
/**
|
||||||
|
* 物料名称
|
||||||
|
*/
|
||||||
|
@TableField("MTRL_NAME")
|
||||||
|
private String materialName;
|
||||||
|
/**
|
||||||
|
* 合同名称
|
||||||
|
*/
|
||||||
|
@TableField("CTRT_NAME")
|
||||||
|
private String contractName;
|
||||||
|
/**
|
||||||
|
* 小户头号
|
||||||
|
*/
|
||||||
|
@TableField("TNT_NUM")
|
||||||
|
private String tenantNumber;
|
||||||
|
/**
|
||||||
|
* ERP公司编号
|
||||||
|
*/
|
||||||
|
@TableField("ERP_PRCH_CPN_NUM")
|
||||||
|
private String erpPurchaseCompanyNumber;
|
||||||
|
/**
|
||||||
|
* ERP公司名称
|
||||||
|
*/
|
||||||
|
@TableField("ERP_PRCH_CPN_NAME")
|
||||||
|
private String erpPurchaseCompanyName;
|
||||||
|
/**
|
||||||
|
* ERP客商公司编码
|
||||||
|
*/
|
||||||
|
@TableField("ERP_SALE_CPN_NUM")
|
||||||
|
private String erpSalesCompanyNumber;
|
||||||
|
/**
|
||||||
|
* ERP客商公司名称
|
||||||
|
*/
|
||||||
|
@TableField("ERP_SALE_CPN_NAME")
|
||||||
|
private String erpSalesCompanyName;
|
||||||
|
/**
|
||||||
|
* 采购组织名称
|
||||||
|
*/
|
||||||
|
@TableField("PRCH_ORGZ_NAME")
|
||||||
|
private String purchaseOrganizationName;
|
||||||
|
/**
|
||||||
|
* ERP状态(字典: ERP_REQ_STS)
|
||||||
|
*/
|
||||||
|
@TableField("ERP_STS")
|
||||||
|
private String erpStatus;
|
||||||
|
/**
|
||||||
|
* 请求ERP失败原因
|
||||||
|
*/
|
||||||
|
@TableField("CAUS")
|
||||||
|
private String cause;
|
||||||
|
/**
|
||||||
|
* 订单状态(字典:PRCH_ORD_STS)
|
||||||
|
*/
|
||||||
|
@TableField("STS")
|
||||||
|
private String status;
|
||||||
|
/**
|
||||||
|
* 采购组名称
|
||||||
|
*/
|
||||||
|
@TableField("PRCH_GRP_NAME")
|
||||||
|
private String purchaseGroupName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程实例编号
|
||||||
|
*/
|
||||||
|
@TableField("PRCS_INSC_ID")
|
||||||
|
private String processInstanceId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程当前任务节点id
|
||||||
|
*/
|
||||||
|
@TableField("TSK_NDE_ID")
|
||||||
|
private String taskId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审批意见
|
||||||
|
*/
|
||||||
|
@TableField("RVW_ONN")
|
||||||
|
private String reviewOpinion;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否需要审批
|
||||||
|
*/
|
||||||
|
@TableField("IS_PUSH")
|
||||||
|
private int isPush;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计量单位
|
||||||
|
*/
|
||||||
|
@TableField("UNT")
|
||||||
|
private String unt;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料字典
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@TableField("MTRL_TP")
|
||||||
|
private String mtrlTp;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单分类
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@TableField("SPLY_BSN_TP")
|
||||||
|
private String splyBsnTp;
|
||||||
|
|
||||||
|
@TableField("PDT_GRP_CDG")
|
||||||
|
private String pdtGrpCdg;
|
||||||
|
@TableField("PDT_GRP_NAME")
|
||||||
|
private String pdtGrpName;
|
||||||
|
@TableField("SALE_ACS_CDG")
|
||||||
|
private String saleAcsCdg;
|
||||||
|
@TableField("SALE_ACS_NAME")
|
||||||
|
private String saleAcsName;
|
||||||
|
}
|
||||||
@@ -0,0 +1,158 @@
|
|||||||
|
package com.zt.plat.module.contractorder.dal.dataobject.salesorder;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
|
||||||
|
/**
|
||||||
|
* 销售订单明细 DO
|
||||||
|
*
|
||||||
|
* @author 后台管理-1
|
||||||
|
*/
|
||||||
|
@TableName("bse_sale_ord_dtl")
|
||||||
|
@KeySequence("bse_sale_ord_dtl_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
/**
|
||||||
|
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||||
|
*/
|
||||||
|
public class SalesOrderDetailDO extends BusinessBaseDO {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 订单主键
|
||||||
|
*/
|
||||||
|
@TableField("ORD_ID")
|
||||||
|
private Long orderId;
|
||||||
|
/**
|
||||||
|
* 行项目;推送ERP(必须)
|
||||||
|
*/
|
||||||
|
@TableField("LINE_NUM")
|
||||||
|
private Long lineNumber;
|
||||||
|
/**
|
||||||
|
* 物料名称
|
||||||
|
*/
|
||||||
|
@TableField("MTRL_NAME")
|
||||||
|
private String materialName;
|
||||||
|
/**
|
||||||
|
* 物料编码;推送ERP(必须)
|
||||||
|
*/
|
||||||
|
@TableField("MTRL_NUM")
|
||||||
|
private String materialNumber;
|
||||||
|
/**
|
||||||
|
* 工厂名称
|
||||||
|
*/
|
||||||
|
@TableField("FACT_NAME")
|
||||||
|
private String factoryName;
|
||||||
|
/**
|
||||||
|
* 工厂编码;推送ERP(必须)
|
||||||
|
*/
|
||||||
|
@TableField("FACT_NUM")
|
||||||
|
private String factoryNumber;
|
||||||
|
/**
|
||||||
|
* 库位名称
|
||||||
|
*/
|
||||||
|
@TableField("WRH_NAME")
|
||||||
|
private String warehouseName;
|
||||||
|
/**
|
||||||
|
* 库位编码;推送ERP(必须)
|
||||||
|
*/
|
||||||
|
@TableField("WRH_NUM")
|
||||||
|
private String warehouseNumber;
|
||||||
|
/**
|
||||||
|
* 计量单位;推送ERP(必须)
|
||||||
|
*/
|
||||||
|
@TableField("UNT")
|
||||||
|
private String unit;
|
||||||
|
/**
|
||||||
|
* 开票类型;推送ERP(必须)
|
||||||
|
*/
|
||||||
|
@TableField("INV_TP")
|
||||||
|
private String invoiceType;
|
||||||
|
/**
|
||||||
|
* 暂估数量;推送ERP(必须)
|
||||||
|
*/
|
||||||
|
@TableField("QTY")
|
||||||
|
private BigDecimal quantity;
|
||||||
|
/**
|
||||||
|
* 稅分类(字典:SALE_TAX);推送ERP(必须)
|
||||||
|
*/
|
||||||
|
@TableField("TAX_ACTS")
|
||||||
|
private String taxAcctasscat;
|
||||||
|
/**
|
||||||
|
* 项目类别;推送ERP
|
||||||
|
*/
|
||||||
|
@TableField("PRJ_CTGR")
|
||||||
|
private String projectCategory;
|
||||||
|
/**
|
||||||
|
* 装运地点;推送ERP
|
||||||
|
*/
|
||||||
|
@TableField("SHPP_PLCE")
|
||||||
|
private String shippingPlace;
|
||||||
|
/**
|
||||||
|
* 物料科目分配组;推送ERP(必须)
|
||||||
|
*/
|
||||||
|
@TableField("MTL_ACTS_GRP")
|
||||||
|
private String metalAcctasscatGroup;
|
||||||
|
/**
|
||||||
|
* 小协议号
|
||||||
|
*/
|
||||||
|
@TableField("AGR_NUM")
|
||||||
|
private String agreementNumber;
|
||||||
|
/**
|
||||||
|
* 总价
|
||||||
|
*/
|
||||||
|
@TableField("GRS")
|
||||||
|
private BigDecimal gross;
|
||||||
|
/**
|
||||||
|
* 金属元素缩写
|
||||||
|
*/
|
||||||
|
@TableField("ELEM_ABBR")
|
||||||
|
private String elementAbbreviation;
|
||||||
|
/**
|
||||||
|
* 金属元素名称
|
||||||
|
*/
|
||||||
|
@TableField("ELEM_NAME")
|
||||||
|
private String elementName;
|
||||||
|
/**
|
||||||
|
* 金属元素编码
|
||||||
|
*/
|
||||||
|
@TableField("ELEM_NUM")
|
||||||
|
private String elementNumber;
|
||||||
|
/**
|
||||||
|
* 是否启用;处理明细中多个相同物料,只能允许一种物料启用
|
||||||
|
*/
|
||||||
|
@TableField("IS_ENB")
|
||||||
|
private String isEnable;
|
||||||
|
/**
|
||||||
|
* 价格条件详情;推送ERP(必须):JSON
|
||||||
|
*/
|
||||||
|
@TableField("PRC_CND_DTL")
|
||||||
|
private String priceConditionDetail;
|
||||||
|
/**
|
||||||
|
* 来料加工原料详情;推送ERP:订单类型(JSON)
|
||||||
|
*/
|
||||||
|
@TableField("ORGN_DTL")
|
||||||
|
private String originDetail;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 税率
|
||||||
|
*/
|
||||||
|
@TableField("TAX_RTE")
|
||||||
|
private String taxRte;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -24,7 +24,7 @@ public interface PurchaseOrderMapper extends BaseMapperX<PurchaseOrderDO> {
|
|||||||
default PageResult<PurchaseOrderDO> selectPage(PurchaseOrderPageReqVO reqVO) {
|
default PageResult<PurchaseOrderDO> selectPage(PurchaseOrderPageReqVO reqVO) {
|
||||||
return selectPage(reqVO, new LambdaQueryWrapperX<PurchaseOrderDO>()
|
return selectPage(reqVO, new LambdaQueryWrapperX<PurchaseOrderDO>()
|
||||||
.eqIfPresent(PurchaseOrderDO::getOrderSAPNumber, reqVO.getOrderSAPNumber())
|
.eqIfPresent(PurchaseOrderDO::getOrderSAPNumber, reqVO.getOrderSAPNumber())
|
||||||
.eqIfPresent(PurchaseOrderDO::getSystemOrderNumber, reqVO.getSystemOrderNumber())
|
.likeIfPresent(PurchaseOrderDO::getSystemOrderNumber, reqVO.getSystemOrderNumber())
|
||||||
.eqIfPresent(PurchaseOrderDO::getCompanyNumber, reqVO.getCompanyNumber())
|
.eqIfPresent(PurchaseOrderDO::getCompanyNumber, reqVO.getCompanyNumber())
|
||||||
.eqIfPresent(PurchaseOrderDO::getSupplierNumber, reqVO.getSupplierNumber())
|
.eqIfPresent(PurchaseOrderDO::getSupplierNumber, reqVO.getSupplierNumber())
|
||||||
.likeIfPresent(PurchaseOrderDO::getSupplierName, reqVO.getSupplierName())
|
.likeIfPresent(PurchaseOrderDO::getSupplierName, reqVO.getSupplierName())
|
||||||
|
|||||||
@@ -0,0 +1,51 @@
|
|||||||
|
package com.zt.plat.module.contractorder.dal.mysql.salesorder;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
|
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
|
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
|
||||||
|
import com.zt.plat.module.contractorder.controller.admin.salesorder.vo.SalesOrderDetailPageReqVO;
|
||||||
|
import com.zt.plat.module.contractorder.dal.dataobject.salesorder.SalesOrderDetailDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 销售订单明细 Mapper
|
||||||
|
*
|
||||||
|
* @author 后台管理-1
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface SalesOrderDetailMapper extends BaseMapperX<SalesOrderDetailDO> {
|
||||||
|
|
||||||
|
default PageResult<SalesOrderDetailDO> selectPage(SalesOrderDetailPageReqVO reqVO) {
|
||||||
|
return selectPage(reqVO, new LambdaQueryWrapperX<SalesOrderDetailDO>()
|
||||||
|
.eqIfPresent(SalesOrderDetailDO::getOrderId, reqVO.getOrderId())
|
||||||
|
.eqIfPresent(SalesOrderDetailDO::getLineNumber, reqVO.getLineNumber())
|
||||||
|
.likeIfPresent(SalesOrderDetailDO::getMaterialName, reqVO.getMaterialName())
|
||||||
|
.eqIfPresent(SalesOrderDetailDO::getMaterialNumber, reqVO.getMaterialNumber())
|
||||||
|
.likeIfPresent(SalesOrderDetailDO::getFactoryName, reqVO.getFactoryName())
|
||||||
|
.eqIfPresent(SalesOrderDetailDO::getFactoryNumber, reqVO.getFactoryNumber())
|
||||||
|
.likeIfPresent(SalesOrderDetailDO::getWarehouseName, reqVO.getWarehouseName())
|
||||||
|
.eqIfPresent(SalesOrderDetailDO::getWarehouseNumber, reqVO.getWarehouseNumber())
|
||||||
|
.eqIfPresent(SalesOrderDetailDO::getUnit, reqVO.getUnit())
|
||||||
|
.eqIfPresent(SalesOrderDetailDO::getInvoiceType, reqVO.getInvoiceType())
|
||||||
|
.eqIfPresent(SalesOrderDetailDO::getQuantity, reqVO.getQuantity())
|
||||||
|
.eqIfPresent(SalesOrderDetailDO::getTaxAcctasscat, reqVO.getTaxAcctasscat())
|
||||||
|
.eqIfPresent(SalesOrderDetailDO::getProjectCategory, reqVO.getProjectCategory())
|
||||||
|
.eqIfPresent(SalesOrderDetailDO::getShippingPlace, reqVO.getShippingPlace())
|
||||||
|
.eqIfPresent(SalesOrderDetailDO::getMetalAcctasscatGroup, reqVO.getMetalAcctasscatGroup())
|
||||||
|
.eqIfPresent(SalesOrderDetailDO::getAgreementNumber, reqVO.getAgreementNumber())
|
||||||
|
.eqIfPresent(SalesOrderDetailDO::getGross, reqVO.getGross())
|
||||||
|
.eqIfPresent(SalesOrderDetailDO::getElementAbbreviation, reqVO.getElementAbbreviation())
|
||||||
|
.likeIfPresent(SalesOrderDetailDO::getElementName, reqVO.getElementName())
|
||||||
|
.eqIfPresent(SalesOrderDetailDO::getElementNumber, reqVO.getElementNumber())
|
||||||
|
.eqIfPresent(SalesOrderDetailDO::getIsEnable, reqVO.getIsEnable())
|
||||||
|
.eqIfPresent(SalesOrderDetailDO::getPriceConditionDetail, reqVO.getPriceConditionDetail())
|
||||||
|
.eqIfPresent(SalesOrderDetailDO::getOriginDetail, reqVO.getOriginDetail())
|
||||||
|
.betweenIfPresent(SalesOrderDetailDO::getCreateTime, reqVO.getCreateTime())
|
||||||
|
.orderByDesc(SalesOrderDetailDO::getId));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
package com.zt.plat.module.contractorder.dal.mysql.salesorder;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
|
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
|
|
||||||
|
import com.zt.plat.module.contractorder.controller.admin.salesorder.vo.SalesOrderPageReqVO;
|
||||||
|
import com.zt.plat.module.contractorder.dal.dataobject.salesorder.SalesOrderDO;
|
||||||
|
import com.zt.plat.module.contractorder.dal.dataobject.salesorder.SalesOrderDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 采购订单 Mapper
|
||||||
|
*
|
||||||
|
* @author 后台管理-1
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface SalesOrderMapper extends BaseMapperX<SalesOrderDO> {
|
||||||
|
|
||||||
|
default PageResult<SalesOrderDO> selectPage(SalesOrderPageReqVO reqVO) {
|
||||||
|
return selectPage(reqVO, new LambdaQueryWrapperX<SalesOrderDO>()
|
||||||
|
.eqIfPresent(SalesOrderDO::getOrderSAPNumber, reqVO.getOrderSAPNumber())
|
||||||
|
.eqIfPresent(SalesOrderDO::getSystemOrderNumber, reqVO.getSystemOrderNumber())
|
||||||
|
.eqIfPresent(SalesOrderDO::getCompanyNumber, reqVO.getCompanyNumber())
|
||||||
|
.eqIfPresent(SalesOrderDO::getSupplierNumber, reqVO.getSupplierNumber())
|
||||||
|
.likeIfPresent(SalesOrderDO::getSupplierName, reqVO.getSupplierName())
|
||||||
|
.eqIfPresent(SalesOrderDO::getType, reqVO.getType())
|
||||||
|
.betweenIfPresent(SalesOrderDO::getVoucherDate, reqVO.getVoucherDate())
|
||||||
|
.eqIfPresent(SalesOrderDO::getPurchaseOrganizationCustomsDeclaration, reqVO.getPurchaseOrganizationCustomsDeclaration())
|
||||||
|
.likeIfPresent(SalesOrderDO::getReceiveFactoryName, reqVO.getReceiveFactoryName())
|
||||||
|
.eqIfPresent(SalesOrderDO::getReceiveFactoryNumber, reqVO.getReceiveFactoryNumber())
|
||||||
|
.likeIfPresent(SalesOrderDO::getReceiveWarehouseName, reqVO.getReceiveWarehouseName())
|
||||||
|
.eqIfPresent(SalesOrderDO::getReceiveWarehouseNumber, reqVO.getReceiveWarehouseNumber())
|
||||||
|
.eqIfPresent(SalesOrderDO::getPurchaseGroup, reqVO.getPurchaseGroup())
|
||||||
|
.eqIfPresent(SalesOrderDO::getCurrencyNumber, reqVO.getCurrencyNumber())
|
||||||
|
.eqIfPresent(SalesOrderDO::getExchangeRate, reqVO.getExchangeRate())
|
||||||
|
.eqIfPresent(SalesOrderDO::getPaperContractNumber, reqVO.getPaperContractNumber())
|
||||||
|
.eqIfPresent(SalesOrderDO::getAgreementNumber, reqVO.getAgreementNumber())
|
||||||
|
.eqIfPresent(SalesOrderDO::getRemark, reqVO.getRemark())
|
||||||
|
.eqIfPresent(SalesOrderDO::getAgentNumber, reqVO.getAgentNumber())
|
||||||
|
.likeIfPresent(SalesOrderDO::getAgentName, reqVO.getAgentName())
|
||||||
|
// .eqIfPresent(SalesOrderDO::getOrderNumber, reqVO.getOrderNumber())
|
||||||
|
.eqIfPresent(SalesOrderDO::getContractNumber, reqVO.getContractNumber())
|
||||||
|
.eqIfPresent(SalesOrderDO::getMaterialNumber, reqVO.getMaterialNumber())
|
||||||
|
.likeIfPresent(SalesOrderDO::getMaterialName, reqVO.getMaterialName())
|
||||||
|
.likeIfPresent(SalesOrderDO::getContractName, reqVO.getContractName())
|
||||||
|
.eqIfPresent(SalesOrderDO::getTenantNumber, reqVO.getTenantNumber())
|
||||||
|
.betweenIfPresent(SalesOrderDO::getCreateTime, reqVO.getCreateTime())
|
||||||
|
.eqIfPresent(SalesOrderDO::getErpPurchaseCompanyNumber, reqVO.getErpPurchaseCompanyNumber())
|
||||||
|
.likeIfPresent(SalesOrderDO::getErpPurchaseCompanyName, reqVO.getErpPurchaseCompanyName())
|
||||||
|
.eqIfPresent(SalesOrderDO::getErpSalesCompanyNumber, reqVO.getErpSalesCompanyNumber())
|
||||||
|
.likeIfPresent(SalesOrderDO::getErpSalesCompanyName, reqVO.getErpSalesCompanyName())
|
||||||
|
.likeIfPresent(SalesOrderDO::getPurchaseOrganizationName, reqVO.getPurchaseOrganizationName())
|
||||||
|
.eqIfPresent(SalesOrderDO::getErpStatus, reqVO.getErpStatus())
|
||||||
|
.eqIfPresent(SalesOrderDO::getSplyBsnTp, reqVO.getSplyBsnTp())
|
||||||
|
.eqIfPresent(SalesOrderDO::getCause, reqVO.getCause())
|
||||||
|
.eqIfPresent(SalesOrderDO::getStatus, reqVO.getStatus())
|
||||||
|
.likeIfPresent(SalesOrderDO::getPurchaseGroupName, reqVO.getPurchaseGroupName())
|
||||||
|
.orderByDesc(SalesOrderDO::getId));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -102,10 +102,10 @@ public interface ContractService {
|
|||||||
/**
|
/**
|
||||||
* 提交ERP
|
* 提交ERP
|
||||||
*
|
*
|
||||||
* @param ids 合同ID集合
|
* @param id 合同ID
|
||||||
* @return
|
* @return 提交结果
|
||||||
*/
|
*/
|
||||||
List<String> submitErp(List<Long> ids);
|
JSONObject submitErp(Long id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除合同
|
* 删除合同
|
||||||
@@ -203,12 +203,6 @@ public interface ContractService {
|
|||||||
*/
|
*/
|
||||||
Boolean complete(List<Long> ids);
|
Boolean complete(List<Long> ids);
|
||||||
|
|
||||||
/**
|
|
||||||
* 关联订单;该接口仅供订单关联使用
|
|
||||||
*
|
|
||||||
* @param LinkOrderReqVO 订单信息
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
Boolean linkOrder(@Valid LinkOrderReqVO LinkOrderReqVO);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package com.zt.plat.module.contractorder.service.contract;
|
|||||||
|
|
||||||
import cn.hutool.json.JSONArray;
|
import cn.hutool.json.JSONArray;
|
||||||
import cn.hutool.json.JSONObject;
|
import cn.hutool.json.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||||
import com.zt.plat.framework.common.pojo.PageResult;
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
@@ -25,7 +24,6 @@ import com.zt.plat.module.bpm.api.task.dto.*;
|
|||||||
import com.zt.plat.module.bpm.enums.task.BpmProcessInstanceStatusEnum;
|
import com.zt.plat.module.bpm.enums.task.BpmProcessInstanceStatusEnum;
|
||||||
import com.zt.plat.module.contractorder.api.dto.contract.*;
|
import com.zt.plat.module.contractorder.api.dto.contract.*;
|
||||||
import com.zt.plat.module.contractorder.controller.admin.contract.vo.contract.*;
|
import com.zt.plat.module.contractorder.controller.admin.contract.vo.contract.*;
|
||||||
import com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo.LinkOrderReqVO;
|
|
||||||
import com.zt.plat.module.contractorder.dal.dataobject.contract.*;
|
import com.zt.plat.module.contractorder.dal.dataobject.contract.*;
|
||||||
import com.zt.plat.module.contractorder.dal.mysql.contract.*;
|
import com.zt.plat.module.contractorder.dal.mysql.contract.*;
|
||||||
import com.zt.plat.module.contractorder.enums.*;
|
import com.zt.plat.module.contractorder.enums.*;
|
||||||
@@ -57,7 +55,10 @@ import java.io.ByteArrayOutputStream;
|
|||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.*;
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.LinkedHashSet;
|
||||||
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import java.util.zip.ZipEntry;
|
import java.util.zip.ZipEntry;
|
||||||
import java.util.zip.ZipOutputStream;
|
import java.util.zip.ZipOutputStream;
|
||||||
@@ -1317,55 +1318,62 @@ public class ContractServiceImpl implements ContractService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> submitErp(List<Long> ids) {
|
public JSONObject submitErp(Long id) {
|
||||||
|
|
||||||
List<String> results = new ArrayList<>();
|
JSONObject result = new JSONObject();
|
||||||
|
|
||||||
// 遍历合同ID集合
|
// 查询合同信息
|
||||||
ids.forEach(id -> {
|
ContractMainDO contractMainDO = contractMainMapper.selectById(id);
|
||||||
|
|
||||||
// 查询合同信息
|
// 合同数据不存在
|
||||||
ContractMainDO contractMainDO = contractMainMapper.selectById(id);
|
if (contractMainDO == null) {
|
||||||
|
throw exception(CONTRACT_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
|
||||||
if (contractMainDO != null) {
|
// 合同状态校验
|
||||||
|
if (!(DictEnum.BSE_CTRT_STS_WAIT_PUSH.getCode().equals(contractMainDO.getStatus())
|
||||||
|
|| DictEnum.BSE_CTRT_STS_VOID.getCode().equals(contractMainDO.getStatus())
|
||||||
|
|| DictEnum.BSE_CTRT_STS_TERMINATED.getCode().equals(contractMainDO.getStatus()))) {
|
||||||
|
|
||||||
// 合同状态校验
|
throw exception(CONTRACT_STATUS_NOT_SUBMIT_ERP,
|
||||||
if (!(DictEnum.BSE_CTRT_STS_WAIT_PUSH.getCode().equals(contractMainDO.getStatus())
|
DictEnum.getByCodeAndType(contractMainDO.getStatus(), DictTypeConstants.BSE_CTRT_STS).getLabel());
|
||||||
|| DictEnum.BSE_CTRT_STS_VOID.getCode().equals(contractMainDO.getStatus())
|
}
|
||||||
|| DictEnum.BSE_CTRT_STS_TERMINATED.getCode().equals(contractMainDO.getStatus()))) {
|
|
||||||
|
|
||||||
throw exception(CONTRACT_STATUS_NOT_SUBMIT_ERP,
|
// 生成ERP合同映射表
|
||||||
DictEnum.getByCodeAndType(contractMainDO.getStatus(), DictTypeConstants.BSE_CTRT_STS).getLabel());
|
ErpContractSaveReqVO erpContractVO = getErpContract(contractMainDO);
|
||||||
}
|
|
||||||
|
|
||||||
// 生成ERP合同映射表
|
// 调用ERP模块
|
||||||
ErpContractSaveReqVO erpContractVO = getErpContract(contractMainDO);
|
JSONObject erpResult = sendToErp(erpContractVO);
|
||||||
|
log.info("合同提交ERP结果:{}", erpResult);
|
||||||
|
result.putOnce("success", erpResult.getBool("success"));
|
||||||
|
|
||||||
// 调用ERP模块
|
// 更新合同状态
|
||||||
JSONObject erpResult = sendToErp(erpContractVO);
|
if (erpResult.getBool("success")) {
|
||||||
log.info("合同提交ERP结果:{}", erpResult);
|
if (DictEnum.BSE_CTRT_STS_WAIT_PUSH.getCode().equals(contractMainDO.getStatus())) {
|
||||||
String result = id
|
// 待推送的合同设置为执行中
|
||||||
+"-"+erpResult.getBool("success")
|
contractMainDO.setStatus(DictEnum.BSE_CTRT_STS_IN_PROGRESS.getCode());
|
||||||
+(erpResult.getBool("success") ? "" : "-" + erpResult.getStr("errMsg"));
|
|
||||||
results.add(result);
|
|
||||||
|
|
||||||
// 更新合同状态
|
|
||||||
if (erpResult.getBool("success")) {
|
|
||||||
contractMainDO.setStatus(DictEnum.BSE_CTRT_STS_IN_PROGRESS.getCode());
|
|
||||||
contractMainDO.setErpStatus(DictEnum.ERP_REQ_STS_FIND.getCode());
|
|
||||||
contractMainMapper.updateById(contractMainDO);
|
|
||||||
} else {
|
|
||||||
contractMainDO.setStatus(DictEnum.BSE_CTRT_STS_PUSH_ERROR.getCode());
|
|
||||||
contractMainDO.setErpStatus(DictEnum.ERP_REQ_STS_RLBK.getCode());
|
|
||||||
contractMainDO.setCause(erpResult.getStr("errMsg"));
|
|
||||||
contractMainMapper.updateById(contractMainDO);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
results.add(id+"-"+"false"+"-"+CONTRACT_NOT_EXISTS);
|
|
||||||
}
|
}
|
||||||
});
|
contractMainDO.setErpStatus(DictEnum.ERP_REQ_STS_FIND.getCode());
|
||||||
|
contractMainMapper.updateById(contractMainDO);
|
||||||
|
|
||||||
return results;
|
result.putOnce("data", erpResult.getStr("data"));
|
||||||
|
} else {
|
||||||
|
if (DictEnum.BSE_CTRT_STS_VOID.getCode().equals(contractMainDO.getStatus())
|
||||||
|
|| DictEnum.BSE_CTRT_STS_TERMINATED.getCode().equals(contractMainDO.getStatus())) {
|
||||||
|
// 作废和已完结订单退回执行中
|
||||||
|
contractMainDO.setStatus(DictEnum.BSE_CTRT_STS_TERMINATED.getCode());
|
||||||
|
} else {
|
||||||
|
// 待推送的合同设置为推送失败
|
||||||
|
contractMainDO.setStatus(DictEnum.BSE_CTRT_STS_PUSH_ERROR.getCode());
|
||||||
|
}
|
||||||
|
contractMainDO.setErpStatus(DictEnum.ERP_REQ_STS_RLBK.getCode());
|
||||||
|
contractMainDO.setCause(erpResult.getStr("errMsg"));
|
||||||
|
contractMainMapper.updateById(contractMainDO);
|
||||||
|
|
||||||
|
result.putOnce("data", erpResult.getStr("errMsg"));
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
private JSONObject sendToErp(ErpContractSaveReqVO erpContractVO) {
|
private JSONObject sendToErp(ErpContractSaveReqVO erpContractVO) {
|
||||||
@@ -1554,10 +1562,10 @@ public class ContractServiceImpl implements ContractService {
|
|||||||
|
|
||||||
// 更新合同
|
// 更新合同
|
||||||
contractMainMapper.updateById(contractMainDO);
|
contractMainMapper.updateById(contractMainDO);
|
||||||
});
|
|
||||||
|
|
||||||
// 重新提交erp
|
// 重新提交erp
|
||||||
submitErp(ids);
|
submitErp(id);
|
||||||
|
});
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -1585,28 +1593,14 @@ public class ContractServiceImpl implements ContractService {
|
|||||||
|
|
||||||
// 更新合同
|
// 更新合同
|
||||||
contractMainMapper.updateById(contractMainDO);
|
contractMainMapper.updateById(contractMainDO);
|
||||||
|
|
||||||
|
// 重新提交erp
|
||||||
|
submitErp(id);
|
||||||
});
|
});
|
||||||
|
|
||||||
// 重新提交erp
|
|
||||||
submitErp(ids);
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Boolean linkOrder(LinkOrderReqVO LinkOrderReqVO) {
|
|
||||||
|
|
||||||
SystemRelativityDO saveDO = new SystemRelativityDO();
|
|
||||||
saveDO.setStatus(DictEnum.BSE_SYS_REL_TP_ORDER.getCode());
|
|
||||||
saveDO.setUpId(LinkOrderReqVO.getUpOrderId());
|
|
||||||
saveDO.setDownId(LinkOrderReqVO.getDownOrderId());
|
|
||||||
//判断订单有没有关联过
|
|
||||||
if (systemRelativityMapper.selectCount(new LambdaQueryWrapper<SystemRelativityDO>().eq(SystemRelativityDO::getUpId, saveDO.getUpId()).eq(SystemRelativityDO::getDownId, saveDO.getDownId()))>0){
|
|
||||||
throw exception(CONTRACT_ORDER_EXISTS);
|
|
||||||
}
|
|
||||||
return systemRelativityMapper.insert(saveDO)>0;
|
|
||||||
}
|
|
||||||
|
|
||||||
private ErpContractSaveReqVO getErpContract(ContractMainDO contractMainDO) {
|
private ErpContractSaveReqVO getErpContract(ContractMainDO contractMainDO) {
|
||||||
|
|
||||||
ErpContractSaveReqVO erpContractVO = new ErpContractSaveReqVO();
|
ErpContractSaveReqVO erpContractVO = new ErpContractSaveReqVO();
|
||||||
@@ -1699,9 +1693,17 @@ public class ContractServiceImpl implements ContractService {
|
|||||||
// 变更后合同总金额(本位币-含税):CHG_BSC_AMT
|
// 变更后合同总金额(本位币-含税):CHG_BSC_AMT
|
||||||
erpContractVO.setChangeBasicAmount(contractMainDO.getChangeBasicAmount());
|
erpContractVO.setChangeBasicAmount(contractMainDO.getChangeBasicAmount());
|
||||||
// 合同状态编号:STS_NUM 参照060接口
|
// 合同状态编号:STS_NUM 参照060接口
|
||||||
erpContractVO.setStatusNumber(DictEnum.SUBMIT_ERP_CTRT_STS_EF.getCode());
|
|
||||||
// 合同状态名称:STS_NAME 参照060接口
|
// 合同状态名称:STS_NAME 参照060接口
|
||||||
erpContractVO.setStatusName(DictEnum.SUBMIT_ERP_CTRT_STS_EF.getLabel());
|
if (DictEnum.BSE_CTRT_STS_VOID.getCode().equals(contractMainDO.getStatus())) { // 作废
|
||||||
|
erpContractVO.setStatusNumber(DictEnum.SUBMIT_ERP_CTRT_STS_CA.getCode());
|
||||||
|
erpContractVO.setStatusName(DictEnum.SUBMIT_ERP_CTRT_STS_CA.getLabel());
|
||||||
|
} else if (DictEnum.BSE_CTRT_STS_TERMINATED.getCode().equals(contractMainDO.getStatus())) { // 完结
|
||||||
|
erpContractVO.setStatusNumber(DictEnum.SUBMIT_ERP_CTRT_STS_ZXWB.getCode());
|
||||||
|
erpContractVO.setStatusName(DictEnum.SUBMIT_ERP_CTRT_STS_ZXWB.getLabel());
|
||||||
|
} else { // 其它所有状态
|
||||||
|
erpContractVO.setStatusNumber(DictEnum.SUBMIT_ERP_CTRT_STS_EF.getCode());
|
||||||
|
erpContractVO.setStatusName(DictEnum.SUBMIT_ERP_CTRT_STS_EF.getLabel());
|
||||||
|
}
|
||||||
// 是否有预付款:IS_PPYM
|
// 是否有预付款:IS_PPYM
|
||||||
erpContractVO.setIsPrepayment(contractMainDO.getHasPrepayment());
|
erpContractVO.setIsPrepayment(contractMainDO.getHasPrepayment());
|
||||||
// 预付款比例:PPYM_RTIO
|
// 预付款比例:PPYM_RTIO
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import java.util.*;
|
|||||||
|
|
||||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||||
import com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo.*;
|
import com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo.*;
|
||||||
|
import com.zt.plat.module.contractorder.controller.admin.salesorder.vo.SalesOrderSaveReqVO;
|
||||||
import com.zt.plat.module.contractorder.dal.dataobject.purchaseorder.PurchaseOrderDO;
|
import com.zt.plat.module.contractorder.dal.dataobject.purchaseorder.PurchaseOrderDO;
|
||||||
import jakarta.validation.*;
|
import jakarta.validation.*;
|
||||||
|
|
||||||
@@ -52,7 +53,7 @@ public interface PurchaseOrderService {
|
|||||||
* @param id 编号
|
* @param id 编号
|
||||||
* @return 采购订单
|
* @return 采购订单
|
||||||
*/
|
*/
|
||||||
PurchaseOrderDO getPurchaseOrder(Long id);
|
PurchaseOrderDO getPurchaseOrder(Long id,String splyBsnTp);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获得采购订单分页
|
* 获得采购订单分页
|
||||||
@@ -103,13 +104,7 @@ public interface PurchaseOrderService {
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
CommonResult<MaterialRespVO> getMaterial(String orderNo);
|
CommonResult<MaterialRespVO> getMaterial(String orderNo);
|
||||||
/**
|
|
||||||
* 关联订单
|
|
||||||
*
|
|
||||||
* @param reqVO 关联订单
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
boolean linkOrder(LinkOrderReqVO reqVO);
|
|
||||||
/**
|
/**
|
||||||
* 订单审核通过和不通过
|
* 订单审核通过和不通过
|
||||||
*
|
*
|
||||||
@@ -117,4 +112,16 @@ public interface PurchaseOrderService {
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
boolean orderPassReject(PurchaseorderReqVO purchaseorderReqVO);
|
boolean orderPassReject(PurchaseorderReqVO purchaseorderReqVO);
|
||||||
|
|
||||||
|
List<DownOrUpOrderRespVO> getOrderByOrderIdAndType(DownOrUpOrderReqVO reqVO);
|
||||||
|
|
||||||
|
List<String> getBindOrderByOrder(DownOrUpOrderReqVO reqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关联订单;该接口仅供订单关联使用
|
||||||
|
*
|
||||||
|
* @param LinkOrderReqVO 订单信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
Boolean linkOrder(@Valid LinkOrderReqVO LinkOrderReqVO);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,9 +11,13 @@ import com.zt.plat.module.bpm.api.task.BpmProcessInstanceApi;
|
|||||||
import com.zt.plat.module.bpm.api.task.BpmTaskApi;
|
import com.zt.plat.module.bpm.api.task.BpmTaskApi;
|
||||||
import com.zt.plat.module.bpm.api.task.dto.*;
|
import com.zt.plat.module.bpm.api.task.dto.*;
|
||||||
import com.zt.plat.module.bpm.enums.task.BpmProcessInstanceStatusEnum;
|
import com.zt.plat.module.bpm.enums.task.BpmProcessInstanceStatusEnum;
|
||||||
|
import com.zt.plat.module.contractorder.controller.admin.contract.vo.contract.ContractRespVO;
|
||||||
import com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo.*;
|
import com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo.*;
|
||||||
|
import com.zt.plat.module.contractorder.controller.admin.salesorder.vo.SalesOrderSaveReqVO;
|
||||||
|
import com.zt.plat.module.contractorder.dal.dataobject.contract.SystemRelativityDO;
|
||||||
import com.zt.plat.module.contractorder.dal.dataobject.purchaseorder.PrchOrdDtlDO;
|
import com.zt.plat.module.contractorder.dal.dataobject.purchaseorder.PrchOrdDtlDO;
|
||||||
import com.zt.plat.module.contractorder.dal.dataobject.purchaseorder.PurchaseOrderDO;
|
import com.zt.plat.module.contractorder.dal.dataobject.purchaseorder.PurchaseOrderDO;
|
||||||
|
import com.zt.plat.module.contractorder.dal.mysql.contract.SystemRelativityMapper;
|
||||||
import com.zt.plat.module.contractorder.dal.mysql.purchaseorder.PrchOrdDtlMapper;
|
import com.zt.plat.module.contractorder.dal.mysql.purchaseorder.PrchOrdDtlMapper;
|
||||||
import com.zt.plat.module.contractorder.dal.mysql.purchaseorder.PurchaseOrderMapper;
|
import com.zt.plat.module.contractorder.dal.mysql.purchaseorder.PurchaseOrderMapper;
|
||||||
import com.zt.plat.module.contractorder.enums.contract.DictEnum;
|
import com.zt.plat.module.contractorder.enums.contract.DictEnum;
|
||||||
@@ -44,6 +48,7 @@ import com.zt.plat.framework.common.util.object.BeanUtils;
|
|||||||
|
|
||||||
|
|
||||||
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
|
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
|
import static com.zt.plat.module.contractorder.enums.ErrorCodeConstants.CONTRACT_ORDER_EXISTS;
|
||||||
import static com.zt.plat.module.contractorder.enums.purchaseorder.ErrorCodeConstants.*;
|
import static com.zt.plat.module.contractorder.enums.purchaseorder.ErrorCodeConstants.*;
|
||||||
|
|
||||||
|
|
||||||
@@ -80,8 +85,12 @@ public class PurchaseOrderServiceImpl implements PurchaseOrderService {
|
|||||||
@Resource
|
@Resource
|
||||||
private ContractService contractService;
|
private ContractService contractService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private SystemRelativityMapper systemRelativityMapper;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public PurchaseOrderRespVO createPurchaseOrder(PurchaseOrderSaveReqVO createReqVO) {
|
public PurchaseOrderRespVO createPurchaseOrder(PurchaseOrderSaveReqVO createReqVO) {
|
||||||
// 插入
|
// 插入
|
||||||
PurchaseOrderDO purchaseOrder = BeanUtils.toBean(createReqVO, PurchaseOrderDO.class);
|
PurchaseOrderDO purchaseOrder = BeanUtils.toBean(createReqVO, PurchaseOrderDO.class);
|
||||||
@@ -95,7 +104,7 @@ public class PurchaseOrderServiceImpl implements PurchaseOrderService {
|
|||||||
purchaseOrder.setSystemOrderNumber(orderNumber);
|
purchaseOrder.setSystemOrderNumber(orderNumber);
|
||||||
purchaseOrderMapper.insert(purchaseOrder);
|
purchaseOrderMapper.insert(purchaseOrder);
|
||||||
|
|
||||||
if (createReqVO.getPrchOrdDtlSaveReqVOS().isEmpty()){
|
if (createReqVO.getPrchOrdDtlSaveReqVOS().isEmpty()) {
|
||||||
return BeanUtils.toBean(purchaseOrder, PurchaseOrderRespVO.class);
|
return BeanUtils.toBean(purchaseOrder, PurchaseOrderRespVO.class);
|
||||||
}
|
}
|
||||||
//批量插入订单明细
|
//批量插入订单明细
|
||||||
@@ -107,7 +116,7 @@ public class PurchaseOrderServiceImpl implements PurchaseOrderService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void updatePurchaseOrder(PurchaseOrderSaveReqVO updateReqVO) {
|
public void updatePurchaseOrder(PurchaseOrderSaveReqVO updateReqVO) {
|
||||||
// 校验存在
|
// 校验存在
|
||||||
validatePurchaseOrderExists(updateReqVO.getId());
|
validatePurchaseOrderExists(updateReqVO.getId());
|
||||||
@@ -164,8 +173,8 @@ public class PurchaseOrderServiceImpl implements PurchaseOrderService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PurchaseOrderDO getPurchaseOrder(Long id) {
|
public PurchaseOrderDO getPurchaseOrder(Long id, String splyBsnTp) {
|
||||||
return purchaseOrderMapper.selectById(id);
|
return purchaseOrderMapper.selectOne(new LambdaQueryWrapper<PurchaseOrderDO>().eq(PurchaseOrderDO::getId, id).eq(splyBsnTp != null && !splyBsnTp.isEmpty(), PurchaseOrderDO::getSplyBsnTp, splyBsnTp));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -474,10 +483,18 @@ public class PurchaseOrderServiceImpl implements PurchaseOrderService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean linkOrder(LinkOrderReqVO reqVO) {
|
public Boolean linkOrder(LinkOrderReqVO LinkOrderReqVO) {
|
||||||
return contractService.linkOrder(reqVO);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
SystemRelativityDO saveDO = new SystemRelativityDO();
|
||||||
|
saveDO.setStatus(DictEnum.BSE_SYS_REL_TP_ORDER.getCode());
|
||||||
|
saveDO.setUpId(LinkOrderReqVO.getUpOrderId());
|
||||||
|
saveDO.setDownId(LinkOrderReqVO.getDownOrderId());
|
||||||
|
//判断订单有没有关联过
|
||||||
|
if (systemRelativityMapper.selectCount(new LambdaQueryWrapper<SystemRelativityDO>().eq(SystemRelativityDO::getUpId, saveDO.getUpId()).eq(SystemRelativityDO::getDownId, saveDO.getDownId())) > 0) {
|
||||||
|
throw exception(CONTRACT_ORDER_EXISTS);
|
||||||
|
}
|
||||||
|
return systemRelativityMapper.insert(saveDO) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
private void setValue(ErpOrderUpdateReqVO erpOrderUpdateReqVO, PurchaseOrderWithDetailsVO purchaseOrderWithDetailsVO) {
|
private void setValue(ErpOrderUpdateReqVO erpOrderUpdateReqVO, PurchaseOrderWithDetailsVO purchaseOrderWithDetailsVO) {
|
||||||
//head
|
//head
|
||||||
@@ -543,7 +560,6 @@ public class PurchaseOrderServiceImpl implements PurchaseOrderService {
|
|||||||
if (ObjectUtils.isEmpty(purchaseOrderDO)) {
|
if (ObjectUtils.isEmpty(purchaseOrderDO)) {
|
||||||
throw exception(PURCHASE_ORDER_NOT_EXISTS);
|
throw exception(PURCHASE_ORDER_NOT_EXISTS);
|
||||||
}
|
}
|
||||||
AdminUserRespDTO adminUserRespDTO = adminUserApi.getUser(SecurityFrameworkUtils.getLoginUserId()).getData();
|
|
||||||
// 获取当前流程正在审批的任务节点
|
// 获取当前流程正在审批的任务节点
|
||||||
List<BpmTaskRespDTO> taskList = bpmTaskApi.getTaskListByProcessInstanceId(purchaseOrderDO.getProcessInstanceId()).getData();
|
List<BpmTaskRespDTO> taskList = bpmTaskApi.getTaskListByProcessInstanceId(purchaseOrderDO.getProcessInstanceId()).getData();
|
||||||
BpmTaskRespDTO undoTask = taskList.get(taskList.size() - 1);
|
BpmTaskRespDTO undoTask = taskList.get(taskList.size() - 1);
|
||||||
@@ -585,4 +601,68 @@ public class PurchaseOrderServiceImpl implements PurchaseOrderService {
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<DownOrUpOrderRespVO> getOrderByOrderIdAndType(DownOrUpOrderReqVO reqVO) {
|
||||||
|
PurchaseOrderDO purchaseOrderDO = purchaseOrderMapper.selectById(reqVO.getOrderId());
|
||||||
|
if (purchaseOrderDO == null) {
|
||||||
|
throw exception(PURCHASE_ORDER_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
String contractNumber = purchaseOrderDO.getContractNumber();// 合同号
|
||||||
|
|
||||||
|
ContractRespVO upRelation = null;
|
||||||
|
if ("up".equals(reqVO.getOrderType())) {
|
||||||
|
log.info("获取上游订单");
|
||||||
|
//上游
|
||||||
|
upRelation = contractService.getUpRelation(Long.valueOf(contractNumber));
|
||||||
|
} else {
|
||||||
|
//下游
|
||||||
|
log.info("获取下游订单");
|
||||||
|
upRelation = contractService.getDownRelation(Long.valueOf(contractNumber));
|
||||||
|
}
|
||||||
|
List<DownOrUpOrderRespVO> orderList = new ArrayList<>();
|
||||||
|
if (upRelation != null) {
|
||||||
|
String systemContractNumber = upRelation.getSystemContractNumber();
|
||||||
|
|
||||||
|
List<PurchaseOrderDO> purchaseOrderDOS = purchaseOrderMapper.selectList(new LambdaQueryWrapper<PurchaseOrderDO>().eq(PurchaseOrderDO::getContractNumber, systemContractNumber));
|
||||||
|
purchaseOrderDOS.forEach(p -> {
|
||||||
|
DownOrUpOrderRespVO downOrUpOrderRespVO = new DownOrUpOrderRespVO();
|
||||||
|
downOrUpOrderRespVO.setOrderId(String.valueOf(p.getId()));
|
||||||
|
downOrUpOrderRespVO.setOrderNo(p.getSystemOrderNumber());
|
||||||
|
downOrUpOrderRespVO.setOrderType(reqVO.getOrderType());
|
||||||
|
downOrUpOrderRespVO.setContractId(String.valueOf(p.getId()));
|
||||||
|
downOrUpOrderRespVO.setContractName(p.getContractName());
|
||||||
|
downOrUpOrderRespVO.setContractNumber(p.getContractNumber());
|
||||||
|
orderList.add(downOrUpOrderRespVO);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
}
|
||||||
|
return orderList;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<String> getBindOrderByOrder(DownOrUpOrderReqVO reqVO) {
|
||||||
|
List<String> orderList = new ArrayList<>();
|
||||||
|
if ("up".equals(reqVO.getOrderType())) {
|
||||||
|
log.info("获取上游订单");
|
||||||
|
//上游
|
||||||
|
List<SystemRelativityDO> systemRelativityDOS = systemRelativityMapper.selectList(new LambdaQueryWrapper<SystemRelativityDO>().eq(SystemRelativityDO::getDownId, reqVO.getOrderId()));
|
||||||
|
if (!systemRelativityDOS.isEmpty()) {
|
||||||
|
systemRelativityDOS.forEach(systemRelativityDO -> {
|
||||||
|
orderList.add(systemRelativityDO.getUpId().toString());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
//下游
|
||||||
|
log.info("获取下游订单");
|
||||||
|
List<SystemRelativityDO> systemRelativityDOS = systemRelativityMapper.selectList(new LambdaQueryWrapper<SystemRelativityDO>().eq(SystemRelativityDO::getUpId, reqVO.getOrderId()));
|
||||||
|
if (!systemRelativityDOS.isEmpty()) {
|
||||||
|
systemRelativityDOS.forEach(systemRelativityDO -> {
|
||||||
|
orderList.add(systemRelativityDO.getDownId().toString());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return orderList;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,85 @@
|
|||||||
|
package com.zt.plat.module.contractorder.service.salesorder;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import com.zt.plat.module.contractorder.controller.admin.salesorder.vo.SalesOrderDetailPageReqVO;
|
||||||
|
import com.zt.plat.module.contractorder.controller.admin.salesorder.vo.SalesOrderDetailRespVO;
|
||||||
|
import com.zt.plat.module.contractorder.controller.admin.salesorder.vo.SalesOrderDetailSaveReqVO;
|
||||||
|
import com.zt.plat.module.contractorder.dal.dataobject.salesorder.SalesOrderDetailDO;
|
||||||
|
import jakarta.validation.*;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
|
import com.zt.plat.framework.common.pojo.PageParam;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 销售订单明细 Service 接口
|
||||||
|
*
|
||||||
|
* @author 后台管理-1
|
||||||
|
*/
|
||||||
|
public interface SalesOrderDetailService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建销售订单明细
|
||||||
|
*
|
||||||
|
* @param createReqVO 创建信息
|
||||||
|
* @return 编号
|
||||||
|
*/
|
||||||
|
SalesOrderDetailRespVO createSalesOrderDetail(@Valid SalesOrderDetailSaveReqVO createReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量创建销售订单明细
|
||||||
|
*
|
||||||
|
* @param createReqVOS 创建信息
|
||||||
|
* @return 编号
|
||||||
|
*/
|
||||||
|
List<SalesOrderDetailRespVO> createSalesOrderDetail(@Valid List<SalesOrderDetailSaveReqVO> createReqVOS);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新销售订单明细
|
||||||
|
*
|
||||||
|
* @param updateReqVO 更新信息
|
||||||
|
*/
|
||||||
|
void updateSalesOrderDetail(@Valid SalesOrderDetailSaveReqVO updateReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除销售订单明细
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
*/
|
||||||
|
void deleteSalesOrderDetail(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除销售订单明细
|
||||||
|
*
|
||||||
|
* @param ids 编号
|
||||||
|
*/
|
||||||
|
void deleteSalesOrderDetailListByIds(List<Long> ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得销售订单明细
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
* @return 销售订单明细
|
||||||
|
*/
|
||||||
|
SalesOrderDetailDO getSalesOrderDetail(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得销售订单明细分页
|
||||||
|
*
|
||||||
|
* @param pageReqVO 分页查询
|
||||||
|
* @return 销售订单明细分页
|
||||||
|
*/
|
||||||
|
PageResult<SalesOrderDetailDO> getSalesOrderDetailPage(SalesOrderDetailPageReqVO pageReqVO);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据订单主键删除订单明细
|
||||||
|
*
|
||||||
|
* @param orderIds 订单主键
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
void deleteSalesOrderDetailByOrderIds(List<Long> orderIds);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,111 @@
|
|||||||
|
package com.zt.plat.module.contractorder.service.salesorder;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import com.zt.plat.module.contractorder.controller.admin.salesorder.vo.SalesOrderDetailPageReqVO;
|
||||||
|
import com.zt.plat.module.contractorder.controller.admin.salesorder.vo.SalesOrderDetailRespVO;
|
||||||
|
import com.zt.plat.module.contractorder.controller.admin.salesorder.vo.SalesOrderDetailSaveReqVO;
|
||||||
|
import com.zt.plat.module.contractorder.dal.dataobject.salesorder.SalesOrderDetailDO;
|
||||||
|
import com.zt.plat.module.contractorder.dal.mysql.salesorder.SalesOrderDetailMapper;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
|
import com.zt.plat.framework.common.pojo.PageParam;
|
||||||
|
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
|
|
||||||
|
import static com.zt.plat.module.contractorder.enums.salesorder.ErrorCodeConstants.SALES_ORDER_DETAIL_NOT_EXISTS;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 销售订单明细 Service 实现类
|
||||||
|
*
|
||||||
|
* @author 后台管理-1
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Validated
|
||||||
|
public class SalesOrderDetailServiceImpl implements SalesOrderDetailService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private SalesOrderDetailMapper salesOrderDetailMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public SalesOrderDetailRespVO createSalesOrderDetail(SalesOrderDetailSaveReqVO createReqVO) {
|
||||||
|
// 插入
|
||||||
|
SalesOrderDetailDO salesOrderDetail = BeanUtils.toBean(createReqVO, SalesOrderDetailDO.class);
|
||||||
|
salesOrderDetailMapper.insert(salesOrderDetail);
|
||||||
|
// 返回
|
||||||
|
return BeanUtils.toBean(salesOrderDetail, SalesOrderDetailRespVO.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public List<SalesOrderDetailRespVO> createSalesOrderDetail(List<SalesOrderDetailSaveReqVO> createReqVOS) {
|
||||||
|
List<SalesOrderDetailDO> salesOrderDetailDOS = BeanUtils.toBean(createReqVOS, SalesOrderDetailDO.class);
|
||||||
|
salesOrderDetailMapper.insertBatch(salesOrderDetailDOS);
|
||||||
|
return BeanUtils.toBean(salesOrderDetailDOS, SalesOrderDetailRespVO.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateSalesOrderDetail(SalesOrderDetailSaveReqVO updateReqVO) {
|
||||||
|
// 校验存在
|
||||||
|
validateSalesOrderDetailExists(updateReqVO.getId());
|
||||||
|
// 更新
|
||||||
|
SalesOrderDetailDO updateObj = BeanUtils.toBean(updateReqVO, SalesOrderDetailDO.class);
|
||||||
|
salesOrderDetailMapper.updateById(updateObj);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteSalesOrderDetail(Long id) {
|
||||||
|
// 校验存在
|
||||||
|
validateSalesOrderDetailExists(id);
|
||||||
|
// 删除
|
||||||
|
salesOrderDetailMapper.deleteById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteSalesOrderDetailListByIds(List<Long> ids) {
|
||||||
|
// 校验存在
|
||||||
|
validateSalesOrderDetailExists(ids);
|
||||||
|
// 删除
|
||||||
|
salesOrderDetailMapper.deleteByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validateSalesOrderDetailExists(List<Long> ids) {
|
||||||
|
List<SalesOrderDetailDO> list = salesOrderDetailMapper.selectByIds(ids);
|
||||||
|
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
|
||||||
|
throw exception(SALES_ORDER_DETAIL_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validateSalesOrderDetailExists(Long id) {
|
||||||
|
if (salesOrderDetailMapper.selectById(id) == null) {
|
||||||
|
throw exception(SALES_ORDER_DETAIL_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SalesOrderDetailDO getSalesOrderDetail(Long id) {
|
||||||
|
return salesOrderDetailMapper.selectById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<SalesOrderDetailDO> getSalesOrderDetailPage(SalesOrderDetailPageReqVO pageReqVO) {
|
||||||
|
return salesOrderDetailMapper.selectPage(pageReqVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void deleteSalesOrderDetailByOrderIds(List<Long> orderIds) {
|
||||||
|
salesOrderDetailMapper.deleteBatch(SalesOrderDetailDO::getOrderId, orderIds);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,65 @@
|
|||||||
|
package com.zt.plat.module.contractorder.service.salesorder;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import com.zt.plat.module.contractorder.controller.admin.salesorder.vo.SalesOrderPageReqVO;
|
||||||
|
import com.zt.plat.module.contractorder.controller.admin.salesorder.vo.SalesOrderRespVO;
|
||||||
|
import com.zt.plat.module.contractorder.controller.admin.salesorder.vo.SalesOrderSaveReqVO;
|
||||||
|
import com.zt.plat.module.contractorder.dal.dataobject.salesorder.SalesOrderDO;
|
||||||
|
import jakarta.validation.*;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 采购订单 Service 接口
|
||||||
|
*
|
||||||
|
* @author 后台管理-1
|
||||||
|
*/
|
||||||
|
public interface SalesOrderService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建采购订单
|
||||||
|
*
|
||||||
|
* @param createReqVO 创建信息
|
||||||
|
* @return 编号
|
||||||
|
*/
|
||||||
|
SalesOrderRespVO createSalesOrder(@Valid SalesOrderSaveReqVO createReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新采购订单
|
||||||
|
*
|
||||||
|
* @param updateReqVO 更新信息
|
||||||
|
*/
|
||||||
|
void updateSalesOrder(@Valid SalesOrderSaveReqVO updateReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除采购订单
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
*/
|
||||||
|
void deleteSalesOrder(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除采购订单
|
||||||
|
*
|
||||||
|
* @param ids 编号
|
||||||
|
*/
|
||||||
|
void deleteSalesOrderListByIds(List<Long> ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得采购订单
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
* @return 采购订单
|
||||||
|
*/
|
||||||
|
SalesOrderDO getSalesOrder(Long id, String splyBsnTp);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得采购订单分页
|
||||||
|
*
|
||||||
|
* @param pageReqVO 分页查询
|
||||||
|
* @return 采购订单分页
|
||||||
|
*/
|
||||||
|
PageResult<SalesOrderDO> getSalesOrderPage(SalesOrderPageReqVO pageReqVO);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,99 @@
|
|||||||
|
package com.zt.plat.module.contractorder.service.salesorder;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.zt.plat.module.contractorder.controller.admin.salesorder.vo.SalesOrderPageReqVO;
|
||||||
|
import com.zt.plat.module.contractorder.controller.admin.salesorder.vo.SalesOrderRespVO;
|
||||||
|
import com.zt.plat.module.contractorder.controller.admin.salesorder.vo.SalesOrderSaveReqVO;
|
||||||
|
import com.zt.plat.module.contractorder.dal.dataobject.salesorder.SalesOrderDO;
|
||||||
|
import com.zt.plat.module.contractorder.dal.mysql.salesorder.SalesOrderMapper;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||||
|
|
||||||
|
|
||||||
|
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
|
import static com.zt.plat.module.contractorder.enums.purchaseorder.ErrorCodeConstants.PURCHASE_ORDER_NOT_EXISTS;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 采购订单 Service 实现类
|
||||||
|
*
|
||||||
|
* @author 后台管理-1
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Validated
|
||||||
|
public class SalesOrderServiceImpl implements SalesOrderService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private SalesOrderMapper salesOrderMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public SalesOrderRespVO createSalesOrder(SalesOrderSaveReqVO createReqVO) {
|
||||||
|
// 插入
|
||||||
|
SalesOrderDO purchaseOrder = BeanUtils.toBean(createReqVO, SalesOrderDO.class);
|
||||||
|
salesOrderMapper.insert(purchaseOrder);
|
||||||
|
// 返回
|
||||||
|
return BeanUtils.toBean(purchaseOrder, SalesOrderRespVO.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public void updateSalesOrder(SalesOrderSaveReqVO updateReqVO) {
|
||||||
|
// 校验存在
|
||||||
|
validateSalesOrderExists(updateReqVO.getId());
|
||||||
|
// 更新
|
||||||
|
SalesOrderDO updateObj = BeanUtils.toBean(updateReqVO, SalesOrderDO.class);
|
||||||
|
salesOrderMapper.updateById(updateObj);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public void deleteSalesOrder(Long id) {
|
||||||
|
// 校验存在
|
||||||
|
validateSalesOrderExists(id);
|
||||||
|
// 删除
|
||||||
|
salesOrderMapper.deleteById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public void deleteSalesOrderListByIds(List<Long> ids) {
|
||||||
|
// 校验存在
|
||||||
|
validateSalesOrderExists(ids);
|
||||||
|
// 删除
|
||||||
|
salesOrderMapper.deleteByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validateSalesOrderExists(List<Long> ids) {
|
||||||
|
List<SalesOrderDO> list = salesOrderMapper.selectByIds(ids);
|
||||||
|
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
|
||||||
|
throw exception(PURCHASE_ORDER_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validateSalesOrderExists(Long id) {
|
||||||
|
if (salesOrderMapper.selectById(id) == null) {
|
||||||
|
throw exception(PURCHASE_ORDER_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SalesOrderDO getSalesOrder(Long id, String splyBsnTp) {
|
||||||
|
return salesOrderMapper.selectOne(new LambdaQueryWrapper<SalesOrderDO>().eq(SalesOrderDO::getId, id).eq(splyBsnTp != null && !splyBsnTp.isEmpty(), SalesOrderDO::getSplyBsnTp, splyBsnTp));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<SalesOrderDO> getSalesOrderPage(SalesOrderPageReqVO pageReqVO) {
|
||||||
|
return salesOrderMapper.selectPage(pageReqVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -166,6 +166,10 @@
|
|||||||
po.CREATOR,
|
po.CREATOR,
|
||||||
po.UPDATER,
|
po.UPDATER,
|
||||||
po.DELETED,
|
po.DELETED,
|
||||||
|
po.pdtGrpCdg,
|
||||||
|
po.pdtGrpName,
|
||||||
|
po.saleAcsCdg,
|
||||||
|
po.saleAcsName,
|
||||||
pod.ID as pod_id,
|
pod.ID as pod_id,
|
||||||
pod.ORD_ID,
|
pod.ORD_ID,
|
||||||
pod.LINE_NUM,
|
pod.LINE_NUM,
|
||||||
@@ -279,6 +283,10 @@
|
|||||||
<result column="UNT" property="unt"/>
|
<result column="UNT" property="unt"/>
|
||||||
<result column="MTRL_TP" property="mtrlTp"/>
|
<result column="MTRL_TP" property="mtrlTp"/>
|
||||||
<result column="SPLY_BSN_TP" property="splyBsnTp"/>
|
<result column="SPLY_BSN_TP" property="splyBsnTp"/>
|
||||||
|
<result column="PDT_GRP_CDG" property="pdtGrpCdg"/>
|
||||||
|
<result column="PDT_GRP_NAME" property="pdtGrpName"/>
|
||||||
|
<result column="SALE_ACS_CDG" property="saleAcsCdg"/>
|
||||||
|
<result column="SALE_ACS_NAME" property="saleAcsName"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<resultMap id="PrchOrdDtlResultMap" type="com.zt.plat.module.contractorder.dal.dataobject.purchaseorder.PrchOrdDtlDO">
|
<resultMap id="PrchOrdDtlResultMap" type="com.zt.plat.module.contractorder.dal.dataobject.purchaseorder.PrchOrdDtlDO">
|
||||||
@@ -328,6 +336,5 @@
|
|||||||
<result column="ENTT_DTL" property="enttDtl"/>
|
<result column="ENTT_DTL" property="enttDtl"/>
|
||||||
<result column="ELEM_ABBR" property="elemAbbr"/>
|
<result column="ELEM_ABBR" property="elemAbbr"/>
|
||||||
<result column="ELEM_NAME" property="elemName"/>
|
<result column="ELEM_NAME" property="elemName"/>
|
||||||
<result column="ELEM_CDG" property="elemCdg"/>
|
|
||||||
</resultMap>
|
</resultMap>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
24
zt-module-unit-management/pom.xml
Normal file
24
zt-module-unit-management/pom.xml
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<parent>
|
||||||
|
<artifactId>dsc-base</artifactId>
|
||||||
|
<groupId>com.zt.plat</groupId>
|
||||||
|
<version>${revision}</version>
|
||||||
|
</parent>
|
||||||
|
<modules>
|
||||||
|
<module>zt-module-unit-management-api</module>
|
||||||
|
<module>zt-module-unit-management-server</module>
|
||||||
|
</modules>
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
<artifactId>zt-module-unit-management</artifactId>
|
||||||
|
<packaging>pom</packaging>
|
||||||
|
|
||||||
|
<name>${project.artifactId}</name>
|
||||||
|
<description>
|
||||||
|
计量单位 模块。
|
||||||
|
</description>
|
||||||
|
|
||||||
|
</project>
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<parent>
|
||||||
|
<artifactId>zt-module-unit-management</artifactId>
|
||||||
|
<groupId>com.zt.plat</groupId>
|
||||||
|
<version>${revision}</version>
|
||||||
|
</parent>
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<artifactId>zt-module-unit-management-api</artifactId>
|
||||||
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
|
<name>${project.artifactId}</name>
|
||||||
|
<description>
|
||||||
|
暴露给其它模块调用
|
||||||
|
</description>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.zt.plat</groupId>
|
||||||
|
<artifactId>zt-common</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<!-- Web 相关 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springdoc</groupId> <!-- 接口文档:使用最新版本的 Swagger 模型 -->
|
||||||
|
<artifactId>springdoc-openapi-starter-webmvc-api</artifactId>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 参数校验 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-validation</artifactId>
|
||||||
|
<optional>true</optional>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- RPC 远程调用相关 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-openfeign</artifactId>
|
||||||
|
<optional>true</optional>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
</project>
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
package com.zt.plat.module.unitmanagement.enums;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.common.exception.ErrorCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* unit-management 模块的错误码常量
|
||||||
|
*/
|
||||||
|
public interface UnitErrorCodeConstants {
|
||||||
|
|
||||||
|
ErrorCode QUANTITY_UNIT_RELATION_NOT_EXISTS =
|
||||||
|
new ErrorCode(1_010_000_001, "计量单位量与单位关联不存在");
|
||||||
|
|
||||||
|
ErrorCode UNIT_CONVERSION_NOT_EXISTS =
|
||||||
|
new ErrorCode(1_010_000_002, "单位转换记录不存在");
|
||||||
|
|
||||||
|
ErrorCode UNIT_QUANTITY_NOT_EXISTS =
|
||||||
|
new ErrorCode(1_010_000_003, "单位数量记录不存在");
|
||||||
|
|
||||||
|
ErrorCode UNT_INFO_NOT_EXISTS =
|
||||||
|
new ErrorCode(1_010_000_004, "单位信息记录不存在");
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,151 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<parent>
|
||||||
|
<artifactId>zt-module-unit-management</artifactId>
|
||||||
|
<groupId>com.zt.plat</groupId>
|
||||||
|
<version>${revision}</version>
|
||||||
|
</parent>
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
|
<artifactId>zt-module-unit-management-server</artifactId>
|
||||||
|
|
||||||
|
<name>${project.artifactId}</name>
|
||||||
|
<description>
|
||||||
|
计量单位管理 模块。
|
||||||
|
</description>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<!-- Spring Cloud 基础 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.zt.plat</groupId>
|
||||||
|
<artifactId>zt-spring-boot-starter-env</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 依赖服务 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.zt.plat</groupId>
|
||||||
|
<artifactId>zt-module-system-api</artifactId>
|
||||||
|
<version>${revision}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.zt.plat</groupId>
|
||||||
|
<artifactId>zt-module-infra-api</artifactId>
|
||||||
|
<version>${revision}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.zt.plat</groupId>
|
||||||
|
<artifactId>zt-module-unit-management-api</artifactId>
|
||||||
|
<version>${revision}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 业务组件 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.zt.plat</groupId>
|
||||||
|
<artifactId>zt-spring-boot-starter-biz-data-permission</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.zt.plat</groupId>
|
||||||
|
<artifactId>zt-spring-boot-starter-biz-tenant</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Web 相关 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.zt.plat</groupId>
|
||||||
|
<artifactId>zt-spring-boot-starter-web</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.zt.plat</groupId>
|
||||||
|
<artifactId>zt-spring-boot-starter-security</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- DB 相关 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.zt.plat</groupId>
|
||||||
|
<artifactId>zt-spring-boot-starter-mybatis</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.zt.plat</groupId>
|
||||||
|
<artifactId>zt-spring-boot-starter-redis</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- RPC 远程调用相关 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.zt.plat</groupId>
|
||||||
|
<artifactId>zt-spring-boot-starter-rpc</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Registry 注册中心相关 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Config 配置中心相关 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Job 定时任务相关 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.zt.plat</groupId>
|
||||||
|
<artifactId>zt-spring-boot-starter-job</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 消息队列相关 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.zt.plat</groupId>
|
||||||
|
<artifactId>zt-spring-boot-starter-mq</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Test 测试相关 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.zt.plat</groupId>
|
||||||
|
<artifactId>zt-spring-boot-starter-test</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 工具类相关 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.zt.plat</groupId>
|
||||||
|
<artifactId>zt-spring-boot-starter-excel</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 监控相关 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.zt.plat</groupId>
|
||||||
|
<artifactId>zt-spring-boot-starter-monitor</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.zt.plat</groupId>
|
||||||
|
<artifactId>zt-spring-boot-starter-biz-business</artifactId>
|
||||||
|
<version>${revision}</version>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<!-- 设置构建的 jar 包名 -->
|
||||||
|
<finalName>${project.artifactId}</finalName>
|
||||||
|
<!-- <plugins>-->
|
||||||
|
<!-- <!– 打包 –>-->
|
||||||
|
<!-- <plugin>-->
|
||||||
|
<!-- <groupId>org.springframework.boot</groupId>-->
|
||||||
|
<!-- <artifactId>spring-boot-maven-plugin</artifactId>-->
|
||||||
|
<!-- <version>${spring.boot.version}</version>-->
|
||||||
|
<!-- <executions>-->
|
||||||
|
<!-- <execution>-->
|
||||||
|
<!-- <goals>-->
|
||||||
|
<!-- <goal>repackage</goal> <!– 将引入的 jar 打入其中 –>-->
|
||||||
|
<!-- </goals>-->
|
||||||
|
<!-- </execution>-->
|
||||||
|
<!-- </executions>-->
|
||||||
|
<!-- </plugin>-->
|
||||||
|
<!-- </plugins>-->
|
||||||
|
</build>
|
||||||
|
|
||||||
|
</project>
|
||||||
@@ -0,0 +1,116 @@
|
|||||||
|
package com.zt.plat.module.unitmanagement.controller.admin.QuantityUnitRelation;
|
||||||
|
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import com.zt.plat.framework.business.interceptor.BusinessControllerMarker;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
|
||||||
|
import jakarta.validation.constraints.*;
|
||||||
|
import jakarta.validation.*;
|
||||||
|
import jakarta.servlet.http.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO;
|
||||||
|
import com.zt.plat.framework.common.pojo.PageParam;
|
||||||
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
|
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||||
|
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||||
|
import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.excel.core.util.ExcelUtils;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog;
|
||||||
|
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||||
|
|
||||||
|
import com.zt.plat.module.unitmanagement.controller.admin.QuantityUnitRelation.vo.*;
|
||||||
|
import com.zt.plat.module.unitmanagement.dal.dataobject.QuantityUnitRelation.QuantityUnitRelationDO;
|
||||||
|
import com.zt.plat.module.unitmanagement.service.QuantityUnitRelation.QuantityUnitRelationService;
|
||||||
|
|
||||||
|
@Tag(name = "管理后台 - 计量单位量与单位关联")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/base/unit-management/quantity-unit-relation")
|
||||||
|
@Validated
|
||||||
|
public class QuantityUnitRelationController implements BusinessControllerMarker {
|
||||||
|
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private QuantityUnitRelationService quantityUnitRelationService;
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
@Operation(summary = "创建计量单位量与单位关联")
|
||||||
|
@PreAuthorize("@ss.hasPermission('unitmanagement:quantity-unit-relation:create')")
|
||||||
|
public CommonResult<QuantityUnitRelationRespVO> createQuantityUnitRelation(@Valid @RequestBody QuantityUnitRelationSaveReqVO createReqVO) {
|
||||||
|
return success(quantityUnitRelationService.createQuantityUnitRelation(createReqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update")
|
||||||
|
@Operation(summary = "更新计量单位量与单位关联")
|
||||||
|
@PreAuthorize("@ss.hasPermission('unitmanagement:quantity-unit-relation:update')")
|
||||||
|
public CommonResult<Boolean> updateQuantityUnitRelation(@Valid @RequestBody QuantityUnitRelationSaveReqVO updateReqVO) {
|
||||||
|
quantityUnitRelationService.updateQuantityUnitRelation(updateReqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete")
|
||||||
|
@Operation(summary = "删除计量单位量与单位关联")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
|
@PreAuthorize("@ss.hasPermission('unitmanagement:quantity-unit-relation:delete')")
|
||||||
|
public CommonResult<Boolean> deleteQuantityUnitRelation(@RequestParam("id") Long id) {
|
||||||
|
quantityUnitRelationService.deleteQuantityUnitRelation(id);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete-list")
|
||||||
|
@Parameter(name = "ids", description = "编号", required = true)
|
||||||
|
@Operation(summary = "批量删除计量单位量与单位关联")
|
||||||
|
@PreAuthorize("@ss.hasPermission('unitmanagement:quantity-unit-relation:delete')")
|
||||||
|
public CommonResult<Boolean> deleteQuantityUnitRelationList(@RequestBody BatchDeleteReqVO req) {
|
||||||
|
quantityUnitRelationService.deleteQuantityUnitRelationListByIds(req.getIds());
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get")
|
||||||
|
@Operation(summary = "获得计量单位量与单位关联")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
|
@PreAuthorize("@ss.hasPermission('unitmanagement:quantity-unit-relation:query')")
|
||||||
|
public CommonResult<QuantityUnitRelationRespVO> getQuantityUnitRelation(@RequestParam("id") Long id) {
|
||||||
|
QuantityUnitRelationDO quantityUnitRelation = quantityUnitRelationService.getQuantityUnitRelation(id);
|
||||||
|
return success(BeanUtils.toBean(quantityUnitRelation, QuantityUnitRelationRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/page")
|
||||||
|
@Operation(summary = "获得计量单位量与单位关联分页")
|
||||||
|
@PreAuthorize("@ss.hasPermission('unitmanagement:quantity-unit-relation:query')")
|
||||||
|
public CommonResult<PageResult<QuantityUnitRelationRespVO>> getQuantityUnitRelationPage(@Valid QuantityUnitRelationPageReqVO pageReqVO) {
|
||||||
|
PageResult<QuantityUnitRelationDO> pageResult = quantityUnitRelationService.getQuantityUnitRelationPage(pageReqVO);
|
||||||
|
return success(BeanUtils.toBean(pageResult, QuantityUnitRelationRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/export-excel")
|
||||||
|
@Operation(summary = "导出计量单位量与单位关联 Excel")
|
||||||
|
@PreAuthorize("@ss.hasPermission('unitmanagement:quantity-unit-relation:export')")
|
||||||
|
@ApiAccessLog(operateType = EXPORT)
|
||||||
|
public void exportQuantityUnitRelationExcel(@Valid QuantityUnitRelationPageReqVO pageReqVO,
|
||||||
|
HttpServletResponse response) throws IOException {
|
||||||
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||||
|
List<QuantityUnitRelationDO> list = quantityUnitRelationService.getQuantityUnitRelationPage(pageReqVO).getList();
|
||||||
|
// 导出 Excel
|
||||||
|
ExcelUtils.write(response, "计量单位量与单位关联.xls", "数据", QuantityUnitRelationRespVO.class,
|
||||||
|
BeanUtils.toBean(list, QuantityUnitRelationRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/batch-save")
|
||||||
|
@Operation(summary = "批量保存计量单位量与单位关联")
|
||||||
|
@PreAuthorize("@ss.hasPermission('unitmanagement:quantity-unit-relation:create')")
|
||||||
|
public CommonResult<Boolean> batchSaveQuantityUnitRelations(@Valid @RequestBody QuantityUnitRelationBatchSaveReqVO batchSaveReqVO) {
|
||||||
|
quantityUnitRelationService.batchSaveQuantityUnitRelations(batchSaveReqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
package com.zt.plat.module.unitmanagement.controller.admin.QuantityUnitRelation.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import jakarta.validation.constraints.*;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 计量单位量与单位关联批量保存 Request VO")
|
||||||
|
@Data
|
||||||
|
public class QuantityUnitRelationBatchSaveReqVO {
|
||||||
|
|
||||||
|
@Schema(description = "计量单位量ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "11015")
|
||||||
|
@NotNull(message = "计量单位量ID不能为空")
|
||||||
|
private Long untQtyId;
|
||||||
|
|
||||||
|
@Schema(description = "单位关联列表", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotNull(message = "单位关联列表不能为空")
|
||||||
|
private List<UnitRelationItemVO> unitRelations;
|
||||||
|
|
||||||
|
@Schema(description = "单位关联项")
|
||||||
|
@Data
|
||||||
|
public static class UnitRelationItemVO {
|
||||||
|
|
||||||
|
@Schema(description = "主键ID(新增时为空,更新时必填)", example = "11015")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "计量单位ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "30976")
|
||||||
|
@NotNull(message = "计量单位ID不能为空")
|
||||||
|
private Long untId;
|
||||||
|
|
||||||
|
@Schema(description = "是否基准单位-标识该维度基准单位")
|
||||||
|
private Integer isBse;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
package com.zt.plat.module.unitmanagement.controller.admin.QuantityUnitRelation.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import com.zt.plat.framework.common.pojo.PageParam;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 计量单位量与单位关联分页 Request VO")
|
||||||
|
@Data
|
||||||
|
public class QuantityUnitRelationPageReqVO extends PageParam {
|
||||||
|
|
||||||
|
@Schema(description = "所属量纲")
|
||||||
|
private Long untQtyId;
|
||||||
|
|
||||||
|
@Schema(description = "是否基准单位-标识该维度基准单位")
|
||||||
|
private Integer isBse;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
package com.zt.plat.module.unitmanagement.controller.admin.QuantityUnitRelation.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.alibaba.excel.annotation.*;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 计量单位量与单位关联 Response VO")
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class QuantityUnitRelationRespVO {
|
||||||
|
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "11015")
|
||||||
|
@ExcelProperty("ID")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "计量单位量ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "11015")
|
||||||
|
@ExcelProperty("计量单位量ID")
|
||||||
|
private Long untQtyId;
|
||||||
|
|
||||||
|
@Schema(description = "计量单位ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "30976")
|
||||||
|
@ExcelProperty("计量单位ID")
|
||||||
|
private Long untId;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("创建时间")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
@Schema(description = "是否基准单位-标识该维度基准单位")
|
||||||
|
@ExcelProperty("是否基准单位-标识该维度基准单位")
|
||||||
|
private Integer isBse;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package com.zt.plat.module.unitmanagement.controller.admin.QuantityUnitRelation.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import jakarta.validation.constraints.*;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 计量单位量与单位关联新增/修改 Request VO")
|
||||||
|
@Data
|
||||||
|
public class QuantityUnitRelationSaveReqVO {
|
||||||
|
|
||||||
|
@Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "11015")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "计量单位量ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "11015")
|
||||||
|
private Long untQtyId;
|
||||||
|
|
||||||
|
@Schema(description = "计量单位ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "30976")
|
||||||
|
private Long untId;
|
||||||
|
|
||||||
|
@Schema(description = "是否基准单位-标识该维度基准单位")
|
||||||
|
private Integer isBse;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,108 @@
|
|||||||
|
package com.zt.plat.module.unitmanagement.controller.admin.UnitConversion;
|
||||||
|
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import com.zt.plat.framework.business.interceptor.BusinessControllerMarker;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
|
||||||
|
import jakarta.validation.constraints.*;
|
||||||
|
import jakarta.validation.*;
|
||||||
|
import jakarta.servlet.http.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO;
|
||||||
|
import com.zt.plat.framework.common.pojo.PageParam;
|
||||||
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
|
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||||
|
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||||
|
import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.excel.core.util.ExcelUtils;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog;
|
||||||
|
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||||
|
|
||||||
|
import com.zt.plat.module.unitmanagement.controller.admin.UnitConversion.vo.*;
|
||||||
|
import com.zt.plat.module.unitmanagement.dal.dataobject.UnitConversion.UnitConversionDO;
|
||||||
|
import com.zt.plat.module.unitmanagement.service.UnitConversion.UnitConversionService;
|
||||||
|
|
||||||
|
@Tag(name = "管理后台 - 单位转换")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/base/unit-management/unit-conversion")
|
||||||
|
@Validated
|
||||||
|
public class UnitConversionController implements BusinessControllerMarker {
|
||||||
|
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private UnitConversionService unitConversionService;
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
@Operation(summary = "创建单位转换")
|
||||||
|
@PreAuthorize("@ss.hasPermission('unitmanagement:unit-conversion:create')")
|
||||||
|
public CommonResult<UnitConversionRespVO> createUnitConversion(@Valid @RequestBody UnitConversionSaveReqVO createReqVO) {
|
||||||
|
return success(unitConversionService.createUnitConversion(createReqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update")
|
||||||
|
@Operation(summary = "更新单位转换")
|
||||||
|
@PreAuthorize("@ss.hasPermission('unitmanagement:unit-conversion:update')")
|
||||||
|
public CommonResult<Boolean> updateUnitConversion(@Valid @RequestBody UnitConversionSaveReqVO updateReqVO) {
|
||||||
|
unitConversionService.updateUnitConversion(updateReqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete")
|
||||||
|
@Operation(summary = "删除单位转换")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
|
@PreAuthorize("@ss.hasPermission('unitmanagement:unit-conversion:delete')")
|
||||||
|
public CommonResult<Boolean> deleteUnitConversion(@RequestParam("id") Long id) {
|
||||||
|
unitConversionService.deleteUnitConversion(id);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete-list")
|
||||||
|
@Parameter(name = "ids", description = "编号", required = true)
|
||||||
|
@Operation(summary = "批量删除单位转换")
|
||||||
|
@PreAuthorize("@ss.hasPermission('unitmanagement:unit-conversion:delete')")
|
||||||
|
public CommonResult<Boolean> deleteUnitConversionList(@RequestBody BatchDeleteReqVO req) {
|
||||||
|
unitConversionService.deleteUnitConversionListByIds(req.getIds());
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get")
|
||||||
|
@Operation(summary = "获得单位转换")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
|
@PreAuthorize("@ss.hasPermission('unitmanagement:unit-conversion:query')")
|
||||||
|
public CommonResult<UnitConversionRespVO> getUnitConversion(@RequestParam("id") Long id) {
|
||||||
|
UnitConversionDO unitConversion = unitConversionService.getUnitConversion(id);
|
||||||
|
return success(BeanUtils.toBean(unitConversion, UnitConversionRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/page")
|
||||||
|
@Operation(summary = "获得单位转换分页")
|
||||||
|
@PreAuthorize("@ss.hasPermission('unitmanagement:unit-conversion:query')")
|
||||||
|
public CommonResult<PageResult<UnitConversionRespVO>> getUnitConversionPage(@Valid UnitConversionPageReqVO pageReqVO) {
|
||||||
|
PageResult<UnitConversionDO> pageResult = unitConversionService.getUnitConversionPage(pageReqVO);
|
||||||
|
return success(BeanUtils.toBean(pageResult, UnitConversionRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/export-excel")
|
||||||
|
@Operation(summary = "导出单位转换 Excel")
|
||||||
|
@PreAuthorize("@ss.hasPermission('unitmanagement:unit-conversion:export')")
|
||||||
|
@ApiAccessLog(operateType = EXPORT)
|
||||||
|
public void exportUnitConversionExcel(@Valid UnitConversionPageReqVO pageReqVO,
|
||||||
|
HttpServletResponse response) throws IOException {
|
||||||
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||||
|
List<UnitConversionDO> list = unitConversionService.getUnitConversionPage(pageReqVO).getList();
|
||||||
|
// 导出 Excel
|
||||||
|
ExcelUtils.write(response, "单位转换.xls", "数据", UnitConversionRespVO.class,
|
||||||
|
BeanUtils.toBean(list, UnitConversionRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package com.zt.plat.module.unitmanagement.controller.admin.UnitConversion.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import com.zt.plat.framework.common.pojo.PageParam;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 单位转换分页 Request VO")
|
||||||
|
@Data
|
||||||
|
public class UnitConversionPageReqVO extends PageParam {
|
||||||
|
|
||||||
|
@Schema(description = "源单位ID", example = "26239")
|
||||||
|
private Long srcUntId;
|
||||||
|
|
||||||
|
@Schema(description = "目标单位ID", example = "25640")
|
||||||
|
private Long tgtUntId;
|
||||||
|
|
||||||
|
@Schema(description = "转换因子")
|
||||||
|
private BigDecimal fctr;
|
||||||
|
|
||||||
|
@Schema(description = "转换公式")
|
||||||
|
private String fmu;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime[] createTime;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
package com.zt.plat.module.unitmanagement.controller.admin.UnitConversion.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.alibaba.excel.annotation.*;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 单位转换 Response VO")
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class UnitConversionRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "339")
|
||||||
|
@ExcelProperty("主键ID")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "源单位ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "26239")
|
||||||
|
@ExcelProperty("源单位ID")
|
||||||
|
private Long srcUntId;
|
||||||
|
|
||||||
|
@Schema(description = "目标单位ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "25640")
|
||||||
|
@ExcelProperty("目标单位ID")
|
||||||
|
private Long tgtUntId;
|
||||||
|
|
||||||
|
@Schema(description = "转换因子")
|
||||||
|
@ExcelProperty("转换因子")
|
||||||
|
private BigDecimal fctr;
|
||||||
|
|
||||||
|
@Schema(description = "转换公式", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("转换公式")
|
||||||
|
private String fmu;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("创建时间")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
package com.zt.plat.module.unitmanagement.controller.admin.UnitConversion.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import jakarta.validation.constraints.*;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 单位转换新增/修改 Request VO")
|
||||||
|
@Data
|
||||||
|
public class UnitConversionSaveReqVO {
|
||||||
|
|
||||||
|
@Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "339")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "源单位ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "26239")
|
||||||
|
@NotNull(message = "源单位ID不能为空")
|
||||||
|
private Long srcUntId;
|
||||||
|
|
||||||
|
@Schema(description = "目标单位ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "25640")
|
||||||
|
@NotNull(message = "目标单位ID不能为空")
|
||||||
|
private Long tgtUntId;
|
||||||
|
|
||||||
|
@Schema(description = "转换因子")
|
||||||
|
private BigDecimal fctr;
|
||||||
|
|
||||||
|
@Schema(description = "转换公式", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
private String fmu;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,108 @@
|
|||||||
|
package com.zt.plat.module.unitmanagement.controller.admin.UnitQuantity;
|
||||||
|
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import com.zt.plat.framework.business.interceptor.BusinessControllerMarker;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
|
||||||
|
import jakarta.validation.constraints.*;
|
||||||
|
import jakarta.validation.*;
|
||||||
|
import jakarta.servlet.http.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO;
|
||||||
|
import com.zt.plat.framework.common.pojo.PageParam;
|
||||||
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
|
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||||
|
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||||
|
import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.excel.core.util.ExcelUtils;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog;
|
||||||
|
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||||
|
|
||||||
|
import com.zt.plat.module.unitmanagement.controller.admin.UnitQuantity.vo.*;
|
||||||
|
import com.zt.plat.module.unitmanagement.dal.dataobject.UnitQuantity.UnitQuantityDO;
|
||||||
|
import com.zt.plat.module.unitmanagement.service.UnitQuantity.UnitQuantityService;
|
||||||
|
|
||||||
|
@Tag(name = "管理后台 - 计量单位量")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/base/unit-management/unit-quantity")
|
||||||
|
@Validated
|
||||||
|
public class UnitQuantityController implements BusinessControllerMarker {
|
||||||
|
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private UnitQuantityService unitQuantityService;
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
@Operation(summary = "创建计量单位量")
|
||||||
|
@PreAuthorize("@ss.hasPermission('unitmanagement:unit-quantity:create')")
|
||||||
|
public CommonResult<UnitQuantityRespVO> createUnitQuantity(@Valid @RequestBody UnitQuantitySaveReqVO createReqVO) {
|
||||||
|
return success(unitQuantityService.createUnitQuantity(createReqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update")
|
||||||
|
@Operation(summary = "更新计量单位量")
|
||||||
|
@PreAuthorize("@ss.hasPermission('unitmanagement:unit-quantity:update')")
|
||||||
|
public CommonResult<Boolean> updateUnitQuantity(@Valid @RequestBody UnitQuantitySaveReqVO updateReqVO) {
|
||||||
|
unitQuantityService.updateUnitQuantity(updateReqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete")
|
||||||
|
@Operation(summary = "删除计量单位量")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
|
@PreAuthorize("@ss.hasPermission('unitmanagement:unit-quantity:delete')")
|
||||||
|
public CommonResult<Boolean> deleteUnitQuantity(@RequestParam("id") Long id) {
|
||||||
|
unitQuantityService.deleteUnitQuantity(id);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete-list")
|
||||||
|
@Parameter(name = "ids", description = "编号", required = true)
|
||||||
|
@Operation(summary = "批量删除计量单位量")
|
||||||
|
@PreAuthorize("@ss.hasPermission('unitmanagement:unit-quantity:delete')")
|
||||||
|
public CommonResult<Boolean> deleteUnitQuantityList(@RequestBody BatchDeleteReqVO req) {
|
||||||
|
unitQuantityService.deleteUnitQuantityListByIds(req.getIds());
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get")
|
||||||
|
@Operation(summary = "获得计量单位量")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
|
@PreAuthorize("@ss.hasPermission('unitmanagement:unit-quantity:query')")
|
||||||
|
public CommonResult<UnitQuantityRespVO> getUnitQuantity(@RequestParam("id") Long id) {
|
||||||
|
UnitQuantityDO unitQuantity = unitQuantityService.getUnitQuantity(id);
|
||||||
|
return success(BeanUtils.toBean(unitQuantity, UnitQuantityRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/page")
|
||||||
|
@Operation(summary = "获得计量单位量分页")
|
||||||
|
@PreAuthorize("@ss.hasPermission('unitmanagement:unit-quantity:query')")
|
||||||
|
public CommonResult<PageResult<UnitQuantityRespVO>> getUnitQuantityPage(@Valid UnitQuantityPageReqVO pageReqVO) {
|
||||||
|
PageResult<UnitQuantityDO> pageResult = unitQuantityService.getUnitQuantityPage(pageReqVO);
|
||||||
|
return success(BeanUtils.toBean(pageResult, UnitQuantityRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/export-excel")
|
||||||
|
@Operation(summary = "导出计量单位量 Excel")
|
||||||
|
@PreAuthorize("@ss.hasPermission('unitmanagement:unit-quantity:export')")
|
||||||
|
@ApiAccessLog(operateType = EXPORT)
|
||||||
|
public void exportUnitQuantityExcel(@Valid UnitQuantityPageReqVO pageReqVO,
|
||||||
|
HttpServletResponse response) throws IOException {
|
||||||
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||||
|
List<UnitQuantityDO> list = unitQuantityService.getUnitQuantityPage(pageReqVO).getList();
|
||||||
|
// 导出 Excel
|
||||||
|
ExcelUtils.write(response, "计量单位量.xls", "数据", UnitQuantityRespVO.class,
|
||||||
|
BeanUtils.toBean(list, UnitQuantityRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package com.zt.plat.module.unitmanagement.controller.admin.UnitQuantity.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import com.zt.plat.framework.common.pojo.PageParam;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 计量单位量分页 Request VO")
|
||||||
|
@Data
|
||||||
|
public class UnitQuantityPageReqVO extends PageParam {
|
||||||
|
|
||||||
|
@Schema(description = "计量名称", example = "王五")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "计量符号")
|
||||||
|
private String symbol;
|
||||||
|
|
||||||
|
@Schema(description = "计量描述")
|
||||||
|
private String dsp;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime[] createTime;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
package com.zt.plat.module.unitmanagement.controller.admin.UnitQuantity.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.alibaba.excel.annotation.*;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 计量单位量 Response VO")
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class UnitQuantityRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "314")
|
||||||
|
@ExcelProperty("主键ID")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "计量名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
|
||||||
|
@ExcelProperty("计量名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "计量符号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("计量符号")
|
||||||
|
private String symbol;
|
||||||
|
|
||||||
|
@Schema(description = "计量描述", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("计量描述")
|
||||||
|
private String dsp;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("创建时间")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package com.zt.plat.module.unitmanagement.controller.admin.UnitQuantity.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import jakarta.validation.constraints.*;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 计量单位量新增/修改 Request VO")
|
||||||
|
@Data
|
||||||
|
public class UnitQuantitySaveReqVO {
|
||||||
|
|
||||||
|
@Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "314")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "计量名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
|
||||||
|
@NotEmpty(message = "计量名称不能为空")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "计量符号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotEmpty(message = "计量符号不能为空")
|
||||||
|
private String symbol;
|
||||||
|
|
||||||
|
@Schema(description = "计量描述", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotEmpty(message = "计量描述不能为空")
|
||||||
|
private String dsp;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,108 @@
|
|||||||
|
package com.zt.plat.module.unitmanagement.controller.admin.UntInfo;
|
||||||
|
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import com.zt.plat.framework.business.interceptor.BusinessControllerMarker;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
|
||||||
|
import jakarta.validation.constraints.*;
|
||||||
|
import jakarta.validation.*;
|
||||||
|
import jakarta.servlet.http.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO;
|
||||||
|
import com.zt.plat.framework.common.pojo.PageParam;
|
||||||
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
|
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||||
|
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||||
|
import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.excel.core.util.ExcelUtils;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog;
|
||||||
|
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||||
|
|
||||||
|
import com.zt.plat.module.unitmanagement.controller.admin.UntInfo.vo.*;
|
||||||
|
import com.zt.plat.module.unitmanagement.dal.dataobject.UntInfo.UntInfoDO;
|
||||||
|
import com.zt.plat.module.unitmanagement.service.UntInfo.UntInfoService;
|
||||||
|
|
||||||
|
@Tag(name = "管理后台 - 计量单位")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/base/unit-management/unt-info")
|
||||||
|
@Validated
|
||||||
|
public class UntInfoController implements BusinessControllerMarker {
|
||||||
|
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private UntInfoService untInfoService;
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
@Operation(summary = "创建计量单位")
|
||||||
|
@PreAuthorize("@ss.hasPermission('unitmanagement:unt-info:create')")
|
||||||
|
public CommonResult<UntInfoRespVO> createUntInfo(@Valid @RequestBody UntInfoSaveReqVO createReqVO) {
|
||||||
|
return success(untInfoService.createUntInfo(createReqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update")
|
||||||
|
@Operation(summary = "更新计量单位")
|
||||||
|
@PreAuthorize("@ss.hasPermission('unitmanagement:unt-info:update')")
|
||||||
|
public CommonResult<Boolean> updateUntInfo(@Valid @RequestBody UntInfoSaveReqVO updateReqVO) {
|
||||||
|
untInfoService.updateUntInfo(updateReqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete")
|
||||||
|
@Operation(summary = "删除计量单位")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
|
@PreAuthorize("@ss.hasPermission('unitmanagement:unt-info:delete')")
|
||||||
|
public CommonResult<Boolean> deleteUntInfo(@RequestParam("id") Long id) {
|
||||||
|
untInfoService.deleteUntInfo(id);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete-list")
|
||||||
|
@Parameter(name = "ids", description = "编号", required = true)
|
||||||
|
@Operation(summary = "批量删除计量单位")
|
||||||
|
@PreAuthorize("@ss.hasPermission('unitmanagement:unt-info:delete')")
|
||||||
|
public CommonResult<Boolean> deleteUntInfoList(@RequestBody BatchDeleteReqVO req) {
|
||||||
|
untInfoService.deleteUntInfoListByIds(req.getIds());
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get")
|
||||||
|
@Operation(summary = "获得计量单位")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
|
@PreAuthorize("@ss.hasPermission('unitmanagement:unt-info:query')")
|
||||||
|
public CommonResult<UntInfoRespVO> getUntInfo(@RequestParam("id") Long id) {
|
||||||
|
UntInfoDO untInfo = untInfoService.getUntInfo(id);
|
||||||
|
return success(BeanUtils.toBean(untInfo, UntInfoRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/page")
|
||||||
|
@Operation(summary = "获得计量单位分页")
|
||||||
|
@PreAuthorize("@ss.hasPermission('unitmanagement:unt-info:query')")
|
||||||
|
public CommonResult<PageResult<UntInfoRespVO>> getUntInfoPage(@Valid UntInfoPageReqVO pageReqVO) {
|
||||||
|
PageResult<UntInfoDO> pageResult = untInfoService.getUntInfoPage(pageReqVO);
|
||||||
|
return success(BeanUtils.toBean(pageResult, UntInfoRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/export-excel")
|
||||||
|
@Operation(summary = "导出计量单位 Excel")
|
||||||
|
@PreAuthorize("@ss.hasPermission('unitmanagement:unt-info:export')")
|
||||||
|
@ApiAccessLog(operateType = EXPORT)
|
||||||
|
public void exportUntInfoExcel(@Valid UntInfoPageReqVO pageReqVO,
|
||||||
|
HttpServletResponse response) throws IOException {
|
||||||
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||||
|
List<UntInfoDO> list = untInfoService.getUntInfoPage(pageReqVO).getList();
|
||||||
|
// 导出 Excel
|
||||||
|
ExcelUtils.write(response, "计量单位.xls", "数据", UntInfoRespVO.class,
|
||||||
|
BeanUtils.toBean(list, UntInfoRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package com.zt.plat.module.unitmanagement.controller.admin.UntInfo.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import com.zt.plat.framework.common.pojo.PageParam;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 计量单位分页 Request VO")
|
||||||
|
@Data
|
||||||
|
public class UntInfoPageReqVO extends PageParam {
|
||||||
|
|
||||||
|
@Schema(description = "单位名称", example = "王五")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "单位符号")
|
||||||
|
private String smb;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime[] createTime;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package com.zt.plat.module.unitmanagement.controller.admin.UntInfo.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.alibaba.excel.annotation.*;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 计量单位 Response VO")
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class UntInfoRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "18527")
|
||||||
|
@ExcelProperty("主键ID")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "单位名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
|
||||||
|
@ExcelProperty("单位名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "单位符号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("单位符号")
|
||||||
|
private String smb;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("创建时间")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
package com.zt.plat.module.unitmanagement.controller.admin.UntInfo.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import jakarta.validation.constraints.*;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 计量单位新增/修改 Request VO")
|
||||||
|
@Data
|
||||||
|
public class UntInfoSaveReqVO {
|
||||||
|
|
||||||
|
@Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "18527")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "单位名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
|
||||||
|
@NotEmpty(message = "单位名称不能为空")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "单位符号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotEmpty(message = "单位符号不能为空")
|
||||||
|
private String smb;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
package com.zt.plat.module.unitmanagement.dal.dao.QuantityUnitRelation;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
|
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
|
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
import com.zt.plat.module.unitmanagement.dal.dataobject.QuantityUnitRelation.QuantityUnitRelationDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import com.zt.plat.module.unitmanagement.controller.admin.QuantityUnitRelation.vo.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计量单位量与单位关联 Mapper
|
||||||
|
*
|
||||||
|
* @author 后台管理-1
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface QuantityUnitRelationMapper extends BaseMapperX<QuantityUnitRelationDO> {
|
||||||
|
|
||||||
|
default PageResult<QuantityUnitRelationDO> selectPage(QuantityUnitRelationPageReqVO reqVO) {
|
||||||
|
return selectPage(reqVO, new LambdaQueryWrapperX<QuantityUnitRelationDO>()
|
||||||
|
.eqIfPresent(QuantityUnitRelationDO::getUntQtyId, reqVO.getUntQtyId())
|
||||||
|
.eqIfPresent(QuantityUnitRelationDO::getIsBse, reqVO.getIsBse())
|
||||||
|
.orderByDesc(QuantityUnitRelationDO::getUntQtyId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据量纲ID查询所有关联关系
|
||||||
|
*
|
||||||
|
* @param untQtyId 量纲ID
|
||||||
|
* @return 关联关系列表
|
||||||
|
*/
|
||||||
|
default List<QuantityUnitRelationDO> selectListByUntQtyId(Long untQtyId) {
|
||||||
|
return selectList(new LambdaQueryWrapperX<QuantityUnitRelationDO>()
|
||||||
|
.eq(QuantityUnitRelationDO::getUntQtyId, untQtyId));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
package com.zt.plat.module.unitmanagement.dal.dao.UnitConversion;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
|
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
|
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
import com.zt.plat.module.unitmanagement.dal.dataobject.UnitConversion.UnitConversionDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import com.zt.plat.module.unitmanagement.controller.admin.UnitConversion.vo.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单位转换 Mapper
|
||||||
|
*
|
||||||
|
* @author 后台管理-1
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface UnitConversionMapper extends BaseMapperX<UnitConversionDO> {
|
||||||
|
|
||||||
|
default PageResult<UnitConversionDO> selectPage(UnitConversionPageReqVO reqVO) {
|
||||||
|
return selectPage(reqVO, new LambdaQueryWrapperX<UnitConversionDO>()
|
||||||
|
.eqIfPresent(UnitConversionDO::getSrcUntId, reqVO.getSrcUntId())
|
||||||
|
.eqIfPresent(UnitConversionDO::getTgtUntId, reqVO.getTgtUntId())
|
||||||
|
.eqIfPresent(UnitConversionDO::getFctr, reqVO.getFctr())
|
||||||
|
.eqIfPresent(UnitConversionDO::getFmu, reqVO.getFmu())
|
||||||
|
.betweenIfPresent(UnitConversionDO::getCreateTime, reqVO.getCreateTime())
|
||||||
|
.orderByDesc(UnitConversionDO::getId));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package com.zt.plat.module.unitmanagement.dal.dao.UnitQuantity;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
|
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
|
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
import com.zt.plat.module.unitmanagement.dal.dataobject.UnitQuantity.UnitQuantityDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import com.zt.plat.module.unitmanagement.controller.admin.UnitQuantity.vo.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计量单位量 Mapper
|
||||||
|
*
|
||||||
|
* @author 后台管理-1
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface UnitQuantityMapper extends BaseMapperX<UnitQuantityDO> {
|
||||||
|
|
||||||
|
default PageResult<UnitQuantityDO> selectPage(UnitQuantityPageReqVO reqVO) {
|
||||||
|
return selectPage(reqVO, new LambdaQueryWrapperX<UnitQuantityDO>()
|
||||||
|
.likeIfPresent(UnitQuantityDO::getName, reqVO.getName())
|
||||||
|
.eqIfPresent(UnitQuantityDO::getSymbol, reqVO.getSymbol())
|
||||||
|
.eqIfPresent(UnitQuantityDO::getDsp, reqVO.getDsp())
|
||||||
|
.betweenIfPresent(UnitQuantityDO::getCreateTime, reqVO.getCreateTime())
|
||||||
|
.orderByDesc(UnitQuantityDO::getId));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
package com.zt.plat.module.unitmanagement.dal.dao.UntInfo;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
|
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
|
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
import com.zt.plat.module.unitmanagement.dal.dataobject.UntInfo.UntInfoDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import com.zt.plat.module.unitmanagement.controller.admin.UntInfo.vo.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计量单位 Mapper
|
||||||
|
*
|
||||||
|
* @author 后台管理-1
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface UntInfoMapper extends BaseMapperX<UntInfoDO> {
|
||||||
|
|
||||||
|
default PageResult<UntInfoDO> selectPage(UntInfoPageReqVO reqVO) {
|
||||||
|
return selectPage(reqVO, new LambdaQueryWrapperX<UntInfoDO>()
|
||||||
|
.likeIfPresent(UntInfoDO::getName, reqVO.getName())
|
||||||
|
.eqIfPresent(UntInfoDO::getSmb, reqVO.getSmb())
|
||||||
|
.betweenIfPresent(UntInfoDO::getCreateTime, reqVO.getCreateTime())
|
||||||
|
.orderByDesc(UntInfoDO::getId));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
package com.zt.plat.module.unitmanagement.dal.dataobject.QuantityUnitRelation;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.mybatis.core.dataobject.BaseDO;
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
/**
|
||||||
|
* 计量单位量与单位关联 DO
|
||||||
|
*
|
||||||
|
* @author 后台管理-1
|
||||||
|
*/
|
||||||
|
@TableName("bse_unt_qty_unt")
|
||||||
|
@KeySequence("bse_unt_qty_unt_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
/**
|
||||||
|
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||||
|
*/
|
||||||
|
public class QuantityUnitRelationDO extends BaseDO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键ID
|
||||||
|
*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计量单位量ID
|
||||||
|
*/
|
||||||
|
@TableField("UNT_QTY_ID")
|
||||||
|
private Long untQtyId;
|
||||||
|
/**
|
||||||
|
* 计量单位ID
|
||||||
|
*/
|
||||||
|
@TableField("UNT_ID")
|
||||||
|
private Long untId;
|
||||||
|
/**
|
||||||
|
* 是否基准单位-标识该维度基准单位
|
||||||
|
*/
|
||||||
|
@TableField("IS_BSE")
|
||||||
|
private Integer isBse;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
package com.zt.plat.module.unitmanagement.dal.dataobject.UnitConversion;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.mybatis.core.dataobject.BaseDO;
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
/**
|
||||||
|
* 单位转换 DO
|
||||||
|
*
|
||||||
|
* @author 后台管理-1
|
||||||
|
*/
|
||||||
|
@TableName("bse_unt_cnv")
|
||||||
|
@KeySequence("bse_unt_cnv_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
/**
|
||||||
|
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||||
|
*/
|
||||||
|
public class UnitConversionDO extends BaseDO {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键ID
|
||||||
|
*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 源单位ID
|
||||||
|
*/
|
||||||
|
@TableField("SRC_UNT_ID")
|
||||||
|
private Long srcUntId;
|
||||||
|
/**
|
||||||
|
* 目标单位ID
|
||||||
|
*/
|
||||||
|
@TableField("TGT_UNT_ID")
|
||||||
|
private Long tgtUntId;
|
||||||
|
/**
|
||||||
|
* 转换因子
|
||||||
|
*/
|
||||||
|
@TableField("FCTR")
|
||||||
|
private BigDecimal fctr;
|
||||||
|
/**
|
||||||
|
* 转换公式
|
||||||
|
*/
|
||||||
|
@TableField("FMU")
|
||||||
|
private String fmu;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,50 @@
|
|||||||
|
package com.zt.plat.module.unitmanagement.dal.dataobject.UnitQuantity;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.mybatis.core.dataobject.BaseDO;
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
/**
|
||||||
|
* 计量单位量 DO
|
||||||
|
*
|
||||||
|
* @author 后台管理-1
|
||||||
|
*/
|
||||||
|
@TableName("bse_unt_qty")
|
||||||
|
@KeySequence("bse_unt_qty_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
/**
|
||||||
|
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||||
|
*/
|
||||||
|
public class UnitQuantityDO extends BaseDO {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键ID
|
||||||
|
*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 计量名称
|
||||||
|
*/
|
||||||
|
@TableField("NAME")
|
||||||
|
private String name;
|
||||||
|
/**
|
||||||
|
* 计量符号
|
||||||
|
*/
|
||||||
|
@TableField("SYMBOL")
|
||||||
|
private String symbol;
|
||||||
|
/**
|
||||||
|
* 计量描述
|
||||||
|
*/
|
||||||
|
@TableField("DSP")
|
||||||
|
private String dsp;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
package com.zt.plat.module.unitmanagement.dal.dataobject.UntInfo;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.mybatis.core.dataobject.BaseDO;
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
/**
|
||||||
|
* 计量单位 DO
|
||||||
|
*
|
||||||
|
* @author 后台管理-1
|
||||||
|
*/
|
||||||
|
@TableName("bse_unt_inf")
|
||||||
|
@KeySequence("bse_unt_inf_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
/**
|
||||||
|
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||||
|
*/
|
||||||
|
public class UntInfoDO extends BaseDO {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键ID
|
||||||
|
*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 单位名称
|
||||||
|
*/
|
||||||
|
@TableField("NAME")
|
||||||
|
private String name;
|
||||||
|
/**
|
||||||
|
* 单位符号
|
||||||
|
*/
|
||||||
|
@TableField("SMB")
|
||||||
|
private String smb;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,70 @@
|
|||||||
|
package com.zt.plat.module.unitmanagement.service.QuantityUnitRelation;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import jakarta.validation.*;
|
||||||
|
import com.zt.plat.module.unitmanagement.controller.admin.QuantityUnitRelation.vo.*;
|
||||||
|
import com.zt.plat.module.unitmanagement.dal.dataobject.QuantityUnitRelation.QuantityUnitRelationDO;
|
||||||
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
|
import com.zt.plat.framework.common.pojo.PageParam;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计量单位量与单位关联 Service 接口
|
||||||
|
*
|
||||||
|
* @author 后台管理-1
|
||||||
|
*/
|
||||||
|
public interface QuantityUnitRelationService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建计量单位量与单位关联
|
||||||
|
*
|
||||||
|
* @param createReqVO 创建信息
|
||||||
|
* @return 编号
|
||||||
|
*/
|
||||||
|
QuantityUnitRelationRespVO createQuantityUnitRelation(@Valid QuantityUnitRelationSaveReqVO createReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新计量单位量与单位关联
|
||||||
|
*
|
||||||
|
* @param updateReqVO 更新信息
|
||||||
|
*/
|
||||||
|
void updateQuantityUnitRelation(@Valid QuantityUnitRelationSaveReqVO updateReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除计量单位量与单位关联
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
*/
|
||||||
|
void deleteQuantityUnitRelation(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除计量单位量与单位关联
|
||||||
|
*
|
||||||
|
* @param ids 编号
|
||||||
|
*/
|
||||||
|
void deleteQuantityUnitRelationListByIds(List<Long> ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得计量单位量与单位关联
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
* @return 计量单位量与单位关联
|
||||||
|
*/
|
||||||
|
QuantityUnitRelationDO getQuantityUnitRelation(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得计量单位量与单位关联分页
|
||||||
|
*
|
||||||
|
* @param pageReqVO 分页查询
|
||||||
|
* @return 计量单位量与单位关联分页
|
||||||
|
*/
|
||||||
|
PageResult<QuantityUnitRelationDO> getQuantityUnitRelationPage(QuantityUnitRelationPageReqVO pageReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量保存计量单位量与单位关联
|
||||||
|
* 根据传入的量纲ID和单位列表,进行新增、更新和逻辑删除操作
|
||||||
|
*
|
||||||
|
* @param batchSaveReqVO 批量保存请求
|
||||||
|
*/
|
||||||
|
void batchSaveQuantityUnitRelations(@Valid QuantityUnitRelationBatchSaveReqVO batchSaveReqVO);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,141 @@
|
|||||||
|
package com.zt.plat.module.unitmanagement.service.QuantityUnitRelation;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import com.zt.plat.module.unitmanagement.controller.admin.QuantityUnitRelation.vo.*;
|
||||||
|
import com.zt.plat.module.unitmanagement.dal.dataobject.QuantityUnitRelation.QuantityUnitRelationDO;
|
||||||
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
|
import com.zt.plat.framework.common.pojo.PageParam;
|
||||||
|
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||||
|
|
||||||
|
import com.zt.plat.module.unitmanagement.dal.dao.QuantityUnitRelation.QuantityUnitRelationMapper;
|
||||||
|
|
||||||
|
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
|
import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList;
|
||||||
|
import static com.zt.plat.framework.common.util.collection.CollectionUtils.diffList;
|
||||||
|
import static com.zt.plat.module.unitmanagement.enums.UnitErrorCodeConstants.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计量单位量与单位关联 Service 实现类
|
||||||
|
*
|
||||||
|
* @author 后台管理-1
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Validated
|
||||||
|
public class QuantityUnitRelationServiceImpl implements QuantityUnitRelationService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private QuantityUnitRelationMapper quantityUnitRelationMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public QuantityUnitRelationRespVO createQuantityUnitRelation(QuantityUnitRelationSaveReqVO createReqVO) {
|
||||||
|
// 插入
|
||||||
|
QuantityUnitRelationDO quantityUnitRelation = BeanUtils.toBean(createReqVO, QuantityUnitRelationDO.class);
|
||||||
|
quantityUnitRelationMapper.insert(quantityUnitRelation);
|
||||||
|
// 返回
|
||||||
|
return BeanUtils.toBean(quantityUnitRelation, QuantityUnitRelationRespVO.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateQuantityUnitRelation(QuantityUnitRelationSaveReqVO updateReqVO) {
|
||||||
|
// 校验存在
|
||||||
|
validateQuantityUnitRelationExists(updateReqVO.getId());
|
||||||
|
// 更新
|
||||||
|
QuantityUnitRelationDO updateObj = BeanUtils.toBean(updateReqVO, QuantityUnitRelationDO.class);
|
||||||
|
quantityUnitRelationMapper.updateById(updateObj);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteQuantityUnitRelation(Long id) {
|
||||||
|
// 校验存在
|
||||||
|
validateQuantityUnitRelationExists(id);
|
||||||
|
// 删除
|
||||||
|
quantityUnitRelationMapper.deleteById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteQuantityUnitRelationListByIds(List<Long> ids) {
|
||||||
|
// 校验存在
|
||||||
|
validateQuantityUnitRelationExists(ids);
|
||||||
|
// 删除
|
||||||
|
quantityUnitRelationMapper.deleteByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validateQuantityUnitRelationExists(List<Long> ids) {
|
||||||
|
List<QuantityUnitRelationDO> list = quantityUnitRelationMapper.selectByIds(ids);
|
||||||
|
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
|
||||||
|
throw exception(QUANTITY_UNIT_RELATION_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validateQuantityUnitRelationExists(Long id) {
|
||||||
|
if (quantityUnitRelationMapper.selectById(id) == null) {
|
||||||
|
throw exception(QUANTITY_UNIT_RELATION_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public QuantityUnitRelationDO getQuantityUnitRelation(Long id) {
|
||||||
|
return quantityUnitRelationMapper.selectById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<QuantityUnitRelationDO> getQuantityUnitRelationPage(QuantityUnitRelationPageReqVO pageReqVO) {
|
||||||
|
return quantityUnitRelationMapper.selectPage(pageReqVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void batchSaveQuantityUnitRelations(QuantityUnitRelationBatchSaveReqVO batchSaveReqVO) {
|
||||||
|
Long untQtyId = batchSaveReqVO.getUntQtyId();
|
||||||
|
List<QuantityUnitRelationBatchSaveReqVO.UnitRelationItemVO> requestItems = batchSaveReqVO.getUnitRelations();
|
||||||
|
|
||||||
|
// 1. 查询数据库中该量纲下的所有现有关联关系
|
||||||
|
List<QuantityUnitRelationDO> existingRelations = quantityUnitRelationMapper.selectListByUntQtyId(untQtyId);
|
||||||
|
|
||||||
|
// 2. 提取请求中的ID列表(排除null)
|
||||||
|
List<Long> requestIds = requestItems.stream()
|
||||||
|
.map(QuantityUnitRelationBatchSaveReqVO.UnitRelationItemVO::getId)
|
||||||
|
.filter(Objects::nonNull)
|
||||||
|
.toList();
|
||||||
|
|
||||||
|
// 3. 提取现有数据的ID列表
|
||||||
|
List<Long> existingIds = convertList(existingRelations, QuantityUnitRelationDO::getId);
|
||||||
|
|
||||||
|
// 4. 找出需要删除的ID(数据库有但请求中没有的)
|
||||||
|
List<Long> toDeleteIds = new ArrayList<>();
|
||||||
|
for (Long existingId : existingIds) {
|
||||||
|
if (!requestIds.contains(existingId)) {
|
||||||
|
toDeleteIds.add(existingId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 5. 执行逻辑删除
|
||||||
|
if (CollUtil.isNotEmpty(toDeleteIds)) {
|
||||||
|
quantityUnitRelationMapper.deleteByIds(toDeleteIds);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 6. 处理新增和更新
|
||||||
|
for (QuantityUnitRelationBatchSaveReqVO.UnitRelationItemVO item : requestItems) {
|
||||||
|
QuantityUnitRelationDO relation = new QuantityUnitRelationDO();
|
||||||
|
relation.setUntQtyId(untQtyId);
|
||||||
|
relation.setUntId(item.getUntId());
|
||||||
|
relation.setIsBse(item.getIsBse());
|
||||||
|
|
||||||
|
if (item.getId() != null) {
|
||||||
|
// 更新操作
|
||||||
|
relation.setId(item.getId());
|
||||||
|
quantityUnitRelationMapper.updateById(relation);
|
||||||
|
} else {
|
||||||
|
// 新增操作
|
||||||
|
quantityUnitRelationMapper.insert(relation);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
package com.zt.plat.module.unitmanagement.service.UnitConversion;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import jakarta.validation.*;
|
||||||
|
import com.zt.plat.module.unitmanagement.controller.admin.UnitConversion.vo.*;
|
||||||
|
import com.zt.plat.module.unitmanagement.dal.dataobject.UnitConversion.UnitConversionDO;
|
||||||
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
|
import com.zt.plat.framework.common.pojo.PageParam;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单位转换 Service 接口
|
||||||
|
*
|
||||||
|
* @author 后台管理-1
|
||||||
|
*/
|
||||||
|
public interface UnitConversionService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建单位转换
|
||||||
|
*
|
||||||
|
* @param createReqVO 创建信息
|
||||||
|
* @return 编号
|
||||||
|
*/
|
||||||
|
UnitConversionRespVO createUnitConversion(@Valid UnitConversionSaveReqVO createReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新单位转换
|
||||||
|
*
|
||||||
|
* @param updateReqVO 更新信息
|
||||||
|
*/
|
||||||
|
void updateUnitConversion(@Valid UnitConversionSaveReqVO updateReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除单位转换
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
*/
|
||||||
|
void deleteUnitConversion(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除单位转换
|
||||||
|
*
|
||||||
|
* @param ids 编号
|
||||||
|
*/
|
||||||
|
void deleteUnitConversionListByIds(List<Long> ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得单位转换
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
* @return 单位转换
|
||||||
|
*/
|
||||||
|
UnitConversionDO getUnitConversion(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得单位转换分页
|
||||||
|
*
|
||||||
|
* @param pageReqVO 分页查询
|
||||||
|
* @return 单位转换分页
|
||||||
|
*/
|
||||||
|
PageResult<UnitConversionDO> getUnitConversionPage(UnitConversionPageReqVO pageReqVO);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,92 @@
|
|||||||
|
package com.zt.plat.module.unitmanagement.service.UnitConversion;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import com.zt.plat.module.unitmanagement.controller.admin.UnitConversion.vo.*;
|
||||||
|
import com.zt.plat.module.unitmanagement.dal.dataobject.UnitConversion.UnitConversionDO;
|
||||||
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
|
import com.zt.plat.framework.common.pojo.PageParam;
|
||||||
|
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||||
|
|
||||||
|
import com.zt.plat.module.unitmanagement.dal.dao.UnitConversion.UnitConversionMapper;
|
||||||
|
|
||||||
|
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
|
import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList;
|
||||||
|
import static com.zt.plat.framework.common.util.collection.CollectionUtils.diffList;
|
||||||
|
import static com.zt.plat.module.unitmanagement.enums.UnitErrorCodeConstants.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单位转换 Service 实现类
|
||||||
|
*
|
||||||
|
* @author 后台管理-1
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Validated
|
||||||
|
public class UnitConversionServiceImpl implements UnitConversionService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private UnitConversionMapper unitConversionMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public UnitConversionRespVO createUnitConversion(UnitConversionSaveReqVO createReqVO) {
|
||||||
|
// 插入
|
||||||
|
UnitConversionDO unitConversion = BeanUtils.toBean(createReqVO, UnitConversionDO.class);
|
||||||
|
unitConversionMapper.insert(unitConversion);
|
||||||
|
// 返回
|
||||||
|
return BeanUtils.toBean(unitConversion, UnitConversionRespVO.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateUnitConversion(UnitConversionSaveReqVO updateReqVO) {
|
||||||
|
// 校验存在
|
||||||
|
validateUnitConversionExists(updateReqVO.getId());
|
||||||
|
// 更新
|
||||||
|
UnitConversionDO updateObj = BeanUtils.toBean(updateReqVO, UnitConversionDO.class);
|
||||||
|
unitConversionMapper.updateById(updateObj);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteUnitConversion(Long id) {
|
||||||
|
// 校验存在
|
||||||
|
validateUnitConversionExists(id);
|
||||||
|
// 删除
|
||||||
|
unitConversionMapper.deleteById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteUnitConversionListByIds(List<Long> ids) {
|
||||||
|
// 校验存在
|
||||||
|
validateUnitConversionExists(ids);
|
||||||
|
// 删除
|
||||||
|
unitConversionMapper.deleteByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validateUnitConversionExists(List<Long> ids) {
|
||||||
|
List<UnitConversionDO> list = unitConversionMapper.selectByIds(ids);
|
||||||
|
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
|
||||||
|
throw exception(UNIT_CONVERSION_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validateUnitConversionExists(Long id) {
|
||||||
|
if (unitConversionMapper.selectById(id) == null) {
|
||||||
|
throw exception(UNIT_CONVERSION_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public UnitConversionDO getUnitConversion(Long id) {
|
||||||
|
return unitConversionMapper.selectById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<UnitConversionDO> getUnitConversionPage(UnitConversionPageReqVO pageReqVO) {
|
||||||
|
return unitConversionMapper.selectPage(pageReqVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
package com.zt.plat.module.unitmanagement.service.UnitQuantity;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import jakarta.validation.*;
|
||||||
|
import com.zt.plat.module.unitmanagement.controller.admin.UnitQuantity.vo.*;
|
||||||
|
import com.zt.plat.module.unitmanagement.dal.dataobject.UnitQuantity.UnitQuantityDO;
|
||||||
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
|
import com.zt.plat.framework.common.pojo.PageParam;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计量单位量 Service 接口
|
||||||
|
*
|
||||||
|
* @author 后台管理-1
|
||||||
|
*/
|
||||||
|
public interface UnitQuantityService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建计量单位量
|
||||||
|
*
|
||||||
|
* @param createReqVO 创建信息
|
||||||
|
* @return 编号
|
||||||
|
*/
|
||||||
|
UnitQuantityRespVO createUnitQuantity(@Valid UnitQuantitySaveReqVO createReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新计量单位量
|
||||||
|
*
|
||||||
|
* @param updateReqVO 更新信息
|
||||||
|
*/
|
||||||
|
void updateUnitQuantity(@Valid UnitQuantitySaveReqVO updateReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除计量单位量
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
*/
|
||||||
|
void deleteUnitQuantity(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除计量单位量
|
||||||
|
*
|
||||||
|
* @param ids 编号
|
||||||
|
*/
|
||||||
|
void deleteUnitQuantityListByIds(List<Long> ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得计量单位量
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
* @return 计量单位量
|
||||||
|
*/
|
||||||
|
UnitQuantityDO getUnitQuantity(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得计量单位量分页
|
||||||
|
*
|
||||||
|
* @param pageReqVO 分页查询
|
||||||
|
* @return 计量单位量分页
|
||||||
|
*/
|
||||||
|
PageResult<UnitQuantityDO> getUnitQuantityPage(UnitQuantityPageReqVO pageReqVO);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,92 @@
|
|||||||
|
package com.zt.plat.module.unitmanagement.service.UnitQuantity;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import com.zt.plat.module.unitmanagement.controller.admin.UnitQuantity.vo.*;
|
||||||
|
import com.zt.plat.module.unitmanagement.dal.dataobject.UnitQuantity.UnitQuantityDO;
|
||||||
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
|
import com.zt.plat.framework.common.pojo.PageParam;
|
||||||
|
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||||
|
|
||||||
|
import com.zt.plat.module.unitmanagement.dal.dao.UnitQuantity.UnitQuantityMapper;
|
||||||
|
|
||||||
|
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
|
import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList;
|
||||||
|
import static com.zt.plat.framework.common.util.collection.CollectionUtils.diffList;
|
||||||
|
import static com.zt.plat.module.unitmanagement.enums.UnitErrorCodeConstants.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计量单位量 Service 实现类
|
||||||
|
*
|
||||||
|
* @author 后台管理-1
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Validated
|
||||||
|
public class UnitQuantityServiceImpl implements UnitQuantityService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private UnitQuantityMapper unitQuantityMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public UnitQuantityRespVO createUnitQuantity(UnitQuantitySaveReqVO createReqVO) {
|
||||||
|
// 插入
|
||||||
|
UnitQuantityDO unitQuantity = BeanUtils.toBean(createReqVO, UnitQuantityDO.class);
|
||||||
|
unitQuantityMapper.insert(unitQuantity);
|
||||||
|
// 返回
|
||||||
|
return BeanUtils.toBean(unitQuantity, UnitQuantityRespVO.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateUnitQuantity(UnitQuantitySaveReqVO updateReqVO) {
|
||||||
|
// 校验存在
|
||||||
|
validateUnitQuantityExists(updateReqVO.getId());
|
||||||
|
// 更新
|
||||||
|
UnitQuantityDO updateObj = BeanUtils.toBean(updateReqVO, UnitQuantityDO.class);
|
||||||
|
unitQuantityMapper.updateById(updateObj);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteUnitQuantity(Long id) {
|
||||||
|
// 校验存在
|
||||||
|
validateUnitQuantityExists(id);
|
||||||
|
// 删除
|
||||||
|
unitQuantityMapper.deleteById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteUnitQuantityListByIds(List<Long> ids) {
|
||||||
|
// 校验存在
|
||||||
|
validateUnitQuantityExists(ids);
|
||||||
|
// 删除
|
||||||
|
unitQuantityMapper.deleteByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validateUnitQuantityExists(List<Long> ids) {
|
||||||
|
List<UnitQuantityDO> list = unitQuantityMapper.selectByIds(ids);
|
||||||
|
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
|
||||||
|
throw exception(UNIT_QUANTITY_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validateUnitQuantityExists(Long id) {
|
||||||
|
if (unitQuantityMapper.selectById(id) == null) {
|
||||||
|
throw exception(UNIT_QUANTITY_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public UnitQuantityDO getUnitQuantity(Long id) {
|
||||||
|
return unitQuantityMapper.selectById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<UnitQuantityDO> getUnitQuantityPage(UnitQuantityPageReqVO pageReqVO) {
|
||||||
|
return unitQuantityMapper.selectPage(pageReqVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
package com.zt.plat.module.unitmanagement.service.UntInfo;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import jakarta.validation.*;
|
||||||
|
import com.zt.plat.module.unitmanagement.controller.admin.UntInfo.vo.*;
|
||||||
|
import com.zt.plat.module.unitmanagement.dal.dataobject.UntInfo.UntInfoDO;
|
||||||
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
|
import com.zt.plat.framework.common.pojo.PageParam;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计量单位 Service 接口
|
||||||
|
*
|
||||||
|
* @author 后台管理-1
|
||||||
|
*/
|
||||||
|
public interface UntInfoService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建计量单位
|
||||||
|
*
|
||||||
|
* @param createReqVO 创建信息
|
||||||
|
* @return 编号
|
||||||
|
*/
|
||||||
|
UntInfoRespVO createUntInfo(@Valid UntInfoSaveReqVO createReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新计量单位
|
||||||
|
*
|
||||||
|
* @param updateReqVO 更新信息
|
||||||
|
*/
|
||||||
|
void updateUntInfo(@Valid UntInfoSaveReqVO updateReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除计量单位
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
*/
|
||||||
|
void deleteUntInfo(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除计量单位
|
||||||
|
*
|
||||||
|
* @param ids 编号
|
||||||
|
*/
|
||||||
|
void deleteUntInfoListByIds(List<Long> ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得计量单位
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
* @return 计量单位
|
||||||
|
*/
|
||||||
|
UntInfoDO getUntInfo(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得计量单位分页
|
||||||
|
*
|
||||||
|
* @param pageReqVO 分页查询
|
||||||
|
* @return 计量单位分页
|
||||||
|
*/
|
||||||
|
PageResult<UntInfoDO> getUntInfoPage(UntInfoPageReqVO pageReqVO);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,92 @@
|
|||||||
|
package com.zt.plat.module.unitmanagement.service.UntInfo;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import com.zt.plat.module.unitmanagement.controller.admin.UntInfo.vo.*;
|
||||||
|
import com.zt.plat.module.unitmanagement.dal.dataobject.UntInfo.UntInfoDO;
|
||||||
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
|
import com.zt.plat.framework.common.pojo.PageParam;
|
||||||
|
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||||
|
|
||||||
|
import com.zt.plat.module.unitmanagement.dal.dao.UntInfo.UntInfoMapper;
|
||||||
|
|
||||||
|
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
|
import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList;
|
||||||
|
import static com.zt.plat.framework.common.util.collection.CollectionUtils.diffList;
|
||||||
|
import static com.zt.plat.module.unitmanagement.enums.UnitErrorCodeConstants.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计量单位 Service 实现类
|
||||||
|
*
|
||||||
|
* @author 后台管理-1
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Validated
|
||||||
|
public class UntInfoServiceImpl implements UntInfoService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private UntInfoMapper untInfoMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public UntInfoRespVO createUntInfo(UntInfoSaveReqVO createReqVO) {
|
||||||
|
// 插入
|
||||||
|
UntInfoDO untInfo = BeanUtils.toBean(createReqVO, UntInfoDO.class);
|
||||||
|
untInfoMapper.insert(untInfo);
|
||||||
|
// 返回
|
||||||
|
return BeanUtils.toBean(untInfo, UntInfoRespVO.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateUntInfo(UntInfoSaveReqVO updateReqVO) {
|
||||||
|
// 校验存在
|
||||||
|
validateUntInfoExists(updateReqVO.getId());
|
||||||
|
// 更新
|
||||||
|
UntInfoDO updateObj = BeanUtils.toBean(updateReqVO, UntInfoDO.class);
|
||||||
|
untInfoMapper.updateById(updateObj);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteUntInfo(Long id) {
|
||||||
|
// 校验存在
|
||||||
|
validateUntInfoExists(id);
|
||||||
|
// 删除
|
||||||
|
untInfoMapper.deleteById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteUntInfoListByIds(List<Long> ids) {
|
||||||
|
// 校验存在
|
||||||
|
validateUntInfoExists(ids);
|
||||||
|
// 删除
|
||||||
|
untInfoMapper.deleteByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validateUntInfoExists(List<Long> ids) {
|
||||||
|
List<UntInfoDO> list = untInfoMapper.selectByIds(ids);
|
||||||
|
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
|
||||||
|
throw exception(UNT_INFO_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validateUntInfoExists(Long id) {
|
||||||
|
if (untInfoMapper.selectById(id) == null) {
|
||||||
|
throw exception(UNT_INFO_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public UntInfoDO getUntInfo(Long id) {
|
||||||
|
return untInfoMapper.selectById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<UntInfoDO> getUntInfoPage(UntInfoPageReqVO pageReqVO) {
|
||||||
|
return untInfoMapper.selectPage(pageReqVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.zt.plat.module.unit-management.dal.dao.QuantityUnitRelation.QuantityUnitRelationMapper">
|
||||||
|
|
||||||
|
<!--
|
||||||
|
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||||
|
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||||
|
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||||
|
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||||
|
-->
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.zt.plat.module.unit-management.dal.dao.UnitConversion.UnitConversionMapper">
|
||||||
|
|
||||||
|
<!--
|
||||||
|
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||||
|
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||||
|
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||||
|
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||||
|
-->
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.zt.plat.module.unit-management.dal.dao.unitQuantity.UnitQuantityMapper">
|
||||||
|
|
||||||
|
<!--
|
||||||
|
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||||
|
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||||
|
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||||
|
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||||
|
-->
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.zt.plat.module.unit-management.dal.dao.untinfo.UntInfoMapper">
|
||||||
|
|
||||||
|
<!--
|
||||||
|
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||||
|
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||||
|
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||||
|
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||||
|
-->
|
||||||
|
|
||||||
|
</mapper>
|
||||||
Reference in New Issue
Block a user