From e7f3458dccf410501e5c7019f851a3afdc255e1f Mon Sep 17 00:00:00 2001 From: FCD <2453864257@qq.com> Date: Wed, 26 Nov 2025 08:53:45 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E7=94=B5=E8=A1=A8=E6=95=B4=E7=82=B9?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=97=A0=E6=B3=95=E5=AF=BC=E5=87=BA=E5=92=8C?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/RecordDnbInstantServiceImpl.java | 6 +++--- .../resources/mapper/report/ReportPointDnbMapper.xml | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/op-modules/op-energy/src/main/java/com/op/energy/record/service/impl/RecordDnbInstantServiceImpl.java b/op-modules/op-energy/src/main/java/com/op/energy/record/service/impl/RecordDnbInstantServiceImpl.java index 256d06212..113588c0a 100644 --- a/op-modules/op-energy/src/main/java/com/op/energy/record/service/impl/RecordDnbInstantServiceImpl.java +++ b/op-modules/op-energy/src/main/java/com/op/energy/record/service/impl/RecordDnbInstantServiceImpl.java @@ -297,7 +297,6 @@ public class RecordDnbInstantServiceImpl implements IRecordDnbInstantService { String address = array.getJSONObject(i).getString("Address"); if (address.equals(item.getMonitorId())) { item.setGlys(getSafeBigDecimal(array.getJSONObject(i), "GLYS")); - item.setZxyg(getSafeBigDecimal(array.getJSONObject(i), "YGGL")); item.setActivePower(getSafeBigDecimal(array.getJSONObject(i), "YGGL")); item.setReactivePower(getSafeBigDecimal(array.getJSONObject(i), "WGGL")); } @@ -316,6 +315,7 @@ public class RecordDnbInstantServiceImpl implements IRecordDnbInstantService { for (RecordDnbInstant item : list) { String address = array.getJSONObject(i).getString("Address"); if (address.equals(item.getMonitorId())) { + item.setZxyg(getSafeBigDecimal(array.getJSONObject(i), "ZYGDNSZ")); item.setReactivePower(getSafeBigDecimal(array.getJSONObject(i), "ZYGDN")); } } @@ -329,8 +329,8 @@ public class RecordDnbInstantServiceImpl implements IRecordDnbInstantService { for (RecordDnbInstant item : list) { BaseMonitorInfo temp = new BaseMonitorInfo(); temp.setConnCode(item.getMonitorId()); - List BaseList = baseMonitorInfoMapper.selectBaseMonitorInfoList(temp); - for (BaseMonitorInfo base : BaseList) { + List baseList = baseMonitorInfoMapper.selectBaseMonitorInfoList(temp); + for (BaseMonitorInfo base : baseList) { item.setMonitorId(base.getMonitorId()); recordDnbInstantMapper.insertRecordDnbInstant(item); } diff --git a/op-modules/op-energy/src/main/resources/mapper/report/ReportPointDnbMapper.xml b/op-modules/op-energy/src/main/resources/mapper/report/ReportPointDnbMapper.xml index b61a9116f..7647cb861 100644 --- a/op-modules/op-energy/src/main/resources/mapper/report/ReportPointDnbMapper.xml +++ b/op-modules/op-energy/src/main/resources/mapper/report/ReportPointDnbMapper.xml @@ -179,21 +179,21 @@ order by ert.monitor_id, ert.monitor_name, ert.pointTime - + select ert.monitor_id monitorId, + ert.monitor_name monitorName, CAST( CASE WHEN #{params.timeSub} = 10 THEN ert.pointTime WHEN #{params.timeSub} = 7 THEN concat(ert.pointTime, '-01') WHEN #{params.timeSub} = 4 THEN concat(ert.pointTime, '-01-01') - END AS datetime) AS begin_time, + END AS datetime) AS beginTime, CAST( CASE WHEN #{params.timeSub} = 10 THEN ert.pointTime WHEN #{params.timeSub} = 7 THEN EOMONTH(CONVERT(DATE, CONCAT(ert.pointTime, '-01'))) WHEN #{params.timeSub} = 4 THEN EOMONTH(CONVERT(DATE, CONCAT(ert.pointTime, '-12-01'))) - END AS datetime) AS end_time, + END AS datetime) AS endTime, sum(isnull(ert.expend,0)) expend, - max(ert.meter_value) meter_value, + max(ert.meter_value) meterValue, max(ert.monitor_addr) address from ( select rpd.monitor_id, m.monitor_name, left(CONVERT(VARCHAR(19), rpd.begin_time, 120), #{params.timeSub}) pointTime, rpd.expend, From 17b94eec5a3587cfbda36f04edb28c397a015e97 Mon Sep 17 00:00:00 2001 From: FCD <2453864257@qq.com> Date: Wed, 26 Nov 2025 09:15:57 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=BA=93=E5=8C=BA=E5=A1=AB=E6=8A=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/op/system/api/RemoteSapService.java | 3 + .../api/domain/sap/SapMaterialEntry.java | 71 ++++++++ .../api/factory/RemoteSapFallbackFactory.java | 5 + .../com/op/sap/controller/SapController.java | 9 + .../com/op/sap/service/SapWmsService.java | 6 + .../sap/service/impl/SapWmsServicelmpl.java | 65 ++++++- .../controller/WmsToWCSmissionController.java | 20 +++ .../com/op/wms/domain/WmsStockAreaEntry.java | 159 ++++++++++++++++++ .../wms/mapper/OdsProcureOutOrderMapper.java | 11 +- .../wms/service/IOdsProcureOrderService.java | 4 + .../impl/OdsProcureOrderServiceImpl.java | 42 +++++ .../mapper/wms/OdsProcureOutOrderMapper.xml | 62 +++++++ 12 files changed, 449 insertions(+), 8 deletions(-) create mode 100644 op-api/op-api-system/src/main/java/com/op/system/api/domain/sap/SapMaterialEntry.java create mode 100644 op-modules/op-wms/src/main/java/com/op/wms/domain/WmsStockAreaEntry.java diff --git a/op-api/op-api-system/src/main/java/com/op/system/api/RemoteSapService.java b/op-api/op-api-system/src/main/java/com/op/system/api/RemoteSapService.java index 01133f13e..e35333810 100644 --- a/op-api/op-api-system/src/main/java/com/op/system/api/RemoteSapService.java +++ b/op-api/op-api-system/src/main/java/com/op/system/api/RemoteSapService.java @@ -156,6 +156,9 @@ public interface RemoteSapService { @PostMapping("/sap/handMadeInStorage") public R handMadeInStorage(@RequestBody List list); + @PostMapping("/sap/updateMaterialEntry") + R updateMaterialEntry(@RequestBody List list, @RequestParam("optionType") String optionType // 关键:指定value + ); } diff --git a/op-api/op-api-system/src/main/java/com/op/system/api/domain/sap/SapMaterialEntry.java b/op-api/op-api-system/src/main/java/com/op/system/api/domain/sap/SapMaterialEntry.java new file mode 100644 index 000000000..d9e74c6d8 --- /dev/null +++ b/op-api/op-api-system/src/main/java/com/op/system/api/domain/sap/SapMaterialEntry.java @@ -0,0 +1,71 @@ +package com.op.system.api.domain.sap; + +/** + * remark + * + * @author 019117 + * @date + */ +public class SapMaterialEntry { + + private String materialCode; + + + private String batchCode; + + private String factoryCode; + + private String areaCode; + + private String status; + + private String userCode; + + public String getMaterialCode() { + return materialCode; + } + + public void setMaterialCode(String materialCode) { + this.materialCode = materialCode; + } + + public String getBatchCode() { + return batchCode; + } + + public void setBatchCode(String batchCode) { + this.batchCode = batchCode; + } + + public String getFactoryCode() { + return factoryCode; + } + + public void setFactoryCode(String factoryCode) { + this.factoryCode = factoryCode; + } + + public String getAreaCode() { + return areaCode; + } + + public void setAreaCode(String areaCode) { + this.areaCode = areaCode; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public String getUserCode() { + return userCode; + } + + public void setUserCode(String userCode) { + this.userCode = userCode; + } +} diff --git a/op-api/op-api-system/src/main/java/com/op/system/api/factory/RemoteSapFallbackFactory.java b/op-api/op-api-system/src/main/java/com/op/system/api/factory/RemoteSapFallbackFactory.java index 0e15409a6..1def8ec25 100644 --- a/op-api/op-api-system/src/main/java/com/op/system/api/factory/RemoteSapFallbackFactory.java +++ b/op-api/op-api-system/src/main/java/com/op/system/api/factory/RemoteSapFallbackFactory.java @@ -193,6 +193,11 @@ public class RemoteSapFallbackFactory implements FallbackFactory list, String optionType) { + return R.fail("更新物料库位失败" + throwable.getMessage()); + } + }; } } diff --git a/op-modules/op-sap/src/main/java/com/op/sap/controller/SapController.java b/op-modules/op-sap/src/main/java/com/op/sap/controller/SapController.java index fccbe7843..b87c0d430 100644 --- a/op-modules/op-sap/src/main/java/com/op/sap/controller/SapController.java +++ b/op-modules/op-sap/src/main/java/com/op/sap/controller/SapController.java @@ -652,4 +652,13 @@ public class SapController extends BaseController { public R handMadeInStorage(@RequestBody List list) { return sapOrderService.handMadeInStorage(list); } + + /** + * 手持成品物料收货入库 + * **/ + @PostMapping("/updateMaterialEntry") + @Log(title = "物料库区填报", businessType = BusinessType.SAP) + public R updateMaterialEntry(@RequestBody List list, @RequestParam("optionType") String optionType) { + return sapWmsService.updateMaterialEntry(list, optionType); + } } diff --git a/op-modules/op-sap/src/main/java/com/op/sap/service/SapWmsService.java b/op-modules/op-sap/src/main/java/com/op/sap/service/SapWmsService.java index 6c9debd31..8afc9e00a 100644 --- a/op-modules/op-sap/src/main/java/com/op/sap/service/SapWmsService.java +++ b/op-modules/op-sap/src/main/java/com/op/sap/service/SapWmsService.java @@ -1,6 +1,10 @@ package com.op.sap.service; import com.op.common.core.domain.R; +import com.op.system.api.domain.sap.SapHandMadeInStorage; +import com.op.system.api.domain.sap.SapMaterialEntry; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestParam; import java.util.List; import java.util.Map; @@ -14,4 +18,6 @@ public interface SapWmsService { R sapProductOutboundCostCenter(List> mapList); R sapProductOutboundCostTW(List> mapList); + + R updateMaterialEntry(List list, String optionType) ; } diff --git a/op-modules/op-sap/src/main/java/com/op/sap/service/impl/SapWmsServicelmpl.java b/op-modules/op-sap/src/main/java/com/op/sap/service/impl/SapWmsServicelmpl.java index 10d7102c7..a932ea1d8 100644 --- a/op-modules/op-sap/src/main/java/com/op/sap/service/impl/SapWmsServicelmpl.java +++ b/op-modules/op-sap/src/main/java/com/op/sap/service/impl/SapWmsServicelmpl.java @@ -3,17 +3,17 @@ package com.op.sap.service.impl; import com.op.common.core.domain.R; import com.op.common.core.utils.StringUtils; import com.op.sap.service.SapWmsService; +import com.op.system.api.domain.sap.SapHandMadeInStorage; +import com.op.system.api.domain.sap.SapMaterialEntry; import com.sap.conn.jco.*; +import org.apache.commons.collections4.CollectionUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import org.springframework.stereotype.Service; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; @Component @Service @@ -318,4 +318,61 @@ public class SapWmsServicelmpl implements SapWmsService { return R.fail(e.getMessage()); } } + + @Override + public R updateMaterialEntry(List list, String optionType) { + + if (CollectionUtils.isEmpty(list)) { + throw new RuntimeException("参数list不存在,或长度为0"); + } + + if (StringUtils.isBlank(optionType)) { + throw new RuntimeException("没有指定读写操作"); + } + + try { + JCoRepository repository = dest.getRepository(); + JCoFunction sapFunction = repository.getFunction("ZMB_MODIFY_ZMMKW"); + + if ("1".equals(optionType)){ + sapFunction.getImportParameterList().setValue("P_WRITE", "X"); + } + if ("2".equals(optionType)){ + sapFunction.getImportParameterList().setValue("P_DELETE", "X"); + } + + Date now = new Date(); + + JCoTable table = sapFunction.getTableParameterList().getTable("IN_ZMMKW"); + for (SapMaterialEntry item : list) { + table.appendRow(); + //物料编码 + table.setValue("MATNR", "0000000" + item.getMaterialCode()); + //批次 + table.setValue("CHARG", item.getBatchCode()); + //工厂 + table.setValue("WERKS", item.getFactoryCode()); + //区位 + table.setValue("ABLAD", item.getAreaCode()); + //状态 + table.setValue("ZTYPE", item.getStatus()); + //修改人 + table.setValue("ZNAME", item.getUserCode()); + //修改日期 + table.setValue("ZMDDAT", now); + } + + sapFunction.execute(dest); + String code = sapFunction.getExportParameterList().getString("RETCODE"); + String msg = sapFunction.getExportParameterList().getString("RETMSG"); + if (!"0".equals(code)) { + throw new Exception("提交物料库区填报失败:"+msg); + } + return R.ok(); + }catch (Exception e){ + e.printStackTrace(); + log.error(e.getMessage()); + return R.fail(e.getMessage()); + } + } } diff --git a/op-modules/op-wms/src/main/java/com/op/wms/controller/WmsToWCSmissionController.java b/op-modules/op-wms/src/main/java/com/op/wms/controller/WmsToWCSmissionController.java index d344411ce..8a7c28a67 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/controller/WmsToWCSmissionController.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/controller/WmsToWCSmissionController.java @@ -4,6 +4,7 @@ package com.op.wms.controller; import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder; import com.op.common.core.domain.R; +import com.op.common.core.utils.JwtUtils; import com.op.common.core.utils.StringUtils; import com.op.common.core.utils.uuid.IdUtils; import com.op.common.core.web.domain.AjaxResult; @@ -1004,4 +1005,23 @@ public class WmsToWCSmissionController { String result = odsProcureOrderService.upbatCardXNew(order); return success(result); } + + /** + * 查询需要填写的成品 + * **/ + @GetMapping("/wmsStockAreaEntryList") + public AjaxResult getStockAreaEntryList(WmsStockAreaEntry params) { + List list = odsProcureOrderService.getStockAreaEntryList(params); + return AjaxResult.success(list); + } + + /** + * 提交成品入库 + * **/ + @PostMapping("/submitMaterialEntry") + public AjaxResult submitMaterialEntry(@RequestBody List list) { + odsProcureOrderService.submitMaterialEntry(list); + return AjaxResult.success(); + } + } diff --git a/op-modules/op-wms/src/main/java/com/op/wms/domain/WmsStockAreaEntry.java b/op-modules/op-wms/src/main/java/com/op/wms/domain/WmsStockAreaEntry.java new file mode 100644 index 000000000..ace8690a4 --- /dev/null +++ b/op-modules/op-wms/src/main/java/com/op/wms/domain/WmsStockAreaEntry.java @@ -0,0 +1,159 @@ +package com.op.wms.domain; + + +import com.op.common.core.web.domain.BaseEntity; + +/** + * remark + * + * @author 019117 + * @date + */ +public class WmsStockAreaEntry extends BaseEntity { + + private Long id; + + /** + * 生产日期 + * **/ + private String productionDate; + + /** + * 工单号 + * **/ + private String workOrderCode; + + + /** + * 工单状态 + * **/ + private String status; + + /** + * 物料编码 + * **/ + private String materialCode; + + /** + * 物料名称 + * **/ + private String materialName; + + /** + * 批次编码 + * **/ + private String batchCode; + + /** + * 工厂编码 + * **/ + private String factoryCode; + + /** + * 地点 + * **/ + private String location; + + /** + * 区号 + * **/ + private String areaCode; + + /** + * 查询-生产开始时间 + * **/ + private String beginDate; + + /** + * 查询-生产结束时间 + * **/ + private String endDate; + + public String getProductionDate() { + return productionDate; + } + + public void setProductionDate(String productionDate) { + this.productionDate = productionDate; + } + + public String getWorkOrderCode() { + return workOrderCode; + } + + public void setWorkOrderCode(String workOrderCode) { + this.workOrderCode = workOrderCode; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public String getMaterialCode() { + return materialCode; + } + + public void setMaterialCode(String materialCode) { + this.materialCode = materialCode; + } + + public String getMaterialName() { + return materialName; + } + + public void setMaterialName(String materialName) { + this.materialName = materialName; + } + + public String getBatchCode() { + return batchCode; + } + + public void setBatchCode(String batchCode) { + this.batchCode = batchCode; + } + + public String getFactoryCode() { + return factoryCode; + } + + public void setFactoryCode(String factoryCode) { + this.factoryCode = factoryCode; + } + + public String getLocation() { + return location; + } + + public void setLocation(String location) { + this.location = location; + } + + public String getAreaCode() { + return areaCode; + } + + public void setAreaCode(String areaCode) { + this.areaCode = areaCode; + } + + public String getBeginDate() { + return beginDate; + } + + public void setBeginDate(String beginDate) { + this.beginDate = beginDate; + } + + public String getEndDate() { + return endDate; + } + + public void setEndDate(String endDate) { + this.endDate = endDate; + } +} diff --git a/op-modules/op-wms/src/main/java/com/op/wms/mapper/OdsProcureOutOrderMapper.java b/op-modules/op-wms/src/main/java/com/op/wms/mapper/OdsProcureOutOrderMapper.java index e88b051b4..404823bce 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/mapper/OdsProcureOutOrderMapper.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/mapper/OdsProcureOutOrderMapper.java @@ -3,10 +3,7 @@ package com.op.wms.mapper; import java.util.List; import com.op.system.api.domain.sap.SapMaterialPosting; -import com.op.wms.domain.OdsProcureOrder; -import com.op.wms.domain.OdsProcureOutOrder; -import com.op.wms.domain.WmsOdsEmStorageNews; -import com.op.wms.domain.WmsOdsMateStorageNews; +import com.op.wms.domain.*; import org.apache.ibatis.annotations.Param; /** @@ -185,4 +182,10 @@ public interface OdsProcureOutOrderMapper { int removeReturn(String[] IDs); List selectWmsOdsProcureReturnOrderByProduceCode(String order); + + List getStockAreaEntryList(WmsStockAreaEntry params); + + List batchCheckDuplication(List list ); + + void batchInsertMaterialEntry(List list); } diff --git a/op-modules/op-wms/src/main/java/com/op/wms/service/IOdsProcureOrderService.java b/op-modules/op-wms/src/main/java/com/op/wms/service/IOdsProcureOrderService.java index 37cec3ccd..82e13d7dc 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/service/IOdsProcureOrderService.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/service/IOdsProcureOrderService.java @@ -164,4 +164,8 @@ public interface IOdsProcureOrderService { List selectOrderCardTLTWO(OdsProcureOrder odsProcureOrder); void batchSapTl(List orderList); + + List getStockAreaEntryList(WmsStockAreaEntry params); + + void submitMaterialEntry(List list); } diff --git a/op-modules/op-wms/src/main/java/com/op/wms/service/impl/OdsProcureOrderServiceImpl.java b/op-modules/op-wms/src/main/java/com/op/wms/service/impl/OdsProcureOrderServiceImpl.java index 5dd781995..584f87ed4 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/service/impl/OdsProcureOrderServiceImpl.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/service/impl/OdsProcureOrderServiceImpl.java @@ -26,6 +26,7 @@ import com.op.system.api.RemoteQualityService; import com.op.system.api.RemoteSapService; import com.op.system.api.domain.quality.QcCheckTaskIncomeDTO; import com.op.system.api.domain.sap.SapBackflushMPQuery; +import com.op.system.api.domain.sap.SapMaterialEntry; import com.op.system.api.domain.sap.SapMaterialPosting; import com.op.system.api.domain.sap.SapPurchaseOrderQuery; import okhttp3.OkHttpClient; @@ -36,6 +37,7 @@ import okhttp3.Response; import java.io.IOException; +import java.util.stream.Collectors; import com.baomidou.dynamic.datasource.annotation.DS; import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder; @@ -4063,4 +4065,44 @@ public class OdsProcureOrderServiceImpl implements IOdsProcureOrderService { OutboundPostingzcSAPTH(orderList1); } } + + @Override + @DS("#header.poolName") + public List getStockAreaEntryList(WmsStockAreaEntry params) { + return odsProcureOutOrderMapper.getStockAreaEntryList(params); + } + + @Override + @DS("#header.poolName") + public void submitMaterialEntry(List list) { + + List sapList = new ArrayList<>(); + + List duplicationList = odsProcureOutOrderMapper.batchCheckDuplication(list); + + if (!duplicationList.isEmpty()){ + List materialCodeList = duplicationList.stream().map(WmsStockAreaEntry::getMaterialCode).collect(Collectors.toList()); + throw new RuntimeException("物料:"+materialCodeList+"存在重复数据"); + } + + for (WmsStockAreaEntry item : list){ + SapMaterialEntry entry = new SapMaterialEntry(); + + entry.setMaterialCode(item.getMaterialCode()); + entry.setBatchCode(item.getBatchCode()); + entry.setFactoryCode(item.getFactoryCode()); + entry.setAreaCode(item.getAreaCode()); + entry.setStatus(item.getStatus()); + entry.setUserCode(item.getCreateBy()); + + sapList.add(entry); + } + + //提交记录 + odsProcureOutOrderMapper.batchInsertMaterialEntry(list); + + + //提交到sap + remoteSapService.updateMaterialEntry(sapList,"1"); + } } diff --git a/op-modules/op-wms/src/main/resources/mapper/wms/OdsProcureOutOrderMapper.xml b/op-modules/op-wms/src/main/resources/mapper/wms/OdsProcureOutOrderMapper.xml index c00adf109..134972833 100644 --- a/op-modules/op-wms/src/main/resources/mapper/wms/OdsProcureOutOrderMapper.xml +++ b/op-modules/op-wms/src/main/resources/mapper/wms/OdsProcureOutOrderMapper.xml @@ -2141,4 +2141,66 @@ and wms_ods_procure_return_order.User_Defined10!='2' and Order_Status='3' + + + + + + + + + INSERT INTO wms_material_entry ( + work_order_code, + material_code, + batch_code, + factory_code, + location, + area_code, + status, + create_time, + create_by + ) + VALUES + + ( + #{item.workOrderCode}, + #{item.materialCode}, + #{item.batchCode}, + #{item.factoryCode}, + #{item.location}, + #{item.areaCode}, + #{item.status}, + GETDATE(), + #{item.createBy} + ) + + From a35a2f6547cb12517e636a87a96a83ae4ba5529c Mon Sep 17 00:00:00 2001 From: FCD <2453864257@qq.com> Date: Mon, 8 Dec 2025 11:25:45 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E7=99=BD=E5=9D=AF=E6=A3=80=E9=AA=8C?= =?UTF-8?q?=E5=90=8E=E5=8F=B0=E6=8A=A5=E8=A1=A8=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/QcStaticTableController.java | 17 +- .../java/com/op/quality/domain/QcCheckBp.java | 31 ++- .../op/quality/domain/QcCheckBpDefect.java | 50 ++++ .../op/quality/mapper/QcCheckBpMapper.java | 3 + .../quality/mapper/QcStaticTableMapper.java | 6 + .../service/IQcStaticTableService.java | 13 + .../service/impl/QcCheckBpServiceImpl.java | 30 +- .../impl/QcStaticTableServiceImpl.java | 262 ++++++++++++++++++ .../mapper/quality/QcCheckBpMapper.xml | 13 + .../quality/QcCheckTaskProduceMapper.xml | 45 +-- .../mapper/quality/QcStaticTableMapper.xml | 75 +++++ 11 files changed, 492 insertions(+), 53 deletions(-) create mode 100644 op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckBpDefect.java diff --git a/op-modules/op-quality/src/main/java/com/op/quality/controller/QcStaticTableController.java b/op-modules/op-quality/src/main/java/com/op/quality/controller/QcStaticTableController.java index 5d0a68e55..ace2d864b 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/controller/QcStaticTableController.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/controller/QcStaticTableController.java @@ -17,6 +17,7 @@ import com.op.common.core.utils.DateUtils; import com.op.common.core.utils.bean.BeanUtils; import com.op.common.core.utils.poi.ExcelMapUtil; import com.op.common.core.utils.poi.ExcelReportMapUtil; +import com.op.common.core.web.domain.AjaxResult; import com.op.quality.domain.*; import com.op.system.api.domain.mes.ProLineDTO; import com.op.system.api.domain.quality.ChartDTO; @@ -960,8 +961,8 @@ public class QcStaticTableController extends BaseController { @Log(title = "白坯缺陷排列报表--数表", businessType = BusinessType.QUERY) @GetMapping("/getMonthOfDataDefect") - public List> getMonthOfDataDefect(QcStaticTable qcStaticTable) { - return qcStaticTableService.getMonthOfDataDefect(qcStaticTable); + public AjaxResult getMonthOfDataDefect(QcStaticTable qcStaticTable) { + return AjaxResult.success(qcStaticTableService.getMonthOfDataDefectV2(qcStaticTable)); } @Log(title = "白坯缺陷排列报表导出", businessType = BusinessType.EXPORT) @PostMapping("/getMonthOfDataDefectExport") @@ -1005,12 +1006,12 @@ public class QcStaticTableController extends BaseController { @Log(title = "白坯不良项目报表--数表", businessType = BusinessType.QUERY) @GetMapping("/getDefectItemData") public List> getDefectItemData(QcStaticTable qcStaticTable) { - return qcStaticTableService.getDefectItemData(qcStaticTable); + return qcStaticTableService.getDefectItemDataV2(qcStaticTable); } @Log(title = "白坯不良项目报表--图表", businessType = BusinessType.QUERY) @GetMapping("/getDefectItemLine") - public QcStaticTable getDefectItemLine(QcStaticTable qcStaticTable) { - return qcStaticTableService.getDefectItemLine(qcStaticTable); + public AjaxResult getDefectItemLine(QcStaticTable qcStaticTable) { + return AjaxResult.success(qcStaticTableService.getDefectItemLineV2(qcStaticTable)); } @Log(title = "白坯不良项目报表导出", businessType = BusinessType.EXPORT) @PostMapping("/getDefectItemDataExport") @@ -1048,12 +1049,12 @@ public class QcStaticTableController extends BaseController { @Log(title = "白坯性能--数表", businessType = BusinessType.QUERY) @GetMapping("/getDefectItemDataPC") public List> getDefectItemDataPC(QcStaticTable qcStaticTable) { - return qcStaticTableService.getDefectItemDataPC(qcStaticTable); + return qcStaticTableService.getDefectItemDataPCV2(qcStaticTable); } @Log(title = "白坯性能--图表", businessType = BusinessType.QUERY) @GetMapping("/getDefectItemLinePC") - public QcStaticTable getDefectItemLinePC(QcStaticTable qcStaticTable) { - return qcStaticTableService.getDefectItemLinePC(qcStaticTable); + public Map getDefectItemLinePC(QcStaticTable qcStaticTable) { + return qcStaticTableService.getDefectItemLinePCV2(qcStaticTable); } @Log(title = "白坯性能报表导出", businessType = BusinessType.EXPORT) @PostMapping("/getDefectItemDataPCExport") diff --git a/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckBp.java b/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckBp.java index ad58cc787..99518700a 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckBp.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckBp.java @@ -2,6 +2,8 @@ package com.op.quality.domain; import com.op.common.core.web.domain.BaseEntity; +import java.util.List; + /** * remark * @@ -28,12 +30,12 @@ public class QcCheckBp extends BaseEntity { /** * 检查数量 * **/ - private Integer checkNum; + private Integer checkNum = 0; /** * 不良数量 * **/ - private Integer badNum; + private Integer badNum = 0; /** * 是否合格 @@ -61,6 +63,15 @@ public class QcCheckBp extends BaseEntity { * **/ private String createUserName; + /** + * 来料 + * **/ + private String incomeBatchNo; + + /** + * 缺陷列表 + * **/ + private List defectList; public String getMaterialCode() { @@ -142,4 +153,20 @@ public class QcCheckBp extends BaseEntity { public void setCreateUserName(String createUserName) { this.createUserName = createUserName; } + + public String getIncomeBatchNo() { + return incomeBatchNo; + } + + public void setIncomeBatchNo(String incomeBatchNo) { + this.incomeBatchNo = incomeBatchNo; + } + + public List getDefectList() { + return defectList; + } + + public void setDefectList(List defectList) { + this.defectList = defectList; + } } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckBpDefect.java b/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckBpDefect.java new file mode 100644 index 000000000..8bdada966 --- /dev/null +++ b/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckBpDefect.java @@ -0,0 +1,50 @@ +package com.op.quality.domain; + +/** + * remark + * + * @author 019117 + * @date + */ +public class QcCheckBpDefect { + + private Integer badNum = 0; + + private String badItem; + + private String defectCode; + + private String defectSubclass; + + public Integer getBadNum() { + return badNum; + } + + public void setBadNum(Integer badNum) { + this.badNum = badNum; + } + + public String getBadItem() { + return badItem; + } + + public void setBadItem(String badItem) { + this.badItem = badItem; + } + + public String getDefectCode() { + return defectCode; + } + + public void setDefectCode(String defectCode) { + this.defectCode = defectCode; + } + + public String getDefectSubclass() { + return defectSubclass; + } + + public void setDefectSubclass(String defectSubclass) { + this.defectSubclass = defectSubclass; + } +} diff --git a/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcCheckBpMapper.java b/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcCheckBpMapper.java index f66bea8a3..287c80db3 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcCheckBpMapper.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcCheckBpMapper.java @@ -1,6 +1,7 @@ package com.op.quality.mapper; import com.op.quality.domain.QcCheckBp; +import com.op.quality.domain.QcCheckTaskDefect; import com.op.quality.domain.QcCheckTaskIncome; import org.apache.ibatis.annotations.Mapper; @@ -20,6 +21,8 @@ public interface QcCheckBpMapper { void insertCheckBpResult( QcCheckTaskIncome task ); + void batchInsertCheckBpDefects( List list ); + } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcStaticTableMapper.java b/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcStaticTableMapper.java index ec27b291f..3918806a3 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcStaticTableMapper.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcStaticTableMapper.java @@ -159,4 +159,10 @@ public interface QcStaticTableMapper { List getCpDefectTypes(QcStaticTable qcStaticTable); String getGroupIdByOrderNo(String orderNo); + + List getBPDefectList(QcStaticTable qcStaticTable); + + List getBPDefectMothMapV2(QcStaticTable qcStaticTable); + + List getBPDefectMothPCMapV2(QcStaticTable qcStaticTable); } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/IQcStaticTableService.java b/op-modules/op-quality/src/main/java/com/op/quality/service/IQcStaticTableService.java index 5c128c37c..4927ae051 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/service/IQcStaticTableService.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/IQcStaticTableService.java @@ -97,4 +97,17 @@ public interface IQcStaticTableService { List getCpDateTitle(QcStaticTable qcStaticTable); List> getCpDefectDate(QcStaticTable qcStaticTable); + + List> getMonthOfDataDefectV2(QcStaticTable qcStaticTable); + + Map getDefectItemLineV2(QcStaticTable qcStaticTable); + + Map getDefectItemLinePCV2(QcStaticTable qcStaticTable); + + List> getDefectItemDataPCV2(QcStaticTable qcStaticTable); + + List> getDefectItemDataV2(QcStaticTable qcStaticTable); + + + } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckBpServiceImpl.java b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckBpServiceImpl.java index 171456913..a2bf4b29c 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckBpServiceImpl.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckBpServiceImpl.java @@ -3,19 +3,17 @@ package com.op.quality.service.impl; import com.baomidou.dynamic.datasource.annotation.DS; import com.op.common.core.utils.DateUtils; import com.op.common.core.utils.uuid.IdUtils; -import com.op.quality.domain.QcCheckBp; -import com.op.quality.domain.QcCheckTaskIncome; -import com.op.quality.domain.QcCheckTaskProduce; +import com.op.quality.domain.*; import com.op.quality.mapper.QcCheckBpMapper; import com.op.quality.mapper.QcCheckTaskIncomeMapper; -import com.op.quality.mapper.QcCheckTaskProduceMapper; import com.op.quality.service.IQcCheckBpService; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; import javax.annotation.Resource; import java.math.BigDecimal; +import java.util.ArrayList; import java.util.Date; import java.util.List; @@ -67,7 +65,29 @@ public class QcCheckBpServiceImpl implements IQcCheckBpService { task.setOrderType("bp"); task.setRemark(params.getRemark()); task.setRemarkCode(params.getBadItem()); + task.setIncomeBatchNo(params.getIncomeBatchNo()); qcCheckBpMapper.insertCheckBpResult(task); + + List defectList = new ArrayList<>(); + + for (QcCheckBpDefect item : params.getDefectList()) { + QcCheckTaskDefect defect = new QcCheckTaskDefect(); + defect.setRecordId(IdUtils.fastSimpleUUID()); + defect.setDefectCode(item.getDefectCode()); + defect.setDefectSubclass(item.getDefectSubclass()); + defect.setCreateBy(params.getCreateBy()); + defect.setFactoryCode("ds_"+params.getFactoryCode()); + defect.setBelongTo(task.getRecordId()); + defect.setOkQuality(new BigDecimal(params.getCheckNum())); + defect.setNoOkQuality(new BigDecimal(item.getBadNum())); + defect.setClassId(item.getBadItem()); + defectList.add(defect); + } + + if (!CollectionUtils.isEmpty(defectList)) { + qcCheckBpMapper.batchInsertCheckBpDefects(defectList); + } + } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcStaticTableServiceImpl.java b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcStaticTableServiceImpl.java index e34673924..4ba3bed2f 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcStaticTableServiceImpl.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcStaticTableServiceImpl.java @@ -1769,6 +1769,70 @@ public class QcStaticTableServiceImpl implements IQcStaticTableService { return dtos; } + @Override + @DS("#header.poolName") + public List> getMonthOfDataDefectV2(QcStaticTable qcStaticTable) { + List bpDefects = qcStaticTableMapper.getBpDefects(qcStaticTable); + List list = qcStaticTableMapper.getBPDefectList(qcStaticTable); + List> result = new ArrayList<>(); + for (String defect : bpDefects){ + Map map = new HashMap<>(); + map.put("defect",defect); + int count = 0; + for (QcCheckTaskDefect data : list){ + if (defect.equals(data.getDefectSubclass())){ + map.put(data.getAttr1(),data.getAttr2()); + if (StringUtils.isNotBlank(data.getAttr2())){ + count = count + Integer.parseInt(data.getAttr2()); + } + } + } + map.put("count", Integer.toString(count)); + result.add(map); + } + int count1 = 0; + int count2 = 0; + Map map1 = new HashMap<>(); + map1.put("defect","合计"); + Map map2 = new HashMap<>(); + map2.put("defect","抽样数"); + for (QcCheckTaskDefect data : list){ + if ("合计".equals(data.getDefectSubclass())){ + map1.put(data.getAttr1(),data.getAttr2()); + map2.put(data.getAttr1(),data.getAttr3()); + if (StringUtils.isNotBlank(data.getAttr2())){ + count1 = count1 + Integer.parseInt(data.getAttr2()); + } + if (StringUtils.isNotBlank(data.getAttr3())){ + count2 = count2 + Integer.parseInt(data.getAttr3().replace(".00","")); + } + } + } + map1.put("count", Integer.toString(count1)); + map2.put("count", Integer.toString(count2)); + result.add(map1); + result.add(map2); + + + return result; + } + + @Override + @DS("#header.poolName") + public List> getDefectItemDataV2(QcStaticTable qcStaticTable) { + List> dtos = new ArrayList<>(); + //获取不良种类 + List bpDefects = qcStaticTableMapper.getBpDefects(qcStaticTable); + List monthList = qcStaticTableMapper.getBPDefectMothMapV2(qcStaticTable); + qcStaticTable.setYearMonth(null); + List totalList = qcStaticTableMapper.getBPDefectMothMapV2(qcStaticTable); + + dtos.add(computerBpDefectsRate(monthList,"num","不良数", bpDefects)); + dtos.add(computerBpDefectsRate(monthList,"rate","不良比例", bpDefects)); + dtos.add(computerBpDefectsRate(totalList,"rate","累计不良比例", bpDefects)); + return dtos; + } + @Override @DS("#header.poolName") public List getDefectItemTitle(QcStaticTable qcStaticTable) { @@ -1888,6 +1952,80 @@ public class QcStaticTableServiceImpl implements IQcStaticTableService { return dto; } + @Override + @DS("#header.poolName") + public Map getDefectItemLineV2(QcStaticTable qcStaticTable) { + Map result = new HashMap<>(); + + //获取不良种类 + List bpDefects = qcStaticTableMapper.getBpDefects(qcStaticTable); + result.put("xData",bpDefects); + + //当前查询月份的不良率 + List monthList = qcStaticTableMapper.getBPDefectMothMapV2(qcStaticTable); + //计算总不良率 + //不良数 + BigDecimal noOkQty = new BigDecimal(0); + //样品数 + BigDecimal sampleQty = new BigDecimal(0); + for (QcCheckTaskDefect item : monthList){ + if (StringUtils.isNotBlank(item.getAttr2())){ + noOkQty = noOkQty.add(new BigDecimal(item.getAttr2())); + } + if (StringUtils.isNotBlank(item.getAttr3())){ + sampleQty = sampleQty.add(new BigDecimal(item.getAttr3())); + } + } + //不良率 + BigDecimal noOkRate = new BigDecimal(0); + if (sampleQty.compareTo(BigDecimal.ZERO) > 0){ + noOkRate = noOkQty.divide(sampleQty,4,BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)); + } + //合格率 + BigDecimal okRate = new BigDecimal(100).subtract(noOkRate); + result.put("noOkQty",noOkQty); + result.put("sampleQty",sampleQty); + result.put("noOkRate",noOkRate); + result.put("okRate",okRate); + + List yDataLeft = new ArrayList<>(); + for (String defect : bpDefects) { + boolean flag = true; + for (QcCheckTaskDefect item : monthList){ + if (defect.equals(item.getDefectSubclass())){ + yDataLeft.add(item.getAttr1()); + flag = false; + break; + } + } + if (flag){ + yDataLeft.add("0"); + } + } + result.put("yDataLeft",yDataLeft); + + + //累计不良率 + qcStaticTable.setYearMonth(null); + List totalList = qcStaticTableMapper.getBPDefectMothMapV2(qcStaticTable); + List yDataRight = new ArrayList<>(); + for (String defect : bpDefects) { + boolean flag = true; + for (QcCheckTaskDefect item : totalList){ + if (defect.equals(item.getDefectSubclass())){ + yDataRight.add(item.getAttr1()); + flag = false; + break; + } + } + if (flag){ + yDataRight.add("0"); + } + } + result.put("yDataRight",yDataRight); + return result; + } + @Override @DS("#header.poolName") public List> getDefectItemDataPC(QcStaticTable qcStaticTable) { @@ -1933,6 +2071,55 @@ public class QcStaticTableServiceImpl implements IQcStaticTableService { return dtos; } + + + @Override + @DS("#header.poolName") + public List> getDefectItemDataPCV2(QcStaticTable qcStaticTable) { + List> dtos = new ArrayList<>(); + //获取不良种类 + List bpDefects = qcStaticTableMapper.getBpDefects(qcStaticTable); + List monthList = qcStaticTableMapper.getBPDefectMothPCMapV2(qcStaticTable); + qcStaticTable.setYearMonth(null); + List totalList = qcStaticTableMapper.getBPDefectMothPCMapV2(qcStaticTable); + + dtos.add(computerBpDefectsRate(monthList,"num","不良数", bpDefects)); + dtos.add(computerBpDefectsRate(monthList,"rate","不良比例", bpDefects)); + dtos.add(computerBpDefectsRate(totalList,"rate","累计不良比例", bpDefects)); + return dtos; + } + + //计算 + private Map computerBpDefectsRate(List list, String type, String title, List bpDefects ){ + Map result= new HashMap<>(); + result.put("dataType",title); + int i = 0; + for (String defect : bpDefects) { + for (QcCheckTaskDefect item : list){ + if (defect.equals(item.getDefectSubclass())){ + if (StringUtils.isNotBlank(item.getAttr1())){ + if ("rate".equals(type)){ + result.put("item"+i, item.getAttr1()); + }else { + if (StringUtils.isNotBlank(item.getAttr2())){ + result.put("item"+i,new BigDecimal(item.getAttr1()).divide(new BigDecimal(item.getAttr2()),2,RoundingMode.HALF_UP).toString()); + }else { + result.put("item"+i,"100"); + } + } + + }else { + result.put("item"+i,"0"); + } + break; + } + } + i++; + } + + return result; + } + @Override @DS("#header.poolName") public QcStaticTable getDefectItemLinePC(QcStaticTable qcStaticTable) { @@ -2001,6 +2188,81 @@ public class QcStaticTableServiceImpl implements IQcStaticTableService { return dto; } + @Override + @DS("#header.poolName") + public Map getDefectItemLinePCV2(QcStaticTable qcStaticTable) { + Map result = new HashMap<>(); + + //获取不良种类 + List bpDefects = qcStaticTableMapper.getBpDefects(qcStaticTable); + result.put("xData",bpDefects); + + //当前查询月份的不良率 + List monthList = qcStaticTableMapper.getBPDefectMothPCMapV2(qcStaticTable); + //计算总不良率 + //不良数 + BigDecimal noOkQty = new BigDecimal(0); + //样品数 + BigDecimal sampleQty = new BigDecimal(0); + for (QcCheckTaskDefect item : monthList){ + if (StringUtils.isNotBlank(item.getAttr2())){ + noOkQty = noOkQty.add(new BigDecimal(item.getAttr2())); + } + if (StringUtils.isNotBlank(item.getAttr3())){ + sampleQty = sampleQty.add(new BigDecimal(item.getAttr3())); + } + } + //不良率 + BigDecimal noOkRate = new BigDecimal(0); + if (sampleQty.compareTo(BigDecimal.ZERO) > 0){ + noOkRate = noOkQty.divide(sampleQty,4,BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)); + } + //合格率 + BigDecimal okRate = new BigDecimal(100).subtract(noOkRate); + result.put("noOkQty",noOkQty); + result.put("sampleQty",sampleQty); + result.put("noOkRate",noOkRate); + result.put("okRate",okRate); + + List yDataLeft = new ArrayList<>(); + for (String defect : bpDefects) { + boolean flag = true; + for (QcCheckTaskDefect item : monthList){ + if (defect.equals(item.getDefectSubclass())){ + yDataLeft.add(item.getAttr1()); + flag = false; + break; + } + } + if (flag){ + yDataLeft.add("0"); + } + } + result.put("yDataLeft",yDataLeft); + + + //累计不良率 + qcStaticTable.setYearMonth(null); + List totalList = qcStaticTableMapper.getBPDefectMothPCMapV2(qcStaticTable); + List yDataRight = new ArrayList<>(); + for (String defect : bpDefects) { + boolean flag = true; + for (QcCheckTaskDefect item : totalList){ + if (defect.equals(item.getDefectSubclass())){ + yDataRight.add(item.getAttr1()); + flag = false; + break; + } + } + if (flag){ + yDataRight.add("0"); + } + } + result.put("yDataRight",yDataRight); + return result; + } + + @Override @DS("#header.poolName") public List getCpDateTitle(QcStaticTable qcStaticTable) { diff --git a/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckBpMapper.xml b/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckBpMapper.xml index 90599297a..6815f22c4 100644 --- a/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckBpMapper.xml +++ b/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckBpMapper.xml @@ -99,4 +99,17 @@ + + insert into qc_check_task_defect( + record_id, defect_code, defect_subclass, create_by, create_time, + factory_code, belong_to, ok_quality, noOk_quality, class_id + ) values + + ( + #{item.recordId}, #{item.defectCode}, #{item.defectSubclass}, #{item.createBy}, GETDATE(), + #{item.factoryCode}, #{item.belongTo}, #{item.okQuality}, #{item.noOkQuality},#{item.classId} + ) + + + \ No newline at end of file diff --git a/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTaskProduceMapper.xml b/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTaskProduceMapper.xml index 1cca932bf..3f55a007d 100644 --- a/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTaskProduceMapper.xml +++ b/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTaskProduceMapper.xml @@ -359,7 +359,12 @@ select qct.record_id, qct.check_no, qct.income_batch_no, qct.order_no, qct.material_code, qct.material_name, qct.quality, qct.unit, qct.supplier_code, qct.supplier_name, qct.income_time, qct.check_loc, qct.check_status, - qct.check_time, qct.check_result, qct.check_type,'首件检验' check_name, + qct.check_time, qct.check_result, qct.check_type, + CASE + WHEN 'checkTypeSC' = #{checkType} THEN '首件检验' + WHEN 'checkTypeCPPC' = #{checkType} THEN '批次成品检验' + ELSE '' + END check_name, CONVERT(varchar(10),qct.create_time, 120) createTimeStr, qct.confirm,qct.confirm_man_name,qct.check_man_code ,qct.check_man_name from qc_check_task qct @@ -386,44 +391,8 @@ and #{incomeTimeEnd} > CONVERT(varchar(30),qct.income_time, 120) and CONVERT(varchar(30),qct.create_time, 120) >= #{checkTimeStart} and #{checkTimeEnd} > CONVERT(varchar(30),qct.create_time, 120) - and qct.check_type = 'checkTypeSC' and qct.del_flag = '0' + and qct.check_type in ('checkTypeSC','checkTypeCPPC') and qct.del_flag = '0' - union ALL - select - '','','', - qct.order_no, qct.material_code, qct.material_name, qct.quality, qct.unit, - qct.supplier_code, qct.supplier_name,CONVERT(varchar(10), qct.income_time, 120) income_time,'','', - null,'', qct.check_type,'巡检检验' check_name,CONVERT(varchar(10),qct.create_time, 120) createTimeStr, - qct.confirm,qct.confirm_man_name,'','' - from qc_check_task qct - - and qct.check_no = #{checkNo} - and qct.income_batch_no = #{incomeBatchNo} - and qct.order_no = #{orderNo} - and qct.material_code = #{materialCode} - and qct.material_name like concat('%', - #{materialName}, '%') - - and qct.supplier_code = #{supplierCode} - and qct.supplier_name like concat('%', - #{supplierName}, '%') - - and qct.check_loc = #{checkLoc} - and qct.check_status = #{checkStatus} - and qct.check_man_code = #{checkManCode} - and qct.check_man_name like concat('%', - #{checkManName}, '%') - - and qct.check_result = #{checkResult} - and CONVERT(varchar(30),qct.income_time, 120) >= #{incomeTimeStart} - and #{incomeTimeEnd} > CONVERT(varchar(30),qct.income_time, 120) - and CONVERT(varchar(30),qct.create_time, 120) >= #{checkTimeStart} - and #{checkTimeEnd} > CONVERT(varchar(30),qct.create_time, 120) - and qct.check_type = 'checkTypeSCXJ' and qct.del_flag = '0' - - GROUP BY qct.order_no, qct.material_code, qct.material_name, qct.quality, qct.unit, - qct.supplier_code, qct.supplier_name,CONVERT(varchar(10), qct.income_time, 120), qct.check_type,CONVERT(varchar(10),qct.create_time, 120), - qct.confirm,qct.confirm_man_name ) t left join pro_order_workorder pow on pow.workorder_code = t.order_no where pow.del_flag = '0' diff --git a/op-modules/op-quality/src/main/resources/mapper/quality/QcStaticTableMapper.xml b/op-modules/op-quality/src/main/resources/mapper/quality/QcStaticTableMapper.xml index 32ed4fff6..08d737d29 100644 --- a/op-modules/op-quality/src/main/resources/mapper/quality/QcStaticTableMapper.xml +++ b/op-modules/op-quality/src/main/resources/mapper/quality/QcStaticTableMapper.xml @@ -1412,4 +1412,79 @@ where pow.workorder_code = #{orderNo} + + + + + +