Compare commits
1 Commits
04596350b6
...
lims_dev
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
927731c217 |
@@ -149,6 +149,9 @@ public interface ErrorCodeConstants {
|
|||||||
ErrorCode MATERIAL_INFOMATION_NOT_EXISTS = new ErrorCode(1_032_150_000, "试剂耗材不存在");
|
ErrorCode MATERIAL_INFOMATION_NOT_EXISTS = new ErrorCode(1_032_150_000, "试剂耗材不存在");
|
||||||
ErrorCode MATERIAL_PRODUCT_NOT_EXISTS = new ErrorCode(1_032_150_000, "试剂耗材大类不存在");
|
ErrorCode MATERIAL_PRODUCT_NOT_EXISTS = new ErrorCode(1_032_150_000, "试剂耗材大类不存在");
|
||||||
|
|
||||||
|
ErrorCode MATERIAL_LIFECYCLE_DETAIL_NOT_EXISTS = new ErrorCode(1_032_150_000, "物料通用流程明细不存在");
|
||||||
|
ErrorCode MATERIAL_LIFECYCLE_NOT_EXISTS = new ErrorCode(1_032_150_000, "物料通用流程不存在");
|
||||||
|
|
||||||
|
|
||||||
/*================================= tx 1_032_200_000 ~ 1_032_249_999 ==================================*/
|
/*================================= tx 1_032_200_000 ~ 1_032_249_999 ==================================*/
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,118 @@
|
|||||||
|
package com.zt.plat.module.qms.resource.material.controller.admin;
|
||||||
|
|
||||||
|
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialLifecyclePageReqVO;
|
||||||
|
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialLifecycleRespVO;
|
||||||
|
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialLifecycleSaveReqVO;
|
||||||
|
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 com.zt.plat.framework.business.annotation.FileUploadController;
|
||||||
|
import com.zt.plat.framework.business.controller.AbstractFileUploadController;
|
||||||
|
|
||||||
|
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.*;
|
||||||
|
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.qms.resource.material.dal.dataobject.MaterialLifecycleDO;
|
||||||
|
import com.zt.plat.module.qms.resource.material.service.MaterialLifecycleService;
|
||||||
|
|
||||||
|
@Tag(name = "管理后台 - 物料通用流程")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/qms/material-lifecycle")
|
||||||
|
@Validated
|
||||||
|
@FileUploadController(source = "qms.materiallifecycle")
|
||||||
|
public class MaterialLifecycleController extends AbstractFileUploadController implements BusinessControllerMarker{
|
||||||
|
|
||||||
|
static {
|
||||||
|
FileUploadController annotation = MaterialLifecycleController.class.getAnnotation(FileUploadController.class);
|
||||||
|
if (annotation != null) {
|
||||||
|
setFileUploadInfo(annotation);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private MaterialLifecycleService materialLifecycleService;
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
@Operation(summary = "创建物料通用流程")
|
||||||
|
@PreAuthorize("@ss.hasPermission('qms:material-lifecycle:create')")
|
||||||
|
public CommonResult<MaterialLifecycleRespVO> createMaterialLifecycle(@Valid @RequestBody MaterialLifecycleSaveReqVO createReqVO) {
|
||||||
|
return success(materialLifecycleService.createMaterialLifecycle(createReqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update")
|
||||||
|
@Operation(summary = "更新物料通用流程")
|
||||||
|
@PreAuthorize("@ss.hasPermission('qms:material-lifecycle:update')")
|
||||||
|
public CommonResult<Boolean> updateMaterialLifecycle(@Valid @RequestBody MaterialLifecycleSaveReqVO updateReqVO) {
|
||||||
|
materialLifecycleService.updateMaterialLifecycle(updateReqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete")
|
||||||
|
@Operation(summary = "删除物料通用流程")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
|
@PreAuthorize("@ss.hasPermission('qms:material-lifecycle:delete')")
|
||||||
|
public CommonResult<Boolean> deleteMaterialLifecycle(@RequestParam("id") Long id) {
|
||||||
|
materialLifecycleService.deleteMaterialLifecycle(id);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete-list")
|
||||||
|
@Parameter(name = "ids", description = "编号", required = true)
|
||||||
|
@Operation(summary = "批量删除物料通用流程")
|
||||||
|
@PreAuthorize("@ss.hasPermission('qms:material-lifecycle:delete')")
|
||||||
|
public CommonResult<Boolean> deleteMaterialLifecycleList(@RequestBody BatchDeleteReqVO req) {
|
||||||
|
materialLifecycleService.deleteMaterialLifecycleListByIds(req.getIds());
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get")
|
||||||
|
@Operation(summary = "获得物料通用流程")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
|
@PreAuthorize("@ss.hasPermission('qms:material-lifecycle:query')")
|
||||||
|
public CommonResult<MaterialLifecycleRespVO> getMaterialLifecycle(@RequestParam("id") Long id) {
|
||||||
|
MaterialLifecycleDO materialLifecycle = materialLifecycleService.getMaterialLifecycle(id);
|
||||||
|
return success(BeanUtils.toBean(materialLifecycle, MaterialLifecycleRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/page")
|
||||||
|
@Operation(summary = "获得物料通用流程分页")
|
||||||
|
@PreAuthorize("@ss.hasPermission('qms:material-lifecycle:query')")
|
||||||
|
public CommonResult<PageResult<MaterialLifecycleRespVO>> getMaterialLifecyclePage(@Valid MaterialLifecyclePageReqVO pageReqVO) {
|
||||||
|
PageResult<MaterialLifecycleDO> pageResult = materialLifecycleService.getMaterialLifecyclePage(pageReqVO);
|
||||||
|
return success(BeanUtils.toBean(pageResult, MaterialLifecycleRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/export-excel")
|
||||||
|
@Operation(summary = "导出物料通用流程 Excel")
|
||||||
|
@PreAuthorize("@ss.hasPermission('qms:material-lifecycle:export')")
|
||||||
|
@ApiAccessLog(operateType = EXPORT)
|
||||||
|
public void exportMaterialLifecycleExcel(@Valid MaterialLifecyclePageReqVO pageReqVO,
|
||||||
|
HttpServletResponse response) throws IOException {
|
||||||
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||||
|
List<MaterialLifecycleDO> list = materialLifecycleService.getMaterialLifecyclePage(pageReqVO).getList();
|
||||||
|
// 导出 Excel
|
||||||
|
ExcelUtils.write(response, "物料通用流程.xls", "数据", MaterialLifecycleRespVO.class,
|
||||||
|
BeanUtils.toBean(list, MaterialLifecycleRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,118 @@
|
|||||||
|
package com.zt.plat.module.qms.resource.material.controller.admin;
|
||||||
|
|
||||||
|
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialLifecycleDetailPageReqVO;
|
||||||
|
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialLifecycleDetailRespVO;
|
||||||
|
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialLifecycleDetailSaveReqVO;
|
||||||
|
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 com.zt.plat.framework.business.annotation.FileUploadController;
|
||||||
|
import com.zt.plat.framework.business.controller.AbstractFileUploadController;
|
||||||
|
|
||||||
|
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.*;
|
||||||
|
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.qms.resource.material.dal.dataobject.MaterialLifecycleDetailDO;
|
||||||
|
import com.zt.plat.module.qms.resource.material.service.MaterialLifecycleDetailService;
|
||||||
|
|
||||||
|
@Tag(name = "管理后台 - 物料通用流程明细,对应生命周期的明细")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/qms/material-lifecycle-detail")
|
||||||
|
@Validated
|
||||||
|
@FileUploadController(source = "qms.materiallifecycledetail")
|
||||||
|
public class MaterialLifecycleDetailController extends AbstractFileUploadController implements BusinessControllerMarker{
|
||||||
|
|
||||||
|
static {
|
||||||
|
FileUploadController annotation = MaterialLifecycleDetailController.class.getAnnotation(FileUploadController.class);
|
||||||
|
if (annotation != null) {
|
||||||
|
setFileUploadInfo(annotation);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private MaterialLifecycleDetailService materialLifecycleDetailService;
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
@Operation(summary = "创建物料通用流程明细,对应生命周期的明细")
|
||||||
|
@PreAuthorize("@ss.hasPermission('qms:material-lifecycle-detail:create')")
|
||||||
|
public CommonResult<MaterialLifecycleDetailRespVO> createMaterialLifecycleDetail(@Valid @RequestBody MaterialLifecycleDetailSaveReqVO createReqVO) {
|
||||||
|
return success(materialLifecycleDetailService.createMaterialLifecycleDetail(createReqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update")
|
||||||
|
@Operation(summary = "更新物料通用流程明细,对应生命周期的明细")
|
||||||
|
@PreAuthorize("@ss.hasPermission('qms:material-lifecycle-detail:update')")
|
||||||
|
public CommonResult<Boolean> updateMaterialLifecycleDetail(@Valid @RequestBody MaterialLifecycleDetailSaveReqVO updateReqVO) {
|
||||||
|
materialLifecycleDetailService.updateMaterialLifecycleDetail(updateReqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete")
|
||||||
|
@Operation(summary = "删除物料通用流程明细,对应生命周期的明细")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
|
@PreAuthorize("@ss.hasPermission('qms:material-lifecycle-detail:delete')")
|
||||||
|
public CommonResult<Boolean> deleteMaterialLifecycleDetail(@RequestParam("id") Long id) {
|
||||||
|
materialLifecycleDetailService.deleteMaterialLifecycleDetail(id);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete-list")
|
||||||
|
@Parameter(name = "ids", description = "编号", required = true)
|
||||||
|
@Operation(summary = "批量删除物料通用流程明细,对应生命周期的明细")
|
||||||
|
@PreAuthorize("@ss.hasPermission('qms:material-lifecycle-detail:delete')")
|
||||||
|
public CommonResult<Boolean> deleteMaterialLifecycleDetailList(@RequestBody BatchDeleteReqVO req) {
|
||||||
|
materialLifecycleDetailService.deleteMaterialLifecycleDetailListByIds(req.getIds());
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get")
|
||||||
|
@Operation(summary = "获得物料通用流程明细,对应生命周期的明细")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
|
@PreAuthorize("@ss.hasPermission('qms:material-lifecycle-detail:query')")
|
||||||
|
public CommonResult<MaterialLifecycleDetailRespVO> getMaterialLifecycleDetail(@RequestParam("id") Long id) {
|
||||||
|
MaterialLifecycleDetailDO materialLifecycleDetail = materialLifecycleDetailService.getMaterialLifecycleDetail(id);
|
||||||
|
return success(BeanUtils.toBean(materialLifecycleDetail, MaterialLifecycleDetailRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/page")
|
||||||
|
@Operation(summary = "获得物料通用流程明细,对应生命周期的明细分页")
|
||||||
|
@PreAuthorize("@ss.hasPermission('qms:material-lifecycle-detail:query')")
|
||||||
|
public CommonResult<PageResult<MaterialLifecycleDetailRespVO>> getMaterialLifecycleDetailPage(@Valid MaterialLifecycleDetailPageReqVO pageReqVO) {
|
||||||
|
PageResult<MaterialLifecycleDetailDO> pageResult = materialLifecycleDetailService.getMaterialLifecycleDetailPage(pageReqVO);
|
||||||
|
return success(BeanUtils.toBean(pageResult, MaterialLifecycleDetailRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/export-excel")
|
||||||
|
@Operation(summary = "导出物料通用流程明细,对应生命周期的明细 Excel")
|
||||||
|
@PreAuthorize("@ss.hasPermission('qms:material-lifecycle-detail:export')")
|
||||||
|
@ApiAccessLog(operateType = EXPORT)
|
||||||
|
public void exportMaterialLifecycleDetailExcel(@Valid MaterialLifecycleDetailPageReqVO pageReqVO,
|
||||||
|
HttpServletResponse response) throws IOException {
|
||||||
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||||
|
List<MaterialLifecycleDetailDO> list = materialLifecycleDetailService.getMaterialLifecycleDetailPage(pageReqVO).getList();
|
||||||
|
// 导出 Excel
|
||||||
|
ExcelUtils.write(response, "物料通用流程明细,对应生命周期的明细.xls", "数据", MaterialLifecycleDetailRespVO.class,
|
||||||
|
BeanUtils.toBean(list, MaterialLifecycleDetailRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
package com.zt.plat.module.qms.resource.material.controller.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
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 MaterialLifecycleDetailPageReqVO extends PageParam {
|
||||||
|
|
||||||
|
@Schema(description = "父ID", example = "24095")
|
||||||
|
private Long materialLifecycleId;
|
||||||
|
|
||||||
|
@Schema(description = "物料批次编号", example = "30393")
|
||||||
|
private Long batchId;
|
||||||
|
|
||||||
|
@Schema(description = "物料大类编号", example = "1020")
|
||||||
|
private String categoryProductId;
|
||||||
|
|
||||||
|
@Schema(description = "物料实例编号", example = "11872")
|
||||||
|
private Long infomationId;
|
||||||
|
|
||||||
|
@Schema(description = "影响数量", example = "28166")
|
||||||
|
private String influenceCount;
|
||||||
|
|
||||||
|
@Schema(description = "明细操作类型", example = "2")
|
||||||
|
private String businessType;
|
||||||
|
|
||||||
|
@Schema(description = "处理状态", example = "1")
|
||||||
|
private Integer treatmentStatus;
|
||||||
|
|
||||||
|
@Schema(description = "表单数据,表单数据")
|
||||||
|
private String formData;
|
||||||
|
|
||||||
|
@Schema(description = "所属部门")
|
||||||
|
private String systemDepartmentCode;
|
||||||
|
|
||||||
|
@Schema(description = "公司名称", example = "赵六")
|
||||||
|
private String companyName;
|
||||||
|
|
||||||
|
@Schema(description = "备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime[] createTime;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,74 @@
|
|||||||
|
package com.zt.plat.module.qms.resource.material.controller.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.alibaba.excel.annotation.*;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 物料通用流程明细,对应生命周期的明细 Response VO")
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class MaterialLifecycleDetailRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "30686")
|
||||||
|
@ExcelProperty("主键")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "父ID", example = "24095")
|
||||||
|
@ExcelProperty("父ID")
|
||||||
|
private Long materialLifecycleId;
|
||||||
|
|
||||||
|
@Schema(description = "物料批次编号", example = "30393")
|
||||||
|
@ExcelProperty("物料批次编号")
|
||||||
|
private Long batchId;
|
||||||
|
|
||||||
|
@Schema(description = "物料大类编号", example = "1020")
|
||||||
|
@ExcelProperty("物料大类编号")
|
||||||
|
private String categoryProductId;
|
||||||
|
|
||||||
|
@Schema(description = "物料实例编号", example = "11872")
|
||||||
|
@ExcelProperty("物料实例编号")
|
||||||
|
private Long infomationId;
|
||||||
|
|
||||||
|
@Schema(description = "影响数量", example = "28166")
|
||||||
|
@ExcelProperty("影响数量")
|
||||||
|
private String influenceCount;
|
||||||
|
|
||||||
|
@Schema(description = "明细操作类型", example = "2")
|
||||||
|
@ExcelProperty("明细操作类型")
|
||||||
|
private String businessType;
|
||||||
|
|
||||||
|
@Schema(description = "处理状态", example = "1")
|
||||||
|
@ExcelProperty("处理状态")
|
||||||
|
private Integer treatmentStatus;
|
||||||
|
|
||||||
|
@Schema(description = "表单数据,表单数据")
|
||||||
|
@ExcelProperty("表单数据,表单数据")
|
||||||
|
private String formData;
|
||||||
|
|
||||||
|
@Schema(description = "所属部门")
|
||||||
|
@ExcelProperty("所属部门")
|
||||||
|
private String systemDepartmentCode;
|
||||||
|
|
||||||
|
@Schema(description = "公司编号", example = "2613")
|
||||||
|
@ExcelProperty("公司编号")
|
||||||
|
private Long companyId;
|
||||||
|
|
||||||
|
@Schema(description = "公司名称", example = "赵六")
|
||||||
|
@ExcelProperty("公司名称")
|
||||||
|
private String companyName;
|
||||||
|
|
||||||
|
@Schema(description = "部门编号", example = "32413")
|
||||||
|
@ExcelProperty("部门编号")
|
||||||
|
private Long deptId;
|
||||||
|
|
||||||
|
@Schema(description = "备注")
|
||||||
|
@ExcelProperty("备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@ExcelProperty("创建时间")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
package com.zt.plat.module.qms.resource.material.controller.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 物料通用流程明细,对应生命周期的明细新增/修改 Request VO")
|
||||||
|
@Data
|
||||||
|
public class MaterialLifecycleDetailSaveReqVO {
|
||||||
|
|
||||||
|
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "30686")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "父ID", example = "24095")
|
||||||
|
private Long materialLifecycleId;
|
||||||
|
|
||||||
|
@Schema(description = "物料批次编号", example = "30393")
|
||||||
|
private Long batchId;
|
||||||
|
|
||||||
|
@Schema(description = "物料大类编号", example = "1020")
|
||||||
|
private String categoryProductId;
|
||||||
|
|
||||||
|
@Schema(description = "物料实例编号", example = "11872")
|
||||||
|
private Long infomationId;
|
||||||
|
|
||||||
|
@Schema(description = "影响数量", example = "28166")
|
||||||
|
private String influenceCount;
|
||||||
|
|
||||||
|
@Schema(description = "明细操作类型", example = "2")
|
||||||
|
private String businessType;
|
||||||
|
|
||||||
|
@Schema(description = "处理状态", example = "1")
|
||||||
|
private Integer treatmentStatus;
|
||||||
|
|
||||||
|
@Schema(description = "表单数据,表单数据")
|
||||||
|
private String formData;
|
||||||
|
|
||||||
|
@Schema(description = "所属部门")
|
||||||
|
private String systemDepartmentCode;
|
||||||
|
|
||||||
|
@Schema(description = "公司编号", example = "2613")
|
||||||
|
private Long companyId;
|
||||||
|
|
||||||
|
@Schema(description = "公司名称", example = "赵六")
|
||||||
|
private String companyName;
|
||||||
|
|
||||||
|
@Schema(description = "备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
package com.zt.plat.module.qms.resource.material.controller.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
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 MaterialLifecyclePageReqVO extends PageParam {
|
||||||
|
|
||||||
|
@Schema(description = "标题")
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
@Schema(description = "业务类型,【字典】【jy_material_lifecycle_bsn_type】验收、退换货、配置申请", example = "2")
|
||||||
|
private String businessType;
|
||||||
|
|
||||||
|
@Schema(description = "业务类型编码")
|
||||||
|
private String businessTypeCode;
|
||||||
|
|
||||||
|
@Schema(description = "申请人")
|
||||||
|
private String applyUser;
|
||||||
|
|
||||||
|
@Schema(description = "申请人id", example = "29846")
|
||||||
|
private Long applyUserId;
|
||||||
|
|
||||||
|
@Schema(description = "申请部门")
|
||||||
|
private String applyDepartment;
|
||||||
|
|
||||||
|
@Schema(description = "申请部门id", example = "7174")
|
||||||
|
private Long applyDepartmentId;
|
||||||
|
|
||||||
|
@Schema(description = "申请时间")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime[] applyTime;
|
||||||
|
|
||||||
|
@Schema(description = "表单数据,表单数据")
|
||||||
|
private String formData;
|
||||||
|
|
||||||
|
@Schema(description = "流程实例id", example = "28688")
|
||||||
|
private String flowInstanceId;
|
||||||
|
|
||||||
|
@Schema(description = "流程审批状态", example = "2")
|
||||||
|
private String flowStatus;
|
||||||
|
|
||||||
|
@Schema(description = "所属部门")
|
||||||
|
private String systemDepartmentCode;
|
||||||
|
|
||||||
|
@Schema(description = "备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime[] createTime;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,74 @@
|
|||||||
|
package com.zt.plat.module.qms.resource.material.controller.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.alibaba.excel.annotation.*;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 物料通用流程 Response VO")
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class MaterialLifecycleRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "4561")
|
||||||
|
@ExcelProperty("主键")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "标题")
|
||||||
|
@ExcelProperty("标题")
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
@Schema(description = "业务类型,【字典】【jy_material_lifecycle_bsn_type】验收、退换货、配置申请", example = "2")
|
||||||
|
@ExcelProperty("业务类型,【字典】【jy_material_lifecycle_bsn_type】验收、退换货、配置申请")
|
||||||
|
private String businessType;
|
||||||
|
|
||||||
|
@Schema(description = "业务类型编码")
|
||||||
|
@ExcelProperty("业务类型编码")
|
||||||
|
private String businessTypeCode;
|
||||||
|
|
||||||
|
@Schema(description = "申请人")
|
||||||
|
@ExcelProperty("申请人")
|
||||||
|
private String applyUser;
|
||||||
|
|
||||||
|
@Schema(description = "申请人id", example = "29846")
|
||||||
|
@ExcelProperty("申请人id")
|
||||||
|
private Long applyUserId;
|
||||||
|
|
||||||
|
@Schema(description = "申请部门")
|
||||||
|
@ExcelProperty("申请部门")
|
||||||
|
private String applyDepartment;
|
||||||
|
|
||||||
|
@Schema(description = "申请部门id", example = "7174")
|
||||||
|
@ExcelProperty("申请部门id")
|
||||||
|
private Long applyDepartmentId;
|
||||||
|
|
||||||
|
@Schema(description = "申请时间")
|
||||||
|
@ExcelProperty("申请时间")
|
||||||
|
private LocalDateTime applyTime;
|
||||||
|
|
||||||
|
@Schema(description = "表单数据,表单数据")
|
||||||
|
@ExcelProperty("表单数据,表单数据")
|
||||||
|
private String formData;
|
||||||
|
|
||||||
|
@Schema(description = "流程实例id", example = "28688")
|
||||||
|
@ExcelProperty("流程实例id")
|
||||||
|
private String flowInstanceId;
|
||||||
|
|
||||||
|
@Schema(description = "流程审批状态", example = "2")
|
||||||
|
@ExcelProperty("流程审批状态")
|
||||||
|
private String flowStatus;
|
||||||
|
|
||||||
|
@Schema(description = "所属部门")
|
||||||
|
@ExcelProperty("所属部门")
|
||||||
|
private String systemDepartmentCode;
|
||||||
|
|
||||||
|
@Schema(description = "备注")
|
||||||
|
@ExcelProperty("备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@ExcelProperty("创建时间")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
package com.zt.plat.module.qms.resource.material.controller.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 物料通用流程新增/修改 Request VO")
|
||||||
|
@Data
|
||||||
|
public class MaterialLifecycleSaveReqVO {
|
||||||
|
|
||||||
|
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "4561")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "标题")
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
@Schema(description = "业务类型,【字典】【jy_material_lifecycle_bsn_type】验收、退换货、配置申请", example = "2")
|
||||||
|
private String businessType;
|
||||||
|
|
||||||
|
@Schema(description = "业务类型编码")
|
||||||
|
private String businessTypeCode;
|
||||||
|
|
||||||
|
@Schema(description = "申请人")
|
||||||
|
private String applyUser;
|
||||||
|
|
||||||
|
@Schema(description = "申请人id", example = "29846")
|
||||||
|
private Long applyUserId;
|
||||||
|
|
||||||
|
@Schema(description = "申请部门")
|
||||||
|
private String applyDepartment;
|
||||||
|
|
||||||
|
@Schema(description = "申请部门id", example = "7174")
|
||||||
|
private Long applyDepartmentId;
|
||||||
|
|
||||||
|
@Schema(description = "申请时间")
|
||||||
|
private LocalDateTime applyTime;
|
||||||
|
|
||||||
|
@Schema(description = "表单数据,表单数据")
|
||||||
|
private String formData;
|
||||||
|
|
||||||
|
@Schema(description = "流程实例id", example = "28688")
|
||||||
|
private String flowInstanceId;
|
||||||
|
|
||||||
|
@Schema(description = "流程审批状态", example = "2")
|
||||||
|
private String flowStatus;
|
||||||
|
|
||||||
|
@Schema(description = "所属部门")
|
||||||
|
private String systemDepartmentCode;
|
||||||
|
|
||||||
|
@Schema(description = "备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,100 @@
|
|||||||
|
package com.zt.plat.module.qms.resource.material.dal.dataobject;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
|
||||||
|
/**
|
||||||
|
* 物料通用流程 DO
|
||||||
|
*
|
||||||
|
* @author 后台管理
|
||||||
|
*/
|
||||||
|
@TableName("t_mtrl_lfc")
|
||||||
|
@KeySequence("t_mtrl_lfc_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
/**
|
||||||
|
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||||
|
*/
|
||||||
|
public class MaterialLifecycleDO extends BusinessBaseDO {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 标题
|
||||||
|
*/
|
||||||
|
@TableField("TTL")
|
||||||
|
private String title;
|
||||||
|
/**
|
||||||
|
* 业务类型,【字典】【jy_material_lifecycle_bsn_type】验收、退换货、配置申请
|
||||||
|
*/
|
||||||
|
@TableField("BSN_TP")
|
||||||
|
private String businessType;
|
||||||
|
/**
|
||||||
|
* 业务类型编码
|
||||||
|
*/
|
||||||
|
@TableField("BSN_TP_CD")
|
||||||
|
private String businessTypeCode;
|
||||||
|
/**
|
||||||
|
* 申请人
|
||||||
|
*/
|
||||||
|
@TableField("APL_USER")
|
||||||
|
private String applyUser;
|
||||||
|
/**
|
||||||
|
* 申请人id
|
||||||
|
*/
|
||||||
|
@TableField("APL_USER_ID")
|
||||||
|
private Long applyUserId;
|
||||||
|
/**
|
||||||
|
* 申请部门
|
||||||
|
*/
|
||||||
|
@TableField("APL_DEPT")
|
||||||
|
private String applyDepartment;
|
||||||
|
/**
|
||||||
|
* 申请部门id
|
||||||
|
*/
|
||||||
|
@TableField("APL_DEPT_ID")
|
||||||
|
private Long applyDepartmentId;
|
||||||
|
/**
|
||||||
|
* 申请时间
|
||||||
|
*/
|
||||||
|
@TableField("APL_TM")
|
||||||
|
private LocalDateTime applyTime;
|
||||||
|
/**
|
||||||
|
* 表单数据,表单数据
|
||||||
|
*/
|
||||||
|
@TableField("FORM_DAT")
|
||||||
|
private String formData;
|
||||||
|
/**
|
||||||
|
* 流程实例id
|
||||||
|
*/
|
||||||
|
@TableField("FLW_INSC_ID")
|
||||||
|
private String flowInstanceId;
|
||||||
|
/**
|
||||||
|
* 流程审批状态
|
||||||
|
*/
|
||||||
|
@TableField("FLW_STS")
|
||||||
|
private String flowStatus;
|
||||||
|
/**
|
||||||
|
* 所属部门
|
||||||
|
*/
|
||||||
|
@TableField("SYS_DEPT_CD")
|
||||||
|
private String systemDepartmentCode;
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
@TableField("RMK")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,82 @@
|
|||||||
|
package com.zt.plat.module.qms.resource.material.dal.dataobject;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
|
||||||
|
/**
|
||||||
|
* 物料通用流程明细,对应生命周期的明细 DO
|
||||||
|
*
|
||||||
|
* @author 后台管理
|
||||||
|
*/
|
||||||
|
@TableName("t_mtrl_lfc_dtl")
|
||||||
|
@KeySequence("t_mtrl_lfc_dtl_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
/**
|
||||||
|
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||||
|
*/
|
||||||
|
public class MaterialLifecycleDetailDO extends BusinessBaseDO {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 父ID
|
||||||
|
*/
|
||||||
|
@TableField("MTRL_LFC_ID")
|
||||||
|
private Long materialLifecycleId;
|
||||||
|
/**
|
||||||
|
* 物料批次编号
|
||||||
|
*/
|
||||||
|
@TableField("BAT_ID")
|
||||||
|
private Long batchId;
|
||||||
|
/**
|
||||||
|
* 物料大类编号
|
||||||
|
*/
|
||||||
|
@TableField("CTGR_PDT_ID")
|
||||||
|
private String categoryProductId;
|
||||||
|
/**
|
||||||
|
* 物料实例编号
|
||||||
|
*/
|
||||||
|
@TableField("INF_ID")
|
||||||
|
private Long infomationId;
|
||||||
|
/**
|
||||||
|
* 影响数量
|
||||||
|
*/
|
||||||
|
@TableField("INFL_CNT")
|
||||||
|
private String influenceCount;
|
||||||
|
/**
|
||||||
|
* 明细操作类型
|
||||||
|
*/
|
||||||
|
@TableField("BSN_TP")
|
||||||
|
private String businessType;
|
||||||
|
/**
|
||||||
|
* 处理状态
|
||||||
|
*/
|
||||||
|
@TableField("TMT_STS")
|
||||||
|
private Integer treatmentStatus;
|
||||||
|
/**
|
||||||
|
* 表单数据,表单数据
|
||||||
|
*/
|
||||||
|
@TableField("FORM_DAT")
|
||||||
|
private String formData;
|
||||||
|
/**
|
||||||
|
* 所属部门
|
||||||
|
*/
|
||||||
|
@TableField("SYS_DEPT_CD")
|
||||||
|
private String systemDepartmentCode;
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
@TableField("RMK")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
package com.zt.plat.module.qms.resource.material.dal.mapper;
|
||||||
|
|
||||||
|
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.qms.resource.material.dal.dataobject.MaterialLifecycleDetailDO;
|
||||||
|
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialLifecycleDetailPageReqVO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料通用流程明细,对应生命周期的明细 Mapper
|
||||||
|
*
|
||||||
|
* @author 后台管理
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface MaterialLifecycleDetailMapper extends BaseMapperX<MaterialLifecycleDetailDO> {
|
||||||
|
|
||||||
|
default PageResult<MaterialLifecycleDetailDO> selectPage(MaterialLifecycleDetailPageReqVO reqVO) {
|
||||||
|
return selectPage(reqVO, new LambdaQueryWrapperX<MaterialLifecycleDetailDO>()
|
||||||
|
.eqIfPresent(MaterialLifecycleDetailDO::getMaterialLifecycleId, reqVO.getMaterialLifecycleId())
|
||||||
|
.eqIfPresent(MaterialLifecycleDetailDO::getBatchId, reqVO.getBatchId())
|
||||||
|
.eqIfPresent(MaterialLifecycleDetailDO::getCategoryProductId, reqVO.getCategoryProductId())
|
||||||
|
.eqIfPresent(MaterialLifecycleDetailDO::getInfomationId, reqVO.getInfomationId())
|
||||||
|
.eqIfPresent(MaterialLifecycleDetailDO::getInfluenceCount, reqVO.getInfluenceCount())
|
||||||
|
.eqIfPresent(MaterialLifecycleDetailDO::getBusinessType, reqVO.getBusinessType())
|
||||||
|
.eqIfPresent(MaterialLifecycleDetailDO::getTreatmentStatus, reqVO.getTreatmentStatus())
|
||||||
|
.eqIfPresent(MaterialLifecycleDetailDO::getFormData, reqVO.getFormData())
|
||||||
|
.eqIfPresent(MaterialLifecycleDetailDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
|
||||||
|
.likeIfPresent(MaterialLifecycleDetailDO::getCompanyName, reqVO.getCompanyName())
|
||||||
|
.eqIfPresent(MaterialLifecycleDetailDO::getRemark, reqVO.getRemark())
|
||||||
|
.betweenIfPresent(MaterialLifecycleDetailDO::getCreateTime, reqVO.getCreateTime())
|
||||||
|
.orderByDesc(MaterialLifecycleDetailDO::getId));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package com.zt.plat.module.qms.resource.material.dal.mapper;
|
||||||
|
|
||||||
|
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.qms.resource.material.controller.vo.MaterialLifecyclePageReqVO;
|
||||||
|
import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialLifecycleDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料通用流程 Mapper
|
||||||
|
*
|
||||||
|
* @author 后台管理
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface MaterialLifecycleMapper extends BaseMapperX<MaterialLifecycleDO> {
|
||||||
|
|
||||||
|
default PageResult<MaterialLifecycleDO> selectPage(MaterialLifecyclePageReqVO reqVO) {
|
||||||
|
return selectPage(reqVO, new LambdaQueryWrapperX<MaterialLifecycleDO>()
|
||||||
|
.eqIfPresent(MaterialLifecycleDO::getTitle, reqVO.getTitle())
|
||||||
|
.eqIfPresent(MaterialLifecycleDO::getBusinessType, reqVO.getBusinessType())
|
||||||
|
.eqIfPresent(MaterialLifecycleDO::getBusinessTypeCode, reqVO.getBusinessTypeCode())
|
||||||
|
.eqIfPresent(MaterialLifecycleDO::getApplyUser, reqVO.getApplyUser())
|
||||||
|
.eqIfPresent(MaterialLifecycleDO::getApplyUserId, reqVO.getApplyUserId())
|
||||||
|
.eqIfPresent(MaterialLifecycleDO::getApplyDepartment, reqVO.getApplyDepartment())
|
||||||
|
.eqIfPresent(MaterialLifecycleDO::getApplyDepartmentId, reqVO.getApplyDepartmentId())
|
||||||
|
.betweenIfPresent(MaterialLifecycleDO::getApplyTime, reqVO.getApplyTime())
|
||||||
|
.eqIfPresent(MaterialLifecycleDO::getFormData, reqVO.getFormData())
|
||||||
|
.eqIfPresent(MaterialLifecycleDO::getFlowInstanceId, reqVO.getFlowInstanceId())
|
||||||
|
.eqIfPresent(MaterialLifecycleDO::getFlowStatus, reqVO.getFlowStatus())
|
||||||
|
.eqIfPresent(MaterialLifecycleDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
|
||||||
|
.eqIfPresent(MaterialLifecycleDO::getRemark, reqVO.getRemark())
|
||||||
|
.betweenIfPresent(MaterialLifecycleDO::getCreateTime, reqVO.getCreateTime())
|
||||||
|
.orderByDesc(MaterialLifecycleDO::getId));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,64 @@
|
|||||||
|
package com.zt.plat.module.qms.resource.material.service;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialLifecycleDetailPageReqVO;
|
||||||
|
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialLifecycleDetailRespVO;
|
||||||
|
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialLifecycleDetailSaveReqVO;
|
||||||
|
import jakarta.validation.*;
|
||||||
|
import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialLifecycleDetailDO;
|
||||||
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料通用流程明细,对应生命周期的明细 Service 接口
|
||||||
|
*
|
||||||
|
* @author 后台管理
|
||||||
|
*/
|
||||||
|
public interface MaterialLifecycleDetailService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建物料通用流程明细,对应生命周期的明细
|
||||||
|
*
|
||||||
|
* @param createReqVO 创建信息
|
||||||
|
* @return 编号
|
||||||
|
*/
|
||||||
|
MaterialLifecycleDetailRespVO createMaterialLifecycleDetail(@Valid MaterialLifecycleDetailSaveReqVO createReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新物料通用流程明细,对应生命周期的明细
|
||||||
|
*
|
||||||
|
* @param updateReqVO 更新信息
|
||||||
|
*/
|
||||||
|
void updateMaterialLifecycleDetail(@Valid MaterialLifecycleDetailSaveReqVO updateReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除物料通用流程明细,对应生命周期的明细
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
*/
|
||||||
|
void deleteMaterialLifecycleDetail(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除物料通用流程明细,对应生命周期的明细
|
||||||
|
*
|
||||||
|
* @param ids 编号
|
||||||
|
*/
|
||||||
|
void deleteMaterialLifecycleDetailListByIds(List<Long> ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得物料通用流程明细,对应生命周期的明细
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
* @return 物料通用流程明细,对应生命周期的明细
|
||||||
|
*/
|
||||||
|
MaterialLifecycleDetailDO getMaterialLifecycleDetail(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得物料通用流程明细,对应生命周期的明细分页
|
||||||
|
*
|
||||||
|
* @param pageReqVO 分页查询
|
||||||
|
* @return 物料通用流程明细,对应生命周期的明细分页
|
||||||
|
*/
|
||||||
|
PageResult<MaterialLifecycleDetailDO> getMaterialLifecycleDetailPage(MaterialLifecycleDetailPageReqVO pageReqVO);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,92 @@
|
|||||||
|
package com.zt.plat.module.qms.resource.material.service;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialLifecycleDetailPageReqVO;
|
||||||
|
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialLifecycleDetailRespVO;
|
||||||
|
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialLifecycleDetailSaveReqVO;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialLifecycleDetailDO;
|
||||||
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
|
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||||
|
|
||||||
|
import com.zt.plat.module.qms.resource.material.dal.mapper.MaterialLifecycleDetailMapper;
|
||||||
|
|
||||||
|
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.module.qms.enums.ErrorCodeConstants.MATERIAL_LIFECYCLE_DETAIL_NOT_EXISTS;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料通用流程明细,对应生命周期的明细 Service 实现类
|
||||||
|
*
|
||||||
|
* @author 后台管理
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Validated
|
||||||
|
public class MaterialLifecycleDetailServiceImpl implements MaterialLifecycleDetailService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private MaterialLifecycleDetailMapper materialLifecycleDetailMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MaterialLifecycleDetailRespVO createMaterialLifecycleDetail(MaterialLifecycleDetailSaveReqVO createReqVO) {
|
||||||
|
// 插入
|
||||||
|
MaterialLifecycleDetailDO materialLifecycleDetail = BeanUtils.toBean(createReqVO, MaterialLifecycleDetailDO.class);
|
||||||
|
materialLifecycleDetailMapper.insert(materialLifecycleDetail);
|
||||||
|
// 返回
|
||||||
|
return BeanUtils.toBean(materialLifecycleDetail, MaterialLifecycleDetailRespVO.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateMaterialLifecycleDetail(MaterialLifecycleDetailSaveReqVO updateReqVO) {
|
||||||
|
// 校验存在
|
||||||
|
validateMaterialLifecycleDetailExists(updateReqVO.getId());
|
||||||
|
// 更新
|
||||||
|
MaterialLifecycleDetailDO updateObj = BeanUtils.toBean(updateReqVO, MaterialLifecycleDetailDO.class);
|
||||||
|
materialLifecycleDetailMapper.updateById(updateObj);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteMaterialLifecycleDetail(Long id) {
|
||||||
|
// 校验存在
|
||||||
|
validateMaterialLifecycleDetailExists(id);
|
||||||
|
// 删除
|
||||||
|
materialLifecycleDetailMapper.deleteById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteMaterialLifecycleDetailListByIds(List<Long> ids) {
|
||||||
|
// 校验存在
|
||||||
|
validateMaterialLifecycleDetailExists(ids);
|
||||||
|
// 删除
|
||||||
|
materialLifecycleDetailMapper.deleteByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validateMaterialLifecycleDetailExists(List<Long> ids) {
|
||||||
|
List<MaterialLifecycleDetailDO> list = materialLifecycleDetailMapper.selectByIds(ids);
|
||||||
|
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
|
||||||
|
throw exception(MATERIAL_LIFECYCLE_DETAIL_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validateMaterialLifecycleDetailExists(Long id) {
|
||||||
|
if (materialLifecycleDetailMapper.selectById(id) == null) {
|
||||||
|
throw exception(MATERIAL_LIFECYCLE_DETAIL_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MaterialLifecycleDetailDO getMaterialLifecycleDetail(Long id) {
|
||||||
|
return materialLifecycleDetailMapper.selectById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<MaterialLifecycleDetailDO> getMaterialLifecycleDetailPage(MaterialLifecycleDetailPageReqVO pageReqVO) {
|
||||||
|
return materialLifecycleDetailMapper.selectPage(pageReqVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,64 @@
|
|||||||
|
package com.zt.plat.module.qms.resource.material.service;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialLifecyclePageReqVO;
|
||||||
|
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialLifecycleRespVO;
|
||||||
|
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialLifecycleSaveReqVO;
|
||||||
|
import jakarta.validation.*;
|
||||||
|
import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialLifecycleDO;
|
||||||
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料通用流程 Service 接口
|
||||||
|
*
|
||||||
|
* @author 后台管理
|
||||||
|
*/
|
||||||
|
public interface MaterialLifecycleService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建物料通用流程
|
||||||
|
*
|
||||||
|
* @param createReqVO 创建信息
|
||||||
|
* @return 编号
|
||||||
|
*/
|
||||||
|
MaterialLifecycleRespVO createMaterialLifecycle(@Valid MaterialLifecycleSaveReqVO createReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新物料通用流程
|
||||||
|
*
|
||||||
|
* @param updateReqVO 更新信息
|
||||||
|
*/
|
||||||
|
void updateMaterialLifecycle(@Valid MaterialLifecycleSaveReqVO updateReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除物料通用流程
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
*/
|
||||||
|
void deleteMaterialLifecycle(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除物料通用流程
|
||||||
|
*
|
||||||
|
* @param ids 编号
|
||||||
|
*/
|
||||||
|
void deleteMaterialLifecycleListByIds(List<Long> ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得物料通用流程
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
* @return 物料通用流程
|
||||||
|
*/
|
||||||
|
MaterialLifecycleDO getMaterialLifecycle(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得物料通用流程分页
|
||||||
|
*
|
||||||
|
* @param pageReqVO 分页查询
|
||||||
|
* @return 物料通用流程分页
|
||||||
|
*/
|
||||||
|
PageResult<MaterialLifecycleDO> getMaterialLifecyclePage(MaterialLifecyclePageReqVO pageReqVO);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,92 @@
|
|||||||
|
package com.zt.plat.module.qms.resource.material.service;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialLifecyclePageReqVO;
|
||||||
|
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialLifecycleRespVO;
|
||||||
|
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialLifecycleSaveReqVO;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialLifecycleDO;
|
||||||
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
|
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||||
|
|
||||||
|
import com.zt.plat.module.qms.resource.material.dal.mapper.MaterialLifecycleMapper;
|
||||||
|
|
||||||
|
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.module.qms.enums.ErrorCodeConstants.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料通用流程 Service 实现类
|
||||||
|
*
|
||||||
|
* @author 后台管理
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Validated
|
||||||
|
public class MaterialLifecycleServiceImpl implements MaterialLifecycleService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private MaterialLifecycleMapper materialLifecycleMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MaterialLifecycleRespVO createMaterialLifecycle(MaterialLifecycleSaveReqVO createReqVO) {
|
||||||
|
// 插入
|
||||||
|
MaterialLifecycleDO materialLifecycle = BeanUtils.toBean(createReqVO, MaterialLifecycleDO.class);
|
||||||
|
materialLifecycleMapper.insert(materialLifecycle);
|
||||||
|
// 返回
|
||||||
|
return BeanUtils.toBean(materialLifecycle, MaterialLifecycleRespVO.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateMaterialLifecycle(MaterialLifecycleSaveReqVO updateReqVO) {
|
||||||
|
// 校验存在
|
||||||
|
validateMaterialLifecycleExists(updateReqVO.getId());
|
||||||
|
// 更新
|
||||||
|
MaterialLifecycleDO updateObj = BeanUtils.toBean(updateReqVO, MaterialLifecycleDO.class);
|
||||||
|
materialLifecycleMapper.updateById(updateObj);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteMaterialLifecycle(Long id) {
|
||||||
|
// 校验存在
|
||||||
|
validateMaterialLifecycleExists(id);
|
||||||
|
// 删除
|
||||||
|
materialLifecycleMapper.deleteById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteMaterialLifecycleListByIds(List<Long> ids) {
|
||||||
|
// 校验存在
|
||||||
|
validateMaterialLifecycleExists(ids);
|
||||||
|
// 删除
|
||||||
|
materialLifecycleMapper.deleteByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validateMaterialLifecycleExists(List<Long> ids) {
|
||||||
|
List<MaterialLifecycleDO> list = materialLifecycleMapper.selectByIds(ids);
|
||||||
|
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
|
||||||
|
throw exception(MATERIAL_LIFECYCLE_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validateMaterialLifecycleExists(Long id) {
|
||||||
|
if (materialLifecycleMapper.selectById(id) == null) {
|
||||||
|
throw exception(MATERIAL_LIFECYCLE_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MaterialLifecycleDO getMaterialLifecycle(Long id) {
|
||||||
|
return materialLifecycleMapper.selectById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<MaterialLifecycleDO> getMaterialLifecyclePage(MaterialLifecyclePageReqVO pageReqVO) {
|
||||||
|
return materialLifecycleMapper.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.qms.resource.material.dal.mapper.MaterialLifecycleDetailMapper">
|
||||||
|
|
||||||
|
<!--
|
||||||
|
一般情况下,尽可能使用 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.qms.resource.material.dal.mapper.MaterialLifecycleMapper">
|
||||||
|
|
||||||
|
<!--
|
||||||
|
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||||
|
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||||
|
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||||
|
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||||
|
-->
|
||||||
|
|
||||||
|
</mapper>
|
||||||
Reference in New Issue
Block a user