Compare commits
38 Commits
ac44920fa7
...
test
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a96fa0ed9b | ||
|
|
8121c7a97f | ||
| a8330ade63 | |||
| e9259122b7 | |||
| fbd13f50d4 | |||
|
|
58ab9961c4 | ||
| 3302a2ee7c | |||
|
|
1bbfa9a950 | ||
|
|
57bf9b0cd5 | ||
|
|
5bf435b08e | ||
|
|
3bf8ee09b7 | ||
|
|
4444d9e3c0 | ||
| 9348c33f1b | |||
| 969fb2edf7 | |||
| e6d08d975f | |||
| 3cd25f68ef | |||
|
|
5a03ed1cab | ||
|
|
1c5588a05a | ||
|
|
2111c8b3ad | ||
|
|
675e1fe850 | ||
|
|
c7d4399e53 | ||
|
|
2fae2ccac2 | ||
|
|
533b96fb6a | ||
|
|
525d588c20 | ||
| be2f28cef5 | |||
| ce9aff5583 | |||
|
|
71206f43a3 | ||
|
|
0d164c660e | ||
| 2336c370fa | |||
| a578426458 | |||
| 892596fc2e | |||
| 50a868e0a0 | |||
|
|
99b6521c19 | ||
|
|
215ec8b5aa | ||
| b408d1e726 | |||
| 23babc6795 | |||
|
|
6d7caf5738 | ||
|
|
3cb93ce84c |
37
pom.xml
37
pom.xml
@@ -18,6 +18,9 @@
|
||||
|
||||
<properties>
|
||||
<revision>3.0.47-SNAPSHOT</revision>
|
||||
<!-- qms服务相关 -->
|
||||
<zzjc.tio.version>3.9.1.v20251204-RELEASE</zzjc.tio.version>
|
||||
<liteflow.version>2.15.3</liteflow.version>
|
||||
<!-- Maven 相关 -->
|
||||
<java.version>17</java.version>
|
||||
<maven.compiler.source>${java.version}</maven.compiler.source>
|
||||
@@ -41,6 +44,40 @@
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- liteflow -->
|
||||
<dependency>
|
||||
<groupId>com.yomahub</groupId>
|
||||
<artifactId>liteflow-spring-boot-starter</artifactId>
|
||||
<version>${liteflow.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.yomahub</groupId>
|
||||
<artifactId>liteflow-script-javax-pro</artifactId>
|
||||
<version>${liteflow.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.yomahub</groupId>
|
||||
<artifactId>liteflow-script-groovy</artifactId>
|
||||
<version>${liteflow.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.yomahub</groupId>
|
||||
<artifactId>liteflow-script-qlexpress</artifactId>
|
||||
<version>${liteflow.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.yomahub</groupId>
|
||||
<artifactId>liteflow-script-graaljs</artifactId>
|
||||
<version>${liteflow.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- tio -->
|
||||
<dependency>
|
||||
<groupId>tech.zzjc.tio</groupId>
|
||||
<artifactId>zzjc-tio-spring-boot-starter</artifactId>
|
||||
<version>${zzjc.tio.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
|
||||
@@ -171,24 +171,33 @@ public interface ErrorCodeConstants {
|
||||
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_INFOMATION_NOT_EXISTS = new ErrorCode(1_032_160_000, "试剂耗材不存在");
|
||||
ErrorCode MATERIAL_PRODUCT_NOT_EXISTS = new ErrorCode(1_032_160_000, "物料分类/大类不存在");
|
||||
ErrorCode MATERIAL_PRODUCT_PARENT_NOT_EXISTS = new ErrorCode(1_032_160_000, "物料分类/大类的父类不存在");
|
||||
ErrorCode MATERIAL_PRODUCT_CODE_EXISTED = new ErrorCode(1_032_160_000, "物料大类编码重复");
|
||||
ErrorCode MATERIAL_CATEGORY_EXISTS_CHILDREN = new ErrorCode(1_032_160_000, "分类下含有子分类或物料大类,不可删除");
|
||||
ErrorCode MATERIAL_PRODUCT_EXISTS_BATCH = new ErrorCode(1_032_160_000, "物料大类下存在物料批次,不可删除");
|
||||
ErrorCode MATERIAL_PRODUCTS_EXISTS_CATEGORY = new ErrorCode(1_032_160_000, "物料大类列表中存在分类数据");
|
||||
ErrorCode MATERIAL_LIFECYCLE_DETAIL_NOT_EXISTS = new ErrorCode(1_032_160_000, "物料通用流程明细不存在");
|
||||
ErrorCode MATERIAL_LIFECYCLE_NOT_EXISTS = new ErrorCode(1_032_160_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 MATERIAL_BATCH_NOT_EXISTS = new ErrorCode(1_032_160_000, "物料批次不存在");
|
||||
ErrorCode MATERIAL_BATCH_ASSIGN_END = new ErrorCode(1_032_160_000, "物料批次已拆分,不可操作");
|
||||
ErrorCode GONGDUAN_BELONG_MATERIAL_BATCH_NOT_EQUAL = new ErrorCode(1_032_160_000, "工段所属的物料批次不一致");
|
||||
ErrorCode GONGDUAN_QUANTITY_MATERIAL_BATCH_NOT_EQUAL = new ErrorCode(1_032_160_000, "工段累加数量和批次数量不一致");
|
||||
ErrorCode MATERIAL_BATCH_NOT_ASSIGN_FOR_SUBMIT = new ErrorCode(1_032_160_000, "物料批次未拆分,不可提交");
|
||||
ErrorCode MATERIAL_BATCH_ASSIGN_NOT_EXISTS = new ErrorCode(1_032_160_000, "物料批次分发不存在");
|
||||
ErrorCode MATERIAL_INVENTORY_INBOUND_NOT_EXISTS = new ErrorCode(1_032_160_000, "入库,出库不存在");
|
||||
ErrorCode MATERIAL_INVENTORY_INBOUND_DETAIL_NOT_EXISTS = new ErrorCode(1_032_160_000, "入库明细,出库明细等不存在");
|
||||
|
||||
ErrorCode SYSTEM_VERSION_MANAGEMENT_NOT_EXISTS = new ErrorCode(1_032_150_000, "客户端版本管理不存在");
|
||||
ErrorCode SYSTEM_VERSION_MANAGEMENT_NOT_EXISTS = new ErrorCode(1_032_160_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, "出库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等不存在");
|
||||
ErrorCode MATERIAL_LOCATION_NOT_EXISTS = new ErrorCode(1_032_160_000, "存放位置不存在");
|
||||
ErrorCode MATERIAL_INVENTORY_CHECK_NOT_EXISTS = new ErrorCode(1_032_160_000, "库存盘点不存在");
|
||||
ErrorCode MATERIAL_INVENTORY_CHECK_BATCH_NOT_EXISTS = new ErrorCode(1_032_160_000, "库存盘点项不存在");
|
||||
ErrorCode MATERIAL_INVENTORY_CHECK_DETAIL_NOT_EXISTS = new ErrorCode(1_032_160_000, "库存盘点明细不存在");
|
||||
ErrorCode MATERIAL_INVENTORY_OUTBOUND_NOT_EXISTS = new ErrorCode(1_032_160_000, "出库不存在");
|
||||
ErrorCode MATERIAL_INVENTORY_OUTBOUND_DETAIL_NOT_EXISTS = new ErrorCode(1_032_160_000, "出库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等不存在");
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -207,7 +207,9 @@ public interface QmsCommonConstant {
|
||||
|
||||
/** 允许提交 **/
|
||||
String ALLOW_SUBMIT = "allow_submit";
|
||||
|
||||
/** 临时数据标识 **/
|
||||
String TEMP_DATA_CODE = "-1";
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -16,9 +16,12 @@ public interface QmsPermissionConstant {
|
||||
//目标权限类型-自定义
|
||||
String TARGET_TYPE_CUSTOM = "custom";
|
||||
|
||||
String DEPT_DATA_AND_SUB = "ytjyDeptAndSub"; //部门
|
||||
|
||||
//======================各业务模块权限常量=============================
|
||||
|
||||
String REPORT_DOCUMENT_TYPE_START = "report_document_type_start"; //报告发起权限
|
||||
String SAMPLE_WAREHOUSE_ADMIN = "sample_warehouse_admin"; //样品库管理员
|
||||
|
||||
String DEVICE_MANAGER = "qms_device_manager"; //设备管理员
|
||||
}
|
||||
|
||||
@@ -16,10 +16,7 @@
|
||||
<description>
|
||||
QMS模块。
|
||||
</description>
|
||||
<properties>
|
||||
<zzjc.tio.version>3.9.1.v20251204-RELEASE</zzjc.tio.version>
|
||||
<liteflow.version>2.15.2</liteflow.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<!-- Spring Cloud 基础 -->
|
||||
<dependency>
|
||||
@@ -142,27 +139,22 @@
|
||||
<dependency>
|
||||
<groupId>com.yomahub</groupId>
|
||||
<artifactId>liteflow-spring-boot-starter</artifactId>
|
||||
<version>${liteflow.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.yomahub</groupId>
|
||||
<artifactId>liteflow-script-javax-pro</artifactId>
|
||||
<version>${liteflow.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.yomahub</groupId>
|
||||
<artifactId>liteflow-script-groovy</artifactId>
|
||||
<version>${liteflow.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.yomahub</groupId>
|
||||
<artifactId>liteflow-script-qlexpress</artifactId>
|
||||
<version>${liteflow.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.yomahub</groupId>
|
||||
<artifactId>liteflow-script-graaljs</artifactId>
|
||||
<version>${liteflow.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- pdfbox -->
|
||||
@@ -199,7 +191,6 @@
|
||||
<dependency>
|
||||
<groupId>tech.zzjc.tio</groupId>
|
||||
<artifactId>zzjc-tio-spring-boot-starter</artifactId>
|
||||
<version>${zzjc.tio.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
||||
@@ -29,6 +29,8 @@ 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.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.BusinessHandoverRecordSubDO;
|
||||
import com.zt.plat.module.qms.business.bus.service.BusinessHandoverRecordSubService;
|
||||
@@ -92,6 +94,11 @@ public class BusinessHandoverRecordSubController implements BusinessControllerMa
|
||||
@Operation(summary = "获得子样交接记录业务分页")
|
||||
//@PreAuthorize("@ss.hasPermission('qms:business-handover-record-sub:query')")
|
||||
public CommonResult<PageResult<BusinessHandoverRecordSubExtendRespVO>> getBusinessHandoverRecordSubPage(@Valid BusinessHandoverRecordSubPageReqVO pageReqVO) {
|
||||
if (pageReqVO.getDeptId() == null) {
|
||||
//当前登录用户
|
||||
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
|
||||
pageReqVO.setDeptId(loginUser.getVisitDeptId());
|
||||
}
|
||||
PageResult<BusinessHandoverRecordSubExtendRespVO> pageResult = businessHandoverRecordSubService.getBusinessHandoverRecordSubPage(pageReqVO);
|
||||
return success(pageResult);
|
||||
}
|
||||
|
||||
@@ -28,6 +28,8 @@ 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.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.BusinessSampleHandoverDO;
|
||||
import com.zt.plat.module.qms.business.bus.service.BusinessSampleHandoverService;
|
||||
@@ -100,6 +102,11 @@ public class BusinessSampleHandoverController {
|
||||
@Operation(summary = "获得样品交接单业务分页")
|
||||
//@PreAuthorize("@ss.hasPermission('qms:business-sample-handover:query')")
|
||||
public CommonResult<PageResult<BusinessSampleHandoverRespVO>> getBusinessSampleHandoverPage(@Valid BusinessSampleHandoverPageReqVO pageReqVO) {
|
||||
if (pageReqVO.getDeptId() == null) {
|
||||
//当前登录用户
|
||||
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
|
||||
pageReqVO.setDeptId(loginUser.getVisitDeptId());
|
||||
}
|
||||
PageResult<BusinessSampleHandoverDO> pageResult = businessSampleHandoverService.getBusinessSampleHandoverPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, BusinessSampleHandoverRespVO.class));
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ 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.controller.vo.BatchAssessmentDataReportingReqVO.BusinessSubSampleIdAndRetestCount;
|
||||
import com.zt.plat.module.qms.business.bus.service.SampleAnalysisAuditService;
|
||||
import com.zt.plat.module.qms.enums.QmsCommonConstant;
|
||||
|
||||
@@ -39,7 +40,7 @@ public class SampleAnalysisAuditController implements BusinessControllerMarker {
|
||||
*/
|
||||
@PostMapping("/crossAudit")
|
||||
public CommonResult<?> crossAudit(Long businessAssayTaskId, String auditStatus) {
|
||||
sampleAnalysisAuditService.crossAuditByByTaskId(businessAssayTaskId, auditStatus);
|
||||
sampleAnalysisAuditService.crossAuditByTaskId(businessAssayTaskId, auditStatus);
|
||||
return success("成功");
|
||||
}
|
||||
|
||||
@@ -88,23 +89,23 @@ public class SampleAnalysisAuditController implements BusinessControllerMarker {
|
||||
|
||||
//判定数据上报
|
||||
@PostMapping("/assessmentDataReporting")
|
||||
public CommonResult<?> assessmentDataReporting(Long businessSubSampleId, Long configAssayMethodId) {
|
||||
sampleAnalysisAuditService.assessmentDataReporting(businessSubSampleId, configAssayMethodId);
|
||||
public CommonResult<?> assessmentDataReporting(Long businessSubSampleId, Long configAssayMethodId, Integer retestCount) {
|
||||
sampleAnalysisAuditService.assessmentDataReporting(businessSubSampleId, configAssayMethodId, retestCount);
|
||||
return success("成功");
|
||||
}
|
||||
|
||||
@PostMapping("/batchAssessmentDataReporting")
|
||||
public CommonResult<?> batchAssessmentDataReporting(@RequestBody BatchAssessmentDataReportingReqVO reqVO) {
|
||||
for (Long businessSubSampleId : reqVO.getBusinessSubSampleIds()) {
|
||||
sampleAnalysisAuditService.assessmentDataReporting(businessSubSampleId, reqVO.getConfigAssayMethodId());
|
||||
for (BusinessSubSampleIdAndRetestCount businessSubSampleIdAndRetestCount : reqVO.getBusinessSubSampleIdAndRetestCounts()) {
|
||||
sampleAnalysisAuditService.assessmentDataReporting(businessSubSampleIdAndRetestCount.getBusinessSubSampleId(), reqVO.getConfigAssayMethodId(), businessSubSampleIdAndRetestCount.getRetestCount());
|
||||
}
|
||||
return success("成功");
|
||||
}
|
||||
|
||||
//重新创建复检委托
|
||||
@PostMapping("/createReAnalysis")
|
||||
public CommonResult<?> createReAnalysis(Long businessSubSampleId, Long configAssayMethodId) {
|
||||
sampleAnalysisAuditService.createReAnalysis(businessSubSampleId, configAssayMethodId);
|
||||
public CommonResult<?> createReAnalysis(Long businessSubSampleId, Long configAssayMethodId, Integer retestCount) {
|
||||
sampleAnalysisAuditService.createReAnalysis(businessSubSampleId, configAssayMethodId, retestCount);
|
||||
return success("成功");
|
||||
}
|
||||
|
||||
|
||||
@@ -57,13 +57,20 @@ public class SampleAnalysisController implements BusinessControllerMarker {
|
||||
return success("成功");
|
||||
}
|
||||
|
||||
//下发配料
|
||||
//下发配料(自动火试金配料)
|
||||
@PostMapping("/issuedIngredients")
|
||||
public CommonResult<?> issuedIngredients(Long businessAssayTaskId) {
|
||||
sampleAnalysisService.issuedIngredients(businessAssayTaskId);
|
||||
return success("成功");
|
||||
}
|
||||
|
||||
//人工配料
|
||||
@PostMapping("/manualIngredients")
|
||||
public CommonResult<?> manualIngredients(Long businessAssayTaskId) {
|
||||
sampleAnalysisService.manualIngredients(businessAssayTaskId);
|
||||
return success("成功");
|
||||
}
|
||||
|
||||
@PostMapping("/submitSampleAnalysisByTaskId")
|
||||
public CommonResult<?> submitSampleAnalysisByTaskId(Long businessAssayTaskId) {
|
||||
sampleAnalysisService.submitSampleAnalysisByTaskId(businessAssayTaskId);
|
||||
|
||||
@@ -41,7 +41,7 @@ public class SampleReportDataQueryController {
|
||||
@Operation(summary = "委托单详情数据")
|
||||
@GetMapping("/crossAuditByTaskId")
|
||||
public CommonResult<?> crossAuditByTaskId(Long businessAssayTaskId) {
|
||||
JSONObject result = sampleAnalysisAuditService.crossAuditByTaskId(businessAssayTaskId);
|
||||
JSONObject result = sampleAnalysisAuditService.getCrossAuditDataByTaskId(businessAssayTaskId);
|
||||
return success(result);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,6 @@ import com.zt.plat.module.qms.business.bus.liteflow.param.SampleTaskAssignSample
|
||||
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;
|
||||
|
||||
@@ -46,20 +46,22 @@ public class TestController {
|
||||
bzr.setNodeKey("flw_team_receive");
|
||||
bzr.setSort(3300);
|
||||
|
||||
SampleFlowNode ypbm = new SampleFlowNode();
|
||||
ypbm.setNodeName("样品编密");
|
||||
ypbm.setNodeKey("flw_sample_encrypt");
|
||||
ypbm.setSort(3400);
|
||||
// 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 fx = new SampleFlowNode();
|
||||
// fx.setNodeName("样品分析");
|
||||
// fx.setNodeKey("flw_analysis");
|
||||
// fx.setSort(3550);
|
||||
|
||||
//
|
||||
// SampleFlowNode fxs = new SampleFlowNode();
|
||||
// fxs.setNodeName("分析送样");
|
||||
@@ -101,19 +103,20 @@ public class TestController {
|
||||
private static final long serialVersionUID = 6376704859477839016L;
|
||||
|
||||
{
|
||||
add(BeanUtils.toBean(ypbm,SampleFlowNode.class).setCondition("subSampleEncrypt"));//样品需要编密并且没编密过
|
||||
add(BeanUtils.toBean(fx,SampleFlowNode.class).setCondition("subSampleNotEncrypt"));//样品无需编密或样品已编密过
|
||||
add(BeanUtils.toBean(bzs,SampleFlowNode.class).setIsDefault(true));//
|
||||
// add(BeanUtils.toBean(ypbm,SampleFlowNode.class).setCondition("subSampleEncrypt"));//样品需要编密并且没编密过
|
||||
// add(BeanUtils.toBean(bzs,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);
|
||||
// ypbm.setNextFlowNodeList(new ArrayList<>() {
|
||||
// private static final long serialVersionUID = 1014984817516902869L;
|
||||
//
|
||||
// {
|
||||
// add(BeanUtils.toBean(bzs,SampleFlowNode.class).setIsDefault(true));
|
||||
// }});
|
||||
// flowNodeList.add(ypbm);
|
||||
|
||||
|
||||
// fxr.setNextFlowNodeList(new ArrayList<>() {{
|
||||
@@ -127,13 +130,13 @@ public class TestController {
|
||||
// }});
|
||||
// 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);
|
||||
// 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;
|
||||
|
||||
@@ -17,6 +17,8 @@ public class AssayMethodProjectRespVO {
|
||||
|
||||
private String dictionaryProjectShowName;
|
||||
|
||||
private String assayType;
|
||||
|
||||
private Long configAssayMethodId;
|
||||
|
||||
private String configAssayMethodName;
|
||||
|
||||
@@ -1,13 +1,35 @@
|
||||
package com.zt.plat.module.qms.business.bus.controller.vo;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
public class BatchAssessmentDataReportingReqVO {
|
||||
|
||||
private List<Long> businessSubSampleIds;
|
||||
private List<BusinessSubSampleIdAndRetestCount> businessSubSampleIdAndRetestCounts;
|
||||
|
||||
public List<Long> getBusinessSubSampleIds() {
|
||||
if (CollUtil.isEmpty(this.businessSubSampleIdAndRetestCounts)) {
|
||||
return null;
|
||||
}
|
||||
return this.businessSubSampleIdAndRetestCounts.stream().map(m -> m.getBusinessSubSampleId()).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
private Long configAssayMethodId;
|
||||
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class BusinessSubSampleIdAndRetestCount {
|
||||
|
||||
private Long businessSubSampleId;
|
||||
|
||||
private Integer retestCount;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,34 @@
|
||||
package com.zt.plat.module.qms.business.bus.controller.vo;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
public class BatchResultDataReportingReqVO {
|
||||
|
||||
private List<Long> businessSubParentSampleIds;
|
||||
|
||||
private List<BusinessSubParentSampleIdAndRetestCount> businessSubParentSampleIdAndRetestCounts;
|
||||
|
||||
private Long configAssayMethodId;
|
||||
|
||||
public List<Long> getBusinessSubParentSampleIds() {
|
||||
if (CollUtil.isEmpty(this.businessSubParentSampleIdAndRetestCounts)) {
|
||||
return null;
|
||||
}
|
||||
return this.businessSubParentSampleIdAndRetestCounts.stream().map(m -> m.getBusinessSubParentSampleId()).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class BusinessSubParentSampleIdAndRetestCount {
|
||||
|
||||
private Long businessSubParentSampleId;
|
||||
|
||||
private Integer retestCount;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,9 @@ public class BusinessAssayProjectDataExtendRespVO extends BusinessAssayProjectDa
|
||||
|
||||
@Schema(description = "样品主样ID", example = "23293")
|
||||
private Long businessBaseSampleId;
|
||||
|
||||
@Schema(description = "主样配置ID")
|
||||
private Long configBaseSampleId;
|
||||
|
||||
@Schema(description = "样品分样ID", example = "15024")
|
||||
private Long businessSubParentSampleId;
|
||||
|
||||
@@ -5,6 +5,8 @@ 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.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
@@ -31,6 +33,15 @@ public class BusinessAssayProjectDataPageReqVO extends PageParam {
|
||||
@Schema(description = "值")
|
||||
private String value;
|
||||
|
||||
@Schema(description = "补正系数ID", example = "1008")
|
||||
private Long configAssayMethodProjectCoefficientId;
|
||||
|
||||
@Schema(description = "补正系数")
|
||||
private BigDecimal coefficient;
|
||||
|
||||
@Schema(description = "补正后的值")
|
||||
private String valueAfter;
|
||||
|
||||
@Schema(description = "数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间", example = "2")
|
||||
private String dataType;
|
||||
|
||||
|
||||
@@ -5,6 +5,8 @@ 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.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
@@ -37,6 +39,15 @@ public class BusinessAssayProjectDataReqVO {
|
||||
@Schema(description = "值")
|
||||
private String value;
|
||||
|
||||
@Schema(description = "补正系数ID", example = "1008")
|
||||
private Long configAssayMethodProjectCoefficientId;
|
||||
|
||||
@Schema(description = "补正系数")
|
||||
private BigDecimal coefficient;
|
||||
|
||||
@Schema(description = "补正后的值")
|
||||
private String valueAfter;
|
||||
|
||||
@Schema(description = "数据类型,【字典】【jy_sample_data_type】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间", example = "1")
|
||||
private String dataType;
|
||||
|
||||
|
||||
@@ -4,6 +4,8 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@@ -38,6 +40,15 @@ public class BusinessAssayProjectDataRespVO {
|
||||
@ExcelProperty("值")
|
||||
private String value;
|
||||
|
||||
@Schema(description = "补正系数ID", example = "1008")
|
||||
private Long configAssayMethodProjectCoefficientId;
|
||||
|
||||
@Schema(description = "补正系数")
|
||||
private BigDecimal coefficient;
|
||||
|
||||
@Schema(description = "补正后的值")
|
||||
private String valueAfter;
|
||||
|
||||
@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;
|
||||
|
||||
@@ -2,6 +2,8 @@ package com.zt.plat.module.qms.business.bus.controller.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
@@ -27,6 +29,15 @@ public class BusinessAssayProjectDataSaveReqVO {
|
||||
@Schema(description = "值")
|
||||
private String value;
|
||||
|
||||
@Schema(description = "补正系数ID", example = "1008")
|
||||
private Long configAssayMethodProjectCoefficientId;
|
||||
|
||||
@Schema(description = "补正系数")
|
||||
private BigDecimal coefficient;
|
||||
|
||||
@Schema(description = "补正后的值")
|
||||
private String valueAfter;
|
||||
|
||||
@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;
|
||||
|
||||
@@ -47,6 +47,9 @@ public class BusinessAssayTaskAnalysisSampleAndQcProjectRespVO {
|
||||
@Schema(description = "是否配料,1-是,0-否")
|
||||
private Integer isIngredients;
|
||||
|
||||
@Schema(description = "配料方式,初始状态-initial、自动配料-automatic、人工配料-manual")
|
||||
private String ingredientsWay;
|
||||
|
||||
@Schema(description = "配料状态,初始状态-initial、等待配料-in_progress、可提交-allow_submit", example = "2")
|
||||
private String ingredientsStatus;
|
||||
|
||||
|
||||
@@ -21,6 +21,9 @@ public class BusinessAssayTaskDataExtendRespVO extends BusinessAssayTaskDataResp
|
||||
@Schema(description = "检测方法配置名称及类别")
|
||||
private String configAssayMethodNameAndCategory;
|
||||
|
||||
@Schema(description = "主样配置id")
|
||||
private Long configBaseSampleId;
|
||||
|
||||
@Schema(description = "子样配置id")
|
||||
private Long configSubSampleId;
|
||||
|
||||
|
||||
@@ -50,6 +50,9 @@ public class BusinessAssayTaskPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "是否配料,1-是,0-否")
|
||||
private Integer isIngredients;
|
||||
|
||||
@Schema(description = "配料方式,初始状态-initial、自动配料-automatic、人工配料-manual")
|
||||
private String ingredientsWay;
|
||||
|
||||
@Schema(description = "配料状态,初始状态-initial、等待配料-in_progress、可提交-allow_submit", example = "2")
|
||||
private String ingredientsStatus;
|
||||
|
||||
@@ -49,6 +49,9 @@ public class BusinessAssayTaskReqVO {
|
||||
|
||||
@Schema(description = "是否配料,1-是,0-否")
|
||||
private Integer isIngredients;
|
||||
|
||||
@Schema(description = "配料方式,初始状态-initial、自动配料-automatic、人工配料-manual")
|
||||
private String ingredientsWay;
|
||||
|
||||
@Schema(description = "配料状态,初始状态-initial、等待配料-in_progress、可提交-allow_submit", example = "2")
|
||||
private String ingredientsStatus;
|
||||
|
||||
@@ -61,6 +61,9 @@ public class BusinessAssayTaskRespVO {
|
||||
|
||||
@Schema(description = "是否配料,1-是,0-否")
|
||||
private Integer isIngredients;
|
||||
|
||||
@Schema(description = "配料方式,初始状态-initial、自动配料-automatic、人工配料-manual")
|
||||
private String ingredientsWay;
|
||||
|
||||
@Schema(description = "配料状态,初始状态-initial、等待配料-in_progress、可提交-allow_submit", example = "2")
|
||||
private String ingredientsStatus;
|
||||
|
||||
@@ -59,6 +59,9 @@ public class BusinessAssayTaskSaveReqVO {
|
||||
|
||||
@Schema(description = "是否配料,1-是,0-否")
|
||||
private Integer isIngredients;
|
||||
|
||||
@Schema(description = "配料方式,初始状态-initial、自动配料-automatic、人工配料-manual")
|
||||
private String ingredientsWay;
|
||||
|
||||
@Schema(description = "配料状态,初始状态-initial、等待配料-in_progress、可提交-allow_submit", example = "2")
|
||||
private String ingredientsStatus;
|
||||
|
||||
@@ -19,6 +19,9 @@ public class BusinessSubParentSampleAssessmentProjectRespVO {
|
||||
@Schema(description = "样品分样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "23188")
|
||||
@ExcelProperty("样品分样ID")
|
||||
private Long businessSubParentSampleId;
|
||||
|
||||
@Schema(description = "班组判定数据业务ID")
|
||||
private Long businessSubParentSampleAssessmentId;
|
||||
|
||||
@Schema(description = "检测项目ID,字典表【T_DIC_PRJ】", requiredMode = Schema.RequiredMode.REQUIRED, example = "17642")
|
||||
@ExcelProperty("检测项目ID,字典表【T_DIC_PRJ】")
|
||||
|
||||
@@ -145,6 +145,9 @@ public class BusinessSubSamplePageReqVO extends PageParam {
|
||||
@Schema(description = "分析部门状态")
|
||||
private String assayDepartmentStatus;
|
||||
|
||||
@Schema(description = "分析部门状态列表")
|
||||
private List<String> assayDepartmentStatusList;
|
||||
|
||||
@Schema(description = "是否已送样")
|
||||
private Integer isSendSample;
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@ package com.zt.plat.module.qms.business.bus.dal.dataobject;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
|
||||
/**
|
||||
@@ -62,6 +62,21 @@ public class BusinessAssayProjectDataDO extends BusinessBaseDO {
|
||||
@TableField(value = "VAL", updateStrategy = FieldStrategy.ALWAYS)
|
||||
private String value;
|
||||
/**
|
||||
* 补正系数ID
|
||||
*/
|
||||
@TableField(value = "CFG_ASY_MTHD_PRJ_COEF_ID", updateStrategy = FieldStrategy.ALWAYS)
|
||||
private Long configAssayMethodProjectCoefficientId;
|
||||
/**
|
||||
* 补正系数
|
||||
*/
|
||||
@TableField(value = "COEF", updateStrategy = FieldStrategy.ALWAYS)
|
||||
private BigDecimal coefficient;
|
||||
/**
|
||||
* 补正后的值
|
||||
*/
|
||||
@TableField(value = "VAL_AFT", updateStrategy = FieldStrategy.ALWAYS)
|
||||
private String valueAfter;
|
||||
/**
|
||||
* 数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间
|
||||
*/
|
||||
@TableField("DAT_TP")
|
||||
|
||||
@@ -90,6 +90,11 @@ public class BusinessAssayTaskDO extends BusinessBaseDO {
|
||||
@TableField("IS_IGDT")
|
||||
private Integer isIngredients;
|
||||
/**
|
||||
* 配料方式,初始状态-initial、自动配料-automatic、人工配料-manual
|
||||
*/
|
||||
@TableField("IGDT_WY")
|
||||
private String ingredientsWay;
|
||||
/**
|
||||
* 配料状态,初始状态-initial、等待配料-in_progress、可提交-allow_submit
|
||||
*/
|
||||
@TableField("IGDT_STS")
|
||||
|
||||
@@ -8,6 +8,7 @@ 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.BusinessAssayProjectDataDO;
|
||||
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.BusinessSubSampleDO;
|
||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectDO;
|
||||
import com.zt.plat.module.qms.business.dic.dal.dataobject.DictionaryProjectDO;
|
||||
@@ -56,6 +57,9 @@ public interface BusinessAssayProjectDataMapper extends BaseMapperX<BusinessAssa
|
||||
.eqIfPresent(BusinessAssayProjectDataDO::getUsage, reqVO.getUsage())
|
||||
.eqIfPresent(BusinessAssayProjectDataDO::getSymbol, reqVO.getSymbol())
|
||||
.eqIfPresent(BusinessAssayProjectDataDO::getValue, reqVO.getValue())
|
||||
.eqIfPresent(BusinessAssayProjectDataDO::getConfigAssayMethodProjectCoefficientId, reqVO.getConfigAssayMethodProjectCoefficientId())
|
||||
.eqIfPresent(BusinessAssayProjectDataDO::getCoefficient, reqVO.getCoefficient())
|
||||
.eqIfPresent(BusinessAssayProjectDataDO::getValueAfter, reqVO.getValueAfter())
|
||||
.eqIfPresent(BusinessAssayProjectDataDO::getDataType, reqVO.getDataType())
|
||||
.eqIfPresent(BusinessAssayProjectDataDO::getDecimalPosition, reqVO.getDecimalPosition())
|
||||
.eqIfPresent(BusinessAssayProjectDataDO::getIsNotAssessment, reqVO.getIsNotAssessment())
|
||||
@@ -75,6 +79,9 @@ public interface BusinessAssayProjectDataMapper extends BaseMapperX<BusinessAssa
|
||||
.eqIfPresent(BusinessAssayProjectDataDO::getUsage, reqVO.getUsage())
|
||||
.eqIfPresent(BusinessAssayProjectDataDO::getSymbol, reqVO.getSymbol())
|
||||
.eqIfPresent(BusinessAssayProjectDataDO::getValue, reqVO.getValue())
|
||||
.eqIfPresent(BusinessAssayProjectDataDO::getConfigAssayMethodProjectCoefficientId, reqVO.getConfigAssayMethodProjectCoefficientId())
|
||||
.eqIfPresent(BusinessAssayProjectDataDO::getCoefficient, reqVO.getCoefficient())
|
||||
.eqIfPresent(BusinessAssayProjectDataDO::getValueAfter, reqVO.getValueAfter())
|
||||
.eqIfPresent(BusinessAssayProjectDataDO::getDataType, reqVO.getDataType())
|
||||
.eqIfPresent(BusinessAssayProjectDataDO::getDecimalPosition, reqVO.getDecimalPosition())
|
||||
.eqIfPresent(BusinessAssayProjectDataDO::getIsNotAssessment, reqVO.getIsNotAssessment())
|
||||
@@ -111,6 +118,7 @@ public interface BusinessAssayProjectDataMapper extends BaseMapperX<BusinessAssa
|
||||
default List<BusinessAssayProjectDataExtendRespVO> selectByBusinessAssayTaskDataIds(List<Long> businessAssayTaskDataIds) {
|
||||
return selectJoinList(BusinessAssayProjectDataExtendRespVO.class, new MPJLambdaWrapperX<BusinessAssayProjectDataDO>()
|
||||
.leftJoin(BusinessAssayTaskDataDO.class, BusinessAssayTaskDataDO::getId, BusinessAssayProjectDataDO::getBusinessAssayTaskDataId)
|
||||
.leftJoin(BusinessBaseSampleDO.class, BusinessBaseSampleDO::getId, BusinessAssayTaskDataDO::getBusinessBaseSampleId)
|
||||
.leftJoin(DictionaryProjectDO.class, DictionaryProjectDO::getId, BusinessAssayProjectDataDO::getDictionaryProjectId)
|
||||
.selectAll(BusinessAssayProjectDataDO.class)
|
||||
.selectAs(DictionaryProjectDO::getKey, BusinessAssayProjectDataExtendRespVO::getDictionaryProjectKey)
|
||||
@@ -122,6 +130,7 @@ public interface BusinessAssayProjectDataMapper extends BaseMapperX<BusinessAssa
|
||||
.selectAs(BusinessAssayTaskDataDO::getBusinessBaseSampleId, BusinessAssayProjectDataExtendRespVO::getBusinessBaseSampleId)
|
||||
.selectAs(BusinessAssayTaskDataDO::getBusinessSubParentSampleId, BusinessAssayProjectDataExtendRespVO::getBusinessSubParentSampleId)
|
||||
.selectAs(BusinessAssayTaskDataDO::getBusinessSubSampleId, BusinessAssayProjectDataExtendRespVO::getBusinessSubSampleId)
|
||||
.selectAs(BusinessBaseSampleDO::getConfigBaseSampleId, BusinessAssayProjectDataExtendRespVO::getConfigBaseSampleId)
|
||||
.in(BusinessAssayProjectDataDO::getBusinessAssayTaskDataId, businessAssayTaskDataIds));
|
||||
}
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayTaskDataGr
|
||||
import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayTaskDataPageReqVO;
|
||||
import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayTaskDataReqVO;
|
||||
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.BusinessSubSampleAnalysisGroupDO;
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleAssessmentDO;
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleDO;
|
||||
@@ -365,6 +366,19 @@ public interface BusinessAssayTaskDataMapper extends BaseMapperX<BusinessAssayTa
|
||||
return selectList(new LambdaQueryWrapperX<BusinessAssayTaskDataDO>()
|
||||
.eq(BusinessAssayTaskDataDO::getBusinessAssayTaskId, businessAssayTaskId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据任务分配单id查询分析任务
|
||||
* @param businessAssayTaskId 任务分配单id
|
||||
* @return
|
||||
*/
|
||||
default List<BusinessAssayTaskDataExtendRespVO> selectExtendByBusinessAssayTaskId(Long businessAssayTaskId) {
|
||||
return selectJoinList(BusinessAssayTaskDataExtendRespVO.class, new MPJLambdaWrapperX<BusinessAssayTaskDataDO>()
|
||||
.leftJoin(BusinessBaseSampleDO.class, BusinessBaseSampleDO::getId, BusinessAssayTaskDataDO::getBusinessBaseSampleId)
|
||||
.selectAll(BusinessAssayTaskDataDO.class)
|
||||
.selectAs(BusinessBaseSampleDO::getConfigBaseSampleId, BusinessAssayTaskDataExtendRespVO::getConfigBaseSampleId)
|
||||
.eq(BusinessAssayTaskDataDO::getBusinessAssayTaskId, businessAssayTaskId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据子样查询分析任务
|
||||
@@ -441,16 +455,18 @@ public interface BusinessAssayTaskDataMapper extends BaseMapperX<BusinessAssayTa
|
||||
* @param excludeIds 排除的id列表
|
||||
* @param businessSubSampleId 子样id
|
||||
* @param configAssayMethodId 分析方法id
|
||||
* @param retestCount 复测次数
|
||||
* @param isReported 是否上报
|
||||
* @return
|
||||
*/
|
||||
default List<BusinessAssayTaskDataDO> selectIsReportedList(List<Long> excludeIds, Long businessSubSampleId, Long configAssayMethodId, Integer isReported) {
|
||||
default List<BusinessAssayTaskDataDO> selectIsReportedList(List<Long> excludeIds, Long businessSubSampleId, Long configAssayMethodId, Integer retestCount, Integer isReported) {
|
||||
LambdaQueryWrapper<BusinessAssayTaskDataDO> queryWrapper = new LambdaQueryWrapperX<BusinessAssayTaskDataDO>();
|
||||
if (CollUtil.isNotEmpty(excludeIds)) {
|
||||
queryWrapper.notIn(BusinessAssayTaskDataDO::getId, excludeIds);
|
||||
}
|
||||
queryWrapper.eq(BusinessAssayTaskDataDO::getBusinessSubSampleId, businessSubSampleId)
|
||||
.eq(BusinessAssayTaskDataDO::getConfigAssayMethodId, configAssayMethodId)
|
||||
.eq(BusinessAssayTaskDataDO::getRetestCount, retestCount)
|
||||
.eq(BusinessAssayTaskDataDO::getIsReported, isReported);
|
||||
return selectList(queryWrapper);
|
||||
}
|
||||
|
||||
@@ -42,6 +42,7 @@ public interface BusinessAssayTaskMapper extends BaseMapperX<BusinessAssayTaskDO
|
||||
.eqIfPresent(BusinessAssayTaskDO::getTaskAssignStatus, reqVO.getTaskAssignStatus())
|
||||
.betweenIfPresent(BusinessAssayTaskDO::getTaskAssignSubmitTime, reqVO.getTaskAssignSubmitTime())
|
||||
.eqIfPresent(BusinessAssayTaskDO::getIsIngredients, reqVO.getIsIngredients())
|
||||
.eqIfPresent(BusinessAssayTaskDO::getIngredientsWay, reqVO.getIngredientsWay())
|
||||
.eqIfPresent(BusinessAssayTaskDO::getIngredientsStatus, reqVO.getIngredientsStatus())
|
||||
.eqIfPresent(BusinessAssayTaskDO::getAssayOperator, reqVO.getAssayOperator())
|
||||
.eqIfPresent(BusinessAssayTaskDO::getAssayOperatorId, reqVO.getAssayOperatorId())
|
||||
@@ -89,6 +90,7 @@ public interface BusinessAssayTaskMapper extends BaseMapperX<BusinessAssayTaskDO
|
||||
.eqIfPresent(BusinessAssayTaskDO::getTaskAssignStatus, reqVO.getTaskAssignStatus())
|
||||
.betweenIfPresent(BusinessAssayTaskDO::getTaskAssignSubmitTime, reqVO.getTaskAssignSubmitTime())
|
||||
.eqIfPresent(BusinessAssayTaskDO::getIsIngredients, reqVO.getIsIngredients())
|
||||
.eqIfPresent(BusinessAssayTaskDO::getIngredientsWay, reqVO.getIngredientsWay())
|
||||
.eqIfPresent(BusinessAssayTaskDO::getIngredientsStatus, reqVO.getIngredientsStatus())
|
||||
.eqIfPresent(BusinessAssayTaskDO::getAssayOperator, reqVO.getAssayOperator())
|
||||
.eqIfPresent(BusinessAssayTaskDO::getAssayOperatorId, reqVO.getAssayOperatorId())
|
||||
|
||||
@@ -45,10 +45,11 @@ public interface BusinessSubParentSampleAssessmentMapper extends BaseMapperX<Bus
|
||||
.in(BusinessSubParentSampleAssessmentDO::getBusinessSubParentSampleId, businessSubParentSampleIds));
|
||||
}
|
||||
|
||||
default BusinessSubParentSampleAssessmentDO selectByBusinessSubParentSampleIdAndConfigAssayMethodId(Long businessSubParentSampleId, Long configAssayMethodId) {
|
||||
default BusinessSubParentSampleAssessmentDO selectByBusinessSubParentSampleIdAndConfigAssayMethodIdAndRetestCount(Long businessSubParentSampleId, Long configAssayMethodId, Integer retestCount) {
|
||||
return selectOne(new LambdaQueryWrapperX<BusinessSubParentSampleAssessmentDO>()
|
||||
.eq(BusinessSubParentSampleAssessmentDO::getBusinessSubParentSampleId, businessSubParentSampleId)
|
||||
.eq(BusinessSubParentSampleAssessmentDO::getConfigAssayMethodId, configAssayMethodId));
|
||||
.eq(BusinessSubParentSampleAssessmentDO::getConfigAssayMethodId, configAssayMethodId)
|
||||
.eq(BusinessSubParentSampleAssessmentDO::getRetestCount, retestCount));
|
||||
}
|
||||
|
||||
default List<BusinessSubParentSampleAssessmentExtendRespVO> selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(List<Long> businessSubParentSampleIds, Long configAssayMethodId) {
|
||||
|
||||
@@ -50,12 +50,14 @@ public interface BusinessSubSampleAssessmentMapper extends BaseMapperX<BusinessS
|
||||
.eq(BusinessSubSampleAssessmentDO::getConfigAssayMethodId, configAssayMethodId));
|
||||
}
|
||||
|
||||
default BusinessSubSampleAssessmentDO selectByBusinessSubSampleIdAndConfigAssayMethodId(Long businessSubSampleId, Long configAssayMethodId) {
|
||||
default BusinessSubSampleAssessmentDO selectByBusinessSubSampleIdAndConfigAssayMethodIdAndRetestCount(Long businessSubSampleId, Long configAssayMethodId, Integer retestCount) {
|
||||
return selectOne(new LambdaQueryWrapperX<BusinessSubSampleAssessmentDO>()
|
||||
.eq(BusinessSubSampleAssessmentDO::getBusinessSubSampleId, businessSubSampleId)
|
||||
.eq(BusinessSubSampleAssessmentDO::getConfigAssayMethodId, configAssayMethodId));
|
||||
.eq(BusinessSubSampleAssessmentDO::getConfigAssayMethodId, configAssayMethodId)
|
||||
.eq(BusinessSubSampleAssessmentDO::getRetestCount, retestCount));
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
default List<BusinessSubSampleAssessmentDO> selectByBusinessSubSampleIdsAndConfigAssayMethodIdAndRetestCount(List<Long> businessSubSampleIds, Long configAssayMethodId, Integer retestCount) {
|
||||
return selectList(new LambdaQueryWrapperX<BusinessSubSampleAssessmentDO>()
|
||||
.in(BusinessSubSampleAssessmentDO::getBusinessSubSampleId, businessSubSampleIds)
|
||||
|
||||
@@ -100,8 +100,11 @@ public interface BusinessSubSampleAssessmentProjectMapper extends BaseMapperX<Bu
|
||||
.eq(BusinessSubSampleAssessmentProjectDO::getConfigAssayMethodId, configAssayMethodId));
|
||||
}
|
||||
|
||||
default List<BusinessSubSampleAssessmentProjectExtendRespVO> selectByBusinessSubSampleIdAndConfigAssayMethodId(Long businessSubSampleId, Long configAssayMethodId) {
|
||||
@Deprecated
|
||||
default List<BusinessSubSampleAssessmentProjectExtendRespVO> selectByBusinessSubSampleIdAndConfigAssayMethodId(Long businessSubSampleId, Long configAssayMethodId) {
|
||||
return selectJoinList(BusinessSubSampleAssessmentProjectExtendRespVO.class, new MPJLambdaWrapperX<BusinessSubSampleAssessmentProjectDO>()
|
||||
.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)
|
||||
@@ -113,6 +116,22 @@ public interface BusinessSubSampleAssessmentProjectMapper extends BaseMapperX<Bu
|
||||
.eq(BusinessSubSampleAssessmentProjectDO::getConfigAssayMethodId, configAssayMethodId));
|
||||
}
|
||||
|
||||
default List<BusinessSubSampleAssessmentProjectExtendRespVO> selectByBusinessSubSampleIdAndConfigAssayMethodIdAndRetestCount(Long businessSubSampleId, Long configAssayMethodId, Integer retestCount) {
|
||||
return selectJoinList(BusinessSubSampleAssessmentProjectExtendRespVO.class, new MPJLambdaWrapperX<BusinessSubSampleAssessmentProjectDO>()
|
||||
.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(ConfigAssayMethodProjectDO::getDictionaryProjectUnit, BusinessSubSampleAssessmentProjectExtendRespVO::getDictionaryProjectUnit)
|
||||
.selectAs(DictionaryProjectDO::getKey, BusinessSubSampleAssessmentProjectExtendRespVO::getDictionaryProjectKey)
|
||||
.selectAs(DictionaryProjectDO::getSimpleName, BusinessSubSampleAssessmentProjectExtendRespVO::getSimpleName)
|
||||
.selectAs(DictionaryProjectDO::getShowName, BusinessSubSampleAssessmentProjectExtendRespVO::getShowName)
|
||||
.eq(BusinessSubSampleAssessmentProjectDO::getBusinessSubSampleId, businessSubSampleId)
|
||||
.eq(BusinessSubSampleAssessmentProjectDO::getConfigAssayMethodId, configAssayMethodId)
|
||||
.eq(BusinessSubSampleAssessmentDO::getRetestCount, retestCount));
|
||||
}
|
||||
|
||||
default BusinessSubSampleAssessmentProjectDO selectByBusinessSubSampleIdAndConfigAssayMethodIdAndConfigAssayMethodProjectId(Long businessSubSampleId, Long configAssayMethodId, Long configAssayMethodProjectId) {
|
||||
return selectOne(new LambdaQueryWrapperX<BusinessSubSampleAssessmentProjectDO>()
|
||||
.eq(BusinessSubSampleAssessmentProjectDO::getBusinessSubSampleId, businessSubSampleId)
|
||||
|
||||
@@ -144,6 +144,7 @@ public interface BusinessSubSampleMapper extends BaseMapperX<BusinessSubSampleDO
|
||||
.eqIfPresent(BusinessSubSampleAnalysisGroupDO::getAssayDepartmentId, reqVO.getAssayDepartmentId())
|
||||
.eqIfPresent(BusinessSubSampleAnalysisGroupDO::getAssayDepartmentName, reqVO.getAssayDepartmentName())
|
||||
.eqIfPresent(BusinessSubSampleAnalysisGroupDO::getSampleStatus, reqVO.getAssayDepartmentStatus())
|
||||
.inIfPresent(BusinessSubSampleAnalysisGroupDO::getSampleStatus, reqVO.getAssayDepartmentStatusList())
|
||||
.eqIfPresent(BusinessSubSampleAnalysisGroupDO::getIsSend, reqVO.getIsSendSample())
|
||||
.orderByDesc(BusinessSubSampleDO::getSampleFlowNodeTime).orderByAsc(BusinessSubSampleDO::getSampleCode));
|
||||
}
|
||||
|
||||
@@ -2,6 +2,8 @@ package com.zt.plat.module.qms.business.bus.liteflow.sample.entrust;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
@@ -83,6 +85,18 @@ public class SampleEntrustCreateDataCmp extends NodeComponent {
|
||||
|
||||
List<BusinessSampleAssayResultDO> sampleAssayResultList = new ArrayList<>();
|
||||
|
||||
//提取委托单号
|
||||
String year = null;
|
||||
String number = null;
|
||||
Pattern pattern = Pattern.compile("\\((\\d+)\\)第(\\d+)号");
|
||||
//一般委托或仲裁委托才提取
|
||||
if ("xsqywtybwt".equals(configEntrustSource.getKey()) || "xsqywtzcwt".equals(configEntrustSource.getKey())) {
|
||||
Matcher matcher = pattern.matcher(sampleEntrustRegistration.getEntrustNumber());
|
||||
if (matcher.find()) {
|
||||
year = matcher.group(1); // "2026"
|
||||
number = matcher.group(2); // "0027"
|
||||
}
|
||||
}
|
||||
List<BusinessSampleEntrustDetailDO> sampleEntrustDetailList = sampleEntrustContext.getSampleEntrustDetailList();
|
||||
for (BusinessSampleEntrustDetailDO businessSampleEntrustDetail : sampleEntrustDetailList) {
|
||||
businessSampleEntrustDetail.setBusinessSampleEntrustRegistrationId(sampleEntrustRegistration.getId());
|
||||
@@ -93,6 +107,17 @@ public class SampleEntrustCreateDataCmp extends NodeComponent {
|
||||
sampleAssayResult.setData(businessSampleEntrustDetail.getForecastResult());
|
||||
sampleAssayResultList.add(sampleAssayResult);
|
||||
}
|
||||
|
||||
//一般委托
|
||||
if ("xsqywtybwt".equals(configEntrustSource.getKey())) {
|
||||
String sampleCode = "W" + year + number + "-" + StringUtils.leftPad(businessSampleEntrustDetail.getSort().toString(), 2, "0");
|
||||
businessSampleEntrustDetail.setSampleCode(sampleCode);
|
||||
} else if ("xsqywtzcwt".equals(configEntrustSource.getKey())) {//仲裁委托
|
||||
String sampleCode = "ZW" + year + number + "-" + StringUtils.leftPad(businessSampleEntrustDetail.getSort().toString(), 2, "0");
|
||||
businessSampleEntrustDetail.setSampleCode(sampleCode);
|
||||
} else if ("ztgmwt".equals(configEntrustSource.getKey())) {//中铜国贸商检委托,来样编号与样品编号一致
|
||||
businessSampleEntrustDetail.setSampleCode(businessSampleEntrustDetail.getEntrustSampleCode());//样品编号与来样编号一致
|
||||
}
|
||||
}
|
||||
|
||||
List<BusinessSampleEntrustProjectDO> sampleEntrustProjectList = sampleEntrustContext.getSampleEntrustProjectList();
|
||||
|
||||
@@ -334,7 +334,9 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent {
|
||||
businessBaseSampleDO.setDictionaryBusinessId(businessSampleEntrustDetailDO.getSampleTypeDictionaryBusinessId());
|
||||
//生成样品编号
|
||||
String sampleCode = businessSampleEntrustDetailDO.getEntrustSampleCode();//默认取来样编号
|
||||
if (StringUtils.isNotBlank(configBaseSample.getCodeRule())) {//如果配置了样品编号生成规则,则以生成规则为准
|
||||
if (StringUtils.isNotBlank(businessSampleEntrustDetailDO.getSampleCode())) {//如果已经提前生成,
|
||||
sampleCode = businessSampleEntrustDetailDO.getSampleCode();
|
||||
} else if (StringUtils.isNotBlank(configBaseSample.getCodeRule())) {//如果配置了样品编号生成规则,则以生成规则为准
|
||||
sampleCode = sequenceUtil.genCode(configBaseSample.getCodeRule());
|
||||
}
|
||||
businessBaseSampleDO.setSampleCode(sampleCode);
|
||||
@@ -572,9 +574,9 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent {
|
||||
businessAssayTaskDataDO.setConfigAssayMethodId(configAssayMethodId);
|
||||
businessAssayTaskDataDO.setAssayType(assayType);
|
||||
businessAssayTaskDataDO.setTaskType("常规");
|
||||
businessAssayTaskDataDO.setConfigSampleFlowId(configSampleFlowSub.getId());
|
||||
businessAssayTaskDataDO.setSampleFlowNodeKey(sampleFlowNodeSub.getNodeKey());
|
||||
businessAssayTaskDataDO.setSampleFlowNodeTime(currentDateTime);
|
||||
// businessAssayTaskDataDO.setConfigSampleFlowId(configSampleFlowSub.getId());
|
||||
// businessAssayTaskDataDO.setSampleFlowNodeKey(sampleFlowNodeSub.getNodeKey());
|
||||
// businessAssayTaskDataDO.setSampleFlowNodeTime(currentDateTime);
|
||||
businessAssayTaskDataDO.setAssayDepartmentId(configAssayMethodDO.getAssayDepartmentId());
|
||||
businessAssayTaskDataDO.setAssayDepartmentName(configAssayMethodDO.getAssayDepartmentName());
|
||||
|
||||
@@ -832,9 +834,9 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent {
|
||||
businessAssayTaskDataDO.setConfigAssayMethodId(addAssayTaskConfigAssayMethod.getId());
|
||||
businessAssayTaskDataDO.setAssayType(assayType);
|
||||
businessAssayTaskDataDO.setTaskType("常规");
|
||||
businessAssayTaskDataDO.setConfigSampleFlowId(configSampleFlowSub.getId());
|
||||
businessAssayTaskDataDO.setSampleFlowNodeKey(sampleFlowNodeSub.getNodeKey());
|
||||
businessAssayTaskDataDO.setSampleFlowNodeTime(currentDateTime);
|
||||
// businessAssayTaskDataDO.setConfigSampleFlowId(configSampleFlowSub.getId());
|
||||
// businessAssayTaskDataDO.setSampleFlowNodeKey(sampleFlowNodeSub.getNodeKey());
|
||||
// businessAssayTaskDataDO.setSampleFlowNodeTime(currentDateTime);
|
||||
businessAssayTaskDataDO.setAssayDepartmentId(addAssayTaskConfigAssayMethod.getAssayDepartmentId());
|
||||
businessAssayTaskDataDO.setAssayDepartmentName(addAssayTaskConfigAssayMethod.getAssayDepartmentName());
|
||||
|
||||
|
||||
@@ -2,6 +2,8 @@ package com.zt.plat.module.qms.business.bus.liteflow.sample.entrust;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
@@ -47,6 +49,8 @@ public class SampleEntrustUpdateDataCmp extends NodeComponent {
|
||||
SampleEntrustContext sampleEntrustContext = this.getContextBean(SampleEntrustContext.class);
|
||||
//样品委托
|
||||
BusinessSampleEntrustRegistrationDO sampleEntrustRegistration = sampleEntrustContext.getSampleEntrustRegistration();
|
||||
BusinessSampleEntrustRegistrationDO oldSampleEntrustRegistration = businessSampleEntrustRegistrationMapper.selectById(sampleEntrustRegistration.getId());
|
||||
sampleEntrustRegistration.setEntrustNumber(oldSampleEntrustRegistration.getEntrustNumber());//重新赋值委托单号
|
||||
|
||||
//获取委托来源配置
|
||||
ConfigEntrustSourceDO configEntrustSource = sampleEntrustContext.getConfigEntrustSourceById(sampleEntrustRegistration.getConfigEntrustSourceId());
|
||||
@@ -80,8 +84,19 @@ public class SampleEntrustUpdateDataCmp extends NodeComponent {
|
||||
|
||||
//保存更新新的
|
||||
List<BusinessSampleAssayResultDO> sampleAssayResultList = new ArrayList<>();
|
||||
|
||||
|
||||
|
||||
//提取委托单号
|
||||
String year = null;
|
||||
String number = null;
|
||||
Pattern pattern = Pattern.compile("\\((\\d+)\\)第(\\d+)号");
|
||||
//一般委托或仲裁委托才提取
|
||||
if ("xsqywtybwt".equals(configEntrustSource.getKey()) || "xsqywtzcwt".equals(configEntrustSource.getKey())) {
|
||||
Matcher matcher = pattern.matcher(sampleEntrustRegistration.getEntrustNumber());
|
||||
if (matcher.find()) {
|
||||
year = matcher.group(1); // "2026"
|
||||
number = matcher.group(2); // "0027"
|
||||
}
|
||||
}
|
||||
List<BusinessSampleEntrustDetailDO> sampleEntrustDetailList = sampleEntrustContext.getSampleEntrustDetailList();
|
||||
for (BusinessSampleEntrustDetailDO businessSampleEntrustDetail : sampleEntrustDetailList) {
|
||||
businessSampleEntrustDetail.setBusinessSampleEntrustRegistrationId(sampleEntrustRegistration.getId());
|
||||
@@ -92,6 +107,18 @@ public class SampleEntrustUpdateDataCmp extends NodeComponent {
|
||||
sampleAssayResult.setData(businessSampleEntrustDetail.getForecastResult());
|
||||
sampleAssayResultList.add(sampleAssayResult);
|
||||
}
|
||||
|
||||
//一般委托
|
||||
if ("xsqywtybwt".equals(configEntrustSource.getKey())) {
|
||||
String sampleCode = "W" + year + number + "-" + StringUtils.leftPad(businessSampleEntrustDetail.getSort().toString(), 2, "0");
|
||||
businessSampleEntrustDetail.setSampleCode(sampleCode);
|
||||
} else if ("xsqywtzcwt".equals(configEntrustSource.getKey())) {//仲裁委托
|
||||
String sampleCode = "ZW" + year + number + "-" + StringUtils.leftPad(businessSampleEntrustDetail.getSort().toString(), 2, "0");
|
||||
businessSampleEntrustDetail.setSampleCode(sampleCode);
|
||||
} else if ("ztgmwt".equals(configEntrustSource.getKey())) {//中铜国贸商检委托,来样编号与样品编号一致
|
||||
businessSampleEntrustDetail.setSampleCode(businessSampleEntrustDetail.getEntrustSampleCode());//样品编号与来样编号一致
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
List<BusinessSampleEntrustProjectDO> sampleEntrustProjectList = sampleEntrustContext.getSampleEntrustProjectList();
|
||||
@@ -119,5 +146,5 @@ public class SampleEntrustUpdateDataCmp extends NodeComponent {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.zt.plat.module.qms.business.bus.liteflow.sample.flow;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -19,6 +20,8 @@ import com.zt.plat.module.qms.business.bus.liteflow.param.SampleFlowInfo;
|
||||
import com.zt.plat.module.qms.business.bus.liteflow.slot.SampleFlowContext;
|
||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSubSampleDO;
|
||||
import com.zt.plat.module.qms.business.config.dal.mapper.ConfigSubSampleMapper;
|
||||
import com.zt.plat.module.qms.enums.QmsCommonConstant;
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
|
||||
@LiteflowComponent(id = "sampleSubCheckCmp", name = "子样检查")
|
||||
@@ -62,7 +65,11 @@ public class SampleSubCheckCmp extends NodeComponent {
|
||||
List<Long> configSubSampleIdList = businessSubSampleDOList.stream().map(m -> m.getConfigSubSampleId()).distinct().collect(Collectors.toList());
|
||||
List<ConfigSubSampleDO> configSubSampleList = configSubSampleMapper.selectByIds(configSubSampleIdList);
|
||||
|
||||
List<BusinessAssayTaskDataDO> businessAssayTaskDataList = businessAssayTaskDataMapper.selectList(new LambdaQueryWrapperX<BusinessAssayTaskDataDO>().in(BusinessAssayTaskDataDO::getBusinessSubSampleId, sampleIdList));
|
||||
List<BusinessAssayTaskDataDO> businessAssayTaskDataList = new ArrayList<>();
|
||||
//如果是班组收样或者内部简码时,才需要更新分析任务节点
|
||||
if (QmsCommonConstant.FLOW_NODE_TEAM_RECEIVE.equals(currentSampleFlowKey) || QmsCommonConstant.FlOW_NODE_SAMPLE_ENCRYPT.equals(currentSampleFlowKey)) {
|
||||
businessAssayTaskDataList = businessAssayTaskDataMapper.selectList(new LambdaQueryWrapperX<BusinessAssayTaskDataDO>().in(BusinessAssayTaskDataDO::getBusinessSubSampleId, sampleIdList));
|
||||
}
|
||||
|
||||
//上一次交接记录
|
||||
List<Long> upSampleRecordIdList = businessSubSampleDOList.stream().filter(f -> f.getUpSampleRecordId() != null).map(m -> m.getUpSampleRecordId()).collect(Collectors.toList());
|
||||
|
||||
@@ -98,8 +98,8 @@ public class SampleSubProcessUpdateCmp extends NodeComponent {
|
||||
|
||||
if (CollUtil.isNotEmpty(businessSubSampleAnalysisGroupDOList)) {
|
||||
List<BusinessSubSampleAnalysisGroupDO> curSubSampleAnalysisGroupDOList = businessSubSampleAnalysisGroupDOList.stream().filter(f -> f.getBusinessSubSampleId().equals(businessSubSample.getId())).collect(Collectors.toList());
|
||||
Boolean hasAllDeptAnalyzed = curSubSampleAnalysisGroupDOList.stream().allMatch(m -> "已完成".equals(m.getSampleStatus()));
|
||||
Boolean hasCurDeptAnalyzed = curSubSampleAnalysisGroupDOList.stream().filter(f -> f.getAssayDepartmentId().equals(loginUser.getVisitDeptId())).allMatch(m -> "已完成".equals(m.getSampleStatus()));
|
||||
Boolean hasAllDeptAnalyzed = curSubSampleAnalysisGroupDOList.stream().allMatch(m -> ( "已完成".equals(m.getSampleStatus()) || "已收样".equals(m.getSampleStatus()) ) );
|
||||
Boolean hasCurDeptAnalyzed = curSubSampleAnalysisGroupDOList.stream().filter(f -> f.getAssayDepartmentId().equals(loginUser.getVisitDeptId())).allMatch(m -> ( "已完成".equals(m.getSampleStatus()) || "已收样".equals(m.getSampleStatus()) ) );
|
||||
context.put("hasAllDeptAnalyzed", hasAllDeptAnalyzed);
|
||||
context.put("hasCurDeptAnalyzed", hasCurDeptAnalyzed);
|
||||
}
|
||||
@@ -127,7 +127,7 @@ public class SampleSubProcessUpdateCmp extends NodeComponent {
|
||||
|
||||
List<BusinessAssayTaskDataDO> subSampleAssayTaskDataList = businessAssayTaskDataList.stream().filter(f -> f.getBusinessSubSampleId().equals(businessSubSample.getId())).collect(Collectors.toList());
|
||||
for (BusinessAssayTaskDataDO businessAssayTaskDataDO : subSampleAssayTaskDataList) {
|
||||
businessAssayTaskDataDO.setSampleFlowNodeKey(nextFlowNode.getNodeKey());
|
||||
businessAssayTaskDataDO.setSampleFlowNodeKey(QmsCommonConstant.FLOW_NODE_ANALYSIS);//样品分析
|
||||
businessAssayTaskDataDO.setSampleFlowNodeTime(currentDateTime);
|
||||
|
||||
}
|
||||
@@ -145,7 +145,7 @@ public class SampleSubProcessUpdateCmp extends NodeComponent {
|
||||
}
|
||||
|
||||
//如果是班组送样,需要更新分析班组表
|
||||
if (QmsCommonConstant.FLOW_NODE_ANALYSIS_SEND.equals(currentSampleFlowKey)) {
|
||||
if (QmsCommonConstant.FLOW_NODE_TEAM_SEND.equals(currentSampleFlowKey)) {
|
||||
List<BusinessSubSampleAnalysisGroupDO> curDeptSubSampleAnalysisGroupDOList = businessSubSampleAnalysisGroupDOList.stream().filter(f -> f.getAssayDepartmentId().equals(loginUser.getVisitDeptId())).collect(Collectors.toList());
|
||||
for (BusinessSubSampleAnalysisGroupDO businessSubSampleAnalysisGroupDO : curDeptSubSampleAnalysisGroupDOList) {
|
||||
businessSubSampleAnalysisGroupDO.setIsSend(QmsCommonConstant.YES);
|
||||
|
||||
@@ -243,9 +243,9 @@ public class BusinessSubSampleServiceImpl implements BusinessSubSampleService {
|
||||
return subSample;
|
||||
}
|
||||
List<BusinessSubSampleAnalysisGroupDO> 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) {
|
||||
throw new ServiceException(1_032_100_000, "当前样品在" + receiveSample.getAssayDepartmentName() + ",不允许收样!");
|
||||
BusinessSubSampleAnalysisGroupDO receiveSample = businessSubSampleAnalysisGroupList.stream().filter(f -> f.getAssayDepartmentId().equals(loginUser.getVisitDeptId())).findFirst().orElse(null);
|
||||
if (receiveSample == null) {
|
||||
throw new ServiceException(1_032_100_000, "当前样品不在" + loginUser.getVisitDeptName() + ",不允许收样!");
|
||||
}
|
||||
} else {
|
||||
subSample = businessSubSampleMapper.getBySampleCodeAndFlowKey(reqVO);
|
||||
|
||||
@@ -10,9 +10,9 @@ import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayTaskDataRe
|
||||
*/
|
||||
public interface SampleAnalysisAuditService {
|
||||
|
||||
JSONObject crossAuditByTaskId(Long businessAssayTaskId);
|
||||
JSONObject getCrossAuditDataByTaskId(Long businessAssayTaskId);
|
||||
|
||||
void crossAuditByByTaskId(Long businessAssayTaskId, String auditStatus);
|
||||
void crossAuditByTaskId(Long businessAssayTaskId, String auditStatus);
|
||||
|
||||
JSONObject getSampleResultAssessmentList(BusinessAssayTaskDataReqVO reqVO);
|
||||
|
||||
@@ -20,9 +20,9 @@ public interface SampleAnalysisAuditService {
|
||||
|
||||
JSONObject getDoubleCupResultAssessment(Long businessSubParentSampleId, Long configAssayMethodId);
|
||||
|
||||
void assessmentDataReporting(Long businessSubSampleId, Long configAssayMethodId);
|
||||
void assessmentDataReporting(Long businessSubSampleId, Long configAssayMethodId, Integer retestCount);
|
||||
|
||||
void createReAnalysis(Long businessSubSampleId, Long configAssayMethodId);
|
||||
void createReAnalysis(Long businessSubSampleId, Long configAssayMethodId, Integer retestCount);
|
||||
|
||||
JSONObject modifyParallelResultAssessment(Long businessSubSampleId, Long configAssayMethodId, Long businessSubSampleAssessmentId, List<Long> businessAssayProjectDataIds);
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@ 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.controller.vo.BatchResultDataReportingReqVO.BusinessSubParentSampleIdAndRetestCount;
|
||||
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;
|
||||
@@ -67,10 +68,12 @@ 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.ConfigAssayMethodProjectCoefficientDO;
|
||||
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.ConfigSubSampleParentMethodDO;
|
||||
import com.zt.plat.module.qms.business.config.dal.mapper.ConfigAssayMethodProjectAssessmentMapper;
|
||||
import com.zt.plat.module.qms.business.config.dal.mapper.ConfigAssayMethodProjectCoefficientMapper;
|
||||
import com.zt.plat.module.qms.business.config.dal.mapper.ConfigAssayMethodProjectMapper;
|
||||
import com.zt.plat.module.qms.business.config.dal.mapper.ConfigProjectMapper;
|
||||
import com.zt.plat.module.qms.business.config.dal.mapper.ConfigReportFieldMapper;
|
||||
@@ -152,6 +155,9 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic
|
||||
@Resource
|
||||
private ConfigAssayMethodProjectMapper configAssayMethodProjectMapper;
|
||||
|
||||
@Resource
|
||||
private ConfigAssayMethodProjectCoefficientMapper configAssayMethodProjectCoefficientMapper;
|
||||
|
||||
@Resource
|
||||
private ConfigSubSampleMethodMapper configSubSampleMethodMapper;
|
||||
|
||||
@@ -198,7 +204,7 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic
|
||||
//为空则未添加过判定记录
|
||||
if (assessmentMap == null) {
|
||||
if (QmsCommonConstant.ASSAY_TYPE_SINGLE_PARALLEL.equals(businessAssayTaskDataExtendRespVO.getAssayType())) {//平行
|
||||
List<BusinessSubSampleAssessmentProjectExtendRespVO> businessSubSampleAssessmentList = businessSubSampleAssessmentProjectMapper.selectByBusinessSubSampleIdAndConfigAssayMethodId(businessAssayTaskDataExtendRespVO.getBusinessSubSampleId(), configAssayMethodId);
|
||||
List<BusinessSubSampleAssessmentProjectExtendRespVO> businessSubSampleAssessmentList = businessSubSampleAssessmentProjectMapper.selectByBusinessSubSampleIdAndConfigAssayMethodIdAndRetestCount(businessAssayTaskDataExtendRespVO.getBusinessSubSampleId(), configAssayMethodId, businessAssayTaskDataExtendRespVO.getRetestCount());
|
||||
for (BusinessSubSampleAssessmentProjectExtendRespVO businessSubSampleAssessment : businessSubSampleAssessmentList) {
|
||||
businessAssayTaskDataAssessmentMap.put("id", businessSubSampleAssessment.getId());
|
||||
businessAssayTaskDataAssessmentMap.put("assessmentStatus", businessSubSampleAssessment.getAssessmentStatus());
|
||||
@@ -217,7 +223,15 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic
|
||||
|
||||
List<BusinessAssayProjectDataExtendRespVO> businessAssayProjectDataList = businessAssayProjectDataMapper.selectByBusinessAssayTaskDataId(businessAssayTaskDataExtendRespVO.getId());
|
||||
for (BusinessAssayProjectDataExtendRespVO businessAssayProjectData : businessAssayProjectDataList) {
|
||||
businessAssayTaskDataMap.put(businessAssayProjectData.getSimpleName(), businessAssayProjectData.getValue());
|
||||
// String value = businessAssayProjectData.getValueAfter();
|
||||
// if (businessAssayProjectData.getCoefficient() != null) {
|
||||
// value = value + "(" + businessAssayProjectData.getValue() + "x" + businessAssayProjectData.getCoefficient().setScale(3, RoundingMode.HALF_EVEN).toPlainString()+ ")";
|
||||
// }
|
||||
// businessAssayTaskDataMap.put(businessAssayProjectData.getSimpleName(), value);
|
||||
businessAssayTaskDataMap.put(businessAssayProjectData.getSimpleName(), businessAssayProjectData.getValueAfter());
|
||||
// businessAssayTaskDataMap.put(businessAssayProjectData.getSimpleName(), businessAssayProjectData.getValue());
|
||||
// businessAssayTaskDataMap.put(businessAssayProjectData.getSimpleName() + "_coefficient", businessAssayProjectData.getCoefficient());
|
||||
// businessAssayTaskDataMap.put(businessAssayProjectData.getSimpleName() + "_after", businessAssayProjectData.getValueAfter());
|
||||
businessAssayTaskDataMap.put("isNotAssessment_" + businessAssayProjectData.getSimpleName(), businessAssayProjectData.getIsNotAssessment());
|
||||
//添加判定状态
|
||||
businessAssayTaskDataMap.put("assessmentStatus", assessmentMap.get("assessmentStatus"));
|
||||
@@ -271,6 +285,11 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic
|
||||
Map<String, Object> businessSubSampleAssessmentMap = BeanUtil.beanToMap(businessSubSampleAssessment);
|
||||
List<BusinessAssayProjectDataExtendRespVO> businessAssayProjectDataSingleList = businessAssayProjectDataList.stream().filter(f -> f.getDictionaryProjectId().equals(businessSubSampleAssessment.getDictionaryProjectId())).collect(Collectors.toList());
|
||||
for (BusinessAssayProjectDataExtendRespVO businessAssayProjectDataExtendRespVO : businessAssayProjectDataSingleList) {
|
||||
// String value = businessAssayProjectDataExtendRespVO.getValueAfter();
|
||||
// if (businessAssayProjectDataExtendRespVO.getCoefficient() != null) {
|
||||
// value = value + "(" + businessAssayProjectDataExtendRespVO.getValue() + "x" + businessAssayProjectDataExtendRespVO.getCoefficient().setScale(3, RoundingMode.HALF_EVEN).toPlainString()+ ")";
|
||||
// }
|
||||
// businessSubSampleAssessmentMap.put(businessAssayProjectDataExtendRespVO.getBusinessAssayTaskDataId() + ";" + businessAssayProjectDataExtendRespVO.getBusinessSubSampleId() + ";" + businessAssayProjectDataExtendRespVO.getRecheckCount(), value);
|
||||
businessSubSampleAssessmentMap.put(businessAssayProjectDataExtendRespVO.getBusinessAssayTaskDataId() + ";" + businessAssayProjectDataExtendRespVO.getBusinessSubSampleId() + ";" + businessAssayProjectDataExtendRespVO.getRecheckCount(), businessAssayProjectDataExtendRespVO.getValue());
|
||||
}
|
||||
dataList.add(businessSubSampleAssessmentMap);
|
||||
@@ -291,7 +310,7 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject crossAuditByTaskId(Long businessAssayTaskId) {
|
||||
public JSONObject getCrossAuditDataByTaskId(Long businessAssayTaskId) {
|
||||
JSONWriter.Context context = JSONFactory.createWriteContext();
|
||||
context.setDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
@@ -622,13 +641,13 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void crossAuditByByTaskId(Long businessAssayTaskId, String auditStatus) {
|
||||
public void crossAuditByTaskId(Long businessAssayTaskId, String auditStatus) {
|
||||
|
||||
//当前登录用户昵称
|
||||
String nickName = SecurityFrameworkUtils.getLoginUserNickname();
|
||||
|
||||
//自动上报的子样
|
||||
List<Long> automaticBusinessSubSampleIdList = new ArrayList<>();
|
||||
//自动上报的子样判定数据
|
||||
List<BusinessSubSampleAssessmentDO> automaticBusinessSubSampleAssessmentList = new ArrayList<>();
|
||||
|
||||
//判定记录
|
||||
List<BusinessSubSampleAssessmentDO> updateBusinessSubSampleAssessmentDOList = new ArrayList<>();
|
||||
@@ -645,9 +664,12 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic
|
||||
|
||||
//查询分析任务明细
|
||||
List<BusinessAssayTaskDataDO> businessAssayTaskDataDOList = businessAssayTaskDataMapper.selectByBusinessAssayTaskId(businessAssayTaskId);
|
||||
Integer recheckCount = businessAssayTaskDataDOList.get(0).getRetestCount();
|
||||
List<Long> businessSubSampleIdList = businessAssayTaskDataDOList.stream().map(m -> m.getBusinessSubSampleId()).distinct().collect(Collectors.toList());
|
||||
List<BusinessSubSampleAssessmentDO> businessSubSampleAssessmentDOList = businessSubSampleAssessmentMapper.selectByBusinessSubSampleIdsAndConfigAssayMethodIdAndRetestCount(businessSubSampleIdList, businessAssayTaskDO.getConfigAssayMethodId(), recheckCount);
|
||||
|
||||
//获取任务明细对应的判定id
|
||||
List<Long> businessSubSampleAssessmentIdList = businessAssayTaskDataDOList.stream().map(m -> m.getBusinessSubSampleAssessmentId()).distinct().collect(Collectors.toList());
|
||||
//获取子样判定数据
|
||||
List<BusinessSubSampleAssessmentDO> businessSubSampleAssessmentDOList = businessSubSampleAssessmentMapper.selectByIds(businessSubSampleAssessmentIdList);
|
||||
|
||||
//根据子样分组
|
||||
Map<Long, List<BusinessAssayTaskDataDO>> businessAssayTaskDataDOMap = businessAssayTaskDataDOList.stream().collect(Collectors.groupingBy(BusinessAssayTaskDataDO::getBusinessSubSampleId));
|
||||
//循环分组
|
||||
@@ -655,43 +677,144 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic
|
||||
|
||||
Long businessSubSampleId = businessAssayTaskDataDOMapEntry.getKey();
|
||||
List<BusinessAssayTaskDataDO> businessAssayTaskDataList = businessAssayTaskDataDOMapEntry.getValue();
|
||||
List<Long> businessAssayTaskDataIdList = businessAssayTaskDataList.stream().map(m -> m.getId()).collect(Collectors.toList());
|
||||
BusinessAssayTaskDataDO businessAssayTaskDataDO = businessAssayTaskDataList.get(0);
|
||||
|
||||
BusinessSubSampleDO businessSubSampleDO = businessSubSampleMapper.selectById(businessSubSampleId);
|
||||
//获取子样分析方法配置
|
||||
ConfigSubSampleMethodExtendRespVO configSubSampleMethodDO = configSubSampleMethodMapper.selectByConfigSubSampleIdAndConfigAssayMethodId(businessSubSampleDO.getConfigSubSampleId(), businessAssayTaskDataDO.getConfigAssayMethodId());
|
||||
Map<Integer, List<BusinessAssayTaskDataDO>> businessAssayTaskDataDORetestMap = businessAssayTaskDataList.stream().collect(Collectors.groupingBy(BusinessAssayTaskDataDO::getRetestCount));
|
||||
|
||||
for (Map.Entry<Integer, List<BusinessAssayTaskDataDO>> businessAssayTaskDataDORetestMapEntry : businessAssayTaskDataDORetestMap.entrySet()) {
|
||||
Integer retestCount = businessAssayTaskDataDORetestMapEntry.getKey();
|
||||
List<BusinessAssayTaskDataDO> businessAssayTaskDataRetestList = businessAssayTaskDataDORetestMapEntry.getValue();
|
||||
|
||||
List<Long> businessAssayTaskDataIdList = businessAssayTaskDataRetestList.stream().map(m -> m.getId()).collect(Collectors.toList());
|
||||
BusinessAssayTaskDataDO businessAssayTaskDataDO = businessAssayTaskDataRetestList.get(0);
|
||||
|
||||
BusinessSubSampleDO businessSubSampleDO = businessSubSampleMapper.selectById(businessSubSampleId);
|
||||
//获取子样分析方法配置
|
||||
ConfigSubSampleMethodExtendRespVO configSubSampleMethodDO = configSubSampleMethodMapper.selectByConfigSubSampleIdAndConfigAssayMethodId(businessSubSampleDO.getConfigSubSampleId(), businessAssayTaskDataDO.getConfigAssayMethodId());
|
||||
|
||||
if (QmsCommonConstant.ASSAY_TYPE_SINGLE_PARALLEL.equals(businessAssayTaskDataDO.getAssayType())) {
|
||||
//根据子样id及分析方法id,查询未上报的分析任务
|
||||
List<BusinessAssayTaskDataDO> unReportedList = businessAssayTaskDataMapper.selectIsReportedList(businessAssayTaskDataIdList, businessAssayTaskDataDO.getBusinessSubSampleId(), businessAssayTaskDataDO.getConfigAssayMethodId(), retestCount, QmsCommonConstant.NO);
|
||||
if (unReportedList.size() > 0) {//还有未上报数据,直接处理,无需判定
|
||||
continue;
|
||||
} else {//做超差判定
|
||||
//根据子样id及分析方法id,查询已上报的分析任务
|
||||
List<BusinessAssayTaskDataDO> reportedList = businessAssayTaskDataMapper.selectIsReportedList(businessAssayTaskDataIdList, businessAssayTaskDataDO.getBusinessSubSampleId(), businessAssayTaskDataDO.getConfigAssayMethodId(), retestCount, QmsCommonConstant.YES);
|
||||
if (reportedList.size() > 0) {
|
||||
List<Long> reportedBusinessAssayTaskDataIdList = reportedList.stream().map(m -> m.getId()).collect(Collectors.toList());
|
||||
businessAssayTaskDataIdList.addAll(reportedBusinessAssayTaskDataIdList);
|
||||
}
|
||||
|
||||
//查询判定业务
|
||||
BusinessSubSampleAssessmentDO businessSubSampleAssessmentDO = updateBusinessSubSampleAssessmentDOList.stream().filter(f -> f.getId().equals(businessAssayTaskDataDO.getBusinessSubSampleAssessmentId())).findFirst().orElse(null);
|
||||
if (businessSubSampleAssessmentDO == null) {
|
||||
businessSubSampleAssessmentDO = businessSubSampleAssessmentDOList.stream().filter(f -> f.getId().equals(businessAssayTaskDataDO.getBusinessSubSampleAssessmentId())).findFirst().orElse(null);
|
||||
updateBusinessSubSampleAssessmentDOList.add(businessSubSampleAssessmentDO);
|
||||
}
|
||||
//状态设置为待上报
|
||||
businessSubSampleAssessmentDO.setReportedStatus(QmsCommonConstant.ASMT_PENDING_REPORT);
|
||||
//查询分析项目
|
||||
List<BusinessAssayProjectDataDO> businessAssayProjectDataDOList = businessAssayProjectDataMapper.selectList(new LambdaQueryWrapperX<BusinessAssayProjectDataDO>().in(BusinessAssayProjectDataDO::getBusinessAssayTaskDataId, businessAssayTaskDataIdList));
|
||||
Map<Long, List<BusinessAssayProjectDataDO>> businessAssayProjectDataDOMap = businessAssayProjectDataDOList.stream().collect(Collectors.groupingBy(BusinessAssayProjectDataDO::getDictionaryProjectId));
|
||||
for (Map.Entry<Long, List<BusinessAssayProjectDataDO>> businessAssayProjectDataDOEntry : businessAssayProjectDataDOMap.entrySet()) {
|
||||
Long dictionaryProjectId = businessAssayProjectDataDOEntry.getKey();
|
||||
List<BusinessAssayProjectDataDO> val1 = businessAssayProjectDataDOEntry.getValue();
|
||||
BusinessAssayProjectDataDO businessAssayProjectDataDO = val1.get(0);
|
||||
List<ConfigAssayMethodProjectAssessmentDO> configAssayMethodProjectAssessmentDOList = configAssayMethodProjectAssessmentMapper.selectByConfigBaseSampleIdAndConfigAssayMethodIdAndConfigAssayMethodProjectId(configSubSampleMethodDO.getConfigBaseSampleId(), businessAssayTaskDataDO.getConfigAssayMethodId(), businessAssayProjectDataDO.getConfigAssayMethodProjectId());
|
||||
|
||||
if (QmsCommonConstant.ASSAY_TYPE_SINGLE_PARALLEL.equals(businessAssayTaskDataDO.getAssayType())) {
|
||||
//根据子样id及分析方法id,查询未上报的分析任务
|
||||
List<BusinessAssayTaskDataDO> unReportedList = businessAssayTaskDataMapper.selectIsReportedList(businessAssayTaskDataIdList, businessAssayTaskDataDO.getBusinessSubSampleId(), businessAssayTaskDataDO.getConfigAssayMethodId(), QmsCommonConstant.NO);
|
||||
if (unReportedList.size() > 0) {//还有未上报数据,直接处理,无需判定
|
||||
continue;
|
||||
} else {//做超差判定
|
||||
//根据子样id及分析方法id,查询已上报的分析任务
|
||||
List<BusinessAssayTaskDataDO> reportedList = businessAssayTaskDataMapper.selectIsReportedList(businessAssayTaskDataIdList, businessAssayTaskDataDO.getBusinessSubSampleId(), businessAssayTaskDataDO.getConfigAssayMethodId(), QmsCommonConstant.YES);
|
||||
if (reportedList.size() > 0) {
|
||||
List<Long> reportedBusinessAssayTaskDataIdList = reportedList.stream().map(m -> m.getId()).collect(Collectors.toList());
|
||||
businessAssayTaskDataIdList.addAll(reportedBusinessAssayTaskDataIdList);
|
||||
//查询判定结果数据
|
||||
BusinessSubSampleAssessmentProjectDO businessSubSampleAssessmentProjectDO = businessSubSampleAssessmentProjectMapper.selectByBusinessSubSampleIdAndConfigAssayMethodIdAndConfigAssayMethodProjectId(businessSubSampleId, businessAssayTaskDataDO.getConfigAssayMethodId(), businessAssayProjectDataDO.getConfigAssayMethodProjectId());
|
||||
if (businessSubSampleAssessmentProjectDO == null) {
|
||||
businessSubSampleAssessmentProjectDO = new BusinessSubSampleAssessmentProjectDO();
|
||||
|
||||
saveBusinessSubSampleAssessmentProjectDOList.add(businessSubSampleAssessmentProjectDO);
|
||||
} else {
|
||||
updateBusinessSubSampleAssessmentProjectDOList.add(businessSubSampleAssessmentProjectDO);
|
||||
}
|
||||
businessSubSampleAssessmentProjectDO.setBusinessSubParentSampleId(businessAssayTaskDataDO.getBusinessSubParentSampleId());
|
||||
businessSubSampleAssessmentProjectDO.setBusinessSubSampleId(businessAssayTaskDataDO.getBusinessSubSampleId());
|
||||
businessSubSampleAssessmentProjectDO.setBusinessSubSampleAssessmentId(businessSubSampleAssessmentDO.getId());
|
||||
businessSubSampleAssessmentProjectDO.setConfigAssayMethodId(businessAssayTaskDataDO.getConfigAssayMethodId());
|
||||
businessSubSampleAssessmentProjectDO.setConfigAssayMethodProjectId(businessAssayProjectDataDO.getConfigAssayMethodProjectId());
|
||||
businessSubSampleAssessmentProjectDO.setDictionaryProjectId(dictionaryProjectId);
|
||||
businessSubSampleAssessmentProjectDO.setDataType(businessAssayProjectDataDO.getDataType());
|
||||
businessSubSampleAssessmentProjectDO.setDecimalPosition(businessAssayProjectDataDO.getDecimalPosition());
|
||||
businessSubSampleAssessmentProjectDO.setAssayType(businessAssayTaskDataDO.getAssayType());
|
||||
businessSubSampleAssessmentProjectDO.setTaskType(businessAssayTaskDataDO.getTaskType());
|
||||
businessSubSampleAssessmentProjectDO.setUsage(businessAssayProjectDataDO.getUsage());
|
||||
businessSubSampleAssessmentProjectDO.setSymbol(businessAssayProjectDataDO.getSymbol());
|
||||
businessSubSampleAssessmentProjectDO.setAssessmentStatus(QmsCommonConstant.NORMAL);
|
||||
|
||||
// 排序并处理 null
|
||||
List<BigDecimal> sortedValues = val1.stream()
|
||||
.map(v -> {
|
||||
String val = v.getValueAfter();//补正后的值
|
||||
return val == null || val.trim().isEmpty() ? BigDecimal.ZERO : new BigDecimal(val.trim());
|
||||
})
|
||||
.sorted()
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// 获取小数精度
|
||||
int elementScale = businessAssayProjectDataDO.getDecimalPosition();
|
||||
// 计算代表值(均值或差值)
|
||||
BigDecimal representativeValue = calculateRepresentativeValue(sortedValues, elementScale);
|
||||
|
||||
//设置判定值
|
||||
businessSubSampleAssessmentProjectDO.setAssessmentValue(representativeValue.toPlainString());
|
||||
|
||||
// 查找匹配的允差规则
|
||||
ConfigAssayMethodProjectAssessmentDO matchedRule = findMatchingRule(configAssayMethodProjectAssessmentDOList, representativeValue);
|
||||
if (matchedRule == null) {
|
||||
throw new ServiceException(1_032_100_000, "未找到超差判定区间范围,元素ID: " + dictionaryProjectId + ", 值: " + representativeValue);
|
||||
}
|
||||
|
||||
// 计算允差值
|
||||
BigDecimal allowValue;
|
||||
try {
|
||||
allowValue = allowanceCalculatorComponent.calculateAllowableValue(new BigDecimal(matchedRule.getMinimumValue()), new BigDecimal(matchedRule.getMaximumValue()), new BigDecimal(matchedRule.getMinimumToleraanceValue()), new BigDecimal(matchedRule.getMaximumToleraanceValue()), new BigDecimal(matchedRule.getToleraanceAdjustmentValue()), representativeValue, matchedRule.getIsUseFormula(), matchedRule.getFormula(), elementScale);
|
||||
} catch (Exception e) {
|
||||
throw new ServiceException(1_032_100_000, "超差判定计算出错,检测项目ID: " + dictionaryProjectId);
|
||||
}
|
||||
|
||||
// 判断相邻差值是否超差
|
||||
for (int i = 0; i < sortedValues.size() - 1; i++) {
|
||||
BigDecimal diff = sortedValues.get(i + 1).subtract(sortedValues.get(i)).abs();
|
||||
if (diff.compareTo(allowValue) > 0) {
|
||||
businessSubSampleAssessmentProjectDO.setAssessmentStatus(QmsCommonConstant.EXCEEDS_TOLERANCE);
|
||||
//存在超差,设置为待判定
|
||||
businessSubSampleAssessmentDO.setReportedStatus(QmsCommonConstant.ASMT_PENDING_ASSESSMENT);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//如果为自动上报, 并且上报状态为待上报的
|
||||
if (QmsCommonConstant.AUTOMATIC.equals(configSubSampleMethodDO.getResultTreatmentWay()) && QmsCommonConstant.ASMT_PENDING_REPORT.equals(businessSubSampleAssessmentDO.getReportedStatus())) {
|
||||
automaticBusinessSubSampleAssessmentList.add(businessSubSampleAssessmentDO);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
} else if (QmsCommonConstant.ASSAY_TYPE_DOUBLE_CUP.equals(businessAssayTaskDataDO.getAssayType())) {
|
||||
|
||||
} else {//单杯
|
||||
|
||||
//查询判定业务
|
||||
BusinessSubSampleAssessmentDO businessSubSampleAssessmentDO = updateBusinessSubSampleAssessmentDOList.stream().filter(f -> f.getId().equals(businessAssayTaskDataDO.getBusinessSubSampleAssessmentId())).findFirst().orElse(null);
|
||||
if (businessSubSampleAssessmentDO == null) {
|
||||
businessSubSampleAssessmentDO = businessSubSampleAssessmentDOList.stream().filter(f -> f.getId().equals(businessAssayTaskDataDO.getBusinessSubSampleAssessmentId())).findFirst().orElse(null);
|
||||
updateBusinessSubSampleAssessmentDOList.add(businessSubSampleAssessmentDO);
|
||||
}
|
||||
//状态设置为待上报
|
||||
//修改状态为待上报
|
||||
businessSubSampleAssessmentDO.setReportedStatus(QmsCommonConstant.ASMT_PENDING_REPORT);
|
||||
|
||||
//查询分析项目
|
||||
List<BusinessAssayProjectDataDO> businessAssayProjectDataDOList = businessAssayProjectDataMapper.selectList(new LambdaQueryWrapperX<BusinessAssayProjectDataDO>().in(BusinessAssayProjectDataDO::getBusinessAssayTaskDataId, businessAssayTaskDataIdList));
|
||||
Map<Long, List<BusinessAssayProjectDataDO>> businessAssayProjectDataDOMap = businessAssayProjectDataDOList.stream().collect(Collectors.groupingBy(BusinessAssayProjectDataDO::getDictionaryProjectId));
|
||||
for (Map.Entry<Long, List<BusinessAssayProjectDataDO>> businessAssayProjectDataDOEntry : businessAssayProjectDataDOMap.entrySet()) {
|
||||
Long dictionaryProjectId = businessAssayProjectDataDOEntry.getKey();
|
||||
List<BusinessAssayProjectDataDO> val1 = businessAssayProjectDataDOEntry.getValue();
|
||||
BusinessAssayProjectDataDO businessAssayProjectDataDO = val1.get(0);
|
||||
List<ConfigAssayMethodProjectAssessmentDO> configAssayMethodProjectAssessmentDOList = configAssayMethodProjectAssessmentMapper.selectByConfigBaseSampleIdAndConfigAssayMethodIdAndConfigAssayMethodProjectId(configSubSampleMethodDO.getConfigBaseSampleId(), businessAssayTaskDataDO.getConfigAssayMethodId(), businessAssayProjectDataDO.getConfigAssayMethodProjectId());
|
||||
|
||||
|
||||
for (BusinessAssayProjectDataDO businessAssayProjectDataDO : businessAssayProjectDataDOList) {
|
||||
|
||||
//查询判定结果数据
|
||||
BusinessSubSampleAssessmentProjectDO businessSubSampleAssessmentProjectDO = businessSubSampleAssessmentProjectMapper.selectByBusinessSubSampleIdAndConfigAssayMethodIdAndConfigAssayMethodProjectId(businessSubSampleId, businessAssayTaskDataDO.getConfigAssayMethodId(), businessAssayProjectDataDO.getConfigAssayMethodProjectId());
|
||||
if (businessSubSampleAssessmentProjectDO == null) {
|
||||
@@ -706,120 +829,26 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic
|
||||
businessSubSampleAssessmentProjectDO.setBusinessSubSampleAssessmentId(businessSubSampleAssessmentDO.getId());
|
||||
businessSubSampleAssessmentProjectDO.setConfigAssayMethodId(businessAssayTaskDataDO.getConfigAssayMethodId());
|
||||
businessSubSampleAssessmentProjectDO.setConfigAssayMethodProjectId(businessAssayProjectDataDO.getConfigAssayMethodProjectId());
|
||||
businessSubSampleAssessmentProjectDO.setDictionaryProjectId(dictionaryProjectId);
|
||||
businessSubSampleAssessmentProjectDO.setDictionaryProjectId(businessAssayProjectDataDO.getDictionaryProjectId());
|
||||
businessSubSampleAssessmentProjectDO.setDataType(businessAssayProjectDataDO.getDataType());
|
||||
businessSubSampleAssessmentProjectDO.setDecimalPosition(businessAssayProjectDataDO.getDecimalPosition());
|
||||
businessSubSampleAssessmentProjectDO.setAssayType(businessAssayTaskDataDO.getAssayType());
|
||||
businessSubSampleAssessmentProjectDO.setTaskType(businessAssayTaskDataDO.getTaskType());
|
||||
businessSubSampleAssessmentProjectDO.setUsage(businessAssayProjectDataDO.getUsage());
|
||||
businessSubSampleAssessmentProjectDO.setMinimumLimitValue(businessAssayProjectDataDO.getMinimumLimitValue());
|
||||
businessSubSampleAssessmentProjectDO.setSymbol(businessAssayProjectDataDO.getSymbol());
|
||||
businessSubSampleAssessmentProjectDO.setAssessmentStatus(QmsCommonConstant.NORMAL);
|
||||
|
||||
// 排序并处理 null
|
||||
List<BigDecimal> sortedValues = val1.stream()
|
||||
.map(v -> {
|
||||
String val = v.getValue();
|
||||
return val == null || val.trim().isEmpty() ? BigDecimal.ZERO : new BigDecimal(val.trim());
|
||||
})
|
||||
.sorted()
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// 获取小数精度
|
||||
int elementScale = businessAssayProjectDataDO.getDecimalPosition();
|
||||
// 计算代表值(均值或差值)
|
||||
BigDecimal representativeValue = calculateRepresentativeValue(sortedValues, elementScale);
|
||||
|
||||
//设置判定值
|
||||
businessSubSampleAssessmentProjectDO.setAssessmentValue(representativeValue.toPlainString());
|
||||
|
||||
// 查找匹配的允差规则
|
||||
ConfigAssayMethodProjectAssessmentDO matchedRule = findMatchingRule(configAssayMethodProjectAssessmentDOList, representativeValue);
|
||||
if (matchedRule == null) {
|
||||
throw new ServiceException(1_032_100_000, "未找到超差判定区间范围,元素ID: " + dictionaryProjectId + ", 值: " + representativeValue);
|
||||
}
|
||||
|
||||
// 计算允差值
|
||||
BigDecimal allowValue;
|
||||
try {
|
||||
allowValue = allowanceCalculatorComponent.calculateAllowableValue(new BigDecimal(matchedRule.getMinimumValue()), new BigDecimal(matchedRule.getMaximumValue()), new BigDecimal(matchedRule.getMinimumToleraanceValue()), new BigDecimal(matchedRule.getMaximumToleraanceValue()), new BigDecimal(matchedRule.getToleraanceAdjustmentValue()), representativeValue, matchedRule.getIsUseFormula(), matchedRule.getFormula(), elementScale);
|
||||
} catch (Exception e) {
|
||||
throw new ServiceException(1_032_100_000, "超差判定计算出错,检测项目ID: " + dictionaryProjectId);
|
||||
}
|
||||
|
||||
// 判断相邻差值是否超差
|
||||
for (int i = 0; i < sortedValues.size() - 1; i++) {
|
||||
BigDecimal diff = sortedValues.get(i + 1).subtract(sortedValues.get(i)).abs();
|
||||
if (diff.compareTo(allowValue) > 0) {
|
||||
businessSubSampleAssessmentProjectDO.setAssessmentStatus(QmsCommonConstant.EXCEEDS_TOLERANCE);
|
||||
//存在超差,设置为待判定
|
||||
businessSubSampleAssessmentDO.setReportedStatus(QmsCommonConstant.ASMT_PENDING_ASSESSMENT);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
businessSubSampleAssessmentProjectDO.setAssessmentValue(businessAssayProjectDataDO.getValueAfter());//修改为赋值补正后的值
|
||||
}
|
||||
|
||||
//如果为自动上报, 并且上报状态为待上报的
|
||||
|
||||
//如果为自动上报
|
||||
if (QmsCommonConstant.AUTOMATIC.equals(configSubSampleMethodDO.getResultTreatmentWay()) && QmsCommonConstant.ASMT_PENDING_REPORT.equals(businessSubSampleAssessmentDO.getReportedStatus())) {
|
||||
automaticBusinessSubSampleIdList.add(businessSubSampleId);
|
||||
automaticBusinessSubSampleAssessmentList.add(businessSubSampleAssessmentDO);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
} else if (QmsCommonConstant.ASSAY_TYPE_DOUBLE_CUP.equals(businessAssayTaskDataDO.getAssayType())) {
|
||||
|
||||
} else {//单杯
|
||||
|
||||
|
||||
//查询判定业务
|
||||
BusinessSubSampleAssessmentDO businessSubSampleAssessmentDO = updateBusinessSubSampleAssessmentDOList.stream().filter(f -> f.getId().equals(businessAssayTaskDataDO.getBusinessSubSampleAssessmentId())).findFirst().orElse(null);
|
||||
if (businessSubSampleAssessmentDO == null) {
|
||||
businessSubSampleAssessmentDO = businessSubSampleAssessmentDOList.stream().filter(f -> f.getId().equals(businessAssayTaskDataDO.getBusinessSubSampleAssessmentId())).findFirst().orElse(null);
|
||||
updateBusinessSubSampleAssessmentDOList.add(businessSubSampleAssessmentDO);
|
||||
}
|
||||
//修改状态为待上报
|
||||
businessSubSampleAssessmentDO.setReportedStatus(QmsCommonConstant.ASMT_PENDING_REPORT);
|
||||
|
||||
//查询分析项目
|
||||
List<BusinessAssayProjectDataDO> businessAssayProjectDataDOList = businessAssayProjectDataMapper.selectList(new LambdaQueryWrapperX<BusinessAssayProjectDataDO>().in(BusinessAssayProjectDataDO::getBusinessAssayTaskDataId, businessAssayTaskDataIdList));
|
||||
|
||||
for (BusinessAssayProjectDataDO businessAssayProjectDataDO : businessAssayProjectDataDOList) {
|
||||
|
||||
//查询判定结果数据
|
||||
BusinessSubSampleAssessmentProjectDO businessSubSampleAssessmentProjectDO = businessSubSampleAssessmentProjectMapper.selectByBusinessSubSampleIdAndConfigAssayMethodIdAndConfigAssayMethodProjectId(businessSubSampleId, businessAssayTaskDataDO.getConfigAssayMethodId(), businessAssayProjectDataDO.getConfigAssayMethodProjectId());
|
||||
if (businessSubSampleAssessmentProjectDO == null) {
|
||||
businessSubSampleAssessmentProjectDO = new BusinessSubSampleAssessmentProjectDO();
|
||||
|
||||
saveBusinessSubSampleAssessmentProjectDOList.add(businessSubSampleAssessmentProjectDO);
|
||||
} else {
|
||||
updateBusinessSubSampleAssessmentProjectDOList.add(businessSubSampleAssessmentProjectDO);
|
||||
}
|
||||
businessSubSampleAssessmentProjectDO.setBusinessSubParentSampleId(businessAssayTaskDataDO.getBusinessSubParentSampleId());
|
||||
businessSubSampleAssessmentProjectDO.setBusinessSubSampleId(businessAssayTaskDataDO.getBusinessSubSampleId());
|
||||
businessSubSampleAssessmentProjectDO.setBusinessSubSampleAssessmentId(businessSubSampleAssessmentDO.getId());
|
||||
businessSubSampleAssessmentProjectDO.setConfigAssayMethodId(businessAssayTaskDataDO.getConfigAssayMethodId());
|
||||
businessSubSampleAssessmentProjectDO.setConfigAssayMethodProjectId(businessAssayProjectDataDO.getConfigAssayMethodProjectId());
|
||||
businessSubSampleAssessmentProjectDO.setDictionaryProjectId(businessAssayProjectDataDO.getDictionaryProjectId());
|
||||
businessSubSampleAssessmentProjectDO.setDataType(businessAssayProjectDataDO.getDataType());
|
||||
businessSubSampleAssessmentProjectDO.setDecimalPosition(businessAssayProjectDataDO.getDecimalPosition());
|
||||
businessSubSampleAssessmentProjectDO.setAssayType(businessAssayTaskDataDO.getAssayType());
|
||||
businessSubSampleAssessmentProjectDO.setTaskType(businessAssayTaskDataDO.getTaskType());
|
||||
businessSubSampleAssessmentProjectDO.setUsage(businessAssayProjectDataDO.getUsage());
|
||||
businessSubSampleAssessmentProjectDO.setMinimumLimitValue(businessAssayProjectDataDO.getMinimumLimitValue());
|
||||
businessSubSampleAssessmentProjectDO.setSymbol(businessAssayProjectDataDO.getSymbol());
|
||||
businessSubSampleAssessmentProjectDO.setAssessmentStatus(QmsCommonConstant.NORMAL);
|
||||
businessSubSampleAssessmentProjectDO.setAssessmentValue(businessAssayProjectDataDO.getValue());
|
||||
}
|
||||
|
||||
|
||||
//如果为自动上报
|
||||
if (QmsCommonConstant.AUTOMATIC.equals(configSubSampleMethodDO.getResultTreatmentWay())) {
|
||||
automaticBusinessSubSampleIdList.add(businessSubSampleId);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -838,7 +867,7 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic
|
||||
businessAssayTaskDO.setFlowStatus(QmsCommonConstant.RETURNED);
|
||||
}
|
||||
businessAssayTaskMapper.updateById(businessAssayTaskDO);
|
||||
|
||||
|
||||
if (updateBusinessSubSampleAssessmentDOList.size() > 0) {
|
||||
businessSubSampleAssessmentMapper.updateBatch(updateBusinessSubSampleAssessmentDOList);
|
||||
}
|
||||
@@ -850,9 +879,9 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic
|
||||
}
|
||||
|
||||
//执行自动上报
|
||||
if (automaticBusinessSubSampleIdList.size() > 0) {
|
||||
for (Long automaticBusinessSubSampleId : automaticBusinessSubSampleIdList) {
|
||||
this.assessmentDataReporting(automaticBusinessSubSampleId, businessAssayTaskDO.getConfigAssayMethodId());
|
||||
if (automaticBusinessSubSampleAssessmentList.size() > 0) {
|
||||
for (BusinessSubSampleAssessmentDO automaticBusinessSubSampleAssessment : automaticBusinessSubSampleAssessmentList) {
|
||||
this.assessmentDataReporting(automaticBusinessSubSampleAssessment.getBusinessSubSampleId(), businessAssayTaskDO.getConfigAssayMethodId(), automaticBusinessSubSampleAssessment.getRetestCount());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -936,29 +965,29 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void assessmentDataReporting(Long businessSubSampleId, Long configAssayMethodId) {
|
||||
public void assessmentDataReporting(Long businessSubSampleId, Long configAssayMethodId, Integer retestCount) {
|
||||
//当前登录用户昵称
|
||||
String nickName = SecurityFrameworkUtils.getLoginUserNickname();
|
||||
List<BusinessAssayTaskDataDO> unReportedList = businessAssayTaskDataMapper.selectIsReportedList(null, businessSubSampleId, configAssayMethodId, QmsCommonConstant.NO);
|
||||
List<BusinessAssayTaskDataDO> unReportedList = businessAssayTaskDataMapper.selectIsReportedList(null, businessSubSampleId, configAssayMethodId, retestCount, QmsCommonConstant.NO);
|
||||
if (unReportedList.size() > 0) {
|
||||
throw new ServiceException(1_032_100_000, "存在未上报的数据");
|
||||
}
|
||||
//自动上报
|
||||
List<Long> automaticBusinessSubParentSampleIdList = new ArrayList<>();
|
||||
List<BusinessSubParentSampleIdAndRetestCount> automaticBusinessSubParentSampleIdAndRetestCounts = new ArrayList<>();
|
||||
|
||||
List<BusinessSubParentSampleAssessmentProjectDO> businessSubParentSampleAssessmentDOList = new ArrayList<>();
|
||||
|
||||
//分析任务已全部上报
|
||||
List<BusinessAssayTaskDataDO> reportedList = businessAssayTaskDataMapper.selectIsReportedList(null, businessSubSampleId, configAssayMethodId, QmsCommonConstant.YES);
|
||||
List<BusinessAssayTaskDataDO> reportedList = businessAssayTaskDataMapper.selectIsReportedList(null, businessSubSampleId, configAssayMethodId, retestCount, QmsCommonConstant.YES);
|
||||
//判定结果
|
||||
List<BusinessSubSampleAssessmentProjectExtendRespVO> businessSubSampleAssessmentList = businessSubSampleAssessmentProjectMapper.selectByBusinessSubSampleIdAndConfigAssayMethodId(businessSubSampleId, configAssayMethodId);
|
||||
List<BusinessSubSampleAssessmentProjectExtendRespVO> businessSubSampleAssessmentList = businessSubSampleAssessmentProjectMapper.selectByBusinessSubSampleIdAndConfigAssayMethodIdAndRetestCount(businessSubSampleId, configAssayMethodId, retestCount);
|
||||
|
||||
List<Long> businessSubSampleAssessmentIdList = businessSubSampleAssessmentList.stream().map(m -> m.getId()).collect(Collectors.toList());
|
||||
|
||||
BusinessAssayTaskDataDO businessAssayTaskDataDO = reportedList.get(0);
|
||||
|
||||
//查询主样
|
||||
BusinessBaseSampleDO businessBaseSampleDO = businessBaseSampleMapper.selectById(businessAssayTaskDataDO.getBusinessBaseSampleId());
|
||||
//BusinessBaseSampleDO businessBaseSampleDO = businessBaseSampleMapper.selectById(businessAssayTaskDataDO.getBusinessBaseSampleId());
|
||||
|
||||
//查询分样
|
||||
BusinessSubParentSampleDO businessSubParentSampleDO = businessSubParentSampleMapper.selectById(businessAssayTaskDataDO.getBusinessSubParentSampleId());
|
||||
@@ -967,10 +996,10 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic
|
||||
ConfigSubSampleParentMethodDO configSubSampleParentMethodDO = configSubSampleParentMethodMapper.selectByConfigSubSampleParentIdAndConfigAssayMethodId(businessSubParentSampleDO.getConfigSubSampleParentId(), configAssayMethodId);
|
||||
|
||||
//子样判定
|
||||
BusinessSubSampleAssessmentDO businessSubSampleAssessmentDO = businessSubSampleAssessmentMapper.selectByBusinessSubSampleIdAndConfigAssayMethodId(businessSubSampleId, configAssayMethodId);
|
||||
BusinessSubSampleAssessmentDO businessSubSampleAssessmentDO = businessSubSampleAssessmentMapper.selectByBusinessSubSampleIdAndConfigAssayMethodIdAndRetestCount(businessSubSampleId, configAssayMethodId, retestCount);
|
||||
|
||||
//分样判定
|
||||
BusinessSubParentSampleAssessmentDO businessSubParentSampleAssessmentDO = businessSubParentSampleAssessmentMapper.selectByBusinessSubParentSampleIdAndConfigAssayMethodId(businessSubParentSampleDO.getId(), configAssayMethodId);
|
||||
BusinessSubParentSampleAssessmentDO businessSubParentSampleAssessmentDO = businessSubParentSampleAssessmentMapper.selectByBusinessSubParentSampleIdAndConfigAssayMethodIdAndRetestCount(businessSubParentSampleDO.getId(), configAssayMethodId, retestCount);
|
||||
|
||||
//循环判定值
|
||||
BusinessSubParentSampleAssessmentProjectDO businessSubParentSampleAssessmentProjectDO = null;
|
||||
@@ -1014,9 +1043,9 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic
|
||||
.in(BusinessSubSampleAssessmentProjectDO::getId, businessSubSampleAssessmentIdList));
|
||||
|
||||
if (QmsCommonConstant.AUTOMATIC.equals(configSubSampleParentMethodDO.getResultTreatmentWay())) {
|
||||
automaticBusinessSubParentSampleIdList.add(businessSubParentSampleDO.getId());
|
||||
automaticBusinessSubParentSampleIdAndRetestCounts.add(new BusinessSubParentSampleIdAndRetestCount(businessSubParentSampleDO.getId(), retestCount));
|
||||
BatchResultDataReportingReqVO batchResultDataReportingReqVO = new BatchResultDataReportingReqVO();
|
||||
batchResultDataReportingReqVO.setBusinessSubParentSampleIds(automaticBusinessSubParentSampleIdList);
|
||||
batchResultDataReportingReqVO.setBusinessSubParentSampleIdAndRetestCounts(automaticBusinessSubParentSampleIdAndRetestCounts);
|
||||
batchResultDataReportingReqVO.setConfigAssayMethodId(configAssayMethodId);
|
||||
|
||||
sampleResultReportingService.batchResultDataReporting(batchResultDataReportingReqVO);
|
||||
@@ -1034,7 +1063,7 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void createReAnalysis(Long businessSubSampleId, Long configAssayMethodId) {
|
||||
public void createReAnalysis(Long businessSubSampleId, Long configAssayMethodId, Integer retestCount) {
|
||||
//子样数据
|
||||
BusinessSubSampleDO businessSubSampleDO = businessSubSampleMapper.selectById(businessSubSampleId);
|
||||
|
||||
@@ -1048,7 +1077,7 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic
|
||||
List<BusinessAssayProjectDataDO> newBusinessAssayProjectDataDOList = new ArrayList<>();
|
||||
List<BusinessAssayParameterDataDO> newBusinessAssayParameterDataDOList = new ArrayList<>();
|
||||
|
||||
BusinessSubSampleAssessmentDO businessSubSampleAssessmentDO = businessSubSampleAssessmentMapper.selectByBusinessSubSampleIdAndConfigAssayMethodId(businessSubSampleId, configAssayMethodId);
|
||||
BusinessSubSampleAssessmentDO businessSubSampleAssessmentDO = businessSubSampleAssessmentMapper.selectByBusinessSubSampleIdAndConfigAssayMethodIdAndRetestCount(businessSubSampleId, configAssayMethodId, retestCount);
|
||||
|
||||
BusinessAssayTaskDataDO newBusinessAssayTaskDataDO = null;
|
||||
List<BusinessAssayTaskDataDO> businessAssayTaskDataDOList = businessAssayTaskDataMapper.selectMaxRecheckCountByBusinessSubSampleIdAndConfigAssayMethodId(businessSubSampleId, configAssayMethodId);
|
||||
@@ -1112,7 +1141,7 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic
|
||||
|
||||
//修改判定状态
|
||||
//查询判定值
|
||||
List<BusinessSubSampleAssessmentProjectExtendRespVO> businessSubSampleAssessmentList = businessSubSampleAssessmentProjectMapper.selectByBusinessSubSampleIdAndConfigAssayMethodId(businessSubSampleId, configAssayMethodId);
|
||||
List<BusinessSubSampleAssessmentProjectExtendRespVO> businessSubSampleAssessmentList = businessSubSampleAssessmentProjectMapper.selectByBusinessSubSampleIdAndConfigAssayMethodIdAndRetestCount(businessSubSampleId, configAssayMethodId, retestCount);
|
||||
for (BusinessSubSampleAssessmentProjectExtendRespVO businessSubSampleAssessmentProjectExtendRespVO : businessSubSampleAssessmentList) {
|
||||
businessSubSampleAssessmentProjectExtendRespVO.setAssessmentValue(null);
|
||||
businessSubSampleAssessmentProjectExtendRespVO.setAssessmentStatus(QmsCommonConstant.IN_PROGRESS);
|
||||
@@ -1170,7 +1199,7 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic
|
||||
List<BigDecimal> sortedValues = businessAssayProjectDataDOList.stream()
|
||||
.filter(f -> f.getIsNotAssessment().equals(QmsCommonConstant.NO))
|
||||
.map(v -> {
|
||||
String val = v.getValue();
|
||||
String val = v.getValueAfter();//设置为补正后的
|
||||
return val == null || val.trim().isEmpty() ? BigDecimal.ZERO : new BigDecimal(val.trim());
|
||||
})
|
||||
.sorted()
|
||||
|
||||
@@ -30,11 +30,17 @@ public interface SampleAnalysisService {
|
||||
BusinessAssayTaskAnalysisSampleAndQcProjectRespVO batchSampleAndQcAnalysisByTaskId(Long businessAssayTaskId);
|
||||
|
||||
/**
|
||||
* 下发配料
|
||||
* 下发配料(自动火试金配料)
|
||||
* @param businessAssayTaskId
|
||||
*/
|
||||
void issuedIngredients(Long businessAssayTaskId);
|
||||
|
||||
/**
|
||||
* 人工配料
|
||||
* @param businessAssayTaskId
|
||||
*/
|
||||
void manualIngredients(Long businessAssayTaskId);
|
||||
|
||||
/**
|
||||
* 根据任务单id提交分析数据
|
||||
* @param businessAssayTaskId 任务单id
|
||||
@@ -57,4 +63,5 @@ public interface SampleAnalysisService {
|
||||
void rollbackAnalysisSample(BusinessAssayTaskBackSampleReqVO req);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -529,6 +529,7 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService {
|
||||
businessAssayTaskAnalysisSampleAndQcProjectRespVO.setDataCollectionId(businessAssayTaskDO.getFormDataCollectionId());
|
||||
businessAssayTaskAnalysisSampleAndQcProjectRespVO.setFormValue(businessAssayTaskDO.getFormValue());
|
||||
businessAssayTaskAnalysisSampleAndQcProjectRespVO.setIsIngredients(businessAssayTaskDO.getIsIngredients());
|
||||
businessAssayTaskAnalysisSampleAndQcProjectRespVO.setIngredientsWay(businessAssayTaskDO.getIngredientsWay());
|
||||
businessAssayTaskAnalysisSampleAndQcProjectRespVO.setIngredientsStatus(businessAssayTaskDO.getIngredientsStatus());
|
||||
|
||||
ConfigAssayMethodDO configAssayMethodDO = configAssayMethodMapper.selectById(businessAssayTaskDO.getConfigAssayMethodId());
|
||||
@@ -1267,12 +1268,51 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService {
|
||||
|
||||
@Override
|
||||
public void submitSampleAnalysisByTaskId(Long businessAssayTaskId) {
|
||||
String loginUserNickname = SecurityFrameworkUtils.getLoginUserNickname();
|
||||
// String loginUserNickname = SecurityFrameworkUtils.getLoginUserNickname();
|
||||
BusinessAssayTaskDO businessAssayTaskDO = businessAssayTaskMapper.selectById(businessAssayTaskId);
|
||||
businessAssayTaskDO.setTaskAssayStatus(QmsCommonConstant.SUBMITTED);
|
||||
businessAssayTaskDO.setAssaySubmitTime(LocalDateTime.now());
|
||||
businessAssayTaskDO.setFinishStatus(QmsCommonConstant.IN_PROGRESS);
|
||||
businessAssayTaskDO.setFlowStatus(QmsCommonConstant.IN_PROGRESS);
|
||||
|
||||
List<BusinessAssayTaskDataExtendRespVO> businessAssayTaskDataExtendList = businessAssayTaskDataMapper.selectExtendByBusinessAssayTaskId(businessAssayTaskId);
|
||||
|
||||
//补正系数列表
|
||||
List<ConfigAssayMethodProjectCoefficientDO> configAssayMethodProjectCoefficientList = new ArrayList<>();
|
||||
if (businessAssayTaskDO.getIsIngredients().equals(QmsCommonConstant.YES) && QmsCommonConstant.MANUAL.equals(businessAssayTaskDO.getIngredientsWay())) {//如果是需要配料,并且是人工配料的
|
||||
List<Long> configBaseSampleIdList = businessAssayTaskDataExtendList.stream().map(m -> m.getConfigBaseSampleId()).distinct().collect(Collectors.toList());
|
||||
configAssayMethodProjectCoefficientList = configAssayMethodProjectCoefficientMapper.selectByConfigBaseSampleIds(configBaseSampleIdList);
|
||||
}
|
||||
|
||||
List<Long> businessAssayTaskDataIdList = businessAssayTaskDataExtendList.stream().map(m -> m.getId()).collect(Collectors.toList());
|
||||
List<BusinessAssayProjectDataExtendRespVO> businessAssayProjectDataExtendList = businessAssayProjectDataMapper.selectByBusinessAssayTaskDataIds(businessAssayTaskDataIdList);
|
||||
for (BusinessAssayProjectDataExtendRespVO businessAssayProjectDataExtend : businessAssayProjectDataExtendList) {
|
||||
if (businessAssayTaskDO.getIsIngredients().equals(QmsCommonConstant.YES) && QmsCommonConstant.MANUAL.equals(businessAssayTaskDO.getIngredientsWay())) {
|
||||
ConfigAssayMethodProjectCoefficientDO configAssayMethodProjectCoefficientDO = configAssayMethodProjectCoefficientList.stream().filter(f ->
|
||||
businessAssayProjectDataExtend.getConfigBaseSampleId().equals(f.getConfigBaseSampleId())
|
||||
&& businessAssayTaskDO.getConfigAssayMethodId().equals(f.getConfigAssayMethodId())
|
||||
&& businessAssayProjectDataExtend.getConfigAssayMethodProjectId().equals(f.getConfigAssayMethodProjectId())
|
||||
&& new BigDecimal(businessAssayProjectDataExtend.getValue()).compareTo(new BigDecimal(f.getMinimumValue())) > 0
|
||||
&& new BigDecimal(businessAssayProjectDataExtend.getValue()).compareTo(new BigDecimal(f.getMaximumValue())) <= 0
|
||||
).findFirst().orElse(null);
|
||||
if (configAssayMethodProjectCoefficientDO != null) {
|
||||
businessAssayProjectDataExtend.setConfigAssayMethodProjectCoefficientId(configAssayMethodProjectCoefficientDO.getId());//补正系数的id
|
||||
businessAssayProjectDataExtend.setCoefficient(configAssayMethodProjectCoefficientDO.getCoefficient());//补正系数
|
||||
String valueAfter = new BigDecimal(businessAssayProjectDataExtend.getValue()).multiply(configAssayMethodProjectCoefficientDO.getCoefficient()).setScale(businessAssayProjectDataExtend.getDecimalPosition(), RoundingMode.HALF_EVEN).toPlainString();
|
||||
businessAssayProjectDataExtend.setValueAfter(valueAfter);//补正后的值
|
||||
} else { //未找到补正系数,默认为1
|
||||
businessAssayProjectDataExtend.setCoefficient(new BigDecimal("1"));
|
||||
businessAssayProjectDataExtend.setValueAfter(businessAssayProjectDataExtend.getValue());
|
||||
}
|
||||
} else {
|
||||
businessAssayProjectDataExtend.setValueAfter(businessAssayProjectDataExtend.getValue());//不需要配料,补正后的值与补正前一致
|
||||
}
|
||||
}
|
||||
if (businessAssayProjectDataExtendList.size() > 0) {
|
||||
List<BusinessAssayProjectDataDO> businessAssayProjectDataList = BeanUtils.toBean(businessAssayProjectDataExtendList, BusinessAssayProjectDataDO.class);
|
||||
businessAssayProjectDataMapper.updateBatch(businessAssayProjectDataList);
|
||||
}
|
||||
|
||||
businessAssayTaskMapper.updateById(businessAssayTaskDO);
|
||||
}
|
||||
|
||||
@@ -1433,8 +1473,18 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService {
|
||||
|
||||
}
|
||||
}
|
||||
businessAssayTaskDO.setIngredientsWay(QmsCommonConstant.AUTOMATIC);//自动火试金配料
|
||||
businessAssayTaskDO.setIngredientsStatus(QmsCommonConstant.IN_PROGRESS);
|
||||
businessAssayTaskMapper.updateById(businessAssayTaskDO);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void manualIngredients(Long businessAssayTaskId) {
|
||||
BusinessAssayTaskDO businessAssayTaskDO = businessAssayTaskMapper.selectById(businessAssayTaskId);
|
||||
businessAssayTaskDO.setIngredientsWay(QmsCommonConstant.MANUAL);//人工配料
|
||||
businessAssayTaskDO.setIngredientsStatus(QmsCommonConstant.ALLOW_SUBMIT);//表示为允许提交
|
||||
businessAssayTaskMapper.updateById(businessAssayTaskDO);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -28,6 +28,7 @@ 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.BatchResultDataReportingReqVO.BusinessSubParentSampleIdAndRetestCount;
|
||||
import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubParentSampleAssessmentProjectExtendRespVO;
|
||||
import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubParentSampleAssessmentGroupReqVO;
|
||||
import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubParentSampleAssessmentGroupRespVO;
|
||||
@@ -443,7 +444,7 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe
|
||||
businessAssayTaskDataDO.setAssayType(assayType);
|
||||
businessAssayTaskDataDO.setTaskType("复测");
|
||||
businessAssayTaskDataDO.setConfigSampleFlowId(businessSubSampleDO.getConfigSampleFlowId());
|
||||
businessAssayTaskDataDO.setSampleFlowNodeKey(businessSubSampleDO.getSampleFlowNodeKey());
|
||||
businessAssayTaskDataDO.setSampleFlowNodeKey(QmsCommonConstant.FLOW_NODE_ANALYSIS);
|
||||
businessAssayTaskDataDO.setSampleFlowNodeTime(LocalDateTime.now());
|
||||
businessAssayTaskDataDO.setAssayDepartmentId(configAssayMethodDO.getAssayDepartmentId());
|
||||
businessAssayTaskDataDO.setAssayDepartmentName(configAssayMethodDO.getAssayDepartmentName());
|
||||
@@ -571,6 +572,9 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe
|
||||
List<BusinessAssayReportDataDO> saveBusinessAssayReportDataDOList = new ArrayList<>();
|
||||
List<BusinessAssayReportDataDO> updateBusinessAssayReportDataDOList = new ArrayList<>();
|
||||
|
||||
List<Long> businessSubParentSampleAssessmentIdList = new ArrayList<>();
|
||||
List<Long> businessSubParentSampleAssessmentProjectIdList = new ArrayList<>();
|
||||
|
||||
List<BusinessSubParentSampleAssessmentProjectExtendRespVO> businessSubParentSampleAssessmentExtendList = businessSubParentSampleAssessmentProjectMapper.selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(reqVO.getBusinessSubParentSampleIds(), reqVO.getConfigAssayMethodId());
|
||||
|
||||
List<BusinessSubParentSampleDO> businessSubParentSampleDOList = businessSubParentSampleMapper.selectByIds(reqVO.getBusinessSubParentSampleIds());
|
||||
@@ -615,33 +619,43 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe
|
||||
if (StringUtils.isNotBlank(assayData)) {
|
||||
assayDataJson = JSON.parseObject(assayData, new TypeReference<Map<String, ReportFieldValueData>>() {});
|
||||
}
|
||||
//循环判定值
|
||||
List<BusinessSubParentSampleAssessmentProjectExtendRespVO> 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<ConfigProjectExtendRespVO> 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);
|
||||
|
||||
//过滤分样id,根据多个复测次数处理
|
||||
List<BusinessSubParentSampleIdAndRetestCount> businessSubParentSampleIdAndRetestCountList = reqVO.getBusinessSubParentSampleIdAndRetestCounts().stream().filter(f -> f.getBusinessSubParentSampleId().equals(businessSubParentSampleDO.getId())).collect(Collectors.toList());
|
||||
for (BusinessSubParentSampleIdAndRetestCount businessSubParentSampleIdAndRetestCount : businessSubParentSampleIdAndRetestCountList) {
|
||||
|
||||
//循环判定值
|
||||
List<BusinessSubParentSampleAssessmentProjectExtendRespVO> businessSubParentSampleAssessmentList = businessSubParentSampleAssessmentExtendList.stream().filter(f -> f.getBusinessSubParentSampleId().equals(businessSubParentSampleDO.getId()) && f.getRetestCount().equals(businessSubParentSampleIdAndRetestCount.getRetestCount()) && "normal".equals(f.getAssessmentStatus())).collect(Collectors.toList());
|
||||
for (BusinessSubParentSampleAssessmentProjectExtendRespVO businessSubParentSampleAssessment : businessSubParentSampleAssessmentList) {
|
||||
businessSubParentSampleAssessmentProjectIdList.add(businessSubParentSampleAssessment.getId());
|
||||
businessSubParentSampleAssessmentIdList.add(businessSubParentSampleAssessment.getBusinessSubParentSampleAssessmentId());
|
||||
|
||||
if (configReportField == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
ReportFieldValueData reportFieldValueData = new ReportFieldValueData();
|
||||
reportFieldValueData.setFieldName(configReportField.getFieldName());
|
||||
reportFieldValueData.setFieldValue(businessSubParentSampleAssessment.getAssessmentValue());
|
||||
reportFieldValueData.setDataType(configReportField.getDataType());
|
||||
reportFieldValueData.setDecimalPosition(configReportField.getDecimalPosition());
|
||||
reportFieldValueData.setMathSymbol(businessSubParentSampleAssessment.getSymbol());
|
||||
reportFieldValueData.setUnit(configProjectFeild.getDictionaryProjectUnit());
|
||||
reportFieldValueData.setUsage(businessSubParentSampleAssessment.getUsage());
|
||||
reportFieldValueData.setMinLimitValue(businessSubParentSampleAssessment.getMinimumLimitValue());
|
||||
reportFieldValueData.setMethodName(businessSubParentSampleAssessment.getConfigAssayMethodName());
|
||||
assayDataJson.put(configReportField.getField(), reportFieldValueData);
|
||||
}
|
||||
Long configAssayMethodProjectId = businessSubParentSampleAssessment.getConfigAssayMethodProjectId();
|
||||
List<ConfigProjectExtendRespVO> 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);
|
||||
|
||||
if (configReportField == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
ReportFieldValueData reportFieldValueData = new ReportFieldValueData();
|
||||
reportFieldValueData.setFieldName(configReportField.getFieldName());
|
||||
reportFieldValueData.setFieldValue(businessSubParentSampleAssessment.getAssessmentValue());
|
||||
reportFieldValueData.setDataType(configReportField.getDataType());
|
||||
reportFieldValueData.setDecimalPosition(configReportField.getDecimalPosition());
|
||||
reportFieldValueData.setMathSymbol(businessSubParentSampleAssessment.getSymbol());
|
||||
reportFieldValueData.setUnit(configProjectFeild.getDictionaryProjectUnit());
|
||||
reportFieldValueData.setUsage(businessSubParentSampleAssessment.getUsage());
|
||||
reportFieldValueData.setMinLimitValue(businessSubParentSampleAssessment.getMinimumLimitValue());
|
||||
reportFieldValueData.setMethodName(businessSubParentSampleAssessment.getConfigAssayMethodName());
|
||||
assayDataJson.put(configReportField.getField(), reportFieldValueData);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//修改已上报数据来源
|
||||
String dataSource = businessAssayReportDataDO.getDataSource();
|
||||
Set<String> dataSources = StringUtils.isBlank(dataSource) ? new HashSet<>() : new HashSet<>(Arrays.asList(dataSource.split(",")));
|
||||
@@ -726,8 +740,9 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe
|
||||
//查询当前分析部门下的子样分析班组信息
|
||||
List<BusinessSubSampleAnalysisGroupDO> 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();
|
||||
//查询当前分样判定上报未上报的,并排除当前(上报方法和复测次数),的数量
|
||||
List<Integer> retestCountList = reqVO.getBusinessSubParentSampleIdAndRetestCounts().stream().filter(f -> f.getBusinessSubParentSampleId().equals(businessSubSampleAnalysisGroupDO.getBusinessSubParentSampleId())).map(m -> m.getRetestCount()).collect(Collectors.toList());
|
||||
long count = businessSubParentSampleAssessmentDOList.stream().filter(f -> f.getBusinessSubParentSampleId().equals(businessSubSampleAnalysisGroupDO.getBusinessSubParentSampleId()) && !( f.getConfigAssayMethodId().equals(reqVO.getConfigAssayMethodId()) && retestCountList.contains(f.getRetestCount()) ) && f.getIsReported().equals(QmsCommonConstant.NO)).count();
|
||||
if (count > 0) {//如果还存在未上报的数据,则继续
|
||||
continue;
|
||||
}
|
||||
@@ -776,41 +791,26 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe
|
||||
}
|
||||
|
||||
//查询正常上报的
|
||||
List<Long> businessSubParentSampleAssessmentIdList = businessSubParentSampleAssessmentExtendList.stream().filter(f -> "normal".equals(f.getAssessmentStatus())).map(m -> m.getId()).collect(Collectors.toList());
|
||||
//查询未上报的分样主id
|
||||
// List<Long> noAllReportBusinessSubParentSampleIdList = businessSubParentSampleAssessmentExtendList.stream().filter(f -> "in_progress".equals(f.getAssessmentStatus())).map(m -> m.getBusinessSubParentSampleId()).distinct().collect(Collectors.toList());
|
||||
//全部上报的
|
||||
// List<Long> allReportBusinessSubParentSampleIdList = new ArrayList<>();
|
||||
// if (noAllReportBusinessSubParentSampleIdList != null) {
|
||||
// allReportBusinessSubParentSampleIdList = reqVO.getBusinessSubParentSampleIds().stream().filter(item -> !noAllReportBusinessSubParentSampleIdList.contains(item)).collect(Collectors.toList());
|
||||
// }
|
||||
// List<Long> businessSubParentSampleAssessmentIdList = businessSubParentSampleAssessmentExtendList.stream().filter(f -> "normal".equals(f.getAssessmentStatus()) ).map(m -> m.getId()).collect(Collectors.toList());
|
||||
|
||||
businessSubParentSampleAssessmentProjectMapper.update(new LambdaUpdateWrapper<BusinessSubParentSampleAssessmentProjectDO>()
|
||||
.set(BusinessSubParentSampleAssessmentProjectDO::getIsReported, QmsCommonConstant.YES)
|
||||
.set(BusinessSubParentSampleAssessmentProjectDO::getReporter, nickName)
|
||||
.set(BusinessSubParentSampleAssessmentProjectDO::getReportTime, LocalDateTime.now())
|
||||
.in(BusinessSubParentSampleAssessmentProjectDO::getId, businessSubParentSampleAssessmentIdList));
|
||||
.in(BusinessSubParentSampleAssessmentProjectDO::getId, businessSubParentSampleAssessmentProjectIdList));
|
||||
|
||||
|
||||
// if (allReportBusinessSubParentSampleIdList.size() > 0) {
|
||||
// businessSubParentSampleAssessmentMapper.update(new LambdaUpdateWrapper<BusinessSubParentSampleAssessmentDO>()
|
||||
// .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<BusinessSubParentSampleAssessmentDO>()
|
||||
.set(BusinessSubParentSampleAssessmentDO::getIsReported, QmsCommonConstant.YES)
|
||||
.set(BusinessSubParentSampleAssessmentDO::getReporter, nickName)
|
||||
.set(BusinessSubParentSampleAssessmentDO::getReportTime, LocalDateTime.now())
|
||||
.in(BusinessSubParentSampleAssessmentDO::getBusinessSubParentSampleId, reqVO.getBusinessSubParentSampleIds())
|
||||
.eq(BusinessSubParentSampleAssessmentDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId()));
|
||||
.in(BusinessSubParentSampleAssessmentDO::getId, businessSubParentSampleAssessmentIdList));
|
||||
|
||||
if (updatebBusinessSampleEntrustRegistrationDOList.size() > 0) {
|
||||
businessSampleEntrustRegistrationMapper.updateBatch(updatebBusinessSampleEntrustRegistrationDOList);
|
||||
}
|
||||
|
||||
if (updateBusinessSubSampleDOList.size() > 0) {
|
||||
if (updateBusinessSubSampleDOList.size() > 0 && QmsCommonConstant.FLOW_NODE_ANALYSIS.equals(updateBusinessSubSampleDOList.get(0).getSampleFlowNodeKey())) {//仅当前节点在分析时,才操作
|
||||
SampleFlowParam sampleFlowParam = new SampleFlowParam();
|
||||
sampleFlowParam.setCurrentSampleFlowKey(QmsCommonConstant.FLOW_NODE_ANALYSIS);
|
||||
sampleFlowParam.setSampleSourceType(2);
|
||||
|
||||
@@ -3,6 +3,9 @@ package com.zt.plat.module.qms.business.bus.service;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
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.lang3.StringUtils;
|
||||
@@ -237,6 +240,9 @@ public class SampleTaskAssignServiceImpl implements SampleTaskAssignService {
|
||||
//查询子样分析方法及检测项目
|
||||
// List<ConfigAssayMethodProjectExtendRespVO> configAssayMethodProjectList = configAssayMethodProjectMapper.selectByConfigSubSampleIdsAndAssayDepartmentId(configSubSampleIdList, visitDeptId);
|
||||
|
||||
//根据样品大类,查询所有子样方法
|
||||
List<ConfigSubSampleMethodExtendRespVO> configSubSampleMethodList = configSubSampleMethodMapper.selectByBaseSampleId(baseSampleId);
|
||||
|
||||
//查询分析方法检测项目
|
||||
List<AssayMethodProjectRespVO> list = businessAssayProjectDataMapper.selectAssayMethodProjectByBusinessSubSampleIdListAndConfigAssayMethodId(businessSubSampleIdList, configAssayMethodId);
|
||||
|
||||
@@ -246,9 +252,15 @@ public class SampleTaskAssignServiceImpl implements SampleTaskAssignService {
|
||||
|
||||
for (AssayMethodProjectRespVO assayMethodProject : list) {
|
||||
List<ConfigAssayMethodProjectExtendRespVO> methodList = materialAssayStandardMethodList.stream().filter(f -> assayMethodProject.getDictionaryProjectId().equals(f.getDictionaryProjectId())).map(m -> {
|
||||
ConfigSubSampleMethodExtendRespVO configSubSampleMethodExtend = configSubSampleMethodList.stream().filter(f -> m.getConfigAssayMethodId().equals(f.getConfigAssayMethodId())).findFirst().orElse(null);
|
||||
String assayType = configSubSampleMethodExtend.getTaskCount() > 1 ? QmsCommonConstant.ASSAY_TYPE_SINGLE_PARALLEL : QmsCommonConstant.ASSAY_TYPE_SINGLE_CUP;
|
||||
if (m.getIsDualCup().equals(1)) {
|
||||
assayType = QmsCommonConstant.ASSAY_TYPE_DOUBLE_CUP;
|
||||
}
|
||||
ConfigAssayMethodProjectExtendRespVO configAssayMethod = new ConfigAssayMethodProjectExtendRespVO();
|
||||
configAssayMethod.setConfigAssayMethodId(m.getConfigAssayMethodId());
|
||||
configAssayMethod.setConfigAssayMethodName(m.getConfigAssayMethodName());
|
||||
configAssayMethod.setAssayType(assayType);
|
||||
configAssayMethod.setConfigAssayMethodNameAndCategory(m.getConfigAssayMethodNameAndCategory());
|
||||
return configAssayMethod;
|
||||
}).collect(Collectors.toList());
|
||||
@@ -258,6 +270,499 @@ public class SampleTaskAssignServiceImpl implements SampleTaskAssignService {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void changeMethod(ChangeAssayMethodReqVO req) {
|
||||
List<Long> businessSubSampleIdList = req.getBusinessSubSampleIdList();
|
||||
Long configAssayMethodId = req.getConfigAssayMethodId();
|
||||
List<AssayMethodProjectRespVO> changeConfigAssayMethodProjectList = req.getChangeConfigAssayMethodProjectList();
|
||||
|
||||
// 先按 configAssayMethodId 分组
|
||||
Map<Long, List<AssayMethodProjectRespVO>> groupedByConfigId = changeConfigAssayMethodProjectList.stream()
|
||||
.collect(Collectors.groupingBy(AssayMethodProjectRespVO::getConfigAssayMethodId));
|
||||
|
||||
// 遍历每个分组,检查 assayType 是否唯一
|
||||
for (Map.Entry<Long, List<AssayMethodProjectRespVO>> entry : groupedByConfigId.entrySet()) {
|
||||
List<AssayMethodProjectRespVO> group = entry.getValue();
|
||||
|
||||
// 获取该组所有非空的 assayType(去重)
|
||||
Set<String> assayTypes = group.stream()
|
||||
.map(AssayMethodProjectRespVO::getAssayType)
|
||||
.filter(Objects::nonNull)
|
||||
.collect(Collectors.toSet());
|
||||
|
||||
if (assayTypes.size() > 1) {
|
||||
// 取第一个元素的 configAssayMethodNameAndCategory 作为代表(假设同 configId 下名称一致)
|
||||
String methodName = group.get(0).getConfigAssayMethodNameAndCategory();
|
||||
if (methodName == null || methodName.trim().isEmpty()) {
|
||||
methodName = "(未命名)";
|
||||
}
|
||||
|
||||
throw new ServiceException(1_032_050_000,
|
||||
String.format("检测方法“%s”存在多种分析类型:%s,请确保同一检测方法仅对应一种分析类型。",
|
||||
methodName,
|
||||
assayTypes.stream().sorted().collect(Collectors.joining(", "))
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
List<Long> changeConfigAssayMethodIdList = changeConfigAssayMethodProjectList.stream().map(m -> m.getConfigAssayMethodId()).distinct().collect(Collectors.toList());
|
||||
|
||||
LocalDateTime currentDateTime = LocalDateTime.now();
|
||||
|
||||
//需要更新的报表数据
|
||||
List<BusinessAssayReportDataDO> updateBusinessAssayReportDataDOList = new ArrayList<>();
|
||||
|
||||
//需要更新的分析任务
|
||||
List<BusinessAssayTaskDataDO> updateBusinessAssayTaskDataDOList = new ArrayList<>();
|
||||
//需要更新的分析任务检测项目
|
||||
List<BusinessAssayProjectDataDO> updateBusinessAssayProjectDataDOList = new ArrayList<>();
|
||||
//需要更新的分析任务检测项目参数
|
||||
List<BusinessAssayParameterDataDO> updateBusinessAssayParameterDataDOList = new ArrayList<>();
|
||||
|
||||
//需要更新的子样判定
|
||||
List<BusinessSubSampleAssessmentDO> updateBusinessSubSampleAssessmentDOList = new ArrayList<>();
|
||||
|
||||
//需要更新的分样判定
|
||||
List<BusinessSubParentSampleAssessmentDO> updateBusinessSubParentSampleAssessmentDOList = new ArrayList<>();
|
||||
|
||||
//需要新建的分析任务
|
||||
List<BusinessAssayTaskDataDO> saveBusinessAssayTaskDataDOList = new ArrayList<>();
|
||||
//需要新建的分析任务检测项目
|
||||
List<BusinessAssayProjectDataDO> saveBusinessAssayProjectDataDOList = new ArrayList<>();
|
||||
//需要新建的分析任务检测项目参数
|
||||
List<BusinessAssayParameterDataDO> saveBusinessAssayParameterDataDOList = new ArrayList<>();
|
||||
|
||||
//需要新建的子样判定
|
||||
List<BusinessSubSampleAssessmentDO> saveBusinessSubSampleAssessmentDOList = new ArrayList<>();
|
||||
|
||||
//需要新建的分样判定
|
||||
List<BusinessSubParentSampleAssessmentDO> saveBusinessSubParentSampleAssessmentDOList = new ArrayList<>();
|
||||
|
||||
//需要删除的分析任务
|
||||
List<Long> removeAssayTaskDataIdList = new ArrayList<>();
|
||||
//需要删除的分析任务检测项目
|
||||
List<Long> removeAssayProjectIdList = new ArrayList<>();
|
||||
//需要删除的分析任务检测项目参数
|
||||
List<Long> removeAssayParameterIdList = new ArrayList<>();
|
||||
|
||||
//需要删除的子样判定
|
||||
List<Long> removeSubSampleAssessmentIdList = new ArrayList<>();
|
||||
|
||||
//需要删除的分样判定
|
||||
List<Long> removeSubParentSampleAssessmentIdList = new ArrayList<>();
|
||||
|
||||
//查询子样
|
||||
List<BusinessSubSampleDO> businessSubSampleDOList = businessSubSampleMapper.selectByIds(businessSubSampleIdList);
|
||||
List<Long> businessBaseSampleIdList = businessSubSampleDOList.stream().map(m -> m.getBusinessBaseSampleId()).distinct().collect(Collectors.toList());
|
||||
List<Long> businessSubParentSampleIdList = businessSubSampleDOList.stream().map(m -> m.getBusinessSubParentSampleId()).distinct().collect(Collectors.toList());
|
||||
List<Long> configSubSampleIdList = businessSubSampleDOList.stream().map(m -> m.getConfigSubSampleId()).distinct().collect(Collectors.toList());
|
||||
//查询检测任务 (通过分样id,可以查询双杯样的)
|
||||
List<BusinessAssayTaskDataDO> businessAssayTaskDataDOList = businessAssayTaskDataMapper.selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(businessSubParentSampleIdList, configAssayMethodId);
|
||||
|
||||
boolean disabled = businessAssayTaskDataDOList.stream().anyMatch(m -> m.getIsAssignTasked().equals(QmsCommonConstant.YES));
|
||||
if (disabled) {
|
||||
throw new ServiceException(1_032_001_000, "当前样品存在已分配任务,不允许修改分析方法");
|
||||
}
|
||||
|
||||
List<Long> businessAssayTaskDataIdList = businessAssayTaskDataDOList.stream().map(m -> m.getId()).collect(Collectors.toList());
|
||||
//查询检测任务的检测项目
|
||||
List<BusinessAssayProjectDataExtendRespVO> businessAssayProjectDataList = businessAssayProjectDataMapper.selectByBusinessAssayTaskDataIds(businessAssayTaskDataIdList);
|
||||
List<Long> businessAssayProjectDataIdList = businessAssayProjectDataList.stream().map(m -> m.getId()).collect(Collectors.toList());
|
||||
//查询检测任务的检测项目的参数
|
||||
List<BusinessAssayParameterDataDO> businessAssayParameterDataDOList = businessAssayParameterDataMapper.selectByBusinessAssayProjectDataIds(businessAssayProjectDataIdList);
|
||||
|
||||
//查询子样判定 (通过分样id,可以查询双杯样的)
|
||||
List<BusinessSubSampleAssessmentDO> businessSubSampleAssessmentDOList = businessSubSampleAssessmentMapper.selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(businessSubParentSampleIdList, configAssayMethodId);
|
||||
|
||||
//查询分样判定
|
||||
List<BusinessSubParentSampleAssessmentExtendRespVO> businessSubParentSampleAssessmentList = businessSubParentSampleAssessmentMapper.selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(businessSubParentSampleIdList, configAssayMethodId);
|
||||
|
||||
//查询要变更的分析方法配置
|
||||
List<ConfigAssayMethodDO> configAssayMethodDOList = configAssayMethodMapper.selectByIds(changeConfigAssayMethodIdList);
|
||||
//分析方法检测项目配置
|
||||
List<ConfigAssayMethodProjectExtendRespVO> configAssayMethodProjectList = configAssayMethodProjectMapper.selectByConfigAssayMethodIds(changeConfigAssayMethodIdList);
|
||||
//分析方法检测项目参数配置
|
||||
List<ConfigAssayMethodProjectParameterDO> configAssayMethodProjectParameterList = configAssayMethodProjectParameterMapper.selectByConfigAssayMethodIds(changeConfigAssayMethodIdList);
|
||||
//查询要变更的子样及分析方法配置
|
||||
List<ConfigSubSampleMethodExtendRespVO> configSubSampleMethodList = configSubSampleMethodMapper.selectByConfigSubSampleIdsAndConfigAssayMethodIds(configSubSampleIdList, changeConfigAssayMethodIdList);
|
||||
|
||||
//循环分样判定
|
||||
for (BusinessSubParentSampleAssessmentExtendRespVO businessSubParentSampleAssessment : businessSubParentSampleAssessmentList) {
|
||||
|
||||
//循环变更的分析方法
|
||||
for (Long changeConfigAssayMethodId : changeConfigAssayMethodIdList) {
|
||||
//如果当前分析方法不等于要变更的方法
|
||||
if (!businessSubParentSampleAssessment.getConfigAssayMethodId().equals(changeConfigAssayMethodId)) {
|
||||
//查询是否已有要变更的方法的分样判定
|
||||
BusinessSubParentSampleAssessmentDO businessSubParentSampleAssessmentDO = businessSubParentSampleAssessmentMapper.selectByBusinessSubParentSampleIdAndConfigAssayMethodIdAndRetestCount(businessSubParentSampleAssessment.getBusinessSubParentSampleId(), changeConfigAssayMethodId, businessSubParentSampleAssessment.getRetestCount());
|
||||
if (businessSubParentSampleAssessmentDO == null) {//不存在
|
||||
//根据变更方法过滤出检测项目
|
||||
List<Long> projectIdList = changeConfigAssayMethodProjectList.stream().filter(f -> f.getConfigAssayMethodId().equals(changeConfigAssayMethodId)).map(m -> m.getDictionaryProjectId()).distinct().collect(Collectors.toList());
|
||||
//分析类型
|
||||
String changeAssayType = changeConfigAssayMethodProjectList.stream().filter(f -> f.getConfigAssayMethodId().equals(changeConfigAssayMethodId)).map(m -> m.getAssayType()).distinct().findFirst().orElse(null);
|
||||
|
||||
|
||||
//查询分析方法
|
||||
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);
|
||||
switch (changeAssayType) {//根据前端传入的分析类型,修改子样分析方法中的分析任务数
|
||||
case QmsCommonConstant.ASSAY_TYPE_SINGLE_PARALLEL: {
|
||||
configSubSampleMethod.setTaskCount(2);//平行
|
||||
}
|
||||
default:
|
||||
configSubSampleMethod.setTaskCount(1);//单杯
|
||||
}
|
||||
|
||||
|
||||
//根据任务数判断是平行还是
|
||||
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<Long> 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<Long> 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<Long> 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<Long> 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<String> projectShowNameList = changeConfigAssayMethodProjectList.stream().filter(f -> f.getConfigAssayMethodId().equals(configAssayMethodId)).map(m -> m.getDictionaryProjectShowName()).distinct().collect(Collectors.toList());
|
||||
//查询旧的检测任务
|
||||
List<BusinessAssayTaskDataDO> 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<ConfigAssayMethodProjectExtendRespVO> 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<ConfigAssayMethodProjectParameterDO> 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 {//已存在
|
||||
//分析类型
|
||||
String changeAssayType = changeConfigAssayMethodProjectList.stream().filter(f -> f.getConfigAssayMethodId().equals(changeConfigAssayMethodId)).map(m -> m.getAssayType()).distinct().findFirst().orElse(null);
|
||||
if (!businessSubParentSampleAssessmentDO.getAssayType().equals(changeAssayType)) {
|
||||
String configAssayMethodNameAndCategory = changeConfigAssayMethodProjectList.stream().filter(f -> f.getConfigAssayMethodId().equals(changeConfigAssayMethodId)).map(m -> m.getConfigAssayMethodNameAndCategory()).distinct().findFirst().orElse(null);
|
||||
throw new ServiceException(1_032_001_000, "检测方法“"+configAssayMethodNameAndCategory+"”,存在与当前分析类型不同的分析任务!");
|
||||
}
|
||||
|
||||
//根据变更方法过滤出检测项目
|
||||
List<Long> 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<Long> 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<Long> 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<Long> 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<Long> 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<String> projectShowNameList = changeConfigAssayMethodProjectList.stream().filter(f -> f.getConfigAssayMethodId().equals(configAssayMethodId)).map(m -> m.getDictionaryProjectShowName()).distinct().collect(Collectors.toList());
|
||||
//查询旧的检测任务
|
||||
List<BusinessAssayTaskDataDO> 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<BusinessAssayTaskDataDO> currBusinessAssayTaskDataDOList = businessAssayTaskDataMapper.selectByBusinessSubParentSampleIdAndConfigAssayMethodId(businessSubParentSampleAssessmentDO.getBusinessSubParentSampleId(), changeConfigAssayMethodId);
|
||||
|
||||
//当前存在的分析任务循环
|
||||
for (BusinessAssayTaskDataDO businessAssayTaskDataDO : currBusinessAssayTaskDataDOList) {
|
||||
|
||||
List<ConfigAssayMethodProjectExtendRespVO> 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<ConfigAssayMethodProjectParameterDO> 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<BusinessAssayReportDataDO> businessAssayReportDataDOList = businessAssayReportDataMapper.selectBytBusinessBaseSampleIds(businessBaseSampleIdList);
|
||||
for (BusinessAssayReportDataDO businessAssayReportDataDO : businessAssayReportDataDOList) {
|
||||
String dataSource = businessAssayReportDataDO.getDataSource();
|
||||
if (dataSource.contains(req.getConfigAssayMethodId().toString())) {//判定是否存在
|
||||
List<Long> dataSourceList = new ArrayList<>();
|
||||
String[] dataSourceSplit = dataSource.split(",");
|
||||
for (int i = 0; i < dataSourceSplit.length; i++) {
|
||||
dataSourceList.add(Long.parseLong(dataSourceSplit[i]));
|
||||
}
|
||||
|
||||
//移除当前的
|
||||
dataSourceList.remove(req.getConfigAssayMethodId());
|
||||
//添加新的
|
||||
dataSourceList.addAll(changeConfigAssayMethodIdList);
|
||||
|
||||
//重新赋值
|
||||
businessAssayReportDataDO.setDataSource(CollUtil.join(dataSourceList, ","));
|
||||
|
||||
//添加到更新列表
|
||||
updateBusinessAssayReportDataDOList.add(businessAssayReportDataDO);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//======================== 删除 =====================================================================
|
||||
|
||||
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);
|
||||
}
|
||||
if (saveBusinessAssayProjectDataDOList.size() > 0) {
|
||||
businessAssayProjectDataMapper.insertBatch(saveBusinessAssayProjectDataDOList);
|
||||
}
|
||||
if (saveBusinessAssayParameterDataDOList.size() > 0) {
|
||||
businessAssayParameterDataMapper.insertBatch(saveBusinessAssayParameterDataDOList);
|
||||
}
|
||||
|
||||
if (saveBusinessSubSampleAssessmentDOList.size() > 0) {
|
||||
businessSubSampleAssessmentMapper.insertBatch(saveBusinessSubSampleAssessmentDOList);
|
||||
}
|
||||
|
||||
if (saveBusinessSubParentSampleAssessmentDOList.size() > 0) {
|
||||
businessSubParentSampleAssessmentMapper.insertBatch(saveBusinessSubParentSampleAssessmentDOList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void changeMethod(ChangeAssayMethodReqVO req) {
|
||||
@@ -353,7 +858,7 @@ public class SampleTaskAssignServiceImpl implements SampleTaskAssignService {
|
||||
//如果当前分析方法不等于要变更的方法
|
||||
if (!businessSubParentSampleAssessment.getConfigAssayMethodId().equals(changeConfigAssayMethodId)) {
|
||||
//查询是否已有要变更的方法的分样判定
|
||||
BusinessSubParentSampleAssessmentDO businessSubParentSampleAssessmentDO = businessSubParentSampleAssessmentMapper.selectByBusinessSubParentSampleIdAndConfigAssayMethodId(businessSubParentSampleAssessment.getBusinessSubParentSampleId(), changeConfigAssayMethodId);
|
||||
BusinessSubParentSampleAssessmentDO businessSubParentSampleAssessmentDO = businessSubParentSampleAssessmentMapper.selectByBusinessSubParentSampleIdAndConfigAssayMethodIdAndRetestCount(businessSubParentSampleAssessment.getBusinessSubParentSampleId(), changeConfigAssayMethodId, businessSubParentSampleAssessment.getRetestCount());
|
||||
if (businessSubParentSampleAssessmentDO == null) {//不存在
|
||||
//根据变更方法过滤出检测项目
|
||||
List<Long> projectIdList = changeConfigAssayMethodProjectList.stream().filter(f -> f.getConfigAssayMethodId().equals(changeConfigAssayMethodId)).map(m -> m.getDictionaryProjectId()).distinct().collect(Collectors.toList());
|
||||
@@ -699,7 +1204,8 @@ public class SampleTaskAssignServiceImpl implements SampleTaskAssignService {
|
||||
|
||||
|
||||
}
|
||||
|
||||
**/
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public LiteflowResponse methodAssign(SampleTaskAssignMethodParam param) {
|
||||
|
||||
@@ -14,6 +14,9 @@ import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH
|
||||
@Data
|
||||
public class ConfigAssayMethodProjectCoefficientPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "主样配置ID", example = "30107")
|
||||
private Long configBaseSampleId;
|
||||
|
||||
@Schema(description = "检测方法配置ID", example = "10243")
|
||||
private Long configAssayMethodId;
|
||||
|
||||
|
||||
@@ -17,6 +17,9 @@ public class ConfigAssayMethodProjectCoefficientRespVO {
|
||||
@ExcelProperty("ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "主样配置ID", example = "30107")
|
||||
private Long configBaseSampleId;
|
||||
|
||||
@Schema(description = "检测方法配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "10243")
|
||||
@ExcelProperty("检测方法配置ID")
|
||||
private Long configAssayMethodId;
|
||||
|
||||
@@ -13,6 +13,9 @@ public class ConfigAssayMethodProjectCoefficientSaveReqVO {
|
||||
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "26850")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "主样配置ID", example = "30107")
|
||||
private Long configBaseSampleId;
|
||||
|
||||
@Schema(description = "检测方法配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "10243")
|
||||
@NotNull(message = "检测方法配置ID不能为空")
|
||||
private Long configAssayMethodId;
|
||||
|
||||
@@ -20,4 +20,7 @@ public class ConfigAssayMethodProjectExtendRespVO extends ConfigAssayMethodProje
|
||||
|
||||
@Schema(description = "显示名称")
|
||||
private String showName;
|
||||
|
||||
@Schema(description = "分析类型 单杯-single_cup、双杯-double_cup、平行-single_parallel")
|
||||
private String assayType;
|
||||
}
|
||||
|
||||
@@ -13,6 +13,9 @@ import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH
|
||||
@Data
|
||||
public class ConfigAssayMethodProjectRangePageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "主样配置ID", example = "30107")
|
||||
private Long configBaseSampleId;
|
||||
|
||||
@Schema(description = "检测方法配置ID", example = "6862")
|
||||
private Long configAssayMethodId;
|
||||
|
||||
|
||||
@@ -16,6 +16,9 @@ public class ConfigAssayMethodProjectRangeRespVO {
|
||||
@ExcelProperty("ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "主样配置ID", example = "30107")
|
||||
private Long configBaseSampleId;
|
||||
|
||||
@Schema(description = "检测方法配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "6862")
|
||||
@ExcelProperty("检测方法配置ID")
|
||||
private Long configAssayMethodId;
|
||||
|
||||
@@ -12,6 +12,9 @@ public class ConfigAssayMethodProjectRangeSaveReqVO {
|
||||
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "25632")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "主样配置ID", example = "30107")
|
||||
private Long configBaseSampleId;
|
||||
|
||||
@Schema(description = "检测方法配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "6862")
|
||||
@NotNull(message = "检测方法配置ID不能为空")
|
||||
private Long configAssayMethodId;
|
||||
|
||||
@@ -33,6 +33,11 @@ public class ConfigAssayMethodProjectCoefficientDO 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")
|
||||
|
||||
@@ -32,6 +32,11 @@ public class ConfigAssayMethodProjectRangeDO 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")
|
||||
|
||||
@@ -19,6 +19,7 @@ public interface ConfigAssayMethodProjectCoefficientMapper extends BaseMapperX<C
|
||||
|
||||
default PageResult<ConfigAssayMethodProjectCoefficientDO> selectPage(ConfigAssayMethodProjectCoefficientPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<ConfigAssayMethodProjectCoefficientDO>()
|
||||
.eqIfPresent(ConfigAssayMethodProjectCoefficientDO::getConfigBaseSampleId, reqVO.getConfigBaseSampleId())
|
||||
.eqIfPresent(ConfigAssayMethodProjectCoefficientDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId())
|
||||
.eqIfPresent(ConfigAssayMethodProjectCoefficientDO::getConfigAssayMethodProjectId, reqVO.getConfigAssayMethodProjectId())
|
||||
.eqIfPresent(ConfigAssayMethodProjectCoefficientDO::getDictionaryProjectId, reqVO.getDictionaryProjectId())
|
||||
@@ -34,4 +35,9 @@ public interface ConfigAssayMethodProjectCoefficientMapper extends BaseMapperX<C
|
||||
.orderByDesc(ConfigAssayMethodProjectCoefficientDO::getId));
|
||||
}
|
||||
|
||||
default List<ConfigAssayMethodProjectCoefficientDO> selectByConfigBaseSampleIds(List<Long> configBaseSampleIdList){
|
||||
return selectList(new LambdaQueryWrapperX<ConfigAssayMethodProjectCoefficientDO>()
|
||||
.in(ConfigAssayMethodProjectCoefficientDO::getConfigBaseSampleId, configBaseSampleIdList));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -18,6 +18,7 @@ public interface ConfigAssayMethodProjectRangeMapper extends BaseMapperX<ConfigA
|
||||
|
||||
default PageResult<ConfigAssayMethodProjectRangeDO> selectPage(ConfigAssayMethodProjectRangePageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<ConfigAssayMethodProjectRangeDO>()
|
||||
.eqIfPresent(ConfigAssayMethodProjectRangeDO::getConfigBaseSampleId, reqVO.getConfigBaseSampleId())
|
||||
.eqIfPresent(ConfigAssayMethodProjectRangeDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId())
|
||||
.eqIfPresent(ConfigAssayMethodProjectRangeDO::getConfigAssayMethodProjectId, reqVO.getConfigAssayMethodProjectId())
|
||||
.eqIfPresent(ConfigAssayMethodProjectRangeDO::getDictionaryProjectId, reqVO.getDictionaryProjectId())
|
||||
|
||||
@@ -97,5 +97,18 @@ public interface ConfigSubSampleMethodMapper extends BaseMapperX<ConfigSubSample
|
||||
.selectAs(ConfigSubSampleParentMethodDO::getIsDefaultUse, ConfigSubSampleMethodExtendRespVO::getIsDefaultUse)
|
||||
.in(ConfigSubSampleMethodDO::getConfigSubSampleId, configSubSampleIds));
|
||||
}
|
||||
|
||||
default List<ConfigSubSampleMethodExtendRespVO> selectByBaseSampleId(Long baseSampleId) {
|
||||
return selectJoinList(ConfigSubSampleMethodExtendRespVO.class, new MPJLambdaWrapperX<ConfigSubSampleMethodDO>()
|
||||
.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)
|
||||
.eq(ConfigSubSampleDO::getBaseSampleId, baseSampleId));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -202,6 +202,13 @@ public class ReportDocumentDataServiceImpl implements ReportDocumentDataService
|
||||
if(!ObjectUtils.isEmpty(maxRowCountStr)) maxRowCount = Integer.parseInt(maxRowCountStr);
|
||||
int rowLength = rowList.size();
|
||||
if(rowLength <= maxRowCount){
|
||||
//以下为空白
|
||||
if(rowList.size() < maxRowCount){
|
||||
JSONObject t = new JSONObject();
|
||||
t.put(colPrefix + "01", emptyText);
|
||||
putEmptyData(t, 2,10);
|
||||
rowList.add(t.clone());
|
||||
}
|
||||
pageRowList.add(rowList);
|
||||
return assemblePageResult(mainData, pageRowList, maxRowCount);
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import org.springframework.stereotype.Component;
|
||||
|
||||
import com.alibaba.qlexpress4.Express4Runner;
|
||||
import com.alibaba.qlexpress4.QLOptions;
|
||||
import com.alibaba.qlexpress4.QLResult;
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -87,8 +88,8 @@ public class AllowanceCalculatorComponent {
|
||||
|
||||
try {
|
||||
// Object result = expressRunner.execute(formula, context, null, true, false);
|
||||
Object result = express4Runner.execute(formula, context, QLOptions.builder().precise(true).build());
|
||||
|
||||
QLResult execute = express4Runner.execute(formula, context, QLOptions.builder().precise(true).build());
|
||||
Object result = execute.getResult();
|
||||
if (result == null) {
|
||||
throw new RuntimeException("Express 公式返回结果为 null");
|
||||
}
|
||||
|
||||
@@ -58,14 +58,14 @@ public class SupplierController extends AbstractFileUploadController implements
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建供应商")
|
||||
@PreAuthorize("@ss.hasPermission('qms:supplier:create')")
|
||||
// @PreAuthorize("@ss.hasPermission('qms:supplier:create')")
|
||||
public CommonResult<SupplierRespVO> createSupplier(@Valid @RequestBody SupplierSaveReqVO createReqVO) {
|
||||
return success(supplierService.createSupplier(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新供应商")
|
||||
@PreAuthorize("@ss.hasPermission('qms:supplier:update')")
|
||||
// @PreAuthorize("@ss.hasPermission('qms:supplier:update')")
|
||||
public CommonResult<Boolean> updateSupplier(@Valid @RequestBody SupplierSaveReqVO updateReqVO) {
|
||||
supplierService.updateSupplier(updateReqVO);
|
||||
return success(true);
|
||||
@@ -74,7 +74,7 @@ public class SupplierController extends AbstractFileUploadController implements
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除供应商")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('qms:supplier:delete')")
|
||||
// @PreAuthorize("@ss.hasPermission('qms:supplier:delete')")
|
||||
public CommonResult<Boolean> deleteSupplier(@RequestParam("id") Long id) {
|
||||
supplierService.deleteSupplier(id);
|
||||
return success(true);
|
||||
@@ -92,7 +92,7 @@ public class SupplierController extends AbstractFileUploadController implements
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得供应商")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('qms:supplier:query')")
|
||||
// @PreAuthorize("@ss.hasPermission('qms:supplier:query')")
|
||||
public CommonResult<SupplierExtendRespVO> getSupplier(@RequestParam("id") Long id) {
|
||||
SupplierExtendRespVO supplier = supplierService.getSupplier(id);
|
||||
return success(supplier);
|
||||
@@ -100,7 +100,7 @@ public class SupplierController extends AbstractFileUploadController implements
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得供应商分页")
|
||||
@PreAuthorize("@ss.hasPermission('qms:supplier:query')")
|
||||
// @PreAuthorize("@ss.hasPermission('qms:supplier:query')")
|
||||
public CommonResult<PageResult<SupplierRespVO>> getSupplierPage(@Valid SupplierPageReqVO pageReqVO) {
|
||||
PageResult<SupplierDO> pageResult = supplierService.getSupplierPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, SupplierRespVO.class));
|
||||
|
||||
@@ -40,12 +40,21 @@ public interface SupplierMapper extends BaseMapperX<SupplierDO> {
|
||||
|
||||
default SupplierExtendRespVO selectOneWithCertifications(Long id) {
|
||||
return selectJoinOne(SupplierExtendRespVO.class,
|
||||
// new MPJLambdaWrapperX<SupplierDO>()
|
||||
// .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)
|
||||
new MPJLambdaWrapperX<SupplierDO>()
|
||||
.selectAll(SupplierDO.class)
|
||||
.selectCollection(SupplierPropertiesDO.class, SupplierExtendRespVO::getSupplierPropertiesList)
|
||||
.leftJoin(SupplierPropertiesDO.class, SupplierPropertiesDO::getSupplierId, SupplierDO::getId)
|
||||
// 将关联条件写在一个 on() 方法内
|
||||
.leftJoin(SupplierPropertiesDO.class, on -> on
|
||||
.eq(SupplierPropertiesDO::getSupplierId, SupplierDO::getId)
|
||||
.eq(SupplierPropertiesDO::getBusinessType, QmsSupplierConstant.CERTIFICATION_KEY)
|
||||
) // 注意这里移除了之前的 .eq 条件
|
||||
.eq(SupplierDO::getId, id)
|
||||
.eq(SupplierPropertiesDO::getBusinessType, QmsSupplierConstant.CERTIFICATION_KEY)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
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.DeviceApplyPageReqVO;
|
||||
import com.zt.plat.module.qms.resource.device.controller.vo.DeviceApplyRespVO;
|
||||
import com.zt.plat.module.qms.resource.device.controller.vo.DeviceApplySaveReqVO;
|
||||
@@ -52,15 +53,31 @@ public class DeviceApplyController extends AbstractFileUploadController implemen
|
||||
}
|
||||
}
|
||||
|
||||
@Resource
|
||||
private DeviceApplyService deviceApplyService;
|
||||
@Resource private DeviceApplyService deviceApplyService;
|
||||
|
||||
//todo 通过设备通用流程配置创建
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建设备通用流程,验收、降级、停用、报废、还原、启用")
|
||||
// @PreAuthorize("@ss.hasPermission('qms:device-apply:create')")
|
||||
public CommonResult<DeviceApplyRespVO> createDeviceApply(@Valid @RequestBody DeviceApplySaveReqVO createReqVO) {
|
||||
return success(deviceApplyService.createDeviceApply(createReqVO));
|
||||
@RequestMapping("/createTempData")
|
||||
@Operation(summary = "创建临时数据")
|
||||
public CommonResult<DeviceApplyRespVO> createTempData(@RequestBody DeviceApplySaveReqVO createReqVO) {
|
||||
return deviceApplyService.createTempData(createReqVO);
|
||||
}
|
||||
|
||||
@RequestMapping("/saveDeviceApply")
|
||||
@Operation(summary = "保存申请数据")
|
||||
public CommonResult<Boolean> saveDeviceApply(@Valid @RequestBody DeviceApplySaveReqVO createReqVO) {
|
||||
return deviceApplyService.saveDeviceApply(createReqVO);
|
||||
}
|
||||
|
||||
@RequestMapping("/addDetail")
|
||||
@Operation(summary = "增加明细")
|
||||
public CommonResult<Boolean> addDetail(@RequestBody JSONObject param) {
|
||||
return deviceApplyService.addDetail(param);
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping("/removeDetail")
|
||||
@Operation(summary = "删除明细")
|
||||
public CommonResult<Boolean> removeDetail(@RequestBody JSONObject param) {
|
||||
return deviceApplyService.removeDetail(param);
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
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 com.zt.plat.module.qms.resource.device.controller.vo.*;
|
||||
import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceApplyDO;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -55,6 +54,13 @@ public class DeviceApplyDetailController extends AbstractFileUploadController im
|
||||
@Resource
|
||||
private DeviceApplyDetailService deviceApplyDetailService;
|
||||
|
||||
@GetMapping("/list")
|
||||
@Operation(summary = "获得设备通用流程分页")
|
||||
public CommonResult<List<DeviceApplyDetailRespVO>> list(DeviceApplyDetailPageReqVO reqVO) {
|
||||
List<DeviceApplyDetailDO> list = deviceApplyDetailService.selectList(reqVO);
|
||||
return success(BeanUtils.toBean(list, DeviceApplyDetailRespVO.class));
|
||||
}
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建设备通用流程明细")
|
||||
@PreAuthorize("@ss.hasPermission('qms:device-apply-detail:create')")
|
||||
|
||||
@@ -57,14 +57,14 @@ public class DeviceConfigBusinessItemController extends AbstractFileUploadContro
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建设备-检查项目配置")
|
||||
@PreAuthorize("@ss.hasPermission('qms:device-config-business-item:create')")
|
||||
// @PreAuthorize("@ss.hasPermission('qms:device-config-business-item:create')")
|
||||
public CommonResult<DeviceConfigBusinessItemRespVO> createDeviceConfigBusinessItem(@Valid @RequestBody DeviceConfigBusinessItemSaveReqVO createReqVO) {
|
||||
return success(deviceConfigBusinessItemService.createDeviceConfigBusinessItem(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新设备-检查项目配置")
|
||||
@PreAuthorize("@ss.hasPermission('qms:device-config-business-item:update')")
|
||||
// @PreAuthorize("@ss.hasPermission('qms:device-config-business-item:update')")
|
||||
public CommonResult<Boolean> updateDeviceConfigBusinessItem(@Valid @RequestBody DeviceConfigBusinessItemSaveReqVO updateReqVO) {
|
||||
deviceConfigBusinessItemService.updateDeviceConfigBusinessItem(updateReqVO);
|
||||
return success(true);
|
||||
@@ -73,7 +73,7 @@ public class DeviceConfigBusinessItemController extends AbstractFileUploadContro
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除设备-检查项目配置")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('qms:device-config-business-item:delete')")
|
||||
// @PreAuthorize("@ss.hasPermission('qms:device-config-business-item:delete')")
|
||||
public CommonResult<Boolean> deleteDeviceConfigBusinessItem(@RequestParam("id") Long id) {
|
||||
deviceConfigBusinessItemService.deleteDeviceConfigBusinessItem(id);
|
||||
return success(true);
|
||||
@@ -82,7 +82,7 @@ public class DeviceConfigBusinessItemController extends AbstractFileUploadContro
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除设备-检查项目配置")
|
||||
@PreAuthorize("@ss.hasPermission('qms:device-config-business-item:delete')")
|
||||
// @PreAuthorize("@ss.hasPermission('qms:device-config-business-item:delete')")
|
||||
public CommonResult<Boolean> deleteDeviceConfigBusinessItemList(@RequestBody BatchDeleteReqVO req) {
|
||||
deviceConfigBusinessItemService.deleteDeviceConfigBusinessItemListByIds(req.getIds());
|
||||
return success(true);
|
||||
@@ -91,7 +91,7 @@ public class DeviceConfigBusinessItemController extends AbstractFileUploadContro
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得设备-检查项目配置")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('qms:device-config-business-item:query')")
|
||||
// @PreAuthorize("@ss.hasPermission('qms:device-config-business-item:query')")
|
||||
public CommonResult<DeviceConfigBusinessItemRespVO> getDeviceConfigBusinessItem(@RequestParam("id") Long id) {
|
||||
DeviceConfigBusinessItemDO deviceConfigBusinessItem = deviceConfigBusinessItemService.getDeviceConfigBusinessItem(id);
|
||||
return success(BeanUtils.toBean(deviceConfigBusinessItem, DeviceConfigBusinessItemRespVO.class));
|
||||
@@ -99,7 +99,7 @@ public class DeviceConfigBusinessItemController extends AbstractFileUploadContro
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得设备-检查项目配置分页")
|
||||
@PreAuthorize("@ss.hasPermission('qms:device-config-business-item:query')")
|
||||
// @PreAuthorize("@ss.hasPermission('qms:device-config-business-item:query')")
|
||||
public CommonResult<PageResult<DeviceConfigBusinessItemRespVO>> getDeviceConfigBusinessItemPage(@Valid DeviceConfigBusinessItemPageReqVO pageReqVO) {
|
||||
PageResult<DeviceConfigBusinessItemDO> pageResult = deviceConfigBusinessItemService.getDeviceConfigBusinessItemPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, DeviceConfigBusinessItemRespVO.class));
|
||||
@@ -107,7 +107,7 @@ public class DeviceConfigBusinessItemController extends AbstractFileUploadContro
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出设备-检查项目配置 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('qms:device-config-business-item:export')")
|
||||
// @PreAuthorize("@ss.hasPermission('qms:device-config-business-item:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportDeviceConfigBusinessItemExcel(@Valid DeviceConfigBusinessItemPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
|
||||
@@ -55,14 +55,14 @@ public class DeviceConfigFlowController implements BusinessControllerMarker {
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建设备通用流程配置")
|
||||
@PreAuthorize("@ss.hasPermission('qms:device-config-flow:create')")
|
||||
// @PreAuthorize("@ss.hasPermission('qms:device-config-flow:create')")
|
||||
public CommonResult<DeviceConfigFlowRespVO> createDeviceConfigFlow(@Valid @RequestBody DeviceConfigFlowSaveReqVO createReqVO) {
|
||||
return success(deviceConfigFlowService.createDeviceConfigFlow(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新设备通用流程配置")
|
||||
@PreAuthorize("@ss.hasPermission('qms:device-config-flow:update')")
|
||||
// @PreAuthorize("@ss.hasPermission('qms:device-config-flow:update')")
|
||||
public CommonResult<Boolean> updateDeviceConfigFlow(@Valid @RequestBody DeviceConfigFlowSaveReqVO updateReqVO) {
|
||||
deviceConfigFlowService.updateDeviceConfigFlow(updateReqVO);
|
||||
return success(true);
|
||||
@@ -71,7 +71,7 @@ public class DeviceConfigFlowController implements BusinessControllerMarker {
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除设备通用流程配置")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('qms:device-config-flow:delete')")
|
||||
// @PreAuthorize("@ss.hasPermission('qms:device-config-flow:delete')")
|
||||
public CommonResult<Boolean> deleteDeviceConfigFlow(@RequestParam("id") Long id) {
|
||||
deviceConfigFlowService.deleteDeviceConfigFlow(id);
|
||||
return success(true);
|
||||
@@ -80,7 +80,7 @@ public class DeviceConfigFlowController implements BusinessControllerMarker {
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除设备通用流程配置")
|
||||
@PreAuthorize("@ss.hasPermission('qms:device-config-flow:delete')")
|
||||
// @PreAuthorize("@ss.hasPermission('qms:device-config-flow:delete')")
|
||||
public CommonResult<Boolean> deleteDeviceConfigFlowList(@RequestBody BatchDeleteReqVO req) {
|
||||
deviceConfigFlowService.deleteDeviceConfigFlowListByIds(req.getIds());
|
||||
return success(true);
|
||||
@@ -89,7 +89,7 @@ public class DeviceConfigFlowController implements BusinessControllerMarker {
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得设备通用流程配置")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('qms:device-config-flow:query')")
|
||||
// @PreAuthorize("@ss.hasPermission('qms:device-config-flow:query')")
|
||||
public CommonResult<DeviceConfigFlowRespVO> getDeviceConfigFlow(@RequestParam("id") Long id) {
|
||||
DeviceConfigFlowDO deviceConfigFlow = deviceConfigFlowService.getDeviceConfigFlow(id);
|
||||
return success(BeanUtils.toBean(deviceConfigFlow, DeviceConfigFlowRespVO.class));
|
||||
@@ -104,7 +104,7 @@ public class DeviceConfigFlowController implements BusinessControllerMarker {
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出设备通用流程配置 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('qms:device-config-flow:export')")
|
||||
// @PreAuthorize("@ss.hasPermission('qms:device-config-flow:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportDeviceConfigFlowExcel(@Valid DeviceConfigFlowPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
|
||||
@@ -35,4 +35,7 @@ public class DeviceApplyDetailPageReqVO extends PageParam {
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
//扩展字段
|
||||
@Schema(description = "设备id列表")
|
||||
private List<Long> deviceInfoIdList;
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.zt.plat.module.qms.resource.device.controller.vo;
|
||||
|
||||
import com.zt.plat.module.qms.core.aspect.annotation.Dict;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
@@ -49,6 +50,7 @@ public class DeviceApplyRespVO {
|
||||
|
||||
@Schema(description = "业务状态", example = "1")
|
||||
@ExcelProperty("业务状态")
|
||||
@Dict(dicCode = "flow_status")
|
||||
private String businessStatus;
|
||||
|
||||
@Schema(description = "借用人")
|
||||
|
||||
@@ -45,7 +45,7 @@ public class DeviceApplyDO extends BusinessBaseDO {
|
||||
* 申请部门ID
|
||||
*/
|
||||
@TableField("APL_DEPT")
|
||||
private String applyDepartment;
|
||||
private Long applyDepartment;
|
||||
/**
|
||||
* 申请人
|
||||
*/
|
||||
@@ -55,7 +55,7 @@ public class DeviceApplyDO extends BusinessBaseDO {
|
||||
* 申请人ID
|
||||
*/
|
||||
@TableField("APL_USER")
|
||||
private String applyUser;
|
||||
private Long applyUser;
|
||||
/**
|
||||
* 业务编码
|
||||
*/
|
||||
@@ -115,7 +115,7 @@ public class DeviceApplyDO extends BusinessBaseDO {
|
||||
* 表单模板ID
|
||||
*/
|
||||
@TableField("TMPL_ID")
|
||||
private String templateId;
|
||||
private Long templateId;
|
||||
/**
|
||||
* 表单组件
|
||||
*/
|
||||
|
||||
@@ -7,6 +7,8 @@ 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;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设备通用流程明细 Mapper
|
||||
*
|
||||
@@ -27,4 +29,18 @@ public interface DeviceApplyDetailMapper extends BaseMapperX<DeviceApplyDetailDO
|
||||
.orderByDesc(DeviceApplyDetailDO::getId));
|
||||
}
|
||||
|
||||
default List<DeviceApplyDetailDO> selectList(DeviceApplyDetailPageReqVO reqVO) {
|
||||
return selectList(new LambdaQueryWrapperX<DeviceApplyDetailDO>()
|
||||
.eqIfPresent(DeviceApplyDetailDO::getApplyId, reqVO.getApplyId())
|
||||
.eqIfPresent(DeviceApplyDetailDO::getDeviceInfomationId, reqVO.getDeviceInfomationId())
|
||||
.inIfPresent(DeviceApplyDetailDO::getDeviceInfomationId, reqVO.getDeviceInfoIdList())
|
||||
.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));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -4,10 +4,14 @@ 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.enums.QmsCommonConstant;
|
||||
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;
|
||||
|
||||
import static com.zt.plat.module.qms.enums.QmsPermissionConstant.DEPT_DATA_AND_SUB;
|
||||
import static com.zt.plat.module.qms.enums.QmsPermissionConstant.DEVICE_MANAGER;
|
||||
|
||||
/**
|
||||
* 设备通用流程,验收、降级、停用、报废、还原、启用 Mapper
|
||||
*
|
||||
@@ -16,10 +20,11 @@ import org.apache.ibatis.annotations.Mapper;
|
||||
@Mapper
|
||||
public interface DeviceApplyMapper extends BaseMapperX<DeviceApplyDO> {
|
||||
|
||||
@QmsPermission
|
||||
@QmsPermission(deptDataRoleCodes = DEPT_DATA_AND_SUB, moduleDataRoleCodes = DEVICE_MANAGER)
|
||||
default PageResult<DeviceApplyDO> selectPage(DeviceApplyPageReqVO reqVO) {
|
||||
LambdaQueryWrapperX<DeviceApplyDO> wrapper = new LambdaQueryWrapperX<>();
|
||||
wrapper.likeIfPresent(DeviceApplyDO::getBusinessName, reqVO.getBusinessName())
|
||||
wrapper.neIfPresent(DeviceApplyDO::getBusinessStatus, QmsCommonConstant.TEMP_DATA_CODE)
|
||||
.likeIfPresent(DeviceApplyDO::getBusinessName, reqVO.getBusinessName())
|
||||
.likeIfPresent(DeviceApplyDO::getApplyDepartmentName, reqVO.getApplyDepartmentName())
|
||||
.eqIfPresent(DeviceApplyDO::getApplyDepartment, reqVO.getApplyDepartment())
|
||||
.likeIfPresent(DeviceApplyDO::getApplyUserName, reqVO.getApplyUserName())
|
||||
|
||||
@@ -13,6 +13,9 @@ import org.apache.ibatis.annotations.Param;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static com.zt.plat.module.qms.enums.QmsPermissionConstant.DEPT_DATA_AND_SUB;
|
||||
import static com.zt.plat.module.qms.enums.QmsPermissionConstant.DEVICE_MANAGER;
|
||||
|
||||
/**
|
||||
* 设备-设备信息 Mapper
|
||||
*
|
||||
@@ -21,7 +24,7 @@ import java.util.Map;
|
||||
@Mapper
|
||||
public interface DeviceInfomationMapper extends BaseMapperX<DeviceInfomationDO> {
|
||||
|
||||
@QmsPermission(deptDataRoleCodes = "ytjyDeptAndSub", moduleDataRoleCodes = "qms_device_manager")
|
||||
// @QmsPermission(deptDataRoleCodes = DEPT_DATA_AND_SUB, moduleDataRoleCodes = DEVICE_MANAGER)
|
||||
default PageResult<DeviceInfomationDO> selectPage(DeviceInfomationPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<DeviceInfomationDO>()
|
||||
.eqIfPresent(DeviceInfomationDO::getProductId, reqVO.getProductId())
|
||||
|
||||
@@ -16,6 +16,10 @@ import com.zt.plat.framework.common.pojo.PageResult;
|
||||
*/
|
||||
public interface DeviceApplyDetailService {
|
||||
|
||||
List<DeviceApplyDetailDO> selectList(DeviceApplyDetailPageReqVO reqVO);
|
||||
|
||||
void insertBatch(List<DeviceApplyDetailDO> list);
|
||||
|
||||
/**
|
||||
* 创建设备通用流程明细
|
||||
*
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.zt.plat.module.qms.resource.device.controller.vo.DeviceApplyDetailRes
|
||||
import com.zt.plat.module.qms.resource.device.controller.vo.DeviceApplyDetailSaveReqVO;
|
||||
import org.springframework.stereotype.Service;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.util.*;
|
||||
@@ -32,6 +33,17 @@ public class DeviceApplyDetailServiceImpl implements DeviceApplyDetailService {
|
||||
@Resource
|
||||
private DeviceApplyDetailMapper deviceApplyDetailMapper;
|
||||
|
||||
@Override
|
||||
public List<DeviceApplyDetailDO> selectList(DeviceApplyDetailPageReqVO reqVO) {
|
||||
return deviceApplyDetailMapper.selectList(reqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void insertBatch(List<DeviceApplyDetailDO> list) {
|
||||
deviceApplyDetailMapper.insertBatch(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DeviceApplyDetailRespVO createDeviceApplyDetail(DeviceApplyDetailSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
|
||||
@@ -2,6 +2,8 @@ package com.zt.plat.module.qms.resource.device.service;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
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;
|
||||
@@ -24,6 +26,17 @@ public interface DeviceApplyService {
|
||||
*/
|
||||
DeviceApplyRespVO createDeviceApply(@Valid DeviceApplySaveReqVO createReqVO);
|
||||
|
||||
//创建临时数据
|
||||
CommonResult<DeviceApplyRespVO> createTempData(@Valid DeviceApplySaveReqVO createReqVO);
|
||||
|
||||
//增加明细
|
||||
CommonResult<Boolean> addDetail(JSONObject param);
|
||||
|
||||
//删除明细
|
||||
CommonResult<Boolean> removeDetail(JSONObject param);
|
||||
|
||||
CommonResult<Boolean> saveDeviceApply(@Valid DeviceApplySaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 更新设备通用流程,验收、降级、停用、报废、还原、启用
|
||||
*
|
||||
@@ -31,6 +44,7 @@ public interface DeviceApplyService {
|
||||
*/
|
||||
void updateDeviceApply(@Valid DeviceApplySaveReqVO updateReqVO);
|
||||
|
||||
|
||||
/**
|
||||
* 删除设备通用流程,验收、降级、停用、报废、还原、启用
|
||||
*
|
||||
|
||||
@@ -1,14 +1,36 @@
|
||||
package com.zt.plat.module.qms.resource.device.service;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.bean.copier.CopyOptions;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.alibaba.fastjson.parser.Feature;
|
||||
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.common.data.dal.dataobject.DataCollectionDO;
|
||||
import com.zt.plat.module.qms.common.data.dal.dataobject.DataTemplateDO;
|
||||
import com.zt.plat.module.qms.common.data.service.DataCollectionService;
|
||||
import com.zt.plat.module.qms.common.data.service.DataTemplateService;
|
||||
import com.zt.plat.module.qms.enums.QmsCommonConstant;
|
||||
import com.zt.plat.module.qms.resource.device.controller.vo.DeviceApplyDetailPageReqVO;
|
||||
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 com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceApplyDetailDO;
|
||||
import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceConfigFlowDO;
|
||||
import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceInfomationDO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.beanutils.PropertyUtils;
|
||||
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.lang.reflect.InvocationTargetException;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceApplyDO;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
@@ -27,10 +49,15 @@ import static com.zt.plat.module.qms.enums.ErrorCodeConstants.DEVICE_APPLY_NOT_E
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
@Slf4j
|
||||
public class DeviceApplyServiceImpl implements DeviceApplyService {
|
||||
|
||||
@Resource
|
||||
private DeviceApplyMapper deviceApplyMapper;
|
||||
@Resource private DeviceApplyMapper deviceApplyMapper;
|
||||
@Resource private DeviceConfigFlowService deviceConfigFlowService;
|
||||
@Resource private DeviceInfomationService deviceInfomationService;
|
||||
@Resource private DeviceApplyDetailService deviceApplyDetailService;
|
||||
@Resource private DataCollectionService dataCollectionService;
|
||||
@Resource private DataTemplateService dataTemplateService;
|
||||
|
||||
@Override
|
||||
public DeviceApplyRespVO createDeviceApply(DeviceApplySaveReqVO createReqVO) {
|
||||
@@ -41,6 +68,121 @@ public class DeviceApplyServiceImpl implements DeviceApplyService {
|
||||
return BeanUtils.toBean(deviceApply, DeviceApplyRespVO.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public CommonResult<DeviceApplyRespVO> createTempData(DeviceApplySaveReqVO createReqVO) {
|
||||
String businessType = createReqVO.getBusinessCode();
|
||||
if(ObjectUtils.isEmpty(businessType))
|
||||
return CommonResult.error(DEVICE_APPLY_NOT_EXISTS.getCode(), "请选择业务类型");
|
||||
DeviceConfigFlowDO config = deviceConfigFlowService.getByBusinessType(businessType);
|
||||
if(ObjectUtils.isEmpty(config))
|
||||
return CommonResult.error(DEVICE_APPLY_NOT_EXISTS.getCode(), "业务类型配置不存在("+businessType+"),请联系管理员处理");
|
||||
DeviceApplyDO deviceApply = BeanUtils.toBean(createReqVO, DeviceApplyDO.class);
|
||||
if(!ObjectUtils.isEmpty(config.getTemplateKey())){
|
||||
DataTemplateDO dataTemplate = dataTemplateService.getLatestDataByKey(config.getTemplateKey());
|
||||
if(ObjectUtils.isEmpty(dataTemplate))
|
||||
return CommonResult.error(DEVICE_APPLY_NOT_EXISTS.getCode(), "表单编辑器模板不存在("+config.getTemplateKey()+"),请联系管理员处理");
|
||||
deviceApply.setTemplateId(dataTemplate.getId());
|
||||
}
|
||||
DataCollectionDO dataCollection = dataCollectionService.getLatestDataCollectionByKey(config.getDataCollectionKey());
|
||||
if(ObjectUtils.isEmpty(dataCollection))
|
||||
return CommonResult.error(DEVICE_APPLY_NOT_EXISTS.getCode(), "数据集不存在("+config.getDataCollectionKey()+"),请联系管理员处理");
|
||||
deviceApply.setBusinessName(config.getBusinessName());
|
||||
deviceApply.setDataCollectionId(dataCollection.getId());
|
||||
//取当前用户
|
||||
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
|
||||
String nickName = SecurityFrameworkUtils.getLoginUserNickname();
|
||||
deviceApply.setApplyUser(loginUser.getId());
|
||||
deviceApply.setApplyUserName(nickName);
|
||||
deviceApply.setApplyDepartment(loginUser.getVisitDeptId());
|
||||
deviceApply.setApplyDepartmentName(loginUser.getVisitDeptName());
|
||||
deviceApply.setBusinessStatus(QmsCommonConstant.TEMP_DATA_CODE);
|
||||
deviceApplyMapper.insert(deviceApply);
|
||||
// 返回
|
||||
return CommonResult.success(BeanUtils.toBean(deviceApply, DeviceApplyRespVO.class));
|
||||
}
|
||||
|
||||
|
||||
//增加明细
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public CommonResult<Boolean> addDetail(JSONObject param) {
|
||||
String deviceIds = param.getString("deviceIds");
|
||||
String applyId = param.getString("applyId");
|
||||
if(ObjectUtils.isEmpty(deviceIds))
|
||||
return CommonResult.error(DEVICE_APPLY_NOT_EXISTS.getCode(), "请选择设备");
|
||||
if(ObjectUtils.isEmpty(applyId))
|
||||
return CommonResult.error(DEVICE_APPLY_NOT_EXISTS.getCode(), "缺少申请id参数,请刷新后重试!");
|
||||
List<DeviceInfomationDO> deviceList = deviceInfomationService.getListByIds(deviceIds);
|
||||
if(deviceList.isEmpty())
|
||||
return CommonResult.error(DEVICE_APPLY_NOT_EXISTS.getCode(), "设备不存在");
|
||||
List<Long> deviceInfoIdList = new ArrayList<>();
|
||||
for (DeviceInfomationDO device : deviceList) {
|
||||
deviceInfoIdList.add(device.getId());
|
||||
}
|
||||
//查询已有明细,避免重复添加
|
||||
DeviceApplyDetailPageReqVO detailPageReqVO = new DeviceApplyDetailPageReqVO();
|
||||
detailPageReqVO.setApplyId(Long.valueOf(applyId));
|
||||
detailPageReqVO.setDeviceInfoIdList(deviceInfoIdList);
|
||||
List<DeviceApplyDetailDO> detailList = deviceApplyDetailService.selectList(detailPageReqVO);
|
||||
//过滤已添加设备
|
||||
List<DeviceInfomationDO> addDeviceList = deviceList.stream().filter(device ->
|
||||
detailList.stream().noneMatch(detail -> detail.getDeviceInfomationId().equals(device.getId()))).toList();
|
||||
List<DeviceApplyDetailDO> detailDOList = new ArrayList<>();
|
||||
for (DeviceInfomationDO device : addDeviceList) {
|
||||
DeviceApplyDetailDO detail = new DeviceApplyDetailDO();
|
||||
detail.setApplyId(Long.valueOf(applyId));
|
||||
detail.setDeviceInfomationId(device.getId());
|
||||
detailDOList.add(detail);
|
||||
}
|
||||
deviceApplyDetailService.insertBatch(detailDOList);
|
||||
|
||||
return CommonResult.success(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<Boolean> removeDetail(JSONObject param) {
|
||||
|
||||
String detailIds = param.getString("detailIds");
|
||||
if(ObjectUtils.isEmpty(detailIds))
|
||||
return CommonResult.error(DEVICE_APPLY_NOT_EXISTS.getCode(), "请选择需要删除的明细数据");
|
||||
List<Long> detailIdList = Arrays.stream(detailIds.split(",")).map(Long::valueOf).toList();
|
||||
deviceApplyDetailService.deleteDeviceApplyDetailListByIds(detailIdList);
|
||||
return CommonResult.success(true);
|
||||
}
|
||||
|
||||
//保存
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public CommonResult<Boolean> saveDeviceApply(DeviceApplySaveReqVO updateReqVO) {
|
||||
|
||||
// 校验存在
|
||||
DeviceApplyDO backData = getDeviceApply(updateReqVO.getId());
|
||||
if(backData == null)
|
||||
throw exception(DEVICE_APPLY_NOT_EXISTS);
|
||||
if(QmsCommonConstant.TEMP_DATA_CODE.equals(backData.getBusinessStatus())){
|
||||
updateReqVO.setBusinessStatus(QmsCommonConstant.NOT_START);
|
||||
}
|
||||
//处理动态表单字段
|
||||
String formData = updateReqVO.getFormData();
|
||||
if(!ObjectUtils.isEmpty(formData)) {
|
||||
assembleFormData(formData, updateReqVO);
|
||||
}
|
||||
// 更新
|
||||
DeviceApplyDO updateObj = BeanUtils.toBean(updateReqVO, DeviceApplyDO.class);
|
||||
deviceApplyMapper.updateById(updateObj);
|
||||
return CommonResult.success(true);
|
||||
}
|
||||
|
||||
private void assembleFormData(String formData, DeviceApplySaveReqVO updateReqVO){
|
||||
JSONObject jsonObject = JSONObject.parseObject(formData);
|
||||
DeviceApplySaveReqVO jsonVo = jsonObject.toJavaObject(DeviceApplySaveReqVO.class);
|
||||
CopyOptions copyOptions = CopyOptions.create();
|
||||
copyOptions.setIgnoreNullValue(true);
|
||||
BeanUtil.copyProperties(jsonVo, updateReqVO, copyOptions);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void updateDeviceApply(DeviceApplySaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
|
||||
@@ -18,6 +18,8 @@ public interface DeviceConfigFlowService {
|
||||
|
||||
List<DeviceConfigFlowDO> getEnableList(DeviceConfigFlowPageReqVO pageReqVO);
|
||||
|
||||
DeviceConfigFlowDO getByBusinessType(String code);
|
||||
|
||||
/**
|
||||
* 创建设备通用流程配置
|
||||
*
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
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.DeviceConfigFlowPageReqVO;
|
||||
import com.zt.plat.module.qms.resource.device.controller.vo.DeviceConfigFlowRespVO;
|
||||
import com.zt.plat.module.qms.resource.device.controller.vo.DeviceConfigFlowSaveReqVO;
|
||||
@@ -37,6 +38,15 @@ public class DeviceConfigFlowServiceImpl implements DeviceConfigFlowService {
|
||||
return deviceConfigFlowMapper.selectList(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DeviceConfigFlowDO getByBusinessType(String code) {
|
||||
LambdaQueryWrapper<DeviceConfigFlowDO> query = new LambdaQueryWrapper<>();
|
||||
query.eq(DeviceConfigFlowDO::getBusinessType, code);
|
||||
query.orderByDesc(DeviceConfigFlowDO::getUpdateTime);
|
||||
query.last("limit 1");
|
||||
return deviceConfigFlowMapper.selectOne(query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DeviceConfigFlowRespVO createDeviceConfigFlow(DeviceConfigFlowSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
|
||||
@@ -27,6 +27,7 @@ public interface DeviceInfomationService {
|
||||
DeviceInfomationDO getByCode(String code);
|
||||
|
||||
List<DeviceInfomationDO> getListByProductIdList(List<Long> productIds);
|
||||
List<DeviceInfomationDO> getListByIds(String ids);
|
||||
|
||||
List<Long> getIdListByProductIdList(List<Long> productIds);
|
||||
|
||||
@@ -47,11 +48,7 @@ public interface DeviceInfomationService {
|
||||
// CommonResult<Boolean> updateDeviceAcceptFlag(Long deviceId, String acceptFlag);
|
||||
// CommonResult<Boolean> updateDeviceLendFlag(Long deviceId, Integer lendFlag);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void updateBatch(List<DeviceInfomationDO> updateList);
|
||||
|
||||
/**
|
||||
* 创建设备-设备信息
|
||||
|
||||
@@ -25,9 +25,7 @@ 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 java.util.*;
|
||||
|
||||
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception0;
|
||||
@@ -201,6 +199,11 @@ public class DeviceInfomationServiceImpl implements DeviceInfomationService {
|
||||
deviceInfomationMapper.update(updateWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateBatch(List<DeviceInfomationDO> updateList) {
|
||||
deviceInfomationMapper.updateBatch(updateList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DeviceInfomationDO getByCode(String code) {
|
||||
LambdaQueryWrapper<DeviceInfomationDO> query = new LambdaQueryWrapper<>();
|
||||
@@ -215,6 +218,14 @@ public class DeviceInfomationServiceImpl implements DeviceInfomationService {
|
||||
return deviceInfomationMapper.selectList(query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DeviceInfomationDO> getListByIds(String ids) {
|
||||
if(ObjectUtils.isEmpty(ids))
|
||||
return Collections.emptyList();
|
||||
List< Long> idsList = Arrays.asList(ids.split(",")).stream().map(Long::parseLong).toList();
|
||||
return deviceInfomationMapper.selectByIds(idsList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Long> getIdListByProductIdList(List<Long> productIds) {
|
||||
List<DeviceInfomationDO> list = getListByProductIdList(productIds);
|
||||
|
||||
@@ -1,138 +0,0 @@
|
||||
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 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;
|
||||
|
||||
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
|
||||
@DeptDataPermissionIgnore(enable = "true")
|
||||
@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<MaterialBatchAssignRespVO> createMaterialBatchAssign(@Valid @RequestBody MaterialBatchAssignSaveReqVO createReqVO) {
|
||||
return success(materialBatchAssignService.createMaterialBatchAssign(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新物料批次分发")
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-batch-assign:update')")
|
||||
public CommonResult<Boolean> 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<Boolean> 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<Boolean> 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<MaterialBatchAssignRespVO> 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<PageResult<MaterialBatchAssignRespVO>> getMaterialBatchAssignByInfiId(MaterialBatchAssignPageReqVO pageReqVO) {
|
||||
|
||||
if(pageReqVO.getMaterialInfomationId()==null||pageReqVO.getMaterialInfomationId().length()==0){
|
||||
return error(MATERIAL_BATCH_ASSIGN_NOT_EXISTS,"示例编号不能为空");
|
||||
}
|
||||
|
||||
PageResult<MaterialBatchAssignDO> 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<PageResult<MaterialBatchAssignRespVO>> getMaterialBatchAssignPage(@Valid MaterialBatchAssignPageReqVO pageReqVO) {
|
||||
PageResult<MaterialBatchAssignDO> 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<MaterialBatchAssignDO> list = materialBatchAssignService.getMaterialBatchAssignPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "物料批次分发.xls", "数据", MaterialBatchAssignRespVO.class,
|
||||
BeanUtils.toBean(list, MaterialBatchAssignRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,19 +1,24 @@
|
||||
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 com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore;
|
||||
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 com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialBatchDO;
|
||||
import com.zt.plat.module.qms.resource.material.service.MaterialBatchService;
|
||||
import com.zt.plat.module.qms.resource.material.valid.AddGroup;
|
||||
import com.zt.plat.module.qms.resource.material.valid.UpdateGroup;
|
||||
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.constraints.*;
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
@@ -24,8 +29,6 @@ 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,41 +36,28 @@ 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
|
||||
@DeptDataPermissionIgnore(enable = "true")
|
||||
@FileUploadController(source = "qms.materialbatch")
|
||||
public class MaterialBatchController extends AbstractFileUploadController implements BusinessControllerMarker{
|
||||
public class MaterialBatchController 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<MaterialBatchRespVO> createMaterialBatch(@Valid @RequestBody MaterialBatchSaveReqVO createReqVO) {
|
||||
// @PreAuthorize("@ss.hasPermission('qms:material-batch:create')")
|
||||
public CommonResult<MaterialBatchRespVO> createMaterialBatch(@Validated(AddGroup.class) @RequestBody MaterialBatchSaveReqVO createReqVO) {
|
||||
return success(materialBatchService.createMaterialBatch(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新物料批次")
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-batch:update')")
|
||||
public CommonResult<Boolean> updateMaterialBatch(@Valid @RequestBody MaterialBatchSaveReqVO updateReqVO) {
|
||||
// @PreAuthorize("@ss.hasPermission('qms:material-batch:update')")
|
||||
public CommonResult<Boolean> updateMaterialBatch(@Validated(UpdateGroup.class) @RequestBody MaterialBatchSaveReqVO updateReqVO) {
|
||||
materialBatchService.updateMaterialBatch(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
@@ -75,7 +65,7 @@ public class MaterialBatchController extends AbstractFileUploadController implem
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除物料批次")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-batch:delete')")
|
||||
// @PreAuthorize("@ss.hasPermission('qms:material-batch:delete')")
|
||||
public CommonResult<Boolean> deleteMaterialBatch(@RequestParam("id") Long id) {
|
||||
materialBatchService.deleteMaterialBatch(id);
|
||||
return success(true);
|
||||
@@ -84,7 +74,7 @@ public class MaterialBatchController extends AbstractFileUploadController implem
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除物料批次")
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-batch:delete')")
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-batch:delete')")
|
||||
public CommonResult<Boolean> deleteMaterialBatchList(@RequestBody BatchDeleteReqVO req) {
|
||||
materialBatchService.deleteMaterialBatchListByIds(req.getIds());
|
||||
return success(true);
|
||||
@@ -93,7 +83,7 @@ public class MaterialBatchController extends AbstractFileUploadController implem
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得物料批次")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-batch:query')")
|
||||
// @PreAuthorize("@ss.hasPermission('qms:material-batch:query')")
|
||||
public CommonResult<MaterialBatchRespVO> getMaterialBatch(@RequestParam("id") Long id) {
|
||||
MaterialBatchDO materialBatch = materialBatchService.getMaterialBatch(id);
|
||||
return success(BeanUtils.toBean(materialBatch, MaterialBatchRespVO.class));
|
||||
@@ -101,10 +91,15 @@ public class MaterialBatchController extends AbstractFileUploadController implem
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得物料批次分页")
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-batch:query')")
|
||||
// @PreAuthorize("@ss.hasPermission('qms:material-batch:query')")
|
||||
public CommonResult<PageResult<MaterialBatchRespVO>> getMaterialBatchPage(@Valid MaterialBatchPageReqVO pageReqVO) {
|
||||
PageResult<MaterialBatchDO> pageResult = materialBatchService.getMaterialBatchPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, MaterialBatchRespVO.class));
|
||||
PageResult<MaterialBatchRespVO> pageResult;
|
||||
if (!pageReqVO.getOnlyGong()) {
|
||||
pageResult = materialBatchService.getMaterialBatchPageWithPdtInfo(pageReqVO);
|
||||
} else {
|
||||
pageResult = materialBatchService.getMaterialBatchGongPageWithPdtInfo(pageReqVO);
|
||||
}
|
||||
return success(pageResult);
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@@ -120,10 +115,27 @@ public class MaterialBatchController extends AbstractFileUploadController implem
|
||||
BeanUtils.toBean(list, MaterialBatchRespVO.class));
|
||||
}
|
||||
|
||||
@PostMapping("/assign")
|
||||
@Operation(summary = "物料分发")
|
||||
public CommonResult<MaterialBatchAssignRespVO> assign(@Valid @RequestBody MaterialBatchAssignSaveReqVO createReqVO) {
|
||||
return success(materialBatchAssignService.assignLab(createReqVO));
|
||||
@PostMapping("/assign-gongduan")
|
||||
@Operation(summary = "批次工段拆分")
|
||||
// @PreAuthorize("@ss.hasPermission('qms:material-batch:create')")
|
||||
public CommonResult<List<MaterialBatchRespVO>> assignMaterialBatchGongduan(@Valid @RequestBody List<MaterialBatchSaveReqVO> createReqVOs) {
|
||||
return success(materialBatchService.assignMaterialBatchGongduan(createReqVOs));
|
||||
}
|
||||
|
||||
@PutMapping("/submit")
|
||||
@Operation(summary = "提交物料批次")
|
||||
@Parameter(name = "id", required = true)
|
||||
public CommonResult<Boolean> submitMaterialBatch(@RequestParam("id") Long id) {
|
||||
|
||||
return success(materialBatchService.submitMaterialBatch(id));
|
||||
}
|
||||
|
||||
@GetMapping("gongduan-page")
|
||||
@Operation(summary = "获取工段列表")
|
||||
@Parameter(name = "id", description = "物料批次 id", required = true, example = "1054")
|
||||
public CommonResult<List<MaterialBatchRespVO>> getMaterialBatchGongduanList(@RequestParam("id") Long id) {
|
||||
List<MaterialBatchDO> list = materialBatchService.getMaterialBatchGongduanList(id);
|
||||
return success(BeanUtils.toBean(list, MaterialBatchRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,69 +1,59 @@
|
||||
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.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.*;
|
||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInfomationPageReqVO;
|
||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInfomationRespVO;
|
||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInfomationSaveReqVO;
|
||||
import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialInfomationDO;
|
||||
import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialProductDO;
|
||||
import com.zt.plat.module.qms.resource.material.service.MaterialInfomationService;
|
||||
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 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 java.util.List;
|
||||
|
||||
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
|
||||
import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO;
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import com.zt.plat.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
|
||||
@Tag(name = "管理后台 - 物料实例")
|
||||
@RestController
|
||||
@RequestMapping("/qms/resource/material-infomation")
|
||||
@RequestMapping("/qms/material-infomation")
|
||||
@Validated
|
||||
@DeptDataPermissionIgnore(enable = "true")
|
||||
@FileUploadController(source = "resource.materialinfomation")
|
||||
public class MaterialInfomationController extends AbstractFileUploadController implements BusinessControllerMarker{
|
||||
public class MaterialInfomationController implements BusinessControllerMarker {
|
||||
|
||||
static {
|
||||
FileUploadController annotation = MaterialInfomationController.class.getAnnotation(FileUploadController.class);
|
||||
if (annotation != null) {
|
||||
setFileUploadInfo(annotation);
|
||||
}
|
||||
}
|
||||
|
||||
@Resource private MaterialInfomationService materialInfomationService;
|
||||
@Resource private MaterialProductService materialProductService;
|
||||
@Resource
|
||||
private MaterialInfomationService materialInfomationService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建物料实例")
|
||||
@PreAuthorize("@ss.hasPermission('resource:material-infomation:create')")
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-infomation:create')")
|
||||
public CommonResult<MaterialInfomationRespVO> createMaterialInfomation(@Valid @RequestBody MaterialInfomationSaveReqVO createReqVO) {
|
||||
return success(materialInfomationService.createMaterialInfomation(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新物料实例")
|
||||
@PreAuthorize("@ss.hasPermission('resource:material-infomation:update')")
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-infomation:update')")
|
||||
public CommonResult<Boolean> updateMaterialInfomation(@Valid @RequestBody MaterialInfomationSaveReqVO updateReqVO) {
|
||||
materialInfomationService.updateMaterialInfomation(updateReqVO);
|
||||
return success(true);
|
||||
@@ -72,7 +62,7 @@ public class MaterialInfomationController extends AbstractFileUploadController i
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除物料实例")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('resource:material-infomation:delete')")
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-infomation:delete')")
|
||||
public CommonResult<Boolean> deleteMaterialInfomation(@RequestParam("id") Long id) {
|
||||
materialInfomationService.deleteMaterialInfomation(id);
|
||||
return success(true);
|
||||
@@ -81,7 +71,7 @@ public class MaterialInfomationController extends AbstractFileUploadController i
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除物料实例")
|
||||
@PreAuthorize("@ss.hasPermission('resource:material-infomation:delete')")
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-infomation:delete')")
|
||||
public CommonResult<Boolean> deleteMaterialInfomationList(@RequestBody BatchDeleteReqVO req) {
|
||||
materialInfomationService.deleteMaterialInfomationListByIds(req.getIds());
|
||||
return success(true);
|
||||
@@ -90,7 +80,7 @@ public class MaterialInfomationController extends AbstractFileUploadController i
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得物料实例")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('resource:material-infomation:query')")
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-infomation:query')")
|
||||
public CommonResult<MaterialInfomationRespVO> getMaterialInfomation(@RequestParam("id") Long id) {
|
||||
MaterialInfomationDO materialInfomation = materialInfomationService.getMaterialInfomation(id);
|
||||
return success(BeanUtils.toBean(materialInfomation, MaterialInfomationRespVO.class));
|
||||
@@ -98,24 +88,15 @@ public class MaterialInfomationController extends AbstractFileUploadController i
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得物料实例分页")
|
||||
@PreAuthorize("@ss.hasPermission('resource:material-infomation:query')")
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-infomation:query')")
|
||||
public CommonResult<PageResult<MaterialInfomationRespVO>> getMaterialInfomationPage(@Valid MaterialInfomationPageReqVO pageReqVO) {
|
||||
|
||||
Long productId = pageReqVO.getProductId();
|
||||
if(productId != null){
|
||||
List<MaterialProductDO> productDOList = materialProductService.listByIdPath(productId, DataTypeConstant.DATA_TYPE_DATA);
|
||||
List<Long> productIds = productDOList.stream().map(MaterialProductDO::getId).toList();
|
||||
pageReqVO.setProductIds(productIds);
|
||||
pageReqVO.setProductId(null);
|
||||
}
|
||||
|
||||
PageResult<MaterialInfomationDO> pageResult = materialInfomationService.getMaterialInfomationPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, MaterialInfomationRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出物料实例 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('resource:material-infomation:export')")
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-infomation:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportMaterialInfomationExcel(@Valid MaterialInfomationPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
|
||||
@@ -1,121 +0,0 @@
|
||||
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 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.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
|
||||
@DeptDataPermissionIgnore(enable = "true")
|
||||
@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<MaterialInventoryCheckBatchRespVO> 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<Boolean> 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<Boolean> 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<Boolean> 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<MaterialInventoryCheckBatchRespVO> 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<PageResult<MaterialInventoryCheckBatchRespVO>> getMaterialInventoryCheckBatchPage(@Valid MaterialInventoryCheckBatchPageReqVO pageReqVO) {
|
||||
PageResult<MaterialInventoryCheckBatchDO> 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<MaterialInventoryCheckBatchDO> list = materialInventoryCheckBatchService.getMaterialInventoryCheckBatchPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "库存盘点项.xls", "数据", MaterialInventoryCheckBatchRespVO.class,
|
||||
BeanUtils.toBean(list, MaterialInventoryCheckBatchRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,138 +0,0 @@
|
||||
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 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.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
|
||||
@DeptDataPermissionIgnore(enable = "true")
|
||||
@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<MaterialInventoryCheckRespVO> createMaterialInventoryCheck(@Valid @RequestBody MaterialInventoryCheckSaveReqVO createReqVO) {
|
||||
return success(materialInventoryCheckService.createMaterialInventoryCheck(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新库存盘点")
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-inventory-check:update')")
|
||||
public CommonResult<Boolean> 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<Boolean> 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<Boolean> 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<MaterialInventoryCheckRespVO> 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<PageResult<MaterialInventoryCheckRespVO>> getMaterialInventoryCheckPage(@Valid MaterialInventoryCheckPageReqVO pageReqVO) {
|
||||
PageResult<MaterialInventoryCheckDO> 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<MaterialInventoryCheckDO> list = materialInventoryCheckService.getMaterialInventoryCheckPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "库存盘点.xls", "数据", MaterialInventoryCheckRespVO.class,
|
||||
BeanUtils.toBean(list, MaterialInventoryCheckRespVO.class));
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/create-form")
|
||||
@Operation(summary = "创建库存盘点")
|
||||
public CommonResult<MaterialInventoryCheckRespVO> 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<MaterialInventoryCheckRespVO> getMaterialInventoryCheckForm(@RequestParam("id") Long id) {
|
||||
|
||||
return success(materialInventoryCheckService.getMaterialInventoryCheckForm(id));
|
||||
}
|
||||
}
|
||||
@@ -1,121 +0,0 @@
|
||||
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 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.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
|
||||
@DeptDataPermissionIgnore(enable = "true")
|
||||
@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<MaterialInventoryCheckDetailRespVO> 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<Boolean> 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<Boolean> 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<Boolean> 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<MaterialInventoryCheckDetailRespVO> 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<PageResult<MaterialInventoryCheckDetailRespVO>> getMaterialInventoryCheckDetailPage(@Valid MaterialInventoryCheckDetailPageReqVO pageReqVO) {
|
||||
PageResult<MaterialInventoryCheckDetailDO> 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<MaterialInventoryCheckDetailDO> list = materialInventoryCheckDetailService.getMaterialInventoryCheckDetailPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "库存盘点明细.xls", "数据", MaterialInventoryCheckDetailRespVO.class,
|
||||
BeanUtils.toBean(list, MaterialInventoryCheckDetailRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,153 +1,38 @@
|
||||
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.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;
|
||||
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.controller.vo.MaterialProductPageReqVO;
|
||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialProductRespVO;
|
||||
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.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
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 = "管理后台 - 入库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等")
|
||||
@Tag(name = "管理后台 - 物料库存")
|
||||
@RestController
|
||||
@RequestMapping("/qms/resource/material-inventory")
|
||||
@Validated
|
||||
@DeptDataPermissionIgnore(enable = "true")
|
||||
@FileUploadController(source = "qms.materiainfo")
|
||||
public class MaterialInventoryController extends AbstractFileUploadController implements BusinessControllerMarker {
|
||||
public class MaterialInventoryController 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<MaterialInventoryInboundDetailRespVO> 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<Boolean> 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<Boolean> 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<Boolean> 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<MaterialInventoryInboundDetailRespVO> getMaterialInventoryInboundDetail(@RequestParam("id") Long id) {
|
||||
MaterialInventoryInboundDetailDO materialInventoryInboundDetail = materialInventoryInboundDetailService.getMaterialInventoryInboundDetail(id);
|
||||
return success(BeanUtils.toBean(materialInventoryInboundDetail, MaterialInventoryInboundDetailRespVO.class));
|
||||
}
|
||||
@Autowired
|
||||
private MaterialProductService materialProductService;
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得库存明细")
|
||||
// @PreAuthorize("@ss.hasPermission('qms:material-inventory-inbound-detail:query')")
|
||||
public CommonResult<PageResult<MaterialInventoryInboundDetailRespVO>> getMaterialInventoryPage(@Valid MaterialInventoryInboundDetailPageReqVO pageReqVO) {
|
||||
PageResult<MaterialInventoryInboundDetailDO> pageResult = materialInventoryInboundDetailService.getMaterialInventoryInboundDetailPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, MaterialInventoryInboundDetailRespVO.class));
|
||||
@Operation(summary = "获得物料大类分页")
|
||||
public CommonResult<PageResult<MaterialProductRespVO>> getMaterialInventoryPage(@Valid MaterialProductPageReqVO pageReqVO) {
|
||||
// 需要库存数量和预警信息
|
||||
PageResult<MaterialProductRespVO> pageResult = materialProductService.getMaterialInventoryPage(pageReqVO);
|
||||
return success(pageResult);
|
||||
}
|
||||
|
||||
@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<MaterialInventoryInboundDetailDO> 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<PageResult<MaterialInventoryRespVO>> getMaterialProduct(MaterialInventoryRespVO pageReqVO) {
|
||||
|
||||
PageResult<MaterialInventoryDO> 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<PageResult<MaterialInventoryRespVO>> getInfomation(MaterialInventoryRespVO pageReqVO) {
|
||||
|
||||
PageResult<MaterialInventoryDO> 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<Boolean> agreeOut(@RequestParam("outId") Long outId) {
|
||||
|
||||
// PageResult<MaterialInventoryDO> pageResult = mterialInventoryService.getMaterialInventoryPage(pageReqVO);
|
||||
// return success(BeanUtils.toBean(pageResult, MaterialInventoryRespVO.class));
|
||||
mterialInventoryService.agreeMaterialInventoryOutbound(outId);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,71 +1,54 @@
|
||||
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.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.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 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.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;
|
||||
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-inbound")
|
||||
@RequestMapping("/t/material-inventory-inbound")
|
||||
@Validated
|
||||
@DeptDataPermissionIgnore(enable = "true")
|
||||
@FileUploadController(source = "qms.materialinventoryinbound")
|
||||
public class MaterialInventoryInboundController extends AbstractFileUploadController implements BusinessControllerMarker{
|
||||
public class MaterialInventoryInboundController 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')")
|
||||
@PreAuthorize("@ss.hasPermission('t:material-inventory-inbound:create')")
|
||||
public CommonResult<MaterialInventoryInboundRespVO> createMaterialInventoryInbound(@Valid @RequestBody MaterialInventoryInboundSaveReqVO createReqVO) {
|
||||
return success(materialInventoryInboundService.createMaterialInventoryInbound(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新入库")
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-inventory-inbound:update')")
|
||||
@PreAuthorize("@ss.hasPermission('t:material-inventory-inbound:update')")
|
||||
public CommonResult<Boolean> updateMaterialInventoryInbound(@Valid @RequestBody MaterialInventoryInboundSaveReqVO updateReqVO) {
|
||||
materialInventoryInboundService.updateMaterialInventoryInbound(updateReqVO);
|
||||
return success(true);
|
||||
@@ -74,7 +57,7 @@ public class MaterialInventoryInboundController extends AbstractFileUploadContro
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除入库")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-inventory-inbound:delete')")
|
||||
@PreAuthorize("@ss.hasPermission('t:material-inventory-inbound:delete')")
|
||||
public CommonResult<Boolean> deleteMaterialInventoryInbound(@RequestParam("id") Long id) {
|
||||
materialInventoryInboundService.deleteMaterialInventoryInbound(id);
|
||||
return success(true);
|
||||
@@ -83,7 +66,7 @@ public class MaterialInventoryInboundController extends AbstractFileUploadContro
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除入库")
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-inventory-inbound:delete')")
|
||||
@PreAuthorize("@ss.hasPermission('t:material-inventory-inbound:delete')")
|
||||
public CommonResult<Boolean> deleteMaterialInventoryInboundList(@RequestBody BatchDeleteReqVO req) {
|
||||
materialInventoryInboundService.deleteMaterialInventoryInboundListByIds(req.getIds());
|
||||
return success(true);
|
||||
@@ -92,7 +75,7 @@ public class MaterialInventoryInboundController extends AbstractFileUploadContro
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得入库")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-inventory-inbound:query')")
|
||||
@PreAuthorize("@ss.hasPermission('t:material-inventory-inbound:query')")
|
||||
public CommonResult<MaterialInventoryInboundRespVO> getMaterialInventoryInbound(@RequestParam("id") Long id) {
|
||||
MaterialInventoryInboundDO materialInventoryInbound = materialInventoryInboundService.getMaterialInventoryInbound(id);
|
||||
return success(BeanUtils.toBean(materialInventoryInbound, MaterialInventoryInboundRespVO.class));
|
||||
@@ -100,7 +83,7 @@ public class MaterialInventoryInboundController extends AbstractFileUploadContro
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得入库分页")
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-inventory-inbound:query')")
|
||||
@PreAuthorize("@ss.hasPermission('t:material-inventory-inbound:query')")
|
||||
public CommonResult<PageResult<MaterialInventoryInboundRespVO>> getMaterialInventoryInboundPage(@Valid MaterialInventoryInboundPageReqVO pageReqVO) {
|
||||
PageResult<MaterialInventoryInboundDO> pageResult = materialInventoryInboundService.getMaterialInventoryInboundPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, MaterialInventoryInboundRespVO.class));
|
||||
@@ -108,7 +91,7 @@ public class MaterialInventoryInboundController extends AbstractFileUploadContro
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出入库 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-inventory-inbound:export')")
|
||||
@PreAuthorize("@ss.hasPermission('t:material-inventory-inbound:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportMaterialInventoryInboundExcel(@Valid MaterialInventoryInboundPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
@@ -119,17 +102,4 @@ public class MaterialInventoryInboundController extends AbstractFileUploadContro
|
||||
BeanUtils.toBean(list, MaterialInventoryInboundRespVO.class));
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/multi-put")
|
||||
@Operation(summary = "批量上架")
|
||||
public CommonResult<Boolean> createMaterialInventoryInboundMulti(@Valid @RequestBody MaterialInventoryInboundSaveReqVO createReqVO) {
|
||||
materialInventoryInboundService.multiCreateMaterialInventoryInbound(createReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@PostMapping("single-put")
|
||||
@Operation(summary = "单一上架")
|
||||
public CommonResult<PageResult<MaterialInventoryInboundRespVO>> createMaterialInventoryInboundSingle(@Valid @RequestBody MaterialInventoryInboundSaveReqVO createReqVO) {
|
||||
return success(materialInventoryInboundService.singleCreateMaterialInventoryInbound(createReqVO));
|
||||
}
|
||||
}
|
||||
@@ -1,79 +1,63 @@
|
||||
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.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.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 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.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;
|
||||
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.*;
|
||||
|
||||
@Tag(name = "管理后台 - 入库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等")
|
||||
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-inbound-detail")
|
||||
@RequestMapping("/t/material-inventory-inbound-detail")
|
||||
@Validated
|
||||
@DeptDataPermissionIgnore(enable = "true")
|
||||
@FileUploadController(source = "qms.materialinventoryinbounddetail")
|
||||
public class MaterialInventoryInboundDetailController extends AbstractFileUploadController implements BusinessControllerMarker{
|
||||
public class MaterialInventoryInboundDetailController 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')")
|
||||
@Operation(summary = "创建入库明细,验收入库、盘盈入库等")
|
||||
@PreAuthorize("@ss.hasPermission('t:material-inventory-inbound-detail:create')")
|
||||
public CommonResult<MaterialInventoryInboundDetailRespVO> createMaterialInventoryInboundDetail(@Valid @RequestBody MaterialInventoryInboundDetailSaveReqVO createReqVO) {
|
||||
return success(materialInventoryInboundDetailService.createMaterialInventoryInboundDetail(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新入库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等")
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-inventory-inbound-detail:update')")
|
||||
@Operation(summary = "更新入库明细,验收入库、盘盈入库等")
|
||||
@PreAuthorize("@ss.hasPermission('t:material-inventory-inbound-detail:update')")
|
||||
public CommonResult<Boolean> updateMaterialInventoryInboundDetail(@Valid @RequestBody MaterialInventoryInboundDetailSaveReqVO updateReqVO) {
|
||||
materialInventoryInboundDetailService.updateMaterialInventoryInboundDetail(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除入库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等")
|
||||
@Operation(summary = "删除入库明细,验收入库、盘盈入库等")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-inventory-inbound-detail:delete')")
|
||||
@PreAuthorize("@ss.hasPermission('t:material-inventory-inbound-detail:delete')")
|
||||
public CommonResult<Boolean> deleteMaterialInventoryInboundDetail(@RequestParam("id") Long id) {
|
||||
materialInventoryInboundDetailService.deleteMaterialInventoryInboundDetail(id);
|
||||
return success(true);
|
||||
@@ -81,47 +65,41 @@ public class MaterialInventoryInboundDetailController extends AbstractFileUpload
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除入库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等")
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-inventory-inbound-detail:delete')")
|
||||
@Operation(summary = "批量删除入库明细,验收入库、盘盈入库等")
|
||||
@PreAuthorize("@ss.hasPermission('t:material-inventory-inbound-detail:delete')")
|
||||
public CommonResult<Boolean> deleteMaterialInventoryInboundDetailList(@RequestBody BatchDeleteReqVO req) {
|
||||
materialInventoryInboundDetailService.deleteMaterialInventoryInboundDetailListByIds(req.getIds());
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得入库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等")
|
||||
@Operation(summary = "获得入库明细,验收入库、盘盈入库等")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-inventory-inbound-detail:query')")
|
||||
@PreAuthorize("@ss.hasPermission('t:material-inventory-inbound-detail:query')")
|
||||
public CommonResult<MaterialInventoryInboundDetailRespVO> 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')")
|
||||
@Operation(summary = "获得入库明细,验收入库、盘盈入库等分页")
|
||||
@PreAuthorize("@ss.hasPermission('t:material-inventory-inbound-detail:query')")
|
||||
public CommonResult<PageResult<MaterialInventoryInboundDetailRespVO>> getMaterialInventoryInboundDetailPage(@Valid MaterialInventoryInboundDetailPageReqVO pageReqVO) {
|
||||
PageResult<MaterialInventoryInboundDetailDO> 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')")
|
||||
@Operation(summary = "导出入库明细,验收入库、盘盈入库等 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('t: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<MaterialInventoryInboundDetailDO> list = materialInventoryInboundDetailService.getMaterialInventoryInboundDetailPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "入库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等.xls", "数据", MaterialInventoryInboundDetailRespVO.class,
|
||||
ExcelUtils.write(response, "入库明细,验收入库、盘盈入库等.xls", "数据", MaterialInventoryInboundDetailRespVO.class,
|
||||
BeanUtils.toBean(list, MaterialInventoryInboundDetailRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page-list")
|
||||
@Operation(summary = "获得入库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等分页")
|
||||
public CommonResult<PageResult<MaterialInventoryInboundDetailRespVO>> getMaterialInventoryInboundDetailPageList(@Valid MaterialInventoryInboundDetailPageReqVO pageReqVO) {
|
||||
PageResult<MaterialInventoryInboundDetailRespVO> pageResult = materialInventoryInboundDetailService.getMaterialInventoryInboundDetailPageList(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, MaterialInventoryInboundDetailRespVO.class));
|
||||
}
|
||||
}
|
||||
@@ -1,129 +0,0 @@
|
||||
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 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.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
|
||||
@DeptDataPermissionIgnore(enable = "true")
|
||||
@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<MaterialInventoryOutboundRespVO> createMaterialInventoryOutbound(@Valid @RequestBody MaterialInventoryOutboundSaveReqVO createReqVO) {
|
||||
return success(materialInventoryOutboundService.createMaterialInventoryOutbound(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新出库")
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-inventory-outbound:update')")
|
||||
public CommonResult<Boolean> 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<Boolean> 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<Boolean> 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<MaterialInventoryOutboundRespVO> 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<PageResult<MaterialInventoryOutboundRespVO>> getMaterialInventoryOutboundPage(@Valid MaterialInventoryOutboundPageReqVO pageReqVO) {
|
||||
PageResult<MaterialInventoryOutboundDO> 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<MaterialInventoryOutboundDO> 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<MaterialInventoryOutboundRespVO> createMaterialInventoryOutboundAll(@Valid @RequestBody MaterialInventoryOutboundSaveReqVO createReqVO) {
|
||||
return success(materialInventoryOutboundService.createMaterialInventoryOutboundAll(createReqVO));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,121 +0,0 @@
|
||||
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 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.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
|
||||
@DeptDataPermissionIgnore(enable = "true")
|
||||
@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<MaterialInventoryOutboundDetailRespVO> 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<Boolean> 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<Boolean> 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<Boolean> 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<MaterialInventoryOutboundDetailRespVO> 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<PageResult<MaterialInventoryOutboundDetailRespVO>> getMaterialInventoryOutboundDetailPage(@Valid MaterialInventoryOutboundDetailPageReqVO pageReqVO) {
|
||||
PageResult<MaterialInventoryOutboundDetailDO> 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<MaterialInventoryOutboundDetailDO> list = materialInventoryOutboundDetailService.getMaterialInventoryOutboundDetailPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "出库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等.xls", "数据", MaterialInventoryOutboundDetailRespVO.class,
|
||||
BeanUtils.toBean(list, MaterialInventoryOutboundDetailRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,48 +1,45 @@
|
||||
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.apilog.core.annotation.ApiAccessLog;
|
||||
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.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.CommonResult;
|
||||
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.MaterialLifecycleDO;
|
||||
import com.zt.plat.module.qms.resource.material.service.MaterialBatchService;
|
||||
import com.zt.plat.module.qms.resource.material.service.MaterialLifecycleService;
|
||||
import com.zt.plat.module.qms.resource.material.valid.AddGroup;
|
||||
import com.zt.plat.module.qms.resource.material.valid.UpdateGroup;
|
||||
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.beans.factory.annotation.Autowired;
|
||||
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;
|
||||
|
||||
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 = "管理后台 - 物料通用流程")
|
||||
@Tag(name = "管理后台 - 物料通用流程,物料验收、退换货")
|
||||
@RestController
|
||||
@RequestMapping("/qms/material-lifecycle")
|
||||
@RequestMapping("/qms/resource/material-lifecycle")
|
||||
@Validated
|
||||
@FileUploadController(source = "resource.materiallifecycle")
|
||||
@DeptDataPermissionIgnore(enable = "true")
|
||||
@FileUploadController(source = "qms.materiallifecycle")
|
||||
public class MaterialLifecycleController extends AbstractFileUploadController implements BusinessControllerMarker{
|
||||
|
||||
static {
|
||||
@@ -55,25 +52,27 @@ public class MaterialLifecycleController extends AbstractFileUploadController im
|
||||
@Resource
|
||||
private MaterialLifecycleService materialLifecycleService;
|
||||
|
||||
// QMS_RESOURCE_MATERIAL_COMMON
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建物料通用流程")
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-lifecycle:create')")
|
||||
public CommonResult<MaterialLifecycleRespVO> createMaterialLifecycle(@Valid @RequestBody MaterialLifecycleSaveReqVO createReqVO) {
|
||||
@Operation(summary = "新建物料流程")
|
||||
// @PreAuthorize("@ss.hasPermission('qms:material-lifecycle:create')")
|
||||
public CommonResult<MaterialLifecycleRespVO> createMaterialLifecycle(@Validated(AddGroup.class) @RequestBody MaterialLifecycleSaveReqVO createReqVO) {
|
||||
return success(materialLifecycleService.createMaterialLifecycle(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新物料通用流程")
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-lifecycle:update')")
|
||||
public CommonResult<Boolean> updateMaterialLifecycle(@Valid @RequestBody MaterialLifecycleSaveReqVO updateReqVO) {
|
||||
@Operation(summary = "更新物料流程")
|
||||
// @PreAuthorize("@ss.hasPermission('qms:material-lifecycle:update')")
|
||||
public CommonResult<Boolean> updateMaterialLifecycle(@Validated(UpdateGroup.class) @RequestBody MaterialLifecycleSaveReqVO updateReqVO) {
|
||||
materialLifecycleService.updateMaterialLifecycle(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除物料通用流程")
|
||||
@Operation(summary = "删除物料流程")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-lifecycle:delete')")
|
||||
// @PreAuthorize("@ss.hasPermission('qms:material-lifecycle:delete')")
|
||||
public CommonResult<Boolean> deleteMaterialLifecycle(@RequestParam("id") Long id) {
|
||||
materialLifecycleService.deleteMaterialLifecycle(id);
|
||||
return success(true);
|
||||
@@ -81,32 +80,40 @@ public class MaterialLifecycleController extends AbstractFileUploadController im
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除物料通用流程")
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-lifecycle:delete')")
|
||||
@Operation(summary = "批量删除物料流程")
|
||||
@PreAuthorize("@ss.hasPermission('t:material-lifecycle:delete')")
|
||||
public CommonResult<Boolean> deleteMaterialLifecycleList(@RequestBody BatchDeleteReqVO req) {
|
||||
materialLifecycleService.deleteMaterialLifecycleListByIds(req.getIds());
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得物料通用流程")
|
||||
@Operation(summary = "获得物料流程")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-lifecycle:query')")
|
||||
// @PreAuthorize("@ss.hasPermission('qms:material-lifecycle:query')")
|
||||
public CommonResult<MaterialLifecycleRespVO> getMaterialLifecycle(@RequestParam("id") Long id) {
|
||||
MaterialLifecycleDO materialLifecycle = materialLifecycleService.getMaterialLifecycle(id);
|
||||
return success(BeanUtils.toBean(materialLifecycle, MaterialLifecycleRespVO.class));
|
||||
MaterialLifecycleRespVO lifecycleRespVO = materialLifecycleService.getMaterialLifecycle(id);
|
||||
return success(lifecycleRespVO);
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得物料通用流程分页")
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-lifecycle:query')")
|
||||
@Operation(summary = "获得物料流程分页")
|
||||
// @PreAuthorize("@ss.hasPermission('qms:material-lifecycle:query')")
|
||||
public CommonResult<PageResult<MaterialLifecycleRespVO>> getMaterialLifecyclePage(@Valid MaterialLifecyclePageReqVO pageReqVO) {
|
||||
PageResult<MaterialLifecycleDO> pageResult = materialLifecycleService.getMaterialLifecyclePage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, MaterialLifecycleRespVO.class));
|
||||
}
|
||||
|
||||
@PutMapping("/submit")
|
||||
@Operation(summary = "提交(验收等流程)")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
public CommonResult<Boolean> submitLifecycle(@RequestParam("id") Long id) {
|
||||
|
||||
return success(materialLifecycleService.submitLifecycle(id));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出物料通用流程 Excel")
|
||||
@Operation(summary = "导出物料通用流程,物料验收、退换货 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-lifecycle:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportMaterialLifecycleExcel(@Valid MaterialLifecyclePageReqVO pageReqVO,
|
||||
@@ -114,7 +121,7 @@ public class MaterialLifecycleController extends AbstractFileUploadController im
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<MaterialLifecycleDO> list = materialLifecycleService.getMaterialLifecyclePage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "物料通用流程.xls", "数据", MaterialLifecycleRespVO.class,
|
||||
ExcelUtils.write(response, "物料通用流程,物料验收、退换货.xls", "数据", MaterialLifecycleRespVO.class,
|
||||
BeanUtils.toBean(list, MaterialLifecycleRespVO.class));
|
||||
}
|
||||
|
||||
|
||||
@@ -1,79 +1,63 @@
|
||||
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.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.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 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.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;
|
||||
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.*;
|
||||
|
||||
@Tag(name = "管理后台 - 物料通用流程明细,对应生命周期的明细")
|
||||
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/material-lifecycle-detail")
|
||||
@RequestMapping("/t/material-lifecycle-detail")
|
||||
@Validated
|
||||
@DeptDataPermissionIgnore(enable = "true")
|
||||
@FileUploadController(source = "qms.materiallifecycledetail")
|
||||
public class MaterialLifecycleDetailController extends AbstractFileUploadController implements BusinessControllerMarker{
|
||||
public class MaterialLifecycleDetailController 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')")
|
||||
@Operation(summary = "创建物料通用流程明细")
|
||||
@PreAuthorize("@ss.hasPermission('t:material-lifecycle-detail:create')")
|
||||
public CommonResult<MaterialLifecycleDetailRespVO> createMaterialLifecycleDetail(@Valid @RequestBody MaterialLifecycleDetailSaveReqVO createReqVO) {
|
||||
return success(materialLifecycleDetailService.createMaterialLifecycleDetail(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新物料通用流程明细,对应生命周期的明细")
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-lifecycle-detail:update')")
|
||||
@Operation(summary = "更新物料通用流程明细")
|
||||
@PreAuthorize("@ss.hasPermission('t:material-lifecycle-detail:update')")
|
||||
public CommonResult<Boolean> updateMaterialLifecycleDetail(@Valid @RequestBody MaterialLifecycleDetailSaveReqVO updateReqVO) {
|
||||
materialLifecycleDetailService.updateMaterialLifecycleDetail(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除物料通用流程明细,对应生命周期的明细")
|
||||
@Operation(summary = "删除物料通用流程明细")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-lifecycle-detail:delete')")
|
||||
@PreAuthorize("@ss.hasPermission('t:material-lifecycle-detail:delete')")
|
||||
public CommonResult<Boolean> deleteMaterialLifecycleDetail(@RequestParam("id") Long id) {
|
||||
materialLifecycleDetailService.deleteMaterialLifecycleDetail(id);
|
||||
return success(true);
|
||||
@@ -81,40 +65,40 @@ public class MaterialLifecycleDetailController extends AbstractFileUploadControl
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除物料通用流程明细,对应生命周期的明细")
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-lifecycle-detail:delete')")
|
||||
@Operation(summary = "批量删除物料通用流程明细")
|
||||
@PreAuthorize("@ss.hasPermission('t:material-lifecycle-detail:delete')")
|
||||
public CommonResult<Boolean> deleteMaterialLifecycleDetailList(@RequestBody BatchDeleteReqVO req) {
|
||||
materialLifecycleDetailService.deleteMaterialLifecycleDetailListByIds(req.getIds());
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得物料通用流程明细,对应生命周期的明细")
|
||||
@Operation(summary = "获得物料通用流程明细")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-lifecycle-detail:query')")
|
||||
@PreAuthorize("@ss.hasPermission('t:material-lifecycle-detail:query')")
|
||||
public CommonResult<MaterialLifecycleDetailRespVO> getMaterialLifecycleDetail(@RequestParam("id") Long id) {
|
||||
MaterialLifecycleDetailDO materialLifecycleDetail = materialLifecycleDetailService.getMaterialLifecycleDetail(id);
|
||||
return success(BeanUtils.toBean(materialLifecycleDetail, MaterialLifecycleDetailRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得物料通用流程明细,对应生命周期的明细分页")
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-lifecycle-detail:query')")
|
||||
@Operation(summary = "获得物料通用流程明细分页")
|
||||
@PreAuthorize("@ss.hasPermission('t:material-lifecycle-detail:query')")
|
||||
public CommonResult<PageResult<MaterialLifecycleDetailRespVO>> getMaterialLifecycleDetailPage(@Valid MaterialLifecycleDetailPageReqVO pageReqVO) {
|
||||
PageResult<MaterialLifecycleDetailDO> pageResult = materialLifecycleDetailService.getMaterialLifecycleDetailPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, MaterialLifecycleDetailRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出物料通用流程明细,对应生命周期的明细 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-lifecycle-detail:export')")
|
||||
@Operation(summary = "导出物料通用流程明细 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('t:material-lifecycle-detail:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportMaterialLifecycleDetailExcel(@Valid MaterialLifecycleDetailPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<MaterialLifecycleDetailDO> list = materialLifecycleDetailService.getMaterialLifecycleDetailPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "物料通用流程明细,对应生命周期的明细.xls", "数据", MaterialLifecycleDetailRespVO.class,
|
||||
ExcelUtils.write(response, "物料通用流程明细.xls", "数据", MaterialLifecycleDetailRespVO.class,
|
||||
BeanUtils.toBean(list, MaterialLifecycleDetailRespVO.class));
|
||||
}
|
||||
|
||||
|
||||
@@ -8,13 +8,12 @@ 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.constraints.*;
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
@@ -25,8 +24,6 @@ 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,16 +38,8 @@ 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{
|
||||
public class MaterialLocationController implements BusinessControllerMarker {
|
||||
|
||||
static {
|
||||
FileUploadController annotation = MaterialLocationController.class.getAnnotation(FileUploadController.class);
|
||||
if (annotation != null) {
|
||||
setFileUploadInfo(annotation);
|
||||
}
|
||||
}
|
||||
|
||||
@Resource
|
||||
private MaterialLocationService materialLocationService;
|
||||
|
||||
@@ -11,8 +11,6 @@ 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.*;
|
||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialProductPageReqVO;
|
||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialProductRespVO;
|
||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialProductSaveReqVO;
|
||||
@@ -38,8 +36,8 @@ import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||
@RestController
|
||||
@RequestMapping("/qms/resource/material-product")
|
||||
@Validated
|
||||
@DeptDataPermissionIgnore(enable = "true")
|
||||
@FileUploadController(source = "resource.materialproduct")
|
||||
@DeptDataPermissionIgnore(enable = "true")
|
||||
public class MaterialProductController extends AbstractFileUploadController implements BusinessControllerMarker{
|
||||
|
||||
static {
|
||||
@@ -52,51 +50,63 @@ public class MaterialProductController extends AbstractFileUploadController impl
|
||||
@Resource
|
||||
private MaterialProductService materialProductService;
|
||||
|
||||
@PostMapping("/saveData")
|
||||
@Operation(summary = "保存数据")
|
||||
public CommonResult<MaterialProductRespVO> saveData(@Valid @RequestBody MaterialProductSaveReqVO createReqVO) {
|
||||
return materialProductService.saveData(createReqVO);
|
||||
}
|
||||
|
||||
@PostMapping("/saveClassify")
|
||||
@PostMapping("/save-category")
|
||||
@Operation(summary = "保存分类")
|
||||
public CommonResult<MaterialProductRespVO> saveClassify(@Valid @RequestBody MaterialProductSaveReqVO createReqVO) {
|
||||
return materialProductService.saveCategory(createReqVO);
|
||||
// @PreAuthorize("@ss.hasPermission('qms:material-product:create-category')")
|
||||
public CommonResult<MaterialProductRespVO> saveMaterialCategory(@Valid @RequestBody MaterialProductSaveReqVO createReqVO) {
|
||||
return success(materialProductService.saveMaterialCategory(createReqVO));
|
||||
}
|
||||
|
||||
@GetMapping("/getTreeData")
|
||||
@Operation(summary = "查询分类树")
|
||||
public CommonResult<List<MaterialProductRespVO>> getTreeData() {
|
||||
List<MaterialProductDO> list = materialProductService.getTreeData(DataTypeConstant.DATA_TYPE_CATEGORY);
|
||||
return success(BeanUtils.toBean(list, MaterialProductRespVO.class));
|
||||
@GetMapping("/category-tree")
|
||||
@Operation(summary = "获取分类树")
|
||||
public CommonResult<List<MaterialProductRespVO>> getMaterialCategoryTree() {
|
||||
return success(materialProductService.getMaterialCategoryTree());
|
||||
}
|
||||
|
||||
@GetMapping("/getProductTreeData")
|
||||
@Operation(summary = "获取分类和产品树")
|
||||
public CommonResult<List<MaterialProductRespVO>> getProductTreeData() {
|
||||
List<MaterialProductDO> list = materialProductService.getTreeData("");
|
||||
return success(BeanUtils.toBean(list, MaterialProductRespVO.class));
|
||||
}
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建物料大类")
|
||||
@PreAuthorize("@ss.hasPermission('resource:material-product:create')")
|
||||
public CommonResult<MaterialProductRespVO> createMaterialProduct(@Valid @RequestBody MaterialProductSaveReqVO createReqVO) {
|
||||
return success(materialProductService.createMaterialProduct(createReqVO));
|
||||
// TODO 后边再对接
|
||||
@GetMapping("/orig-material/{code}")
|
||||
@Operation(summary = "根据物料编码获取外部系统原始物料")
|
||||
public CommonResult<MaterialProductRespVO> getOriginalMaterial(@PathVariable String code) {
|
||||
|
||||
return success(new MaterialProductRespVO().setCode(code).setName("测试物料"));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新物料大类")
|
||||
@PreAuthorize("@ss.hasPermission('resource:material-product:update')")
|
||||
public CommonResult<Boolean> updateMaterialProduct(@Valid @RequestBody MaterialProductSaveReqVO updateReqVO) {
|
||||
materialProductService.updateMaterialProduct(updateReqVO);
|
||||
return success(true);
|
||||
@PostMapping("/save-material")
|
||||
@Operation(summary = "保存物料大类")
|
||||
// @PreAuthorize("@ss.hasPermission('qms:material-product:create')")
|
||||
public CommonResult<MaterialProductRespVO> saveMaterialProduct(@Valid @RequestBody MaterialProductSaveReqVO createReqVO) {
|
||||
return success(materialProductService.saveMaterialProduct(createReqVO));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得物料大类分页")
|
||||
// @PreAuthorize("@ss.hasPermission('qms:material-product:query')")
|
||||
public CommonResult<PageResult<MaterialProductRespVO>> getMaterialProductPage(@Valid MaterialProductPageReqVO pageReqVO) {
|
||||
PageResult<MaterialProductDO> pageResult = materialProductService.getMaterialProductPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, MaterialProductRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("category-data")
|
||||
@Operation(summary = "获得物料分类和大类")
|
||||
@Parameter(name = "type", description = "category-分类,data-全部")
|
||||
public CommonResult<List<MaterialProductRespVO>> getCategoryAndData(@RequestParam("type") String type) {
|
||||
return success(materialProductService.getCategoryAndData(type));
|
||||
}
|
||||
|
||||
|
||||
// @PutMapping("/update")
|
||||
// @Operation(summary = "更新物料")
|
||||
// @PreAuthorize("@ss.hasPermission('qms:material-product:update')")
|
||||
// public CommonResult<Boolean> updateMaterialProduct(@Valid @RequestBody MaterialProductSaveReqVO updateReqVO) {
|
||||
// materialProductService.updateMaterialProduct(updateReqVO);
|
||||
// return success(true);
|
||||
// }
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除物料大类")
|
||||
@Operation(summary = "删除物料分类或大类")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('resource:material-product:delete')")
|
||||
// @PreAuthorize("@ss.hasPermission('qms:material-product:delete')")
|
||||
public CommonResult<Boolean> deleteMaterialProduct(@RequestParam("id") Long id) {
|
||||
materialProductService.deleteMaterialProduct(id);
|
||||
return success(true);
|
||||
@@ -105,32 +115,24 @@ public class MaterialProductController extends AbstractFileUploadController impl
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除物料大类")
|
||||
@PreAuthorize("@ss.hasPermission('resource:material-product:delete')")
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-product:delete')")
|
||||
public CommonResult<Boolean> deleteMaterialProductList(@RequestBody BatchDeleteReqVO req) {
|
||||
materialProductService.deleteMaterialProductListByIds(req.getIds());
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得物料大类")
|
||||
@Operation(summary = "获得物料")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('resource:material-product:query')")
|
||||
// @PreAuthorize("@ss.hasPermission('qms:material-product:query')")
|
||||
public CommonResult<MaterialProductRespVO> getMaterialProduct(@RequestParam("id") Long id) {
|
||||
MaterialProductDO materialProduct = materialProductService.getMaterialProduct(id);
|
||||
MaterialProductDO materialProduct = materialProductService.getMaterialProductInfo(id);
|
||||
return success(BeanUtils.toBean(materialProduct, MaterialProductRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得物料大类分页")
|
||||
@PreAuthorize("@ss.hasPermission('resource:material-product:query')")
|
||||
public CommonResult<PageResult<MaterialProductRespVO>> getMaterialProductPage(@Valid MaterialProductPageReqVO pageReqVO) {
|
||||
PageResult<MaterialProductDO> pageResult = materialProductService.getMaterialProductPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, MaterialProductRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出物料大类 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('resource:material-product:export')")
|
||||
@Operation(summary = "导出物料 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-product:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportMaterialProductExcel(@Valid MaterialProductPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
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;
|
||||
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
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;
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user