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},