From b2c34982f94261241fa56e62180996693ffb490e Mon Sep 17 00:00:00 2001 From: FCL Date: Fri, 28 Nov 2025 15:22:17 +0800 Subject: [PATCH 01/11] =?UTF-8?q?feat:=E9=98=B6=E6=AE=B5=E6=80=A7=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../zt/plat/module/qms/api/task/QmsApi.java | 2 +- .../module/qms/enums/QmsCommonConstant.java | 10 + .../qms/enums/QmsPermissionConstant.java | 5 +- .../plat/module/qms/QmsServerApplication.java | 16 -- .../BusinessSampleDispatchController.java | 44 +++- .../BusinessSampleHandoverController.java | 2 +- ...usinessSampleHandoverDetailController.java | 8 + .../admin/BusinessSubSampleController.java | 8 + ...usinessAssayParameterDataExtendRespVO.java | 12 + .../vo/BusinessAssayProjectDataReqVO.java | 4 + .../vo/BusinessAssayTaskDataExtendRespVO.java | 3 + .../vo/BusinessAssayTaskDataPageReqVO.java | 6 + .../vo/BusinessAssayTaskDataReqVO.java | 6 + .../vo/BusinessAssayTaskDataRespVO.java | 8 + .../vo/BusinessAssayTaskDataSaveReqVO.java | 8 +- .../vo/BusinessAssayTaskPageReqVO.java | 9 + .../controller/vo/BusinessAssayTaskReqVO.java | 9 + .../vo/BusinessAssayTaskRespVO.java | 12 + .../vo/BusinessAssayTaskSaveReqVO.java | 10 +- .../BusinessQCCoefficientDataPageReqVO.java | 6 + .../vo/BusinessQCCoefficientDataReqVO.java | 6 + .../vo/BusinessQCCoefficientDataRespVO.java | 6 + .../BusinessQCCoefficientDataSaveReqVO.java | 6 + .../vo/BusinessQCManagementDataPageReqVO.java | 6 + .../vo/BusinessQCManagementDataReqVO.java | 6 + .../vo/BusinessQCManagementDataRespVO.java | 6 + .../vo/BusinessQCManagementDataSaveReqVO.java | 6 + .../vo/BusinessSampleDispatchRespVO.java | 2 + ...sinessSampleEntrustDetailExtendRespVO.java | 16 ++ .../BusinessSampleHandoverDetailRespVO.java | 15 ++ .../vo/BusinessSubSampleExtendRespVO.java | 21 ++ .../vo/BusinessSubSamplePageReqVO.java | 9 +- .../controller/vo/BusinessSubSampleReqVO.java | 23 ++ .../dal/dataobject/BusinessAssayTaskDO.java | 20 +- .../dataobject/BusinessAssayTaskDataDO.java | 22 +- .../BusinessQCCoefficientDataDO.java | 11 + .../BusinessQCManagementDataDO.java | 11 +- .../BusinessAssayParameterDataMapper.java | 9 + .../BusinessAssayProjectDataMapper.java | 1 + .../mapper/BusinessAssayTaskDataMapper.java | 22 +- .../dal/mapper/BusinessAssayTaskMapper.java | 8 +- .../BusinessQCCoefficientDataMapper.java | 4 + .../BusinessQCManagementDataMapper.java | 4 + .../BusinessSampleHandoverDetailMapper.java | 27 +++ .../BusinessSubSampleAnalysisGroupMapper.java | 6 + .../dal/mapper/BusinessSubSampleMapper.java | 5 + .../SampleEntrustGenSampleDataCmp.java | 21 +- .../taskassign/SampleTaskAssignManualCmp.java | 5 + .../taskassign/SampleTaskAssignMethodCmp.java | 5 + .../SampleTaskAssignQCSampleCmp.java | 1 + .../taskassign/SampleTaskAssignSampleCmp.java | 5 + .../BusinessSampleDispatchService.java | 2 +- .../BusinessSampleDispatchServiceImpl.java | 23 +- .../BusinessSampleHandoverDetailService.java | 2 + ...sinessSampleHandoverDetailServiceImpl.java | 5 + .../bus/service/BusinessSubSampleService.java | 7 + .../service/BusinessSubSampleServiceImpl.java | 81 +++++-- .../SampleAnalysisAuditServiceImpl.java | 16 +- .../service/SampleAnalysisServiceImpl.java | 140 ++++++++++-- .../SampleResultReportingServiceImpl.java | 8 + .../service/SampleTaskAssignServiceImpl.java | 2 + .../ConfigWarehouseLocationController.java | 51 ++++- .../MaterialAssayStandardController.java | 4 + ...MaterialAssayStandardDetailController.java | 8 + .../vo/ConfigSubSampleMethodConfInfo.java | 18 ++ .../vo/ConfigSubSampleMethodConfItem.java | 16 ++ .../vo/ConfigSubSampleMethodConfPoint.java | 20 ++ .../vo/ConfigWarehouseLocationPageReqVO.java | 16 ++ .../vo/ConfigWarehouseLocationRespVO.java | 17 ++ .../vo/ConfigWarehouseLocationSaveReqVO.java | 8 + .../dataobject/ConfigWarehouseLocationDO.java | 4 + .../mapper/ConfigSubSampleMethodMapper.java | 6 + .../mapper/ConfigWarehouseLocationMapper.java | 23 +- .../ConfigWarehouseLocationService.java | 6 +- .../ConfigWarehouseLocationServiceImpl.java | 30 ++- .../vo/ReportDocumentMainRespVO.java | 1 + .../ReportDocumentDataServiceImpl.java | 166 ++++++++------ .../module/qms/core/aspect/DictAspect.java | 2 +- .../module/qms/iot/mapper/IotHelloMapper.java | 2 +- .../qms/iot/service/IIotHelloService.java | 2 +- .../iot/service/impl/IotHelloServiceImpl.java | 2 +- .../admin/AutoIngredientsController.java | 2 +- .../service/AutoIngredientsServiceImpl.java | 215 +++++++++++++++++- .../mapper/BusinessAssayTaskDataMapper.xml | 1 + ...SubParentSampleAssessmentProjectMapper.xml | 62 +++-- .../dal/mapper/BusinessSubSampleMapper.xml | 2 +- ...onfigWarehouseLocationInfomationMapper.xml | 12 - .../mapper/ConfigWarehouseLocationMapper.xml | 54 +++++ 88 files changed, 1296 insertions(+), 243 deletions(-) delete mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/QmsServerApplication.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayParameterDataExtendRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleMethodConfInfo.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleMethodConfItem.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleMethodConfPoint.java delete mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/config/dal/mapper/ConfigWarehouseLocationInfomationMapper.xml diff --git a/zt-module-qms/zt-module-qms-api/src/main/java/com/zt/plat/module/qms/api/task/QmsApi.java b/zt-module-qms/zt-module-qms-api/src/main/java/com/zt/plat/module/qms/api/task/QmsApi.java index 21142fb..6216c19 100644 --- a/zt-module-qms/zt-module-qms-api/src/main/java/com/zt/plat/module/qms/api/task/QmsApi.java +++ b/zt-module-qms/zt-module-qms-api/src/main/java/com/zt/plat/module/qms/api/task/QmsApi.java @@ -1,9 +1,9 @@ package com.zt.plat.module.qms.api.task; +import com.alibaba.fastjson.JSONObject; import com.zt.plat.framework.common.pojo.CommonResult; import com.zt.plat.module.qms.api.task.dto.QmsBpmDTO; import com.zt.plat.module.qms.enums.ApiConstants; -import com.alibaba.fastjson.JSONObject; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.validation.Valid; diff --git a/zt-module-qms/zt-module-qms-api/src/main/java/com/zt/plat/module/qms/enums/QmsCommonConstant.java b/zt-module-qms/zt-module-qms-api/src/main/java/com/zt/plat/module/qms/enums/QmsCommonConstant.java index 6934dec..19a8a8e 100644 --- a/zt-module-qms/zt-module-qms-api/src/main/java/com/zt/plat/module/qms/enums/QmsCommonConstant.java +++ b/zt-module-qms/zt-module-qms-api/src/main/java/com/zt/plat/module/qms/enums/QmsCommonConstant.java @@ -184,4 +184,14 @@ public interface QmsCommonConstant { /** 手动 **/ String MANUAL = "manual"; + + + /** 样品库操作类型: 归库、调拨、下架 **/ + String SAMPLE_STORAGE_OPERATION_TYPE_STORAGE = "storage"; + String SAMPLE_STORAGE_OPERATION_TYPE_TRANSFER = "dispatch"; + String SAMPLE_STORAGE_OPERATION_TYPE_TAKEN_OFF = "take_off"; + + + /** 允许提交 **/ + String ALLOW_SUBMIT = "allow_submit"; } diff --git a/zt-module-qms/zt-module-qms-api/src/main/java/com/zt/plat/module/qms/enums/QmsPermissionConstant.java b/zt-module-qms/zt-module-qms-api/src/main/java/com/zt/plat/module/qms/enums/QmsPermissionConstant.java index 8ea6100..ee8342e 100644 --- a/zt-module-qms/zt-module-qms-api/src/main/java/com/zt/plat/module/qms/enums/QmsPermissionConstant.java +++ b/zt-module-qms/zt-module-qms-api/src/main/java/com/zt/plat/module/qms/enums/QmsPermissionConstant.java @@ -17,7 +17,8 @@ public interface QmsPermissionConstant { String TARGET_TYPE_CUSTOM = "custom"; //======================各业务模块权限常量============================= - //报告发起权限 - String REPORT_DOCUMENT_TYPE_START = "report_document_type_start"; + + String REPORT_DOCUMENT_TYPE_START = "report_document_type_start"; //报告发起权限 + String SAMPLE_WAREHOUSE_ADMIN = "sample_warehouse_admin"; //样品库管理员 } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/QmsServerApplication.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/QmsServerApplication.java deleted file mode 100644 index c328170..0000000 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/QmsServerApplication.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.zt.plat.module.qms; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * 项目的启动类 - */ -@SpringBootApplication -public class QmsServerApplication { - - public static void main(String[] args) { - SpringApplication.run(QmsServerApplication.class, args); - } - -} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSampleDispatchController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSampleDispatchController.java index e4bdc09..4cf8a37 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSampleDispatchController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSampleDispatchController.java @@ -1,12 +1,16 @@ package com.zt.plat.module.qms.business.bus.controller.admin; import com.alibaba.fastjson.JSONObject; -import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleDispatchPageReqVO; -import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleDispatchRespVO; -import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleDispatchSaveReqVO; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleDispatchDetailDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleDO; +import com.zt.plat.module.qms.business.bus.service.BusinessSampleDispatchDetailService; import com.zt.plat.module.qms.business.bus.service.BusinessSubSampleService; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigWarehouseLocationPageReqVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigWarehouseLocationRespVO; +import com.zt.plat.module.qms.business.config.service.ConfigWarehouseLocationService; import com.zt.plat.module.qms.enums.QmsCommonConstant; +import org.springframework.util.ObjectUtils; import org.springframework.web.bind.annotation.*; import jakarta.annotation.Resource; import org.springframework.validation.annotation.Validated; @@ -46,7 +50,9 @@ public class BusinessSampleDispatchController implements BusinessControllerMarke @Resource private BusinessSampleDispatchService businessSampleDispatchService; + @Resource private BusinessSampleDispatchDetailService businessSampleDispatchDetailService; @Resource private BusinessSubSampleService businessSubSampleService; + @Resource private ConfigWarehouseLocationService configWarehouseLocationService; @PostMapping("/createTempData") @Operation(summary = "创建临时数据") @@ -60,6 +66,7 @@ public class BusinessSampleDispatchController implements BusinessControllerMarke @Operation(summary = "更新样品调拨") public CommonResult updateBusinessSampleDispatch(@Valid @RequestBody BusinessSampleDispatchSaveReqVO updateReqVO) { updateReqVO.setCancelStatus("0"); + updateReqVO.setFlowStatus(QmsCommonConstant.NOT_START); businessSampleDispatchService.updateBusinessSampleDispatch(updateReqVO); return success(true); } @@ -67,7 +74,7 @@ public class BusinessSampleDispatchController implements BusinessControllerMarke @PostMapping("/addOrRemoveSample") @Operation(summary = "增加或移除样品") public CommonResult addOrRemoveSample(@Valid @RequestBody BusinessSampleDispatchSaveReqVO updateReqVO) { - businessSampleDispatchService.addOrRemoveSample(updateReqVO); + businessSampleDispatchService.addOrRemoveSample(updateReqVO, true); return success(true); } @@ -76,10 +83,26 @@ public class BusinessSampleDispatchController implements BusinessControllerMarke public CommonResult addBySampleReturnCode(@RequestBody JSONObject param) { String id = param.getString("id"); String sampleReturnCode = param.getString("sampleReturnCode"); + String warehouseCode = param.getString("warehouseCode"); + if(ObjectUtils.isEmpty(warehouseCode)){ + return CommonResult.error(BUSINESS_SUB_SAMPLE_NOT_EXISTS.getCode(), "请选择仓库,再扫描样品!"); + } BusinessSubSampleDO businessSubSampleDO = businessSubSampleService.getBySampleReturnCode(sampleReturnCode); if(businessSubSampleDO == null) return CommonResult.error(BUSINESS_SUB_SAMPLE_NOT_EXISTS.getCode(), "未查询到此样品!"); - //判断样品状态 + //判断样品状态、库位 +// String sampleWarehouseCode = businessSubSampleDO.getWarehouseCode(); //todo 判断库位 + ConfigWarehouseLocationPageReqVO warehouseReqVO = new ConfigWarehouseLocationPageReqVO(); + warehouseReqVO.setId(businessSubSampleDO.getConfigWarehouseLocationInfomationId()); + PageResult warehousePage = configWarehouseLocationService.getConfigWarehouseLocationPage(warehouseReqVO); + if(warehousePage.getTotal() == 0){ + return CommonResult.error(BUSINESS_SUB_SAMPLE_NOT_EXISTS.getCode(), "未查询到样品所在仓库,请检查样品码是否正确!"); + } + ConfigWarehouseLocationRespVO warehouse = warehousePage.getList().get(0); + if(!warehouseCode.equals(warehouse.getWarehouseCode())){ + return CommonResult.error(BUSINESS_SUB_SAMPLE_NOT_EXISTS.getCode(), "此样品所在仓库为:"+warehouse.getWarehouseName()+",请检查样品码是否正确!"); + } + String returnStatus = businessSubSampleDO.getReturnStatus(); if(!QmsCommonConstant.COMPLETED.equals(returnStatus)){ return CommonResult.error(BUSINESS_SUB_SAMPLE_NOT_EXISTS.getCode(), "样品状态为:"+returnStatus+",不能调拨!"); @@ -88,14 +111,19 @@ public class BusinessSampleDispatchController implements BusinessControllerMarke if("1".equals(dispatchStatus)){ return CommonResult.error(BUSINESS_SUB_SAMPLE_NOT_EXISTS.getCode(), "样品已被调拨:请归还后再调拨!"); } - //todo 重复校验 - + BusinessSampleDispatchDetailPageReqVO reqVO = new BusinessSampleDispatchDetailPageReqVO(); + reqVO.setParentId(Long.valueOf(id)); + reqVO.setSampleReturnCode(sampleReturnCode); + PageResult pageDetailList = businessSampleDispatchDetailService.getBusinessSampleDispatchDetailPage(reqVO); + if(pageDetailList.getTotal() > 0){ + return CommonResult.error(BUSINESS_SUB_SAMPLE_NOT_EXISTS.getCode(), "次样品已添加,请勿重复添加!"); + } List sampleIds = new ArrayList<>(); sampleIds.add(businessSubSampleDO.getId()); BusinessSampleDispatchSaveReqVO updateReqVO = new BusinessSampleDispatchSaveReqVO(); updateReqVO.setId(Long.valueOf(id)); updateReqVO.setAddSubSampleIds(sampleIds); - businessSampleDispatchService.addOrRemoveSample(updateReqVO); + businessSampleDispatchService.addOrRemoveSample(updateReqVO, false); return success(true); } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSampleHandoverController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSampleHandoverController.java index 34e432f..eedf82b 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSampleHandoverController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSampleHandoverController.java @@ -37,7 +37,7 @@ import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; @RestController @RequestMapping("/qms/business-sample-handover") @Validated -public class BusinessSampleHandoverController implements BusinessControllerMarker { +public class BusinessSampleHandoverController { @Resource diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSampleHandoverDetailController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSampleHandoverDetailController.java index d95a382..a89c1e0 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSampleHandoverDetailController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSampleHandoverDetailController.java @@ -92,6 +92,14 @@ public class BusinessSampleHandoverDetailController implements BusinessControlle return success(BeanUtils.toBean(pageResult, BusinessSampleHandoverDetailRespVO.class)); } + @GetMapping("/takeOffPageList") + @Operation(summary = "获得样品交接明细分页") + //@PreAuthorize("@ss.hasPermission('qms:business-sample-handover-detail:query')") + public CommonResult> takeOffPageList(@Valid BusinessSampleHandoverDetailPageReqVO pageReqVO) { + PageResult pageResult = businessSampleHandoverDetailService.takeOffPageList(pageReqVO); + return success(pageResult); + } + @GetMapping("/export-excel") @Operation(summary = "导出样品交接明细 Excel") //@PreAuthorize("@ss.hasPermission('qms:business-sample-handover-detail:export')") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSubSampleController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSubSampleController.java index 6b45a6d..7d241c1 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSubSampleController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSubSampleController.java @@ -90,6 +90,14 @@ public class BusinessSubSampleController implements BusinessControllerMarker { return success(result); } + @GetMapping("/getPrintSubSample") + @Operation(summary = "获得打印子样业务") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + public CommonResult getPrintSubSample(@RequestParam("id") Long id) { + BusinessSubSampleExtendRespVO result = businessSubSampleService.getPrintSubSample(id); + return success(result); + } + @GetMapping("/list") @Operation(summary = "获得子样业务列表") //@PreAuthorize("@ss.hasPermission('qms:business-sub-sample:query')") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayParameterDataExtendRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayParameterDataExtendRespVO.java new file mode 100644 index 0000000..ee2ff02 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayParameterDataExtendRespVO.java @@ -0,0 +1,12 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import lombok.Data; + +@Data +public class BusinessAssayParameterDataExtendRespVO extends BusinessAssayParameterDataRespVO { + + private String parameterName; + + private String parameterKey; + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayProjectDataReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayProjectDataReqVO.java index a052df1..462fcc0 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayProjectDataReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayProjectDataReqVO.java @@ -65,4 +65,8 @@ public class BusinessAssayProjectDataReqVO { @Schema(description = "备注") private String remark; + //========================扩展字段================================== + + @Schema(description = "检测任务ID列表", example = "16505") + private List businessAssayTaskDataIdList; } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataExtendRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataExtendRespVO.java index b7a252a..0958e76 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataExtendRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataExtendRespVO.java @@ -17,6 +17,9 @@ public class BusinessAssayTaskDataExtendRespVO extends BusinessAssayTaskDataResp /** 分析方法名称 **/ @Schema(description = "分析方法名称") private String configAssayMethodName; + + @Schema(description = "子样配置id") + private Long configSubSampleId; @Schema(description = "样品名称") private String sampleName; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataPageReqVO.java index 70dcea3..ff1e6a3 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataPageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataPageReqVO.java @@ -49,6 +49,9 @@ public class BusinessAssayTaskDataPageReqVO extends PageParam { @Schema(description = "分析人") private String assayOperator; + @Schema(description = "分析人ID", example = "27835") + private Long assayOperatorId; + @Schema(description = "分配任务时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] assignTaskTime; @@ -62,6 +65,9 @@ public class BusinessAssayTaskDataPageReqVO extends PageParam { @Schema(description = "上报人") private String reporter; + @Schema(description = "上报人ID", example = "15920") + private Long reporterId; + @Schema(description = "上报时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] reportTime; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataReqVO.java index c91101a..c9064d3 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataReqVO.java @@ -49,6 +49,9 @@ public class BusinessAssayTaskDataReqVO { @Schema(description = "分析人") private String assayOperator; + @Schema(description = "分析人ID", example = "27835") + private Long assayOperatorId; + @Schema(description = "分配任务时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] assignTaskTime; @@ -62,6 +65,9 @@ public class BusinessAssayTaskDataReqVO { @Schema(description = "上报人") private String reporter; + @Schema(description = "上报人ID", example = "15920") + private Long reporterId; + @Schema(description = "上报时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] reportTime; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataRespVO.java index fb3dfc9..40b3b8b 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataRespVO.java @@ -63,6 +63,10 @@ public class BusinessAssayTaskDataRespVO { @ExcelProperty("分析人") private String assayOperator; + @Schema(description = "分析人ID", example = "27835") + @ExcelProperty("分析人ID") + private Long assayOperatorId; + @Schema(description = "分配任务时间") @ExcelProperty("分配任务时间") private LocalDateTime assignTaskTime; @@ -79,6 +83,10 @@ public class BusinessAssayTaskDataRespVO { @ExcelProperty("上报人") private String reporter; + @Schema(description = "上报人ID", example = "15920") + @ExcelProperty("上报人ID") + private Long reporterId; + @Schema(description = "上报时间") @ExcelProperty("上报时间") private LocalDateTime reportTime; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataSaveReqVO.java index b825997..7e2bf4c 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataSaveReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataSaveReqVO.java @@ -2,9 +2,7 @@ package com.zt.plat.module.qms.business.bus.controller.vo; import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; -import java.util.*; import jakarta.validation.constraints.*; -import org.springframework.format.annotation.DateTimeFormat; import java.time.LocalDateTime; @Schema(description = "管理后台 - 子样检测任务业务新增/修改 Request VO") @@ -59,6 +57,9 @@ public class BusinessAssayTaskDataSaveReqVO { @Schema(description = "分析人") private String assayOperator; + @Schema(description = "分析人ID", example = "27835") + private Long assayOperatorId; + @Schema(description = "分配任务时间") private LocalDateTime assignTaskTime; @@ -71,6 +72,9 @@ public class BusinessAssayTaskDataSaveReqVO { @Schema(description = "上报人") private String reporter; + @Schema(description = "上报人ID", example = "15920") + private Long reporterId; + @Schema(description = "上报时间") private LocalDateTime reportTime; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskPageReqVO.java index 4e31fc1..cbdade7 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskPageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskPageReqVO.java @@ -34,6 +34,9 @@ public class BusinessAssayTaskPageReqVO extends PageParam { @Schema(description = "任务单分配人") private String taskAssignOperator; + @Schema(description = "任务单分配人ID", example = "14545") + private Long taskAssignOperatorId; + @Schema(description = "任务单分配时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] taskAssignTime; @@ -54,6 +57,9 @@ public class BusinessAssayTaskPageReqVO extends PageParam { @Schema(description = "分析人") private String assayOperator; + @Schema(description = "分析人", example = "17685") + private Long assayOperatorId; + @Schema(description = "分析时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] assayTime; @@ -75,6 +81,9 @@ public class BusinessAssayTaskPageReqVO extends PageParam { @Schema(description = "上报人") private String reportOperator; + @Schema(description = "上报人ID", example = "7393") + private Long reportOperatorId; + @Schema(description = "任务单完成时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] taskFinishTime; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskReqVO.java index 445dc92..3767ed4 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskReqVO.java @@ -33,6 +33,9 @@ public class BusinessAssayTaskReqVO { @Schema(description = "任务单分配人") private String taskAssignOperator; + @Schema(description = "任务单分配人ID", example = "14545") + private Long taskAssignOperatorId; + @Schema(description = "任务单分配时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] taskAssignTime; @@ -53,6 +56,9 @@ public class BusinessAssayTaskReqVO { @Schema(description = "分析人") private String assayOperator; + @Schema(description = "分析人", example = "17685") + private Long assayOperatorId; + @Schema(description = "分析时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] assayTime; @@ -74,6 +80,9 @@ public class BusinessAssayTaskReqVO { @Schema(description = "上报人") private String reportOperator; + @Schema(description = "上报人ID", example = "7393") + private Long reportOperatorId; + @Schema(description = "任务单完成时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] taskFinishTime; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskRespVO.java index 9bae38a..a31f6ed 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskRespVO.java @@ -42,6 +42,10 @@ public class BusinessAssayTaskRespVO { @ExcelProperty("任务单分配人") private String taskAssignOperator; + @Schema(description = "任务单分配人ID", example = "14545") + @ExcelProperty("任务单分配人ID") + private Long taskAssignOperatorId; + @Schema(description = "任务单分配时间", requiredMode = Schema.RequiredMode.REQUIRED) @ExcelProperty("任务单分配时间") private LocalDateTime taskAssignTime; @@ -64,6 +68,10 @@ public class BusinessAssayTaskRespVO { @ExcelProperty("分析人") private String assayOperator; + @Schema(description = "分析人", example = "17685") + @ExcelProperty("分析人") + private Long assayOperatorId; + @Schema(description = "分析时间") @ExcelProperty("分析时间") private LocalDateTime assayTime; @@ -84,6 +92,10 @@ public class BusinessAssayTaskRespVO { @ExcelProperty("上报人") private String reportOperator; + @Schema(description = "上报人ID", example = "7393") + @ExcelProperty("上报人ID") + private Long reportOperatorId; + @Schema(description = "任务单完成时间") @ExcelProperty("任务单完成时间") private LocalDateTime taskFinishTime; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskSaveReqVO.java index aa444e5..fb95ba7 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskSaveReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskSaveReqVO.java @@ -40,9 +40,11 @@ public class BusinessAssayTaskSaveReqVO { private String taskSourceType; @Schema(description = "任务单分配人", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "任务单分配人不能为空") private String taskAssignOperator; + @Schema(description = "任务单分配人ID", example = "14545") + private Long taskAssignOperatorId; + @Schema(description = "任务单分配时间", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "任务单分配时间不能为空") private LocalDateTime taskAssignTime; @@ -64,6 +66,9 @@ public class BusinessAssayTaskSaveReqVO { @Schema(description = "分析人") private String assayOperator; + @Schema(description = "分析人", example = "17685") + private Long assayOperatorId; + @Schema(description = "分析时间") private LocalDateTime assayTime; @@ -79,6 +84,9 @@ public class BusinessAssayTaskSaveReqVO { @Schema(description = "上报人") private String reportOperator; + @Schema(description = "上报人ID", example = "7393") + private Long reportOperatorId; + @Schema(description = "任务单完成时间") private LocalDateTime taskFinishTime; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCCoefficientDataPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCCoefficientDataPageReqVO.java index 0223ac0..89f816d 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCCoefficientDataPageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCCoefficientDataPageReqVO.java @@ -46,6 +46,9 @@ public class BusinessQCCoefficientDataPageReqVO extends PageParam { @Schema(description = "分析人") private String assayOperator; + @Schema(description = "分析人ID", example = "10644") + private Long assayOperatorId; + @Schema(description = "分配任务时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] assignTaskTime; @@ -59,6 +62,9 @@ public class BusinessQCCoefficientDataPageReqVO extends PageParam { @Schema(description = "上报人") private String reporter; + @Schema(description = "上报人ID", example = "2683") + private Long reporterId; + @Schema(description = "上报时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] reportTime; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCCoefficientDataReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCCoefficientDataReqVO.java index cf8ca9d..4eff26e 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCCoefficientDataReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCCoefficientDataReqVO.java @@ -46,6 +46,9 @@ public class BusinessQCCoefficientDataReqVO { @Schema(description = "分析人") private String assayOperator; + @Schema(description = "分析人ID", example = "10644") + private Long assayOperatorId; + @Schema(description = "分配任务时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] assignTaskTime; @@ -59,6 +62,9 @@ public class BusinessQCCoefficientDataReqVO { @Schema(description = "上报人") private String reporter; + @Schema(description = "上报人ID", example = "2683") + private Long reporterId; + @Schema(description = "上报时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] reportTime; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCCoefficientDataRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCCoefficientDataRespVO.java index b0cc663..11c44f8 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCCoefficientDataRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCCoefficientDataRespVO.java @@ -60,6 +60,9 @@ public class BusinessQCCoefficientDataRespVO { @ExcelProperty("分析人") private String assayOperator; + @Schema(description = "分析人ID", example = "10644") + private Long assayOperatorId; + @Schema(description = "分配任务时间") @ExcelProperty("分配任务时间") private LocalDateTime assignTaskTime; @@ -76,6 +79,9 @@ public class BusinessQCCoefficientDataRespVO { @ExcelProperty("上报人") private String reporter; + @Schema(description = "上报人ID", example = "2683") + private Long reporterId; + @Schema(description = "上报时间") @ExcelProperty("上报时间") private LocalDateTime reportTime; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCCoefficientDataSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCCoefficientDataSaveReqVO.java index a02d79e..fac424c 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCCoefficientDataSaveReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCCoefficientDataSaveReqVO.java @@ -50,6 +50,9 @@ public class BusinessQCCoefficientDataSaveReqVO { @Schema(description = "分析人") private String assayOperator; + @Schema(description = "分析人ID", example = "10644") + private Long assayOperatorId; + @Schema(description = "分配任务时间") private LocalDateTime assignTaskTime; @@ -59,6 +62,9 @@ public class BusinessQCCoefficientDataSaveReqVO { @Schema(description = "是否已上报") private Integer isReported; + @Schema(description = "上报人ID", example = "2683") + private Long reporterId; + @Schema(description = "上报人") private String reporter; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCManagementDataPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCManagementDataPageReqVO.java index f9c44bf..761f5d9 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCManagementDataPageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCManagementDataPageReqVO.java @@ -46,6 +46,9 @@ public class BusinessQCManagementDataPageReqVO extends PageParam { @Schema(description = "分析人") private String assayOperator; + @Schema(description = "分析人ID", example = "6498") + private Long assayOperatorId; + @Schema(description = "分配任务时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] assignTaskTime; @@ -59,6 +62,9 @@ public class BusinessQCManagementDataPageReqVO extends PageParam { @Schema(description = "上报人") private String reporter; + @Schema(description = "上报人ID", example = "17517") + private Long reporterId; + @Schema(description = "上报时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] reportTime; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCManagementDataReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCManagementDataReqVO.java index 43a2f19..8ad382a 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCManagementDataReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCManagementDataReqVO.java @@ -46,6 +46,9 @@ public class BusinessQCManagementDataReqVO { @Schema(description = "分析人") private String assayOperator; + @Schema(description = "分析人ID", example = "6498") + private Long assayOperatorId; + @Schema(description = "分配任务时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] assignTaskTime; @@ -59,6 +62,9 @@ public class BusinessQCManagementDataReqVO { @Schema(description = "上报人") private String reporter; + @Schema(description = "上报人ID", example = "17517") + private Long reporterId; + @Schema(description = "上报时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] reportTime; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCManagementDataRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCManagementDataRespVO.java index fc265de..e7723c4 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCManagementDataRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCManagementDataRespVO.java @@ -60,6 +60,9 @@ public class BusinessQCManagementDataRespVO { @ExcelProperty("分析人") private String assayOperator; + @Schema(description = "分析人ID", example = "6498") + private Long assayOperatorId; + @Schema(description = "分配任务时间") @ExcelProperty("分配任务时间") private LocalDateTime assignTaskTime; @@ -76,6 +79,9 @@ public class BusinessQCManagementDataRespVO { @ExcelProperty("上报人") private String reporter; + @Schema(description = "上报人ID", example = "17517") + private Long reporterId; + @Schema(description = "上报时间") @ExcelProperty("上报时间") private LocalDateTime reportTime; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCManagementDataSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCManagementDataSaveReqVO.java index 77dc4d1..0a15599 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCManagementDataSaveReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCManagementDataSaveReqVO.java @@ -51,6 +51,9 @@ public class BusinessQCManagementDataSaveReqVO { @Schema(description = "分析人") private String assayOperator; + @Schema(description = "分析人ID", example = "6498") + private Long assayOperatorId; + @Schema(description = "分配任务时间") private LocalDateTime assignTaskTime; @@ -63,6 +66,9 @@ public class BusinessQCManagementDataSaveReqVO { @Schema(description = "上报人") private String reporter; + @Schema(description = "上报人ID", example = "17517") + private Long reporterId; + @Schema(description = "上报时间") private LocalDateTime reportTime; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleDispatchRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleDispatchRespVO.java index d7f3a31..fe31c3b 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleDispatchRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleDispatchRespVO.java @@ -1,5 +1,6 @@ package com.zt.plat.module.qms.business.bus.controller.vo; +import com.zt.plat.module.qms.core.aspect.annotation.Dict; import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; @@ -65,6 +66,7 @@ public class BusinessSampleDispatchRespVO { @Schema(description = "流程审批状态", example = "1") @ExcelProperty("流程审批状态") + @Dict(dicCode = "flow_status") private String flowStatus; @Schema(description = "完成状态", example = "1") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleEntrustDetailExtendRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleEntrustDetailExtendRespVO.java index c9ffcc6..18c741e 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleEntrustDetailExtendRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleEntrustDetailExtendRespVO.java @@ -1,7 +1,17 @@ package com.zt.plat.module.qms.business.bus.controller.vo; +import java.time.LocalDateTime; import java.util.List; +import org.springframework.format.annotation.DateTimeFormat; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer; +import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer; + +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; @Data @@ -16,6 +26,12 @@ public class BusinessSampleEntrustDetailExtendRespVO extends BusinessSampleEntru /** 打印标签 **/ private String printTemplate; + @JsonSerialize(using = LocalDateTimeSerializer.class) // 序列化(响应) + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Schema(description = "任务结束时间(yyyy-MM-dd HH:mm:ss)") + private LocalDateTime createTime; + private List sampleEntrustDetailProjectList; } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleHandoverDetailRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleHandoverDetailRespVO.java index 54cf9e6..88e5562 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleHandoverDetailRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleHandoverDetailRespVO.java @@ -61,4 +61,19 @@ public class BusinessSampleHandoverDetailRespVO { @ExcelProperty("备注") private String remark; + + //==================================扩展字段================================== + @Schema(description = "原样品编号") + @ExcelProperty("原样品编号") + private String originalSampleCode; + + @Schema(description = "库位编码") + @ExcelProperty("归库时间") + private String warehouseLocationCode; + + @Schema(description = "归库时间") + @ExcelProperty("归库时间") + private LocalDateTime returnTime; + + } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleExtendRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleExtendRespVO.java index 3439535..6a60a80 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleExtendRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleExtendRespVO.java @@ -1,9 +1,15 @@ package com.zt.plat.module.qms.business.bus.controller.vo; +import java.time.LocalDateTime; import java.util.List; import java.util.stream.Collectors; import org.apache.commons.lang3.StringUtils; +import org.springframework.format.annotation.DateTimeFormat; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer; import cn.hutool.core.collection.CollUtil; import io.swagger.v3.oas.annotations.media.Schema; @@ -63,6 +69,21 @@ public class BusinessSubSampleExtendRespVO extends BusinessSubSampleRespVO { @Schema(description = "样品标签打印模版") private String printTemplate; + + @Schema(description = "样品标签打印份数") + private Integer codePrintQuantity; + + @Schema(description = "收样人") + private String sampleReceiver; + + @Schema(description = "分析项目") + private String assayProject; + + @JsonSerialize(using = LocalDateTimeSerializer.class) // 序列化(响应) + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Schema(description = "收样时间") + private LocalDateTime sampleReceiveTime; @Schema(description = "库位编码") private String warehouseLocationCode; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSamplePageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSamplePageReqVO.java index cf97617..abfeb31 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSamplePageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSamplePageReqVO.java @@ -6,6 +6,7 @@ import com.zt.plat.framework.common.pojo.PageParam; import java.math.BigDecimal; import org.springframework.format.annotation.DateTimeFormat; import java.time.LocalDateTime; +import java.util.List; import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; @@ -133,6 +134,8 @@ public class BusinessSubSamplePageReqVO extends PageParam { @Schema(description = "备注") private String remark; + //=======================================扩展字段======================================= + @Schema(description = "分析部门id") private Long assayDepartmentId; @@ -141,8 +144,10 @@ public class BusinessSubSamplePageReqVO extends PageParam { @Schema(description = "分析部门状态") private String assayDepartmentStatus; - - //=======================================扩展字段======================================= + + @Schema(description = "样品流程节点KEY列表") + private List sampleFlowNodeKeyList; + @Schema(description = "库位编码") private String warehouseLocationCode; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleReqVO.java index e116687..a4bc808 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleReqVO.java @@ -134,6 +134,29 @@ public class BusinessSubSampleReqVO { @Schema(description = "备注") private String remark; + //=======================================扩展字段======================================= + + @Schema(description = "分析部门id") + private Long assayDepartmentId; + + @Schema(description = "分析部门名称") + private String assayDepartmentName; + + @Schema(description = "分析部门状态") + private String assayDepartmentStatus; + + @Schema(description = "样品流程节点KEY列表") + private List sampleFlowNodeKeyList; + + @Schema(description = "库位编码") + private String warehouseLocationCode; + + @Schema(description = "仓库编码") + private String warehouseCode; + + //是否过滤已申请调拨的数据: 1-是, 其他值:否 + @Schema(description = "是否过滤已申请调拨的数据") + private String hideDispatchData; } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessAssayTaskDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessAssayTaskDO.java index 81ff2e7..c88515e 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessAssayTaskDO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessAssayTaskDO.java @@ -24,7 +24,6 @@ import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; public class BusinessAssayTaskDO extends BusinessBaseDO { - /** * ID */ @@ -66,6 +65,11 @@ public class BusinessAssayTaskDO extends BusinessBaseDO { @TableField("TSK_ASN_OPTR") private String taskAssignOperator; /** + * 任务单分配人ID + */ + @TableField("TSK_ASN_OPTR_ID") + private Long taskAssignOperatorId; + /** * 任务单分配时间 */ @TableField("TSK_ASN_TM") @@ -76,8 +80,8 @@ public class BusinessAssayTaskDO extends BusinessBaseDO { @TableField("TSK_ASN_STS") private String taskAssignStatus; /** - * 任务单分配提交时间 - */ + * 任务单分配提交时间 + */ @TableField("TSK_ASN_SBM_TM") private LocalDateTime taskAssignSubmitTime; /** @@ -96,6 +100,11 @@ public class BusinessAssayTaskDO extends BusinessBaseDO { @TableField("ASY_OPTR") private String assayOperator; /** + * 分析人 + */ + @TableField("ASY_OPTR_ID") + private Long assayOperatorId; + /** * 分析时间 */ @TableField("ASY_TM") @@ -121,6 +130,11 @@ public class BusinessAssayTaskDO extends BusinessBaseDO { @TableField("RPT_OPTR") private String reportOperator; /** + * 上报人ID + */ + @TableField("RPT_OPTR_ID") + private Long reportOperatorId; + /** * 任务单完成时间 */ @TableField("TSK_FIN_TM") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessAssayTaskDataDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessAssayTaskDataDO.java index 6121427..3be86ec 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessAssayTaskDataDO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessAssayTaskDataDO.java @@ -46,11 +46,6 @@ public class BusinessAssayTaskDataDO extends BusinessBaseDO { @TableField("BSN_SB_SMP_ID") private Long businessSubSampleId; /** - * 分样子样判定ID - */ - @TableField("BSN_SB_SMP_ASMT_ID") - private Long businessSubSampleAssessmentId; - /** * 检测方法配置ID */ @TableField("CFG_ASY_MTHD_ID") @@ -61,6 +56,11 @@ public class BusinessAssayTaskDataDO extends BusinessBaseDO { @TableField(value = "BSN_ASY_TSK_ID", updateStrategy = FieldStrategy.ALWAYS) private Long businessAssayTaskId; /** + * 子样判定ID + */ + @TableField("BSN_SB_SMP_ASMT_ID") + private Long businessSubSampleAssessmentId; + /** * 任务类型,【字典】【jy_sample_task_type】常规、抽查... */ @TableField("TSK_TP") @@ -91,6 +91,11 @@ public class BusinessAssayTaskDataDO extends BusinessBaseDO { @TableField(value = "ASY_OPTR", updateStrategy = FieldStrategy.ALWAYS) private String assayOperator; /** + * 分析人ID + */ + @TableField(value = "ASY_OPTR_ID", updateStrategy = FieldStrategy.ALWAYS) + private Long assayOperatorId; + /** * 分配任务时间 */ @TableField(value = "ASN_TSK_TM", updateStrategy = FieldStrategy.ALWAYS) @@ -111,6 +116,11 @@ public class BusinessAssayTaskDataDO extends BusinessBaseDO { @TableField("RPTR") private String reporter; /** + * 上报人ID + */ + @TableField("RPTR_ID") + private Long reporterId; + /** * 上报时间 */ @TableField("RPT_TM") @@ -131,7 +141,7 @@ public class BusinessAssayTaskDataDO extends BusinessBaseDO { @TableField("SMP_FLW_NDE_TM") private LocalDateTime sampleFlowNodeTime; /** - * 分析次数,复检的累加次数 + * 分析次数,值为0为分析,大于0为第几次复检 */ @TableField("ANL_CNT") private Integer analysisCount; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessQCCoefficientDataDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessQCCoefficientDataDO.java index 76e5dc6..b884247 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessQCCoefficientDataDO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessQCCoefficientDataDO.java @@ -89,6 +89,11 @@ public class BusinessQCCoefficientDataDO extends BusinessBaseDO { @TableField("ASY_OPTR") private String assayOperator; /** + * 分析人ID + */ + @TableField("ASY_OPTR_ID") + private Long assayOperatorId; + /** * 分配任务时间 */ @TableField("ASN_TSK_TM") @@ -109,6 +114,11 @@ public class BusinessQCCoefficientDataDO extends BusinessBaseDO { @TableField("RPTR") private String reporter; /** + * 上报人ID + */ + @TableField("RPTR_ID") + private Long reporterId; + /** * 上报时间 */ @TableField("RPT_TM") @@ -129,4 +139,5 @@ public class BusinessQCCoefficientDataDO extends BusinessBaseDO { @TableField("RMK") private String remark; + } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessQCManagementDataDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessQCManagementDataDO.java index 3938b80..9f3102b 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessQCManagementDataDO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessQCManagementDataDO.java @@ -89,6 +89,11 @@ public class BusinessQCManagementDataDO extends BusinessBaseDO { @TableField("ASY_OPTR") private String assayOperator; /** + * 分析人ID + */ + @TableField("ASY_OPTR_ID") + private Long assayOperatorId; + /** * 分配任务时间 */ @TableField("ASN_TSK_TM") @@ -109,6 +114,11 @@ public class BusinessQCManagementDataDO extends BusinessBaseDO { @TableField("RPTR") private String reporter; /** + * 上报人ID + */ + @TableField("RPTR_ID") + private Long reporterId; + /** * 上报时间 */ @TableField("RPT_TM") @@ -128,5 +138,4 @@ public class BusinessQCManagementDataDO extends BusinessBaseDO { */ @TableField("RMK") private String remark; - } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayParameterDataMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayParameterDataMapper.java index d5b2ddc..c0f5797 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayParameterDataMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayParameterDataMapper.java @@ -83,5 +83,14 @@ public interface BusinessAssayParameterDataMapper extends BaseMapperX() .in(BusinessAssayParameterDataDO::getBusinessAssayProjectDataId, businessAssayProjectDataIds)); } + + default List selectExtendByBusinessAssayProjectDataIds(List businessAssayProjectDataIds) { + return selectJoinList(BusinessAssayParameterDataExtendRespVO.class, new MPJLambdaWrapperX() + .leftJoin(DictionaryParameterDO.class, DictionaryParameterDO::getId, BusinessAssayParameterDataDO::getDictionaryParameterId) + .selectAll(BusinessAssayParameterDataDO.class) + .selectAs(DictionaryParameterDO::getName, BusinessAssayParameterDataExtendRespVO::getParameterName) + .selectAs(DictionaryParameterDO::getKey, BusinessAssayParameterDataExtendRespVO::getParameterKey) + .in(BusinessAssayParameterDataDO::getBusinessAssayProjectDataId, businessAssayProjectDataIds)); + } } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayProjectDataMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayProjectDataMapper.java index ce6ef99..f1407d5 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayProjectDataMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayProjectDataMapper.java @@ -49,6 +49,7 @@ public interface BusinessAssayProjectDataMapper extends BaseMapperX() .eq(BusinessAssayTaskDataDO::getBusinessSubSampleId, businessSubSampleId)); } + + + /** + * 根据子样及分析部门查询分析任务 + * @param businessSubSampleId 子样id + * @param assayDepartmentId 分析部门id + * @return + */ + default List selectByBusinessSubSampleIdAndAssayDepartmentId(Long businessSubSampleId, Long assayDepartmentId) { + return selectList(new LambdaQueryWrapperX() + .eq(BusinessAssayTaskDataDO::getBusinessSubSampleId, businessSubSampleId) + .eq(BusinessAssayTaskDataDO::getAssayDepartmentId, assayDepartmentId)); + } + /** * 根据子样查询分析任务 diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayTaskMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayTaskMapper.java index 65be90b..ff497c4 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayTaskMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayTaskMapper.java @@ -9,8 +9,6 @@ import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDetai import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodDO; import com.zt.plat.module.qms.enums.QmsCommonConstant; -import jakarta.validation.Valid; - import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; import java.util.List; @@ -38,18 +36,21 @@ public interface BusinessAssayTaskMapper extends BaseMapperX takeOffPageList(BusinessSampleHandoverDetailPageReqVO reqVO) { + return selectJoinPage(reqVO, BusinessSampleHandoverDetailRespVO.class, new MPJLambdaWrapperX() + .leftJoin(BusinessSubSampleDO.class, BusinessSubSampleDO::getId, BusinessSampleHandoverDetailDO::getBusinessSubSampleId) + .leftJoin(ConfigWarehouseLocationDO.class, ConfigWarehouseLocationDO::getId, BusinessSubSampleDO::getConfigWarehouseLocationInfomationId) + .selectAll(BusinessSampleHandoverDetailDO.class) + .selectAs(BusinessSubSampleDO::getSampleCode, BusinessSampleHandoverDetailRespVO::getOriginalSampleCode) + .selectAs(BusinessSubSampleDO::getReturnTime, BusinessSampleHandoverDetailRespVO::getReturnTime) + .selectAs(ConfigWarehouseLocationDO::getCode, BusinessSampleHandoverDetailRespVO::getWarehouseLocationCode) + .eqIfPresent(BusinessSampleHandoverDetailDO::getBusinessSampleHandoverId, reqVO.getBusinessSampleHandoverId()) + .eqIfPresent(BusinessSampleHandoverDetailDO::getBusinessSubSampleId, reqVO.getBusinessSubSampleId()) + .likeIfPresent(BusinessSampleHandoverDetailDO::getSampleName, reqVO.getSampleName()) + .eqIfPresent(BusinessSampleHandoverDetailDO::getSampleCode, reqVO.getSampleCode()) + .eqIfPresent(BusinessSampleHandoverDetailDO::getSampleWeight, reqVO.getSampleWeight()) + .eqIfPresent(BusinessSampleHandoverDetailDO::getBalanceCode, reqVO.getBalanceCode()) + .eqIfPresent(BusinessSampleHandoverDetailDO::getDictionaryBusinessId, reqVO.getDictionaryBusinessId()) + .likeIfPresent(BusinessSampleHandoverDetailDO::getDictionaryBusinessName, reqVO.getDictionaryBusinessName()) + .eqIfPresent(BusinessSampleHandoverDetailDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .betweenIfPresent(BusinessSampleHandoverDetailDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(BusinessSampleHandoverDetailDO::getRemark, reqVO.getRemark()) + .orderByDesc(BusinessSampleHandoverDetailDO::getId)); + } + } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubSampleAnalysisGroupMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubSampleAnalysisGroupMapper.java index 4680c73..2e4a679 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubSampleAnalysisGroupMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubSampleAnalysisGroupMapper.java @@ -61,5 +61,11 @@ public interface BusinessSubSampleAnalysisGroupMapper extends BaseMapperX() + .eq(BusinessSubSampleAnalysisGroupDO::getBusinessSubSampleId, businessSubSampleId) + .eq(BusinessSubSampleAnalysisGroupDO::getAssayDepartmentId, assayDepartmentId)); + } } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubSampleMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubSampleMapper.java index 3675d80..4799e20 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubSampleMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubSampleMapper.java @@ -63,6 +63,7 @@ public interface BusinessSubSampleMapper extends BaseMapperX 1 ? QmsCommonConstant.ASSAY_TYPE_SINGLE_PARALLEL : QmsCommonConstant.ASSAY_TYPE_SINGLE_CUP; + + //分样判定数据 + BusinessSubParentSampleAssessmentDO businessSubParentSampleAssessmentDO = new BusinessSubParentSampleAssessmentDO(); + businessSubParentSampleAssessmentDO.setId(IdWorker.getId()); + businessSubParentSampleAssessmentDO.setBusinessSubParentSampleId(businessSubSampleDO.getBusinessSubParentSampleId()); + businessSubParentSampleAssessmentDO.setConfigAssayMethodId(configAssayMethodZhy.getId()); + businessSubParentSampleAssessmentDO.setAssayType(assayType); + businessSubParentSampleAssessmentDO.setTaskType("常规"); + businessSubParentSampleAssessmentDOList.add(businessSubParentSampleAssessmentDO); + //子样判定数据 BusinessSubSampleAssessmentDO businessSubSampleAssessmentDO = new BusinessSubSampleAssessmentDO(); businessSubSampleAssessmentDO.setId(IdWorker.getId()); businessSubSampleAssessmentDO.setBusinessBaseSampleId(businessSubSampleDO.getBusinessBaseSampleId()); businessSubSampleAssessmentDO.setBusinessSubParentSampleId(businessSubSampleDO.getBusinessSubParentSampleId()); + businessSubSampleAssessmentDO.setBusinessSubParentSampleAssessmentId(businessSubParentSampleAssessmentDO.getId()); businessSubSampleAssessmentDO.setBusinessSubSampleId(businessSubSampleDO.getId()); businessSubSampleAssessmentDO.setConfigAssayMethodId(configAssayMethodZhy.getId()); businessSubSampleAssessmentDO.setAssayType(assayType); @@ -669,43 +680,33 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent { businessSampleAssayResultMapper.updateBatch(sampleAssayResultList); } if (CollUtil.isNotEmpty(businessBaseSampleDOList)) { - log.info("插入 businessBaseSampleDOList 前 tenant_id = {}", TenantContextHolder.getTenantId()); businessBaseSampleMapper.insertBatch(businessBaseSampleDOList); } if (CollUtil.isNotEmpty(businessSubParentSampleDOList)) { - log.info("插入 businessSubParentSampleDOList 前 tenant_id = {}", TenantContextHolder.getTenantId()); businessSubParentSampleMapper.insertBatch(businessSubParentSampleDOList); } if (CollUtil.isNotEmpty(businessSubParentSampleAssessmentDOList)) { - log.info("插入 businessSubParentSampleAssessmentDOList 前 tenant_id = {}", TenantContextHolder.getTenantId()); businessSubParentSampleAssessmentMapper.insertBatch(businessSubParentSampleAssessmentDOList); } if (CollUtil.isNotEmpty(businessSubSampleDOList)) { - log.info("插入 businessSubSampleDOList 前 tenant_id = {}", TenantContextHolder.getTenantId()); businessSubSampleMapper.insertBatch(businessSubSampleDOList); } if (CollUtil.isNotEmpty(businessSubSampleAnalysisGroupDOList)) { - log.info("插入 businessSubSampleAnalysisGroupDOList 前 tenant_id = {}", TenantContextHolder.getTenantId()); businessSubSampleAnalysisGroupMapper.insertBatch(businessSubSampleAnalysisGroupDOList); } if (CollUtil.isNotEmpty(businessSubSampleAssessmentDOList)) { - log.info("插入 businessSubSampleAssessmentDOList 前 tenant_id = {}", TenantContextHolder.getTenantId()); businessSubSampleAssessmentMapper.insertBatch(businessSubSampleAssessmentDOList); } if (CollUtil.isNotEmpty(businessAssayTaskDataDOList)) { - log.info("插入 businessAssayTaskDataDOList 前 tenant_id = {}", TenantContextHolder.getTenantId()); businessAssayTaskDataMapper.insertBatch(businessAssayTaskDataDOList); } if (CollUtil.isNotEmpty(businessAssayProjectDataDOList)) { - log.info("插入 businessAssayProjectDataDOList 前 tenant_id = {}", TenantContextHolder.getTenantId()); businessAssayProjectDataMapper.insertBatch(businessAssayProjectDataDOList); } if (CollUtil.isNotEmpty(businessAssayParameterDataDOList)) { - log.info("插入 businessAssayParameterDataDOList 前 tenant_id = {}", TenantContextHolder.getTenantId()); businessAssayParameterDataMapper.insertBatch(businessAssayParameterDataDOList); } if (CollUtil.isNotEmpty(businessAssayReportDataDOList)) { - log.info("插入 businessAssayReportDataDOList 前 tenant_id = {}", TenantContextHolder.getTenantId()); businessAssayReportDataMapper.insertBatch(businessAssayReportDataDOList); } } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/taskassign/SampleTaskAssignManualCmp.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/taskassign/SampleTaskAssignManualCmp.java index b8ebddd..60bdb68 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/taskassign/SampleTaskAssignManualCmp.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/taskassign/SampleTaskAssignManualCmp.java @@ -9,6 +9,7 @@ import java.util.stream.Collectors; import com.baomidou.mybatisplus.core.toolkit.IdWorker; import com.yomahub.liteflow.annotation.LiteflowComponent; import com.yomahub.liteflow.core.NodeComponent; +import com.zt.plat.framework.security.core.LoginUser; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDataDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDetailDO; @@ -53,6 +54,7 @@ public class SampleTaskAssignManualCmp extends NodeComponent { public void process() throws Exception { SampleTaskAssignContext sampleTaskAssignContext = this.getContextBean(SampleTaskAssignContext.class); String loginRealname = sampleTaskAssignContext.getLoginRealname(); + LoginUser loginUser = sampleTaskAssignContext.getLoginUser(); LocalDateTime currentDateTime = sampleTaskAssignContext.getCurrentDateTime(); AssignAssayUser assignAssayUser = sampleTaskAssignContext.getAssignAssayUser(); List assayTaskDataIdList = sampleTaskAssignContext.getAssayTaskDataIdList(); @@ -91,12 +93,14 @@ public class SampleTaskAssignManualCmp extends NodeComponent { businessAssayTaskDO.setTaskNo(taskNo); businessAssayTaskDO.setTaskName(configAssayMethod.getName()); businessAssayTaskDO.setAssayOperator(assignAssayUser.getRealName()); + businessAssayTaskDO.setAssayOperatorId(assignAssayUser.getUserId()); businessAssayTaskDO.setConfigAssayMethodId(key); businessAssayTaskDO.setTaskSourceType(QmsCommonConstant.TASK_ASSIGN); businessAssayTaskDO.setConfigReportTemplateId(configReportTemplate.getId()); businessAssayTaskDO.setConfigReportTemplateKey(configReportTemplate.getKey()); businessAssayTaskDO.setTaskAssignOperator(loginRealname); + businessAssayTaskDO.setTaskAssignOperatorId(loginUser.getId()); businessAssayTaskDO.setTaskAssignTime(currentDateTime); businessAssayTaskDO.setTaskAssignStatus(QmsCommonConstant.IN_PROGRESS); businessAssayTaskDO.setTaskAssayStatus(QmsCommonConstant.NOT_START); @@ -116,6 +120,7 @@ public class SampleTaskAssignManualCmp extends NodeComponent { val.setIsAssignTasked(QmsCommonConstant.YES); val.setAssignTaskTime(currentDateTime); val.setAssayOperator(assignAssayUser.getRealName()); + val.setAssayOperatorId(assignAssayUser.getUserId()); val.setBusinessAssayTaskId(businessAssayTaskDO.getId()); BusinessSubSampleDO businessSubSampleDO = sampleTaskAssignContext.getBusinessSubSampleById(val.getBusinessSubSampleId()); diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/taskassign/SampleTaskAssignMethodCmp.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/taskassign/SampleTaskAssignMethodCmp.java index 0b274ae..57712aa 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/taskassign/SampleTaskAssignMethodCmp.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/taskassign/SampleTaskAssignMethodCmp.java @@ -11,6 +11,7 @@ import com.yomahub.liteflow.core.NodeComponent; import cn.hutool.core.collection.CollUtil; import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zt.plat.framework.security.core.LoginUser; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDataDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDetailDO; @@ -54,6 +55,7 @@ public class SampleTaskAssignMethodCmp extends NodeComponent { public void process() throws Exception { SampleTaskAssignContext sampleTaskAssignContext = this.getContextBean(SampleTaskAssignContext.class); String loginRealname = sampleTaskAssignContext.getLoginRealname(); + LoginUser loginUser = sampleTaskAssignContext.getLoginUser(); LocalDateTime currentDateTime = sampleTaskAssignContext.getCurrentDateTime(); Long assignConfigAssayMethodId = sampleTaskAssignContext.getAssignConfigAssayMethodId(); List assignAssayUserList = sampleTaskAssignContext.getAssignAssayUserList(); @@ -100,8 +102,10 @@ public class SampleTaskAssignMethodCmp extends NodeComponent { businessAssayTaskDO.setConfigReportTemplateId(configReportTemplate.getId()); businessAssayTaskDO.setConfigReportTemplateKey(configReportTemplate.getKey()); businessAssayTaskDO.setAssayOperator(assignAssayUser.getRealName()); + businessAssayTaskDO.setAssayOperatorId(assignAssayUser.getUserId()); businessAssayTaskDO.setTaskAssignOperator(loginRealname); + businessAssayTaskDO.setTaskAssignOperatorId(loginUser.getId()); businessAssayTaskDO.setTaskAssignTime(currentDateTime); businessAssayTaskDO.setTaskAssignStatus(QmsCommonConstant.IN_PROGRESS); businessAssayTaskDO.setTaskAssayStatus(QmsCommonConstant.NOT_START); @@ -120,6 +124,7 @@ public class SampleTaskAssignMethodCmp extends NodeComponent { businessAssayTaskDataDO.setIsAssignTasked(QmsCommonConstant.YES); businessAssayTaskDataDO.setAssignTaskTime(currentDateTime); businessAssayTaskDataDO.setAssayOperator(assignAssayUser.getRealName()); + businessAssayTaskDataDO.setAssayOperatorId(assignAssayUser.getUserId()); businessAssayTaskDataDO.setBusinessAssayTaskId(businessAssayTaskDO.getId()); BusinessSubSampleDO businessSubSampleDO = sampleTaskAssignContext.getBusinessSubSampleById(businessAssayTaskDataDO.getBusinessSubSampleId()); diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/taskassign/SampleTaskAssignQCSampleCmp.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/taskassign/SampleTaskAssignQCSampleCmp.java index cc2f4e8..e19d749 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/taskassign/SampleTaskAssignQCSampleCmp.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/taskassign/SampleTaskAssignQCSampleCmp.java @@ -118,6 +118,7 @@ public class SampleTaskAssignQCSampleCmp extends NodeComponent { businessQCCoefficientDataDO.setAssayDepartmentId(configAssayMethodDO.getAssayDepartmentId()); businessQCCoefficientDataDO.setAssayDepartmentName(configAssayMethodDO.getAssayDepartmentName()); businessQCCoefficientDataDO.setAssayOperator(businessAssayTaskDO.getAssayOperator()); + businessQCCoefficientDataDO.setAssayOperatorId(businessAssayTaskDO.getAssayOperatorId()); businessQCCoefficientDataDO.setAssayProject(""); businessQCCoefficientDataDO.setAssignTaskTime(businessAssayTaskDO.getTaskAssignTime()); businessQCCoefficientDataDO.setIsAssignTasked(QmsCommonConstant.YES); diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/taskassign/SampleTaskAssignSampleCmp.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/taskassign/SampleTaskAssignSampleCmp.java index 8fe4b6d..27ecd31 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/taskassign/SampleTaskAssignSampleCmp.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/taskassign/SampleTaskAssignSampleCmp.java @@ -10,6 +10,7 @@ import com.baomidou.mybatisplus.core.toolkit.IdWorker; import com.yomahub.liteflow.annotation.LiteflowComponent; import com.yomahub.liteflow.core.NodeComponent; import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zt.plat.framework.security.core.LoginUser; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDataDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDetailDO; @@ -53,6 +54,7 @@ public class SampleTaskAssignSampleCmp extends NodeComponent { public void process() throws Exception { SampleTaskAssignContext sampleTaskAssignContext = this.getContextBean(SampleTaskAssignContext.class); String loginRealname = sampleTaskAssignContext.getLoginRealname(); + LoginUser loginUser = sampleTaskAssignContext.getLoginUser(); LocalDateTime currentDateTime = sampleTaskAssignContext.getCurrentDateTime(); AssignAssayUser assignAssayUser = sampleTaskAssignContext.getAssignAssayUser(); List assignSampleIdList = sampleTaskAssignContext.getAssignSampleIdList(); @@ -91,12 +93,14 @@ public class SampleTaskAssignSampleCmp extends NodeComponent { businessAssayTaskDO.setTaskNo(taskNo); businessAssayTaskDO.setTaskName(configAssayMethod.getName()); businessAssayTaskDO.setAssayOperator(assignAssayUser.getRealName()); + businessAssayTaskDO.setAssayOperatorId(assignAssayUser.getUserId()); businessAssayTaskDO.setConfigAssayMethodId(key); businessAssayTaskDO.setTaskSourceType(QmsCommonConstant.TASK_ASSIGN); businessAssayTaskDO.setConfigReportTemplateId(configReportTemplate.getId()); businessAssayTaskDO.setConfigReportTemplateKey(configReportTemplate.getKey()); businessAssayTaskDO.setTaskAssignOperator(loginRealname); + businessAssayTaskDO.setTaskAssignOperatorId(loginUser.getId()); businessAssayTaskDO.setTaskAssignTime(currentDateTime); businessAssayTaskDO.setTaskAssignStatus(QmsCommonConstant.IN_PROGRESS); businessAssayTaskDO.setTaskAssayStatus(QmsCommonConstant.NOT_START); @@ -116,6 +120,7 @@ public class SampleTaskAssignSampleCmp extends NodeComponent { val.setIsAssignTasked(QmsCommonConstant.YES); val.setAssignTaskTime(currentDateTime); val.setAssayOperator(assignAssayUser.getRealName()); + val.setAssayOperatorId(assignAssayUser.getUserId()); val.setBusinessAssayTaskId(businessAssayTaskDO.getId()); BusinessSubSampleDO businessSubSampleDO = sampleTaskAssignContext.getBusinessSubSampleById(val.getBusinessSubSampleId()); diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleDispatchService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleDispatchService.java index d06739a..f801f8f 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleDispatchService.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleDispatchService.java @@ -19,7 +19,7 @@ import com.zt.plat.framework.common.pojo.PageResult; public interface BusinessSampleDispatchService { //增加样品 - void addOrRemoveSample(@Valid BusinessSampleDispatchSaveReqVO paramVo); + void addOrRemoveSample(@Valid BusinessSampleDispatchSaveReqVO paramVo, boolean updateCancelFlag); //发起流程 CommonResult createProcessInstance(BusinessSampleDispatchSaveReqVO paramVo); diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleDispatchServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleDispatchServiceImpl.java index 9cc8ac8..08cd27e 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleDispatchServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleDispatchServiceImpl.java @@ -22,6 +22,7 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; import jakarta.annotation.Resource; import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.ObjectUtils; import org.springframework.validation.annotation.Validated; import java.text.SimpleDateFormat; @@ -59,11 +60,11 @@ public class BusinessSampleDispatchServiceImpl implements BusinessSampleDispatch @Override @Transactional(rollbackFor = Exception.class) - public void addOrRemoveSample(BusinessSampleDispatchSaveReqVO paramVo) { + public void addOrRemoveSample(BusinessSampleDispatchSaveReqVO paramVo, boolean updateCancelFlag) { Long id = paramVo.getId(); List addSubSampleIds = paramVo.getAddSubSampleIds(); List removeDetailIds = paramVo.getRemoveDetailIds(); - + BusinessSampleDispatchDO entity = getBusinessSampleDispatch(id); //处理移除 if(removeDetailIds != null && !removeDetailIds.isEmpty()){ businessSampleDispatchDetailService.deleteBusinessSampleDispatchDetailListByIds(removeDetailIds); @@ -81,8 +82,14 @@ public class BusinessSampleDispatchServiceImpl implements BusinessSampleDispatch detail.setParentId(id); insertList.add(detail); } - if(!insertList.isEmpty()) + if(!insertList.isEmpty()){ businessSampleDispatchDetailService.insertBatch(insertList); + if(updateCancelFlag && "-1".equals(entity.getCancelStatus())){ + //如果有新增,修改临时数据状态 + entity.setCancelStatus("0"); + businessSampleDispatchMapper.updateById(entity); + } + } } } @@ -137,8 +144,11 @@ public class BusinessSampleDispatchServiceImpl implements BusinessSampleDispatch @Transactional(rollbackFor = Exception.class) public CommonResult execDispatch(BusinessSampleDispatchSaveReqVO paramVo) { Long id = paramVo.getId(); - String warehouseUser = paramVo.getWarehouseUser(); //库管员 - Long warehouseUserId = paramVo.getWarehouseUserId(); + + LoginUser loginUser = SecurityFrameworkUtils.getLoginUser(); + String nickName = SecurityFrameworkUtils.getLoginUserNickname(); + String warehouseUser = nickName; //库管员 + Long warehouseUserId = loginUser.getId(); BusinessSampleDispatchDO entity = getBusinessSampleDispatch( id); BusinessSampleDispatchDetailPageReqVO pageReqVO = new BusinessSampleDispatchDetailPageReqVO(); pageReqVO.setParentId(id); @@ -150,8 +160,10 @@ public class BusinessSampleDispatchServiceImpl implements BusinessSampleDispatch List handoverRecordList = new ArrayList<>(); for (BusinessSampleDispatchDetailExtendRespVO detail : detailList) { BusinessSampleDispatchDetailDO u = new BusinessSampleDispatchDetailDO(); + u.setId(detail.getId()); u.setUseStatus("1"); u.setBorrowStatus("1"); + u.setGivebackStatus("0"); u.setBorrowUser(entity.getApplyUser()); u.setBorrowUserId(entity.getApplyUserId()); u.setBorrowTime(borrowTime); @@ -222,6 +234,7 @@ public class BusinessSampleDispatchServiceImpl implements BusinessSampleDispatch handoverRecord.setOperatorId(givebackUserId); handoverRecord.setSendSampleOperator(givebackUser); //送样人 handoverRecord.setReceiveSampleOperator(warehouseUser); //收样人 + handoverRecord.setSampleFlowNodeKey(QmsCommonConstant.FLOW_SAMPLE_STORAGE); handoverRecordList.add(handoverRecord); } businessSampleDispatchDetailService.updateBatch(detailUpdateList); diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleHandoverDetailService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleHandoverDetailService.java index b5fcd8e..c9247a3 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleHandoverDetailService.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleHandoverDetailService.java @@ -61,5 +61,7 @@ public interface BusinessSampleHandoverDetailService { */ PageResult getBusinessSampleHandoverDetailPage(BusinessSampleHandoverDetailPageReqVO pageReqVO); + PageResult takeOffPageList(BusinessSampleHandoverDetailPageReqVO pageReqVO); + void insertBatch(List list); } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleHandoverDetailServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleHandoverDetailServiceImpl.java index 5ebc517..55e2f1d 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleHandoverDetailServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleHandoverDetailServiceImpl.java @@ -91,6 +91,11 @@ public class BusinessSampleHandoverDetailServiceImpl implements BusinessSampleHa return businessSampleHandoverDetailMapper.selectPage(pageReqVO); } + @Override + public PageResult takeOffPageList(BusinessSampleHandoverDetailPageReqVO pageReqVO) { + return businessSampleHandoverDetailMapper.takeOffPageList(pageReqVO); + } + @Override @Transactional(rollbackFor = Exception.class) public void insertBatch(List list) { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubSampleService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubSampleService.java index 18cd2e3..47c2b33 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubSampleService.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubSampleService.java @@ -57,6 +57,13 @@ public interface BusinessSubSampleService { */ BusinessSubSampleExtendRespVO getBusinessSubSample(Long id); + /** + * 获取打印子样业务数据 + * @param id + * @return + */ + BusinessSubSampleExtendRespVO getPrintSubSample(Long id); + BusinessSubSampleDO getBySampleCode(String sampleCode); BusinessSubSampleDO getBySampleReturnCode(String sampleReturnCode); diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubSampleServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubSampleServiceImpl.java index 4daa516..0a18ab0 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubSampleServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubSampleServiceImpl.java @@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.zt.plat.framework.security.core.LoginUser; import com.zt.plat.framework.security.core.util.SecurityFrameworkUtils; import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDataDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessHandoverRecordSubDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleHandoverDetailDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleAnalysisGroupDO; @@ -15,6 +16,8 @@ import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSubSampleDO; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigWarehouseLocationDO; import com.zt.plat.module.qms.business.config.service.ConfigSubSampleService; import com.zt.plat.module.qms.business.config.service.ConfigWarehouseLocationService; +import com.zt.plat.module.qms.common.dic.dal.dataobject.DictionaryBusinessDO; +import com.zt.plat.module.qms.common.dic.dal.mapper.DictionaryBusinessMapper; import com.zt.plat.module.qms.common.dic.service.DictionaryBusinessService; import com.zt.plat.module.qms.core.code.SequenceUtil; import com.zt.plat.module.qms.enums.QmsCommonConstant; @@ -35,6 +38,7 @@ import com.zt.plat.framework.common.exception.ServiceException; import com.zt.plat.framework.common.pojo.PageResult; import com.zt.plat.framework.common.util.object.BeanUtils; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleDO; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayTaskDataMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubSampleAnalysisGroupMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubSampleMapper; import com.zt.plat.module.qms.enums.QmsCommonConstant; @@ -43,6 +47,7 @@ import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.e import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception0; import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList; import static com.zt.plat.module.qms.enums.ErrorCodeConstants.*; +import static com.zt.plat.module.qms.enums.QmsCommonConstant.SAMPLE_STORAGE_OPERATION_TYPE_TAKEN_OFF; /** * 子样业务 Service 实现类 @@ -58,6 +63,9 @@ public class BusinessSubSampleServiceImpl implements BusinessSubSampleService { @Resource private BusinessSubSampleAnalysisGroupMapper businessSubSampleAnalysisGroupMapper; + + @Resource + private BusinessAssayTaskDataMapper businessAssayTaskDataMapper; @Resource private ConfigWarehouseLocationService configWarehouseLocationService; @Resource private BusinessSampleHandoverService businessSampleHandoverService; @@ -66,6 +74,8 @@ public class BusinessSubSampleServiceImpl implements BusinessSubSampleService { @Resource private DictionaryBusinessService dictionaryBusinessService; @Resource private ConfigSubSampleService configSubSampleService; @Resource private SequenceUtil sequenceUtil; + @Resource + private DictionaryBusinessMapper dictionaryBusinessMapper; @Override @Transactional(rollbackFor = Exception.class) @@ -130,6 +140,33 @@ public class BusinessSubSampleServiceImpl implements BusinessSubSampleService { return businessSubSampleMapper.selectExtendById(id); } + @Override + public BusinessSubSampleExtendRespVO getPrintSubSample(Long id) { + LoginUser loginUser = SecurityFrameworkUtils.getLoginUser(); + BusinessSubSampleExtendRespVO businessSubSample = businessSubSampleMapper.selectExtendById(id); + BusinessSubSampleAnalysisGroupDO businessSubSampleAnalysisGroupDO = businessSubSampleAnalysisGroupMapper.selectByBusinessSubSampleIdAndAssayDepartmentId(id, loginUser.getVisitDeptId()); + businessSubSample.setAssayDepartmentId(businessSubSampleAnalysisGroupDO.getAssayDepartmentId()); + businessSubSample.setAssayDepartmentName(businessSubSampleAnalysisGroupDO.getAssayDepartmentName()); + businessSubSample.setSampleReceiver(businessSubSampleAnalysisGroupDO.getSampleReceiver()); + businessSubSample.setSampleReceiveTime(businessSubSampleAnalysisGroupDO.getSampleReceiveTime()); + List businessAssayTaskDataDOList = businessAssayTaskDataMapper.selectByBusinessSubSampleIdAndAssayDepartmentId(id, loginUser.getVisitDeptId()); + Map> businessAssayTaskDataDOMap = businessAssayTaskDataDOList.stream().collect(Collectors.groupingBy(BusinessAssayTaskDataDO::getConfigAssayMethodId)); + List assayProjectList = new ArrayList<>(); + for (Map.Entry> entry : businessAssayTaskDataDOMap.entrySet()) { + List val = entry.getValue(); + BusinessAssayTaskDataDO businessAssayTaskDataDO = val.get(0); + String assayProject = businessAssayTaskDataDO.getAssayProject(); + String[] split = assayProject.split(","); + for (String s : split) { + if (!assayProjectList.contains(s)) { + assayProjectList.add(s); + } + } + } + businessSubSample.setAssayProject(CollUtil.join(assayProjectList, ",")); + return businessSubSample; + } + @Override public BusinessSubSampleDO getBySampleCode(String sampleCode) { LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); @@ -292,7 +329,7 @@ public class BusinessSubSampleServiceImpl implements BusinessSubSampleService { @Transactional(rollbackFor = Exception.class) public Integer execTakeOff(JSONObject reqVo) { String actionWay = reqVo.getString("actionWay"); - String warehouseLocationCode = reqVo.getString("warehouseLocationCode"); + String warehouseLocationCode = reqVo.getString("locationCode"); String sampleReturnCode = reqVo.getString("sampleReturnCodes"); LoginUser loginUser = SecurityFrameworkUtils.getLoginUser(); String loginUserName = SecurityFrameworkUtils.getLoginUserNickname(); @@ -314,7 +351,7 @@ public class BusinessSubSampleServiceImpl implements BusinessSubSampleService { ConfigWarehouseLocationDO locationDO = configWarehouseLocationService.getLocationByCode(warehouseLocationCode, QmsWarehouseLocationConstant.WAREHOUSE_TYPE_SAMPLE); if(locationDO == null) throw exception(CONFIG_WAREHOUSE_LOCATION_NOT_EXISTS); - queryWrapper.eq(BusinessSubSampleDO::getConfigWarehouseLocationInfomationId, warehouseLocationCode); + queryWrapper.eq(BusinessSubSampleDO::getConfigWarehouseLocationInfomationId, locationDO.getId()); }else{ throw exception0(BUSINESS_SUB_SAMPLE_NOT_EXISTS.getCode(), "actionWay参数错误!"); } @@ -325,35 +362,34 @@ public class BusinessSubSampleServiceImpl implements BusinessSubSampleService { //创建交接抬头 BusinessSampleHandoverSaveReqVO handoverVO = new BusinessSampleHandoverSaveReqVO(); - String codeTemplate = dictionaryBusinessService.getValueByDataKey("sample_take_off_serial"); - if(ObjectUtils.isEmpty(codeTemplate)) - throw exception0(BUSINESS_SUB_SAMPLE_NOT_EXISTS.getCode(), "缺少“样品下架记录编号规则”的配置,请在业务参数字典增加此配置!"); - String code = sequenceUtil.genCode(codeTemplate); + String code = sequenceUtil.genCode("QMS_SAMPLE_TAKE_OFF_SERIAL"); handoverVO.setCode(code); handoverVO.setName("样品下架记录"); handoverVO.setSampleFlowNodeKey(QmsCommonConstant.FLOW_SAMPLE_STORAGE); handoverVO.setOperationTime(LocalDateTime.now()); handoverVO.setOperator(loginUserName); handoverVO.setOperatorId(loginUser.getId()); + handoverVO.setOperationType(SAMPLE_STORAGE_OPERATION_TYPE_TAKEN_OFF); BusinessSampleHandoverRespVO handoverRespVO = businessSampleHandoverService.createBusinessSampleHandover(handoverVO); - + List dictionaryBusinessIdList = waitingList.stream().map(m -> m.getDictionaryBusinessId()).distinct().collect(Collectors.toList()); + List dictionaryBusinessList = dictionaryBusinessMapper.selectByIds(dictionaryBusinessIdList); //更新下架状态 List recordList = new ArrayList<>(); List detailList = new ArrayList<>(); //通过样品交接明细记录下架记录 for(BusinessSubSampleDO businessSubSampleDO : waitingList){ businessSubSampleDO.setReturnStatus(QmsCommonConstant.TAKEN_OFF); //创建流转记录 - BusinessHandoverRecordSubDO reecordDO = new BusinessHandoverRecordSubDO(); - reecordDO.setBusinessSubSampleId(businessSubSampleDO.getId()); - reecordDO.setSampleFlowNodeKey(QmsCommonConstant.FLOW_SAMPLE_STORAGE); - reecordDO.setSampleCode(businessSubSampleDO.getSampleReturnCode()); - reecordDO.setOperationTime(LocalDateTime.now()); - reecordDO.setOperator(loginUserName); - reecordDO.setOperatorId(loginUser.getId()); - reecordDO.setSendSampleOperator(""); - reecordDO.setReceiveSampleOperator(""); - reecordDO.setConfigSampleFlowId(0L); - recordList.add(reecordDO); + BusinessHandoverRecordSubDO record = new BusinessHandoverRecordSubDO(); + record.setBusinessSubSampleId(businessSubSampleDO.getId()); + record.setSampleFlowNodeKey(QmsCommonConstant.FLOW_SAMPLE_STORAGE); + record.setSampleCode(businessSubSampleDO.getSampleReturnCode()); + record.setOperationTime(LocalDateTime.now()); + record.setOperator(loginUserName); + record.setOperatorId(loginUser.getId()); + record.setSendSampleOperator(""); + record.setReceiveSampleOperator(""); + record.setConfigSampleFlowId(0L); + recordList.add(record); BusinessSampleHandoverDetailDO detailDO = new BusinessSampleHandoverDetailDO(); @@ -361,6 +397,11 @@ public class BusinessSubSampleServiceImpl implements BusinessSubSampleService { detailDO.setBusinessSubSampleId(businessSubSampleDO.getId()); detailDO.setSampleName(businessSubSampleDO.getSampleName()); detailDO.setSampleCode(businessSubSampleDO.getSampleReturnCode()); + detailDO.setDictionaryBusinessId(businessSubSampleDO.getDictionaryBusinessId()); + DictionaryBusinessDO dictionaryBusiness = dictionaryBusinessList.stream().filter(f -> f.getId().equals(businessSubSampleDO.getDictionaryBusinessId())).findFirst().orElse(null); + detailDO.setDictionaryBusinessName(""); + if(dictionaryBusiness != null) + detailDO.setDictionaryBusinessName(dictionaryBusiness.getName()); detailList.add(detailDO); } businessHandoverRecordSubService.insertBatch(recordList); @@ -377,8 +418,10 @@ public class BusinessSubSampleServiceImpl implements BusinessSubSampleService { String warehouseLocationCode = reqVo.getString("warehouseLocationCode"); String sampleReturnCode = reqVo.getString("sampleReturnCode"); if(ObjectUtils.isEmpty(targetLocation)) - throw exception0(BUSINESS_SUB_SAMPLE_NOT_EXISTS.getCode(), "缺少目标库位参数!"); + throw exception0(BUSINESS_SUB_SAMPLE_NOT_EXISTS.getCode(), "缺少“变更后库位”参数!"); ConfigWarehouseLocationDO targetLocationDO = configWarehouseLocationService.getLocationByCode(targetLocation, QmsWarehouseLocationConstant.WAREHOUSE_TYPE_SAMPLE); + if(targetLocationDO == null) + throw exception0(BUSINESS_SUB_SAMPLE_NOT_EXISTS.getCode(), "“变更后库位”不存在,请检查编码是否正确!"); //查询要操作的样品 LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); queryWrapper.eq(BusinessSubSampleDO::getSampleFlowNodeKey, QmsCommonConstant.FLOW_SAMPLE_STORAGE); diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleAnalysisAuditServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleAnalysisAuditServiceImpl.java index fc903c0..767e7b7 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleAnalysisAuditServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleAnalysisAuditServiceImpl.java @@ -294,15 +294,18 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic if (businessAssayTaskDO == null) { throw new ServiceException(1_032_100_000, "未找到任务分配单"); } - String formValue = businessAssayTaskDO.getFormValue(); - JSONObject formValueJsonObject = JSON.parseObject(formValue); + JSONArray jsonArray = new JSONArray(); String jsonString = JSON.toJSONString(businessAssayTaskDO, context); JSONObject businessAssayTaskJson = JSON.parseObject(jsonString); - formValueJsonObject.forEach((key, value) -> { - businessAssayTaskJson.put(key, value); - }); - JSONArray jsonArray = new JSONArray(); + + String formValue = businessAssayTaskDO.getFormValue(); + if (StringUtils.isNotBlank(formValue)) { + JSONObject formValueJsonObject = JSON.parseObject(formValue); + formValueJsonObject.forEach((key, value) -> { + businessAssayTaskJson.put(key, value); + }); + } jsonArray.add(businessAssayTaskJson); resultJsonObject.put("businessAssayTask", jsonArray); @@ -437,6 +440,7 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic businessAssayTaskDO.setFlowStatus(QmsCommonConstant.APPROVED); businessAssayTaskDO.setReportTime(LocalDateTime.now()); businessAssayTaskDO.setReportOperator(SecurityFrameworkUtils.getLoginUserNickname()); + businessAssayTaskDO.setReportOperatorId(SecurityFrameworkUtils.getLoginUserId()); //查询分析任务明细 List businessAssayTaskDataDOList = businessAssayTaskDataMapper.selectByBusinessAssayTaskId(businessAssayTaskId); diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleAnalysisServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleAnalysisServiceImpl.java index 1a12032..ce2bd47 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleAnalysisServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleAnalysisServiceImpl.java @@ -4,7 +4,9 @@ import java.math.BigDecimal; import java.math.RoundingMode; import java.time.LocalDateTime; import java.util.ArrayList; +import java.util.Comparator; import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.stream.Collectors; @@ -21,8 +23,10 @@ import com.zt.plat.framework.common.util.object.BeanUtils; import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; import com.zt.plat.framework.security.core.util.SecurityFrameworkUtils; import com.zt.plat.module.qms.business.bus.controller.vo.BatchSampleAnalysisColumnRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayParameterDataExtendRespVO; import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayParameterDataReqVO; import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayProjectAndParameterRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayProjectDataExtendRespVO; import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayProjectDataReqVO; import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayTaskAnalysisSampleAndQcProjectRespVO; import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayTaskAnalysisSampleProjectRespVO; @@ -41,6 +45,7 @@ import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCCoefficientP import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCManagementDataDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCManagementParameterDataDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCManagementProjectDataDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleDO; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayParameterDataMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayProjectDataMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayTaskDataMapper; @@ -51,36 +56,31 @@ import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCCoefficientParam import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCManagementDataMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCManagementParameterDataMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCManagementProjectDataMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubSampleMapper; import com.zt.plat.module.qms.business.config.controller.vo.BusinessAssayTaskAnalysisDataRespVO; import com.zt.plat.module.qms.business.config.controller.vo.ConfigAssayMethodProjectCoefficientRespVO; import com.zt.plat.module.qms.business.config.controller.vo.ConfigAssayMethodProjectRangeRespVO; import com.zt.plat.module.qms.business.config.controller.vo.ConfigQCSampleMethodExtendRespVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSampleMethodConfInfo; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSampleMethodConfItem; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSampleMethodConfPoint; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodDO; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectCoefficientDO; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectRangeDO; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSubSampleMethodDO; import com.zt.plat.module.qms.business.config.dal.mapper.ConfigAssayMethodMapper; import com.zt.plat.module.qms.business.config.dal.mapper.ConfigAssayMethodProjectCoefficientMapper; import com.zt.plat.module.qms.business.config.dal.mapper.ConfigAssayMethodProjectRangeMapper; import com.zt.plat.module.qms.business.config.dal.mapper.ConfigQCSampleMethodMapper; +import com.zt.plat.module.qms.business.config.dal.mapper.ConfigSubSampleMethodMapper; import com.zt.plat.module.qms.common.data.dal.dataobject.DataCollectionDO; import com.zt.plat.module.qms.common.data.service.DataCollectionService; import com.zt.plat.module.qms.enums.QmsCommonConstant; +import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.collection.CollUtil; import jakarta.annotation.Resource; -/** - * SampleAnalysisServiceImpl - *

- * 更新历史: - *

 版本         更新时间            更新者        更新内容
- * V1.0 2025年9月22日 wxr Add
- * Copyright (C) 云南志者竟成科技有限公司 - *

- * @author 王兴荣 - * @version V1.0 - * @since 2025年9月22日 - */ @Service public class SampleAnalysisServiceImpl implements SampleAnalysisService { @@ -93,6 +93,12 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService { @Resource private ConfigAssayMethodProjectCoefficientMapper configAssayMethodProjectCoefficientMapper; + @Resource + private ConfigSubSampleMethodMapper configSubSampleMethodMapper; + + @Resource + private BusinessSubSampleMapper businessSubSampleMapper; + @Resource private BusinessAssayTaskMapper businessAssayTaskMapper; @@ -161,12 +167,20 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService { List businessAssayTaskDetailList = businessAssayTaskDetailMapper.selectList(new LambdaQueryWrapperX().eq(BusinessAssayTaskDetailDO::getBusinessAssayTaskId, businessAssayTaskId)); List businessAssayTaskDataList = businessAssayTaskDataMapper.selectList(new LambdaQueryWrapperX().eq(BusinessAssayTaskDataDO::getBusinessAssayTaskId, businessAssayTaskId).eq(BusinessAssayTaskDataDO::getConfigAssayMethodId, businessAssayTaskDO.getConfigAssayMethodId())); - BusinessAssayTaskDataDO businessAssayTaskData = businessAssayTaskDataList.get(0); + List businessAssayTaskDataIdList = businessAssayTaskDataList.stream().map(m -> m.getId()).collect(Collectors.toList()); + //BusinessAssayTaskDataDO businessAssayTaskData = businessAssayTaskDataList.get(0); BusinessAssayProjectDataReqVO projectDataSearch = new BusinessAssayProjectDataReqVO(); - projectDataSearch.setBusinessAssayTaskDataId(businessAssayTaskData.getId()); +// projectDataSearch.setBusinessAssayTaskDataId(businessAssayTaskData.getId()); + projectDataSearch.setBusinessAssayTaskDataIdList(businessAssayTaskDataIdList); List projectAndParameterList = businessAssayProjectDataMapper.selectProjectAndParameterBy(projectDataSearch); - for (BusinessAssayProjectAndParameterRespVO ep : projectAndParameterList) { + + Map> projectAndParameterMap = projectAndParameterList.stream().sorted(Comparator.comparing(BusinessAssayProjectAndParameterRespVO::getParamNo)).collect(Collectors.groupingBy(BusinessAssayProjectAndParameterRespVO::getDicId, + LinkedHashMap::new, // 保持组首次出现的顺序(可选) + Collectors.toList() // ArrayList 保持组内顺序 + )); + for (Map.Entry> entry : projectAndParameterMap.entrySet()) { + BusinessAssayProjectAndParameterRespVO ep = entry.getValue().get(0); String fieldIndex = "e" + ep.getDicId(); String title = ep.getShowName() + (StringUtils.isBlank(ep.getUnit()) ? "" : "(" + ep.getUnit() + ")"); boolean isEdit = StringUtils.isBlank(ep.getFormula()); @@ -183,7 +197,26 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService { cloumns.add(new BatchSampleAnalysisColumnRespVO(fieldIndex, fieldIndex + ".value", title, "", "120px", p.getDataType(), p.getDecimalPosition(), null, p.getFormula(), p.getParamNo(), isEdit, p.getUnit(), "parameter", p.getFillingWay(), p.getGroupDictionaryBusinessId(), p.getGroupDictionaryBusinessKey(), p.getGroupDictionaryBusinessName())); } } + } +// for (BusinessAssayProjectAndParameterRespVO ep : projectAndParameterList) { +// String fieldIndex = "e" + ep.getDicId(); +// String title = ep.getShowName() + (StringUtils.isBlank(ep.getUnit()) ? "" : "(" + ep.getUnit() + ")"); +// boolean isEdit = StringUtils.isBlank(ep.getFormula()); +// cloumns.add(new BatchSampleAnalysisColumnRespVO(fieldIndex, fieldIndex + ".value", title, "", "120px", ep.getDataType(), ep.getDecimalPosition(), null, ep.getFormula(), ep.getParamNo(), isEdit, ep.getUnit(), "project", ep.getFillingWay(), ep.getGroupDictionaryBusinessId(), ep.getGroupDictionaryBusinessKey(), ep.getGroupDictionaryBusinessName())); +// +// if (StringUtils.isNotEmpty(ep.getFormula())) { +// BusinessAssayParameterDataReqVO parameterDataSearch = new BusinessAssayParameterDataReqVO(); +// parameterDataSearch.setBusinessAssayProjectDataId(ep.getId()); +// List plist = businessAssayParameterDataMapper.selectProjectAndParameterBy(parameterDataSearch); +// for (BusinessAssayProjectAndParameterRespVO p : plist) { +// fieldIndex = "p" + p.getDicId(); +// title = p.getShowName() + (StringUtils.isBlank(p.getUnit()) ? "" : "(" + p.getUnit() + ")"); +// isEdit = StringUtils.isBlank(p.getFormula()); +// cloumns.add(new BatchSampleAnalysisColumnRespVO(fieldIndex, fieldIndex + ".value", title, "", "120px", p.getDataType(), p.getDecimalPosition(), null, p.getFormula(), p.getParamNo(), isEdit, p.getUnit(), "parameter", p.getFillingWay(), p.getGroupDictionaryBusinessId(), p.getGroupDictionaryBusinessKey(), p.getGroupDictionaryBusinessName())); +// } +// } +// } businessAssayTaskAnalysisSampleProjectRespVO.setColumns(cloumns); @@ -419,12 +452,19 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService { List businessAssayTaskDetailList = businessAssayTaskDetailMapper.selectList(new LambdaQueryWrapperX().eq(BusinessAssayTaskDetailDO::getBusinessAssayTaskId, businessAssayTaskDO.getId())); List businessAssayTaskDataList = businessAssayTaskDataMapper.selectList(new LambdaQueryWrapperX().eq(BusinessAssayTaskDataDO::getBusinessAssayTaskId, businessAssayTaskDO.getId()).eq(BusinessAssayTaskDataDO::getConfigAssayMethodId, businessAssayTaskDO.getConfigAssayMethodId())); - BusinessAssayTaskDataDO businessAssayTaskData = businessAssayTaskDataList.get(0); + List businessAssayTaskDataIdList = businessAssayTaskDataList.stream().map(m -> m.getId()).collect(Collectors.toList()); + // BusinessAssayTaskDataDO businessAssayTaskData = businessAssayTaskDataList.get(0); BusinessAssayProjectDataReqVO projectDataSearch = new BusinessAssayProjectDataReqVO(); - projectDataSearch.setBusinessAssayTaskDataId(businessAssayTaskData.getId()); +// projectDataSearch.setBusinessAssayTaskDataId(businessAssayTaskData.getId()); + projectDataSearch.setBusinessAssayTaskDataIdList(businessAssayTaskDataIdList); List projectAndParameterList = businessAssayProjectDataMapper.selectProjectAndParameterBy(projectDataSearch); - for (BusinessAssayProjectAndParameterRespVO ep : projectAndParameterList) { + Map> projectAndParameterMap = projectAndParameterList.stream().sorted(Comparator.comparing(BusinessAssayProjectAndParameterRespVO::getParamNo)).collect(Collectors.groupingBy(BusinessAssayProjectAndParameterRespVO::getDicId, + LinkedHashMap::new, // 保持组首次出现的顺序(可选) + Collectors.toList() // ArrayList 保持组内顺序 + )); + for (Map.Entry> entry : projectAndParameterMap.entrySet()) { + BusinessAssayProjectAndParameterRespVO ep = entry.getValue().get(0); String fieldIndex = "e" + ep.getDicId(); String title = ep.getShowName() + (StringUtils.isBlank(ep.getUnit()) ? "" : "(" + ep.getUnit() + ")"); boolean isEdit = StringUtils.isBlank(ep.getFormula()); @@ -441,7 +481,25 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService { cloumns.add(new BatchSampleAnalysisColumnRespVO(fieldIndex, fieldIndex + ".value", title, "", "120px", p.getDataType(), p.getDecimalPosition(), null, p.getFormula(), p.getParamNo(), isEdit, p.getUnit(), "parameter", p.getFillingWay(), p.getGroupDictionaryBusinessId(), p.getGroupDictionaryBusinessKey(), p.getGroupDictionaryBusinessName())); } } - } + } +// for (BusinessAssayProjectAndParameterRespVO ep : projectAndParameterList) { +// String fieldIndex = "e" + ep.getDicId(); +// String title = ep.getShowName() + (StringUtils.isBlank(ep.getUnit()) ? "" : "(" + ep.getUnit() + ")"); +// boolean isEdit = StringUtils.isBlank(ep.getFormula()); +// cloumns.add(new BatchSampleAnalysisColumnRespVO(fieldIndex, fieldIndex + ".value", title, "", "120px", ep.getDataType(), ep.getDecimalPosition(), null, ep.getFormula(), ep.getParamNo(), isEdit, ep.getUnit(), "project", ep.getFillingWay(), ep.getGroupDictionaryBusinessId(), ep.getGroupDictionaryBusinessKey(), ep.getGroupDictionaryBusinessName())); +// +// if (StringUtils.isNotEmpty(ep.getFormula())) { +// BusinessAssayParameterDataReqVO parameterDataSearch = new BusinessAssayParameterDataReqVO(); +// parameterDataSearch.setBusinessAssayProjectDataId(ep.getId()); +// List plist = businessAssayParameterDataMapper.selectProjectAndParameterBy(parameterDataSearch); +// for (BusinessAssayProjectAndParameterRespVO p : plist) { +// fieldIndex = "p" + p.getDicId(); +// title = p.getShowName() + (StringUtils.isBlank(p.getUnit()) ? "" : "(" + p.getUnit() + ")"); +// isEdit = StringUtils.isBlank(p.getFormula()); +// cloumns.add(new BatchSampleAnalysisColumnRespVO(fieldIndex, fieldIndex + ".value", title, "", "120px", p.getDataType(), p.getDecimalPosition(), null, p.getFormula(), p.getParamNo(), isEdit, p.getUnit(), "parameter", p.getFillingWay(), p.getGroupDictionaryBusinessId(), p.getGroupDictionaryBusinessKey(), p.getGroupDictionaryBusinessName())); +// } +// } +// } businessAssayTaskAnalysisDataRespVO.setColumns(cloumns); @@ -931,7 +989,49 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService { @Transactional(rollbackFor = Exception.class) public void issuedIngredients(Long businessAssayTaskId) { BusinessAssayTaskDO businessAssayTaskDO = businessAssayTaskMapper.selectById(businessAssayTaskId); - businessAssayTaskDO.setIngredientsStatus("in_progress"); + List businessAssayTaskDataDOList = businessAssayTaskDataMapper.selectByBusinessAssayTaskId(businessAssayTaskId); + List businessAssayTaskDataIdList = businessAssayTaskDataDOList.stream().map(m -> m.getId()).collect(Collectors.toList()); + //获取子样id列表 + List businessSubSampleIdList = businessAssayTaskDataDOList.stream().map(m -> m.getBusinessSubSampleId()).distinct().collect(Collectors.toList()); + //获取子样 + List businessSubSampleDOList = businessSubSampleMapper.selectByIds(businessSubSampleIdList); + //子样配置id列表 + List configSubSampleIdList = businessSubSampleDOList.stream().map(m -> m.getConfigSubSampleId()).distinct().collect(Collectors.toList()); + //子样配置方法 + List configSubSampleMethodList = configSubSampleMethodMapper.selectByConfigSubSampleIdsAndConfigAssayMethodId(configSubSampleIdList, businessAssayTaskDO.getConfigAssayMethodId()); + + List businessAssayProjectDataList = businessAssayProjectDataMapper.selectByBusinessAssayTaskDataIds(businessAssayTaskDataIdList); + List businessAssayProjectDataIdList = businessAssayProjectDataList.stream().map(m -> m.getId()).collect(Collectors.toList()); + //查询检测项目参数 + List businessAssayParameterDataList = businessAssayParameterDataMapper.selectExtendByBusinessAssayProjectDataIds(businessAssayProjectDataIdList); + + for (BusinessAssayTaskDataDO businessAssayTaskDataDO : businessAssayTaskDataDOList) { + //获取子样 + BusinessSubSampleDO businessSubSampleDO = businessSubSampleDOList.stream().filter(f -> f.getId().equals(businessAssayTaskDataDO.getBusinessSubSampleId())).findFirst().orElse(null); + + //子样配置信息 + ConfigSubSampleMethodDO configSubSampleMethodDO = configSubSampleMethodList.stream().filter(f -> f.getConfigSubSampleId().equals(businessSubSampleDO.getConfigSubSampleId())).findFirst().orElse(null); + String configInfomation = configSubSampleMethodDO.getConfigInfomation(); + if (StringUtils.isNotBlank(configInfomation)) { + ConfigSubSampleMethodConfInfo configSubSampleMethodConfInfo = JSON.parseObject(configInfomation, ConfigSubSampleMethodConfInfo.class); + //获取下发配置 + List downIngredients = configSubSampleMethodConfInfo.getDownIngredients(); + for (ConfigSubSampleMethodConfItem configSubSampleMethodConfItem : downIngredients) { + if (configSubSampleMethodConfItem.getRequired()) { + ConfigSubSampleMethodConfPoint source = configSubSampleMethodConfItem.getSource(); + String project = source.getProject(); + String parameter = source.getParameter(); + BusinessAssayProjectDataExtendRespVO currentBusinessAssayProjectData = businessAssayProjectDataList.stream().filter(f -> f.getBusinessAssayTaskDataId().equals(businessAssayTaskDataDO.getId()) && f.getSimpleName().equals(project)).findFirst().orElse(null); + BusinessAssayParameterDataExtendRespVO currentBusinessAssayParameterData = businessAssayParameterDataList.stream().filter(f -> f.getBusinessAssayProjectDataId().equals(currentBusinessAssayProjectData.getId()) && f.getParameterKey().equals(parameter)).findFirst().orElse(null); + if (StringUtils.isBlank(currentBusinessAssayParameterData.getValue())) { + throw new ServiceException(1_032_050_000, "当前分析任务,存在下发配料必填为空情况。请检查后再下发!"); + } + } + } + + } + } + businessAssayTaskDO.setIngredientsStatus(QmsCommonConstant.IN_PROGRESS); businessAssayTaskMapper.updateById(businessAssayTaskDO); } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleResultReportingServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleResultReportingServiceImpl.java index 28c308f..668f6aa 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleResultReportingServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleResultReportingServiceImpl.java @@ -133,6 +133,14 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe //查询结果报送未上报的样品 List noReportSubParentSampleAssessmentRespList = businessSubParentSampleAssessmentProjectMapper.selectNoReportSubParentSampleAssessment(configAssayMethodId); + + if (CollUtil.isEmpty(noReportSubParentSampleAssessmentRespList)) {//没有查询到未上报的数据 + JSONObject json = new JSONObject(); + json.put("columns", columnList); + json.put("datas", dataList); + return json; + } + //分样id列表 List businessSubParentSampleIds = noReportSubParentSampleAssessmentRespList.stream().map(m -> m.getBusinessSubParentSampleId()).collect(Collectors.toList()); //报送的检测项目数据 diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleTaskAssignServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleTaskAssignServiceImpl.java index e70cb1d..d837dd0 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleTaskAssignServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleTaskAssignServiceImpl.java @@ -519,6 +519,7 @@ public class SampleTaskAssignServiceImpl implements SampleTaskAssignService { businessQCCoefficientDataDO.setAssayDepartmentId(configAssayMethodDO.getAssayDepartmentId()); businessQCCoefficientDataDO.setAssayDepartmentName(configAssayMethodDO.getAssayDepartmentName()); businessQCCoefficientDataDO.setAssayOperator(businessAssayTaskDO.getAssayOperator()); + businessQCCoefficientDataDO.setAssayOperatorId(businessAssayTaskDO.getAssayOperatorId()); businessQCCoefficientDataDO.setAssayProject(""); businessQCCoefficientDataDO.setAssignTaskTime(businessAssayTaskDO.getTaskAssignTime()); businessQCCoefficientDataDO.setIsAssignTasked(QmsCommonConstant.YES); @@ -562,6 +563,7 @@ public class SampleTaskAssignServiceImpl implements SampleTaskAssignService { businessQCManagementDataDO.setAssayDepartmentId(configAssayMethodDO.getAssayDepartmentId()); businessQCManagementDataDO.setAssayDepartmentName(configAssayMethodDO.getAssayDepartmentName()); businessQCManagementDataDO.setAssayOperator(businessAssayTaskDO.getAssayOperator()); + businessQCManagementDataDO.setAssayOperatorId(businessAssayTaskDO.getAssayOperatorId()); businessQCManagementDataDO.setAssayProject(assayProject); businessQCManagementDataDO.setAssignTaskTime(businessAssayTaskDO.getTaskAssignTime()); businessQCManagementDataDO.setIsAssignTasked(QmsCommonConstant.YES); diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigWarehouseLocationController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigWarehouseLocationController.java index 53b4614..fbba672 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigWarehouseLocationController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigWarehouseLocationController.java @@ -1,8 +1,16 @@ package com.zt.plat.module.qms.business.config.controller.admin; +import com.zt.plat.framework.security.core.LoginUser; +import com.zt.plat.framework.security.core.util.SecurityFrameworkUtils; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigPermissionRespVO; import com.zt.plat.module.qms.business.config.controller.vo.ConfigWarehouseLocationPageReqVO; import com.zt.plat.module.qms.business.config.controller.vo.ConfigWarehouseLocationRespVO; import com.zt.plat.module.qms.business.config.controller.vo.ConfigWarehouseLocationSaveReqVO; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigPermissionDO; +import com.zt.plat.module.qms.business.config.service.ConfigPermissionService; +import com.zt.plat.module.qms.enums.QmsPermissionConstant; +import com.zt.plat.module.qms.enums.QmsWarehouseLocationConstant; +import com.zt.plat.module.system.api.permission.PermissionApi; import org.springframework.web.bind.annotation.*; import jakarta.annotation.Resource; import org.springframework.validation.annotation.Validated; @@ -40,8 +48,16 @@ import com.zt.plat.module.qms.business.config.service.ConfigWarehouseLocationSer public class ConfigWarehouseLocationController implements BusinessControllerMarker { - @Resource - private ConfigWarehouseLocationService configWarehouseLocationService; + @Resource private ConfigWarehouseLocationService configWarehouseLocationService; + @Resource private ConfigPermissionService configPermissionService; + @Resource private PermissionApi permissionApi; + + @PostMapping("/save") + @Operation(summary = "创建存放位置") +// @PreAuthorize("@ss.hasPermission('qms:config-warehouse-location:create')") + public CommonResult save(@Valid @RequestBody ConfigWarehouseLocationSaveReqVO createReqVO) { + return success(configWarehouseLocationService.save(createReqVO)); + } @PostMapping("/create") @Operation(summary = "创建存放位置") @@ -82,15 +98,35 @@ public class ConfigWarehouseLocationController implements BusinessControllerMark // @PreAuthorize("@ss.hasPermission('qms:config-warehouse-location:query')") public CommonResult getConfigWarehouseLocation(@RequestParam("id") Long id) { ConfigWarehouseLocationDO configWarehouseLocation = configWarehouseLocationService.getConfigWarehouseLocation(id); - return success(BeanUtils.toBean(configWarehouseLocation, ConfigWarehouseLocationRespVO.class)); + List permissionList = configPermissionService.getPermissionList(id, QmsPermissionConstant.SAMPLE_WAREHOUSE_ADMIN, ""); + List permissionRespVOList= BeanUtils.toBean(permissionList, ConfigPermissionRespVO.class); + ConfigWarehouseLocationRespVO vo = BeanUtils.toBean(configWarehouseLocation, ConfigWarehouseLocationRespVO.class); + vo.setPermissionList(permissionRespVOList); + return success(vo); } @GetMapping("/page") @Operation(summary = "获得存放位置分页") // @PreAuthorize("@ss.hasPermission('qms:config-warehouse-location:query')") public CommonResult> getConfigWarehouseLocationPage(@Valid ConfigWarehouseLocationPageReqVO pageReqVO) { - PageResult pageResult = configWarehouseLocationService.getConfigWarehouseLocationPage(pageReqVO); - return success(BeanUtils.toBean(pageResult, ConfigWarehouseLocationRespVO.class)); + PageResult pageResult = configWarehouseLocationService.getConfigWarehouseLocationPage(pageReqVO); + return success(pageResult); + } + + @GetMapping("/selectListWithPermission") + @Operation(summary = "安权限查询报告类型") + public CommonResult> selectListWithPermission(@Valid ConfigWarehouseLocationPageReqVO pageReqVO) { + pageReqVO.setPermissionFilterFlag("1"); + pageReqVO.setSrcPermissionType(QmsPermissionConstant.SAMPLE_WAREHOUSE_ADMIN); + pageReqVO.setDataType(QmsWarehouseLocationConstant.DATA_TYPE_WAREHOUSE); + //查询权限 + LoginUser loginUser = SecurityFrameworkUtils.getLoginUser(); + Long userId = loginUser.getId(); + CommonResult> roleRet = permissionApi.getUserRoleIdListByUserId(userId); + Set roleIds = roleRet.getData(); + pageReqVO.setRoleIds(roleIds); + List list = configWarehouseLocationService.selectListWithPermission(pageReqVO); + return success(BeanUtils.toBean(list, ConfigWarehouseLocationRespVO.class)); } @GetMapping("/export-excel") @@ -100,10 +136,9 @@ public class ConfigWarehouseLocationController implements BusinessControllerMark public void exportConfigWarehouseLocationExcel(@Valid ConfigWarehouseLocationPageReqVO pageReqVO, HttpServletResponse response) throws IOException { pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); - List list = configWarehouseLocationService.getConfigWarehouseLocationPage(pageReqVO).getList(); + List list = configWarehouseLocationService.getConfigWarehouseLocationPage(pageReqVO).getList(); // 导出 Excel - ExcelUtils.write(response, "存放位置.xls", "数据", ConfigWarehouseLocationRespVO.class, - BeanUtils.toBean(list, ConfigWarehouseLocationRespVO.class)); + ExcelUtils.write(response, "存放位置.xls", "数据", ConfigWarehouseLocationRespVO.class, list); } } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/MaterialAssayStandardController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/MaterialAssayStandardController.java index b4d9fc4..28aff4f 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/MaterialAssayStandardController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/MaterialAssayStandardController.java @@ -70,6 +70,10 @@ public class MaterialAssayStandardController implements BusinessControllerMarker @Operation(summary = "更新检测标准") //@PreAuthorize("@ss.hasPermission('qms:material-assay-standard:update')") public CommonResult updateMaterialAssayStandard(@Valid @RequestBody MaterialAssayStandardSaveReqVO updateReqVO) { + Long id = updateReqVO.getId(); + MaterialAssayStandardDO entity = materialAssayStandardService.getMaterialAssayStandard(id); + if("tempDataKey".equals(entity.getRemark())) + updateReqVO.setRemark(""); materialAssayStandardService.updateMaterialAssayStandard(updateReqVO); return success(true); } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/MaterialAssayStandardDetailController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/MaterialAssayStandardDetailController.java index 4e326f8..b14fc5a 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/MaterialAssayStandardDetailController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/MaterialAssayStandardDetailController.java @@ -74,6 +74,14 @@ public class MaterialAssayStandardDetailController implements BusinessController return success(jsonArray); } + @GetMapping("/getByStandardId") + @Operation(summary = "获得物料检测标准检测项目分页") + //@PreAuthorize("@ss.hasPermission('qms:material-assay-standard-detail:query')") + public CommonResult> getByStandardId(@Valid MaterialAssayStandardDetailPageReqVO pageReqVO) { + List list = materialAssayStandardDetailService.getByStandardId(pageReqVO.getMaterialAssayStandardId()); + return success(list); + } + @PostMapping("/create") @Operation(summary = "创建物料检测标准检测项目") //@PreAuthorize("@ss.hasPermission('qms:material-assay-standard-detail:create')") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleMethodConfInfo.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleMethodConfInfo.java new file mode 100644 index 0000000..41f2b37 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleMethodConfInfo.java @@ -0,0 +1,18 @@ +package com.zt.plat.module.qms.business.config.controller.vo; + +import java.util.List; + +import lombok.Data; + +@Data +public class ConfigSubSampleMethodConfInfo { + + /** 分析方法参数取值配置 **/ + private List getParam; + + /** 分析方法下发配料配置 **/ + private List downIngredients; + + /** 分析方法配料上传配置 **/ + private List upIngredients; +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleMethodConfItem.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleMethodConfItem.java new file mode 100644 index 0000000..3ba9e78 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleMethodConfItem.java @@ -0,0 +1,16 @@ +package com.zt.plat.module.qms.business.config.controller.vo; + +import lombok.Data; + +@Data +public class ConfigSubSampleMethodConfItem { + + /** 来源 **/ + private ConfigSubSampleMethodConfPoint source; + + /** 目标 **/ + private ConfigSubSampleMethodConfPoint target; + + /** 是否必须 **/ + private Boolean required; +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleMethodConfPoint.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleMethodConfPoint.java new file mode 100644 index 0000000..72a534d --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleMethodConfPoint.java @@ -0,0 +1,20 @@ +package com.zt.plat.module.qms.business.config.controller.vo; + +import lombok.Data; + +@Data +public class ConfigSubSampleMethodConfPoint { + + /** 分析方法id **/ + private Long methodId; + + /** 检测项目 **/ + private String project; + + /** 参数 **/ + private String parameter; + + /** 字段 **/ + private String field; + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigWarehouseLocationPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigWarehouseLocationPageReqVO.java index 28861de..106af70 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigWarehouseLocationPageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigWarehouseLocationPageReqVO.java @@ -6,6 +6,7 @@ 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 java.util.Set; import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; @@ -13,6 +14,9 @@ import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH @Data public class ConfigWarehouseLocationPageReqVO extends PageParam { + @Schema(description = "ID", example = "31498") + private Long id; + @Schema(description = "父ID", example = "31498") private Long parentId; @@ -50,4 +54,16 @@ public class ConfigWarehouseLocationPageReqVO extends PageParam { @Schema(description = "备注") private String remark; + @Schema(description = "标签打印模板key") + private String printTemplate; + + //===================扩展属性===================== + @Schema(description = "查询时进行权限过滤") + private String permissionFilterFlag; + + @Schema(description = "查询用-权限角色") + private Set roleIds; + + @Schema(description = "查询用-源权限类型") + private String srcPermissionType; } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigWarehouseLocationRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigWarehouseLocationRespVO.java index 5080ffb..85da06a 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigWarehouseLocationRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigWarehouseLocationRespVO.java @@ -1,9 +1,12 @@ package com.zt.plat.module.qms.business.config.controller.vo; +import com.zt.plat.module.qms.core.aspect.annotation.Dict; import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; import java.time.LocalDateTime; +import java.util.List; + import com.alibaba.excel.annotation.*; @Schema(description = "管理后台 - 存放位置 Response VO") @@ -15,6 +18,7 @@ public class ConfigWarehouseLocationRespVO { @ExcelProperty("ID") private Long id; +// @Dict(dictTable="t_cfg_wrh_loc",dicCode="id",dicText="name") @Schema(description = "父ID", example = "31498") @ExcelProperty("父ID") private Long parentId; @@ -63,4 +67,17 @@ public class ConfigWarehouseLocationRespVO { @ExcelProperty("备注") private String remark; + @Schema(description = "标签打印模板key") + @ExcelProperty("标签打印模板key") + private String printTemplate; + + //===========扩展字段======================= + @Schema(description = "权限列表") + List permissionList; + + @Schema(description = "仓库名称") + String warehouseName; + + @Schema(description = "仓库编码") + String warehouseCode; } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigWarehouseLocationSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigWarehouseLocationSaveReqVO.java index 01ff684..b6e8cd0 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigWarehouseLocationSaveReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigWarehouseLocationSaveReqVO.java @@ -4,6 +4,8 @@ import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; import jakarta.validation.constraints.*; +import java.util.List; + @Schema(description = "管理后台 - 存放位置新增/修改 Request VO") @Data public class ConfigWarehouseLocationSaveReqVO { @@ -48,4 +50,10 @@ public class ConfigWarehouseLocationSaveReqVO { @Schema(description = "备注") private String remark; + @Schema(description = "标签打印模板key") + private String printTemplate; + + //===========扩展字段======================= + @Schema(description = "权限列表") + List permissionList; } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigWarehouseLocationDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigWarehouseLocationDO.java index 6e980e1..8d38d53 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigWarehouseLocationDO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigWarehouseLocationDO.java @@ -85,4 +85,8 @@ public class ConfigWarehouseLocationDO extends BusinessBaseDO { @TableField("RMK") private String remark; + //标签打印模板key + @TableField("PRNT_TMPL") + private String printTemplate; + } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigSubSampleMethodMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigSubSampleMethodMapper.java index 50cdda1..7abb095 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigSubSampleMethodMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigSubSampleMethodMapper.java @@ -53,5 +53,11 @@ public interface ConfigSubSampleMethodMapper extends BaseMapperX selectByConfigSubSampleIdsAndConfigAssayMethodId(List configSubSampleIds, Long configAssayMethodId) { + return selectList(new LambdaQueryWrapper() + .in(ConfigSubSampleMethodDO::getConfigSubSampleId, configSubSampleIds) + .eq(ConfigSubSampleMethodDO::getConfigAssayMethodId, configAssayMethodId)); + } } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigWarehouseLocationMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigWarehouseLocationMapper.java index ef85e56..9dabfdd 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigWarehouseLocationMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigWarehouseLocationMapper.java @@ -3,9 +3,16 @@ package com.zt.plat.module.qms.business.config.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.framework.mybatis.core.query.MPJLambdaWrapperX; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleDispatchDetailDO; import com.zt.plat.module.qms.business.config.controller.vo.ConfigWarehouseLocationPageReqVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigWarehouseLocationRespVO; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigWarehouseLocationDO; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigWarehouseLocationParDO; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 存放位置 Mapper @@ -15,9 +22,16 @@ import org.apache.ibatis.annotations.Mapper; @Mapper public interface ConfigWarehouseLocationMapper extends BaseMapperX { - default PageResult selectPage(ConfigWarehouseLocationPageReqVO reqVO) { - return selectPage(reqVO, new LambdaQueryWrapperX() + default PageResult selectPage(ConfigWarehouseLocationPageReqVO reqVO) { + + MPJLambdaWrapperX wrapper = new MPJLambdaWrapperX<>(); + //仓库 + wrapper.leftJoin(ConfigWarehouseLocationParDO.class, ConfigWarehouseLocationParDO::getId, ConfigWarehouseLocationDO::getParentId); + wrapper.selectAll(ConfigWarehouseLocationDO.class) + .selectAs(ConfigWarehouseLocationParDO::getName, ConfigWarehouseLocationRespVO::getWarehouseName) + .selectAs(ConfigWarehouseLocationParDO::getCode, ConfigWarehouseLocationRespVO::getWarehouseCode) .eqIfPresent(ConfigWarehouseLocationDO::getWarehouseType, reqVO.getWarehouseType()) + .eqIfPresent(ConfigWarehouseLocationDO::getId, reqVO.getId()) .eqIfPresent(ConfigWarehouseLocationDO::getParentId, reqVO.getParentId()) .likeIfPresent(ConfigWarehouseLocationDO::getName, reqVO.getName()) .eqIfPresent(ConfigWarehouseLocationDO::getCode, reqVO.getCode()) @@ -29,7 +43,10 @@ public interface ConfigWarehouseLocationMapper extends BaseMapperX selectListWithPermission(@Param("param") ConfigWarehouseLocationPageReqVO param); } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigWarehouseLocationService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigWarehouseLocationService.java index 71f440a..ceeda49 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigWarehouseLocationService.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigWarehouseLocationService.java @@ -18,6 +18,9 @@ public interface ConfigWarehouseLocationService { ConfigWarehouseLocationDO getLocationByCode(String code, String warehouseType); + //保存数据 + ConfigWarehouseLocationRespVO save(@Valid ConfigWarehouseLocationSaveReqVO reqVO); + /** * 创建存放位置 * @@ -61,6 +64,7 @@ public interface ConfigWarehouseLocationService { * @param pageReqVO 分页查询 * @return 存放位置分页 */ - PageResult getConfigWarehouseLocationPage(ConfigWarehouseLocationPageReqVO pageReqVO); + PageResult getConfigWarehouseLocationPage(ConfigWarehouseLocationPageReqVO pageReqVO); + List selectListWithPermission(ConfigWarehouseLocationPageReqVO pageReqVO); } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigWarehouseLocationServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigWarehouseLocationServiceImpl.java index e8f1d90..235beca 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigWarehouseLocationServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigWarehouseLocationServiceImpl.java @@ -2,9 +2,11 @@ package com.zt.plat.module.qms.business.config.service; import cn.hutool.core.collection.CollUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigPermissionSaveReqVO; import com.zt.plat.module.qms.business.config.controller.vo.ConfigWarehouseLocationPageReqVO; import com.zt.plat.module.qms.business.config.controller.vo.ConfigWarehouseLocationRespVO; import com.zt.plat.module.qms.business.config.controller.vo.ConfigWarehouseLocationSaveReqVO; +import com.zt.plat.module.qms.enums.QmsPermissionConstant; import com.zt.plat.module.qms.enums.QmsWarehouseLocationConstant; import org.springframework.stereotype.Service; import jakarta.annotation.Resource; @@ -19,7 +21,6 @@ import com.zt.plat.framework.common.util.object.BeanUtils; import com.zt.plat.module.qms.business.config.dal.mapper.ConfigWarehouseLocationMapper; 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.*; /** @@ -31,11 +32,30 @@ import static com.zt.plat.module.qms.enums.ErrorCodeConstants.*; @Validated public class ConfigWarehouseLocationServiceImpl implements ConfigWarehouseLocationService { - + @Resource private ConfigPermissionService configPermissionService; @Resource private ConfigWarehouseLocationMapper configWarehouseLocationMapper; + @Override + public ConfigWarehouseLocationRespVO save(ConfigWarehouseLocationSaveReqVO reqVo) { + Long id = reqVo.getId(); + //处理权限 + List primissionList = reqVo.getPermissionList(); + if(id == null){ + ConfigWarehouseLocationDO entity = BeanUtils.toBean(reqVo, ConfigWarehouseLocationDO.class); + configWarehouseLocationMapper.insert(entity); + id = entity.getId(); + reqVo.setId( id); + } + for(ConfigPermissionSaveReqVO permission : primissionList){ + permission.setSourceId( id); + permission.setSourceType(QmsPermissionConstant.SAMPLE_WAREHOUSE_ADMIN); + } + configPermissionService.savePermissionListWithAutoDelete(primissionList, id, QmsPermissionConstant.SAMPLE_WAREHOUSE_ADMIN, null); + return BeanUtils.toBean(reqVo, ConfigWarehouseLocationRespVO.class); + } + @Override public ConfigWarehouseLocationDO getLocationByCode(String code, String warehouseType) { LambdaQueryWrapper query = new LambdaQueryWrapper<>(); @@ -104,8 +124,12 @@ public class ConfigWarehouseLocationServiceImpl implements ConfigWarehouseLocati } @Override - public PageResult getConfigWarehouseLocationPage(ConfigWarehouseLocationPageReqVO pageReqVO) { + public PageResult getConfigWarehouseLocationPage(ConfigWarehouseLocationPageReqVO pageReqVO) { return configWarehouseLocationMapper.selectPage(pageReqVO); } + @Override + public List selectListWithPermission(ConfigWarehouseLocationPageReqVO pageReqVO) { + return configWarehouseLocationMapper.selectListWithPermission(pageReqVO); + } } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentMainRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentMainRespVO.java index ee8dc5d..6e681df 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentMainRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentMainRespVO.java @@ -72,6 +72,7 @@ public class ReportDocumentMainRespVO { @Schema(description = "审批状态,【字典】【jy_doc_main_status】待编制、审批中、已结束", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") @ExcelProperty("审批状态,【字典】【jy_doc_main_status】待编制、审批中、已结束") + @Dict(dicCode = "flow_status") private String flowStatus; @Schema(description = "作废标识:0-有效;1-作废") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentDataServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentDataServiceImpl.java index 40b2521..0eb4bcc 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentDataServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentDataServiceImpl.java @@ -21,8 +21,6 @@ import org.springframework.util.ObjectUtils; import org.springframework.validation.annotation.Validated; import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; import java.util.List; import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception; @@ -113,12 +111,14 @@ public class ReportDocumentDataServiceImpl implements ReportDocumentDataService return new ArrayList<>(); JSONObject jsonObject = JSONObject.parseObject(customConfig); Integer dynamicColCount = 3; - Integer fixedColCount = 3; + Integer fixedColCount = 0; Integer maxRowCount = 3; String dynamicColCountStr = jsonObject.getString("dynamicColCount"); //动态列(检测项)数量 - String fixedColCountStr = jsonObject.getString("fixedColCount"); //固定列(样品名称、样品编号等)数量 +// String fixedColCountStr = jsonObject.getString("fixedColCount"); //固定列(样品名称、样品编号等)数量 + JSONArray fixedCol = jsonObject.getJSONArray("fixedCol"); //固定列,举例:["sampleName", "sampleCode"] + JSONArray fixedColShow = jsonObject.getJSONArray("fixedColShow"); //固定列,举例:["产品名称", "编 号"] String maxRowCountStr = jsonObject.getString("maxRowCount"); //最大行数 - String nameCodeType = jsonObject.getString("nameCodeType"); //名称、编号处理方式:merge-合并, name-只显示名称, code-只显示编号, split-2列分开显示 +// String nameCodeType = jsonObject.getString("nameCodeType"); //名称、编号处理方式:merge-合并, name-只显示名称, code-只显示编号, split-2列分开显示 String hasRemark = jsonObject.getString("hasRemark"); //是否有备注 String hasRange = jsonObject.getString("hasRange"); //是否有检出限 String verticalFlag = jsonObject.getString("verticalFlag"); //vertical-纵表, 否则为横表 @@ -130,7 +130,7 @@ public class ReportDocumentDataServiceImpl implements ReportDocumentDataService return assembleFixedFieldsData(fieldList, dataList, customConfig); } if(!ObjectUtils.isEmpty(dynamicColCountStr)) dynamicColCount = Integer.parseInt(dynamicColCountStr); - if(!ObjectUtils.isEmpty(fixedColCountStr)) fixedColCount = Integer.parseInt(fixedColCountStr); + if(fixedCol != null) fixedColCount = fixedCol.size(); if(!ObjectUtils.isEmpty(maxRowCountStr)) maxRowCount = Integer.parseInt(maxRowCountStr); Integer eleCount = 0; //元素数量,即元素列总数 @@ -144,14 +144,14 @@ public class ReportDocumentDataServiceImpl implements ReportDocumentDataService Integer colCountOneSample = fixedColCount + dynamicColCount; //每个样品要占的列数 Integer dataLength = dataList.size(); Integer emptyRowCount = dataLength < maxRowCount ? 1 : 0; //空行数 - Integer allRowCount = 1 + dataLength + emptyRowCount + 1; //标题 + 样品数 + 空行 +// Integer allRowCount = 1 + dataLength + emptyRowCount + 1; //标题 + 样品数 + 空行 if("1".equals(hasRange)) emptyRowCount ++; - if(rowCountOneSample > 1){ - allRowCount = (1 + dataLength + emptyRowCount + 9) * rowCountOneSample + emptyRowCount; //(标题 + 样品数 + 空行) * 但样品行数 + 末尾行 - } +// if(rowCountOneSample > 1){ +// allRowCount = (1 + dataLength + emptyRowCount + 9) * rowCountOneSample + emptyRowCount; //(标题 + 样品数 + 空行) * 但样品行数 + 末尾行 +// } List rowList = new ArrayList<>(); for(int i = 0; i < maxRowCount; i++){ JSONObject row = new JSONObject(); @@ -193,7 +193,7 @@ public class ReportDocumentDataServiceImpl implements ReportDocumentDataService r.put(colPrefix + "01", "方法检出限"); lastObjFlag = true; if(colIndex % colCountOneSample == 0){ - addTitleToRowList(nameCodeType, rowAssist, t, dataLength, emptyRowCount, rowList, fieldList); + addTitleToRowList(fixedCol, rowAssist, t, dataLength, emptyRowCount, rowList, fieldList); if("1".equals(hasRange)) addRangeToRowList(rowAssist, r, dataLength, emptyRowCount, rowList); t = new JSONObject(); @@ -211,7 +211,7 @@ public class ReportDocumentDataServiceImpl implements ReportDocumentDataService colIndex++; } if(lastObjFlag){ - addTitleToRowList(nameCodeType, rowAssist, t, dataLength, emptyRowCount, rowList, fieldList); + addTitleToRowList(fixedCol, rowAssist, t, dataLength, emptyRowCount, rowList, fieldList); if("1".equals(hasRange)) addRangeToRowList(rowAssist, r, dataLength, emptyRowCount, rowList); } @@ -252,7 +252,7 @@ public class ReportDocumentDataServiceImpl implements ReportDocumentDataService t.put(colPrefix + colKey, fieldValue); lastObjFlag = true; if(colIndex % colCountOneSample == 0){ - addDataToRowList(nameCodeType, dataDO, rowAssist, t, dataLength, emptyRowCount, dataIndex, rowList, fieldList); + addFixedDataToRowList(fixedCol, dataDO, rowAssist, t, dataLength, emptyRowCount, dataIndex, rowList, fieldList); t = new JSONObject(); if("1".equals(hasRemark)){ t.put(colPrefix + parseNumToString(colCountOneSample + 1, 2), remark); @@ -265,7 +265,7 @@ public class ReportDocumentDataServiceImpl implements ReportDocumentDataService colIndex++; } if(lastObjFlag){ - addDataToRowList(nameCodeType, dataDO, rowAssist, t, dataLength, emptyRowCount, dataIndex, rowList, fieldList); + addFixedDataToRowList(fixedCol, dataDO, rowAssist, t, dataLength, emptyRowCount, dataIndex, rowList, fieldList); } dataIndex ++; } @@ -290,38 +290,43 @@ public class ReportDocumentDataServiceImpl implements ReportDocumentDataService } /** - * @param nameCodeType: merge-合并, name-只显示名称, code-只显示编号, split-2列分开显示 + * @param * * */ - private void addTitleToRowList(String nameCodeType, Integer rowAssist, JSONObject t, Integer dataLength, Integer emptyRowCount, - List rowList, List fieldList){ + private void addTitleToRowList(JSONArray fixedCol, Integer rowAssist, JSONObject t, Integer dataLength, Integer emptyRowCount, List rowList, List fieldList){ int rowIndex = (1 + dataLength + emptyRowCount) * (rowAssist - 1) + 1; //(标题 + 数据行 + 空行) //处理固定列 int index = 1; - String colKey = parseNumToString(index, 2); - if(name_code_merge.equals(nameCodeType)){ - t.put(colPrefix + colKey, "样品名称及编号"); - rowList.set(rowIndex, t.clone()); - return; - } - if(name_code_name.equals(nameCodeType)){ - t.put(colPrefix + colKey, "样品名称"); - rowList.set(rowIndex, t.clone()); - return; - } - if(name_code_code.equals(nameCodeType)){ - t.put(colPrefix + colKey, "样品编号"); - rowList.set(rowIndex, t.clone()); - return; - } - for(ConfigReportFieldDO fieldDO : fieldList){ - String fieldName = fieldDO.getFieldName(); - String fieldType = fieldDO.getFieldType(); - if(FIELD_DYNAMIC.equals(fieldType)) - continue; - colKey = parseNumToString(index, 2); - t.put(colPrefix + colKey, fieldName); - index++; + String colKey = ""; + for(int i=0;i rowList, List fieldList){ + /** + * 添加固定列的数据 + * */ + private void addFixedDataToRowList(JSONArray fixedCol, ReportDocumentDataDO dataDO, Integer rowAssist, JSONObject t, Integer dataLength, Integer emptyRowCount, Integer dataIndex, List rowList, List fieldList){ int rowIndex = (1 + dataLength + emptyRowCount) * (rowAssist - 1) + dataIndex + 1; //(标题 + 数据行 + 空行) t.put("id", dataDO.getId()); //处理固定列 int index = 1; //处理固定列 - String colKey = parseNumToString(index, 2); - if(name_code_merge.equals(nameCodeType)){ - String merge = dataDO.getSampleName() + " " + dataDO.getSampleCode(); - t.put(colPrefix + colKey, merge); - rowList.set(rowIndex, t.clone()); - return; - } - if(name_code_name.equals(nameCodeType)){ - t.put(colPrefix + colKey, dataDO.getSampleName()); - rowList.set(rowIndex, t.clone()); - return; - } - if(name_code_code.equals(nameCodeType)){ - t.put(colPrefix + colKey, dataDO.getSampleCode()); - rowList.set(rowIndex, t.clone()); - return; - } - for(ConfigReportFieldDO fieldDO : fieldList){ - String fieldName = fieldDO.getFieldName(); - String fieldType = fieldDO.getFieldType(); - String field = fieldDO.getField(); - if(FIELD_FIXED.equals(fieldType)){ + String colKey = ""; + if(fixedCol != null && !fixedCol.isEmpty()){ + for(int i=0;i submitAssayResult(@RequestBody AutoIngredientsTaskAssayResultReqVO body) { - System.out.println(com.alibaba.fastjson2.JSON.toJSONString(body)); +// System.out.println(com.alibaba.fastjson2.JSON.toJSONString(body)); autoIngredientsService.submitAssayResult(body); return CommonResult.success("成功"); } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/thirdpartyapi/service/AutoIngredientsServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/thirdpartyapi/service/AutoIngredientsServiceImpl.java index 26ebc1b..90c6d10 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/thirdpartyapi/service/AutoIngredientsServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/thirdpartyapi/service/AutoIngredientsServiceImpl.java @@ -6,27 +6,58 @@ import java.util.Arrays; import java.util.List; import java.util.stream.Collectors; +import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import com.alibaba.fastjson2.JSON; +import com.zt.plat.framework.common.exception.ServiceException; +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.framework.common.util.object.BeanUtils; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayParameterDataExtendRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayProjectDataExtendRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayTaskDataExtendRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayTaskDataReqVO; import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayTaskExtendRespVO; import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayTaskPageReqVO; -import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDetailDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayParameterDataDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayProjectDataDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDataDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleDO; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayParameterDataMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayProjectDataMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayTaskDataMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayTaskDetailMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayTaskMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubSampleMapper; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSampleMethodConfInfo; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSampleMethodConfItem; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSampleMethodConfPoint; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSubSampleMethodDO; +import com.zt.plat.module.qms.business.config.dal.mapper.ConfigSubSampleMethodMapper; import com.zt.plat.module.qms.enums.QmsCommonConstant; import com.zt.plat.module.qms.thirdpartyapi.controller.vo.AutoIngredientsTaskAssayResultReqVO; +import com.zt.plat.module.qms.thirdpartyapi.controller.vo.AutoIngredientsTaskDetailAssayResultReqVO; import com.zt.plat.module.qms.thirdpartyapi.controller.vo.AutoIngredientsTaskDetailRespVO; import com.zt.plat.module.qms.thirdpartyapi.controller.vo.AutoIngredientsTaskQueryReqVO; import com.zt.plat.module.qms.thirdpartyapi.controller.vo.AutoIngredientsTaskRespVO; +import com.zt.plat.module.system.api.user.AdminUserApi; +import com.zt.plat.module.system.api.user.dto.AdminUserRespDTO; +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.collection.CollUtil; import jakarta.annotation.Resource; @Service public class AutoIngredientsServiceImpl implements AutoIngredientsService { + @Resource + private AdminUserApi adminUserApi; + + @Resource + private BusinessSubSampleMapper businessSubSampleMapper; + @Resource private BusinessAssayTaskMapper businessAssayTaskMapper; @@ -36,6 +67,9 @@ public class AutoIngredientsServiceImpl implements AutoIngredientsService { @Resource private BusinessAssayTaskDataMapper businessAssayTaskDataMapper; + @Resource + private ConfigSubSampleMethodMapper configSubSampleMethodMapper; + @Resource private BusinessAssayProjectDataMapper businessAssayProjectDataMapper; @@ -52,28 +86,187 @@ public class AutoIngredientsServiceImpl implements AutoIngredientsService { search.setTaskAssignSubmitTime(taskAssignSubmiTimes); } List list = businessAssayTaskMapper.selectList(search); - List resultList = list.stream().map(m -> new AutoIngredientsTaskRespVO(m.getId(), m.getTaskNo(), m.getTaskAssignSubmitTime(), m.getAssayOperator(), m.getAssayOperator())).collect(Collectors.toList()); + List assayOperatorIdList = list.stream().filter(f -> f.getAssayOperatorId() != null).map(m -> m.getAssayOperatorId()).distinct().collect(Collectors.toList()); + CommonResult> userListResult = adminUserApi.getUserList(assayOperatorIdList); + if (userListResult.isError()) { + throw new ServiceException(userListResult.getCode(), userListResult.getMsg()); + } + List userList = userListResult.getData(); + List resultList = list.stream().map(m -> { + AdminUserRespDTO user = userList.stream().filter(f -> f.getId().equals(m.getAssayOperatorId())).findFirst().orElse(null); + return new AutoIngredientsTaskRespVO(m.getId(), m.getTaskNo(), m.getTaskAssignSubmitTime(), user.getUsername(), m.getAssayOperator()); + }).collect(Collectors.toList()); return resultList; } @Override public List taskDetailList(Long taskId) { -// List list = businessAssayTaskDetailMapper.selectByBusinessAssayTaskId(taskId); -// businessAssayTaskDataMapper.selectByBusinessAssayTaskId(taskId) - List resultList = new ArrayList<>(); -// for (BusinessAssayTaskDetailDO businessAssayTaskDetailDO : list) { -// AutoIngredientsTaskDetailRespVO autoIngredientsTaskDetailRespVO = new AutoIngredientsTaskDetailRespVO(); -// autoIngredientsTaskDetailRespVO.setAssayOperator(null) -// resultList.add(autoIngredientsTaskDetailRespVO); -// -// } + //查询任务分配信息 + BusinessAssayTaskDO businessAssayTaskDO = businessAssayTaskMapper.selectById(taskId); + //查询子样检测任务 + BusinessAssayTaskDataReqVO search = new BusinessAssayTaskDataReqVO(); + search.setBusinessAssayTaskId(taskId); + List list = businessAssayTaskDataMapper.selectList(search); + //分析人员id列表 + List assayOperatorIdList = list.stream().filter(f -> f.getAssayOperatorId() != null).map(m -> m.getAssayOperatorId()).distinct().collect(Collectors.toList()); + + //子样配置id列表 + List configSubSampleIdList = list.stream().map(m -> m.getConfigSubSampleId()).distinct().collect(Collectors.toList()); + + //子样配置方法 + List configSubSampleMethodList = configSubSampleMethodMapper.selectByConfigSubSampleIdsAndConfigAssayMethodId(configSubSampleIdList, businessAssayTaskDO.getConfigAssayMethodId()); + + //分析任务id列表 + List businessAssayTaskDataIdList = list.stream().map(m -> m.getId()).collect(Collectors.toList()); + + //查询检测项目 + List businessAssayProjectDataList = businessAssayProjectDataMapper.selectByBusinessAssayTaskDataIds(businessAssayTaskDataIdList); + List businessAssayProjectDataIdList = businessAssayProjectDataList.stream().map(m -> m.getId()).collect(Collectors.toList()); + //查询检测项目参数 + List businessAssayParameterDataList = businessAssayParameterDataMapper.selectExtendByBusinessAssayProjectDataIds(businessAssayProjectDataIdList); + + CommonResult> userListResult = adminUserApi.getUserList(assayOperatorIdList); + if (userListResult.isError()) { + throw new ServiceException(userListResult.getCode(), userListResult.getMsg()); + } + List userList = userListResult.getData(); + List resultList = list.stream().map(m -> { + //分析人员信息 + AdminUserRespDTO user = userList.stream().filter(f -> f.getId().equals(m.getAssayOperatorId())).findFirst().orElse(null); + //子样配置信息 + ConfigSubSampleMethodDO configSubSampleMethodDO = configSubSampleMethodList.stream().filter(f -> f.getConfigSubSampleId().equals(m.getConfigSubSampleId())).findFirst().orElse(null); + String configInfomation = configSubSampleMethodDO.getConfigInfomation(); + //当前检测项目列表 + List currentBusinessAssayProjectDataList = businessAssayProjectDataList.stream().filter(f -> f.getBusinessAssayTaskDataId().equals(m.getId())).collect(Collectors.toList()); + + AutoIngredientsTaskDetailRespVO autoIngredientsTaskDetailRespVO = new AutoIngredientsTaskDetailRespVO(); + autoIngredientsTaskDetailRespVO.setId(m.getId()); + autoIngredientsTaskDetailRespVO.setTaskId(m.getBusinessAssayTaskId()); + autoIngredientsTaskDetailRespVO.setSampleCode(m.getSampleAssayCode()); + autoIngredientsTaskDetailRespVO.setSampleName(m.getSampleName()); + + if (StringUtils.isNotBlank(configInfomation)) { + ConfigSubSampleMethodConfInfo configSubSampleMethodConfInfo = JSON.parseObject(configInfomation, ConfigSubSampleMethodConfInfo.class); + //获取下发配置 + List downIngredients = configSubSampleMethodConfInfo.getDownIngredients(); + for (ConfigSubSampleMethodConfItem configSubSampleMethodConfItem : downIngredients) { + if (configSubSampleMethodConfItem.getRequired()) { + ConfigSubSampleMethodConfPoint source = configSubSampleMethodConfItem.getSource(); + String project = source.getProject(); + String parameter = source.getParameter(); + BusinessAssayProjectDataExtendRespVO currentBusinessAssayProjectData = currentBusinessAssayProjectDataList.stream().filter(f -> f.getSimpleName().equals(project)).findFirst().orElse(null); + BusinessAssayParameterDataExtendRespVO currentBusinessAssayParameterData = businessAssayParameterDataList.stream().filter(f -> f.getBusinessAssayProjectDataId().equals(currentBusinessAssayProjectData.getId()) && f.getParameterKey().equals(parameter)).findFirst().orElse(null); + ConfigSubSampleMethodConfPoint target = configSubSampleMethodConfItem.getTarget(); + String field = target.getField(); + BeanUtil.setFieldValue(autoIngredientsTaskDetailRespVO, field, currentBusinessAssayParameterData.getValue()); + } + } + } + autoIngredientsTaskDetailRespVO.setAssayProject(m.getAssayProject()); + autoIngredientsTaskDetailRespVO.setAssayOperator(user.getUsername()); + autoIngredientsTaskDetailRespVO.setAssayOperatorName(m.getAssayOperator()); + autoIngredientsTaskDetailRespVO.setRemark(m.getRemark()); + + return autoIngredientsTaskDetailRespVO; + }).collect(Collectors.toList()); return resultList; } @Override + @Transactional(rollbackFor = Exception.class) public void submitAssayResult(AutoIngredientsTaskAssayResultReqVO body) { + List updateBusinessAssayTaskDataDOList = new ArrayList<>(); + List updateBusinessAssayProjectDataDOList = new ArrayList<>(); + List updateBusinessAssayParameterDataDOList = new ArrayList<>(); + + //任务id + Long taskId = body.getTaskId(); + //查询任务分配信息 + BusinessAssayTaskDO businessAssayTaskDO = businessAssayTaskMapper.selectById(taskId); + List sampleList = body.getSampleList(); + //获取检测任务id + List businessAssayTaskDataIdList = sampleList.stream().map(m -> m.getId()).collect(Collectors.toList()); + List businessAssayTaskDataDOList = businessAssayTaskDataMapper.selectByIds(businessAssayTaskDataIdList); + //获取子样id列表 + List businessSubSampleIdList = businessAssayTaskDataDOList.stream().map(m -> m.getBusinessSubSampleId()).distinct().collect(Collectors.toList()); + //获取子样 + List businessSubSampleDOList = businessSubSampleMapper.selectByIds(businessSubSampleIdList); + //子样配置id列表 + List configSubSampleIdList = businessSubSampleDOList.stream().map(m -> m.getConfigSubSampleId()).distinct().collect(Collectors.toList()); + //子样配置方法 + List configSubSampleMethodList = configSubSampleMethodMapper.selectByConfigSubSampleIdsAndConfigAssayMethodId(configSubSampleIdList, businessAssayTaskDO.getConfigAssayMethodId()); + + List businessAssayProjectDataList = businessAssayProjectDataMapper.selectByBusinessAssayTaskDataIds(businessAssayTaskDataIdList); + List businessAssayProjectDataIdList = businessAssayProjectDataList.stream().map(m -> m.getId()).collect(Collectors.toList()); + //查询检测项目参数 + List businessAssayParameterDataList = businessAssayParameterDataMapper.selectExtendByBusinessAssayProjectDataIds(businessAssayProjectDataIdList); + + for (AutoIngredientsTaskDetailAssayResultReqVO autoIngredientsTaskDetailAssayResultReqVO : sampleList) { + //获取子样检测任务 + BusinessAssayTaskDataDO businessAssayTaskDataDO = businessAssayTaskDataDOList.stream().filter(f -> f.getId().equals(autoIngredientsTaskDetailAssayResultReqVO.getId())).findFirst().orElse(null); + //获取子样 + BusinessSubSampleDO businessSubSampleDO = businessSubSampleDOList.stream().filter(f -> f.getId().equals(businessAssayTaskDataDO.getBusinessSubSampleId())).findFirst().orElse(null); + + //子样配置信息 + ConfigSubSampleMethodDO configSubSampleMethodDO = configSubSampleMethodList.stream().filter(f -> f.getConfigSubSampleId().equals(businessSubSampleDO.getConfigSubSampleId())).findFirst().orElse(null); + String configInfomation = configSubSampleMethodDO.getConfigInfomation(); + if (StringUtils.isNotBlank(configInfomation)) { + ConfigSubSampleMethodConfInfo configSubSampleMethodConfInfo = JSON.parseObject(configInfomation, ConfigSubSampleMethodConfInfo.class); + //获取上传配置 + List upIngredients = configSubSampleMethodConfInfo.getUpIngredients(); + for (ConfigSubSampleMethodConfItem configSubSampleMethodConfItem : upIngredients) { + if (configSubSampleMethodConfItem.getRequired()) { + ConfigSubSampleMethodConfPoint source = configSubSampleMethodConfItem.getSource(); + String field = source.getField(); +// System.out.println("field:" + field); +// Field field2 = ReflectUtil.getField(autoIngredientsTaskDetailAssayResultReqVO.getClass(), field); +// Map fieldMap = ReflectUtil.getFieldMap(autoIngredientsTaskDetailAssayResultReqVO.getClass()); +// Object fieldValue2 = ReflectUtil.getFieldValue(autoIngredientsTaskDetailAssayResultReqVO, fieldMap.get(field)); + Object fieldValue = BeanUtil.getFieldValue(autoIngredientsTaskDetailAssayResultReqVO, field); + if (fieldValue == null) { + fieldValue = ""; + } +// System.out.println("fieldValue:" + fieldValue); + + ConfigSubSampleMethodConfPoint target = configSubSampleMethodConfItem.getTarget(); + String project = target.getProject(); + + BusinessAssayProjectDataExtendRespVO currentBusinessAssayProjectData = businessAssayProjectDataList.stream().filter(f -> f.getBusinessAssayTaskDataId().equals(autoIngredientsTaskDetailAssayResultReqVO.getId()) && f.getSimpleName().equals(project)).findFirst().orElse(null); + String parameter = target.getParameter(); + if (StringUtils.isBlank(parameter)) { + currentBusinessAssayProjectData.setValue(fieldValue.toString()); + updateBusinessAssayProjectDataDOList.add(BeanUtils.toBean(currentBusinessAssayProjectData, BusinessAssayProjectDataDO.class)); + } else { + BusinessAssayParameterDataExtendRespVO currentBusinessAssayParameterData = businessAssayParameterDataList.stream().filter(f -> f.getBusinessAssayProjectDataId().equals(currentBusinessAssayProjectData.getId()) && f.getParameterKey().equals(parameter)).findFirst().orElse(null); + currentBusinessAssayParameterData.setValue(fieldValue.toString()); + updateBusinessAssayParameterDataDOList.add(BeanUtils.toBean(currentBusinessAssayParameterData, BusinessAssayParameterDataDO.class)); + } + + } + } + } + String remark = CollUtil.join(Arrays.asList(autoIngredientsTaskDetailAssayResultReqVO.getRemark()), "、"); + + businessAssayTaskDataDO.setRemark(remark); + updateBusinessAssayTaskDataDOList.add(businessAssayTaskDataDO); + } + + businessAssayTaskDO.setIngredientsStatus(QmsCommonConstant.ALLOW_SUBMIT); + + businessAssayTaskMapper.updateById(businessAssayTaskDO); + + if (CollUtil.isNotEmpty(updateBusinessAssayTaskDataDOList)) { + businessAssayTaskDataMapper.updateBatch(updateBusinessAssayTaskDataDOList); + } + if (CollUtil.isNotEmpty(updateBusinessAssayProjectDataDOList)) { + businessAssayProjectDataMapper.updateBatch(updateBusinessAssayProjectDataDOList); + } + if (CollUtil.isNotEmpty(updateBusinessAssayParameterDataDOList)) { + businessAssayParameterDataMapper.updateBatch(updateBusinessAssayParameterDataDOList); + } + } } diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayTaskDataMapper.xml b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayTaskDataMapper.xml index 9ca148d..7f0c5e0 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayTaskDataMapper.xml +++ b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayTaskDataMapper.xml @@ -88,6 +88,7 @@ LEFT JOIN T_CFG_ASY_MTHD tcam ON t.CFG_ASY_MTHD_ID = tcam.ID AND t.TENANT_ID = tcam.TENANT_ID + WHERE t.RPOD_STS in ('pending_report', 'pending_assessment', 're_inspected') GROUP BY t.CFG_ASY_MTHD_ID, t.ASY_TP, diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubParentSampleAssessmentProjectMapper.xml b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubParentSampleAssessmentProjectMapper.xml index 2433995..8ed7baa 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubParentSampleAssessmentProjectMapper.xml +++ b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubParentSampleAssessmentProjectMapper.xml @@ -11,29 +11,49 @@ + select + t.id as id, + t.PRN_ID as parentId, + t.NAME as name, + t.CD as code, + t.SRT_NO as sortNo, + t.CPY as capacity, + t.MAIN_DEPT_ID as mainDepartmentId, + t.MAIN_DEPT_NAME as mainDepartmentName, + t.DAT_TP as dataType, + t.WRH_TP as warehouseType, + t.SYS_DEPT_CD as systemDepartmentCode, + t.RMK as remark, + t.PRNT_TMPL as printTemplate + from T_CFG_WRH_LOC t + + + and t.DAT_TP = #{param.dataType} + + + and t.WRH_TP = #{param.warehouseType} + + + and ( + + exists( + select 1 + from T_CFG_PERM p + where t.ID = p.SRC_ID + and p.SRC_TP = #{param.srcPermissionType} + and p.TGT_ID in ( + + #{item} + + ) + and p.TGT_TP = 'role' + and p.DELETED = 0 + ) + or + + not exists( + select 1 from T_CFG_PERM p where t.ID = p.SRC_ID + and p.SRC_TP = #{param.srcPermissionType} + and p.DELETED = 0 + ) + ) + + and t.DELETED = 0 + + + order by t.SRT_NO asc + + \ No newline at end of file From 212a28059c438198681d909b1b9b698a79a51d9b Mon Sep 17 00:00:00 2001 From: FCL Date: Thu, 4 Dec 2025 10:39:19 +0800 Subject: [PATCH 02/11] =?UTF-8?q?feat:=E6=9B=B4=E6=96=B0tio=EF=BC=8C?= =?UTF-8?q?=E6=94=AF=E6=8C=81redis=E6=8C=87=E5=AE=9A=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- zt-module-qms/zt-module-qms-server/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zt-module-qms/zt-module-qms-server/pom.xml b/zt-module-qms/zt-module-qms-server/pom.xml index 798ba07..2e5c10c 100644 --- a/zt-module-qms/zt-module-qms-server/pom.xml +++ b/zt-module-qms/zt-module-qms-server/pom.xml @@ -17,7 +17,7 @@ QMS模块。 - 3.9.1.v20251013-RELEASE + 3.9.1.v20251204-RELEASE From 8c3a1bdff8fcf03d145d4aa686698038fbdcbb45 Mon Sep 17 00:00:00 2001 From: chenbowen Date: Tue, 23 Dec 2025 10:50:23 +0800 Subject: [PATCH 03/11] =?UTF-8?q?1.=20=E5=8D=87=E7=BA=A7=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index eff8e17..f2b9cd2 100644 --- a/pom.xml +++ b/pom.xml @@ -17,7 +17,7 @@ https://github.com/YunaiV/ruoyi-vue-pro - 3.0.45 + 3.0.46 17 ${java.version} From 8fa11eb44c55161b0c32b2dc37b02496f813abd0 Mon Sep 17 00:00:00 2001 From: FCL Date: Sun, 4 Jan 2026 16:53:52 +0800 Subject: [PATCH 04/11] =?UTF-8?q?feat:qms=E9=98=B6=E6=AE=B5=E6=80=A7?= =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../zt/plat/module/qms/api/task/QmsApi.java | 2 +- .../module/qms/enums/ErrorCodeConstants.java | 59 +- .../plat/module/qms/enums/QmsBpmConstant.java | 3 + .../module/qms/enums/QmsCommonConstant.java | 16 + zt-module-qms/zt-module-qms-server/pom.xml | 17 +- ...inessAssayTaskParameterDataController.java | 106 +++ .../BusinessQCCoefficientDataController.java | 16 +- .../BusinessQCManagementDataController.java | 14 +- ...nagementSampleParameterDataController.java | 106 +++ ...ssSampleEntrustRegistrationController.java | 3 + ...inessSubSampleParentRetestController.java} | 76 +- .../admin/SampleAnalysisAuditController.java | 13 +- .../admin/SampleAnalysisController.java | 7 +- .../admin/SampleEntrustController.java | 12 +- .../admin/SampleFlowController.java | 167 +--- .../SampleReportDataQueryController.java | 45 + .../SampleResultReportingController.java | 7 +- .../admin/SampleTaskAssignController.java | 32 +- .../bus/controller/admin/TestController.java | 155 ++++ .../vo/AssayMethodProjectRespVO.java | 28 + .../vo/BusinessAssayParameterDataReqVO.java | 3 + ...usinessAssayProjectAndParameterRespVO.java | 7 + .../BusinessAssayProjectDataExtendRespVO.java | 9 +- .../vo/BusinessAssayTaskDataExtendRespVO.java | 3 + .../vo/BusinessAssayTaskDataGroupRespVO.java | 7 + .../vo/BusinessAssayTaskDataPageReqVO.java | 11 +- .../vo/BusinessAssayTaskDataReqVO.java | 34 +- .../vo/BusinessAssayTaskDataRespVO.java | 10 +- .../vo/BusinessAssayTaskDataSaveReqVO.java | 8 +- .../vo/BusinessAssayTaskExtendRespVO.java | 7 + .../vo/BusinessAssayTaskPageReqVO.java | 13 +- ...sinessAssayTaskParameterDataPageReqVO.java | 44 + .../BusinessAssayTaskParameterDataRespVO.java | 55 ++ ...sinessAssayTaskParameterDataSaveReqVO.java | 43 + .../controller/vo/BusinessAssayTaskReqVO.java | 4 +- .../vo/BusinessAssayTaskRespVO.java | 10 +- .../vo/BusinessAssayTaskSaveReqVO.java | 4 +- .../BusinessHandoverRecordSubPageReqVO.java | 11 + ...BusinessQCCoefficientDataExtendRespVO.java | 16 + .../BusinessQCManagementDataExtendRespVO.java | 16 + ...anagementSampleParameterDataPageReqVO.java | 44 + ...QCManagementSampleParameterDataRespVO.java | 55 ++ ...anagementSampleParameterDataSaveReqVO.java | 43 + ...sinessSampleEntrustDetailExtendRespVO.java | 5 + ...essSampleEntrustRegistrationPageReqVO.java | 3 + ...sinessSampleEntrustRegistrationRespVO.java | 3 + ...SubParentSampleAssessmentExtendRespVO.java | 6 + ...ssSubParentSampleAssessmentGroupReqVO.java | 13 + ...sSubParentSampleAssessmentGroupRespVO.java | 6 + ...essSubParentSampleAssessmentPageReqVO.java | 3 + ...ntSampleAssessmentProjectExtendRespVO.java | 3 + ...arentSampleAssessmentProjectPageReqVO.java | 3 + ...sinessSubParentSampleAssessmentRespVO.java | 4 + ...essSubParentSampleAssessmentSaveReqVO.java | 3 + ...sinessSubSampleAnalysisGroupPageReqVO.java | 3 + .../BusinessSubSampleAnalysisGroupRespVO.java | 3 + ...sinessSubSampleAnalysisGroupSaveReqVO.java | 3 + .../BusinessSubSampleAssessmentPageReqVO.java | 5 +- ...ubSampleAssessmentProjectExtendRespVO.java | 3 + .../vo/BusinessSubSampleAssessmentRespVO.java | 7 +- .../BusinessSubSampleAssessmentSaveReqVO.java | 5 +- .../vo/BusinessSubSampleExtendRespVO.java | 3 + .../vo/BusinessSubSamplePageReqVO.java | 3 + ...sinessSubSampleParentRecheckPageReqVO.java | 50 -- ...usinessSubSampleParentRetestPageReqVO.java | 59 ++ ... BusinessSubSampleParentRetestRespVO.java} | 40 +- ...sinessSubSampleParentRetestSaveReqVO.java} | 38 +- .../vo/BusinessXRFDataPageReqVO.java | 3 + .../controller/vo/BusinessXRFDataReqVO.java | 3 + .../controller/vo/BusinessXRFDataRespVO.java | 3 + .../vo/BusinessXRFDataSaveReqVO.java | 3 + .../controller/vo/ChangeAssayMethodReqVO.java | 4 +- .../controller/vo/CreateQcSampleReqVO.java | 3 + .../controller/vo/DeleteQcSampleReqVO.java | 3 + .../vo/ModifySampleResultReportingReqVO.java | 2 +- ...ReportSubParentSampleAssessmentRespVO.java | 8 + .../vo/RecheckSubSampleParentCreateReqVO.java | 3 +- .../RecheckSubSampleParentMethodRespVO.java | 4 + .../bus/controller/vo/ReportedDataSource.java | 2 +- .../vo/UnAssignTaskedSubSampleRespVO.java | 12 + .../BusinessAssayParameterDataDO.java | 7 +- .../BusinessAssayProjectDataDO.java | 2 +- .../dataobject/BusinessAssayReportDataDO.java | 17 + .../dal/dataobject/BusinessAssayTaskDO.java | 4 +- .../dataobject/BusinessAssayTaskDataDO.java | 12 +- .../BusinessAssayTaskParameterDataDO.java | 75 ++ .../BusinessQCCoefficientParameterDataDO.java | 7 +- .../BusinessQCManagementParameterDataDO.java | 7 +- .../BusinessQCManagementProjectDataDO.java | 2 +- ...nessQCManagementSampleParameterDataDO.java | 75 ++ .../BusinessSubParentSampleAssessmentDO.java | 5 + ...essSubParentSampleAssessmentProjectDO.java | 2 +- .../BusinessSubSampleAnalysisGroupDO.java | 5 + .../BusinessSubSampleAssessmentDO.java | 7 +- ...a => BusinessSubSampleParentRetestDO.java} | 37 +- .../bus/dal/dataobject/BusinessXRFDataDO.java | 5 + .../BusinessAssayParameterDataMapper.java | 39 +- .../BusinessAssayProjectDataMapper.java | 33 +- .../mapper/BusinessAssayReportDataMapper.java | 5 + .../mapper/BusinessAssayTaskDataMapper.java | 324 +++++-- .../mapper/BusinessAssayTaskDetailMapper.java | 4 +- .../dal/mapper/BusinessAssayTaskMapper.java | 8 + .../BusinessAssayTaskParameterDataMapper.java | 64 ++ .../BusinessHandoverRecordSubMapper.java | 5 +- .../BusinessQCCoefficientDataMapper.java | 133 +-- ...inessQCCoefficientParameterDataMapper.java | 19 +- .../BusinessQCManagementDataMapper.java | 137 +-- ...sinessQCManagementParameterDataMapper.java | 18 +- ...BusinessQCManagementProjectDataMapper.java | 5 +- ...QCManagementSampleParameterDataMapper.java | 64 ++ .../BusinessSampleEntrustDetailMapper.java | 38 + ...sinessSubParentSampleAssessmentMapper.java | 27 +- ...ubParentSampleAssessmentProjectMapper.java | 21 +- .../mapper/BusinessSubParentSampleMapper.java | 13 + .../BusinessSubSampleAnalysisGroupMapper.java | 7 + .../BusinessSubSampleAssessmentMapper.java | 18 +- ...inessSubSampleAssessmentProjectMapper.java | 24 +- .../dal/mapper/BusinessSubSampleMapper.java | 4 +- .../BusinessSubSampleParentRecheckMapper.java | 42 - .../BusinessSubSampleParentRetestMapper.java | 45 + .../bus/dal/mapper/BusinessXRFDataMapper.java | 2 + .../SampleEntrustGenSampleDataCmp.java | 734 ++++++++++------ .../sample/flow/SampleSimpleEncryptCmp.java | 1 + .../flow/SampleSubProcessUpdateCmp.java | 25 +- .../SampleTaskAssignDataSaveOrUpdateCmp.java | 33 + .../SampleTaskAssignQCSampleCmp.java | 241 +++++- .../slot/SampleTaskAssignContext.java | 16 + .../BusinessAssayTaskDataServiceImpl.java | 2 +- ...BusinessAssayTaskParameterDataService.java | 61 ++ ...nessAssayTaskParameterDataServiceImpl.java | 91 ++ .../BusinessQCCoefficientDataService.java | 4 +- .../BusinessQCCoefficientDataServiceImpl.java | 4 +- .../BusinessQCManagementDataService.java | 4 +- .../BusinessQCManagementDataServiceImpl.java | 4 +- ...CManagementSampleParameterDataService.java | 62 ++ ...agementSampleParameterDataServiceImpl.java | 91 ++ ...inessSampleEntrustRegistrationService.java | 4 + ...sSampleEntrustRegistrationServiceImpl.java | 5 + ...BusinessSubSampleParentRecheckService.java | 62 -- ...nessSubSampleParentRecheckServiceImpl.java | 91 -- .../BusinessSubSampleParentRetestService.java | 62 ++ ...inessSubSampleParentRetestServiceImpl.java | 91 ++ .../service/BusinessSubSampleServiceImpl.java | 8 +- .../service/SampleAnalysisAuditService.java | 12 +- .../SampleAnalysisAuditServiceImpl.java | 458 +++++++--- .../bus/service/SampleAnalysisService.java | 8 - .../service/SampleAnalysisServiceImpl.java | 508 +++++++++-- .../bus/service/SampleEntrustServiceImpl.java | 27 +- .../service/SampleResultReportingService.java | 2 +- .../SampleResultReportingServiceImpl.java | 417 ++++++--- .../bus/service/SampleTaskAssignService.java | 23 +- .../service/SampleTaskAssignServiceImpl.java | 678 +++++++++++---- .../admin/BaseSampleController.java | 7 + .../ConfigAssayMethodParameterController.java | 106 +++ ...nfigEntrustSourceSampleTypeController.java | 106 +++ .../admin/ConfigReportTemplateController.java | 526 +----------- .../ConfigSubSampleMethodController.java | 18 +- .../admin/GridReportController.java | 556 ++++++++++++ .../controller/vo/BaseSamplePageReqVO.java | 5 + .../vo/ConfigAssayMethodPageReqVO.java | 6 + .../ConfigAssayMethodParameterPageReqVO.java | 71 ++ .../vo/ConfigAssayMethodParameterRespVO.java | 91 ++ .../ConfigAssayMethodParameterSaveReqVO.java | 74 ++ .../ConfigAssayMethodProjectExtendRespVO.java | 6 + ...gAssayMethodProjectParameterPageReqVO.java | 21 + ...nfigAssayMethodProjectParameterRespVO.java | 21 + ...gAssayMethodProjectParameterSaveReqVO.java | 21 + .../controller/vo/ConfigAssayMethodReqVO.java | 6 + .../vo/ConfigAssayMethodRespVO.java | 7 + .../vo/ConfigAssayMethodSaveReqVO.java | 6 + ...onfigEntrustSourceSampleTypePageReqVO.java | 35 + .../ConfigEntrustSourceSampleTypeRespVO.java | 43 + ...onfigEntrustSourceSampleTypeSaveReqVO.java | 32 + .../vo/ConfigQCSampleMethodExtendRespVO.java | 6 + .../vo/ConfigQCSampleMethodPageReqVO.java | 3 + ...igQCSampleMethodParameterExtendRespVO.java | 15 - ...onfigQCSampleMethodParameterPageReqVO.java | 21 + .../ConfigQCSampleMethodParameterRespVO.java | 21 + ...onfigQCSampleMethodParameterSaveReqVO.java | 21 + .../vo/ConfigQCSampleMethodRespVO.java | 4 + .../vo/ConfigQCSampleMethodSaveReqVO.java | 3 + .../vo/ConfigSubSampleMethodConfAdd.java | 19 + .../vo/ConfigSubSampleMethodConfInfo.java | 3 + .../vo/ConfigSubSampleMethodExtendRespVO.java | 18 + .../vo/ConfigSubSampleMethodPageReqVO.java | 9 +- .../vo/ConfigSubSampleMethodRespVO.java | 11 +- .../vo/ConfigSubSampleMethodSaveReqVO.java | 11 +- .../ConfigSubSampleParentMethodPageReqVO.java | 3 + .../vo/ConfigSubSampleParentMethodRespVO.java | 3 + .../ConfigSubSampleParentMethodSaveReqVO.java | 3 + ...terialAssayStandardMethodExtendRespVO.java | 17 + .../config/dal/dataobject/BaseSampleDO.java | 7 +- .../dal/dataobject/ConfigAssayMethodDO.java | 10 + .../ConfigAssayMethodParameterDO.java | 120 +++ .../ConfigAssayMethodProjectParameterDO.java | 35 + .../ConfigEntrustSourceSampleTypeDO.java | 60 ++ .../dataobject/ConfigQCSampleMethodDO.java | 5 + .../ConfigQCSampleMethodParameterDO.java | 35 + .../dataobject/ConfigSubSampleMethodDO.java | 13 +- .../ConfigSubSampleParentMethodDO.java | 5 + .../config/dal/mapper/BaseSampleMapper.java | 32 +- .../dal/mapper/ConfigAssayMethodMapper.java | 7 +- .../ConfigAssayMethodParameterMapper.java | 53 ++ .../ConfigAssayMethodProjectMapper.java | 25 +- ...nfigAssayMethodProjectParameterMapper.java | 7 + .../dal/mapper/ConfigBaseSampleMapper.java | 8 + .../ConfigEntrustSourceSampleTypeMapper.java | 31 + .../mapper/ConfigQCSampleMethodMapper.java | 11 +- .../ConfigQCSampleMethodParameterMapper.java | 22 +- .../dal/mapper/ConfigSampleReportMapper.java | 5 + .../dal/mapper/ConfigSubSampleMapper.java | 8 + .../mapper/ConfigSubSampleMethodMapper.java | 57 +- .../mapper/ConfigSubSampleParentMapper.java | 8 + .../ConfigSubSampleParentMethodMapper.java | 1 + .../MaterialAssayStandardMethodMapper.java | 19 + .../config/service/BaseSampleService.java | 7 + .../config/service/BaseSampleServiceImpl.java | 5 + .../ConfigAssayMethodParameterService.java | 62 ++ ...ConfigAssayMethodParameterServiceImpl.java | 91 ++ .../ConfigEntrustSourceSampleTypeService.java | 61 ++ ...figEntrustSourceSampleTypeServiceImpl.java | 91 ++ .../service/ConfigSubSampleMethodService.java | 18 +- .../ConfigSubSampleMethodServiceImpl.java | 2 +- .../ConfigWarehouseLocationService.java | 4 + .../ConfigWarehouseLocationServiceImpl.java | 60 +- .../business/reportdoc/async/AsyncConfig.java | 23 + .../admin/ReportDocumentDataController.java | 9 +- .../admin/ReportDocumentFileController.java | 148 ++++ .../admin/ReportDocumentMainController.java | 129 ++- .../vo/ReportDocumentDataPageReqVO.java | 12 + .../vo/ReportDocumentDataRespVO.java | 16 + .../vo/ReportDocumentDataSaveReqVO.java | 12 + .../vo/ReportDocumentFilePageReqVO.java | 46 + .../vo/ReportDocumentFileRespVO.java | 58 ++ .../vo/ReportDocumentFileSaveReqVO.java | 40 + .../vo/ReportDocumentMainPageReqVO.java | 6 + .../vo/ReportDocumentMainRespVO.java | 7 + .../vo/ReportDocumentMainSaveReqVO.java | 5 + .../dal/dataobject/ReportDocumentDataDO.java | 18 + .../dal/dataobject/ReportDocumentFileDO.java | 77 ++ .../dal/dataobject/ReportDocumentMainDO.java | 8 + .../dal/mapper/ReportDocumentFileMapper.java | 50 ++ .../service/ReportDocumentAssistService.java | 164 ++++ .../service/ReportDocumentDataService.java | 4 +- .../ReportDocumentDataServiceImpl.java | 788 ++++++++++++------ .../service/ReportDocumentFileService.java | 67 ++ .../ReportDocumentFileServiceImpl.java | 104 +++ .../ReportDocumentMainCorrelationService.java | 2 + ...ortDocumentMainCorrelationServiceImpl.java | 5 + .../service/ReportDocumentMainService.java | 7 +- .../ReportDocumentMainServiceImpl.java | 161 +++- .../admin/DataKeyCheckController.java | 79 ++ .../controller/vo/DataKeyCheckPageReqVO.java | 28 + .../controller/vo/DataKeyCheckRespVO.java | 34 + .../controller/vo/DataKeyCheckSaveReqVO.java | 22 + .../data/dal/dataobject/DataKeyCheckDO.java | 47 ++ .../data/dal/mapper/DataKeyCheckMapper.java | 27 + .../data/service/DataKeyCheckService.java | 66 ++ .../data/service/DataKeyCheckServiceImpl.java | 83 ++ .../admin/DictionaryBusinessController.java | 4 +- .../vo/DictionaryBusinessExtendRespVO.java | 11 + .../dal/mapper/DictionaryBusinessMapper.java | 11 + .../module/qms/core/code/CodeGenUtil.java | 2 +- .../qms/core/code/SampleEncryptUtil.java | 2 +- .../AbstractQueryBlackListHandler.java | 2 +- .../cmp/AllowanceCalculatorComponent.java | 13 +- .../config/QlExpressRuleEngineConfig.java | 13 +- .../function/RoundToScaleHalfEven.java | 16 +- .../rpc/config/RpcConfiguration.java | 3 +- .../module/qms/iot/mapper/IotHelloMapper.java | 2 +- .../qms/iot/service/IIotHelloService.java | 2 +- .../iot/service/impl/IotHelloServiceImpl.java | 2 +- .../module/qms/iot/tcpserver/IotUtils.java | 2 +- .../device/RedisSessionComponent.java | 2 +- .../handler/IotDeviceBalanceHandler.java | 7 +- .../com/zt/plat/module/qms/office/deleteme | 0 .../controller/admin/SupplierController.java | 119 +++ .../admin/SupplierEvaluationAtController.java | 118 +++ .../admin/SupplierEvaluationController.java | 118 +++ .../admin/SupplierPropertiesController.java | 118 +++ .../vo/SupplierEvaluationAtPageReqVO.java | 34 + .../vo/SupplierEvaluationAtRespVO.java | 42 + .../vo/SupplierEvaluationAtSaveReqVO.java | 32 + .../vo/SupplierEvaluationPageReqVO.java | 53 ++ .../vo/SupplierEvaluationRespVO.java | 66 ++ .../vo/SupplierEvaluationSaveReqVO.java | 48 ++ .../controller/vo/SupplierPageReqVO.java | 49 ++ .../vo/SupplierPropertiesPageReqVO.java | 50 ++ .../vo/SupplierPropertiesRespVO.java | 59 ++ .../vo/SupplierPropertiesSaveReqVO.java | 43 + .../controller/vo/SupplierRespVO.java | 62 ++ .../controller/vo/SupplierSaveReqVO.java | 43 + .../supplier/dal/dataobject/SupplierDO.java | 81 ++ .../dataobject/SupplierEvaluationAtDO.java | 57 ++ .../dal/dataobject/SupplierEvaluationDO.java | 90 ++ .../dal/dataobject/SupplierPropertiesDO.java | 81 ++ .../mapper/SupplierEvaluationAtMapper.java | 29 + .../dal/mapper/SupplierEvaluationMapper.java | 35 + .../supplier/dal/mapper/SupplierMapper.java | 33 + .../dal/mapper/SupplierPropertiesMapper.java | 33 + .../service/SupplierEvaluationAtService.java | 64 ++ .../SupplierEvaluationAtServiceImpl.java | 92 ++ .../service/SupplierEvaluationService.java | 64 ++ .../SupplierEvaluationServiceImpl.java | 92 ++ .../service/SupplierPropertiesService.java | 64 ++ .../SupplierPropertiesServiceImpl.java | 92 ++ .../supplier/service/SupplierService.java | 64 ++ .../supplier/service/SupplierServiceImpl.java | 92 ++ .../clientManage/VersionManagementConst.java | 8 + .../admin/VersionManagementController.java | 142 ++++ .../controller/vo/UploadFileVo.java | 23 + .../vo/VersionManagementPageReqVO.java | 46 + .../vo/VersionManagementRespVO.java | 96 +++ .../vo/VersionManagementSaveReqVO.java | 74 ++ .../dal/dataobject/VersionManagementDO.java | 117 +++ .../dal/mapper/VersionManagementMapper.java | 46 + .../service/VersionManagementService.java | 78 ++ .../service/VersionManagementServiceImpl.java | 151 ++++ .../resource/device/common/DeviceUtil.java | 140 ++++ ...DeviceAffiliationRelativityController.java | 118 +++ .../admin/DeviceApplyController.java | 119 +++ .../admin/DeviceApplyDetailController.java | 118 +++ .../admin/DeviceCalibrationController.java | 118 +++ .../DeviceCalibrationPlanController.java | 118 +++ .../DeviceConfigBusinessItemController.java | 118 +++ .../DeviceConfigBusinessRuleController.java | 131 +++ .../admin/DeviceConfigFlowController.java | 116 +++ .../admin/DeviceInfomationController.java | 20 +- .../admin/DeviceMaintainController.java | 165 ++++ .../admin/DeviceMaintainItemController.java | 118 +++ .../admin/DevicePeriodCheckController.java | 118 +++ .../DevicePeriodCheckPlanController.java | 118 +++ .../admin/DeviceRepairApplyController.java | 118 +++ .../admin/DeviceRepairDetailController.java | 118 +++ .../DeviceRepairResultDetailController.java | 118 +++ .../admin/DeviceUseRecordController.java | 154 ++++ .../DeviceAffiliationRelativityPageReqVO.java | 35 + .../vo/DeviceAffiliationRelativityRespVO.java | 43 + .../DeviceAffiliationRelativitySaveReqVO.java | 30 + .../vo/DeviceApplyDetailPageReqVO.java | 38 + .../vo/DeviceApplyDetailRespVO.java | 47 ++ .../vo/DeviceApplyDetailSaveReqVO.java | 33 + .../controller/vo/DeviceApplyPageReqVO.java | 90 ++ .../controller/vo/DeviceApplyRespVO.java | 114 +++ .../controller/vo/DeviceApplySaveReqVO.java | 84 ++ .../vo/DeviceCalibrationPageReqVO.java | 87 ++ .../vo/DeviceCalibrationPlanPageReqVO.java | 56 ++ .../vo/DeviceCalibrationPlanRespVO.java | 71 ++ .../vo/DeviceCalibrationPlanSaveReqVO.java | 51 ++ .../vo/DeviceCalibrationRespVO.java | 107 +++ .../vo/DeviceCalibrationSaveReqVO.java | 80 ++ .../vo/DeviceConfigBusinessItemPageReqVO.java | 56 ++ .../vo/DeviceConfigBusinessItemRespVO.java | 71 ++ .../vo/DeviceConfigBusinessItemSaveReqVO.java | 51 ++ .../vo/DeviceConfigBusinessRulePageReqVO.java | 64 ++ .../vo/DeviceConfigBusinessRuleRespVO.java | 82 ++ .../vo/DeviceConfigBusinessRuleSaveReqVO.java | 58 ++ .../vo/DeviceConfigFlowPageReqVO.java | 49 ++ .../controller/vo/DeviceConfigFlowRespVO.java | 60 ++ .../vo/DeviceConfigFlowSaveReqVO.java | 43 + .../vo/DeviceInfomationPageReqVO.java | 2 +- .../controller/vo/DeviceInfomationRespVO.java | 2 +- .../vo/DeviceInfomationSaveReqVO.java | 7 +- .../vo/DeviceMaintainItemPageReqVO.java | 83 ++ .../vo/DeviceMaintainItemRespVO.java | 106 +++ .../vo/DeviceMaintainItemSaveReqVO.java | 78 ++ .../vo/DeviceMaintainPageReqVO.java | 85 ++ .../controller/vo/DeviceMaintainRespVO.java | 88 ++ .../vo/DeviceMaintainSaveReqVO.java | 62 ++ .../controller/vo/DeviceMaintainVO.java | 84 ++ .../vo/DevicePeriodCheckPageReqVO.java | 88 ++ .../vo/DevicePeriodCheckPlanPageReqVO.java | 56 ++ .../vo/DevicePeriodCheckPlanRespVO.java | 71 ++ .../vo/DevicePeriodCheckPlanSaveReqVO.java | 51 ++ .../vo/DevicePeriodCheckRespVO.java | 111 +++ .../vo/DevicePeriodCheckSaveReqVO.java | 83 ++ .../vo/DeviceRepairApplyPageReqVO.java | 69 ++ .../vo/DeviceRepairApplyRespVO.java | 87 ++ .../vo/DeviceRepairApplySaveReqVO.java | 65 ++ .../vo/DeviceRepairAtPageReqVO.java | 32 + .../controller/vo/DeviceRepairAtRespVO.java | 39 + .../vo/DeviceRepairAtSaveReqVO.java | 29 + .../vo/DeviceRepairDetailPageReqVO.java | 32 + .../vo/DeviceRepairDetailRespVO.java | 39 + .../vo/DeviceRepairDetailSaveReqVO.java | 27 + .../vo/DeviceRepairResultDetailPageReqVO.java | 29 + .../vo/DeviceRepairResultDetailRespVO.java | 35 + .../vo/DeviceRepairResultDetailSaveReqVO.java | 24 + .../vo/DeviceUseRecordPageReqVO.java | 84 ++ .../controller/vo/DeviceUseRecordRespVO.java | 79 ++ .../vo/DeviceUseRecordSaveReqVO.java | 59 ++ .../controller/vo/DeviceUseRecordVO.java | 79 ++ .../DeviceAffiliationRelativityDO.java | 57 ++ .../device/dal/dataobject/DeviceApplyDO.java | 150 ++++ .../dal/dataobject/DeviceApplyDetailDO.java | 62 ++ .../dal/dataobject/DeviceCalibrationDO.java | 140 ++++ .../dataobject/DeviceCalibrationPlanDO.java | 92 ++ .../DeviceConfigBusinessItemDO.java | 92 ++ .../DeviceConfigBusinessRuleDO.java | 107 +++ .../dal/dataobject/DeviceConfigFlowDO.java | 82 ++ .../dataobject/DeviceInfoWithBizConfigVO.java | 48 ++ .../dal/dataobject/DeviceInfomationDO.java | 5 +- .../dal/dataobject/DeviceMaintainDO.java | 110 +++ .../dal/dataobject/DeviceMaintainItemDO.java | 140 ++++ .../dal/dataobject/DevicePeriodCheckDO.java | 145 ++++ .../dataobject/DevicePeriodCheckPlanDO.java | 92 ++ .../dal/dataobject/DeviceRepairApplyDO.java | 115 +++ .../dal/dataobject/DeviceRepairAtDO.java | 52 ++ .../dal/dataobject/DeviceRepairDetailDO.java | 52 ++ .../DeviceRepairResultDetailDO.java | 47 ++ .../dal/dataobject/DeviceUseRecordDO.java | 105 +++ .../DeviceAffiliationRelativityMapper.java | 29 + .../dal/mapper/DeviceApplyDetailMapper.java | 30 + .../device/dal/mapper/DeviceApplyMapper.java | 45 + .../dal/mapper/DeviceCalibrationMapper.java | 45 + .../mapper/DeviceCalibrationPlanMapper.java | 36 + .../DeviceConfigBusinessItemMapper.java | 36 + .../DeviceConfigBusinessRuleMapper.java | 39 + .../dal/mapper/DeviceConfigFlowMapper.java | 49 ++ .../dal/mapper/DeviceInfomationMapper.java | 10 +- .../dal/mapper/DeviceMaintainItemMapper.java | 45 + .../dal/mapper/DeviceMaintainMapper.java | 46 + .../dal/mapper/DevicePeriodCheckMapper.java | 46 + .../mapper/DevicePeriodCheckPlanMapper.java | 36 + .../dal/mapper/DeviceRepairApplyMapper.java | 40 + .../dal/mapper/DeviceRepairAtMapper.java | 28 + .../dal/mapper/DeviceRepairDetailMapper.java | 28 + .../DeviceRepairResultDetailMapper.java | 27 + .../dal/mapper/DeviceUseRecordMapper.java | 46 + .../DeviceAffiliationRelativityService.java | 64 ++ ...eviceAffiliationRelativityServiceImpl.java | 92 ++ .../service/DeviceApplyDetailService.java | 64 ++ .../service/DeviceApplyDetailServiceImpl.java | 92 ++ .../device/service/DeviceApplyService.java | 64 ++ .../service/DeviceApplyServiceImpl.java | 92 ++ .../service/DeviceCalibrationPlanService.java | 64 ++ .../DeviceCalibrationPlanServiceImpl.java | 92 ++ .../service/DeviceCalibrationService.java | 64 ++ .../service/DeviceCalibrationServiceImpl.java | 92 ++ .../DeviceConfigBusinessItemService.java | 67 ++ .../DeviceConfigBusinessItemServiceImpl.java | 105 +++ .../DeviceConfigBusinessRuleService.java | 71 ++ .../DeviceConfigBusinessRuleServiceImpl.java | 151 ++++ .../service/DeviceConfigFlowService.java | 66 ++ .../service/DeviceConfigFlowServiceImpl.java | 97 +++ .../service/DeviceInfomationService.java | 37 + .../service/DeviceInfomationServiceImpl.java | 195 ++++- .../service/DeviceMaintainItemService.java | 72 ++ .../DeviceMaintainItemServiceImpl.java | 147 ++++ .../device/service/DeviceMaintainService.java | 81 ++ .../service/DeviceMaintainServiceImpl.java | 231 +++++ .../service/DevicePeriodCheckPlanService.java | 64 ++ .../DevicePeriodCheckPlanServiceImpl.java | 92 ++ .../service/DevicePeriodCheckService.java | 64 ++ .../service/DevicePeriodCheckServiceImpl.java | 92 ++ .../device/service/DeviceProductService.java | 1 + .../service/DeviceProductServiceImpl.java | 7 + .../service/DeviceRepairApplyService.java | 64 ++ .../service/DeviceRepairApplyServiceImpl.java | 92 ++ .../device/service/DeviceRepairAtService.java | 64 ++ .../service/DeviceRepairAtServiceImpl.java | 75 ++ .../service/DeviceRepairDetailService.java | 64 ++ .../DeviceRepairDetailServiceImpl.java | 92 ++ .../DeviceRepairResultDetailService.java | 64 ++ .../DeviceRepairResultDetailServiceImpl.java | 92 ++ .../service/DeviceUseRecordService.java | 66 ++ .../service/DeviceUseRecordServiceImpl.java | 135 +++ .../admin/MaterialBatchAssignController.java | 135 +++ .../admin/MaterialBatchController.java | 126 +++ ...MaterialInventoryCheckBatchController.java | 118 +++ .../MaterialInventoryCheckController.java | 135 +++ ...aterialInventoryCheckDetailController.java | 118 +++ .../admin/MaterialInventoryController.java | 151 ++++ .../MaterialInventoryInboundController.java | 132 +++ ...erialInventoryInboundDetailController.java | 124 +++ .../MaterialInventoryOutboundController.java | 126 +++ ...rialInventoryOutboundDetailController.java | 118 +++ .../admin/MaterialLifecycleController.java | 118 +++ .../MaterialLifecycleDetailController.java | 118 +++ .../admin/MaterialLocationController.java | 118 +++ .../vo/MaterialBatchAssignPageReqVO.java | 43 + .../vo/MaterialBatchAssignRespVO.java | 50 ++ .../vo/MaterialBatchAssignSaveReqVO.java | 34 + .../controller/vo/MaterialBatchPageReqVO.java | 51 ++ .../controller/vo/MaterialBatchRespVO.java | 62 ++ .../controller/vo/MaterialBatchSaveReqVO.java | 45 + .../vo/MaterialInfomationPageReqVO.java | 3 + .../MaterialInventoryCheckBatchPageReqVO.java | 44 + .../vo/MaterialInventoryCheckBatchRespVO.java | 55 ++ .../MaterialInventoryCheckBatchSaveReqVO.java | 42 + ...MaterialInventoryCheckDetailPageReqVO.java | 43 + .../MaterialInventoryCheckDetailRespVO.java | 54 ++ ...MaterialInventoryCheckDetailSaveReqVO.java | 37 + .../vo/MaterialInventoryCheckPageReqVO.java | 59 ++ .../vo/MaterialInventoryCheckRespVO.java | 74 ++ .../vo/MaterialInventoryCheckSaveReqVO.java | 56 ++ ...terialInventoryInboundDetailPageReqVO.java | 56 ++ .../MaterialInventoryInboundDetailRespVO.java | 68 ++ ...terialInventoryInboundDetailSaveReqVO.java | 64 ++ .../vo/MaterialInventoryInboundPageReqVO.java | 59 ++ .../vo/MaterialInventoryInboundRespVO.java | 74 ++ .../vo/MaterialInventoryInboundSaveReqVO.java | 59 ++ ...erialInventoryOutboundDetailPageReqVO.java | 34 + ...MaterialInventoryOutboundDetailRespVO.java | 42 + ...erialInventoryOutboundDetailSaveReqVO.java | 28 + .../MaterialInventoryOutboundPageReqVO.java | 65 ++ .../vo/MaterialInventoryOutboundRespVO.java | 87 ++ .../MaterialInventoryOutboundSaveReqVO.java | 64 ++ .../vo/MaterialInventoryPageReqVO.java | 102 +++ .../vo/MaterialInventoryRespVO.java | 143 ++++ .../vo/MaterialLifecycleDetailPageReqVO.java | 52 ++ .../vo/MaterialLifecycleDetailRespVO.java | 74 ++ .../vo/MaterialLifecycleDetailSaveReqVO.java | 49 ++ .../vo/MaterialLifecyclePageReqVO.java | 59 ++ .../vo/MaterialLifecycleRespVO.java | 74 ++ .../vo/MaterialLifecycleSaveReqVO.java | 54 ++ .../vo/MaterialLocationPageReqVO.java | 40 + .../controller/vo/MaterialLocationRespVO.java | 50 ++ .../vo/MaterialLocationSaveReqVO.java | 34 + .../dal/dataobject/MaterialBatchAssignDO.java | 69 ++ .../dal/dataobject/MaterialBatchDO.java | 85 ++ .../dal/dataobject/MaterialInfomationDO.java | 5 + .../MaterialInventoryCheckBatchDO.java | 72 ++ .../dataobject/MaterialInventoryCheckDO.java | 95 +++ .../MaterialInventoryCheckDetailDO.java | 72 ++ .../dal/dataobject/MaterialInventoryDO.java | 169 ++++ .../MaterialInventoryInboundDO.java | 100 +++ .../MaterialInventoryInboundDetailDO.java | 90 ++ .../MaterialInventoryOutboundDO.java | 110 +++ .../MaterialInventoryOutboundDetailDO.java | 57 ++ .../dal/dataobject/MaterialLifecycleDO.java | 100 +++ .../dataobject/MaterialLifecycleDetailDO.java | 82 ++ .../dal/dataobject/MaterialLocationDO.java | 67 ++ .../dal/mapper/MaterialBatchAssignMapper.java | 37 + .../dal/mapper/MaterialBatchMapper.java | 34 + .../dal/mapper/MaterialInfomationMapper.java | 11 + .../MaterialInventoryCheckBatchMapper.java | 32 + .../MaterialInventoryCheckDetailMapper.java | 32 + .../mapper/MaterialInventoryCheckMapper.java | 36 + .../MaterialInventoryInboundDetailMapper.java | 53 ++ .../MaterialInventoryInboundMapper.java | 37 + .../dal/mapper/MaterialInventoryMapper.java | 34 + ...MaterialInventoryOutboundDetailMapper.java | 29 + .../MaterialInventoryOutboundMapper.java | 39 + .../mapper/MaterialLifecycleDetailMapper.java | 35 + .../dal/mapper/MaterialLifecycleMapper.java | 37 + .../dal/mapper/MaterialLocationMapper.java | 31 + .../service/MaterialBatchAssignService.java | 80 ++ .../MaterialBatchAssignServiceImpl.java | 134 +++ .../service/MaterialBatchService.java | 64 ++ .../service/MaterialBatchServiceImpl.java | 92 ++ .../MaterialInventoryCheckBatchService.java | 65 ++ ...aterialInventoryCheckBatchServiceImpl.java | 92 ++ .../MaterialInventoryCheckDetailService.java | 64 ++ ...terialInventoryCheckDetailServiceImpl.java | 92 ++ .../MaterialInventoryCheckService.java | 80 ++ .../MaterialInventoryCheckServiceImpl.java | 183 ++++ ...MaterialInventoryInboundDetailService.java | 69 ++ ...rialInventoryInboundDetailServiceImpl.java | 96 +++ .../MaterialInventoryInboundService.java | 78 ++ .../MaterialInventoryInboundServiceImpl.java | 191 +++++ ...aterialInventoryOutboundDetailService.java | 64 ++ ...ialInventoryOutboundDetailServiceImpl.java | 92 ++ .../MaterialInventoryOutboundService.java | 74 ++ .../MaterialInventoryOutboundServiceImpl.java | 132 +++ .../service/MaterialInventoryService.java | 31 + .../service/MaterialInventoryServiceImpl.java | 76 ++ .../MaterialLifecycleDetailService.java | 64 ++ .../MaterialLifecycleDetailServiceImpl.java | 92 ++ .../service/MaterialLifecycleService.java | 64 ++ .../service/MaterialLifecycleServiceImpl.java | 92 ++ .../service/MaterialLocationService.java | 64 ++ .../service/MaterialLocationServiceImpl.java | 92 ++ .../service/AutoIngredientsServiceImpl.java | 9 +- .../service/XRFDataServiceImpl.java | 174 +++- .../mapper/BusinessAssayProjectDataMapper.xml | 41 + .../mapper/BusinessAssayReportDataMapper.xml | 8 +- .../mapper/BusinessAssayTaskDataMapper.xml | 99 ++- ... BusinessAssayTaskParameterDataMapper.xml} | 2 +- ...usinessSampleEntrustRegistrationMapper.xml | 18 +- ...SubParentSampleAssessmentProjectMapper.xml | 67 +- .../BusinessSubSampleParentRetestMapper.xml | 12 + .../ConfigAssayMethodParameterMapper.xml | 12 + .../dal/mapper/ReportDocumentFileMapper.xml | 12 + .../com/zt/plat/module/qms/office/deleteme | 0 .../dal/mapper/SupplierEvaluationAtMapper.xml | 12 + .../dal/mapper/SupplierEvaluationMapper.xml | 12 + .../supplier/dal/mapper/SupplierMapper.xml | 12 + .../dal/mapper/SupplierPropertiesMapper.xml | 12 + .../dal/mapper/VersionManagementMapper.xml | 12 + .../DeviceAffiliationRelativityMapper.xml | 12 + .../dal/mapper/DeviceApplyDetailMapper.xml | 12 + .../mapper/DeviceApplyMapper.xml} | 2 +- .../dal/mapper/DeviceCalibrationMapper.xml | 12 + .../mapper/DeviceCalibrationPlanMapper.xml | 12 + .../mapper/DeviceConfigBusinessItemMapper.xml | 12 + .../mapper/DeviceConfigBusinessRuleMapper.xml | 12 + .../dal/mapper/DeviceConfigFlowMapper.xml | 12 + .../dal/mapper/DeviceInfomationMapper.xml | 50 ++ .../dal/mapper/DeviceMaintainItemMapper.xml | 12 + .../dal/mapper/DeviceMaintainMapper.xml | 129 +++ .../dal/mapper/DevicePeriodCheckMapper.xml | 12 + .../mapper/DevicePeriodCheckPlanMapper.xml | 12 + .../dal/mapper/DeviceProductMapper.xml | 0 .../dal/mapper/DeviceRepairApplyMapper.xml | 12 + .../dal/mapper/DeviceRepairAtMapper.xml | 12 + .../dal/mapper/DeviceRepairDetailMapper.xml | 12 + .../mapper/DeviceRepairResultDetailMapper.xml | 12 + .../dal/mapper/DeviceUseRecordMapper.xml | 129 +++ .../dal/mapper/MaterialBatchAssignMapper.xml | 12 + .../dal/mapper/MaterialBatchMapper.xml | 12 + .../dal/mapper/MaterialInfomationMapper.xml | 0 .../MaterialInventoryCheckBatchMapper.xml | 12 + .../MaterialInventoryCheckDetailMapper.xml | 12 + .../mapper/MaterialInventoryCheckMapper.xml | 12 + .../MaterialInventoryInboundDetailMapper.xml | 12 + .../mapper/MaterialInventoryInboundMapper.xml | 12 + .../dal/mapper/MaterialInventoryMapper.xml | 103 +++ .../MaterialInventoryOutboundDetailMapper.xml | 12 + .../MaterialInventoryOutboundMapper.xml | 12 + .../mapper/MaterialLifecycleDetailMapper.xml | 12 + .../dal/mapper/MaterialLifecycleMapper.xml | 12 + .../dal/mapper/MaterialLocationMapper.xml | 12 + .../dal/mapper/MaterialProductMapper.xml | 0 624 files changed, 32489 insertions(+), 2776 deletions(-) create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessAssayTaskParameterDataController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQCManagementSampleParameterDataController.java rename zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/{BusinessSubSampleParentRecheckController.java => BusinessSubSampleParentRetestController.java} (51%) create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleReportDataQueryController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/TestController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/AssayMethodProjectRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskParameterDataPageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskParameterDataRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskParameterDataSaveReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCCoefficientDataExtendRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCManagementDataExtendRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCManagementSampleParameterDataPageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCManagementSampleParameterDataRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCManagementSampleParameterDataSaveReqVO.java delete mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleParentRecheckPageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleParentRetestPageReqVO.java rename zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/{BusinessSubSampleParentRecheckRespVO.java => BusinessSubSampleParentRetestRespVO.java} (59%) rename zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/{BusinessSubSampleParentRecheckSaveReqVO.java => BusinessSubSampleParentRetestSaveReqVO.java} (56%) create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessAssayTaskParameterDataDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessQCManagementSampleParameterDataDO.java rename zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/{BusinessSubSampleParentRecheckDO.java => BusinessSubSampleParentRetestDO.java} (63%) create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayTaskParameterDataMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQCManagementSampleParameterDataMapper.java delete mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubSampleParentRecheckMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubSampleParentRetestMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessAssayTaskParameterDataService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessAssayTaskParameterDataServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCManagementSampleParameterDataService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCManagementSampleParameterDataServiceImpl.java delete mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubSampleParentRecheckService.java delete mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubSampleParentRecheckServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubSampleParentRetestService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubSampleParentRetestServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigAssayMethodParameterController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigEntrustSourceSampleTypeController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/GridReportController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodParameterPageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodParameterRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodParameterSaveReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigEntrustSourceSampleTypePageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigEntrustSourceSampleTypeRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigEntrustSourceSampleTypeSaveReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleMethodConfAdd.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/MaterialAssayStandardMethodExtendRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigAssayMethodParameterDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigEntrustSourceSampleTypeDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigAssayMethodParameterMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigEntrustSourceSampleTypeMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigAssayMethodParameterService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigAssayMethodParameterServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigEntrustSourceSampleTypeService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigEntrustSourceSampleTypeServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/async/AsyncConfig.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/admin/ReportDocumentFileController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentFilePageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentFileRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentFileSaveReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/dal/dataobject/ReportDocumentFileDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/dal/mapper/ReportDocumentFileMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentAssistService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentFileService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentFileServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/controller/admin/DataKeyCheckController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/controller/vo/DataKeyCheckPageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/controller/vo/DataKeyCheckRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/controller/vo/DataKeyCheckSaveReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/dal/dataobject/DataKeyCheckDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/dal/mapper/DataKeyCheckMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/service/DataKeyCheckService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/service/DataKeyCheckServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/dic/controller/vo/DictionaryBusinessExtendRespVO.java delete mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/deleteme create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/admin/SupplierController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/admin/SupplierEvaluationAtController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/admin/SupplierEvaluationController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/admin/SupplierPropertiesController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/vo/SupplierEvaluationAtPageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/vo/SupplierEvaluationAtRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/vo/SupplierEvaluationAtSaveReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/vo/SupplierEvaluationPageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/vo/SupplierEvaluationRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/vo/SupplierEvaluationSaveReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/vo/SupplierPageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/vo/SupplierPropertiesPageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/vo/SupplierPropertiesRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/vo/SupplierPropertiesSaveReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/vo/SupplierRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/vo/SupplierSaveReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/dal/dataobject/SupplierDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/dal/dataobject/SupplierEvaluationAtDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/dal/dataobject/SupplierEvaluationDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/dal/dataobject/SupplierPropertiesDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/dal/mapper/SupplierEvaluationAtMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/dal/mapper/SupplierEvaluationMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/dal/mapper/SupplierMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/dal/mapper/SupplierPropertiesMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/service/SupplierEvaluationAtService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/service/SupplierEvaluationAtServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/service/SupplierEvaluationService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/service/SupplierEvaluationServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/service/SupplierPropertiesService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/service/SupplierPropertiesServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/service/SupplierService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/service/SupplierServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/clientManage/VersionManagementConst.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/clientManage/controller/admin/VersionManagementController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/clientManage/controller/vo/UploadFileVo.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/clientManage/controller/vo/VersionManagementPageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/clientManage/controller/vo/VersionManagementRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/clientManage/controller/vo/VersionManagementSaveReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/clientManage/dal/dataobject/VersionManagementDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/clientManage/dal/mapper/VersionManagementMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/clientManage/service/VersionManagementService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/clientManage/service/VersionManagementServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/common/DeviceUtil.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceAffiliationRelativityController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceApplyController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceApplyDetailController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceCalibrationController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceCalibrationPlanController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceConfigBusinessItemController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceConfigBusinessRuleController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceConfigFlowController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceMaintainController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceMaintainItemController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DevicePeriodCheckController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DevicePeriodCheckPlanController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceRepairApplyController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceRepairDetailController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceRepairResultDetailController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceUseRecordController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceAffiliationRelativityPageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceAffiliationRelativityRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceAffiliationRelativitySaveReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceApplyDetailPageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceApplyDetailRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceApplyDetailSaveReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceApplyPageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceApplyRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceApplySaveReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceCalibrationPageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceCalibrationPlanPageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceCalibrationPlanRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceCalibrationPlanSaveReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceCalibrationRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceCalibrationSaveReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceConfigBusinessItemPageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceConfigBusinessItemRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceConfigBusinessItemSaveReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceConfigBusinessRulePageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceConfigBusinessRuleRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceConfigBusinessRuleSaveReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceConfigFlowPageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceConfigFlowRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceConfigFlowSaveReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceMaintainItemPageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceMaintainItemRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceMaintainItemSaveReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceMaintainPageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceMaintainRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceMaintainSaveReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceMaintainVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DevicePeriodCheckPageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DevicePeriodCheckPlanPageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DevicePeriodCheckPlanRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DevicePeriodCheckPlanSaveReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DevicePeriodCheckRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DevicePeriodCheckSaveReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceRepairApplyPageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceRepairApplyRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceRepairApplySaveReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceRepairAtPageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceRepairAtRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceRepairAtSaveReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceRepairDetailPageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceRepairDetailRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceRepairDetailSaveReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceRepairResultDetailPageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceRepairResultDetailRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceRepairResultDetailSaveReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceUseRecordPageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceUseRecordRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceUseRecordSaveReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceUseRecordVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/dataobject/DeviceAffiliationRelativityDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/dataobject/DeviceApplyDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/dataobject/DeviceApplyDetailDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/dataobject/DeviceCalibrationDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/dataobject/DeviceCalibrationPlanDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/dataobject/DeviceConfigBusinessItemDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/dataobject/DeviceConfigBusinessRuleDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/dataobject/DeviceConfigFlowDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/dataobject/DeviceInfoWithBizConfigVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/dataobject/DeviceMaintainDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/dataobject/DeviceMaintainItemDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/dataobject/DevicePeriodCheckDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/dataobject/DevicePeriodCheckPlanDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/dataobject/DeviceRepairApplyDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/dataobject/DeviceRepairAtDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/dataobject/DeviceRepairDetailDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/dataobject/DeviceRepairResultDetailDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/dataobject/DeviceUseRecordDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceAffiliationRelativityMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceApplyDetailMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceApplyMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceCalibrationMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceCalibrationPlanMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceConfigBusinessItemMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceConfigBusinessRuleMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceConfigFlowMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceMaintainItemMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceMaintainMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DevicePeriodCheckMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DevicePeriodCheckPlanMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceRepairApplyMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceRepairAtMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceRepairDetailMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceRepairResultDetailMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceUseRecordMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceAffiliationRelativityService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceAffiliationRelativityServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceApplyDetailService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceApplyDetailServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceApplyService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceApplyServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceCalibrationPlanService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceCalibrationPlanServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceCalibrationService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceCalibrationServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceConfigBusinessItemService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceConfigBusinessItemServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceConfigBusinessRuleService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceConfigBusinessRuleServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceConfigFlowService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceConfigFlowServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceMaintainItemService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceMaintainItemServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceMaintainService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceMaintainServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DevicePeriodCheckPlanService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DevicePeriodCheckPlanServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DevicePeriodCheckService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DevicePeriodCheckServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceRepairApplyService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceRepairApplyServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceRepairAtService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceRepairAtServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceRepairDetailService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceRepairDetailServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceRepairResultDetailService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceRepairResultDetailServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceUseRecordService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceUseRecordServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialBatchAssignController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialBatchController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialInventoryCheckBatchController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialInventoryCheckController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialInventoryCheckDetailController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialInventoryController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialInventoryInboundController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialInventoryInboundDetailController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialInventoryOutboundController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialInventoryOutboundDetailController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialLifecycleController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialLifecycleDetailController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialLocationController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialBatchAssignPageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialBatchAssignRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialBatchAssignSaveReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialBatchPageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialBatchRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialBatchSaveReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryCheckBatchPageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryCheckBatchRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryCheckBatchSaveReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryCheckDetailPageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryCheckDetailRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryCheckDetailSaveReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryCheckPageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryCheckRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryCheckSaveReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryInboundDetailPageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryInboundDetailRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryInboundDetailSaveReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryInboundPageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryInboundRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryInboundSaveReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryOutboundDetailPageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryOutboundDetailRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryOutboundDetailSaveReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryOutboundPageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryOutboundRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryOutboundSaveReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryPageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialLifecycleDetailPageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialLifecycleDetailRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialLifecycleDetailSaveReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialLifecyclePageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialLifecycleRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialLifecycleSaveReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialLocationPageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialLocationRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialLocationSaveReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/dataobject/MaterialBatchAssignDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/dataobject/MaterialBatchDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/dataobject/MaterialInventoryCheckBatchDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/dataobject/MaterialInventoryCheckDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/dataobject/MaterialInventoryCheckDetailDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/dataobject/MaterialInventoryDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/dataobject/MaterialInventoryInboundDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/dataobject/MaterialInventoryInboundDetailDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/dataobject/MaterialInventoryOutboundDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/dataobject/MaterialInventoryOutboundDetailDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/dataobject/MaterialLifecycleDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/dataobject/MaterialLifecycleDetailDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/dataobject/MaterialLocationDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialBatchAssignMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialBatchMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialInventoryCheckBatchMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialInventoryCheckDetailMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialInventoryCheckMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialInventoryInboundDetailMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialInventoryInboundMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialInventoryMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialInventoryOutboundDetailMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialInventoryOutboundMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialLifecycleDetailMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialLifecycleMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialLocationMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialBatchAssignService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialBatchAssignServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialBatchService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialBatchServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialInventoryCheckBatchService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialInventoryCheckBatchServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialInventoryCheckDetailService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialInventoryCheckDetailServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialInventoryCheckService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialInventoryCheckServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialInventoryInboundDetailService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialInventoryInboundDetailServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialInventoryInboundService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialInventoryInboundServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialInventoryOutboundDetailService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialInventoryOutboundDetailServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialInventoryOutboundService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialInventoryOutboundServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialInventoryService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialInventoryServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialLifecycleDetailService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialLifecycleDetailServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialLifecycleService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialLifecycleServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialLocationService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialLocationServiceImpl.java rename zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/{BusinessSubSampleParentRecheckMapper.xml => BusinessAssayTaskParameterDataMapper.xml} (93%) create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubSampleParentRetestMapper.xml create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/config/dal/mapper/ConfigAssayMethodParameterMapper.xml create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/reportdoc/dal/mapper/ReportDocumentFileMapper.xml delete mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/office/deleteme create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/office/supplier/dal/mapper/SupplierEvaluationAtMapper.xml create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/office/supplier/dal/mapper/SupplierEvaluationMapper.xml create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/office/supplier/dal/mapper/SupplierMapper.xml create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/office/supplier/dal/mapper/SupplierPropertiesMapper.xml create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/clientManage/data/dal/mapper/VersionManagementMapper.xml create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceAffiliationRelativityMapper.xml create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceApplyDetailMapper.xml rename zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/device/{data/dal/mapper/DeviceInfomationMapper.xml => dal/mapper/DeviceApplyMapper.xml} (95%) create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceCalibrationMapper.xml create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceCalibrationPlanMapper.xml create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceConfigBusinessItemMapper.xml create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceConfigBusinessRuleMapper.xml create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceConfigFlowMapper.xml create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceInfomationMapper.xml create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceMaintainItemMapper.xml create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceMaintainMapper.xml create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/device/dal/mapper/DevicePeriodCheckMapper.xml create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/device/dal/mapper/DevicePeriodCheckPlanMapper.xml rename zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/device/{data => }/dal/mapper/DeviceProductMapper.xml (100%) create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceRepairApplyMapper.xml create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceRepairAtMapper.xml create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceRepairDetailMapper.xml create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceRepairResultDetailMapper.xml create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceUseRecordMapper.xml create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialBatchAssignMapper.xml create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialBatchMapper.xml rename zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/material/{data => }/dal/mapper/MaterialInfomationMapper.xml (100%) create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialInventoryCheckBatchMapper.xml create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialInventoryCheckDetailMapper.xml create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialInventoryCheckMapper.xml create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialInventoryInboundDetailMapper.xml create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialInventoryInboundMapper.xml create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialInventoryMapper.xml create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialInventoryOutboundDetailMapper.xml create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialInventoryOutboundMapper.xml create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialLifecycleDetailMapper.xml create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialLifecycleMapper.xml create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialLocationMapper.xml rename zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/material/{data => }/dal/mapper/MaterialProductMapper.xml (100%) diff --git a/zt-module-qms/zt-module-qms-api/src/main/java/com/zt/plat/module/qms/api/task/QmsApi.java b/zt-module-qms/zt-module-qms-api/src/main/java/com/zt/plat/module/qms/api/task/QmsApi.java index 6216c19..21142fb 100644 --- a/zt-module-qms/zt-module-qms-api/src/main/java/com/zt/plat/module/qms/api/task/QmsApi.java +++ b/zt-module-qms/zt-module-qms-api/src/main/java/com/zt/plat/module/qms/api/task/QmsApi.java @@ -1,9 +1,9 @@ package com.zt.plat.module.qms.api.task; -import com.alibaba.fastjson.JSONObject; import com.zt.plat.framework.common.pojo.CommonResult; import com.zt.plat.module.qms.api.task.dto.QmsBpmDTO; import com.zt.plat.module.qms.enums.ApiConstants; +import com.alibaba.fastjson.JSONObject; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.validation.Valid; diff --git a/zt-module-qms/zt-module-qms-api/src/main/java/com/zt/plat/module/qms/enums/ErrorCodeConstants.java b/zt-module-qms/zt-module-qms-api/src/main/java/com/zt/plat/module/qms/enums/ErrorCodeConstants.java index 1b95f56..84eeaec 100644 --- a/zt-module-qms/zt-module-qms-api/src/main/java/com/zt/plat/module/qms/enums/ErrorCodeConstants.java +++ b/zt-module-qms/zt-module-qms-api/src/main/java/com/zt/plat/module/qms/enums/ErrorCodeConstants.java @@ -37,6 +37,7 @@ public interface ErrorCodeConstants { /*==============================config 配置模块 1_032_050_000 ~ 1_032_099_999 ===============================*/ ErrorCode CONFIG_REPORT_TEMPLATE_NOT_EXISTS = new ErrorCode(1_032_050_000, "报表模版配置不存在"); ErrorCode CONFIG_ASSAY_METHOD_NOT_EXISTS = new ErrorCode(1_032_050_000, "检测方法配置不存在"); + ErrorCode CONFIG_ASSAY_METHOD_PARAMETER_NOT_EXISTS = new ErrorCode(1_032_050_000, "检测方法参数配置不存在"); ErrorCode CONFIG_ASSAY_METHOD_PROJECT_NOT_EXISTS = new ErrorCode(1_032_050_000, "检测方法分析项目配置不存在"); ErrorCode CONFIG_ASSAY_METHOD_PROJECT_RANGE_NOT_EXISTS = new ErrorCode(1_032_050_000, "检测方法分析项目区间不存在"); ErrorCode CONFIG_ASSAY_METHOD_PROJECT_ASSESSMENT_NOT_EXISTS = new ErrorCode(1_032_050_000, "检测方法分析项目判定不存在"); @@ -47,13 +48,14 @@ public interface ErrorCodeConstants { ErrorCode CONFIG_SUB_SAMPLE_PARENT_NOT_EXISTS = new ErrorCode(1_032_050_000, "分样配置不存在"); ErrorCode CONFIG_SUB_SAMPLE_PARENT_METHOD_NOT_EXISTS = new ErrorCode(1_032_050_000, "分样与检测方法配置不存在"); //ErrorCode CONFIG_SUB_SAMPLE_PARENT_RECHECK_NOT_EXISTS = new ErrorCode(1_032_050_000, "分样与复检配置不存在"); - ErrorCode CONFIG_SUB_SAMPLE_METHOD_NOT_EXISTS = new ErrorCode(1_032_050_000, "子样与检测方法配置不存在"); + ErrorCode CONFIG_SUB_SAMPLE_METHOD_NOT_EXISTS = new ErrorCode(1_032_050_000, "子样与分样检测方法配置表不存在"); ErrorCode CONFIG_SUB_SAMPLE_NOT_EXISTS = new ErrorCode(1_032_050_000, "子样配置不存在"); ErrorCode CONFIG_SAMPLE_REPORT_NOT_EXISTS = new ErrorCode(1_032_050_000, "样品报表关系不存在"); ErrorCode CONFIG_SAMPLE_FLOW_NOT_EXISTS = new ErrorCode(1_032_050_000, "样品流程配置不存在"); ErrorCode CONFIG_REPORT_TYPE_NOT_EXISTS = new ErrorCode(1_032_050_000, "报表类型配置不存在"); ErrorCode CONFIG_PROJECT_NOT_EXISTS = new ErrorCode(1_032_050_000, "检测项目配置不存在"); ErrorCode CONFIG_ENTRUST_SOURCE_NOT_EXISTS = new ErrorCode(1_032_050_000, "检验委托来源配置不存在"); + ErrorCode CONFIG_ENTRUST_SOURCE_SAMPLE_TYPE_NOT_EXISTS = new ErrorCode(1_032_050_000, "检验委托来源与样品类型配置不存在"); ErrorCode CONFIG_BASE_SAMPLE_NOT_EXISTS = new ErrorCode(1_032_050_000, "主样配置不存在"); ErrorCode CONFIG_ASSAY_METHOD_PROJECT_PARAMETER_NOT_EXISTS = new ErrorCode(1_032_050_000, "检测方法分析项目参数配置不存在"); @@ -87,7 +89,7 @@ public interface ErrorCodeConstants { ErrorCode CONFIG_PERMISSION_NOT_EXISTS = new ErrorCode(1_032_050_000, "权限配置不存在"); ErrorCode CONFIG_PERMISSION_DUPLICATE = new ErrorCode(1_032_050_000, "权限配置数据有误"); ErrorCode CONFIG_WAREHOUSE_LOCATION_NOT_EXISTS = new ErrorCode(1_032_050_000, "存放位置不存在"); - ErrorCode CONFIG_WAREHOUSE_LOCATION_CODE_DUPLICATE = new ErrorCode(1_032_050_000, "库位编码重复,请检查库位数据,或联系管理员处理!"); + ErrorCode CONFIG_WAREHOUSE_LOCATION_CODE_DUPLICATE = new ErrorCode(1_032_050_000, "库位编码重复,请检查!"); /*=================================bus 检验业务 1_032_100_000 ~ 1_032_149_999==================================*/ ErrorCode BUSINESS_SAMPLE_ENTRUST_REGISTRATION_NOT_EXISTS = new ErrorCode(1_032_100_000, "委检登记业务不存在"); @@ -100,6 +102,7 @@ public interface ErrorCodeConstants { ErrorCode BUSINESS_HANDOVER_RECORD_SUB_NOT_EXISTS = new ErrorCode(1_032_100_000, "子样交接记录业务不存在"); ErrorCode BUSINESS_SAMPLE_ASSAY_RESULT_NOT_EXISTS = new ErrorCode(1_032_100_000, "委检登记来样品位不存在"); ErrorCode BUSINESS_ASSAY_TASK_DATA_NOT_EXISTS = new ErrorCode(1_032_100_000, "子样检测任务业务不存在"); + ErrorCode BUSINESS_ASSAY_TASK_PARAMETER_DATA_NOT_EXISTS = new ErrorCode(1_032_100_000, "子样检测任务参数业务不存在"); ErrorCode BUSINESS_ASSAY_PROJECT_DATA_NOT_EXISTS = new ErrorCode(1_032_100_000, "检测项目数据业务不存在"); ErrorCode BUSINESS_ASSAY_PARAMETER_DATA_NOT_EXISTS = new ErrorCode(1_032_100_000, "检测参数数据业务不存在"); ErrorCode BUSINESS_SUB_SAMPLE_ASSESSMENT_NOT_EXISTS = new ErrorCode(1_032_100_000, "子样判定业务不存在"); @@ -119,7 +122,7 @@ public interface ErrorCodeConstants { ErrorCode BUSINESS_SUB_PARENT_SAMPLE_ASSESSMENT_NOT_EXISTS = new ErrorCode(1_032_100_000, "班组判定数据业务不存在"); ErrorCode BUSINESS_SUB_PARENT_SAMPLE_ASSESSMENT_PROJECT_NOT_EXISTS = new ErrorCode(1_032_100_000, "班组判定检测项目数据业务不存在"); - ErrorCode BUSINESS_SUB_SAMPLE_PARENT_RECHECK_NOT_EXISTS = new ErrorCode(1_032_100_000, "分样复检业务数据不存在"); + ErrorCode BUSINESS_SUB_SAMPLE_PARENT_RETEST_NOT_EXISTS = new ErrorCode(1_032_100_000, "分样复测业务数据不存在"); ErrorCode BUSINESS_QC_DATA_NOT_EXISTS = new ErrorCode(1_032_100_000, "质控样业务不存在"); ErrorCode BUSINESS_QC_PROJECT_DATA_NOT_EXISTS = new ErrorCode(1_032_100_000, "质控样检测项目数据业务不存在"); @@ -128,6 +131,7 @@ public interface ErrorCodeConstants { ErrorCode BUSINESS_QC_MANAGEMENT_DATA_NOT_EXISTS = new ErrorCode(1_032_100_000, "质控管理样检测任务数据,管理样、标准样不存在"); ErrorCode BUSINESS_QC_MANAGEMENT_PROJECT_DATA_NOT_EXISTS = new ErrorCode(1_032_100_000, "质控样检测项目数据业务不存在"); ErrorCode BUSINESS_QC_MANAGEMENT_PARAMETER_DATA_NOT_EXISTS = new ErrorCode(1_032_100_000, "质控样检测参数数据业务不存在"); + ErrorCode BUSINESS_QC_MANAGEMENT_SAMPLE_PARAMETER_DATA_NOT_EXISTS = new ErrorCode(1_032_100_000, "质控管理样检测任务参数业务表,与子样检测任务参数业务表T_BSN_ASY_TSK_PRM_DAT一样,针对标准样、管理样、质控样、监控样等样品的参数不存在"); ErrorCode BUSINESS_QC_COEFFICIENT_DATA_NOT_EXISTS = new ErrorCode(1_032_100_000, "质控样检测系数任务数据,空白样、标样不存在"); ErrorCode BUSINESS_QC_COEFFICIENT_PARAMETER_DATA_NOT_EXISTS = new ErrorCode(1_032_100_000, "质控样检测系数参数业务不存在"); @@ -139,15 +143,55 @@ public interface ErrorCodeConstants { ErrorCode REPORT_DOCUMENT_DATA_NOT_EXISTS = new ErrorCode(1_032_100_000, "检测报告明细不存在"); ErrorCode REPORT_DOCUMENT_TYPE_NOT_EXISTS = new ErrorCode(1_032_100_000, "报告类型配置不存在"); ErrorCode REPORT_DOCUMENT_MAIN_CORRELATION_NOT_EXISTS = new ErrorCode(1_032_100_000, "报告主数据关系不存在"); + ErrorCode REPORT_DOCUMENT_FILE_NOT_EXISTS = new ErrorCode(1_032_100_000, "检测报告附件不存在"); ErrorCode BUSINESS_SAMPLE_DISPATCH_NOT_EXISTS = new ErrorCode(1_032_100_000, "样品调拨不存在"); ErrorCode BUSINESS_SAMPLE_DISPATCH_DETAIL_NOT_EXISTS = new ErrorCode(1_032_100_000, "样品调拨明细不存在"); /*=================================resource 资源管理 1_032_150_000 ~ 1_032_199_999 ==================================*/ - ErrorCode DEVICE_INFOMATION_NOT_EXISTS = new ErrorCode(1_032_150_000, "设备_设备信息不存在"); - ErrorCode DEVICE_PRODUCT_NOT_EXISTS = new ErrorCode(1_032_150_000, "设备_设备大类不存在"); +// ----------设备管理---------- + ErrorCode DEVICE_INFOMATION_NOT_EXISTS = new ErrorCode(1_032_150_000, "设备信息不存在"); + ErrorCode DEVICE_PRODUCT_NOT_EXISTS = new ErrorCode(1_032_150_000, "设备大类不存在"); + ErrorCode DEVICE_MAINTAIN_NOT_EXISTS = new ErrorCode(1_032_150_000, "设备维护数据不存在"); + ErrorCode DEVICE_MAINTAIN_ITEM_NOT_EXISTS = new ErrorCode(1_032_150_000, "设备维护项不存在"); + ErrorCode DEVICE_CONFIG_BUSINESS_RULE_NOT_EXISTS = new ErrorCode(1_032_150_000, "设备业务配置不存在"); + ErrorCode DEVICE_CONFIG_BUSINESS_ITEM_NOT_EXISTS = new ErrorCode(1_032_150_000, "设备业务配置项不存在"); + ErrorCode DEVICE_PERIOD_CHECK_NOT_EXISTS = new ErrorCode(1_032_150_000, "期间核查数据不存在"); + + ErrorCode DEVICE_PERIOD_CHECK_PLAN_NOT_EXISTS = new ErrorCode(1_032_150_000, "期间核查计划不存在"); + ErrorCode DEVICE_REPAIR_APPLY_NOT_EXISTS = new ErrorCode(1_032_150_000, "设备维修申请数据不存在"); + ErrorCode DEVICE_REPAIR_RESULT_DETAIL_NOT_EXISTS = new ErrorCode(1_032_150_000, "设备维修结果明细不存在"); + ErrorCode DEVICE_REPAIR_DETAIL_NOT_EXISTS = new ErrorCode(1_032_150_000, "设备维修明细不存在"); + ErrorCode DEVICE_CALIBRATION_PLAN_NOT_EXISTS = new ErrorCode(1_032_150_000, "检定校准计划不存在"); + ErrorCode DEVICE_CALIBRATION_NOT_EXISTS = new ErrorCode(1_032_150_000, "检定校准数据不存在"); + ErrorCode DEVICE_USE_RECORD_NOT_EXISTS = new ErrorCode(1_032_150_000, "设备使用记录不存在"); + ErrorCode DEVICE_AFFILIATION_RELATIVITY_NOT_EXISTS = new ErrorCode(1_032_150_000, "附属设备关系不存在"); + ErrorCode DEVICE_APPLY_DETAIL_NOT_EXISTS = new ErrorCode(1_032_150_000, "设备申请明细数据不存在"); + ErrorCode DEVICE_APPLY_NOT_EXISTS = new ErrorCode(1_032_150_000, "设备申请数据不存在"); + ErrorCode DEVICE_CONFIG_FLOW_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_LIFECYCLE_DETAIL_NOT_EXISTS = new ErrorCode(1_032_150_000, "物料通用流程明细不存在"); + ErrorCode MATERIAL_LIFECYCLE_NOT_EXISTS = new ErrorCode(1_032_150_000, "物料通用流程不存在"); + + ErrorCode MATERIAL_BATCH_NOT_EXISTS = new ErrorCode(1_032_150_000, "物料批次不存在"); + ErrorCode MATERIAL_BATCH_ASSIGN_NOT_EXISTS = new ErrorCode(1_032_150_000, "物料批次分发不存在"); + ErrorCode MATERIAL_INVENTORY_INBOUND_NOT_EXISTS = new ErrorCode(1_032_150_000, "入库,出库不存在"); + ErrorCode MATERIAL_INVENTORY_INBOUND_DETAIL_NOT_EXISTS = new ErrorCode(1_032_150_000, "入库明细,出库明细等不存在"); + + ErrorCode SYSTEM_VERSION_MANAGEMENT_NOT_EXISTS = new ErrorCode(1_032_150_000, "客户端版本管理不存在"); + + ErrorCode MATERIAL_LOCATION_NOT_EXISTS = new ErrorCode(1_032_150_000, "存放位置不存在"); + ErrorCode MATERIAL_INVENTORY_CHECK_NOT_EXISTS = new ErrorCode(1_032_150_000, "库存盘点不存在"); + ErrorCode MATERIAL_INVENTORY_CHECK_BATCH_NOT_EXISTS = new ErrorCode(1_032_150_000, "库存盘点项不存在"); + ErrorCode MATERIAL_INVENTORY_CHECK_DETAIL_NOT_EXISTS = new ErrorCode(1_032_150_000, "库存盘点明细不存在"); + ErrorCode MATERIAL_INVENTORY_OUTBOUND_NOT_EXISTS = new ErrorCode(1_032_150_000, "出库不存在"); + ErrorCode MATERIAL_INVENTORY_OUTBOUND_DETAIL_NOT_EXISTS = new ErrorCode(1_032_150_000, "出库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等不存在"); + + + /*================================= tx 1_032_200_000 ~ 1_032_249_999 ==================================*/ @@ -156,6 +200,11 @@ public interface ErrorCodeConstants { /*================================= office 办公 1_032_250_000 ~ 1_032_299_999 ==================================*/ + ErrorCode SUPPLIER_NOT_EXISTS = new ErrorCode(1_032_250_000, "供应商不存在"); + ErrorCode SUPPLIER_PROPERTIES_NOT_EXISTS = new ErrorCode(1_032_250_000, "供应商属性不存在"); + ErrorCode SUPPLIER_EVALUATION_NOT_EXISTS = new ErrorCode(1_032_250_000, "供应商评价不存在"); + ErrorCode SUPPLIER_EVALUATION_AT_NOT_EXISTS = new ErrorCode(1_032_250_000, "供应商评价关系不存在"); + /*================================= dzj 大质检 1_032_300_000 ~ 1_032_349_999 ==================================*/ diff --git a/zt-module-qms/zt-module-qms-api/src/main/java/com/zt/plat/module/qms/enums/QmsBpmConstant.java b/zt-module-qms/zt-module-qms-api/src/main/java/com/zt/plat/module/qms/enums/QmsBpmConstant.java index 16af761..d22931b 100644 --- a/zt-module-qms/zt-module-qms-api/src/main/java/com/zt/plat/module/qms/enums/QmsBpmConstant.java +++ b/zt-module-qms/zt-module-qms-api/src/main/java/com/zt/plat/module/qms/enums/QmsBpmConstant.java @@ -14,6 +14,9 @@ public class QmsBpmConstant { public static final String BPM_FIELD_EXTENSIONS = "bpmFieldExtensions"; public static final String BPM_FIRST_ACTIVITY_FLAG = "firstActivityFlag"; public static final String BPM_LAST_ACTIVITY_FLAG = "lastActivityFlag"; + public static final String BPM_REJECT_TO_FIRST_FLAG = "rejectToFirstActivity"; + public static final String BPM_CUR_ACTIVITY_INS_ID = "currentActivityInsId"; //当前活动实例id + public static final String BPM_PROCESS_INS_ID = "processInstanceId"; //当前活动实例id //驳回标记前缀 public static final String BPM_CALLBACK_RETURN_FLAG_PREFIX_KEY = "RETURN_FLAG_"; diff --git a/zt-module-qms/zt-module-qms-api/src/main/java/com/zt/plat/module/qms/enums/QmsCommonConstant.java b/zt-module-qms/zt-module-qms-api/src/main/java/com/zt/plat/module/qms/enums/QmsCommonConstant.java index 19a8a8e..adafb2b 100644 --- a/zt-module-qms/zt-module-qms-api/src/main/java/com/zt/plat/module/qms/enums/QmsCommonConstant.java +++ b/zt-module-qms/zt-module-qms-api/src/main/java/com/zt/plat/module/qms/enums/QmsCommonConstant.java @@ -107,6 +107,15 @@ public interface QmsCommonConstant { /** 检验委托 **/ String ENTRUST_INSPECTION = "entrust_inspection"; + /** 委托样品类型: 委检样 **/ + String ENTRUST_COMMISSION_INSPECTION_SAMPLE = "commissionInspectionSample"; + + /** 委托样品类型: 商检分析样 **/ + String ENTRUST_INSPECTION_ANALYSIS_SAMPLE = "inspectionAnalysisSample"; + + /** 委托样品类型: 商检综合 **/ + String ENTRUST_COMPREHENSIVE_INSPECTION_SAMPLE = "comprehensiveInspectionSample"; + /** 中心收样 **/ String FLOW_NODE_CENTER_RECEIVE = "flw_center_receive"; @@ -179,6 +188,10 @@ public interface QmsCommonConstant { /** 检验完成状态-未完成 **/ String UNCHECKED = "unchecked"; + /** 数据回报状态 未回报 **/ + String UNRETURNED = "unreturned"; + + /** 自动 **/ String AUTOMATIC = "automatic"; @@ -194,4 +207,7 @@ public interface QmsCommonConstant { /** 允许提交 **/ String ALLOW_SUBMIT = "allow_submit"; + + + } diff --git a/zt-module-qms/zt-module-qms-server/pom.xml b/zt-module-qms/zt-module-qms-server/pom.xml index 2e5c10c..afbba64 100644 --- a/zt-module-qms/zt-module-qms-server/pom.xml +++ b/zt-module-qms/zt-module-qms-server/pom.xml @@ -18,6 +18,7 @@ 3.9.1.v20251204-RELEASE + 2.15.2 @@ -110,6 +111,12 @@ com.zt.plat zt-spring-boot-starter-test + + + com.vaadin.external.google + android-json + + @@ -135,27 +142,27 @@ com.yomahub liteflow-spring-boot-starter - 2.15.0 + ${liteflow.version} com.yomahub liteflow-script-javax-pro - 2.15.0 + ${liteflow.version} com.yomahub liteflow-script-groovy - 2.15.0 + ${liteflow.version} com.yomahub liteflow-script-qlexpress - 2.15.0 + ${liteflow.version} com.yomahub liteflow-script-graaljs - 2.15.0 + ${liteflow.version} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessAssayTaskParameterDataController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessAssayTaskParameterDataController.java new file mode 100644 index 0000000..b62186b --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessAssayTaskParameterDataController.java @@ -0,0 +1,106 @@ +package com.zt.plat.module.qms.business.bus.controller.admin; + +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.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskParameterDataDO; +import com.zt.plat.module.qms.business.bus.service.BusinessAssayTaskParameterDataService; +import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog; +import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; + +@Tag(name = "管理后台 - 子样检测任务参数业务") +@RestController +@RequestMapping("/qms/business-assay-task-parameter-data") +@Validated +public class BusinessAssayTaskParameterDataController implements BusinessControllerMarker { + + + @Resource + private BusinessAssayTaskParameterDataService businessAssayTaskParameterDataService; + + @PostMapping("/create") + @Operation(summary = "创建子样检测任务参数业务") + @PreAuthorize("@ss.hasPermission('qms:business-assay-task-parameter-data:create')") + public CommonResult createBusinessAssayTaskParameterData(@Valid @RequestBody BusinessAssayTaskParameterDataSaveReqVO createReqVO) { + return success(businessAssayTaskParameterDataService.createBusinessAssayTaskParameterData(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新子样检测任务参数业务") + @PreAuthorize("@ss.hasPermission('qms:business-assay-task-parameter-data:update')") + public CommonResult updateBusinessAssayTaskParameterData(@Valid @RequestBody BusinessAssayTaskParameterDataSaveReqVO updateReqVO) { + businessAssayTaskParameterDataService.updateBusinessAssayTaskParameterData(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除子样检测任务参数业务") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('qms:business-assay-task-parameter-data:delete')") + public CommonResult deleteBusinessAssayTaskParameterData(@RequestParam("id") Long id) { + businessAssayTaskParameterDataService.deleteBusinessAssayTaskParameterData(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除子样检测任务参数业务") + @PreAuthorize("@ss.hasPermission('qms:business-assay-task-parameter-data:delete')") + public CommonResult deleteBusinessAssayTaskParameterDataList(@RequestBody BatchDeleteReqVO req) { + businessAssayTaskParameterDataService.deleteBusinessAssayTaskParameterDataListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得子样检测任务参数业务") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('qms:business-assay-task-parameter-data:query')") + public CommonResult getBusinessAssayTaskParameterData(@RequestParam("id") Long id) { + BusinessAssayTaskParameterDataDO businessAssayTaskParameterData = businessAssayTaskParameterDataService.getBusinessAssayTaskParameterData(id); + return success(BeanUtils.toBean(businessAssayTaskParameterData, BusinessAssayTaskParameterDataRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得子样检测任务参数业务分页") + @PreAuthorize("@ss.hasPermission('qms:business-assay-task-parameter-data:query')") + public CommonResult> getBusinessAssayTaskParameterDataPage(@Valid BusinessAssayTaskParameterDataPageReqVO pageReqVO) { + PageResult pageResult = businessAssayTaskParameterDataService.getBusinessAssayTaskParameterDataPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, BusinessAssayTaskParameterDataRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出子样检测任务参数业务 Excel") + @PreAuthorize("@ss.hasPermission('qms:business-assay-task-parameter-data:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportBusinessAssayTaskParameterDataExcel(@Valid BusinessAssayTaskParameterDataPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = businessAssayTaskParameterDataService.getBusinessAssayTaskParameterDataPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "子样检测任务参数业务.xls", "数据", BusinessAssayTaskParameterDataRespVO.class, + BeanUtils.toBean(list, BusinessAssayTaskParameterDataRespVO.class)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQCCoefficientDataController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQCCoefficientDataController.java index 59b1305..c8ca6be 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQCCoefficientDataController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQCCoefficientDataController.java @@ -84,18 +84,18 @@ public class BusinessQCCoefficientDataController implements BusinessControllerMa @GetMapping("/page") @Operation(summary = "获得质控样检测系数任务数据,空白样、标样分页") - @PreAuthorize("@ss.hasPermission('qms:business-QC-coefficient-data:query')") - public CommonResult> getBusinessQCCoefficientDataPage(@Valid BusinessQCCoefficientDataPageReqVO pageReqVO) { - PageResult pageResult = businessQCCoefficientDataService.getBusinessQCCoefficientDataPage(pageReqVO); - return success(BeanUtils.toBean(pageResult, BusinessQCCoefficientDataRespVO.class)); +// @PreAuthorize("@ss.hasPermission('qms:business-QC-coefficient-data:query')") + public CommonResult> getBusinessQCCoefficientDataPage(@Valid BusinessQCCoefficientDataPageReqVO pageReqVO) { + PageResult pageResult = businessQCCoefficientDataService.getBusinessQCCoefficientDataPage(pageReqVO); + return success(pageResult); } @GetMapping("/list") @Operation(summary = "获得质控样检测系数任务数据,空白样、标样分页") // @PreAuthorize("@ss.hasPermission('qms:business-QC-coefficient-data:query')") - public CommonResult> getBusinessQCCoefficientDataPage(@Valid BusinessQCCoefficientDataReqVO reqVO) { - List pageResult = businessQCCoefficientDataService.getBusinessQCCoefficientDataList(reqVO); - return success(BeanUtils.toBean(pageResult, BusinessQCCoefficientDataRespVO.class)); + public CommonResult> getBusinessQCCoefficientDataPage(@Valid BusinessQCCoefficientDataReqVO reqVO) { + List listResult = businessQCCoefficientDataService.getBusinessQCCoefficientDataList(reqVO); + return success(listResult); } @GetMapping("/export-excel") @@ -105,7 +105,7 @@ public class BusinessQCCoefficientDataController implements BusinessControllerMa public void exportBusinessQCCoefficientDataExcel(@Valid BusinessQCCoefficientDataPageReqVO pageReqVO, HttpServletResponse response) throws IOException { pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); - List list = businessQCCoefficientDataService.getBusinessQCCoefficientDataPage(pageReqVO).getList(); + List list = businessQCCoefficientDataService.getBusinessQCCoefficientDataPage(pageReqVO).getList(); // 导出 Excel ExcelUtils.write(response, "质控样检测系数任务数据,空白样、标样.xls", "数据", BusinessQCCoefficientDataRespVO.class, BeanUtils.toBean(list, BusinessQCCoefficientDataRespVO.class)); diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQCManagementDataController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQCManagementDataController.java index f3e667e..28c20ab 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQCManagementDataController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQCManagementDataController.java @@ -85,17 +85,17 @@ public class BusinessQCManagementDataController implements BusinessControllerMar @GetMapping("/page") @Operation(summary = "获得质控管理样检测任务数据,管理样、标准样分页") @PreAuthorize("@ss.hasPermission('qms:business-QC-management-data:query')") - public CommonResult> getBusinessQCManagementDataPage(@Valid BusinessQCManagementDataPageReqVO pageReqVO) { - PageResult pageResult = businessQCManagementDataService.getBusinessQCManagementDataPage(pageReqVO); - return success(BeanUtils.toBean(pageResult, BusinessQCManagementDataRespVO.class)); + public CommonResult> getBusinessQCManagementDataPage(@Valid BusinessQCManagementDataPageReqVO pageReqVO) { + PageResult pageResult = businessQCManagementDataService.getBusinessQCManagementDataPage(pageReqVO); + return success(pageResult); } @GetMapping("/list") @Operation(summary = "获得质控管理样检测任务数据,管理样、标准样列表") // @PreAuthorize("@ss.hasPermission('qms:business-QC-management-data:query')") - public CommonResult> getBusinessQCManagementDataList(@Valid BusinessQCManagementDataReqVO reqVO) { - List pageResult = businessQCManagementDataService.getBusinessQCManagementDataList(reqVO); - return success(BeanUtils.toBean(pageResult, BusinessQCManagementDataRespVO.class)); + public CommonResult> getBusinessQCManagementDataList(@Valid BusinessQCManagementDataReqVO reqVO) { + List listResult = businessQCManagementDataService.getBusinessQCManagementDataList(reqVO); + return success(listResult); } @GetMapping("/export-excel") @@ -105,7 +105,7 @@ public class BusinessQCManagementDataController implements BusinessControllerMar public void exportBusinessQCManagementDataExcel(@Valid BusinessQCManagementDataPageReqVO pageReqVO, HttpServletResponse response) throws IOException { pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); - List list = businessQCManagementDataService.getBusinessQCManagementDataPage(pageReqVO).getList(); + List list = businessQCManagementDataService.getBusinessQCManagementDataPage(pageReqVO).getList(); // 导出 Excel ExcelUtils.write(response, "质控管理样检测任务数据,管理样、标准样.xls", "数据", BusinessQCManagementDataRespVO.class, BeanUtils.toBean(list, BusinessQCManagementDataRespVO.class)); diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQCManagementSampleParameterDataController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQCManagementSampleParameterDataController.java new file mode 100644 index 0000000..5323623 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQCManagementSampleParameterDataController.java @@ -0,0 +1,106 @@ +package com.zt.plat.module.qms.business.bus.controller.admin; + +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.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCManagementSampleParameterDataDO; +import com.zt.plat.module.qms.business.bus.service.BusinessQCManagementSampleParameterDataService; +import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog; +import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; + +@Tag(name = "管理后台 - 质控管理样检测任务参数业务表,与子样检测任务参数业务表T_BSN_ASY_TSK_PRM_DAT一样,针对标准样、管理样、质控样、监控样等样品的参数") +@RestController +@RequestMapping("/qms/business-QC-management-sample-parameter-data") +@Validated +public class BusinessQCManagementSampleParameterDataController implements BusinessControllerMarker { + + + @Resource + private BusinessQCManagementSampleParameterDataService businessQCManagementSampleParameterDataService; + + @PostMapping("/create") + @Operation(summary = "创建质控管理样检测任务参数业务表,与子样检测任务参数业务表T_BSN_ASY_TSK_PRM_DAT一样,针对标准样、管理样、质控样、监控样等样品的参数") + @PreAuthorize("@ss.hasPermission('qms:business-QC-management-sample-parameter-data:create')") + public CommonResult createBusinessQCManagementSampleParameterData(@Valid @RequestBody BusinessQCManagementSampleParameterDataSaveReqVO createReqVO) { + return success(businessQCManagementSampleParameterDataService.createBusinessQCManagementSampleParameterData(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新质控管理样检测任务参数业务表,与子样检测任务参数业务表T_BSN_ASY_TSK_PRM_DAT一样,针对标准样、管理样、质控样、监控样等样品的参数") + @PreAuthorize("@ss.hasPermission('qms:business-QC-management-sample-parameter-data:update')") + public CommonResult updateBusinessQCManagementSampleParameterData(@Valid @RequestBody BusinessQCManagementSampleParameterDataSaveReqVO updateReqVO) { + businessQCManagementSampleParameterDataService.updateBusinessQCManagementSampleParameterData(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除质控管理样检测任务参数业务表,与子样检测任务参数业务表T_BSN_ASY_TSK_PRM_DAT一样,针对标准样、管理样、质控样、监控样等样品的参数") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('qms:business-QC-management-sample-parameter-data:delete')") + public CommonResult deleteBusinessQCManagementSampleParameterData(@RequestParam("id") Long id) { + businessQCManagementSampleParameterDataService.deleteBusinessQCManagementSampleParameterData(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除质控管理样检测任务参数业务表,与子样检测任务参数业务表T_BSN_ASY_TSK_PRM_DAT一样,针对标准样、管理样、质控样、监控样等样品的参数") + @PreAuthorize("@ss.hasPermission('qms:business-QC-management-sample-parameter-data:delete')") + public CommonResult deleteBusinessQCManagementSampleParameterDataList(@RequestBody BatchDeleteReqVO req) { + businessQCManagementSampleParameterDataService.deleteBusinessQCManagementSampleParameterDataListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得质控管理样检测任务参数业务表,与子样检测任务参数业务表T_BSN_ASY_TSK_PRM_DAT一样,针对标准样、管理样、质控样、监控样等样品的参数") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('qms:business-QC-management-sample-parameter-data:query')") + public CommonResult getBusinessQCManagementSampleParameterData(@RequestParam("id") Long id) { + BusinessQCManagementSampleParameterDataDO businessQCManagementSampleParameterData = businessQCManagementSampleParameterDataService.getBusinessQCManagementSampleParameterData(id); + return success(BeanUtils.toBean(businessQCManagementSampleParameterData, BusinessQCManagementSampleParameterDataRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得质控管理样检测任务参数业务表,与子样检测任务参数业务表T_BSN_ASY_TSK_PRM_DAT一样,针对标准样、管理样、质控样、监控样等样品的参数分页") + @PreAuthorize("@ss.hasPermission('qms:business-QC-management-sample-parameter-data:query')") + public CommonResult> getBusinessQCManagementSampleParameterDataPage(@Valid BusinessQCManagementSampleParameterDataPageReqVO pageReqVO) { + PageResult pageResult = businessQCManagementSampleParameterDataService.getBusinessQCManagementSampleParameterDataPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, BusinessQCManagementSampleParameterDataRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出质控管理样检测任务参数业务表,与子样检测任务参数业务表T_BSN_ASY_TSK_PRM_DAT一样,针对标准样、管理样、质控样、监控样等样品的参数 Excel") + @PreAuthorize("@ss.hasPermission('qms:business-QC-management-sample-parameter-data:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportBusinessQCManagementSampleParameterDataExcel(@Valid BusinessQCManagementSampleParameterDataPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = businessQCManagementSampleParameterDataService.getBusinessQCManagementSampleParameterDataPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "质控管理样检测任务参数业务表,与子样检测任务参数业务表T_BSN_ASY_TSK_PRM_DAT一样,针对标准样、管理样、质控样、监控样等样品的参数.xls", "数据", BusinessQCManagementSampleParameterDataRespVO.class, + BeanUtils.toBean(list, BusinessQCManagementSampleParameterDataRespVO.class)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSampleEntrustRegistrationController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSampleEntrustRegistrationController.java index bfde1bc..dbbb2cc 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSampleEntrustRegistrationController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSampleEntrustRegistrationController.java @@ -110,6 +110,9 @@ public class BusinessSampleEntrustRegistrationController implements BusinessCont @GetMapping("/queryWaitingDataForReport") @Operation(summary = "查询待编制数据") public CommonResult> queryWaitingDataForReport(@Valid BusinessSampleEntrustRegistrationPageReqVO pageReqVO) { + Long configReportTypeId = pageReqVO.getConfigReportTypeId(); + if(configReportTypeId == null) + return CommonResult.error(0, "缺少configReportTypeId参数,请刷新后重试!"); PageResult result = businessSampleEntrustRegistrationService.queryWaitingDataForReport(pageReqVO); return success(result); } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSubSampleParentRecheckController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSubSampleParentRetestController.java similarity index 51% rename from zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSubSampleParentRecheckController.java rename to zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSubSampleParentRetestController.java index a2cd20d..85aead2 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSubSampleParentRecheckController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSubSampleParentRetestController.java @@ -25,82 +25,82 @@ import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; import com.zt.plat.module.qms.business.bus.controller.vo.*; -import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleParentRecheckDO; -import com.zt.plat.module.qms.business.bus.service.BusinessSubSampleParentRecheckService; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleParentRetestDO; +import com.zt.plat.module.qms.business.bus.service.BusinessSubSampleParentRetestService; import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog; import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; -@Tag(name = "管理后台 - 分样复检业务数据") +@Tag(name = "管理后台 - 分样复测业务数据") @RestController -@RequestMapping("/qms/business-sub-sample-parent-recheck") +@RequestMapping("/qms/business-sub-sample-parent-retest") @Validated -public class BusinessSubSampleParentRecheckController implements BusinessControllerMarker { +public class BusinessSubSampleParentRetestController implements BusinessControllerMarker { @Resource - private BusinessSubSampleParentRecheckService businessSubSampleParentRecheckService; + private BusinessSubSampleParentRetestService businessSubSampleParentRetestService; @PostMapping("/create") - @Operation(summary = "创建分样复检业务数据") - @PreAuthorize("@ss.hasPermission('qms:business-sub-sample-parent-recheck:create')") - public CommonResult createBusinessSubSampleParentRecheck(@Valid @RequestBody BusinessSubSampleParentRecheckSaveReqVO createReqVO) { - return success(businessSubSampleParentRecheckService.createBusinessSubSampleParentRecheck(createReqVO)); + @Operation(summary = "创建分样复测业务数据") + @PreAuthorize("@ss.hasPermission('qms:business-sub-sample-parent-retest:create')") + public CommonResult createBusinessSubSampleParentRetest(@Valid @RequestBody BusinessSubSampleParentRetestSaveReqVO createReqVO) { + return success(businessSubSampleParentRetestService.createBusinessSubSampleParentRetest(createReqVO)); } @PutMapping("/update") - @Operation(summary = "更新分样复检业务数据") - @PreAuthorize("@ss.hasPermission('qms:business-sub-sample-parent-recheck:update')") - public CommonResult updateBusinessSubSampleParentRecheck(@Valid @RequestBody BusinessSubSampleParentRecheckSaveReqVO updateReqVO) { - businessSubSampleParentRecheckService.updateBusinessSubSampleParentRecheck(updateReqVO); + @Operation(summary = "更新分样复测业务数据") + @PreAuthorize("@ss.hasPermission('qms:business-sub-sample-parent-retest:update')") + public CommonResult updateBusinessSubSampleParentRetest(@Valid @RequestBody BusinessSubSampleParentRetestSaveReqVO updateReqVO) { + businessSubSampleParentRetestService.updateBusinessSubSampleParentRetest(updateReqVO); return success(true); } @DeleteMapping("/delete") - @Operation(summary = "删除分样复检业务数据") + @Operation(summary = "删除分样复测业务数据") @Parameter(name = "id", description = "编号", required = true) - @PreAuthorize("@ss.hasPermission('qms:business-sub-sample-parent-recheck:delete')") - public CommonResult deleteBusinessSubSampleParentRecheck(@RequestParam("id") Long id) { - businessSubSampleParentRecheckService.deleteBusinessSubSampleParentRecheck(id); + @PreAuthorize("@ss.hasPermission('qms:business-sub-sample-parent-retest:delete')") + public CommonResult deleteBusinessSubSampleParentRetest(@RequestParam("id") Long id) { + businessSubSampleParentRetestService.deleteBusinessSubSampleParentRetest(id); return success(true); } @DeleteMapping("/delete-list") @Parameter(name = "ids", description = "编号", required = true) - @Operation(summary = "批量删除分样复检业务数据") - @PreAuthorize("@ss.hasPermission('qms:business-sub-sample-parent-recheck:delete')") - public CommonResult deleteBusinessSubSampleParentRecheckList(@RequestBody BatchDeleteReqVO req) { - businessSubSampleParentRecheckService.deleteBusinessSubSampleParentRecheckListByIds(req.getIds()); + @Operation(summary = "批量删除分样复测业务数据") + @PreAuthorize("@ss.hasPermission('qms:business-sub-sample-parent-retest:delete')") + public CommonResult deleteBusinessSubSampleParentRetestList(@RequestBody BatchDeleteReqVO req) { + businessSubSampleParentRetestService.deleteBusinessSubSampleParentRetestListByIds(req.getIds()); return success(true); } @GetMapping("/get") - @Operation(summary = "获得分样复检业务数据") + @Operation(summary = "获得分样复测业务数据") @Parameter(name = "id", description = "编号", required = true, example = "1024") - @PreAuthorize("@ss.hasPermission('qms:business-sub-sample-parent-recheck:query')") - public CommonResult getBusinessSubSampleParentRecheck(@RequestParam("id") Long id) { - BusinessSubSampleParentRecheckDO businessSubSampleParentRecheck = businessSubSampleParentRecheckService.getBusinessSubSampleParentRecheck(id); - return success(BeanUtils.toBean(businessSubSampleParentRecheck, BusinessSubSampleParentRecheckRespVO.class)); + @PreAuthorize("@ss.hasPermission('qms:business-sub-sample-parent-retest:query')") + public CommonResult getBusinessSubSampleParentRetest(@RequestParam("id") Long id) { + BusinessSubSampleParentRetestDO businessSubSampleParentRetest = businessSubSampleParentRetestService.getBusinessSubSampleParentRetest(id); + return success(BeanUtils.toBean(businessSubSampleParentRetest, BusinessSubSampleParentRetestRespVO.class)); } @GetMapping("/page") - @Operation(summary = "获得分样复检业务数据分页") - @PreAuthorize("@ss.hasPermission('qms:business-sub-sample-parent-recheck:query')") - public CommonResult> getBusinessSubSampleParentRecheckPage(@Valid BusinessSubSampleParentRecheckPageReqVO pageReqVO) { - PageResult pageResult = businessSubSampleParentRecheckService.getBusinessSubSampleParentRecheckPage(pageReqVO); - return success(BeanUtils.toBean(pageResult, BusinessSubSampleParentRecheckRespVO.class)); + @Operation(summary = "获得分样复测业务数据分页") + @PreAuthorize("@ss.hasPermission('qms:business-sub-sample-parent-retest:query')") + public CommonResult> getBusinessSubSampleParentRetestPage(@Valid BusinessSubSampleParentRetestPageReqVO pageReqVO) { + PageResult pageResult = businessSubSampleParentRetestService.getBusinessSubSampleParentRetestPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, BusinessSubSampleParentRetestRespVO.class)); } @GetMapping("/export-excel") - @Operation(summary = "导出分样复检业务数据 Excel") - @PreAuthorize("@ss.hasPermission('qms:business-sub-sample-parent-recheck:export')") + @Operation(summary = "导出分样复测业务数据 Excel") + @PreAuthorize("@ss.hasPermission('qms:business-sub-sample-parent-retest:export')") @ApiAccessLog(operateType = EXPORT) - public void exportBusinessSubSampleParentRecheckExcel(@Valid BusinessSubSampleParentRecheckPageReqVO pageReqVO, + public void exportBusinessSubSampleParentRetestExcel(@Valid BusinessSubSampleParentRetestPageReqVO pageReqVO, HttpServletResponse response) throws IOException { pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); - List list = businessSubSampleParentRecheckService.getBusinessSubSampleParentRecheckPage(pageReqVO).getList(); + List list = businessSubSampleParentRetestService.getBusinessSubSampleParentRetestPage(pageReqVO).getList(); // 导出 Excel - ExcelUtils.write(response, "分样复检业务数据.xls", "数据", BusinessSubSampleParentRecheckRespVO.class, - BeanUtils.toBean(list, BusinessSubSampleParentRecheckRespVO.class)); + ExcelUtils.write(response, "分样复测业务数据.xls", "数据", BusinessSubSampleParentRetestRespVO.class, + BeanUtils.toBean(list, BusinessSubSampleParentRetestRespVO.class)); } } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleAnalysisAuditController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleAnalysisAuditController.java index 33884a3..c51e3be 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleAnalysisAuditController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleAnalysisAuditController.java @@ -8,6 +8,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import com.alibaba.fastjson2.JSONObject; +import com.zt.plat.framework.business.interceptor.BusinessControllerMarker; import com.zt.plat.framework.common.pojo.CommonResult; import com.zt.plat.module.qms.business.bus.controller.vo.*; import com.zt.plat.module.qms.business.bus.service.SampleAnalysisAuditService; @@ -25,17 +26,11 @@ import static com.zt.plat.framework.common.pojo.CommonResult.success; @RestController @RequestMapping("/qms/bus/sample/analysis-audit") @Validated -public class SampleAnalysisAuditController { +public class SampleAnalysisAuditController implements BusinessControllerMarker { @Resource private SampleAnalysisAuditService sampleAnalysisAuditService; - @GetMapping("/crossAuditByTaskId") - public CommonResult crossAuditByTaskId(Long businessAssayTaskId) { - JSONObject result = sampleAnalysisAuditService.crossAuditByTaskId(businessAssayTaskId); - return success(result); - } - /** * 交叉审核 * @return @@ -47,8 +42,8 @@ public class SampleAnalysisAuditController { } @GetMapping("/getSampleResultAssessmentList") - public CommonResult getSampleResultAssessmentList(Long configAssayMethodId, String asmtReportedStatus) { - JSONObject result = sampleAnalysisAuditService.getSampleResultAssessmentList(configAssayMethodId, asmtReportedStatus); + public CommonResult getSampleResultAssessmentList(BusinessAssayTaskDataReqVO reqVO) { + JSONObject result = sampleAnalysisAuditService.getSampleResultAssessmentList(reqVO); return success(result); } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleAnalysisController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleAnalysisController.java index 9fbe165..e11fec3 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleAnalysisController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleAnalysisController.java @@ -8,6 +8,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import com.alibaba.fastjson2.JSONObject; +import com.zt.plat.framework.business.interceptor.BusinessControllerMarker; import com.zt.plat.framework.common.pojo.CommonResult; import com.zt.plat.module.qms.business.bus.controller.vo.*; import com.zt.plat.module.qms.business.bus.service.SampleAnalysisService; @@ -23,17 +24,19 @@ import static com.zt.plat.framework.common.pojo.CommonResult.success; @RestController @RequestMapping("/qms/bus/sample/analysis") @Validated -public class SampleAnalysisController { +public class SampleAnalysisController implements BusinessControllerMarker { @Resource private SampleAnalysisService sampleAnalysisService ; + @Deprecated @GetMapping("/batchSampleAnalysisByTaskId") public CommonResult batchSampleAnalysisByTaskId(Long businessAssayTaskId) { BusinessAssayTaskAnalysisSampleProjectRespVO businessAssayTaskAnalysisSampleProject = sampleAnalysisService.batchSampleAnalysisByTaskId(businessAssayTaskId); return success(businessAssayTaskAnalysisSampleProject); } - + + @Deprecated @PostMapping("/saveBatchSampleAnalysis") public CommonResult saveBatchSampleAnalysis(@RequestBody BusinessAssayTaskAnalysisSampleProjectRespVO vo) { sampleAnalysisService.saveBatchSampleAnalysis(vo); diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleEntrustController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleEntrustController.java index 9d02c5b..5336a48 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleEntrustController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleEntrustController.java @@ -17,7 +17,7 @@ import org.springframework.web.bind.annotation.RestController; import com.alibaba.fastjson2.JSONObject; import com.yomahub.liteflow.core.FlowExecutor; import com.yomahub.liteflow.flow.LiteflowResponse; - +import com.zt.plat.framework.business.interceptor.BusinessControllerMarker; import com.zt.plat.framework.common.pojo.CommonResult; import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO; import com.zt.plat.module.qms.business.bus.controller.vo.*; @@ -34,7 +34,7 @@ import jakarta.validation.Valid; @RestController @RequestMapping("/qms/bus/sample/entrust") @Validated -public class SampleEntrustController { +public class SampleEntrustController implements BusinessControllerMarker { @Resource private FlowExecutor flowExecutor; @@ -59,14 +59,6 @@ public class SampleEntrustController { BusinessSampleEntrustRegistrationExtendRespVO sampleEntrustRegistration = sampleEntrustService.detail(id); return success(sampleEntrustRegistration); } - - @GetMapping("/reportDetail") - @Operation(summary = "委托单详情数据") - public CommonResult reportDetail(@RequestParam("id") Long id) { - JSONObject jsonObject = sampleEntrustService.reportDetail(id); - return success(jsonObject); - - } @PostMapping("/update") @Operation(summary = "修改委托登记") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleFlowController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleFlowController.java index 534d90f..c128dff 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleFlowController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleFlowController.java @@ -1,39 +1,30 @@ package com.zt.plat.module.qms.business.bus.controller.admin; -import java.util.ArrayList; -import java.util.List; - import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; -import com.alibaba.fastjson2.JSON; import com.yomahub.liteflow.core.FlowExecutor; import com.yomahub.liteflow.flow.LiteflowResponse; - +import com.zt.plat.framework.business.interceptor.BusinessControllerMarker; import com.zt.plat.framework.common.pojo.CommonResult; -import com.zt.plat.framework.common.util.object.BeanUtils; -import com.zt.plat.framework.tenant.core.context.TenantContextHolder; -import com.zt.plat.module.qms.business.bus.liteflow.param.SampleFlowInfo; import com.zt.plat.module.qms.business.bus.liteflow.param.SampleFlowParam; import com.zt.plat.module.qms.business.bus.liteflow.slot.SampleFlowContext; import com.zt.plat.module.qms.business.bus.service.SampleFlowService; -import com.zt.plat.module.qms.core.sampleflow.SampleFlowDefinition; -import com.zt.plat.module.qms.core.sampleflow.SampleFlowNode; +import com.zt.plat.module.qms.enums.QmsCommonConstant; + import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.annotation.Resource; import static com.zt.plat.framework.common.pojo.CommonResult.success; -import static com.zt.plat.framework.common.pojo.CommonResult.error; @Tag(name = "管理后台 - 样品流转") @RestController @RequestMapping("/qms/bus/sample/flow") @Validated -public class SampleFlowController { +public class SampleFlowController implements BusinessControllerMarker { @Resource private SampleFlowService sampleFlowService; @@ -45,138 +36,22 @@ public class SampleFlowController { public CommonResult sampleFlow(@Validated @RequestBody SampleFlowParam sampleFlowParam) { LiteflowResponse response = sampleFlowService.sampleFlow(sampleFlowParam); return success(response.getContextBean(SampleFlowContext.class)); - } - - @GetMapping("/test") - public CommonResult test() { - - SampleFlowDefinition sampleFlowDefinition = new SampleFlowDefinition(); - sampleFlowDefinition.setFlowKey("flw_sub_sample_process"); - sampleFlowDefinition.setFlowName("子样样品流转流程"); - List flowNodeList = new ArrayList<>(); - - SampleFlowNode zxr = new SampleFlowNode(); - zxr.setNodeName("中心收样"); - zxr.setNodeKey("flw_center_receive"); - zxr.setSort(3100); - - SampleFlowNode zxs = new SampleFlowNode(); - zxs.setNodeName("中心送样"); - zxs.setNodeKey("flw_center_send"); - zxs.setSort(3200); - - SampleFlowNode bzr = new SampleFlowNode(); - bzr.setNodeName("班组收样"); - bzr.setNodeKey("flw_team_receive"); - bzr.setSort(3300); - - SampleFlowNode ypbm = new SampleFlowNode(); - ypbm.setNodeName("样品编密"); - ypbm.setNodeKey("flw_sample_encrypt"); - ypbm.setSort(3400); - -// SampleFlowNode fxr = new SampleFlowNode(); -// fxr.setNodeName("分析收样"); -// fxr.setNodeKey("flw_analysis_receive"); -// fxr.setSort(3500); -// - SampleFlowNode fx = new SampleFlowNode(); - fx.setNodeName("样品分析"); - fx.setNodeKey("flw_analysis"); - fx.setSort(3550); -// -// SampleFlowNode fxs = new SampleFlowNode(); -// fxs.setNodeName("分析送样"); -// fxs.setNodeKey("flw_analysis_send"); -// fxs.setSort(3600); - - SampleFlowNode bzs = new SampleFlowNode(); - bzs.setNodeName("班组送样"); - bzs.setNodeKey("flw_team_send"); - bzs.setSort(3700); - - SampleFlowNode ypgk = new SampleFlowNode(); - ypgk.setNodeName("样品归库"); - ypgk.setNodeKey("flw_sample_storage"); - ypgk.setSort(3800); - ypgk.setNextFlowNodeList(null); - flowNodeList.add(ypgk); - - - zxr.setNextFlowNodeList(new ArrayList() { - { - add(BeanUtils.toBean(zxs,SampleFlowNode.class).setIsDefault(true)); - } - }); - flowNodeList.add(zxr); - - - zxs.setNextFlowNodeList(new ArrayList<>() {{ - add(BeanUtils.toBean(bzr,SampleFlowNode.class).setIsDefault(true)); - }}); - flowNodeList.add(zxs); - - bzr.setNextFlowNodeList(new ArrayList<>() {{ - add(BeanUtils.toBean(ypbm,SampleFlowNode.class).setCondition("subSampleEncrypt"));//样品需要编密并且没编密过 - add(BeanUtils.toBean(fx,SampleFlowNode.class).setCondition("subSampleNotEncrypt"));//样品无需编密或样品已编密过 - }}); - flowNodeList.add(bzr); - - - ypbm.setNextFlowNodeList(new ArrayList<>() {{ - add(BeanUtils.toBean(fx,SampleFlowNode.class).setIsDefault(true)); - }}); - flowNodeList.add(ypbm); - - -// fxr.setNextFlowNodeList(new ArrayList<>() {{ -// add(BeanUtils.toBean(fxs,SampleFlowNode.class).setIsDefault(true)); -// }}); -// flowNodeList.add(fxr); -// -// -// fxs.setNextFlowNodeList(new ArrayList<>() {{ -// add(BeanUtils.toBean(bzs,SampleFlowNode.class).setIsDefault(true).setCondition("当前部门任务已全部分析完")); -// }}); -// flowNodeList.add(fxs); - - fx.setNextFlowNodeList(new ArrayList<>() {{ - add(BeanUtils.toBean(bzs,SampleFlowNode.class).setIsDefault(true).setCondition("当前部门任务已全部分析完")); - }}); - flowNodeList.add(fx); - - bzs.setNextFlowNodeList(new ArrayList<>() {{ -// add(BeanUtils.toBean(fx,SampleFlowNode.class).setCondition("样品当前分析班组结果超差,需要发起复检")); - add(BeanUtils.toBean(bzr,SampleFlowNode.class).setCondition("subSampleSelfReportedOthersPending"));//当前部门数据已全部判断上报 - add(BeanUtils.toBean(ypgk,SampleFlowNode.class).setCondition("subSampleAlldeptAnalyzed"));//当前样品所有分析任务已全部上报完 - }}); - flowNodeList.add(bzs); - - sampleFlowDefinition.setFlowNodeList(flowNodeList); - - String jsonSampleFlowDefinition = JSON.toJSONString(sampleFlowDefinition); - - System.out.println(jsonSampleFlowDefinition); - - Long tenantId = TenantContextHolder.getRequiredTenantId(); - - List sampleFlowInfoList = new ArrayList<>(); - sampleFlowInfoList.add(new SampleFlowInfo().setId(1967550576457330690L).setIsWeighing(0)); - - SampleFlowParam sampleFlowParam = new SampleFlowParam(); - sampleFlowParam.setSampleSourceType(2); - sampleFlowParam.setCurrentSampleFlowKey("P3000"); - sampleFlowParam.setSampleFlowInfoList(sampleFlowInfoList); - - - - LiteflowResponse response = flowExecutor.execute2Resp("sampleFlowChain" + tenantId, sampleFlowParam, SampleFlowContext.class); - if (response.isSuccess()) { - return success(response.getContextBean(SampleFlowContext.class)); - } else { - return error(1_032_100_000, response.getMessage()); - } - //return success(FlowBus.getNodeMap()); - } + } + /** + * 中心收样并送样 + * @param sampleFlowParam + * @return + */ + @PostMapping("/centerReceiveAndSend") + public CommonResult centerReceiveAndSend(@Validated @RequestBody SampleFlowParam sampleFlowParam) { + //中心收样 + sampleFlowParam.setCurrentSampleFlowKey(QmsCommonConstant.FLOW_NODE_CENTER_RECEIVE); + LiteflowResponse response = sampleFlowService.sampleFlow(sampleFlowParam); + //中心送样 + sampleFlowParam.setCurrentSampleFlowKey(QmsCommonConstant.FLOW_NODE_CENTER_SEND); + sampleFlowParam.setSendSampleOper(null); + response = sampleFlowService.sampleFlow(sampleFlowParam); + return success(response.getContextBean(SampleFlowContext.class)); + } } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleReportDataQueryController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleReportDataQueryController.java new file mode 100644 index 0000000..fe7db94 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleReportDataQueryController.java @@ -0,0 +1,45 @@ +package com.zt.plat.module.qms.business.bus.controller.admin; + +import static com.zt.plat.framework.common.pojo.CommonResult.success; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import com.alibaba.fastjson2.JSONObject; +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.module.qms.business.bus.service.SampleAnalysisAuditService; +import com.zt.plat.module.qms.business.bus.service.SampleEntrustService; + +import io.swagger.v3.oas.annotations.Operation; +import jakarta.annotation.Resource; + +/** + * 报表数据查询接口,不继承BusinessControllerMarker + */ +@RestController +@RequestMapping("/qms/bus/sample/reporting-data-query") +public class SampleReportDataQueryController { + + @Resource + private SampleEntrustService sampleEntrustService; + + @Resource + private SampleAnalysisAuditService sampleAnalysisAuditService; + + @GetMapping("/entrust-report-detail") + @Operation(summary = "委托单详情数据") + public CommonResult reportDetail(@RequestParam("id") Long id) { + JSONObject jsonObject = sampleEntrustService.reportDetail(id); + return success(jsonObject); + + } + + @Operation(summary = "委托单详情数据") + @GetMapping("/crossAuditByTaskId") + public CommonResult crossAuditByTaskId(Long businessAssayTaskId) { + JSONObject result = sampleAnalysisAuditService.crossAuditByTaskId(businessAssayTaskId); + return success(result); + } +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleResultReportingController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleResultReportingController.java index ea4f0c1..4e0db17 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleResultReportingController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleResultReportingController.java @@ -6,6 +6,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import com.alibaba.fastjson2.JSONObject; +import com.zt.plat.framework.business.interceptor.BusinessControllerMarker; import com.zt.plat.framework.common.pojo.CommonResult; import com.zt.plat.module.qms.business.bus.controller.vo.*; import com.zt.plat.module.qms.business.bus.service.SampleResultReportingService; @@ -28,7 +29,7 @@ import org.springframework.web.bind.annotation.RequestBody; @RestController @RequestMapping("/qms/bus/sample/result-reporting") @Validated -public class SampleResultReportingController { +public class SampleResultReportingController implements BusinessControllerMarker { @Resource private SampleResultReportingService sampleResultReportingService; @@ -42,8 +43,8 @@ public class SampleResultReportingController { //获取方法对应的样品 @GetMapping("/getSampleResultReportingList") - public CommonResult getSampleResultReportingList(Long configAssayMethodId) { - JSONObject result = sampleResultReportingService.getSampleResultReportingList(configAssayMethodId); + public CommonResult getSampleResultReportingList(BusinessSubParentSampleAssessmentGroupReqVO reqVO) { + JSONObject result = sampleResultReportingService.getSampleResultReportingList(reqVO); return success(result); } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleTaskAssignController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleTaskAssignController.java index f9db69b..a5e6ae5 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleTaskAssignController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleTaskAssignController.java @@ -9,8 +9,10 @@ import org.springframework.web.bind.annotation.RestController; import static com.zt.plat.framework.common.pojo.CommonResult.success; +import java.util.Arrays; import java.util.List; +import com.zt.plat.framework.business.interceptor.BusinessControllerMarker; import com.zt.plat.framework.common.pojo.CommonResult; import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO; import com.zt.plat.module.qms.business.bus.controller.vo.*; @@ -19,6 +21,8 @@ import com.zt.plat.module.qms.business.bus.liteflow.param.SampleTaskAssignMethod import com.zt.plat.module.qms.business.bus.liteflow.param.SampleTaskAssignSampleParam; import com.zt.plat.module.qms.business.bus.service.SampleTaskAssignService; import com.zt.plat.module.system.api.user.dto.AdminUserRespDTO; + +import cn.hutool.core.collection.CollUtil; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.annotation.Resource; @@ -27,7 +31,7 @@ import jakarta.annotation.Resource; @RestController @RequestMapping("/qms/bus/sample/task-assign") @Validated -public class SampleTaskAssignController { +public class SampleTaskAssignController implements BusinessControllerMarker { @Resource private SampleTaskAssignService sampleTaskAssignService; @@ -38,6 +42,13 @@ public class SampleTaskAssignController { List list = sampleTaskAssignService.getAssignUserList(); return success(list); } + + @Operation(description = "根据用户id获取用户信息") + @GetMapping("/getUserInfoById") + public CommonResult getUserInfoById(Long userId) { + AdminUserRespDTO userRespDTO = sampleTaskAssignService.getUserInfoById(userId); + return success(userRespDTO); + } @GetMapping("/getAssaySampleList") public CommonResult getAssaySampleList(BusinessAssayTaskDataReqVO reqVO) { @@ -45,9 +56,17 @@ public class SampleTaskAssignController { return success(list); } - @GetMapping("/getAssayMethodList") - public CommonResult getAssayMethodList(Long businessSubSampleId, Long configAssayMethodId) { - List list = sampleTaskAssignService.getAssayMethodList(businessSubSampleId, configAssayMethodId); + @GetMapping("/getAssayMethodProjectList") + public CommonResult getAssayMethodProjectList(String businessSubSampleIds, Long configAssayMethodId) { + List businessSubSampleIdList = Arrays.asList(businessSubSampleIds.split(",")).stream().map(Long::parseLong).toList(); + List list = sampleTaskAssignService.getAssayMethodProjectList(businessSubSampleIdList, configAssayMethodId); + return success(list); + } + + @GetMapping("/getMaterialAssayStandardMethodProjectList") + public CommonResult getMaterialAssayStandardMethodProjectList(String businessSubSampleIds, Long baseSampleId, Long configAssayMethodId) { + List businessSubSampleIdList = Arrays.asList(businessSubSampleIds.split(",")).stream().map(Long::parseLong).toList(); + List list = sampleTaskAssignService.getMaterialAssayStandardMethodProjectList(businessSubSampleIdList, baseSampleId, configAssayMethodId); return success(list); } @@ -99,6 +118,11 @@ public class SampleTaskAssignController { return success("成功"); } + /** + * 作废 + * @param id + * @return + */ @PostMapping("/voidAssign") public CommonResult voidAssign(Long id) { sampleTaskAssignService.voidAssign(id); diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/TestController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/TestController.java new file mode 100644 index 0000000..372c7f4 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/TestController.java @@ -0,0 +1,155 @@ +package com.zt.plat.module.qms.business.bus.controller.admin; + +import static com.zt.plat.framework.common.pojo.CommonResult.success; + +import java.util.ArrayList; +import java.util.List; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import com.alibaba.fastjson2.JSON; +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.framework.common.util.object.BeanUtils; +import com.zt.plat.module.qms.core.sampleflow.SampleFlowDefinition; +import com.zt.plat.module.qms.core.sampleflow.SampleFlowNode; + + +@RestController +@RequestMapping("/qms/bus/test") +public class TestController { + + + @GetMapping("/testSampleFlow") + public CommonResult testSampleFlow() { + + SampleFlowDefinition sampleFlowDefinition = new SampleFlowDefinition(); + sampleFlowDefinition.setFlowKey("flw_sub_sample_process"); + sampleFlowDefinition.setFlowName("子样样品流转流程"); + List flowNodeList = new ArrayList<>(); + + SampleFlowNode zxr = new SampleFlowNode(); + zxr.setNodeName("中心收样"); + zxr.setNodeKey("flw_center_receive"); + zxr.setSort(3100); + + SampleFlowNode zxs = new SampleFlowNode(); + zxs.setNodeName("中心送样"); + zxs.setNodeKey("flw_center_send"); + zxs.setSort(3200); + + SampleFlowNode bzr = new SampleFlowNode(); + bzr.setNodeName("班组收样"); + bzr.setNodeKey("flw_team_receive"); + bzr.setSort(3300); + + SampleFlowNode ypbm = new SampleFlowNode(); + ypbm.setNodeName("样品编密"); + ypbm.setNodeKey("flw_sample_encrypt"); + ypbm.setSort(3400); + +// SampleFlowNode fxr = new SampleFlowNode(); +// fxr.setNodeName("分析收样"); +// fxr.setNodeKey("flw_analysis_receive"); +// fxr.setSort(3500); +// + SampleFlowNode fx = new SampleFlowNode(); + fx.setNodeName("样品分析"); + fx.setNodeKey("flw_analysis"); + fx.setSort(3550); +// +// SampleFlowNode fxs = new SampleFlowNode(); +// fxs.setNodeName("分析送样"); +// fxs.setNodeKey("flw_analysis_send"); +// fxs.setSort(3600); + + SampleFlowNode bzs = new SampleFlowNode(); + bzs.setNodeName("班组送样"); + bzs.setNodeKey("flw_team_send"); + bzs.setSort(3700); + + SampleFlowNode ypgk = new SampleFlowNode(); + ypgk.setNodeName("样品归库"); + ypgk.setNodeKey("flw_sample_storage"); + ypgk.setSort(3800); + ypgk.setNextFlowNodeList(null); + flowNodeList.add(ypgk); + + + zxr.setNextFlowNodeList(new ArrayList() { + private static final long serialVersionUID = 6146393613606839512L; + + { + add(BeanUtils.toBean(zxs,SampleFlowNode.class).setIsDefault(true)); + } + }); + flowNodeList.add(zxr); + + + zxs.setNextFlowNodeList(new ArrayList<>() { + private static final long serialVersionUID = 5357543125760924047L; + + { + add(BeanUtils.toBean(bzr,SampleFlowNode.class).setIsDefault(true)); + }}); + flowNodeList.add(zxs); + + bzr.setNextFlowNodeList(new ArrayList<>() { + private static final long serialVersionUID = 6376704859477839016L; + + { + add(BeanUtils.toBean(ypbm,SampleFlowNode.class).setCondition("subSampleEncrypt"));//样品需要编密并且没编密过 + add(BeanUtils.toBean(fx,SampleFlowNode.class).setCondition("subSampleNotEncrypt"));//样品无需编密或样品已编密过 + }}); + flowNodeList.add(bzr); + + + ypbm.setNextFlowNodeList(new ArrayList<>() { + private static final long serialVersionUID = 1014984817516902869L; + + { + add(BeanUtils.toBean(fx,SampleFlowNode.class).setIsDefault(true)); + }}); + flowNodeList.add(ypbm); + + +// fxr.setNextFlowNodeList(new ArrayList<>() {{ +// add(BeanUtils.toBean(fxs,SampleFlowNode.class).setIsDefault(true)); +// }}); +// flowNodeList.add(fxr); +// +// +// fxs.setNextFlowNodeList(new ArrayList<>() {{ +// add(BeanUtils.toBean(bzs,SampleFlowNode.class).setIsDefault(true).setCondition("当前部门任务已全部分析完")); +// }}); +// flowNodeList.add(fxs); + + fx.setNextFlowNodeList(new ArrayList<>() { + private static final long serialVersionUID = -610440034210287957L; + + { + add(BeanUtils.toBean(bzs,SampleFlowNode.class).setIsDefault(true).setCondition("当前部门任务已全部分析完")); + }}); + flowNodeList.add(fx); + + bzs.setNextFlowNodeList(new ArrayList<>() { + private static final long serialVersionUID = -5057434004685743838L; + + { +// add(BeanUtils.toBean(fx,SampleFlowNode.class).setCondition("样品当前分析班组结果超差,需要发起复检")); + add(BeanUtils.toBean(bzr,SampleFlowNode.class).setCondition("subSampleSelfReportedOthersPending"));//当前部门数据已全部判断上报 + add(BeanUtils.toBean(ypgk,SampleFlowNode.class).setCondition("subSampleAlldeptAnalyzed"));//当前样品所有分析任务已全部上报完 + }}); + flowNodeList.add(bzs); + + sampleFlowDefinition.setFlowNodeList(flowNodeList); + + String jsonSampleFlowDefinition = JSON.toJSONString(sampleFlowDefinition); + + System.out.println(jsonSampleFlowDefinition); + + return success(jsonSampleFlowDefinition); + } + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/AssayMethodProjectRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/AssayMethodProjectRespVO.java new file mode 100644 index 0000000..95fba2d --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/AssayMethodProjectRespVO.java @@ -0,0 +1,28 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import java.util.List; + +import com.zt.plat.module.qms.business.config.controller.vo.ConfigAssayMethodProjectExtendRespVO; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class AssayMethodProjectRespVO { + + private Long dictionaryProjectId; + + private String dictionaryProjectName; + + private String dictionaryProjectSimpleName; + + private String dictionaryProjectShowName; + + private Long configAssayMethodId; + + private String configAssayMethodName; + + @Schema(description = "检测方法配置名称及类别") + private String configAssayMethodNameAndCategory; + + private List methodList; +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayParameterDataReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayParameterDataReqVO.java index 37ec882..ad12c4f 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayParameterDataReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayParameterDataReqVO.java @@ -44,4 +44,7 @@ public class BusinessAssayParameterDataReqVO { @Schema(description = "备注") private String remark; + //===================扩展字段==================== + @Schema(description = "检测项目业务ID列表") + private List businessAssayProjectDataIdList; } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayProjectAndParameterRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayProjectAndParameterRespVO.java index ce9ac89..aa9dcd4 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayProjectAndParameterRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayProjectAndParameterRespVO.java @@ -16,6 +16,9 @@ public class BusinessAssayProjectAndParameterRespVO implements Serializable { /** id主键 **/ private Long id; + /** 业务数据id 如:T_BSN_ASY_PRJ_DAT表,则为BSN_ASY_TSK_DAT_ID,T_BSN_ASY_PRM_DAT表,则为BSN_ASY_PRJ_DAT_ID **/ + private Long bizId; + /** 元素或参数字典id **/ private Long dicId; @@ -42,6 +45,10 @@ public class BusinessAssayProjectAndParameterRespVO implements Serializable { /** 结果值 **/ @Schema(description = "结果值") private String value; + + /** 符号,=、>、<、等 **/ + @Schema(description = "符号,=、>、<、等") + private String symbol; @Schema(description = "是否允许为空") private Integer isNull; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayProjectDataExtendRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayProjectDataExtendRespVO.java index 397744f..7017e24 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayProjectDataExtendRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayProjectDataExtendRespVO.java @@ -44,7 +44,10 @@ public class BusinessAssayProjectDataExtendRespVO extends BusinessAssayProjectDa @Schema(description = "单位") private String dictionaryProjectUnit; - - @Schema(description = "分析次数") - private Integer analysisCount; + + @Schema(description = "复检次数") + private Integer recheckCount; + + @Schema(description = "复测次数") + private Integer retestCount; } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataExtendRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataExtendRespVO.java index 0958e76..c20e850 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataExtendRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataExtendRespVO.java @@ -18,6 +18,9 @@ public class BusinessAssayTaskDataExtendRespVO extends BusinessAssayTaskDataResp @Schema(description = "分析方法名称") private String configAssayMethodName; + @Schema(description = "检测方法配置名称及类别") + private String configAssayMethodNameAndCategory; + @Schema(description = "子样配置id") private Long configSubSampleId; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataGroupRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataGroupRespVO.java index 98186e0..4ca5669 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataGroupRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataGroupRespVO.java @@ -5,9 +5,16 @@ import lombok.Data; @Data public class BusinessAssayTaskDataGroupRespVO { + /** 方法id **/ private Long configAssayMethodId; + /** 方法名称 **/ private String configAssayMethodName; + + private String configAssayMethodDictionaryBusinessKey; + + /** 方法名称及类别 **/ + private String configAssayMethodNameAndCategory; private String assayType; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataPageReqVO.java index ff1e6a3..f3e993d 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataPageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataPageReqVO.java @@ -82,8 +82,11 @@ public class BusinessAssayTaskDataPageReqVO extends PageParam { @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] sampleFlowNodeTime; - @Schema(description = "分析次数,复检的累加次数", example = "13073") - private Integer analysisCount; + @Schema(description = "复检次数", example = "7312") + private Integer recheckCount; + + @Schema(description = "复测次数", example = "28081") + private Integer retestCount; @Schema(description = "乐观锁", example = "11435") private Integer updateCount; @@ -98,4 +101,8 @@ public class BusinessAssayTaskDataPageReqVO extends PageParam { @Schema(description = "备注") private String remark; + //===================================扩展字段=============================================== + + @Schema(description = "样品状态") + private String sampleStatus; } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataReqVO.java index c9064d3..2b07b19 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataReqVO.java @@ -1,9 +1,7 @@ package com.zt.plat.module.qms.business.bus.controller.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; @@ -82,8 +80,11 @@ public class BusinessAssayTaskDataReqVO { @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] sampleFlowNodeTime; - @Schema(description = "分析次数,复检的累加次数", example = "13073") - private Integer analysisCount; + @Schema(description = "复检次数", example = "7312") + private Integer recheckCount; + + @Schema(description = "复测次数", example = "28081") + private Integer retestCount; @Schema(description = "乐观锁", example = "11435") private Integer updateCount; @@ -101,6 +102,29 @@ public class BusinessAssayTaskDataReqVO { //=== 扩展字段,判定上报状态 @Schema(description = "判定上报状态") private String asmtReportedStatus; - + @Schema(description = "样品状态") + private String sampleStatus; + + @Schema(description = "检测方法配置名称") + private String configAssayMethodName; + + @Schema(description = "检测方法配置名称及类别") + private String configAssayMethodNameAndCategory; + + @Schema(description = "收样时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] sampleReceiveTime; + + @Schema(description = "样品编号") + private String sampleCode; + + @Schema(description = "样品名称") + private String sampleName; + + @Schema(description = "分析编号") + private String sampleAssayCode; + + @Schema(description = "归库编号") + private String sampleReturnCode; } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataRespVO.java index 40b3b8b..a816ec3 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataRespVO.java @@ -103,9 +103,13 @@ public class BusinessAssayTaskDataRespVO { @ExcelProperty("样品流程节点时间") private LocalDateTime sampleFlowNodeTime; - @Schema(description = "分析次数,复检的累加次数", requiredMode = Schema.RequiredMode.REQUIRED, example = "13073") - @ExcelProperty("分析次数,复检的累加次数") - private Integer analysisCount; + @Schema(description = "复检次数", example = "7312") + @ExcelProperty("复测次数") + private Integer recheckCount; + + @Schema(description = "复测次数", example = "28081") + @ExcelProperty("复测次数") + private Integer retestCount; @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "11435") @ExcelProperty("乐观锁") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataSaveReqVO.java index 7e2bf4c..bf51bf5 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataSaveReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataSaveReqVO.java @@ -90,9 +90,11 @@ public class BusinessAssayTaskDataSaveReqVO { @NotNull(message = "样品流程节点时间不能为空") private LocalDateTime sampleFlowNodeTime; - @Schema(description = "分析次数,复检的累加次数", requiredMode = Schema.RequiredMode.REQUIRED, example = "13073") - @NotNull(message = "分析次数,复检的累加次数不能为空") - private Integer analysisCount; + @Schema(description = "复检次数", example = "7312") + private Integer recheckCount; + + @Schema(description = "复测次数", example = "28081") + private Integer retestCount; @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "11435") private Integer updateCount; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskExtendRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskExtendRespVO.java index 7ed693e..6167eb9 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskExtendRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskExtendRespVO.java @@ -4,6 +4,7 @@ import java.util.List; import com.zt.plat.module.qms.business.config.controller.vo.ConfigQCSampleMethodExtendRespVO; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; /** @@ -20,10 +21,16 @@ import lombok.Data; */ @Data public class BusinessAssayTaskExtendRespVO extends BusinessAssayTaskRespVO { + + /** 任务单数据类型,横向:horizontal,纵向:‌vertical **/ + private String reportDataType; /** 分析方法名称 **/ private String configAssayMethodName; + @Schema(description = "检测方法配置名称及类别") + private String configAssayMethodNameAndCategory; + /** 分析方法对应的分析项目 **/ private String configAssayMethodProjectShowNames; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskPageReqVO.java index cbdade7..3d62df8 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskPageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskPageReqVO.java @@ -100,10 +100,10 @@ public class BusinessAssayTaskPageReqVO extends PageParam { @Schema(description = "签名信息") private String documentSignature; - @Schema(description = "完成状态,未开始-not_start、审核中-running、已退回-returned、已通过-approved", example = "2") + @Schema(description = "完成状态,未开始-not_start、审核中-in_progress、已退回-returned、已通过-completed", example = "2") private String finishStatus; - @Schema(description = "流程状态,未开始-not_start、审核中-running、已退回-returned、已通过-approved", example = "1") + @Schema(description = "流程状态,未开始-not_start、审核中-in_progress、已退回-returned、已通过-completed", example = "1") private String flowStatus; @Schema(description = "所属部门") @@ -121,4 +121,13 @@ public class BusinessAssayTaskPageReqVO extends PageParam { @Schema(description = "部门id") private Long deptId; + + //=========扩展字段========== + + /** 分析方法名称 **/ + @Schema(description = "分析方法") + private String configAssayMethodName; + + @Schema(description = "检测方法配置名称及类别") + private String configAssayMethodNameAndCategory; } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskParameterDataPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskParameterDataPageReqVO.java new file mode 100644 index 0000000..c14ae8a --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskParameterDataPageReqVO.java @@ -0,0 +1,44 @@ +package com.zt.plat.module.qms.business.bus.controller.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 BusinessAssayTaskParameterDataPageReqVO extends PageParam { + + @Schema(description = "检测任务ID", example = "11383") + private Long businessAssayTaskDataId; + + @Schema(description = "检测方法参数配置ID", example = "9000") + private Long configAssayMethodParameterId; + + @Schema(description = "值") + private String value; + + @Schema(description = "数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间", example = "1") + private String dataType; + + @Schema(description = "小数位") + private Integer decimalPosition; + + @Schema(description = "乐观锁", example = "3750") + private Integer updateCount; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskParameterDataRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskParameterDataRespVO.java new file mode 100644 index 0000000..120708d --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskParameterDataRespVO.java @@ -0,0 +1,55 @@ +package com.zt.plat.module.qms.business.bus.controller.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 BusinessAssayTaskParameterDataRespVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "2727") + @ExcelProperty("ID") + private Long id; + + @Schema(description = "检测任务ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "11383") + @ExcelProperty("检测任务ID") + private Long businessAssayTaskDataId; + + @Schema(description = "检测方法参数配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "9000") + @ExcelProperty("检测方法参数配置ID") + private Long configAssayMethodParameterId; + + @Schema(description = "值") + @ExcelProperty("值") + private String value; + + @Schema(description = "数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") + @ExcelProperty("数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间") + private String dataType; + + @Schema(description = "小数位") + @ExcelProperty("小数位") + private Integer decimalPosition; + + @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "3750") + @ExcelProperty("乐观锁") + private Integer updateCount; + + @Schema(description = "所属部门") + @ExcelProperty("所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") + private LocalDateTime createTime; + + @Schema(description = "备注") + @ExcelProperty("备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskParameterDataSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskParameterDataSaveReqVO.java new file mode 100644 index 0000000..39a18c4 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskParameterDataSaveReqVO.java @@ -0,0 +1,43 @@ +package com.zt.plat.module.qms.business.bus.controller.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 BusinessAssayTaskParameterDataSaveReqVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "2727") + private Long id; + + @Schema(description = "检测任务ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "11383") + @NotNull(message = "检测任务ID不能为空") + private Long businessAssayTaskDataId; + + @Schema(description = "检测方法参数配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "9000") + @NotNull(message = "检测方法参数配置ID不能为空") + private Long configAssayMethodParameterId; + + @Schema(description = "值") + private String value; + + @Schema(description = "数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") + @NotEmpty(message = "数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间不能为空") + private String dataType; + + @Schema(description = "小数位") + private Integer decimalPosition; + + @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "3750") + @NotNull(message = "乐观锁不能为空") + private Integer updateCount; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskReqVO.java index 3767ed4..0ae445f 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskReqVO.java @@ -99,10 +99,10 @@ public class BusinessAssayTaskReqVO { @Schema(description = "签名信息") private String documentSignature; - @Schema(description = "完成状态,未开始-not_start、审核中-running、已退回-returned、已通过-approved", example = "2") + @Schema(description = "完成状态,未开始-not_start、审核中-in_progress、已退回-returned、已通过-completed", example = "2") private String finishStatus; - @Schema(description = "流程状态,未开始-not_start、审核中-running、已退回-returned、已通过-approved", example = "1") + @Schema(description = "流程状态,未开始-not_start、审核中-in_progress、已退回-returned、已通过-completed", example = "1") private String flowStatus; @Schema(description = "所属部门") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskRespVO.java index a31f6ed..a6c9999 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskRespVO.java @@ -4,6 +4,7 @@ import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; import java.time.LocalDateTime; import com.alibaba.excel.annotation.*; +import com.zt.plat.module.qms.core.aspect.annotation.Dict; @Schema(description = "管理后台 - 检测任务分配业务 Response VO") @Data @@ -116,12 +117,13 @@ public class BusinessAssayTaskRespVO { @ExcelProperty("签名信息") private String documentSignature; - @Schema(description = "完成状态,未开始-not_start、审核中-running、已退回-returned、已通过-approved", example = "2") - @ExcelProperty("完成状态,未开始-not_start、审核中-running、已退回-returned、已通过-approved") + @Schema(description = "完成状态,未开始-not_start、审核中-in_progress、已退回-returned、已通过-completed", example = "2") + @ExcelProperty("完成状态,未开始-not_start、审核中-in_progress、已退回-returned、已通过-completed") private String finishStatus; - @Schema(description = "流程状态,未开始-not_start、审核中-running、已退回-returned、已通过-approved", example = "1") - @ExcelProperty("流程状态,未开始-not_start、审核中-running、已退回-returned、已通过-approved") + @Dict(dicCode = "flow_status") + @Schema(description = "流程状态,未开始-not_start、审核中-in_progress、已退回-returned、已通过-completed", example = "1") + @ExcelProperty("流程状态,未开始-not_start、审核中-in_progress、已退回-returned、已通过-completed") private String flowStatus; @Schema(description = "所属部门") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskSaveReqVO.java index fb95ba7..b00fc07 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskSaveReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskSaveReqVO.java @@ -102,10 +102,10 @@ public class BusinessAssayTaskSaveReqVO { @Schema(description = "签名信息") private String documentSignature; - @Schema(description = "完成状态,未开始-not_start、审核中-running、已退回-returned、已通过-approved", example = "2") + @Schema(description = "完成状态,未开始-not_start、审核中-in_progress、已退回-returned、已通过-completed", example = "2") private String finishStatus; - @Schema(description = "流程状态,未开始-not_start、审核中-running、已退回-returned、已通过-approved", example = "1") + @Schema(description = "流程状态,未开始-not_start、审核中-in_progress、已退回-returned、已通过-completed", example = "1") private String flowStatus; @Schema(description = "所属部门") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessHandoverRecordSubPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessHandoverRecordSubPageReqVO.java index 783c9a5..b73c46e 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessHandoverRecordSubPageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessHandoverRecordSubPageReqVO.java @@ -64,5 +64,16 @@ public class BusinessHandoverRecordSubPageReqVO extends PageParam { @Schema(description = "备注") private String remark; + //==============扩展字段================ + private Long deptId; + + @Schema(description = "分析编号") + private String sampleAssayCode; + + @Schema(description = "归库编号") + private String sampleReturnCode; + + @Schema(description = "样品名称") + private String sampleName; } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCCoefficientDataExtendRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCCoefficientDataExtendRespVO.java new file mode 100644 index 0000000..3a55146 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCCoefficientDataExtendRespVO.java @@ -0,0 +1,16 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import lombok.Data; + +@Data +public class BusinessQCCoefficientDataExtendRespVO extends BusinessQCCoefficientDataRespVO { + + private String dictionaryBusinessName; + + private String parentDictionaryBusinessId; + + private String parentDictionaryBusinessName; + + private String parentDictionaryBusinesskey; + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCManagementDataExtendRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCManagementDataExtendRespVO.java new file mode 100644 index 0000000..bdf61b8 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCManagementDataExtendRespVO.java @@ -0,0 +1,16 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import lombok.Data; + +@Data +public class BusinessQCManagementDataExtendRespVO extends BusinessQCManagementDataRespVO { + + private String dictionaryBusinessName; + + private String parentDictionaryBusinessId; + + private String parentDictionaryBusinessName; + + private String parentDictionaryBusinesskey; + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCManagementSampleParameterDataPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCManagementSampleParameterDataPageReqVO.java new file mode 100644 index 0000000..7232a34 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCManagementSampleParameterDataPageReqVO.java @@ -0,0 +1,44 @@ +package com.zt.plat.module.qms.business.bus.controller.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 = "管理后台 - 质控管理样检测任务参数业务表,与子样检测任务参数业务表T_BSN_ASY_TSK_PRM_DAT一样,针对标准样、管理样、质控样、监控样等样品的参数分页 Request VO") +@Data +public class BusinessQCManagementSampleParameterDataPageReqVO extends PageParam { + + @Schema(description = "质控管理样检测任务ID", example = "100") + private Long businessQCManagementDataId; + + @Schema(description = "检测方法参数配置ID", example = "10419") + private Long configAssayMethodParameterId; + + @Schema(description = "值") + private String value; + + @Schema(description = "数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间", example = "2") + private String dataType; + + @Schema(description = "小数位") + private Integer decimalPosition; + + @Schema(description = "乐观锁", example = "2766") + private Integer updateCount; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCManagementSampleParameterDataRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCManagementSampleParameterDataRespVO.java new file mode 100644 index 0000000..c98d8f1 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCManagementSampleParameterDataRespVO.java @@ -0,0 +1,55 @@ +package com.zt.plat.module.qms.business.bus.controller.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 = "管理后台 - 质控管理样检测任务参数业务表,与子样检测任务参数业务表T_BSN_ASY_TSK_PRM_DAT一样,针对标准样、管理样、质控样、监控样等样品的参数 Response VO") +@Data +@ExcelIgnoreUnannotated +public class BusinessQCManagementSampleParameterDataRespVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1205") + @ExcelProperty("ID") + private Long id; + + @Schema(description = "质控管理样检测任务ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "100") + @ExcelProperty("质控管理样检测任务ID") + private Long businessQCManagementDataId; + + @Schema(description = "检测方法参数配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "10419") + @ExcelProperty("检测方法参数配置ID") + private Long configAssayMethodParameterId; + + @Schema(description = "值") + @ExcelProperty("值") + private String value; + + @Schema(description = "数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") + @ExcelProperty("数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间") + private String dataType; + + @Schema(description = "小数位") + @ExcelProperty("小数位") + private Integer decimalPosition; + + @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "2766") + @ExcelProperty("乐观锁") + private Integer updateCount; + + @Schema(description = "所属部门") + @ExcelProperty("所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") + private LocalDateTime createTime; + + @Schema(description = "备注") + @ExcelProperty("备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCManagementSampleParameterDataSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCManagementSampleParameterDataSaveReqVO.java new file mode 100644 index 0000000..130879b --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCManagementSampleParameterDataSaveReqVO.java @@ -0,0 +1,43 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import jakarta.validation.constraints.*; + +@Schema(description = "管理后台 - 质控管理样检测任务参数业务表,与子样检测任务参数业务表T_BSN_ASY_TSK_PRM_DAT一样,针对标准样、管理样、质控样、监控样等样品的参数新增/修改 Request VO") +@Data +public class BusinessQCManagementSampleParameterDataSaveReqVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1205") + private Long id; + + @Schema(description = "质控管理样检测任务ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "100") + @NotNull(message = "质控管理样检测任务ID不能为空") + private Long businessQCManagementDataId; + + @Schema(description = "检测方法参数配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "10419") + @NotNull(message = "检测方法参数配置ID不能为空") + private Long configAssayMethodParameterId; + + @Schema(description = "值") + private String value; + + @Schema(description = "数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") + @NotEmpty(message = "数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间不能为空") + private String dataType; + + @Schema(description = "小数位") + private Integer decimalPosition; + + @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "2766") + @NotNull(message = "乐观锁不能为空") + private Integer updateCount; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleEntrustDetailExtendRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleEntrustDetailExtendRespVO.java index 18c741e..05eb841 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleEntrustDetailExtendRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleEntrustDetailExtendRespVO.java @@ -17,6 +17,11 @@ import lombok.Data; @Data public class BusinessSampleEntrustDetailExtendRespVO extends BusinessSampleEntrustDetailRespVO { + /** + * 样品类型key + */ + private String sampleTypeDictionaryBusinessKey; + /** 样品大类名称 **/ private String baseSampleName; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleEntrustRegistrationPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleEntrustRegistrationPageReqVO.java index 26e7757..a5dc088 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleEntrustRegistrationPageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleEntrustRegistrationPageReqVO.java @@ -156,4 +156,7 @@ public class BusinessSampleEntrustRegistrationPageReqVO extends PageParam { //====================扩展字段====================== @Schema(description = "委托来源名称") private String configEntrustSourceName; + + @Schema(description = "报表配置id") + private Long configReportTypeId; } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleEntrustRegistrationRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleEntrustRegistrationRespVO.java index 2d33f95..918b195 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleEntrustRegistrationRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleEntrustRegistrationRespVO.java @@ -6,6 +6,7 @@ import java.util.*; import org.springframework.format.annotation.DateTimeFormat; import java.time.LocalDateTime; import com.alibaba.excel.annotation.*; +import com.zt.plat.module.qms.core.aspect.annotation.Dict; @Schema(description = "管理后台 - 委检登记业务 Response VO") @Data @@ -144,10 +145,12 @@ public class BusinessSampleEntrustRegistrationRespVO { @ExcelProperty("数据校验状态,success-数据校验成功、fail-数据校验失败") private String dataCheckStatus; + @Dict(dicCode = "entrust_assay_status") @Schema(description = "检验状态,unchecked-未检验;checked-已检验", example = "2") @ExcelProperty("检验状态,unchecked-未检验;checked-已检验") private String assayStatus; + @Dict(dicCode = "entrust_data_status") @Schema(description = "数据回报状态,unreturned-未回报;returned-已回报", example = "1") @ExcelProperty("数据回报状态,unreturned-未回报;returned-已回报") private String dataStatus; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleAssessmentExtendRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleAssessmentExtendRespVO.java index 7ca9494..1d1e605 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleAssessmentExtendRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleAssessmentExtendRespVO.java @@ -5,6 +5,12 @@ import lombok.Data; @Data public class BusinessSubParentSampleAssessmentExtendRespVO extends BusinessSubParentSampleAssessmentRespVO { + + @Schema(description = "主样id") + private Long businessBaseSampleId; + + @Schema(description = "分样配置id") + private Long configSubSampleParentId; @Schema(description = "检测项目key") private String dictionaryProjectKey; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleAssessmentGroupReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleAssessmentGroupReqVO.java index 8df8634..1e92715 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleAssessmentGroupReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleAssessmentGroupReqVO.java @@ -1,5 +1,11 @@ package com.zt.plat.module.qms.business.bus.controller.vo; +import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +import java.time.LocalDateTime; + +import org.springframework.format.annotation.DateTimeFormat; + import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; @@ -11,10 +17,17 @@ public class BusinessSubParentSampleAssessmentGroupReqVO { @Schema(description = "分析方法名称") private String configAssayMethodName; + + @Schema(description = "检测方法配置名称及类别") + private String configAssayMethodNameAndCategory; @Schema(description = "分析部门ID") private Long assayDepartmentId; @Schema(description = "分析部门名称") private String assayDepartmentName; + + @Schema(description = "收样时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] sampleReceiveTime; } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleAssessmentGroupRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleAssessmentGroupRespVO.java index f4f69cf..12e1806 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleAssessmentGroupRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleAssessmentGroupRespVO.java @@ -9,8 +9,14 @@ public class BusinessSubParentSampleAssessmentGroupRespVO { @Schema(description = "分析方法id") private Long configAssayMethodId; + @Schema(description = "方法大类") + private String configAssayMethodDictionaryBusinessKey; + @Schema(description = "分析方法名称") private String configAssayMethodName; + + @Schema(description = "检测方法配置名称及类别") + private String configAssayMethodNameAndCategory; @Schema(description = "分析部门ID") private Long assayDepartmentId; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleAssessmentPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleAssessmentPageReqVO.java index b52abe4..68589c9 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleAssessmentPageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleAssessmentPageReqVO.java @@ -28,6 +28,9 @@ public class BusinessSubParentSampleAssessmentPageReqVO extends PageParam { @Schema(description = "判定状态,in_progress-进行中 normal-正常", example = "1") private String assessmentStatus; + @Schema(description = "复测次数", example = "28081") + private Integer retestCount; + @Schema(description = "是否已上报") private Integer isReported; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleAssessmentProjectExtendRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleAssessmentProjectExtendRespVO.java index 8d6001e..ef8bf49 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleAssessmentProjectExtendRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleAssessmentProjectExtendRespVO.java @@ -5,6 +5,9 @@ import lombok.Data; @Data public class BusinessSubParentSampleAssessmentProjectExtendRespVO extends BusinessSubParentSampleAssessmentProjectRespVO { + + @Schema(description = "复测次数") + private Integer retestCount; @Schema(description = "检测项目key") private String dictionaryProjectKey; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleAssessmentProjectPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleAssessmentProjectPageReqVO.java index b284293..c1beacf 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleAssessmentProjectPageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleAssessmentProjectPageReqVO.java @@ -15,6 +15,9 @@ public class BusinessSubParentSampleAssessmentProjectPageReqVO extends PageParam @Schema(description = "样品分样ID", example = "23188") private Long businessSubParentSampleId; + + @Schema(description = "班组判定数据业务ID") + private Long businessSubParentSampleAssessmentId; @Schema(description = "检测项目ID,字典表【T_DIC_PRJ】", example = "17642") private Long dictionaryProjectId; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleAssessmentRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleAssessmentRespVO.java index d4155e5..1eaac21 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleAssessmentRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleAssessmentRespVO.java @@ -36,6 +36,10 @@ public class BusinessSubParentSampleAssessmentRespVO { @ExcelProperty("判定状态,in_progress-进行中 normal-正常") private String assessmentStatus; + @Schema(description = "复测次数", example = "28081") + @ExcelProperty("复测次数") + private Integer retestCount; + @Schema(description = "是否已上报") @ExcelProperty("是否已上报") private Integer isReported; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleAssessmentSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleAssessmentSaveReqVO.java index 112d681..fb9f382 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleAssessmentSaveReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleAssessmentSaveReqVO.java @@ -32,6 +32,9 @@ public class BusinessSubParentSampleAssessmentSaveReqVO { @Schema(description = "判定状态,in_progress-进行中 normal-正常", example = "1") private String assessmentStatus; + + @Schema(description = "复测次数") + private Integer retestCount; @Schema(description = "是否已上报") private Integer isReported; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleAnalysisGroupPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleAnalysisGroupPageReqVO.java index 0739593..149c8ba 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleAnalysisGroupPageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleAnalysisGroupPageReqVO.java @@ -31,6 +31,9 @@ public class BusinessSubSampleAnalysisGroupPageReqVO extends PageParam { @Schema(description = "样品状态", example = "1") private String sampleStatus; + @Schema(description = "是否送样") + private Integer isSend; + @Schema(description = "收样人") private String sampleReceiver; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleAnalysisGroupRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleAnalysisGroupRespVO.java index 7382885..a9728c9 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleAnalysisGroupRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleAnalysisGroupRespVO.java @@ -40,6 +40,9 @@ public class BusinessSubSampleAnalysisGroupRespVO { @ExcelProperty("样品状态") private String sampleStatus; + @Schema(description = "是否送样") + private Integer isSend; + @Schema(description = "收样人") @ExcelProperty("收样人") private String sampleReceiver; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleAnalysisGroupSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleAnalysisGroupSaveReqVO.java index d163842..a7b32bb 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleAnalysisGroupSaveReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleAnalysisGroupSaveReqVO.java @@ -37,6 +37,9 @@ public class BusinessSubSampleAnalysisGroupSaveReqVO { @NotEmpty(message = "样品状态不能为空") private String sampleStatus; + @Schema(description = "是否送样") + private Integer isSend; + @Schema(description = "收样人") private String sampleReceiver; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleAssessmentPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleAssessmentPageReqVO.java index 2b315df..41be175 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleAssessmentPageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleAssessmentPageReqVO.java @@ -30,8 +30,11 @@ public class BusinessSubSampleAssessmentPageReqVO extends PageParam { @Schema(description = "判定状态,in_progress-进行中 normal-正常,exceeds_tolerance-超差", example = "2") private String assessmentStatus; + + @Schema(description = "复测次数") + private Integer retestCount; - @Schema(description = "是否复测,1-是,0-否") + @Schema(description = "是否复检,1-是,0-否") private Integer isRecheck; @Schema(description = "是否已上报,1-是,0-否") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleAssessmentProjectExtendRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleAssessmentProjectExtendRespVO.java index 59e602a..2c607da 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleAssessmentProjectExtendRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleAssessmentProjectExtendRespVO.java @@ -5,6 +5,9 @@ import lombok.Data; @Data public class BusinessSubSampleAssessmentProjectExtendRespVO extends BusinessSubSampleAssessmentProjectRespVO { + + @Schema(description = "复测次数") + private Integer retestCount; /** 分析方法名称 **/ @Schema(description = "分析方法名称") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleAssessmentRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleAssessmentRespVO.java index 9e13136..e6ebc54 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleAssessmentRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleAssessmentRespVO.java @@ -39,9 +39,12 @@ public class BusinessSubSampleAssessmentRespVO { @Schema(description = "判定状态,in_progress-进行中 normal-正常,exceeds_tolerance-超差", example = "2") @ExcelProperty("判定状态,in_progress-进行中 normal-正常,exceeds_tolerance-超差") private String assessmentStatus; + + @Schema(description = "复测次数") + private Integer retestCount; - @Schema(description = "是否复测,1-是,0-否") - @ExcelProperty("是否复测,1-是,0-否") + @Schema(description = "是否复检,1-是,0-否") + @ExcelProperty("是否复检,1-是,0-否") private Integer isRecheck; @Schema(description = "是否已上报,1-是,0-否") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleAssessmentSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleAssessmentSaveReqVO.java index 3c8a858..d996203 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleAssessmentSaveReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleAssessmentSaveReqVO.java @@ -34,8 +34,11 @@ public class BusinessSubSampleAssessmentSaveReqVO { @Schema(description = "判定状态,in_progress-进行中 normal-正常,exceeds_tolerance-超差", example = "2") private String assessmentStatus; + + @Schema(description = "复测次数") + private Integer retestCount; - @Schema(description = "是否复测,1-是,0-否") + @Schema(description = "是否复检,1-是,0-否") private Integer isRecheck; @Schema(description = "是否已上报,1-是,0-否") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleExtendRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleExtendRespVO.java index 6a60a80..ed6cdb1 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleExtendRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleExtendRespVO.java @@ -63,6 +63,9 @@ public class BusinessSubSampleExtendRespVO extends BusinessSubSampleRespVO { @Schema(description = "分析部门名称") private String assayDepartmentName; + + @Schema(description = "是否已送样") + private Integer isSendSample; @Schema(description = "是否打印") private Integer isPrint; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSamplePageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSamplePageReqVO.java index abfeb31..9c5581b 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSamplePageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSamplePageReqVO.java @@ -145,6 +145,9 @@ public class BusinessSubSamplePageReqVO extends PageParam { @Schema(description = "分析部门状态") private String assayDepartmentStatus; + @Schema(description = "是否已送样") + private Integer isSendSample; + @Schema(description = "样品流程节点KEY列表") private List sampleFlowNodeKeyList; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleParentRecheckPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleParentRecheckPageReqVO.java deleted file mode 100644 index c3646a8..0000000 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleParentRecheckPageReqVO.java +++ /dev/null @@ -1,50 +0,0 @@ -package com.zt.plat.module.qms.business.bus.controller.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 BusinessSubSampleParentRecheckPageReqVO extends PageParam { - - @Schema(description = "样品ID", example = "19065") - private Long sampleId; - - @Schema(description = "样品主样ID", example = "26605") - private Long businessBaseSampleId; - - @Schema(description = "样品分样ID", example = "29386") - private Long businessSubParentSampleId; - - @Schema(description = "检测方法配置ID", example = "19087") - private Long configAssayMethodId; - - @Schema(description = "复检样品主样ID", example = "12742") - private Long recheckBusinessBaseSampleId; - - @Schema(description = "复检样品分样ID", example = "24043") - private Long recheckBusinessSubParentSampleId; - - @Schema(description = "复检检测方法配置ID", example = "4026") - private Long recheckConfigAssayMethodId; - - @Schema(description = "所属部门") - private String systemDepartmentCode; - - @Schema(description = "创建时间") - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - private LocalDateTime[] createTime; - - @Schema(description = "乐观锁", example = "18382") - private Integer updateCount; - - @Schema(description = "备注") - private String remark; - -} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleParentRetestPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleParentRetestPageReqVO.java new file mode 100644 index 0000000..b6314b2 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleParentRetestPageReqVO.java @@ -0,0 +1,59 @@ +package com.zt.plat.module.qms.business.bus.controller.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 BusinessSubSampleParentRetestPageReqVO extends PageParam { + + @Schema(description = "样品ID", example = "28939") + private Long sampleId; + + @Schema(description = "样品主样ID", example = "3389") + private Long businessBaseSampleId; + + @Schema(description = "样品分样ID", example = "6831") + private Long businessSubParentSampleId; + + @Schema(description = "检测方法配置ID", example = "23450") + private Long configAssayMethodId; + + @Schema(description = "班组判定数据业务ID", example = "32694") + private Long businessSubParentSampleAssessmentId; + + @Schema(description = "复测次数", example = "12365") + private Integer retestCount; + + @Schema(description = "复检样品主样ID", example = "23172") + private Long retestBusinessBaseSampleId; + + @Schema(description = "复检样品分样ID", example = "11648") + private Long retestBusinessSubParentSampleId; + + @Schema(description = "复检检测方法配置ID", example = "7801") + private Long retestConfigAssayMethodId; + + @Schema(description = "班组判定数据业务ID", example = "21169") + private Long retestBusinessSubParentSampleAssessmentId; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "乐观锁", example = "30845") + private Integer updateCount; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleParentRecheckRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleParentRetestRespVO.java similarity index 59% rename from zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleParentRecheckRespVO.java rename to zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleParentRetestRespVO.java index dc1a051..9cc5b8a 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleParentRecheckRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleParentRetestRespVO.java @@ -7,42 +7,54 @@ import org.springframework.format.annotation.DateTimeFormat; import java.time.LocalDateTime; import com.alibaba.excel.annotation.*; -@Schema(description = "管理后台 - 分样复检业务数据 Response VO") +@Schema(description = "管理后台 - 分样复测业务数据 Response VO") @Data @ExcelIgnoreUnannotated -public class BusinessSubSampleParentRecheckRespVO { +public class BusinessSubSampleParentRetestRespVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "4631") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "20948") @ExcelProperty("ID") private Long id; - @Schema(description = "样品ID", example = "19065") + @Schema(description = "样品ID", example = "28939") @ExcelProperty("样品ID") private Long sampleId; - @Schema(description = "样品主样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "26605") + @Schema(description = "样品主样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "3389") @ExcelProperty("样品主样ID") private Long businessBaseSampleId; - @Schema(description = "样品分样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "29386") + @Schema(description = "样品分样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "6831") @ExcelProperty("样品分样ID") private Long businessSubParentSampleId; - @Schema(description = "检测方法配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "19087") + @Schema(description = "检测方法配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "23450") @ExcelProperty("检测方法配置ID") private Long configAssayMethodId; - @Schema(description = "复检样品主样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "12742") + @Schema(description = "班组判定数据业务ID", example = "32694") + @ExcelProperty("班组判定数据业务ID") + private Long businessSubParentSampleAssessmentId; + + @Schema(description = "复测次数", requiredMode = Schema.RequiredMode.REQUIRED, example = "12365") + @ExcelProperty("复测次数") + private Integer retestCount; + + @Schema(description = "复检样品主样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "23172") @ExcelProperty("复检样品主样ID") - private Long recheckBusinessBaseSampleId; + private Long retestBusinessBaseSampleId; - @Schema(description = "复检样品分样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "24043") + @Schema(description = "复检样品分样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "11648") @ExcelProperty("复检样品分样ID") - private Long recheckBusinessSubParentSampleId; + private Long retestBusinessSubParentSampleId; - @Schema(description = "复检检测方法配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "4026") + @Schema(description = "复检检测方法配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "7801") @ExcelProperty("复检检测方法配置ID") - private Long recheckConfigAssayMethodId; + private Long retestConfigAssayMethodId; + + @Schema(description = "班组判定数据业务ID", example = "21169") + @ExcelProperty("班组判定数据业务ID") + private Long retestBusinessSubParentSampleAssessmentId; @Schema(description = "所属部门") @ExcelProperty("所属部门") @@ -52,7 +64,7 @@ public class BusinessSubSampleParentRecheckRespVO { @ExcelProperty("创建时间") private LocalDateTime createTime; - @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "18382") + @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "30845") @ExcelProperty("乐观锁") private Integer updateCount; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleParentRecheckSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleParentRetestSaveReqVO.java similarity index 56% rename from zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleParentRecheckSaveReqVO.java rename to zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleParentRetestSaveReqVO.java index b0d6802..fe36c45 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleParentRecheckSaveReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleParentRetestSaveReqVO.java @@ -5,44 +5,54 @@ import lombok.*; import java.util.*; import jakarta.validation.constraints.*; -@Schema(description = "管理后台 - 分样复检业务数据新增/修改 Request VO") +@Schema(description = "管理后台 - 分样复测业务数据新增/修改 Request VO") @Data -public class BusinessSubSampleParentRecheckSaveReqVO { +public class BusinessSubSampleParentRetestSaveReqVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "4631") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "20948") private Long id; - @Schema(description = "样品ID", example = "19065") + @Schema(description = "样品ID", example = "28939") private Long sampleId; - @Schema(description = "样品主样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "26605") + @Schema(description = "样品主样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "3389") @NotNull(message = "样品主样ID不能为空") private Long businessBaseSampleId; - @Schema(description = "样品分样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "29386") + @Schema(description = "样品分样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "6831") @NotNull(message = "样品分样ID不能为空") private Long businessSubParentSampleId; - @Schema(description = "检测方法配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "19087") + @Schema(description = "检测方法配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "23450") @NotNull(message = "检测方法配置ID不能为空") private Long configAssayMethodId; - @Schema(description = "复检样品主样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "12742") + @Schema(description = "班组判定数据业务ID", example = "32694") + private Long businessSubParentSampleAssessmentId; + + @Schema(description = "复测次数", requiredMode = Schema.RequiredMode.REQUIRED, example = "12365") + @NotNull(message = "复测次数不能为空") + private Integer retestCount; + + @Schema(description = "复检样品主样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "23172") @NotNull(message = "复检样品主样ID不能为空") - private Long recheckBusinessBaseSampleId; + private Long retestBusinessBaseSampleId; - @Schema(description = "复检样品分样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "24043") + @Schema(description = "复检样品分样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "11648") @NotNull(message = "复检样品分样ID不能为空") - private Long recheckBusinessSubParentSampleId; + private Long retestBusinessSubParentSampleId; - @Schema(description = "复检检测方法配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "4026") + @Schema(description = "复检检测方法配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "7801") @NotNull(message = "复检检测方法配置ID不能为空") - private Long recheckConfigAssayMethodId; + private Long retestConfigAssayMethodId; + + @Schema(description = "班组判定数据业务ID", example = "21169") + private Long retestBusinessSubParentSampleAssessmentId; @Schema(description = "所属部门") private String systemDepartmentCode; - @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "18382") + @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "30845") @NotNull(message = "乐观锁不能为空") private Integer updateCount; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessXRFDataPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessXRFDataPageReqVO.java index 93689ac..eb5a58b 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessXRFDataPageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessXRFDataPageReqVO.java @@ -46,6 +46,9 @@ public class BusinessXRFDataPageReqVO extends PageParam { @Schema(description = "检测任务ID", example = "16505") private Long businessAssayTaskDataId; + + @Schema(description = "检测任务ID", example = "940") + private Long businessQCManagementDataId; @Schema(description = "检测数据") private String assayData; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessXRFDataReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessXRFDataReqVO.java index f767309..3ed2865 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessXRFDataReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessXRFDataReqVO.java @@ -49,6 +49,9 @@ public class BusinessXRFDataReqVO { @Schema(description = "检测任务ID", example = "16505") private Long businessAssayTaskDataId; + + @Schema(description = "检测任务ID", example = "940") + private Long businessQCManagementDataId; @Schema(description = "检测数据") private String assayData; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessXRFDataRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessXRFDataRespVO.java index eb2ef7b..d0522fe 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessXRFDataRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessXRFDataRespVO.java @@ -58,6 +58,9 @@ public class BusinessXRFDataRespVO { @Schema(description = "检测任务ID", example = "16505") private Long businessAssayTaskDataId; + + @Schema(description = "检测任务ID", example = "940") + private Long businessQCManagementDataId; @Schema(description = "检测数据", requiredMode = Schema.RequiredMode.REQUIRED) @ExcelProperty("检测数据") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessXRFDataSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessXRFDataSaveReqVO.java index cfe3d2c..287906a 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessXRFDataSaveReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessXRFDataSaveReqVO.java @@ -51,6 +51,9 @@ public class BusinessXRFDataSaveReqVO { @Schema(description = "检测任务ID", example = "16505") private Long businessAssayTaskDataId; + + @Schema(description = "检测任务ID", example = "940") + private Long businessQCManagementDataId; @Schema(description = "检测数据", requiredMode = Schema.RequiredMode.REQUIRED) @NotEmpty(message = "检测数据不能为空") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/ChangeAssayMethodReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/ChangeAssayMethodReqVO.java index 85f692d..70814c4 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/ChangeAssayMethodReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/ChangeAssayMethodReqVO.java @@ -7,10 +7,10 @@ import lombok.Data; @Data public class ChangeAssayMethodReqVO { - private Long businessSubSampleId; + private List businessSubSampleIdList; private Long configAssayMethodId; - private List changeConfigAssayMethodIdList; + private List changeConfigAssayMethodProjectList; } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/CreateQcSampleReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/CreateQcSampleReqVO.java index 791ac1c..6afd2e7 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/CreateQcSampleReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/CreateQcSampleReqVO.java @@ -26,4 +26,7 @@ public class CreateQcSampleReqVO { @Schema(description = "质控类型_Key,字典表【T_DIC_BSN】质控类型:空白样、管理样、标准样、标样") private String dictionaryBusinessKey; + + @Schema(description = "质控类型_父类_Key,字典表【T_DIC_BSN】质控类型:带检测项-withProject 不带检测项目-withoutProject") + private String parentDictionaryBusinesskey; } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/DeleteQcSampleReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/DeleteQcSampleReqVO.java index 370da2d..8228ca7 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/DeleteQcSampleReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/DeleteQcSampleReqVO.java @@ -13,6 +13,9 @@ public class DeleteQcSampleReqVO { @Schema(description = "质控类型_Key,字典表【T_DIC_BSN】质控类型:空白样、管理样、标准样、标样") private String dictionaryBusinessKey; + + @Schema(description = "质控类型_父类_Key,字典表【T_DIC_BSN】质控类型:带检测项-withProject 不带检测项目-withoutProject") + private String parentDictionaryBusinesskey; @Schema(description = "质控样id") private List qcSampleIdList; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/ModifySampleResultReportingReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/ModifySampleResultReportingReqVO.java index 9ff8961..fca36e8 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/ModifySampleResultReportingReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/ModifySampleResultReportingReqVO.java @@ -5,7 +5,7 @@ import lombok.Data; @Data public class ModifySampleResultReportingReqVO { - private String businessSubParentSampleAssessmentIds; + private String businessSubParentSampleAssessmentProjectIds; private String businessSubSampleAssessmentIds; } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/NoReportSubParentSampleAssessmentRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/NoReportSubParentSampleAssessmentRespVO.java index 6726322..090638b 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/NoReportSubParentSampleAssessmentRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/NoReportSubParentSampleAssessmentRespVO.java @@ -1,9 +1,13 @@ package com.zt.plat.module.qms.business.bus.controller.vo; +import java.time.LocalDateTime; + import lombok.Data; @Data public class NoReportSubParentSampleAssessmentRespVO { + + private Long businessSubParentSampleAssessmentId; private Long baseSampleId; @@ -22,4 +26,8 @@ public class NoReportSubParentSampleAssessmentRespVO { private String taskType; private String assayType; + + private Integer retestCount; + + private LocalDateTime sampleReceiveTime; } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/RecheckSubSampleParentCreateReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/RecheckSubSampleParentCreateReqVO.java index bc37688..19b585e 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/RecheckSubSampleParentCreateReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/RecheckSubSampleParentCreateReqVO.java @@ -19,8 +19,9 @@ public class RecheckSubSampleParentCreateReqVO { private Long businessSubSampleId; - private Long configAssayMethodId; + + private Long businessSubParentSampleAssessmentId; List recheckProjectList; } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/RecheckSubSampleParentMethodRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/RecheckSubSampleParentMethodRespVO.java index afe6019..878b7d5 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/RecheckSubSampleParentMethodRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/RecheckSubSampleParentMethodRespVO.java @@ -4,6 +4,7 @@ import java.util.List; import com.zt.plat.module.qms.business.config.controller.vo.*; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; @Data @@ -20,6 +21,9 @@ public class RecheckSubSampleParentMethodRespVO { private Long configAssayMethodId; private String configAssayMethodName; + + @Schema(description = "检测方法配置名称及类别") + private String configAssayMethodNameAndCategory; private Long baseSampleId; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/ReportedDataSource.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/ReportedDataSource.java index 4d1a5f6..f3042f3 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/ReportedDataSource.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/ReportedDataSource.java @@ -6,7 +6,7 @@ import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import com.fasterxml.jackson.annotation.JsonFormat; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/UnAssignTaskedSubSampleRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/UnAssignTaskedSubSampleRespVO.java index 99f408d..3aeedea 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/UnAssignTaskedSubSampleRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/UnAssignTaskedSubSampleRespVO.java @@ -14,8 +14,14 @@ public class UnAssignTaskedSubSampleRespVO implements Serializable { @Schema(description = "联合id") private String id; + @Schema(description = "样品大类ID", example = "15112") + private Long baseSampleId; + @Schema(description = "分样子样ID") private Long businessSubSampleId; + + @Schema(description = "样品大类名称", example = "张三") + private String baseSampleName; @Schema(description = "样品名称", example = "张三") private String sampleName; @@ -34,6 +40,12 @@ public class UnAssignTaskedSubSampleRespVO implements Serializable { @Schema(description = "检测方法配置ID", example = "9130") private Long configAssayMethodId; + + @Schema(description = "分析方法名称") + private String configAssayMethodName; + + @Schema(description = "检测方法配置名称及类别") + private String configAssayMethodNameAndCategory; @Schema(description = "分析类型,【字典】【jy_sample_assay_type】单杯-single_cup、双杯-double_cup、平行-single_parallel...", example = "2") private String assayType; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessAssayParameterDataDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessAssayParameterDataDO.java index f69102f..adb8cd6 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessAssayParameterDataDO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessAssayParameterDataDO.java @@ -47,9 +47,14 @@ public class BusinessAssayParameterDataDO extends BusinessBaseDO { @TableField("DIC_PRM_ID") private Long dictionaryParameterId; /** + * 符号,=、>、<、等 + */ + @TableField("SMB") + private String symbol; + /** * 值 */ - @TableField("VAL") + @TableField(value = "VAL", updateStrategy = FieldStrategy.ALWAYS) private String value; /** * 数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间 diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessAssayProjectDataDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessAssayProjectDataDO.java index 3da3238..d3bcdbc 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessAssayProjectDataDO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessAssayProjectDataDO.java @@ -59,7 +59,7 @@ public class BusinessAssayProjectDataDO extends BusinessBaseDO { /** * 值 */ - @TableField("VAL") + @TableField(value = "VAL", updateStrategy = FieldStrategy.ALWAYS) private String value; /** * 数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间 diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessAssayReportDataDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessAssayReportDataDO.java index e1aa53f..536d6ae 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessAssayReportDataDO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessAssayReportDataDO.java @@ -1,5 +1,6 @@ package com.zt.plat.module.qms.business.bus.dal.dataobject; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; import java.util.*; import java.time.LocalDateTime; @@ -109,4 +110,20 @@ public class BusinessAssayReportDataDO extends BusinessBaseDO { //样品创建时间 @TableField(exist = false) private LocalDateTime baseSampleCreateTime; + + //样品类型key + @TableField(exist = false) + private String sampleTypeKey; + + //委托样品名称 + @TableField(exist = false) + private String entrustSampleName; + + //委托样品编号 + @TableField(exist = false) + private String entrustSampleCode; + + //委托明细排序 + @TableField(exist = false) + private Integer entrustDetailSort; } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessAssayTaskDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessAssayTaskDO.java index c88515e..94f1b1d 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessAssayTaskDO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessAssayTaskDO.java @@ -160,12 +160,12 @@ public class BusinessAssayTaskDO extends BusinessBaseDO { @TableField("DOC_SIG") private String documentSignature; /** - * 完成状态,未开始-not_start、审核中-running、已退回-returned、已通过-approved + * 完成状态,未开始-not_start、审核中-in_progress、已退回-returned、已通过-completed */ @TableField("FIN_STS") private String finishStatus; /** - * 流程状态,未开始-not_start、审核中-running、已退回-returned、已通过-approved + * 流程状态,未开始-not_start、审核中-in_progress、已退回-returned、已通过-completed */ @TableField("FLW_STS") private String flowStatus; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessAssayTaskDataDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessAssayTaskDataDO.java index 3be86ec..e5a4d11 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessAssayTaskDataDO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessAssayTaskDataDO.java @@ -1,7 +1,6 @@ package com.zt.plat.module.qms.business.bus.dal.dataobject; import lombok.*; -import java.util.*; import java.time.LocalDateTime; import com.baomidou.mybatisplus.annotation.*; import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; @@ -141,10 +140,15 @@ public class BusinessAssayTaskDataDO extends BusinessBaseDO { @TableField("SMP_FLW_NDE_TM") private LocalDateTime sampleFlowNodeTime; /** - * 分析次数,值为0为分析,大于0为第几次复检 + * 复检次数 */ - @TableField("ANL_CNT") - private Integer analysisCount; + @TableField("RCHK_CNT") + private Integer recheckCount; + /** + * 复测次数 + */ + @TableField("RTST_CNT") + private Integer retestCount; /** * 乐观锁 */ diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessAssayTaskParameterDataDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessAssayTaskParameterDataDO.java new file mode 100644 index 0000000..04e3d4e --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessAssayTaskParameterDataDO.java @@ -0,0 +1,75 @@ +package com.zt.plat.module.qms.business.bus.dal.dataobject; + +import lombok.*; +import java.util.*; + 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("t_bsn_asy_tsk_prm_dat") +@KeySequence("t_bsn_asy_tsk_prm_dat_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class BusinessAssayTaskParameterDataDO extends BusinessBaseDO { + + + + /** + * ID + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 检测任务ID + */ + @TableField("BSN_ASY_TSK_DAT_ID") + private Long businessAssayTaskDataId; + /** + * 检测方法参数配置ID + */ + @TableField("CFG_ASY_MTHD_PRM_ID") + private Long configAssayMethodParameterId; + /** + * 值 + */ + @TableField(value = "VAL", updateStrategy = FieldStrategy.ALWAYS) + private String value; + /** + * 数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间 + */ + @TableField("DAT_TP") + private String dataType; + /** + * 小数位 + */ + @TableField("DEC_POS") + private Integer decimalPosition; + /** + * 乐观锁 + */ + @TableField("UPD_CNT") + private Integer updateCount; + /** + * 所属部门 + */ + @TableField("SYS_DEPT_CD") + private String systemDepartmentCode; + /** + * 备注 + */ + @TableField("RMK") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessQCCoefficientParameterDataDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessQCCoefficientParameterDataDO.java index 5be6059..f8f06ce 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessQCCoefficientParameterDataDO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessQCCoefficientParameterDataDO.java @@ -47,9 +47,14 @@ public class BusinessQCCoefficientParameterDataDO extends BusinessBaseDO { @TableField("DIC_PRM_ID") private Long dictionaryParameterId; /** + * 符号,=、>、<、等 + */ + @TableField("SMB") + private String symbol; + /** * 值 */ - @TableField("VAL") + @TableField(value = "VAL", updateStrategy = FieldStrategy.ALWAYS) private String value; /** * 数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间 diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessQCManagementParameterDataDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessQCManagementParameterDataDO.java index 88d7026..3bfd61b 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessQCManagementParameterDataDO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessQCManagementParameterDataDO.java @@ -47,9 +47,14 @@ public class BusinessQCManagementParameterDataDO extends BusinessBaseDO { @TableField("DIC_PRM_ID") private Long dictionaryParameterId; /** + * 符号,=、>、<、等 + */ + @TableField("SMB") + private String symbol; + /** * 值 */ - @TableField("VAL") + @TableField(value = "VAL", updateStrategy = FieldStrategy.ALWAYS) private String value; /** * 数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间 diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessQCManagementProjectDataDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessQCManagementProjectDataDO.java index c23a5b5..95eda72 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessQCManagementProjectDataDO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessQCManagementProjectDataDO.java @@ -59,7 +59,7 @@ public class BusinessQCManagementProjectDataDO extends BusinessBaseDO { /** * 值 */ - @TableField("VAL") + @TableField(value = "VAL", updateStrategy = FieldStrategy.ALWAYS) private String value; /** * 数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间 diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessQCManagementSampleParameterDataDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessQCManagementSampleParameterDataDO.java new file mode 100644 index 0000000..d94b4b3 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessQCManagementSampleParameterDataDO.java @@ -0,0 +1,75 @@ +package com.zt.plat.module.qms.business.bus.dal.dataobject; + +import lombok.*; +import java.util.*; + import java.time.LocalDateTime; + import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.*; +import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; +/** +* 质控管理样检测任务参数业务表,与子样检测任务参数业务表T_BSN_ASY_TSK_PRM_DAT一样,针对标准样、管理样、质控样、监控样等样品的参数 DO +* +* @author 后台管理-1 +*/ +@TableName("t_bsn_qc_mngt_smp_prm_dat") +@KeySequence("t_bsn_qc_mngt_smp_prm_dat_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class BusinessQCManagementSampleParameterDataDO extends BusinessBaseDO { + + + + /** + * ID + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 质控管理样检测任务ID + */ + @TableField("BSN_QC_MNGT_DAT_ID") + private Long businessQCManagementDataId; + /** + * 检测方法参数配置ID + */ + @TableField("CFG_ASY_MTHD_PRM_ID") + private Long configAssayMethodParameterId; + /** + * 值 + */ + @TableField(value = "VAL", updateStrategy = FieldStrategy.ALWAYS) + private String value; + /** + * 数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间 + */ + @TableField("DAT_TP") + private String dataType; + /** + * 小数位 + */ + @TableField("DEC_POS") + private Integer decimalPosition; + /** + * 乐观锁 + */ + @TableField("UPD_CNT") + private Integer updateCount; + /** + * 所属部门 + */ + @TableField("SYS_DEPT_CD") + private String systemDepartmentCode; + /** + * 备注 + */ + @TableField("RMK") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSubParentSampleAssessmentDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSubParentSampleAssessmentDO.java index 3023341..6bac783 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSubParentSampleAssessmentDO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSubParentSampleAssessmentDO.java @@ -58,6 +58,11 @@ public class BusinessSubParentSampleAssessmentDO extends BusinessBaseDO { @TableField("ASMT_STS") private String assessmentStatus; /** + * 复测次数 + */ + @TableField("RTST_CNT") + private Integer retestCount; + /** * 是否已上报 */ @TableField("IS_RPOD") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSubParentSampleAssessmentProjectDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSubParentSampleAssessmentProjectDO.java index 266478f..a9e6004 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSubParentSampleAssessmentProjectDO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSubParentSampleAssessmentProjectDO.java @@ -90,7 +90,7 @@ public class BusinessSubParentSampleAssessmentProjectDO extends BusinessBaseDO { /** * 判定值 */ - @TableField("ASMT_VAL") + @TableField(value = "ASMT_VAL", updateStrategy = FieldStrategy.ALWAYS) private String assessmentValue; /** * 判定状态,in_progress-进行中 normal-正常,exceeds_tolerance-超差 diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSubSampleAnalysisGroupDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSubSampleAnalysisGroupDO.java index 5e8876a..d846f3a 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSubSampleAnalysisGroupDO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSubSampleAnalysisGroupDO.java @@ -63,6 +63,11 @@ public class BusinessSubSampleAnalysisGroupDO extends BusinessBaseDO { @TableField("SMP_STS") private String sampleStatus; /** + * 是否送样 + */ + @TableField("IS_SND") + private Integer isSend; + /** * 收样人 */ @TableField("SMP_RCVR") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSubSampleAssessmentDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSubSampleAssessmentDO.java index bd737bb..01b5c6e 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSubSampleAssessmentDO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSubSampleAssessmentDO.java @@ -71,11 +71,16 @@ public class BusinessSubSampleAssessmentDO extends BusinessBaseDO { @TableField("ASMT_STS") private String assessmentStatus; /** - * 是否复测,1-是,0-否 + * 是否复检,1-是,0-否 */ @TableField("IS_RCHK") private Integer isRecheck; /** + * 复测次数 + */ + @TableField("RTST_CNT") + private Integer retestCount; + /** * 是否已上报,1-是,0-否 */ @TableField("IS_RPOD") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSubSampleParentRecheckDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSubSampleParentRetestDO.java similarity index 63% rename from zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSubSampleParentRecheckDO.java rename to zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSubSampleParentRetestDO.java index 0d4e22d..885ea8c 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSubSampleParentRecheckDO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSubSampleParentRetestDO.java @@ -7,12 +7,12 @@ import java.util.*; import com.baomidou.mybatisplus.annotation.*; import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; /** -* 分样复检业务数据 DO +* 分样复测业务数据 DO * -* @author 后台管理 +* @author 后台管理-1 */ -@TableName("t_bsn_sb_smp_prn_rchk") -@KeySequence("t_bsn_sb_smp_prn_rchk_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@TableName("t_bsn_sb_smp_prn_rtst") +@KeySequence("t_bsn_sb_smp_prn_rtst_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) @@ -22,7 +22,7 @@ import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; /** * 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO */ -public class BusinessSubSampleParentRecheckDO extends BusinessBaseDO { +public class BusinessSubSampleParentRetestDO extends BusinessBaseDO { @@ -52,20 +52,35 @@ public class BusinessSubSampleParentRecheckDO extends BusinessBaseDO { @TableField("CFG_ASY_MTHD_ID") private Long configAssayMethodId; /** + * 班组判定数据业务ID + */ + @TableField("BSN_SB_PRN_SMP_ASMT_ID") + private Long businessSubParentSampleAssessmentId; + /** + * 复测次数 + */ + @TableField("RTST_CNT") + private Integer retestCount; + /** * 复检样品主样ID */ - @TableField("RCHK_BSN_BSE_SMP_ID") - private Long recheckBusinessBaseSampleId; + @TableField("RTST_BSN_BSE_SMP_ID") + private Long retestBusinessBaseSampleId; /** * 复检样品分样ID */ - @TableField("RCHK_BSN_SB_PRN_SMP_ID") - private Long recheckBusinessSubParentSampleId; + @TableField("RTST_BSN_SB_PRN_SMP_ID") + private Long retestBusinessSubParentSampleId; /** * 复检检测方法配置ID */ - @TableField("RCHK_CFG_ASY_MTHD_ID") - private Long recheckConfigAssayMethodId; + @TableField("RTST_CFG_ASY_MTHD_ID") + private Long retestConfigAssayMethodId; + /** + * 班组判定数据业务ID + */ + @TableField("RTST_BSN_SB_PRN_SMP_ASMT_ID") + private Long retestBusinessSubParentSampleAssessmentId; /** * 所属部门 */ diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessXRFDataDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessXRFDataDO.java index a503aef..9865524 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessXRFDataDO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessXRFDataDO.java @@ -89,6 +89,11 @@ public class BusinessXRFDataDO extends BusinessBaseDO { @TableField("BSN_ASY_TSK_DAT_ID") private Long businessAssayTaskDataId; /** + * 检测任务ID + */ + @TableField("BSN_QC_MNGT_DAT_ID") + private Long businessQCManagementDataId; + /** * 检测数据 */ @TableField("ASY_DAT") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayParameterDataMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayParameterDataMapper.java index c0f5797..718a26e 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayParameterDataMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayParameterDataMapper.java @@ -10,8 +10,10 @@ import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayParameterD import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayParameterDataReqVO; import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayProjectAndParameterRespVO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayParameterDataDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayProjectDataDO; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectDO; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectParameterDO; -import com.zt.plat.module.qms.business.dic.dal.dataobject.DictionaryParameterDO; +import com.zt.plat.module.qms.business.dic.dal.dataobject.DictionaryProjectDO; import com.zt.plat.module.qms.common.dic.dal.dataobject.DictionaryBusinessDO; import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; import org.apache.ibatis.annotations.Mapper; @@ -27,26 +29,28 @@ public interface BusinessAssayParameterDataMapper extends BaseMapperX selectProjectAndParameterBy(BusinessAssayParameterDataReqVO reqVO) { return selectJoinList(BusinessAssayProjectAndParameterRespVO.class, new MPJLambdaWrapperX() .leftJoin(ConfigAssayMethodProjectParameterDO.class, ConfigAssayMethodProjectParameterDO::getId, BusinessAssayParameterDataDO::getConfigAssayMethodProjectParameterId) - .leftJoin(DictionaryParameterDO.class, DictionaryParameterDO::getId, BusinessAssayParameterDataDO::getDictionaryParameterId) .leftJoin(DictionaryBusinessDO.class, DictionaryBusinessDO::getId, ConfigAssayMethodProjectParameterDO::getDictionaryBusinessId) .selectAs(BusinessAssayParameterDataDO::getId, BusinessAssayProjectAndParameterRespVO::getId) - .selectAs(BusinessAssayParameterDataDO::getDictionaryParameterId, BusinessAssayProjectAndParameterRespVO::getDicId) - .selectAs(DictionaryParameterDO::getKey, BusinessAssayProjectAndParameterRespVO::getDicKey) - .selectAs(DictionaryParameterDO::getName, BusinessAssayProjectAndParameterRespVO::getName) - .selectAs(DictionaryParameterDO::getName, BusinessAssayProjectAndParameterRespVO::getShowName) - .selectAs(DictionaryParameterDO::getFillingWay, BusinessAssayProjectAndParameterRespVO::getFillingWay) + .selectAs(BusinessAssayParameterDataDO::getBusinessAssayProjectDataId, BusinessAssayProjectAndParameterRespVO::getBizId) + .selectAs(BusinessAssayParameterDataDO::getConfigAssayMethodProjectParameterId, BusinessAssayProjectAndParameterRespVO::getDicId) + .selectAs(ConfigAssayMethodProjectParameterDO::getKey, BusinessAssayProjectAndParameterRespVO::getDicKey) + .selectAs(ConfigAssayMethodProjectParameterDO::getParameterName, BusinessAssayProjectAndParameterRespVO::getName) + .selectAs(ConfigAssayMethodProjectParameterDO::getParameterName, BusinessAssayProjectAndParameterRespVO::getShowName) + .selectAs(ConfigAssayMethodProjectParameterDO::getFillingWay, BusinessAssayProjectAndParameterRespVO::getFillingWay) .selectAs(BusinessAssayParameterDataDO::getDataType, BusinessAssayProjectAndParameterRespVO::getDataType) .selectAs(BusinessAssayParameterDataDO::getDecimalPosition, BusinessAssayProjectAndParameterRespVO::getDecimalPosition) .selectAs(BusinessAssayParameterDataDO::getValue, BusinessAssayProjectAndParameterRespVO::getValue) - .selectAs(DictionaryParameterDO::getUnit, BusinessAssayProjectAndParameterRespVO::getUnit) + .selectAs(BusinessAssayParameterDataDO::getSymbol, BusinessAssayProjectAndParameterRespVO::getSymbol) + .selectAs(ConfigAssayMethodProjectParameterDO::getUnit, BusinessAssayProjectAndParameterRespVO::getUnit) .selectAs(ConfigAssayMethodProjectParameterDO::getIsNull, BusinessAssayProjectAndParameterRespVO::getIsNull) .selectAs(ConfigAssayMethodProjectParameterDO::getFormula, BusinessAssayProjectAndParameterRespVO::getFormula) - .selectAs(ConfigAssayMethodProjectParameterDO::getSortNo, BusinessAssayProjectAndParameterRespVO::getParamNo) + .selectAs(ConfigAssayMethodProjectParameterDO::getNo, BusinessAssayProjectAndParameterRespVO::getParamNo) .selectAs("'parameter'", BusinessAssayProjectAndParameterRespVO::getType) .selectAs(ConfigAssayMethodProjectParameterDO::getDictionaryBusinessId, BusinessAssayProjectAndParameterRespVO::getGroupDictionaryBusinessId) .selectAs(ConfigAssayMethodProjectParameterDO::getDictionaryBusinessKey, BusinessAssayProjectAndParameterRespVO::getGroupDictionaryBusinessKey) .selectAs(DictionaryBusinessDO::getName, BusinessAssayProjectAndParameterRespVO::getGroupDictionaryBusinessName) .eqIfPresent(BusinessAssayParameterDataDO::getBusinessAssayProjectDataId, reqVO.getBusinessAssayProjectDataId()) + .inIfPresent(BusinessAssayParameterDataDO::getBusinessAssayProjectDataId, reqVO.getBusinessAssayProjectDataIdList()) .eqIfPresent(BusinessAssayParameterDataDO::getConfigAssayMethodProjectParameterId, reqVO.getConfigAssayMethodProjectParameterId()) .eqIfPresent(BusinessAssayParameterDataDO::getDictionaryParameterId, reqVO.getDictionaryParameterId()) .eqIfPresent(BusinessAssayParameterDataDO::getValue, reqVO.getValue()) @@ -86,11 +90,22 @@ public interface BusinessAssayParameterDataMapper extends BaseMapperX selectExtendByBusinessAssayProjectDataIds(List businessAssayProjectDataIds) { return selectJoinList(BusinessAssayParameterDataExtendRespVO.class, new MPJLambdaWrapperX() - .leftJoin(DictionaryParameterDO.class, DictionaryParameterDO::getId, BusinessAssayParameterDataDO::getDictionaryParameterId) + .leftJoin(ConfigAssayMethodProjectParameterDO.class, ConfigAssayMethodProjectParameterDO::getId, BusinessAssayParameterDataDO::getConfigAssayMethodProjectParameterId) .selectAll(BusinessAssayParameterDataDO.class) - .selectAs(DictionaryParameterDO::getName, BusinessAssayParameterDataExtendRespVO::getParameterName) - .selectAs(DictionaryParameterDO::getKey, BusinessAssayParameterDataExtendRespVO::getParameterKey) + .selectAs(ConfigAssayMethodProjectParameterDO::getParameterName, BusinessAssayParameterDataExtendRespVO::getParameterName) + .selectAs(ConfigAssayMethodProjectParameterDO::getKey, BusinessAssayParameterDataExtendRespVO::getParameterKey) .in(BusinessAssayParameterDataDO::getBusinessAssayProjectDataId, businessAssayProjectDataIds)); } + + default BusinessAssayParameterDataDO selectByBusinessAssayTaskDataIdAndProjectSimpleNameAndParameterKey(Long businessAssayTaskDataId, String projectSimpleName, String parameterKey) { + return selectJoinOne(BusinessAssayParameterDataDO.class, new MPJLambdaWrapperX() + .leftJoin(ConfigAssayMethodProjectParameterDO.class, ConfigAssayMethodProjectParameterDO::getId, BusinessAssayParameterDataDO::getConfigAssayMethodProjectParameterId) + .leftJoin(BusinessAssayProjectDataDO.class, BusinessAssayProjectDataDO::getId, BusinessAssayParameterDataDO::getBusinessAssayProjectDataId) + .leftJoin(ConfigAssayMethodProjectDO.class, ConfigAssayMethodProjectDO::getId, BusinessAssayProjectDataDO::getConfigAssayMethodProjectId) + .leftJoin(DictionaryProjectDO.class, DictionaryProjectDO::getId, BusinessAssayProjectDataDO::getDictionaryProjectId) + .eq(BusinessAssayProjectDataDO::getBusinessAssayTaskDataId, businessAssayTaskDataId) + .eq(DictionaryProjectDO::getSimpleName, projectSimpleName) + .eq(ConfigAssayMethodProjectParameterDO::getKey, parameterKey)); + } } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayProjectDataMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayProjectDataMapper.java index f1407d5..57443c2 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayProjectDataMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayProjectDataMapper.java @@ -6,17 +6,16 @@ import com.zt.plat.framework.common.pojo.PageResult; import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; import com.zt.plat.framework.mybatis.core.query.MPJLambdaWrapperX; import com.zt.plat.module.qms.business.bus.controller.vo.*; -import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayProjectAndParameterRespVO; -import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayProjectDataPageReqVO; -import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayProjectDataReqVO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayProjectDataDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDataDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleDO; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectDO; import com.zt.plat.module.qms.business.dic.dal.dataobject.DictionaryProjectDO; import com.zt.plat.module.qms.common.dic.dal.dataobject.DictionaryBusinessDO; +import com.zt.plat.module.qms.enums.QmsCommonConstant; import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; /** * 检测项目数据业务 Mapper @@ -32,7 +31,8 @@ public interface BusinessAssayProjectDataMapper extends BaseMapperX selectByBusinessAssayTaskId(Long businessAssayTaskId) { + return selectJoinList(BusinessAssayProjectDataExtendRespVO.class, new MPJLambdaWrapperX() + .leftJoin(BusinessAssayTaskDataDO.class, BusinessAssayTaskDataDO::getId, BusinessAssayProjectDataDO::getBusinessAssayTaskDataId) + .leftJoin(DictionaryProjectDO.class, DictionaryProjectDO::getId, BusinessAssayProjectDataDO::getDictionaryProjectId) + .selectAll(BusinessAssayProjectDataDO.class) + .selectAs(DictionaryProjectDO::getKey, BusinessAssayProjectDataExtendRespVO::getDictionaryProjectKey) + .selectAs(DictionaryProjectDO::getSimpleName, BusinessAssayProjectDataExtendRespVO::getSimpleName) + .selectAs(DictionaryProjectDO::getShowName, BusinessAssayProjectDataExtendRespVO::getShowName) + .eq(BusinessAssayTaskDataDO::getBusinessAssayTaskId, businessAssayTaskId) + .eq(BusinessAssayProjectDataDO::getIsEnabled, QmsCommonConstant.YES)); + } + default List selectByBusinessAssayTaskDataId(Long businessAssayTaskDataId) { return selectJoinList(BusinessAssayProjectDataExtendRespVO.class, new MPJLambdaWrapperX() .leftJoin(DictionaryProjectDO.class, DictionaryProjectDO::getId, BusinessAssayProjectDataDO::getDictionaryProjectId) @@ -97,11 +110,18 @@ public interface BusinessAssayProjectDataMapper extends BaseMapperX selectByBusinessAssayTaskDataIds(List businessAssayTaskDataIds) { return selectJoinList(BusinessAssayProjectDataExtendRespVO.class, new MPJLambdaWrapperX() + .leftJoin(BusinessAssayTaskDataDO.class, BusinessAssayTaskDataDO::getId, BusinessAssayProjectDataDO::getBusinessAssayTaskDataId) .leftJoin(DictionaryProjectDO.class, DictionaryProjectDO::getId, BusinessAssayProjectDataDO::getDictionaryProjectId) .selectAll(BusinessAssayProjectDataDO.class) .selectAs(DictionaryProjectDO::getKey, BusinessAssayProjectDataExtendRespVO::getDictionaryProjectKey) .selectAs(DictionaryProjectDO::getSimpleName, BusinessAssayProjectDataExtendRespVO::getSimpleName) .selectAs(DictionaryProjectDO::getShowName, BusinessAssayProjectDataExtendRespVO::getShowName) + .selectAs(BusinessAssayTaskDataDO::getAssayOperator, BusinessAssayProjectDataExtendRespVO::getAssayOperator) + .selectAs(BusinessAssayTaskDataDO::getRecheckCount, BusinessAssayProjectDataExtendRespVO::getRecheckCount) + .selectAs(BusinessAssayTaskDataDO::getRetestCount, BusinessAssayProjectDataExtendRespVO::getRetestCount) + .selectAs(BusinessAssayTaskDataDO::getBusinessBaseSampleId, BusinessAssayProjectDataExtendRespVO::getBusinessBaseSampleId) + .selectAs(BusinessAssayTaskDataDO::getBusinessSubParentSampleId, BusinessAssayProjectDataExtendRespVO::getBusinessSubParentSampleId) + .selectAs(BusinessAssayTaskDataDO::getBusinessSubSampleId, BusinessAssayProjectDataExtendRespVO::getBusinessSubSampleId) .in(BusinessAssayProjectDataDO::getBusinessAssayTaskDataId, businessAssayTaskDataIds)); } @@ -117,7 +137,8 @@ public interface BusinessAssayProjectDataMapper extends BaseMapperX selectAssayMethodProjectByBusinessSubSampleIdListAndConfigAssayMethodId(@Param("businessSubSampleIdList")List businessSubSampleIdList, @Param("configAssayMethodId") Long configAssayMethodId); + } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayReportDataMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayReportDataMapper.java index bb5434e..93352a0 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayReportDataMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayReportDataMapper.java @@ -46,6 +46,11 @@ public interface BusinessAssayReportDataMapper extends BaseMapperX selectBytBusinessBaseSampleIds(List businessBaseSampleIds) { + return selectList(new LambdaQueryWrapperX() + .inIfPresent(BusinessAssayReportDataDO::getBusinessBaseSampleId, businessBaseSampleIds)); + } + //查询报告待编制数据 Page queryWaitingDataForReport(IPage page, @Param("param") BusinessAssayReportDataPageReqVO param); diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayTaskDataMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayTaskDataMapper.java index 669497b..73bf35f 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayTaskDataMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayTaskDataMapper.java @@ -2,7 +2,6 @@ package com.zt.plat.module.qms.business.bus.dal.mapper; import java.util.*; -import com.alibaba.druid.sql.ast.statement.SQLForeignKeyImpl.On; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.github.yulichang.wrapper.MPJLambdaWrapper; import com.zt.plat.framework.common.pojo.PageResult; @@ -16,7 +15,6 @@ import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayTaskDataRe import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDataDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleAnalysisGroupDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleAssessmentDO; -import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleAssessmentProjectDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleDO; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodDO; import com.zt.plat.module.qms.enums.QmsCommonConstant; @@ -26,7 +24,6 @@ import cn.hutool.core.util.ObjectUtil; import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; -import org.apache.commons.lang3.StringUtils; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -39,83 +36,215 @@ import org.apache.ibatis.annotations.Param; public interface BusinessAssayTaskDataMapper extends BaseMapperX { default List selectList(BusinessAssayTaskDataReqVO reqVO) { - return selectJoinList(BusinessAssayTaskDataExtendRespVO.class, new MPJLambdaWrapperX() - .leftJoin(ConfigAssayMethodDO.class, ConfigAssayMethodDO::getId, BusinessAssayTaskDataDO::getConfigAssayMethodId) - .leftJoin(BusinessSubSampleDO.class, BusinessSubSampleDO::getId, BusinessAssayTaskDataDO::getBusinessSubSampleId) - .selectAll(BusinessAssayTaskDataDO.class) - .selectAs(ConfigAssayMethodDO::getName, BusinessAssayTaskDataExtendRespVO::getConfigAssayMethodName) - .selectAs(BusinessSubSampleDO::getSampleName, BusinessAssayTaskDataExtendRespVO::getSampleName) - .selectAs(BusinessSubSampleDO::getSampleCode, BusinessAssayTaskDataExtendRespVO::getSampleCode) - .selectAs(BusinessSubSampleDO::getSampleAssayCode, BusinessAssayTaskDataExtendRespVO::getSampleAssayCode) - .selectAs(BusinessSubSampleDO::getConfigSubSampleId, BusinessAssayTaskDataExtendRespVO::getConfigSubSampleId) - .eqIfPresent(BusinessAssayTaskDataDO::getBusinessBaseSampleId, reqVO.getBusinessBaseSampleId()) - .eqIfPresent(BusinessAssayTaskDataDO::getBusinessSubParentSampleId, reqVO.getBusinessSubParentSampleId()) - .eqIfPresent(BusinessAssayTaskDataDO::getBusinessSubSampleId, reqVO.getBusinessSubSampleId()) - .eqIfPresent(BusinessAssayTaskDataDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId()) - .eqIfPresent(BusinessAssayTaskDataDO::getBusinessAssayTaskId, reqVO.getBusinessAssayTaskId()) - .eqIfPresent(BusinessAssayTaskDataDO::getBusinessSubSampleAssessmentId, reqVO.getBusinessSubSampleAssessmentId()) - .eqIfPresent(BusinessAssayTaskDataDO::getTaskType, reqVO.getTaskType()) - .eqIfPresent(BusinessAssayTaskDataDO::getAssayType, reqVO.getAssayType()) - .eqIfPresent(BusinessAssayTaskDataDO::getAssayProject, reqVO.getAssayProject()) - .eqIfPresent(BusinessAssayTaskDataDO::getAssayDepartmentId, reqVO.getAssayDepartmentId()) - .likeIfPresent(BusinessAssayTaskDataDO::getAssayDepartmentName, reqVO.getAssayDepartmentName()) - .eqIfPresent(BusinessAssayTaskDataDO::getAssayOperator, reqVO.getAssayOperator()) - .eqIfPresent(BusinessAssayTaskDataDO::getAssayOperatorId, reqVO.getAssayOperatorId()) - .betweenIfPresent(BusinessAssayTaskDataDO::getAssignTaskTime, reqVO.getAssignTaskTime()) - .eqIfPresent(BusinessAssayTaskDataDO::getIsAssignTasked, reqVO.getIsAssignTasked()) - .eqIfPresent(BusinessAssayTaskDataDO::getIsReported, reqVO.getIsReported()) - .eqIfPresent(BusinessAssayTaskDataDO::getReporter, reqVO.getReporter()) - .eqIfPresent(BusinessAssayTaskDataDO::getReporterId, reqVO.getReporterId()) - .betweenIfPresent(BusinessAssayTaskDataDO::getReportTime, reqVO.getReportTime()) - .eqIfPresent(BusinessAssayTaskDataDO::getConfigSampleFlowId, reqVO.getConfigSampleFlowId()) - .eqIfPresent(BusinessAssayTaskDataDO::getSampleFlowNodeKey, reqVO.getSampleFlowNodeKey()) - .betweenIfPresent(BusinessAssayTaskDataDO::getSampleFlowNodeTime, reqVO.getSampleFlowNodeTime()) - .eqIfPresent(BusinessAssayTaskDataDO::getAnalysisCount, reqVO.getAnalysisCount()) - .eqIfPresent(BusinessAssayTaskDataDO::getUpdateCount, reqVO.getUpdateCount()) - .eqIfPresent(BusinessAssayTaskDataDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) - .betweenIfPresent(BusinessAssayTaskDataDO::getCreateTime, reqVO.getCreateTime()) - .eqIfPresent(BusinessAssayTaskDataDO::getRemark, reqVO.getRemark()) - .orderByDesc(BusinessAssayTaskDataDO::getId)); + MPJLambdaWrapper mpjLambdaWrapper = new MPJLambdaWrapperX() + .leftJoin(ConfigAssayMethodDO.class, ConfigAssayMethodDO::getId, BusinessAssayTaskDataDO::getConfigAssayMethodId) + .leftJoin(BusinessSubSampleDO.class, BusinessSubSampleDO::getId, BusinessAssayTaskDataDO::getBusinessSubSampleId) + .leftJoin(BusinessSubSampleAnalysisGroupDO.class, on -> on + .eq(BusinessSubSampleAnalysisGroupDO::getBusinessSubSampleId, BusinessAssayTaskDataDO::getBusinessSubSampleId) + .eq(BusinessSubSampleAnalysisGroupDO::getAssayDepartmentId, BusinessAssayTaskDataDO::getAssayDepartmentId)) + .selectAll(BusinessAssayTaskDataDO.class) + .selectAs(ConfigAssayMethodDO::getName, BusinessAssayTaskDataExtendRespVO::getConfigAssayMethodName) + .selectAs(ConfigAssayMethodDO::getMethodNameCategory, BusinessAssayTaskDataExtendRespVO::getConfigAssayMethodNameAndCategory) + .selectAs(BusinessSubSampleDO::getSampleName, BusinessAssayTaskDataExtendRespVO::getSampleName) + .selectAs(BusinessSubSampleDO::getSampleCode, BusinessAssayTaskDataExtendRespVO::getSampleCode) + .selectAs(BusinessSubSampleDO::getSampleAssayCode, BusinessAssayTaskDataExtendRespVO::getSampleAssayCode) + .selectAs(BusinessSubSampleDO::getConfigSubSampleId, BusinessAssayTaskDataExtendRespVO::getConfigSubSampleId); + if (ObjectUtil.isNotEmpty(reqVO.getBusinessBaseSampleId())) { + mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getBusinessBaseSampleId, reqVO.getBusinessBaseSampleId()); + } + if (ObjectUtil.isNotEmpty(reqVO.getBusinessSubParentSampleId())) { + mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getBusinessSubParentSampleId, reqVO.getBusinessSubParentSampleId()); + } + if (ObjectUtil.isNotEmpty(reqVO.getBusinessSubSampleId())) { + mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getBusinessSubSampleId, reqVO.getBusinessSubSampleId()); + } + if (ObjectUtil.isNotEmpty(reqVO.getConfigAssayMethodId())) { + mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId()); + } + if (ObjectUtil.isNotEmpty(reqVO.getBusinessAssayTaskId())) { + mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getBusinessAssayTaskId, reqVO.getBusinessAssayTaskId()); + } + if (ObjectUtil.isNotEmpty(reqVO.getBusinessSubSampleAssessmentId())) { + mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getBusinessSubSampleAssessmentId, reqVO.getBusinessSubSampleAssessmentId()); + } + if (ObjectUtil.isNotEmpty(reqVO.getTaskType())) { + mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getTaskType, reqVO.getTaskType()); + } + if (ObjectUtil.isNotEmpty(reqVO.getAssayType())) { + mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getAssayType, reqVO.getAssayType()); + } + if (ObjectUtil.isNotEmpty(reqVO.getAssayProject())) { + mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getAssayProject, reqVO.getAssayProject()); + } + if (ObjectUtil.isNotEmpty(reqVO.getAssayDepartmentId())) { + mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getAssayDepartmentId, reqVO.getAssayDepartmentId()); + } + if (ObjectUtil.isNotEmpty(reqVO.getAssayDepartmentName())) { + mpjLambdaWrapper.like(BusinessAssayTaskDataDO::getAssayDepartmentName, reqVO.getAssayDepartmentName()); + } + if (ObjectUtil.isNotEmpty(reqVO.getAssayOperator())) { + mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getAssayOperator, reqVO.getAssayOperator()); + } + if (ObjectUtil.isNotEmpty(reqVO.getAssayOperatorId())) { + mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getAssayOperatorId, reqVO.getAssayOperatorId()); + } + if (ObjectUtil.isNotEmpty(reqVO.getAssignTaskTime()) && ObjectUtil.isNotEmpty(reqVO.getAssignTaskTime()[0]) && ObjectUtil.isNotEmpty(reqVO.getAssignTaskTime()[1])) { + mpjLambdaWrapper.between(BusinessAssayTaskDataDO::getAssignTaskTime, reqVO.getAssignTaskTime()[0], reqVO.getAssignTaskTime()[1]); + } + if (ObjectUtil.isNotEmpty(reqVO.getIsAssignTasked())) { + mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getIsAssignTasked, reqVO.getIsAssignTasked()); + } + if (ObjectUtil.isNotEmpty(reqVO.getIsReported())) { + mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getIsReported, reqVO.getIsReported()); + } + if (ObjectUtil.isNotEmpty(reqVO.getReporter())) { + mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getReporter, reqVO.getReporter()); + } + if (ObjectUtil.isNotEmpty(reqVO.getReporterId())) { + mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getReporterId, reqVO.getReporterId()); + } + if (ObjectUtil.isNotEmpty(reqVO.getReportTime()) && ObjectUtil.isNotEmpty(reqVO.getReportTime()[0]) && ObjectUtil.isNotEmpty(reqVO.getReportTime()[1])) { + mpjLambdaWrapper.between(BusinessAssayTaskDataDO::getReportTime, reqVO.getReportTime()[0], reqVO.getReportTime()[1]); + } + if (ObjectUtil.isNotEmpty(reqVO.getConfigSampleFlowId())) { + mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getConfigSampleFlowId, reqVO.getConfigSampleFlowId()); + } + if (ObjectUtil.isNotEmpty(reqVO.getSampleFlowNodeKey())) { + mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getSampleFlowNodeKey, reqVO.getSampleFlowNodeKey()); + } + if (ObjectUtil.isNotEmpty(reqVO.getSampleFlowNodeTime()) && ObjectUtil.isNotEmpty(reqVO.getSampleFlowNodeTime()[0]) && ObjectUtil.isNotEmpty(reqVO.getSampleFlowNodeTime()[1])) { + mpjLambdaWrapper.between(BusinessAssayTaskDataDO::getSampleFlowNodeTime, reqVO.getSampleFlowNodeTime()[0], reqVO.getSampleFlowNodeTime()[1]); + } + if (ObjectUtil.isNotEmpty(reqVO.getRecheckCount())) { + mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getRecheckCount, reqVO.getRecheckCount()); + } + if (ObjectUtil.isNotEmpty(reqVO.getRetestCount())) { + mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getRetestCount, reqVO.getRetestCount()); + } + if (ObjectUtil.isNotEmpty(reqVO.getUpdateCount())) { + mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getUpdateCount, reqVO.getUpdateCount()); + } + if (ObjectUtil.isNotEmpty(reqVO.getSystemDepartmentCode())) { + mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()); + } + if (ObjectUtil.isNotEmpty(reqVO.getCreateTime()) && ObjectUtil.isNotEmpty(reqVO.getCreateTime()[0]) && ObjectUtil.isNotEmpty(reqVO.getCreateTime()[1])) { + mpjLambdaWrapper.between(BusinessAssayTaskDataDO::getCreateTime, reqVO.getCreateTime()[0], reqVO.getCreateTime()[1]); + } + if (ObjectUtil.isNotEmpty(reqVO.getRemark())) { + mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getRemark, reqVO.getRemark()); + } + + if (ObjectUtil.isNotEmpty(reqVO.getSampleStatus())) { + mpjLambdaWrapper.eq(BusinessSubSampleAnalysisGroupDO::getSampleStatus, reqVO.getSampleStatus()); + } + mpjLambdaWrapper.orderByAsc(BusinessAssayTaskDataDO::getSampleFlowNodeTime).orderByAsc(BusinessSubSampleDO::getSampleAssayCode); + return selectJoinList(BusinessAssayTaskDataExtendRespVO.class, mpjLambdaWrapper); } default PageResult selectPage(BusinessAssayTaskDataPageReqVO reqVO) { - return selectJoinPage(reqVO, BusinessAssayTaskDataExtendRespVO.class, new MPJLambdaWrapperX() - .leftJoin(ConfigAssayMethodDO.class, ConfigAssayMethodDO::getId, BusinessAssayTaskDataDO::getConfigAssayMethodId) - .leftJoin(BusinessSubSampleDO.class, BusinessSubSampleDO::getId, BusinessAssayTaskDataDO::getBusinessSubSampleId) - .selectAll(BusinessAssayTaskDataDO.class) - .selectAs(ConfigAssayMethodDO::getName, BusinessAssayTaskDataExtendRespVO::getConfigAssayMethodName) - .selectAs(BusinessSubSampleDO::getSampleName, BusinessAssayTaskDataExtendRespVO::getSampleName) - .selectAs(BusinessSubSampleDO::getSampleCode, BusinessAssayTaskDataExtendRespVO::getSampleCode) - .selectAs(BusinessSubSampleDO::getSampleAssayCode, BusinessAssayTaskDataExtendRespVO::getSampleAssayCode) - .selectAs(BusinessSubSampleDO::getConfigSubSampleId, BusinessAssayTaskDataExtendRespVO::getConfigSubSampleId) - .eqIfPresent(BusinessAssayTaskDataDO::getBusinessBaseSampleId, reqVO.getBusinessBaseSampleId()) - .eqIfPresent(BusinessAssayTaskDataDO::getBusinessSubParentSampleId, reqVO.getBusinessSubParentSampleId()) - .eqIfPresent(BusinessAssayTaskDataDO::getBusinessSubSampleId, reqVO.getBusinessSubSampleId()) - .eqIfPresent(BusinessAssayTaskDataDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId()) - .eqIfPresent(BusinessAssayTaskDataDO::getBusinessAssayTaskId, reqVO.getBusinessAssayTaskId()) - .eqIfPresent(BusinessAssayTaskDataDO::getBusinessSubSampleAssessmentId, reqVO.getBusinessSubSampleAssessmentId()) - .eqIfPresent(BusinessAssayTaskDataDO::getTaskType, reqVO.getTaskType()) - .eqIfPresent(BusinessAssayTaskDataDO::getAssayType, reqVO.getAssayType()) - .eqIfPresent(BusinessAssayTaskDataDO::getAssayProject, reqVO.getAssayProject()) - .eqIfPresent(BusinessAssayTaskDataDO::getAssayDepartmentId, reqVO.getAssayDepartmentId()) - .likeIfPresent(BusinessAssayTaskDataDO::getAssayDepartmentName, reqVO.getAssayDepartmentName()) - .eqIfPresent(BusinessAssayTaskDataDO::getAssayOperator, reqVO.getAssayOperator()) - .eqIfPresent(BusinessAssayTaskDataDO::getAssayOperatorId, reqVO.getAssayOperatorId()) - .betweenIfPresent(BusinessAssayTaskDataDO::getAssignTaskTime, reqVO.getAssignTaskTime()) - .eqIfPresent(BusinessAssayTaskDataDO::getIsAssignTasked, reqVO.getIsAssignTasked()) - .eqIfPresent(BusinessAssayTaskDataDO::getIsReported, reqVO.getIsReported()) - .eqIfPresent(BusinessAssayTaskDataDO::getReporter, reqVO.getReporter()) - .eqIfPresent(BusinessAssayTaskDataDO::getReporterId, reqVO.getReporterId()) - .betweenIfPresent(BusinessAssayTaskDataDO::getReportTime, reqVO.getReportTime()) - .eqIfPresent(BusinessAssayTaskDataDO::getConfigSampleFlowId, reqVO.getConfigSampleFlowId()) - .eqIfPresent(BusinessAssayTaskDataDO::getSampleFlowNodeKey, reqVO.getSampleFlowNodeKey()) - .betweenIfPresent(BusinessAssayTaskDataDO::getSampleFlowNodeTime, reqVO.getSampleFlowNodeTime()) - .eqIfPresent(BusinessAssayTaskDataDO::getAnalysisCount, reqVO.getAnalysisCount()) - .eqIfPresent(BusinessAssayTaskDataDO::getUpdateCount, reqVO.getUpdateCount()) - .eqIfPresent(BusinessAssayTaskDataDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) - .betweenIfPresent(BusinessAssayTaskDataDO::getCreateTime, reqVO.getCreateTime()) - .eqIfPresent(BusinessAssayTaskDataDO::getRemark, reqVO.getRemark()) - .orderByDesc(BusinessAssayTaskDataDO::getId)); + MPJLambdaWrapper mpjLambdaWrapper = new MPJLambdaWrapperX() + .leftJoin(ConfigAssayMethodDO.class, ConfigAssayMethodDO::getId, BusinessAssayTaskDataDO::getConfigAssayMethodId) + .leftJoin(BusinessSubSampleDO.class, BusinessSubSampleDO::getId, BusinessAssayTaskDataDO::getBusinessSubSampleId) + .leftJoin(BusinessSubSampleAnalysisGroupDO.class, on -> on + .eq(BusinessSubSampleAnalysisGroupDO::getBusinessSubSampleId, BusinessAssayTaskDataDO::getBusinessSubSampleId) + .eq(BusinessSubSampleAnalysisGroupDO::getAssayDepartmentId, BusinessAssayTaskDataDO::getAssayDepartmentId)) + .selectAll(BusinessAssayTaskDataDO.class) + .selectAs(ConfigAssayMethodDO::getName, BusinessAssayTaskDataExtendRespVO::getConfigAssayMethodName) + .selectAs(ConfigAssayMethodDO::getMethodNameCategory, BusinessAssayTaskDataExtendRespVO::getConfigAssayMethodNameAndCategory) + .selectAs(BusinessSubSampleDO::getSampleName, BusinessAssayTaskDataExtendRespVO::getSampleName) + .selectAs(BusinessSubSampleDO::getSampleCode, BusinessAssayTaskDataExtendRespVO::getSampleCode) + .selectAs(BusinessSubSampleDO::getSampleAssayCode, BusinessAssayTaskDataExtendRespVO::getSampleAssayCode) + .selectAs(BusinessSubSampleDO::getConfigSubSampleId, BusinessAssayTaskDataExtendRespVO::getConfigSubSampleId); + if (ObjectUtil.isNotEmpty(reqVO.getBusinessBaseSampleId())) { + mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getBusinessBaseSampleId, reqVO.getBusinessBaseSampleId()); + } + if (ObjectUtil.isNotEmpty(reqVO.getBusinessSubParentSampleId())) { + mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getBusinessSubParentSampleId, reqVO.getBusinessSubParentSampleId()); + } + if (ObjectUtil.isNotEmpty(reqVO.getBusinessSubSampleId())) { + mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getBusinessSubSampleId, reqVO.getBusinessSubSampleId()); + } + if (ObjectUtil.isNotEmpty(reqVO.getConfigAssayMethodId())) { + mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId()); + } + if (ObjectUtil.isNotEmpty(reqVO.getBusinessAssayTaskId())) { + mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getBusinessAssayTaskId, reqVO.getBusinessAssayTaskId()); + } + if (ObjectUtil.isNotEmpty(reqVO.getBusinessSubSampleAssessmentId())) { + mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getBusinessSubSampleAssessmentId, reqVO.getBusinessSubSampleAssessmentId()); + } + if (ObjectUtil.isNotEmpty(reqVO.getTaskType())) { + mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getTaskType, reqVO.getTaskType()); + } + if (ObjectUtil.isNotEmpty(reqVO.getAssayType())) { + mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getAssayType, reqVO.getAssayType()); + } + if (ObjectUtil.isNotEmpty(reqVO.getAssayProject())) { + mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getAssayProject, reqVO.getAssayProject()); + } + if (ObjectUtil.isNotEmpty(reqVO.getAssayDepartmentId())) { + mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getAssayDepartmentId, reqVO.getAssayDepartmentId()); + } + if (ObjectUtil.isNotEmpty(reqVO.getAssayDepartmentName())) { + mpjLambdaWrapper.like(BusinessAssayTaskDataDO::getAssayDepartmentName, reqVO.getAssayDepartmentName()); + } + if (ObjectUtil.isNotEmpty(reqVO.getAssayOperator())) { + mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getAssayOperator, reqVO.getAssayOperator()); + } + if (ObjectUtil.isNotEmpty(reqVO.getAssayOperatorId())) { + mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getAssayOperatorId, reqVO.getAssayOperatorId()); + } + if (ObjectUtil.isNotEmpty(reqVO.getAssignTaskTime()) && ObjectUtil.isNotEmpty(reqVO.getAssignTaskTime()[0]) && ObjectUtil.isNotEmpty(reqVO.getAssignTaskTime()[1])) { + mpjLambdaWrapper.between(BusinessAssayTaskDataDO::getAssignTaskTime, reqVO.getAssignTaskTime()[0], reqVO.getAssignTaskTime()[1]); + } + if (ObjectUtil.isNotEmpty(reqVO.getIsAssignTasked())) { + mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getIsAssignTasked, reqVO.getIsAssignTasked()); + } + if (ObjectUtil.isNotEmpty(reqVO.getIsReported())) { + mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getIsReported, reqVO.getIsReported()); + } + if (ObjectUtil.isNotEmpty(reqVO.getReporter())) { + mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getReporter, reqVO.getReporter()); + } + if (ObjectUtil.isNotEmpty(reqVO.getReporterId())) { + mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getReporterId, reqVO.getReporterId()); + } + if (ObjectUtil.isNotEmpty(reqVO.getReportTime()) && ObjectUtil.isNotEmpty(reqVO.getReportTime()[0]) && ObjectUtil.isNotEmpty(reqVO.getReportTime()[1])) { + mpjLambdaWrapper.between(BusinessAssayTaskDataDO::getReportTime, reqVO.getReportTime()[0], reqVO.getReportTime()[1]); + } + if (ObjectUtil.isNotEmpty(reqVO.getConfigSampleFlowId())) { + mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getConfigSampleFlowId, reqVO.getConfigSampleFlowId()); + } + if (ObjectUtil.isNotEmpty(reqVO.getSampleFlowNodeKey())) { + mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getSampleFlowNodeKey, reqVO.getSampleFlowNodeKey()); + } + if (ObjectUtil.isNotEmpty(reqVO.getSampleFlowNodeTime()) && ObjectUtil.isNotEmpty(reqVO.getSampleFlowNodeTime()[0]) && ObjectUtil.isNotEmpty(reqVO.getSampleFlowNodeTime()[1])) { + mpjLambdaWrapper.between(BusinessAssayTaskDataDO::getSampleFlowNodeTime, reqVO.getSampleFlowNodeTime()[0], reqVO.getSampleFlowNodeTime()[1]); + } + if (ObjectUtil.isNotEmpty(reqVO.getRecheckCount())) { + mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getRecheckCount, reqVO.getRecheckCount()); + } + if (ObjectUtil.isNotEmpty(reqVO.getRetestCount())) { + mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getRetestCount, reqVO.getRetestCount()); + } + if (ObjectUtil.isNotEmpty(reqVO.getUpdateCount())) { + mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getUpdateCount, reqVO.getUpdateCount()); + } + if (ObjectUtil.isNotEmpty(reqVO.getSystemDepartmentCode())) { + mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()); + } + if (ObjectUtil.isNotEmpty(reqVO.getCreateTime()) && ObjectUtil.isNotEmpty(reqVO.getCreateTime()[0]) && ObjectUtil.isNotEmpty(reqVO.getCreateTime()[1])) { + mpjLambdaWrapper.between(BusinessAssayTaskDataDO::getCreateTime, reqVO.getCreateTime()[0], reqVO.getCreateTime()[1]); + } + if (ObjectUtil.isNotEmpty(reqVO.getRemark())) { + mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getRemark, reqVO.getRemark()); + } + + if (ObjectUtil.isNotEmpty(reqVO.getSampleStatus())) { + mpjLambdaWrapper.eq(BusinessSubSampleAnalysisGroupDO::getSampleStatus, reqVO.getSampleStatus()); + } + mpjLambdaWrapper.orderByAsc(BusinessAssayTaskDataDO::getSampleFlowNodeTime).orderByAsc(BusinessSubSampleDO::getSampleAssayCode); + return selectJoinPage(reqVO, BusinessAssayTaskDataExtendRespVO.class, mpjLambdaWrapper); } @@ -140,6 +269,31 @@ public interface BusinessAssayTaskDataMapper extends BaseMapperX selectBySampleAssayCodesAndConfigAssayMethodId(List sampleAssayCodes, Long configAssayMethodId) { + return selectJoinList(BusinessAssayTaskDataExtendRespVO.class, new MPJLambdaWrapperX() + .leftJoin(BusinessSubSampleDO.class, BusinessSubSampleDO::getId, BusinessAssayTaskDataDO::getBusinessSubSampleId) + .selectAll(BusinessAssayTaskDataDO.class) + .selectAs(BusinessSubSampleDO::getSampleName, BusinessAssayTaskDataExtendRespVO::getSampleName) + .selectAs(BusinessSubSampleDO::getSampleCode, BusinessAssayTaskDataExtendRespVO::getSampleCode) + .selectAs(BusinessSubSampleDO::getSampleAssayCode, BusinessAssayTaskDataExtendRespVO::getSampleAssayCode) + .in(BusinessSubSampleDO::getSampleAssayCode, sampleAssayCodes) + .eq(BusinessAssayTaskDataDO::getConfigAssayMethodId, configAssayMethodId) + .eq(BusinessAssayTaskDataDO::getIsReported, QmsCommonConstant.NO)); + } + + default List selectBySampleAssayCodesAndConfigAssayMethodDictionaryBusinessKey(List sampleAssayCodes, String configAssayMethodDictionaryBusinessKey) { + return selectJoinList(BusinessAssayTaskDataExtendRespVO.class, new MPJLambdaWrapperX() + .leftJoin(BusinessSubSampleDO.class, BusinessSubSampleDO::getId, BusinessAssayTaskDataDO::getBusinessSubSampleId) + .leftJoin(ConfigAssayMethodDO.class, ConfigAssayMethodDO::getId, BusinessAssayTaskDataDO::getConfigAssayMethodId) + .selectAll(BusinessAssayTaskDataDO.class) + .selectAs(BusinessSubSampleDO::getSampleName, BusinessAssayTaskDataExtendRespVO::getSampleName) + .selectAs(BusinessSubSampleDO::getSampleCode, BusinessAssayTaskDataExtendRespVO::getSampleCode) + .selectAs(BusinessSubSampleDO::getSampleAssayCode, BusinessAssayTaskDataExtendRespVO::getSampleAssayCode) + .in(BusinessSubSampleDO::getSampleAssayCode, sampleAssayCodes) + .eq(ConfigAssayMethodDO::getDictionaryBusinessKey, configAssayMethodDictionaryBusinessKey) + .eq(BusinessAssayTaskDataDO::getIsReported, QmsCommonConstant.NO)); + } + default List selectResultAssessmentList(BusinessAssayTaskDataReqVO reqVO) { MPJLambdaWrapper mpjLambdaWrapper = new MPJLambdaWrapper() .leftJoin(ConfigAssayMethodDO.class, ConfigAssayMethodDO::getId, BusinessAssayTaskDataDO::getConfigAssayMethodId) @@ -150,6 +304,7 @@ public interface BusinessAssayTaskDataMapper extends BaseMapperX selectMaxAnalysisCountByBusinessSubSampleIdAndConfigAssayMethodId(Long businessSubSampleId, Long configAssayMethodId) { - BusinessAssayTaskDataDO maxAnalysisCount = selectOne(new LambdaQueryWrapperX() + default List selectMaxRecheckCountByBusinessSubSampleIdAndConfigAssayMethodId(Long businessSubSampleId, Long configAssayMethodId) { + BusinessAssayTaskDataDO maxRecheckCountBusinessAssayTaskData = selectOne(new LambdaQueryWrapperX() .eq(BusinessAssayTaskDataDO::getBusinessSubSampleId, businessSubSampleId) .eq(BusinessAssayTaskDataDO::getConfigAssayMethodId, configAssayMethodId) - .orderByDesc(BusinessAssayTaskDataDO::getAnalysisCount) + .orderByDesc(BusinessAssayTaskDataDO::getRecheckCount) .last("LIMIT 1")); return selectList(new LambdaQueryWrapperX() .eq(BusinessAssayTaskDataDO::getBusinessSubSampleId, businessSubSampleId) .eq(BusinessAssayTaskDataDO::getConfigAssayMethodId, configAssayMethodId) - .eq(BusinessAssayTaskDataDO::getAnalysisCount, maxAnalysisCount.getAnalysisCount())); + .eq(BusinessAssayTaskDataDO::getRecheckCount, maxRecheckCountBusinessAssayTaskData.getRecheckCount())); } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayTaskDetailMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayTaskDetailMapper.java index 4c73ff9..c14ffdc 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayTaskDetailMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayTaskDetailMapper.java @@ -49,7 +49,7 @@ public interface BusinessAssayTaskDetailMapper extends BaseMapperX selectList(BusinessAssayTaskDetailReqVO reqVO) { @@ -80,7 +80,7 @@ public interface BusinessAssayTaskDetailMapper extends BaseMapperX selectByBusinessAssayTaskId(Long businessAssayTaskId) { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayTaskMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayTaskMapper.java index ff497c4..6b1ebe1 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayTaskMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayTaskMapper.java @@ -29,6 +29,7 @@ public interface BusinessAssayTaskMapper extends BaseMapperX { + + default PageResult selectPage(BusinessAssayTaskParameterDataPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(BusinessAssayTaskParameterDataDO::getBusinessAssayTaskDataId, reqVO.getBusinessAssayTaskDataId()) + .eqIfPresent(BusinessAssayTaskParameterDataDO::getConfigAssayMethodParameterId, reqVO.getConfigAssayMethodParameterId()) + .eqIfPresent(BusinessAssayTaskParameterDataDO::getValue, reqVO.getValue()) + .eqIfPresent(BusinessAssayTaskParameterDataDO::getDataType, reqVO.getDataType()) + .eqIfPresent(BusinessAssayTaskParameterDataDO::getDecimalPosition, reqVO.getDecimalPosition()) + .eqIfPresent(BusinessAssayTaskParameterDataDO::getUpdateCount, reqVO.getUpdateCount()) + .eqIfPresent(BusinessAssayTaskParameterDataDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .betweenIfPresent(BusinessAssayTaskParameterDataDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(BusinessAssayTaskParameterDataDO::getRemark, reqVO.getRemark()) + .orderByDesc(BusinessAssayTaskParameterDataDO::getId)); + } + + default List selectByBusinessAssayTaskDataIds(List businessAssayTaskDataIdList) { + return selectJoinList(BusinessAssayProjectAndParameterRespVO.class, new MPJLambdaWrapperX() + .leftJoin(ConfigAssayMethodParameterDO.class, ConfigAssayMethodParameterDO::getId, BusinessAssayTaskParameterDataDO::getConfigAssayMethodParameterId) + .leftJoin(DictionaryBusinessDO.class, DictionaryBusinessDO::getId, ConfigAssayMethodParameterDO::getDictionaryBusinessId) + .selectAs(BusinessAssayTaskParameterDataDO::getId, BusinessAssayProjectAndParameterRespVO::getId) + .selectAs(BusinessAssayTaskParameterDataDO::getBusinessAssayTaskDataId, BusinessAssayProjectAndParameterRespVO::getBizId) + .selectAs(BusinessAssayTaskParameterDataDO::getConfigAssayMethodParameterId, BusinessAssayProjectAndParameterRespVO::getDicId) + .selectAs(ConfigAssayMethodParameterDO::getKey, BusinessAssayProjectAndParameterRespVO::getDicKey) + .selectAs(ConfigAssayMethodParameterDO::getParameterName, BusinessAssayProjectAndParameterRespVO::getName) + .selectAs(ConfigAssayMethodParameterDO::getParameterName, BusinessAssayProjectAndParameterRespVO::getShowName) + .selectAs(ConfigAssayMethodParameterDO::getFillingWay, BusinessAssayProjectAndParameterRespVO::getFillingWay) + .selectAs(BusinessAssayTaskParameterDataDO::getDataType, BusinessAssayProjectAndParameterRespVO::getDataType) + .selectAs(BusinessAssayTaskParameterDataDO::getDecimalPosition, BusinessAssayProjectAndParameterRespVO::getDecimalPosition) + .selectAs(BusinessAssayTaskParameterDataDO::getValue, BusinessAssayProjectAndParameterRespVO::getValue) + //.selectAs(ConfigAssayMethodParameterDO::getDictionaryProjectUnit, BusinessAssayProjectAndParameterRespVO::getUnit) + .selectAs(ConfigAssayMethodParameterDO::getIsNull, BusinessAssayProjectAndParameterRespVO::getIsNull) + //.selectAs(ConfigAssayMethodParameterDO::getFormula, BusinessAssayProjectAndParameterRespVO::getFormula) + .selectAs(ConfigAssayMethodParameterDO::getSortNo, BusinessAssayProjectAndParameterRespVO::getParamNo) + .selectAs("'attribute'", BusinessAssayProjectAndParameterRespVO::getType) + .selectAs(ConfigAssayMethodParameterDO::getDictionaryBusinessId, BusinessAssayProjectAndParameterRespVO::getGroupDictionaryBusinessId) + .selectAs(ConfigAssayMethodParameterDO::getDictionaryBusinessKey, BusinessAssayProjectAndParameterRespVO::getGroupDictionaryBusinessKey) + .selectAs(DictionaryBusinessDO::getName, BusinessAssayProjectAndParameterRespVO::getGroupDictionaryBusinessName) + .in(BusinessAssayTaskParameterDataDO::getBusinessAssayTaskDataId, businessAssayTaskDataIdList) + .orderByAsc(ConfigAssayMethodParameterDO::getSortNo)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessHandoverRecordSubMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessHandoverRecordSubMapper.java index 7749762..c73c4f2 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessHandoverRecordSubMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessHandoverRecordSubMapper.java @@ -47,7 +47,10 @@ public interface BusinessHandoverRecordSubMapper extends BaseMapperX { - default PageResult selectPage(BusinessQCCoefficientDataPageReqVO reqVO) { - return selectPage(reqVO, new LambdaQueryWrapperX() - .eqIfPresent(BusinessQCCoefficientDataDO::getSampleCode, reqVO.getSampleCode()) - .likeIfPresent(BusinessQCCoefficientDataDO::getSampleName, reqVO.getSampleName()) - .eqIfPresent(BusinessQCCoefficientDataDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId()) - .eqIfPresent(BusinessQCCoefficientDataDO::getBusinessAssayTaskId, reqVO.getBusinessAssayTaskId()) - .eqIfPresent(BusinessQCCoefficientDataDO::getBusinessStandardSampleId, reqVO.getBusinessStandardSampleId()) - .eqIfPresent(BusinessQCCoefficientDataDO::getDictionaryBusinessId, reqVO.getDictionaryBusinessId()) - .eqIfPresent(BusinessQCCoefficientDataDO::getDictionaryBusinessKey, reqVO.getDictionaryBusinessKey()) - .eqIfPresent(BusinessQCCoefficientDataDO::getAssayProject, reqVO.getAssayProject()) - .eqIfPresent(BusinessQCCoefficientDataDO::getAssayDepartmentId, reqVO.getAssayDepartmentId()) - .likeIfPresent(BusinessQCCoefficientDataDO::getAssayDepartmentName, reqVO.getAssayDepartmentName()) - .eqIfPresent(BusinessQCCoefficientDataDO::getAssayOperator, reqVO.getAssayOperator()) - .eqIfPresent(BusinessQCCoefficientDataDO::getAssayOperatorId, reqVO.getAssayOperatorId()) - .betweenIfPresent(BusinessQCCoefficientDataDO::getAssignTaskTime, reqVO.getAssignTaskTime()) - .eqIfPresent(BusinessQCCoefficientDataDO::getIsAssignTasked, reqVO.getIsAssignTasked()) - .eqIfPresent(BusinessQCCoefficientDataDO::getIsReported, reqVO.getIsReported()) - .eqIfPresent(BusinessQCCoefficientDataDO::getReporter, reqVO.getReporter()) - .eqIfPresent(BusinessQCCoefficientDataDO::getReporterId, reqVO.getReporterId()) - .betweenIfPresent(BusinessQCCoefficientDataDO::getReportTime, reqVO.getReportTime()) - .eqIfPresent(BusinessQCCoefficientDataDO::getUpdateCount, reqVO.getUpdateCount()) - .eqIfPresent(BusinessQCCoefficientDataDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) - .betweenIfPresent(BusinessQCCoefficientDataDO::getCreateTime, reqVO.getCreateTime()) - .eqIfPresent(BusinessQCCoefficientDataDO::getRemark, reqVO.getRemark()) - .orderByDesc(BusinessQCCoefficientDataDO::getId)); + default PageResult selectPage(BusinessQCCoefficientDataPageReqVO reqVO) { + MPJLambdaWrapperX queryLambdaWrapperX = new MPJLambdaWrapperX(); + queryLambdaWrapperX = (MPJLambdaWrapperX) queryLambdaWrapperX.leftJoin(DictionaryBusinessDO.class, "dbd1", DictionaryBusinessDO::getId, BusinessQCCoefficientDataDO::getDictionaryBusinessId); + queryLambdaWrapperX = (MPJLambdaWrapperX) queryLambdaWrapperX.leftJoin(DictionaryBusinessDO.class, "dbd2", DictionaryBusinessDO::getId, "dbd1", DictionaryBusinessDO::getParentId); + queryLambdaWrapperX = queryLambdaWrapperX.selectAll(BusinessQCCoefficientDataDO.class); + queryLambdaWrapperX = (MPJLambdaWrapperX) queryLambdaWrapperX.selectAs("dbd1", DictionaryBusinessDO::getName, ConfigQCSampleMethodExtendRespVO::getDictionaryBusinessName); + queryLambdaWrapperX = (MPJLambdaWrapperX) queryLambdaWrapperX.selectAs("dbd1", DictionaryBusinessDO::getParentId, ConfigQCSampleMethodExtendRespVO::getParentDictionaryBusinessId); + queryLambdaWrapperX = (MPJLambdaWrapperX) queryLambdaWrapperX.selectAs("dbd2", DictionaryBusinessDO::getKey, ConfigQCSampleMethodExtendRespVO::getParentDictionaryBusinesskey); + queryLambdaWrapperX = (MPJLambdaWrapperX) queryLambdaWrapperX.selectAs("dbd2", DictionaryBusinessDO::getName, ConfigQCSampleMethodExtendRespVO::getParentDictionaryBusinessName); + queryLambdaWrapperX.eqIfPresent(BusinessQCCoefficientDataDO::getSampleCode, reqVO.getSampleCode()) + .likeIfPresent(BusinessQCCoefficientDataDO::getSampleName, reqVO.getSampleName()) + .eqIfPresent(BusinessQCCoefficientDataDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId()) + .eqIfPresent(BusinessQCCoefficientDataDO::getBusinessAssayTaskId, reqVO.getBusinessAssayTaskId()) + .eqIfPresent(BusinessQCCoefficientDataDO::getBusinessStandardSampleId, reqVO.getBusinessStandardSampleId()) + .eqIfPresent(BusinessQCCoefficientDataDO::getDictionaryBusinessId, reqVO.getDictionaryBusinessId()) + .eqIfPresent(BusinessQCCoefficientDataDO::getDictionaryBusinessKey, reqVO.getDictionaryBusinessKey()) + .eqIfPresent(BusinessQCCoefficientDataDO::getAssayProject, reqVO.getAssayProject()) + .eqIfPresent(BusinessQCCoefficientDataDO::getAssayDepartmentId, reqVO.getAssayDepartmentId()) + .likeIfPresent(BusinessQCCoefficientDataDO::getAssayDepartmentName, reqVO.getAssayDepartmentName()) + .eqIfPresent(BusinessQCCoefficientDataDO::getAssayOperator, reqVO.getAssayOperator()) + .eqIfPresent(BusinessQCCoefficientDataDO::getAssayOperatorId, reqVO.getAssayOperatorId()) + .betweenIfPresent(BusinessQCCoefficientDataDO::getAssignTaskTime, reqVO.getAssignTaskTime()) + .eqIfPresent(BusinessQCCoefficientDataDO::getIsAssignTasked, reqVO.getIsAssignTasked()) + .eqIfPresent(BusinessQCCoefficientDataDO::getIsReported, reqVO.getIsReported()) + .eqIfPresent(BusinessQCCoefficientDataDO::getReporter, reqVO.getReporter()) + .eqIfPresent(BusinessQCCoefficientDataDO::getReporterId, reqVO.getReporterId()) + .betweenIfPresent(BusinessQCCoefficientDataDO::getReportTime, reqVO.getReportTime()) + .eqIfPresent(BusinessQCCoefficientDataDO::getUpdateCount, reqVO.getUpdateCount()) + .eqIfPresent(BusinessQCCoefficientDataDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .betweenIfPresent(BusinessQCCoefficientDataDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(BusinessQCCoefficientDataDO::getRemark, reqVO.getRemark()) + .orderByDesc(BusinessQCCoefficientDataDO::getId); + + return selectJoinPage(reqVO, BusinessQCCoefficientDataExtendRespVO.class, queryLambdaWrapperX); } - default List selectList(BusinessQCCoefficientDataReqVO reqVO) { - return selectList(new LambdaQueryWrapperX() - .eqIfPresent(BusinessQCCoefficientDataDO::getSampleCode, reqVO.getSampleCode()) - .likeIfPresent(BusinessQCCoefficientDataDO::getSampleName, reqVO.getSampleName()) - .eqIfPresent(BusinessQCCoefficientDataDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId()) - .eqIfPresent(BusinessQCCoefficientDataDO::getBusinessAssayTaskId, reqVO.getBusinessAssayTaskId()) - .eqIfPresent(BusinessQCCoefficientDataDO::getBusinessStandardSampleId, reqVO.getBusinessStandardSampleId()) - .eqIfPresent(BusinessQCCoefficientDataDO::getDictionaryBusinessId, reqVO.getDictionaryBusinessId()) - .eqIfPresent(BusinessQCCoefficientDataDO::getDictionaryBusinessKey, reqVO.getDictionaryBusinessKey()) - .eqIfPresent(BusinessQCCoefficientDataDO::getAssayProject, reqVO.getAssayProject()) - .eqIfPresent(BusinessQCCoefficientDataDO::getAssayDepartmentId, reqVO.getAssayDepartmentId()) - .likeIfPresent(BusinessQCCoefficientDataDO::getAssayDepartmentName, reqVO.getAssayDepartmentName()) - .eqIfPresent(BusinessQCCoefficientDataDO::getAssayOperator, reqVO.getAssayOperator()) - .eqIfPresent(BusinessQCCoefficientDataDO::getAssayOperatorId, reqVO.getAssayOperatorId()) - .betweenIfPresent(BusinessQCCoefficientDataDO::getAssignTaskTime, reqVO.getAssignTaskTime()) - .eqIfPresent(BusinessQCCoefficientDataDO::getIsAssignTasked, reqVO.getIsAssignTasked()) - .eqIfPresent(BusinessQCCoefficientDataDO::getIsReported, reqVO.getIsReported()) - .eqIfPresent(BusinessQCCoefficientDataDO::getReporter, reqVO.getReporter()) - .eqIfPresent(BusinessQCCoefficientDataDO::getReporterId, reqVO.getReporterId()) - .betweenIfPresent(BusinessQCCoefficientDataDO::getReportTime, reqVO.getReportTime()) - .eqIfPresent(BusinessQCCoefficientDataDO::getUpdateCount, reqVO.getUpdateCount()) - .eqIfPresent(BusinessQCCoefficientDataDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) - .betweenIfPresent(BusinessQCCoefficientDataDO::getCreateTime, reqVO.getCreateTime()) - .eqIfPresent(BusinessQCCoefficientDataDO::getRemark, reqVO.getRemark()) - .orderByDesc(BusinessQCCoefficientDataDO::getId)); + default List selectList(BusinessQCCoefficientDataReqVO reqVO) { + MPJLambdaWrapperX queryLambdaWrapperX = new MPJLambdaWrapperX(); + queryLambdaWrapperX = (MPJLambdaWrapperX) queryLambdaWrapperX.leftJoin(DictionaryBusinessDO.class, "dbd1", DictionaryBusinessDO::getId, BusinessQCCoefficientDataDO::getDictionaryBusinessId); + queryLambdaWrapperX = (MPJLambdaWrapperX) queryLambdaWrapperX.leftJoin(DictionaryBusinessDO.class, "dbd2", DictionaryBusinessDO::getId, "dbd1", DictionaryBusinessDO::getParentId); + queryLambdaWrapperX = queryLambdaWrapperX.selectAll(BusinessQCCoefficientDataDO.class); + queryLambdaWrapperX = (MPJLambdaWrapperX) queryLambdaWrapperX.selectAs("dbd1", DictionaryBusinessDO::getName, ConfigQCSampleMethodExtendRespVO::getDictionaryBusinessName); + queryLambdaWrapperX = (MPJLambdaWrapperX) queryLambdaWrapperX.selectAs("dbd1", DictionaryBusinessDO::getParentId, ConfigQCSampleMethodExtendRespVO::getParentDictionaryBusinessId); + queryLambdaWrapperX = (MPJLambdaWrapperX) queryLambdaWrapperX.selectAs("dbd2", DictionaryBusinessDO::getKey, ConfigQCSampleMethodExtendRespVO::getParentDictionaryBusinesskey); + queryLambdaWrapperX = (MPJLambdaWrapperX) queryLambdaWrapperX.selectAs("dbd2", DictionaryBusinessDO::getName, ConfigQCSampleMethodExtendRespVO::getParentDictionaryBusinessName); + queryLambdaWrapperX.eqIfPresent(BusinessQCCoefficientDataDO::getSampleCode, reqVO.getSampleCode()) + .likeIfPresent(BusinessQCCoefficientDataDO::getSampleName, reqVO.getSampleName()) + .eqIfPresent(BusinessQCCoefficientDataDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId()) + .eqIfPresent(BusinessQCCoefficientDataDO::getBusinessAssayTaskId, reqVO.getBusinessAssayTaskId()) + .eqIfPresent(BusinessQCCoefficientDataDO::getBusinessStandardSampleId, reqVO.getBusinessStandardSampleId()) + .eqIfPresent(BusinessQCCoefficientDataDO::getDictionaryBusinessId, reqVO.getDictionaryBusinessId()) + .eqIfPresent(BusinessQCCoefficientDataDO::getDictionaryBusinessKey, reqVO.getDictionaryBusinessKey()) + .eqIfPresent(BusinessQCCoefficientDataDO::getAssayProject, reqVO.getAssayProject()) + .eqIfPresent(BusinessQCCoefficientDataDO::getAssayDepartmentId, reqVO.getAssayDepartmentId()) + .likeIfPresent(BusinessQCCoefficientDataDO::getAssayDepartmentName, reqVO.getAssayDepartmentName()) + .eqIfPresent(BusinessQCCoefficientDataDO::getAssayOperator, reqVO.getAssayOperator()) + .eqIfPresent(BusinessQCCoefficientDataDO::getAssayOperatorId, reqVO.getAssayOperatorId()) + .betweenIfPresent(BusinessQCCoefficientDataDO::getAssignTaskTime, reqVO.getAssignTaskTime()) + .eqIfPresent(BusinessQCCoefficientDataDO::getIsAssignTasked, reqVO.getIsAssignTasked()) + .eqIfPresent(BusinessQCCoefficientDataDO::getIsReported, reqVO.getIsReported()) + .eqIfPresent(BusinessQCCoefficientDataDO::getReporter, reqVO.getReporter()) + .eqIfPresent(BusinessQCCoefficientDataDO::getReporterId, reqVO.getReporterId()) + .betweenIfPresent(BusinessQCCoefficientDataDO::getReportTime, reqVO.getReportTime()) + .eqIfPresent(BusinessQCCoefficientDataDO::getUpdateCount, reqVO.getUpdateCount()) + .eqIfPresent(BusinessQCCoefficientDataDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .betweenIfPresent(BusinessQCCoefficientDataDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(BusinessQCCoefficientDataDO::getRemark, reqVO.getRemark()) + .orderByDesc(BusinessQCCoefficientDataDO::getId); + return selectJoinList(BusinessQCCoefficientDataExtendRespVO.class, queryLambdaWrapperX); } default List selectByBusinessAssayTaskId(Long businessAssayTaskId) { @@ -82,4 +104,13 @@ public interface BusinessQCCoefficientDataMapper extends BaseMapperX selectBySampleAssayCodesAndConfigAssayMethodDictionaryBusinessKey(List sampleCodeList, String configAssayMethodDictionaryBusinessKey) { + return selectJoinList(BusinessQCCoefficientDataDO.class, new MPJLambdaWrapperX() + .leftJoin(ConfigAssayMethodDO.class, ConfigAssayMethodDO::getId, BusinessQCCoefficientDataDO::getConfigAssayMethodId) + .selectAll(BusinessQCCoefficientDataDO.class) + .in(BusinessQCCoefficientDataDO::getSampleCode, sampleCodeList) + .eq(BusinessQCCoefficientDataDO::getIsReported, QmsCommonConstant.NO) + .eq(ConfigAssayMethodDO::getDictionaryBusinessKey, configAssayMethodDictionaryBusinessKey)); + } + } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQCCoefficientParameterDataMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQCCoefficientParameterDataMapper.java index dea9438..711fa7d 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQCCoefficientParameterDataMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQCCoefficientParameterDataMapper.java @@ -8,9 +8,9 @@ import com.zt.plat.framework.mybatis.core.query.MPJLambdaWrapperX; import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayProjectAndParameterRespVO; import com.zt.plat.module.qms.business.bus.controller.vo.BusinessQCCoefficientParameterDataPageReqVO; import com.zt.plat.module.qms.business.bus.controller.vo.BusinessQCCoefficientParameterDataReqVO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskParameterDataDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCCoefficientParameterDataDO; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigQCSampleMethodParameterDO; -import com.zt.plat.module.qms.business.dic.dal.dataobject.DictionaryParameterDO; import com.zt.plat.module.qms.common.dic.dal.dataobject.DictionaryBusinessDO; import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; import org.apache.ibatis.annotations.Mapper; @@ -41,21 +41,22 @@ public interface BusinessQCCoefficientParameterDataMapper extends BaseMapperX selectProjectAndParameterBy(BusinessQCCoefficientParameterDataReqVO reqVO) { return selectJoinList(BusinessAssayProjectAndParameterRespVO.class, new MPJLambdaWrapperX() .leftJoin(ConfigQCSampleMethodParameterDO.class, ConfigQCSampleMethodParameterDO::getId, BusinessQCCoefficientParameterDataDO::getConfigQCSampleMethodParameterId) - .leftJoin(DictionaryParameterDO.class, DictionaryParameterDO::getId, BusinessQCCoefficientParameterDataDO::getDictionaryParameterId) .leftJoin(DictionaryBusinessDO.class, DictionaryBusinessDO::getId, ConfigQCSampleMethodParameterDO::getDictionaryBusinessId) .selectAs(BusinessQCCoefficientParameterDataDO::getId, BusinessAssayProjectAndParameterRespVO::getId) - .selectAs(BusinessQCCoefficientParameterDataDO::getDictionaryParameterId, BusinessAssayProjectAndParameterRespVO::getDicId) - .selectAs(DictionaryParameterDO::getKey, BusinessAssayProjectAndParameterRespVO::getDicKey) - .selectAs(DictionaryParameterDO::getName, BusinessAssayProjectAndParameterRespVO::getName) - .selectAs(DictionaryParameterDO::getName, BusinessAssayProjectAndParameterRespVO::getShowName) - .selectAs(DictionaryParameterDO::getFillingWay, BusinessAssayProjectAndParameterRespVO::getFillingWay) + .selectAs(BusinessQCCoefficientParameterDataDO::getBusinessQCCoefficientDataId, BusinessAssayProjectAndParameterRespVO::getBizId) + .selectAs(BusinessQCCoefficientParameterDataDO::getConfigQCSampleMethodParameterId, BusinessAssayProjectAndParameterRespVO::getDicId) + .selectAs(ConfigQCSampleMethodParameterDO::getKey, BusinessAssayProjectAndParameterRespVO::getDicKey) + .selectAs(ConfigQCSampleMethodParameterDO::getParameterName, BusinessAssayProjectAndParameterRespVO::getName) + .selectAs(ConfigQCSampleMethodParameterDO::getParameterName, BusinessAssayProjectAndParameterRespVO::getShowName) + .selectAs(ConfigQCSampleMethodParameterDO::getFillingWay, BusinessAssayProjectAndParameterRespVO::getFillingWay) .selectAs(BusinessQCCoefficientParameterDataDO::getDataType, BusinessAssayProjectAndParameterRespVO::getDataType) .selectAs(BusinessQCCoefficientParameterDataDO::getDecimalPosition, BusinessAssayProjectAndParameterRespVO::getDecimalPosition) .selectAs(BusinessQCCoefficientParameterDataDO::getValue, BusinessAssayProjectAndParameterRespVO::getValue) - .selectAs(DictionaryParameterDO::getUnit, BusinessAssayProjectAndParameterRespVO::getUnit) + .selectAs(BusinessQCCoefficientParameterDataDO::getSymbol, BusinessAssayProjectAndParameterRespVO::getSymbol) + .selectAs(ConfigQCSampleMethodParameterDO::getUnit, BusinessAssayProjectAndParameterRespVO::getUnit) .selectAs(ConfigQCSampleMethodParameterDO::getIsNull, BusinessAssayProjectAndParameterRespVO::getIsNull) .selectAs(ConfigQCSampleMethodParameterDO::getFormula, BusinessAssayProjectAndParameterRespVO::getFormula) - .selectAs(ConfigQCSampleMethodParameterDO::getSortNo, BusinessAssayProjectAndParameterRespVO::getParamNo) + .selectAs(ConfigQCSampleMethodParameterDO::getNo, BusinessAssayProjectAndParameterRespVO::getParamNo) .selectAs("'parameter'", BusinessAssayProjectAndParameterRespVO::getType) .selectAs(ConfigQCSampleMethodParameterDO::getDictionaryBusinessId, BusinessAssayProjectAndParameterRespVO::getGroupDictionaryBusinessId) .selectAs(ConfigQCSampleMethodParameterDO::getDictionaryBusinessKey, BusinessAssayProjectAndParameterRespVO::getGroupDictionaryBusinessKey) diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQCManagementDataMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQCManagementDataMapper.java index acd9443..d44f77b 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQCManagementDataMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQCManagementDataMapper.java @@ -4,8 +4,13 @@ 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.query.MPJLambdaWrapperX; import com.zt.plat.module.qms.business.bus.controller.vo.*; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCManagementDataDO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigQCSampleMethodExtendRespVO; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodDO; +import com.zt.plat.module.qms.common.dic.dal.dataobject.DictionaryBusinessDO; +import com.zt.plat.module.qms.enums.QmsCommonConstant; import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; import org.apache.ibatis.annotations.Mapper; @@ -17,63 +22,95 @@ import org.apache.ibatis.annotations.Mapper; @Mapper public interface BusinessQCManagementDataMapper extends BaseMapperX { - default PageResult selectPage(BusinessQCManagementDataPageReqVO reqVO) { - return selectPage(reqVO, new LambdaQueryWrapperX() - .eqIfPresent(BusinessQCManagementDataDO::getSampleCode, reqVO.getSampleCode()) - .likeIfPresent(BusinessQCManagementDataDO::getSampleName, reqVO.getSampleName()) - .eqIfPresent(BusinessQCManagementDataDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId()) - .eqIfPresent(BusinessQCManagementDataDO::getBusinessAssayTaskId, reqVO.getBusinessAssayTaskId()) - .eqIfPresent(BusinessQCManagementDataDO::getBusinessStandardSampleId, reqVO.getBusinessStandardSampleId()) - .eqIfPresent(BusinessQCManagementDataDO::getDictionaryBusinessId, reqVO.getDictionaryBusinessId()) - .eqIfPresent(BusinessQCManagementDataDO::getDictionaryBusinessKey, reqVO.getDictionaryBusinessKey()) - .eqIfPresent(BusinessQCManagementDataDO::getAssayProject, reqVO.getAssayProject()) - .eqIfPresent(BusinessQCManagementDataDO::getAssayDepartmentId, reqVO.getAssayDepartmentId()) - .likeIfPresent(BusinessQCManagementDataDO::getAssayDepartmentName, reqVO.getAssayDepartmentName()) - .eqIfPresent(BusinessQCManagementDataDO::getAssayOperator, reqVO.getAssayOperator()) - .eqIfPresent(BusinessQCManagementDataDO::getAssayOperatorId, reqVO.getAssayOperatorId()) - .betweenIfPresent(BusinessQCManagementDataDO::getAssignTaskTime, reqVO.getAssignTaskTime()) - .eqIfPresent(BusinessQCManagementDataDO::getIsAssignTasked, reqVO.getIsAssignTasked()) - .eqIfPresent(BusinessQCManagementDataDO::getIsReported, reqVO.getIsReported()) - .eqIfPresent(BusinessQCManagementDataDO::getReporter, reqVO.getReporter()) - .eqIfPresent(BusinessQCManagementDataDO::getReporterId, reqVO.getReporterId()) - .betweenIfPresent(BusinessQCManagementDataDO::getReportTime, reqVO.getReportTime()) - .eqIfPresent(BusinessQCManagementDataDO::getUpdateCount, reqVO.getUpdateCount()) - .eqIfPresent(BusinessQCManagementDataDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) - .betweenIfPresent(BusinessQCManagementDataDO::getCreateTime, reqVO.getCreateTime()) - .eqIfPresent(BusinessQCManagementDataDO::getRemark, reqVO.getRemark()) - .orderByDesc(BusinessQCManagementDataDO::getId)); + default PageResult selectPage(BusinessQCManagementDataPageReqVO reqVO) { + MPJLambdaWrapperX queryLambdaWrapperX = new MPJLambdaWrapperX<>(); + queryLambdaWrapperX = (MPJLambdaWrapperX) queryLambdaWrapperX.leftJoin(DictionaryBusinessDO.class, "dbd1", DictionaryBusinessDO::getId, BusinessQCManagementDataDO::getDictionaryBusinessId); + queryLambdaWrapperX = (MPJLambdaWrapperX) queryLambdaWrapperX.leftJoin(DictionaryBusinessDO.class, "dbd2", DictionaryBusinessDO::getId, "dbd1", DictionaryBusinessDO::getParentId); + queryLambdaWrapperX = queryLambdaWrapperX.selectAll(BusinessQCManagementDataDO.class); + queryLambdaWrapperX = (MPJLambdaWrapperX) queryLambdaWrapperX.selectAs("dbd1", DictionaryBusinessDO::getName, ConfigQCSampleMethodExtendRespVO::getDictionaryBusinessName); + queryLambdaWrapperX = (MPJLambdaWrapperX) queryLambdaWrapperX.selectAs("dbd1", DictionaryBusinessDO::getParentId, ConfigQCSampleMethodExtendRespVO::getParentDictionaryBusinessId); + queryLambdaWrapperX = (MPJLambdaWrapperX) queryLambdaWrapperX.selectAs("dbd2", DictionaryBusinessDO::getKey, ConfigQCSampleMethodExtendRespVO::getParentDictionaryBusinesskey); + queryLambdaWrapperX = (MPJLambdaWrapperX) queryLambdaWrapperX.selectAs("dbd2", DictionaryBusinessDO::getName, ConfigQCSampleMethodExtendRespVO::getParentDictionaryBusinessName); + queryLambdaWrapperX.eqIfPresent(BusinessQCManagementDataDO::getSampleCode, reqVO.getSampleCode()) + .likeIfPresent(BusinessQCManagementDataDO::getSampleName, reqVO.getSampleName()) + .eqIfPresent(BusinessQCManagementDataDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId()) + .eqIfPresent(BusinessQCManagementDataDO::getBusinessAssayTaskId, reqVO.getBusinessAssayTaskId()) + .eqIfPresent(BusinessQCManagementDataDO::getBusinessStandardSampleId, reqVO.getBusinessStandardSampleId()) + .eqIfPresent(BusinessQCManagementDataDO::getDictionaryBusinessId, reqVO.getDictionaryBusinessId()) + .eqIfPresent(BusinessQCManagementDataDO::getDictionaryBusinessKey, reqVO.getDictionaryBusinessKey()) + .eqIfPresent(BusinessQCManagementDataDO::getAssayProject, reqVO.getAssayProject()) + .eqIfPresent(BusinessQCManagementDataDO::getAssayDepartmentId, reqVO.getAssayDepartmentId()) + .likeIfPresent(BusinessQCManagementDataDO::getAssayDepartmentName, reqVO.getAssayDepartmentName()) + .eqIfPresent(BusinessQCManagementDataDO::getAssayOperator, reqVO.getAssayOperator()) + .eqIfPresent(BusinessQCManagementDataDO::getAssayOperatorId, reqVO.getAssayOperatorId()) + .betweenIfPresent(BusinessQCManagementDataDO::getAssignTaskTime, reqVO.getAssignTaskTime()) + .eqIfPresent(BusinessQCManagementDataDO::getIsAssignTasked, reqVO.getIsAssignTasked()) + .eqIfPresent(BusinessQCManagementDataDO::getIsReported, reqVO.getIsReported()) + .eqIfPresent(BusinessQCManagementDataDO::getReporter, reqVO.getReporter()) + .eqIfPresent(BusinessQCManagementDataDO::getReporterId, reqVO.getReporterId()) + .betweenIfPresent(BusinessQCManagementDataDO::getReportTime, reqVO.getReportTime()) + .eqIfPresent(BusinessQCManagementDataDO::getUpdateCount, reqVO.getUpdateCount()) + .eqIfPresent(BusinessQCManagementDataDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .betweenIfPresent(BusinessQCManagementDataDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(BusinessQCManagementDataDO::getRemark, reqVO.getRemark()) + .orderByDesc(BusinessQCManagementDataDO::getId); + + return selectJoinPage(reqVO, BusinessQCManagementDataExtendRespVO.class, queryLambdaWrapperX); } - default List selectList(BusinessQCManagementDataReqVO reqVO) { - return selectList(new LambdaQueryWrapperX() - .eqIfPresent(BusinessQCManagementDataDO::getSampleCode, reqVO.getSampleCode()) - .likeIfPresent(BusinessQCManagementDataDO::getSampleName, reqVO.getSampleName()) - .eqIfPresent(BusinessQCManagementDataDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId()) - .eqIfPresent(BusinessQCManagementDataDO::getBusinessAssayTaskId, reqVO.getBusinessAssayTaskId()) - .eqIfPresent(BusinessQCManagementDataDO::getBusinessStandardSampleId, reqVO.getBusinessStandardSampleId()) - .eqIfPresent(BusinessQCManagementDataDO::getDictionaryBusinessId, reqVO.getDictionaryBusinessId()) - .eqIfPresent(BusinessQCManagementDataDO::getDictionaryBusinessKey, reqVO.getDictionaryBusinessKey()) - .eqIfPresent(BusinessQCManagementDataDO::getAssayProject, reqVO.getAssayProject()) - .eqIfPresent(BusinessQCManagementDataDO::getAssayDepartmentId, reqVO.getAssayDepartmentId()) - .likeIfPresent(BusinessQCManagementDataDO::getAssayDepartmentName, reqVO.getAssayDepartmentName()) - .eqIfPresent(BusinessQCManagementDataDO::getAssayOperator, reqVO.getAssayOperator()) - .eqIfPresent(BusinessQCManagementDataDO::getAssayOperatorId, reqVO.getAssayOperatorId()) - .betweenIfPresent(BusinessQCManagementDataDO::getAssignTaskTime, reqVO.getAssignTaskTime()) - .eqIfPresent(BusinessQCManagementDataDO::getIsAssignTasked, reqVO.getIsAssignTasked()) - .eqIfPresent(BusinessQCManagementDataDO::getIsReported, reqVO.getIsReported()) - .eqIfPresent(BusinessQCManagementDataDO::getReporter, reqVO.getReporter()) - .eqIfPresent(BusinessQCManagementDataDO::getReporterId, reqVO.getReporterId()) - .betweenIfPresent(BusinessQCManagementDataDO::getReportTime, reqVO.getReportTime()) - .eqIfPresent(BusinessQCManagementDataDO::getUpdateCount, reqVO.getUpdateCount()) - .eqIfPresent(BusinessQCManagementDataDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) - .betweenIfPresent(BusinessQCManagementDataDO::getCreateTime, reqVO.getCreateTime()) - .eqIfPresent(BusinessQCManagementDataDO::getRemark, reqVO.getRemark()) - .orderByDesc(BusinessQCManagementDataDO::getId)); + default List selectList(BusinessQCManagementDataReqVO reqVO) { + MPJLambdaWrapperX queryLambdaWrapperX = new MPJLambdaWrapperX<>(); + queryLambdaWrapperX = (MPJLambdaWrapperX) queryLambdaWrapperX.leftJoin(DictionaryBusinessDO.class, "dbd1", DictionaryBusinessDO::getId, BusinessQCManagementDataDO::getDictionaryBusinessId); + queryLambdaWrapperX = (MPJLambdaWrapperX) queryLambdaWrapperX.leftJoin(DictionaryBusinessDO.class, "dbd2", DictionaryBusinessDO::getId, "dbd1", DictionaryBusinessDO::getParentId); + queryLambdaWrapperX = queryLambdaWrapperX.selectAll(BusinessQCManagementDataDO.class); + queryLambdaWrapperX = (MPJLambdaWrapperX) queryLambdaWrapperX.selectAs("dbd1", DictionaryBusinessDO::getName, ConfigQCSampleMethodExtendRespVO::getDictionaryBusinessName); + queryLambdaWrapperX = (MPJLambdaWrapperX) queryLambdaWrapperX.selectAs("dbd1", DictionaryBusinessDO::getParentId, ConfigQCSampleMethodExtendRespVO::getParentDictionaryBusinessId); + queryLambdaWrapperX = (MPJLambdaWrapperX) queryLambdaWrapperX.selectAs("dbd2", DictionaryBusinessDO::getKey, ConfigQCSampleMethodExtendRespVO::getParentDictionaryBusinesskey); + queryLambdaWrapperX = (MPJLambdaWrapperX) queryLambdaWrapperX.selectAs("dbd2", DictionaryBusinessDO::getName, ConfigQCSampleMethodExtendRespVO::getParentDictionaryBusinessName); + queryLambdaWrapperX.eqIfPresent(BusinessQCManagementDataDO::getSampleCode, reqVO.getSampleCode()) + .likeIfPresent(BusinessQCManagementDataDO::getSampleName, reqVO.getSampleName()) + .eqIfPresent(BusinessQCManagementDataDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId()) + .eqIfPresent(BusinessQCManagementDataDO::getBusinessAssayTaskId, reqVO.getBusinessAssayTaskId()) + .eqIfPresent(BusinessQCManagementDataDO::getBusinessStandardSampleId, reqVO.getBusinessStandardSampleId()) + .eqIfPresent(BusinessQCManagementDataDO::getDictionaryBusinessId, reqVO.getDictionaryBusinessId()) + .eqIfPresent(BusinessQCManagementDataDO::getDictionaryBusinessKey, reqVO.getDictionaryBusinessKey()) + .eqIfPresent(BusinessQCManagementDataDO::getAssayProject, reqVO.getAssayProject()) + .eqIfPresent(BusinessQCManagementDataDO::getAssayDepartmentId, reqVO.getAssayDepartmentId()) + .likeIfPresent(BusinessQCManagementDataDO::getAssayDepartmentName, reqVO.getAssayDepartmentName()) + .eqIfPresent(BusinessQCManagementDataDO::getAssayOperator, reqVO.getAssayOperator()) + .eqIfPresent(BusinessQCManagementDataDO::getAssayOperatorId, reqVO.getAssayOperatorId()) + .betweenIfPresent(BusinessQCManagementDataDO::getAssignTaskTime, reqVO.getAssignTaskTime()) + .eqIfPresent(BusinessQCManagementDataDO::getIsAssignTasked, reqVO.getIsAssignTasked()) + .eqIfPresent(BusinessQCManagementDataDO::getIsReported, reqVO.getIsReported()) + .eqIfPresent(BusinessQCManagementDataDO::getReporter, reqVO.getReporter()) + .eqIfPresent(BusinessQCManagementDataDO::getReporterId, reqVO.getReporterId()) + .betweenIfPresent(BusinessQCManagementDataDO::getReportTime, reqVO.getReportTime()) + .eqIfPresent(BusinessQCManagementDataDO::getUpdateCount, reqVO.getUpdateCount()) + .eqIfPresent(BusinessQCManagementDataDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .betweenIfPresent(BusinessQCManagementDataDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(BusinessQCManagementDataDO::getRemark, reqVO.getRemark()) + .orderByDesc(BusinessQCManagementDataDO::getId); + return selectJoinList(BusinessQCManagementDataExtendRespVO.class, queryLambdaWrapperX); } default List selectByBusinessAssayTaskId(Long businessAssayTaskId) { return selectList(new LambdaQueryWrapperX() .eq(BusinessQCManagementDataDO::getBusinessAssayTaskId, businessAssayTaskId)); } + + default List selectByBusinessAssayTaskIdAndDictionaryBusinessKey(Long businessAssayTaskId, String configAssayMethodDictionaryBusinessKey) { + return selectList(new LambdaQueryWrapperX() + .eq(BusinessQCManagementDataDO::getBusinessAssayTaskId, businessAssayTaskId) + .eq(BusinessQCManagementDataDO::getDictionaryBusinessKey, configAssayMethodDictionaryBusinessKey)); + } + + default List selectBySampleAssayCodesAndConfigAssayMethodDictionaryBusinessKey(List sampleCodeList, String configAssayMethodDictionaryBusinessKey){ + return selectJoinList(BusinessQCManagementDataDO.class, new MPJLambdaWrapperX() + .leftJoin(ConfigAssayMethodDO.class, ConfigAssayMethodDO::getId, BusinessQCManagementDataDO::getConfigAssayMethodId) + .selectAll(BusinessQCManagementDataDO.class) + .in(BusinessQCManagementDataDO::getSampleCode, sampleCodeList) + .eq(ConfigAssayMethodDO::getDictionaryBusinessKey, configAssayMethodDictionaryBusinessKey) + .eq(BusinessQCManagementDataDO::getIsReported, QmsCommonConstant.NO)); + } } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQCManagementParameterDataMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQCManagementParameterDataMapper.java index 42c7f8a..8ee512a 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQCManagementParameterDataMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQCManagementParameterDataMapper.java @@ -6,6 +6,7 @@ import com.zt.plat.framework.common.pojo.PageResult; import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; import com.zt.plat.framework.mybatis.core.query.MPJLambdaWrapperX; import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCCoefficientParameterDataDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCManagementParameterDataDO; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectParameterDO; import com.zt.plat.module.qms.business.dic.dal.dataobject.DictionaryParameterDO; @@ -39,21 +40,22 @@ public interface BusinessQCManagementParameterDataMapper extends BaseMapperX selectProjectAndParameterBy(BusinessQCManagementParameterDataReqVO reqVO) { return selectJoinList(BusinessAssayProjectAndParameterRespVO.class, new MPJLambdaWrapperX() .leftJoin(ConfigAssayMethodProjectParameterDO.class, ConfigAssayMethodProjectParameterDO::getId, BusinessQCManagementParameterDataDO::getConfigAssayMethodProjectParameterId) - .leftJoin(DictionaryParameterDO.class, DictionaryParameterDO::getId, BusinessQCManagementParameterDataDO::getDictionaryParameterId) .leftJoin(DictionaryBusinessDO.class, DictionaryBusinessDO::getId, ConfigAssayMethodProjectParameterDO::getDictionaryBusinessId) .selectAs(BusinessQCManagementParameterDataDO::getId, BusinessAssayProjectAndParameterRespVO::getId) - .selectAs(BusinessQCManagementParameterDataDO::getDictionaryParameterId, BusinessAssayProjectAndParameterRespVO::getDicId) - .selectAs(DictionaryParameterDO::getKey, BusinessAssayProjectAndParameterRespVO::getDicKey) - .selectAs(DictionaryParameterDO::getName, BusinessAssayProjectAndParameterRespVO::getName) - .selectAs(DictionaryParameterDO::getName, BusinessAssayProjectAndParameterRespVO::getShowName) - .selectAs(DictionaryParameterDO::getFillingWay, BusinessAssayProjectAndParameterRespVO::getFillingWay) + .selectAs(BusinessQCManagementParameterDataDO::getBusinessQCManagementProjectDataId, BusinessAssayProjectAndParameterRespVO::getBizId) + .selectAs(BusinessQCManagementParameterDataDO::getConfigAssayMethodProjectParameterId, BusinessAssayProjectAndParameterRespVO::getDicId) + .selectAs(ConfigAssayMethodProjectParameterDO::getKey, BusinessAssayProjectAndParameterRespVO::getDicKey) + .selectAs(ConfigAssayMethodProjectParameterDO::getParameterName, BusinessAssayProjectAndParameterRespVO::getName) + .selectAs(ConfigAssayMethodProjectParameterDO::getParameterName, BusinessAssayProjectAndParameterRespVO::getShowName) + .selectAs(ConfigAssayMethodProjectParameterDO::getFillingWay, BusinessAssayProjectAndParameterRespVO::getFillingWay) .selectAs(BusinessQCManagementParameterDataDO::getDataType, BusinessAssayProjectAndParameterRespVO::getDataType) .selectAs(BusinessQCManagementParameterDataDO::getDecimalPosition, BusinessAssayProjectAndParameterRespVO::getDecimalPosition) .selectAs(BusinessQCManagementParameterDataDO::getValue, BusinessAssayProjectAndParameterRespVO::getValue) - .selectAs(DictionaryParameterDO::getUnit, BusinessAssayProjectAndParameterRespVO::getUnit) + .selectAs(BusinessQCManagementParameterDataDO::getSymbol, BusinessAssayProjectAndParameterRespVO::getSymbol) + .selectAs(ConfigAssayMethodProjectParameterDO::getUnit, BusinessAssayProjectAndParameterRespVO::getUnit) .selectAs(ConfigAssayMethodProjectParameterDO::getIsNull, BusinessAssayProjectAndParameterRespVO::getIsNull) .selectAs(ConfigAssayMethodProjectParameterDO::getFormula, BusinessAssayProjectAndParameterRespVO::getFormula) - .selectAs(ConfigAssayMethodProjectParameterDO::getSortNo, BusinessAssayProjectAndParameterRespVO::getParamNo) + .selectAs(ConfigAssayMethodProjectParameterDO::getNo, BusinessAssayProjectAndParameterRespVO::getParamNo) .selectAs("'parameter'", BusinessAssayProjectAndParameterRespVO::getType) .selectAs(ConfigAssayMethodProjectParameterDO::getDictionaryBusinessId, BusinessAssayProjectAndParameterRespVO::getGroupDictionaryBusinessId) .selectAs(ConfigAssayMethodProjectParameterDO::getDictionaryBusinessKey, BusinessAssayProjectAndParameterRespVO::getGroupDictionaryBusinessKey) diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQCManagementProjectDataMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQCManagementProjectDataMapper.java index 9642585..e60ce36 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQCManagementProjectDataMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQCManagementProjectDataMapper.java @@ -6,6 +6,7 @@ import com.zt.plat.framework.common.pojo.PageResult; import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; import com.zt.plat.framework.mybatis.core.query.MPJLambdaWrapperX; import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskParameterDataDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCManagementProjectDataDO; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectDO; import com.zt.plat.module.qms.business.dic.dal.dataobject.DictionaryProjectDO; @@ -46,7 +47,8 @@ public interface BusinessQCManagementProjectDataMapper extends BaseMapperX { + + default PageResult selectPage(BusinessQCManagementSampleParameterDataPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(BusinessQCManagementSampleParameterDataDO::getBusinessQCManagementDataId, reqVO.getBusinessQCManagementDataId()) + .eqIfPresent(BusinessQCManagementSampleParameterDataDO::getConfigAssayMethodParameterId, reqVO.getConfigAssayMethodParameterId()) + .eqIfPresent(BusinessQCManagementSampleParameterDataDO::getValue, reqVO.getValue()) + .eqIfPresent(BusinessQCManagementSampleParameterDataDO::getDataType, reqVO.getDataType()) + .eqIfPresent(BusinessQCManagementSampleParameterDataDO::getDecimalPosition, reqVO.getDecimalPosition()) + .eqIfPresent(BusinessQCManagementSampleParameterDataDO::getUpdateCount, reqVO.getUpdateCount()) + .eqIfPresent(BusinessQCManagementSampleParameterDataDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .betweenIfPresent(BusinessQCManagementSampleParameterDataDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(BusinessQCManagementSampleParameterDataDO::getRemark, reqVO.getRemark()) + .orderByDesc(BusinessQCManagementSampleParameterDataDO::getId)); + } + + default List selectByBusinessQCManagementDataIds(List businessQCManagementDataIdList) { + return selectJoinList(BusinessAssayProjectAndParameterRespVO.class, new MPJLambdaWrapperX() + .leftJoin(ConfigAssayMethodParameterDO.class, ConfigAssayMethodParameterDO::getId, BusinessQCManagementSampleParameterDataDO::getConfigAssayMethodParameterId) + .leftJoin(DictionaryBusinessDO.class, DictionaryBusinessDO::getId, ConfigAssayMethodParameterDO::getDictionaryBusinessId) + .selectAs(BusinessQCManagementSampleParameterDataDO::getId, BusinessAssayProjectAndParameterRespVO::getId) + .selectAs(BusinessQCManagementSampleParameterDataDO::getBusinessQCManagementDataId, BusinessAssayProjectAndParameterRespVO::getBizId) + .selectAs(BusinessQCManagementSampleParameterDataDO::getConfigAssayMethodParameterId, BusinessAssayProjectAndParameterRespVO::getDicId) + .selectAs(ConfigAssayMethodParameterDO::getKey, BusinessAssayProjectAndParameterRespVO::getDicKey) + .selectAs(ConfigAssayMethodParameterDO::getParameterName, BusinessAssayProjectAndParameterRespVO::getName) + .selectAs(ConfigAssayMethodParameterDO::getParameterName, BusinessAssayProjectAndParameterRespVO::getShowName) + .selectAs(ConfigAssayMethodParameterDO::getFillingWay, BusinessAssayProjectAndParameterRespVO::getFillingWay) + .selectAs(BusinessQCManagementSampleParameterDataDO::getDataType, BusinessAssayProjectAndParameterRespVO::getDataType) + .selectAs(BusinessQCManagementSampleParameterDataDO::getDecimalPosition, BusinessAssayProjectAndParameterRespVO::getDecimalPosition) + .selectAs(BusinessQCManagementSampleParameterDataDO::getValue, BusinessAssayProjectAndParameterRespVO::getValue) + //.selectAs(ConfigAssayMethodParameterDO::getDictionaryProjectUnit, BusinessAssayProjectAndParameterRespVO::getUnit) + .selectAs(ConfigAssayMethodParameterDO::getIsNull, BusinessAssayProjectAndParameterRespVO::getIsNull) + //.selectAs(ConfigAssayMethodParameterDO::getFormula, BusinessAssayProjectAndParameterRespVO::getFormula) + .selectAs(ConfigAssayMethodParameterDO::getSortNo, BusinessAssayProjectAndParameterRespVO::getParamNo) + .selectAs("'attribute'", BusinessAssayProjectAndParameterRespVO::getType) + .selectAs(ConfigAssayMethodParameterDO::getDictionaryBusinessId, BusinessAssayProjectAndParameterRespVO::getGroupDictionaryBusinessId) + .selectAs(ConfigAssayMethodParameterDO::getDictionaryBusinessKey, BusinessAssayProjectAndParameterRespVO::getGroupDictionaryBusinessKey) + .selectAs(DictionaryBusinessDO::getName, BusinessAssayProjectAndParameterRespVO::getGroupDictionaryBusinessName) + .in(BusinessQCManagementSampleParameterDataDO::getBusinessQCManagementDataId, businessQCManagementDataIdList) + .orderByAsc(ConfigAssayMethodParameterDO::getSortNo)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSampleEntrustDetailMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSampleEntrustDetailMapper.java index 3103db7..b2e53d7 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSampleEntrustDetailMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSampleEntrustDetailMapper.java @@ -82,6 +82,44 @@ public interface BusinessSampleEntrustDetailMapper extends BaseMapperX selectByBusinessSampleEntrustRegistrationId(Long businessSampleEntrustRegistrationId) { return selectList(new LambdaQueryWrapperX().eq(BusinessSampleEntrustDetailDO::getBusinessSampleEntrustRegistrationId, businessSampleEntrustRegistrationId)); } + + default List selectExtendByBusinessSampleEntrustRegistrationId(Long businessSampleEntrustRegistrationId) { + return selectJoinList(BusinessSampleEntrustDetailExtendRespVO.class, new MPJLambdaWrapperX() + .leftJoin(BaseSampleDO.class, BaseSampleDO::getId, BusinessSampleEntrustDetailDO::getBaseSampleId) + .selectAll(BusinessSampleEntrustDetailDO.class) + .selectAs(BaseSampleDO::getDictionaryBusinessKey, BusinessSampleEntrustDetailExtendRespVO::getSampleTypeDictionaryBusinessKey) + .eq(BusinessSampleEntrustDetailDO::getBusinessSampleEntrustRegistrationId, businessSampleEntrustRegistrationId)); + } + + default List selectByBusinessSampleEntrustRegistrationIds(List businessSampleEntrustRegistrationIds) { + return selectList(new LambdaQueryWrapperX().in(BusinessSampleEntrustDetailDO::getBusinessSampleEntrustRegistrationId, businessSampleEntrustRegistrationIds)); + } + + default BusinessSampleEntrustDetailDO selectByBusinessBaseSampleId(Long businessBaseSampleId) { + return selectOne(new LambdaQueryWrapperX().eq(BusinessSampleEntrustDetailDO::getBusinessBaseSampleId, businessBaseSampleId)); + } + + default List selectByBusinessBaseSampleIds(List businessBaseSampleIds) { + return selectList(new LambdaQueryWrapperX().in(BusinessSampleEntrustDetailDO::getBusinessBaseSampleId, businessBaseSampleIds)); + } + + /** + * 查询当前批次的第一条数据 + * @param businessBaseSampleId 任意一条的主样id + * @param baseSampleDictionaryBusinessKey 样品大类类型key + * @return + */ + default BusinessSampleEntrustDetailDO selectCurrBatchFirstByBusinessBaseSampleIdAndBaseSampleDictionaryBusinessKey(Long businessBaseSampleId, String baseSampleDictionaryBusinessKey) { + BusinessSampleEntrustDetailDO businessSampleEntrustDetailDO = selectByBusinessBaseSampleId(businessBaseSampleId); + //查询当前委托的第一条 + return selectJoinOne(BusinessSampleEntrustDetailDO.class, new MPJLambdaWrapperX() + .leftJoin(BaseSampleDO.class, BaseSampleDO::getId, BusinessSampleEntrustDetailDO::getBaseSampleId) + .eq(BusinessSampleEntrustDetailDO::getBusinessSampleEntrustRegistrationId, businessSampleEntrustDetailDO.getBusinessSampleEntrustRegistrationId()) + .eq(BaseSampleDO::getDictionaryBusinessKey, baseSampleDictionaryBusinessKey) + .orderByAsc(BusinessSampleEntrustDetailDO::getSort) + .last(" limit 1 ")); + + } /** * 物理批量删除删除 diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubParentSampleAssessmentMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubParentSampleAssessmentMapper.java index 1116eda..cb92b17 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubParentSampleAssessmentMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubParentSampleAssessmentMapper.java @@ -4,8 +4,11 @@ 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.query.MPJLambdaWrapperX; import com.zt.plat.module.qms.business.bus.controller.vo.*; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubParentSampleAssessmentDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubParentSampleDO; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodDO; import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; import org.apache.ibatis.annotations.Mapper; @@ -24,6 +27,7 @@ public interface BusinessSubParentSampleAssessmentMapper extends BaseMapperX selectByBusinessSubParentSampleIds(List businessSubParentSampleIds) { + return selectJoinList(BusinessSubParentSampleAssessmentDO.class, new MPJLambdaWrapperX() + .leftJoin(ConfigAssayMethodDO.class, ConfigAssayMethodDO::getId, BusinessSubParentSampleAssessmentDO::getConfigAssayMethodId) + .in(BusinessSubParentSampleAssessmentDO::getBusinessSubParentSampleId, businessSubParentSampleIds)); + } default BusinessSubParentSampleAssessmentDO selectByBusinessSubParentSampleIdAndConfigAssayMethodId(Long businessSubParentSampleId, Long configAssayMethodId) { return selectOne(new LambdaQueryWrapperX() @@ -41,11 +51,22 @@ public interface BusinessSubParentSampleAssessmentMapper extends BaseMapperX selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(List businessSubParentSampleIds, - Long configAssayMethodId) { - return selectList(new LambdaQueryWrapperX() + default List selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(List businessSubParentSampleIds, Long configAssayMethodId) { + return selectJoinList(BusinessSubParentSampleAssessmentExtendRespVO.class, new MPJLambdaWrapperX() + .leftJoin(BusinessSubParentSampleDO.class, BusinessSubParentSampleDO::getId, BusinessSubParentSampleAssessmentDO::getBusinessSubParentSampleId) + .selectAll(BusinessSubParentSampleAssessmentDO.class) + .selectAs(BusinessSubParentSampleDO::getConfigSubSampleParentId, BusinessSubParentSampleAssessmentExtendRespVO::getConfigSubSampleParentId) + .selectAs(BusinessSubParentSampleDO::getBusinessBaseSampleId, BusinessSubParentSampleAssessmentExtendRespVO::getBusinessBaseSampleId) .in(BusinessSubParentSampleAssessmentDO::getBusinessSubParentSampleId, businessSubParentSampleIds) .eq(BusinessSubParentSampleAssessmentDO::getConfigAssayMethodId, configAssayMethodId)); } + default List selectByBusinessSubParentSampleIdsAndAssayDepartmentId(List businessSubParentSampleIds, + Long assayDepartmentId) { + return selectJoinList(BusinessSubParentSampleAssessmentDO.class, new MPJLambdaWrapperX() + .leftJoin(ConfigAssayMethodDO.class, ConfigAssayMethodDO::getId, BusinessSubParentSampleAssessmentDO::getConfigAssayMethodId) + .in(BusinessSubParentSampleAssessmentDO::getBusinessSubParentSampleId, businessSubParentSampleIds) + .eq(ConfigAssayMethodDO::getAssayDepartmentId, assayDepartmentId)); + } + } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubParentSampleAssessmentProjectMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubParentSampleAssessmentProjectMapper.java index c410af6..b951534 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubParentSampleAssessmentProjectMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubParentSampleAssessmentProjectMapper.java @@ -7,10 +7,12 @@ import com.zt.plat.framework.common.pojo.PageResult; import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; import com.zt.plat.framework.mybatis.core.query.MPJLambdaWrapperX; import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubParentSampleAssessmentDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubParentSampleAssessmentProjectDO; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodDO; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectDO; import com.zt.plat.module.qms.business.dic.dal.dataobject.DictionaryProjectDO; +import com.zt.plat.module.qms.enums.QmsCommonConstant; import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -28,6 +30,7 @@ public interface BusinessSubParentSampleAssessmentProjectMapper extends BaseMapp default PageResult selectPage(BusinessSubParentSampleAssessmentProjectPageReqVO reqVO) { return selectPage(reqVO, new LambdaQueryWrapperX() .eqIfPresent(BusinessSubParentSampleAssessmentProjectDO::getBusinessSubParentSampleId, reqVO.getBusinessSubParentSampleId()) + .eqIfPresent(BusinessSubParentSampleAssessmentProjectDO::getBusinessSubParentSampleAssessmentId, reqVO.getBusinessSubParentSampleAssessmentId()) .eqIfPresent(BusinessSubParentSampleAssessmentProjectDO::getDictionaryProjectId, reqVO.getDictionaryProjectId()) .eqIfPresent(BusinessSubParentSampleAssessmentProjectDO::getConfigAssayMethodProjectId, reqVO.getConfigAssayMethodProjectId()) .eqIfPresent(BusinessSubParentSampleAssessmentProjectDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId()) @@ -49,19 +52,22 @@ public interface BusinessSubParentSampleAssessmentProjectMapper extends BaseMapp .orderByDesc(BusinessSubParentSampleAssessmentProjectDO::getId)); } - default List selectByBusinessSubParentSampleIdAndConfigAssayMethodId(List businessSubParentSampleIds, Long configAssayMethodId) { + default List selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(List businessSubParentSampleIds, Long configAssayMethodId) { return selectJoinList(BusinessSubParentSampleAssessmentProjectExtendRespVO.class, new MPJLambdaWrapperX() + .leftJoin(BusinessSubParentSampleAssessmentDO.class, BusinessSubParentSampleAssessmentDO::getId, BusinessSubParentSampleAssessmentProjectDO::getBusinessSubParentSampleAssessmentId) .leftJoin(ConfigAssayMethodProjectDO.class, ConfigAssayMethodProjectDO::getId, BusinessSubParentSampleAssessmentProjectDO::getConfigAssayMethodProjectId) .leftJoin(DictionaryProjectDO.class, DictionaryProjectDO::getId, BusinessSubParentSampleAssessmentProjectDO::getDictionaryProjectId) .leftJoin(ConfigAssayMethodDO.class, ConfigAssayMethodDO::getId, BusinessSubParentSampleAssessmentProjectDO::getConfigAssayMethodId) .selectAll(BusinessSubParentSampleAssessmentProjectDO.class) + .selectAs(BusinessSubParentSampleAssessmentDO::getRetestCount, BusinessSubParentSampleAssessmentProjectExtendRespVO::getRetestCount) .selectAs(ConfigAssayMethodProjectDO::getDictionaryProjectUnit, BusinessSubSampleAssessmentProjectExtendRespVO::getDictionaryProjectUnit) .selectAs(DictionaryProjectDO::getKey, BusinessSubSampleAssessmentProjectExtendRespVO::getDictionaryProjectKey) .selectAs(DictionaryProjectDO::getSimpleName, BusinessSubSampleAssessmentProjectExtendRespVO::getSimpleName) .selectAs(DictionaryProjectDO::getShowName, BusinessSubSampleAssessmentProjectExtendRespVO::getShowName) .selectAs(ConfigAssayMethodDO::getName, BusinessSubSampleAssessmentProjectExtendRespVO::getConfigAssayMethodName) .in(BusinessSubParentSampleAssessmentProjectDO::getBusinessSubParentSampleId, businessSubParentSampleIds) - .eq(BusinessSubParentSampleAssessmentProjectDO::getConfigAssayMethodId, configAssayMethodId)); + .eq(BusinessSubParentSampleAssessmentProjectDO::getAssessmentStatus, QmsCommonConstant.NORMAL) + .eq(BusinessSubParentSampleAssessmentDO::getConfigAssayMethodId, configAssayMethodId)); } default List selectByConfigAssayMethodId(Long configAssayMethodId) { @@ -69,9 +75,16 @@ public interface BusinessSubParentSampleAssessmentProjectMapper extends BaseMapp .eq(BusinessSubParentSampleAssessmentProjectDO::getConfigAssayMethodId, configAssayMethodId)); } - List selectNoReportSubParentSampleAssessment(@Param("configAssayMethodId") Long configAssayMethodId); + default List selectByBusinessSubParentSampleAssessmentIdAndDictionaryProjectIds(Long businessSubParentSampleAssessmentId, List recheckDictionaryProjectIdList) { + return selectList(new LambdaQueryWrapper() + .eq(BusinessSubParentSampleAssessmentProjectDO::getBusinessSubParentSampleAssessmentId, businessSubParentSampleAssessmentId) + .in(BusinessSubParentSampleAssessmentProjectDO::getDictionaryProjectId, recheckDictionaryProjectIdList)); + } + + List selectNoReportSubParentSampleAssessment(@Param("reqVO") BusinessSubParentSampleAssessmentGroupReqVO reqVO); - List getRecheckAssayMethodList(@Param("baseSampleId") Long baseSampleId, @Param("businessSubParentSampleId") Long businessSubParentSampleId, @Param("configAssayMethodId") Long configAssayMethodId); + List getRecheckAssayMethodList(@Param("baseSampleId") Long baseSampleId, @Param("businessSubParentSampleId") Long businessSubParentSampleId, @Param("configAssayMethodId") Long configAssayMethodId, @Param("assayDepartmentId") Long assayDepartmentId); + } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubParentSampleMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubParentSampleMapper.java index 3c68a90..39b3e77 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubParentSampleMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubParentSampleMapper.java @@ -5,6 +5,9 @@ import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubParentSamplePageReqVO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubParentSampleDO; import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; + +import java.util.List; + import org.apache.ibatis.annotations.Mapper; /** @@ -37,5 +40,15 @@ public interface BusinessSubParentSampleMapper extends BaseMapperX selectByBusinessBaseSampleId(Long businessBaseSampleId) { + return selectList(new LambdaQueryWrapperX() + .eq(BusinessSubParentSampleDO::getBusinessBaseSampleId, businessBaseSampleId)); + } + + default List selectByBusinessBaseSampleIds(List businessBaseSampleIds) { + return selectList(new LambdaQueryWrapperX() + .in(BusinessSubParentSampleDO::getBusinessBaseSampleId, businessBaseSampleIds)); + } } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubSampleAnalysisGroupMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubSampleAnalysisGroupMapper.java index 2e4a679..68414ee 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubSampleAnalysisGroupMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubSampleAnalysisGroupMapper.java @@ -27,6 +27,7 @@ public interface BusinessSubSampleAnalysisGroupMapper extends BaseMapperX selectByBusinessSubParentSampleIdsAndAssayDepartmentId(List businessSubParentSampleIds, Long assayDepartmentId) { + return selectList(new LambdaQueryWrapperX() + .in(BusinessSubSampleAnalysisGroupDO::getBusinessSubParentSampleId, businessSubParentSampleIds) + .eq(BusinessSubSampleAnalysisGroupDO::getAssayDepartmentId, assayDepartmentId)); + } + default List selectByBusinessSubSampleId(Long businessSubSampleId) { return selectList(new LambdaQueryWrapperX() .eq(BusinessSubSampleAnalysisGroupDO::getBusinessSubSampleId, businessSubSampleId)); diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubSampleAssessmentMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubSampleAssessmentMapper.java index 13376e6..c483da8 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubSampleAssessmentMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubSampleAssessmentMapper.java @@ -25,6 +25,7 @@ public interface BusinessSubSampleAssessmentMapper extends BaseMapperX() + .eq(BusinessSubSampleAssessmentDO::getBusinessSubParentSampleId, businessSubParentSampleId) + .eq(BusinessSubSampleAssessmentDO::getConfigAssayMethodId, configAssayMethodId)); + } + + default List selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(List businessSubParentSampleIds, Long configAssayMethodId) { + return selectList(new LambdaQueryWrapperX() + .in(BusinessSubSampleAssessmentDO::getBusinessSubParentSampleId, businessSubParentSampleIds) + .eq(BusinessSubSampleAssessmentDO::getConfigAssayMethodId, configAssayMethodId)); + } + default BusinessSubSampleAssessmentDO selectByBusinessSubSampleIdAndConfigAssayMethodId(Long businessSubSampleId, Long configAssayMethodId) { return selectOne(new LambdaQueryWrapperX() .eq(BusinessSubSampleAssessmentDO::getBusinessSubSampleId, businessSubSampleId) .eq(BusinessSubSampleAssessmentDO::getConfigAssayMethodId, configAssayMethodId)); } - default List selectByBusinessSubSampleIdsAndConfigAssayMethodId(List businessSubSampleIds, Long configAssayMethodId) { + default List selectByBusinessSubSampleIdsAndConfigAssayMethodIdAndRetestCount(List businessSubSampleIds, Long configAssayMethodId, Integer retestCount) { return selectList(new LambdaQueryWrapperX() .in(BusinessSubSampleAssessmentDO::getBusinessSubSampleId, businessSubSampleIds) - .eq(BusinessSubSampleAssessmentDO::getConfigAssayMethodId, configAssayMethodId)); + .eq(BusinessSubSampleAssessmentDO::getConfigAssayMethodId, configAssayMethodId) + .eq(BusinessSubSampleAssessmentDO::getRetestCount, retestCount)); } } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubSampleAssessmentProjectMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubSampleAssessmentProjectMapper.java index b7f25ab..e146f3e 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubSampleAssessmentProjectMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubSampleAssessmentProjectMapper.java @@ -4,6 +4,7 @@ import com.zt.plat.framework.common.pojo.PageResult; import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; import com.zt.plat.framework.mybatis.core.query.MPJLambdaWrapperX; import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleAssessmentDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleAssessmentProjectDO; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodDO; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectDO; @@ -48,12 +49,31 @@ public interface BusinessSubSampleAssessmentProjectMapper extends BaseMapperX selectByBusinessSubParentSampleIdAndConfigAssayMethodId(Long businessSubParentSampleId, Long configAssayMethodId) { + default List selectByBusinessSubParentSampleIdAndBusinessSubParentSampleAssessmentId(Long businessSubParentSampleId, Long businessSubParentSampleAssessmentId) { return selectJoinList(BusinessSubSampleAssessmentProjectExtendRespVO.class, new MPJLambdaWrapperX() + .leftJoin(BusinessSubSampleAssessmentDO.class, BusinessSubSampleAssessmentDO::getId, BusinessSubSampleAssessmentProjectDO::getBusinessSubSampleAssessmentId) .leftJoin(ConfigAssayMethodDO.class, ConfigAssayMethodDO::getId, BusinessSubSampleAssessmentProjectDO::getConfigAssayMethodId) .leftJoin(ConfigAssayMethodProjectDO.class, ConfigAssayMethodProjectDO::getId, BusinessSubSampleAssessmentProjectDO::getConfigAssayMethodProjectId) .leftJoin(DictionaryProjectDO.class, DictionaryProjectDO::getId, BusinessSubSampleAssessmentProjectDO::getDictionaryProjectId) .selectAll(BusinessSubSampleAssessmentProjectDO.class) + .selectAs(BusinessSubSampleAssessmentDO::getRetestCount, BusinessSubSampleAssessmentProjectExtendRespVO::getRetestCount) + .selectAs(ConfigAssayMethodDO::getName, BusinessSubSampleAssessmentProjectExtendRespVO::getConfigAssayMethodName) + .selectAs(ConfigAssayMethodProjectDO::getDictionaryProjectUnit, BusinessSubSampleAssessmentProjectExtendRespVO::getDictionaryProjectUnit) + .selectAs(DictionaryProjectDO::getKey, BusinessSubSampleAssessmentProjectExtendRespVO::getDictionaryProjectKey) + .selectAs(DictionaryProjectDO::getSimpleName, BusinessSubSampleAssessmentProjectExtendRespVO::getSimpleName) + .selectAs(DictionaryProjectDO::getShowName, BusinessSubSampleAssessmentProjectExtendRespVO::getShowName) + .eq(BusinessSubSampleAssessmentProjectDO::getBusinessSubParentSampleId, businessSubParentSampleId) + .eq(BusinessSubSampleAssessmentDO::getBusinessSubParentSampleAssessmentId, businessSubParentSampleAssessmentId)); + } + + default List selectByBusinessSubParentSampleIdAndConfigAssayMethodId(Long businessSubParentSampleId, Long configAssayMethodId) { + return selectJoinList(BusinessSubSampleAssessmentProjectExtendRespVO.class, new MPJLambdaWrapperX() + .leftJoin(BusinessSubSampleAssessmentDO.class, BusinessSubSampleAssessmentDO::getId, BusinessSubSampleAssessmentProjectDO::getBusinessSubSampleAssessmentId) + .leftJoin(ConfigAssayMethodDO.class, ConfigAssayMethodDO::getId, BusinessSubSampleAssessmentProjectDO::getConfigAssayMethodId) + .leftJoin(ConfigAssayMethodProjectDO.class, ConfigAssayMethodProjectDO::getId, BusinessSubSampleAssessmentProjectDO::getConfigAssayMethodProjectId) + .leftJoin(DictionaryProjectDO.class, DictionaryProjectDO::getId, BusinessSubSampleAssessmentProjectDO::getDictionaryProjectId) + .selectAll(BusinessSubSampleAssessmentProjectDO.class) + .selectAs(BusinessSubSampleAssessmentDO::getRetestCount, BusinessSubSampleAssessmentProjectExtendRespVO::getRetestCount) .selectAs(ConfigAssayMethodDO::getName, BusinessSubSampleAssessmentProjectExtendRespVO::getConfigAssayMethodName) .selectAs(ConfigAssayMethodProjectDO::getDictionaryProjectUnit, BusinessSubSampleAssessmentProjectExtendRespVO::getDictionaryProjectUnit) .selectAs(DictionaryProjectDO::getKey, BusinessSubSampleAssessmentProjectExtendRespVO::getDictionaryProjectKey) @@ -65,10 +85,12 @@ public interface BusinessSubSampleAssessmentProjectMapper extends BaseMapperX selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(List businessSubParentSampleIds, Long configAssayMethodId) { return selectJoinList(BusinessSubSampleAssessmentProjectExtendRespVO.class, new MPJLambdaWrapperX() + .leftJoin(BusinessSubSampleAssessmentDO.class, BusinessSubSampleAssessmentDO::getId, BusinessSubSampleAssessmentProjectDO::getBusinessSubSampleAssessmentId) .leftJoin(ConfigAssayMethodDO.class, ConfigAssayMethodDO::getId, BusinessSubSampleAssessmentProjectDO::getConfigAssayMethodId) .leftJoin(ConfigAssayMethodProjectDO.class, ConfigAssayMethodProjectDO::getId, BusinessSubSampleAssessmentProjectDO::getConfigAssayMethodProjectId) .leftJoin(DictionaryProjectDO.class, DictionaryProjectDO::getId, BusinessSubSampleAssessmentProjectDO::getDictionaryProjectId) .selectAll(BusinessSubSampleAssessmentProjectDO.class) + .selectAs(BusinessSubSampleAssessmentDO::getRetestCount, BusinessSubSampleAssessmentProjectExtendRespVO::getRetestCount) .selectAs(ConfigAssayMethodDO::getName, BusinessSubSampleAssessmentProjectExtendRespVO::getConfigAssayMethodName) .selectAs(ConfigAssayMethodProjectDO::getDictionaryProjectUnit, BusinessSubSampleAssessmentProjectExtendRespVO::getDictionaryProjectUnit) .selectAs(DictionaryProjectDO::getKey, BusinessSubSampleAssessmentProjectExtendRespVO::getDictionaryProjectKey) diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubSampleMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubSampleMapper.java index 4799e20..59463fb 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubSampleMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubSampleMapper.java @@ -144,8 +144,8 @@ public interface BusinessSubSampleMapper extends BaseMapperX selectList(@Valid BusinessSubSampleReqVO reqVO) { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubSampleParentRecheckMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubSampleParentRecheckMapper.java deleted file mode 100644 index c7f396e..0000000 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubSampleParentRecheckMapper.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.zt.plat.module.qms.business.bus.dal.mapper; - -import java.util.*; - -import com.zt.plat.framework.common.pojo.PageResult; -import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; -import com.zt.plat.module.qms.business.bus.controller.vo.*; -import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleParentRecheckDO; -import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; -import org.apache.ibatis.annotations.Mapper; - -/** - * 分样复检业务数据 Mapper - * - * @author 后台管理 - */ -@Mapper -public interface BusinessSubSampleParentRecheckMapper extends BaseMapperX { - - default PageResult selectPage(BusinessSubSampleParentRecheckPageReqVO reqVO) { - return selectPage(reqVO, new LambdaQueryWrapperX() - .eqIfPresent(BusinessSubSampleParentRecheckDO::getSampleId, reqVO.getSampleId()) - .eqIfPresent(BusinessSubSampleParentRecheckDO::getBusinessBaseSampleId, reqVO.getBusinessBaseSampleId()) - .eqIfPresent(BusinessSubSampleParentRecheckDO::getBusinessSubParentSampleId, reqVO.getBusinessSubParentSampleId()) - .eqIfPresent(BusinessSubSampleParentRecheckDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId()) - .eqIfPresent(BusinessSubSampleParentRecheckDO::getRecheckBusinessBaseSampleId, reqVO.getRecheckBusinessBaseSampleId()) - .eqIfPresent(BusinessSubSampleParentRecheckDO::getRecheckBusinessSubParentSampleId, reqVO.getRecheckBusinessSubParentSampleId()) - .eqIfPresent(BusinessSubSampleParentRecheckDO::getRecheckConfigAssayMethodId, reqVO.getRecheckConfigAssayMethodId()) - .eqIfPresent(BusinessSubSampleParentRecheckDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) - .betweenIfPresent(BusinessSubSampleParentRecheckDO::getCreateTime, reqVO.getCreateTime()) - .eqIfPresent(BusinessSubSampleParentRecheckDO::getUpdateCount, reqVO.getUpdateCount()) - .eqIfPresent(BusinessSubSampleParentRecheckDO::getRemark, reqVO.getRemark()) - .orderByDesc(BusinessSubSampleParentRecheckDO::getId)); - } - - default List selectByRecheckBusinessSubParentSampleIdsAndRecheckConfigAssayMethodId(List recheckBusinessSubParentSampleIds, Long recheckConfigAssayMethodId) { - return selectList(new LambdaQueryWrapperX() - .in(BusinessSubSampleParentRecheckDO::getRecheckBusinessSubParentSampleId, recheckBusinessSubParentSampleIds) - .eq(BusinessSubSampleParentRecheckDO::getRecheckConfigAssayMethodId, recheckConfigAssayMethodId)); - } - -} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubSampleParentRetestMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubSampleParentRetestMapper.java new file mode 100644 index 0000000..41a73f9 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubSampleParentRetestMapper.java @@ -0,0 +1,45 @@ +package com.zt.plat.module.qms.business.bus.dal.mapper; + +import java.util.*; + +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleParentRetestDO; +import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; +import org.apache.ibatis.annotations.Mapper; + +/** + * 分样复测业务数据 Mapper + * + * @author 后台管理-1 + */ +@Mapper +public interface BusinessSubSampleParentRetestMapper extends BaseMapperX { + + default PageResult selectPage(BusinessSubSampleParentRetestPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(BusinessSubSampleParentRetestDO::getSampleId, reqVO.getSampleId()) + .eqIfPresent(BusinessSubSampleParentRetestDO::getBusinessBaseSampleId, reqVO.getBusinessBaseSampleId()) + .eqIfPresent(BusinessSubSampleParentRetestDO::getBusinessSubParentSampleId, reqVO.getBusinessSubParentSampleId()) + .eqIfPresent(BusinessSubSampleParentRetestDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId()) + .eqIfPresent(BusinessSubSampleParentRetestDO::getBusinessSubParentSampleAssessmentId, reqVO.getBusinessSubParentSampleAssessmentId()) + .eqIfPresent(BusinessSubSampleParentRetestDO::getRetestCount, reqVO.getRetestCount()) + .eqIfPresent(BusinessSubSampleParentRetestDO::getRetestBusinessBaseSampleId, reqVO.getRetestBusinessBaseSampleId()) + .eqIfPresent(BusinessSubSampleParentRetestDO::getRetestBusinessSubParentSampleId, reqVO.getRetestBusinessSubParentSampleId()) + .eqIfPresent(BusinessSubSampleParentRetestDO::getRetestConfigAssayMethodId, reqVO.getRetestConfigAssayMethodId()) + .eqIfPresent(BusinessSubSampleParentRetestDO::getRetestBusinessSubParentSampleAssessmentId, reqVO.getRetestBusinessSubParentSampleAssessmentId()) + .eqIfPresent(BusinessSubSampleParentRetestDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .betweenIfPresent(BusinessSubSampleParentRetestDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(BusinessSubSampleParentRetestDO::getUpdateCount, reqVO.getUpdateCount()) + .eqIfPresent(BusinessSubSampleParentRetestDO::getRemark, reqVO.getRemark()) + .orderByDesc(BusinessSubSampleParentRetestDO::getId)); + } + + default List selectByRetestBusinessSubParentSampleIdsAndRetestConfigAssayMethodId(List retestBusinessSubParentSampleIds, Long retestConfigAssayMethodId) { + return selectList(new LambdaQueryWrapperX() + .in(BusinessSubSampleParentRetestDO::getRetestBusinessSubParentSampleId, retestBusinessSubParentSampleIds) + .eq(BusinessSubSampleParentRetestDO::getRetestConfigAssayMethodId, retestConfigAssayMethodId)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessXRFDataMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessXRFDataMapper.java index fde1a91..4d6bd8c 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessXRFDataMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessXRFDataMapper.java @@ -30,6 +30,7 @@ public interface BusinessXRFDataMapper extends BaseMapperX { .eqIfPresent(BusinessXRFDataDO::getBusinessSubParentSampleId, reqVO.getBusinessSubParentSampleId()) .eqIfPresent(BusinessXRFDataDO::getBusinessSubSampleId, reqVO.getBusinessSubSampleId()) .eqIfPresent(BusinessXRFDataDO::getBusinessAssayTaskDataId, reqVO.getBusinessAssayTaskDataId()) + .eqIfPresent(BusinessXRFDataDO::getBusinessQCManagementDataId, reqVO.getBusinessQCManagementDataId()) .eqIfPresent(BusinessXRFDataDO::getAssayData, reqVO.getAssayData()) .eqIfPresent(BusinessXRFDataDO::getIsCheckCreate, reqVO.getIsCheckCreate()) .eqIfPresent(BusinessXRFDataDO::getIsMatched, reqVO.getIsMatched()) @@ -57,6 +58,7 @@ public interface BusinessXRFDataMapper extends BaseMapperX { .eqIfPresent(BusinessXRFDataDO::getBusinessSubParentSampleId, reqVO.getBusinessSubParentSampleId()) .eqIfPresent(BusinessXRFDataDO::getBusinessSubSampleId, reqVO.getBusinessSubSampleId()) .eqIfPresent(BusinessXRFDataDO::getBusinessAssayTaskDataId, reqVO.getBusinessAssayTaskDataId()) + .eqIfPresent(BusinessXRFDataDO::getBusinessQCManagementDataId, reqVO.getBusinessQCManagementDataId()) .eqIfPresent(BusinessXRFDataDO::getAssayData, reqVO.getAssayData()) .eqIfPresent(BusinessXRFDataDO::getIsCheckCreate, reqVO.getIsCheckCreate()) .eqIfPresent(BusinessXRFDataDO::getIsMatched, reqVO.getIsMatched()) diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/entrust/SampleEntrustGenSampleDataCmp.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/entrust/SampleEntrustGenSampleDataCmp.java index a6553d6..c675372 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/entrust/SampleEntrustGenSampleDataCmp.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/entrust/SampleEntrustGenSampleDataCmp.java @@ -2,22 +2,28 @@ package com.zt.plat.module.qms.business.bus.liteflow.sample.entrust; import java.time.LocalDateTime; import java.util.ArrayList; +import java.util.Arrays; import java.util.Comparator; import java.util.List; import java.util.stream.Collectors; +import org.apache.commons.lang3.StringUtils; + import com.alibaba.fastjson2.JSON; +import com.alibaba.fastjson2.JSONArray; +import com.alibaba.fastjson2.JSONObject; import com.baomidou.mybatisplus.core.toolkit.IdWorker; import com.yomahub.liteflow.annotation.LiteflowComponent; import com.yomahub.liteflow.core.NodeComponent; import cn.hutool.core.collection.CollUtil; + import com.zt.plat.framework.common.exception.ServiceException; -import com.zt.plat.framework.tenant.core.context.TenantContextHolder; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayParameterDataDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayProjectDataDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayReportDataDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDataDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskParameterDataDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessBaseSampleDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleAssayResultDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleEntrustDetailDO; @@ -32,6 +38,7 @@ import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayParameterData import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayProjectDataMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayReportDataMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayTaskDataMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayTaskParameterDataMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessBaseSampleMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSampleAssayResultMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSampleEntrustDetailMapper; @@ -44,19 +51,23 @@ import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubSampleAssessmen import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubSampleMapper; import com.zt.plat.module.qms.business.bus.liteflow.param.SampleFlowInfo; import com.zt.plat.module.qms.business.bus.liteflow.slot.SampleEntrustContext; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigAssayMethodProjectExtendRespVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSampleMethodConfAdd; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSampleMethodConfInfo; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSampleMethodExtendRespVO; import com.zt.plat.module.qms.business.config.dal.dataobject.BaseSampleDO; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodDO; -import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectDO; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodParameterDO; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectParameterDO; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigBaseSampleDO; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSampleFlowDO; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSampleReportDO; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSubSampleDO; -import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSubSampleMethodDO; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSubSampleParentDO; import com.zt.plat.module.qms.business.config.dal.dataobject.MaterialAssayStandardMethodDO; import com.zt.plat.module.qms.business.config.dal.mapper.BaseSampleMapper; import com.zt.plat.module.qms.business.config.dal.mapper.ConfigAssayMethodMapper; +import com.zt.plat.module.qms.business.config.dal.mapper.ConfigAssayMethodParameterMapper; import com.zt.plat.module.qms.business.config.dal.mapper.ConfigAssayMethodProjectMapper; import com.zt.plat.module.qms.business.config.dal.mapper.ConfigAssayMethodProjectParameterMapper; import com.zt.plat.module.qms.business.config.dal.mapper.ConfigBaseSampleMapper; @@ -75,6 +86,13 @@ import com.zt.plat.module.qms.enums.QmsCommonConstant; import jakarta.annotation.Resource; import lombok.extern.slf4j.Slf4j; +/** + * 委检样 是否有来样品位S值, 是: 综合分析室分析配料元素,试金分析室获取分析的配料元素 ;否:不送往综合分析室,配料时采用来样品位S值,如果是必须含有Cu、S的,则试金分析人员称样时,估一个Cu品位进行配料。 + * + * 商检分析样 这批样中第一个样品默认产生1个配料任务(综合分析室分析),最终这些配料元素对应到这批商检分析样的每一个试金样品的配料参数上; + * + * 商检综合样 综合样,除了杂质元素,如果要分析Au、Ag,单个样品综合分析室分析配料元素会单独生成1个任务;这个结果匹配到综合样自身的试金任务的配料参数上; + */ @Slf4j @LiteflowComponent(id = "sampleEntrustGenSampleDataCmp", name = "样品委托生成系统样品数据") public class SampleEntrustGenSampleDataCmp extends NodeComponent { @@ -127,9 +145,15 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent { @Resource private ConfigSubSampleMethodMapper configSubSampleMethodMapper;//子样分析方法关联配置 + @Resource + private ConfigAssayMethodParameterMapper configAssayMethodParameterMapper; + @Resource private BusinessAssayTaskDataMapper businessAssayTaskDataMapper; + @Resource + private BusinessAssayTaskParameterDataMapper businessAssayTaskParameterDataMapper; + @Resource private ConfigAssayMethodProjectMapper configAssayMethodProjectMapper; @@ -178,47 +202,35 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent { //样品来样品位 List sampleAssayResultList = sampleEntrustContext.getSampleAssayResultList(); - //金银检测项目字典id列表 - List auAgDictionaryProjectIdList = new ArrayList<>() { - private static final long serialVersionUID = 1L; - - { - add(1000000000000000002L); - add(1000000000000000003L); - }}; - //硫的检测项目字典id - Long sDictionaryProjectId = 1000000000000000004L; - - //商检样品来源id - List sjEntrustSourceIdList = new ArrayList<>() { - private static final long serialVersionUID = 1L; - - { - add(1000000000000000002L);//中铜国贸 - }}; + List baseSampleIdList = sampleEntrustDetailList.stream().map(m -> m.getBaseSampleId()).distinct().collect(Collectors.toList()); //样品大类列表 - List baseSampleList = baseSampleMapper.selectList(); + List baseSampleList = baseSampleMapper.selectByIds(baseSampleIdList); //主样配置 - List configBaseSampleList = configBaseSampleMapper.selectList(); + List configBaseSampleList = configBaseSampleMapper.selectByBaseSampleIds(baseSampleIdList); + List configBaseSampleIdList = configBaseSampleList.stream().map(m -> m.getId()).collect(Collectors.toList()); //分样配置 - List configSubSampleParentList = configSubSampleParentMapper.selectList(); + List configSubSampleParentList = configSubSampleParentMapper.selectByBaseSampleIds(baseSampleIdList); //子样配置 - List configSubSampleList = configSubSampleMapper.selectList(); + List configSubSampleList = configSubSampleMapper.selectByBaseSampleIds(baseSampleIdList); + List configSubSampleIdList = configSubSampleList.stream().map(m -> m.getId()).collect(Collectors.toList()); //子样分析方法配置 - List configSubSampleMethodList = configSubSampleMethodMapper.selectList(); + List configSubSampleMethodList = configSubSampleMethodMapper.selectByConfigSubSampleIds(configSubSampleIdList); + List configAssayMethodIdList = configSubSampleMethodList.stream().map(m -> m.getConfigAssayMethodId()).distinct().collect(Collectors.toList()); //分析方法配置 - List configAssayMethodList = configAssayMethodMapper.selectList(); + List configAssayMethodList = configAssayMethodMapper.selectByIds(configAssayMethodIdList); + //分析方法参数配置 + List configAssayMethodParameterList = configAssayMethodParameterMapper.selectByConfigAssayMethodIds(configAssayMethodIdList); //分析方法检测项目配置 - List configAssayMethodProjectList = configAssayMethodProjectMapper.selectList(); + List configAssayMethodProjectList = configAssayMethodProjectMapper.selectByConfigAssayMethodIds(configAssayMethodIdList); //分析方法检测项目参数配置 - List configAssayMethodProjectParameterList = configAssayMethodProjectParameterMapper.selectList(); + List configAssayMethodProjectParameterList = configAssayMethodProjectParameterMapper.selectByConfigAssayMethodIds(configAssayMethodIdList); //检测项目字典 List dictionaryProjectList = dictionaryProjectMapper.selectList(); //主样报表配置 - List configSampleReportList = configSampleReportMapper.selectList(); + List configSampleReportList = configSampleReportMapper.selectByConfigBaseSampleIds(configBaseSampleIdList); //样品流程配置 List configSampleFlowKeyList = new ArrayList<>(); @@ -242,6 +254,8 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent { List businessSubSampleAssessmentDOList = new ArrayList<>(); //子样检测任务 List businessAssayTaskDataDOList = new ArrayList<>(); + //子样检测任务参数 + List businessAssayTaskParameterDataDOList = new ArrayList<>(); //检测任务的分析项目 List businessAssayProjectDataDOList = new ArrayList<>(); //分析项目对应的分析参数 @@ -249,13 +263,6 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent { //分析报表数据 List businessAssayReportDataDOList = new ArrayList<>(); - //是否为商检委托 - Boolean isSjEntrust = sjEntrustSourceIdList.contains(sampleEntrustRegistration.getConfigEntrustSourceId()); - //是否分析金银 - Boolean isAssayAuAg = sampleEntrustProjectList.stream().anyMatch(f -> auAgDictionaryProjectIdList.contains(f.getDictionaryProjectId())); - //是否分析硫 - Boolean isAssayS = sampleEntrustProjectList.stream().anyMatch(f -> f.getDictionaryProjectId().equals(sDictionaryProjectId)); - //子样流转信息列表 List sampleFlowInfoList = new ArrayList<>(); @@ -263,18 +270,23 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent { List sampleEntrustDetailListSort = sampleEntrustDetailList.stream().sorted(Comparator.comparingInt(BusinessSampleEntrustDetailDO::getSort)).collect(Collectors.toList()); //主样 BusinessBaseSampleDO businessBaseSampleDO = null; - int sort = 0;//委托明细顺序 + int sjfxyOne = -1;//商检分析样第一个是值为0,已经过商检分析样的值为1,默认值为-1; for (BusinessSampleEntrustDetailDO businessSampleEntrustDetailDO : sampleEntrustDetailListSort) {//委托样品明细 //样品大类 BaseSampleDO baseSampleDO = baseSampleList.stream().filter(f -> f.getId().equals(businessSampleEntrustDetailDO.getBaseSampleId())).findFirst().orElse(null); + + if (QmsCommonConstant.ENTRUST_INSPECTION_ANALYSIS_SAMPLE.equals(baseSampleDO.getDictionaryBusinessKey())){//如果是商检分析样 + if (sjfxyOne == -1) { + sjfxyOne = 0;//第一个商检分析样 + } else { + sjfxyOne = 1;//商检分析样已添加过 + } + } //获取当前样品的检测项目 List sampleEntrustProjectDOList = sampleEntrustProjectList.stream().filter(f -> businessSampleEntrustDetailDO.getId().equals(f.getBusinessSampleEntrustDetailId())).collect(Collectors.toList()); - //当前样品检测项目字典id列表 - List dictionaryProjectIdList = sampleEntrustProjectDOList.stream().map(m -> m.getDictionaryProjectId()).collect(Collectors.toList()); - //获取物料检测标准检测项目id列表 List materialAssayStandardDetailIdList = sampleEntrustProjectDOList.stream().map(m -> m.getMaterialAssayStandardDetailId()).collect(Collectors.toList()); @@ -282,42 +294,17 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent { List materialAssayStandardMethodList = sampleEntrustContext.getMaterialAssayStandardMethodDefaultByMaterialAssayStandardDetailIds(materialAssayStandardDetailIdList); //获取检测方法 - List configAssayMethodIdList = materialAssayStandardMethodList.stream().map(m -> m.getConfigAssayMethodId()).distinct().collect(Collectors.toList()); + List materialAssayStandardConfigAssayMethodIdList = materialAssayStandardMethodList.stream().map(m -> m.getConfigAssayMethodId()).distinct().collect(Collectors.toList()); - //查找子样配置 - List configSubSampleIdList = configSubSampleMethodList.stream().filter(f -> f.getIsDefaultUse().equals(QmsCommonConstant.YES) && configAssayMethodIdList.contains(f.getConfigAssayMethodId())).map(m -> m.getConfigSubSampleId()).distinct().collect(Collectors.toList()); + //查找当前委托明细分析的子样配置 + List currentConfigSubSampleIdList = configSubSampleMethodList.stream().filter(f -> f.getIsDefaultUse().equals(QmsCommonConstant.YES) && materialAssayStandardConfigAssayMethodIdList.contains(f.getConfigAssayMethodId())).map(m -> m.getConfigSubSampleId()).distinct().collect(Collectors.toList()); //查询当前委托样品对应的子样 - List entrustConfigSubSampleList = configSubSampleList.stream().filter(f -> configSubSampleIdList.contains(f.getId()) && f.getBaseSampleId().equals(businessSampleEntrustDetailDO.getBaseSampleId())).distinct().collect(Collectors.toList()); + List entrustConfigSubSampleList = configSubSampleList.stream().filter(f -> currentConfigSubSampleIdList.contains(f.getId()) && f.getBaseSampleId().equals(businessSampleEntrustDetailDO.getBaseSampleId())).distinct().collect(Collectors.toList()); if (entrustConfigSubSampleList.size() != 1) { throw new ServiceException(1_032_100_000, "子样配置不正确"); } - - - //是否创建综合样S分析 - Boolean isCreateZhy = false; - //综合样分析方法 - ConfigAssayMethodDO configAssayMethodZhy = null; - - //是商检样品,分析金银,第一个样品 - if (isSjEntrust && isAssayAuAg && sort == 0) { - //是否分析硫 - isAssayS = dictionaryProjectIdList.contains(sDictionaryProjectId); - if (isAssayS) { - isCreateZhy = false; - } else { - isCreateZhy = true; - MaterialAssayStandardMethodDO materialAssayStandardMethodDO = materialAssayStandardMethodMapper.selectByBaseSampleIdAndDictionaryProjectId(businessSampleEntrustDetailDO.getBaseSampleId(), sDictionaryProjectId); - if (materialAssayStandardMethodDO == null) { - throw new ServiceException(1_032_100_000, "商检样品,检测项目存在金银,但未找到S配置"); - } - configAssayMethodZhy = configAssayMethodMapper.selectById(materialAssayStandardMethodDO.getConfigAssayMethodId()); - } - - } - - - + //获取到子样配置 ConfigSubSampleDO configSubSample = entrustConfigSubSampleList.get(0); Long configSubSampleParentId = configSubSample.getConfigSubSampleParentId(); @@ -432,14 +419,84 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent { //子样对应的分析班组 BusinessSubSampleAnalysisGroupDO businessSubSampleAnalysisGroupDO = null; - - for (Long configAssayMethodId : configAssayMethodIdList) { + + for (Long configAssayMethodId : materialAssayStandardConfigAssayMethodIdList) { + //获取分析方法对应的分析标准 + List currentMaterialAssayStandardMethodList = materialAssayStandardMethodList.stream().filter(f -> f.getConfigAssayMethodId().equals(configAssayMethodId)).collect(Collectors.toList()); + //获取分析标准的明细id + List currentMaterialAssayStandardDetailIdList = currentMaterialAssayStandardMethodList.stream().map(m -> m.getMaterialAssayStandardDetailId()).collect(Collectors.toList()); + //获取当前分析方法对应的检测项目 + List dictionaryProjectIdList = sampleEntrustProjectDOList.stream().filter(f -> currentMaterialAssayStandardDetailIdList.contains(f.getMaterialAssayStandardDetailId())).map(m -> m.getDictionaryProjectId()).collect(Collectors.toList()); + //获取当前分析方法对应的检测项目显示名称 + List dictionaryProjectShowNameList = dictionaryProjectList.stream().filter(f -> dictionaryProjectIdList.contains(f.getId())).map(m -> m.getShowName()).collect(Collectors.toList()); //查询分析方法 ConfigAssayMethodDO configAssayMethodDO = configAssayMethodList.stream().filter(f -> f.getId().equals(configAssayMethodId)).findFirst().orElse(null); //查询子样对应的分析方法 - ConfigSubSampleMethodDO configSubSampleMethodDO = configSubSampleMethodList.stream().filter(f -> f.getIsDefaultUse().equals(QmsCommonConstant.YES) && f.getConfigAssayMethodId().equals(configAssayMethodId) && f.getConfigSubSampleId().equals(configSubSample.getId())).findFirst().orElse(null); + ConfigSubSampleMethodExtendRespVO configSubSampleMethodDO = configSubSampleMethodList.stream().filter(f -> f.getIsDefaultUse().equals(QmsCommonConstant.YES) && f.getConfigAssayMethodId().equals(configAssayMethodId) && f.getConfigSubSampleId().equals(configSubSample.getId())).findFirst().orElse(null); + if (configSubSampleMethodDO == null) { + throw new ServiceException(1_032_100_000, "未找到子样对应的分析方法配置!"); + } + + //扩展配置信息 + String configInfomation = configSubSampleMethodDO.getConfigInfomation(); + if (StringUtils.isNotBlank(configInfomation)) { + ConfigSubSampleMethodConfInfo configSubSampleMethodConfInfo = JSON.parseObject(configInfomation, ConfigSubSampleMethodConfInfo.class); + ConfigSubSampleMethodConfAdd addAssayTask = configSubSampleMethodConfInfo.getAddAssayTask(); + if (addAssayTask != null) {//需要添加任务 + + List conditionProjectIdList = addAssayTask.getConditionProjectIdList(); + Long methodId = addAssayTask.getMethodId(); + List projectIdList = addAssayTask.getProjectIdList(); + //判定检测项目包含条件中的检测项目 + Boolean isAssayConditionProjectList = sampleEntrustProjectList.stream().anyMatch(f -> conditionProjectIdList.contains(f.getDictionaryProjectId())); + //是否预报S值 + Boolean isForecastS = false; + String forecastResult = businessSampleEntrustDetailDO.getForecastResult(); + if (StringUtils.isNotBlank(forecastResult)) { + JSONArray array = JSON.parseArray(forecastResult); + for (int i = 0; i < array.size(); i++) { + JSONObject item = array.getJSONObject(i); + if ("S".equals(item.getString("simpleName"))) { + isForecastS = true; + break; + } + } + } + + //如果是商检样分析,且为第一个商检分析样,并且包含要检测的项目, + if (QmsCommonConstant.ENTRUST_INSPECTION_ANALYSIS_SAMPLE.equals(baseSampleDO.getDictionaryBusinessKey()) && isAssayConditionProjectList && sjfxyOne == 0) { + addAssayTask(currentDateTime, configSubSampleMethodList, configAssayMethodProjectList, + configAssayMethodProjectParameterList, dictionaryProjectList, + businessSubParentSampleAssessmentDOList, businessSubSampleAnalysisGroupDOList, + businessSubSampleAssessmentDOList, businessAssayTaskDataDOList, + businessAssayProjectDataDOList, businessAssayParameterDataDOList, configSubSample, + configSampleFlowSub, sampleFlowNodeSub, businessSubSampleDO, methodId, + projectIdList, configAssayMethodParameterList, businessAssayTaskParameterDataDOList); + } else if (QmsCommonConstant.ENTRUST_COMPREHENSIVE_INSPECTION_SAMPLE.equals(baseSampleDO.getDictionaryBusinessKey()) && isAssayConditionProjectList) {//如果是商检综合样,并且包含需检查的项目 + addAssayTask(currentDateTime, configSubSampleMethodList, configAssayMethodProjectList, + configAssayMethodProjectParameterList, dictionaryProjectList, + businessSubParentSampleAssessmentDOList, businessSubSampleAnalysisGroupDOList, + businessSubSampleAssessmentDOList, businessAssayTaskDataDOList, + businessAssayProjectDataDOList, businessAssayParameterDataDOList, configSubSample, + configSampleFlowSub, sampleFlowNodeSub, businessSubSampleDO, methodId, + projectIdList, configAssayMethodParameterList, businessAssayTaskParameterDataDOList); + + } else if (QmsCommonConstant.ENTRUST_COMMISSION_INSPECTION_SAMPLE.equals(baseSampleDO.getDictionaryBusinessKey()) && isAssayConditionProjectList && !isForecastS ) {//如果是委检样,包含检测项目,未预报S值 + addAssayTask(currentDateTime, configSubSampleMethodList, configAssayMethodProjectList, + configAssayMethodProjectParameterList, dictionaryProjectList, + businessSubParentSampleAssessmentDOList, businessSubSampleAnalysisGroupDOList, + businessSubSampleAssessmentDOList, businessAssayTaskDataDOList, + businessAssayProjectDataDOList, businessAssayParameterDataDOList, configSubSample, + configSampleFlowSub, sampleFlowNodeSub, businessSubSampleDO, methodId, + projectIdList, configAssayMethodParameterList, businessAssayTaskParameterDataDOList); + } + + } + + } + //分析班组 businessSubSampleAnalysisGroupDO = businessSubSampleAnalysisGroupDOList.stream().filter(f -> f.getBusinessSubSampleId().equals(businessSubSampleDO.getId()) && f.getAssayDepartmentId().equals(configAssayMethodDO.getAssayDepartmentId())).findFirst().orElse(null); if (businessSubSampleAnalysisGroupDO == null) { businessSubSampleAnalysisGroupDO = new BusinessSubSampleAnalysisGroupDO(); @@ -458,214 +515,173 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent { String assayType = configSubSampleMethodDO.getTaskCount() > 1 ? QmsCommonConstant.ASSAY_TYPE_SINGLE_PARALLEL : QmsCommonConstant.ASSAY_TYPE_SINGLE_CUP; //分样判定数据 - BusinessSubParentSampleAssessmentDO businessSubParentSampleAssessmentDO = new BusinessSubParentSampleAssessmentDO(); - businessSubParentSampleAssessmentDO.setId(IdWorker.getId()); - businessSubParentSampleAssessmentDO.setBusinessSubParentSampleId(businessSubSampleDO.getBusinessSubParentSampleId()); - businessSubParentSampleAssessmentDO.setConfigAssayMethodId(configAssayMethodId); - businessSubParentSampleAssessmentDO.setAssayType(assayType); - businessSubParentSampleAssessmentDO.setTaskType("常规"); - businessSubParentSampleAssessmentDOList.add(businessSubParentSampleAssessmentDO); + BusinessSubParentSampleAssessmentDO businessSubParentSampleAssessmentDO = businessSubParentSampleAssessmentDOList.stream().filter(f -> f.getBusinessSubParentSampleId().equals(businessSubSampleDO.getBusinessSubParentSampleId()) && f.getConfigAssayMethodId().equals(configAssayMethodId) && f.getAssayType().equals(assayType)).findFirst().orElse(null);//防止重复添加,先从列表过滤 + if (businessSubParentSampleAssessmentDO == null) { + businessSubParentSampleAssessmentDO = new BusinessSubParentSampleAssessmentDO(); + businessSubParentSampleAssessmentDO.setId(IdWorker.getId()); + businessSubParentSampleAssessmentDO.setBusinessSubParentSampleId(businessSubSampleDO.getBusinessSubParentSampleId()); + businessSubParentSampleAssessmentDO.setConfigAssayMethodId(configAssayMethodId); + businessSubParentSampleAssessmentDO.setAssayType(assayType); + businessSubParentSampleAssessmentDO.setTaskType("常规"); + businessSubParentSampleAssessmentDOList.add(businessSubParentSampleAssessmentDO); + } //子样判定数据 - BusinessSubSampleAssessmentDO businessSubSampleAssessmentDO = new BusinessSubSampleAssessmentDO(); - businessSubSampleAssessmentDO.setId(IdWorker.getId()); - businessSubSampleAssessmentDO.setBusinessBaseSampleId(businessSubSampleDO.getBusinessBaseSampleId()); - businessSubSampleAssessmentDO.setBusinessSubParentSampleId(businessSubSampleDO.getBusinessSubParentSampleId()); - businessSubSampleAssessmentDO.setBusinessSubSampleId(businessSubSampleDO.getId()); - businessSubSampleAssessmentDO.setBusinessSubParentSampleAssessmentId(businessSubParentSampleAssessmentDO.getId()); - businessSubSampleAssessmentDO.setConfigAssayMethodId(configAssayMethodId); - businessSubSampleAssessmentDO.setAssayType(assayType); - businessSubSampleAssessmentDO.setTaskType("常规"); - - businessSubSampleAssessmentDOList.add(businessSubSampleAssessmentDO); - - //根据检测方法循环 - BusinessAssayTaskDataDO businessAssayTaskDataDO = null; + BusinessSubSampleAssessmentDO businessSubSampleAssessmentDO = businessSubSampleAssessmentDOList.stream().filter(f -> f.getBusinessSubSampleId().equals(businessSubSampleDO.getId()) && f.getConfigAssayMethodId().equals(configAssayMethodId) && f.getAssayType().equals(assayType)).findFirst().orElse(null);//防止重复添加,先从列表过滤 + if (businessSubSampleAssessmentDO == null) { + businessSubSampleAssessmentDO = new BusinessSubSampleAssessmentDO(); + businessSubSampleAssessmentDO.setId(IdWorker.getId()); + businessSubSampleAssessmentDO.setBusinessBaseSampleId(businessSubSampleDO.getBusinessBaseSampleId()); + businessSubSampleAssessmentDO.setBusinessSubParentSampleId(businessSubSampleDO.getBusinessSubParentSampleId()); + businessSubSampleAssessmentDO.setBusinessSubSampleId(businessSubSampleDO.getId()); + businessSubSampleAssessmentDO.setBusinessSubParentSampleAssessmentId(businessSubParentSampleAssessmentDO.getId()); + businessSubSampleAssessmentDO.setConfigAssayMethodId(configAssayMethodId); + businessSubSampleAssessmentDO.setAssayType(assayType); + businessSubSampleAssessmentDO.setTaskType("常规"); + + businessSubSampleAssessmentDOList.add(businessSubSampleAssessmentDO); + } + //根据任务数循环 - for (int i = 0; i < configSubSampleMethodDO.getTaskCount(); i++) { - //子样检测任务 - businessAssayTaskDataDO = new BusinessAssayTaskDataDO(); - businessAssayTaskDataDO.setId(IdWorker.getId()); - businessAssayTaskDataDO.setBusinessBaseSampleId(businessSubSampleDO.getBusinessBaseSampleId()); - businessAssayTaskDataDO.setBusinessSubParentSampleId(businessSubSampleDO.getBusinessSubParentSampleId()); - businessAssayTaskDataDO.setBusinessSubSampleId(businessSubSampleDO.getId()); - businessAssayTaskDataDO.setBusinessSubSampleAssessmentId(businessSubSampleAssessmentDO.getId()); - businessAssayTaskDataDO.setConfigAssayMethodId(configAssayMethodId); - businessAssayTaskDataDO.setAssayType(assayType); - businessAssayTaskDataDO.setTaskType("常规"); - businessAssayTaskDataDO.setConfigSampleFlowId(configSampleFlowSub.getId()); - businessAssayTaskDataDO.setSampleFlowNodeKey(sampleFlowNodeSub.getNodeKey()); - businessAssayTaskDataDO.setSampleFlowNodeTime(currentDateTime); - businessAssayTaskDataDO.setAssayDepartmentId(configAssayMethodDO.getAssayDepartmentId()); - businessAssayTaskDataDO.setAssayDepartmentName(configAssayMethodDO.getAssayDepartmentName()); + for (int i = 0; i < configSubSampleMethodDO.getTaskCount(); i++) { + Long businessSubSampleId = businessSubSampleDO.getId(); + Long businessSubSampleAssessmentId = businessSubSampleAssessmentDO.getId(); + BusinessAssayTaskDataDO businessAssayTaskDataDO = businessAssayTaskDataDOList.stream().filter(f -> { + String assayProject = f.getAssayProject(); + if (StringUtils.isNotBlank(assayProject)) { + List assayProjectList = Arrays.asList(assayProject.split(",")); + return !assayProjectList.containsAll(dictionaryProjectShowNameList) + && configAssayMethodId.equals(f.getConfigAssayMethodId()) + && businessSubSampleId.equals(f.getBusinessSubSampleId()) + && businessSubSampleAssessmentId.equals(f.getBusinessSubSampleAssessmentId()) ;//分析项目未完全存在,则返回 + } + return false; + }).findFirst().orElse(null); + if (businessAssayTaskDataDO == null) { + //子样检测任务 + businessAssayTaskDataDO = new BusinessAssayTaskDataDO(); + businessAssayTaskDataDO.setId(IdWorker.getId()); + businessAssayTaskDataDO.setBusinessBaseSampleId(businessSubSampleDO.getBusinessBaseSampleId()); + businessAssayTaskDataDO.setBusinessSubParentSampleId(businessSubSampleDO.getBusinessSubParentSampleId()); + businessAssayTaskDataDO.setBusinessSubSampleId(businessSubSampleDO.getId()); + businessAssayTaskDataDO.setBusinessSubSampleAssessmentId(businessSubSampleAssessmentDO.getId()); + businessAssayTaskDataDO.setConfigAssayMethodId(configAssayMethodId); + businessAssayTaskDataDO.setAssayType(assayType); + businessAssayTaskDataDO.setTaskType("常规"); + businessAssayTaskDataDO.setConfigSampleFlowId(configSampleFlowSub.getId()); + businessAssayTaskDataDO.setSampleFlowNodeKey(sampleFlowNodeSub.getNodeKey()); + businessAssayTaskDataDO.setSampleFlowNodeTime(currentDateTime); + businessAssayTaskDataDO.setAssayDepartmentId(configAssayMethodDO.getAssayDepartmentId()); + businessAssayTaskDataDO.setAssayDepartmentName(configAssayMethodDO.getAssayDepartmentName()); + + //子样检测任务参数 + List configAssayMethodParameterDOList = configAssayMethodParameterList.stream().filter(f -> f.getConfigAssayMethodId().equals(configAssayMethodId)).collect(Collectors.toList()); + BusinessAssayTaskParameterDataDO businessAssayTaskParameterDataDO = null; + for (ConfigAssayMethodParameterDO configAssayMethodParameterDO : configAssayMethodParameterDOList) { + businessAssayTaskParameterDataDO = new BusinessAssayTaskParameterDataDO(); + businessAssayTaskParameterDataDO.setId(IdWorker.getId()); + businessAssayTaskParameterDataDO.setBusinessAssayTaskDataId(businessAssayTaskDataDO.getId()); + businessAssayTaskParameterDataDO.setConfigAssayMethodParameterId(configAssayMethodParameterDO.getId()); + businessAssayTaskParameterDataDO.setDataType(configAssayMethodParameterDO.getDataType()); + businessAssayTaskParameterDataDO.setDecimalPosition(configAssayMethodParameterDO.getDecimalPosition()); + + businessAssayTaskParameterDataDOList.add(businessAssayTaskParameterDataDO); + } + + //子样检测任务添加 + businessAssayTaskDataDOList.add(businessAssayTaskDataDO); + } - List configAssayMethodProjectDOList = configAssayMethodProjectList.stream().filter(f -> f.getConfigAssayMethodId().equals(configAssayMethodId)).collect(Collectors.toList()); + + //子样检测任务检测项目 + List configAssayMethodProjectDOList = configAssayMethodProjectList.stream().filter(f -> f.getConfigAssayMethodId().equals(configAssayMethodId)).collect(Collectors.toList()); - StringBuilder assayProjectBuilder = new StringBuilder(); +// StringBuilder assayProjectBuilder = new StringBuilder(); - for (ConfigAssayMethodProjectDO configAssayMethodProjectDO : configAssayMethodProjectDOList) { + for (ConfigAssayMethodProjectExtendRespVO configAssayMethodProjectDO : configAssayMethodProjectDOList) { //如果当前分析方法的项目不在当前检测项目中,则跳出循环继续 if (!dictionaryProjectIdList.contains(configAssayMethodProjectDO.getDictionaryProjectId())) { continue; } - DictionaryProjectDO dictionaryProject = dictionaryProjectList.stream().filter(f -> f.getId().equals(configAssayMethodProjectDO.getDictionaryProjectId())).findFirst().orElse(null); - assayProjectBuilder.append(dictionaryProject.getShowName()).append(","); +// DictionaryProjectDO dictionaryProject = dictionaryProjectList.stream().filter(f -> f.getId().equals(configAssayMethodProjectDO.getDictionaryProjectId())).findFirst().orElse(null); +// assayProjectBuilder.append(dictionaryProject.getShowName()).append(","); + //检测项目 - BusinessAssayProjectDataDO businessAssayProjectDataDO = new BusinessAssayProjectDataDO(); - businessAssayProjectDataDO.setId(IdWorker.getId()); - businessAssayProjectDataDO.setBusinessAssayTaskDataId(businessAssayTaskDataDO.getId()); - businessAssayProjectDataDO.setConfigAssayMethodProjectId(configAssayMethodProjectDO.getId()); - businessAssayProjectDataDO.setDictionaryProjectId(configAssayMethodProjectDO.getDictionaryProjectId()); - businessAssayProjectDataDO.setDataType(configAssayMethodProjectDO.getDataType()); - businessAssayProjectDataDO.setDecimalPosition(configAssayMethodProjectDO.getDecimalPosition()); - businessAssayProjectDataDO.setUsage(QmsCommonConstant.ASSAY_PROJECT_USAGE_REPORT); - if (isSjEntrust && isAssayAuAg && sort == 0 && !isCreateZhy && sDictionaryProjectId.equals(configAssayMethodProjectDO.getDictionaryProjectId())) {//是商检样品,分析金银,第一个样品,不创建综合样,并且是S值 - businessAssayProjectDataDO.setUsage(QmsCommonConstant.ASSAY_PROJECT_USAGE_INGREDIENT_REPORT); - } + Long businessAssayTaskDataId = businessAssayTaskDataDO.getId(); + BusinessAssayProjectDataDO businessAssayProjectDataDO = businessAssayProjectDataDOList.stream().filter(f -> f.getBusinessAssayTaskDataId().equals(businessAssayTaskDataId) && f.getDictionaryProjectId().equals(configAssayMethodProjectDO.getDictionaryProjectId())).findFirst().orElse(null); + if (businessAssayProjectDataDO == null) { + businessAssayProjectDataDO = new BusinessAssayProjectDataDO(); + businessAssayProjectDataDO.setId(IdWorker.getId()); + businessAssayProjectDataDO.setBusinessAssayTaskDataId(businessAssayTaskDataDO.getId()); + businessAssayProjectDataDO.setConfigAssayMethodProjectId(configAssayMethodProjectDO.getId()); + businessAssayProjectDataDO.setDictionaryProjectId(configAssayMethodProjectDO.getDictionaryProjectId()); + businessAssayProjectDataDO.setDataType(configAssayMethodProjectDO.getDataType()); + businessAssayProjectDataDO.setDecimalPosition(configAssayMethodProjectDO.getDecimalPosition()); + businessAssayProjectDataDO.setUsage(QmsCommonConstant.ASSAY_PROJECT_USAGE_REPORT); - businessAssayProjectDataDO.setMinimumLimitValue(configAssayMethodProjectDO.getMinimumLimitValue()); - businessAssayProjectDataDO.setIsEnabled(1); - businessAssayProjectDataDO.setIsNotAssessment(0); - - businessAssayProjectDataDOList.add(businessAssayProjectDataDO); - - List configAssayMethodProjectParameterDOList = configAssayMethodProjectParameterList.stream().filter(f -> f.getConfigAssayMethodProjectId().equals(configAssayMethodProjectDO.getId())).collect(Collectors.toList()); - for (ConfigAssayMethodProjectParameterDO configAssayMethodProjectParameterDO : configAssayMethodProjectParameterDOList) { - BusinessAssayParameterDataDO businessAssayParameterDataDO = new BusinessAssayParameterDataDO(); - businessAssayParameterDataDO.setId(IdWorker.getId()); - businessAssayParameterDataDO.setConfigAssayMethodProjectParameterId(configAssayMethodProjectParameterDO.getId()); - businessAssayParameterDataDO.setBusinessAssayProjectDataId(businessAssayProjectDataDO.getId()); - businessAssayParameterDataDO.setDictionaryParameterId(configAssayMethodProjectParameterDO.getDictionaryParameterId()); - businessAssayParameterDataDO.setDataType(configAssayMethodProjectParameterDO.getDataType()); - businessAssayParameterDataDO.setDecimalPosition(configAssayMethodProjectParameterDO.getDecimalPosition()); + businessAssayProjectDataDO.setMinimumLimitValue(configAssayMethodProjectDO.getMinimumLimitValue()); + businessAssayProjectDataDO.setIsEnabled(1); + businessAssayProjectDataDO.setIsNotAssessment(0); + businessAssayProjectDataDOList.add(businessAssayProjectDataDO); - businessAssayParameterDataDOList.add(businessAssayParameterDataDO); + List configAssayMethodProjectParameterDOList = configAssayMethodProjectParameterList.stream().filter(f -> f.getConfigAssayMethodProjectId().equals(configAssayMethodProjectDO.getId())).collect(Collectors.toList()); + for (ConfigAssayMethodProjectParameterDO configAssayMethodProjectParameterDO : configAssayMethodProjectParameterDOList) { + BusinessAssayParameterDataDO businessAssayParameterDataDO = new BusinessAssayParameterDataDO(); + businessAssayParameterDataDO.setId(IdWorker.getId()); + businessAssayParameterDataDO.setConfigAssayMethodProjectParameterId(configAssayMethodProjectParameterDO.getId()); + businessAssayParameterDataDO.setBusinessAssayProjectDataId(businessAssayProjectDataDO.getId()); + businessAssayParameterDataDO.setDictionaryParameterId(configAssayMethodProjectParameterDO.getDictionaryParameterId()); + businessAssayParameterDataDO.setDataType(configAssayMethodProjectParameterDO.getDataType()); + businessAssayParameterDataDO.setDecimalPosition(configAssayMethodProjectParameterDO.getDecimalPosition()); + + + businessAssayParameterDataDOList.add(businessAssayParameterDataDO); + } + } else { + if (QmsCommonConstant.ASSAY_PROJECT_USAGE_INGREDIENT.equals(businessAssayProjectDataDO.getUsage())) { + businessAssayProjectDataDO.setUsage(QmsCommonConstant.ASSAY_PROJECT_USAGE_INGREDIENT_REPORT); + } + + List configAssayMethodProjectParameterDOList = configAssayMethodProjectParameterList.stream().filter(f -> f.getConfigAssayMethodProjectId().equals(configAssayMethodProjectDO.getId())).collect(Collectors.toList()); + for (ConfigAssayMethodProjectParameterDO configAssayMethodProjectParameterDO : configAssayMethodProjectParameterDOList) { + BusinessAssayParameterDataDO businessAssayParameterDataDO = new BusinessAssayParameterDataDO(); + businessAssayParameterDataDO.setId(IdWorker.getId()); + businessAssayParameterDataDO.setConfigAssayMethodProjectParameterId(configAssayMethodProjectParameterDO.getId()); + businessAssayParameterDataDO.setBusinessAssayProjectDataId(businessAssayProjectDataDO.getId()); + businessAssayParameterDataDO.setDictionaryParameterId(configAssayMethodProjectParameterDO.getDictionaryParameterId()); + businessAssayParameterDataDO.setDataType(configAssayMethodProjectParameterDO.getDataType()); + businessAssayParameterDataDO.setDecimalPosition(configAssayMethodProjectParameterDO.getDecimalPosition()); + + + businessAssayParameterDataDOList.add(businessAssayParameterDataDO); + } } } - - assayProjectBuilder.delete(assayProjectBuilder.length() - 1 , assayProjectBuilder.length()); - businessAssayTaskDataDO.setAssayProject(assayProjectBuilder.toString()); - businessAssayTaskDataDOList.add(businessAssayTaskDataDO); + +// if (assayProjectBuilder.length() > 1) { +// assayProjectBuilder.delete(assayProjectBuilder.length() - 1 , assayProjectBuilder.length()); +// } +// businessAssayTaskDataDO.setAssayProject(assayProjectBuilder.toString()); + + Long currentBusinessAssayTaskDataId = businessAssayTaskDataDO.getId(); + List currentDictionaryProjectIdList = businessAssayProjectDataDOList.stream().filter(f -> f.getBusinessAssayTaskDataId().equals(currentBusinessAssayTaskDataId)).map(m -> m.getDictionaryProjectId()).collect(Collectors.toList()); + List currentDictionaryProjectShowNameList = dictionaryProjectList.stream().filter(f -> currentDictionaryProjectIdList.contains(f.getId())).map(m -> m.getShowName()).collect(Collectors.toList()); + businessAssayTaskDataDO.setAssayProject(CollUtil.join(currentDictionaryProjectShowNameList, ",")); } } - - //判定是商检 分析金银 需要创建综合样,样品为第1个 - if (isSjEntrust && isAssayAuAg && sort == 0 && isCreateZhy && configAssayMethodZhy != null) { - Long configAssayMethodIdZhy = configAssayMethodZhy.getId(); - Long assayDepartmentIdZhy = configAssayMethodZhy.getAssayDepartmentId(); - - //查询子样对应的分析方法 - ConfigSubSampleMethodDO configSubSampleMethodDO = configSubSampleMethodList.stream().filter(f -> f.getIsDefaultUse().equals(QmsCommonConstant.YES) && f.getConfigAssayMethodId().equals(configAssayMethodIdZhy) && f.getConfigSubSampleId().equals(configSubSample.getId())).findFirst().orElse(null); - - businessSubSampleAnalysisGroupDO = businessSubSampleAnalysisGroupDOList.stream().filter(f -> f.getBusinessSubSampleId().equals(businessSubSampleDO.getId()) && f.getAssayDepartmentId().equals(assayDepartmentIdZhy)).findFirst().orElse(null); - if (businessSubSampleAnalysisGroupDO == null) { - businessSubSampleAnalysisGroupDO = new BusinessSubSampleAnalysisGroupDO(); - businessSubSampleAnalysisGroupDO.setId(IdWorker.getId()); - businessSubSampleAnalysisGroupDO.setBusinessBaseSampleId(businessSubSampleDO.getBusinessBaseSampleId()); - businessSubSampleAnalysisGroupDO.setBusinessSubParentSampleId(businessSubSampleDO.getBusinessSubParentSampleId()); - businessSubSampleAnalysisGroupDO.setBusinessSubSampleId(businessSubSampleDO.getId()); - businessSubSampleAnalysisGroupDO.setAssayDepartmentId(configAssayMethodZhy.getAssayDepartmentId()); - businessSubSampleAnalysisGroupDO.setAssayDepartmentName(configAssayMethodZhy.getAssayDepartmentName()); - businessSubSampleAnalysisGroupDO.setSampleStatus("待收样"); - - businessSubSampleAnalysisGroupDOList.add(businessSubSampleAnalysisGroupDO); - } - - //根据任务数判断是平行还是 - String assayType = configSubSampleMethodDO.getTaskCount() > 1 ? QmsCommonConstant.ASSAY_TYPE_SINGLE_PARALLEL : QmsCommonConstant.ASSAY_TYPE_SINGLE_CUP; - - //分样判定数据 - BusinessSubParentSampleAssessmentDO businessSubParentSampleAssessmentDO = new BusinessSubParentSampleAssessmentDO(); - businessSubParentSampleAssessmentDO.setId(IdWorker.getId()); - businessSubParentSampleAssessmentDO.setBusinessSubParentSampleId(businessSubSampleDO.getBusinessSubParentSampleId()); - businessSubParentSampleAssessmentDO.setConfigAssayMethodId(configAssayMethodZhy.getId()); - businessSubParentSampleAssessmentDO.setAssayType(assayType); - businessSubParentSampleAssessmentDO.setTaskType("常规"); - businessSubParentSampleAssessmentDOList.add(businessSubParentSampleAssessmentDO); - - //子样判定数据 - BusinessSubSampleAssessmentDO businessSubSampleAssessmentDO = new BusinessSubSampleAssessmentDO(); - businessSubSampleAssessmentDO.setId(IdWorker.getId()); - businessSubSampleAssessmentDO.setBusinessBaseSampleId(businessSubSampleDO.getBusinessBaseSampleId()); - businessSubSampleAssessmentDO.setBusinessSubParentSampleId(businessSubSampleDO.getBusinessSubParentSampleId()); - businessSubSampleAssessmentDO.setBusinessSubParentSampleAssessmentId(businessSubParentSampleAssessmentDO.getId()); - businessSubSampleAssessmentDO.setBusinessSubSampleId(businessSubSampleDO.getId()); - businessSubSampleAssessmentDO.setConfigAssayMethodId(configAssayMethodZhy.getId()); - businessSubSampleAssessmentDO.setAssayType(assayType); - businessSubSampleAssessmentDO.setTaskType("常规"); - - businessSubSampleAssessmentDOList.add(businessSubSampleAssessmentDO); - - //根据检测方法循环 - BusinessAssayTaskDataDO businessAssayTaskDataDO = null; - //根据任务数循环 - for (int i = 0; i < configSubSampleMethodDO.getTaskCount(); i++) { - //子样检测任务 - businessAssayTaskDataDO = new BusinessAssayTaskDataDO(); - businessAssayTaskDataDO.setId(IdWorker.getId()); - businessAssayTaskDataDO.setBusinessBaseSampleId(businessSubSampleDO.getBusinessBaseSampleId()); - businessAssayTaskDataDO.setBusinessSubParentSampleId(businessSubSampleDO.getBusinessSubParentSampleId()); - businessAssayTaskDataDO.setBusinessSubSampleId(businessSubSampleDO.getId()); - businessAssayTaskDataDO.setBusinessSubSampleAssessmentId(businessSubSampleAssessmentDO.getId());//子样判定id - businessAssayTaskDataDO.setConfigAssayMethodId(configAssayMethodZhy.getId()); - businessAssayTaskDataDO.setAssayType(assayType); - businessAssayTaskDataDO.setTaskType("常规"); - businessAssayTaskDataDO.setConfigSampleFlowId(configSampleFlowSub.getId()); - businessAssayTaskDataDO.setSampleFlowNodeKey(sampleFlowNodeSub.getNodeKey()); - businessAssayTaskDataDO.setSampleFlowNodeTime(currentDateTime); - businessAssayTaskDataDO.setAssayDepartmentId(configAssayMethodZhy.getAssayDepartmentId()); - businessAssayTaskDataDO.setAssayDepartmentName(configAssayMethodZhy.getAssayDepartmentName()); - - - //查询S检测项目 - ConfigAssayMethodProjectDO configAssayMethodProjectDO = configAssayMethodProjectList.stream().filter(f -> f.getConfigAssayMethodId().equals(configAssayMethodIdZhy) && f.getDictionaryProjectId().equals(sDictionaryProjectId)).findFirst().orElse(null); - - - - //检测项目 - BusinessAssayProjectDataDO businessAssayProjectDataDO = new BusinessAssayProjectDataDO(); - businessAssayProjectDataDO.setId(IdWorker.getId()); - businessAssayProjectDataDO.setBusinessAssayTaskDataId(businessAssayTaskDataDO.getId()); - businessAssayProjectDataDO.setConfigAssayMethodProjectId(configAssayMethodProjectDO.getId()); - businessAssayProjectDataDO.setDictionaryProjectId(configAssayMethodProjectDO.getDictionaryProjectId()); - businessAssayProjectDataDO.setDataType(configAssayMethodProjectDO.getDataType()); - businessAssayProjectDataDO.setDecimalPosition(configAssayMethodProjectDO.getDecimalPosition()); - businessAssayProjectDataDO.setUsage(QmsCommonConstant.ASSAY_PROJECT_USAGE_INGREDIENT); - businessAssayProjectDataDO.setMinimumLimitValue(configAssayMethodProjectDO.getMinimumLimitValue()); - businessAssayProjectDataDO.setIsEnabled(1); - businessAssayProjectDataDO.setIsNotAssessment(0); - - businessAssayProjectDataDOList.add(businessAssayProjectDataDO); - - List configAssayMethodProjectParameterDOList = configAssayMethodProjectParameterList.stream().filter(f -> f.getConfigAssayMethodProjectId().equals(configAssayMethodProjectDO.getId())).collect(Collectors.toList()); - for (ConfigAssayMethodProjectParameterDO configAssayMethodProjectParameterDO : configAssayMethodProjectParameterDOList) { - BusinessAssayParameterDataDO businessAssayParameterDataDO = new BusinessAssayParameterDataDO(); - businessAssayParameterDataDO.setId(IdWorker.getId()); - businessAssayParameterDataDO.setConfigAssayMethodProjectParameterId(configAssayMethodProjectParameterDO.getId()); - businessAssayParameterDataDO.setBusinessAssayProjectDataId(businessAssayProjectDataDO.getId()); - businessAssayParameterDataDO.setDictionaryParameterId(configAssayMethodProjectParameterDO.getDictionaryParameterId()); - businessAssayParameterDataDO.setDataType(configAssayMethodProjectParameterDO.getDataType()); - businessAssayParameterDataDO.setDecimalPosition(configAssayMethodProjectParameterDO.getDecimalPosition()); - - - businessAssayParameterDataDOList.add(businessAssayParameterDataDO); - } - - businessAssayTaskDataDO.setAssayProject("S"); - businessAssayTaskDataDOList.add(businessAssayTaskDataDO); - } - } - sort++; } sampleEntrustRegistration.setRegistrationStatus(QmsCommonConstant.SUBMITTED); + sampleEntrustRegistration.setAssayStatus(QmsCommonConstant.UNCHECKED); + sampleEntrustRegistration.setDataStatus(QmsCommonConstant.UNRETURNED); + sampleEntrustRegistration.setTaskQuantity(businessAssayTaskDataDOList.size()); sampleEntrustContext.setSampleFlowInfoList(sampleFlowInfoList); @@ -699,7 +715,10 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent { } if (CollUtil.isNotEmpty(businessAssayTaskDataDOList)) { businessAssayTaskDataMapper.insertBatch(businessAssayTaskDataDOList); - } + } + if (CollUtil.isNotEmpty(businessAssayTaskParameterDataDOList)) { + businessAssayTaskParameterDataMapper.insertBatch(businessAssayTaskParameterDataDOList); + } if (CollUtil.isNotEmpty(businessAssayProjectDataDOList)) { businessAssayProjectDataMapper.insertBatch(businessAssayProjectDataDOList); } @@ -711,4 +730,207 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent { } } + private void addAssayTask(LocalDateTime currentDateTime, List configSubSampleMethodList, + List configAssayMethodProjectList, + List configAssayMethodProjectParameterList, + List dictionaryProjectList, + List businessSubParentSampleAssessmentDOList, + List businessSubSampleAnalysisGroupDOList, + List businessSubSampleAssessmentDOList, + List businessAssayTaskDataDOList, + List businessAssayProjectDataDOList, + List businessAssayParameterDataDOList, ConfigSubSampleDO configSubSample, + ConfigSampleFlowDO configSampleFlowSub, SampleFlowNode sampleFlowNodeSub, + BusinessSubSampleDO businessSubSampleDO, Long methodId, List projectIdList, + List configAssayMethodParameterList, + List businessAssayTaskParameterDataDOList) { + BusinessSubSampleAnalysisGroupDO businessSubSampleAnalysisGroupDO; + ConfigAssayMethodDO addAssayTaskConfigAssayMethod = configAssayMethodMapper.selectById(methodId); + Long addAssayTaskAssayDepartmentId = addAssayTaskConfigAssayMethod.getAssayDepartmentId(); + + //获取当前分析方法对应的检测项目显示名称 + List dictionaryProjectShowNameList = dictionaryProjectList.stream().filter(f -> projectIdList.contains(f.getId())).map(m -> m.getShowName()).collect(Collectors.toList()); + + //查询子样对应的分析方法 + ConfigSubSampleMethodExtendRespVO addAssayTaskConfigSubSampleMethodDO = configSubSampleMethodList.stream().filter(f -> f.getIsDefaultUse().equals(QmsCommonConstant.YES) && f.getConfigAssayMethodId().equals(methodId) && f.getConfigSubSampleId().equals(configSubSample.getId())).findFirst().orElse(null); + + businessSubSampleAnalysisGroupDO = businessSubSampleAnalysisGroupDOList.stream().filter(f -> f.getBusinessSubSampleId().equals(businessSubSampleDO.getId()) && f.getAssayDepartmentId().equals(addAssayTaskAssayDepartmentId)).findFirst().orElse(null); + if (businessSubSampleAnalysisGroupDO == null) { + businessSubSampleAnalysisGroupDO = new BusinessSubSampleAnalysisGroupDO(); + businessSubSampleAnalysisGroupDO.setId(IdWorker.getId()); + businessSubSampleAnalysisGroupDO.setBusinessBaseSampleId(businessSubSampleDO.getBusinessBaseSampleId()); + businessSubSampleAnalysisGroupDO.setBusinessSubParentSampleId(businessSubSampleDO.getBusinessSubParentSampleId()); + businessSubSampleAnalysisGroupDO.setBusinessSubSampleId(businessSubSampleDO.getId()); + businessSubSampleAnalysisGroupDO.setAssayDepartmentId(addAssayTaskConfigAssayMethod.getAssayDepartmentId()); + businessSubSampleAnalysisGroupDO.setAssayDepartmentName(addAssayTaskConfigAssayMethod.getAssayDepartmentName()); + businessSubSampleAnalysisGroupDO.setSampleStatus("待收样"); + + businessSubSampleAnalysisGroupDOList.add(businessSubSampleAnalysisGroupDO); + } + + //根据任务数判断是平行还是 + String assayType = addAssayTaskConfigSubSampleMethodDO.getTaskCount() > 1 ? QmsCommonConstant.ASSAY_TYPE_SINGLE_PARALLEL : QmsCommonConstant.ASSAY_TYPE_SINGLE_CUP; + + //分样判定数据 + BusinessSubParentSampleAssessmentDO businessSubParentSampleAssessmentDO = businessSubParentSampleAssessmentDOList.stream().filter(f -> f.getBusinessSubParentSampleId().equals(businessSubSampleDO.getBusinessSubParentSampleId()) && f.getConfigAssayMethodId().equals(addAssayTaskConfigAssayMethod.getId()) && f.getAssayType().equals(assayType)).findFirst().orElse(null);//防止重复添加,先从列表过滤 + if (businessSubParentSampleAssessmentDO == null) { + businessSubParentSampleAssessmentDO = new BusinessSubParentSampleAssessmentDO(); + businessSubParentSampleAssessmentDO.setId(IdWorker.getId()); + businessSubParentSampleAssessmentDO.setBusinessSubParentSampleId(businessSubSampleDO.getBusinessSubParentSampleId()); + businessSubParentSampleAssessmentDO.setConfigAssayMethodId(addAssayTaskConfigAssayMethod.getId()); + businessSubParentSampleAssessmentDO.setAssayType(assayType); + businessSubParentSampleAssessmentDO.setTaskType("常规"); + businessSubParentSampleAssessmentDOList.add(businessSubParentSampleAssessmentDO); + + } + + //子样判定数据 + BusinessSubSampleAssessmentDO businessSubSampleAssessmentDO = businessSubSampleAssessmentDOList.stream().filter(f -> f.getBusinessSubSampleId().equals(businessSubSampleDO.getId()) && f.getConfigAssayMethodId().equals(addAssayTaskConfigAssayMethod.getId()) && f.getAssayType().equals(assayType)).findFirst().orElse(null);//防止重复添加,先从列表过滤 + if (businessSubSampleAssessmentDO == null) { + businessSubSampleAssessmentDO = new BusinessSubSampleAssessmentDO(); + businessSubSampleAssessmentDO.setId(IdWorker.getId()); + businessSubSampleAssessmentDO.setBusinessBaseSampleId(businessSubSampleDO.getBusinessBaseSampleId()); + businessSubSampleAssessmentDO.setBusinessSubParentSampleId(businessSubSampleDO.getBusinessSubParentSampleId()); + businessSubSampleAssessmentDO.setBusinessSubParentSampleAssessmentId(businessSubParentSampleAssessmentDO.getId()); + businessSubSampleAssessmentDO.setBusinessSubSampleId(businessSubSampleDO.getId()); + businessSubSampleAssessmentDO.setConfigAssayMethodId(addAssayTaskConfigAssayMethod.getId()); + businessSubSampleAssessmentDO.setAssayType(assayType); + businessSubSampleAssessmentDO.setTaskType("常规"); + + businessSubSampleAssessmentDOList.add(businessSubSampleAssessmentDO); + } + + //根据任务数循环 + for (int i = 0; i < addAssayTaskConfigSubSampleMethodDO.getTaskCount(); i++) { + + //根据检测方法循环 + Long businessSubSampleId = businessSubSampleDO.getId(); + Long businessSubSampleAssessmentId = businessSubSampleAssessmentDO.getId(); + BusinessAssayTaskDataDO businessAssayTaskDataDO = businessAssayTaskDataDOList.stream().filter(f -> { + String assayProject = f.getAssayProject(); + if (StringUtils.isNotBlank(assayProject)) { + List assayProjectList = Arrays.asList(assayProject.split(",")); + return !assayProjectList.containsAll(dictionaryProjectShowNameList) + && addAssayTaskConfigAssayMethod.getId().equals(f.getConfigAssayMethodId()) + && businessSubSampleId.equals(f.getBusinessSubSampleId()) + && businessSubSampleAssessmentId.equals(f.getBusinessSubSampleAssessmentId()) ;//分析项目未完全存在,则返回 + } + return false; + }).findFirst().orElse(null); + + if (businessAssayTaskDataDO == null) { + //子样检测任务 + businessAssayTaskDataDO = new BusinessAssayTaskDataDO(); + businessAssayTaskDataDO.setId(IdWorker.getId()); + businessAssayTaskDataDO.setBusinessBaseSampleId(businessSubSampleDO.getBusinessBaseSampleId()); + businessAssayTaskDataDO.setBusinessSubParentSampleId(businessSubSampleDO.getBusinessSubParentSampleId()); + businessAssayTaskDataDO.setBusinessSubSampleId(businessSubSampleDO.getId()); + businessAssayTaskDataDO.setBusinessSubSampleAssessmentId(businessSubSampleAssessmentDO.getId());//子样判定id + businessAssayTaskDataDO.setConfigAssayMethodId(addAssayTaskConfigAssayMethod.getId()); + businessAssayTaskDataDO.setAssayType(assayType); + businessAssayTaskDataDO.setTaskType("常规"); + businessAssayTaskDataDO.setConfigSampleFlowId(configSampleFlowSub.getId()); + businessAssayTaskDataDO.setSampleFlowNodeKey(sampleFlowNodeSub.getNodeKey()); + businessAssayTaskDataDO.setSampleFlowNodeTime(currentDateTime); + businessAssayTaskDataDO.setAssayDepartmentId(addAssayTaskConfigAssayMethod.getAssayDepartmentId()); + businessAssayTaskDataDO.setAssayDepartmentName(addAssayTaskConfigAssayMethod.getAssayDepartmentName()); + + + //子样检测任务参数 + List configAssayMethodParameterDOList = configAssayMethodParameterList.stream().filter(f -> f.getConfigAssayMethodId().equals(methodId)).collect(Collectors.toList()); + BusinessAssayTaskParameterDataDO businessAssayTaskParameterDataDO = null; + for (ConfigAssayMethodParameterDO configAssayMethodParameterDO : configAssayMethodParameterDOList) { + businessAssayTaskParameterDataDO = new BusinessAssayTaskParameterDataDO(); + businessAssayTaskParameterDataDO.setId(IdWorker.getId()); + businessAssayTaskParameterDataDO.setBusinessAssayTaskDataId(businessAssayTaskDataDO.getId()); + businessAssayTaskParameterDataDO.setConfigAssayMethodParameterId(configAssayMethodParameterDO.getId()); + businessAssayTaskParameterDataDO.setDataType(configAssayMethodParameterDO.getDataType()); + businessAssayTaskParameterDataDO.setDecimalPosition(configAssayMethodParameterDO.getDecimalPosition()); + + businessAssayTaskParameterDataDOList.add(businessAssayTaskParameterDataDO); + } + + + businessAssayTaskDataDOList.add(businessAssayTaskDataDO); + } + + + //子样检测任务检测项目 + List configAssayMethodProjectDOList = configAssayMethodProjectList.stream().filter(f -> f.getConfigAssayMethodId().equals(methodId)).collect(Collectors.toList()); + +// StringBuilder assayProjectBuilder = new StringBuilder(); + + for (ConfigAssayMethodProjectExtendRespVO configAssayMethodProjectDO : configAssayMethodProjectDOList) { + + //如果当前分析方法的项目不在当前检测项目中,则跳出循环继续 + if (!projectIdList.contains(configAssayMethodProjectDO.getDictionaryProjectId())) { + continue; + } + +// DictionaryProjectDO dictionaryProject = dictionaryProjectList.stream().filter(f -> f.getId().equals(configAssayMethodProjectDO.getDictionaryProjectId())).findFirst().orElse(null); +// assayProjectBuilder.append(dictionaryProject.getShowName()).append(","); + + + //检测项目 + Long businessAssayTaskDataId = businessAssayTaskDataDO.getId(); + BusinessAssayProjectDataDO businessAssayProjectDataDO = businessAssayProjectDataDOList.stream().filter(f -> f.getBusinessAssayTaskDataId().equals(businessAssayTaskDataId) && f.getDictionaryProjectId().equals(configAssayMethodProjectDO.getDictionaryProjectId())).findFirst().orElse(null); + if (businessAssayProjectDataDO == null) { + businessAssayProjectDataDO = new BusinessAssayProjectDataDO(); + businessAssayProjectDataDO.setId(IdWorker.getId()); + businessAssayProjectDataDO.setBusinessAssayTaskDataId(businessAssayTaskDataDO.getId()); + businessAssayProjectDataDO.setConfigAssayMethodProjectId(configAssayMethodProjectDO.getId()); + businessAssayProjectDataDO.setDictionaryProjectId(configAssayMethodProjectDO.getDictionaryProjectId()); + businessAssayProjectDataDO.setDataType(configAssayMethodProjectDO.getDataType()); + businessAssayProjectDataDO.setDecimalPosition(configAssayMethodProjectDO.getDecimalPosition()); + businessAssayProjectDataDO.setUsage(QmsCommonConstant.ASSAY_PROJECT_USAGE_INGREDIENT); + + businessAssayProjectDataDO.setMinimumLimitValue(configAssayMethodProjectDO.getMinimumLimitValue()); + businessAssayProjectDataDO.setIsEnabled(1); + businessAssayProjectDataDO.setIsNotAssessment(0); + + businessAssayProjectDataDOList.add(businessAssayProjectDataDO); + + List configAssayMethodProjectParameterDOList = configAssayMethodProjectParameterList.stream().filter(f -> f.getConfigAssayMethodProjectId().equals(configAssayMethodProjectDO.getId())).collect(Collectors.toList()); + for (ConfigAssayMethodProjectParameterDO configAssayMethodProjectParameterDO : configAssayMethodProjectParameterDOList) { + BusinessAssayParameterDataDO businessAssayParameterDataDO = new BusinessAssayParameterDataDO(); + businessAssayParameterDataDO.setId(IdWorker.getId()); + businessAssayParameterDataDO.setConfigAssayMethodProjectParameterId(configAssayMethodProjectParameterDO.getId()); + businessAssayParameterDataDO.setBusinessAssayProjectDataId(businessAssayProjectDataDO.getId()); + businessAssayParameterDataDO.setDictionaryParameterId(configAssayMethodProjectParameterDO.getDictionaryParameterId()); + businessAssayParameterDataDO.setDataType(configAssayMethodProjectParameterDO.getDataType()); + businessAssayParameterDataDO.setDecimalPosition(configAssayMethodProjectParameterDO.getDecimalPosition()); + + + businessAssayParameterDataDOList.add(businessAssayParameterDataDO); + } + } else { + if (QmsCommonConstant.ASSAY_PROJECT_USAGE_REPORT.equals(businessAssayProjectDataDO.getUsage())) { + businessAssayProjectDataDO.setUsage(QmsCommonConstant.ASSAY_PROJECT_USAGE_INGREDIENT_REPORT); + } + + List configAssayMethodProjectParameterDOList = configAssayMethodProjectParameterList.stream().filter(f -> f.getConfigAssayMethodProjectId().equals(configAssayMethodProjectDO.getId())).collect(Collectors.toList()); + for (ConfigAssayMethodProjectParameterDO configAssayMethodProjectParameterDO : configAssayMethodProjectParameterDOList) { + BusinessAssayParameterDataDO businessAssayParameterDataDO = new BusinessAssayParameterDataDO(); + businessAssayParameterDataDO.setId(IdWorker.getId()); + businessAssayParameterDataDO.setConfigAssayMethodProjectParameterId(configAssayMethodProjectParameterDO.getId()); + businessAssayParameterDataDO.setBusinessAssayProjectDataId(businessAssayProjectDataDO.getId()); + businessAssayParameterDataDO.setDictionaryParameterId(configAssayMethodProjectParameterDO.getDictionaryParameterId()); + businessAssayParameterDataDO.setDataType(configAssayMethodProjectParameterDO.getDataType()); + businessAssayParameterDataDO.setDecimalPosition(configAssayMethodProjectParameterDO.getDecimalPosition()); + + + businessAssayParameterDataDOList.add(businessAssayParameterDataDO); + } + } + } +// if (assayProjectBuilder.length() > 1) { +// assayProjectBuilder.delete(assayProjectBuilder.length() - 1 , assayProjectBuilder.length()); +// } + Long currentBusinessAssayTaskDataId = businessAssayTaskDataDO.getId(); + List currentDictionaryProjectIdList = businessAssayProjectDataDOList.stream().filter(f -> f.getBusinessAssayTaskDataId().equals(currentBusinessAssayTaskDataId)).map(m -> m.getDictionaryProjectId()).collect(Collectors.toList()); + List currentDictionaryProjectShowNameList = dictionaryProjectList.stream().filter(f -> currentDictionaryProjectIdList.contains(f.getId())).map(m -> m.getShowName()).collect(Collectors.toList()); + businessAssayTaskDataDO.setAssayProject(CollUtil.join(currentDictionaryProjectShowNameList, ",")); + } + } + } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/flow/SampleSimpleEncryptCmp.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/flow/SampleSimpleEncryptCmp.java index 22451a9..92f18e9 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/flow/SampleSimpleEncryptCmp.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/flow/SampleSimpleEncryptCmp.java @@ -29,6 +29,7 @@ public class SampleSimpleEncryptCmp extends NodeComponent { String simpleCode = sequenceUtil.genCode(simpleCodeRule); businessSubSampleDO.setSampleAssayCode(simpleCode); businessSubSampleDO.setSampleReturnCode(simpleCode); + businessSubSampleDO.setIsGenerateReturnCode(QmsCommonConstant.YES); } } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/flow/SampleSubProcessUpdateCmp.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/flow/SampleSubProcessUpdateCmp.java index c578adf..e5e6e7a 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/flow/SampleSubProcessUpdateCmp.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/flow/SampleSubProcessUpdateCmp.java @@ -2,14 +2,16 @@ package com.zt.plat.module.qms.business.bus.liteflow.sample.flow; import java.math.BigDecimal; import java.time.LocalDateTime; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.stream.Collectors; import org.apache.commons.lang3.StringUtils; import com.alibaba.fastjson2.JSON; -import com.ql.util.express.DefaultContext; -import com.ql.util.express.ExpressRunner; +import com.alibaba.qlexpress4.Express4Runner; +import com.alibaba.qlexpress4.QLOptions; import com.yomahub.liteflow.annotation.LiteflowComponent; import com.yomahub.liteflow.core.NodeComponent; import com.zt.plat.framework.common.exception.ServiceException; @@ -41,7 +43,7 @@ public class SampleSubProcessUpdateCmp extends NodeComponent { // private ConfigSubSampleService configSubSampleService; @Resource - private ExpressRunner expressRunner; + private Express4Runner express4Runner; @Resource private ConfigRuleMapper configRuleMapper; @@ -89,10 +91,10 @@ public class SampleSubProcessUpdateCmp extends NodeComponent { for (SampleFlowNode flowNode : nextFlowNodeList) { ConfigRuleDO conditionRule = configRuleMapper.selectLatestConfigRuleByCode(flowNode.getCondition()); Boolean isMeetCondition = false; - DefaultContext context = new DefaultContext<>(); + Map context = new HashMap<>(); ConfigSubSampleDO configSubSample = sampleFlowContext.getConfigSubSampleById(businessSubSample.getConfigSubSampleId()); Boolean hasSubSimpleCodeRule = configSubSample != null && StringUtils.isNotBlank(configSubSample.getSimpleCodeRule()); - Boolean hasSubSampleEncrypt = businessHandoverRecordSubDOList.stream().anyMatch(m -> QmsCommonConstant.FlOW_NODE_SAMPLE_ENCRYPT.equals(m.getSampleFlowNodeKey())); + Boolean hasSubSampleEncrypt = businessHandoverRecordSubDOList.stream().filter(f -> f.getBusinessSubSampleId().equals(businessSubSample.getId())).anyMatch(m -> QmsCommonConstant.FlOW_NODE_SAMPLE_ENCRYPT.equals(m.getSampleFlowNodeKey())); if (CollUtil.isNotEmpty(businessSubSampleAnalysisGroupDOList)) { List curSubSampleAnalysisGroupDOList = businessSubSampleAnalysisGroupDOList.stream().filter(f -> f.getBusinessSubSampleId().equals(businessSubSample.getId())).collect(Collectors.toList()); @@ -105,7 +107,8 @@ public class SampleSubProcessUpdateCmp extends NodeComponent { context.put("hasSubSimpleCodeRule", hasSubSimpleCodeRule); context.put("hasSubSampleEncrypt", hasSubSampleEncrypt); try { - isMeetCondition = (Boolean) expressRunner.execute(conditionRule.getExpression(), context, null, false, false); +// isMeetCondition = (Boolean) express4Runner.execute(conditionRule.getExpression(), context, null, false, false); + isMeetCondition = (Boolean) express4Runner.execute(conditionRule.getExpression(), context, QLOptions.DEFAULT_OPTIONS).getResult(); } catch (Exception e) { e.printStackTrace(); throw new ServiceException(1_032_100_000, e.getMessage()); @@ -140,6 +143,16 @@ public class SampleSubProcessUpdateCmp extends NodeComponent { } sampleFlowContext.setBusinessSubSampleAnalysisGroupList(curDeptSubSampleAnalysisGroupDOList); } + + //如果是班组送样,需要更新分析班组表 + if (QmsCommonConstant.FLOW_NODE_ANALYSIS_SEND.equals(currentSampleFlowKey)) { + List curDeptSubSampleAnalysisGroupDOList = businessSubSampleAnalysisGroupDOList.stream().filter(f -> f.getAssayDepartmentId().equals(loginUser.getVisitDeptId())).collect(Collectors.toList()); + for (BusinessSubSampleAnalysisGroupDO businessSubSampleAnalysisGroupDO : curDeptSubSampleAnalysisGroupDOList) { + businessSubSampleAnalysisGroupDO.setIsSend(QmsCommonConstant.YES); + } + sampleFlowContext.setBusinessSubSampleAnalysisGroupList(curDeptSubSampleAnalysisGroupDOList); + + } } } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/taskassign/SampleTaskAssignDataSaveOrUpdateCmp.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/taskassign/SampleTaskAssignDataSaveOrUpdateCmp.java index c8a6723..42a47d1 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/taskassign/SampleTaskAssignDataSaveOrUpdateCmp.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/taskassign/SampleTaskAssignDataSaveOrUpdateCmp.java @@ -11,11 +11,17 @@ import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDataD import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDetailDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCCoefficientDataDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCCoefficientParameterDataDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCManagementDataDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCManagementParameterDataDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCManagementProjectDataDO; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayTaskDataMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayTaskDetailMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayTaskMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCCoefficientDataMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCCoefficientParameterDataMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCManagementDataMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCManagementParameterDataMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCManagementProjectDataMapper; import com.zt.plat.module.qms.business.bus.liteflow.slot.SampleTaskAssignContext; import jakarta.annotation.Resource; @@ -36,6 +42,15 @@ public class SampleTaskAssignDataSaveOrUpdateCmp extends NodeComponent { @Resource private BusinessQCCoefficientParameterDataMapper businessQCCoefficientParameterDataMapper; + + @Resource + private BusinessQCManagementDataMapper businessQCManagementDataMapper; + + @Resource + private BusinessQCManagementProjectDataMapper businessQCManagementProjectDataMapper; + + @Resource + private BusinessQCManagementParameterDataMapper businessQCManagementParameterDataMapper; @Override public void process() throws Exception { @@ -53,6 +68,12 @@ public class SampleTaskAssignDataSaveOrUpdateCmp extends NodeComponent { List businessQCCoefficientParameterDataList = sampleTaskAssignContext.getBusinessQCCoefficientParameterDataList(); + List businessQCManagementDataDOList = sampleTaskAssignContext.getBusinessQCManagementDataDOList(); + + List businessQCManagementProjectDataDOList = sampleTaskAssignContext.getBusinessQCManagementProjectDataDOList(); + + List businessQCManagementParameterDataDOList = sampleTaskAssignContext.getBusinessQCManagementParameterDataDOList(); + if (CollUtil.isNotEmpty(savebusinessAssayTaskList)) { this.businessAssayTaskMapper.insertBatch(savebusinessAssayTaskList); } @@ -76,6 +97,18 @@ public class SampleTaskAssignDataSaveOrUpdateCmp extends NodeComponent { if (CollUtil.isNotEmpty(businessQCCoefficientParameterDataList)) { this.businessQCCoefficientParameterDataMapper.insertBatch(businessQCCoefficientParameterDataList); } + + if (CollUtil.isNotEmpty(businessQCManagementDataDOList)) { + this.businessQCManagementDataMapper.insertBatch(businessQCManagementDataDOList); + } + + if (CollUtil.isNotEmpty(businessQCManagementProjectDataDOList)) { + this.businessQCManagementProjectDataMapper.insertBatch(businessQCManagementProjectDataDOList); + } + + if (CollUtil.isNotEmpty(businessQCManagementParameterDataDOList)) { + this.businessQCManagementParameterDataMapper.insertBatch(businessQCManagementParameterDataDOList); + } } } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/taskassign/SampleTaskAssignQCSampleCmp.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/taskassign/SampleTaskAssignQCSampleCmp.java index e19d749..660304c 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/taskassign/SampleTaskAssignQCSampleCmp.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/taskassign/SampleTaskAssignQCSampleCmp.java @@ -8,16 +8,30 @@ import org.apache.commons.lang3.StringUtils; import com.baomidou.mybatisplus.core.toolkit.IdWorker; import com.yomahub.liteflow.annotation.LiteflowComponent; import com.yomahub.liteflow.core.NodeComponent; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayProjectDataExtendRespVO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDataDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCCoefficientDataDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCCoefficientParameterDataDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCManagementDataDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCManagementParameterDataDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCManagementProjectDataDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCManagementSampleParameterDataDO; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayProjectDataMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCCoefficientDataMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCCoefficientParameterDataMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCManagementDataMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCManagementParameterDataMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCManagementProjectDataMapper; import com.zt.plat.module.qms.business.bus.liteflow.slot.SampleTaskAssignContext; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigAssayMethodProjectExtendRespVO; import com.zt.plat.module.qms.business.config.controller.vo.ConfigQCSampleMethodExtendRespVO; import com.zt.plat.module.qms.business.config.controller.vo.ConfigQCSampleMethodParameterExtendRespVO; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodDO; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodParameterDO; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectParameterDO; import com.zt.plat.module.qms.business.config.dal.mapper.ConfigAssayMethodMapper; +import com.zt.plat.module.qms.business.config.dal.mapper.ConfigAssayMethodParameterMapper; import com.zt.plat.module.qms.business.config.dal.mapper.ConfigAssayMethodProjectMapper; import com.zt.plat.module.qms.business.config.dal.mapper.ConfigAssayMethodProjectParameterMapper; import com.zt.plat.module.qms.business.config.dal.mapper.ConfigQCSampleMethodMapper; @@ -37,6 +51,9 @@ public class SampleTaskAssignQCSampleCmp extends NodeComponent { @Resource private ConfigAssayMethodMapper configAssayMethodMapper; + @Resource + private ConfigAssayMethodParameterMapper configAssayMethodParameterMapper; + @Resource private ConfigQCSampleMethodMapper configQCSampleMethodMapper; @@ -48,6 +65,9 @@ public class SampleTaskAssignQCSampleCmp extends NodeComponent { @Resource private ConfigAssayMethodProjectParameterMapper configAssayMethodProjectParameterMapper; + + @Resource + private BusinessAssayProjectDataMapper businessAssayProjectDataMapper; @Resource private BusinessQCCoefficientDataMapper businessQCCoefficientDataMapper; @@ -55,6 +75,15 @@ public class SampleTaskAssignQCSampleCmp extends NodeComponent { @Resource private BusinessQCCoefficientParameterDataMapper businessQCCoefficientParameterDataMapper; + @Resource + private BusinessQCManagementDataMapper businessQCManagementDataMapper; + + @Resource + private BusinessQCManagementProjectDataMapper businessQCManagementProjectDataMapper; + + @Resource + private BusinessQCManagementParameterDataMapper businessQCManagementParameterDataMapper; + @Override public void process() throws Exception { SampleTaskAssignContext sampleTaskAssignContext = this.getContextBean(SampleTaskAssignContext.class); @@ -62,6 +91,11 @@ public class SampleTaskAssignQCSampleCmp extends NodeComponent { List businessQCCoefficientDataDOList = new ArrayList<>(); List businessQCCoefficientParameterDataDOList = new ArrayList<>(); + List businessQCManagementDataDOList = new ArrayList<>(); + List businessQCManagementSampleParameterDataDOList = new ArrayList<>(); + List businessQCManagementProjectDataDOList = new ArrayList<>(); + List businessQCManagementParameterDataDOList = new ArrayList<>(); + //分配任务 List businessAssayTaskList = new ArrayList<>(); //获取需要保存的分配任务 @@ -71,6 +105,9 @@ public class SampleTaskAssignQCSampleCmp extends NodeComponent { businessAssayTaskList.addAll(saveBusinessAssayTaskList); businessAssayTaskList.addAll(updateBusinessAssayTaskList); + //检测任务 + List businessAssayTaskDataList = sampleTaskAssignContext.getBusinessAssayTaskDataList(); + //获取分配任务的分析方法id列表 List configAssayMethodIdList = businessAssayTaskList.stream().map(m -> m.getConfigAssayMethodId()).distinct().collect(Collectors.toList()); @@ -86,63 +123,177 @@ public class SampleTaskAssignQCSampleCmp extends NodeComponent { //循环分配任务 for (BusinessAssayTaskDO businessAssayTaskDO : businessAssayTaskList) { - ConfigQCSampleMethodExtendRespVO configQCSampleMethodExtendRespVO = configQCSampleMethodList.stream().filter(f -> f.getConfigAssayMethodId().equals(businessAssayTaskDO.getConfigAssayMethodId()) && "kby".equals(f.getDictionaryBusinessKey())).findFirst().orElse(null); + ConfigQCSampleMethodExtendRespVO configQCSampleMethodExtendRespVO = configQCSampleMethodList.stream().filter(f -> f.getConfigAssayMethodId().equals(businessAssayTaskDO.getConfigAssayMethodId()) && ("kby".equals(f.getDictionaryBusinessKey()) || "zkkby".equals(f.getDictionaryBusinessKey()))).findFirst().orElse(null); //不存在空白样,直接跳出 if (configQCSampleMethodExtendRespVO == null) { - break; + continue; } ConfigAssayMethodDO configAssayMethodDO = configAssayMethodMapper.selectById(businessAssayTaskDO.getConfigAssayMethodId()); - //查询下质控数据,如果存在则跳出循环 - List businessQCCoefficientDataList = businessQCCoefficientDataMapper.selectByBusinessAssayTaskId(businessAssayTaskDO.getId()); - //如果存在则跳出循环 - if (CollUtil.isNotEmpty(businessQCCoefficientDataList)) { - break; + if ("kby".equals(configQCSampleMethodExtendRespVO.getDictionaryBusinessKey())) { //普通空白样 + + //查询下质控数据,如果存在则跳出循环 + List businessQCCoefficientDataList = businessQCCoefficientDataMapper.selectByBusinessAssayTaskId(businessAssayTaskDO.getId()); + //如果存在则跳出循环 + if (CollUtil.isNotEmpty(businessQCCoefficientDataList)) { + continue; + } + + //根据默认配置的个数生成空白样 + for (int i = 0; i < configQCSampleMethodExtendRespVO.getDefaultCount(); i++) { + + BusinessQCCoefficientDataDO businessQCCoefficientDataDO = new BusinessQCCoefficientDataDO(); + businessQCCoefficientDataDO.setId(IdWorker.getId()); + businessQCCoefficientDataDO.setBusinessAssayTaskId(businessAssayTaskDO.getId()); + businessQCCoefficientDataDO.setConfigAssayMethodId(configQCSampleMethodExtendRespVO.getConfigAssayMethodId()); + businessQCCoefficientDataDO.setSampleName(configQCSampleMethodExtendRespVO.getDictionaryBusinessName()); + if (StringUtils.isNotBlank(configQCSampleMethodExtendRespVO.getCodeRule())) { + String codeSample = sequenceUtil.genCode(configQCSampleMethodExtendRespVO.getCodeRule()); + businessQCCoefficientDataDO.setSampleCode(codeSample); + } + businessQCCoefficientDataDO.setDictionaryBusinessId(configQCSampleMethodExtendRespVO.getDictionaryBusinessId()); + businessQCCoefficientDataDO.setDictionaryBusinessKey(configQCSampleMethodExtendRespVO.getDictionaryBusinessKey()); + businessQCCoefficientDataDO.setAssayDepartmentId(configAssayMethodDO.getAssayDepartmentId()); + businessQCCoefficientDataDO.setAssayDepartmentName(configAssayMethodDO.getAssayDepartmentName()); + businessQCCoefficientDataDO.setAssayOperator(businessAssayTaskDO.getAssayOperator()); + businessQCCoefficientDataDO.setAssayOperatorId(businessAssayTaskDO.getAssayOperatorId()); + businessQCCoefficientDataDO.setAssayProject(""); + businessQCCoefficientDataDO.setAssignTaskTime(businessAssayTaskDO.getTaskAssignTime()); + businessQCCoefficientDataDO.setIsAssignTasked(QmsCommonConstant.YES); + businessQCCoefficientDataDO.setIsReported(QmsCommonConstant.NO); + + businessQCCoefficientDataDOList.add(businessQCCoefficientDataDO); + + List configQCSampleMethodParameterExtendRespVOs = configQcSampleMethodParameterList.stream().filter(f -> f.getConfigQCSampleMethodId().equals(configQCSampleMethodExtendRespVO.getId())).collect(Collectors.toList()); + for (ConfigQCSampleMethodParameterExtendRespVO configQCSampleMethodParameterExtendRespVO : configQCSampleMethodParameterExtendRespVOs) { + BusinessQCCoefficientParameterDataDO businessQCCoefficientParameterDataDO = new BusinessQCCoefficientParameterDataDO(); + businessQCCoefficientParameterDataDO.setBusinessQCCoefficientDataId(businessQCCoefficientDataDO.getId()); + businessQCCoefficientParameterDataDO.setConfigQCSampleMethodParameterId(configQCSampleMethodParameterExtendRespVO.getId()); + businessQCCoefficientParameterDataDO.setDictionaryParameterId(configQCSampleMethodParameterExtendRespVO.getDictionaryParameterId()); + businessQCCoefficientParameterDataDO.setDataType(configQCSampleMethodParameterExtendRespVO.getDataType()); + businessQCCoefficientParameterDataDO.setDecimalPosition(configQCSampleMethodParameterExtendRespVO.getDecimalPosition()); + businessQCCoefficientParameterDataDO.setValue(configQCSampleMethodParameterExtendRespVO.getDefaultValue()); + + businessQCCoefficientParameterDataDOList.add(businessQCCoefficientParameterDataDO); + } + } + + } else if ("zkkby".equals(configQCSampleMethodExtendRespVO.getDictionaryBusinessKey())) {//质控空白样 + //查询质控数据,如果存在则跳出循环 + List businessQCManagementDataList = businessQCManagementDataMapper.selectByBusinessAssayTaskId(businessAssayTaskDO.getId()); + if (CollUtil.isNotEmpty(businessQCManagementDataList)) { + continue; + } + //分析项目 + List configAssayMethodProjectExtendRespList = configAssayMethodProjectMapper.selectByConfigAssayMethodId(businessAssayTaskDO.getConfigAssayMethodId()); + + List businessAssayTaskDataIdList = businessAssayTaskDataList.stream().filter(f -> f.getBusinessAssayTaskId().equals(businessAssayTaskDO.getId())).map(m -> m.getId()).collect(Collectors.toList()); + List businessAssayProjectDataList = businessAssayProjectDataMapper.selectByBusinessAssayTaskDataIds(businessAssayTaskDataIdList); + //检测项目id + List dictionaryProjectIdList = new ArrayList<>(); + //必须要检测的项目 + String mustProject = configQCSampleMethodExtendRespVO.getMustProject(); + if (StringUtils.isNotBlank(mustProject)) { + String[] mustProjects = mustProject.split(","); + for (String dicProjectId : mustProjects) { + dictionaryProjectIdList.add(Long.parseLong(dicProjectId)); + } + } + + //获取当前任务的检测项目id列表 + List busTaskDictionaryProjectIdList = businessAssayProjectDataList.stream().map(m -> m.getDictionaryProjectId()).distinct().collect(Collectors.toList()); + dictionaryProjectIdList.addAll(busTaskDictionaryProjectIdList); + //获取需要创建的检测项目id + List configAssayMethodProjectIds = configAssayMethodProjectExtendRespList.stream().filter(f -> dictionaryProjectIdList.contains(f.getDictionaryProjectId())).map(m -> m.getId()).collect(Collectors.toList()); + + //分析项目参数 + List configAssayMethodProjectParameterList = configAssayMethodProjectParameterMapper.selectByConfigAssayMethodProjectIds(configAssayMethodProjectIds); + //分析项目 + String assayProject = configAssayMethodProjectExtendRespList.stream().map(m -> m.getShowName()).collect(Collectors.joining(",")); + + + //分析方法参数配置 + List configAssayMethodParameterDOList = configAssayMethodParameterMapper.selectByConfigAssayMethodId(businessAssayTaskDO.getConfigAssayMethodId()); + + for (int i = 0; i < configQCSampleMethodExtendRespVO.getDefaultCount(); i++) { + + BusinessQCManagementDataDO businessQCManagementDataDO = new BusinessQCManagementDataDO(); + businessQCManagementDataDO.setId(IdWorker.getId()); + businessQCManagementDataDO.setBusinessAssayTaskId(businessAssayTaskDO.getId()); + businessQCManagementDataDO.setConfigAssayMethodId(businessAssayTaskDO.getConfigAssayMethodId()); + businessQCManagementDataDO.setSampleName(configQCSampleMethodExtendRespVO.getDictionaryBusinessName()); + if (StringUtils.isNotBlank(configQCSampleMethodExtendRespVO.getCodeRule())) { + String codeSample = sequenceUtil.genCode(configQCSampleMethodExtendRespVO.getCodeRule()); + businessQCManagementDataDO.setSampleCode(codeSample); + } + businessQCManagementDataDO.setBusinessStandardSampleId(null);//特殊空白样无定值样 + businessQCManagementDataDO.setDictionaryBusinessId(configQCSampleMethodExtendRespVO.getDictionaryBusinessId()); + businessQCManagementDataDO.setDictionaryBusinessKey(configQCSampleMethodExtendRespVO.getDictionaryBusinessKey()); + businessQCManagementDataDO.setAssayDepartmentId(configAssayMethodDO.getAssayDepartmentId()); + businessQCManagementDataDO.setAssayDepartmentName(configAssayMethodDO.getAssayDepartmentName()); + businessQCManagementDataDO.setAssayOperator(businessAssayTaskDO.getAssayOperator()); + businessQCManagementDataDO.setAssayOperatorId(businessAssayTaskDO.getAssayOperatorId()); + businessQCManagementDataDO.setAssayProject(assayProject); + businessQCManagementDataDO.setAssignTaskTime(businessAssayTaskDO.getTaskAssignTime()); + businessQCManagementDataDO.setIsAssignTasked(QmsCommonConstant.YES); + businessQCManagementDataDO.setIsReported(QmsCommonConstant.NO); + + businessQCManagementDataDOList.add(businessQCManagementDataDO); + + BusinessQCManagementSampleParameterDataDO businessQCManagementSampleParameterDataDO = null; + for (ConfigAssayMethodParameterDO configAssayMethodParameterDO : configAssayMethodParameterDOList) { + businessQCManagementSampleParameterDataDO = new BusinessQCManagementSampleParameterDataDO(); + businessQCManagementSampleParameterDataDO.setId(IdWorker.getId()); + businessQCManagementSampleParameterDataDO.setBusinessQCManagementDataId(businessQCManagementDataDO.getId()); + businessQCManagementSampleParameterDataDO.setConfigAssayMethodParameterId(configAssayMethodParameterDO.getId()); + businessQCManagementSampleParameterDataDO.setDataType(configAssayMethodParameterDO.getDataType()); + businessQCManagementSampleParameterDataDO.setDecimalPosition(configAssayMethodParameterDO.getDecimalPosition()); + + businessQCManagementSampleParameterDataDOList.add(businessQCManagementSampleParameterDataDO); + } + + for (ConfigAssayMethodProjectExtendRespVO configAssayMethodProjectExtendRespVO : configAssayMethodProjectExtendRespList) { + if (!dictionaryProjectIdList.contains(configAssayMethodProjectExtendRespVO.getDictionaryProjectId())) {//不存在则跳过 + continue; + } + BusinessQCManagementProjectDataDO businessQCManagementProjectDataDO = new BusinessQCManagementProjectDataDO(); + businessQCManagementProjectDataDO.setId(IdWorker.getId()); + businessQCManagementProjectDataDO.setBusinessQCManagementDataId(businessQCManagementDataDO.getId()); + businessQCManagementProjectDataDO.setConfigAssayMethodProjectId(configAssayMethodProjectExtendRespVO.getId()); + businessQCManagementProjectDataDO.setDictionaryProjectId(configAssayMethodProjectExtendRespVO.getDictionaryProjectId()); + businessQCManagementProjectDataDO.setUsage(QmsCommonConstant.ASSAY_PROJECT_USAGE_QUALITY_CONTROL); + businessQCManagementProjectDataDO.setSymbol("="); + businessQCManagementProjectDataDO.setDataType(configAssayMethodProjectExtendRespVO.getDataType()); + businessQCManagementProjectDataDO.setDecimalPosition(configAssayMethodProjectExtendRespVO.getDecimalPosition()); + businessQCManagementProjectDataDO.setIsEnabled(configAssayMethodProjectExtendRespVO.getIsDefaultEnabled()); + + businessQCManagementProjectDataDOList.add(businessQCManagementProjectDataDO); + + List configAssayMethodProjectParameterDoList = configAssayMethodProjectParameterList.stream().filter(f -> f.getConfigAssayMethodProjectId().equals(configAssayMethodProjectExtendRespVO.getId())).collect(Collectors.toList()); + for (ConfigAssayMethodProjectParameterDO configAssayMethodProjectParameterDO : configAssayMethodProjectParameterDoList) { + BusinessQCManagementParameterDataDO businessQCManagementParameterDataDO = new BusinessQCManagementParameterDataDO(); + businessQCManagementParameterDataDO.setBusinessQCManagementProjectDataId(businessQCManagementProjectDataDO.getId()); + businessQCManagementParameterDataDO.setConfigAssayMethodProjectParameterId(configAssayMethodProjectParameterDO.getId()); + businessQCManagementParameterDataDO.setDictionaryParameterId(configAssayMethodProjectParameterDO.getDictionaryParameterId()); + businessQCManagementParameterDataDO.setDataType(configAssayMethodProjectParameterDO.getDataType()); + businessQCManagementParameterDataDO.setDecimalPosition(configAssayMethodProjectParameterDO.getDecimalPosition()); + + businessQCManagementParameterDataDOList.add(businessQCManagementParameterDataDO); + } + + } + } + } - //根据默认配置的个数生成空白样 - for (int i = 0; i < configQCSampleMethodExtendRespVO.getDefaultCount(); i++) { - - BusinessQCCoefficientDataDO businessQCCoefficientDataDO = new BusinessQCCoefficientDataDO(); - businessQCCoefficientDataDO.setId(IdWorker.getId()); - businessQCCoefficientDataDO.setBusinessAssayTaskId(businessAssayTaskDO.getId()); - businessQCCoefficientDataDO.setConfigAssayMethodId(configQCSampleMethodExtendRespVO.getConfigAssayMethodId()); - businessQCCoefficientDataDO.setSampleName(configQCSampleMethodExtendRespVO.getDictionaryBusinessName()); - if (StringUtils.isNotBlank(configQCSampleMethodExtendRespVO.getCodeRule())) { - String codeSample = sequenceUtil.genCode(configQCSampleMethodExtendRespVO.getCodeRule()); - businessQCCoefficientDataDO.setSampleCode(codeSample); - } - businessQCCoefficientDataDO.setDictionaryBusinessId(configQCSampleMethodExtendRespVO.getDictionaryBusinessId()); - businessQCCoefficientDataDO.setDictionaryBusinessKey(configQCSampleMethodExtendRespVO.getDictionaryBusinessKey()); - businessQCCoefficientDataDO.setAssayDepartmentId(configAssayMethodDO.getAssayDepartmentId()); - businessQCCoefficientDataDO.setAssayDepartmentName(configAssayMethodDO.getAssayDepartmentName()); - businessQCCoefficientDataDO.setAssayOperator(businessAssayTaskDO.getAssayOperator()); - businessQCCoefficientDataDO.setAssayOperatorId(businessAssayTaskDO.getAssayOperatorId()); - businessQCCoefficientDataDO.setAssayProject(""); - businessQCCoefficientDataDO.setAssignTaskTime(businessAssayTaskDO.getTaskAssignTime()); - businessQCCoefficientDataDO.setIsAssignTasked(QmsCommonConstant.YES); - businessQCCoefficientDataDO.setIsReported(QmsCommonConstant.NO); - - businessQCCoefficientDataDOList.add(businessQCCoefficientDataDO); - - List configQCSampleMethodParameterExtendRespVOs = configQcSampleMethodParameterList.stream().filter(f -> f.getConfigQCSampleMethodId().equals(configQCSampleMethodExtendRespVO.getId())).collect(Collectors.toList()); - for (ConfigQCSampleMethodParameterExtendRespVO configQCSampleMethodParameterExtendRespVO : configQCSampleMethodParameterExtendRespVOs) { - BusinessQCCoefficientParameterDataDO businessQCCoefficientParameterDataDO = new BusinessQCCoefficientParameterDataDO(); - businessQCCoefficientParameterDataDO.setBusinessQCCoefficientDataId(businessQCCoefficientDataDO.getId()); - businessQCCoefficientParameterDataDO.setConfigQCSampleMethodParameterId(configQCSampleMethodParameterExtendRespVO.getId()); - businessQCCoefficientParameterDataDO.setDictionaryParameterId(configQCSampleMethodParameterExtendRespVO.getDictionaryParameterId()); - businessQCCoefficientParameterDataDO.setDataType(configQCSampleMethodParameterExtendRespVO.getDataType()); - businessQCCoefficientParameterDataDO.setDecimalPosition(configQCSampleMethodParameterExtendRespVO.getDecimalPosition()); - businessQCCoefficientParameterDataDO.setValue(configQCSampleMethodParameterExtendRespVO.getDefaultValue()); - - businessQCCoefficientParameterDataDOList.add(businessQCCoefficientParameterDataDO); - } - } } sampleTaskAssignContext.setBusinessQCCoefficientDataList(businessQCCoefficientDataDOList); sampleTaskAssignContext.setBusinessQCCoefficientParameterDataList(businessQCCoefficientParameterDataDOList); + sampleTaskAssignContext.setBusinessQCManagementDataDOList(businessQCManagementDataDOList); + sampleTaskAssignContext.setBusinessQCManagementProjectDataDOList(businessQCManagementProjectDataDOList); + sampleTaskAssignContext.setBusinessQCManagementParameterDataDOList(businessQCManagementParameterDataDOList); } } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/slot/SampleTaskAssignContext.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/slot/SampleTaskAssignContext.java index 8c00403..1cc292b 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/slot/SampleTaskAssignContext.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/slot/SampleTaskAssignContext.java @@ -10,6 +10,10 @@ import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDataD import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDetailDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCCoefficientDataDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCCoefficientParameterDataDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCManagementDataDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCManagementParameterDataDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCManagementProjectDataDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCManagementSampleParameterDataDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleDO; import com.zt.plat.module.qms.business.bus.liteflow.param.AssignAssayUser; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodDO; @@ -89,5 +93,17 @@ public class SampleTaskAssignContext { /** 质控样-(空白、标准)检测参数数据 **/ private List businessQCCoefficientParameterDataList; + + /** 质控样-(质控空白) **/ + private List businessQCManagementDataDOList; + + /** 质控样-(质控空白)参数 **/ + private List businessQCManagementSampleParameterDataDOList; + + /** 质控样-(质控空白)检测项目 **/ + private List businessQCManagementProjectDataDOList; + + /** 质控样-(质控空白)检测项目参数 **/ + private List businessQCManagementParameterDataDOList; } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessAssayTaskDataServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessAssayTaskDataServiceImpl.java index 55ed343..fea9f71 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessAssayTaskDataServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessAssayTaskDataServiceImpl.java @@ -89,7 +89,7 @@ public class BusinessAssayTaskDataServiceImpl implements BusinessAssayTaskDataSe @Override public List getUnAssayTaskGroupList(BusinessAssayTaskDataReqVO reqVO) { - System.out.println("查询时租户id:" + TenantContextHolder.getTenantId()); +// System.out.println("查询时租户id:" + TenantContextHolder.getTenantId()); return businessAssayTaskDataMapper.selectUnAssayTaskGroupList(reqVO); } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessAssayTaskParameterDataService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessAssayTaskParameterDataService.java new file mode 100644 index 0000000..ef56197 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessAssayTaskParameterDataService.java @@ -0,0 +1,61 @@ +package com.zt.plat.module.qms.business.bus.service; + +import java.util.*; +import jakarta.validation.*; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskParameterDataDO; + +/** + * 子样检测任务参数业务 Service 接口 + * + * @author 后台管理-1 + */ +public interface BusinessAssayTaskParameterDataService { + + /** + * 创建子样检测任务参数业务 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + BusinessAssayTaskParameterDataRespVO createBusinessAssayTaskParameterData(@Valid BusinessAssayTaskParameterDataSaveReqVO createReqVO); + + /** + * 更新子样检测任务参数业务 + * + * @param updateReqVO 更新信息 + */ + void updateBusinessAssayTaskParameterData(@Valid BusinessAssayTaskParameterDataSaveReqVO updateReqVO); + + /** + * 删除子样检测任务参数业务 + * + * @param id 编号 + */ + void deleteBusinessAssayTaskParameterData(Long id); + + /** + * 批量删除子样检测任务参数业务 + * + * @param ids 编号 + */ + void deleteBusinessAssayTaskParameterDataListByIds(List ids); + + /** + * 获得子样检测任务参数业务 + * + * @param id 编号 + * @return 子样检测任务参数业务 + */ + BusinessAssayTaskParameterDataDO getBusinessAssayTaskParameterData(Long id); + + /** + * 获得子样检测任务参数业务分页 + * + * @param pageReqVO 分页查询 + * @return 子样检测任务参数业务分页 + */ + PageResult getBusinessAssayTaskParameterDataPage(BusinessAssayTaskParameterDataPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessAssayTaskParameterDataServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessAssayTaskParameterDataServiceImpl.java new file mode 100644 index 0000000..6e872f0 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessAssayTaskParameterDataServiceImpl.java @@ -0,0 +1,91 @@ +package com.zt.plat.module.qms.business.bus.service; + +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.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.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskParameterDataDO; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayTaskParameterDataMapper; + +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.qms.enums.ErrorCodeConstants.*; + +/** + * 子样检测任务参数业务 Service 实现类 + * + * @author 后台管理-1 + */ +@Service +@Validated +public class BusinessAssayTaskParameterDataServiceImpl implements BusinessAssayTaskParameterDataService { + + @Resource + private BusinessAssayTaskParameterDataMapper businessAssayTaskParameterDataMapper; + + @Override + public BusinessAssayTaskParameterDataRespVO createBusinessAssayTaskParameterData(BusinessAssayTaskParameterDataSaveReqVO createReqVO) { + // 插入 + BusinessAssayTaskParameterDataDO businessAssayTaskParameterData = BeanUtils.toBean(createReqVO, BusinessAssayTaskParameterDataDO.class); + businessAssayTaskParameterDataMapper.insert(businessAssayTaskParameterData); + // 返回 + return BeanUtils.toBean(businessAssayTaskParameterData, BusinessAssayTaskParameterDataRespVO.class); + } + + @Override + public void updateBusinessAssayTaskParameterData(BusinessAssayTaskParameterDataSaveReqVO updateReqVO) { + // 校验存在 + validateBusinessAssayTaskParameterDataExists(updateReqVO.getId()); + // 更新 + BusinessAssayTaskParameterDataDO updateObj = BeanUtils.toBean(updateReqVO, BusinessAssayTaskParameterDataDO.class); + businessAssayTaskParameterDataMapper.updateById(updateObj); + } + + @Override + public void deleteBusinessAssayTaskParameterData(Long id) { + // 校验存在 + validateBusinessAssayTaskParameterDataExists(id); + // 删除 + businessAssayTaskParameterDataMapper.deleteById(id); + } + + @Override + public void deleteBusinessAssayTaskParameterDataListByIds(List ids) { + // 校验存在 + validateBusinessAssayTaskParameterDataExists(ids); + // 删除 + businessAssayTaskParameterDataMapper.deleteByIds(ids); + } + + private void validateBusinessAssayTaskParameterDataExists(List ids) { + List list = businessAssayTaskParameterDataMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(BUSINESS_ASSAY_TASK_PARAMETER_DATA_NOT_EXISTS); + } + } + + private void validateBusinessAssayTaskParameterDataExists(Long id) { + if (businessAssayTaskParameterDataMapper.selectById(id) == null) { + throw exception(BUSINESS_ASSAY_TASK_PARAMETER_DATA_NOT_EXISTS); + } + } + + @Override + public BusinessAssayTaskParameterDataDO getBusinessAssayTaskParameterData(Long id) { + return businessAssayTaskParameterDataMapper.selectById(id); + } + + @Override + public PageResult getBusinessAssayTaskParameterDataPage(BusinessAssayTaskParameterDataPageReqVO pageReqVO) { + return businessAssayTaskParameterDataMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCCoefficientDataService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCCoefficientDataService.java index dc59a8b..5a480bf 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCCoefficientDataService.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCCoefficientDataService.java @@ -57,8 +57,8 @@ public interface BusinessQCCoefficientDataService { * @param pageReqVO 分页查询 * @return 质控样检测系数任务数据,空白样、标样分页 */ - PageResult getBusinessQCCoefficientDataPage(BusinessQCCoefficientDataPageReqVO pageReqVO); + PageResult getBusinessQCCoefficientDataPage(BusinessQCCoefficientDataPageReqVO pageReqVO); - List getBusinessQCCoefficientDataList(BusinessQCCoefficientDataReqVO reqVO); + List getBusinessQCCoefficientDataList(BusinessQCCoefficientDataReqVO reqVO); } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCCoefficientDataServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCCoefficientDataServiceImpl.java index 339ce33..3a5878c 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCCoefficientDataServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCCoefficientDataServiceImpl.java @@ -84,12 +84,12 @@ public class BusinessQCCoefficientDataServiceImpl implements BusinessQCCoefficie } @Override - public PageResult getBusinessQCCoefficientDataPage(BusinessQCCoefficientDataPageReqVO pageReqVO) { + public PageResult getBusinessQCCoefficientDataPage(BusinessQCCoefficientDataPageReqVO pageReqVO) { return businessQCCoefficientDataMapper.selectPage(pageReqVO); } @Override - public List getBusinessQCCoefficientDataList(BusinessQCCoefficientDataReqVO reqVO) { + public List getBusinessQCCoefficientDataList(BusinessQCCoefficientDataReqVO reqVO) { return businessQCCoefficientDataMapper.selectList(reqVO); } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCManagementDataService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCManagementDataService.java index 9ab773f..c11500a 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCManagementDataService.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCManagementDataService.java @@ -57,8 +57,8 @@ public interface BusinessQCManagementDataService { * @param pageReqVO 分页查询 * @return 质控管理样检测任务数据,管理样、标准样分页 */ - PageResult getBusinessQCManagementDataPage(BusinessQCManagementDataPageReqVO pageReqVO); + PageResult getBusinessQCManagementDataPage(BusinessQCManagementDataPageReqVO pageReqVO); - List getBusinessQCManagementDataList(BusinessQCManagementDataReqVO reqVO); + List getBusinessQCManagementDataList(BusinessQCManagementDataReqVO reqVO); } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCManagementDataServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCManagementDataServiceImpl.java index 7601b09..6be5261 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCManagementDataServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCManagementDataServiceImpl.java @@ -84,12 +84,12 @@ public class BusinessQCManagementDataServiceImpl implements BusinessQCManagement } @Override - public PageResult getBusinessQCManagementDataPage(BusinessQCManagementDataPageReqVO pageReqVO) { + public PageResult getBusinessQCManagementDataPage(BusinessQCManagementDataPageReqVO pageReqVO) { return businessQCManagementDataMapper.selectPage(pageReqVO); } @Override - public List getBusinessQCManagementDataList(BusinessQCManagementDataReqVO reqVO) { + public List getBusinessQCManagementDataList(BusinessQCManagementDataReqVO reqVO) { return businessQCManagementDataMapper.selectList(reqVO); } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCManagementSampleParameterDataService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCManagementSampleParameterDataService.java new file mode 100644 index 0000000..a564f39 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCManagementSampleParameterDataService.java @@ -0,0 +1,62 @@ +package com.zt.plat.module.qms.business.bus.service; + +import java.util.*; +import jakarta.validation.*; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCManagementSampleParameterDataDO; +import com.zt.plat.framework.common.pojo.PageParam; + +/** + * 质控管理样检测任务参数业务表,与子样检测任务参数业务表T_BSN_ASY_TSK_PRM_DAT一样,针对标准样、管理样、质控样、监控样等样品的参数 Service 接口 + * + * @author 后台管理-1 + */ +public interface BusinessQCManagementSampleParameterDataService { + + /** + * 创建质控管理样检测任务参数业务表,与子样检测任务参数业务表T_BSN_ASY_TSK_PRM_DAT一样,针对标准样、管理样、质控样、监控样等样品的参数 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + BusinessQCManagementSampleParameterDataRespVO createBusinessQCManagementSampleParameterData(@Valid BusinessQCManagementSampleParameterDataSaveReqVO createReqVO); + + /** + * 更新质控管理样检测任务参数业务表,与子样检测任务参数业务表T_BSN_ASY_TSK_PRM_DAT一样,针对标准样、管理样、质控样、监控样等样品的参数 + * + * @param updateReqVO 更新信息 + */ + void updateBusinessQCManagementSampleParameterData(@Valid BusinessQCManagementSampleParameterDataSaveReqVO updateReqVO); + + /** + * 删除质控管理样检测任务参数业务表,与子样检测任务参数业务表T_BSN_ASY_TSK_PRM_DAT一样,针对标准样、管理样、质控样、监控样等样品的参数 + * + * @param id 编号 + */ + void deleteBusinessQCManagementSampleParameterData(Long id); + + /** + * 批量删除质控管理样检测任务参数业务表,与子样检测任务参数业务表T_BSN_ASY_TSK_PRM_DAT一样,针对标准样、管理样、质控样、监控样等样品的参数 + * + * @param ids 编号 + */ + void deleteBusinessQCManagementSampleParameterDataListByIds(List ids); + + /** + * 获得质控管理样检测任务参数业务表,与子样检测任务参数业务表T_BSN_ASY_TSK_PRM_DAT一样,针对标准样、管理样、质控样、监控样等样品的参数 + * + * @param id 编号 + * @return 质控管理样检测任务参数业务表,与子样检测任务参数业务表T_BSN_ASY_TSK_PRM_DAT一样,针对标准样、管理样、质控样、监控样等样品的参数 + */ + BusinessQCManagementSampleParameterDataDO getBusinessQCManagementSampleParameterData(Long id); + + /** + * 获得质控管理样检测任务参数业务表,与子样检测任务参数业务表T_BSN_ASY_TSK_PRM_DAT一样,针对标准样、管理样、质控样、监控样等样品的参数分页 + * + * @param pageReqVO 分页查询 + * @return 质控管理样检测任务参数业务表,与子样检测任务参数业务表T_BSN_ASY_TSK_PRM_DAT一样,针对标准样、管理样、质控样、监控样等样品的参数分页 + */ + PageResult getBusinessQCManagementSampleParameterDataPage(BusinessQCManagementSampleParameterDataPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCManagementSampleParameterDataServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCManagementSampleParameterDataServiceImpl.java new file mode 100644 index 0000000..ce60fb2 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCManagementSampleParameterDataServiceImpl.java @@ -0,0 +1,91 @@ +package com.zt.plat.module.qms.business.bus.service; + +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.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.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCManagementSampleParameterDataDO; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCManagementSampleParameterDataMapper; + +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.qms.enums.ErrorCodeConstants.*; + +/** + * 质控管理样检测任务参数业务表,与子样检测任务参数业务表T_BSN_ASY_TSK_PRM_DAT一样,针对标准样、管理样、质控样、监控样等样品的参数 Service 实现类 + * + * @author 后台管理-1 + */ +@Service +@Validated +public class BusinessQCManagementSampleParameterDataServiceImpl implements BusinessQCManagementSampleParameterDataService { + + @Resource + private BusinessQCManagementSampleParameterDataMapper businessQCManagementSampleParameterDataMapper; + + @Override + public BusinessQCManagementSampleParameterDataRespVO createBusinessQCManagementSampleParameterData(BusinessQCManagementSampleParameterDataSaveReqVO createReqVO) { + // 插入 + BusinessQCManagementSampleParameterDataDO businessQCManagementSampleParameterData = BeanUtils.toBean(createReqVO, BusinessQCManagementSampleParameterDataDO.class); + businessQCManagementSampleParameterDataMapper.insert(businessQCManagementSampleParameterData); + // 返回 + return BeanUtils.toBean(businessQCManagementSampleParameterData, BusinessQCManagementSampleParameterDataRespVO.class); + } + + @Override + public void updateBusinessQCManagementSampleParameterData(BusinessQCManagementSampleParameterDataSaveReqVO updateReqVO) { + // 校验存在 + validateBusinessQCManagementSampleParameterDataExists(updateReqVO.getId()); + // 更新 + BusinessQCManagementSampleParameterDataDO updateObj = BeanUtils.toBean(updateReqVO, BusinessQCManagementSampleParameterDataDO.class); + businessQCManagementSampleParameterDataMapper.updateById(updateObj); + } + + @Override + public void deleteBusinessQCManagementSampleParameterData(Long id) { + // 校验存在 + validateBusinessQCManagementSampleParameterDataExists(id); + // 删除 + businessQCManagementSampleParameterDataMapper.deleteById(id); + } + + @Override + public void deleteBusinessQCManagementSampleParameterDataListByIds(List ids) { + // 校验存在 + validateBusinessQCManagementSampleParameterDataExists(ids); + // 删除 + businessQCManagementSampleParameterDataMapper.deleteByIds(ids); + } + + private void validateBusinessQCManagementSampleParameterDataExists(List ids) { + List list = businessQCManagementSampleParameterDataMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(BUSINESS_QC_MANAGEMENT_SAMPLE_PARAMETER_DATA_NOT_EXISTS); + } + } + + private void validateBusinessQCManagementSampleParameterDataExists(Long id) { + if (businessQCManagementSampleParameterDataMapper.selectById(id) == null) { + throw exception(BUSINESS_QC_MANAGEMENT_SAMPLE_PARAMETER_DATA_NOT_EXISTS); + } + } + + @Override + public BusinessQCManagementSampleParameterDataDO getBusinessQCManagementSampleParameterData(Long id) { + return businessQCManagementSampleParameterDataMapper.selectById(id); + } + + @Override + public PageResult getBusinessQCManagementSampleParameterDataPage(BusinessQCManagementSampleParameterDataPageReqVO pageReqVO) { + return businessQCManagementSampleParameterDataMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleEntrustRegistrationService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleEntrustRegistrationService.java index ae49327..9da761c 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleEntrustRegistrationService.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleEntrustRegistrationService.java @@ -19,6 +19,8 @@ import com.zt.plat.framework.common.pojo.PageParam; */ public interface BusinessSampleEntrustRegistrationService { + + /** * 创建委检登记业务 * @@ -56,6 +58,8 @@ public interface BusinessSampleEntrustRegistrationService { */ BusinessSampleEntrustRegistrationDO getBusinessSampleEntrustRegistration(Long id); + List listByIds(List ids); + /** * 获得委检登记业务分页 * diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleEntrustRegistrationServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleEntrustRegistrationServiceImpl.java index c578ea4..663b5f4 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleEntrustRegistrationServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleEntrustRegistrationServiceImpl.java @@ -89,6 +89,11 @@ public class BusinessSampleEntrustRegistrationServiceImpl implements BusinessSam return businessSampleEntrustRegistrationMapper.selectById(id); } + @Override + public List listByIds(List ids) { + return businessSampleEntrustRegistrationMapper.selectByIds(ids); + } + @Override public PageResult getBusinessSampleEntrustRegistrationPage(BusinessSampleEntrustRegistrationPageReqVO pageReqVO) { return businessSampleEntrustRegistrationMapper.selectPage(pageReqVO); diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubSampleParentRecheckService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubSampleParentRecheckService.java deleted file mode 100644 index 65d0a63..0000000 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubSampleParentRecheckService.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.zt.plat.module.qms.business.bus.service; - -import java.util.*; -import jakarta.validation.*; -import com.zt.plat.framework.common.pojo.PageResult; -import com.zt.plat.module.qms.business.bus.controller.vo.*; -import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleParentRecheckDO; -import com.zt.plat.framework.common.pojo.PageParam; - -/** - * 分样复检业务数据 Service 接口 - * - * @author 后台管理 - */ -public interface BusinessSubSampleParentRecheckService { - - /** - * 创建分样复检业务数据 - * - * @param createReqVO 创建信息 - * @return 编号 - */ - BusinessSubSampleParentRecheckRespVO createBusinessSubSampleParentRecheck(@Valid BusinessSubSampleParentRecheckSaveReqVO createReqVO); - - /** - * 更新分样复检业务数据 - * - * @param updateReqVO 更新信息 - */ - void updateBusinessSubSampleParentRecheck(@Valid BusinessSubSampleParentRecheckSaveReqVO updateReqVO); - - /** - * 删除分样复检业务数据 - * - * @param id 编号 - */ - void deleteBusinessSubSampleParentRecheck(Long id); - - /** - * 批量删除分样复检业务数据 - * - * @param ids 编号 - */ - void deleteBusinessSubSampleParentRecheckListByIds(List ids); - - /** - * 获得分样复检业务数据 - * - * @param id 编号 - * @return 分样复检业务数据 - */ - BusinessSubSampleParentRecheckDO getBusinessSubSampleParentRecheck(Long id); - - /** - * 获得分样复检业务数据分页 - * - * @param pageReqVO 分页查询 - * @return 分样复检业务数据分页 - */ - PageResult getBusinessSubSampleParentRecheckPage(BusinessSubSampleParentRecheckPageReqVO pageReqVO); - -} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubSampleParentRecheckServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubSampleParentRecheckServiceImpl.java deleted file mode 100644 index 236d7e8..0000000 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubSampleParentRecheckServiceImpl.java +++ /dev/null @@ -1,91 +0,0 @@ -package com.zt.plat.module.qms.business.bus.service; - -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.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.qms.business.bus.controller.vo.*; -import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleParentRecheckDO; -import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubSampleParentRecheckMapper; - -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.qms.enums.ErrorCodeConstants.*; - -/** - * 分样复检业务数据 Service 实现类 - * - * @author 后台管理 - */ -@Service -@Validated -public class BusinessSubSampleParentRecheckServiceImpl implements BusinessSubSampleParentRecheckService { - - @Resource - private BusinessSubSampleParentRecheckMapper businessSubSampleParentRecheckMapper; - - @Override - public BusinessSubSampleParentRecheckRespVO createBusinessSubSampleParentRecheck(BusinessSubSampleParentRecheckSaveReqVO createReqVO) { - // 插入 - BusinessSubSampleParentRecheckDO businessSubSampleParentRecheck = BeanUtils.toBean(createReqVO, BusinessSubSampleParentRecheckDO.class); - businessSubSampleParentRecheckMapper.insert(businessSubSampleParentRecheck); - // 返回 - return BeanUtils.toBean(businessSubSampleParentRecheck, BusinessSubSampleParentRecheckRespVO.class); - } - - @Override - public void updateBusinessSubSampleParentRecheck(BusinessSubSampleParentRecheckSaveReqVO updateReqVO) { - // 校验存在 - validateBusinessSubSampleParentRecheckExists(updateReqVO.getId()); - // 更新 - BusinessSubSampleParentRecheckDO updateObj = BeanUtils.toBean(updateReqVO, BusinessSubSampleParentRecheckDO.class); - businessSubSampleParentRecheckMapper.updateById(updateObj); - } - - @Override - public void deleteBusinessSubSampleParentRecheck(Long id) { - // 校验存在 - validateBusinessSubSampleParentRecheckExists(id); - // 删除 - businessSubSampleParentRecheckMapper.deleteById(id); - } - - @Override - public void deleteBusinessSubSampleParentRecheckListByIds(List ids) { - // 校验存在 - validateBusinessSubSampleParentRecheckExists(ids); - // 删除 - businessSubSampleParentRecheckMapper.deleteByIds(ids); - } - - private void validateBusinessSubSampleParentRecheckExists(List ids) { - List list = businessSubSampleParentRecheckMapper.selectByIds(ids); - if (CollUtil.isEmpty(list) || list.size() != ids.size()) { - throw exception(BUSINESS_SUB_SAMPLE_PARENT_RECHECK_NOT_EXISTS); - } - } - - private void validateBusinessSubSampleParentRecheckExists(Long id) { - if (businessSubSampleParentRecheckMapper.selectById(id) == null) { - throw exception(BUSINESS_SUB_SAMPLE_PARENT_RECHECK_NOT_EXISTS); - } - } - - @Override - public BusinessSubSampleParentRecheckDO getBusinessSubSampleParentRecheck(Long id) { - return businessSubSampleParentRecheckMapper.selectById(id); - } - - @Override - public PageResult getBusinessSubSampleParentRecheckPage(BusinessSubSampleParentRecheckPageReqVO pageReqVO) { - return businessSubSampleParentRecheckMapper.selectPage(pageReqVO); - } - -} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubSampleParentRetestService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubSampleParentRetestService.java new file mode 100644 index 0000000..6fa8173 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubSampleParentRetestService.java @@ -0,0 +1,62 @@ +package com.zt.plat.module.qms.business.bus.service; + +import java.util.*; +import jakarta.validation.*; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleParentRetestDO; +import com.zt.plat.framework.common.pojo.PageParam; + +/** + * 分样复测业务数据 Service 接口 + * + * @author 后台管理-1 + */ +public interface BusinessSubSampleParentRetestService { + + /** + * 创建分样复测业务数据 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + BusinessSubSampleParentRetestRespVO createBusinessSubSampleParentRetest(@Valid BusinessSubSampleParentRetestSaveReqVO createReqVO); + + /** + * 更新分样复测业务数据 + * + * @param updateReqVO 更新信息 + */ + void updateBusinessSubSampleParentRetest(@Valid BusinessSubSampleParentRetestSaveReqVO updateReqVO); + + /** + * 删除分样复测业务数据 + * + * @param id 编号 + */ + void deleteBusinessSubSampleParentRetest(Long id); + + /** + * 批量删除分样复测业务数据 + * + * @param ids 编号 + */ + void deleteBusinessSubSampleParentRetestListByIds(List ids); + + /** + * 获得分样复测业务数据 + * + * @param id 编号 + * @return 分样复测业务数据 + */ + BusinessSubSampleParentRetestDO getBusinessSubSampleParentRetest(Long id); + + /** + * 获得分样复测业务数据分页 + * + * @param pageReqVO 分页查询 + * @return 分样复测业务数据分页 + */ + PageResult getBusinessSubSampleParentRetestPage(BusinessSubSampleParentRetestPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubSampleParentRetestServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubSampleParentRetestServiceImpl.java new file mode 100644 index 0000000..c9cc171 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubSampleParentRetestServiceImpl.java @@ -0,0 +1,91 @@ +package com.zt.plat.module.qms.business.bus.service; + +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.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.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleParentRetestDO; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubSampleParentRetestMapper; + +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.qms.enums.ErrorCodeConstants.*; + +/** + * 分样复测业务数据 Service 实现类 + * + * @author 后台管理-1 + */ +@Service +@Validated +public class BusinessSubSampleParentRetestServiceImpl implements BusinessSubSampleParentRetestService { + + @Resource + private BusinessSubSampleParentRetestMapper businessSubSampleParentRetestMapper; + + @Override + public BusinessSubSampleParentRetestRespVO createBusinessSubSampleParentRetest(BusinessSubSampleParentRetestSaveReqVO createReqVO) { + // 插入 + BusinessSubSampleParentRetestDO businessSubSampleParentRetest = BeanUtils.toBean(createReqVO, BusinessSubSampleParentRetestDO.class); + businessSubSampleParentRetestMapper.insert(businessSubSampleParentRetest); + // 返回 + return BeanUtils.toBean(businessSubSampleParentRetest, BusinessSubSampleParentRetestRespVO.class); + } + + @Override + public void updateBusinessSubSampleParentRetest(BusinessSubSampleParentRetestSaveReqVO updateReqVO) { + // 校验存在 + validateBusinessSubSampleParentRetestExists(updateReqVO.getId()); + // 更新 + BusinessSubSampleParentRetestDO updateObj = BeanUtils.toBean(updateReqVO, BusinessSubSampleParentRetestDO.class); + businessSubSampleParentRetestMapper.updateById(updateObj); + } + + @Override + public void deleteBusinessSubSampleParentRetest(Long id) { + // 校验存在 + validateBusinessSubSampleParentRetestExists(id); + // 删除 + businessSubSampleParentRetestMapper.deleteById(id); + } + + @Override + public void deleteBusinessSubSampleParentRetestListByIds(List ids) { + // 校验存在 + validateBusinessSubSampleParentRetestExists(ids); + // 删除 + businessSubSampleParentRetestMapper.deleteByIds(ids); + } + + private void validateBusinessSubSampleParentRetestExists(List ids) { + List list = businessSubSampleParentRetestMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(BUSINESS_SUB_SAMPLE_PARENT_RETEST_NOT_EXISTS); + } + } + + private void validateBusinessSubSampleParentRetestExists(Long id) { + if (businessSubSampleParentRetestMapper.selectById(id) == null) { + throw exception(BUSINESS_SUB_SAMPLE_PARENT_RETEST_NOT_EXISTS); + } + } + + @Override + public BusinessSubSampleParentRetestDO getBusinessSubSampleParentRetest(Long id) { + return businessSubSampleParentRetestMapper.selectById(id); + } + + @Override + public PageResult getBusinessSubSampleParentRetestPage(BusinessSubSampleParentRetestPageReqVO pageReqVO) { + return businessSubSampleParentRetestMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubSampleServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubSampleServiceImpl.java index 0a18ab0..6336b2b 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubSampleServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubSampleServiceImpl.java @@ -150,11 +150,8 @@ public class BusinessSubSampleServiceImpl implements BusinessSubSampleService { businessSubSample.setSampleReceiver(businessSubSampleAnalysisGroupDO.getSampleReceiver()); businessSubSample.setSampleReceiveTime(businessSubSampleAnalysisGroupDO.getSampleReceiveTime()); List businessAssayTaskDataDOList = businessAssayTaskDataMapper.selectByBusinessSubSampleIdAndAssayDepartmentId(id, loginUser.getVisitDeptId()); - Map> businessAssayTaskDataDOMap = businessAssayTaskDataDOList.stream().collect(Collectors.groupingBy(BusinessAssayTaskDataDO::getConfigAssayMethodId)); List assayProjectList = new ArrayList<>(); - for (Map.Entry> entry : businessAssayTaskDataDOMap.entrySet()) { - List val = entry.getValue(); - BusinessAssayTaskDataDO businessAssayTaskDataDO = val.get(0); + for (BusinessAssayTaskDataDO businessAssayTaskDataDO : businessAssayTaskDataDOList) { String assayProject = businessAssayTaskDataDO.getAssayProject(); String[] split = assayProject.split(","); for (String s : split) { @@ -242,6 +239,9 @@ public class BusinessSubSampleServiceImpl implements BusinessSubSampleService { BusinessSubSampleExtendRespVO subSample = null; if (QmsCommonConstant.FLOW_NODE_TEAM_RECEIVE.equals(reqVO.getSampleFlowNodeKey())) { subSample = businessSubSampleMapper.getBySampleCode(reqVO); + if (subSample == null) { + return subSample; + } List businessSubSampleAnalysisGroupList = businessSubSampleAnalysisGroupMapper.selectByBusinessSubSampleId(subSample.getId()); BusinessSubSampleAnalysisGroupDO receiveSample = businessSubSampleAnalysisGroupList.stream().filter(f -> "已收样".equals(f.getSampleStatus()) && !f.getAssayDepartmentId().equals(loginUser.getVisitDeptId())).findFirst().orElse(null); if (receiveSample != null) { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleAnalysisAuditService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleAnalysisAuditService.java index 3b180d6..8d036fc 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleAnalysisAuditService.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleAnalysisAuditService.java @@ -3,18 +3,10 @@ package com.zt.plat.module.qms.business.bus.service; import java.util.List; import com.alibaba.fastjson2.JSONObject; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayTaskDataReqVO; /** * SampleAnalysisAuditService - *

- * 更新历史: - *

 版本         更新时间            更新者        更新内容
- * V1.0 2025年9月29日 wxr Add
- * Copyright (C) 云南志者竟成科技有限公司 - *

- * @author 王兴荣 - * @version V1.0 - * @since 2025年9月29日 */ public interface SampleAnalysisAuditService { @@ -22,7 +14,7 @@ public interface SampleAnalysisAuditService { void crossAuditByByTaskId(Long businessAssayTaskId, String auditStatus); - JSONObject getSampleResultAssessmentList(Long configAssayMethodId, String asmtReportedStatus); + JSONObject getSampleResultAssessmentList(BusinessAssayTaskDataReqVO reqVO); JSONObject getParallelResultAssessment(Long businessSubSampleId, Long configAssayMethodId); diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleAnalysisAuditServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleAnalysisAuditServiceImpl.java index 767e7b7..430547f 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleAnalysisAuditServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleAnalysisAuditServiceImpl.java @@ -6,14 +6,13 @@ import java.time.LocalDateTime; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; -import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import java.util.stream.Collectors; import org.apache.commons.collections4.map.HashedMap; +import org.apache.commons.lang3.SerializationUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -23,18 +22,17 @@ import com.alibaba.fastjson2.JSONArray; import com.alibaba.fastjson2.JSONFactory; import com.alibaba.fastjson2.JSONObject; import com.alibaba.fastjson2.JSONWriter; -import com.alibaba.nacos.shaded.io.grpc.Attributes.Key; +import com.alibaba.qlexpress4.Express4Runner; +import com.alibaba.qlexpress4.QLOptions; +import com.alibaba.qlexpress4.QLResult; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.toolkit.IdWorker; -import com.ql.util.express.DefaultContext; -import com.ql.util.express.ExpressRunner; import com.zt.plat.framework.common.exception.ServiceException; import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; import com.zt.plat.framework.security.core.util.SecurityFrameworkUtils; import com.zt.plat.module.qms.business.bus.controller.vo.*; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayParameterDataDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayProjectDataDO; -import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayReportDataDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDataDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDetailDO; @@ -53,12 +51,14 @@ import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayReportDataMap import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayTaskDataMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayTaskDetailMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayTaskMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayTaskParameterDataMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessBaseSampleMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCCoefficientDataMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCCoefficientParameterDataMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCManagementDataMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCManagementParameterDataMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCManagementProjectDataMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCManagementSampleParameterDataMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubParentSampleAssessmentMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubParentSampleAssessmentProjectMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubParentSampleMapper; @@ -67,10 +67,8 @@ import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubSampleAssessmen import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubSampleMapper; import com.zt.plat.module.qms.business.config.controller.vo.*; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectAssessmentDO; -import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigReportFieldDO; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigRuleDO; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSubSampleDO; -import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSubSampleMethodDO; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSubSampleParentMethodDO; import com.zt.plat.module.qms.business.config.dal.mapper.ConfigAssayMethodProjectAssessmentMapper; import com.zt.plat.module.qms.business.config.dal.mapper.ConfigAssayMethodProjectMapper; @@ -104,7 +102,7 @@ import jakarta.annotation.Resource; public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditService { @Resource - private ExpressRunner expressRunner; + private Express4Runner express4Runner; @Resource private AllowanceCalculatorComponent allowanceCalculatorComponent; @@ -112,6 +110,9 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic @Resource private BusinessAssayTaskMapper businessAssayTaskMapper; + @Resource + private BusinessAssayTaskParameterDataMapper businessAssayTaskParameterDataMapper; + @Resource private BusinessAssayTaskDetailMapper businessAssayTaskDetailMapper; @@ -130,6 +131,9 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic @Resource private BusinessQCManagementDataMapper businessQCManagementDataMapper; + @Resource + private BusinessQCManagementSampleParameterDataMapper businessQCManagementSampleParameterDataMapper; + @Resource private BusinessQCManagementProjectDataMapper businessQCManagementProjectDataMapper; @@ -152,7 +156,9 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic private ConfigSubSampleMethodMapper configSubSampleMethodMapper; @Override - public JSONObject getSampleResultAssessmentList(Long configAssayMethodId, String asmtReportedStatus) { + public JSONObject getSampleResultAssessmentList(BusinessAssayTaskDataReqVO reqVO) { + Long configAssayMethodId = reqVO.getConfigAssayMethodId(); + String asmtReportedStatus = reqVO.getAsmtReportedStatus(); List configAssayMethodProjectDOList = configAssayMethodProjectMapper.selectByConfigAssayMethodId(configAssayMethodId); List> columnList = new ArrayList<>(); @@ -173,6 +179,7 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic BusinessAssayTaskDataReqVO search = new BusinessAssayTaskDataReqVO(); search.setConfigAssayMethodId(configAssayMethodId); search.setAsmtReportedStatus(asmtReportedStatus); + search.setSampleReceiveTime(reqVO.getSampleReceiveTime()); List resultAssessmentList = businessAssayTaskDataMapper.selectResultAssessmentList(search); for (BusinessAssayTaskDataExtendRespVO businessAssayTaskDataExtendRespVO : resultAssessmentList) { @@ -249,7 +256,7 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic { put("title", businessAssayProjectDataExtendRespVO.getSampleAssayCode() + "(" + businessAssayProjectDataExtendRespVO.getAssayOperator() + ")"); - put("field", businessAssayProjectDataExtendRespVO.getBusinessAssayTaskDataId() + ";" + businessAssayProjectDataExtendRespVO.getBusinessSubSampleId() + ";" + businessAssayProjectDataExtendRespVO.getAnalysisCount()); + put("field", businessAssayProjectDataExtendRespVO.getBusinessAssayTaskDataId() + ";" + businessAssayProjectDataExtendRespVO.getBusinessSubSampleId() + ";" + businessAssayProjectDataExtendRespVO.getRecheckCount()); }}); } @@ -264,7 +271,7 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic Map businessSubSampleAssessmentMap = BeanUtil.beanToMap(businessSubSampleAssessment); List businessAssayProjectDataSingleList = businessAssayProjectDataList.stream().filter(f -> f.getDictionaryProjectId().equals(businessSubSampleAssessment.getDictionaryProjectId())).collect(Collectors.toList()); for (BusinessAssayProjectDataExtendRespVO businessAssayProjectDataExtendRespVO : businessAssayProjectDataSingleList) { - businessSubSampleAssessmentMap.put(businessAssayProjectDataExtendRespVO.getBusinessAssayTaskDataId() + ";" + businessAssayProjectDataExtendRespVO.getBusinessSubSampleId() + ";" + businessAssayProjectDataExtendRespVO.getAnalysisCount(), businessAssayProjectDataExtendRespVO.getValue()); + businessSubSampleAssessmentMap.put(businessAssayProjectDataExtendRespVO.getBusinessAssayTaskDataId() + ";" + businessAssayProjectDataExtendRespVO.getBusinessSubSampleId() + ";" + businessAssayProjectDataExtendRespVO.getRecheckCount(), businessAssayProjectDataExtendRespVO.getValue()); } dataList.add(businessSubSampleAssessmentMap); } @@ -290,10 +297,13 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic JSONObject resultJsonObject = new JSONObject(); - BusinessAssayTaskDO businessAssayTaskDO = businessAssayTaskMapper.selectById(businessAssayTaskId); + BusinessAssayTaskExtendRespVO businessAssayTaskDO = businessAssayTaskMapper.selectBusinessAssayTaskById(businessAssayTaskId); if (businessAssayTaskDO == null) { throw new ServiceException(1_032_100_000, "未找到任务分配单"); } + //原始记录数据类型 + String reportDataType = businessAssayTaskDO.getReportDataType(); + JSONArray jsonArray = new JSONArray(); String jsonString = JSON.toJSONString(businessAssayTaskDO, context); @@ -309,113 +319,288 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic jsonArray.add(businessAssayTaskJson); resultJsonObject.put("businessAssayTask", jsonArray); - List businessAssayTaskDetailList = businessAssayTaskDetailMapper.selectList(new LambdaQueryWrapperX().eq(BusinessAssayTaskDetailDO::getBusinessAssayTaskId, businessAssayTaskDO.getId())); - List businessAssayTaskDataList = businessAssayTaskDataMapper.selectList(new LambdaQueryWrapperX().eq(BusinessAssayTaskDataDO::getBusinessAssayTaskId, businessAssayTaskDO.getId()).eq(BusinessAssayTaskDataDO::getConfigAssayMethodId, businessAssayTaskDO.getConfigAssayMethodId())); -// BusinessAssayTaskDataDO businessAssayTaskData = businessAssayTaskDataList.get(0); - //处理数据 + //处理数据 List> datas = new ArrayList<>(); - for (BusinessAssayTaskDataDO businessAssayTaskDataDO : businessAssayTaskDataList) { - BusinessAssayTaskDetailDO businessAssayTaskDetailDO = businessAssayTaskDetailList.stream().filter(f -> f.getSampleId().equals(businessAssayTaskDataDO.getBusinessSubSampleId())).findFirst().orElse(null); - - Map map = new HashedMap<>(); - map.put("businessAssayTaskDataId", businessAssayTaskDataDO.getId()); - map.put("businessAssayTaskId", businessAssayTaskDataDO.getBusinessAssayTaskId()); - map.put("businessSubSampleId", businessAssayTaskDataDO.getBusinessSubSampleId()); - map.put("businessSubParentSampleId", businessAssayTaskDataDO.getBusinessSubParentSampleId()); - map.put("configAssayMethodId", businessAssayTaskDataDO.getConfigAssayMethodId()); - map.put("businessAssayTaskDetailId", businessAssayTaskDetailDO.getId()); - map.put("sampleCode", businessAssayTaskDetailDO.getSampleCode()); - map.put("sampleName", businessAssayTaskDetailDO.getSampleName()); - map.put("analysisType", "analysis"); + //横向数据 + if ("horizontal".equals(reportDataType)) { - BusinessAssayProjectDataReqVO projectDataSearch2 = new BusinessAssayProjectDataReqVO(); - projectDataSearch2.setBusinessAssayTaskDataId(businessAssayTaskDataDO.getId()); - List projectAndParameterList2 = businessAssayProjectDataMapper.selectProjectAndParameterBy(projectDataSearch2); - for (BusinessAssayProjectAndParameterRespVO ep : projectAndParameterList2) { -// map.put("e" + ep.getDicId(), ep); - map.put(ep.getName(), ep.getValue()); - if (StringUtils.isNotEmpty(ep.getFormula())) { - BusinessAssayParameterDataReqVO parameterDataSearch = new BusinessAssayParameterDataReqVO(); - parameterDataSearch.setBusinessAssayProjectDataId(ep.getId()); - List plist = businessAssayParameterDataMapper.selectProjectAndParameterBy(parameterDataSearch); - for (BusinessAssayProjectAndParameterRespVO p : plist) { -// map.put("p" + p.getDicId(), p); - map.put(p.getName(), p.getValue()); - } + List businessAssayTaskDetailList = businessAssayTaskDetailMapper.selectList(new LambdaQueryWrapperX().eq(BusinessAssayTaskDetailDO::getBusinessAssayTaskId, businessAssayTaskDO.getId())); + List businessAssayTaskDataList = businessAssayTaskDataMapper.selectList(new LambdaQueryWrapperX().eq(BusinessAssayTaskDataDO::getBusinessAssayTaskId, businessAssayTaskDO.getId()).eq(BusinessAssayTaskDataDO::getConfigAssayMethodId, businessAssayTaskDO.getConfigAssayMethodId())); + + for (BusinessAssayTaskDataDO businessAssayTaskDataDO : businessAssayTaskDataList) { + BusinessAssayTaskDetailDO businessAssayTaskDetailDO = businessAssayTaskDetailList.stream().filter(f -> f.getSampleId().equals(businessAssayTaskDataDO.getBusinessSubSampleId())).findFirst().orElse(null); + + Map map = new HashedMap<>(); + map.put("businessAssayTaskDataId", businessAssayTaskDataDO.getId()); + map.put("businessAssayTaskId", businessAssayTaskDataDO.getBusinessAssayTaskId()); + map.put("businessSubSampleId", businessAssayTaskDataDO.getBusinessSubSampleId()); + map.put("businessSubParentSampleId", businessAssayTaskDataDO.getBusinessSubParentSampleId()); + map.put("configAssayMethodId", businessAssayTaskDataDO.getConfigAssayMethodId()); + map.put("businessAssayTaskDetailId", businessAssayTaskDetailDO.getId()); + map.put("sampleCode", businessAssayTaskDetailDO.getSampleCode()); + map.put("sampleName", businessAssayTaskDetailDO.getSampleName()); + map.put("analysisType", "analysis"); + map.put("assayTime", businessAssayTaskJson.get("assayTime")); + + List businessAssayTaskParameterDataList = businessAssayTaskParameterDataMapper.selectByBusinessAssayTaskDataIds(Arrays.asList(businessAssayTaskDataDO.getId())); + for (BusinessAssayProjectAndParameterRespVO businessAssayTaskParameterDataDO : businessAssayTaskParameterDataList) { + map.put(businessAssayTaskParameterDataDO.getName(), businessAssayTaskParameterDataDO.getValue()); } - - } - datas.add(map); - } - List businessQCManagementDataDOList = businessQCManagementDataMapper.selectByBusinessAssayTaskId(businessAssayTaskDO.getId()); + BusinessAssayProjectDataReqVO projectDataSearch2 = new BusinessAssayProjectDataReqVO(); + projectDataSearch2.setBusinessAssayTaskDataId(businessAssayTaskDataDO.getId()); + List projectAndParameterList2 = businessAssayProjectDataMapper.selectProjectAndParameterBy(projectDataSearch2); + for (BusinessAssayProjectAndParameterRespVO ep : projectAndParameterList2) { + String ev = ep.getValue(); + if (StringUtils.isNotBlank(ep.getSymbol()) && !"=".equals(ep.getSymbol())) { + ev = ep.getSymbol() + ev; + } + map.put(ep.getName(), ev); + if (StringUtils.isNotEmpty(ep.getFormula())) { + BusinessAssayParameterDataReqVO parameterDataSearch = new BusinessAssayParameterDataReqVO(); + parameterDataSearch.setBusinessAssayProjectDataId(ep.getId()); + List plist = businessAssayParameterDataMapper.selectProjectAndParameterBy(parameterDataSearch); + for (BusinessAssayProjectAndParameterRespVO p : plist) { + String v = p.getValue(); + if (StringUtils.isNotBlank(p.getSymbol()) && !"=".equals(p.getSymbol())) { + v = p.getSymbol() + v; + } + map.put(p.getName(), v); + } + } + + } + datas.add(map); + } + + List businessQCManagementDataDOList = businessQCManagementDataMapper.selectByBusinessAssayTaskId(businessAssayTaskDO.getId()); + + + for (BusinessQCManagementDataDO businessQCManagementData : businessQCManagementDataDOList) { + Map map = new HashedMap<>(); + map.put("businessAssayTaskDataId", businessQCManagementData.getId()); + map.put("businessAssayTaskId", businessQCManagementData.getBusinessAssayTaskId()); + map.put("businessSubSampleId", ""); + map.put("businessSubParentSampleId", ""); + map.put("configAssayMethodId", businessQCManagementData.getConfigAssayMethodId()); + map.put("businessAssayTaskDetailId", ""); + map.put("sampleCode", businessQCManagementData.getSampleCode()); + map.put("sampleName", businessQCManagementData.getSampleName()); + map.put("analysisType", businessQCManagementData.getDictionaryBusinessKey()); + map.put("assayTime", businessAssayTaskJson.get("assayTime")); + + List businessQCManagementSampleParameterDataList = businessQCManagementSampleParameterDataMapper.selectByBusinessQCManagementDataIds(Arrays.asList(businessQCManagementData.getId())); + for (BusinessAssayProjectAndParameterRespVO businessQCManagementSampleParameterData : businessQCManagementSampleParameterDataList) { + map.put(businessQCManagementSampleParameterData.getName(), businessQCManagementSampleParameterData.getValue()); + } + + BusinessQCManagementProjectDataReqVO projectDataSearch2 = new BusinessQCManagementProjectDataReqVO(); + projectDataSearch2.setBusinessQCManagementDataId(businessQCManagementData.getId()); + List projectAndParameterList2 = businessQCManagementProjectDataMapper.selectProjectAndParameterBy(projectDataSearch2); + for (BusinessAssayProjectAndParameterRespVO ep : projectAndParameterList2) { + String ev = ep.getValue(); + if (StringUtils.isNotBlank(ep.getSymbol()) && !"=".equals(ep.getSymbol())) { + ev = ep.getSymbol() + ev; + } + map.put(ep.getName(), ev); + if (StringUtils.isNotEmpty(ep.getFormula())) { + BusinessQCManagementParameterDataReqVO parameterDataSearch = new BusinessQCManagementParameterDataReqVO(); + parameterDataSearch.setBusinessQCManagementProjectDataId(ep.getId()); + List plist = businessQCManagementParameterDataMapper.selectProjectAndParameterBy(parameterDataSearch); + for (BusinessAssayProjectAndParameterRespVO p : plist) { + String v = p.getValue(); + if (StringUtils.isNotBlank(p.getSymbol()) && !"=".equals(p.getSymbol())) { + v = p.getSymbol() + v; + } + map.put(p.getName(), v); + } + } + + } + datas.add(map); + } + + List businessQCCoefficientDataDOList = businessQCCoefficientDataMapper.selectByBusinessAssayTaskId(businessAssayTaskDO.getId()); + for (BusinessQCCoefficientDataDO businessQCCoefficientData: businessQCCoefficientDataDOList) { + Map map = new HashedMap<>(); + map.put("businessAssayTaskDataId", businessQCCoefficientData.getId()); + map.put("businessAssayTaskId", businessQCCoefficientData.getBusinessAssayTaskId()); + map.put("businessSubSampleId", ""); + map.put("businessSubParentSampleId", ""); + map.put("configAssayMethodId", businessQCCoefficientData.getConfigAssayMethodId()); + map.put("businessAssayTaskDetailId", ""); + map.put("sampleCode", businessQCCoefficientData.getSampleCode()); + map.put("sampleName", businessQCCoefficientData.getSampleName()); + map.put("analysisType", businessQCCoefficientData.getDictionaryBusinessKey()); + map.put("assayTime", businessAssayTaskJson.get("assayTime")); + + BusinessQCCoefficientParameterDataReqVO parameterDataSearch2 = new BusinessQCCoefficientParameterDataReqVO(); + parameterDataSearch2.setBusinessQCCoefficientDataId(businessQCCoefficientData.getId()); + List plist2 = businessQCCoefficientParameterDataMapper.selectProjectAndParameterBy(parameterDataSearch2); + for (BusinessAssayProjectAndParameterRespVO p : plist2) { + String v = p.getValue(); + if (StringUtils.isNotBlank(p.getSymbol()) && !"=".equals(p.getSymbol())) { + v = p.getSymbol() + v; + } + map.put(p.getName(), v); + } + datas.add(map); + } + + } else if ("vertical".equals(reportDataType)) {//纵向数据 + List businessAssayTaskDetailList = businessAssayTaskDetailMapper.selectList(new LambdaQueryWrapperX().eq(BusinessAssayTaskDetailDO::getBusinessAssayTaskId, businessAssayTaskDO.getId())); + List businessAssayTaskDataList = businessAssayTaskDataMapper.selectList(new LambdaQueryWrapperX().eq(BusinessAssayTaskDataDO::getBusinessAssayTaskId, businessAssayTaskDO.getId()).eq(BusinessAssayTaskDataDO::getConfigAssayMethodId, businessAssayTaskDO.getConfigAssayMethodId())); + + for (BusinessAssayTaskDataDO businessAssayTaskDataDO : businessAssayTaskDataList) { + BusinessAssayTaskDetailDO businessAssayTaskDetailDO = businessAssayTaskDetailList.stream().filter(f -> f.getSampleId().equals(businessAssayTaskDataDO.getBusinessSubSampleId())).findFirst().orElse(null); + + HashedMap map = new HashedMap<>(); + map.put("businessAssayTaskDataId", businessAssayTaskDataDO.getId()); + map.put("businessAssayTaskId", businessAssayTaskDataDO.getBusinessAssayTaskId()); + map.put("businessSubSampleId", businessAssayTaskDataDO.getBusinessSubSampleId()); + map.put("businessSubParentSampleId", businessAssayTaskDataDO.getBusinessSubParentSampleId()); + map.put("configAssayMethodId", businessAssayTaskDataDO.getConfigAssayMethodId()); + map.put("businessAssayTaskDetailId", businessAssayTaskDetailDO.getId()); + map.put("sampleCode", businessAssayTaskDetailDO.getSampleCode()); + map.put("sampleName", businessAssayTaskDetailDO.getSampleName()); + map.put("analysisType", "analysis"); + map.put("assayTime", businessAssayTaskJson.get("assayTime")); + + List businessAssayTaskParameterDataList = businessAssayTaskParameterDataMapper.selectByBusinessAssayTaskDataIds(Arrays.asList(businessAssayTaskDataDO.getId())); + for (BusinessAssayProjectAndParameterRespVO businessAssayTaskParameterDataDO : businessAssayTaskParameterDataList) { + map.put(businessAssayTaskParameterDataDO.getName(), businessAssayTaskParameterDataDO.getValue()); + } + + BusinessAssayProjectDataReqVO projectDataSearch2 = new BusinessAssayProjectDataReqVO(); + projectDataSearch2.setBusinessAssayTaskDataId(businessAssayTaskDataDO.getId()); + List projectAndParameterList2 = businessAssayProjectDataMapper.selectProjectAndParameterBy(projectDataSearch2); + for (BusinessAssayProjectAndParameterRespVO ep : projectAndParameterList2) { + HashedMap newMap = SerializationUtils.clone(map); + String projectSymbol = ""; + if (StringUtils.isNotBlank(ep.getSymbol()) && !"=".equals(ep.getSymbol())) { + projectSymbol = ep.getSymbol(); + } +// newMap.put(ep.getName(), ep.getValue()); + newMap.put("projectName", ep.getShowName()); + newMap.put("projectValue", ep.getValue()); + newMap.put("projectSymbol", projectSymbol); + newMap.put("projectUnit", ep.getUnit()); + if (StringUtils.isNotEmpty(ep.getFormula())) { + BusinessAssayParameterDataReqVO parameterDataSearch = new BusinessAssayParameterDataReqVO(); + parameterDataSearch.setBusinessAssayProjectDataId(ep.getId()); + List plist = businessAssayParameterDataMapper.selectProjectAndParameterBy(parameterDataSearch); + for (BusinessAssayProjectAndParameterRespVO p : plist) { + String v = p.getValue(); + if (StringUtils.isNotBlank(p.getSymbol()) && !"=".equals(p.getSymbol())) { + v = p.getSymbol() + v; + } + newMap.put(p.getName(), v); + } + } + datas.add(newMap); + } + } + + List businessQCManagementDataDOList = businessQCManagementDataMapper.selectByBusinessAssayTaskId(businessAssayTaskDO.getId()); + + + for (BusinessQCManagementDataDO businessQCManagementData : businessQCManagementDataDOList) { + HashedMap map = new HashedMap<>(); + map.put("businessAssayTaskDataId", businessQCManagementData.getId()); + map.put("businessAssayTaskId", businessQCManagementData.getBusinessAssayTaskId()); + map.put("businessSubSampleId", ""); + map.put("businessSubParentSampleId", ""); + map.put("configAssayMethodId", businessQCManagementData.getConfigAssayMethodId()); + map.put("businessAssayTaskDetailId", ""); + map.put("sampleCode", businessQCManagementData.getSampleCode()); + map.put("sampleName", businessQCManagementData.getSampleName()); + map.put("analysisType", businessQCManagementData.getDictionaryBusinessKey()); + map.put("assayTime", businessAssayTaskJson.get("assayTime")); + + List businessQCManagementSampleParameterDataList = businessQCManagementSampleParameterDataMapper.selectByBusinessQCManagementDataIds(Arrays.asList(businessQCManagementData.getId())); + for (BusinessAssayProjectAndParameterRespVO businessQCManagementSampleParameterData : businessQCManagementSampleParameterDataList) { + String v = businessQCManagementSampleParameterData.getValue(); + if (StringUtils.isNotBlank(businessQCManagementSampleParameterData.getSymbol()) && !"=".equals(businessQCManagementSampleParameterData.getSymbol())) { + v = businessQCManagementSampleParameterData.getSymbol() + v; + } + map.put(businessQCManagementSampleParameterData.getName(), v); + } + + BusinessQCManagementProjectDataReqVO projectDataSearch2 = new BusinessQCManagementProjectDataReqVO(); + projectDataSearch2.setBusinessQCManagementDataId(businessQCManagementData.getId()); + List projectAndParameterList2 = businessQCManagementProjectDataMapper.selectProjectAndParameterBy(projectDataSearch2); + for (BusinessAssayProjectAndParameterRespVO ep : projectAndParameterList2) { + HashedMap newMap = SerializationUtils.clone(map); + String projectSymbol = ""; + if (StringUtils.isNotBlank(ep.getSymbol()) && !"=".equals(ep.getSymbol())) { + projectSymbol = ep.getSymbol(); + } +// newMap.put(ep.getName(), ep.getValue()); + newMap.put("projectName", ep.getShowName()); + newMap.put("projectValue", ep.getValue()); + newMap.put("projectSymbol", projectSymbol); + newMap.put("projectUnit", ep.getUnit()); + if (StringUtils.isNotEmpty(ep.getFormula())) { + BusinessQCManagementParameterDataReqVO parameterDataSearch = new BusinessQCManagementParameterDataReqVO(); + parameterDataSearch.setBusinessQCManagementProjectDataId(ep.getId()); + List plist = businessQCManagementParameterDataMapper.selectProjectAndParameterBy(parameterDataSearch); + for (BusinessAssayProjectAndParameterRespVO p : plist) { + String v = p.getValue(); + if (StringUtils.isNotBlank(p.getSymbol()) && !"=".equals(p.getSymbol())) { + v = p.getSymbol() + v; + } + newMap.put(p.getName(), v); + } + } + datas.add(newMap); + } + } + + List businessQCCoefficientDataDOList = businessQCCoefficientDataMapper.selectByBusinessAssayTaskId(businessAssayTaskDO.getId()); + for (BusinessQCCoefficientDataDO businessQCCoefficientData: businessQCCoefficientDataDOList) { + HashedMap map = new HashedMap<>(); + map.put("businessAssayTaskDataId", businessQCCoefficientData.getId()); + map.put("businessAssayTaskId", businessQCCoefficientData.getBusinessAssayTaskId()); + map.put("businessSubSampleId", ""); + map.put("businessSubParentSampleId", ""); + map.put("configAssayMethodId", businessQCCoefficientData.getConfigAssayMethodId()); + map.put("businessAssayTaskDetailId", ""); + map.put("sampleCode", businessQCCoefficientData.getSampleCode()); + map.put("sampleName", businessQCCoefficientData.getSampleName()); + map.put("analysisType", businessQCCoefficientData.getDictionaryBusinessKey()); + map.put("assayTime", businessAssayTaskJson.get("assayTime")); + + BusinessQCCoefficientParameterDataReqVO parameterDataSearch2 = new BusinessQCCoefficientParameterDataReqVO(); + parameterDataSearch2.setBusinessQCCoefficientDataId(businessQCCoefficientData.getId()); + List plist2 = businessQCCoefficientParameterDataMapper.selectProjectAndParameterBy(parameterDataSearch2); + for (BusinessAssayProjectAndParameterRespVO p : plist2) { + String projectSymbol = ""; + if (StringUtils.isNotBlank(p.getSymbol()) && !"=".equals(p.getSymbol())) { + projectSymbol = p.getSymbol(); + } + //map.put(p.getName(), p.getValue()); + HashedMap newMap = SerializationUtils.clone(map); + newMap.put("projectName", p.getShowName()); + newMap.put("projectValue", p.getValue()); + newMap.put("projectSymbol", projectSymbol); + newMap.put("projectUnit", p.getUnit()); + datas.add(map); + } + } + + } - for (BusinessQCManagementDataDO businessQCManagementData : businessQCManagementDataDOList) { - Map map = new HashedMap<>(); - map.put("businessAssayTaskDataId", businessQCManagementData.getId()); - map.put("businessAssayTaskId", businessQCManagementData.getBusinessAssayTaskId()); - map.put("businessSubSampleId", ""); - map.put("businessSubParentSampleId", ""); - map.put("configAssayMethodId", businessQCManagementData.getConfigAssayMethodId()); - map.put("businessAssayTaskDetailId", ""); - map.put("sampleCode", businessQCManagementData.getSampleCode()); - map.put("sampleName", businessQCManagementData.getSampleName()); - map.put("analysisType", businessQCManagementData.getDictionaryBusinessKey()); - - BusinessQCManagementProjectDataReqVO projectDataSearch2 = new BusinessQCManagementProjectDataReqVO(); - projectDataSearch2.setBusinessQCManagementDataId(businessQCManagementData.getId()); - List projectAndParameterList2 = businessQCManagementProjectDataMapper.selectProjectAndParameterBy(projectDataSearch2); - for (BusinessAssayProjectAndParameterRespVO ep : projectAndParameterList2) { -// map.put("e" + ep.getDicId(), ep); - map.put(ep.getName(), ep.getValue()); - if (StringUtils.isNotEmpty(ep.getFormula())) { - BusinessQCManagementParameterDataReqVO parameterDataSearch = new BusinessQCManagementParameterDataReqVO(); - parameterDataSearch.setBusinessQCManagementProjectDataId(ep.getId()); - List plist = businessQCManagementParameterDataMapper.selectProjectAndParameterBy(parameterDataSearch); - for (BusinessAssayProjectAndParameterRespVO p : plist) { -// map.put("p" + p.getDicId(), p); - map.put(p.getName(), p.getValue()); - } - } - - } - datas.add(map); - } - - List businessQCCoefficientDataDOList = businessQCCoefficientDataMapper.selectByBusinessAssayTaskId(businessAssayTaskDO.getId()); - for (BusinessQCCoefficientDataDO businessQCCoefficientData: businessQCCoefficientDataDOList) { - Map map = new HashedMap<>(); - map.put("businessAssayTaskDataId", businessQCCoefficientData.getId()); - map.put("businessAssayTaskId", businessQCCoefficientData.getBusinessAssayTaskId()); - map.put("businessSubSampleId", ""); - map.put("businessSubParentSampleId", ""); - map.put("configAssayMethodId", businessQCCoefficientData.getConfigAssayMethodId()); - map.put("businessAssayTaskDetailId", ""); - map.put("sampleCode", businessQCCoefficientData.getSampleCode()); - map.put("sampleName", businessQCCoefficientData.getSampleName()); - map.put("analysisType", businessQCCoefficientData.getDictionaryBusinessKey()); - - BusinessQCCoefficientParameterDataReqVO parameterDataSearch2 = new BusinessQCCoefficientParameterDataReqVO(); - parameterDataSearch2.setBusinessQCCoefficientDataId(businessQCCoefficientData.getId()); - List plist2 = businessQCCoefficientParameterDataMapper.selectProjectAndParameterBy(parameterDataSearch2); - for (BusinessAssayProjectAndParameterRespVO p : plist2) { -// map.put("p" + p.getDicId(), p); - map.put(p.getName(), p.getValue()); - } - datas.add(map); - } - // resultJsonObject.put("all", datas); // Map>> map = datas.stream().collect(Collectors.groupingBy(g -> (String) g.get("analysisType"))); // for (Map.Entry>> entry : map.entrySet()) { // resultJsonObject.put(entry.getKey(), entry.getValue()); // } - List> fxList = datas.stream().filter(f -> "analysis".equals(f.get("analysisType")) || "zky".equals(f.get("analysisType")) || "kby".equals(f.get("analysisType")) ).collect(Collectors.toList()); + List> fxList = datas.stream().filter(f -> "analysis".equals(f.get("analysisType")) || "zky".equals(f.get("analysisType")) || "kby".equals(f.get("analysisType")) || "zkkby".equals(f.get("analysisType")) || "jky".equals(f.get("analysisType")) ).collect(Collectors.toList()); resultJsonObject.put("fx", fxList); List> byList = datas.stream().filter(f -> "by".equals(f.get("analysisType"))).collect(Collectors.toList()); - resultJsonObject.put("by", byList); + resultJsonObject.put("by", byList); return resultJsonObject; } @@ -436,16 +621,17 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic BusinessAssayTaskDO businessAssayTaskDO = businessAssayTaskMapper.selectById(businessAssayTaskId); if (QmsCommonConstant.APPROVE.equals(auditStatus)) { - businessAssayTaskDO.setFinishStatus(QmsCommonConstant.APPROVED); - businessAssayTaskDO.setFlowStatus(QmsCommonConstant.APPROVED); + businessAssayTaskDO.setFinishStatus(QmsCommonConstant.COMPLETED); + businessAssayTaskDO.setFlowStatus(QmsCommonConstant.COMPLETED); businessAssayTaskDO.setReportTime(LocalDateTime.now()); businessAssayTaskDO.setReportOperator(SecurityFrameworkUtils.getLoginUserNickname()); businessAssayTaskDO.setReportOperatorId(SecurityFrameworkUtils.getLoginUserId()); //查询分析任务明细 List businessAssayTaskDataDOList = businessAssayTaskDataMapper.selectByBusinessAssayTaskId(businessAssayTaskId); + Integer recheckCount = businessAssayTaskDataDOList.get(0).getRetestCount(); List businessSubSampleIdList = businessAssayTaskDataDOList.stream().map(m -> m.getBusinessSubSampleId()).distinct().collect(Collectors.toList()); - List businessSubSampleAssessmentDOList = businessSubSampleAssessmentMapper.selectByBusinessSubSampleIdsAndConfigAssayMethodId(businessSubSampleIdList, businessAssayTaskDO.getConfigAssayMethodId()); + List businessSubSampleAssessmentDOList = businessSubSampleAssessmentMapper.selectByBusinessSubSampleIdsAndConfigAssayMethodIdAndRetestCount(businessSubSampleIdList, businessAssayTaskDO.getConfigAssayMethodId(), recheckCount); //根据子样分组 Map> businessAssayTaskDataDOMap = businessAssayTaskDataDOList.stream().collect(Collectors.groupingBy(BusinessAssayTaskDataDO::getBusinessSubSampleId)); //循环分组 @@ -458,7 +644,7 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic BusinessSubSampleDO businessSubSampleDO = businessSubSampleMapper.selectById(businessSubSampleId); //获取子样分析方法配置 - ConfigSubSampleMethodDO configSubSampleMethodDO = configSubSampleMethodMapper.selectByConfigSubSampleIdAndConfigAssayMethodId(businessSubSampleDO.getConfigSubSampleId(), businessAssayTaskDataDO.getConfigAssayMethodId()); + ConfigSubSampleMethodExtendRespVO configSubSampleMethodDO = configSubSampleMethodMapper.selectByConfigSubSampleIdAndConfigAssayMethodId(businessSubSampleDO.getConfigSubSampleId(), businessAssayTaskDataDO.getConfigAssayMethodId()); if (QmsCommonConstant.ASSAY_TYPE_SINGLE_PARALLEL.equals(businessAssayTaskDataDO.getAssayType())) { //根据子样id及分析方法id,查询未上报的分析任务 @@ -501,6 +687,7 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic } businessSubSampleAssessmentProjectDO.setBusinessSubParentSampleId(businessAssayTaskDataDO.getBusinessSubParentSampleId()); businessSubSampleAssessmentProjectDO.setBusinessSubSampleId(businessAssayTaskDataDO.getBusinessSubSampleId()); + businessSubSampleAssessmentProjectDO.setBusinessSubSampleAssessmentId(businessSubSampleAssessmentDO.getId()); businessSubSampleAssessmentProjectDO.setConfigAssayMethodId(businessAssayTaskDataDO.getConfigAssayMethodId()); businessSubSampleAssessmentProjectDO.setConfigAssayMethodProjectId(businessAssayProjectDataDO.getConfigAssayMethodProjectId()); businessSubSampleAssessmentProjectDO.setDictionaryProjectId(dictionaryProjectId); @@ -595,6 +782,7 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic } businessSubSampleAssessmentProjectDO.setBusinessSubParentSampleId(businessAssayTaskDataDO.getBusinessSubParentSampleId()); businessSubSampleAssessmentProjectDO.setBusinessSubSampleId(businessAssayTaskDataDO.getBusinessSubSampleId()); + businessSubSampleAssessmentProjectDO.setBusinessSubSampleAssessmentId(businessSubSampleAssessmentDO.getId()); businessSubSampleAssessmentProjectDO.setConfigAssayMethodId(businessAssayTaskDataDO.getConfigAssayMethodId()); businessSubSampleAssessmentProjectDO.setConfigAssayMethodProjectId(businessAssayProjectDataDO.getConfigAssayMethodProjectId()); businessSubSampleAssessmentProjectDO.setDictionaryProjectId(businessAssayProjectDataDO.getDictionaryProjectId()); @@ -628,20 +816,10 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic businessAssayTaskDataMapper.updateBatch(businessAssayTaskDataDOList); - - - - - - - - - - - } else { + businessAssayTaskDO.setTaskAssayStatus(QmsCommonConstant.SAVED); businessAssayTaskDO.setFinishStatus(QmsCommonConstant.PENDING); - businessAssayTaskDO.setFlowStatus(QmsCommonConstant.NOT_START); + businessAssayTaskDO.setFlowStatus(QmsCommonConstant.RETURNED); } businessAssayTaskMapper.updateById(businessAssayTaskDO); @@ -675,17 +853,19 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic .filter(r -> r.getAssessmentLevel() == 1) .findFirst() .orElse(rule); - if (value.compareTo(new BigDecimal(next.getMinimumValue())) >= 0 && value.compareTo(new BigDecimal(next.getMaximumValue())) <= 0) { - return next; - } +// if (value.compareTo(new BigDecimal(next.getMinimumValue())) >= 0 && value.compareTo(new BigDecimal(next.getMaximumValue())) <= 0) { +// return next; +// } + return next; } else if (rule.getAssessmentLevel() == 4) { ConfigAssayMethodProjectAssessmentDO prev = rules.stream() .filter(r -> r.getAssessmentLevel() == 3) .findFirst() .orElse(rule); - if (value.compareTo(new BigDecimal(prev.getMinimumValue())) >= 0 && value.compareTo(new BigDecimal(prev.getMaximumValue())) <= 0) { - return prev; - } +// if (value.compareTo(new BigDecimal(prev.getMinimumValue())) >= 0 && value.compareTo(new BigDecimal(prev.getMaximumValue())) <= 0) { +// return prev; +// } + return prev; } else { if (value.compareTo(new BigDecimal(rule.getMinimumValue())) >= 0 && value.compareTo(new BigDecimal(rule.getMaximumValue())) <= 0) { return rule; @@ -786,6 +966,7 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic businessSubParentSampleAssessmentProjectDO.setBusinessSubParentSampleId(businessAssayTaskDataDO.getBusinessSubParentSampleId()); businessSubParentSampleAssessmentProjectDO.setAssessmentStatus(QmsCommonConstant.NORMAL); businessSubParentSampleAssessmentProjectDO.setAssessmentValue(businessSubSampleAssessment.getAssessmentValue()); + businessSubParentSampleAssessmentProjectDO.setSymbol(businessSubSampleAssessment.getSymbol()); businessSubParentSampleAssessmentProjectDO.setTaskType(businessSubSampleAssessment.getTaskType()); businessSubParentSampleAssessmentProjectDO.setAssayType(businessSubSampleAssessment.getAssayType()); businessSubParentSampleAssessmentProjectDO.setDataType(businessSubSampleAssessment.getDataType()); @@ -856,7 +1037,7 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic BusinessSubSampleAssessmentDO businessSubSampleAssessmentDO = businessSubSampleAssessmentMapper.selectByBusinessSubSampleIdAndConfigAssayMethodId(businessSubSampleId, configAssayMethodId); BusinessAssayTaskDataDO newBusinessAssayTaskDataDO = null; - List businessAssayTaskDataDOList = businessAssayTaskDataMapper.selectMaxAnalysisCountByBusinessSubSampleIdAndConfigAssayMethodId(businessSubSampleId, configAssayMethodId); + List businessAssayTaskDataDOList = businessAssayTaskDataMapper.selectMaxRecheckCountByBusinessSubSampleIdAndConfigAssayMethodId(businessSubSampleId, configAssayMethodId); List businessAssayTaskDataDOIdList = businessAssayTaskDataDOList.stream().map(m -> m.getId()).collect(Collectors.toList()); List businessAssayProjectDataDOList = businessAssayProjectDataMapper.selectByBusinessAssayTaskDataIds(businessAssayTaskDataDOIdList); List businessAssayProjectDataDOIdList = businessAssayProjectDataDOList.stream().map(m -> m.getId()).collect(Collectors.toList()); @@ -878,7 +1059,8 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic newBusinessAssayTaskDataDO.setSampleFlowNodeTime(LocalDateTime.now()); newBusinessAssayTaskDataDO.setAssayDepartmentId(businessAssayTaskDataDO.getAssayDepartmentId()); newBusinessAssayTaskDataDO.setAssayDepartmentName(businessAssayTaskDataDO.getAssayDepartmentName()); - newBusinessAssayTaskDataDO.setAnalysisCount(businessAssayTaskDataDO.getAnalysisCount() + 1); + newBusinessAssayTaskDataDO.setRecheckCount(businessAssayTaskDataDO.getRecheckCount() + 1); + newBusinessAssayTaskDataDO.setRetestCount(businessAssayTaskDataDO.getRetestCount()); newBusinessAssayTaskDataDO.setAssayProject(businessAssayTaskDataDO.getAssayProject()); List businessAssayProjectDataList = businessAssayProjectDataDOList.stream().filter(f -> f.getBusinessAssayTaskDataId().equals(businessAssayTaskDataDO.getId())).collect(Collectors.toList()); @@ -952,7 +1134,7 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic //查询子样 BusinessSubSampleDO businessSubSampleDO = businessSubSampleMapper.selectById(businessSubSampleId); //查询子样与方法的配置 - ConfigSubSampleMethodDO configSubSampleMethodDO = configSubSampleMethodMapper.selectByConfigSubSampleIdAndConfigAssayMethodId(businessSubSampleDO.getConfigSubSampleId(), configAssayMethodId); + ConfigSubSampleMethodExtendRespVO configSubSampleMethodDO = configSubSampleMethodMapper.selectByConfigSubSampleIdAndConfigAssayMethodId(businessSubSampleDO.getConfigSubSampleId(), configAssayMethodId); //计算判定值计算规则 ConfigRuleDO calculateAssessmentValue = configRuleMapper.selectLatestConfigRuleByCode(configSubSampleMethodDO.getCalculateMethod()); @@ -979,17 +1161,27 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic }) .sorted() .collect(Collectors.toList()); + + //符号处理 + String symbol = "="; + BusinessAssayProjectDataDO noEquals = businessAssayProjectDataDOList.stream().filter(f -> !"=".equals(f.getSymbol())).findFirst().orElse(null); + if (noEquals != null) { + symbol = noEquals.getSymbol(); + } + businessSubSampleAssessmentProjectDO.setSymbol(symbol); // 获取小数精度 int elementScale = businessSubSampleAssessmentProjectDO.getDecimalPosition(); // 计算代表值(均值\) // BigDecimal representativeValue = calculateRepresentativeValue(sortedValues, elementScale); - DefaultContext context = new DefaultContext<>(); + Map context = new HashMap<>(); context.put("values", sortedValues); context.put("scale", elementScale); BigDecimal representativeValue = null; try { - representativeValue = (BigDecimal) expressRunner.execute(calculateAssessmentValue.getExpression(), context, null, false, false); + //representativeValue = (BigDecimal) expressRunner.execute(calculateAssessmentValue.getExpression(), context, null, false, false); + QLResult expressResult = express4Runner.execute(calculateAssessmentValue.getExpression(), context, QLOptions.builder().precise(true).build());//高精度计算 + representativeValue = (BigDecimal) expressResult.getResult(); } catch (Exception e) { e.printStackTrace(); } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleAnalysisService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleAnalysisService.java index 5b102c2..4609fe1 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleAnalysisService.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleAnalysisService.java @@ -5,14 +5,6 @@ import com.zt.plat.module.qms.business.bus.controller.vo.*; /** * SampleAnalysisService - *

- * 更新历史: - *

 版本         更新时间            更新者        更新内容
- * V1.0 2025年9月22日 wxr Add
- * Copyright (C) 云南志者竟成科技有限公司 - *

- * @author 王兴荣 - * @version V1.0 * @since 2025年9月22日 */ public interface SampleAnalysisService { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleAnalysisServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleAnalysisServiceImpl.java index ce2bd47..b780a8f 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleAnalysisServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleAnalysisServiceImpl.java @@ -4,6 +4,7 @@ import java.math.BigDecimal; import java.math.RoundingMode; import java.time.LocalDateTime; import java.util.ArrayList; +import java.util.Arrays; import java.util.Comparator; import java.util.HashMap; import java.util.LinkedHashMap; @@ -17,6 +18,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import com.alibaba.fastjson2.JSON; +import com.alibaba.fastjson2.JSONArray; import com.alibaba.fastjson2.JSONObject; import com.zt.plat.framework.common.exception.ServiceException; import com.zt.plat.framework.common.util.object.BeanUtils; @@ -35,27 +37,37 @@ import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayTaskDataEx import com.zt.plat.module.qms.business.bus.controller.vo.BusinessQCCoefficientParameterDataReqVO; import com.zt.plat.module.qms.business.bus.controller.vo.BusinessQCManagementParameterDataReqVO; import com.zt.plat.module.qms.business.bus.controller.vo.BusinessQCManagementProjectDataReqVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubParentSampleAssessmentProjectExtendRespVO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayParameterDataDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayProjectDataDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDataDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDetailDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskParameterDataDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCCoefficientDataDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCCoefficientParameterDataDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCManagementDataDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCManagementParameterDataDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCManagementProjectDataDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCManagementSampleParameterDataDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleEntrustDetailDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubParentSampleDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleDO; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayParameterDataMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayProjectDataMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayTaskDataMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayTaskDetailMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayTaskMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayTaskParameterDataMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCCoefficientDataMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCCoefficientParameterDataMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCManagementDataMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCManagementParameterDataMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCManagementProjectDataMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCManagementSampleParameterDataMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSampleEntrustDetailMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubParentSampleAssessmentProjectMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubParentSampleMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubSampleMapper; import com.zt.plat.module.qms.business.config.controller.vo.BusinessAssayTaskAnalysisDataRespVO; import com.zt.plat.module.qms.business.config.controller.vo.ConfigAssayMethodProjectCoefficientRespVO; @@ -64,10 +76,13 @@ import com.zt.plat.module.qms.business.config.controller.vo.ConfigQCSampleMethod import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSampleMethodConfInfo; import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSampleMethodConfItem; import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSampleMethodConfPoint; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSampleMethodExtendRespVO; +import com.zt.plat.module.qms.business.config.dal.dataobject.BaseSampleDO; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodDO; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectCoefficientDO; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectRangeDO; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSubSampleMethodDO; +import com.zt.plat.module.qms.business.config.dal.mapper.BaseSampleMapper; import com.zt.plat.module.qms.business.config.dal.mapper.ConfigAssayMethodMapper; import com.zt.plat.module.qms.business.config.dal.mapper.ConfigAssayMethodProjectCoefficientMapper; import com.zt.plat.module.qms.business.config.dal.mapper.ConfigAssayMethodProjectRangeMapper; @@ -75,6 +90,8 @@ import com.zt.plat.module.qms.business.config.dal.mapper.ConfigQCSampleMethodMap import com.zt.plat.module.qms.business.config.dal.mapper.ConfigSubSampleMethodMapper; import com.zt.plat.module.qms.common.data.dal.dataobject.DataCollectionDO; import com.zt.plat.module.qms.common.data.service.DataCollectionService; +import com.zt.plat.module.qms.common.dic.controller.vo.DictionaryBusinessExtendRespVO; +import com.zt.plat.module.qms.common.dic.dal.mapper.DictionaryBusinessMapper; import com.zt.plat.module.qms.enums.QmsCommonConstant; import cn.hutool.core.bean.BeanUtil; @@ -84,6 +101,9 @@ import jakarta.annotation.Resource; @Service public class SampleAnalysisServiceImpl implements SampleAnalysisService { + @Resource + private DictionaryBusinessMapper dictionaryBusinessMapper; + @Resource private ConfigAssayMethodMapper configAssayMethodMapper; @@ -108,6 +128,9 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService { @Resource private BusinessAssayTaskDataMapper businessAssayTaskDataMapper; + @Resource + private BusinessAssayTaskParameterDataMapper businessAssayTaskParameterDataMapper; + @Resource private BusinessAssayProjectDataMapper businessAssayProjectDataMapper; @@ -126,16 +149,32 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService { @Resource private BusinessQCManagementDataMapper businessQCManagementDataMapper; + @Resource + private BusinessQCManagementSampleParameterDataMapper businessQCManagementSampleParameterDataMapper; + @Resource private BusinessQCManagementProjectDataMapper businessQCManagementProjectDataMapper; @Resource private BusinessQCManagementParameterDataMapper businessQCManagementParameterDataMapper; + @Resource + private BusinessSampleEntrustDetailMapper businessSampleEntrustDetailMapper; + + @Resource + private BaseSampleMapper baseSampleMapper; + + @Resource + private BusinessSubParentSampleMapper businessSubParentSampleMapper; + + @Resource + private BusinessSubParentSampleAssessmentProjectMapper businessSubParentSampleAssessmentProjectMapper; + @Resource private DataCollectionService dataCollectionService; @Override + @Transactional(rollbackFor = Exception.class) public BusinessAssayTaskAnalysisSampleProjectRespVO batchSampleAnalysisByTaskId(Long businessAssayTaskId) { BusinessAssayTaskAnalysisSampleProjectRespVO businessAssayTaskAnalysisSampleProjectRespVO = new BusinessAssayTaskAnalysisSampleProjectRespVO(); BusinessAssayTaskDO businessAssayTaskDO = businessAssayTaskMapper.selectById(businessAssayTaskId); @@ -157,21 +196,33 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService { businessAssayTaskAnalysisSampleProjectRespVO.setConfigAssayMethodName(configAssayMethodDO.getName()); businessAssayTaskAnalysisSampleProjectRespVO.setDataCollectionKey(configAssayMethodDO.getDataCollectionKey()); + String minWidth = "200px"; + //处理列 List cloumns = new ArrayList<>(); - cloumns.add(new BatchSampleAnalysisColumnRespVO("sampleCode", "sampleCode", "样品编号", "200px", "200px", "string", null, null, null, null, false, null, null, null, null, null, null)); - cloumns.add(new BatchSampleAnalysisColumnRespVO("sampleName", "sampleName", "样品名称", "200px", "200px", "string", null, null, null, null, false, null, null, null, null, null, null)); - //cloumns.add(new BatchSampleAnalysisColumnRespVO("cupNumber", "cupNumber", "杯号", "200px", "200px", "string", null, null, null, null, true, null)); + cloumns.add(new BatchSampleAnalysisColumnRespVO("sampleCode", "sampleCode", "样品编号", minWidth, minWidth, "string", null, null, null, null, false, null, null, null, null, null, null)); + cloumns.add(new BatchSampleAnalysisColumnRespVO("sampleName", "sampleName", "样品名称", minWidth, minWidth, "string", null, null, null, null, false, null, null, null, null, null, null)); List businessAssayTaskDetailList = businessAssayTaskDetailMapper.selectList(new LambdaQueryWrapperX().eq(BusinessAssayTaskDetailDO::getBusinessAssayTaskId, businessAssayTaskId)); List businessAssayTaskDataList = businessAssayTaskDataMapper.selectList(new LambdaQueryWrapperX().eq(BusinessAssayTaskDataDO::getBusinessAssayTaskId, businessAssayTaskId).eq(BusinessAssayTaskDataDO::getConfigAssayMethodId, businessAssayTaskDO.getConfigAssayMethodId())); List businessAssayTaskDataIdList = businessAssayTaskDataList.stream().map(m -> m.getId()).collect(Collectors.toList()); - //BusinessAssayTaskDataDO businessAssayTaskData = businessAssayTaskDataList.get(0); + + + //子样Id列表 + List businessSubSampleIdList = businessAssayTaskDataList.stream().map(m -> m.getBusinessSubSampleId()).distinct().collect(Collectors.toList()); + + //子样列表 + List businessSubSampleDOList = businessSubSampleMapper.selectByIds(businessSubSampleIdList); + //子样配置id列表 + List configSubSampleIdList = businessSubSampleDOList.stream().map(m -> m.getConfigSubSampleId()).distinct().collect(Collectors.toList()); + + //子样方法配置列表 + List configSubSampleMethodDOList = configSubSampleMethodMapper.selectByConfigSubSampleIdsAndConfigAssayMethodId(configSubSampleIdList, businessAssayTaskDO.getConfigAssayMethodId()); + BusinessAssayProjectDataReqVO projectDataSearch = new BusinessAssayProjectDataReqVO(); -// projectDataSearch.setBusinessAssayTaskDataId(businessAssayTaskData.getId()); projectDataSearch.setBusinessAssayTaskDataIdList(businessAssayTaskDataIdList); List projectAndParameterList = businessAssayProjectDataMapper.selectProjectAndParameterBy(projectDataSearch); @@ -184,7 +235,7 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService { String fieldIndex = "e" + ep.getDicId(); String title = ep.getShowName() + (StringUtils.isBlank(ep.getUnit()) ? "" : "(" + ep.getUnit() + ")"); boolean isEdit = StringUtils.isBlank(ep.getFormula()); - cloumns.add(new BatchSampleAnalysisColumnRespVO(fieldIndex, fieldIndex + ".value", title, "", "120px", ep.getDataType(), ep.getDecimalPosition(), null, ep.getFormula(), ep.getParamNo(), isEdit, ep.getUnit(), "project", ep.getFillingWay(), ep.getGroupDictionaryBusinessId(), ep.getGroupDictionaryBusinessKey(), ep.getGroupDictionaryBusinessName())); + cloumns.add(new BatchSampleAnalysisColumnRespVO(fieldIndex, fieldIndex + ".value", title, "", minWidth, ep.getDataType(), ep.getDecimalPosition(), null, ep.getFormula(), ep.getParamNo(), isEdit, ep.getUnit(), "project", ep.getFillingWay(), ep.getGroupDictionaryBusinessId(), ep.getGroupDictionaryBusinessKey(), ep.getGroupDictionaryBusinessName())); if (StringUtils.isNotEmpty(ep.getFormula())) { BusinessAssayParameterDataReqVO parameterDataSearch = new BusinessAssayParameterDataReqVO(); @@ -194,29 +245,11 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService { fieldIndex = "p" + p.getDicId(); title = p.getShowName() + (StringUtils.isBlank(p.getUnit()) ? "" : "(" + p.getUnit() + ")"); isEdit = StringUtils.isBlank(p.getFormula()); - cloumns.add(new BatchSampleAnalysisColumnRespVO(fieldIndex, fieldIndex + ".value", title, "", "120px", p.getDataType(), p.getDecimalPosition(), null, p.getFormula(), p.getParamNo(), isEdit, p.getUnit(), "parameter", p.getFillingWay(), p.getGroupDictionaryBusinessId(), p.getGroupDictionaryBusinessKey(), p.getGroupDictionaryBusinessName())); + cloumns.add(new BatchSampleAnalysisColumnRespVO(fieldIndex, fieldIndex + ".value", title, "", minWidth, p.getDataType(), p.getDecimalPosition(), null, p.getFormula(), p.getParamNo(), isEdit, p.getUnit(), "parameter", p.getFillingWay(), p.getGroupDictionaryBusinessId(), p.getGroupDictionaryBusinessKey(), p.getGroupDictionaryBusinessName())); } } } -// for (BusinessAssayProjectAndParameterRespVO ep : projectAndParameterList) { -// String fieldIndex = "e" + ep.getDicId(); -// String title = ep.getShowName() + (StringUtils.isBlank(ep.getUnit()) ? "" : "(" + ep.getUnit() + ")"); -// boolean isEdit = StringUtils.isBlank(ep.getFormula()); -// cloumns.add(new BatchSampleAnalysisColumnRespVO(fieldIndex, fieldIndex + ".value", title, "", "120px", ep.getDataType(), ep.getDecimalPosition(), null, ep.getFormula(), ep.getParamNo(), isEdit, ep.getUnit(), "project", ep.getFillingWay(), ep.getGroupDictionaryBusinessId(), ep.getGroupDictionaryBusinessKey(), ep.getGroupDictionaryBusinessName())); -// -// if (StringUtils.isNotEmpty(ep.getFormula())) { -// BusinessAssayParameterDataReqVO parameterDataSearch = new BusinessAssayParameterDataReqVO(); -// parameterDataSearch.setBusinessAssayProjectDataId(ep.getId()); -// List plist = businessAssayParameterDataMapper.selectProjectAndParameterBy(parameterDataSearch); -// for (BusinessAssayProjectAndParameterRespVO p : plist) { -// fieldIndex = "p" + p.getDicId(); -// title = p.getShowName() + (StringUtils.isBlank(p.getUnit()) ? "" : "(" + p.getUnit() + ")"); -// isEdit = StringUtils.isBlank(p.getFormula()); -// cloumns.add(new BatchSampleAnalysisColumnRespVO(fieldIndex, fieldIndex + ".value", title, "", "120px", p.getDataType(), p.getDecimalPosition(), null, p.getFormula(), p.getParamNo(), isEdit, p.getUnit(), "parameter", p.getFillingWay(), p.getGroupDictionaryBusinessId(), p.getGroupDictionaryBusinessKey(), p.getGroupDictionaryBusinessName())); -// } -// } -// } businessAssayTaskAnalysisSampleProjectRespVO.setColumns(cloumns); @@ -225,6 +258,91 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService { for (BusinessAssayTaskDataDO businessAssayTaskDataDO : businessAssayTaskDataList) { BusinessAssayTaskDetailDO businessAssayTaskDetailDO = businessAssayTaskDetailList.stream().filter(f -> f.getBusinessAssayTaskDataId().equals(businessAssayTaskDataDO.getId())).findFirst().orElse(null); + + BusinessSubSampleDO businessSubSampleDO = businessSubSampleDOList.stream().filter(f -> f.getId().equals(businessAssayTaskDataDO.getBusinessSubSampleId())).findFirst().orElse(null); + ConfigSubSampleMethodExtendRespVO configSubSampleMethodDO = configSubSampleMethodDOList.stream().filter(f -> f.getConfigAssayMethodId().equals(businessAssayTaskDataDO.getConfigAssayMethodId()) && f.getConfigSubSampleId().equals(businessSubSampleDO.getConfigSubSampleId())).findFirst().orElse(null); + String configInfomation = configSubSampleMethodDO.getConfigInfomation(); + if (StringUtils.isNotBlank(configInfomation)) { + ConfigSubSampleMethodConfInfo configSubSampleMethodConfInfo = JSON.parseObject(configInfomation, ConfigSubSampleMethodConfInfo.class); + List getParamList = configSubSampleMethodConfInfo.getGetParam(); + for (ConfigSubSampleMethodConfItem configSubSampleMethodConfItem: getParamList) { + //Boolean required = configSubSampleMethodConfItem.getRequired();//是否必须 + ConfigSubSampleMethodConfPoint source = configSubSampleMethodConfItem.getSource();//来源 + Long configMethodId = source.getMethodId(); + String sourceProject = source.getProject(); + //String sourceParameter = source.getParameter(); + + + ConfigSubSampleMethodConfPoint target = configSubSampleMethodConfItem.getTarget();//目标 + String targetProject = target.getProject(); + String targetParameter = target.getParameter(); + + BusinessAssayParameterDataDO businessAssayParameterDataDO = businessAssayParameterDataMapper.selectByBusinessAssayTaskDataIdAndProjectSimpleNameAndParameterKey(businessAssayTaskDataDO.getId(), targetProject, targetParameter); + if (StringUtils.isBlank(businessAssayParameterDataDO.getValue())) { + //1 查询委托明细 + BusinessSampleEntrustDetailDO businessSampleEntrustDetailDO = businessSampleEntrustDetailMapper.selectByBusinessBaseSampleId(businessAssayTaskDataDO.getBusinessBaseSampleId()); + //2 查询样品大类 + BaseSampleDO baseSampleDO = baseSampleMapper.selectById(businessSampleEntrustDetailDO.getBaseSampleId()); + //3 判断样品大类类型 + if (QmsCommonConstant.ENTRUST_INSPECTION_ANALYSIS_SAMPLE.equals(baseSampleDO.getDictionaryBusinessKey())) {//如果是商检分析样 + //查询当前批次的第一个商检分析样 + BusinessSampleEntrustDetailDO currBatchFirstBusinessSampleEntrustDetailDO = businessSampleEntrustDetailMapper.selectCurrBatchFirstByBusinessBaseSampleIdAndBaseSampleDictionaryBusinessKey(businessAssayTaskDataDO.getBusinessBaseSampleId(), QmsCommonConstant.ENTRUST_INSPECTION_ANALYSIS_SAMPLE); + List currBusinessSubParentSampleDOList = businessSubParentSampleMapper.selectByBusinessBaseSampleId(currBatchFirstBusinessSampleEntrustDetailDO.getBusinessBaseSampleId()); + List currBusinessSubParentSampleIdList = currBusinessSubParentSampleDOList.stream().map(m -> m.getId()).collect(Collectors.toList()); + List businessSubParentSampleAssessmentProjectList = businessSubParentSampleAssessmentProjectMapper.selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(currBusinessSubParentSampleIdList, configMethodId); + BusinessSubParentSampleAssessmentProjectExtendRespVO businessSubParentSampleAssessmentProject = businessSubParentSampleAssessmentProjectList.stream().filter(f -> f.getSimpleName().equals(sourceProject)).findFirst().orElse(null); + if (businessSubParentSampleAssessmentProject != null && StringUtils.isNotBlank(businessSubParentSampleAssessmentProject.getAssessmentValue())) { + businessAssayParameterDataDO.setValue(businessSubParentSampleAssessmentProject.getAssessmentValue()); + } + } else if (QmsCommonConstant.ENTRUST_COMPREHENSIVE_INSPECTION_SAMPLE.equals(baseSampleDO.getDictionaryBusinessKey())) {//如果是商检综合样 + //查询当前样品的其他分析方法的结果 + List businessSubParentSampleIdList = Arrays.asList(businessAssayTaskDataDO.getBusinessSubParentSampleId()); + List businessSubParentSampleAssessmentProjectList = businessSubParentSampleAssessmentProjectMapper.selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(businessSubParentSampleIdList, configMethodId); + BusinessSubParentSampleAssessmentProjectExtendRespVO businessSubParentSampleAssessmentProject = businessSubParentSampleAssessmentProjectList.stream().filter(f -> f.getSimpleName().equals(sourceProject)).findFirst().orElse(null); + if (businessSubParentSampleAssessmentProject == null || StringUtils.isBlank(businessSubParentSampleAssessmentProject.getAssessmentValue())) { + businessAssayParameterDataDO.setValue(businessSubParentSampleAssessmentProject.getAssessmentValue()); + } + } else if (QmsCommonConstant.ENTRUST_COMMISSION_INSPECTION_SAMPLE.equals(baseSampleDO.getDictionaryBusinessKey())) {//如果是委检样 + //查询来样品位 + Boolean isForecastS = false; + String forecastValue = null; + String forecastResult = businessSampleEntrustDetailDO.getForecastResult(); + if (StringUtils.isNotBlank(forecastResult)) { + JSONArray array = JSON.parseArray(forecastResult); + for (int i = 0; i < array.size(); i++) { + JSONObject item = array.getJSONObject(i); + if ("S".equals(item.getString("simpleName"))) { + isForecastS = true; + break; + } + } + for (int i = 0; i < array.size(); i++) { + JSONObject item = array.getJSONObject(i); + if (sourceProject.equals(item.getString("simpleName"))) { + forecastValue = item.getString("value"); + break; + } + } + } + if (isForecastS) {//来样品位存在S值, 则取预报的值 + businessAssayParameterDataDO.setValue(forecastValue); + } else { + //查询当前样品的其他方法的结果 + List businessSubParentSampleIdList = Arrays.asList(businessAssayTaskDataDO.getBusinessSubParentSampleId()); + List businessSubParentSampleAssessmentProjectList = businessSubParentSampleAssessmentProjectMapper.selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(businessSubParentSampleIdList, configMethodId); + BusinessSubParentSampleAssessmentProjectExtendRespVO businessSubParentSampleAssessmentProject = businessSubParentSampleAssessmentProjectList.stream().filter(f -> f.getSimpleName().equals(sourceProject)).findFirst().orElse(null); + if (businessSubParentSampleAssessmentProject == null || StringUtils.isBlank(businessSubParentSampleAssessmentProject.getAssessmentValue())) { + businessAssayParameterDataDO.setValue(businessSubParentSampleAssessmentProject.getAssessmentValue()); + } + } + + } + + businessAssayParameterDataMapper.updateById(businessAssayParameterDataDO); + } + } + } + Map map = new HashedMap<>(); map.put("businessAssayTaskDataId", businessAssayTaskDataDO.getId()); map.put("businessAssayTaskId", businessAssayTaskDataDO.getBusinessAssayTaskId()); @@ -389,6 +507,7 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService { } @Override + @Transactional(rollbackFor = Exception.class) public BusinessAssayTaskAnalysisSampleAndQcProjectRespVO batchSampleAndQcAnalysisByTaskId(Long businessAssayTaskId) { BusinessAssayTaskAnalysisSampleAndQcProjectRespVO businessAssayTaskAnalysisSampleAndQcProjectRespVO = new BusinessAssayTaskAnalysisSampleAndQcProjectRespVO(); BusinessAssayTaskDO businessAssayTaskDO = businessAssayTaskMapper.selectById(businessAssayTaskId); @@ -421,9 +540,6 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService { assayTaskAnalysisDataList.add(analysis); businessAssayTaskAnalysisSampleAndQcProjectRespVO.setAssayTaskAnalysisDataList(assayTaskAnalysisDataList); - -// List configQCSampleMethodList = configQCSampleMethodMapper.selectByConfigAssayMethodId(businessAssayTaskDO.getConfigAssayMethodId()); -// businessAssayTaskAnalysisSampleAndQcProjectRespVO.setConfigQCSampleMethodList(configQCSampleMethodList); //查询区间范围 List configAssayMethodProjectRangeDOList = configAssayMethodProjectRangeMapper.selectList(new LambdaQueryWrapperX().eq(ConfigAssayMethodProjectRangeDO::getConfigAssayMethodId, businessAssayTaskDO.getConfigAssayMethodId())); @@ -441,24 +557,56 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService { businessAssayTaskAnalysisDataRespVO.setAnalysisType("analysis"); businessAssayTaskAnalysisDataRespVO.setAnalysisName("分析样"); businessAssayTaskAnalysisDataRespVO.setSortNo(99); - + + String minWidth = "200px"; //处理列 List cloumns = new ArrayList<>(); - cloumns.add(new BatchSampleAnalysisColumnRespVO("sampleCode", "sampleCode", "样品编号", "200px", "200px", "string", null, null, null, null, false, null, null, null, null, null, null)); - cloumns.add(new BatchSampleAnalysisColumnRespVO("sampleName", "sampleName", "样品名称", "200px", "200px", "string", null, null, null, null, false, null, null, null, null, null, null)); - //cloumns.add(new BatchSampleAnalysisColumnRespVO("cupNumber", "cupNumber", "杯号", "200px", "200px", "string", null, null, null, null, true, null)); - + cloumns.add(new BatchSampleAnalysisColumnRespVO("sampleCode", "sampleCode", "样品编号", minWidth, minWidth, "string", null, null, null, null, false, null, null, null, null, null, null)); + cloumns.add(new BatchSampleAnalysisColumnRespVO("sampleName", "sampleName", "样品名称", minWidth, minWidth, "string", null, null, null, null, false, null, null, null, null, null, null)); List businessAssayTaskDetailList = businessAssayTaskDetailMapper.selectList(new LambdaQueryWrapperX().eq(BusinessAssayTaskDetailDO::getBusinessAssayTaskId, businessAssayTaskDO.getId())); List businessAssayTaskDataList = businessAssayTaskDataMapper.selectList(new LambdaQueryWrapperX().eq(BusinessAssayTaskDataDO::getBusinessAssayTaskId, businessAssayTaskDO.getId()).eq(BusinessAssayTaskDataDO::getConfigAssayMethodId, businessAssayTaskDO.getConfigAssayMethodId())); - List businessAssayTaskDataIdList = businessAssayTaskDataList.stream().map(m -> m.getId()).collect(Collectors.toList()); - // BusinessAssayTaskDataDO businessAssayTaskData = businessAssayTaskDataList.get(0); + //子样Id列表 + List businessSubSampleIdList = businessAssayTaskDataList.stream().map(m -> m.getBusinessSubSampleId()).distinct().collect(Collectors.toList()); + + //子样列表 + List businessSubSampleDOList = businessSubSampleMapper.selectByIds(businessSubSampleIdList); + //子样配置id列表 + List configSubSampleIdList = businessSubSampleDOList.stream().map(m -> m.getConfigSubSampleId()).distinct().collect(Collectors.toList()); + + //子样方法配置列表 + List configSubSampleMethodDOList = configSubSampleMethodMapper.selectByConfigSubSampleIdsAndConfigAssayMethodId(configSubSampleIdList, businessAssayTaskDO.getConfigAssayMethodId()); + + + List businessAssayTaskDataIdList = businessAssayTaskDataList.stream().map(m -> m.getId()).collect(Collectors.toList()); + + //任务参数查询 + List taskParameterList = businessAssayTaskParameterDataMapper.selectByBusinessAssayTaskDataIds(businessAssayTaskDataIdList); + Map> taskParameterMap = taskParameterList.stream().sorted(Comparator.comparing(BusinessAssayProjectAndParameterRespVO::getParamNo)).collect(Collectors.groupingBy(BusinessAssayProjectAndParameterRespVO::getDicId, + LinkedHashMap::new, // 保持组首次出现的顺序(可选) + Collectors.toList() // ArrayList 保持组内顺序 + )); + for (Map.Entry> entry : taskParameterMap.entrySet()) { + BusinessAssayProjectAndParameterRespVO taskParameter = entry.getValue().get(0); + String fieldIndex = "a" + taskParameter.getDicId(); + String title = taskParameter.getShowName() + (StringUtils.isBlank(taskParameter.getUnit()) ? "" : "(" + taskParameter.getUnit() + ")"); + boolean isEdit = StringUtils.isBlank(taskParameter.getFormula()); + cloumns.add(new BatchSampleAnalysisColumnRespVO(fieldIndex, fieldIndex + ".value", title, "", minWidth, taskParameter.getDataType(), taskParameter.getDecimalPosition(), null, taskParameter.getFormula(), taskParameter.getParamNo(), isEdit, taskParameter.getUnit(), "attribute", taskParameter.getFillingWay(), taskParameter.getGroupDictionaryBusinessId(), taskParameter.getGroupDictionaryBusinessKey(), taskParameter.getGroupDictionaryBusinessName())); + } + + //查询检测项目 BusinessAssayProjectDataReqVO projectDataSearch = new BusinessAssayProjectDataReqVO(); -// projectDataSearch.setBusinessAssayTaskDataId(businessAssayTaskData.getId()); projectDataSearch.setBusinessAssayTaskDataIdList(businessAssayTaskDataIdList); List projectAndParameterList = businessAssayProjectDataMapper.selectProjectAndParameterBy(projectDataSearch); + List businessAssayProjectDataIdList = projectAndParameterList.stream().map(m -> m.getId()).collect(Collectors.toList()); + + //检测项目参数 + BusinessAssayParameterDataReqVO parameterDataSearch = new BusinessAssayParameterDataReqVO(); + parameterDataSearch.setBusinessAssayProjectDataIdList(businessAssayProjectDataIdList); + List businessAssayParameterDataList = businessAssayParameterDataMapper.selectProjectAndParameterBy(parameterDataSearch); + Map> projectAndParameterMap = projectAndParameterList.stream().sorted(Comparator.comparing(BusinessAssayProjectAndParameterRespVO::getParamNo)).collect(Collectors.groupingBy(BusinessAssayProjectAndParameterRespVO::getDicId, LinkedHashMap::new, // 保持组首次出现的顺序(可选) Collectors.toList() // ArrayList 保持组内顺序 @@ -468,38 +616,25 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService { String fieldIndex = "e" + ep.getDicId(); String title = ep.getShowName() + (StringUtils.isBlank(ep.getUnit()) ? "" : "(" + ep.getUnit() + ")"); boolean isEdit = StringUtils.isBlank(ep.getFormula()); - cloumns.add(new BatchSampleAnalysisColumnRespVO(fieldIndex, fieldIndex + ".value", title, "", "120px", ep.getDataType(), ep.getDecimalPosition(), null, ep.getFormula(), ep.getParamNo(), isEdit, ep.getUnit(), "project", ep.getFillingWay(), ep.getGroupDictionaryBusinessId(), ep.getGroupDictionaryBusinessKey(), ep.getGroupDictionaryBusinessName())); + if (isEdit) { + minWidth = "280px"; + } + cloumns.add(new BatchSampleAnalysisColumnRespVO(fieldIndex, fieldIndex + ".value", title, "", minWidth, ep.getDataType(), ep.getDecimalPosition(), null, ep.getFormula(), ep.getParamNo(), isEdit, ep.getUnit(), "project", ep.getFillingWay(), ep.getGroupDictionaryBusinessId(), ep.getGroupDictionaryBusinessKey(), ep.getGroupDictionaryBusinessName())); if (StringUtils.isNotEmpty(ep.getFormula())) { - BusinessAssayParameterDataReqVO parameterDataSearch = new BusinessAssayParameterDataReqVO(); - parameterDataSearch.setBusinessAssayProjectDataId(ep.getId()); - List plist = businessAssayParameterDataMapper.selectProjectAndParameterBy(parameterDataSearch); + //BusinessAssayParameterDataReqVO parameterDataSearch = new BusinessAssayParameterDataReqVO(); + //parameterDataSearch.setBusinessAssayProjectDataId(ep.getId()); + //List plist = businessAssayParameterDataMapper.selectProjectAndParameterBy(parameterDataSearch); + List plist = businessAssayParameterDataList.stream().filter(f -> f.getBizId().equals(ep.getId())).collect(Collectors.toList()); for (BusinessAssayProjectAndParameterRespVO p : plist) { fieldIndex = "p" + p.getDicId(); title = p.getShowName() + (StringUtils.isBlank(p.getUnit()) ? "" : "(" + p.getUnit() + ")"); isEdit = StringUtils.isBlank(p.getFormula()); - cloumns.add(new BatchSampleAnalysisColumnRespVO(fieldIndex, fieldIndex + ".value", title, "", "120px", p.getDataType(), p.getDecimalPosition(), null, p.getFormula(), p.getParamNo(), isEdit, p.getUnit(), "parameter", p.getFillingWay(), p.getGroupDictionaryBusinessId(), p.getGroupDictionaryBusinessKey(), p.getGroupDictionaryBusinessName())); + cloumns.add(new BatchSampleAnalysisColumnRespVO(fieldIndex, fieldIndex + ".value", title, "", minWidth, p.getDataType(), p.getDecimalPosition(), null, p.getFormula(), p.getParamNo(), isEdit, p.getUnit(), "parameter", p.getFillingWay(), p.getGroupDictionaryBusinessId(), p.getGroupDictionaryBusinessKey(), p.getGroupDictionaryBusinessName())); } } } -// for (BusinessAssayProjectAndParameterRespVO ep : projectAndParameterList) { -// String fieldIndex = "e" + ep.getDicId(); -// String title = ep.getShowName() + (StringUtils.isBlank(ep.getUnit()) ? "" : "(" + ep.getUnit() + ")"); -// boolean isEdit = StringUtils.isBlank(ep.getFormula()); -// cloumns.add(new BatchSampleAnalysisColumnRespVO(fieldIndex, fieldIndex + ".value", title, "", "120px", ep.getDataType(), ep.getDecimalPosition(), null, ep.getFormula(), ep.getParamNo(), isEdit, ep.getUnit(), "project", ep.getFillingWay(), ep.getGroupDictionaryBusinessId(), ep.getGroupDictionaryBusinessKey(), ep.getGroupDictionaryBusinessName())); -// -// if (StringUtils.isNotEmpty(ep.getFormula())) { -// BusinessAssayParameterDataReqVO parameterDataSearch = new BusinessAssayParameterDataReqVO(); -// parameterDataSearch.setBusinessAssayProjectDataId(ep.getId()); -// List plist = businessAssayParameterDataMapper.selectProjectAndParameterBy(parameterDataSearch); -// for (BusinessAssayProjectAndParameterRespVO p : plist) { -// fieldIndex = "p" + p.getDicId(); -// title = p.getShowName() + (StringUtils.isBlank(p.getUnit()) ? "" : "(" + p.getUnit() + ")"); -// isEdit = StringUtils.isBlank(p.getFormula()); -// cloumns.add(new BatchSampleAnalysisColumnRespVO(fieldIndex, fieldIndex + ".value", title, "", "120px", p.getDataType(), p.getDecimalPosition(), null, p.getFormula(), p.getParamNo(), isEdit, p.getUnit(), "parameter", p.getFillingWay(), p.getGroupDictionaryBusinessId(), p.getGroupDictionaryBusinessKey(), p.getGroupDictionaryBusinessName())); -// } -// } -// } + businessAssayTaskAnalysisDataRespVO.setColumns(cloumns); @@ -507,6 +642,102 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService { List> datas = new ArrayList<>(); for (BusinessAssayTaskDataDO businessAssayTaskDataDO : businessAssayTaskDataList) { BusinessAssayTaskDetailDO businessAssayTaskDetailDO = businessAssayTaskDetailList.stream().filter(f -> f.getBusinessAssayTaskDataId().equals(businessAssayTaskDataDO.getId())).findFirst().orElse(null); + + BusinessSubSampleDO businessSubSampleDO = businessSubSampleDOList.stream().filter(f -> f.getId().equals(businessAssayTaskDataDO.getBusinessSubSampleId())).findFirst().orElse(null); + ConfigSubSampleMethodExtendRespVO configSubSampleMethodDO = configSubSampleMethodDOList.stream().filter(f -> f.getConfigAssayMethodId().equals(businessAssayTaskDataDO.getConfigAssayMethodId()) && f.getConfigSubSampleId().equals(businessSubSampleDO.getConfigSubSampleId())).findFirst().orElse(null); + String configInfomation = configSubSampleMethodDO.getConfigInfomation(); + if (StringUtils.isNotBlank(configInfomation)) { + ConfigSubSampleMethodConfInfo configSubSampleMethodConfInfo = JSON.parseObject(configInfomation, ConfigSubSampleMethodConfInfo.class); + List getParamList = configSubSampleMethodConfInfo.getGetParam(); + for (ConfigSubSampleMethodConfItem configSubSampleMethodConfItem: getParamList) { + //Boolean required = configSubSampleMethodConfItem.getRequired();//是否必须 + ConfigSubSampleMethodConfPoint source = configSubSampleMethodConfItem.getSource();//来源 + Long configMethodId = source.getMethodId(); + String sourceProject = source.getProject(); + //String sourceParameter = source.getParameter(); + + + ConfigSubSampleMethodConfPoint target = configSubSampleMethodConfItem.getTarget();//目标 + String targetProject = target.getProject(); + String targetParameter = target.getParameter(); + + BusinessAssayParameterDataDO businessAssayParameterDataDO = businessAssayParameterDataMapper.selectByBusinessAssayTaskDataIdAndProjectSimpleNameAndParameterKey(businessAssayTaskDataDO.getId(), targetProject, targetParameter); + if (businessAssayParameterDataDO == null) { + throw new ServiceException(1_032_100_000, "子样检测方法映射配置错误"); + } + + if (StringUtils.isBlank(businessAssayParameterDataDO.getValue())) { + //1 查询委托明细 + BusinessSampleEntrustDetailDO businessSampleEntrustDetailDO = businessSampleEntrustDetailMapper.selectByBusinessBaseSampleId(businessAssayTaskDataDO.getBusinessBaseSampleId()); + //2 查询样品大类 + BaseSampleDO baseSampleDO = baseSampleMapper.selectById(businessSampleEntrustDetailDO.getBaseSampleId()); + //3 判断样品大类类型 + if (QmsCommonConstant.ENTRUST_INSPECTION_ANALYSIS_SAMPLE.equals(baseSampleDO.getDictionaryBusinessKey())) {//如果是商检分析样 + //查询当前批次的第一个商检分析样 + BusinessSampleEntrustDetailDO currBatchFirstBusinessSampleEntrustDetailDO = businessSampleEntrustDetailMapper.selectCurrBatchFirstByBusinessBaseSampleIdAndBaseSampleDictionaryBusinessKey(businessAssayTaskDataDO.getBusinessBaseSampleId(), QmsCommonConstant.ENTRUST_INSPECTION_ANALYSIS_SAMPLE); + List currBusinessSubParentSampleDOList = businessSubParentSampleMapper.selectByBusinessBaseSampleId(currBatchFirstBusinessSampleEntrustDetailDO.getBusinessBaseSampleId()); + List currBusinessSubParentSampleIdList = currBusinessSubParentSampleDOList.stream().map(m -> m.getId()).collect(Collectors.toList()); + List businessSubParentSampleAssessmentProjectList = businessSubParentSampleAssessmentProjectMapper.selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(currBusinessSubParentSampleIdList, configMethodId); + BusinessSubParentSampleAssessmentProjectExtendRespVO businessSubParentSampleAssessmentProject = businessSubParentSampleAssessmentProjectList.stream().filter(f -> f.getSimpleName().equals(sourceProject)).findFirst().orElse(null); + if (businessSubParentSampleAssessmentProject != null && StringUtils.isNotBlank(businessSubParentSampleAssessmentProject.getAssessmentValue())) { + businessAssayParameterDataDO.setValue(businessSubParentSampleAssessmentProject.getAssessmentValue()); + } + } else if (QmsCommonConstant.ENTRUST_COMPREHENSIVE_INSPECTION_SAMPLE.equals(baseSampleDO.getDictionaryBusinessKey())) {//如果是商检综合样 + //查询当前样品的其他分析方法的结果 + List businessSubParentSampleIdList = Arrays.asList(businessAssayTaskDataDO.getBusinessSubParentSampleId()); + List businessSubParentSampleAssessmentProjectList = businessSubParentSampleAssessmentProjectMapper.selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(businessSubParentSampleIdList, configMethodId); + BusinessSubParentSampleAssessmentProjectExtendRespVO businessSubParentSampleAssessmentProject = businessSubParentSampleAssessmentProjectList.stream().filter(f -> f.getSimpleName().equals(sourceProject)).findFirst().orElse(null); + if (businessSubParentSampleAssessmentProject != null && StringUtils.isNotBlank(businessSubParentSampleAssessmentProject.getAssessmentValue())) { + businessAssayParameterDataDO.setValue(businessSubParentSampleAssessmentProject.getAssessmentValue()); + } + } else if (QmsCommonConstant.ENTRUST_COMMISSION_INSPECTION_SAMPLE.equals(baseSampleDO.getDictionaryBusinessKey())) {//如果是委检样 + //查询来样品位 + Boolean isForecastS = false; + String forecastValue = null; + String forecastResult = businessSampleEntrustDetailDO.getForecastResult(); + if (StringUtils.isNotBlank(forecastResult)) { + JSONArray array = JSON.parseArray(forecastResult); + for (int i = 0; i < array.size(); i++) { + JSONObject item = array.getJSONObject(i); + if ("S".equals(item.getString("simpleName"))) { + isForecastS = true; + break; + } + } + for (int i = 0; i < array.size(); i++) { + JSONObject item = array.getJSONObject(i); + if (sourceProject.equals(item.getString("simpleName"))) { + forecastValue = item.getString("value"); + break; + } + } + } + if (isForecastS) {//来样品位存在S值, 则取预报的值 + businessAssayParameterDataDO.setValue(forecastValue); + } else { + //查询当前样品的其他方法的结果 + List businessSubParentSampleIdList = Arrays.asList(businessAssayTaskDataDO.getBusinessSubParentSampleId()); + List businessSubParentSampleAssessmentProjectList = businessSubParentSampleAssessmentProjectMapper.selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(businessSubParentSampleIdList, configMethodId); + BusinessSubParentSampleAssessmentProjectExtendRespVO businessSubParentSampleAssessmentProject = businessSubParentSampleAssessmentProjectList.stream().filter(f -> f.getSimpleName().equals(sourceProject)).findFirst().orElse(null); + if (businessSubParentSampleAssessmentProject != null && StringUtils.isNotBlank(businessSubParentSampleAssessmentProject.getAssessmentValue())) { + businessAssayParameterDataDO.setValue(businessSubParentSampleAssessmentProject.getAssessmentValue()); + } + } + + } + + //处理已查询的数据 + BusinessAssayProjectAndParameterRespVO businessAssayProjectAndParameterRespVO = businessAssayParameterDataList.stream().filter(f -> f.getBizId().equals(businessAssayParameterDataDO.getBusinessAssayProjectDataId()) && f.getDicId().equals(businessAssayParameterDataDO.getConfigAssayMethodProjectParameterId()) ).findFirst().orElse(null); + if (businessAssayProjectAndParameterRespVO != null) { + businessAssayProjectAndParameterRespVO.setValue(businessAssayParameterDataDO.getValue()); + } + + //更新 + businessAssayParameterDataMapper.updateById(businessAssayParameterDataDO); + } + } + } + Map map = new HashedMap<>(); map.put("businessAssayTaskDataId", businessAssayTaskDataDO.getId()); @@ -518,16 +749,25 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService { map.put("sampleCode", businessAssayTaskDetailDO.getSampleCode()); map.put("sampleName", businessAssayTaskDetailDO.getSampleName()); map.put("rollbackStatus", businessAssayTaskDetailDO.getRollbackStatus()); + + + //List taskParameterList2 = businessAssayTaskParameterDataMapper.selectByBusinessAssayTaskDataIds(Arrays.asList(businessAssayTaskDataDO.getId())); + List taskParameterList2 = taskParameterList.stream().filter(f -> f.getBizId().equals(businessAssayTaskDataDO.getId())).collect(Collectors.toList()); + for (BusinessAssayProjectAndParameterRespVO taskParameter : taskParameterList2) { + map.put("a" + taskParameter.getDicId(), taskParameter); + } - BusinessAssayProjectDataReqVO projectDataSearch2 = new BusinessAssayProjectDataReqVO(); - projectDataSearch2.setBusinessAssayTaskDataId(businessAssayTaskDataDO.getId()); - List projectAndParameterList2 = businessAssayProjectDataMapper.selectProjectAndParameterBy(projectDataSearch2); + //BusinessAssayProjectDataReqVO projectDataSearch2 = new BusinessAssayProjectDataReqVO(); + //projectDataSearch2.setBusinessAssayTaskDataId(businessAssayTaskDataDO.getId()); + //List projectAndParameterList2 = businessAssayProjectDataMapper.selectProjectAndParameterBy(projectDataSearch2); + List projectAndParameterList2 = projectAndParameterList.stream().filter(f -> f.getBizId().equals(businessAssayTaskDataDO.getId())).collect(Collectors.toList()); for (BusinessAssayProjectAndParameterRespVO ep : projectAndParameterList2) { map.put("e" + ep.getDicId(), ep); if (StringUtils.isNotEmpty(ep.getFormula())) { - BusinessAssayParameterDataReqVO parameterDataSearch = new BusinessAssayParameterDataReqVO(); - parameterDataSearch.setBusinessAssayProjectDataId(ep.getId()); - List plist = businessAssayParameterDataMapper.selectProjectAndParameterBy(parameterDataSearch); + //BusinessAssayParameterDataReqVO parameterDataSearch = new BusinessAssayParameterDataReqVO(); + //parameterDataSearch.setBusinessAssayProjectDataId(ep.getId()); + //List plist = businessAssayParameterDataMapper.selectProjectAndParameterBy(parameterDataSearch); + List plist = businessAssayParameterDataList.stream().filter(f -> f.getBizId().equals(ep.getId())).collect(Collectors.toList()); for (BusinessAssayProjectAndParameterRespVO p : plist) { map.put("p" + p.getDicId(), p); } @@ -545,7 +785,8 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService { private List getQcAnalysis(BusinessAssayTaskDO businessAssayTaskDO) { List list = new ArrayList<>(); - + + String minWidth = "200px"; List configQCSampleMethodList = configQCSampleMethodMapper.selectByConfigAssayMethodId(businessAssayTaskDO.getConfigAssayMethodId()); BusinessAssayTaskAnalysisDataRespVO businessAssayTaskAnalysisDataRespVO = null; for (ConfigQCSampleMethodExtendRespVO configQCSampleMethodExtendRespVO : configQCSampleMethodList) { @@ -557,12 +798,12 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService { //处理列 List cloumns = new ArrayList<>(); - cloumns.add(new BatchSampleAnalysisColumnRespVO("sampleCode", "sampleCode", "样品编号", "200px", "200px", "string", null, null, null, null, false, null, null, null, null, null, null)); - cloumns.add(new BatchSampleAnalysisColumnRespVO("sampleName", "sampleName", "样品名称", "200px", "200px", "string", null, null, null, null, false, null, null, null, null, null, null)); + cloumns.add(new BatchSampleAnalysisColumnRespVO("sampleCode", "sampleCode", "样品编号", minWidth, minWidth, "string", null, null, null, null, false, null, null, null, null, null, null)); + cloumns.add(new BatchSampleAnalysisColumnRespVO("sampleName", "sampleName", "样品名称", minWidth, minWidth, "string", null, null, null, null, false, null, null, null, null, null, null)); //处理数据 List> datas = new ArrayList<>(); - if ("kby".equals(configQCSampleMethodExtendRespVO.getDictionaryBusinessKey()) || "by".equals(configQCSampleMethodExtendRespVO.getDictionaryBusinessKey())) { + if ("withoutProject".equals(configQCSampleMethodExtendRespVO.getParentDictionaryBusinesskey())) {//不带检测项目 List businessQCCoefficientDataDOList = businessQCCoefficientDataMapper.selectByBusinessAssayTaskIdAndDictionaryBusinessKey(businessAssayTaskDO.getId(), configQCSampleMethodExtendRespVO.getDictionaryBusinessKey()); if (CollUtil.isEmpty(businessQCCoefficientDataDOList)) { break; @@ -576,7 +817,7 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService { String fieldIndex = "p" + p.getDicId(); String title = p.getShowName() + (StringUtils.isBlank(p.getUnit()) ? "" : "(" + p.getUnit() + ")"); boolean isEdit = StringUtils.isBlank(p.getFormula()); - cloumns.add(new BatchSampleAnalysisColumnRespVO(fieldIndex, fieldIndex + ".value", title, "", "120px", p.getDataType(), p.getDecimalPosition(), null, p.getFormula(), p.getParamNo(), isEdit, p.getUnit(), "parameter", p.getFillingWay(), p.getGroupDictionaryBusinessId(), p.getGroupDictionaryBusinessKey(), p.getGroupDictionaryBusinessName())); + cloumns.add(new BatchSampleAnalysisColumnRespVO(fieldIndex, fieldIndex + ".value", title, "", minWidth, p.getDataType(), p.getDecimalPosition(), null, p.getFormula(), p.getParamNo(), isEdit, p.getUnit(), "parameter", p.getFillingWay(), p.getGroupDictionaryBusinessId(), p.getGroupDictionaryBusinessKey(), p.getGroupDictionaryBusinessName())); } @@ -599,15 +840,29 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService { } datas.add(map); } - - - } else { - List businessQCManagementDataDOList = businessQCManagementDataMapper.selectByBusinessAssayTaskId(businessAssayTaskDO.getId()); + } else {//带检测项目 + List businessQCManagementDataDOList = businessQCManagementDataMapper.selectByBusinessAssayTaskIdAndDictionaryBusinessKey(businessAssayTaskDO.getId(), configQCSampleMethodExtendRespVO.getDictionaryBusinessKey()); if (CollUtil.isEmpty(businessQCManagementDataDOList)) { break; } BusinessQCManagementDataDO businessQCManagementDataDO = businessQCManagementDataDOList.get(0); + + + //任务参数查询 + List taskParameterList = businessQCManagementSampleParameterDataMapper.selectByBusinessQCManagementDataIds(Arrays.asList(businessQCManagementDataDO.getId())); + Map> taskParameterMap = taskParameterList.stream().sorted(Comparator.comparing(BusinessAssayProjectAndParameterRespVO::getParamNo)).collect(Collectors.groupingBy(BusinessAssayProjectAndParameterRespVO::getDicId, + LinkedHashMap::new, // 保持组首次出现的顺序(可选) + Collectors.toList() // ArrayList 保持组内顺序 + )); + for (Map.Entry> entry : taskParameterMap.entrySet()) { + BusinessAssayProjectAndParameterRespVO taskParameter = entry.getValue().get(0); + String fieldIndex = "a" + taskParameter.getDicId(); + String title = taskParameter.getShowName() + (StringUtils.isBlank(taskParameter.getUnit()) ? "" : "(" + taskParameter.getUnit() + ")"); + boolean isEdit = StringUtils.isBlank(taskParameter.getFormula()); + cloumns.add(new BatchSampleAnalysisColumnRespVO(fieldIndex, fieldIndex + ".value", title, "", minWidth, taskParameter.getDataType(), taskParameter.getDecimalPosition(), null, taskParameter.getFormula(), taskParameter.getParamNo(), isEdit, taskParameter.getUnit(), "attribute", taskParameter.getFillingWay(), taskParameter.getGroupDictionaryBusinessId(), taskParameter.getGroupDictionaryBusinessKey(), taskParameter.getGroupDictionaryBusinessName())); + } + BusinessQCManagementProjectDataReqVO projectDataSearch = new BusinessQCManagementProjectDataReqVO(); projectDataSearch.setBusinessQCManagementDataId(businessQCManagementDataDO.getId()); @@ -616,7 +871,14 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService { String fieldIndex = "e" + ep.getDicId(); String title = ep.getShowName() + (StringUtils.isBlank(ep.getUnit()) ? "" : "(" + ep.getUnit() + ")"); boolean isEdit = StringUtils.isBlank(ep.getFormula()); - cloumns.add(new BatchSampleAnalysisColumnRespVO(fieldIndex, fieldIndex + ".value", title, "", "120px", ep.getDataType(), ep.getDecimalPosition(), null, ep.getFormula(), ep.getParamNo(), isEdit, ep.getUnit(), "project", ep.getFillingWay(), ep.getGroupDictionaryBusinessId(), ep.getGroupDictionaryBusinessKey(), ep.getGroupDictionaryBusinessName())); + if ("zkkby".equals(configQCSampleMethodExtendRespVO.getDictionaryBusinessKey()) && StringUtils.isNotBlank(ep.getFormula()) && ep.getFormula().startsWith("From")) { + isEdit = true; + ep.setFormula(null); + } + if (isEdit) { + minWidth = "280px"; + } + cloumns.add(new BatchSampleAnalysisColumnRespVO(fieldIndex, fieldIndex + ".value", title, "", minWidth, ep.getDataType(), ep.getDecimalPosition(), null, ep.getFormula(), ep.getParamNo(), isEdit, ep.getUnit(), "project", ep.getFillingWay(), ep.getGroupDictionaryBusinessId(), ep.getGroupDictionaryBusinessKey(), ep.getGroupDictionaryBusinessName())); if (StringUtils.isNotEmpty(ep.getFormula())) { BusinessQCManagementParameterDataReqVO parameterDataSearch = new BusinessQCManagementParameterDataReqVO(); @@ -626,7 +888,11 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService { fieldIndex = "p" + p.getDicId(); title = p.getShowName() + (StringUtils.isBlank(p.getUnit()) ? "" : "(" + p.getUnit() + ")"); isEdit = StringUtils.isBlank(p.getFormula()); - cloumns.add(new BatchSampleAnalysisColumnRespVO(fieldIndex, fieldIndex + ".value", title, "", "120px", p.getDataType(), p.getDecimalPosition(), null, p.getFormula(), p.getParamNo(), isEdit, p.getUnit(), "parameter", p.getFillingWay(), p.getGroupDictionaryBusinessId(), p.getGroupDictionaryBusinessKey(), p.getGroupDictionaryBusinessName())); + if ("zkkby".equals(configQCSampleMethodExtendRespVO.getDictionaryBusinessKey()) && StringUtils.isNotBlank(p.getFormula()) && p.getFormula().startsWith("From")) { + isEdit = true; + p.setFormula(null); + } + cloumns.add(new BatchSampleAnalysisColumnRespVO(fieldIndex, fieldIndex + ".value", title, "", minWidth, p.getDataType(), p.getDecimalPosition(), null, p.getFormula(), p.getParamNo(), isEdit, p.getUnit(), "parameter", p.getFillingWay(), p.getGroupDictionaryBusinessId(), p.getGroupDictionaryBusinessKey(), p.getGroupDictionaryBusinessName())); } } } @@ -641,6 +907,12 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService { map.put("businessAssayTaskDetailId", ""); map.put("sampleCode", businessQCManagementData.getSampleCode()); map.put("sampleName", businessQCManagementData.getSampleName()); + + List taskParameterList2 = businessQCManagementSampleParameterDataMapper.selectByBusinessQCManagementDataIds(Arrays.asList(businessQCManagementData.getId())); + for (BusinessAssayProjectAndParameterRespVO taskParameter : taskParameterList2) { + map.put("a" + taskParameter.getDicId(), taskParameter); + } + BusinessQCManagementProjectDataReqVO projectDataSearch2 = new BusinessQCManagementProjectDataReqVO(); projectDataSearch2.setBusinessQCManagementDataId(businessQCManagementData.getId()); @@ -685,18 +957,25 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService { } List assayTaskAnalysisDataList = vo.getAssayTaskAnalysisDataList(); + + List dictionaryBusinessItemList = dictionaryBusinessMapper.selectItemByCategoryKeys(Arrays.asList("withProject", "withoutProject")); + if (CollUtil.isNotEmpty(assayTaskAnalysisDataList)) { for (BusinessAssayTaskAnalysisDataRespVO businessAssayTaskAnalysisDataRespVO : assayTaskAnalysisDataList) { - if ("analysis".equals(businessAssayTaskAnalysisDataRespVO.getAnalysisType())) { + DictionaryBusinessExtendRespVO dictionaryBusinessItem = dictionaryBusinessItemList.stream().filter(f -> f.getKey().equals(businessAssayTaskAnalysisDataRespVO.getAnalysisType())).findFirst().orElse(null); + if ("analysis".equals(businessAssayTaskAnalysisDataRespVO.getAnalysisType())) {//分析样 List businessAssayTaskDataList = businessAssayTaskDataMapper.selectList(new LambdaQueryWrapperX().eq(BusinessAssayTaskDataDO::getBusinessAssayTaskId, vo.getBusinessAssayTaskId()).eq(BusinessAssayTaskDataDO::getConfigAssayMethodId, businessAssayTaskDO.getConfigAssayMethodId())); List businessAssayTaskDataIdList = businessAssayTaskDataList.stream().map(m -> m.getId()).collect(Collectors.toList()); + List businessAssayTaskParameterDataList = businessAssayTaskParameterDataMapper.selectList(new LambdaQueryWrapperX().in(BusinessAssayTaskParameterDataDO::getBusinessAssayTaskDataId, businessAssayTaskDataIdList)); + List businessAssayProjectDataList = businessAssayProjectDataMapper.selectList(new LambdaQueryWrapperX().in(BusinessAssayProjectDataDO::getBusinessAssayTaskDataId, businessAssayTaskDataIdList)); List businessAssayProjectDataIdList = businessAssayProjectDataList.stream().map(m -> m.getId()).collect(Collectors.toList()); List businessAssayParameterDataList = businessAssayParameterDataMapper.selectList(new LambdaQueryWrapperX().in(BusinessAssayParameterDataDO::getBusinessAssayProjectDataId, businessAssayProjectDataIdList)); + List> datas = businessAssayTaskAnalysisDataRespVO.getDatas(); for (Map map : datas) { @@ -714,6 +993,7 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService { if ("project".equals(pap.getType())) { BusinessAssayProjectDataDO businessAssayProjectDataDO = businessAssayProjectDataList.stream().filter(f -> f.getId().equals(pap.getId())).findFirst().orElse(null); if (StringUtils.isNotBlank(pap.getValue())) { + businessAssayProjectDataDO.setSymbol(pap.getSymbol()); String dataType = pap.getDataType();//string-字符串,int-整数,decimal-小数,date-日期,datetime-时间 switch (dataType) { case "int": @@ -738,6 +1018,7 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService { } else if ("parameter".equals(pap.getType())) { BusinessAssayParameterDataDO businessAssayParameterDataDO = businessAssayParameterDataList.stream().filter(f -> f.getId().equals(pap.getId())).findFirst().orElse(null); if (StringUtils.isNotBlank(pap.getValue())) { + businessAssayParameterDataDO.setSymbol(pap.getSymbol()); String dataType = pap.getDataType();//string-字符串,int-整数,decimal-小数,date-日期,datetime-时间 switch (dataType) { case "int": @@ -759,11 +1040,39 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService { } else { businessAssayParameterDataDO.setValue(null); } + } else if ("attribute".equals(pap.getType())) { + BusinessAssayTaskParameterDataDO businessAssayTaskParameterDataDO = businessAssayTaskParameterDataList.stream().filter(f -> f.getId().equals(pap.getId())).findFirst().orElse(null); + if (StringUtils.isNotBlank(pap.getValue())) { + String dataType = pap.getDataType();//string-字符串,int-整数,decimal-小数,date-日期,datetime-时间 + switch (dataType) { + case "int": + case "date": + case "datetime": + case "string": + businessAssayTaskParameterDataDO.setValue(pap.getValue()); + businessAssayTaskParameterDataDO.setRemark(pap.getShowName() + ": " + pap.getValue()); + break; + case "decimal": + BigDecimal value = new BigDecimal(pap.getValue()); + value = value.setScale(pap.getDecimalPosition(), RoundingMode.HALF_EVEN); + businessAssayTaskParameterDataDO.setValue(value.toPlainString()); + businessAssayTaskParameterDataDO.setRemark(pap.getShowName() + ": " + value.toPlainString()); + break; + default: + throw new IllegalArgumentException("Unexpected value: " + dataType); + } + } else { + businessAssayTaskParameterDataDO.setValue(null); + } } } } + if (CollUtil.isNotEmpty(businessAssayTaskParameterDataList)) { + businessAssayTaskParameterDataMapper.updateBatch(businessAssayTaskParameterDataList); + } + if (CollUtil.isNotEmpty(businessAssayProjectDataList)) { businessAssayProjectDataMapper.updateBatch(businessAssayProjectDataList); } @@ -771,10 +1080,12 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService { businessAssayParameterDataMapper.updateBatch(businessAssayParameterDataList); } - } else if ("zky".equals(businessAssayTaskAnalysisDataRespVO.getAnalysisType())) { + } else if (dictionaryBusinessItem != null && "withProject".equals(dictionaryBusinessItem.getParentDictionaryBusinesskey())) {//带检测项目 List BusinessQCManagementDataList = businessQCManagementDataMapper.selectByBusinessAssayTaskId(businessAssayTaskDO.getId()); List businessQCManagementDataIdList = BusinessQCManagementDataList.stream().map(m -> m.getId()).collect(Collectors.toList()); + + List businessQCManagementSampleParameterDataDOList = businessQCManagementSampleParameterDataMapper.selectList(new LambdaQueryWrapperX().in(BusinessQCManagementSampleParameterDataDO::getBusinessQCManagementDataId, businessQCManagementDataIdList)); List businessQCManagementProjectDataList = businessQCManagementProjectDataMapper.selectByBusinessQCManagementDataIds(businessQCManagementDataIdList); List businessQCManagementProjectDataIdList = businessQCManagementProjectDataList.stream().map(m -> m.getId()).collect(Collectors.toList()); @@ -798,6 +1109,7 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService { if ("project".equals(pap.getType())) { BusinessQCManagementProjectDataDO businessQCManagementProjectDataDO = businessQCManagementProjectDataList.stream().filter(f -> f.getId().equals(pap.getId())).findFirst().orElse(null); if (StringUtils.isNotBlank(pap.getValue())) { + businessQCManagementProjectDataDO.setSymbol(pap.getSymbol()); String dataType = pap.getDataType();//string-字符串,int-整数,decimal-小数,date-日期,datetime-时间 switch (dataType) { case "int": @@ -822,6 +1134,7 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService { } else if ("parameter".equals(pap.getType())) { BusinessQCManagementParameterDataDO businessQCManagementParameterDataDO = businessQCManagementParameterDataList.stream().filter(f -> f.getId().equals(pap.getId())).findFirst().orElse(null); if (StringUtils.isNotBlank(pap.getValue())) { + businessQCManagementParameterDataDO.setSymbol(pap.getSymbol()); String dataType = pap.getDataType();//string-字符串,int-整数,decimal-小数,date-日期,datetime-时间 switch (dataType) { case "int": @@ -843,11 +1156,39 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService { } else { businessQCManagementParameterDataDO.setValue(null); } + } else if ("attribute".equals(pap.getType())) { + BusinessQCManagementSampleParameterDataDO businessQCManagementSampleParameterDataDO = businessQCManagementSampleParameterDataDOList.stream().filter(f -> f.getId().equals(pap.getId())).findFirst().orElse(null); + if (StringUtils.isNotBlank(pap.getValue())) { + String dataType = pap.getDataType();//string-字符串,int-整数,decimal-小数,date-日期,datetime-时间 + switch (dataType) { + case "int": + case "date": + case "datetime": + case "string": + businessQCManagementSampleParameterDataDO.setValue(pap.getValue()); + businessQCManagementSampleParameterDataDO.setRemark(pap.getShowName() + ": " + pap.getValue()); + break; + case "decimal": + BigDecimal value = new BigDecimal(pap.getValue()); + value = value.setScale(pap.getDecimalPosition(), RoundingMode.HALF_EVEN); + businessQCManagementSampleParameterDataDO.setValue(value.toPlainString()); + businessQCManagementSampleParameterDataDO.setRemark(pap.getShowName() + ": " + value.toPlainString()); + break; + default: + throw new IllegalArgumentException("Unexpected value: " + dataType); + } + } else { + businessQCManagementSampleParameterDataDO.setValue(null); + } } } } + if (CollUtil.isNotEmpty(businessQCManagementSampleParameterDataDOList)) { + businessQCManagementSampleParameterDataMapper.updateBatch(businessQCManagementSampleParameterDataDOList); + } + if (CollUtil.isNotEmpty(businessQCManagementProjectDataList)) { businessQCManagementProjectDataMapper.updateBatch(businessQCManagementProjectDataList); } @@ -855,7 +1196,7 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService { if (CollUtil.isNotEmpty(businessQCManagementParameterDataList)) { businessQCManagementParameterDataMapper.updateBatch(businessQCManagementParameterDataList); } - } else { + } else { //不带检测项目的 List businessQCCoefficientDataList = businessQCCoefficientDataMapper.selectByBusinessAssayTaskId(businessAssayTaskDO.getId()); List businessQCCoefficientDataIdList = businessQCCoefficientDataList.stream().map(m -> m.getId()).collect(Collectors.toList()); @@ -879,6 +1220,7 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService { if ("parameter".equals(pap.getType())) { BusinessQCCoefficientParameterDataDO businessQCCoefficientParameterDataDO = businessQCCoefficientParameterDataList.stream().filter(f -> f.getId().equals(pap.getId())).findFirst().orElse(null); if (StringUtils.isNotBlank(pap.getValue())) { + businessQCCoefficientParameterDataDO.setSymbol(pap.getSymbol()); String dataType = pap.getDataType();//string-字符串,int-整数,decimal-小数,date-日期,datetime-时间 switch (dataType) { case "int": @@ -923,8 +1265,8 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService { BusinessAssayTaskDO businessAssayTaskDO = businessAssayTaskMapper.selectById(businessAssayTaskId); businessAssayTaskDO.setTaskAssayStatus(QmsCommonConstant.SUBMITTED); businessAssayTaskDO.setAssaySubmitTime(LocalDateTime.now()); - businessAssayTaskDO.setFinishStatus(QmsCommonConstant.NOT_START); - businessAssayTaskDO.setFlowStatus(QmsCommonConstant.NOT_START); + businessAssayTaskDO.setFinishStatus(QmsCommonConstant.IN_PROGRESS); + businessAssayTaskDO.setFlowStatus(QmsCommonConstant.IN_PROGRESS); businessAssayTaskMapper.updateById(businessAssayTaskDO); } @@ -998,7 +1340,7 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService { //子样配置id列表 List configSubSampleIdList = businessSubSampleDOList.stream().map(m -> m.getConfigSubSampleId()).distinct().collect(Collectors.toList()); //子样配置方法 - List configSubSampleMethodList = configSubSampleMethodMapper.selectByConfigSubSampleIdsAndConfigAssayMethodId(configSubSampleIdList, businessAssayTaskDO.getConfigAssayMethodId()); + List configSubSampleMethodList = configSubSampleMethodMapper.selectByConfigSubSampleIdsAndConfigAssayMethodId(configSubSampleIdList, businessAssayTaskDO.getConfigAssayMethodId()); List businessAssayProjectDataList = businessAssayProjectDataMapper.selectByBusinessAssayTaskDataIds(businessAssayTaskDataIdList); List businessAssayProjectDataIdList = businessAssayProjectDataList.stream().map(m -> m.getId()).collect(Collectors.toList()); @@ -1010,7 +1352,7 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService { BusinessSubSampleDO businessSubSampleDO = businessSubSampleDOList.stream().filter(f -> f.getId().equals(businessAssayTaskDataDO.getBusinessSubSampleId())).findFirst().orElse(null); //子样配置信息 - ConfigSubSampleMethodDO configSubSampleMethodDO = configSubSampleMethodList.stream().filter(f -> f.getConfigSubSampleId().equals(businessSubSampleDO.getConfigSubSampleId())).findFirst().orElse(null); + ConfigSubSampleMethodExtendRespVO configSubSampleMethodDO = configSubSampleMethodList.stream().filter(f -> f.getConfigSubSampleId().equals(businessSubSampleDO.getConfigSubSampleId())).findFirst().orElse(null); String configInfomation = configSubSampleMethodDO.getConfigInfomation(); if (StringUtils.isNotBlank(configInfomation)) { ConfigSubSampleMethodConfInfo configSubSampleMethodConfInfo = JSON.parseObject(configInfomation, ConfigSubSampleMethodConfInfo.class); diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleEntrustServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleEntrustServiceImpl.java index de5792d..d88c058 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleEntrustServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleEntrustServiceImpl.java @@ -2,6 +2,7 @@ package com.zt.plat.module.qms.business.bus.service; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.stream.Collectors; import org.springframework.stereotype.Service; @@ -114,21 +115,22 @@ public class SampleEntrustServiceImpl implements SampleEntrustService { sampleEntrustRegistration.put(key, value); }); - JSONArray jsonArray = new JSONArray(); - jsonArray.add(sampleEntrustRegistration); - - List sampleEntrustDetailExtendRespVOList = new ArrayList<>(); - List sampleEntrustDetailList = businessSampleEntrustDetailMapper.selectByBusinessSampleEntrustRegistrationId(id); - BusinessSampleEntrustDetailExtendRespVO businessSampleEntrustDetailExtendRespVO = null; - for (BusinessSampleEntrustDetailDO businessSampleEntrustDetailDO : sampleEntrustDetailList) { - businessSampleEntrustDetailExtendRespVO = BeanUtils.toBean(businessSampleEntrustDetailDO, BusinessSampleEntrustDetailExtendRespVO.class); - - List businessSampleEntrustProjectExtendRespVOList = businessSampleEntrustProjectMapper.selectByBusinessSampleEntrustDetailId(businessSampleEntrustDetailDO.getId()); + List sampleEntrustDetailExtendRespVOList = businessSampleEntrustDetailMapper.selectExtendByBusinessSampleEntrustRegistrationId(id); + for (BusinessSampleEntrustDetailExtendRespVO businessSampleEntrustDetailExtendRespVO : sampleEntrustDetailExtendRespVOList) { + List businessSampleEntrustProjectExtendRespVOList = businessSampleEntrustProjectMapper.selectByBusinessSampleEntrustDetailId(businessSampleEntrustDetailExtendRespVO.getId()); businessSampleEntrustDetailExtendRespVO.setSampleEntrustDetailProjectList(businessSampleEntrustProjectExtendRespVOList); - - sampleEntrustDetailExtendRespVOList.add(businessSampleEntrustDetailExtendRespVO); } + //样品类型分组统计 + Map groupMap = sampleEntrustDetailExtendRespVOList.stream().collect(Collectors.groupingBy(BusinessSampleEntrustDetailExtendRespVO::getSampleTypeDictionaryBusinessKey, Collectors.counting())); + for (Map.Entry entry : groupMap.entrySet()) { + String key = entry.getKey(); + Long val = entry.getValue(); + sampleEntrustRegistration.put(key + "Count", val); + } + + JSONArray jsonArray = new JSONArray(); + jsonArray.add(sampleEntrustRegistration); String sampleEntrustDetailJsonString = JSON.toJSONString(sampleEntrustDetailExtendRespVOList, context); result.put("sampleEntrustRegistration", jsonArray); @@ -250,6 +252,7 @@ public class SampleEntrustServiceImpl implements SampleEntrustService { LiteflowResponse response = flowExecutor.execute2Resp("sampleEntrustSubmitChain" + tenantId, sampleEntrustParam, SampleEntrustContext.class); if (!response.isSuccess()){ log.error("提交委托登记失败", response.getCause()); + response.getCause().printStackTrace(); throw new ServiceException(1_032_100_000, response.getCause().getMessage()); } } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleResultReportingService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleResultReportingService.java index 3c33c1d..d57ed8c 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleResultReportingService.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleResultReportingService.java @@ -14,7 +14,7 @@ public interface SampleResultReportingService { List getUnReportMethodGroupList(BusinessSubParentSampleAssessmentGroupReqVO reqVO); - JSONObject getSampleResultReportingList(Long configAssayMethodId); + JSONObject getSampleResultReportingList(BusinessSubParentSampleAssessmentGroupReqVO reqVO); List getRecheckAssayMethodList(Long baseSampleId, Long businessSubParentSampleId, Long configAssayMethodId); diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleResultReportingServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleResultReportingServiceImpl.java index 668f6aa..8042b20 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleResultReportingServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleResultReportingServiceImpl.java @@ -1,5 +1,6 @@ package com.zt.plat.module.qms.business.bus.service; +import java.math.BigDecimal; import java.time.LocalDateTime; import java.util.ArrayList; import java.util.Arrays; @@ -16,9 +17,15 @@ import org.springframework.transaction.annotation.Transactional; import com.alibaba.cloud.commons.lang.StringUtils; import com.alibaba.fastjson2.JSON; import com.alibaba.fastjson2.JSONObject; +import com.alibaba.fastjson2.TypeReference; +import com.alibaba.qlexpress4.Express4Runner; +import com.alibaba.qlexpress4.QLOptions; +import com.alibaba.qlexpress4.QLResult; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.toolkit.IdWorker; +import com.zt.plat.framework.common.exception.ServiceException; import com.zt.plat.framework.common.util.object.BeanUtils; +import com.zt.plat.framework.security.core.LoginUser; import com.zt.plat.framework.security.core.util.SecurityFrameworkUtils; import com.zt.plat.module.qms.business.bus.controller.vo.BatchResultDataReportingReqVO; import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubParentSampleAssessmentProjectExtendRespVO; @@ -36,25 +43,31 @@ import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayProjectDa import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayReportDataDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDataDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessBaseSampleDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleEntrustDetailDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleEntrustRegistrationDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubParentSampleAssessmentDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubParentSampleAssessmentProjectDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubParentSampleDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleAnalysisGroupDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleAssessmentDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleAssessmentProjectDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleDO; -import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleParentRecheckDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleParentRetestDO; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayParameterDataMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayProjectDataMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayReportDataMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayTaskDataMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessBaseSampleMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSampleEntrustDetailMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSampleEntrustRegistrationMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubParentSampleAssessmentMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubParentSampleAssessmentProjectMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubParentSampleMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubSampleAnalysisGroupMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubSampleAssessmentMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubSampleAssessmentProjectMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubSampleMapper; -import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubSampleParentRecheckMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubSampleParentRetestMapper; import com.zt.plat.module.qms.business.bus.liteflow.param.SampleFlowInfo; import com.zt.plat.module.qms.business.bus.liteflow.param.SampleFlowParam; import com.zt.plat.module.qms.business.config.controller.vo.ConfigAssayMethodProjectExtendRespVO; @@ -62,6 +75,7 @@ import com.zt.plat.module.qms.business.config.controller.vo.ConfigAssayMethodRes import com.zt.plat.module.qms.business.config.controller.vo.ConfigProjectExtendRespVO; import com.zt.plat.module.qms.business.config.controller.vo.ConfigSampleReportExtendRespVO; import com.zt.plat.module.qms.business.config.controller.vo.ConfigSampleReportReqVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSampleMethodExtendRespVO; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodDO; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectDO; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectParameterDO; @@ -88,9 +102,15 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe @Resource private BusinessAssayTaskDataMapper businessAssayTaskDataMapper; + @Resource + private BusinessSubParentSampleAssessmentMapper businessSubParentSampleAssessmentMapper; + @Resource private BusinessSubParentSampleAssessmentProjectMapper businessSubParentSampleAssessmentProjectMapper; + @Resource + private BusinessSubSampleAssessmentMapper businessSubSampleAssessmentMapper; + @Resource private BusinessSubSampleAssessmentProjectMapper businessSubSampleAssessmentProjectMapper; @@ -111,8 +131,8 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe } @Override - public JSONObject getSampleResultReportingList(Long configAssayMethodId) { - List configAssayMethodProjectDOList = configAssayMethodProjectMapper.selectByConfigAssayMethodId(configAssayMethodId); + public JSONObject getSampleResultReportingList(BusinessSubParentSampleAssessmentGroupReqVO reqVO) { + List configAssayMethodProjectDOList = configAssayMethodProjectMapper.selectByConfigAssayMethodId(reqVO.getConfigAssayMethodId()); List> columnList = new ArrayList<>(); //动态字段 @@ -132,7 +152,7 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe List> dataList = new ArrayList<>(); //查询结果报送未上报的样品 - List noReportSubParentSampleAssessmentRespList = businessSubParentSampleAssessmentProjectMapper.selectNoReportSubParentSampleAssessment(configAssayMethodId); + List noReportSubParentSampleAssessmentRespList = businessSubParentSampleAssessmentProjectMapper.selectNoReportSubParentSampleAssessment(reqVO); if (CollUtil.isEmpty(noReportSubParentSampleAssessmentRespList)) {//没有查询到未上报的数据 JSONObject json = new JSONObject(); @@ -144,18 +164,18 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe //分样id列表 List businessSubParentSampleIds = noReportSubParentSampleAssessmentRespList.stream().map(m -> m.getBusinessSubParentSampleId()).collect(Collectors.toList()); //报送的检测项目数据 - List businessSubParentSampleAssessmentDOList = businessSubParentSampleAssessmentProjectMapper.selectByBusinessSubParentSampleIdAndConfigAssayMethodId(businessSubParentSampleIds, configAssayMethodId); + List businessSubParentSampleAssessmentDOList = businessSubParentSampleAssessmentProjectMapper.selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(businessSubParentSampleIds, reqVO.getConfigAssayMethodId()); //获取分析任务数 - List businessAssayTaskDataDOList = businessAssayTaskDataMapper.selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(businessSubParentSampleIds, configAssayMethodId); + List businessAssayTaskDataDOList = businessAssayTaskDataMapper.selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(businessSubParentSampleIds, reqVO.getConfigAssayMethodId()); List businessSubSampleIds = businessAssayTaskDataDOList.stream().map(m -> m.getBusinessSubSampleId()).distinct().collect(Collectors.toList()); //获取子样数据 List businessSubSampleDOList = businessSubSampleMapper.selectByIds(businessSubSampleIds); //获取结果判定数据 - List businessSubSampleAssessmentExtendRespVOList = businessSubSampleAssessmentProjectMapper.selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(businessSubParentSampleIds, configAssayMethodId); + List businessSubSampleAssessmentExtendRespVOList = businessSubSampleAssessmentProjectMapper.selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(businessSubParentSampleIds, reqVO.getConfigAssayMethodId()); //获取复测业务数据 - List businessSubSampleParentRecheckDOList = businessSubSampleParentRecheckMapper.selectByRecheckBusinessSubParentSampleIdsAndRecheckConfigAssayMethodId(businessSubParentSampleIds, configAssayMethodId); + List businessSubSampleParentRecheckDOList = businessSubSampleParentRetestMapper.selectByRetestBusinessSubParentSampleIdsAndRetestConfigAssayMethodId(businessSubParentSampleIds, reqVO.getConfigAssayMethodId()); //循环未上报的样品 for (NoReportSubParentSampleAssessmentRespVO noReportSubParentSampleAssessmentRespVO : noReportSubParentSampleAssessmentRespList) { @@ -163,50 +183,75 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe String sampleCode = businessSubSampleDOList.stream().filter(f -> f.getBusinessSubParentSampleId().equals(noReportSubParentSampleAssessmentRespVO.getBusinessSubParentSampleId())).map(m -> m.getSampleAssayCode()).distinct().collect(Collectors.joining(" | ")); noReportSubParentSampleAssessmentMap.put("sampleCode", sampleCode); + //报出结果 Map subSampleAssessmentBeforeMap = BeanUtil.copyProperties(noReportSubParentSampleAssessmentMap, Map.class); Map subSampleAssessmentMap = BeanUtil.copyProperties(noReportSubParentSampleAssessmentMap, Map.class); - List curBusinessSubParentSampleAssessmentDOList = businessSubParentSampleAssessmentDOList.stream().filter(f -> f.getBusinessSubParentSampleId().equals(noReportSubParentSampleAssessmentRespVO.getBusinessSubParentSampleId())).collect(Collectors.toList()); + List curBusinessSubParentSampleAssessmentDOList = businessSubParentSampleAssessmentDOList.stream().filter(f -> f.getBusinessSubParentSampleId().equals(noReportSubParentSampleAssessmentRespVO.getBusinessSubParentSampleId()) && f.getRetestCount().equals(noReportSubParentSampleAssessmentRespVO.getRetestCount())).collect(Collectors.toList()); + List curBusinessSubParentSampleAssessmentDictionaryProjectIdList = curBusinessSubParentSampleAssessmentDOList.stream().map(m -> m.getDictionaryProjectId()).collect(Collectors.toList()); + noReportSubParentSampleAssessmentMap.put("sampleReceiveTime", noReportSubParentSampleAssessmentRespVO.getSampleReceiveTime()); noReportSubParentSampleAssessmentMap.put("configAssayMethodName", "报出结果"); - StringBuilder businessSubParentSampleAssessmentIds = new StringBuilder(); - for (BusinessSubParentSampleAssessmentProjectExtendRespVO businessSubParentSampleAssessmentDO : curBusinessSubParentSampleAssessmentDOList) { - noReportSubParentSampleAssessmentMap.put(businessSubParentSampleAssessmentDO.getSimpleName(), businessSubParentSampleAssessmentDO.getAssessmentValue()); - businessSubParentSampleAssessmentIds.append(businessSubParentSampleAssessmentDO.getId()).append(","); + StringBuilder businessSubParentSampleAssessmentProjectIds = new StringBuilder(); + for (BusinessSubParentSampleAssessmentProjectExtendRespVO businessSubParentSampleAssessmentProjectDO : curBusinessSubParentSampleAssessmentDOList) { + String assessmentValue = businessSubParentSampleAssessmentProjectDO.getAssessmentValue(); + if (StringUtils.isNotBlank(businessSubParentSampleAssessmentProjectDO.getSymbol()) && !"=".equals(businessSubParentSampleAssessmentProjectDO.getSymbol())) {//符号不为空,并且不为等于号。结果添加上符号 + assessmentValue = businessSubParentSampleAssessmentProjectDO.getSymbol() + assessmentValue; + } + noReportSubParentSampleAssessmentMap.put(businessSubParentSampleAssessmentProjectDO.getSimpleName(), assessmentValue); + businessSubParentSampleAssessmentProjectIds.append(businessSubParentSampleAssessmentProjectDO.getId()).append(","); } - businessSubParentSampleAssessmentIds.delete(businessSubParentSampleAssessmentIds.length() -1, businessSubParentSampleAssessmentIds.length()); - noReportSubParentSampleAssessmentMap.put("businessSubParentSampleAssessmentIds", businessSubParentSampleAssessmentIds.toString()); + businessSubParentSampleAssessmentProjectIds.delete(businessSubParentSampleAssessmentProjectIds.length() -1, businessSubParentSampleAssessmentProjectIds.length()); + noReportSubParentSampleAssessmentMap.put("businessSubParentSampleAssessmentProjectIds", businessSubParentSampleAssessmentProjectIds.toString()); + noReportSubParentSampleAssessmentMap.put("businessSubParentSampleAssessmentId", noReportSubParentSampleAssessmentRespVO.getBusinessSubParentSampleAssessmentId()); dataList.add(noReportSubParentSampleAssessmentMap); - //复测之前的判定数据 - BusinessSubSampleParentRecheckDO businessSubSampleParentRecheckDO = businessSubSampleParentRecheckDOList.stream().filter(f -> f.getRecheckBusinessSubParentSampleId().equals(noReportSubParentSampleAssessmentRespVO.getBusinessSubParentSampleId())).findFirst().orElse(null); - if (businessSubSampleParentRecheckDO != null) { - - List businessSubSampleAssessmentExtendBeforeList = businessSubSampleAssessmentProjectMapper.selectByBusinessSubParentSampleIdAndConfigAssayMethodId(businessSubSampleParentRecheckDO.getBusinessSubParentSampleId(), businessSubSampleParentRecheckDO.getConfigAssayMethodId()); - StringBuilder businessSubSampleAssessmentIdsBefore = new StringBuilder(); - for (BusinessSubSampleAssessmentProjectExtendRespVO businessSubSampleAssessmentProjectExtendRespVO : businessSubSampleAssessmentExtendBeforeList) { - subSampleAssessmentBeforeMap.put("configAssayMethodName", businessSubSampleAssessmentProjectExtendRespVO.getConfigAssayMethodName()); - subSampleAssessmentBeforeMap.put(businessSubSampleAssessmentProjectExtendRespVO.getSimpleName(), businessSubSampleAssessmentProjectExtendRespVO.getAssessmentValue()); - businessSubSampleAssessmentIdsBefore.append(businessSubSampleAssessmentProjectExtendRespVO.getId()).append(","); - } - businessSubSampleAssessmentIdsBefore.delete(businessSubSampleAssessmentIdsBefore.length() -1, businessSubSampleAssessmentIdsBefore.length()); - subSampleAssessmentBeforeMap.put("businessSubParentSampleAssessmentIds", businessSubParentSampleAssessmentIds.toString()); - subSampleAssessmentBeforeMap.put("businessSubSampleAssessmentIds", businessSubSampleAssessmentIdsBefore.toString()); - - dataList.add(subSampleAssessmentBeforeMap); - } - - - List businessSubSampleAssessmentList = businessSubSampleAssessmentExtendRespVOList.stream().filter(f -> f.getBusinessSubParentSampleId().equals(noReportSubParentSampleAssessmentRespVO.getBusinessSubParentSampleId())).collect(Collectors.toList()); + //当前判定数据 + List businessSubSampleAssessmentList = businessSubSampleAssessmentExtendRespVOList.stream().filter(f -> f.getBusinessSubParentSampleId().equals(noReportSubParentSampleAssessmentRespVO.getBusinessSubParentSampleId()) && f.getRetestCount().equals(noReportSubParentSampleAssessmentRespVO.getRetestCount()) ).collect(Collectors.toList()); StringBuilder businessSubSampleAssessmentIds = new StringBuilder(); for (BusinessSubSampleAssessmentProjectExtendRespVO businessSubSampleAssessmentProjectExtendRespVO : businessSubSampleAssessmentList) { + subSampleAssessmentMap.put("sampleReceiveTime", noReportSubParentSampleAssessmentRespVO.getSampleReceiveTime()); subSampleAssessmentMap.put("configAssayMethodName", businessSubSampleAssessmentProjectExtendRespVO.getConfigAssayMethodName()); - subSampleAssessmentMap.put(businessSubSampleAssessmentProjectExtendRespVO.getSimpleName(), businessSubSampleAssessmentProjectExtendRespVO.getAssessmentValue()); + String assessmentValue = businessSubSampleAssessmentProjectExtendRespVO.getAssessmentValue(); + if (StringUtils.isNotBlank(businessSubSampleAssessmentProjectExtendRespVO.getSymbol()) && !"=".equals(businessSubSampleAssessmentProjectExtendRespVO.getSymbol())) {//符号不为空,并且不为等于号。结果添加上符号 + assessmentValue = businessSubSampleAssessmentProjectExtendRespVO.getSymbol() + assessmentValue; + } + subSampleAssessmentMap.put(businessSubSampleAssessmentProjectExtendRespVO.getSimpleName(), assessmentValue); businessSubSampleAssessmentIds.append(businessSubSampleAssessmentProjectExtendRespVO.getId()).append(","); } businessSubSampleAssessmentIds.delete(businessSubSampleAssessmentIds.length() -1, businessSubSampleAssessmentIds.length()); - subSampleAssessmentMap.put("businessSubParentSampleAssessmentIds", businessSubParentSampleAssessmentIds.toString()); + subSampleAssessmentMap.put("businessSubParentSampleAssessmentProjectIds", businessSubParentSampleAssessmentProjectIds.toString()); subSampleAssessmentMap.put("businessSubSampleAssessmentIds", businessSubSampleAssessmentIds.toString()); dataList.add(subSampleAssessmentMap); + + //复测之前的判定数据 + BusinessSubSampleParentRetestDO businessSubSampleParentRecheckDO = businessSubSampleParentRecheckDOList.stream().filter(f -> f.getRetestBusinessSubParentSampleId().equals(noReportSubParentSampleAssessmentRespVO.getBusinessSubParentSampleId()) && f.getRetestCount().equals(noReportSubParentSampleAssessmentRespVO.getRetestCount())).findFirst().orElse(null); + if (businessSubSampleParentRecheckDO != null) { + + List businessSubSampleAssessmentExtendBeforeList = businessSubSampleAssessmentProjectMapper.selectByBusinessSubParentSampleIdAndBusinessSubParentSampleAssessmentId(businessSubSampleParentRecheckDO.getBusinessSubParentSampleId(), businessSubSampleParentRecheckDO.getBusinessSubParentSampleAssessmentId()); + StringBuilder businessSubSampleAssessmentIdsBefore = new StringBuilder(); + for (BusinessSubSampleAssessmentProjectExtendRespVO businessSubSampleAssessmentProjectExtendRespVO : businessSubSampleAssessmentExtendBeforeList) { + if (!curBusinessSubParentSampleAssessmentDictionaryProjectIdList.contains(businessSubSampleAssessmentProjectExtendRespVO.getDictionaryProjectId())) { + continue; + } + subSampleAssessmentBeforeMap.put("sampleReceiveTime", noReportSubParentSampleAssessmentRespVO.getSampleReceiveTime()); + subSampleAssessmentBeforeMap.put("configAssayMethodName", businessSubSampleAssessmentProjectExtendRespVO.getConfigAssayMethodName()); + String assessmentValue = businessSubSampleAssessmentProjectExtendRespVO.getAssessmentValue(); + if (StringUtils.isNotBlank(businessSubSampleAssessmentProjectExtendRespVO.getSymbol()) && !"=".equals(businessSubSampleAssessmentProjectExtendRespVO.getSymbol())) {//符号不为空,并且不为等于号。结果添加上符号 + assessmentValue = businessSubSampleAssessmentProjectExtendRespVO.getSymbol() + assessmentValue; + } + subSampleAssessmentBeforeMap.put(businessSubSampleAssessmentProjectExtendRespVO.getSimpleName(), assessmentValue); + businessSubSampleAssessmentIdsBefore.append(businessSubSampleAssessmentProjectExtendRespVO.getId()).append(","); + } + if (businessSubSampleAssessmentIdsBefore.length() > 0) { + businessSubSampleAssessmentIdsBefore.delete(businessSubSampleAssessmentIdsBefore.length() -1, businessSubSampleAssessmentIdsBefore.length()); + subSampleAssessmentBeforeMap.put("businessSubParentSampleAssessmentProjectIds", businessSubParentSampleAssessmentProjectIds.toString()); + subSampleAssessmentBeforeMap.put("businessSubSampleAssessmentIds", businessSubSampleAssessmentIdsBefore.toString()); + + dataList.add(subSampleAssessmentBeforeMap); + + } + } + } @@ -238,8 +283,9 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe @Override public List getRecheckAssayMethodList(Long baseSampleId, Long businessSubParentSampleId, Long configAssayMethodId) { + LoginUser loginUser = SecurityFrameworkUtils.getLoginUser(); //查询检查项目 - List list = businessSubParentSampleAssessmentProjectMapper.getRecheckAssayMethodList(baseSampleId, businessSubParentSampleId, configAssayMethodId); + List list = businessSubParentSampleAssessmentProjectMapper.getRecheckAssayMethodList(baseSampleId, businessSubParentSampleId, configAssayMethodId, loginUser.getVisitDeptId()); //过滤默认的 List resultList = list.stream().filter(f -> f.getIsRecheckDefault() != null && f.getIsRecheckDefault().equals(QmsCommonConstant.YES)).collect(Collectors.toList()); for (RecheckSubSampleParentMethodRespVO recheckSubSampleParentMethodRespVO : resultList) { @@ -250,6 +296,7 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe ConfigAssayMethodRespVO configAssayMethodRespVO = new ConfigAssayMethodRespVO(); configAssayMethodRespVO.setId(recheckSubSampleParentMethod.getConfigAssayMethodId()); configAssayMethodRespVO.setName(recheckSubSampleParentMethod.getConfigAssayMethodName()); + configAssayMethodRespVO.setMethodNameCategory(recheckSubSampleParentMethod.getConfigAssayMethodNameAndCategory()); methodList.add(configAssayMethodRespVO); } recheckSubSampleParentMethodRespVO.setMethodList(methodList); @@ -277,17 +324,37 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe private BusinessAssayParameterDataMapper businessAssayParameterDataMapper; @Resource - private BusinessSubSampleParentRecheckMapper businessSubSampleParentRecheckMapper; + private BusinessSubSampleParentRetestMapper businessSubSampleParentRetestMapper; @Override @Transactional(rollbackFor = Exception.class) public void createRecheckSample(RecheckSubSampleParentCreateReqVO reqVO) { - + + List newSubParentSampleAssessmentDOList = new ArrayList<>(); + List newSubSampleAssessmentDOList = new ArrayList<>(); List newBusinessAssayTaskDataDOList = new ArrayList<>(); List newBusinessAssayProjectDataDOList = new ArrayList<>(); List newBusinessAssayParameterDataDOList = new ArrayList<>(); - List newBusinessSubSampleParentRecheckDOList = new ArrayList<>(); + List newBusinessSubSampleParentRetestDOList = new ArrayList<>(); + + BusinessSubParentSampleAssessmentDO olBusinessSubParentSampleAssessmentDO = businessSubParentSampleAssessmentMapper.selectById(reqVO.getBusinessSubParentSampleAssessmentId()); + + //查询分样主样判定 + BusinessSubParentSampleAssessmentDO businessSubParentSampleAssessmentDO = businessSubParentSampleAssessmentMapper.selectByBusinessSubParentSampleIdAndConfigAssayMethodId(reqVO.getBusinessSubParentSampleId(), reqVO.getConfigAssayMethodId()); + if (businessSubParentSampleAssessmentDO == null) { + throw new ServiceException(1_032_050_000, "结果报送数据未找到"); + } + + //复检的检测项目 + List recheckProjectList = reqVO.getRecheckProjectList(); + List recheckDictionaryProjectIdList = recheckProjectList.stream().map(m -> m.getDictionaryProjectId()).collect(Collectors.toList()); + List businessSubParentSampleAssessmentProjectDOList = businessSubParentSampleAssessmentProjectMapper.selectByBusinessSubParentSampleAssessmentIdAndDictionaryProjectIds(businessSubParentSampleAssessmentDO.getId(), recheckDictionaryProjectIdList); + for (BusinessSubParentSampleAssessmentProjectDO businessSubParentSampleAssessmentProjectDO : businessSubParentSampleAssessmentProjectDOList) { + businessSubParentSampleAssessmentProjectDO.setIsReported(QmsCommonConstant.NO); + businessSubParentSampleAssessmentProjectDO.setAssessmentStatus(QmsCommonConstant.VOID); + businessSubParentSampleAssessmentProjectDO.setAssessmentValue(null); + } //获取分析任务数 List businessAssayTaskDataDOList = businessAssayTaskDataMapper.selectByBusinessSubParentSampleIdAndConfigAssayMethodId(reqVO.getBusinessSubParentSampleId(), reqVO.getConfigAssayMethodId()); @@ -295,11 +362,9 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe //获取子样 List businessSubSampleDOList = businessSubSampleMapper.selectByIds(businessSubSampleIds); - - for (BusinessSubSampleDO businessSubSampleDO : businessSubSampleDOList) { - //复检的检测项目 - List recheckProjectList = reqVO.getRecheckProjectList(); + for (BusinessSubSampleDO businessSubSampleDO : businessSubSampleDOList) { + //根据方法分组 Map> recheckProjectMap = recheckProjectList.stream().collect(Collectors.groupingBy(RecheckSubSampleParentMethodRespVO::getConfigAssayMethodId)); @@ -309,24 +374,58 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe Long configAssayMethodId = entry.getKey(); List projectList = entry.getValue(); - BusinessSubSampleParentRecheckDO businessSubSampleParentRecheckDO = new BusinessSubSampleParentRecheckDO(); - businessSubSampleParentRecheckDO.setBusinessBaseSampleId(businessSubSampleDO.getBusinessBaseSampleId()); - businessSubSampleParentRecheckDO.setBusinessSubParentSampleId(businessSubSampleDO.getBusinessSubParentSampleId()); - businessSubSampleParentRecheckDO.setConfigAssayMethodId(reqVO.getConfigAssayMethodId()); - businessSubSampleParentRecheckDO.setRecheckBusinessBaseSampleId(businessSubSampleDO.getBusinessBaseSampleId()); - businessSubSampleParentRecheckDO.setRecheckBusinessSubParentSampleId(businessSubSampleDO.getBusinessSubParentSampleId()); - businessSubSampleParentRecheckDO.setRecheckConfigAssayMethodId(configAssayMethodId); - - newBusinessSubSampleParentRecheckDOList.add(businessSubSampleParentRecheckDO); //查询分析方法 ConfigAssayMethodDO configAssayMethodDO = configAssayMethodMapper.selectById(configAssayMethodId); - ConfigSubSampleMethodDO configSubSampleMethodDO = configSubSampleMethodMapper.selectByConfigSubSampleIdAndConfigAssayMethodId(businessSubSampleDO.getConfigSubSampleId(), configAssayMethodId); + ConfigSubSampleMethodExtendRespVO configSubSampleMethodDO = configSubSampleMethodMapper.selectByConfigSubSampleIdAndConfigAssayMethodId(businessSubSampleDO.getConfigSubSampleId(), configAssayMethodId); List configAssayMethodProjectList = configAssayMethodProjectMapper.selectByConfigAssayMethodId(configAssayMethodId); //根据任务数判断是平行还是 String assayType = configSubSampleMethodDO.getTaskCount() > 1 ? QmsCommonConstant.ASSAY_TYPE_SINGLE_PARALLEL : QmsCommonConstant.ASSAY_TYPE_SINGLE_CUP; + + BusinessSubParentSampleAssessmentDO newBusinessSubParentSampleAssessmentDO = newSubParentSampleAssessmentDOList.stream().filter(f -> businessSubSampleDO.getBusinessSubParentSampleId().equals(f.getBusinessSubParentSampleId()) && configAssayMethodId.equals(f.getConfigAssayMethodId()) && "复测".equals(f.getTaskType())).findFirst().orElse(null); + if (newBusinessSubParentSampleAssessmentDO == null) { + newBusinessSubParentSampleAssessmentDO = new BusinessSubParentSampleAssessmentDO(); + newBusinessSubParentSampleAssessmentDO.setId(IdWorker.getId()); + newBusinessSubParentSampleAssessmentDO.setBusinessSubParentSampleId(businessSubSampleDO.getBusinessSubParentSampleId()); + newBusinessSubParentSampleAssessmentDO.setConfigAssayMethodId(configAssayMethodId); + newBusinessSubParentSampleAssessmentDO.setAssayType(assayType); + newBusinessSubParentSampleAssessmentDO.setTaskType("复测"); + newBusinessSubParentSampleAssessmentDO.setRetestCount(olBusinessSubParentSampleAssessmentDO.getRetestCount() + 1); + newSubParentSampleAssessmentDOList.add(newBusinessSubParentSampleAssessmentDO); + + + BusinessSubSampleParentRetestDO businessSubSampleParentRetestDO = new BusinessSubSampleParentRetestDO(); + businessSubSampleParentRetestDO.setBusinessBaseSampleId(businessSubSampleDO.getBusinessBaseSampleId()); + businessSubSampleParentRetestDO.setBusinessSubParentSampleId(businessSubSampleDO.getBusinessSubParentSampleId()); + businessSubSampleParentRetestDO.setBusinessSubParentSampleAssessmentId(reqVO.getBusinessSubParentSampleAssessmentId()); + businessSubSampleParentRetestDO.setConfigAssayMethodId(reqVO.getConfigAssayMethodId()); + businessSubSampleParentRetestDO.setRetestBusinessBaseSampleId(businessSubSampleDO.getBusinessBaseSampleId()); + businessSubSampleParentRetestDO.setRetestBusinessSubParentSampleId(businessSubSampleDO.getBusinessSubParentSampleId()); + businessSubSampleParentRetestDO.setRetestBusinessSubParentSampleAssessmentId(newBusinessSubParentSampleAssessmentDO.getId()); + businessSubSampleParentRetestDO.setRetestCount(newBusinessSubParentSampleAssessmentDO.getRetestCount()); + businessSubSampleParentRetestDO.setRetestConfigAssayMethodId(configAssayMethodId); + + newBusinessSubSampleParentRetestDOList.add(businessSubSampleParentRetestDO ); + } + + BusinessSubSampleAssessmentDO newBusinessSubSampleAssessmentDO = newSubSampleAssessmentDOList.stream().filter(f -> f.getBusinessSubParentSampleAssessmentId().equals(businessSubParentSampleAssessmentDO.getId())).findFirst().orElse(null); + if (newBusinessSubSampleAssessmentDO == null) { + newBusinessSubSampleAssessmentDO = new BusinessSubSampleAssessmentDO(); + newBusinessSubSampleAssessmentDO.setId(IdWorker.getId()); + newBusinessSubSampleAssessmentDO.setBusinessBaseSampleId(businessSubSampleDO.getBusinessBaseSampleId()); + newBusinessSubSampleAssessmentDO.setBusinessSubParentSampleId(businessSubSampleDO.getBusinessSubParentSampleId()); + newBusinessSubSampleAssessmentDO.setBusinessSubSampleId(businessSubSampleDO.getId()); + newBusinessSubSampleAssessmentDO.setBusinessSubParentSampleAssessmentId(newBusinessSubParentSampleAssessmentDO.getId()); + newBusinessSubSampleAssessmentDO.setConfigAssayMethodId(configAssayMethodId); + newBusinessSubSampleAssessmentDO.setAssayType(assayType); + newBusinessSubSampleAssessmentDO.setTaskType("复测"); + newBusinessSubSampleAssessmentDO.setRetestCount(newBusinessSubParentSampleAssessmentDO.getRetestCount()); + + newSubSampleAssessmentDOList.add(newBusinessSubSampleAssessmentDO); + } + //根据任务数循环 for (int i = 0; i < configSubSampleMethodDO.getTaskCount(); i++) { @@ -336,6 +435,7 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe businessAssayTaskDataDO.setBusinessBaseSampleId(businessSubSampleDO.getBusinessBaseSampleId()); businessAssayTaskDataDO.setBusinessSubParentSampleId(businessSubSampleDO.getBusinessSubParentSampleId()); businessAssayTaskDataDO.setBusinessSubSampleId(businessSubSampleDO.getId()); + businessAssayTaskDataDO.setBusinessSubSampleAssessmentId(newBusinessSubSampleAssessmentDO.getId()); businessAssayTaskDataDO.setConfigAssayMethodId(configAssayMethodId); businessAssayTaskDataDO.setAssayType(assayType); businessAssayTaskDataDO.setTaskType("复测"); @@ -344,6 +444,7 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe businessAssayTaskDataDO.setSampleFlowNodeTime(LocalDateTime.now()); businessAssayTaskDataDO.setAssayDepartmentId(configAssayMethodDO.getAssayDepartmentId()); businessAssayTaskDataDO.setAssayDepartmentName(configAssayMethodDO.getAssayDepartmentName()); + businessAssayTaskDataDO.setRetestCount(newBusinessSubSampleAssessmentDO.getRetestCount()); StringBuilder assayProjectBuilder = new StringBuilder(); @@ -361,12 +462,15 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe businessAssayProjectDataDO.setDictionaryProjectId(configAssayMethodProjectDO.getDictionaryProjectId()); businessAssayProjectDataDO.setDataType(configAssayMethodProjectDO.getDataType()); businessAssayProjectDataDO.setDecimalPosition(configAssayMethodProjectDO.getDecimalPosition()); - businessAssayProjectDataDO.setIsEnabled(1); - businessAssayProjectDataDO.setIsNotAssessment(0); + businessAssayProjectDataDO.setUsage(QmsCommonConstant.ASSAY_PROJECT_USAGE_REPORT); + + businessAssayProjectDataDO.setMinimumLimitValue(configAssayMethodProjectDO.getMinimumLimitValue()); + businessAssayProjectDataDO.setIsEnabled(QmsCommonConstant.YES); + businessAssayProjectDataDO.setIsNotAssessment(QmsCommonConstant.NO); newBusinessAssayProjectDataDOList.add(businessAssayProjectDataDO); - List configAssayMethodProjectParameterDOList = configAssayMethodProjectParameterMapper.selectByConfigAssayMethodProjectId(configAssayMethodId); + List configAssayMethodProjectParameterDOList = configAssayMethodProjectParameterMapper.selectByConfigAssayMethodProjectId(configAssayMethodProjectDO.getId()); for (ConfigAssayMethodProjectParameterDO configAssayMethodProjectParameterDO : configAssayMethodProjectParameterDOList) { BusinessAssayParameterDataDO businessAssayParameterDataDO = new BusinessAssayParameterDataDO(); businessAssayParameterDataDO.setId(IdWorker.getId()); @@ -388,6 +492,19 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe } } + + if (CollUtil.isNotEmpty(businessSubParentSampleAssessmentProjectDOList)) { + businessSubParentSampleAssessmentProjectMapper.updateBatch(businessSubParentSampleAssessmentProjectDOList); + } + + if (CollUtil.isNotEmpty(newSubParentSampleAssessmentDOList)) { + businessSubParentSampleAssessmentMapper.insertBatch(newSubParentSampleAssessmentDOList); + } + + if (CollUtil.isNotEmpty(newSubSampleAssessmentDOList)) { + businessSubSampleAssessmentMapper.insertBatch(newSubSampleAssessmentDOList); + } + if (CollUtil.isNotEmpty(newBusinessAssayTaskDataDOList)) { businessAssayTaskDataMapper.insertBatch(newBusinessAssayTaskDataDOList); } @@ -397,10 +514,13 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe if (CollUtil.isNotEmpty(newBusinessAssayParameterDataDOList)) { businessAssayParameterDataMapper.insertBatch(newBusinessAssayParameterDataDOList); } - if (CollUtil.isNotEmpty(newBusinessSubSampleParentRecheckDOList)) { - businessSubSampleParentRecheckMapper.insertBatch(newBusinessSubSampleParentRecheckDOList); + if (CollUtil.isNotEmpty(newBusinessSubSampleParentRetestDOList)) { + businessSubSampleParentRetestMapper.insertBatch(newBusinessSubSampleParentRetestDOList); } } + + @Resource + private Express4Runner express4Runner; @Resource private BusinessAssayReportDataMapper businessAssayReportDataMapper; @@ -421,7 +541,10 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe private BusinessSubSampleAnalysisGroupMapper businessSubSampleAnalysisGroupMapper; @Resource - private BusinessSubParentSampleAssessmentMapper businessSubParentSampleAssessmentMapper; + private BusinessSampleEntrustRegistrationMapper businessSampleEntrustRegistrationMapper; + + @Resource + private BusinessSampleEntrustDetailMapper businessSampleEntrustDetailMapper; @Resource private SampleFlowService sampleFlowService; @@ -433,19 +556,17 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe //当前登录用户昵称 String nickName = SecurityFrameworkUtils.getLoginUserNickname(); - + List updatebBusinessSampleEntrustRegistrationDOList = new ArrayList<>(); List updateBusinessSubSampleDOList = new ArrayList<>(); List updateBusinessSubSampleAnalysisGroupDOList = new ArrayList<>(); List saveBusinessAssayReportDataDOList = new ArrayList<>(); List updateBusinessAssayReportDataDOList = new ArrayList<>(); - List businessSubParentSampleAssessmentExtendList = businessSubParentSampleAssessmentProjectMapper.selectByBusinessSubParentSampleIdAndConfigAssayMethodId(reqVO.getBusinessSubParentSampleIds(), reqVO.getConfigAssayMethodId()); + List businessSubParentSampleAssessmentExtendList = businessSubParentSampleAssessmentProjectMapper.selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(reqVO.getBusinessSubParentSampleIds(), reqVO.getConfigAssayMethodId()); List businessSubParentSampleDOList = businessSubParentSampleMapper.selectByIds(reqVO.getBusinessSubParentSampleIds()); -// List businessSubParentSampleAssessmentDOList = businessSubParentSampleAssessmentMapper.selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(reqVO.getBusinessSubParentSampleIds(), reqVO.getConfigAssayMethodId()); - //循环分样主样数据 for (BusinessSubParentSampleDO businessSubParentSampleDO : businessSubParentSampleDOList) { @@ -481,16 +602,16 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe } else { updateBusinessAssayReportDataDOList.add(businessAssayReportDataDO); } - JSONObject assayDataJson = new JSONObject(); + Map assayDataJson = new HashMap<>(); String assayData = businessAssayReportDataDO.getAssayData(); if (StringUtils.isNotBlank(assayData)) { - assayDataJson = JSON.parseObject(assayData); + assayDataJson = JSON.parseObject(assayData, new TypeReference>() {}); } //循环判定值 - List businessSubParentSampleAssessmentList = businessSubParentSampleAssessmentExtendList.stream().filter(f -> f.getBusinessSubParentSampleId().equals(businessSubParentSampleDO.getId())).collect(Collectors.toList()); + List businessSubParentSampleAssessmentList = businessSubParentSampleAssessmentExtendList.stream().filter(f -> f.getBusinessSubParentSampleId().equals(businessSubParentSampleDO.getId()) && "normal".equals(f.getAssessmentStatus())).collect(Collectors.toList()); for (BusinessSubParentSampleAssessmentProjectExtendRespVO businessSubParentSampleAssessment : businessSubParentSampleAssessmentList) { Long configAssayMethodProjectId = businessSubParentSampleAssessment.getConfigAssayMethodProjectId(); - List configProjectFeildList = configProjectList.stream().filter(f -> f.getConfigAssayMethodProjectId().equals(configAssayMethodProjectId)).collect(Collectors.toList()); + List configProjectFeildList = configProjectList.stream().filter(f -> f.getConfigAssayMethodProjectId() != null && f.getConfigAssayMethodProjectId().equals(configAssayMethodProjectId)).collect(Collectors.toList()); for (ConfigProjectExtendRespVO configProjectFeild : configProjectFeildList) { //查询动态报表字段 ConfigReportFieldDO configReportField = configReportFieldDynamicList.stream().filter(f -> f.getConfigReportTypeId().equals(configSampleReport.getConfigReportTypeId()) && f.getField().equals(configProjectFeild.getSaveColumn())).findFirst().orElse(null); @@ -504,7 +625,7 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe reportFieldValueData.setFieldValue(businessSubParentSampleAssessment.getAssessmentValue()); reportFieldValueData.setDataType(configReportField.getDataType()); reportFieldValueData.setDecimalPosition(configReportField.getDecimalPosition()); - reportFieldValueData.setMathSymbol("="); + reportFieldValueData.setMathSymbol(businessSubParentSampleAssessment.getSymbol()); reportFieldValueData.setUnit(configProjectFeild.getDictionaryProjectUnit()); reportFieldValueData.setUsage(businessSubParentSampleAssessment.getUsage()); reportFieldValueData.setMinLimitValue(businessSubParentSampleAssessment.getMinimumLimitValue()); @@ -512,7 +633,6 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe assayDataJson.put(configReportField.getField(), reportFieldValueData); } } - businessAssayReportDataDO.setAssayData(assayDataJson.toJSONString()); //修改已上报数据来源 String dataSource = businessAssayReportDataDO.getDataSource(); @@ -529,42 +649,110 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe if (busDataSources.size() == dataSources.size() && busDataSources.equals(dataSources)) { businessAssayReportDataDO.setIsAllReported(QmsCommonConstant.YES); } - if (busDataSources.size() > 0) { - //计算 - // TODO + if (busDataSources.size() > 0) {//计算 + Map calcContext = assayDataJson.entrySet().stream().collect(Collectors.toMap( + Map.Entry::getKey, + entry -> { + ReportFieldValueData data = entry.getValue(); + String fieldValue = data != null ? data.getFieldValue() : null; + if (fieldValue == null || fieldValue.isEmpty()) { + return BigDecimal.ZERO; + } + return new BigDecimal(fieldValue); + } + )); + + //计算报表字段 + List configReportFieldCalculatedList = configReportFieldList.stream().filter(f -> QmsCommonConstant.FIELD_CALCULATED.equals(f.getFieldType())).collect(Collectors.toList()); + for (ConfigReportFieldDO configReportFieldCalculated : configReportFieldCalculatedList) { + if (StringUtils.isNotBlank(configReportFieldCalculated.getFormula())) { + //获取公式中的参数 + Set outVarNames = express4Runner.getOutVarNames(configReportFieldCalculated.getFormula()); + for (String calcField : outVarNames) { + if (!calcContext.containsKey(calcField)) { + calcContext.put(calcField, BigDecimal.ZERO); + } + } + + QLResult expressResult = express4Runner.execute(configReportFieldCalculated.getFormula(), calcContext, QLOptions.builder().precise(true).build());//高精度计算 + BigDecimal calcValue = (BigDecimal) expressResult.getResult(); + + String mathSymbol = "="; + List mathSymbolList = assayDataJson.entrySet().stream().filter(f -> outVarNames.contains(f.getKey()) && !"=".equals(((ReportFieldValueData)f.getValue()).getMathSymbol())).map(f -> ((ReportFieldValueData)f.getValue()).getMathSymbol()).distinct().collect(Collectors.toList()); + if (CollUtil.isNotEmpty(mathSymbolList)) { + mathSymbol = mathSymbolList.get(0); + } + String unit = null; + List unitList = assayDataJson.entrySet().stream().filter(f -> outVarNames.contains(f.getKey())).map(f -> ((ReportFieldValueData)f.getValue()).getUnit()).distinct().collect(Collectors.toList()); + if (CollUtil.isNotEmpty(mathSymbolList)) { + unit = unitList.get(0); + } + + ReportFieldValueData reportFieldValueData = new ReportFieldValueData(); + reportFieldValueData.setFieldName(configReportFieldCalculated.getFieldName()); + reportFieldValueData.setFieldValue(calcValue.toPlainString()); + reportFieldValueData.setDataType(configReportFieldCalculated.getDataType()); + reportFieldValueData.setDecimalPosition(configReportFieldCalculated.getDecimalPosition()); + reportFieldValueData.setMathSymbol(mathSymbol); + reportFieldValueData.setUnit(unit); + reportFieldValueData.setUsage(QmsCommonConstant.ASSAY_PROJECT_USAGE_REPORT); + reportFieldValueData.setMinLimitValue(null); + reportFieldValueData.setMethodName(null); + assayDataJson.put(configReportFieldCalculated.getField(), reportFieldValueData); + + } + + } + } + businessAssayReportDataDO.setAssayData(JSON.toJSONString(assayDataJson)); businessAssayReportDataDO.setReportedSource(JSON.toJSONString(reportedDataSource)); } } - //处理子样分析任务数据 - List businessAssayTaskDataDOList = businessAssayTaskDataMapper.selectByBusinessSubParentSampleIds(reqVO.getBusinessSubParentSampleIds()); - List businessSubSampleIdList = businessAssayTaskDataDOList.stream().map(m -> m.getBusinessSubSampleId()).distinct().collect(Collectors.toList()); - List businessSubSampleDOList = businessSubSampleMapper.selectByIds(businessSubSampleIdList); - List businessSubSampleAnalysisGroupDOList = businessSubSampleAnalysisGroupMapper.selectByBusinessSubParentSampleIds(reqVO.getBusinessSubParentSampleIds()); - //根据子样id进行分组 - Map> businessAssayTaskDataDOMap = businessAssayTaskDataDOList.stream().collect(Collectors.groupingBy(BusinessAssayTaskDataDO::getBusinessSubSampleId)); - for (Map.Entry> businessAssayTaskDataDOEntry : businessAssayTaskDataDOMap.entrySet()) { - Long businessSubSampleId = businessAssayTaskDataDOEntry.getKey(); - //子样下的分析任务 - List valList = businessAssayTaskDataDOEntry.getValue(); - //查询子样 - BusinessSubSampleDO businessSubSampleDO = businessSubSampleDOList.stream().filter(f -> businessSubSampleId.equals(f.getId())).findFirst().orElse(null); - //查询子样下的分析班组 - List subSampleAnalysisGroupList = businessSubSampleAnalysisGroupDOList.stream().filter(f -> f.getBusinessSubSampleId().equals(businessSubSampleId)).collect(Collectors.toList()); - for (BusinessSubSampleAnalysisGroupDO subSampleAnalysisGroupDO : subSampleAnalysisGroupList) { - long count = valList.stream().filter(f -> f.getIsReported().equals(QmsCommonConstant.NO) && f.getAssayDepartmentId().equals(subSampleAnalysisGroupDO.getAssayDepartmentId())).count(); - if (count > 0) {//如果还存在未上报的数据,则继续 - continue; - } - subSampleAnalysisGroupDO.setSampleStatus("已完成");//当前班组分析已完成 - updateBusinessSubSampleAnalysisGroupDOList.add(subSampleAnalysisGroupDO); - - updateBusinessSubSampleDOList.add(businessSubSampleDO); + //分析方法信息 + ConfigAssayMethodDO configAssayMethodDO = configAssayMethodMapper.selectById(reqVO.getConfigAssayMethodId()); + //查询当前分析部门下的分样判定信息 + List businessSubParentSampleAssessmentDOList = businessSubParentSampleAssessmentMapper.selectByBusinessSubParentSampleIdsAndAssayDepartmentId(reqVO.getBusinessSubParentSampleIds(), configAssayMethodDO.getAssayDepartmentId()); + //查询当前分析部门下的子样分析班组信息 + List businessSubSampleAnalysisGroupDOList = businessSubSampleAnalysisGroupMapper.selectByBusinessSubParentSampleIdsAndAssayDepartmentId(reqVO.getBusinessSubParentSampleIds(), configAssayMethodDO.getAssayDepartmentId()); + for (BusinessSubSampleAnalysisGroupDO businessSubSampleAnalysisGroupDO : businessSubSampleAnalysisGroupDOList) {//循环分析班组信息 + //查询当前分样判定上报未上报的,并排除当前上报的方法,的数量 + long count = businessSubParentSampleAssessmentDOList.stream().filter(f -> f.getBusinessSubParentSampleId().equals(businessSubSampleAnalysisGroupDO.getBusinessSubParentSampleId()) && !f.getConfigAssayMethodId().equals(reqVO.getConfigAssayMethodId()) && f.getIsReported().equals(QmsCommonConstant.NO)).count(); + if (count > 0) {//如果还存在未上报的数据,则继续 + continue; } + businessSubSampleAnalysisGroupDO.setSampleStatus("已完成");//当前班组分析已完成 + updateBusinessSubSampleAnalysisGroupDOList.add(businessSubSampleAnalysisGroupDO); + //查询子样 + BusinessSubSampleDO businessSubSampleDO = businessSubSampleMapper.selectById(businessSubSampleAnalysisGroupDO.getBusinessSubSampleId()); + updateBusinessSubSampleDOList.add(businessSubSampleDO); + } + + //处理委托登记信息 + List businessBaseSampleIdList = businessSubParentSampleDOList.stream().map(m -> m.getBusinessBaseSampleId()).distinct().collect(Collectors.toList()); + + List businessSampleEntrustDetailDOList = businessSampleEntrustDetailMapper.selectByBusinessBaseSampleIds(businessBaseSampleIdList); + List businessSampleEntrustRegistrationIdList = businessSampleEntrustDetailDOList.stream().map(m -> m.getBusinessSampleEntrustRegistrationId()).distinct().collect(Collectors.toList()); + + List businessSampleEntrustRegistrationDOList = businessSampleEntrustRegistrationMapper.selectByIds(businessSampleEntrustRegistrationIdList); + + List allBusinessSampleEntrustDetailDOList = businessSampleEntrustDetailMapper.selectByBusinessSampleEntrustRegistrationIds(businessSampleEntrustRegistrationIdList); + + for (BusinessSampleEntrustRegistrationDO businessSampleEntrustRegistrationDO : businessSampleEntrustRegistrationDOList) { + List currentBusinessBaseSampleIdList = allBusinessSampleEntrustDetailDOList.stream().filter(f -> f.getBusinessSampleEntrustRegistrationId().equals(businessSampleEntrustRegistrationDO.getId())).map(m -> m.getBusinessBaseSampleId()).collect(Collectors.toList()); + List currentBusinessSubParentSampleDOList = businessSubParentSampleMapper.selectByBusinessBaseSampleIds(currentBusinessBaseSampleIdList); + List currentBusinessSubParentSampleIdList = currentBusinessSubParentSampleDOList.stream().map(m -> m.getId()).collect(Collectors.toList()); + List currentBusinessSubParentSampleAssessmentDOList = businessSubParentSampleAssessmentMapper.selectByBusinessSubParentSampleIds(currentBusinessSubParentSampleIdList); - + //排除不在reqVO.getBusinessSubParentSampleIds()并且方法reqVO.getConfigAssayMethodId()的数据,其他数据校验是否已上报 + long count = currentBusinessSubParentSampleAssessmentDOList.stream().filter(f -> !(reqVO.getBusinessSubParentSampleIds().contains(f.getBusinessSubParentSampleId()) && f.getConfigAssayMethodId().equals(reqVO.getConfigAssayMethodId())) && f.getIsReported().equals(QmsCommonConstant.NO)).count(); + if (count > 0) {//如果还存在未上报的数据,则继续 + continue; + } + businessSampleEntrustRegistrationDO.setAssayStatus(QmsCommonConstant.CHECKED); + updatebBusinessSampleEntrustRegistrationDOList.add(businessSampleEntrustRegistrationDO); } if (saveBusinessAssayReportDataDOList.size() > 0) { @@ -579,7 +767,15 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe businessSubSampleAnalysisGroupMapper.updateBatch(updateBusinessSubSampleAnalysisGroupDOList); } - List businessSubParentSampleAssessmentIdList = businessSubParentSampleAssessmentExtendList.stream().map(m -> m.getId()).collect(Collectors.toList()); + //查询正常上报的 + List businessSubParentSampleAssessmentIdList = businessSubParentSampleAssessmentExtendList.stream().filter(f -> "normal".equals(f.getAssessmentStatus())).map(m -> m.getId()).collect(Collectors.toList()); + //查询未上报的分样主id +// List noAllReportBusinessSubParentSampleIdList = businessSubParentSampleAssessmentExtendList.stream().filter(f -> "in_progress".equals(f.getAssessmentStatus())).map(m -> m.getBusinessSubParentSampleId()).distinct().collect(Collectors.toList()); + //全部上报的 +// List allReportBusinessSubParentSampleIdList = new ArrayList<>(); +// if (noAllReportBusinessSubParentSampleIdList != null) { +// allReportBusinessSubParentSampleIdList = reqVO.getBusinessSubParentSampleIds().stream().filter(item -> !noAllReportBusinessSubParentSampleIdList.contains(item)).collect(Collectors.toList()); +// } businessSubParentSampleAssessmentProjectMapper.update(new LambdaUpdateWrapper() .set(BusinessSubParentSampleAssessmentProjectDO::getIsReported, QmsCommonConstant.YES) @@ -587,6 +783,14 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe .set(BusinessSubParentSampleAssessmentProjectDO::getReportTime, LocalDateTime.now()) .in(BusinessSubParentSampleAssessmentProjectDO::getId, businessSubParentSampleAssessmentIdList)); +// if (allReportBusinessSubParentSampleIdList.size() > 0) { +// businessSubParentSampleAssessmentMapper.update(new LambdaUpdateWrapper() +// .set(BusinessSubParentSampleAssessmentDO::getIsReported, QmsCommonConstant.YES) +// .set(BusinessSubParentSampleAssessmentDO::getReporter, nickName) +// .set(BusinessSubParentSampleAssessmentDO::getReportTime, LocalDateTime.now()) +// .in(BusinessSubParentSampleAssessmentDO::getBusinessSubParentSampleId, allReportBusinessSubParentSampleIdList) +// .eq(BusinessSubParentSampleAssessmentDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId())); +// } businessSubParentSampleAssessmentMapper.update(new LambdaUpdateWrapper() .set(BusinessSubParentSampleAssessmentDO::getIsReported, QmsCommonConstant.YES) .set(BusinessSubParentSampleAssessmentDO::getReporter, nickName) @@ -594,9 +798,11 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe .in(BusinessSubParentSampleAssessmentDO::getBusinessSubParentSampleId, reqVO.getBusinessSubParentSampleIds()) .eq(BusinessSubParentSampleAssessmentDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId())); + if (updatebBusinessSampleEntrustRegistrationDOList.size() > 0) { + businessSampleEntrustRegistrationMapper.updateBatch(updatebBusinessSampleEntrustRegistrationDOList); + } if (updateBusinessSubSampleDOList.size() > 0) { - SampleFlowParam sampleFlowParam = new SampleFlowParam(); sampleFlowParam.setCurrentSampleFlowKey(QmsCommonConstant.FLOW_NODE_ANALYSIS); sampleFlowParam.setSampleSourceType(2); @@ -613,13 +819,16 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe @Override @Transactional(rollbackFor = Exception.class) public void modifySampleResultReporting(ModifySampleResultReportingReqVO reqVO) { - List businessSubParentSampleAssessmentIdList = Arrays.asList(reqVO.getBusinessSubParentSampleAssessmentIds().split(",")); + List businessSubParentSampleAssessmentProjectIdList = Arrays.asList(reqVO.getBusinessSubParentSampleAssessmentProjectIds().split(",")); List businessSubSampleAssessmentIdList = Arrays.asList(reqVO.getBusinessSubSampleAssessmentIds().split(",")); - List businessSubParentSampleAssessmentDOList = businessSubParentSampleAssessmentProjectMapper.selectByIds(businessSubParentSampleAssessmentIdList); + List businessSubParentSampleAssessmentDOList = businessSubParentSampleAssessmentProjectMapper.selectByIds(businessSubParentSampleAssessmentProjectIdList); List businessSubSampleAssessmentDOList = businessSubSampleAssessmentProjectMapper.selectByIds(businessSubSampleAssessmentIdList); for (BusinessSubParentSampleAssessmentProjectDO businessSubParentSampleAssessmentProjectDO : businessSubParentSampleAssessmentDOList) { BusinessSubSampleAssessmentProjectDO businessSubSampleAssessmentProjectDO = businessSubSampleAssessmentDOList.stream().filter(f -> f.getDictionaryProjectId().equals(businessSubParentSampleAssessmentProjectDO.getDictionaryProjectId())).findFirst().orElse(null); + businessSubParentSampleAssessmentProjectDO.setConfigAssayMethodId(businessSubSampleAssessmentProjectDO.getConfigAssayMethodId()); + businessSubParentSampleAssessmentProjectDO.setConfigAssayMethodProjectId(businessSubSampleAssessmentProjectDO.getConfigAssayMethodProjectId()); businessSubParentSampleAssessmentProjectDO.setAssessmentValue(businessSubSampleAssessmentProjectDO.getAssessmentValue()); + businessSubParentSampleAssessmentProjectDO.setSymbol(businessSubSampleAssessmentProjectDO.getSymbol()); } businessSubParentSampleAssessmentProjectMapper.updateBatch(businessSubParentSampleAssessmentDOList); } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleTaskAssignService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleTaskAssignService.java index 8afa8f5..695fe4d 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleTaskAssignService.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleTaskAssignService.java @@ -18,6 +18,13 @@ public interface SampleTaskAssignService { */ List getAssignUserList(); + /** + * 根据用户id获取用户信息 + * @param userId + * @return + */ + AdminUserRespDTO getUserInfoById(Long userId); + /** * 获取未指派任务子样信息 * @return @@ -25,12 +32,20 @@ public interface SampleTaskAssignService { List getAssaySampleList(BusinessAssayTaskDataReqVO reqVO); /** - * 根据子样id查询分析方法 - * @param businessSubSampleId - * @param configAssayMethodId + * 根据子样id列表,查询分析方法项目 + * @param businessSubSampleIdList 子样id列表 + * @param configAssayMethodId 分析方法id * @return */ - List getAssayMethodList(Long businessSubSampleId, Long configAssayMethodId); + List getAssayMethodProjectList(List businessSubSampleIdList, Long configAssayMethodId); + + /** + * 根据大样id,分析方法 查询检测标准中分析方法项目 + * @param baseSampleId 大样id + * @param configAssayMethodId 分析方法id + * @return + */ + List getMaterialAssayStandardMethodProjectList(List businessSubSampleIdList, Long baseSampleId, Long configAssayMethodId); /** * 修改分析方法 diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleTaskAssignServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleTaskAssignServiceImpl.java index d837dd0..f1db901 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleTaskAssignServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleTaskAssignServiceImpl.java @@ -2,8 +2,6 @@ package com.zt.plat.module.qms.business.bus.service; import java.time.LocalDateTime; import java.util.ArrayList; -import java.util.Arrays; -import java.util.Iterator; import java.util.List; import java.util.stream.Collectors; @@ -11,7 +9,6 @@ import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import com.alibaba.fastjson2.JSONObject; import com.baomidou.mybatisplus.core.toolkit.IdWorker; import com.yomahub.liteflow.core.FlowExecutor; import com.yomahub.liteflow.flow.LiteflowResponse; @@ -33,12 +30,12 @@ import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDataD import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDetailDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCCoefficientDataDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCCoefficientParameterDataDO; -import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCDataDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCManagementDataDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCManagementParameterDataDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCManagementProjectDataDO; -import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCParameterDataDO; -import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCProjectDataDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCManagementSampleParameterDataDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubParentSampleAssessmentDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleAssessmentDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleDO; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayParameterDataMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayProjectDataMapper; @@ -48,12 +45,12 @@ import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayTaskDetailMap import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayTaskMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCCoefficientDataMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCCoefficientParameterDataMapper; -import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCDataMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCManagementDataMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCManagementParameterDataMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCManagementProjectDataMapper; -import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCParameterDataMapper; -import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCProjectDataMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCManagementSampleParameterDataMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubParentSampleAssessmentMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubSampleAssessmentMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubSampleMapper; import com.zt.plat.module.qms.business.bus.liteflow.param.SampleTaskAssignManualParam; import com.zt.plat.module.qms.business.bus.liteflow.param.SampleTaskAssignMethodParam; @@ -63,15 +60,18 @@ import com.zt.plat.module.qms.business.config.controller.vo.ConfigAssayMethodPro import com.zt.plat.module.qms.business.config.controller.vo.ConfigQCSampleMethodExtendRespVO; import com.zt.plat.module.qms.business.config.controller.vo.ConfigQCSampleMethodParameterExtendRespVO; import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSampleMethodExtendRespVO; +import com.zt.plat.module.qms.business.config.controller.vo.MaterialAssayStandardMethodExtendRespVO; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodDO; -import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectDO; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodParameterDO; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectParameterDO; import com.zt.plat.module.qms.business.config.dal.mapper.ConfigAssayMethodMapper; +import com.zt.plat.module.qms.business.config.dal.mapper.ConfigAssayMethodParameterMapper; import com.zt.plat.module.qms.business.config.dal.mapper.ConfigAssayMethodProjectMapper; import com.zt.plat.module.qms.business.config.dal.mapper.ConfigAssayMethodProjectParameterMapper; import com.zt.plat.module.qms.business.config.dal.mapper.ConfigQCSampleMethodMapper; import com.zt.plat.module.qms.business.config.dal.mapper.ConfigQCSampleMethodParameterMapper; import com.zt.plat.module.qms.business.config.dal.mapper.ConfigSubSampleMethodMapper; +import com.zt.plat.module.qms.business.config.dal.mapper.MaterialAssayStandardMethodMapper; import com.zt.plat.module.qms.business.dic.dal.mapper.DictionaryProjectMapper; import com.zt.plat.module.qms.core.code.SequenceUtil; import com.zt.plat.module.qms.enums.QmsCommonConstant; @@ -116,6 +116,12 @@ public class SampleTaskAssignServiceImpl implements SampleTaskAssignService { @Resource private BusinessAssayParameterDataMapper businessAssayParameterDataMapper; + @Resource + private BusinessSubSampleAssessmentMapper businessSubSampleAssessmentMapper; + + @Resource + private BusinessSubParentSampleAssessmentMapper businessSubParentSampleAssessmentMapper; + @Resource private BusinessAssayReportDataMapper businessAssayReportDataMapper; @@ -125,6 +131,9 @@ public class SampleTaskAssignServiceImpl implements SampleTaskAssignService { @Resource private ConfigAssayMethodMapper configAssayMethodMapper; + @Resource + private ConfigAssayMethodParameterMapper configAssayMethodParameterMapper; + @Resource private ConfigAssayMethodProjectMapper configAssayMethodProjectMapper; @@ -149,11 +158,17 @@ public class SampleTaskAssignServiceImpl implements SampleTaskAssignService { @Resource private BusinessQCManagementDataMapper businessQCManagementDataMapper; + @Resource + private BusinessQCManagementSampleParameterDataMapper businessQCManagementSampleParameterDataMapper; + @Resource private BusinessQCManagementProjectDataMapper businessQCManagementProjectDataMapper; @Resource private BusinessQCManagementParameterDataMapper businessQCManagementParameterDataMapper; + + @Resource + private MaterialAssayStandardMethodMapper materialAssayStandardMethodMapper; @Override public List getAssignUserList() { @@ -176,91 +191,423 @@ public class SampleTaskAssignServiceImpl implements SampleTaskAssignService { return userListResult.getCheckedData(); } + @Override + public AdminUserRespDTO getUserInfoById(Long userId) { + CommonResult useResult = adminUserApi.getUser(userId); + return useResult.getCheckedData(); + } + @Override public List getAssaySampleList(BusinessAssayTaskDataReqVO reqVO) { List list = businessAssayTaskDataMapper.selectUnAssignTaskedSubSample(reqVO); return list; } - + + /** + * 通过子样方法检测项目 + */ @Override - public List getAssayMethodList(Long businessSubSampleId, Long configAssayMethodId) { - List resutList = new ArrayList<>(); + public List getAssayMethodProjectList(List businessSubSampleIdList, Long configAssayMethodId) { //当前登录用户 LoginUser loginUser = SecurityFrameworkUtils.getLoginUser(); Long visitDeptId = loginUser.getVisitDeptId(); - //子样 - BusinessSubSampleDO businessSubSampleDO = businessSubSampleMapper.selectById(businessSubSampleId); - //原检测项目 - List oldConfigAssayMethodProjectList = configAssayMethodProjectMapper.selectByConfigAssayMethodId(configAssayMethodId); - //原检测项目字典id列表 - List oldDictionaryProjectIdList = oldConfigAssayMethodProjectList.stream().map(m -> m.getDictionaryProjectId()).collect(Collectors.toList()); - - - //子样对应的检测任务 - List businessAssayTaskDataDOList = businessAssayTaskDataMapper.selectByBusinessSubSampleId(businessSubSampleId); - - //查询子样配置的方法 - List configSubSampleMethodList = configSubSampleMethodMapper.selectByConfigSubSampleIdAndAssayDepartmentId(businessSubSampleDO.getConfigSubSampleId(), visitDeptId); - - JSONObject jsonObject = null; - for (ConfigSubSampleMethodExtendRespVO configSubSampleMethod : configSubSampleMethodList) { - jsonObject = new JSONObject(); - jsonObject.put("configAssayMethodId", configSubSampleMethod.getConfigAssayMethodId()); - jsonObject.put("configAssayMethodName", configSubSampleMethod.getConfigAssayMethodName()); - jsonObject.put("configAssayMethodCode", configSubSampleMethod.getConfigAssayMethodCode()); - - StringBuilder assayProjectBuilder = new StringBuilder(); - List configAssayMethodProjectList = configAssayMethodProjectMapper.selectByConfigAssayMethodId(configSubSampleMethod.getConfigAssayMethodId()); - - //判定是否存在原检测项目 - boolean isExistProject = configAssayMethodProjectList.stream().anyMatch(m -> oldDictionaryProjectIdList.contains(m.getDictionaryProjectId())); - if (!isExistProject) {//如果不存在,则跳出循环 - continue; - } - - - for (ConfigAssayMethodProjectExtendRespVO configAssayMethodProject : configAssayMethodProjectList) { - assayProjectBuilder.append(configAssayMethodProject.getShowName()).append(","); - } - assayProjectBuilder.delete(assayProjectBuilder.length() - 1 , assayProjectBuilder.length()); - - jsonObject.put("assayProject", assayProjectBuilder.toString()); - - boolean checked = businessAssayTaskDataDOList.stream().anyMatch(m -> m.getConfigAssayMethodId().equals(configSubSampleMethod.getConfigAssayMethodId())); - boolean disabled = businessAssayTaskDataDOList.stream().anyMatch(m -> m.getConfigAssayMethodId().equals(configSubSampleMethod.getConfigAssayMethodId()) && m.getIsAssignTasked().equals(QmsCommonConstant.YES)); - jsonObject.put("checked", checked); - jsonObject.put("disabled", disabled); - - resutList.add(jsonObject); + List businessSubSampleList = businessSubSampleMapper.selectByIds(businessSubSampleIdList); + List configSubSampleIdList = businessSubSampleList.stream().map(m -> m.getConfigSubSampleId()).distinct().collect(Collectors.toList()); + //查询子样分析方法及检测项目 + List configAssayMethodProjectList = configAssayMethodProjectMapper.selectByConfigSubSampleIdsAndAssayDepartmentId(configSubSampleIdList, visitDeptId); + //查询分析方法检测项目 + List list = businessAssayProjectDataMapper.selectAssayMethodProjectByBusinessSubSampleIdListAndConfigAssayMethodId(businessSubSampleIdList, configAssayMethodId); + for (AssayMethodProjectRespVO assayMethodProject : list) { + List methodList = configAssayMethodProjectList.stream().filter(f -> assayMethodProject.getDictionaryProjectId().equals(f.getDictionaryProjectId())).collect(Collectors.toList()); + assayMethodProject.setMethodList(methodList); } - - return resutList; + return list; } + @Override + public List getMaterialAssayStandardMethodProjectList(List businessSubSampleIdList, Long baseSampleId, Long configAssayMethodId) { + //当前登录用户 + LoginUser loginUser = SecurityFrameworkUtils.getLoginUser(); + Long visitDeptId = loginUser.getVisitDeptId(); + //查询子样 +// List businessSubSampleList = businessSubSampleMapper.selectByIds(businessSubSampleIdList); + //子样配置id +// List configSubSampleIdList = businessSubSampleList.stream().map(m -> m.getConfigSubSampleId()).distinct().collect(Collectors.toList()); + //查询子样分析方法及检测项目 +// List configAssayMethodProjectList = configAssayMethodProjectMapper.selectByConfigSubSampleIdsAndAssayDepartmentId(configSubSampleIdList, visitDeptId); + + //查询分析方法检测项目 + List list = businessAssayProjectDataMapper.selectAssayMethodProjectByBusinessSubSampleIdListAndConfigAssayMethodId(businessSubSampleIdList, configAssayMethodId); + + List dictionaryProjectIdList = list.stream().map(m -> m.getDictionaryProjectId()).collect(Collectors.toList()); + + List materialAssayStandardMethodList = materialAssayStandardMethodMapper.selectByBaseSampleIdAndDictionaryProjectIdsAndAssayDepartmentId(baseSampleId, dictionaryProjectIdList, visitDeptId); + + for (AssayMethodProjectRespVO assayMethodProject : list) { + List methodList = materialAssayStandardMethodList.stream().filter(f -> assayMethodProject.getDictionaryProjectId().equals(f.getDictionaryProjectId())).map(m -> { + ConfigAssayMethodProjectExtendRespVO configAssayMethod = new ConfigAssayMethodProjectExtendRespVO(); + configAssayMethod.setConfigAssayMethodId(m.getConfigAssayMethodId()); + configAssayMethod.setConfigAssayMethodName(m.getConfigAssayMethodName()); + configAssayMethod.setConfigAssayMethodNameAndCategory(m.getConfigAssayMethodNameAndCategory()); + return configAssayMethod; + }).collect(Collectors.toList()); + assayMethodProject.setMethodList(methodList); + } + return list; + } + + @Override @Transactional(rollbackFor = Exception.class) public void changeMethod(ChangeAssayMethodReqVO req) { - + List businessSubSampleIdList = req.getBusinessSubSampleIdList(); + Long configAssayMethodId = req.getConfigAssayMethodId(); + List changeConfigAssayMethodProjectList = req.getChangeConfigAssayMethodProjectList(); + List changeConfigAssayMethodIdList = changeConfigAssayMethodProjectList.stream().map(m -> m.getConfigAssayMethodId()).distinct().collect(Collectors.toList()); + + LocalDateTime currentDateTime = LocalDateTime.now(); + + //需要更新的报表数据 List updateBusinessAssayReportDataDOList = new ArrayList<>(); + + //需要更新的分析任务 + List updateBusinessAssayTaskDataDOList = new ArrayList<>(); + //需要更新的分析任务检测项目 + List updateBusinessAssayProjectDataDOList = new ArrayList<>(); + //需要更新的分析任务检测项目参数 + List updateBusinessAssayParameterDataDOList = new ArrayList<>(); + + //需要更新的子样判定 + List updateBusinessSubSampleAssessmentDOList = new ArrayList<>(); + + //需要更新的分样判定 + List updateBusinessSubParentSampleAssessmentDOList = new ArrayList<>(); + + //需要新建的分析任务 List saveBusinessAssayTaskDataDOList = new ArrayList<>(); + //需要新建的分析任务检测项目 List saveBusinessAssayProjectDataDOList = new ArrayList<>(); + //需要新建的分析任务检测项目参数 List saveBusinessAssayParameterDataDOList = new ArrayList<>(); - List removeProjectIdList = new ArrayList<>(); - List removeParameterIdList = new ArrayList<>(); - //子样 - BusinessSubSampleDO businessSubSampleDO = businessSubSampleMapper.selectById(req.getBusinessSubSampleId()); + //需要新建的子样判定 + List saveBusinessSubSampleAssessmentDOList = new ArrayList<>(); - //查询检测任务 - List businessAssayTaskDataDOList = businessAssayTaskDataMapper.selectByBusinessSubParentSampleIdAndConfigAssayMethodId(businessSubSampleDO.getBusinessSubParentSampleId(), req.getConfigAssayMethodId()); + //需要新建的分样判定 + List saveBusinessSubParentSampleAssessmentDOList = new ArrayList<>(); + + //需要删除的分析任务 + List removeAssayTaskDataIdList = new ArrayList<>(); + //需要删除的分析任务检测项目 + List removeAssayProjectIdList = new ArrayList<>(); + //需要删除的分析任务检测项目参数 + List removeAssayParameterIdList = new ArrayList<>(); + + //需要删除的子样判定 + List removeSubSampleAssessmentIdList = new ArrayList<>(); + + //需要删除的分样判定 + List removeSubParentSampleAssessmentIdList = new ArrayList<>(); + + //查询子样 + List businessSubSampleDOList = businessSubSampleMapper.selectByIds(businessSubSampleIdList); + List businessBaseSampleIdList = businessSubSampleDOList.stream().map(m -> m.getBusinessBaseSampleId()).distinct().collect(Collectors.toList()); + List businessSubParentSampleIdList = businessSubSampleDOList.stream().map(m -> m.getBusinessSubParentSampleId()).distinct().collect(Collectors.toList()); + List configSubSampleIdList = businessSubSampleDOList.stream().map(m -> m.getConfigSubSampleId()).distinct().collect(Collectors.toList()); + //查询检测任务 (通过分样id,可以查询双杯样的) + List businessAssayTaskDataDOList = businessAssayTaskDataMapper.selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(businessSubParentSampleIdList, configAssayMethodId); boolean disabled = businessAssayTaskDataDOList.stream().anyMatch(m -> m.getIsAssignTasked().equals(QmsCommonConstant.YES)); if (disabled) { - throw new ServiceException(10010, "当前样品存在已分配任务,不允许修改分析方法"); + throw new ServiceException(1_032_001_000, "当前样品存在已分配任务,不允许修改分析方法"); } + + List businessAssayTaskDataIdList = businessAssayTaskDataDOList.stream().map(m -> m.getId()).collect(Collectors.toList()); + //查询检测任务的检测项目 + List businessAssayProjectDataList = businessAssayProjectDataMapper.selectByBusinessAssayTaskDataIds(businessAssayTaskDataIdList); + List businessAssayProjectDataIdList = businessAssayProjectDataList.stream().map(m -> m.getId()).collect(Collectors.toList()); + //查询检测任务的检测项目的参数 + List businessAssayParameterDataDOList = businessAssayParameterDataMapper.selectByBusinessAssayProjectDataIds(businessAssayProjectDataIdList); + + //查询子样判定 (通过分样id,可以查询双杯样的) + List businessSubSampleAssessmentDOList = businessSubSampleAssessmentMapper.selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(businessSubParentSampleIdList, configAssayMethodId); + + //查询分样判定 + List businessSubParentSampleAssessmentList = businessSubParentSampleAssessmentMapper.selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(businessSubParentSampleIdList, configAssayMethodId); + + //查询要变更的分析方法配置 + List configAssayMethodDOList = configAssayMethodMapper.selectByIds(changeConfigAssayMethodIdList); + //分析方法检测项目配置 + List configAssayMethodProjectList = configAssayMethodProjectMapper.selectByConfigAssayMethodIds(changeConfigAssayMethodIdList); + //分析方法检测项目参数配置 + List configAssayMethodProjectParameterList = configAssayMethodProjectParameterMapper.selectByConfigAssayMethodIds(changeConfigAssayMethodIdList); + //查询要变更的子样及分析方法配置 + List configSubSampleMethodList = configSubSampleMethodMapper.selectByConfigSubSampleIdsAndConfigAssayMethodIds(configSubSampleIdList, changeConfigAssayMethodIdList); + + //循环分样判定 + for (BusinessSubParentSampleAssessmentExtendRespVO businessSubParentSampleAssessment : businessSubParentSampleAssessmentList) { + + //循环变更的分析方法 + for (Long changeConfigAssayMethodId : changeConfigAssayMethodIdList) { + //如果当前分析方法不等于要变更的方法 + if (!businessSubParentSampleAssessment.getConfigAssayMethodId().equals(changeConfigAssayMethodId)) { + //查询是否已有要变更的方法的分样判定 + BusinessSubParentSampleAssessmentDO businessSubParentSampleAssessmentDO = businessSubParentSampleAssessmentMapper.selectByBusinessSubParentSampleIdAndConfigAssayMethodId(businessSubParentSampleAssessment.getBusinessSubParentSampleId(), changeConfigAssayMethodId); + if (businessSubParentSampleAssessmentDO == null) {//不存在 + //根据变更方法过滤出检测项目 + List projectIdList = changeConfigAssayMethodProjectList.stream().filter(f -> f.getConfigAssayMethodId().equals(changeConfigAssayMethodId)).map(m -> m.getDictionaryProjectId()).distinct().collect(Collectors.toList()); + + //查询分析方法 + ConfigAssayMethodDO configAssayMethodDO = configAssayMethodDOList.stream().filter(f -> f.getId().equals(changeConfigAssayMethodId)).findFirst().orElse(null); + //查询子样分析方法 + ConfigSubSampleMethodExtendRespVO configSubSampleMethod = configSubSampleMethodList.stream().filter(f -> f.getConfigSubSampleParentId().equals(businessSubParentSampleAssessment.getConfigSubSampleParentId()) && f.getConfigAssayMethodId().equals(changeConfigAssayMethodId)).findFirst().orElse(null); + + //根据任务数判断是平行还是 + String assayType = configSubSampleMethod.getTaskCount() > 1 ? QmsCommonConstant.ASSAY_TYPE_SINGLE_PARALLEL : QmsCommonConstant.ASSAY_TYPE_SINGLE_CUP; + businessSubParentSampleAssessmentDO = new BusinessSubParentSampleAssessmentDO(); + businessSubParentSampleAssessmentDO.setId(IdWorker.getId()); + businessSubParentSampleAssessmentDO.setBusinessSubParentSampleId(businessSubParentSampleAssessment.getBusinessSubParentSampleId()); + businessSubParentSampleAssessmentDO.setConfigAssayMethodId(changeConfigAssayMethodId); + businessSubParentSampleAssessmentDO.setAssayType(assayType); + businessSubParentSampleAssessmentDO.setTaskType("常规"); + saveBusinessSubParentSampleAssessmentDOList.add(businessSubParentSampleAssessmentDO); + + BusinessSubSampleDO businessSubSampleDO = null; + if (!QmsCommonConstant.ASSAY_TYPE_DOUBLE_CUP.equals(businessSubParentSampleAssessment.getAssayType())) {//如果不为双杯样 + businessSubSampleDO = businessSubSampleDOList.stream().filter(f -> f.getBusinessSubParentSampleId().equals(businessSubParentSampleAssessment.getBusinessSubParentSampleId())).findFirst().orElse(null); + } + + //子样判定数据 + BusinessSubSampleAssessmentDO businessSubSampleAssessmentDO = new BusinessSubSampleAssessmentDO(); + businessSubSampleAssessmentDO.setId(IdWorker.getId()); + businessSubSampleAssessmentDO.setBusinessBaseSampleId(businessSubParentSampleAssessment.getBusinessBaseSampleId()); + businessSubSampleAssessmentDO.setBusinessSubParentSampleId(businessSubParentSampleAssessment.getBusinessSubParentSampleId()); + businessSubSampleAssessmentDO.setBusinessSubParentSampleAssessmentId(businessSubParentSampleAssessmentDO.getId()); + if (businessSubSampleDO != null) { + businessSubSampleAssessmentDO.setBusinessSubSampleId(businessSubSampleDO.getId()); + } + businessSubSampleAssessmentDO.setConfigAssayMethodId(changeConfigAssayMethodId); + businessSubSampleAssessmentDO.setAssayType(assayType); + businessSubSampleAssessmentDO.setTaskType("常规"); + + saveBusinessSubSampleAssessmentDOList.add(businessSubSampleAssessmentDO); + + //查询旧的检测项目 + List oldBusinessAssayProjectDataIdList = businessAssayProjectDataList.stream().filter(f -> projectIdList.contains(f.getDictionaryProjectId()) && f.getBusinessSubParentSampleId().equals(businessSubParentSampleAssessment.getBusinessSubParentSampleId())).map(m -> m.getId()).collect(Collectors.toList()); + //添加到删除列表 + removeAssayProjectIdList.addAll(oldBusinessAssayProjectDataIdList); + List oldBusinessAssayParameterDataIdList = businessAssayParameterDataDOList.stream().filter(f -> oldBusinessAssayProjectDataIdList.contains(f.getBusinessAssayProjectDataId())).map(m -> m.getId()).collect(Collectors.toList()); + removeAssayParameterIdList.addAll(oldBusinessAssayParameterDataIdList); + if (projectIdList.size() == changeConfigAssayMethodProjectList.size()) { + //查询旧的检测任务 + List oldBusinessAssayTaskDataIdList = businessAssayTaskDataDOList.stream().filter(f -> f.getConfigAssayMethodId().equals(configAssayMethodId) && f.getBusinessSubParentSampleId().equals(businessSubParentSampleAssessment.getBusinessSubParentSampleId())).map(m -> m.getId()).collect(Collectors.toList()); + //添加到删除列表 + removeAssayTaskDataIdList.addAll(oldBusinessAssayTaskDataIdList); + //查询旧的子样判定 + List oldBusinessSubSampleAssesmentIdList = businessSubSampleAssessmentDOList.stream().filter(f -> f.getConfigAssayMethodId().equals(configAssayMethodId) && f.getBusinessSubParentSampleId().equals(businessSubParentSampleAssessment.getBusinessSubParentSampleId())).map(m -> m.getId()).collect(Collectors.toList()); + //添加到删除列表 + removeSubSampleAssessmentIdList.addAll(oldBusinessSubSampleAssesmentIdList); + + //添加到删除列表 + removeSubParentSampleAssessmentIdList.add(businessSubParentSampleAssessment.getId()); + } else { + List projectShowNameList = changeConfigAssayMethodProjectList.stream().filter(f -> f.getConfigAssayMethodId().equals(configAssayMethodId)).map(m -> m.getDictionaryProjectShowName()).distinct().collect(Collectors.toList()); + //查询旧的检测任务 + List oldBusinessAssayTaskDataList = businessAssayTaskDataDOList.stream().filter(f -> f.getConfigAssayMethodId().equals(configAssayMethodId) && f.getBusinessSubParentSampleId().equals(businessSubParentSampleAssessment.getBusinessSubParentSampleId())).collect(Collectors.toList()); + for (BusinessAssayTaskDataDO oldBusinessAssayTaskData : oldBusinessAssayTaskDataList) { + boolean isAdd = updateBusinessAssayTaskDataDOList.stream().anyMatch(m -> m.getId().equals(oldBusinessAssayTaskData.getId())); + if (!isAdd) {//如果未添加过更新,则修改检测项目并添加更新 + oldBusinessAssayTaskData.setAssayProject(CollUtil.join(projectShowNameList, ",")); + updateBusinessAssayTaskDataDOList.add(oldBusinessAssayTaskData); + } + } + } + + BusinessAssayTaskDataDO oldBusinessAssayTaskDataDO = businessAssayTaskDataDOList.stream().filter(f -> f.getBusinessSubParentSampleId().equals(businessSubParentSampleAssessment.getBusinessSubParentSampleId())).findFirst().orElse(null); + + //根据检测方法循环 + BusinessAssayTaskDataDO businessAssayTaskDataDO = null; + //根据任务数循环 + for (int i = 0; i < configSubSampleMethod.getTaskCount(); i++) { + //子样检测任务 + businessAssayTaskDataDO = new BusinessAssayTaskDataDO(); + businessAssayTaskDataDO.setId(IdWorker.getId()); + businessAssayTaskDataDO.setBusinessBaseSampleId(businessSubSampleDO.getBusinessBaseSampleId()); + businessAssayTaskDataDO.setBusinessSubParentSampleId(businessSubSampleDO.getBusinessSubParentSampleId()); + businessAssayTaskDataDO.setBusinessSubSampleId(businessSubSampleDO.getId()); + businessAssayTaskDataDO.setBusinessSubSampleAssessmentId(businessSubSampleAssessmentDO.getId());//子样判定id + businessAssayTaskDataDO.setConfigAssayMethodId(changeConfigAssayMethodId); + businessAssayTaskDataDO.setAssayType(assayType); + businessAssayTaskDataDO.setTaskType("常规"); + businessAssayTaskDataDO.setConfigSampleFlowId(oldBusinessAssayTaskDataDO.getConfigSampleFlowId()); + businessAssayTaskDataDO.setSampleFlowNodeKey(oldBusinessAssayTaskDataDO.getSampleFlowNodeKey()); + businessAssayTaskDataDO.setSampleFlowNodeTime(currentDateTime); + businessAssayTaskDataDO.setAssayDepartmentId(configAssayMethodDO.getAssayDepartmentId()); + businessAssayTaskDataDO.setAssayDepartmentName(configAssayMethodDO.getAssayDepartmentName()); + + List configAssayMethodProjectDOList = configAssayMethodProjectList.stream().filter(f -> f.getConfigAssayMethodId().equals(changeConfigAssayMethodId)).collect(Collectors.toList()); + + StringBuilder assayProjectBuilder = new StringBuilder(); + + for (ConfigAssayMethodProjectExtendRespVO configAssayMethodProjectDO : configAssayMethodProjectDOList) { + + //如果当前分析方法的项目不在当前检测项目中,则跳出循环继续 + if (!projectIdList.contains(configAssayMethodProjectDO.getDictionaryProjectId())) { + continue; + } + + assayProjectBuilder.append(configAssayMethodProjectDO.getShowName()).append(","); + + + //检测项目 + BusinessAssayProjectDataDO businessAssayProjectDataDO = new BusinessAssayProjectDataDO(); + businessAssayProjectDataDO.setId(IdWorker.getId()); + businessAssayProjectDataDO.setBusinessAssayTaskDataId(businessAssayTaskDataDO.getId()); + businessAssayProjectDataDO.setConfigAssayMethodProjectId(configAssayMethodProjectDO.getId()); + businessAssayProjectDataDO.setDictionaryProjectId(configAssayMethodProjectDO.getDictionaryProjectId()); + businessAssayProjectDataDO.setDataType(configAssayMethodProjectDO.getDataType()); + businessAssayProjectDataDO.setDecimalPosition(configAssayMethodProjectDO.getDecimalPosition()); + businessAssayProjectDataDO.setUsage(QmsCommonConstant.ASSAY_PROJECT_USAGE_REPORT); + businessAssayProjectDataDO.setMinimumLimitValue(configAssayMethodProjectDO.getMinimumLimitValue()); + businessAssayProjectDataDO.setIsEnabled(QmsCommonConstant.YES); + businessAssayProjectDataDO.setIsNotAssessment(QmsCommonConstant.NO); + + saveBusinessAssayProjectDataDOList.add(businessAssayProjectDataDO); + + List configAssayMethodProjectParameterDOList = configAssayMethodProjectParameterList.stream().filter(f -> f.getConfigAssayMethodProjectId().equals(configAssayMethodProjectDO.getId())).collect(Collectors.toList()); + for (ConfigAssayMethodProjectParameterDO configAssayMethodProjectParameterDO : configAssayMethodProjectParameterDOList) { + BusinessAssayParameterDataDO businessAssayParameterDataDO = new BusinessAssayParameterDataDO(); + businessAssayParameterDataDO.setId(IdWorker.getId()); + businessAssayParameterDataDO.setConfigAssayMethodProjectParameterId(configAssayMethodProjectParameterDO.getId()); + businessAssayParameterDataDO.setBusinessAssayProjectDataId(businessAssayProjectDataDO.getId()); + businessAssayParameterDataDO.setDictionaryParameterId(configAssayMethodProjectParameterDO.getDictionaryParameterId()); + businessAssayParameterDataDO.setDataType(configAssayMethodProjectParameterDO.getDataType()); + businessAssayParameterDataDO.setDecimalPosition(configAssayMethodProjectParameterDO.getDecimalPosition()); + + saveBusinessAssayParameterDataDOList.add(businessAssayParameterDataDO); + } + } + if (assayProjectBuilder.length() > 1) { + assayProjectBuilder.delete(assayProjectBuilder.length() - 1 , assayProjectBuilder.length()); + } + businessAssayTaskDataDO.setAssayProject(assayProjectBuilder.toString()); + saveBusinessAssayTaskDataDOList.add(businessAssayTaskDataDO); + } + + } else {//已存在 + //根据变更方法过滤出检测项目 + List projectIdList = changeConfigAssayMethodProjectList.stream().filter(f -> f.getConfigAssayMethodId().equals(changeConfigAssayMethodId)).map(m -> m.getDictionaryProjectId()).distinct().collect(Collectors.toList()); + + //查询分析方法 + //ConfigAssayMethodDO configAssayMethodDO = configAssayMethodDOList.stream().filter(f -> f.getId().equals(changeConfigAssayMethodId)).findFirst().orElse(null); + //查询子样分析方法 + //ConfigSubSampleMethodExtendRespVO configSubSampleMethod = configSubSampleMethodList.stream().filter(f -> f.getConfigSubSampleParentId().equals(businessSubParentSampleAssessment.getConfigSubSampleParentId()) && f.getConfigAssayMethodId().equals(changeConfigAssayMethodId)).findFirst().orElse(null); + + //根据任务数判断是平行还是 + //String assayType = configSubSampleMethod.getTaskCount() > 1 ? QmsCommonConstant.ASSAY_TYPE_SINGLE_PARALLEL : QmsCommonConstant.ASSAY_TYPE_SINGLE_CUP; + + //查询子样判定 + //BusinessSubSampleAssessmentDO businessSubSampleAssessmentDO = businessSubSampleAssessmentMapper.selectByBusinessSubParentSampleIdAndConfigAssayMethodId(businessSubParentSampleAssessmentDO.getBusinessSubParentSampleId(), changeConfigAssayMethodId); + + //查询旧的检测项目 + List oldBusinessAssayProjectDataIdList = businessAssayProjectDataList.stream().filter(f -> projectIdList.contains(f.getDictionaryProjectId()) && f.getBusinessSubParentSampleId().equals(businessSubParentSampleAssessment.getBusinessSubParentSampleId())).map(m -> m.getId()).collect(Collectors.toList()); + //添加到删除列表 + removeAssayProjectIdList.addAll(oldBusinessAssayProjectDataIdList); + List oldBusinessAssayParameterDataIdList = businessAssayParameterDataDOList.stream().filter(f -> oldBusinessAssayProjectDataIdList.contains(f.getBusinessAssayProjectDataId())).map(m -> m.getId()).collect(Collectors.toList()); + removeAssayParameterIdList.addAll(oldBusinessAssayParameterDataIdList); + if (projectIdList.size() == changeConfigAssayMethodProjectList.size()) { + //查询旧的检测任务 + List oldBusinessAssayTaskDataIdList = businessAssayTaskDataDOList.stream().filter(f -> f.getConfigAssayMethodId().equals(configAssayMethodId) && f.getBusinessSubParentSampleId().equals(businessSubParentSampleAssessment.getBusinessSubParentSampleId())).map(m -> m.getId()).collect(Collectors.toList()); + //添加到删除列表 + removeAssayTaskDataIdList.addAll(oldBusinessAssayTaskDataIdList); + //查询旧的子样判定 + List oldBusinessSubSampleAssesmentIdList = businessSubSampleAssessmentDOList.stream().filter(f -> f.getConfigAssayMethodId().equals(configAssayMethodId) && f.getBusinessSubParentSampleId().equals(businessSubParentSampleAssessment.getBusinessSubParentSampleId())).map(m -> m.getId()).collect(Collectors.toList()); + //添加到删除列表 + removeSubSampleAssessmentIdList.addAll(oldBusinessSubSampleAssesmentIdList); + + //添加到删除列表 + removeSubParentSampleAssessmentIdList.add(businessSubParentSampleAssessment.getId()); + } else { + List projectShowNameList = changeConfigAssayMethodProjectList.stream().filter(f -> f.getConfigAssayMethodId().equals(configAssayMethodId)).map(m -> m.getDictionaryProjectShowName()).distinct().collect(Collectors.toList()); + //查询旧的检测任务 + List oldBusinessAssayTaskDataList = businessAssayTaskDataDOList.stream().filter(f -> f.getConfigAssayMethodId().equals(configAssayMethodId) && f.getBusinessSubParentSampleId().equals(businessSubParentSampleAssessment.getBusinessSubParentSampleId())).collect(Collectors.toList()); + for (BusinessAssayTaskDataDO oldBusinessAssayTaskData : oldBusinessAssayTaskDataList) { + boolean isAdd = updateBusinessAssayTaskDataDOList.stream().anyMatch(m -> m.getId().equals(oldBusinessAssayTaskData.getId())); + if (!isAdd) {//如果未添加过更新,则修改检测项目并添加更新 + oldBusinessAssayTaskData.setAssayProject(CollUtil.join(projectShowNameList, ",")); + updateBusinessAssayTaskDataDOList.add(oldBusinessAssayTaskData); + } + } + } + + //查询当前存在的分析任务 + List currBusinessAssayTaskDataDOList = businessAssayTaskDataMapper.selectByBusinessSubParentSampleIdAndConfigAssayMethodId(businessSubParentSampleAssessmentDO.getBusinessSubParentSampleId(), changeConfigAssayMethodId); + + //当前存在的分析任务循环 + for (BusinessAssayTaskDataDO businessAssayTaskDataDO : currBusinessAssayTaskDataDOList) { + + List configAssayMethodProjectDOList = configAssayMethodProjectList.stream().filter(f -> f.getConfigAssayMethodId().equals(changeConfigAssayMethodId)).collect(Collectors.toList()); + + StringBuilder assayProjectBuilder = new StringBuilder(businessAssayTaskDataDO.getAssayProject()); + assayProjectBuilder.append(","); + + for (ConfigAssayMethodProjectExtendRespVO configAssayMethodProjectDO : configAssayMethodProjectDOList) { + + //如果当前分析方法的项目不在当前检测项目中,则跳出循环继续 + if (!projectIdList.contains(configAssayMethodProjectDO.getDictionaryProjectId())) { + continue; + } + + assayProjectBuilder.append(configAssayMethodProjectDO.getShowName()).append(","); + + + //检测项目 + BusinessAssayProjectDataDO businessAssayProjectDataDO = new BusinessAssayProjectDataDO(); + businessAssayProjectDataDO.setId(IdWorker.getId()); + businessAssayProjectDataDO.setBusinessAssayTaskDataId(businessAssayTaskDataDO.getId()); + businessAssayProjectDataDO.setConfigAssayMethodProjectId(configAssayMethodProjectDO.getId()); + businessAssayProjectDataDO.setDictionaryProjectId(configAssayMethodProjectDO.getDictionaryProjectId()); + businessAssayProjectDataDO.setDataType(configAssayMethodProjectDO.getDataType()); + businessAssayProjectDataDO.setDecimalPosition(configAssayMethodProjectDO.getDecimalPosition()); + businessAssayProjectDataDO.setUsage(QmsCommonConstant.ASSAY_PROJECT_USAGE_REPORT); + businessAssayProjectDataDO.setMinimumLimitValue(configAssayMethodProjectDO.getMinimumLimitValue()); + businessAssayProjectDataDO.setIsEnabled(QmsCommonConstant.YES); + businessAssayProjectDataDO.setIsNotAssessment(QmsCommonConstant.NO); + + saveBusinessAssayProjectDataDOList.add(businessAssayProjectDataDO); + + List configAssayMethodProjectParameterDOList = configAssayMethodProjectParameterList.stream().filter(f -> f.getConfigAssayMethodProjectId().equals(configAssayMethodProjectDO.getId())).collect(Collectors.toList()); + for (ConfigAssayMethodProjectParameterDO configAssayMethodProjectParameterDO : configAssayMethodProjectParameterDOList) { + BusinessAssayParameterDataDO businessAssayParameterDataDO = new BusinessAssayParameterDataDO(); + businessAssayParameterDataDO.setId(IdWorker.getId()); + businessAssayParameterDataDO.setConfigAssayMethodProjectParameterId(configAssayMethodProjectParameterDO.getId()); + businessAssayParameterDataDO.setBusinessAssayProjectDataId(businessAssayProjectDataDO.getId()); + businessAssayParameterDataDO.setDictionaryParameterId(configAssayMethodProjectParameterDO.getDictionaryParameterId()); + businessAssayParameterDataDO.setDataType(configAssayMethodProjectParameterDO.getDataType()); + businessAssayParameterDataDO.setDecimalPosition(configAssayMethodProjectParameterDO.getDecimalPosition()); + + saveBusinessAssayParameterDataDOList.add(businessAssayParameterDataDO); + } + } + if (assayProjectBuilder.length() > 1) { + assayProjectBuilder.delete(assayProjectBuilder.length() - 1 , assayProjectBuilder.length()); + } + businessAssayTaskDataDO.setAssayProject(assayProjectBuilder.toString()); + updateBusinessAssayTaskDataDOList.add(businessAssayTaskDataDO); + } + + + } + + } + + } + + } + //查询报表数据 - List businessAssayReportDataDOList = businessAssayReportDataMapper.selectBytBusinessBaseSampleId(businessSubSampleDO.getBusinessBaseSampleId()); + List businessAssayReportDataDOList = businessAssayReportDataMapper.selectBytBusinessBaseSampleIds(businessBaseSampleIdList); for (BusinessAssayReportDataDO businessAssayReportDataDO : businessAssayReportDataDOList) { String dataSource = businessAssayReportDataDO.getDataSource(); if (dataSource.contains(req.getConfigAssayMethodId().toString())) {//判定是否存在 @@ -269,10 +616,11 @@ public class SampleTaskAssignServiceImpl implements SampleTaskAssignService { for (int i = 0; i < dataSourceSplit.length; i++) { dataSourceList.add(Long.parseLong(dataSourceSplit[i])); } + //移除当前的 dataSourceList.remove(req.getConfigAssayMethodId()); //添加新的 - dataSourceList.addAll(req.getChangeConfigAssayMethodIdList()); + dataSourceList.addAll(changeConfigAssayMethodIdList); //重新赋值 businessAssayReportDataDO.setDataSource(CollUtil.join(dataSourceList, ",")); @@ -280,92 +628,56 @@ public class SampleTaskAssignServiceImpl implements SampleTaskAssignService { //添加到更新列表 updateBusinessAssayReportDataDOList.add(businessAssayReportDataDO); } - - } - - for (BusinessAssayTaskDataDO businessAssayTaskDataDO : businessAssayTaskDataDOList) { - //查询旧的 - List businessAssayProjectDataExtendRespVOs = businessAssayProjectDataMapper.selectByBusinessAssayTaskDataId(businessAssayTaskDataDO.getId()); - List businessAssayProjectDataIdList = businessAssayProjectDataExtendRespVOs.stream().map(m -> m.getId()).collect(Collectors.toList()); - removeProjectIdList.addAll(businessAssayProjectDataIdList); - List businessAssayParameterDataDOList = businessAssayParameterDataMapper.selectByBusinessAssayProjectDataIds(businessAssayProjectDataIdList); - List businessAssayParameterDataDOIdList = businessAssayParameterDataDOList.stream().map(m -> m.getId()).collect(Collectors.toList()); - removeParameterIdList.addAll(businessAssayParameterDataDOIdList); - - int i = 0; - for (Long configAssayMethodId : req.getChangeConfigAssayMethodIdList()) { - Long businessAssayTaskDataId = null; - if (i == 0) { - businessAssayTaskDataId = businessAssayTaskDataDO.getId(); - businessAssayTaskDataDO.setConfigAssayMethodId(configAssayMethodId); - } else { - businessAssayTaskDataId = IdWorker.getId(); - BusinessAssayTaskDataDO newBusinessAssayTaskDataDO = new BusinessAssayTaskDataDO(); - newBusinessAssayTaskDataDO.setId(businessAssayTaskDataId); - newBusinessAssayTaskDataDO.setBusinessBaseSampleId(businessSubSampleDO.getBusinessBaseSampleId()); - newBusinessAssayTaskDataDO.setBusinessSubParentSampleId(businessSubSampleDO.getBusinessSubParentSampleId()); - newBusinessAssayTaskDataDO.setBusinessSubSampleId(businessSubSampleDO.getId()); - newBusinessAssayTaskDataDO.setConfigAssayMethodId(configAssayMethodId); - newBusinessAssayTaskDataDO.setAssayType(businessAssayTaskDataDO.getAssayType()); - newBusinessAssayTaskDataDO.setTaskType(businessAssayTaskDataDO.getTaskType()); - newBusinessAssayTaskDataDO.setConfigSampleFlowId(businessAssayTaskDataDO.getConfigSampleFlowId()); - newBusinessAssayTaskDataDO.setSampleFlowNodeKey(businessAssayTaskDataDO.getSampleFlowNodeKey()); - newBusinessAssayTaskDataDO.setSampleFlowNodeTime(businessAssayTaskDataDO.getSampleFlowNodeTime()); - newBusinessAssayTaskDataDO.setAssayDepartmentId(businessAssayTaskDataDO.getAssayDepartmentId()); - newBusinessAssayTaskDataDO.setAssayDepartmentName(businessAssayTaskDataDO.getAssayDepartmentName()); - - saveBusinessAssayTaskDataDOList.add(newBusinessAssayTaskDataDO); - } - - //查询新的检测项目 - List configAssayMethodProjectDOList = configAssayMethodProjectMapper.selectByConfigAssayMethodId(businessAssayTaskDataDO.getConfigAssayMethodId()); - - StringBuilder assayProjectBuilder = new StringBuilder(); - - for (ConfigAssayMethodProjectExtendRespVO configAssayMethodProjectDO : configAssayMethodProjectDOList) { - assayProjectBuilder.append(configAssayMethodProjectDO.getShowName()).append(","); - - //检测项目 - BusinessAssayProjectDataDO businessAssayProjectDataDO = new BusinessAssayProjectDataDO(); - businessAssayProjectDataDO.setId(IdWorker.getId()); - businessAssayProjectDataDO.setBusinessAssayTaskDataId(businessAssayTaskDataDO.getId()); - businessAssayProjectDataDO.setConfigAssayMethodProjectId(configAssayMethodProjectDO.getId()); - businessAssayProjectDataDO.setDictionaryProjectId(configAssayMethodProjectDO.getDictionaryProjectId()); - businessAssayProjectDataDO.setDataType(configAssayMethodProjectDO.getDataType()); - businessAssayProjectDataDO.setDecimalPosition(configAssayMethodProjectDO.getDecimalPosition()); - businessAssayProjectDataDO.setIsEnabled(1); - businessAssayProjectDataDO.setIsNotAssessment(0); - - saveBusinessAssayProjectDataDOList.add(businessAssayProjectDataDO); - - List configAssayMethodProjectParameterDOList = configAssayMethodProjectParameterMapper.selectByConfigAssayMethodProjectId(configAssayMethodProjectDO.getId()); - for (ConfigAssayMethodProjectParameterDO configAssayMethodProjectParameterDO : configAssayMethodProjectParameterDOList) { - BusinessAssayParameterDataDO businessAssayParameterDataDO = new BusinessAssayParameterDataDO(); - businessAssayParameterDataDO.setId(IdWorker.getId()); - businessAssayParameterDataDO.setConfigAssayMethodProjectParameterId(configAssayMethodProjectParameterDO.getId()); - businessAssayParameterDataDO.setBusinessAssayProjectDataId(businessAssayProjectDataDO.getId()); - businessAssayParameterDataDO.setDictionaryParameterId(configAssayMethodProjectParameterDO.getDictionaryParameterId()); - businessAssayParameterDataDO.setDataType(configAssayMethodProjectParameterDO.getDataType()); - businessAssayParameterDataDO.setDecimalPosition(configAssayMethodProjectParameterDO.getDecimalPosition()); - - - saveBusinessAssayParameterDataDOList.add(businessAssayParameterDataDO); - } - } - - i++; - } - - } - businessAssayTaskDataMapper.updateBatch(businessAssayTaskDataDOList); - businessAssayProjectDataMapper.deleteByIds(removeProjectIdList); - businessAssayParameterDataMapper.deleteByIds(removeParameterIdList); - //更新报表数据来源 + + + //======================== 删除 ===================================================================== + + if (removeAssayTaskDataIdList.size() > 0) { + businessAssayTaskDataMapper.deleteByIds(removeAssayTaskDataIdList); + } + if (removeAssayProjectIdList.size() > 0) { + businessAssayProjectDataMapper.deleteByIds(removeAssayProjectIdList); + } + if (removeAssayParameterIdList.size() > 0) { + businessAssayParameterDataMapper.deleteByIds(removeAssayParameterIdList); + } + + if (removeSubSampleAssessmentIdList.size() > 0) { + businessSubSampleAssessmentMapper.deleteByIds(removeSubSampleAssessmentIdList); + } + + if (removeSubParentSampleAssessmentIdList.size() > 0) { + businessSubParentSampleAssessmentMapper.deleteByIds(removeSubParentSampleAssessmentIdList); + } + + //======================== 修改 ===================================================================== + if (updateBusinessAssayReportDataDOList.size() > 0) { businessAssayReportDataMapper.updateBatch(updateBusinessAssayReportDataDOList); } + + if (updateBusinessAssayTaskDataDOList.size() > 0) { + businessAssayTaskDataMapper.updateBatch(updateBusinessAssayTaskDataDOList); + } + if (updateBusinessAssayProjectDataDOList.size() > 0) { + businessAssayProjectDataMapper.updateBatch(updateBusinessAssayProjectDataDOList); + } + if (updateBusinessAssayParameterDataDOList.size() > 0) { + businessAssayParameterDataMapper.updateBatch(updateBusinessAssayParameterDataDOList); + } + + if (updateBusinessSubSampleAssessmentDOList.size() > 0) { + businessSubSampleAssessmentMapper.updateBatch(updateBusinessSubSampleAssessmentDOList); + } + + if (updateBusinessSubParentSampleAssessmentDOList.size() > 0) { + businessSubParentSampleAssessmentMapper.updateBatch(updateBusinessSubParentSampleAssessmentDOList); + } + + //======================== 新建 ===================================================================== + if (saveBusinessAssayTaskDataDOList.size() > 0) { businessAssayTaskDataMapper.insertBatch(saveBusinessAssayTaskDataDOList); } @@ -375,6 +687,17 @@ public class SampleTaskAssignServiceImpl implements SampleTaskAssignService { if (saveBusinessAssayParameterDataDOList.size() > 0) { businessAssayParameterDataMapper.insertBatch(saveBusinessAssayParameterDataDOList); } + + if (saveBusinessSubSampleAssessmentDOList.size() > 0) { + businessSubSampleAssessmentMapper.insertBatch(saveBusinessSubSampleAssessmentDOList); + } + + if (saveBusinessSubParentSampleAssessmentDOList.size() > 0) { + businessSubParentSampleAssessmentMapper.insertBatch(saveBusinessSubParentSampleAssessmentDOList); + } + + + } @Override @@ -451,12 +774,16 @@ public class SampleTaskAssignServiceImpl implements SampleTaskAssignService { List businessAssayTaskDataDOList = businessAssayTaskDataMapper.selectList(new LambdaQueryWrapperX().eq(BusinessAssayTaskDataDO::getBusinessAssayTaskId, businessAssayTaskDO.getId())); for (BusinessAssayTaskDataDO businessAssayTaskDataDO : businessAssayTaskDataDOList) { + businessAssayTaskDataDO.setBusinessAssayTaskId(null); + businessAssayTaskDataDO.setAssayOperatorId(null); businessAssayTaskDataDO.setAssayOperator(null); businessAssayTaskDataDO.setAssignTaskTime(null); businessAssayTaskDataDO.setIsAssignTasked(0); } businessAssayTaskMapper.updateById(businessAssayTaskDO); - businessAssayTaskDataMapper.updateBatch(businessAssayTaskDataDOList); + if (CollUtil.isNotEmpty(businessAssayTaskDataDOList)) { + businessAssayTaskDataMapper.updateBatch(businessAssayTaskDataDOList); + } } @Override @@ -482,6 +809,7 @@ public class SampleTaskAssignServiceImpl implements SampleTaskAssignService { @Transactional(rollbackFor = Exception.class) public void createQcSample(CreateQcSampleReqVO req) { List businessQCManagementDataDOList = new ArrayList<>(); + List businessQCManagementSampleParameterDataDOList = new ArrayList<>(); List businessQCManagementProjectDataDOList = new ArrayList<>(); List businessQCManagementParameterDataDOList = new ArrayList<>(); @@ -496,7 +824,7 @@ public class SampleTaskAssignServiceImpl implements SampleTaskAssignService { ConfigQCSampleMethodExtendRespVO configQCSampleMethod = configQCSampleMethodMapper.selectByConfigAssayMethodIdAndDictionaryBusinessKey(businessAssayTaskDO.getConfigAssayMethodId(), req.getDictionaryBusinessKey()); - if ("kby".equals(req.getDictionaryBusinessKey()) || "by".equals(req.getDictionaryBusinessKey())) {//空白样和标样 + if ("withoutProject".equals(req.getParentDictionaryBusinesskey())) {//不带检测项目的:如 空白样和标样 BusinessQCCoefficientDataDO businessQCCoefficientDataDO = new BusinessQCCoefficientDataDO(); businessQCCoefficientDataDO.setId(IdWorker.getId()); @@ -540,10 +868,26 @@ public class SampleTaskAssignServiceImpl implements SampleTaskAssignService { businessQCCoefficientParameterDataDOList.add(businessQCCoefficientParameterDataDO); } - } else {//管理样与标准样 + } else {//带检测项目的 如: 管理样、标准样、质控空白样、监控样 //分析项目 List configAssayMethodProjectExtendRespList = configAssayMethodProjectMapper.selectByConfigAssayMethodId(businessAssayTaskDO.getConfigAssayMethodId()); - List configAssayMethodProjectIds = configAssayMethodProjectExtendRespList.stream().map(m -> m.getId()).collect(Collectors.toList()); + //检测项目id + List dictionaryProjectIdList = new ArrayList<>(); + //必须要检测的项目 + String mustProject = configQCSampleMethod.getMustProject(); + if (StringUtils.isNotBlank(mustProject)) { + String[] mustProjects = mustProject.split(","); + for (String dicProjectId : mustProjects) { + dictionaryProjectIdList.add(Long.parseLong(dicProjectId)); + } + } + //当前任务的检测项目列表 + List businessAssayProjectDataList = businessAssayProjectDataMapper.selectByBusinessAssayTaskId(req.getBusinessAssayTaskId()); + //获取当前任务的检测项目id列表 + List busTaskDictionaryProjectIdList = businessAssayProjectDataList.stream().map(m -> m.getDictionaryProjectId()).distinct().collect(Collectors.toList()); + dictionaryProjectIdList.addAll(busTaskDictionaryProjectIdList); + //获取需要创建的检测项目id + List configAssayMethodProjectIds = configAssayMethodProjectExtendRespList.stream().filter(f -> dictionaryProjectIdList.contains(f.getDictionaryProjectId())).map(m -> m.getId()).collect(Collectors.toList()); //分析项目参数 List configAssayMethodProjectParameterList = configAssayMethodProjectParameterMapper.selectByConfigAssayMethodProjectIds(configAssayMethodProjectIds); //分析项目 @@ -570,8 +914,27 @@ public class SampleTaskAssignServiceImpl implements SampleTaskAssignService { businessQCManagementDataDO.setIsReported(QmsCommonConstant.NO); businessQCManagementDataDOList.add(businessQCManagementDataDO); + + + //分析方法参数配置 + List configAssayMethodParameterDOList = configAssayMethodParameterMapper.selectByConfigAssayMethodId(businessAssayTaskDO.getConfigAssayMethodId()); + BusinessQCManagementSampleParameterDataDO businessQCManagementSampleParameterDataDO = null; + for (ConfigAssayMethodParameterDO configAssayMethodParameterDO : configAssayMethodParameterDOList) { + businessQCManagementSampleParameterDataDO = new BusinessQCManagementSampleParameterDataDO(); + businessQCManagementSampleParameterDataDO.setId(IdWorker.getId()); + businessQCManagementSampleParameterDataDO.setBusinessQCManagementDataId(businessQCManagementDataDO.getId()); + businessQCManagementSampleParameterDataDO.setConfigAssayMethodParameterId(configAssayMethodParameterDO.getId()); + businessQCManagementSampleParameterDataDO.setDataType(configAssayMethodParameterDO.getDataType()); + businessQCManagementSampleParameterDataDO.setDecimalPosition(configAssayMethodParameterDO.getDecimalPosition()); + + businessQCManagementSampleParameterDataDOList.add(businessQCManagementSampleParameterDataDO); + } for (ConfigAssayMethodProjectExtendRespVO configAssayMethodProjectExtendRespVO : configAssayMethodProjectExtendRespList) { + if (!dictionaryProjectIdList.contains(configAssayMethodProjectExtendRespVO.getDictionaryProjectId())) {//不存在则跳过 + continue; + } + BusinessQCManagementProjectDataDO businessQCManagementProjectDataDO = new BusinessQCManagementProjectDataDO(); businessQCManagementProjectDataDO.setId(IdWorker.getId()); businessQCManagementProjectDataDO.setBusinessQCManagementDataId(businessQCManagementDataDO.getId()); @@ -604,6 +967,9 @@ public class SampleTaskAssignServiceImpl implements SampleTaskAssignService { if (CollUtil.isNotEmpty(businessQCManagementDataDOList)) { businessQCManagementDataMapper.insertBatch(businessQCManagementDataDOList); } + if (CollUtil.isNotEmpty(businessQCManagementSampleParameterDataDOList)) { + businessQCManagementSampleParameterDataMapper.insertBatch(businessQCManagementSampleParameterDataDOList); + } if (CollUtil.isNotEmpty(businessQCManagementProjectDataDOList)) { businessQCManagementProjectDataMapper.insertBatch(businessQCManagementProjectDataDOList); } @@ -621,10 +987,10 @@ public class SampleTaskAssignServiceImpl implements SampleTaskAssignService { @Override @Transactional(rollbackFor = Exception.class) public void deleteQcSample(DeleteQcSampleReqVO req) { - if ("kby".equals(req.getDictionaryBusinessKey()) || "by".equals(req.getDictionaryBusinessKey())) {//空白样和标样 + if ("withoutProject".equals(req.getParentDictionaryBusinesskey())) {//不带检测项目的 空白样和标样 businessQCCoefficientDataMapper.deleteByIds(req.getQcSampleIdList()); businessQCCoefficientParameterDataMapper.delete(new LambdaQueryWrapperX().in(BusinessQCCoefficientParameterDataDO::getBusinessQCCoefficientDataId, req.getQcSampleIdList())); - } else { //管理样和标准样 + } else { //带检测项目的 管理样和标准样 businessQCManagementDataMapper.deleteByIds(req.getQcSampleIdList()); List businessQCManagementProjectDataList = businessQCManagementProjectDataMapper.selectByBusinessQCManagementDataIds(req.getQcSampleIdList()); List businessQCManagementProjectDataIdList = businessQCManagementProjectDataList.stream().map(m -> m.getId()).collect(Collectors.toList()); diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/BaseSampleController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/BaseSampleController.java index 00e7fc2..4329898 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/BaseSampleController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/BaseSampleController.java @@ -99,6 +99,13 @@ public class BaseSampleController implements BusinessControllerMarker { PageResult pageResult = baseSampleService.getBaseSamplePage(pageReqVO); return success(BeanUtils.toBean(pageResult, BaseSampleRespVO.class)); } + + @GetMapping("/list") + @Operation(summary = "获得样品大类管理列表") + public CommonResult getBaseSampleList(BaseSamplePageReqVO reqVO) { + List list = baseSampleService.getBaseSampleList(reqVO); + return success(list); + } @GetMapping("/export-excel") @Operation(summary = "导出样品大类管理 Excel") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigAssayMethodParameterController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigAssayMethodParameterController.java new file mode 100644 index 0000000..b68d6f1 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigAssayMethodParameterController.java @@ -0,0 +1,106 @@ +package com.zt.plat.module.qms.business.config.controller.admin; + +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.module.qms.business.config.controller.vo.*; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodParameterDO; +import com.zt.plat.module.qms.business.config.service.ConfigAssayMethodParameterService; +import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog; +import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; + +@Tag(name = "管理后台 - 检测方法参数配置") +@RestController +@RequestMapping("/qms/config-assay-method-parameter") +@Validated +public class ConfigAssayMethodParameterController implements BusinessControllerMarker { + + + @Resource + private ConfigAssayMethodParameterService configAssayMethodParameterService; + + @PostMapping("/create") + @Operation(summary = "创建检测方法参数配置") + @PreAuthorize("@ss.hasPermission('qms:config-assay-method-parameter:create')") + public CommonResult createConfigAssayMethodParameter(@Valid @RequestBody ConfigAssayMethodParameterSaveReqVO createReqVO) { + return success(configAssayMethodParameterService.createConfigAssayMethodParameter(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新检测方法参数配置") + @PreAuthorize("@ss.hasPermission('qms:config-assay-method-parameter:update')") + public CommonResult updateConfigAssayMethodParameter(@Valid @RequestBody ConfigAssayMethodParameterSaveReqVO updateReqVO) { + configAssayMethodParameterService.updateConfigAssayMethodParameter(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除检测方法参数配置") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('qms:config-assay-method-parameter:delete')") + public CommonResult deleteConfigAssayMethodParameter(@RequestParam("id") Long id) { + configAssayMethodParameterService.deleteConfigAssayMethodParameter(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除检测方法参数配置") + @PreAuthorize("@ss.hasPermission('qms:config-assay-method-parameter:delete')") + public CommonResult deleteConfigAssayMethodParameterList(@RequestBody BatchDeleteReqVO req) { + configAssayMethodParameterService.deleteConfigAssayMethodParameterListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得检测方法参数配置") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('qms:config-assay-method-parameter:query')") + public CommonResult getConfigAssayMethodParameter(@RequestParam("id") Long id) { + ConfigAssayMethodParameterDO configAssayMethodParameter = configAssayMethodParameterService.getConfigAssayMethodParameter(id); + return success(BeanUtils.toBean(configAssayMethodParameter, ConfigAssayMethodParameterRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得检测方法参数配置分页") + @PreAuthorize("@ss.hasPermission('qms:config-assay-method-parameter:query')") + public CommonResult> getConfigAssayMethodParameterPage(@Valid ConfigAssayMethodParameterPageReqVO pageReqVO) { + PageResult pageResult = configAssayMethodParameterService.getConfigAssayMethodParameterPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, ConfigAssayMethodParameterRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出检测方法参数配置 Excel") + @PreAuthorize("@ss.hasPermission('qms:config-assay-method-parameter:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportConfigAssayMethodParameterExcel(@Valid ConfigAssayMethodParameterPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = configAssayMethodParameterService.getConfigAssayMethodParameterPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "检测方法参数配置.xls", "数据", ConfigAssayMethodParameterRespVO.class, + BeanUtils.toBean(list, ConfigAssayMethodParameterRespVO.class)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigEntrustSourceSampleTypeController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigEntrustSourceSampleTypeController.java new file mode 100644 index 0000000..6c7da2e --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigEntrustSourceSampleTypeController.java @@ -0,0 +1,106 @@ +package com.zt.plat.module.qms.business.config.controller.admin; + +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.module.qms.business.config.controller.vo.*; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigEntrustSourceSampleTypeDO; +import com.zt.plat.module.qms.business.config.service.ConfigEntrustSourceSampleTypeService; +import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog; +import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; + +@Tag(name = "管理后台 - 检验委托来源与样品类型配置") +@RestController +@RequestMapping("/qms/config-entrust-source-sample-type") +@Validated +public class ConfigEntrustSourceSampleTypeController implements BusinessControllerMarker { + + + @Resource + private ConfigEntrustSourceSampleTypeService configEntrustSourceSampleTypeService; + + @PostMapping("/create") + @Operation(summary = "创建检验委托来源与样品类型配置") + @PreAuthorize("@ss.hasPermission('qms:config-entrust-source-sample-type:create')") + public CommonResult createConfigEntrustSourceSampleType(@Valid @RequestBody ConfigEntrustSourceSampleTypeSaveReqVO createReqVO) { + return success(configEntrustSourceSampleTypeService.createConfigEntrustSourceSampleType(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新检验委托来源与样品类型配置") + @PreAuthorize("@ss.hasPermission('qms:config-entrust-source-sample-type:update')") + public CommonResult updateConfigEntrustSourceSampleType(@Valid @RequestBody ConfigEntrustSourceSampleTypeSaveReqVO updateReqVO) { + configEntrustSourceSampleTypeService.updateConfigEntrustSourceSampleType(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除检验委托来源与样品类型配置") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('qms:config-entrust-source-sample-type:delete')") + public CommonResult deleteConfigEntrustSourceSampleType(@RequestParam("id") Long id) { + configEntrustSourceSampleTypeService.deleteConfigEntrustSourceSampleType(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除检验委托来源与样品类型配置") + @PreAuthorize("@ss.hasPermission('qms:config-entrust-source-sample-type:delete')") + public CommonResult deleteConfigEntrustSourceSampleTypeList(@RequestBody BatchDeleteReqVO req) { + configEntrustSourceSampleTypeService.deleteConfigEntrustSourceSampleTypeListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得检验委托来源与样品类型配置") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('qms:config-entrust-source-sample-type:query')") + public CommonResult getConfigEntrustSourceSampleType(@RequestParam("id") Long id) { + ConfigEntrustSourceSampleTypeDO configEntrustSourceSampleType = configEntrustSourceSampleTypeService.getConfigEntrustSourceSampleType(id); + return success(BeanUtils.toBean(configEntrustSourceSampleType, ConfigEntrustSourceSampleTypeRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得检验委托来源与样品类型配置分页") + @PreAuthorize("@ss.hasPermission('qms:config-entrust-source-sample-type:query')") + public CommonResult> getConfigEntrustSourceSampleTypePage(@Valid ConfigEntrustSourceSampleTypePageReqVO pageReqVO) { + PageResult pageResult = configEntrustSourceSampleTypeService.getConfigEntrustSourceSampleTypePage(pageReqVO); + return success(BeanUtils.toBean(pageResult, ConfigEntrustSourceSampleTypeRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出检验委托来源与样品类型配置 Excel") + @PreAuthorize("@ss.hasPermission('qms:config-entrust-source-sample-type:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportConfigEntrustSourceSampleTypeExcel(@Valid ConfigEntrustSourceSampleTypePageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = configEntrustSourceSampleTypeService.getConfigEntrustSourceSampleTypePage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "检验委托来源与样品类型配置.xls", "数据", ConfigEntrustSourceSampleTypeRespVO.class, + BeanUtils.toBean(list, ConfigEntrustSourceSampleTypeRespVO.class)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigReportTemplateController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigReportTemplateController.java index 4cd4efd..1a0369f 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigReportTemplateController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigReportTemplateController.java @@ -3,109 +3,41 @@ package com.zt.plat.module.qms.business.config.controller.admin; import com.zt.plat.module.qms.business.config.controller.vo.ConfigReportTemplatePageReqVO; import com.zt.plat.module.qms.business.config.controller.vo.ConfigReportTemplateRespVO; import com.zt.plat.module.qms.business.config.controller.vo.ConfigReportTemplateSaveReqVO; -import com.zt.plat.module.qms.business.config.controller.vo.GenReportBody; import org.springframework.web.bind.annotation.*; -import org.springframework.web.util.UriUtils; - -import com.alibaba.fastjson.JSON; -import com.baomidou.mybatisplus.core.toolkit.StringPool; - import jakarta.annotation.Resource; import org.springframework.validation.annotation.Validated; -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.text.StringEscapeUtils; -import org.springframework.core.io.ByteArrayResource; -import org.springframework.core.io.FileSystemResource; -import org.springframework.core.io.support.ResourceRegion; -import org.springframework.http.HttpHeaders; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -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 lombok.extern.slf4j.Slf4j; import jakarta.validation.*; import jakarta.servlet.http.*; -import java.io.File; import java.io.IOException; -import java.nio.charset.StandardCharsets; -import java.util.Collection; -import java.util.HashMap; import java.util.List; -import java.util.Map; - import com.zt.plat.framework.common.pojo.PageParam; import com.zt.plat.framework.common.pojo.PageResult; -import com.zt.plat.framework.common.exception.ServiceException; import com.zt.plat.framework.common.pojo.CommonResult; import com.zt.plat.framework.common.util.object.BeanUtils; -import com.zt.plat.framework.common.util.servlet.ServletUtils; - import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; -import com.zt.plat.framework.security.config.SecurityProperties; -import com.zt.plat.framework.security.core.LoginUser; -import com.zt.plat.framework.security.core.util.SecurityFrameworkUtils; -import cn.hutool.core.bean.BeanUtil; -import cn.hutool.core.codec.Base64; -import cn.hutool.core.util.ArrayUtil; -import cn.hutool.core.util.ObjectUtil; -import cn.hutool.core.util.StrUtil; -import cn.hutool.http.HttpRequest; -import cn.hutool.http.HttpResponse; 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.business.config.dal.dataobject.ConfigReportTemplateDO; -import com.zt.plat.module.qms.enums.ErrorCodeConstants; -import com.zt.plat.module.qms.framework.gridreport.GridReport; -import com.zt.plat.module.qms.framework.gridreport.PdfHelper; -import com.zt.plat.module.qms.framework.gridreport.exception.GridReportException; import com.zt.plat.module.qms.business.config.service.ConfigReportTemplateService; -import gridreport.jni.BinaryObject; -import gridreport.jni.ExportImageType; -import gridreport.jni.ExportType; -import gridreport.jni.Report; @Tag(name = "管理后台 - 报表模版配置") @RestController @RequestMapping("/qms/config-report-template") @Validated -@Slf4j -public class ConfigReportTemplateController { - - public static final String WR_PREFIX = "_WR_"; - - @Resource - private GridReport gridReport; - - @Resource - private SecurityProperties securityProperties; +public class ConfigReportTemplateController implements BusinessControllerMarker { @Resource private ConfigReportTemplateService configReportTemplateService; - @GetMapping("/info") - @Operation(summary = "获取报表信息") - public CommonResult info() { - Map data = new HashMap<>(); - try { - String moduleInfo = Report.getModuleInfo(); - String moduleVersion = Report.getModuleVersion(); - String modulePath = Report.getModulePath(); - data.put("moduleInfo", moduleInfo); - data.put("moduleVersion", moduleVersion); - data.put("modulePath", modulePath); - } catch (Exception e) { - } - return success(data); - } @PostMapping("/create") @Operation(summary = "创建报表模版配置") @@ -179,460 +111,4 @@ public class ConfigReportTemplateController { BeanUtils.toBean(list, ConfigReportTemplateRespVO.class)); } - /*** - * 预览报表 - * @param reportId - * @param reportKey - * @param dataUrl - * @param isCrypto - * @param type - * @return - * @throws Exception - */ - @GetMapping("/preview") - @Operation(summary = "预览报表") - public ResponseEntity preview(Long reportId, String reportKey, String dataUrl, Boolean isCrypto, String type) throws Exception { - HttpServletRequest request = ServletUtils.getRequest(); - ConfigReportTemplateDO gridppReportFile = null; - if (reportId != null) { - gridppReportFile = configReportTemplateService.getConfigReportTemplate(reportId); - } else if (StrUtil.isNotBlank(reportKey)) { - gridppReportFile = configReportTemplateService.getConfigReportTemplateByKey(reportKey); - } - if (ObjectUtil.isEmpty(gridppReportFile)) { - throw new ServiceException(ErrorCodeConstants.CONFIG_REPORT_TEMPLATE_NOT_EXISTS); - } - String reportData = StringEscapeUtils.unescapeHtml4(gridppReportFile.getData()); - - //报表参数 - Map reportParams = new HashMap<>(); - //获取当前用户姓名 - LoginUser user = SecurityFrameworkUtils.getLoginUser(); - String realName = ""; - if (user != null) { - realName = SecurityFrameworkUtils.getLoginUserNickname(); - } - reportParams.put("operName", realName); - - if (StrUtil.isNotBlank(dataUrl)) { - log.info("url:" + dataUrl); - dataUrl = StringEscapeUtils.unescapeHtml4(dataUrl); - log.info("url:" + dataUrl); - //处理url参数 - if(dataUrl.contains("?")) { - String urlParam = dataUrl.split("\\?")[1]; - String[] urlVks = urlParam.split("&"); - for (int i = 0; i < urlVks.length; i++) { - String vk = urlVks[i]; - if (StrUtil.isNotBlank(vk)) { - String[] vkSplit = vk.split("="); - if(vkSplit.length == 2){ - reportParams.put(vkSplit[0], vkSplit[1]); - } - } - } - } - - Map headers = new HashMap<>(); - String token = SecurityFrameworkUtils.obtainAuthorization(request, - securityProperties.getTokenHeader(), securityProperties.getTokenParameter()); - headers.put(securityProperties.getTokenHeader(), token); - HttpResponse res = HttpRequest.get(dataUrl) - .addHeaders(headers) - .setConnectionTimeout(60 * 1000) - .setReadTimeout(120 * 1000) - .execute(); - if (res.getStatus() != 200) { - log.error("报表数据,网络请求错误!", res.body()); - throw new GridReportException("报表数据,网络请求错误!"); - } - String body = res.body(); - CommonResult dataR = JSON.parseObject(body, CommonResult.class); - if (dataR != null && dataR.getCode() == 0) { - if (ArrayUtil.isArray(dataR.getData()) || dataR.getData() instanceof Collection) { - reportData = JSON.toJSONString(dataR); - } else { - reportData = JSON.toJSONString(dataR.getData()); - } - } else { - log.error("获取报表数据错误!", dataR.getMsg()); - log.error("报表数据:" + reportData); - throw new GridReportException("获取报表数据错误!"); - } - } - - - BinaryObject binaryObject = gridReport.genReport(gridppReportFile.getContent(), reportData, reportParams, ExportType.valueOf("OFD".equals(type.toUpperCase()) ? "PDF" : type.toUpperCase())); - MediaType mediaType = null; - byte[] docBytes = null; - //文件扩展名 - String fileExtName = type.toLowerCase(); - switch (type.toUpperCase()) { - case "PDF": - mediaType = MediaType.APPLICATION_PDF; - docBytes = PdfHelper.modifyDocInfo(binaryObject.getDataBuf()); - break; - case "OFD": - mediaType = MediaType.APPLICATION_OCTET_STREAM; - docBytes = PdfHelper.modifyDocInfo(binaryObject.getDataBuf()); - break; - case "RTF": - fileExtName = "doc"; - mediaType = MediaType.APPLICATION_OCTET_STREAM; - docBytes = binaryObject.getDataBuf(); - break; - default: - mediaType = MediaType.APPLICATION_OCTET_STREAM; - docBytes = binaryObject.getDataBuf(); - break; - } - - return browser(new ByteArrayResource(docBytes), gridppReportFile.getName() + "." + fileExtName, mediaType); - } - - @GetMapping("/previewDocs") - @Operation(summary = "报告预览报表") - public ResponseEntity previewDocs(Long reportId, String reportKey, String dataUrl, Boolean isCrypto, String type) throws Exception { - HttpServletRequest request = ServletUtils.getRequest(); - ConfigReportTemplateDO gridppReportFile = null; - if (reportId != null) { - gridppReportFile = configReportTemplateService.getConfigReportTemplate(reportId); - } else if (StrUtil.isNotBlank(reportKey)) { - gridppReportFile = configReportTemplateService.getConfigReportTemplateByKey(reportKey); - } - if (ObjectUtil.isEmpty(gridppReportFile)) { - throw new GridReportException("未找到报表模板!"); - } - String reportData = StringEscapeUtils.unescapeHtml4(gridppReportFile.getData()); - - //报表参数 - Map reportParams = new HashMap<>(); - //获取当前用户姓名 - LoginUser user = SecurityFrameworkUtils.getLoginUser(); - String realName = ""; - if (user != null) { - realName = SecurityFrameworkUtils.getLoginUserNickname(); - } - reportParams.put("operName", realName); - - if (StrUtil.isNotBlank(dataUrl)) { - log.info("url:" + dataUrl); - dataUrl = StringEscapeUtils.unescapeHtml4(dataUrl); - log.info("url:" + dataUrl); - - - Map headers = new HashMap<>(); - String token = SecurityFrameworkUtils.obtainAuthorization(request, - securityProperties.getTokenHeader(), securityProperties.getTokenParameter()); - headers.put(securityProperties.getTokenHeader(), token); - HttpResponse res = HttpRequest.get(dataUrl) - .addHeaders(headers) - .setConnectionTimeout(60 * 1000) - .setReadTimeout(120 * 1000) - .execute(); - if (res.getStatus() != 200) { - log.error("报表数据,网络请求错误!", res.body()); - throw new GridReportException("报表数据,网络请求错误!"); - } - String body = res.body(); - CommonResult dataR = JSON.parseObject(body, CommonResult.class); - if (dataR != null && dataR.getCode() == 0) { - if (ArrayUtil.isArray(dataR.getData()) || dataR.getData() instanceof Collection) { - reportData = JSON.toJSONString(dataR); - } else { - - Map map = BeanUtil.beanToMap(dataR.getData()); - for (Map.Entry obj : BeanUtil.beanToMap(map.get("reportParams")).entrySet()) { - reportParams.put(obj.getKey(), obj.getValue() == null ? "": obj.getValue().toString()); - } - reportData = JSON.toJSONString(dataR.getData()); - } - } else { - log.error("获取报表数据错误!", dataR.getMsg()); - log.error("报表数据:" + reportData); - throw new GridReportException("获取报表数据错误!"); - } - - } - - BinaryObject binaryObject = gridReport.genReport(gridppReportFile.getContent(), reportData, reportParams, ExportType.valueOf("OFD".equals(type.toUpperCase()) ? "PDF" : type.toUpperCase())); - MediaType mediaType = null; - byte[] docBytes = null; - //文件扩展名 - String fileExtName = type.toLowerCase(); - switch (type.toUpperCase()) { - case "PDF": - mediaType = MediaType.APPLICATION_PDF; - docBytes = PdfHelper.modifyDocInfo(binaryObject.getDataBuf()); - break; - case "OFD": - mediaType = MediaType.APPLICATION_OCTET_STREAM; - docBytes = PdfHelper.modifyDocInfo(binaryObject.getDataBuf()); - break; - case "RTF": - fileExtName = "doc"; - mediaType = MediaType.APPLICATION_OCTET_STREAM; - docBytes = binaryObject.getDataBuf(); - break; - case "IMG": - fileExtName = "png"; - mediaType = MediaType.IMAGE_PNG; - docBytes = binaryObject.getDataBuf(); - break; - default: - mediaType = MediaType.APPLICATION_OCTET_STREAM; - docBytes = binaryObject.getDataBuf(); - break; - } - - return browser(new ByteArrayResource(docBytes), gridppReportFile.getName() + "." + fileExtName, mediaType); - } - - @GetMapping("/export") - @Operation(summary = "导出报表") - public ResponseEntity export(Long reportId, String reportKey, String exportName, String dataUrl, Boolean isCrypto, String type) throws Exception { - HttpServletRequest request = ServletUtils.getRequest(); - ConfigReportTemplateDO gridppReportFile = null; - if (reportId != null) { - gridppReportFile = configReportTemplateService.getConfigReportTemplate(reportId); - } else if (StrUtil.isNotBlank(reportKey)) { - gridppReportFile = configReportTemplateService.getConfigReportTemplateByKey(reportKey); - } - if (ObjectUtil.isEmpty(gridppReportFile)) { - throw new GridReportException("未找到报表模板!"); - } - String reportData = StringEscapeUtils.unescapeHtml4(gridppReportFile.getData()); - - //报表参数 - Map reportParams = new HashMap<>(); - //获取当前用户姓名 - LoginUser user = SecurityFrameworkUtils.getLoginUser(); - String realName = ""; - if (user != null) { - realName = SecurityFrameworkUtils.getLoginUserNickname(); - } - reportParams.put("operName", realName); - - if (StrUtil.isNotBlank(dataUrl)) { - dataUrl = StringEscapeUtils.unescapeHtml4(dataUrl); - //处理url参数 - if (dataUrl.contains("?")) { - String urlParam = dataUrl.split("\\?")[1]; - String[] urlVks = urlParam.split("&"); - for (int i = 0; i < urlVks.length; i++) { - String vk = urlVks[i]; - if (StrUtil.isNotBlank(vk)) { - String[] vkSplit = vk.split("="); - if(vkSplit.length == 2){ - reportParams.put(vkSplit[0], vkSplit[1]); - } - } - } - } - Map headers = new HashMap<>(); - String token = SecurityFrameworkUtils.obtainAuthorization(request, - securityProperties.getTokenHeader(), securityProperties.getTokenParameter()); - headers.put(securityProperties.getTokenHeader(), token); - HttpResponse res = HttpRequest.get(dataUrl) - .addHeaders(headers) - .setConnectionTimeout(60 * 1000) - .setReadTimeout(120 * 1000) - .execute(); - if (res.getStatus() != 200) { - log.error("报表数据,网络请求错误!", res.body()); - throw new GridReportException("报表数据,网络请求错误!"); - } - String body = res.body(); - CommonResult dataR = JSON.parseObject(body, CommonResult.class); - if (dataR != null && dataR.getCode() == 0) { - if (ArrayUtil.isArray(dataR.getData()) || dataR.getData() instanceof Collection) { - reportData = JSON.toJSONString(dataR); - } else { - reportData = JSON.toJSONString(dataR.getData()); - } - } else { - log.error("获取报表数据错误!", dataR.getMsg()); - throw new GridReportException("获取报表数据错误!"); - } - } - - BinaryObject binaryObject = gridReport.genReport(gridppReportFile.getContent(), reportData, reportParams, ExportType.valueOf("OFD".equals(type.toUpperCase()) ? "PDF" : type.toUpperCase())); - byte[] docBytes = null; - //文件扩展名 - String fileExtName = type.toLowerCase(); - switch (type.toUpperCase()) { - case "PDF": - docBytes = PdfHelper.modifyDocInfo(binaryObject.getDataBuf()); - break; - case "OFD": - docBytes = PdfHelper.modifyDocInfo(binaryObject.getDataBuf()); - break; - case "RTF": - fileExtName = "doc"; - docBytes = binaryObject.getDataBuf(); - break; - case "IMG": - fileExtName = "png"; - docBytes = binaryObject.getDataBuf(); - break; - default: - docBytes = binaryObject.getDataBuf(); - break; - } - String fileName = gridppReportFile.getName(); - if (StrUtil.isNotBlank(exportName)) { - fileName = exportName; - } - return download(new ByteArrayResource(docBytes), fileName + "." + fileExtName); - } - - /** - * 生成Base64图片 - * @return - */ - @PostMapping("/gen-report-png-image-base64") - @Operation(summary = "生成Base64图片") - public CommonResult genReportPngImageBase64(@RequestBody GenReportBody body) { - ConfigReportTemplateDO gridppReportFile = null; - if (body.getReportId() != null) { - gridppReportFile = configReportTemplateService.getConfigReportTemplate(body.getReportId()); - } else if (StrUtil.isNotBlank(body.getReportKey())) { - gridppReportFile = configReportTemplateService.getConfigReportTemplateByKey(body.getReportKey()); - } - if (ObjectUtil.isEmpty(gridppReportFile)) { - throw new ServiceException(ErrorCodeConstants.CONFIG_REPORT_TEMPLATE_NOT_EXISTS); - } - - String imgBase64 = null; - try { - BinaryObject binaryObject = gridReport.genReport(gridppReportFile.getContent(), body.getReportDataJson(), body.getReportParams(), ExportType.IMG, ExportImageType.PNG, body.getImgDpi()); - imgBase64 = binaryObject.getAsBase64Text(); - } catch (Exception e) { - log.error("生成base64图片失败", e); - } - if (StringUtils.isBlank(imgBase64)) { - return CommonResult.error(1_032_100_000, "生成Base64图片失败"); - } - return success(imgBase64); - } - - /** - * 生成Base64图片 - * @return - */ - @PostMapping("/gen-report-png-image-base64-by-pdf") - @Operation(summary = "生成Base64图片") - public CommonResult genReportPngImageBase64ByPdf(@RequestBody GenReportBody body) { - ConfigReportTemplateDO gridppReportFile = null; - if (body.getReportId() != null) { - gridppReportFile = configReportTemplateService.getConfigReportTemplate(body.getReportId()); - } else if (StrUtil.isNotBlank(body.getReportKey())) { - gridppReportFile = configReportTemplateService.getConfigReportTemplateByKey(body.getReportKey()); - } - if (ObjectUtil.isEmpty(gridppReportFile)) { - throw new ServiceException(ErrorCodeConstants.CONFIG_REPORT_TEMPLATE_NOT_EXISTS); - } - - String imgBase64 = null; - try { - BinaryObject binaryObject = gridReport.genReport(gridppReportFile.getContent(), body.getReportDataJson(), body.getReportParams(), ExportType.PDF); - byte[] pngBytes = PdfHelper.pdfToPng(binaryObject.getDataBuf(), body.getImgDpi()); - //String encodeHexStr = HexUtil.encodeHexStr(pngBytes); - //System.out.println(encodeHexStr); - imgBase64 = Base64.encode(pngBytes); - } catch (Exception e) { - log.error("生成base64图片失败", e); - } - if (StringUtils.isBlank(imgBase64)) { - return CommonResult.error(1_032_100_000, "生成Base64图片失败"); - } - return success(imgBase64); - } - - /** - * 下载文件 - * - * @param file 文件 - * @return {ResponseEntity} - * @throws IOException io异常 - */ - protected ResponseEntity download(File file) throws IOException { - String fileName = file.getName(); - return download(file, fileName); - } - - /** - * 下载 - * - * @param file 文件 - * @param fileName 生成的文件名 - * @return {ResponseEntity} - * @throws IOException io异常 - */ - protected ResponseEntity download(File file, String fileName) throws IOException { - org.springframework.core.io.Resource resource = new FileSystemResource(file); - return download(resource, fileName); - } - - /** - * 下载 - * - * @param resource 资源 - * @param fileName 生成的文件名 - * @return {ResponseEntity} - * @throws IOException io异常 - */ - protected ResponseEntity download(org.springframework.core.io.Resource resource, String fileName) throws IOException { - HttpServletRequest request = ServletUtils.getRequest(); - String header = request.getHeader(HttpHeaders.USER_AGENT); - // 避免空指针 - header = header == null ? StringPool.EMPTY : header.toUpperCase(); - HttpStatus status= HttpStatus.OK; - // 断点续传 - long position = 0; - long count = resource.contentLength(); - String range = request.getHeader(HttpHeaders.RANGE); - if (null != range) { - status = HttpStatus.PARTIAL_CONTENT; - String[] rangeRange = range.replace("bytes=", StringPool.EMPTY).split(StringPool.DASH); - position = Long.parseLong(rangeRange[0]); - if (rangeRange.length > 1) { - long end = Long.parseLong(rangeRange[1]); - count = end - position + 1; - } - } - HttpHeaders headers = new HttpHeaders(); - headers.setContentType(MediaType.APPLICATION_OCTET_STREAM); - String encodeFileName = UriUtils.encode(fileName, StandardCharsets.UTF_8); - // 兼容各种浏览器下载: - // https://blog.robotshell.org/2012/deal-with-http-header-encoding-for-file-download/ - String disposition = "attachment;" + - "filename=\"" + encodeFileName + "\";" + - "filename*=utf-8''" + encodeFileName; - headers.set(HttpHeaders.CONTENT_DISPOSITION, disposition); - return new ResponseEntity<>(new ResourceRegion(resource, position, count), headers, status); - } - - /** - * 浏览器打开 - * - * @param resource 资源 - * @param fileName 生成的文件名 - * @return {ResponseEntity} - * @throws IOException io异常 - */ - protected ResponseEntity browser(org.springframework.core.io.Resource resource, String fileName, MediaType mediaType) throws IOException { - HttpHeaders headers = new HttpHeaders(); - headers.setContentType(mediaType); - headers.setContentLength(resource.contentLength()); - String encodeFileName = UriUtils.encode(fileName, StandardCharsets.UTF_8); - // 兼容各种浏览器下载: - // https://blog.robotshell.org/2012/deal-with-http-header-encoding-for-file-download/ - String disposition = "inline;" + - "filename=\"" + encodeFileName + "\";" + - "filename*=utf-8''" + encodeFileName; - headers.set(HttpHeaders.CONTENT_DISPOSITION, disposition); - return new ResponseEntity<>(resource, headers, HttpStatus.OK); - } - } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigSubSampleMethodController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigSubSampleMethodController.java index 6bbe270..e74bf12 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigSubSampleMethodController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigSubSampleMethodController.java @@ -34,7 +34,7 @@ import com.zt.plat.module.qms.business.config.controller.vo.*; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSubSampleMethodDO; import com.zt.plat.module.qms.business.config.service.ConfigSubSampleMethodService; -@Tag(name = "管理后台 - 子样与检测方法配置") +@Tag(name = "管理后台 - 子样与分样检测方法配置表") @RestController @RequestMapping("/qms/config-sub-sample-method") @Validated @@ -45,14 +45,14 @@ public class ConfigSubSampleMethodController implements BusinessControllerMarker private ConfigSubSampleMethodService configSubSampleMethodService; @PostMapping("/create") - @Operation(summary = "创建子样与检测方法配置") + @Operation(summary = "创建子样与分样检测方法配置表") //@PreAuthorize("@ss.hasPermission('qms:config-sub-sample-method:create')") public CommonResult createConfigSubSampleMethod(@Valid @RequestBody ConfigSubSampleMethodSaveReqVO createReqVO) { return success(configSubSampleMethodService.createConfigSubSampleMethod(createReqVO)); } @PutMapping("/update") - @Operation(summary = "更新子样与检测方法配置") + @Operation(summary = "更新子样与分样检测方法配置表") //@PreAuthorize("@ss.hasPermission('qms:config-sub-sample-method:update')") public CommonResult updateConfigSubSampleMethod(@Valid @RequestBody ConfigSubSampleMethodSaveReqVO updateReqVO) { configSubSampleMethodService.updateConfigSubSampleMethod(updateReqVO); @@ -60,7 +60,7 @@ public class ConfigSubSampleMethodController implements BusinessControllerMarker } @DeleteMapping("/delete") - @Operation(summary = "删除子样与检测方法配置") + @Operation(summary = "删除子样与分样检测方法配置表") @Parameter(name = "id", description = "编号", required = true) //@PreAuthorize("@ss.hasPermission('qms:config-sub-sample-method:delete')") public CommonResult deleteConfigSubSampleMethod(@RequestParam("id") Long id) { @@ -70,7 +70,7 @@ public class ConfigSubSampleMethodController implements BusinessControllerMarker @DeleteMapping("/delete-list") @Parameter(name = "ids", description = "编号", required = true) - @Operation(summary = "批量删除子样与检测方法配置") + @Operation(summary = "批量删除子样与分样检测方法配置表") //@PreAuthorize("@ss.hasPermission('qms:config-sub-sample-method:delete')") public CommonResult deleteConfigSubSampleMethodList(@RequestBody BatchDeleteReqVO req) { configSubSampleMethodService.deleteConfigSubSampleMethodListByIds(req.getIds()); @@ -78,7 +78,7 @@ public class ConfigSubSampleMethodController implements BusinessControllerMarker } @GetMapping("/get") - @Operation(summary = "获得子样与检测方法配置") + @Operation(summary = "获得子样与分样检测方法配置表") @Parameter(name = "id", description = "编号", required = true, example = "1024") //@PreAuthorize("@ss.hasPermission('qms:config-sub-sample-method:query')") public CommonResult getConfigSubSampleMethod(@RequestParam("id") Long id) { @@ -87,7 +87,7 @@ public class ConfigSubSampleMethodController implements BusinessControllerMarker } @GetMapping("/page") - @Operation(summary = "获得子样与检测方法配置分页") + @Operation(summary = "获得子样与分样检测方法配置表分页") //@PreAuthorize("@ss.hasPermission('qms:config-sub-sample-method:query')") public CommonResult> getConfigSubSampleMethodPage(@Valid ConfigSubSampleMethodPageReqVO pageReqVO) { PageResult pageResult = configSubSampleMethodService.getConfigSubSampleMethodPage(pageReqVO); @@ -95,7 +95,7 @@ public class ConfigSubSampleMethodController implements BusinessControllerMarker } @GetMapping("/export-excel") - @Operation(summary = "导出子样与检测方法配置 Excel") + @Operation(summary = "导出子样与分样检测方法配置表 Excel") //@PreAuthorize("@ss.hasPermission('qms:config-sub-sample-method:export')") @ApiAccessLog(operateType = EXPORT) public void exportConfigSubSampleMethodExcel(@Valid ConfigSubSampleMethodPageReqVO pageReqVO, @@ -103,7 +103,7 @@ public class ConfigSubSampleMethodController implements BusinessControllerMarker pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); List list = configSubSampleMethodService.getConfigSubSampleMethodPage(pageReqVO).getList(); // 导出 Excel - ExcelUtils.write(response, "子样与检测方法配置.xls", "数据", ConfigSubSampleMethodRespVO.class, + ExcelUtils.write(response, "子样与分样检测方法配置表.xls", "数据", ConfigSubSampleMethodRespVO.class, BeanUtils.toBean(list, ConfigSubSampleMethodRespVO.class)); } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/GridReportController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/GridReportController.java new file mode 100644 index 0000000..9a564b0 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/GridReportController.java @@ -0,0 +1,556 @@ +package com.zt.plat.module.qms.business.config.controller.admin; + +import static com.zt.plat.framework.common.pojo.CommonResult.success; + +import java.io.File; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.Collection; +import java.util.HashMap; +import java.util.Map; + +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.text.StringEscapeUtils; +import org.springframework.core.io.ByteArrayResource; +import org.springframework.core.io.FileSystemResource; +import org.springframework.core.io.support.ResourceRegion; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.util.UriUtils; + +import com.alibaba.fastjson.JSON; +import com.baomidou.mybatisplus.core.toolkit.StringPool; +import com.zt.plat.framework.common.exception.ServiceException; +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.framework.common.util.servlet.ServletUtils; +import com.zt.plat.framework.security.config.SecurityProperties; +import com.zt.plat.framework.security.core.LoginUser; +import com.zt.plat.framework.security.core.util.SecurityFrameworkUtils; +import com.zt.plat.framework.web.core.util.WebFrameworkUtils; +import com.zt.plat.module.qms.business.config.controller.vo.GenReportBody; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigReportTemplateDO; +import com.zt.plat.module.qms.business.config.service.ConfigReportTemplateService; +import com.zt.plat.module.qms.enums.ErrorCodeConstants; +import com.zt.plat.module.qms.framework.gridreport.GridReport; +import com.zt.plat.module.qms.framework.gridreport.PdfHelper; +import com.zt.plat.module.qms.framework.gridreport.exception.GridReportException; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.codec.Base64; +import cn.hutool.core.util.ArrayUtil; +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.StrUtil; +import cn.hutool.http.HttpRequest; +import cn.hutool.http.HttpResponse; +import gridreport.jni.BinaryObject; +import gridreport.jni.ExportImageType; +import gridreport.jni.ExportType; +import gridreport.jni.Report; +import io.swagger.v3.oas.annotations.Operation; +import jakarta.annotation.Resource; +import jakarta.servlet.http.HttpServletRequest; +import lombok.extern.slf4j.Slf4j; + +@Slf4j +@RestController +@RequestMapping("/qms/config-report-template") +public class GridReportController { + + public static final String WR_PREFIX = "_WR_"; + + @Resource + private GridReport gridReport; + + @Resource + private SecurityProperties securityProperties; + + @Resource + private ConfigReportTemplateService configReportTemplateService; + + @GetMapping("/info") + @Operation(summary = "获取报表信息") + public CommonResult info() { + Map data = new HashMap<>(); + try { + String moduleInfo = Report.getModuleInfo(); + String moduleVersion = Report.getModuleVersion(); + String modulePath = Report.getModulePath(); + data.put("moduleInfo", moduleInfo); + data.put("moduleVersion", moduleVersion); + data.put("modulePath", modulePath); + } catch (Exception e) { + } + return success(data); + } + + /*** + * 预览报表 + * @param reportId + * @param reportKey + * @param dataUrl + * @param isCrypto + * @param type + * @return + * @throws Exception + */ + @GetMapping("/preview") + @Operation(summary = "预览报表") + public ResponseEntity preview(Long reportId, String reportKey, String dataUrl, Boolean isCrypto, String type) throws Exception { + HttpServletRequest request = ServletUtils.getRequest(); + ConfigReportTemplateDO gridppReportFile = null; + if (reportId != null) { + gridppReportFile = configReportTemplateService.getConfigReportTemplate(reportId); + } else if (StrUtil.isNotBlank(reportKey)) { + gridppReportFile = configReportTemplateService.getConfigReportTemplateByKey(reportKey); + } + if (ObjectUtil.isEmpty(gridppReportFile)) { + throw new ServiceException(ErrorCodeConstants.CONFIG_REPORT_TEMPLATE_NOT_EXISTS); + } + String reportData = StringEscapeUtils.unescapeHtml4(gridppReportFile.getData()); + + //报表参数 + Map reportParams = new HashMap<>(); + //获取当前用户姓名 + LoginUser user = SecurityFrameworkUtils.getLoginUser(); + String realName = ""; + if (user != null) { + realName = SecurityFrameworkUtils.getLoginUserNickname(); + } + reportParams.put("operName", realName); + + if (StrUtil.isNotBlank(dataUrl)) { + log.info("url:" + dataUrl); + dataUrl = StringEscapeUtils.unescapeHtml4(dataUrl); + log.info("url:" + dataUrl); + //处理url参数 + if(dataUrl.contains("?")) { + String urlParam = dataUrl.split("\\?")[1]; + String[] urlVks = urlParam.split("&"); + for (int i = 0; i < urlVks.length; i++) { + String vk = urlVks[i]; + if (StrUtil.isNotBlank(vk)) { + String[] vkSplit = vk.split("="); + if(vkSplit.length == 2){ + reportParams.put(vkSplit[0], vkSplit[1]); + } + } + } + } + + Map headers = new HashMap<>(); + String token = SecurityFrameworkUtils.obtainAuthorization(request, + securityProperties.getTokenHeader(), securityProperties.getTokenParameter()); + headers.put(securityProperties.getTokenHeader(), token); +// headers.put(WebFrameworkUtils.HEADER_VISIT_COMPANY_ID, user.getVisitCompanyId() + ""); +// headers.put(WebFrameworkUtils.HEADER_VISIT_DEPT_ID, user.getVisitDeptId() + ""); + + HttpResponse res = HttpRequest.get(dataUrl) + .addHeaders(headers) + .setConnectionTimeout(60 * 1000) + .setReadTimeout(120 * 1000) + .execute(); + if (res.getStatus() != 200) { + log.error("报表数据,网络请求错误!", res.body()); + throw new GridReportException("报表数据,网络请求错误!"); + } + String body = res.body(); + CommonResult dataR = JSON.parseObject(body, CommonResult.class); + if (dataR != null && dataR.getCode() == 0) { + if (ArrayUtil.isArray(dataR.getData()) || dataR.getData() instanceof Collection) { + reportData = JSON.toJSONString(dataR); + } else { + reportData = JSON.toJSONString(dataR.getData()); + } + } else { + log.error("获取报表数据错误!", dataR.getMsg()); + log.error("报表数据:" + reportData); + throw new GridReportException("获取报表数据错误!"); + } + } + + + BinaryObject binaryObject = gridReport.genReport(gridppReportFile.getContent(), reportData, reportParams, ExportType.valueOf("OFD".equals(type.toUpperCase()) ? "PDF" : type.toUpperCase())); + MediaType mediaType = null; + byte[] docBytes = null; + //文件扩展名 + String fileExtName = type.toLowerCase(); + switch (type.toUpperCase()) { + case "PDF": + mediaType = MediaType.APPLICATION_PDF; + docBytes = PdfHelper.modifyDocInfo(binaryObject.getDataBuf()); + break; + case "OFD": + mediaType = MediaType.APPLICATION_OCTET_STREAM; + docBytes = PdfHelper.modifyDocInfo(binaryObject.getDataBuf()); + break; + case "RTF": + fileExtName = "doc"; + mediaType = MediaType.APPLICATION_OCTET_STREAM; + docBytes = binaryObject.getDataBuf(); + break; + default: + mediaType = MediaType.APPLICATION_OCTET_STREAM; + docBytes = binaryObject.getDataBuf(); + break; + } + + return browser(new ByteArrayResource(docBytes), gridppReportFile.getName() + "." + fileExtName, mediaType); + } + + @GetMapping("/previewDocs") + @Operation(summary = "报告预览报表") + public ResponseEntity previewDocs(Long reportId, String reportKey, String dataUrl, Boolean isCrypto, String type) throws Exception { + HttpServletRequest request = ServletUtils.getRequest(); + ConfigReportTemplateDO gridppReportFile = null; + if (reportId != null) { + gridppReportFile = configReportTemplateService.getConfigReportTemplate(reportId); + } else if (StrUtil.isNotBlank(reportKey)) { + gridppReportFile = configReportTemplateService.getConfigReportTemplateByKey(reportKey); + } + if (ObjectUtil.isEmpty(gridppReportFile)) { + throw new GridReportException("未找到报表模板!"); + } + String reportData = StringEscapeUtils.unescapeHtml4(gridppReportFile.getData()); + + //报表参数 + Map reportParams = new HashMap<>(); + //获取当前用户姓名 + LoginUser user = SecurityFrameworkUtils.getLoginUser(); + String realName = ""; + if (user != null) { + realName = SecurityFrameworkUtils.getLoginUserNickname(); + } + reportParams.put("operName", realName); + + if (StrUtil.isNotBlank(dataUrl)) { + log.info("url:" + dataUrl); + dataUrl = StringEscapeUtils.unescapeHtml4(dataUrl); + log.info("url:" + dataUrl); + + + Map headers = new HashMap<>(); + String token = SecurityFrameworkUtils.obtainAuthorization(request, + securityProperties.getTokenHeader(), securityProperties.getTokenParameter()); + headers.put(securityProperties.getTokenHeader(), token); +// headers.put(WebFrameworkUtils.HEADER_VISIT_COMPANY_ID, user.getVisitCompanyId() + ""); +// headers.put(WebFrameworkUtils.HEADER_VISIT_DEPT_ID, user.getVisitDeptId() + ""); + HttpResponse res = HttpRequest.get(dataUrl) + .addHeaders(headers) + .setConnectionTimeout(60 * 1000) + .setReadTimeout(120 * 1000) + .execute(); + if (res.getStatus() != 200) { + log.error("报表数据,网络请求错误!", res.body()); + throw new GridReportException("报表数据,网络请求错误!"); + } + String body = res.body(); + CommonResult dataR = JSON.parseObject(body, CommonResult.class); + if (dataR != null && dataR.getCode() == 0) { + if (ArrayUtil.isArray(dataR.getData()) || dataR.getData() instanceof Collection) { + reportData = JSON.toJSONString(dataR); + } else { + + Map map = BeanUtil.beanToMap(dataR.getData()); + for (Map.Entry obj : BeanUtil.beanToMap(map.get("reportParams")).entrySet()) { + reportParams.put(obj.getKey(), obj.getValue() == null ? "": obj.getValue().toString()); + } + reportData = JSON.toJSONString(dataR.getData()); + } + } else { + log.error("获取报表数据错误!", dataR.getMsg()); + log.error("报表数据:" + reportData); + throw new GridReportException("获取报表数据错误!"); + } + + } + + BinaryObject binaryObject = gridReport.genReport(gridppReportFile.getContent(), reportData, reportParams, ExportType.valueOf("OFD".equals(type.toUpperCase()) ? "PDF" : type.toUpperCase())); + MediaType mediaType = null; + byte[] docBytes = null; + //文件扩展名 + String fileExtName = type.toLowerCase(); + switch (type.toUpperCase()) { + case "PDF": + mediaType = MediaType.APPLICATION_PDF; + docBytes = PdfHelper.modifyDocInfo(binaryObject.getDataBuf()); + break; + case "OFD": + mediaType = MediaType.APPLICATION_OCTET_STREAM; + docBytes = PdfHelper.modifyDocInfo(binaryObject.getDataBuf()); + break; + case "RTF": + fileExtName = "doc"; + mediaType = MediaType.APPLICATION_OCTET_STREAM; + docBytes = binaryObject.getDataBuf(); + break; + case "IMG": + fileExtName = "png"; + mediaType = MediaType.IMAGE_PNG; + docBytes = binaryObject.getDataBuf(); + break; + default: + mediaType = MediaType.APPLICATION_OCTET_STREAM; + docBytes = binaryObject.getDataBuf(); + break; + } + + return browser(new ByteArrayResource(docBytes), gridppReportFile.getName() + "." + fileExtName, mediaType); + } + + @GetMapping("/export") + @Operation(summary = "导出报表") + public ResponseEntity export(Long reportId, String reportKey, String exportName, String dataUrl, Boolean isCrypto, String type) throws Exception { + HttpServletRequest request = ServletUtils.getRequest(); + ConfigReportTemplateDO gridppReportFile = null; + if (reportId != null) { + gridppReportFile = configReportTemplateService.getConfigReportTemplate(reportId); + } else if (StrUtil.isNotBlank(reportKey)) { + gridppReportFile = configReportTemplateService.getConfigReportTemplateByKey(reportKey); + } + if (ObjectUtil.isEmpty(gridppReportFile)) { + throw new GridReportException("未找到报表模板!"); + } + String reportData = StringEscapeUtils.unescapeHtml4(gridppReportFile.getData()); + + //报表参数 + Map reportParams = new HashMap<>(); + //获取当前用户姓名 + LoginUser user = SecurityFrameworkUtils.getLoginUser(); + String realName = ""; + if (user != null) { + realName = SecurityFrameworkUtils.getLoginUserNickname(); + } + reportParams.put("operName", realName); + + if (StrUtil.isNotBlank(dataUrl)) { + dataUrl = StringEscapeUtils.unescapeHtml4(dataUrl); + //处理url参数 + if (dataUrl.contains("?")) { + String urlParam = dataUrl.split("\\?")[1]; + String[] urlVks = urlParam.split("&"); + for (int i = 0; i < urlVks.length; i++) { + String vk = urlVks[i]; + if (StrUtil.isNotBlank(vk)) { + String[] vkSplit = vk.split("="); + if(vkSplit.length == 2){ + reportParams.put(vkSplit[0], vkSplit[1]); + } + } + } + } + Map headers = new HashMap<>(); + String token = SecurityFrameworkUtils.obtainAuthorization(request, + securityProperties.getTokenHeader(), securityProperties.getTokenParameter()); + headers.put(securityProperties.getTokenHeader(), token); +// headers.put(WebFrameworkUtils.HEADER_VISIT_COMPANY_ID, user.getVisitCompanyId() + ""); +// headers.put(WebFrameworkUtils.HEADER_VISIT_DEPT_ID, user.getVisitDeptId() + ""); + HttpResponse res = HttpRequest.get(dataUrl) + .addHeaders(headers) + .setConnectionTimeout(60 * 1000) + .setReadTimeout(120 * 1000) + .execute(); + if (res.getStatus() != 200) { + log.error("报表数据,网络请求错误!", res.body()); + throw new GridReportException("报表数据,网络请求错误!"); + } + String body = res.body(); + CommonResult dataR = JSON.parseObject(body, CommonResult.class); + if (dataR != null && dataR.getCode() == 0) { + if (ArrayUtil.isArray(dataR.getData()) || dataR.getData() instanceof Collection) { + reportData = JSON.toJSONString(dataR); + } else { + reportData = JSON.toJSONString(dataR.getData()); + } + } else { + log.error("获取报表数据错误!", dataR.getMsg()); + throw new GridReportException("获取报表数据错误!"); + } + } + + BinaryObject binaryObject = gridReport.genReport(gridppReportFile.getContent(), reportData, reportParams, ExportType.valueOf("OFD".equals(type.toUpperCase()) ? "PDF" : type.toUpperCase())); + byte[] docBytes = null; + //文件扩展名 + String fileExtName = type.toLowerCase(); + switch (type.toUpperCase()) { + case "PDF": + docBytes = PdfHelper.modifyDocInfo(binaryObject.getDataBuf()); + break; + case "OFD": + docBytes = PdfHelper.modifyDocInfo(binaryObject.getDataBuf()); + break; + case "RTF": + fileExtName = "doc"; + docBytes = binaryObject.getDataBuf(); + break; + case "IMG": + fileExtName = "png"; + docBytes = binaryObject.getDataBuf(); + break; + default: + docBytes = binaryObject.getDataBuf(); + break; + } + String fileName = gridppReportFile.getName(); + if (StrUtil.isNotBlank(exportName)) { + fileName = exportName; + } + return download(new ByteArrayResource(docBytes), fileName + "." + fileExtName); + } + + /** + * 生成Base64图片 + * @return + */ + @PostMapping("/gen-report-png-image-base64") + @Operation(summary = "生成Base64图片") + public CommonResult genReportPngImageBase64(@RequestBody GenReportBody body) { + ConfigReportTemplateDO gridppReportFile = null; + if (body.getReportId() != null) { + gridppReportFile = configReportTemplateService.getConfigReportTemplate(body.getReportId()); + } else if (StrUtil.isNotBlank(body.getReportKey())) { + gridppReportFile = configReportTemplateService.getConfigReportTemplateByKey(body.getReportKey()); + } + if (ObjectUtil.isEmpty(gridppReportFile)) { + throw new ServiceException(ErrorCodeConstants.CONFIG_REPORT_TEMPLATE_NOT_EXISTS); + } + + String imgBase64 = null; + try { + BinaryObject binaryObject = gridReport.genReport(gridppReportFile.getContent(), body.getReportDataJson(), body.getReportParams(), ExportType.IMG, ExportImageType.PNG, body.getImgDpi()); + imgBase64 = binaryObject.getAsBase64Text(); + } catch (Exception e) { + log.error("生成base64图片失败", e); + } + if (StringUtils.isBlank(imgBase64)) { + return CommonResult.error(1_032_100_000, "生成Base64图片失败"); + } + return success(imgBase64); + } + + /** + * 生成Base64图片 + * @return + */ + @PostMapping("/gen-report-png-image-base64-by-pdf") + @Operation(summary = "生成Base64图片") + public CommonResult genReportPngImageBase64ByPdf(@RequestBody GenReportBody body) { + ConfigReportTemplateDO gridppReportFile = null; + if (body.getReportId() != null) { + gridppReportFile = configReportTemplateService.getConfigReportTemplate(body.getReportId()); + } else if (StrUtil.isNotBlank(body.getReportKey())) { + gridppReportFile = configReportTemplateService.getConfigReportTemplateByKey(body.getReportKey()); + } + if (ObjectUtil.isEmpty(gridppReportFile)) { + throw new ServiceException(ErrorCodeConstants.CONFIG_REPORT_TEMPLATE_NOT_EXISTS); + } + + String imgBase64 = null; + try { + BinaryObject binaryObject = gridReport.genReport(gridppReportFile.getContent(), body.getReportDataJson(), body.getReportParams(), ExportType.PDF); + byte[] pngBytes = PdfHelper.pdfToPng(binaryObject.getDataBuf(), body.getImgDpi()); + //String encodeHexStr = HexUtil.encodeHexStr(pngBytes); + //System.out.println(encodeHexStr); + imgBase64 = Base64.encode(pngBytes); + } catch (Exception e) { + log.error("生成base64图片失败", e); + } + if (StringUtils.isBlank(imgBase64)) { + return CommonResult.error(1_032_100_000, "生成Base64图片失败"); + } + return success(imgBase64); + } + + /** + * 下载文件 + * + * @param file 文件 + * @return {ResponseEntity} + * @throws IOException io异常 + */ + protected ResponseEntity download(File file) throws IOException { + String fileName = file.getName(); + return download(file, fileName); + } + + /** + * 下载 + * + * @param file 文件 + * @param fileName 生成的文件名 + * @return {ResponseEntity} + * @throws IOException io异常 + */ + protected ResponseEntity download(File file, String fileName) throws IOException { + org.springframework.core.io.Resource resource = new FileSystemResource(file); + return download(resource, fileName); + } + + /** + * 下载 + * + * @param resource 资源 + * @param fileName 生成的文件名 + * @return {ResponseEntity} + * @throws IOException io异常 + */ + protected ResponseEntity download(org.springframework.core.io.Resource resource, String fileName) throws IOException { + HttpServletRequest request = ServletUtils.getRequest(); + String header = request.getHeader(HttpHeaders.USER_AGENT); + // 避免空指针 + header = header == null ? StringPool.EMPTY : header.toUpperCase(); + HttpStatus status= HttpStatus.OK; + // 断点续传 + long position = 0; + long count = resource.contentLength(); + String range = request.getHeader(HttpHeaders.RANGE); + if (null != range) { + status = HttpStatus.PARTIAL_CONTENT; + String[] rangeRange = range.replace("bytes=", StringPool.EMPTY).split(StringPool.DASH); + position = Long.parseLong(rangeRange[0]); + if (rangeRange.length > 1) { + long end = Long.parseLong(rangeRange[1]); + count = end - position + 1; + } + } + HttpHeaders headers = new HttpHeaders(); + headers.setContentType(MediaType.APPLICATION_OCTET_STREAM); + String encodeFileName = UriUtils.encode(fileName, StandardCharsets.UTF_8); + // 兼容各种浏览器下载: + // https://blog.robotshell.org/2012/deal-with-http-header-encoding-for-file-download/ + String disposition = "attachment;" + + "filename=\"" + encodeFileName + "\";" + + "filename*=utf-8''" + encodeFileName; + headers.set(HttpHeaders.CONTENT_DISPOSITION, disposition); + return new ResponseEntity<>(new ResourceRegion(resource, position, count), headers, status); + } + + /** + * 浏览器打开 + * + * @param resource 资源 + * @param fileName 生成的文件名 + * @return {ResponseEntity} + * @throws IOException io异常 + */ + protected ResponseEntity browser(org.springframework.core.io.Resource resource, String fileName, MediaType mediaType) throws IOException { + HttpHeaders headers = new HttpHeaders(); + headers.setContentType(mediaType); + headers.setContentLength(resource.contentLength()); + String encodeFileName = UriUtils.encode(fileName, StandardCharsets.UTF_8); + // 兼容各种浏览器下载: + // https://blog.robotshell.org/2012/deal-with-http-header-encoding-for-file-download/ + String disposition = "inline;" + + "filename=\"" + encodeFileName + "\";" + + "filename*=utf-8''" + encodeFileName; + headers.set(HttpHeaders.CONTENT_DISPOSITION, disposition); + return new ResponseEntity<>(resource, headers, HttpStatus.OK); + } + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/BaseSamplePageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/BaseSamplePageReqVO.java index d5f78f4..c47e27b 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/BaseSamplePageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/BaseSamplePageReqVO.java @@ -42,4 +42,9 @@ public class BaseSamplePageReqVO extends PageParam { @Schema(description = "检测标准数量") private String assayStandardCount; + @Schema(description = "检验委托来源配置ID", example = "321") + private Long configEntrustSourceId; + + @Schema(description = "委托类型,委托登记-entrust_registration、检验委托-entrust_inspection", example = "1") + private String entrustType; } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodPageReqVO.java index 662d05e..98e7b88 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodPageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodPageReqVO.java @@ -24,6 +24,9 @@ public class ConfigAssayMethodPageReqVO extends PageParam { @Schema(description = "方法名称", example = "李四") private String name; + + @Schema(description = "方法名称及类别") + private String methodNameCategory; @Schema(description = "方法编号") private String methodCode; @@ -43,6 +46,9 @@ public class ConfigAssayMethodPageReqVO extends PageParam { @Schema(description = "任务单模板key") private String configReportTemplateKey; + @Schema(description = "任务单数据类型,横向:horizontal,纵向:‌vertical‌", example = "2") + private String reportDataType; + @Schema(description = "任务单编号规则") private String codeRule; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodParameterPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodParameterPageReqVO.java new file mode 100644 index 0000000..a23f3ef --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodParameterPageReqVO.java @@ -0,0 +1,71 @@ +package com.zt.plat.module.qms.business.config.controller.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 ConfigAssayMethodParameterPageReqVO extends PageParam { + + @Schema(description = "检测方法ID", example = "29823") + private Long configAssayMethodId; + + @Schema(description = "参数名称", example = "张三") + private String parameterName; + + @Schema(description = "参数简称", example = "张三") + private String shortName; + + @Schema(description = "参数序号") + private Integer no; + + @Schema(description = "键值") + private String key; + + @Schema(description = "填写方式,字典表【T_DIC_BSN】人工录入,天平采集,计算") + private String fillingWay; + + @Schema(description = "数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间", example = "1") + private String dataType; + + @Schema(description = "小数位") + private Integer decimalPosition; + + @Schema(description = "默认值") + private String defaultValue; + + @Schema(description = "是否允许为空") + private Integer isNull; + + @Schema(description = "pc界面是否显示") + private Integer isShow; + + @Schema(description = "排序号") + private Integer sortNo; + + @Schema(description = "参数分组_ID,字典表【T_DIC_BSN】参数分组", example = "14680") + private Long dictionaryBusinessId; + + @Schema(description = "参数分组_Key,字典表【T_DIC_BSN】参数分组") + private String dictionaryBusinessKey; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "备注") + private String remark; + + @Schema(description = "版本") + private Integer version; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodParameterRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodParameterRespVO.java new file mode 100644 index 0000000..154813e --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodParameterRespVO.java @@ -0,0 +1,91 @@ +package com.zt.plat.module.qms.business.config.controller.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 ConfigAssayMethodParameterRespVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "12031") + @ExcelProperty("ID") + private Long id; + + @Schema(description = "检测方法ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "29823") + @ExcelProperty("检测方法ID") + private Long configAssayMethodId; + + @Schema(description = "参数名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三") + @ExcelProperty("参数名称") + private String parameterName; + + @Schema(description = "参数简称", example = "张三") + @ExcelProperty("参数简称") + private String shortName; + + @Schema(description = "参数序号", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("参数序号") + private Integer no; + + @Schema(description = "键值") + @ExcelProperty("键值") + private String key; + + @Schema(description = "填写方式,字典表【T_DIC_BSN】人工录入,天平采集,计算", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("填写方式,字典表【T_DIC_BSN】人工录入,天平采集,计算") + private String fillingWay; + + @Schema(description = "数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") + @ExcelProperty("数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间") + private String dataType; + + @Schema(description = "小数位") + @ExcelProperty("小数位") + private Integer decimalPosition; + + @Schema(description = "默认值") + @ExcelProperty("默认值") + private String defaultValue; + + @Schema(description = "是否允许为空", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("是否允许为空") + private Integer isNull; + + @Schema(description = "pc界面是否显示", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("pc界面是否显示") + private Integer isShow; + + @Schema(description = "排序号") + @ExcelProperty("排序号") + private Integer sortNo; + + @Schema(description = "参数分组_ID,字典表【T_DIC_BSN】参数分组", example = "14680") + @ExcelProperty("参数分组_ID,字典表【T_DIC_BSN】参数分组") + private Long dictionaryBusinessId; + + @Schema(description = "参数分组_Key,字典表【T_DIC_BSN】参数分组") + @ExcelProperty("参数分组_Key,字典表【T_DIC_BSN】参数分组") + private String dictionaryBusinessKey; + + @Schema(description = "所属部门") + @ExcelProperty("所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") + private LocalDateTime createTime; + + @Schema(description = "备注") + @ExcelProperty("备注") + private String remark; + + @Schema(description = "版本", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("版本") + private Integer version; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodParameterSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodParameterSaveReqVO.java new file mode 100644 index 0000000..f390c28 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodParameterSaveReqVO.java @@ -0,0 +1,74 @@ +package com.zt.plat.module.qms.business.config.controller.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 ConfigAssayMethodParameterSaveReqVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "12031") + private Long id; + + @Schema(description = "检测方法ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "29823") + @NotNull(message = "检测方法ID不能为空") + private Long configAssayMethodId; + + @Schema(description = "参数名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三") + @NotEmpty(message = "参数名称不能为空") + private String parameterName; + + @Schema(description = "参数简称", example = "张三") + private String shortName; + + @Schema(description = "参数序号", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "参数序号不能为空") + private Integer no; + + @Schema(description = "键值") + private String key; + + @Schema(description = "填写方式,字典表【T_DIC_BSN】人工录入,天平采集,计算", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "填写方式,字典表【T_DIC_BSN】人工录入,天平采集,计算不能为空") + private String fillingWay; + + @Schema(description = "数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") + @NotEmpty(message = "数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间不能为空") + private String dataType; + + @Schema(description = "小数位") + private Integer decimalPosition; + + @Schema(description = "默认值") + private String defaultValue; + + @Schema(description = "是否允许为空", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "是否允许为空不能为空") + private Integer isNull; + + @Schema(description = "pc界面是否显示", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "pc界面是否显示不能为空") + private Integer isShow; + + @Schema(description = "排序号") + private Integer sortNo; + + @Schema(description = "参数分组_ID,字典表【T_DIC_BSN】参数分组", example = "14680") + private Long dictionaryBusinessId; + + @Schema(description = "参数分组_Key,字典表【T_DIC_BSN】参数分组") + private String dictionaryBusinessKey; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + + @Schema(description = "版本", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "版本不能为空") + private Integer version; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectExtendRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectExtendRespVO.java index 73e938d..627832e 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectExtendRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectExtendRespVO.java @@ -5,6 +5,12 @@ import lombok.Data; @Data public class ConfigAssayMethodProjectExtendRespVO extends ConfigAssayMethodProjectRespVO { + + @Schema(description = "分析方法名称") + private String configAssayMethodName; + + @Schema(description = "检测方法配置名称及类别") + private String configAssayMethodNameAndCategory; @Schema(description = "检测项目key") private String dictionaryProjectKey; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectParameterPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectParameterPageReqVO.java index 36a97b8..eb7b6e9 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectParameterPageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectParameterPageReqVO.java @@ -19,6 +19,27 @@ public class ConfigAssayMethodProjectParameterPageReqVO extends PageParam { @Schema(description = "参数ID,字典表【T_DIC_PRM】", example = "1283") private Long dictionaryParameterId; + @Schema(description = "参数名称", example = "李四") + private String parameterName; + + @Schema(description = "参数简称", example = "李四") + private String shortName; + + @Schema(description = "参数序号") + private Integer no; + + @Schema(description = "键值") + private String key; + + @Schema(description = "单位ID,UNT表", example = "31081") + private Long unitId; + + @Schema(description = "单位") + private String unit; + + @Schema(description = "填写方式,字典表【T_DIC_BSN】,keyboard-人工数字键盘录入,input-人工文本录入,collect-天平采集,calculate-计算", requiredMode = Schema.RequiredMode.REQUIRED) + private String fillingWay; + @Schema(description = "数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间", example = "2") private String dataType; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectParameterRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectParameterRespVO.java index c134894..d9161c0 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectParameterRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectParameterRespVO.java @@ -24,6 +24,27 @@ public class ConfigAssayMethodProjectParameterRespVO { @ExcelProperty("参数ID,字典表【T_DIC_PRM】") private Long dictionaryParameterId; + @Schema(description = "参数名称", example = "李四") + private String parameterName; + + @Schema(description = "参数简称", example = "李四") + private String shortName; + + @Schema(description = "参数序号") + private Integer no; + + @Schema(description = "键值") + private String key; + + @Schema(description = "单位ID,UNT表", example = "31081") + private Long unitId; + + @Schema(description = "单位") + private String unit; + + @Schema(description = "填写方式,字典表【T_DIC_BSN】,keyboard-人工数字键盘录入,input-人工文本录入,collect-天平采集,calculate-计算", requiredMode = Schema.RequiredMode.REQUIRED) + private String fillingWay; + @Schema(description = "数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") @ExcelProperty("数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间") private String dataType; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectParameterSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectParameterSaveReqVO.java index bc46b2c..ab4ff95 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectParameterSaveReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectParameterSaveReqVO.java @@ -20,6 +20,27 @@ public class ConfigAssayMethodProjectParameterSaveReqVO { @NotNull(message = "参数ID,字典表【T_DIC_PRM】不能为空") private Long dictionaryParameterId; + @Schema(description = "参数名称", example = "李四") + private String parameterName; + + @Schema(description = "参数简称", example = "李四") + private String shortName; + + @Schema(description = "参数序号") + private Integer no; + + @Schema(description = "键值") + private String key; + + @Schema(description = "单位ID,UNT表", example = "31081") + private Long unitId; + + @Schema(description = "单位") + private String unit; + + @Schema(description = "填写方式,字典表【T_DIC_BSN】,keyboard-人工数字键盘录入,input-人工文本录入,collect-天平采集,calculate-计算", requiredMode = Schema.RequiredMode.REQUIRED) + private String fillingWay; + @Schema(description = "数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") @NotEmpty(message = "数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间不能为空") private String dataType; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodReqVO.java index da30560..f82c1f7 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodReqVO.java @@ -25,6 +25,9 @@ public class ConfigAssayMethodReqVO { @Schema(description = "方法名称", example = "李四") private String name; + @Schema(description = "方法名称及类别") + private String methodNameCategory; + @Schema(description = "方法编号") private String methodCode; @@ -43,6 +46,9 @@ public class ConfigAssayMethodReqVO { @Schema(description = "任务单模板key") private String configReportTemplateKey; + @Schema(description = "任务单数据类型,横向:horizontal,纵向:‌vertical‌", example = "2") + private String reportDataType; + @Schema(description = "任务单编号规则") private String codeRule; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodRespVO.java index 08bfc94..36fc362 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodRespVO.java @@ -30,6 +30,9 @@ public class ConfigAssayMethodRespVO { @ExcelProperty("方法名称") private String name; + @Schema(description = "方法名称及类别") + private String methodNameCategory; + @Schema(description = "方法编号") @ExcelProperty("方法编号") private String methodCode; @@ -53,6 +56,10 @@ public class ConfigAssayMethodRespVO { @ExcelProperty("任务单模板key") private String configReportTemplateKey; + @Schema(description = "任务单数据类型,横向:horizontal,纵向:‌vertical‌", example = "2") + @ExcelProperty("任务单数据类型,横向:horizontal,纵向:‌vertical‌") + private String reportDataType; + @Schema(description = "任务单编号规则", requiredMode = Schema.RequiredMode.REQUIRED) @ExcelProperty("任务单编号规则") private String codeRule; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodSaveReqVO.java index 91fff24..3f97395 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodSaveReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodSaveReqVO.java @@ -24,6 +24,9 @@ public class ConfigAssayMethodSaveReqVO { @Schema(description = "方法名称", example = "李四") private String name; + @Schema(description = "方法名称及类别") + private String methodNameCategory; + @Schema(description = "方法编号") private String methodCode; @@ -44,6 +47,9 @@ public class ConfigAssayMethodSaveReqVO { @Schema(description = "任务单模板key") private String configReportTemplateKey; + @Schema(description = "任务单数据类型,横向:horizontal,纵向:‌vertical‌") + private String reportDataType; + @Schema(description = "任务单编号规则", requiredMode = Schema.RequiredMode.REQUIRED) @NotEmpty(message = "任务单编号规则不能为空") private String codeRule; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigEntrustSourceSampleTypePageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigEntrustSourceSampleTypePageReqVO.java new file mode 100644 index 0000000..1d095c2 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigEntrustSourceSampleTypePageReqVO.java @@ -0,0 +1,35 @@ +package com.zt.plat.module.qms.business.config.controller.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 ConfigEntrustSourceSampleTypePageReqVO extends PageParam { + + @Schema(description = "检验委托来源配置ID", example = "321") + private Long configEntrustSourceId; + + @Schema(description = "样品类型_ID,字典表【T_DIC_BSN】样品类型:委检样、商检分析样、商检综合样、西南铜产品", example = "30057") + private Long dictionaryBusinessId; + + @Schema(description = "参数分组_Key,字典表【T_DIC_BSN】样品类型") + private String dictionaryBusinessKey; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigEntrustSourceSampleTypeRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigEntrustSourceSampleTypeRespVO.java new file mode 100644 index 0000000..8f35c3c --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigEntrustSourceSampleTypeRespVO.java @@ -0,0 +1,43 @@ +package com.zt.plat.module.qms.business.config.controller.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 ConfigEntrustSourceSampleTypeRespVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "2073") + @ExcelProperty("ID") + private Long id; + + @Schema(description = "检验委托来源配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "321") + @ExcelProperty("检验委托来源配置ID") + private Long configEntrustSourceId; + + @Schema(description = "样品类型_ID,字典表【T_DIC_BSN】样品类型:委检样、商检分析样、商检综合样、西南铜产品", requiredMode = Schema.RequiredMode.REQUIRED, example = "30057") + @ExcelProperty("样品类型_ID,字典表【T_DIC_BSN】样品类型:委检样、商检分析样、商检综合样、西南铜产品") + private Long dictionaryBusinessId; + + @Schema(description = "参数分组_Key,字典表【T_DIC_BSN】样品类型") + @ExcelProperty("参数分组_Key,字典表【T_DIC_BSN】样品类型") + private String dictionaryBusinessKey; + + @Schema(description = "所属部门") + @ExcelProperty("所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") + private LocalDateTime createTime; + + @Schema(description = "备注") + @ExcelProperty("备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigEntrustSourceSampleTypeSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigEntrustSourceSampleTypeSaveReqVO.java new file mode 100644 index 0000000..ee2d798 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigEntrustSourceSampleTypeSaveReqVO.java @@ -0,0 +1,32 @@ +package com.zt.plat.module.qms.business.config.controller.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 ConfigEntrustSourceSampleTypeSaveReqVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "2073") + private Long id; + + @Schema(description = "检验委托来源配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "321") + @NotEmpty(message = "检验委托来源配置ID不能为空") + private Long configEntrustSourceId; + + @Schema(description = "样品类型_ID,字典表【T_DIC_BSN】样品类型:委检样、商检分析样、商检综合样、西南铜产品", requiredMode = Schema.RequiredMode.REQUIRED, example = "30057") + @NotNull(message = "样品类型_ID,字典表【T_DIC_BSN】样品类型:委检样、商检分析样、商检综合样、西南铜产品不能为空") + private Long dictionaryBusinessId; + + @Schema(description = "参数分组_Key,字典表【T_DIC_BSN】样品类型") + private String dictionaryBusinessKey; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCSampleMethodExtendRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCSampleMethodExtendRespVO.java index 277078a..b5032d1 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCSampleMethodExtendRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCSampleMethodExtendRespVO.java @@ -6,6 +6,12 @@ import lombok.Data; public class ConfigQCSampleMethodExtendRespVO extends ConfigQCSampleMethodRespVO { private String dictionaryBusinessName; + + private String parentDictionaryBusinessId; + + private String parentDictionaryBusinessName; + + private String parentDictionaryBusinesskey; private String configAssayMethodName; } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCSampleMethodPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCSampleMethodPageReqVO.java index 71fa079..37eaf64 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCSampleMethodPageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCSampleMethodPageReqVO.java @@ -40,6 +40,9 @@ public class ConfigQCSampleMethodPageReqVO extends PageParam { @Schema(description = "映射检测信息配置") private String configInfomation; + @Schema(description = "必要检测项目") + private String mustProject; + @Schema(description = "排序号") private Integer sortNo; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCSampleMethodParameterExtendRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCSampleMethodParameterExtendRespVO.java index df03866..152ed01 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCSampleMethodParameterExtendRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCSampleMethodParameterExtendRespVO.java @@ -1,23 +1,8 @@ package com.zt.plat.module.qms.business.config.controller.vo; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; @Data public class ConfigQCSampleMethodParameterExtendRespVO extends ConfigQCSampleMethodParameterRespVO { - @Schema(description = "参数序号") - private Integer dictionaryParameterNo; - - @Schema(description = "名称", example = "王五") - private String dictionaryParameterName; - - @Schema(description = "键值") - private String dictionaryParameterKey; - - @Schema(description = "检测单位ID,UNT表", example = "20894") - private Long dictionaryParameterUnitId; - - @Schema(description = "单位") - private String dictionaryParameterUnit; } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCSampleMethodParameterPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCSampleMethodParameterPageReqVO.java index 31af65f..bbcde9f 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCSampleMethodParameterPageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCSampleMethodParameterPageReqVO.java @@ -19,6 +19,27 @@ public class ConfigQCSampleMethodParameterPageReqVO extends PageParam { @Schema(description = "参数ID,字典表【T_DIC_PRM】", example = "29135") private Long dictionaryParameterId; + @Schema(description = "参数名称", example = "李四") + private String parameterName; + + @Schema(description = "参数简称", example = "李四") + private String shortName; + + @Schema(description = "参数序号") + private Integer no; + + @Schema(description = "键值") + private String key; + + @Schema(description = "单位ID,UNT表", example = "31081") + private Long unitId; + + @Schema(description = "单位") + private String unit; + + @Schema(description = "填写方式,字典表【T_DIC_BSN】,keyboard-人工数字键盘录入,input-人工文本录入,collect-天平采集,calculate-计算") + private String fillingWay; + @Schema(description = "数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间", example = "1") private String dataType; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCSampleMethodParameterRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCSampleMethodParameterRespVO.java index 3fedc3d..6229598 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCSampleMethodParameterRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCSampleMethodParameterRespVO.java @@ -24,6 +24,27 @@ public class ConfigQCSampleMethodParameterRespVO { @ExcelProperty("参数ID,字典表【T_DIC_PRM】") private Long dictionaryParameterId; + @Schema(description = "参数名称", example = "李四") + private String parameterName; + + @Schema(description = "参数简称", example = "李四") + private String shortName; + + @Schema(description = "参数序号") + private Integer no; + + @Schema(description = "键值") + private String key; + + @Schema(description = "单位ID,UNT表", example = "31081") + private Long unitId; + + @Schema(description = "单位") + private String unit; + + @Schema(description = "填写方式,字典表【T_DIC_BSN】,keyboard-人工数字键盘录入,input-人工文本录入,collect-天平采集,calculate-计算", requiredMode = Schema.RequiredMode.REQUIRED) + private String fillingWay; + @Schema(description = "数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") @ExcelProperty("数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间") private String dataType; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCSampleMethodParameterSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCSampleMethodParameterSaveReqVO.java index 1b00378..fe0af1c 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCSampleMethodParameterSaveReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCSampleMethodParameterSaveReqVO.java @@ -20,6 +20,27 @@ public class ConfigQCSampleMethodParameterSaveReqVO { @NotNull(message = "参数ID,字典表【T_DIC_PRM】不能为空") private Long dictionaryParameterId; + @Schema(description = "参数名称", example = "李四") + private String parameterName; + + @Schema(description = "参数简称", example = "李四") + private String shortName; + + @Schema(description = "参数序号") + private Integer no; + + @Schema(description = "键值") + private String key; + + @Schema(description = "单位ID,UNT表", example = "31081") + private Long unitId; + + @Schema(description = "单位") + private String unit; + + @Schema(description = "填写方式,字典表【T_DIC_BSN】,keyboard-人工数字键盘录入,input-人工文本录入,collect-天平采集,calculate-计算", requiredMode = Schema.RequiredMode.REQUIRED) + private String fillingWay; + @Schema(description = "数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") @NotEmpty(message = "数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间不能为空") private String dataType; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCSampleMethodRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCSampleMethodRespVO.java index 34eb738..18dba20 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCSampleMethodRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCSampleMethodRespVO.java @@ -52,6 +52,10 @@ public class ConfigQCSampleMethodRespVO { @ExcelProperty("映射检测信息配置") private String configInfomation; + @Schema(description = "必要检测项目") + @ExcelProperty("必要检测项目") + private String mustProject; + @Schema(description = "排序号") private Integer sortNo; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCSampleMethodSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCSampleMethodSaveReqVO.java index 2be5344..ca46435 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCSampleMethodSaveReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCSampleMethodSaveReqVO.java @@ -46,6 +46,9 @@ public class ConfigQCSampleMethodSaveReqVO { @Schema(description = "映射检测信息配置") private String configInfomation; + @Schema(description = "必要检测项目") + private String mustProject; + @Schema(description = "排序号") private Integer sortNo; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleMethodConfAdd.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleMethodConfAdd.java new file mode 100644 index 0000000..a64049d --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleMethodConfAdd.java @@ -0,0 +1,19 @@ +package com.zt.plat.module.qms.business.config.controller.vo; + +import java.util.List; + +import lombok.Data; + +@Data +public class ConfigSubSampleMethodConfAdd { + + /** 分析方法id **/ + private Long methodId; + + /** 检测项目 **/ + private List projectIdList; + + /** 条件 需要存在分析的检测项目,才添加分析方法 **/ + private List conditionProjectIdList; + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleMethodConfInfo.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleMethodConfInfo.java index 41f2b37..e854bf1 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleMethodConfInfo.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleMethodConfInfo.java @@ -6,6 +6,9 @@ import lombok.Data; @Data public class ConfigSubSampleMethodConfInfo { + + /** 添加分析任务 **/ + private ConfigSubSampleMethodConfAdd addAssayTask; /** 分析方法参数取值配置 **/ private List getParam; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleMethodExtendRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleMethodExtendRespVO.java index 9cce8d3..4fa4953 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleMethodExtendRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleMethodExtendRespVO.java @@ -5,11 +5,29 @@ import lombok.Data; @Data public class ConfigSubSampleMethodExtendRespVO extends ConfigSubSampleMethodRespVO { + + @Schema(description = "样品大类ID", example = "15082") + private Long baseSampleId; + + @Schema(description = "主样配置ID", example = "1906") + private Long configBaseSampleId; + + @Schema(description = "分样配置ID", example = "13652") + private Long configSubSampleParentId; + + @Schema(description = "分析方法id") + private Long configAssayMethodId; + + @Schema(description = "是否默认使用,1-是,0-否") + private Integer isDefaultUse; /** 分析方法名称 **/ @Schema(description = "分析方法名称") private String configAssayMethodName; + @Schema(description = "检测方法配置名称及类别") + private String configAssayMethodNameAndCategory; + /** 分析方法编号 **/ @Schema(description = "分析方法编号") private String configAssayMethodCode; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleMethodPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleMethodPageReqVO.java index 8fd05b4..45c34ca 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleMethodPageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleMethodPageReqVO.java @@ -9,18 +9,15 @@ 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") +@Schema(description = "管理后台 - 子样与分样检测方法配置表分页 Request VO") @Data public class ConfigSubSampleMethodPageReqVO extends PageParam { @Schema(description = "子样配置ID", example = "27079") private Long configSubSampleId; - @Schema(description = "检测方法配置ID", example = "30543") - private Long configAssayMethodId; - - @Schema(description = "是否默认使用,1-启用,0-不启用") - private Integer isDefaultUse; + @Schema(description = "分样与检测方法配置ID", example = "30543") + private Long configSubSampleParentMethodId; @Schema(description = "任务数", example = "27414") private Integer taskCount; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleMethodRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleMethodRespVO.java index 9b5f322..592360b 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleMethodRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleMethodRespVO.java @@ -7,7 +7,7 @@ import org.springframework.format.annotation.DateTimeFormat; import java.time.LocalDateTime; import com.alibaba.excel.annotation.*; -@Schema(description = "管理后台 - 子样与检测方法配置 Response VO") +@Schema(description = "管理后台 - 子样与分样检测方法配置表 Response VO") @Data @ExcelIgnoreUnannotated public class ConfigSubSampleMethodRespVO { @@ -20,13 +20,8 @@ public class ConfigSubSampleMethodRespVO { @ExcelProperty("子样配置ID") private Long configSubSampleId; - @Schema(description = "检测方法配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "30543") - @ExcelProperty("检测方法配置ID") - private Long configAssayMethodId; - - @Schema(description = "是否默认使用,1-启用,0-不启用", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("是否默认使用,1-启用,0-不启用") - private Integer isDefaultUse; + @Schema(description = "分样与检测方法配置ID", example = "30543") + private Long configSubSampleParentMethodId; @Schema(description = "任务数", example = "27414") @ExcelProperty("任务数") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleMethodSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleMethodSaveReqVO.java index 84f588c..41c82f4 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleMethodSaveReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleMethodSaveReqVO.java @@ -5,7 +5,7 @@ import lombok.*; import java.util.*; import jakarta.validation.constraints.*; -@Schema(description = "管理后台 - 子样与检测方法配置新增/修改 Request VO") +@Schema(description = "管理后台 - 子样与分样检测方法配置表新增/修改 Request VO") @Data public class ConfigSubSampleMethodSaveReqVO { @@ -16,13 +16,8 @@ public class ConfigSubSampleMethodSaveReqVO { @NotNull(message = "子样配置ID不能为空") private Long configSubSampleId; - @Schema(description = "检测方法配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "30543") - @NotNull(message = "检测方法配置ID不能为空") - private Long configAssayMethodId; - - @Schema(description = "是否默认使用,1-启用,0-不启用", requiredMode = Schema.RequiredMode.REQUIRED) - @NotNull(message = "是否默认使用,1-启用,0-不启用不能为空") - private Integer isDefaultUse; + @Schema(description = "分样与检测方法配置ID", example = "30543") + private Long configSubSampleParentMethodId; @Schema(description = "任务数", example = "27414") private Integer taskCount; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleParentMethodPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleParentMethodPageReqVO.java index 4fa8bd4..5224a48 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleParentMethodPageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleParentMethodPageReqVO.java @@ -19,6 +19,9 @@ public class ConfigSubSampleParentMethodPageReqVO extends PageParam { @Schema(description = "检测方法配置ID", example = "24094") private Long configAssayMethodId; + @Schema(description = "是否默认使用,1-启用,0-不启用") + private Integer isDefaultUse; + @Schema(description = "结果处理方式,automatic-自动报出(不超差),manual-手动报出,modify-允许修改") private String resultTreatmentWay; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleParentMethodRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleParentMethodRespVO.java index 87dc823..abf91e7 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleParentMethodRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleParentMethodRespVO.java @@ -24,6 +24,9 @@ public class ConfigSubSampleParentMethodRespVO { @ExcelProperty("检测方法配置ID") private Long configAssayMethodId; + @Schema(description = "是否默认使用,1-启用,0-不启用") + private Integer isDefaultUse; + @Schema(description = "结果处理方式,automatic-自动报出(不超差),manual-手动报出,modify-允许修改") @ExcelProperty("结果处理方式,automatic-自动报出(不超差),manual-手动报出,modify-允许修改") private String resultTreatmentWay; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleParentMethodSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleParentMethodSaveReqVO.java index f13c75a..286fe81 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleParentMethodSaveReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleParentMethodSaveReqVO.java @@ -20,6 +20,9 @@ public class ConfigSubSampleParentMethodSaveReqVO { @NotNull(message = "检测方法配置ID不能为空") private Long configAssayMethodId; + @Schema(description = "是否默认使用,1-启用,0-不启用") + private Integer isDefaultUse; + @Schema(description = "结果处理方式,automatic-自动报出(不超差),manual-手动报出,modify-允许修改") private String resultTreatmentWay; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/MaterialAssayStandardMethodExtendRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/MaterialAssayStandardMethodExtendRespVO.java new file mode 100644 index 0000000..3fe0a88 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/MaterialAssayStandardMethodExtendRespVO.java @@ -0,0 +1,17 @@ +package com.zt.plat.module.qms.business.config.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class MaterialAssayStandardMethodExtendRespVO extends MaterialAssayStandardMethodRespVO { + + @Schema(description = "检测项目id") + private Long dictionaryProjectId; + + @Schema(description = "分析方法名称") + private String configAssayMethodName; + + @Schema(description = "检测方法配置名称及类别") + private String configAssayMethodNameAndCategory; +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/BaseSampleDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/BaseSampleDO.java index 9fd5436..1656e6e 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/BaseSampleDO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/BaseSampleDO.java @@ -52,10 +52,15 @@ public class BaseSampleDO extends BusinessBaseDO { @TableField("MTRL_NAME") private String materialName; /** - * 样品类型_ID,字典表【T_DIC_BSN】结算样、委检样、抽查样 + * 样品类型 */ @TableField("DIC_BSN_ID") private Long dictionaryBusinessId; + /** + * 样品类型key + */ + @TableField("DIC_BSN_KY") + private String dictionaryBusinessKey; /** * 所属部门 */ diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigAssayMethodDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigAssayMethodDO.java index 1d49e38..d10ff91 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigAssayMethodDO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigAssayMethodDO.java @@ -57,6 +57,11 @@ public class ConfigAssayMethodDO extends BusinessBaseDO { @TableField("MTHD_CD") private String methodCode; /** + * 方法名称及类别 + */ + @TableField("MTHD_NAME_CTGR") + private String methodNameCategory; + /** * 描述 */ @TableField("DSP") @@ -82,6 +87,11 @@ public class ConfigAssayMethodDO extends BusinessBaseDO { @TableField("CFG_RPT_TMPL_KY") private String configReportTemplateKey; /** + * 任务单数据类型,横向:horizontal,纵向:‌vertical‌ + */ + @TableField("RPT_DAT_TP") + private String reportDataType; + /** * 任务单编号规则 */ @TableField("CD_RUL") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigAssayMethodParameterDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigAssayMethodParameterDO.java new file mode 100644 index 0000000..817c5e9 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigAssayMethodParameterDO.java @@ -0,0 +1,120 @@ +package com.zt.plat.module.qms.business.config.dal.dataobject; + +import lombok.*; +import java.util.*; + 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("t_cfg_asy_mthd_prm") +@KeySequence("t_cfg_asy_mthd_prm_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class ConfigAssayMethodParameterDO extends BusinessBaseDO { + + + + /** + * ID + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 检测方法ID + */ + @TableField("CFG_ASY_MTHD_ID") + private Long configAssayMethodId; + /** + * 参数名称 + */ + @TableField("PRM_NAME") + private String parameterName; + /** + * 参数简称 + */ + @TableField("SHRT_NAME") + private String shortName; + /** + * 参数序号 + */ + @TableField("NO") + private Integer no; + /** + * 键值 + */ + @TableField("KY") + private String key; + /** + * 填写方式,字典表【T_DIC_BSN】人工录入,天平采集,计算 + */ + @TableField("FIL_WY") + private String fillingWay; + /** + * 数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间 + */ + @TableField("DAT_TP") + private String dataType; + /** + * 小数位 + */ + @TableField("DEC_POS") + private Integer decimalPosition; + /** + * 默认值 + */ + @TableField("DFT_VAL") + private String defaultValue; + /** + * 是否允许为空 + */ + @TableField("IS_NLL") + private Integer isNull; + /** + * pc界面是否显示 + */ + @TableField("IS_SHW") + private Integer isShow; + /** + * 排序号 + */ + @TableField("SRT_NO") + private Integer sortNo; + /** + * 参数分组_ID,字典表【T_DIC_BSN】参数分组 + */ + @TableField("DIC_BSN_ID") + private Long dictionaryBusinessId; + /** + * 参数分组_Key,字典表【T_DIC_BSN】参数分组 + */ + @TableField("DIC_BSN_KY") + private String dictionaryBusinessKey; + /** + * 所属部门 + */ + @TableField("SYS_DEPT_CD") + private String systemDepartmentCode; + /** + * 备注 + */ + @TableField("RMK") + private String remark; + /** + * 版本 + */ + @TableField("VER") + private Integer version; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigAssayMethodProjectParameterDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigAssayMethodProjectParameterDO.java index feaeb99..f995c82 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigAssayMethodProjectParameterDO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigAssayMethodProjectParameterDO.java @@ -42,6 +42,41 @@ public class ConfigAssayMethodProjectParameterDO extends BusinessBaseDO { @TableField("DIC_PRM_ID") private Long dictionaryParameterId; /** + * 参数名称 + */ + @TableField("PRM_NAME") + private String parameterName; + /** + * 参数简称 + */ + @TableField("SHRT_NAME") + private String shortName; + /** + * 参数序号 + */ + @TableField("NO") + private Integer no; + /** + * 键值 + */ + @TableField("KY") + private String key; + /** + * 单位ID,UNT表 + */ + @TableField("UNT_ID") + private Long unitId; + /** + * 单位 + */ + @TableField("UNT") + private String unit; + /** + * 填写方式,字典表【T_DIC_BSN】,keyboard-人工数字键盘录入,input-人工文本录入,collect-天平采集,calculate-计算 + */ + @TableField("FIL_WY") + private String fillingWay; + /** * 数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间 */ @TableField("DAT_TP") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigEntrustSourceSampleTypeDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigEntrustSourceSampleTypeDO.java new file mode 100644 index 0000000..412c862 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigEntrustSourceSampleTypeDO.java @@ -0,0 +1,60 @@ +package com.zt.plat.module.qms.business.config.dal.dataobject; + +import lombok.*; +import java.util.*; + import java.time.LocalDateTime; + import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.*; +import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; +/** +* 检验委托来源与样品类型配置 DO +* +* @author 后台管理 +*/ +@TableName("t_cfg_entt_src_smp_tp") +@KeySequence("t_cfg_entt_src_smp_tp_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class ConfigEntrustSourceSampleTypeDO extends BusinessBaseDO { + + + + /** + * ID + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 检验委托来源配置ID + */ + @TableField("CFG_ENTT_SRC_ID") + private Long configEntrustSourceId; + /** + * 样品类型_ID,字典表【T_DIC_BSN】样品类型:委检样、商检分析样、商检综合样、西南铜产品 + */ + @TableField("DIC_BSN_ID") + private Long dictionaryBusinessId; + /** + * 参数分组_Key,字典表【T_DIC_BSN】样品类型 + */ + @TableField("DIC_BSN_KY") + private String dictionaryBusinessKey; + /** + * 所属部门 + */ + @TableField("SYS_DEPT_CD") + private String systemDepartmentCode; + /** + * 备注 + */ + @TableField("RMK") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigQCSampleMethodDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigQCSampleMethodDO.java index ba8720c..5703ae0 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigQCSampleMethodDO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigQCSampleMethodDO.java @@ -77,6 +77,11 @@ public class ConfigQCSampleMethodDO extends BusinessBaseDO { @TableField("CFG_INF") private String configInfomation; /** + * 必要检测项目 + */ + @TableField("MUST_PRJ") + private String mustProject; + /** * 排序号 */ @TableField("SRT_NO") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigQCSampleMethodParameterDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigQCSampleMethodParameterDO.java index 5ba95d1..8c31526 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigQCSampleMethodParameterDO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigQCSampleMethodParameterDO.java @@ -42,6 +42,41 @@ public class ConfigQCSampleMethodParameterDO extends BusinessBaseDO { @TableField("DIC_PRM_ID") private Long dictionaryParameterId; /** + * 参数名称 + */ + @TableField("PRM_NAME") + private String parameterName; + /** + * 参数简称 + */ + @TableField("SHRT_NAME") + private String shortName; + /** + * 参数序号 + */ + @TableField("NO") + private Integer no; + /** + * 键值 + */ + @TableField("KY") + private String key; + /** + * 单位ID,UNT表 + */ + @TableField("UNT_ID") + private Long unitId; + /** + * 单位 + */ + @TableField("UNT") + private String unit; + /** + * 填写方式,字典表【T_DIC_BSN】,keyboard-人工数字键盘录入,input-人工文本录入,collect-天平采集,calculate-计算 + */ + @TableField("FIL_WY") + private String fillingWay; + /** * 数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间 */ @TableField("DAT_TP") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigSubSampleMethodDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigSubSampleMethodDO.java index 9cd6934..cf24b10 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigSubSampleMethodDO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigSubSampleMethodDO.java @@ -7,7 +7,7 @@ import java.util.*; import com.baomidou.mybatisplus.annotation.*; import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; /** -* 子样与检测方法配置 DO +* 子样与分样检测方法配置表 DO * * @author 后台管理 */ @@ -37,15 +37,10 @@ public class ConfigSubSampleMethodDO extends BusinessBaseDO { @TableField("CFG_SB_SMP_ID") private Long configSubSampleId; /** - * 检测方法配置ID + * 分样与检测方法配置ID */ - @TableField("CFG_ASY_MTHD_ID") - private Long configAssayMethodId; - /** - * 是否默认使用,1-是,0-否 - */ - @TableField("IS_DFT_USE") - private Integer isDefaultUse; + @TableField("CFG_SB_SMP_PRN_MTHD_ID") + private Long configSubSampleParentMethodId; /** * 任务数 */ diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigSubSampleParentMethodDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigSubSampleParentMethodDO.java index 8fa3ebe..c4aecb3 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigSubSampleParentMethodDO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigSubSampleParentMethodDO.java @@ -42,6 +42,11 @@ public class ConfigSubSampleParentMethodDO extends BusinessBaseDO { @TableField("CFG_ASY_MTHD_ID") private Long configAssayMethodId; /** + * 是否默认使用,1-是,0-否 + */ + @TableField("IS_DFT_USE") + private Integer isDefaultUse; + /** * 结果处理方式,automatic-自动报出(不超差),manual-手动报出,modify-允许修改 */ @TableField("RSLT_TMT_WY") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/BaseSampleMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/BaseSampleMapper.java index d208ce7..c728524 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/BaseSampleMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/BaseSampleMapper.java @@ -1,10 +1,18 @@ package com.zt.plat.module.qms.business.config.dal.mapper; import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.util.object.BeanUtils; import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zt.plat.framework.mybatis.core.query.MPJLambdaWrapperX; +import com.zt.plat.framework.tenant.core.context.TenantContextHolder; import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; -import com.zt.plat.module.qms.business.config.controller.vo.BaseSamplePageReqVO; +import com.zt.plat.module.qms.business.config.controller.vo.*; import com.zt.plat.module.qms.business.config.dal.dataobject.BaseSampleDO; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigEntrustSourceSampleTypeDO; +import com.zt.plat.module.qms.enums.QmsCommonConstant; + +import cn.hutool.core.util.ObjectUtil; + import org.apache.ibatis.annotations.Mapper; import java.util.List; @@ -29,6 +37,28 @@ public interface BaseSampleMapper extends BaseMapperX { .eqIfPresent(BaseSampleDO::getRemark, reqVO.getRemark()) .orderByDesc(BaseSampleDO::getId)); } + + default List selectList(BaseSamplePageReqVO reqVO) { + LambdaQueryWrapperX queryWrapperX = new LambdaQueryWrapperX() + .likeIfPresent(BaseSampleDO::getName, reqVO.getName()) + .eqIfPresent(BaseSampleDO::getMaterialId, reqVO.getMaterialId()) + .eqIfPresent(BaseSampleDO::getMaterialCode, reqVO.getMaterialCode()) + .likeIfPresent(BaseSampleDO::getMaterialName, reqVO.getMaterialName()) + .eqIfPresent(BaseSampleDO::getDictionaryBusinessId, reqVO.getDictionaryBusinessId()) + .eqIfPresent(BaseSampleDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .betweenIfPresent(BaseSampleDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(BaseSampleDO::getRemark, reqVO.getRemark()); + if (ObjectUtil.isNotEmpty(reqVO.getConfigEntrustSourceId())) { + queryWrapperX.inSql(BaseSampleDO::getDictionaryBusinessId, "SELECT tcesst.DIC_BSN_ID FROM T_CFG_ENTT_SRC_SMP_TP tcesst WHERE tcesst.DELETED = 0 AND tcesst.CFG_ENTT_SRC_ID = " + reqVO.getConfigEntrustSourceId()); + } + if (QmsCommonConstant.ENTRUST_INSPECTION.equals(reqVO.getEntrustType())) { + queryWrapperX.inSql(BaseSampleDO::getDictionaryBusinessId, "SELECT tcesst.DIC_BSN_ID FROM T_CFG_ENTT_SRC_SMP_TP tcesst LEFT JOIN T_CFG_ENTT_SRC tces ON tcesst.CFG_ENTT_SRC_ID = tces.ID WHERE tcesst.DELETED = 0 AND tces.DELETED = 0 AND tces.ENTT_TP = '" + reqVO.getEntrustType() + "'"); + } + + queryWrapperX.orderByDesc(BaseSampleDO::getId); + List list = selectList(queryWrapperX); + return BeanUtils.toBean(list, BaseSampleRespVO.class); + } List getBaseSampleListWithAssayStandardCount(); diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigAssayMethodMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigAssayMethodMapper.java index 03df34b..4006332 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigAssayMethodMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigAssayMethodMapper.java @@ -4,14 +4,12 @@ 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.query.MPJLambdaWrapperX; import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; import com.zt.plat.module.qms.business.config.controller.vo.ConfigAssayMethodPageReqVO; import com.zt.plat.module.qms.business.config.controller.vo.ConfigAssayMethodReqVO; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodDO; import org.apache.ibatis.annotations.Mapper; -import com.zt.plat.module.qms.business.config.controller.vo.*; /** * 检测方法配置 Mapper @@ -27,11 +25,13 @@ public interface ConfigAssayMethodMapper extends BaseMapperX { + + default PageResult selectPage(ConfigAssayMethodParameterPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(ConfigAssayMethodParameterDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId()) + .likeIfPresent(ConfigAssayMethodParameterDO::getParameterName, reqVO.getParameterName()) + .likeIfPresent(ConfigAssayMethodParameterDO::getShortName, reqVO.getShortName()) + .eqIfPresent(ConfigAssayMethodParameterDO::getNo, reqVO.getNo()) + .eqIfPresent(ConfigAssayMethodParameterDO::getKey, reqVO.getKey()) + .eqIfPresent(ConfigAssayMethodParameterDO::getFillingWay, reqVO.getFillingWay()) + .eqIfPresent(ConfigAssayMethodParameterDO::getDataType, reqVO.getDataType()) + .eqIfPresent(ConfigAssayMethodParameterDO::getDecimalPosition, reqVO.getDecimalPosition()) + .eqIfPresent(ConfigAssayMethodParameterDO::getDefaultValue, reqVO.getDefaultValue()) + .eqIfPresent(ConfigAssayMethodParameterDO::getIsNull, reqVO.getIsNull()) + .eqIfPresent(ConfigAssayMethodParameterDO::getIsShow, reqVO.getIsShow()) + .eqIfPresent(ConfigAssayMethodParameterDO::getSortNo, reqVO.getSortNo()) + .eqIfPresent(ConfigAssayMethodParameterDO::getDictionaryBusinessId, reqVO.getDictionaryBusinessId()) + .eqIfPresent(ConfigAssayMethodParameterDO::getDictionaryBusinessKey, reqVO.getDictionaryBusinessKey()) + .eqIfPresent(ConfigAssayMethodParameterDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .betweenIfPresent(ConfigAssayMethodParameterDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(ConfigAssayMethodParameterDO::getRemark, reqVO.getRemark()) + .eqIfPresent(ConfigAssayMethodParameterDO::getVersion, reqVO.getVersion()) + .orderByDesc(ConfigAssayMethodParameterDO::getId)); + } + + default List selectByConfigAssayMethodId(Long configAssayMethodId) { + return selectList(new LambdaQueryWrapperX() + .eq(ConfigAssayMethodParameterDO::getConfigAssayMethodId, configAssayMethodId)); + } + + default List selectByConfigAssayMethodIds(List configAssayMethodIdList) { + return selectList(new LambdaQueryWrapperX() + .in(ConfigAssayMethodParameterDO::getConfigAssayMethodId, configAssayMethodIdList)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigAssayMethodProjectMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigAssayMethodProjectMapper.java index 132c413..91179ca 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigAssayMethodProjectMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigAssayMethodProjectMapper.java @@ -1,12 +1,11 @@ package com.zt.plat.module.qms.business.config.dal.mapper; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.zt.plat.framework.common.pojo.PageResult; import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; import com.zt.plat.framework.mybatis.core.query.MPJLambdaWrapperX; -import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayProjectDataDO; import com.zt.plat.module.qms.business.config.controller.vo.*; import com.zt.plat.module.qms.business.config.controller.vo.ConfigAssayMethodProjectPageReqVO; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodDO; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectDO; import com.zt.plat.module.qms.business.dic.dal.dataobject.DictionaryProjectDO; import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; @@ -63,5 +62,27 @@ public interface ConfigAssayMethodProjectMapper extends BaseMapperX selectByConfigSubSampleIdsAndAssayDepartmentId(List configSubSampleIds, Long assayDepartmentId) { + StringBuilder inSql = new StringBuilder("SELECT tcsspm.CFG_ASY_MTHD_ID FROM T_CFG_SB_SMP_MTHD tcssm LEFT JOIN T_CFG_SB_SMP_PRN_MTHD tcsspm ON tcssm.CFG_SB_SMP_PRN_MTHD_ID = tcsspm.ID WHERE tcssm.DELETED = 0 AND tcsspm.DELETED = 0 AND tcssm.CFG_SB_SMP_ID IN ("); + for (Long configSubSampleId : configSubSampleIds) { + inSql.append(configSubSampleId).append(","); + } + inSql.delete(inSql.length() - 1, inSql.length()); + inSql.append(")"); + return selectJoinList(ConfigAssayMethodProjectExtendRespVO.class, new MPJLambdaWrapperX() + .leftJoin(ConfigAssayMethodDO.class, ConfigAssayMethodDO::getId, ConfigAssayMethodProjectDO::getConfigAssayMethodId) + .selectAll(ConfigAssayMethodProjectDO.class) + .selectAs(ConfigAssayMethodDO::getName, ConfigAssayMethodProjectExtendRespVO::getConfigAssayMethodName) + .selectAs(ConfigAssayMethodDO::getMethodNameCategory, ConfigAssayMethodProjectExtendRespVO::getConfigAssayMethodNameAndCategory) + .eq(ConfigAssayMethodDO::getAssayDepartmentId, assayDepartmentId) + .inSql(ConfigAssayMethodProjectDO::getConfigAssayMethodId, inSql.toString())); + } } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigAssayMethodProjectParameterMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigAssayMethodProjectParameterMapper.java index 09910e8..16c4d2a 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigAssayMethodProjectParameterMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigAssayMethodProjectParameterMapper.java @@ -25,6 +25,13 @@ public interface ConfigAssayMethodProjectParameterMapper extends BaseMapperX() .eqIfPresent(ConfigAssayMethodProjectParameterDO::getConfigAssayMethodProjectId, reqVO.getConfigAssayMethodProjectId()) .eqIfPresent(ConfigAssayMethodProjectParameterDO::getDictionaryParameterId, reqVO.getDictionaryParameterId()) + .likeIfPresent(ConfigAssayMethodProjectParameterDO::getParameterName, reqVO.getParameterName()) + .likeIfPresent(ConfigAssayMethodProjectParameterDO::getShortName, reqVO.getShortName()) + .eqIfPresent(ConfigAssayMethodProjectParameterDO::getNo, reqVO.getNo()) + .eqIfPresent(ConfigAssayMethodProjectParameterDO::getKey, reqVO.getKey()) + .eqIfPresent(ConfigAssayMethodProjectParameterDO::getUnitId, reqVO.getUnitId()) + .eqIfPresent(ConfigAssayMethodProjectParameterDO::getUnit, reqVO.getUnit()) + .eqIfPresent(ConfigAssayMethodProjectParameterDO::getFillingWay, reqVO.getFillingWay()) .eqIfPresent(ConfigAssayMethodProjectParameterDO::getDataType, reqVO.getDataType()) .eqIfPresent(ConfigAssayMethodProjectParameterDO::getDecimalPosition, reqVO.getDecimalPosition()) .eqIfPresent(ConfigAssayMethodProjectParameterDO::getDefaultValue, reqVO.getDefaultValue()) diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigBaseSampleMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigBaseSampleMapper.java index 69e0306..5776161 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigBaseSampleMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigBaseSampleMapper.java @@ -6,6 +6,9 @@ import com.zt.plat.module.qms.business.config.controller.vo.*; import com.zt.plat.module.qms.business.config.controller.vo.ConfigBaseSamplePageReqVO; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigBaseSampleDO; import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; + +import java.util.List; + import org.apache.ibatis.annotations.Mapper; /** @@ -31,5 +34,10 @@ public interface ConfigBaseSampleMapper extends BaseMapperX .eqIfPresent(ConfigBaseSampleDO::getVersion, reqVO.getVersion()) .orderByDesc(ConfigBaseSampleDO::getId)); } + + default List selectByBaseSampleIds(List baseSampleIds) { + return selectList(new LambdaQueryWrapperX() + .in(ConfigBaseSampleDO::getBaseSampleId, baseSampleIds)); + } } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigEntrustSourceSampleTypeMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigEntrustSourceSampleTypeMapper.java new file mode 100644 index 0000000..dd2edad --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigEntrustSourceSampleTypeMapper.java @@ -0,0 +1,31 @@ +package com.zt.plat.module.qms.business.config.dal.mapper; + +import java.util.*; + +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigEntrustSourceSampleTypePageReqVO; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigEntrustSourceSampleTypeDO; +import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; +import org.apache.ibatis.annotations.Mapper; + +/** + * 检验委托来源与样品类型配置 Mapper + * + * @author 后台管理 + */ +@Mapper +public interface ConfigEntrustSourceSampleTypeMapper extends BaseMapperX { + + default PageResult selectPage(ConfigEntrustSourceSampleTypePageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(ConfigEntrustSourceSampleTypeDO::getConfigEntrustSourceId, reqVO.getConfigEntrustSourceId()) + .eqIfPresent(ConfigEntrustSourceSampleTypeDO::getDictionaryBusinessId, reqVO.getDictionaryBusinessId()) + .eqIfPresent(ConfigEntrustSourceSampleTypeDO::getDictionaryBusinessKey, reqVO.getDictionaryBusinessKey()) + .eqIfPresent(ConfigEntrustSourceSampleTypeDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .betweenIfPresent(ConfigEntrustSourceSampleTypeDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(ConfigEntrustSourceSampleTypeDO::getRemark, reqVO.getRemark()) + .orderByDesc(ConfigEntrustSourceSampleTypeDO::getId)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigQCSampleMethodMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigQCSampleMethodMapper.java index 5a0fc14..1b88f58 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigQCSampleMethodMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigQCSampleMethodMapper.java @@ -6,9 +6,7 @@ import com.zt.plat.framework.common.pojo.PageResult; import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; import com.zt.plat.framework.mybatis.core.query.MPJLambdaWrapperX; import com.zt.plat.module.qms.business.config.controller.vo.*; -import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodDO; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigQCSampleMethodDO; -import com.zt.plat.module.qms.business.dic.dal.dataobject.DictionarySampleTypeDO; import com.zt.plat.module.qms.common.dic.dal.dataobject.DictionaryBusinessDO; import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; import org.apache.ibatis.annotations.Mapper; @@ -32,6 +30,7 @@ public interface ConfigQCSampleMethodMapper extends BaseMapperX selectByConfigAssayMethodId(Long configAssayMethodId) { return selectJoinList(ConfigQCSampleMethodExtendRespVO.class, new MPJLambdaWrapperX() - .leftJoin(DictionaryBusinessDO.class, DictionaryBusinessDO::getId, ConfigQCSampleMethodDO::getDictionaryBusinessId) + .leftJoin(DictionaryBusinessDO.class, "dbd1", DictionaryBusinessDO::getId, ConfigQCSampleMethodDO::getDictionaryBusinessId) + .leftJoin(DictionaryBusinessDO.class, "dbd2", DictionaryBusinessDO::getId, "dbd1", DictionaryBusinessDO::getParentId) .selectAll(ConfigQCSampleMethodDO.class) - .selectAs(DictionaryBusinessDO::getName, ConfigQCSampleMethodExtendRespVO::getDictionaryBusinessName) + .selectAs("dbd1", DictionaryBusinessDO::getName, ConfigQCSampleMethodExtendRespVO::getDictionaryBusinessName) + .selectAs("dbd1", DictionaryBusinessDO::getParentId, ConfigQCSampleMethodExtendRespVO::getParentDictionaryBusinessId) + .selectAs("dbd2", DictionaryBusinessDO::getKey, ConfigQCSampleMethodExtendRespVO::getParentDictionaryBusinesskey) + .selectAs("dbd2", DictionaryBusinessDO::getName, ConfigQCSampleMethodExtendRespVO::getParentDictionaryBusinessName) .eq(ConfigQCSampleMethodDO::getConfigAssayMethodId, configAssayMethodId) .orderByAsc(ConfigQCSampleMethodDO::getSortNo)); } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigQCSampleMethodParameterMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigQCSampleMethodParameterMapper.java index 4917cc9..125f3cc 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigQCSampleMethodParameterMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigQCSampleMethodParameterMapper.java @@ -7,7 +7,6 @@ import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; import com.zt.plat.framework.mybatis.core.query.MPJLambdaWrapperX; import com.zt.plat.module.qms.business.config.controller.vo.*; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigQCSampleMethodParameterDO; -import com.zt.plat.module.qms.business.dic.dal.dataobject.DictionaryParameterDO; import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; import org.apache.ibatis.annotations.Mapper; @@ -23,6 +22,13 @@ public interface ConfigQCSampleMethodParameterMapper extends BaseMapperX() .eqIfPresent(ConfigQCSampleMethodParameterDO::getConfigQCSampleMethodId, reqVO.getConfigQCSampleMethodId()) .eqIfPresent(ConfigQCSampleMethodParameterDO::getDictionaryParameterId, reqVO.getDictionaryParameterId()) + .likeIfPresent(ConfigQCSampleMethodParameterDO::getParameterName, reqVO.getParameterName()) + .likeIfPresent(ConfigQCSampleMethodParameterDO::getShortName, reqVO.getShortName()) + .eqIfPresent(ConfigQCSampleMethodParameterDO::getNo, reqVO.getNo()) + .eqIfPresent(ConfigQCSampleMethodParameterDO::getKey, reqVO.getKey()) + .eqIfPresent(ConfigQCSampleMethodParameterDO::getUnitId, reqVO.getUnitId()) + .eqIfPresent(ConfigQCSampleMethodParameterDO::getUnit, reqVO.getUnit()) + .eqIfPresent(ConfigQCSampleMethodParameterDO::getFillingWay, reqVO.getFillingWay()) .eqIfPresent(ConfigQCSampleMethodParameterDO::getDataType, reqVO.getDataType()) .eqIfPresent(ConfigQCSampleMethodParameterDO::getDecimalPosition, reqVO.getDecimalPosition()) .eqIfPresent(ConfigQCSampleMethodParameterDO::getDefaultValue, reqVO.getDefaultValue()) @@ -39,25 +45,11 @@ public interface ConfigQCSampleMethodParameterMapper extends BaseMapperX selectByConfigQCSampleMethodId(Long configQCSampleMethodId) { return selectJoinList(ConfigQCSampleMethodParameterExtendRespVO.class, new MPJLambdaWrapperX() - .leftJoin(DictionaryParameterDO.class, DictionaryParameterDO::getId, ConfigQCSampleMethodParameterDO::getDictionaryParameterId) - .selectAll(ConfigQCSampleMethodParameterDO.class) - .selectAs(DictionaryParameterDO::getKey, ConfigQCSampleMethodParameterExtendRespVO::getDictionaryParameterKey) - .selectAs(DictionaryParameterDO::getName, ConfigQCSampleMethodParameterExtendRespVO::getDictionaryParameterName) - .selectAs(DictionaryParameterDO::getNo, ConfigQCSampleMethodParameterExtendRespVO::getDictionaryParameterNo) - .selectAs(DictionaryParameterDO::getUnitId, ConfigQCSampleMethodParameterExtendRespVO::getDictionaryParameterUnitId) - .selectAs(DictionaryParameterDO::getUnit, ConfigQCSampleMethodParameterExtendRespVO::getDictionaryParameterUnit) .eq(ConfigQCSampleMethodParameterDO::getConfigQCSampleMethodId, configQCSampleMethodId)); } default List selectByConfigQCSampleMethodIds(List configQCSampleMethodIds) { return selectJoinList(ConfigQCSampleMethodParameterExtendRespVO.class, new MPJLambdaWrapperX() - .leftJoin(DictionaryParameterDO.class, DictionaryParameterDO::getId, ConfigQCSampleMethodParameterDO::getDictionaryParameterId) - .selectAll(ConfigQCSampleMethodParameterDO.class) - .selectAs(DictionaryParameterDO::getKey, ConfigQCSampleMethodParameterExtendRespVO::getDictionaryParameterKey) - .selectAs(DictionaryParameterDO::getName, ConfigQCSampleMethodParameterExtendRespVO::getDictionaryParameterName) - .selectAs(DictionaryParameterDO::getNo, ConfigQCSampleMethodParameterExtendRespVO::getDictionaryParameterNo) - .selectAs(DictionaryParameterDO::getUnitId, ConfigQCSampleMethodParameterExtendRespVO::getDictionaryParameterUnitId) - .selectAs(DictionaryParameterDO::getUnit, ConfigQCSampleMethodParameterExtendRespVO::getDictionaryParameterUnit) .in(ConfigQCSampleMethodParameterDO::getConfigQCSampleMethodId, configQCSampleMethodIds)); } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigSampleReportMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigSampleReportMapper.java index d38332e..5839b93 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigSampleReportMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigSampleReportMapper.java @@ -51,4 +51,9 @@ public interface ConfigSampleReportMapper extends BaseMapperX selectByConfigBaseSampleIds(List configBaseSampleIds) { + return selectList(new LambdaQueryWrapperX() + .in(ConfigSampleReportDO::getConfigBaseSampleId, configBaseSampleIds)); + } } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigSubSampleMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigSubSampleMapper.java index 96fd270..afdab78 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigSubSampleMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigSubSampleMapper.java @@ -6,6 +6,9 @@ import com.zt.plat.module.qms.business.config.controller.vo.*; import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSamplePageReqVO; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSubSampleDO; import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; + +import java.util.List; + import org.apache.ibatis.annotations.Mapper; /** @@ -39,5 +42,10 @@ public interface ConfigSubSampleMapper extends BaseMapperX { .eqIfPresent(ConfigSubSampleDO::getVersion, reqVO.getVersion()) .orderByDesc(ConfigSubSampleDO::getId)); } + + default List selectByBaseSampleIds(List baseSampleIds) { + return selectList(new LambdaQueryWrapperX() + .in(ConfigSubSampleDO::getBaseSampleId, baseSampleIds)); + } } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigSubSampleMethodMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigSubSampleMethodMapper.java index 7abb095..15537ac 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigSubSampleMethodMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigSubSampleMethodMapper.java @@ -1,13 +1,14 @@ package com.zt.plat.module.qms.business.config.dal.mapper; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.zt.plat.framework.common.pojo.PageResult; import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; import com.zt.plat.framework.mybatis.core.query.MPJLambdaWrapperX; import com.zt.plat.module.qms.business.config.controller.vo.*; import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSampleMethodPageReqVO; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodDO; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSubSampleDO; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSubSampleMethodDO; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSubSampleParentMethodDO; import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; import java.util.List; @@ -15,7 +16,7 @@ import java.util.List; import org.apache.ibatis.annotations.Mapper; /** - * 子样与检测方法配置 Mapper + * 子样与分样检测方法配置表 Mapper * * @author 后台管理 */ @@ -25,8 +26,7 @@ public interface ConfigSubSampleMethodMapper extends BaseMapperX selectPage(ConfigSubSampleMethodPageReqVO reqVO) { return selectPage(reqVO, new LambdaQueryWrapperX() .eqIfPresent(ConfigSubSampleMethodDO::getConfigSubSampleId, reqVO.getConfigSubSampleId()) - .eqIfPresent(ConfigSubSampleMethodDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId()) - .eqIfPresent(ConfigSubSampleMethodDO::getIsDefaultUse, reqVO.getIsDefaultUse()) + .eqIfPresent(ConfigSubSampleMethodDO::getConfigSubSampleParentMethodId, reqVO.getConfigSubSampleParentMethodId()) .eqIfPresent(ConfigSubSampleMethodDO::getTaskCount, reqVO.getTaskCount()) .eqIfPresent(ConfigSubSampleMethodDO::getResultTreatmentWay, reqVO.getResultTreatmentWay()) .eqIfPresent(ConfigSubSampleMethodDO::getAssessmentMethod, reqVO.getAssessmentMethod()) @@ -40,24 +40,59 @@ public interface ConfigSubSampleMethodMapper extends BaseMapperX selectByConfigSubSampleIdAndAssayDepartmentId(Long configSubSampleId, Long assayDepartmentId) { return selectJoinList(ConfigSubSampleMethodExtendRespVO.class, new MPJLambdaWrapperX() - .leftJoin(ConfigAssayMethodDO.class, ConfigAssayMethodDO::getId, ConfigSubSampleMethodDO::getConfigAssayMethodId) + .leftJoin(ConfigSubSampleParentMethodDO.class, ConfigSubSampleParentMethodDO::getId, ConfigSubSampleMethodDO::getConfigSubSampleParentMethodId) + .leftJoin(ConfigAssayMethodDO.class, ConfigAssayMethodDO::getId, ConfigSubSampleParentMethodDO::getConfigAssayMethodId) .selectAll(ConfigSubSampleMethodDO.class) + .selectAs(ConfigSubSampleParentMethodDO::getConfigAssayMethodId, ConfigSubSampleMethodExtendRespVO::getConfigAssayMethodId) + .selectAs(ConfigSubSampleParentMethodDO::getIsDefaultUse, ConfigSubSampleMethodExtendRespVO::getIsDefaultUse) .selectAs(ConfigAssayMethodDO::getName, ConfigSubSampleMethodExtendRespVO::getConfigAssayMethodName) + .selectAs(ConfigAssayMethodDO::getMethodNameCategory, ConfigSubSampleMethodExtendRespVO::getConfigAssayMethodNameAndCategory) .selectAs(ConfigAssayMethodDO::getMethodCode, ConfigSubSampleMethodExtendRespVO::getConfigAssayMethodCode) .eq(ConfigSubSampleMethodDO::getConfigSubSampleId, configSubSampleId) .eq(ConfigAssayMethodDO::getAssayDepartmentId, assayDepartmentId)); } - default ConfigSubSampleMethodDO selectByConfigSubSampleIdAndConfigAssayMethodId(Long configSubSampleId, Long configAssayMethodId) { - return selectOne(new LambdaQueryWrapper() + default ConfigSubSampleMethodExtendRespVO selectByConfigSubSampleIdAndConfigAssayMethodId(Long configSubSampleId, Long configAssayMethodId) { + return selectJoinOne(ConfigSubSampleMethodExtendRespVO.class, new MPJLambdaWrapperX() + .leftJoin(ConfigSubSampleParentMethodDO.class, ConfigSubSampleParentMethodDO::getId, ConfigSubSampleMethodDO::getConfigSubSampleParentMethodId) + .selectAll(ConfigSubSampleMethodDO.class) + .selectAs(ConfigSubSampleParentMethodDO::getConfigAssayMethodId, ConfigSubSampleMethodExtendRespVO::getConfigAssayMethodId) + .selectAs(ConfigSubSampleParentMethodDO::getIsDefaultUse, ConfigSubSampleMethodExtendRespVO::getIsDefaultUse) .eq(ConfigSubSampleMethodDO::getConfigSubSampleId, configSubSampleId) - .eq(ConfigSubSampleMethodDO::getConfigAssayMethodId, configAssayMethodId)); + .eq(ConfigSubSampleParentMethodDO::getConfigAssayMethodId, configAssayMethodId)); } - default List selectByConfigSubSampleIdsAndConfigAssayMethodId(List configSubSampleIds, Long configAssayMethodId) { - return selectList(new LambdaQueryWrapper() + default List selectByConfigSubSampleIdsAndConfigAssayMethodId(List configSubSampleIds, Long configAssayMethodId) { + return selectJoinList(ConfigSubSampleMethodExtendRespVO.class, new MPJLambdaWrapperX() + .leftJoin(ConfigSubSampleParentMethodDO.class, ConfigSubSampleParentMethodDO::getId, ConfigSubSampleMethodDO::getConfigSubSampleParentMethodId) + .selectAll(ConfigSubSampleMethodDO.class) + .selectAs(ConfigSubSampleParentMethodDO::getConfigAssayMethodId, ConfigSubSampleMethodExtendRespVO::getConfigAssayMethodId) + .selectAs(ConfigSubSampleParentMethodDO::getIsDefaultUse, ConfigSubSampleMethodExtendRespVO::getIsDefaultUse) .in(ConfigSubSampleMethodDO::getConfigSubSampleId, configSubSampleIds) - .eq(ConfigSubSampleMethodDO::getConfigAssayMethodId, configAssayMethodId)); + .eq(ConfigSubSampleParentMethodDO::getConfigAssayMethodId, configAssayMethodId)); + } + + default List selectByConfigSubSampleIdsAndConfigAssayMethodIds(List configSubSampleIds, List configAssayMethodIds) { + return selectJoinList(ConfigSubSampleMethodExtendRespVO.class, new MPJLambdaWrapperX() + .leftJoin(ConfigSubSampleParentMethodDO.class, ConfigSubSampleParentMethodDO::getId, ConfigSubSampleMethodDO::getConfigSubSampleParentMethodId) + .leftJoin(ConfigSubSampleDO.class, ConfigSubSampleDO::getId, ConfigSubSampleMethodDO::getConfigSubSampleId) + .selectAll(ConfigSubSampleMethodDO.class) + .selectAs(ConfigSubSampleParentMethodDO::getConfigAssayMethodId, ConfigSubSampleMethodExtendRespVO::getConfigAssayMethodId) + .selectAs(ConfigSubSampleParentMethodDO::getIsDefaultUse, ConfigSubSampleMethodExtendRespVO::getIsDefaultUse) + .selectAs(ConfigSubSampleDO::getConfigSubSampleParentId, ConfigSubSampleMethodExtendRespVO::getConfigSubSampleParentId) + .selectAs(ConfigSubSampleDO::getConfigBaseSampleId, ConfigSubSampleMethodExtendRespVO::getConfigBaseSampleId) + .selectAs(ConfigSubSampleDO::getBaseSampleId, ConfigSubSampleMethodExtendRespVO::getBaseSampleId) + .in(ConfigSubSampleMethodDO::getConfigSubSampleId, configSubSampleIds) + .in(ConfigSubSampleParentMethodDO::getConfigAssayMethodId, configAssayMethodIds)); + } + + default List selectByConfigSubSampleIds(List configSubSampleIds) { + return selectJoinList(ConfigSubSampleMethodExtendRespVO.class, new MPJLambdaWrapperX() + .leftJoin(ConfigSubSampleParentMethodDO.class, ConfigSubSampleParentMethodDO::getId, ConfigSubSampleMethodDO::getConfigSubSampleParentMethodId) + .selectAll(ConfigSubSampleMethodDO.class) + .selectAs(ConfigSubSampleParentMethodDO::getConfigAssayMethodId, ConfigSubSampleMethodExtendRespVO::getConfigAssayMethodId) + .selectAs(ConfigSubSampleParentMethodDO::getIsDefaultUse, ConfigSubSampleMethodExtendRespVO::getIsDefaultUse) + .in(ConfigSubSampleMethodDO::getConfigSubSampleId, configSubSampleIds)); } } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigSubSampleParentMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigSubSampleParentMapper.java index 128215f..4b7cc8b 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigSubSampleParentMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigSubSampleParentMapper.java @@ -6,6 +6,9 @@ import com.zt.plat.module.qms.business.config.controller.vo.*; import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSampleParentPageReqVO; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSubSampleParentDO; import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; + +import java.util.List; + import org.apache.ibatis.annotations.Mapper; /** @@ -30,5 +33,10 @@ public interface ConfigSubSampleParentMapper extends BaseMapperX selectByBaseSampleIds(List baseSampleIds) { + return selectList(new LambdaQueryWrapperX() + .in(ConfigSubSampleParentDO::getBaseSampleId, baseSampleIds)); + } } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigSubSampleParentMethodMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigSubSampleParentMethodMapper.java index d52beca..817dece 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigSubSampleParentMethodMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigSubSampleParentMethodMapper.java @@ -20,6 +20,7 @@ public interface ConfigSubSampleParentMethodMapper extends BaseMapperX() .eqIfPresent(ConfigSubSampleParentMethodDO::getConfigSubSampleParentId, reqVO.getConfigSubSampleParentId()) .eqIfPresent(ConfigSubSampleParentMethodDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId()) + .eqIfPresent(ConfigSubSampleParentMethodDO::getIsDefaultUse, reqVO.getIsDefaultUse()) .eqIfPresent(ConfigSubSampleParentMethodDO::getResultTreatmentWay, reqVO.getResultTreatmentWay()) .eqIfPresent(ConfigSubSampleParentMethodDO::getCalculateMethod, reqVO.getCalculateMethod()) .eqIfPresent(ConfigSubSampleParentMethodDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/MaterialAssayStandardMethodMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/MaterialAssayStandardMethodMapper.java index 8444c1e..eaaf237 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/MaterialAssayStandardMethodMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/MaterialAssayStandardMethodMapper.java @@ -4,12 +4,16 @@ import com.zt.plat.framework.common.pojo.PageResult; import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; import com.zt.plat.framework.mybatis.core.query.MPJLambdaWrapperX; import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; +import com.zt.plat.module.qms.business.config.controller.vo.MaterialAssayStandardMethodExtendRespVO; import com.zt.plat.module.qms.business.config.controller.vo.MaterialAssayStandardMethodPageReqVO; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodDO; import com.zt.plat.module.qms.business.config.dal.dataobject.MaterialAssayStandardDO; import com.zt.plat.module.qms.business.config.dal.dataobject.MaterialAssayStandardDetailDO; import com.zt.plat.module.qms.business.config.dal.dataobject.MaterialAssayStandardMethodDO; import com.zt.plat.module.qms.enums.QmsCommonConstant; +import java.util.List; + import org.apache.ibatis.annotations.Mapper; /** @@ -50,4 +54,19 @@ public interface MaterialAssayStandardMethodMapper extends BaseMapperX selectByBaseSampleIdAndDictionaryProjectIdsAndAssayDepartmentId(Long baseSampleId, List dictionaryProjectIdList, Long assayDepartmentId) { + return selectJoinList(MaterialAssayStandardMethodExtendRespVO.class, new MPJLambdaWrapperX() + .leftJoin(MaterialAssayStandardDetailDO.class, MaterialAssayStandardDetailDO::getId, MaterialAssayStandardMethodDO::getMaterialAssayStandardDetailId) + .leftJoin(MaterialAssayStandardDO.class, MaterialAssayStandardDO::getId, MaterialAssayStandardDetailDO::getMaterialAssayStandardId) + .leftJoin(ConfigAssayMethodDO.class, ConfigAssayMethodDO::getId, MaterialAssayStandardMethodDO::getConfigAssayMethodId) + .selectAll(MaterialAssayStandardMethodDO.class) + .selectAs(MaterialAssayStandardDetailDO::getDictionaryProjectId, MaterialAssayStandardMethodExtendRespVO::getDictionaryProjectId) + .selectAs(ConfigAssayMethodDO::getName, MaterialAssayStandardMethodExtendRespVO::getConfigAssayMethodName) + .selectAs(ConfigAssayMethodDO::getMethodNameCategory, MaterialAssayStandardMethodExtendRespVO::getConfigAssayMethodNameAndCategory) + .eq(MaterialAssayStandardDO::getBaseSampleId, baseSampleId) + .in(MaterialAssayStandardDetailDO::getDictionaryProjectId, dictionaryProjectIdList) + .eq(ConfigAssayMethodDO::getAssayDepartmentId, assayDepartmentId)); + } + + } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/BaseSampleService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/BaseSampleService.java index e67626b..bea9c10 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/BaseSampleService.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/BaseSampleService.java @@ -63,4 +63,11 @@ public interface BaseSampleService { */ PageResult getBaseSamplePage(BaseSamplePageReqVO pageReqVO); + /** + * 获得样品大类管理列表 + * @param reqVO + * @return + */ + List getBaseSampleList(BaseSamplePageReqVO reqVO); + } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/BaseSampleServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/BaseSampleServiceImpl.java index f6fee31..2e3e788 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/BaseSampleServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/BaseSampleServiceImpl.java @@ -92,4 +92,9 @@ public class BaseSampleServiceImpl implements BaseSampleService { return baseSampleMapper.selectPage(pageReqVO); } + @Override + public List getBaseSampleList(BaseSamplePageReqVO reqVO) { + return baseSampleMapper.selectList(reqVO); + } + } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigAssayMethodParameterService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigAssayMethodParameterService.java new file mode 100644 index 0000000..0044938 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigAssayMethodParameterService.java @@ -0,0 +1,62 @@ +package com.zt.plat.module.qms.business.config.service; + +import java.util.*; +import jakarta.validation.*; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.module.qms.business.config.controller.vo.*; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodParameterDO; +import com.zt.plat.framework.common.pojo.PageParam; + +/** + * 检测方法参数配置 Service 接口 + * + * @author 后台管理-1 + */ +public interface ConfigAssayMethodParameterService { + + /** + * 创建检测方法参数配置 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + ConfigAssayMethodParameterRespVO createConfigAssayMethodParameter(@Valid ConfigAssayMethodParameterSaveReqVO createReqVO); + + /** + * 更新检测方法参数配置 + * + * @param updateReqVO 更新信息 + */ + void updateConfigAssayMethodParameter(@Valid ConfigAssayMethodParameterSaveReqVO updateReqVO); + + /** + * 删除检测方法参数配置 + * + * @param id 编号 + */ + void deleteConfigAssayMethodParameter(Long id); + + /** + * 批量删除检测方法参数配置 + * + * @param ids 编号 + */ + void deleteConfigAssayMethodParameterListByIds(List ids); + + /** + * 获得检测方法参数配置 + * + * @param id 编号 + * @return 检测方法参数配置 + */ + ConfigAssayMethodParameterDO getConfigAssayMethodParameter(Long id); + + /** + * 获得检测方法参数配置分页 + * + * @param pageReqVO 分页查询 + * @return 检测方法参数配置分页 + */ + PageResult getConfigAssayMethodParameterPage(ConfigAssayMethodParameterPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigAssayMethodParameterServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigAssayMethodParameterServiceImpl.java new file mode 100644 index 0000000..311e2e3 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigAssayMethodParameterServiceImpl.java @@ -0,0 +1,91 @@ +package com.zt.plat.module.qms.business.config.service; + +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.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.qms.business.config.controller.vo.*; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodParameterDO; +import com.zt.plat.module.qms.business.config.dal.mapper.ConfigAssayMethodParameterMapper; + +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.qms.enums.ErrorCodeConstants.*; + +/** + * 检测方法参数配置 Service 实现类 + * + * @author 后台管理-1 + */ +@Service +@Validated +public class ConfigAssayMethodParameterServiceImpl implements ConfigAssayMethodParameterService { + + @Resource + private ConfigAssayMethodParameterMapper configAssayMethodParameterMapper; + + @Override + public ConfigAssayMethodParameterRespVO createConfigAssayMethodParameter(ConfigAssayMethodParameterSaveReqVO createReqVO) { + // 插入 + ConfigAssayMethodParameterDO configAssayMethodParameter = BeanUtils.toBean(createReqVO, ConfigAssayMethodParameterDO.class); + configAssayMethodParameterMapper.insert(configAssayMethodParameter); + // 返回 + return BeanUtils.toBean(configAssayMethodParameter, ConfigAssayMethodParameterRespVO.class); + } + + @Override + public void updateConfigAssayMethodParameter(ConfigAssayMethodParameterSaveReqVO updateReqVO) { + // 校验存在 + validateConfigAssayMethodParameterExists(updateReqVO.getId()); + // 更新 + ConfigAssayMethodParameterDO updateObj = BeanUtils.toBean(updateReqVO, ConfigAssayMethodParameterDO.class); + configAssayMethodParameterMapper.updateById(updateObj); + } + + @Override + public void deleteConfigAssayMethodParameter(Long id) { + // 校验存在 + validateConfigAssayMethodParameterExists(id); + // 删除 + configAssayMethodParameterMapper.deleteById(id); + } + + @Override + public void deleteConfigAssayMethodParameterListByIds(List ids) { + // 校验存在 + validateConfigAssayMethodParameterExists(ids); + // 删除 + configAssayMethodParameterMapper.deleteByIds(ids); + } + + private void validateConfigAssayMethodParameterExists(List ids) { + List list = configAssayMethodParameterMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(CONFIG_ASSAY_METHOD_PARAMETER_NOT_EXISTS); + } + } + + private void validateConfigAssayMethodParameterExists(Long id) { + if (configAssayMethodParameterMapper.selectById(id) == null) { + throw exception(CONFIG_ASSAY_METHOD_PARAMETER_NOT_EXISTS); + } + } + + @Override + public ConfigAssayMethodParameterDO getConfigAssayMethodParameter(Long id) { + return configAssayMethodParameterMapper.selectById(id); + } + + @Override + public PageResult getConfigAssayMethodParameterPage(ConfigAssayMethodParameterPageReqVO pageReqVO) { + return configAssayMethodParameterMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigEntrustSourceSampleTypeService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigEntrustSourceSampleTypeService.java new file mode 100644 index 0000000..69224a5 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigEntrustSourceSampleTypeService.java @@ -0,0 +1,61 @@ +package com.zt.plat.module.qms.business.config.service; + +import java.util.*; +import jakarta.validation.*; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.module.qms.business.config.controller.vo.*; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigEntrustSourceSampleTypeDO; + +/** + * 检验委托来源与样品类型配置 Service 接口 + * + * @author 后台管理 + */ +public interface ConfigEntrustSourceSampleTypeService { + + /** + * 创建检验委托来源与样品类型配置 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + ConfigEntrustSourceSampleTypeRespVO createConfigEntrustSourceSampleType(@Valid ConfigEntrustSourceSampleTypeSaveReqVO createReqVO); + + /** + * 更新检验委托来源与样品类型配置 + * + * @param updateReqVO 更新信息 + */ + void updateConfigEntrustSourceSampleType(@Valid ConfigEntrustSourceSampleTypeSaveReqVO updateReqVO); + + /** + * 删除检验委托来源与样品类型配置 + * + * @param id 编号 + */ + void deleteConfigEntrustSourceSampleType(Long id); + + /** + * 批量删除检验委托来源与样品类型配置 + * + * @param ids 编号 + */ + void deleteConfigEntrustSourceSampleTypeListByIds(List ids); + + /** + * 获得检验委托来源与样品类型配置 + * + * @param id 编号 + * @return 检验委托来源与样品类型配置 + */ + ConfigEntrustSourceSampleTypeDO getConfigEntrustSourceSampleType(Long id); + + /** + * 获得检验委托来源与样品类型配置分页 + * + * @param pageReqVO 分页查询 + * @return 检验委托来源与样品类型配置分页 + */ + PageResult getConfigEntrustSourceSampleTypePage(ConfigEntrustSourceSampleTypePageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigEntrustSourceSampleTypeServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigEntrustSourceSampleTypeServiceImpl.java new file mode 100644 index 0000000..ec2289b --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigEntrustSourceSampleTypeServiceImpl.java @@ -0,0 +1,91 @@ +package com.zt.plat.module.qms.business.config.service; + +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.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.qms.business.config.controller.vo.*; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigEntrustSourceSampleTypeDO; +import com.zt.plat.module.qms.business.config.dal.mapper.ConfigEntrustSourceSampleTypeMapper; + +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.qms.enums.ErrorCodeConstants.*; + +/** + * 检验委托来源与样品类型配置 Service 实现类 + * + * @author 后台管理 + */ +@Service +@Validated +public class ConfigEntrustSourceSampleTypeServiceImpl implements ConfigEntrustSourceSampleTypeService { + + @Resource + private ConfigEntrustSourceSampleTypeMapper configEntrustSourceSampleTypeMapper; + + @Override + public ConfigEntrustSourceSampleTypeRespVO createConfigEntrustSourceSampleType(ConfigEntrustSourceSampleTypeSaveReqVO createReqVO) { + // 插入 + ConfigEntrustSourceSampleTypeDO configEntrustSourceSampleType = BeanUtils.toBean(createReqVO, ConfigEntrustSourceSampleTypeDO.class); + configEntrustSourceSampleTypeMapper.insert(configEntrustSourceSampleType); + // 返回 + return BeanUtils.toBean(configEntrustSourceSampleType, ConfigEntrustSourceSampleTypeRespVO.class); + } + + @Override + public void updateConfigEntrustSourceSampleType(ConfigEntrustSourceSampleTypeSaveReqVO updateReqVO) { + // 校验存在 + validateConfigEntrustSourceSampleTypeExists(updateReqVO.getId()); + // 更新 + ConfigEntrustSourceSampleTypeDO updateObj = BeanUtils.toBean(updateReqVO, ConfigEntrustSourceSampleTypeDO.class); + configEntrustSourceSampleTypeMapper.updateById(updateObj); + } + + @Override + public void deleteConfigEntrustSourceSampleType(Long id) { + // 校验存在 + validateConfigEntrustSourceSampleTypeExists(id); + // 删除 + configEntrustSourceSampleTypeMapper.deleteById(id); + } + + @Override + public void deleteConfigEntrustSourceSampleTypeListByIds(List ids) { + // 校验存在 + validateConfigEntrustSourceSampleTypeExists(ids); + // 删除 + configEntrustSourceSampleTypeMapper.deleteByIds(ids); + } + + private void validateConfigEntrustSourceSampleTypeExists(List ids) { + List list = configEntrustSourceSampleTypeMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(CONFIG_ENTRUST_SOURCE_SAMPLE_TYPE_NOT_EXISTS); + } + } + + private void validateConfigEntrustSourceSampleTypeExists(Long id) { + if (configEntrustSourceSampleTypeMapper.selectById(id) == null) { + throw exception(CONFIG_ENTRUST_SOURCE_SAMPLE_TYPE_NOT_EXISTS); + } + } + + @Override + public ConfigEntrustSourceSampleTypeDO getConfigEntrustSourceSampleType(Long id) { + return configEntrustSourceSampleTypeMapper.selectById(id); + } + + @Override + public PageResult getConfigEntrustSourceSampleTypePage(ConfigEntrustSourceSampleTypePageReqVO pageReqVO) { + return configEntrustSourceSampleTypeMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigSubSampleMethodService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigSubSampleMethodService.java index 720559d..a24b2b5 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigSubSampleMethodService.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigSubSampleMethodService.java @@ -12,14 +12,14 @@ import com.zt.plat.framework.common.pojo.PageResult; import com.zt.plat.framework.common.pojo.PageParam; /** - * 子样与检测方法配置 Service 接口 + * 子样与分样检测方法配置表 Service 接口 * * @author 后台管理 */ public interface ConfigSubSampleMethodService { /** - * 创建子样与检测方法配置 + * 创建子样与分样检测方法配置表 * * @param createReqVO 创建信息 * @return 编号 @@ -27,39 +27,39 @@ public interface ConfigSubSampleMethodService { ConfigSubSampleMethodRespVO createConfigSubSampleMethod(@Valid ConfigSubSampleMethodSaveReqVO createReqVO); /** - * 更新子样与检测方法配置 + * 更新子样与分样检测方法配置表 * * @param updateReqVO 更新信息 */ void updateConfigSubSampleMethod(@Valid ConfigSubSampleMethodSaveReqVO updateReqVO); /** - * 删除子样与检测方法配置 + * 删除子样与分样检测方法配置表 * * @param id 编号 */ void deleteConfigSubSampleMethod(Long id); /** - * 批量删除子样与检测方法配置 + * 批量删除子样与分样检测方法配置表 * * @param ids 编号 */ void deleteConfigSubSampleMethodListByIds(List ids); /** - * 获得子样与检测方法配置 + * 获得子样与分样检测方法配置表 * * @param id 编号 - * @return 子样与检测方法配置 + * @return 子样与分样检测方法配置表 */ ConfigSubSampleMethodDO getConfigSubSampleMethod(Long id); /** - * 获得子样与检测方法配置分页 + * 获得子样与分样检测方法配置表分页 * * @param pageReqVO 分页查询 - * @return 子样与检测方法配置分页 + * @return 子样与分样检测方法配置表分页 */ PageResult getConfigSubSampleMethodPage(ConfigSubSampleMethodPageReqVO pageReqVO); diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigSubSampleMethodServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigSubSampleMethodServiceImpl.java index 38c6d3c..20f8462 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigSubSampleMethodServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigSubSampleMethodServiceImpl.java @@ -21,7 +21,7 @@ import static com.zt.plat.framework.common.util.collection.CollectionUtils.conve import static com.zt.plat.module.qms.enums.ErrorCodeConstants.CONFIG_SUB_SAMPLE_METHOD_NOT_EXISTS; /** - * 子样与检测方法配置 Service 实现类 + * 子样与分样检测方法配置表 Service 实现类 * * @author 后台管理 */ diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigWarehouseLocationService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigWarehouseLocationService.java index ceeda49..2fce44c 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigWarehouseLocationService.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigWarehouseLocationService.java @@ -17,6 +17,10 @@ import com.zt.plat.framework.common.pojo.PageResult; public interface ConfigWarehouseLocationService { ConfigWarehouseLocationDO getLocationByCode(String code, String warehouseType); + ConfigWarehouseLocationDO getByCode(String code); + + void checkCodeUnique(ConfigWarehouseLocationSaveReqVO reqVo); + void checkCodeUniqueWithoutId(ConfigWarehouseLocationSaveReqVO reqVo); //保存数据 ConfigWarehouseLocationRespVO save(@Valid ConfigWarehouseLocationSaveReqVO reqVO); diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigWarehouseLocationServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigWarehouseLocationServiceImpl.java index 235beca..3431627 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigWarehouseLocationServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigWarehouseLocationServiceImpl.java @@ -10,6 +10,7 @@ import com.zt.plat.module.qms.enums.QmsPermissionConstant; import com.zt.plat.module.qms.enums.QmsWarehouseLocationConstant; import org.springframework.stereotype.Service; import jakarta.annotation.Resource; +import org.springframework.util.ObjectUtils; import org.springframework.validation.annotation.Validated; import java.util.*; @@ -42,11 +43,15 @@ public class ConfigWarehouseLocationServiceImpl implements ConfigWarehouseLocati Long id = reqVo.getId(); //处理权限 List primissionList = reqVo.getPermissionList(); + ConfigWarehouseLocationDO entity = BeanUtils.toBean(reqVo, ConfigWarehouseLocationDO.class); if(id == null){ - ConfigWarehouseLocationDO entity = BeanUtils.toBean(reqVo, ConfigWarehouseLocationDO.class); + checkCodeUniqueWithoutId(reqVo); configWarehouseLocationMapper.insert(entity); id = entity.getId(); reqVo.setId( id); + }else { + checkCodeUnique(reqVo); + configWarehouseLocationMapper.updateById(entity); } for(ConfigPermissionSaveReqVO permission : primissionList){ permission.setSourceId( id); @@ -60,7 +65,8 @@ public class ConfigWarehouseLocationServiceImpl implements ConfigWarehouseLocati public ConfigWarehouseLocationDO getLocationByCode(String code, String warehouseType) { LambdaQueryWrapper query = new LambdaQueryWrapper<>(); query.eq(ConfigWarehouseLocationDO::getCode, code); - query.eq(ConfigWarehouseLocationDO::getWarehouseType, warehouseType); + if(!ObjectUtils.isEmpty(warehouseType)) + query.eq(ConfigWarehouseLocationDO::getWarehouseType, warehouseType); query.eq(ConfigWarehouseLocationDO::getDataType, QmsWarehouseLocationConstant.DATA_TYPE_LOCATION); // query.last("limit 1"); List list = configWarehouseLocationMapper.selectList(query); @@ -72,23 +78,63 @@ public class ConfigWarehouseLocationServiceImpl implements ConfigWarehouseLocati } @Override - public ConfigWarehouseLocationRespVO createConfigWarehouseLocation(ConfigWarehouseLocationSaveReqVO createReqVO) { + public ConfigWarehouseLocationDO getByCode(String code) { + LambdaQueryWrapper query = new LambdaQueryWrapper<>(); + query.eq(ConfigWarehouseLocationDO::getCode, code); + List list = configWarehouseLocationMapper.selectList(query); + if(list.size() > 1) + throw exception(CONFIG_WAREHOUSE_LOCATION_CODE_DUPLICATE); + if(list.isEmpty()) + return null; + return list.get(0); + } + + @Override + public ConfigWarehouseLocationRespVO createConfigWarehouseLocation(ConfigWarehouseLocationSaveReqVO reqVo) { // 插入 - ConfigWarehouseLocationDO configWarehouseLocation = BeanUtils.toBean(createReqVO, ConfigWarehouseLocationDO.class); + checkCodeUniqueWithoutId(reqVo); + ConfigWarehouseLocationDO configWarehouseLocation = BeanUtils.toBean(reqVo, ConfigWarehouseLocationDO.class); configWarehouseLocationMapper.insert(configWarehouseLocation); // 返回 return BeanUtils.toBean(configWarehouseLocation, ConfigWarehouseLocationRespVO.class); } @Override - public void updateConfigWarehouseLocation(ConfigWarehouseLocationSaveReqVO updateReqVO) { + public void updateConfigWarehouseLocation(ConfigWarehouseLocationSaveReqVO reqVo) { // 校验存在 - validateConfigWarehouseLocationExists(updateReqVO.getId()); + validateConfigWarehouseLocationExists(reqVo.getId()); + checkCodeUnique(reqVo); // 更新 - ConfigWarehouseLocationDO updateObj = BeanUtils.toBean(updateReqVO, ConfigWarehouseLocationDO.class); + ConfigWarehouseLocationDO updateObj = BeanUtils.toBean(reqVo, ConfigWarehouseLocationDO.class); configWarehouseLocationMapper.updateById(updateObj); } + @Override + public void checkCodeUnique(ConfigWarehouseLocationSaveReqVO reqVo) { + String code = reqVo.getCode(); + if(ObjectUtils.isEmpty(code)){ + return; + } + ConfigWarehouseLocationDO dbData1 = getConfigWarehouseLocation(reqVo.getId()); + if(!code.equals(dbData1.getCode())){ + ConfigWarehouseLocationDO dbData = getByCode(code); + if(dbData != null){ + throw exception(CONFIG_WAREHOUSE_LOCATION_CODE_DUPLICATE); + } + } + } + + @Override + public void checkCodeUniqueWithoutId(ConfigWarehouseLocationSaveReqVO reqVo) { + String code = reqVo.getCode(); + if(ObjectUtils.isEmpty(code)) + return; + ConfigWarehouseLocationDO dbData = getByCode(code); + if(dbData != null){ + throw exception(CONFIG_WAREHOUSE_LOCATION_CODE_DUPLICATE); + } + } + @Override public void deleteConfigWarehouseLocation(Long id) { // 校验存在 diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/async/AsyncConfig.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/async/AsyncConfig.java new file mode 100644 index 0000000..7ac61d7 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/async/AsyncConfig.java @@ -0,0 +1,23 @@ +package com.zt.plat.module.qms.business.reportdoc.async; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.scheduling.annotation.EnableAsync; +import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; + +import java.util.concurrent.Executor; + +@Configuration +@EnableAsync +public class AsyncConfig { + @Bean("asyncTaskExecutor") + public Executor asyncTaskExecutor() { + ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); + executor.setCorePoolSize(5); + executor.setMaxPoolSize(10); + executor.setQueueCapacity(100); + executor.setThreadNamePrefix("Async-"); + executor.initialize(); + return executor; + } +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/admin/ReportDocumentDataController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/admin/ReportDocumentDataController.java index ccc2c5f..ca69695 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/admin/ReportDocumentDataController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/admin/ReportDocumentDataController.java @@ -21,6 +21,7 @@ import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentTy import com.zt.plat.module.qms.business.reportdoc.service.ReportDocumentDataService; import com.zt.plat.module.qms.business.reportdoc.service.ReportDocumentMainService; import com.zt.plat.module.qms.business.reportdoc.service.ReportDocumentTypeService; +import com.zt.plat.module.qms.common.data.service.DataTemplateService; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.tags.Tag; @@ -62,16 +63,12 @@ public class ReportDocumentDataController extends AbstractFileUploadController i @GetMapping("/queryReportDetail") @Operation(summary = "查询报告明细数据") @Parameter(name = "mainId", description = "报告id", required = true, example = "1024") - public CommonResult> queryReportDetail(@RequestParam("mainId") Long mainId) { + public CommonResult queryReportDetail(@RequestParam("mainId") Long mainId, @RequestParam(name = "pageFlag", required = false) String pageFlag) { ReportDocumentMainDO mainDO = reportDocumentMainService.getReportDocumentMain(mainId); Long typeId = mainDO.getReportDocumentTypeId(); ReportDocumentTypeDO typeDO = reportDocumentTypeService.getReportDocumentType(typeId); - Long confId = typeDO.getConfigReportTypeId(); -// Map param = new HashMap<>(); -// List list = reportDocumentDataService.listByMainDataId(mainId).getData(); -// return success(BeanUtils.toBean(list, ReportDocumentDataRespVO.class)); - CommonResult> result = reportDocumentDataService.assembleDynamicData(mainDO, typeDO); + CommonResult result = reportDocumentDataService.assembleDynamicData(mainDO, typeDO, pageFlag); return result; } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/admin/ReportDocumentFileController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/admin/ReportDocumentFileController.java new file mode 100644 index 0000000..2af9795 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/admin/ReportDocumentFileController.java @@ -0,0 +1,148 @@ +package com.zt.plat.module.qms.business.reportdoc.controller.admin; + +import com.zt.plat.module.infra.api.file.FileApi; +import com.zt.plat.module.infra.api.file.dto.FileRespDTO; +import com.zt.plat.module.qms.business.reportdoc.controller.vo.ReportDocumentFilePageReqVO; +import com.zt.plat.module.qms.business.reportdoc.controller.vo.ReportDocumentFileRespVO; +import com.zt.plat.module.qms.business.reportdoc.controller.vo.ReportDocumentFileSaveReqVO; +import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentMainDO; +import com.zt.plat.module.qms.business.reportdoc.service.ReportDocumentMainService; +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.business.reportdoc.dal.dataobject.ReportDocumentFileDO; +import com.zt.plat.module.qms.business.reportdoc.service.ReportDocumentFileService; + +@Tag(name = "管理后台 - 检测报告附件") +@RestController +@RequestMapping("/qms/report-document-file") +@Validated +@FileUploadController(source = "qms.reportdocumentfile") +public class ReportDocumentFileController extends AbstractFileUploadController implements BusinessControllerMarker{ + + static { + FileUploadController annotation = ReportDocumentFileController.class.getAnnotation(FileUploadController.class); + if (annotation != null) { + setFileUploadInfo(annotation); + } + } + + @Resource private ReportDocumentFileService reportDocumentFileService; + @Resource private ReportDocumentMainService reportDocumentMainService; + @Resource private FileApi fileApi; + + @PostMapping("/create") + @Operation(summary = "创建检测报告附件") + @PreAuthorize("@ss.hasPermission('qms:report-document-file:create')") + public CommonResult createReportDocumentFile(@Valid @RequestBody ReportDocumentFileSaveReqVO createReqVO) { + return success(reportDocumentFileService.createReportDocumentFile(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新检测报告附件") + @PreAuthorize("@ss.hasPermission('qms:report-document-file:update')") + public CommonResult updateReportDocumentFile(@Valid @RequestBody ReportDocumentFileSaveReqVO updateReqVO) { + reportDocumentFileService.updateReportDocumentFile(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除检测报告附件") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('qms:report-document-file:delete')") + public CommonResult deleteReportDocumentFile(@RequestParam("id") Long id) { + reportDocumentFileService.deleteReportDocumentFile(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除检测报告附件") + @PreAuthorize("@ss.hasPermission('qms:report-document-file:delete')") + public CommonResult deleteReportDocumentFileList(@RequestBody BatchDeleteReqVO req) { + reportDocumentFileService.deleteReportDocumentFileListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得检测报告附件") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('qms:report-document-file:query')") + public CommonResult getReportDocumentFile(@RequestParam("id") Long id) { + ReportDocumentFileDO reportDocumentFile = reportDocumentFileService.getReportDocumentFile(id); + return success(BeanUtils.toBean(reportDocumentFile, ReportDocumentFileRespVO.class)); + } + + @GetMapping("/getPdfFileObjByMainId") + @Operation(summary = "获得检测报告附件") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + public CommonResult getPdfFileObjByMainId(ReportDocumentFileSaveReqVO vo) { + Long mainId = vo.getMainId(); + Integer version = vo.getVersion(); + if(version == null){ + ReportDocumentMainDO mainDO = reportDocumentMainService.getReportDocumentMain(mainId); + version = mainDO.getDocumentVersion(); + } + ReportDocumentFileDO entity = reportDocumentFileService.getByMainIdAndVersion(mainId, version); + if(entity == null){ + return CommonResult.success(null); + } + Long fileId = entity.getFileId(); + CommonResult fileRet = fileApi.getFile(fileId); + FileRespDTO file = fileRet.getData(); + if(fileRet.isSuccess() && file != null) + entity.setUrl(file.getUrl()); + if(entity == null){ + return CommonResult.success(null); + } + return success(BeanUtils.toBean(entity, ReportDocumentFileRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得检测报告附件分页") + @PreAuthorize("@ss.hasPermission('qms:report-document-file:query')") + public CommonResult> getReportDocumentFilePage(@Valid ReportDocumentFilePageReqVO pageReqVO) { + PageResult pageResult = reportDocumentFileService.getReportDocumentFilePage(pageReqVO); + return success(BeanUtils.toBean(pageResult, ReportDocumentFileRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出检测报告附件 Excel") + @PreAuthorize("@ss.hasPermission('qms:report-document-file:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportReportDocumentFileExcel(@Valid ReportDocumentFilePageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = reportDocumentFileService.getReportDocumentFilePage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "检测报告附件.xls", "数据", ReportDocumentFileRespVO.class, + BeanUtils.toBean(list, ReportDocumentFileRespVO.class)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/admin/ReportDocumentMainController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/admin/ReportDocumentMainController.java index 9d491b7..3567f68 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/admin/ReportDocumentMainController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/admin/ReportDocumentMainController.java @@ -14,26 +14,28 @@ import com.zt.plat.framework.excel.core.util.ExcelUtils; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigUserSignatureDO; import com.zt.plat.module.qms.business.config.service.ConfigUserSignatureService; import com.zt.plat.module.qms.business.reportdoc.controller.vo.*; -import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentDataDO; import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentMainDO; import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentTypeDO; import com.zt.plat.module.qms.business.reportdoc.service.ReportDocumentDataService; import com.zt.plat.module.qms.business.reportdoc.service.ReportDocumentMainService; import com.zt.plat.module.qms.business.reportdoc.service.ReportDocumentTypeService; +import com.zt.plat.module.qms.common.data.dal.dataobject.DataTemplateDO; +import com.zt.plat.module.qms.common.data.service.DataTemplateService; import com.zt.plat.module.qms.enums.QmsCommonConstant; +import com.zt.plat.module.system.api.iwork.dto.IWorkOperationRespDTO; +import com.zt.plat.module.system.api.iwork.dto.IWorkWorkflowCreateReqDTO; 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 lombok.extern.slf4j.Slf4j; import org.springframework.util.ObjectUtils; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import java.io.IOException; -import java.text.SimpleDateFormat; import java.util.*; import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.EXPORT; @@ -45,6 +47,7 @@ import static com.zt.plat.module.qms.enums.ErrorCodeConstants.REPORT_DOCUMENT_TY @RestController @RequestMapping("/qms/report-document-main") @Validated +@Slf4j @FileUploadController(source = "qms.reportdocumentmain") public class ReportDocumentMainController extends AbstractFileUploadController implements BusinessControllerMarker{ @@ -58,7 +61,20 @@ public class ReportDocumentMainController extends AbstractFileUploadController i @Resource private ReportDocumentMainService reportDocumentMainService; @Resource private ReportDocumentDataService reportDocumentDataService; @Resource private ReportDocumentTypeService reportDocumentTypeService; - @Resource private ConfigUserSignatureService configUserSignatureService; + + @Resource private DataTemplateService dataTemplateService; + + @RequestMapping("/testAsyncTask") + public CommonResult testAsyncTask(@RequestParam Long id) { + ReportDocumentMainSaveReqVO reqVO = new ReportDocumentMainSaveReqVO(); + reqVO.setId(id); + reqVO.setFlowStatus("async"); + reportDocumentMainService.updateReportDocumentMain(reqVO); + + reportDocumentMainService.testAsyncTask(id); + return CommonResult.success("success"); + } + @PostMapping("/create") @Operation(summary = "创建检测报告") @@ -78,6 +94,11 @@ public class ReportDocumentMainController extends AbstractFileUploadController i if(typeDO == null){ return error(REPORT_DOCUMENT_TYPE_NOT_EXISTS, "报告类型不存在,请刷新后重试"); } + String dataTemplateKey = typeDO.getReportKey(); + DataTemplateDO dataTemplateDO = dataTemplateService.getLatestDataByKey(dataTemplateKey); + if(dataTemplateDO == null) + return error(REPORT_DOCUMENT_TYPE_NOT_EXISTS, "表单编辑器模板不存在,请联系管理员处理"); + vo.setDataTemplateId(dataTemplateDO.getId()); vo.setDocumentTitle(typeDO.getName()); vo.setFlowKey(typeDO.getFlowKey()); vo.setDocumentType(typeDO.getDocumentType()); @@ -160,87 +181,12 @@ public class ReportDocumentMainController extends AbstractFileUploadController i //处理签名 String docSig = vo.getDocumentSignature(); - if(!ObjectUtils.isEmpty(docSig)){ - JSONObject docSigJson = JSONObject.parseObject(docSig); - List sigIds = new ArrayList<>(); - docSigJson.forEach((key, value) -> { - JSONObject obj = docSigJson.getJSONObject( key); - String signatureId = obj.getString("signatureId"); - if(!ObjectUtils.isEmpty(signatureId)) - sigIds.add(Long.parseLong(signatureId)); - }); - - if(!sigIds.isEmpty()){ - List sigList = configUserSignatureService.getByIdList(sigIds); - docSigJson.forEach((key, value) -> { - JSONObject obj = docSigJson.getJSONObject( key); - String signatureId = obj.getString("signatureId"); - if(!ObjectUtils.isEmpty(signatureId)){ - ConfigUserSignatureDO sig = sigList.stream().filter(item -> item.getId().equals(Long.parseLong(signatureId))).findFirst().orElse(null); - if(sig != null){ - String base64 = sig.getSignatureContent(); - obj.put("signatureIdBase64", base64); - } - } - }); - } - vo.setDocumentSignature(docSigJson.toJSONString()); - } - - //处理抬头数据 - - if("true".equals(editFlag)){ - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - String formData = vo.getFormData(); - JSONObject formDataJson = new JSONObject(); - if(!ObjectUtils.isEmpty(formData)) - formDataJson = JSONObject.parseObject(formData); - List dataList = reportDocumentDataService.listByMainDataId(id).getData(); - ReportDocumentTypeDO typeDO = reportDocumentTypeService.getReportDocumentType(reportDocumentMain.getReportDocumentTypeId()); - String customConfig = typeDO.getCustomConfig(); - String defaultConclusion = ""; - if(!ObjectUtils.isEmpty(customConfig)){ - JSONObject config = JSONObject.parseObject(customConfig); - defaultConclusion = config.getString("defaultConclusion"); - } - formDataJson.put("conclusion", defaultConclusion); - if(!dataList.isEmpty()) - formDataJson.put("sampleName", dataList.get(0).getSampleName()); - //处理检测标准 - String standard = assembleStandard(dataList); - formDataJson.put("standard", standard); - formDataJson.put("reportTime", sdf.format(new Date())); - vo.setFormData(formDataJson.toJSONString()); -// ReportDocumentMainSaveReqVO updateVO = new ReportDocumentMainSaveReqVO(); -// updateVO.setId(reportDocumentMain.getId()); -// updateVO.setFormData(formDataJson.toJSONString()); -// reportDocumentMainService.updateReportDocumentMain(updateVO); - } + String docSigJsonStr = reportDocumentDataService.assembleSignature(docSig); + if(!ObjectUtils.isEmpty(docSigJsonStr)) + vo.setDocumentSignature(docSigJsonStr); return success(vo); } - private String assembleStandard(List dataList){ - - Set standardSet = new HashSet<>(); - for(ReportDocumentDataDO data : dataList){ - String content = data.getDocumentContent(); - if(ObjectUtils.isEmpty( content)) - continue; - JSONObject json = JSONObject.parseObject(content); - for(String key : json.keySet()){ - JSONObject obj = json.getJSONObject(key); - String methodName = obj.getString("methodName"); - if(ObjectUtils.isEmpty(methodName)) - continue; - standardSet.add(methodName); - } - } - if(standardSet.isEmpty()) - return ""; - return String.join(",", standardSet); - } - - @GetMapping("/page") @Operation(summary = "获得检测报告业务分页") //@PreAuthorize("@ss.hasPermission('qms:report-document-main:query')") @@ -261,4 +207,23 @@ public class ReportDocumentMainController extends AbstractFileUploadController i ExcelUtils.write(response, "检测报告业务.xls", "数据", ReportDocumentMainRespVO.class, list); } + @GetMapping("/testCreateIworkWorkflow") + @Operation(summary = "测试发起iwork流程") + //@PreAuthorize("@ss.hasPermission('qms:report-document-main:query')") + public CommonResult createIworkWorkflow() { + IWorkWorkflowCreateReqDTO req = new IWorkWorkflowCreateReqDTO(); + req.setJbr("1001"); + req.setYybm("2001"); + req.setFb("3001"); + req.setSqsj("2025-01-01"); + req.setYyqx("对外邮寄"); +// req.setYyfkUrl("https://files.example.com/evidence.pdf"); + req.setYysy("与客户合同用印"); + req.setXyywjUrl("http://172.16.46.63:30002/yudao/20251204/%E6%B5%8B%E8%AF%95pdf_1764818842846.pdf?response-cache-control=no-cache%2C%20no-store%2C%20must-revalidate&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20251209T093343Z&X-Amz-SignedHeaders=host&X-Amz-Credential=EKplIEnbNgfYBAZbEJNa%2F20251209%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Expires=86400&X-Amz-Signature=37d63249667ea855f9a51bdf47bbb044d5860c302721f52fff2ba644985bae4c"); + req.setYysx("检测报告用印"); + req.setYwxtdjbh("JY-20251209-0001"); +// CommonResult ret = reportDocumentMainService.createIWorkflow(req); + return null; + } + } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentDataPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentDataPageReqVO.java index 5c66fdf..ba747d5 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentDataPageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentDataPageReqVO.java @@ -43,4 +43,16 @@ public class ReportDocumentDataPageReqVO extends PageParam { @Schema(description = "样品大类名称") private String baseSampleName; + + @Schema(description = "样品类型key") + private String sampleTypeKey; + + @Schema(description = "委托样品名称") + private String entrustSampleName; + + @Schema(description = "委托样品编号") + private String entrustSampleCode; + + @Schema(description = "排序") + private Integer sort; } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentDataRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentDataRespVO.java index ebc981a..c4a6d9e 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentDataRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentDataRespVO.java @@ -56,6 +56,22 @@ public class ReportDocumentDataRespVO { @ExcelProperty("样品大类名称") private String baseSampleName; + @Schema(description = "样品类型key") + @ExcelProperty("样品类型key") + private String sampleTypeKey; + + @Schema(description = "委托样品名称") + @ExcelProperty("委托样品名称") + private String entrustSampleName; + + @Schema(description = "委托样品编号") + @ExcelProperty("委托样品编号") + private String entrustSampleCode; + + @Schema(description = "排序") + @ExcelProperty("排序") + private Integer sort; + //==================扩展字段=========== @Schema(description = "样品创建时间") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentDataSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentDataSaveReqVO.java index 72b9a26..bc5f178 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentDataSaveReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentDataSaveReqVO.java @@ -40,4 +40,16 @@ public class ReportDocumentDataSaveReqVO { @Schema(description = "样品大类名称") private String baseSampleName; + @Schema(description = "样品类型key") + private String sampleTypeKey; + + @Schema(description = "委托样品名称") + private String entrustSampleName; + + @Schema(description = "委托样品编号") + private String entrustSampleCode; + + @Schema(description = "排序") + private Integer sort; + } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentFilePageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentFilePageReqVO.java new file mode 100644 index 0000000..f799790 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentFilePageReqVO.java @@ -0,0 +1,46 @@ +package com.zt.plat.module.qms.business.reportdoc.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 ReportDocumentFilePageReqVO extends PageParam { + + @Schema(description = "报告id", example = "20899") + private Long mainId; + + @Schema(description = "文件表ID", example = "25498") + private Long fileId; + + @Schema(description = "文件名称", example = "李四") + private String name; + + @Schema(description = "路径") + private String path; + + @Schema(description = "文件地址", example = "https://www.iocoder.cn") + private String url; + + @Schema(description = "文件类型", example = "1") + private String type; + + @Schema(description = "版本") + private Integer version; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentFileRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentFileRespVO.java new file mode 100644 index 0000000..b953ba9 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentFileRespVO.java @@ -0,0 +1,58 @@ +package com.zt.plat.module.qms.business.reportdoc.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 ReportDocumentFileRespVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "29698") + @ExcelProperty("ID") + private Long id; + + @Schema(description = "报告id", example = "20899") + @ExcelProperty("报告id") + private Long mainId; + + @Schema(description = "文件表ID", example = "25498") + @ExcelProperty("文件表ID") + private Long fileId; + + @Schema(description = "文件名称", example = "李四") + @ExcelProperty("文件名称") + private String name; + + @Schema(description = "路径") + @ExcelProperty("路径") + private String path; + + @Schema(description = "文件地址", example = "https://www.iocoder.cn") + @ExcelProperty("文件地址") + private String url; + + @Schema(description = "文件类型", example = "1") + @ExcelProperty("文件类型") + private String type; + + @Schema(description = "版本") + @ExcelProperty("版本") + private Integer version; + + @Schema(description = "所属部门") + @ExcelProperty("所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间") + @ExcelProperty("创建时间") + private LocalDateTime createTime; + + @Schema(description = "备注") + @ExcelProperty("备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentFileSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentFileSaveReqVO.java new file mode 100644 index 0000000..f212d3c --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentFileSaveReqVO.java @@ -0,0 +1,40 @@ +package com.zt.plat.module.qms.business.reportdoc.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; + +@Schema(description = "管理后台 - 检测报告附件新增/修改 Request VO") +@Data +public class ReportDocumentFileSaveReqVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "29698") + private Long id; + + @Schema(description = "报告id", example = "20899") + private Long mainId; + + @Schema(description = "文件表ID", example = "25498") + private Long fileId; + + @Schema(description = "文件名称", example = "李四") + private String name; + + @Schema(description = "路径") + private String path; + + @Schema(description = "文件地址", example = "https://www.iocoder.cn") + private String url; + + @Schema(description = "文件类型", example = "1") + private String type; + + @Schema(description = "版本") + private Integer version; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentMainPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentMainPageReqVO.java index f738eac..e5e2f37 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentMainPageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentMainPageReqVO.java @@ -88,4 +88,10 @@ public class ReportDocumentMainPageReqVO extends PageParam { @Schema(description = "表单设计器模板id") private Long dataTemplateId; + + @Schema(description = "附件版本") + private Integer documentVersion; + + @Schema(description = "异步执行状态") + private String executionStatus; } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentMainRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentMainRespVO.java index 6e681df..6191db5 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentMainRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentMainRespVO.java @@ -115,6 +115,13 @@ public class ReportDocumentMainRespVO { @ExcelProperty("表单设计器模板id") private Long dataTemplateId; + @Schema(description = "附件版本") + @ExcelProperty("附件版本") + private Integer documentVersion; + + @Schema(description = "异步执行状态") + @ExcelProperty("异步执行状态") + private String executionStatus; //==============================扩展字段======================================= @Schema(description = "记录数") @ExcelProperty("记录数") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentMainSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentMainSaveReqVO.java index e4011eb..fbeb9df 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentMainSaveReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentMainSaveReqVO.java @@ -90,6 +90,11 @@ public class ReportDocumentMainSaveReqVO { @Schema(description = "表单设计器模板id") private Long dataTemplateId; + @Schema(description = "附件版本") + private Integer documentVersion; + + @Schema(description = "异步执行状态") + private String executionStatus; //====================附加属性============================== @Schema(description = "委托id,支持多值") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/dal/dataobject/ReportDocumentDataDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/dal/dataobject/ReportDocumentDataDO.java index c590366..25c46a4 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/dal/dataobject/ReportDocumentDataDO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/dal/dataobject/ReportDocumentDataDO.java @@ -75,8 +75,26 @@ public class ReportDocumentDataDO extends BusinessBaseDO { @TableField("BSE_SMP_NAME") private String baseSampleName; + //样品类型key + @TableField("SMP_TP_KY") + private String sampleTypeKey; + /** + * 委托样品名称 + */ + @TableField("ENTT_SMP_NAME") + private String entrustSampleName; + /** + * 委托样品编号 + */ + @TableField("ENTT_SMP_CD") + private String entrustSampleCode; + /** + * 排序 + */ + @TableField("SRT") + private Integer sort; //==================扩展字段=========== //样品创建时间 diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/dal/dataobject/ReportDocumentFileDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/dal/dataobject/ReportDocumentFileDO.java new file mode 100644 index 0000000..20b34c2 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/dal/dataobject/ReportDocumentFileDO.java @@ -0,0 +1,77 @@ +package com.zt.plat.module.qms.business.reportdoc.dal.dataobject; + +import lombok.*; +import com.baomidou.mybatisplus.annotation.*; +import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; +/** +* 检测报告附件 DO +* +* @author 后台管理 +*/ +@TableName("t_rpt_doc_file") +@KeySequence("t_rpt_doc_file_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class ReportDocumentFileDO extends BusinessBaseDO { + + + + /** + * ID + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 报告id + */ + @TableField("MAIN_ID") + private Long mainId; + /** + * 文件表ID + */ + @TableField("FILE_ID") + private Long fileId; + /** + * 文件名称 + */ + @TableField("NAME") + private String name; + /** + * 路径 + */ + @TableField("PATH") + private String path; + /** + * 文件地址 + */ + @TableField("URL") + private String url; + /** + * 文件类型 + */ + @TableField("TP") + private String type; + /** + * 版本 + */ + @TableField("VER") + private Integer version; + /** + * 所属部门 + */ + @TableField("SYS_DEPT_CD") + private String systemDepartmentCode; + /** + * 备注 + */ + @TableField("RMK") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/dal/dataobject/ReportDocumentMainDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/dal/dataobject/ReportDocumentMainDO.java index 7657dfc..d8da536 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/dal/dataobject/ReportDocumentMainDO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/dal/dataobject/ReportDocumentMainDO.java @@ -141,4 +141,12 @@ public class ReportDocumentMainDO extends BusinessBaseDO { //表单设计器模板id @TableField("DAT_TMPL_ID") private Long dataTemplateId; + + //表单设计器模板id + @TableField("DOC_VER") + private Integer documentVersion; + + //异步执行状态 + @TableField("EXC_STS") + private String executionStatus; } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/dal/mapper/ReportDocumentFileMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/dal/mapper/ReportDocumentFileMapper.java new file mode 100644 index 0000000..dc9d536 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/dal/mapper/ReportDocumentFileMapper.java @@ -0,0 +1,50 @@ +package com.zt.plat.module.qms.business.reportdoc.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.business.reportdoc.controller.vo.ReportDocumentFilePageReqVO; +import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentFileDO; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 检测报告附件 Mapper + * + * @author 后台管理 + */ +@Mapper +public interface ReportDocumentFileMapper extends BaseMapperX { + + default PageResult selectPage(ReportDocumentFilePageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(ReportDocumentFileDO::getMainId, reqVO.getMainId()) + .eqIfPresent(ReportDocumentFileDO::getFileId, reqVO.getFileId()) + .likeIfPresent(ReportDocumentFileDO::getName, reqVO.getName()) + .eqIfPresent(ReportDocumentFileDO::getPath, reqVO.getPath()) + .eqIfPresent(ReportDocumentFileDO::getUrl, reqVO.getUrl()) + .eqIfPresent(ReportDocumentFileDO::getType, reqVO.getType()) + .eqIfPresent(ReportDocumentFileDO::getVersion, reqVO.getVersion()) + .eqIfPresent(ReportDocumentFileDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .betweenIfPresent(ReportDocumentFileDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(ReportDocumentFileDO::getRemark, reqVO.getRemark()) + .orderByDesc(ReportDocumentFileDO::getId)); + } + + default List selectList(ReportDocumentFileDO reqVO) { + LambdaQueryWrapperX query = new LambdaQueryWrapperX<>(); + query.eqIfPresent(ReportDocumentFileDO::getMainId, reqVO.getMainId()) + .eqIfPresent(ReportDocumentFileDO::getFileId, reqVO.getFileId()) + .likeIfPresent(ReportDocumentFileDO::getName, reqVO.getName()) + .eqIfPresent(ReportDocumentFileDO::getPath, reqVO.getPath()) + .eqIfPresent(ReportDocumentFileDO::getUrl, reqVO.getUrl()) + .eqIfPresent(ReportDocumentFileDO::getType, reqVO.getType()) + .eqIfPresent(ReportDocumentFileDO::getVersion, reqVO.getVersion()) + .eqIfPresent(ReportDocumentFileDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .eqIfPresent(ReportDocumentFileDO::getRemark, reqVO.getRemark()) + .orderByDesc(ReportDocumentFileDO::getId); + return selectList(query); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentAssistService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentAssistService.java new file mode 100644 index 0000000..4e3db6d --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentAssistService.java @@ -0,0 +1,164 @@ +package com.zt.plat.module.qms.business.reportdoc.service; + +import cn.hutool.http.HttpResponse; +import cn.hutool.http.HttpUtil; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.zt.plat.framework.common.exception.ServiceException; +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.framework.common.util.object.BeanUtils; +import com.zt.plat.framework.security.core.LoginUser; +import com.zt.plat.framework.security.core.util.SecurityFrameworkUtils; +import com.zt.plat.module.infra.api.file.FileApi; +import com.zt.plat.module.infra.api.file.dto.FileCreateReqDTO; +import com.zt.plat.module.infra.api.file.dto.FileRespDTO; +import com.zt.plat.module.qms.business.reportdoc.controller.vo.ReportDocumentFileSaveReqVO; +import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentFileDO; +import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentMainDO; +import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentTypeDO; +import com.zt.plat.module.qms.common.data.dal.dataobject.DataTemplateDO; +import com.zt.plat.module.qms.common.data.service.DataTemplateService; +import com.zt.plat.module.qms.core.code.SequenceUtil; +import com.zt.plat.module.system.api.iwork.IWorkIntegrationApi; +import com.zt.plat.module.system.api.iwork.dto.IWorkOperationRespDTO; +import com.zt.plat.module.system.api.iwork.dto.IWorkWorkflowCreateReqDTO; +import jakarta.annotation.Resource; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.compress.utils.IOUtils; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.text.SimpleDateFormat; +import java.time.LocalDateTime; +import java.util.Date; +import java.util.Optional; + +import static com.zt.plat.module.qms.enums.ErrorCodeConstants.REPORT_DOCUMENT_FILE_NOT_EXISTS; + +/* +* 处理报告附件和发起iwork流程 +* */ +@Service("reportDocumentAssistService") +@Slf4j +public class ReportDocumentAssistService { + @Resource + private IWorkIntegrationApi iWorkIntegrationApi; + + @Value("${zzjc.html2pdf.addr:}") + private String html2pdfAddr; + + @Resource private ReportDocumentDataService reportDocumentDataService; + @Resource private ReportDocumentTypeService reportDocumentTypeService; + @Resource private ReportDocumentFileService reportDocumentFileService; + @Resource private DataTemplateService dataTemplateService; + @Resource private SequenceUtil sequenceUtil; + @Resource private FileApi fileApi; + + private String sequenceKey = "QMS_REPORT_IWORK_CODE"; + + // todo 判断是否更新pdf + public boolean checkUpdateDocFile(JSONObject variables){ + return true; + } + + /* + * 更新报告附件,并发起iwork流程*/ + public void updateDocFileAndCreateIWorkflow(JSONObject variables, ReportDocumentMainDO entity) throws IOException { +// boolean updateDocFileFlag = true; + boolean createIworkWorkflowFlag = false; + JSONArray bpmFieldExtensions = variables.getJSONArray("bpmFieldExtensions"); + if(bpmFieldExtensions == null) + bpmFieldExtensions = new JSONArray(); + for(int i = 0; i < bpmFieldExtensions.size(); i++){ + JSONObject extension = bpmFieldExtensions.getJSONObject(i); + String fieldName = extension.getString("fieldName"); + String stringValue = extension.getString("stringValue"); + if(fieldName.equalsIgnoreCase("createiworkflow") && stringValue.equals("1")){ + createIworkWorkflowFlag = true; + break; + } + } + ReportDocumentFileDO docFile = generatePdf(entity); + if(createIworkWorkflowFlag){ + CommonResult iworkkResult = createIWorkflow(entity, docFile); + log.error("iworkkResult: " + JSONObject.toJSONString(iworkkResult)); + } + } + + /* + * 发起iwork用印*/ + public CommonResult createIWorkflow(ReportDocumentMainDO entity, ReportDocumentFileDO docFile) { + LoginUser loginUser = SecurityFrameworkUtils.getLoginUser(); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + IWorkWorkflowCreateReqDTO dto = new IWorkWorkflowCreateReqDTO(); + dto.setOperatorUserId(String.valueOf(loginUser.getId())); + dto.setJbr(String.valueOf(loginUser.getId())); + dto.setYybm(String.valueOf(loginUser.getVisitDeptId())); + dto.setFb(String.valueOf(loginUser.getVisitCompanyId())); + dto.setSqsj(sdf.format(new Date())); + dto.setYyqx("检测报告用印"); + dto.setYysy("检测报告用印"); + dto.setYysx("检测报告用印"); + dto.setXyywjUrl(docFile.getUrl()); + dto.setYwxtdjbh(sequenceUtil.genCode(sequenceKey)); + return iWorkIntegrationApi.createWorkflow(dto); + } + + /* + * 生成新版pdf文件 + * 在reportDocumentFile创建新pdf文件 + * */ + public ReportDocumentFileDO generatePdf(ReportDocumentMainDO mainDO) throws IOException { + String pageFlag = "1"; //分页处理 + Long typeId = mainDO.getReportDocumentTypeId(); + ReportDocumentTypeDO typeDO = reportDocumentTypeService.getReportDocumentType(typeId); + DataTemplateDO templateDO = dataTemplateService.getDataTemplate(mainDO.getDataTemplateId()); + CommonResult result = reportDocumentDataService.assembleDynamicData(mainDO, typeDO, pageFlag); + JSONArray data = result.getData(); + String templateContent = templateDO.getFormContent(); + JSONObject bodyJson = new JSONObject(); + bodyJson.put("Template", templateContent); + bodyJson.put("Data", data.toJSONString()); + String bodyStr = bodyJson.toJSONString(); + log.info("html2pdf body: " + bodyStr); + log.info("html2pdf--start at {}", LocalDateTime.now()); + HttpResponse response = HttpUtil.createPost(html2pdfAddr) + .body(bodyStr) + .timeout(15000) + .execute(); + log.info("html2pdf--end at {}", LocalDateTime.now()); + InputStream inputStream = response.bodyStream(); // 关键:返回原始 InputStream + + //尝试从响应头中提取文件名 + String documentCode = mainDO.getDocumentCode(); + if(documentCode == null) documentCode = ""; + String filename = documentCode + "检测报告.pdf"; + byte[] fileBytes = IOUtils.toByteArray(inputStream); + + //上传到文件服务 + FileCreateReqDTO fileCreateReqDTO = new FileCreateReqDTO(); + fileCreateReqDTO.setName(filename); + fileCreateReqDTO.setDirectory(null); + fileCreateReqDTO.setType(null); + fileCreateReqDTO.setContent(fileBytes); + CommonResult fileResult = fileApi.createFileWithReturn(fileCreateReqDTO); + if (fileResult == null || !fileResult.isSuccess() || fileResult.getData() == null) { + throw new ServiceException(REPORT_DOCUMENT_FILE_NOT_EXISTS.getCode(), "通过文件服务创建附件失败: " + Optional.ofNullable(fileResult).map(CommonResult::getMsg).orElse("未知错误")); + } + FileRespDTO fileRespDTO = fileResult.getData(); + //写入ReportDocumentFile + ReportDocumentFileSaveReqVO fileSaveReqVO = new ReportDocumentFileSaveReqVO(); + fileSaveReqVO.setMainId(mainDO.getId()); + fileSaveReqVO.setFileId(fileRespDTO.getId()); + fileSaveReqVO.setName(filename); + fileSaveReqVO.setPath(fileRespDTO.getDirectory()); + fileSaveReqVO.setUrl(fileRespDTO.getUrl()); + fileSaveReqVO.setVersion(mainDO.getDocumentVersion()); + reportDocumentFileService.createReportDocumentFile(fileSaveReqVO); + return BeanUtils.toBean(fileRespDTO, ReportDocumentFileDO.class); + } +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentDataService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentDataService.java index db821ef..b92169f 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentDataService.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentDataService.java @@ -19,13 +19,13 @@ import java.util.List; */ public interface ReportDocumentDataService { - CommonResult> assembleDynamicData(ReportDocumentMainDO mainData, ReportDocumentTypeDO reportConfig); + CommonResult assembleDynamicData(ReportDocumentMainDO mainData, ReportDocumentTypeDO reportConfig, String pageFlag); CommonResult> listByMainDataId(Long mainDataId); CommonResult countMainDataId(Long mainDataId); CommonResult removeByMainIdAndDetailIds(Long mainDataId, List detailIds); - + String assembleSignature(String docSig); /** * 创建检测报告明细 diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentDataServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentDataServiceImpl.java index 0eb4bcc..7b72e2c 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentDataServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentDataServiceImpl.java @@ -9,13 +9,16 @@ import com.zt.plat.framework.common.pojo.PageResult; import com.zt.plat.framework.common.util.object.BeanUtils; import com.zt.plat.module.qms.business.config.controller.vo.ConfigReportFieldPageReqVO; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigReportFieldDO; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigUserSignatureDO; import com.zt.plat.module.qms.business.config.service.ConfigReportFieldService; +import com.zt.plat.module.qms.business.config.service.ConfigUserSignatureService; import com.zt.plat.module.qms.business.reportdoc.controller.vo.*; import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentMainDO; import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentTypeDO; import com.zt.plat.module.qms.business.reportdoc.dal.mapper.ReportDocumentDataMapper; import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentDataDO; import jakarta.annotation.Resource; +import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; import org.springframework.util.ObjectUtils; import org.springframework.validation.annotation.Validated; @@ -27,6 +30,7 @@ import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.e import static com.zt.plat.module.qms.enums.ErrorCodeConstants.REPORT_DOCUMENT_DATA_NOT_EXISTS; import static com.zt.plat.module.qms.enums.ErrorCodeConstants.REPORT_DOCUMENT_TYPE_NOT_EXISTS; import static com.zt.plat.module.qms.enums.QmsCommonConstant.FIELD_DYNAMIC; +import static com.zt.plat.module.qms.enums.QmsCommonConstant.FIELD_CALCULATED; import static com.zt.plat.module.qms.enums.QmsCommonConstant.FIELD_FIXED; /** @@ -36,17 +40,22 @@ import static com.zt.plat.module.qms.enums.QmsCommonConstant.FIELD_FIXED; */ @Service @Validated +@Slf4j public class ReportDocumentDataServiceImpl implements ReportDocumentDataService { @Resource private ReportDocumentDataMapper reportDocumentDataMapper; @Resource private ConfigReportFieldService configReportFieldService; + @Resource private ConfigUserSignatureService configUserSignatureService; private final String colPrefix = "col"; private final String sampleCodeKey = "SMP_CD"; private final String sampleNameKey = "SMP_NAME"; - private final String name_code_merge = "merge"; - private final String name_code_name = "name"; - private final String name_code_code = "code"; - private final String name_code_split = "split"; + private final String sampleNameAndCodeKey = "SMP_NAME_CD"; + private final String entrustSampleNameKey = "ENTT_SMP_NAME"; + private final String entrustSampleCodeKey = "ENTT_SMP_CD"; + private final String entrustSampleNameCodeKey = "ENTT_SMP_NAME_CD"; + private final String rowTypeKey = "rowType"; //行类型 + private final String rowTypeTitle = "title"; //行类型-标题 + private final String rowTypeLimit = "limit"; //行类型-检出限 private final String rangeKey = "minLimitValue"; private final String emptyText = "以下为空白"; @@ -55,10 +64,16 @@ public class ReportDocumentDataServiceImpl implements ReportDocumentDataService * 组装动态报表数据 * */ @Override - public CommonResult> assembleDynamicData(ReportDocumentMainDO mainData, ReportDocumentTypeDO typeDO) { + public CommonResult assembleDynamicData(ReportDocumentMainDO mainData, ReportDocumentTypeDO typeDO, String pageFlag) { if(typeDO == null || typeDO.getConfigReportTypeId() == null) return CommonResult.error(REPORT_DOCUMENT_TYPE_NOT_EXISTS.getCode(), "报告配置为空,或未配置报表类型,请联系管理员处理!"); String customConfig = typeDO.getCustomConfig(); + JSONObject configJson = JSONObject.parseObject(customConfig); + String verticalFlag = configJson.getString("verticalFlag"); + String maxRowCountStr = configJson.getString("maxRowCount"); //最大行数 + Integer maxRowCount = 3; + if(!ObjectUtils.isEmpty(maxRowCountStr)) + maxRowCount = Integer.parseInt(maxRowCountStr); //查询报表字段配置 ConfigReportFieldPageReqVO fieldParam = new ConfigReportFieldPageReqVO(); fieldParam.setConfigReportTypeId(typeDO.getConfigReportTypeId()); @@ -67,38 +82,262 @@ public class ReportDocumentDataServiceImpl implements ReportDocumentDataService if(fieldListAll.isEmpty()) return CommonResult.error(REPORT_DOCUMENT_TYPE_NOT_EXISTS.getCode(), "未配置报表字段,请联系管理员处理!"); List dataList = listByMainDataId(mainData.getId()).getData(); - //处理字段,提取有数据的字段 - List fieldList = new ArrayList<>(); - List hasFields = new ArrayList<>(); - for(ConfigReportFieldDO fieldDO : fieldListAll){ - String field = fieldDO.getField(); - String fieldName = fieldDO.getFieldName(); - String fieldType = fieldDO.getFieldType(); - //先处理固定列 - if(FIELD_FIXED.equals(fieldType)){ - if(!hasFields.contains( field)){ - fieldList.add(fieldDO); - hasFields.add(field); + + //拆分dataList,按样品分类key拆分 + List> dataListGroup = new ArrayList<>(); + String[] sampleTypeKeys = new String[]{"inspectionAnalysisSample", "comprehensiveInspectionSample"}; //商检分析样、商检综合样 + for(String sampleTypeKey : sampleTypeKeys){ + List dataListByKey = new ArrayList<>(); + for(ReportDocumentDataDO dataDO: dataList){ + if(sampleTypeKey.equals(dataDO.getSampleTypeKey())){ + dataListByKey.add(dataDO); } - continue; } - for(ReportDocumentDataDO dataDO : dataList){ - String documentContent = dataDO.getDocumentContent(); - JSONObject dataJson = JSONObject.parseObject(documentContent); - if(dataJson == null) + if(!dataListByKey.isEmpty()) + dataListGroup.add(dataListByKey); + } + if(dataListGroup.isEmpty() && !dataList.isEmpty()) + dataListGroup.add(dataList); + JSONArray rowList = new JSONArray(); + for(int i = 0; i < dataListGroup.size(); i++){ + List dataListByKey = dataListGroup.get(i); + //处理字段,提取有数据的字段 + List fieldList = new ArrayList<>(); + List hasFields = new ArrayList<>(); + for(ConfigReportFieldDO fieldDO : fieldListAll){ + String field = fieldDO.getField(); + String fieldName = fieldDO.getFieldName(); + String fieldType = fieldDO.getFieldType(); + //先处理固定列 + if(FIELD_FIXED.equals(fieldType)){ + if(!hasFields.contains( field)){ + fieldList.add(fieldDO); + hasFields.add(field); + } continue; - if(dataJson.containsKey(field)){ + } + for(ReportDocumentDataDO dataDO : dataListByKey){ + String documentContent = dataDO.getDocumentContent(); + JSONObject dataJson = JSONObject.parseObject(documentContent); + if(dataJson == null) + continue; + if(!dataJson.containsKey(field)) + continue; if(!hasFields.contains( fieldName)){ + JSONObject valueJson = dataJson.getJSONObject(field); + String usage = valueJson.getString("usage"); + if(!"report".equals( usage) && ! "ingredient_report".equals(usage)) + continue; fieldList.add(fieldDO); hasFields.add(fieldName); } } } + assembleStep1(rowList, fieldList, dataListByKey, customConfig, i); //处理后的组数对象 + } + if(!"1".equals(verticalFlag)){ + //处理空数据,填充/ + rowList = assembleEmpty(configJson, rowList); + //处理数据分页 + if("1".equals(pageFlag)){ + JSONArray pageRowList = assemblePageRowList(rowList, configJson, mainData); + return CommonResult.success(pageRowList); + } + } + //以下为空白 + if(rowList.size() < maxRowCount && !rowList.isEmpty()){ + JSONObject t = new JSONObject(); + t.put(colPrefix + "01", emptyText); + putEmptyData(t, 2,10); + rowList.add(t.clone()); + } + while(rowList.size() < maxRowCount){ + JSONObject t = new JSONObject(); + putEmptyData(t, 1,10); + rowList.add(t.clone()); + } + /* + * 修改数据结构 + [ + { + "headerData": {}, + "tableList": [{},] + }, + ] + * */ + JSONArray result = new JSONArray(); + JSONObject resultData = new JSONObject(); + JSONObject headerData = new JSONObject(); + JSONObject firstRow = rowList.getJSONObject(0); + if(rowTypeTitle.equals(firstRow.getString(rowTypeKey))){ + headerData = firstRow.clone(); + rowList.remove(0); + } + resultData.put("headerData", headerData); + resultData.put("tableList", rowList); + String formData = mainData.getFormData(); + String signatureData = mainData.getDocumentSignature(); + if(!ObjectUtils.isEmpty(formData)) + resultData.put("formData", JSONObject.parseObject(formData)); + if(!ObjectUtils.isEmpty(signatureData)) + resultData.put("signatureData", JSONObject.parseObject(signatureData)); + result.add(resultData); + return CommonResult.success(result); + } + + void putEmptyData(JSONObject t, int start, int length){ + for(int i = start; i < start + length; i++){ + t.put(colPrefix + parseNumToString(i, 2), " "); + } + } + + /* + * 处理分页 + * + * */ + private JSONArray assemblePageRowList(JSONArray rowList, JSONObject configJson, ReportDocumentMainDO mainData){ + JSONArray pageRowList = new JSONArray(); + Integer maxRowCount = 20; + String maxRowCountStr = configJson.getString("maxRowCount"); //最大行数 + if(!ObjectUtils.isEmpty(maxRowCountStr)) maxRowCount = Integer.parseInt(maxRowCountStr); + int rowLength = rowList.size(); + if(rowLength <= maxRowCount){ + pageRowList.add(rowList); + return assemblePageResult(mainData, pageRowList, maxRowCount); + } + JSONArray remainingRows = new JSONArray(); + remainingRows.addAll(rowList); + while(remainingRows.size() > 0){ + JSONArray pageRow = new JSONArray(); + for(int i = 0; i < maxRowCount ; i++){ + if(remainingRows.isEmpty()) + break; + pageRow.add(remainingRows.getJSONObject(0)); + remainingRows.remove(0); + } + /* + 在每页开头插入“标题行” + 如果最后一行是标题,直接移到下一页;如果不是,往上寻找最近的“标题行” + */ + JSONObject lastTitleRow = pageRow.getJSONObject(pageRow.size() - 1); + String rowType = lastTitleRow.getString(rowTypeKey); + if(rowTypeTitle.equals(rowType)){ + //如果最后一行是“标题行”,移除 + pageRow.remove(pageRow.size() - 1); + }else { + for(int i = pageRow.size() - 1; i >= 0; i--){ + JSONObject t = pageRow.getJSONObject(i); + rowType = t.getString(rowTypeKey); + if(rowTypeTitle.equals(rowType)){ + lastTitleRow = t; + break; + } + } + } + if(!remainingRows.isEmpty()){ + JSONObject firstRemainingRow = remainingRows.getJSONObject(0); + String val01 = firstRemainingRow.getString(colPrefix + "01"); + if(!ObjectUtils.isEmpty(val01) && !" ".equals(val01) && !rowTypeTitle.equals(firstRemainingRow.getString(rowTypeKey))){ + //如果下一页的第一行不为空,且不是标题行,则插入标题 + remainingRows.add(0, lastTitleRow); + }else{ + //如果下一页的第一行为空,则删除空行 + while (ObjectUtils.isEmpty(val01) || " ".equals(val01)){ + remainingRows.remove(0); + if(remainingRows.isEmpty()) + break; + firstRemainingRow = remainingRows.getJSONObject(0); + val01 = firstRemainingRow.getString(colPrefix + "01"); + } + } + } + pageRowList.add(pageRow); } - //组装数据 - List step1Arr = assembleStep1(fieldList, dataList, customConfig); //处理后的组数对象 - return CommonResult.success(step1Arr); + //在最后一页插入“以下为空” + JSONArray pageRow = pageRowList.getJSONArray(pageRowList.size() - 1); + if(pageRow.size() < maxRowCount){ + JSONObject t = new JSONObject(); + t.put(colPrefix + "01", emptyText); + putEmptyData(t, 2,10); + pageRow.add(t.clone()); + } + + return assemblePageResult(mainData, pageRowList, maxRowCount); + } + /* + * 修改数据结构 + [{ + "headerData": {}, + "tableList": [{},] + },] + * */ + private JSONArray assemblePageResult(ReportDocumentMainDO mainData, JSONArray pageRowList, Integer maxRowCount){ + JSONArray result = new JSONArray(); + String formData = mainData.getFormData(); + String signatureData = mainData.getDocumentSignature(); + String signatureJsonStr = assembleSignature(signatureData); + JSONObject formDataJson = new JSONObject(); + boolean hasSignatureData = false; + if(!ObjectUtils.isEmpty(formData)) + formDataJson = JSONObject.parseObject(formData); + if(!ObjectUtils.isEmpty(signatureJsonStr)) + hasSignatureData = true; + //在最后一页填充空行 + JSONArray pageRow = pageRowList.getJSONArray(pageRowList.size() - 1); + while(pageRow.size() < maxRowCount){ + JSONObject t = new JSONObject(); + putEmptyData(t, 1,10); + pageRow.add(t.clone()); + } + for(int i=0;i assembleStep1(List fieldList, List dataList, String customConfig){ + private JSONArray assembleStep1(JSONArray rowList, List fieldList, List dataList, String customConfig, int groupIndex){ if(dataList.isEmpty()) - return new ArrayList<>(); + return new JSONArray(); JSONObject jsonObject = JSONObject.parseObject(customConfig); Integer dynamicColCount = 3; - Integer fixedColCount = 0; - Integer maxRowCount = 3; + Integer fixedColCount_left = 0; + String dynamicColCountStr = jsonObject.getString("dynamicColCount"); //动态列(检测项)数量 -// String fixedColCountStr = jsonObject.getString("fixedColCount"); //固定列(样品名称、样品编号等)数量 - JSONArray fixedCol = jsonObject.getJSONArray("fixedCol"); //固定列,举例:["sampleName", "sampleCode"] - JSONArray fixedColShow = jsonObject.getJSONArray("fixedColShow"); //固定列,举例:["产品名称", "编 号"] - String maxRowCountStr = jsonObject.getString("maxRowCount"); //最大行数 -// String nameCodeType = jsonObject.getString("nameCodeType"); //名称、编号处理方式:merge-合并, name-只显示名称, code-只显示编号, split-2列分开显示 + JSONArray fixedCol = jsonObject.getJSONArray("fixedCol"); //固定列,举例:["SMP_NAME", "SMP_CD"] + if(fixedCol == null) fixedCol = new JSONArray(); + JSONArray fixedColRight = jsonObject.getJSONArray("fixedColRight"); //右侧固定列 + if(fixedColRight == null) fixedColRight = new JSONArray(); String hasRemark = jsonObject.getString("hasRemark"); //是否有备注 String hasRange = jsonObject.getString("hasRange"); //是否有检出限 String verticalFlag = jsonObject.getString("verticalFlag"); //vertical-纵表, 否则为横表 String fixedFields = jsonObject.getString("fixedFields"); //固定检测项。如果固定检测项,则以检测项作为数据Key if("1".equals(verticalFlag)){ //纵表 - return assembleVerticalData(fieldList, dataList, customConfig); + return assembleVerticalData(rowList, fieldList, dataList, customConfig); } if(!ObjectUtils.isEmpty(fixedFields)){ //固定列 - return assembleFixedFieldsData(fieldList, dataList, customConfig); + return assembleFixedFieldsData(rowList, fieldList, dataList, customConfig); } if(!ObjectUtils.isEmpty(dynamicColCountStr)) dynamicColCount = Integer.parseInt(dynamicColCountStr); - if(fixedCol != null) fixedColCount = fixedCol.size(); - - if(!ObjectUtils.isEmpty(maxRowCountStr)) maxRowCount = Integer.parseInt(maxRowCountStr); - Integer eleCount = 0; //元素数量,即元素列总数 - - for(ConfigReportFieldDO fieldDO : fieldList){ - String fieldType = fieldDO.getFieldType(); - if(FIELD_DYNAMIC.equals(fieldType)) - eleCount ++; - } - Integer rowCountOneSample = eleCount / dynamicColCount + (eleCount % dynamicColCount == 0 ? 0 : 1); //每个样品要占的行数 - Integer colCountOneSample = fixedColCount + dynamicColCount; //每个样品要占的列数 - Integer dataLength = dataList.size(); - Integer emptyRowCount = dataLength < maxRowCount ? 1 : 0; //空行数 -// Integer allRowCount = 1 + dataLength + emptyRowCount + 1; //标题 + 样品数 + 空行 - - if("1".equals(hasRange)) - emptyRowCount ++; - -// if(rowCountOneSample > 1){ -// allRowCount = (1 + dataLength + emptyRowCount + 9) * rowCountOneSample + emptyRowCount; //(标题 + 样品数 + 空行) * 但样品行数 + 末尾行 -// } - List rowList = new ArrayList<>(); - for(int i = 0; i < maxRowCount; i++){ - JSONObject row = new JSONObject(); - row.put("col01", " "); - rowList.add( row); - } - - + fixedColCount_left = fixedCol.size(); + Integer colCountOneSample = fixedColCount_left + dynamicColCount; //每个样品要占的列数 //=============处理表头============ JSONObject t = new JSONObject(); JSONObject r = new JSONObject(); //检出限 - int rowAssist = 1; - int colIndex = fixedColCount + 1; - boolean lastObjFlag = true; //取第一行数据,用来处理检出限 - JSONObject firstData = new JSONObject(); //取第一行数据,用于处理检出限 - if(dataLength > 0) - firstData = JSONObject.parseObject(dataList.get(0).getDocumentContent()); + JSONObject firstData = JSONObject.parseObject(dataList.get(0).getDocumentContent()); //取第一行数据,用于处理检出限 if("1".equals(hasRemark)){ //在最后一列增加备注 t.put(colPrefix + parseNumToString(colCountOneSample + 1, 2), "备注"); } - for(ConfigReportFieldDO fieldDO : fieldList){ + //取fieldList的动态字段,并分组 + List> dynamicFieldListGroup = new ArrayList<>(); + int fieldIndex = 1; + List list = new ArrayList<>(); + for(int i = 0; i < fieldList.size(); i++){ + ConfigReportFieldDO fieldDO = fieldList.get(i); String fieldType = fieldDO.getFieldType(); - String field = fieldDO.getField(); - if(FIELD_FIXED.equals(fieldType)){ //这里只处理动态列。固定列在 addTitleToRowList 处理 + if(FIELD_FIXED.equals(fieldType)) continue; + list.add(fieldDO); + if(fieldIndex % dynamicColCount == 0){ + dynamicFieldListGroup.add(list); + list = new ArrayList<>(); } - String fieldName = fieldDO.getFieldName(); - String colKey = parseNumToString(colIndex, 2); - t.put(colPrefix + colKey, fieldName); - //查询当前字段的检出限 - JSONObject fieldObj = firstData.getJSONObject( field); - String rangeVal = ""; - if(fieldObj != null){ - rangeVal = fieldObj.getString(rangeKey); - } - r.put(colPrefix + colKey, rangeVal); - r.put(colPrefix + "01", "方法检出限"); - lastObjFlag = true; - if(colIndex % colCountOneSample == 0){ - addTitleToRowList(fixedCol, rowAssist, t, dataLength, emptyRowCount, rowList, fieldList); - if("1".equals(hasRange)) - addRangeToRowList(rowAssist, r, dataLength, emptyRowCount, rowList); - t = new JSONObject(); - r = new JSONObject(); - - if("1".equals(hasRemark)){ - //在最后一列增加备注 - t.put(colPrefix + parseNumToString(colCountOneSample + 1, 2), "备注"); + fieldIndex ++; + } + if(!list.isEmpty()) + dynamicFieldListGroup.add(list); + int colIndex = 1; + for(int i = 0; i < dynamicFieldListGroup.size(); i++){ + List dynamicFieldList = dynamicFieldListGroup.get(i); + t = new JSONObject(); + t.put(rowTypeKey, rowTypeTitle); + r = new JSONObject(); + r.put(rowTypeKey, rowTypeLimit); + colIndex = fixedColCount_left + 1; //第二组以后,从固定列数开始 + for(ConfigReportFieldDO fieldDO : dynamicFieldList) { + String field = fieldDO.getField(); + String fieldName = fieldDO.getFieldName(); + String colKey = parseNumToString(colIndex, 2); + t.put(colPrefix + colKey, fieldName); + //查询当前字段的检出限 + JSONObject fieldObj = null; + if(firstData != null && !ObjectUtils.isEmpty(field)){ + fieldObj = firstData.getJSONObject(field); } - rowAssist++; - colIndex = fixedColCount + 1; //第二组以后,从固定列数开始 - lastObjFlag = false; - continue; + String rangeVal = ""; + if (fieldObj != null) { + rangeVal = fieldObj.getString(rangeKey); + } + r.put(colPrefix + colKey, rangeVal); + r.put(colPrefix + "01", "方法检出限"); + colIndex ++; + } + //处理备注列 + if(i == 0 && groupIndex == 0 && "1".equals(hasRemark)){ + //在最后一列增加备注 + t.put(colPrefix + parseNumToString(colCountOneSample + 1, 2), "备注"); + } + if(i > 0 || groupIndex > 0){ //插入空行 + JSONObject emptyRow = new JSONObject(); + putEmptyData(emptyRow, 1,10); + rowList.add(emptyRow); + } + addTitleToRowList(fixedCol, fixedColRight, dynamicColCount, t, rowList, fieldList); + //插入样品数据 + addDataToRowList(fixedCol, fixedColRight, dynamicFieldList, dataList, rowList, fixedColCount_left, dynamicColCount, hasRemark); + //检出限 + if("1".equals(hasRange)){ + rowList.add(r); } - colIndex++; - } - if(lastObjFlag){ - addTitleToRowList(fixedCol, rowAssist, t, dataLength, emptyRowCount, rowList, fieldList); - if("1".equals(hasRange)) - addRangeToRowList(rowAssist, r, dataLength, emptyRowCount, rowList); } + return rowList; + } - //=============处理数据============ - int dataIndex = 1; + /** + * @param + * + * */ + private void addTitleToRowList(JSONArray fixedCol, JSONArray fixedColRight, Integer dynamicColCount, JSONObject t, JSONArray rowList, List fieldList){ + //处理固定列 + int index = 1; + String colKey = ""; + //固定列-左 + for(int i=0;i fieldList, List dataList, JSONArray rowList, int fixedColCount, int dynamicColCount, String hasRemark){ + int colIndex = 0; + JSONObject t = new JSONObject(); for(ReportDocumentDataDO dataDO : dataList){ String documentContent = dataDO.getDocumentContent(); String externalContent = dataDO.getExternalContent(); JSONObject s = JSONObject.parseObject(documentContent); - JSONObject e = new JSONObject(); - if(!ObjectUtils.isEmpty(externalContent)){ - e = JSONObject.parseObject(externalContent); + //判断样品是否有值,若无值则跳过 + boolean hasValue = false; + for(ConfigReportFieldDO fieldDO : fieldList) { + String fieldType = fieldDO.getFieldType(); + if (FIELD_FIXED.equals(fieldType)) //这里只处理动态列。固定列在 addDataToRowList 处理 + continue; + String field = fieldDO.getField(); + JSONObject fieldObj = new JSONObject(); + if(s != null) + fieldObj = s.getJSONObject(field); + String fieldValue = ""; + if (fieldObj != null) + fieldValue = fieldObj.getString("fieldValue"); + if(!ObjectUtils.isEmpty(fieldValue)) + hasValue = true; } + if(!hasValue) + continue; + JSONObject e = new JSONObject(); + if(!ObjectUtils.isEmpty(externalContent)) + e = JSONObject.parseObject(externalContent); String remark = e.getString("remark"); + if(ObjectUtils.isEmpty(remark)) + remark = " "; colIndex = fixedColCount + 1; - rowAssist = 1; t = new JSONObject(); + int colCountOneSample = fixedColCount + dynamicColCount; if("1".equals(hasRemark)){ t.put(colPrefix + parseNumToString(colCountOneSample + 1, 2), remark); } @@ -249,157 +558,63 @@ public class ReportDocumentDataServiceImpl implements ReportDocumentDataService } if(!ObjectUtils.isEmpty(mathSymbol) && !"=".equals(mathSymbol)) fieldValue = mathSymbol + fieldValue; + if(ObjectUtils.isEmpty(fieldValue)) + fieldValue = "/"; t.put(colPrefix + colKey, fieldValue); - lastObjFlag = true; - if(colIndex % colCountOneSample == 0){ - addFixedDataToRowList(fixedCol, dataDO, rowAssist, t, dataLength, emptyRowCount, dataIndex, rowList, fieldList); - t = new JSONObject(); - if("1".equals(hasRemark)){ - t.put(colPrefix + parseNumToString(colCountOneSample + 1, 2), remark); - } - rowAssist++; - colIndex = fixedColCount + 1; //第二组以后,从固定列数开始 - lastObjFlag = false; - continue; - } colIndex++; } - if(lastObjFlag){ - addFixedDataToRowList(fixedCol, dataDO, rowAssist, t, dataLength, emptyRowCount, dataIndex, rowList, fieldList); - } - dataIndex ++; - } - - //==============以下为空白================= - //实际使用行数小于总行数,显示“”以下为空白“ - if(dataLength < maxRowCount){ - String colKey = colPrefix + "01"; - t = new JSONObject(); - t.put(colKey, emptyText); - int rowIndex = (dataLength + emptyRowCount) * (rowAssist) + 2; - if(rowAssist == 1) - rowIndex = dataLength + emptyRowCount; - if(rowCountOneSample == 1) - rowIndex = dataLength + 2; - rowList.set(rowIndex, t.clone()); - } - //前面的计数是从1开始,移除第一个元素 - if(!rowList.isEmpty()) - rowList.remove(0); - return rowList; - } - - /** - * @param - * - * */ - private void addTitleToRowList(JSONArray fixedCol, Integer rowAssist, JSONObject t, Integer dataLength, Integer emptyRowCount, List rowList, List fieldList){ - int rowIndex = (1 + dataLength + emptyRowCount) * (rowAssist - 1) + 1; //(标题 + 数据行 + 空行) - //处理固定列 - int index = 1; - String colKey = ""; - for(int i=0;i rowList){ - int rowIndex = (dataLength + emptyRowCount + 1 ) * (rowAssist); - rowList.set(rowIndex, r.clone()); - } - - - /** - * 添加固定列的数据 - * */ - private void addFixedDataToRowList(JSONArray fixedCol, ReportDocumentDataDO dataDO, Integer rowAssist, JSONObject t, Integer dataLength, Integer emptyRowCount, Integer dataIndex, List rowList, List fieldList){ - int rowIndex = (1 + dataLength + emptyRowCount) * (rowAssist - 1) + dataIndex + 1; //(标题 + 数据行 + 空行) - t.put("id", dataDO.getId()); - //处理固定列 - int index = 1; - //处理固定列 - String colKey = ""; - if(fixedCol != null && !fixedCol.isEmpty()){ + t.put("id", dataDO.getId()); + //处理固定列-左 + int index = 1; + String colKey = ""; for(int i=0;i assembleFixedFieldsData(List fieldList, List dataList, String customConfig){ + private JSONArray assembleFixedFieldsData(JSONArray rowList, List fieldList, List dataList, String customConfig){ JSONObject jsonObject = JSONObject.parseObject(customConfig); Integer maxRowCount = 3; @@ -421,15 +636,13 @@ public class ReportDocumentDataServiceImpl implements ReportDocumentDataService String fixedFields = jsonObject.getString("fixedFields"); //固定检测项。如果固定检测项,则以检测项作为数据Key JSONArray fixedFieldsArray = JSONArray.parseArray(fixedFields); if(!ObjectUtils.isEmpty(maxRowCountStr)) maxRowCount = Integer.parseInt(maxRowCountStr); - - List rowList = new ArrayList<>(); - for(int i = 0; i < maxRowCount; i++){ - JSONObject row = new JSONObject(); - row.put("sampleNameCode", " "); - row.put("sampleName", " "); - row.put("sampleCode", " "); - rowList.add( row); - } +// for(int i = 0; i < maxRowCount; i++){ +// JSONObject row = new JSONObject(); +// row.put("sampleNameCode", " "); +// row.put("sampleName", " "); +// row.put("sampleCode", " "); +// rowList.add( row); +// } for(ReportDocumentDataDO dataDO : dataList) { JSONObject t = new JSONObject(); String documentContent = dataDO.getDocumentContent(); @@ -476,6 +689,13 @@ public class ReportDocumentDataServiceImpl implements ReportDocumentDataService t.put("sampleCode", emptyText); rowList.add( t); } + while(rowList.size() < maxRowCount){ + JSONObject t = new JSONObject(); + t.put("sampleNameCode", " "); + t.put("sampleName", " "); + t.put("sampleCode", " "); + rowList.add( t); + } return rowList; } @@ -483,17 +703,15 @@ public class ReportDocumentDataServiceImpl implements ReportDocumentDataService * 组装纵表数据 * 第1列固定为:元素; 第2列:方法检出限(%);第三列开始为各个样品 * */ - private List assembleVerticalData(List fieldList, List dataList, String customConfig){ + private JSONArray assembleVerticalData(JSONArray rowList, List fieldList, List dataList, String customConfig){ JSONObject jsonObject = JSONObject.parseObject(customConfig); Integer dynamicColCount = 3; - Integer fixedColCount = 2; - Integer maxRowCount = 3; - String dynamicColCountStr = jsonObject.getString("dynamicColCount"); //动态列(检测项)数量 - String fixedColCountStr = jsonObject.getString("fixedColCount"); //固定列(样品名称、样品编号等)数量 - String maxRowCountStr = jsonObject.getString("maxRowCount"); //最大行数 - String nameCodeType = jsonObject.getString("nameCodeType"); //名称、编号处理方式:merge-合并, name-只显示名称, code-只显示编号, split-2列分开显示 + Integer fixedColCount = 1; + Integer maxRowCount = 20; String hasRemark = jsonObject.getString("hasRemark"); //是否有备注 String hasRange = jsonObject.getString("hasRange"); //是否有检出限 + if("1".equals(hasRange)) + fixedColCount ++; //取数据第一行,用于处理方法检出限 String content = ""; if(!ObjectUtils.isEmpty(dataList)) @@ -502,11 +720,14 @@ public class ReportDocumentDataServiceImpl implements ReportDocumentDataService if(!ObjectUtils.isEmpty(content)){ firstData = JSONObject.parseObject(content); } - List rowList = new ArrayList<>(); //处理第一行-样品编号 int colIndex = fixedColCount + 1; int rowIndex = 1; JSONObject t = new JSONObject(); + t.put(colPrefix + "01", "元素"); + if("1".equals(hasRange)){ + t.put(colPrefix + "02", "方法检出限"); + } for(ReportDocumentDataDO dataDO : dataList){ String colKey = parseNumToString(colIndex, 2); t.put(colPrefix + colKey, dataDO.getSampleCode()); @@ -565,7 +786,7 @@ public class ReportDocumentDataServiceImpl implements ReportDocumentDataService public CommonResult> listByMainDataId(Long mainDataId) { QueryWrapper queryWrapper = new QueryWrapper<>(); queryWrapper.eq("MAIN_ID", mainDataId); - queryWrapper.orderByAsc("ID"); + queryWrapper.orderByAsc("SRT"); List list = reportDocumentDataMapper.selectList(queryWrapper); return CommonResult.success(list); } @@ -578,6 +799,37 @@ public class ReportDocumentDataServiceImpl implements ReportDocumentDataService return CommonResult.success(reportDocumentDataMapper.selectCount(queryWrapper)); } + /* + * 处理报告签名*/ + @Override + public String assembleSignature(String docSig) { + if(ObjectUtils.isEmpty(docSig)) + return ""; + JSONObject docSigJson = JSONObject.parseObject(docSig); + List sigIds = new ArrayList<>(); + docSigJson.forEach((key, value) -> { + JSONObject obj = docSigJson.getJSONObject( key); + String signatureId = obj.getString("signatureId"); + if(!ObjectUtils.isEmpty(signatureId)) + sigIds.add(Long.parseLong(signatureId)); + }); + if(sigIds.isEmpty()) + return docSigJson.toJSONString(); + List sigList = configUserSignatureService.getByIdList(sigIds); + docSigJson.forEach((key, value) -> { + JSONObject obj = docSigJson.getJSONObject( key); + String signatureId = obj.getString("signatureId"); + if(!ObjectUtils.isEmpty(signatureId)){ + ConfigUserSignatureDO sig = sigList.stream().filter(item -> item.getId().equals(Long.parseLong(signatureId))).findFirst().orElse(null); + if(sig != null){ + String base64 = sig.getSignatureContent(); + obj.put("signatureIdBase64", base64); + } + } + }); + return docSigJson.toJSONString(); + } + @Override public CommonResult removeByMainIdAndDetailIds(Long mainDataId, List detailIds) { QueryWrapper queryWrapper = new QueryWrapper<>(); diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentFileService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentFileService.java new file mode 100644 index 0000000..7ba9506 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentFileService.java @@ -0,0 +1,67 @@ +package com.zt.plat.module.qms.business.reportdoc.service; + +import java.util.*; + +import com.zt.plat.module.qms.business.reportdoc.controller.vo.ReportDocumentFilePageReqVO; +import com.zt.plat.module.qms.business.reportdoc.controller.vo.ReportDocumentFileRespVO; +import com.zt.plat.module.qms.business.reportdoc.controller.vo.ReportDocumentFileSaveReqVO; +import jakarta.validation.*; +import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentFileDO; +import com.zt.plat.framework.common.pojo.PageResult; + +/** + * 检测报告附件 Service 接口 + * + * @author 后台管理 + */ +public interface ReportDocumentFileService { + + ReportDocumentFileDO getByMainIdAndVersion(Long mainId, Integer version); + + + /** + * 创建检测报告附件 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + ReportDocumentFileRespVO createReportDocumentFile(@Valid ReportDocumentFileSaveReqVO createReqVO); + + /** + * 更新检测报告附件 + * + * @param updateReqVO 更新信息 + */ + void updateReportDocumentFile(@Valid ReportDocumentFileSaveReqVO updateReqVO); + + /** + * 删除检测报告附件 + * + * @param id 编号 + */ + void deleteReportDocumentFile(Long id); + + /** + * 批量删除检测报告附件 + * + * @param ids 编号 + */ + void deleteReportDocumentFileListByIds(List ids); + + /** + * 获得检测报告附件 + * + * @param id 编号 + * @return 检测报告附件 + */ + ReportDocumentFileDO getReportDocumentFile(Long id); + + /** + * 获得检测报告附件分页 + * + * @param pageReqVO 分页查询 + * @return 检测报告附件分页 + */ + PageResult getReportDocumentFilePage(ReportDocumentFilePageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentFileServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentFileServiceImpl.java new file mode 100644 index 0000000..3023f56 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentFileServiceImpl.java @@ -0,0 +1,104 @@ +package com.zt.plat.module.qms.business.reportdoc.service; + +import cn.hutool.core.collection.CollUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.zt.plat.module.qms.business.reportdoc.controller.vo.ReportDocumentFilePageReqVO; +import com.zt.plat.module.qms.business.reportdoc.controller.vo.ReportDocumentFileRespVO; +import com.zt.plat.module.qms.business.reportdoc.controller.vo.ReportDocumentFileSaveReqVO; +import org.springframework.stereotype.Service; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; + +import java.util.*; + +import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentFileDO; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.util.object.BeanUtils; + +import com.zt.plat.module.qms.business.reportdoc.dal.mapper.ReportDocumentFileMapper; + +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 ReportDocumentFileServiceImpl implements ReportDocumentFileService { + + @Resource + private ReportDocumentFileMapper reportDocumentFileMapper; + + + @Override + public ReportDocumentFileDO getByMainIdAndVersion(Long mainId, Integer version) { + LambdaQueryWrapper query = new LambdaQueryWrapper<>(); + query.eq(ReportDocumentFileDO::getMainId, mainId); + query.eq(ReportDocumentFileDO::getVersion, version); + query.orderByDesc(ReportDocumentFileDO::getCreateTime); + query.last("LIMIT 1"); + return reportDocumentFileMapper.selectOne(query); + } + + @Override + public ReportDocumentFileRespVO createReportDocumentFile(ReportDocumentFileSaveReqVO createReqVO) { + // 插入 + ReportDocumentFileDO reportDocumentFile = BeanUtils.toBean(createReqVO, ReportDocumentFileDO.class); + reportDocumentFileMapper.insert(reportDocumentFile); + // 返回 + return BeanUtils.toBean(reportDocumentFile, ReportDocumentFileRespVO.class); + } + + @Override + public void updateReportDocumentFile(ReportDocumentFileSaveReqVO updateReqVO) { + // 校验存在 + validateReportDocumentFileExists(updateReqVO.getId()); + // 更新 + ReportDocumentFileDO updateObj = BeanUtils.toBean(updateReqVO, ReportDocumentFileDO.class); + reportDocumentFileMapper.updateById(updateObj); + } + + @Override + public void deleteReportDocumentFile(Long id) { + // 校验存在 + validateReportDocumentFileExists(id); + // 删除 + reportDocumentFileMapper.deleteById(id); + } + + @Override + public void deleteReportDocumentFileListByIds(List ids) { + // 校验存在 + validateReportDocumentFileExists(ids); + // 删除 + reportDocumentFileMapper.deleteByIds(ids); + } + + private void validateReportDocumentFileExists(List ids) { + List list = reportDocumentFileMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(REPORT_DOCUMENT_FILE_NOT_EXISTS); + } + } + + private void validateReportDocumentFileExists(Long id) { + if (reportDocumentFileMapper.selectById(id) == null) { + throw exception(REPORT_DOCUMENT_FILE_NOT_EXISTS); + } + } + + @Override + public ReportDocumentFileDO getReportDocumentFile(Long id) { + return reportDocumentFileMapper.selectById(id); + } + + @Override + public PageResult getReportDocumentFilePage(ReportDocumentFilePageReqVO pageReqVO) { + return reportDocumentFileMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentMainCorrelationService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentMainCorrelationService.java index 2a1c2be..cdb3dff 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentMainCorrelationService.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentMainCorrelationService.java @@ -22,6 +22,8 @@ public interface ReportDocumentMainCorrelationService { void deleteByMainId(Long mainId); + void insertBatch(List list); + /** * 创建检测报告关系表 * diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentMainCorrelationServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentMainCorrelationServiceImpl.java index d0188b5..dd0d20e 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentMainCorrelationServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentMainCorrelationServiceImpl.java @@ -59,6 +59,11 @@ public class ReportDocumentMainCorrelationServiceImpl implements ReportDocumentM reportDocumentMainCorrelationMapper.delete(query); } + @Override + public void insertBatch(List list) { + reportDocumentMainCorrelationMapper.insertBatch(list); + } + @Override public void updateReportDocumentMainCorrelation(ReportDocumentMainCorrelationSaveReqVO updateReqVO) { // 校验存在 diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentMainService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentMainService.java index baacc8b..dec4864 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentMainService.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentMainService.java @@ -3,8 +3,11 @@ package com.zt.plat.module.qms.business.reportdoc.service; import com.zt.plat.framework.common.pojo.CommonResult; import com.zt.plat.framework.common.pojo.PageResult; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayReportDataDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleEntrustRegistrationDO; import com.zt.plat.module.qms.business.reportdoc.controller.vo.*; import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentMainDO; +import com.zt.plat.module.system.api.iwork.dto.IWorkOperationRespDTO; +import com.zt.plat.module.system.api.iwork.dto.IWorkWorkflowCreateReqDTO; import jakarta.validation.Valid; import java.util.List; @@ -23,7 +26,7 @@ public interface ReportDocumentMainService { CommonResult execAddDataByEntrust(ReportDocumentMainSaveReqVO reqVO); //添加数据到报告-按表表数据 - CommonResult execAddByBusinessAssayReportData(List assayReportDataList, Long id); + CommonResult execAddByBusinessAssayReportData(List assayReportDataList, Long id, List entrustList); //移除数据 CommonResult execRemoveData(ReportDocumentMainSaveReqVO reqVO); @@ -82,4 +85,6 @@ public interface ReportDocumentMainService { //发起流程 CommonResult createProcessInstance(ReportDocumentMainSaveReqVO entity); + + void testAsyncTask(Long id); } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentMainServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentMainServiceImpl.java index 6bb7127..32d912d 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentMainServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentMainServiceImpl.java @@ -17,28 +17,31 @@ import com.zt.plat.module.qms.api.task.BMPCallbackInterface; import com.zt.plat.module.qms.api.task.dto.QmsBpmDTO; import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayReportDataPageReqVO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayReportDataDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleEntrustRegistrationDO; import com.zt.plat.module.qms.business.bus.service.BusinessAssayReportDataService; +import com.zt.plat.module.qms.business.bus.service.BusinessSampleEntrustRegistrationService; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigUserSignatureDO; import com.zt.plat.module.qms.business.config.service.ConfigUserSignatureService; import com.zt.plat.module.qms.business.reportdoc.controller.vo.*; import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentDataDO; import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentMainCorrelationDO; +import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentTypeDO; import com.zt.plat.module.qms.business.reportdoc.dal.mapper.ReportDocumentMainMapper; import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentMainDO; +import com.zt.plat.module.qms.common.data.service.DataKeyCheckService; import com.zt.plat.module.qms.enums.QmsBpmConstant; import com.zt.plat.module.qms.enums.QmsCommonConstant; import jakarta.annotation.Resource; import lombok.extern.slf4j.Slf4j; +import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.ObjectUtils; import org.springframework.validation.annotation.Validated; +import java.io.IOException; import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; -import java.util.Map; +import java.util.*; import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception; import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception0; @@ -62,7 +65,29 @@ public class ReportDocumentMainServiceImpl implements ReportDocumentMainService, @Resource private BpmProcessInstanceApi bpmProcessInstanceApi; @Resource private BpmTaskApi bpmTaskApi; @Resource private ReportDocumentMainCorrelationService reportDocumentMainCorrelationService; + @Resource private ReportDocumentTypeService reportDocumentTypeService; @Resource private ConfigUserSignatureService configUserSignatureService; + @Resource private BusinessSampleEntrustRegistrationService businessSampleEntrustRegistrationService; + @Resource private ReportDocumentAssistService reportDocumentAssistService; + @Resource private DataKeyCheckService dataKeyCheckService; + + /* + * 测试异步执行 + * */ + @Async("asyncTaskExecutor") + @Override + @Transactional(rollbackFor = Exception.class) + public void testAsyncTask(Long id) { + ReportDocumentMainDO entity = reportDocumentMainMapper.selectById(id); + entity.setFlowStatus("success"); + try { + Thread.sleep(10000); + } catch (InterruptedException e) { + throw new RuntimeException(e); + } + reportDocumentMainMapper.updateById(entity); + } + /*** * 增加报表数据(按样品) * 传入:报告id、 报表数据ids @@ -93,14 +118,13 @@ public class ReportDocumentMainServiceImpl implements ReportDocumentMainService, } if(isExist) return error(REPORT_DOCUMENT_DATA_NOT_EXISTS.getCode(), "报表数据已在本报告使用,请勿重复添加"); -// List assayReportDataList = businessAssayReportDataService.listByIds(addReportDataIdList); BusinessAssayReportDataPageReqVO reportDataQueryVo = new BusinessAssayReportDataPageReqVO(); reportDataQueryVo.setIdList(addReportDataIdList); reportDataQueryVo.setPageNo(1); reportDataQueryVo.setPageSize(9999); PageResult assayReportPage = businessAssayReportDataService.queryWaitingDataForReport( reportDataQueryVo); List assayReportDataList = assayReportPage.getList(); - return execAddByBusinessAssayReportData(assayReportDataList, id); + return execAddByBusinessAssayReportData(assayReportDataList, id, new ArrayList<>()); } @Override @@ -108,39 +132,44 @@ public class ReportDocumentMainServiceImpl implements ReportDocumentMainService, public CommonResult execAddDataByEntrust(ReportDocumentMainSaveReqVO reqVO) { Long id = reqVO.getId(); String businessSampleEntrustRegistrationIds = reqVO.getBusinessSampleEntrustRegistrationIds(); - if(ObjectUtils.isEmpty(businessSampleEntrustRegistrationIds) || id == null) + if(id == null) + return error(REPORT_DOCUMENT_DATA_NOT_EXISTS.getCode(), "缺少id参数,请刷新后重试"); + if(ObjectUtils.isEmpty(businessSampleEntrustRegistrationIds)) return error(REPORT_DOCUMENT_DATA_NOT_EXISTS.getCode(), "缺少businessSampleEntrustRegistrationIds参数,请刷新后重试"); - List reportRelationList = reportDocumentMainCorrelationService.listByMainId(id); - //todo 判断修改的场景。处理方法:删除reportRelation、ReportDocumentData List businessSampleEntrustRegistrationIdList = new ArrayList<>(); String[] split = businessSampleEntrustRegistrationIds.split(","); for (String s : split) { Long aLong = Long.valueOf(s); businessSampleEntrustRegistrationIdList.add(aLong); } + List entrustList = businessSampleEntrustRegistrationService.listByIds(businessSampleEntrustRegistrationIdList); BusinessAssayReportDataPageReqVO reportDataQueryVo = new BusinessAssayReportDataPageReqVO(); reportDataQueryVo.setBusinessSampleEntrustRegistrationIdList(businessSampleEntrustRegistrationIdList); reportDataQueryVo.setPageNo(1); reportDataQueryVo.setPageSize(9999); PageResult assayReportPage = businessAssayReportDataService.queryWaitingDataForReport( reportDataQueryVo); List assayReportDataList = assayReportPage.getList(); - CommonResult ret = execAddByBusinessAssayReportData(assayReportDataList, id); + CommonResult ret = execAddByBusinessAssayReportData(assayReportDataList, id, entrustList); if(!ret.isSuccess()) return ret; //保存报告关系表 + List correlationList = new ArrayList<>(); for(Long businessSampleEntrustRegistrationId : businessSampleEntrustRegistrationIdList){ - ReportDocumentMainCorrelationSaveReqVO correlationEntity = new ReportDocumentMainCorrelationSaveReqVO(); + ReportDocumentMainCorrelationDO correlationEntity = new ReportDocumentMainCorrelationDO(); correlationEntity.setMainId( id); correlationEntity.setCorrelationId(businessSampleEntrustRegistrationId); correlationEntity.setCorrelationType(ReportDocumentMainCorrelationService.CorrelationType_entrust); - reportDocumentMainCorrelationService.createReportDocumentMainCorrelation(correlationEntity); + correlationList.add(correlationEntity); } + if(!correlationList.isEmpty()) + reportDocumentMainCorrelationService.insertBatch(correlationList); return CommonResult.success("操作成功"); } @Override - public CommonResult execAddByBusinessAssayReportData(List assayReportDataList, Long id){ + @Transactional(rollbackFor = Exception.class) + public CommonResult execAddByBusinessAssayReportData(List assayReportDataList, Long id, List entrustList){ if(ObjectUtils.isEmpty(assayReportDataList)) return error(REPORT_DOCUMENT_DATA_NOT_EXISTS.getCode(), "您选择的委托还没产生可编制报告的数据,请稍后重试!"); List insertList = new ArrayList<>(); @@ -152,16 +181,75 @@ public class ReportDocumentMainServiceImpl implements ReportDocumentMainService, reportDocumentDataDO.setSampleName(assayReportData.getSampleName()); reportDocumentDataDO.setBaseSampleName(assayReportData.getBaseSampleName()); reportDocumentDataDO.setDocumentContent(assayReportData.getAssayData()); + reportDocumentDataDO.setSampleTypeKey(assayReportData.getSampleTypeKey()); + reportDocumentDataDO.setEntrustSampleCode(assayReportData.getEntrustSampleCode()); + reportDocumentDataDO.setEntrustSampleName(assayReportData.getEntrustSampleName()); + reportDocumentDataDO.setSort(assayReportData.getEntrustDetailSort()); insertList.add(reportDocumentDataDO); } if(!insertList.isEmpty()) reportDocumentDataService.insertBatch(insertList); ReportDocumentMainDO reportDocumentMainDO = reportDocumentMainMapper.selectById(id); updateCommonField(reportDocumentMainDO); + + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + String formData = reportDocumentMainDO.getFormData(); + JSONObject formDataJson = new JSONObject(); + if(!ObjectUtils.isEmpty(formData)) + formDataJson = JSONObject.parseObject(formData); + ReportDocumentTypeDO typeDO = reportDocumentTypeService.getReportDocumentType(reportDocumentMainDO.getReportDocumentTypeId()); + String customConfig = typeDO.getCustomConfig(); + String defaultConclusion = ""; + if(!ObjectUtils.isEmpty(customConfig)){ + JSONObject config = JSONObject.parseObject(customConfig); + defaultConclusion = config.getString("defaultConclusion"); + } + formDataJson.put("conclusion", defaultConclusion); + if(!assayReportDataList.isEmpty()) + formDataJson.put("sampleName", assayReportDataList.get(0).getSampleName()); + //处理检测标准 + String standard = assembleStandard(assayReportDataList); + formDataJson.put("standard", standard); + formDataJson.put("reportTime", sdf.format(new Date())); + + //委托单号 + String entrustCode = ""; + if(!ObjectUtils.isEmpty(entrustList)){ + for(BusinessSampleEntrustRegistrationDO entrust : entrustList){ + entrustCode += entrust.getEntrustNumber() + ","; + break; + } + } + if(!ObjectUtils.isEmpty(entrustCode)) + entrustCode = entrustCode.substring(0, entrustCode.length() - 1); + formDataJson.put("entrustCode", entrustCode); + + reportDocumentMainDO.setFormData(formDataJson.toJSONString()); reportDocumentMainMapper.updateById(reportDocumentMainDO); return CommonResult.success("操作成功"); } + //组装检测标准 + private String assembleStandard(List dataList){ + Set standardSet = new HashSet<>(); + for(BusinessAssayReportDataDO data : dataList){ + String content = data.getAssayData(); + if(ObjectUtils.isEmpty( content)) + continue; + JSONObject json = JSONObject.parseObject(content); + for(String key : json.keySet()){ + JSONObject obj = json.getJSONObject(key); + String methodName = obj.getString("methodName"); + if(ObjectUtils.isEmpty(methodName)) + continue; + standardSet.add(methodName); + } + } + if(standardSet.isEmpty()) + return ""; + return String.join(",", standardSet); + } + @Override public void updateCommonField(ReportDocumentMainDO reportDocumentMainDO) { if(reportDocumentMainDO == null) @@ -290,6 +378,7 @@ public class ReportDocumentMainServiceImpl implements ReportDocumentMainService, throw exception0(ERROR_CODE_MODULE_COMMON, result.getMsg()); } entity.setFlowStatus(QmsCommonConstant.IN_PROGRESS); + //todo 生成报告编号 documentCode reportDocumentMainMapper.updateById(entity); ReportDocumentMainRespVO respVO = BeanUtils.toBean(entity, ReportDocumentMainRespVO.class); return CommonResult.success(respVO); @@ -324,12 +413,29 @@ public class ReportDocumentMainServiceImpl implements ReportDocumentMainService, return CommonResult.success(respVO); } + //流程回调 @Override @Transactional(rollbackFor = Exception.class) public CommonResult callback(QmsBpmDTO reqDTO) { + log.error("流程回调:{}", JSONObject.toJSONString(reqDTO)); JSONObject variables = reqDTO.getVariables(); - + String processInsId = variables.getString(QmsBpmConstant.BPM_PROCESS_INS_ID); + String currentActivityInsId = variables.getString(QmsBpmConstant.BPM_CUR_ACTIVITY_INS_ID); + String returnFlag = variables.getString(QmsBpmConstant.BPM_REJECT_TO_FIRST_FLAG); //退回标识。在任务监听中设置 + //同一个节点实例只触发一次 + String checkKey = currentActivityInsId; + if(ObjectUtils.isEmpty(currentActivityInsId)) + checkKey = processInsId + "-create"; + if("1".equals(returnFlag)) + checkKey += "-reject"; + try{ + dataKeyCheckService.create(checkKey, this.getClass().getName()); + }catch (Exception e){ +// e.printStackTrace(); + log.error("checkKey 重复:key={}", checkKey); + return CommonResult.success(new JSONObject()); + } //流程状态 1-提交(含退回) 4-取消流程 String PROCESS_STATUS = variables.getString(QmsBpmConstant.PROCESS_INSTANCE_VARIABLE_STATUS); String mainId = variables.getString("mainId"); @@ -338,10 +444,7 @@ public class ReportDocumentMainServiceImpl implements ReportDocumentMainService, fieldExtensions = variables.getJSONArray(QmsBpmConstant.BPM_FIELD_EXTENSIONS); } ReportDocumentMainDO entity = getReportDocumentMain(Long.valueOf(mainId)); - log.error("流程回调:{}", JSONObject.toJSONString(reqDTO)); String currentActivityId = variables.getString(QmsBpmConstant.BPM_CALLBACK_ACTIVITY_ID); - String RETURN_FLAG_PREFIX_KEY = QmsBpmConstant.BPM_CALLBACK_RETURN_FLAG_PREFIX_KEY; - String returnFlagKey = RETURN_FLAG_PREFIX_KEY + "Activity_001"; //判断是否最后一个节点 String lastActivityFlag = "0"; @@ -349,17 +452,16 @@ public class ReportDocumentMainServiceImpl implements ReportDocumentMainService, if(!fieldExtensions.isEmpty()){ for(int i = 0; i < fieldExtensions.size(); i++){ JSONObject fieldExtension = fieldExtensions.getJSONObject(i); - if(fieldExtension.getString("fieldName").equals(QmsBpmConstant.BPM_LAST_ACTIVITY_FLAG)){ + if(fieldExtension.getString("fieldName").equalsIgnoreCase(QmsBpmConstant.BPM_LAST_ACTIVITY_FLAG)){ lastActivityFlag = "1"; } - if(fieldExtension.getString("fieldName").equals(QmsBpmConstant.BPM_FIRST_ACTIVITY_FLAG)){ + if(fieldExtension.getString("fieldName").equalsIgnoreCase(QmsBpmConstant.BPM_FIRST_ACTIVITY_FLAG)){ firstActivityFlag = "1"; } } } - //"RETURN_FLAG_Activity_001": true 标识驳回到发起环节 - if(variables.containsKey(returnFlagKey) && variables.getString(returnFlagKey).equals("true")){ + if(("1").equals(returnFlag)){ //驳回。流程需要配置退回到发起节点 entity.setFlowStatus(QmsCommonConstant.REJECTED); entity.setDocumentSignature(""); @@ -375,7 +477,23 @@ public class ReportDocumentMainServiceImpl implements ReportDocumentMainService, if("1".equals(lastActivityFlag)) entity.setFlowStatus(QmsCommonConstant.COMPLETED); //结束审批 } + boolean updateDocFileFlag = reportDocumentAssistService.checkUpdateDocFile(variables); + if(updateDocFileFlag){ + Integer version = entity.getDocumentVersion(); + if(version == null) + version = 1; + else + version++; + entity.setDocumentVersion(version); //版本+1 + } reportDocumentMainMapper.updateById(entity); + + try { + reportDocumentAssistService.updateDocFileAndCreateIWorkflow( variables, entity); + } catch (IOException e) { + throw new RuntimeException(e); + } + JSONObject ret = new JSONObject(); return CommonResult.success(ret); } @@ -405,5 +523,4 @@ public class ReportDocumentMainServiceImpl implements ReportDocumentMainService, signObj.put(currentActivityId, obj); entity.setDocumentSignature(signObj.toJSONString()); } - } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/controller/admin/DataKeyCheckController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/controller/admin/DataKeyCheckController.java new file mode 100644 index 0000000..08c4284 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/controller/admin/DataKeyCheckController.java @@ -0,0 +1,79 @@ +package com.zt.plat.module.qms.common.data.controller.admin; + +import com.zt.plat.module.qms.common.data.controller.vo.DataKeyCheckPageReqVO; +import com.zt.plat.module.qms.common.data.controller.vo.DataKeyCheckRespVO; +import com.zt.plat.module.qms.common.data.controller.vo.DataKeyCheckSaveReqVO; +import com.zt.plat.module.qms.common.data.dal.dataobject.DataKeyCheckDO; +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.*; + +import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO; +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.module.qms.common.data.service.DataKeyCheckService; + +@Tag(name = "管理后台 - 数据重复校验") +@RestController +@RequestMapping("/qms/data-key-check") +@Validated +public class DataKeyCheckController implements BusinessControllerMarker { + + + @Resource + private DataKeyCheckService dataKeyCheckService; + + @PostMapping("/create") + @Operation(summary = "创建数据重复校验") + @PreAuthorize("@ss.hasPermission('qms:data-key-check:create')") + public CommonResult createDataKeyCheck(@Valid @RequestBody DataKeyCheckSaveReqVO createReqVO) { + return success(dataKeyCheckService.createDataKeyCheck(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新数据重复校验") + @PreAuthorize("@ss.hasPermission('qms:data-key-check:update')") + public CommonResult updateDataKeyCheck(@Valid @RequestBody DataKeyCheckSaveReqVO updateReqVO) { + dataKeyCheckService.updateDataKeyCheck(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除数据重复校验") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('qms:data-key-check:delete')") + public CommonResult deleteDataKeyCheck(@RequestParam("id") String id) { + dataKeyCheckService.deleteDataKeyCheck(id); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得数据重复校验") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('qms:data-key-check:query')") + public CommonResult getDataKeyCheck(@RequestParam("id") String id) { + DataKeyCheckDO dataKeyCheck = dataKeyCheckService.getDataKeyCheck(id); + return success(BeanUtils.toBean(dataKeyCheck, DataKeyCheckRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得数据重复校验分页") + @PreAuthorize("@ss.hasPermission('qms:data-key-check:query')") + public CommonResult> getDataKeyCheckPage(@Valid DataKeyCheckPageReqVO pageReqVO) { + PageResult pageResult = dataKeyCheckService.getDataKeyCheckPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, DataKeyCheckRespVO.class)); + } + + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/controller/vo/DataKeyCheckPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/controller/vo/DataKeyCheckPageReqVO.java new file mode 100644 index 0000000..c28c1d0 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/controller/vo/DataKeyCheckPageReqVO.java @@ -0,0 +1,28 @@ +package com.zt.plat.module.qms.common.data.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 DataKeyCheckPageReqVO extends PageParam { + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "模块编码") + private String moduleCode; + + @Schema(description = "备注") + private String remark; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/controller/vo/DataKeyCheckRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/controller/vo/DataKeyCheckRespVO.java new file mode 100644 index 0000000..37b5c38 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/controller/vo/DataKeyCheckRespVO.java @@ -0,0 +1,34 @@ +package com.zt.plat.module.qms.common.data.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 DataKeyCheckRespVO { + + @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "4480") + @ExcelProperty("主键") + private String id; + + @Schema(description = "所属部门") + @ExcelProperty("所属部门") + private String systemDepartmentCode; + + @Schema(description = "模块编码") + @ExcelProperty("模块编码") + private String moduleCode; + + @Schema(description = "备注") + @ExcelProperty("备注") + private String remark; + + @Schema(description = "创建时间") + @ExcelProperty("创建时间") + private LocalDateTime createTime; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/controller/vo/DataKeyCheckSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/controller/vo/DataKeyCheckSaveReqVO.java new file mode 100644 index 0000000..1a2e456 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/controller/vo/DataKeyCheckSaveReqVO.java @@ -0,0 +1,22 @@ +package com.zt.plat.module.qms.common.data.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; + +@Schema(description = "管理后台 - 数据重复校验新增/修改 Request VO") +@Data +public class DataKeyCheckSaveReqVO { + + @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "4480") + private String id; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "模块编码") + private String moduleCode; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/dal/dataobject/DataKeyCheckDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/dal/dataobject/DataKeyCheckDO.java new file mode 100644 index 0000000..489ee98 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/dal/dataobject/DataKeyCheckDO.java @@ -0,0 +1,47 @@ +package com.zt.plat.module.qms.common.data.dal.dataobject; + +import lombok.*; +import com.baomidou.mybatisplus.annotation.*; +import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; +/** +* 数据重复校验 DO +* +* @author 后台管理-1 +*/ +@TableName("t_dat_ky_chk") +@KeySequence("t_dat_ky_chk_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class DataKeyCheckDO extends BusinessBaseDO { + + + + /** + * 主键 + */ + @TableId(type = IdType.INPUT) + private String id; + /** + * 所属部门 + */ + @TableField("SYS_DEPT_CD") + private String systemDepartmentCode; + /** + * 模块编码 + */ + @TableField("MDUL_CD") + private String moduleCode; + /** + * 备注 + */ + @TableField("RMK") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/dal/mapper/DataKeyCheckMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/dal/mapper/DataKeyCheckMapper.java new file mode 100644 index 0000000..1fb741f --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/dal/mapper/DataKeyCheckMapper.java @@ -0,0 +1,27 @@ +package com.zt.plat.module.qms.common.data.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.common.data.controller.vo.DataKeyCheckPageReqVO; +import com.zt.plat.module.qms.common.data.dal.dataobject.DataKeyCheckDO; +import org.apache.ibatis.annotations.Mapper; + +/** + * 数据重复校验 Mapper + * + * @author 后台管理-1 + */ +@Mapper +public interface DataKeyCheckMapper extends BaseMapperX { + + default PageResult selectPage(DataKeyCheckPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(DataKeyCheckDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .eqIfPresent(DataKeyCheckDO::getModuleCode, reqVO.getModuleCode()) + .eqIfPresent(DataKeyCheckDO::getRemark, reqVO.getRemark()) + .betweenIfPresent(DataKeyCheckDO::getCreateTime, reqVO.getCreateTime()) + .orderByDesc(DataKeyCheckDO::getId)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/service/DataKeyCheckService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/service/DataKeyCheckService.java new file mode 100644 index 0000000..5298eef --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/service/DataKeyCheckService.java @@ -0,0 +1,66 @@ +package com.zt.plat.module.qms.common.data.service; + +import java.util.*; + +import com.zt.plat.module.qms.common.data.controller.vo.DataKeyCheckPageReqVO; +import com.zt.plat.module.qms.common.data.controller.vo.DataKeyCheckRespVO; +import com.zt.plat.module.qms.common.data.controller.vo.DataKeyCheckSaveReqVO; +import com.zt.plat.module.qms.common.data.dal.dataobject.DataKeyCheckDO; +import jakarta.validation.*; +import com.zt.plat.framework.common.pojo.PageResult; + +/** + * 数据重复校验 Service 接口 + * + * @author 后台管理-1 + */ +public interface DataKeyCheckService { + + void create(String id, String moduleCode); + + /** + * 创建数据重复校验 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + DataKeyCheckRespVO createDataKeyCheck(@Valid DataKeyCheckSaveReqVO createReqVO); + + /** + * 更新数据重复校验 + * + * @param updateReqVO 更新信息 + */ + void updateDataKeyCheck(@Valid DataKeyCheckSaveReqVO updateReqVO); + + /** + * 删除数据重复校验 + * + * @param id 编号 + */ + void deleteDataKeyCheck(String id); + + /** + * 批量删除数据重复校验 + * + * @param ids 编号 + */ + void deleteDataKeyCheckListByIds(List ids); + + /** + * 获得数据重复校验 + * + * @param id 编号 + * @return 数据重复校验 + */ + DataKeyCheckDO getDataKeyCheck(String id); + + /** + * 获得数据重复校验分页 + * + * @param pageReqVO 分页查询 + * @return 数据重复校验分页 + */ + PageResult getDataKeyCheckPage(DataKeyCheckPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/service/DataKeyCheckServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/service/DataKeyCheckServiceImpl.java new file mode 100644 index 0000000..c67f255 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/service/DataKeyCheckServiceImpl.java @@ -0,0 +1,83 @@ +package com.zt.plat.module.qms.common.data.service; + +import cn.hutool.core.collection.CollUtil; +import com.zt.plat.module.qms.common.data.controller.vo.DataKeyCheckPageReqVO; +import com.zt.plat.module.qms.common.data.controller.vo.DataKeyCheckRespVO; +import com.zt.plat.module.qms.common.data.controller.vo.DataKeyCheckSaveReqVO; +import com.zt.plat.module.qms.common.data.dal.dataobject.DataKeyCheckDO; +import org.springframework.stereotype.Service; +import jakarta.annotation.Resource; +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 com.zt.plat.module.qms.common.data.dal.mapper.DataKeyCheckMapper; + +import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList; + +/** + * 数据重复校验 Service 实现类 + * + * @author 后台管理-1 + */ +@Service +@Validated +public class DataKeyCheckServiceImpl implements DataKeyCheckService { + + @Resource + private DataKeyCheckMapper dataKeyCheckMapper; + + @Override + public void create(String id, String moduleCode) { + DataKeyCheckDO dataKeyCheck = new DataKeyCheckDO(); + dataKeyCheck.setId(id); + dataKeyCheck.setModuleCode(moduleCode); + dataKeyCheckMapper.insert(dataKeyCheck); + } + + @Override + public DataKeyCheckRespVO createDataKeyCheck(DataKeyCheckSaveReqVO createReqVO) { + // 插入 + DataKeyCheckDO dataKeyCheck = BeanUtils.toBean(createReqVO, DataKeyCheckDO.class); + dataKeyCheckMapper.insert(dataKeyCheck); + // 返回 + return BeanUtils.toBean(dataKeyCheck, DataKeyCheckRespVO.class); + } + + @Override + public void updateDataKeyCheck(DataKeyCheckSaveReqVO updateReqVO) { + + // 更新 + DataKeyCheckDO updateObj = BeanUtils.toBean(updateReqVO, DataKeyCheckDO.class); + dataKeyCheckMapper.updateById(updateObj); + } + + @Override + public void deleteDataKeyCheck(String id) { + + // 删除 + dataKeyCheckMapper.deleteById(id); + } + + @Override + public void deleteDataKeyCheckListByIds(List ids) { + + // 删除 + dataKeyCheckMapper.deleteByIds(ids); + } + + @Override + public DataKeyCheckDO getDataKeyCheck(String id) { + return dataKeyCheckMapper.selectById(id); + } + + @Override + public PageResult getDataKeyCheckPage(DataKeyCheckPageReqVO pageReqVO) { + return dataKeyCheckMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/dic/controller/admin/DictionaryBusinessController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/dic/controller/admin/DictionaryBusinessController.java index 6cb55cc..58ab86c 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/dic/controller/admin/DictionaryBusinessController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/dic/controller/admin/DictionaryBusinessController.java @@ -112,7 +112,7 @@ public class DictionaryBusinessController implements BusinessControllerMarker { @GetMapping("/get") @Operation(summary = "获得业务参数字典") @Parameter(name = "id", description = "编号", required = true, example = "1024") - @PreAuthorize("@ss.hasPermission('qms:dictionary-business:query')") +// @PreAuthorize("@ss.hasPermission('qms:dictionary-business:query')") public CommonResult getDictionaryBusiness(@RequestParam("id") Long id) { DictionaryBusinessDO dictionaryBusiness = dictionaryBusinessService.getDictionaryBusiness(id); return success(BeanUtils.toBean(dictionaryBusiness, DictionaryBusinessRespVO.class)); @@ -120,7 +120,7 @@ public class DictionaryBusinessController implements BusinessControllerMarker { @GetMapping("/page") @Operation(summary = "获得业务参数字典分页") - @PreAuthorize("@ss.hasPermission('qms:dictionary-business:query')") +// @PreAuthorize("@ss.hasPermission('qms:dictionary-business:query')") public CommonResult> getDictionaryBusinessPage(@Valid DictionaryBusinessPageReqVO pageReqVO) { PageResult pageResult = dictionaryBusinessService.getDictionaryBusinessPage(pageReqVO); return success(BeanUtils.toBean(pageResult, DictionaryBusinessRespVO.class)); diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/dic/controller/vo/DictionaryBusinessExtendRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/dic/controller/vo/DictionaryBusinessExtendRespVO.java new file mode 100644 index 0000000..79d3c1a --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/dic/controller/vo/DictionaryBusinessExtendRespVO.java @@ -0,0 +1,11 @@ +package com.zt.plat.module.qms.common.dic.controller.vo; + +import lombok.Data; + +@Data +public class DictionaryBusinessExtendRespVO extends DictionaryBusinessRespVO { + + private String parentDictionaryBusinessName; + + private String parentDictionaryBusinesskey; +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/dic/dal/mapper/DictionaryBusinessMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/dic/dal/mapper/DictionaryBusinessMapper.java index f438223..c5256ac 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/dic/dal/mapper/DictionaryBusinessMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/dic/dal/mapper/DictionaryBusinessMapper.java @@ -3,6 +3,7 @@ package com.zt.plat.module.qms.common.dic.dal.mapper; 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.framework.mybatis.core.query.MPJLambdaWrapperX; import com.zt.plat.module.qms.common.dic.controller.vo.*; import com.zt.plat.module.qms.common.dic.controller.vo.DictionaryBusinessPageReqVO; import com.zt.plat.module.qms.common.dic.dal.dataobject.DictionaryBusinessDO; @@ -35,6 +36,16 @@ public interface DictionaryBusinessMapper extends BaseMapperX selectItemByCategoryKeys(List keys) { + return selectJoinList(DictionaryBusinessExtendRespVO.class, new MPJLambdaWrapperX() + .leftJoin(DictionaryBusinessDO.class, "dbd", DictionaryBusinessDO::getId, DictionaryBusinessDO::getParentId) + .selectAll(DictionaryBusinessDO.class) + .selectAs("dbd", DictionaryBusinessDO::getKey, DictionaryBusinessExtendRespVO::getParentDictionaryBusinesskey) + .selectAs("dbd", DictionaryBusinessDO::getName, DictionaryBusinessExtendRespVO::getParentDictionaryBusinessName) + .in("dbd", DictionaryBusinessDO::getKey, keys) + .orderByAsc(DictionaryBusinessDO::getSortNo)); + } /** diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/core/code/CodeGenUtil.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/core/code/CodeGenUtil.java index b5209fb..b462b00 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/core/code/CodeGenUtil.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/core/code/CodeGenUtil.java @@ -7,7 +7,7 @@ import java.util.List; import java.util.Set; import java.util.concurrent.TimeUnit; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.stereotype.Component; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/core/code/SampleEncryptUtil.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/core/code/SampleEncryptUtil.java index 37cb497..7bff5f7 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/core/code/SampleEncryptUtil.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/core/code/SampleEncryptUtil.java @@ -3,7 +3,7 @@ package com.zt.plat.module.qms.core.code; import java.math.BigInteger; import java.util.ArrayList; import java.util.List; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import com.baomidou.mybatisplus.core.toolkit.IdWorker; public class SampleEncryptUtil { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/core/legend/security/AbstractQueryBlackListHandler.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/core/legend/security/AbstractQueryBlackListHandler.java index 39086fd..ae02309 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/core/legend/security/AbstractQueryBlackListHandler.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/core/legend/security/AbstractQueryBlackListHandler.java @@ -1,7 +1,7 @@ package com.zt.plat.module.qms.core.legend.security; import lombok.extern.slf4j.Slf4j; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import java.util.*; import java.util.regex.Matcher; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/core/qlexpress/cmp/AllowanceCalculatorComponent.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/core/qlexpress/cmp/AllowanceCalculatorComponent.java index fcc29d1..757f011 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/core/qlexpress/cmp/AllowanceCalculatorComponent.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/core/qlexpress/cmp/AllowanceCalculatorComponent.java @@ -2,11 +2,13 @@ package com.zt.plat.module.qms.core.qlexpress.cmp; import java.math.BigDecimal; import java.math.RoundingMode; +import java.util.HashMap; +import java.util.Map; import org.springframework.stereotype.Component; -import com.ql.util.express.DefaultContext; -import com.ql.util.express.ExpressRunner; +import com.alibaba.qlexpress4.Express4Runner; +import com.alibaba.qlexpress4.QLOptions; import jakarta.annotation.Resource; import lombok.extern.slf4j.Slf4j; @@ -19,7 +21,7 @@ import lombok.extern.slf4j.Slf4j; public class AllowanceCalculatorComponent { @Resource - private ExpressRunner expressRunner; + private Express4Runner express4Runner; /** * 计算允差值:支持原生线性公式 和 Express 自定义公式混合模式 @@ -80,11 +82,12 @@ public class AllowanceCalculatorComponent { * 使用 Express 执行自定义公式 */ private BigDecimal evaluateCustomFormula(String formula, BigDecimal xValue, int scale) { - DefaultContext context = new DefaultContext<>(); + Map context = new HashMap<>(); context.put("X", xValue); // 用户公式中使用 X 作为变量名 try { - Object result = expressRunner.execute(formula, context, null, true, false); +// Object result = expressRunner.execute(formula, context, null, true, false); + Object result = express4Runner.execute(formula, context, QLOptions.builder().precise(true).build()); if (result == null) { throw new RuntimeException("Express 公式返回结果为 null"); diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/core/qlexpress/config/QlExpressRuleEngineConfig.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/core/qlexpress/config/QlExpressRuleEngineConfig.java index 5d0180e..6484fc9 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/core/qlexpress/config/QlExpressRuleEngineConfig.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/core/qlexpress/config/QlExpressRuleEngineConfig.java @@ -3,16 +3,19 @@ package com.zt.plat.module.qms.core.qlexpress.config; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import com.ql.util.express.ExpressRunner; +import com.alibaba.qlexpress4.Express4Runner; +import com.alibaba.qlexpress4.InitOptions; +import com.alibaba.qlexpress4.security.QLSecurityStrategy; import com.zt.plat.module.qms.core.qlexpress.function.RoundToScaleHalfEven; -@Configuration +@Configuration(proxyBeanMethods = false) public class QlExpressRuleEngineConfig { @Bean - public ExpressRunner expressRunner() { - //需要高精度计算支持 - ExpressRunner expressRunner = new ExpressRunner(true, false); + public Express4Runner expressRunner() { + //兼容 3 的行为,则在新建 Express4Runner 时, 要将安全策略设置为 “开放” + InitOptions initOptions = InitOptions.builder().securityStrategy(QLSecurityStrategy.open()).build(); + Express4Runner expressRunner = new Express4Runner(initOptions); expressRunner.addFunction("roundToScale", new RoundToScaleHalfEven()); return expressRunner; } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/core/qlexpress/function/RoundToScaleHalfEven.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/core/qlexpress/function/RoundToScaleHalfEven.java index 2053ae0..f5806b4 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/core/qlexpress/function/RoundToScaleHalfEven.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/core/qlexpress/function/RoundToScaleHalfEven.java @@ -3,18 +3,20 @@ package com.zt.plat.module.qms.core.qlexpress.function; import java.math.BigDecimal; import java.math.RoundingMode; -import com.ql.util.express.Operator; +import com.alibaba.qlexpress4.runtime.Parameters; +import com.alibaba.qlexpress4.runtime.QContext; +import com.alibaba.qlexpress4.runtime.function.CustomFunction; -public class RoundToScaleHalfEven extends Operator { + +public class RoundToScaleHalfEven implements CustomFunction { @Override - public Object executeInner(Object[] list) throws Exception { - if (list.length != 2) { + public Object call(QContext qContext, Parameters parameters) throws Throwable { + if (parameters.size() != 2) { throw new Exception("roundToScale函数需要2个参数:数值和小数位数"); } - - double value = Double.parseDouble(list[0].toString()); - int scale = Integer.parseInt(list[1].toString()); + double value = Double.parseDouble(parameters.get(0).get().toString()); + int scale = Integer.parseInt(parameters.get(1).get().toString()); BigDecimal bd = BigDecimal.valueOf(value); bd = bd.setScale(scale, RoundingMode.HALF_EVEN); diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/framework/rpc/config/RpcConfiguration.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/framework/rpc/config/RpcConfiguration.java index 4f0e709..85e3570 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/framework/rpc/config/RpcConfiguration.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/framework/rpc/config/RpcConfiguration.java @@ -4,6 +4,7 @@ import com.zt.plat.module.bpm.api.task.BpmProcessInstanceApi; import com.zt.plat.module.bpm.api.task.BpmTaskApi; import com.zt.plat.module.infra.api.file.FileApi; import com.zt.plat.module.system.api.dept.DeptApi; +import com.zt.plat.module.system.api.iwork.IWorkIntegrationApi; import com.zt.plat.module.system.api.permission.PermissionApi; import com.zt.plat.module.system.api.sequence.SequenceApi; import com.zt.plat.module.system.api.user.AdminUserApi; @@ -12,6 +13,6 @@ import org.springframework.cloud.openfeign.EnableFeignClients; import org.springframework.context.annotation.Configuration; @Configuration(value = "qmsRpcConfiguration", proxyBeanMethods = false) -@EnableFeignClients(clients = {FileApi.class, SequenceApi.class, AdminUserApi.class, DeptApi.class, BpmProcessInstanceApi.class, BpmTaskApi.class, PermissionApi.class}) +@EnableFeignClients(clients = {FileApi.class, SequenceApi.class, AdminUserApi.class, DeptApi.class, BpmProcessInstanceApi.class, BpmTaskApi.class, PermissionApi.class, IWorkIntegrationApi.class}) public class RpcConfiguration { } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/mapper/IotHelloMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/mapper/IotHelloMapper.java index ad5c214..fce43bb 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/mapper/IotHelloMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/mapper/IotHelloMapper.java @@ -1,4 +1,4 @@ -package com.zt.plat.module.qms.iot.mapper;//package com.zt.plat.module.qms.iot.mapper; +//package com.zt.plat.module.qms.iot.mapper; // //import com.baomidou.mybatisplus.core.mapper.BaseMapper; //import com.yncic.modules.iot.entity.IotHelloEntity; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/service/IIotHelloService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/service/IIotHelloService.java index bf43aef..8337255 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/service/IIotHelloService.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/service/IIotHelloService.java @@ -1,4 +1,4 @@ -package com.zt.plat.module.qms.iot.service;//package com.zt.plat.module.qms.iot.service; +//package com.zt.plat.module.qms.iot.service; // //import com.baomidou.mybatisplus.extension.service.IService; //import com.yncic.modules.iot.entity.IotHelloEntity; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/service/impl/IotHelloServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/service/impl/IotHelloServiceImpl.java index fed77cc..385848d 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/service/impl/IotHelloServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/service/impl/IotHelloServiceImpl.java @@ -1,4 +1,4 @@ -package com.zt.plat.module.qms.iot.service.impl;//package com.zt.plat.module.qms.iot.service.impl; +//package com.zt.plat.module.qms.iot.service.impl; // //import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; //import com.yncic.modules.iot.entity.IotHelloEntity; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/IotUtils.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/IotUtils.java index 6d4fa80..6fae7b2 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/IotUtils.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/IotUtils.java @@ -1,7 +1,7 @@ package com.zt.plat.module.qms.iot.tcpserver; import lombok.extern.slf4j.Slf4j; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.springframework.util.ObjectUtils; import tech.zzjc.tio.core.ChannelContext; import tech.zzjc.tio.core.Tio; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/device/RedisSessionComponent.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/device/RedisSessionComponent.java index 89a0fc4..87b0595 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/device/RedisSessionComponent.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/device/RedisSessionComponent.java @@ -105,7 +105,7 @@ public class RedisSessionComponent { context.setDeviceType(deviceType); context.setDeviceCode(deviceCode); if(deviceInfo != null){ - context.setDeviceName(deviceInfo.getProductName()); + context.setDeviceName(deviceInfo.getDeviceName()); context.setTenantId(deviceInfo.getTenantId().toString()); deviceInfo.setIsConnect("1"); deviceInfo.setLastConnectTime(LocalDateTime.now()); diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/device/handler/IotDeviceBalanceHandler.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/device/handler/IotDeviceBalanceHandler.java index b4da687..cb8e7f6 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/device/handler/IotDeviceBalanceHandler.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/device/handler/IotDeviceBalanceHandler.java @@ -10,8 +10,9 @@ import com.zt.plat.module.qms.iot.tcpserver.handler.IotDataHander; import com.zt.plat.module.qms.iot.tcpserver.publisher.BalanceDataPublisher; import com.fhs.common.spring.SpringContextUtil; import lombok.extern.slf4j.Slf4j; -import org.apache.commons.lang.StringUtils; -import org.apache.commons.lang.math.NumberUtils; + +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.math.NumberUtils; import org.springframework.stereotype.Component; import tech.zzjc.tio.cluster.TioClusterConfig; import tech.zzjc.tio.cluster.TioClusterVo; @@ -81,7 +82,7 @@ public class IotDeviceBalanceHandler implements IotDataHander { String[] dataArray = analysisData(data, weightUnit); weightData = dataArray[0]; weightUnit = dataArray[1]; - if (!NumberUtils.isNumber(weightData)) { + if (!NumberUtils.isParsable(weightData)) { log.error("{},天平接收到的数据不正确!接收到的数据:{} 16进制:{}", realClient, data, IotUtils.bytesToHex(data.getBytes("UTF-8"))); return null; } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/deleteme b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/deleteme deleted file mode 100644 index e69de29..0000000 diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/admin/SupplierController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/admin/SupplierController.java new file mode 100644 index 0000000..eabfca4 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/admin/SupplierController.java @@ -0,0 +1,119 @@ +package com.zt.plat.module.qms.office.supplier.controller.admin; + +import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierPageReqVO; +import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierRespVO; +import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierSaveReqVO; +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.office.supplier.controller.vo.*; +import com.zt.plat.module.qms.office.supplier.dal.dataobject.SupplierDO; +import com.zt.plat.module.qms.office.supplier.service.SupplierService; + +@Tag(name = "管理后台 - 供应商") +@RestController +@RequestMapping("/qms/supplier") +@Validated +@FileUploadController(source = "qms.supplier") +public class SupplierController extends AbstractFileUploadController implements BusinessControllerMarker{ + + static { + FileUploadController annotation = SupplierController.class.getAnnotation(FileUploadController.class); + if (annotation != null) { + setFileUploadInfo(annotation); + } + } + + @Resource + private SupplierService supplierService; + + @PostMapping("/create") + @Operation(summary = "创建供应商") + @PreAuthorize("@ss.hasPermission('qms:supplier:create')") + public CommonResult createSupplier(@Valid @RequestBody SupplierSaveReqVO createReqVO) { + return success(supplierService.createSupplier(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新供应商") + @PreAuthorize("@ss.hasPermission('qms:supplier:update')") + public CommonResult updateSupplier(@Valid @RequestBody SupplierSaveReqVO updateReqVO) { + supplierService.updateSupplier(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除供应商") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('qms:supplier:delete')") + public CommonResult deleteSupplier(@RequestParam("id") Long id) { + supplierService.deleteSupplier(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除供应商") + @PreAuthorize("@ss.hasPermission('qms:supplier:delete')") + public CommonResult deleteSupplierList(@RequestBody BatchDeleteReqVO req) { + supplierService.deleteSupplierListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得供应商") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('qms:supplier:query')") + public CommonResult getSupplier(@RequestParam("id") Long id) { + SupplierDO supplier = supplierService.getSupplier(id); + return success(BeanUtils.toBean(supplier, SupplierRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得供应商分页") + @PreAuthorize("@ss.hasPermission('qms:supplier:query')") + public CommonResult> getSupplierPage(@Valid SupplierPageReqVO pageReqVO) { + PageResult pageResult = supplierService.getSupplierPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, SupplierRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出供应商 Excel") + @PreAuthorize("@ss.hasPermission('qms:supplier:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportSupplierExcel(@Valid SupplierPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = supplierService.getSupplierPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "供应商.xls", "数据", SupplierRespVO.class, + BeanUtils.toBean(list, SupplierRespVO.class)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/admin/SupplierEvaluationAtController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/admin/SupplierEvaluationAtController.java new file mode 100644 index 0000000..e1101a0 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/admin/SupplierEvaluationAtController.java @@ -0,0 +1,118 @@ +package com.zt.plat.module.qms.office.supplier.controller.admin; + +import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationAtPageReqVO; +import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationAtRespVO; +import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationAtSaveReqVO; +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.office.supplier.dal.dataobject.SupplierEvaluationAtDO; +import com.zt.plat.module.qms.office.supplier.service.SupplierEvaluationAtService; + +@Tag(name = "管理后台 - 供应商评价关系") +@RestController +@RequestMapping("/qms/supplier-evaluation-at") +@Validated +@FileUploadController(source = "qms.supplierevaluationat") +public class SupplierEvaluationAtController extends AbstractFileUploadController implements BusinessControllerMarker{ + + static { + FileUploadController annotation = SupplierEvaluationAtController.class.getAnnotation(FileUploadController.class); + if (annotation != null) { + setFileUploadInfo(annotation); + } + } + + @Resource + private SupplierEvaluationAtService supplierEvaluationAtService; + + @PostMapping("/create") + @Operation(summary = "创建供应商评价关系") + @PreAuthorize("@ss.hasPermission('qms:supplier-evaluation-at:create')") + public CommonResult createSupplierEvaluationAt(@Valid @RequestBody SupplierEvaluationAtSaveReqVO createReqVO) { + return success(supplierEvaluationAtService.createSupplierEvaluationAt(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新供应商评价关系") + @PreAuthorize("@ss.hasPermission('qms:supplier-evaluation-at:update')") + public CommonResult updateSupplierEvaluationAt(@Valid @RequestBody SupplierEvaluationAtSaveReqVO updateReqVO) { + supplierEvaluationAtService.updateSupplierEvaluationAt(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除供应商评价关系") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('qms:supplier-evaluation-at:delete')") + public CommonResult deleteSupplierEvaluationAt(@RequestParam("id") Long id) { + supplierEvaluationAtService.deleteSupplierEvaluationAt(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除供应商评价关系") + @PreAuthorize("@ss.hasPermission('qms:supplier-evaluation-at:delete')") + public CommonResult deleteSupplierEvaluationAtList(@RequestBody BatchDeleteReqVO req) { + supplierEvaluationAtService.deleteSupplierEvaluationAtListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得供应商评价关系") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('qms:supplier-evaluation-at:query')") + public CommonResult getSupplierEvaluationAt(@RequestParam("id") Long id) { + SupplierEvaluationAtDO supplierEvaluationAt = supplierEvaluationAtService.getSupplierEvaluationAt(id); + return success(BeanUtils.toBean(supplierEvaluationAt, SupplierEvaluationAtRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得供应商评价关系分页") + @PreAuthorize("@ss.hasPermission('qms:supplier-evaluation-at:query')") + public CommonResult> getSupplierEvaluationAtPage(@Valid SupplierEvaluationAtPageReqVO pageReqVO) { + PageResult pageResult = supplierEvaluationAtService.getSupplierEvaluationAtPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, SupplierEvaluationAtRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出供应商评价关系 Excel") + @PreAuthorize("@ss.hasPermission('qms:supplier-evaluation-at:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportSupplierEvaluationAtExcel(@Valid SupplierEvaluationAtPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = supplierEvaluationAtService.getSupplierEvaluationAtPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "供应商评价关系.xls", "数据", SupplierEvaluationAtRespVO.class, + BeanUtils.toBean(list, SupplierEvaluationAtRespVO.class)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/admin/SupplierEvaluationController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/admin/SupplierEvaluationController.java new file mode 100644 index 0000000..ca11044 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/admin/SupplierEvaluationController.java @@ -0,0 +1,118 @@ +package com.zt.plat.module.qms.office.supplier.controller.admin; + +import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationPageReqVO; +import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationRespVO; +import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationSaveReqVO; +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.office.supplier.dal.dataobject.SupplierEvaluationDO; +import com.zt.plat.module.qms.office.supplier.service.SupplierEvaluationService; + +@Tag(name = "管理后台 - 供应商评价") +@RestController +@RequestMapping("/qms/supplier-evaluation") +@Validated +@FileUploadController(source = "qms.supplierevaluation") +public class SupplierEvaluationController extends AbstractFileUploadController implements BusinessControllerMarker{ + + static { + FileUploadController annotation = SupplierEvaluationController.class.getAnnotation(FileUploadController.class); + if (annotation != null) { + setFileUploadInfo(annotation); + } + } + + @Resource + private SupplierEvaluationService supplierEvaluationService; + + @PostMapping("/create") + @Operation(summary = "创建供应商评价") + @PreAuthorize("@ss.hasPermission('qms:supplier-evaluation:create')") + public CommonResult createSupplierEvaluation(@Valid @RequestBody SupplierEvaluationSaveReqVO createReqVO) { + return success(supplierEvaluationService.createSupplierEvaluation(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新供应商评价") + @PreAuthorize("@ss.hasPermission('qms:supplier-evaluation:update')") + public CommonResult updateSupplierEvaluation(@Valid @RequestBody SupplierEvaluationSaveReqVO updateReqVO) { + supplierEvaluationService.updateSupplierEvaluation(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除供应商评价") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('qms:supplier-evaluation:delete')") + public CommonResult deleteSupplierEvaluation(@RequestParam("id") Long id) { + supplierEvaluationService.deleteSupplierEvaluation(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除供应商评价") + @PreAuthorize("@ss.hasPermission('qms:supplier-evaluation:delete')") + public CommonResult deleteSupplierEvaluationList(@RequestBody BatchDeleteReqVO req) { + supplierEvaluationService.deleteSupplierEvaluationListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得供应商评价") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('qms:supplier-evaluation:query')") + public CommonResult getSupplierEvaluation(@RequestParam("id") Long id) { + SupplierEvaluationDO supplierEvaluation = supplierEvaluationService.getSupplierEvaluation(id); + return success(BeanUtils.toBean(supplierEvaluation, SupplierEvaluationRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得供应商评价分页") + @PreAuthorize("@ss.hasPermission('qms:supplier-evaluation:query')") + public CommonResult> getSupplierEvaluationPage(@Valid SupplierEvaluationPageReqVO pageReqVO) { + PageResult pageResult = supplierEvaluationService.getSupplierEvaluationPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, SupplierEvaluationRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出供应商评价 Excel") + @PreAuthorize("@ss.hasPermission('qms:supplier-evaluation:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportSupplierEvaluationExcel(@Valid SupplierEvaluationPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = supplierEvaluationService.getSupplierEvaluationPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "供应商评价.xls", "数据", SupplierEvaluationRespVO.class, + BeanUtils.toBean(list, SupplierEvaluationRespVO.class)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/admin/SupplierPropertiesController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/admin/SupplierPropertiesController.java new file mode 100644 index 0000000..580d087 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/admin/SupplierPropertiesController.java @@ -0,0 +1,118 @@ +package com.zt.plat.module.qms.office.supplier.controller.admin; + +import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierPropertiesPageReqVO; +import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierPropertiesRespVO; +import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierPropertiesSaveReqVO; +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.office.supplier.dal.dataobject.SupplierPropertiesDO; +import com.zt.plat.module.qms.office.supplier.service.SupplierPropertiesService; + +@Tag(name = "管理后台 - 供应商属性") +@RestController +@RequestMapping("/qms/supplier-properties") +@Validated +@FileUploadController(source = "qms.supplierproperties") +public class SupplierPropertiesController extends AbstractFileUploadController implements BusinessControllerMarker{ + + static { + FileUploadController annotation = SupplierPropertiesController.class.getAnnotation(FileUploadController.class); + if (annotation != null) { + setFileUploadInfo(annotation); + } + } + + @Resource + private SupplierPropertiesService supplierPropertiesService; + + @PostMapping("/create") + @Operation(summary = "创建供应商属性") + @PreAuthorize("@ss.hasPermission('qms:supplier-properties:create')") + public CommonResult createSupplierProperties(@Valid @RequestBody SupplierPropertiesSaveReqVO createReqVO) { + return success(supplierPropertiesService.createSupplierProperties(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新供应商属性") + @PreAuthorize("@ss.hasPermission('qms:supplier-properties:update')") + public CommonResult updateSupplierProperties(@Valid @RequestBody SupplierPropertiesSaveReqVO updateReqVO) { + supplierPropertiesService.updateSupplierProperties(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除供应商属性") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('qms:supplier-properties:delete')") + public CommonResult deleteSupplierProperties(@RequestParam("id") Long id) { + supplierPropertiesService.deleteSupplierProperties(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除供应商属性") + @PreAuthorize("@ss.hasPermission('qms:supplier-properties:delete')") + public CommonResult deleteSupplierPropertiesList(@RequestBody BatchDeleteReqVO req) { + supplierPropertiesService.deleteSupplierPropertiesListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得供应商属性") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('qms:supplier-properties:query')") + public CommonResult getSupplierProperties(@RequestParam("id") Long id) { + SupplierPropertiesDO supplierProperties = supplierPropertiesService.getSupplierProperties(id); + return success(BeanUtils.toBean(supplierProperties, SupplierPropertiesRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得供应商属性分页") + @PreAuthorize("@ss.hasPermission('qms:supplier-properties:query')") + public CommonResult> getSupplierPropertiesPage(@Valid SupplierPropertiesPageReqVO pageReqVO) { + PageResult pageResult = supplierPropertiesService.getSupplierPropertiesPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, SupplierPropertiesRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出供应商属性 Excel") + @PreAuthorize("@ss.hasPermission('qms:supplier-properties:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportSupplierPropertiesExcel(@Valid SupplierPropertiesPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = supplierPropertiesService.getSupplierPropertiesPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "供应商属性.xls", "数据", SupplierPropertiesRespVO.class, + BeanUtils.toBean(list, SupplierPropertiesRespVO.class)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/vo/SupplierEvaluationAtPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/vo/SupplierEvaluationAtPageReqVO.java new file mode 100644 index 0000000..eaf8880 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/vo/SupplierEvaluationAtPageReqVO.java @@ -0,0 +1,34 @@ +package com.zt.plat.module.qms.office.supplier.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 SupplierEvaluationAtPageReqVO extends PageParam { + + @Schema(description = "评价id", example = "6160") + private Long supplierEvaluationId; + + @Schema(description = "目标对象id", example = "24374") + private Long targetId; + + @Schema(description = "目标对象类型,业务类型:设备实例、物料试剂、检定校准记录等", example = "2") + private String targetType; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/vo/SupplierEvaluationAtRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/vo/SupplierEvaluationAtRespVO.java new file mode 100644 index 0000000..c2250df --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/vo/SupplierEvaluationAtRespVO.java @@ -0,0 +1,42 @@ +package com.zt.plat.module.qms.office.supplier.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 SupplierEvaluationAtRespVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "2684") + @ExcelProperty("ID") + private Long id; + + @Schema(description = "评价id", requiredMode = Schema.RequiredMode.REQUIRED, example = "6160") + @ExcelProperty("评价id") + private Long supplierEvaluationId; + + @Schema(description = "目标对象id", requiredMode = Schema.RequiredMode.REQUIRED, example = "24374") + @ExcelProperty("目标对象id") + private Long targetId; + + @Schema(description = "目标对象类型,业务类型:设备实例、物料试剂、检定校准记录等", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") + @ExcelProperty("目标对象类型,业务类型:设备实例、物料试剂、检定校准记录等") + private String targetType; + + @Schema(description = "所属部门") + @ExcelProperty("所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + @ExcelProperty("备注") + private String remark; + + @Schema(description = "创建时间") + @ExcelProperty("创建时间") + private LocalDateTime createTime; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/vo/SupplierEvaluationAtSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/vo/SupplierEvaluationAtSaveReqVO.java new file mode 100644 index 0000000..c1c0ea6 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/vo/SupplierEvaluationAtSaveReqVO.java @@ -0,0 +1,32 @@ +package com.zt.plat.module.qms.office.supplier.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import jakarta.validation.constraints.*; + +@Schema(description = "管理后台 - 供应商评价关系新增/修改 Request VO") +@Data +public class SupplierEvaluationAtSaveReqVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "2684") + private Long id; + + @Schema(description = "评价id", requiredMode = Schema.RequiredMode.REQUIRED, example = "6160") + @NotNull(message = "评价id不能为空") + private Long supplierEvaluationId; + + @Schema(description = "目标对象id", requiredMode = Schema.RequiredMode.REQUIRED, example = "24374") + @NotNull(message = "目标对象id不能为空") + private Long targetId; + + @Schema(description = "目标对象类型,业务类型:设备实例、物料试剂、检定校准记录等", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") + @NotEmpty(message = "目标对象类型,业务类型:设备实例、物料试剂、检定校准记录等不能为空") + private String targetType; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/vo/SupplierEvaluationPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/vo/SupplierEvaluationPageReqVO.java new file mode 100644 index 0000000..1b67536 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/vo/SupplierEvaluationPageReqVO.java @@ -0,0 +1,53 @@ +package com.zt.plat.module.qms.office.supplier.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 SupplierEvaluationPageReqVO extends PageParam { + + @Schema(description = "供应商ID", example = "3346") + private Long supplierId; + + @Schema(description = "表单模板id", example = "32304") + private Long formId; + + @Schema(description = "评价内容") + private String content; + + @Schema(description = "评价结论") + private String conclusion; + + @Schema(description = "评价人") + private String evaluator; + + @Schema(description = "评价人id", example = "25943") + private Long evaluatorId; + + @Schema(description = "评价日期") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] evaluationDate; + + @Schema(description = "流程审批状态", example = "2") + private String flowStatus; + + @Schema(description = "流程实例id", example = "24931") + private String flowInstanceId; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/vo/SupplierEvaluationRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/vo/SupplierEvaluationRespVO.java new file mode 100644 index 0000000..bb2ea1b --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/vo/SupplierEvaluationRespVO.java @@ -0,0 +1,66 @@ +package com.zt.plat.module.qms.office.supplier.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 SupplierEvaluationRespVO { + + @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "31678") + @ExcelProperty("主键") + private Long id; + + @Schema(description = "供应商ID", example = "3346") + @ExcelProperty("供应商ID") + private Long supplierId; + + @Schema(description = "表单模板id", example = "32304") + @ExcelProperty("表单模板id") + private Long formId; + + @Schema(description = "评价内容") + @ExcelProperty("评价内容") + private String content; + + @Schema(description = "评价结论") + @ExcelProperty("评价结论") + private String conclusion; + + @Schema(description = "评价人") + @ExcelProperty("评价人") + private String evaluator; + + @Schema(description = "评价人id", example = "25943") + @ExcelProperty("评价人id") + private Long evaluatorId; + + @Schema(description = "评价日期") + @ExcelProperty("评价日期") + private LocalDateTime evaluationDate; + + @Schema(description = "流程审批状态", example = "2") + @ExcelProperty("流程审批状态") + private String flowStatus; + + @Schema(description = "流程实例id", example = "24931") + @ExcelProperty("流程实例id") + private String flowInstanceId; + + @Schema(description = "所属部门") + @ExcelProperty("所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + @ExcelProperty("备注") + private String remark; + + @Schema(description = "创建时间") + @ExcelProperty("创建时间") + private LocalDateTime createTime; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/vo/SupplierEvaluationSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/vo/SupplierEvaluationSaveReqVO.java new file mode 100644 index 0000000..5f208ce --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/vo/SupplierEvaluationSaveReqVO.java @@ -0,0 +1,48 @@ +package com.zt.plat.module.qms.office.supplier.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; + +import java.time.LocalDateTime; + +@Schema(description = "管理后台 - 供应商评价新增/修改 Request VO") +@Data +public class SupplierEvaluationSaveReqVO { + + @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "31678") + private Long id; + + @Schema(description = "供应商ID", example = "3346") + private Long supplierId; + + @Schema(description = "表单模板id", example = "32304") + private Long formId; + + @Schema(description = "评价内容") + private String content; + + @Schema(description = "评价结论") + private String conclusion; + + @Schema(description = "评价人") + private String evaluator; + + @Schema(description = "评价人id", example = "25943") + private Long evaluatorId; + + @Schema(description = "评价日期") + private LocalDateTime evaluationDate; + + @Schema(description = "流程审批状态", example = "2") + private String flowStatus; + + @Schema(description = "流程实例id", example = "24931") + private String flowInstanceId; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/vo/SupplierPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/vo/SupplierPageReqVO.java new file mode 100644 index 0000000..e00c5d0 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/vo/SupplierPageReqVO.java @@ -0,0 +1,49 @@ +package com.zt.plat.module.qms.office.supplier.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 SupplierPageReqVO extends PageParam { + + @Schema(description = "供应商名称", example = "张三") + private String name; + + @Schema(description = "编号") + private String code; + + @Schema(description = "类型", example = "1") + private String type; + + @Schema(description = "地址") + private String address; + + @Schema(description = "联系人") + private String contact; + + @Schema(description = "电话") + private String mobile; + + @Schema(description = "经营范围") + private String businessScope; + + @Schema(description = "禁用标识") + private String cancelFlag; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/vo/SupplierPropertiesPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/vo/SupplierPropertiesPageReqVO.java new file mode 100644 index 0000000..101fdba --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/vo/SupplierPropertiesPageReqVO.java @@ -0,0 +1,50 @@ +package com.zt.plat.module.qms.office.supplier.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.LocalDate; +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 SupplierPropertiesPageReqVO extends PageParam { + + @Schema(description = "供应商ID", example = "31214") + private Long supplierId; + + @Schema(description = "业务类型,【字典】【jy_supplier_bsn_type】供应商类型、资质、证照等", example = "1") + private String businessType; + + @Schema(description = "业务编码") + private String businessCode; + + @Schema(description = "子业务编码") + private String subitemCode; + + @Schema(description = "名称", example = "王五") + private String name; + + @Schema(description = "有效期开始") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] startDate; + + @Schema(description = "有效期截止") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] endDate; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/vo/SupplierPropertiesRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/vo/SupplierPropertiesRespVO.java new file mode 100644 index 0000000..d39ddb0 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/vo/SupplierPropertiesRespVO.java @@ -0,0 +1,59 @@ +package com.zt.plat.module.qms.office.supplier.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; + +import java.time.LocalDate; +import java.time.LocalDateTime; +import com.alibaba.excel.annotation.*; + +@Schema(description = "管理后台 - 供应商属性 Response VO") +@Data +@ExcelIgnoreUnannotated +public class SupplierPropertiesRespVO { + + @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "22878") + @ExcelProperty("主键") + private Long id; + + @Schema(description = "供应商ID", example = "31214") + @ExcelProperty("供应商ID") + private Long supplierId; + + @Schema(description = "业务类型,【字典】【jy_supplier_bsn_type】供应商类型、资质、证照等", example = "1") + @ExcelProperty("业务类型,【字典】【jy_supplier_bsn_type】供应商类型、资质、证照等") + private String businessType; + + @Schema(description = "业务编码") + @ExcelProperty("业务编码") + private String businessCode; + + @Schema(description = "子业务编码") + @ExcelProperty("子业务编码") + private String subitemCode; + + @Schema(description = "名称", example = "王五") + @ExcelProperty("名称") + private String name; + + @Schema(description = "有效期开始") + @ExcelProperty("有效期开始") + private LocalDateTime startDate; + + @Schema(description = "有效期截止") + @ExcelProperty("有效期截止") + private LocalDateTime endDate; + + @Schema(description = "所属部门") + @ExcelProperty("所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + @ExcelProperty("备注") + private String remark; + + @Schema(description = "创建时间") + @ExcelProperty("创建时间") + private LocalDateTime createTime; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/vo/SupplierPropertiesSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/vo/SupplierPropertiesSaveReqVO.java new file mode 100644 index 0000000..77a27cf --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/vo/SupplierPropertiesSaveReqVO.java @@ -0,0 +1,43 @@ +package com.zt.plat.module.qms.office.supplier.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; + +import java.time.LocalDate; +import java.time.LocalDateTime; + +@Schema(description = "管理后台 - 供应商属性新增/修改 Request VO") +@Data +public class SupplierPropertiesSaveReqVO { + + @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "22878") + private Long id; + + @Schema(description = "供应商ID", example = "31214") + private Long supplierId; + + @Schema(description = "业务类型,【字典】【jy_supplier_bsn_type】供应商类型、资质、证照等", example = "1") + private String businessType; + + @Schema(description = "业务编码") + private String businessCode; + + @Schema(description = "子业务编码") + private String subitemCode; + + @Schema(description = "名称", example = "王五") + private String name; + + @Schema(description = "有效期开始") + private LocalDateTime startDate; + + @Schema(description = "有效期截止") + private LocalDateTime endDate; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/vo/SupplierRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/vo/SupplierRespVO.java new file mode 100644 index 0000000..d120efc --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/vo/SupplierRespVO.java @@ -0,0 +1,62 @@ +package com.zt.plat.module.qms.office.supplier.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 SupplierRespVO { + + @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "15586") + @ExcelProperty("主键") + private Long id; + + @Schema(description = "供应商名称", example = "张三") + @ExcelProperty("供应商名称") + private String name; + + @Schema(description = "编号") + @ExcelProperty("编号") + private String code; + + @Schema(description = "类型", example = "1") + @ExcelProperty("类型") + private String type; + + @Schema(description = "地址") + @ExcelProperty("地址") + private String address; + + @Schema(description = "联系人") + @ExcelProperty("联系人") + private String contact; + + @Schema(description = "电话") + @ExcelProperty("电话") + private String mobile; + + @Schema(description = "经营范围") + @ExcelProperty("经营范围") + private String businessScope; + + @Schema(description = "禁用标识") + @ExcelProperty("禁用标识") + private String cancelFlag; + + @Schema(description = "所属部门") + @ExcelProperty("所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + @ExcelProperty("备注") + private String remark; + + @Schema(description = "创建时间") + @ExcelProperty("创建时间") + private LocalDateTime createTime; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/vo/SupplierSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/vo/SupplierSaveReqVO.java new file mode 100644 index 0000000..843cbfc --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/vo/SupplierSaveReqVO.java @@ -0,0 +1,43 @@ +package com.zt.plat.module.qms.office.supplier.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; + +@Schema(description = "管理后台 - 供应商新增/修改 Request VO") +@Data +public class SupplierSaveReqVO { + + @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "15586") + private Long id; + + @Schema(description = "供应商名称", example = "张三") + private String name; + + @Schema(description = "编号") + private String code; + + @Schema(description = "类型", example = "1") + private String type; + + @Schema(description = "地址") + private String address; + + @Schema(description = "联系人") + private String contact; + + @Schema(description = "电话") + private String mobile; + + @Schema(description = "经营范围") + private String businessScope; + + @Schema(description = "禁用标识") + private String cancelFlag; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/dal/dataobject/SupplierDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/dal/dataobject/SupplierDO.java new file mode 100644 index 0000000..08ad568 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/dal/dataobject/SupplierDO.java @@ -0,0 +1,81 @@ +package com.zt.plat.module.qms.office.supplier.dal.dataobject; + +import lombok.*; +import com.baomidou.mybatisplus.annotation.*; +import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; +/** +* 供应商 DO +* +* @author 后台管理 +*/ +@TableName("t_splr") +@KeySequence("t_splr_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class SupplierDO extends BusinessBaseDO { + + + + /** + * 主键 + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 供应商名称 + */ + @TableField("NAME") + private String name; + /** + * 编号 + */ + @TableField("CD") + private String code; + /** + * 类型 + */ + @TableField("TP") + private String type; + /** + * 地址 + */ + @TableField("ADR") + private String address; + /** + * 联系人 + */ + @TableField("CTCT") + private String contact; + /** + * 电话 + */ + @TableField("MOB") + private String mobile; + /** + * 经营范围 + */ + @TableField("BSN_SCO") + private String businessScope; + + //禁用标识 + @TableField("CNL_FLG") + private String cancelFlag; + /** + * 所属部门 + */ + @TableField("SYS_DEPT_CD") + private String systemDepartmentCode; + /** + * 备注 + */ + @TableField("RMK") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/dal/dataobject/SupplierEvaluationAtDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/dal/dataobject/SupplierEvaluationAtDO.java new file mode 100644 index 0000000..945983a --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/dal/dataobject/SupplierEvaluationAtDO.java @@ -0,0 +1,57 @@ +package com.zt.plat.module.qms.office.supplier.dal.dataobject; + +import lombok.*; +import com.baomidou.mybatisplus.annotation.*; +import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; +/** +* 供应商评价关系 DO +* +* @author 后台管理 +*/ +@TableName("t_splr_evl_at") +@KeySequence("t_splr_evl_at_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class SupplierEvaluationAtDO extends BusinessBaseDO { + + + + /** + * ID + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 评价id + */ + @TableField("SPLR_EVL_ID") + private Long supplierEvaluationId; + /** + * 目标对象id + */ + @TableField("TGT_ID") + private Long targetId; + /** + * 目标对象类型,业务类型:设备实例、物料试剂、检定校准记录等 + */ + @TableField("TGT_TP") + private String targetType; + /** + * 所属部门 + */ + @TableField("SYS_DEPT_CD") + private String systemDepartmentCode; + /** + * 备注 + */ + @TableField("RMK") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/dal/dataobject/SupplierEvaluationDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/dal/dataobject/SupplierEvaluationDO.java new file mode 100644 index 0000000..c0e1fbb --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/dal/dataobject/SupplierEvaluationDO.java @@ -0,0 +1,90 @@ +package com.zt.plat.module.qms.office.supplier.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_splr_evl") +@KeySequence("t_splr_evl_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class SupplierEvaluationDO extends BusinessBaseDO { + + + + /** + * 主键 + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 供应商ID + */ + @TableField("SPLR_ID") + private Long supplierId; + /** + * 表单模板id + */ + @TableField("FORM_ID") + private Long formId; + /** + * 评价内容 + */ + @TableField("CNTT") + private String content; + /** + * 评价结论 + */ + @TableField("CNCL") + private String conclusion; + /** + * 评价人 + */ + @TableField("EVLR") + private String evaluator; + /** + * 评价人id + */ + @TableField("EVLR_ID") + private Long evaluatorId; + /** + * 评价日期 + */ + @TableField("EVL_DT") + private LocalDateTime evaluationDate; + /** + * 流程审批状态 + */ + @TableField("FLW_STS") + private String flowStatus; + /** + * 流程实例id + */ + @TableField("FLW_INSC_ID") + private String flowInstanceId; + /** + * 所属部门 + */ + @TableField("SYS_DEPT_CD") + private String systemDepartmentCode; + /** + * 备注 + */ + @TableField("RMK") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/dal/dataobject/SupplierPropertiesDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/dal/dataobject/SupplierPropertiesDO.java new file mode 100644 index 0000000..d74a2a4 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/dal/dataobject/SupplierPropertiesDO.java @@ -0,0 +1,81 @@ +package com.zt.plat.module.qms.office.supplier.dal.dataobject; + +import lombok.*; +import com.baomidou.mybatisplus.annotation.*; +import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; + +import java.time.LocalDate; +import java.time.LocalDateTime; + +/** +* 供应商属性 DO +* +* @author 后台管理 +*/ +@TableName("t_splr_prps") +@KeySequence("t_splr_prps_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class SupplierPropertiesDO extends BusinessBaseDO { + + + + /** + * 主键 + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 供应商ID + */ + @TableField("SPLR_ID") + private Long supplierId; + /** + * 业务类型,【字典】【jy_supplier_bsn_type】供应商类型、资质、证照等 + */ + @TableField("BSN_TP") + private String businessType; + /** + * 业务编码 + */ + @TableField("BSN_CD") + private String businessCode; + /** + * 子业务编码 + */ + @TableField("SUB_CD") + private String subitemCode; + /** + * 名称 + */ + @TableField("NAME") + private String name; + /** + * 有效期开始 + */ + @TableField("STRT_DT") + private LocalDateTime startDate; + /** + * 有效期截止 + */ + @TableField("END_DT") + private LocalDateTime endDate; + /** + * 所属部门 + */ + @TableField("SYS_DEPT_CD") + private String systemDepartmentCode; + /** + * 备注 + */ + @TableField("RMK") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/dal/mapper/SupplierEvaluationAtMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/dal/mapper/SupplierEvaluationAtMapper.java new file mode 100644 index 0000000..71df810 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/dal/mapper/SupplierEvaluationAtMapper.java @@ -0,0 +1,29 @@ +package com.zt.plat.module.qms.office.supplier.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.office.supplier.dal.dataobject.SupplierEvaluationAtDO; +import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationAtPageReqVO; +import org.apache.ibatis.annotations.Mapper; + +/** + * 供应商评价关系 Mapper + * + * @author 后台管理 + */ +@Mapper +public interface SupplierEvaluationAtMapper extends BaseMapperX { + + default PageResult selectPage(SupplierEvaluationAtPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(SupplierEvaluationAtDO::getSupplierEvaluationId, reqVO.getSupplierEvaluationId()) + .eqIfPresent(SupplierEvaluationAtDO::getTargetId, reqVO.getTargetId()) + .eqIfPresent(SupplierEvaluationAtDO::getTargetType, reqVO.getTargetType()) + .eqIfPresent(SupplierEvaluationAtDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .eqIfPresent(SupplierEvaluationAtDO::getRemark, reqVO.getRemark()) + .betweenIfPresent(SupplierEvaluationAtDO::getCreateTime, reqVO.getCreateTime()) + .orderByDesc(SupplierEvaluationAtDO::getId)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/dal/mapper/SupplierEvaluationMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/dal/mapper/SupplierEvaluationMapper.java new file mode 100644 index 0000000..c2e5388 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/dal/mapper/SupplierEvaluationMapper.java @@ -0,0 +1,35 @@ +package com.zt.plat.module.qms.office.supplier.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.office.supplier.dal.dataobject.SupplierEvaluationDO; +import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationPageReqVO; +import org.apache.ibatis.annotations.Mapper; + +/** + * 供应商评价 Mapper + * + * @author 后台管理 + */ +@Mapper +public interface SupplierEvaluationMapper extends BaseMapperX { + + default PageResult selectPage(SupplierEvaluationPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(SupplierEvaluationDO::getSupplierId, reqVO.getSupplierId()) + .eqIfPresent(SupplierEvaluationDO::getFormId, reqVO.getFormId()) + .eqIfPresent(SupplierEvaluationDO::getContent, reqVO.getContent()) + .eqIfPresent(SupplierEvaluationDO::getConclusion, reqVO.getConclusion()) + .eqIfPresent(SupplierEvaluationDO::getEvaluator, reqVO.getEvaluator()) + .eqIfPresent(SupplierEvaluationDO::getEvaluatorId, reqVO.getEvaluatorId()) + .betweenIfPresent(SupplierEvaluationDO::getEvaluationDate, reqVO.getEvaluationDate()) + .eqIfPresent(SupplierEvaluationDO::getFlowStatus, reqVO.getFlowStatus()) + .eqIfPresent(SupplierEvaluationDO::getFlowInstanceId, reqVO.getFlowInstanceId()) + .eqIfPresent(SupplierEvaluationDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .eqIfPresent(SupplierEvaluationDO::getRemark, reqVO.getRemark()) + .betweenIfPresent(SupplierEvaluationDO::getCreateTime, reqVO.getCreateTime()) + .orderByDesc(SupplierEvaluationDO::getId)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/dal/mapper/SupplierMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/dal/mapper/SupplierMapper.java new file mode 100644 index 0000000..dc232d4 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/dal/mapper/SupplierMapper.java @@ -0,0 +1,33 @@ +package com.zt.plat.module.qms.office.supplier.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.office.supplier.dal.dataobject.SupplierDO; +import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierPageReqVO; +import org.apache.ibatis.annotations.Mapper; + +/** + * 供应商 Mapper + * + * @author 后台管理 + */ +@Mapper +public interface SupplierMapper extends BaseMapperX { + + default PageResult selectPage(SupplierPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .likeIfPresent(SupplierDO::getName, reqVO.getName()) + .eqIfPresent(SupplierDO::getCode, reqVO.getCode()) + .eqIfPresent(SupplierDO::getType, reqVO.getType()) + .eqIfPresent(SupplierDO::getAddress, reqVO.getAddress()) + .eqIfPresent(SupplierDO::getContact, reqVO.getContact()) + .eqIfPresent(SupplierDO::getMobile, reqVO.getMobile()) + .eqIfPresent(SupplierDO::getBusinessScope, reqVO.getBusinessScope()) + .eqIfPresent(SupplierDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .eqIfPresent(SupplierDO::getRemark, reqVO.getRemark()) + .betweenIfPresent(SupplierDO::getCreateTime, reqVO.getCreateTime()) + .orderByDesc(SupplierDO::getId)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/dal/mapper/SupplierPropertiesMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/dal/mapper/SupplierPropertiesMapper.java new file mode 100644 index 0000000..89ecc1e --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/dal/mapper/SupplierPropertiesMapper.java @@ -0,0 +1,33 @@ +package com.zt.plat.module.qms.office.supplier.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.office.supplier.dal.dataobject.SupplierPropertiesDO; +import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierPropertiesPageReqVO; +import org.apache.ibatis.annotations.Mapper; + +/** + * 供应商属性 Mapper + * + * @author 后台管理 + */ +@Mapper +public interface SupplierPropertiesMapper extends BaseMapperX { + + default PageResult selectPage(SupplierPropertiesPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(SupplierPropertiesDO::getSupplierId, reqVO.getSupplierId()) + .eqIfPresent(SupplierPropertiesDO::getBusinessType, reqVO.getBusinessType()) + .eqIfPresent(SupplierPropertiesDO::getBusinessCode, reqVO.getBusinessCode()) + .eqIfPresent(SupplierPropertiesDO::getSubitemCode, reqVO.getSubitemCode()) + .likeIfPresent(SupplierPropertiesDO::getName, reqVO.getName()) + .betweenIfPresent(SupplierPropertiesDO::getStartDate, reqVO.getStartDate()) + .betweenIfPresent(SupplierPropertiesDO::getEndDate, reqVO.getEndDate()) + .eqIfPresent(SupplierPropertiesDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .eqIfPresent(SupplierPropertiesDO::getRemark, reqVO.getRemark()) + .betweenIfPresent(SupplierPropertiesDO::getCreateTime, reqVO.getCreateTime()) + .orderByDesc(SupplierPropertiesDO::getId)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/service/SupplierEvaluationAtService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/service/SupplierEvaluationAtService.java new file mode 100644 index 0000000..6fc9006 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/service/SupplierEvaluationAtService.java @@ -0,0 +1,64 @@ +package com.zt.plat.module.qms.office.supplier.service; + +import java.util.*; + +import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationAtPageReqVO; +import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationAtRespVO; +import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationAtSaveReqVO; +import jakarta.validation.*; +import com.zt.plat.module.qms.office.supplier.dal.dataobject.SupplierEvaluationAtDO; +import com.zt.plat.framework.common.pojo.PageResult; + +/** + * 供应商评价关系 Service 接口 + * + * @author 后台管理 + */ +public interface SupplierEvaluationAtService { + + /** + * 创建供应商评价关系 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + SupplierEvaluationAtRespVO createSupplierEvaluationAt(@Valid SupplierEvaluationAtSaveReqVO createReqVO); + + /** + * 更新供应商评价关系 + * + * @param updateReqVO 更新信息 + */ + void updateSupplierEvaluationAt(@Valid SupplierEvaluationAtSaveReqVO updateReqVO); + + /** + * 删除供应商评价关系 + * + * @param id 编号 + */ + void deleteSupplierEvaluationAt(Long id); + + /** + * 批量删除供应商评价关系 + * + * @param ids 编号 + */ + void deleteSupplierEvaluationAtListByIds(List ids); + + /** + * 获得供应商评价关系 + * + * @param id 编号 + * @return 供应商评价关系 + */ + SupplierEvaluationAtDO getSupplierEvaluationAt(Long id); + + /** + * 获得供应商评价关系分页 + * + * @param pageReqVO 分页查询 + * @return 供应商评价关系分页 + */ + PageResult getSupplierEvaluationAtPage(SupplierEvaluationAtPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/service/SupplierEvaluationAtServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/service/SupplierEvaluationAtServiceImpl.java new file mode 100644 index 0000000..b2eadc2 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/service/SupplierEvaluationAtServiceImpl.java @@ -0,0 +1,92 @@ +package com.zt.plat.module.qms.office.supplier.service; + +import cn.hutool.core.collection.CollUtil; +import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationAtPageReqVO; +import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationAtRespVO; +import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationAtSaveReqVO; +import org.springframework.stereotype.Service; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; + +import java.util.*; + +import com.zt.plat.module.qms.office.supplier.dal.dataobject.SupplierEvaluationAtDO; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.util.object.BeanUtils; + +import com.zt.plat.module.qms.office.supplier.dal.mapper.SupplierEvaluationAtMapper; + +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 SupplierEvaluationAtServiceImpl implements SupplierEvaluationAtService { + + @Resource + private SupplierEvaluationAtMapper supplierEvaluationAtMapper; + + @Override + public SupplierEvaluationAtRespVO createSupplierEvaluationAt(SupplierEvaluationAtSaveReqVO createReqVO) { + // 插入 + SupplierEvaluationAtDO supplierEvaluationAt = BeanUtils.toBean(createReqVO, SupplierEvaluationAtDO.class); + supplierEvaluationAtMapper.insert(supplierEvaluationAt); + // 返回 + return BeanUtils.toBean(supplierEvaluationAt, SupplierEvaluationAtRespVO.class); + } + + @Override + public void updateSupplierEvaluationAt(SupplierEvaluationAtSaveReqVO updateReqVO) { + // 校验存在 + validateSupplierEvaluationAtExists(updateReqVO.getId()); + // 更新 + SupplierEvaluationAtDO updateObj = BeanUtils.toBean(updateReqVO, SupplierEvaluationAtDO.class); + supplierEvaluationAtMapper.updateById(updateObj); + } + + @Override + public void deleteSupplierEvaluationAt(Long id) { + // 校验存在 + validateSupplierEvaluationAtExists(id); + // 删除 + supplierEvaluationAtMapper.deleteById(id); + } + + @Override + public void deleteSupplierEvaluationAtListByIds(List ids) { + // 校验存在 + validateSupplierEvaluationAtExists(ids); + // 删除 + supplierEvaluationAtMapper.deleteByIds(ids); + } + + private void validateSupplierEvaluationAtExists(List ids) { + List list = supplierEvaluationAtMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(SUPPLIER_EVALUATION_AT_NOT_EXISTS); + } + } + + private void validateSupplierEvaluationAtExists(Long id) { + if (supplierEvaluationAtMapper.selectById(id) == null) { + throw exception(SUPPLIER_EVALUATION_AT_NOT_EXISTS); + } + } + + @Override + public SupplierEvaluationAtDO getSupplierEvaluationAt(Long id) { + return supplierEvaluationAtMapper.selectById(id); + } + + @Override + public PageResult getSupplierEvaluationAtPage(SupplierEvaluationAtPageReqVO pageReqVO) { + return supplierEvaluationAtMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/service/SupplierEvaluationService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/service/SupplierEvaluationService.java new file mode 100644 index 0000000..5eff693 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/service/SupplierEvaluationService.java @@ -0,0 +1,64 @@ +package com.zt.plat.module.qms.office.supplier.service; + +import java.util.*; + +import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationPageReqVO; +import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationRespVO; +import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationSaveReqVO; +import jakarta.validation.*; +import com.zt.plat.module.qms.office.supplier.dal.dataobject.SupplierEvaluationDO; +import com.zt.plat.framework.common.pojo.PageResult; + +/** + * 供应商评价 Service 接口 + * + * @author 后台管理 + */ +public interface SupplierEvaluationService { + + /** + * 创建供应商评价 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + SupplierEvaluationRespVO createSupplierEvaluation(@Valid SupplierEvaluationSaveReqVO createReqVO); + + /** + * 更新供应商评价 + * + * @param updateReqVO 更新信息 + */ + void updateSupplierEvaluation(@Valid SupplierEvaluationSaveReqVO updateReqVO); + + /** + * 删除供应商评价 + * + * @param id 编号 + */ + void deleteSupplierEvaluation(Long id); + + /** + * 批量删除供应商评价 + * + * @param ids 编号 + */ + void deleteSupplierEvaluationListByIds(List ids); + + /** + * 获得供应商评价 + * + * @param id 编号 + * @return 供应商评价 + */ + SupplierEvaluationDO getSupplierEvaluation(Long id); + + /** + * 获得供应商评价分页 + * + * @param pageReqVO 分页查询 + * @return 供应商评价分页 + */ + PageResult getSupplierEvaluationPage(SupplierEvaluationPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/service/SupplierEvaluationServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/service/SupplierEvaluationServiceImpl.java new file mode 100644 index 0000000..e19b7e8 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/service/SupplierEvaluationServiceImpl.java @@ -0,0 +1,92 @@ +package com.zt.plat.module.qms.office.supplier.service; + +import cn.hutool.core.collection.CollUtil; +import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationPageReqVO; +import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationRespVO; +import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationSaveReqVO; +import org.springframework.stereotype.Service; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; + +import java.util.*; + +import com.zt.plat.module.qms.office.supplier.dal.dataobject.SupplierEvaluationDO; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.util.object.BeanUtils; + +import com.zt.plat.module.qms.office.supplier.dal.mapper.SupplierEvaluationMapper; + +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 SupplierEvaluationServiceImpl implements SupplierEvaluationService { + + @Resource + private SupplierEvaluationMapper supplierEvaluationMapper; + + @Override + public SupplierEvaluationRespVO createSupplierEvaluation(SupplierEvaluationSaveReqVO createReqVO) { + // 插入 + SupplierEvaluationDO supplierEvaluation = BeanUtils.toBean(createReqVO, SupplierEvaluationDO.class); + supplierEvaluationMapper.insert(supplierEvaluation); + // 返回 + return BeanUtils.toBean(supplierEvaluation, SupplierEvaluationRespVO.class); + } + + @Override + public void updateSupplierEvaluation(SupplierEvaluationSaveReqVO updateReqVO) { + // 校验存在 + validateSupplierEvaluationExists(updateReqVO.getId()); + // 更新 + SupplierEvaluationDO updateObj = BeanUtils.toBean(updateReqVO, SupplierEvaluationDO.class); + supplierEvaluationMapper.updateById(updateObj); + } + + @Override + public void deleteSupplierEvaluation(Long id) { + // 校验存在 + validateSupplierEvaluationExists(id); + // 删除 + supplierEvaluationMapper.deleteById(id); + } + + @Override + public void deleteSupplierEvaluationListByIds(List ids) { + // 校验存在 + validateSupplierEvaluationExists(ids); + // 删除 + supplierEvaluationMapper.deleteByIds(ids); + } + + private void validateSupplierEvaluationExists(List ids) { + List list = supplierEvaluationMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(SUPPLIER_EVALUATION_NOT_EXISTS); + } + } + + private void validateSupplierEvaluationExists(Long id) { + if (supplierEvaluationMapper.selectById(id) == null) { + throw exception(SUPPLIER_EVALUATION_NOT_EXISTS); + } + } + + @Override + public SupplierEvaluationDO getSupplierEvaluation(Long id) { + return supplierEvaluationMapper.selectById(id); + } + + @Override + public PageResult getSupplierEvaluationPage(SupplierEvaluationPageReqVO pageReqVO) { + return supplierEvaluationMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/service/SupplierPropertiesService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/service/SupplierPropertiesService.java new file mode 100644 index 0000000..dbd1b61 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/service/SupplierPropertiesService.java @@ -0,0 +1,64 @@ +package com.zt.plat.module.qms.office.supplier.service; + +import java.util.*; + +import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierPropertiesPageReqVO; +import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierPropertiesRespVO; +import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierPropertiesSaveReqVO; +import jakarta.validation.*; +import com.zt.plat.module.qms.office.supplier.dal.dataobject.SupplierPropertiesDO; +import com.zt.plat.framework.common.pojo.PageResult; + +/** + * 供应商属性 Service 接口 + * + * @author 后台管理 + */ +public interface SupplierPropertiesService { + + /** + * 创建供应商属性 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + SupplierPropertiesRespVO createSupplierProperties(@Valid SupplierPropertiesSaveReqVO createReqVO); + + /** + * 更新供应商属性 + * + * @param updateReqVO 更新信息 + */ + void updateSupplierProperties(@Valid SupplierPropertiesSaveReqVO updateReqVO); + + /** + * 删除供应商属性 + * + * @param id 编号 + */ + void deleteSupplierProperties(Long id); + + /** + * 批量删除供应商属性 + * + * @param ids 编号 + */ + void deleteSupplierPropertiesListByIds(List ids); + + /** + * 获得供应商属性 + * + * @param id 编号 + * @return 供应商属性 + */ + SupplierPropertiesDO getSupplierProperties(Long id); + + /** + * 获得供应商属性分页 + * + * @param pageReqVO 分页查询 + * @return 供应商属性分页 + */ + PageResult getSupplierPropertiesPage(SupplierPropertiesPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/service/SupplierPropertiesServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/service/SupplierPropertiesServiceImpl.java new file mode 100644 index 0000000..7b08e56 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/service/SupplierPropertiesServiceImpl.java @@ -0,0 +1,92 @@ +package com.zt.plat.module.qms.office.supplier.service; + +import cn.hutool.core.collection.CollUtil; +import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierPropertiesPageReqVO; +import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierPropertiesRespVO; +import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierPropertiesSaveReqVO; +import org.springframework.stereotype.Service; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; + +import java.util.*; + +import com.zt.plat.module.qms.office.supplier.dal.dataobject.SupplierPropertiesDO; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.util.object.BeanUtils; + +import com.zt.plat.module.qms.office.supplier.dal.mapper.SupplierPropertiesMapper; + +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 SupplierPropertiesServiceImpl implements SupplierPropertiesService { + + @Resource + private SupplierPropertiesMapper supplierPropertiesMapper; + + @Override + public SupplierPropertiesRespVO createSupplierProperties(SupplierPropertiesSaveReqVO createReqVO) { + // 插入 + SupplierPropertiesDO supplierProperties = BeanUtils.toBean(createReqVO, SupplierPropertiesDO.class); + supplierPropertiesMapper.insert(supplierProperties); + // 返回 + return BeanUtils.toBean(supplierProperties, SupplierPropertiesRespVO.class); + } + + @Override + public void updateSupplierProperties(SupplierPropertiesSaveReqVO updateReqVO) { + // 校验存在 + validateSupplierPropertiesExists(updateReqVO.getId()); + // 更新 + SupplierPropertiesDO updateObj = BeanUtils.toBean(updateReqVO, SupplierPropertiesDO.class); + supplierPropertiesMapper.updateById(updateObj); + } + + @Override + public void deleteSupplierProperties(Long id) { + // 校验存在 + validateSupplierPropertiesExists(id); + // 删除 + supplierPropertiesMapper.deleteById(id); + } + + @Override + public void deleteSupplierPropertiesListByIds(List ids) { + // 校验存在 + validateSupplierPropertiesExists(ids); + // 删除 + supplierPropertiesMapper.deleteByIds(ids); + } + + private void validateSupplierPropertiesExists(List ids) { + List list = supplierPropertiesMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(SUPPLIER_PROPERTIES_NOT_EXISTS); + } + } + + private void validateSupplierPropertiesExists(Long id) { + if (supplierPropertiesMapper.selectById(id) == null) { + throw exception(SUPPLIER_PROPERTIES_NOT_EXISTS); + } + } + + @Override + public SupplierPropertiesDO getSupplierProperties(Long id) { + return supplierPropertiesMapper.selectById(id); + } + + @Override + public PageResult getSupplierPropertiesPage(SupplierPropertiesPageReqVO pageReqVO) { + return supplierPropertiesMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/service/SupplierService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/service/SupplierService.java new file mode 100644 index 0000000..003ca82 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/service/SupplierService.java @@ -0,0 +1,64 @@ +package com.zt.plat.module.qms.office.supplier.service; + +import java.util.*; + +import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierPageReqVO; +import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierRespVO; +import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierSaveReqVO; +import jakarta.validation.*; +import com.zt.plat.module.qms.office.supplier.dal.dataobject.SupplierDO; +import com.zt.plat.framework.common.pojo.PageResult; + +/** + * 供应商 Service 接口 + * + * @author 后台管理 + */ +public interface SupplierService { + + /** + * 创建供应商 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + SupplierRespVO createSupplier(@Valid SupplierSaveReqVO createReqVO); + + /** + * 更新供应商 + * + * @param updateReqVO 更新信息 + */ + void updateSupplier(@Valid SupplierSaveReqVO updateReqVO); + + /** + * 删除供应商 + * + * @param id 编号 + */ + void deleteSupplier(Long id); + + /** + * 批量删除供应商 + * + * @param ids 编号 + */ + void deleteSupplierListByIds(List ids); + + /** + * 获得供应商 + * + * @param id 编号 + * @return 供应商 + */ + SupplierDO getSupplier(Long id); + + /** + * 获得供应商分页 + * + * @param pageReqVO 分页查询 + * @return 供应商分页 + */ + PageResult getSupplierPage(SupplierPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/service/SupplierServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/service/SupplierServiceImpl.java new file mode 100644 index 0000000..867d750 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/service/SupplierServiceImpl.java @@ -0,0 +1,92 @@ +package com.zt.plat.module.qms.office.supplier.service; + +import cn.hutool.core.collection.CollUtil; +import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierPageReqVO; +import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierRespVO; +import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierSaveReqVO; +import org.springframework.stereotype.Service; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; + +import java.util.*; + +import com.zt.plat.module.qms.office.supplier.dal.dataobject.SupplierDO; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.util.object.BeanUtils; + +import com.zt.plat.module.qms.office.supplier.dal.mapper.SupplierMapper; + +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 SupplierServiceImpl implements SupplierService { + + @Resource + private SupplierMapper supplierMapper; + + @Override + public SupplierRespVO createSupplier(SupplierSaveReqVO createReqVO) { + // 插入 + SupplierDO supplier = BeanUtils.toBean(createReqVO, SupplierDO.class); + supplierMapper.insert(supplier); + // 返回 + return BeanUtils.toBean(supplier, SupplierRespVO.class); + } + + @Override + public void updateSupplier(SupplierSaveReqVO updateReqVO) { + // 校验存在 + validateSupplierExists(updateReqVO.getId()); + // 更新 + SupplierDO updateObj = BeanUtils.toBean(updateReqVO, SupplierDO.class); + supplierMapper.updateById(updateObj); + } + + @Override + public void deleteSupplier(Long id) { + // 校验存在 + validateSupplierExists(id); + // 删除 + supplierMapper.deleteById(id); + } + + @Override + public void deleteSupplierListByIds(List ids) { + // 校验存在 + validateSupplierExists(ids); + // 删除 + supplierMapper.deleteByIds(ids); + } + + private void validateSupplierExists(List ids) { + List list = supplierMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(SUPPLIER_NOT_EXISTS); + } + } + + private void validateSupplierExists(Long id) { + if (supplierMapper.selectById(id) == null) { + throw exception(SUPPLIER_NOT_EXISTS); + } + } + + @Override + public SupplierDO getSupplier(Long id) { + return supplierMapper.selectById(id); + } + + @Override + public PageResult getSupplierPage(SupplierPageReqVO pageReqVO) { + return supplierMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/clientManage/VersionManagementConst.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/clientManage/VersionManagementConst.java new file mode 100644 index 0000000..87b3467 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/clientManage/VersionManagementConst.java @@ -0,0 +1,8 @@ +package com.zt.plat.module.qms.resource.clientManage; + +public class VersionManagementConst { + + public static final String UPDATE_TYPE_WAITING = "0"; //未发布 + public static final String PUBLISH_FLAG_PUBLISH = "1"; //已发布 + public static final String PUBLISH_FLAG_OFFLINE = "2"; //下线 +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/clientManage/controller/admin/VersionManagementController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/clientManage/controller/admin/VersionManagementController.java new file mode 100644 index 0000000..010dc76 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/clientManage/controller/admin/VersionManagementController.java @@ -0,0 +1,142 @@ +package com.zt.plat.module.qms.resource.clientManage.controller.admin; + +import com.zt.plat.module.qms.resource.clientManage.controller.vo.VersionManagementPageReqVO; +import com.zt.plat.module.qms.resource.clientManage.controller.vo.VersionManagementRespVO; +import com.zt.plat.module.qms.resource.clientManage.controller.vo.VersionManagementSaveReqVO; +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.clientManage.dal.dataobject.VersionManagementDO; +import com.zt.plat.module.qms.resource.clientManage.service.VersionManagementService; + +@Tag(name = "管理后台 - 客户端版本管理") +@RestController +@RequestMapping("/qms/version-management") +@Validated +@FileUploadController(source = "qms.versionmanagement") +public class VersionManagementController extends AbstractFileUploadController implements BusinessControllerMarker{ + + static { + FileUploadController annotation = VersionManagementController.class.getAnnotation(FileUploadController.class); + if (annotation != null) { + setFileUploadInfo(annotation); + } + } + + @Resource + private VersionManagementService systemVersionManagementService; + + @PostMapping("/create") + @Operation(summary = "创建客户端版本管理") + @PreAuthorize("@ss.hasPermission('qms:version-management:create')") + public CommonResult createSystemVersionManagement(@Valid @RequestBody VersionManagementSaveReqVO createReqVO) { + return success(systemVersionManagementService.createVersionManagement(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新客户端版本管理") + @PreAuthorize("@ss.hasPermission('qms:version-management:update')") + public CommonResult updateSystemVersionManagement(@Valid @RequestBody VersionManagementSaveReqVO updateReqVO) { + systemVersionManagementService.updateVersionManagement(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除客户端版本管理") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('qms:version-management:delete')") + public CommonResult deleteSystemVersionManagement(@RequestParam("id") Long id) { + systemVersionManagementService.deleteVersionManagement(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除客户端版本管理") + @PreAuthorize("@ss.hasPermission('qms:version-management:delete')") + public CommonResult deleteSystemVersionManagementList(@RequestBody BatchDeleteReqVO req) { + systemVersionManagementService.deleteSystemVersionManagementListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得客户端版本管理") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('qms:version-management:query')") + public CommonResult getSystemVersionManagement(@RequestParam("id") Long id) { + VersionManagementDO systemVersionManagement = systemVersionManagementService.getVersionManagement(id); + return success(BeanUtils.toBean(systemVersionManagement, VersionManagementRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得客户端版本管理分页") + @PreAuthorize("@ss.hasPermission('qms:version-management:query')") + public CommonResult> getSystemVersionManagementPage(@Valid VersionManagementPageReqVO pageReqVO) { + PageResult pageResult = systemVersionManagementService.getVersionManagementPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, VersionManagementRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出客户端版本管理 Excel") + @PreAuthorize("@ss.hasPermission('qms:version-management:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportSystemVersionManagementExcel(@Valid VersionManagementPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = systemVersionManagementService.getVersionManagementPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "客户端版本管理.xls", "数据", VersionManagementRespVO.class, + BeanUtils.toBean(list, VersionManagementRespVO.class)); + } + + + @GetMapping("/checkUpdate") + @Operation(summary = "根据更新平台和安装包类型获取最新客户端版本管理信息") + public CommonResult checkUpdate(@Valid VersionManagementPageReqVO pageReqVO) { + + if (pageReqVO.getApplicationCode() == null ) { + return CommonResult.error(400, "客户端编号不能为空"); + } + if (pageReqVO.getUpdatePlatform() == null ) { + return CommonResult.error(400, "更新平台不能为空"); + } + PageResult pageResult = systemVersionManagementService.getList(pageReqVO); + if (pageResult.getList().size() == 0) { + return CommonResult.error(400, "没有可更新版本"); + } + VersionManagementDO versionManagementDO = pageResult.getList().get(0); + return success(BeanUtils.toBean(versionManagementDO, VersionManagementRespVO.class)); + } + + @GetMapping("/executePublish") + CommonResult executePublish(@RequestParam("id") Long id) { + systemVersionManagementService.executePublish(id); + return success("发布成功"); + } +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/clientManage/controller/vo/UploadFileVo.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/clientManage/controller/vo/UploadFileVo.java new file mode 100644 index 0000000..99e41d9 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/clientManage/controller/vo/UploadFileVo.java @@ -0,0 +1,23 @@ +package com.zt.plat.module.qms.resource.clientManage.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Schema(description = "附件实例") +@Data +public class UploadFileVo { + private String id; + + private String url; + + private String name; + + private String uid; + + private String status; + + private String md5; + + private String sha1; + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/clientManage/controller/vo/VersionManagementPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/clientManage/controller/vo/VersionManagementPageReqVO.java new file mode 100644 index 0000000..bbc1a13 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/clientManage/controller/vo/VersionManagementPageReqVO.java @@ -0,0 +1,46 @@ +package com.zt.plat.module.qms.resource.clientManage.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 VersionManagementPageReqVO extends PageParam { + + @Schema(description = "客户端code", example = "赵六") + private String applicationCode; + + @Schema(description = "客户端名称", example = "赵六") + private String applicationName; + + @Schema(description = "更新标题") + private String updateTitle; + + @Schema(description = "更新内容") + private String updateContent; + + @Schema(description = "更新平台") + private String updatePlatform; + + @Schema(description = "安装包类型") + private String updateType; + + @Schema(description = "发布状态") + private String publishFlag; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建人") + private String creator; + + @Schema(description = "创建日期") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/clientManage/controller/vo/VersionManagementRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/clientManage/controller/vo/VersionManagementRespVO.java new file mode 100644 index 0000000..2442687 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/clientManage/controller/vo/VersionManagementRespVO.java @@ -0,0 +1,96 @@ +package com.zt.plat.module.qms.resource.clientManage.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; + +import java.time.LocalDateTime; +import com.alibaba.excel.annotation.*; +import com.zt.plat.framework.excel.core.annotations.DictFormat; +import com.zt.plat.framework.excel.core.convert.DictConvert; + +@Schema(description = "管理后台 - 客户端版本管理 Response VO") +@Data +@ExcelIgnoreUnannotated +public class VersionManagementRespVO { + + @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "18365") + @ExcelProperty("主键") + private Long id; + + @Schema(description = "客户端code", requiredMode = Schema.RequiredMode.REQUIRED, example = "20524") + @ExcelProperty(value = "客户端code", converter = DictConvert.class) + private String applicationCode; + + @Schema(description = "客户端名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六") + @ExcelProperty(value = "客户端名称", converter = DictConvert.class) + private String applicationName; + + @Schema(description = "更新标题") + @ExcelProperty("更新标题") + private String updateTitle; + + @Schema(description = "更新内容") + @ExcelProperty("更新内容") + private String updateContent; + + @Schema(description = "更新平台", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty(value = "更新平台", converter = DictConvert.class) + private String updatePlatform; + + @Schema(description = "安装包类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") + @ExcelProperty(value = "安装包类型", converter = DictConvert.class) + private String updateType; + + @Schema(description = "当前版本,必须大于当前线上发行版本号") + @ExcelProperty("当前版本,必须大于当前线上发行版本号") + private String currentVersion; + + @Schema(description = "最低版本") + @ExcelProperty("最低版本") + private String minimumVersion; + + @Schema(description = "下载地址", example = "https://www.iocoder.cn") + @ExcelProperty("下载地址") + private String downloadUrl; + + @Schema(description = "下载文件id", example = "11223344") + @ExcelProperty("下载文件id") + private String downloadId; + + @Schema(description = "文件md5值") + @ExcelProperty("文件md5值") + private String fileMd5; + + @Schema(description = "文件sha1值") + @ExcelProperty("文件sha1值") + private String fileEncryptAlgorithm; + + @Schema(description = "发布状态", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("发布状态") + private String publishFlag; + + @Schema(description = "是否静默更新") + @ExcelProperty("是否静默更新") + private Integer silenceFlag; + + @Schema(description = "是否强制更新") + @ExcelProperty("是否强制更新") + private Integer mustFlag; + + @Schema(description = "所属部门") + @ExcelProperty("所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建日期") + @ExcelProperty("创建日期") + private LocalDateTime createTime; + + @Schema(description = "备注") + @ExcelProperty("备注") + private String remark; + + @Schema(description = "创建者") + @ExcelProperty("创建者") + private String creator; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/clientManage/controller/vo/VersionManagementSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/clientManage/controller/vo/VersionManagementSaveReqVO.java new file mode 100644 index 0000000..817c9b3 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/clientManage/controller/vo/VersionManagementSaveReqVO.java @@ -0,0 +1,74 @@ +package com.zt.plat.module.qms.resource.clientManage.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import jakarta.validation.constraints.*; + +import java.util.List; + +@Schema(description = "管理后台 - 客户端版本管理新增/修改 Request VO") +@Data +public class VersionManagementSaveReqVO { + + @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "18365") + private Long id; + + @Schema(description = "客户端code", requiredMode = Schema.RequiredMode.REQUIRED, example = "20524") + @NotEmpty(message = "客户端名称不能为空") + private String applicationCode; + + @Schema(description = "客户端名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六") + @NotEmpty(message = "客户端名称不能为空") + private String applicationName; + + @Schema(description = "更新标题") + private String updateTitle; + + @Schema(description = "更新内容") + private String updateContent; + + @Schema(description = "更新平台", requiredMode = Schema.RequiredMode.REQUIRED) +// @NotEmpty(message = "更新平台不能为空") + private String updatePlatform; + + @Schema(description = "安装包类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") +// @NotEmpty(message = "安装包类型不能为空") + private String updateType; + + @Schema(description = "当前版本,必须大于当前线上发行版本号") + private String currentVersion; + + @Schema(description = "最低版本") + private String minimumVersion; + + @Schema(description = "下载地址", example = "https://www.iocoder.cn") + private String downloadUrl; + + @Schema(description = "文件md5值") + private String fileMd5; + + @Schema(description = "文件sha1值") + private String fileEncryptAlgorithm; + + @Schema(description = "发布状态", requiredMode = Schema.RequiredMode.REQUIRED) + private String publishFlag; + + @Schema(description = "是否静默更新") + private Integer silenceFlag; + + @Schema(description = "是否强制更新") + private Integer mustFlag; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + + @Schema(description = "上传文件Uid") + private String downloadId; + + //==========扩展属性=============== + @Schema(description = "上传文件列表") + private List files; +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/clientManage/dal/dataobject/VersionManagementDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/clientManage/dal/dataobject/VersionManagementDO.java new file mode 100644 index 0000000..6435531 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/clientManage/dal/dataobject/VersionManagementDO.java @@ -0,0 +1,117 @@ +package com.zt.plat.module.qms.resource.clientManage.dal.dataobject; + +import lombok.*; +import com.baomidou.mybatisplus.annotation.*; +import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; +/** +* 客户端版本管理 DO +* +* @author 后台管理 +*/ +@TableName("t_ver_mngt") +@KeySequence("t_ver_mngt_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class VersionManagementDO extends BusinessBaseDO { + + + + /** + * 主键 + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 客户端code + */ + @TableField("APPL_CD") + private String applicationCode; + /** + * 客户端名称 + */ + @TableField("APPL_NAME") + private String applicationName; + /** + * 更新标题 + */ + @TableField("UPD_TTL") + private String updateTitle; + /** + * 更新内容 + */ + @TableField("UPD_CNTT") + private String updateContent; + /** + * 更新平台 + * + */ + @TableField("UPD_PLTF") + private String updatePlatform; + /** + * 安装包类型 + * + */ + @TableField("UPD_TP") + private String updateType; + /** + * 当前版本,必须大于当前线上发行版本号 + */ + @TableField("CRNT_VER") + private String currentVersion; + /** + * 最低版本 + */ + @TableField("MIN_VER") + private String minimumVersion; + /** + * 下载地址 + */ + @TableField("DL_URL") + private String downloadUrl; + /** + * 文件md5值 + */ + @TableField("FILE_MD5") + private String fileMd5; + /** + * 文件sha1值 + */ + @TableField("FILE_ENCR_ALG") + private String fileEncryptAlgorithm; + /** + * 发布状态 + */ + @TableField("PUB_FLG") + private String publishFlag; + /** + * 是否静默更新 + */ + @TableField("SLNC_FLG") + private Integer silenceFlag; + /** + * 是否强制更新 + */ + @TableField("MUST_FLG") + private Integer mustFlag; + /** + * 所属部门 + */ + @TableField("SYS_DEPT_CD") + private String systemDepartmentCode; + /** + * 备注 + */ + @TableField("RMK") + private String remark; + + @TableField("DL_ID") + private String downloadId; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/clientManage/dal/mapper/VersionManagementMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/clientManage/dal/mapper/VersionManagementMapper.java new file mode 100644 index 0000000..8892e36 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/clientManage/dal/mapper/VersionManagementMapper.java @@ -0,0 +1,46 @@ +package com.zt.plat.module.qms.resource.clientManage.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.clientManage.dal.dataobject.VersionManagementDO; +import com.zt.plat.module.qms.resource.clientManage.controller.vo.VersionManagementPageReqVO; +import org.apache.ibatis.annotations.Mapper; + +import java.util.Collections; +import java.util.List; + +/** + * 客户端版本管理 Mapper + * + * @author 后台管理 + */ +@Mapper +public interface VersionManagementMapper extends BaseMapperX { + + default PageResult selectPage(VersionManagementPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(VersionManagementDO::getApplicationCode, reqVO.getApplicationCode()) + .eqIfPresent(VersionManagementDO::getApplicationName, reqVO.getApplicationName()) + .eqIfPresent(VersionManagementDO::getUpdateTitle, reqVO.getUpdateTitle()) + .eqIfPresent(VersionManagementDO::getUpdateContent, reqVO.getUpdateContent()) + .eqIfPresent(VersionManagementDO::getUpdatePlatform, reqVO.getUpdatePlatform()) + .eqIfPresent(VersionManagementDO::getPublishFlag, reqVO.getPublishFlag()) + .eqIfPresent(VersionManagementDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .eqIfPresent(VersionManagementDO::getCreator, reqVO.getCreator()) + .betweenIfPresent(VersionManagementDO::getCreateTime, reqVO.getCreateTime()) + .orderByDesc(VersionManagementDO::getId)); + } + + + default PageResult selectList(VersionManagementPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(VersionManagementDO::getUpdatePlatform, reqVO.getUpdatePlatform()) + .eqIfPresent(VersionManagementDO::getUpdateType, reqVO.getUpdateType()) + .eqIfPresent(VersionManagementDO::getApplicationCode, reqVO.getApplicationCode()) + .eq(VersionManagementDO::getPublishFlag,1) + .orderByDesc(VersionManagementDO::getCreateTime) +// .last("LIMIT 1") + ); + } +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/clientManage/service/VersionManagementService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/clientManage/service/VersionManagementService.java new file mode 100644 index 0000000..7d2cf11 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/clientManage/service/VersionManagementService.java @@ -0,0 +1,78 @@ +package com.zt.plat.module.qms.resource.clientManage.service; + +import java.util.*; + +import com.zt.plat.module.qms.resource.clientManage.controller.vo.VersionManagementPageReqVO; +import com.zt.plat.module.qms.resource.clientManage.controller.vo.VersionManagementRespVO; +import com.zt.plat.module.qms.resource.clientManage.controller.vo.VersionManagementSaveReqVO; +import jakarta.validation.*; +import com.zt.plat.module.qms.resource.clientManage.dal.dataobject.VersionManagementDO; +import com.zt.plat.framework.common.pojo.PageResult; + +/** + * 客户端版本管理 Service 接口 + * + * @author 后台管理 + */ +public interface VersionManagementService { + + /** + * 创建客户端版本管理 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + VersionManagementRespVO createVersionManagement(@Valid VersionManagementSaveReqVO createReqVO); + + /** + * 更新客户端版本管理 + * + * @param updateReqVO 更新信息 + */ + void updateVersionManagement(@Valid VersionManagementSaveReqVO updateReqVO); + + /** + * 删除客户端版本管理 + * + * @param id 编号 + */ + void deleteVersionManagement(Long id); + + /** + * 批量删除客户端版本管理 + * + * @param ids 编号 + */ + void deleteSystemVersionManagementListByIds(List ids); + + /** + * 获得客户端版本管理 + * + * @param id 编号 + * @return 客户端版本管理 + */ + VersionManagementDO getVersionManagement(Long id); + + /** + * 获得客户端版本管理分页 + * + * @param pageReqVO 分页查询 + * @return 客户端版本管理分页 + */ + PageResult getVersionManagementPage(VersionManagementPageReqVO pageReqVO); + + + /** + * 获得客户端版本管理接口方法 + * + * @param pageReqVO 分页查询 + * @return 客户端版本管理分页 + */ + PageResult getList(VersionManagementPageReqVO pageReqVO); + + /** + * 版本发布 + * @param id + */ + void executePublish(Long id); +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/clientManage/service/VersionManagementServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/clientManage/service/VersionManagementServiceImpl.java new file mode 100644 index 0000000..99a28bc --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/clientManage/service/VersionManagementServiceImpl.java @@ -0,0 +1,151 @@ +package com.zt.plat.module.qms.resource.clientManage.service; + +import cn.hutool.core.collection.CollUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.zt.plat.module.qms.resource.clientManage.VersionManagementConst; +import com.zt.plat.module.qms.resource.clientManage.controller.vo.VersionManagementPageReqVO; +import com.zt.plat.module.qms.resource.clientManage.controller.vo.VersionManagementRespVO; +import com.zt.plat.module.qms.resource.clientManage.controller.vo.VersionManagementSaveReqVO; +import com.zt.plat.module.qms.resource.clientManage.controller.vo.UploadFileVo; +import org.springframework.stereotype.Service; +import jakarta.annotation.Resource; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.ObjectUtils; +import org.springframework.validation.annotation.Validated; + +import java.util.*; + +import com.zt.plat.module.qms.resource.clientManage.dal.dataobject.VersionManagementDO; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.util.object.BeanUtils; + +import com.zt.plat.module.qms.resource.clientManage.dal.mapper.VersionManagementMapper; + +import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception0; +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 VersionManagementServiceImpl implements VersionManagementService { + + @Resource + private VersionManagementMapper versionManagementMapper; + + @Override + public VersionManagementRespVO createVersionManagement(VersionManagementSaveReqVO createReqVO) { + //多条数据取第一条 + + // 插入 + VersionManagementDO versionManagement = BeanUtils.toBean(createReqVO, VersionManagementDO.class); + // LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();//获取当前登录人通用方法 +// systemVersionManagement.setCreator(String.valueOf(SecurityFrameworkUtils.getLoginUser().getId())); + handleFileParam(createReqVO); + versionManagementMapper.insert(versionManagement); + // 返回 + return BeanUtils.toBean(versionManagement, VersionManagementRespVO.class); + } + + @Override + public void updateVersionManagement(VersionManagementSaveReqVO updateReqVO) { + // 校验存在 + validateVersionManagementExists(updateReqVO.getId()); + handleFileParam(updateReqVO); + // 更新 + VersionManagementDO updateObj = BeanUtils.toBean(updateReqVO, VersionManagementDO.class); +// updateObj.setUpdater(String.valueOf(SecurityFrameworkUtils.getLoginUser().getId())); + versionManagementMapper.updateById(updateObj); + } + + //处理附件参数 + private void handleFileParam(VersionManagementSaveReqVO reqVO){ + List files = reqVO.getFiles(); + if (files == null || files.isEmpty()) + return; + UploadFileVo uploadFileVo = files.get(0); + reqVO.setDownloadUrl(uploadFileVo.getUrl()); + reqVO.setFileMd5(uploadFileVo.getMd5()); + reqVO.setFileEncryptAlgorithm(uploadFileVo.getSha1()); + reqVO.setDownloadId(uploadFileVo.getId()); + } + + @Override + public void deleteVersionManagement(Long id) { + // 校验存在 + validateVersionManagementExists(id); + // 删除 + versionManagementMapper.deleteById(id); + } + + @Override + public void deleteSystemVersionManagementListByIds(List ids) { + // 校验存在 + validateVersionManagementExists(ids); + // 删除 + versionManagementMapper.deleteByIds(ids); + } + + private void validateVersionManagementExists(List ids) { + List list = versionManagementMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(SYSTEM_VERSION_MANAGEMENT_NOT_EXISTS); + } + } + + private void validateVersionManagementExists(Long id) { + if (versionManagementMapper.selectById(id) == null) { + throw exception(SYSTEM_VERSION_MANAGEMENT_NOT_EXISTS); + } + } + + @Override + public VersionManagementDO getVersionManagement(Long id) { + return versionManagementMapper.selectById(id); + } + + @Override + public PageResult getVersionManagementPage(VersionManagementPageReqVO pageReqVO) { + return versionManagementMapper.selectPage(pageReqVO); + } + + @Override + public PageResult getList(VersionManagementPageReqVO pageReqVO) { + + + return versionManagementMapper.selectList(pageReqVO); + } + + + /* + * 发布*/ + @Override + @Transactional(rollbackFor = Exception.class) + public void executePublish(Long id) { + // 校验存在 + validateVersionManagementExists(id); + // 下线当前发布的版本 + VersionManagementDO entity = versionManagementMapper.selectById(id); + if(ObjectUtils.isEmpty( entity.getDownloadUrl()) || ObjectUtils.isEmpty( entity.getDownloadId())) + throw exception0(SYSTEM_VERSION_MANAGEMENT_NOT_EXISTS.getCode(), "请上传附件后再发布!"); + String code = entity.getApplicationCode(); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(VersionManagementDO::getApplicationCode, code); + queryWrapper.eq(VersionManagementDO::getPublishFlag, VersionManagementConst.PUBLISH_FLAG_PUBLISH); + queryWrapper.ne(VersionManagementDO::getId, id); + List list = versionManagementMapper.selectList(queryWrapper); + if(!list.isEmpty()){ + for(VersionManagementDO versionManagementDO : list){ + versionManagementDO.setPublishFlag(VersionManagementConst.PUBLISH_FLAG_OFFLINE); + } + versionManagementMapper.updateBatch(list); + } + entity.setPublishFlag(VersionManagementConst.PUBLISH_FLAG_PUBLISH); + versionManagementMapper.updateById(entity); + } +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/common/DeviceUtil.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/common/DeviceUtil.java new file mode 100644 index 0000000..76f2395 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/common/DeviceUtil.java @@ -0,0 +1,140 @@ +package com.zt.plat.module.qms.resource.device.common; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import org.springframework.util.ObjectUtils; + +import java.time.DayOfWeek; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.LocalTime; +import java.time.temporal.TemporalAdjusters; +import java.util.ArrayList; +import java.util.List; + +public class DeviceUtil { + + + /*** + * 根据频率类型,获取当前频率周期的开始时间和结束时间 + * @param date 上次执行日期 + * @param frequencyType 频率类型 + * @param frequency 频率 + * @return + */ + public static LocalDateTime[] getDateRangeByFrequency(LocalDate date, boolean nextFlag, String frequencyType, String frequency) { + LocalDate referenceDate = (date != null) ? date : LocalDate.now(); + LocalDate startDate = null; + LocalDate endDate = null; + int frequencyInt = Integer.parseInt(frequency); + if(!nextFlag) + frequencyInt --; + switch (frequencyType.toLowerCase()) { + case "day": + startDate = referenceDate.plusDays(frequencyInt); + endDate = startDate.plusDays(frequencyInt + 1); + break; +// case "day_before_use": //每天第一次使用前,与按天相同。 截止2025-4-19,未启用此项 +// startDate = referenceDate.plusDays(frequencyInt); +// endDate = startDate.plusDays(frequencyInt + 1); +// break; + case "week": + startDate = referenceDate.plusWeeks(frequencyInt); + startDate = startDate.with(TemporalAdjusters.previousOrSame(DayOfWeek.MONDAY)); + endDate = startDate.plusWeeks(1).minusDays(1); + break; + case "month": + startDate = referenceDate.plusMonths(frequencyInt).withDayOfMonth(1); + endDate = startDate.plusMonths(1).minusDays(1); + break; + case "year": + startDate = referenceDate.plusYears(frequencyInt); + endDate = startDate.plusYears(1).minusDays(1); + break; + default: + return null; + } + + return new LocalDateTime[]{ + LocalDateTime.of(startDate, LocalTime.of(0, 0, 0)), + LocalDateTime.of(endDate, LocalTime.of(23, 59, 59)) + }; + } + + + public static String assembleCommentJson(JSONArray flow){ + if(flow == null) + return ""; + JSONArray entity = new JSONArray(); +// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + for(int i = flow.size() - 1; i >= 0; i--){ + JSONObject flowItem = flow.getJSONObject(i); + String historyActivityId = flowItem.getString("historyActivityId"); + String historyActivityName = flowItem.getString("historyActivityName"); + if(checkContains(entity, historyActivityId)) + continue; + String assigneeName = flowItem.getString("assigneeName"); + String assignee = flowItem.getString("assignee"); + String endTime = flowItem.getString("endTime"); + JSONArray comments = flowItem.getJSONArray("comments"); + String comment = ""; + if(comments != null && comments.size() > 0){ + comment = comments.getJSONObject(0).getString("message"); + } + if(!historyActivityId.toLowerCase().startsWith("activity_")) + continue; + if(!ObjectUtils.isEmpty(endTime)){ + JSONObject commentObj = new JSONObject(); + commentObj.put("nodeId", historyActivityId); + commentObj.put("nodeName", historyActivityName); + commentObj.put("comment", comment); + commentObj.put("userName", assigneeName); + commentObj.put("userId", assignee); + commentObj.put("time", endTime); + entity.add(commentObj); + } + } + return entity.toJSONString(); + } + + public static void transCommentToValue(JSONObject voJson, String commentJsonStr){ + List hasActivityList = new ArrayList<>(); + if(!ObjectUtils.isEmpty(commentJsonStr)){ + JSONArray arr = JSONArray.parseArray(commentJsonStr); + for(int i=0;i createDeviceAffiliationRelativity(@Valid @RequestBody DeviceAffiliationRelativitySaveReqVO createReqVO) { + return success(deviceAffiliationRelativityService.createDeviceAffiliationRelativity(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新附属设备关系") + @PreAuthorize("@ss.hasPermission('qms:device-affiliation-relativity:update')") + public CommonResult updateDeviceAffiliationRelativity(@Valid @RequestBody DeviceAffiliationRelativitySaveReqVO updateReqVO) { + deviceAffiliationRelativityService.updateDeviceAffiliationRelativity(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除附属设备关系") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('qms:device-affiliation-relativity:delete')") + public CommonResult deleteDeviceAffiliationRelativity(@RequestParam("id") Long id) { + deviceAffiliationRelativityService.deleteDeviceAffiliationRelativity(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除附属设备关系") + @PreAuthorize("@ss.hasPermission('qms:device-affiliation-relativity:delete')") + public CommonResult deleteDeviceAffiliationRelativityList(@RequestBody BatchDeleteReqVO req) { + deviceAffiliationRelativityService.deleteDeviceAffiliationRelativityListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得附属设备关系") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('qms:device-affiliation-relativity:query')") + public CommonResult getDeviceAffiliationRelativity(@RequestParam("id") Long id) { + DeviceAffiliationRelativityDO deviceAffiliationRelativity = deviceAffiliationRelativityService.getDeviceAffiliationRelativity(id); + return success(BeanUtils.toBean(deviceAffiliationRelativity, DeviceAffiliationRelativityRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得附属设备关系分页") + @PreAuthorize("@ss.hasPermission('qms:device-affiliation-relativity:query')") + public CommonResult> getDeviceAffiliationRelativityPage(@Valid DeviceAffiliationRelativityPageReqVO pageReqVO) { + PageResult pageResult = deviceAffiliationRelativityService.getDeviceAffiliationRelativityPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, DeviceAffiliationRelativityRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出附属设备关系 Excel") + @PreAuthorize("@ss.hasPermission('qms:device-affiliation-relativity:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportDeviceAffiliationRelativityExcel(@Valid DeviceAffiliationRelativityPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = deviceAffiliationRelativityService.getDeviceAffiliationRelativityPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "附属设备关系.xls", "数据", DeviceAffiliationRelativityRespVO.class, + BeanUtils.toBean(list, DeviceAffiliationRelativityRespVO.class)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceApplyController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceApplyController.java new file mode 100644 index 0000000..706e9d1 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceApplyController.java @@ -0,0 +1,119 @@ +package com.zt.plat.module.qms.resource.device.controller.admin; + +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceApplyPageReqVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceApplyRespVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceApplySaveReqVO; +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.device.dal.dataobject.DeviceApplyDO; +import com.zt.plat.module.qms.resource.device.service.DeviceApplyService; + +@Tag(name = "管理后台 - 设备通用流程,验收、降级、停用、报废、还原、启用") +@RestController +@RequestMapping("/qms/resource/device-apply") +@Validated +@FileUploadController(source = "qms.deviceapply") +public class DeviceApplyController extends AbstractFileUploadController implements BusinessControllerMarker{ + + static { + FileUploadController annotation = DeviceApplyController.class.getAnnotation(FileUploadController.class); + if (annotation != null) { + setFileUploadInfo(annotation); + } + } + + @Resource + private DeviceApplyService deviceApplyService; + + //todo 通过设备通用流程配置创建 + @PostMapping("/create") + @Operation(summary = "创建设备通用流程,验收、降级、停用、报废、还原、启用") +// @PreAuthorize("@ss.hasPermission('qms:device-apply:create')") + public CommonResult createDeviceApply(@Valid @RequestBody DeviceApplySaveReqVO createReqVO) { + return success(deviceApplyService.createDeviceApply(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新设备通用流程,验收、降级、停用、报废、还原、启用") +// @PreAuthorize("@ss.hasPermission('qms:device-apply:update')") + public CommonResult updateDeviceApply(@Valid @RequestBody DeviceApplySaveReqVO updateReqVO) { + deviceApplyService.updateDeviceApply(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除设备通用流程,验收、降级、停用、报废、还原、启用") + @Parameter(name = "id", description = "编号", required = true) +// @PreAuthorize("@ss.hasPermission('qms:device-apply:delete')") + public CommonResult deleteDeviceApply(@RequestParam("id") Long id) { + deviceApplyService.deleteDeviceApply(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除设备通用流程,验收、降级、停用、报废、还原、启用") + @PreAuthorize("@ss.hasPermission('qms:device-apply:delete')") + public CommonResult deleteDeviceApplyList(@RequestBody BatchDeleteReqVO req) { + deviceApplyService.deleteDeviceApplyListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得设备通用流程,验收、降级、停用、报废、还原、启用") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('qms:device-apply:query')") + public CommonResult getDeviceApply(@RequestParam("id") Long id) { + DeviceApplyDO deviceApply = deviceApplyService.getDeviceApply(id); + return success(BeanUtils.toBean(deviceApply, DeviceApplyRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得设备通用流程,验收、降级、停用、报废、还原、启用分页") + @PreAuthorize("@ss.hasPermission('qms:device-apply:query')") + public CommonResult> getDeviceApplyPage(@Valid DeviceApplyPageReqVO pageReqVO) { + PageResult pageResult = deviceApplyService.getDeviceApplyPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, DeviceApplyRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出设备通用流程,验收、降级、停用、报废、还原、启用 Excel") + @PreAuthorize("@ss.hasPermission('qms:device-apply:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportDeviceApplyExcel(@Valid DeviceApplyPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = deviceApplyService.getDeviceApplyPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "设备通用流程,验收、降级、停用、报废、还原、启用.xls", "数据", DeviceApplyRespVO.class, + BeanUtils.toBean(list, DeviceApplyRespVO.class)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceApplyDetailController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceApplyDetailController.java new file mode 100644 index 0000000..b8b07f4 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceApplyDetailController.java @@ -0,0 +1,118 @@ +package com.zt.plat.module.qms.resource.device.controller.admin; + +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceApplyDetailPageReqVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceApplyDetailRespVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceApplyDetailSaveReqVO; +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.device.dal.dataobject.DeviceApplyDetailDO; +import com.zt.plat.module.qms.resource.device.service.DeviceApplyDetailService; + +@Tag(name = "管理后台 - 设备通用流程明细") +@RestController +@RequestMapping("/qms/resource/device-apply-detail") +@Validated +@FileUploadController(source = "qms.deviceapplydetail") +public class DeviceApplyDetailController extends AbstractFileUploadController implements BusinessControllerMarker{ + + static { + FileUploadController annotation = DeviceApplyDetailController.class.getAnnotation(FileUploadController.class); + if (annotation != null) { + setFileUploadInfo(annotation); + } + } + + @Resource + private DeviceApplyDetailService deviceApplyDetailService; + + @PostMapping("/create") + @Operation(summary = "创建设备通用流程明细") + @PreAuthorize("@ss.hasPermission('qms:device-apply-detail:create')") + public CommonResult createDeviceApplyDetail(@Valid @RequestBody DeviceApplyDetailSaveReqVO createReqVO) { + return success(deviceApplyDetailService.createDeviceApplyDetail(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新设备通用流程明细") + @PreAuthorize("@ss.hasPermission('qms:device-apply-detail:update')") + public CommonResult updateDeviceApplyDetail(@Valid @RequestBody DeviceApplyDetailSaveReqVO updateReqVO) { + deviceApplyDetailService.updateDeviceApplyDetail(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除设备通用流程明细") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('qms:device-apply-detail:delete')") + public CommonResult deleteDeviceApplyDetail(@RequestParam("id") Long id) { + deviceApplyDetailService.deleteDeviceApplyDetail(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除设备通用流程明细") + @PreAuthorize("@ss.hasPermission('qms:device-apply-detail:delete')") + public CommonResult deleteDeviceApplyDetailList(@RequestBody BatchDeleteReqVO req) { + deviceApplyDetailService.deleteDeviceApplyDetailListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得设备通用流程明细") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('qms:device-apply-detail:query')") + public CommonResult getDeviceApplyDetail(@RequestParam("id") Long id) { + DeviceApplyDetailDO deviceApplyDetail = deviceApplyDetailService.getDeviceApplyDetail(id); + return success(BeanUtils.toBean(deviceApplyDetail, DeviceApplyDetailRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得设备通用流程明细分页") + @PreAuthorize("@ss.hasPermission('qms:device-apply-detail:query')") + public CommonResult> getDeviceApplyDetailPage(@Valid DeviceApplyDetailPageReqVO pageReqVO) { + PageResult pageResult = deviceApplyDetailService.getDeviceApplyDetailPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, DeviceApplyDetailRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出设备通用流程明细 Excel") + @PreAuthorize("@ss.hasPermission('qms:device-apply-detail:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportDeviceApplyDetailExcel(@Valid DeviceApplyDetailPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = deviceApplyDetailService.getDeviceApplyDetailPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "设备通用流程明细.xls", "数据", DeviceApplyDetailRespVO.class, + BeanUtils.toBean(list, DeviceApplyDetailRespVO.class)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceCalibrationController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceCalibrationController.java new file mode 100644 index 0000000..54efbea --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceCalibrationController.java @@ -0,0 +1,118 @@ +package com.zt.plat.module.qms.resource.device.controller.admin; + +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceCalibrationPageReqVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceCalibrationRespVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceCalibrationSaveReqVO; +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.device.dal.dataobject.DeviceCalibrationDO; +import com.zt.plat.module.qms.resource.device.service.DeviceCalibrationService; + +@Tag(name = "管理后台 - 设备-检定校准") +@RestController +@RequestMapping("/qms/resource/device-calibration") +@Validated +@FileUploadController(source = "qms.devicecalibration") +public class DeviceCalibrationController extends AbstractFileUploadController implements BusinessControllerMarker{ + + static { + FileUploadController annotation = DeviceCalibrationController.class.getAnnotation(FileUploadController.class); + if (annotation != null) { + setFileUploadInfo(annotation); + } + } + + @Resource + private DeviceCalibrationService deviceCalibrationService; + + @PostMapping("/create") + @Operation(summary = "创建设备-检定校准") + @PreAuthorize("@ss.hasPermission('qms:device-calibration:create')") + public CommonResult createDeviceCalibration(@Valid @RequestBody DeviceCalibrationSaveReqVO createReqVO) { + return success(deviceCalibrationService.createDeviceCalibration(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新设备-检定校准") + @PreAuthorize("@ss.hasPermission('qms:device-calibration:update')") + public CommonResult updateDeviceCalibration(@Valid @RequestBody DeviceCalibrationSaveReqVO updateReqVO) { + deviceCalibrationService.updateDeviceCalibration(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除设备-检定校准") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('qms:device-calibration:delete')") + public CommonResult deleteDeviceCalibration(@RequestParam("id") Long id) { + deviceCalibrationService.deleteDeviceCalibration(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除设备-检定校准") + @PreAuthorize("@ss.hasPermission('qms:device-calibration:delete')") + public CommonResult deleteDeviceCalibrationList(@RequestBody BatchDeleteReqVO req) { + deviceCalibrationService.deleteDeviceCalibrationListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得设备-检定校准") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('qms:device-calibration:query')") + public CommonResult getDeviceCalibration(@RequestParam("id") Long id) { + DeviceCalibrationDO deviceCalibration = deviceCalibrationService.getDeviceCalibration(id); + return success(BeanUtils.toBean(deviceCalibration, DeviceCalibrationRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得设备-检定校准分页") + @PreAuthorize("@ss.hasPermission('qms:device-calibration:query')") + public CommonResult> getDeviceCalibrationPage(@Valid DeviceCalibrationPageReqVO pageReqVO) { + PageResult pageResult = deviceCalibrationService.getDeviceCalibrationPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, DeviceCalibrationRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出设备-检定校准 Excel") + @PreAuthorize("@ss.hasPermission('qms:device-calibration:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportDeviceCalibrationExcel(@Valid DeviceCalibrationPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = deviceCalibrationService.getDeviceCalibrationPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "设备-检定校准.xls", "数据", DeviceCalibrationRespVO.class, + BeanUtils.toBean(list, DeviceCalibrationRespVO.class)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceCalibrationPlanController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceCalibrationPlanController.java new file mode 100644 index 0000000..428cd95 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceCalibrationPlanController.java @@ -0,0 +1,118 @@ +package com.zt.plat.module.qms.resource.device.controller.admin; + +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceCalibrationPlanPageReqVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceCalibrationPlanRespVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceCalibrationPlanSaveReqVO; +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.device.dal.dataobject.DeviceCalibrationPlanDO; +import com.zt.plat.module.qms.resource.device.service.DeviceCalibrationPlanService; + +@Tag(name = "管理后台 - 设备-检定校准计划") +@RestController +@RequestMapping("/qms/resource/device-calibration-plan") +@Validated +@FileUploadController(source = "qms.devicecalibrationplan") +public class DeviceCalibrationPlanController extends AbstractFileUploadController implements BusinessControllerMarker{ + + static { + FileUploadController annotation = DeviceCalibrationPlanController.class.getAnnotation(FileUploadController.class); + if (annotation != null) { + setFileUploadInfo(annotation); + } + } + + @Resource + private DeviceCalibrationPlanService deviceCalibrationPlanService; + + @PostMapping("/create") + @Operation(summary = "创建设备-检定校准计划") + @PreAuthorize("@ss.hasPermission('qms:device-calibration-plan:create')") + public CommonResult createDeviceCalibrationPlan(@Valid @RequestBody DeviceCalibrationPlanSaveReqVO createReqVO) { + return success(deviceCalibrationPlanService.createDeviceCalibrationPlan(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新设备-检定校准计划") + @PreAuthorize("@ss.hasPermission('qms:device-calibration-plan:update')") + public CommonResult updateDeviceCalibrationPlan(@Valid @RequestBody DeviceCalibrationPlanSaveReqVO updateReqVO) { + deviceCalibrationPlanService.updateDeviceCalibrationPlan(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除设备-检定校准计划") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('qms:device-calibration-plan:delete')") + public CommonResult deleteDeviceCalibrationPlan(@RequestParam("id") Long id) { + deviceCalibrationPlanService.deleteDeviceCalibrationPlan(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除设备-检定校准计划") + @PreAuthorize("@ss.hasPermission('qms:device-calibration-plan:delete')") + public CommonResult deleteDeviceCalibrationPlanList(@RequestBody BatchDeleteReqVO req) { + deviceCalibrationPlanService.deleteDeviceCalibrationPlanListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得设备-检定校准计划") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('qms:device-calibration-plan:query')") + public CommonResult getDeviceCalibrationPlan(@RequestParam("id") Long id) { + DeviceCalibrationPlanDO deviceCalibrationPlan = deviceCalibrationPlanService.getDeviceCalibrationPlan(id); + return success(BeanUtils.toBean(deviceCalibrationPlan, DeviceCalibrationPlanRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得设备-检定校准计划分页") + @PreAuthorize("@ss.hasPermission('qms:device-calibration-plan:query')") + public CommonResult> getDeviceCalibrationPlanPage(@Valid DeviceCalibrationPlanPageReqVO pageReqVO) { + PageResult pageResult = deviceCalibrationPlanService.getDeviceCalibrationPlanPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, DeviceCalibrationPlanRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出设备-检定校准计划 Excel") + @PreAuthorize("@ss.hasPermission('qms:device-calibration-plan:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportDeviceCalibrationPlanExcel(@Valid DeviceCalibrationPlanPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = deviceCalibrationPlanService.getDeviceCalibrationPlanPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "设备-检定校准计划.xls", "数据", DeviceCalibrationPlanRespVO.class, + BeanUtils.toBean(list, DeviceCalibrationPlanRespVO.class)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceConfigBusinessItemController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceConfigBusinessItemController.java new file mode 100644 index 0000000..2555cf8 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceConfigBusinessItemController.java @@ -0,0 +1,118 @@ +package com.zt.plat.module.qms.resource.device.controller.admin; + +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceConfigBusinessItemPageReqVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceConfigBusinessItemRespVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceConfigBusinessItemSaveReqVO; +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.device.dal.dataobject.DeviceConfigBusinessItemDO; +import com.zt.plat.module.qms.resource.device.service.DeviceConfigBusinessItemService; + +@Tag(name = "管理后台 - 设备-检查项目配置") +@RestController +@RequestMapping("/qms/resource/device-config-business-item") +@Validated +@FileUploadController(source = "qms.deviceconfigbusinessitem") +public class DeviceConfigBusinessItemController extends AbstractFileUploadController implements BusinessControllerMarker{ + + static { + FileUploadController annotation = DeviceConfigBusinessItemController.class.getAnnotation(FileUploadController.class); + if (annotation != null) { + setFileUploadInfo(annotation); + } + } + + @Resource + private DeviceConfigBusinessItemService deviceConfigBusinessItemService; + + @PostMapping("/create") + @Operation(summary = "创建设备-检查项目配置") + @PreAuthorize("@ss.hasPermission('qms:device-config-business-item:create')") + public CommonResult createDeviceConfigBusinessItem(@Valid @RequestBody DeviceConfigBusinessItemSaveReqVO createReqVO) { + return success(deviceConfigBusinessItemService.createDeviceConfigBusinessItem(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新设备-检查项目配置") + @PreAuthorize("@ss.hasPermission('qms:device-config-business-item:update')") + public CommonResult updateDeviceConfigBusinessItem(@Valid @RequestBody DeviceConfigBusinessItemSaveReqVO updateReqVO) { + deviceConfigBusinessItemService.updateDeviceConfigBusinessItem(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除设备-检查项目配置") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('qms:device-config-business-item:delete')") + public CommonResult deleteDeviceConfigBusinessItem(@RequestParam("id") Long id) { + deviceConfigBusinessItemService.deleteDeviceConfigBusinessItem(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除设备-检查项目配置") + @PreAuthorize("@ss.hasPermission('qms:device-config-business-item:delete')") + public CommonResult deleteDeviceConfigBusinessItemList(@RequestBody BatchDeleteReqVO req) { + deviceConfigBusinessItemService.deleteDeviceConfigBusinessItemListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得设备-检查项目配置") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('qms:device-config-business-item:query')") + public CommonResult getDeviceConfigBusinessItem(@RequestParam("id") Long id) { + DeviceConfigBusinessItemDO deviceConfigBusinessItem = deviceConfigBusinessItemService.getDeviceConfigBusinessItem(id); + return success(BeanUtils.toBean(deviceConfigBusinessItem, DeviceConfigBusinessItemRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得设备-检查项目配置分页") + @PreAuthorize("@ss.hasPermission('qms:device-config-business-item:query')") + public CommonResult> getDeviceConfigBusinessItemPage(@Valid DeviceConfigBusinessItemPageReqVO pageReqVO) { + PageResult pageResult = deviceConfigBusinessItemService.getDeviceConfigBusinessItemPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, DeviceConfigBusinessItemRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出设备-检查项目配置 Excel") + @PreAuthorize("@ss.hasPermission('qms:device-config-business-item:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportDeviceConfigBusinessItemExcel(@Valid DeviceConfigBusinessItemPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = deviceConfigBusinessItemService.getDeviceConfigBusinessItemPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "设备-检查项目配置.xls", "数据", DeviceConfigBusinessItemRespVO.class, + BeanUtils.toBean(list, DeviceConfigBusinessItemRespVO.class)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceConfigBusinessRuleController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceConfigBusinessRuleController.java new file mode 100644 index 0000000..fd2a3b3 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceConfigBusinessRuleController.java @@ -0,0 +1,131 @@ +package com.zt.plat.module.qms.resource.device.controller.admin; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceConfigBusinessRulePageReqVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceConfigBusinessRuleRespVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceConfigBusinessRuleSaveReqVO; +import com.zt.plat.module.qms.resource.device.dal.mapper.DeviceConfigBusinessRuleMapper; +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.device.dal.dataobject.DeviceConfigBusinessRuleDO; +import com.zt.plat.module.qms.resource.device.service.DeviceConfigBusinessRuleService; + +@Tag(name = "管理后台 - 设备-业务配置") +@RestController +@RequestMapping("/qms/resource/device-config-business-rule") +@Validated +@FileUploadController(source = "qms.deviceconfigbusinessrule") +public class DeviceConfigBusinessRuleController extends AbstractFileUploadController implements BusinessControllerMarker{ + + static { + FileUploadController annotation = DeviceConfigBusinessRuleController.class.getAnnotation(FileUploadController.class); + if (annotation != null) { + setFileUploadInfo(annotation); + } + } + + @Resource private DeviceConfigBusinessRuleService deviceConfigBusinessRuleService; + @Resource private DeviceConfigBusinessRuleMapper deviceConfigBusinessRuleMapper; + + @PostMapping("/create") + @Operation(summary = "创建设备-业务配置") + @PreAuthorize("@ss.hasPermission('qms:device-config-business-rule:create')") + public CommonResult createDeviceConfigBusinessRule(@Valid @RequestBody DeviceConfigBusinessRuleSaveReqVO createReqVO) { + return success(deviceConfigBusinessRuleService.createDeviceConfigBusinessRule(createReqVO)); + } + + + @GetMapping("/getByProductId") + @Operation(summary = "获得设备-业务配置") + @Parameter(name = "productId", description = "设备大类id", required = true, example = "1024") + public CommonResult getByProductId(@RequestParam("productId") Long productId) { + DeviceConfigBusinessRuleDO entity = deviceConfigBusinessRuleService.getByProductId(productId); + if(entity == null) + return success(null); + return success(BeanUtils.toBean(entity, DeviceConfigBusinessRuleRespVO.class)); + } + + @PutMapping("/update") + @Operation(summary = "更新设备-业务配置") + @PreAuthorize("@ss.hasPermission('qms:device-config-business-rule:update')") + public CommonResult updateDeviceConfigBusinessRule(@Valid @RequestBody DeviceConfigBusinessRuleSaveReqVO updateReqVO) { + deviceConfigBusinessRuleService.updateDeviceConfigBusinessRule(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除设备-业务配置") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('qms:device-config-business-rule:delete')") + public CommonResult deleteDeviceConfigBusinessRule(@RequestParam("id") Long id) { + deviceConfigBusinessRuleService.deleteDeviceConfigBusinessRule(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除设备-业务配置") + @PreAuthorize("@ss.hasPermission('qms:device-config-business-rule:delete')") + public CommonResult deleteDeviceConfigBusinessRuleList(@RequestBody BatchDeleteReqVO req) { + deviceConfigBusinessRuleService.deleteDeviceConfigBusinessRuleListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得设备-业务配置") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('qms:device-config-business-rule:query')") + public CommonResult getDeviceConfigBusinessRule(@RequestParam("id") Long id) { + DeviceConfigBusinessRuleDO deviceConfigBusinessRule = deviceConfigBusinessRuleService.getDeviceConfigBusinessRule(id); + return success(BeanUtils.toBean(deviceConfigBusinessRule, DeviceConfigBusinessRuleRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得设备-业务配置分页") + @PreAuthorize("@ss.hasPermission('qms:device-config-business-rule:query')") + public CommonResult> getDeviceConfigBusinessRulePage(@Valid DeviceConfigBusinessRulePageReqVO pageReqVO) { + PageResult pageResult = deviceConfigBusinessRuleService.getDeviceConfigBusinessRulePage(pageReqVO); + return success(BeanUtils.toBean(pageResult, DeviceConfigBusinessRuleRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出设备-业务配置 Excel") + @PreAuthorize("@ss.hasPermission('qms:device-config-business-rule:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportDeviceConfigBusinessRuleExcel(@Valid DeviceConfigBusinessRulePageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = deviceConfigBusinessRuleService.getDeviceConfigBusinessRulePage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "设备-业务配置.xls", "数据", DeviceConfigBusinessRuleRespVO.class, + BeanUtils.toBean(list, DeviceConfigBusinessRuleRespVO.class)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceConfigFlowController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceConfigFlowController.java new file mode 100644 index 0000000..cf1bc1f --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceConfigFlowController.java @@ -0,0 +1,116 @@ +package com.zt.plat.module.qms.resource.device.controller.admin; + +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceConfigFlowPageReqVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceConfigFlowRespVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceConfigFlowSaveReqVO; +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.*; +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.device.dal.dataobject.DeviceConfigFlowDO; +import com.zt.plat.module.qms.resource.device.service.DeviceConfigFlowService; + +@Tag(name = "管理后台 - 设备通用流程配置") +@RestController +@RequestMapping("/qms/resource/device-config-flow") +@Validated +public class DeviceConfigFlowController implements BusinessControllerMarker { + + + @Resource + private DeviceConfigFlowService deviceConfigFlowService; + + @GetMapping("/getEnableList") + @Operation(summary = "获得设备通用流程配置") + public CommonResult> getEnableList(@Valid DeviceConfigFlowPageReqVO pageReqVO) { + PageResult pageResult = deviceConfigFlowService.getDeviceConfigFlowPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, DeviceConfigFlowRespVO.class)); + } + + @PostMapping("/create") + @Operation(summary = "创建设备通用流程配置") + @PreAuthorize("@ss.hasPermission('qms:device-config-flow:create')") + public CommonResult createDeviceConfigFlow(@Valid @RequestBody DeviceConfigFlowSaveReqVO createReqVO) { + return success(deviceConfigFlowService.createDeviceConfigFlow(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新设备通用流程配置") + @PreAuthorize("@ss.hasPermission('qms:device-config-flow:update')") + public CommonResult updateDeviceConfigFlow(@Valid @RequestBody DeviceConfigFlowSaveReqVO updateReqVO) { + deviceConfigFlowService.updateDeviceConfigFlow(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除设备通用流程配置") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('qms:device-config-flow:delete')") + public CommonResult deleteDeviceConfigFlow(@RequestParam("id") Long id) { + deviceConfigFlowService.deleteDeviceConfigFlow(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除设备通用流程配置") + @PreAuthorize("@ss.hasPermission('qms:device-config-flow:delete')") + public CommonResult deleteDeviceConfigFlowList(@RequestBody BatchDeleteReqVO req) { + deviceConfigFlowService.deleteDeviceConfigFlowListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得设备通用流程配置") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('qms:device-config-flow:query')") + public CommonResult getDeviceConfigFlow(@RequestParam("id") Long id) { + DeviceConfigFlowDO deviceConfigFlow = deviceConfigFlowService.getDeviceConfigFlow(id); + return success(BeanUtils.toBean(deviceConfigFlow, DeviceConfigFlowRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得设备通用流程配置分页") + @PreAuthorize("@ss.hasPermission('qms:device-config-flow:query')") + public CommonResult> getDeviceConfigFlowPage(@Valid DeviceConfigFlowPageReqVO pageReqVO) { + PageResult pageResult = deviceConfigFlowService.getDeviceConfigFlowPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, DeviceConfigFlowRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出设备通用流程配置 Excel") + @PreAuthorize("@ss.hasPermission('qms:device-config-flow:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportDeviceConfigFlowExcel(@Valid DeviceConfigFlowPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = deviceConfigFlowService.getDeviceConfigFlowPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "设备通用流程配置.xls", "数据", DeviceConfigFlowRespVO.class, + BeanUtils.toBean(list, DeviceConfigFlowRespVO.class)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceInfomationController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceInfomationController.java index a87a47a..1f27db8 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceInfomationController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceInfomationController.java @@ -51,6 +51,13 @@ public class DeviceInfomationController extends AbstractFileUploadController imp @Resource private DeviceInfomationService deviceInfomationService; @Resource private DeviceProductService deviceProductService; + @PostMapping("/saveDevice") + @Operation(summary = "创建设备-设备信息") +// @PreAuthorize("@ss.hasPermission('resource:device-infomation:create')") + public CommonResult saveDevice(@Valid @RequestBody DeviceInfomationSaveReqVO reqVO) { + return deviceInfomationService.saveDevice(reqVO); + } + @PostMapping("/create") @Operation(summary = "创建设备-设备信息") @PreAuthorize("@ss.hasPermission('resource:device-infomation:create')") @@ -87,7 +94,7 @@ public class DeviceInfomationController extends AbstractFileUploadController imp @GetMapping("/get") @Operation(summary = "获得设备-设备信息") @Parameter(name = "id", description = "编号", required = true, example = "1024") - @PreAuthorize("@ss.hasPermission('resource:device-infomation:query')") +// @PreAuthorize("@ss.hasPermission('resource:device-infomation:query')") public CommonResult getDeviceInfomation(@RequestParam("id") Long id) { DeviceInfomationDO deviceInfomation = deviceInfomationService.getDeviceInfomation(id); return success(BeanUtils.toBean(deviceInfomation, DeviceInfomationRespVO.class)); @@ -95,14 +102,15 @@ public class DeviceInfomationController extends AbstractFileUploadController imp @GetMapping("/page") @Operation(summary = "获得设备-设备信息分页") - @PreAuthorize("@ss.hasPermission('resource:device-infomation:query')") +// @PreAuthorize("@ss.hasPermission('resource:device-infomation:query')") public CommonResult> getDeviceInfomationPage(@Valid DeviceInfomationPageReqVO pageReqVO) { Long productId = pageReqVO.getProductId(); if(productId != null){ - List productDOList = deviceProductService.listByIdPath(productId, DataTypeConstant.DATA_TYPE_DATA); - List productIds = productDOList.stream().map(DeviceProductDO::getId).toList(); - pageReqVO.setProductIds(productIds); - pageReqVO.setProductId(null); + List productIds = deviceProductService.getIdListByIdPath(productId); + if(!productIds.isEmpty()){ + pageReqVO.setProductIds(productIds); + pageReqVO.setProductId(null); + } } PageResult pageResult = deviceInfomationService.getDeviceInfomationPage(pageReqVO); return success(BeanUtils.toBean(pageResult, DeviceInfomationRespVO.class)); diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceMaintainController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceMaintainController.java new file mode 100644 index 0000000..98c1651 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceMaintainController.java @@ -0,0 +1,165 @@ +package com.zt.plat.module.qms.resource.device.controller.admin; + +import com.alibaba.fastjson.JSONObject; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceMaintainPageReqVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceMaintainRespVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceMaintainSaveReqVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceMaintainVO; +import com.zt.plat.module.qms.resource.device.service.DeviceInfomationService; +import org.springframework.util.ObjectUtils; +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.text.SimpleDateFormat; +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 static com.zt.plat.module.qms.enums.ErrorCodeConstants.DEVICE_MAINTAIN_NOT_EXISTS; + +import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceMaintainDO; +import com.zt.plat.module.qms.resource.device.service.DeviceMaintainService; + +@Tag(name = "管理后台 - 设备-点检、保养记录") +@RestController +@RequestMapping("/qms/resource/device-maintain") +@Validated +@FileUploadController(source = "qms.devicemaintain") +public class DeviceMaintainController extends AbstractFileUploadController implements BusinessControllerMarker{ + + static { + FileUploadController annotation = DeviceMaintainController.class.getAnnotation(FileUploadController.class); + if (annotation != null) { + setFileUploadInfo(annotation); + } + } + + @Resource private DeviceMaintainService deviceMaintainService; + @Resource private DeviceInfomationService deviceInfomationService; + + @PostMapping("/saveMaintainVo") + @Operation(summary = "创建或获取维护数据") + public CommonResult saveMaintainVo(@RequestBody DeviceMaintainVO vo) { + return deviceMaintainService.saveMaintainVo(vo); + } + + @PostMapping("/createOrGet") + @Operation(summary = "创建或获取维护数据") + public CommonResult createOrGet(@RequestBody JSONObject jsonObject) { + Long deviceId = jsonObject.getLong("deviceId"); + String dataType = jsonObject.getString("dataType"); + String dateStr = jsonObject.getString("date"); + if (deviceId == null || dataType == null) { + return CommonResult.error(DEVICE_MAINTAIN_NOT_EXISTS.getCode(), "参数错误"); + } + //检查设备状态 + CommonResult checkResult = deviceInfomationService.checkDeviceUsable(deviceId); + if(!checkResult.isSuccess()){ + return checkResult.error(checkResult.getCode(), checkResult.getMsg()); + } + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + if(ObjectUtils.isEmpty(dateStr)) + dateStr = sdf.format(new Date()); + return deviceMaintainService.createOrGet(deviceId, dateStr, dataType); + } + + + @GetMapping("/getMaintainDetail") + @Operation(summary = "查询维护记录详情") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + public CommonResult getMaintainDetail(@RequestParam("id") Long id) { + return deviceMaintainService.getMaintainDetail(id); + } + + @GetMapping("/queryPageListWithCount") + @Operation(summary = "维护-分页列表查询(以设备为主数据)") + public CommonResult> queryPageListWithCount(@Valid DeviceMaintainPageReqVO pageReqVO) { + PageResult pageResult = deviceMaintainService.queryPageListWithCount(pageReqVO); + return success(pageResult); + } + + @PostMapping("/create") + @Operation(summary = "创建设备-点检、保养记录") + @PreAuthorize("@ss.hasPermission('qms:device-maintain:create')") + public CommonResult createDeviceMaintain(@Valid @RequestBody DeviceMaintainSaveReqVO createReqVO) { + return success(deviceMaintainService.createDeviceMaintain(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新设备-点检、保养记录") + @PreAuthorize("@ss.hasPermission('qms:device-maintain:update')") + public CommonResult updateDeviceMaintain(@Valid @RequestBody DeviceMaintainSaveReqVO updateReqVO) { + deviceMaintainService.updateDeviceMaintain(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除设备-点检、保养记录") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('qms:device-maintain:delete')") + public CommonResult deleteDeviceMaintain(@RequestParam("id") Long id) { + deviceMaintainService.deleteDeviceMaintain(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除设备-点检、保养记录") + @PreAuthorize("@ss.hasPermission('qms:device-maintain:delete')") + public CommonResult deleteDeviceMaintainList(@RequestBody BatchDeleteReqVO req) { + deviceMaintainService.deleteDeviceMaintainListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得设备-点检、保养记录") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + public CommonResult getDeviceMaintain(@RequestParam("id") Long id) { + DeviceMaintainDO deviceMaintain = deviceMaintainService.getDeviceMaintain(id); + return success(BeanUtils.toBean(deviceMaintain, DeviceMaintainRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得设备-点检、保养记录分页") + @PreAuthorize("@ss.hasPermission('qms:device-maintain:query')") + public CommonResult> getDeviceMaintainPage(@Valid DeviceMaintainPageReqVO pageReqVO) { + PageResult pageResult = deviceMaintainService.getDeviceMaintainPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, DeviceMaintainRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出设备-点检、保养记录 Excel") + @PreAuthorize("@ss.hasPermission('qms:device-maintain:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportDeviceMaintainExcel(@Valid DeviceMaintainPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = deviceMaintainService.getDeviceMaintainPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "设备-点检、保养记录.xls", "数据", DeviceMaintainRespVO.class, + BeanUtils.toBean(list, DeviceMaintainRespVO.class)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceMaintainItemController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceMaintainItemController.java new file mode 100644 index 0000000..f66768e --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceMaintainItemController.java @@ -0,0 +1,118 @@ +package com.zt.plat.module.qms.resource.device.controller.admin; + +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceMaintainItemPageReqVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceMaintainItemRespVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceMaintainItemSaveReqVO; +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.device.dal.dataobject.DeviceMaintainItemDO; +import com.zt.plat.module.qms.resource.device.service.DeviceMaintainItemService; + +@Tag(name = "管理后台 - 设备-保养分项") +@RestController +@RequestMapping("/qms/resource/device-maintain-item") +@Validated +@FileUploadController(source = "qms.devicemaintainitem") +public class DeviceMaintainItemController extends AbstractFileUploadController implements BusinessControllerMarker{ + + static { + FileUploadController annotation = DeviceMaintainItemController.class.getAnnotation(FileUploadController.class); + if (annotation != null) { + setFileUploadInfo(annotation); + } + } + + @Resource + private DeviceMaintainItemService deviceMaintainItemService; + + @PostMapping("/create") + @Operation(summary = "创建设备-保养分项") + @PreAuthorize("@ss.hasPermission('qms:device-maintain-item:create')") + public CommonResult createDeviceMaintainItem(@Valid @RequestBody DeviceMaintainItemSaveReqVO createReqVO) { + return success(deviceMaintainItemService.createDeviceMaintainItem(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新设备-保养分项") + @PreAuthorize("@ss.hasPermission('qms:device-maintain-item:update')") + public CommonResult updateDeviceMaintainItem(@Valid @RequestBody DeviceMaintainItemSaveReqVO updateReqVO) { + deviceMaintainItemService.updateDeviceMaintainItem(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除设备-保养分项") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('qms:device-maintain-item:delete')") + public CommonResult deleteDeviceMaintainItem(@RequestParam("id") Long id) { + deviceMaintainItemService.deleteDeviceMaintainItem(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除设备-保养分项") + @PreAuthorize("@ss.hasPermission('qms:device-maintain-item:delete')") + public CommonResult deleteDeviceMaintainItemList(@RequestBody BatchDeleteReqVO req) { + deviceMaintainItemService.deleteDeviceMaintainItemListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得设备-保养分项") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('qms:device-maintain-item:query')") + public CommonResult getDeviceMaintainItem(@RequestParam("id") Long id) { + DeviceMaintainItemDO deviceMaintainItem = deviceMaintainItemService.getDeviceMaintainItem(id); + return success(BeanUtils.toBean(deviceMaintainItem, DeviceMaintainItemRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得设备-保养分项分页") + @PreAuthorize("@ss.hasPermission('qms:device-maintain-item:query')") + public CommonResult> getDeviceMaintainItemPage(@Valid DeviceMaintainItemPageReqVO pageReqVO) { + PageResult pageResult = deviceMaintainItemService.getDeviceMaintainItemPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, DeviceMaintainItemRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出设备-保养分项 Excel") + @PreAuthorize("@ss.hasPermission('qms:device-maintain-item:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportDeviceMaintainItemExcel(@Valid DeviceMaintainItemPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = deviceMaintainItemService.getDeviceMaintainItemPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "设备-保养分项.xls", "数据", DeviceMaintainItemRespVO.class, + BeanUtils.toBean(list, DeviceMaintainItemRespVO.class)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DevicePeriodCheckController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DevicePeriodCheckController.java new file mode 100644 index 0000000..ba78280 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DevicePeriodCheckController.java @@ -0,0 +1,118 @@ +package com.zt.plat.module.qms.resource.device.controller.admin; + +import com.zt.plat.module.qms.resource.device.controller.vo.DevicePeriodCheckPageReqVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DevicePeriodCheckRespVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DevicePeriodCheckSaveReqVO; +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.device.dal.dataobject.DevicePeriodCheckDO; +import com.zt.plat.module.qms.resource.device.service.DevicePeriodCheckService; + +@Tag(name = "管理后台 - 设备-期间核查") +@RestController +@RequestMapping("/qms/resource/device-period-check") +@Validated +@FileUploadController(source = "qms.deviceperiodcheck") +public class DevicePeriodCheckController extends AbstractFileUploadController implements BusinessControllerMarker{ + + static { + FileUploadController annotation = DevicePeriodCheckController.class.getAnnotation(FileUploadController.class); + if (annotation != null) { + setFileUploadInfo(annotation); + } + } + + @Resource + private DevicePeriodCheckService devicePeriodCheckService; + + @PostMapping("/create") + @Operation(summary = "创建设备-期间核查") + @PreAuthorize("@ss.hasPermission('qms:device-period-check:create')") + public CommonResult createDevicePeriodCheck(@Valid @RequestBody DevicePeriodCheckSaveReqVO createReqVO) { + return success(devicePeriodCheckService.createDevicePeriodCheck(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新设备-期间核查") + @PreAuthorize("@ss.hasPermission('qms:device-period-check:update')") + public CommonResult updateDevicePeriodCheck(@Valid @RequestBody DevicePeriodCheckSaveReqVO updateReqVO) { + devicePeriodCheckService.updateDevicePeriodCheck(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除设备-期间核查") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('qms:device-period-check:delete')") + public CommonResult deleteDevicePeriodCheck(@RequestParam("id") Long id) { + devicePeriodCheckService.deleteDevicePeriodCheck(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除设备-期间核查") + @PreAuthorize("@ss.hasPermission('qms:device-period-check:delete')") + public CommonResult deleteDevicePeriodCheckList(@RequestBody BatchDeleteReqVO req) { + devicePeriodCheckService.deleteDevicePeriodCheckListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得设备-期间核查") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('qms:device-period-check:query')") + public CommonResult getDevicePeriodCheck(@RequestParam("id") Long id) { + DevicePeriodCheckDO devicePeriodCheck = devicePeriodCheckService.getDevicePeriodCheck(id); + return success(BeanUtils.toBean(devicePeriodCheck, DevicePeriodCheckRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得设备-期间核查分页") + @PreAuthorize("@ss.hasPermission('qms:device-period-check:query')") + public CommonResult> getDevicePeriodCheckPage(@Valid DevicePeriodCheckPageReqVO pageReqVO) { + PageResult pageResult = devicePeriodCheckService.getDevicePeriodCheckPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, DevicePeriodCheckRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出设备-期间核查 Excel") + @PreAuthorize("@ss.hasPermission('qms:device-period-check:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportDevicePeriodCheckExcel(@Valid DevicePeriodCheckPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = devicePeriodCheckService.getDevicePeriodCheckPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "设备-期间核查.xls", "数据", DevicePeriodCheckRespVO.class, + BeanUtils.toBean(list, DevicePeriodCheckRespVO.class)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DevicePeriodCheckPlanController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DevicePeriodCheckPlanController.java new file mode 100644 index 0000000..5200e70 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DevicePeriodCheckPlanController.java @@ -0,0 +1,118 @@ +package com.zt.plat.module.qms.resource.device.controller.admin; + +import com.zt.plat.module.qms.resource.device.controller.vo.DevicePeriodCheckPlanPageReqVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DevicePeriodCheckPlanRespVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DevicePeriodCheckPlanSaveReqVO; +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.device.dal.dataobject.DevicePeriodCheckPlanDO; +import com.zt.plat.module.qms.resource.device.service.DevicePeriodCheckPlanService; + +@Tag(name = "管理后台 - 设备-期间核查计划") +@RestController +@RequestMapping("/qms/resource/device-period-check-plan") +@Validated +@FileUploadController(source = "qms.deviceperiodcheckplan") +public class DevicePeriodCheckPlanController extends AbstractFileUploadController implements BusinessControllerMarker{ + + static { + FileUploadController annotation = DevicePeriodCheckPlanController.class.getAnnotation(FileUploadController.class); + if (annotation != null) { + setFileUploadInfo(annotation); + } + } + + @Resource + private DevicePeriodCheckPlanService devicePeriodCheckPlanService; + + @PostMapping("/create") + @Operation(summary = "创建设备-期间核查计划") + @PreAuthorize("@ss.hasPermission('qms:device-period-check-plan:create')") + public CommonResult createDevicePeriodCheckPlan(@Valid @RequestBody DevicePeriodCheckPlanSaveReqVO createReqVO) { + return success(devicePeriodCheckPlanService.createDevicePeriodCheckPlan(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新设备-期间核查计划") + @PreAuthorize("@ss.hasPermission('qms:device-period-check-plan:update')") + public CommonResult updateDevicePeriodCheckPlan(@Valid @RequestBody DevicePeriodCheckPlanSaveReqVO updateReqVO) { + devicePeriodCheckPlanService.updateDevicePeriodCheckPlan(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除设备-期间核查计划") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('qms:device-period-check-plan:delete')") + public CommonResult deleteDevicePeriodCheckPlan(@RequestParam("id") Long id) { + devicePeriodCheckPlanService.deleteDevicePeriodCheckPlan(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除设备-期间核查计划") + @PreAuthorize("@ss.hasPermission('qms:device-period-check-plan:delete')") + public CommonResult deleteDevicePeriodCheckPlanList(@RequestBody BatchDeleteReqVO req) { + devicePeriodCheckPlanService.deleteDevicePeriodCheckPlanListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得设备-期间核查计划") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('qms:device-period-check-plan:query')") + public CommonResult getDevicePeriodCheckPlan(@RequestParam("id") Long id) { + DevicePeriodCheckPlanDO devicePeriodCheckPlan = devicePeriodCheckPlanService.getDevicePeriodCheckPlan(id); + return success(BeanUtils.toBean(devicePeriodCheckPlan, DevicePeriodCheckPlanRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得设备-期间核查计划分页") + @PreAuthorize("@ss.hasPermission('qms:device-period-check-plan:query')") + public CommonResult> getDevicePeriodCheckPlanPage(@Valid DevicePeriodCheckPlanPageReqVO pageReqVO) { + PageResult pageResult = devicePeriodCheckPlanService.getDevicePeriodCheckPlanPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, DevicePeriodCheckPlanRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出设备-期间核查计划 Excel") + @PreAuthorize("@ss.hasPermission('qms:device-period-check-plan:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportDevicePeriodCheckPlanExcel(@Valid DevicePeriodCheckPlanPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = devicePeriodCheckPlanService.getDevicePeriodCheckPlanPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "设备-期间核查计划.xls", "数据", DevicePeriodCheckPlanRespVO.class, + BeanUtils.toBean(list, DevicePeriodCheckPlanRespVO.class)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceRepairApplyController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceRepairApplyController.java new file mode 100644 index 0000000..b10728f --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceRepairApplyController.java @@ -0,0 +1,118 @@ +package com.zt.plat.module.qms.resource.device.controller.admin; + +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceRepairApplyPageReqVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceRepairApplyRespVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceRepairApplySaveReqVO; +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.device.dal.dataobject.DeviceRepairApplyDO; +import com.zt.plat.module.qms.resource.device.service.DeviceRepairApplyService; + +@Tag(name = "管理后台 - 维修申请") +@RestController +@RequestMapping("/qms/resource/device-repair-apply") +@Validated +@FileUploadController(source = "qms.devicerepairapply") +public class DeviceRepairApplyController extends AbstractFileUploadController implements BusinessControllerMarker{ + + static { + FileUploadController annotation = DeviceRepairApplyController.class.getAnnotation(FileUploadController.class); + if (annotation != null) { + setFileUploadInfo(annotation); + } + } + + @Resource + private DeviceRepairApplyService deviceRepairApplyService; + + @PostMapping("/create") + @Operation(summary = "创建维修申请") + @PreAuthorize("@ss.hasPermission('qms:device-repair-apply:create')") + public CommonResult createDeviceRepairApply(@Valid @RequestBody DeviceRepairApplySaveReqVO createReqVO) { + return success(deviceRepairApplyService.createDeviceRepairApply(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新维修申请") + @PreAuthorize("@ss.hasPermission('qms:device-repair-apply:update')") + public CommonResult updateDeviceRepairApply(@Valid @RequestBody DeviceRepairApplySaveReqVO updateReqVO) { + deviceRepairApplyService.updateDeviceRepairApply(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除维修申请") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('qms:device-repair-apply:delete')") + public CommonResult deleteDeviceRepairApply(@RequestParam("id") Long id) { + deviceRepairApplyService.deleteDeviceRepairApply(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除维修申请") + @PreAuthorize("@ss.hasPermission('qms:device-repair-apply:delete')") + public CommonResult deleteDeviceRepairApplyList(@RequestBody BatchDeleteReqVO req) { + deviceRepairApplyService.deleteDeviceRepairApplyListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得维修申请") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('qms:device-repair-apply:query')") + public CommonResult getDeviceRepairApply(@RequestParam("id") Long id) { + DeviceRepairApplyDO deviceRepairApply = deviceRepairApplyService.getDeviceRepairApply(id); + return success(BeanUtils.toBean(deviceRepairApply, DeviceRepairApplyRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得维修申请分页") + @PreAuthorize("@ss.hasPermission('qms:device-repair-apply:query')") + public CommonResult> getDeviceRepairApplyPage(@Valid DeviceRepairApplyPageReqVO pageReqVO) { + PageResult pageResult = deviceRepairApplyService.getDeviceRepairApplyPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, DeviceRepairApplyRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出维修申请 Excel") + @PreAuthorize("@ss.hasPermission('qms:device-repair-apply:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportDeviceRepairApplyExcel(@Valid DeviceRepairApplyPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = deviceRepairApplyService.getDeviceRepairApplyPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "维修申请.xls", "数据", DeviceRepairApplyRespVO.class, + BeanUtils.toBean(list, DeviceRepairApplyRespVO.class)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceRepairDetailController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceRepairDetailController.java new file mode 100644 index 0000000..4bd19f4 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceRepairDetailController.java @@ -0,0 +1,118 @@ +package com.zt.plat.module.qms.resource.device.controller.admin; + +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceRepairDetailPageReqVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceRepairDetailRespVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceRepairDetailSaveReqVO; +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.device.dal.dataobject.DeviceRepairDetailDO; +import com.zt.plat.module.qms.resource.device.service.DeviceRepairDetailService; + +@Tag(name = "管理后台 - 设备维修明细") +@RestController +@RequestMapping("/qms/resource/device-repair-detail") +@Validated +@FileUploadController(source = "qms.devicerepairdetail") +public class DeviceRepairDetailController extends AbstractFileUploadController implements BusinessControllerMarker{ + + static { + FileUploadController annotation = DeviceRepairDetailController.class.getAnnotation(FileUploadController.class); + if (annotation != null) { + setFileUploadInfo(annotation); + } + } + + @Resource + private DeviceRepairDetailService deviceRepairDetailService; + + @PostMapping("/create") + @Operation(summary = "创建设备维修明细") + @PreAuthorize("@ss.hasPermission('qms:device-repair-detail:create')") + public CommonResult createDeviceRepairDetail(@Valid @RequestBody DeviceRepairDetailSaveReqVO createReqVO) { + return success(deviceRepairDetailService.createDeviceRepairDetail(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新设备维修明细") + @PreAuthorize("@ss.hasPermission('qms:device-repair-detail:update')") + public CommonResult updateDeviceRepairDetail(@Valid @RequestBody DeviceRepairDetailSaveReqVO updateReqVO) { + deviceRepairDetailService.updateDeviceRepairDetail(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除设备维修明细") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('qms:device-repair-detail:delete')") + public CommonResult deleteDeviceRepairDetail(@RequestParam("id") Long id) { + deviceRepairDetailService.deleteDeviceRepairDetail(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除设备维修明细") + @PreAuthorize("@ss.hasPermission('qms:device-repair-detail:delete')") + public CommonResult deleteDeviceRepairDetailList(@RequestBody BatchDeleteReqVO req) { + deviceRepairDetailService.deleteDeviceRepairDetailListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得设备维修明细") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('qms:device-repair-detail:query')") + public CommonResult getDeviceRepairDetail(@RequestParam("id") Long id) { + DeviceRepairDetailDO deviceRepairDetail = deviceRepairDetailService.getDeviceRepairDetail(id); + return success(BeanUtils.toBean(deviceRepairDetail, DeviceRepairDetailRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得设备维修明细分页") + @PreAuthorize("@ss.hasPermission('qms:device-repair-detail:query')") + public CommonResult> getDeviceRepairDetailPage(@Valid DeviceRepairDetailPageReqVO pageReqVO) { + PageResult pageResult = deviceRepairDetailService.getDeviceRepairDetailPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, DeviceRepairDetailRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出设备维修明细 Excel") + @PreAuthorize("@ss.hasPermission('qms:device-repair-detail:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportDeviceRepairDetailExcel(@Valid DeviceRepairDetailPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = deviceRepairDetailService.getDeviceRepairDetailPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "设备维修明细.xls", "数据", DeviceRepairDetailRespVO.class, + BeanUtils.toBean(list, DeviceRepairDetailRespVO.class)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceRepairResultDetailController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceRepairResultDetailController.java new file mode 100644 index 0000000..0432fee --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceRepairResultDetailController.java @@ -0,0 +1,118 @@ +package com.zt.plat.module.qms.resource.device.controller.admin; + +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceRepairResultDetailPageReqVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceRepairResultDetailRespVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceRepairResultDetailSaveReqVO; +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.device.dal.dataobject.DeviceRepairResultDetailDO; +import com.zt.plat.module.qms.resource.device.service.DeviceRepairResultDetailService; + +@Tag(name = "管理后台 - 故障处理明细") +@RestController +@RequestMapping("/qms/resource/device-repair-result-detail") +@Validated +@FileUploadController(source = "qms.devicerepairresultdetail") +public class DeviceRepairResultDetailController extends AbstractFileUploadController implements BusinessControllerMarker{ + + static { + FileUploadController annotation = DeviceRepairResultDetailController.class.getAnnotation(FileUploadController.class); + if (annotation != null) { + setFileUploadInfo(annotation); + } + } + + @Resource + private DeviceRepairResultDetailService deviceRepairResultDetailService; + + @PostMapping("/create") + @Operation(summary = "创建故障处理明细") + @PreAuthorize("@ss.hasPermission('qms:device-repair-result-detail:create')") + public CommonResult createDeviceRepairResultDetail(@Valid @RequestBody DeviceRepairResultDetailSaveReqVO createReqVO) { + return success(deviceRepairResultDetailService.createDeviceRepairResultDetail(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新故障处理明细") + @PreAuthorize("@ss.hasPermission('qms:device-repair-result-detail:update')") + public CommonResult updateDeviceRepairResultDetail(@Valid @RequestBody DeviceRepairResultDetailSaveReqVO updateReqVO) { + deviceRepairResultDetailService.updateDeviceRepairResultDetail(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除故障处理明细") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('qms:device-repair-result-detail:delete')") + public CommonResult deleteDeviceRepairResultDetail(@RequestParam("id") Long id) { + deviceRepairResultDetailService.deleteDeviceRepairResultDetail(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除故障处理明细") + @PreAuthorize("@ss.hasPermission('qms:device-repair-result-detail:delete')") + public CommonResult deleteDeviceRepairResultDetailList(@RequestBody BatchDeleteReqVO req) { + deviceRepairResultDetailService.deleteDeviceRepairResultDetailListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得故障处理明细") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('qms:device-repair-result-detail:query')") + public CommonResult getDeviceRepairResultDetail(@RequestParam("id") Long id) { + DeviceRepairResultDetailDO deviceRepairResultDetail = deviceRepairResultDetailService.getDeviceRepairResultDetail(id); + return success(BeanUtils.toBean(deviceRepairResultDetail, DeviceRepairResultDetailRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得故障处理明细分页") + @PreAuthorize("@ss.hasPermission('qms:device-repair-result-detail:query')") + public CommonResult> getDeviceRepairResultDetailPage(@Valid DeviceRepairResultDetailPageReqVO pageReqVO) { + PageResult pageResult = deviceRepairResultDetailService.getDeviceRepairResultDetailPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, DeviceRepairResultDetailRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出故障处理明细 Excel") + @PreAuthorize("@ss.hasPermission('qms:device-repair-result-detail:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportDeviceRepairResultDetailExcel(@Valid DeviceRepairResultDetailPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = deviceRepairResultDetailService.getDeviceRepairResultDetailPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "故障处理明细.xls", "数据", DeviceRepairResultDetailRespVO.class, + BeanUtils.toBean(list, DeviceRepairResultDetailRespVO.class)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceUseRecordController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceUseRecordController.java new file mode 100644 index 0000000..f99070d --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceUseRecordController.java @@ -0,0 +1,154 @@ +package com.zt.plat.module.qms.resource.device.controller.admin; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.zt.plat.framework.security.core.LoginUser; +import com.zt.plat.framework.security.core.util.SecurityFrameworkUtils; +import com.zt.plat.module.qms.resource.device.controller.vo.*; +import com.zt.plat.module.qms.resource.device.dal.mapper.DeviceUseRecordMapper; +import com.zt.plat.module.qms.resource.device.service.DeviceInfomationService; +import org.springframework.util.ObjectUtils; +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 static com.zt.plat.module.qms.enums.ErrorCodeConstants.DEVICE_USE_RECORD_NOT_EXISTS; + +import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceUseRecordDO; +import com.zt.plat.module.qms.resource.device.service.DeviceUseRecordService; + +@Tag(name = "管理后台 - 设备-使用记录") +@RestController +@RequestMapping("/qms/resource/device-use-record") +@Validated +@FileUploadController(source = "qms.deviceuserecord") +public class DeviceUseRecordController extends AbstractFileUploadController implements BusinessControllerMarker{ + + static { + FileUploadController annotation = DeviceUseRecordController.class.getAnnotation(FileUploadController.class); + if (annotation != null) { + setFileUploadInfo(annotation); + } + } + + @Resource private DeviceUseRecordService deviceUseRecordService; + @Resource private DeviceInfomationService deviceInfomationService; + @Resource private DeviceUseRecordMapper deviceUseRecordMapper; + + @GetMapping("/queryPageListWithCount") + @Operation(summary = "使用记录分页列表查询(以设备为主数据)") + public CommonResult> queryPageListWithCount(@Valid DeviceUseRecordPageReqVO pageReqVO) { + PageResult pageResult = deviceUseRecordService.queryPageListWithCount(pageReqVO); + return success(pageResult); + } + + @GetMapping("/queryLastUsingData") + @Operation(summary = "查询设备最近一次使用中的记录") + @Parameter(name = "deviceId", description = "设备ID", required = true, example = "1024") + public CommonResult queryLastUsingData(@RequestParam("deviceId") Long deviceId) { + if(deviceId == null) + return CommonResult.error(DEVICE_USE_RECORD_NOT_EXISTS.getCode(), "设备ID不能为空"); + LambdaQueryWrapper query = new LambdaQueryWrapper<>(); + query.eq(DeviceUseRecordDO::getDeviceId, deviceId); + query.isNull(DeviceUseRecordDO::getUseTimeEnd); + query.orderByDesc(DeviceUseRecordDO::getUseTimeStart); + query.last("LIMIT 1"); + DeviceUseRecordDO recordDO = deviceUseRecordMapper.selectOne( query); + return success(BeanUtils.toBean(recordDO, DeviceUseRecordRespVO.class)); + } + + @PostMapping("/create") + @Operation(summary = "创建设备-使用记录") + public CommonResult createDeviceUseRecord(@Valid @RequestBody DeviceUseRecordSaveReqVO reqVO) { + Long deviceId = reqVO.getDeviceId(); + if(deviceId == null) + return CommonResult.error(DEVICE_USE_RECORD_NOT_EXISTS.getCode(), "设备ID不能为空"); + //检查设备状态 + CommonResult checkResult = deviceInfomationService.checkDeviceUsable(deviceId); + if(!checkResult.isSuccess()) + return CommonResult.error(checkResult); + return deviceUseRecordService.createDeviceUseRecord(reqVO); + } + + @PutMapping("/update") + @Operation(summary = "更新设备-使用记录") + @PreAuthorize("@ss.hasPermission('qms:device-use-record:update')") + public CommonResult updateDeviceUseRecord(@Valid @RequestBody DeviceUseRecordSaveReqVO reqVO) { + Long deviceId = reqVO.getDeviceId(); + if(deviceId == null) + return CommonResult.error(DEVICE_USE_RECORD_NOT_EXISTS.getCode(), "设备ID不能为空"); + deviceUseRecordService.updateDeviceUseRecord(reqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除设备-使用记录") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('qms:device-use-record:delete')") + public CommonResult deleteDeviceUseRecord(@RequestParam("id") Long id) { + deviceUseRecordService.deleteDeviceUseRecord(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除设备-使用记录") + @PreAuthorize("@ss.hasPermission('qms:device-use-record:delete')") + public CommonResult deleteDeviceUseRecordList(@RequestBody BatchDeleteReqVO req) { + deviceUseRecordService.deleteDeviceUseRecordListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得设备-使用记录") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('qms:device-use-record:query')") + public CommonResult getDeviceUseRecord(@RequestParam("id") Long id) { + DeviceUseRecordDO deviceUseRecord = deviceUseRecordService.getDeviceUseRecord(id); + return success(BeanUtils.toBean(deviceUseRecord, DeviceUseRecordRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得设备-使用记录分页") + public CommonResult> getDeviceUseRecordPage(@Valid DeviceUseRecordPageReqVO pageReqVO) { + PageResult pageResult = deviceUseRecordService.getDeviceUseRecordPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, DeviceUseRecordRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出设备-使用记录 Excel") + @PreAuthorize("@ss.hasPermission('qms:device-use-record:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportDeviceUseRecordExcel(@Valid DeviceUseRecordPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = deviceUseRecordService.getDeviceUseRecordPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "设备-使用记录.xls", "数据", DeviceUseRecordRespVO.class, + BeanUtils.toBean(list, DeviceUseRecordRespVO.class)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceAffiliationRelativityPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceAffiliationRelativityPageReqVO.java new file mode 100644 index 0000000..f78f134 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceAffiliationRelativityPageReqVO.java @@ -0,0 +1,35 @@ +package com.zt.plat.module.qms.resource.device.controller.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 DeviceAffiliationRelativityPageReqVO extends PageParam { + + @Schema(description = "主设备id", example = "20920") + private Long parentProductId; + + @Schema(description = "子设备id", example = "28766") + private Long childDeviceId; + + @Schema(description = "排序号") + private Integer sortNo; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceAffiliationRelativityRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceAffiliationRelativityRespVO.java new file mode 100644 index 0000000..e5fc5e3 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceAffiliationRelativityRespVO.java @@ -0,0 +1,43 @@ +package com.zt.plat.module.qms.resource.device.controller.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 DeviceAffiliationRelativityRespVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "30536") + @ExcelProperty("ID") + private Long id; + + @Schema(description = "主设备id", example = "20920") + @ExcelProperty("主设备id") + private Long parentProductId; + + @Schema(description = "子设备id", example = "28766") + @ExcelProperty("子设备id") + private Long childDeviceId; + + @Schema(description = "排序号") + @ExcelProperty("排序号") + private Integer sortNo; + + @Schema(description = "所属部门") + @ExcelProperty("所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + @ExcelProperty("备注") + private String remark; + + @Schema(description = "创建时间") + @ExcelProperty("创建时间") + private LocalDateTime createTime; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceAffiliationRelativitySaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceAffiliationRelativitySaveReqVO.java new file mode 100644 index 0000000..4043c31 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceAffiliationRelativitySaveReqVO.java @@ -0,0 +1,30 @@ +package com.zt.plat.module.qms.resource.device.controller.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 DeviceAffiliationRelativitySaveReqVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "30536") + private Long id; + + @Schema(description = "主设备id", example = "20920") + private Long parentProductId; + + @Schema(description = "子设备id", example = "28766") + private Long childDeviceId; + + @Schema(description = "排序号") + private Integer sortNo; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceApplyDetailPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceApplyDetailPageReqVO.java new file mode 100644 index 0000000..96a9202 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceApplyDetailPageReqVO.java @@ -0,0 +1,38 @@ +package com.zt.plat.module.qms.resource.device.controller.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 DeviceApplyDetailPageReqVO extends PageParam { + + @Schema(description = "父ID", example = "12485") + private Long applyId; + + @Schema(description = "设备id", example = "140") + private Long deviceInfomationId; + + @Schema(description = "设备借用明细id", example = "16899") + private Long deviceBorrowDetailId; + + @Schema(description = "表单数据,表单数据") + private String formData; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceApplyDetailRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceApplyDetailRespVO.java new file mode 100644 index 0000000..fbc1ceb --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceApplyDetailRespVO.java @@ -0,0 +1,47 @@ +package com.zt.plat.module.qms.resource.device.controller.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 DeviceApplyDetailRespVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "17120") + @ExcelProperty("ID") + private Long id; + + @Schema(description = "父ID", example = "12485") + @ExcelProperty("父ID") + private Long applyId; + + @Schema(description = "设备id", example = "140") + @ExcelProperty("设备id") + private Long deviceInfomationId; + + @Schema(description = "设备借用明细id", example = "16899") + @ExcelProperty("设备借用明细id") + private Long deviceBorrowDetailId; + + @Schema(description = "表单数据,表单数据") + @ExcelProperty("表单数据,表单数据") + private String formData; + + @Schema(description = "所属部门") + @ExcelProperty("所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + @ExcelProperty("备注") + private String remark; + + @Schema(description = "创建时间") + @ExcelProperty("创建时间") + private LocalDateTime createTime; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceApplyDetailSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceApplyDetailSaveReqVO.java new file mode 100644 index 0000000..3a0307d --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceApplyDetailSaveReqVO.java @@ -0,0 +1,33 @@ +package com.zt.plat.module.qms.resource.device.controller.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 DeviceApplyDetailSaveReqVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "17120") + private Long id; + + @Schema(description = "父ID", example = "12485") + private Long applyId; + + @Schema(description = "设备id", example = "140") + private Long deviceInfomationId; + + @Schema(description = "设备借用明细id", example = "16899") + private Long deviceBorrowDetailId; + + @Schema(description = "表单数据,表单数据") + private String formData; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceApplyPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceApplyPageReqVO.java new file mode 100644 index 0000000..7a49d2e --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceApplyPageReqVO.java @@ -0,0 +1,90 @@ +package com.zt.plat.module.qms.resource.device.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 DeviceApplyPageReqVO extends PageParam { + + @Schema(description = "业务名称,【字典】【jy_device_lifecycle_bsn_type】验收、降级、停用、报废、还原、启用等", example = "王五") + private String businessName; + + @Schema(description = "申请部门", example = "王五") + private String applyDepartmentName; + + @Schema(description = "申请部门ID") + private String applyDepartment; + + @Schema(description = "申请人", example = "ZT") + private String applyUserName; + + @Schema(description = "申请人ID") + private String applyUser; + + @Schema(description = "业务编码") + private String businessCode; + + @Schema(description = "业务日期") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] businessDate; + + @Schema(description = "业务原因") + private String businessReason; + + @Schema(description = "业务状态", example = "1") + private String businessStatus; + + @Schema(description = "借用人") + private String businessUser; + + @Schema(description = "借用人id", example = "30865") + private Long businessUserId; + + @Schema(description = "借用部门") + private String businessDepartment; + + @Schema(description = "借用部门id", example = "3852") + private Long businessDepartmentId; + + @Schema(description = "计划归还日期") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] planGivebackDate; + + @Schema(description = "归还接收人") + private String givebackReceiveUser; + + @Schema(description = "归还接收人id", example = "1499") + private Long givebackReceiveUserId; + + @Schema(description = "表单模板ID", example = "23422") + private String templateId; + + @Schema(description = "表单组件") + private String formComponent; + + @Schema(description = "数据集配置ID", example = "17263") + private Long dataCollectionId; + + @Schema(description = "表单数据") + private String formData; + + @Schema(description = "流程实例id", example = "289") + private String flowInstanceId; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceApplyRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceApplyRespVO.java new file mode 100644 index 0000000..42ad701 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceApplyRespVO.java @@ -0,0 +1,114 @@ +package com.zt.plat.module.qms.resource.device.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 DeviceApplyRespVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "23536") + @ExcelProperty("ID") + private Long id; + + @Schema(description = "业务名称,【字典】【jy_device_lifecycle_bsn_type】验收、降级、停用、报废、还原、启用等", example = "王五") + @ExcelProperty("业务名称,【字典】【jy_device_lifecycle_bsn_type】验收、降级、停用、报废、还原、启用等") + private String businessName; + + @Schema(description = "申请部门", example = "王五") + @ExcelProperty("申请部门") + private String applyDepartmentName; + + @Schema(description = "申请部门ID") + @ExcelProperty("申请部门ID") + private String applyDepartment; + + @Schema(description = "申请人", example = "ZT") + @ExcelProperty("申请人") + private String applyUserName; + + @Schema(description = "申请人ID") + @ExcelProperty("申请人ID") + private String applyUser; + + @Schema(description = "业务编码") + @ExcelProperty("业务编码") + private String businessCode; + + @Schema(description = "业务日期") + @ExcelProperty("业务日期") + private LocalDateTime businessDate; + + @Schema(description = "业务原因") + @ExcelProperty("业务原因") + private String businessReason; + + @Schema(description = "业务状态", example = "1") + @ExcelProperty("业务状态") + private String businessStatus; + + @Schema(description = "借用人") + @ExcelProperty("借用人") + private String businessUser; + + @Schema(description = "借用人id", example = "30865") + @ExcelProperty("借用人id") + private Long businessUserId; + + @Schema(description = "借用部门") + @ExcelProperty("借用部门") + private String businessDepartment; + + @Schema(description = "借用部门id", example = "3852") + @ExcelProperty("借用部门id") + private Long businessDepartmentId; + + @Schema(description = "计划归还日期") + @ExcelProperty("计划归还日期") + private LocalDateTime planGivebackDate; + + @Schema(description = "归还接收人") + @ExcelProperty("归还接收人") + private String givebackReceiveUser; + + @Schema(description = "归还接收人id", example = "1499") + @ExcelProperty("归还接收人id") + private Long givebackReceiveUserId; + + @Schema(description = "表单模板ID", example = "23422") + @ExcelProperty("表单模板ID") + private String templateId; + + @Schema(description = "表单组件") + @ExcelProperty("表单组件") + private String formComponent; + + @Schema(description = "数据集配置ID", example = "17263") + @ExcelProperty("数据集配置ID") + private Long dataCollectionId; + + @Schema(description = "表单数据") + @ExcelProperty("表单数据") + private String formData; + + @Schema(description = "流程实例id", example = "289") + @ExcelProperty("流程实例id") + private String flowInstanceId; + + @Schema(description = "所属部门") + @ExcelProperty("所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + @ExcelProperty("备注") + private String remark; + + @Schema(description = "创建时间") + @ExcelProperty("创建时间") + private LocalDateTime createTime; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceApplySaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceApplySaveReqVO.java new file mode 100644 index 0000000..f423ba3 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceApplySaveReqVO.java @@ -0,0 +1,84 @@ +package com.zt.plat.module.qms.resource.device.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; + +import java.time.LocalDateTime; + +@Schema(description = "管理后台 - 设备通用流程,验收、降级、停用、报废、还原、启用新增/修改 Request VO") +@Data +public class DeviceApplySaveReqVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "23536") + private Long id; + + @Schema(description = "业务名称,【字典】【jy_device_lifecycle_bsn_type】验收、降级、停用、报废、还原、启用等", example = "王五") + private String businessName; + + @Schema(description = "申请部门", example = "王五") + private String applyDepartmentName; + + @Schema(description = "申请部门ID") + private String applyDepartment; + + @Schema(description = "申请人", example = "ZT") + private String applyUserName; + + @Schema(description = "申请人ID") + private String applyUser; + + @Schema(description = "业务编码") + private String businessCode; + + @Schema(description = "业务日期") + private LocalDateTime businessDate; + + @Schema(description = "业务原因") + private String businessReason; + + @Schema(description = "业务状态", example = "1") + private String businessStatus; + + @Schema(description = "借用人") + private String businessUser; + + @Schema(description = "借用人id", example = "30865") + private Long businessUserId; + + @Schema(description = "借用部门") + private String businessDepartment; + + @Schema(description = "借用部门id", example = "3852") + private Long businessDepartmentId; + + @Schema(description = "计划归还日期") + private LocalDateTime planGivebackDate; + + @Schema(description = "归还接收人") + private String givebackReceiveUser; + + @Schema(description = "归还接收人id", example = "1499") + private Long givebackReceiveUserId; + + @Schema(description = "表单模板ID", example = "23422") + private String templateId; + + @Schema(description = "表单组件") + private String formComponent; + + @Schema(description = "数据集配置ID", example = "17263") + private Long dataCollectionId; + + @Schema(description = "表单数据") + private String formData; + + @Schema(description = "流程实例id", example = "289") + private String flowInstanceId; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceCalibrationPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceCalibrationPageReqVO.java new file mode 100644 index 0000000..86b116e --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceCalibrationPageReqVO.java @@ -0,0 +1,87 @@ +package com.zt.plat.module.qms.resource.device.controller.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 DeviceCalibrationPageReqVO extends PageParam { + + @Schema(description = "检定校准计划id", example = "22068") + private Long planId; + + @Schema(description = "有效标识") + private String effectiveFlag; + + @Schema(description = "设备id", example = "21116") + private Long deviceId; + + @Schema(description = "供应商名称", example = "赵六") + private String supplierName; + + @Schema(description = "供应商ID", example = "24250") + private Long supplierId; + + @Schema(description = "校准点/范围") + private String specification; + + @Schema(description = "计划检定校准日期") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] planCheckDate; + + @Schema(description = "上次检定校准日期") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] lastCheckDate; + + @Schema(description = "频次") + private String frequencyRemark; + + @Schema(description = "类型:检定|校准", example = "2") + private String checkType; + + @Schema(description = "检定校准日期") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] checkDate; + + @Schema(description = "检定校准单位") + private String agent; + + @Schema(description = "证书编号") + private String certificateCode; + + @Schema(description = "有效期") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] validityDate; + + @Schema(description = "确认情况(理由)") + private String checkContent; + + @Schema(description = "确认结果") + private String checkResult; + + @Schema(description = "检定校准状态", example = "2") + private String flowStatus; + + @Schema(description = "流程实例id", example = "24905") + private String flowInstanceId; + + @Schema(description = "作废状态") + private Integer cancelFlag; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceCalibrationPlanPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceCalibrationPlanPageReqVO.java new file mode 100644 index 0000000..2759666 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceCalibrationPlanPageReqVO.java @@ -0,0 +1,56 @@ +package com.zt.plat.module.qms.resource.device.controller.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 DeviceCalibrationPlanPageReqVO extends PageParam { + + @Schema(description = "汇总计划id", example = "11537") + private Long productId; + + @Schema(description = "年度") + private String checkYear; + + @Schema(description = "申请人", example = "赵六") + private String applyUserName; + + @Schema(description = "流程实例id", example = "24442") + private String flowInstanceId; + + @Schema(description = "审批状态", example = "2") + private String flowStatus; + + @Schema(description = "申请标题") + private String title; + + @Schema(description = "班组提交标识:1-已提交") + private Integer basicSubmitFlag; + + @Schema(description = "退回意见") + private String rollbackRemark; + + @Schema(description = "数据类型:班组/汇总", example = "1") + private String dataType; + + @Schema(description = "作废标识:0-有效;1-作废") + private String cancelFlag; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceCalibrationPlanRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceCalibrationPlanRespVO.java new file mode 100644 index 0000000..185e0ac --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceCalibrationPlanRespVO.java @@ -0,0 +1,71 @@ +package com.zt.plat.module.qms.resource.device.controller.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 DeviceCalibrationPlanRespVO { + + @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "4957") + @ExcelProperty("主键") + private Long id; + + @Schema(description = "汇总计划id", example = "11537") + @ExcelProperty("汇总计划id") + private Long productId; + + @Schema(description = "年度") + @ExcelProperty("年度") + private String checkYear; + + @Schema(description = "申请人", example = "赵六") + @ExcelProperty("申请人") + private String applyUserName; + + @Schema(description = "流程实例id", example = "24442") + @ExcelProperty("流程实例id") + private String flowInstanceId; + + @Schema(description = "审批状态", example = "2") + @ExcelProperty("审批状态") + private String flowStatus; + + @Schema(description = "申请标题") + @ExcelProperty("申请标题") + private String title; + + @Schema(description = "班组提交标识:1-已提交") + @ExcelProperty("班组提交标识:1-已提交") + private Integer basicSubmitFlag; + + @Schema(description = "退回意见") + @ExcelProperty("退回意见") + private String rollbackRemark; + + @Schema(description = "数据类型:班组/汇总", example = "1") + @ExcelProperty("数据类型:班组/汇总") + private String dataType; + + @Schema(description = "作废标识:0-有效;1-作废") + @ExcelProperty("作废标识:0-有效;1-作废") + private String cancelFlag; + + @Schema(description = "所属部门") + @ExcelProperty("所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + @ExcelProperty("备注") + private String remark; + + @Schema(description = "创建时间") + @ExcelProperty("创建时间") + private LocalDateTime createTime; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceCalibrationPlanSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceCalibrationPlanSaveReqVO.java new file mode 100644 index 0000000..a419b67 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceCalibrationPlanSaveReqVO.java @@ -0,0 +1,51 @@ +package com.zt.plat.module.qms.resource.device.controller.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 DeviceCalibrationPlanSaveReqVO { + + @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "4957") + private Long id; + + @Schema(description = "汇总计划id", example = "11537") + private Long productId; + + @Schema(description = "年度") + private String checkYear; + + @Schema(description = "申请人", example = "赵六") + private String applyUserName; + + @Schema(description = "流程实例id", example = "24442") + private String flowInstanceId; + + @Schema(description = "审批状态", example = "2") + private String flowStatus; + + @Schema(description = "申请标题") + private String title; + + @Schema(description = "班组提交标识:1-已提交") + private Integer basicSubmitFlag; + + @Schema(description = "退回意见") + private String rollbackRemark; + + @Schema(description = "数据类型:班组/汇总", example = "1") + private String dataType; + + @Schema(description = "作废标识:0-有效;1-作废") + private String cancelFlag; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceCalibrationRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceCalibrationRespVO.java new file mode 100644 index 0000000..3dda46a --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceCalibrationRespVO.java @@ -0,0 +1,107 @@ +package com.zt.plat.module.qms.resource.device.controller.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 DeviceCalibrationRespVO { + + @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "26716") + @ExcelProperty("主键") + private Long id; + + @Schema(description = "检定校准计划id", example = "22068") + @ExcelProperty("检定校准计划id") + private Long planId; + + @Schema(description = "有效标识") + @ExcelProperty("有效标识") + private String effectiveFlag; + + @Schema(description = "设备id", example = "21116") + @ExcelProperty("设备id") + private Long deviceId; + + @Schema(description = "供应商名称", example = "赵六") + @ExcelProperty("供应商名称") + private Long supplierName; + + @Schema(description = "供应商ID", example = "24250") + @ExcelProperty("供应商ID") + private Long supplierId; + + @Schema(description = "校准点/范围") + @ExcelProperty("校准点/范围") + private String specification; + + @Schema(description = "计划检定校准日期") + @ExcelProperty("计划检定校准日期") + private LocalDateTime planCheckDate; + + @Schema(description = "上次检定校准日期") + @ExcelProperty("上次检定校准日期") + private LocalDateTime lastCheckDate; + + @Schema(description = "频次") + @ExcelProperty("频次") + private String frequencyRemark; + + @Schema(description = "类型:检定|校准", example = "2") + @ExcelProperty("类型:检定|校准") + private String checkType; + + @Schema(description = "检定校准日期") + @ExcelProperty("检定校准日期") + private LocalDateTime checkDate; + + @Schema(description = "检定校准单位") + @ExcelProperty("检定校准单位") + private String agent; + + @Schema(description = "证书编号") + @ExcelProperty("证书编号") + private String certificateCode; + + @Schema(description = "有效期") + @ExcelProperty("有效期") + private LocalDateTime validityDate; + + @Schema(description = "确认情况(理由)") + @ExcelProperty("确认情况(理由)") + private String checkContent; + + @Schema(description = "确认结果") + @ExcelProperty("确认结果") + private String checkResult; + + @Schema(description = "检定校准状态", example = "2") + @ExcelProperty("检定校准状态") + private String flowStatus; + + @Schema(description = "流程实例id", example = "24905") + @ExcelProperty("流程实例id") + private String flowInstanceId; + + @Schema(description = "作废状态") + @ExcelProperty("作废状态") + private Integer cancelFlag; + + @Schema(description = "所属部门") + @ExcelProperty("所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + @ExcelProperty("备注") + private String remark; + + @Schema(description = "创建时间") + @ExcelProperty("创建时间") + private LocalDateTime createTime; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceCalibrationSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceCalibrationSaveReqVO.java new file mode 100644 index 0000000..7f5051b --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceCalibrationSaveReqVO.java @@ -0,0 +1,80 @@ +package com.zt.plat.module.qms.resource.device.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import jakarta.validation.constraints.*; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +@Schema(description = "管理后台 - 设备-检定校准新增/修改 Request VO") +@Data +public class DeviceCalibrationSaveReqVO { + + @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "26716") + private Long id; + + @Schema(description = "检定校准计划id", example = "22068") + private Long planId; + + @Schema(description = "有效标识") + private String effectiveFlag; + + @Schema(description = "设备id", example = "21116") + private Long deviceId; + + @Schema(description = "供应商名称", example = "赵六") + private Long supplierName; + + @Schema(description = "供应商ID", example = "24250") + private Long supplierId; + + @Schema(description = "校准点/范围") + private String specification; + + @Schema(description = "计划检定校准日期") + private LocalDateTime planCheckDate; + + @Schema(description = "上次检定校准日期") + private LocalDateTime lastCheckDate; + + @Schema(description = "频次") + private String frequencyRemark; + + @Schema(description = "类型:检定|校准", example = "2") + private String checkType; + + @Schema(description = "检定校准日期") + private LocalDateTime checkDate; + + @Schema(description = "检定校准单位") + private String agent; + + @Schema(description = "证书编号") + private String certificateCode; + + @Schema(description = "有效期") + private LocalDateTime validityDate; + + @Schema(description = "确认情况(理由)") + private String checkContent; + + @Schema(description = "确认结果") + private String checkResult; + + @Schema(description = "检定校准状态", example = "2") + private String flowStatus; + + @Schema(description = "流程实例id", example = "24905") + private String flowInstanceId; + + @Schema(description = "作废状态") + private Integer cancelFlag; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceConfigBusinessItemPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceConfigBusinessItemPageReqVO.java new file mode 100644 index 0000000..5c3cd7c --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceConfigBusinessItemPageReqVO.java @@ -0,0 +1,56 @@ +package com.zt.plat.module.qms.resource.device.controller.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 DeviceConfigBusinessItemPageReqVO extends PageParam { + + @Schema(description = "业务规则id", example = "25405") + private Long ruleId; + + @Schema(description = "业务键") + private String itemKey; + + @Schema(description = "项目名称", example = "张三") + private String itemName; + + @Schema(description = "频次类型", example = "1") + private String frequencyType; + + @Schema(description = "频次") + private String frequency; + + @Schema(description = "检查标准") + private String standard; + + @Schema(description = "检查方法") + private String itemMethod; + + @Schema(description = "频次说明") + private String frequencyRemark; + + @Schema(description = "责任人") + private String dutyRemark; + + @Schema(description = "排序号") + private Integer orderNo; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceConfigBusinessItemRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceConfigBusinessItemRespVO.java new file mode 100644 index 0000000..e5ea6ea --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceConfigBusinessItemRespVO.java @@ -0,0 +1,71 @@ +package com.zt.plat.module.qms.resource.device.controller.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 DeviceConfigBusinessItemRespVO { + + @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "31814") + @ExcelProperty("主键") + private Long id; + + @Schema(description = "业务规则id", example = "25405") + @ExcelProperty("业务规则id") + private Long ruleId; + + @Schema(description = "业务键") + @ExcelProperty("业务键") + private String itemKey; + + @Schema(description = "项目名称", example = "张三") + @ExcelProperty("项目名称") + private String itemName; + + @Schema(description = "频次类型", example = "1") + @ExcelProperty("频次类型") + private String frequencyType; + + @Schema(description = "频次") + @ExcelProperty("频次") + private String frequency; + + @Schema(description = "检查标准") + @ExcelProperty("检查标准") + private String standard; + + @Schema(description = "检查方法") + @ExcelProperty("检查方法") + private String itemMethod; + + @Schema(description = "频次说明") + @ExcelProperty("频次说明") + private String frequencyRemark; + + @Schema(description = "责任人") + @ExcelProperty("责任人") + private String dutyRemark; + + @Schema(description = "排序号") + @ExcelProperty("排序号") + private Integer orderNo; + + @Schema(description = "所属部门") + @ExcelProperty("所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + @ExcelProperty("备注") + private String remark; + + @Schema(description = "创建时间") + @ExcelProperty("创建时间") + private LocalDateTime createTime; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceConfigBusinessItemSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceConfigBusinessItemSaveReqVO.java new file mode 100644 index 0000000..b52fa3e --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceConfigBusinessItemSaveReqVO.java @@ -0,0 +1,51 @@ +package com.zt.plat.module.qms.resource.device.controller.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 DeviceConfigBusinessItemSaveReqVO { + + @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "31814") + private Long id; + + @Schema(description = "业务规则id", example = "25405") + private Long ruleId; + + @Schema(description = "业务键") + private String itemKey; + + @Schema(description = "项目名称", example = "张三") + private String itemName; + + @Schema(description = "频次类型", example = "1") + private String frequencyType; + + @Schema(description = "频次") + private String frequency; + + @Schema(description = "检查标准") + private String standard; + + @Schema(description = "检查方法") + private String itemMethod; + + @Schema(description = "频次说明") + private String frequencyRemark; + + @Schema(description = "责任人") + private String dutyRemark; + + @Schema(description = "排序号") + private Integer orderNo; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceConfigBusinessRulePageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceConfigBusinessRulePageReqVO.java new file mode 100644 index 0000000..02044f8 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceConfigBusinessRulePageReqVO.java @@ -0,0 +1,64 @@ +package com.zt.plat.module.qms.resource.device.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 DeviceConfigBusinessRulePageReqVO extends PageParam { + + @Schema(description = "产品id", example = "28944") + private Long productId; + + @Schema(description = "业务领域") + private String businessDomain; + + @Schema(description = "是否需要") + private String requireFlag; + + @Schema(description = "子业务类型", example = "2") + private String subitemDomainType; + + @Schema(description = "频次类型", example = "2") + private String frequencyType; + + @Schema(description = "频次") + private String frequency; + + @Schema(description = "频次说明") + private String frequencyRemark; + + @Schema(description = "报表模板") + private String reportTemplateKey; + + @Schema(description = "表单组件") + private String formComponent; + + @Schema(description = "处理方法") + private String treatmentMethod; + + @Schema(description = "处理人") + private String treatmentUser; + + @Schema(description = "检定/校准类型", example = "1") + private String calibrationCheckType; + + @Schema(description = "标准/规范") + private String standard; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceConfigBusinessRuleRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceConfigBusinessRuleRespVO.java new file mode 100644 index 0000000..4159825 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceConfigBusinessRuleRespVO.java @@ -0,0 +1,82 @@ +package com.zt.plat.module.qms.resource.device.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 DeviceConfigBusinessRuleRespVO { + + @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "2207") + @ExcelProperty("主键") + private Long id; + + @Schema(description = "产品id", example = "28944") + @ExcelProperty("产品id") + private Long productId; + + @Schema(description = "业务领域") + @ExcelProperty("业务领域") + private String businessDomain; + + @Schema(description = "是否需要") + @ExcelProperty("是否需要") + private String requireFlag; + + @Schema(description = "子业务类型", example = "2") + @ExcelProperty("子业务类型") + private String subitemDomainType; + + @Schema(description = "频次类型", example = "2") + @ExcelProperty("频次类型") + private String frequencyType; + + @Schema(description = "频次") + @ExcelProperty("频次") + private String frequency; + + @Schema(description = "频次说明") + @ExcelProperty("频次说明") + private String frequencyRemark; + + @Schema(description = "报表模板") + @ExcelProperty("报表模板") + private String reportTemplateKey; + + @Schema(description = "表单组件") + @ExcelProperty("表单组件") + private String formComponent; + + @Schema(description = "处理方法") + @ExcelProperty("处理方法") + private String treatmentMethod; + + @Schema(description = "处理人") + @ExcelProperty("处理人") + private String treatmentUser; + + @Schema(description = "检定/校准类型", example = "1") + @ExcelProperty("检定/校准类型") + private String calibrationCheckType; + + @Schema(description = "标准/规范") + @ExcelProperty("标准/规范") + private String standard; + + @Schema(description = "所属部门") + @ExcelProperty("所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + @ExcelProperty("备注") + private String remark; + + @Schema(description = "创建时间") + @ExcelProperty("创建时间") + private LocalDateTime createTime; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceConfigBusinessRuleSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceConfigBusinessRuleSaveReqVO.java new file mode 100644 index 0000000..e1bc84e --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceConfigBusinessRuleSaveReqVO.java @@ -0,0 +1,58 @@ +package com.zt.plat.module.qms.resource.device.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; + +@Schema(description = "管理后台 - 设备-业务配置新增/修改 Request VO") +@Data +public class DeviceConfigBusinessRuleSaveReqVO { + + @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "2207") + private Long id; + + @Schema(description = "产品id", example = "28944") + private Long productId; + + @Schema(description = "业务领域") + private String businessDomain; + + @Schema(description = "是否需要") + private String requireFlag; + + @Schema(description = "子业务类型", example = "2") + private String subitemDomainType; + + @Schema(description = "频次类型", example = "2") + private String frequencyType; + + @Schema(description = "频次") + private String frequency; + + @Schema(description = "频次说明") + private String frequencyRemark; + + @Schema(description = "报表模板") + private String reportTemplateKey; + + @Schema(description = "表单组件") + private String formComponent; + + @Schema(description = "处理方法") + private String treatmentMethod; + + @Schema(description = "处理人") + private String treatmentUser; + + @Schema(description = "检定/校准类型", example = "1") + private String calibrationCheckType; + + @Schema(description = "标准/规范") + private String standard; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceConfigFlowPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceConfigFlowPageReqVO.java new file mode 100644 index 0000000..17e7be0 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceConfigFlowPageReqVO.java @@ -0,0 +1,49 @@ +package com.zt.plat.module.qms.resource.device.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 DeviceConfigFlowPageReqVO extends PageParam { + + @Schema(description = "业务类型", example = "2") + private String businessType; + + @Schema(description = "业务类型名称", example = "王五") + private String businessName; + + @Schema(description = "流程key") + private String flowKey; + + @Schema(description = "数据集配置Key") + private String dataCollectionKey; + + @Schema(description = "表单模板key") + private String templateKey; + + @Schema(description = "表单组件") + private String formComponent; + + @Schema(description = "其他配置") + private String customConfig; + + @Schema(description = "排序号") + private Integer orderNo; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceConfigFlowRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceConfigFlowRespVO.java new file mode 100644 index 0000000..a373f6a --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceConfigFlowRespVO.java @@ -0,0 +1,60 @@ +package com.zt.plat.module.qms.resource.device.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 DeviceConfigFlowRespVO { + + @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "6744") + @ExcelProperty("主键") + private Long id; + + @Schema(description = "业务类型", example = "2") + @ExcelProperty("业务类型") + private String businessType; + + @Schema(description = "业务类型名称", example = "王五") + @ExcelProperty("业务类型名称") + private String businessName; + + @Schema(description = "流程key") + @ExcelProperty("流程key") + private String flowKey; + + @Schema(description = "数据集配置Key") + @ExcelProperty("数据集配置ID") + private String dataCollectionKey; + + @Schema(description = "表单模板key") + @ExcelProperty("表单模板key") + private String templateKey; + + @Schema(description = "表单组件") + @ExcelProperty("表单组件") + private String formComponent; + + @Schema(description = "其他配置") + private String customConfig;; + + @Schema(description = "排序号") + private Integer orderNo; + + @Schema(description = "所属部门") + @ExcelProperty("所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + @ExcelProperty("备注") + private String remark; + + @Schema(description = "创建时间") + @ExcelProperty("创建时间") + private LocalDateTime createTime; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceConfigFlowSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceConfigFlowSaveReqVO.java new file mode 100644 index 0000000..e72d4f8 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceConfigFlowSaveReqVO.java @@ -0,0 +1,43 @@ +package com.zt.plat.module.qms.resource.device.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; + +@Schema(description = "管理后台 - 设备通用流程配置新增/修改 Request VO") +@Data +public class DeviceConfigFlowSaveReqVO { + + @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "6744") + private Long id; + + @Schema(description = "业务类型", example = "2") + private String businessType; + + @Schema(description = "业务类型名称", example = "王五") + private String businessName; + + @Schema(description = "流程key") + private String flowKey; + + @Schema(description = "数据集配置Key") + private String dataCollectionKey; + + @Schema(description = "表单模板key") + private String templateKey; + + @Schema(description = "表单组件") + private String formComponent; + + @Schema(description = "其他配置") + private String customConfig;; + + @Schema(description = "排序号") + private Integer orderNo; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceInfomationPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceInfomationPageReqVO.java index 341ebc7..dbb3db7 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceInfomationPageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceInfomationPageReqVO.java @@ -19,7 +19,7 @@ public class DeviceInfomationPageReqVO extends PageParam { private Long productId; @Schema(description = "设备名称", example = "张三") - private String productName; + private String deviceName; @Schema(description = "别名") private String alias; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceInfomationRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceInfomationRespVO.java index 44ea0d7..cc6549a 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceInfomationRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceInfomationRespVO.java @@ -23,7 +23,7 @@ public class DeviceInfomationRespVO { @Schema(description = "设备名称", example = "张三") @ExcelProperty("设备名称") - private String productName; + private String deviceName; @Schema(description = "别名") @ExcelProperty("别名") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceInfomationSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceInfomationSaveReqVO.java index 0b72082..7c087f3 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceInfomationSaveReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceInfomationSaveReqVO.java @@ -1,11 +1,12 @@ package com.zt.plat.module.qms.resource.device.controller.vo; 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.Date; @Schema(description = "管理后台 - 设备-设备信息新增/修改 Request VO") @Data @@ -15,10 +16,11 @@ public class DeviceInfomationSaveReqVO { private Long id; @Schema(description = "设备大类id", example = "32101") + @NotNull(message = "请选择设备大类!") private Long productId; @Schema(description = "设备名称", example = "张三") - private String productName; + private String deviceName; @Schema(description = "别名") private String alias; @@ -54,6 +56,7 @@ public class DeviceInfomationSaveReqVO { private String deviceNumber; @Schema(description = "管理编号") + @NotEmpty (message = "管理编号不能为空!") private String deviceCode; @Schema(description = "资产编号") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceMaintainItemPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceMaintainItemPageReqVO.java new file mode 100644 index 0000000..5289d2f --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceMaintainItemPageReqVO.java @@ -0,0 +1,83 @@ +package com.zt.plat.module.qms.resource.device.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 DeviceMaintainItemPageReqVO extends PageParam { + + @Schema(description = "父ID", example = "23462") + private Long parentId; + + @Schema(description = "项id", example = "19985") + private Long checkItemId; + + @Schema(description = "保养情况、异常情况") + private String checkResult; + + @Schema(description = "处理结果") + private String conclusion; + + @Schema(description = "执行说明") + private String checkRemark; + + @Schema(description = "执行日期") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] checkDate; + + @Schema(description = "执行人", example = "王五") + private String checkUserName; + + @Schema(description = "执行人id", example = "25621") + private Long checkUserId; + + @Schema(description = "业务键,预留字段") + private String itemKey; + + @Schema(description = "项目名称", example = "ZT") + private String itemName; + + @Schema(description = "频次类型", example = "1") + private String frequencyType; + + @Schema(description = "频次") + private String frequency; + + @Schema(description = "所属周期开始日期") + private LocalDateTime frequencyTimeStart; + + @Schema(description = "所属周期截止日期") + private LocalDateTime frequencyTimeEnd; + + @Schema(description = "检查标准") + private String standard; + + @Schema(description = "检查方法") + private String itemMethod; + + @Schema(description = "频次说明") + private String frequencyRemark; + + @Schema(description = "责任人") + private String dutyRemark; + + @Schema(description = "排序号") + private Integer sortNo; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceMaintainItemRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceMaintainItemRespVO.java new file mode 100644 index 0000000..5c0d03d --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceMaintainItemRespVO.java @@ -0,0 +1,106 @@ +package com.zt.plat.module.qms.resource.device.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 DeviceMaintainItemRespVO { + + @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "11836") + @ExcelProperty("主键") + private Long id; + + @Schema(description = "父ID", example = "23462") + @ExcelProperty("父ID") + private Long parentId; + + @Schema(description = "项id", example = "19985") + @ExcelProperty("项id") + private Long checkItemId; + + @Schema(description = "保养情况、异常情况") + @ExcelProperty("保养情况、异常情况") + private String checkResult; + + @Schema(description = "处理结果") + @ExcelProperty("处理结果") + private String conclusion; + + @Schema(description = "执行说明") + @ExcelProperty("执行说明") + private String checkRemark; + + @Schema(description = "执行日期") + @ExcelProperty("执行日期") + private LocalDateTime checkDate; + + @Schema(description = "执行人", example = "王五") + @ExcelProperty("执行人") + private String checkUserName; + + @Schema(description = "执行人id", example = "25621") + @ExcelProperty("执行人id") + private Long checkUserId; + + @Schema(description = "业务键,预留字段") + @ExcelProperty("业务键,预留字段") + private String itemKey; + + @Schema(description = "项目名称", example = "ZT") + @ExcelProperty("项目名称") + private String itemName; + + @Schema(description = "频次类型", example = "1") + @ExcelProperty("频次类型") + private String frequencyType; + + @Schema(description = "频次") + @ExcelProperty("频次") + private String frequency; + + @Schema(description = "所属周期开始日期") + @ExcelProperty("所属周期开始日期") + private LocalDateTime frequencyTimeStart; + + @Schema(description = "所属周期截止日期") + @ExcelProperty("所属周期截止日期") + private LocalDateTime frequencyTimeEnd; + + @Schema(description = "检查标准") + @ExcelProperty("检查标准") + private String standard; + + @Schema(description = "检查方法") + @ExcelProperty("检查方法") + private String itemMethod; + + @Schema(description = "频次说明") + @ExcelProperty("频次说明") + private String frequencyRemark; + + @Schema(description = "责任人") + @ExcelProperty("责任人") + private String dutyRemark; + + @Schema(description = "排序号") + @ExcelProperty("排序号") + private Integer sortNo; + + @Schema(description = "所属部门") + @ExcelProperty("所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + @ExcelProperty("备注") + private String remark; + + @Schema(description = "创建时间") + @ExcelProperty("创建时间") + private LocalDateTime createTime; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceMaintainItemSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceMaintainItemSaveReqVO.java new file mode 100644 index 0000000..87f6f4e --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceMaintainItemSaveReqVO.java @@ -0,0 +1,78 @@ +package com.zt.plat.module.qms.resource.device.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; + +import java.time.LocalDateTime; + +@Schema(description = "管理后台 - 设备-保养分项新增/修改 Request VO") +@Data +public class DeviceMaintainItemSaveReqVO { + + @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "11836") + private Long id; + + @Schema(description = "父ID", example = "23462") + private Long parentId; + + @Schema(description = "项id", example = "19985") + private Long checkItemId; + + @Schema(description = "保养情况、异常情况") + private String checkResult; + + @Schema(description = "处理结果") + private String conclusion; + + @Schema(description = "执行说明") + private String checkRemark; + + @Schema(description = "执行日期") + private LocalDateTime checkDate; + + @Schema(description = "执行人", example = "王五") + private String checkUserName; + + @Schema(description = "执行人id", example = "25621") + private Long checkUserId; + + @Schema(description = "业务键,预留字段") + private String itemKey; + + @Schema(description = "项目名称", example = "ZT") + private String itemName; + + @Schema(description = "频次类型", example = "1") + private String frequencyType; + + @Schema(description = "频次") + private String frequency; + + @Schema(description = "所属周期开始日期") + private LocalDateTime frequencyTimeStart; + + @Schema(description = "所属周期截止日期") + private LocalDateTime frequencyTimeEnd; + + @Schema(description = "检查标准") + private String standard; + + @Schema(description = "检查方法") + private String itemMethod; + + @Schema(description = "频次说明") + private String frequencyRemark; + + @Schema(description = "责任人") + private String dutyRemark; + + @Schema(description = "排序号") + private Integer sortNo; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceMaintainPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceMaintainPageReqVO.java new file mode 100644 index 0000000..5b52081 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceMaintainPageReqVO.java @@ -0,0 +1,85 @@ +package com.zt.plat.module.qms.resource.device.controller.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 DeviceMaintainPageReqVO extends PageParam { + + @Schema(description = "数据类型", example = "2") + private String dataType; + + @Schema(description = "业务配置id", example = "5423") + private Long ruleId; + + @Schema(description = "设备id", example = "32060") + private Long deviceId; + + @Schema(description = "保养日期") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] checkDate; + + @Schema(description = "保养内容") + private String content; + + @Schema(description = "保养人", example = "30355") + private Long checkUserId; + + @Schema(description = "保养人", example = "王五") + private String checkUserName; + + @Schema(description = "频次类型", example = "1") + private String frequencyType; + + @Schema(description = "频次") + private String frequency; + + @Schema(description = "频次说明") + private String frequencyRemark; + + @Schema(description = "所属周期开始日期") + private LocalDateTime frequencyTimeStart; + + @Schema(description = "所属周期截止日期") + private LocalDateTime frequencyTimeEnd; + + @Schema(description = "提交标识") + private String submitFlag; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + + //=====================================扩展字段=============================================== + @Schema(description = "产品id") + private Long productId; + + @Schema(description = "设备名称") + private String deviceName; + + @Schema(description = "管理编号") + private String deviceCode; + + @Schema(description = "使用部门") + private String deptName; + + @Schema(description = "产品id查询") + private List productIdList; + + @Schema(description = "设备ID列表") + private List deviceIdList; +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceMaintainRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceMaintainRespVO.java new file mode 100644 index 0000000..a69221a --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceMaintainRespVO.java @@ -0,0 +1,88 @@ +package com.zt.plat.module.qms.resource.device.controller.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 DeviceMaintainRespVO { + + @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "6321") + @ExcelProperty("主键") + private Long id; + + @Schema(description = "数据类型", example = "2") + @ExcelProperty("数据类型") + private String dataType; + + @Schema(description = "业务配置id", example = "5423") + @ExcelProperty("业务配置id") + private Long ruleId; + + @Schema(description = "设备id", example = "32060") + @ExcelProperty("设备id") + private Long deviceId; + + @Schema(description = "保养日期") + @ExcelProperty("保养日期") + private LocalDateTime checkDate; + + @Schema(description = "保养内容") + @ExcelProperty("保养内容") + private String content; + + @Schema(description = "保养人", example = "30355") + @ExcelProperty("保养人") + private Long checkUserId; + + @Schema(description = "保养人", example = "王五") + @ExcelProperty("保养人") + private String checkUserName; + + @Schema(description = "频次类型", example = "1") + @ExcelProperty("频次类型") + private String frequencyType; + + @Schema(description = "频次") + @ExcelProperty("频次") + private String frequency; + + @Schema(description = "频次说明") + @ExcelProperty("频次说明") + private String frequencyRemark; + + @Schema(description = "所属周期开始日期") + @ExcelProperty("所属周期开始日期") + private LocalDateTime frequencyTimeStart; + + @Schema(description = "所属周期截止日期") + @ExcelProperty("所属周期截止日期") + private LocalDateTime frequencyTimeEnd; + + @Schema(description = "提交标识") + @ExcelProperty("提交标识") + private String submitFlag; + + @Schema(description = "所属部门") + @ExcelProperty("所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + @ExcelProperty("备注") + private String remark; + + @Schema(description = "创建时间") + @ExcelProperty("创建时间") + private LocalDateTime createTime; + + + //=====================================扩展字段=============================================== + + + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceMaintainSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceMaintainSaveReqVO.java new file mode 100644 index 0000000..101cea2 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceMaintainSaveReqVO.java @@ -0,0 +1,62 @@ +package com.zt.plat.module.qms.resource.device.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import jakarta.validation.constraints.*; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +@Schema(description = "管理后台 - 设备-点检、保养记录新增/修改 Request VO") +@Data +public class DeviceMaintainSaveReqVO { + + @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "6321") + private Long id; + + @Schema(description = "数据类型", example = "2") + private String dataType; + + @Schema(description = "业务配置id", example = "5423") + private Long ruleId; + + @Schema(description = "设备id", example = "32060") + private Long deviceId; + + @Schema(description = "保养日期") + private LocalDateTime checkDate; + + @Schema(description = "保养内容") + private String content; + + @Schema(description = "保养人", example = "30355") + private Long checkUserId; + + @Schema(description = "保养人", example = "王五") + private String checkUserName; + + @Schema(description = "频次类型", example = "1") + private String frequencyType; + + @Schema(description = "频次") + private String frequency; + + @Schema(description = "频次说明") + private String frequencyRemark; + + @Schema(description = "所属周期开始日期") + private LocalDateTime frequencyTimeStart; + + @Schema(description = "所属周期截止日期") + private LocalDateTime frequencyTimeEnd; + + @Schema(description = "提交标识") + private String submitFlag; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceMaintainVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceMaintainVO.java new file mode 100644 index 0000000..8ee21d8 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceMaintainVO.java @@ -0,0 +1,84 @@ +package com.zt.plat.module.qms.resource.device.controller.vo; + +import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceMaintainDO; +import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceMaintainItemDO; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; +@Schema(description = "管理后台 - 设备维护VO") +@Data +public class DeviceMaintainVO extends DeviceMaintainRespVO { + + + //============大类字段============ + @Schema(description = "产品id") + private Long productId; + + @Schema(description = "规格") + private String specification; + + @Schema(description = "型号") + private String modelNo; + + @Schema(description = "制造商") + private String manufacturer; + + //============设备字段============ + @Schema(description = "设备名称") + private String deviceName; + + @Schema(description = "别名") + private String alias; + + @Schema(description = "管理编号") + private String deviceCode; + + @Schema(description = "资产编号") + private String assetCode; + + @Schema(description = "出厂编号") + private String factoryCode; + + @Schema(description = "所属部门名称") + private String deptName; + + @Schema(description = "维修状态: 1-维修;0-正常") + private Integer repairFlag; + + @Schema(description = "降级状态") + private Integer demoteFlag; + + @Schema(description = "报废状态") + private Integer scrapFlag; + + @Schema(description = "停用状态") + private Integer disableFlag; + + @Schema(description = "外借状态") + private Integer lendFlag; + + @Schema(description = "使用中状态") + private Integer inUseFlag; + + @Schema(description = "验收状态") + private String acceptFlag; + + + //============维护信息字段============ + @Schema(description = "维护项目列表") + List maintainItemList; + + @Schema(description = "未提交数据量") + private Integer runningCount; + + @Schema(description = "已提交数据量") + private Integer finishedCount; + + //导出报表时使用 + @Schema(description = "维护保养内") + private String maintainContent; + + //============其他字段============ + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DevicePeriodCheckPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DevicePeriodCheckPageReqVO.java new file mode 100644 index 0000000..b1ea854 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DevicePeriodCheckPageReqVO.java @@ -0,0 +1,88 @@ +package com.zt.plat.module.qms.resource.device.controller.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 DevicePeriodCheckPageReqVO extends PageParam { + + @Schema(description = "期间核查计划id", example = "21407") + private Long planId; + + @Schema(description = "有效标识") + private String effectiveFlag; + + @Schema(description = "设备ID", example = "31026") + private Long deviceId; + + @Schema(description = "期间核查执行人") + private String checkPersonRemark; + + @Schema(description = "核查人姓名", example = "张三") + private String checkPersonName; + + @Schema(description = "核查人id", example = "29695") + private Long checkPersonId; + + @Schema(description = "复核人姓名", example = "赵六") + private String recheckPersonName; + + @Schema(description = "复核人id", example = "10898") + private Long recheckPersonId; + + @Schema(description = "核查方法") + private String checkAccording; + + @Schema(description = "核查方法描述") + private String checkAccordingRemark; + + @Schema(description = "核查记录") + private String checkContent; + + @Schema(description = "核查结论") + private String checkResult; + + @Schema(description = "核查备注") + private String checkRemark; + + @Schema(description = "实际检查日期") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] checkDate; + + @Schema(description = "上次检查日期") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] lastCheckDate; + + @Schema(description = "计划检查日期-开始") + private LocalDateTime planCheckDateStart; + + @Schema(description = "计划检查日期-截止") + private LocalDateTime planCheckDateEnd; + + @Schema(description = "频次") + private String frequencyRemark; + + @Schema(description = "审批状态", example = "2") + private String flowStatus; + + @Schema(description = "流程实例id", example = "31647") + private String flowInstanceId; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DevicePeriodCheckPlanPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DevicePeriodCheckPlanPageReqVO.java new file mode 100644 index 0000000..0cc2611 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DevicePeriodCheckPlanPageReqVO.java @@ -0,0 +1,56 @@ +package com.zt.plat.module.qms.resource.device.controller.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 DevicePeriodCheckPlanPageReqVO extends PageParam { + + @Schema(description = "汇总计划id", example = "25393") + private Long parentId; + + @Schema(description = "核查年度") + private String checkYear; + + @Schema(description = "申请人", example = "王五") + private String applyUserName; + + @Schema(description = "审批状态", example = "2") + private String flowStatus; + + @Schema(description = "流程实例id", example = "27595") + private String flowInstanceId; + + @Schema(description = "申请标题") + private String title; + + @Schema(description = "班组提交标识,0-未提交;1-已提交") + private String basicSubmitFlag; + + @Schema(description = "退回意见") + private String rollbackRemark; + + @Schema(description = "数据类型,班组/汇总", example = "1") + private String dataType; + + @Schema(description = "作废标识:0-有效;1-作废") + private String cancelFlag; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DevicePeriodCheckPlanRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DevicePeriodCheckPlanRespVO.java new file mode 100644 index 0000000..a4a829f --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DevicePeriodCheckPlanRespVO.java @@ -0,0 +1,71 @@ +package com.zt.plat.module.qms.resource.device.controller.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 DevicePeriodCheckPlanRespVO { + + @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "25737") + @ExcelProperty("主键") + private Long id; + + @Schema(description = "汇总计划id", example = "25393") + @ExcelProperty("汇总计划id") + private Long parentId; + + @Schema(description = "核查年度") + @ExcelProperty("核查年度") + private String checkYear; + + @Schema(description = "申请人", example = "王五") + @ExcelProperty("申请人") + private String applyUserName; + + @Schema(description = "审批状态", example = "2") + @ExcelProperty("审批状态") + private String flowStatus; + + @Schema(description = "流程实例id", example = "27595") + @ExcelProperty("流程实例id") + private String flowInstanceId; + + @Schema(description = "申请标题") + @ExcelProperty("申请标题") + private String title; + + @Schema(description = "班组提交标识,0-未提交;1-已提交") + @ExcelProperty("班组提交标识,0-未提交;1-已提交") + private String basicSubmitFlag; + + @Schema(description = "退回意见") + @ExcelProperty("退回意见") + private String rollbackRemark; + + @Schema(description = "数据类型,班组/汇总", example = "1") + @ExcelProperty("数据类型,班组/汇总") + private String dataType; + + @Schema(description = "作废标识:0-有效;1-作废") + @ExcelProperty("作废标识:0-有效;1-作废") + private String cancelFlag; + + @Schema(description = "所属部门") + @ExcelProperty("所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + @ExcelProperty("备注") + private String remark; + + @Schema(description = "创建时间") + @ExcelProperty("创建时间") + private LocalDateTime createTime; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DevicePeriodCheckPlanSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DevicePeriodCheckPlanSaveReqVO.java new file mode 100644 index 0000000..e197013 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DevicePeriodCheckPlanSaveReqVO.java @@ -0,0 +1,51 @@ +package com.zt.plat.module.qms.resource.device.controller.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 DevicePeriodCheckPlanSaveReqVO { + + @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "25737") + private Long id; + + @Schema(description = "汇总计划id", example = "25393") + private Long parentId; + + @Schema(description = "核查年度") + private String checkYear; + + @Schema(description = "申请人", example = "王五") + private String applyUserName; + + @Schema(description = "审批状态", example = "2") + private String flowStatus; + + @Schema(description = "流程实例id", example = "27595") + private String flowInstanceId; + + @Schema(description = "申请标题") + private String title; + + @Schema(description = "班组提交标识,0-未提交;1-已提交") + private String basicSubmitFlag; + + @Schema(description = "退回意见") + private String rollbackRemark; + + @Schema(description = "数据类型,班组/汇总", example = "1") + private String dataType; + + @Schema(description = "作废标识:0-有效;1-作废") + private String cancelFlag; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DevicePeriodCheckRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DevicePeriodCheckRespVO.java new file mode 100644 index 0000000..0a720ad --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DevicePeriodCheckRespVO.java @@ -0,0 +1,111 @@ +package com.zt.plat.module.qms.resource.device.controller.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 DevicePeriodCheckRespVO { + + @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "27613") + @ExcelProperty("主键") + private Long id; + + @Schema(description = "期间核查计划id", example = "21407") + @ExcelProperty("期间核查计划id") + private Long planId; + + @Schema(description = "有效标识") + @ExcelProperty("有效标识") + private String effectiveFlag; + + @Schema(description = "设备ID", example = "31026") + @ExcelProperty("设备ID") + private Long deviceId; + + @Schema(description = "期间核查执行人") + @ExcelProperty("期间核查执行人") + private String checkPersonRemark; + + @Schema(description = "核查人姓名", example = "张三") + @ExcelProperty("核查人姓名") + private String checkPersonName; + + @Schema(description = "核查人id", example = "29695") + @ExcelProperty("核查人id") + private Long checkPersonId; + + @Schema(description = "复核人姓名", example = "赵六") + @ExcelProperty("复核人姓名") + private String recheckPersonName; + + @Schema(description = "复核人id", example = "10898") + @ExcelProperty("复核人id") + private Long recheckPersonId; + + @Schema(description = "核查方法") + @ExcelProperty("核查方法") + private String checkAccording; + + @Schema(description = "核查方法描述") + @ExcelProperty("核查方法描述") + private String checkAccordingRemark; + + @Schema(description = "核查记录") + @ExcelProperty("核查记录") + private String checkContent; + + @Schema(description = "核查结论") + @ExcelProperty("核查结论") + private String checkResult; + + @Schema(description = "核查备注") + @ExcelProperty("核查备注") + private String checkRemark; + + @Schema(description = "实际检查日期") + @ExcelProperty("实际检查日期") + private LocalDateTime checkDate; + + @Schema(description = "上次检查日期") + @ExcelProperty("上次检查日期") + private LocalDateTime lastCheckDate; + + @Schema(description = "计划检查日期-开始") + @ExcelProperty("计划检查日期-开始") + private LocalDateTime planCheckDateStart; + + @Schema(description = "计划检查日期-截止") + @ExcelProperty("计划检查日期-截止") + private LocalDateTime planCheckDateEnd; + + @Schema(description = "频次") + @ExcelProperty("频次") + private String frequencyRemark; + + @Schema(description = "审批状态", example = "2") + @ExcelProperty("审批状态") + private String flowStatus; + + @Schema(description = "流程实例id", example = "31647") + @ExcelProperty("流程实例id") + private String flowInstanceId; + + @Schema(description = "所属部门") + @ExcelProperty("所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + @ExcelProperty("备注") + private String remark; + + @Schema(description = "创建时间") + @ExcelProperty("创建时间") + private LocalDateTime createTime; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DevicePeriodCheckSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DevicePeriodCheckSaveReqVO.java new file mode 100644 index 0000000..2af8f43 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DevicePeriodCheckSaveReqVO.java @@ -0,0 +1,83 @@ +package com.zt.plat.module.qms.resource.device.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import jakarta.validation.constraints.*; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +@Schema(description = "管理后台 - 设备-期间核查新增/修改 Request VO") +@Data +public class DevicePeriodCheckSaveReqVO { + + @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "27613") + private Long id; + + @Schema(description = "期间核查计划id", example = "21407") + private Long planId; + + @Schema(description = "有效标识") + private String effectiveFlag; + + @Schema(description = "设备ID", example = "31026") + private Long deviceId; + + @Schema(description = "期间核查执行人") + private String checkPersonRemark; + + @Schema(description = "核查人姓名", example = "张三") + private String checkPersonName; + + @Schema(description = "核查人id", example = "29695") + private Long checkPersonId; + + @Schema(description = "复核人姓名", example = "赵六") + private String recheckPersonName; + + @Schema(description = "复核人id", example = "10898") + private Long recheckPersonId; + + @Schema(description = "核查方法") + private String checkAccording; + + @Schema(description = "核查方法描述") + private String checkAccordingRemark; + + @Schema(description = "核查记录") + private String checkContent; + + @Schema(description = "核查结论") + private String checkResult; + + @Schema(description = "核查备注") + private String checkRemark; + + @Schema(description = "实际检查日期") + private LocalDateTime checkDate; + + @Schema(description = "上次检查日期") + private LocalDateTime lastCheckDate; + + @Schema(description = "计划检查日期-开始") + private LocalDateTime planCheckDateStart; + + @Schema(description = "计划检查日期-截止") + private LocalDateTime planCheckDateEnd; + + @Schema(description = "频次") + private String frequencyRemark; + + @Schema(description = "审批状态", example = "2") + private String flowStatus; + + @Schema(description = "流程实例id", example = "31647") + private String flowInstanceId; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceRepairApplyPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceRepairApplyPageReqVO.java new file mode 100644 index 0000000..9f26d61 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceRepairApplyPageReqVO.java @@ -0,0 +1,69 @@ +package com.zt.plat.module.qms.resource.device.controller.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 DeviceRepairApplyPageReqVO extends PageParam { + + @Schema(description = "设备id", example = "16749") + private Long deviceId; + + @Schema(description = "使用地点") + private String devicePosition; + + @Schema(description = "申请人", example = "赵六") + private String applyUserName; + + @Schema(description = "申请时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] applyTime; + + @Schema(description = "申请标题") + private String title; + + @Schema(description = "审批状态", example = "2") + private String flowStatus; + + @Schema(description = "流程实例id", example = "26349") + private String flowInstanceId; + + @Schema(description = "故障描述/故障现象") + private String faultDescription; + + @Schema(description = "处置意见") + private String conclusion; + + @Schema(description = "是否维修") + private String repairFlag; + + @Schema(description = "故障分析") + private String repairAnalysis; + + @Schema(description = "处理方案") + private String repairSolution; + + @Schema(description = "维修方式", example = "2") + private String repairType; + + @Schema(description = "作废标识") + private String cancelFlag; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceRepairApplyRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceRepairApplyRespVO.java new file mode 100644 index 0000000..78811ba --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceRepairApplyRespVO.java @@ -0,0 +1,87 @@ +package com.zt.plat.module.qms.resource.device.controller.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 DeviceRepairApplyRespVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "26714") + @ExcelProperty("ID") + private Long id; + + @Schema(description = "设备id", example = "16749") + @ExcelProperty("设备id") + private Long deviceId; + + @Schema(description = "使用地点") + @ExcelProperty("使用地点") + private String devicePosition; + + @Schema(description = "申请人", example = "赵六") + @ExcelProperty("申请人") + private String applyUserName; + + @Schema(description = "申请时间") + @ExcelProperty("申请时间") + private LocalDateTime applyTime; + + @Schema(description = "申请标题") + @ExcelProperty("申请标题") + private String title; + + @Schema(description = "审批状态", example = "2") + @ExcelProperty("审批状态") + private String flowStatus; + + @Schema(description = "流程实例id", example = "26349") + @ExcelProperty("流程实例id") + private String flowInstanceId; + + @Schema(description = "故障描述/故障现象") + @ExcelProperty("故障描述/故障现象") + private String faultDescription; + + @Schema(description = "处置意见") + @ExcelProperty("处置意见") + private String conclusion; + + @Schema(description = "是否维修") + @ExcelProperty("是否维修") + private String repairFlag; + + @Schema(description = "故障分析") + @ExcelProperty("故障分析") + private String repairAnalysis; + + @Schema(description = "处理方案") + @ExcelProperty("处理方案") + private String repairSolution; + + @Schema(description = "维修方式", example = "2") + @ExcelProperty("维修方式") + private String repairType; + + @Schema(description = "作废标识") + @ExcelProperty("作废标识") + private String cancelFlag; + + @Schema(description = "所属部门") + @ExcelProperty("所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + @ExcelProperty("备注") + private String remark; + + @Schema(description = "创建时间") + @ExcelProperty("创建时间") + private LocalDateTime createTime; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceRepairApplySaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceRepairApplySaveReqVO.java new file mode 100644 index 0000000..7f0a270 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceRepairApplySaveReqVO.java @@ -0,0 +1,65 @@ +package com.zt.plat.module.qms.resource.device.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import jakarta.validation.constraints.*; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +@Schema(description = "管理后台 - 维修申请新增/修改 Request VO") +@Data +public class DeviceRepairApplySaveReqVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "26714") + private Long id; + + @Schema(description = "设备id", example = "16749") + private Long deviceId; + + @Schema(description = "使用地点") + private String devicePosition; + + @Schema(description = "申请人", example = "赵六") + private String applyUserName; + + @Schema(description = "申请时间") + private LocalDateTime applyTime; + + @Schema(description = "申请标题") + private String title; + + @Schema(description = "审批状态", example = "2") + private String flowStatus; + + @Schema(description = "流程实例id", example = "26349") + private String flowInstanceId; + + @Schema(description = "故障描述/故障现象") + private String faultDescription; + + @Schema(description = "处置意见") + private String conclusion; + + @Schema(description = "是否维修") + private String repairFlag; + + @Schema(description = "故障分析") + private String repairAnalysis; + + @Schema(description = "处理方案") + private String repairSolution; + + @Schema(description = "维修方式", example = "2") + private String repairType; + + @Schema(description = "作废标识") + private String cancelFlag; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceRepairAtPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceRepairAtPageReqVO.java new file mode 100644 index 0000000..3ca3d8c --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceRepairAtPageReqVO.java @@ -0,0 +1,32 @@ +package com.zt.plat.module.qms.resource.device.controller.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 DeviceRepairAtPageReqVO extends PageParam { + + @Schema(description = "故障说明明细id", example = "1967") + private Long repairDetailId; + + @Schema(description = "故障处理明细id", example = "14276") + private Long resultDetailId; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceRepairAtRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceRepairAtRespVO.java new file mode 100644 index 0000000..7510ed9 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceRepairAtRespVO.java @@ -0,0 +1,39 @@ +package com.zt.plat.module.qms.resource.device.controller.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 DeviceRepairAtRespVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "20425") + @ExcelProperty("ID") + private Long id; + + @Schema(description = "故障说明明细id", requiredMode = Schema.RequiredMode.REQUIRED, example = "1967") + @ExcelProperty("故障说明明细id") + private Long repairDetailId; + + @Schema(description = "故障处理明细id", requiredMode = Schema.RequiredMode.REQUIRED, example = "14276") + @ExcelProperty("故障处理明细id") + private Long resultDetailId; + + @Schema(description = "所属部门") + @ExcelProperty("所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + @ExcelProperty("备注") + private String remark; + + @Schema(description = "创建时间") + @ExcelProperty("创建时间") + private LocalDateTime createTime; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceRepairAtSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceRepairAtSaveReqVO.java new file mode 100644 index 0000000..98bfae8 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceRepairAtSaveReqVO.java @@ -0,0 +1,29 @@ +package com.zt.plat.module.qms.resource.device.controller.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 DeviceRepairAtSaveReqVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "20425") + private Long id; + + @Schema(description = "故障说明明细id", requiredMode = Schema.RequiredMode.REQUIRED, example = "1967") + @NotNull(message = "故障说明明细id不能为空") + private Long repairDetailId; + + @Schema(description = "故障处理明细id", requiredMode = Schema.RequiredMode.REQUIRED, example = "14276") + @NotNull(message = "故障处理明细id不能为空") + private Long resultDetailId; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceRepairDetailPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceRepairDetailPageReqVO.java new file mode 100644 index 0000000..6af9915 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceRepairDetailPageReqVO.java @@ -0,0 +1,32 @@ +package com.zt.plat.module.qms.resource.device.controller.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 DeviceRepairDetailPageReqVO extends PageParam { + + @Schema(description = "维修申请id", example = "16105") + private Long repairId; + + @Schema(description = "故障说明") + private String faultContent; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceRepairDetailRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceRepairDetailRespVO.java new file mode 100644 index 0000000..48a4ece --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceRepairDetailRespVO.java @@ -0,0 +1,39 @@ +package com.zt.plat.module.qms.resource.device.controller.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 DeviceRepairDetailRespVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "14417") + @ExcelProperty("ID") + private Long id; + + @Schema(description = "维修申请id", example = "16105") + @ExcelProperty("维修申请id") + private Long repairId; + + @Schema(description = "故障说明") + @ExcelProperty("故障说明") + private String faultContent; + + @Schema(description = "所属部门") + @ExcelProperty("所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + @ExcelProperty("备注") + private String remark; + + @Schema(description = "创建时间") + @ExcelProperty("创建时间") + private LocalDateTime createTime; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceRepairDetailSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceRepairDetailSaveReqVO.java new file mode 100644 index 0000000..9b22433 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceRepairDetailSaveReqVO.java @@ -0,0 +1,27 @@ +package com.zt.plat.module.qms.resource.device.controller.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 DeviceRepairDetailSaveReqVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "14417") + private Long id; + + @Schema(description = "维修申请id", example = "16105") + private Long repairId; + + @Schema(description = "故障说明") + private String faultContent; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceRepairResultDetailPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceRepairResultDetailPageReqVO.java new file mode 100644 index 0000000..61ce652 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceRepairResultDetailPageReqVO.java @@ -0,0 +1,29 @@ +package com.zt.plat.module.qms.resource.device.controller.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 DeviceRepairResultDetailPageReqVO extends PageParam { + + @Schema(description = "解决说明") + private String solutionContent; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceRepairResultDetailRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceRepairResultDetailRespVO.java new file mode 100644 index 0000000..1fb03f2 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceRepairResultDetailRespVO.java @@ -0,0 +1,35 @@ +package com.zt.plat.module.qms.resource.device.controller.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 DeviceRepairResultDetailRespVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "9148") + @ExcelProperty("ID") + private Long id; + + @Schema(description = "解决说明") + @ExcelProperty("解决说明") + private String solutionContent; + + @Schema(description = "所属部门") + @ExcelProperty("所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + @ExcelProperty("备注") + private String remark; + + @Schema(description = "创建时间") + @ExcelProperty("创建时间") + private LocalDateTime createTime; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceRepairResultDetailSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceRepairResultDetailSaveReqVO.java new file mode 100644 index 0000000..c54aef1 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceRepairResultDetailSaveReqVO.java @@ -0,0 +1,24 @@ +package com.zt.plat.module.qms.resource.device.controller.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 DeviceRepairResultDetailSaveReqVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "9148") + private Long id; + + @Schema(description = "解决说明") + private String solutionContent; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceUseRecordPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceUseRecordPageReqVO.java new file mode 100644 index 0000000..83de5c3 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceUseRecordPageReqVO.java @@ -0,0 +1,84 @@ +package com.zt.plat.module.qms.resource.device.controller.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 DeviceUseRecordPageReqVO extends PageParam { + + @Schema(description = "设备id", example = "5771") + private Long deviceId; + + @Schema(description = "使用人", example = "王五") + private String userName; + + @Schema(description = "使用人id", example = "11450") + private Long userId; + + @Schema(description = "开始使用时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] useTimeStart; + + @Schema(description = "结束使用时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] useTimeEnd; + + @Schema(description = "使用记录") + private String useRemark; + + @Schema(description = "使用前状态") + private String stateBefore; + + @Schema(description = "使用中状态(正常/异常)") + private String stateRun; + + @Schema(description = "使用后状态") + private String stateAfter; + + @Schema(description = "温度") + private String temperature; + + @Schema(description = "湿度") + private String humidity; + + @Schema(description = "数据来源,PC|PAD|PDA") + private String dataSource; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + //=====================================扩展字段=============================================== + + @Schema(description = "产品id") + private Long productId; + + @Schema(description = "设备名称") + private String deviceName; + + @Schema(description = "管理编号") + private String deviceCode; + + @Schema(description = "使用部门") + private String deptName; + + @Schema(description = "产品id查询") + private List productIdList; + + @Schema(description = "设备ID列表") + private List deviceIdList; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceUseRecordRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceUseRecordRespVO.java new file mode 100644 index 0000000..2b5ef66 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceUseRecordRespVO.java @@ -0,0 +1,79 @@ +package com.zt.plat.module.qms.resource.device.controller.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 DeviceUseRecordRespVO { + + @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "17384") + @ExcelProperty("主键") + private Long id; + + @Schema(description = "设备id", example = "5771") + @ExcelProperty("设备id") + private Long deviceId; + + @Schema(description = "使用人", example = "王五") + @ExcelProperty("使用人") + private String userName; + + @Schema(description = "使用人id", example = "11450") + @ExcelProperty("使用人id") + private Long userId; + + @Schema(description = "开始使用时间") + @ExcelProperty("开始使用时间") + private LocalDateTime useTimeStart; + + @Schema(description = "结束使用时间") + @ExcelProperty("结束使用时间") + private LocalDateTime useTimeEnd; + + @Schema(description = "使用记录") + @ExcelProperty("使用记录") + private String useRemark; + + @Schema(description = "使用前状态") + @ExcelProperty("使用前状态") + private String stateBefore; + + @Schema(description = "使用中状态(正常/异常)") + @ExcelProperty("使用中状态(正常/异常)") + private String stateRun; + + @Schema(description = "使用后状态") + @ExcelProperty("使用后状态") + private String stateAfter; + + @Schema(description = "温度") + @ExcelProperty("温度") + private String temperature; + + @Schema(description = "湿度") + @ExcelProperty("湿度") + private String humidity; + + @Schema(description = "数据来源,PC|PAD|PDA") + @ExcelProperty("数据来源,PC|PAD|PDA") + private String dataSource; + + @Schema(description = "所属部门") + @ExcelProperty("所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + @ExcelProperty("备注") + private String remark; + + @Schema(description = "创建时间") + @ExcelProperty("创建时间") + private LocalDateTime createTime; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceUseRecordSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceUseRecordSaveReqVO.java new file mode 100644 index 0000000..2e86bf7 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceUseRecordSaveReqVO.java @@ -0,0 +1,59 @@ +package com.zt.plat.module.qms.resource.device.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import jakarta.validation.constraints.*; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +@Schema(description = "管理后台 - 设备-使用记录新增/修改 Request VO") +@Data +public class DeviceUseRecordSaveReqVO { + + @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "17384") + private Long id; + + @Schema(description = "设备id", example = "5771") + private Long deviceId; + + @Schema(description = "使用人", example = "王五") + private String userName; + + @Schema(description = "使用人id", example = "11450") + private Long userId; + + @Schema(description = "开始使用时间") + private LocalDateTime useTimeStart; + + @Schema(description = "结束使用时间") + private LocalDateTime useTimeEnd; + + @Schema(description = "使用记录") + private String useRemark; + + @Schema(description = "使用前状态") + private String stateBefore; + + @Schema(description = "使用中状态(正常/异常)") + private String stateRun; + + @Schema(description = "使用后状态") + private String stateAfter; + + @Schema(description = "温度") + private String temperature; + + @Schema(description = "湿度") + private String humidity; + + @Schema(description = "数据来源,PC|PAD|PDA") + private String dataSource; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceUseRecordVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceUseRecordVO.java new file mode 100644 index 0000000..58f00f2 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceUseRecordVO.java @@ -0,0 +1,79 @@ +package com.zt.plat.module.qms.resource.device.controller.vo; + +import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceMaintainItemDO; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +@Schema(description = "管理后台 - 设备使用记录VO") +@Data +public class DeviceUseRecordVO extends DeviceUseRecordRespVO { + + + //============大类字段============ + @Schema(description = "产品id") + private Long productId; + + @Schema(description = "规格") + private String specification; + + @Schema(description = "型号") + private String modelNo; + + @Schema(description = "制造商") + private String manufacturer; + + //============设备字段============ + @Schema(description = "设备名称") + private String deviceName; + + @Schema(description = "别名") + private String alias; + + @Schema(description = "管理编号") + private String deviceCode; + + @Schema(description = "资产编号") + private String assetCode; + + @Schema(description = "出厂编号") + private String factoryCode; + + @Schema(description = "所属部门名称") + private String deptName; + + @Schema(description = "维修状态: 1-维修;0-正常") + private Integer repairFlag; + + @Schema(description = "降级状态") + private Integer demoteFlag; + + @Schema(description = "报废状态") + private Integer scrapFlag; + + @Schema(description = "停用状态") + private Integer disableFlag; + + @Schema(description = "外借状态") + private Integer lendFlag; + + @Schema(description = "使用中状态") + private Integer inUseFlag; + + @Schema(description = "验收状态") + private String acceptFlag; + + + //============其他字段============ + @Schema(description = "未提交数据量") + private Integer runningCount; + + @Schema(description = "已提交数据量") + private Integer finishedCount; + + @Schema(description = "截止时间不为空") + private String useTimeEndFlag; + + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/dataobject/DeviceAffiliationRelativityDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/dataobject/DeviceAffiliationRelativityDO.java new file mode 100644 index 0000000..5aa4d32 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/dataobject/DeviceAffiliationRelativityDO.java @@ -0,0 +1,57 @@ +package com.zt.plat.module.qms.resource.device.dal.dataobject; + +import lombok.*; +import com.baomidou.mybatisplus.annotation.*; +import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; +/** +* 附属设备关系 DO +* +* @author 后台管理-1 +*/ +@TableName("t_dev_aff_rel") +@KeySequence("t_dev_aff_rel_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class DeviceAffiliationRelativityDO extends BusinessBaseDO { + + + + /** + * ID + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 主设备id + */ + @TableField("PRN_PDT_ID") + private Long parentProductId; + /** + * 子设备id + */ + @TableField("CHD_DEV_ID") + private Long childDeviceId; + /** + * 排序号 + */ + @TableField("SRT_NO") + private Integer sortNo; + /** + * 所属部门 + */ + @TableField("SYS_DEPT_CD") + private String systemDepartmentCode; + /** + * 备注 + */ + @TableField("RMK") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/dataobject/DeviceApplyDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/dataobject/DeviceApplyDO.java new file mode 100644 index 0000000..6ff034f --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/dataobject/DeviceApplyDO.java @@ -0,0 +1,150 @@ +package com.zt.plat.module.qms.resource.device.dal.dataobject; + +import lombok.*; + +import java.time.LocalDateTime; + +import com.baomidou.mybatisplus.annotation.*; +import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; +/** +* 设备通用流程,验收、降级、停用、报废、还原、启用 DO +* +* @author 后台管理-1 +*/ +@TableName("t_dev_apl") +@KeySequence("t_dev_apl_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class DeviceApplyDO extends BusinessBaseDO { + + + + /** + * ID + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 业务名称,【字典】【jy_device_lifecycle_bsn_type】验收、降级、停用、报废、还原、启用等 + */ + @TableField("BSN_NAME") + private String businessName; + /** + * 申请部门 + */ + @TableField("APL_DEPT_NAME") + private String applyDepartmentName; + /** + * 申请部门ID + */ + @TableField("APL_DEPT") + private String applyDepartment; + /** + * 申请人 + */ + @TableField("APL_USER_NAME") + private String applyUserName; + /** + * 申请人ID + */ + @TableField("APL_USER") + private String applyUser; + /** + * 业务编码 + */ + @TableField("BSN_CD") + private String businessCode; + /** + * 业务日期 + */ + @TableField("BSN_DT") + private LocalDateTime businessDate; + /** + * 业务原因 + */ + @TableField("BSN_RSN") + private String businessReason; + /** + * 业务状态 + */ + @TableField("BSN_STS") + private String businessStatus; + /** + * 借用人 + */ + @TableField("BSN_USER") + private String businessUser; + /** + * 借用人id + */ + @TableField("BSN_USER_ID") + private Long businessUserId; + /** + * 借用部门 + */ + @TableField("BSN_DEPT") + private String businessDepartment; + /** + * 借用部门id + */ + @TableField("BSN_DEPT_ID") + private Long businessDepartmentId; + /** + * 计划归还日期 + */ + @TableField("PLN_GIV_DT") + private LocalDateTime planGivebackDate; + /** + * 归还接收人 + */ + @TableField("GIV_RCV_USER") + private String givebackReceiveUser; + /** + * 归还接收人id + */ + @TableField("GIV_RCV_USER_ID") + private Long givebackReceiveUserId; + /** + * 表单模板ID + */ + @TableField("TMPL_ID") + private String templateId; + /** + * 表单组件 + */ + @TableField("FORM_CPNT") + private String formComponent; + /** + * 数据集配置ID + */ + @TableField("DAT_COLT_ID") + private Long dataCollectionId; + /** + * 表单数据 + */ + @TableField("FORM_DAT") + private String formData; + /** + * 流程实例id + */ + @TableField("FLW_INSC_ID") + private String flowInstanceId; + /** + * 所属部门 + */ + @TableField("SYS_DEPT_CD") + private String systemDepartmentCode; + /** + * 备注 + */ + @TableField("RMK") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/dataobject/DeviceApplyDetailDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/dataobject/DeviceApplyDetailDO.java new file mode 100644 index 0000000..1cec2f4 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/dataobject/DeviceApplyDetailDO.java @@ -0,0 +1,62 @@ +package com.zt.plat.module.qms.resource.device.dal.dataobject; + +import lombok.*; +import com.baomidou.mybatisplus.annotation.*; +import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; +/** +* 设备通用流程明细 DO +* +* @author 后台管理-1 +*/ +@TableName("t_dev_apl_dtl") +@KeySequence("t_dev_apl_dtl_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class DeviceApplyDetailDO extends BusinessBaseDO { + + + + /** + * ID + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 父ID + */ + @TableField("APL_ID") + private Long applyId; + /** + * 设备id + */ + @TableField("DEV_INF_ID") + private Long deviceInfomationId; + /** + * 设备借用明细id + */ + @TableField("DEV_BRW_DTL_ID") + private Long deviceBorrowDetailId; + /** + * 表单数据,表单数据 + */ + @TableField("FORM_DAT") + private String formData; + /** + * 所属部门 + */ + @TableField("SYS_DEPT_CD") + private String systemDepartmentCode; + /** + * 备注 + */ + @TableField("RMK") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/dataobject/DeviceCalibrationDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/dataobject/DeviceCalibrationDO.java new file mode 100644 index 0000000..7ae46ee --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/dataobject/DeviceCalibrationDO.java @@ -0,0 +1,140 @@ +package com.zt.plat.module.qms.resource.device.dal.dataobject; + +import lombok.*; + +import java.time.LocalDateTime; + +import com.baomidou.mybatisplus.annotation.*; +import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; +/** +* 设备-检定校准 DO +* +* @author 后台管理-1 +*/ +@TableName("t_dev_clb") +@KeySequence("t_dev_clb_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class DeviceCalibrationDO extends BusinessBaseDO { + + + + /** + * 主键 + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 检定校准计划id + */ + @TableField("PLN_ID") + private Long planId; + /** + * 有效标识 + */ + @TableField("EFCT_FLG") + private String effectiveFlag; + /** + * 设备id + */ + @TableField("DEV_ID") + private Long deviceId; + /** + * 供应商名称 + */ + @TableField("SPLR_NAME") + private Long supplierName; + /** + * 供应商ID + */ + @TableField("SPLR_ID") + private Long supplierId; + /** + * 校准点/范围 + */ + @TableField("SPEC") + private String specification; + /** + * 计划检定校准日期 + */ + @TableField("PLN_CHK_DT") + private LocalDateTime planCheckDate; + /** + * 上次检定校准日期 + */ + @TableField("LST_CHK_DT") + private LocalDateTime lastCheckDate; + /** + * 频次 + */ + @TableField("FREQ_RMK") + private String frequencyRemark; + /** + * 类型:检定|校准 + */ + @TableField("CHK_TP") + private String checkType; + /** + * 检定校准日期 + */ + @TableField("CHK_DT") + private LocalDateTime checkDate; + /** + * 检定校准单位 + */ + @TableField("AGT") + private String agent; + /** + * 证书编号 + */ + @TableField("CRTF_CD") + private String certificateCode; + /** + * 有效期 + */ + @TableField("VDTY_DT") + private LocalDateTime validityDate; + /** + * 确认情况(理由) + */ + @TableField("CHK_CNTT") + private String checkContent; + /** + * 确认结果 + */ + @TableField("CHK_RSLT") + private String checkResult; + /** + * 检定校准状态 + */ + @TableField("FLW_STS") + private String flowStatus; + /** + * 流程实例id + */ + @TableField("FLW_INSC_ID") + private String flowInstanceId; + /** + * 作废状态 + */ + @TableField("CNL_FLG") + private Integer cancelFlag; + /** + * 所属部门 + */ + @TableField("SYS_DEPT_CD") + private String systemDepartmentCode; + /** + * 备注 + */ + @TableField("RMK") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/dataobject/DeviceCalibrationPlanDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/dataobject/DeviceCalibrationPlanDO.java new file mode 100644 index 0000000..f47c0a3 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/dataobject/DeviceCalibrationPlanDO.java @@ -0,0 +1,92 @@ +package com.zt.plat.module.qms.resource.device.dal.dataobject; + +import lombok.*; +import com.baomidou.mybatisplus.annotation.*; +import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; +/** +* 设备-检定校准计划 DO +* +* @author 后台管理-1 +*/ +@TableName("t_dev_clb_pln") +@KeySequence("t_dev_clb_pln_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class DeviceCalibrationPlanDO extends BusinessBaseDO { + + + + /** + * 主键 + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 汇总计划id + */ + @TableField("PDT_ID") + private Long productId; + /** + * 年度 + */ + @TableField("CHK_YR") + private String checkYear; + /** + * 申请人 + */ + @TableField("APL_USER_NAME") + private String applyUserName; + /** + * 流程实例id + */ + @TableField("FLW_INSC_ID") + private String flowInstanceId; + /** + * 审批状态 + */ + @TableField("FLW_STS") + private String flowStatus; + /** + * 申请标题 + */ + @TableField("TTL") + private String title; + /** + * 班组提交标识:1-已提交 + */ + @TableField("BSC_SBM_FLG") + private Integer basicSubmitFlag; + /** + * 退回意见 + */ + @TableField("RLBK_RMK") + private String rollbackRemark; + /** + * 数据类型:班组/汇总 + */ + @TableField("DAT_TP") + private String dataType; + /** + * 作废标识:0-有效;1-作废 + */ + @TableField("CNL_FLG") + private String cancelFlag; + /** + * 所属部门 + */ + @TableField("SYS_DEPT_CD") + private String systemDepartmentCode; + /** + * 备注 + */ + @TableField("RMK") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/dataobject/DeviceConfigBusinessItemDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/dataobject/DeviceConfigBusinessItemDO.java new file mode 100644 index 0000000..3e31be9 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/dataobject/DeviceConfigBusinessItemDO.java @@ -0,0 +1,92 @@ +package com.zt.plat.module.qms.resource.device.dal.dataobject; + +import lombok.*; +import com.baomidou.mybatisplus.annotation.*; +import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; +/** +* 设备-检查项目配置 DO +* +* @author 后台管理-1 +*/ +@TableName("t_dev_cfg_bsn_itm") +@KeySequence("t_dev_cfg_bsn_itm_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class DeviceConfigBusinessItemDO extends BusinessBaseDO { + + + + /** + * 主键 + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 业务规则id + */ + @TableField("RUL_ID") + private Long ruleId; + /** + * 业务键 + */ + @TableField("ITM_KY") + private String itemKey; + /** + * 项目名称 + */ + @TableField("ITM_NAME") + private String itemName; + /** + * 频次类型 + */ + @TableField("FREQ_TP") + private String frequencyType; + /** + * 频次 + */ + @TableField("FREQ") + private String frequency; + /** + * 检查标准 + */ + @TableField("STD") + private String standard; + /** + * 检查方法 + */ + @TableField("ITM_MTHD") + private String itemMethod; + /** + * 频次说明 + */ + @TableField("FREQ_RMK") + private String frequencyRemark; + /** + * 责任人 + */ + @TableField("DUTY_RMK") + private String dutyRemark; + /** + * 排序号 + */ + @TableField("ORD_NO") + private Integer orderNo; + /** + * 所属部门 + */ + @TableField("SYS_DEPT_CD") + private String systemDepartmentCode; + /** + * 备注 + */ + @TableField("RMK") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/dataobject/DeviceConfigBusinessRuleDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/dataobject/DeviceConfigBusinessRuleDO.java new file mode 100644 index 0000000..4901ddb --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/dataobject/DeviceConfigBusinessRuleDO.java @@ -0,0 +1,107 @@ +package com.zt.plat.module.qms.resource.device.dal.dataobject; + +import lombok.*; +import com.baomidou.mybatisplus.annotation.*; +import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; +/** +* 设备-业务配置 DO +* +* @author 后台管理-1 +*/ +@TableName("t_dev_cfg_bsn_rul") +@KeySequence("t_dev_cfg_bsn_rul_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class DeviceConfigBusinessRuleDO extends BusinessBaseDO { + + + + /** + * 主键 + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 产品id + */ + @TableField("PDT_ID") + private Long productId; + /** + * 业务领域 + */ + @TableField("BSN_DMN") + private String businessDomain; + /** + * 是否需要 + */ + @TableField("REQR_FLG") + private String requireFlag; + /** + * 子业务类型 + */ + @TableField("SUB_DMN_TP") + private String subitemDomainType; + /** + * 频次类型 + */ + @TableField("FREQ_TP") + private String frequencyType; + /** + * 频次 + */ + @TableField("FREQ") + private String frequency; + /** + * 频次说明 + */ + @TableField("FREQ_RMK") + private String frequencyRemark; + /** + * 报表模板 + */ + @TableField("RPT_TMPL_KY") + private String reportTemplateKey; + /** + * 表单组件 + */ + @TableField("FORM_CPNT") + private String formComponent; + /** + * 处理方法 + */ + @TableField("TMT_MTHD") + private String treatmentMethod; + /** + * 处理人 + */ + @TableField("TMT_USER") + private String treatmentUser; + /** + * 检定/校准类型 + */ + @TableField("CLB_CHK_TP") + private String calibrationCheckType; + /** + * 标准/规范 + */ + @TableField("STD") + private String standard; + /** + * 所属部门 + */ + @TableField("SYS_DEPT_CD") + private String systemDepartmentCode; + /** + * 备注 + */ + @TableField("RMK") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/dataobject/DeviceConfigFlowDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/dataobject/DeviceConfigFlowDO.java new file mode 100644 index 0000000..0f58f93 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/dataobject/DeviceConfigFlowDO.java @@ -0,0 +1,82 @@ +package com.zt.plat.module.qms.resource.device.dal.dataobject; + +import lombok.*; +import com.baomidou.mybatisplus.annotation.*; +import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; +/** +* 设备通用流程配置 DO +* +* @author 后台管理-1 +*/ +@TableName("t_dev_cfg_flw") +@KeySequence("t_dev_cfg_flw_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class DeviceConfigFlowDO extends BusinessBaseDO { + + + + /** + * 主键 + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 业务类型 + */ + @TableField("BSN_TP") + private String businessType; + /** + * 业务类型名称 + */ + @TableField("BSN_NAME") + private String businessName; + /** + * 流程key + */ + @TableField("FLW_KY") + private String flowKey; + /** + * 数据集配置Key + */ + @TableField("DAT_COLT_KY") + private String dataCollectionKey; + /** + * 表单模板key + */ + @TableField("TMPL_KY") + private String templateKey; + /** + * 表单组件 + */ + @TableField("FORM_CPNT") + private String formComponent; + /** + * 其他配置 + */ + @TableField("CST_CFG") + private String customConfig; + + //排序号 + @TableField("ORD_NO") + private Integer orderNo; + + /** + * 所属部门 + */ + @TableField("SYS_DEPT_CD") + private String systemDepartmentCode; + /** + * 备注 + */ + @TableField("RMK") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/dataobject/DeviceInfoWithBizConfigVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/dataobject/DeviceInfoWithBizConfigVO.java new file mode 100644 index 0000000..9c41941 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/dataobject/DeviceInfoWithBizConfigVO.java @@ -0,0 +1,48 @@ +package com.zt.plat.module.qms.resource.device.dal.dataobject; + +import com.zt.plat.module.qms.core.aspect.annotation.Dict; +import io.swagger.v3.oas.annotations.media.Schema; + +public class DeviceInfoWithBizConfigVO extends DeviceInfomationDO{ + + @Schema(description = "规则id") + private String ruleId; + + @Schema(description = "业务领域:点检|检定校准|期间核查|等") + @Dict(dicCode = "device_business_domain") + private String businessDomain; + + @Schema(description = "是否需要") + private Integer needFlag; + + @Schema(description = "子业务类型") + private String subDomainType; + + @Schema(description = "频次类型") + private String frequencyType; + + @Schema(description = "频次") + private String frequency; + + @Schema(description = "频次说明") + private String frequencyRemark; + + @Schema(description = "报表模板") + private String reportTemplateKey; + + @Schema(description = "表单组件") + private String formComponent; + + @Schema(description = "处理方法") + private String processMethod; + + @Schema(description = "处理人") + private String processUser; + + @Schema(description = "标准/规范") + private String standard; + + @Schema(description = "检定/校准类型") + private String calibrationCheckType; + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/dataobject/DeviceInfomationDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/dataobject/DeviceInfomationDO.java index 8c5895c..6345191 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/dataobject/DeviceInfomationDO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/dataobject/DeviceInfomationDO.java @@ -6,7 +6,6 @@ import lombok.*; import java.math.BigDecimal; import java.time.LocalDateTime; -import java.util.Date; /** * 设备-设备信息 DO @@ -41,8 +40,8 @@ public class DeviceInfomationDO extends BusinessBaseDO { /** * 设备名称 */ - @TableField("PDT_NAME") - private String productName; + @TableField("DEV_NAME") + private String deviceName; /** * 别名 */ diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/dataobject/DeviceMaintainDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/dataobject/DeviceMaintainDO.java new file mode 100644 index 0000000..33465d5 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/dataobject/DeviceMaintainDO.java @@ -0,0 +1,110 @@ +package com.zt.plat.module.qms.resource.device.dal.dataobject; + +import lombok.*; + +import java.time.LocalDateTime; + +import com.baomidou.mybatisplus.annotation.*; +import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; +/** +* 设备-点检、保养记录 DO +* +* @author 后台管理-1 +*/ +@TableName("t_dev_matn") +@KeySequence("t_dev_matn_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class DeviceMaintainDO extends BusinessBaseDO { + + + + /** + * 主键 + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 数据类型 + */ + @TableField("DAT_TP") + private String dataType; + /** + * 业务配置id + */ + @TableField("RUL_ID") + private Long ruleId; + /** + * 设备id + */ + @TableField("DEV_ID") + private Long deviceId; + /** + * 保养日期 + */ + @TableField("CHK_DT") + private LocalDateTime checkDate; + /** + * 保养内容 + */ + @TableField("CNTT") + private String content; + /** + * 保养人 + */ + @TableField("CHK_USER_ID") + private Long checkUserId; + /** + * 保养人 + */ + @TableField("CHK_USER_NAME") + private String checkUserName; + /** + * 频次类型 + */ + @TableField("FREQ_TP") + private String frequencyType; + /** + * 频次 + */ + @TableField("FREQ") + private String frequency; + /** + * 频次说明 + */ + @TableField("FREQ_RMK") + private String frequencyRemark; + /** + * 所属周期开始日期 + */ + @TableField("FREQ_TM_STRT") + private LocalDateTime frequencyTimeStart; + /** + * 所属周期截止日期 + */ + @TableField("FREQ_TM_END") + private LocalDateTime frequencyTimeEnd; + /** + * 提交标识 + */ + @TableField("SBM_FLG") + private String submitFlag; + /** + * 所属部门 + */ + @TableField("SYS_DEPT_CD") + private String systemDepartmentCode; + /** + * 备注 + */ + @TableField("RMK") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/dataobject/DeviceMaintainItemDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/dataobject/DeviceMaintainItemDO.java new file mode 100644 index 0000000..4314fab --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/dataobject/DeviceMaintainItemDO.java @@ -0,0 +1,140 @@ +package com.zt.plat.module.qms.resource.device.dal.dataobject; + +import lombok.*; + +import java.time.LocalDateTime; + +import com.baomidou.mybatisplus.annotation.*; +import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; +/** +* 设备-保养分项 DO +* +* @author 后台管理-1 +*/ +@TableName("t_dev_matn_itm") +@KeySequence("t_dev_matn_itm_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class DeviceMaintainItemDO extends BusinessBaseDO { + + + + /** + * 主键 + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 父ID + */ + @TableField("PRN_ID") + private Long parentId; + /** + * 项id + */ + @TableField("CHK_ITM_ID") + private Long checkItemId; + /** + * 保养情况、异常情况 + */ + @TableField("CHK_RSLT") + private String checkResult; + /** + * 处理结果 + */ + @TableField("CNCL") + private String conclusion; + /** + * 执行说明 + */ + @TableField("CHK_RMK") + private String checkRemark; + /** + * 执行日期 + */ + @TableField("CHK_DT") + private LocalDateTime checkDate; + /** + * 执行人 + */ + @TableField("CHK_USER_NAME") + private String checkUserName; + /** + * 执行人id + */ + @TableField("CHK_USER_ID") + private Long checkUserId; + /** + * 业务键,预留字段 + */ + @TableField("ITM_KY") + private String itemKey; + /** + * 项目名称 + */ + @TableField("ITM_NAME") + private String itemName; + /** + * 频次类型 + */ + @TableField("FREQ_TP") + private String frequencyType; + /** + * 频次 + */ + @TableField("FREQ") + private String frequency; + /** + * 所属周期开始日期 + */ + @TableField("FREQ_TM_STRT") + private LocalDateTime frequencyTimeStart; + /** + * 所属周期截止日期 + */ + @TableField("FREQ_TM_STRT") + private LocalDateTime frequencyTimeEnd; + /** + * 检查标准 + */ + @TableField("STD") + private String standard; + /** + * 检查方法 + */ + @TableField("ITM_MTHD") + private String itemMethod; + /** + * 频次说明 + */ + @TableField("FREQ_RMK") + private String frequencyRemark; + /** + * 责任人 + */ + @TableField("DUTY_RMK") + private String dutyRemark; + /** + * 排序号 + */ + @TableField("SRT_NO") + private Integer sortNo; + /** + * 所属部门 + */ + @TableField("SYS_DEPT_CD") + private String systemDepartmentCode; + /** + * 备注 + */ + @TableField("RMK") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/dataobject/DevicePeriodCheckDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/dataobject/DevicePeriodCheckDO.java new file mode 100644 index 0000000..b18a64d --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/dataobject/DevicePeriodCheckDO.java @@ -0,0 +1,145 @@ +package com.zt.plat.module.qms.resource.device.dal.dataobject; + +import lombok.*; + +import java.time.LocalDateTime; + +import com.baomidou.mybatisplus.annotation.*; +import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; +/** +* 设备-期间核查 DO +* +* @author 后台管理-1 +*/ +@TableName("t_dev_prd_chk") +@KeySequence("t_dev_prd_chk_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class DevicePeriodCheckDO extends BusinessBaseDO { + + + + /** + * 主键 + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 期间核查计划id + */ + @TableField("PLN_ID") + private Long planId; + /** + * 有效标识 + */ + @TableField("EFCT_FLG") + private String effectiveFlag; + /** + * 设备ID + */ + @TableField("DEV_ID") + private Long deviceId; + /** + * 期间核查执行人 + */ + @TableField("CHK_PSN_RMK") + private String checkPersonRemark; + /** + * 核查人姓名 + */ + @TableField("CHK_PSN_NAME") + private String checkPersonName; + /** + * 核查人id + */ + @TableField("CHK_PSN_ID") + private Long checkPersonId; + /** + * 复核人姓名 + */ + @TableField("RCHK_PSN_NAME") + private String recheckPersonName; + /** + * 复核人id + */ + @TableField("RCHK_PSN_ID") + private Long recheckPersonId; + /** + * 核查方法 + */ + @TableField("CHK_ACRD") + private String checkAccording; + /** + * 核查方法描述 + */ + @TableField("CHK_ACRD_RMK") + private String checkAccordingRemark; + /** + * 核查记录 + */ + @TableField("CHK_CNTT") + private String checkContent; + /** + * 核查结论 + */ + @TableField("CHK_RSLT") + private String checkResult; + /** + * 核查备注 + */ + @TableField("CHK_RMK") + private String checkRemark; + /** + * 实际检查日期 + */ + @TableField("CHK_DT") + private LocalDateTime checkDate; + /** + * 上次检查日期 + */ + @TableField("LST_CHK_DT") + private LocalDateTime lastCheckDate; + /** + * 计划检查日期-开始 + */ + @TableField("PLN_CHK_DT_STRT") + private LocalDateTime planCheckDateStart; + /** + * 计划检查日期-截止 + */ + @TableField("PLN_CHK_DT_END") + private LocalDateTime planCheckDateEnd; + /** + * 频次 + */ + @TableField("FREQ_RMK") + private String frequencyRemark; + /** + * 审批状态 + */ + @TableField("FLW_STS") + private String flowStatus; + /** + * 流程实例id + */ + @TableField("FLW_INSC_ID") + private String flowInstanceId; + /** + * 所属部门 + */ + @TableField("SYS_DEPT_CD") + private String systemDepartmentCode; + /** + * 备注 + */ + @TableField("RMK") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/dataobject/DevicePeriodCheckPlanDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/dataobject/DevicePeriodCheckPlanDO.java new file mode 100644 index 0000000..95442e1 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/dataobject/DevicePeriodCheckPlanDO.java @@ -0,0 +1,92 @@ +package com.zt.plat.module.qms.resource.device.dal.dataobject; + +import lombok.*; +import com.baomidou.mybatisplus.annotation.*; +import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; +/** +* 设备-期间核查计划 DO +* +* @author 后台管理-1 +*/ +@TableName("t_dev_prd_chk_pln") +@KeySequence("t_dev_prd_chk_pln_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class DevicePeriodCheckPlanDO extends BusinessBaseDO { + + + + /** + * 主键 + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 汇总计划id + */ + @TableField("PRN_ID") + private Long parentId; + /** + * 核查年度 + */ + @TableField("CHK_YR") + private String checkYear; + /** + * 申请人 + */ + @TableField("APL_USER_NAME") + private String applyUserName; + /** + * 审批状态 + */ + @TableField("FLW_STS") + private String flowStatus; + /** + * 流程实例id + */ + @TableField("FLW_INSC_ID") + private String flowInstanceId; + /** + * 申请标题 + */ + @TableField("TTL") + private String title; + /** + * 班组提交标识,0-未提交;1-已提交 + */ + @TableField("BSC_SBM_FLG") + private String basicSubmitFlag; + /** + * 退回意见 + */ + @TableField("RLBK_RMK") + private String rollbackRemark; + /** + * 数据类型,班组/汇总 + */ + @TableField("DAT_TP") + private String dataType; + /** + * 作废标识:0-有效;1-作废 + */ + @TableField("CNL_FLG") + private String cancelFlag; + /** + * 所属部门 + */ + @TableField("SYS_DEPT_CD") + private String systemDepartmentCode; + /** + * 备注 + */ + @TableField("RMK") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/dataobject/DeviceRepairApplyDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/dataobject/DeviceRepairApplyDO.java new file mode 100644 index 0000000..0790cff --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/dataobject/DeviceRepairApplyDO.java @@ -0,0 +1,115 @@ +package com.zt.plat.module.qms.resource.device.dal.dataobject; + +import lombok.*; + +import java.time.LocalDateTime; + +import com.baomidou.mybatisplus.annotation.*; +import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; +/** +* 维修申请 DO +* +* @author 后台管理-1 +*/ +@TableName("t_dev_rpr_apl") +@KeySequence("t_dev_rpr_apl_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class DeviceRepairApplyDO extends BusinessBaseDO { + + + + /** + * ID + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 设备id + */ + @TableField("DEV_ID") + private Long deviceId; + /** + * 使用地点 + */ + @TableField("DEV_POS") + private String devicePosition; + /** + * 申请人 + */ + @TableField("APL_USER_NAME") + private String applyUserName; + /** + * 申请时间 + */ + @TableField("APL_TM") + private LocalDateTime applyTime; + /** + * 申请标题 + */ + @TableField("TTL") + private String title; + /** + * 审批状态 + */ + @TableField("FLW_STS") + private String flowStatus; + /** + * 流程实例id + */ + @TableField("FLW_INSC_ID") + private String flowInstanceId; + /** + * 故障描述/故障现象 + */ + @TableField("FLT_DSP") + private String faultDescription; + /** + * 处置意见 + */ + @TableField("CNCL") + private String conclusion; + /** + * 是否维修 + */ + @TableField("RPR_FLG") + private String repairFlag; + /** + * 故障分析 + */ + @TableField("RPR_ANL") + private String repairAnalysis; + /** + * 处理方案 + */ + @TableField("RPR_SOL") + private String repairSolution; + /** + * 维修方式 + */ + @TableField("RPR_TP") + private String repairType; + /** + * 作废标识 + */ + @TableField("CNL_FLG") + private String cancelFlag; + /** + * 所属部门 + */ + @TableField("SYS_DEPT_CD") + private String systemDepartmentCode; + /** + * 备注 + */ + @TableField("RMK") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/dataobject/DeviceRepairAtDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/dataobject/DeviceRepairAtDO.java new file mode 100644 index 0000000..4fffe72 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/dataobject/DeviceRepairAtDO.java @@ -0,0 +1,52 @@ +package com.zt.plat.module.qms.resource.device.dal.dataobject; + +import lombok.*; +import com.baomidou.mybatisplus.annotation.*; +import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; +/** +* 故障与处理关系 DO +* +* @author 后台管理-1 +*/ +@TableName("t_dev_rpr_at") +@KeySequence("t_dev_rpr_at_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class DeviceRepairAtDO extends BusinessBaseDO { + + + + /** + * ID + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 故障说明明细id + */ + @TableField("RPR_DTL_ID") + private Long repairDetailId; + /** + * 故障处理明细id + */ + @TableField("RSLT_DTL_ID") + private Long resultDetailId; + /** + * 所属部门 + */ + @TableField("SYS_DEPT_CD") + private String systemDepartmentCode; + /** + * 备注 + */ + @TableField("RMK") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/dataobject/DeviceRepairDetailDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/dataobject/DeviceRepairDetailDO.java new file mode 100644 index 0000000..4b8df36 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/dataobject/DeviceRepairDetailDO.java @@ -0,0 +1,52 @@ +package com.zt.plat.module.qms.resource.device.dal.dataobject; + +import lombok.*; +import com.baomidou.mybatisplus.annotation.*; +import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; +/** +* 设备维修明细 DO +* +* @author 后台管理-1 +*/ +@TableName("t_dev_rpr_dtl") +@KeySequence("t_dev_rpr_dtl_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class DeviceRepairDetailDO extends BusinessBaseDO { + + + + /** + * ID + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 维修申请id + */ + @TableField("RPR_ID") + private Long repairId; + /** + * 故障说明 + */ + @TableField("FLT_CNTT") + private String faultContent; + /** + * 所属部门 + */ + @TableField("SYS_DEPT_CD") + private String systemDepartmentCode; + /** + * 备注 + */ + @TableField("RMK") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/dataobject/DeviceRepairResultDetailDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/dataobject/DeviceRepairResultDetailDO.java new file mode 100644 index 0000000..71fa467 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/dataobject/DeviceRepairResultDetailDO.java @@ -0,0 +1,47 @@ +package com.zt.plat.module.qms.resource.device.dal.dataobject; + +import lombok.*; +import com.baomidou.mybatisplus.annotation.*; +import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; +/** +* 故障处理明细 DO +* +* @author 后台管理-1 +*/ +@TableName("t_dev_rpr_rslt_dtl") +@KeySequence("t_dev_rpr_rslt_dtl_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class DeviceRepairResultDetailDO extends BusinessBaseDO { + + + + /** + * ID + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 解决说明 + */ + @TableField("SOL_CNTT") + private String solutionContent; + /** + * 所属部门 + */ + @TableField("SYS_DEPT_CD") + private String systemDepartmentCode; + /** + * 备注 + */ + @TableField("RMK") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/dataobject/DeviceUseRecordDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/dataobject/DeviceUseRecordDO.java new file mode 100644 index 0000000..50d67ba --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/dataobject/DeviceUseRecordDO.java @@ -0,0 +1,105 @@ +package com.zt.plat.module.qms.resource.device.dal.dataobject; + +import lombok.*; + +import java.time.LocalDateTime; + +import com.baomidou.mybatisplus.annotation.*; +import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; +/** +* 设备-使用记录 DO +* +* @author 后台管理-1 +*/ +@TableName("t_dev_use_rcd") +@KeySequence("t_dev_use_rcd_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class DeviceUseRecordDO extends BusinessBaseDO { + + + + /** + * 主键 + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 设备id + */ + @TableField("DEV_ID") + private Long deviceId; + /** + * 使用人 + */ + @TableField("USER_NAME") + private String userName; + /** + * 使用人id + */ + @TableField("USER_ID") + private Long userId; + /** + * 开始使用时间 + */ + @TableField("USE_TM_STRT") + private LocalDateTime useTimeStart; + /** + * 结束使用时间 + */ + @TableField("USE_TM_END") + private LocalDateTime useTimeEnd; + /** + * 使用记录 + */ + @TableField("USE_RMK") + private String useRemark; + /** + * 使用前状态 + */ + @TableField("STA_BFR") + private String stateBefore; + /** + * 使用中状态(正常/异常) + */ + @TableField("STA_RN") + private String stateRun; + /** + * 使用后状态 + */ + @TableField("STA_AFT") + private String stateAfter; + /** + * 温度 + */ + @TableField("TMP") + private String temperature; + /** + * 湿度 + */ + @TableField("HMD") + private String humidity; + /** + * 数据来源,PC|PAD|PDA + */ + @TableField("DAT_SRC") + private String dataSource; + /** + * 所属部门 + */ + @TableField("SYS_DEPT_CD") + private String systemDepartmentCode; + /** + * 备注 + */ + @TableField("RMK") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceAffiliationRelativityMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceAffiliationRelativityMapper.java new file mode 100644 index 0000000..591e5b1 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceAffiliationRelativityMapper.java @@ -0,0 +1,29 @@ +package com.zt.plat.module.qms.resource.device.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.device.dal.dataobject.DeviceAffiliationRelativityDO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceAffiliationRelativityPageReqVO; +import org.apache.ibatis.annotations.Mapper; + +/** + * 附属设备关系 Mapper + * + * @author 后台管理-1 + */ +@Mapper +public interface DeviceAffiliationRelativityMapper extends BaseMapperX { + + default PageResult selectPage(DeviceAffiliationRelativityPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(DeviceAffiliationRelativityDO::getParentProductId, reqVO.getParentProductId()) + .eqIfPresent(DeviceAffiliationRelativityDO::getChildDeviceId, reqVO.getChildDeviceId()) + .eqIfPresent(DeviceAffiliationRelativityDO::getSortNo, reqVO.getSortNo()) + .eqIfPresent(DeviceAffiliationRelativityDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .eqIfPresent(DeviceAffiliationRelativityDO::getRemark, reqVO.getRemark()) + .betweenIfPresent(DeviceAffiliationRelativityDO::getCreateTime, reqVO.getCreateTime()) + .orderByDesc(DeviceAffiliationRelativityDO::getId)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceApplyDetailMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceApplyDetailMapper.java new file mode 100644 index 0000000..531e452 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceApplyDetailMapper.java @@ -0,0 +1,30 @@ +package com.zt.plat.module.qms.resource.device.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.device.dal.dataobject.DeviceApplyDetailDO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceApplyDetailPageReqVO; +import org.apache.ibatis.annotations.Mapper; + +/** + * 设备通用流程明细 Mapper + * + * @author 后台管理-1 + */ +@Mapper +public interface DeviceApplyDetailMapper extends BaseMapperX { + + default PageResult selectPage(DeviceApplyDetailPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(DeviceApplyDetailDO::getApplyId, reqVO.getApplyId()) + .eqIfPresent(DeviceApplyDetailDO::getDeviceInfomationId, reqVO.getDeviceInfomationId()) + .eqIfPresent(DeviceApplyDetailDO::getDeviceBorrowDetailId, reqVO.getDeviceBorrowDetailId()) + .eqIfPresent(DeviceApplyDetailDO::getFormData, reqVO.getFormData()) + .eqIfPresent(DeviceApplyDetailDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .eqIfPresent(DeviceApplyDetailDO::getRemark, reqVO.getRemark()) + .betweenIfPresent(DeviceApplyDetailDO::getCreateTime, reqVO.getCreateTime()) + .orderByDesc(DeviceApplyDetailDO::getId)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceApplyMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceApplyMapper.java new file mode 100644 index 0000000..5358c25 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceApplyMapper.java @@ -0,0 +1,45 @@ +package com.zt.plat.module.qms.resource.device.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.device.controller.vo.DeviceApplyPageReqVO; +import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceApplyDO; +import org.apache.ibatis.annotations.Mapper; + +/** + * 设备通用流程,验收、降级、停用、报废、还原、启用 Mapper + * + * @author 后台管理-1 + */ +@Mapper +public interface DeviceApplyMapper extends BaseMapperX { + + default PageResult selectPage(DeviceApplyPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .likeIfPresent(DeviceApplyDO::getBusinessName, reqVO.getBusinessName()) + .likeIfPresent(DeviceApplyDO::getApplyDepartmentName, reqVO.getApplyDepartmentName()) + .eqIfPresent(DeviceApplyDO::getApplyDepartment, reqVO.getApplyDepartment()) + .likeIfPresent(DeviceApplyDO::getApplyUserName, reqVO.getApplyUserName()) + .eqIfPresent(DeviceApplyDO::getApplyUser, reqVO.getApplyUser()) + .eqIfPresent(DeviceApplyDO::getBusinessCode, reqVO.getBusinessCode()) + .betweenIfPresent(DeviceApplyDO::getBusinessDate, reqVO.getBusinessDate()) + .eqIfPresent(DeviceApplyDO::getBusinessReason, reqVO.getBusinessReason()) + .eqIfPresent(DeviceApplyDO::getBusinessStatus, reqVO.getBusinessStatus()) + .eqIfPresent(DeviceApplyDO::getBusinessUser, reqVO.getBusinessUser()) + .eqIfPresent(DeviceApplyDO::getBusinessUserId, reqVO.getBusinessUserId()) + .eqIfPresent(DeviceApplyDO::getBusinessDepartment, reqVO.getBusinessDepartment()) + .eqIfPresent(DeviceApplyDO::getBusinessDepartmentId, reqVO.getBusinessDepartmentId()) + .betweenIfPresent(DeviceApplyDO::getPlanGivebackDate, reqVO.getPlanGivebackDate()) + .eqIfPresent(DeviceApplyDO::getGivebackReceiveUser, reqVO.getGivebackReceiveUser()) + .eqIfPresent(DeviceApplyDO::getGivebackReceiveUserId, reqVO.getGivebackReceiveUserId()) + .eqIfPresent(DeviceApplyDO::getDataCollectionId, reqVO.getDataCollectionId()) + .eqIfPresent(DeviceApplyDO::getFormData, reqVO.getFormData()) + .eqIfPresent(DeviceApplyDO::getFlowInstanceId, reqVO.getFlowInstanceId()) + .eqIfPresent(DeviceApplyDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .eqIfPresent(DeviceApplyDO::getRemark, reqVO.getRemark()) + .betweenIfPresent(DeviceApplyDO::getCreateTime, reqVO.getCreateTime()) + .orderByDesc(DeviceApplyDO::getId)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceCalibrationMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceCalibrationMapper.java new file mode 100644 index 0000000..02d6c9f --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceCalibrationMapper.java @@ -0,0 +1,45 @@ +package com.zt.plat.module.qms.resource.device.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.device.dal.dataobject.DeviceCalibrationDO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceCalibrationPageReqVO; +import org.apache.ibatis.annotations.Mapper; + +/** + * 设备-检定校准 Mapper + * + * @author 后台管理-1 + */ +@Mapper +public interface DeviceCalibrationMapper extends BaseMapperX { + + default PageResult selectPage(DeviceCalibrationPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(DeviceCalibrationDO::getPlanId, reqVO.getPlanId()) + .eqIfPresent(DeviceCalibrationDO::getEffectiveFlag, reqVO.getEffectiveFlag()) + .eqIfPresent(DeviceCalibrationDO::getDeviceId, reqVO.getDeviceId()) + .likeIfPresent(DeviceCalibrationDO::getSupplierName, reqVO.getSupplierName()) + .eqIfPresent(DeviceCalibrationDO::getSupplierId, reqVO.getSupplierId()) + .eqIfPresent(DeviceCalibrationDO::getSpecification, reqVO.getSpecification()) + .betweenIfPresent(DeviceCalibrationDO::getPlanCheckDate, reqVO.getPlanCheckDate()) + .betweenIfPresent(DeviceCalibrationDO::getLastCheckDate, reqVO.getLastCheckDate()) + .eqIfPresent(DeviceCalibrationDO::getFrequencyRemark, reqVO.getFrequencyRemark()) + .eqIfPresent(DeviceCalibrationDO::getCheckType, reqVO.getCheckType()) + .betweenIfPresent(DeviceCalibrationDO::getCheckDate, reqVO.getCheckDate()) + .eqIfPresent(DeviceCalibrationDO::getAgent, reqVO.getAgent()) + .eqIfPresent(DeviceCalibrationDO::getCertificateCode, reqVO.getCertificateCode()) + .betweenIfPresent(DeviceCalibrationDO::getValidityDate, reqVO.getValidityDate()) + .eqIfPresent(DeviceCalibrationDO::getCheckContent, reqVO.getCheckContent()) + .eqIfPresent(DeviceCalibrationDO::getCheckResult, reqVO.getCheckResult()) + .eqIfPresent(DeviceCalibrationDO::getFlowStatus, reqVO.getFlowStatus()) + .eqIfPresent(DeviceCalibrationDO::getFlowInstanceId, reqVO.getFlowInstanceId()) + .eqIfPresent(DeviceCalibrationDO::getCancelFlag, reqVO.getCancelFlag()) + .eqIfPresent(DeviceCalibrationDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .eqIfPresent(DeviceCalibrationDO::getRemark, reqVO.getRemark()) + .betweenIfPresent(DeviceCalibrationDO::getCreateTime, reqVO.getCreateTime()) + .orderByDesc(DeviceCalibrationDO::getId)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceCalibrationPlanMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceCalibrationPlanMapper.java new file mode 100644 index 0000000..bc1460e --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceCalibrationPlanMapper.java @@ -0,0 +1,36 @@ +package com.zt.plat.module.qms.resource.device.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.device.dal.dataobject.DeviceCalibrationPlanDO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceCalibrationPlanPageReqVO; +import org.apache.ibatis.annotations.Mapper; + +/** + * 设备-检定校准计划 Mapper + * + * @author 后台管理-1 + */ +@Mapper +public interface DeviceCalibrationPlanMapper extends BaseMapperX { + + default PageResult selectPage(DeviceCalibrationPlanPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(DeviceCalibrationPlanDO::getProductId, reqVO.getProductId()) + .eqIfPresent(DeviceCalibrationPlanDO::getCheckYear, reqVO.getCheckYear()) + .likeIfPresent(DeviceCalibrationPlanDO::getApplyUserName, reqVO.getApplyUserName()) + .eqIfPresent(DeviceCalibrationPlanDO::getFlowInstanceId, reqVO.getFlowInstanceId()) + .eqIfPresent(DeviceCalibrationPlanDO::getFlowStatus, reqVO.getFlowStatus()) + .eqIfPresent(DeviceCalibrationPlanDO::getTitle, reqVO.getTitle()) + .eqIfPresent(DeviceCalibrationPlanDO::getBasicSubmitFlag, reqVO.getBasicSubmitFlag()) + .eqIfPresent(DeviceCalibrationPlanDO::getRollbackRemark, reqVO.getRollbackRemark()) + .eqIfPresent(DeviceCalibrationPlanDO::getDataType, reqVO.getDataType()) + .eqIfPresent(DeviceCalibrationPlanDO::getCancelFlag, reqVO.getCancelFlag()) + .eqIfPresent(DeviceCalibrationPlanDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .eqIfPresent(DeviceCalibrationPlanDO::getRemark, reqVO.getRemark()) + .betweenIfPresent(DeviceCalibrationPlanDO::getCreateTime, reqVO.getCreateTime()) + .orderByDesc(DeviceCalibrationPlanDO::getId)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceConfigBusinessItemMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceConfigBusinessItemMapper.java new file mode 100644 index 0000000..f93a453 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceConfigBusinessItemMapper.java @@ -0,0 +1,36 @@ +package com.zt.plat.module.qms.resource.device.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.device.dal.dataobject.DeviceConfigBusinessItemDO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceConfigBusinessItemPageReqVO; +import org.apache.ibatis.annotations.Mapper; + +/** + * 设备-检查项目配置 Mapper + * + * @author 后台管理-1 + */ +@Mapper +public interface DeviceConfigBusinessItemMapper extends BaseMapperX { + + default PageResult selectPage(DeviceConfigBusinessItemPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(DeviceConfigBusinessItemDO::getRuleId, reqVO.getRuleId()) + .eqIfPresent(DeviceConfigBusinessItemDO::getItemKey, reqVO.getItemKey()) + .likeIfPresent(DeviceConfigBusinessItemDO::getItemName, reqVO.getItemName()) + .eqIfPresent(DeviceConfigBusinessItemDO::getFrequencyType, reqVO.getFrequencyType()) + .eqIfPresent(DeviceConfigBusinessItemDO::getFrequency, reqVO.getFrequency()) + .eqIfPresent(DeviceConfigBusinessItemDO::getStandard, reqVO.getStandard()) + .eqIfPresent(DeviceConfigBusinessItemDO::getItemMethod, reqVO.getItemMethod()) + .eqIfPresent(DeviceConfigBusinessItemDO::getFrequencyRemark, reqVO.getFrequencyRemark()) + .eqIfPresent(DeviceConfigBusinessItemDO::getDutyRemark, reqVO.getDutyRemark()) + .eqIfPresent(DeviceConfigBusinessItemDO::getOrderNo, reqVO.getOrderNo()) + .eqIfPresent(DeviceConfigBusinessItemDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .eqIfPresent(DeviceConfigBusinessItemDO::getRemark, reqVO.getRemark()) + .betweenIfPresent(DeviceConfigBusinessItemDO::getCreateTime, reqVO.getCreateTime()) + .orderByDesc(DeviceConfigBusinessItemDO::getId)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceConfigBusinessRuleMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceConfigBusinessRuleMapper.java new file mode 100644 index 0000000..3d484d1 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceConfigBusinessRuleMapper.java @@ -0,0 +1,39 @@ +package com.zt.plat.module.qms.resource.device.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.device.controller.vo.DeviceConfigBusinessRulePageReqVO; +import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceConfigBusinessRuleDO; +import org.apache.ibatis.annotations.Mapper; + +/** + * 设备-业务配置 Mapper + * + * @author 后台管理-1 + */ +@Mapper +public interface DeviceConfigBusinessRuleMapper extends BaseMapperX { + + default PageResult selectPage(DeviceConfigBusinessRulePageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(DeviceConfigBusinessRuleDO::getProductId, reqVO.getProductId()) + .eqIfPresent(DeviceConfigBusinessRuleDO::getBusinessDomain, reqVO.getBusinessDomain()) + .eqIfPresent(DeviceConfigBusinessRuleDO::getRequireFlag, reqVO.getRequireFlag()) + .eqIfPresent(DeviceConfigBusinessRuleDO::getSubitemDomainType, reqVO.getSubitemDomainType()) + .eqIfPresent(DeviceConfigBusinessRuleDO::getFrequencyType, reqVO.getFrequencyType()) + .eqIfPresent(DeviceConfigBusinessRuleDO::getFrequency, reqVO.getFrequency()) + .eqIfPresent(DeviceConfigBusinessRuleDO::getFrequencyRemark, reqVO.getFrequencyRemark()) + .eqIfPresent(DeviceConfigBusinessRuleDO::getReportTemplateKey, reqVO.getReportTemplateKey()) + .eqIfPresent(DeviceConfigBusinessRuleDO::getFormComponent, reqVO.getFormComponent()) + .eqIfPresent(DeviceConfigBusinessRuleDO::getTreatmentMethod, reqVO.getTreatmentMethod()) + .eqIfPresent(DeviceConfigBusinessRuleDO::getTreatmentUser, reqVO.getTreatmentUser()) + .eqIfPresent(DeviceConfigBusinessRuleDO::getCalibrationCheckType, reqVO.getCalibrationCheckType()) + .eqIfPresent(DeviceConfigBusinessRuleDO::getStandard, reqVO.getStandard()) + .eqIfPresent(DeviceConfigBusinessRuleDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .eqIfPresent(DeviceConfigBusinessRuleDO::getRemark, reqVO.getRemark()) + .betweenIfPresent(DeviceConfigBusinessRuleDO::getCreateTime, reqVO.getCreateTime()) + .orderByDesc(DeviceConfigBusinessRuleDO::getId)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceConfigFlowMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceConfigFlowMapper.java new file mode 100644 index 0000000..c06932f --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceConfigFlowMapper.java @@ -0,0 +1,49 @@ +package com.zt.plat.module.qms.resource.device.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.device.dal.dataobject.DeviceConfigFlowDO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceConfigFlowPageReqVO; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 设备通用流程配置 Mapper + * + * @author 后台管理-1 + */ +@Mapper +public interface DeviceConfigFlowMapper extends BaseMapperX { + + default PageResult selectPage(DeviceConfigFlowPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(DeviceConfigFlowDO::getBusinessType, reqVO.getBusinessType()) + .likeIfPresent(DeviceConfigFlowDO::getBusinessName, reqVO.getBusinessName()) + .eqIfPresent(DeviceConfigFlowDO::getFlowKey, reqVO.getFlowKey()) + .eqIfPresent(DeviceConfigFlowDO::getDataCollectionKey, reqVO.getDataCollectionKey()) + .eqIfPresent(DeviceConfigFlowDO::getTemplateKey, reqVO.getTemplateKey()) + .eqIfPresent(DeviceConfigFlowDO::getFormComponent, reqVO.getFormComponent()) + .eqIfPresent(DeviceConfigFlowDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .eqIfPresent(DeviceConfigFlowDO::getRemark, reqVO.getRemark()) + .betweenIfPresent(DeviceConfigFlowDO::getCreateTime, reqVO.getCreateTime()) + .orderByDesc(DeviceConfigFlowDO::getId)); + } + + default List selectList(DeviceConfigFlowPageReqVO reqVO) { + return selectList(new LambdaQueryWrapperX() + .eqIfPresent(DeviceConfigFlowDO::getBusinessType, reqVO.getBusinessType()) + .likeIfPresent(DeviceConfigFlowDO::getBusinessName, reqVO.getBusinessName()) + .eqIfPresent(DeviceConfigFlowDO::getFlowKey, reqVO.getFlowKey()) + .eqIfPresent(DeviceConfigFlowDO::getDataCollectionKey, reqVO.getDataCollectionKey()) + .eqIfPresent(DeviceConfigFlowDO::getTemplateKey, reqVO.getTemplateKey()) + .eqIfPresent(DeviceConfigFlowDO::getFormComponent, reqVO.getFormComponent()) + .eqIfPresent(DeviceConfigFlowDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .eqIfPresent(DeviceConfigFlowDO::getRemark, reqVO.getRemark()) + .betweenIfPresent(DeviceConfigFlowDO::getCreateTime, reqVO.getCreateTime()) + .orderByAsc(DeviceConfigFlowDO::getOrderNo) + ); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceInfomationMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceInfomationMapper.java index b67c198..2fba698 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceInfomationMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceInfomationMapper.java @@ -4,8 +4,13 @@ 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.qms.resource.device.controller.vo.DeviceInfomationPageReqVO; +import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceInfoWithBizConfigVO; import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceInfomationDO; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; /** * 设备-设备信息 Mapper @@ -19,7 +24,7 @@ public interface DeviceInfomationMapper extends BaseMapperX return selectPage(reqVO, new LambdaQueryWrapperX() .eqIfPresent(DeviceInfomationDO::getProductId, reqVO.getProductId()) .inIfPresent(DeviceInfomationDO::getProductId, reqVO.getProductIds()) - .likeIfPresent(DeviceInfomationDO::getProductName, reqVO.getProductName()) + .likeIfPresent(DeviceInfomationDO::getDeviceName, reqVO.getDeviceName()) .eqIfPresent(DeviceInfomationDO::getAlias, reqVO.getAlias()) .eqIfPresent(DeviceInfomationDO::getDeviceStatus, reqVO.getDeviceStatus()) .eqIfPresent(DeviceInfomationDO::getRepairFlag, reqVO.getRepairFlag()) @@ -56,4 +61,7 @@ public interface DeviceInfomationMapper extends BaseMapperX .orderByDesc(DeviceInfomationDO::getId)); } + //查询需要“某个业务类型”的设备列表 + List getListNeedByRule(@Param("param") Map param); + } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceMaintainItemMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceMaintainItemMapper.java new file mode 100644 index 0000000..676cec6 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceMaintainItemMapper.java @@ -0,0 +1,45 @@ +package com.zt.plat.module.qms.resource.device.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.device.dal.dataobject.DeviceMaintainItemDO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceMaintainItemPageReqVO; +import org.apache.ibatis.annotations.Mapper; + +/** + * 设备-保养分项 Mapper + * + * @author 后台管理-1 + */ +@Mapper +public interface DeviceMaintainItemMapper extends BaseMapperX { + + default PageResult selectPage(DeviceMaintainItemPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(DeviceMaintainItemDO::getParentId, reqVO.getParentId()) + .eqIfPresent(DeviceMaintainItemDO::getCheckItemId, reqVO.getCheckItemId()) + .eqIfPresent(DeviceMaintainItemDO::getCheckResult, reqVO.getCheckResult()) + .eqIfPresent(DeviceMaintainItemDO::getConclusion, reqVO.getConclusion()) + .eqIfPresent(DeviceMaintainItemDO::getCheckRemark, reqVO.getCheckRemark()) + .betweenIfPresent(DeviceMaintainItemDO::getCheckDate, reqVO.getCheckDate()) + .likeIfPresent(DeviceMaintainItemDO::getCheckUserName, reqVO.getCheckUserName()) + .eqIfPresent(DeviceMaintainItemDO::getCheckUserId, reqVO.getCheckUserId()) + .eqIfPresent(DeviceMaintainItemDO::getItemKey, reqVO.getItemKey()) + .likeIfPresent(DeviceMaintainItemDO::getItemName, reqVO.getItemName()) + .eqIfPresent(DeviceMaintainItemDO::getFrequencyType, reqVO.getFrequencyType()) + .eqIfPresent(DeviceMaintainItemDO::getFrequency, reqVO.getFrequency()) + .eqIfPresent(DeviceMaintainItemDO::getFrequencyTimeStart, reqVO.getFrequencyTimeStart()) + .eqIfPresent(DeviceMaintainItemDO::getFrequencyTimeEnd, reqVO.getFrequencyTimeEnd()) + .eqIfPresent(DeviceMaintainItemDO::getStandard, reqVO.getStandard()) + .eqIfPresent(DeviceMaintainItemDO::getItemMethod, reqVO.getItemMethod()) + .eqIfPresent(DeviceMaintainItemDO::getFrequencyRemark, reqVO.getFrequencyRemark()) + .eqIfPresent(DeviceMaintainItemDO::getDutyRemark, reqVO.getDutyRemark()) + .eqIfPresent(DeviceMaintainItemDO::getSortNo, reqVO.getSortNo()) + .eqIfPresent(DeviceMaintainItemDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .eqIfPresent(DeviceMaintainItemDO::getRemark, reqVO.getRemark()) + .betweenIfPresent(DeviceMaintainItemDO::getCreateTime, reqVO.getCreateTime()) + .orderByDesc(DeviceMaintainItemDO::getId)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceMaintainMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceMaintainMapper.java new file mode 100644 index 0000000..56fcf80 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceMaintainMapper.java @@ -0,0 +1,46 @@ +package com.zt.plat.module.qms.resource.device.dal.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +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.device.controller.vo.DeviceMaintainVO; +import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceMaintainDO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceMaintainPageReqVO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 设备-点检、保养记录 Mapper + * + * @author 后台管理-1 + */ +@Mapper +public interface DeviceMaintainMapper extends BaseMapperX { + + default PageResult selectPage(DeviceMaintainPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(DeviceMaintainDO::getDataType, reqVO.getDataType()) + .eqIfPresent(DeviceMaintainDO::getRuleId, reqVO.getRuleId()) + .eqIfPresent(DeviceMaintainDO::getDeviceId, reqVO.getDeviceId()) + .betweenIfPresent(DeviceMaintainDO::getCheckDate, reqVO.getCheckDate()) + .eqIfPresent(DeviceMaintainDO::getContent, reqVO.getContent()) + .eqIfPresent(DeviceMaintainDO::getCheckUserId, reqVO.getCheckUserId()) + .likeIfPresent(DeviceMaintainDO::getCheckUserName, reqVO.getCheckUserName()) + .eqIfPresent(DeviceMaintainDO::getFrequencyType, reqVO.getFrequencyType()) + .eqIfPresent(DeviceMaintainDO::getFrequency, reqVO.getFrequency()) + .eqIfPresent(DeviceMaintainDO::getFrequencyRemark, reqVO.getFrequencyRemark()) + .eqIfPresent(DeviceMaintainDO::getFrequencyTimeStart, reqVO.getFrequencyTimeStart()) + .eqIfPresent(DeviceMaintainDO::getFrequencyTimeEnd, reqVO.getFrequencyTimeEnd()) + .eqIfPresent(DeviceMaintainDO::getSubmitFlag, reqVO.getSubmitFlag()) + .eqIfPresent(DeviceMaintainDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .eqIfPresent(DeviceMaintainDO::getRemark, reqVO.getRemark()) + .betweenIfPresent(DeviceMaintainDO::getCreateTime, reqVO.getCreateTime()) + .orderByDesc(DeviceMaintainDO::getId)); + } + + IPage queryPageListWithCount(Page page, @Param("param") DeviceMaintainPageReqVO param); + DeviceMaintainVO queryVoById(@Param("id") Long id); + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DevicePeriodCheckMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DevicePeriodCheckMapper.java new file mode 100644 index 0000000..c85acac --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DevicePeriodCheckMapper.java @@ -0,0 +1,46 @@ +package com.zt.plat.module.qms.resource.device.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.device.dal.dataobject.DevicePeriodCheckDO; +import com.zt.plat.module.qms.resource.device.controller.vo.DevicePeriodCheckPageReqVO; +import org.apache.ibatis.annotations.Mapper; + +/** + * 设备-期间核查 Mapper + * + * @author 后台管理-1 + */ +@Mapper +public interface DevicePeriodCheckMapper extends BaseMapperX { + + default PageResult selectPage(DevicePeriodCheckPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(DevicePeriodCheckDO::getPlanId, reqVO.getPlanId()) + .eqIfPresent(DevicePeriodCheckDO::getEffectiveFlag, reqVO.getEffectiveFlag()) + .eqIfPresent(DevicePeriodCheckDO::getDeviceId, reqVO.getDeviceId()) + .eqIfPresent(DevicePeriodCheckDO::getCheckPersonRemark, reqVO.getCheckPersonRemark()) + .likeIfPresent(DevicePeriodCheckDO::getCheckPersonName, reqVO.getCheckPersonName()) + .eqIfPresent(DevicePeriodCheckDO::getCheckPersonId, reqVO.getCheckPersonId()) + .likeIfPresent(DevicePeriodCheckDO::getRecheckPersonName, reqVO.getRecheckPersonName()) + .eqIfPresent(DevicePeriodCheckDO::getRecheckPersonId, reqVO.getRecheckPersonId()) + .eqIfPresent(DevicePeriodCheckDO::getCheckAccording, reqVO.getCheckAccording()) + .eqIfPresent(DevicePeriodCheckDO::getCheckAccordingRemark, reqVO.getCheckAccordingRemark()) + .eqIfPresent(DevicePeriodCheckDO::getCheckContent, reqVO.getCheckContent()) + .eqIfPresent(DevicePeriodCheckDO::getCheckResult, reqVO.getCheckResult()) + .eqIfPresent(DevicePeriodCheckDO::getCheckRemark, reqVO.getCheckRemark()) + .betweenIfPresent(DevicePeriodCheckDO::getCheckDate, reqVO.getCheckDate()) + .betweenIfPresent(DevicePeriodCheckDO::getLastCheckDate, reqVO.getLastCheckDate()) + .eqIfPresent(DevicePeriodCheckDO::getPlanCheckDateStart, reqVO.getPlanCheckDateStart()) + .eqIfPresent(DevicePeriodCheckDO::getPlanCheckDateEnd, reqVO.getPlanCheckDateEnd()) + .eqIfPresent(DevicePeriodCheckDO::getFrequencyRemark, reqVO.getFrequencyRemark()) + .eqIfPresent(DevicePeriodCheckDO::getFlowStatus, reqVO.getFlowStatus()) + .eqIfPresent(DevicePeriodCheckDO::getFlowInstanceId, reqVO.getFlowInstanceId()) + .eqIfPresent(DevicePeriodCheckDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .eqIfPresent(DevicePeriodCheckDO::getRemark, reqVO.getRemark()) + .betweenIfPresent(DevicePeriodCheckDO::getCreateTime, reqVO.getCreateTime()) + .orderByDesc(DevicePeriodCheckDO::getId)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DevicePeriodCheckPlanMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DevicePeriodCheckPlanMapper.java new file mode 100644 index 0000000..4a5098d --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DevicePeriodCheckPlanMapper.java @@ -0,0 +1,36 @@ +package com.zt.plat.module.qms.resource.device.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.device.dal.dataobject.DevicePeriodCheckPlanDO; +import com.zt.plat.module.qms.resource.device.controller.vo.DevicePeriodCheckPlanPageReqVO; +import org.apache.ibatis.annotations.Mapper; + +/** + * 设备-期间核查计划 Mapper + * + * @author 后台管理-1 + */ +@Mapper +public interface DevicePeriodCheckPlanMapper extends BaseMapperX { + + default PageResult selectPage(DevicePeriodCheckPlanPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(DevicePeriodCheckPlanDO::getParentId, reqVO.getParentId()) + .eqIfPresent(DevicePeriodCheckPlanDO::getCheckYear, reqVO.getCheckYear()) + .likeIfPresent(DevicePeriodCheckPlanDO::getApplyUserName, reqVO.getApplyUserName()) + .eqIfPresent(DevicePeriodCheckPlanDO::getFlowStatus, reqVO.getFlowStatus()) + .eqIfPresent(DevicePeriodCheckPlanDO::getFlowInstanceId, reqVO.getFlowInstanceId()) + .eqIfPresent(DevicePeriodCheckPlanDO::getTitle, reqVO.getTitle()) + .eqIfPresent(DevicePeriodCheckPlanDO::getBasicSubmitFlag, reqVO.getBasicSubmitFlag()) + .eqIfPresent(DevicePeriodCheckPlanDO::getRollbackRemark, reqVO.getRollbackRemark()) + .eqIfPresent(DevicePeriodCheckPlanDO::getDataType, reqVO.getDataType()) + .eqIfPresent(DevicePeriodCheckPlanDO::getCancelFlag, reqVO.getCancelFlag()) + .eqIfPresent(DevicePeriodCheckPlanDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .eqIfPresent(DevicePeriodCheckPlanDO::getRemark, reqVO.getRemark()) + .betweenIfPresent(DevicePeriodCheckPlanDO::getCreateTime, reqVO.getCreateTime()) + .orderByDesc(DevicePeriodCheckPlanDO::getId)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceRepairApplyMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceRepairApplyMapper.java new file mode 100644 index 0000000..63e361d --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceRepairApplyMapper.java @@ -0,0 +1,40 @@ +package com.zt.plat.module.qms.resource.device.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.device.dal.dataobject.DeviceRepairApplyDO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceRepairApplyPageReqVO; +import org.apache.ibatis.annotations.Mapper; + +/** + * 维修申请 Mapper + * + * @author 后台管理-1 + */ +@Mapper +public interface DeviceRepairApplyMapper extends BaseMapperX { + + default PageResult selectPage(DeviceRepairApplyPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(DeviceRepairApplyDO::getDeviceId, reqVO.getDeviceId()) + .eqIfPresent(DeviceRepairApplyDO::getDevicePosition, reqVO.getDevicePosition()) + .likeIfPresent(DeviceRepairApplyDO::getApplyUserName, reqVO.getApplyUserName()) + .betweenIfPresent(DeviceRepairApplyDO::getApplyTime, reqVO.getApplyTime()) + .eqIfPresent(DeviceRepairApplyDO::getTitle, reqVO.getTitle()) + .eqIfPresent(DeviceRepairApplyDO::getFlowStatus, reqVO.getFlowStatus()) + .eqIfPresent(DeviceRepairApplyDO::getFlowInstanceId, reqVO.getFlowInstanceId()) + .eqIfPresent(DeviceRepairApplyDO::getFaultDescription, reqVO.getFaultDescription()) + .eqIfPresent(DeviceRepairApplyDO::getConclusion, reqVO.getConclusion()) + .eqIfPresent(DeviceRepairApplyDO::getRepairFlag, reqVO.getRepairFlag()) + .eqIfPresent(DeviceRepairApplyDO::getRepairAnalysis, reqVO.getRepairAnalysis()) + .eqIfPresent(DeviceRepairApplyDO::getRepairSolution, reqVO.getRepairSolution()) + .eqIfPresent(DeviceRepairApplyDO::getRepairType, reqVO.getRepairType()) + .eqIfPresent(DeviceRepairApplyDO::getCancelFlag, reqVO.getCancelFlag()) + .eqIfPresent(DeviceRepairApplyDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .eqIfPresent(DeviceRepairApplyDO::getRemark, reqVO.getRemark()) + .betweenIfPresent(DeviceRepairApplyDO::getCreateTime, reqVO.getCreateTime()) + .orderByDesc(DeviceRepairApplyDO::getId)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceRepairAtMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceRepairAtMapper.java new file mode 100644 index 0000000..f79d26d --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceRepairAtMapper.java @@ -0,0 +1,28 @@ +package com.zt.plat.module.qms.resource.device.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.device.dal.dataobject.DeviceRepairAtDO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceRepairAtPageReqVO; +import org.apache.ibatis.annotations.Mapper; + +/** + * 故障与处理关系 Mapper + * + * @author 后台管理-1 + */ +@Mapper +public interface DeviceRepairAtMapper extends BaseMapperX { + + default PageResult selectPage(DeviceRepairAtPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(DeviceRepairAtDO::getRepairDetailId, reqVO.getRepairDetailId()) + .eqIfPresent(DeviceRepairAtDO::getResultDetailId, reqVO.getResultDetailId()) + .eqIfPresent(DeviceRepairAtDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .eqIfPresent(DeviceRepairAtDO::getRemark, reqVO.getRemark()) + .betweenIfPresent(DeviceRepairAtDO::getCreateTime, reqVO.getCreateTime()) + .orderByDesc(DeviceRepairAtDO::getId)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceRepairDetailMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceRepairDetailMapper.java new file mode 100644 index 0000000..f6a7470 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceRepairDetailMapper.java @@ -0,0 +1,28 @@ +package com.zt.plat.module.qms.resource.device.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.device.dal.dataobject.DeviceRepairDetailDO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceRepairDetailPageReqVO; +import org.apache.ibatis.annotations.Mapper; + +/** + * 设备维修明细 Mapper + * + * @author 后台管理-1 + */ +@Mapper +public interface DeviceRepairDetailMapper extends BaseMapperX { + + default PageResult selectPage(DeviceRepairDetailPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(DeviceRepairDetailDO::getRepairId, reqVO.getRepairId()) + .eqIfPresent(DeviceRepairDetailDO::getFaultContent, reqVO.getFaultContent()) + .eqIfPresent(DeviceRepairDetailDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .eqIfPresent(DeviceRepairDetailDO::getRemark, reqVO.getRemark()) + .betweenIfPresent(DeviceRepairDetailDO::getCreateTime, reqVO.getCreateTime()) + .orderByDesc(DeviceRepairDetailDO::getId)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceRepairResultDetailMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceRepairResultDetailMapper.java new file mode 100644 index 0000000..b245470 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceRepairResultDetailMapper.java @@ -0,0 +1,27 @@ +package com.zt.plat.module.qms.resource.device.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.device.dal.dataobject.DeviceRepairResultDetailDO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceRepairResultDetailPageReqVO; +import org.apache.ibatis.annotations.Mapper; + +/** + * 故障处理明细 Mapper + * + * @author 后台管理-1 + */ +@Mapper +public interface DeviceRepairResultDetailMapper extends BaseMapperX { + + default PageResult selectPage(DeviceRepairResultDetailPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(DeviceRepairResultDetailDO::getSolutionContent, reqVO.getSolutionContent()) + .eqIfPresent(DeviceRepairResultDetailDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .eqIfPresent(DeviceRepairResultDetailDO::getRemark, reqVO.getRemark()) + .betweenIfPresent(DeviceRepairResultDetailDO::getCreateTime, reqVO.getCreateTime()) + .orderByDesc(DeviceRepairResultDetailDO::getId)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceUseRecordMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceUseRecordMapper.java new file mode 100644 index 0000000..539b0fe --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceUseRecordMapper.java @@ -0,0 +1,46 @@ +package com.zt.plat.module.qms.resource.device.dal.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +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.device.controller.vo.DeviceUseRecordVO; +import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceUseRecordDO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceUseRecordPageReqVO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 设备-使用记录 Mapper + * + * @author 后台管理-1 + */ +@Mapper +public interface DeviceUseRecordMapper extends BaseMapperX { + + default PageResult selectPage(DeviceUseRecordPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(DeviceUseRecordDO::getDeviceId, reqVO.getDeviceId()) + .likeIfPresent(DeviceUseRecordDO::getUserName, reqVO.getUserName()) + .eqIfPresent(DeviceUseRecordDO::getUserId, reqVO.getUserId()) + .betweenIfPresent(DeviceUseRecordDO::getUseTimeStart, reqVO.getUseTimeStart()) + .betweenIfPresent(DeviceUseRecordDO::getUseTimeEnd, reqVO.getUseTimeEnd()) + .eqIfPresent(DeviceUseRecordDO::getUseRemark, reqVO.getUseRemark()) + .eqIfPresent(DeviceUseRecordDO::getStateBefore, reqVO.getStateBefore()) + .eqIfPresent(DeviceUseRecordDO::getStateRun, reqVO.getStateRun()) + .eqIfPresent(DeviceUseRecordDO::getStateAfter, reqVO.getStateAfter()) + .eqIfPresent(DeviceUseRecordDO::getTemperature, reqVO.getTemperature()) + .eqIfPresent(DeviceUseRecordDO::getHumidity, reqVO.getHumidity()) + .eqIfPresent(DeviceUseRecordDO::getDataSource, reqVO.getDataSource()) + .eqIfPresent(DeviceUseRecordDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .eqIfPresent(DeviceUseRecordDO::getRemark, reqVO.getRemark()) + .betweenIfPresent(DeviceUseRecordDO::getCreateTime, reqVO.getCreateTime()) + .orderByDesc(DeviceUseRecordDO::getId)); + } + + IPage queryPageListWithCount(Page page, @Param("param") DeviceUseRecordPageReqVO param); + DeviceUseRecordVO queryVoById(@Param("id") Long id); + + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceAffiliationRelativityService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceAffiliationRelativityService.java new file mode 100644 index 0000000..6d8340c --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceAffiliationRelativityService.java @@ -0,0 +1,64 @@ +package com.zt.plat.module.qms.resource.device.service; + +import java.util.*; + +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceAffiliationRelativityPageReqVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceAffiliationRelativityRespVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceAffiliationRelativitySaveReqVO; +import jakarta.validation.*; +import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceAffiliationRelativityDO; +import com.zt.plat.framework.common.pojo.PageResult; + +/** + * 附属设备关系 Service 接口 + * + * @author 后台管理-1 + */ +public interface DeviceAffiliationRelativityService { + + /** + * 创建附属设备关系 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + DeviceAffiliationRelativityRespVO createDeviceAffiliationRelativity(@Valid DeviceAffiliationRelativitySaveReqVO createReqVO); + + /** + * 更新附属设备关系 + * + * @param updateReqVO 更新信息 + */ + void updateDeviceAffiliationRelativity(@Valid DeviceAffiliationRelativitySaveReqVO updateReqVO); + + /** + * 删除附属设备关系 + * + * @param id 编号 + */ + void deleteDeviceAffiliationRelativity(Long id); + + /** + * 批量删除附属设备关系 + * + * @param ids 编号 + */ + void deleteDeviceAffiliationRelativityListByIds(List ids); + + /** + * 获得附属设备关系 + * + * @param id 编号 + * @return 附属设备关系 + */ + DeviceAffiliationRelativityDO getDeviceAffiliationRelativity(Long id); + + /** + * 获得附属设备关系分页 + * + * @param pageReqVO 分页查询 + * @return 附属设备关系分页 + */ + PageResult getDeviceAffiliationRelativityPage(DeviceAffiliationRelativityPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceAffiliationRelativityServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceAffiliationRelativityServiceImpl.java new file mode 100644 index 0000000..bd464a6 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceAffiliationRelativityServiceImpl.java @@ -0,0 +1,92 @@ +package com.zt.plat.module.qms.resource.device.service; + +import cn.hutool.core.collection.CollUtil; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceAffiliationRelativityPageReqVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceAffiliationRelativityRespVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceAffiliationRelativitySaveReqVO; +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.device.dal.dataobject.DeviceAffiliationRelativityDO; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.util.object.BeanUtils; + +import com.zt.plat.module.qms.resource.device.dal.mapper.DeviceAffiliationRelativityMapper; + +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.DEVICE_AFFILIATION_RELATIVITY_NOT_EXISTS; + +/** + * 附属设备关系 Service 实现类 + * + * @author 后台管理-1 + */ +@Service +@Validated +public class DeviceAffiliationRelativityServiceImpl implements DeviceAffiliationRelativityService { + + @Resource + private DeviceAffiliationRelativityMapper deviceAffiliationRelativityMapper; + + @Override + public DeviceAffiliationRelativityRespVO createDeviceAffiliationRelativity(DeviceAffiliationRelativitySaveReqVO createReqVO) { + // 插入 + DeviceAffiliationRelativityDO deviceAffiliationRelativity = BeanUtils.toBean(createReqVO, DeviceAffiliationRelativityDO.class); + deviceAffiliationRelativityMapper.insert(deviceAffiliationRelativity); + // 返回 + return BeanUtils.toBean(deviceAffiliationRelativity, DeviceAffiliationRelativityRespVO.class); + } + + @Override + public void updateDeviceAffiliationRelativity(DeviceAffiliationRelativitySaveReqVO updateReqVO) { + // 校验存在 + validateDeviceAffiliationRelativityExists(updateReqVO.getId()); + // 更新 + DeviceAffiliationRelativityDO updateObj = BeanUtils.toBean(updateReqVO, DeviceAffiliationRelativityDO.class); + deviceAffiliationRelativityMapper.updateById(updateObj); + } + + @Override + public void deleteDeviceAffiliationRelativity(Long id) { + // 校验存在 + validateDeviceAffiliationRelativityExists(id); + // 删除 + deviceAffiliationRelativityMapper.deleteById(id); + } + + @Override + public void deleteDeviceAffiliationRelativityListByIds(List ids) { + // 校验存在 + validateDeviceAffiliationRelativityExists(ids); + // 删除 + deviceAffiliationRelativityMapper.deleteByIds(ids); + } + + private void validateDeviceAffiliationRelativityExists(List ids) { + List list = deviceAffiliationRelativityMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(DEVICE_AFFILIATION_RELATIVITY_NOT_EXISTS); + } + } + + private void validateDeviceAffiliationRelativityExists(Long id) { + if (deviceAffiliationRelativityMapper.selectById(id) == null) { + throw exception(DEVICE_AFFILIATION_RELATIVITY_NOT_EXISTS); + } + } + + @Override + public DeviceAffiliationRelativityDO getDeviceAffiliationRelativity(Long id) { + return deviceAffiliationRelativityMapper.selectById(id); + } + + @Override + public PageResult getDeviceAffiliationRelativityPage(DeviceAffiliationRelativityPageReqVO pageReqVO) { + return deviceAffiliationRelativityMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceApplyDetailService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceApplyDetailService.java new file mode 100644 index 0000000..52b0457 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceApplyDetailService.java @@ -0,0 +1,64 @@ +package com.zt.plat.module.qms.resource.device.service; + +import java.util.*; + +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceApplyDetailPageReqVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceApplyDetailRespVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceApplyDetailSaveReqVO; +import jakarta.validation.*; +import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceApplyDetailDO; +import com.zt.plat.framework.common.pojo.PageResult; + +/** + * 设备通用流程明细 Service 接口 + * + * @author 后台管理-1 + */ +public interface DeviceApplyDetailService { + + /** + * 创建设备通用流程明细 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + DeviceApplyDetailRespVO createDeviceApplyDetail(@Valid DeviceApplyDetailSaveReqVO createReqVO); + + /** + * 更新设备通用流程明细 + * + * @param updateReqVO 更新信息 + */ + void updateDeviceApplyDetail(@Valid DeviceApplyDetailSaveReqVO updateReqVO); + + /** + * 删除设备通用流程明细 + * + * @param id 编号 + */ + void deleteDeviceApplyDetail(Long id); + + /** + * 批量删除设备通用流程明细 + * + * @param ids 编号 + */ + void deleteDeviceApplyDetailListByIds(List ids); + + /** + * 获得设备通用流程明细 + * + * @param id 编号 + * @return 设备通用流程明细 + */ + DeviceApplyDetailDO getDeviceApplyDetail(Long id); + + /** + * 获得设备通用流程明细分页 + * + * @param pageReqVO 分页查询 + * @return 设备通用流程明细分页 + */ + PageResult getDeviceApplyDetailPage(DeviceApplyDetailPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceApplyDetailServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceApplyDetailServiceImpl.java new file mode 100644 index 0000000..5c09035 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceApplyDetailServiceImpl.java @@ -0,0 +1,92 @@ +package com.zt.plat.module.qms.resource.device.service; + +import cn.hutool.core.collection.CollUtil; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceApplyDetailPageReqVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceApplyDetailRespVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceApplyDetailSaveReqVO; +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.device.dal.dataobject.DeviceApplyDetailDO; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.util.object.BeanUtils; + +import com.zt.plat.module.qms.resource.device.dal.mapper.DeviceApplyDetailMapper; + +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.DEVICE_APPLY_DETAIL_NOT_EXISTS; + +/** + * 设备通用流程明细 Service 实现类 + * + * @author 后台管理-1 + */ +@Service +@Validated +public class DeviceApplyDetailServiceImpl implements DeviceApplyDetailService { + + @Resource + private DeviceApplyDetailMapper deviceApplyDetailMapper; + + @Override + public DeviceApplyDetailRespVO createDeviceApplyDetail(DeviceApplyDetailSaveReqVO createReqVO) { + // 插入 + DeviceApplyDetailDO deviceApplyDetail = BeanUtils.toBean(createReqVO, DeviceApplyDetailDO.class); + deviceApplyDetailMapper.insert(deviceApplyDetail); + // 返回 + return BeanUtils.toBean(deviceApplyDetail, DeviceApplyDetailRespVO.class); + } + + @Override + public void updateDeviceApplyDetail(DeviceApplyDetailSaveReqVO updateReqVO) { + // 校验存在 + validateDeviceApplyDetailExists(updateReqVO.getId()); + // 更新 + DeviceApplyDetailDO updateObj = BeanUtils.toBean(updateReqVO, DeviceApplyDetailDO.class); + deviceApplyDetailMapper.updateById(updateObj); + } + + @Override + public void deleteDeviceApplyDetail(Long id) { + // 校验存在 + validateDeviceApplyDetailExists(id); + // 删除 + deviceApplyDetailMapper.deleteById(id); + } + + @Override + public void deleteDeviceApplyDetailListByIds(List ids) { + // 校验存在 + validateDeviceApplyDetailExists(ids); + // 删除 + deviceApplyDetailMapper.deleteByIds(ids); + } + + private void validateDeviceApplyDetailExists(List ids) { + List list = deviceApplyDetailMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(DEVICE_APPLY_DETAIL_NOT_EXISTS); + } + } + + private void validateDeviceApplyDetailExists(Long id) { + if (deviceApplyDetailMapper.selectById(id) == null) { + throw exception(DEVICE_APPLY_DETAIL_NOT_EXISTS); + } + } + + @Override + public DeviceApplyDetailDO getDeviceApplyDetail(Long id) { + return deviceApplyDetailMapper.selectById(id); + } + + @Override + public PageResult getDeviceApplyDetailPage(DeviceApplyDetailPageReqVO pageReqVO) { + return deviceApplyDetailMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceApplyService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceApplyService.java new file mode 100644 index 0000000..f1a7379 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceApplyService.java @@ -0,0 +1,64 @@ +package com.zt.plat.module.qms.resource.device.service; + +import java.util.*; + +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceApplyPageReqVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceApplyRespVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceApplySaveReqVO; +import jakarta.validation.*; +import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceApplyDO; +import com.zt.plat.framework.common.pojo.PageResult; + +/** + * 设备通用流程,验收、降级、停用、报废、还原、启用 Service 接口 + * + * @author 后台管理-1 + */ +public interface DeviceApplyService { + + /** + * 创建设备通用流程,验收、降级、停用、报废、还原、启用 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + DeviceApplyRespVO createDeviceApply(@Valid DeviceApplySaveReqVO createReqVO); + + /** + * 更新设备通用流程,验收、降级、停用、报废、还原、启用 + * + * @param updateReqVO 更新信息 + */ + void updateDeviceApply(@Valid DeviceApplySaveReqVO updateReqVO); + + /** + * 删除设备通用流程,验收、降级、停用、报废、还原、启用 + * + * @param id 编号 + */ + void deleteDeviceApply(Long id); + + /** + * 批量删除设备通用流程,验收、降级、停用、报废、还原、启用 + * + * @param ids 编号 + */ + void deleteDeviceApplyListByIds(List ids); + + /** + * 获得设备通用流程,验收、降级、停用、报废、还原、启用 + * + * @param id 编号 + * @return 设备通用流程,验收、降级、停用、报废、还原、启用 + */ + DeviceApplyDO getDeviceApply(Long id); + + /** + * 获得设备通用流程,验收、降级、停用、报废、还原、启用分页 + * + * @param pageReqVO 分页查询 + * @return 设备通用流程,验收、降级、停用、报废、还原、启用分页 + */ + PageResult getDeviceApplyPage(DeviceApplyPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceApplyServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceApplyServiceImpl.java new file mode 100644 index 0000000..02ec912 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceApplyServiceImpl.java @@ -0,0 +1,92 @@ +package com.zt.plat.module.qms.resource.device.service; + +import cn.hutool.core.collection.CollUtil; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceApplyPageReqVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceApplyRespVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceApplySaveReqVO; +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.device.dal.dataobject.DeviceApplyDO; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.util.object.BeanUtils; + +import com.zt.plat.module.qms.resource.device.dal.mapper.DeviceApplyMapper; + +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.DEVICE_APPLY_NOT_EXISTS; + +/** + * 设备通用流程,验收、降级、停用、报废、还原、启用 Service 实现类 + * + * @author 后台管理-1 + */ +@Service +@Validated +public class DeviceApplyServiceImpl implements DeviceApplyService { + + @Resource + private DeviceApplyMapper deviceApplyMapper; + + @Override + public DeviceApplyRespVO createDeviceApply(DeviceApplySaveReqVO createReqVO) { + // 插入 + DeviceApplyDO deviceApply = BeanUtils.toBean(createReqVO, DeviceApplyDO.class); + deviceApplyMapper.insert(deviceApply); + // 返回 + return BeanUtils.toBean(deviceApply, DeviceApplyRespVO.class); + } + + @Override + public void updateDeviceApply(DeviceApplySaveReqVO updateReqVO) { + // 校验存在 + validateDeviceApplyExists(updateReqVO.getId()); + // 更新 + DeviceApplyDO updateObj = BeanUtils.toBean(updateReqVO, DeviceApplyDO.class); + deviceApplyMapper.updateById(updateObj); + } + + @Override + public void deleteDeviceApply(Long id) { + // 校验存在 + validateDeviceApplyExists(id); + // 删除 + deviceApplyMapper.deleteById(id); + } + + @Override + public void deleteDeviceApplyListByIds(List ids) { + // 校验存在 + validateDeviceApplyExists(ids); + // 删除 + deviceApplyMapper.deleteByIds(ids); + } + + private void validateDeviceApplyExists(List ids) { + List list = deviceApplyMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(DEVICE_APPLY_NOT_EXISTS); + } + } + + private void validateDeviceApplyExists(Long id) { + if (deviceApplyMapper.selectById(id) == null) { + throw exception(DEVICE_APPLY_NOT_EXISTS); + } + } + + @Override + public DeviceApplyDO getDeviceApply(Long id) { + return deviceApplyMapper.selectById(id); + } + + @Override + public PageResult getDeviceApplyPage(DeviceApplyPageReqVO pageReqVO) { + return deviceApplyMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceCalibrationPlanService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceCalibrationPlanService.java new file mode 100644 index 0000000..a06a8cb --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceCalibrationPlanService.java @@ -0,0 +1,64 @@ +package com.zt.plat.module.qms.resource.device.service; + +import java.util.*; + +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceCalibrationPlanPageReqVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceCalibrationPlanRespVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceCalibrationPlanSaveReqVO; +import jakarta.validation.*; +import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceCalibrationPlanDO; +import com.zt.plat.framework.common.pojo.PageResult; + +/** + * 设备-检定校准计划 Service 接口 + * + * @author 后台管理-1 + */ +public interface DeviceCalibrationPlanService { + + /** + * 创建设备-检定校准计划 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + DeviceCalibrationPlanRespVO createDeviceCalibrationPlan(@Valid DeviceCalibrationPlanSaveReqVO createReqVO); + + /** + * 更新设备-检定校准计划 + * + * @param updateReqVO 更新信息 + */ + void updateDeviceCalibrationPlan(@Valid DeviceCalibrationPlanSaveReqVO updateReqVO); + + /** + * 删除设备-检定校准计划 + * + * @param id 编号 + */ + void deleteDeviceCalibrationPlan(Long id); + + /** + * 批量删除设备-检定校准计划 + * + * @param ids 编号 + */ + void deleteDeviceCalibrationPlanListByIds(List ids); + + /** + * 获得设备-检定校准计划 + * + * @param id 编号 + * @return 设备-检定校准计划 + */ + DeviceCalibrationPlanDO getDeviceCalibrationPlan(Long id); + + /** + * 获得设备-检定校准计划分页 + * + * @param pageReqVO 分页查询 + * @return 设备-检定校准计划分页 + */ + PageResult getDeviceCalibrationPlanPage(DeviceCalibrationPlanPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceCalibrationPlanServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceCalibrationPlanServiceImpl.java new file mode 100644 index 0000000..f6c8417 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceCalibrationPlanServiceImpl.java @@ -0,0 +1,92 @@ +package com.zt.plat.module.qms.resource.device.service; + +import cn.hutool.core.collection.CollUtil; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceCalibrationPlanPageReqVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceCalibrationPlanRespVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceCalibrationPlanSaveReqVO; +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.device.dal.dataobject.DeviceCalibrationPlanDO; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.util.object.BeanUtils; + +import com.zt.plat.module.qms.resource.device.dal.mapper.DeviceCalibrationPlanMapper; + +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.DEVICE_CALIBRATION_PLAN_NOT_EXISTS; + +/** + * 设备-检定校准计划 Service 实现类 + * + * @author 后台管理-1 + */ +@Service +@Validated +public class DeviceCalibrationPlanServiceImpl implements DeviceCalibrationPlanService { + + @Resource + private DeviceCalibrationPlanMapper deviceCalibrationPlanMapper; + + @Override + public DeviceCalibrationPlanRespVO createDeviceCalibrationPlan(DeviceCalibrationPlanSaveReqVO createReqVO) { + // 插入 + DeviceCalibrationPlanDO deviceCalibrationPlan = BeanUtils.toBean(createReqVO, DeviceCalibrationPlanDO.class); + deviceCalibrationPlanMapper.insert(deviceCalibrationPlan); + // 返回 + return BeanUtils.toBean(deviceCalibrationPlan, DeviceCalibrationPlanRespVO.class); + } + + @Override + public void updateDeviceCalibrationPlan(DeviceCalibrationPlanSaveReqVO updateReqVO) { + // 校验存在 + validateDeviceCalibrationPlanExists(updateReqVO.getId()); + // 更新 + DeviceCalibrationPlanDO updateObj = BeanUtils.toBean(updateReqVO, DeviceCalibrationPlanDO.class); + deviceCalibrationPlanMapper.updateById(updateObj); + } + + @Override + public void deleteDeviceCalibrationPlan(Long id) { + // 校验存在 + validateDeviceCalibrationPlanExists(id); + // 删除 + deviceCalibrationPlanMapper.deleteById(id); + } + + @Override + public void deleteDeviceCalibrationPlanListByIds(List ids) { + // 校验存在 + validateDeviceCalibrationPlanExists(ids); + // 删除 + deviceCalibrationPlanMapper.deleteByIds(ids); + } + + private void validateDeviceCalibrationPlanExists(List ids) { + List list = deviceCalibrationPlanMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(DEVICE_CALIBRATION_PLAN_NOT_EXISTS); + } + } + + private void validateDeviceCalibrationPlanExists(Long id) { + if (deviceCalibrationPlanMapper.selectById(id) == null) { + throw exception(DEVICE_CALIBRATION_PLAN_NOT_EXISTS); + } + } + + @Override + public DeviceCalibrationPlanDO getDeviceCalibrationPlan(Long id) { + return deviceCalibrationPlanMapper.selectById(id); + } + + @Override + public PageResult getDeviceCalibrationPlanPage(DeviceCalibrationPlanPageReqVO pageReqVO) { + return deviceCalibrationPlanMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceCalibrationService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceCalibrationService.java new file mode 100644 index 0000000..6703733 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceCalibrationService.java @@ -0,0 +1,64 @@ +package com.zt.plat.module.qms.resource.device.service; + +import java.util.*; + +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceCalibrationPageReqVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceCalibrationRespVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceCalibrationSaveReqVO; +import jakarta.validation.*; +import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceCalibrationDO; +import com.zt.plat.framework.common.pojo.PageResult; + +/** + * 设备-检定校准 Service 接口 + * + * @author 后台管理-1 + */ +public interface DeviceCalibrationService { + + /** + * 创建设备-检定校准 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + DeviceCalibrationRespVO createDeviceCalibration(@Valid DeviceCalibrationSaveReqVO createReqVO); + + /** + * 更新设备-检定校准 + * + * @param updateReqVO 更新信息 + */ + void updateDeviceCalibration(@Valid DeviceCalibrationSaveReqVO updateReqVO); + + /** + * 删除设备-检定校准 + * + * @param id 编号 + */ + void deleteDeviceCalibration(Long id); + + /** + * 批量删除设备-检定校准 + * + * @param ids 编号 + */ + void deleteDeviceCalibrationListByIds(List ids); + + /** + * 获得设备-检定校准 + * + * @param id 编号 + * @return 设备-检定校准 + */ + DeviceCalibrationDO getDeviceCalibration(Long id); + + /** + * 获得设备-检定校准分页 + * + * @param pageReqVO 分页查询 + * @return 设备-检定校准分页 + */ + PageResult getDeviceCalibrationPage(DeviceCalibrationPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceCalibrationServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceCalibrationServiceImpl.java new file mode 100644 index 0000000..6f75798 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceCalibrationServiceImpl.java @@ -0,0 +1,92 @@ +package com.zt.plat.module.qms.resource.device.service; + +import cn.hutool.core.collection.CollUtil; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceCalibrationPageReqVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceCalibrationRespVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceCalibrationSaveReqVO; +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.device.dal.dataobject.DeviceCalibrationDO; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.util.object.BeanUtils; + +import com.zt.plat.module.qms.resource.device.dal.mapper.DeviceCalibrationMapper; + +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.DEVICE_CALIBRATION_NOT_EXISTS; + +/** + * 设备-检定校准 Service 实现类 + * + * @author 后台管理-1 + */ +@Service +@Validated +public class DeviceCalibrationServiceImpl implements DeviceCalibrationService { + + @Resource + private DeviceCalibrationMapper deviceCalibrationMapper; + + @Override + public DeviceCalibrationRespVO createDeviceCalibration(DeviceCalibrationSaveReqVO createReqVO) { + // 插入 + DeviceCalibrationDO deviceCalibration = BeanUtils.toBean(createReqVO, DeviceCalibrationDO.class); + deviceCalibrationMapper.insert(deviceCalibration); + // 返回 + return BeanUtils.toBean(deviceCalibration, DeviceCalibrationRespVO.class); + } + + @Override + public void updateDeviceCalibration(DeviceCalibrationSaveReqVO updateReqVO) { + // 校验存在 + validateDeviceCalibrationExists(updateReqVO.getId()); + // 更新 + DeviceCalibrationDO updateObj = BeanUtils.toBean(updateReqVO, DeviceCalibrationDO.class); + deviceCalibrationMapper.updateById(updateObj); + } + + @Override + public void deleteDeviceCalibration(Long id) { + // 校验存在 + validateDeviceCalibrationExists(id); + // 删除 + deviceCalibrationMapper.deleteById(id); + } + + @Override + public void deleteDeviceCalibrationListByIds(List ids) { + // 校验存在 + validateDeviceCalibrationExists(ids); + // 删除 + deviceCalibrationMapper.deleteByIds(ids); + } + + private void validateDeviceCalibrationExists(List ids) { + List list = deviceCalibrationMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(DEVICE_CALIBRATION_NOT_EXISTS); + } + } + + private void validateDeviceCalibrationExists(Long id) { + if (deviceCalibrationMapper.selectById(id) == null) { + throw exception(DEVICE_CALIBRATION_NOT_EXISTS); + } + } + + @Override + public DeviceCalibrationDO getDeviceCalibration(Long id) { + return deviceCalibrationMapper.selectById(id); + } + + @Override + public PageResult getDeviceCalibrationPage(DeviceCalibrationPageReqVO pageReqVO) { + return deviceCalibrationMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceConfigBusinessItemService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceConfigBusinessItemService.java new file mode 100644 index 0000000..b8394a1 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceConfigBusinessItemService.java @@ -0,0 +1,67 @@ +package com.zt.plat.module.qms.resource.device.service; + +import java.util.*; + +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceConfigBusinessItemPageReqVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceConfigBusinessItemRespVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceConfigBusinessItemSaveReqVO; +import jakarta.validation.*; +import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceConfigBusinessItemDO; +import com.zt.plat.framework.common.pojo.PageResult; + +/** + * 设备-检查项目配置 Service 接口 + * + * @author 后台管理-1 + */ +public interface DeviceConfigBusinessItemService { + + List listByRuleId(Long ruleId); + List getByIdList(List ruleId); + + /** + * 创建设备-检查项目配置 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + DeviceConfigBusinessItemRespVO createDeviceConfigBusinessItem(@Valid DeviceConfigBusinessItemSaveReqVO createReqVO); + + /** + * 更新设备-检查项目配置 + * + * @param updateReqVO 更新信息 + */ + void updateDeviceConfigBusinessItem(@Valid DeviceConfigBusinessItemSaveReqVO updateReqVO); + + /** + * 删除设备-检查项目配置 + * + * @param id 编号 + */ + void deleteDeviceConfigBusinessItem(Long id); + + /** + * 批量删除设备-检查项目配置 + * + * @param ids 编号 + */ + void deleteDeviceConfigBusinessItemListByIds(List ids); + + /** + * 获得设备-检查项目配置 + * + * @param id 编号 + * @return 设备-检查项目配置 + */ + DeviceConfigBusinessItemDO getDeviceConfigBusinessItem(Long id); + + /** + * 获得设备-检查项目配置分页 + * + * @param pageReqVO 分页查询 + * @return 设备-检查项目配置分页 + */ + PageResult getDeviceConfigBusinessItemPage(DeviceConfigBusinessItemPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceConfigBusinessItemServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceConfigBusinessItemServiceImpl.java new file mode 100644 index 0000000..ed9613b --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceConfigBusinessItemServiceImpl.java @@ -0,0 +1,105 @@ +package com.zt.plat.module.qms.resource.device.service; + +import cn.hutool.core.collection.CollUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceConfigBusinessItemPageReqVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceConfigBusinessItemRespVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceConfigBusinessItemSaveReqVO; +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.device.dal.dataobject.DeviceConfigBusinessItemDO; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.util.object.BeanUtils; + +import com.zt.plat.module.qms.resource.device.dal.mapper.DeviceConfigBusinessItemMapper; + +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.DEVICE_CONFIG_BUSINESS_ITEM_NOT_EXISTS; + +/** + * 设备-检查项目配置 Service 实现类 + * + * @author 后台管理-1 + */ +@Service +@Validated +public class DeviceConfigBusinessItemServiceImpl implements DeviceConfigBusinessItemService { + + @Resource + private DeviceConfigBusinessItemMapper deviceConfigBusinessItemMapper; + + @Override + public List listByRuleId(Long ruleId) { + LambdaQueryWrapper query = new LambdaQueryWrapper<>(); + query.eq(DeviceConfigBusinessItemDO::getRuleId, ruleId); + return deviceConfigBusinessItemMapper.selectList(query); + } + + @Override + public List getByIdList(List ruleId) { + return deviceConfigBusinessItemMapper.selectByIds(ruleId); + } + + @Override + public DeviceConfigBusinessItemRespVO createDeviceConfigBusinessItem(DeviceConfigBusinessItemSaveReqVO createReqVO) { + // 插入 + DeviceConfigBusinessItemDO deviceConfigBusinessItem = BeanUtils.toBean(createReqVO, DeviceConfigBusinessItemDO.class); + deviceConfigBusinessItemMapper.insert(deviceConfigBusinessItem); + // 返回 + return BeanUtils.toBean(deviceConfigBusinessItem, DeviceConfigBusinessItemRespVO.class); + } + + @Override + public void updateDeviceConfigBusinessItem(DeviceConfigBusinessItemSaveReqVO updateReqVO) { + // 校验存在 + validateDeviceConfigBusinessItemExists(updateReqVO.getId()); + // 更新 + DeviceConfigBusinessItemDO updateObj = BeanUtils.toBean(updateReqVO, DeviceConfigBusinessItemDO.class); + deviceConfigBusinessItemMapper.updateById(updateObj); + } + + @Override + public void deleteDeviceConfigBusinessItem(Long id) { + // 校验存在 + validateDeviceConfigBusinessItemExists(id); + // 删除 + deviceConfigBusinessItemMapper.deleteById(id); + } + + @Override + public void deleteDeviceConfigBusinessItemListByIds(List ids) { + // 校验存在 + validateDeviceConfigBusinessItemExists(ids); + // 删除 + deviceConfigBusinessItemMapper.deleteByIds(ids); + } + + private void validateDeviceConfigBusinessItemExists(List ids) { + List list = deviceConfigBusinessItemMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(DEVICE_CONFIG_BUSINESS_ITEM_NOT_EXISTS); + } + } + + private void validateDeviceConfigBusinessItemExists(Long id) { + if (deviceConfigBusinessItemMapper.selectById(id) == null) { + throw exception(DEVICE_CONFIG_BUSINESS_ITEM_NOT_EXISTS); + } + } + + @Override + public DeviceConfigBusinessItemDO getDeviceConfigBusinessItem(Long id) { + return deviceConfigBusinessItemMapper.selectById(id); + } + + @Override + public PageResult getDeviceConfigBusinessItemPage(DeviceConfigBusinessItemPageReqVO pageReqVO) { + return deviceConfigBusinessItemMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceConfigBusinessRuleService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceConfigBusinessRuleService.java new file mode 100644 index 0000000..4ad437d --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceConfigBusinessRuleService.java @@ -0,0 +1,71 @@ +package com.zt.plat.module.qms.resource.device.service; + +import java.util.*; + +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceConfigBusinessRulePageReqVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceConfigBusinessRuleRespVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceConfigBusinessRuleSaveReqVO; +import jakarta.validation.*; +import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceConfigBusinessRuleDO; +import com.zt.plat.framework.common.pojo.PageResult; + +/** + * 设备-业务配置 Service 接口 + * + * @author 后台管理-1 + */ +public interface DeviceConfigBusinessRuleService { + + DeviceConfigBusinessRuleDO getByProductId(Long productId); + + CommonResult getRuleByDeviceIdAndType(Long deviceId, String type); + + List getByProductIdListAndBusinessDomain(List productIdList, String businessDomain); + + /** + * 创建设备-业务配置 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + DeviceConfigBusinessRuleRespVO createDeviceConfigBusinessRule(@Valid DeviceConfigBusinessRuleSaveReqVO createReqVO); + + /** + * 更新设备-业务配置 + * + * @param updateReqVO 更新信息 + */ + void updateDeviceConfigBusinessRule(@Valid DeviceConfigBusinessRuleSaveReqVO updateReqVO); + + /** + * 删除设备-业务配置 + * + * @param id 编号 + */ + void deleteDeviceConfigBusinessRule(Long id); + + /** + * 批量删除设备-业务配置 + * + * @param ids 编号 + */ + void deleteDeviceConfigBusinessRuleListByIds(List ids); + + /** + * 获得设备-业务配置 + * + * @param id 编号 + * @return 设备-业务配置 + */ + DeviceConfigBusinessRuleDO getDeviceConfigBusinessRule(Long id); + + /** + * 获得设备-业务配置分页 + * + * @param pageReqVO 分页查询 + * @return 设备-业务配置分页 + */ + PageResult getDeviceConfigBusinessRulePage(DeviceConfigBusinessRulePageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceConfigBusinessRuleServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceConfigBusinessRuleServiceImpl.java new file mode 100644 index 0000000..663f14c --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceConfigBusinessRuleServiceImpl.java @@ -0,0 +1,151 @@ +package com.zt.plat.module.qms.resource.device.service; + +import cn.hutool.core.collection.CollUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceConfigBusinessRulePageReqVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceConfigBusinessRuleRespVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceConfigBusinessRuleSaveReqVO; +import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceInfomationDO; +import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceProductDO; +import org.springframework.stereotype.Service; +import jakarta.annotation.Resource; +import org.springframework.util.ObjectUtils; +import org.springframework.validation.annotation.Validated; + +import java.util.*; + +import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceConfigBusinessRuleDO; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.util.object.BeanUtils; + +import com.zt.plat.module.qms.resource.device.dal.mapper.DeviceConfigBusinessRuleMapper; + +import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception0; +import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList; +import static com.zt.plat.module.qms.enums.ErrorCodeConstants.DEVICE_CONFIG_BUSINESS_RULE_NOT_EXISTS; + +/** + * 设备-业务配置 Service 实现类 + * + * @author 后台管理-1 + */ +@Service +@Validated +public class DeviceConfigBusinessRuleServiceImpl implements DeviceConfigBusinessRuleService { + + @Resource private DeviceConfigBusinessRuleMapper deviceConfigBusinessRuleMapper; + @Resource private DeviceInfomationService deviceInfomationService; + @Resource private DeviceProductService deviceProductService; + + @Override + public DeviceConfigBusinessRuleDO getByProductId(Long productId) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(DeviceConfigBusinessRuleDO::getProductId, productId); + List list = deviceConfigBusinessRuleMapper.selectList(queryWrapper); + if(list.size() > 1) + throw exception0(DEVICE_CONFIG_BUSINESS_RULE_NOT_EXISTS.getCode(), "业务配置数据有" + list.size() + "行, 请联系管理员处理!"); + if(list.isEmpty()) + return null; + return list.get(0); + } + + @Override + public CommonResult getRuleByDeviceIdAndType(Long deviceId, String type) { + DeviceInfomationDO deviceDO = deviceInfomationService.getDeviceInfomation(deviceId); + DeviceProductDO productDO = deviceProductService.getDeviceProduct(deviceDO.getProductId()); + String path = productDO.getIdPath(); + List productIdList = new ArrayList<>(); + if(!ObjectUtils.isEmpty(path)){ + String[] split = path.split("/"); + for (String s : split) { + String id = s.replaceAll("/", ""); + if(id.equals("0")) + continue; + productIdList.add(s); + } + }else + productIdList.add(productDO.getId().toString()); + List ruleList = getByProductIdListAndBusinessDomain(productIdList, type); + if(ruleList.isEmpty()) + return CommonResult.error(DEVICE_CONFIG_BUSINESS_RULE_NOT_EXISTS); + if(ruleList.size() == 1) + return CommonResult.success(ruleList.get(0)); + //取最底层的配置 + for(int i = productIdList.size() - 1; i > 0; i--){ + String id = productIdList.get(i); + for(DeviceConfigBusinessRuleDO rule : ruleList){ + if(Objects.equals(rule.getProductId(), Long.valueOf(id))) + return CommonResult.success(rule); + } + } + return CommonResult.error(DEVICE_CONFIG_BUSINESS_RULE_NOT_EXISTS); + } + + @Override + public List getByProductIdListAndBusinessDomain(List productIdList, String businessDomain) { + LambdaQueryWrapper query = new LambdaQueryWrapper<>(); + query.in(DeviceConfigBusinessRuleDO::getProductId, productIdList); + query.eq(DeviceConfigBusinessRuleDO::getBusinessDomain, businessDomain); + return deviceConfigBusinessRuleMapper.selectList( query); + } + + @Override + public DeviceConfigBusinessRuleRespVO createDeviceConfigBusinessRule(DeviceConfigBusinessRuleSaveReqVO createReqVO) { + // 插入 + DeviceConfigBusinessRuleDO deviceConfigBusinessRule = BeanUtils.toBean(createReqVO, DeviceConfigBusinessRuleDO.class); + deviceConfigBusinessRuleMapper.insert(deviceConfigBusinessRule); + // 返回 + return BeanUtils.toBean(deviceConfigBusinessRule, DeviceConfigBusinessRuleRespVO.class); + } + + @Override + public void updateDeviceConfigBusinessRule(DeviceConfigBusinessRuleSaveReqVO updateReqVO) { + // 校验存在 + validateDeviceConfigBusinessRuleExists(updateReqVO.getId()); + // 更新 + DeviceConfigBusinessRuleDO updateObj = BeanUtils.toBean(updateReqVO, DeviceConfigBusinessRuleDO.class); + deviceConfigBusinessRuleMapper.updateById(updateObj); + } + + @Override + public void deleteDeviceConfigBusinessRule(Long id) { + // 校验存在 + validateDeviceConfigBusinessRuleExists(id); + // 删除 + deviceConfigBusinessRuleMapper.deleteById(id); + } + + @Override + public void deleteDeviceConfigBusinessRuleListByIds(List ids) { + // 校验存在 + validateDeviceConfigBusinessRuleExists(ids); + // 删除 + deviceConfigBusinessRuleMapper.deleteByIds(ids); + } + + private void validateDeviceConfigBusinessRuleExists(List ids) { + List list = deviceConfigBusinessRuleMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(DEVICE_CONFIG_BUSINESS_RULE_NOT_EXISTS); + } + } + + private void validateDeviceConfigBusinessRuleExists(Long id) { + if (deviceConfigBusinessRuleMapper.selectById(id) == null) { + throw exception(DEVICE_CONFIG_BUSINESS_RULE_NOT_EXISTS); + } + } + + @Override + public DeviceConfigBusinessRuleDO getDeviceConfigBusinessRule(Long id) { + return deviceConfigBusinessRuleMapper.selectById(id); + } + + @Override + public PageResult getDeviceConfigBusinessRulePage(DeviceConfigBusinessRulePageReqVO pageReqVO) { + return deviceConfigBusinessRuleMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceConfigFlowService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceConfigFlowService.java new file mode 100644 index 0000000..1977e0f --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceConfigFlowService.java @@ -0,0 +1,66 @@ +package com.zt.plat.module.qms.resource.device.service; + +import java.util.*; + +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceConfigFlowPageReqVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceConfigFlowRespVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceConfigFlowSaveReqVO; +import jakarta.validation.*; +import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceConfigFlowDO; +import com.zt.plat.framework.common.pojo.PageResult; + +/** + * 设备通用流程配置 Service 接口 + * + * @author 后台管理-1 + */ +public interface DeviceConfigFlowService { + + List getEnableList(DeviceConfigFlowPageReqVO pageReqVO); + + /** + * 创建设备通用流程配置 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + DeviceConfigFlowRespVO createDeviceConfigFlow(@Valid DeviceConfigFlowSaveReqVO createReqVO); + + /** + * 更新设备通用流程配置 + * + * @param updateReqVO 更新信息 + */ + void updateDeviceConfigFlow(@Valid DeviceConfigFlowSaveReqVO updateReqVO); + + /** + * 删除设备通用流程配置 + * + * @param id 编号 + */ + void deleteDeviceConfigFlow(Long id); + + /** + * 批量删除设备通用流程配置 + * + * @param ids 编号 + */ + void deleteDeviceConfigFlowListByIds(List ids); + + /** + * 获得设备通用流程配置 + * + * @param id 编号 + * @return 设备通用流程配置 + */ + DeviceConfigFlowDO getDeviceConfigFlow(Long id); + + /** + * 获得设备通用流程配置分页 + * + * @param pageReqVO 分页查询 + * @return 设备通用流程配置分页 + */ + PageResult getDeviceConfigFlowPage(DeviceConfigFlowPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceConfigFlowServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceConfigFlowServiceImpl.java new file mode 100644 index 0000000..e6a07b3 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceConfigFlowServiceImpl.java @@ -0,0 +1,97 @@ +package com.zt.plat.module.qms.resource.device.service; + +import cn.hutool.core.collection.CollUtil; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceConfigFlowPageReqVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceConfigFlowRespVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceConfigFlowSaveReqVO; +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.device.dal.dataobject.DeviceConfigFlowDO; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.util.object.BeanUtils; + +import com.zt.plat.module.qms.resource.device.dal.mapper.DeviceConfigFlowMapper; + +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 后台管理-1 + */ +@Service +@Validated +public class DeviceConfigFlowServiceImpl implements DeviceConfigFlowService { + + @Resource + private DeviceConfigFlowMapper deviceConfigFlowMapper; + + @Override + public List getEnableList(DeviceConfigFlowPageReqVO pageReqVO) { + return deviceConfigFlowMapper.selectList(pageReqVO); + } + + @Override + public DeviceConfigFlowRespVO createDeviceConfigFlow(DeviceConfigFlowSaveReqVO createReqVO) { + // 插入 + DeviceConfigFlowDO deviceConfigFlow = BeanUtils.toBean(createReqVO, DeviceConfigFlowDO.class); + deviceConfigFlowMapper.insert(deviceConfigFlow); + // 返回 + return BeanUtils.toBean(deviceConfigFlow, DeviceConfigFlowRespVO.class); + } + + @Override + public void updateDeviceConfigFlow(DeviceConfigFlowSaveReqVO updateReqVO) { + // 校验存在 + validateDeviceConfigFlowExists(updateReqVO.getId()); + // 更新 + DeviceConfigFlowDO updateObj = BeanUtils.toBean(updateReqVO, DeviceConfigFlowDO.class); + deviceConfigFlowMapper.updateById(updateObj); + } + + @Override + public void deleteDeviceConfigFlow(Long id) { + // 校验存在 + validateDeviceConfigFlowExists(id); + // 删除 + deviceConfigFlowMapper.deleteById(id); + } + + @Override + public void deleteDeviceConfigFlowListByIds(List ids) { + // 校验存在 + validateDeviceConfigFlowExists(ids); + // 删除 + deviceConfigFlowMapper.deleteByIds(ids); + } + + private void validateDeviceConfigFlowExists(List ids) { + List list = deviceConfigFlowMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(DEVICE_CONFIG_FLOW_NOT_EXISTS); + } + } + + private void validateDeviceConfigFlowExists(Long id) { + if (deviceConfigFlowMapper.selectById(id) == null) { + throw exception(DEVICE_CONFIG_FLOW_NOT_EXISTS); + } + } + + @Override + public DeviceConfigFlowDO getDeviceConfigFlow(Long id) { + return deviceConfigFlowMapper.selectById(id); + } + + @Override + public PageResult getDeviceConfigFlowPage(DeviceConfigFlowPageReqVO pageReqVO) { + return deviceConfigFlowMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceInfomationService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceInfomationService.java index 5adbbf7..6a6eb70 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceInfomationService.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceInfomationService.java @@ -1,13 +1,17 @@ package com.zt.plat.module.qms.resource.device.service; +import com.alibaba.fastjson.JSONObject; +import com.zt.plat.framework.common.pojo.CommonResult; import com.zt.plat.framework.common.pojo.PageResult; import com.zt.plat.module.qms.resource.device.controller.vo.DeviceInfomationPageReqVO; import com.zt.plat.module.qms.resource.device.controller.vo.DeviceInfomationRespVO; import com.zt.plat.module.qms.resource.device.controller.vo.DeviceInfomationSaveReqVO; +import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceInfoWithBizConfigVO; import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceInfomationDO; import jakarta.validation.Valid; import java.util.List; +import java.util.Map; /** * 设备-设备信息 Service 接口 @@ -16,6 +20,39 @@ import java.util.List; */ public interface DeviceInfomationService { + CommonResult saveDevice(@Valid DeviceInfomationSaveReqVO reqVO); + + CommonResult checkDeviceUsable(Long id ); + + DeviceInfomationDO getByCode(String code); + + List getListByProductIdList(List productIds); + + List getIdListByProductIdList(List productIds); + + + //查询需要“某个业务类型”的设备列表 + List getListNeedByRule(JSONObject params); + + + // 更新设备的生命周期状态 + CommonResult updateLifeStatus(DeviceInfomationDO info, String bizType, Integer flag); + + //更新“使用中”状态 + void updateDeviceInUseFlag(Long deviceId, Integer inUseFlag); +// CommonResult updateDeviceRepairFlag(Long deviceId, Integer repairFlag); +// CommonResult updateDeviceDemoteFlag(Long deviceId, Integer demoteFlag); +// CommonResult updateDeviceScrapFlag(Long deviceId, Integer scrapFlag); +// CommonResult updateDeviceDisableFlag(Long deviceId, Integer disableFlag); +// CommonResult updateDeviceAcceptFlag(Long deviceId, String acceptFlag); +// CommonResult updateDeviceLendFlag(Long deviceId, Integer lendFlag); + + + + + + + /** * 创建设备-设备信息 * diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceInfomationServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceInfomationServiceImpl.java index eb8da8e..0d67841 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceInfomationServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceInfomationServiceImpl.java @@ -1,21 +1,38 @@ package com.zt.plat.module.qms.resource.device.service; import cn.hutool.core.collection.CollUtil; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.baomidou.mybatisplus.core.toolkit.support.SFunction; +import com.zt.plat.framework.common.pojo.CommonResult; import com.zt.plat.framework.common.pojo.PageResult; import com.zt.plat.framework.common.util.object.BeanUtils; +import com.zt.plat.module.qms.core.constant.DataTypeConstant; import com.zt.plat.module.qms.resource.device.controller.vo.DeviceInfomationPageReqVO; import com.zt.plat.module.qms.resource.device.controller.vo.DeviceInfomationRespVO; import com.zt.plat.module.qms.resource.device.controller.vo.DeviceInfomationSaveReqVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceProductRespVO; +import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceInfoWithBizConfigVO; import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceInfomationDO; +import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceProductDO; import com.zt.plat.module.qms.resource.device.dal.mapper.DeviceInfomationMapper; import jakarta.annotation.Resource; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.ObjectUtils; import org.springframework.validation.annotation.Validated; +import java.util.HashMap; import java.util.List; +import java.util.Map; import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception0; import static com.zt.plat.module.qms.enums.ErrorCodeConstants.DEVICE_INFOMATION_NOT_EXISTS; +import static com.zt.plat.module.qms.enums.ErrorCodeConstants.DEVICE_PRODUCT_NOT_EXISTS; /** @@ -27,8 +44,182 @@ import static com.zt.plat.module.qms.enums.ErrorCodeConstants.DEVICE_INFOMATION_ @Validated public class DeviceInfomationServiceImpl implements DeviceInfomationService { - @Resource - private DeviceInfomationMapper deviceInfomationMapper; + @Resource private DeviceInfomationMapper deviceInfomationMapper; + @Resource private DeviceProductService deviceProductService; + + @Override + @Transactional(rollbackFor = Exception.class) + public CommonResult saveDevice(DeviceInfomationSaveReqVO reqVO) { + Long productId = reqVO.getProductId(); + String deviceCode = reqVO.getDeviceCode(); + if(productId == null) + throw exception0(DEVICE_INFOMATION_NOT_EXISTS.getCode(), "请选择所属设备大类!"); + DeviceProductDO productDO = deviceProductService.getDeviceProduct(productId); + if(productDO == null) + throw exception(DEVICE_PRODUCT_NOT_EXISTS); + if(!DataTypeConstant.DATA_TYPE_DATA.equals(productDO.getNodeType())) + throw exception0(DEVICE_INFOMATION_NOT_EXISTS.getCode(), "您选择的是“分类”,请选择“产品”!"); + DeviceInfomationDO checkData = getByCode(deviceCode); + if(reqVO.getId() == null){ + if(checkData != null && !checkData.getId().equals(reqVO.getId())) + throw exception0(DEVICE_INFOMATION_NOT_EXISTS.getCode(), "管理编号已存在,请重新填写!"); + DeviceInfomationRespVO respVO = this.createDeviceInfomation(reqVO); + return CommonResult.success(respVO); + } + if(checkData != null) + throw exception0(DEVICE_INFOMATION_NOT_EXISTS.getCode(), "管理编号已存在,请重新填写!"); + reqVO.setDeviceParameter(productDO.getParameter()); + this.updateDeviceInfomation(reqVO); + return CommonResult.success(BeanUtils.toBean(reqVO, DeviceInfomationRespVO.class)); + } + + @Override + public CommonResult checkDeviceUsable(Long id) { + DeviceInfomationDO deviceDO = this.getDeviceInfomation(id); + if(ObjectUtils.isEmpty(deviceDO)) + return CommonResult.error(DEVICE_INFOMATION_NOT_EXISTS.getCode(), "设备不存在,请刷新后重试!"); + if("1".equals(deviceDO.getDisableFlag())) + return CommonResult.error(DEVICE_INFOMATION_NOT_EXISTS.getCode(), "设备已停用!"); + if("1".equals(deviceDO.getScrapFlag())) + return CommonResult.error(DEVICE_INFOMATION_NOT_EXISTS.getCode(), "设备已报废!"); + if("1".equals(deviceDO.getLendFlag())) + return CommonResult.error(DEVICE_INFOMATION_NOT_EXISTS.getCode(), "设备已外借!"); + if("1".equals(deviceDO.getRepairFlag())) + return CommonResult.error( DEVICE_INFOMATION_NOT_EXISTS.getCode(), "设备在维修中"); + return CommonResult.success( true); + } + /*查询需要“某个业务类型”的设备列表*/ + @Override + public List getListNeedByRule(JSONObject params) { + return deviceInfomationMapper.getListNeedByRule(params); + } + + /* + * 更新设备生命周期状态 + * 传入设备实体、业务类型(停用、外借、维修、降级等)、状态(1-是,其他-否) + * */ + @Override + @Transactional(rollbackFor = Exception.class) + public CommonResult updateLifeStatus(DeviceInfomationDO info, String bizType, Integer flag) { + String stateStack = info.getStateStack(); + JSONArray arr = new JSONArray(); + if(!ObjectUtils.isEmpty(stateStack)) + arr = JSON.parseArray(stateStack); + String state = "-1"; + Map stateMap = new HashMap<>(); + SFunction tableField = null; + stateMap.put("repair", "维修"); + stateMap.put("demote", "降级"); + stateMap.put("scrap", "报废"); + stateMap.put("disable", "停用"); + stateMap.put("lend", "外借"); + if(bizType.equals("repair")){ + state = info.getRepairFlag(); + tableField = DeviceInfomationDO::getRepairFlag; + } + if(bizType.equals("demote")){ + state = info.getDemoteFlag(); + tableField = DeviceInfomationDO::getDemoteFlag; + } + if(bizType.equals("scrap")){ + state = info.getScrapFlag(); + tableField = DeviceInfomationDO::getScrapFlag; + } + if(bizType.equals("disable")){ + state = info.getDisableFlag(); + tableField = DeviceInfomationDO::getDisableFlag; + } + if(bizType.equals("lend")){ + state = info.getLendFlag(); + tableField = DeviceInfomationDO::getLendFlag; + } + if("-1".equals( state)) + return CommonResult.error(DEVICE_INFOMATION_NOT_EXISTS.getCode(), "请传入正确的业务类型!"); + //未传入状态,则切换状态 + if(flag == null){ + state = "1".equals(state) ? "0" : "1"; + }else{ + state = flag.equals(1) ? "1" : "0"; + } + + JSONObject json = null; + int index = -1; + boolean itemFindFlag = false; + for(int i = 0; i < arr.size(); i++){ + index = i; + JSONObject item = arr.getJSONObject(i); + if(item.getString("bizType").equals(bizType)){ + json = item; + itemFindFlag = true; + break; + } + } + //如果栈里不存在记录 + if(json == null){ + //状态为正常,不做处理 + if(!"0".equals(state)){ + //插入记录 + json = new JSONObject(); + json.put("bizType", bizType); + json.put("state", state); + arr.add(0, json); + } + }else{ + //存在记录,移至最前端 + if(itemFindFlag) + arr.remove(index); + if("1".equals(state)) + arr.add(0, json); + } + info.setStateStack(arr.toJSONString()); + if(arr.isEmpty()){ + info.setStateShow("正常"); + }else{ + JSONObject first = arr.getJSONObject(0); + String firstBiz = first.getString("bizType"); + info.setStateShow(stateMap.get(firstBiz)); + } + //更新数据 + LambdaUpdateWrapper updateWrapper = new LambdaUpdateWrapper<>(); + updateWrapper.eq(DeviceInfomationDO::getId, info.getId()); + updateWrapper.set(tableField, state); + updateWrapper.set(DeviceInfomationDO::getStateShow, info.getStateShow()); + updateWrapper.set(DeviceInfomationDO::getStateStack, info.getStateStack()); + deviceInfomationMapper.update(updateWrapper); + return CommonResult.success(info); + } + + /* + * 更新“使用中”状态*/ + @Override + @Transactional(rollbackFor = Exception.class) + public void updateDeviceInUseFlag(Long deviceId, Integer inUseFlag) { + String state = (1 == inUseFlag) ? "1" : "0"; + LambdaUpdateWrapper updateWrapper = new LambdaUpdateWrapper<>(); + updateWrapper.eq(DeviceInfomationDO::getId, deviceId); + updateWrapper.set(DeviceInfomationDO::getInUseFlag, state); + deviceInfomationMapper.update(updateWrapper); + } + + @Override + public DeviceInfomationDO getByCode(String code) { + LambdaQueryWrapper query = new LambdaQueryWrapper<>(); + query.eq(DeviceInfomationDO::getDeviceCode, code); + return deviceInfomationMapper.selectOne(query); + } + + @Override + public List getListByProductIdList(List productIds) { + LambdaQueryWrapper query = new LambdaQueryWrapper<>(); + query.in(DeviceInfomationDO::getProductId, productIds); + return deviceInfomationMapper.selectList(query); + } + + @Override + public List getIdListByProductIdList(List productIds) { + List list = getListByProductIdList(productIds); + return list.stream().map(DeviceInfomationDO::getId).toList(); + } @Override public DeviceInfomationRespVO createDeviceInfomation(DeviceInfomationSaveReqVO createReqVO) { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceMaintainItemService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceMaintainItemService.java new file mode 100644 index 0000000..aed5fa4 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceMaintainItemService.java @@ -0,0 +1,72 @@ +package com.zt.plat.module.qms.resource.device.service; + +import java.util.*; + +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceMaintainItemPageReqVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceMaintainItemRespVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceMaintainItemSaveReqVO; +import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceMaintainDO; +import jakarta.validation.*; +import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceMaintainItemDO; +import com.zt.plat.framework.common.pojo.PageResult; + +/** + * 设备-保养分项 Service 接口 + * + * @author 后台管理-1 + */ +public interface DeviceMaintainItemService { + + void updateBatch(List list); + + CommonResult createItems(DeviceMaintainDO maintain, Long ruleId); + + List getListByParId(Long maintainId); + + /** + * 创建设备-保养分项 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + DeviceMaintainItemRespVO createDeviceMaintainItem(@Valid DeviceMaintainItemSaveReqVO createReqVO); + + /** + * 更新设备-保养分项 + * + * @param updateReqVO 更新信息 + */ + void updateDeviceMaintainItem(@Valid DeviceMaintainItemSaveReqVO updateReqVO); + + /** + * 删除设备-保养分项 + * + * @param id 编号 + */ + void deleteDeviceMaintainItem(Long id); + + /** + * 批量删除设备-保养分项 + * + * @param ids 编号 + */ + void deleteDeviceMaintainItemListByIds(List ids); + + /** + * 获得设备-保养分项 + * + * @param id 编号 + * @return 设备-保养分项 + */ + DeviceMaintainItemDO getDeviceMaintainItem(Long id); + + /** + * 获得设备-保养分项分页 + * + * @param pageReqVO 分页查询 + * @return 设备-保养分项分页 + */ + PageResult getDeviceMaintainItemPage(DeviceMaintainItemPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceMaintainItemServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceMaintainItemServiceImpl.java new file mode 100644 index 0000000..cbea1a8 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceMaintainItemServiceImpl.java @@ -0,0 +1,147 @@ +package com.zt.plat.module.qms.resource.device.service; + +import cn.hutool.core.collection.CollUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceMaintainItemPageReqVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceMaintainItemRespVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceMaintainItemSaveReqVO; +import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceConfigBusinessItemDO; +import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceMaintainDO; +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 java.util.stream.Collectors; + +import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceMaintainItemDO; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.util.object.BeanUtils; + +import com.zt.plat.module.qms.resource.device.dal.mapper.DeviceMaintainItemMapper; + +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.DEVICE_CONFIG_BUSINESS_ITEM_NOT_EXISTS; +import static com.zt.plat.module.qms.enums.ErrorCodeConstants.DEVICE_MAINTAIN_ITEM_NOT_EXISTS; + +/** + * 设备-保养分项 Service 实现类 + * + * @author 后台管理-1 + */ +@Service +@Validated +public class DeviceMaintainItemServiceImpl implements DeviceMaintainItemService { + + @Resource private DeviceMaintainItemMapper deviceMaintainItemMapper; + @Resource private DeviceConfigBusinessItemService deviceConfigBusinessItemService;; + + @Override + public void updateBatch(List list) { + deviceMaintainItemMapper.updateBatch(list); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public CommonResult createItems(DeviceMaintainDO maintain, Long ruleId) { + List itemList = deviceConfigBusinessItemService.listByRuleId(ruleId); //配置的所有明细项 + List itemIdList = itemList.stream().map(DeviceConfigBusinessItemDO::getId).toList(); + if(itemIdList.isEmpty()) + return CommonResult.error(DEVICE_CONFIG_BUSINESS_ITEM_NOT_EXISTS.getCode(), "没有配置检查项,请联系管理员处理!"); + //查询各明细项的最新数据 +// List lastDataList = queryLastestData(itemIdList, maintain.getDeviceId()); + + //循环检查当前维护 + List insertList = new ArrayList<>(); + for(DeviceConfigBusinessItemDO library : itemList){ +// if(!checkItemNeeded(maintain, library, lastDataList)) +// continue; + DeviceMaintainItemDO item = new DeviceMaintainItemDO(); + item.setParentId(maintain.getId()); + item.setFrequencyTimeStart(maintain.getFrequencyTimeStart()); + item.setFrequencyTimeEnd(maintain.getFrequencyTimeEnd()); + item.setCheckItemId(library.getId()); + item.setItemKey(library.getItemKey()); + item.setItemName(library.getItemName()); + item.setFrequencyType(library.getFrequencyType()); + item.setFrequency(library.getFrequency()); + item.setStandard(library.getStandard()); + item.setItemMethod(library.getItemMethod()); + item.setFrequencyRemark(library.getFrequencyRemark()); + item.setSortNo(library.getOrderNo()); + insertList.add(item); + } + if(!insertList.isEmpty()) + deviceMaintainItemMapper.insertBatch(insertList); + return CommonResult.success(""); + } + + @Override + public List getListByParId(Long maintainId) { + LambdaQueryWrapper query = new LambdaQueryWrapper<>(); + query.eq(DeviceMaintainItemDO::getParentId, maintainId); + query.orderByAsc(DeviceMaintainItemDO::getSortNo); + return deviceMaintainItemMapper.selectList(query); + } + + @Override + public DeviceMaintainItemRespVO createDeviceMaintainItem(DeviceMaintainItemSaveReqVO createReqVO) { + // 插入 + DeviceMaintainItemDO deviceMaintainItem = BeanUtils.toBean(createReqVO, DeviceMaintainItemDO.class); + deviceMaintainItemMapper.insert(deviceMaintainItem); + // 返回 + return BeanUtils.toBean(deviceMaintainItem, DeviceMaintainItemRespVO.class); + } + + @Override + public void updateDeviceMaintainItem(DeviceMaintainItemSaveReqVO updateReqVO) { + // 校验存在 + validateDeviceMaintainItemExists(updateReqVO.getId()); + // 更新 + DeviceMaintainItemDO updateObj = BeanUtils.toBean(updateReqVO, DeviceMaintainItemDO.class); + deviceMaintainItemMapper.updateById(updateObj); + } + + @Override + public void deleteDeviceMaintainItem(Long id) { + // 校验存在 + validateDeviceMaintainItemExists(id); + // 删除 + deviceMaintainItemMapper.deleteById(id); + } + + @Override + public void deleteDeviceMaintainItemListByIds(List ids) { + // 校验存在 + validateDeviceMaintainItemExists(ids); + // 删除 + deviceMaintainItemMapper.deleteByIds(ids); + } + + private void validateDeviceMaintainItemExists(List ids) { + List list = deviceMaintainItemMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(DEVICE_MAINTAIN_ITEM_NOT_EXISTS); + } + } + + private void validateDeviceMaintainItemExists(Long id) { + if (deviceMaintainItemMapper.selectById(id) == null) { + throw exception(DEVICE_MAINTAIN_ITEM_NOT_EXISTS); + } + } + + @Override + public DeviceMaintainItemDO getDeviceMaintainItem(Long id) { + return deviceMaintainItemMapper.selectById(id); + } + + @Override + public PageResult getDeviceMaintainItemPage(DeviceMaintainItemPageReqVO pageReqVO) { + return deviceMaintainItemMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceMaintainService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceMaintainService.java new file mode 100644 index 0000000..3e23485 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceMaintainService.java @@ -0,0 +1,81 @@ +package com.zt.plat.module.qms.resource.device.service; + +import java.text.ParseException; +import java.time.LocalDate; +import java.util.*; + +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceMaintainPageReqVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceMaintainRespVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceMaintainSaveReqVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceMaintainVO; +import jakarta.validation.*; +import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceMaintainDO; +import com.zt.plat.framework.common.pojo.PageResult; + +/** + * 设备-点检、保养记录 Service 接口 + * + * @author 后台管理-1 + */ +public interface DeviceMaintainService { + + CommonResult saveMaintainVo(DeviceMaintainVO vo); + + CommonResult createOrGet(Long deviceId, String date, String dataType); + + CommonResult create(Long deviceId, LocalDate lastDate, String dataType); + + PageResult queryPageListWithCount(DeviceMaintainPageReqVO pageReqVO); + + CommonResult getMaintainDetail(Long id); + + CommonResult getLastData(Long deviceId, String dataType, String date); + + + /** + * 创建设备-点检、保养记录 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + DeviceMaintainRespVO createDeviceMaintain(@Valid DeviceMaintainSaveReqVO createReqVO); + + /** + * 更新设备-点检、保养记录 + * + * @param updateReqVO 更新信息 + */ + void updateDeviceMaintain(@Valid DeviceMaintainSaveReqVO updateReqVO); + + /** + * 删除设备-点检、保养记录 + * + * @param id 编号 + */ + void deleteDeviceMaintain(Long id); + + /** + * 批量删除设备-点检、保养记录 + * + * @param ids 编号 + */ + void deleteDeviceMaintainListByIds(List ids); + + /** + * 获得设备-点检、保养记录 + * + * @param id 编号 + * @return 设备-点检、保养记录 + */ + DeviceMaintainDO getDeviceMaintain(Long id); + + /** + * 获得设备-点检、保养记录分页 + * + * @param pageReqVO 分页查询 + * @return 设备-点检、保养记录分页 + */ + PageResult getDeviceMaintainPage(DeviceMaintainPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceMaintainServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceMaintainServiceImpl.java new file mode 100644 index 0000000..3941dcc --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceMaintainServiceImpl.java @@ -0,0 +1,231 @@ +package com.zt.plat.module.qms.resource.device.service; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.collection.CollUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.framework.security.core.LoginUser; +import com.zt.plat.framework.security.core.util.SecurityFrameworkUtils; +import com.zt.plat.module.qms.resource.device.common.DeviceUtil; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceMaintainPageReqVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceMaintainRespVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceMaintainSaveReqVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceMaintainVO; +import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceConfigBusinessRuleDO; +import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceMaintainItemDO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import jakarta.annotation.Resource; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.ObjectUtils; +import org.springframework.validation.annotation.Validated; + +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; +import java.util.*; + +import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceMaintainDO; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.util.object.BeanUtils; + +import com.zt.plat.module.qms.resource.device.dal.mapper.DeviceMaintainMapper; + +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.DEVICE_MAINTAIN_NOT_EXISTS; + +/** + * 设备-点检、保养记录 Service 实现类 + * + * @author 后台管理-1 + */ +@Service +@Validated +public class DeviceMaintainServiceImpl implements DeviceMaintainService { + + @Resource private DeviceMaintainMapper deviceMaintainMapper; + @Resource private DeviceMaintainItemService deviceMaintainItemService; + @Resource private DeviceProductService deviceProductService; + @Resource private DeviceInfomationService deviceInfomationService; + @Autowired private DeviceConfigBusinessRuleService deviceConfigBusinessRuleService; + + @Override + @Transactional(rollbackFor = Exception.class) + public CommonResult saveMaintainVo(DeviceMaintainVO vo) { + DeviceMaintainDO data = new DeviceMaintainDO(); + BeanUtil.copyProperties(vo, data); + deviceMaintainMapper.updateById(data); + List maintainItemList = vo.getMaintainItemList(); + deviceMaintainItemService.updateBatch(maintainItemList); + return CommonResult.success(true); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public CommonResult createOrGet(Long deviceId, String date, String dataType){ + LocalDateTime curDate = LocalDateTime.now(); + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); + if(!ObjectUtils.isEmpty(date)) + curDate = LocalDateTime.parse( date + " 00:00:00", formatter); + String dateStr = curDate.toLocalDate().toString(); + //查询上一个点检记录 + DeviceMaintainDO lastData = getLastData(deviceId, dataType, dateStr).getData(); + if(lastData != null && (lastData.getFrequencyTimeStart() == null || lastData.getFrequencyTimeEnd() == null)) + return getMaintainDetail(lastData.getId()); + if(lastData != null && curDate.compareTo(lastData.getFrequencyTimeStart()) >=0 && curDate.compareTo(lastData.getFrequencyTimeEnd()) <=0 ){ + return getMaintainDetail(lastData.getId()); + } + LocalDate lastDate = null; + if(lastData != null) + lastDate = lastData.getFrequencyTimeEnd().toLocalDate(); + + //比较lastDate与curDate + if(lastDate != null ){ + if(lastDate.isBefore(curDate.toLocalDate())) + lastDate = curDate.toLocalDate(); + } + return create(deviceId, lastDate, dataType); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public CommonResult create(Long deviceId, LocalDate lastDate, String dataType) { + //当前登录人 + LoginUser loginUser = SecurityFrameworkUtils.getLoginUser(); + //当前登录用户昵称 + String nickName = SecurityFrameworkUtils.getLoginUserNickname(); + //获取配置 + CommonResult ruleRet = deviceConfigBusinessRuleService.getRuleByDeviceIdAndType(deviceId, dataType); + if(!ruleRet.isSuccess()) + return CommonResult.error(ruleRet.getCode(), ruleRet.getMsg()); + DeviceConfigBusinessRuleDO rule = ruleRet.getData(); + //根据周期判断当前日期是否存在数据 + LocalDateTime[] dateRange = null; + if(lastDate != null){ + dateRange = DeviceUtil.getDateRangeByFrequency(lastDate, false, rule.getFrequencyType(), rule.getFrequency()); + } + DeviceMaintainDO data = new DeviceMaintainDO(); + data.setDeviceId(deviceId); + data.setDataType(dataType); + data.setCheckDate(LocalDateTime.now()); + data.setRuleId(rule.getId()); + data.setCheckUserId(loginUser.getId()); + data.setCheckUserName(nickName); + data.setFrequencyType(rule.getFrequencyType()); + data.setFrequency(rule.getFrequency()); + data.setFrequencyRemark(rule.getFrequencyRemark()); + if(dateRange != null){ + data.setFrequencyTimeStart(dateRange[0]); + data.setFrequencyTimeEnd(dateRange[1]); + } + deviceMaintainMapper.insert(data); + + //创建明细项 + deviceMaintainItemService.createItems(data, rule.getId()); + + return getMaintainDetail(data.getId()); + } + + @Override + public CommonResult getMaintainDetail(Long id) { + DeviceMaintainVO vo = deviceMaintainMapper.queryVoById( id); + if(vo == null) + throw exception(DEVICE_MAINTAIN_NOT_EXISTS); + List itemList = deviceMaintainItemService.getListByParId( id); + vo.setMaintainItemList(itemList); + return CommonResult.success( vo); + } + + @Override + public CommonResult getLastData(Long deviceId, String dataType, String date) { + LambdaQueryWrapper query = new LambdaQueryWrapper<>(); + query.eq(DeviceMaintainDO::getDeviceId, deviceId); + query.eq(DeviceMaintainDO::getDataType, dataType); + if(!ObjectUtils.isEmpty(date)){ + query.ge(DeviceMaintainDO::getCheckDate, date); + query.le(DeviceMaintainDO::getCheckDate, date + " 23:59:59"); + } + query.orderByDesc(DeviceMaintainDO::getCheckDate); + query.last("limit 1"); + DeviceMaintainDO maintainDO = deviceMaintainMapper.selectOne(query); + return CommonResult.success(maintainDO); + } + + @Override + public PageResult queryPageListWithCount(DeviceMaintainPageReqVO reqVO) { + Long productId = reqVO.getProductId(); + if(productId != null){ + List productIds = deviceProductService.getIdListByIdPath(productId); + List deviceIds = deviceInfomationService.getIdListByProductIdList(productIds); + if(!deviceIds.isEmpty()){ + reqVO.setProductId(null); + reqVO.setDeviceIdList(deviceIds); + } + } + Page page = new Page<>(reqVO.getPageNo(), reqVO.getPageSize()); + + IPage pageList = deviceMaintainMapper.queryPageListWithCount(page, reqVO); + return new PageResult<>(pageList.getRecords(), pageList.getTotal()); + } + + @Override + public DeviceMaintainRespVO createDeviceMaintain(DeviceMaintainSaveReqVO createReqVO) { + // 插入 + DeviceMaintainDO deviceMaintain = BeanUtils.toBean(createReqVO, DeviceMaintainDO.class); + deviceMaintainMapper.insert(deviceMaintain); + // 返回 + return BeanUtils.toBean(deviceMaintain, DeviceMaintainRespVO.class); + } + + @Override + public void updateDeviceMaintain(DeviceMaintainSaveReqVO updateReqVO) { + // 校验存在 + validateDeviceMaintainExists(updateReqVO.getId()); + // 更新 + DeviceMaintainDO updateObj = BeanUtils.toBean(updateReqVO, DeviceMaintainDO.class); + deviceMaintainMapper.updateById(updateObj); + } + + @Override + public void deleteDeviceMaintain(Long id) { + // 校验存在 + validateDeviceMaintainExists(id); + // 删除 + deviceMaintainMapper.deleteById(id); + } + + @Override + public void deleteDeviceMaintainListByIds(List ids) { + // 校验存在 + validateDeviceMaintainExists(ids); + // 删除 + deviceMaintainMapper.deleteByIds(ids); + } + + private void validateDeviceMaintainExists(List ids) { + List list = deviceMaintainMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(DEVICE_MAINTAIN_NOT_EXISTS); + } + } + + private void validateDeviceMaintainExists(Long id) { + if (deviceMaintainMapper.selectById(id) == null) { + throw exception(DEVICE_MAINTAIN_NOT_EXISTS); + } + } + + @Override + public DeviceMaintainDO getDeviceMaintain(Long id) { + return deviceMaintainMapper.selectById(id); + } + + @Override + public PageResult getDeviceMaintainPage(DeviceMaintainPageReqVO pageReqVO) { + return deviceMaintainMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DevicePeriodCheckPlanService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DevicePeriodCheckPlanService.java new file mode 100644 index 0000000..fc649c7 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DevicePeriodCheckPlanService.java @@ -0,0 +1,64 @@ +package com.zt.plat.module.qms.resource.device.service; + +import java.util.*; + +import com.zt.plat.module.qms.resource.device.controller.vo.DevicePeriodCheckPlanPageReqVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DevicePeriodCheckPlanRespVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DevicePeriodCheckPlanSaveReqVO; +import jakarta.validation.*; +import com.zt.plat.module.qms.resource.device.dal.dataobject.DevicePeriodCheckPlanDO; +import com.zt.plat.framework.common.pojo.PageResult; + +/** + * 设备-期间核查计划 Service 接口 + * + * @author 后台管理-1 + */ +public interface DevicePeriodCheckPlanService { + + /** + * 创建设备-期间核查计划 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + DevicePeriodCheckPlanRespVO createDevicePeriodCheckPlan(@Valid DevicePeriodCheckPlanSaveReqVO createReqVO); + + /** + * 更新设备-期间核查计划 + * + * @param updateReqVO 更新信息 + */ + void updateDevicePeriodCheckPlan(@Valid DevicePeriodCheckPlanSaveReqVO updateReqVO); + + /** + * 删除设备-期间核查计划 + * + * @param id 编号 + */ + void deleteDevicePeriodCheckPlan(Long id); + + /** + * 批量删除设备-期间核查计划 + * + * @param ids 编号 + */ + void deleteDevicePeriodCheckPlanListByIds(List ids); + + /** + * 获得设备-期间核查计划 + * + * @param id 编号 + * @return 设备-期间核查计划 + */ + DevicePeriodCheckPlanDO getDevicePeriodCheckPlan(Long id); + + /** + * 获得设备-期间核查计划分页 + * + * @param pageReqVO 分页查询 + * @return 设备-期间核查计划分页 + */ + PageResult getDevicePeriodCheckPlanPage(DevicePeriodCheckPlanPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DevicePeriodCheckPlanServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DevicePeriodCheckPlanServiceImpl.java new file mode 100644 index 0000000..d950cad --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DevicePeriodCheckPlanServiceImpl.java @@ -0,0 +1,92 @@ +package com.zt.plat.module.qms.resource.device.service; + +import cn.hutool.core.collection.CollUtil; +import com.zt.plat.module.qms.resource.device.controller.vo.DevicePeriodCheckPlanPageReqVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DevicePeriodCheckPlanRespVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DevicePeriodCheckPlanSaveReqVO; +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.device.dal.dataobject.DevicePeriodCheckPlanDO; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.util.object.BeanUtils; + +import com.zt.plat.module.qms.resource.device.dal.mapper.DevicePeriodCheckPlanMapper; + +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.DEVICE_PERIOD_CHECK_PLAN_NOT_EXISTS; + +/** + * 设备-期间核查计划 Service 实现类 + * + * @author 后台管理-1 + */ +@Service +@Validated +public class DevicePeriodCheckPlanServiceImpl implements DevicePeriodCheckPlanService { + + @Resource + private DevicePeriodCheckPlanMapper devicePeriodCheckPlanMapper; + + @Override + public DevicePeriodCheckPlanRespVO createDevicePeriodCheckPlan(DevicePeriodCheckPlanSaveReqVO createReqVO) { + // 插入 + DevicePeriodCheckPlanDO devicePeriodCheckPlan = BeanUtils.toBean(createReqVO, DevicePeriodCheckPlanDO.class); + devicePeriodCheckPlanMapper.insert(devicePeriodCheckPlan); + // 返回 + return BeanUtils.toBean(devicePeriodCheckPlan, DevicePeriodCheckPlanRespVO.class); + } + + @Override + public void updateDevicePeriodCheckPlan(DevicePeriodCheckPlanSaveReqVO updateReqVO) { + // 校验存在 + validateDevicePeriodCheckPlanExists(updateReqVO.getId()); + // 更新 + DevicePeriodCheckPlanDO updateObj = BeanUtils.toBean(updateReqVO, DevicePeriodCheckPlanDO.class); + devicePeriodCheckPlanMapper.updateById(updateObj); + } + + @Override + public void deleteDevicePeriodCheckPlan(Long id) { + // 校验存在 + validateDevicePeriodCheckPlanExists(id); + // 删除 + devicePeriodCheckPlanMapper.deleteById(id); + } + + @Override + public void deleteDevicePeriodCheckPlanListByIds(List ids) { + // 校验存在 + validateDevicePeriodCheckPlanExists(ids); + // 删除 + devicePeriodCheckPlanMapper.deleteByIds(ids); + } + + private void validateDevicePeriodCheckPlanExists(List ids) { + List list = devicePeriodCheckPlanMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(DEVICE_PERIOD_CHECK_PLAN_NOT_EXISTS); + } + } + + private void validateDevicePeriodCheckPlanExists(Long id) { + if (devicePeriodCheckPlanMapper.selectById(id) == null) { + throw exception(DEVICE_PERIOD_CHECK_PLAN_NOT_EXISTS); + } + } + + @Override + public DevicePeriodCheckPlanDO getDevicePeriodCheckPlan(Long id) { + return devicePeriodCheckPlanMapper.selectById(id); + } + + @Override + public PageResult getDevicePeriodCheckPlanPage(DevicePeriodCheckPlanPageReqVO pageReqVO) { + return devicePeriodCheckPlanMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DevicePeriodCheckService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DevicePeriodCheckService.java new file mode 100644 index 0000000..fe65d35 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DevicePeriodCheckService.java @@ -0,0 +1,64 @@ +package com.zt.plat.module.qms.resource.device.service; + +import java.util.*; + +import com.zt.plat.module.qms.resource.device.controller.vo.DevicePeriodCheckPageReqVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DevicePeriodCheckRespVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DevicePeriodCheckSaveReqVO; +import jakarta.validation.*; +import com.zt.plat.module.qms.resource.device.dal.dataobject.DevicePeriodCheckDO; +import com.zt.plat.framework.common.pojo.PageResult; + +/** + * 设备-期间核查 Service 接口 + * + * @author 后台管理-1 + */ +public interface DevicePeriodCheckService { + + /** + * 创建设备-期间核查 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + DevicePeriodCheckRespVO createDevicePeriodCheck(@Valid DevicePeriodCheckSaveReqVO createReqVO); + + /** + * 更新设备-期间核查 + * + * @param updateReqVO 更新信息 + */ + void updateDevicePeriodCheck(@Valid DevicePeriodCheckSaveReqVO updateReqVO); + + /** + * 删除设备-期间核查 + * + * @param id 编号 + */ + void deleteDevicePeriodCheck(Long id); + + /** + * 批量删除设备-期间核查 + * + * @param ids 编号 + */ + void deleteDevicePeriodCheckListByIds(List ids); + + /** + * 获得设备-期间核查 + * + * @param id 编号 + * @return 设备-期间核查 + */ + DevicePeriodCheckDO getDevicePeriodCheck(Long id); + + /** + * 获得设备-期间核查分页 + * + * @param pageReqVO 分页查询 + * @return 设备-期间核查分页 + */ + PageResult getDevicePeriodCheckPage(DevicePeriodCheckPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DevicePeriodCheckServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DevicePeriodCheckServiceImpl.java new file mode 100644 index 0000000..e746d8a --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DevicePeriodCheckServiceImpl.java @@ -0,0 +1,92 @@ +package com.zt.plat.module.qms.resource.device.service; + +import cn.hutool.core.collection.CollUtil; +import com.zt.plat.module.qms.resource.device.controller.vo.DevicePeriodCheckPageReqVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DevicePeriodCheckRespVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DevicePeriodCheckSaveReqVO; +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.device.dal.dataobject.DevicePeriodCheckDO; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.util.object.BeanUtils; + +import com.zt.plat.module.qms.resource.device.dal.mapper.DevicePeriodCheckMapper; + +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.DEVICE_PERIOD_CHECK_NOT_EXISTS; + +/** + * 设备-期间核查 Service 实现类 + * + * @author 后台管理-1 + */ +@Service +@Validated +public class DevicePeriodCheckServiceImpl implements DevicePeriodCheckService { + + @Resource + private DevicePeriodCheckMapper devicePeriodCheckMapper; + + @Override + public DevicePeriodCheckRespVO createDevicePeriodCheck(DevicePeriodCheckSaveReqVO createReqVO) { + // 插入 + DevicePeriodCheckDO devicePeriodCheck = BeanUtils.toBean(createReqVO, DevicePeriodCheckDO.class); + devicePeriodCheckMapper.insert(devicePeriodCheck); + // 返回 + return BeanUtils.toBean(devicePeriodCheck, DevicePeriodCheckRespVO.class); + } + + @Override + public void updateDevicePeriodCheck(DevicePeriodCheckSaveReqVO updateReqVO) { + // 校验存在 + validateDevicePeriodCheckExists(updateReqVO.getId()); + // 更新 + DevicePeriodCheckDO updateObj = BeanUtils.toBean(updateReqVO, DevicePeriodCheckDO.class); + devicePeriodCheckMapper.updateById(updateObj); + } + + @Override + public void deleteDevicePeriodCheck(Long id) { + // 校验存在 + validateDevicePeriodCheckExists(id); + // 删除 + devicePeriodCheckMapper.deleteById(id); + } + + @Override + public void deleteDevicePeriodCheckListByIds(List ids) { + // 校验存在 + validateDevicePeriodCheckExists(ids); + // 删除 + devicePeriodCheckMapper.deleteByIds(ids); + } + + private void validateDevicePeriodCheckExists(List ids) { + List list = devicePeriodCheckMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(DEVICE_PERIOD_CHECK_NOT_EXISTS); + } + } + + private void validateDevicePeriodCheckExists(Long id) { + if (devicePeriodCheckMapper.selectById(id) == null) { + throw exception(DEVICE_PERIOD_CHECK_NOT_EXISTS); + } + } + + @Override + public DevicePeriodCheckDO getDevicePeriodCheck(Long id) { + return devicePeriodCheckMapper.selectById(id); + } + + @Override + public PageResult getDevicePeriodCheckPage(DevicePeriodCheckPageReqVO pageReqVO) { + return devicePeriodCheckMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceProductService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceProductService.java index 6f716b5..3ecffd2 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceProductService.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceProductService.java @@ -26,6 +26,7 @@ public interface DeviceProductService { /*获取分类树数据*/ List getTreeData(String nodeType); + List getIdListByIdPath(Long id); List listByIdPath(Long id, String nodeType); List listByParId(Long parId, String nodeType); diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceProductServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceProductServiceImpl.java index 01d5dbe..cbb6a77 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceProductServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceProductServiceImpl.java @@ -98,6 +98,13 @@ public class DeviceProductServiceImpl implements DeviceProductService { return CommonResult.success( vo); } + @Override + public List getIdListByIdPath(Long id) { + List productDOList = this.listByIdPath(id, DataTypeConstant.DATA_TYPE_DATA); + List productIds = productDOList.stream().map(DeviceProductDO::getId).toList(); + return productIds; + } + @Override public List listByIdPath(Long id, String nodeType) { LambdaQueryWrapper query = new LambdaQueryWrapper<>(); diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceRepairApplyService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceRepairApplyService.java new file mode 100644 index 0000000..7368180 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceRepairApplyService.java @@ -0,0 +1,64 @@ +package com.zt.plat.module.qms.resource.device.service; + +import java.util.*; + +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceRepairApplyPageReqVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceRepairApplyRespVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceRepairApplySaveReqVO; +import jakarta.validation.*; +import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceRepairApplyDO; +import com.zt.plat.framework.common.pojo.PageResult; + +/** + * 维修申请 Service 接口 + * + * @author 后台管理-1 + */ +public interface DeviceRepairApplyService { + + /** + * 创建维修申请 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + DeviceRepairApplyRespVO createDeviceRepairApply(@Valid DeviceRepairApplySaveReqVO createReqVO); + + /** + * 更新维修申请 + * + * @param updateReqVO 更新信息 + */ + void updateDeviceRepairApply(@Valid DeviceRepairApplySaveReqVO updateReqVO); + + /** + * 删除维修申请 + * + * @param id 编号 + */ + void deleteDeviceRepairApply(Long id); + + /** + * 批量删除维修申请 + * + * @param ids 编号 + */ + void deleteDeviceRepairApplyListByIds(List ids); + + /** + * 获得维修申请 + * + * @param id 编号 + * @return 维修申请 + */ + DeviceRepairApplyDO getDeviceRepairApply(Long id); + + /** + * 获得维修申请分页 + * + * @param pageReqVO 分页查询 + * @return 维修申请分页 + */ + PageResult getDeviceRepairApplyPage(DeviceRepairApplyPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceRepairApplyServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceRepairApplyServiceImpl.java new file mode 100644 index 0000000..d1fc79e --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceRepairApplyServiceImpl.java @@ -0,0 +1,92 @@ +package com.zt.plat.module.qms.resource.device.service; + +import cn.hutool.core.collection.CollUtil; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceRepairApplyPageReqVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceRepairApplyRespVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceRepairApplySaveReqVO; +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.device.dal.dataobject.DeviceRepairApplyDO; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.util.object.BeanUtils; + +import com.zt.plat.module.qms.resource.device.dal.mapper.DeviceRepairApplyMapper; + +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.DEVICE_REPAIR_APPLY_NOT_EXISTS; + +/** + * 维修申请 Service 实现类 + * + * @author 后台管理-1 + */ +@Service +@Validated +public class DeviceRepairApplyServiceImpl implements DeviceRepairApplyService { + + @Resource + private DeviceRepairApplyMapper deviceRepairApplyMapper; + + @Override + public DeviceRepairApplyRespVO createDeviceRepairApply(DeviceRepairApplySaveReqVO createReqVO) { + // 插入 + DeviceRepairApplyDO deviceRepairApply = BeanUtils.toBean(createReqVO, DeviceRepairApplyDO.class); + deviceRepairApplyMapper.insert(deviceRepairApply); + // 返回 + return BeanUtils.toBean(deviceRepairApply, DeviceRepairApplyRespVO.class); + } + + @Override + public void updateDeviceRepairApply(DeviceRepairApplySaveReqVO updateReqVO) { + // 校验存在 + validateDeviceRepairApplyExists(updateReqVO.getId()); + // 更新 + DeviceRepairApplyDO updateObj = BeanUtils.toBean(updateReqVO, DeviceRepairApplyDO.class); + deviceRepairApplyMapper.updateById(updateObj); + } + + @Override + public void deleteDeviceRepairApply(Long id) { + // 校验存在 + validateDeviceRepairApplyExists(id); + // 删除 + deviceRepairApplyMapper.deleteById(id); + } + + @Override + public void deleteDeviceRepairApplyListByIds(List ids) { + // 校验存在 + validateDeviceRepairApplyExists(ids); + // 删除 + deviceRepairApplyMapper.deleteByIds(ids); + } + + private void validateDeviceRepairApplyExists(List ids) { + List list = deviceRepairApplyMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(DEVICE_REPAIR_APPLY_NOT_EXISTS); + } + } + + private void validateDeviceRepairApplyExists(Long id) { + if (deviceRepairApplyMapper.selectById(id) == null) { + throw exception(DEVICE_REPAIR_APPLY_NOT_EXISTS); + } + } + + @Override + public DeviceRepairApplyDO getDeviceRepairApply(Long id) { + return deviceRepairApplyMapper.selectById(id); + } + + @Override + public PageResult getDeviceRepairApplyPage(DeviceRepairApplyPageReqVO pageReqVO) { + return deviceRepairApplyMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceRepairAtService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceRepairAtService.java new file mode 100644 index 0000000..26c353e --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceRepairAtService.java @@ -0,0 +1,64 @@ +package com.zt.plat.module.qms.resource.device.service; + +import java.util.*; + +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceRepairAtPageReqVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceRepairAtRespVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceRepairAtSaveReqVO; +import jakarta.validation.*; +import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceRepairAtDO; +import com.zt.plat.framework.common.pojo.PageResult; + +/** + * 故障与处理关系 Service 接口 + * + * @author 后台管理-1 + */ +public interface DeviceRepairAtService { + + /** + * 创建故障与处理关系 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + DeviceRepairAtRespVO createDeviceRepairAt(@Valid DeviceRepairAtSaveReqVO createReqVO); + + /** + * 更新故障与处理关系 + * + * @param updateReqVO 更新信息 + */ + void updateDeviceRepairAt(@Valid DeviceRepairAtSaveReqVO updateReqVO); + + /** + * 删除故障与处理关系 + * + * @param id 编号 + */ + void deleteDeviceRepairAt(Long id); + + /** + * 批量删除故障与处理关系 + * + * @param ids 编号 + */ + void deleteDeviceRepairAtListByIds(List ids); + + /** + * 获得故障与处理关系 + * + * @param id 编号 + * @return 故障与处理关系 + */ + DeviceRepairAtDO getDeviceRepairAt(Long id); + + /** + * 获得故障与处理关系分页 + * + * @param pageReqVO 分页查询 + * @return 故障与处理关系分页 + */ + PageResult getDeviceRepairAtPage(DeviceRepairAtPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceRepairAtServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceRepairAtServiceImpl.java new file mode 100644 index 0000000..9b136e0 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceRepairAtServiceImpl.java @@ -0,0 +1,75 @@ +package com.zt.plat.module.qms.resource.device.service; + +import cn.hutool.core.collection.CollUtil; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceRepairAtPageReqVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceRepairAtRespVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceRepairAtSaveReqVO; +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.device.dal.dataobject.DeviceRepairAtDO; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.util.object.BeanUtils; + +import com.zt.plat.module.qms.resource.device.dal.mapper.DeviceRepairAtMapper; + +import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList; + +/** + * 故障与处理关系 Service 实现类 + * + * @author 后台管理-1 + */ +@Service +@Validated +public class DeviceRepairAtServiceImpl implements DeviceRepairAtService { + + @Resource + private DeviceRepairAtMapper deviceRepairAtMapper; + + @Override + public DeviceRepairAtRespVO createDeviceRepairAt(DeviceRepairAtSaveReqVO createReqVO) { + // 插入 + DeviceRepairAtDO deviceRepairAt = BeanUtils.toBean(createReqVO, DeviceRepairAtDO.class); + deviceRepairAtMapper.insert(deviceRepairAt); + // 返回 + return BeanUtils.toBean(deviceRepairAt, DeviceRepairAtRespVO.class); + } + + @Override + public void updateDeviceRepairAt(DeviceRepairAtSaveReqVO updateReqVO) { + // 校验存在 + // 更新 + DeviceRepairAtDO updateObj = BeanUtils.toBean(updateReqVO, DeviceRepairAtDO.class); + deviceRepairAtMapper.updateById(updateObj); + } + + @Override + public void deleteDeviceRepairAt(Long id) { + // 校验存在 + // 删除 + deviceRepairAtMapper.deleteById(id); + } + + @Override + public void deleteDeviceRepairAtListByIds(List ids) { + // 校验存在 + // 删除 + deviceRepairAtMapper.deleteByIds(ids); + } + + @Override + public DeviceRepairAtDO getDeviceRepairAt(Long id) { + return deviceRepairAtMapper.selectById(id); + } + + @Override + public PageResult getDeviceRepairAtPage(DeviceRepairAtPageReqVO pageReqVO) { + return deviceRepairAtMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceRepairDetailService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceRepairDetailService.java new file mode 100644 index 0000000..746ebe5 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceRepairDetailService.java @@ -0,0 +1,64 @@ +package com.zt.plat.module.qms.resource.device.service; + +import java.util.*; + +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceRepairDetailPageReqVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceRepairDetailRespVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceRepairDetailSaveReqVO; +import jakarta.validation.*; +import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceRepairDetailDO; +import com.zt.plat.framework.common.pojo.PageResult; + +/** + * 设备维修明细 Service 接口 + * + * @author 后台管理-1 + */ +public interface DeviceRepairDetailService { + + /** + * 创建设备维修明细 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + DeviceRepairDetailRespVO createDeviceRepairDetail(@Valid DeviceRepairDetailSaveReqVO createReqVO); + + /** + * 更新设备维修明细 + * + * @param updateReqVO 更新信息 + */ + void updateDeviceRepairDetail(@Valid DeviceRepairDetailSaveReqVO updateReqVO); + + /** + * 删除设备维修明细 + * + * @param id 编号 + */ + void deleteDeviceRepairDetail(Long id); + + /** + * 批量删除设备维修明细 + * + * @param ids 编号 + */ + void deleteDeviceRepairDetailListByIds(List ids); + + /** + * 获得设备维修明细 + * + * @param id 编号 + * @return 设备维修明细 + */ + DeviceRepairDetailDO getDeviceRepairDetail(Long id); + + /** + * 获得设备维修明细分页 + * + * @param pageReqVO 分页查询 + * @return 设备维修明细分页 + */ + PageResult getDeviceRepairDetailPage(DeviceRepairDetailPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceRepairDetailServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceRepairDetailServiceImpl.java new file mode 100644 index 0000000..0532ba2 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceRepairDetailServiceImpl.java @@ -0,0 +1,92 @@ +package com.zt.plat.module.qms.resource.device.service; + +import cn.hutool.core.collection.CollUtil; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceRepairDetailPageReqVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceRepairDetailRespVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceRepairDetailSaveReqVO; +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.device.dal.dataobject.DeviceRepairDetailDO; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.util.object.BeanUtils; + +import com.zt.plat.module.qms.resource.device.dal.mapper.DeviceRepairDetailMapper; + +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.DEVICE_REPAIR_DETAIL_NOT_EXISTS; + +/** + * 设备维修明细 Service 实现类 + * + * @author 后台管理-1 + */ +@Service +@Validated +public class DeviceRepairDetailServiceImpl implements DeviceRepairDetailService { + + @Resource + private DeviceRepairDetailMapper deviceRepairDetailMapper; + + @Override + public DeviceRepairDetailRespVO createDeviceRepairDetail(DeviceRepairDetailSaveReqVO createReqVO) { + // 插入 + DeviceRepairDetailDO deviceRepairDetail = BeanUtils.toBean(createReqVO, DeviceRepairDetailDO.class); + deviceRepairDetailMapper.insert(deviceRepairDetail); + // 返回 + return BeanUtils.toBean(deviceRepairDetail, DeviceRepairDetailRespVO.class); + } + + @Override + public void updateDeviceRepairDetail(DeviceRepairDetailSaveReqVO updateReqVO) { + // 校验存在 + validateDeviceRepairDetailExists(updateReqVO.getId()); + // 更新 + DeviceRepairDetailDO updateObj = BeanUtils.toBean(updateReqVO, DeviceRepairDetailDO.class); + deviceRepairDetailMapper.updateById(updateObj); + } + + @Override + public void deleteDeviceRepairDetail(Long id) { + // 校验存在 + validateDeviceRepairDetailExists(id); + // 删除 + deviceRepairDetailMapper.deleteById(id); + } + + @Override + public void deleteDeviceRepairDetailListByIds(List ids) { + // 校验存在 + validateDeviceRepairDetailExists(ids); + // 删除 + deviceRepairDetailMapper.deleteByIds(ids); + } + + private void validateDeviceRepairDetailExists(List ids) { + List list = deviceRepairDetailMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(DEVICE_REPAIR_DETAIL_NOT_EXISTS); + } + } + + private void validateDeviceRepairDetailExists(Long id) { + if (deviceRepairDetailMapper.selectById(id) == null) { + throw exception(DEVICE_REPAIR_DETAIL_NOT_EXISTS); + } + } + + @Override + public DeviceRepairDetailDO getDeviceRepairDetail(Long id) { + return deviceRepairDetailMapper.selectById(id); + } + + @Override + public PageResult getDeviceRepairDetailPage(DeviceRepairDetailPageReqVO pageReqVO) { + return deviceRepairDetailMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceRepairResultDetailService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceRepairResultDetailService.java new file mode 100644 index 0000000..10e3ab1 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceRepairResultDetailService.java @@ -0,0 +1,64 @@ +package com.zt.plat.module.qms.resource.device.service; + +import java.util.*; + +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceRepairResultDetailPageReqVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceRepairResultDetailRespVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceRepairResultDetailSaveReqVO; +import jakarta.validation.*; +import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceRepairResultDetailDO; +import com.zt.plat.framework.common.pojo.PageResult; + +/** + * 故障处理明细 Service 接口 + * + * @author 后台管理-1 + */ +public interface DeviceRepairResultDetailService { + + /** + * 创建故障处理明细 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + DeviceRepairResultDetailRespVO createDeviceRepairResultDetail(@Valid DeviceRepairResultDetailSaveReqVO createReqVO); + + /** + * 更新故障处理明细 + * + * @param updateReqVO 更新信息 + */ + void updateDeviceRepairResultDetail(@Valid DeviceRepairResultDetailSaveReqVO updateReqVO); + + /** + * 删除故障处理明细 + * + * @param id 编号 + */ + void deleteDeviceRepairResultDetail(Long id); + + /** + * 批量删除故障处理明细 + * + * @param ids 编号 + */ + void deleteDeviceRepairResultDetailListByIds(List ids); + + /** + * 获得故障处理明细 + * + * @param id 编号 + * @return 故障处理明细 + */ + DeviceRepairResultDetailDO getDeviceRepairResultDetail(Long id); + + /** + * 获得故障处理明细分页 + * + * @param pageReqVO 分页查询 + * @return 故障处理明细分页 + */ + PageResult getDeviceRepairResultDetailPage(DeviceRepairResultDetailPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceRepairResultDetailServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceRepairResultDetailServiceImpl.java new file mode 100644 index 0000000..de2b4dd --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceRepairResultDetailServiceImpl.java @@ -0,0 +1,92 @@ +package com.zt.plat.module.qms.resource.device.service; + +import cn.hutool.core.collection.CollUtil; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceRepairResultDetailPageReqVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceRepairResultDetailRespVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceRepairResultDetailSaveReqVO; +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.device.dal.dataobject.DeviceRepairResultDetailDO; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.util.object.BeanUtils; + +import com.zt.plat.module.qms.resource.device.dal.mapper.DeviceRepairResultDetailMapper; + +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.DEVICE_REPAIR_RESULT_DETAIL_NOT_EXISTS; + +/** + * 故障处理明细 Service 实现类 + * + * @author 后台管理-1 + */ +@Service +@Validated +public class DeviceRepairResultDetailServiceImpl implements DeviceRepairResultDetailService { + + @Resource + private DeviceRepairResultDetailMapper deviceRepairResultDetailMapper; + + @Override + public DeviceRepairResultDetailRespVO createDeviceRepairResultDetail(DeviceRepairResultDetailSaveReqVO createReqVO) { + // 插入 + DeviceRepairResultDetailDO deviceRepairResultDetail = BeanUtils.toBean(createReqVO, DeviceRepairResultDetailDO.class); + deviceRepairResultDetailMapper.insert(deviceRepairResultDetail); + // 返回 + return BeanUtils.toBean(deviceRepairResultDetail, DeviceRepairResultDetailRespVO.class); + } + + @Override + public void updateDeviceRepairResultDetail(DeviceRepairResultDetailSaveReqVO updateReqVO) { + // 校验存在 + validateDeviceRepairResultDetailExists(updateReqVO.getId()); + // 更新 + DeviceRepairResultDetailDO updateObj = BeanUtils.toBean(updateReqVO, DeviceRepairResultDetailDO.class); + deviceRepairResultDetailMapper.updateById(updateObj); + } + + @Override + public void deleteDeviceRepairResultDetail(Long id) { + // 校验存在 + validateDeviceRepairResultDetailExists(id); + // 删除 + deviceRepairResultDetailMapper.deleteById(id); + } + + @Override + public void deleteDeviceRepairResultDetailListByIds(List ids) { + // 校验存在 + validateDeviceRepairResultDetailExists(ids); + // 删除 + deviceRepairResultDetailMapper.deleteByIds(ids); + } + + private void validateDeviceRepairResultDetailExists(List ids) { + List list = deviceRepairResultDetailMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(DEVICE_REPAIR_RESULT_DETAIL_NOT_EXISTS); + } + } + + private void validateDeviceRepairResultDetailExists(Long id) { + if (deviceRepairResultDetailMapper.selectById(id) == null) { + throw exception(DEVICE_REPAIR_RESULT_DETAIL_NOT_EXISTS); + } + } + + @Override + public DeviceRepairResultDetailDO getDeviceRepairResultDetail(Long id) { + return deviceRepairResultDetailMapper.selectById(id); + } + + @Override + public PageResult getDeviceRepairResultDetailPage(DeviceRepairResultDetailPageReqVO pageReqVO) { + return deviceRepairResultDetailMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceUseRecordService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceUseRecordService.java new file mode 100644 index 0000000..3bc119d --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceUseRecordService.java @@ -0,0 +1,66 @@ +package com.zt.plat.module.qms.resource.device.service; + +import java.util.*; + +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.module.qms.resource.device.controller.vo.*; +import jakarta.validation.*; +import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceUseRecordDO; +import com.zt.plat.framework.common.pojo.PageResult; + +/** + * 设备-使用记录 Service 接口 + * + * @author 后台管理-1 + */ +public interface DeviceUseRecordService { + + + PageResult queryPageListWithCount(DeviceUseRecordPageReqVO reqVO); + + /** + * 创建设备-使用记录 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + CommonResult createDeviceUseRecord(@Valid DeviceUseRecordSaveReqVO createReqVO); + + /** + * 更新设备-使用记录 + * + * @param updateReqVO 更新信息 + */ + void updateDeviceUseRecord(@Valid DeviceUseRecordSaveReqVO updateReqVO); + + /** + * 删除设备-使用记录 + * + * @param id 编号 + */ + void deleteDeviceUseRecord(Long id); + + /** + * 批量删除设备-使用记录 + * + * @param ids 编号 + */ + void deleteDeviceUseRecordListByIds(List ids); + + /** + * 获得设备-使用记录 + * + * @param id 编号 + * @return 设备-使用记录 + */ + DeviceUseRecordDO getDeviceUseRecord(Long id); + + /** + * 获得设备-使用记录分页 + * + * @param pageReqVO 分页查询 + * @return 设备-使用记录分页 + */ + PageResult getDeviceUseRecordPage(DeviceUseRecordPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceUseRecordServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceUseRecordServiceImpl.java new file mode 100644 index 0000000..fddb3f2 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceUseRecordServiceImpl.java @@ -0,0 +1,135 @@ +package com.zt.plat.module.qms.resource.device.service; + +import cn.hutool.core.collection.CollUtil; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.framework.security.core.LoginUser; +import com.zt.plat.framework.security.core.util.SecurityFrameworkUtils; +import com.zt.plat.module.qms.resource.device.controller.vo.*; +import org.springframework.stereotype.Service; +import jakarta.annotation.Resource; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.ObjectUtils; +import org.springframework.validation.annotation.Validated; + +import java.util.*; + +import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceUseRecordDO; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.util.object.BeanUtils; + +import com.zt.plat.module.qms.resource.device.dal.mapper.DeviceUseRecordMapper; + +import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.zt.plat.framework.common.pojo.CommonResult.success; +import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList; +import static com.zt.plat.module.qms.enums.ErrorCodeConstants.DEVICE_USE_RECORD_NOT_EXISTS; + +/** + * 设备-使用记录 Service 实现类 + * + * @author 后台管理-1 + */ +@Service +@Validated +public class DeviceUseRecordServiceImpl implements DeviceUseRecordService { + + @Resource private DeviceInfomationService deviceInfomationService; + @Resource private DeviceProductService deviceProductService; + @Resource private DeviceUseRecordMapper deviceUseRecordMapper; + + @Override + public PageResult queryPageListWithCount(DeviceUseRecordPageReqVO reqVO) { + Long productId = reqVO.getProductId(); + if(productId != null){ + List productIds = deviceProductService.getIdListByIdPath(productId); + List deviceIds = deviceInfomationService.getIdListByProductIdList(productIds); + if(!deviceIds.isEmpty()){ + reqVO.setProductId(null); + reqVO.setDeviceIdList(deviceIds); + } + } + Page page = new Page<>(reqVO.getPageNo(), reqVO.getPageSize()); + IPage pageList = deviceUseRecordMapper.queryPageListWithCount(page, reqVO); + return new PageResult<>(pageList.getRecords(), pageList.getTotal()); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public CommonResult createDeviceUseRecord(DeviceUseRecordSaveReqVO reqVO) { + Long deviceId = reqVO.getDeviceId(); + if(ObjectUtils.isEmpty(reqVO.getUserName())){ + //当前登录人 + LoginUser loginUser = SecurityFrameworkUtils.getLoginUser(); + //当前登录用户昵称 + String nickName = SecurityFrameworkUtils.getLoginUserNickname(); + reqVO.setUserName(nickName); + reqVO.setUserId(loginUser.getId()); + } + DeviceUseRecordDO deviceUseRecord = BeanUtils.toBean(reqVO, DeviceUseRecordDO.class); + deviceUseRecordMapper.insert(deviceUseRecord); + if(reqVO.getUseTimeEnd() == null) + deviceInfomationService.updateDeviceInUseFlag(deviceId, 1); + else + deviceInfomationService.updateDeviceInUseFlag(deviceId, 0); + // 返回 + DeviceUseRecordRespVO respVO = BeanUtils.toBean(deviceUseRecord, DeviceUseRecordRespVO.class); + return success(respVO); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void updateDeviceUseRecord(DeviceUseRecordSaveReqVO reqVO) { + // 校验存在 + validateDeviceUseRecordExists(reqVO.getId()); + Long deviceId = reqVO.getDeviceId(); + if(reqVO.getUseTimeEnd() == null) + deviceInfomationService.updateDeviceInUseFlag(deviceId, 1); + else + deviceInfomationService.updateDeviceInUseFlag(deviceId, 0); + // 更新 + DeviceUseRecordDO updateObj = BeanUtils.toBean(reqVO, DeviceUseRecordDO.class); + deviceUseRecordMapper.updateById(updateObj); + } + + @Override + public void deleteDeviceUseRecord(Long id) { + // 校验存在 + validateDeviceUseRecordExists(id); + // 删除 + deviceUseRecordMapper.deleteById(id); + } + + @Override + public void deleteDeviceUseRecordListByIds(List ids) { + // 校验存在 + validateDeviceUseRecordExists(ids); + // 删除 + deviceUseRecordMapper.deleteByIds(ids); + } + + private void validateDeviceUseRecordExists(List ids) { + List list = deviceUseRecordMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(DEVICE_USE_RECORD_NOT_EXISTS); + } + } + + private void validateDeviceUseRecordExists(Long id) { + if (deviceUseRecordMapper.selectById(id) == null) { + throw exception(DEVICE_USE_RECORD_NOT_EXISTS); + } + } + + @Override + public DeviceUseRecordDO getDeviceUseRecord(Long id) { + return deviceUseRecordMapper.selectById(id); + } + + @Override + public PageResult getDeviceUseRecordPage(DeviceUseRecordPageReqVO pageReqVO) { + return deviceUseRecordMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialBatchAssignController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialBatchAssignController.java new file mode 100644 index 0000000..d051f79 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialBatchAssignController.java @@ -0,0 +1,135 @@ +package com.zt.plat.module.qms.resource.material.controller.admin; + +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialBatchAssignPageReqVO; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialBatchAssignRespVO; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialBatchAssignSaveReqVO; +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 static com.zt.plat.framework.common.pojo.CommonResult.error; + +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 static com.zt.plat.module.qms.enums.ErrorCodeConstants.MATERIAL_BATCH_ASSIGN_NOT_EXISTS; + +import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialBatchAssignDO; +import com.zt.plat.module.qms.resource.material.service.MaterialBatchAssignService; + +@Tag(name = "管理后台 - 物料批次分发") +@RestController +@RequestMapping("/qms/resource/material-batch-assign") +@Validated +@FileUploadController(source = "qms.materialbatchassign") +public class MaterialBatchAssignController extends AbstractFileUploadController implements BusinessControllerMarker{ + + static { + FileUploadController annotation = MaterialBatchAssignController.class.getAnnotation(FileUploadController.class); + if (annotation != null) { + setFileUploadInfo(annotation); + } + } + + @Resource + private MaterialBatchAssignService materialBatchAssignService; + + @PostMapping("/create") + @Operation(summary = "创建物料批次分发") + @PreAuthorize("@ss.hasPermission('qms:material-batch-assign:create')") + public CommonResult createMaterialBatchAssign(@Valid @RequestBody MaterialBatchAssignSaveReqVO createReqVO) { + return success(materialBatchAssignService.createMaterialBatchAssign(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新物料批次分发") + @PreAuthorize("@ss.hasPermission('qms:material-batch-assign:update')") + public CommonResult updateMaterialBatchAssign(@Valid @RequestBody MaterialBatchAssignSaveReqVO updateReqVO) { + materialBatchAssignService.updateMaterialBatchAssign(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除物料批次分发") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('qms:material-batch-assign:delete')") + public CommonResult deleteMaterialBatchAssign(@RequestParam("id") Long id) { + materialBatchAssignService.deleteMaterialBatchAssign(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除物料批次分发") + @PreAuthorize("@ss.hasPermission('qms:material-batch-assign:delete')") + public CommonResult deleteMaterialBatchAssignList(@RequestBody BatchDeleteReqVO req) { + materialBatchAssignService.deleteMaterialBatchAssignListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得物料批次分发") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('qms:material-batch-assign:query')") + public CommonResult getMaterialBatchAssign(@RequestParam("id") Long id) { + MaterialBatchAssignDO materialBatchAssign = materialBatchAssignService.getMaterialBatchAssign(id); + return success(BeanUtils.toBean(materialBatchAssign, MaterialBatchAssignRespVO.class)); + } + + + @GetMapping("/get-by-inf") + @Operation(summary = "获得物料批次分发") + @Parameter(name = "productId", description = "产品大类编号", required = true) + // @PreAuthorize("@ss.hasPermission('qms:material-batch-assign:query')") + public CommonResult> getMaterialBatchAssignByInfiId(MaterialBatchAssignPageReqVO pageReqVO) { + + if(pageReqVO.getMaterialInfomationId()==null||pageReqVO.getMaterialInfomationId().length()==0){ + return error(MATERIAL_BATCH_ASSIGN_NOT_EXISTS,"示例编号不能为空"); + } + + PageResult pageResult = materialBatchAssignService.getMaterialBatchAssignByInfId(pageReqVO); + return success(BeanUtils.toBean(pageResult, MaterialBatchAssignRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得物料批次分发分页") + @PreAuthorize("@ss.hasPermission('qms:material-batch-assign:query')") + public CommonResult> getMaterialBatchAssignPage(@Valid MaterialBatchAssignPageReqVO pageReqVO) { + PageResult pageResult = materialBatchAssignService.getMaterialBatchAssignPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, MaterialBatchAssignRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出物料批次分发 Excel") + @PreAuthorize("@ss.hasPermission('qms:material-batch-assign:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportMaterialBatchAssignExcel(@Valid MaterialBatchAssignPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = materialBatchAssignService.getMaterialBatchAssignPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "物料批次分发.xls", "数据", MaterialBatchAssignRespVO.class, + BeanUtils.toBean(list, MaterialBatchAssignRespVO.class)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialBatchController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialBatchController.java new file mode 100644 index 0000000..3850d84 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialBatchController.java @@ -0,0 +1,126 @@ +package com.zt.plat.module.qms.resource.material.controller.admin; + +import com.zt.plat.module.qms.resource.material.controller.vo.*; +import com.zt.plat.module.qms.resource.material.service.MaterialBatchAssignService; +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.MaterialBatchDO; +import com.zt.plat.module.qms.resource.material.service.MaterialBatchService; + +@Tag(name = "管理后台 - 物料批次") +@RestController +@RequestMapping("/qms/resource/material-batch") +@Validated +@FileUploadController(source = "qms.materialbatch") +public class MaterialBatchController extends AbstractFileUploadController implements BusinessControllerMarker{ + + @Resource + private MaterialBatchAssignService materialBatchAssignService; + + static { + FileUploadController annotation = MaterialBatchController.class.getAnnotation(FileUploadController.class); + if (annotation != null) { + setFileUploadInfo(annotation); + } + } + + @Resource + private MaterialBatchService materialBatchService; + + @PostMapping("/create") + @Operation(summary = "创建物料批次") + @PreAuthorize("@ss.hasPermission('qms:material-batch:create')") + public CommonResult createMaterialBatch(@Valid @RequestBody MaterialBatchSaveReqVO createReqVO) { + return success(materialBatchService.createMaterialBatch(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新物料批次") + @PreAuthorize("@ss.hasPermission('qms:material-batch:update')") + public CommonResult updateMaterialBatch(@Valid @RequestBody MaterialBatchSaveReqVO updateReqVO) { + materialBatchService.updateMaterialBatch(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除物料批次") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('qms:material-batch:delete')") + public CommonResult deleteMaterialBatch(@RequestParam("id") Long id) { + materialBatchService.deleteMaterialBatch(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除物料批次") + @PreAuthorize("@ss.hasPermission('qms:material-batch:delete')") + public CommonResult deleteMaterialBatchList(@RequestBody BatchDeleteReqVO req) { + materialBatchService.deleteMaterialBatchListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得物料批次") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('qms:material-batch:query')") + public CommonResult getMaterialBatch(@RequestParam("id") Long id) { + MaterialBatchDO materialBatch = materialBatchService.getMaterialBatch(id); + return success(BeanUtils.toBean(materialBatch, MaterialBatchRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得物料批次分页") + @PreAuthorize("@ss.hasPermission('qms:material-batch:query')") + public CommonResult> getMaterialBatchPage(@Valid MaterialBatchPageReqVO pageReqVO) { + PageResult pageResult = materialBatchService.getMaterialBatchPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, MaterialBatchRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出物料批次 Excel") + @PreAuthorize("@ss.hasPermission('qms:material-batch:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportMaterialBatchExcel(@Valid MaterialBatchPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = materialBatchService.getMaterialBatchPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "物料批次.xls", "数据", MaterialBatchRespVO.class, + BeanUtils.toBean(list, MaterialBatchRespVO.class)); + } + + @PostMapping("/assign") + @Operation(summary = "物料分发") + public CommonResult assign(@Valid @RequestBody MaterialBatchAssignSaveReqVO createReqVO) { + return success(materialBatchAssignService.assignLab(createReqVO)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialInventoryCheckBatchController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialInventoryCheckBatchController.java new file mode 100644 index 0000000..8beffa6 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialInventoryCheckBatchController.java @@ -0,0 +1,118 @@ +package com.zt.plat.module.qms.resource.material.controller.admin; + +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryCheckBatchPageReqVO; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryCheckBatchRespVO; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryCheckBatchSaveReqVO; +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.MaterialInventoryCheckBatchDO; +import com.zt.plat.module.qms.resource.material.service.MaterialInventoryCheckBatchService; + +@Tag(name = "管理后台 - 库存盘点项") +@RestController +@RequestMapping("/qms/material-inventory-check-batch") +@Validated +@FileUploadController(source = "qms.materialinventorycheckbatch") +public class MaterialInventoryCheckBatchController extends AbstractFileUploadController implements BusinessControllerMarker{ + + static { + FileUploadController annotation = MaterialInventoryCheckBatchController.class.getAnnotation(FileUploadController.class); + if (annotation != null) { + setFileUploadInfo(annotation); + } + } + + @Resource + private MaterialInventoryCheckBatchService materialInventoryCheckBatchService; + + @PostMapping("/create") + @Operation(summary = "创建库存盘点项") + @PreAuthorize("@ss.hasPermission('qms:material-inventory-check-batch:create')") + public CommonResult createMaterialInventoryCheckBatch(@Valid @RequestBody MaterialInventoryCheckBatchSaveReqVO createReqVO) { + return success(materialInventoryCheckBatchService.createMaterialInventoryCheckBatch(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新库存盘点项") + @PreAuthorize("@ss.hasPermission('qms:material-inventory-check-batch:update')") + public CommonResult updateMaterialInventoryCheckBatch(@Valid @RequestBody MaterialInventoryCheckBatchSaveReqVO updateReqVO) { + materialInventoryCheckBatchService.updateMaterialInventoryCheckBatch(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除库存盘点项") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('qms:material-inventory-check-batch:delete')") + public CommonResult deleteMaterialInventoryCheckBatch(@RequestParam("id") Long id) { + materialInventoryCheckBatchService.deleteMaterialInventoryCheckBatch(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除库存盘点项") + @PreAuthorize("@ss.hasPermission('qms:material-inventory-check-batch:delete')") + public CommonResult deleteMaterialInventoryCheckBatchList(@RequestBody BatchDeleteReqVO req) { + materialInventoryCheckBatchService.deleteMaterialInventoryCheckBatchListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得库存盘点项") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('qms:material-inventory-check-batch:query')") + public CommonResult getMaterialInventoryCheckBatch(@RequestParam("id") Long id) { + MaterialInventoryCheckBatchDO materialInventoryCheckBatch = materialInventoryCheckBatchService.getMaterialInventoryCheckBatch(id); + return success(BeanUtils.toBean(materialInventoryCheckBatch, MaterialInventoryCheckBatchRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得库存盘点项分页") + @PreAuthorize("@ss.hasPermission('qms:material-inventory-check-batch:query')") + public CommonResult> getMaterialInventoryCheckBatchPage(@Valid MaterialInventoryCheckBatchPageReqVO pageReqVO) { + PageResult pageResult = materialInventoryCheckBatchService.getMaterialInventoryCheckBatchPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, MaterialInventoryCheckBatchRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出库存盘点项 Excel") + @PreAuthorize("@ss.hasPermission('qms:material-inventory-check-batch:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportMaterialInventoryCheckBatchExcel(@Valid MaterialInventoryCheckBatchPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = materialInventoryCheckBatchService.getMaterialInventoryCheckBatchPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "库存盘点项.xls", "数据", MaterialInventoryCheckBatchRespVO.class, + BeanUtils.toBean(list, MaterialInventoryCheckBatchRespVO.class)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialInventoryCheckController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialInventoryCheckController.java new file mode 100644 index 0000000..0e46412 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialInventoryCheckController.java @@ -0,0 +1,135 @@ +package com.zt.plat.module.qms.resource.material.controller.admin; + +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryCheckPageReqVO; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryCheckRespVO; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryCheckSaveReqVO; +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.MaterialInventoryCheckDO; +import com.zt.plat.module.qms.resource.material.service.MaterialInventoryCheckService; + +@Tag(name = "管理后台 - 库存盘点") +@RestController +@RequestMapping("/qms/resource/material-inventory-check") +@Validated +@FileUploadController(source = "qms.materialinventorycheck") +public class MaterialInventoryCheckController extends AbstractFileUploadController implements BusinessControllerMarker{ + + static { + FileUploadController annotation = MaterialInventoryCheckController.class.getAnnotation(FileUploadController.class); + if (annotation != null) { + setFileUploadInfo(annotation); + } + } + + @Resource + private MaterialInventoryCheckService materialInventoryCheckService; + + @PostMapping("/create") + @Operation(summary = "创建库存盘点") + @PreAuthorize("@ss.hasPermission('qms:material-inventory-check:create')") + public CommonResult createMaterialInventoryCheck(@Valid @RequestBody MaterialInventoryCheckSaveReqVO createReqVO) { + return success(materialInventoryCheckService.createMaterialInventoryCheck(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新库存盘点") + @PreAuthorize("@ss.hasPermission('qms:material-inventory-check:update')") + public CommonResult updateMaterialInventoryCheck(@Valid @RequestBody MaterialInventoryCheckSaveReqVO updateReqVO) { + materialInventoryCheckService.updateMaterialInventoryCheck(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除库存盘点") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('qms:material-inventory-check:delete')") + public CommonResult deleteMaterialInventoryCheck(@RequestParam("id") Long id) { + materialInventoryCheckService.deleteMaterialInventoryCheck(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除库存盘点") + @PreAuthorize("@ss.hasPermission('qms:material-inventory-check:delete')") + public CommonResult deleteMaterialInventoryCheckList(@RequestBody BatchDeleteReqVO req) { + materialInventoryCheckService.deleteMaterialInventoryCheckListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得库存盘点") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('qms:material-inventory-check:query')") + public CommonResult getMaterialInventoryCheck(@RequestParam("id") Long id) { + MaterialInventoryCheckDO materialInventoryCheck = materialInventoryCheckService.getMaterialInventoryCheck(id); + return success(BeanUtils.toBean(materialInventoryCheck, MaterialInventoryCheckRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得库存盘点分页") + @PreAuthorize("@ss.hasPermission('qms:material-inventory-check:query')") + public CommonResult> getMaterialInventoryCheckPage(@Valid MaterialInventoryCheckPageReqVO pageReqVO) { + PageResult pageResult = materialInventoryCheckService.getMaterialInventoryCheckPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, MaterialInventoryCheckRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出库存盘点 Excel") + @PreAuthorize("@ss.hasPermission('qms:material-inventory-check:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportMaterialInventoryCheckExcel(@Valid MaterialInventoryCheckPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = materialInventoryCheckService.getMaterialInventoryCheckPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "库存盘点.xls", "数据", MaterialInventoryCheckRespVO.class, + BeanUtils.toBean(list, MaterialInventoryCheckRespVO.class)); + } + + + @PostMapping("/create-form") + @Operation(summary = "创建库存盘点") + public CommonResult createMaterialInventoryCheckForm(@Valid @RequestBody MaterialInventoryCheckSaveReqVO createReqVO) { + + + return success(materialInventoryCheckService.createMaterialInventoryCheckForm(createReqVO)); + } + + @GetMapping("/get-form") + @Operation(summary = "获得库存盘点") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('qms:material-inventory-check:query')") + public CommonResult getMaterialInventoryCheckForm(@RequestParam("id") Long id) { + + return success(materialInventoryCheckService.getMaterialInventoryCheckForm(id)); + } +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialInventoryCheckDetailController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialInventoryCheckDetailController.java new file mode 100644 index 0000000..3de97e2 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialInventoryCheckDetailController.java @@ -0,0 +1,118 @@ +package com.zt.plat.module.qms.resource.material.controller.admin; + +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryCheckDetailPageReqVO; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryCheckDetailRespVO; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryCheckDetailSaveReqVO; +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.MaterialInventoryCheckDetailDO; +import com.zt.plat.module.qms.resource.material.service.MaterialInventoryCheckDetailService; + +@Tag(name = "管理后台 - 库存盘点明细") +@RestController +@RequestMapping("/qms/material-inventory-check-detail") +@Validated +@FileUploadController(source = "qms.materialinventorycheckdetail") +public class MaterialInventoryCheckDetailController extends AbstractFileUploadController implements BusinessControllerMarker{ + + static { + FileUploadController annotation = MaterialInventoryCheckDetailController.class.getAnnotation(FileUploadController.class); + if (annotation != null) { + setFileUploadInfo(annotation); + } + } + + @Resource + private MaterialInventoryCheckDetailService materialInventoryCheckDetailService; + + @PostMapping("/create") + @Operation(summary = "创建库存盘点明细") + @PreAuthorize("@ss.hasPermission('qms:material-inventory-check-detail:create')") + public CommonResult createMaterialInventoryCheckDetail(@Valid @RequestBody MaterialInventoryCheckDetailSaveReqVO createReqVO) { + return success(materialInventoryCheckDetailService.createMaterialInventoryCheckDetail(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新库存盘点明细") + @PreAuthorize("@ss.hasPermission('qms:material-inventory-check-detail:update')") + public CommonResult updateMaterialInventoryCheckDetail(@Valid @RequestBody MaterialInventoryCheckDetailSaveReqVO updateReqVO) { + materialInventoryCheckDetailService.updateMaterialInventoryCheckDetail(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除库存盘点明细") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('qms:material-inventory-check-detail:delete')") + public CommonResult deleteMaterialInventoryCheckDetail(@RequestParam("id") Long id) { + materialInventoryCheckDetailService.deleteMaterialInventoryCheckDetail(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除库存盘点明细") + @PreAuthorize("@ss.hasPermission('qms:material-inventory-check-detail:delete')") + public CommonResult deleteMaterialInventoryCheckDetailList(@RequestBody BatchDeleteReqVO req) { + materialInventoryCheckDetailService.deleteMaterialInventoryCheckDetailListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得库存盘点明细") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('qms:material-inventory-check-detail:query')") + public CommonResult getMaterialInventoryCheckDetail(@RequestParam("id") Long id) { + MaterialInventoryCheckDetailDO materialInventoryCheckDetail = materialInventoryCheckDetailService.getMaterialInventoryCheckDetail(id); + return success(BeanUtils.toBean(materialInventoryCheckDetail, MaterialInventoryCheckDetailRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得库存盘点明细分页") + @PreAuthorize("@ss.hasPermission('qms:material-inventory-check-detail:query')") + public CommonResult> getMaterialInventoryCheckDetailPage(@Valid MaterialInventoryCheckDetailPageReqVO pageReqVO) { + PageResult pageResult = materialInventoryCheckDetailService.getMaterialInventoryCheckDetailPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, MaterialInventoryCheckDetailRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出库存盘点明细 Excel") + @PreAuthorize("@ss.hasPermission('qms:material-inventory-check-detail:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportMaterialInventoryCheckDetailExcel(@Valid MaterialInventoryCheckDetailPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = materialInventoryCheckDetailService.getMaterialInventoryCheckDetailPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "库存盘点明细.xls", "数据", MaterialInventoryCheckDetailRespVO.class, + BeanUtils.toBean(list, MaterialInventoryCheckDetailRespVO.class)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialInventoryController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialInventoryController.java new file mode 100644 index 0000000..a77892b --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialInventoryController.java @@ -0,0 +1,151 @@ +package com.zt.plat.module.qms.resource.material.controller.admin; + +import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog; +import com.zt.plat.framework.business.annotation.FileUploadController; +import com.zt.plat.framework.business.controller.AbstractFileUploadController; +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.qms.resource.material.controller.vo.*; +import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialInventoryDO; +import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialInventoryInboundDetailDO; +import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialProductDO; +import com.zt.plat.module.qms.resource.material.service.MaterialInventoryInboundDetailService; +import com.zt.plat.module.qms.resource.material.service.MaterialInventoryService; +import com.zt.plat.module.qms.resource.material.service.MaterialProductService; +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("/qms/resource/material-inventory") +@Validated +@FileUploadController(source = "qms.materiainfo") +public class MaterialInventoryController extends AbstractFileUploadController implements BusinessControllerMarker { + + static { + FileUploadController annotation = MaterialInventoryController.class.getAnnotation(FileUploadController.class); + if (annotation != null) { + setFileUploadInfo(annotation); + } + } + + @Resource + private MaterialInventoryInboundDetailService materialInventoryInboundDetailService; + + @Resource + private MaterialInventoryService mterialInventoryService; + + + @PostMapping("/create") + @Operation(summary = "创建入库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等") + @PreAuthorize("@ss.hasPermission('qms:material-inventory-inbound-detail:create')") + public CommonResult createMaterialInventoryInboundDetail(@Valid @RequestBody MaterialInventoryInboundDetailSaveReqVO createReqVO) { + return success(materialInventoryInboundDetailService.createMaterialInventoryInboundDetail(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新入库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等") + @PreAuthorize("@ss.hasPermission('qms:material-inventory-inbound-detail:update')") + public CommonResult updateMaterialInventoryInboundDetail(@Valid @RequestBody MaterialInventoryInboundDetailSaveReqVO updateReqVO) { + materialInventoryInboundDetailService.updateMaterialInventoryInboundDetail(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除入库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('qms:material-inventory-inbound-detail:delete')") + public CommonResult deleteMaterialInventoryInboundDetail(@RequestParam("id") Long id) { + materialInventoryInboundDetailService.deleteMaterialInventoryInboundDetail(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除入库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等") + @PreAuthorize("@ss.hasPermission('qms:material-inventory-inbound-detail:delete')") + public CommonResult deleteMaterialInventoryInboundDetailList(@RequestBody BatchDeleteReqVO req) { + materialInventoryInboundDetailService.deleteMaterialInventoryInboundDetailListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得入库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('qms:material-inventory-inbound-detail:query')") + public CommonResult getMaterialInventoryInboundDetail(@RequestParam("id") Long id) { + MaterialInventoryInboundDetailDO materialInventoryInboundDetail = materialInventoryInboundDetailService.getMaterialInventoryInboundDetail(id); + return success(BeanUtils.toBean(materialInventoryInboundDetail, MaterialInventoryInboundDetailRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得库存明细") +// @PreAuthorize("@ss.hasPermission('qms:material-inventory-inbound-detail:query')") + public CommonResult> getMaterialInventoryPage(@Valid MaterialInventoryInboundDetailPageReqVO pageReqVO) { + PageResult pageResult = materialInventoryInboundDetailService.getMaterialInventoryInboundDetailPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, MaterialInventoryInboundDetailRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出入库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等 Excel") + @PreAuthorize("@ss.hasPermission('qms:material-inventory-inbound-detail:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportMaterialInventoryInboundDetailExcel(@Valid MaterialInventoryInboundDetailPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = materialInventoryInboundDetailService.getMaterialInventoryInboundDetailPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "入库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等.xls", "数据", MaterialInventoryInboundDetailRespVO.class, + BeanUtils.toBean(list, MaterialInventoryInboundDetailRespVO.class)); + } + + + @GetMapping("/getList") + @Operation(summary = "获得库存列表") + @Parameter(name = "id", description = "编号", required = true) + public CommonResult> getMaterialProduct(MaterialInventoryRespVO pageReqVO) { + + PageResult pageResult = mterialInventoryService.getMaterialInventoryPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, MaterialInventoryRespVO.class)); + } + + @GetMapping("/get_mtrl_inf") + @Operation(summary = "获取实例列表") + @Parameter(name = "id", description = "编号", required = true) + public CommonResult> getInfomation(MaterialInventoryRespVO pageReqVO) { + + PageResult pageResult = mterialInventoryService.getMaterialInventoryPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, MaterialInventoryRespVO.class)); + } + + @GetMapping("/agree-out") + @Operation(summary = "同意出库") + @Parameter(name = "id", description = "出库单id", required = true) + public CommonResult agreeOut(@RequestParam("outId") Long outId) { + +// PageResult pageResult = mterialInventoryService.getMaterialInventoryPage(pageReqVO); +// return success(BeanUtils.toBean(pageResult, MaterialInventoryRespVO.class)); + mterialInventoryService.agreeMaterialInventoryOutbound(outId); + return success(true); + } + + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialInventoryInboundController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialInventoryInboundController.java new file mode 100644 index 0000000..c564f06 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialInventoryInboundController.java @@ -0,0 +1,132 @@ +package com.zt.plat.module.qms.resource.material.controller.admin; + +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryInboundPageReqVO; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryInboundRespVO; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryInboundSaveReqVO; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialProductRespVO; +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.MaterialInventoryInboundDO; +import com.zt.plat.module.qms.resource.material.service.MaterialInventoryInboundService; + +@Tag(name = "管理后台 - 入库") +@RestController +@RequestMapping("/qms/resource/material-inventory-inbound") +@Validated +@FileUploadController(source = "qms.materialinventoryinbound") +public class MaterialInventoryInboundController extends AbstractFileUploadController implements BusinessControllerMarker{ + + static { + FileUploadController annotation = MaterialInventoryInboundController.class.getAnnotation(FileUploadController.class); + if (annotation != null) { + setFileUploadInfo(annotation); + } + } + + @Resource + private MaterialInventoryInboundService materialInventoryInboundService; + + @PostMapping("/create") + @Operation(summary = "创建入库") + @PreAuthorize("@ss.hasPermission('qms:material-inventory-inbound:create')") + public CommonResult createMaterialInventoryInbound(@Valid @RequestBody MaterialInventoryInboundSaveReqVO createReqVO) { + return success(materialInventoryInboundService.createMaterialInventoryInbound(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新入库") + @PreAuthorize("@ss.hasPermission('qms:material-inventory-inbound:update')") + public CommonResult updateMaterialInventoryInbound(@Valid @RequestBody MaterialInventoryInboundSaveReqVO updateReqVO) { + materialInventoryInboundService.updateMaterialInventoryInbound(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除入库") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('qms:material-inventory-inbound:delete')") + public CommonResult deleteMaterialInventoryInbound(@RequestParam("id") Long id) { + materialInventoryInboundService.deleteMaterialInventoryInbound(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除入库") + @PreAuthorize("@ss.hasPermission('qms:material-inventory-inbound:delete')") + public CommonResult deleteMaterialInventoryInboundList(@RequestBody BatchDeleteReqVO req) { + materialInventoryInboundService.deleteMaterialInventoryInboundListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得入库") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('qms:material-inventory-inbound:query')") + public CommonResult getMaterialInventoryInbound(@RequestParam("id") Long id) { + MaterialInventoryInboundDO materialInventoryInbound = materialInventoryInboundService.getMaterialInventoryInbound(id); + return success(BeanUtils.toBean(materialInventoryInbound, MaterialInventoryInboundRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得入库分页") + @PreAuthorize("@ss.hasPermission('qms:material-inventory-inbound:query')") + public CommonResult> getMaterialInventoryInboundPage(@Valid MaterialInventoryInboundPageReqVO pageReqVO) { + PageResult pageResult = materialInventoryInboundService.getMaterialInventoryInboundPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, MaterialInventoryInboundRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出入库 Excel") + @PreAuthorize("@ss.hasPermission('qms:material-inventory-inbound:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportMaterialInventoryInboundExcel(@Valid MaterialInventoryInboundPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = materialInventoryInboundService.getMaterialInventoryInboundPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "入库.xls", "数据", MaterialInventoryInboundRespVO.class, + BeanUtils.toBean(list, MaterialInventoryInboundRespVO.class)); + } + + + @PostMapping("/multi-put") + @Operation(summary = "批量上架") + public CommonResult createMaterialInventoryInboundMulti(@Valid @RequestBody MaterialInventoryInboundSaveReqVO createReqVO) { + materialInventoryInboundService.multiCreateMaterialInventoryInbound(createReqVO); + return success(true); + } + + @PostMapping("single-put") + @Operation(summary = "单一上架") + public CommonResult> createMaterialInventoryInboundSingle(@Valid @RequestBody MaterialInventoryInboundSaveReqVO createReqVO) { + return success(materialInventoryInboundService.singleCreateMaterialInventoryInbound(createReqVO)); + } +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialInventoryInboundDetailController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialInventoryInboundDetailController.java new file mode 100644 index 0000000..d110a8a --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialInventoryInboundDetailController.java @@ -0,0 +1,124 @@ +package com.zt.plat.module.qms.resource.material.controller.admin; + +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryInboundDetailPageReqVO; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryInboundDetailRespVO; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryInboundDetailSaveReqVO; +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.MaterialInventoryInboundDetailDO; +import com.zt.plat.module.qms.resource.material.service.MaterialInventoryInboundDetailService; + +@Tag(name = "管理后台 - 入库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等") +@RestController +@RequestMapping("/qms/resource/material-inventory-inbound-detail") +@Validated +@FileUploadController(source = "qms.materialinventoryinbounddetail") +public class MaterialInventoryInboundDetailController extends AbstractFileUploadController implements BusinessControllerMarker{ + + static { + FileUploadController annotation = MaterialInventoryInboundDetailController.class.getAnnotation(FileUploadController.class); + if (annotation != null) { + setFileUploadInfo(annotation); + } + } + + @Resource + private MaterialInventoryInboundDetailService materialInventoryInboundDetailService; + + @PostMapping("/create") + @Operation(summary = "创建入库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等") + @PreAuthorize("@ss.hasPermission('qms:material-inventory-inbound-detail:create')") + public CommonResult createMaterialInventoryInboundDetail(@Valid @RequestBody MaterialInventoryInboundDetailSaveReqVO createReqVO) { + return success(materialInventoryInboundDetailService.createMaterialInventoryInboundDetail(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新入库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等") + @PreAuthorize("@ss.hasPermission('qms:material-inventory-inbound-detail:update')") + public CommonResult updateMaterialInventoryInboundDetail(@Valid @RequestBody MaterialInventoryInboundDetailSaveReqVO updateReqVO) { + materialInventoryInboundDetailService.updateMaterialInventoryInboundDetail(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除入库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('qms:material-inventory-inbound-detail:delete')") + public CommonResult deleteMaterialInventoryInboundDetail(@RequestParam("id") Long id) { + materialInventoryInboundDetailService.deleteMaterialInventoryInboundDetail(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除入库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等") + @PreAuthorize("@ss.hasPermission('qms:material-inventory-inbound-detail:delete')") + public CommonResult deleteMaterialInventoryInboundDetailList(@RequestBody BatchDeleteReqVO req) { + materialInventoryInboundDetailService.deleteMaterialInventoryInboundDetailListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得入库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('qms:material-inventory-inbound-detail:query')") + public CommonResult getMaterialInventoryInboundDetail(@RequestParam("id") Long id) { + MaterialInventoryInboundDetailDO materialInventoryInboundDetail = materialInventoryInboundDetailService.getMaterialInventoryInboundDetail(id); + return success(BeanUtils.toBean(materialInventoryInboundDetail, MaterialInventoryInboundDetailRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得入库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等分页") + @PreAuthorize("@ss.hasPermission('qms:material-inventory-inbound-detail:query')") + public CommonResult> getMaterialInventoryInboundDetailPage(@Valid MaterialInventoryInboundDetailPageReqVO pageReqVO) { + PageResult pageResult = materialInventoryInboundDetailService.getMaterialInventoryInboundDetailPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, MaterialInventoryInboundDetailRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出入库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等 Excel") + @PreAuthorize("@ss.hasPermission('qms:material-inventory-inbound-detail:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportMaterialInventoryInboundDetailExcel(@Valid MaterialInventoryInboundDetailPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = materialInventoryInboundDetailService.getMaterialInventoryInboundDetailPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "入库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等.xls", "数据", MaterialInventoryInboundDetailRespVO.class, + BeanUtils.toBean(list, MaterialInventoryInboundDetailRespVO.class)); + } + + @GetMapping("/page-list") + @Operation(summary = "获得入库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等分页") + public CommonResult> getMaterialInventoryInboundDetailPageList(@Valid MaterialInventoryInboundDetailPageReqVO pageReqVO) { + PageResult pageResult = materialInventoryInboundDetailService.getMaterialInventoryInboundDetailPageList(pageReqVO); + return success(BeanUtils.toBean(pageResult, MaterialInventoryInboundDetailRespVO.class)); + } +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialInventoryOutboundController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialInventoryOutboundController.java new file mode 100644 index 0000000..4c46325 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialInventoryOutboundController.java @@ -0,0 +1,126 @@ +package com.zt.plat.module.qms.resource.material.controller.admin; + +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryOutboundPageReqVO; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryOutboundRespVO; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryOutboundSaveReqVO; +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.MaterialInventoryOutboundDO; +import com.zt.plat.module.qms.resource.material.service.MaterialInventoryOutboundService; + +@Tag(name = "管理后台 - 出库") +@RestController +@RequestMapping("/qms/resource/material-inventory-outbound") +@Validated +@FileUploadController(source = "qms.materialinventoryoutbound") +public class MaterialInventoryOutboundController extends AbstractFileUploadController implements BusinessControllerMarker{ + + static { + FileUploadController annotation = MaterialInventoryOutboundController.class.getAnnotation(FileUploadController.class); + if (annotation != null) { + setFileUploadInfo(annotation); + } + } + + @Resource + private MaterialInventoryOutboundService materialInventoryOutboundService; + + @PostMapping("/create") + @Operation(summary = "创建出库") + @PreAuthorize("@ss.hasPermission('qms:material-inventory-outbound:create')") + public CommonResult createMaterialInventoryOutbound(@Valid @RequestBody MaterialInventoryOutboundSaveReqVO createReqVO) { + return success(materialInventoryOutboundService.createMaterialInventoryOutbound(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新出库") + @PreAuthorize("@ss.hasPermission('qms:material-inventory-outbound:update')") + public CommonResult updateMaterialInventoryOutbound(@Valid @RequestBody MaterialInventoryOutboundSaveReqVO updateReqVO) { + materialInventoryOutboundService.updateMaterialInventoryOutbound(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除出库") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('qms:material-inventory-outbound:delete')") + public CommonResult deleteMaterialInventoryOutbound(@RequestParam("id") Long id) { + materialInventoryOutboundService.deleteMaterialInventoryOutbound(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除出库") + @PreAuthorize("@ss.hasPermission('qms:material-inventory-outbound:delete')") + public CommonResult deleteMaterialInventoryOutboundList(@RequestBody BatchDeleteReqVO req) { + materialInventoryOutboundService.deleteMaterialInventoryOutboundListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得出库") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('qms:material-inventory-outbound:query')") + public CommonResult getMaterialInventoryOutbound(@RequestParam("id") Long id) { + MaterialInventoryOutboundDO materialInventoryOutbound = materialInventoryOutboundService.getMaterialInventoryOutbound(id); + return success(BeanUtils.toBean(materialInventoryOutbound, MaterialInventoryOutboundRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得出库分页") + @PreAuthorize("@ss.hasPermission('qms:material-inventory-outbound:query')") + public CommonResult> getMaterialInventoryOutboundPage(@Valid MaterialInventoryOutboundPageReqVO pageReqVO) { + PageResult pageResult = materialInventoryOutboundService.getMaterialInventoryOutboundPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, MaterialInventoryOutboundRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出出库 Excel") + @PreAuthorize("@ss.hasPermission('qms:material-inventory-outbound:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportMaterialInventoryOutboundExcel(@Valid MaterialInventoryOutboundPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = materialInventoryOutboundService.getMaterialInventoryOutboundPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "出库.xls", "数据", MaterialInventoryOutboundRespVO.class, + BeanUtils.toBean(list, MaterialInventoryOutboundRespVO.class)); + } + + + @PostMapping("/create-all") + @Operation(summary = "创建出库") + @PreAuthorize("@ss.hasPermission('qms:material-inventory-outbound:create')") + public CommonResult createMaterialInventoryOutboundAll(@Valid @RequestBody MaterialInventoryOutboundSaveReqVO createReqVO) { + return success(materialInventoryOutboundService.createMaterialInventoryOutboundAll(createReqVO)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialInventoryOutboundDetailController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialInventoryOutboundDetailController.java new file mode 100644 index 0000000..eef01d7 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialInventoryOutboundDetailController.java @@ -0,0 +1,118 @@ +package com.zt.plat.module.qms.resource.material.controller.admin; + +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryOutboundDetailPageReqVO; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryOutboundDetailRespVO; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryOutboundDetailSaveReqVO; +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.MaterialInventoryOutboundDetailDO; +import com.zt.plat.module.qms.resource.material.service.MaterialInventoryOutboundDetailService; + +@Tag(name = "管理后台 - 出库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等") +@RestController +@RequestMapping("/qms/material-inventory-outbound-detail") +@Validated +@FileUploadController(source = "qms.materialinventoryoutbounddetail") +public class MaterialInventoryOutboundDetailController extends AbstractFileUploadController implements BusinessControllerMarker{ + + static { + FileUploadController annotation = MaterialInventoryOutboundDetailController.class.getAnnotation(FileUploadController.class); + if (annotation != null) { + setFileUploadInfo(annotation); + } + } + + @Resource + private MaterialInventoryOutboundDetailService materialInventoryOutboundDetailService; + + @PostMapping("/create") + @Operation(summary = "创建出库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等") + @PreAuthorize("@ss.hasPermission('qms:material-inventory-outbound-detail:create')") + public CommonResult createMaterialInventoryOutboundDetail(@Valid @RequestBody MaterialInventoryOutboundDetailSaveReqVO createReqVO) { + return success(materialInventoryOutboundDetailService.createMaterialInventoryOutboundDetail(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新出库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等") + @PreAuthorize("@ss.hasPermission('qms:material-inventory-outbound-detail:update')") + public CommonResult updateMaterialInventoryOutboundDetail(@Valid @RequestBody MaterialInventoryOutboundDetailSaveReqVO updateReqVO) { + materialInventoryOutboundDetailService.updateMaterialInventoryOutboundDetail(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除出库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('qms:material-inventory-outbound-detail:delete')") + public CommonResult deleteMaterialInventoryOutboundDetail(@RequestParam("id") Long id) { + materialInventoryOutboundDetailService.deleteMaterialInventoryOutboundDetail(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除出库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等") + @PreAuthorize("@ss.hasPermission('qms:material-inventory-outbound-detail:delete')") + public CommonResult deleteMaterialInventoryOutboundDetailList(@RequestBody BatchDeleteReqVO req) { + materialInventoryOutboundDetailService.deleteMaterialInventoryOutboundDetailListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得出库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('qms:material-inventory-outbound-detail:query')") + public CommonResult getMaterialInventoryOutboundDetail(@RequestParam("id") Long id) { + MaterialInventoryOutboundDetailDO materialInventoryOutboundDetail = materialInventoryOutboundDetailService.getMaterialInventoryOutboundDetail(id); + return success(BeanUtils.toBean(materialInventoryOutboundDetail, MaterialInventoryOutboundDetailRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得出库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等分页") + @PreAuthorize("@ss.hasPermission('qms:material-inventory-outbound-detail:query')") + public CommonResult> getMaterialInventoryOutboundDetailPage(@Valid MaterialInventoryOutboundDetailPageReqVO pageReqVO) { + PageResult pageResult = materialInventoryOutboundDetailService.getMaterialInventoryOutboundDetailPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, MaterialInventoryOutboundDetailRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出出库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等 Excel") + @PreAuthorize("@ss.hasPermission('qms:material-inventory-outbound-detail:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportMaterialInventoryOutboundDetailExcel(@Valid MaterialInventoryOutboundDetailPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = materialInventoryOutboundDetailService.getMaterialInventoryOutboundDetailPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "出库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等.xls", "数据", MaterialInventoryOutboundDetailRespVO.class, + BeanUtils.toBean(list, MaterialInventoryOutboundDetailRespVO.class)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialLifecycleController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialLifecycleController.java new file mode 100644 index 0000000..9558127 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialLifecycleController.java @@ -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 createMaterialLifecycle(@Valid @RequestBody MaterialLifecycleSaveReqVO createReqVO) { + return success(materialLifecycleService.createMaterialLifecycle(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新物料通用流程") + @PreAuthorize("@ss.hasPermission('qms:material-lifecycle:update')") + public CommonResult 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 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 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 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> getMaterialLifecyclePage(@Valid MaterialLifecyclePageReqVO pageReqVO) { + PageResult 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 list = materialLifecycleService.getMaterialLifecyclePage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "物料通用流程.xls", "数据", MaterialLifecycleRespVO.class, + BeanUtils.toBean(list, MaterialLifecycleRespVO.class)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialLifecycleDetailController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialLifecycleDetailController.java new file mode 100644 index 0000000..e9a4e38 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialLifecycleDetailController.java @@ -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 createMaterialLifecycleDetail(@Valid @RequestBody MaterialLifecycleDetailSaveReqVO createReqVO) { + return success(materialLifecycleDetailService.createMaterialLifecycleDetail(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新物料通用流程明细,对应生命周期的明细") + @PreAuthorize("@ss.hasPermission('qms:material-lifecycle-detail:update')") + public CommonResult 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 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 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 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> getMaterialLifecycleDetailPage(@Valid MaterialLifecycleDetailPageReqVO pageReqVO) { + PageResult 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 list = materialLifecycleDetailService.getMaterialLifecycleDetailPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "物料通用流程明细,对应生命周期的明细.xls", "数据", MaterialLifecycleDetailRespVO.class, + BeanUtils.toBean(list, MaterialLifecycleDetailRespVO.class)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialLocationController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialLocationController.java new file mode 100644 index 0000000..c0f9fe9 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialLocationController.java @@ -0,0 +1,118 @@ +package com.zt.plat.module.qms.resource.material.controller.admin; + +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialLocationPageReqVO; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialLocationRespVO; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialLocationSaveReqVO; +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.MaterialLocationDO; +import com.zt.plat.module.qms.resource.material.service.MaterialLocationService; + +@Tag(name = "管理后台 - 存放位置") +@RestController +@RequestMapping("/qms/material-location") +@Validated +@FileUploadController(source = "qms.materiallocation") +public class MaterialLocationController extends AbstractFileUploadController implements BusinessControllerMarker{ + + static { + FileUploadController annotation = MaterialLocationController.class.getAnnotation(FileUploadController.class); + if (annotation != null) { + setFileUploadInfo(annotation); + } + } + + @Resource + private MaterialLocationService materialLocationService; + + @PostMapping("/create") + @Operation(summary = "创建存放位置") + @PreAuthorize("@ss.hasPermission('qms:material-location:create')") + public CommonResult createMaterialLocation(@Valid @RequestBody MaterialLocationSaveReqVO createReqVO) { + return success(materialLocationService.createMaterialLocation(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新存放位置") + @PreAuthorize("@ss.hasPermission('qms:material-location:update')") + public CommonResult updateMaterialLocation(@Valid @RequestBody MaterialLocationSaveReqVO updateReqVO) { + materialLocationService.updateMaterialLocation(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除存放位置") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('qms:material-location:delete')") + public CommonResult deleteMaterialLocation(@RequestParam("id") Long id) { + materialLocationService.deleteMaterialLocation(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除存放位置") + @PreAuthorize("@ss.hasPermission('qms:material-location:delete')") + public CommonResult deleteMaterialLocationList(@RequestBody BatchDeleteReqVO req) { + materialLocationService.deleteMaterialLocationListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得存放位置") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('qms:material-location:query')") + public CommonResult getMaterialLocation(@RequestParam("id") Long id) { + MaterialLocationDO materialLocation = materialLocationService.getMaterialLocation(id); + return success(BeanUtils.toBean(materialLocation, MaterialLocationRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得存放位置分页") + @PreAuthorize("@ss.hasPermission('qms:material-location:query')") + public CommonResult> getMaterialLocationPage(@Valid MaterialLocationPageReqVO pageReqVO) { + PageResult pageResult = materialLocationService.getMaterialLocationPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, MaterialLocationRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出存放位置 Excel") + @PreAuthorize("@ss.hasPermission('qms:material-location:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportMaterialLocationExcel(@Valid MaterialLocationPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = materialLocationService.getMaterialLocationPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "存放位置.xls", "数据", MaterialLocationRespVO.class, + BeanUtils.toBean(list, MaterialLocationRespVO.class)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialBatchAssignPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialBatchAssignPageReqVO.java new file mode 100644 index 0000000..84a398f --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialBatchAssignPageReqVO.java @@ -0,0 +1,43 @@ +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 MaterialBatchAssignPageReqVO extends PageParam { + + @Schema(description = "源批次ID", example = "23099") + private Long batchId; + + @Schema(description = "产品id", example = "10774") + private String productId; + + @Schema(description = "库房ID", example = "24720") + private Long warehouseId; + + @Schema(description = "数量") + private String inboundQuantity; + + @Schema(description = "暂存位置记录", example = "https://www.iocoder.cn") + private String url; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "实例ID") + private String materialInfomationId; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialBatchAssignRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialBatchAssignRespVO.java new file mode 100644 index 0000000..4467bc7 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialBatchAssignRespVO.java @@ -0,0 +1,50 @@ +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 MaterialBatchAssignRespVO { + + @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "15114") + @ExcelProperty("主键") + private Long id; + + @Schema(description = "源批次ID", example = "23099") + @ExcelProperty("源批次ID") + private Long batchId; + + @Schema(description = "产品id", example = "10774") + @ExcelProperty("产品id") + private String productId; + + @Schema(description = "库房ID", example = "24720") + @ExcelProperty("库房ID") + private Long warehouseId; + + @Schema(description = "数量") + @ExcelProperty("数量") + private String inboundQuantity; + + @Schema(description = "暂存位置记录", example = "https://www.iocoder.cn") + @ExcelProperty("暂存位置记录") + private String url; + + @Schema(description = "所属部门") + @ExcelProperty("所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + @ExcelProperty("备注") + private String remark; + + @Schema(description = "创建时间") + @ExcelProperty("创建时间") + private LocalDateTime createTime; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialBatchAssignSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialBatchAssignSaveReqVO.java new file mode 100644 index 0000000..50c068b --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialBatchAssignSaveReqVO.java @@ -0,0 +1,34 @@ +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 MaterialBatchAssignSaveReqVO { + + @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "15114") + private Long id; + + @Schema(description = "源批次ID",requiredMode = Schema.RequiredMode.REQUIRED, example = "23099") + private Long batchId; + + @Schema(description = "产品id", example = "10774") + private String productId; + + @Schema(description = "库房ID",requiredMode = Schema.RequiredMode.REQUIRED, example = "24720") + private Long warehouseId; + + @Schema(description = "数量") + private String inboundQuantity; + + @Schema(description = "暂存位置记录", example = "https://www.iocoder.cn") + private String url; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialBatchPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialBatchPageReqVO.java new file mode 100644 index 0000000..5859a1a --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialBatchPageReqVO.java @@ -0,0 +1,51 @@ +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 MaterialBatchPageReqVO extends PageParam { + + @Schema(description = "产品id", example = "16851") + private Long productId; + + @Schema(description = "批次编号") + private String batchNo; + + @Schema(description = "总数量") + private String inboundQuantity; + + @Schema(description = "存放位置描述") + private String location; + + @Schema(description = "供应商id", example = "6956") + private Long supplierId; + + @Schema(description = "生产日期") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] manufacturerDate; + + @Schema(description = "到期日期") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] dueDate; + + @Schema(description = "验收状态", example = "1") + private String acceptanceStatus; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialBatchRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialBatchRespVO.java new file mode 100644 index 0000000..b16bce3 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialBatchRespVO.java @@ -0,0 +1,62 @@ +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 MaterialBatchRespVO { + + @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "25470") + @ExcelProperty("主键") + private Long id; + + @Schema(description = "产品id", example = "16851") + @ExcelProperty("产品id") + private Long productId; + + @Schema(description = "批次编号") + @ExcelProperty("批次编号") + private String batchNo; + + @Schema(description = "总数量") + @ExcelProperty("总数量") + private String inboundQuantity; + + @Schema(description = "存放位置描述") + @ExcelProperty("存放位置描述") + private String location; + + @Schema(description = "供应商id", example = "6956") + @ExcelProperty("供应商id") + private Long supplierId; + + @Schema(description = "生产日期") + @ExcelProperty("生产日期") + private LocalDateTime manufacturerDate; + + @Schema(description = "到期日期") + @ExcelProperty("到期日期") + private LocalDateTime dueDate; + + @Schema(description = "验收状态", example = "1") + @ExcelProperty("验收状态") + private String acceptanceStatus; + + @Schema(description = "所属部门") + @ExcelProperty("所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + @ExcelProperty("备注") + private String remark; + + @Schema(description = "创建时间") + @ExcelProperty("创建时间") + private LocalDateTime createTime; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialBatchSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialBatchSaveReqVO.java new file mode 100644 index 0000000..f4e1fca --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialBatchSaveReqVO.java @@ -0,0 +1,45 @@ +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 MaterialBatchSaveReqVO { + + @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "25470") + private Long id; + + @Schema(description = "产品id", example = "16851") + private Long productId; + + @Schema(description = "批次编号") + private String batchNo; + + @Schema(description = "总数量") + private String inboundQuantity; + + @Schema(description = "存放位置描述") + private String location; + + @Schema(description = "供应商id", example = "6956") + private Long supplierId; + + @Schema(description = "生产日期") + private LocalDateTime manufacturerDate; + + @Schema(description = "到期日期") + private LocalDateTime dueDate; + + @Schema(description = "验收状态", example = "1") + private String acceptanceStatus; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInfomationPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInfomationPageReqVO.java index 5ed177c..adbfb68 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInfomationPageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInfomationPageReqVO.java @@ -78,5 +78,8 @@ public class MaterialInfomationPageReqVO extends PageParam { @Schema(description = "大类ids") List productIds; + @Schema(description = "入库id") + private Long inventoryInboundId; + } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryCheckBatchPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryCheckBatchPageReqVO.java new file mode 100644 index 0000000..2d809ed --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryCheckBatchPageReqVO.java @@ -0,0 +1,44 @@ +package com.zt.plat.module.qms.resource.material.controller.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 MaterialInventoryCheckBatchPageReqVO extends PageParam { + + @Schema(description = "父id", example = "9310") + private Long checkId; + + @Schema(description = "盘点物料大类ID", example = "18437") + private Long checkProductId; + + @Schema(description = "盘点部门ID", example = "17789") + private Long checkDepartmentId; + + @Schema(description = "应有量") + private String expected; + + @Schema(description = "实有量") + private String actual; + + @Schema(description = "差异") + private String difference; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryCheckBatchRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryCheckBatchRespVO.java new file mode 100644 index 0000000..7b6b546 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryCheckBatchRespVO.java @@ -0,0 +1,55 @@ +package com.zt.plat.module.qms.resource.material.controller.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 MaterialInventoryCheckBatchRespVO { + + @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "12065") + @ExcelProperty("主键") + private Long id; + + @Schema(description = "父id", example = "9310") + @ExcelProperty("父id") + private Long checkId; + + @Schema(description = "盘点物料大类ID", example = "18437") + @ExcelProperty("盘点物料大类ID") + private Long checkProductId; + + @Schema(description = "盘点部门ID", example = "17789") + @ExcelProperty("盘点部门ID") + private Long checkDepartmentId; + + @Schema(description = "应有量") + @ExcelProperty("应有量") + private String expected; + + @Schema(description = "实有量") + @ExcelProperty("实有量") + private String actual; + + @Schema(description = "差异") + @ExcelProperty("差异") + private String difference; + + @Schema(description = "所属部门") + @ExcelProperty("所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + @ExcelProperty("备注") + private String remark; + + @Schema(description = "创建时间") + @ExcelProperty("创建时间") + private LocalDateTime createTime; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryCheckBatchSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryCheckBatchSaveReqVO.java new file mode 100644 index 0000000..0c5abc9 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryCheckBatchSaveReqVO.java @@ -0,0 +1,42 @@ +package com.zt.plat.module.qms.resource.material.controller.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 MaterialInventoryCheckBatchSaveReqVO { + + @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "12065") + private Long id; + + @Schema(description = "父id", example = "9310") + private Long checkId; + + @Schema(description = "盘点物料大类ID", example = "18437") + private Long checkProductId; + + @Schema(description = "盘点部门ID", example = "17789") + private Long checkDepartmentId; + + @Schema(description = "应有量") + private String expected; + + @Schema(description = "实有量") + private String actual; + + @Schema(description = "差异") + private String difference; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + + @Schema(description = "盘点明细") + private List detailList; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryCheckDetailPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryCheckDetailPageReqVO.java new file mode 100644 index 0000000..3faf5da --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryCheckDetailPageReqVO.java @@ -0,0 +1,43 @@ +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 MaterialInventoryCheckDetailPageReqVO extends PageParam { + + @Schema(description = "盘点批次id", example = "12013") + private Long checkBatchId; + + @Schema(description = "物料实例id", example = "2480") + private Long infomationId; + + @Schema(description = "是否存在") + private String present; + + @Schema(description = "当前数量") + private String currentQuantity; + + @Schema(description = "状态", example = "1") + private String status; + + @Schema(description = "处置方式,字典配置") + private String disposalMethod; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryCheckDetailRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryCheckDetailRespVO.java new file mode 100644 index 0000000..8f8bb3d --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryCheckDetailRespVO.java @@ -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; +import com.alibaba.excel.annotation.*; + +@Schema(description = "管理后台 - 库存盘点明细 Response VO") +@Data +@ExcelIgnoreUnannotated +public class MaterialInventoryCheckDetailRespVO { + + @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "16347") + @ExcelProperty("主键") + private Long id; + + @Schema(description = "盘点批次id", example = "12013") + @ExcelProperty("盘点批次id") + private Long checkBatchId; + + @Schema(description = "物料实例id", example = "2480") + @ExcelProperty("物料实例id") + private Long infomationId; + + @Schema(description = "是否存在") + @ExcelProperty("是否存在") + private String present; + + @Schema(description = "当前数量") + @ExcelProperty("当前数量") + private String currentQuantity; + + @Schema(description = "状态", example = "1") + @ExcelProperty("状态") + private String status; + + @Schema(description = "处置方式,字典配置") + @ExcelProperty("处置方式,字典配置") + private String disposalMethod; + + @Schema(description = "所属部门") + @ExcelProperty("所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + @ExcelProperty("备注") + private String remark; + + @Schema(description = "创建时间") + @ExcelProperty("创建时间") + private LocalDateTime createTime; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryCheckDetailSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryCheckDetailSaveReqVO.java new file mode 100644 index 0000000..8fbdd90 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryCheckDetailSaveReqVO.java @@ -0,0 +1,37 @@ +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 MaterialInventoryCheckDetailSaveReqVO { + + @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "16347") + private Long id; + + @Schema(description = "盘点批次id", example = "12013") + private Long checkBatchId; + + @Schema(description = "物料实例id", example = "2480") + private Long infomationId; + + @Schema(description = "是否存在") + private String present; + + @Schema(description = "当前数量") + private String currentQuantity; + + @Schema(description = "状态", example = "1") + private String status; + + @Schema(description = "处置方式,字典配置") + private String disposalMethod; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryCheckPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryCheckPageReqVO.java new file mode 100644 index 0000000..679b429 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryCheckPageReqVO.java @@ -0,0 +1,59 @@ +package com.zt.plat.module.qms.resource.material.controller.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 MaterialInventoryCheckPageReqVO extends PageParam { + + @Schema(description = "标题") + private String title; + + @Schema(description = "业务类型", example = "2") + private String businessType; + + @Schema(description = "业务类型编码") + private String businessTypeCode; + + @Schema(description = "申请人") + private String applyUser; + + @Schema(description = "申请人id", example = "31128") + private Long applyUserId; + + @Schema(description = "申请部门") + private String applyDepartment; + + @Schema(description = "申请部门id", example = "16511") + private Long applyDepartmentId; + + @Schema(description = "申请时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] applyTime; + + @Schema(description = "流程实例id", example = "6407") + 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; + + @Schema(description = "主键") + private Long id; +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryCheckRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryCheckRespVO.java new file mode 100644 index 0000000..2e1821d --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryCheckRespVO.java @@ -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.util.*; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; +import com.alibaba.excel.annotation.*; + +@Schema(description = "管理后台 - 库存盘点 Response VO") +@Data +@ExcelIgnoreUnannotated +public class MaterialInventoryCheckRespVO { + + @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "2275") + @ExcelProperty("主键") + private Long id; + + @Schema(description = "标题") + @ExcelProperty("标题") + private String title; + + @Schema(description = "业务类型", example = "2") + @ExcelProperty("业务类型") + private String businessType; + + @Schema(description = "业务类型编码") + @ExcelProperty("业务类型编码") + private String businessTypeCode; + + @Schema(description = "申请人") + @ExcelProperty("申请人") + private String applyUser; + + @Schema(description = "申请人id", example = "31128") + @ExcelProperty("申请人id") + private Long applyUserId; + + @Schema(description = "申请部门") + @ExcelProperty("申请部门") + private String applyDepartment; + + @Schema(description = "申请部门id", example = "16511") + @ExcelProperty("申请部门id") + private Long applyDepartmentId; + + @Schema(description = "申请时间") + @ExcelProperty("申请时间") + private LocalDateTime applyTime; + + @Schema(description = "流程实例id", example = "6407") + @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; + + @Schema(description = "盘点项") + @ExcelProperty("盘点项") + private List batchList; +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryCheckSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryCheckSaveReqVO.java new file mode 100644 index 0000000..4e794ab --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryCheckSaveReqVO.java @@ -0,0 +1,56 @@ +package com.zt.plat.module.qms.resource.material.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import jakarta.validation.constraints.*; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +@Schema(description = "管理后台 - 库存盘点新增/修改 Request VO") +@Data +public class MaterialInventoryCheckSaveReqVO { + + @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "2275") + private Long id; + + @Schema(description = "标题") + private String title; + + @Schema(description = "业务类型", example = "2") + private String businessType; + + @Schema(description = "业务类型编码") + private String businessTypeCode; + + @Schema(description = "申请人") + private String applyUser; + + @Schema(description = "申请人id", example = "31128") + private Long applyUserId; + + @Schema(description = "申请部门") + private String applyDepartment; + + @Schema(description = "申请部门id", example = "16511") + private Long applyDepartmentId; + + @Schema(description = "申请时间") + private LocalDateTime applyTime; + + @Schema(description = "流程实例id", example = "6407") + private String flowInstanceId; + + @Schema(description = "流程审批状态", example = "2") + private String flowStatus; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + + @Schema(description = "盘点项") + private List batchList; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryInboundDetailPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryInboundDetailPageReqVO.java new file mode 100644 index 0000000..1360453 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryInboundDetailPageReqVO.java @@ -0,0 +1,56 @@ +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 MaterialInventoryInboundDetailPageReqVO extends PageParam { + + @Schema(description = "入库单ID", example = "8031") + private Long inboundId; + + @Schema(description = "分发批次id", example = "24731") + private Long batchAssignId; + + @Schema(description = "入库方式") + private String inboundWay; + + @Schema(description = "物料实例ID", example = "23510") + private Long materialInfomationId; + + @Schema(description = "入库人", example = "赵六") + private String inboundUserName; + + @Schema(description = "入库人id", example = "8857") + private Long inboundUserId; + + @Schema(description = "入库人部门", example = "芋艿") + private String inboundDepartmentName; + + @Schema(description = "入库人部门id", example = "8008") + private Long inboundDepartmentId; + + @Schema(description = "入库时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] inboundTime; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "物料大类Id") + private Long productId; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryInboundDetailRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryInboundDetailRespVO.java new file mode 100644 index 0000000..654a410 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryInboundDetailRespVO.java @@ -0,0 +1,68 @@ +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 MaterialInventoryInboundDetailRespVO { + + @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "20724") + @ExcelProperty("主键") + private Long id; + + @Schema(description = "入库单ID", example = "8031") + @ExcelProperty("入库单ID") + private Long inboundId; + + @Schema(description = "分发批次id", example = "24731") + @ExcelProperty("分发批次id") + private Long batchAssignId; + + @Schema(description = "入库方式") + @ExcelProperty("入库方式") + private String inboundWay; + + @Schema(description = "物料实例ID", example = "23510") + @ExcelProperty("物料实例ID") + private Long materialInfomationId; + + @Schema(description = "入库人", example = "赵六") + @ExcelProperty("入库人") + private String inboundUserName; + + @Schema(description = "入库人id", example = "8857") + @ExcelProperty("入库人id") + private Long inboundUserId; + + @Schema(description = "入库人部门", example = "芋艿") + @ExcelProperty("入库人部门") + private String inboundDepartmentName; + + @Schema(description = "入库人部门id", example = "8008") + @ExcelProperty("入库人部门id") + private Long inboundDepartmentId; + + @Schema(description = "入库时间") + @ExcelProperty("入库时间") + private LocalDateTime inboundTime; + + @Schema(description = "所属部门") + @ExcelProperty("所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + @ExcelProperty("备注") + private String remark; + + @Schema(description = "创建时间") + @ExcelProperty("创建时间") + private LocalDateTime createTime; + + private Long productId; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryInboundDetailSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryInboundDetailSaveReqVO.java new file mode 100644 index 0000000..ff8aa08 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryInboundDetailSaveReqVO.java @@ -0,0 +1,64 @@ +package com.zt.plat.module.qms.resource.material.controller.vo; + +import com.baomidou.mybatisplus.annotation.TableField; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; + +import java.time.LocalDateTime; + +@Schema(description = "管理后台 - 入库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等新增/修改 Request VO") +@Data +public class MaterialInventoryInboundDetailSaveReqVO { + + @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "20724") + private Long id; + + @Schema(description = "入库单ID", example = "8031") + private Long inboundId; + + @Schema(description = "分发批次id", example = "24731") + private Long batchAssignId; + + @Schema(description = "入库方式") + private String inboundWay; + + @Schema(description = "物料实例ID", example = "23510") + private Long materialInfomationId; + + @Schema(description = "入库人", example = "赵六") + private String inboundUserName; + + @Schema(description = "入库人id", example = "8857") + private Long inboundUserId; + + @Schema(description = "入库人部门", example = "芋艿") + private String inboundDepartmentName; + + @Schema(description = "入库人部门id", example = "8008") + private Long inboundDepartmentId; + + @Schema(description = "入库时间") + private LocalDateTime inboundTime; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + + @Schema(description = "申请数量") + private Long quantity; + + /** + * 存放位置 + */ + @TableField("LOC_ID") + private String locationId; + + /** + * 物料大类id + */ + @TableField("PDT_ID") + private Long productId; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryInboundPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryInboundPageReqVO.java new file mode 100644 index 0000000..79a9cff --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryInboundPageReqVO.java @@ -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 MaterialInventoryInboundPageReqVO extends PageParam { + + @Schema(description = "标题") + private String title; + + @Schema(description = "业务类型1.验收上架,【字典】【jy_material_in_bsn_type】领用出库、盘亏出库、损坏出库等", example = "1") + private String businessType; + + @Schema(description = "业务类型编码") + private String businessTypeCode; + + @Schema(description = "申请人") + private String applyUser; + + @Schema(description = "申请人id", example = "30960") + private Long applyUserId; + + @Schema(description = "申请部门") + private String applyDepartment; + + @Schema(description = "申请部门id", example = "666") + private Long applyDepartmentId; + + @Schema(description = "申请时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] applyTime; + + @Schema(description = "流程实例id", example = "654") + private String flowInstanceId; + + @Schema(description = "流程审批状态", example = "1") + private String flowStatus; + + @Schema(description = "意见json") + private String commentJson; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryInboundRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryInboundRespVO.java new file mode 100644 index 0000000..7240943 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryInboundRespVO.java @@ -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 MaterialInventoryInboundRespVO { + + @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "15437") + @ExcelProperty("主键") + private Long id; + + @Schema(description = "标题") + @ExcelProperty("标题") + private String title; + + @Schema(description = "业务类型1.验收上架,【字典】【jy_material_in_bsn_type】领用出库、盘亏出库、损坏出库等", example = "1") + @ExcelProperty("业务类型1.验收上架,【字典】【jy_material_in_bsn_type】领用出库、盘亏出库、损坏出库等") + private String businessType; + + @Schema(description = "业务类型编码") + @ExcelProperty("业务类型编码") + private String businessTypeCode; + + @Schema(description = "申请人") + @ExcelProperty("申请人") + private String applyUser; + + @Schema(description = "申请人id", example = "30960") + @ExcelProperty("申请人id") + private Long applyUserId; + + @Schema(description = "申请部门") + @ExcelProperty("申请部门") + private String applyDepartment; + + @Schema(description = "申请部门id", example = "666") + @ExcelProperty("申请部门id") + private Long applyDepartmentId; + + @Schema(description = "申请时间") + @ExcelProperty("申请时间") + private LocalDateTime applyTime; + + @Schema(description = "流程实例id", example = "654") + @ExcelProperty("流程实例id") + private String flowInstanceId; + + @Schema(description = "流程审批状态", example = "1") + @ExcelProperty("流程审批状态") + private String flowStatus; + + @Schema(description = "意见json") + @ExcelProperty("意见json") + private String commentJson; + + @Schema(description = "所属部门") + @ExcelProperty("所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + @ExcelProperty("备注") + private String remark; + + @Schema(description = "创建时间") + @ExcelProperty("创建时间") + private LocalDateTime createTime; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryInboundSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryInboundSaveReqVO.java new file mode 100644 index 0000000..d2d2d4f --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryInboundSaveReqVO.java @@ -0,0 +1,59 @@ +package com.zt.plat.module.qms.resource.material.controller.vo; + +import com.baomidou.mybatisplus.annotation.TableField; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; + +import java.time.LocalDateTime; + +@Schema(description = "管理后台 - 入库新增/修改 Request VO") +@Data +public class MaterialInventoryInboundSaveReqVO { + + @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "15437") + private Long id; + + @Schema(description = "标题") + private String title; + + @Schema(description = "业务类型1.验收上架,【字典】【jy_material_in_bsn_type】领用出库、盘亏出库、损坏出库等", example = "1") + private String businessType; + + @Schema(description = "业务类型编码") + private String businessTypeCode; + + @Schema(description = "申请人") + private String applyUser; + + @Schema(description = "申请人id", example = "30960") + private Long applyUserId; + + @Schema(description = "申请部门") + private String applyDepartment; + + @Schema(description = "申请部门id", example = "666") + private Long applyDepartmentId; + + @Schema(description = "申请时间") + private LocalDateTime applyTime; + + @Schema(description = "流程实例id", example = "654") + private String flowInstanceId; + + @Schema(description = "流程审批状态", example = "1") + private String flowStatus; + + @Schema(description = "意见json") + private String commentJson; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + + @Schema(description = "详情",requiredMode = Schema.RequiredMode.REQUIRED) + private MaterialInventoryInboundDetailSaveReqVO detail; + + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryOutboundDetailPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryOutboundDetailPageReqVO.java new file mode 100644 index 0000000..6fab815 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryOutboundDetailPageReqVO.java @@ -0,0 +1,34 @@ +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 MaterialInventoryOutboundDetailPageReqVO extends PageParam { + + @Schema(description = "出库单id", example = "21793") + private Long parentId; + + @Schema(description = "物料实例id", example = "13656") + private Long infomationId; + + @Schema(description = "数量") + private String quantity; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryOutboundDetailRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryOutboundDetailRespVO.java new file mode 100644 index 0000000..7d9aeda --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryOutboundDetailRespVO.java @@ -0,0 +1,42 @@ +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 MaterialInventoryOutboundDetailRespVO { + + @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "20579") + @ExcelProperty("主键") + private Long id; + + @Schema(description = "出库单id", example = "21793") + @ExcelProperty("出库单id") + private Long parentId; + + @Schema(description = "物料实例id", example = "13656") + @ExcelProperty("物料实例id") + private Long infomationId; + + @Schema(description = "数量") + @ExcelProperty("数量") + private String quantity; + + @Schema(description = "所属部门") + @ExcelProperty("所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + @ExcelProperty("备注") + private String remark; + + @Schema(description = "创建时间") + @ExcelProperty("创建时间") + private LocalDateTime createTime; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryOutboundDetailSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryOutboundDetailSaveReqVO.java new file mode 100644 index 0000000..f935063 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryOutboundDetailSaveReqVO.java @@ -0,0 +1,28 @@ +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 MaterialInventoryOutboundDetailSaveReqVO { + + @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "20579") + private Long id; + + @Schema(description = "出库单id", example = "21793") + private Long parentId; + + @Schema(description = "物料实例id", example = "13656") + private Long infomationId; + + @Schema(description = "数量") + private String quantity; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryOutboundPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryOutboundPageReqVO.java new file mode 100644 index 0000000..bb2f7fd --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryOutboundPageReqVO.java @@ -0,0 +1,65 @@ +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 MaterialInventoryOutboundPageReqVO extends PageParam { + + @Schema(description = "标题") + private String title; + + @Schema(description = "业务类型,【字典】【jy_material_out_bsn_type】领用出库、盘亏出库、损坏出库等", example = "1") + private String businessType; + + @Schema(description = "业务类型编码") + private String businessTypeCode; + + @Schema(description = "申请人") + private String applyUser; + + @Schema(description = "申请人id", example = "22585") + private Long applyUserId; + + @Schema(description = "申请部门") + private String applyDepartment; + + @Schema(description = "申请部门id", example = "22046") + private Long applyDepartmentId; + + @Schema(description = "申请时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] applyTime; + + @Schema(description = "监督人") + private String checkUser; + + @Schema(description = "监督人id", example = "30131") + private Long checkUserId; + + @Schema(description = "流程实例id", example = "4828") + private String flowInstanceId; + + @Schema(description = "意见json") + private String commentJson; + + @Schema(description = "流程审批状态", example = "1") + 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; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryOutboundRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryOutboundRespVO.java new file mode 100644 index 0000000..7833d9f --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryOutboundRespVO.java @@ -0,0 +1,87 @@ +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 java.util.List; + +import com.alibaba.excel.annotation.*; + +@Schema(description = "管理后台 - 出库 Response VO") +@Data +@ExcelIgnoreUnannotated +public class MaterialInventoryOutboundRespVO { + + @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "28833") + @ExcelProperty("主键") + private Long id; + + @Schema(description = "标题") + @ExcelProperty("标题") + private String title; + + @Schema(description = "业务类型,【字典】【jy_material_out_bsn_type】领用出库、盘亏出库、损坏出库等", example = "1") + @ExcelProperty("业务类型,【字典】【jy_material_out_bsn_type】领用出库、盘亏出库、损坏出库等") + private String businessType; + + @Schema(description = "业务类型编码") + @ExcelProperty("业务类型编码") + private String businessTypeCode; + + @Schema(description = "申请人") + @ExcelProperty("申请人") + private String applyUser; + + @Schema(description = "申请人id", example = "22585") + @ExcelProperty("申请人id") + private Long applyUserId; + + @Schema(description = "申请部门") + @ExcelProperty("申请部门") + private String applyDepartment; + + @Schema(description = "申请部门id", example = "22046") + @ExcelProperty("申请部门id") + private Long applyDepartmentId; + + @Schema(description = "申请时间") + @ExcelProperty("申请时间") + private LocalDateTime applyTime; + + @Schema(description = "监督人") + @ExcelProperty("监督人") + private String checkUser; + + @Schema(description = "监督人id", example = "30131") + @ExcelProperty("监督人id") + private Long checkUserId; + + @Schema(description = "流程实例id", example = "4828") + @ExcelProperty("流程实例id") + private String flowInstanceId; + + @Schema(description = "意见json") + @ExcelProperty("意见json") + private String commentJson; + + @Schema(description = "流程审批状态", example = "1") + @ExcelProperty("流程审批状态") + private String flowStatus; + + @Schema(description = "所属部门") + @ExcelProperty("所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + @ExcelProperty("备注") + private String remark; + + @Schema(description = "创建时间") + @ExcelProperty("创建时间") + private LocalDateTime createTime; + + @Schema(description = "出库明细") + private List detailReqVoList; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryOutboundSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryOutboundSaveReqVO.java new file mode 100644 index 0000000..d18d512 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryOutboundSaveReqVO.java @@ -0,0 +1,64 @@ +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 java.util.List; + +@Schema(description = "管理后台 - 出库新增/修改 Request VO") +@Data +public class MaterialInventoryOutboundSaveReqVO { + + @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "28833") + private Long id; + + @Schema(description = "标题") + private String title; + + @Schema(description = "业务类型,【字典】【jy_material_out_bsn_type】领用出库、盘亏出库、损坏出库等", example = "1") + private String businessType; + + @Schema(description = "业务类型编码") + private String businessTypeCode; + + @Schema(description = "申请人") + private String applyUser; + + @Schema(description = "申请人id", example = "22585") + private Long applyUserId; + + @Schema(description = "申请部门") + private String applyDepartment; + + @Schema(description = "申请部门id", example = "22046") + private Long applyDepartmentId; + + @Schema(description = "申请时间") + private LocalDateTime applyTime; + + @Schema(description = "监督人") + private String checkUser; + + @Schema(description = "监督人id", example = "30131") + private Long checkUserId; + + @Schema(description = "流程实例id", example = "4828") + private String flowInstanceId; + + @Schema(description = "意见json") + private String commentJson; + + @Schema(description = "流程审批状态", example = "1") + private String flowStatus; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + + + @Schema(description = "出库明细") + private List detailSaveReqVoList; +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryPageReqVO.java new file mode 100644 index 0000000..9ad6f34 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryPageReqVO.java @@ -0,0 +1,102 @@ +package com.zt.plat.module.qms.resource.material.controller.vo; + +import com.alibaba.excel.annotation.ExcelProperty; +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.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 MaterialInventoryPageReqVO extends PageParam { + + @Schema(description = "主键", requiredMode = Schema.RequiredMode.AUTO, example = "32133") + private Long id; + + @Schema(description = "父id", example = "6098") + private Long parentId; + + @Schema(description = "id路径") + private String idPath; + + @Schema(description = "节点类型,分类|产品", example = "2") + private String nodeType; + + @Schema(description = "名称", example = "张三") + private String name; + + @Schema(description = "其他配置") + private String customConfig; + + @Schema(description = "自定义表单") + private String customForm; + + @Schema(description = "扩展数据") + private String customData; + + @Schema(description = "标签") + private String tag; + + @Schema(description = "标签模板") + private String labelTemplateKey; + + @Schema(description = "型号") + private String modelNo; + + @Schema(description = "规格") + private String specification; + + @Schema(description = "技术参数") + private String parameter; + + @Schema(description = "制造商") + private String manufacturer; + + @Schema(description = "单位") + private String unit; + + @Schema(description = "允许按量领取") + private String enablePartial; + + @Schema(description = "保质期(天)") + private Integer due; + + @Schema(description = "开封后保质期是否变化") + private String openDueFlag; + + @Schema(description = "开封后保质期(天)") + private Integer openDueAfter; + + @Schema(description = "是否危险品") + private String hazardous; + + @Schema(description = "是否标准溶液") + private String standardSolutionFlag; + + @Schema(description = "是否标准物质") + private String standardMaterialFlag; + + @Schema(description = "复标周期,单位:天。小于等于0-不复标") + private Integer reviewDue; + + @Schema(description = "排序号") + private Integer sortNo; + + @Schema(description = "禁用") + private String cancelFlag; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryRespVO.java new file mode 100644 index 0000000..efd5ab1 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInventoryRespVO.java @@ -0,0 +1,143 @@ +package com.zt.plat.module.qms.resource.material.controller.vo; + +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import com.baomidou.mybatisplus.annotation.TableField; +import com.zt.plat.framework.common.pojo.PageParam; +import com.zt.plat.module.qms.core.aspect.annotation.Dict; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.time.LocalDateTime; + +@Schema(description = "管理后台 - 库存列表 Response VO") +@Data +@ExcelIgnoreUnannotated +public class MaterialInventoryRespVO extends PageParam { + + @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "32133") + @ExcelProperty("主键") + private Long id; + + @Schema(description = "父id", example = "6098") + @ExcelProperty("父id") + private Long parentId; + + @Schema(description = "id路径") + @ExcelProperty("id路径") + private String idPath; + + @Schema(description = "节点类型,分类|产品", example = "2") + @ExcelProperty("节点类型,分类|产品") + private String nodeType; + + @Schema(description = "名称", example = "张三") + @ExcelProperty("名称") + private String name; + + @Schema(description = "其他配置") + @ExcelProperty("其他配置") + private String customConfig; + + @Schema(description = "自定义表单") + @ExcelProperty("自定义表单") + private String customForm; + + @Schema(description = "扩展数据") + @ExcelProperty("扩展数据") + private String customData; + + @Schema(description = "标签") + @ExcelProperty("标签") + private String tag; + + @Schema(description = "标签模板") + @ExcelProperty("标签模板") + private String labelTemplateKey; + + @Schema(description = "型号") + @ExcelProperty("型号") + private String modelNo; + + @Schema(description = "规格") + @ExcelProperty("规格") + private String specification; + + @Schema(description = "技术参数") + @ExcelProperty("技术参数") + private String parameter; + + @Schema(description = "制造商") + @ExcelProperty("制造商") + private String manufacturer; + + @Schema(description = "单位") + @ExcelProperty("单位") + private String unit; + + @Schema(description = "允许按量领取") + @ExcelProperty("允许按量领取") + @Dict(dicCode = "yes_or_no") + private String enablePartial; + + @Schema(description = "保质期(天)") + @ExcelProperty("保质期(天)") + private Integer due; + + @Schema(description = "开封后保质期是否变化") + @ExcelProperty("开封后保质期是否变化") + @Dict(dicCode = "yes_or_no") + private String openDueFlag; + + @Schema(description = "开封后保质期(天)") + @ExcelProperty("开封后保质期(天)") + private Integer openDueAfter; + + @Schema(description = "是否危险品") + @ExcelProperty("是否危险品") + @Dict(dicCode = "yes_or_no") + private String hazardous; + + @Schema(description = "是否标准溶液") + @ExcelProperty("是否标准溶液") + @Dict(dicCode = "yes_or_no") + private String standardSolutionFlag; + + @Schema(description = "是否标准物质") + @ExcelProperty("是否标准物质") + @Dict(dicCode = "yes_or_no") + private String standardMaterialFlag; + + @Schema(description = "复标周期,单位:天。小于等于0-不复标") + @ExcelProperty("复标周期") + private Integer reviewDue; + + @Schema(description = "排序号") + @ExcelProperty("排序号") + private Integer sortNo; + + @Schema(description = "禁用") + @ExcelProperty("禁用") + private String cancelFlag; + + @Schema(description = "所属部门") + @ExcelProperty("所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + @ExcelProperty("备注") + private String remark; + + @Schema(description = "创建时间") + @ExcelProperty("创建时间") + private LocalDateTime createTime; + + /** + * 总数量 + */ + @TableField("INB_QTY") + @Schema(description = "库存总量") + @ExcelProperty("库存总量") + private Long inboundQuantity; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialLifecycleDetailPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialLifecycleDetailPageReqVO.java new file mode 100644 index 0000000..3c76d1d --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialLifecycleDetailPageReqVO.java @@ -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; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialLifecycleDetailRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialLifecycleDetailRespVO.java new file mode 100644 index 0000000..bfa9230 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialLifecycleDetailRespVO.java @@ -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; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialLifecycleDetailSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialLifecycleDetailSaveReqVO.java new file mode 100644 index 0000000..f10eff0 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialLifecycleDetailSaveReqVO.java @@ -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; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialLifecyclePageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialLifecyclePageReqVO.java new file mode 100644 index 0000000..1eee388 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialLifecyclePageReqVO.java @@ -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; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialLifecycleRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialLifecycleRespVO.java new file mode 100644 index 0000000..10c00c1 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialLifecycleRespVO.java @@ -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; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialLifecycleSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialLifecycleSaveReqVO.java new file mode 100644 index 0000000..d3a28c0 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialLifecycleSaveReqVO.java @@ -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; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialLocationPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialLocationPageReqVO.java new file mode 100644 index 0000000..919bb9a --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialLocationPageReqVO.java @@ -0,0 +1,40 @@ +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 MaterialLocationPageReqVO extends PageParam { + + @Schema(description = "上级id", example = "15203") + private Long parentId; + + @Schema(description = "名称", example = "赵六") + private String name; + + @Schema(description = "编码") + private String code; + + @Schema(description = "编码路径") + private String codePath; + + @Schema(description = "容量") + private String capacity; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialLocationRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialLocationRespVO.java new file mode 100644 index 0000000..1977648 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialLocationRespVO.java @@ -0,0 +1,50 @@ +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 MaterialLocationRespVO { + + @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "7748") + @ExcelProperty("主键") + private Long id; + + @Schema(description = "上级id", example = "15203") + @ExcelProperty("上级id") + private Long parentId; + + @Schema(description = "名称", example = "赵六") + @ExcelProperty("名称") + private String name; + + @Schema(description = "编码") + @ExcelProperty("编码") + private String code; + + @Schema(description = "编码路径") + @ExcelProperty("编码路径") + private String codePath; + + @Schema(description = "容量") + @ExcelProperty("容量") + private String capacity; + + @Schema(description = "所属部门") + @ExcelProperty("所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + @ExcelProperty("备注") + private String remark; + + @Schema(description = "创建时间") + @ExcelProperty("创建时间") + private LocalDateTime createTime; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialLocationSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialLocationSaveReqVO.java new file mode 100644 index 0000000..0bc7590 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialLocationSaveReqVO.java @@ -0,0 +1,34 @@ +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 MaterialLocationSaveReqVO { + + @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "7748") + private Long id; + + @Schema(description = "上级id", example = "15203") + private Long parentId; + + @Schema(description = "名称", example = "赵六") + private String name; + + @Schema(description = "编码") + private String code; + + @Schema(description = "编码路径") + private String codePath; + + @Schema(description = "容量") + private String capacity; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/dataobject/MaterialBatchAssignDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/dataobject/MaterialBatchAssignDO.java new file mode 100644 index 0000000..0cf96fc --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/dataobject/MaterialBatchAssignDO.java @@ -0,0 +1,69 @@ +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_bat_asn") +@KeySequence("t_mtrl_bat_asn_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class MaterialBatchAssignDO extends BusinessBaseDO { + + + + /** + * 主键 + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 源批次ID + */ + @TableField("BAT_ID") + private Long batchId; + /** + * 产品id + */ + @TableField("PDT_ID") + private Long productId; + /** + * 库房ID + */ + @TableField("WRH_ID") + private Long warehouseId; + /** + * 数量 + */ + @TableField("INB_QTY") + private Long inboundQuantity; + /** + * 暂存位置记录 + */ + @TableField("URL") + private String url; + /** + * 所属部门 + */ + @TableField("SYS_DEPT_CD") + private String systemDepartmentCode; + /** + * 备注 + */ + @TableField("RMK") + private String remark; + + + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/dataobject/MaterialBatchDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/dataobject/MaterialBatchDO.java new file mode 100644 index 0000000..44b4eb1 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/dataobject/MaterialBatchDO.java @@ -0,0 +1,85 @@ +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_bat") +@KeySequence("t_mtrl_bat_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class MaterialBatchDO extends BusinessBaseDO { + + + + /** + * 主键 + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 产品id + */ + @TableField("PDT_ID") + private Long productId; + /** + * 批次编号 + */ + @TableField("BAT_NO") + private String batchNo; + /** + * 总数量 + */ + @TableField("INB_QTY") + private String inboundQuantity; + /** + * 存放位置描述 + */ + @TableField("LOC") + private String location; + /** + * 供应商id + */ + @TableField("SPLR_ID") + private Long supplierId; + /** + * 生产日期 + */ + @TableField("MFR_DT") + private LocalDateTime manufacturerDate; + /** + * 到期日期 + */ + @TableField("DUE_DT") + private LocalDateTime dueDate; + /** + * 验收状态 + */ + @TableField("ACPT_STS") + private String acceptanceStatus; + /** + * 所属部门 + */ + @TableField("SYS_DEPT_CD") + private String systemDepartmentCode; + /** + * 备注 + */ + @TableField("RMK") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/dataobject/MaterialInfomationDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/dataobject/MaterialInfomationDO.java index 279150a..93a436a 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/dataobject/MaterialInfomationDO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/dataobject/MaterialInfomationDO.java @@ -121,4 +121,9 @@ public class MaterialInfomationDO extends BusinessBaseDO { @TableField("RMK") private String remark; + /** + * 库存入库id + */ + @TableField("INVT_INB_ID") + private long inventoryInboundId; } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/dataobject/MaterialInventoryCheckBatchDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/dataobject/MaterialInventoryCheckBatchDO.java new file mode 100644 index 0000000..9b07804 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/dataobject/MaterialInventoryCheckBatchDO.java @@ -0,0 +1,72 @@ +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_invt_chk_bat") +@KeySequence("t_mtrl_invt_chk_bat_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class MaterialInventoryCheckBatchDO extends BusinessBaseDO { + + + + /** + * 主键 + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 父id + */ + @TableField("CHK_ID") + private Long checkId; + /** + * 盘点物料大类ID + */ + @TableField("CHK_PDT_ID") + private Long checkProductId; + /** + * 盘点部门ID + */ + @TableField("CHK_DEPT_ID") + private Long checkDepartmentId; + /** + * 应有量 + */ + @TableField("EXPT") + private String expected; + /** + * 实有量 + */ + @TableField("ACT") + private String actual; + /** + * 差异 + */ + @TableField("DIFF") + private String difference; + /** + * 所属部门 + */ + @TableField("SYS_DEPT_CD") + private String systemDepartmentCode; + /** + * 备注 + */ + @TableField("RMK") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/dataobject/MaterialInventoryCheckDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/dataobject/MaterialInventoryCheckDO.java new file mode 100644 index 0000000..a7bd635 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/dataobject/MaterialInventoryCheckDO.java @@ -0,0 +1,95 @@ +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_invt_chk") +@KeySequence("t_mtrl_invt_chk_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class MaterialInventoryCheckDO extends BusinessBaseDO { + + + + /** + * 主键 + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 标题 + */ + @TableField("TTL") + private String title; + /** + * 业务类型 + */ + @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; + /** + * 流程实例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; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/dataobject/MaterialInventoryCheckDetailDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/dataobject/MaterialInventoryCheckDetailDO.java new file mode 100644 index 0000000..2a268c3 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/dataobject/MaterialInventoryCheckDetailDO.java @@ -0,0 +1,72 @@ +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_invt_chk_dtl") +@KeySequence("t_mtrl_invt_chk_dtl_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class MaterialInventoryCheckDetailDO extends BusinessBaseDO { + + + + /** + * 主键 + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 盘点批次id + */ + @TableField("CHK_BAT_ID") + private Long checkBatchId; + /** + * 物料实例id + */ + @TableField("INF_ID") + private Long infomationId; + /** + * 是否存在 + */ + @TableField("PRST") + private String present; + /** + * 当前数量 + */ + @TableField("CRNT_QTY") + private String currentQuantity; + /** + * 状态 + */ + @TableField("STS") + private String status; + /** + * 处置方式,字典配置 + */ + @TableField("DSPL_MTHD") + private String disposalMethod; + /** + * 所属部门 + */ + @TableField("SYS_DEPT_CD") + private String systemDepartmentCode; + /** + * 备注 + */ + @TableField("RMK") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/dataobject/MaterialInventoryDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/dataobject/MaterialInventoryDO.java new file mode 100644 index 0000000..18a099d --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/dataobject/MaterialInventoryDO.java @@ -0,0 +1,169 @@ +package com.zt.plat.module.qms.resource.material.dal.dataobject; + +import com.baomidou.mybatisplus.annotation.*; +import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; +import lombok.*; + +/** +* 物料大类 DO +* +* @author 后台管理 +*/ +@TableName("t_mtrl_pdt") +@KeySequence("t_mtrl_pdt_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class MaterialInventoryDO extends BusinessBaseDO { + + + + /** + * 主键 + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 父id + */ + @TableField("PRN_ID") + private Long parentId; + /** + * id路径 + */ + @TableField("ID_PATH") + private String idPath; + /** + * 节点类型,分类|产品 + */ + @TableField("NDE_TP") + private String nodeType; + /** + * 名称 + */ + @TableField("NAME") + private String name; + /** + * 其他配置 + */ + @TableField("CST_CFG") + private String customConfig; + /** + * 自定义表单 + */ + @TableField("CST_FORM") + private String customForm; + /** + * 扩展数据 + */ + @TableField("CST_DAT") + private String customData; + /** + * 标签 + */ + @TableField("TAG") + private String tag; + /** + * 标签模板 + */ + @TableField("LBL_TMPL_KY") + private String labelTemplateKey; + /** + * 型号 + */ + @TableField("MDL_NO") + private String modelNo; + /** + * 规格 + */ + @TableField("SPEC") + private String specification; + /** + * 技术参数 + */ + @TableField("PRM") + private String parameter; + /** + * 制造商 + */ + @TableField("MFR") + private String manufacturer; + /** + * 单位 + */ + @TableField("UNT") + private String unit; + /** + * 允许按量领取,1-领用时输入量,按量领取;0-领用时不能输入量,整个领走 + */ + @TableField("ENB_PRTL") + private String enablePartial; + /** + * 保质期(天) + */ + @TableField("DUE") + private Integer due; + /** + * 开封后保质期是否变化 + */ + @TableField("OPN_DUE_FLG") + private String openDueFlag; + /** + * 开封后保质期(天) + */ + @TableField("OPN_DUE_AFT") + private Integer openDueAfter; + /** + * 是否危险品 + */ + @TableField("HZRD") + private String hazardous; + /** + * 是否标准溶液 + */ + @TableField("STD_SOL_FLG") + private String standardSolutionFlag; + /** + * 是否标准物质 + */ + @TableField("STD_MTRL_FLG") + private String standardMaterialFlag; + /** + * 复标周期,单位:天。小于等于0-不复标 + */ + @TableField("RVW_DUE") + private Integer reviewDue; + /** + * 排序号 + */ + @TableField("SRT_NO") + private Integer sortNo; + /** + * 禁用 + */ + @TableField("CNL_FLG") + private String cancelFlag; + /** + * 所属部门 + */ + @TableField("SYS_DEPT_CD") + private String systemDepartmentCode; + /** + * 备注 + */ + @TableField("RMK") + private String remark; + + /** + * 总数量 + */ + @TableField("INB_QTY") + private Long inboundQuantity; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/dataobject/MaterialInventoryInboundDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/dataobject/MaterialInventoryInboundDO.java new file mode 100644 index 0000000..5d2509f --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/dataobject/MaterialInventoryInboundDO.java @@ -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_invt_inb") +@KeySequence("t_mtrl_invt_inb_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class MaterialInventoryInboundDO extends BusinessBaseDO { + + + + /** + * 主键 + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 标题 + */ + @TableField("TTL") + private String title; + /** + * 业务类型1.验收上架,【字典】【jy_material_in_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; + /** + * 流程实例id + */ + @TableField("FLW_INSC_ID") + private String flowInstanceId; + /** + * 流程审批状态 + */ + @TableField("FLW_STS") + private String flowStatus; + /** + * 意见json + */ + @TableField("CMT_JSON") + private String commentJson; + /** + * 所属部门 + */ + @TableField("SYS_DEPT_CD") + private String systemDepartmentCode; + /** + * 备注 + */ + @TableField("RMK") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/dataobject/MaterialInventoryInboundDetailDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/dataobject/MaterialInventoryInboundDetailDO.java new file mode 100644 index 0000000..85180d7 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/dataobject/MaterialInventoryInboundDetailDO.java @@ -0,0 +1,90 @@ +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_invt_inb_dtl") +@KeySequence("t_mtrl_invt_inb_dtl_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class MaterialInventoryInboundDetailDO extends BusinessBaseDO { + + + + /** + * 主键 + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 入库单ID + */ + @TableField("INB_ID") + private Long inboundId; + /** + * 分发批次id + */ + @TableField("BAT_ASN_ID") + private Long batchAssignId; + /** + * 入库方式 + */ + @TableField("INB_WY") + private String inboundWay; + /** + * 物料实例ID + */ + @TableField("MTRL_INF_ID") + private Long materialInfomationId; + /** + * 入库人 + */ + @TableField("INB_USER_NAME") + private String inboundUserName; + /** + * 入库人id + */ + @TableField("INB_USER_ID") + private Long inboundUserId; + /** + * 入库人部门 + */ + @TableField("INB_DEPT_NAME") + private String inboundDepartmentName; + /** + * 入库人部门id + */ + @TableField("INB_DEPT_ID") + private Long inboundDepartmentId; + /** + * 入库时间 + */ + @TableField("INB_TM") + private LocalDateTime inboundTime; + /** + * 所属部门 + */ + @TableField("SYS_DEPT_CD") + private String systemDepartmentCode; + /** + * 备注 + */ + @TableField("RMK") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/dataobject/MaterialInventoryOutboundDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/dataobject/MaterialInventoryOutboundDO.java new file mode 100644 index 0000000..3dc7a8d --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/dataobject/MaterialInventoryOutboundDO.java @@ -0,0 +1,110 @@ +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_invt_outb") +@KeySequence("t_mtrl_invt_outb_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class MaterialInventoryOutboundDO extends BusinessBaseDO { + + + + /** + * 主键 + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 标题 + */ + @TableField("TTL") + private String title; + /** + * 业务类型,【字典】【jy_material_out_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("CHK_USER") + private String checkUser; + /** + * 监督人id + */ + @TableField("CHK_USER_ID") + private Long checkUserId; + /** + * 流程实例id + */ + @TableField("FLW_INSC_ID") + private String flowInstanceId; + /** + * 意见json + */ + @TableField("CMT_JSON") + private String commentJson; + /** + * 流程审批状态 + */ + @TableField("FLW_STS") + private String flowStatus; + /** + * 所属部门 + */ + @TableField("SYS_DEPT_CD") + private String systemDepartmentCode; + /** + * 备注 + */ + @TableField("RMK") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/dataobject/MaterialInventoryOutboundDetailDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/dataobject/MaterialInventoryOutboundDetailDO.java new file mode 100644 index 0000000..d83121c --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/dataobject/MaterialInventoryOutboundDetailDO.java @@ -0,0 +1,57 @@ +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_invt_outb_dtl") +@KeySequence("t_mtrl_invt_outb_dtl_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class MaterialInventoryOutboundDetailDO extends BusinessBaseDO { + + + + /** + * 主键 + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 出库单id + */ + @TableField("PRN_ID") + private Long parentId; + /** + * 物料实例id + */ + @TableField("INF_ID") + private Long infomationId; + /** + * 数量 + */ + @TableField("QTY") + private String quantity; + /** + * 所属部门 + */ + @TableField("SYS_DEPT_CD") + private String systemDepartmentCode; + /** + * 备注 + */ + @TableField("RMK") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/dataobject/MaterialLifecycleDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/dataobject/MaterialLifecycleDO.java new file mode 100644 index 0000000..a5af068 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/dataobject/MaterialLifecycleDO.java @@ -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; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/dataobject/MaterialLifecycleDetailDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/dataobject/MaterialLifecycleDetailDO.java new file mode 100644 index 0000000..05ed59f --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/dataobject/MaterialLifecycleDetailDO.java @@ -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; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/dataobject/MaterialLocationDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/dataobject/MaterialLocationDO.java new file mode 100644 index 0000000..d9a6fc1 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/dataobject/MaterialLocationDO.java @@ -0,0 +1,67 @@ +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_loc") +@KeySequence("t_mtrl_loc_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class MaterialLocationDO extends BusinessBaseDO { + + + + /** + * 主键 + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 上级id + */ + @TableField("PRN_ID") + private Long parentId; + /** + * 名称 + */ + @TableField("NAME") + private String name; + /** + * 编码 + */ + @TableField("CD") + private String code; + /** + * 编码路径 + */ + @TableField("CD_PATH") + private String codePath; + /** + * 容量 + */ + @TableField("CPY") + private String capacity; + /** + * 所属部门 + */ + @TableField("SYS_DEPT_CD") + private String systemDepartmentCode; + /** + * 备注 + */ + @TableField("RMK") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialBatchAssignMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialBatchAssignMapper.java new file mode 100644 index 0000000..0c26169 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialBatchAssignMapper.java @@ -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.dal.dataobject.MaterialBatchAssignDO; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialBatchAssignPageReqVO; +import org.apache.ibatis.annotations.Mapper; + +/** + * 物料批次分发 Mapper + * + * @author 后台管理 + */ +@Mapper +public interface MaterialBatchAssignMapper extends BaseMapperX { + + default PageResult selectPage(MaterialBatchAssignPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(MaterialBatchAssignDO::getBatchId, reqVO.getBatchId()) + .eqIfPresent(MaterialBatchAssignDO::getProductId, reqVO.getProductId()) + .eqIfPresent(MaterialBatchAssignDO::getWarehouseId, reqVO.getWarehouseId()) + .eqIfPresent(MaterialBatchAssignDO::getInboundQuantity, reqVO.getInboundQuantity()) + .eqIfPresent(MaterialBatchAssignDO::getUrl, reqVO.getUrl()) + .eqIfPresent(MaterialBatchAssignDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .eqIfPresent(MaterialBatchAssignDO::getRemark, reqVO.getRemark()) + .betweenIfPresent(MaterialBatchAssignDO::getCreateTime, reqVO.getCreateTime()) + .orderByDesc(MaterialBatchAssignDO::getId)); + } + +// default PageResult selectByInfId(MaterialBatchAssignPageReqVO reqVO) { +// return selectPage(reqVO, new LambdaQueryWrapperX() +// .eqIfPresent(MaterialBatchAssignDO::getMaterialInfomationId, reqVO.getMaterialInfomationId()) +// .orderByDesc(MaterialBatchAssignDO::getCreateTime)); +// } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialBatchMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialBatchMapper.java new file mode 100644 index 0000000..f47e65d --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialBatchMapper.java @@ -0,0 +1,34 @@ +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.MaterialBatchDO; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialBatchPageReqVO; +import org.apache.ibatis.annotations.Mapper; + +/** + * 物料批次 Mapper + * + * @author 后台管理 + */ +@Mapper +public interface MaterialBatchMapper extends BaseMapperX { + + default PageResult selectPage(MaterialBatchPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(MaterialBatchDO::getProductId, reqVO.getProductId()) + .eqIfPresent(MaterialBatchDO::getBatchNo, reqVO.getBatchNo()) + .eqIfPresent(MaterialBatchDO::getInboundQuantity, reqVO.getInboundQuantity()) + .eqIfPresent(MaterialBatchDO::getLocation, reqVO.getLocation()) + .eqIfPresent(MaterialBatchDO::getSupplierId, reqVO.getSupplierId()) + .betweenIfPresent(MaterialBatchDO::getManufacturerDate, reqVO.getManufacturerDate()) + .betweenIfPresent(MaterialBatchDO::getDueDate, reqVO.getDueDate()) + .eqIfPresent(MaterialBatchDO::getAcceptanceStatus, reqVO.getAcceptanceStatus()) + .eqIfPresent(MaterialBatchDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .eqIfPresent(MaterialBatchDO::getRemark, reqVO.getRemark()) + .betweenIfPresent(MaterialBatchDO::getCreateTime, reqVO.getCreateTime()) + .orderByDesc(MaterialBatchDO::getId)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialInfomationMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialInfomationMapper.java index 5549d3c..24ae0b3 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialInfomationMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialInfomationMapper.java @@ -41,4 +41,15 @@ public interface MaterialInfomationMapper extends BaseMapperX selectAll(MaterialInfomationPageReqVO reqVO) { + reqVO.setPageSize(-1); + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(MaterialInfomationDO::getProductId, reqVO.getProductId()) + .eqIfPresent(MaterialInfomationDO::getBatchId, reqVO.getBatchId()) + .eqIfPresent(MaterialInfomationDO::getUsageStatus, reqVO.getUsageStatus()) + .eqIfPresent(MaterialInfomationDO::getInventoryInboundId, reqVO.getInventoryInboundId() + ) + ); + } + } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialInventoryCheckBatchMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialInventoryCheckBatchMapper.java new file mode 100644 index 0000000..d494500 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialInventoryCheckBatchMapper.java @@ -0,0 +1,32 @@ +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.MaterialInventoryCheckBatchDO; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryCheckBatchPageReqVO; +import org.apache.ibatis.annotations.Mapper; + +/** + * 库存盘点项 Mapper + * + * @author 后台管理 + */ +@Mapper +public interface MaterialInventoryCheckBatchMapper extends BaseMapperX { + + default PageResult selectPage(MaterialInventoryCheckBatchPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(MaterialInventoryCheckBatchDO::getCheckId, reqVO.getCheckId()) + .eqIfPresent(MaterialInventoryCheckBatchDO::getCheckProductId, reqVO.getCheckProductId()) + .eqIfPresent(MaterialInventoryCheckBatchDO::getCheckDepartmentId, reqVO.getCheckDepartmentId()) + .eqIfPresent(MaterialInventoryCheckBatchDO::getExpected, reqVO.getExpected()) + .eqIfPresent(MaterialInventoryCheckBatchDO::getActual, reqVO.getActual()) + .eqIfPresent(MaterialInventoryCheckBatchDO::getDifference, reqVO.getDifference()) + .eqIfPresent(MaterialInventoryCheckBatchDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .eqIfPresent(MaterialInventoryCheckBatchDO::getRemark, reqVO.getRemark()) + .betweenIfPresent(MaterialInventoryCheckBatchDO::getCreateTime, reqVO.getCreateTime()) + .orderByDesc(MaterialInventoryCheckBatchDO::getId)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialInventoryCheckDetailMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialInventoryCheckDetailMapper.java new file mode 100644 index 0000000..e894456 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialInventoryCheckDetailMapper.java @@ -0,0 +1,32 @@ +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.MaterialInventoryCheckDetailDO; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryCheckDetailPageReqVO; +import org.apache.ibatis.annotations.Mapper; + +/** + * 库存盘点明细 Mapper + * + * @author 后台管理 + */ +@Mapper +public interface MaterialInventoryCheckDetailMapper extends BaseMapperX { + + default PageResult selectPage(MaterialInventoryCheckDetailPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(MaterialInventoryCheckDetailDO::getCheckBatchId, reqVO.getCheckBatchId()) + .eqIfPresent(MaterialInventoryCheckDetailDO::getInfomationId, reqVO.getInfomationId()) + .eqIfPresent(MaterialInventoryCheckDetailDO::getPresent, reqVO.getPresent()) + .eqIfPresent(MaterialInventoryCheckDetailDO::getCurrentQuantity, reqVO.getCurrentQuantity()) + .eqIfPresent(MaterialInventoryCheckDetailDO::getStatus, reqVO.getStatus()) + .eqIfPresent(MaterialInventoryCheckDetailDO::getDisposalMethod, reqVO.getDisposalMethod()) + .eqIfPresent(MaterialInventoryCheckDetailDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .eqIfPresent(MaterialInventoryCheckDetailDO::getRemark, reqVO.getRemark()) + .betweenIfPresent(MaterialInventoryCheckDetailDO::getCreateTime, reqVO.getCreateTime()) + .orderByDesc(MaterialInventoryCheckDetailDO::getId)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialInventoryCheckMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialInventoryCheckMapper.java new file mode 100644 index 0000000..dc8c5b8 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialInventoryCheckMapper.java @@ -0,0 +1,36 @@ +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.MaterialInventoryCheckDO; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryCheckPageReqVO; +import org.apache.ibatis.annotations.Mapper; + +/** + * 库存盘点 Mapper + * + * @author 后台管理 + */ +@Mapper +public interface MaterialInventoryCheckMapper extends BaseMapperX { + + default PageResult selectPage(MaterialInventoryCheckPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(MaterialInventoryCheckDO::getTitle, reqVO.getTitle()) + .eqIfPresent(MaterialInventoryCheckDO::getBusinessType, reqVO.getBusinessType()) + .eqIfPresent(MaterialInventoryCheckDO::getBusinessTypeCode, reqVO.getBusinessTypeCode()) + .eqIfPresent(MaterialInventoryCheckDO::getApplyUser, reqVO.getApplyUser()) + .eqIfPresent(MaterialInventoryCheckDO::getApplyUserId, reqVO.getApplyUserId()) + .eqIfPresent(MaterialInventoryCheckDO::getApplyDepartment, reqVO.getApplyDepartment()) + .eqIfPresent(MaterialInventoryCheckDO::getApplyDepartmentId, reqVO.getApplyDepartmentId()) + .betweenIfPresent(MaterialInventoryCheckDO::getApplyTime, reqVO.getApplyTime()) + .eqIfPresent(MaterialInventoryCheckDO::getFlowInstanceId, reqVO.getFlowInstanceId()) + .eqIfPresent(MaterialInventoryCheckDO::getFlowStatus, reqVO.getFlowStatus()) + .eqIfPresent(MaterialInventoryCheckDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .eqIfPresent(MaterialInventoryCheckDO::getRemark, reqVO.getRemark()) + .betweenIfPresent(MaterialInventoryCheckDO::getCreateTime, reqVO.getCreateTime()) + .orderByDesc(MaterialInventoryCheckDO::getId)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialInventoryInboundDetailMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialInventoryInboundDetailMapper.java new file mode 100644 index 0000000..97a94ef --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialInventoryInboundDetailMapper.java @@ -0,0 +1,53 @@ +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.framework.mybatis.core.query.MPJLambdaWrapperX; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayProjectAndParameterRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayProjectDataExtendRespVO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayParameterDataDO; +import com.zt.plat.module.qms.business.dic.dal.dataobject.DictionaryProjectDO; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryInboundDetailRespVO; +import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialInfomationDO; +import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialInventoryInboundDetailDO; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryInboundDetailPageReqVO; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 入库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等 Mapper + * + * @author 后台管理 + */ +@Mapper +public interface MaterialInventoryInboundDetailMapper extends BaseMapperX { + + default PageResult selectPage(MaterialInventoryInboundDetailPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(MaterialInventoryInboundDetailDO::getInboundId, reqVO.getInboundId()) + .eqIfPresent(MaterialInventoryInboundDetailDO::getBatchAssignId, reqVO.getBatchAssignId()) + .eqIfPresent(MaterialInventoryInboundDetailDO::getInboundWay, reqVO.getInboundWay()) + .eqIfPresent(MaterialInventoryInboundDetailDO::getMaterialInfomationId, reqVO.getMaterialInfomationId()) + .likeIfPresent(MaterialInventoryInboundDetailDO::getInboundUserName, reqVO.getInboundUserName()) + .eqIfPresent(MaterialInventoryInboundDetailDO::getInboundUserId, reqVO.getInboundUserId()) + .likeIfPresent(MaterialInventoryInboundDetailDO::getInboundDepartmentName, reqVO.getInboundDepartmentName()) + .eqIfPresent(MaterialInventoryInboundDetailDO::getInboundDepartmentId, reqVO.getInboundDepartmentId()) + .betweenIfPresent(MaterialInventoryInboundDetailDO::getInboundTime, reqVO.getInboundTime()) + .eqIfPresent(MaterialInventoryInboundDetailDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .eqIfPresent(MaterialInventoryInboundDetailDO::getRemark, reqVO.getRemark()) + .betweenIfPresent(MaterialInventoryInboundDetailDO::getCreateTime, reqVO.getCreateTime()) + .orderByDesc(MaterialInventoryInboundDetailDO::getId)); + } + + default PageResult selectPageList(MaterialInventoryInboundDetailPageReqVO reqVO) { + return selectJoinPage(reqVO, MaterialInventoryInboundDetailRespVO.class, new MPJLambdaWrapperX() + .selectAll(MaterialInventoryInboundDetailDO.class) + .selectAs(MaterialInfomationDO::getProductId, MaterialInventoryInboundDetailRespVO::getProductId) + .leftJoin(MaterialInfomationDO.class, MaterialInfomationDO::getId, MaterialInventoryInboundDetailDO::getMaterialInfomationId) + .eqIfPresent(MaterialInfomationDO::getProductId, reqVO.getProductId()) + ); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialInventoryInboundMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialInventoryInboundMapper.java new file mode 100644 index 0000000..d16c1c3 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialInventoryInboundMapper.java @@ -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.dal.dataobject.MaterialInventoryInboundDO; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryInboundPageReqVO; +import org.apache.ibatis.annotations.Mapper; + +/** + * 入库 Mapper + * + * @author 后台管理 + */ +@Mapper +public interface MaterialInventoryInboundMapper extends BaseMapperX { + + default PageResult selectPage(MaterialInventoryInboundPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(MaterialInventoryInboundDO::getTitle, reqVO.getTitle()) + .eqIfPresent(MaterialInventoryInboundDO::getBusinessType, reqVO.getBusinessType()) + .eqIfPresent(MaterialInventoryInboundDO::getBusinessTypeCode, reqVO.getBusinessTypeCode()) + .eqIfPresent(MaterialInventoryInboundDO::getApplyUser, reqVO.getApplyUser()) + .eqIfPresent(MaterialInventoryInboundDO::getApplyUserId, reqVO.getApplyUserId()) + .eqIfPresent(MaterialInventoryInboundDO::getApplyDepartment, reqVO.getApplyDepartment()) + .eqIfPresent(MaterialInventoryInboundDO::getApplyDepartmentId, reqVO.getApplyDepartmentId()) + .betweenIfPresent(MaterialInventoryInboundDO::getApplyTime, reqVO.getApplyTime()) + .eqIfPresent(MaterialInventoryInboundDO::getFlowInstanceId, reqVO.getFlowInstanceId()) + .eqIfPresent(MaterialInventoryInboundDO::getFlowStatus, reqVO.getFlowStatus()) + .eqIfPresent(MaterialInventoryInboundDO::getCommentJson, reqVO.getCommentJson()) + .eqIfPresent(MaterialInventoryInboundDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .eqIfPresent(MaterialInventoryInboundDO::getRemark, reqVO.getRemark()) + .betweenIfPresent(MaterialInventoryInboundDO::getCreateTime, reqVO.getCreateTime()) + .orderByDesc(MaterialInventoryInboundDO::getId)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialInventoryMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialInventoryMapper.java new file mode 100644 index 0000000..aa3cc30 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialInventoryMapper.java @@ -0,0 +1,34 @@ +package com.zt.plat.module.qms.resource.material.dal.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +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.qms.business.bus.dal.dataobject.BusinessSampleEntrustRegistrationDO; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryInboundPageReqVO; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryRespVO; +import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialInventoryDO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 入库 Mapper + * + * @author 后台管理 + */ +@Mapper +public interface MaterialInventoryMapper extends BaseMapperX { + +// default PageResult selectPage(MaterialInventoryRespVO reqVO) { +// return selectPage(reqVO, new LambdaQueryWrapperX() +// +// .eqIfPresent(MaterialInventoryDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) +// .eqIfPresent(MaterialInventoryDO::getRemark, reqVO.getRemark()) +// .betweenIfPresent(MaterialInventoryDO::getCreateTime, reqVO.getCreateTime()) +// .orderByDesc(MaterialInventoryDO::getId)); +// } + + IPage selectPageList (IPage page,@Param("param")MaterialInventoryRespVO RespVO); + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialInventoryOutboundDetailMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialInventoryOutboundDetailMapper.java new file mode 100644 index 0000000..ace8f14 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialInventoryOutboundDetailMapper.java @@ -0,0 +1,29 @@ +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.MaterialInventoryOutboundDetailPageReqVO; +import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialInventoryOutboundDetailDO; +import org.apache.ibatis.annotations.Mapper; + +/** + * 出库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等 Mapper + * + * @author 后台管理 + */ +@Mapper +public interface MaterialInventoryOutboundDetailMapper extends BaseMapperX { + + default PageResult selectPage(MaterialInventoryOutboundDetailPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(MaterialInventoryOutboundDetailDO::getParentId, reqVO.getParentId()) + .eqIfPresent(MaterialInventoryOutboundDetailDO::getInfomationId, reqVO.getInfomationId()) + .eqIfPresent(MaterialInventoryOutboundDetailDO::getQuantity, reqVO.getQuantity()) + .eqIfPresent(MaterialInventoryOutboundDetailDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .eqIfPresent(MaterialInventoryOutboundDetailDO::getRemark, reqVO.getRemark()) + .betweenIfPresent(MaterialInventoryOutboundDetailDO::getCreateTime, reqVO.getCreateTime()) + .orderByDesc(MaterialInventoryOutboundDetailDO::getId)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialInventoryOutboundMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialInventoryOutboundMapper.java new file mode 100644 index 0000000..dcfbbcf --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialInventoryOutboundMapper.java @@ -0,0 +1,39 @@ +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.MaterialInventoryOutboundPageReqVO; +import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialInventoryOutboundDO; +import org.apache.ibatis.annotations.Mapper; + +/** + * 出库 Mapper + * + * @author 后台管理 + */ +@Mapper +public interface MaterialInventoryOutboundMapper extends BaseMapperX { + + default PageResult selectPage(MaterialInventoryOutboundPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(MaterialInventoryOutboundDO::getTitle, reqVO.getTitle()) + .eqIfPresent(MaterialInventoryOutboundDO::getBusinessType, reqVO.getBusinessType()) + .eqIfPresent(MaterialInventoryOutboundDO::getBusinessTypeCode, reqVO.getBusinessTypeCode()) + .eqIfPresent(MaterialInventoryOutboundDO::getApplyUser, reqVO.getApplyUser()) + .eqIfPresent(MaterialInventoryOutboundDO::getApplyUserId, reqVO.getApplyUserId()) + .eqIfPresent(MaterialInventoryOutboundDO::getApplyDepartment, reqVO.getApplyDepartment()) + .eqIfPresent(MaterialInventoryOutboundDO::getApplyDepartmentId, reqVO.getApplyDepartmentId()) + .betweenIfPresent(MaterialInventoryOutboundDO::getApplyTime, reqVO.getApplyTime()) + .eqIfPresent(MaterialInventoryOutboundDO::getCheckUser, reqVO.getCheckUser()) + .eqIfPresent(MaterialInventoryOutboundDO::getCheckUserId, reqVO.getCheckUserId()) + .eqIfPresent(MaterialInventoryOutboundDO::getFlowInstanceId, reqVO.getFlowInstanceId()) + .eqIfPresent(MaterialInventoryOutboundDO::getCommentJson, reqVO.getCommentJson()) + .eqIfPresent(MaterialInventoryOutboundDO::getFlowStatus, reqVO.getFlowStatus()) + .eqIfPresent(MaterialInventoryOutboundDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .eqIfPresent(MaterialInventoryOutboundDO::getRemark, reqVO.getRemark()) + .betweenIfPresent(MaterialInventoryOutboundDO::getCreateTime, reqVO.getCreateTime()) + .orderByDesc(MaterialInventoryOutboundDO::getId)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialLifecycleDetailMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialLifecycleDetailMapper.java new file mode 100644 index 0000000..ce42a1d --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialLifecycleDetailMapper.java @@ -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 { + + default PageResult selectPage(MaterialLifecycleDetailPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .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)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialLifecycleMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialLifecycleMapper.java new file mode 100644 index 0000000..0241370 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialLifecycleMapper.java @@ -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 { + + default PageResult selectPage(MaterialLifecyclePageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .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)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialLocationMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialLocationMapper.java new file mode 100644 index 0000000..42302d9 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialLocationMapper.java @@ -0,0 +1,31 @@ +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.MaterialLocationDO; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialLocationPageReqVO; +import org.apache.ibatis.annotations.Mapper; + +/** + * 存放位置 Mapper + * + * @author 后台管理 + */ +@Mapper +public interface MaterialLocationMapper extends BaseMapperX { + + default PageResult selectPage(MaterialLocationPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(MaterialLocationDO::getParentId, reqVO.getParentId()) + .likeIfPresent(MaterialLocationDO::getName, reqVO.getName()) + .eqIfPresent(MaterialLocationDO::getCode, reqVO.getCode()) + .eqIfPresent(MaterialLocationDO::getCodePath, reqVO.getCodePath()) + .eqIfPresent(MaterialLocationDO::getCapacity, reqVO.getCapacity()) + .eqIfPresent(MaterialLocationDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .eqIfPresent(MaterialLocationDO::getRemark, reqVO.getRemark()) + .betweenIfPresent(MaterialLocationDO::getCreateTime, reqVO.getCreateTime()) + .orderByDesc(MaterialLocationDO::getId)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialBatchAssignService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialBatchAssignService.java new file mode 100644 index 0000000..05764a7 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialBatchAssignService.java @@ -0,0 +1,80 @@ +package com.zt.plat.module.qms.resource.material.service; + +import java.util.*; + +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialBatchAssignPageReqVO; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialBatchAssignRespVO; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialBatchAssignSaveReqVO; +import jakarta.validation.*; +import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialBatchAssignDO; +import com.zt.plat.framework.common.pojo.PageResult; + +/** + * 物料批次分发 Service 接口 + * + * @author 后台管理 + */ +public interface MaterialBatchAssignService { + + /** + * 创建物料批次分发 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + MaterialBatchAssignRespVO createMaterialBatchAssign(@Valid MaterialBatchAssignSaveReqVO createReqVO); + + /** + * 更新物料批次分发 + * + * @param updateReqVO 更新信息 + */ + void updateMaterialBatchAssign(@Valid MaterialBatchAssignSaveReqVO updateReqVO); + + /** + * 删除物料批次分发 + * + * @param id 编号 + */ + void deleteMaterialBatchAssign(Long id); + + /** + * 批量删除物料批次分发 + * + * @param ids 编号 + */ + void deleteMaterialBatchAssignListByIds(List ids); + + /** + * 获得物料批次分发 + * + * @param id 编号 + * @return 物料批次分发 + */ + MaterialBatchAssignDO getMaterialBatchAssign(Long id); + + /** + * 用物料实例Id获得物料批次 + * + * @param pageReqVO 分页查询 + * @return 物料批次分发 + */ + public PageResult getMaterialBatchAssignByInfId(MaterialBatchAssignPageReqVO pageReqVO); + + /** + * 获得物料批次分发分页 + * + * @param pageReqVO 分页查询 + * @return 物料批次分发分页 + */ + PageResult getMaterialBatchAssignPage(MaterialBatchAssignPageReqVO pageReqVO); + + + /** + * 分发到实验室 + * @param createReqVO + * @return + */ + MaterialBatchAssignRespVO assignLab(@Valid MaterialBatchAssignSaveReqVO createReqVO); + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialBatchAssignServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialBatchAssignServiceImpl.java new file mode 100644 index 0000000..758ef44 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialBatchAssignServiceImpl.java @@ -0,0 +1,134 @@ +package com.zt.plat.module.qms.resource.material.service; + +import cn.hutool.core.collection.CollUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialBatchAssignPageReqVO; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialBatchAssignRespVO; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialBatchAssignSaveReqVO; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInfomationPageReqVO; +import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialInfomationDO; +import com.zt.plat.module.qms.resource.material.dal.mapper.MaterialInfomationMapper; +import jakarta.validation.Valid; +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.MaterialBatchAssignDO; +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.MaterialBatchAssignMapper; + +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 MaterialBatchAssignServiceImpl implements MaterialBatchAssignService { + + @Resource + private MaterialBatchAssignMapper materialBatchAssignMapper; + + @Resource + private MaterialInfomationMapper materialInfomationMapper; + + @Override + public MaterialBatchAssignRespVO createMaterialBatchAssign(MaterialBatchAssignSaveReqVO createReqVO) { + // 插入 + MaterialBatchAssignDO materialBatchAssign = BeanUtils.toBean(createReqVO, MaterialBatchAssignDO.class); + materialBatchAssignMapper.insert(materialBatchAssign); + // 返回 + return BeanUtils.toBean(materialBatchAssign, MaterialBatchAssignRespVO.class); + } + + @Override + public void updateMaterialBatchAssign(MaterialBatchAssignSaveReqVO updateReqVO) { + // 校验存在 + validateMaterialBatchAssignExists(updateReqVO.getId()); + // 更新 + MaterialBatchAssignDO updateObj = BeanUtils.toBean(updateReqVO, MaterialBatchAssignDO.class); + materialBatchAssignMapper.updateById(updateObj); + } + + @Override + public void deleteMaterialBatchAssign(Long id) { + // 校验存在 + validateMaterialBatchAssignExists(id); + // 删除 + materialBatchAssignMapper.deleteById(id); + } + + @Override + public void deleteMaterialBatchAssignListByIds(List ids) { + // 校验存在 + validateMaterialBatchAssignExists(ids); + // 删除 + materialBatchAssignMapper.deleteByIds(ids); + } + + private void validateMaterialBatchAssignExists(List ids) { + List list = materialBatchAssignMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(MATERIAL_BATCH_ASSIGN_NOT_EXISTS); + } + } + + private void validateMaterialBatchAssignExists(Long id) { + if (materialBatchAssignMapper.selectById(id) == null) { + throw exception(MATERIAL_BATCH_ASSIGN_NOT_EXISTS); + } + } + + @Override + public MaterialBatchAssignDO getMaterialBatchAssign(Long id) { + return materialBatchAssignMapper.selectById(id); + } + + @Override + public PageResult getMaterialBatchAssignByInfId(MaterialBatchAssignPageReqVO pageReqVO){ + return materialBatchAssignMapper.selectPage(pageReqVO); + } + + @Override + public PageResult getMaterialBatchAssignPage(MaterialBatchAssignPageReqVO pageReqVO) { + PageResult pageResult = materialBatchAssignMapper.selectPage(pageReqVO); + + + + /** 统计批次剩余量需要除去已上架(存在实例)的部分 */ + pageResult.getList().forEach(item -> { + MaterialInfomationPageReqVO infomationPageReqVO = new MaterialInfomationPageReqVO(); + infomationPageReqVO.setBatchId(item.getId()); + infomationPageReqVO.setProductId(item.getProductId()); + infomationPageReqVO.setUsageStatus("0"); + PageResult materialInfomationDOPageResult = materialInfomationMapper.selectAll(infomationPageReqVO); + Long totalCount = materialInfomationDOPageResult.getTotalCount(); +// item.setInboundQuantity(item.getInboundQuantity()-totalCount); + // 方案2: 添加边界检查,防止负数 + long calculatedQuantity = item.getInboundQuantity() - totalCount; + item.setInboundQuantity(Math.max(0L, calculatedQuantity)); + }); + + + return pageResult; + } + + + @Override + public MaterialBatchAssignRespVO assignLab(MaterialBatchAssignSaveReqVO createReqVO){ + // 插入 + MaterialBatchAssignDO materialBatchAssign = BeanUtils.toBean(createReqVO, MaterialBatchAssignDO.class); + materialBatchAssignMapper.insert(materialBatchAssign); + // 返回 + return BeanUtils.toBean(materialBatchAssign, MaterialBatchAssignRespVO.class); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialBatchService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialBatchService.java new file mode 100644 index 0000000..152f7af --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialBatchService.java @@ -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.MaterialBatchPageReqVO; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialBatchRespVO; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialBatchSaveReqVO; +import jakarta.validation.*; +import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialBatchDO; +import com.zt.plat.framework.common.pojo.PageResult; + +/** + * 物料批次 Service 接口 + * + * @author 后台管理 + */ +public interface MaterialBatchService { + + /** + * 创建物料批次 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + MaterialBatchRespVO createMaterialBatch(@Valid MaterialBatchSaveReqVO createReqVO); + + /** + * 更新物料批次 + * + * @param updateReqVO 更新信息 + */ + void updateMaterialBatch(@Valid MaterialBatchSaveReqVO updateReqVO); + + /** + * 删除物料批次 + * + * @param id 编号 + */ + void deleteMaterialBatch(Long id); + + /** + * 批量删除物料批次 + * + * @param ids 编号 + */ + void deleteMaterialBatchListByIds(List ids); + + /** + * 获得物料批次 + * + * @param id 编号 + * @return 物料批次 + */ + MaterialBatchDO getMaterialBatch(Long id); + + /** + * 获得物料批次分页 + * + * @param pageReqVO 分页查询 + * @return 物料批次分页 + */ + PageResult getMaterialBatchPage(MaterialBatchPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialBatchServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialBatchServiceImpl.java new file mode 100644 index 0000000..a801e0f --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialBatchServiceImpl.java @@ -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.MaterialBatchPageReqVO; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialBatchRespVO; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialBatchSaveReqVO; +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.MaterialBatchDO; +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.MaterialBatchMapper; + +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 MaterialBatchServiceImpl implements MaterialBatchService { + + @Resource + private MaterialBatchMapper materialBatchMapper; + + @Override + public MaterialBatchRespVO createMaterialBatch(MaterialBatchSaveReqVO createReqVO) { + // 插入 + MaterialBatchDO materialBatch = BeanUtils.toBean(createReqVO, MaterialBatchDO.class); + materialBatchMapper.insert(materialBatch); + // 返回 + return BeanUtils.toBean(materialBatch, MaterialBatchRespVO.class); + } + + @Override + public void updateMaterialBatch(MaterialBatchSaveReqVO updateReqVO) { + // 校验存在 + validateMaterialBatchExists(updateReqVO.getId()); + // 更新 + MaterialBatchDO updateObj = BeanUtils.toBean(updateReqVO, MaterialBatchDO.class); + materialBatchMapper.updateById(updateObj); + } + + @Override + public void deleteMaterialBatch(Long id) { + // 校验存在 + validateMaterialBatchExists(id); + // 删除 + materialBatchMapper.deleteById(id); + } + + @Override + public void deleteMaterialBatchListByIds(List ids) { + // 校验存在 + validateMaterialBatchExists(ids); + // 删除 + materialBatchMapper.deleteByIds(ids); + } + + private void validateMaterialBatchExists(List ids) { + List list = materialBatchMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(MATERIAL_BATCH_NOT_EXISTS); + } + } + + private void validateMaterialBatchExists(Long id) { + if (materialBatchMapper.selectById(id) == null) { + throw exception(MATERIAL_BATCH_NOT_EXISTS); + } + } + + @Override + public MaterialBatchDO getMaterialBatch(Long id) { + return materialBatchMapper.selectById(id); + } + + @Override + public PageResult getMaterialBatchPage(MaterialBatchPageReqVO pageReqVO) { + return materialBatchMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialInventoryCheckBatchService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialInventoryCheckBatchService.java new file mode 100644 index 0000000..2f3ae1e --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialInventoryCheckBatchService.java @@ -0,0 +1,65 @@ +package com.zt.plat.module.qms.resource.material.service; + +import java.util.*; + +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryCheckBatchPageReqVO; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryCheckBatchRespVO; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryCheckBatchSaveReqVO; +import jakarta.validation.*; +import com.zt.plat.module.qms.resource.material.controller.vo.*; +import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialInventoryCheckBatchDO; +import com.zt.plat.framework.common.pojo.PageResult; + +/** + * 库存盘点项 Service 接口 + * + * @author 后台管理 + */ +public interface MaterialInventoryCheckBatchService { + + /** + * 创建库存盘点项 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + MaterialInventoryCheckBatchRespVO createMaterialInventoryCheckBatch(@Valid MaterialInventoryCheckBatchSaveReqVO createReqVO); + + /** + * 更新库存盘点项 + * + * @param updateReqVO 更新信息 + */ + void updateMaterialInventoryCheckBatch(@Valid MaterialInventoryCheckBatchSaveReqVO updateReqVO); + + /** + * 删除库存盘点项 + * + * @param id 编号 + */ + void deleteMaterialInventoryCheckBatch(Long id); + + /** + * 批量删除库存盘点项 + * + * @param ids 编号 + */ + void deleteMaterialInventoryCheckBatchListByIds(List ids); + + /** + * 获得库存盘点项 + * + * @param id 编号 + * @return 库存盘点项 + */ + MaterialInventoryCheckBatchDO getMaterialInventoryCheckBatch(Long id); + + /** + * 获得库存盘点项分页 + * + * @param pageReqVO 分页查询 + * @return 库存盘点项分页 + */ + PageResult getMaterialInventoryCheckBatchPage(MaterialInventoryCheckBatchPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialInventoryCheckBatchServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialInventoryCheckBatchServiceImpl.java new file mode 100644 index 0000000..c2573df --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialInventoryCheckBatchServiceImpl.java @@ -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.MaterialInventoryCheckBatchPageReqVO; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryCheckBatchRespVO; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryCheckBatchSaveReqVO; +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.controller.vo.*; +import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialInventoryCheckBatchDO; +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.MaterialInventoryCheckBatchMapper; + +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 MaterialInventoryCheckBatchServiceImpl implements MaterialInventoryCheckBatchService { + + @Resource + private MaterialInventoryCheckBatchMapper materialInventoryCheckBatchMapper; + + @Override + public MaterialInventoryCheckBatchRespVO createMaterialInventoryCheckBatch(MaterialInventoryCheckBatchSaveReqVO createReqVO) { + // 插入 + MaterialInventoryCheckBatchDO materialInventoryCheckBatch = BeanUtils.toBean(createReqVO, MaterialInventoryCheckBatchDO.class); + materialInventoryCheckBatchMapper.insert(materialInventoryCheckBatch); + // 返回 + return BeanUtils.toBean(materialInventoryCheckBatch, MaterialInventoryCheckBatchRespVO.class); + } + + @Override + public void updateMaterialInventoryCheckBatch(MaterialInventoryCheckBatchSaveReqVO updateReqVO) { + // 校验存在 + validateMaterialInventoryCheckBatchExists(updateReqVO.getId()); + // 更新 + MaterialInventoryCheckBatchDO updateObj = BeanUtils.toBean(updateReqVO, MaterialInventoryCheckBatchDO.class); + materialInventoryCheckBatchMapper.updateById(updateObj); + } + + @Override + public void deleteMaterialInventoryCheckBatch(Long id) { + // 校验存在 + validateMaterialInventoryCheckBatchExists(id); + // 删除 + materialInventoryCheckBatchMapper.deleteById(id); + } + + @Override + public void deleteMaterialInventoryCheckBatchListByIds(List ids) { + // 校验存在 + validateMaterialInventoryCheckBatchExists(ids); + // 删除 + materialInventoryCheckBatchMapper.deleteByIds(ids); + } + + private void validateMaterialInventoryCheckBatchExists(List ids) { + List list = materialInventoryCheckBatchMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(MATERIAL_INVENTORY_CHECK_BATCH_NOT_EXISTS); + } + } + + private void validateMaterialInventoryCheckBatchExists(Long id) { + if (materialInventoryCheckBatchMapper.selectById(id) == null) { + throw exception(MATERIAL_INVENTORY_CHECK_BATCH_NOT_EXISTS); + } + } + + @Override + public MaterialInventoryCheckBatchDO getMaterialInventoryCheckBatch(Long id) { + return materialInventoryCheckBatchMapper.selectById(id); + } + + @Override + public PageResult getMaterialInventoryCheckBatchPage(MaterialInventoryCheckBatchPageReqVO pageReqVO) { + return materialInventoryCheckBatchMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialInventoryCheckDetailService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialInventoryCheckDetailService.java new file mode 100644 index 0000000..91b79da --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialInventoryCheckDetailService.java @@ -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.MaterialInventoryCheckDetailPageReqVO; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryCheckDetailRespVO; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryCheckDetailSaveReqVO; +import jakarta.validation.*; +import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialInventoryCheckDetailDO; +import com.zt.plat.framework.common.pojo.PageResult; + +/** + * 库存盘点明细 Service 接口 + * + * @author 后台管理 + */ +public interface MaterialInventoryCheckDetailService { + + /** + * 创建库存盘点明细 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + MaterialInventoryCheckDetailRespVO createMaterialInventoryCheckDetail(@Valid MaterialInventoryCheckDetailSaveReqVO createReqVO); + + /** + * 更新库存盘点明细 + * + * @param updateReqVO 更新信息 + */ + void updateMaterialInventoryCheckDetail(@Valid MaterialInventoryCheckDetailSaveReqVO updateReqVO); + + /** + * 删除库存盘点明细 + * + * @param id 编号 + */ + void deleteMaterialInventoryCheckDetail(Long id); + + /** + * 批量删除库存盘点明细 + * + * @param ids 编号 + */ + void deleteMaterialInventoryCheckDetailListByIds(List ids); + + /** + * 获得库存盘点明细 + * + * @param id 编号 + * @return 库存盘点明细 + */ + MaterialInventoryCheckDetailDO getMaterialInventoryCheckDetail(Long id); + + /** + * 获得库存盘点明细分页 + * + * @param pageReqVO 分页查询 + * @return 库存盘点明细分页 + */ + PageResult getMaterialInventoryCheckDetailPage(MaterialInventoryCheckDetailPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialInventoryCheckDetailServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialInventoryCheckDetailServiceImpl.java new file mode 100644 index 0000000..3387b48 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialInventoryCheckDetailServiceImpl.java @@ -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.MaterialInventoryCheckDetailPageReqVO; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryCheckDetailRespVO; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryCheckDetailSaveReqVO; +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.MaterialInventoryCheckDetailDO; +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.MaterialInventoryCheckDetailMapper; + +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 MaterialInventoryCheckDetailServiceImpl implements MaterialInventoryCheckDetailService { + + @Resource + private MaterialInventoryCheckDetailMapper materialInventoryCheckDetailMapper; + + @Override + public MaterialInventoryCheckDetailRespVO createMaterialInventoryCheckDetail(MaterialInventoryCheckDetailSaveReqVO createReqVO) { + // 插入 + MaterialInventoryCheckDetailDO materialInventoryCheckDetail = BeanUtils.toBean(createReqVO, MaterialInventoryCheckDetailDO.class); + materialInventoryCheckDetailMapper.insert(materialInventoryCheckDetail); + // 返回 + return BeanUtils.toBean(materialInventoryCheckDetail, MaterialInventoryCheckDetailRespVO.class); + } + + @Override + public void updateMaterialInventoryCheckDetail(MaterialInventoryCheckDetailSaveReqVO updateReqVO) { + // 校验存在 + validateMaterialInventoryCheckDetailExists(updateReqVO.getId()); + // 更新 + MaterialInventoryCheckDetailDO updateObj = BeanUtils.toBean(updateReqVO, MaterialInventoryCheckDetailDO.class); + materialInventoryCheckDetailMapper.updateById(updateObj); + } + + @Override + public void deleteMaterialInventoryCheckDetail(Long id) { + // 校验存在 + validateMaterialInventoryCheckDetailExists(id); + // 删除 + materialInventoryCheckDetailMapper.deleteById(id); + } + + @Override + public void deleteMaterialInventoryCheckDetailListByIds(List ids) { + // 校验存在 + validateMaterialInventoryCheckDetailExists(ids); + // 删除 + materialInventoryCheckDetailMapper.deleteByIds(ids); + } + + private void validateMaterialInventoryCheckDetailExists(List ids) { + List list = materialInventoryCheckDetailMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(MATERIAL_INVENTORY_CHECK_DETAIL_NOT_EXISTS); + } + } + + private void validateMaterialInventoryCheckDetailExists(Long id) { + if (materialInventoryCheckDetailMapper.selectById(id) == null) { + throw exception(MATERIAL_INVENTORY_CHECK_DETAIL_NOT_EXISTS); + } + } + + @Override + public MaterialInventoryCheckDetailDO getMaterialInventoryCheckDetail(Long id) { + return materialInventoryCheckDetailMapper.selectById(id); + } + + @Override + public PageResult getMaterialInventoryCheckDetailPage(MaterialInventoryCheckDetailPageReqVO pageReqVO) { + return materialInventoryCheckDetailMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialInventoryCheckService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialInventoryCheckService.java new file mode 100644 index 0000000..f1b88cb --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialInventoryCheckService.java @@ -0,0 +1,80 @@ +package com.zt.plat.module.qms.resource.material.service; + +import java.util.*; + +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryCheckPageReqVO; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryCheckRespVO; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryCheckSaveReqVO; +import jakarta.validation.*; +import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialInventoryCheckDO; +import com.zt.plat.framework.common.pojo.PageResult; + +/** + * 库存盘点 Service 接口 + * + * @author 后台管理 + */ +public interface MaterialInventoryCheckService { + + /** + * 创建库存盘点 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + MaterialInventoryCheckRespVO createMaterialInventoryCheck(@Valid MaterialInventoryCheckSaveReqVO createReqVO); + + /** + * 更新库存盘点 + * + * @param updateReqVO 更新信息 + */ + void updateMaterialInventoryCheck(@Valid MaterialInventoryCheckSaveReqVO updateReqVO); + + /** + * 删除库存盘点 + * + * @param id 编号 + */ + void deleteMaterialInventoryCheck(Long id); + + /** + * 批量删除库存盘点 + * + * @param ids 编号 + */ + void deleteMaterialInventoryCheckListByIds(List ids); + + /** + * 获得库存盘点 + * + * @param id 编号 + * @return 库存盘点 + */ + MaterialInventoryCheckDO getMaterialInventoryCheck(Long id); + + /** + * 获得库存盘点分页 + * + * @param pageReqVO 分页查询 + * @return 库存盘点分页 + */ + PageResult getMaterialInventoryCheckPage(MaterialInventoryCheckPageReqVO pageReqVO); + + + /** + * 创建库存盘点表单 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + MaterialInventoryCheckRespVO createMaterialInventoryCheckForm(@Valid MaterialInventoryCheckSaveReqVO createReqVO); + + /** + * 获得库存盘点表单 + * + * @param id 编号 + * @return 库存盘点 + */ + MaterialInventoryCheckRespVO getMaterialInventoryCheckForm(Long id); +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialInventoryCheckServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialInventoryCheckServiceImpl.java new file mode 100644 index 0000000..7b2d646 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialInventoryCheckServiceImpl.java @@ -0,0 +1,183 @@ +package com.zt.plat.module.qms.resource.material.service; + +import cn.hutool.core.collection.CollUtil; +import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryCheckPageReqVO; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryCheckRespVO; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryCheckSaveReqVO; +import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialInfomationDO; +import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialInventoryCheckBatchDO; +import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialInventoryCheckDetailDO; +import com.zt.plat.module.qms.resource.material.dal.mapper.MaterialInfomationMapper; +import com.zt.plat.module.qms.resource.material.dal.mapper.MaterialInventoryCheckBatchMapper; +import com.zt.plat.module.qms.resource.material.dal.mapper.MaterialInventoryCheckDetailMapper; +import jakarta.validation.Valid; +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.module.qms.resource.material.controller.vo.*; +import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialInventoryCheckDO; +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.MaterialInventoryCheckMapper; + +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 MaterialInventoryCheckServiceImpl implements MaterialInventoryCheckService { + + @Resource + private MaterialInventoryCheckMapper materialInventoryCheckMapper; + + @Resource + private MaterialInventoryCheckBatchMapper materialInventoryCheckBatchMapper;//盘点项目 + + @Resource + private MaterialInventoryCheckDetailMapper materialInventoryCheckDetailMapper;//盘点明细 + + + @Resource + private MaterialInfomationMapper materialInfomationMapper;//物料实例 + + @Override + public MaterialInventoryCheckRespVO createMaterialInventoryCheck(MaterialInventoryCheckSaveReqVO createReqVO) { + // 插入 + MaterialInventoryCheckDO materialInventoryCheck = BeanUtils.toBean(createReqVO, MaterialInventoryCheckDO.class); + materialInventoryCheckMapper.insert(materialInventoryCheck); + // 返回 + return BeanUtils.toBean(materialInventoryCheck, MaterialInventoryCheckRespVO.class); + } + + @Override + public void updateMaterialInventoryCheck(MaterialInventoryCheckSaveReqVO updateReqVO) { + // 校验存在 + validateMaterialInventoryCheckExists(updateReqVO.getId()); + // 更新 + MaterialInventoryCheckDO updateObj = BeanUtils.toBean(updateReqVO, MaterialInventoryCheckDO.class); + materialInventoryCheckMapper.updateById(updateObj); + } + + @Override + public void deleteMaterialInventoryCheck(Long id) { + // 校验存在 + validateMaterialInventoryCheckExists(id); + // 删除 + materialInventoryCheckMapper.deleteById(id); + } + + @Override + public void deleteMaterialInventoryCheckListByIds(List ids) { + // 校验存在 + validateMaterialInventoryCheckExists(ids); + // 删除 + materialInventoryCheckMapper.deleteByIds(ids); + } + + private void validateMaterialInventoryCheckExists(List ids) { + List list = materialInventoryCheckMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(MATERIAL_INVENTORY_CHECK_NOT_EXISTS); + } + } + + private void validateMaterialInventoryCheckExists(Long id) { + if (materialInventoryCheckMapper.selectById(id) == null) { + throw exception(MATERIAL_INVENTORY_CHECK_NOT_EXISTS); + } + } + + @Override + public MaterialInventoryCheckDO getMaterialInventoryCheck(Long id) { + return materialInventoryCheckMapper.selectById(id); + } + + @Override + public PageResult getMaterialInventoryCheckPage(MaterialInventoryCheckPageReqVO pageReqVO) { + return materialInventoryCheckMapper.selectPage(pageReqVO); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public MaterialInventoryCheckRespVO createMaterialInventoryCheckForm(@Valid MaterialInventoryCheckSaveReqVO createReqVO) { + // 校验 batchList 不为空 + if (CollUtil.isEmpty(createReqVO.getBatchList())) { + throw exception(MATERIAL_INVENTORY_CHECK_NOT_EXISTS); + } + + /** 插入库存盘点数据 */ + MaterialInventoryCheckDO materialInventoryCheck = BeanUtils.toBean(createReqVO, MaterialInventoryCheckDO.class); + materialInventoryCheckMapper.insert(materialInventoryCheck); + + MaterialInventoryCheckRespVO resultVo = BeanUtils.toBean(materialInventoryCheck, MaterialInventoryCheckRespVO.class); + + // 获取生成的ID作为父ID + Long parentId = materialInventoryCheck.getId(); + + + /** 插入库存盘点项目数据 */ + List batchList = createReqVO.getBatchList(); + List BatchRespVOList = new ArrayList<>(); + for (MaterialInventoryCheckBatchSaveReqVO batchItem : batchList) { + batchItem.setCheckId(parentId); + // 插入 + MaterialInventoryCheckBatchDO materialInventoryCheckBatch = BeanUtils.toBean(batchItem, MaterialInventoryCheckBatchDO.class); + materialInventoryCheckBatchMapper.insert(materialInventoryCheckBatch); + BatchRespVOList.add(BeanUtils.toBean(materialInventoryCheckBatch, MaterialInventoryCheckBatchRespVO.class)); + } + + /** 根据盘点数据自动填入盘点明细 */ + for (MaterialInventoryCheckBatchRespVO materialInventoryCheckBatchRespVO : BatchRespVOList) { + MaterialInfomationPageReqVO reqVO = new MaterialInfomationPageReqVO(); + reqVO.setProductId(materialInventoryCheckBatchRespVO.getCheckProductId()); + + PageResult materialInfomationDOPageResult = materialInfomationMapper.selectAll(reqVO); + + materialInventoryCheckBatchRespVO.setExpected(String.valueOf(materialInfomationDOPageResult.getList().size()));//以实例数量为应盘数量 + + materialInfomationDOPageResult.getList().forEach(materialInfomationDO -> { + // 插入 + MaterialInventoryCheckDetailDO materialInventoryCheckDetail = new MaterialInventoryCheckDetailDO(); + materialInventoryCheckDetail.setCheckBatchId(materialInventoryCheckBatchRespVO.getId());//盘点项目ID + materialInventoryCheckDetail.setInfomationId(materialInfomationDO.getId());//物料实例ID + materialInventoryCheckDetail.setStatus("0");//待盘点状态 + materialInventoryCheckDetailMapper.insert(materialInventoryCheckDetail); + }); + + } + + + resultVo.setBatchList(BatchRespVOList); + // 返回结果 + return resultVo; + + } + + + @Override + public MaterialInventoryCheckRespVO getMaterialInventoryCheckForm(Long id) { + MaterialInventoryCheckDO micDo = materialInventoryCheckMapper.selectById(id); + if (micDo == null) { + throw exception(MATERIAL_INVENTORY_CHECK_NOT_EXISTS); + } + List BatchDOList= materialInventoryCheckBatchMapper.selectList(new LambdaQueryWrapperX() + .eq(MaterialInventoryCheckBatchDO::getCheckId, micDo.getId())); + + MaterialInventoryCheckRespVO resultVo =BeanUtils.toBean(micDo, MaterialInventoryCheckRespVO.class); + resultVo.setBatchList(BeanUtils.toBean(BatchDOList, MaterialInventoryCheckBatchRespVO.class)); + return resultVo; + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialInventoryInboundDetailService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialInventoryInboundDetailService.java new file mode 100644 index 0000000..551af01 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialInventoryInboundDetailService.java @@ -0,0 +1,69 @@ +package com.zt.plat.module.qms.resource.material.service; + +import java.util.*; + +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryInboundDetailPageReqVO; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryInboundDetailRespVO; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryInboundDetailSaveReqVO; +import jakarta.validation.*; +import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialInventoryInboundDetailDO; +import com.zt.plat.framework.common.pojo.PageResult; + +/** + * 入库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等 Service 接口 + * + * @author 后台管理 + */ +public interface MaterialInventoryInboundDetailService { + + /** + * 创建入库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + MaterialInventoryInboundDetailRespVO createMaterialInventoryInboundDetail(@Valid MaterialInventoryInboundDetailSaveReqVO createReqVO); + + /** + * 更新入库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等 + * + * @param updateReqVO 更新信息 + */ + void updateMaterialInventoryInboundDetail(@Valid MaterialInventoryInboundDetailSaveReqVO updateReqVO); + + /** + * 删除入库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等 + * + * @param id 编号 + */ + void deleteMaterialInventoryInboundDetail(Long id); + + /** + * 批量删除入库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等 + * + * @param ids 编号 + */ + void deleteMaterialInventoryInboundDetailListByIds(List ids); + + /** + * 获得入库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等 + * + * @param id 编号 + * @return 入库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等 + */ + MaterialInventoryInboundDetailDO getMaterialInventoryInboundDetail(Long id); + + /** + * 获得入库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等分页 + * + * @param pageReqVO 分页查询 + * @return 入库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等分页 + */ + PageResult getMaterialInventoryInboundDetailPage(MaterialInventoryInboundDetailPageReqVO pageReqVO); + + + + + PageResult getMaterialInventoryInboundDetailPageList(MaterialInventoryInboundDetailPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialInventoryInboundDetailServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialInventoryInboundDetailServiceImpl.java new file mode 100644 index 0000000..bce83ee --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialInventoryInboundDetailServiceImpl.java @@ -0,0 +1,96 @@ +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.MaterialInventoryInboundDetailPageReqVO; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryInboundDetailRespVO; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryInboundDetailSaveReqVO; +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.MaterialInventoryInboundDetailDO; +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.MaterialInventoryInboundDetailMapper; + +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 MaterialInventoryInboundDetailServiceImpl implements MaterialInventoryInboundDetailService { + + @Resource + private MaterialInventoryInboundDetailMapper materialInventoryInboundDetailMapper; + + @Override + public MaterialInventoryInboundDetailRespVO createMaterialInventoryInboundDetail(MaterialInventoryInboundDetailSaveReqVO createReqVO) { + // 插入 + MaterialInventoryInboundDetailDO materialInventoryInboundDetail = BeanUtils.toBean(createReqVO, MaterialInventoryInboundDetailDO.class); + materialInventoryInboundDetailMapper.insert(materialInventoryInboundDetail); + // 返回 + return BeanUtils.toBean(materialInventoryInboundDetail, MaterialInventoryInboundDetailRespVO.class); + } + + @Override + public void updateMaterialInventoryInboundDetail(MaterialInventoryInboundDetailSaveReqVO updateReqVO) { + // 校验存在 + validateMaterialInventoryInboundDetailExists(updateReqVO.getId()); + // 更新 + MaterialInventoryInboundDetailDO updateObj = BeanUtils.toBean(updateReqVO, MaterialInventoryInboundDetailDO.class); + materialInventoryInboundDetailMapper.updateById(updateObj); + } + + @Override + public void deleteMaterialInventoryInboundDetail(Long id) { + // 校验存在 + validateMaterialInventoryInboundDetailExists(id); + // 删除 + materialInventoryInboundDetailMapper.deleteById(id); + } + + @Override + public void deleteMaterialInventoryInboundDetailListByIds(List ids) { + // 校验存在 + validateMaterialInventoryInboundDetailExists(ids); + // 删除 + materialInventoryInboundDetailMapper.deleteByIds(ids); + } + + private void validateMaterialInventoryInboundDetailExists(List ids) { + List list = materialInventoryInboundDetailMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(MATERIAL_INVENTORY_INBOUND_DETAIL_NOT_EXISTS); + } + } + + private void validateMaterialInventoryInboundDetailExists(Long id) { + if (materialInventoryInboundDetailMapper.selectById(id) == null) { + throw exception(MATERIAL_INVENTORY_INBOUND_DETAIL_NOT_EXISTS); + } + } + + @Override + public MaterialInventoryInboundDetailDO getMaterialInventoryInboundDetail(Long id) { + return materialInventoryInboundDetailMapper.selectById(id); + } + + @Override + public PageResult getMaterialInventoryInboundDetailPage(MaterialInventoryInboundDetailPageReqVO pageReqVO) { + return materialInventoryInboundDetailMapper.selectPage(pageReqVO); + } + + @Override + public PageResult getMaterialInventoryInboundDetailPageList(MaterialInventoryInboundDetailPageReqVO pageReqVO) { + return materialInventoryInboundDetailMapper.selectPageList(pageReqVO); + } +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialInventoryInboundService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialInventoryInboundService.java new file mode 100644 index 0000000..249e7dc --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialInventoryInboundService.java @@ -0,0 +1,78 @@ +package com.zt.plat.module.qms.resource.material.service; + +import java.util.*; + +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryInboundPageReqVO; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryInboundRespVO; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryInboundSaveReqVO; +import jakarta.validation.*; +import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialInventoryInboundDO; +import com.zt.plat.framework.common.pojo.PageResult; + +/** + * 入库 Service 接口 + * + * @author 后台管理 + */ +public interface MaterialInventoryInboundService { + + /** + * 创建入库 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + MaterialInventoryInboundRespVO createMaterialInventoryInbound(@Valid MaterialInventoryInboundSaveReqVO createReqVO); + + /** + * 更新入库 + * + * @param updateReqVO 更新信息 + */ + void updateMaterialInventoryInbound(@Valid MaterialInventoryInboundSaveReqVO updateReqVO); + + /** + * 删除入库 + * + * @param id 编号 + */ + void deleteMaterialInventoryInbound(Long id); + + /** + * 批量删除入库 + * + * @param ids 编号 + */ + void deleteMaterialInventoryInboundListByIds(List ids); + + /** + * 获得入库 + * + * @param id 编号 + * @return 入库 + */ + MaterialInventoryInboundDO getMaterialInventoryInbound(Long id); + + /** + * 获得入库分页 + * + * @param pageReqVO 分页查询 + * @return 入库分页 + */ + PageResult getMaterialInventoryInboundPage(MaterialInventoryInboundPageReqVO pageReqVO); + + + /*** + * 批量入库/上架 + * @param createReqVO + * @return + */ + void multiCreateMaterialInventoryInbound(MaterialInventoryInboundSaveReqVO createReqVO); + + /** + * 单个入库/上架 + */ + PageResultsingleCreateMaterialInventoryInbound(MaterialInventoryInboundSaveReqVO createReqVO); + + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialInventoryInboundServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialInventoryInboundServiceImpl.java new file mode 100644 index 0000000..5024f5e --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialInventoryInboundServiceImpl.java @@ -0,0 +1,191 @@ +package com.zt.plat.module.qms.resource.material.service; + +import cn.hutool.core.collection.CollUtil; +import com.zt.plat.framework.common.exception.ErrorCode; +import com.zt.plat.module.qms.resource.material.controller.vo.*; +import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialBatchAssignDO; +import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialInfomationDO; +import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialInventoryInboundDetailDO; +import com.zt.plat.module.qms.resource.material.dal.mapper.MaterialBatchAssignMapper; +import com.zt.plat.module.qms.resource.material.dal.mapper.MaterialInfomationMapper; +import com.zt.plat.module.qms.resource.material.dal.mapper.MaterialInventoryInboundDetailMapper; +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.module.qms.resource.material.dal.dataobject.MaterialInventoryInboundDO; +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.MaterialInventoryInboundMapper; + +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 MaterialInventoryInboundServiceImpl implements MaterialInventoryInboundService { + + @Resource + private MaterialInventoryInboundMapper materialInventoryInboundMapper;//入库 + + @Resource + private MaterialInventoryInboundDetailMapper materialInventoryInboundDetailMapper;//入库明细 + + @Resource + private MaterialInfomationMapper materialInfomationMapper;//物料实例 + + @Resource + private MaterialBatchAssignMapper materialBatchAssignMapper;//批次分配 + + @Override + public MaterialInventoryInboundRespVO createMaterialInventoryInbound(MaterialInventoryInboundSaveReqVO createReqVO) { + // 插入 + MaterialInventoryInboundDO materialInventoryInbound = BeanUtils.toBean(createReqVO, MaterialInventoryInboundDO.class); + materialInventoryInboundMapper.insert(materialInventoryInbound); + // 返回 + return BeanUtils.toBean(materialInventoryInbound, MaterialInventoryInboundRespVO.class); + } + + @Override + public void updateMaterialInventoryInbound(MaterialInventoryInboundSaveReqVO updateReqVO) { + // 校验存在 + validateMaterialInventoryInboundExists(updateReqVO.getId()); + // 更新 + MaterialInventoryInboundDO updateObj = BeanUtils.toBean(updateReqVO, MaterialInventoryInboundDO.class); + materialInventoryInboundMapper.updateById(updateObj); + } + + @Override + public void deleteMaterialInventoryInbound(Long id) { + // 校验存在 + validateMaterialInventoryInboundExists(id); + // 删除 + materialInventoryInboundMapper.deleteById(id); + } + + @Override + public void deleteMaterialInventoryInboundListByIds(List ids) { + // 校验存在 + validateMaterialInventoryInboundExists(ids); + // 删除 + materialInventoryInboundMapper.deleteByIds(ids); + } + + private void validateMaterialInventoryInboundExists(List ids) { + List list = materialInventoryInboundMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(MATERIAL_INVENTORY_INBOUND_NOT_EXISTS); + } + } + + private void validateMaterialInventoryInboundExists(Long id) { + if (materialInventoryInboundMapper.selectById(id) == null) { + throw exception(MATERIAL_INVENTORY_INBOUND_NOT_EXISTS); + } + } + + @Override + public MaterialInventoryInboundDO getMaterialInventoryInbound(Long id) { + return materialInventoryInboundMapper.selectById(id); + } + + @Override + public PageResult getMaterialInventoryInboundPage(MaterialInventoryInboundPageReqVO pageReqVO) { + return materialInventoryInboundMapper.selectPage(pageReqVO); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void multiCreateMaterialInventoryInbound(MaterialInventoryInboundSaveReqVO createReqVO) { + MaterialInventoryInboundDetailSaveReqVO detail = createReqVO.getDetail(); + + //判断输入数量是否大于批次剩余数据 + this.quantityCheck(detail); + //生成入库头数据 + MaterialInventoryInboundDO materialInventoryInbound = BeanUtils.toBean(createReqVO, MaterialInventoryInboundDO.class); + materialInventoryInboundMapper.insert(materialInventoryInbound); + + + + //根据入库数量创建实例数据 + List MaterialInfomationDO = new ArrayList(); + for (int i = 0; i < detail.getQuantity(); i++) { + MaterialInfomationDO materialInfomation = new MaterialInfomationDO(); + materialInfomation.setBatchId(detail.getBatchAssignId());//分发批次ID + materialInfomation.setLocationId(detail.getLocationId());//货位Id + materialInfomation.setInventoryInboundId(materialInventoryInbound.getId());//入库ID,批量入库的,所以为同一ID,主要是验收申请入库时不一样 + materialInfomation.setProductId(detail.getProductId());//分类ID + materialInfomation.setPublishStatus("1");//批量入库默认上架 + MaterialInfomationDO.add(materialInfomation); + } + + materialInfomationMapper.insert(MaterialInfomationDO); + + + //根据实例数据创建入库明细 + MaterialInfomationPageReqVO InfomationVO = new MaterialInfomationPageReqVO(); + InfomationVO.setInventoryInboundId(materialInventoryInbound.getId()); + PageResult InfomationList = materialInfomationMapper.selectPage(InfomationVO); + InfomationList.getList().forEach(item -> { + MaterialInventoryInboundDetailDO detailDO = new MaterialInventoryInboundDetailDO(); + detailDO.setInboundId(materialInventoryInbound.getId()); + detailDO.setMaterialInfomationId(item.getId()); + detailDO.setInboundWay("批量入库"); + materialInventoryInboundDetailMapper.insert(detailDO); + }); + } + + @Override + public PageResult singleCreateMaterialInventoryInbound(MaterialInventoryInboundSaveReqVO createReqVO) { + + MaterialInventoryInboundDetailSaveReqVO detail = createReqVO.getDetail(); + + //判断输入数量是否大于批次剩余数据 + this.quantityCheck(detail); + //生成入库头数据 + MaterialInventoryInboundDO materialInventoryInbound = BeanUtils.toBean(createReqVO, MaterialInventoryInboundDO.class); + materialInventoryInboundMapper.insert(materialInventoryInbound); + + //根据实例数据创建入库明细 + MaterialInfomationPageReqVO InfomationVO = new MaterialInfomationPageReqVO(); + InfomationVO.setInventoryInboundId(materialInventoryInbound.getId()); + PageResult InfomationList = materialInfomationMapper.selectPage(InfomationVO); + InfomationList.getList().forEach(item -> { + MaterialInventoryInboundDetailDO detailDO = new MaterialInventoryInboundDetailDO(); + detailDO.setInboundId(materialInventoryInbound.getId()); + detailDO.setMaterialInfomationId(item.getId()); + detailDO.setInboundWay("采购入库"); + materialInventoryInboundDetailMapper.insert(detailDO); + }); + + return null; + } + + private void quantityCheck(MaterialInventoryInboundDetailSaveReqVO detail) { + if (detail.getBatchAssignId() == null || detail.getQuantity() == null) { + throw exception(MATERIAL_BATCH_ASSIGN_NOT_EXISTS); + } + + MaterialBatchAssignDO materialBatchAssignDO = materialBatchAssignMapper.selectById(detail.getBatchAssignId()); + if (materialBatchAssignDO==null){ + throw exception(new ErrorCode(1_032_150_000, "批次信息错误-"+detail.getBatchAssignId())); + } + + //判断输入数量是否大于批次剩余数据 + if (materialBatchAssignDO.getInboundQuantity() < detail.getQuantity()) { + throw exception(new ErrorCode(1_032_150_000, "批次剩余量不足")); + } + } + + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialInventoryOutboundDetailService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialInventoryOutboundDetailService.java new file mode 100644 index 0000000..ab949c0 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialInventoryOutboundDetailService.java @@ -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.MaterialInventoryOutboundDetailPageReqVO; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryOutboundDetailRespVO; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryOutboundDetailSaveReqVO; +import jakarta.validation.*; +import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialInventoryOutboundDetailDO; +import com.zt.plat.framework.common.pojo.PageResult; + +/** + * 出库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等 Service 接口 + * + * @author 后台管理 + */ +public interface MaterialInventoryOutboundDetailService { + + /** + * 创建出库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + MaterialInventoryOutboundDetailRespVO createMaterialInventoryOutboundDetail(@Valid MaterialInventoryOutboundDetailSaveReqVO createReqVO); + + /** + * 更新出库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等 + * + * @param updateReqVO 更新信息 + */ + void updateMaterialInventoryOutboundDetail(@Valid MaterialInventoryOutboundDetailSaveReqVO updateReqVO); + + /** + * 删除出库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等 + * + * @param id 编号 + */ + void deleteMaterialInventoryOutboundDetail(Long id); + + /** + * 批量删除出库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等 + * + * @param ids 编号 + */ + void deleteMaterialInventoryOutboundDetailListByIds(List ids); + + /** + * 获得出库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等 + * + * @param id 编号 + * @return 出库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等 + */ + MaterialInventoryOutboundDetailDO getMaterialInventoryOutboundDetail(Long id); + + /** + * 获得出库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等分页 + * + * @param pageReqVO 分页查询 + * @return 出库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等分页 + */ + PageResult getMaterialInventoryOutboundDetailPage(MaterialInventoryOutboundDetailPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialInventoryOutboundDetailServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialInventoryOutboundDetailServiceImpl.java new file mode 100644 index 0000000..f671f57 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialInventoryOutboundDetailServiceImpl.java @@ -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.MaterialInventoryOutboundDetailPageReqVO; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryOutboundDetailRespVO; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryOutboundDetailSaveReqVO; +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.MaterialInventoryOutboundDetailDO; +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.MaterialInventoryOutboundDetailMapper; + +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 MaterialInventoryOutboundDetailServiceImpl implements MaterialInventoryOutboundDetailService { + + @Resource + private MaterialInventoryOutboundDetailMapper materialInventoryOutboundDetailMapper; + + @Override + public MaterialInventoryOutboundDetailRespVO createMaterialInventoryOutboundDetail(MaterialInventoryOutboundDetailSaveReqVO createReqVO) { + // 插入 + MaterialInventoryOutboundDetailDO materialInventoryOutboundDetail = BeanUtils.toBean(createReqVO, MaterialInventoryOutboundDetailDO.class); + materialInventoryOutboundDetailMapper.insert(materialInventoryOutboundDetail); + // 返回 + return BeanUtils.toBean(materialInventoryOutboundDetail, MaterialInventoryOutboundDetailRespVO.class); + } + + @Override + public void updateMaterialInventoryOutboundDetail(MaterialInventoryOutboundDetailSaveReqVO updateReqVO) { + // 校验存在 + validateMaterialInventoryOutboundDetailExists(updateReqVO.getId()); + // 更新 + MaterialInventoryOutboundDetailDO updateObj = BeanUtils.toBean(updateReqVO, MaterialInventoryOutboundDetailDO.class); + materialInventoryOutboundDetailMapper.updateById(updateObj); + } + + @Override + public void deleteMaterialInventoryOutboundDetail(Long id) { + // 校验存在 + validateMaterialInventoryOutboundDetailExists(id); + // 删除 + materialInventoryOutboundDetailMapper.deleteById(id); + } + + @Override + public void deleteMaterialInventoryOutboundDetailListByIds(List ids) { + // 校验存在 + validateMaterialInventoryOutboundDetailExists(ids); + // 删除 + materialInventoryOutboundDetailMapper.deleteByIds(ids); + } + + private void validateMaterialInventoryOutboundDetailExists(List ids) { + List list = materialInventoryOutboundDetailMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(MATERIAL_INVENTORY_OUTBOUND_DETAIL_NOT_EXISTS); + } + } + + private void validateMaterialInventoryOutboundDetailExists(Long id) { + if (materialInventoryOutboundDetailMapper.selectById(id) == null) { + throw exception(MATERIAL_INVENTORY_OUTBOUND_DETAIL_NOT_EXISTS); + } + } + + @Override + public MaterialInventoryOutboundDetailDO getMaterialInventoryOutboundDetail(Long id) { + return materialInventoryOutboundDetailMapper.selectById(id); + } + + @Override + public PageResult getMaterialInventoryOutboundDetailPage(MaterialInventoryOutboundDetailPageReqVO pageReqVO) { + return materialInventoryOutboundDetailMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialInventoryOutboundService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialInventoryOutboundService.java new file mode 100644 index 0000000..dc531df --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialInventoryOutboundService.java @@ -0,0 +1,74 @@ +package com.zt.plat.module.qms.resource.material.service; + +import java.util.*; + +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryOutboundPageReqVO; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryOutboundRespVO; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryOutboundSaveReqVO; +import jakarta.validation.*; +import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialInventoryOutboundDO; +import com.zt.plat.framework.common.pojo.PageResult; + +/** + * 出库 Service 接口 + * + * @author 后台管理 + */ +public interface MaterialInventoryOutboundService { + + /** + * 创建出库 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + MaterialInventoryOutboundRespVO createMaterialInventoryOutbound(@Valid MaterialInventoryOutboundSaveReqVO createReqVO); + + /** + * 更新出库 + * + * @param updateReqVO 更新信息 + */ + void updateMaterialInventoryOutbound(@Valid MaterialInventoryOutboundSaveReqVO updateReqVO); + + /** + * 删除出库 + * + * @param id 编号 + */ + void deleteMaterialInventoryOutbound(Long id); + + /** + * 批量删除出库 + * + * @param ids 编号 + */ + void deleteMaterialInventoryOutboundListByIds(List ids); + + /** + * 获得出库 + * + * @param id 编号 + * @return 出库 + */ + MaterialInventoryOutboundDO getMaterialInventoryOutbound(Long id); + + /** + * 获得出库分页 + * + * @param pageReqVO 分页查询 + * @return 出库分页 + */ + PageResult getMaterialInventoryOutboundPage(MaterialInventoryOutboundPageReqVO pageReqVO); + + /** + * 创建出库 + * + * 连带出库明细一起创建 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + MaterialInventoryOutboundRespVO createMaterialInventoryOutboundAll(@Valid MaterialInventoryOutboundSaveReqVO createReqVO); + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialInventoryOutboundServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialInventoryOutboundServiceImpl.java new file mode 100644 index 0000000..1224937 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialInventoryOutboundServiceImpl.java @@ -0,0 +1,132 @@ +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.*; +import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialInventoryOutboundDetailDO; +import com.zt.plat.module.qms.resource.material.dal.mapper.MaterialInventoryOutboundDetailMapper; +import jakarta.validation.Valid; +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.module.qms.resource.material.dal.dataobject.MaterialInventoryOutboundDO; +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.MaterialInventoryOutboundMapper; + +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 MaterialInventoryOutboundServiceImpl implements MaterialInventoryOutboundService { + + @Resource + private MaterialInventoryOutboundMapper materialInventoryOutboundMapper; + + @Resource + private MaterialInventoryOutboundDetailMapper materialInventoryOutboundDetailMapper; + + @Override + public MaterialInventoryOutboundRespVO createMaterialInventoryOutbound(MaterialInventoryOutboundSaveReqVO createReqVO) { + // 插入 + MaterialInventoryOutboundDO materialInventoryOutbound = BeanUtils.toBean(createReqVO, MaterialInventoryOutboundDO.class); + materialInventoryOutboundMapper.insert(materialInventoryOutbound); + // 返回 + return BeanUtils.toBean(materialInventoryOutbound, MaterialInventoryOutboundRespVO.class); + } + + @Override + public void updateMaterialInventoryOutbound(MaterialInventoryOutboundSaveReqVO updateReqVO) { + // 校验存在 + validateMaterialInventoryOutboundExists(updateReqVO.getId()); + // 更新 + MaterialInventoryOutboundDO updateObj = BeanUtils.toBean(updateReqVO, MaterialInventoryOutboundDO.class); + materialInventoryOutboundMapper.updateById(updateObj); + } + + @Override + public void deleteMaterialInventoryOutbound(Long id) { + // 校验存在 + validateMaterialInventoryOutboundExists(id); + // 删除 + materialInventoryOutboundMapper.deleteById(id); + } + + @Override + public void deleteMaterialInventoryOutboundListByIds(List ids) { + // 校验存在 + validateMaterialInventoryOutboundExists(ids); + // 删除 + materialInventoryOutboundMapper.deleteByIds(ids); + } + + private void validateMaterialInventoryOutboundExists(List ids) { + List list = materialInventoryOutboundMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(MATERIAL_INVENTORY_OUTBOUND_NOT_EXISTS); + } + } + + private void validateMaterialInventoryOutboundExists(Long id) { + if (materialInventoryOutboundMapper.selectById(id) == null) { + throw exception(MATERIAL_INVENTORY_OUTBOUND_NOT_EXISTS); + } + } + + @Override + public MaterialInventoryOutboundDO getMaterialInventoryOutbound(Long id) { + return materialInventoryOutboundMapper.selectById(id); + } + + @Override + public PageResult getMaterialInventoryOutboundPage(MaterialInventoryOutboundPageReqVO pageReqVO) { + return materialInventoryOutboundMapper.selectPage(pageReqVO); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public MaterialInventoryOutboundRespVO createMaterialInventoryOutboundAll(@Valid MaterialInventoryOutboundSaveReqVO createReqVO) { + + + /** 创建出库头 */ + // 插入 + MaterialInventoryOutboundDO materialInventoryOutbound = BeanUtils.toBean(createReqVO, MaterialInventoryOutboundDO.class); + materialInventoryOutboundMapper.insert(materialInventoryOutbound); + + MaterialInventoryOutboundRespVO respVO = BeanUtils.toBean(materialInventoryOutbound, MaterialInventoryOutboundRespVO.class); + + /** 创建出出库明细 */ + // 校验存在 + if (createReqVO.getDetailSaveReqVoList() == null || createReqVO.getDetailSaveReqVoList().size() == 0) + throw exception(MATERIAL_INVENTORY_OUTBOUND_DETAIL_NOT_EXISTS); + + List detailReqVoList = new ArrayList<>(); + + for (MaterialInventoryOutboundDetailSaveReqVO itemVo : createReqVO.getDetailSaveReqVoList()) { + MaterialInventoryOutboundDetailDO materialInventoryOutboundDetail = BeanUtils.toBean(itemVo, MaterialInventoryOutboundDetailDO.class); + + // 设置出库单id + materialInventoryOutboundDetail.setParentId(materialInventoryOutbound.getId()); + + materialInventoryOutboundDetailMapper.insert(materialInventoryOutboundDetail); + detailReqVoList.add(BeanUtils.toBean(materialInventoryOutboundDetail, MaterialInventoryOutboundDetailRespVO.class)); + } + + respVO.setDetailReqVoList(detailReqVoList); + + + // 返回 + return respVO; + } +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialInventoryService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialInventoryService.java new file mode 100644 index 0000000..b597c11 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialInventoryService.java @@ -0,0 +1,31 @@ +package com.zt.plat.module.qms.resource.material.service; + +import com.zt.plat.framework.common.pojo.PageResult; + +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryPageReqVO; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryRespVO; +import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialInventoryDO; +import jakarta.validation.Valid; + +import java.util.List; + +/** + * 库存管理 Service 接口 + * + * @author 后台管理 + */ +public interface MaterialInventoryService { + + + /** + * 单个入库/上架 + */ + PageResult getMaterialInventoryPage(MaterialInventoryRespVO pageReqVO); + + /** + * 同意出库 + */ + + void agreeMaterialInventoryOutbound(Long id); + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialInventoryServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialInventoryServiceImpl.java new file mode 100644 index 0000000..42182d9 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialInventoryServiceImpl.java @@ -0,0 +1,76 @@ +package com.zt.plat.module.qms.resource.material.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.util.object.BeanUtils; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleEntrustRegistrationExtendRespVO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleEntrustRegistrationDO; +import com.zt.plat.module.qms.enums.QmsCommonConstant; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryOutboundDetailPageReqVO; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryOutboundPageReqVO; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryRespVO; +import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialInfomationDO; +import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialInventoryDO; +import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialInventoryOutboundDetailDO; +import com.zt.plat.module.qms.resource.material.dal.mapper.MaterialInfomationMapper; +import com.zt.plat.module.qms.resource.material.dal.mapper.MaterialInventoryMapper; +import com.zt.plat.module.qms.resource.material.dal.mapper.MaterialInventoryOutboundDetailMapper; +import jakarta.annotation.Resource; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; +import java.util.stream.Collectors; + +import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.zt.plat.module.qms.enums.ErrorCodeConstants.MATERIAL_INFOMATION_NOT_EXISTS; + +@Service +public class MaterialInventoryServiceImpl implements MaterialInventoryService { + @Resource + private MaterialInventoryMapper materialInventoryMapper; + + @Resource + private MaterialInventoryOutboundDetailMapper materialInventoryOutboundDetailMapper;//出库明细 + + @Resource + private MaterialInfomationMapper materialInfomationMapper;//物料实例 + @Override + public PageResult getMaterialInventoryPage(MaterialInventoryRespVO pageReqVO) { + IPage page = new Page<>(pageReqVO.getPageNo(), pageReqVO.getPageSize()); + + IPage pageList = materialInventoryMapper.selectPageList(page, pageReqVO); + PageResult pageResult = new PageResult<>(pageList.getRecords(), pageList.getTotal()); + return BeanUtils.toBean(pageResult, MaterialInventoryDO.class); + + } + + @Override + @Transactional + public void agreeMaterialInventoryOutbound(Long outId) { + MaterialInventoryOutboundDetailPageReqVO pageReqVO = new MaterialInventoryOutboundDetailPageReqVO(); + pageReqVO.setParentId(outId); + pageReqVO.setPageSize(-1);//不分页 + PageResult materialInventoryOutboundDetailDOPageResult = materialInventoryOutboundDetailMapper.selectPage(pageReqVO); + + List list = materialInventoryOutboundDetailDOPageResult.getList(); + for (MaterialInventoryOutboundDetailDO item : list) { + // 校验存在 + validateMaterialInfomationExists(item.getInfomationId()); + // 更新 + MaterialInfomationDO updateObj = new MaterialInfomationDO(); + updateObj.setId(item.getInfomationId()); + updateObj.setUsageStatus("1"); + materialInfomationMapper.updateById(updateObj); + } + + + } + + private void validateMaterialInfomationExists(Long id) { + if (materialInfomationMapper.selectById(id) == null) { + throw exception(MATERIAL_INFOMATION_NOT_EXISTS); + } + } +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialLifecycleDetailService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialLifecycleDetailService.java new file mode 100644 index 0000000..e6ce97c --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialLifecycleDetailService.java @@ -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 ids); + + /** + * 获得物料通用流程明细,对应生命周期的明细 + * + * @param id 编号 + * @return 物料通用流程明细,对应生命周期的明细 + */ + MaterialLifecycleDetailDO getMaterialLifecycleDetail(Long id); + + /** + * 获得物料通用流程明细,对应生命周期的明细分页 + * + * @param pageReqVO 分页查询 + * @return 物料通用流程明细,对应生命周期的明细分页 + */ + PageResult getMaterialLifecycleDetailPage(MaterialLifecycleDetailPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialLifecycleDetailServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialLifecycleDetailServiceImpl.java new file mode 100644 index 0000000..aee89af --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialLifecycleDetailServiceImpl.java @@ -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 ids) { + // 校验存在 + validateMaterialLifecycleDetailExists(ids); + // 删除 + materialLifecycleDetailMapper.deleteByIds(ids); + } + + private void validateMaterialLifecycleDetailExists(List ids) { + List 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 getMaterialLifecycleDetailPage(MaterialLifecycleDetailPageReqVO pageReqVO) { + return materialLifecycleDetailMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialLifecycleService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialLifecycleService.java new file mode 100644 index 0000000..930593a --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialLifecycleService.java @@ -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 ids); + + /** + * 获得物料通用流程 + * + * @param id 编号 + * @return 物料通用流程 + */ + MaterialLifecycleDO getMaterialLifecycle(Long id); + + /** + * 获得物料通用流程分页 + * + * @param pageReqVO 分页查询 + * @return 物料通用流程分页 + */ + PageResult getMaterialLifecyclePage(MaterialLifecyclePageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialLifecycleServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialLifecycleServiceImpl.java new file mode 100644 index 0000000..05a8579 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialLifecycleServiceImpl.java @@ -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 ids) { + // 校验存在 + validateMaterialLifecycleExists(ids); + // 删除 + materialLifecycleMapper.deleteByIds(ids); + } + + private void validateMaterialLifecycleExists(List ids) { + List 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 getMaterialLifecyclePage(MaterialLifecyclePageReqVO pageReqVO) { + return materialLifecycleMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialLocationService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialLocationService.java new file mode 100644 index 0000000..69bc21a --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialLocationService.java @@ -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.MaterialLocationPageReqVO; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialLocationRespVO; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialLocationSaveReqVO; +import jakarta.validation.*; +import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialLocationDO; +import com.zt.plat.framework.common.pojo.PageResult; + +/** + * 存放位置 Service 接口 + * + * @author 后台管理 + */ +public interface MaterialLocationService { + + /** + * 创建存放位置 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + MaterialLocationRespVO createMaterialLocation(@Valid MaterialLocationSaveReqVO createReqVO); + + /** + * 更新存放位置 + * + * @param updateReqVO 更新信息 + */ + void updateMaterialLocation(@Valid MaterialLocationSaveReqVO updateReqVO); + + /** + * 删除存放位置 + * + * @param id 编号 + */ + void deleteMaterialLocation(Long id); + + /** + * 批量删除存放位置 + * + * @param ids 编号 + */ + void deleteMaterialLocationListByIds(List ids); + + /** + * 获得存放位置 + * + * @param id 编号 + * @return 存放位置 + */ + MaterialLocationDO getMaterialLocation(Long id); + + /** + * 获得存放位置分页 + * + * @param pageReqVO 分页查询 + * @return 存放位置分页 + */ + PageResult getMaterialLocationPage(MaterialLocationPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialLocationServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialLocationServiceImpl.java new file mode 100644 index 0000000..a6e755e --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialLocationServiceImpl.java @@ -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.MaterialLocationPageReqVO; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialLocationRespVO; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialLocationSaveReqVO; +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.MaterialLocationDO; +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.MaterialLocationMapper; + +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 MaterialLocationServiceImpl implements MaterialLocationService { + + @Resource + private MaterialLocationMapper materialLocationMapper; + + @Override + public MaterialLocationRespVO createMaterialLocation(MaterialLocationSaveReqVO createReqVO) { + // 插入 + MaterialLocationDO materialLocation = BeanUtils.toBean(createReqVO, MaterialLocationDO.class); + materialLocationMapper.insert(materialLocation); + // 返回 + return BeanUtils.toBean(materialLocation, MaterialLocationRespVO.class); + } + + @Override + public void updateMaterialLocation(MaterialLocationSaveReqVO updateReqVO) { + // 校验存在 + validateMaterialLocationExists(updateReqVO.getId()); + // 更新 + MaterialLocationDO updateObj = BeanUtils.toBean(updateReqVO, MaterialLocationDO.class); + materialLocationMapper.updateById(updateObj); + } + + @Override + public void deleteMaterialLocation(Long id) { + // 校验存在 + validateMaterialLocationExists(id); + // 删除 + materialLocationMapper.deleteById(id); + } + + @Override + public void deleteMaterialLocationListByIds(List ids) { + // 校验存在 + validateMaterialLocationExists(ids); + // 删除 + materialLocationMapper.deleteByIds(ids); + } + + private void validateMaterialLocationExists(List ids) { + List list = materialLocationMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(MATERIAL_LOCATION_NOT_EXISTS); + } + } + + private void validateMaterialLocationExists(Long id) { + if (materialLocationMapper.selectById(id) == null) { + throw exception(MATERIAL_LOCATION_NOT_EXISTS); + } + } + + @Override + public MaterialLocationDO getMaterialLocation(Long id) { + return materialLocationMapper.selectById(id); + } + + @Override + public PageResult getMaterialLocationPage(MaterialLocationPageReqVO pageReqVO) { + return materialLocationMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/thirdpartyapi/service/AutoIngredientsServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/thirdpartyapi/service/AutoIngredientsServiceImpl.java index 90c6d10..7bd8d4f 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/thirdpartyapi/service/AutoIngredientsServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/thirdpartyapi/service/AutoIngredientsServiceImpl.java @@ -34,6 +34,7 @@ import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubSampleMapper; import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSampleMethodConfInfo; import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSampleMethodConfItem; import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSampleMethodConfPoint; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSampleMethodExtendRespVO; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSubSampleMethodDO; import com.zt.plat.module.qms.business.config.dal.mapper.ConfigSubSampleMethodMapper; import com.zt.plat.module.qms.enums.QmsCommonConstant; @@ -115,7 +116,7 @@ public class AutoIngredientsServiceImpl implements AutoIngredientsService { List configSubSampleIdList = list.stream().map(m -> m.getConfigSubSampleId()).distinct().collect(Collectors.toList()); //子样配置方法 - List configSubSampleMethodList = configSubSampleMethodMapper.selectByConfigSubSampleIdsAndConfigAssayMethodId(configSubSampleIdList, businessAssayTaskDO.getConfigAssayMethodId()); + List configSubSampleMethodList = configSubSampleMethodMapper.selectByConfigSubSampleIdsAndConfigAssayMethodId(configSubSampleIdList, businessAssayTaskDO.getConfigAssayMethodId()); //分析任务id列表 List businessAssayTaskDataIdList = list.stream().map(m -> m.getId()).collect(Collectors.toList()); @@ -135,7 +136,7 @@ public class AutoIngredientsServiceImpl implements AutoIngredientsService { //分析人员信息 AdminUserRespDTO user = userList.stream().filter(f -> f.getId().equals(m.getAssayOperatorId())).findFirst().orElse(null); //子样配置信息 - ConfigSubSampleMethodDO configSubSampleMethodDO = configSubSampleMethodList.stream().filter(f -> f.getConfigSubSampleId().equals(m.getConfigSubSampleId())).findFirst().orElse(null); + ConfigSubSampleMethodExtendRespVO configSubSampleMethodDO = configSubSampleMethodList.stream().filter(f -> f.getConfigSubSampleId().equals(m.getConfigSubSampleId())).findFirst().orElse(null); String configInfomation = configSubSampleMethodDO.getConfigInfomation(); //当前检测项目列表 List currentBusinessAssayProjectDataList = businessAssayProjectDataList.stream().filter(f -> f.getBusinessAssayTaskDataId().equals(m.getId())).collect(Collectors.toList()); @@ -196,7 +197,7 @@ public class AutoIngredientsServiceImpl implements AutoIngredientsService { //子样配置id列表 List configSubSampleIdList = businessSubSampleDOList.stream().map(m -> m.getConfigSubSampleId()).distinct().collect(Collectors.toList()); //子样配置方法 - List configSubSampleMethodList = configSubSampleMethodMapper.selectByConfigSubSampleIdsAndConfigAssayMethodId(configSubSampleIdList, businessAssayTaskDO.getConfigAssayMethodId()); + List configSubSampleMethodList = configSubSampleMethodMapper.selectByConfigSubSampleIdsAndConfigAssayMethodId(configSubSampleIdList, businessAssayTaskDO.getConfigAssayMethodId()); List businessAssayProjectDataList = businessAssayProjectDataMapper.selectByBusinessAssayTaskDataIds(businessAssayTaskDataIdList); List businessAssayProjectDataIdList = businessAssayProjectDataList.stream().map(m -> m.getId()).collect(Collectors.toList()); @@ -210,7 +211,7 @@ public class AutoIngredientsServiceImpl implements AutoIngredientsService { BusinessSubSampleDO businessSubSampleDO = businessSubSampleDOList.stream().filter(f -> f.getId().equals(businessAssayTaskDataDO.getBusinessSubSampleId())).findFirst().orElse(null); //子样配置信息 - ConfigSubSampleMethodDO configSubSampleMethodDO = configSubSampleMethodList.stream().filter(f -> f.getConfigSubSampleId().equals(businessSubSampleDO.getConfigSubSampleId())).findFirst().orElse(null); + ConfigSubSampleMethodExtendRespVO configSubSampleMethodDO = configSubSampleMethodList.stream().filter(f -> f.getConfigSubSampleId().equals(businessSubSampleDO.getConfigSubSampleId())).findFirst().orElse(null); String configInfomation = configSubSampleMethodDO.getConfigInfomation(); if (StringUtils.isNotBlank(configInfomation)) { ConfigSubSampleMethodConfInfo configSubSampleMethodConfInfo = JSON.parseObject(configInfomation, ConfigSubSampleMethodConfInfo.class); diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/thirdpartyapi/service/XRFDataServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/thirdpartyapi/service/XRFDataServiceImpl.java index ebe2461..72402b3 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/thirdpartyapi/service/XRFDataServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/thirdpartyapi/service/XRFDataServiceImpl.java @@ -19,10 +19,17 @@ import com.zt.plat.framework.common.util.object.BeanUtils; import com.zt.plat.module.qms.business.bus.controller.vo.*; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayProjectDataDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDataDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCManagementDataDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCManagementProjectDataDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessXRFDataDO; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayProjectDataMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayTaskDataMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCCoefficientDataMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCCoefficientParameterDataMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCManagementDataMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCManagementProjectDataMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessXRFDataMapper; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectDO; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigXRFConversionRateDO; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigXRFLineDO; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigXRFProjectDO; @@ -60,6 +67,18 @@ public class XRFDataServiceImpl implements XRFDataService { @Resource private BusinessAssayProjectDataMapper businessAssayProjectDataMapper; + + @Resource + private BusinessQCManagementDataMapper businessQCManagementDataMapper; + + @Resource + private BusinessQCManagementProjectDataMapper businessQCManagementProjectDataMapper; + + @Resource + private BusinessQCCoefficientDataMapper businessQCCoefficientDataMapper; + + @Resource + private BusinessQCCoefficientParameterDataMapper businessQCCoefficientParameterDataMapper; @Override public List getXrfLineList(String deviceNo) { @@ -82,6 +101,9 @@ public class XRFDataServiceImpl implements XRFDataService { //获取荧光样品id列表 List sampleIdList = xrfDeviceSampleList.stream().map(XRFDeviceSampleReqVO::getSampleId).collect(Collectors.toList()); + //获取荧光样品编号列表 + List sampleCodeList = xrfDeviceSampleList.stream().map(m -> m.getSampleCode()).collect(Collectors.toList()); + //查询数据库是否已保存了荧光数据 BusinessXRFDataReqVO existXRFDataSearch = new BusinessXRFDataReqVO(); existXRFDataSearch.setDeviceNo(xrfDeviceSampleFirst.getDeviceNo()); @@ -95,9 +117,20 @@ public class XRFDataServiceImpl implements XRFDataService { } //根据设备编号查询荧光元素配置 List conYgElementList = configXRFProjectMapper.selectByDeviceNo(xrfDeviceSampleFirst.getDeviceNo()); + + //根据样品编号及分析方法类型,获取检测任务数据 + List businessAssayTaskDataList = businessAssayTaskDataMapper.selectBySampleAssayCodesAndConfigAssayMethodDictionaryBusinessKey(sampleCodeList, "xshxyggpf"); + + //管理样和标准样 + List businessQCManagementDataList = businessQCManagementDataMapper.selectBySampleAssayCodesAndConfigAssayMethodDictionaryBusinessKey(sampleCodeList, "xshxyggpf"); + + //空白样和标样 +// List businessQCCoefficientDataList = businessQCCoefficientDataMapper.selectBySampleAssayCodesAndConfigAssayMethodDictionaryBusinessKey(sampleCodeList, "xshxyggpf"); List businessAssayTaskDataDOList = new ArrayList<>(); List busElementValueList = new ArrayList<>(); + List busQcManageElementValueList = new ArrayList<>(); +// List busQccParameterValueList = new ArrayList<>(); List busYgDataList = new ArrayList<>(); BusinessXRFDataDO busYgData = null; for (XRFDeviceSampleReqVO ygDeviceSample : xrfDeviceSampleList) { @@ -127,12 +160,33 @@ public class XRFDataServiceImpl implements XRFDataService { //处理匹配 + //a. 分析样 List tempBusElementValueList = new ArrayList<>(); - BusinessAssayTaskDataExtendRespVO businessAssayTaskData = businessAssayTaskDataMapper.selectBySampleCode(ygDeviceSample.getSampleCode()); - if (businessAssayTaskData != null) { - List busElementValues = businessAssayProjectDataMapper.selectByBusinessAssayTaskDataId(businessAssayTaskData.getId()); - tempBusElementValueList.addAll(busElementValues); + List currBusinessAssayTaskDataList = businessAssayTaskDataList.stream().filter(f -> ygDeviceSample.getSampleCode().equals(f.getSampleAssayCode())).collect(Collectors.toList()); + if (currBusinessAssayTaskDataList != null && currBusinessAssayTaskDataList.size() > 0) { + for (BusinessAssayTaskDataExtendRespVO businessAssayTaskData : currBusinessAssayTaskDataList) { + List busElementValues = businessAssayProjectDataMapper.selectByBusinessAssayTaskDataId(businessAssayTaskData.getId()); + tempBusElementValueList.addAll(busElementValues); + } } + //b. 管理样和标准样 + List tempBusinessQCManagementProjectDataList = new ArrayList<>(); + List currBusinessQCManagementDataList = businessQCManagementDataList.stream().filter(f -> ygDeviceSample.getSampleCode().equals(f.getSampleCode())).collect(Collectors.toList()); + if (currBusinessQCManagementDataList != null && currBusinessQCManagementDataList.size() > 0) { + for (BusinessQCManagementDataDO businessQCManagementData : currBusinessQCManagementDataList) { + List businessQCManagementProjectDataList = businessQCManagementProjectDataMapper.selectByBusinessQCManagementDataId(businessQCManagementData.getId()); + tempBusinessQCManagementProjectDataList.addAll(businessQCManagementProjectDataList); + } + } + //c. 空白样和标样 +// List tempBusinessQCCoefficientParameterDataList = new ArrayList<>(); +// List currBusinessQCCoefficientDataList = businessQCCoefficientDataList.stream().filter(f -> ygDeviceSample.getSampleCode().equals(f.getSampleCode())).collect(Collectors.toList()); +// if (currBusinessQCCoefficientDataList != null && currBusinessQCCoefficientDataList.size() > 0) { +// for (BusinessQCCoefficientDataDO businessQCCoefficientDataDO : currBusinessQCCoefficientDataList) { +// List businessQCCoefficientParameterDataList = businessQCCoefficientParameterDataMapper.selectByBusinessQCCoefficientDataId(businessQCCoefficientDataDO.getId()); +// tempBusinessQCCoefficientParameterDataList.addAll(businessQCCoefficientParameterDataList); +// } +// } //分析元素 for (XRFDeviceSampleProjectReqVO ygDeviceSampleElement : sampleElements) { @@ -142,9 +196,7 @@ public class XRFDataServiceImpl implements XRFDataService { continue; } - //查询是否有特殊转换率 -// QmsConYgConverRate conYgConverRate = conYgConverRateService.getOne(Wrappers.query().lambda().eq(QmsConYgConverRate::getDeviceNo, ygDeviceSample.getDeviceNo()) -// .eq(QmsConYgConverRate::getLineName, ygDeviceSample.getLineName()).eq(QmsConYgConverRate::getElementName, ygDeviceSampleElement.getElementName())); + //查询是否有特殊转换率 ConfigXRFConversionRateDO conYgConverRate = configXRFConversionRateMapper.selectBy(ygDeviceSample.getDeviceNo(), ygDeviceSample.getLineName(), ygDeviceSampleElement.getXrfProjectName()); ConfigXRFProjectDO conYgElement = null; @@ -170,35 +222,67 @@ public class XRFDataServiceImpl implements XRFDataService { if(conYgElement.getDataType() != null && "decimal".equals(conYgElement.getDataType())) { conYgElementDataType = conYgElement.getDecimalPosition(); } - Long elementId = conYgElement.getDictionaryProjectId(); - BusinessAssayProjectDataExtendRespVO busElementValue = tempBusElementValueList.stream().filter(f -> f.getDictionaryProjectId().equals(elementId) && f.getIsEnabled().equals(1)).findFirst().orElse(null); - if (busElementValue != null) { - //化验数据小数精度四舍六入五单双 - if("decimal".equals(busElementValue.getDataType())) { - busElementValue.setValue(elementValue.setScale(busElementValue.getDecimalPosition(), RoundingMode.HALF_EVEN).toPlainString()); - } else { - busElementValue.setValue(elementValue.setScale(conYgElementDataType, RoundingMode.HALF_EVEN).toPlainString()); - } - busElementValue.setRemark(conYgElement.getShowName() + ": " + busElementValue.getValue()); - busElementValueList.add(BeanUtils.toBean(busElementValue, BusinessAssayProjectDataDO.class)); + Long elementId = conYgElement.getDictionaryProjectId(); + List currBusElementValueList = tempBusElementValueList.stream().filter(f -> f.getDictionaryProjectId().equals(elementId) && f.getIsEnabled().equals(1)).collect(Collectors.toList()); + String symbol = "="; + String minimumLimitValue = ""; + if (currBusElementValueList != null && currBusElementValueList.size() > 0) { + for (BusinessAssayProjectDataExtendRespVO busElementValue : currBusElementValueList) { + //化验数据小数精度四舍六入五单双 + if("decimal".equals(busElementValue.getDataType())) { + busElementValue.setValue(elementValue.setScale(busElementValue.getDecimalPosition(), RoundingMode.HALF_EVEN).toPlainString()); + if (elementValue.compareTo(new BigDecimal(busElementValue.getMinimumLimitValue())) < 0) { + symbol = "<"; + minimumLimitValue = busElementValue.getMinimumLimitValue(); + busElementValue.setValue(busElementValue.getMinimumLimitValue()); + } + busElementValue.setSymbol(symbol); + + } else { + busElementValue.setValue(elementValue.setScale(conYgElementDataType, RoundingMode.HALF_EVEN).toPlainString()); + } + busElementValue.setRemark(conYgElement.getShowName() + ": " + busElementValue.getValue()); + busElementValueList.add(BeanUtils.toBean(busElementValue, BusinessAssayProjectDataDO.class)); + + } } + List currBusQcElementValueList = tempBusinessQCManagementProjectDataList.stream().filter(f -> f.getDictionaryProjectId().equals(elementId) && f.getIsEnabled().equals(1)).collect(Collectors.toList()); + if (currBusQcElementValueList != null && currBusQcElementValueList.size() > 0) { + for (BusinessQCManagementProjectDataDO busElementValue : currBusQcElementValueList) { + //化验数据小数精度四舍六入五单双 + if("decimal".equals(busElementValue.getDataType())) { + busElementValue.setValue(elementValue.setScale(busElementValue.getDecimalPosition(), RoundingMode.HALF_EVEN).toPlainString()); + ConfigAssayMethodProjectDO configAssayMethodProjectDO = configAssayMethodProjectMapper.selectById(busElementValue.getConfigAssayMethodProjectId()); + if (elementValue.compareTo(new BigDecimal(configAssayMethodProjectDO.getMinimumLimitValue())) < 0) { + symbol = "<"; + minimumLimitValue = configAssayMethodProjectDO.getMinimumLimitValue(); + busElementValue.setValue(configAssayMethodProjectDO.getMinimumLimitValue()); + } + busElementValue.setSymbol(symbol); + } else { + busElementValue.setValue(elementValue.setScale(conYgElementDataType, RoundingMode.HALF_EVEN).toPlainString()); + } + busElementValue.setRemark(conYgElement.getShowName() + ": " + busElementValue.getValue()); + busQcManageElementValueList.add(busElementValue); + } + } + + ReportFieldValueData reportFieldValueData = new ReportFieldValueData(); reportFieldValueData.setFieldName(conYgElement.getSaveColumn()); reportFieldValueData.setFieldValue(elementValue.setScale(conYgElementDataType, RoundingMode.HALF_EVEN).toPlainString()); reportFieldValueData.setDecimalPosition(ygDeviceSampleElement.getValueDecimals()); - reportFieldValueData.setMathSymbol("="); + reportFieldValueData.setMathSymbol(symbol); + if ("<".equals(symbol)) { + reportFieldValueData.setFieldValue(minimumLimitValue); + } reportFieldValueData.setUnit(ygDeviceSampleElement.getXrfProjectUnit()); assayDataJson.put(conYgElement.getSaveColumn(), reportFieldValueData); -// if(conYgElementDataType != null && conYgElementDataType.intValue() > -1) { -// BeanUtil.setFieldValue(busYgData, conYgElement.getSaveColumn(), elementValue.setScale(conYgElementDataType, BigDecimal.ROUND_HALF_EVEN).toPlainString());//数据格式化-四舍六入五单双 -// } else { -// BeanUtil.setFieldValue(busYgData, conYgElement.getSaveColumn(), elementValue); -// } } } - //循环元素修改流程节点 + //循环元素修改 for (BusinessAssayProjectDataExtendRespVO busElementValue : tempBusElementValueList) { boolean match = busElementValueList.stream().anyMatch(m -> m.getId().equals(busElementValue.getId())); if (!match) {//已经添加过的,不再添加 @@ -209,14 +293,23 @@ public class XRFDataServiceImpl implements XRFDataService { //设置分析数据 busYgData.setAssayData(assayDataJson.toJSONString()); - if (businessAssayTaskData != null) { - busYgData.setIsMatched(QmsCommonConstant.YES); - busYgData.setBusinessBaseSampleId(businessAssayTaskData.getBusinessBaseSampleId()); - busYgData.setBusinessSubParentSampleId(businessAssayTaskData.getBusinessSubParentSampleId()); - busYgData.setBusinessSubSampleId(businessAssayTaskData.getBusinessSubSampleId()); - busYgData.setBusinessAssayTaskDataId(businessAssayTaskData.getId()); - businessAssayTaskDataDOList.add(BeanUtils.toBean(businessAssayTaskData, BusinessAssayTaskDataDO.class)); + if (currBusinessAssayTaskDataList != null && currBusinessAssayTaskDataList.size() > 0) { + for (BusinessAssayTaskDataExtendRespVO businessAssayTaskData : currBusinessAssayTaskDataList) { + busYgData.setIsMatched(QmsCommonConstant.YES); + busYgData.setBusinessBaseSampleId(businessAssayTaskData.getBusinessBaseSampleId()); + busYgData.setBusinessSubParentSampleId(businessAssayTaskData.getBusinessSubParentSampleId()); + busYgData.setBusinessSubSampleId(businessAssayTaskData.getBusinessSubSampleId()); + busYgData.setBusinessAssayTaskDataId(businessAssayTaskData.getId()); + businessAssayTaskDataDOList.add(BeanUtils.toBean(businessAssayTaskData, BusinessAssayTaskDataDO.class)); + } } + if (currBusinessQCManagementDataList != null && currBusinessQCManagementDataList.size() > 0) { + for (BusinessQCManagementDataDO businessQCManagementData : currBusinessQCManagementDataList) { + busYgData.setBusinessQCManagementDataId(businessQCManagementData.getId()); + busYgData.setIsMatched(QmsCommonConstant.YES); + } + } + busYgDataList.add(busYgData); } @@ -227,22 +320,25 @@ public class XRFDataServiceImpl implements XRFDataService { } else { conYgLine.setLastSynchronousDataTime(maxSampleTime); } - //更新配置时间 + //更新荧光线配置时间 configXRFLineMapper.updateById(conYgLine); if (busYgDataList.size() > 0) { //保存荧光数据 businessXRFDataMapper.insertBatch(busYgDataList); - - //更新分样子样 -// if(businessAssayTaskDataDOs.size() > 0) { -// busSubCsampleService.updateBatchById(businessAssayTaskDataDOs); -// } - + //更新分析结果 if (busElementValueList.size() > 0) { businessAssayProjectDataMapper.updateBatch(busElementValueList); } + //荧光管理样和标准样 + if (busQcManageElementValueList.size() > 0) { + businessQCManagementProjectDataMapper.updateBatch(busQcManageElementValueList); + } + //荧光空白样和标样 +// if (busQccParameterValueList.size() > 0) { +// businessQCCoefficientParameterDataMapper.updateBatch(busQccParameterValueList); +// } } } diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayProjectDataMapper.xml b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayProjectDataMapper.xml index 4b6d82e..018e02a 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayProjectDataMapper.xml +++ b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayProjectDataMapper.xml @@ -9,4 +9,45 @@ 文档可见:https://www.iocoder.cn/MyBatis/x-plugins/ --> + \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayReportDataMapper.xml b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayReportDataMapper.xml index c29e66c..faf43b5 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayReportDataMapper.xml +++ b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayReportDataMapper.xml @@ -10,7 +10,6 @@ --> - SELECT + SELECT tbatd.CFG_ASY_MTHD_ID AS configAssayMethodId, tcam.NAME AS configAssayMethodName, + tcam.DIC_BSN_KY AS configAssayMethodDictionaryBusinessKey, + tcam.MTHD_NAME_CTGR AS configAssayMethodNameAndCategory, COUNT(tbatd.ID) AS sampleTaskCount FROM T_BSN_ASY_TSK_DAT tbatd LEFT JOIN T_CFG_ASY_MTHD tcam ON tbatd.CFG_ASY_MTHD_ID = tcam.ID + LEFT JOIN T_BSN_SB_SMP_ANL_GRP tbssag ON + tbatd.BSN_SB_SMP_ID = tbssag.BSN_SB_SMP_ID + AND tbatd.ASY_DEPT_ID = tbssag.ASY_DEPT_ID WHERE tbatd.DELETED = 0 AND tcam.DELETED = 0 + AND tbssag.DELETED = 0 AND tbatd.IS_ASN_TSKD = 0 AND tbatd.IS_RPOD = 0 + AND tbssag.SMP_STS = '已收样' AND tbatd.ASY_DEPT_ID = #{reqVO.assayDepartmentId} AND tbatd.SMP_FLW_NDE_KY = #{reqVO.sampleFlowNodeKey} - - AND tbatd.SMP_FLW_NDE_TM #{reqVO.sampleFlowNodeTime[0]} and #{reqVO.sampleFlowNodeTime[1]} + + AND tbatd.SMP_FLW_NDE_TM BETWEEN #{reqVO.sampleFlowNodeTime[0]} AND #{reqVO.sampleFlowNodeTime[1]} + + + AND tcam.NAME like '%' || #{reqVO.configAssayMethodName} || '%' + + + AND tcam.MTHD_NAME_CTGR like '%' || #{reqVO.configAssayMethodNameAndCategory} || '%' GROUP BY tbatd.CFG_ASY_MTHD_ID, - tcam.NAME + tcam.NAME, + tcam.DIC_BSN_KY, + tcam.MTHD_NAME_CTGR + ORDER BY tcam.DIC_BSN_KY ASC diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubSampleParentRetestMapper.xml b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubSampleParentRetestMapper.xml new file mode 100644 index 0000000..3675701 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubSampleParentRetestMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/config/dal/mapper/ConfigAssayMethodParameterMapper.xml b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/config/dal/mapper/ConfigAssayMethodParameterMapper.xml new file mode 100644 index 0000000..b219367 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/config/dal/mapper/ConfigAssayMethodParameterMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/reportdoc/dal/mapper/ReportDocumentFileMapper.xml b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/reportdoc/dal/mapper/ReportDocumentFileMapper.xml new file mode 100644 index 0000000..818b91f --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/reportdoc/dal/mapper/ReportDocumentFileMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/office/deleteme b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/office/deleteme deleted file mode 100644 index e69de29..0000000 diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/office/supplier/dal/mapper/SupplierEvaluationAtMapper.xml b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/office/supplier/dal/mapper/SupplierEvaluationAtMapper.xml new file mode 100644 index 0000000..b151ed0 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/office/supplier/dal/mapper/SupplierEvaluationAtMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/office/supplier/dal/mapper/SupplierEvaluationMapper.xml b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/office/supplier/dal/mapper/SupplierEvaluationMapper.xml new file mode 100644 index 0000000..cd84c69 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/office/supplier/dal/mapper/SupplierEvaluationMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/office/supplier/dal/mapper/SupplierMapper.xml b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/office/supplier/dal/mapper/SupplierMapper.xml new file mode 100644 index 0000000..abf2da0 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/office/supplier/dal/mapper/SupplierMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/office/supplier/dal/mapper/SupplierPropertiesMapper.xml b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/office/supplier/dal/mapper/SupplierPropertiesMapper.xml new file mode 100644 index 0000000..270074a --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/office/supplier/dal/mapper/SupplierPropertiesMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/clientManage/data/dal/mapper/VersionManagementMapper.xml b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/clientManage/data/dal/mapper/VersionManagementMapper.xml new file mode 100644 index 0000000..be60ea9 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/clientManage/data/dal/mapper/VersionManagementMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceAffiliationRelativityMapper.xml b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceAffiliationRelativityMapper.xml new file mode 100644 index 0000000..2f32acc --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceAffiliationRelativityMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceApplyDetailMapper.xml b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceApplyDetailMapper.xml new file mode 100644 index 0000000..39e6700 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceApplyDetailMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/device/data/dal/mapper/DeviceInfomationMapper.xml b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceApplyMapper.xml similarity index 95% rename from zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/device/data/dal/mapper/DeviceInfomationMapper.xml rename to zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceApplyMapper.xml index 2453564..aac60ed 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/device/data/dal/mapper/DeviceInfomationMapper.xml +++ b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceApplyMapper.xml @@ -1,6 +1,6 @@ - + + + \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceCalibrationPlanMapper.xml b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceCalibrationPlanMapper.xml new file mode 100644 index 0000000..db5a97d --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceCalibrationPlanMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceConfigBusinessItemMapper.xml b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceConfigBusinessItemMapper.xml new file mode 100644 index 0000000..f599f44 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceConfigBusinessItemMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceConfigBusinessRuleMapper.xml b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceConfigBusinessRuleMapper.xml new file mode 100644 index 0000000..8e44738 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceConfigBusinessRuleMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceConfigFlowMapper.xml b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceConfigFlowMapper.xml new file mode 100644 index 0000000..e443caa --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceConfigFlowMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceInfomationMapper.xml b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceInfomationMapper.xml new file mode 100644 index 0000000..a175453 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceInfomationMapper.xml @@ -0,0 +1,50 @@ + + + + + + + + + + \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceMaintainItemMapper.xml b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceMaintainItemMapper.xml new file mode 100644 index 0000000..f6ee4b1 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceMaintainItemMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceMaintainMapper.xml b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceMaintainMapper.xml new file mode 100644 index 0000000..c53382e --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceMaintainMapper.xml @@ -0,0 +1,129 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + d.DEV_NAME, + d.ALS, + d.DEV_CD, + d.FACT_CD, + d.DEPT_NAME, + d.RPR_FLG, + d.DMOT_FLG, + d.SCR_FLG, + d.DSBL_FLG, + d.LND_FLG, + d.IN_USE_FLG, + d.ACPT_FLG, + p.ID as PRODUCT_ID, + p.MFR, + p.SPEC, + p.MDL_NO + + + + + + + + \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/device/dal/mapper/DevicePeriodCheckMapper.xml b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/device/dal/mapper/DevicePeriodCheckMapper.xml new file mode 100644 index 0000000..cd6efea --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/device/dal/mapper/DevicePeriodCheckMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/device/dal/mapper/DevicePeriodCheckPlanMapper.xml b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/device/dal/mapper/DevicePeriodCheckPlanMapper.xml new file mode 100644 index 0000000..cbc0292 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/device/dal/mapper/DevicePeriodCheckPlanMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/device/data/dal/mapper/DeviceProductMapper.xml b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceProductMapper.xml similarity index 100% rename from zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/device/data/dal/mapper/DeviceProductMapper.xml rename to zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceProductMapper.xml diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceRepairApplyMapper.xml b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceRepairApplyMapper.xml new file mode 100644 index 0000000..e6327f5 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceRepairApplyMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceRepairAtMapper.xml b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceRepairAtMapper.xml new file mode 100644 index 0000000..eb094c1 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceRepairAtMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceRepairDetailMapper.xml b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceRepairDetailMapper.xml new file mode 100644 index 0000000..48eeb63 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceRepairDetailMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceRepairResultDetailMapper.xml b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceRepairResultDetailMapper.xml new file mode 100644 index 0000000..176b5c4 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceRepairResultDetailMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceUseRecordMapper.xml b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceUseRecordMapper.xml new file mode 100644 index 0000000..15ab51f --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceUseRecordMapper.xml @@ -0,0 +1,129 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + d.DEV_NAME, + d.ALS, + d.DEV_CD, + d.FACT_CD, + d.DEPT_NAME, + d.RPR_FLG, + d.DMOT_FLG, + d.SCR_FLG, + d.DSBL_FLG, + d.LND_FLG, + d.IN_USE_FLG, + d.ACPT_FLG, + p.ID as PRODUCT_ID, + p.MFR, + p.SPEC, + p.MDL_NO + + + + + + + + + \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialBatchAssignMapper.xml b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialBatchAssignMapper.xml new file mode 100644 index 0000000..a4f6f96 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialBatchAssignMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialBatchMapper.xml b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialBatchMapper.xml new file mode 100644 index 0000000..2db4203 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialBatchMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/material/data/dal/mapper/MaterialInfomationMapper.xml b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialInfomationMapper.xml similarity index 100% rename from zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/material/data/dal/mapper/MaterialInfomationMapper.xml rename to zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialInfomationMapper.xml diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialInventoryCheckBatchMapper.xml b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialInventoryCheckBatchMapper.xml new file mode 100644 index 0000000..5d4fcb8 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialInventoryCheckBatchMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialInventoryCheckDetailMapper.xml b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialInventoryCheckDetailMapper.xml new file mode 100644 index 0000000..3a412d5 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialInventoryCheckDetailMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialInventoryCheckMapper.xml b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialInventoryCheckMapper.xml new file mode 100644 index 0000000..74020bc --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialInventoryCheckMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialInventoryInboundDetailMapper.xml b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialInventoryInboundDetailMapper.xml new file mode 100644 index 0000000..d592317 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialInventoryInboundDetailMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialInventoryInboundMapper.xml b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialInventoryInboundMapper.xml new file mode 100644 index 0000000..89e7439 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialInventoryInboundMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialInventoryMapper.xml b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialInventoryMapper.xml new file mode 100644 index 0000000..e1be1da --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialInventoryMapper.xml @@ -0,0 +1,103 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialInventoryOutboundDetailMapper.xml b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialInventoryOutboundDetailMapper.xml new file mode 100644 index 0000000..b9650aa --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialInventoryOutboundDetailMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialInventoryOutboundMapper.xml b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialInventoryOutboundMapper.xml new file mode 100644 index 0000000..49373b9 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialInventoryOutboundMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialLifecycleDetailMapper.xml b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialLifecycleDetailMapper.xml new file mode 100644 index 0000000..5e1e665 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialLifecycleDetailMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialLifecycleMapper.xml b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialLifecycleMapper.xml new file mode 100644 index 0000000..27a70af --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialLifecycleMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialLocationMapper.xml b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialLocationMapper.xml new file mode 100644 index 0000000..bb88adb --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialLocationMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/material/data/dal/mapper/MaterialProductMapper.xml b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialProductMapper.xml similarity index 100% rename from zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/material/data/dal/mapper/MaterialProductMapper.xml rename to zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialProductMapper.xml From b7db2d34ac9333da1081bfea1d798f377561ee09 Mon Sep 17 00:00:00 2001 From: FCL Date: Sun, 4 Jan 2026 18:48:53 +0800 Subject: [PATCH 05/11] =?UTF-8?q?=E9=83=A8=E7=BD=B2=E8=B0=83=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/{application-dev.yml => application-dev1.yml} | 0 qms-server/src/main/resources/application.yml | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename qms-server/src/main/resources/{application-dev.yml => application-dev1.yml} (100%) diff --git a/qms-server/src/main/resources/application-dev.yml b/qms-server/src/main/resources/application-dev1.yml similarity index 100% rename from qms-server/src/main/resources/application-dev.yml rename to qms-server/src/main/resources/application-dev1.yml diff --git a/qms-server/src/main/resources/application.yml b/qms-server/src/main/resources/application.yml index 6a4ab2a..3e55a7e 100644 --- a/qms-server/src/main/resources/application.yml +++ b/qms-server/src/main/resources/application.yml @@ -24,7 +24,7 @@ spring: config: import: - - optional:classpath:application-${spring.profiles.active}.yaml # 加载【本地】配置 +# - optional:classpath:application-${spring.profiles.active}.yaml # 加载【本地】配置 - optional:nacos:${spring.application.name}-${spring.profiles.active}.yaml # 加载【Nacos】的配置 # Servlet 配置 From 10716a0ec59a5b0e8b1860bb718fb21b9099dc72 Mon Sep 17 00:00:00 2001 From: FCL Date: Wed, 7 Jan 2026 11:00:12 +0800 Subject: [PATCH 06/11] =?UTF-8?q?feat:qms=E9=98=B6=E6=AE=B5=E6=80=A7?= =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BusinessAssayParameterDataController.java | 2 + .../BusinessAssayProjectDataController.java | 3 + .../BusinessAssayReportDataController.java | 3 + .../admin/BusinessAssayTaskController.java | 9 + .../BusinessAssayTaskDataController.java | 13 ++ .../BusinessAssayTaskDetailController.java | 3 + ...inessAssayTaskParameterDataController.java | 3 + .../admin/BusinessBaseSampleController.java | 3 + .../BusinessHandoverRecordSubController.java | 3 + .../BusinessQCCoefficientDataController.java | 3 + ...sQCCoefficientParameterDataController.java | 3 + .../admin/BusinessQCDataController.java | 3 + .../BusinessQCManagementDataController.java | 3 + ...ssQCManagementParameterDataController.java | 3 + ...nessQCManagementProjectDataController.java | 3 + ...nagementSampleParameterDataController.java | 3 + .../BusinessQCParameterDataController.java | 3 + .../BusinessQCProjectDataController.java | 3 + ...QualityControlSampleProjectController.java | 3 + .../BusinessSampleAssayResultController.java | 3 + .../BusinessSampleDispatchController.java | 3 + ...usinessSampleDispatchDetailController.java | 3 + ...BusinessSampleEntrustDetailController.java | 3 + ...usinessSampleEntrustProjectController.java | 3 + ...ssSampleEntrustRegistrationController.java | 3 + .../BusinessSampleHandoverController.java | 3 + ...usinessSampleHandoverDetailController.java | 3 + .../BusinessStandardSampleController.java | 3 + ...sinessStandardSampleProjectController.java | 3 + ...ssSubParentSampleAssessmentController.java | 3 + ...rentSampleAssessmentProjectController.java | 3 + .../BusinessSubParentSampleController.java | 3 + ...inessSubSampleAnalysisGroupController.java | 3 + ...BusinessSubSampleAssessmentController.java | 3 + ...sSubSampleAssessmentProjectController.java | 3 + .../admin/BusinessSubSampleController.java | 9 + ...sinessSubSampleParentRetestController.java | 3 + .../admin/BusinessXRFDataController.java | 3 + .../admin/SampleAnalysisAuditController.java | 2 + .../admin/SampleAnalysisController.java | 2 + .../admin/SampleEntrustController.java | 2 + .../admin/SampleFlowController.java | 2 + .../SampleReportDataQueryController.java | 2 + .../SampleResultReportingController.java | 8 + .../admin/SampleTaskAssignController.java | 8 + .../bus/controller/admin/TestController.java | 2 + ...sinessAssayTaskDataExternalInfomation.java | 47 ++++ .../vo/BusinessAssayTaskDataPageReqVO.java | 3 + .../vo/BusinessAssayTaskDataReqVO.java | 3 + .../vo/BusinessAssayTaskDataRespVO.java | 3 + .../vo/BusinessAssayTaskDataSaveReqVO.java | 3 + .../dataobject/BusinessAssayTaskDataDO.java | 5 + .../SampleEntrustGenSampleDataCmp.java | 5 +- .../taskassign/SampleTaskAssignManualCmp.java | 2 + .../taskassign/SampleTaskAssignMethodCmp.java | 2 + .../taskassign/SampleTaskAssignSampleCmp.java | 2 + .../SampleAnalysisAuditServiceImpl.java | 167 +++++++------ .../service/SampleAnalysisServiceImpl.java | 50 +++- .../admin/BaseSampleController.java | 3 + .../admin/ConfigAssayMethodController.java | 3 + .../ConfigAssayMethodParameterController.java | 3 + ...ssayMethodProjectAssessmentController.java | 3 + ...sayMethodProjectCoefficientController.java | 3 + .../ConfigAssayMethodProjectController.java | 3 + ...AssayMethodProjectParameterController.java | 3 + ...nfigAssayMethodProjectRangeController.java | 3 + .../admin/ConfigBaseSampleController.java | 3 + .../admin/ConfigEntrustSourceController.java | 3 + ...nfigEntrustSourceSampleTypeController.java | 3 + .../admin/ConfigPermissionController.java | 3 + .../admin/ConfigProjectController.java | 3 + .../admin/ConfigQCSampleMethodController.java | 3 + ...nfigQCSampleMethodParameterController.java | 3 + .../ConfigQCStandardSampleController.java | 3 + .../admin/ConfigReportFieldController.java | 3 + .../admin/ConfigReportTemplateController.java | 3 + .../admin/ConfigReportTypeController.java | 3 + .../admin/ConfigRuleController.java | 3 + .../admin/ConfigSampleFlowController.java | 3 + .../admin/ConfigSampleHandoverController.java | 3 + .../admin/ConfigSampleReportController.java | 3 + .../admin/ConfigSimpleFlowCodeController.java | 3 + .../admin/ConfigSimpleFlowRuleController.java | 3 + ...ConfigStandardSampleProjectController.java | 3 + .../ConfigStandardSampleTypeController.java | 3 + .../admin/ConfigSubSampleController.java | 3 + .../ConfigSubSampleMethodController.java | 3 + .../ConfigSubSampleParentController.java | 3 + ...ConfigSubSampleParentMethodController.java | 3 + .../admin/ConfigUserSignatureController.java | 3 + .../ConfigWarehouseLocationController.java | 3 + .../ConfigXRFConversionRateController.java | 3 + .../admin/ConfigXRFLineController.java | 3 + .../admin/ConfigXRFProjectController.java | 3 + .../admin/GridReportController.java | 2 + .../MaterialAssayStandardController.java | 3 + ...MaterialAssayStandardDetailController.java | 3 + ...ssayStandardForecastProjectController.java | 3 + ...MaterialAssayStandardMethodController.java | 3 + ...AssayMethodProjectAssessmentPageReqVO.java | 3 + ...figAssayMethodProjectAssessmentRespVO.java | 4 + ...AssayMethodProjectAssessmentSaveReqVO.java | 3 + .../ConfigAssayMethodProjectAssessmentDO.java | 5 + ...figAssayMethodProjectAssessmentMapper.java | 17 ++ .../mapper/ConfigSubSampleMethodMapper.java | 3 + .../admin/DictionaryParameterController.java | 2 + .../admin/DictionaryProjectController.java | 2 + .../DictionarySampleFlowNodeController.java | 2 + .../admin/DictionarySampleTypeController.java | 2 + .../admin/ReportDocumentDataController.java | 2 + .../admin/ReportDocumentFileController.java | 3 + .../admin/ReportDocumentMainController.java | 2 + ...portDocumentMainCorrelationController.java | 3 + .../admin/ReportDocumentTypeController.java | 2 + .../admin/DataCollectionController.java | 2 + .../admin/DataCollectionFieldController.java | 2 + .../controller/admin/DataFormController.java | 2 + .../admin/DataKeyCheckController.java | 3 + .../admin/DataTemplateController.java | 3 + .../admin/DictionaryBusinessController.java | 2 + .../core/aspect/annotation/QmsPermission.java | 24 ++ .../datapermission/QMSDataPermissionDTO.java | 32 +++ .../QMSMultiDataPermissionHandler.java | 219 ++++++++++++++++++ .../QMSPermissionContextHolder.java | 55 +++++ .../mybatis/QMSDataPermissionConfig.java | 42 ++++ .../IotConnectManagerStatsController.java | 2 + .../controller/admin/SupplierController.java | 3 + .../admin/SupplierEvaluationAtController.java | 3 + .../admin/SupplierEvaluationController.java | 3 + .../admin/SupplierPropertiesController.java | 3 + .../admin/VersionManagementController.java | 3 + ...DeviceAffiliationRelativityController.java | 3 + .../admin/DeviceApplyController.java | 4 +- .../admin/DeviceApplyDetailController.java | 3 + .../admin/DeviceCalibrationController.java | 3 + .../DeviceCalibrationPlanController.java | 3 + .../DeviceConfigBusinessItemController.java | 3 + .../DeviceConfigBusinessRuleController.java | 3 + .../admin/DeviceConfigFlowController.java | 4 +- .../admin/DeviceInfomationController.java | 2 + .../admin/DeviceMaintainController.java | 3 + .../admin/DeviceMaintainItemController.java | 3 + .../admin/DevicePeriodCheckController.java | 3 + .../DevicePeriodCheckPlanController.java | 3 + .../admin/DeviceProductController.java | 9 +- .../admin/DeviceRepairApplyController.java | 3 + .../admin/DeviceRepairDetailController.java | 3 + .../DeviceRepairResultDetailController.java | 3 + .../admin/DeviceUseRecordController.java | 3 + .../device/dal/mapper/DeviceApplyMapper.java | 10 +- .../admin/MaterialBatchAssignController.java | 3 + .../admin/MaterialBatchController.java | 3 + .../admin/MaterialInfomationController.java | 2 + ...MaterialInventoryCheckBatchController.java | 3 + .../MaterialInventoryCheckController.java | 3 + ...aterialInventoryCheckDetailController.java | 3 + .../admin/MaterialInventoryController.java | 2 + .../MaterialInventoryInboundController.java | 3 + ...erialInventoryInboundDetailController.java | 3 + .../MaterialInventoryOutboundController.java | 3 + ...rialInventoryOutboundDetailController.java | 3 + .../admin/MaterialLifecycleController.java | 3 + .../MaterialLifecycleDetailController.java | 3 + .../admin/MaterialLocationController.java | 3 + .../admin/MaterialProductController.java | 2 + .../admin/AutoIngredientsController.java | 2 + .../controller/admin/XRFDataController.java | 2 + 167 files changed, 1069 insertions(+), 83 deletions(-) create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataExternalInfomation.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/core/aspect/annotation/QmsPermission.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/framework/datapermission/QMSDataPermissionDTO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/framework/datapermission/QMSMultiDataPermissionHandler.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/framework/datapermission/QMSPermissionContextHolder.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/framework/mybatis/QMSDataPermissionConfig.java diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessAssayParameterDataController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessAssayParameterDataController.java index 20e30e1..62d20d7 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessAssayParameterDataController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessAssayParameterDataController.java @@ -25,6 +25,7 @@ import com.zt.plat.framework.common.pojo.PageResult; import com.zt.plat.framework.common.pojo.CommonResult; import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.common.util.object.BeanUtils; +import com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; import com.zt.plat.framework.excel.core.util.ExcelUtils; import com.zt.plat.module.qms.business.bus.controller.vo.*; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayParameterDataDO; @@ -36,6 +37,7 @@ import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; @RestController @RequestMapping("/qms/business-assay-parameter-data") @Validated +@DeptDataPermissionIgnore(enable = "true") public class BusinessAssayParameterDataController implements BusinessControllerMarker { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessAssayProjectDataController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessAssayProjectDataController.java index 6cb3769..d8dd50d 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessAssayProjectDataController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessAssayProjectDataController.java @@ -23,6 +23,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -37,6 +39,7 @@ import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; @RestController @RequestMapping("/qms/business-assay-project-data") @Validated +@DeptDataPermissionIgnore(enable = "true") public class BusinessAssayProjectDataController implements BusinessControllerMarker { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessAssayReportDataController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessAssayReportDataController.java index 3c9a0a2..05b437b 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessAssayReportDataController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessAssayReportDataController.java @@ -23,6 +23,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -36,6 +38,7 @@ import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; @RestController @RequestMapping("/qms/business-assay-report-data") @Validated +@DeptDataPermissionIgnore(enable = "true") public class BusinessAssayReportDataController implements BusinessControllerMarker { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessAssayTaskController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessAssayTaskController.java index 17c1b91..bb33948 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessAssayTaskController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessAssayTaskController.java @@ -24,9 +24,13 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; +import com.zt.plat.framework.security.core.LoginUser; +import com.zt.plat.framework.security.core.util.SecurityFrameworkUtils; import com.zt.plat.module.qms.business.bus.controller.vo.*; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDO; import com.zt.plat.module.qms.business.bus.service.BusinessAssayTaskService; @@ -37,6 +41,7 @@ import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; @RestController @RequestMapping("/qms/business-assay-task") @Validated +@DeptDataPermissionIgnore(enable = "true") public class BusinessAssayTaskController implements BusinessControllerMarker { @@ -89,6 +94,10 @@ public class BusinessAssayTaskController implements BusinessControllerMarker { @Operation(summary = "获得检测任务分配业务分页") //@PreAuthorize("@ss.hasPermission('qms:business-assay-task:query')") public CommonResult> getBusinessAssayTaskPage(@Valid BusinessAssayTaskPageReqVO pageReqVO) { + if (pageReqVO.getDeptId() == null) { + LoginUser loginUser = SecurityFrameworkUtils.getLoginUser(); + pageReqVO.setDeptId(loginUser.getVisitDeptId()); + } PageResult pageResult = businessAssayTaskService.getBusinessAssayTaskPage(pageReqVO); return success(pageResult); } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessAssayTaskDataController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessAssayTaskDataController.java index a14ce69..4b6f999 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessAssayTaskDataController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessAssayTaskDataController.java @@ -21,9 +21,13 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; +import com.zt.plat.framework.security.core.LoginUser; +import com.zt.plat.framework.security.core.util.SecurityFrameworkUtils; import com.zt.plat.module.qms.business.bus.controller.vo.*; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDataDO; import com.zt.plat.module.qms.business.bus.service.BusinessAssayTaskDataService; @@ -34,6 +38,7 @@ import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; @RestController @RequestMapping("/qms/business-assay-task-data") @Validated +@DeptDataPermissionIgnore(enable = "true") public class BusinessAssayTaskDataController implements BusinessControllerMarker { @@ -86,6 +91,10 @@ public class BusinessAssayTaskDataController implements BusinessControllerMarker @Operation(summary = "获得未指派的子样检测任务业务分组列表") //@PreAuthorize("@ss.hasPermission('qms:business-assay-task-data:query')") public CommonResult getUnAssayTaskGroupList(BusinessAssayTaskDataReqVO reqVO) { + if (reqVO.getAssayDepartmentId() == null) { + LoginUser loginUser = SecurityFrameworkUtils.getLoginUser(); + reqVO.setAssayDepartmentId(loginUser.getVisitDeptId()); + } List list = businessAssayTaskDataService.getUnAssayTaskGroupList(reqVO); return success(list); } @@ -94,6 +103,10 @@ public class BusinessAssayTaskDataController implements BusinessControllerMarker @Operation(summary = "获得未审核的子样检测任务业务分组列表") //@PreAuthorize("@ss.hasPermission('qms:business-assay-task-data:query')") public CommonResult getUnAuditTaskGroupList(BusinessAssayTaskDataReqVO reqVO) { + if (reqVO.getAssayDepartmentId() == null) { + LoginUser loginUser = SecurityFrameworkUtils.getLoginUser(); + reqVO.setAssayDepartmentId(loginUser.getVisitDeptId()); + } List list = businessAssayTaskDataService.getUnAuditTaskGroupList(reqVO); return success(list); } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessAssayTaskDetailController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessAssayTaskDetailController.java index 7cc9a4f..c6df002 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessAssayTaskDetailController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessAssayTaskDetailController.java @@ -23,6 +23,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -36,6 +38,7 @@ import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; @RestController @RequestMapping("/qms/business-assay-task-detail") @Validated +@DeptDataPermissionIgnore(enable = "true") public class BusinessAssayTaskDetailController implements BusinessControllerMarker { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessAssayTaskParameterDataController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessAssayTaskParameterDataController.java index b62186b..ed23125 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessAssayTaskParameterDataController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessAssayTaskParameterDataController.java @@ -21,6 +21,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -34,6 +36,7 @@ import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; @RestController @RequestMapping("/qms/business-assay-task-parameter-data") @Validated +@DeptDataPermissionIgnore(enable = "true") public class BusinessAssayTaskParameterDataController implements BusinessControllerMarker { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessBaseSampleController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessBaseSampleController.java index 42afdc8..9796ae7 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessBaseSampleController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessBaseSampleController.java @@ -23,6 +23,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -36,6 +38,7 @@ import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; @RestController @RequestMapping("/qms/business-base-sample") @Validated +@DeptDataPermissionIgnore(enable = "true") public class BusinessBaseSampleController implements BusinessControllerMarker { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessHandoverRecordSubController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessHandoverRecordSubController.java index 28908e0..7370d56 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessHandoverRecordSubController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessHandoverRecordSubController.java @@ -24,6 +24,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -37,6 +39,7 @@ import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; @RestController @RequestMapping("/qms/business-handover-record-sub") @Validated +@DeptDataPermissionIgnore(enable = "true") public class BusinessHandoverRecordSubController implements BusinessControllerMarker { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQCCoefficientDataController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQCCoefficientDataController.java index c8ca6be..1ab974d 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQCCoefficientDataController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQCCoefficientDataController.java @@ -21,6 +21,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -34,6 +36,7 @@ import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; @RestController @RequestMapping("/qms/business-qc-coefficient-data") @Validated +@DeptDataPermissionIgnore(enable = "true") public class BusinessQCCoefficientDataController implements BusinessControllerMarker { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQCCoefficientParameterDataController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQCCoefficientParameterDataController.java index 6356dd4..1cc0195 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQCCoefficientParameterDataController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQCCoefficientParameterDataController.java @@ -21,6 +21,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -34,6 +36,7 @@ import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; @RestController @RequestMapping("/qms/business-qc-coefficient-parameter-data") @Validated +@DeptDataPermissionIgnore(enable = "true") public class BusinessQCCoefficientParameterDataController implements BusinessControllerMarker { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQCDataController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQCDataController.java index 1829704..8db87c3 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQCDataController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQCDataController.java @@ -21,6 +21,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -34,6 +36,7 @@ import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; @RestController @RequestMapping("/qms/business-qc-data") @Validated +@DeptDataPermissionIgnore(enable = "true") public class BusinessQCDataController implements BusinessControllerMarker { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQCManagementDataController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQCManagementDataController.java index 28c20ab..2b70cdb 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQCManagementDataController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQCManagementDataController.java @@ -21,6 +21,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -34,6 +36,7 @@ import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; @RestController @RequestMapping("/qms/business-qc-management-data") @Validated +@DeptDataPermissionIgnore(enable = "true") public class BusinessQCManagementDataController implements BusinessControllerMarker { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQCManagementParameterDataController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQCManagementParameterDataController.java index 4eeaf63..01564a0 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQCManagementParameterDataController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQCManagementParameterDataController.java @@ -21,6 +21,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -34,6 +36,7 @@ import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; @RestController @RequestMapping("/qms/business-qc-management-parameter-data") @Validated +@DeptDataPermissionIgnore(enable = "true") public class BusinessQCManagementParameterDataController implements BusinessControllerMarker { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQCManagementProjectDataController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQCManagementProjectDataController.java index cf3ee27..ede8140 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQCManagementProjectDataController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQCManagementProjectDataController.java @@ -21,6 +21,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -34,6 +36,7 @@ import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; @RestController @RequestMapping("/qms/business-qc-management-project-data") @Validated +@DeptDataPermissionIgnore(enable = "true") public class BusinessQCManagementProjectDataController implements BusinessControllerMarker { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQCManagementSampleParameterDataController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQCManagementSampleParameterDataController.java index 5323623..e0a7c52 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQCManagementSampleParameterDataController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQCManagementSampleParameterDataController.java @@ -21,6 +21,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -34,6 +36,7 @@ import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; @RestController @RequestMapping("/qms/business-QC-management-sample-parameter-data") @Validated +@DeptDataPermissionIgnore(enable = "true") public class BusinessQCManagementSampleParameterDataController implements BusinessControllerMarker { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQCParameterDataController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQCParameterDataController.java index 567dc30..2a63cd2 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQCParameterDataController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQCParameterDataController.java @@ -21,6 +21,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -34,6 +36,7 @@ import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; @RestController @RequestMapping("/qms/business-qc-parameter-data") @Validated +@DeptDataPermissionIgnore(enable = "true") public class BusinessQCParameterDataController implements BusinessControllerMarker { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQCProjectDataController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQCProjectDataController.java index e3e4db3..a4c160a 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQCProjectDataController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQCProjectDataController.java @@ -21,6 +21,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -34,6 +36,7 @@ import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; @RestController @RequestMapping("/qms/business-qc-project-data") @Validated +@DeptDataPermissionIgnore(enable = "true") public class BusinessQCProjectDataController implements BusinessControllerMarker { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQualityControlSampleProjectController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQualityControlSampleProjectController.java index 254c548..047dd40 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQualityControlSampleProjectController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQualityControlSampleProjectController.java @@ -23,6 +23,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -36,6 +38,7 @@ import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; @RestController @RequestMapping("/qms/business-quality-control-sample-project") @Validated +@DeptDataPermissionIgnore(enable = "true") public class BusinessQualityControlSampleProjectController implements BusinessControllerMarker { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSampleAssayResultController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSampleAssayResultController.java index 5c4c7d0..e510eeb 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSampleAssayResultController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSampleAssayResultController.java @@ -23,6 +23,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -36,6 +38,7 @@ import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; @RestController @RequestMapping("/qms/business-sample-assay-result") @Validated +@DeptDataPermissionIgnore(enable = "true") public class BusinessSampleAssayResultController implements BusinessControllerMarker { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSampleDispatchController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSampleDispatchController.java index 4cf8a37..b3b6315 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSampleDispatchController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSampleDispatchController.java @@ -31,6 +31,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -46,6 +48,7 @@ import com.zt.plat.module.qms.business.bus.service.BusinessSampleDispatchService @RestController @RequestMapping("/qms/business-sample-dispatch") @Validated +@DeptDataPermissionIgnore(enable = "true") public class BusinessSampleDispatchController implements BusinessControllerMarker { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSampleDispatchDetailController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSampleDispatchDetailController.java index fcec9ee..a2ce22e 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSampleDispatchDetailController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSampleDispatchDetailController.java @@ -25,6 +25,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -41,6 +43,7 @@ import com.zt.plat.module.qms.business.bus.service.BusinessSampleDispatchDetailS @RestController @RequestMapping("/qms/business-sample-dispatch-detail") @Validated +@DeptDataPermissionIgnore(enable = "true") public class BusinessSampleDispatchDetailController implements BusinessControllerMarker { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSampleEntrustDetailController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSampleEntrustDetailController.java index a6d46fd..d8dd877 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSampleEntrustDetailController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSampleEntrustDetailController.java @@ -21,6 +21,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -34,6 +36,7 @@ import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; @RestController @RequestMapping("/qms/business-sample-entrust-detail") @Validated +@DeptDataPermissionIgnore(enable = "true") public class BusinessSampleEntrustDetailController implements BusinessControllerMarker { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSampleEntrustProjectController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSampleEntrustProjectController.java index 03c5ef2..aebc22a 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSampleEntrustProjectController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSampleEntrustProjectController.java @@ -23,6 +23,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -36,6 +38,7 @@ import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; @RestController @RequestMapping("/qms/business-sample-entrust-project") @Validated +@DeptDataPermissionIgnore(enable = "true") public class BusinessSampleEntrustProjectController implements BusinessControllerMarker { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSampleEntrustRegistrationController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSampleEntrustRegistrationController.java index dbbb2cc..df085bf 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSampleEntrustRegistrationController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSampleEntrustRegistrationController.java @@ -24,6 +24,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -38,6 +40,7 @@ import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; @RestController @RequestMapping("/qms/business-sample-entrust-registration") @Validated +@DeptDataPermissionIgnore(enable = "true") public class BusinessSampleEntrustRegistrationController implements BusinessControllerMarker { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSampleHandoverController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSampleHandoverController.java index eedf82b..7dbea2d 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSampleHandoverController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSampleHandoverController.java @@ -23,6 +23,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -37,6 +39,7 @@ import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; @RestController @RequestMapping("/qms/business-sample-handover") @Validated +@DeptDataPermissionIgnore(enable = "true") public class BusinessSampleHandoverController { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSampleHandoverDetailController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSampleHandoverDetailController.java index a89c1e0..095d77f 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSampleHandoverDetailController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSampleHandoverDetailController.java @@ -23,6 +23,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -36,6 +38,7 @@ import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; @RestController @RequestMapping("/qms/business-sample-handover-detail") @Validated +@DeptDataPermissionIgnore(enable = "true") public class BusinessSampleHandoverDetailController implements BusinessControllerMarker { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessStandardSampleController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessStandardSampleController.java index e0fea37..d435b6e 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessStandardSampleController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessStandardSampleController.java @@ -20,6 +20,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -33,6 +35,7 @@ import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; @RestController @RequestMapping("/qms/business-standard-sample") @Validated +@DeptDataPermissionIgnore(enable = "true") public class BusinessStandardSampleController implements BusinessControllerMarker { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessStandardSampleProjectController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessStandardSampleProjectController.java index 2ab8fc3..b8d2c1f 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessStandardSampleProjectController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessStandardSampleProjectController.java @@ -23,6 +23,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -36,6 +38,7 @@ import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; @RestController @RequestMapping("/qms/business-standard-sample-project") @Validated +@DeptDataPermissionIgnore(enable = "true") public class BusinessStandardSampleProjectController implements BusinessControllerMarker { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSubParentSampleAssessmentController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSubParentSampleAssessmentController.java index 30831b8..8b92088 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSubParentSampleAssessmentController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSubParentSampleAssessmentController.java @@ -21,6 +21,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -34,6 +36,7 @@ import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; @RestController @RequestMapping("/qms/business-sub-parent-sample-assessment") @Validated +@DeptDataPermissionIgnore(enable = "true") public class BusinessSubParentSampleAssessmentController implements BusinessControllerMarker { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSubParentSampleAssessmentProjectController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSubParentSampleAssessmentProjectController.java index d6e9225..05f773b 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSubParentSampleAssessmentProjectController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSubParentSampleAssessmentProjectController.java @@ -21,6 +21,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -34,6 +36,7 @@ import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; @RestController @RequestMapping("/qms/business-sub-parent-sample-assessment-project") @Validated +@DeptDataPermissionIgnore(enable = "true") public class BusinessSubParentSampleAssessmentProjectController implements BusinessControllerMarker { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSubParentSampleController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSubParentSampleController.java index ebd83b9..7ec30d1 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSubParentSampleController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSubParentSampleController.java @@ -23,6 +23,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -36,6 +38,7 @@ import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; @RestController @RequestMapping("/qms/business-sub-parent-sample") @Validated +@DeptDataPermissionIgnore(enable = "true") public class BusinessSubParentSampleController implements BusinessControllerMarker { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSubSampleAnalysisGroupController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSubSampleAnalysisGroupController.java index cb00de5..11a7ae2 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSubSampleAnalysisGroupController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSubSampleAnalysisGroupController.java @@ -23,6 +23,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -36,6 +38,7 @@ import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; @RestController @RequestMapping("/qms/business-sub-sample-analysis-group") @Validated +@DeptDataPermissionIgnore(enable = "true") public class BusinessSubSampleAnalysisGroupController implements BusinessControllerMarker { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSubSampleAssessmentController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSubSampleAssessmentController.java index de60e89..08d3c36 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSubSampleAssessmentController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSubSampleAssessmentController.java @@ -20,6 +20,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -33,6 +35,7 @@ import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; @RestController @RequestMapping("/qms/business-sub-sample-assessment") @Validated +@DeptDataPermissionIgnore(enable = "true") public class BusinessSubSampleAssessmentController implements BusinessControllerMarker { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSubSampleAssessmentProjectController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSubSampleAssessmentProjectController.java index 5705318..7db592f 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSubSampleAssessmentProjectController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSubSampleAssessmentProjectController.java @@ -23,6 +23,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -36,6 +38,7 @@ import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; @RestController @RequestMapping("/qms/business-sub-sample-assessment-project") @Validated +@DeptDataPermissionIgnore(enable = "true") public class BusinessSubSampleAssessmentProjectController implements BusinessControllerMarker { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSubSampleController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSubSampleController.java index 7d241c1..49c3e87 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSubSampleController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSubSampleController.java @@ -22,9 +22,13 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; +import com.zt.plat.framework.security.core.LoginUser; +import com.zt.plat.framework.security.core.util.SecurityFrameworkUtils; import com.zt.plat.module.qms.business.bus.controller.vo.*; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleDO; import com.zt.plat.module.qms.business.bus.service.BusinessAssayTaskDataService; @@ -37,6 +41,7 @@ import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; @RestController @RequestMapping("/qms/business-sub-sample") @Validated +@DeptDataPermissionIgnore(enable = "true") public class BusinessSubSampleController implements BusinessControllerMarker { @@ -118,6 +123,10 @@ public class BusinessSubSampleController implements BusinessControllerMarker { @Operation(summary = "获得子样分析部门分页") //@PreAuthorize("@ss.hasPermission('qms:business-sub-sample:query')") public CommonResult> getAnalysisGroupPage(@Valid BusinessSubSamplePageReqVO pageReqVO) { + if (pageReqVO.getAssayDepartmentId() == null) { + LoginUser loginUser = SecurityFrameworkUtils.getLoginUser(); + pageReqVO.setAssayDepartmentId(loginUser.getVisitDeptId()); + } PageResult pageResult = businessSubSampleService.getAnalysisGroupPage(pageReqVO); return success(pageResult); } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSubSampleParentRetestController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSubSampleParentRetestController.java index 85aead2..187c51b 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSubSampleParentRetestController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSubSampleParentRetestController.java @@ -21,6 +21,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -34,6 +36,7 @@ import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; @RestController @RequestMapping("/qms/business-sub-sample-parent-retest") @Validated +@DeptDataPermissionIgnore(enable = "true") public class BusinessSubSampleParentRetestController implements BusinessControllerMarker { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessXRFDataController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessXRFDataController.java index 31a2c1f..314a2ff 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessXRFDataController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessXRFDataController.java @@ -20,6 +20,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -33,6 +35,7 @@ import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; @RestController @RequestMapping("/qms/business-xrf-data") @Validated +@DeptDataPermissionIgnore(enable = "true") public class BusinessXRFDataController implements BusinessControllerMarker { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleAnalysisAuditController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleAnalysisAuditController.java index c51e3be..09bf871 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleAnalysisAuditController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleAnalysisAuditController.java @@ -10,6 +10,7 @@ import org.springframework.web.bind.annotation.RestController; import com.alibaba.fastjson2.JSONObject; import com.zt.plat.framework.business.interceptor.BusinessControllerMarker; import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; import com.zt.plat.module.qms.business.bus.controller.vo.*; import com.zt.plat.module.qms.business.bus.service.SampleAnalysisAuditService; import com.zt.plat.module.qms.enums.QmsCommonConstant; @@ -26,6 +27,7 @@ import static com.zt.plat.framework.common.pojo.CommonResult.success; @RestController @RequestMapping("/qms/bus/sample/analysis-audit") @Validated +@DeptDataPermissionIgnore(enable = "true") public class SampleAnalysisAuditController implements BusinessControllerMarker { @Resource diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleAnalysisController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleAnalysisController.java index e11fec3..ae318b1 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleAnalysisController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleAnalysisController.java @@ -10,6 +10,7 @@ import org.springframework.web.bind.annotation.RestController; import com.alibaba.fastjson2.JSONObject; import com.zt.plat.framework.business.interceptor.BusinessControllerMarker; import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; import com.zt.plat.module.qms.business.bus.controller.vo.*; import com.zt.plat.module.qms.business.bus.service.SampleAnalysisService; import io.swagger.v3.oas.annotations.tags.Tag; @@ -24,6 +25,7 @@ import static com.zt.plat.framework.common.pojo.CommonResult.success; @RestController @RequestMapping("/qms/bus/sample/analysis") @Validated +@DeptDataPermissionIgnore(enable = "true") public class SampleAnalysisController implements BusinessControllerMarker { @Resource diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleEntrustController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleEntrustController.java index 5336a48..78919bd 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleEntrustController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleEntrustController.java @@ -20,6 +20,7 @@ import com.yomahub.liteflow.flow.LiteflowResponse; import com.zt.plat.framework.business.interceptor.BusinessControllerMarker; import com.zt.plat.framework.common.pojo.CommonResult; import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO; +import com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; import com.zt.plat.module.qms.business.bus.controller.vo.*; import com.zt.plat.module.qms.business.bus.liteflow.param.SampleEntrustParam; import com.zt.plat.module.qms.business.bus.liteflow.slot.SampleEntrustContext; @@ -34,6 +35,7 @@ import jakarta.validation.Valid; @RestController @RequestMapping("/qms/bus/sample/entrust") @Validated +@DeptDataPermissionIgnore(enable = "true") public class SampleEntrustController implements BusinessControllerMarker { @Resource diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleFlowController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleFlowController.java index c128dff..153bfbe 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleFlowController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleFlowController.java @@ -10,6 +10,7 @@ import com.yomahub.liteflow.core.FlowExecutor; import com.yomahub.liteflow.flow.LiteflowResponse; import com.zt.plat.framework.business.interceptor.BusinessControllerMarker; import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; import com.zt.plat.module.qms.business.bus.liteflow.param.SampleFlowParam; import com.zt.plat.module.qms.business.bus.liteflow.slot.SampleFlowContext; import com.zt.plat.module.qms.business.bus.service.SampleFlowService; @@ -24,6 +25,7 @@ import static com.zt.plat.framework.common.pojo.CommonResult.success; @RestController @RequestMapping("/qms/bus/sample/flow") @Validated +@DeptDataPermissionIgnore(enable = "true") public class SampleFlowController implements BusinessControllerMarker { @Resource diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleReportDataQueryController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleReportDataQueryController.java index fe7db94..ed96e92 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleReportDataQueryController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleReportDataQueryController.java @@ -9,6 +9,7 @@ import org.springframework.web.bind.annotation.RestController; import com.alibaba.fastjson2.JSONObject; import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; import com.zt.plat.module.qms.business.bus.service.SampleAnalysisAuditService; import com.zt.plat.module.qms.business.bus.service.SampleEntrustService; @@ -20,6 +21,7 @@ import jakarta.annotation.Resource; */ @RestController @RequestMapping("/qms/bus/sample/reporting-data-query") +@DeptDataPermissionIgnore(enable = "true") public class SampleReportDataQueryController { @Resource diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleResultReportingController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleResultReportingController.java index 4e0db17..5d1a3aa 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleResultReportingController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleResultReportingController.java @@ -8,6 +8,9 @@ import org.springframework.web.bind.annotation.RestController; import com.alibaba.fastjson2.JSONObject; import com.zt.plat.framework.business.interceptor.BusinessControllerMarker; import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; +import com.zt.plat.framework.security.core.LoginUser; +import com.zt.plat.framework.security.core.util.SecurityFrameworkUtils; import com.zt.plat.module.qms.business.bus.controller.vo.*; import com.zt.plat.module.qms.business.bus.service.SampleResultReportingService; @@ -29,6 +32,7 @@ import org.springframework.web.bind.annotation.RequestBody; @RestController @RequestMapping("/qms/bus/sample/result-reporting") @Validated +@DeptDataPermissionIgnore(enable = "true") public class SampleResultReportingController implements BusinessControllerMarker { @Resource @@ -37,6 +41,10 @@ public class SampleResultReportingController implements BusinessControllerMarker //获取未上报的方法 @GetMapping("/getUnReportMethodGroupList") public CommonResult getUnReportMethodGroupList(BusinessSubParentSampleAssessmentGroupReqVO reqVO) { + if (reqVO.getAssayDepartmentId() == null) { + LoginUser loginUser = SecurityFrameworkUtils.getLoginUser(); + reqVO.setAssayDepartmentId(loginUser.getVisitDeptId()); + } List list = sampleResultReportingService.getUnReportMethodGroupList(reqVO); return success(list); } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleTaskAssignController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleTaskAssignController.java index a5e6ae5..3da9459 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleTaskAssignController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleTaskAssignController.java @@ -15,6 +15,9 @@ import java.util.List; import com.zt.plat.framework.business.interceptor.BusinessControllerMarker; import com.zt.plat.framework.common.pojo.CommonResult; import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO; +import com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; +import com.zt.plat.framework.security.core.LoginUser; +import com.zt.plat.framework.security.core.util.SecurityFrameworkUtils; import com.zt.plat.module.qms.business.bus.controller.vo.*; import com.zt.plat.module.qms.business.bus.liteflow.param.SampleTaskAssignManualParam; import com.zt.plat.module.qms.business.bus.liteflow.param.SampleTaskAssignMethodParam; @@ -31,6 +34,7 @@ import jakarta.annotation.Resource; @RestController @RequestMapping("/qms/bus/sample/task-assign") @Validated +@DeptDataPermissionIgnore(enable = "true") public class SampleTaskAssignController implements BusinessControllerMarker { @Resource @@ -52,6 +56,10 @@ public class SampleTaskAssignController implements BusinessControllerMarker { @GetMapping("/getAssaySampleList") public CommonResult getAssaySampleList(BusinessAssayTaskDataReqVO reqVO) { + if (reqVO.getAssayDepartmentId() == null) { + LoginUser loginUser = SecurityFrameworkUtils.getLoginUser(); + reqVO.setAssayDepartmentId(loginUser.getVisitDeptId()); + } List list = sampleTaskAssignService.getAssaySampleList(reqVO); return success(list); } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/TestController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/TestController.java index 372c7f4..6621a2e 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/TestController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/TestController.java @@ -12,12 +12,14 @@ import org.springframework.web.bind.annotation.RestController; import com.alibaba.fastjson2.JSON; import com.zt.plat.framework.common.pojo.CommonResult; import com.zt.plat.framework.common.util.object.BeanUtils; +import com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; import com.zt.plat.module.qms.core.sampleflow.SampleFlowDefinition; import com.zt.plat.module.qms.core.sampleflow.SampleFlowNode; @RestController @RequestMapping("/qms/bus/test") +@DeptDataPermissionIgnore(enable = "true") public class TestController { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataExternalInfomation.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataExternalInfomation.java new file mode 100644 index 0000000..ae2cfea --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataExternalInfomation.java @@ -0,0 +1,47 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import java.io.Serializable; +import java.util.List; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +public class BusinessAssayTaskDataExternalInfomation implements Serializable { + + private static final long serialVersionUID = 2740738762124170770L; + + /** 是否退回 **/ + private Integer isRollback; + + /** 回退详情 **/ + private List rollbackDetailList; + + @Data + @NoArgsConstructor + @AllArgsConstructor + public static class RollbackDetail { + + /** + * 退回人ID + */ + private Long rollbackOperId; + + /** + * 退回人 + */ + private String rollbackOper; + + /** + * 退回原因 + */ + private String rollbackReason; + + /** + * 退回时间 yyyy-MM-dd HH:mm:ss + */ + private String rollbackTime; + } + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataPageReqVO.java index f3e993d..1b2d5d7 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataPageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataPageReqVO.java @@ -88,6 +88,9 @@ public class BusinessAssayTaskDataPageReqVO extends PageParam { @Schema(description = "复测次数", example = "28081") private Integer retestCount; + @Schema(description = "扩展信息") + private String externalInfomation; + @Schema(description = "乐观锁", example = "11435") private Integer updateCount; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataReqVO.java index 2b07b19..d788436 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataReqVO.java @@ -86,6 +86,9 @@ public class BusinessAssayTaskDataReqVO { @Schema(description = "复测次数", example = "28081") private Integer retestCount; + @Schema(description = "扩展信息") + private String externalInfomation; + @Schema(description = "乐观锁", example = "11435") private Integer updateCount; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataRespVO.java index a816ec3..6f47a33 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataRespVO.java @@ -111,6 +111,9 @@ public class BusinessAssayTaskDataRespVO { @ExcelProperty("复测次数") private Integer retestCount; + @Schema(description = "扩展信息") + private String externalInfomation; + @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "11435") @ExcelProperty("乐观锁") private Integer updateCount; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataSaveReqVO.java index bf51bf5..fd58915 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataSaveReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataSaveReqVO.java @@ -96,6 +96,9 @@ public class BusinessAssayTaskDataSaveReqVO { @Schema(description = "复测次数", example = "28081") private Integer retestCount; + @Schema(description = "扩展信息") + private String externalInfomation; + @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "11435") private Integer updateCount; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessAssayTaskDataDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessAssayTaskDataDO.java index e5a4d11..14fa03a 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessAssayTaskDataDO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessAssayTaskDataDO.java @@ -150,6 +150,11 @@ public class BusinessAssayTaskDataDO extends BusinessBaseDO { @TableField("RTST_CNT") private Integer retestCount; /** + * 扩展信息 + */ + @TableField("EXT_INF") + private String externalInfomation; + /** * 乐观锁 */ @TableField("UPD_CNT") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/entrust/SampleEntrustGenSampleDataCmp.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/entrust/SampleEntrustGenSampleDataCmp.java index c675372..18ef3f0 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/entrust/SampleEntrustGenSampleDataCmp.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/entrust/SampleEntrustGenSampleDataCmp.java @@ -333,7 +333,10 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent { //样品类型字典与委托一致 businessBaseSampleDO.setDictionaryBusinessId(businessSampleEntrustDetailDO.getSampleTypeDictionaryBusinessId()); //生成样品编号 - String sampleCode = sequenceUtil.genCode(configBaseSample.getCodeRule()); + String sampleCode = businessSampleEntrustDetailDO.getEntrustSampleCode();//默认取来样编号 + if (StringUtils.isNotBlank(configBaseSample.getCodeRule())) {//如果配置了样品编号生成规则,则以生成规则为准 + sampleCode = sequenceUtil.genCode(configBaseSample.getCodeRule()); + } businessBaseSampleDO.setSampleCode(sampleCode); //样品生成时间为当前时间 businessBaseSampleDO.setSampleTime(currentDateTime); diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/taskassign/SampleTaskAssignManualCmp.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/taskassign/SampleTaskAssignManualCmp.java index 60bdb68..3c9ae00 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/taskassign/SampleTaskAssignManualCmp.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/taskassign/SampleTaskAssignManualCmp.java @@ -98,6 +98,8 @@ public class SampleTaskAssignManualCmp extends NodeComponent { businessAssayTaskDO.setTaskSourceType(QmsCommonConstant.TASK_ASSIGN); businessAssayTaskDO.setConfigReportTemplateId(configReportTemplate.getId()); businessAssayTaskDO.setConfigReportTemplateKey(configReportTemplate.getKey()); + businessAssayTaskDO.setIsIngredients(configAssayMethod.getIsIngredients()); + businessAssayTaskDO.setIngredientsStatus("initial"); businessAssayTaskDO.setTaskAssignOperator(loginRealname); businessAssayTaskDO.setTaskAssignOperatorId(loginUser.getId()); diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/taskassign/SampleTaskAssignMethodCmp.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/taskassign/SampleTaskAssignMethodCmp.java index 57712aa..85c4851 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/taskassign/SampleTaskAssignMethodCmp.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/taskassign/SampleTaskAssignMethodCmp.java @@ -103,6 +103,8 @@ public class SampleTaskAssignMethodCmp extends NodeComponent { businessAssayTaskDO.setConfigReportTemplateKey(configReportTemplate.getKey()); businessAssayTaskDO.setAssayOperator(assignAssayUser.getRealName()); businessAssayTaskDO.setAssayOperatorId(assignAssayUser.getUserId()); + businessAssayTaskDO.setIsIngredients(configAssayMethod.getIsIngredients()); + businessAssayTaskDO.setIngredientsStatus("initial"); businessAssayTaskDO.setTaskAssignOperator(loginRealname); businessAssayTaskDO.setTaskAssignOperatorId(loginUser.getId()); diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/taskassign/SampleTaskAssignSampleCmp.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/taskassign/SampleTaskAssignSampleCmp.java index 27ecd31..fb4ef49 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/taskassign/SampleTaskAssignSampleCmp.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/taskassign/SampleTaskAssignSampleCmp.java @@ -98,6 +98,8 @@ public class SampleTaskAssignSampleCmp extends NodeComponent { businessAssayTaskDO.setTaskSourceType(QmsCommonConstant.TASK_ASSIGN); businessAssayTaskDO.setConfigReportTemplateId(configReportTemplate.getId()); businessAssayTaskDO.setConfigReportTemplateKey(configReportTemplate.getKey()); + businessAssayTaskDO.setIsIngredients(configAssayMethod.getIsIngredients()); + businessAssayTaskDO.setIngredientsStatus("initial"); businessAssayTaskDO.setTaskAssignOperator(loginRealname); businessAssayTaskDO.setTaskAssignOperatorId(loginUser.getId()); diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleAnalysisAuditServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleAnalysisAuditServiceImpl.java index 430547f..51a3f51 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleAnalysisAuditServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleAnalysisAuditServiceImpl.java @@ -327,49 +327,54 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic List businessAssayTaskDetailList = businessAssayTaskDetailMapper.selectList(new LambdaQueryWrapperX().eq(BusinessAssayTaskDetailDO::getBusinessAssayTaskId, businessAssayTaskDO.getId())); List businessAssayTaskDataList = businessAssayTaskDataMapper.selectList(new LambdaQueryWrapperX().eq(BusinessAssayTaskDataDO::getBusinessAssayTaskId, businessAssayTaskDO.getId()).eq(BusinessAssayTaskDataDO::getConfigAssayMethodId, businessAssayTaskDO.getConfigAssayMethodId())); - for (BusinessAssayTaskDataDO businessAssayTaskDataDO : businessAssayTaskDataList) { - BusinessAssayTaskDetailDO businessAssayTaskDetailDO = businessAssayTaskDetailList.stream().filter(f -> f.getSampleId().equals(businessAssayTaskDataDO.getBusinessSubSampleId())).findFirst().orElse(null); - + for (BusinessAssayTaskDetailDO businessAssayTaskDetailDO : businessAssayTaskDetailList) { Map map = new HashedMap<>(); - map.put("businessAssayTaskDataId", businessAssayTaskDataDO.getId()); - map.put("businessAssayTaskId", businessAssayTaskDataDO.getBusinessAssayTaskId()); - map.put("businessSubSampleId", businessAssayTaskDataDO.getBusinessSubSampleId()); - map.put("businessSubParentSampleId", businessAssayTaskDataDO.getBusinessSubParentSampleId()); - map.put("configAssayMethodId", businessAssayTaskDataDO.getConfigAssayMethodId()); + map.put("businessAssayTaskDetailId", businessAssayTaskDetailDO.getId()); map.put("sampleCode", businessAssayTaskDetailDO.getSampleCode()); map.put("sampleName", businessAssayTaskDetailDO.getSampleName()); map.put("analysisType", "analysis"); map.put("assayTime", businessAssayTaskJson.get("assayTime")); + map.put("taskDetailRemark", businessAssayTaskDetailDO.getRemark()); - List businessAssayTaskParameterDataList = businessAssayTaskParameterDataMapper.selectByBusinessAssayTaskDataIds(Arrays.asList(businessAssayTaskDataDO.getId())); - for (BusinessAssayProjectAndParameterRespVO businessAssayTaskParameterDataDO : businessAssayTaskParameterDataList) { - map.put(businessAssayTaskParameterDataDO.getName(), businessAssayTaskParameterDataDO.getValue()); - } + if (!"returned".equals(businessAssayTaskDetailDO.getRollbackStatus())) { + BusinessAssayTaskDataDO businessAssayTaskDataDO = businessAssayTaskDataList.stream().filter(f -> businessAssayTaskDetailDO.getBusinessAssayTaskDataId().equals(f.getId())).findFirst().orElse(null); + map.put("businessAssayTaskDataId", businessAssayTaskDataDO.getId()); + map.put("businessAssayTaskId", businessAssayTaskDataDO.getBusinessAssayTaskId()); + map.put("businessSubSampleId", businessAssayTaskDataDO.getBusinessSubSampleId()); + map.put("businessSubParentSampleId", businessAssayTaskDataDO.getBusinessSubParentSampleId()); + map.put("configAssayMethodId", businessAssayTaskDataDO.getConfigAssayMethodId()); + + List businessAssayTaskParameterDataList = businessAssayTaskParameterDataMapper.selectByBusinessAssayTaskDataIds(Arrays.asList(businessAssayTaskDataDO.getId())); + for (BusinessAssayProjectAndParameterRespVO businessAssayTaskParameterDataDO : businessAssayTaskParameterDataList) { + map.put(businessAssayTaskParameterDataDO.getName(), businessAssayTaskParameterDataDO.getValue()); + } - BusinessAssayProjectDataReqVO projectDataSearch2 = new BusinessAssayProjectDataReqVO(); - projectDataSearch2.setBusinessAssayTaskDataId(businessAssayTaskDataDO.getId()); - List projectAndParameterList2 = businessAssayProjectDataMapper.selectProjectAndParameterBy(projectDataSearch2); - for (BusinessAssayProjectAndParameterRespVO ep : projectAndParameterList2) { - String ev = ep.getValue(); - if (StringUtils.isNotBlank(ep.getSymbol()) && !"=".equals(ep.getSymbol())) { - ev = ep.getSymbol() + ev; - } - map.put(ep.getName(), ev); - if (StringUtils.isNotEmpty(ep.getFormula())) { - BusinessAssayParameterDataReqVO parameterDataSearch = new BusinessAssayParameterDataReqVO(); - parameterDataSearch.setBusinessAssayProjectDataId(ep.getId()); - List plist = businessAssayParameterDataMapper.selectProjectAndParameterBy(parameterDataSearch); - for (BusinessAssayProjectAndParameterRespVO p : plist) { - String v = p.getValue(); - if (StringUtils.isNotBlank(p.getSymbol()) && !"=".equals(p.getSymbol())) { - v = p.getSymbol() + v; - } - map.put(p.getName(), v); + BusinessAssayProjectDataReqVO projectDataSearch2 = new BusinessAssayProjectDataReqVO(); + projectDataSearch2.setBusinessAssayTaskDataId(businessAssayTaskDataDO.getId()); + List projectAndParameterList2 = businessAssayProjectDataMapper.selectProjectAndParameterBy(projectDataSearch2); + for (BusinessAssayProjectAndParameterRespVO ep : projectAndParameterList2) { + String ev = ep.getValue(); + if (StringUtils.isNotBlank(ep.getSymbol()) && !"=".equals(ep.getSymbol())) { + ev = ep.getSymbol() + ev; } + map.put(ep.getName(), ev); + if (StringUtils.isNotEmpty(ep.getFormula())) { + BusinessAssayParameterDataReqVO parameterDataSearch = new BusinessAssayParameterDataReqVO(); + parameterDataSearch.setBusinessAssayProjectDataId(ep.getId()); + List plist = businessAssayParameterDataMapper.selectProjectAndParameterBy(parameterDataSearch); + for (BusinessAssayProjectAndParameterRespVO p : plist) { + String v = p.getValue(); + if (StringUtils.isNotBlank(p.getSymbol()) && !"=".equals(p.getSymbol())) { + v = p.getSymbol() + v; + } + map.put(p.getName(), v); + } + } + } - } + datas.add(map); } @@ -451,54 +456,65 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic List businessAssayTaskDetailList = businessAssayTaskDetailMapper.selectList(new LambdaQueryWrapperX().eq(BusinessAssayTaskDetailDO::getBusinessAssayTaskId, businessAssayTaskDO.getId())); List businessAssayTaskDataList = businessAssayTaskDataMapper.selectList(new LambdaQueryWrapperX().eq(BusinessAssayTaskDataDO::getBusinessAssayTaskId, businessAssayTaskDO.getId()).eq(BusinessAssayTaskDataDO::getConfigAssayMethodId, businessAssayTaskDO.getConfigAssayMethodId())); - for (BusinessAssayTaskDataDO businessAssayTaskDataDO : businessAssayTaskDataList) { - BusinessAssayTaskDetailDO businessAssayTaskDetailDO = businessAssayTaskDetailList.stream().filter(f -> f.getSampleId().equals(businessAssayTaskDataDO.getBusinessSubSampleId())).findFirst().orElse(null); + for (BusinessAssayTaskDetailDO businessAssayTaskDetailDO : businessAssayTaskDetailList) { + //BusinessAssayTaskDetailDO businessAssayTaskDetailDO = businessAssayTaskDetailList.stream().filter(f -> f.getSampleId().equals(businessAssayTaskDataDO.getBusinessSubSampleId())).findFirst().orElse(null); HashedMap map = new HashedMap<>(); - map.put("businessAssayTaskDataId", businessAssayTaskDataDO.getId()); - map.put("businessAssayTaskId", businessAssayTaskDataDO.getBusinessAssayTaskId()); - map.put("businessSubSampleId", businessAssayTaskDataDO.getBusinessSubSampleId()); - map.put("businessSubParentSampleId", businessAssayTaskDataDO.getBusinessSubParentSampleId()); - map.put("configAssayMethodId", businessAssayTaskDataDO.getConfigAssayMethodId()); map.put("businessAssayTaskDetailId", businessAssayTaskDetailDO.getId()); map.put("sampleCode", businessAssayTaskDetailDO.getSampleCode()); map.put("sampleName", businessAssayTaskDetailDO.getSampleName()); map.put("analysisType", "analysis"); map.put("assayTime", businessAssayTaskJson.get("assayTime")); + map.put("taskDetailRemark", businessAssayTaskDetailDO.getRemark()); - List businessAssayTaskParameterDataList = businessAssayTaskParameterDataMapper.selectByBusinessAssayTaskDataIds(Arrays.asList(businessAssayTaskDataDO.getId())); - for (BusinessAssayProjectAndParameterRespVO businessAssayTaskParameterDataDO : businessAssayTaskParameterDataList) { - map.put(businessAssayTaskParameterDataDO.getName(), businessAssayTaskParameterDataDO.getValue()); + + if (!"returned".equals(businessAssayTaskDetailDO.getRollbackStatus())) { + BusinessAssayTaskDataDO businessAssayTaskDataDO = businessAssayTaskDataList.stream().filter(f -> businessAssayTaskDetailDO.getBusinessAssayTaskDataId().equals(f.getId())).findFirst().orElse(null); + + map.put("businessAssayTaskDataId", businessAssayTaskDataDO.getId()); + map.put("businessAssayTaskId", businessAssayTaskDataDO.getBusinessAssayTaskId()); + map.put("businessSubSampleId", businessAssayTaskDataDO.getBusinessSubSampleId()); + map.put("businessSubParentSampleId", businessAssayTaskDataDO.getBusinessSubParentSampleId()); + map.put("configAssayMethodId", businessAssayTaskDataDO.getConfigAssayMethodId()); + + List businessAssayTaskParameterDataList = businessAssayTaskParameterDataMapper.selectByBusinessAssayTaskDataIds(Arrays.asList(businessAssayTaskDataDO.getId())); + for (BusinessAssayProjectAndParameterRespVO businessAssayTaskParameterDataDO : businessAssayTaskParameterDataList) { + map.put(businessAssayTaskParameterDataDO.getName(), businessAssayTaskParameterDataDO.getValue()); + } + + BusinessAssayProjectDataReqVO projectDataSearch2 = new BusinessAssayProjectDataReqVO(); + projectDataSearch2.setBusinessAssayTaskDataId(businessAssayTaskDataDO.getId()); + List projectAndParameterList2 = businessAssayProjectDataMapper.selectProjectAndParameterBy(projectDataSearch2); + for (BusinessAssayProjectAndParameterRespVO ep : projectAndParameterList2) { + HashedMap newMap = SerializationUtils.clone(map); + String projectSymbol = ""; + if (StringUtils.isNotBlank(ep.getSymbol()) && !"=".equals(ep.getSymbol())) { + projectSymbol = ep.getSymbol(); + } +// newMap.put(ep.getName(), ep.getValue()); + newMap.put("projectName", ep.getShowName()); + newMap.put("projectValue", ep.getValue()); + newMap.put("projectSymbol", projectSymbol); + newMap.put("projectUnit", ep.getUnit()); + if (StringUtils.isNotEmpty(ep.getFormula())) { + BusinessAssayParameterDataReqVO parameterDataSearch = new BusinessAssayParameterDataReqVO(); + parameterDataSearch.setBusinessAssayProjectDataId(ep.getId()); + List plist = businessAssayParameterDataMapper.selectProjectAndParameterBy(parameterDataSearch); + for (BusinessAssayProjectAndParameterRespVO p : plist) { + String v = p.getValue(); + if (StringUtils.isNotBlank(p.getSymbol()) && !"=".equals(p.getSymbol())) { + v = p.getSymbol() + v; + } + newMap.put(p.getName(), v); + } + } + datas.add(newMap); + } + + } else { + datas.add(map); } - BusinessAssayProjectDataReqVO projectDataSearch2 = new BusinessAssayProjectDataReqVO(); - projectDataSearch2.setBusinessAssayTaskDataId(businessAssayTaskDataDO.getId()); - List projectAndParameterList2 = businessAssayProjectDataMapper.selectProjectAndParameterBy(projectDataSearch2); - for (BusinessAssayProjectAndParameterRespVO ep : projectAndParameterList2) { - HashedMap newMap = SerializationUtils.clone(map); - String projectSymbol = ""; - if (StringUtils.isNotBlank(ep.getSymbol()) && !"=".equals(ep.getSymbol())) { - projectSymbol = ep.getSymbol(); - } -// newMap.put(ep.getName(), ep.getValue()); - newMap.put("projectName", ep.getShowName()); - newMap.put("projectValue", ep.getValue()); - newMap.put("projectSymbol", projectSymbol); - newMap.put("projectUnit", ep.getUnit()); - if (StringUtils.isNotEmpty(ep.getFormula())) { - BusinessAssayParameterDataReqVO parameterDataSearch = new BusinessAssayParameterDataReqVO(); - parameterDataSearch.setBusinessAssayProjectDataId(ep.getId()); - List plist = businessAssayParameterDataMapper.selectProjectAndParameterBy(parameterDataSearch); - for (BusinessAssayProjectAndParameterRespVO p : plist) { - String v = p.getValue(); - if (StringUtils.isNotBlank(p.getSymbol()) && !"=".equals(p.getSymbol())) { - v = p.getSymbol() + v; - } - newMap.put(p.getName(), v); - } - } - datas.add(newMap); - } } List businessQCManagementDataDOList = businessQCManagementDataMapper.selectByBusinessAssayTaskId(businessAssayTaskDO.getId()); @@ -674,8 +690,8 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic Long dictionaryProjectId = businessAssayProjectDataDOEntry.getKey(); List val1 = businessAssayProjectDataDOEntry.getValue(); BusinessAssayProjectDataDO businessAssayProjectDataDO = val1.get(0); - List configAssayMethodProjectAssessmentDOList = configAssayMethodProjectAssessmentMapper.selectList(new LambdaQueryWrapperX().eq(ConfigAssayMethodProjectAssessmentDO::getConfigAssayMethodId, businessAssayTaskDataDO.getConfigAssayMethodId()).eq(ConfigAssayMethodProjectAssessmentDO::getConfigAssayMethodProjectId, businessAssayProjectDataDO.getConfigAssayMethodProjectId())); - + List configAssayMethodProjectAssessmentDOList = configAssayMethodProjectAssessmentMapper.selectByConfigBaseSampleIdAndConfigAssayMethodIdAndConfigAssayMethodProjectId(configSubSampleMethodDO.getConfigBaseSampleId(), businessAssayTaskDataDO.getConfigAssayMethodId(), businessAssayProjectDataDO.getConfigAssayMethodProjectId()); + //查询判定结果数据 BusinessSubSampleAssessmentProjectDO businessSubSampleAssessmentProjectDO = businessSubSampleAssessmentProjectMapper.selectByBusinessSubSampleIdAndConfigAssayMethodIdAndConfigAssayMethodProjectId(businessSubSampleId, businessAssayTaskDataDO.getConfigAssayMethodId(), businessAssayProjectDataDO.getConfigAssayMethodProjectId()); if (businessSubSampleAssessmentProjectDO == null) { @@ -1189,9 +1205,10 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic //设置判定值 businessSubSampleAssessmentProjectDO.setAssessmentValue(representativeValue.toPlainString()); - List configAssayMethodProjectAssessmentDOList = configAssayMethodProjectAssessmentMapper.selectList(new LambdaQueryWrapperX() - .eq(ConfigAssayMethodProjectAssessmentDO::getConfigAssayMethodId, businessSubSampleAssessmentProjectDO.getConfigAssayMethodId()) - .eq(ConfigAssayMethodProjectAssessmentDO::getConfigAssayMethodProjectId, businessSubSampleAssessmentProjectDO.getConfigAssayMethodProjectId())); +// List configAssayMethodProjectAssessmentDOList = configAssayMethodProjectAssessmentMapper.selectList(new LambdaQueryWrapperX() +// .eq(ConfigAssayMethodProjectAssessmentDO::getConfigAssayMethodId, businessSubSampleAssessmentProjectDO.getConfigAssayMethodId()) +// .eq(ConfigAssayMethodProjectAssessmentDO::getConfigAssayMethodProjectId, businessSubSampleAssessmentProjectDO.getConfigAssayMethodProjectId())); + List configAssayMethodProjectAssessmentDOList = configAssayMethodProjectAssessmentMapper.selectByConfigBaseSampleIdAndConfigAssayMethodIdAndConfigAssayMethodProjectId(configSubSampleMethodDO.getConfigBaseSampleId(), businessSubSampleAssessmentProjectDO.getConfigAssayMethodId(), businessSubSampleAssessmentProjectDO.getConfigAssayMethodProjectId()); // 查找匹配的允差规则 ConfigAssayMethodProjectAssessmentDO matchedRule = findMatchingRule(configAssayMethodProjectAssessmentDOList, representativeValue); diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleAnalysisServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleAnalysisServiceImpl.java index b780a8f..98dd8b2 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleAnalysisServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleAnalysisServiceImpl.java @@ -21,8 +21,10 @@ import com.alibaba.fastjson2.JSON; import com.alibaba.fastjson2.JSONArray; import com.alibaba.fastjson2.JSONObject; import com.zt.plat.framework.common.exception.ServiceException; +import com.zt.plat.framework.common.util.date.DateUtils; import com.zt.plat.framework.common.util.object.BeanUtils; import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zt.plat.framework.security.core.LoginUser; import com.zt.plat.framework.security.core.util.SecurityFrameworkUtils; import com.zt.plat.module.qms.business.bus.controller.vo.BatchSampleAnalysisColumnRespVO; import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayParameterDataExtendRespVO; @@ -34,6 +36,8 @@ import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayTaskAnalys import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayTaskAnalysisSampleProjectRespVO; import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayTaskBackSampleReqVO; import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayTaskDataExtendRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayTaskDataExternalInfomation; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayTaskDataExternalInfomation.RollbackDetail; import com.zt.plat.module.qms.business.bus.controller.vo.BusinessQCCoefficientParameterDataReqVO; import com.zt.plat.module.qms.business.bus.controller.vo.BusinessQCManagementParameterDataReqVO; import com.zt.plat.module.qms.business.bus.controller.vo.BusinessQCManagementProjectDataReqVO; @@ -96,6 +100,8 @@ import com.zt.plat.module.qms.enums.QmsCommonConstant; import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.date.DateTime; +import cn.hutool.core.date.DateUtil; import jakarta.annotation.Resource; @Service @@ -1317,14 +1323,56 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService { @Override public void rollbackAnalysisSample(BusinessAssayTaskBackSampleReqVO req) { + LoginUser loginUser = SecurityFrameworkUtils.getLoginUser(); + String loginUserNickname = SecurityFrameworkUtils.getLoginUserNickname(); List businessAssayTaskDetailList = businessAssayTaskDetailMapper.selectByIds(req.getIdList()); for (BusinessAssayTaskDetailDO businessAssayTaskDetailDO : businessAssayTaskDetailList) { businessAssayTaskDetailDO.setRollbackStatus("returned"); businessAssayTaskDetailDO.setRemark(req.getBackDesc()); } + List businessAssayTaskDataIdList = businessAssayTaskDetailList.stream().map(m -> m.getBusinessAssayTaskDataId()).collect(Collectors.toList()); + List businessAssayTaskDataDOList = businessAssayTaskDataMapper.selectByIds(businessAssayTaskDataIdList); + for (BusinessAssayTaskDataDO businessAssayTaskDataDO : businessAssayTaskDataDOList) { + businessAssayTaskDataDO.setBusinessAssayTaskId(null); + businessAssayTaskDataDO.setAssayOperatorId(null); + businessAssayTaskDataDO.setAssayOperator(null); + businessAssayTaskDataDO.setAssignTaskTime(null); + businessAssayTaskDataDO.setIsAssignTasked(0); + + BusinessAssayTaskDataExternalInfomation businessAssayTaskDataExternalInfomation = null; + String externalInfomation = businessAssayTaskDataDO.getExternalInfomation(); + if (StringUtils.isNotBlank(externalInfomation)) { + businessAssayTaskDataExternalInfomation = JSON.parseObject(externalInfomation, BusinessAssayTaskDataExternalInfomation.class); + } else { + businessAssayTaskDataExternalInfomation = new BusinessAssayTaskDataExternalInfomation(); + } + + businessAssayTaskDataExternalInfomation.setIsRollback(QmsCommonConstant.YES); + + List rollbackDetailList = businessAssayTaskDataExternalInfomation.getRollbackDetailList(); + if (CollUtil.isEmpty(rollbackDetailList)) { + rollbackDetailList = new ArrayList<>(); + } + //回退详情 + RollbackDetail rollbackDetail = new RollbackDetail(); + rollbackDetail.setRollbackOperId(loginUser.getId()); + rollbackDetail.setRollbackOper(loginUserNickname); + rollbackDetail.setRollbackReason(req.getBackDesc()); + rollbackDetail.setRollbackTime(DateUtil.formatLocalDateTime(LocalDateTime.now())); + rollbackDetailList.add(rollbackDetail); + + businessAssayTaskDataExternalInfomation.setRollbackDetailList(rollbackDetailList); + businessAssayTaskDataDO.setExternalInfomation(JSON.toJSONString(businessAssayTaskDataExternalInfomation)); + + } - businessAssayTaskDetailMapper.updateBatch(businessAssayTaskDetailList); + if (CollUtil.isNotEmpty(businessAssayTaskDetailList)) { + businessAssayTaskDetailMapper.updateBatch(businessAssayTaskDetailList); + } + if (CollUtil.isNotEmpty(businessAssayTaskDataDOList)) { + businessAssayTaskDataMapper.updateBatch(businessAssayTaskDataDOList); + } } @Override diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/BaseSampleController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/BaseSampleController.java index 4329898..b95b1d6 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/BaseSampleController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/BaseSampleController.java @@ -23,6 +23,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -37,6 +39,7 @@ import com.zt.plat.module.qms.business.config.service.BaseSampleService; @RestController @RequestMapping("/qms/base-sample") @Validated +@DeptDataPermissionIgnore(enable = "true") public class BaseSampleController implements BusinessControllerMarker { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigAssayMethodController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigAssayMethodController.java index 98c088c..1d2d8d9 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigAssayMethodController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigAssayMethodController.java @@ -21,6 +21,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -36,6 +38,7 @@ import com.zt.plat.module.qms.business.config.service.ConfigAssayMethodService; @RestController @RequestMapping("/qms/config-assay-method") @Validated +@DeptDataPermissionIgnore(enable = "true") public class ConfigAssayMethodController implements BusinessControllerMarker { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigAssayMethodParameterController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigAssayMethodParameterController.java index b68d6f1..2b140c2 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigAssayMethodParameterController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigAssayMethodParameterController.java @@ -21,6 +21,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -34,6 +36,7 @@ import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; @RestController @RequestMapping("/qms/config-assay-method-parameter") @Validated +@DeptDataPermissionIgnore(enable = "true") public class ConfigAssayMethodParameterController implements BusinessControllerMarker { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigAssayMethodProjectAssessmentController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigAssayMethodProjectAssessmentController.java index 376c3ad..65d7968 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigAssayMethodProjectAssessmentController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigAssayMethodProjectAssessmentController.java @@ -21,6 +21,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -34,6 +36,7 @@ import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; @RestController @RequestMapping("/qms/config-assay-method-project-assessment") @Validated +@DeptDataPermissionIgnore(enable = "true") public class ConfigAssayMethodProjectAssessmentController implements BusinessControllerMarker { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigAssayMethodProjectCoefficientController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigAssayMethodProjectCoefficientController.java index 6faf4a3..783d8d2 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigAssayMethodProjectCoefficientController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigAssayMethodProjectCoefficientController.java @@ -21,6 +21,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -34,6 +36,7 @@ import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; @RestController @RequestMapping("/qms/config-assay-method-project-coefficient") @Validated +@DeptDataPermissionIgnore(enable = "true") public class ConfigAssayMethodProjectCoefficientController implements BusinessControllerMarker { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigAssayMethodProjectController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigAssayMethodProjectController.java index 5fe6fad..4305175 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigAssayMethodProjectController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigAssayMethodProjectController.java @@ -23,6 +23,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -38,6 +40,7 @@ import com.zt.plat.module.qms.business.config.service.ConfigAssayMethodProjectSe @RestController @RequestMapping("/qms/config-assay-method-project") @Validated +@DeptDataPermissionIgnore(enable = "true") public class ConfigAssayMethodProjectController implements BusinessControllerMarker { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigAssayMethodProjectParameterController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigAssayMethodProjectParameterController.java index e8bd392..a1fdd6e 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigAssayMethodProjectParameterController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigAssayMethodProjectParameterController.java @@ -23,6 +23,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -38,6 +40,7 @@ import com.zt.plat.module.qms.business.config.service.ConfigAssayMethodProjectPa @RestController @RequestMapping("/qms/config-assay-method-project-parameter") @Validated +@DeptDataPermissionIgnore(enable = "true") public class ConfigAssayMethodProjectParameterController implements BusinessControllerMarker { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigAssayMethodProjectRangeController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigAssayMethodProjectRangeController.java index ce4f804..a9b0356 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigAssayMethodProjectRangeController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigAssayMethodProjectRangeController.java @@ -23,6 +23,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -36,6 +38,7 @@ import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; @RestController @RequestMapping("/qms/config-assay-method-project-range") @Validated +@DeptDataPermissionIgnore(enable = "true") public class ConfigAssayMethodProjectRangeController implements BusinessControllerMarker { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigBaseSampleController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigBaseSampleController.java index 1f83fb2..bc95d3b 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigBaseSampleController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigBaseSampleController.java @@ -23,6 +23,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -38,6 +40,7 @@ import com.zt.plat.module.qms.business.config.service.ConfigBaseSampleService; @RestController @RequestMapping("/qms/config-base-sample") @Validated +@DeptDataPermissionIgnore(enable = "true") public class ConfigBaseSampleController implements BusinessControllerMarker { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigEntrustSourceController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigEntrustSourceController.java index 3913f0c..cec45f3 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigEntrustSourceController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigEntrustSourceController.java @@ -24,6 +24,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -39,6 +41,7 @@ import com.zt.plat.module.qms.business.config.service.ConfigEntrustSourceService @RestController @RequestMapping("/qms/config-entrust-source") @Validated +@DeptDataPermissionIgnore(enable = "true") public class ConfigEntrustSourceController implements BusinessControllerMarker { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigEntrustSourceSampleTypeController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigEntrustSourceSampleTypeController.java index 6c7da2e..59c4dfd 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigEntrustSourceSampleTypeController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigEntrustSourceSampleTypeController.java @@ -21,6 +21,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -34,6 +36,7 @@ import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; @RestController @RequestMapping("/qms/config-entrust-source-sample-type") @Validated +@DeptDataPermissionIgnore(enable = "true") public class ConfigEntrustSourceSampleTypeController implements BusinessControllerMarker { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigPermissionController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigPermissionController.java index 2ac449a..db82867 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigPermissionController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigPermissionController.java @@ -23,6 +23,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -37,6 +39,7 @@ import com.zt.plat.module.qms.business.config.service.ConfigPermissionService; @RestController @RequestMapping("/qms/config-permission") @Validated +@DeptDataPermissionIgnore(enable = "true") public class ConfigPermissionController implements BusinessControllerMarker { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigProjectController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigProjectController.java index e251e92..174dac7 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigProjectController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigProjectController.java @@ -23,6 +23,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -38,6 +40,7 @@ import com.zt.plat.module.qms.business.config.service.ConfigProjectService; @RestController @RequestMapping("/qms/config-project") @Validated +@DeptDataPermissionIgnore(enable = "true") public class ConfigProjectController implements BusinessControllerMarker { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigQCSampleMethodController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigQCSampleMethodController.java index 5115254..3c491b3 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigQCSampleMethodController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigQCSampleMethodController.java @@ -21,6 +21,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -34,6 +36,7 @@ import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; @RestController @RequestMapping("/qms/config-qc-sample-method") @Validated +@DeptDataPermissionIgnore(enable = "true") public class ConfigQCSampleMethodController implements BusinessControllerMarker { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigQCSampleMethodParameterController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigQCSampleMethodParameterController.java index 6662b7b..6f75711 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigQCSampleMethodParameterController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigQCSampleMethodParameterController.java @@ -21,6 +21,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -34,6 +36,7 @@ import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; @RestController @RequestMapping("/qms/config-QC-sample-method-parameter") @Validated +@DeptDataPermissionIgnore(enable = "true") public class ConfigQCSampleMethodParameterController implements BusinessControllerMarker { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigQCStandardSampleController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigQCStandardSampleController.java index 0bbb29f..244b15c 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigQCStandardSampleController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigQCStandardSampleController.java @@ -21,6 +21,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -34,6 +36,7 @@ import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; @RestController @RequestMapping("/qms/config-qc-standard-sample") @Validated +@DeptDataPermissionIgnore(enable = "true") public class ConfigQCStandardSampleController implements BusinessControllerMarker { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigReportFieldController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigReportFieldController.java index c755fbb..e9865a6 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigReportFieldController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigReportFieldController.java @@ -23,6 +23,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -38,6 +40,7 @@ import com.zt.plat.module.qms.business.config.service.ConfigReportFieldService; @RestController @RequestMapping("/qms/config-report-field") @Validated +@DeptDataPermissionIgnore(enable = "true") public class ConfigReportFieldController implements BusinessControllerMarker { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigReportTemplateController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigReportTemplateController.java index 1a0369f..8ddb723 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigReportTemplateController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigReportTemplateController.java @@ -20,6 +20,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -33,6 +35,7 @@ import com.zt.plat.module.qms.business.config.service.ConfigReportTemplateServic @RestController @RequestMapping("/qms/config-report-template") @Validated +@DeptDataPermissionIgnore(enable = "true") public class ConfigReportTemplateController implements BusinessControllerMarker { @Resource diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigReportTypeController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigReportTypeController.java index e6284ef..70132bb 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigReportTypeController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigReportTypeController.java @@ -23,6 +23,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -38,6 +40,7 @@ import com.zt.plat.module.qms.business.config.service.ConfigReportTypeService; @RestController @RequestMapping("/qms/config-report-type") @Validated +@DeptDataPermissionIgnore(enable = "true") public class ConfigReportTypeController implements BusinessControllerMarker { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigRuleController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigRuleController.java index 08667d8..6c1aa9f 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigRuleController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigRuleController.java @@ -21,6 +21,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -34,6 +36,7 @@ import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; @RestController @RequestMapping("/qms/config-rule") @Validated +@DeptDataPermissionIgnore(enable = "true") public class ConfigRuleController implements BusinessControllerMarker { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigSampleFlowController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigSampleFlowController.java index 51aa002..8dc0ccd 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigSampleFlowController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigSampleFlowController.java @@ -23,6 +23,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -38,6 +40,7 @@ import com.zt.plat.module.qms.business.config.service.ConfigSampleFlowService; @RestController @RequestMapping("/qms/config-sample-flow") @Validated +@DeptDataPermissionIgnore(enable = "true") public class ConfigSampleFlowController implements BusinessControllerMarker { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigSampleHandoverController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigSampleHandoverController.java index c4205e5..de797f5 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigSampleHandoverController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigSampleHandoverController.java @@ -23,6 +23,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -36,6 +38,7 @@ import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; @RestController @RequestMapping("/qms/config-sample-handover") @Validated +@DeptDataPermissionIgnore(enable = "true") public class ConfigSampleHandoverController implements BusinessControllerMarker { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigSampleReportController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigSampleReportController.java index 4451939..3cbe886 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigSampleReportController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigSampleReportController.java @@ -23,6 +23,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -38,6 +40,7 @@ import com.zt.plat.module.qms.business.config.service.ConfigSampleReportService; @RestController @RequestMapping("/qms/config-sample-report") @Validated +@DeptDataPermissionIgnore(enable = "true") public class ConfigSampleReportController implements BusinessControllerMarker { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigSimpleFlowCodeController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigSimpleFlowCodeController.java index dcb867a..1b5b4e0 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigSimpleFlowCodeController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigSimpleFlowCodeController.java @@ -20,6 +20,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -35,6 +37,7 @@ import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; @RestController @RequestMapping("/qms/config-simple-flow-code") @Validated +@DeptDataPermissionIgnore(enable = "true") public class ConfigSimpleFlowCodeController implements BusinessControllerMarker { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigSimpleFlowRuleController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigSimpleFlowRuleController.java index 012700c..ca04be9 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigSimpleFlowRuleController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigSimpleFlowRuleController.java @@ -23,6 +23,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -39,6 +41,7 @@ import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; @RestController @RequestMapping("/qms/config-simple-flow-rule") @Validated +@DeptDataPermissionIgnore(enable = "true") public class ConfigSimpleFlowRuleController implements BusinessControllerMarker { @Resource diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigStandardSampleProjectController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigStandardSampleProjectController.java index 4ead6ba..9761d90 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigStandardSampleProjectController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigStandardSampleProjectController.java @@ -23,6 +23,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -38,6 +40,7 @@ import com.zt.plat.module.qms.business.config.service.ConfigStandardSampleProjec @RestController @RequestMapping("/qms/config-standard-sample-project") @Validated +@DeptDataPermissionIgnore(enable = "true") public class ConfigStandardSampleProjectController implements BusinessControllerMarker { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigStandardSampleTypeController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigStandardSampleTypeController.java index 7ab0a5d..e04d327 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigStandardSampleTypeController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigStandardSampleTypeController.java @@ -23,6 +23,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -38,6 +40,7 @@ import com.zt.plat.module.qms.business.config.service.ConfigStandardSampleTypeSe @RestController @RequestMapping("/qms/config-standard-sample-type") @Validated +@DeptDataPermissionIgnore(enable = "true") public class ConfigStandardSampleTypeController implements BusinessControllerMarker { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigSubSampleController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigSubSampleController.java index 69af5fd..9b67239 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigSubSampleController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigSubSampleController.java @@ -23,6 +23,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -38,6 +40,7 @@ import com.zt.plat.module.qms.business.config.service.ConfigSubSampleService; @RestController @RequestMapping("/qms/config-sub-sample") @Validated +@DeptDataPermissionIgnore(enable = "true") public class ConfigSubSampleController implements BusinessControllerMarker { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigSubSampleMethodController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigSubSampleMethodController.java index e74bf12..a2e1155 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigSubSampleMethodController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigSubSampleMethodController.java @@ -23,6 +23,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -38,6 +40,7 @@ import com.zt.plat.module.qms.business.config.service.ConfigSubSampleMethodServi @RestController @RequestMapping("/qms/config-sub-sample-method") @Validated +@DeptDataPermissionIgnore(enable = "true") public class ConfigSubSampleMethodController implements BusinessControllerMarker { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigSubSampleParentController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigSubSampleParentController.java index 042d3d6..593bc37 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigSubSampleParentController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigSubSampleParentController.java @@ -23,6 +23,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -38,6 +40,7 @@ import com.zt.plat.module.qms.business.config.service.ConfigSubSampleParentServi @RestController @RequestMapping("/qms/config-sub-sample-parent") @Validated +@DeptDataPermissionIgnore(enable = "true") public class ConfigSubSampleParentController implements BusinessControllerMarker { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigSubSampleParentMethodController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigSubSampleParentMethodController.java index 34bef7d..33b3151 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigSubSampleParentMethodController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigSubSampleParentMethodController.java @@ -21,6 +21,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -34,6 +36,7 @@ import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; @RestController @RequestMapping("/qms/config-sub-sample-parent-method") @Validated +@DeptDataPermissionIgnore(enable = "true") public class ConfigSubSampleParentMethodController implements BusinessControllerMarker { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigUserSignatureController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigUserSignatureController.java index 52982bd..bf14641 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigUserSignatureController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigUserSignatureController.java @@ -25,6 +25,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -39,6 +41,7 @@ import com.zt.plat.module.qms.business.config.service.ConfigUserSignatureService @RestController @RequestMapping("/qms/config-user-signature") @Validated +@DeptDataPermissionIgnore(enable = "true") @FileUploadController(source = "qms.configusersignature") public class ConfigUserSignatureController extends AbstractFileUploadController implements BusinessControllerMarker{ diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigWarehouseLocationController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigWarehouseLocationController.java index fbba672..119cae3 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigWarehouseLocationController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigWarehouseLocationController.java @@ -31,6 +31,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -45,6 +47,7 @@ import com.zt.plat.module.qms.business.config.service.ConfigWarehouseLocationSer @RestController @RequestMapping("/qms/config-warehouse-location") @Validated +@DeptDataPermissionIgnore(enable = "true") public class ConfigWarehouseLocationController implements BusinessControllerMarker { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigXRFConversionRateController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigXRFConversionRateController.java index fb25d2a..d4528af 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigXRFConversionRateController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigXRFConversionRateController.java @@ -21,6 +21,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -34,6 +36,7 @@ import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; @RestController @RequestMapping("/qms/config-xrf-conversion-rate") @Validated +@DeptDataPermissionIgnore(enable = "true") public class ConfigXRFConversionRateController implements BusinessControllerMarker { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigXRFLineController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigXRFLineController.java index b562b9d..ae204e9 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigXRFLineController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigXRFLineController.java @@ -21,6 +21,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -34,6 +36,7 @@ import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; @RestController @RequestMapping("/qms/config-xrf-line") @Validated +@DeptDataPermissionIgnore(enable = "true") public class ConfigXRFLineController implements BusinessControllerMarker { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigXRFProjectController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigXRFProjectController.java index 44f806d..2e379b5 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigXRFProjectController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigXRFProjectController.java @@ -21,6 +21,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -34,6 +36,7 @@ import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; @RestController @RequestMapping("/qms/config-xrf-project") @Validated +@DeptDataPermissionIgnore(enable = "true") public class ConfigXRFProjectController implements BusinessControllerMarker { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/GridReportController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/GridReportController.java index 9a564b0..1b7b7f4 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/GridReportController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/GridReportController.java @@ -30,6 +30,7 @@ import com.baomidou.mybatisplus.core.toolkit.StringPool; import com.zt.plat.framework.common.exception.ServiceException; import com.zt.plat.framework.common.pojo.CommonResult; import com.zt.plat.framework.common.util.servlet.ServletUtils; +import com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; import com.zt.plat.framework.security.config.SecurityProperties; import com.zt.plat.framework.security.core.LoginUser; import com.zt.plat.framework.security.core.util.SecurityFrameworkUtils; @@ -61,6 +62,7 @@ import lombok.extern.slf4j.Slf4j; @Slf4j @RestController @RequestMapping("/qms/config-report-template") +@DeptDataPermissionIgnore(enable = "true") public class GridReportController { public static final String WR_PREFIX = "_WR_"; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/MaterialAssayStandardController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/MaterialAssayStandardController.java index 28aff4f..3a0db61 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/MaterialAssayStandardController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/MaterialAssayStandardController.java @@ -27,6 +27,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -41,6 +43,7 @@ import com.zt.plat.module.qms.business.config.service.MaterialAssayStandardServi @RestController @RequestMapping("/qms/material-assay-standard") @Validated +@DeptDataPermissionIgnore(enable = "true") public class MaterialAssayStandardController implements BusinessControllerMarker { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/MaterialAssayStandardDetailController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/MaterialAssayStandardDetailController.java index b14fc5a..f92f190 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/MaterialAssayStandardDetailController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/MaterialAssayStandardDetailController.java @@ -27,6 +27,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -41,6 +43,7 @@ import com.zt.plat.module.qms.business.config.service.MaterialAssayStandardDetai @RestController @RequestMapping("/qms/material-assay-standard-detail") @Validated +@DeptDataPermissionIgnore(enable = "true") public class MaterialAssayStandardDetailController implements BusinessControllerMarker { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/MaterialAssayStandardForecastProjectController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/MaterialAssayStandardForecastProjectController.java index a0fbf10..ab45985 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/MaterialAssayStandardForecastProjectController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/MaterialAssayStandardForecastProjectController.java @@ -23,6 +23,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -36,6 +38,7 @@ import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; @RestController @RequestMapping("/qms/material-assay-standard-forecast-project") @Validated +@DeptDataPermissionIgnore(enable = "true") public class MaterialAssayStandardForecastProjectController implements BusinessControllerMarker { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/MaterialAssayStandardMethodController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/MaterialAssayStandardMethodController.java index 1cdeb1b..3578319 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/MaterialAssayStandardMethodController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/MaterialAssayStandardMethodController.java @@ -23,6 +23,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -37,6 +39,7 @@ import com.zt.plat.module.qms.business.config.service.MaterialAssayStandardMetho @RestController @RequestMapping("/qms/material-assay-standard-method") @Validated +@DeptDataPermissionIgnore(enable = "true") public class MaterialAssayStandardMethodController implements BusinessControllerMarker { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectAssessmentPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectAssessmentPageReqVO.java index fd7b1b6..09f6356 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectAssessmentPageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectAssessmentPageReqVO.java @@ -13,6 +13,9 @@ import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH @Data public class ConfigAssayMethodProjectAssessmentPageReqVO extends PageParam { + @Schema(description = "主样配置ID", example = "30107") + private Long configBaseSampleId; + @Schema(description = "检测方法配置ID", example = "18120") private Long configAssayMethodId; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectAssessmentRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectAssessmentRespVO.java index 2501d8e..953c5a8 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectAssessmentRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectAssessmentRespVO.java @@ -16,6 +16,10 @@ public class ConfigAssayMethodProjectAssessmentRespVO { @ExcelProperty("ID") private Long id; + @Schema(description = "主样配置ID", example = "30107") + @ExcelProperty("主样配置ID") + private Long configBaseSampleId; + @Schema(description = "检测方法配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "18120") @ExcelProperty("检测方法配置ID") private Long configAssayMethodId; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectAssessmentSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectAssessmentSaveReqVO.java index efd5e17..dbd35d5 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectAssessmentSaveReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectAssessmentSaveReqVO.java @@ -12,6 +12,9 @@ public class ConfigAssayMethodProjectAssessmentSaveReqVO { @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "912") private Long id; + @Schema(description = "主样配置ID", example = "30107") + private Long configBaseSampleId; + @Schema(description = "检测方法配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "18120") @NotNull(message = "检测方法配置ID不能为空") private Long configAssayMethodId; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigAssayMethodProjectAssessmentDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigAssayMethodProjectAssessmentDO.java index 789f4b4..507a7d9 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigAssayMethodProjectAssessmentDO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigAssayMethodProjectAssessmentDO.java @@ -32,6 +32,11 @@ public class ConfigAssayMethodProjectAssessmentDO extends BusinessBaseDO { @TableId(type = IdType.ASSIGN_ID) private Long id; /** + * 主样配置ID + */ + @TableField("CFG_BSE_SMP_ID") + private Long configBaseSampleId; + /** * 检测方法配置ID */ @TableField("CFG_ASY_MTHD_ID") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigAssayMethodProjectAssessmentMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigAssayMethodProjectAssessmentMapper.java index 2f493b8..e0e5c54 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigAssayMethodProjectAssessmentMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigAssayMethodProjectAssessmentMapper.java @@ -19,6 +19,7 @@ public interface ConfigAssayMethodProjectAssessmentMapper extends BaseMapperX selectPage(ConfigAssayMethodProjectAssessmentPageReqVO reqVO) { return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(ConfigAssayMethodProjectAssessmentDO::getConfigBaseSampleId, reqVO.getConfigBaseSampleId()) .eqIfPresent(ConfigAssayMethodProjectAssessmentDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId()) .eqIfPresent(ConfigAssayMethodProjectAssessmentDO::getConfigAssayMethodProjectId, reqVO.getConfigAssayMethodProjectId()) .eqIfPresent(ConfigAssayMethodProjectAssessmentDO::getDictionaryProjectId, reqVO.getDictionaryProjectId()) @@ -37,5 +38,21 @@ public interface ConfigAssayMethodProjectAssessmentMapper extends BaseMapperX selectByConfigBaseSampleIdsAndConfigAssayMethodIdAndConfigAssayMethodProjectId(Long configBaseSampleIdList, Long configAssayMethodId, Long configAssayMethodProjectId) { + return selectList(new LambdaQueryWrapperX() + .inIfPresent(ConfigAssayMethodProjectAssessmentDO::getConfigBaseSampleId, configBaseSampleIdList) + .eqIfPresent(ConfigAssayMethodProjectAssessmentDO::getConfigAssayMethodId, configAssayMethodId) + .eqIfPresent(ConfigAssayMethodProjectAssessmentDO::getConfigAssayMethodProjectId, configAssayMethodProjectId) + .orderByDesc(ConfigAssayMethodProjectAssessmentDO::getId)); + } + + default List selectByConfigBaseSampleIdAndConfigAssayMethodIdAndConfigAssayMethodProjectId(Long configBaseSampleId, Long configAssayMethodId, Long configAssayMethodProjectId) { + return selectList(new LambdaQueryWrapperX() + .eqIfPresent(ConfigAssayMethodProjectAssessmentDO::getConfigBaseSampleId, configBaseSampleId) + .eqIfPresent(ConfigAssayMethodProjectAssessmentDO::getConfigAssayMethodId, configAssayMethodId) + .eqIfPresent(ConfigAssayMethodProjectAssessmentDO::getConfigAssayMethodProjectId, configAssayMethodProjectId) + .orderByDesc(ConfigAssayMethodProjectAssessmentDO::getId)); + } } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigSubSampleMethodMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigSubSampleMethodMapper.java index 15537ac..3d17c5f 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigSubSampleMethodMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigSubSampleMethodMapper.java @@ -55,7 +55,10 @@ public interface ConfigSubSampleMethodMapper extends BaseMapperX() .leftJoin(ConfigSubSampleParentMethodDO.class, ConfigSubSampleParentMethodDO::getId, ConfigSubSampleMethodDO::getConfigSubSampleParentMethodId) + .leftJoin(ConfigSubSampleDO.class, ConfigSubSampleDO::getId, ConfigSubSampleMethodDO::getConfigSubSampleId) .selectAll(ConfigSubSampleMethodDO.class) + .selectAs(ConfigSubSampleDO::getConfigBaseSampleId, ConfigSubSampleMethodExtendRespVO::getConfigBaseSampleId) + .selectAs(ConfigSubSampleDO::getConfigSubSampleParentId, ConfigSubSampleMethodExtendRespVO::getConfigSubSampleParentId) .selectAs(ConfigSubSampleParentMethodDO::getConfigAssayMethodId, ConfigSubSampleMethodExtendRespVO::getConfigAssayMethodId) .selectAs(ConfigSubSampleParentMethodDO::getIsDefaultUse, ConfigSubSampleMethodExtendRespVO::getIsDefaultUse) .eq(ConfigSubSampleMethodDO::getConfigSubSampleId, configSubSampleId) diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/controller/admin/DictionaryParameterController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/controller/admin/DictionaryParameterController.java index 0355fa7..6f580e6 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/controller/admin/DictionaryParameterController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/controller/admin/DictionaryParameterController.java @@ -7,6 +7,7 @@ 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.datapermission.core.annotation.DeptDataPermissionIgnore; import com.zt.plat.framework.excel.core.util.ExcelUtils; import com.zt.plat.module.qms.business.dic.controller.vo.DictionaryParameterPageReqVO; import com.zt.plat.module.qms.business.dic.controller.vo.DictionaryParameterRespVO; @@ -33,6 +34,7 @@ import static com.zt.plat.framework.common.pojo.CommonResult.success; @RestController @RequestMapping("/qms/dictionary-parameter") @Validated +@DeptDataPermissionIgnore(enable = "true") public class DictionaryParameterController implements BusinessControllerMarker { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/controller/admin/DictionaryProjectController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/controller/admin/DictionaryProjectController.java index 0688e2c..5c948ab 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/controller/admin/DictionaryProjectController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/controller/admin/DictionaryProjectController.java @@ -7,6 +7,7 @@ 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.datapermission.core.annotation.DeptDataPermissionIgnore; import com.zt.plat.framework.excel.core.util.ExcelUtils; import com.zt.plat.module.qms.business.dic.controller.vo.DictionaryProjectPageReqVO; import com.zt.plat.module.qms.business.dic.controller.vo.DictionaryProjectRespVO; @@ -33,6 +34,7 @@ import static com.zt.plat.framework.common.pojo.CommonResult.success; @RestController @RequestMapping("/qms/dictionary-project") @Validated +@DeptDataPermissionIgnore(enable = "true") public class DictionaryProjectController implements BusinessControllerMarker { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/controller/admin/DictionarySampleFlowNodeController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/controller/admin/DictionarySampleFlowNodeController.java index 07d5fbd..1e5812f 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/controller/admin/DictionarySampleFlowNodeController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/controller/admin/DictionarySampleFlowNodeController.java @@ -7,6 +7,7 @@ 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.datapermission.core.annotation.DeptDataPermissionIgnore; import com.zt.plat.framework.excel.core.util.ExcelUtils; import com.zt.plat.module.qms.business.dic.controller.vo.DictionarySampleFlowNodePageReqVO; import com.zt.plat.module.qms.business.dic.controller.vo.DictionarySampleFlowNodeRespVO; @@ -33,6 +34,7 @@ import static com.zt.plat.framework.common.pojo.CommonResult.success; @RestController @RequestMapping("/qms/dictionary-sample-flow-node") @Validated +@DeptDataPermissionIgnore(enable = "true") public class DictionarySampleFlowNodeController implements BusinessControllerMarker { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/controller/admin/DictionarySampleTypeController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/controller/admin/DictionarySampleTypeController.java index 97fa218..ab664c3 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/controller/admin/DictionarySampleTypeController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/controller/admin/DictionarySampleTypeController.java @@ -7,6 +7,7 @@ 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.datapermission.core.annotation.DeptDataPermissionIgnore; import com.zt.plat.framework.excel.core.util.ExcelUtils; import com.zt.plat.module.qms.business.dic.controller.vo.DictionarySampleTypePageReqVO; import com.zt.plat.module.qms.business.dic.controller.vo.DictionarySampleTypeRespVO; @@ -33,6 +34,7 @@ import static com.zt.plat.framework.common.pojo.CommonResult.success; @RestController @RequestMapping("/qms/dictionary-sample-type") @Validated +@DeptDataPermissionIgnore(enable = "true") public class DictionarySampleTypeController implements BusinessControllerMarker { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/admin/ReportDocumentDataController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/admin/ReportDocumentDataController.java index ca69695..e700905 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/admin/ReportDocumentDataController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/admin/ReportDocumentDataController.java @@ -11,6 +11,7 @@ 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.datapermission.core.annotation.DeptDataPermissionIgnore; import com.zt.plat.framework.excel.core.util.ExcelUtils; import com.zt.plat.module.qms.business.reportdoc.controller.vo.ReportDocumentDataPageReqVO; import com.zt.plat.module.qms.business.reportdoc.controller.vo.ReportDocumentDataRespVO; @@ -44,6 +45,7 @@ import static com.zt.plat.framework.common.pojo.CommonResult.success; @RestController @RequestMapping("/qms/report-document-data") @Validated +@DeptDataPermissionIgnore(enable = "true") @FileUploadController(source = "qms.reportdocumentdata") public class ReportDocumentDataController extends AbstractFileUploadController implements BusinessControllerMarker{ diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/admin/ReportDocumentFileController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/admin/ReportDocumentFileController.java index 2af9795..480e76f 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/admin/ReportDocumentFileController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/admin/ReportDocumentFileController.java @@ -29,6 +29,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -43,6 +45,7 @@ import com.zt.plat.module.qms.business.reportdoc.service.ReportDocumentFileServi @RestController @RequestMapping("/qms/report-document-file") @Validated +@DeptDataPermissionIgnore(enable = "true") @FileUploadController(source = "qms.reportdocumentfile") public class ReportDocumentFileController extends AbstractFileUploadController implements BusinessControllerMarker{ diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/admin/ReportDocumentMainController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/admin/ReportDocumentMainController.java index 3567f68..69949dd 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/admin/ReportDocumentMainController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/admin/ReportDocumentMainController.java @@ -10,6 +10,7 @@ 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.datapermission.core.annotation.DeptDataPermissionIgnore; import com.zt.plat.framework.excel.core.util.ExcelUtils; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigUserSignatureDO; import com.zt.plat.module.qms.business.config.service.ConfigUserSignatureService; @@ -48,6 +49,7 @@ import static com.zt.plat.module.qms.enums.ErrorCodeConstants.REPORT_DOCUMENT_TY @RequestMapping("/qms/report-document-main") @Validated @Slf4j +@DeptDataPermissionIgnore(enable = "true") @FileUploadController(source = "qms.reportdocumentmain") public class ReportDocumentMainController extends AbstractFileUploadController implements BusinessControllerMarker{ diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/admin/ReportDocumentMainCorrelationController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/admin/ReportDocumentMainCorrelationController.java index 1cb690d..25f6229 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/admin/ReportDocumentMainCorrelationController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/admin/ReportDocumentMainCorrelationController.java @@ -23,6 +23,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -37,6 +39,7 @@ import com.zt.plat.module.qms.business.reportdoc.service.ReportDocumentMainCorre @RestController @RequestMapping("/qms/report-document-main-correlation") @Validated +@DeptDataPermissionIgnore(enable = "true") public class ReportDocumentMainCorrelationController implements BusinessControllerMarker { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/admin/ReportDocumentTypeController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/admin/ReportDocumentTypeController.java index bc746bb..e9ee80a 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/admin/ReportDocumentTypeController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/admin/ReportDocumentTypeController.java @@ -7,6 +7,7 @@ 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.datapermission.core.annotation.DeptDataPermissionIgnore; import com.zt.plat.framework.excel.core.util.ExcelUtils; import com.zt.plat.framework.security.core.LoginUser; import com.zt.plat.framework.security.core.util.SecurityFrameworkUtils; @@ -39,6 +40,7 @@ import static com.zt.plat.framework.common.pojo.CommonResult.success; @RestController @RequestMapping("/qms/report-document-type") @Validated +@DeptDataPermissionIgnore(enable = "true") public class ReportDocumentTypeController implements BusinessControllerMarker { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/controller/admin/DataCollectionController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/controller/admin/DataCollectionController.java index f18e778..5d30578 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/controller/admin/DataCollectionController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/controller/admin/DataCollectionController.java @@ -9,6 +9,7 @@ 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.datapermission.core.annotation.DeptDataPermissionIgnore; import com.zt.plat.framework.excel.core.util.ExcelUtils; import com.zt.plat.module.qms.common.data.dal.dataobject.DataCollectionDO; import com.zt.plat.module.qms.common.data.controller.vo.DataCollectionPageReqVO; @@ -36,6 +37,7 @@ import static com.zt.plat.framework.common.pojo.CommonResult.success; @RestController @RequestMapping("/qms/common/data/data-collection") @Validated +@DeptDataPermissionIgnore(enable = "true") @FileUploadController(source = "common.data.datacollection") public class DataCollectionController extends AbstractFileUploadController implements BusinessControllerMarker{ diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/controller/admin/DataCollectionFieldController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/controller/admin/DataCollectionFieldController.java index d2c818e..1f307a5 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/controller/admin/DataCollectionFieldController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/controller/admin/DataCollectionFieldController.java @@ -7,6 +7,7 @@ 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.datapermission.core.annotation.DeptDataPermissionIgnore; import com.zt.plat.framework.excel.core.util.ExcelUtils; import com.zt.plat.module.qms.common.data.dal.dataobject.DataCollectionDO; import com.zt.plat.module.qms.common.data.dal.dataobject.DataCollectionFieldDO; @@ -36,6 +37,7 @@ import static com.zt.plat.framework.common.pojo.CommonResult.success; @RestController @RequestMapping("/qms/common/data/data-collection-field") @Validated +@DeptDataPermissionIgnore(enable = "true") public class DataCollectionFieldController implements BusinessControllerMarker { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/controller/admin/DataFormController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/controller/admin/DataFormController.java index d51f321..067bda8 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/controller/admin/DataFormController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/controller/admin/DataFormController.java @@ -9,6 +9,7 @@ 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.datapermission.core.annotation.DeptDataPermissionIgnore; import com.zt.plat.framework.excel.core.util.ExcelUtils; import com.zt.plat.module.qms.common.data.controller.vo.*; import com.zt.plat.module.qms.common.data.controller.vo.DataFormPageReqVO; @@ -36,6 +37,7 @@ import static com.zt.plat.framework.common.pojo.CommonResult.success; @RestController @RequestMapping("/qms/common/data/data-form") @Validated +@DeptDataPermissionIgnore(enable = "true") @FileUploadController(source = "qms.dataform") public class DataFormController extends AbstractFileUploadController implements BusinessControllerMarker{ diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/controller/admin/DataKeyCheckController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/controller/admin/DataKeyCheckController.java index 08c4284..22f97df 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/controller/admin/DataKeyCheckController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/controller/admin/DataKeyCheckController.java @@ -20,6 +20,8 @@ import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO; 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.module.qms.common.data.service.DataKeyCheckService; @@ -28,6 +30,7 @@ import com.zt.plat.module.qms.common.data.service.DataKeyCheckService; @RestController @RequestMapping("/qms/data-key-check") @Validated +@DeptDataPermissionIgnore(enable = "true") public class DataKeyCheckController implements BusinessControllerMarker { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/controller/admin/DataTemplateController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/controller/admin/DataTemplateController.java index c012b56..c3a5966 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/controller/admin/DataTemplateController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/controller/admin/DataTemplateController.java @@ -25,6 +25,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -40,6 +42,7 @@ import com.zt.plat.module.qms.common.data.service.DataTemplateService; @RestController @RequestMapping("/qms/common/data/data-template") @Validated +@DeptDataPermissionIgnore(enable = "true") public class DataTemplateController implements BusinessControllerMarker { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/dic/controller/admin/DictionaryBusinessController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/dic/controller/admin/DictionaryBusinessController.java index 58ab86c..9e92178 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/dic/controller/admin/DictionaryBusinessController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/dic/controller/admin/DictionaryBusinessController.java @@ -7,6 +7,7 @@ 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.datapermission.core.annotation.DeptDataPermissionIgnore; import com.zt.plat.framework.excel.core.util.ExcelUtils; import com.zt.plat.module.qms.common.dic.controller.vo.DictionaryBusinessPageReqVO; import com.zt.plat.module.qms.common.dic.controller.vo.DictionaryBusinessRespVO; @@ -33,6 +34,7 @@ import static com.zt.plat.framework.common.pojo.CommonResult.success; @RestController @RequestMapping("/qms/dictionary-business") @Validated +@DeptDataPermissionIgnore(enable = "true") public class DictionaryBusinessController implements BusinessControllerMarker { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/core/aspect/annotation/QmsPermission.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/core/aspect/annotation/QmsPermission.java new file mode 100644 index 0000000..be5ca86 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/core/aspect/annotation/QmsPermission.java @@ -0,0 +1,24 @@ +package com.zt.plat.module.qms.core.aspect.annotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Target(ElementType.METHOD) +@Retention(RetentionPolicy.RUNTIME) +public @interface QmsPermission { + + boolean enable() default true; //默认开启 + + //部门数据查看权限 + String deptLeaderRoleCode() default "ytjyDeptAndSub"; + + //模块数据权限-具有此角色可查看本模块所有数据 + String moduleDataRoleCode() default ""; + + String deptColumn() default "DEPT_ID"; + + String userColumn() default "CREATOR"; + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/framework/datapermission/QMSDataPermissionDTO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/framework/datapermission/QMSDataPermissionDTO.java new file mode 100644 index 0000000..3a049c0 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/framework/datapermission/QMSDataPermissionDTO.java @@ -0,0 +1,32 @@ +package com.zt.plat.module.qms.framework.datapermission; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.HashSet; +import java.util.Set; + +@Schema(description = "QMS的数据权限 Response DTO") +@Data +public class QMSDataPermissionDTO { + + @Schema(description = "是否可查看全部数据", requiredMode = Schema.RequiredMode.REQUIRED, example = "true") + private Boolean all; + + @Schema(description = "是否可查看自己的数据", requiredMode = Schema.RequiredMode.REQUIRED, example = "true") + private Boolean self; + + @Schema(description = "可查看的部门编号数组", requiredMode = Schema.RequiredMode.REQUIRED, example = "[1, 3]") + private Set deptIds; + + @Schema(description = "可查看的公司编号数组", requiredMode = Schema.RequiredMode.REQUIRED, example = "[1, 3]") + private Long companyId; + + public QMSDataPermissionDTO() { + this.all = false; + this.self = false; + this.deptIds = new HashSet<>(); + this.companyId = 0L; + } + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/framework/datapermission/QMSMultiDataPermissionHandler.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/framework/datapermission/QMSMultiDataPermissionHandler.java new file mode 100644 index 0000000..6b2c38a --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/framework/datapermission/QMSMultiDataPermissionHandler.java @@ -0,0 +1,219 @@ +//package com.zt.plat.module.qms.framework.datapermission; +// +//import cn.hutool.core.collection.CollUtil; +//import cn.hutool.core.util.ObjectUtil; +//import cn.hutool.core.util.StrUtil; +//import com.baomidou.mybatisplus.extension.plugins.handler.MultiDataPermissionHandler; +//import com.zt.plat.framework.common.biz.system.permission.PermissionCommonApi; +//import com.zt.plat.framework.common.biz.system.permission.dto.DeptDataPermissionRespDTO; +//import com.zt.plat.framework.common.enums.UserTypeEnum; +//import com.zt.plat.framework.common.util.collection.CollectionUtils; +//import com.zt.plat.framework.common.util.json.JsonUtils; +//import com.zt.plat.framework.mybatis.core.util.MyBatisUtils; +//import com.zt.plat.framework.security.core.LoginUser; +//import com.zt.plat.framework.security.core.util.SecurityFrameworkUtils; +//import com.zt.plat.framework.tenant.core.context.DeptContextHolder; +//import com.zt.plat.module.qms.core.aspect.annotation.QmsPermission; +//import lombok.extern.slf4j.Slf4j; +//import net.sf.jsqlparser.expression.Alias; +//import net.sf.jsqlparser.expression.Expression; +//import net.sf.jsqlparser.expression.LongValue; +//import net.sf.jsqlparser.expression.NullValue; +//import net.sf.jsqlparser.expression.operators.conditional.AndExpression; +//import net.sf.jsqlparser.expression.operators.conditional.OrExpression; +//import net.sf.jsqlparser.expression.operators.relational.*; +//import net.sf.jsqlparser.schema.Column; +//import net.sf.jsqlparser.schema.Table; +//import net.sf.jsqlparser.statement.select.ParenthesedSelect; +//import net.sf.jsqlparser.statement.select.PlainSelect; +//import net.sf.jsqlparser.statement.select.SelectItem; +//import org.springframework.beans.factory.annotation.Autowired; +//import org.springframework.stereotype.Component; +// +//import java.lang.reflect.Method; +//import java.util.Map; +//import java.util.Set; +//import java.util.concurrent.ConcurrentHashMap; +// +//import static java.util.Collections.singletonList; +// +// +///* +//* QMS权限处理 +//* 1、只能查看自己创建的数据 +//* 2、部门领导可查看本部门数据 +//* 3、模块管理员可查看本模块数据 +//* +//* */ +//@Component +//@Slf4j +//public class QMSMultiDataPermissionHandler implements MultiDataPermissionHandler { +// +// @Autowired private PermissionCommonApi permissionApi; +// /** +// * LoginUser 的 Context 缓存 Key +// */ +// protected static final String QMS_PERMISSION_CONTEXT_KEY = "QMS_DATA_PERMISSION_KEY"; +// static final Expression EXPRESSION_NULL = new NullValue(); +// public static final String SYSTEM_USERS = "system_users"; +// +// @Override +// public Expression getSqlSegment(Table table, Expression where, String mappedStatementId) { +// log.error("QMSMultiDataPermissionHandler: Expression={}", where); +// +// //获取注解 +// QmsPermission permissionAnnotation = getQmsPermission(mappedStatementId); +// if (permissionAnnotation == null || !permissionAnnotation.enable()) return null; +// +// return buildExpression(permissionAnnotation, table, where); +// } +// +// /* +// * 构建权限sql*/ +// private Expression buildExpression(QmsPermission permissionAnnotation, Table table, Expression where) { +// LoginUser loginUser = SecurityFrameworkUtils.getLoginUser(); +// if (loginUser == null) { +// return null; +// } +// //管理员用户,不进行权限处理 +// if (ObjectUtil.notEqual(loginUser.getUserType(), UserTypeEnum.ADMIN.getValue())) { +// return null; +// } +// String deptCol = permissionAnnotation.deptColumn(); +// String userCol = permissionAnnotation.userColumn(); +// String tableName = MyBatisUtils.getTableName(table); +// Alias tableAlias = table.getAlias(); +// DeptDataPermissionRespDTO qmsDataPermission = loginUser.getContext(QMS_PERMISSION_CONTEXT_KEY, DeptDataPermissionRespDTO.class); +// if(qmsDataPermission == null){ +// qmsDataPermission = permissionApi.getDeptDataPermission(loginUser.getId()).getCheckedData(); +// if (qmsDataPermission == null) { +// log.error("[getExpression][LoginUser({}) 获取数据权限为 null]", JsonUtils.toJsonString(loginUser)); +// throw new NullPointerException(String.format("LoginUser(%d) Table(%s/%s) 未返回数据权限", loginUser.getId(), tableName, tableAlias.getName())); +// } +// // 添加到上下文中,避免重复计算 +// loginUser.setContext(QMS_PERMISSION_CONTEXT_KEY, qmsDataPermission); +// } +// +// // 计算有效的部门与自查标记:当存在上下文部门且未被忽略时,强制仅使用该部门,以避免默认全量或空权限分支 +// Long ctxDeptId = QMSPermissionContextHolder.getDeptId(); +// Set effectiveDeptIds = qmsDataPermission.getDeptIds(); +// Boolean effectiveSelf = qmsDataPermission.getSelf(); +// if (!QMSPermissionContextHolder.shouldIgnore() && ctxDeptId != null && ctxDeptId > 0L) { +// effectiveDeptIds = CollUtil.newHashSet(ctxDeptId); +// } +// +// // 情况一:仅当不存在上下文部门时,且 ALL 可查看全部,才无需拼接条件;若存在上下文部门则仍需基于该部门过滤 +// if (ctxDeptId == null && qmsDataPermission.getAll()) { +// return null; +// } +// +// // 情况二:仅在有效部门集合为空且不可查看自己时,才认为无权限;若上下文提供部门,则跳过该兜底 +// if (CollUtil.isEmpty(effectiveDeptIds) +// && Boolean.FALSE.equals(effectiveSelf)) { +// return new EqualsTo(null, null); // WHERE null = null,可以保证返回的数据为空 +// } +// +// // 情况三,拼接 Dept 和 Company User 的条件,最后组合 +// Expression deptExpression = buildDeptExpression(tableName, tableAlias, effectiveDeptIds); +//// Expression deptExpression = buildDeptExpression(tableName, tableAlias, deptDataPermission.getDeptIds()); +// Expression userExpression = buildUserExpression(tableName, tableAlias, effectiveSelf, loginUser.getId()); +// if (deptExpression == null && userExpression == null) { +// // TODO ZT:获得不到条件的时候,暂时不抛出异常,而是不返回数据 +// log.warn("[getExpression][LoginUser({}) Table({}/{}) DeptDataPermission({}) 构建的条件为空]", +// JsonUtils.toJsonString(loginUser), tableName, tableAlias, JsonUtils.toJsonString(qmsDataPermission)); +//// throw new NullPointerException(String.format("LoginUser(%d) Table(%s/%s) 构建的条件为空", +//// loginUser.getId(), tableName, tableAlias.getName())); +// return EXPRESSION_NULL; +// } +// if (deptExpression == null) { +// return userExpression; +// } +// if (userExpression == null) { +// return deptExpression; +// } +// // 目前,如果有指定部门 + 可查看自己,采用 OR 条件。即,WHERE (dept_id IN ? OR user_id = ?) +// return new ParenthesedExpressionList(new OrExpression(deptExpression, userExpression)); +// +// return null; +// } +// +// private Expression buildDeptExpression(String tableName, Alias tableAlias, Set deptIds) { +// // 如果不存在配置,则无需作为条件 +// String columnName = deptColumns.get(tableName); +// // 特殊处理:system_users 表没有 dept_id 字段,已经迁移到了 user_dept 表 +// if (SYSTEM_USERS.equals(tableName)) { +// // system_users 走 exists 子查询 user_dept +// if (CollUtil.isEmpty(deptIds)) { +// return null; +// } +// // 构造 exists (select 1 from user_dept where user_dept.user_id = system_users.id and user_dept.dept_id in (...)) +// PlainSelect plainSelect = new PlainSelect(); +// plainSelect.setSelectItems(singletonList(new SelectItem<>(new LongValue(1)))); +// Table userDept = new Table(SYSTEM_USER_DEPT); +// // 使用 user 表别名避免语法错误 +// Table user = new Table(tableAlias == null ? tableName : tableAlias.getName()); +// plainSelect.setFromItem(userDept); +// // where user_dept.user_id = system_users.id and user_dept.dept_id in (...) +// Column userDeptUserIdCol = new Column(userDept, USER_COLUMN_NAME); +// Column systemUsersIdCol = new Column(user, "id"); +// EqualsTo userIdEquals = new EqualsTo(userDeptUserIdCol, systemUsersIdCol); +// Column userDeptDeptIdCol = new Column(userDept, DEPT_COLUMN_NAME); +// InExpression deptIn = new InExpression(userDeptDeptIdCol, new ParenthesedExpressionList<>(new ExpressionList<>(CollectionUtils.convertList(deptIds, LongValue::new)))); +// Expression whereExp = new AndExpression(userIdEquals, deptIn); +// plainSelect.setWhere(whereExp); +// // +// ParenthesedSelect parenthesedSelect = new ParenthesedSelect(); +// parenthesedSelect.setSelect(plainSelect); +// // 构建 exists 表达式 +// ExistsExpression existsExpr = new ExistsExpression(); +// existsExpr.setRightExpression(parenthesedSelect); +// return existsExpr; +// } +// if (StrUtil.isEmpty(columnName)) { +// return null; +// } +// // 如果为空,则无条件 +// if (CollUtil.isEmpty(deptIds)) { +// return null; +// } +// // 拼接条件 +// return new InExpression(MyBatisUtils.buildColumn(tableName, tableAlias, columnName), +// // Parenthesis 的目的,是提供 (1,2,3) 的 () 左右括号 +// new ParenthesedExpressionList(new ExpressionList(CollectionUtils.convertList(deptIds, LongValue::new)))); +// } +// +// private Expression buildUserExpression(String tableName, Alias tableAlias, Boolean self, Long userId) { +// // 如果不查看自己,则无需作为条件 +// if (Boolean.FALSE.equals(self)) { +// return null; +// } +// String columnName = userColumns.get(tableName); +// if (StrUtil.isEmpty(columnName)) { +// return null; +// } +// // 拼接条件 +// return new EqualsTo(MyBatisUtils.buildColumn(tableName, tableAlias, columnName), new LongValue(userId)); +// } +// +// private static final Map CACHE = new ConcurrentHashMap<>(); +// +// private QmsPermission getQmsPermission(String mappedStatementId) { +// try { +// int idx = mappedStatementId.lastIndexOf("."); +// String className = mappedStatementId.substring(0, idx); +// String methodName = mappedStatementId.substring(idx + 1); +// +// Class mapperClass = Class.forName(className); +// +// for (Method method : mapperClass.getMethods()) { +// if (method.getName().equals(methodName) && method.isAnnotationPresent(QmsPermission.class)) { +// return method.getAnnotation(QmsPermission.class); +// } +// } +// } catch (Exception e) { +// log.error("解析 QmsPermission 失败: {}", mappedStatementId, e); +// } +// return null; +// } +// +//} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/framework/datapermission/QMSPermissionContextHolder.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/framework/datapermission/QMSPermissionContextHolder.java new file mode 100644 index 0000000..2c5eaeb --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/framework/datapermission/QMSPermissionContextHolder.java @@ -0,0 +1,55 @@ +package com.zt.plat.module.qms.framework.datapermission; + +import com.alibaba.ttl.TransmittableThreadLocal; + +public class QMSPermissionContextHolder { + /** 当前部门编号 */ + private static final ThreadLocal DEPT_ID = new TransmittableThreadLocal<>(); + /** 当前部门所属公司编号(用于一致性校验) */ + private static final ThreadLocal COMPANY_ID = new TransmittableThreadLocal<>(); + /** 是否忽略部门数据权限 */ + private static final ThreadLocal IGNORE = new TransmittableThreadLocal<>(); + + public static Long getDeptId() { + return DEPT_ID.get(); + } + + public static Long getCompanyId() { + return COMPANY_ID.get(); + } + + /** + * 设置部门与所属公司编号。 + */ + public static void setContext(Long deptId, Long companyId) { + DEPT_ID.set(deptId); + COMPANY_ID.set(companyId); + } + + public static void setDeptId(Long deptId) { + DEPT_ID.set(deptId); + } + + public static void setCompanyId(Long companyId) { + COMPANY_ID.set(companyId); + } + + public static boolean hasDeptId() { + Long deptId = DEPT_ID.get(); + return deptId != null && deptId > 0L; + } + + public static void setIgnore(Boolean ignore) { + IGNORE.set(ignore); + } + + public static boolean shouldIgnore() { + return Boolean.TRUE.equals(IGNORE.get()); + } + + public static void clear() { + DEPT_ID.remove(); + COMPANY_ID.remove(); + IGNORE.remove(); + } +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/framework/mybatis/QMSDataPermissionConfig.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/framework/mybatis/QMSDataPermissionConfig.java new file mode 100644 index 0000000..3bf9f88 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/framework/mybatis/QMSDataPermissionConfig.java @@ -0,0 +1,42 @@ +//package com.zt.plat.module.qms.framework.mybatis; +// +// +//import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor; +//import com.baomidou.mybatisplus.extension.plugins.inner.DataPermissionInterceptor; +//import com.baomidou.mybatisplus.extension.plugins.inner.InnerInterceptor; +//import com.zt.plat.module.qms.framework.datapermission.QMSMultiDataPermissionHandler; +//import jakarta.annotation.PostConstruct; +//import org.aspectj.lang.annotation.After; +//import org.springframework.beans.factory.SmartInitializingSingleton; +//import org.springframework.beans.factory.annotation.Autowired; +//import org.springframework.context.annotation.Configuration; +// +//import java.util.List; +// +//@Configuration +//public class QMSDataPermissionConfig implements SmartInitializingSingleton { +// @Autowired +// private MybatisPlusInterceptor mybatisPlusInterceptor; +// +// @Autowired +// private QMSMultiDataPermissionHandler qmsMultiDataPermissionHandler; +// +// @Override +// public void afterSingletonsInstantiated() { +// List interceptors = mybatisPlusInterceptor.getInterceptors(); +// // 避免重复注册 +// boolean exists = interceptors.stream() +// .filter(i -> i instanceof DataPermissionInterceptor) +// .map(i -> (DataPermissionInterceptor) i) +// .anyMatch(i -> i.getDataPermissionHandler() == qmsMultiDataPermissionHandler); +// if (!exists) { +// mybatisPlusInterceptor.addInnerInterceptor(new DataPermissionInterceptor(qmsMultiDataPermissionHandler)); +// } +// } +// +//// @PostConstruct +//// public void addDataPermissionInterceptor() { +//// +//// } +// +//} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/controller/admin/IotConnectManagerStatsController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/controller/admin/IotConnectManagerStatsController.java index 4a52207..52ccd62 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/controller/admin/IotConnectManagerStatsController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/controller/admin/IotConnectManagerStatsController.java @@ -2,6 +2,7 @@ package com.zt.plat.module.qms.iot.controller.admin; import com.alibaba.fastjson.JSONObject; import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; import com.zt.plat.module.qms.iot.service.IotConnectManagerStatsService; import com.zt.plat.module.qms.iot.tcpserver.cluster.TioServerMessageConfig; import com.zt.plat.module.qms.iot.tcpserver.cluster.TioServerMessagePublisher; @@ -48,6 +49,7 @@ import static java.lang.Thread.sleep; @AllArgsConstructor @RequestMapping("/qms/resource/iot/connect-manager-stats") @Tag(name = "iot连接管理-连接统计") +@DeptDataPermissionIgnore(enable = "true") public class IotConnectManagerStatsController { @Autowired private TioServerBootstrap tioServerBootstrap; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/admin/SupplierController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/admin/SupplierController.java index eabfca4..78ddfd4 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/admin/SupplierController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/admin/SupplierController.java @@ -25,6 +25,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -40,6 +42,7 @@ import com.zt.plat.module.qms.office.supplier.service.SupplierService; @RestController @RequestMapping("/qms/supplier") @Validated +@DeptDataPermissionIgnore(enable = "true") @FileUploadController(source = "qms.supplier") public class SupplierController extends AbstractFileUploadController implements BusinessControllerMarker{ diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/admin/SupplierEvaluationAtController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/admin/SupplierEvaluationAtController.java index e1101a0..96d165e 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/admin/SupplierEvaluationAtController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/admin/SupplierEvaluationAtController.java @@ -25,6 +25,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -39,6 +41,7 @@ import com.zt.plat.module.qms.office.supplier.service.SupplierEvaluationAtServic @RestController @RequestMapping("/qms/supplier-evaluation-at") @Validated +@DeptDataPermissionIgnore(enable = "true") @FileUploadController(source = "qms.supplierevaluationat") public class SupplierEvaluationAtController extends AbstractFileUploadController implements BusinessControllerMarker{ diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/admin/SupplierEvaluationController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/admin/SupplierEvaluationController.java index ca11044..8a8a0dc 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/admin/SupplierEvaluationController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/admin/SupplierEvaluationController.java @@ -25,6 +25,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -39,6 +41,7 @@ import com.zt.plat.module.qms.office.supplier.service.SupplierEvaluationService; @RestController @RequestMapping("/qms/supplier-evaluation") @Validated +@DeptDataPermissionIgnore(enable = "true") @FileUploadController(source = "qms.supplierevaluation") public class SupplierEvaluationController extends AbstractFileUploadController implements BusinessControllerMarker{ diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/admin/SupplierPropertiesController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/admin/SupplierPropertiesController.java index 580d087..85be988 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/admin/SupplierPropertiesController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/admin/SupplierPropertiesController.java @@ -25,6 +25,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -39,6 +41,7 @@ import com.zt.plat.module.qms.office.supplier.service.SupplierPropertiesService; @RestController @RequestMapping("/qms/supplier-properties") @Validated +@DeptDataPermissionIgnore(enable = "true") @FileUploadController(source = "qms.supplierproperties") public class SupplierPropertiesController extends AbstractFileUploadController implements BusinessControllerMarker{ diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/clientManage/controller/admin/VersionManagementController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/clientManage/controller/admin/VersionManagementController.java index 010dc76..48b88f4 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/clientManage/controller/admin/VersionManagementController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/clientManage/controller/admin/VersionManagementController.java @@ -25,6 +25,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -40,6 +42,7 @@ import com.zt.plat.module.qms.resource.clientManage.service.VersionManagementSer @RequestMapping("/qms/version-management") @Validated @FileUploadController(source = "qms.versionmanagement") +@DeptDataPermissionIgnore(enable = "true") public class VersionManagementController extends AbstractFileUploadController implements BusinessControllerMarker{ static { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceAffiliationRelativityController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceAffiliationRelativityController.java index 0a49ec6..3f971a9 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceAffiliationRelativityController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceAffiliationRelativityController.java @@ -25,6 +25,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -39,6 +41,7 @@ import com.zt.plat.module.qms.resource.device.service.DeviceAffiliationRelativit @RestController @RequestMapping("/qms/resource/device-affiliation-relativity") @Validated +@DeptDataPermissionIgnore(enable = "true") @FileUploadController(source = "qms.deviceaffiliationrelativity") public class DeviceAffiliationRelativityController extends AbstractFileUploadController implements BusinessControllerMarker{ diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceApplyController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceApplyController.java index 706e9d1..42cbe8b 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceApplyController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceApplyController.java @@ -25,6 +25,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -39,6 +41,7 @@ import com.zt.plat.module.qms.resource.device.service.DeviceApplyService; @RestController @RequestMapping("/qms/resource/device-apply") @Validated +@DeptDataPermissionIgnore(enable = "true") @FileUploadController(source = "qms.deviceapply") public class DeviceApplyController extends AbstractFileUploadController implements BusinessControllerMarker{ @@ -97,7 +100,6 @@ public class DeviceApplyController extends AbstractFileUploadController implemen @GetMapping("/page") @Operation(summary = "获得设备通用流程,验收、降级、停用、报废、还原、启用分页") - @PreAuthorize("@ss.hasPermission('qms:device-apply:query')") public CommonResult> getDeviceApplyPage(@Valid DeviceApplyPageReqVO pageReqVO) { PageResult pageResult = deviceApplyService.getDeviceApplyPage(pageReqVO); return success(BeanUtils.toBean(pageResult, DeviceApplyRespVO.class)); diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceApplyDetailController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceApplyDetailController.java index b8b07f4..62647ce 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceApplyDetailController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceApplyDetailController.java @@ -25,6 +25,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -39,6 +41,7 @@ import com.zt.plat.module.qms.resource.device.service.DeviceApplyDetailService; @RestController @RequestMapping("/qms/resource/device-apply-detail") @Validated +@DeptDataPermissionIgnore(enable = "true") @FileUploadController(source = "qms.deviceapplydetail") public class DeviceApplyDetailController extends AbstractFileUploadController implements BusinessControllerMarker{ diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceCalibrationController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceCalibrationController.java index 54efbea..0b3a7a9 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceCalibrationController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceCalibrationController.java @@ -25,6 +25,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -39,6 +41,7 @@ import com.zt.plat.module.qms.resource.device.service.DeviceCalibrationService; @RestController @RequestMapping("/qms/resource/device-calibration") @Validated +@DeptDataPermissionIgnore(enable = "true") @FileUploadController(source = "qms.devicecalibration") public class DeviceCalibrationController extends AbstractFileUploadController implements BusinessControllerMarker{ diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceCalibrationPlanController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceCalibrationPlanController.java index 428cd95..92b1c36 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceCalibrationPlanController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceCalibrationPlanController.java @@ -25,6 +25,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -39,6 +41,7 @@ import com.zt.plat.module.qms.resource.device.service.DeviceCalibrationPlanServi @RestController @RequestMapping("/qms/resource/device-calibration-plan") @Validated +@DeptDataPermissionIgnore(enable = "true") @FileUploadController(source = "qms.devicecalibrationplan") public class DeviceCalibrationPlanController extends AbstractFileUploadController implements BusinessControllerMarker{ diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceConfigBusinessItemController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceConfigBusinessItemController.java index 2555cf8..76bb751 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceConfigBusinessItemController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceConfigBusinessItemController.java @@ -25,6 +25,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -39,6 +41,7 @@ import com.zt.plat.module.qms.resource.device.service.DeviceConfigBusinessItemSe @RestController @RequestMapping("/qms/resource/device-config-business-item") @Validated +@DeptDataPermissionIgnore(enable = "true") @FileUploadController(source = "qms.deviceconfigbusinessitem") public class DeviceConfigBusinessItemController extends AbstractFileUploadController implements BusinessControllerMarker{ diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceConfigBusinessRuleController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceConfigBusinessRuleController.java index fd2a3b3..f14e3b3 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceConfigBusinessRuleController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceConfigBusinessRuleController.java @@ -27,6 +27,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -41,6 +43,7 @@ import com.zt.plat.module.qms.resource.device.service.DeviceConfigBusinessRuleSe @RestController @RequestMapping("/qms/resource/device-config-business-rule") @Validated +@DeptDataPermissionIgnore(enable = "true") @FileUploadController(source = "qms.deviceconfigbusinessrule") public class DeviceConfigBusinessRuleController extends AbstractFileUploadController implements BusinessControllerMarker{ diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceConfigFlowController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceConfigFlowController.java index cf1bc1f..5d31f7d 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceConfigFlowController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceConfigFlowController.java @@ -23,6 +23,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -37,6 +39,7 @@ import com.zt.plat.module.qms.resource.device.service.DeviceConfigFlowService; @RestController @RequestMapping("/qms/resource/device-config-flow") @Validated +@DeptDataPermissionIgnore(enable = "true") public class DeviceConfigFlowController implements BusinessControllerMarker { @@ -94,7 +97,6 @@ public class DeviceConfigFlowController implements BusinessControllerMarker { @GetMapping("/page") @Operation(summary = "获得设备通用流程配置分页") - @PreAuthorize("@ss.hasPermission('qms:device-config-flow:query')") public CommonResult> getDeviceConfigFlowPage(@Valid DeviceConfigFlowPageReqVO pageReqVO) { PageResult pageResult = deviceConfigFlowService.getDeviceConfigFlowPage(pageReqVO); return success(BeanUtils.toBean(pageResult, DeviceConfigFlowRespVO.class)); diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceInfomationController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceInfomationController.java index 1f27db8..b304d24 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceInfomationController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceInfomationController.java @@ -9,6 +9,7 @@ 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.datapermission.core.annotation.DeptDataPermissionIgnore; import com.zt.plat.framework.excel.core.util.ExcelUtils; import com.zt.plat.module.qms.core.constant.DataTypeConstant; import com.zt.plat.module.qms.resource.device.controller.vo.DeviceInfomationPageReqVO; @@ -38,6 +39,7 @@ import static com.zt.plat.framework.common.pojo.CommonResult.success; @RestController @RequestMapping("/qms/resource/device-infomation") @Validated +@DeptDataPermissionIgnore(enable = "true") @FileUploadController(source = "resource.deviceinfomation") public class DeviceInfomationController extends AbstractFileUploadController implements BusinessControllerMarker{ diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceMaintainController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceMaintainController.java index 98c1651..c4f9c41 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceMaintainController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceMaintainController.java @@ -31,6 +31,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -46,6 +48,7 @@ import com.zt.plat.module.qms.resource.device.service.DeviceMaintainService; @RestController @RequestMapping("/qms/resource/device-maintain") @Validated +@DeptDataPermissionIgnore(enable = "true") @FileUploadController(source = "qms.devicemaintain") public class DeviceMaintainController extends AbstractFileUploadController implements BusinessControllerMarker{ diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceMaintainItemController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceMaintainItemController.java index f66768e..912029b 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceMaintainItemController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceMaintainItemController.java @@ -25,6 +25,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -39,6 +41,7 @@ import com.zt.plat.module.qms.resource.device.service.DeviceMaintainItemService; @RestController @RequestMapping("/qms/resource/device-maintain-item") @Validated +@DeptDataPermissionIgnore(enable = "true") @FileUploadController(source = "qms.devicemaintainitem") public class DeviceMaintainItemController extends AbstractFileUploadController implements BusinessControllerMarker{ diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DevicePeriodCheckController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DevicePeriodCheckController.java index ba78280..156bd4b 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DevicePeriodCheckController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DevicePeriodCheckController.java @@ -25,6 +25,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -39,6 +41,7 @@ import com.zt.plat.module.qms.resource.device.service.DevicePeriodCheckService; @RestController @RequestMapping("/qms/resource/device-period-check") @Validated +@DeptDataPermissionIgnore(enable = "true") @FileUploadController(source = "qms.deviceperiodcheck") public class DevicePeriodCheckController extends AbstractFileUploadController implements BusinessControllerMarker{ diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DevicePeriodCheckPlanController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DevicePeriodCheckPlanController.java index 5200e70..ef635fc 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DevicePeriodCheckPlanController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DevicePeriodCheckPlanController.java @@ -25,6 +25,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -39,6 +41,7 @@ import com.zt.plat.module.qms.resource.device.service.DevicePeriodCheckPlanServi @RestController @RequestMapping("/qms/resource/device-period-check-plan") @Validated +@DeptDataPermissionIgnore(enable = "true") @FileUploadController(source = "qms.deviceperiodcheckplan") public class DevicePeriodCheckPlanController extends AbstractFileUploadController implements BusinessControllerMarker{ diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceProductController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceProductController.java index 1a28046..5571f2b 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceProductController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceProductController.java @@ -1,5 +1,6 @@ package com.zt.plat.module.qms.resource.device.controller.admin; +import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor; import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog; import com.zt.plat.framework.business.annotation.FileUploadController; import com.zt.plat.framework.business.controller.AbstractFileUploadController; @@ -9,6 +10,7 @@ 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.datapermission.core.annotation.DeptDataPermissionIgnore; import com.zt.plat.framework.excel.core.util.ExcelUtils; import com.zt.plat.module.qms.core.constant.DataTypeConstant; import com.zt.plat.module.qms.resource.device.controller.vo.DeviceProductPageReqVO; @@ -23,6 +25,7 @@ import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.annotation.Resource; import jakarta.servlet.http.HttpServletResponse; import jakarta.validation.Valid; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -37,6 +40,7 @@ import static com.zt.plat.framework.common.pojo.CommonResult.success; @RestController @RequestMapping("/qms/resource/device-product") @Validated +//@DeptDataPermissionIgnore(enable = "true") @FileUploadController(source = "resource.deviceproduct") public class DeviceProductController extends AbstractFileUploadController implements BusinessControllerMarker{ @@ -118,9 +122,12 @@ public class DeviceProductController extends AbstractFileUploadController implem return success(BeanUtils.toBean(deviceProduct, DeviceProductRespVO.class)); } + @Autowired + private MybatisPlusInterceptor mybatisPlusInterceptor; + @GetMapping("/page") @Operation(summary = "获得设备-设备大类分页") - @PreAuthorize("@ss.hasPermission('resource:device-product:query')") +// @PreAuthorize("@ss.hasPermission('resource:device-product:query')") public CommonResult> getDeviceProductPage(@Valid DeviceProductPageReqVO pageReqVO) { PageResult pageResult = deviceProductService.getDeviceProductPage(pageReqVO); return success(BeanUtils.toBean(pageResult, DeviceProductRespVO.class)); diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceRepairApplyController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceRepairApplyController.java index b10728f..6b63ed3 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceRepairApplyController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceRepairApplyController.java @@ -25,6 +25,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -39,6 +41,7 @@ import com.zt.plat.module.qms.resource.device.service.DeviceRepairApplyService; @RestController @RequestMapping("/qms/resource/device-repair-apply") @Validated +@DeptDataPermissionIgnore(enable = "true") @FileUploadController(source = "qms.devicerepairapply") public class DeviceRepairApplyController extends AbstractFileUploadController implements BusinessControllerMarker{ diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceRepairDetailController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceRepairDetailController.java index 4bd19f4..2a76d78 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceRepairDetailController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceRepairDetailController.java @@ -25,6 +25,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -39,6 +41,7 @@ import com.zt.plat.module.qms.resource.device.service.DeviceRepairDetailService; @RestController @RequestMapping("/qms/resource/device-repair-detail") @Validated +@DeptDataPermissionIgnore(enable = "true") @FileUploadController(source = "qms.devicerepairdetail") public class DeviceRepairDetailController extends AbstractFileUploadController implements BusinessControllerMarker{ diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceRepairResultDetailController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceRepairResultDetailController.java index 0432fee..e0557bc 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceRepairResultDetailController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceRepairResultDetailController.java @@ -25,6 +25,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -39,6 +41,7 @@ import com.zt.plat.module.qms.resource.device.service.DeviceRepairResultDetailSe @RestController @RequestMapping("/qms/resource/device-repair-result-detail") @Validated +@DeptDataPermissionIgnore(enable = "true") @FileUploadController(source = "qms.devicerepairresultdetail") public class DeviceRepairResultDetailController extends AbstractFileUploadController implements BusinessControllerMarker{ diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceUseRecordController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceUseRecordController.java index f99070d..0bc660b 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceUseRecordController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceUseRecordController.java @@ -29,6 +29,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -44,6 +46,7 @@ import com.zt.plat.module.qms.resource.device.service.DeviceUseRecordService; @RestController @RequestMapping("/qms/resource/device-use-record") @Validated +@DeptDataPermissionIgnore(enable = "true") @FileUploadController(source = "qms.deviceuserecord") public class DeviceUseRecordController extends AbstractFileUploadController implements BusinessControllerMarker{ diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceApplyMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceApplyMapper.java index 5358c25..44a4e49 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceApplyMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceApplyMapper.java @@ -3,6 +3,7 @@ package com.zt.plat.module.qms.resource.device.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.core.aspect.annotation.QmsPermission; import com.zt.plat.module.qms.resource.device.controller.vo.DeviceApplyPageReqVO; import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceApplyDO; import org.apache.ibatis.annotations.Mapper; @@ -15,9 +16,10 @@ import org.apache.ibatis.annotations.Mapper; @Mapper public interface DeviceApplyMapper extends BaseMapperX { + @QmsPermission default PageResult selectPage(DeviceApplyPageReqVO reqVO) { - return selectPage(reqVO, new LambdaQueryWrapperX() - .likeIfPresent(DeviceApplyDO::getBusinessName, reqVO.getBusinessName()) + LambdaQueryWrapperX wrapper = new LambdaQueryWrapperX<>(); + wrapper.likeIfPresent(DeviceApplyDO::getBusinessName, reqVO.getBusinessName()) .likeIfPresent(DeviceApplyDO::getApplyDepartmentName, reqVO.getApplyDepartmentName()) .eqIfPresent(DeviceApplyDO::getApplyDepartment, reqVO.getApplyDepartment()) .likeIfPresent(DeviceApplyDO::getApplyUserName, reqVO.getApplyUserName()) @@ -39,7 +41,9 @@ public interface DeviceApplyMapper extends BaseMapperX { .eqIfPresent(DeviceApplyDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) .eqIfPresent(DeviceApplyDO::getRemark, reqVO.getRemark()) .betweenIfPresent(DeviceApplyDO::getCreateTime, reqVO.getCreateTime()) - .orderByDesc(DeviceApplyDO::getId)); + .orderByDesc(DeviceApplyDO::getId); + return selectPage(reqVO, wrapper); + } } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialBatchAssignController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialBatchAssignController.java index d051f79..fdd87ae 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialBatchAssignController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialBatchAssignController.java @@ -25,6 +25,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import static com.zt.plat.framework.common.pojo.CommonResult.error; @@ -41,6 +43,7 @@ import com.zt.plat.module.qms.resource.material.service.MaterialBatchAssignServi @RestController @RequestMapping("/qms/resource/material-batch-assign") @Validated +@DeptDataPermissionIgnore(enable = "true") @FileUploadController(source = "qms.materialbatchassign") public class MaterialBatchAssignController extends AbstractFileUploadController implements BusinessControllerMarker{ diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialBatchController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialBatchController.java index 3850d84..31566f5 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialBatchController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialBatchController.java @@ -24,6 +24,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -38,6 +40,7 @@ import com.zt.plat.module.qms.resource.material.service.MaterialBatchService; @RestController @RequestMapping("/qms/resource/material-batch") @Validated +@DeptDataPermissionIgnore(enable = "true") @FileUploadController(source = "qms.materialbatch") public class MaterialBatchController extends AbstractFileUploadController implements BusinessControllerMarker{ diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialInfomationController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialInfomationController.java index 39e61b6..e31ec87 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialInfomationController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialInfomationController.java @@ -9,6 +9,7 @@ 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.datapermission.core.annotation.DeptDataPermissionIgnore; import com.zt.plat.framework.excel.core.util.ExcelUtils; import com.zt.plat.module.qms.core.constant.DataTypeConstant; import com.zt.plat.module.qms.resource.material.controller.vo.*; @@ -39,6 +40,7 @@ import static com.zt.plat.framework.common.pojo.CommonResult.success; @RestController @RequestMapping("/qms/resource/material-infomation") @Validated +@DeptDataPermissionIgnore(enable = "true") @FileUploadController(source = "resource.materialinfomation") public class MaterialInfomationController extends AbstractFileUploadController implements BusinessControllerMarker{ diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialInventoryCheckBatchController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialInventoryCheckBatchController.java index 8beffa6..796ad55 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialInventoryCheckBatchController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialInventoryCheckBatchController.java @@ -25,6 +25,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -39,6 +41,7 @@ import com.zt.plat.module.qms.resource.material.service.MaterialInventoryCheckBa @RestController @RequestMapping("/qms/material-inventory-check-batch") @Validated +@DeptDataPermissionIgnore(enable = "true") @FileUploadController(source = "qms.materialinventorycheckbatch") public class MaterialInventoryCheckBatchController extends AbstractFileUploadController implements BusinessControllerMarker{ diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialInventoryCheckController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialInventoryCheckController.java index 0e46412..adc94f0 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialInventoryCheckController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialInventoryCheckController.java @@ -25,6 +25,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -39,6 +41,7 @@ import com.zt.plat.module.qms.resource.material.service.MaterialInventoryCheckSe @RestController @RequestMapping("/qms/resource/material-inventory-check") @Validated +@DeptDataPermissionIgnore(enable = "true") @FileUploadController(source = "qms.materialinventorycheck") public class MaterialInventoryCheckController extends AbstractFileUploadController implements BusinessControllerMarker{ diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialInventoryCheckDetailController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialInventoryCheckDetailController.java index 3de97e2..6fa6591 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialInventoryCheckDetailController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialInventoryCheckDetailController.java @@ -25,6 +25,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -39,6 +41,7 @@ import com.zt.plat.module.qms.resource.material.service.MaterialInventoryCheckDe @RestController @RequestMapping("/qms/material-inventory-check-detail") @Validated +@DeptDataPermissionIgnore(enable = "true") @FileUploadController(source = "qms.materialinventorycheckdetail") public class MaterialInventoryCheckDetailController extends AbstractFileUploadController implements BusinessControllerMarker{ diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialInventoryController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialInventoryController.java index a77892b..e1b020d 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialInventoryController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialInventoryController.java @@ -9,6 +9,7 @@ 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.datapermission.core.annotation.DeptDataPermissionIgnore; import com.zt.plat.framework.excel.core.util.ExcelUtils; import com.zt.plat.module.qms.resource.material.controller.vo.*; import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialInventoryDO; @@ -37,6 +38,7 @@ import static com.zt.plat.framework.common.pojo.CommonResult.success; @RestController @RequestMapping("/qms/resource/material-inventory") @Validated +@DeptDataPermissionIgnore(enable = "true") @FileUploadController(source = "qms.materiainfo") public class MaterialInventoryController extends AbstractFileUploadController implements BusinessControllerMarker { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialInventoryInboundController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialInventoryInboundController.java index c564f06..d7743bb 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialInventoryInboundController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialInventoryInboundController.java @@ -26,6 +26,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -40,6 +42,7 @@ import com.zt.plat.module.qms.resource.material.service.MaterialInventoryInbound @RestController @RequestMapping("/qms/resource/material-inventory-inbound") @Validated +@DeptDataPermissionIgnore(enable = "true") @FileUploadController(source = "qms.materialinventoryinbound") public class MaterialInventoryInboundController extends AbstractFileUploadController implements BusinessControllerMarker{ diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialInventoryInboundDetailController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialInventoryInboundDetailController.java index d110a8a..50bc5c9 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialInventoryInboundDetailController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialInventoryInboundDetailController.java @@ -25,6 +25,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -39,6 +41,7 @@ import com.zt.plat.module.qms.resource.material.service.MaterialInventoryInbound @RestController @RequestMapping("/qms/resource/material-inventory-inbound-detail") @Validated +@DeptDataPermissionIgnore(enable = "true") @FileUploadController(source = "qms.materialinventoryinbounddetail") public class MaterialInventoryInboundDetailController extends AbstractFileUploadController implements BusinessControllerMarker{ diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialInventoryOutboundController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialInventoryOutboundController.java index 4c46325..e83eb54 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialInventoryOutboundController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialInventoryOutboundController.java @@ -25,6 +25,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -39,6 +41,7 @@ import com.zt.plat.module.qms.resource.material.service.MaterialInventoryOutboun @RestController @RequestMapping("/qms/resource/material-inventory-outbound") @Validated +@DeptDataPermissionIgnore(enable = "true") @FileUploadController(source = "qms.materialinventoryoutbound") public class MaterialInventoryOutboundController extends AbstractFileUploadController implements BusinessControllerMarker{ diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialInventoryOutboundDetailController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialInventoryOutboundDetailController.java index eef01d7..a6fa8b6 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialInventoryOutboundDetailController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialInventoryOutboundDetailController.java @@ -25,6 +25,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -39,6 +41,7 @@ import com.zt.plat.module.qms.resource.material.service.MaterialInventoryOutboun @RestController @RequestMapping("/qms/material-inventory-outbound-detail") @Validated +@DeptDataPermissionIgnore(enable = "true") @FileUploadController(source = "qms.materialinventoryoutbounddetail") public class MaterialInventoryOutboundDetailController extends AbstractFileUploadController implements BusinessControllerMarker{ diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialLifecycleController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialLifecycleController.java index 9558127..b5048a4 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialLifecycleController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialLifecycleController.java @@ -25,6 +25,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -39,6 +41,7 @@ import com.zt.plat.module.qms.resource.material.service.MaterialLifecycleService @RestController @RequestMapping("/qms/material-lifecycle") @Validated +@DeptDataPermissionIgnore(enable = "true") @FileUploadController(source = "qms.materiallifecycle") public class MaterialLifecycleController extends AbstractFileUploadController implements BusinessControllerMarker{ diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialLifecycleDetailController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialLifecycleDetailController.java index e9a4e38..bc24cfc 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialLifecycleDetailController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialLifecycleDetailController.java @@ -25,6 +25,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -39,6 +41,7 @@ import com.zt.plat.module.qms.resource.material.service.MaterialLifecycleDetailS @RestController @RequestMapping("/qms/material-lifecycle-detail") @Validated +@DeptDataPermissionIgnore(enable = "true") @FileUploadController(source = "qms.materiallifecycledetail") public class MaterialLifecycleDetailController extends AbstractFileUploadController implements BusinessControllerMarker{ diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialLocationController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialLocationController.java index c0f9fe9..dd6aae5 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialLocationController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialLocationController.java @@ -25,6 +25,8 @@ 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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; + import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; @@ -39,6 +41,7 @@ import com.zt.plat.module.qms.resource.material.service.MaterialLocationService; @RestController @RequestMapping("/qms/material-location") @Validated +@DeptDataPermissionIgnore(enable = "true") @FileUploadController(source = "qms.materiallocation") public class MaterialLocationController extends AbstractFileUploadController implements BusinessControllerMarker{ diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialProductController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialProductController.java index 13bcbab..e5ff66f 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialProductController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialProductController.java @@ -9,6 +9,7 @@ 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.datapermission.core.annotation.DeptDataPermissionIgnore; import com.zt.plat.framework.excel.core.util.ExcelUtils; import com.zt.plat.module.qms.core.constant.DataTypeConstant; import com.zt.plat.module.qms.resource.material.controller.vo.*; @@ -37,6 +38,7 @@ import static com.zt.plat.framework.common.pojo.CommonResult.success; @RestController @RequestMapping("/qms/resource/material-product") @Validated +@DeptDataPermissionIgnore(enable = "true") @FileUploadController(source = "resource.materialproduct") public class MaterialProductController extends AbstractFileUploadController implements BusinessControllerMarker{ diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/thirdpartyapi/controller/admin/AutoIngredientsController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/thirdpartyapi/controller/admin/AutoIngredientsController.java index 904b4c4..7942b55 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/thirdpartyapi/controller/admin/AutoIngredientsController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/thirdpartyapi/controller/admin/AutoIngredientsController.java @@ -10,6 +10,7 @@ import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; import com.zt.plat.module.qms.thirdpartyapi.controller.vo.*; import com.zt.plat.module.qms.thirdpartyapi.service.AutoIngredientsService; @@ -24,6 +25,7 @@ import jakarta.annotation.Resource; @Tag(name = "自动配料(自动火试金)接口") @RestController @RequestMapping("/qms/thirdpartyapi/auto-ingredients") +@DeptDataPermissionIgnore(enable = "true") public class AutoIngredientsController { @Resource diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/thirdpartyapi/controller/admin/XRFDataController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/thirdpartyapi/controller/admin/XRFDataController.java index 9366837..db67095 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/thirdpartyapi/controller/admin/XRFDataController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/thirdpartyapi/controller/admin/XRFDataController.java @@ -10,6 +10,7 @@ import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; import com.zt.plat.module.qms.thirdpartyapi.controller.vo.*; import com.zt.plat.module.qms.thirdpartyapi.service.XRFDataService; @@ -18,6 +19,7 @@ import jakarta.annotation.Resource; @RestController @RequestMapping("/qms/thirdpartyapi/xrf-data") +@DeptDataPermissionIgnore(enable = "true") public class XRFDataController { @Resource From 7e7295cb74b4f6243b2568ea4f33caa17cacadd0 Mon Sep 17 00:00:00 2001 From: FCL Date: Fri, 9 Jan 2026 11:26:52 +0800 Subject: [PATCH 07/11] =?UTF-8?q?feat:qms=E9=98=B6=E6=AE=B5=E6=80=A7?= =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../module/qms/enums/QmsSupplierConstant.java | 10 + .../service/BusinessSubSampleServiceImpl.java | 2 + .../SampleAnalysisAuditServiceImpl.java | 16 +- .../dal/mapper/DictionaryBusinessMapper.java | 15 +- .../DictionaryBusinessServiceImpl.java | 16 +- .../qms/core/aspect/QmsPermissionAspect.java | 78 +++ .../core/aspect/annotation/QmsPermission.java | 11 +- .../QMSMultiDataPermissionHandler.java | 444 +++++++++--------- .../QMSPermissionContextHolder.java | 86 ++-- .../mybatis/QMSDataPermissionConfig.java | 78 +-- .../controller/admin/SupplierController.java | 6 +- .../admin/SupplierEvaluationController.java | 26 +- .../admin/SupplierPropertiesController.java | 10 +- .../vo/SupplierEvaluationPageReqVO.java | 9 + .../vo/SupplierEvaluationRespVO.java | 11 + .../vo/SupplierEvaluationSaveReqVO.java | 4 + .../controller/vo/SupplierExtendRespVO.java | 26 + .../controller/vo/SupplierPageReqVO.java | 6 + .../vo/SupplierPropertiesPageReqVO.java | 3 + .../vo/SupplierPropertiesRespVO.java | 6 + .../vo/SupplierPropertiesSaveReqVO.java | 3 + .../controller/vo/SupplierRespVO.java | 9 +- .../controller/vo/SupplierSaveReqVO.java | 9 + .../supplier/dal/dataobject/SupplierDO.java | 13 + .../dal/dataobject/SupplierEvaluationDO.java | 5 + .../dal/dataobject/SupplierPropertiesDO.java | 5 + .../dal/mapper/SupplierEvaluationMapper.java | 15 +- .../supplier/dal/mapper/SupplierMapper.java | 20 + .../dal/mapper/SupplierPropertiesMapper.java | 10 + .../service/SupplierEvaluationService.java | 8 +- .../SupplierEvaluationServiceImpl.java | 199 +++++++- .../supplier/service/SupplierService.java | 3 +- .../supplier/service/SupplierServiceImpl.java | 5 +- .../admin/VersionManagementController.java | 36 +- .../admin/DeviceProductController.java | 7 +- .../device/dal/mapper/DeviceApplyMapper.java | 1 - .../dal/mapper/DeviceInfomationMapper.java | 2 + .../dal/mapper/DeviceProductMapper.java | 1 - 38 files changed, 865 insertions(+), 349 deletions(-) create mode 100644 zt-module-qms/zt-module-qms-api/src/main/java/com/zt/plat/module/qms/enums/QmsSupplierConstant.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/core/aspect/QmsPermissionAspect.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/vo/SupplierExtendRespVO.java diff --git a/zt-module-qms/zt-module-qms-api/src/main/java/com/zt/plat/module/qms/enums/QmsSupplierConstant.java b/zt-module-qms/zt-module-qms-api/src/main/java/com/zt/plat/module/qms/enums/QmsSupplierConstant.java new file mode 100644 index 0000000..892a7b6 --- /dev/null +++ b/zt-module-qms/zt-module-qms-api/src/main/java/com/zt/plat/module/qms/enums/QmsSupplierConstant.java @@ -0,0 +1,10 @@ +package com.zt.plat.module.qms.enums; + +public interface QmsSupplierConstant { + + String OPERATING_ITEMS_KEY = "operatingItems"; +// 供应商属性资质key + String CERTIFICATION_KEY = "certification"; +// 评价流程key + String EVALUATION_FLOW_KEY= "OFFICE_SUPPLIER_EVALUATION"; +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubSampleServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubSampleServiceImpl.java index 6336b2b..f0d7010 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubSampleServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubSampleServiceImpl.java @@ -321,6 +321,8 @@ public class BusinessSubSampleServiceImpl implements BusinessSubSampleService { * */ BusinessSubSampleExtendRespVO respVO = BeanUtils.toBean(businessSubSampleDO, BusinessSubSampleExtendRespVO.class); respVO.setIsPrint(printFlag); + respVO.setWarehouseName(warehouseDO.getName()); + respVO.setWarehouseLocationCode(locationDO.getCode()); return respVO; } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleAnalysisAuditServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleAnalysisAuditServiceImpl.java index 51a3f51..648e206 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleAnalysisAuditServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleAnalysisAuditServiceImpl.java @@ -861,7 +861,7 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic // 查找匹配的允差区间 private ConfigAssayMethodProjectAssessmentDO findMatchingRule(List rules, BigDecimal value) { if (rules == null || rules.isEmpty()) return null; - + // 特殊处理 level=0 和 level=4 for (ConfigAssayMethodProjectAssessmentDO rule : rules) { if (rule.getAssessmentLevel() == 0) { @@ -869,19 +869,17 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic .filter(r -> r.getAssessmentLevel() == 1) .findFirst() .orElse(rule); -// if (value.compareTo(new BigDecimal(next.getMinimumValue())) >= 0 && value.compareTo(new BigDecimal(next.getMaximumValue())) <= 0) { -// return next; -// } - return next; + if (value.compareTo(new BigDecimal(rule.getMinimumValue())) >= 0 && value.compareTo(new BigDecimal(rule.getMaximumValue())) <= 0) { + return next; + } } else if (rule.getAssessmentLevel() == 4) { ConfigAssayMethodProjectAssessmentDO prev = rules.stream() .filter(r -> r.getAssessmentLevel() == 3) .findFirst() .orElse(rule); -// if (value.compareTo(new BigDecimal(prev.getMinimumValue())) >= 0 && value.compareTo(new BigDecimal(prev.getMaximumValue())) <= 0) { -// return prev; -// } - return prev; + if (value.compareTo(new BigDecimal(rule.getMinimumValue())) >= 0 && value.compareTo(new BigDecimal(rule.getMaximumValue())) <= 0) { + return prev; + } } else { if (value.compareTo(new BigDecimal(rule.getMinimumValue())) >= 0 && value.compareTo(new BigDecimal(rule.getMaximumValue())) <= 0) { return rule; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/dic/dal/mapper/DictionaryBusinessMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/dic/dal/mapper/DictionaryBusinessMapper.java index c5256ac..bac3c9b 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/dic/dal/mapper/DictionaryBusinessMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/dic/dal/mapper/DictionaryBusinessMapper.java @@ -1,6 +1,8 @@ package com.zt.plat.module.qms.common.dic.dal.mapper; +import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; import com.zt.plat.framework.mybatis.core.query.MPJLambdaWrapperX; @@ -21,6 +23,12 @@ import java.util.List; @Mapper public interface DictionaryBusinessMapper extends BaseMapperX { + @DeptDataPermissionIgnore(enable = "true") + default List selectListWithoutPermissionCheck(Wrapper queryWrapper){ + return selectList(queryWrapper); + } + + @DeptDataPermissionIgnore(enable = "true") default PageResult selectPage(DictionaryBusinessPageReqVO reqVO) { return selectPage(reqVO, new LambdaQueryWrapperX() .eqIfPresent(DictionaryBusinessDO::getIdPath, reqVO.getIdPath()) @@ -36,7 +44,8 @@ public interface DictionaryBusinessMapper extends BaseMapperX selectItemByCategoryKeys(List keys) { return selectJoinList(DictionaryBusinessExtendRespVO.class, new MPJLambdaWrapperX() .leftJoin(DictionaryBusinessDO.class, "dbd", DictionaryBusinessDO::getId, DictionaryBusinessDO::getParentId) @@ -56,6 +65,7 @@ public interface DictionaryBusinessMapper extends BaseMapperX queryTableDictCustom(@Param("table") String table, @Param("text") String text, @Param("code") String code, @Param("filterSql") String filterSql, @Param("keys") List keys); @@ -64,7 +74,10 @@ public interface DictionaryBusinessMapper extends BaseMapperX parList = dictionaryBusinessMapper.selectList(query); + List parList = dictionaryBusinessMapper.selectListWithoutPermissionCheck(query); if(parList.isEmpty()) return dictMap; List parIds = parList.stream().map(DictionaryBusinessDO::getId).toList(); @@ -159,7 +159,7 @@ public class DictionaryBusinessServiceImpl implements DictionaryBusinessService query.in(DictionaryBusinessDO::getKey, itemKeys); else query.in(DictionaryBusinessDO::getId, itemKeys); - List itemList = dictionaryBusinessMapper.selectList(query); + List itemList = dictionaryBusinessMapper.selectListWithoutPermissionCheck(query); List modelItemList = new ArrayList<>(); for(DictionaryBusinessDO item: itemList){ Long parId = item.getParentId(); @@ -185,7 +185,7 @@ public class DictionaryBusinessServiceImpl implements DictionaryBusinessService // query.in(DictionaryBusinessDO::getKey, dictCodeList); // query.eq(DictionaryBusinessDO::getNodeType, DataTypeConstant.DATA_TYPE_CATEGORY); //// query.eq(DictionaryBusinessDO::getDeleted, 0); -// List parList = dictionaryBusinessMapper.selectList(query); +// List parList = dictionaryBusinessMapper.selectListWithoutPermissionCheck(query); // if(parList.isEmpty()) // return dictMap; // List parIds = parList.stream().map(DictionaryBusinessDO::getId).toList(); @@ -193,7 +193,7 @@ public class DictionaryBusinessServiceImpl implements DictionaryBusinessService // query.in(DictionaryBusinessDO::getParentId, parIds); // query.eq(DictionaryBusinessDO::getNodeType, DataTypeConstant.DATA_TYPE_DATA); // query.in(DictionaryBusinessDO::getId, ids); -// List itemList = dictionaryBusinessMapper.selectList(query); +// List itemList = dictionaryBusinessMapper.selectListWithoutPermissionCheck(query); // List modelItemList = new ArrayList<>(); // for(DictionaryBusinessDO item: itemList){ // Long parId = item.getParentId(); @@ -216,7 +216,7 @@ public class DictionaryBusinessServiceImpl implements DictionaryBusinessService LambdaQueryWrapper query = new LambdaQueryWrapper<>(); query.eq(DictionaryBusinessDO::getKey, key); query.eq(DictionaryBusinessDO::getNodeType, DataTypeConstant.DATA_TYPE_CATEGORY); - List list = dictionaryBusinessMapper.selectList(query); + List list = dictionaryBusinessMapper.selectListWithoutPermissionCheck(query); if(list.isEmpty()) throw exception(DICTIONARY_BUSINESS_NOT_EXISTS); if(list.size() > 1) @@ -234,7 +234,7 @@ public class DictionaryBusinessServiceImpl implements DictionaryBusinessService LambdaQueryWrapper query = new LambdaQueryWrapper<>(); query.eq(DictionaryBusinessDO::getKey, key); query.eq(DictionaryBusinessDO::getNodeType, DataTypeConstant.DATA_TYPE_DATA); - List list = dictionaryBusinessMapper.selectList(query); + List list = dictionaryBusinessMapper.selectListWithoutPermissionCheck(query); if(list.isEmpty()) return CommonResult.error(DICTIONARY_BUSINESS_NOT_EXISTS); if(list.size() > 1) @@ -325,7 +325,7 @@ public class DictionaryBusinessServiceImpl implements DictionaryBusinessService LambdaQueryWrapper query = new LambdaQueryWrapper<>(); query.eq(DictionaryBusinessDO::getNodeType, DataTypeConstant.DATA_TYPE_CATEGORY); query.orderByAsc(DictionaryBusinessDO::getSortNo); - return dictionaryBusinessMapper.selectList(query); + return dictionaryBusinessMapper.selectListWithoutPermissionCheck(query); } @Override @@ -335,7 +335,7 @@ public class DictionaryBusinessServiceImpl implements DictionaryBusinessService if(!ObjectUtils.isEmpty(nodeType)) query.eq(DictionaryBusinessDO::getNodeType, nodeType); query.orderByAsc(DictionaryBusinessDO::getSortNo); - return dictionaryBusinessMapper.selectList(query); + return dictionaryBusinessMapper.selectListWithoutPermissionCheck(query); } @Override diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/core/aspect/QmsPermissionAspect.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/core/aspect/QmsPermissionAspect.java new file mode 100644 index 0000000..37c1bca --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/core/aspect/QmsPermissionAspect.java @@ -0,0 +1,78 @@ +package com.zt.plat.module.qms.core.aspect; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.alibaba.fastjson.parser.Feature; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.security.core.LoginUser; +import com.zt.plat.module.qms.core.aspect.annotation.Dict; +import com.zt.plat.module.qms.core.aspect.annotation.QmsPermission; +import com.zt.plat.module.qms.core.constant.CommonConstant; +import com.zt.plat.module.qms.core.legend.LegendApi; +import com.zt.plat.module.qms.core.legend.LegendConvertUtils; +import com.zt.plat.module.qms.core.legend.vo.DictModel; +import com.zt.plat.module.qms.framework.datapermission.QMSPermissionContextHolder; +import lombok.extern.slf4j.Slf4j; +import org.aspectj.lang.JoinPoint; +import org.aspectj.lang.ProceedingJoinPoint; +import org.aspectj.lang.Signature; +import org.aspectj.lang.annotation.Around; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Before; +import org.aspectj.lang.annotation.Pointcut; +import org.aspectj.lang.reflect.MethodSignature; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Lazy; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.stereotype.Component; +import org.springframework.util.StringUtils; + +import java.lang.reflect.Field; +import java.lang.reflect.Method; +import java.util.*; +import java.util.concurrent.TimeUnit; +import java.util.stream.Collectors; + +import static com.zt.plat.framework.security.core.util.SecurityFrameworkUtils.getLoginUser; +import static com.zt.plat.module.qms.core.constant.CacheConstant.QMS_DICT_BIZ_CACHE; +import static com.zt.plat.module.qms.core.constant.CacheConstant.QMS_DICT_TABLE_CACHE; +import static com.zt.plat.module.qms.core.constant.DataTypeConstant.DICT_ANNOTATION_SPLIT; + +@Aspect +@Component +@Slf4j +public class QmsPermissionAspect { + /** + * 定义切点Pointcut + */ + @Pointcut("@annotation(com.zt.plat.module.qms.core.aspect.annotation.QmsPermission)") + public void executeService() { + } + + @Before("executeService()") + public void doBefore(JoinPoint point) throws Throwable { + handleDataScope(point); + } + + private void handleDataScope(JoinPoint joinPoint){ + QmsPermission annotation = getAnnotationByJoinPoint(joinPoint); + if(annotation == null) + return; + QMSPermissionContextHolder.setContext(true, annotation.deptDataRoleCodes(), annotation.moduleDataRoleCodes(), annotation.deptIdColumn(), annotation.userIdColumn(), annotation.custom()); + } + + private QmsPermission getAnnotationByJoinPoint(JoinPoint joinPoint) { + Signature signature = joinPoint.getSignature(); + MethodSignature methodSignature = (MethodSignature) signature; + Method method = methodSignature.getMethod(); + + if (method != null) { + return method.getAnnotation(QmsPermission.class); + } + return null; + } + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/core/aspect/annotation/QmsPermission.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/core/aspect/annotation/QmsPermission.java index be5ca86..29379bc 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/core/aspect/annotation/QmsPermission.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/core/aspect/annotation/QmsPermission.java @@ -12,13 +12,16 @@ public @interface QmsPermission { boolean enable() default true; //默认开启 //部门数据查看权限 - String deptLeaderRoleCode() default "ytjyDeptAndSub"; + String deptDataRoleCodes() default ""; //指定部门数据查看角色,多值半角逗号分隔 //模块数据权限-具有此角色可查看本模块所有数据 - String moduleDataRoleCode() default ""; + String moduleDataRoleCodes() default "ytjyAdmin"; //指定所有数据查看角色,多值半角逗号分隔 - String deptColumn() default "DEPT_ID"; + String deptIdColumn() default "DEPT_ID"; //部门id列 - String userColumn() default "CREATOR"; + String userIdColumn() default "CREATOR"; //人员id列 + + //todo 考虑支持模块自定义扩展。参数传入表达式,通过表达式计算权限 + String custom() default ""; } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/framework/datapermission/QMSMultiDataPermissionHandler.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/framework/datapermission/QMSMultiDataPermissionHandler.java index 6b2c38a..2ba0b9b 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/framework/datapermission/QMSMultiDataPermissionHandler.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/framework/datapermission/QMSMultiDataPermissionHandler.java @@ -1,219 +1,227 @@ -//package com.zt.plat.module.qms.framework.datapermission; -// -//import cn.hutool.core.collection.CollUtil; -//import cn.hutool.core.util.ObjectUtil; -//import cn.hutool.core.util.StrUtil; -//import com.baomidou.mybatisplus.extension.plugins.handler.MultiDataPermissionHandler; -//import com.zt.plat.framework.common.biz.system.permission.PermissionCommonApi; -//import com.zt.plat.framework.common.biz.system.permission.dto.DeptDataPermissionRespDTO; -//import com.zt.plat.framework.common.enums.UserTypeEnum; -//import com.zt.plat.framework.common.util.collection.CollectionUtils; -//import com.zt.plat.framework.common.util.json.JsonUtils; -//import com.zt.plat.framework.mybatis.core.util.MyBatisUtils; -//import com.zt.plat.framework.security.core.LoginUser; -//import com.zt.plat.framework.security.core.util.SecurityFrameworkUtils; -//import com.zt.plat.framework.tenant.core.context.DeptContextHolder; +package com.zt.plat.module.qms.framework.datapermission; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.extension.plugins.handler.MultiDataPermissionHandler; +import com.zt.plat.framework.common.biz.system.permission.PermissionCommonApi; +import com.zt.plat.framework.common.biz.system.permission.dto.DeptDataPermissionRespDTO; +import com.zt.plat.framework.common.enums.UserTypeEnum; +import com.zt.plat.framework.common.util.collection.CollectionUtils; +import com.zt.plat.framework.common.util.json.JsonUtils; +import com.zt.plat.framework.mybatis.core.util.MyBatisUtils; +import com.zt.plat.framework.security.core.LoginUser; +import com.zt.plat.framework.security.core.util.SecurityFrameworkUtils; //import com.zt.plat.module.qms.core.aspect.annotation.QmsPermission; -//import lombok.extern.slf4j.Slf4j; -//import net.sf.jsqlparser.expression.Alias; -//import net.sf.jsqlparser.expression.Expression; -//import net.sf.jsqlparser.expression.LongValue; -//import net.sf.jsqlparser.expression.NullValue; -//import net.sf.jsqlparser.expression.operators.conditional.AndExpression; -//import net.sf.jsqlparser.expression.operators.conditional.OrExpression; -//import net.sf.jsqlparser.expression.operators.relational.*; -//import net.sf.jsqlparser.schema.Column; -//import net.sf.jsqlparser.schema.Table; -//import net.sf.jsqlparser.statement.select.ParenthesedSelect; -//import net.sf.jsqlparser.statement.select.PlainSelect; -//import net.sf.jsqlparser.statement.select.SelectItem; -//import org.springframework.beans.factory.annotation.Autowired; -//import org.springframework.stereotype.Component; -// -//import java.lang.reflect.Method; -//import java.util.Map; -//import java.util.Set; -//import java.util.concurrent.ConcurrentHashMap; -// -//import static java.util.Collections.singletonList; -// -// -///* -//* QMS权限处理 -//* 1、只能查看自己创建的数据 -//* 2、部门领导可查看本部门数据 -//* 3、模块管理员可查看本模块数据 -//* -//* */ -//@Component -//@Slf4j -//public class QMSMultiDataPermissionHandler implements MultiDataPermissionHandler { -// -// @Autowired private PermissionCommonApi permissionApi; -// /** -// * LoginUser 的 Context 缓存 Key -// */ -// protected static final String QMS_PERMISSION_CONTEXT_KEY = "QMS_DATA_PERMISSION_KEY"; -// static final Expression EXPRESSION_NULL = new NullValue(); -// public static final String SYSTEM_USERS = "system_users"; -// -// @Override -// public Expression getSqlSegment(Table table, Expression where, String mappedStatementId) { -// log.error("QMSMultiDataPermissionHandler: Expression={}", where); -// -// //获取注解 -// QmsPermission permissionAnnotation = getQmsPermission(mappedStatementId); -// if (permissionAnnotation == null || !permissionAnnotation.enable()) return null; -// -// return buildExpression(permissionAnnotation, table, where); -// } -// -// /* -// * 构建权限sql*/ -// private Expression buildExpression(QmsPermission permissionAnnotation, Table table, Expression where) { -// LoginUser loginUser = SecurityFrameworkUtils.getLoginUser(); -// if (loginUser == null) { -// return null; -// } -// //管理员用户,不进行权限处理 -// if (ObjectUtil.notEqual(loginUser.getUserType(), UserTypeEnum.ADMIN.getValue())) { -// return null; -// } -// String deptCol = permissionAnnotation.deptColumn(); -// String userCol = permissionAnnotation.userColumn(); -// String tableName = MyBatisUtils.getTableName(table); -// Alias tableAlias = table.getAlias(); -// DeptDataPermissionRespDTO qmsDataPermission = loginUser.getContext(QMS_PERMISSION_CONTEXT_KEY, DeptDataPermissionRespDTO.class); -// if(qmsDataPermission == null){ -// qmsDataPermission = permissionApi.getDeptDataPermission(loginUser.getId()).getCheckedData(); -// if (qmsDataPermission == null) { -// log.error("[getExpression][LoginUser({}) 获取数据权限为 null]", JsonUtils.toJsonString(loginUser)); -// throw new NullPointerException(String.format("LoginUser(%d) Table(%s/%s) 未返回数据权限", loginUser.getId(), tableName, tableAlias.getName())); -// } -// // 添加到上下文中,避免重复计算 -// loginUser.setContext(QMS_PERMISSION_CONTEXT_KEY, qmsDataPermission); -// } -// -// // 计算有效的部门与自查标记:当存在上下文部门且未被忽略时,强制仅使用该部门,以避免默认全量或空权限分支 -// Long ctxDeptId = QMSPermissionContextHolder.getDeptId(); -// Set effectiveDeptIds = qmsDataPermission.getDeptIds(); -// Boolean effectiveSelf = qmsDataPermission.getSelf(); -// if (!QMSPermissionContextHolder.shouldIgnore() && ctxDeptId != null && ctxDeptId > 0L) { -// effectiveDeptIds = CollUtil.newHashSet(ctxDeptId); -// } -// -// // 情况一:仅当不存在上下文部门时,且 ALL 可查看全部,才无需拼接条件;若存在上下文部门则仍需基于该部门过滤 -// if (ctxDeptId == null && qmsDataPermission.getAll()) { -// return null; -// } -// -// // 情况二:仅在有效部门集合为空且不可查看自己时,才认为无权限;若上下文提供部门,则跳过该兜底 -// if (CollUtil.isEmpty(effectiveDeptIds) -// && Boolean.FALSE.equals(effectiveSelf)) { -// return new EqualsTo(null, null); // WHERE null = null,可以保证返回的数据为空 -// } -// -// // 情况三,拼接 Dept 和 Company User 的条件,最后组合 -// Expression deptExpression = buildDeptExpression(tableName, tableAlias, effectiveDeptIds); -//// Expression deptExpression = buildDeptExpression(tableName, tableAlias, deptDataPermission.getDeptIds()); -// Expression userExpression = buildUserExpression(tableName, tableAlias, effectiveSelf, loginUser.getId()); -// if (deptExpression == null && userExpression == null) { -// // TODO ZT:获得不到条件的时候,暂时不抛出异常,而是不返回数据 -// log.warn("[getExpression][LoginUser({}) Table({}/{}) DeptDataPermission({}) 构建的条件为空]", -// JsonUtils.toJsonString(loginUser), tableName, tableAlias, JsonUtils.toJsonString(qmsDataPermission)); -//// throw new NullPointerException(String.format("LoginUser(%d) Table(%s/%s) 构建的条件为空", -//// loginUser.getId(), tableName, tableAlias.getName())); -// return EXPRESSION_NULL; -// } -// if (deptExpression == null) { -// return userExpression; -// } -// if (userExpression == null) { -// return deptExpression; -// } -// // 目前,如果有指定部门 + 可查看自己,采用 OR 条件。即,WHERE (dept_id IN ? OR user_id = ?) -// return new ParenthesedExpressionList(new OrExpression(deptExpression, userExpression)); -// -// return null; -// } -// -// private Expression buildDeptExpression(String tableName, Alias tableAlias, Set deptIds) { -// // 如果不存在配置,则无需作为条件 -// String columnName = deptColumns.get(tableName); -// // 特殊处理:system_users 表没有 dept_id 字段,已经迁移到了 user_dept 表 -// if (SYSTEM_USERS.equals(tableName)) { -// // system_users 走 exists 子查询 user_dept -// if (CollUtil.isEmpty(deptIds)) { -// return null; -// } -// // 构造 exists (select 1 from user_dept where user_dept.user_id = system_users.id and user_dept.dept_id in (...)) -// PlainSelect plainSelect = new PlainSelect(); -// plainSelect.setSelectItems(singletonList(new SelectItem<>(new LongValue(1)))); -// Table userDept = new Table(SYSTEM_USER_DEPT); -// // 使用 user 表别名避免语法错误 -// Table user = new Table(tableAlias == null ? tableName : tableAlias.getName()); -// plainSelect.setFromItem(userDept); -// // where user_dept.user_id = system_users.id and user_dept.dept_id in (...) -// Column userDeptUserIdCol = new Column(userDept, USER_COLUMN_NAME); -// Column systemUsersIdCol = new Column(user, "id"); -// EqualsTo userIdEquals = new EqualsTo(userDeptUserIdCol, systemUsersIdCol); -// Column userDeptDeptIdCol = new Column(userDept, DEPT_COLUMN_NAME); -// InExpression deptIn = new InExpression(userDeptDeptIdCol, new ParenthesedExpressionList<>(new ExpressionList<>(CollectionUtils.convertList(deptIds, LongValue::new)))); -// Expression whereExp = new AndExpression(userIdEquals, deptIn); -// plainSelect.setWhere(whereExp); -// // -// ParenthesedSelect parenthesedSelect = new ParenthesedSelect(); -// parenthesedSelect.setSelect(plainSelect); -// // 构建 exists 表达式 -// ExistsExpression existsExpr = new ExistsExpression(); -// existsExpr.setRightExpression(parenthesedSelect); -// return existsExpr; -// } -// if (StrUtil.isEmpty(columnName)) { -// return null; -// } -// // 如果为空,则无条件 -// if (CollUtil.isEmpty(deptIds)) { -// return null; -// } -// // 拼接条件 -// return new InExpression(MyBatisUtils.buildColumn(tableName, tableAlias, columnName), -// // Parenthesis 的目的,是提供 (1,2,3) 的 () 左右括号 -// new ParenthesedExpressionList(new ExpressionList(CollectionUtils.convertList(deptIds, LongValue::new)))); -// } -// -// private Expression buildUserExpression(String tableName, Alias tableAlias, Boolean self, Long userId) { -// // 如果不查看自己,则无需作为条件 -// if (Boolean.FALSE.equals(self)) { -// return null; -// } -// String columnName = userColumns.get(tableName); -// if (StrUtil.isEmpty(columnName)) { -// return null; -// } -// // 拼接条件 -// return new EqualsTo(MyBatisUtils.buildColumn(tableName, tableAlias, columnName), new LongValue(userId)); -// } -// -// private static final Map CACHE = new ConcurrentHashMap<>(); -// -// private QmsPermission getQmsPermission(String mappedStatementId) { -// try { -// int idx = mappedStatementId.lastIndexOf("."); -// String className = mappedStatementId.substring(0, idx); -// String methodName = mappedStatementId.substring(idx + 1); -// -// Class mapperClass = Class.forName(className); -// -// for (Method method : mapperClass.getMethods()) { -// if (method.getName().equals(methodName) && method.isAnnotationPresent(QmsPermission.class)) { -// return method.getAnnotation(QmsPermission.class); -// } -// } -// } catch (Exception e) { -// log.error("解析 QmsPermission 失败: {}", mappedStatementId, e); -// } -// return null; -// } -// -//} +import com.zt.plat.framework.tenant.core.context.DeptContextHolder; +import lombok.extern.slf4j.Slf4j; +import net.sf.jsqlparser.expression.Alias; +import net.sf.jsqlparser.expression.Expression; +import net.sf.jsqlparser.expression.LongValue; +import net.sf.jsqlparser.expression.NullValue; +import net.sf.jsqlparser.expression.operators.conditional.AndExpression; +import net.sf.jsqlparser.expression.operators.conditional.OrExpression; +import net.sf.jsqlparser.expression.operators.relational.*; +import net.sf.jsqlparser.schema.Column; +import net.sf.jsqlparser.schema.Table; +import net.sf.jsqlparser.statement.select.ParenthesedSelect; +import net.sf.jsqlparser.statement.select.PlainSelect; +import net.sf.jsqlparser.statement.select.SelectItem; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Set; + +import static java.util.Collections.singletonList; + + +/* +* QMS权限处理 +* 1、只能查看自己创建的数据 +* 2、部门领导可查看本部门数据 +* 3、模块管理员可查看本模块数据 +* +* */ +@Component +@Slf4j +public class QMSMultiDataPermissionHandler implements MultiDataPermissionHandler { + + @Autowired private PermissionCommonApi permissionApi; + /** + * LoginUser 的 Context 缓存 Key + */ + protected static final String QMS_PERMISSION_CONTEXT_KEY = "QMS_DATA_PERMISSION"; + static final Expression EXPRESSION_NULL = new NullValue(); + public static final String SYSTEM_USERS = "system_users"; + private static final String SYSTEM_USER_DEPT = "system_user_dept"; + private static final String DEPT_COLUMN_NAME = "dept_id"; + private static final String USER_COLUMN_NAME = "user_id"; + + @Override + public Expression getSqlSegment(Table table, Expression where, String mappedStatementId) { + log.error("QMSMultiDataPermissionHandler: Expression={}", where); + + //获取注解 + if(!QMSPermissionContextHolder.shouldExecute()) + return null; + try{ + Expression expression = buildExpression(table, where); + return expression; + }catch (Exception e){ + log.error("QMSMultiDataPermissionHandler: Expression={}", where); + }finally { + QMSPermissionContextHolder.clear(); + } + return EXPRESSION_NULL; + } + + /* + * 构建权限sql*/ + private Expression buildExpression(Table table, Expression where) { + LoginUser loginUser = SecurityFrameworkUtils.getLoginUser(); + if (loginUser == null) { + return EXPRESSION_NULL; + } + //管理员用户,不进行权限处理 + if (ObjectUtil.notEqual(loginUser.getUserType(), UserTypeEnum.ADMIN.getValue())) { + return null; + } + String deptIdCol = QMSPermissionContextHolder.getDeptIdColumn(); //部门id列 + String userIdCol = QMSPermissionContextHolder.getUserIdColumn(); //人员id列 + String deptDataRoleCodes = QMSPermissionContextHolder.getDeptDataRoleCode(); //部门数据权限角色。具有该角色,然后按角色的权限属性判断。从而获得人员允许查看的部门数据 + String moduleDataRoleCodes = QMSPermissionContextHolder.getModuleDataRoleCodes(); //模块数据权限角色。 + String custom = QMSPermissionContextHolder.getCustom(); //todo 自定义权限 + + List allRoleCode = new ArrayList<>(); + if(!ObjectUtil.isEmpty(deptDataRoleCodes)){ + allRoleCode.addAll(Arrays.asList(deptDataRoleCodes.split( ","))); + } + if(!ObjectUtil.isEmpty(moduleDataRoleCodes)){ + allRoleCode.addAll(Arrays.asList(moduleDataRoleCodes.split( ","))); + } + //查询角色 + + String tableName = MyBatisUtils.getTableName(table); + Alias tableAlias = table.getAlias(); + DeptDataPermissionRespDTO qmsDataPermission = loginUser.getContext(QMS_PERMISSION_CONTEXT_KEY, DeptDataPermissionRespDTO.class); + if(qmsDataPermission == null){ + try{ +// DeptContextHolder.setRoleCodeList(allRoleCode); + qmsDataPermission = permissionApi.getDeptDataPermission(loginUser.getId()).getCheckedData(); + }catch (Exception e){ + log.error("[getExpression][LoginUser({}) 获取角色权限为 null]", JsonUtils.toJsonString(loginUser)); + log.error("", e); + }finally { +// DeptContextHolder.clearRoleCodeList(); + } + + if (qmsDataPermission == null) { + log.error("[getExpression][LoginUser({}) 获取数据权限为 null]", JsonUtils.toJsonString(loginUser)); + throw new NullPointerException(String.format("LoginUser(%d) Table(%s/%s) 未返回数据权限", loginUser.getId(), tableName, tableAlias.getName())); + } + // 添加到上下文中,避免重复计算 + loginUser.setContext(QMS_PERMISSION_CONTEXT_KEY, qmsDataPermission); + } + Long ctxDeptId = DeptContextHolder.getDeptId(); + // 计算有效的部门与自查标记:当存在上下文部门且未被忽略时,强制仅使用该部门,以避免默认全量或空权限分支 + Set effectiveDeptIds = qmsDataPermission.getDeptIds(); + Boolean effectiveSelf = qmsDataPermission.getSelf(); + if (!DeptContextHolder.shouldIgnore() && ctxDeptId != null && ctxDeptId > 0L) { + effectiveDeptIds = CollUtil.newHashSet(ctxDeptId); + } + // 情况一:仅当不存在上下文部门时,且 ALL 可查看全部,才无需拼接条件;若存在上下文部门则仍需基于该部门过滤 + if (ctxDeptId == null && qmsDataPermission.getAll()) { + return null; + } + + // 情况二:仅在有效部门集合为空且不可查看自己时,才认为无权限;若上下文提供部门,则跳过该兜底 + if (CollUtil.isEmpty(effectiveDeptIds) && Boolean.FALSE.equals(effectiveSelf)) { + return new EqualsTo(null, null); // WHERE null = null,可以保证返回的数据为空 + } + + // 情况三,拼接 Dept 和 Company User 的条件,最后组合 + Expression deptExpression = buildDeptExpression(tableName, deptIdCol, tableAlias, effectiveDeptIds); + Expression userExpression = buildUserExpression(tableName, userIdCol, tableAlias, effectiveSelf, loginUser.getId()); + if (deptExpression == null && userExpression == null) { + // TODO:获得不到条件的时候,暂时不抛出异常,而是不返回数据 + log.warn("[getExpression][LoginUser({}) Table({}/{}) DeptDataPermission({}) 构建的条件为空]", + JsonUtils.toJsonString(loginUser), tableName, tableAlias, JsonUtils.toJsonString(qmsDataPermission)); +// throw new NullPointerException(String.format("LoginUser(%d) Table(%s/%s) 构建的条件为空", +// loginUser.getId(), tableName, tableAlias.getName())); + return null; + } + if (deptExpression == null) { + return userExpression; + } + if (userExpression == null) { + return deptExpression; + } + // 目前,如果有指定部门 + 可查看自己,采用 OR 条件。即,WHERE (dept_id IN ? OR user_id = ?) + return new ParenthesedExpressionList(new OrExpression(deptExpression, userExpression)); + } + + private Expression buildDeptExpression(String tableName, String columnName, Alias tableAlias, Set deptIds) { + // 特殊处理:system_users 表没有 dept_id 字段,已经迁移到了 user_dept 表 + if (SYSTEM_USERS.equals(tableName)) { + // system_users 走 exists 子查询 user_dept + if (CollUtil.isEmpty(deptIds)) { + return null; + } + // 构造 exists (select 1 from user_dept where user_dept.user_id = system_users.id and user_dept.dept_id in (...)) + PlainSelect plainSelect = new PlainSelect(); + plainSelect.setSelectItems(singletonList(new SelectItem<>(new LongValue(1)))); + Table userDept = new Table(SYSTEM_USER_DEPT); + // 使用 user 表别名避免语法错误 + Table user = new Table(tableAlias == null ? tableName : tableAlias.getName()); + plainSelect.setFromItem(userDept); + // where user_dept.user_id = system_users.id and user_dept.dept_id in (...) + Column userDeptUserIdCol = new Column(userDept, USER_COLUMN_NAME); + Column systemUsersIdCol = new Column(user, "id"); + EqualsTo userIdEquals = new EqualsTo(userDeptUserIdCol, systemUsersIdCol); + Column userDeptDeptIdCol = new Column(userDept, DEPT_COLUMN_NAME); + InExpression deptIn = new InExpression(userDeptDeptIdCol, new ParenthesedExpressionList<>(new ExpressionList<>(CollectionUtils.convertList(deptIds, LongValue::new)))); + Expression whereExp = new AndExpression(userIdEquals, deptIn); + plainSelect.setWhere(whereExp); + // + ParenthesedSelect parenthesedSelect = new ParenthesedSelect(); + parenthesedSelect.setSelect(plainSelect); + // 构建 exists 表达式 + ExistsExpression existsExpr = new ExistsExpression(); + existsExpr.setRightExpression(parenthesedSelect); + return existsExpr; + } + if (StrUtil.isEmpty(columnName)) { + return null; + } + // 如果为空,则无条件 + if (CollUtil.isEmpty(deptIds)) { + return null; + } + // 拼接条件 + return new InExpression(MyBatisUtils.buildColumn(tableName, tableAlias, columnName), + // Parenthesis 的目的,是提供 (1,2,3) 的 () 左右括号 + new ParenthesedExpressionList(new ExpressionList(CollectionUtils.convertList(deptIds, LongValue::new)))); + } + + private Expression buildUserExpression(String tableName, String columnName, Alias tableAlias, Boolean self, Long userId) { + // 如果不查看自己,则无需作为条件 + if (Boolean.FALSE.equals(self)) { + return null; + } + if (StrUtil.isEmpty(columnName)) { + return null; + } + // 拼接条件 + return new EqualsTo(MyBatisUtils.buildColumn(tableName, tableAlias, columnName), new LongValue(userId)); + } + + /* + * */ + private DeptDataPermissionRespDTO getQmsDataPermission(){ + return null; + } + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/framework/datapermission/QMSPermissionContextHolder.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/framework/datapermission/QMSPermissionContextHolder.java index 2c5eaeb..192bae8 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/framework/datapermission/QMSPermissionContextHolder.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/framework/datapermission/QMSPermissionContextHolder.java @@ -2,54 +2,80 @@ package com.zt.plat.module.qms.framework.datapermission; import com.alibaba.ttl.TransmittableThreadLocal; + public class QMSPermissionContextHolder { - /** 当前部门编号 */ - private static final ThreadLocal DEPT_ID = new TransmittableThreadLocal<>(); - /** 当前部门所属公司编号(用于一致性校验) */ - private static final ThreadLocal COMPANY_ID = new TransmittableThreadLocal<>(); - /** 是否忽略部门数据权限 */ - private static final ThreadLocal IGNORE = new TransmittableThreadLocal<>(); + // 是否启用 + private static final ThreadLocal enable = new TransmittableThreadLocal<>(); - public static Long getDeptId() { - return DEPT_ID.get(); + private static final ThreadLocal deptDataRoleCodes = new TransmittableThreadLocal<>(); //部门数据查看权限 + private static final ThreadLocal moduleDataRoleCodes = new TransmittableThreadLocal<>(); //模块数据权限 + private static final ThreadLocal deptIdColumn = new TransmittableThreadLocal<>(); //部门id列 + private static final ThreadLocal userIdColumn = new TransmittableThreadLocal<>(); //人员id列 + private static final ThreadLocal custom = new TransmittableThreadLocal<>(); //人员id列 + + public static void setEnable(Boolean ignore) { + enable.set(ignore); } - public static Long getCompanyId() { - return COMPANY_ID.get(); + public static boolean shouldExecute() { + return Boolean.TRUE.equals(enable.get()); } - /** - * 设置部门与所属公司编号。 - */ - public static void setContext(Long deptId, Long companyId) { - DEPT_ID.set(deptId); - COMPANY_ID.set(companyId); + public static void setContext(boolean enable, String deptDataRoleCode, String moduleDataRoleCode, String deptIdColumn, String userIdColumn, String custom){ + QMSPermissionContextHolder.setEnable(enable); + QMSPermissionContextHolder.deptDataRoleCodes.set(deptDataRoleCode); + QMSPermissionContextHolder.moduleDataRoleCodes.set(moduleDataRoleCode); + QMSPermissionContextHolder.deptIdColumn.set(deptIdColumn); + QMSPermissionContextHolder.userIdColumn.set(userIdColumn); + QMSPermissionContextHolder.custom.set(custom); } - public static void setDeptId(Long deptId) { - DEPT_ID.set(deptId); + public static void setDeptDataRoleCode(String deptDataRoleCode) { + QMSPermissionContextHolder.deptDataRoleCodes.set(deptDataRoleCode); + } + public static String getDeptDataRoleCode() { + return deptDataRoleCodes.get(); } - public static void setCompanyId(Long companyId) { - COMPANY_ID.set(companyId); + public static void setModuleDataRoleCodes(String moduleDataRoleCodes) { + QMSPermissionContextHolder.moduleDataRoleCodes.set(moduleDataRoleCodes); + } + public static String getModuleDataRoleCodes() { + return moduleDataRoleCodes.get(); } - public static boolean hasDeptId() { - Long deptId = DEPT_ID.get(); - return deptId != null && deptId > 0L; + public static void setDeptIdColumn(String deptIdColumn) { + QMSPermissionContextHolder.deptIdColumn.set(deptIdColumn); + } + public static String getDeptIdColumn() { + if(deptIdColumn.get() == null || deptIdColumn.get().length() == 0) + return "DEPT_ID"; + return deptIdColumn.get(); } - public static void setIgnore(Boolean ignore) { - IGNORE.set(ignore); + public static void setUserIdColumn(String userIdColumn) { + QMSPermissionContextHolder.userIdColumn.set(userIdColumn); + } + public static String getUserIdColumn() { + if(userIdColumn.get() == null || userIdColumn.get().length() == 0) + return "CREATOR"; + return userIdColumn.get(); } - public static boolean shouldIgnore() { - return Boolean.TRUE.equals(IGNORE.get()); + public static void setCustom(String custom) { + QMSPermissionContextHolder.custom.set(custom); + } + public static String getCustom() { + return custom.get(); } public static void clear() { - DEPT_ID.remove(); - COMPANY_ID.remove(); - IGNORE.remove(); + enable.remove(); + deptDataRoleCodes.remove(); + moduleDataRoleCodes.remove(); + deptIdColumn.remove(); + userIdColumn.remove(); + custom.remove(); + } } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/framework/mybatis/QMSDataPermissionConfig.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/framework/mybatis/QMSDataPermissionConfig.java index 3bf9f88..d1610e2 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/framework/mybatis/QMSDataPermissionConfig.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/framework/mybatis/QMSDataPermissionConfig.java @@ -1,42 +1,42 @@ -//package com.zt.plat.module.qms.framework.mybatis; -// -// -//import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor; -//import com.baomidou.mybatisplus.extension.plugins.inner.DataPermissionInterceptor; -//import com.baomidou.mybatisplus.extension.plugins.inner.InnerInterceptor; -//import com.zt.plat.module.qms.framework.datapermission.QMSMultiDataPermissionHandler; -//import jakarta.annotation.PostConstruct; -//import org.aspectj.lang.annotation.After; -//import org.springframework.beans.factory.SmartInitializingSingleton; -//import org.springframework.beans.factory.annotation.Autowired; -//import org.springframework.context.annotation.Configuration; -// -//import java.util.List; -// +package com.zt.plat.module.qms.framework.mybatis; + + +import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor; +import com.baomidou.mybatisplus.extension.plugins.inner.DataPermissionInterceptor; +import com.baomidou.mybatisplus.extension.plugins.inner.InnerInterceptor; +import com.zt.plat.module.qms.framework.datapermission.QMSMultiDataPermissionHandler; +import jakarta.annotation.PostConstruct; +import org.aspectj.lang.annotation.After; +import org.springframework.beans.factory.SmartInitializingSingleton; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Configuration; + +import java.util.List; + //@Configuration -//public class QMSDataPermissionConfig implements SmartInitializingSingleton { -// @Autowired -// private MybatisPlusInterceptor mybatisPlusInterceptor; +public class QMSDataPermissionConfig implements SmartInitializingSingleton { + @Autowired + private MybatisPlusInterceptor mybatisPlusInterceptor; + + @Autowired + private QMSMultiDataPermissionHandler qmsMultiDataPermissionHandler; + + @Override + public void afterSingletonsInstantiated() { + List interceptors = mybatisPlusInterceptor.getInterceptors(); + // 避免重复注册 + boolean exists = interceptors.stream() + .filter(i -> i instanceof DataPermissionInterceptor) + .map(i -> (DataPermissionInterceptor) i) + .anyMatch(i -> i.getDataPermissionHandler() == qmsMultiDataPermissionHandler); + if (!exists) { + mybatisPlusInterceptor.addInnerInterceptor(new DataPermissionInterceptor(qmsMultiDataPermissionHandler)); + } + } + +// @PostConstruct +// public void addDataPermissionInterceptor() { // -// @Autowired -// private QMSMultiDataPermissionHandler qmsMultiDataPermissionHandler; -// -// @Override -// public void afterSingletonsInstantiated() { -// List interceptors = mybatisPlusInterceptor.getInterceptors(); -// // 避免重复注册 -// boolean exists = interceptors.stream() -// .filter(i -> i instanceof DataPermissionInterceptor) -// .map(i -> (DataPermissionInterceptor) i) -// .anyMatch(i -> i.getDataPermissionHandler() == qmsMultiDataPermissionHandler); -// if (!exists) { -// mybatisPlusInterceptor.addInnerInterceptor(new DataPermissionInterceptor(qmsMultiDataPermissionHandler)); -// } // } -// -//// @PostConstruct -//// public void addDataPermissionInterceptor() { -//// -//// } -// -//} + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/admin/SupplierController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/admin/SupplierController.java index 78ddfd4..4e8fd76 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/admin/SupplierController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/admin/SupplierController.java @@ -93,9 +93,9 @@ public class SupplierController extends AbstractFileUploadController implements @Operation(summary = "获得供应商") @Parameter(name = "id", description = "编号", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('qms:supplier:query')") - public CommonResult getSupplier(@RequestParam("id") Long id) { - SupplierDO supplier = supplierService.getSupplier(id); - return success(BeanUtils.toBean(supplier, SupplierRespVO.class)); + public CommonResult getSupplier(@RequestParam("id") Long id) { + SupplierExtendRespVO supplier = supplierService.getSupplier(id); + return success(supplier); } @GetMapping("/page") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/admin/SupplierEvaluationController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/admin/SupplierEvaluationController.java index 8a8a0dc..4e60ac1 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/admin/SupplierEvaluationController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/admin/SupplierEvaluationController.java @@ -1,5 +1,7 @@ package com.zt.plat.module.qms.office.supplier.controller.admin; +import com.zt.plat.module.qms.business.reportdoc.controller.vo.ReportDocumentMainRespVO; +import com.zt.plat.module.qms.business.reportdoc.controller.vo.ReportDocumentMainSaveReqVO; import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationPageReqVO; import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationRespVO; import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationSaveReqVO; @@ -57,14 +59,14 @@ public class SupplierEvaluationController extends AbstractFileUploadController i @PostMapping("/create") @Operation(summary = "创建供应商评价") - @PreAuthorize("@ss.hasPermission('qms:supplier-evaluation:create')") +// @PreAuthorize("@ss.hasPermission('qms:supplier-evaluation:create')") public CommonResult createSupplierEvaluation(@Valid @RequestBody SupplierEvaluationSaveReqVO createReqVO) { return success(supplierEvaluationService.createSupplierEvaluation(createReqVO)); } @PutMapping("/update") @Operation(summary = "更新供应商评价") - @PreAuthorize("@ss.hasPermission('qms:supplier-evaluation:update')") +// @PreAuthorize("@ss.hasPermission('qms:supplier-evaluation:update')") public CommonResult updateSupplierEvaluation(@Valid @RequestBody SupplierEvaluationSaveReqVO updateReqVO) { supplierEvaluationService.updateSupplierEvaluation(updateReqVO); return success(true); @@ -73,7 +75,7 @@ public class SupplierEvaluationController extends AbstractFileUploadController i @DeleteMapping("/delete") @Operation(summary = "删除供应商评价") @Parameter(name = "id", description = "编号", required = true) - @PreAuthorize("@ss.hasPermission('qms:supplier-evaluation:delete')") +// @PreAuthorize("@ss.hasPermission('qms:supplier-evaluation:delete')") public CommonResult deleteSupplierEvaluation(@RequestParam("id") Long id) { supplierEvaluationService.deleteSupplierEvaluation(id); return success(true); @@ -82,7 +84,7 @@ public class SupplierEvaluationController extends AbstractFileUploadController i @DeleteMapping("/delete-list") @Parameter(name = "ids", description = "编号", required = true) @Operation(summary = "批量删除供应商评价") - @PreAuthorize("@ss.hasPermission('qms:supplier-evaluation:delete')") +// @PreAuthorize("@ss.hasPermission('qms:supplier-evaluation:delete')") public CommonResult deleteSupplierEvaluationList(@RequestBody BatchDeleteReqVO req) { supplierEvaluationService.deleteSupplierEvaluationListByIds(req.getIds()); return success(true); @@ -91,7 +93,7 @@ public class SupplierEvaluationController extends AbstractFileUploadController i @GetMapping("/get") @Operation(summary = "获得供应商评价") @Parameter(name = "id", description = "编号", required = true, example = "1024") - @PreAuthorize("@ss.hasPermission('qms:supplier-evaluation:query')") +// @PreAuthorize("@ss.hasPermission('qms:supplier-evaluation:query')") public CommonResult getSupplierEvaluation(@RequestParam("id") Long id) { SupplierEvaluationDO supplierEvaluation = supplierEvaluationService.getSupplierEvaluation(id); return success(BeanUtils.toBean(supplierEvaluation, SupplierEvaluationRespVO.class)); @@ -99,10 +101,16 @@ public class SupplierEvaluationController extends AbstractFileUploadController i @GetMapping("/page") @Operation(summary = "获得供应商评价分页") - @PreAuthorize("@ss.hasPermission('qms:supplier-evaluation:query')") +// @PreAuthorize("@ss.hasPermission('qms:supplier-evaluation:query')") public CommonResult> getSupplierEvaluationPage(@Valid SupplierEvaluationPageReqVO pageReqVO) { - PageResult pageResult = supplierEvaluationService.getSupplierEvaluationPage(pageReqVO); - return success(BeanUtils.toBean(pageResult, SupplierEvaluationRespVO.class)); + PageResult pageResult = supplierEvaluationService.getSupplierEvaluationPage(pageReqVO); + return success(pageResult); + } + + @PostMapping("/createProcessInstance") + @Operation(summary = "发起流程") + public CommonResult createProcessInstance(@Valid @RequestBody SupplierEvaluationSaveReqVO createReqVO) { + return supplierEvaluationService.createProcessInstance(createReqVO); } @GetMapping("/export-excel") @@ -112,7 +120,7 @@ public class SupplierEvaluationController extends AbstractFileUploadController i public void exportSupplierEvaluationExcel(@Valid SupplierEvaluationPageReqVO pageReqVO, HttpServletResponse response) throws IOException { pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); - List list = supplierEvaluationService.getSupplierEvaluationPage(pageReqVO).getList(); + List list = supplierEvaluationService.getSupplierEvaluationPage(pageReqVO).getList(); // 导出 Excel ExcelUtils.write(response, "供应商评价.xls", "数据", SupplierEvaluationRespVO.class, BeanUtils.toBean(list, SupplierEvaluationRespVO.class)); diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/admin/SupplierPropertiesController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/admin/SupplierPropertiesController.java index 85be988..f1231d5 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/admin/SupplierPropertiesController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/admin/SupplierPropertiesController.java @@ -57,14 +57,14 @@ public class SupplierPropertiesController extends AbstractFileUploadController i @PostMapping("/create") @Operation(summary = "创建供应商属性") - @PreAuthorize("@ss.hasPermission('qms:supplier-properties:create')") +// @PreAuthorize("@ss.hasPermission('qms:supplier-properties:create')") public CommonResult createSupplierProperties(@Valid @RequestBody SupplierPropertiesSaveReqVO createReqVO) { return success(supplierPropertiesService.createSupplierProperties(createReqVO)); } @PutMapping("/update") @Operation(summary = "更新供应商属性") - @PreAuthorize("@ss.hasPermission('qms:supplier-properties:update')") +// @PreAuthorize("@ss.hasPermission('qms:supplier-properties:update')") public CommonResult updateSupplierProperties(@Valid @RequestBody SupplierPropertiesSaveReqVO updateReqVO) { supplierPropertiesService.updateSupplierProperties(updateReqVO); return success(true); @@ -73,7 +73,7 @@ public class SupplierPropertiesController extends AbstractFileUploadController i @DeleteMapping("/delete") @Operation(summary = "删除供应商属性") @Parameter(name = "id", description = "编号", required = true) - @PreAuthorize("@ss.hasPermission('qms:supplier-properties:delete')") +// @PreAuthorize("@ss.hasPermission('qms:supplier-properties:delete')") public CommonResult deleteSupplierProperties(@RequestParam("id") Long id) { supplierPropertiesService.deleteSupplierProperties(id); return success(true); @@ -91,7 +91,7 @@ public class SupplierPropertiesController extends AbstractFileUploadController i @GetMapping("/get") @Operation(summary = "获得供应商属性") @Parameter(name = "id", description = "编号", required = true, example = "1024") - @PreAuthorize("@ss.hasPermission('qms:supplier-properties:query')") +// @PreAuthorize("@ss.hasPermission('qms:supplier-properties:query')") public CommonResult getSupplierProperties(@RequestParam("id") Long id) { SupplierPropertiesDO supplierProperties = supplierPropertiesService.getSupplierProperties(id); return success(BeanUtils.toBean(supplierProperties, SupplierPropertiesRespVO.class)); @@ -99,7 +99,7 @@ public class SupplierPropertiesController extends AbstractFileUploadController i @GetMapping("/page") @Operation(summary = "获得供应商属性分页") - @PreAuthorize("@ss.hasPermission('qms:supplier-properties:query')") +// @PreAuthorize("@ss.hasPermission('qms:supplier-properties:query')") public CommonResult> getSupplierPropertiesPage(@Valid SupplierPropertiesPageReqVO pageReqVO) { PageResult pageResult = supplierPropertiesService.getSupplierPropertiesPage(pageReqVO); return success(BeanUtils.toBean(pageResult, SupplierPropertiesRespVO.class)); diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/vo/SupplierEvaluationPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/vo/SupplierEvaluationPageReqVO.java index 1b67536..8f1a779 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/vo/SupplierEvaluationPageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/vo/SupplierEvaluationPageReqVO.java @@ -1,5 +1,6 @@ package com.zt.plat.module.qms.office.supplier.controller.vo; +import com.alibaba.excel.annotation.ExcelProperty; import lombok.*; import io.swagger.v3.oas.annotations.media.Schema; import com.zt.plat.framework.common.pojo.PageParam; @@ -50,4 +51,12 @@ public class SupplierEvaluationPageReqVO extends PageParam { @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] createTime; + //==============扩展字段=============== + @Schema(description = "供应商名称") + private String supplierName; + + @Schema(description = "审批签名") + private String signatureInfo; + + } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/vo/SupplierEvaluationRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/vo/SupplierEvaluationRespVO.java index bb2ea1b..403d25a 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/vo/SupplierEvaluationRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/vo/SupplierEvaluationRespVO.java @@ -1,5 +1,6 @@ package com.zt.plat.module.qms.office.supplier.controller.vo; +import com.zt.plat.module.qms.core.aspect.annotation.Dict; import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; @@ -45,6 +46,7 @@ public class SupplierEvaluationRespVO { @Schema(description = "流程审批状态", example = "2") @ExcelProperty("流程审批状态") + @Dict(dicCode = "flow_status") private String flowStatus; @Schema(description = "流程实例id", example = "24931") @@ -63,4 +65,13 @@ public class SupplierEvaluationRespVO { @ExcelProperty("创建时间") private LocalDateTime createTime; + //==============扩展字段=============== + @Schema(description = "供应商名称") + private String supplierName; + + @Schema(description = "审批签名") + @ExcelProperty("审批签名") + private String signatureInfo; + + } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/vo/SupplierEvaluationSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/vo/SupplierEvaluationSaveReqVO.java index 5f208ce..a5ff13e 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/vo/SupplierEvaluationSaveReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/vo/SupplierEvaluationSaveReqVO.java @@ -1,5 +1,6 @@ package com.zt.plat.module.qms.office.supplier.controller.vo; +import com.alibaba.excel.annotation.ExcelProperty; import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; @@ -45,4 +46,7 @@ public class SupplierEvaluationSaveReqVO { @Schema(description = "备注") private String remark; + @Schema(description = "审批签名") + private String signatureInfo; + } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/vo/SupplierExtendRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/vo/SupplierExtendRespVO.java new file mode 100644 index 0000000..36e0530 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/vo/SupplierExtendRespVO.java @@ -0,0 +1,26 @@ +package com.zt.plat.module.qms.office.supplier.controller.vo; + +import cn.hutool.core.collection.CollUtil; +import com.zt.plat.module.qms.office.supplier.dal.dataobject.SupplierPropertiesDO; +import lombok.Data; + +import java.util.List; +import java.util.stream.Collectors; + + +@Data +public class SupplierExtendRespVO extends SupplierRespVO { + + private String certification; + + public String getCertification() { + if (CollUtil.isNotEmpty(this.supplierPropertiesList)) { + return this.supplierPropertiesList.stream().map(m -> m.getSubitemCode()).collect(Collectors.joining("、")); + } + return null; + } + + private List supplierPropertiesList; + + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/vo/SupplierPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/vo/SupplierPageReqVO.java index e00c5d0..c471eff 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/vo/SupplierPageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/vo/SupplierPageReqVO.java @@ -21,6 +21,12 @@ public class SupplierPageReqVO extends PageParam { @Schema(description = "类型", example = "1") private String type; + @Schema(description = "统一社会信用代码") + private String creditCode; + + @Schema(description = "注册日期") + private LocalDateTime registerDate; + @Schema(description = "地址") private String address; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/vo/SupplierPropertiesPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/vo/SupplierPropertiesPageReqVO.java index 101fdba..efe174b 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/vo/SupplierPropertiesPageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/vo/SupplierPropertiesPageReqVO.java @@ -29,6 +29,9 @@ public class SupplierPropertiesPageReqVO extends PageParam { @Schema(description = "名称", example = "王五") private String name; + @Schema(description = "说明") + private String content; + @Schema(description = "有效期开始") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] startDate; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/vo/SupplierPropertiesRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/vo/SupplierPropertiesRespVO.java index d39ddb0..eb425f8 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/vo/SupplierPropertiesRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/vo/SupplierPropertiesRespVO.java @@ -1,5 +1,6 @@ package com.zt.plat.module.qms.office.supplier.controller.vo; +import com.zt.plat.module.qms.core.aspect.annotation.Dict; import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; @@ -30,12 +31,17 @@ public class SupplierPropertiesRespVO { @Schema(description = "子业务编码") @ExcelProperty("子业务编码") + @Dict(dicCode = "") private String subitemCode; @Schema(description = "名称", example = "王五") @ExcelProperty("名称") private String name; + @Schema(description = "说明") + @ExcelProperty("说明") + private String content; + @Schema(description = "有效期开始") @ExcelProperty("有效期开始") private LocalDateTime startDate; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/vo/SupplierPropertiesSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/vo/SupplierPropertiesSaveReqVO.java index 77a27cf..f3b0c30 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/vo/SupplierPropertiesSaveReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/vo/SupplierPropertiesSaveReqVO.java @@ -28,6 +28,9 @@ public class SupplierPropertiesSaveReqVO { @Schema(description = "名称", example = "王五") private String name; + @Schema(description = "说明") + private String content; + @Schema(description = "有效期开始") private LocalDateTime startDate; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/vo/SupplierRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/vo/SupplierRespVO.java index d120efc..f263313 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/vo/SupplierRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/vo/SupplierRespVO.java @@ -27,6 +27,14 @@ public class SupplierRespVO { @ExcelProperty("类型") private String type; + @Schema(description = "统一社会信用代码") + @ExcelProperty("统一社会信用代码") + private String creditCode; + + @Schema(description = "注册日期") + @ExcelProperty("注册日期") + private LocalDateTime registerDate; + @Schema(description = "地址") @ExcelProperty("地址") private String address; @@ -58,5 +66,4 @@ public class SupplierRespVO { @Schema(description = "创建时间") @ExcelProperty("创建时间") private LocalDateTime createTime; - } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/vo/SupplierSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/vo/SupplierSaveReqVO.java index 843cbfc..7c21946 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/vo/SupplierSaveReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/controller/vo/SupplierSaveReqVO.java @@ -1,8 +1,11 @@ package com.zt.plat.module.qms.office.supplier.controller.vo; +import com.alibaba.excel.annotation.ExcelProperty; import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; +import java.time.LocalDateTime; + @Schema(description = "管理后台 - 供应商新增/修改 Request VO") @Data public class SupplierSaveReqVO { @@ -19,6 +22,12 @@ public class SupplierSaveReqVO { @Schema(description = "类型", example = "1") private String type; + @Schema(description = "统一社会信用代码") + private String creditCode; + + @Schema(description = "注册日期") + private LocalDateTime registerDate; + @Schema(description = "地址") private String address; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/dal/dataobject/SupplierDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/dal/dataobject/SupplierDO.java index 08ad568..eaec43e 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/dal/dataobject/SupplierDO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/dal/dataobject/SupplierDO.java @@ -3,6 +3,9 @@ package com.zt.plat.module.qms.office.supplier.dal.dataobject; import lombok.*; import com.baomidou.mybatisplus.annotation.*; import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; + +import java.time.LocalDateTime; + /** * 供应商 DO * @@ -44,6 +47,16 @@ public class SupplierDO extends BusinessBaseDO { @TableField("TP") private String type; /** + * 统一社会信用代码 + */ + @TableField("CRDT_CD") + private String creditCode; + /** + * 注册日期 + */ + @TableField("REG_DT") + private LocalDateTime registerDate; + /** * 地址 */ @TableField("ADR") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/dal/dataobject/SupplierEvaluationDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/dal/dataobject/SupplierEvaluationDO.java index c0e1fbb..a8d1d80 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/dal/dataobject/SupplierEvaluationDO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/dal/dataobject/SupplierEvaluationDO.java @@ -77,6 +77,11 @@ public class SupplierEvaluationDO extends BusinessBaseDO { @TableField("FLW_INSC_ID") private String flowInstanceId; /** + * 签名信息 + */ + @TableField("SIG_INF") + private String signatureInfo; + /** * 所属部门 */ @TableField("SYS_DEPT_CD") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/dal/dataobject/SupplierPropertiesDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/dal/dataobject/SupplierPropertiesDO.java index d74a2a4..22046f4 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/dal/dataobject/SupplierPropertiesDO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/dal/dataobject/SupplierPropertiesDO.java @@ -57,6 +57,11 @@ public class SupplierPropertiesDO extends BusinessBaseDO { */ @TableField("NAME") private String name; + /** + * 说明 + */ + @TableField("CNTT") + private String content; /** * 有效期开始 */ diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/dal/mapper/SupplierEvaluationMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/dal/mapper/SupplierEvaluationMapper.java index c2e5388..ce1b97b 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/dal/mapper/SupplierEvaluationMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/dal/mapper/SupplierEvaluationMapper.java @@ -3,6 +3,9 @@ package com.zt.plat.module.qms.office.supplier.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.framework.mybatis.core.query.MPJLambdaWrapperX; +import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationRespVO; +import com.zt.plat.module.qms.office.supplier.dal.dataobject.SupplierDO; import com.zt.plat.module.qms.office.supplier.dal.dataobject.SupplierEvaluationDO; import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationPageReqVO; import org.apache.ibatis.annotations.Mapper; @@ -15,8 +18,11 @@ import org.apache.ibatis.annotations.Mapper; @Mapper public interface SupplierEvaluationMapper extends BaseMapperX { - default PageResult selectPage(SupplierEvaluationPageReqVO reqVO) { - return selectPage(reqVO, new LambdaQueryWrapperX() + default PageResult selectPage(SupplierEvaluationPageReqVO reqVO) { + return selectJoinPage(reqVO,SupplierEvaluationRespVO.class, new MPJLambdaWrapperX() + .leftJoin(SupplierDO.class,SupplierDO::getId, SupplierEvaluationDO::getSupplierId) + .selectAll(SupplierEvaluationDO.class) + .selectAs(SupplierDO::getName, SupplierEvaluationRespVO::getSupplierName) .eqIfPresent(SupplierEvaluationDO::getSupplierId, reqVO.getSupplierId()) .eqIfPresent(SupplierEvaluationDO::getFormId, reqVO.getFormId()) .eqIfPresent(SupplierEvaluationDO::getContent, reqVO.getContent()) @@ -29,7 +35,10 @@ public interface SupplierEvaluationMapper extends BaseMapperX { .eqIfPresent(SupplierDO::getCode, reqVO.getCode()) .eqIfPresent(SupplierDO::getType, reqVO.getType()) .eqIfPresent(SupplierDO::getAddress, reqVO.getAddress()) + .eqIfPresent(SupplierDO::getCreditCode, reqVO.getCreditCode()) + .eqIfPresent(SupplierDO::getRegisterDate, reqVO.getRegisterDate()) .eqIfPresent(SupplierDO::getContact, reqVO.getContact()) .eqIfPresent(SupplierDO::getMobile, reqVO.getMobile()) .eqIfPresent(SupplierDO::getBusinessScope, reqVO.getBusinessScope()) @@ -30,4 +38,16 @@ public interface SupplierMapper extends BaseMapperX { .orderByDesc(SupplierDO::getId)); } + default SupplierExtendRespVO selectOneWithCertifications(Long id) { + return selectJoinOne(SupplierExtendRespVO.class, + new MPJLambdaWrapperX() + .selectAll(SupplierDO.class) + .selectCollection(SupplierPropertiesDO.class, SupplierExtendRespVO::getSupplierPropertiesList) + .leftJoin(SupplierPropertiesDO.class, SupplierPropertiesDO::getSupplierId, SupplierDO::getId) + .eq(SupplierDO::getId, id) + .eq(SupplierPropertiesDO::getBusinessType, QmsSupplierConstant.CERTIFICATION_KEY) + ); + } + + } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/dal/mapper/SupplierPropertiesMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/dal/mapper/SupplierPropertiesMapper.java index 89ecc1e..6b13a04 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/dal/mapper/SupplierPropertiesMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/dal/mapper/SupplierPropertiesMapper.java @@ -1,5 +1,6 @@ package com.zt.plat.module.qms.office.supplier.dal.mapper; +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; @@ -22,6 +23,7 @@ public interface SupplierPropertiesMapper extends BaseMapperX selectList(SupplierPropertiesPageReqVO reqVO) { + return selectList(new LambdaQueryWrapperX() + .eqIfPresent(SupplierPropertiesDO::getSupplierId, reqVO.getSupplierId()) + .eqIfPresent(SupplierPropertiesDO::getBusinessType, reqVO.getBusinessType()) + .eqIfPresent(SupplierPropertiesDO::getBusinessCode, reqVO.getBusinessCode()) + .eqIfPresent(SupplierPropertiesDO::getSubitemCode, reqVO.getSubitemCode()) + .orderByDesc(SupplierPropertiesDO::getId)); + } } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/service/SupplierEvaluationService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/service/SupplierEvaluationService.java index 5eff693..2b4f4fe 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/service/SupplierEvaluationService.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/service/SupplierEvaluationService.java @@ -2,6 +2,9 @@ package com.zt.plat.module.qms.office.supplier.service; import java.util.*; +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.module.qms.business.reportdoc.controller.vo.ReportDocumentMainRespVO; +import com.zt.plat.module.qms.business.reportdoc.controller.vo.ReportDocumentMainSaveReqVO; import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationPageReqVO; import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationRespVO; import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationSaveReqVO; @@ -59,6 +62,9 @@ public interface SupplierEvaluationService { * @param pageReqVO 分页查询 * @return 供应商评价分页 */ - PageResult getSupplierEvaluationPage(SupplierEvaluationPageReqVO pageReqVO); + PageResult getSupplierEvaluationPage(SupplierEvaluationPageReqVO pageReqVO); + + //发起流程 + CommonResult createProcessInstance(SupplierEvaluationSaveReqVO entity); } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/service/SupplierEvaluationServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/service/SupplierEvaluationServiceImpl.java index e19b7e8..a6f3047 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/service/SupplierEvaluationServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/service/SupplierEvaluationServiceImpl.java @@ -1,13 +1,37 @@ package com.zt.plat.module.qms.office.supplier.service; import cn.hutool.core.collection.CollUtil; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.framework.security.core.LoginUser; +import com.zt.plat.framework.security.core.util.SecurityFrameworkUtils; +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.dto.BpmProcessInstanceCreateReqDTO; +import com.zt.plat.module.bpm.api.task.dto.BpmTaskApproveReqDTO; +import com.zt.plat.module.bpm.api.task.dto.BpmTaskRespDTO; +import com.zt.plat.module.qms.api.task.BMPCallbackInterface; +import com.zt.plat.module.qms.api.task.dto.QmsBpmDTO; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigUserSignatureDO; +import com.zt.plat.module.qms.business.config.service.ConfigUserSignatureService; +import com.zt.plat.module.qms.business.reportdoc.controller.vo.ReportDocumentMainRespVO; +import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentMainDO; +import com.zt.plat.module.qms.common.data.service.DataKeyCheckService; +import com.zt.plat.module.qms.enums.QmsBpmConstant; +import com.zt.plat.module.qms.enums.QmsCommonConstant; +import com.zt.plat.module.qms.enums.QmsSupplierConstant; import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationPageReqVO; import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationRespVO; import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationSaveReqVO; import org.springframework.stereotype.Service; import jakarta.annotation.Resource; +import org.springframework.util.ObjectUtils; import org.springframework.validation.annotation.Validated; +import java.io.IOException; +import java.text.SimpleDateFormat; +import java.time.LocalDateTime; import java.util.*; import com.zt.plat.module.qms.office.supplier.dal.dataobject.SupplierEvaluationDO; @@ -17,25 +41,32 @@ import com.zt.plat.framework.common.util.object.BeanUtils; import com.zt.plat.module.qms.office.supplier.dal.mapper.SupplierEvaluationMapper; import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception0; import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList; import static com.zt.plat.module.qms.enums.ErrorCodeConstants.*; +import static com.zt.plat.module.qms.enums.QmsBpmConstant.BPM_CALLBACK_BEAN_NAME; /** * 供应商评价 Service 实现类 * * @author 后台管理 */ -@Service +@Service("supplierEvaluationService") @Validated -public class SupplierEvaluationServiceImpl implements SupplierEvaluationService { +public class SupplierEvaluationServiceImpl implements SupplierEvaluationService, BMPCallbackInterface { - @Resource - private SupplierEvaluationMapper supplierEvaluationMapper; + @Resource private SupplierEvaluationMapper supplierEvaluationMapper; + @Resource private BpmProcessInstanceApi bpmProcessInstanceApi; + @Resource private BpmTaskApi bpmTaskApi; + @Resource private ConfigUserSignatureService configUserSignatureService; + @Resource private DataKeyCheckService dataKeyCheckService; @Override public SupplierEvaluationRespVO createSupplierEvaluation(SupplierEvaluationSaveReqVO createReqVO) { + // 插入 SupplierEvaluationDO supplierEvaluation = BeanUtils.toBean(createReqVO, SupplierEvaluationDO.class); + supplierEvaluation.setFlowStatus(QmsCommonConstant.NOT_START); supplierEvaluationMapper.insert(supplierEvaluation); // 返回 return BeanUtils.toBean(supplierEvaluation, SupplierEvaluationRespVO.class); @@ -85,8 +116,166 @@ public class SupplierEvaluationServiceImpl implements SupplierEvaluationService } @Override - public PageResult getSupplierEvaluationPage(SupplierEvaluationPageReqVO pageReqVO) { + public PageResult getSupplierEvaluationPage(SupplierEvaluationPageReqVO pageReqVO) { return supplierEvaluationMapper.selectPage(pageReqVO); } + @Override + public CommonResult createProcessInstance(SupplierEvaluationSaveReqVO param) { + + LoginUser loginUser = SecurityFrameworkUtils.getLoginUser(); + //当前登录用户昵称 + String nickName = SecurityFrameworkUtils.getLoginUserNickname(); + Long id = param.getId(); + SupplierEvaluationDO entity = getSupplierEvaluation(id); + String flowInsId = entity.getFlowInstanceId(); + + if(!ObjectUtils.isEmpty(flowInsId)){ + CommonResult> taskRet = bpmTaskApi.getTaskListByProcessInstanceId(flowInsId); + List taskList = taskRet.getData(); + if(taskList.isEmpty()) + throw exception0(ERROR_CODE_MODULE_COMMON, "流程任务查询失败,请联系管理员处理"); + String taskId = taskList.get(taskList.size() - 1).getId(); + //驳回后重新提交 + BpmTaskApproveReqDTO reqVO = new BpmTaskApproveReqDTO(); + reqVO.setId(taskId); + CommonResult result = bpmProcessInstanceApi.approveTask(reqVO); + if(!result.isSuccess()){ + throw exception0(ERROR_CODE_MODULE_COMMON, result.getMsg()); + } + entity.setFlowStatus(QmsCommonConstant.IN_PROGRESS); + //todo 生成报告编号 documentCode + supplierEvaluationMapper.updateById(entity); + SupplierEvaluationRespVO respVO = BeanUtils.toBean(entity, SupplierEvaluationRespVO.class); + return CommonResult.success(respVO); + } + JSONObject formData = new JSONObject(); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + formData.put("mainId", id); + formData.put("applyUser", nickName); + formData.put("applyUserId", loginUser.getId()); + formData.put("applyDepartment", loginUser.getVisitDeptName()); + formData.put("applyDepartmentId", loginUser.getVisitDeptId()); + formData.put("applyTime", sdf.format(new Date())); + Map variables = formData.toJavaObject(Map.class); + variables.put(BPM_CALLBACK_BEAN_NAME, "supplierEvaluationService"); //流程回调时使用的service + BpmProcessInstanceCreateReqDTO reqDTO = new BpmProcessInstanceCreateReqDTO(); + reqDTO.setBusinessKey(String.valueOf(id)); + reqDTO.setProcessDefinitionKey(QmsSupplierConstant.EVALUATION_FLOW_KEY); + reqDTO.setVariables(variables); + CommonResult result = bpmProcessInstanceApi.createProcessInstance(loginUser.getId(), reqDTO); + if(!result.isSuccess()){ + throw exception0(ERROR_CODE_MODULE_COMMON, result.getMsg()); + } + String wfInsId = result.getData(); + entity.setFlowInstanceId(wfInsId); + entity.setFlowStatus(QmsCommonConstant.IN_PROGRESS); + entity.setEvaluationDate(LocalDateTime.now()); + entity.setEvaluator(nickName); + supplierEvaluationMapper.updateById(entity); + SupplierEvaluationRespVO respVO = BeanUtils.toBean(entity, SupplierEvaluationRespVO.class); + return CommonResult.success(respVO); + } + + @Override + public CommonResult callback(QmsBpmDTO reqDTO) { + + JSONObject variables = reqDTO.getVariables(); + String processInsId = variables.getString(QmsBpmConstant.BPM_PROCESS_INS_ID); + String currentActivityInsId = variables.getString(QmsBpmConstant.BPM_CUR_ACTIVITY_INS_ID); + String returnFlag = variables.getString(QmsBpmConstant.BPM_REJECT_TO_FIRST_FLAG); //退回标识。在任务监听中设置 + //同一个节点实例只触发一次 + String checkKey = currentActivityInsId; + if(ObjectUtils.isEmpty(currentActivityInsId)) + checkKey = processInsId + "-create"; + if("1".equals(returnFlag)) + checkKey += "-reject"; + try{ + dataKeyCheckService.create(checkKey, this.getClass().getName()); + }catch (Exception e){ +// e.printStackTrace(); + + return CommonResult.success(new JSONObject()); + } + //流程状态 1-提交(含退回) 4-取消流程 + String PROCESS_STATUS = variables.getString(QmsBpmConstant.PROCESS_INSTANCE_VARIABLE_STATUS); + String mainId = variables.getString("mainId"); + JSONArray fieldExtensions = new JSONArray(); + if(variables.containsKey(QmsBpmConstant.BPM_FIELD_EXTENSIONS)){ + fieldExtensions = variables.getJSONArray(QmsBpmConstant.BPM_FIELD_EXTENSIONS); + } + SupplierEvaluationDO entity = getSupplierEvaluation(Long.valueOf(mainId)); + + String currentActivityId = variables.getString(QmsBpmConstant.BPM_CALLBACK_ACTIVITY_ID); + + //判断是否最后一个节点 + String lastActivityFlag = "0"; + String firstActivityFlag = "0"; + if(!fieldExtensions.isEmpty()){ + for(int i = 0; i < fieldExtensions.size(); i++){ + JSONObject fieldExtension = fieldExtensions.getJSONObject(i); + if(fieldExtension.getString("fieldName").equalsIgnoreCase(QmsBpmConstant.BPM_LAST_ACTIVITY_FLAG)){ + lastActivityFlag = "1"; + } + if(fieldExtension.getString("fieldName").equalsIgnoreCase(QmsBpmConstant.BPM_FIRST_ACTIVITY_FLAG)){ + firstActivityFlag = "1"; + } + } + } + //"RETURN_FLAG_Activity_001": true 标识驳回到发起环节 + if(("1").equals(returnFlag)){ + //驳回。流程需要配置退回到发起节点 + entity.setFlowStatus(QmsCommonConstant.REJECTED); + entity.setSignatureInfo(""); + }else if("4".equals(PROCESS_STATUS)){ + //作废 + entity.setFlowStatus(QmsCommonConstant.VOID); + entity.setSignatureInfo(""); + }else if("1".equals(PROCESS_STATUS)){ + //通过 + assembleSignature(currentActivityId, entity); + if("1".equals(firstActivityFlag)) + entity.setFlowStatus(QmsCommonConstant.IN_PROGRESS); //驳回后重新提交 + if("1".equals(lastActivityFlag)) + entity.setFlowStatus(QmsCommonConstant.COMPLETED); //结束审批 + } + + supplierEvaluationMapper.updateById(entity); + +// try { +// reportDocumentAssistService.updateDocFileAndCreateIWorkflow( variables, entity); +// } catch (IOException e) { +// throw new RuntimeException(e); +// } + + JSONObject ret = new JSONObject(); + return CommonResult.success(ret); + } + + private void assembleSignature(String currentActivityId, SupplierEvaluationDO entity){ + if(ObjectUtils.isEmpty(currentActivityId) || "null".equals(currentActivityId)) + return; + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + String sign = entity.getSignatureInfo(); + JSONObject signObj = new JSONObject(); + if(!ObjectUtils.isEmpty( sign)) + signObj = JSONObject.parseObject(sign); + if(signObj.containsKey(currentActivityId)) + return; + JSONObject obj = new JSONObject(); + LoginUser loginUser = SecurityFrameworkUtils.getLoginUser(); + Long userId = loginUser.getId(); + //当前登录用户昵称 + String nickName = SecurityFrameworkUtils.getLoginUserNickname(); + ConfigUserSignatureDO configUserSignatureDO = configUserSignatureService.getByUserId(userId); + obj.put("signatureId", ""); + if(configUserSignatureDO != null) + obj.put("signatureId", configUserSignatureDO.getId()); + obj.put("userId", userId); + obj.put("userName", nickName); + obj.put("signTime", sdf.format(new Date())); + signObj.put(currentActivityId, obj); + entity.setSignatureInfo(signObj.toJSONString()); + } } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/service/SupplierService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/service/SupplierService.java index 003ca82..b9592f0 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/service/SupplierService.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/service/SupplierService.java @@ -2,6 +2,7 @@ package com.zt.plat.module.qms.office.supplier.service; import java.util.*; +import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierExtendRespVO; import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierPageReqVO; import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierRespVO; import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierSaveReqVO; @@ -51,7 +52,7 @@ public interface SupplierService { * @param id 编号 * @return 供应商 */ - SupplierDO getSupplier(Long id); + SupplierExtendRespVO getSupplier(Long id); /** * 获得供应商分页 diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/service/SupplierServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/service/SupplierServiceImpl.java index 867d750..f188ef7 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/service/SupplierServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/supplier/service/SupplierServiceImpl.java @@ -1,6 +1,7 @@ package com.zt.plat.module.qms.office.supplier.service; import cn.hutool.core.collection.CollUtil; +import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierExtendRespVO; import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierPageReqVO; import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierRespVO; import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierSaveReqVO; @@ -80,8 +81,8 @@ public class SupplierServiceImpl implements SupplierService { } @Override - public SupplierDO getSupplier(Long id) { - return supplierMapper.selectById(id); + public SupplierExtendRespVO getSupplier(Long id) { + return supplierMapper.selectOneWithCertifications(id); } @Override diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/clientManage/controller/admin/VersionManagementController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/clientManage/controller/admin/VersionManagementController.java index 48b88f4..ddb9572 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/clientManage/controller/admin/VersionManagementController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/clientManage/controller/admin/VersionManagementController.java @@ -30,7 +30,7 @@ import com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIg import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; - +import com.alibaba.fastjson.JSONObject; import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog; import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; @@ -121,7 +121,7 @@ public class VersionManagementController extends AbstractFileUploadController im @GetMapping("/checkUpdate") @Operation(summary = "根据更新平台和安装包类型获取最新客户端版本管理信息") - public CommonResult checkUpdate(@Valid VersionManagementPageReqVO pageReqVO) { + public Object checkUpdate(@Valid VersionManagementPageReqVO pageReqVO) { if (pageReqVO.getApplicationCode() == null ) { return CommonResult.error(400, "客户端编号不能为空"); @@ -130,10 +130,42 @@ public class VersionManagementController extends AbstractFileUploadController im return CommonResult.error(400, "更新平台不能为空"); } PageResult pageResult = systemVersionManagementService.getList(pageReqVO); + if ("pc".equals(pageReqVO.getUpdatePlatform())) { + String version = "0.0.0"; + String minVersion = "0.0.0"; + String checksumSha1 = ""; + String url = ""; + String log = ""; + if (pageResult.getList().size() != 0) { + VersionManagementDO versionManagementDO = pageResult.getList().get(0); + version = versionManagementDO.getCurrentVersion(); + minVersion = versionManagementDO.getMinimumVersion(); + url = versionManagementDO.getDownloadUrl(); + log = versionManagementDO.getUpdateContent(); + checksumSha1 = versionManagementDO.getFileEncryptAlgorithm(); + } + + JSONObject resultJson = new JSONObject(); + resultJson.put("version", version); + resultJson.put("url", url); + resultJson.put("changelog", log); + JSONObject mandatory = new JSONObject(); + mandatory.put("value", true); + mandatory.put("minVersion", minVersion); + mandatory.put("mode", 2); + resultJson.put("mandatory", mandatory); + JSONObject checksum = new JSONObject(); + checksum.put("hashingAlgorithm", "SHA1"); + checksum.put("value", checksumSha1); + resultJson.put("checksum", checksum); + return resultJson; + } + if (pageResult.getList().size() == 0) { return CommonResult.error(400, "没有可更新版本"); } VersionManagementDO versionManagementDO = pageResult.getList().get(0); + return success(BeanUtils.toBean(versionManagementDO, VersionManagementRespVO.class)); } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceProductController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceProductController.java index 5571f2b..c8f642a 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceProductController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceProductController.java @@ -1,6 +1,5 @@ package com.zt.plat.module.qms.resource.device.controller.admin; -import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor; import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog; import com.zt.plat.framework.business.annotation.FileUploadController; import com.zt.plat.framework.business.controller.AbstractFileUploadController; @@ -25,7 +24,6 @@ import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.annotation.Resource; import jakarta.servlet.http.HttpServletResponse; import jakarta.validation.Valid; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -40,7 +38,7 @@ import static com.zt.plat.framework.common.pojo.CommonResult.success; @RestController @RequestMapping("/qms/resource/device-product") @Validated -//@DeptDataPermissionIgnore(enable = "true") +@DeptDataPermissionIgnore(enable = "true") @FileUploadController(source = "resource.deviceproduct") public class DeviceProductController extends AbstractFileUploadController implements BusinessControllerMarker{ @@ -122,9 +120,6 @@ public class DeviceProductController extends AbstractFileUploadController implem return success(BeanUtils.toBean(deviceProduct, DeviceProductRespVO.class)); } - @Autowired - private MybatisPlusInterceptor mybatisPlusInterceptor; - @GetMapping("/page") @Operation(summary = "获得设备-设备大类分页") // @PreAuthorize("@ss.hasPermission('resource:device-product:query')") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceApplyMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceApplyMapper.java index 44a4e49..813b61b 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceApplyMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceApplyMapper.java @@ -43,7 +43,6 @@ public interface DeviceApplyMapper extends BaseMapperX { .betweenIfPresent(DeviceApplyDO::getCreateTime, reqVO.getCreateTime()) .orderByDesc(DeviceApplyDO::getId); return selectPage(reqVO, wrapper); - } } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceInfomationMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceInfomationMapper.java index 2fba698..a2f89c0 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceInfomationMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceInfomationMapper.java @@ -3,6 +3,7 @@ package com.zt.plat.module.qms.resource.device.dal.mapper; 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.qms.core.aspect.annotation.QmsPermission; import com.zt.plat.module.qms.resource.device.controller.vo.DeviceInfomationPageReqVO; import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceInfoWithBizConfigVO; import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceInfomationDO; @@ -20,6 +21,7 @@ import java.util.Map; @Mapper public interface DeviceInfomationMapper extends BaseMapperX { + @QmsPermission(deptDataRoleCodes = "") default PageResult selectPage(DeviceInfomationPageReqVO reqVO) { return selectPage(reqVO, new LambdaQueryWrapperX() .eqIfPresent(DeviceInfomationDO::getProductId, reqVO.getProductId()) diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceProductMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceProductMapper.java index fd64a7c..1b87ec9 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceProductMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceProductMapper.java @@ -3,7 +3,6 @@ package com.zt.plat.module.qms.resource.device.dal.mapper; 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.qms.resource.device.controller.vo.*; import com.zt.plat.module.qms.resource.device.controller.vo.DeviceProductPageReqVO; import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceProductDO; import org.apache.ibatis.annotations.Mapper; From ccfa341429b5164803b00c41edbc871b2dfa25c4 Mon Sep 17 00:00:00 2001 From: FCL Date: Fri, 9 Jan 2026 14:10:20 +0800 Subject: [PATCH 08/11] =?UTF-8?q?fix:=E6=B5=81=E7=A8=8B=E5=9B=9E=E8=B0=83?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=A2=9E=E5=8A=A0DeptDataPermissionIgnore?= =?UTF-8?q?=E6=B3=A8=E8=A7=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/zt/plat/module/qms/api/task/QmsApiImpl.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/api/task/QmsApiImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/api/task/QmsApiImpl.java index c879642..6871bcd 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/api/task/QmsApiImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/api/task/QmsApiImpl.java @@ -2,6 +2,7 @@ package com.zt.plat.module.qms.api.task; import com.zt.plat.framework.common.pojo.CommonResult; import com.zt.plat.framework.common.util.spring.SpringUtils; +import com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore; import com.zt.plat.module.qms.api.task.dto.QmsBpmDTO; import com.alibaba.fastjson.JSONObject; import org.springframework.validation.annotation.Validated; @@ -12,6 +13,7 @@ import static com.zt.plat.module.qms.enums.QmsBpmConstant.BPM_CALLBACK_BEAN_NAME @RestController @Validated +@DeptDataPermissionIgnore(enable = "true") public class QmsApiImpl implements QmsApi{ @Override From 34277c921a96e577e4bc825f04502b6aff736cdf Mon Sep 17 00:00:00 2001 From: FCL Date: Tue, 13 Jan 2026 11:21:28 +0800 Subject: [PATCH 09/11] =?UTF-8?q?feat:qms=E9=98=B6=E6=AE=B5=E6=80=A7?= =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/BusinessAssayTaskDetailMapper.java | 5 + ...ubParentSampleAssessmentProjectMapper.java | 7 + .../SampleAnalysisAuditServiceImpl.java | 4 +- .../service/SampleAnalysisServiceImpl.java | 12 + .../SampleResultReportingServiceImpl.java | 18 +- .../QMSMultiDataPermissionHandler.java | 451 +++++++++--------- .../mybatis/QMSDataPermissionConfig.java | 80 ++-- .../admin/VersionManagementController.java | 20 + .../dal/mapper/DeviceInfomationMapper.java | 2 +- ...SubParentSampleAssessmentProjectMapper.xml | 1 + 10 files changed, 326 insertions(+), 274 deletions(-) diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayTaskDetailMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayTaskDetailMapper.java index c14ffdc..7622991 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayTaskDetailMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayTaskDetailMapper.java @@ -87,6 +87,11 @@ public interface BusinessAssayTaskDetailMapper extends BaseMapperX() .eqIfPresent(BusinessAssayTaskDetailDO::getBusinessAssayTaskId, businessAssayTaskId)); } + + default Long selectCountByBusinessAssayTaskId(Long businessAssayTaskId) { + return selectCount(new LambdaQueryWrapperX() + .eqIfPresent(BusinessAssayTaskDetailDO::getBusinessAssayTaskId, businessAssayTaskId)); + } /** * 物理批量删除删除 diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubParentSampleAssessmentProjectMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubParentSampleAssessmentProjectMapper.java index b951534..0b7e098 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubParentSampleAssessmentProjectMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubParentSampleAssessmentProjectMapper.java @@ -74,12 +74,19 @@ public interface BusinessSubParentSampleAssessmentProjectMapper extends BaseMapp return selectList(new LambdaQueryWrapper() .eq(BusinessSubParentSampleAssessmentProjectDO::getConfigAssayMethodId, configAssayMethodId)); } + + default List selectByBusinessSubParentSampleAssessmentIdAndDictionaryProjectIds(Long businessSubParentSampleAssessmentId, List recheckDictionaryProjectIdList) { return selectList(new LambdaQueryWrapper() .eq(BusinessSubParentSampleAssessmentProjectDO::getBusinessSubParentSampleAssessmentId, businessSubParentSampleAssessmentId) .in(BusinessSubParentSampleAssessmentProjectDO::getDictionaryProjectId, recheckDictionaryProjectIdList)); } + + default List selectByBusinessSubParentSampleAssessmentId(Long businessSubParentSampleAssessmentId) { + return selectList(new LambdaQueryWrapper() + .eq(BusinessSubParentSampleAssessmentProjectDO::getBusinessSubParentSampleAssessmentId, businessSubParentSampleAssessmentId)); + } List selectNoReportSubParentSampleAssessment(@Param("reqVO") BusinessSubParentSampleAssessmentGroupReqVO reqVO); diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleAnalysisAuditServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleAnalysisAuditServiceImpl.java index 648e206..087dcb0 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleAnalysisAuditServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleAnalysisAuditServiceImpl.java @@ -759,8 +759,8 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic } - //如果为自动上报 - if (QmsCommonConstant.AUTOMATIC.equals(configSubSampleMethodDO.getResultTreatmentWay())) { + //如果为自动上报, 并且上报状态为待上报的 + if (QmsCommonConstant.AUTOMATIC.equals(configSubSampleMethodDO.getResultTreatmentWay()) && QmsCommonConstant.ASMT_PENDING_REPORT.equals(businessSubSampleAssessmentDO.getReportedStatus())) { automaticBusinessSubSampleIdList.add(businessSubSampleId); } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleAnalysisServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleAnalysisServiceImpl.java index 98dd8b2..4e3d962 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleAnalysisServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleAnalysisServiceImpl.java @@ -1366,10 +1366,22 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService { businessAssayTaskDataDO.setExternalInfomation(JSON.toJSONString(businessAssayTaskDataExternalInfomation)); } + //任务id + Long businessAssayTaskId = businessAssayTaskDetailList.stream().map(m -> m.getBusinessAssayTaskId()).distinct().findFirst().orElse(null); + //查询任务下的明细 + Long taskCount = businessAssayTaskDetailMapper.selectCountByBusinessAssayTaskId(businessAssayTaskId); + if (businessAssayTaskDetailList.size() == taskCount.intValue()) {//如果回退所有样品,则作废任务 + BusinessAssayTaskDO businessAssayTaskDO = businessAssayTaskMapper.selectById(businessAssayTaskId); + businessAssayTaskDO.setTaskAssignStatus(QmsCommonConstant.VOID); + + businessAssayTaskMapper.updateById(businessAssayTaskDO); + } + //明细处理 if (CollUtil.isNotEmpty(businessAssayTaskDetailList)) { businessAssayTaskDetailMapper.updateBatch(businessAssayTaskDetailList); } + //任务明细处理 if (CollUtil.isNotEmpty(businessAssayTaskDataDOList)) { businessAssayTaskDataMapper.updateBatch(businessAssayTaskDataDOList); } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleResultReportingServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleResultReportingServiceImpl.java index 8042b20..8e07c8f 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleResultReportingServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleResultReportingServiceImpl.java @@ -199,7 +199,9 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe noReportSubParentSampleAssessmentMap.put(businessSubParentSampleAssessmentProjectDO.getSimpleName(), assessmentValue); businessSubParentSampleAssessmentProjectIds.append(businessSubParentSampleAssessmentProjectDO.getId()).append(","); } - businessSubParentSampleAssessmentProjectIds.delete(businessSubParentSampleAssessmentProjectIds.length() -1, businessSubParentSampleAssessmentProjectIds.length()); + if (businessSubParentSampleAssessmentProjectIds.length() > 0) { + businessSubParentSampleAssessmentProjectIds.delete(businessSubParentSampleAssessmentProjectIds.length() -1, businessSubParentSampleAssessmentProjectIds.length()); + } noReportSubParentSampleAssessmentMap.put("businessSubParentSampleAssessmentProjectIds", businessSubParentSampleAssessmentProjectIds.toString()); noReportSubParentSampleAssessmentMap.put("businessSubParentSampleAssessmentId", noReportSubParentSampleAssessmentRespVO.getBusinessSubParentSampleAssessmentId()); dataList.add(noReportSubParentSampleAssessmentMap); @@ -341,15 +343,15 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe BusinessSubParentSampleAssessmentDO olBusinessSubParentSampleAssessmentDO = businessSubParentSampleAssessmentMapper.selectById(reqVO.getBusinessSubParentSampleAssessmentId()); //查询分样主样判定 - BusinessSubParentSampleAssessmentDO businessSubParentSampleAssessmentDO = businessSubParentSampleAssessmentMapper.selectByBusinessSubParentSampleIdAndConfigAssayMethodId(reqVO.getBusinessSubParentSampleId(), reqVO.getConfigAssayMethodId()); - if (businessSubParentSampleAssessmentDO == null) { + //BusinessSubParentSampleAssessmentDO businessSubParentSampleAssessmentDO = businessSubParentSampleAssessmentMapper.selectByBusinessSubParentSampleIdAndConfigAssayMethodId(reqVO.getBusinessSubParentSampleId(), reqVO.getConfigAssayMethodId()); + if (olBusinessSubParentSampleAssessmentDO == null) { throw new ServiceException(1_032_050_000, "结果报送数据未找到"); } //复检的检测项目 List recheckProjectList = reqVO.getRecheckProjectList(); List recheckDictionaryProjectIdList = recheckProjectList.stream().map(m -> m.getDictionaryProjectId()).collect(Collectors.toList()); - List businessSubParentSampleAssessmentProjectDOList = businessSubParentSampleAssessmentProjectMapper.selectByBusinessSubParentSampleAssessmentIdAndDictionaryProjectIds(businessSubParentSampleAssessmentDO.getId(), recheckDictionaryProjectIdList); + List businessSubParentSampleAssessmentProjectDOList = businessSubParentSampleAssessmentProjectMapper.selectByBusinessSubParentSampleAssessmentIdAndDictionaryProjectIds(olBusinessSubParentSampleAssessmentDO.getId(), recheckDictionaryProjectIdList); for (BusinessSubParentSampleAssessmentProjectDO businessSubParentSampleAssessmentProjectDO : businessSubParentSampleAssessmentProjectDOList) { businessSubParentSampleAssessmentProjectDO.setIsReported(QmsCommonConstant.NO); businessSubParentSampleAssessmentProjectDO.setAssessmentStatus(QmsCommonConstant.VOID); @@ -410,7 +412,8 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe newBusinessSubSampleParentRetestDOList.add(businessSubSampleParentRetestDO ); } - BusinessSubSampleAssessmentDO newBusinessSubSampleAssessmentDO = newSubSampleAssessmentDOList.stream().filter(f -> f.getBusinessSubParentSampleAssessmentId().equals(businessSubParentSampleAssessmentDO.getId())).findFirst().orElse(null); + Long newBusinessSubParentSampleAssessmentId = newBusinessSubParentSampleAssessmentDO.getId(); + BusinessSubSampleAssessmentDO newBusinessSubSampleAssessmentDO = newSubSampleAssessmentDOList.stream().filter(f -> f.getBusinessSubParentSampleAssessmentId().equals(newBusinessSubParentSampleAssessmentId)).findFirst().orElse(null); if (newBusinessSubSampleAssessmentDO == null) { newBusinessSubSampleAssessmentDO = new BusinessSubSampleAssessmentDO(); newBusinessSubSampleAssessmentDO.setId(IdWorker.getId()); @@ -493,6 +496,11 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe } } + List allBusinessSubParentSampleAssessmentProjectList = businessSubParentSampleAssessmentProjectMapper.selectByBusinessSubParentSampleAssessmentId(olBusinessSubParentSampleAssessmentDO.getId()); + if (allBusinessSubParentSampleAssessmentProjectList.size() == businessSubParentSampleAssessmentProjectDOList.size()) {//如果复测项目都全部完成,则删除旧的结果报送 + businessSubParentSampleAssessmentMapper.deleteById(olBusinessSubParentSampleAssessmentDO.getId()); + } + if (CollUtil.isNotEmpty(businessSubParentSampleAssessmentProjectDOList)) { businessSubParentSampleAssessmentProjectMapper.updateBatch(businessSubParentSampleAssessmentProjectDOList); } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/framework/datapermission/QMSMultiDataPermissionHandler.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/framework/datapermission/QMSMultiDataPermissionHandler.java index 2ba0b9b..00d8fbc 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/framework/datapermission/QMSMultiDataPermissionHandler.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/framework/datapermission/QMSMultiDataPermissionHandler.java @@ -1,227 +1,226 @@ -package com.zt.plat.module.qms.framework.datapermission; - -import cn.hutool.core.collection.CollUtil; -import cn.hutool.core.util.ObjectUtil; -import cn.hutool.core.util.StrUtil; -import com.baomidou.mybatisplus.extension.plugins.handler.MultiDataPermissionHandler; -import com.zt.plat.framework.common.biz.system.permission.PermissionCommonApi; -import com.zt.plat.framework.common.biz.system.permission.dto.DeptDataPermissionRespDTO; -import com.zt.plat.framework.common.enums.UserTypeEnum; -import com.zt.plat.framework.common.util.collection.CollectionUtils; -import com.zt.plat.framework.common.util.json.JsonUtils; -import com.zt.plat.framework.mybatis.core.util.MyBatisUtils; -import com.zt.plat.framework.security.core.LoginUser; -import com.zt.plat.framework.security.core.util.SecurityFrameworkUtils; -//import com.zt.plat.module.qms.core.aspect.annotation.QmsPermission; -import com.zt.plat.framework.tenant.core.context.DeptContextHolder; -import lombok.extern.slf4j.Slf4j; -import net.sf.jsqlparser.expression.Alias; -import net.sf.jsqlparser.expression.Expression; -import net.sf.jsqlparser.expression.LongValue; -import net.sf.jsqlparser.expression.NullValue; -import net.sf.jsqlparser.expression.operators.conditional.AndExpression; -import net.sf.jsqlparser.expression.operators.conditional.OrExpression; -import net.sf.jsqlparser.expression.operators.relational.*; -import net.sf.jsqlparser.schema.Column; -import net.sf.jsqlparser.schema.Table; -import net.sf.jsqlparser.statement.select.ParenthesedSelect; -import net.sf.jsqlparser.statement.select.PlainSelect; -import net.sf.jsqlparser.statement.select.SelectItem; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Set; - -import static java.util.Collections.singletonList; - - -/* -* QMS权限处理 -* 1、只能查看自己创建的数据 -* 2、部门领导可查看本部门数据 -* 3、模块管理员可查看本模块数据 -* -* */ -@Component -@Slf4j -public class QMSMultiDataPermissionHandler implements MultiDataPermissionHandler { - - @Autowired private PermissionCommonApi permissionApi; - /** - * LoginUser 的 Context 缓存 Key - */ - protected static final String QMS_PERMISSION_CONTEXT_KEY = "QMS_DATA_PERMISSION"; - static final Expression EXPRESSION_NULL = new NullValue(); - public static final String SYSTEM_USERS = "system_users"; - private static final String SYSTEM_USER_DEPT = "system_user_dept"; - private static final String DEPT_COLUMN_NAME = "dept_id"; - private static final String USER_COLUMN_NAME = "user_id"; - - @Override - public Expression getSqlSegment(Table table, Expression where, String mappedStatementId) { - log.error("QMSMultiDataPermissionHandler: Expression={}", where); - - //获取注解 - if(!QMSPermissionContextHolder.shouldExecute()) - return null; - try{ - Expression expression = buildExpression(table, where); - return expression; - }catch (Exception e){ - log.error("QMSMultiDataPermissionHandler: Expression={}", where); - }finally { - QMSPermissionContextHolder.clear(); - } - return EXPRESSION_NULL; - } - - /* - * 构建权限sql*/ - private Expression buildExpression(Table table, Expression where) { - LoginUser loginUser = SecurityFrameworkUtils.getLoginUser(); - if (loginUser == null) { - return EXPRESSION_NULL; - } - //管理员用户,不进行权限处理 - if (ObjectUtil.notEqual(loginUser.getUserType(), UserTypeEnum.ADMIN.getValue())) { - return null; - } - String deptIdCol = QMSPermissionContextHolder.getDeptIdColumn(); //部门id列 - String userIdCol = QMSPermissionContextHolder.getUserIdColumn(); //人员id列 - String deptDataRoleCodes = QMSPermissionContextHolder.getDeptDataRoleCode(); //部门数据权限角色。具有该角色,然后按角色的权限属性判断。从而获得人员允许查看的部门数据 - String moduleDataRoleCodes = QMSPermissionContextHolder.getModuleDataRoleCodes(); //模块数据权限角色。 - String custom = QMSPermissionContextHolder.getCustom(); //todo 自定义权限 - - List allRoleCode = new ArrayList<>(); - if(!ObjectUtil.isEmpty(deptDataRoleCodes)){ - allRoleCode.addAll(Arrays.asList(deptDataRoleCodes.split( ","))); - } - if(!ObjectUtil.isEmpty(moduleDataRoleCodes)){ - allRoleCode.addAll(Arrays.asList(moduleDataRoleCodes.split( ","))); - } - //查询角色 - - String tableName = MyBatisUtils.getTableName(table); - Alias tableAlias = table.getAlias(); - DeptDataPermissionRespDTO qmsDataPermission = loginUser.getContext(QMS_PERMISSION_CONTEXT_KEY, DeptDataPermissionRespDTO.class); - if(qmsDataPermission == null){ - try{ -// DeptContextHolder.setRoleCodeList(allRoleCode); - qmsDataPermission = permissionApi.getDeptDataPermission(loginUser.getId()).getCheckedData(); - }catch (Exception e){ - log.error("[getExpression][LoginUser({}) 获取角色权限为 null]", JsonUtils.toJsonString(loginUser)); - log.error("", e); - }finally { +//package com.zt.plat.module.qms.framework.datapermission; +// +//import cn.hutool.core.collection.CollUtil; +//import cn.hutool.core.util.ObjectUtil; +//import cn.hutool.core.util.StrUtil; +//import com.alibaba.fastjson.JSONObject; +//import com.baomidou.mybatisplus.extension.plugins.handler.MultiDataPermissionHandler; +//import com.zt.plat.framework.common.biz.system.permission.PermissionCommonApi; +//import com.zt.plat.framework.common.biz.system.permission.dto.DeptDataPermissionRespDTO; +//import com.zt.plat.framework.common.enums.UserTypeEnum; +//import com.zt.plat.framework.common.util.collection.CollectionUtils; +//import com.zt.plat.framework.common.util.json.JsonUtils; +//import com.zt.plat.framework.mybatis.core.util.MyBatisUtils; +//import com.zt.plat.framework.security.core.LoginUser; +//import com.zt.plat.framework.security.core.util.SecurityFrameworkUtils; +////import com.zt.plat.module.qms.core.aspect.annotation.QmsPermission; +//import com.zt.plat.framework.tenant.core.context.DeptContextHolder; +//import lombok.extern.slf4j.Slf4j; +//import net.sf.jsqlparser.expression.Alias; +//import net.sf.jsqlparser.expression.Expression; +//import net.sf.jsqlparser.expression.LongValue; +//import net.sf.jsqlparser.expression.NullValue; +//import net.sf.jsqlparser.expression.operators.conditional.AndExpression; +//import net.sf.jsqlparser.expression.operators.conditional.OrExpression; +//import net.sf.jsqlparser.expression.operators.relational.*; +//import net.sf.jsqlparser.schema.Column; +//import net.sf.jsqlparser.schema.Table; +//import net.sf.jsqlparser.statement.select.ParenthesedSelect; +//import net.sf.jsqlparser.statement.select.PlainSelect; +//import net.sf.jsqlparser.statement.select.SelectItem; +//import org.springframework.beans.factory.annotation.Autowired; +//import org.springframework.stereotype.Component; +// +//import java.util.ArrayList; +//import java.util.Arrays; +//import java.util.List; +//import java.util.Set; +// +//import static java.util.Collections.singletonList; +// +// +///* +//* QMS权限处理 +//* 1、只能查看自己创建的数据 +//* 2、部门领导可查看本部门数据 +//* 3、模块管理员可查看本模块数据 +//* +//* */ +//@Component +//@Slf4j +//public class QMSMultiDataPermissionHandler implements MultiDataPermissionHandler { +// +// @Autowired private PermissionCommonApi permissionApi; +// /** +// * LoginUser 的 Context 缓存 Key +// */ +// protected static final String QMS_PERMISSION_CONTEXT_KEY = "QMS_DATA_PERMISSION"; +// static final Expression EXPRESSION_NULL = new NullValue(); +// public static final String SYSTEM_USERS = "system_users"; +// private static final String SYSTEM_USER_DEPT = "system_user_dept"; +// private static final String DEPT_COLUMN_NAME = "dept_id"; +// private static final String USER_COLUMN_NAME = "user_id"; +// +// @Override +// public Expression getSqlSegment(Table table, Expression where, String mappedStatementId) { +// log.error("QMSMultiDataPermissionHandler: Expression={}", where); +// +// //获取注解 +// if(!QMSPermissionContextHolder.shouldExecute()) +// return null; +// try{ +// Expression expression = buildExpression(table, where); +// return expression; +// }catch (Exception e){ +// log.error("QMSMultiDataPermissionHandler: Expression={}", where); +// }finally { +// QMSPermissionContextHolder.clear(); +// } +// return EXPRESSION_NULL; +// } +// +// /* +// * 构建权限sql*/ +// private Expression buildExpression(Table table, Expression where) { +// LoginUser loginUser = SecurityFrameworkUtils.getLoginUser(); +// if (loginUser == null) { +// return EXPRESSION_NULL; +// } +// //管理员用户,不进行权限处理 +// if (ObjectUtil.notEqual(loginUser.getUserType(), UserTypeEnum.ADMIN.getValue())) { +// return null; +// } +// String deptIdCol = QMSPermissionContextHolder.getDeptIdColumn(); //部门id列 +// String userIdCol = QMSPermissionContextHolder.getUserIdColumn(); //人员id列 +// String deptDataRoleCodes = QMSPermissionContextHolder.getDeptDataRoleCode(); //部门数据权限角色。具有该角色,然后按角色的权限属性判断。从而获得人员允许查看的部门数据 +// String moduleDataRoleCodes = QMSPermissionContextHolder.getModuleDataRoleCodes(); //模块数据权限角色。 +// String custom = QMSPermissionContextHolder.getCustom(); //todo 自定义权限 +// +// List allRoleCode = new ArrayList<>(); +// if(!ObjectUtil.isEmpty(deptDataRoleCodes)){ +// allRoleCode.addAll(Arrays.asList(deptDataRoleCodes.split( ","))); +// } +// if(!ObjectUtil.isEmpty(moduleDataRoleCodes)){ +// allRoleCode.addAll(Arrays.asList(moduleDataRoleCodes.split( ","))); +// } +// String roleCodes = CollUtil.join(allRoleCode, ","); +// String tableName = MyBatisUtils.getTableName(table); +// Alias tableAlias = table.getAlias(); +// DeptDataPermissionRespDTO qmsDataPermission = loginUser.getContext(QMS_PERMISSION_CONTEXT_KEY, DeptDataPermissionRespDTO.class); +// if(qmsDataPermission == null){ +// try{ +// qmsDataPermission = permissionApi.getDeptDataPermissionWithRoleCodes(loginUser.getId(), roleCodes).getCheckedData(); +// }catch (Exception e){ +// log.error("[getExpression][LoginUser({}) 获取角色权限为 null]", JsonUtils.toJsonString(loginUser)); +// log.error("", e); +// }finally { // DeptContextHolder.clearRoleCodeList(); - } - - if (qmsDataPermission == null) { - log.error("[getExpression][LoginUser({}) 获取数据权限为 null]", JsonUtils.toJsonString(loginUser)); - throw new NullPointerException(String.format("LoginUser(%d) Table(%s/%s) 未返回数据权限", loginUser.getId(), tableName, tableAlias.getName())); - } - // 添加到上下文中,避免重复计算 - loginUser.setContext(QMS_PERMISSION_CONTEXT_KEY, qmsDataPermission); - } - Long ctxDeptId = DeptContextHolder.getDeptId(); - // 计算有效的部门与自查标记:当存在上下文部门且未被忽略时,强制仅使用该部门,以避免默认全量或空权限分支 - Set effectiveDeptIds = qmsDataPermission.getDeptIds(); - Boolean effectiveSelf = qmsDataPermission.getSelf(); - if (!DeptContextHolder.shouldIgnore() && ctxDeptId != null && ctxDeptId > 0L) { - effectiveDeptIds = CollUtil.newHashSet(ctxDeptId); - } - // 情况一:仅当不存在上下文部门时,且 ALL 可查看全部,才无需拼接条件;若存在上下文部门则仍需基于该部门过滤 - if (ctxDeptId == null && qmsDataPermission.getAll()) { - return null; - } - - // 情况二:仅在有效部门集合为空且不可查看自己时,才认为无权限;若上下文提供部门,则跳过该兜底 - if (CollUtil.isEmpty(effectiveDeptIds) && Boolean.FALSE.equals(effectiveSelf)) { - return new EqualsTo(null, null); // WHERE null = null,可以保证返回的数据为空 - } - - // 情况三,拼接 Dept 和 Company User 的条件,最后组合 - Expression deptExpression = buildDeptExpression(tableName, deptIdCol, tableAlias, effectiveDeptIds); - Expression userExpression = buildUserExpression(tableName, userIdCol, tableAlias, effectiveSelf, loginUser.getId()); - if (deptExpression == null && userExpression == null) { - // TODO:获得不到条件的时候,暂时不抛出异常,而是不返回数据 - log.warn("[getExpression][LoginUser({}) Table({}/{}) DeptDataPermission({}) 构建的条件为空]", - JsonUtils.toJsonString(loginUser), tableName, tableAlias, JsonUtils.toJsonString(qmsDataPermission)); -// throw new NullPointerException(String.format("LoginUser(%d) Table(%s/%s) 构建的条件为空", -// loginUser.getId(), tableName, tableAlias.getName())); - return null; - } - if (deptExpression == null) { - return userExpression; - } - if (userExpression == null) { - return deptExpression; - } - // 目前,如果有指定部门 + 可查看自己,采用 OR 条件。即,WHERE (dept_id IN ? OR user_id = ?) - return new ParenthesedExpressionList(new OrExpression(deptExpression, userExpression)); - } - - private Expression buildDeptExpression(String tableName, String columnName, Alias tableAlias, Set deptIds) { - // 特殊处理:system_users 表没有 dept_id 字段,已经迁移到了 user_dept 表 - if (SYSTEM_USERS.equals(tableName)) { - // system_users 走 exists 子查询 user_dept - if (CollUtil.isEmpty(deptIds)) { - return null; - } - // 构造 exists (select 1 from user_dept where user_dept.user_id = system_users.id and user_dept.dept_id in (...)) - PlainSelect plainSelect = new PlainSelect(); - plainSelect.setSelectItems(singletonList(new SelectItem<>(new LongValue(1)))); - Table userDept = new Table(SYSTEM_USER_DEPT); - // 使用 user 表别名避免语法错误 - Table user = new Table(tableAlias == null ? tableName : tableAlias.getName()); - plainSelect.setFromItem(userDept); - // where user_dept.user_id = system_users.id and user_dept.dept_id in (...) - Column userDeptUserIdCol = new Column(userDept, USER_COLUMN_NAME); - Column systemUsersIdCol = new Column(user, "id"); - EqualsTo userIdEquals = new EqualsTo(userDeptUserIdCol, systemUsersIdCol); - Column userDeptDeptIdCol = new Column(userDept, DEPT_COLUMN_NAME); - InExpression deptIn = new InExpression(userDeptDeptIdCol, new ParenthesedExpressionList<>(new ExpressionList<>(CollectionUtils.convertList(deptIds, LongValue::new)))); - Expression whereExp = new AndExpression(userIdEquals, deptIn); - plainSelect.setWhere(whereExp); - // - ParenthesedSelect parenthesedSelect = new ParenthesedSelect(); - parenthesedSelect.setSelect(plainSelect); - // 构建 exists 表达式 - ExistsExpression existsExpr = new ExistsExpression(); - existsExpr.setRightExpression(parenthesedSelect); - return existsExpr; - } - if (StrUtil.isEmpty(columnName)) { - return null; - } - // 如果为空,则无条件 - if (CollUtil.isEmpty(deptIds)) { - return null; - } - // 拼接条件 - return new InExpression(MyBatisUtils.buildColumn(tableName, tableAlias, columnName), - // Parenthesis 的目的,是提供 (1,2,3) 的 () 左右括号 - new ParenthesedExpressionList(new ExpressionList(CollectionUtils.convertList(deptIds, LongValue::new)))); - } - - private Expression buildUserExpression(String tableName, String columnName, Alias tableAlias, Boolean self, Long userId) { - // 如果不查看自己,则无需作为条件 - if (Boolean.FALSE.equals(self)) { - return null; - } - if (StrUtil.isEmpty(columnName)) { - return null; - } - // 拼接条件 - return new EqualsTo(MyBatisUtils.buildColumn(tableName, tableAlias, columnName), new LongValue(userId)); - } - - /* - * */ - private DeptDataPermissionRespDTO getQmsDataPermission(){ - return null; - } - -} +// } +// +// if (qmsDataPermission == null) { +// log.error("[getExpression][LoginUser({}) 获取数据权限为 null]", JsonUtils.toJsonString(loginUser)); +// throw new NullPointerException(String.format("LoginUser(%d) Table(%s/%s) 未返回数据权限", loginUser.getId(), tableName, tableAlias.getName())); +// } +// // 添加到上下文中,避免重复计算 +// loginUser.setContext(QMS_PERMISSION_CONTEXT_KEY, qmsDataPermission); +// } +// Long ctxDeptId = DeptContextHolder.getDeptId(); +// // 计算有效的部门与自查标记:当存在上下文部门且未被忽略时,强制仅使用该部门,以避免默认全量或空权限分支 +// Set effectiveDeptIds = qmsDataPermission.getDeptIds(); +// Boolean effectiveSelf = qmsDataPermission.getSelf(); +// if (!DeptContextHolder.shouldIgnore() && ctxDeptId != null && ctxDeptId > 0L) { +// effectiveDeptIds = CollUtil.newHashSet(ctxDeptId); +// } +// // 情况一:仅当不存在上下文部门时,且 ALL 可查看全部,才无需拼接条件;若存在上下文部门则仍需基于该部门过滤 +// if (ctxDeptId == null && qmsDataPermission.getAll()) { +// return null; +// } +// +// // 情况二:仅在有效部门集合为空且不可查看自己时,才认为无权限;若上下文提供部门,则跳过该兜底 +// if (CollUtil.isEmpty(effectiveDeptIds) && Boolean.FALSE.equals(effectiveSelf)) { +// return new EqualsTo(null, null); // WHERE null = null,可以保证返回的数据为空 +// } +// +// // 情况三,拼接 Dept 和 Company User 的条件,最后组合 +// Expression deptExpression = buildDeptExpression(tableName, deptIdCol, tableAlias, effectiveDeptIds); +// Expression userExpression = buildUserExpression(tableName, userIdCol, tableAlias, effectiveSelf, loginUser.getId()); +// if (deptExpression == null && userExpression == null) { +// // TODO:获得不到条件的时候,暂时不抛出异常,而是不返回数据 +// log.warn("[getExpression][LoginUser({}) Table({}/{}) DeptDataPermission({}) 构建的条件为空]", +// JsonUtils.toJsonString(loginUser), tableName, tableAlias, JsonUtils.toJsonString(qmsDataPermission)); +//// throw new NullPointerException(String.format("LoginUser(%d) Table(%s/%s) 构建的条件为空", +//// loginUser.getId(), tableName, tableAlias.getName())); +// return null; +// } +// if (deptExpression == null) { +// return userExpression; +// } +// if (userExpression == null) { +// return deptExpression; +// } +// // 目前,如果有指定部门 + 可查看自己,采用 OR 条件。即,WHERE (dept_id IN ? OR user_id = ?) +// return new ParenthesedExpressionList(new OrExpression(deptExpression, userExpression)); +// } +// +// private Expression buildDeptExpression(String tableName, String columnName, Alias tableAlias, Set deptIds) { +// // 特殊处理:system_users 表没有 dept_id 字段,已经迁移到了 user_dept 表 +// if (SYSTEM_USERS.equals(tableName)) { +// // system_users 走 exists 子查询 user_dept +// if (CollUtil.isEmpty(deptIds)) { +// return null; +// } +// // 构造 exists (select 1 from user_dept where user_dept.user_id = system_users.id and user_dept.dept_id in (...)) +// PlainSelect plainSelect = new PlainSelect(); +// plainSelect.setSelectItems(singletonList(new SelectItem<>(new LongValue(1)))); +// Table userDept = new Table(SYSTEM_USER_DEPT); +// // 使用 user 表别名避免语法错误 +// Table user = new Table(tableAlias == null ? tableName : tableAlias.getName()); +// plainSelect.setFromItem(userDept); +// // where user_dept.user_id = system_users.id and user_dept.dept_id in (...) +// Column userDeptUserIdCol = new Column(userDept, USER_COLUMN_NAME); +// Column systemUsersIdCol = new Column(user, "id"); +// EqualsTo userIdEquals = new EqualsTo(userDeptUserIdCol, systemUsersIdCol); +// Column userDeptDeptIdCol = new Column(userDept, DEPT_COLUMN_NAME); +// InExpression deptIn = new InExpression(userDeptDeptIdCol, new ParenthesedExpressionList<>(new ExpressionList<>(CollectionUtils.convertList(deptIds, LongValue::new)))); +// Expression whereExp = new AndExpression(userIdEquals, deptIn); +// plainSelect.setWhere(whereExp); +// // +// ParenthesedSelect parenthesedSelect = new ParenthesedSelect(); +// parenthesedSelect.setSelect(plainSelect); +// // 构建 exists 表达式 +// ExistsExpression existsExpr = new ExistsExpression(); +// existsExpr.setRightExpression(parenthesedSelect); +// return existsExpr; +// } +// if (StrUtil.isEmpty(columnName)) { +// return null; +// } +// // 如果为空,则无条件 +// if (CollUtil.isEmpty(deptIds)) { +// return null; +// } +// // 拼接条件 +// return new InExpression(MyBatisUtils.buildColumn(tableName, tableAlias, columnName), +// // Parenthesis 的目的,是提供 (1,2,3) 的 () 左右括号 +// new ParenthesedExpressionList(new ExpressionList(CollectionUtils.convertList(deptIds, LongValue::new)))); +// } +// +// private Expression buildUserExpression(String tableName, String columnName, Alias tableAlias, Boolean self, Long userId) { +// // 如果不查看自己,则无需作为条件 +// if (Boolean.FALSE.equals(self)) { +// return null; +// } +// if (StrUtil.isEmpty(columnName)) { +// return null; +// } +// // 拼接条件 +// return new EqualsTo(MyBatisUtils.buildColumn(tableName, tableAlias, columnName), new LongValue(userId)); +// } +// +// /* +// * */ +// private DeptDataPermissionRespDTO getQmsDataPermission(){ +// return null; +// } +// +//} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/framework/mybatis/QMSDataPermissionConfig.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/framework/mybatis/QMSDataPermissionConfig.java index d1610e2..3bf9f88 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/framework/mybatis/QMSDataPermissionConfig.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/framework/mybatis/QMSDataPermissionConfig.java @@ -1,42 +1,42 @@ -package com.zt.plat.module.qms.framework.mybatis; - - -import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor; -import com.baomidou.mybatisplus.extension.plugins.inner.DataPermissionInterceptor; -import com.baomidou.mybatisplus.extension.plugins.inner.InnerInterceptor; -import com.zt.plat.module.qms.framework.datapermission.QMSMultiDataPermissionHandler; -import jakarta.annotation.PostConstruct; -import org.aspectj.lang.annotation.After; -import org.springframework.beans.factory.SmartInitializingSingleton; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Configuration; - -import java.util.List; - -//@Configuration -public class QMSDataPermissionConfig implements SmartInitializingSingleton { - @Autowired - private MybatisPlusInterceptor mybatisPlusInterceptor; - - @Autowired - private QMSMultiDataPermissionHandler qmsMultiDataPermissionHandler; - - @Override - public void afterSingletonsInstantiated() { - List interceptors = mybatisPlusInterceptor.getInterceptors(); - // 避免重复注册 - boolean exists = interceptors.stream() - .filter(i -> i instanceof DataPermissionInterceptor) - .map(i -> (DataPermissionInterceptor) i) - .anyMatch(i -> i.getDataPermissionHandler() == qmsMultiDataPermissionHandler); - if (!exists) { - mybatisPlusInterceptor.addInnerInterceptor(new DataPermissionInterceptor(qmsMultiDataPermissionHandler)); - } - } - -// @PostConstruct -// public void addDataPermissionInterceptor() { +//package com.zt.plat.module.qms.framework.mybatis; // +// +//import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor; +//import com.baomidou.mybatisplus.extension.plugins.inner.DataPermissionInterceptor; +//import com.baomidou.mybatisplus.extension.plugins.inner.InnerInterceptor; +//import com.zt.plat.module.qms.framework.datapermission.QMSMultiDataPermissionHandler; +//import jakarta.annotation.PostConstruct; +//import org.aspectj.lang.annotation.After; +//import org.springframework.beans.factory.SmartInitializingSingleton; +//import org.springframework.beans.factory.annotation.Autowired; +//import org.springframework.context.annotation.Configuration; +// +//import java.util.List; +// +//@Configuration +//public class QMSDataPermissionConfig implements SmartInitializingSingleton { +// @Autowired +// private MybatisPlusInterceptor mybatisPlusInterceptor; +// +// @Autowired +// private QMSMultiDataPermissionHandler qmsMultiDataPermissionHandler; +// +// @Override +// public void afterSingletonsInstantiated() { +// List interceptors = mybatisPlusInterceptor.getInterceptors(); +// // 避免重复注册 +// boolean exists = interceptors.stream() +// .filter(i -> i instanceof DataPermissionInterceptor) +// .map(i -> (DataPermissionInterceptor) i) +// .anyMatch(i -> i.getDataPermissionHandler() == qmsMultiDataPermissionHandler); +// if (!exists) { +// mybatisPlusInterceptor.addInnerInterceptor(new DataPermissionInterceptor(qmsMultiDataPermissionHandler)); +// } // } - -} +// +//// @PostConstruct +//// public void addDataPermissionInterceptor() { +//// +//// } +// +//} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/clientManage/controller/admin/VersionManagementController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/clientManage/controller/admin/VersionManagementController.java index ddb9572..f859937 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/clientManage/controller/admin/VersionManagementController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/clientManage/controller/admin/VersionManagementController.java @@ -1,5 +1,7 @@ package com.zt.plat.module.qms.resource.clientManage.controller.admin; +import com.zt.plat.module.infra.api.file.FileApi; +import com.zt.plat.module.infra.api.file.dto.FileRespDTO; import com.zt.plat.module.qms.resource.clientManage.controller.vo.VersionManagementPageReqVO; import com.zt.plat.module.qms.resource.clientManage.controller.vo.VersionManagementRespVO; import com.zt.plat.module.qms.resource.clientManage.controller.vo.VersionManagementSaveReqVO; @@ -54,6 +56,9 @@ public class VersionManagementController extends AbstractFileUploadController im @Resource private VersionManagementService systemVersionManagementService; + + @Resource + private FileApi fileApi; @PostMapping("/create") @Operation(summary = "创建客户端版本管理") @@ -138,6 +143,14 @@ public class VersionManagementController extends AbstractFileUploadController im String log = ""; if (pageResult.getList().size() != 0) { VersionManagementDO versionManagementDO = pageResult.getList().get(0); + //处理文件下载url + Long fileId = Long.parseLong(versionManagementDO.getDownloadId()); + CommonResult fileRet = fileApi.getFileInfo(fileId); + FileRespDTO file = fileRet.getData(); + if(fileRet.isSuccess() && file != null) { + versionManagementDO.setDownloadUrl(file.getUrl()); + } + version = versionManagementDO.getCurrentVersion(); minVersion = versionManagementDO.getMinimumVersion(); url = versionManagementDO.getDownloadUrl(); @@ -165,6 +178,13 @@ public class VersionManagementController extends AbstractFileUploadController im return CommonResult.error(400, "没有可更新版本"); } VersionManagementDO versionManagementDO = pageResult.getList().get(0); + //处理文件下载url + Long fileId = Long.parseLong(versionManagementDO.getDownloadId()); + CommonResult fileRet = fileApi.getFileInfo(fileId); + FileRespDTO file = fileRet.getData(); + if(fileRet.isSuccess() && file != null) { + versionManagementDO.setDownloadUrl(file.getUrl()); + } return success(BeanUtils.toBean(versionManagementDO, VersionManagementRespVO.class)); } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceInfomationMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceInfomationMapper.java index a2f89c0..4acbce6 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceInfomationMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceInfomationMapper.java @@ -21,7 +21,7 @@ import java.util.Map; @Mapper public interface DeviceInfomationMapper extends BaseMapperX { - @QmsPermission(deptDataRoleCodes = "") + @QmsPermission(deptDataRoleCodes = "ytjyDeptAndSub", moduleDataRoleCodes = "qms_device_manager") default PageResult selectPage(DeviceInfomationPageReqVO reqVO) { return selectPage(reqVO, new LambdaQueryWrapperX() .eqIfPresent(DeviceInfomationDO::getProductId, reqVO.getProductId()) diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubParentSampleAssessmentProjectMapper.xml b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubParentSampleAssessmentProjectMapper.xml index e80a189..4697ff8 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubParentSampleAssessmentProjectMapper.xml +++ b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubParentSampleAssessmentProjectMapper.xml @@ -40,6 +40,7 @@ AND tcam.ASY_DEPT_ID = tbssag.ASY_DEPT_ID WHERE tbssa.DELETED = 0 + AND tbspsa.DELETED = 0 AND tbssa.RPOD_STS = 'reported' AND tbspsa.IS_RPOD = 0 From b529df9860a33c61c998205bc6f029bb4d262765 Mon Sep 17 00:00:00 2001 From: ranke <213539@qq.com> Date: Thu, 15 Jan 2026 09:18:02 +0800 Subject: [PATCH 10/11] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=8F=B7,=E6=96=B0=E5=A2=9E=E5=BF=AB=E7=85=A7=E5=8F=91?= =?UTF-8?q?=E5=B8=83=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pom.xml b/pom.xml index f2b9cd2..ea91f8d 100644 --- a/pom.xml +++ b/pom.xml @@ -17,7 +17,7 @@ https://github.com/YunaiV/ruoyi-vue-pro - 3.0.46 + 3.0.47-SNAPSHOT 17 ${java.version} @@ -161,11 +161,11 @@ 中铜 ZStack 私服 http://172.16.46.63:30708/repository/test/ - - - - - + + ZT-snap + 中铜 ZStack 私服 + http://172.16.46.63:30708/repository/test-snap/ + From 7d8b8c55f1baa36799af37617fd1a0c8220d7403 Mon Sep 17 00:00:00 2001 From: ranke <213539@qq.com> Date: Thu, 15 Jan 2026 10:03:48 +0800 Subject: [PATCH 11/11] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=A7=81=E6=9C=8D?= =?UTF-8?q?=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index ea91f8d..709b3da 100644 --- a/pom.xml +++ b/pom.xml @@ -143,7 +143,7 @@ ZT 中铜 ZStack 私服 - http://172.16.46.63:30708/repository/test/ + http://172.16.46.63:30708/repository/zt-cloud/ always warn