From 1b98903f2d7b16c9796d12cdf57ebc97751896f1 Mon Sep 17 00:00:00 2001 From: Yangwl <1726150332@qq.com> Date: Wed, 29 Nov 2023 13:50:19 +0800 Subject: [PATCH 1/4] =?UTF-8?q?SAP=E6=8E=A5=E5=8F=A3=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=92=8C=E8=AE=A2=E5=8D=95=E5=85=B3=E9=97=AD?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/op/sap/controller/SapController.java | 22 ++- .../op/sap/domain/vo/SapBackflushMPQuery.java | 117 +++++++++++++ .../op/sap/domain/vo/SapCloseOrderQuery.java | 23 +++ .../op/sap/service/SapItemSyncService.java | 3 + .../com/op/sap/service/SapOrderService.java | 5 +- .../op/sap/service/impl/SapItemSyncImpl.java | 70 +++++++- .../sap/service/impl/SapOrderServiceImpl.java | 55 ++++--- .../service/impl/SapRouterServiceImpl.java | 155 +++++++++++------- .../java/com/op/sap/util/SAPConnUtils.java | 1 + .../mapper/sap/SapProRouteMapper.xml | 24 +++ 10 files changed, 380 insertions(+), 95 deletions(-) create mode 100644 op-modules/op-sap/src/main/java/com/op/sap/domain/vo/SapBackflushMPQuery.java create mode 100644 op-modules/op-sap/src/main/java/com/op/sap/domain/vo/SapCloseOrderQuery.java 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 393bb74e..77640f01 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 @@ -176,7 +176,7 @@ public class SapController extends BaseController { calendar.setTime(maxTime0); calendar.add(Calendar.DAY_OF_YEAR, 1); Date maxTime = calendar.getTime(); - qo.setAedat(DateFormatUtils.format(maxTime, "yyyyMMdd"));//修改日期20230923 + // qo.setAedat(DateFormatUtils.format(maxTime, "yyyyMMdd"));//修改日期20230923 } qo.setWerks(dateSource.get("poolName").replace("ds_", ""));//工厂 @@ -202,6 +202,19 @@ public class SapController extends BaseController { return sapMaterialPreparationService.MaterialPreparation(shopOrder); } + + /** + * 反冲物料领料过账接口 + * ***与包材领料分开过账 + * @param sapBackflushMPQueryList + * @return + */ + @PostMapping("/sapBackflushMP") + @Log(title = "", businessType = BusinessType.SAP) + public R sapBackflushMP(@RequestBody List sapBackflushMPQueryList){ + return sapItemSyncService.sapBackflushMP(sapBackflushMPQueryList); + } + @PostMapping("/sapMaterialPosting") @Log(title = "订单物料领料过账、原材料补料、订单物料退料过账接口(MB1A)", businessType = BusinessType.SAP) public R sapMaterialPosting(@RequestBody SapMaterialPosting sapMaterialPosting){ @@ -223,13 +236,14 @@ public class SapController extends BaseController { /** * 生产订单关闭接口 - * @param shopOrder + * 传母订单号即可 + * @param sapCloseOrderQuery * @return */ @PostMapping("/sapCloseOrder") @Log(title = "生产订单关闭接口", businessType = BusinessType.SAP) - public R sapCloseOrder(@RequestParam("shopOrder") String shopOrder){ - return sapOrderService.sapCloseOrder(shopOrder); + public R sapCloseOrder(@RequestBody SapCloseOrderQuery sapCloseOrderQuery){ + return sapOrderService.sapCloseOrder(sapCloseOrderQuery); } /** diff --git a/op-modules/op-sap/src/main/java/com/op/sap/domain/vo/SapBackflushMPQuery.java b/op-modules/op-sap/src/main/java/com/op/sap/domain/vo/SapBackflushMPQuery.java new file mode 100644 index 00000000..7cc1e30b --- /dev/null +++ b/op-modules/op-sap/src/main/java/com/op/sap/domain/vo/SapBackflushMPQuery.java @@ -0,0 +1,117 @@ +package com.op.sap.domain.vo; + +/** + * 反冲类型的领料过账接口 + * auth YangWL + * + * MATNR CHAR 18 0 物料号 必填 + * PLANT CHAR 4 0 工厂 必填 + * GR_RCPT CHAR 12 0 收货方/运达方 选填 + * LGORT CHAR 4 0 库存地点 必填 + * UMLGO CHAR 4 0 收货/发货库存地点 选填 + * QUANTITY QUAN 13 3 数量 必填 + * MEINS UNIT 3 0 条目单位 必填 + * BATCH CHAR 10 0 批号 必填 + * MOVE_BATCH CHAR 10 0 收货/发货批量 选填 + */ + + +public class SapBackflushMPQuery { + + private String matnr; + private String plant; + private String gr_rcpt; + private String lgort; + private String umlgo; + private String quantity; + private String meins; + private String batch; + private String move_batch; + + public String getMatnr() { + return matnr; + } + + public void setMatnr(String matnr) { + this.matnr = matnr; + } + + public String getPlant() { + return plant; + } + + public void setPlant(String plant) { + this.plant = plant; + } + + public String getGr_rcpt() { + return gr_rcpt; + } + + public void setGr_rcpt(String gr_rcpt) { + this.gr_rcpt = gr_rcpt; + } + + public String getLgort() { + return lgort; + } + + public void setLgort(String lgort) { + this.lgort = lgort; + } + + public String getUmlgo() { + return umlgo; + } + + public void setUmlgo(String umlgo) { + this.umlgo = umlgo; + } + + public String getQuantity() { + return quantity; + } + + public void setQuantity(String quantity) { + this.quantity = quantity; + } + + public String getMeins() { + return meins; + } + + public void setMeins(String meins) { + this.meins = meins; + } + + public String getBatch() { + return batch; + } + + public void setBatch(String batch) { + this.batch = batch; + } + + public String getMove_batch() { + return move_batch; + } + + public void setMove_batch(String move_batch) { + this.move_batch = move_batch; + } + + @Override + public String toString() { + return "SapBackflushMPQuery{" + + "matnr='" + matnr + '\'' + + ", plant='" + plant + '\'' + + ", gr_rcpt='" + gr_rcpt + '\'' + + ", lgort='" + lgort + '\'' + + ", umlgo='" + umlgo + '\'' + + ", quantity='" + quantity + '\'' + + ", meins='" + meins + '\'' + + ", batch='" + batch + '\'' + + ", move_batch='" + move_batch + '\'' + + '}'; + } +} diff --git a/op-modules/op-sap/src/main/java/com/op/sap/domain/vo/SapCloseOrderQuery.java b/op-modules/op-sap/src/main/java/com/op/sap/domain/vo/SapCloseOrderQuery.java new file mode 100644 index 00000000..effeb118 --- /dev/null +++ b/op-modules/op-sap/src/main/java/com/op/sap/domain/vo/SapCloseOrderQuery.java @@ -0,0 +1,23 @@ +package com.op.sap.domain.vo; + + +public class SapCloseOrderQuery { + private String leadOrder; + private String order; + + public String getLeadOrder() { + return leadOrder; + } + + public void setLeadOrder(String leadOrder) { + this.leadOrder = leadOrder; + } + + public String getOrder() { + return order; + } + + public void setOrder(String order) { + this.order = order; + } +} diff --git a/op-modules/op-sap/src/main/java/com/op/sap/service/SapItemSyncService.java b/op-modules/op-sap/src/main/java/com/op/sap/service/SapItemSyncService.java index 5f7975d6..2e3152bb 100644 --- a/op-modules/op-sap/src/main/java/com/op/sap/service/SapItemSyncService.java +++ b/op-modules/op-sap/src/main/java/com/op/sap/service/SapItemSyncService.java @@ -1,6 +1,7 @@ package com.op.sap.service; import com.op.common.core.domain.R; +import com.op.sap.domain.vo.SapBackflushMPQuery; import com.op.sap.domain.vo.SapItemQuery; import com.op.sap.domain.vo.SapMaterialPosting; import com.op.system.api.domain.sap.SapBaseProduct; @@ -25,4 +26,6 @@ public interface SapItemSyncService { */ R sapMaterialPosting(SapMaterialPosting sapMaterialPosting); + + R sapBackflushMP(List sapBackflushMPQueryList); } diff --git a/op-modules/op-sap/src/main/java/com/op/sap/service/SapOrderService.java b/op-modules/op-sap/src/main/java/com/op/sap/service/SapOrderService.java index fe4273ae..8e061ada 100644 --- a/op-modules/op-sap/src/main/java/com/op/sap/service/SapOrderService.java +++ b/op-modules/op-sap/src/main/java/com/op/sap/service/SapOrderService.java @@ -2,6 +2,7 @@ package com.op.sap.service; import com.op.common.core.domain.R; +import com.op.sap.domain.vo.SapCloseOrderQuery; import com.op.sap.domain.vo.SapPurchaseOrderQuery; import com.op.system.api.domain.sap.SapCreateOrder; import com.op.system.api.domain.sap.SapRFW; @@ -32,11 +33,11 @@ public interface SapOrderService { /** * 订单关闭 - * @param shopOrder + * @param sapCloseOrderQuery * @return */ - R sapCloseOrder(String shopOrder); + R sapCloseOrder(SapCloseOrderQuery sapCloseOrderQuery); /** * 订单报工 diff --git a/op-modules/op-sap/src/main/java/com/op/sap/service/impl/SapItemSyncImpl.java b/op-modules/op-sap/src/main/java/com/op/sap/service/impl/SapItemSyncImpl.java index a0c06733..812d87a0 100644 --- a/op-modules/op-sap/src/main/java/com/op/sap/service/impl/SapItemSyncImpl.java +++ b/op-modules/op-sap/src/main/java/com/op/sap/service/impl/SapItemSyncImpl.java @@ -8,6 +8,7 @@ import com.op.common.core.utils.DateUtils; import com.op.common.core.utils.StringUtils; import com.op.common.core.utils.bean.BeanValidators; import com.op.common.security.utils.SecurityUtils; +import com.op.sap.domain.vo.SapBackflushMPQuery; import com.op.sap.domain.vo.SapItemQuery; import com.op.sap.domain.vo.SapMaterialPosting; import com.op.sap.mapper.SapBaseProductMapper; @@ -98,13 +99,6 @@ public class SapItemSyncImpl implements SapItemSyncService { S_LAEDA.setValue("HIGH", END_DATE); } - - - - - - - // 获取调用 RFC 函数对象 func.execute(dest); // 获取 内表 - ZMES_PRO @@ -297,6 +291,68 @@ public class SapItemSyncImpl implements SapItemSyncService { } } + /** + * 反冲物料领料过账 + * @param sapBackflushMPQueryList + * @return + */ + + @Override + public R sapBackflushMP(List sapBackflushMPQueryList) { + try { + JCoRepository repository = dest.getRepository(); + JCoFunction func = repository.getFunction("ZPPR_MES_GOODSMVT_CREATE_B"); + if (func == null) { + throw new RuntimeException("Function does not exist in SAP"); + } + JCoTable L_ITEM = func.getTableParameterList().getTable("L_ITEM"); + + System.out.println(L_ITEM); + +// +// int successNum = 0; +// int failureNum = 0; +// StringBuilder successMsg = new StringBuilder(); +// StringBuilder failureMsg = new StringBuilder(); +// log.info("反冲物料开始过账----------------------------------------"); + +// for (int i = 0; i < sapBackflushMPQueryList.size(); i++) { +// L_ITEM.setRow(i); +// L_ITEM.appendRow(); +// L_ITEM.setValue("MATNR",sfp.getMatnr()); +// } + for (SapBackflushMPQuery sfp:sapBackflushMPQueryList){ +// if (StringUtils.isEmpty(sfp.getMatnr())){ +// return R.fail("物料号为空!"); +// } +// if (StringUtils.isEmpty(sfp.getPlant())){ +// +// } + L_ITEM.appendRow(); + L_ITEM.setValue("MATNR",sfp.getMatnr()); + L_ITEM.setValue("PLANT",sfp.getPlant()); + L_ITEM.setValue("GR_RCPT",sfp.getGr_rcpt()); + L_ITEM.setValue("LGORT",sfp.getLgort()); + L_ITEM.setValue("UMLGO",sfp.getUmlgo()); + L_ITEM.setValue("QUANTITY",sfp.getQuantity()); + L_ITEM.setValue("MEINS",sfp.getMeins()); + L_ITEM.setValue("BATCH",sfp.getBatch()); + L_ITEM.setValue("MOVE_BATCH",sfp.getMove_batch()); + + } + return R.ok(); + + }catch (Exception e){ + return R.fail(e.getMessage()); + } + + } + + public static void main(String[] args) { + SapBackflushMPQuery sapBackflushMPQuery=new SapBackflushMPQuery(); + System.out.println(sapBackflushMPQuery.toString()); + } + public String importProducts(List sapBaseProductList){ if (StringUtils.isNull(sapBaseProductList) || sapBaseProductList.size() == 0) { diff --git a/op-modules/op-sap/src/main/java/com/op/sap/service/impl/SapOrderServiceImpl.java b/op-modules/op-sap/src/main/java/com/op/sap/service/impl/SapOrderServiceImpl.java index 96667412..adc7b5bf 100644 --- a/op-modules/op-sap/src/main/java/com/op/sap/service/impl/SapOrderServiceImpl.java +++ b/op-modules/op-sap/src/main/java/com/op/sap/service/impl/SapOrderServiceImpl.java @@ -6,6 +6,7 @@ import com.op.common.core.utils.DateUtils; import com.op.common.core.utils.StringUtils; import com.op.common.core.utils.uuid.IdUtils; +import com.op.sap.domain.vo.SapCloseOrderQuery; import com.op.sap.domain.vo.SapPurchaseOrderQuery; import com.op.sap.service.SapOrderService; @@ -202,8 +203,9 @@ public class SapOrderServiceImpl implements SapOrderService { } @Override - public R sapCloseOrder(String shopOrder) { - String L_MSG=null; + public R sapCloseOrder(SapCloseOrderQuery sapCloseOrderQuery) { + + StringBuilder Msg = new StringBuilder(); try { //获取连接 // JCoDestination dest = SAPConnUtils.connect(); @@ -215,19 +217,26 @@ public class SapOrderServiceImpl implements SapOrderService { // 配置传入参数 JCoParameterList jCoParameterList = func.getImportParameterList(); - if (StringUtils.isEmpty(shopOrder)){ - return R.fail("订单号为空"); + if (StringUtils.isEmpty(sapCloseOrderQuery.getLeadOrder())){ + return R.fail("母订单号为空"); } - jCoParameterList.setValue("P_AUFNR",shopOrder); + if (StringUtils.isEmpty(sapCloseOrderQuery.getOrder())){ + return R.fail("子订单号为空"); + } + //关闭母订单 + jCoParameterList.setValue("P_AUFNR",sapCloseOrderQuery.getLeadOrder()); func.execute(dest);//执行调用函数 - JCoParameterList J= func.getExportParameterList(); - System.out.println(J); - L_MSG= func.getExportParameterList().getString("L_MSG"); - if (StringUtils.isEmpty(L_MSG)){ - return R.fail("订单关闭失败"); - } - return R.ok(L_MSG); +// JCoParameterList J= func.getExportParameterList(); +// System.out.println(J); + String L_MSG1= func.getExportParameterList().getString("L_MSG"); + Msg.append(sapCloseOrderQuery.getLeadOrder()+L_MSG1+";"); + //关闭子订单 + jCoParameterList.setValue("P_AUFNR",sapCloseOrderQuery.getOrder()); + func.execute(dest);//执行调用函数 + String L_MSG2= func.getExportParameterList().getString("L_MSG"); + Msg.append(sapCloseOrderQuery.getOrder()+L_MSG2); + return R.ok(null,Msg.toString()); }catch (Exception e){ return R.fail(e.getMessage()); } @@ -260,7 +269,7 @@ public class SapOrderServiceImpl implements SapOrderService { if (sapRFW.getLt_gs()==null){ return R.fail("生产订单报工工时为空"); } - if (sapRFW.getLt_hw()==null){ + if (sapRFW.getLt_hwList()==null){ return R.fail("生产订单报工货物移动为空"); } /** @@ -280,9 +289,12 @@ public class SapOrderServiceImpl implements SapOrderService { */ JCoTable LT_HW_jCoTable = func.getTableParameterList().getTable("LT_HW"); System.out.println("LT_HW_jCoTable"+LT_HW_jCoTable); - LT_HW_jCoTable.appendRow(); - LT_HW_jCoTable.setValue("MATERIAL", sapRFW.getLt_hw().getMaterial()); - LT_HW_jCoTable.setValue("ENTRY_QNT", sapRFW.getLt_hw().getEntry_qnt()); + for (SapRFW.lt_hw lt_hw:sapRFW.getLt_hwList()){ + LT_HW_jCoTable.appendRow(); + LT_HW_jCoTable.setValue("MATERIAL", lt_hw.getMaterial()); + LT_HW_jCoTable.setValue("ENTRY_QNT", lt_hw.getEntry_qnt()); + } + func.execute(dest);//执行调用函数 JCoParameterList J= func.getExportParameterList(); @@ -364,7 +376,7 @@ public class SapOrderServiceImpl implements SapOrderService { JCoFunction func = repository.getFunction("ZPPR_MES_PRODORD_CHANGE"); // 配置传入参数 JCoParameterList jCoParameterList = func.getImportParameterList(); - System.out.println(jCoParameterList); + //System.out.println(jCoParameterList); if (func == null) { throw new RuntimeException("Function does not exist in SAP"); } @@ -381,10 +393,13 @@ public class SapOrderServiceImpl implements SapOrderService { jCoParameterList.setValue("P_QUANTITY",sapProOrder.getQuantity()); func.execute(dest);//执行调用函数 JCoParameterList J= func.getExportParameterList(); - System.out.println(J); + String RETCODE= func.getExportParameterList().getString("RETCODE"); String MESSAGE= func.getExportParameterList().getString("MESSAGE"); - System.out.println(MESSAGE); - return R.ok(MESSAGE); + if ((Constants.FAIL).equals(Integer.parseInt(RETCODE))){ + return R.fail(null,"订单号:"+sapProOrder.getAufnr()+MESSAGE); + }else { + return R.ok(null,"订单号:"+sapProOrder.getAufnr()+MESSAGE); + } }catch (Exception e){ return R.fail(e.getMessage()); } diff --git a/op-modules/op-sap/src/main/java/com/op/sap/service/impl/SapRouterServiceImpl.java b/op-modules/op-sap/src/main/java/com/op/sap/service/impl/SapRouterServiceImpl.java index 494e865f..bd78ae0b 100644 --- a/op-modules/op-sap/src/main/java/com/op/sap/service/impl/SapRouterServiceImpl.java +++ b/op-modules/op-sap/src/main/java/com/op/sap/service/impl/SapRouterServiceImpl.java @@ -176,8 +176,8 @@ public class SapRouterServiceImpl implements SapRouterService { "删除标识:" + LOEKZ+ "物料号:" + MATNR+ "物料描述:" + MAKTX+ - "任务清单使用"+VERWE+ - "状态"+STATU+ + "任务清单使用:"+VERWE+ + "状态:"+STATU+ "任务清单描述:" + KTEXT+ " 操作/活动编号:" + VORNR+ "控制码:" + STEUS+ @@ -190,16 +190,14 @@ public class SapRouterServiceImpl implements SapRouterService { "工作中心:" + ARBPL+ "基本数量:" + BMSCH+ "工序计量单位:" + MEINH+ - "标准值01:" + VGW01+ - "计量单位01:" + VGE01+ - "标准值02:" + VGE02+ - "计量单位02:" + VGE02+ - "标准值03:" + VGE03+ - "计量单位03:" + VGE03+ - " 标准值04:" + VGE04+ - " 计量单位04:" + VGE04); - - + "标准值01(机器):" + VGW01+ + "计量单位01:" + VGE01+ + "标准值02(人工):" + VGW02+ + "计量单位02:" + VGE02+ + "标准值03(折旧):" + VGW03+ + "计量单位03:" + VGE03+ + "标准值04(其它):" + VGW04+ + " 计量单位04:" + VGE04); //工艺路线下的工序 if (StringUtil.isBlank(PLNNR)) { throw new ServiceException("任务清单组码不能为空"); @@ -239,6 +237,18 @@ public class SapRouterServiceImpl implements SapRouterService { sapProRoute.setAttr1("job");//说明是来自定时任务 sapProRoute.setCreateTime(DateUtils.dateTime("yyyy-MM-dd", ANDAT)); sapProRoute.setRouteVersion("1.0"); + //机器 + sapProRoute.setTecMachine(VGW01); + sapProRoute.setTecMachineUnit(VGE01); + //人工 + sapProRoute.setTecMan(VGW02); + sapProRoute.setTecManUnit(VGE02); + //折旧 + sapProRoute.setTecDepreciation(VGW03); + sapProRoute.setTecDepreciationUnit(VGE03); + //其它 + sapProRoute.setTecOther(VGW04); + sapProRoute.setTecOtherUnit(VGE04); sapProRouteMapper.insertProRoute(sapProRoute); //增加工艺路线和工序的关系 @@ -265,58 +275,79 @@ public class SapRouterServiceImpl implements SapRouterService { successNum++; } } + //更新工艺路线 + else { + sapProRoute.setRouteName(KTEXT); + sapProRoute.setRouteDesc(KTEXT); + sapProRoute.setEnableFlag("Y"); - else{ - //验证是否存在工序 - sapProProcess.setProcessName(LTXA1); - SapProProcess operation = sapProProcessMapper.selectProProcessByProcessName(sapProProcess); - //验证原材料是否存在 - SapBaseProduct sapBaseProduct=new SapBaseProduct(); - sapBaseProduct.setProductCode(MATNR); - sapBaseProduct = sapBaseProductMapper.selectBaseProductByProductCode(sapBaseProduct); - if (StringUtils.isNull(operation)){ - failureNum++; - failureMsg.append(failureNum+"、工艺路线【" + PLNNR + "】下的工序【" + LTXA1 + "】不存在!"); - } - else if (StringUtils.isNull(sapBaseProduct)){ - failureNum++; - failureMsg.append(failureNum+"、工艺路线【" + PLNNR + "】下的物料【" + MATNR + "】不存在!"); - } - else if(!StringUtils.isNull(operation) && !StringUtils.isNull(sapBaseProduct)) { - //验证是否存在工艺路线和工序的关系 - SapProRouteProcess sapProRouteProcess = new SapProRouteProcess(); - sapProRouteProcess.setRouteId(sapProRoute.getRouteId()); - sapProRouteProcess.setProcessId(operation.getProcessId()); - List sapProRouteProcessList = sapProRouteProcessMapper.selectProRouteProcessList(sapProRouteProcess); - if (sapProRouteProcessList .size()==0) { - //增加工艺路线和工序的关系 - sapProRouteProcess.setRecordId(IdUtils.fastSimpleUUID()); - sapProRouteProcess.setRouteId(sapProRoute.getRouteId()); - sapProRouteProcess.setProcessId(operation.getProcessId()); - sapProRouteProcess.setProcessCode(operation.getProcessCode()); - sapProRouteProcess.setProcessName(operation.getProcessName()); - sapProRouteProcess.setOrderNum(1); - sapProRouteProcess.setCreateTime(DateUtils.dateTime("yyyy-MM-dd", ANDAT)); - sapProRouteProcess.setCreateBy(ANNAM); - sapProRouteProcessMapper.insertProRouteProcess(sapProRouteProcess); - } - //验证是否存在工艺路线和物料的关系 - SapProRouteProduct sapProRouteProduct = new SapProRouteProduct(); - sapProRouteProduct.setRouteId(sapProRoute.getRouteId()); - sapProRouteProduct.setItemCode(MATNR); - List sapProRouteProductList = sapProRouteProductMapper.selectProRouteProductList(sapProRouteProduct); - if (sapProRouteProductList .size()==0) { - sapProRouteProduct.setRecordId(IdUtils.fastSimpleUUID()); - sapProRouteProduct.setRouteId(sapProRoute.getRouteId()); - sapProRouteProduct.setItemId(sapBaseProduct.getProductId()); - sapProRouteProduct.setItemCode(MATNR); - sapProRouteProduct.setItemName(sapBaseProduct.getProductDescZh()); - sapProRouteProduct.setCreateBy(ANNAM); - sapProRouteProduct.setCreateTime(DateUtils.dateTime("yyyy-MM-dd", ANDAT)); - sapProRouteProductMapper.insertProRouteProduct(sapProRouteProduct); - } - } + //机器 + sapProRoute.setTecMachine(VGW01); + sapProRoute.setTecMachineUnit(VGE01); + //人工 + sapProRoute.setTecMan(VGW02); + sapProRoute.setTecManUnit(VGE02); + //折旧 + sapProRoute.setTecDepreciation(VGW03); + sapProRoute.setTecDepreciationUnit(VGE03); + //其它 + sapProRoute.setTecOther(VGW04); + sapProRoute.setTecOtherUnit(VGE04); + sapProRoute.setUpdateBy(ANNAM); + sapProRoute.setUpdateTime(DateUtils.getNowDate()); + sapProRouteMapper.updateProRoute(sapProRoute); } +// else{ +// //验证是否存在工序 +// sapProProcess.setProcessName(LTXA1); +// SapProProcess operation = sapProProcessMapper.selectProProcessByProcessName(sapProProcess); +// //验证产品是否存在 +// SapBaseProduct sapBaseProduct=new SapBaseProduct(); +// sapBaseProduct.setProductCode(MATNR); +// sapBaseProduct = sapBaseProductMapper.selectBaseProductByProductCode(sapBaseProduct); +// if (StringUtils.isNull(operation)){ +// failureNum++; +// failureMsg.append(failureNum+"、工艺路线【" + PLNNR + "】下的工序【" + LTXA1 + "】不存在!"); +// } +// else if (StringUtils.isNull(sapBaseProduct)){ +// failureNum++; +// failureMsg.append(failureNum+"、工艺路线【" + PLNNR + "】下的物料【" + MATNR + "】不存在!"); +// } +// else if(!StringUtils.isNull(operation) && !StringUtils.isNull(sapBaseProduct)) { +// //验证是否存在工艺路线和工序的关系 +// SapProRouteProcess sapProRouteProcess = new SapProRouteProcess(); +// sapProRouteProcess.setRouteId(sapProRoute.getRouteId()); +// sapProRouteProcess.setProcessId(operation.getProcessId()); +// List sapProRouteProcessList = sapProRouteProcessMapper.selectProRouteProcessList(sapProRouteProcess); +// if (sapProRouteProcessList .size()==0) { +// //增加工艺路线和工序的关系 +// sapProRouteProcess.setRecordId(IdUtils.fastSimpleUUID()); +// sapProRouteProcess.setRouteId(sapProRoute.getRouteId()); +// sapProRouteProcess.setProcessId(operation.getProcessId()); +// sapProRouteProcess.setProcessCode(operation.getProcessCode()); +// sapProRouteProcess.setProcessName(operation.getProcessName()); +// sapProRouteProcess.setOrderNum(1); +// sapProRouteProcess.setCreateTime(DateUtils.dateTime("yyyy-MM-dd", ANDAT)); +// sapProRouteProcess.setCreateBy(ANNAM); +// sapProRouteProcessMapper.insertProRouteProcess(sapProRouteProcess); +// } +// //验证是否存在工艺路线和物料的关系 +// SapProRouteProduct sapProRouteProduct = new SapProRouteProduct(); +// sapProRouteProduct.setRouteId(sapProRoute.getRouteId()); +// sapProRouteProduct.setItemCode(MATNR); +// List sapProRouteProductList = sapProRouteProductMapper.selectProRouteProductList(sapProRouteProduct); +// if (sapProRouteProductList .size()==0) { +// sapProRouteProduct.setRecordId(IdUtils.fastSimpleUUID()); +// sapProRouteProduct.setRouteId(sapProRoute.getRouteId()); +// sapProRouteProduct.setItemId(sapBaseProduct.getProductId()); +// sapProRouteProduct.setItemCode(MATNR); +// sapProRouteProduct.setItemName(sapBaseProduct.getProductDescZh()); +// sapProRouteProduct.setCreateBy(ANNAM); +// sapProRouteProduct.setCreateTime(DateUtils.dateTime("yyyy-MM-dd", ANDAT)); +// sapProRouteProductMapper.insertProRouteProduct(sapProRouteProduct); +// } +// } +// } } diff --git a/op-modules/op-sap/src/main/java/com/op/sap/util/SAPConnUtils.java b/op-modules/op-sap/src/main/java/com/op/sap/util/SAPConnUtils.java index 7266fb09..e04eeef8 100644 --- a/op-modules/op-sap/src/main/java/com/op/sap/util/SAPConnUtils.java +++ b/op-modules/op-sap/src/main/java/com/op/sap/util/SAPConnUtils.java @@ -24,6 +24,7 @@ public class SAPConnUtils { destination = JCoDestinationManager.getDestination(ABAP_AS_POOLED); if (destination!=null){ logger.info("连接SAP成功"); + System.err.println("连接SAP成功"); } } catch (JCoException e) { logger.info("连接SAP失败,错误: " + e.toString()); diff --git a/op-modules/op-sap/src/main/resources/mapper/sap/SapProRouteMapper.xml b/op-modules/op-sap/src/main/resources/mapper/sap/SapProRouteMapper.xml index df6cebe2..e81879f8 100644 --- a/op-modules/op-sap/src/main/resources/mapper/sap/SapProRouteMapper.xml +++ b/op-modules/op-sap/src/main/resources/mapper/sap/SapProRouteMapper.xml @@ -97,6 +97,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" update_time, route_version, need_check, + tec_man, + tec_man_unit, + tec_machine, + tec_machine_unit, + tec_depreciation, + tec_depreciation_unit, + tec_other, + tec_ohter_unit, @@ -116,6 +124,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{updateTime}, #{routeVersion}, #{needCheck}, + #{tecMan}, + #{tecManUnit}, + #{tecMachine}, + #{tecMachineUnit}, + #{tecDepreciation}, + #{tecDepreciationUnit}, + #{tecOther}, + #{tecOtherUnit}, @@ -128,6 +144,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" route_desc = #{routeDesc}, enable_flag = #{enableFlag}, remark = #{remark}, + tec_man = #{tecMan}, + tec_man_unit = #{tecManUnit}, + tec_machine = #{tecMachine}, + tec_machine_unit = #{tecMachineUnit}, + tec_depreciation = #{tecDepreciation}, + tec_depreciation_unit = #{tecDepreciationUnit}, + tec_other = #{tecOther}, + tec_ohter_unit = #{tecOtherUnit}, attr1 = #{attr1}, attr2 = #{attr2}, attr3 = #{attr3}, From fc43732c0c860ed7fa75cff5380dfc61a6c17763 Mon Sep 17 00:00:00 2001 From: Yangwl <1726150332@qq.com> Date: Wed, 29 Nov 2023 13:52:31 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8A=A5=E5=B7=A5?= =?UTF-8?q?=E5=AE=9E=E4=BD=93=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/op/system/api/domain/sap/SapRFW.java | 22 +++++++------------ .../service/impl/IWCInterfaceServiceImpl.java | 4 +++- .../impl/ProOrderWorkorderServiceImpl.java | 1 - 3 files changed, 11 insertions(+), 16 deletions(-) diff --git a/op-api/op-api-system/src/main/java/com/op/system/api/domain/sap/SapRFW.java b/op-api/op-api-system/src/main/java/com/op/system/api/domain/sap/SapRFW.java index e6df8f1a..6d21a116 100644 --- a/op-api/op-api-system/src/main/java/com/op/system/api/domain/sap/SapRFW.java +++ b/op-api/op-api-system/src/main/java/com/op/system/api/domain/sap/SapRFW.java @@ -1,5 +1,7 @@ package com.op.system.api.domain.sap; +import java.util.List; + /** * 报工 */ @@ -7,14 +9,14 @@ public class SapRFW { private String aufnr; private String gamng; private lt_gs lt_gs; - private lt_hw lt_hw; + private List lt_hwList; - public SapRFW.lt_hw getLt_hw() { - return lt_hw; + public List getLt_hwList() { + return lt_hwList; } - public void setLt_hw(SapRFW.lt_hw lt_hw) { - this.lt_hw = lt_hw; + public void setLt_hwList(List lt_hwList) { + this.lt_hwList = lt_hwList; } public SapRFW.lt_gs getLt_gs() { @@ -140,13 +142,5 @@ public class SapRFW { '}'; } } - @Override - public String toString() { - return "{" + - "aufnr:"+aufnr+","+ - "gamng:"+gamng+","+ - "lt_gs:"+lt_gs.toString()+","+ - "lt_hw:"+lt_hw.toString()+","+ - "}"; - } + } diff --git a/op-modules/op-mes/src/main/java/com/op/mes/service/impl/IWCInterfaceServiceImpl.java b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/IWCInterfaceServiceImpl.java index 0c42940d..e9ddc3d9 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/service/impl/IWCInterfaceServiceImpl.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/IWCInterfaceServiceImpl.java @@ -304,10 +304,12 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService { ltgs.setConf_activity5(work.getSac5());//折旧 ltgs.setConf_activity6(work.getSac6()); sapRFW.setLt_gs(ltgs); + List lt_hwList =new ArrayList<>(); SapRFW.lt_hw lthw = sapRFW.new lt_hw();//MES生产订单报工货物移动修改 lthw.setEntry_qnt(work.getQuantityFeedback().toString());//TODO; lthw.setMaterial(work.getProcessCode()); - sapRFW.setLt_hw(lthw); + lt_hwList.add(lthw); + sapRFW.setLt_hwList(lt_hwList); //添加调用sap日志 SysSapLog sysSapLog = new SysSapLog(); sysSapLog.setId(IdUtils.fastSimpleUUID()); diff --git a/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProOrderWorkorderServiceImpl.java b/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProOrderWorkorderServiceImpl.java index ce1bf79c..5c041426 100644 --- a/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProOrderWorkorderServiceImpl.java +++ b/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProOrderWorkorderServiceImpl.java @@ -244,7 +244,6 @@ public class ProOrderWorkorderServiceImpl implements IProOrderWorkorderService { mesPrepare.setStatus("L0");//待确认 proOrderWorkorderMapper.createPrepare(mesPrepare); //备(领)料明细 - List details = new ArrayList<>(); MesPrepareDetailDTO detail = new MesPrepareDetailDTO(); detail.setCreateTime(DateUtils.getNowDate()); From f13ee5d888b8f9a1cec9637c4b0e979623d87a2b Mon Sep 17 00:00:00 2001 From: zhaoxiaolin Date: Wed, 29 Nov 2023 14:18:34 +0800 Subject: [PATCH 3/4] =?UTF-8?q?sap=E8=B0=83=E6=95=B4+=E8=B4=A8=E9=87=8F?= =?UTF-8?q?=E6=89=8B=E6=8C=81=E6=8E=A5=E5=8F=A3+=E9=A6=96=E9=A1=B5?= =?UTF-8?q?=E6=9F=B1=E5=9B=BE=E6=95=B0=E6=8D=AEbug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/IWCInterfaceServiceImpl.java | 2 +- .../mapper/mes/MesReportWorkMapper.xml | 32 ++++++---- .../op/open/service/impl/OpenServiceImpl.java | 2 +- .../main/resources/mapper/open/OpenMapper.xml | 2 +- .../impl/ProOrderWorkorderServiceImpl.java | 19 +++--- .../QcCheckTypeProjectController.java | 4 +- .../op/quality/controller/QuaController.java | 63 ++++++++++++++----- .../op/quality/domain/QcCheckTaskDetail.java | 9 +++ .../op/quality/domain/QcCheckTypeProject.java | 38 +++++++++++ .../mapper/QcCheckTaskIncomeMapper.java | 3 + .../mapper/QcCheckTypeProjectMapper.java | 7 +++ .../service/IQcMaterialGroupService.java | 18 +++--- .../op/quality/service/QcProCheckService.java | 3 + .../QcCheckProjectServiceImpl.java | 16 ++--- .../QcCheckReportIncomeServiceImpl.java | 2 +- .../QcCheckReportProduceServiceImpl.java | 2 +- .../QcCheckReportProductServiceImpl.java | 10 +-- .../impl/QcCheckTaskIncomeServiceImpl.java | 24 +++---- .../QcCheckTypeProjectServiceImpl.java | 31 ++++++--- .../QcCheckTypeServiceImpl.java | 2 +- .../QcMaterialGroupDetailServiceImpl.java | 16 ++--- .../QcMaterialGroupServiceImpl.java | 39 +++++++++--- .../QcProCheckServiceImpl.java | 10 ++- .../QcUserMaterialServiceImpl.java | 16 ++--- .../quality/QcCheckTaskIncomeMapper.xml | 22 ++++--- .../quality/QcCheckTypeProjectMapper.xml | 37 ++++++++++- .../mapper/quality/QcProCheckMapper.xml | 3 +- 27 files changed, 308 insertions(+), 124 deletions(-) rename op-modules/op-quality/src/main/java/com/op/quality/service/{serviceImpl => impl}/QcCheckProjectServiceImpl.java (97%) rename op-modules/op-quality/src/main/java/com/op/quality/service/{serviceImpl => impl}/QcCheckReportIncomeServiceImpl.java (99%) rename op-modules/op-quality/src/main/java/com/op/quality/service/{serviceImpl => impl}/QcCheckReportProduceServiceImpl.java (99%) rename op-modules/op-quality/src/main/java/com/op/quality/service/{serviceImpl => impl}/QcCheckReportProductServiceImpl.java (95%) rename op-modules/op-quality/src/main/java/com/op/quality/service/{serviceImpl => impl}/QcCheckTypeProjectServiceImpl.java (84%) rename op-modules/op-quality/src/main/java/com/op/quality/service/{serviceImpl => impl}/QcCheckTypeServiceImpl.java (98%) rename op-modules/op-quality/src/main/java/com/op/quality/service/{serviceImpl => impl}/QcMaterialGroupDetailServiceImpl.java (97%) rename op-modules/op-quality/src/main/java/com/op/quality/service/{serviceImpl => impl}/QcMaterialGroupServiceImpl.java (85%) rename op-modules/op-quality/src/main/java/com/op/quality/service/{serviceImpl => impl}/QcProCheckServiceImpl.java (93%) rename op-modules/op-quality/src/main/java/com/op/quality/service/{serviceImpl => impl}/QcUserMaterialServiceImpl.java (98%) diff --git a/op-modules/op-mes/src/main/java/com/op/mes/service/impl/IWCInterfaceServiceImpl.java b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/IWCInterfaceServiceImpl.java index 0c42940d..3d53dbd1 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/service/impl/IWCInterfaceServiceImpl.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/IWCInterfaceServiceImpl.java @@ -339,7 +339,7 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService { List sapWorkOrders = mesReportWorkMapper.getSapWorkOrder(work.getWorkorderCode());//根据belong_work_order找到所有要关闭的虚拟工单 for(String sapWorkOrder:sapWorkOrders){ R r2= remoteSapService.sapCloseOrder(sapWorkOrder); - logger.info("工单"+work.getWorkorderCode()+",sapworkorder:"+sapWorkOrder+",sap关闭"+r.getCode()+",返回信息:"+r.getMsg()); + logger.info("工单"+work.getWorkorderCode()+",sapworkorder:"+sapWorkOrder+",sap关闭"+r2.getCode()+",返回信息:"+r2.getMsg()); } work.setStatus("w3"); diff --git a/op-modules/op-mes/src/main/resources/mapper/mes/MesReportWorkMapper.xml b/op-modules/op-mes/src/main/resources/mapper/mes/MesReportWorkMapper.xml index c10cc1b8..f6ae8139 100644 --- a/op-modules/op-mes/src/main/resources/mapper/mes/MesReportWorkMapper.xml +++ b/op-modules/op-mes/src/main/resources/mapper/mes/MesReportWorkMapper.xml @@ -275,18 +275,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" from sys_factory where f_type = 'c' diff --git a/op-modules/op-open/src/main/java/com/op/open/service/impl/OpenServiceImpl.java b/op-modules/op-open/src/main/java/com/op/open/service/impl/OpenServiceImpl.java index eef5e8e8..8383c9a4 100644 --- a/op-modules/op-open/src/main/java/com/op/open/service/impl/OpenServiceImpl.java +++ b/op-modules/op-open/src/main/java/com/op/open/service/impl/OpenServiceImpl.java @@ -209,7 +209,7 @@ public class OpenServiceImpl implements OpenService { List sapWorkOrders = openMapper.getSapWorkOrder(work.getWorkorderCode());//根据belong_work_order找到所有要关闭的虚拟工单 for(String sapWorkOrder:sapWorkOrders){ R rclose = remoteSapService.sapCloseOrder(sapWorkOrder); - logger.info("工单"+work.getWorkorderCode()+",sapworkorder:"+sapWorkOrder+",sap关闭"+r.getCode()+",返回信息:"+r.getMsg()); + logger.info("工单"+work.getWorkorderCode()+",sapworkorder:"+sapWorkOrder+",sap关闭"+rclose.getCode()+",返回信息:"+rclose.getMsg()); } work.setStatus("w3"); work.setUpdateTime(DateUtils.getNowDate()); diff --git a/op-modules/op-open/src/main/resources/mapper/open/OpenMapper.xml b/op-modules/op-open/src/main/resources/mapper/open/OpenMapper.xml index 6057fab1..40ab74ce 100644 --- a/op-modules/op-open/src/main/resources/mapper/open/OpenMapper.xml +++ b/op-modules/op-open/src/main/resources/mapper/open/OpenMapper.xml @@ -124,7 +124,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" diff --git a/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProOrderWorkorderServiceImpl.java b/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProOrderWorkorderServiceImpl.java index ce1bf79c..788fcaa8 100644 --- a/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProOrderWorkorderServiceImpl.java +++ b/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProOrderWorkorderServiceImpl.java @@ -348,14 +348,17 @@ public class ProOrderWorkorderServiceImpl implements IProOrderWorkorderService { //获取领料单 this.getMesPrepare(returnCodes,wcodes); - //关闭母订单子订单会自动关闭//订单的订单编码 - //for(String orderCode:ordercodes){ - R closeR= remoteSapService.sapCloseOrder(ordercodes.get(0)); - logger.info(workorderId+"下发工单后关闭母订单"+ordercodes.get(0)+":"+closeR.getMsg()); - //} - //下达工单 - String[] idsArrayAll = (String[])wids.toArray(new String[wids.size()]); - proOrderWorkorderMapper.downWorkorders(idsArrayAll); + //关闭母子订单//订单的订单编码 + R closeR = null; + for(String orderCode:ordercodes){ + closeR= remoteSapService.sapCloseOrder(orderCode); + logger.info(workorderId+"下发工单后关闭母订单"+orderCode+":"+closeR.getCode()+","+closeR.getMsg()); + } + if(closeR.getCode()==200){ + //下达工单 + String[] idsArrayAll = (String[])wids.toArray(new String[wids.size()]); + proOrderWorkorderMapper.downWorkorders(idsArrayAll); + } } } return 1; diff --git a/op-modules/op-quality/src/main/java/com/op/quality/controller/QcCheckTypeProjectController.java b/op-modules/op-quality/src/main/java/com/op/quality/controller/QcCheckTypeProjectController.java index 5d5bcf84..d5c864fd 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/controller/QcCheckTypeProjectController.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/controller/QcCheckTypeProjectController.java @@ -26,7 +26,7 @@ import com.op.common.core.web.page.TableDataInfo; /** * 物料检验项目维护Controller - * + * * @author Open Platform * @date 2023-10-17 */ @@ -35,8 +35,6 @@ import com.op.common.core.web.page.TableDataInfo; public class QcCheckTypeProjectController extends BaseController { @Autowired private IQcCheckTypeProjectService qcCheckTypeProjectService; - @Autowired - private IQcMaterialGroupService qcMaterialGroupService; /** * 查询物料检验项目维护列表 diff --git a/op-modules/op-quality/src/main/java/com/op/quality/controller/QuaController.java b/op-modules/op-quality/src/main/java/com/op/quality/controller/QuaController.java index fc0cc81e..d63fb830 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/controller/QuaController.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/controller/QuaController.java @@ -7,10 +7,12 @@ import com.op.common.core.utils.StringUtils; import com.op.common.core.web.controller.BaseController; import com.op.common.core.web.domain.AjaxResult; import com.op.common.core.web.page.TableDataInfo; +import com.op.common.security.annotation.RequiresPermissions; import com.op.common.security.utils.SecurityUtils; import com.op.quality.domain.*; import com.op.quality.service.*; import com.op.system.api.RemoteMesService; +import com.op.system.api.domain.SysDictData; import com.op.system.api.domain.dto.WCSDTO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.util.CollectionUtils; @@ -39,7 +41,8 @@ public class QuaController extends BaseController { private IQcCheckTaskWarehousingService qcCheckTaskWarehousingService; @Autowired private IQcCheckTypeService qcCheckTypeService; - + @Autowired + private IQcMaterialGroupService qcMaterialGroupService; @Autowired private IQcCheckTaskIncomeService qcCheckTaskIncomeService; @@ -179,17 +182,14 @@ public class QuaController extends BaseController { * 获取待检验信息列表 */ @GetMapping(value = "getCheckTaskList") - public AjaxResult getCheckTaskList(QcCheckTaskIncome qcCheckTaskIncome) { - if(StringUtils.isBlank(qcCheckTaskIncome.getFactoryCode())){ - return error("[factoryCode]不能为空"); - } - if(StringUtils.isBlank(qcCheckTaskIncome.getCheckType())){ - return error("[checkType]不能为空"); - } - if(StringUtils.isBlank(qcCheckTaskIncome.getCheckManCode())){ - return error("[checkManCode]不能为空"); + public TableDataInfo getCheckTaskList(QcCheckTaskIncome qcCheckTaskIncome) { + + if(StringUtils.isNotBlank(qcCheckTaskIncome.getCheckStatus())){ + qcCheckTaskIncome.setCheckStatus("'"+ qcCheckTaskIncome.getCheckStatus().replace(",","','")+"'"); } - return success(qcProCheckService.getCheckTaskList(qcCheckTaskIncome)); + startPage(); + List list = qcProCheckService.getCheckTaskList(qcCheckTaskIncome); + return getDataTable(list); } /** * 获取待检验信息列表 @@ -204,13 +204,44 @@ public class QuaController extends BaseController { } return success(qcProCheckService.getCheckTaskDetailList(qcCheckTaskDetail)); } - /**检测结果提交**/ - @PostMapping("/commitCheckResults") - public AjaxResult commitCheckResults(@RequestBody List details) { - if(CollectionUtils.isEmpty(details)){ + + /** + * 获取待检验信息列表 + */ + @PostMapping(value = "commitCheckResults") + public AjaxResult commitCheckResults(@RequestBody List qcCheckTaskDetails) { + if(CollectionUtils.isEmpty(qcCheckTaskDetails)){ return error("[List]不能为空"); } - return toAjax(qcCheckTaskIncomeService.commitCheckResults(details)); + return success(qcCheckTaskIncomeService.commitCheckResults(qcCheckTaskDetails)); + } + /** + * 检验单位 + */ + @GetMapping(value = "getQcUnitList") + public TableDataInfo getQcUnitList(SysDictData sysDictData) { + startPage(); + List list = qcProCheckService.getQcUnitList(sysDictData); + return getDataTable(list); + } + /** + * 检验项目 + */ + @GetMapping("/pdaMaterialTree") + public AjaxResult pdaMaterialTree(QcMaterialGroup materialGroup) { + DynamicDataSourceContextHolder.push("ds_"+materialGroup.getFactoryCode()); + return success(qcMaterialGroupService.selectQcMaterialTreeList(materialGroup)); } + /** + * 查询物料检验项目维护列表 + */ + + @GetMapping("/getCheckTypeProjectList") + public TableDataInfo list(QcCheckTypeProject qcCheckTypeProject) { + DynamicDataSourceContextHolder.push("ds_"+qcCheckTypeProject.getFactoryCode()); + startPage(); + List list = qcMaterialGroupService.getCheckTypeProjectList(qcCheckTypeProject); + return getDataTable(list); + } } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckTaskDetail.java b/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckTaskDetail.java index 72b8ac8d..4517e562 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckTaskDetail.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckTaskDetail.java @@ -95,6 +95,15 @@ public class QcCheckTaskDetail extends BaseEntity { private List actualValues; private String typeProjectId; private String defectCode; + private String checkType; + + public String getCheckType() { + return checkType; + } + + public void setCheckType(String checkType) { + this.checkType = checkType; + } public String getDefectCode() { return defectCode; diff --git a/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckTypeProject.java b/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckTypeProject.java index bc93b9a0..5619b9b9 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckTypeProject.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckTypeProject.java @@ -70,10 +70,48 @@ public class QcCheckTypeProject extends BaseEntity { @Excel(name = "物料编码") private String materialCode; + private String materialName; + private Integer sort; private String projectNo; + private String checkTool; + private String checkMode; + private String uint; + + public String getUint() { + return uint; + } + + public void setUint(String uint) { + this.uint = uint; + } + + public String getCheckTool() { + return checkTool; + } + + public void setCheckTool(String checkTool) { + this.checkTool = checkTool; + } + + public String getCheckMode() { + return checkMode; + } + + public void setCheckMode(String checkMode) { + this.checkMode = checkMode; + } + + public String getMaterialName() { + return materialName; + } + + public void setMaterialName(String materialName) { + this.materialName = materialName; + } + public Integer getSort() { return sort; } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcCheckTaskIncomeMapper.java b/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcCheckTaskIncomeMapper.java index f5b04059..bfe82357 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcCheckTaskIncomeMapper.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcCheckTaskIncomeMapper.java @@ -6,6 +6,7 @@ import com.op.quality.domain.QcBomComponent; import com.op.quality.domain.QcCheckTaskDetail; import com.op.quality.domain.QcCheckTaskIncome; import com.op.quality.domain.QcSupplier; +import com.op.system.api.domain.SysDictData; import com.op.system.api.domain.SysUser; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -79,4 +80,6 @@ public interface QcCheckTaskIncomeMapper { int updateQcCheckTask(QcCheckTaskIncome qcCheckTask); int updateQcCheckTaskDetails(@Param("list") List details); + + List getQcUnitList(SysDictData sysDictData); } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcCheckTypeProjectMapper.java b/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcCheckTypeProjectMapper.java index 16969171..15c7b8f3 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcCheckTypeProjectMapper.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcCheckTypeProjectMapper.java @@ -1,9 +1,12 @@ package com.op.quality.mapper; import java.util.List; +import java.util.Map; import com.op.quality.domain.QcCheckTaskDetail; import com.op.quality.domain.QcCheckTypeProject; +import com.op.system.api.domain.SysDictData; +import org.apache.ibatis.annotations.MapKey; import org.apache.ibatis.annotations.Mapper; /** @@ -65,4 +68,8 @@ public interface QcCheckTypeProjectMapper { List getTPByTypeMaterial(QcCheckTypeProject qctp); List getTPByTypeGroup(QcCheckTypeProject qctp); + + List getCheckTypeProjectList(QcCheckTypeProject qcCheckTypeProject); + @MapKey("dictValue") + Map getDictMap(SysDictData sysDictData); } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/IQcMaterialGroupService.java b/op-modules/op-quality/src/main/java/com/op/quality/service/IQcMaterialGroupService.java index 1ed5f635..32d573c9 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/service/IQcMaterialGroupService.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/IQcMaterialGroupService.java @@ -1,20 +1,22 @@ package com.op.quality.service; import java.util.List; + +import com.op.quality.domain.QcCheckTypeProject; import com.op.quality.domain.QcMaterialGroup; import com.op.quality.domain.vo.TreeSelect; import com.op.system.api.domain.SysDept; /** * 物料组Service接口 - * + * * @author materialGroup * @date 2023-10-16 */ public interface IQcMaterialGroupService { /** * 查询物料组 - * + * * @param id 物料组主键 * @return 物料组 */ @@ -22,7 +24,7 @@ public interface IQcMaterialGroupService { /** * 查询物料组列表 - * + * * @param qcMaterialGroup 物料组 * @return 物料组集合 */ @@ -38,7 +40,7 @@ public interface IQcMaterialGroupService { /** * 新增物料组 - * + * * @param qcMaterialGroup 物料组 * @return 结果 */ @@ -46,7 +48,7 @@ public interface IQcMaterialGroupService { /** * 修改物料组 - * + * * @param qcMaterialGroup 物料组 * @return 结果 */ @@ -54,7 +56,7 @@ public interface IQcMaterialGroupService { /** * 批量删除物料组 - * + * * @param ids 需要删除的物料组主键集合 * @return 结果 */ @@ -62,11 +64,13 @@ public interface IQcMaterialGroupService { /** * 删除物料组信息 - * + * * @param id 物料组主键 * @return 结果 */ public int deleteQcMaterialGroupById(String id); public boolean validationData(String id); + + List getCheckTypeProjectList(QcCheckTypeProject qcCheckTypeProject); } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/QcProCheckService.java b/op-modules/op-quality/src/main/java/com/op/quality/service/QcProCheckService.java index 46bb5cc0..785a37c3 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/service/QcProCheckService.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/QcProCheckService.java @@ -6,6 +6,7 @@ import com.op.quality.domain.QcCheckTaskDetail; import com.op.quality.domain.QcCheckTaskIncome; import com.op.quality.domain.QcCheckTypeProject; import com.op.quality.domain.QcProCheck; +import com.op.system.api.domain.SysDictData; import java.util.List; @@ -34,4 +35,6 @@ public interface QcProCheckService { List getCheckTaskList(QcCheckTaskIncome qcCheckTaskIncome); List getCheckTaskDetailList(QcCheckTaskDetail qcCheckTaskDetail); + + List getQcUnitList(SysDictData sysDictData); } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcCheckProjectServiceImpl.java b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckProjectServiceImpl.java similarity index 97% rename from op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcCheckProjectServiceImpl.java rename to op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckProjectServiceImpl.java index c37f5bc5..6e6fd606 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcCheckProjectServiceImpl.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckProjectServiceImpl.java @@ -1,4 +1,4 @@ -package com.op.quality.service.serviceImpl; +package com.op.quality.service.impl; import java.util.List; @@ -19,7 +19,7 @@ import javax.servlet.http.HttpServletRequest; /** * 检验项目维护Service业务层处理 - * + * * @author Open Platform * @date 2023-10-13 */ @@ -30,7 +30,7 @@ public class QcCheckProjectServiceImpl implements IQcCheckProjectService { /** * 查询检验项目维护 - * + * * @param id 检验项目维护主键 * @return 检验项目维护 */ @@ -42,7 +42,7 @@ public class QcCheckProjectServiceImpl implements IQcCheckProjectService { /** * 查询检验项目维护列表 - * + * * @param qcCheckProject 检验项目维护 * @return 检验项目维护 */ @@ -54,7 +54,7 @@ public class QcCheckProjectServiceImpl implements IQcCheckProjectService { /** * 新增检验项目维护 - * + * * @param qcCheckProject 检验项目维护 * @return 结果 */ @@ -77,7 +77,7 @@ public class QcCheckProjectServiceImpl implements IQcCheckProjectService { /** * 修改检验项目维护 - * + * * @param qcCheckProject 检验项目维护 * @return 结果 */ @@ -91,7 +91,7 @@ public class QcCheckProjectServiceImpl implements IQcCheckProjectService { /** * 批量删除检验项目维护 - * + * * @param ids 需要删除的检验项目维护主键 * @return 结果 */ @@ -103,7 +103,7 @@ public class QcCheckProjectServiceImpl implements IQcCheckProjectService { /** * 删除检验项目维护信息 - * + * * @param id 检验项目维护主键 * @return 结果 */ diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcCheckReportIncomeServiceImpl.java b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckReportIncomeServiceImpl.java similarity index 99% rename from op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcCheckReportIncomeServiceImpl.java rename to op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckReportIncomeServiceImpl.java index aeb97d41..7cec9cea 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcCheckReportIncomeServiceImpl.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckReportIncomeServiceImpl.java @@ -1,4 +1,4 @@ -package com.op.quality.service.serviceImpl; +package com.op.quality.service.impl; import com.alibaba.fastjson2.JSONArray; import com.baomidou.dynamic.datasource.annotation.DS; diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcCheckReportProduceServiceImpl.java b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckReportProduceServiceImpl.java similarity index 99% rename from op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcCheckReportProduceServiceImpl.java rename to op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckReportProduceServiceImpl.java index 1feb3952..0dd13d13 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcCheckReportProduceServiceImpl.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckReportProduceServiceImpl.java @@ -1,4 +1,4 @@ -package com.op.quality.service.serviceImpl; +package com.op.quality.service.impl; import com.baomidou.dynamic.datasource.annotation.DS; import com.op.common.core.utils.DateUtils; diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcCheckReportProductServiceImpl.java b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckReportProductServiceImpl.java similarity index 95% rename from op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcCheckReportProductServiceImpl.java rename to op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckReportProductServiceImpl.java index 8c34e2c2..3dbfaf3d 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcCheckReportProductServiceImpl.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckReportProductServiceImpl.java @@ -1,4 +1,4 @@ -package com.op.quality.service.serviceImpl; +package com.op.quality.service.impl; import com.baomidou.dynamic.datasource.annotation.DS; import com.op.common.core.utils.DateUtils; @@ -102,12 +102,12 @@ public class QcCheckReportProductServiceImpl implements IQcCheckReportProductSer qctp.setTypeId(qcCheckReportIncome.getCheckType());//生产过程检验 qctp.setMaterialCode(qcCheckReportIncome.getMaterialCode());//特性 /**qc_check_type_project**/ - List items = qcCheckTypeProjectMapper.getTPByTypeMaterial(qctp); - if(CollectionUtils.isEmpty(items)){ - /**qc_material_group_detail**/ + List items = qcCheckTypeProjectMapper.getTPByTypeMaterial(qctp); + if(CollectionUtils.isEmpty(items)){ + /**qc_material_group_detail**/ QcMaterialGroupDetail group = qcMaterialGroupDetailMapper.getGroupByMaterial(qcCheckReportIncome.getMaterialCode()); if(group == null){ - return 0;//没有找到检测项目 + return 0;//没有找到检测项目 } qctp.setGroupId(group.getGroupId());//共性 items = qcCheckTypeProjectMapper.getTPByTypeGroup(qctp); diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckTaskIncomeServiceImpl.java b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckTaskIncomeServiceImpl.java index 584aa143..b1544f82 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckTaskIncomeServiceImpl.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckTaskIncomeServiceImpl.java @@ -296,6 +296,7 @@ public class QcCheckTaskIncomeServiceImpl implements IQcCheckTaskIncomeService { String factoryCode = details.get(0).getFactoryCode(); String updateBy = details.get(0).getUpdateBy(); String belongId = details.get(0).getBelongTo(); + String checkType = details.get(0).getCheckType(); //默认合格 String result = "Y"; @@ -318,22 +319,23 @@ public class QcCheckTaskIncomeServiceImpl implements IQcCheckTaskIncomeService { logger.info("qc_check_task:"+n); /**更新qc_check_task_detail**/ for(QcCheckTaskDetail detail:details){ - + detail.setUpdateTime(nowTime); } - n= qcCheckTaskIncomeMapper.updateQcCheckTaskDetails(details);; + n= qcCheckTaskIncomeMapper.updateQcCheckTaskDetails(details); logger.info("更新qc_check_task_detail:"+n); //不合格处理 if("N".equals(result)){ -// QcCheckUnqualified unqualified = new QcCheckUnqualified(); -// unqualified.setId(IdUtils.fastSimpleUUID()); -// unqualified.setTaskId(qcCheckTaskIncome.getRecordId()); -// unqualified.setCreateTime(DateUtils.getNowDate()); -// unqualified.setCreateBy(qcCheckTaskIncome.getUpdateBy()); -// unqualified.setFactoryCode(factoryCode); -// unqualified.setType(qcCheckTaskIncome.getCheckType()); -// /**qc_check_unqualified**/ -// qcCheckUnqualifiedMapper.insertQcCheckUnqualified(unqualified); + QcCheckUnqualified unqualified = new QcCheckUnqualified(); + unqualified.setId(IdUtils.fastSimpleUUID()); + unqualified.setTaskId(belongId); + unqualified.setCreateTime(DateUtils.getNowDate()); + unqualified.setCreateBy(updateBy); + unqualified.setFactoryCode(factoryCode); + unqualified.setType(checkType); + /**qc_check_unqualified**/ + n = qcCheckUnqualifiedMapper.insertQcCheckUnqualified(unqualified); + logger.info("qc_check_unqualified:"+n); } return n ; diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcCheckTypeProjectServiceImpl.java b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckTypeProjectServiceImpl.java similarity index 84% rename from op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcCheckTypeProjectServiceImpl.java rename to op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckTypeProjectServiceImpl.java index adc747b7..14244499 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcCheckTypeProjectServiceImpl.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckTypeProjectServiceImpl.java @@ -1,11 +1,14 @@ -package com.op.quality.service.serviceImpl; +package com.op.quality.service.impl; import java.util.List; +import java.util.Map; import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder; import com.op.common.core.utils.DateUtils; import com.op.common.core.utils.uuid.IdUtils; import com.op.common.security.utils.SecurityUtils; +import com.op.system.api.domain.SysDictData; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.op.quality.mapper.QcCheckTypeProjectMapper; @@ -18,7 +21,7 @@ import javax.servlet.http.HttpServletRequest; /** * 物料检验项目维护Service业务层处理 - * + * * @author Open Platform * @date 2023-10-17 */ @@ -29,7 +32,7 @@ public class QcCheckTypeProjectServiceImpl implements IQcCheckTypeProjectService /** * 查询物料检验项目维护 - * + * * @param id 物料检验项目维护主键 * @return 物料检验项目维护 */ @@ -41,19 +44,29 @@ public class QcCheckTypeProjectServiceImpl implements IQcCheckTypeProjectService /** * 查询物料检验项目维护列表 - * + * * @param qcCheckTypeProject 物料检验项目维护 * @return 物料检验项目维护 */ @Override @DS("#header.poolName") public List selectQcCheckTypeProjectList(QcCheckTypeProject qcCheckTypeProject) { - return qcCheckTypeProjectMapper.selectQcCheckTypeProjectList(qcCheckTypeProject); + List dtos = qcCheckTypeProjectMapper.selectQcCheckTypeProjectList(qcCheckTypeProject); + DynamicDataSourceContextHolder.push("master"); + SysDictData sData = new SysDictData(); + sData.setDictType("unit"); + Map dictMap = qcCheckTypeProjectMapper.getDictMap(sData); + if(dictMap != null){ + for(QcCheckTypeProject dto:dtos){ + dto.setUint(dictMap.get(dto.getUint()).getDictLabel()); + } + } + return dtos; } /** * 新增物料检验项目维护 - * + * * @param qcCheckTypeProject 物料检验项目维护 * @return 结果 */ @@ -71,7 +84,7 @@ public class QcCheckTypeProjectServiceImpl implements IQcCheckTypeProjectService /** * 修改物料检验项目维护 - * + * * @param qcCheckTypeProject 物料检验项目维护 * @return 结果 */ @@ -85,7 +98,7 @@ public class QcCheckTypeProjectServiceImpl implements IQcCheckTypeProjectService /** * 批量删除物料检验项目维护 - * + * * @param ids 需要删除的物料检验项目维护主键 * @return 结果 */ @@ -97,7 +110,7 @@ public class QcCheckTypeProjectServiceImpl implements IQcCheckTypeProjectService /** * 删除物料检验项目维护信息 - * + * * @param id 物料检验项目维护主键 * @return 结果 */ diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcCheckTypeServiceImpl.java b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckTypeServiceImpl.java similarity index 98% rename from op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcCheckTypeServiceImpl.java rename to op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckTypeServiceImpl.java index 0c7ff187..88ee8cb9 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcCheckTypeServiceImpl.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckTypeServiceImpl.java @@ -1,4 +1,4 @@ -package com.op.quality.service.serviceImpl; +package com.op.quality.service.impl; import java.util.List; diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcMaterialGroupDetailServiceImpl.java b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcMaterialGroupDetailServiceImpl.java similarity index 97% rename from op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcMaterialGroupDetailServiceImpl.java rename to op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcMaterialGroupDetailServiceImpl.java index 5867ad43..0d8325da 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcMaterialGroupDetailServiceImpl.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcMaterialGroupDetailServiceImpl.java @@ -1,4 +1,4 @@ -package com.op.quality.service.serviceImpl; +package com.op.quality.service.impl; import java.util.List; @@ -18,7 +18,7 @@ import javax.servlet.http.HttpServletRequest; /** * 物料组成员Service业务层处理 - * + * * @author Open Platform * @date 2023-10-18 */ @@ -29,7 +29,7 @@ public class QcMaterialGroupDetailServiceImpl implements IQcMaterialGroupDetailS /** * 查询物料组成员 - * + * * @param id 物料组成员主键 * @return 物料组成员 */ @@ -41,7 +41,7 @@ public class QcMaterialGroupDetailServiceImpl implements IQcMaterialGroupDetailS /** * 查询物料组成员列表 - * + * * @param qcMaterialGroupDetail 物料组成员 * @return 物料组成员 */ @@ -53,7 +53,7 @@ public class QcMaterialGroupDetailServiceImpl implements IQcMaterialGroupDetailS /** * 新增物料组成员 - * + * * @param qcMaterialGroupDetail 物料组成员 * @return 结果 */ @@ -71,7 +71,7 @@ public class QcMaterialGroupDetailServiceImpl implements IQcMaterialGroupDetailS /** * 修改物料组成员 - * + * * @param qcMaterialGroupDetail 物料组成员 * @return 结果 */ @@ -84,7 +84,7 @@ public class QcMaterialGroupDetailServiceImpl implements IQcMaterialGroupDetailS /** * 批量删除物料组成员 - * + * * @param ids 需要删除的物料组成员主键 * @return 结果 */ @@ -96,7 +96,7 @@ public class QcMaterialGroupDetailServiceImpl implements IQcMaterialGroupDetailS /** * 删除物料组成员信息 - * + * * @param id 物料组成员主键 * @return 结果 */ diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcMaterialGroupServiceImpl.java b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcMaterialGroupServiceImpl.java similarity index 85% rename from op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcMaterialGroupServiceImpl.java rename to op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcMaterialGroupServiceImpl.java index 4307a3bc..08c509b4 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcMaterialGroupServiceImpl.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcMaterialGroupServiceImpl.java @@ -1,4 +1,4 @@ -package com.op.quality.service.serviceImpl; +package com.op.quality.service.impl; import java.util.ArrayList; import java.util.Iterator; @@ -7,13 +7,17 @@ import java.util.Map; import java.util.stream.Collectors; import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder; import com.op.common.core.utils.DateUtils; import com.op.common.core.utils.SpringUtils; import com.op.common.core.utils.StringUtils; import com.op.common.core.utils.uuid.IdUtils; import com.op.common.datascope.annotation.DataScope; import com.op.common.security.utils.SecurityUtils; +import com.op.quality.domain.QcCheckTypeProject; import com.op.quality.domain.vo.TreeSelect; +import com.op.quality.mapper.QcCheckTypeProjectMapper; +import com.op.system.api.domain.SysDictData; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.op.quality.mapper.QcMaterialGroupMapper; @@ -26,7 +30,7 @@ import javax.servlet.http.HttpServletRequest; /** * 物料组Service业务层处理 - * + * * @author materialGroup * @date 2023-10-16 */ @@ -34,10 +38,12 @@ import javax.servlet.http.HttpServletRequest; public class QcMaterialGroupServiceImpl implements IQcMaterialGroupService { @Autowired private QcMaterialGroupMapper qcMaterialGroupMapper; + @Autowired + private QcCheckTypeProjectMapper qcCheckTypeProjectMapper; /** * 查询物料组 - * + * * @param id 物料组主键 * @return 物料组 */ @@ -46,7 +52,7 @@ public class QcMaterialGroupServiceImpl implements IQcMaterialGroupService { return qcMaterialGroupMapper.selectQcMaterialGroupById(id); } @Override - @DataScope(deptAlias = "d") + //@DataScope(deptAlias = "d") @DS("#header.poolName") public List selectQcMaterialGroupList(QcMaterialGroup qcMaterialGroup) { return qcMaterialGroupMapper.selectQcMaterialGroupList(qcMaterialGroup); @@ -54,7 +60,7 @@ public class QcMaterialGroupServiceImpl implements IQcMaterialGroupService { /** * 查询物料树列表 - * + * * @param qcMaterialGroup 物料组 * @return 物料组 */ @@ -119,7 +125,7 @@ public class QcMaterialGroupServiceImpl implements IQcMaterialGroupService { /** * 新增物料组 - * + * * @param qcMaterialGroup 物料组 * @return 结果 */ @@ -137,7 +143,7 @@ public class QcMaterialGroupServiceImpl implements IQcMaterialGroupService { /** * 修改物料组 - * + * * @param qcMaterialGroup 物料组 * @return 结果 */ @@ -151,7 +157,7 @@ public class QcMaterialGroupServiceImpl implements IQcMaterialGroupService { /** * 批量删除物料组 - * + * * @param ids 需要删除的物料组主键 * @return 结果 */ @@ -163,7 +169,7 @@ public class QcMaterialGroupServiceImpl implements IQcMaterialGroupService { /** * 删除物料组信息 - * + * * @param id 物料组主键 * @return 结果 */ @@ -179,6 +185,21 @@ public class QcMaterialGroupServiceImpl implements IQcMaterialGroupService { return qcMaterialGroupMapper.validationData(id).size() > 0; } + @Override + public List getCheckTypeProjectList(QcCheckTypeProject qcCheckTypeProject) { + List dtos = qcCheckTypeProjectMapper.getCheckTypeProjectList(qcCheckTypeProject); + DynamicDataSourceContextHolder.push("master"); + SysDictData sData = new SysDictData(); + sData.setDictType("unit"); + Map dictMap = qcCheckTypeProjectMapper.getDictMap(sData); + if(dictMap != null){ + for(QcCheckTypeProject dto:dtos){ + dto.setUint(dictMap.get(dto.getUint()).getDictLabel()); + } + } + return dtos; + } + private boolean hasChild(List list, QcMaterialGroup t) { return getChildList(list, t).size() > 0 ? true : false; } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcProCheckServiceImpl.java b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcProCheckServiceImpl.java similarity index 93% rename from op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcProCheckServiceImpl.java rename to op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcProCheckServiceImpl.java index 005a118d..12f7129a 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcProCheckServiceImpl.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcProCheckServiceImpl.java @@ -1,5 +1,6 @@ -package com.op.quality.service.serviceImpl; +package com.op.quality.service.impl; +import com.baomidou.dynamic.datasource.annotation.DS; import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder; import com.op.common.core.domain.BaseFileData; import com.op.common.core.domain.R; @@ -14,6 +15,7 @@ import com.op.quality.domain.QcProCheck; import com.op.quality.mapper.QcCheckTaskIncomeMapper; import com.op.quality.mapper.QcProCheckMapper; import com.op.quality.service.QcProCheckService; +import com.op.system.api.domain.SysDictData; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -127,4 +129,10 @@ public class QcProCheckServiceImpl implements QcProCheckService { return qcCheckTaskIncomeMapper.getCkeckProjectList(qcCheckTaskDetail); } + @Override + @DS("master") + public List getQcUnitList(SysDictData sysDictData) { + return qcCheckTaskIncomeMapper.getQcUnitList(sysDictData); + } + } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcUserMaterialServiceImpl.java b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcUserMaterialServiceImpl.java similarity index 98% rename from op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcUserMaterialServiceImpl.java rename to op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcUserMaterialServiceImpl.java index 1e4a3379..016f5a27 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcUserMaterialServiceImpl.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcUserMaterialServiceImpl.java @@ -1,4 +1,4 @@ -package com.op.quality.service.serviceImpl; +package com.op.quality.service.impl; import java.util.Date; import java.util.List; @@ -20,7 +20,7 @@ import javax.servlet.http.HttpServletRequest; /** * 人员物料绑定Service业务层处理 - * + * * @author Open Platform * @date 2023-10-09 */ @@ -35,7 +35,7 @@ public class QcUserMaterialServiceImpl implements IQcUserMaterialService { /** * 查询人员物料绑定 - * + * * @param userCode 人员物料绑定主键 * @return 人员物料绑定 */ @@ -53,7 +53,7 @@ public class QcUserMaterialServiceImpl implements IQcUserMaterialService { /** * 查询人员物料绑定列表 - * + * * @param qcUserMaterial 人员物料绑定 * @return 人员物料绑定 */ @@ -65,7 +65,7 @@ public class QcUserMaterialServiceImpl implements IQcUserMaterialService { /** * 新增人员物料绑定 - * + * * @param qcUserMaterial 人员物料绑定 * @return 结果 */ @@ -105,7 +105,7 @@ public class QcUserMaterialServiceImpl implements IQcUserMaterialService { /** * 修改人员物料绑定 - * + * * @param qcUserMaterial 人员物料绑定 * @return 结果 */ @@ -118,7 +118,7 @@ public class QcUserMaterialServiceImpl implements IQcUserMaterialService { /** * 批量删除人员物料绑定 - * + * * @param userCodes 需要删除的人员物料绑定主键 * @return 结果 */ @@ -130,7 +130,7 @@ public class QcUserMaterialServiceImpl implements IQcUserMaterialService { /** * 删除人员物料绑定信息 - * + * * @param qcUserMaterial 人员物料绑定 * @return 结果 */ diff --git a/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTaskIncomeMapper.xml b/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTaskIncomeMapper.xml index 37ede2ca..01fc9767 100644 --- a/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTaskIncomeMapper.xml +++ b/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTaskIncomeMapper.xml @@ -131,7 +131,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" td.create_time createTime, td.update_by updateBy, td.update_time updateTime, - td.update_time updateTime, td.belong_to belongTo, qctp.upper_diff upperDiff, qctp.down_diff downDiff, @@ -140,8 +139,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" left join qc_check_type_project qctp on td.type_project_id = qctp.id where td.belong_to = #{belongTo} and td.del_flag='0' and qctp.del_flag = '0' + - + insert into qc_check_task record_id, @@ -258,14 +264,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" update qc_check_task_detail set - zh_desc = #{item.name1}, - contact_phone = #{item.telf1}, - address = #{item.stras}, - factory_code = #{item.bukrs}, - create_time= #{item.erdat}, - update_time = #{item.erdat} + actual_value = #{item.actualValue}, + status = #{item.status}, + update_by = #{item.updateBy}, + update_time = #{item.updateTime} where - supplier_code = #{item.lifnr} + record_id = #{item.recordId} diff --git a/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTypeProjectMapper.xml b/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTypeProjectMapper.xml index dc43d312..231ccdbc 100644 --- a/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTypeProjectMapper.xml +++ b/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTypeProjectMapper.xml @@ -26,7 +26,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select id, project_id, type_id, standard_value, upper_diff, down_diff, sample, status, attr1, create_by, create_time, update_by, update_time, factory_code, del_flag, group_id, material_code, sample_num from qc_check_type_project + select id, project_id, type_id, standard_value, upper_diff, down_diff, sample, status, attr1, + create_by, create_time, update_by, update_time, factory_code, del_flag, group_id, material_code, sample_num + from qc_check_type_project - + + insert into qc_check_type_project diff --git a/op-modules/op-quality/src/main/resources/mapper/quality/QcProCheckMapper.xml b/op-modules/op-quality/src/main/resources/mapper/quality/QcProCheckMapper.xml index 9e36c0ea..6d96fc3a 100644 --- a/op-modules/op-quality/src/main/resources/mapper/quality/QcProCheckMapper.xml +++ b/op-modules/op-quality/src/main/resources/mapper/quality/QcProCheckMapper.xml @@ -248,12 +248,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" 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_man_code,qct.check_man_name, qct.check_time, qct.check_result, - qct.status,qct.create_by,qct.create_time + qct.status,qct.create_by,qct.create_time,qct.check_type from qc_check_task qct and qct.del_flag = '0' and qct.check_type = #{checkType} and qct.check_man_code = #{checkManCode} + and qct.check_status in (#{checkStatus}) order by qct.create_time desc From 3fc57331874cfc4562da6ac847af488e74a08771 Mon Sep 17 00:00:00 2001 From: A0010407 Date: Wed, 29 Nov 2023 16:53:07 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E8=AE=BE=E5=A4=87=E7=9C=8B=E6=9D=BF?= =?UTF-8?q?=E5=88=B7=E6=96=B0=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../device/controller/DeviceInterfaceController.java | 10 ++++++++++ .../com/op/device/mapper/DeviceInterfaceMapper.java | 6 ++++++ .../op/device/service/IDeviceInterfaceService.java | 6 ++++++ .../service/impl/DeviceInterfaceServiceImpl.java | 11 +++++++++++ .../resources/mapper/device/DeviceInterfaceMapper.xml | 6 ++++++ 5 files changed, 39 insertions(+) diff --git a/op-modules/op-device/src/main/java/com/op/device/controller/DeviceInterfaceController.java b/op-modules/op-device/src/main/java/com/op/device/controller/DeviceInterfaceController.java index ee308a84..bd048a05 100644 --- a/op-modules/op-device/src/main/java/com/op/device/controller/DeviceInterfaceController.java +++ b/op-modules/op-device/src/main/java/com/op/device/controller/DeviceInterfaceController.java @@ -71,4 +71,14 @@ public class DeviceInterfaceController { public AjaxResult getEquipmentIntactRate(EquOperationRecord equOperationRecord) { return deviceInterfaceService.getEquipmentIntactRate(equOperationRecord); } + + /** + * 设备看板刷新时间 + * 初始值:五分钟刷新一次 + */ + @GetMapping("/getDeviceRefreshTime") + public AjaxResult getDeviceRefreshTime(EquOperationRecord equOperationRecord) { + return deviceInterfaceService.getDeviceRefreshTime(equOperationRecord); + } + } diff --git a/op-modules/op-device/src/main/java/com/op/device/mapper/DeviceInterfaceMapper.java b/op-modules/op-device/src/main/java/com/op/device/mapper/DeviceInterfaceMapper.java index c0391bb8..9f63567c 100644 --- a/op-modules/op-device/src/main/java/com/op/device/mapper/DeviceInterfaceMapper.java +++ b/op-modules/op-device/src/main/java/com/op/device/mapper/DeviceInterfaceMapper.java @@ -37,4 +37,10 @@ public interface DeviceInterfaceMapper { MesReportWork selectReportWorkByEquipmentCode(String equipmentCode); List selectRepairRecordByEquipmentCode(String equipmentCode); + + /** + * 设备看板刷新时间 + * 初始值:5分钟 + */ + String getDeviceRefreshTime(EquOperationRecord equOperationRecord); } diff --git a/op-modules/op-device/src/main/java/com/op/device/service/IDeviceInterfaceService.java b/op-modules/op-device/src/main/java/com/op/device/service/IDeviceInterfaceService.java index 466671e2..db04b539 100644 --- a/op-modules/op-device/src/main/java/com/op/device/service/IDeviceInterfaceService.java +++ b/op-modules/op-device/src/main/java/com/op/device/service/IDeviceInterfaceService.java @@ -39,4 +39,10 @@ public interface IDeviceInterfaceService { * @return */ AjaxResult getEquipmentIntactRate(EquOperationRecord equOperationRecord); + + /** + * 设备看板刷新时间 + * 初始值:5分钟 + */ + public AjaxResult getDeviceRefreshTime(EquOperationRecord equOperationRecord); } diff --git a/op-modules/op-device/src/main/java/com/op/device/service/impl/DeviceInterfaceServiceImpl.java b/op-modules/op-device/src/main/java/com/op/device/service/impl/DeviceInterfaceServiceImpl.java index a58cb137..da8fba1c 100644 --- a/op-modules/op-device/src/main/java/com/op/device/service/impl/DeviceInterfaceServiceImpl.java +++ b/op-modules/op-device/src/main/java/com/op/device/service/impl/DeviceInterfaceServiceImpl.java @@ -206,4 +206,15 @@ public class DeviceInterfaceServiceImpl implements IDeviceInterfaceService { EquOperationRecord equipmentIntactRate = equOperationRecordMapper.getEquipmentIntactRate(equOperationRecord); return success(equipmentIntactRate); } + + /** + * 看板刷新时间 + */ + @Override + @DS("master") + public AjaxResult getDeviceRefreshTime(EquOperationRecord equOperationRecord) { + String refreshTime = deviceInterfaceMapper.getDeviceRefreshTime(equOperationRecord); + int time = Integer.parseInt(refreshTime); + return success(time); + } } diff --git a/op-modules/op-device/src/main/resources/mapper/device/DeviceInterfaceMapper.xml b/op-modules/op-device/src/main/resources/mapper/device/DeviceInterfaceMapper.xml index 27dfd636..bd81324d 100644 --- a/op-modules/op-device/src/main/resources/mapper/device/DeviceInterfaceMapper.xml +++ b/op-modules/op-device/src/main/resources/mapper/device/DeviceInterfaceMapper.xml @@ -58,4 +58,10 @@ and wo.work_status = '1' + + \ No newline at end of file