Compare commits
14 Commits
lims_dev
...
d84f1adf65
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d84f1adf65 | ||
|
|
4b9d27e8fc | ||
| d41f69cc51 | |||
| 15621a9a56 | |||
|
|
06be110e5d | ||
|
|
ae0f0d79c5 | ||
| 93cf620376 | |||
| be89a965d8 | |||
|
|
8fa69a0906 | ||
|
|
3bb70a94f2 | ||
| 433ac9124b | |||
| 3285e6050a | |||
|
|
c68c7cfbf2 | ||
| 04596350b6 |
@@ -54,6 +54,7 @@ public interface ErrorCodeConstants {
|
||||
ErrorCode CONFIG_REPORT_TYPE_NOT_EXISTS = new ErrorCode(1_032_050_000, "报表类型配置不存在");
|
||||
ErrorCode CONFIG_PROJECT_NOT_EXISTS = new ErrorCode(1_032_050_000, "检测项目配置不存在");
|
||||
ErrorCode CONFIG_ENTRUST_SOURCE_NOT_EXISTS = new ErrorCode(1_032_050_000, "检验委托来源配置不存在");
|
||||
ErrorCode CONFIG_ENTRUST_SOURCE_SAMPLE_TYPE_NOT_EXISTS = new ErrorCode(1_032_050_000, "检验委托来源与样品类型配置不存在");
|
||||
|
||||
ErrorCode CONFIG_BASE_SAMPLE_NOT_EXISTS = new ErrorCode(1_032_050_000, "主样配置不存在");
|
||||
ErrorCode CONFIG_ASSAY_METHOD_PROJECT_PARAMETER_NOT_EXISTS = new ErrorCode(1_032_050_000, "检测方法分析项目参数配置不存在");
|
||||
@@ -149,9 +150,15 @@ public interface ErrorCodeConstants {
|
||||
ErrorCode MATERIAL_INFOMATION_NOT_EXISTS = new ErrorCode(1_032_150_000, "试剂耗材不存在");
|
||||
ErrorCode MATERIAL_PRODUCT_NOT_EXISTS = new ErrorCode(1_032_150_000, "试剂耗材大类不存在");
|
||||
|
||||
|
||||
ErrorCode MATERIAL_LIFECYCLE_DETAIL_NOT_EXISTS = new ErrorCode(1_032_150_000, "物料通用流程明细不存在");
|
||||
ErrorCode MATERIAL_LIFECYCLE_NOT_EXISTS = new ErrorCode(1_032_150_000, "物料通用流程不存在");
|
||||
|
||||
ErrorCode MATERIAL_BATCH_NOT_EXISTS = new ErrorCode(1_032_150_000, "物料批次不存在");
|
||||
ErrorCode MATERIAL_BATCH_ASSIGN_NOT_EXISTS = new ErrorCode(1_032_150_000, "物料批次分发不存在");
|
||||
ErrorCode MATERIAL_INVENTORY_INBOUND_NOT_EXISTS = new ErrorCode(1_032_150_000, "入库,出库不存在");
|
||||
ErrorCode MATERIAL_INVENTORY_INBOUND_DETAIL_NOT_EXISTS = new ErrorCode(1_032_150_000, "入库明细,出库明细等不存在");
|
||||
|
||||
|
||||
/*================================= tx 1_032_200_000 ~ 1_032_249_999 ==================================*/
|
||||
|
||||
@@ -159,6 +166,11 @@ public interface ErrorCodeConstants {
|
||||
|
||||
|
||||
/*================================= office 办公 1_032_250_000 ~ 1_032_299_999 ==================================*/
|
||||
ErrorCode SUPPLIER_NOT_EXISTS = new ErrorCode(1_032_250_000, "供应商不存在");
|
||||
ErrorCode SUPPLIER_PROPERTIES_NOT_EXISTS = new ErrorCode(1_032_250_000, "供应商属性不存在");
|
||||
ErrorCode SUPPLIER_EVALUATION_NOT_EXISTS = new ErrorCode(1_032_250_000, "供应商评价不存在");
|
||||
ErrorCode SUPPLIER_EVALUATION_AT_NOT_EXISTS = new ErrorCode(1_032_250_000, "供应商评价关系不存在");
|
||||
|
||||
|
||||
|
||||
/*================================= dzj 大质检 1_032_300_000 ~ 1_032_349_999 ==================================*/
|
||||
|
||||
@@ -107,6 +107,15 @@ public interface QmsCommonConstant {
|
||||
/** 检验委托 **/
|
||||
String ENTRUST_INSPECTION = "entrust_inspection";
|
||||
|
||||
/** 委托样品类型: 委检样 **/
|
||||
String ENTRUST_COMMISSION_INSPECTION_SAMPLE = "commissionInspectionSample";
|
||||
|
||||
/** 委托样品类型: 商检分析样 **/
|
||||
String ENTRUST_INSPECTION_ANALYSIS_SAMPLE = "inspectionAnalysisSample";
|
||||
|
||||
/** 委托样品类型: 商检综合 **/
|
||||
String ENTRUST_COMPREHENSIVE_INSPECTION_SAMPLE = "comprehensiveInspectionSample";
|
||||
|
||||
/** 中心收样 **/
|
||||
String FLOW_NODE_CENTER_RECEIVE = "flw_center_receive";
|
||||
|
||||
@@ -179,6 +188,10 @@ public interface QmsCommonConstant {
|
||||
/** 检验完成状态-未完成 **/
|
||||
String UNCHECKED = "unchecked";
|
||||
|
||||
/** 数据回报状态 未回报 **/
|
||||
String UNRETURNED = "unreturned";
|
||||
|
||||
|
||||
/** 自动 **/
|
||||
String AUTOMATIC = "automatic";
|
||||
|
||||
@@ -194,4 +207,7 @@ public interface QmsCommonConstant {
|
||||
|
||||
/** 允许提交 **/
|
||||
String ALLOW_SUBMIT = "allow_submit";
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
QMS模块。
|
||||
</description>
|
||||
<properties>
|
||||
<zzjc.tio.version>3.9.1.v20251013-RELEASE</zzjc.tio.version>
|
||||
<zzjc.tio.version>3.9.1.v20251204-RELEASE</zzjc.tio.version>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<!-- Spring Cloud 基础 -->
|
||||
|
||||
@@ -31,12 +31,6 @@ public class SampleAnalysisAuditController implements BusinessControllerMarker {
|
||||
@Resource
|
||||
private SampleAnalysisAuditService sampleAnalysisAuditService;
|
||||
|
||||
@GetMapping("/crossAuditByTaskId")
|
||||
public CommonResult<?> crossAuditByTaskId(Long businessAssayTaskId) {
|
||||
JSONObject result = sampleAnalysisAuditService.crossAuditByTaskId(businessAssayTaskId);
|
||||
return success(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 交叉审核
|
||||
* @return
|
||||
|
||||
@@ -59,14 +59,6 @@ public class SampleEntrustController implements BusinessControllerMarker {
|
||||
BusinessSampleEntrustRegistrationExtendRespVO sampleEntrustRegistration = sampleEntrustService.detail(id);
|
||||
return success(sampleEntrustRegistration);
|
||||
}
|
||||
|
||||
@GetMapping("/reportDetail")
|
||||
@Operation(summary = "委托单详情数据")
|
||||
public CommonResult<?> reportDetail(@RequestParam("id") Long id) {
|
||||
JSONObject jsonObject = sampleEntrustService.reportDetail(id);
|
||||
return success(jsonObject);
|
||||
|
||||
}
|
||||
|
||||
@PostMapping("/update")
|
||||
@Operation(summary = "修改委托登记")
|
||||
|
||||
@@ -1,33 +1,24 @@
|
||||
package com.zt.plat.module.qms.business.bus.controller.admin;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.yomahub.liteflow.core.FlowExecutor;
|
||||
import com.yomahub.liteflow.flow.LiteflowResponse;
|
||||
import com.zt.plat.framework.business.interceptor.BusinessControllerMarker;
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
import com.zt.plat.framework.tenant.core.context.TenantContextHolder;
|
||||
import com.zt.plat.module.qms.business.bus.liteflow.param.SampleFlowInfo;
|
||||
import com.zt.plat.module.qms.business.bus.liteflow.param.SampleFlowParam;
|
||||
import com.zt.plat.module.qms.business.bus.liteflow.slot.SampleFlowContext;
|
||||
import com.zt.plat.module.qms.business.bus.service.SampleFlowService;
|
||||
import com.zt.plat.module.qms.core.sampleflow.SampleFlowDefinition;
|
||||
import com.zt.plat.module.qms.core.sampleflow.SampleFlowNode;
|
||||
import com.zt.plat.module.qms.enums.QmsCommonConstant;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
|
||||
import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||
import static com.zt.plat.framework.common.pojo.CommonResult.error;
|
||||
|
||||
@Tag(name = "管理后台 - 样品流转")
|
||||
@RestController
|
||||
@@ -45,138 +36,22 @@ public class SampleFlowController implements BusinessControllerMarker {
|
||||
public CommonResult<?> sampleFlow(@Validated @RequestBody SampleFlowParam sampleFlowParam) {
|
||||
LiteflowResponse response = sampleFlowService.sampleFlow(sampleFlowParam);
|
||||
return success(response.getContextBean(SampleFlowContext.class));
|
||||
}
|
||||
|
||||
@GetMapping("/test")
|
||||
public CommonResult<?> test() {
|
||||
|
||||
SampleFlowDefinition sampleFlowDefinition = new SampleFlowDefinition();
|
||||
sampleFlowDefinition.setFlowKey("flw_sub_sample_process");
|
||||
sampleFlowDefinition.setFlowName("子样样品流转流程");
|
||||
List<SampleFlowNode> flowNodeList = new ArrayList<>();
|
||||
|
||||
SampleFlowNode zxr = new SampleFlowNode();
|
||||
zxr.setNodeName("中心收样");
|
||||
zxr.setNodeKey("flw_center_receive");
|
||||
zxr.setSort(3100);
|
||||
|
||||
SampleFlowNode zxs = new SampleFlowNode();
|
||||
zxs.setNodeName("中心送样");
|
||||
zxs.setNodeKey("flw_center_send");
|
||||
zxs.setSort(3200);
|
||||
|
||||
SampleFlowNode bzr = new SampleFlowNode();
|
||||
bzr.setNodeName("班组收样");
|
||||
bzr.setNodeKey("flw_team_receive");
|
||||
bzr.setSort(3300);
|
||||
|
||||
SampleFlowNode ypbm = new SampleFlowNode();
|
||||
ypbm.setNodeName("样品编密");
|
||||
ypbm.setNodeKey("flw_sample_encrypt");
|
||||
ypbm.setSort(3400);
|
||||
|
||||
// SampleFlowNode fxr = new SampleFlowNode();
|
||||
// fxr.setNodeName("分析收样");
|
||||
// fxr.setNodeKey("flw_analysis_receive");
|
||||
// fxr.setSort(3500);
|
||||
//
|
||||
SampleFlowNode fx = new SampleFlowNode();
|
||||
fx.setNodeName("样品分析");
|
||||
fx.setNodeKey("flw_analysis");
|
||||
fx.setSort(3550);
|
||||
//
|
||||
// SampleFlowNode fxs = new SampleFlowNode();
|
||||
// fxs.setNodeName("分析送样");
|
||||
// fxs.setNodeKey("flw_analysis_send");
|
||||
// fxs.setSort(3600);
|
||||
|
||||
SampleFlowNode bzs = new SampleFlowNode();
|
||||
bzs.setNodeName("班组送样");
|
||||
bzs.setNodeKey("flw_team_send");
|
||||
bzs.setSort(3700);
|
||||
|
||||
SampleFlowNode ypgk = new SampleFlowNode();
|
||||
ypgk.setNodeName("样品归库");
|
||||
ypgk.setNodeKey("flw_sample_storage");
|
||||
ypgk.setSort(3800);
|
||||
ypgk.setNextFlowNodeList(null);
|
||||
flowNodeList.add(ypgk);
|
||||
|
||||
|
||||
zxr.setNextFlowNodeList(new ArrayList<SampleFlowNode>() {
|
||||
{
|
||||
add(BeanUtils.toBean(zxs,SampleFlowNode.class).setIsDefault(true));
|
||||
}
|
||||
});
|
||||
flowNodeList.add(zxr);
|
||||
|
||||
|
||||
zxs.setNextFlowNodeList(new ArrayList<>() {{
|
||||
add(BeanUtils.toBean(bzr,SampleFlowNode.class).setIsDefault(true));
|
||||
}});
|
||||
flowNodeList.add(zxs);
|
||||
|
||||
bzr.setNextFlowNodeList(new ArrayList<>() {{
|
||||
add(BeanUtils.toBean(ypbm,SampleFlowNode.class).setCondition("subSampleEncrypt"));//样品需要编密并且没编密过
|
||||
add(BeanUtils.toBean(fx,SampleFlowNode.class).setCondition("subSampleNotEncrypt"));//样品无需编密或样品已编密过
|
||||
}});
|
||||
flowNodeList.add(bzr);
|
||||
|
||||
|
||||
ypbm.setNextFlowNodeList(new ArrayList<>() {{
|
||||
add(BeanUtils.toBean(fx,SampleFlowNode.class).setIsDefault(true));
|
||||
}});
|
||||
flowNodeList.add(ypbm);
|
||||
|
||||
|
||||
// fxr.setNextFlowNodeList(new ArrayList<>() {{
|
||||
// add(BeanUtils.toBean(fxs,SampleFlowNode.class).setIsDefault(true));
|
||||
// }});
|
||||
// flowNodeList.add(fxr);
|
||||
//
|
||||
//
|
||||
// fxs.setNextFlowNodeList(new ArrayList<>() {{
|
||||
// add(BeanUtils.toBean(bzs,SampleFlowNode.class).setIsDefault(true).setCondition("当前部门任务已全部分析完"));
|
||||
// }});
|
||||
// flowNodeList.add(fxs);
|
||||
|
||||
fx.setNextFlowNodeList(new ArrayList<>() {{
|
||||
add(BeanUtils.toBean(bzs,SampleFlowNode.class).setIsDefault(true).setCondition("当前部门任务已全部分析完"));
|
||||
}});
|
||||
flowNodeList.add(fx);
|
||||
|
||||
bzs.setNextFlowNodeList(new ArrayList<>() {{
|
||||
// add(BeanUtils.toBean(fx,SampleFlowNode.class).setCondition("样品当前分析班组结果超差,需要发起复检"));
|
||||
add(BeanUtils.toBean(bzr,SampleFlowNode.class).setCondition("subSampleSelfReportedOthersPending"));//当前部门数据已全部判断上报
|
||||
add(BeanUtils.toBean(ypgk,SampleFlowNode.class).setCondition("subSampleAlldeptAnalyzed"));//当前样品所有分析任务已全部上报完
|
||||
}});
|
||||
flowNodeList.add(bzs);
|
||||
|
||||
sampleFlowDefinition.setFlowNodeList(flowNodeList);
|
||||
|
||||
String jsonSampleFlowDefinition = JSON.toJSONString(sampleFlowDefinition);
|
||||
|
||||
System.out.println(jsonSampleFlowDefinition);
|
||||
|
||||
Long tenantId = TenantContextHolder.getRequiredTenantId();
|
||||
|
||||
List<SampleFlowInfo> sampleFlowInfoList = new ArrayList<>();
|
||||
sampleFlowInfoList.add(new SampleFlowInfo().setId(1967550576457330690L).setIsWeighing(0));
|
||||
|
||||
SampleFlowParam sampleFlowParam = new SampleFlowParam();
|
||||
sampleFlowParam.setSampleSourceType(2);
|
||||
sampleFlowParam.setCurrentSampleFlowKey("P3000");
|
||||
sampleFlowParam.setSampleFlowInfoList(sampleFlowInfoList);
|
||||
|
||||
|
||||
|
||||
LiteflowResponse response = flowExecutor.execute2Resp("sampleFlowChain" + tenantId, sampleFlowParam, SampleFlowContext.class);
|
||||
if (response.isSuccess()) {
|
||||
return success(response.getContextBean(SampleFlowContext.class));
|
||||
} else {
|
||||
return error(1_032_100_000, response.getMessage());
|
||||
}
|
||||
//return success(FlowBus.getNodeMap());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 中心收样并送样
|
||||
* @param sampleFlowParam
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/centerReceiveAndSend")
|
||||
public CommonResult<?> centerReceiveAndSend(@Validated @RequestBody SampleFlowParam sampleFlowParam) {
|
||||
//中心收样
|
||||
sampleFlowParam.setCurrentSampleFlowKey(QmsCommonConstant.FLOW_NODE_CENTER_RECEIVE);
|
||||
LiteflowResponse response = sampleFlowService.sampleFlow(sampleFlowParam);
|
||||
//中心送样
|
||||
sampleFlowParam.setCurrentSampleFlowKey(QmsCommonConstant.FLOW_NODE_CENTER_SEND);
|
||||
sampleFlowParam.setSendSampleOper(null);
|
||||
response = sampleFlowService.sampleFlow(sampleFlowParam);
|
||||
return success(response.getContextBean(SampleFlowContext.class));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.zt.plat.module.qms.business.bus.controller.admin;
|
||||
|
||||
import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.module.qms.business.bus.service.SampleAnalysisAuditService;
|
||||
import com.zt.plat.module.qms.business.bus.service.SampleEntrustService;
|
||||
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import jakarta.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 报表数据查询接口,不继承BusinessControllerMarker
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/qms/bus/sample/reporting-data-query")
|
||||
public class SampleReportDataQueryController {
|
||||
|
||||
@Resource
|
||||
private SampleEntrustService sampleEntrustService;
|
||||
|
||||
@Resource
|
||||
private SampleAnalysisAuditService sampleAnalysisAuditService;
|
||||
|
||||
@GetMapping("/entrust-report-detail")
|
||||
@Operation(summary = "委托单详情数据")
|
||||
public CommonResult<?> reportDetail(@RequestParam("id") Long id) {
|
||||
JSONObject jsonObject = sampleEntrustService.reportDetail(id);
|
||||
return success(jsonObject);
|
||||
|
||||
}
|
||||
|
||||
@Operation(summary = "委托单详情数据")
|
||||
@GetMapping("/crossAuditByTaskId")
|
||||
public CommonResult<?> crossAuditByTaskId(Long businessAssayTaskId) {
|
||||
JSONObject result = sampleAnalysisAuditService.crossAuditByTaskId(businessAssayTaskId);
|
||||
return success(result);
|
||||
}
|
||||
}
|
||||
@@ -39,6 +39,13 @@ public class SampleTaskAssignController implements BusinessControllerMarker {
|
||||
List<AdminUserRespDTO> list = sampleTaskAssignService.getAssignUserList();
|
||||
return success(list);
|
||||
}
|
||||
|
||||
@Operation(description = "根据用户id获取用户信息")
|
||||
@GetMapping("/getUserInfoById")
|
||||
public CommonResult<?> getUserInfoById(Long userId) {
|
||||
AdminUserRespDTO userRespDTO = sampleTaskAssignService.getUserInfoById(userId);
|
||||
return success(userRespDTO);
|
||||
}
|
||||
|
||||
@GetMapping("/getAssaySampleList")
|
||||
public CommonResult<?> getAssaySampleList(BusinessAssayTaskDataReqVO reqVO) {
|
||||
|
||||
@@ -0,0 +1,155 @@
|
||||
package com.zt.plat.module.qms.business.bus.controller.admin;
|
||||
|
||||
import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
import com.zt.plat.module.qms.core.sampleflow.SampleFlowDefinition;
|
||||
import com.zt.plat.module.qms.core.sampleflow.SampleFlowNode;
|
||||
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/qms/bus/test")
|
||||
public class TestController {
|
||||
|
||||
|
||||
@GetMapping("/testSampleFlow")
|
||||
public CommonResult<?> testSampleFlow() {
|
||||
|
||||
SampleFlowDefinition sampleFlowDefinition = new SampleFlowDefinition();
|
||||
sampleFlowDefinition.setFlowKey("flw_sub_sample_process");
|
||||
sampleFlowDefinition.setFlowName("子样样品流转流程");
|
||||
List<SampleFlowNode> flowNodeList = new ArrayList<>();
|
||||
|
||||
SampleFlowNode zxr = new SampleFlowNode();
|
||||
zxr.setNodeName("中心收样");
|
||||
zxr.setNodeKey("flw_center_receive");
|
||||
zxr.setSort(3100);
|
||||
|
||||
SampleFlowNode zxs = new SampleFlowNode();
|
||||
zxs.setNodeName("中心送样");
|
||||
zxs.setNodeKey("flw_center_send");
|
||||
zxs.setSort(3200);
|
||||
|
||||
SampleFlowNode bzr = new SampleFlowNode();
|
||||
bzr.setNodeName("班组收样");
|
||||
bzr.setNodeKey("flw_team_receive");
|
||||
bzr.setSort(3300);
|
||||
|
||||
SampleFlowNode ypbm = new SampleFlowNode();
|
||||
ypbm.setNodeName("样品编密");
|
||||
ypbm.setNodeKey("flw_sample_encrypt");
|
||||
ypbm.setSort(3400);
|
||||
|
||||
// SampleFlowNode fxr = new SampleFlowNode();
|
||||
// fxr.setNodeName("分析收样");
|
||||
// fxr.setNodeKey("flw_analysis_receive");
|
||||
// fxr.setSort(3500);
|
||||
//
|
||||
SampleFlowNode fx = new SampleFlowNode();
|
||||
fx.setNodeName("样品分析");
|
||||
fx.setNodeKey("flw_analysis");
|
||||
fx.setSort(3550);
|
||||
//
|
||||
// SampleFlowNode fxs = new SampleFlowNode();
|
||||
// fxs.setNodeName("分析送样");
|
||||
// fxs.setNodeKey("flw_analysis_send");
|
||||
// fxs.setSort(3600);
|
||||
|
||||
SampleFlowNode bzs = new SampleFlowNode();
|
||||
bzs.setNodeName("班组送样");
|
||||
bzs.setNodeKey("flw_team_send");
|
||||
bzs.setSort(3700);
|
||||
|
||||
SampleFlowNode ypgk = new SampleFlowNode();
|
||||
ypgk.setNodeName("样品归库");
|
||||
ypgk.setNodeKey("flw_sample_storage");
|
||||
ypgk.setSort(3800);
|
||||
ypgk.setNextFlowNodeList(null);
|
||||
flowNodeList.add(ypgk);
|
||||
|
||||
|
||||
zxr.setNextFlowNodeList(new ArrayList<SampleFlowNode>() {
|
||||
private static final long serialVersionUID = 6146393613606839512L;
|
||||
|
||||
{
|
||||
add(BeanUtils.toBean(zxs,SampleFlowNode.class).setIsDefault(true));
|
||||
}
|
||||
});
|
||||
flowNodeList.add(zxr);
|
||||
|
||||
|
||||
zxs.setNextFlowNodeList(new ArrayList<>() {
|
||||
private static final long serialVersionUID = 5357543125760924047L;
|
||||
|
||||
{
|
||||
add(BeanUtils.toBean(bzr,SampleFlowNode.class).setIsDefault(true));
|
||||
}});
|
||||
flowNodeList.add(zxs);
|
||||
|
||||
bzr.setNextFlowNodeList(new ArrayList<>() {
|
||||
private static final long serialVersionUID = 6376704859477839016L;
|
||||
|
||||
{
|
||||
add(BeanUtils.toBean(ypbm,SampleFlowNode.class).setCondition("subSampleEncrypt"));//样品需要编密并且没编密过
|
||||
add(BeanUtils.toBean(fx,SampleFlowNode.class).setCondition("subSampleNotEncrypt"));//样品无需编密或样品已编密过
|
||||
}});
|
||||
flowNodeList.add(bzr);
|
||||
|
||||
|
||||
ypbm.setNextFlowNodeList(new ArrayList<>() {
|
||||
private static final long serialVersionUID = 1014984817516902869L;
|
||||
|
||||
{
|
||||
add(BeanUtils.toBean(fx,SampleFlowNode.class).setIsDefault(true));
|
||||
}});
|
||||
flowNodeList.add(ypbm);
|
||||
|
||||
|
||||
// fxr.setNextFlowNodeList(new ArrayList<>() {{
|
||||
// add(BeanUtils.toBean(fxs,SampleFlowNode.class).setIsDefault(true));
|
||||
// }});
|
||||
// flowNodeList.add(fxr);
|
||||
//
|
||||
//
|
||||
// fxs.setNextFlowNodeList(new ArrayList<>() {{
|
||||
// add(BeanUtils.toBean(bzs,SampleFlowNode.class).setIsDefault(true).setCondition("当前部门任务已全部分析完"));
|
||||
// }});
|
||||
// flowNodeList.add(fxs);
|
||||
|
||||
fx.setNextFlowNodeList(new ArrayList<>() {
|
||||
private static final long serialVersionUID = -610440034210287957L;
|
||||
|
||||
{
|
||||
add(BeanUtils.toBean(bzs,SampleFlowNode.class).setIsDefault(true).setCondition("当前部门任务已全部分析完"));
|
||||
}});
|
||||
flowNodeList.add(fx);
|
||||
|
||||
bzs.setNextFlowNodeList(new ArrayList<>() {
|
||||
private static final long serialVersionUID = -5057434004685743838L;
|
||||
|
||||
{
|
||||
// add(BeanUtils.toBean(fx,SampleFlowNode.class).setCondition("样品当前分析班组结果超差,需要发起复检"));
|
||||
add(BeanUtils.toBean(bzr,SampleFlowNode.class).setCondition("subSampleSelfReportedOthersPending"));//当前部门数据已全部判断上报
|
||||
add(BeanUtils.toBean(ypgk,SampleFlowNode.class).setCondition("subSampleAlldeptAnalyzed"));//当前样品所有分析任务已全部上报完
|
||||
}});
|
||||
flowNodeList.add(bzs);
|
||||
|
||||
sampleFlowDefinition.setFlowNodeList(flowNodeList);
|
||||
|
||||
String jsonSampleFlowDefinition = JSON.toJSONString(sampleFlowDefinition);
|
||||
|
||||
System.out.println(jsonSampleFlowDefinition);
|
||||
|
||||
return success(jsonSampleFlowDefinition);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -105,4 +105,15 @@ public class BusinessAssayTaskDataReqVO {
|
||||
@Schema(description = "样品状态")
|
||||
private String sampleStatus;
|
||||
|
||||
@Schema(description = "检测方法配置名称")
|
||||
private String configAssayMethodName;
|
||||
|
||||
@Schema(description = "样品编号")
|
||||
private String sampleCode;
|
||||
|
||||
@Schema(description = "分析编号")
|
||||
private String sampleAssayCode;
|
||||
|
||||
@Schema(description = "归库编号")
|
||||
private String sampleReturnCode;
|
||||
}
|
||||
@@ -64,5 +64,16 @@ public class BusinessHandoverRecordSubPageReqVO extends PageParam {
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
//==============扩展字段================
|
||||
|
||||
private Long deptId;
|
||||
|
||||
@Schema(description = "分析编号")
|
||||
private String sampleAssayCode;
|
||||
|
||||
@Schema(description = "归库编号")
|
||||
private String sampleReturnCode;
|
||||
|
||||
@Schema(description = "样品名称")
|
||||
private String sampleName;
|
||||
}
|
||||
@@ -6,6 +6,7 @@ import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
import com.zt.plat.module.qms.core.aspect.annotation.Dict;
|
||||
|
||||
@Schema(description = "管理后台 - 委检登记业务 Response VO")
|
||||
@Data
|
||||
@@ -144,10 +145,12 @@ public class BusinessSampleEntrustRegistrationRespVO {
|
||||
@ExcelProperty("数据校验状态,success-数据校验成功、fail-数据校验失败")
|
||||
private String dataCheckStatus;
|
||||
|
||||
@Dict(dicCode = "entrust_assay_status")
|
||||
@Schema(description = "检验状态,unchecked-未检验;checked-已检验", example = "2")
|
||||
@ExcelProperty("检验状态,unchecked-未检验;checked-已检验")
|
||||
private String assayStatus;
|
||||
|
||||
@Dict(dicCode = "entrust_data_status")
|
||||
@Schema(description = "数据回报状态,unreturned-未回报;returned-已回报", example = "1")
|
||||
@ExcelProperty("数据回报状态,unreturned-未回报;returned-已回报")
|
||||
private String dataStatus;
|
||||
|
||||
@@ -47,7 +47,10 @@ public interface BusinessHandoverRecordSubMapper extends BaseMapperX<BusinessHan
|
||||
.eqIfPresent(BusinessHandoverRecordSubDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
|
||||
.betweenIfPresent(BusinessHandoverRecordSubDO::getCreateTime, reqVO.getCreateTime())
|
||||
.eqIfPresent(BusinessHandoverRecordSubDO::getRemark, reqVO.getRemark())
|
||||
.eqIfPresent(BusinessHandoverRecordSubDO::getDeptId, reqVO.getDeptId())
|
||||
.eqIfPresent(BusinessSubSampleDO::getSampleAssayCode, reqVO.getSampleAssayCode())
|
||||
.eqIfPresent(BusinessSubSampleDO::getSampleReturnCode, reqVO.getSampleReturnCode())
|
||||
.likeIfPresent(BusinessSubSampleDO::getSampleName, reqVO.getSampleName())
|
||||
.eqIfPresent(BusinessHandoverRecordSubDO::getDeptId, reqVO.getDeptId())
|
||||
.orderByDesc(BusinessHandoverRecordSubDO::getCreateTime));
|
||||
}
|
||||
|
||||
|
||||
@@ -83,20 +83,31 @@ public interface BusinessSampleEntrustDetailMapper extends BaseMapperX<BusinessS
|
||||
return selectList(new LambdaQueryWrapperX<BusinessSampleEntrustDetailDO>().eq(BusinessSampleEntrustDetailDO::getBusinessSampleEntrustRegistrationId, businessSampleEntrustRegistrationId));
|
||||
}
|
||||
|
||||
default List<BusinessSampleEntrustDetailDO> selectByBusinessSampleEntrustRegistrationIds(List<Long> businessSampleEntrustRegistrationIds) {
|
||||
return selectList(new LambdaQueryWrapperX<BusinessSampleEntrustDetailDO>().in(BusinessSampleEntrustDetailDO::getBusinessSampleEntrustRegistrationId, businessSampleEntrustRegistrationIds));
|
||||
}
|
||||
|
||||
default BusinessSampleEntrustDetailDO selectByBusinessBaseSampleId(Long businessBaseSampleId) {
|
||||
return selectOne(new LambdaQueryWrapperX<BusinessSampleEntrustDetailDO>().eq(BusinessSampleEntrustDetailDO::getBusinessBaseSampleId, businessBaseSampleId));
|
||||
}
|
||||
|
||||
default List<BusinessSampleEntrustDetailDO> selectByBusinessBaseSampleIds(List<Long> businessBaseSampleIds) {
|
||||
return selectList(new LambdaQueryWrapperX<BusinessSampleEntrustDetailDO>().in(BusinessSampleEntrustDetailDO::getBusinessBaseSampleId, businessBaseSampleIds));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询当前批次的第一条数据
|
||||
* @param businessBaseSampleId 任意一条的主样id
|
||||
* @param baseSampleDictionaryBusinessKey 样品大类类型key
|
||||
* @return
|
||||
*/
|
||||
default BusinessSampleEntrustDetailDO selectCurrBatchFirstByBusinessBaseSampleId(Long businessBaseSampleId) {
|
||||
default BusinessSampleEntrustDetailDO selectCurrBatchFirstByBusinessBaseSampleIdAndBaseSampleDictionaryBusinessKey(Long businessBaseSampleId, String baseSampleDictionaryBusinessKey) {
|
||||
BusinessSampleEntrustDetailDO businessSampleEntrustDetailDO = selectByBusinessBaseSampleId(businessBaseSampleId);
|
||||
//查询当前委托的第一条
|
||||
return selectOne(new LambdaQueryWrapperX<BusinessSampleEntrustDetailDO>()
|
||||
return selectJoinOne(BusinessSampleEntrustDetailDO.class, new MPJLambdaWrapperX<BusinessSampleEntrustDetailDO>()
|
||||
.leftJoin(BaseSampleDO.class, BaseSampleDO::getId, BusinessSampleEntrustDetailDO::getBaseSampleId)
|
||||
.eq(BusinessSampleEntrustDetailDO::getBusinessSampleEntrustRegistrationId, businessSampleEntrustDetailDO.getBusinessSampleEntrustRegistrationId())
|
||||
.eq(BaseSampleDO::getDictionaryBusinessKey, baseSampleDictionaryBusinessKey)
|
||||
.orderByAsc(BusinessSampleEntrustDetailDO::getSort)
|
||||
.last(" limit 1 "));
|
||||
|
||||
|
||||
@@ -4,8 +4,10 @@ import java.util.*;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.zt.plat.framework.mybatis.core.query.MPJLambdaWrapperX;
|
||||
import com.zt.plat.module.qms.business.bus.controller.vo.*;
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubParentSampleAssessmentDO;
|
||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodDO;
|
||||
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@@ -34,6 +36,12 @@ public interface BusinessSubParentSampleAssessmentMapper extends BaseMapperX<Bus
|
||||
.eqIfPresent(BusinessSubParentSampleAssessmentDO::getRemark, reqVO.getRemark())
|
||||
.orderByDesc(BusinessSubParentSampleAssessmentDO::getId));
|
||||
}
|
||||
|
||||
default List<BusinessSubParentSampleAssessmentDO> selectByBusinessSubParentSampleIds(List<Long> businessSubParentSampleIds) {
|
||||
return selectJoinList(BusinessSubParentSampleAssessmentDO.class, new MPJLambdaWrapperX<BusinessSubParentSampleAssessmentDO>()
|
||||
.leftJoin(ConfigAssayMethodDO.class, ConfigAssayMethodDO::getId, BusinessSubParentSampleAssessmentDO::getConfigAssayMethodId)
|
||||
.in(BusinessSubParentSampleAssessmentDO::getBusinessSubParentSampleId, businessSubParentSampleIds));
|
||||
}
|
||||
|
||||
default BusinessSubParentSampleAssessmentDO selectByBusinessSubParentSampleIdAndConfigAssayMethodId(Long businessSubParentSampleId, Long configAssayMethodId) {
|
||||
return selectOne(new LambdaQueryWrapperX<BusinessSubParentSampleAssessmentDO>()
|
||||
@@ -48,4 +56,12 @@ public interface BusinessSubParentSampleAssessmentMapper extends BaseMapperX<Bus
|
||||
.eq(BusinessSubParentSampleAssessmentDO::getConfigAssayMethodId, configAssayMethodId));
|
||||
}
|
||||
|
||||
default List<BusinessSubParentSampleAssessmentDO> selectByBusinessSubParentSampleIdsAndAssayDepartmentId(List<Long> businessSubParentSampleIds,
|
||||
Long assayDepartmentId) {
|
||||
return selectJoinList(BusinessSubParentSampleAssessmentDO.class, new MPJLambdaWrapperX<BusinessSubParentSampleAssessmentDO>()
|
||||
.leftJoin(ConfigAssayMethodDO.class, ConfigAssayMethodDO::getId, BusinessSubParentSampleAssessmentDO::getConfigAssayMethodId)
|
||||
.in(BusinessSubParentSampleAssessmentDO::getBusinessSubParentSampleId, businessSubParentSampleIds)
|
||||
.eq(ConfigAssayMethodDO::getAssayDepartmentId, assayDepartmentId));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -45,5 +45,10 @@ public interface BusinessSubParentSampleMapper extends BaseMapperX<BusinessSubPa
|
||||
return selectList(new LambdaQueryWrapperX<BusinessSubParentSampleDO>()
|
||||
.eq(BusinessSubParentSampleDO::getBusinessBaseSampleId, businessBaseSampleId));
|
||||
}
|
||||
|
||||
default List<BusinessSubParentSampleDO> selectByBusinessBaseSampleIds(List<Long> businessBaseSampleIds) {
|
||||
return selectList(new LambdaQueryWrapperX<BusinessSubParentSampleDO>()
|
||||
.in(BusinessSubParentSampleDO::getBusinessBaseSampleId, businessBaseSampleIds));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -46,6 +46,12 @@ public interface BusinessSubSampleAnalysisGroupMapper extends BaseMapperX<Busine
|
||||
.in(BusinessSubSampleAnalysisGroupDO::getBusinessSubParentSampleId, businessSubParentSampleIds));
|
||||
}
|
||||
|
||||
default List<BusinessSubSampleAnalysisGroupDO> selectByBusinessSubParentSampleIdsAndAssayDepartmentId(List<Long> businessSubParentSampleIds, Long assayDepartmentId) {
|
||||
return selectList(new LambdaQueryWrapperX<BusinessSubSampleAnalysisGroupDO>()
|
||||
.in(BusinessSubSampleAnalysisGroupDO::getBusinessSubParentSampleId, businessSubParentSampleIds)
|
||||
.eq(BusinessSubSampleAnalysisGroupDO::getAssayDepartmentId, assayDepartmentId));
|
||||
}
|
||||
|
||||
default List<BusinessSubSampleAnalysisGroupDO> selectByBusinessSubSampleId(Long businessSubSampleId) {
|
||||
return selectList(new LambdaQueryWrapperX<BusinessSubSampleAnalysisGroupDO>()
|
||||
.eq(BusinessSubSampleAnalysisGroupDO::getBusinessSubSampleId, businessSubSampleId));
|
||||
|
||||
@@ -144,8 +144,7 @@ public interface BusinessSubSampleMapper extends BaseMapperX<BusinessSubSampleDO
|
||||
.eqIfPresent(BusinessSubSampleAnalysisGroupDO::getAssayDepartmentId, reqVO.getAssayDepartmentId())
|
||||
.eqIfPresent(BusinessSubSampleAnalysisGroupDO::getAssayDepartmentName, reqVO.getAssayDepartmentName())
|
||||
.eqIfPresent(BusinessSubSampleAnalysisGroupDO::getSampleStatus, reqVO.getAssayDepartmentStatus())
|
||||
.orderByAsc(BusinessSubSampleDO::getSampleCode)
|
||||
);
|
||||
.orderByDesc(BusinessSubSampleDO::getSampleFlowNodeTime).orderByAsc(BusinessSubSampleDO::getSampleCode));
|
||||
}
|
||||
|
||||
default List<BusinessSubSampleExtendRespVO> selectList(@Valid BusinessSubSampleReqVO reqVO) {
|
||||
|
||||
@@ -9,13 +9,15 @@ import java.util.stream.Collectors;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
import com.yomahub.liteflow.annotation.LiteflowComponent;
|
||||
import com.yomahub.liteflow.core.NodeComponent;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
|
||||
import com.zt.plat.framework.common.exception.ServiceException;
|
||||
import com.zt.plat.framework.tenant.core.context.TenantContextHolder;
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayParameterDataDO;
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayProjectDataDO;
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayReportDataDO;
|
||||
@@ -46,11 +48,11 @@ import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubSampleAssessmen
|
||||
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubSampleMapper;
|
||||
import com.zt.plat.module.qms.business.bus.liteflow.param.SampleFlowInfo;
|
||||
import com.zt.plat.module.qms.business.bus.liteflow.slot.SampleEntrustContext;
|
||||
import com.zt.plat.module.qms.business.config.controller.vo.ConfigAssayMethodProjectExtendRespVO;
|
||||
import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSampleMethodConfAdd;
|
||||
import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSampleMethodConfInfo;
|
||||
import com.zt.plat.module.qms.business.config.dal.dataobject.BaseSampleDO;
|
||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodDO;
|
||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectDO;
|
||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectParameterDO;
|
||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigBaseSampleDO;
|
||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSampleFlowDO;
|
||||
@@ -79,6 +81,13 @@ import com.zt.plat.module.qms.enums.QmsCommonConstant;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* 委检样 是否有来样品位S值, 是: 综合分析室分析配料元素,试金分析室获取分析的配料元素 ;否:不送往综合分析室,配料时采用来样品位S值,如果是必须含有Cu、S的,则试金分析人员称样时,估一个Cu品位进行配料。
|
||||
*
|
||||
* 商检分析样 这批样中第一个样品默认产生1个配料任务(综合分析室分析),最终这些配料元素对应到这批商检分析样的每一个试金样品的配料参数上;
|
||||
*
|
||||
* 商检综合样 综合样,除了杂质元素,如果要分析Au、Ag,单个样品综合分析室分析配料元素会单独生成1个任务;这个结果匹配到综合样自身的试金任务的配料参数上;
|
||||
*/
|
||||
@Slf4j
|
||||
@LiteflowComponent(id = "sampleEntrustGenSampleDataCmp", name = "样品委托生成系统样品数据")
|
||||
public class SampleEntrustGenSampleDataCmp extends NodeComponent {
|
||||
@@ -182,47 +191,33 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent {
|
||||
//样品来样品位
|
||||
List<BusinessSampleAssayResultDO> sampleAssayResultList = sampleEntrustContext.getSampleAssayResultList();
|
||||
|
||||
//金银检测项目字典id列表
|
||||
// List<Long> auAgDictionaryProjectIdList = new ArrayList<>() {
|
||||
// private static final long serialVersionUID = 1L;
|
||||
//
|
||||
// {
|
||||
// add(1000000000000000002L);
|
||||
// add(1000000000000000003L);
|
||||
// }};
|
||||
//硫的检测项目字典id
|
||||
// Long sDictionaryProjectId = 1000000000000000004L;
|
||||
|
||||
//商检样品来源id
|
||||
// List<Long> sjEntrustSourceIdList = new ArrayList<>() {
|
||||
// private static final long serialVersionUID = 1L;
|
||||
//
|
||||
// {
|
||||
// add(1000000000000000002L);//中铜国贸
|
||||
// }};
|
||||
List<Long> baseSampleIdList = sampleEntrustDetailList.stream().map(m -> m.getBaseSampleId()).distinct().collect(Collectors.toList());
|
||||
|
||||
//样品大类列表
|
||||
List<BaseSampleDO> baseSampleList = baseSampleMapper.selectList();
|
||||
List<BaseSampleDO> baseSampleList = baseSampleMapper.selectByIds(baseSampleIdList);
|
||||
|
||||
//主样配置
|
||||
List<ConfigBaseSampleDO> configBaseSampleList = configBaseSampleMapper.selectList();
|
||||
List<ConfigBaseSampleDO> configBaseSampleList = configBaseSampleMapper.selectByBaseSampleIds(baseSampleIdList);
|
||||
List<Long> configBaseSampleIdList = configBaseSampleList.stream().map(m -> m.getId()).collect(Collectors.toList());
|
||||
//分样配置
|
||||
List<ConfigSubSampleParentDO> configSubSampleParentList = configSubSampleParentMapper.selectList();
|
||||
List<ConfigSubSampleParentDO> configSubSampleParentList = configSubSampleParentMapper.selectByBaseSampleIds(baseSampleIdList);
|
||||
//子样配置
|
||||
List<ConfigSubSampleDO> configSubSampleList = configSubSampleMapper.selectList();
|
||||
List<ConfigSubSampleDO> configSubSampleList = configSubSampleMapper.selectByBaseSampleIds(baseSampleIdList);
|
||||
List<Long> configSubSampleIdList = configSubSampleList.stream().map(m -> m.getId()).collect(Collectors.toList());
|
||||
//子样分析方法配置
|
||||
List<ConfigSubSampleMethodDO> configSubSampleMethodList = configSubSampleMethodMapper.selectList();
|
||||
List<ConfigSubSampleMethodDO> configSubSampleMethodList = configSubSampleMethodMapper.selectByConfigSubSampleIds(configSubSampleIdList);
|
||||
List<Long> configAssayMethodIdList = configSubSampleMethodList.stream().map(m -> m.getConfigAssayMethodId()).distinct().collect(Collectors.toList());
|
||||
//分析方法配置
|
||||
List<ConfigAssayMethodDO> configAssayMethodList = configAssayMethodMapper.selectList();
|
||||
List<ConfigAssayMethodDO> configAssayMethodList = configAssayMethodMapper.selectByIds(configAssayMethodIdList);
|
||||
//分析方法检测项目配置
|
||||
List<ConfigAssayMethodProjectDO> configAssayMethodProjectList = configAssayMethodProjectMapper.selectList();
|
||||
List<ConfigAssayMethodProjectExtendRespVO> configAssayMethodProjectList = configAssayMethodProjectMapper.selectByConfigAssayMethodIds(configAssayMethodIdList);
|
||||
//分析方法检测项目参数配置
|
||||
List<ConfigAssayMethodProjectParameterDO> configAssayMethodProjectParameterList = configAssayMethodProjectParameterMapper.selectList();
|
||||
List<ConfigAssayMethodProjectParameterDO> configAssayMethodProjectParameterList = configAssayMethodProjectParameterMapper.selectByConfigAssayMethodIds(configAssayMethodIdList);
|
||||
//检测项目字典
|
||||
List<DictionaryProjectDO> dictionaryProjectList = dictionaryProjectMapper.selectList();
|
||||
|
||||
//主样报表配置
|
||||
List<ConfigSampleReportDO> configSampleReportList = configSampleReportMapper.selectList();
|
||||
List<ConfigSampleReportDO> configSampleReportList = configSampleReportMapper.selectByConfigBaseSampleIds(configBaseSampleIdList);
|
||||
|
||||
//样品流程配置
|
||||
List<String> configSampleFlowKeyList = new ArrayList<>();
|
||||
@@ -253,13 +248,6 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent {
|
||||
//分析报表数据
|
||||
List<BusinessAssayReportDataDO> businessAssayReportDataDOList = new ArrayList<>();
|
||||
|
||||
//是否为商检委托
|
||||
// Boolean isSjEntrust = sjEntrustSourceIdList.contains(sampleEntrustRegistration.getConfigEntrustSourceId());
|
||||
//是否分析金银
|
||||
// Boolean isAssayAuAg = sampleEntrustProjectList.stream().anyMatch(f -> auAgDictionaryProjectIdList.contains(f.getDictionaryProjectId()));
|
||||
//是否分析硫
|
||||
// Boolean isAssayS = sampleEntrustProjectList.stream().anyMatch(f -> f.getDictionaryProjectId().equals(sDictionaryProjectId));
|
||||
|
||||
//子样流转信息列表
|
||||
List<SampleFlowInfo> sampleFlowInfoList = new ArrayList<>();
|
||||
|
||||
@@ -267,11 +255,19 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent {
|
||||
List<BusinessSampleEntrustDetailDO> sampleEntrustDetailListSort = sampleEntrustDetailList.stream().sorted(Comparator.comparingInt(BusinessSampleEntrustDetailDO::getSort)).collect(Collectors.toList());
|
||||
//主样
|
||||
BusinessBaseSampleDO businessBaseSampleDO = null;
|
||||
int sort = 0;//委托明细顺序
|
||||
int sjfxyOne = -1;//商检分析样第一个是值为0,已经过商检分析样的值为1,默认值为-1;
|
||||
for (BusinessSampleEntrustDetailDO businessSampleEntrustDetailDO : sampleEntrustDetailListSort) {//委托样品明细
|
||||
|
||||
//样品大类
|
||||
BaseSampleDO baseSampleDO = baseSampleList.stream().filter(f -> f.getId().equals(businessSampleEntrustDetailDO.getBaseSampleId())).findFirst().orElse(null);
|
||||
|
||||
if (QmsCommonConstant.ENTRUST_INSPECTION_ANALYSIS_SAMPLE.equals(baseSampleDO.getDictionaryBusinessKey())){//如果是商检分析样
|
||||
if (sjfxyOne == -1) {
|
||||
sjfxyOne = 0;//第一个商检分析样
|
||||
} else {
|
||||
sjfxyOne = 1;//商检分析样已添加过
|
||||
}
|
||||
}
|
||||
|
||||
//获取当前样品的检测项目
|
||||
List<BusinessSampleEntrustProjectDO> sampleEntrustProjectDOList = sampleEntrustProjectList.stream().filter(f -> businessSampleEntrustDetailDO.getId().equals(f.getBusinessSampleEntrustDetailId())).collect(Collectors.toList());
|
||||
@@ -286,42 +282,17 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent {
|
||||
List<MaterialAssayStandardMethodDO> materialAssayStandardMethodList = sampleEntrustContext.getMaterialAssayStandardMethodDefaultByMaterialAssayStandardDetailIds(materialAssayStandardDetailIdList);
|
||||
|
||||
//获取检测方法
|
||||
List<Long> configAssayMethodIdList = materialAssayStandardMethodList.stream().map(m -> m.getConfigAssayMethodId()).distinct().collect(Collectors.toList());
|
||||
List<Long> materialAssayStandardConfigAssayMethodIdList = materialAssayStandardMethodList.stream().map(m -> m.getConfigAssayMethodId()).distinct().collect(Collectors.toList());
|
||||
|
||||
//查找子样配置
|
||||
List<Long> configSubSampleIdList = configSubSampleMethodList.stream().filter(f -> f.getIsDefaultUse().equals(QmsCommonConstant.YES) && configAssayMethodIdList.contains(f.getConfigAssayMethodId())).map(m -> m.getConfigSubSampleId()).distinct().collect(Collectors.toList());
|
||||
//查找当前委托明细分析的子样配置
|
||||
List<Long> currentConfigSubSampleIdList = configSubSampleMethodList.stream().filter(f -> f.getIsDefaultUse().equals(QmsCommonConstant.YES) && materialAssayStandardConfigAssayMethodIdList.contains(f.getConfigAssayMethodId())).map(m -> m.getConfigSubSampleId()).distinct().collect(Collectors.toList());
|
||||
|
||||
//查询当前委托样品对应的子样
|
||||
List<ConfigSubSampleDO> entrustConfigSubSampleList = configSubSampleList.stream().filter(f -> configSubSampleIdList.contains(f.getId()) && f.getBaseSampleId().equals(businessSampleEntrustDetailDO.getBaseSampleId())).distinct().collect(Collectors.toList());
|
||||
List<ConfigSubSampleDO> entrustConfigSubSampleList = configSubSampleList.stream().filter(f -> currentConfigSubSampleIdList.contains(f.getId()) && f.getBaseSampleId().equals(businessSampleEntrustDetailDO.getBaseSampleId())).distinct().collect(Collectors.toList());
|
||||
if (entrustConfigSubSampleList.size() != 1) {
|
||||
throw new ServiceException(1_032_100_000, "子样配置不正确");
|
||||
}
|
||||
|
||||
|
||||
//是否创建综合样S分析
|
||||
// Boolean isCreateZhy = false;
|
||||
//综合样分析方法
|
||||
// ConfigAssayMethodDO configAssayMethodZhy = null;
|
||||
|
||||
//是商检样品,分析金银,第一个样品
|
||||
// if (isSjEntrust && isAssayAuAg && sort == 0) {
|
||||
//是否分析硫
|
||||
// isAssayS = dictionaryProjectIdList.contains(sDictionaryProjectId);
|
||||
// if (isAssayS) {
|
||||
// isCreateZhy = false;
|
||||
// } else {
|
||||
// isCreateZhy = true;
|
||||
// MaterialAssayStandardMethodDO materialAssayStandardMethodDO = materialAssayStandardMethodMapper.selectByBaseSampleIdAndDictionaryProjectId(businessSampleEntrustDetailDO.getBaseSampleId(), sDictionaryProjectId);
|
||||
// if (materialAssayStandardMethodDO == null) {
|
||||
// throw new ServiceException(1_032_100_000, "商检样品,检测项目存在金银,但未找到S配置");
|
||||
// }
|
||||
// configAssayMethodZhy = configAssayMethodMapper.selectById(materialAssayStandardMethodDO.getConfigAssayMethodId());
|
||||
// }
|
||||
//
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
//获取到子样配置
|
||||
ConfigSubSampleDO configSubSample = entrustConfigSubSampleList.get(0);
|
||||
Long configSubSampleParentId = configSubSample.getConfigSubSampleParentId();
|
||||
@@ -436,8 +407,8 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent {
|
||||
|
||||
//子样对应的分析班组
|
||||
BusinessSubSampleAnalysisGroupDO businessSubSampleAnalysisGroupDO = null;
|
||||
|
||||
for (Long configAssayMethodId : configAssayMethodIdList) {
|
||||
|
||||
for (Long configAssayMethodId : materialAssayStandardConfigAssayMethodIdList) {
|
||||
//查询分析方法
|
||||
ConfigAssayMethodDO configAssayMethodDO = configAssayMethodList.stream().filter(f -> f.getId().equals(configAssayMethodId)).findFirst().orElse(null);
|
||||
|
||||
@@ -456,128 +427,52 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent {
|
||||
List<Long> projectIdList = addAssayTask.getProjectIdList();
|
||||
//判定检测项目包含条件中的检测项目
|
||||
Boolean isAssayConditionProjectList = sampleEntrustProjectList.stream().anyMatch(f -> conditionProjectIdList.contains(f.getDictionaryProjectId()));
|
||||
if (isAssayConditionProjectList && sort == 0) {
|
||||
ConfigAssayMethodDO addAssayTaskConfigAssayMethod = configAssayMethodMapper.selectById(methodId);
|
||||
Long addAssayTaskAssayDepartmentId = addAssayTaskConfigAssayMethod.getAssayDepartmentId();
|
||||
|
||||
//查询子样对应的分析方法
|
||||
ConfigSubSampleMethodDO addAssayTaskConfigSubSampleMethodDO = configSubSampleMethodList.stream().filter(f -> f.getIsDefaultUse().equals(QmsCommonConstant.YES) && f.getConfigAssayMethodId().equals(methodId) && f.getConfigSubSampleId().equals(configSubSample.getId())).findFirst().orElse(null);
|
||||
|
||||
businessSubSampleAnalysisGroupDO = businessSubSampleAnalysisGroupDOList.stream().filter(f -> f.getBusinessSubSampleId().equals(businessSubSampleDO.getId()) && f.getAssayDepartmentId().equals(addAssayTaskAssayDepartmentId)).findFirst().orElse(null);
|
||||
if (businessSubSampleAnalysisGroupDO == null) {
|
||||
businessSubSampleAnalysisGroupDO = new BusinessSubSampleAnalysisGroupDO();
|
||||
businessSubSampleAnalysisGroupDO.setId(IdWorker.getId());
|
||||
businessSubSampleAnalysisGroupDO.setBusinessBaseSampleId(businessSubSampleDO.getBusinessBaseSampleId());
|
||||
businessSubSampleAnalysisGroupDO.setBusinessSubParentSampleId(businessSubSampleDO.getBusinessSubParentSampleId());
|
||||
businessSubSampleAnalysisGroupDO.setBusinessSubSampleId(businessSubSampleDO.getId());
|
||||
businessSubSampleAnalysisGroupDO.setAssayDepartmentId(addAssayTaskConfigAssayMethod.getAssayDepartmentId());
|
||||
businessSubSampleAnalysisGroupDO.setAssayDepartmentName(addAssayTaskConfigAssayMethod.getAssayDepartmentName());
|
||||
businessSubSampleAnalysisGroupDO.setSampleStatus("待收样");
|
||||
|
||||
businessSubSampleAnalysisGroupDOList.add(businessSubSampleAnalysisGroupDO);
|
||||
}
|
||||
|
||||
//根据任务数判断是平行还是
|
||||
String assayType = addAssayTaskConfigSubSampleMethodDO.getTaskCount() > 1 ? QmsCommonConstant.ASSAY_TYPE_SINGLE_PARALLEL : QmsCommonConstant.ASSAY_TYPE_SINGLE_CUP;
|
||||
|
||||
//分样判定数据
|
||||
BusinessSubParentSampleAssessmentDO businessSubParentSampleAssessmentDO = new BusinessSubParentSampleAssessmentDO();
|
||||
businessSubParentSampleAssessmentDO.setId(IdWorker.getId());
|
||||
businessSubParentSampleAssessmentDO.setBusinessSubParentSampleId(businessSubSampleDO.getBusinessSubParentSampleId());
|
||||
businessSubParentSampleAssessmentDO.setConfigAssayMethodId(addAssayTaskConfigAssayMethod.getId());
|
||||
businessSubParentSampleAssessmentDO.setAssayType(assayType);
|
||||
businessSubParentSampleAssessmentDO.setTaskType("常规");
|
||||
businessSubParentSampleAssessmentDOList.add(businessSubParentSampleAssessmentDO);
|
||||
|
||||
//子样判定数据
|
||||
BusinessSubSampleAssessmentDO businessSubSampleAssessmentDO = new BusinessSubSampleAssessmentDO();
|
||||
businessSubSampleAssessmentDO.setId(IdWorker.getId());
|
||||
businessSubSampleAssessmentDO.setBusinessBaseSampleId(businessSubSampleDO.getBusinessBaseSampleId());
|
||||
businessSubSampleAssessmentDO.setBusinessSubParentSampleId(businessSubSampleDO.getBusinessSubParentSampleId());
|
||||
businessSubSampleAssessmentDO.setBusinessSubParentSampleAssessmentId(businessSubParentSampleAssessmentDO.getId());
|
||||
businessSubSampleAssessmentDO.setBusinessSubSampleId(businessSubSampleDO.getId());
|
||||
businessSubSampleAssessmentDO.setConfigAssayMethodId(addAssayTaskConfigAssayMethod.getId());
|
||||
businessSubSampleAssessmentDO.setAssayType(assayType);
|
||||
businessSubSampleAssessmentDO.setTaskType("常规");
|
||||
|
||||
businessSubSampleAssessmentDOList.add(businessSubSampleAssessmentDO);
|
||||
|
||||
//根据检测方法循环
|
||||
BusinessAssayTaskDataDO businessAssayTaskDataDO = null;
|
||||
//根据任务数循环
|
||||
for (int i = 0; i < addAssayTaskConfigSubSampleMethodDO.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(addAssayTaskConfigAssayMethod.getId());
|
||||
businessAssayTaskDataDO.setAssayType(assayType);
|
||||
businessAssayTaskDataDO.setTaskType("常规");
|
||||
businessAssayTaskDataDO.setConfigSampleFlowId(configSampleFlowSub.getId());
|
||||
businessAssayTaskDataDO.setSampleFlowNodeKey(sampleFlowNodeSub.getNodeKey());
|
||||
businessAssayTaskDataDO.setSampleFlowNodeTime(currentDateTime);
|
||||
businessAssayTaskDataDO.setAssayDepartmentId(addAssayTaskConfigAssayMethod.getAssayDepartmentId());
|
||||
businessAssayTaskDataDO.setAssayDepartmentName(addAssayTaskConfigAssayMethod.getAssayDepartmentName());
|
||||
|
||||
List<ConfigAssayMethodProjectDO> configAssayMethodProjectDOList = configAssayMethodProjectList.stream().filter(f -> f.getConfigAssayMethodId().equals(methodId)).collect(Collectors.toList());
|
||||
|
||||
StringBuilder assayProjectBuilder = new StringBuilder();
|
||||
|
||||
for (ConfigAssayMethodProjectDO configAssayMethodProjectDO : configAssayMethodProjectDOList) {
|
||||
|
||||
//如果当前分析方法的项目不在当前检测项目中,则跳出循环继续
|
||||
if (!projectIdList.contains(configAssayMethodProjectDO.getDictionaryProjectId())) {
|
||||
continue;
|
||||
}
|
||||
|
||||
DictionaryProjectDO dictionaryProject = dictionaryProjectList.stream().filter(f -> f.getId().equals(configAssayMethodProjectDO.getDictionaryProjectId())).findFirst().orElse(null);
|
||||
assayProjectBuilder.append(dictionaryProject.getShowName()).append(",");
|
||||
|
||||
|
||||
//检测项目
|
||||
BusinessAssayProjectDataDO businessAssayProjectDataDO = new BusinessAssayProjectDataDO();
|
||||
businessAssayProjectDataDO.setId(IdWorker.getId());
|
||||
businessAssayProjectDataDO.setBusinessAssayTaskDataId(businessAssayTaskDataDO.getId());
|
||||
businessAssayProjectDataDO.setConfigAssayMethodProjectId(configAssayMethodProjectDO.getId());
|
||||
businessAssayProjectDataDO.setDictionaryProjectId(configAssayMethodProjectDO.getDictionaryProjectId());
|
||||
businessAssayProjectDataDO.setDataType(configAssayMethodProjectDO.getDataType());
|
||||
businessAssayProjectDataDO.setDecimalPosition(configAssayMethodProjectDO.getDecimalPosition());
|
||||
businessAssayProjectDataDO.setUsage(QmsCommonConstant.ASSAY_PROJECT_USAGE_INGREDIENT);
|
||||
businessAssayProjectDataDO.setMinimumLimitValue(configAssayMethodProjectDO.getMinimumLimitValue());
|
||||
businessAssayProjectDataDO.setIsEnabled(1);
|
||||
businessAssayProjectDataDO.setIsNotAssessment(0);
|
||||
|
||||
businessAssayProjectDataDOList.add(businessAssayProjectDataDO);
|
||||
|
||||
List<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());
|
||||
|
||||
|
||||
businessAssayParameterDataDOList.add(businessAssayParameterDataDO);
|
||||
}
|
||||
//是否预报S值
|
||||
Boolean isForecastS = false;
|
||||
String forecastResult = businessSampleEntrustDetailDO.getForecastResult();
|
||||
if (StringUtils.isNotBlank(forecastResult)) {
|
||||
JSONArray array = JSON.parseArray(forecastResult);
|
||||
for (int i = 0; i < array.size(); i++) {
|
||||
JSONObject item = array.getJSONObject(i);
|
||||
if ("S".equals(item.getString("simpleName"))) {
|
||||
isForecastS = true;
|
||||
break;
|
||||
}
|
||||
|
||||
assayProjectBuilder.delete(assayProjectBuilder.length() - 1 , assayProjectBuilder.length());
|
||||
businessAssayTaskDataDO.setAssayProject(assayProjectBuilder.toString());
|
||||
businessAssayTaskDataDOList.add(businessAssayTaskDataDO);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//如果是商检样分析,且为第一个商检分析样,并且包含要检测的项目,
|
||||
if (QmsCommonConstant.ENTRUST_INSPECTION_ANALYSIS_SAMPLE.equals(baseSampleDO.getDictionaryBusinessKey()) && isAssayConditionProjectList && sjfxyOne == 0) {
|
||||
addAssayTask(currentDateTime, configSubSampleMethodList, configAssayMethodProjectList,
|
||||
configAssayMethodProjectParameterList, dictionaryProjectList,
|
||||
businessSubParentSampleAssessmentDOList, businessSubSampleAnalysisGroupDOList,
|
||||
businessSubSampleAssessmentDOList, businessAssayTaskDataDOList,
|
||||
businessAssayProjectDataDOList, businessAssayParameterDataDOList, configSubSample,
|
||||
configSampleFlowSub, sampleFlowNodeSub, businessSubSampleDO, methodId,
|
||||
projectIdList);
|
||||
} else if (QmsCommonConstant.ENTRUST_COMPREHENSIVE_INSPECTION_SAMPLE.equals(baseSampleDO.getDictionaryBusinessKey()) && isAssayConditionProjectList) {//如果是商检综合样,并且包含需检查的项目
|
||||
addAssayTask(currentDateTime, configSubSampleMethodList, configAssayMethodProjectList,
|
||||
configAssayMethodProjectParameterList, dictionaryProjectList,
|
||||
businessSubParentSampleAssessmentDOList, businessSubSampleAnalysisGroupDOList,
|
||||
businessSubSampleAssessmentDOList, businessAssayTaskDataDOList,
|
||||
businessAssayProjectDataDOList, businessAssayParameterDataDOList, configSubSample,
|
||||
configSampleFlowSub, sampleFlowNodeSub, businessSubSampleDO, methodId,
|
||||
projectIdList);
|
||||
|
||||
} else if (QmsCommonConstant.ENTRUST_COMMISSION_INSPECTION_SAMPLE.equals(baseSampleDO.getDictionaryBusinessKey()) && isAssayConditionProjectList && !isForecastS ) {//如果是委检样,包含检测项目,未预报S值
|
||||
addAssayTask(currentDateTime, configSubSampleMethodList, configAssayMethodProjectList,
|
||||
configAssayMethodProjectParameterList, dictionaryProjectList,
|
||||
businessSubParentSampleAssessmentDOList, businessSubSampleAnalysisGroupDOList,
|
||||
businessSubSampleAssessmentDOList, businessAssayTaskDataDOList,
|
||||
businessAssayProjectDataDOList, businessAssayParameterDataDOList, configSubSample,
|
||||
configSampleFlowSub, sampleFlowNodeSub, businessSubSampleDO, methodId,
|
||||
projectIdList);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//分析班组
|
||||
businessSubSampleAnalysisGroupDO = businessSubSampleAnalysisGroupDOList.stream().filter(f -> f.getBusinessSubSampleId().equals(businessSubSampleDO.getId()) && f.getAssayDepartmentId().equals(configAssayMethodDO.getAssayDepartmentId())).findFirst().orElse(null);
|
||||
if (businessSubSampleAnalysisGroupDO == null) {
|
||||
businessSubSampleAnalysisGroupDO = new BusinessSubSampleAnalysisGroupDO();
|
||||
@@ -638,11 +533,11 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent {
|
||||
businessAssayTaskDataDO.setAssayDepartmentName(configAssayMethodDO.getAssayDepartmentName());
|
||||
|
||||
|
||||
List<ConfigAssayMethodProjectDO> configAssayMethodProjectDOList = configAssayMethodProjectList.stream().filter(f -> f.getConfigAssayMethodId().equals(configAssayMethodId)).collect(Collectors.toList());
|
||||
List<ConfigAssayMethodProjectExtendRespVO> configAssayMethodProjectDOList = configAssayMethodProjectList.stream().filter(f -> f.getConfigAssayMethodId().equals(configAssayMethodId)).collect(Collectors.toList());
|
||||
|
||||
StringBuilder assayProjectBuilder = new StringBuilder();
|
||||
|
||||
for (ConfigAssayMethodProjectDO configAssayMethodProjectDO : configAssayMethodProjectDOList) {
|
||||
for (ConfigAssayMethodProjectExtendRespVO configAssayMethodProjectDO : configAssayMethodProjectDOList) {
|
||||
|
||||
//如果当前分析方法的项目不在当前检测项目中,则跳出循环继续
|
||||
if (!dictionaryProjectIdList.contains(configAssayMethodProjectDO.getDictionaryProjectId())) {
|
||||
@@ -661,9 +556,6 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent {
|
||||
businessAssayProjectDataDO.setDataType(configAssayMethodProjectDO.getDataType());
|
||||
businessAssayProjectDataDO.setDecimalPosition(configAssayMethodProjectDO.getDecimalPosition());
|
||||
businessAssayProjectDataDO.setUsage(QmsCommonConstant.ASSAY_PROJECT_USAGE_REPORT);
|
||||
// if (isSjEntrust && isAssayAuAg && sort == 0 && !isCreateZhy && sDictionaryProjectId.equals(configAssayMethodProjectDO.getDictionaryProjectId())) {//是商检样品,分析金银,第一个样品,不创建综合样,并且是S值
|
||||
// businessAssayProjectDataDO.setUsage(QmsCommonConstant.ASSAY_PROJECT_USAGE_INGREDIENT_REPORT);
|
||||
// }
|
||||
|
||||
businessAssayProjectDataDO.setMinimumLimitValue(configAssayMethodProjectDO.getMinimumLimitValue());
|
||||
businessAssayProjectDataDO.setIsEnabled(1);
|
||||
@@ -686,126 +578,21 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
assayProjectBuilder.delete(assayProjectBuilder.length() - 1 , assayProjectBuilder.length());
|
||||
|
||||
if (assayProjectBuilder.length() > 1) {
|
||||
assayProjectBuilder.delete(assayProjectBuilder.length() - 1 , assayProjectBuilder.length());
|
||||
}
|
||||
businessAssayTaskDataDO.setAssayProject(assayProjectBuilder.toString());
|
||||
businessAssayTaskDataDOList.add(businessAssayTaskDataDO);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
//判定是商检 分析金银 需要创建综合样,样品为第1个
|
||||
if (isSjEntrust && isAssayAuAg && sort == 0 && isCreateZhy && configAssayMethodZhy != null) {
|
||||
Long configAssayMethodIdZhy = configAssayMethodZhy.getId();
|
||||
Long assayDepartmentIdZhy = configAssayMethodZhy.getAssayDepartmentId();
|
||||
|
||||
//查询子样对应的分析方法
|
||||
ConfigSubSampleMethodDO configSubSampleMethodDO = configSubSampleMethodList.stream().filter(f -> f.getIsDefaultUse().equals(QmsCommonConstant.YES) && f.getConfigAssayMethodId().equals(configAssayMethodIdZhy) && f.getConfigSubSampleId().equals(configSubSample.getId())).findFirst().orElse(null);
|
||||
|
||||
businessSubSampleAnalysisGroupDO = businessSubSampleAnalysisGroupDOList.stream().filter(f -> f.getBusinessSubSampleId().equals(businessSubSampleDO.getId()) && f.getAssayDepartmentId().equals(assayDepartmentIdZhy)).findFirst().orElse(null);
|
||||
if (businessSubSampleAnalysisGroupDO == null) {
|
||||
businessSubSampleAnalysisGroupDO = new BusinessSubSampleAnalysisGroupDO();
|
||||
businessSubSampleAnalysisGroupDO.setId(IdWorker.getId());
|
||||
businessSubSampleAnalysisGroupDO.setBusinessBaseSampleId(businessSubSampleDO.getBusinessBaseSampleId());
|
||||
businessSubSampleAnalysisGroupDO.setBusinessSubParentSampleId(businessSubSampleDO.getBusinessSubParentSampleId());
|
||||
businessSubSampleAnalysisGroupDO.setBusinessSubSampleId(businessSubSampleDO.getId());
|
||||
businessSubSampleAnalysisGroupDO.setAssayDepartmentId(configAssayMethodZhy.getAssayDepartmentId());
|
||||
businessSubSampleAnalysisGroupDO.setAssayDepartmentName(configAssayMethodZhy.getAssayDepartmentName());
|
||||
businessSubSampleAnalysisGroupDO.setSampleStatus("待收样");
|
||||
|
||||
businessSubSampleAnalysisGroupDOList.add(businessSubSampleAnalysisGroupDO);
|
||||
}
|
||||
|
||||
//根据任务数判断是平行还是
|
||||
String assayType = configSubSampleMethodDO.getTaskCount() > 1 ? QmsCommonConstant.ASSAY_TYPE_SINGLE_PARALLEL : QmsCommonConstant.ASSAY_TYPE_SINGLE_CUP;
|
||||
|
||||
//分样判定数据
|
||||
BusinessSubParentSampleAssessmentDO businessSubParentSampleAssessmentDO = new BusinessSubParentSampleAssessmentDO();
|
||||
businessSubParentSampleAssessmentDO.setId(IdWorker.getId());
|
||||
businessSubParentSampleAssessmentDO.setBusinessSubParentSampleId(businessSubSampleDO.getBusinessSubParentSampleId());
|
||||
businessSubParentSampleAssessmentDO.setConfigAssayMethodId(configAssayMethodZhy.getId());
|
||||
businessSubParentSampleAssessmentDO.setAssayType(assayType);
|
||||
businessSubParentSampleAssessmentDO.setTaskType("常规");
|
||||
businessSubParentSampleAssessmentDOList.add(businessSubParentSampleAssessmentDO);
|
||||
|
||||
//子样判定数据
|
||||
BusinessSubSampleAssessmentDO businessSubSampleAssessmentDO = new BusinessSubSampleAssessmentDO();
|
||||
businessSubSampleAssessmentDO.setId(IdWorker.getId());
|
||||
businessSubSampleAssessmentDO.setBusinessBaseSampleId(businessSubSampleDO.getBusinessBaseSampleId());
|
||||
businessSubSampleAssessmentDO.setBusinessSubParentSampleId(businessSubSampleDO.getBusinessSubParentSampleId());
|
||||
businessSubSampleAssessmentDO.setBusinessSubParentSampleAssessmentId(businessSubParentSampleAssessmentDO.getId());
|
||||
businessSubSampleAssessmentDO.setBusinessSubSampleId(businessSubSampleDO.getId());
|
||||
businessSubSampleAssessmentDO.setConfigAssayMethodId(configAssayMethodZhy.getId());
|
||||
businessSubSampleAssessmentDO.setAssayType(assayType);
|
||||
businessSubSampleAssessmentDO.setTaskType("常规");
|
||||
|
||||
businessSubSampleAssessmentDOList.add(businessSubSampleAssessmentDO);
|
||||
|
||||
//根据检测方法循环
|
||||
BusinessAssayTaskDataDO businessAssayTaskDataDO = null;
|
||||
//根据任务数循环
|
||||
for (int i = 0; i < configSubSampleMethodDO.getTaskCount(); i++) {
|
||||
//子样检测任务
|
||||
businessAssayTaskDataDO = new BusinessAssayTaskDataDO();
|
||||
businessAssayTaskDataDO.setId(IdWorker.getId());
|
||||
businessAssayTaskDataDO.setBusinessBaseSampleId(businessSubSampleDO.getBusinessBaseSampleId());
|
||||
businessAssayTaskDataDO.setBusinessSubParentSampleId(businessSubSampleDO.getBusinessSubParentSampleId());
|
||||
businessAssayTaskDataDO.setBusinessSubSampleId(businessSubSampleDO.getId());
|
||||
businessAssayTaskDataDO.setBusinessSubSampleAssessmentId(businessSubSampleAssessmentDO.getId());//子样判定id
|
||||
businessAssayTaskDataDO.setConfigAssayMethodId(configAssayMethodZhy.getId());
|
||||
businessAssayTaskDataDO.setAssayType(assayType);
|
||||
businessAssayTaskDataDO.setTaskType("常规");
|
||||
businessAssayTaskDataDO.setConfigSampleFlowId(configSampleFlowSub.getId());
|
||||
businessAssayTaskDataDO.setSampleFlowNodeKey(sampleFlowNodeSub.getNodeKey());
|
||||
businessAssayTaskDataDO.setSampleFlowNodeTime(currentDateTime);
|
||||
businessAssayTaskDataDO.setAssayDepartmentId(configAssayMethodZhy.getAssayDepartmentId());
|
||||
businessAssayTaskDataDO.setAssayDepartmentName(configAssayMethodZhy.getAssayDepartmentName());
|
||||
|
||||
|
||||
//查询S检测项目
|
||||
ConfigAssayMethodProjectDO configAssayMethodProjectDO = configAssayMethodProjectList.stream().filter(f -> f.getConfigAssayMethodId().equals(configAssayMethodIdZhy) && f.getDictionaryProjectId().equals(sDictionaryProjectId)).findFirst().orElse(null);
|
||||
|
||||
|
||||
|
||||
//检测项目
|
||||
BusinessAssayProjectDataDO businessAssayProjectDataDO = new BusinessAssayProjectDataDO();
|
||||
businessAssayProjectDataDO.setId(IdWorker.getId());
|
||||
businessAssayProjectDataDO.setBusinessAssayTaskDataId(businessAssayTaskDataDO.getId());
|
||||
businessAssayProjectDataDO.setConfigAssayMethodProjectId(configAssayMethodProjectDO.getId());
|
||||
businessAssayProjectDataDO.setDictionaryProjectId(configAssayMethodProjectDO.getDictionaryProjectId());
|
||||
businessAssayProjectDataDO.setDataType(configAssayMethodProjectDO.getDataType());
|
||||
businessAssayProjectDataDO.setDecimalPosition(configAssayMethodProjectDO.getDecimalPosition());
|
||||
businessAssayProjectDataDO.setUsage(QmsCommonConstant.ASSAY_PROJECT_USAGE_INGREDIENT);
|
||||
businessAssayProjectDataDO.setMinimumLimitValue(configAssayMethodProjectDO.getMinimumLimitValue());
|
||||
businessAssayProjectDataDO.setIsEnabled(1);
|
||||
businessAssayProjectDataDO.setIsNotAssessment(0);
|
||||
|
||||
businessAssayProjectDataDOList.add(businessAssayProjectDataDO);
|
||||
|
||||
List<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());
|
||||
|
||||
|
||||
businessAssayParameterDataDOList.add(businessAssayParameterDataDO);
|
||||
}
|
||||
|
||||
businessAssayTaskDataDO.setAssayProject("S");
|
||||
businessAssayTaskDataDOList.add(businessAssayTaskDataDO);
|
||||
}
|
||||
}
|
||||
**/
|
||||
sort++;
|
||||
}
|
||||
|
||||
sampleEntrustRegistration.setRegistrationStatus(QmsCommonConstant.SUBMITTED);
|
||||
sampleEntrustRegistration.setAssayStatus(QmsCommonConstant.UNCHECKED);
|
||||
sampleEntrustRegistration.setDataStatus(QmsCommonConstant.UNRETURNED);
|
||||
sampleEntrustRegistration.setTaskQuantity(businessAssayTaskDataDOList.size());
|
||||
|
||||
sampleEntrustContext.setSampleFlowInfoList(sampleFlowInfoList);
|
||||
|
||||
@@ -851,4 +638,134 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent {
|
||||
}
|
||||
}
|
||||
|
||||
private void addAssayTask(LocalDateTime currentDateTime, List<ConfigSubSampleMethodDO> configSubSampleMethodList,
|
||||
List<ConfigAssayMethodProjectExtendRespVO> configAssayMethodProjectList,
|
||||
List<ConfigAssayMethodProjectParameterDO> configAssayMethodProjectParameterList,
|
||||
List<DictionaryProjectDO> dictionaryProjectList,
|
||||
List<BusinessSubParentSampleAssessmentDO> businessSubParentSampleAssessmentDOList,
|
||||
List<BusinessSubSampleAnalysisGroupDO> businessSubSampleAnalysisGroupDOList,
|
||||
List<BusinessSubSampleAssessmentDO> businessSubSampleAssessmentDOList,
|
||||
List<BusinessAssayTaskDataDO> businessAssayTaskDataDOList,
|
||||
List<BusinessAssayProjectDataDO> businessAssayProjectDataDOList,
|
||||
List<BusinessAssayParameterDataDO> businessAssayParameterDataDOList, ConfigSubSampleDO configSubSample,
|
||||
ConfigSampleFlowDO configSampleFlowSub, SampleFlowNode sampleFlowNodeSub,
|
||||
BusinessSubSampleDO businessSubSampleDO, Long methodId, List<Long> projectIdList) {
|
||||
BusinessSubSampleAnalysisGroupDO businessSubSampleAnalysisGroupDO;
|
||||
ConfigAssayMethodDO addAssayTaskConfigAssayMethod = configAssayMethodMapper.selectById(methodId);
|
||||
Long addAssayTaskAssayDepartmentId = addAssayTaskConfigAssayMethod.getAssayDepartmentId();
|
||||
|
||||
//查询子样对应的分析方法
|
||||
ConfigSubSampleMethodDO addAssayTaskConfigSubSampleMethodDO = configSubSampleMethodList.stream().filter(f -> f.getIsDefaultUse().equals(QmsCommonConstant.YES) && f.getConfigAssayMethodId().equals(methodId) && f.getConfigSubSampleId().equals(configSubSample.getId())).findFirst().orElse(null);
|
||||
|
||||
businessSubSampleAnalysisGroupDO = businessSubSampleAnalysisGroupDOList.stream().filter(f -> f.getBusinessSubSampleId().equals(businessSubSampleDO.getId()) && f.getAssayDepartmentId().equals(addAssayTaskAssayDepartmentId)).findFirst().orElse(null);
|
||||
if (businessSubSampleAnalysisGroupDO == null) {
|
||||
businessSubSampleAnalysisGroupDO = new BusinessSubSampleAnalysisGroupDO();
|
||||
businessSubSampleAnalysisGroupDO.setId(IdWorker.getId());
|
||||
businessSubSampleAnalysisGroupDO.setBusinessBaseSampleId(businessSubSampleDO.getBusinessBaseSampleId());
|
||||
businessSubSampleAnalysisGroupDO.setBusinessSubParentSampleId(businessSubSampleDO.getBusinessSubParentSampleId());
|
||||
businessSubSampleAnalysisGroupDO.setBusinessSubSampleId(businessSubSampleDO.getId());
|
||||
businessSubSampleAnalysisGroupDO.setAssayDepartmentId(addAssayTaskConfigAssayMethod.getAssayDepartmentId());
|
||||
businessSubSampleAnalysisGroupDO.setAssayDepartmentName(addAssayTaskConfigAssayMethod.getAssayDepartmentName());
|
||||
businessSubSampleAnalysisGroupDO.setSampleStatus("待收样");
|
||||
|
||||
businessSubSampleAnalysisGroupDOList.add(businessSubSampleAnalysisGroupDO);
|
||||
}
|
||||
|
||||
//根据任务数判断是平行还是
|
||||
String assayType = addAssayTaskConfigSubSampleMethodDO.getTaskCount() > 1 ? QmsCommonConstant.ASSAY_TYPE_SINGLE_PARALLEL : QmsCommonConstant.ASSAY_TYPE_SINGLE_CUP;
|
||||
|
||||
//分样判定数据
|
||||
BusinessSubParentSampleAssessmentDO businessSubParentSampleAssessmentDO = new BusinessSubParentSampleAssessmentDO();
|
||||
businessSubParentSampleAssessmentDO.setId(IdWorker.getId());
|
||||
businessSubParentSampleAssessmentDO.setBusinessSubParentSampleId(businessSubSampleDO.getBusinessSubParentSampleId());
|
||||
businessSubParentSampleAssessmentDO.setConfigAssayMethodId(addAssayTaskConfigAssayMethod.getId());
|
||||
businessSubParentSampleAssessmentDO.setAssayType(assayType);
|
||||
businessSubParentSampleAssessmentDO.setTaskType("常规");
|
||||
businessSubParentSampleAssessmentDOList.add(businessSubParentSampleAssessmentDO);
|
||||
|
||||
//子样判定数据
|
||||
BusinessSubSampleAssessmentDO businessSubSampleAssessmentDO = new BusinessSubSampleAssessmentDO();
|
||||
businessSubSampleAssessmentDO.setId(IdWorker.getId());
|
||||
businessSubSampleAssessmentDO.setBusinessBaseSampleId(businessSubSampleDO.getBusinessBaseSampleId());
|
||||
businessSubSampleAssessmentDO.setBusinessSubParentSampleId(businessSubSampleDO.getBusinessSubParentSampleId());
|
||||
businessSubSampleAssessmentDO.setBusinessSubParentSampleAssessmentId(businessSubParentSampleAssessmentDO.getId());
|
||||
businessSubSampleAssessmentDO.setBusinessSubSampleId(businessSubSampleDO.getId());
|
||||
businessSubSampleAssessmentDO.setConfigAssayMethodId(addAssayTaskConfigAssayMethod.getId());
|
||||
businessSubSampleAssessmentDO.setAssayType(assayType);
|
||||
businessSubSampleAssessmentDO.setTaskType("常规");
|
||||
|
||||
businessSubSampleAssessmentDOList.add(businessSubSampleAssessmentDO);
|
||||
|
||||
//根据检测方法循环
|
||||
BusinessAssayTaskDataDO businessAssayTaskDataDO = null;
|
||||
//根据任务数循环
|
||||
for (int i = 0; i < addAssayTaskConfigSubSampleMethodDO.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(addAssayTaskConfigAssayMethod.getId());
|
||||
businessAssayTaskDataDO.setAssayType(assayType);
|
||||
businessAssayTaskDataDO.setTaskType("常规");
|
||||
businessAssayTaskDataDO.setConfigSampleFlowId(configSampleFlowSub.getId());
|
||||
businessAssayTaskDataDO.setSampleFlowNodeKey(sampleFlowNodeSub.getNodeKey());
|
||||
businessAssayTaskDataDO.setSampleFlowNodeTime(currentDateTime);
|
||||
businessAssayTaskDataDO.setAssayDepartmentId(addAssayTaskConfigAssayMethod.getAssayDepartmentId());
|
||||
businessAssayTaskDataDO.setAssayDepartmentName(addAssayTaskConfigAssayMethod.getAssayDepartmentName());
|
||||
|
||||
List<ConfigAssayMethodProjectExtendRespVO> configAssayMethodProjectDOList = configAssayMethodProjectList.stream().filter(f -> f.getConfigAssayMethodId().equals(methodId)).collect(Collectors.toList());
|
||||
|
||||
StringBuilder assayProjectBuilder = new StringBuilder();
|
||||
|
||||
for (ConfigAssayMethodProjectExtendRespVO configAssayMethodProjectDO : configAssayMethodProjectDOList) {
|
||||
|
||||
//如果当前分析方法的项目不在当前检测项目中,则跳出循环继续
|
||||
if (!projectIdList.contains(configAssayMethodProjectDO.getDictionaryProjectId())) {
|
||||
continue;
|
||||
}
|
||||
|
||||
DictionaryProjectDO dictionaryProject = dictionaryProjectList.stream().filter(f -> f.getId().equals(configAssayMethodProjectDO.getDictionaryProjectId())).findFirst().orElse(null);
|
||||
assayProjectBuilder.append(dictionaryProject.getShowName()).append(",");
|
||||
|
||||
|
||||
//检测项目
|
||||
BusinessAssayProjectDataDO businessAssayProjectDataDO = new BusinessAssayProjectDataDO();
|
||||
businessAssayProjectDataDO.setId(IdWorker.getId());
|
||||
businessAssayProjectDataDO.setBusinessAssayTaskDataId(businessAssayTaskDataDO.getId());
|
||||
businessAssayProjectDataDO.setConfigAssayMethodProjectId(configAssayMethodProjectDO.getId());
|
||||
businessAssayProjectDataDO.setDictionaryProjectId(configAssayMethodProjectDO.getDictionaryProjectId());
|
||||
businessAssayProjectDataDO.setDataType(configAssayMethodProjectDO.getDataType());
|
||||
businessAssayProjectDataDO.setDecimalPosition(configAssayMethodProjectDO.getDecimalPosition());
|
||||
businessAssayProjectDataDO.setUsage(QmsCommonConstant.ASSAY_PROJECT_USAGE_INGREDIENT);
|
||||
businessAssayProjectDataDO.setMinimumLimitValue(configAssayMethodProjectDO.getMinimumLimitValue());
|
||||
businessAssayProjectDataDO.setIsEnabled(1);
|
||||
businessAssayProjectDataDO.setIsNotAssessment(0);
|
||||
|
||||
businessAssayProjectDataDOList.add(businessAssayProjectDataDO);
|
||||
|
||||
List<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());
|
||||
|
||||
|
||||
businessAssayParameterDataDOList.add(businessAssayParameterDataDO);
|
||||
}
|
||||
}
|
||||
if (assayProjectBuilder.length() > 1) {
|
||||
assayProjectBuilder.delete(assayProjectBuilder.length() - 1 , assayProjectBuilder.length());
|
||||
}
|
||||
businessAssayTaskDataDO.setAssayProject(assayProjectBuilder.toString());
|
||||
businessAssayTaskDataDOList.add(businessAssayTaskDataDO);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ public class SampleSubProcessUpdateCmp extends NodeComponent {
|
||||
DefaultContext<String, Object> context = new DefaultContext<>();
|
||||
ConfigSubSampleDO configSubSample = sampleFlowContext.getConfigSubSampleById(businessSubSample.getConfigSubSampleId());
|
||||
Boolean hasSubSimpleCodeRule = configSubSample != null && StringUtils.isNotBlank(configSubSample.getSimpleCodeRule());
|
||||
Boolean hasSubSampleEncrypt = businessHandoverRecordSubDOList.stream().anyMatch(m -> QmsCommonConstant.FlOW_NODE_SAMPLE_ENCRYPT.equals(m.getSampleFlowNodeKey()));
|
||||
Boolean hasSubSampleEncrypt = businessHandoverRecordSubDOList.stream().filter(f -> f.getBusinessSubSampleId().equals(businessSubSample.getId())).anyMatch(m -> QmsCommonConstant.FlOW_NODE_SAMPLE_ENCRYPT.equals(m.getSampleFlowNodeKey()));
|
||||
|
||||
if (CollUtil.isNotEmpty(businessSubSampleAnalysisGroupDOList)) {
|
||||
List<BusinessSubSampleAnalysisGroupDO> curSubSampleAnalysisGroupDOList = businessSubSampleAnalysisGroupDOList.stream().filter(f -> f.getBusinessSubSampleId().equals(businessSubSample.getId())).collect(Collectors.toList());
|
||||
|
||||
@@ -242,6 +242,9 @@ public class BusinessSubSampleServiceImpl implements BusinessSubSampleService {
|
||||
BusinessSubSampleExtendRespVO subSample = null;
|
||||
if (QmsCommonConstant.FLOW_NODE_TEAM_RECEIVE.equals(reqVO.getSampleFlowNodeKey())) {
|
||||
subSample = businessSubSampleMapper.getBySampleCode(reqVO);
|
||||
if (subSample == null) {
|
||||
return subSample;
|
||||
}
|
||||
List<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) {
|
||||
|
||||
@@ -327,6 +327,7 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic
|
||||
map.put("sampleCode", businessAssayTaskDetailDO.getSampleCode());
|
||||
map.put("sampleName", businessAssayTaskDetailDO.getSampleName());
|
||||
map.put("analysisType", "analysis");
|
||||
map.put("assayTime", businessAssayTaskJson.get("assayTime"));
|
||||
|
||||
BusinessAssayProjectDataReqVO projectDataSearch2 = new BusinessAssayProjectDataReqVO();
|
||||
projectDataSearch2.setBusinessAssayTaskDataId(businessAssayTaskDataDO.getId());
|
||||
@@ -362,6 +363,7 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic
|
||||
map.put("sampleCode", businessQCManagementData.getSampleCode());
|
||||
map.put("sampleName", businessQCManagementData.getSampleName());
|
||||
map.put("analysisType", businessQCManagementData.getDictionaryBusinessKey());
|
||||
map.put("assayTime", businessAssayTaskJson.get("assayTime"));
|
||||
|
||||
BusinessQCManagementProjectDataReqVO projectDataSearch2 = new BusinessQCManagementProjectDataReqVO();
|
||||
projectDataSearch2.setBusinessQCManagementDataId(businessQCManagementData.getId());
|
||||
@@ -395,6 +397,7 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic
|
||||
map.put("sampleCode", businessQCCoefficientData.getSampleCode());
|
||||
map.put("sampleName", businessQCCoefficientData.getSampleName());
|
||||
map.put("analysisType", businessQCCoefficientData.getDictionaryBusinessKey());
|
||||
map.put("assayTime", businessAssayTaskJson.get("assayTime"));
|
||||
|
||||
BusinessQCCoefficientParameterDataReqVO parameterDataSearch2 = new BusinessQCCoefficientParameterDataReqVO();
|
||||
parameterDataSearch2.setBusinessQCCoefficientDataId(businessQCCoefficientData.getId());
|
||||
|
||||
@@ -18,6 +18,7 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.zt.plat.framework.common.exception.ServiceException;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
@@ -71,10 +72,12 @@ import com.zt.plat.module.qms.business.config.controller.vo.ConfigQCSampleMethod
|
||||
import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSampleMethodConfInfo;
|
||||
import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSampleMethodConfItem;
|
||||
import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSampleMethodConfPoint;
|
||||
import com.zt.plat.module.qms.business.config.dal.dataobject.BaseSampleDO;
|
||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodDO;
|
||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectCoefficientDO;
|
||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectRangeDO;
|
||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSubSampleMethodDO;
|
||||
import com.zt.plat.module.qms.business.config.dal.mapper.BaseSampleMapper;
|
||||
import com.zt.plat.module.qms.business.config.dal.mapper.ConfigAssayMethodMapper;
|
||||
import com.zt.plat.module.qms.business.config.dal.mapper.ConfigAssayMethodProjectCoefficientMapper;
|
||||
import com.zt.plat.module.qms.business.config.dal.mapper.ConfigAssayMethodProjectRangeMapper;
|
||||
@@ -142,6 +145,9 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService {
|
||||
@Resource
|
||||
private BusinessSampleEntrustDetailMapper businessSampleEntrustDetailMapper;
|
||||
|
||||
@Resource
|
||||
private BaseSampleMapper baseSampleMapper;
|
||||
|
||||
@Resource
|
||||
private BusinessSubParentSampleMapper businessSubParentSampleMapper;
|
||||
|
||||
@@ -152,6 +158,7 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService {
|
||||
private DataCollectionService dataCollectionService;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public BusinessAssayTaskAnalysisSampleProjectRespVO batchSampleAnalysisByTaskId(Long businessAssayTaskId) {
|
||||
BusinessAssayTaskAnalysisSampleProjectRespVO businessAssayTaskAnalysisSampleProjectRespVO = new BusinessAssayTaskAnalysisSampleProjectRespVO();
|
||||
BusinessAssayTaskDO businessAssayTaskDO = businessAssayTaskMapper.selectById(businessAssayTaskId);
|
||||
@@ -177,17 +184,27 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService {
|
||||
List<BatchSampleAnalysisColumnRespVO> cloumns = new ArrayList<>();
|
||||
cloumns.add(new BatchSampleAnalysisColumnRespVO("sampleCode", "sampleCode", "样品编号", "200px", "200px", "string", null, null, null, null, false, null, null, null, null, null, null));
|
||||
cloumns.add(new BatchSampleAnalysisColumnRespVO("sampleName", "sampleName", "样品名称", "200px", "200px", "string", null, null, null, null, false, null, null, null, null, null, null));
|
||||
//cloumns.add(new BatchSampleAnalysisColumnRespVO("cupNumber", "cupNumber", "杯号", "200px", "200px", "string", null, null, null, null, true, null));
|
||||
|
||||
|
||||
List<BusinessAssayTaskDetailDO> businessAssayTaskDetailList = businessAssayTaskDetailMapper.selectList(new LambdaQueryWrapperX<BusinessAssayTaskDetailDO>().eq(BusinessAssayTaskDetailDO::getBusinessAssayTaskId, businessAssayTaskId));
|
||||
|
||||
List<BusinessAssayTaskDataDO> businessAssayTaskDataList = businessAssayTaskDataMapper.selectList(new LambdaQueryWrapperX<BusinessAssayTaskDataDO>().eq(BusinessAssayTaskDataDO::getBusinessAssayTaskId, businessAssayTaskId).eq(BusinessAssayTaskDataDO::getConfigAssayMethodId, businessAssayTaskDO.getConfigAssayMethodId()));
|
||||
List<Long> businessAssayTaskDataIdList = businessAssayTaskDataList.stream().map(m -> m.getId()).collect(Collectors.toList());
|
||||
//BusinessAssayTaskDataDO businessAssayTaskData = businessAssayTaskDataList.get(0);
|
||||
|
||||
|
||||
//子样Id列表
|
||||
List<Long> businessSubSampleIdList = businessAssayTaskDataList.stream().map(m -> m.getBusinessSubSampleId()).distinct().collect(Collectors.toList());
|
||||
|
||||
//子样列表
|
||||
List<BusinessSubSampleDO> businessSubSampleDOList = businessSubSampleMapper.selectByIds(businessSubSampleIdList);
|
||||
//子样配置id列表
|
||||
List<Long> configSubSampleIdList = businessSubSampleDOList.stream().map(m -> m.getConfigSubSampleId()).distinct().collect(Collectors.toList());
|
||||
|
||||
//子样方法配置列表
|
||||
List<ConfigSubSampleMethodDO> configSubSampleMethodDOList = configSubSampleMethodMapper.selectByConfigSubSampleIdsAndConfigAssayMethodId(configSubSampleIdList, businessAssayTaskDO.getConfigAssayMethodId());
|
||||
|
||||
|
||||
BusinessAssayProjectDataReqVO projectDataSearch = new BusinessAssayProjectDataReqVO();
|
||||
// projectDataSearch.setBusinessAssayTaskDataId(businessAssayTaskData.getId());
|
||||
projectDataSearch.setBusinessAssayTaskDataIdList(businessAssayTaskDataIdList);
|
||||
List<BusinessAssayProjectAndParameterRespVO> projectAndParameterList = businessAssayProjectDataMapper.selectProjectAndParameterBy(projectDataSearch);
|
||||
|
||||
@@ -215,24 +232,6 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService {
|
||||
}
|
||||
|
||||
}
|
||||
// for (BusinessAssayProjectAndParameterRespVO ep : projectAndParameterList) {
|
||||
// String fieldIndex = "e" + ep.getDicId();
|
||||
// String title = ep.getShowName() + (StringUtils.isBlank(ep.getUnit()) ? "" : "(" + ep.getUnit() + ")");
|
||||
// boolean isEdit = StringUtils.isBlank(ep.getFormula());
|
||||
// cloumns.add(new BatchSampleAnalysisColumnRespVO(fieldIndex, fieldIndex + ".value", title, "", "120px", ep.getDataType(), ep.getDecimalPosition(), null, ep.getFormula(), ep.getParamNo(), isEdit, ep.getUnit(), "project", ep.getFillingWay(), ep.getGroupDictionaryBusinessId(), ep.getGroupDictionaryBusinessKey(), ep.getGroupDictionaryBusinessName()));
|
||||
//
|
||||
// if (StringUtils.isNotEmpty(ep.getFormula())) {
|
||||
// BusinessAssayParameterDataReqVO parameterDataSearch = new BusinessAssayParameterDataReqVO();
|
||||
// parameterDataSearch.setBusinessAssayProjectDataId(ep.getId());
|
||||
// List<BusinessAssayProjectAndParameterRespVO> plist = businessAssayParameterDataMapper.selectProjectAndParameterBy(parameterDataSearch);
|
||||
// for (BusinessAssayProjectAndParameterRespVO p : plist) {
|
||||
// fieldIndex = "p" + p.getDicId();
|
||||
// title = p.getShowName() + (StringUtils.isBlank(p.getUnit()) ? "" : "(" + p.getUnit() + ")");
|
||||
// isEdit = StringUtils.isBlank(p.getFormula());
|
||||
// cloumns.add(new BatchSampleAnalysisColumnRespVO(fieldIndex, fieldIndex + ".value", title, "", "120px", p.getDataType(), p.getDecimalPosition(), null, p.getFormula(), p.getParamNo(), isEdit, p.getUnit(), "parameter", p.getFillingWay(), p.getGroupDictionaryBusinessId(), p.getGroupDictionaryBusinessKey(), p.getGroupDictionaryBusinessName()));
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
businessAssayTaskAnalysisSampleProjectRespVO.setColumns(cloumns);
|
||||
|
||||
|
||||
@@ -241,6 +240,91 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService {
|
||||
for (BusinessAssayTaskDataDO businessAssayTaskDataDO : businessAssayTaskDataList) {
|
||||
BusinessAssayTaskDetailDO businessAssayTaskDetailDO = businessAssayTaskDetailList.stream().filter(f -> f.getBusinessAssayTaskDataId().equals(businessAssayTaskDataDO.getId())).findFirst().orElse(null);
|
||||
|
||||
|
||||
BusinessSubSampleDO businessSubSampleDO = businessSubSampleDOList.stream().filter(f -> f.getId().equals(businessAssayTaskDataDO.getBusinessSubSampleId())).findFirst().orElse(null);
|
||||
ConfigSubSampleMethodDO configSubSampleMethodDO = configSubSampleMethodDOList.stream().filter(f -> f.getConfigAssayMethodId().equals(businessAssayTaskDataDO.getConfigAssayMethodId()) && f.getConfigSubSampleId().equals(businessSubSampleDO.getConfigSubSampleId())).findFirst().orElse(null);
|
||||
String configInfomation = configSubSampleMethodDO.getConfigInfomation();
|
||||
if (StringUtils.isNotBlank(configInfomation)) {
|
||||
ConfigSubSampleMethodConfInfo configSubSampleMethodConfInfo = JSON.parseObject(configInfomation, ConfigSubSampleMethodConfInfo.class);
|
||||
List<ConfigSubSampleMethodConfItem> getParamList = configSubSampleMethodConfInfo.getGetParam();
|
||||
for (ConfigSubSampleMethodConfItem configSubSampleMethodConfItem: getParamList) {
|
||||
//Boolean required = configSubSampleMethodConfItem.getRequired();//是否必须
|
||||
ConfigSubSampleMethodConfPoint source = configSubSampleMethodConfItem.getSource();//来源
|
||||
Long configMethodId = source.getMethodId();
|
||||
String sourceProject = source.getProject();
|
||||
//String sourceParameter = source.getParameter();
|
||||
|
||||
|
||||
ConfigSubSampleMethodConfPoint target = configSubSampleMethodConfItem.getTarget();//目标
|
||||
String targetProject = target.getProject();
|
||||
String targetParameter = target.getParameter();
|
||||
|
||||
BusinessAssayParameterDataDO businessAssayParameterDataDO = businessAssayParameterDataMapper.selectByBusinessAssayTaskDataIdAndProjectSimpleNameAndParameterKey(businessAssayTaskDataDO.getId(), targetProject, targetParameter);
|
||||
if (StringUtils.isBlank(businessAssayParameterDataDO.getValue())) {
|
||||
//1 查询委托明细
|
||||
BusinessSampleEntrustDetailDO businessSampleEntrustDetailDO = businessSampleEntrustDetailMapper.selectByBusinessBaseSampleId(businessAssayTaskDataDO.getBusinessBaseSampleId());
|
||||
//2 查询样品大类
|
||||
BaseSampleDO baseSampleDO = baseSampleMapper.selectById(businessSampleEntrustDetailDO.getBaseSampleId());
|
||||
//3 判断样品大类类型
|
||||
if (QmsCommonConstant.ENTRUST_INSPECTION_ANALYSIS_SAMPLE.equals(baseSampleDO.getDictionaryBusinessKey())) {//如果是商检分析样
|
||||
//查询当前批次的第一个商检分析样
|
||||
BusinessSampleEntrustDetailDO currBatchFirstBusinessSampleEntrustDetailDO = businessSampleEntrustDetailMapper.selectCurrBatchFirstByBusinessBaseSampleIdAndBaseSampleDictionaryBusinessKey(businessAssayTaskDataDO.getBusinessBaseSampleId(), QmsCommonConstant.ENTRUST_INSPECTION_ANALYSIS_SAMPLE);
|
||||
List<BusinessSubParentSampleDO> currBusinessSubParentSampleDOList = businessSubParentSampleMapper.selectByBusinessBaseSampleId(currBatchFirstBusinessSampleEntrustDetailDO.getBusinessBaseSampleId());
|
||||
List<Long> currBusinessSubParentSampleIdList = currBusinessSubParentSampleDOList.stream().map(m -> m.getId()).collect(Collectors.toList());
|
||||
List<BusinessSubParentSampleAssessmentProjectExtendRespVO> businessSubParentSampleAssessmentProjectList = businessSubParentSampleAssessmentProjectMapper.selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(currBusinessSubParentSampleIdList, configMethodId);
|
||||
BusinessSubParentSampleAssessmentProjectExtendRespVO businessSubParentSampleAssessmentProject = businessSubParentSampleAssessmentProjectList.stream().filter(f -> f.getSimpleName().equals(sourceProject)).findFirst().orElse(null);
|
||||
if (businessSubParentSampleAssessmentProject != null && StringUtils.isNotBlank(businessSubParentSampleAssessmentProject.getAssessmentValue())) {
|
||||
businessAssayParameterDataDO.setValue(businessSubParentSampleAssessmentProject.getAssessmentValue());
|
||||
}
|
||||
} else if (QmsCommonConstant.ENTRUST_COMPREHENSIVE_INSPECTION_SAMPLE.equals(baseSampleDO.getDictionaryBusinessKey())) {//如果是商检综合样
|
||||
//查询当前样品的其他分析方法的结果
|
||||
List<Long> businessSubParentSampleIdList = Arrays.asList(businessAssayTaskDataDO.getBusinessSubParentSampleId());
|
||||
List<BusinessSubParentSampleAssessmentProjectExtendRespVO> businessSubParentSampleAssessmentProjectList = businessSubParentSampleAssessmentProjectMapper.selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(businessSubParentSampleIdList, configMethodId);
|
||||
BusinessSubParentSampleAssessmentProjectExtendRespVO businessSubParentSampleAssessmentProject = businessSubParentSampleAssessmentProjectList.stream().filter(f -> f.getSimpleName().equals(sourceProject)).findFirst().orElse(null);
|
||||
if (businessSubParentSampleAssessmentProject == null || StringUtils.isBlank(businessSubParentSampleAssessmentProject.getAssessmentValue())) {
|
||||
businessAssayParameterDataDO.setValue(businessSubParentSampleAssessmentProject.getAssessmentValue());
|
||||
}
|
||||
} else if (QmsCommonConstant.ENTRUST_COMMISSION_INSPECTION_SAMPLE.equals(baseSampleDO.getDictionaryBusinessKey())) {//如果是委检样
|
||||
//查询来样品位
|
||||
Boolean isForecastS = false;
|
||||
String forecastValue = null;
|
||||
String forecastResult = businessSampleEntrustDetailDO.getForecastResult();
|
||||
if (StringUtils.isNotBlank(forecastResult)) {
|
||||
JSONArray array = JSON.parseArray(forecastResult);
|
||||
for (int i = 0; i < array.size(); i++) {
|
||||
JSONObject item = array.getJSONObject(i);
|
||||
if ("S".equals(item.getString("simpleName"))) {
|
||||
isForecastS = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < array.size(); i++) {
|
||||
JSONObject item = array.getJSONObject(i);
|
||||
if (sourceProject.equals(item.getString("simpleName"))) {
|
||||
forecastValue = item.getString("value");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (isForecastS) {//来样品位存在S值, 则取预报的值
|
||||
businessAssayParameterDataDO.setValue(forecastValue);
|
||||
} else {
|
||||
//查询当前样品的其他方法的结果
|
||||
List<Long> businessSubParentSampleIdList = Arrays.asList(businessAssayTaskDataDO.getBusinessSubParentSampleId());
|
||||
List<BusinessSubParentSampleAssessmentProjectExtendRespVO> businessSubParentSampleAssessmentProjectList = businessSubParentSampleAssessmentProjectMapper.selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(businessSubParentSampleIdList, configMethodId);
|
||||
BusinessSubParentSampleAssessmentProjectExtendRespVO businessSubParentSampleAssessmentProject = businessSubParentSampleAssessmentProjectList.stream().filter(f -> f.getSimpleName().equals(sourceProject)).findFirst().orElse(null);
|
||||
if (businessSubParentSampleAssessmentProject == null || StringUtils.isBlank(businessSubParentSampleAssessmentProject.getAssessmentValue())) {
|
||||
businessAssayParameterDataDO.setValue(businessSubParentSampleAssessmentProject.getAssessmentValue());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
businessAssayParameterDataMapper.updateById(businessAssayParameterDataDO);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, Object> map = new HashedMap<>();
|
||||
map.put("businessAssayTaskDataId", businessAssayTaskDataDO.getId());
|
||||
map.put("businessAssayTaskId", businessAssayTaskDataDO.getBusinessAssayTaskId());
|
||||
@@ -405,6 +489,7 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public BusinessAssayTaskAnalysisSampleAndQcProjectRespVO batchSampleAndQcAnalysisByTaskId(Long businessAssayTaskId) {
|
||||
BusinessAssayTaskAnalysisSampleAndQcProjectRespVO businessAssayTaskAnalysisSampleAndQcProjectRespVO = new BusinessAssayTaskAnalysisSampleAndQcProjectRespVO();
|
||||
BusinessAssayTaskDO businessAssayTaskDO = businessAssayTaskMapper.selectById(businessAssayTaskId);
|
||||
@@ -437,9 +522,6 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService {
|
||||
assayTaskAnalysisDataList.add(analysis);
|
||||
|
||||
businessAssayTaskAnalysisSampleAndQcProjectRespVO.setAssayTaskAnalysisDataList(assayTaskAnalysisDataList);
|
||||
|
||||
// List<ConfigQCSampleMethodExtendRespVO> configQCSampleMethodList = configQCSampleMethodMapper.selectByConfigAssayMethodId(businessAssayTaskDO.getConfigAssayMethodId());
|
||||
// businessAssayTaskAnalysisSampleAndQcProjectRespVO.setConfigQCSampleMethodList(configQCSampleMethodList);
|
||||
|
||||
//查询区间范围
|
||||
List<ConfigAssayMethodProjectRangeDO> configAssayMethodProjectRangeDOList = configAssayMethodProjectRangeMapper.selectList(new LambdaQueryWrapperX<ConfigAssayMethodProjectRangeDO>().eq(ConfigAssayMethodProjectRangeDO::getConfigAssayMethodId, businessAssayTaskDO.getConfigAssayMethodId()));
|
||||
@@ -462,9 +544,7 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService {
|
||||
//处理列
|
||||
List<BatchSampleAnalysisColumnRespVO> cloumns = new ArrayList<>();
|
||||
cloumns.add(new BatchSampleAnalysisColumnRespVO("sampleCode", "sampleCode", "样品编号", "200px", "200px", "string", null, null, null, null, false, null, null, null, null, null, null));
|
||||
cloumns.add(new BatchSampleAnalysisColumnRespVO("sampleName", "sampleName", "样品名称", "200px", "200px", "string", null, null, null, null, false, null, null, null, null, null, null));
|
||||
//cloumns.add(new BatchSampleAnalysisColumnRespVO("cupNumber", "cupNumber", "杯号", "200px", "200px", "string", null, null, null, null, true, null));
|
||||
|
||||
cloumns.add(new BatchSampleAnalysisColumnRespVO("sampleName", "sampleName", "样品名称", "200px", "200px", "string", null, null, null, null, false, null, null, null, null, null, null));
|
||||
|
||||
List<BusinessAssayTaskDetailDO> businessAssayTaskDetailList = businessAssayTaskDetailMapper.selectList(new LambdaQueryWrapperX<BusinessAssayTaskDetailDO>().eq(BusinessAssayTaskDetailDO::getBusinessAssayTaskId, businessAssayTaskDO.getId()));
|
||||
List<BusinessAssayTaskDataDO> businessAssayTaskDataList = businessAssayTaskDataMapper.selectList(new LambdaQueryWrapperX<BusinessAssayTaskDataDO>().eq(BusinessAssayTaskDataDO::getBusinessAssayTaskId, businessAssayTaskDO.getId()).eq(BusinessAssayTaskDataDO::getConfigAssayMethodId, businessAssayTaskDO.getConfigAssayMethodId()));
|
||||
@@ -482,10 +562,8 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService {
|
||||
|
||||
|
||||
List<Long> businessAssayTaskDataIdList = businessAssayTaskDataList.stream().map(m -> m.getId()).collect(Collectors.toList());
|
||||
// BusinessAssayTaskDataDO businessAssayTaskData = businessAssayTaskDataList.get(0);
|
||||
|
||||
BusinessAssayProjectDataReqVO projectDataSearch = new BusinessAssayProjectDataReqVO();
|
||||
// projectDataSearch.setBusinessAssayTaskDataId(businessAssayTaskData.getId());
|
||||
projectDataSearch.setBusinessAssayTaskDataIdList(businessAssayTaskDataIdList);
|
||||
List<BusinessAssayProjectAndParameterRespVO> projectAndParameterList = businessAssayProjectDataMapper.selectProjectAndParameterBy(projectDataSearch);
|
||||
Map<Long, List<BusinessAssayProjectAndParameterRespVO>> projectAndParameterMap = projectAndParameterList.stream().sorted(Comparator.comparing(BusinessAssayProjectAndParameterRespVO::getParamNo)).collect(Collectors.groupingBy(BusinessAssayProjectAndParameterRespVO::getDicId,
|
||||
@@ -511,24 +589,7 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService {
|
||||
}
|
||||
}
|
||||
}
|
||||
// for (BusinessAssayProjectAndParameterRespVO ep : projectAndParameterList) {
|
||||
// String fieldIndex = "e" + ep.getDicId();
|
||||
// String title = ep.getShowName() + (StringUtils.isBlank(ep.getUnit()) ? "" : "(" + ep.getUnit() + ")");
|
||||
// boolean isEdit = StringUtils.isBlank(ep.getFormula());
|
||||
// cloumns.add(new BatchSampleAnalysisColumnRespVO(fieldIndex, fieldIndex + ".value", title, "", "120px", ep.getDataType(), ep.getDecimalPosition(), null, ep.getFormula(), ep.getParamNo(), isEdit, ep.getUnit(), "project", ep.getFillingWay(), ep.getGroupDictionaryBusinessId(), ep.getGroupDictionaryBusinessKey(), ep.getGroupDictionaryBusinessName()));
|
||||
//
|
||||
// if (StringUtils.isNotEmpty(ep.getFormula())) {
|
||||
// BusinessAssayParameterDataReqVO parameterDataSearch = new BusinessAssayParameterDataReqVO();
|
||||
// parameterDataSearch.setBusinessAssayProjectDataId(ep.getId());
|
||||
// List<BusinessAssayProjectAndParameterRespVO> plist = businessAssayParameterDataMapper.selectProjectAndParameterBy(parameterDataSearch);
|
||||
// for (BusinessAssayProjectAndParameterRespVO p : plist) {
|
||||
// fieldIndex = "p" + p.getDicId();
|
||||
// title = p.getShowName() + (StringUtils.isBlank(p.getUnit()) ? "" : "(" + p.getUnit() + ")");
|
||||
// isEdit = StringUtils.isBlank(p.getFormula());
|
||||
// cloumns.add(new BatchSampleAnalysisColumnRespVO(fieldIndex, fieldIndex + ".value", title, "", "120px", p.getDataType(), p.getDecimalPosition(), null, p.getFormula(), p.getParamNo(), isEdit, p.getUnit(), "parameter", p.getFillingWay(), p.getGroupDictionaryBusinessId(), p.getGroupDictionaryBusinessKey(), p.getGroupDictionaryBusinessName()));
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
businessAssayTaskAnalysisDataRespVO.setColumns(cloumns);
|
||||
|
||||
|
||||
@@ -557,36 +618,65 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService {
|
||||
|
||||
BusinessAssayParameterDataDO businessAssayParameterDataDO = businessAssayParameterDataMapper.selectByBusinessAssayTaskDataIdAndProjectSimpleNameAndParameterKey(businessAssayTaskDataDO.getId(), targetProject, targetParameter);
|
||||
if (StringUtils.isBlank(businessAssayParameterDataDO.getValue())) {
|
||||
//1 查询来源品位
|
||||
//1 查询委托明细
|
||||
BusinessSampleEntrustDetailDO businessSampleEntrustDetailDO = businessSampleEntrustDetailMapper.selectByBusinessBaseSampleId(businessAssayTaskDataDO.getBusinessBaseSampleId());
|
||||
String forecastResult = businessSampleEntrustDetailDO.getForecastResult();//预报品位
|
||||
if (StringUtils.isBlank(forecastResult)) {
|
||||
//2 查询当前样品其他分析方法的结果 (废弃-20251202)
|
||||
// List<Long> businessSubParentSampleIdList = Arrays.asList(businessAssayTaskDataDO.getBusinessSubParentSampleId());
|
||||
// List<BusinessSubParentSampleAssessmentProjectExtendRespVO> businessSubParentSampleAssessmentProjectList = businessSubParentSampleAssessmentProjectMapper.selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(businessSubParentSampleIdList, configMethodId);
|
||||
// BusinessSubParentSampleAssessmentProjectExtendRespVO businessSubParentSampleAssessmentProject = businessSubParentSampleAssessmentProjectList.stream().filter(f -> f.getSimpleName().equals(sourceProject)).findFirst().orElse(null);
|
||||
// if (businessSubParentSampleAssessmentProject == null || StringUtils.isBlank(businessSubParentSampleAssessmentProject.getAssessmentValue())) {
|
||||
|
||||
//3 查询当前批次委托的第一个样品对应的分析方法的结果
|
||||
BusinessSampleEntrustDetailDO currBatchFirstBusinessSampleEntrustDetailDO = businessSampleEntrustDetailMapper.selectCurrBatchFirstByBusinessBaseSampleId(businessAssayTaskDataDO.getBusinessBaseSampleId());
|
||||
List<BusinessSubParentSampleDO> currBusinessSubParentSampleDOList = businessSubParentSampleMapper.selectByBusinessBaseSampleId(currBatchFirstBusinessSampleEntrustDetailDO.getBusinessBaseSampleId());
|
||||
List<Long> currBusinessSubParentSampleIdList = currBusinessSubParentSampleDOList.stream().map(m -> m.getId()).collect(Collectors.toList());
|
||||
List<BusinessSubParentSampleAssessmentProjectExtendRespVO> businessSubParentSampleAssessmentProjectList = businessSubParentSampleAssessmentProjectMapper.selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(currBusinessSubParentSampleIdList, configMethodId);
|
||||
//2 查询样品大类
|
||||
BaseSampleDO baseSampleDO = baseSampleMapper.selectById(businessSampleEntrustDetailDO.getBaseSampleId());
|
||||
//3 判断样品大类类型
|
||||
if (QmsCommonConstant.ENTRUST_INSPECTION_ANALYSIS_SAMPLE.equals(baseSampleDO.getDictionaryBusinessKey())) {//如果是商检分析样
|
||||
//查询当前批次的第一个商检分析样
|
||||
BusinessSampleEntrustDetailDO currBatchFirstBusinessSampleEntrustDetailDO = businessSampleEntrustDetailMapper.selectCurrBatchFirstByBusinessBaseSampleIdAndBaseSampleDictionaryBusinessKey(businessAssayTaskDataDO.getBusinessBaseSampleId(), QmsCommonConstant.ENTRUST_INSPECTION_ANALYSIS_SAMPLE);
|
||||
List<BusinessSubParentSampleDO> currBusinessSubParentSampleDOList = businessSubParentSampleMapper.selectByBusinessBaseSampleId(currBatchFirstBusinessSampleEntrustDetailDO.getBusinessBaseSampleId());
|
||||
List<Long> currBusinessSubParentSampleIdList = currBusinessSubParentSampleDOList.stream().map(m -> m.getId()).collect(Collectors.toList());
|
||||
List<BusinessSubParentSampleAssessmentProjectExtendRespVO> businessSubParentSampleAssessmentProjectList = businessSubParentSampleAssessmentProjectMapper.selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(currBusinessSubParentSampleIdList, configMethodId);
|
||||
BusinessSubParentSampleAssessmentProjectExtendRespVO businessSubParentSampleAssessmentProject = businessSubParentSampleAssessmentProjectList.stream().filter(f -> f.getSimpleName().equals(sourceProject)).findFirst().orElse(null);
|
||||
if (businessSubParentSampleAssessmentProject != null && StringUtils.isNotBlank(businessSubParentSampleAssessmentProject.getAssessmentValue())) {
|
||||
businessAssayParameterDataDO.setValue(businessSubParentSampleAssessmentProject.getAssessmentValue());
|
||||
}
|
||||
} else if (QmsCommonConstant.ENTRUST_COMPREHENSIVE_INSPECTION_SAMPLE.equals(baseSampleDO.getDictionaryBusinessKey())) {//如果是商检综合样
|
||||
//查询当前样品的其他分析方法的结果
|
||||
List<Long> businessSubParentSampleIdList = Arrays.asList(businessAssayTaskDataDO.getBusinessSubParentSampleId());
|
||||
List<BusinessSubParentSampleAssessmentProjectExtendRespVO> businessSubParentSampleAssessmentProjectList = businessSubParentSampleAssessmentProjectMapper.selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(businessSubParentSampleIdList, configMethodId);
|
||||
BusinessSubParentSampleAssessmentProjectExtendRespVO businessSubParentSampleAssessmentProject = businessSubParentSampleAssessmentProjectList.stream().filter(f -> f.getSimpleName().equals(sourceProject)).findFirst().orElse(null);
|
||||
if (businessSubParentSampleAssessmentProject != null && StringUtils.isNotBlank(businessSubParentSampleAssessmentProject.getAssessmentValue())) {
|
||||
businessAssayParameterDataDO.setValue(businessSubParentSampleAssessmentProject.getAssessmentValue());
|
||||
}
|
||||
} else if (QmsCommonConstant.ENTRUST_COMMISSION_INSPECTION_SAMPLE.equals(baseSampleDO.getDictionaryBusinessKey())) {//如果是委检样
|
||||
//查询来样品位
|
||||
Boolean isForecastS = false;
|
||||
String forecastValue = null;
|
||||
String forecastResult = businessSampleEntrustDetailDO.getForecastResult();
|
||||
if (StringUtils.isNotBlank(forecastResult)) {
|
||||
JSONArray array = JSON.parseArray(forecastResult);
|
||||
for (int i = 0; i < array.size(); i++) {
|
||||
JSONObject item = array.getJSONObject(i);
|
||||
if ("S".equals(item.getString("simpleName"))) {
|
||||
isForecastS = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < array.size(); i++) {
|
||||
JSONObject item = array.getJSONObject(i);
|
||||
if (sourceProject.equals(item.getString("simpleName"))) {
|
||||
forecastValue = item.getString("value");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (isForecastS) {//来样品位存在S值, 则取预报的值
|
||||
businessAssayParameterDataDO.setValue(forecastValue);
|
||||
} else {
|
||||
//查询当前样品的其他方法的结果
|
||||
List<Long> businessSubParentSampleIdList = Arrays.asList(businessAssayTaskDataDO.getBusinessSubParentSampleId());
|
||||
List<BusinessSubParentSampleAssessmentProjectExtendRespVO> businessSubParentSampleAssessmentProjectList = businessSubParentSampleAssessmentProjectMapper.selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(businessSubParentSampleIdList, configMethodId);
|
||||
BusinessSubParentSampleAssessmentProjectExtendRespVO businessSubParentSampleAssessmentProject = businessSubParentSampleAssessmentProjectList.stream().filter(f -> f.getSimpleName().equals(sourceProject)).findFirst().orElse(null);
|
||||
if (businessSubParentSampleAssessmentProject != null && StringUtils.isNotBlank(businessSubParentSampleAssessmentProject.getAssessmentValue())) {
|
||||
businessAssayParameterDataDO.setValue(businessSubParentSampleAssessmentProject.getAssessmentValue());
|
||||
}
|
||||
// } else {
|
||||
// businessAssayParameterDataDO.setValue(businessSubParentSampleAssessmentProject.getAssessmentValue());
|
||||
// }
|
||||
|
||||
|
||||
} else {
|
||||
JSONObject forecastResultJson = JSON.parseObject(forecastResult);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
businessAssayParameterDataMapper.updateById(businessAssayParameterDataDO);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -250,6 +250,7 @@ public class SampleEntrustServiceImpl implements SampleEntrustService {
|
||||
LiteflowResponse response = flowExecutor.execute2Resp("sampleEntrustSubmitChain" + tenantId, sampleEntrustParam, SampleEntrustContext.class);
|
||||
if (!response.isSuccess()){
|
||||
log.error("提交委托登记失败", response.getCause());
|
||||
response.getCause().printStackTrace();
|
||||
throw new ServiceException(1_032_100_000, response.getCause().getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,6 +36,8 @@ import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayProjectDa
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayReportDataDO;
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDataDO;
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessBaseSampleDO;
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleEntrustDetailDO;
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleEntrustRegistrationDO;
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubParentSampleAssessmentDO;
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubParentSampleAssessmentProjectDO;
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubParentSampleDO;
|
||||
@@ -48,6 +50,8 @@ import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayProjectDataMa
|
||||
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayReportDataMapper;
|
||||
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayTaskDataMapper;
|
||||
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessBaseSampleMapper;
|
||||
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSampleEntrustDetailMapper;
|
||||
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSampleEntrustRegistrationMapper;
|
||||
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubParentSampleAssessmentMapper;
|
||||
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubParentSampleAssessmentProjectMapper;
|
||||
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubParentSampleMapper;
|
||||
@@ -422,6 +426,12 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe
|
||||
|
||||
@Resource
|
||||
private BusinessSubParentSampleAssessmentMapper businessSubParentSampleAssessmentMapper;
|
||||
|
||||
@Resource
|
||||
private BusinessSampleEntrustRegistrationMapper businessSampleEntrustRegistrationMapper;
|
||||
|
||||
@Resource
|
||||
private BusinessSampleEntrustDetailMapper businessSampleEntrustDetailMapper;
|
||||
|
||||
@Resource
|
||||
private SampleFlowService sampleFlowService;
|
||||
@@ -433,7 +443,7 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe
|
||||
//当前登录用户昵称
|
||||
String nickName = SecurityFrameworkUtils.getLoginUserNickname();
|
||||
|
||||
|
||||
List<BusinessSampleEntrustRegistrationDO> updatebBusinessSampleEntrustRegistrationDOList = new ArrayList<>();
|
||||
List<BusinessSubSampleDO> updateBusinessSubSampleDOList = new ArrayList<>();
|
||||
List<BusinessSubSampleAnalysisGroupDO> updateBusinessSubSampleAnalysisGroupDOList = new ArrayList<>();
|
||||
|
||||
@@ -444,8 +454,6 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe
|
||||
|
||||
List<BusinessSubParentSampleDO> businessSubParentSampleDOList = businessSubParentSampleMapper.selectByIds(reqVO.getBusinessSubParentSampleIds());
|
||||
|
||||
// List<BusinessSubParentSampleAssessmentDO> businessSubParentSampleAssessmentDOList = businessSubParentSampleAssessmentMapper.selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(reqVO.getBusinessSubParentSampleIds(), reqVO.getConfigAssayMethodId());
|
||||
|
||||
//循环分样主样数据
|
||||
for (BusinessSubParentSampleDO businessSubParentSampleDO : businessSubParentSampleDOList) {
|
||||
|
||||
@@ -538,33 +546,46 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe
|
||||
}
|
||||
}
|
||||
|
||||
//处理子样分析任务数据
|
||||
List<BusinessAssayTaskDataDO> businessAssayTaskDataDOList = businessAssayTaskDataMapper.selectByBusinessSubParentSampleIds(reqVO.getBusinessSubParentSampleIds());
|
||||
List<Long> businessSubSampleIdList = businessAssayTaskDataDOList.stream().map(m -> m.getBusinessSubSampleId()).distinct().collect(Collectors.toList());
|
||||
List<BusinessSubSampleDO> businessSubSampleDOList = businessSubSampleMapper.selectByIds(businessSubSampleIdList);
|
||||
List<BusinessSubSampleAnalysisGroupDO> businessSubSampleAnalysisGroupDOList = businessSubSampleAnalysisGroupMapper.selectByBusinessSubParentSampleIds(reqVO.getBusinessSubParentSampleIds());
|
||||
//根据子样id进行分组
|
||||
Map<Long, List<BusinessAssayTaskDataDO>> businessAssayTaskDataDOMap = businessAssayTaskDataDOList.stream().collect(Collectors.groupingBy(BusinessAssayTaskDataDO::getBusinessSubSampleId));
|
||||
for (Map.Entry<Long, List<BusinessAssayTaskDataDO>> businessAssayTaskDataDOEntry : businessAssayTaskDataDOMap.entrySet()) {
|
||||
Long businessSubSampleId = businessAssayTaskDataDOEntry.getKey();
|
||||
//子样下的分析任务
|
||||
List<BusinessAssayTaskDataDO> valList = businessAssayTaskDataDOEntry.getValue();
|
||||
//查询子样
|
||||
BusinessSubSampleDO businessSubSampleDO = businessSubSampleDOList.stream().filter(f -> businessSubSampleId.equals(f.getId())).findFirst().orElse(null);
|
||||
//查询子样下的分析班组
|
||||
List<BusinessSubSampleAnalysisGroupDO> subSampleAnalysisGroupList = businessSubSampleAnalysisGroupDOList.stream().filter(f -> f.getBusinessSubSampleId().equals(businessSubSampleId)).collect(Collectors.toList());
|
||||
for (BusinessSubSampleAnalysisGroupDO subSampleAnalysisGroupDO : subSampleAnalysisGroupList) {
|
||||
long count = valList.stream().filter(f -> f.getIsReported().equals(QmsCommonConstant.NO) && f.getAssayDepartmentId().equals(subSampleAnalysisGroupDO.getAssayDepartmentId())).count();
|
||||
if (count > 0) {//如果还存在未上报的数据,则继续
|
||||
continue;
|
||||
}
|
||||
subSampleAnalysisGroupDO.setSampleStatus("已完成");//当前班组分析已完成
|
||||
updateBusinessSubSampleAnalysisGroupDOList.add(subSampleAnalysisGroupDO);
|
||||
|
||||
updateBusinessSubSampleDOList.add(businessSubSampleDO);
|
||||
//分析方法信息
|
||||
ConfigAssayMethodDO configAssayMethodDO = configAssayMethodMapper.selectById(reqVO.getConfigAssayMethodId());
|
||||
//查询当前分析部门下的分样判定信息
|
||||
List<BusinessSubParentSampleAssessmentDO> businessSubParentSampleAssessmentDOList = businessSubParentSampleAssessmentMapper.selectByBusinessSubParentSampleIdsAndAssayDepartmentId(reqVO.getBusinessSubParentSampleIds(), configAssayMethodDO.getAssayDepartmentId());
|
||||
//查询当前分析部门下的子样分析班组信息
|
||||
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();
|
||||
if (count > 0) {//如果还存在未上报的数据,则继续
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
businessSubSampleAnalysisGroupDO.setSampleStatus("已完成");//当前班组分析已完成
|
||||
updateBusinessSubSampleAnalysisGroupDOList.add(businessSubSampleAnalysisGroupDO);
|
||||
//查询子样
|
||||
BusinessSubSampleDO businessSubSampleDO = businessSubSampleMapper.selectById(businessSubSampleAnalysisGroupDO.getBusinessSubSampleId());
|
||||
updateBusinessSubSampleDOList.add(businessSubSampleDO);
|
||||
}
|
||||
|
||||
//处理委托登记信息
|
||||
List<Long> businessBaseSampleIdList = businessSubParentSampleDOList.stream().map(m -> m.getBusinessBaseSampleId()).distinct().collect(Collectors.toList());
|
||||
|
||||
List<BusinessSampleEntrustDetailDO> businessSampleEntrustDetailDOList = businessSampleEntrustDetailMapper.selectByBusinessBaseSampleIds(businessBaseSampleIdList);
|
||||
List<Long> businessSampleEntrustRegistrationIdList = businessSampleEntrustDetailDOList.stream().map(m -> m.getBusinessSampleEntrustRegistrationId()).distinct().collect(Collectors.toList());
|
||||
|
||||
List<BusinessSampleEntrustRegistrationDO> businessSampleEntrustRegistrationDOList = businessSampleEntrustRegistrationMapper.selectByIds(businessSampleEntrustRegistrationIdList);
|
||||
|
||||
List<BusinessSampleEntrustDetailDO> allBusinessSampleEntrustDetailDOList = businessSampleEntrustDetailMapper.selectByBusinessSampleEntrustRegistrationIds(businessSampleEntrustRegistrationIdList);
|
||||
|
||||
for (BusinessSampleEntrustRegistrationDO businessSampleEntrustRegistrationDO : businessSampleEntrustRegistrationDOList) {
|
||||
List<Long> currentBusinessBaseSampleIdList = allBusinessSampleEntrustDetailDOList.stream().filter(f -> f.getBusinessSampleEntrustRegistrationId().equals(businessSampleEntrustRegistrationDO.getId())).map(m -> m.getBusinessBaseSampleId()).collect(Collectors.toList());
|
||||
List<BusinessSubParentSampleDO> currentBusinessSubParentSampleDOList = businessSubParentSampleMapper.selectByBusinessBaseSampleIds(currentBusinessBaseSampleIdList);
|
||||
List<Long> currentBusinessSubParentSampleIdList = currentBusinessSubParentSampleDOList.stream().map(m -> m.getId()).collect(Collectors.toList());
|
||||
List<BusinessSubParentSampleAssessmentDO> currentBusinessSubParentSampleAssessmentDOList = businessSubParentSampleAssessmentMapper.selectByBusinessSubParentSampleIds(currentBusinessSubParentSampleIdList);
|
||||
long count = currentBusinessSubParentSampleAssessmentDOList.stream().filter(f -> !reqVO.getBusinessSubParentSampleIds().contains(f.getBusinessSubParentSampleId()) && !f.getConfigAssayMethodId().equals(reqVO.getConfigAssayMethodId()) && f.getIsReported().equals(QmsCommonConstant.NO)).count();
|
||||
if (count > 0) {//如果还存在未上报的数据,则继续
|
||||
continue;
|
||||
}
|
||||
businessSampleEntrustRegistrationDO.setAssayStatus(QmsCommonConstant.CHECKED);
|
||||
updatebBusinessSampleEntrustRegistrationDOList.add(businessSampleEntrustRegistrationDO);
|
||||
}
|
||||
|
||||
if (saveBusinessAssayReportDataDOList.size() > 0) {
|
||||
@@ -594,6 +615,9 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe
|
||||
.in(BusinessSubParentSampleAssessmentDO::getBusinessSubParentSampleId, reqVO.getBusinessSubParentSampleIds())
|
||||
.eq(BusinessSubParentSampleAssessmentDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId()));
|
||||
|
||||
if (updatebBusinessSampleEntrustRegistrationDOList.size() > 0) {
|
||||
businessSampleEntrustRegistrationMapper.updateBatch(updatebBusinessSampleEntrustRegistrationDOList);
|
||||
}
|
||||
|
||||
if (updateBusinessSubSampleDOList.size() > 0) {
|
||||
|
||||
|
||||
@@ -18,6 +18,13 @@ public interface SampleTaskAssignService {
|
||||
*/
|
||||
List<AdminUserRespDTO> getAssignUserList();
|
||||
|
||||
/**
|
||||
* 根据用户id获取用户信息
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
AdminUserRespDTO getUserInfoById(Long userId);
|
||||
|
||||
/**
|
||||
* 获取未指派任务子样信息
|
||||
* @return
|
||||
|
||||
@@ -176,6 +176,12 @@ public class SampleTaskAssignServiceImpl implements SampleTaskAssignService {
|
||||
return userListResult.getCheckedData();
|
||||
}
|
||||
|
||||
@Override
|
||||
public AdminUserRespDTO getUserInfoById(Long userId) {
|
||||
CommonResult<AdminUserRespDTO> useResult = adminUserApi.getUser(userId);
|
||||
return useResult.getCheckedData();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<UnAssignTaskedSubSampleRespVO> getAssaySampleList(BusinessAssayTaskDataReqVO reqVO) {
|
||||
List<UnAssignTaskedSubSampleRespVO> list = businessAssayTaskDataMapper.selectUnAssignTaskedSubSample(reqVO);
|
||||
|
||||
@@ -99,6 +99,13 @@ public class BaseSampleController implements BusinessControllerMarker {
|
||||
PageResult<BaseSampleDO> pageResult = baseSampleService.getBaseSamplePage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, BaseSampleRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
@Operation(summary = "获得样品大类管理列表")
|
||||
public CommonResult<?> getBaseSampleList(BaseSamplePageReqVO reqVO) {
|
||||
List<BaseSampleRespVO> list = baseSampleService.getBaseSampleList(reqVO);
|
||||
return success(list);
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出样品大类管理 Excel")
|
||||
|
||||
@@ -0,0 +1,106 @@
|
||||
package com.zt.plat.module.qms.business.config.controller.admin;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import com.zt.plat.framework.business.interceptor.BusinessControllerMarker;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.constraints.*;
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO;
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import com.zt.plat.framework.excel.core.util.ExcelUtils;
|
||||
import com.zt.plat.module.qms.business.config.controller.vo.*;
|
||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigEntrustSourceSampleTypeDO;
|
||||
import com.zt.plat.module.qms.business.config.service.ConfigEntrustSourceSampleTypeService;
|
||||
import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
@Tag(name = "管理后台 - 检验委托来源与样品类型配置")
|
||||
@RestController
|
||||
@RequestMapping("/qms/config-entrust-source-sample-type")
|
||||
@Validated
|
||||
public class ConfigEntrustSourceSampleTypeController implements BusinessControllerMarker {
|
||||
|
||||
|
||||
@Resource
|
||||
private ConfigEntrustSourceSampleTypeService configEntrustSourceSampleTypeService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建检验委托来源与样品类型配置")
|
||||
@PreAuthorize("@ss.hasPermission('qms:config-entrust-source-sample-type:create')")
|
||||
public CommonResult<ConfigEntrustSourceSampleTypeRespVO> createConfigEntrustSourceSampleType(@Valid @RequestBody ConfigEntrustSourceSampleTypeSaveReqVO createReqVO) {
|
||||
return success(configEntrustSourceSampleTypeService.createConfigEntrustSourceSampleType(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新检验委托来源与样品类型配置")
|
||||
@PreAuthorize("@ss.hasPermission('qms:config-entrust-source-sample-type:update')")
|
||||
public CommonResult<Boolean> updateConfigEntrustSourceSampleType(@Valid @RequestBody ConfigEntrustSourceSampleTypeSaveReqVO updateReqVO) {
|
||||
configEntrustSourceSampleTypeService.updateConfigEntrustSourceSampleType(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除检验委托来源与样品类型配置")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('qms:config-entrust-source-sample-type:delete')")
|
||||
public CommonResult<Boolean> deleteConfigEntrustSourceSampleType(@RequestParam("id") Long id) {
|
||||
configEntrustSourceSampleTypeService.deleteConfigEntrustSourceSampleType(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除检验委托来源与样品类型配置")
|
||||
@PreAuthorize("@ss.hasPermission('qms:config-entrust-source-sample-type:delete')")
|
||||
public CommonResult<Boolean> deleteConfigEntrustSourceSampleTypeList(@RequestBody BatchDeleteReqVO req) {
|
||||
configEntrustSourceSampleTypeService.deleteConfigEntrustSourceSampleTypeListByIds(req.getIds());
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得检验委托来源与样品类型配置")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('qms:config-entrust-source-sample-type:query')")
|
||||
public CommonResult<ConfigEntrustSourceSampleTypeRespVO> getConfigEntrustSourceSampleType(@RequestParam("id") Long id) {
|
||||
ConfigEntrustSourceSampleTypeDO configEntrustSourceSampleType = configEntrustSourceSampleTypeService.getConfigEntrustSourceSampleType(id);
|
||||
return success(BeanUtils.toBean(configEntrustSourceSampleType, ConfigEntrustSourceSampleTypeRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得检验委托来源与样品类型配置分页")
|
||||
@PreAuthorize("@ss.hasPermission('qms:config-entrust-source-sample-type:query')")
|
||||
public CommonResult<PageResult<ConfigEntrustSourceSampleTypeRespVO>> getConfigEntrustSourceSampleTypePage(@Valid ConfigEntrustSourceSampleTypePageReqVO pageReqVO) {
|
||||
PageResult<ConfigEntrustSourceSampleTypeDO> pageResult = configEntrustSourceSampleTypeService.getConfigEntrustSourceSampleTypePage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, ConfigEntrustSourceSampleTypeRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出检验委托来源与样品类型配置 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('qms:config-entrust-source-sample-type:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportConfigEntrustSourceSampleTypeExcel(@Valid ConfigEntrustSourceSampleTypePageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<ConfigEntrustSourceSampleTypeDO> list = configEntrustSourceSampleTypeService.getConfigEntrustSourceSampleTypePage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "检验委托来源与样品类型配置.xls", "数据", ConfigEntrustSourceSampleTypeRespVO.class,
|
||||
BeanUtils.toBean(list, ConfigEntrustSourceSampleTypeRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3,109 +3,41 @@ package com.zt.plat.module.qms.business.config.controller.admin;
|
||||
import com.zt.plat.module.qms.business.config.controller.vo.ConfigReportTemplatePageReqVO;
|
||||
import com.zt.plat.module.qms.business.config.controller.vo.ConfigReportTemplateRespVO;
|
||||
import com.zt.plat.module.qms.business.config.controller.vo.ConfigReportTemplateSaveReqVO;
|
||||
import com.zt.plat.module.qms.business.config.controller.vo.GenReportBody;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.util.UriUtils;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.mybatisplus.core.toolkit.StringPool;
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.text.StringEscapeUtils;
|
||||
import org.springframework.core.io.ByteArrayResource;
|
||||
import org.springframework.core.io.FileSystemResource;
|
||||
import org.springframework.core.io.support.ResourceRegion;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import com.zt.plat.framework.business.interceptor.BusinessControllerMarker;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.exception.ServiceException;
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
import com.zt.plat.framework.common.util.servlet.ServletUtils;
|
||||
|
||||
import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import com.zt.plat.framework.excel.core.util.ExcelUtils;
|
||||
import com.zt.plat.framework.security.config.SecurityProperties;
|
||||
import com.zt.plat.framework.security.core.LoginUser;
|
||||
import com.zt.plat.framework.security.core.util.SecurityFrameworkUtils;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.codec.Base64;
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.http.HttpRequest;
|
||||
import cn.hutool.http.HttpResponse;
|
||||
import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigReportTemplateDO;
|
||||
import com.zt.plat.module.qms.enums.ErrorCodeConstants;
|
||||
import com.zt.plat.module.qms.framework.gridreport.GridReport;
|
||||
import com.zt.plat.module.qms.framework.gridreport.PdfHelper;
|
||||
import com.zt.plat.module.qms.framework.gridreport.exception.GridReportException;
|
||||
import com.zt.plat.module.qms.business.config.service.ConfigReportTemplateService;
|
||||
import gridreport.jni.BinaryObject;
|
||||
import gridreport.jni.ExportImageType;
|
||||
import gridreport.jni.ExportType;
|
||||
import gridreport.jni.Report;
|
||||
|
||||
@Tag(name = "管理后台 - 报表模版配置")
|
||||
@RestController
|
||||
@RequestMapping("/qms/config-report-template")
|
||||
@Validated
|
||||
@Slf4j
|
||||
public class ConfigReportTemplateController {
|
||||
|
||||
public static final String WR_PREFIX = "_WR_";
|
||||
|
||||
@Resource
|
||||
private GridReport gridReport;
|
||||
|
||||
@Resource
|
||||
private SecurityProperties securityProperties;
|
||||
public class ConfigReportTemplateController implements BusinessControllerMarker {
|
||||
|
||||
@Resource
|
||||
private ConfigReportTemplateService configReportTemplateService;
|
||||
|
||||
@GetMapping("/info")
|
||||
@Operation(summary = "获取报表信息")
|
||||
public CommonResult<?> info() {
|
||||
Map<String, Object> data = new HashMap<>();
|
||||
try {
|
||||
String moduleInfo = Report.getModuleInfo();
|
||||
String moduleVersion = Report.getModuleVersion();
|
||||
String modulePath = Report.getModulePath();
|
||||
data.put("moduleInfo", moduleInfo);
|
||||
data.put("moduleVersion", moduleVersion);
|
||||
data.put("modulePath", modulePath);
|
||||
} catch (Exception e) {
|
||||
}
|
||||
return success(data);
|
||||
}
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建报表模版配置")
|
||||
@@ -179,460 +111,4 @@ public class ConfigReportTemplateController {
|
||||
BeanUtils.toBean(list, ConfigReportTemplateRespVO.class));
|
||||
}
|
||||
|
||||
/***
|
||||
* 预览报表
|
||||
* @param reportId
|
||||
* @param reportKey
|
||||
* @param dataUrl
|
||||
* @param isCrypto
|
||||
* @param type
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@GetMapping("/preview")
|
||||
@Operation(summary = "预览报表")
|
||||
public ResponseEntity<org.springframework.core.io.Resource> preview(Long reportId, String reportKey, String dataUrl, Boolean isCrypto, String type) throws Exception {
|
||||
HttpServletRequest request = ServletUtils.getRequest();
|
||||
ConfigReportTemplateDO gridppReportFile = null;
|
||||
if (reportId != null) {
|
||||
gridppReportFile = configReportTemplateService.getConfigReportTemplate(reportId);
|
||||
} else if (StrUtil.isNotBlank(reportKey)) {
|
||||
gridppReportFile = configReportTemplateService.getConfigReportTemplateByKey(reportKey);
|
||||
}
|
||||
if (ObjectUtil.isEmpty(gridppReportFile)) {
|
||||
throw new ServiceException(ErrorCodeConstants.CONFIG_REPORT_TEMPLATE_NOT_EXISTS);
|
||||
}
|
||||
String reportData = StringEscapeUtils.unescapeHtml4(gridppReportFile.getData());
|
||||
|
||||
//报表参数
|
||||
Map<String, String> reportParams = new HashMap<>();
|
||||
//获取当前用户姓名
|
||||
LoginUser user = SecurityFrameworkUtils.getLoginUser();
|
||||
String realName = "";
|
||||
if (user != null) {
|
||||
realName = SecurityFrameworkUtils.getLoginUserNickname();
|
||||
}
|
||||
reportParams.put("operName", realName);
|
||||
|
||||
if (StrUtil.isNotBlank(dataUrl)) {
|
||||
log.info("url:" + dataUrl);
|
||||
dataUrl = StringEscapeUtils.unescapeHtml4(dataUrl);
|
||||
log.info("url:" + dataUrl);
|
||||
//处理url参数
|
||||
if(dataUrl.contains("?")) {
|
||||
String urlParam = dataUrl.split("\\?")[1];
|
||||
String[] urlVks = urlParam.split("&");
|
||||
for (int i = 0; i < urlVks.length; i++) {
|
||||
String vk = urlVks[i];
|
||||
if (StrUtil.isNotBlank(vk)) {
|
||||
String[] vkSplit = vk.split("=");
|
||||
if(vkSplit.length == 2){
|
||||
reportParams.put(vkSplit[0], vkSplit[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, String> headers = new HashMap<>();
|
||||
String token = SecurityFrameworkUtils.obtainAuthorization(request,
|
||||
securityProperties.getTokenHeader(), securityProperties.getTokenParameter());
|
||||
headers.put(securityProperties.getTokenHeader(), token);
|
||||
HttpResponse res = HttpRequest.get(dataUrl)
|
||||
.addHeaders(headers)
|
||||
.setConnectionTimeout(60 * 1000)
|
||||
.setReadTimeout(120 * 1000)
|
||||
.execute();
|
||||
if (res.getStatus() != 200) {
|
||||
log.error("报表数据,网络请求错误!", res.body());
|
||||
throw new GridReportException("报表数据,网络请求错误!");
|
||||
}
|
||||
String body = res.body();
|
||||
CommonResult<?> dataR = JSON.parseObject(body, CommonResult.class);
|
||||
if (dataR != null && dataR.getCode() == 0) {
|
||||
if (ArrayUtil.isArray(dataR.getData()) || dataR.getData() instanceof Collection) {
|
||||
reportData = JSON.toJSONString(dataR);
|
||||
} else {
|
||||
reportData = JSON.toJSONString(dataR.getData());
|
||||
}
|
||||
} else {
|
||||
log.error("获取报表数据错误!", dataR.getMsg());
|
||||
log.error("报表数据:" + reportData);
|
||||
throw new GridReportException("获取报表数据错误!");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
BinaryObject binaryObject = gridReport.genReport(gridppReportFile.getContent(), reportData, reportParams, ExportType.valueOf("OFD".equals(type.toUpperCase()) ? "PDF" : type.toUpperCase()));
|
||||
MediaType mediaType = null;
|
||||
byte[] docBytes = null;
|
||||
//文件扩展名
|
||||
String fileExtName = type.toLowerCase();
|
||||
switch (type.toUpperCase()) {
|
||||
case "PDF":
|
||||
mediaType = MediaType.APPLICATION_PDF;
|
||||
docBytes = PdfHelper.modifyDocInfo(binaryObject.getDataBuf());
|
||||
break;
|
||||
case "OFD":
|
||||
mediaType = MediaType.APPLICATION_OCTET_STREAM;
|
||||
docBytes = PdfHelper.modifyDocInfo(binaryObject.getDataBuf());
|
||||
break;
|
||||
case "RTF":
|
||||
fileExtName = "doc";
|
||||
mediaType = MediaType.APPLICATION_OCTET_STREAM;
|
||||
docBytes = binaryObject.getDataBuf();
|
||||
break;
|
||||
default:
|
||||
mediaType = MediaType.APPLICATION_OCTET_STREAM;
|
||||
docBytes = binaryObject.getDataBuf();
|
||||
break;
|
||||
}
|
||||
|
||||
return browser(new ByteArrayResource(docBytes), gridppReportFile.getName() + "." + fileExtName, mediaType);
|
||||
}
|
||||
|
||||
@GetMapping("/previewDocs")
|
||||
@Operation(summary = "报告预览报表")
|
||||
public ResponseEntity<org.springframework.core.io.Resource> previewDocs(Long reportId, String reportKey, String dataUrl, Boolean isCrypto, String type) throws Exception {
|
||||
HttpServletRequest request = ServletUtils.getRequest();
|
||||
ConfigReportTemplateDO gridppReportFile = null;
|
||||
if (reportId != null) {
|
||||
gridppReportFile = configReportTemplateService.getConfigReportTemplate(reportId);
|
||||
} else if (StrUtil.isNotBlank(reportKey)) {
|
||||
gridppReportFile = configReportTemplateService.getConfigReportTemplateByKey(reportKey);
|
||||
}
|
||||
if (ObjectUtil.isEmpty(gridppReportFile)) {
|
||||
throw new GridReportException("未找到报表模板!");
|
||||
}
|
||||
String reportData = StringEscapeUtils.unescapeHtml4(gridppReportFile.getData());
|
||||
|
||||
//报表参数
|
||||
Map<String, String> reportParams = new HashMap<>();
|
||||
//获取当前用户姓名
|
||||
LoginUser user = SecurityFrameworkUtils.getLoginUser();
|
||||
String realName = "";
|
||||
if (user != null) {
|
||||
realName = SecurityFrameworkUtils.getLoginUserNickname();
|
||||
}
|
||||
reportParams.put("operName", realName);
|
||||
|
||||
if (StrUtil.isNotBlank(dataUrl)) {
|
||||
log.info("url:" + dataUrl);
|
||||
dataUrl = StringEscapeUtils.unescapeHtml4(dataUrl);
|
||||
log.info("url:" + dataUrl);
|
||||
|
||||
|
||||
Map<String, String> headers = new HashMap<>();
|
||||
String token = SecurityFrameworkUtils.obtainAuthorization(request,
|
||||
securityProperties.getTokenHeader(), securityProperties.getTokenParameter());
|
||||
headers.put(securityProperties.getTokenHeader(), token);
|
||||
HttpResponse res = HttpRequest.get(dataUrl)
|
||||
.addHeaders(headers)
|
||||
.setConnectionTimeout(60 * 1000)
|
||||
.setReadTimeout(120 * 1000)
|
||||
.execute();
|
||||
if (res.getStatus() != 200) {
|
||||
log.error("报表数据,网络请求错误!", res.body());
|
||||
throw new GridReportException("报表数据,网络请求错误!");
|
||||
}
|
||||
String body = res.body();
|
||||
CommonResult<?> dataR = JSON.parseObject(body, CommonResult.class);
|
||||
if (dataR != null && dataR.getCode() == 0) {
|
||||
if (ArrayUtil.isArray(dataR.getData()) || dataR.getData() instanceof Collection) {
|
||||
reportData = JSON.toJSONString(dataR);
|
||||
} else {
|
||||
|
||||
Map<String, Object> map = BeanUtil.beanToMap(dataR.getData());
|
||||
for (Map.Entry<String,Object> obj : BeanUtil.beanToMap(map.get("reportParams")).entrySet()) {
|
||||
reportParams.put(obj.getKey(), obj.getValue() == null ? "": obj.getValue().toString());
|
||||
}
|
||||
reportData = JSON.toJSONString(dataR.getData());
|
||||
}
|
||||
} else {
|
||||
log.error("获取报表数据错误!", dataR.getMsg());
|
||||
log.error("报表数据:" + reportData);
|
||||
throw new GridReportException("获取报表数据错误!");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
BinaryObject binaryObject = gridReport.genReport(gridppReportFile.getContent(), reportData, reportParams, ExportType.valueOf("OFD".equals(type.toUpperCase()) ? "PDF" : type.toUpperCase()));
|
||||
MediaType mediaType = null;
|
||||
byte[] docBytes = null;
|
||||
//文件扩展名
|
||||
String fileExtName = type.toLowerCase();
|
||||
switch (type.toUpperCase()) {
|
||||
case "PDF":
|
||||
mediaType = MediaType.APPLICATION_PDF;
|
||||
docBytes = PdfHelper.modifyDocInfo(binaryObject.getDataBuf());
|
||||
break;
|
||||
case "OFD":
|
||||
mediaType = MediaType.APPLICATION_OCTET_STREAM;
|
||||
docBytes = PdfHelper.modifyDocInfo(binaryObject.getDataBuf());
|
||||
break;
|
||||
case "RTF":
|
||||
fileExtName = "doc";
|
||||
mediaType = MediaType.APPLICATION_OCTET_STREAM;
|
||||
docBytes = binaryObject.getDataBuf();
|
||||
break;
|
||||
case "IMG":
|
||||
fileExtName = "png";
|
||||
mediaType = MediaType.IMAGE_PNG;
|
||||
docBytes = binaryObject.getDataBuf();
|
||||
break;
|
||||
default:
|
||||
mediaType = MediaType.APPLICATION_OCTET_STREAM;
|
||||
docBytes = binaryObject.getDataBuf();
|
||||
break;
|
||||
}
|
||||
|
||||
return browser(new ByteArrayResource(docBytes), gridppReportFile.getName() + "." + fileExtName, mediaType);
|
||||
}
|
||||
|
||||
@GetMapping("/export")
|
||||
@Operation(summary = "导出报表")
|
||||
public ResponseEntity<ResourceRegion> export(Long reportId, String reportKey, String exportName, String dataUrl, Boolean isCrypto, String type) throws Exception {
|
||||
HttpServletRequest request = ServletUtils.getRequest();
|
||||
ConfigReportTemplateDO gridppReportFile = null;
|
||||
if (reportId != null) {
|
||||
gridppReportFile = configReportTemplateService.getConfigReportTemplate(reportId);
|
||||
} else if (StrUtil.isNotBlank(reportKey)) {
|
||||
gridppReportFile = configReportTemplateService.getConfigReportTemplateByKey(reportKey);
|
||||
}
|
||||
if (ObjectUtil.isEmpty(gridppReportFile)) {
|
||||
throw new GridReportException("未找到报表模板!");
|
||||
}
|
||||
String reportData = StringEscapeUtils.unescapeHtml4(gridppReportFile.getData());
|
||||
|
||||
//报表参数
|
||||
Map<String, String> reportParams = new HashMap<>();
|
||||
//获取当前用户姓名
|
||||
LoginUser user = SecurityFrameworkUtils.getLoginUser();
|
||||
String realName = "";
|
||||
if (user != null) {
|
||||
realName = SecurityFrameworkUtils.getLoginUserNickname();
|
||||
}
|
||||
reportParams.put("operName", realName);
|
||||
|
||||
if (StrUtil.isNotBlank(dataUrl)) {
|
||||
dataUrl = StringEscapeUtils.unescapeHtml4(dataUrl);
|
||||
//处理url参数
|
||||
if (dataUrl.contains("?")) {
|
||||
String urlParam = dataUrl.split("\\?")[1];
|
||||
String[] urlVks = urlParam.split("&");
|
||||
for (int i = 0; i < urlVks.length; i++) {
|
||||
String vk = urlVks[i];
|
||||
if (StrUtil.isNotBlank(vk)) {
|
||||
String[] vkSplit = vk.split("=");
|
||||
if(vkSplit.length == 2){
|
||||
reportParams.put(vkSplit[0], vkSplit[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Map<String, String> headers = new HashMap<>();
|
||||
String token = SecurityFrameworkUtils.obtainAuthorization(request,
|
||||
securityProperties.getTokenHeader(), securityProperties.getTokenParameter());
|
||||
headers.put(securityProperties.getTokenHeader(), token);
|
||||
HttpResponse res = HttpRequest.get(dataUrl)
|
||||
.addHeaders(headers)
|
||||
.setConnectionTimeout(60 * 1000)
|
||||
.setReadTimeout(120 * 1000)
|
||||
.execute();
|
||||
if (res.getStatus() != 200) {
|
||||
log.error("报表数据,网络请求错误!", res.body());
|
||||
throw new GridReportException("报表数据,网络请求错误!");
|
||||
}
|
||||
String body = res.body();
|
||||
CommonResult<?> dataR = JSON.parseObject(body, CommonResult.class);
|
||||
if (dataR != null && dataR.getCode() == 0) {
|
||||
if (ArrayUtil.isArray(dataR.getData()) || dataR.getData() instanceof Collection) {
|
||||
reportData = JSON.toJSONString(dataR);
|
||||
} else {
|
||||
reportData = JSON.toJSONString(dataR.getData());
|
||||
}
|
||||
} else {
|
||||
log.error("获取报表数据错误!", dataR.getMsg());
|
||||
throw new GridReportException("获取报表数据错误!");
|
||||
}
|
||||
}
|
||||
|
||||
BinaryObject binaryObject = gridReport.genReport(gridppReportFile.getContent(), reportData, reportParams, ExportType.valueOf("OFD".equals(type.toUpperCase()) ? "PDF" : type.toUpperCase()));
|
||||
byte[] docBytes = null;
|
||||
//文件扩展名
|
||||
String fileExtName = type.toLowerCase();
|
||||
switch (type.toUpperCase()) {
|
||||
case "PDF":
|
||||
docBytes = PdfHelper.modifyDocInfo(binaryObject.getDataBuf());
|
||||
break;
|
||||
case "OFD":
|
||||
docBytes = PdfHelper.modifyDocInfo(binaryObject.getDataBuf());
|
||||
break;
|
||||
case "RTF":
|
||||
fileExtName = "doc";
|
||||
docBytes = binaryObject.getDataBuf();
|
||||
break;
|
||||
case "IMG":
|
||||
fileExtName = "png";
|
||||
docBytes = binaryObject.getDataBuf();
|
||||
break;
|
||||
default:
|
||||
docBytes = binaryObject.getDataBuf();
|
||||
break;
|
||||
}
|
||||
String fileName = gridppReportFile.getName();
|
||||
if (StrUtil.isNotBlank(exportName)) {
|
||||
fileName = exportName;
|
||||
}
|
||||
return download(new ByteArrayResource(docBytes), fileName + "." + fileExtName);
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成Base64图片
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/gen-report-png-image-base64")
|
||||
@Operation(summary = "生成Base64图片")
|
||||
public CommonResult<?> genReportPngImageBase64(@RequestBody GenReportBody body) {
|
||||
ConfigReportTemplateDO gridppReportFile = null;
|
||||
if (body.getReportId() != null) {
|
||||
gridppReportFile = configReportTemplateService.getConfigReportTemplate(body.getReportId());
|
||||
} else if (StrUtil.isNotBlank(body.getReportKey())) {
|
||||
gridppReportFile = configReportTemplateService.getConfigReportTemplateByKey(body.getReportKey());
|
||||
}
|
||||
if (ObjectUtil.isEmpty(gridppReportFile)) {
|
||||
throw new ServiceException(ErrorCodeConstants.CONFIG_REPORT_TEMPLATE_NOT_EXISTS);
|
||||
}
|
||||
|
||||
String imgBase64 = null;
|
||||
try {
|
||||
BinaryObject binaryObject = gridReport.genReport(gridppReportFile.getContent(), body.getReportDataJson(), body.getReportParams(), ExportType.IMG, ExportImageType.PNG, body.getImgDpi());
|
||||
imgBase64 = binaryObject.getAsBase64Text();
|
||||
} catch (Exception e) {
|
||||
log.error("生成base64图片失败", e);
|
||||
}
|
||||
if (StringUtils.isBlank(imgBase64)) {
|
||||
return CommonResult.error(1_032_100_000, "生成Base64图片失败");
|
||||
}
|
||||
return success(imgBase64);
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成Base64图片
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/gen-report-png-image-base64-by-pdf")
|
||||
@Operation(summary = "生成Base64图片")
|
||||
public CommonResult<?> genReportPngImageBase64ByPdf(@RequestBody GenReportBody body) {
|
||||
ConfigReportTemplateDO gridppReportFile = null;
|
||||
if (body.getReportId() != null) {
|
||||
gridppReportFile = configReportTemplateService.getConfigReportTemplate(body.getReportId());
|
||||
} else if (StrUtil.isNotBlank(body.getReportKey())) {
|
||||
gridppReportFile = configReportTemplateService.getConfigReportTemplateByKey(body.getReportKey());
|
||||
}
|
||||
if (ObjectUtil.isEmpty(gridppReportFile)) {
|
||||
throw new ServiceException(ErrorCodeConstants.CONFIG_REPORT_TEMPLATE_NOT_EXISTS);
|
||||
}
|
||||
|
||||
String imgBase64 = null;
|
||||
try {
|
||||
BinaryObject binaryObject = gridReport.genReport(gridppReportFile.getContent(), body.getReportDataJson(), body.getReportParams(), ExportType.PDF);
|
||||
byte[] pngBytes = PdfHelper.pdfToPng(binaryObject.getDataBuf(), body.getImgDpi());
|
||||
//String encodeHexStr = HexUtil.encodeHexStr(pngBytes);
|
||||
//System.out.println(encodeHexStr);
|
||||
imgBase64 = Base64.encode(pngBytes);
|
||||
} catch (Exception e) {
|
||||
log.error("生成base64图片失败", e);
|
||||
}
|
||||
if (StringUtils.isBlank(imgBase64)) {
|
||||
return CommonResult.error(1_032_100_000, "生成Base64图片失败");
|
||||
}
|
||||
return success(imgBase64);
|
||||
}
|
||||
|
||||
/**
|
||||
* 下载文件
|
||||
*
|
||||
* @param file 文件
|
||||
* @return {ResponseEntity}
|
||||
* @throws IOException io异常
|
||||
*/
|
||||
protected ResponseEntity<ResourceRegion> download(File file) throws IOException {
|
||||
String fileName = file.getName();
|
||||
return download(file, fileName);
|
||||
}
|
||||
|
||||
/**
|
||||
* 下载
|
||||
*
|
||||
* @param file 文件
|
||||
* @param fileName 生成的文件名
|
||||
* @return {ResponseEntity}
|
||||
* @throws IOException io异常
|
||||
*/
|
||||
protected ResponseEntity<ResourceRegion> download(File file, String fileName) throws IOException {
|
||||
org.springframework.core.io.Resource resource = new FileSystemResource(file);
|
||||
return download(resource, fileName);
|
||||
}
|
||||
|
||||
/**
|
||||
* 下载
|
||||
*
|
||||
* @param resource 资源
|
||||
* @param fileName 生成的文件名
|
||||
* @return {ResponseEntity}
|
||||
* @throws IOException io异常
|
||||
*/
|
||||
protected ResponseEntity<ResourceRegion> download(org.springframework.core.io.Resource resource, String fileName) throws IOException {
|
||||
HttpServletRequest request = ServletUtils.getRequest();
|
||||
String header = request.getHeader(HttpHeaders.USER_AGENT);
|
||||
// 避免空指针
|
||||
header = header == null ? StringPool.EMPTY : header.toUpperCase();
|
||||
HttpStatus status= HttpStatus.OK;
|
||||
// 断点续传
|
||||
long position = 0;
|
||||
long count = resource.contentLength();
|
||||
String range = request.getHeader(HttpHeaders.RANGE);
|
||||
if (null != range) {
|
||||
status = HttpStatus.PARTIAL_CONTENT;
|
||||
String[] rangeRange = range.replace("bytes=", StringPool.EMPTY).split(StringPool.DASH);
|
||||
position = Long.parseLong(rangeRange[0]);
|
||||
if (rangeRange.length > 1) {
|
||||
long end = Long.parseLong(rangeRange[1]);
|
||||
count = end - position + 1;
|
||||
}
|
||||
}
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.setContentType(MediaType.APPLICATION_OCTET_STREAM);
|
||||
String encodeFileName = UriUtils.encode(fileName, StandardCharsets.UTF_8);
|
||||
// 兼容各种浏览器下载:
|
||||
// https://blog.robotshell.org/2012/deal-with-http-header-encoding-for-file-download/
|
||||
String disposition = "attachment;" +
|
||||
"filename=\"" + encodeFileName + "\";" +
|
||||
"filename*=utf-8''" + encodeFileName;
|
||||
headers.set(HttpHeaders.CONTENT_DISPOSITION, disposition);
|
||||
return new ResponseEntity<>(new ResourceRegion(resource, position, count), headers, status);
|
||||
}
|
||||
|
||||
/**
|
||||
* 浏览器打开
|
||||
*
|
||||
* @param resource 资源
|
||||
* @param fileName 生成的文件名
|
||||
* @return {ResponseEntity}
|
||||
* @throws IOException io异常
|
||||
*/
|
||||
protected ResponseEntity<org.springframework.core.io.Resource> browser(org.springframework.core.io.Resource resource, String fileName, MediaType mediaType) throws IOException {
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.setContentType(mediaType);
|
||||
headers.setContentLength(resource.contentLength());
|
||||
String encodeFileName = UriUtils.encode(fileName, StandardCharsets.UTF_8);
|
||||
// 兼容各种浏览器下载:
|
||||
// https://blog.robotshell.org/2012/deal-with-http-header-encoding-for-file-download/
|
||||
String disposition = "inline;" +
|
||||
"filename=\"" + encodeFileName + "\";" +
|
||||
"filename*=utf-8''" + encodeFileName;
|
||||
headers.set(HttpHeaders.CONTENT_DISPOSITION, disposition);
|
||||
return new ResponseEntity<>(resource, headers, HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,556 @@
|
||||
package com.zt.plat.module.qms.business.config.controller.admin;
|
||||
|
||||
import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.text.StringEscapeUtils;
|
||||
import org.springframework.core.io.ByteArrayResource;
|
||||
import org.springframework.core.io.FileSystemResource;
|
||||
import org.springframework.core.io.support.ResourceRegion;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.util.UriUtils;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.mybatisplus.core.toolkit.StringPool;
|
||||
import com.zt.plat.framework.common.exception.ServiceException;
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.framework.common.util.servlet.ServletUtils;
|
||||
import com.zt.plat.framework.security.config.SecurityProperties;
|
||||
import com.zt.plat.framework.security.core.LoginUser;
|
||||
import com.zt.plat.framework.security.core.util.SecurityFrameworkUtils;
|
||||
import com.zt.plat.framework.web.core.util.WebFrameworkUtils;
|
||||
import com.zt.plat.module.qms.business.config.controller.vo.GenReportBody;
|
||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigReportTemplateDO;
|
||||
import com.zt.plat.module.qms.business.config.service.ConfigReportTemplateService;
|
||||
import com.zt.plat.module.qms.enums.ErrorCodeConstants;
|
||||
import com.zt.plat.module.qms.framework.gridreport.GridReport;
|
||||
import com.zt.plat.module.qms.framework.gridreport.PdfHelper;
|
||||
import com.zt.plat.module.qms.framework.gridreport.exception.GridReportException;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.codec.Base64;
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.http.HttpRequest;
|
||||
import cn.hutool.http.HttpResponse;
|
||||
import gridreport.jni.BinaryObject;
|
||||
import gridreport.jni.ExportImageType;
|
||||
import gridreport.jni.ExportType;
|
||||
import gridreport.jni.Report;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/qms/config-report-template")
|
||||
public class GridReportController {
|
||||
|
||||
public static final String WR_PREFIX = "_WR_";
|
||||
|
||||
@Resource
|
||||
private GridReport gridReport;
|
||||
|
||||
@Resource
|
||||
private SecurityProperties securityProperties;
|
||||
|
||||
@Resource
|
||||
private ConfigReportTemplateService configReportTemplateService;
|
||||
|
||||
@GetMapping("/info")
|
||||
@Operation(summary = "获取报表信息")
|
||||
public CommonResult<?> info() {
|
||||
Map<String, Object> data = new HashMap<>();
|
||||
try {
|
||||
String moduleInfo = Report.getModuleInfo();
|
||||
String moduleVersion = Report.getModuleVersion();
|
||||
String modulePath = Report.getModulePath();
|
||||
data.put("moduleInfo", moduleInfo);
|
||||
data.put("moduleVersion", moduleVersion);
|
||||
data.put("modulePath", modulePath);
|
||||
} catch (Exception e) {
|
||||
}
|
||||
return success(data);
|
||||
}
|
||||
|
||||
/***
|
||||
* 预览报表
|
||||
* @param reportId
|
||||
* @param reportKey
|
||||
* @param dataUrl
|
||||
* @param isCrypto
|
||||
* @param type
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@GetMapping("/preview")
|
||||
@Operation(summary = "预览报表")
|
||||
public ResponseEntity<org.springframework.core.io.Resource> preview(Long reportId, String reportKey, String dataUrl, Boolean isCrypto, String type) throws Exception {
|
||||
HttpServletRequest request = ServletUtils.getRequest();
|
||||
ConfigReportTemplateDO gridppReportFile = null;
|
||||
if (reportId != null) {
|
||||
gridppReportFile = configReportTemplateService.getConfigReportTemplate(reportId);
|
||||
} else if (StrUtil.isNotBlank(reportKey)) {
|
||||
gridppReportFile = configReportTemplateService.getConfigReportTemplateByKey(reportKey);
|
||||
}
|
||||
if (ObjectUtil.isEmpty(gridppReportFile)) {
|
||||
throw new ServiceException(ErrorCodeConstants.CONFIG_REPORT_TEMPLATE_NOT_EXISTS);
|
||||
}
|
||||
String reportData = StringEscapeUtils.unescapeHtml4(gridppReportFile.getData());
|
||||
|
||||
//报表参数
|
||||
Map<String, String> reportParams = new HashMap<>();
|
||||
//获取当前用户姓名
|
||||
LoginUser user = SecurityFrameworkUtils.getLoginUser();
|
||||
String realName = "";
|
||||
if (user != null) {
|
||||
realName = SecurityFrameworkUtils.getLoginUserNickname();
|
||||
}
|
||||
reportParams.put("operName", realName);
|
||||
|
||||
if (StrUtil.isNotBlank(dataUrl)) {
|
||||
log.info("url:" + dataUrl);
|
||||
dataUrl = StringEscapeUtils.unescapeHtml4(dataUrl);
|
||||
log.info("url:" + dataUrl);
|
||||
//处理url参数
|
||||
if(dataUrl.contains("?")) {
|
||||
String urlParam = dataUrl.split("\\?")[1];
|
||||
String[] urlVks = urlParam.split("&");
|
||||
for (int i = 0; i < urlVks.length; i++) {
|
||||
String vk = urlVks[i];
|
||||
if (StrUtil.isNotBlank(vk)) {
|
||||
String[] vkSplit = vk.split("=");
|
||||
if(vkSplit.length == 2){
|
||||
reportParams.put(vkSplit[0], vkSplit[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, String> headers = new HashMap<>();
|
||||
String token = SecurityFrameworkUtils.obtainAuthorization(request,
|
||||
securityProperties.getTokenHeader(), securityProperties.getTokenParameter());
|
||||
headers.put(securityProperties.getTokenHeader(), token);
|
||||
// headers.put(WebFrameworkUtils.HEADER_VISIT_COMPANY_ID, user.getVisitCompanyId() + "");
|
||||
// headers.put(WebFrameworkUtils.HEADER_VISIT_DEPT_ID, user.getVisitDeptId() + "");
|
||||
|
||||
HttpResponse res = HttpRequest.get(dataUrl)
|
||||
.addHeaders(headers)
|
||||
.setConnectionTimeout(60 * 1000)
|
||||
.setReadTimeout(120 * 1000)
|
||||
.execute();
|
||||
if (res.getStatus() != 200) {
|
||||
log.error("报表数据,网络请求错误!", res.body());
|
||||
throw new GridReportException("报表数据,网络请求错误!");
|
||||
}
|
||||
String body = res.body();
|
||||
CommonResult<?> dataR = JSON.parseObject(body, CommonResult.class);
|
||||
if (dataR != null && dataR.getCode() == 0) {
|
||||
if (ArrayUtil.isArray(dataR.getData()) || dataR.getData() instanceof Collection) {
|
||||
reportData = JSON.toJSONString(dataR);
|
||||
} else {
|
||||
reportData = JSON.toJSONString(dataR.getData());
|
||||
}
|
||||
} else {
|
||||
log.error("获取报表数据错误!", dataR.getMsg());
|
||||
log.error("报表数据:" + reportData);
|
||||
throw new GridReportException("获取报表数据错误!");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
BinaryObject binaryObject = gridReport.genReport(gridppReportFile.getContent(), reportData, reportParams, ExportType.valueOf("OFD".equals(type.toUpperCase()) ? "PDF" : type.toUpperCase()));
|
||||
MediaType mediaType = null;
|
||||
byte[] docBytes = null;
|
||||
//文件扩展名
|
||||
String fileExtName = type.toLowerCase();
|
||||
switch (type.toUpperCase()) {
|
||||
case "PDF":
|
||||
mediaType = MediaType.APPLICATION_PDF;
|
||||
docBytes = PdfHelper.modifyDocInfo(binaryObject.getDataBuf());
|
||||
break;
|
||||
case "OFD":
|
||||
mediaType = MediaType.APPLICATION_OCTET_STREAM;
|
||||
docBytes = PdfHelper.modifyDocInfo(binaryObject.getDataBuf());
|
||||
break;
|
||||
case "RTF":
|
||||
fileExtName = "doc";
|
||||
mediaType = MediaType.APPLICATION_OCTET_STREAM;
|
||||
docBytes = binaryObject.getDataBuf();
|
||||
break;
|
||||
default:
|
||||
mediaType = MediaType.APPLICATION_OCTET_STREAM;
|
||||
docBytes = binaryObject.getDataBuf();
|
||||
break;
|
||||
}
|
||||
|
||||
return browser(new ByteArrayResource(docBytes), gridppReportFile.getName() + "." + fileExtName, mediaType);
|
||||
}
|
||||
|
||||
@GetMapping("/previewDocs")
|
||||
@Operation(summary = "报告预览报表")
|
||||
public ResponseEntity<org.springframework.core.io.Resource> previewDocs(Long reportId, String reportKey, String dataUrl, Boolean isCrypto, String type) throws Exception {
|
||||
HttpServletRequest request = ServletUtils.getRequest();
|
||||
ConfigReportTemplateDO gridppReportFile = null;
|
||||
if (reportId != null) {
|
||||
gridppReportFile = configReportTemplateService.getConfigReportTemplate(reportId);
|
||||
} else if (StrUtil.isNotBlank(reportKey)) {
|
||||
gridppReportFile = configReportTemplateService.getConfigReportTemplateByKey(reportKey);
|
||||
}
|
||||
if (ObjectUtil.isEmpty(gridppReportFile)) {
|
||||
throw new GridReportException("未找到报表模板!");
|
||||
}
|
||||
String reportData = StringEscapeUtils.unescapeHtml4(gridppReportFile.getData());
|
||||
|
||||
//报表参数
|
||||
Map<String, String> reportParams = new HashMap<>();
|
||||
//获取当前用户姓名
|
||||
LoginUser user = SecurityFrameworkUtils.getLoginUser();
|
||||
String realName = "";
|
||||
if (user != null) {
|
||||
realName = SecurityFrameworkUtils.getLoginUserNickname();
|
||||
}
|
||||
reportParams.put("operName", realName);
|
||||
|
||||
if (StrUtil.isNotBlank(dataUrl)) {
|
||||
log.info("url:" + dataUrl);
|
||||
dataUrl = StringEscapeUtils.unescapeHtml4(dataUrl);
|
||||
log.info("url:" + dataUrl);
|
||||
|
||||
|
||||
Map<String, String> headers = new HashMap<>();
|
||||
String token = SecurityFrameworkUtils.obtainAuthorization(request,
|
||||
securityProperties.getTokenHeader(), securityProperties.getTokenParameter());
|
||||
headers.put(securityProperties.getTokenHeader(), token);
|
||||
// headers.put(WebFrameworkUtils.HEADER_VISIT_COMPANY_ID, user.getVisitCompanyId() + "");
|
||||
// headers.put(WebFrameworkUtils.HEADER_VISIT_DEPT_ID, user.getVisitDeptId() + "");
|
||||
HttpResponse res = HttpRequest.get(dataUrl)
|
||||
.addHeaders(headers)
|
||||
.setConnectionTimeout(60 * 1000)
|
||||
.setReadTimeout(120 * 1000)
|
||||
.execute();
|
||||
if (res.getStatus() != 200) {
|
||||
log.error("报表数据,网络请求错误!", res.body());
|
||||
throw new GridReportException("报表数据,网络请求错误!");
|
||||
}
|
||||
String body = res.body();
|
||||
CommonResult<?> dataR = JSON.parseObject(body, CommonResult.class);
|
||||
if (dataR != null && dataR.getCode() == 0) {
|
||||
if (ArrayUtil.isArray(dataR.getData()) || dataR.getData() instanceof Collection) {
|
||||
reportData = JSON.toJSONString(dataR);
|
||||
} else {
|
||||
|
||||
Map<String, Object> map = BeanUtil.beanToMap(dataR.getData());
|
||||
for (Map.Entry<String,Object> obj : BeanUtil.beanToMap(map.get("reportParams")).entrySet()) {
|
||||
reportParams.put(obj.getKey(), obj.getValue() == null ? "": obj.getValue().toString());
|
||||
}
|
||||
reportData = JSON.toJSONString(dataR.getData());
|
||||
}
|
||||
} else {
|
||||
log.error("获取报表数据错误!", dataR.getMsg());
|
||||
log.error("报表数据:" + reportData);
|
||||
throw new GridReportException("获取报表数据错误!");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
BinaryObject binaryObject = gridReport.genReport(gridppReportFile.getContent(), reportData, reportParams, ExportType.valueOf("OFD".equals(type.toUpperCase()) ? "PDF" : type.toUpperCase()));
|
||||
MediaType mediaType = null;
|
||||
byte[] docBytes = null;
|
||||
//文件扩展名
|
||||
String fileExtName = type.toLowerCase();
|
||||
switch (type.toUpperCase()) {
|
||||
case "PDF":
|
||||
mediaType = MediaType.APPLICATION_PDF;
|
||||
docBytes = PdfHelper.modifyDocInfo(binaryObject.getDataBuf());
|
||||
break;
|
||||
case "OFD":
|
||||
mediaType = MediaType.APPLICATION_OCTET_STREAM;
|
||||
docBytes = PdfHelper.modifyDocInfo(binaryObject.getDataBuf());
|
||||
break;
|
||||
case "RTF":
|
||||
fileExtName = "doc";
|
||||
mediaType = MediaType.APPLICATION_OCTET_STREAM;
|
||||
docBytes = binaryObject.getDataBuf();
|
||||
break;
|
||||
case "IMG":
|
||||
fileExtName = "png";
|
||||
mediaType = MediaType.IMAGE_PNG;
|
||||
docBytes = binaryObject.getDataBuf();
|
||||
break;
|
||||
default:
|
||||
mediaType = MediaType.APPLICATION_OCTET_STREAM;
|
||||
docBytes = binaryObject.getDataBuf();
|
||||
break;
|
||||
}
|
||||
|
||||
return browser(new ByteArrayResource(docBytes), gridppReportFile.getName() + "." + fileExtName, mediaType);
|
||||
}
|
||||
|
||||
@GetMapping("/export")
|
||||
@Operation(summary = "导出报表")
|
||||
public ResponseEntity<ResourceRegion> export(Long reportId, String reportKey, String exportName, String dataUrl, Boolean isCrypto, String type) throws Exception {
|
||||
HttpServletRequest request = ServletUtils.getRequest();
|
||||
ConfigReportTemplateDO gridppReportFile = null;
|
||||
if (reportId != null) {
|
||||
gridppReportFile = configReportTemplateService.getConfigReportTemplate(reportId);
|
||||
} else if (StrUtil.isNotBlank(reportKey)) {
|
||||
gridppReportFile = configReportTemplateService.getConfigReportTemplateByKey(reportKey);
|
||||
}
|
||||
if (ObjectUtil.isEmpty(gridppReportFile)) {
|
||||
throw new GridReportException("未找到报表模板!");
|
||||
}
|
||||
String reportData = StringEscapeUtils.unescapeHtml4(gridppReportFile.getData());
|
||||
|
||||
//报表参数
|
||||
Map<String, String> reportParams = new HashMap<>();
|
||||
//获取当前用户姓名
|
||||
LoginUser user = SecurityFrameworkUtils.getLoginUser();
|
||||
String realName = "";
|
||||
if (user != null) {
|
||||
realName = SecurityFrameworkUtils.getLoginUserNickname();
|
||||
}
|
||||
reportParams.put("operName", realName);
|
||||
|
||||
if (StrUtil.isNotBlank(dataUrl)) {
|
||||
dataUrl = StringEscapeUtils.unescapeHtml4(dataUrl);
|
||||
//处理url参数
|
||||
if (dataUrl.contains("?")) {
|
||||
String urlParam = dataUrl.split("\\?")[1];
|
||||
String[] urlVks = urlParam.split("&");
|
||||
for (int i = 0; i < urlVks.length; i++) {
|
||||
String vk = urlVks[i];
|
||||
if (StrUtil.isNotBlank(vk)) {
|
||||
String[] vkSplit = vk.split("=");
|
||||
if(vkSplit.length == 2){
|
||||
reportParams.put(vkSplit[0], vkSplit[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Map<String, String> headers = new HashMap<>();
|
||||
String token = SecurityFrameworkUtils.obtainAuthorization(request,
|
||||
securityProperties.getTokenHeader(), securityProperties.getTokenParameter());
|
||||
headers.put(securityProperties.getTokenHeader(), token);
|
||||
// headers.put(WebFrameworkUtils.HEADER_VISIT_COMPANY_ID, user.getVisitCompanyId() + "");
|
||||
// headers.put(WebFrameworkUtils.HEADER_VISIT_DEPT_ID, user.getVisitDeptId() + "");
|
||||
HttpResponse res = HttpRequest.get(dataUrl)
|
||||
.addHeaders(headers)
|
||||
.setConnectionTimeout(60 * 1000)
|
||||
.setReadTimeout(120 * 1000)
|
||||
.execute();
|
||||
if (res.getStatus() != 200) {
|
||||
log.error("报表数据,网络请求错误!", res.body());
|
||||
throw new GridReportException("报表数据,网络请求错误!");
|
||||
}
|
||||
String body = res.body();
|
||||
CommonResult<?> dataR = JSON.parseObject(body, CommonResult.class);
|
||||
if (dataR != null && dataR.getCode() == 0) {
|
||||
if (ArrayUtil.isArray(dataR.getData()) || dataR.getData() instanceof Collection) {
|
||||
reportData = JSON.toJSONString(dataR);
|
||||
} else {
|
||||
reportData = JSON.toJSONString(dataR.getData());
|
||||
}
|
||||
} else {
|
||||
log.error("获取报表数据错误!", dataR.getMsg());
|
||||
throw new GridReportException("获取报表数据错误!");
|
||||
}
|
||||
}
|
||||
|
||||
BinaryObject binaryObject = gridReport.genReport(gridppReportFile.getContent(), reportData, reportParams, ExportType.valueOf("OFD".equals(type.toUpperCase()) ? "PDF" : type.toUpperCase()));
|
||||
byte[] docBytes = null;
|
||||
//文件扩展名
|
||||
String fileExtName = type.toLowerCase();
|
||||
switch (type.toUpperCase()) {
|
||||
case "PDF":
|
||||
docBytes = PdfHelper.modifyDocInfo(binaryObject.getDataBuf());
|
||||
break;
|
||||
case "OFD":
|
||||
docBytes = PdfHelper.modifyDocInfo(binaryObject.getDataBuf());
|
||||
break;
|
||||
case "RTF":
|
||||
fileExtName = "doc";
|
||||
docBytes = binaryObject.getDataBuf();
|
||||
break;
|
||||
case "IMG":
|
||||
fileExtName = "png";
|
||||
docBytes = binaryObject.getDataBuf();
|
||||
break;
|
||||
default:
|
||||
docBytes = binaryObject.getDataBuf();
|
||||
break;
|
||||
}
|
||||
String fileName = gridppReportFile.getName();
|
||||
if (StrUtil.isNotBlank(exportName)) {
|
||||
fileName = exportName;
|
||||
}
|
||||
return download(new ByteArrayResource(docBytes), fileName + "." + fileExtName);
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成Base64图片
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/gen-report-png-image-base64")
|
||||
@Operation(summary = "生成Base64图片")
|
||||
public CommonResult<?> genReportPngImageBase64(@RequestBody GenReportBody body) {
|
||||
ConfigReportTemplateDO gridppReportFile = null;
|
||||
if (body.getReportId() != null) {
|
||||
gridppReportFile = configReportTemplateService.getConfigReportTemplate(body.getReportId());
|
||||
} else if (StrUtil.isNotBlank(body.getReportKey())) {
|
||||
gridppReportFile = configReportTemplateService.getConfigReportTemplateByKey(body.getReportKey());
|
||||
}
|
||||
if (ObjectUtil.isEmpty(gridppReportFile)) {
|
||||
throw new ServiceException(ErrorCodeConstants.CONFIG_REPORT_TEMPLATE_NOT_EXISTS);
|
||||
}
|
||||
|
||||
String imgBase64 = null;
|
||||
try {
|
||||
BinaryObject binaryObject = gridReport.genReport(gridppReportFile.getContent(), body.getReportDataJson(), body.getReportParams(), ExportType.IMG, ExportImageType.PNG, body.getImgDpi());
|
||||
imgBase64 = binaryObject.getAsBase64Text();
|
||||
} catch (Exception e) {
|
||||
log.error("生成base64图片失败", e);
|
||||
}
|
||||
if (StringUtils.isBlank(imgBase64)) {
|
||||
return CommonResult.error(1_032_100_000, "生成Base64图片失败");
|
||||
}
|
||||
return success(imgBase64);
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成Base64图片
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/gen-report-png-image-base64-by-pdf")
|
||||
@Operation(summary = "生成Base64图片")
|
||||
public CommonResult<?> genReportPngImageBase64ByPdf(@RequestBody GenReportBody body) {
|
||||
ConfigReportTemplateDO gridppReportFile = null;
|
||||
if (body.getReportId() != null) {
|
||||
gridppReportFile = configReportTemplateService.getConfigReportTemplate(body.getReportId());
|
||||
} else if (StrUtil.isNotBlank(body.getReportKey())) {
|
||||
gridppReportFile = configReportTemplateService.getConfigReportTemplateByKey(body.getReportKey());
|
||||
}
|
||||
if (ObjectUtil.isEmpty(gridppReportFile)) {
|
||||
throw new ServiceException(ErrorCodeConstants.CONFIG_REPORT_TEMPLATE_NOT_EXISTS);
|
||||
}
|
||||
|
||||
String imgBase64 = null;
|
||||
try {
|
||||
BinaryObject binaryObject = gridReport.genReport(gridppReportFile.getContent(), body.getReportDataJson(), body.getReportParams(), ExportType.PDF);
|
||||
byte[] pngBytes = PdfHelper.pdfToPng(binaryObject.getDataBuf(), body.getImgDpi());
|
||||
//String encodeHexStr = HexUtil.encodeHexStr(pngBytes);
|
||||
//System.out.println(encodeHexStr);
|
||||
imgBase64 = Base64.encode(pngBytes);
|
||||
} catch (Exception e) {
|
||||
log.error("生成base64图片失败", e);
|
||||
}
|
||||
if (StringUtils.isBlank(imgBase64)) {
|
||||
return CommonResult.error(1_032_100_000, "生成Base64图片失败");
|
||||
}
|
||||
return success(imgBase64);
|
||||
}
|
||||
|
||||
/**
|
||||
* 下载文件
|
||||
*
|
||||
* @param file 文件
|
||||
* @return {ResponseEntity}
|
||||
* @throws IOException io异常
|
||||
*/
|
||||
protected ResponseEntity<ResourceRegion> download(File file) throws IOException {
|
||||
String fileName = file.getName();
|
||||
return download(file, fileName);
|
||||
}
|
||||
|
||||
/**
|
||||
* 下载
|
||||
*
|
||||
* @param file 文件
|
||||
* @param fileName 生成的文件名
|
||||
* @return {ResponseEntity}
|
||||
* @throws IOException io异常
|
||||
*/
|
||||
protected ResponseEntity<ResourceRegion> download(File file, String fileName) throws IOException {
|
||||
org.springframework.core.io.Resource resource = new FileSystemResource(file);
|
||||
return download(resource, fileName);
|
||||
}
|
||||
|
||||
/**
|
||||
* 下载
|
||||
*
|
||||
* @param resource 资源
|
||||
* @param fileName 生成的文件名
|
||||
* @return {ResponseEntity}
|
||||
* @throws IOException io异常
|
||||
*/
|
||||
protected ResponseEntity<ResourceRegion> download(org.springframework.core.io.Resource resource, String fileName) throws IOException {
|
||||
HttpServletRequest request = ServletUtils.getRequest();
|
||||
String header = request.getHeader(HttpHeaders.USER_AGENT);
|
||||
// 避免空指针
|
||||
header = header == null ? StringPool.EMPTY : header.toUpperCase();
|
||||
HttpStatus status= HttpStatus.OK;
|
||||
// 断点续传
|
||||
long position = 0;
|
||||
long count = resource.contentLength();
|
||||
String range = request.getHeader(HttpHeaders.RANGE);
|
||||
if (null != range) {
|
||||
status = HttpStatus.PARTIAL_CONTENT;
|
||||
String[] rangeRange = range.replace("bytes=", StringPool.EMPTY).split(StringPool.DASH);
|
||||
position = Long.parseLong(rangeRange[0]);
|
||||
if (rangeRange.length > 1) {
|
||||
long end = Long.parseLong(rangeRange[1]);
|
||||
count = end - position + 1;
|
||||
}
|
||||
}
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.setContentType(MediaType.APPLICATION_OCTET_STREAM);
|
||||
String encodeFileName = UriUtils.encode(fileName, StandardCharsets.UTF_8);
|
||||
// 兼容各种浏览器下载:
|
||||
// https://blog.robotshell.org/2012/deal-with-http-header-encoding-for-file-download/
|
||||
String disposition = "attachment;" +
|
||||
"filename=\"" + encodeFileName + "\";" +
|
||||
"filename*=utf-8''" + encodeFileName;
|
||||
headers.set(HttpHeaders.CONTENT_DISPOSITION, disposition);
|
||||
return new ResponseEntity<>(new ResourceRegion(resource, position, count), headers, status);
|
||||
}
|
||||
|
||||
/**
|
||||
* 浏览器打开
|
||||
*
|
||||
* @param resource 资源
|
||||
* @param fileName 生成的文件名
|
||||
* @return {ResponseEntity}
|
||||
* @throws IOException io异常
|
||||
*/
|
||||
protected ResponseEntity<org.springframework.core.io.Resource> browser(org.springframework.core.io.Resource resource, String fileName, MediaType mediaType) throws IOException {
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.setContentType(mediaType);
|
||||
headers.setContentLength(resource.contentLength());
|
||||
String encodeFileName = UriUtils.encode(fileName, StandardCharsets.UTF_8);
|
||||
// 兼容各种浏览器下载:
|
||||
// https://blog.robotshell.org/2012/deal-with-http-header-encoding-for-file-download/
|
||||
String disposition = "inline;" +
|
||||
"filename=\"" + encodeFileName + "\";" +
|
||||
"filename*=utf-8''" + encodeFileName;
|
||||
headers.set(HttpHeaders.CONTENT_DISPOSITION, disposition);
|
||||
return new ResponseEntity<>(resource, headers, HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -42,4 +42,9 @@ public class BaseSamplePageReqVO extends PageParam {
|
||||
@Schema(description = "检测标准数量")
|
||||
private String assayStandardCount;
|
||||
|
||||
@Schema(description = "检验委托来源配置ID", example = "321")
|
||||
private Long configEntrustSourceId;
|
||||
|
||||
@Schema(description = "委托类型,委托登记-entrust_registration、检验委托-entrust_inspection", example = "1")
|
||||
private String entrustType;
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.zt.plat.module.qms.business.config.controller.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 检验委托来源与样品类型配置分页 Request VO")
|
||||
@Data
|
||||
public class ConfigEntrustSourceSampleTypePageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "检验委托来源配置ID", example = "321")
|
||||
private Long configEntrustSourceId;
|
||||
|
||||
@Schema(description = "样品类型_ID,字典表【T_DIC_BSN】样品类型:委检样、商检分析样、商检综合样、西南铜产品", example = "30057")
|
||||
private Long dictionaryBusinessId;
|
||||
|
||||
@Schema(description = "参数分组_Key,字典表【T_DIC_BSN】样品类型")
|
||||
private String dictionaryBusinessKey;
|
||||
|
||||
@Schema(description = "所属部门")
|
||||
private String systemDepartmentCode;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.zt.plat.module.qms.business.config.controller.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 检验委托来源与样品类型配置 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ConfigEntrustSourceSampleTypeRespVO {
|
||||
|
||||
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "2073")
|
||||
@ExcelProperty("ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "检验委托来源配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "321")
|
||||
@ExcelProperty("检验委托来源配置ID")
|
||||
private Long configEntrustSourceId;
|
||||
|
||||
@Schema(description = "样品类型_ID,字典表【T_DIC_BSN】样品类型:委检样、商检分析样、商检综合样、西南铜产品", requiredMode = Schema.RequiredMode.REQUIRED, example = "30057")
|
||||
@ExcelProperty("样品类型_ID,字典表【T_DIC_BSN】样品类型:委检样、商检分析样、商检综合样、西南铜产品")
|
||||
private Long dictionaryBusinessId;
|
||||
|
||||
@Schema(description = "参数分组_Key,字典表【T_DIC_BSN】样品类型")
|
||||
@ExcelProperty("参数分组_Key,字典表【T_DIC_BSN】样品类型")
|
||||
private String dictionaryBusinessKey;
|
||||
|
||||
@Schema(description = "所属部门")
|
||||
@ExcelProperty("所属部门")
|
||||
private String systemDepartmentCode;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "备注")
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.zt.plat.module.qms.business.config.controller.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 检验委托来源与样品类型配置新增/修改 Request VO")
|
||||
@Data
|
||||
public class ConfigEntrustSourceSampleTypeSaveReqVO {
|
||||
|
||||
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "2073")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "检验委托来源配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "321")
|
||||
@NotEmpty(message = "检验委托来源配置ID不能为空")
|
||||
private Long configEntrustSourceId;
|
||||
|
||||
@Schema(description = "样品类型_ID,字典表【T_DIC_BSN】样品类型:委检样、商检分析样、商检综合样、西南铜产品", requiredMode = Schema.RequiredMode.REQUIRED, example = "30057")
|
||||
@NotNull(message = "样品类型_ID,字典表【T_DIC_BSN】样品类型:委检样、商检分析样、商检综合样、西南铜产品不能为空")
|
||||
private Long dictionaryBusinessId;
|
||||
|
||||
@Schema(description = "参数分组_Key,字典表【T_DIC_BSN】样品类型")
|
||||
private String dictionaryBusinessKey;
|
||||
|
||||
@Schema(description = "所属部门")
|
||||
private String systemDepartmentCode;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -52,10 +52,15 @@ public class BaseSampleDO extends BusinessBaseDO {
|
||||
@TableField("MTRL_NAME")
|
||||
private String materialName;
|
||||
/**
|
||||
* 样品类型_ID,字典表【T_DIC_BSN】结算样、委检样、抽查样
|
||||
* 样品类型
|
||||
*/
|
||||
@TableField("DIC_BSN_ID")
|
||||
private Long dictionaryBusinessId;
|
||||
/**
|
||||
* 样品类型key
|
||||
*/
|
||||
@TableField("DIC_BSN_KY")
|
||||
private String dictionaryBusinessKey;
|
||||
/**
|
||||
* 所属部门
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
package com.zt.plat.module.qms.business.config.dal.dataobject;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
|
||||
/**
|
||||
* 检验委托来源与样品类型配置 DO
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@TableName("t_cfg_entt_src_smp_tp")
|
||||
@KeySequence("t_cfg_entt_src_smp_tp_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
/**
|
||||
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||
*/
|
||||
public class ConfigEntrustSourceSampleTypeDO extends BusinessBaseDO {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
/**
|
||||
* 检验委托来源配置ID
|
||||
*/
|
||||
@TableField("CFG_ENTT_SRC_ID")
|
||||
private Long configEntrustSourceId;
|
||||
/**
|
||||
* 样品类型_ID,字典表【T_DIC_BSN】样品类型:委检样、商检分析样、商检综合样、西南铜产品
|
||||
*/
|
||||
@TableField("DIC_BSN_ID")
|
||||
private Long dictionaryBusinessId;
|
||||
/**
|
||||
* 参数分组_Key,字典表【T_DIC_BSN】样品类型
|
||||
*/
|
||||
@TableField("DIC_BSN_KY")
|
||||
private String dictionaryBusinessKey;
|
||||
/**
|
||||
* 所属部门
|
||||
*/
|
||||
@TableField("SYS_DEPT_CD")
|
||||
private String systemDepartmentCode;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@TableField("RMK")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -1,10 +1,17 @@
|
||||
package com.zt.plat.module.qms.business.config.dal.mapper;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.zt.plat.framework.mybatis.core.query.MPJLambdaWrapperX;
|
||||
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.zt.plat.module.qms.business.config.controller.vo.BaseSamplePageReqVO;
|
||||
import com.zt.plat.module.qms.business.config.controller.vo.*;
|
||||
import com.zt.plat.module.qms.business.config.dal.dataobject.BaseSampleDO;
|
||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigEntrustSourceSampleTypeDO;
|
||||
import com.zt.plat.module.qms.enums.QmsCommonConstant;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
@@ -29,6 +36,28 @@ public interface BaseSampleMapper extends BaseMapperX<BaseSampleDO> {
|
||||
.eqIfPresent(BaseSampleDO::getRemark, reqVO.getRemark())
|
||||
.orderByDesc(BaseSampleDO::getId));
|
||||
}
|
||||
|
||||
default List<BaseSampleRespVO> selectList(BaseSamplePageReqVO reqVO) {
|
||||
LambdaQueryWrapperX<BaseSampleDO> queryWrapperX = new LambdaQueryWrapperX<BaseSampleDO>()
|
||||
.likeIfPresent(BaseSampleDO::getName, reqVO.getName())
|
||||
.eqIfPresent(BaseSampleDO::getMaterialId, reqVO.getMaterialId())
|
||||
.eqIfPresent(BaseSampleDO::getMaterialCode, reqVO.getMaterialCode())
|
||||
.likeIfPresent(BaseSampleDO::getMaterialName, reqVO.getMaterialName())
|
||||
.eqIfPresent(BaseSampleDO::getDictionaryBusinessId, reqVO.getDictionaryBusinessId())
|
||||
.eqIfPresent(BaseSampleDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
|
||||
.betweenIfPresent(BaseSampleDO::getCreateTime, reqVO.getCreateTime())
|
||||
.eqIfPresent(BaseSampleDO::getRemark, reqVO.getRemark());
|
||||
if (ObjectUtil.isNotEmpty(reqVO.getConfigEntrustSourceId())) {
|
||||
queryWrapperX.inSql(BaseSampleDO::getDictionaryBusinessId, "SELECT tcesst.DIC_BSN_ID FROM T_CFG_ENTT_SRC_SMP_TP tcesst WHERE tcesst.CFG_ENTT_SRC_ID = " + reqVO.getConfigEntrustSourceId());
|
||||
}
|
||||
if (QmsCommonConstant.ENTRUST_INSPECTION.equals(reqVO.getEntrustType())) {
|
||||
queryWrapperX.inSql(BaseSampleDO::getDictionaryBusinessId, "SELECT tcesst.DIC_BSN_ID FROM T_CFG_ENTT_SRC_SMP_TP tcesst LEFT JOIN T_CFG_ENTT_SRC tces ON tcesst.CFG_ENTT_SRC_ID = tces.ID WHERE tces.ENTT_TP = '" + reqVO.getEntrustType() + "'");
|
||||
}
|
||||
|
||||
queryWrapperX.orderByDesc(BaseSampleDO::getId);
|
||||
List<BaseSampleDO> list = selectList(queryWrapperX);
|
||||
return BeanUtils.toBean(list, BaseSampleRespVO.class);
|
||||
}
|
||||
|
||||
List<BaseSampleDO> getBaseSampleListWithAssayStandardCount();
|
||||
|
||||
|
||||
@@ -69,5 +69,6 @@ public interface ConfigAssayMethodMapper extends BaseMapperX<ConfigAssayMethodDO
|
||||
.eqIfPresent(ConfigAssayMethodDO::getVersion, reqVO.getVersion())
|
||||
.orderByDesc(ConfigAssayMethodDO::getId));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -6,6 +6,9 @@ import com.zt.plat.module.qms.business.config.controller.vo.*;
|
||||
import com.zt.plat.module.qms.business.config.controller.vo.ConfigBaseSamplePageReqVO;
|
||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigBaseSampleDO;
|
||||
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
@@ -31,5 +34,10 @@ public interface ConfigBaseSampleMapper extends BaseMapperX<ConfigBaseSampleDO>
|
||||
.eqIfPresent(ConfigBaseSampleDO::getVersion, reqVO.getVersion())
|
||||
.orderByDesc(ConfigBaseSampleDO::getId));
|
||||
}
|
||||
|
||||
default List<ConfigBaseSampleDO> selectByBaseSampleIds(List<Long> baseSampleIds) {
|
||||
return selectList(new LambdaQueryWrapperX<ConfigBaseSampleDO>()
|
||||
.in(ConfigBaseSampleDO::getBaseSampleId, baseSampleIds));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.zt.plat.module.qms.business.config.dal.mapper;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.zt.plat.module.qms.business.config.controller.vo.ConfigEntrustSourceSampleTypePageReqVO;
|
||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigEntrustSourceSampleTypeDO;
|
||||
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 检验委托来源与样品类型配置 Mapper
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@Mapper
|
||||
public interface ConfigEntrustSourceSampleTypeMapper extends BaseMapperX<ConfigEntrustSourceSampleTypeDO> {
|
||||
|
||||
default PageResult<ConfigEntrustSourceSampleTypeDO> selectPage(ConfigEntrustSourceSampleTypePageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<ConfigEntrustSourceSampleTypeDO>()
|
||||
.eqIfPresent(ConfigEntrustSourceSampleTypeDO::getConfigEntrustSourceId, reqVO.getConfigEntrustSourceId())
|
||||
.eqIfPresent(ConfigEntrustSourceSampleTypeDO::getDictionaryBusinessId, reqVO.getDictionaryBusinessId())
|
||||
.eqIfPresent(ConfigEntrustSourceSampleTypeDO::getDictionaryBusinessKey, reqVO.getDictionaryBusinessKey())
|
||||
.eqIfPresent(ConfigEntrustSourceSampleTypeDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
|
||||
.betweenIfPresent(ConfigEntrustSourceSampleTypeDO::getCreateTime, reqVO.getCreateTime())
|
||||
.eqIfPresent(ConfigEntrustSourceSampleTypeDO::getRemark, reqVO.getRemark())
|
||||
.orderByDesc(ConfigEntrustSourceSampleTypeDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -51,4 +51,9 @@ public interface ConfigSampleReportMapper extends BaseMapperX<ConfigSampleReport
|
||||
.eqIfPresent(ConfigSampleReportDO::getVersion, reqVO.getVersion())
|
||||
.orderByDesc(ConfigSampleReportDO::getId));
|
||||
}
|
||||
|
||||
default List<ConfigSampleReportDO> selectByConfigBaseSampleIds(List<Long> configBaseSampleIds) {
|
||||
return selectList(new LambdaQueryWrapperX<ConfigSampleReportDO>()
|
||||
.in(ConfigSampleReportDO::getConfigBaseSampleId, configBaseSampleIds));
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,9 @@ import com.zt.plat.module.qms.business.config.controller.vo.*;
|
||||
import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSamplePageReqVO;
|
||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSubSampleDO;
|
||||
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
@@ -39,5 +42,10 @@ public interface ConfigSubSampleMapper extends BaseMapperX<ConfigSubSampleDO> {
|
||||
.eqIfPresent(ConfigSubSampleDO::getVersion, reqVO.getVersion())
|
||||
.orderByDesc(ConfigSubSampleDO::getId));
|
||||
}
|
||||
|
||||
default List<ConfigSubSampleDO> selectByBaseSampleIds(List<Long> baseSampleIds) {
|
||||
return selectList(new LambdaQueryWrapperX<ConfigSubSampleDO>()
|
||||
.in(ConfigSubSampleDO::getBaseSampleId, baseSampleIds));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -59,5 +59,10 @@ public interface ConfigSubSampleMethodMapper extends BaseMapperX<ConfigSubSample
|
||||
.in(ConfigSubSampleMethodDO::getConfigSubSampleId, configSubSampleIds)
|
||||
.eq(ConfigSubSampleMethodDO::getConfigAssayMethodId, configAssayMethodId));
|
||||
}
|
||||
|
||||
default List<ConfigSubSampleMethodDO> selectByConfigSubSampleIds(List<Long> configSubSampleIds) {
|
||||
return selectList(new LambdaQueryWrapper<ConfigSubSampleMethodDO>()
|
||||
.in(ConfigSubSampleMethodDO::getConfigSubSampleId, configSubSampleIds));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -6,6 +6,9 @@ import com.zt.plat.module.qms.business.config.controller.vo.*;
|
||||
import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSampleParentPageReqVO;
|
||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSubSampleParentDO;
|
||||
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
@@ -30,5 +33,10 @@ public interface ConfigSubSampleParentMapper extends BaseMapperX<ConfigSubSample
|
||||
.eqIfPresent(ConfigSubSampleParentDO::getVersion, reqVO.getVersion())
|
||||
.orderByDesc(ConfigSubSampleParentDO::getId));
|
||||
}
|
||||
|
||||
default List<ConfigSubSampleParentDO> selectByBaseSampleIds(List<Long> baseSampleIds) {
|
||||
return selectList(new LambdaQueryWrapperX<ConfigSubSampleParentDO>()
|
||||
.in(ConfigSubSampleParentDO::getBaseSampleId, baseSampleIds));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -63,4 +63,11 @@ public interface BaseSampleService {
|
||||
*/
|
||||
PageResult<BaseSampleDO> getBaseSamplePage(BaseSamplePageReqVO pageReqVO);
|
||||
|
||||
/**
|
||||
* 获得样品大类管理列表
|
||||
* @param reqVO
|
||||
* @return
|
||||
*/
|
||||
List<BaseSampleRespVO> getBaseSampleList(BaseSamplePageReqVO reqVO);
|
||||
|
||||
}
|
||||
@@ -92,4 +92,9 @@ public class BaseSampleServiceImpl implements BaseSampleService {
|
||||
return baseSampleMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BaseSampleRespVO> getBaseSampleList(BaseSamplePageReqVO reqVO) {
|
||||
return baseSampleMapper.selectList(reqVO);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.zt.plat.module.qms.business.config.service;
|
||||
|
||||
import java.util.*;
|
||||
import jakarta.validation.*;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.module.qms.business.config.controller.vo.*;
|
||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigEntrustSourceSampleTypeDO;
|
||||
|
||||
/**
|
||||
* 检验委托来源与样品类型配置 Service 接口
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
public interface ConfigEntrustSourceSampleTypeService {
|
||||
|
||||
/**
|
||||
* 创建检验委托来源与样品类型配置
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
ConfigEntrustSourceSampleTypeRespVO createConfigEntrustSourceSampleType(@Valid ConfigEntrustSourceSampleTypeSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新检验委托来源与样品类型配置
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateConfigEntrustSourceSampleType(@Valid ConfigEntrustSourceSampleTypeSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除检验委托来源与样品类型配置
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteConfigEntrustSourceSampleType(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除检验委托来源与样品类型配置
|
||||
*
|
||||
* @param ids 编号
|
||||
*/
|
||||
void deleteConfigEntrustSourceSampleTypeListByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 获得检验委托来源与样品类型配置
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 检验委托来源与样品类型配置
|
||||
*/
|
||||
ConfigEntrustSourceSampleTypeDO getConfigEntrustSourceSampleType(Long id);
|
||||
|
||||
/**
|
||||
* 获得检验委托来源与样品类型配置分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 检验委托来源与样品类型配置分页
|
||||
*/
|
||||
PageResult<ConfigEntrustSourceSampleTypeDO> getConfigEntrustSourceSampleTypePage(ConfigEntrustSourceSampleTypePageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
package com.zt.plat.module.qms.business.config.service;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import org.springframework.stereotype.Service;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
import com.zt.plat.module.qms.business.config.controller.vo.*;
|
||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigEntrustSourceSampleTypeDO;
|
||||
import com.zt.plat.module.qms.business.config.dal.mapper.ConfigEntrustSourceSampleTypeMapper;
|
||||
|
||||
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList;
|
||||
import static com.zt.plat.framework.common.util.collection.CollectionUtils.diffList;
|
||||
import static com.zt.plat.module.qms.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 检验委托来源与样品类型配置 Service 实现类
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class ConfigEntrustSourceSampleTypeServiceImpl implements ConfigEntrustSourceSampleTypeService {
|
||||
|
||||
@Resource
|
||||
private ConfigEntrustSourceSampleTypeMapper configEntrustSourceSampleTypeMapper;
|
||||
|
||||
@Override
|
||||
public ConfigEntrustSourceSampleTypeRespVO createConfigEntrustSourceSampleType(ConfigEntrustSourceSampleTypeSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
ConfigEntrustSourceSampleTypeDO configEntrustSourceSampleType = BeanUtils.toBean(createReqVO, ConfigEntrustSourceSampleTypeDO.class);
|
||||
configEntrustSourceSampleTypeMapper.insert(configEntrustSourceSampleType);
|
||||
// 返回
|
||||
return BeanUtils.toBean(configEntrustSourceSampleType, ConfigEntrustSourceSampleTypeRespVO.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateConfigEntrustSourceSampleType(ConfigEntrustSourceSampleTypeSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateConfigEntrustSourceSampleTypeExists(updateReqVO.getId());
|
||||
// 更新
|
||||
ConfigEntrustSourceSampleTypeDO updateObj = BeanUtils.toBean(updateReqVO, ConfigEntrustSourceSampleTypeDO.class);
|
||||
configEntrustSourceSampleTypeMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteConfigEntrustSourceSampleType(Long id) {
|
||||
// 校验存在
|
||||
validateConfigEntrustSourceSampleTypeExists(id);
|
||||
// 删除
|
||||
configEntrustSourceSampleTypeMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteConfigEntrustSourceSampleTypeListByIds(List<Long> ids) {
|
||||
// 校验存在
|
||||
validateConfigEntrustSourceSampleTypeExists(ids);
|
||||
// 删除
|
||||
configEntrustSourceSampleTypeMapper.deleteByIds(ids);
|
||||
}
|
||||
|
||||
private void validateConfigEntrustSourceSampleTypeExists(List<Long> ids) {
|
||||
List<ConfigEntrustSourceSampleTypeDO> list = configEntrustSourceSampleTypeMapper.selectByIds(ids);
|
||||
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
|
||||
throw exception(CONFIG_ENTRUST_SOURCE_SAMPLE_TYPE_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
private void validateConfigEntrustSourceSampleTypeExists(Long id) {
|
||||
if (configEntrustSourceSampleTypeMapper.selectById(id) == null) {
|
||||
throw exception(CONFIG_ENTRUST_SOURCE_SAMPLE_TYPE_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConfigEntrustSourceSampleTypeDO getConfigEntrustSourceSampleType(Long id) {
|
||||
return configEntrustSourceSampleTypeMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<ConfigEntrustSourceSampleTypeDO> getConfigEntrustSourceSampleTypePage(ConfigEntrustSourceSampleTypePageReqVO pageReqVO) {
|
||||
return configEntrustSourceSampleTypeMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,119 @@
|
||||
package com.zt.plat.module.qms.office.supplier.controller.admin;
|
||||
|
||||
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierPageReqVO;
|
||||
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierRespVO;
|
||||
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierSaveReqVO;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import com.zt.plat.framework.business.interceptor.BusinessControllerMarker;
|
||||
import com.zt.plat.framework.business.annotation.FileUploadController;
|
||||
import com.zt.plat.framework.business.controller.AbstractFileUploadController;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO;
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import com.zt.plat.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import com.zt.plat.module.qms.office.supplier.controller.vo.*;
|
||||
import com.zt.plat.module.qms.office.supplier.dal.dataobject.SupplierDO;
|
||||
import com.zt.plat.module.qms.office.supplier.service.SupplierService;
|
||||
|
||||
@Tag(name = "管理后台 - 供应商")
|
||||
@RestController
|
||||
@RequestMapping("/qms/supplier")
|
||||
@Validated
|
||||
@FileUploadController(source = "qms.supplier")
|
||||
public class SupplierController extends AbstractFileUploadController implements BusinessControllerMarker{
|
||||
|
||||
static {
|
||||
FileUploadController annotation = SupplierController.class.getAnnotation(FileUploadController.class);
|
||||
if (annotation != null) {
|
||||
setFileUploadInfo(annotation);
|
||||
}
|
||||
}
|
||||
|
||||
@Resource
|
||||
private SupplierService supplierService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建供应商")
|
||||
@PreAuthorize("@ss.hasPermission('qms:supplier:create')")
|
||||
public CommonResult<SupplierRespVO> createSupplier(@Valid @RequestBody SupplierSaveReqVO createReqVO) {
|
||||
return success(supplierService.createSupplier(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新供应商")
|
||||
@PreAuthorize("@ss.hasPermission('qms:supplier:update')")
|
||||
public CommonResult<Boolean> updateSupplier(@Valid @RequestBody SupplierSaveReqVO updateReqVO) {
|
||||
supplierService.updateSupplier(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除供应商")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('qms:supplier:delete')")
|
||||
public CommonResult<Boolean> deleteSupplier(@RequestParam("id") Long id) {
|
||||
supplierService.deleteSupplier(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除供应商")
|
||||
@PreAuthorize("@ss.hasPermission('qms:supplier:delete')")
|
||||
public CommonResult<Boolean> deleteSupplierList(@RequestBody BatchDeleteReqVO req) {
|
||||
supplierService.deleteSupplierListByIds(req.getIds());
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得供应商")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('qms:supplier:query')")
|
||||
public CommonResult<SupplierRespVO> getSupplier(@RequestParam("id") Long id) {
|
||||
SupplierDO supplier = supplierService.getSupplier(id);
|
||||
return success(BeanUtils.toBean(supplier, SupplierRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得供应商分页")
|
||||
@PreAuthorize("@ss.hasPermission('qms:supplier:query')")
|
||||
public CommonResult<PageResult<SupplierRespVO>> getSupplierPage(@Valid SupplierPageReqVO pageReqVO) {
|
||||
PageResult<SupplierDO> pageResult = supplierService.getSupplierPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, SupplierRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出供应商 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('qms:supplier:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportSupplierExcel(@Valid SupplierPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<SupplierDO> list = supplierService.getSupplierPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "供应商.xls", "数据", SupplierRespVO.class,
|
||||
BeanUtils.toBean(list, SupplierRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
package com.zt.plat.module.qms.office.supplier.controller.admin;
|
||||
|
||||
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationAtPageReqVO;
|
||||
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationAtRespVO;
|
||||
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationAtSaveReqVO;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import com.zt.plat.framework.business.interceptor.BusinessControllerMarker;
|
||||
import com.zt.plat.framework.business.annotation.FileUploadController;
|
||||
import com.zt.plat.framework.business.controller.AbstractFileUploadController;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO;
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import com.zt.plat.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import com.zt.plat.module.qms.office.supplier.dal.dataobject.SupplierEvaluationAtDO;
|
||||
import com.zt.plat.module.qms.office.supplier.service.SupplierEvaluationAtService;
|
||||
|
||||
@Tag(name = "管理后台 - 供应商评价关系")
|
||||
@RestController
|
||||
@RequestMapping("/qms/supplier-evaluation-at")
|
||||
@Validated
|
||||
@FileUploadController(source = "qms.supplierevaluationat")
|
||||
public class SupplierEvaluationAtController extends AbstractFileUploadController implements BusinessControllerMarker{
|
||||
|
||||
static {
|
||||
FileUploadController annotation = SupplierEvaluationAtController.class.getAnnotation(FileUploadController.class);
|
||||
if (annotation != null) {
|
||||
setFileUploadInfo(annotation);
|
||||
}
|
||||
}
|
||||
|
||||
@Resource
|
||||
private SupplierEvaluationAtService supplierEvaluationAtService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建供应商评价关系")
|
||||
@PreAuthorize("@ss.hasPermission('qms:supplier-evaluation-at:create')")
|
||||
public CommonResult<SupplierEvaluationAtRespVO> createSupplierEvaluationAt(@Valid @RequestBody SupplierEvaluationAtSaveReqVO createReqVO) {
|
||||
return success(supplierEvaluationAtService.createSupplierEvaluationAt(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新供应商评价关系")
|
||||
@PreAuthorize("@ss.hasPermission('qms:supplier-evaluation-at:update')")
|
||||
public CommonResult<Boolean> updateSupplierEvaluationAt(@Valid @RequestBody SupplierEvaluationAtSaveReqVO updateReqVO) {
|
||||
supplierEvaluationAtService.updateSupplierEvaluationAt(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除供应商评价关系")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('qms:supplier-evaluation-at:delete')")
|
||||
public CommonResult<Boolean> deleteSupplierEvaluationAt(@RequestParam("id") Long id) {
|
||||
supplierEvaluationAtService.deleteSupplierEvaluationAt(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除供应商评价关系")
|
||||
@PreAuthorize("@ss.hasPermission('qms:supplier-evaluation-at:delete')")
|
||||
public CommonResult<Boolean> deleteSupplierEvaluationAtList(@RequestBody BatchDeleteReqVO req) {
|
||||
supplierEvaluationAtService.deleteSupplierEvaluationAtListByIds(req.getIds());
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得供应商评价关系")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('qms:supplier-evaluation-at:query')")
|
||||
public CommonResult<SupplierEvaluationAtRespVO> getSupplierEvaluationAt(@RequestParam("id") Long id) {
|
||||
SupplierEvaluationAtDO supplierEvaluationAt = supplierEvaluationAtService.getSupplierEvaluationAt(id);
|
||||
return success(BeanUtils.toBean(supplierEvaluationAt, SupplierEvaluationAtRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得供应商评价关系分页")
|
||||
@PreAuthorize("@ss.hasPermission('qms:supplier-evaluation-at:query')")
|
||||
public CommonResult<PageResult<SupplierEvaluationAtRespVO>> getSupplierEvaluationAtPage(@Valid SupplierEvaluationAtPageReqVO pageReqVO) {
|
||||
PageResult<SupplierEvaluationAtDO> pageResult = supplierEvaluationAtService.getSupplierEvaluationAtPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, SupplierEvaluationAtRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出供应商评价关系 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('qms:supplier-evaluation-at:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportSupplierEvaluationAtExcel(@Valid SupplierEvaluationAtPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<SupplierEvaluationAtDO> list = supplierEvaluationAtService.getSupplierEvaluationAtPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "供应商评价关系.xls", "数据", SupplierEvaluationAtRespVO.class,
|
||||
BeanUtils.toBean(list, SupplierEvaluationAtRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
package com.zt.plat.module.qms.office.supplier.controller.admin;
|
||||
|
||||
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationPageReqVO;
|
||||
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationRespVO;
|
||||
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationSaveReqVO;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import com.zt.plat.framework.business.interceptor.BusinessControllerMarker;
|
||||
import com.zt.plat.framework.business.annotation.FileUploadController;
|
||||
import com.zt.plat.framework.business.controller.AbstractFileUploadController;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO;
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import com.zt.plat.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import com.zt.plat.module.qms.office.supplier.dal.dataobject.SupplierEvaluationDO;
|
||||
import com.zt.plat.module.qms.office.supplier.service.SupplierEvaluationService;
|
||||
|
||||
@Tag(name = "管理后台 - 供应商评价")
|
||||
@RestController
|
||||
@RequestMapping("/qms/supplier-evaluation")
|
||||
@Validated
|
||||
@FileUploadController(source = "qms.supplierevaluation")
|
||||
public class SupplierEvaluationController extends AbstractFileUploadController implements BusinessControllerMarker{
|
||||
|
||||
static {
|
||||
FileUploadController annotation = SupplierEvaluationController.class.getAnnotation(FileUploadController.class);
|
||||
if (annotation != null) {
|
||||
setFileUploadInfo(annotation);
|
||||
}
|
||||
}
|
||||
|
||||
@Resource
|
||||
private SupplierEvaluationService supplierEvaluationService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建供应商评价")
|
||||
@PreAuthorize("@ss.hasPermission('qms:supplier-evaluation:create')")
|
||||
public CommonResult<SupplierEvaluationRespVO> createSupplierEvaluation(@Valid @RequestBody SupplierEvaluationSaveReqVO createReqVO) {
|
||||
return success(supplierEvaluationService.createSupplierEvaluation(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新供应商评价")
|
||||
@PreAuthorize("@ss.hasPermission('qms:supplier-evaluation:update')")
|
||||
public CommonResult<Boolean> updateSupplierEvaluation(@Valid @RequestBody SupplierEvaluationSaveReqVO updateReqVO) {
|
||||
supplierEvaluationService.updateSupplierEvaluation(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除供应商评价")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('qms:supplier-evaluation:delete')")
|
||||
public CommonResult<Boolean> deleteSupplierEvaluation(@RequestParam("id") Long id) {
|
||||
supplierEvaluationService.deleteSupplierEvaluation(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除供应商评价")
|
||||
@PreAuthorize("@ss.hasPermission('qms:supplier-evaluation:delete')")
|
||||
public CommonResult<Boolean> deleteSupplierEvaluationList(@RequestBody BatchDeleteReqVO req) {
|
||||
supplierEvaluationService.deleteSupplierEvaluationListByIds(req.getIds());
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得供应商评价")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('qms:supplier-evaluation:query')")
|
||||
public CommonResult<SupplierEvaluationRespVO> getSupplierEvaluation(@RequestParam("id") Long id) {
|
||||
SupplierEvaluationDO supplierEvaluation = supplierEvaluationService.getSupplierEvaluation(id);
|
||||
return success(BeanUtils.toBean(supplierEvaluation, SupplierEvaluationRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得供应商评价分页")
|
||||
@PreAuthorize("@ss.hasPermission('qms:supplier-evaluation:query')")
|
||||
public CommonResult<PageResult<SupplierEvaluationRespVO>> getSupplierEvaluationPage(@Valid SupplierEvaluationPageReqVO pageReqVO) {
|
||||
PageResult<SupplierEvaluationDO> pageResult = supplierEvaluationService.getSupplierEvaluationPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, SupplierEvaluationRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出供应商评价 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('qms:supplier-evaluation:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportSupplierEvaluationExcel(@Valid SupplierEvaluationPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<SupplierEvaluationDO> list = supplierEvaluationService.getSupplierEvaluationPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "供应商评价.xls", "数据", SupplierEvaluationRespVO.class,
|
||||
BeanUtils.toBean(list, SupplierEvaluationRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
package com.zt.plat.module.qms.office.supplier.controller.admin;
|
||||
|
||||
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierPropertiesPageReqVO;
|
||||
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierPropertiesRespVO;
|
||||
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierPropertiesSaveReqVO;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import com.zt.plat.framework.business.interceptor.BusinessControllerMarker;
|
||||
import com.zt.plat.framework.business.annotation.FileUploadController;
|
||||
import com.zt.plat.framework.business.controller.AbstractFileUploadController;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO;
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import com.zt.plat.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import com.zt.plat.module.qms.office.supplier.dal.dataobject.SupplierPropertiesDO;
|
||||
import com.zt.plat.module.qms.office.supplier.service.SupplierPropertiesService;
|
||||
|
||||
@Tag(name = "管理后台 - 供应商属性")
|
||||
@RestController
|
||||
@RequestMapping("/qms/supplier-properties")
|
||||
@Validated
|
||||
@FileUploadController(source = "qms.supplierproperties")
|
||||
public class SupplierPropertiesController extends AbstractFileUploadController implements BusinessControllerMarker{
|
||||
|
||||
static {
|
||||
FileUploadController annotation = SupplierPropertiesController.class.getAnnotation(FileUploadController.class);
|
||||
if (annotation != null) {
|
||||
setFileUploadInfo(annotation);
|
||||
}
|
||||
}
|
||||
|
||||
@Resource
|
||||
private SupplierPropertiesService supplierPropertiesService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建供应商属性")
|
||||
@PreAuthorize("@ss.hasPermission('qms:supplier-properties:create')")
|
||||
public CommonResult<SupplierPropertiesRespVO> createSupplierProperties(@Valid @RequestBody SupplierPropertiesSaveReqVO createReqVO) {
|
||||
return success(supplierPropertiesService.createSupplierProperties(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新供应商属性")
|
||||
@PreAuthorize("@ss.hasPermission('qms:supplier-properties:update')")
|
||||
public CommonResult<Boolean> updateSupplierProperties(@Valid @RequestBody SupplierPropertiesSaveReqVO updateReqVO) {
|
||||
supplierPropertiesService.updateSupplierProperties(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除供应商属性")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('qms:supplier-properties:delete')")
|
||||
public CommonResult<Boolean> deleteSupplierProperties(@RequestParam("id") Long id) {
|
||||
supplierPropertiesService.deleteSupplierProperties(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除供应商属性")
|
||||
@PreAuthorize("@ss.hasPermission('qms:supplier-properties:delete')")
|
||||
public CommonResult<Boolean> deleteSupplierPropertiesList(@RequestBody BatchDeleteReqVO req) {
|
||||
supplierPropertiesService.deleteSupplierPropertiesListByIds(req.getIds());
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得供应商属性")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('qms:supplier-properties:query')")
|
||||
public CommonResult<SupplierPropertiesRespVO> getSupplierProperties(@RequestParam("id") Long id) {
|
||||
SupplierPropertiesDO supplierProperties = supplierPropertiesService.getSupplierProperties(id);
|
||||
return success(BeanUtils.toBean(supplierProperties, SupplierPropertiesRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得供应商属性分页")
|
||||
@PreAuthorize("@ss.hasPermission('qms:supplier-properties:query')")
|
||||
public CommonResult<PageResult<SupplierPropertiesRespVO>> getSupplierPropertiesPage(@Valid SupplierPropertiesPageReqVO pageReqVO) {
|
||||
PageResult<SupplierPropertiesDO> pageResult = supplierPropertiesService.getSupplierPropertiesPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, SupplierPropertiesRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出供应商属性 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('qms:supplier-properties:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportSupplierPropertiesExcel(@Valid SupplierPropertiesPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<SupplierPropertiesDO> list = supplierPropertiesService.getSupplierPropertiesPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "供应商属性.xls", "数据", SupplierPropertiesRespVO.class,
|
||||
BeanUtils.toBean(list, SupplierPropertiesRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.zt.plat.module.qms.office.supplier.controller.vo;
|
||||
|
||||
import lombok.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 供应商评价关系分页 Request VO")
|
||||
@Data
|
||||
public class SupplierEvaluationAtPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "评价id", example = "6160")
|
||||
private Long supplierEvaluationId;
|
||||
|
||||
@Schema(description = "目标对象id", example = "24374")
|
||||
private Long targetId;
|
||||
|
||||
@Schema(description = "目标对象类型,业务类型:设备实例、物料试剂、检定校准记录等", example = "2")
|
||||
private String targetType;
|
||||
|
||||
@Schema(description = "所属部门")
|
||||
private String systemDepartmentCode;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.zt.plat.module.qms.office.supplier.controller.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 供应商评价关系 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class SupplierEvaluationAtRespVO {
|
||||
|
||||
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "2684")
|
||||
@ExcelProperty("ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "评价id", requiredMode = Schema.RequiredMode.REQUIRED, example = "6160")
|
||||
@ExcelProperty("评价id")
|
||||
private Long supplierEvaluationId;
|
||||
|
||||
@Schema(description = "目标对象id", requiredMode = Schema.RequiredMode.REQUIRED, example = "24374")
|
||||
@ExcelProperty("目标对象id")
|
||||
private Long targetId;
|
||||
|
||||
@Schema(description = "目标对象类型,业务类型:设备实例、物料试剂、检定校准记录等", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@ExcelProperty("目标对象类型,业务类型:设备实例、物料试剂、检定校准记录等")
|
||||
private String targetType;
|
||||
|
||||
@Schema(description = "所属部门")
|
||||
@ExcelProperty("所属部门")
|
||||
private String systemDepartmentCode;
|
||||
|
||||
@Schema(description = "备注")
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.zt.plat.module.qms.office.supplier.controller.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 供应商评价关系新增/修改 Request VO")
|
||||
@Data
|
||||
public class SupplierEvaluationAtSaveReqVO {
|
||||
|
||||
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "2684")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "评价id", requiredMode = Schema.RequiredMode.REQUIRED, example = "6160")
|
||||
@NotNull(message = "评价id不能为空")
|
||||
private Long supplierEvaluationId;
|
||||
|
||||
@Schema(description = "目标对象id", requiredMode = Schema.RequiredMode.REQUIRED, example = "24374")
|
||||
@NotNull(message = "目标对象id不能为空")
|
||||
private Long targetId;
|
||||
|
||||
@Schema(description = "目标对象类型,业务类型:设备实例、物料试剂、检定校准记录等", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@NotEmpty(message = "目标对象类型,业务类型:设备实例、物料试剂、检定校准记录等不能为空")
|
||||
private String targetType;
|
||||
|
||||
@Schema(description = "所属部门")
|
||||
private String systemDepartmentCode;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.zt.plat.module.qms.office.supplier.controller.vo;
|
||||
|
||||
import lombok.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 供应商评价分页 Request VO")
|
||||
@Data
|
||||
public class SupplierEvaluationPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "供应商ID", example = "3346")
|
||||
private Long supplierId;
|
||||
|
||||
@Schema(description = "表单模板id", example = "32304")
|
||||
private Long formId;
|
||||
|
||||
@Schema(description = "评价内容")
|
||||
private String content;
|
||||
|
||||
@Schema(description = "评价结论")
|
||||
private String conclusion;
|
||||
|
||||
@Schema(description = "评价人")
|
||||
private String evaluator;
|
||||
|
||||
@Schema(description = "评价人id", example = "25943")
|
||||
private Long evaluatorId;
|
||||
|
||||
@Schema(description = "评价日期")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] evaluationDate;
|
||||
|
||||
@Schema(description = "流程审批状态", example = "2")
|
||||
private String flowStatus;
|
||||
|
||||
@Schema(description = "流程实例id", example = "24931")
|
||||
private String flowInstanceId;
|
||||
|
||||
@Schema(description = "所属部门")
|
||||
private String systemDepartmentCode;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package com.zt.plat.module.qms.office.supplier.controller.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 供应商评价 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class SupplierEvaluationRespVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "31678")
|
||||
@ExcelProperty("主键")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "供应商ID", example = "3346")
|
||||
@ExcelProperty("供应商ID")
|
||||
private Long supplierId;
|
||||
|
||||
@Schema(description = "表单模板id", example = "32304")
|
||||
@ExcelProperty("表单模板id")
|
||||
private Long formId;
|
||||
|
||||
@Schema(description = "评价内容")
|
||||
@ExcelProperty("评价内容")
|
||||
private String content;
|
||||
|
||||
@Schema(description = "评价结论")
|
||||
@ExcelProperty("评价结论")
|
||||
private String conclusion;
|
||||
|
||||
@Schema(description = "评价人")
|
||||
@ExcelProperty("评价人")
|
||||
private String evaluator;
|
||||
|
||||
@Schema(description = "评价人id", example = "25943")
|
||||
@ExcelProperty("评价人id")
|
||||
private Long evaluatorId;
|
||||
|
||||
@Schema(description = "评价日期")
|
||||
@ExcelProperty("评价日期")
|
||||
private LocalDateTime evaluationDate;
|
||||
|
||||
@Schema(description = "流程审批状态", example = "2")
|
||||
@ExcelProperty("流程审批状态")
|
||||
private String flowStatus;
|
||||
|
||||
@Schema(description = "流程实例id", example = "24931")
|
||||
@ExcelProperty("流程实例id")
|
||||
private String flowInstanceId;
|
||||
|
||||
@Schema(description = "所属部门")
|
||||
@ExcelProperty("所属部门")
|
||||
private String systemDepartmentCode;
|
||||
|
||||
@Schema(description = "备注")
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.zt.plat.module.qms.office.supplier.controller.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 供应商评价新增/修改 Request VO")
|
||||
@Data
|
||||
public class SupplierEvaluationSaveReqVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "31678")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "供应商ID", example = "3346")
|
||||
private Long supplierId;
|
||||
|
||||
@Schema(description = "表单模板id", example = "32304")
|
||||
private Long formId;
|
||||
|
||||
@Schema(description = "评价内容")
|
||||
private String content;
|
||||
|
||||
@Schema(description = "评价结论")
|
||||
private String conclusion;
|
||||
|
||||
@Schema(description = "评价人")
|
||||
private String evaluator;
|
||||
|
||||
@Schema(description = "评价人id", example = "25943")
|
||||
private Long evaluatorId;
|
||||
|
||||
@Schema(description = "评价日期")
|
||||
private LocalDateTime evaluationDate;
|
||||
|
||||
@Schema(description = "流程审批状态", example = "2")
|
||||
private String flowStatus;
|
||||
|
||||
@Schema(description = "流程实例id", example = "24931")
|
||||
private String flowInstanceId;
|
||||
|
||||
@Schema(description = "所属部门")
|
||||
private String systemDepartmentCode;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.zt.plat.module.qms.office.supplier.controller.vo;
|
||||
|
||||
import lombok.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 供应商分页 Request VO")
|
||||
@Data
|
||||
public class SupplierPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "供应商名称", example = "张三")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "编号")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "类型", example = "1")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "地址")
|
||||
private String address;
|
||||
|
||||
@Schema(description = "联系人")
|
||||
private String contact;
|
||||
|
||||
@Schema(description = "电话")
|
||||
private String mobile;
|
||||
|
||||
@Schema(description = "经营范围")
|
||||
private String businessScope;
|
||||
|
||||
@Schema(description = "禁用标识")
|
||||
private String cancelFlag;
|
||||
|
||||
@Schema(description = "所属部门")
|
||||
private String systemDepartmentCode;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package com.zt.plat.module.qms.office.supplier.controller.vo;
|
||||
|
||||
import lombok.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 供应商属性分页 Request VO")
|
||||
@Data
|
||||
public class SupplierPropertiesPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "供应商ID", example = "31214")
|
||||
private Long supplierId;
|
||||
|
||||
@Schema(description = "业务类型,【字典】【jy_supplier_bsn_type】供应商类型、资质、证照等", example = "1")
|
||||
private String businessType;
|
||||
|
||||
@Schema(description = "业务编码")
|
||||
private String businessCode;
|
||||
|
||||
@Schema(description = "子业务编码")
|
||||
private String subitemCode;
|
||||
|
||||
@Schema(description = "名称", example = "王五")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "有效期开始")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] startDate;
|
||||
|
||||
@Schema(description = "有效期截止")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] endDate;
|
||||
|
||||
@Schema(description = "所属部门")
|
||||
private String systemDepartmentCode;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
package com.zt.plat.module.qms.office.supplier.controller.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 供应商属性 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class SupplierPropertiesRespVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "22878")
|
||||
@ExcelProperty("主键")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "供应商ID", example = "31214")
|
||||
@ExcelProperty("供应商ID")
|
||||
private Long supplierId;
|
||||
|
||||
@Schema(description = "业务类型,【字典】【jy_supplier_bsn_type】供应商类型、资质、证照等", example = "1")
|
||||
@ExcelProperty("业务类型,【字典】【jy_supplier_bsn_type】供应商类型、资质、证照等")
|
||||
private String businessType;
|
||||
|
||||
@Schema(description = "业务编码")
|
||||
@ExcelProperty("业务编码")
|
||||
private String businessCode;
|
||||
|
||||
@Schema(description = "子业务编码")
|
||||
@ExcelProperty("子业务编码")
|
||||
private String subitemCode;
|
||||
|
||||
@Schema(description = "名称", example = "王五")
|
||||
@ExcelProperty("名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "有效期开始")
|
||||
@ExcelProperty("有效期开始")
|
||||
private LocalDateTime startDate;
|
||||
|
||||
@Schema(description = "有效期截止")
|
||||
@ExcelProperty("有效期截止")
|
||||
private LocalDateTime endDate;
|
||||
|
||||
@Schema(description = "所属部门")
|
||||
@ExcelProperty("所属部门")
|
||||
private String systemDepartmentCode;
|
||||
|
||||
@Schema(description = "备注")
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.zt.plat.module.qms.office.supplier.controller.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 供应商属性新增/修改 Request VO")
|
||||
@Data
|
||||
public class SupplierPropertiesSaveReqVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "22878")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "供应商ID", example = "31214")
|
||||
private Long supplierId;
|
||||
|
||||
@Schema(description = "业务类型,【字典】【jy_supplier_bsn_type】供应商类型、资质、证照等", example = "1")
|
||||
private String businessType;
|
||||
|
||||
@Schema(description = "业务编码")
|
||||
private String businessCode;
|
||||
|
||||
@Schema(description = "子业务编码")
|
||||
private String subitemCode;
|
||||
|
||||
@Schema(description = "名称", example = "王五")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "有效期开始")
|
||||
private LocalDateTime startDate;
|
||||
|
||||
@Schema(description = "有效期截止")
|
||||
private LocalDateTime endDate;
|
||||
|
||||
@Schema(description = "所属部门")
|
||||
private String systemDepartmentCode;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.zt.plat.module.qms.office.supplier.controller.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 供应商 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class SupplierRespVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "15586")
|
||||
@ExcelProperty("主键")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "供应商名称", example = "张三")
|
||||
@ExcelProperty("供应商名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "编号")
|
||||
@ExcelProperty("编号")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "类型", example = "1")
|
||||
@ExcelProperty("类型")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "地址")
|
||||
@ExcelProperty("地址")
|
||||
private String address;
|
||||
|
||||
@Schema(description = "联系人")
|
||||
@ExcelProperty("联系人")
|
||||
private String contact;
|
||||
|
||||
@Schema(description = "电话")
|
||||
@ExcelProperty("电话")
|
||||
private String mobile;
|
||||
|
||||
@Schema(description = "经营范围")
|
||||
@ExcelProperty("经营范围")
|
||||
private String businessScope;
|
||||
|
||||
@Schema(description = "禁用标识")
|
||||
@ExcelProperty("禁用标识")
|
||||
private String cancelFlag;
|
||||
|
||||
@Schema(description = "所属部门")
|
||||
@ExcelProperty("所属部门")
|
||||
private String systemDepartmentCode;
|
||||
|
||||
@Schema(description = "备注")
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.zt.plat.module.qms.office.supplier.controller.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
@Schema(description = "管理后台 - 供应商新增/修改 Request VO")
|
||||
@Data
|
||||
public class SupplierSaveReqVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "15586")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "供应商名称", example = "张三")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "编号")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "类型", example = "1")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "地址")
|
||||
private String address;
|
||||
|
||||
@Schema(description = "联系人")
|
||||
private String contact;
|
||||
|
||||
@Schema(description = "电话")
|
||||
private String mobile;
|
||||
|
||||
@Schema(description = "经营范围")
|
||||
private String businessScope;
|
||||
|
||||
@Schema(description = "禁用标识")
|
||||
private String cancelFlag;
|
||||
|
||||
@Schema(description = "所属部门")
|
||||
private String systemDepartmentCode;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
package com.zt.plat.module.qms.office.supplier.dal.dataobject;
|
||||
|
||||
import lombok.*;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
|
||||
/**
|
||||
* 供应商 DO
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@TableName("t_splr")
|
||||
@KeySequence("t_splr_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
/**
|
||||
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||
*/
|
||||
public class SupplierDO extends BusinessBaseDO {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
/**
|
||||
* 供应商名称
|
||||
*/
|
||||
@TableField("NAME")
|
||||
private String name;
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@TableField("CD")
|
||||
private String code;
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
@TableField("TP")
|
||||
private String type;
|
||||
/**
|
||||
* 地址
|
||||
*/
|
||||
@TableField("ADR")
|
||||
private String address;
|
||||
/**
|
||||
* 联系人
|
||||
*/
|
||||
@TableField("CTCT")
|
||||
private String contact;
|
||||
/**
|
||||
* 电话
|
||||
*/
|
||||
@TableField("MOB")
|
||||
private String mobile;
|
||||
/**
|
||||
* 经营范围
|
||||
*/
|
||||
@TableField("BSN_SCO")
|
||||
private String businessScope;
|
||||
|
||||
//禁用标识
|
||||
@TableField("CNL_FLG")
|
||||
private String cancelFlag;
|
||||
/**
|
||||
* 所属部门
|
||||
*/
|
||||
@TableField("SYS_DEPT_CD")
|
||||
private String systemDepartmentCode;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@TableField("RMK")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.zt.plat.module.qms.office.supplier.dal.dataobject;
|
||||
|
||||
import lombok.*;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
|
||||
/**
|
||||
* 供应商评价关系 DO
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@TableName("t_splr_evl_at")
|
||||
@KeySequence("t_splr_evl_at_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
/**
|
||||
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||
*/
|
||||
public class SupplierEvaluationAtDO extends BusinessBaseDO {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
/**
|
||||
* 评价id
|
||||
*/
|
||||
@TableField("SPLR_EVL_ID")
|
||||
private Long supplierEvaluationId;
|
||||
/**
|
||||
* 目标对象id
|
||||
*/
|
||||
@TableField("TGT_ID")
|
||||
private Long targetId;
|
||||
/**
|
||||
* 目标对象类型,业务类型:设备实例、物料试剂、检定校准记录等
|
||||
*/
|
||||
@TableField("TGT_TP")
|
||||
private String targetType;
|
||||
/**
|
||||
* 所属部门
|
||||
*/
|
||||
@TableField("SYS_DEPT_CD")
|
||||
private String systemDepartmentCode;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@TableField("RMK")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
package com.zt.plat.module.qms.office.supplier.dal.dataobject;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
|
||||
/**
|
||||
* 供应商评价 DO
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@TableName("t_splr_evl")
|
||||
@KeySequence("t_splr_evl_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
/**
|
||||
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||
*/
|
||||
public class SupplierEvaluationDO extends BusinessBaseDO {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
/**
|
||||
* 供应商ID
|
||||
*/
|
||||
@TableField("SPLR_ID")
|
||||
private Long supplierId;
|
||||
/**
|
||||
* 表单模板id
|
||||
*/
|
||||
@TableField("FORM_ID")
|
||||
private Long formId;
|
||||
/**
|
||||
* 评价内容
|
||||
*/
|
||||
@TableField("CNTT")
|
||||
private String content;
|
||||
/**
|
||||
* 评价结论
|
||||
*/
|
||||
@TableField("CNCL")
|
||||
private String conclusion;
|
||||
/**
|
||||
* 评价人
|
||||
*/
|
||||
@TableField("EVLR")
|
||||
private String evaluator;
|
||||
/**
|
||||
* 评价人id
|
||||
*/
|
||||
@TableField("EVLR_ID")
|
||||
private Long evaluatorId;
|
||||
/**
|
||||
* 评价日期
|
||||
*/
|
||||
@TableField("EVL_DT")
|
||||
private LocalDateTime evaluationDate;
|
||||
/**
|
||||
* 流程审批状态
|
||||
*/
|
||||
@TableField("FLW_STS")
|
||||
private String flowStatus;
|
||||
/**
|
||||
* 流程实例id
|
||||
*/
|
||||
@TableField("FLW_INSC_ID")
|
||||
private String flowInstanceId;
|
||||
/**
|
||||
* 所属部门
|
||||
*/
|
||||
@TableField("SYS_DEPT_CD")
|
||||
private String systemDepartmentCode;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@TableField("RMK")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
package com.zt.plat.module.qms.office.supplier.dal.dataobject;
|
||||
|
||||
import lombok.*;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 供应商属性 DO
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@TableName("t_splr_prps")
|
||||
@KeySequence("t_splr_prps_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
/**
|
||||
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||
*/
|
||||
public class SupplierPropertiesDO extends BusinessBaseDO {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
/**
|
||||
* 供应商ID
|
||||
*/
|
||||
@TableField("SPLR_ID")
|
||||
private Long supplierId;
|
||||
/**
|
||||
* 业务类型,【字典】【jy_supplier_bsn_type】供应商类型、资质、证照等
|
||||
*/
|
||||
@TableField("BSN_TP")
|
||||
private String businessType;
|
||||
/**
|
||||
* 业务编码
|
||||
*/
|
||||
@TableField("BSN_CD")
|
||||
private String businessCode;
|
||||
/**
|
||||
* 子业务编码
|
||||
*/
|
||||
@TableField("SUB_CD")
|
||||
private String subitemCode;
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@TableField("NAME")
|
||||
private String name;
|
||||
/**
|
||||
* 有效期开始
|
||||
*/
|
||||
@TableField("STRT_DT")
|
||||
private LocalDateTime startDate;
|
||||
/**
|
||||
* 有效期截止
|
||||
*/
|
||||
@TableField("END_DT")
|
||||
private LocalDateTime endDate;
|
||||
/**
|
||||
* 所属部门
|
||||
*/
|
||||
@TableField("SYS_DEPT_CD")
|
||||
private String systemDepartmentCode;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@TableField("RMK")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.zt.plat.module.qms.office.supplier.dal.mapper;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.zt.plat.module.qms.office.supplier.dal.dataobject.SupplierEvaluationAtDO;
|
||||
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationAtPageReqVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 供应商评价关系 Mapper
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@Mapper
|
||||
public interface SupplierEvaluationAtMapper extends BaseMapperX<SupplierEvaluationAtDO> {
|
||||
|
||||
default PageResult<SupplierEvaluationAtDO> selectPage(SupplierEvaluationAtPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<SupplierEvaluationAtDO>()
|
||||
.eqIfPresent(SupplierEvaluationAtDO::getSupplierEvaluationId, reqVO.getSupplierEvaluationId())
|
||||
.eqIfPresent(SupplierEvaluationAtDO::getTargetId, reqVO.getTargetId())
|
||||
.eqIfPresent(SupplierEvaluationAtDO::getTargetType, reqVO.getTargetType())
|
||||
.eqIfPresent(SupplierEvaluationAtDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
|
||||
.eqIfPresent(SupplierEvaluationAtDO::getRemark, reqVO.getRemark())
|
||||
.betweenIfPresent(SupplierEvaluationAtDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(SupplierEvaluationAtDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.zt.plat.module.qms.office.supplier.dal.mapper;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.zt.plat.module.qms.office.supplier.dal.dataobject.SupplierEvaluationDO;
|
||||
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationPageReqVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 供应商评价 Mapper
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@Mapper
|
||||
public interface SupplierEvaluationMapper extends BaseMapperX<SupplierEvaluationDO> {
|
||||
|
||||
default PageResult<SupplierEvaluationDO> selectPage(SupplierEvaluationPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<SupplierEvaluationDO>()
|
||||
.eqIfPresent(SupplierEvaluationDO::getSupplierId, reqVO.getSupplierId())
|
||||
.eqIfPresent(SupplierEvaluationDO::getFormId, reqVO.getFormId())
|
||||
.eqIfPresent(SupplierEvaluationDO::getContent, reqVO.getContent())
|
||||
.eqIfPresent(SupplierEvaluationDO::getConclusion, reqVO.getConclusion())
|
||||
.eqIfPresent(SupplierEvaluationDO::getEvaluator, reqVO.getEvaluator())
|
||||
.eqIfPresent(SupplierEvaluationDO::getEvaluatorId, reqVO.getEvaluatorId())
|
||||
.betweenIfPresent(SupplierEvaluationDO::getEvaluationDate, reqVO.getEvaluationDate())
|
||||
.eqIfPresent(SupplierEvaluationDO::getFlowStatus, reqVO.getFlowStatus())
|
||||
.eqIfPresent(SupplierEvaluationDO::getFlowInstanceId, reqVO.getFlowInstanceId())
|
||||
.eqIfPresent(SupplierEvaluationDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
|
||||
.eqIfPresent(SupplierEvaluationDO::getRemark, reqVO.getRemark())
|
||||
.betweenIfPresent(SupplierEvaluationDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(SupplierEvaluationDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.zt.plat.module.qms.office.supplier.dal.mapper;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.zt.plat.module.qms.office.supplier.dal.dataobject.SupplierDO;
|
||||
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierPageReqVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 供应商 Mapper
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@Mapper
|
||||
public interface SupplierMapper extends BaseMapperX<SupplierDO> {
|
||||
|
||||
default PageResult<SupplierDO> selectPage(SupplierPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<SupplierDO>()
|
||||
.likeIfPresent(SupplierDO::getName, reqVO.getName())
|
||||
.eqIfPresent(SupplierDO::getCode, reqVO.getCode())
|
||||
.eqIfPresent(SupplierDO::getType, reqVO.getType())
|
||||
.eqIfPresent(SupplierDO::getAddress, reqVO.getAddress())
|
||||
.eqIfPresent(SupplierDO::getContact, reqVO.getContact())
|
||||
.eqIfPresent(SupplierDO::getMobile, reqVO.getMobile())
|
||||
.eqIfPresent(SupplierDO::getBusinessScope, reqVO.getBusinessScope())
|
||||
.eqIfPresent(SupplierDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
|
||||
.eqIfPresent(SupplierDO::getRemark, reqVO.getRemark())
|
||||
.betweenIfPresent(SupplierDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(SupplierDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.zt.plat.module.qms.office.supplier.dal.mapper;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.zt.plat.module.qms.office.supplier.dal.dataobject.SupplierPropertiesDO;
|
||||
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierPropertiesPageReqVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 供应商属性 Mapper
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@Mapper
|
||||
public interface SupplierPropertiesMapper extends BaseMapperX<SupplierPropertiesDO> {
|
||||
|
||||
default PageResult<SupplierPropertiesDO> selectPage(SupplierPropertiesPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<SupplierPropertiesDO>()
|
||||
.eqIfPresent(SupplierPropertiesDO::getSupplierId, reqVO.getSupplierId())
|
||||
.eqIfPresent(SupplierPropertiesDO::getBusinessType, reqVO.getBusinessType())
|
||||
.eqIfPresent(SupplierPropertiesDO::getBusinessCode, reqVO.getBusinessCode())
|
||||
.eqIfPresent(SupplierPropertiesDO::getSubitemCode, reqVO.getSubitemCode())
|
||||
.likeIfPresent(SupplierPropertiesDO::getName, reqVO.getName())
|
||||
.betweenIfPresent(SupplierPropertiesDO::getStartDate, reqVO.getStartDate())
|
||||
.betweenIfPresent(SupplierPropertiesDO::getEndDate, reqVO.getEndDate())
|
||||
.eqIfPresent(SupplierPropertiesDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
|
||||
.eqIfPresent(SupplierPropertiesDO::getRemark, reqVO.getRemark())
|
||||
.betweenIfPresent(SupplierPropertiesDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(SupplierPropertiesDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package com.zt.plat.module.qms.office.supplier.service;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationAtPageReqVO;
|
||||
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationAtRespVO;
|
||||
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationAtSaveReqVO;
|
||||
import jakarta.validation.*;
|
||||
import com.zt.plat.module.qms.office.supplier.dal.dataobject.SupplierEvaluationAtDO;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
|
||||
/**
|
||||
* 供应商评价关系 Service 接口
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
public interface SupplierEvaluationAtService {
|
||||
|
||||
/**
|
||||
* 创建供应商评价关系
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
SupplierEvaluationAtRespVO createSupplierEvaluationAt(@Valid SupplierEvaluationAtSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新供应商评价关系
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateSupplierEvaluationAt(@Valid SupplierEvaluationAtSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除供应商评价关系
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteSupplierEvaluationAt(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除供应商评价关系
|
||||
*
|
||||
* @param ids 编号
|
||||
*/
|
||||
void deleteSupplierEvaluationAtListByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 获得供应商评价关系
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 供应商评价关系
|
||||
*/
|
||||
SupplierEvaluationAtDO getSupplierEvaluationAt(Long id);
|
||||
|
||||
/**
|
||||
* 获得供应商评价关系分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 供应商评价关系分页
|
||||
*/
|
||||
PageResult<SupplierEvaluationAtDO> getSupplierEvaluationAtPage(SupplierEvaluationAtPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
package com.zt.plat.module.qms.office.supplier.service;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationAtPageReqVO;
|
||||
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationAtRespVO;
|
||||
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationAtSaveReqVO;
|
||||
import org.springframework.stereotype.Service;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.zt.plat.module.qms.office.supplier.dal.dataobject.SupplierEvaluationAtDO;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
|
||||
import com.zt.plat.module.qms.office.supplier.dal.mapper.SupplierEvaluationAtMapper;
|
||||
|
||||
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList;
|
||||
import static com.zt.plat.module.qms.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 供应商评价关系 Service 实现类
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class SupplierEvaluationAtServiceImpl implements SupplierEvaluationAtService {
|
||||
|
||||
@Resource
|
||||
private SupplierEvaluationAtMapper supplierEvaluationAtMapper;
|
||||
|
||||
@Override
|
||||
public SupplierEvaluationAtRespVO createSupplierEvaluationAt(SupplierEvaluationAtSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
SupplierEvaluationAtDO supplierEvaluationAt = BeanUtils.toBean(createReqVO, SupplierEvaluationAtDO.class);
|
||||
supplierEvaluationAtMapper.insert(supplierEvaluationAt);
|
||||
// 返回
|
||||
return BeanUtils.toBean(supplierEvaluationAt, SupplierEvaluationAtRespVO.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateSupplierEvaluationAt(SupplierEvaluationAtSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateSupplierEvaluationAtExists(updateReqVO.getId());
|
||||
// 更新
|
||||
SupplierEvaluationAtDO updateObj = BeanUtils.toBean(updateReqVO, SupplierEvaluationAtDO.class);
|
||||
supplierEvaluationAtMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteSupplierEvaluationAt(Long id) {
|
||||
// 校验存在
|
||||
validateSupplierEvaluationAtExists(id);
|
||||
// 删除
|
||||
supplierEvaluationAtMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteSupplierEvaluationAtListByIds(List<Long> ids) {
|
||||
// 校验存在
|
||||
validateSupplierEvaluationAtExists(ids);
|
||||
// 删除
|
||||
supplierEvaluationAtMapper.deleteByIds(ids);
|
||||
}
|
||||
|
||||
private void validateSupplierEvaluationAtExists(List<Long> ids) {
|
||||
List<SupplierEvaluationAtDO> list = supplierEvaluationAtMapper.selectByIds(ids);
|
||||
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
|
||||
throw exception(SUPPLIER_EVALUATION_AT_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
private void validateSupplierEvaluationAtExists(Long id) {
|
||||
if (supplierEvaluationAtMapper.selectById(id) == null) {
|
||||
throw exception(SUPPLIER_EVALUATION_AT_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public SupplierEvaluationAtDO getSupplierEvaluationAt(Long id) {
|
||||
return supplierEvaluationAtMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<SupplierEvaluationAtDO> getSupplierEvaluationAtPage(SupplierEvaluationAtPageReqVO pageReqVO) {
|
||||
return supplierEvaluationAtMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package com.zt.plat.module.qms.office.supplier.service;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationPageReqVO;
|
||||
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationRespVO;
|
||||
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationSaveReqVO;
|
||||
import jakarta.validation.*;
|
||||
import com.zt.plat.module.qms.office.supplier.dal.dataobject.SupplierEvaluationDO;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
|
||||
/**
|
||||
* 供应商评价 Service 接口
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
public interface SupplierEvaluationService {
|
||||
|
||||
/**
|
||||
* 创建供应商评价
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
SupplierEvaluationRespVO createSupplierEvaluation(@Valid SupplierEvaluationSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新供应商评价
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateSupplierEvaluation(@Valid SupplierEvaluationSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除供应商评价
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteSupplierEvaluation(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除供应商评价
|
||||
*
|
||||
* @param ids 编号
|
||||
*/
|
||||
void deleteSupplierEvaluationListByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 获得供应商评价
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 供应商评价
|
||||
*/
|
||||
SupplierEvaluationDO getSupplierEvaluation(Long id);
|
||||
|
||||
/**
|
||||
* 获得供应商评价分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 供应商评价分页
|
||||
*/
|
||||
PageResult<SupplierEvaluationDO> getSupplierEvaluationPage(SupplierEvaluationPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
package com.zt.plat.module.qms.office.supplier.service;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationPageReqVO;
|
||||
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationRespVO;
|
||||
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationSaveReqVO;
|
||||
import org.springframework.stereotype.Service;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.zt.plat.module.qms.office.supplier.dal.dataobject.SupplierEvaluationDO;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
|
||||
import com.zt.plat.module.qms.office.supplier.dal.mapper.SupplierEvaluationMapper;
|
||||
|
||||
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList;
|
||||
import static com.zt.plat.module.qms.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 供应商评价 Service 实现类
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class SupplierEvaluationServiceImpl implements SupplierEvaluationService {
|
||||
|
||||
@Resource
|
||||
private SupplierEvaluationMapper supplierEvaluationMapper;
|
||||
|
||||
@Override
|
||||
public SupplierEvaluationRespVO createSupplierEvaluation(SupplierEvaluationSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
SupplierEvaluationDO supplierEvaluation = BeanUtils.toBean(createReqVO, SupplierEvaluationDO.class);
|
||||
supplierEvaluationMapper.insert(supplierEvaluation);
|
||||
// 返回
|
||||
return BeanUtils.toBean(supplierEvaluation, SupplierEvaluationRespVO.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateSupplierEvaluation(SupplierEvaluationSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateSupplierEvaluationExists(updateReqVO.getId());
|
||||
// 更新
|
||||
SupplierEvaluationDO updateObj = BeanUtils.toBean(updateReqVO, SupplierEvaluationDO.class);
|
||||
supplierEvaluationMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteSupplierEvaluation(Long id) {
|
||||
// 校验存在
|
||||
validateSupplierEvaluationExists(id);
|
||||
// 删除
|
||||
supplierEvaluationMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteSupplierEvaluationListByIds(List<Long> ids) {
|
||||
// 校验存在
|
||||
validateSupplierEvaluationExists(ids);
|
||||
// 删除
|
||||
supplierEvaluationMapper.deleteByIds(ids);
|
||||
}
|
||||
|
||||
private void validateSupplierEvaluationExists(List<Long> ids) {
|
||||
List<SupplierEvaluationDO> list = supplierEvaluationMapper.selectByIds(ids);
|
||||
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
|
||||
throw exception(SUPPLIER_EVALUATION_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
private void validateSupplierEvaluationExists(Long id) {
|
||||
if (supplierEvaluationMapper.selectById(id) == null) {
|
||||
throw exception(SUPPLIER_EVALUATION_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public SupplierEvaluationDO getSupplierEvaluation(Long id) {
|
||||
return supplierEvaluationMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<SupplierEvaluationDO> getSupplierEvaluationPage(SupplierEvaluationPageReqVO pageReqVO) {
|
||||
return supplierEvaluationMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package com.zt.plat.module.qms.office.supplier.service;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierPropertiesPageReqVO;
|
||||
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierPropertiesRespVO;
|
||||
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierPropertiesSaveReqVO;
|
||||
import jakarta.validation.*;
|
||||
import com.zt.plat.module.qms.office.supplier.dal.dataobject.SupplierPropertiesDO;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
|
||||
/**
|
||||
* 供应商属性 Service 接口
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
public interface SupplierPropertiesService {
|
||||
|
||||
/**
|
||||
* 创建供应商属性
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
SupplierPropertiesRespVO createSupplierProperties(@Valid SupplierPropertiesSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新供应商属性
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateSupplierProperties(@Valid SupplierPropertiesSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除供应商属性
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteSupplierProperties(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除供应商属性
|
||||
*
|
||||
* @param ids 编号
|
||||
*/
|
||||
void deleteSupplierPropertiesListByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 获得供应商属性
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 供应商属性
|
||||
*/
|
||||
SupplierPropertiesDO getSupplierProperties(Long id);
|
||||
|
||||
/**
|
||||
* 获得供应商属性分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 供应商属性分页
|
||||
*/
|
||||
PageResult<SupplierPropertiesDO> getSupplierPropertiesPage(SupplierPropertiesPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
package com.zt.plat.module.qms.office.supplier.service;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierPropertiesPageReqVO;
|
||||
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierPropertiesRespVO;
|
||||
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierPropertiesSaveReqVO;
|
||||
import org.springframework.stereotype.Service;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.zt.plat.module.qms.office.supplier.dal.dataobject.SupplierPropertiesDO;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
|
||||
import com.zt.plat.module.qms.office.supplier.dal.mapper.SupplierPropertiesMapper;
|
||||
|
||||
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList;
|
||||
import static com.zt.plat.module.qms.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 供应商属性 Service 实现类
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class SupplierPropertiesServiceImpl implements SupplierPropertiesService {
|
||||
|
||||
@Resource
|
||||
private SupplierPropertiesMapper supplierPropertiesMapper;
|
||||
|
||||
@Override
|
||||
public SupplierPropertiesRespVO createSupplierProperties(SupplierPropertiesSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
SupplierPropertiesDO supplierProperties = BeanUtils.toBean(createReqVO, SupplierPropertiesDO.class);
|
||||
supplierPropertiesMapper.insert(supplierProperties);
|
||||
// 返回
|
||||
return BeanUtils.toBean(supplierProperties, SupplierPropertiesRespVO.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateSupplierProperties(SupplierPropertiesSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateSupplierPropertiesExists(updateReqVO.getId());
|
||||
// 更新
|
||||
SupplierPropertiesDO updateObj = BeanUtils.toBean(updateReqVO, SupplierPropertiesDO.class);
|
||||
supplierPropertiesMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteSupplierProperties(Long id) {
|
||||
// 校验存在
|
||||
validateSupplierPropertiesExists(id);
|
||||
// 删除
|
||||
supplierPropertiesMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteSupplierPropertiesListByIds(List<Long> ids) {
|
||||
// 校验存在
|
||||
validateSupplierPropertiesExists(ids);
|
||||
// 删除
|
||||
supplierPropertiesMapper.deleteByIds(ids);
|
||||
}
|
||||
|
||||
private void validateSupplierPropertiesExists(List<Long> ids) {
|
||||
List<SupplierPropertiesDO> list = supplierPropertiesMapper.selectByIds(ids);
|
||||
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
|
||||
throw exception(SUPPLIER_PROPERTIES_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
private void validateSupplierPropertiesExists(Long id) {
|
||||
if (supplierPropertiesMapper.selectById(id) == null) {
|
||||
throw exception(SUPPLIER_PROPERTIES_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public SupplierPropertiesDO getSupplierProperties(Long id) {
|
||||
return supplierPropertiesMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<SupplierPropertiesDO> getSupplierPropertiesPage(SupplierPropertiesPageReqVO pageReqVO) {
|
||||
return supplierPropertiesMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package com.zt.plat.module.qms.office.supplier.service;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierPageReqVO;
|
||||
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierRespVO;
|
||||
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierSaveReqVO;
|
||||
import jakarta.validation.*;
|
||||
import com.zt.plat.module.qms.office.supplier.dal.dataobject.SupplierDO;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
|
||||
/**
|
||||
* 供应商 Service 接口
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
public interface SupplierService {
|
||||
|
||||
/**
|
||||
* 创建供应商
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
SupplierRespVO createSupplier(@Valid SupplierSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新供应商
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateSupplier(@Valid SupplierSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除供应商
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteSupplier(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除供应商
|
||||
*
|
||||
* @param ids 编号
|
||||
*/
|
||||
void deleteSupplierListByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 获得供应商
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 供应商
|
||||
*/
|
||||
SupplierDO getSupplier(Long id);
|
||||
|
||||
/**
|
||||
* 获得供应商分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 供应商分页
|
||||
*/
|
||||
PageResult<SupplierDO> getSupplierPage(SupplierPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
package com.zt.plat.module.qms.office.supplier.service;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierPageReqVO;
|
||||
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierRespVO;
|
||||
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierSaveReqVO;
|
||||
import org.springframework.stereotype.Service;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.zt.plat.module.qms.office.supplier.dal.dataobject.SupplierDO;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
|
||||
import com.zt.plat.module.qms.office.supplier.dal.mapper.SupplierMapper;
|
||||
|
||||
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList;
|
||||
import static com.zt.plat.module.qms.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 供应商 Service 实现类
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class SupplierServiceImpl implements SupplierService {
|
||||
|
||||
@Resource
|
||||
private SupplierMapper supplierMapper;
|
||||
|
||||
@Override
|
||||
public SupplierRespVO createSupplier(SupplierSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
SupplierDO supplier = BeanUtils.toBean(createReqVO, SupplierDO.class);
|
||||
supplierMapper.insert(supplier);
|
||||
// 返回
|
||||
return BeanUtils.toBean(supplier, SupplierRespVO.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateSupplier(SupplierSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateSupplierExists(updateReqVO.getId());
|
||||
// 更新
|
||||
SupplierDO updateObj = BeanUtils.toBean(updateReqVO, SupplierDO.class);
|
||||
supplierMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteSupplier(Long id) {
|
||||
// 校验存在
|
||||
validateSupplierExists(id);
|
||||
// 删除
|
||||
supplierMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteSupplierListByIds(List<Long> ids) {
|
||||
// 校验存在
|
||||
validateSupplierExists(ids);
|
||||
// 删除
|
||||
supplierMapper.deleteByIds(ids);
|
||||
}
|
||||
|
||||
private void validateSupplierExists(List<Long> ids) {
|
||||
List<SupplierDO> list = supplierMapper.selectByIds(ids);
|
||||
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
|
||||
throw exception(SUPPLIER_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
private void validateSupplierExists(Long id) {
|
||||
if (supplierMapper.selectById(id) == null) {
|
||||
throw exception(SUPPLIER_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public SupplierDO getSupplier(Long id) {
|
||||
return supplierMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<SupplierDO> getSupplierPage(SupplierPageReqVO pageReqVO) {
|
||||
return supplierMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
package com.zt.plat.module.qms.resource.material.controller.admin;
|
||||
|
||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialBatchAssignPageReqVO;
|
||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialBatchAssignRespVO;
|
||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialBatchAssignSaveReqVO;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import com.zt.plat.framework.business.interceptor.BusinessControllerMarker;
|
||||
import com.zt.plat.framework.business.annotation.FileUploadController;
|
||||
import com.zt.plat.framework.business.controller.AbstractFileUploadController;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO;
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import 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.MaterialBatchAssignDO;
|
||||
import com.zt.plat.module.qms.resource.material.service.MaterialBatchAssignService;
|
||||
|
||||
@Tag(name = "管理后台 - 物料批次分发")
|
||||
@RestController
|
||||
@RequestMapping("/qms/material-batch-assign")
|
||||
@Validated
|
||||
@FileUploadController(source = "qms.materialbatchassign")
|
||||
public class MaterialBatchAssignController extends AbstractFileUploadController implements BusinessControllerMarker{
|
||||
|
||||
static {
|
||||
FileUploadController annotation = MaterialBatchAssignController.class.getAnnotation(FileUploadController.class);
|
||||
if (annotation != null) {
|
||||
setFileUploadInfo(annotation);
|
||||
}
|
||||
}
|
||||
|
||||
@Resource
|
||||
private MaterialBatchAssignService materialBatchAssignService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建物料批次分发")
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-batch-assign:create')")
|
||||
public CommonResult<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("/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));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
package com.zt.plat.module.qms.resource.material.controller.admin;
|
||||
|
||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialBatchPageReqVO;
|
||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialBatchRespVO;
|
||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialBatchSaveReqVO;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import com.zt.plat.framework.business.interceptor.BusinessControllerMarker;
|
||||
import com.zt.plat.framework.business.annotation.FileUploadController;
|
||||
import com.zt.plat.framework.business.controller.AbstractFileUploadController;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO;
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import com.zt.plat.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialBatchDO;
|
||||
import com.zt.plat.module.qms.resource.material.service.MaterialBatchService;
|
||||
|
||||
@Tag(name = "管理后台 - 物料批次")
|
||||
@RestController
|
||||
@RequestMapping("/qms/material-batch")
|
||||
@Validated
|
||||
@FileUploadController(source = "qms.materialbatch")
|
||||
public class MaterialBatchController extends AbstractFileUploadController implements BusinessControllerMarker{
|
||||
|
||||
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) {
|
||||
return success(materialBatchService.createMaterialBatch(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新物料批次")
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-batch:update')")
|
||||
public CommonResult<Boolean> updateMaterialBatch(@Valid @RequestBody MaterialBatchSaveReqVO updateReqVO) {
|
||||
materialBatchService.updateMaterialBatch(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除物料批次")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-batch:delete')")
|
||||
public CommonResult<Boolean> deleteMaterialBatch(@RequestParam("id") Long id) {
|
||||
materialBatchService.deleteMaterialBatch(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除物料批次")
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-batch:delete')")
|
||||
public CommonResult<Boolean> deleteMaterialBatchList(@RequestBody BatchDeleteReqVO req) {
|
||||
materialBatchService.deleteMaterialBatchListByIds(req.getIds());
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得物料批次")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-batch:query')")
|
||||
public CommonResult<MaterialBatchRespVO> getMaterialBatch(@RequestParam("id") Long id) {
|
||||
MaterialBatchDO materialBatch = materialBatchService.getMaterialBatch(id);
|
||||
return success(BeanUtils.toBean(materialBatch, MaterialBatchRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得物料批次分页")
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-batch:query')")
|
||||
public CommonResult<PageResult<MaterialBatchRespVO>> getMaterialBatchPage(@Valid MaterialBatchPageReqVO pageReqVO) {
|
||||
PageResult<MaterialBatchDO> pageResult = materialBatchService.getMaterialBatchPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, MaterialBatchRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出物料批次 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-batch:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportMaterialBatchExcel(@Valid MaterialBatchPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<MaterialBatchDO> list = materialBatchService.getMaterialBatchPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "物料批次.xls", "数据", MaterialBatchRespVO.class,
|
||||
BeanUtils.toBean(list, MaterialBatchRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
package com.zt.plat.module.qms.resource.material.controller.admin;
|
||||
|
||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryInboundPageReqVO;
|
||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryInboundRespVO;
|
||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryInboundSaveReqVO;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import com.zt.plat.framework.business.interceptor.BusinessControllerMarker;
|
||||
import com.zt.plat.framework.business.annotation.FileUploadController;
|
||||
import com.zt.plat.framework.business.controller.AbstractFileUploadController;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO;
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import com.zt.plat.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialInventoryInboundDO;
|
||||
import com.zt.plat.module.qms.resource.material.service.MaterialInventoryInboundService;
|
||||
|
||||
@Tag(name = "管理后台 - 入库")
|
||||
@RestController
|
||||
@RequestMapping("/qms/material-inventory-inbound")
|
||||
@Validated
|
||||
@FileUploadController(source = "qms.materialinventoryinbound")
|
||||
public class MaterialInventoryInboundController extends AbstractFileUploadController implements BusinessControllerMarker{
|
||||
|
||||
static {
|
||||
FileUploadController annotation = MaterialInventoryInboundController.class.getAnnotation(FileUploadController.class);
|
||||
if (annotation != null) {
|
||||
setFileUploadInfo(annotation);
|
||||
}
|
||||
}
|
||||
|
||||
@Resource
|
||||
private MaterialInventoryInboundService materialInventoryInboundService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建入库")
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-inventory-inbound:create')")
|
||||
public CommonResult<MaterialInventoryInboundRespVO> createMaterialInventoryInbound(@Valid @RequestBody MaterialInventoryInboundSaveReqVO createReqVO) {
|
||||
return success(materialInventoryInboundService.createMaterialInventoryInbound(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新入库")
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-inventory-inbound:update')")
|
||||
public CommonResult<Boolean> updateMaterialInventoryInbound(@Valid @RequestBody MaterialInventoryInboundSaveReqVO updateReqVO) {
|
||||
materialInventoryInboundService.updateMaterialInventoryInbound(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除入库")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-inventory-inbound:delete')")
|
||||
public CommonResult<Boolean> deleteMaterialInventoryInbound(@RequestParam("id") Long id) {
|
||||
materialInventoryInboundService.deleteMaterialInventoryInbound(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除入库")
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-inventory-inbound:delete')")
|
||||
public CommonResult<Boolean> deleteMaterialInventoryInboundList(@RequestBody BatchDeleteReqVO req) {
|
||||
materialInventoryInboundService.deleteMaterialInventoryInboundListByIds(req.getIds());
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得入库")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-inventory-inbound:query')")
|
||||
public CommonResult<MaterialInventoryInboundRespVO> getMaterialInventoryInbound(@RequestParam("id") Long id) {
|
||||
MaterialInventoryInboundDO materialInventoryInbound = materialInventoryInboundService.getMaterialInventoryInbound(id);
|
||||
return success(BeanUtils.toBean(materialInventoryInbound, MaterialInventoryInboundRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得入库分页")
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-inventory-inbound:query')")
|
||||
public CommonResult<PageResult<MaterialInventoryInboundRespVO>> getMaterialInventoryInboundPage(@Valid MaterialInventoryInboundPageReqVO pageReqVO) {
|
||||
PageResult<MaterialInventoryInboundDO> pageResult = materialInventoryInboundService.getMaterialInventoryInboundPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, MaterialInventoryInboundRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出入库 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-inventory-inbound:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportMaterialInventoryInboundExcel(@Valid MaterialInventoryInboundPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<MaterialInventoryInboundDO> list = materialInventoryInboundService.getMaterialInventoryInboundPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "入库.xls", "数据", MaterialInventoryInboundRespVO.class,
|
||||
BeanUtils.toBean(list, MaterialInventoryInboundRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
package com.zt.plat.module.qms.resource.material.controller.admin;
|
||||
|
||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryInboundDetailPageReqVO;
|
||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryInboundDetailRespVO;
|
||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryInboundDetailSaveReqVO;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import com.zt.plat.framework.business.interceptor.BusinessControllerMarker;
|
||||
import com.zt.plat.framework.business.annotation.FileUploadController;
|
||||
import com.zt.plat.framework.business.controller.AbstractFileUploadController;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO;
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import com.zt.plat.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialInventoryInboundDetailDO;
|
||||
import com.zt.plat.module.qms.resource.material.service.MaterialInventoryInboundDetailService;
|
||||
|
||||
@Tag(name = "管理后台 - 入库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等")
|
||||
@RestController
|
||||
@RequestMapping("/qms/material-inventory-inbound-detail")
|
||||
@Validated
|
||||
@FileUploadController(source = "qms.materialinventoryinbounddetail")
|
||||
public class MaterialInventoryInboundDetailController extends AbstractFileUploadController implements BusinessControllerMarker{
|
||||
|
||||
static {
|
||||
FileUploadController annotation = MaterialInventoryInboundDetailController.class.getAnnotation(FileUploadController.class);
|
||||
if (annotation != null) {
|
||||
setFileUploadInfo(annotation);
|
||||
}
|
||||
}
|
||||
|
||||
@Resource
|
||||
private MaterialInventoryInboundDetailService materialInventoryInboundDetailService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建入库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等")
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-inventory-inbound-detail:create')")
|
||||
public CommonResult<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));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得入库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等分页")
|
||||
@PreAuthorize("@ss.hasPermission('qms: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')")
|
||||
@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));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.zt.plat.module.qms.resource.material.controller.vo;
|
||||
|
||||
import lombok.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 物料批次分发分页 Request VO")
|
||||
@Data
|
||||
public class 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;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package com.zt.plat.module.qms.resource.material.controller.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 物料批次分发 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class MaterialBatchAssignRespVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "15114")
|
||||
@ExcelProperty("主键")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "源批次ID", example = "23099")
|
||||
@ExcelProperty("源批次ID")
|
||||
private Long batchId;
|
||||
|
||||
@Schema(description = "产品id", example = "10774")
|
||||
@ExcelProperty("产品id")
|
||||
private String productId;
|
||||
|
||||
@Schema(description = "库房ID", example = "24720")
|
||||
@ExcelProperty("库房ID")
|
||||
private Long warehouseId;
|
||||
|
||||
@Schema(description = "数量")
|
||||
@ExcelProperty("数量")
|
||||
private String inboundQuantity;
|
||||
|
||||
@Schema(description = "暂存位置记录", example = "https://www.iocoder.cn")
|
||||
@ExcelProperty("暂存位置记录")
|
||||
private String url;
|
||||
|
||||
@Schema(description = "所属部门")
|
||||
@ExcelProperty("所属部门")
|
||||
private String systemDepartmentCode;
|
||||
|
||||
@Schema(description = "备注")
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.zt.plat.module.qms.resource.material.controller.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
@Schema(description = "管理后台 - 物料批次分发新增/修改 Request VO")
|
||||
@Data
|
||||
public class MaterialBatchAssignSaveReqVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "15114")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "源批次ID", 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;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package com.zt.plat.module.qms.resource.material.controller.vo;
|
||||
|
||||
import lombok.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 物料批次分页 Request VO")
|
||||
@Data
|
||||
public class MaterialBatchPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "产品id", example = "16851")
|
||||
private Long productId;
|
||||
|
||||
@Schema(description = "批次编号")
|
||||
private String batchNo;
|
||||
|
||||
@Schema(description = "总数量")
|
||||
private String inboundQuantity;
|
||||
|
||||
@Schema(description = "存放位置描述")
|
||||
private String location;
|
||||
|
||||
@Schema(description = "供应商id", example = "6956")
|
||||
private Long supplierId;
|
||||
|
||||
@Schema(description = "生产日期")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] manufacturerDate;
|
||||
|
||||
@Schema(description = "到期日期")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] dueDate;
|
||||
|
||||
@Schema(description = "验收状态", example = "1")
|
||||
private String acceptanceStatus;
|
||||
|
||||
@Schema(description = "所属部门")
|
||||
private String systemDepartmentCode;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.zt.plat.module.qms.resource.material.controller.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 物料批次 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class MaterialBatchRespVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "25470")
|
||||
@ExcelProperty("主键")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "产品id", example = "16851")
|
||||
@ExcelProperty("产品id")
|
||||
private Long productId;
|
||||
|
||||
@Schema(description = "批次编号")
|
||||
@ExcelProperty("批次编号")
|
||||
private String batchNo;
|
||||
|
||||
@Schema(description = "总数量")
|
||||
@ExcelProperty("总数量")
|
||||
private String inboundQuantity;
|
||||
|
||||
@Schema(description = "存放位置描述")
|
||||
@ExcelProperty("存放位置描述")
|
||||
private String location;
|
||||
|
||||
@Schema(description = "供应商id", example = "6956")
|
||||
@ExcelProperty("供应商id")
|
||||
private Long supplierId;
|
||||
|
||||
@Schema(description = "生产日期")
|
||||
@ExcelProperty("生产日期")
|
||||
private LocalDateTime manufacturerDate;
|
||||
|
||||
@Schema(description = "到期日期")
|
||||
@ExcelProperty("到期日期")
|
||||
private LocalDateTime dueDate;
|
||||
|
||||
@Schema(description = "验收状态", example = "1")
|
||||
@ExcelProperty("验收状态")
|
||||
private String acceptanceStatus;
|
||||
|
||||
@Schema(description = "所属部门")
|
||||
@ExcelProperty("所属部门")
|
||||
private String systemDepartmentCode;
|
||||
|
||||
@Schema(description = "备注")
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.zt.plat.module.qms.resource.material.controller.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 物料批次新增/修改 Request VO")
|
||||
@Data
|
||||
public class MaterialBatchSaveReqVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "25470")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "产品id", example = "16851")
|
||||
private Long productId;
|
||||
|
||||
@Schema(description = "批次编号")
|
||||
private String batchNo;
|
||||
|
||||
@Schema(description = "总数量")
|
||||
private String inboundQuantity;
|
||||
|
||||
@Schema(description = "存放位置描述")
|
||||
private String location;
|
||||
|
||||
@Schema(description = "供应商id", example = "6956")
|
||||
private Long supplierId;
|
||||
|
||||
@Schema(description = "生产日期")
|
||||
private LocalDateTime manufacturerDate;
|
||||
|
||||
@Schema(description = "到期日期")
|
||||
private LocalDateTime dueDate;
|
||||
|
||||
@Schema(description = "验收状态", example = "1")
|
||||
private String acceptanceStatus;
|
||||
|
||||
@Schema(description = "所属部门")
|
||||
private String systemDepartmentCode;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.zt.plat.module.qms.resource.material.controller.vo;
|
||||
|
||||
import lombok.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 入库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等分页 Request VO")
|
||||
@Data
|
||||
public class MaterialInventoryInboundDetailPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "入库单ID", example = "8031")
|
||||
private Long inboundId;
|
||||
|
||||
@Schema(description = "分发批次id", example = "24731")
|
||||
private Long batchAssignId;
|
||||
|
||||
@Schema(description = "入库方式")
|
||||
private String inboundWay;
|
||||
|
||||
@Schema(description = "物料实例ID", example = "23510")
|
||||
private Long materialInfomationId;
|
||||
|
||||
@Schema(description = "入库人", example = "赵六")
|
||||
private String inboundUserName;
|
||||
|
||||
@Schema(description = "入库人id", example = "8857")
|
||||
private Long inboundUserId;
|
||||
|
||||
@Schema(description = "入库人部门", example = "芋艿")
|
||||
private String inboundDepartmentName;
|
||||
|
||||
@Schema(description = "入库人部门id", example = "8008")
|
||||
private Long inboundDepartmentId;
|
||||
|
||||
@Schema(description = "入库时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] inboundTime;
|
||||
|
||||
@Schema(description = "所属部门")
|
||||
private String systemDepartmentCode;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package com.zt.plat.module.qms.resource.material.controller.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 入库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class MaterialInventoryInboundDetailRespVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "20724")
|
||||
@ExcelProperty("主键")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "入库单ID", example = "8031")
|
||||
@ExcelProperty("入库单ID")
|
||||
private Long inboundId;
|
||||
|
||||
@Schema(description = "分发批次id", example = "24731")
|
||||
@ExcelProperty("分发批次id")
|
||||
private Long batchAssignId;
|
||||
|
||||
@Schema(description = "入库方式")
|
||||
@ExcelProperty("入库方式")
|
||||
private String inboundWay;
|
||||
|
||||
@Schema(description = "物料实例ID", example = "23510")
|
||||
@ExcelProperty("物料实例ID")
|
||||
private Long materialInfomationId;
|
||||
|
||||
@Schema(description = "入库人", example = "赵六")
|
||||
@ExcelProperty("入库人")
|
||||
private String inboundUserName;
|
||||
|
||||
@Schema(description = "入库人id", example = "8857")
|
||||
@ExcelProperty("入库人id")
|
||||
private Long inboundUserId;
|
||||
|
||||
@Schema(description = "入库人部门", example = "芋艿")
|
||||
@ExcelProperty("入库人部门")
|
||||
private String inboundDepartmentName;
|
||||
|
||||
@Schema(description = "入库人部门id", example = "8008")
|
||||
@ExcelProperty("入库人部门id")
|
||||
private Long inboundDepartmentId;
|
||||
|
||||
@Schema(description = "入库时间")
|
||||
@ExcelProperty("入库时间")
|
||||
private LocalDateTime inboundTime;
|
||||
|
||||
@Schema(description = "所属部门")
|
||||
@ExcelProperty("所属部门")
|
||||
private String systemDepartmentCode;
|
||||
|
||||
@Schema(description = "备注")
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.zt.plat.module.qms.resource.material.controller.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 入库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等新增/修改 Request VO")
|
||||
@Data
|
||||
public class MaterialInventoryInboundDetailSaveReqVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "20724")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "入库单ID", example = "8031")
|
||||
private Long inboundId;
|
||||
|
||||
@Schema(description = "分发批次id", example = "24731")
|
||||
private Long batchAssignId;
|
||||
|
||||
@Schema(description = "入库方式")
|
||||
private String inboundWay;
|
||||
|
||||
@Schema(description = "物料实例ID", example = "23510")
|
||||
private Long materialInfomationId;
|
||||
|
||||
@Schema(description = "入库人", example = "赵六")
|
||||
private String inboundUserName;
|
||||
|
||||
@Schema(description = "入库人id", example = "8857")
|
||||
private Long inboundUserId;
|
||||
|
||||
@Schema(description = "入库人部门", example = "芋艿")
|
||||
private String inboundDepartmentName;
|
||||
|
||||
@Schema(description = "入库人部门id", example = "8008")
|
||||
private Long inboundDepartmentId;
|
||||
|
||||
@Schema(description = "入库时间")
|
||||
private LocalDateTime inboundTime;
|
||||
|
||||
@Schema(description = "所属部门")
|
||||
private String systemDepartmentCode;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
package com.zt.plat.module.qms.resource.material.controller.vo;
|
||||
|
||||
import lombok.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 入库分页 Request VO")
|
||||
@Data
|
||||
public class MaterialInventoryInboundPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "标题")
|
||||
private String title;
|
||||
|
||||
@Schema(description = "业务类型1.验收上架,【字典】【jy_material_in_bsn_type】领用出库、盘亏出库、损坏出库等", example = "1")
|
||||
private String businessType;
|
||||
|
||||
@Schema(description = "业务类型编码")
|
||||
private String businessTypeCode;
|
||||
|
||||
@Schema(description = "申请人")
|
||||
private String applyUser;
|
||||
|
||||
@Schema(description = "申请人id", example = "30960")
|
||||
private Long applyUserId;
|
||||
|
||||
@Schema(description = "申请部门")
|
||||
private String applyDepartment;
|
||||
|
||||
@Schema(description = "申请部门id", example = "666")
|
||||
private Long applyDepartmentId;
|
||||
|
||||
@Schema(description = "申请时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] applyTime;
|
||||
|
||||
@Schema(description = "流程实例id", example = "654")
|
||||
private String flowInstanceId;
|
||||
|
||||
@Schema(description = "流程审批状态", example = "1")
|
||||
private String flowStatus;
|
||||
|
||||
@Schema(description = "意见json")
|
||||
private String commentJson;
|
||||
|
||||
@Schema(description = "所属部门")
|
||||
private String systemDepartmentCode;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
package com.zt.plat.module.qms.resource.material.controller.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 入库 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class MaterialInventoryInboundRespVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "15437")
|
||||
@ExcelProperty("主键")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "标题")
|
||||
@ExcelProperty("标题")
|
||||
private String title;
|
||||
|
||||
@Schema(description = "业务类型1.验收上架,【字典】【jy_material_in_bsn_type】领用出库、盘亏出库、损坏出库等", example = "1")
|
||||
@ExcelProperty("业务类型1.验收上架,【字典】【jy_material_in_bsn_type】领用出库、盘亏出库、损坏出库等")
|
||||
private String businessType;
|
||||
|
||||
@Schema(description = "业务类型编码")
|
||||
@ExcelProperty("业务类型编码")
|
||||
private String businessTypeCode;
|
||||
|
||||
@Schema(description = "申请人")
|
||||
@ExcelProperty("申请人")
|
||||
private String applyUser;
|
||||
|
||||
@Schema(description = "申请人id", example = "30960")
|
||||
@ExcelProperty("申请人id")
|
||||
private Long applyUserId;
|
||||
|
||||
@Schema(description = "申请部门")
|
||||
@ExcelProperty("申请部门")
|
||||
private String applyDepartment;
|
||||
|
||||
@Schema(description = "申请部门id", example = "666")
|
||||
@ExcelProperty("申请部门id")
|
||||
private Long applyDepartmentId;
|
||||
|
||||
@Schema(description = "申请时间")
|
||||
@ExcelProperty("申请时间")
|
||||
private LocalDateTime applyTime;
|
||||
|
||||
@Schema(description = "流程实例id", example = "654")
|
||||
@ExcelProperty("流程实例id")
|
||||
private String flowInstanceId;
|
||||
|
||||
@Schema(description = "流程审批状态", example = "1")
|
||||
@ExcelProperty("流程审批状态")
|
||||
private String flowStatus;
|
||||
|
||||
@Schema(description = "意见json")
|
||||
@ExcelProperty("意见json")
|
||||
private String commentJson;
|
||||
|
||||
@Schema(description = "所属部门")
|
||||
@ExcelProperty("所属部门")
|
||||
private String systemDepartmentCode;
|
||||
|
||||
@Schema(description = "备注")
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package com.zt.plat.module.qms.resource.material.controller.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 入库新增/修改 Request VO")
|
||||
@Data
|
||||
public class MaterialInventoryInboundSaveReqVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "15437")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "标题")
|
||||
private String title;
|
||||
|
||||
@Schema(description = "业务类型1.验收上架,【字典】【jy_material_in_bsn_type】领用出库、盘亏出库、损坏出库等", example = "1")
|
||||
private String businessType;
|
||||
|
||||
@Schema(description = "业务类型编码")
|
||||
private String businessTypeCode;
|
||||
|
||||
@Schema(description = "申请人")
|
||||
private String applyUser;
|
||||
|
||||
@Schema(description = "申请人id", example = "30960")
|
||||
private Long applyUserId;
|
||||
|
||||
@Schema(description = "申请部门")
|
||||
private String applyDepartment;
|
||||
|
||||
@Schema(description = "申请部门id", example = "666")
|
||||
private Long applyDepartmentId;
|
||||
|
||||
@Schema(description = "申请时间")
|
||||
private LocalDateTime applyTime;
|
||||
|
||||
@Schema(description = "流程实例id", example = "654")
|
||||
private String flowInstanceId;
|
||||
|
||||
@Schema(description = "流程审批状态", example = "1")
|
||||
private String flowStatus;
|
||||
|
||||
@Schema(description = "意见json")
|
||||
private String commentJson;
|
||||
|
||||
@Schema(description = "所属部门")
|
||||
private String systemDepartmentCode;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
package com.zt.plat.module.qms.resource.material.dal.dataobject;
|
||||
|
||||
import lombok.*;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
|
||||
/**
|
||||
* 物料批次分发 DO
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@TableName("t_mtrl_bat_asn")
|
||||
@KeySequence("t_mtrl_bat_asn_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
/**
|
||||
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||
*/
|
||||
public class MaterialBatchAssignDO extends BusinessBaseDO {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
/**
|
||||
* 源批次ID
|
||||
*/
|
||||
@TableField("BAT_ID")
|
||||
private Long batchId;
|
||||
/**
|
||||
* 产品id
|
||||
*/
|
||||
@TableField("PDT_ID")
|
||||
private String productId;
|
||||
/**
|
||||
* 库房ID
|
||||
*/
|
||||
@TableField("WRH_ID")
|
||||
private Long warehouseId;
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
@TableField("INB_QTY")
|
||||
private String inboundQuantity;
|
||||
/**
|
||||
* 暂存位置记录
|
||||
*/
|
||||
@TableField("URL")
|
||||
private String url;
|
||||
/**
|
||||
* 所属部门
|
||||
*/
|
||||
@TableField("SYS_DEPT_CD")
|
||||
private String systemDepartmentCode;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@TableField("RMK")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
package com.zt.plat.module.qms.resource.material.dal.dataobject;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
|
||||
/**
|
||||
* 物料批次 DO
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@TableName("t_mtrl_bat")
|
||||
@KeySequence("t_mtrl_bat_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
/**
|
||||
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||
*/
|
||||
public class MaterialBatchDO extends BusinessBaseDO {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
/**
|
||||
* 产品id
|
||||
*/
|
||||
@TableField("PDT_ID")
|
||||
private Long productId;
|
||||
/**
|
||||
* 批次编号
|
||||
*/
|
||||
@TableField("BAT_NO")
|
||||
private String batchNo;
|
||||
/**
|
||||
* 总数量
|
||||
*/
|
||||
@TableField("INB_QTY")
|
||||
private String inboundQuantity;
|
||||
/**
|
||||
* 存放位置描述
|
||||
*/
|
||||
@TableField("LOC")
|
||||
private String location;
|
||||
/**
|
||||
* 供应商id
|
||||
*/
|
||||
@TableField("SPLR_ID")
|
||||
private Long supplierId;
|
||||
/**
|
||||
* 生产日期
|
||||
*/
|
||||
@TableField("MFR_DT")
|
||||
private LocalDateTime manufacturerDate;
|
||||
/**
|
||||
* 到期日期
|
||||
*/
|
||||
@TableField("DUE_DT")
|
||||
private LocalDateTime dueDate;
|
||||
/**
|
||||
* 验收状态
|
||||
*/
|
||||
@TableField("ACPT_STS")
|
||||
private String acceptanceStatus;
|
||||
/**
|
||||
* 所属部门
|
||||
*/
|
||||
@TableField("SYS_DEPT_CD")
|
||||
private String systemDepartmentCode;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@TableField("RMK")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user