diff --git a/op-api/op-api-system/src/main/java/com/op/system/api/RemoteSapService.java b/op-api/op-api-system/src/main/java/com/op/system/api/RemoteSapService.java index 6b8d2a27..7c1c73cf 100644 --- a/op-api/op-api-system/src/main/java/com/op/system/api/RemoteSapService.java +++ b/op-api/op-api-system/src/main/java/com/op/system/api/RemoteSapService.java @@ -40,7 +40,7 @@ public interface RemoteSapService { /**关闭订单**/ @PostMapping("/sap/sapCloseOrder") - public R sapCloseOrder(@RequestParam("shopOrder") String shopOrder); + public R sapCloseOrder(@RequestBody SapCloseOrderQuery sapCloseOrderQuery); /**报工**/ @PostMapping("/sap/sapRFWOrder") diff --git a/op-api/op-api-system/src/main/java/com/op/system/api/domain/mes/MesReportWorkConsumeDTO.java b/op-api/op-api-system/src/main/java/com/op/system/api/domain/mes/MesReportWorkConsumeDTO.java new file mode 100644 index 00000000..abfbf4cf --- /dev/null +++ b/op-api/op-api-system/src/main/java/com/op/system/api/domain/mes/MesReportWorkConsumeDTO.java @@ -0,0 +1,197 @@ +package com.op.system.api.domain.mes; + +import com.op.common.core.annotation.Excel; +import com.op.common.core.web.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +/** + * 生产报工物料消耗对象 mes_report_work_consume + * + * @author Open Platform + * @date 2023-08-24 + */ +public class MesReportWorkConsumeDTO extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** id */ + private String recordId; + + /** 工单编码 */ + @Excel(name = "工单编码") + private String workorderCode; + + /** 物料编号 */ + @Excel(name = "物料编号") + private String materialCode; + + /** 物料名称 */ + @Excel(name = "物料名称") + private String materialName; + + /** 物料规格型号 */ + @Excel(name = "物料规格型号") + private String materialSpc; + + /** 数量 */ + @Excel(name = "数量") + private Long quantity; + + /** 单位 */ + @Excel(name = "单位") + private String unit; + + /** 预留字段1 */ + @Excel(name = "预留字段1") + private String attr1; + + /** 预留字段2 */ + @Excel(name = "预留字段2") + private String attr2; + + /** 预留字段3 */ + @Excel(name = "预留字段3") + private String attr3; + + /** 预留字段4 */ + @Excel(name = "预留字段4") + private String attr4; + + /** 工厂编码 */ + @Excel(name = "工厂编码") + private String factoryCode; + + /** 工厂编码 */ + @Excel(name = "报工编码") + private String reportCode; + + //虚拟字段 + private String id; + + public void setRecordId(String recordId) { + this.recordId = recordId; + } + + public String getRecordId() { + return recordId; + } + + public void setWorkorderCode(String workorderCode) { + this.workorderCode = workorderCode; + } + public String getWorkorderCode() { + return workorderCode; + } + + public void setReportCode(String reportCode) { + this.reportCode = reportCode; + } + public String getReportCode() { + return reportCode; + } + + public void setMaterialCode(String materialCode) { + this.materialCode = materialCode; + } + + public String getMaterialCode() { + return materialCode; + } + public void setMaterialName(String materialName) { + this.materialName = materialName; + } + + public String getMaterialName() { + return materialName; + } + public void setMaterialSpc(String materialSpc) { + this.materialSpc = materialSpc; + } + + public String getMaterialSpc() { + return materialSpc; + } + public void setQuantity(Long quantity) { + this.quantity = quantity; + } + + public Long getQuantity() { + return quantity; + } + public void setUnit(String unit) { + this.unit = unit; + } + + public String getUnit() { + return unit; + } + public void setAttr1(String attr1) { + this.attr1 = attr1; + } + + public String getAttr1() { + return attr1; + } + public void setAttr2(String attr2) { + this.attr2 = attr2; + } + + public String getAttr2() { + return attr2; + } + public void setAttr3(String attr3) { + this.attr3 = attr3; + } + + public String getAttr3() { + return attr3; + } + public void setAttr4(String attr4) { + this.attr4 = attr4; + } + + public String getAttr4() { + return attr4; + } + public void setFactoryCode(String factoryCode) { + this.factoryCode = factoryCode; + } + + public String getFactoryCode() { + return factoryCode; + } + + //虚拟字段 + public void setId(String factoryCode) { + this.id = id; + } + + public String getId() { + return id; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("recordId", getRecordId()) + .append("id", getId()) + .append("reportCode", getReportCode()) + .append("workorderCode", getWorkorderCode()) + .append("materialCode", getMaterialCode()) + .append("materialName", getMaterialName()) + .append("materialSpc", getMaterialSpc()) + .append("quantity", getQuantity()) + .append("unit", getUnit()) + .append("remark", getRemark()) + .append("attr1", getAttr1()) + .append("attr2", getAttr2()) + .append("attr3", getAttr3()) + .append("attr4", getAttr4()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("factoryCode", getFactoryCode()) + .toString(); + } +} diff --git a/op-modules/op-sap/src/main/java/com/op/sap/domain/vo/SapCloseOrderQuery.java b/op-api/op-api-system/src/main/java/com/op/system/api/domain/sap/SapCloseOrderQuery.java similarity index 91% rename from op-modules/op-sap/src/main/java/com/op/sap/domain/vo/SapCloseOrderQuery.java rename to op-api/op-api-system/src/main/java/com/op/system/api/domain/sap/SapCloseOrderQuery.java index effeb118..f051c15a 100644 --- a/op-modules/op-sap/src/main/java/com/op/sap/domain/vo/SapCloseOrderQuery.java +++ b/op-api/op-api-system/src/main/java/com/op/system/api/domain/sap/SapCloseOrderQuery.java @@ -1,4 +1,4 @@ -package com.op.sap.domain.vo; +package com.op.system.api.domain.sap; public class SapCloseOrderQuery { 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 6d21a116..19a581c8 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 @@ -44,7 +44,7 @@ public class SapRFW { } - public class lt_gs + public static class lt_gs { String conf_activity1; String conf_activity2; @@ -114,7 +114,7 @@ public class SapRFW { } } - public class lt_hw{ + public class lt_hw{ String material; String entry_qnt; diff --git a/op-api/op-api-system/src/main/java/com/op/system/api/factory/RemoteSapFallbackFactory.java b/op-api/op-api-system/src/main/java/com/op/system/api/factory/RemoteSapFallbackFactory.java index fb002c67..6f90361c 100644 --- a/op-api/op-api-system/src/main/java/com/op/system/api/factory/RemoteSapFallbackFactory.java +++ b/op-api/op-api-system/src/main/java/com/op/system/api/factory/RemoteSapFallbackFactory.java @@ -40,7 +40,7 @@ public class RemoteSapFallbackFactory implements FallbackFactory lt_hwList =new ArrayList<>(); - SapRFW.lt_hw lthw = sapRFW.new lt_hw();//MES生产订单报工货物移动修改 - lthw.setEntry_qnt(work.getQuantityFeedback().toString());//TODO; - lthw.setMaterial(work.getProcessCode()); - lt_hwList.add(lthw); + logger.info(work.getWorkorderCodeSap()+"母sap工单报工:报工数量"+sapRFW.getGamng()); + MesReportWorkConsume consumeqo = new MesReportWorkConsume(); + consumeqo.setWorkorderCode(work.getWorkorderCode()); + List consumes = mesReportWorkConsumeMapper.selectMesReportWorkConsumeList(consumeqo); + if(!CollectionUtils.isEmpty(consumes)){ + for(MesReportWorkConsume consume:consumes){ + logger.info(work.getWorkorderCodeSap()+"母sap工单报工:【原料损耗】"+ + consume.getMaterialCode()+"|"+consume.getQuantity()); + SapRFW.lt_hw lthw = sapRFW.new lt_hw();//MES生产订单报工货物移动修改 + lthw.setEntry_qnt(consume.getQuantity()+"");//数量 + lthw.setMaterial(consume.getMaterialCode());//物料编码 + lt_hwList.add(lthw); + } + }else{ + logger.info(work.getWorkorderCodeSap()+"母sap工单报工:工单"+work.getWorkorderCode()+"mes_report_work_consume没有数据"); + return R.fail("mes_report_work_consume没有数据"); + } sapRFW.setLt_hwList(lt_hwList); - //添加调用sap日志 - SysSapLog sysSapLog = new SysSapLog(); - sysSapLog.setId(IdUtils.fastSimpleUUID()); - sysSapLog.setMesssge(sapRFW.toString()); - sysSapLog.setMethod("reportWork"); - sysSapLog.setReqcode("请求"); - sysSapLog.setCreateTime(DateUtils.getNowDate()); - mesMapper.addSapLog(sysSapLog); R r = remoteSapService.sapRFWOrder(sapRFW); + logger.info(work.getWorkorderCodeSap()+"母sap工单报工结果:"+r.getCode()+","+r.getData()+","+r.getMsg()); //上传成功,更改mes_report_work状态 if (r.getCode() == 200) { work.setUploadStatus("1"); @@ -339,10 +347,16 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService { logger.info("工单请求关闭:调用remoteSapService.sapCloseOrder,参数:"+work.getWorkorderCodeSap()); //工单完成,关闭工单 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关闭"+r2.getCode()+",返回信息:"+r2.getMsg()); - } + //关闭母子订单//订单的订单编码 + SapCloseOrderQuery sapCloseOrderQuery = new SapCloseOrderQuery(); + sapCloseOrderQuery.setLeadOrder(sapWorkOrders.get(0)); + sapCloseOrderQuery.setOrder(sapWorkOrders.get(1)); + R closeR = remoteSapService.sapCloseOrder(sapCloseOrderQuery); + logger.info(work.getWorkorderCodeSap()+"报工后关闭母子工单"+sapCloseOrderQuery.getLeadOrder()+":"+ + sapCloseOrderQuery.getOrder()+":"+ + closeR.getCode()+","+ + closeR.getMsg()+","+ + closeR.getData()); work.setStatus("w3"); work.setUpdateTime(DateUtils.getNowDate()); diff --git a/op-modules/op-open/src/main/java/com/op/open/mapper/OpenMapper.java b/op-modules/op-open/src/main/java/com/op/open/mapper/OpenMapper.java index ab213853..c7396d17 100644 --- a/op-modules/op-open/src/main/java/com/op/open/mapper/OpenMapper.java +++ b/op-modules/op-open/src/main/java/com/op/open/mapper/OpenMapper.java @@ -2,6 +2,7 @@ package com.op.open.mapper; import com.op.system.api.domain.SysSapLog; import com.op.system.api.domain.dto.WCSDTO; +import com.op.system.api.domain.mes.MesReportWorkConsumeDTO; import com.op.system.api.domain.mes.MesReportWorkDTO; import com.op.system.api.domain.mes.ProOrderWorkorderDTO; import com.op.system.api.domain.mes.ProRfidProcessDetail; @@ -43,5 +44,7 @@ public interface OpenMapper { List getLGInfo(WCSDTO wcsDTO); List getSapWorkOrder(String workorderCode); + + List selectMesReportWorkConsumeList(MesReportWorkConsumeDTO consumeqo); } 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 8383c9a4..2bd5a1aa 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 @@ -1,6 +1,7 @@ package com.op.open.service.impl; import com.alibaba.fastjson2.JSONArray; +import com.alibaba.fastjson2.JSONObject; import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder; import com.op.common.core.domain.R; import com.op.common.core.utils.DateUtils; @@ -12,9 +13,11 @@ import com.op.system.api.RemoteSapService; import com.op.system.api.domain.SysSapLog; import com.op.system.api.domain.dto.WCSDTO; import com.op.system.api.domain.dto.WCSDataDTO; +import com.op.system.api.domain.mes.MesReportWorkConsumeDTO; import com.op.system.api.domain.mes.MesReportWorkDTO; import com.op.system.api.domain.mes.ProOrderWorkorderDTO; import com.op.system.api.domain.mes.ProRfidProcessDetail; +import com.op.system.api.domain.sap.SapCloseOrderQuery; import com.op.system.api.domain.sap.SapRFW; import org.apache.commons.lang.StringUtils; import org.slf4j.Logger; @@ -165,7 +168,7 @@ public class OpenServiceImpl implements OpenService { SapRFW sapRFW = new SapRFW(); sapRFW.setAufnr(work.getWorkorderCodeSap());//虚拟工单号 sapRFW.setGamng(work.getQuantityFeedback().toString());//报工数量 - SapRFW.lt_gs ltgs = sapRFW.new lt_gs();//生产订单报工工时修改 + SapRFW.lt_gs ltgs = sapRFW.getLt_gs();//生产订单报工工时修改 ltgs.setConf_activity1(work.getSac1());//人工 ltgs.setConf_activity2(work.getSac2()); ltgs.setConf_activity3(work.getSac3());//机器 @@ -173,20 +176,28 @@ public class OpenServiceImpl implements OpenService { ltgs.setConf_activity5(work.getSac5());//折旧 ltgs.setConf_activity6(work.getSac6()); sapRFW.setLt_gs(ltgs); - SapRFW.lt_hw lthw = sapRFW.new lt_hw();//MES生产订单报工货物移动修改 - lthw.setEntry_qnt(work.getQuantityFeedback().toString());//TODO; - lthw.setMaterial(work.getProcessCode()); - sapRFW.setLt_hw(lthw); - //添加调用sap日志 - SysSapLog sysSapLog = new SysSapLog(); - sysSapLog.setId(IdUtils.fastSimpleUUID()); - sysSapLog.setMesssge(sapRFW.toString()); - sysSapLog.setMethod("reportWork"); - sysSapLog.setReqcode("请求"); - sysSapLog.setCreateTime(DateUtils.getNowDate()); - openMapper.addSapLog(sysSapLog); - + List lt_hwList =new ArrayList<>(); + logger.info(work.getWorkorderCodeSap()+"母sap工单报工:报工数量"+sapRFW.getGamng()); + MesReportWorkConsumeDTO consumeqo = new MesReportWorkConsumeDTO(); + consumeqo.setWorkorderCode(work.getWorkorderCode()); + List consumes = openMapper.selectMesReportWorkConsumeList(consumeqo); + if(!CollectionUtils.isEmpty(consumes)){ + for(MesReportWorkConsumeDTO consume:consumes){ + logger.info(work.getWorkorderCodeSap()+"母sap工单报工:【原料损耗】"+ + consume.getMaterialCode()+"|"+consume.getQuantity()); + SapRFW.lt_hw lthw = sapRFW.new lt_hw();//MES生产订单报工货物移动修改 + lthw.setEntry_qnt(consume.getQuantity()+"");//数量 + lthw.setMaterial(consume.getMaterialCode());//物料编码 + lt_hwList.add(lthw); + } + }else{ + logger.info(work.getWorkorderCodeSap()+"母sap工单报工:工单"+work.getWorkorderCode()+"==mes_report_work_consume没有数据"); + //return R.fail("mes_report_work_consume没有数据"); + } + sapRFW.setLt_hwList(lt_hwList); + logger.info(work.getWorkorderCodeSap()+"母sap工单报工请求:"+ JSONObject.toJSONString(sapRFW)); R r = remoteSapService.sapRFWOrder(sapRFW); + logger.info(work.getWorkorderCodeSap()+"母sap工单报工结果:"+r.getCode()+","+r.getData()+","+r.getMsg()); //上传成功,更改mes_report_work状态 if (r.getCode() == 200) { work.setUploadStatus("1"); @@ -199,18 +210,21 @@ public class OpenServiceImpl implements OpenService { //工单完成数量>工单数量:关闭订单 MesReportWorkDTO proResult = openMapper.getProdResult(work); //ProOrderWorkorderDTO topOrder = this.getTopOrder(work.getWorkorderCode()); - if(proResult.getQuantityFeedback().compareTo(work.getQuantitySplit())>=0 - || - "1".equals(work.getEndReport())//最终报工标识 + if(proResult.getQuantityFeedback().compareTo(work.getQuantitySplit())>=0||"1".equals(work.getEndReport())//最终报工标识 ){ logger.info("工单请求关闭:调用remoteSapService.sapCloseOrder,参数:"+work.getWorkorderCodeSap()); - //工单完成,关闭母工单 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关闭"+rclose.getCode()+",返回信息:"+rclose.getMsg()); - } + //关闭母子订单//订单的订单编码 + SapCloseOrderQuery sapCloseOrderQuery = new SapCloseOrderQuery(); + sapCloseOrderQuery.setLeadOrder(sapWorkOrders.get(0)); + sapCloseOrderQuery.setOrder(sapWorkOrders.get(1)); + R closeR = remoteSapService.sapCloseOrder(sapCloseOrderQuery); + logger.info(work.getWorkorderCodeSap()+"下发工单后关闭母子工单"+sapCloseOrderQuery.getLeadOrder()+":"+ + sapCloseOrderQuery.getOrder()+":"+ + closeR.getCode()+","+ + closeR.getMsg()+","+ + closeR.getData()); work.setStatus("w3"); work.setUpdateTime(DateUtils.getNowDate()); //pro_work_order status->w3报工--belong_work_order 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 40ab74ce..ec32eebf 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 @@ -126,5 +126,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select workorder_code_sap from pro_order_workorder where belong_work_order = #{workorderCode} and del_flag = '0' + 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 cf5d03ba..9a00d021 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 @@ -21,6 +21,7 @@ import com.op.system.api.RemoteSapService; import com.op.system.api.domain.SysSapLog; import com.op.system.api.domain.dto.MesPrepareDTO; import com.op.system.api.domain.dto.MesPrepareDetailDTO; +import com.op.system.api.domain.sap.SapCloseOrderQuery; import com.op.system.api.domain.sap.SapCreateOrder; import com.op.system.api.domain.sap.SapMaterialPreparation; import com.op.system.api.domain.sap.SapShopOrderQuery; @@ -306,14 +307,14 @@ public class ProOrderWorkorderServiceImpl implements IProOrderWorkorderService { sapList.add(sap); //添加调用sap日志 - SysSapLog sysSapLog = new SysSapLog(); - sysSapLog.setId(IdUtils.fastSimpleUUID()); - sysSapLog.setMesssge(Arrays.asList(sapList).toString()); - sysSapLog.setMethod("downProOrderWorkorderByWorkorderIds"); - sysSapLog.setReqcode("请求"); - sysSapLog.setCreateTime(DateUtils.getNowDate()); - proOrderMapper.addSapLog(sysSapLog); - +// SysSapLog sysSapLog = new SysSapLog(); +// sysSapLog.setId(IdUtils.fastSimpleUUID()); +// sysSapLog.setMesssge(Arrays.asList(sapList).toString()); +// sysSapLog.setMethod("downProOrderWorkorderByWorkorderIds"); +// sysSapLog.setReqcode("请求"); +// sysSapLog.setCreateTime(DateUtils.getNowDate()); +// proOrderMapper.addSapLog(sysSapLog); + logger.info(whiteOrder.getWorkorderCode()+"sap工单回传sap虚拟工单号开始:"+Arrays.asList(sapList).toString()); R>> r = remoteSapService.SapCreateOrder(sapList); logger.info("sap工单回传:" + r.getMsg()); if (500 == r.getCode()) { @@ -328,7 +329,7 @@ public class ProOrderWorkorderServiceImpl implements IProOrderWorkorderService { } Date updateTime = DateUtils.getNowDate(); if (!CollectionUtils.isEmpty(returnCodes)) { - logger.info("sap工单回传sap虚拟工单号:" + StringUtils.join(returnCodes, ",")); + logger.info("sap工单回传sap虚拟工单号结束:" + StringUtils.join(returnCodes, ",")); //按照母子顺序进行更新 for (int m=0;m> shopOrderSync(@RequestBody SapShopOrderQuery sapProOrder){ - return sapOrderService.shopOrderSync(sapProOrder); - } - - /** - * SAP订单修改接口 - * 传递母订单号和母订单数量 - */ - @PostMapping("/shopUpdateSync") - @Log(title = "修改SAP订单", businessType = BusinessType.SAP) - public R shopUpdateSync(@RequestBody SapShopOrderQuery sapProOrder){ - return sapOrderService.shopUpdateSync(sapProOrder); - } - + /**====================主数据相关===================================================================================*/ /** * 物料同步接口 * @param @@ -113,7 +94,7 @@ public class SapController extends BaseController { } /** - * 物料清单同步接口 + * 物料清单BOM同步接口 * @return */ @PostMapping("/bomSync") @@ -151,7 +132,6 @@ public class SapController extends BaseController { } - /** * 工艺路线同步 * @return @@ -176,7 +156,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_", ""));//工厂 @@ -190,74 +170,6 @@ public class SapController extends BaseController { return R.ok(); } - /** - * 生产订单备料单接口 - * @param shopOrder - * @return - */ - - @PostMapping("/materialPreparation") - @Log(title = "生产订单备料单接口", businessType = BusinessType.SAP) - public R> materialPreparation(@RequestParam("shopOrder") String shopOrder){ - 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){ - return sapItemSyncService.sapMaterialPosting(sapMaterialPosting); - } - - - /** - * 生产订单创建接口 - * @param sapCreateOrderList - * @return - */ - - @PostMapping("/sapCreateOrder") - @Log(title = "生产订单创建接口", businessType = BusinessType.SAP) - public R>> SapCreateOrder(@RequestBody List sapCreateOrderList){ - return sapOrderService.SapCreateOrder(sapCreateOrderList); - } - - /** - * 生产订单关闭接口 - * 传母订单号即可 - * @param sapCloseOrderQuery - * @return - */ - @PostMapping("/sapCloseOrder") - @Log(title = "生产订单关闭接口", businessType = BusinessType.SAP) - public R sapCloseOrder(@RequestBody SapCloseOrderQuery sapCloseOrderQuery){ - return sapOrderService.sapCloseOrder(sapCloseOrderQuery); - } - - /** - * 报工 - * @param sapRFW - * @return - */ - @PostMapping("/sapRFWOrder") - @Log(title = "生产订单报工接口", businessType = BusinessType.SAP) - public R sapRFWOrder(@RequestBody SapRFW sapRFW){ - return sapOrderService.sapRFWOrder(sapRFW); - } - - /** * 工作中心 * @return @@ -382,6 +294,96 @@ public class SapController extends BaseController { } + /**==================================生产订单相关============================================================================*/ + + /** + * 订单同步接口 + * @return + */ + @PostMapping("/shopOrderSync") + @Log(title = "同步SAP订单", businessType = BusinessType.SAP) + public R> shopOrderSync(@RequestBody SapShopOrderQuery sapProOrder){ + return sapOrderService.shopOrderSync(sapProOrder); + } + /** + * 生产订单创建接口 + * @param sapCreateOrderList + * @return + */ + + @PostMapping("/sapCreateOrder") + @Log(title = "生产订单创建接口", businessType = BusinessType.SAP) + public R>> SapCreateOrder(@RequestBody List sapCreateOrderList){ + return sapOrderService.SapCreateOrder(sapCreateOrderList); + } + /** + * SAP订单修改接口 + * 传递母订单号和母订单数量 + */ + @PostMapping("/shopUpdateSync") + @Log(title = "修改SAP订单", businessType = BusinessType.SAP) + public R shopUpdateSync(@RequestBody SapShopOrderQuery sapProOrder){ + return sapOrderService.shopUpdateSync(sapProOrder); + } + + + /** + * 报工 + * @param sapRFW + * @return + */ + @PostMapping("/sapRFWOrder") + @Log(title = "生产订单报工接口", businessType = BusinessType.SAP) + public R sapRFWOrder(@RequestBody SapRFW sapRFW){ + return sapOrderService.sapRFWOrder(sapRFW); + } + + /** + * 生产订单关闭接口 + * 传母订单号即可 + * @param sapCloseOrderQuery + * @return + */ + @PostMapping("/sapCloseOrder") + @Log(title = "生产订单关闭接口", businessType = BusinessType.SAP) + public R sapCloseOrder(@RequestBody SapCloseOrderQuery sapCloseOrderQuery){ + return sapOrderService.sapCloseOrder(sapCloseOrderQuery); + } + + + + /** + * 生产订单备料单接口 + * @param shopOrder + * @return + */ + + @PostMapping("/materialPreparation") + @Log(title = "生产订单备料单接口", businessType = BusinessType.SAP) + public R> materialPreparation(@RequestParam("shopOrder") String shopOrder){ + 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){ + return sapItemSyncService.sapMaterialPosting(sapMaterialPosting); + } + + /** * 采购订单接口 */ 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 8e061ada..945ab3e6 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,8 +2,8 @@ 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.SapCloseOrderQuery; import com.op.system.api.domain.sap.SapCreateOrder; import com.op.system.api.domain.sap.SapRFW; import com.op.system.api.domain.sap.SapShopOrderQuery; 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 adc7b5bf..d81cd2c5 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 @@ -1,16 +1,17 @@ package com.op.sap.service.impl; +import com.alibaba.fastjson2.JSONObject; import com.op.common.core.constant.Constants; import com.op.common.core.domain.R; 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; import com.op.sap.util.SAPConnUtils; +import com.op.system.api.domain.sap.SapCloseOrderQuery; import com.op.system.api.domain.sap.SapCreateOrder; import com.op.system.api.domain.sap.SapRFW; import com.op.system.api.domain.sap.SapShopOrderQuery; @@ -244,6 +245,8 @@ public class SapOrderServiceImpl implements SapOrderService { @Override public R sapRFWOrder(SapRFW sapRFW) { + String json= JSONObject.toJSONString(sapRFW); + System.out.println(json); String MESSAGE=null; try { //获取连接 @@ -300,10 +303,10 @@ public class SapOrderServiceImpl implements SapOrderService { JCoParameterList J= func.getExportParameterList(); System.out.println(J); MESSAGE= func.getExportParameterList().getString("MESSAGE"); - if (StringUtils.isEmpty(MESSAGE)){ - return R.fail("订单号:"+sapRFW.getAufnr()+"报工失败"); + if (StringUtils.contains(MESSAGE,"错误")){ + return R.fail("订单号:"+sapRFW.getAufnr()+"报工失败"+MESSAGE); } - return R.ok(MESSAGE); + return R.ok("",MESSAGE); }catch (Exception e){ return R.fail(e.getMessage()); @@ -404,6 +407,8 @@ public class SapOrderServiceImpl implements SapOrderService { return R.fail(e.getMessage()); } } + + } diff --git a/op-modules/op-wms/src/main/java/com/op/wms/controller/OdsProcureOrderController.java b/op-modules/op-wms/src/main/java/com/op/wms/controller/OdsProcureOrderController.java index 8a45d736..98afca16 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/controller/OdsProcureOrderController.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/controller/OdsProcureOrderController.java @@ -2,6 +2,7 @@ package com.op.wms.controller; import java.util.List; import javax.servlet.http.HttpServletResponse; +import com.op.wms.domain.WmsRawOrderInSn; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; @@ -23,7 +24,7 @@ import com.op.common.core.web.page.TableDataInfo; /** * 包材采购单Controller - * + * * @author Open Platform * @date 2023-07-06 */ @@ -94,4 +95,50 @@ public class OdsProcureOrderController extends BaseController { public AjaxResult remove(@PathVariable String[] IDs) { return toAjax(odsProcureOrderService.deleteOdsProcureOrderByIDs(IDs)); } + + /** + *手持 --包材采购单采购收货查询 + */ + + @PostMapping("/PurchaseOrderPda") + public AjaxResult PurchaseOrderPda(@RequestBody OdsProcureOrder odsProcureOrder) { + List orderList =odsProcureOrderService.PurchaseOrderPda(odsProcureOrder); + return success(orderList); + } + + //** + + /** + * 用于出库任务页面--查询 + * @param odsProcureOrder + * @return + */ + @PostMapping("/PurchaseOrderOutboundTask") + public AjaxResult PurchaseOrderOutboundTask(@RequestBody OdsProcureOrder odsProcureOrder) { + List orderList =odsProcureOrderService.PurchaseOrderPda(odsProcureOrder); + return success(orderList); + } + + + + /** + *手持 --包材采购单采购收货操作 + */ + + @PostMapping("/PurchaseOrderdeliPda") + public AjaxResult PurchaseOrderdeliPda(@RequestBody OdsProcureOrder odsProcureOrder) { + int tem =odsProcureOrderService.PurchaseOrderdeliPda(odsProcureOrder); + return success(tem); + } + + /** + *手持 --包材采购单采购查询明细 + */ + + @PostMapping("/PurchaseOrderdetailPda") + public AjaxResult PurchaseOrderdetailPda(@RequestBody WmsRawOrderInSn wmsRawOrderInSn) { + List wmsRawOrderInSns =odsProcureOrderService.PurchaseOrderdetailPda(wmsRawOrderInSn); + return success(wmsRawOrderInSns); + } + } diff --git a/op-modules/op-wms/src/main/java/com/op/wms/controller/WmsOdsWhiteEmbryoInController.java b/op-modules/op-wms/src/main/java/com/op/wms/controller/WmsOdsWhiteEmbryoInController.java index c70353f3..107954bc 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/controller/WmsOdsWhiteEmbryoInController.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/controller/WmsOdsWhiteEmbryoInController.java @@ -36,7 +36,7 @@ public class WmsOdsWhiteEmbryoInController extends BaseController { /** * 查询白胚入库单列表 */ - @RequiresPermissions("wms:wmsEmbryoin:list") +// @RequiresPermissions("wms:wmsEmbryoin:list") @GetMapping("/list") public TableDataInfo list(WmsOdsWhiteEmbryoIn wmsOdsWhiteEmbryoIn) { startPage(); @@ -47,7 +47,7 @@ public class WmsOdsWhiteEmbryoInController extends BaseController { /** * 导出白胚入库单列表 */ - @RequiresPermissions("wms:wmsEmbryoin:export") + //@RequiresPermissions("wms:wmsEmbryoin:export") @Log(title = "白胚入库单", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, WmsOdsWhiteEmbryoIn wmsOdsWhiteEmbryoIn) { @@ -59,7 +59,7 @@ public class WmsOdsWhiteEmbryoInController extends BaseController { /** * 获取白胚入库单详细信息 */ - @RequiresPermissions("wms:wmsEmbryoin:query") + //@RequiresPermissions("wms:wmsEmbryoin:query") @GetMapping(value = "/{ID}") public AjaxResult getInfo(@PathVariable("ID") String ID) { return success(wmsOdsWhiteEmbryoInService.selectWmsOdsWhiteEmbryoInByID(ID)); @@ -76,7 +76,7 @@ public class WmsOdsWhiteEmbryoInController extends BaseController { /** * 修改白胚入库单 */ - @RequiresPermissions("wms:wmsEmbryoin:edit") + //@RequiresPermissions("wms:wmsEmbryoin:edit") @Log(title = "白胚入库单", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody WmsOdsWhiteEmbryoIn wmsOdsWhiteEmbryoIn) { @@ -86,7 +86,7 @@ public class WmsOdsWhiteEmbryoInController extends BaseController { /** * 删除白胚入库单 */ - @RequiresPermissions("wms:wmsEmbryoin:remove") + //@RequiresPermissions("wms:wmsEmbryoin:remove") @Log(title = "白胚入库单", businessType = BusinessType.DELETE) @DeleteMapping("/{IDs}") public AjaxResult remove(@PathVariable String[] IDs) { diff --git a/op-modules/op-wms/src/main/java/com/op/wms/controller/WmsToWCSInterfaceContorller.java b/op-modules/op-wms/src/main/java/com/op/wms/controller/WmsToWCSInterfaceContorller.java new file mode 100644 index 00000000..689fea5d --- /dev/null +++ b/op-modules/op-wms/src/main/java/com/op/wms/controller/WmsToWCSInterfaceContorller.java @@ -0,0 +1,107 @@ +package com.op.wms.controller; + +import com.op.common.core.utils.StringUtils; +import com.op.wms.domain.WmsToWCSDTO; +import com.op.wms.service.IWmsToWCSInterfaceService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("/WmsToWCSInterface") +public class WmsToWCSInterfaceContorller { + + @Autowired + private IWmsToWCSInterfaceService wmsToWCSInterfaceService; + /** + * 白坯请求入库 + * @param wcsdto + * @return + */ + @PostMapping("/blankRequestForStorage") + public WmsToWCSDTO blankRequestForStorage(@RequestBody WmsToWCSDTO wcsdto) { + if(StringUtils.isBlank(wcsdto.getFactory())){ + wcsdto.setCode("1"); + wcsdto.setMessage("factory is not null"); + return wcsdto; + } + return wmsToWCSInterfaceService.requestMaterialLoadNo(wcsdto); + } + /** + * 白坯入库或移库完成 + * @param wcsdto + * @return + */ + @PostMapping("/blankStorageOrTransferCompleted") + public WmsToWCSDTO blankStorageOrTransferCompleted(@RequestBody WmsToWCSDTO wcsdto) { + if(StringUtils.isBlank(wcsdto.getFactory())){ + wcsdto.setCode("1"); + wcsdto.setMessage("factory is not null"); + return wcsdto; + } + return wmsToWCSInterfaceService.blankStorageOrTransferCompleted(wcsdto); + } + /** + * 白坯库存状态更新 + * @param wcsdto + * @return + */ + @PostMapping("/blankInventoryStatusUpdate") + public WmsToWCSDTO blankInventoryStatusUpdate(@RequestBody WmsToWCSDTO wcsdto) { + if(StringUtils.isBlank(wcsdto.getFactory())){ + wcsdto.setCode("1"); + wcsdto.setMessage("factory is not null"); + return wcsdto; + } + return wmsToWCSInterfaceService.blankInventoryStatusUpdate(wcsdto); + } + /** + * 白坯出库需求下发 + * @param wcsdto + * @return + */ + @PostMapping("/issuanceOfBlankOutboundDemand") + public WmsToWCSDTO issuanceOfBlankOutboundDemand(@RequestBody WmsToWCSDTO wcsdto) { + if(StringUtils.isBlank(wcsdto.getFactory())){ + wcsdto.setCode("1"); + wcsdto.setMessage("factory is not null"); + return wcsdto; + } + return wmsToWCSInterfaceService.issuanceOfBlankOutboundDemand(wcsdto); + } + +// /** +// * 白坯指定托盘出库----WMS 指定托盘号出库, +// * @param wcsdto +// * @return +// */ +// @PostMapping("/blankDesignatedPalletOutbound") +// public WmsToWCSDTO blankDesignatedPalletOutbound(@RequestBody WmsToWCSDTO wcsdto) { +// if(StringUtils.isBlank(wcsdto.getFactory())){ +// wcsdto.setCode("1"); +// wcsdto.setMessage("factory is not null"); +// return wcsdto; +// } +// return wmsToWCSInterfaceService.blankDesignatedPalletOutbound(wcsdto); +// } + + /** + * 白坯出库完成 + * @param wcsdto + * @return + */ + @PostMapping("/blankOutboundCompleted") + public WmsToWCSDTO blankOutboundCompleted(@RequestBody WmsToWCSDTO wcsdto) { + if(StringUtils.isBlank(wcsdto.getFactory())){ + wcsdto.setCode("1"); + wcsdto.setMessage("factory is not null"); + return wcsdto; + } + return wmsToWCSInterfaceService.blankDesignatedPalletOutbound(wcsdto); + } + + + +} diff --git a/op-modules/op-wms/src/main/java/com/op/wms/controller/WmsToWCSmissionController.java b/op-modules/op-wms/src/main/java/com/op/wms/controller/WmsToWCSmissionController.java new file mode 100644 index 00000000..f57dbd33 --- /dev/null +++ b/op-modules/op-wms/src/main/java/com/op/wms/controller/WmsToWCSmissionController.java @@ -0,0 +1,133 @@ +package com.op.wms.controller; + + +import com.op.common.core.utils.StringUtils; +import com.op.common.core.web.domain.AjaxResult; +import com.op.wms.domain.OdsProcureOrder; +import com.op.wms.domain.WmsRawOrderInSn; +import com.op.wms.domain.WmsToWCSDTO; +import com.op.wms.service.IOdsProcureOrderService; +import com.op.wms.service.IWmsToWCSmissionService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +import static com.op.common.core.web.domain.AjaxResult.success; + +@RestController +@RequestMapping("/WmsToWCSmission") +public class WmsToWCSmissionController { + + @Autowired + private IWmsToWCSmissionService iWmsToWCSmissionService; + @Autowired + private IOdsProcureOrderService odsProcureOrderService; + + /** + * 包材请求入库--- + * @param wcsdto + * @return + */ + @PostMapping("/packingMaterialsRequestInbound") + public WmsToWCSDTO PackagingStorage(@RequestBody WmsToWCSDTO wcsdto) { + if(StringUtils.isBlank(wcsdto.getFactory())){ + wcsdto.setCode("1"); + wcsdto.setMessage("factory is not null"); + return wcsdto; + } + return iWmsToWCSmissionService.packagingStorage(wcsdto); + } + + + // + //packingMaterialsInboundCompleted + /** + * 包材入库或移库完成回传 + * @param wcsdto + * @return + */ + @PostMapping("/packingMaterialsInboundCompleted") + public WmsToWCSDTO blankStorageOrTransferCompleted(@RequestBody WmsToWCSDTO wcsdto) { + if(StringUtils.isBlank(wcsdto.getFactory())){ + wcsdto.setCode("1"); + wcsdto.setMessage("factory is not null"); + return wcsdto; + } + return iWmsToWCSmissionService.packingMaterialsInboundCompleted(wcsdto); + } +//packingMaterialsOutBoundCompleted + + /** + * 包材出库完成回传 + * @param wcsdto + * @return + */ +@PostMapping("/packingMaterialsOutBoundCompleted") +public WmsToWCSDTO packingMaterialsOutBoundCompleted(@RequestBody WmsToWCSDTO wcsdto) { + if(StringUtils.isBlank(wcsdto.getFactory())){ + wcsdto.setCode("1"); + wcsdto.setMessage("factory is not null"); + return wcsdto; + } + return iWmsToWCSmissionService.packingMaterialsOutBoundCompleted(wcsdto); +} + /** + *手持 --包材采购单采购收货查询 + */ + + @PostMapping("/PurchaseOrderPda") + public AjaxResult PurchaseOrderPda(@RequestBody OdsProcureOrder odsProcureOrder) { + List orderList =odsProcureOrderService.PurchaseOrderPda(odsProcureOrder); + return success(orderList); + } + + + /** + *手持 --包材采购单采购收货操作 + */ + + @PostMapping("/PurchaseOrderdeliPda") + public AjaxResult PurchaseOrderdeliPda(@RequestBody OdsProcureOrder odsProcureOrder) { + int tem =odsProcureOrderService.PurchaseOrderdeliPda(odsProcureOrder); + return success(tem); + } + + /** + *手持 --包材采购单采购查询明细 + */ + + @PostMapping("/PurchaseOrderdetailPda") + public AjaxResult PurchaseOrderdetailPda(@RequestBody WmsRawOrderInSn wmsRawOrderInSn) { + List wmsRawOrderInSns =odsProcureOrderService.PurchaseOrderdetailPda(wmsRawOrderInSn); + return success(wmsRawOrderInSns); + } + /** + *手持 -入库查询--入参:pono,whcode + * userDefined1;//备用1--收货1,入库2 + */ + + @PostMapping("/PurchaseOrderWarehousingPda") + public AjaxResult PurchaseOrderWarehousingPda(@RequestBody WmsRawOrderInSn wmsRawOrderInSn) { + List wmsRawOrderInSns =odsProcureOrderService.PurchaseOrderWarehousingPda(wmsRawOrderInSn); + //采购入库(PO) + return success(wmsRawOrderInSns); + } + + /** + * 入库操作 + * @param wmsRawOrderInSn + * @return + */ + @PostMapping("/PurchaseOrderRKPda") + public AjaxResult PurchaseOrderRKPda(@RequestBody WmsRawOrderInSn wmsRawOrderInSn) { + odsProcureOrderService.PurchaseOrderRKPda(wmsRawOrderInSn); + //采购入库(PO) + return success(); + } + + +} diff --git a/op-modules/op-wms/src/main/java/com/op/wms/domain/OdsProcureOrder.java b/op-modules/op-wms/src/main/java/com/op/wms/domain/OdsProcureOrder.java index 5a4ae44c..8f17f7c6 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/domain/OdsProcureOrder.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/domain/OdsProcureOrder.java @@ -3,6 +3,7 @@ package com.op.wms.domain; import java.math.BigDecimal; import java.util.Date; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonInclude; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import com.op.common.core.annotation.Excel; @@ -14,15 +15,61 @@ import com.op.common.core.web.domain.BaseEntity; * @author Open Platform * @date 2023-07-06 */ +@JsonInclude(JsonInclude.Include.NON_NULL) public class OdsProcureOrder extends BaseEntity { private static final long serialVersionUID = 1L; + /** ID */ + private String ID; + @Excel(name = "工厂编码") + private String factoryCode; + + public String getFactoryCode() { + return factoryCode; + } + + public void setFactoryCode(String factoryCode) { + this.factoryCode = factoryCode; + } /** 工厂编码 */ @Excel(name = "工厂编码") private String siteCode; + /** 仓库编码--收货仓库 */ + @Excel(name = "仓库编码") + private String whCode; - /** ID */ - private String ID; + public String getWhCode() { + return whCode; + } + /** 托盘号--托盘号 */ + @Excel(name = "托盘号") + private String sn; + + public String getSn() { + return sn; + } + + public void setSn(String sn) { + this.sn = sn; + } + + public void setWhCode(String whCode) { + this.whCode = whCode; + } + + + + /** 采购订单行项目 */ + @Excel(name = "采购订单行项目") + private String poLine; + + public String getPoLine() { + return poLine; + } + + public void setPoLine(String poLine) { + this.poLine = poLine; + } /** 采购单号 */ @Excel(name = "采购单号") @@ -31,6 +78,17 @@ public class OdsProcureOrder extends BaseEntity { /** 物料编码 */ @Excel(name = "物料编码") private String materialCode; + /** 批次号 */ + @Excel(name = "批次号") + private String incomeBatchNo; + + public String getIncomeBatchNo() { + return incomeBatchNo; + } + + public void setIncomeBatchNo(String incomeBatchNo) { + this.incomeBatchNo = incomeBatchNo; + } /** 物料描述 */ @Excel(name = "物料描述") diff --git a/op-modules/op-wms/src/main/java/com/op/wms/domain/OrderLine.java b/op-modules/op-wms/src/main/java/com/op/wms/domain/OrderLine.java new file mode 100644 index 00000000..08171187 --- /dev/null +++ b/op-modules/op-wms/src/main/java/com/op/wms/domain/OrderLine.java @@ -0,0 +1,80 @@ +package com.op.wms.domain; + +import com.op.common.core.web.domain.BaseEntity; + +import java.math.BigDecimal; + +public class OrderLine extends BaseEntity { + private String orderNo;//订单号 + private String warehouseNo; //仓库编号 + private String orderLineNo;//订单行号 + private String sku;//物料编码 + private String batchNo; //批次号 + private BigDecimal qty;//数量 + private String qualityStatus;//质检状态,1合格,2不合格 + private String stationNo;//包装线 + + public String getOrderNo() { + return orderNo; + } + + public void setOrderNo(String orderNo) { + this.orderNo = orderNo; + } + + public String getWarehouseNo() { + return warehouseNo; + } + + public void setWarehouseNo(String warehouseNo) { + this.warehouseNo = warehouseNo; + } + + public String getOrderLineNo() { + return orderLineNo; + } + + public void setOrderLineNo(String orderLineNo) { + this.orderLineNo = orderLineNo; + } + + public String getSku() { + return sku; + } + + public void setSku(String sku) { + this.sku = sku; + } + + public String getBatchNo() { + return batchNo; + } + + public void setBatchNo(String batchNo) { + this.batchNo = batchNo; + } + + public BigDecimal getQty() { + return qty; + } + + public void setQty(BigDecimal qty) { + this.qty = qty; + } + + public String getQualityStatus() { + return qualityStatus; + } + + public void setQualityStatus(String qualityStatus) { + this.qualityStatus = qualityStatus; + } + + public String getStationNo() { + return stationNo; + } + + public void setStationNo(String stationNo) { + this.stationNo = stationNo; + } +} diff --git a/op-modules/op-wms/src/main/java/com/op/wms/domain/WmsRawOrderInSn.java b/op-modules/op-wms/src/main/java/com/op/wms/domain/WmsRawOrderInSn.java index e0b779ec..161da4c1 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/domain/WmsRawOrderInSn.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/domain/WmsRawOrderInSn.java @@ -3,6 +3,7 @@ package com.op.wms.domain; import java.math.BigDecimal; import java.util.Date; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonInclude; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import com.op.common.core.annotation.Excel; @@ -10,20 +11,33 @@ import com.op.common.core.web.domain.BaseEntity; /** * 原材料收货明细对象 wms_raw_order_in_sn - * + * * @author Open Platform * @date 2023-08-30 */ +@JsonInclude(JsonInclude.Include.NON_NULL) public class WmsRawOrderInSn extends BaseEntity { private static final long serialVersionUID = 1L; /** 唯一序列号 */ - private Long rawOrderInSnId; + private String rawOrderInSnId; - /** 仓库编码 */ + /** 仓库编码--收货仓库 */ @Excel(name = "仓库编码") private String whCode; + /** 批次号 */ + @Excel(name = "批次号") + private String incomeBatchNo; + + public String getIncomeBatchNo() { + return incomeBatchNo; + } + + public void setIncomeBatchNo(String incomeBatchNo) { + this.incomeBatchNo = incomeBatchNo; + } + /** 库区编码 */ @Excel(name = "库区编码") private String waCode; @@ -52,7 +66,7 @@ public class WmsRawOrderInSn extends BaseEntity { @Excel(name = "物料描述") private String materialDesc; - /** 托盘号 */ + /** 托盘号--托盘号 */ @Excel(name = "托盘号") private String sn; @@ -62,7 +76,7 @@ public class WmsRawOrderInSn extends BaseEntity { /** 备用1 */ @Excel(name = "备用1") - private String userDefined1; + private String userDefined1;//备用1--收货1,入库2 /** 备用2 */ @Excel(name = "备用2") @@ -118,7 +132,7 @@ public class WmsRawOrderInSn extends BaseEntity { @Excel(name = "有效标记") private String activeFlag; - /** $column.columnComment */ + /** $column.columnComment 工厂*/ @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") private String factoryCode; @@ -126,11 +140,11 @@ public class WmsRawOrderInSn extends BaseEntity { @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") private String sapFactoryCode; - public void setRawOrderInSnId(Long rawOrderInSnId) { + public void setRawOrderInSnId(String rawOrderInSnId) { this.rawOrderInSnId = rawOrderInSnId; } - public Long getRawOrderInSnId() { + public String getRawOrderInSnId() { return rawOrderInSnId; } public void setWhCode(String whCode) { diff --git a/op-modules/op-wms/src/main/java/com/op/wms/domain/WmsToWCSDTO.java b/op-modules/op-wms/src/main/java/com/op/wms/domain/WmsToWCSDTO.java new file mode 100644 index 00000000..a5f59948 --- /dev/null +++ b/op-modules/op-wms/src/main/java/com/op/wms/domain/WmsToWCSDTO.java @@ -0,0 +1,213 @@ +package com.op.wms.domain; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.op.common.core.web.domain.BaseEntity; + +import java.util.Date; +import java.util.List; +@JsonInclude(JsonInclude.Include.NON_NULL) +public class WmsToWCSDTO extends BaseEntity { + + + private String reqCode;//请求ID + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date reqTime;//请求时间 + + private String planNo; + private ListorderLines; + private String code;//返回代码 + private String location; //库位编码 + private String message;//返回信息 + private String colQty;//列数 + private String factory; + private String qty;//数量(列数) + private String sku;//物料编码 + private String qualityStatus;//质检状态 1合格,2不合格 + private String loadNo; + private String batchNo; //批次号 + private String stationType;//收坯机台编号 + private String stationNo; + private String rfidNo;//rfid编号 + private String spec; + private String productionState; + private String warehouseNo;//仓库编号 + private String orderNo;//订单号 + private String workorderCode; + + public String getOrderNo() { + return orderNo; + } + + public void setOrderNo(String orderNo) { + this.orderNo = orderNo; + } + + public String getWorkorderCode() { + return workorderCode; + } + + public List getOrderLines() { + return orderLines; + } + + public void setOrderLines(List orderLines) { + this.orderLines = orderLines; + } + + public void setWorkorderCode(String workorderCode) { + this.workorderCode = workorderCode; + } + + public String getWarehouseNo() { + return warehouseNo; + } + + public void setWarehouseNo(String warehouseNo) { + this.warehouseNo = warehouseNo; + } + + public String getLocation() { + return location; + } + + public void setLocation(String location) { + this.location = location; + } + + public String getReqCode() { + return reqCode; + } + + public void setReqCode(String reqCode) { + this.reqCode = reqCode; + } + + public Date getReqTime() { + return reqTime; + } + + public void setReqTime(Date reqTime) { + this.reqTime = reqTime; + } + + public String getPlanNo() { + return planNo; + } + + public void setPlanNo(String planNo) { + this.planNo = planNo; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public String getColQty() { + return colQty; + } + + public void setColQty(String colQty) { + this.colQty = colQty; + } + + public String getFactory() { + return factory; + } + + public void setFactory(String factory) { + this.factory = factory; + } + + public String getQty() { + return qty; + } + + public void setQty(String qty) { + this.qty = qty; + } + + public String getSku() { + return sku; + } + + public void setSku(String sku) { + this.sku = sku; + } + + public String getQualityStatus() { + return qualityStatus; + } + + public void setQualityStatus(String qualityStatus) { + this.qualityStatus = qualityStatus; + } + + public String getLoadNo() { + return loadNo; + } + + public void setLoadNo(String loadNo) { + this.loadNo = loadNo; + } + + public String getBatchNo() { + return batchNo; + } + + public void setBatchNo(String batchNo) { + this.batchNo = batchNo; + } + + public String getStationType() { + return stationType; + } + + public void setStationType(String stationType) { + this.stationType = stationType; + } + + public String getStationNo() { + return stationNo; + } + + public void setStationNo(String stationNo) { + this.stationNo = stationNo; + } + + public String getRfidNo() { + return rfidNo; + } + + public void setRfidNo(String rfidNo) { + this.rfidNo = rfidNo; + } + + public String getSpec() { + return spec; + } + + public void setSpec(String spec) { + this.spec = spec; + } + + public String getProductionState() { + return productionState; + } + + public void setProductionState(String productionState) { + this.productionState = productionState; + } +} diff --git a/op-modules/op-wms/src/main/java/com/op/wms/mapper/OdsProcureOrderMapper.java b/op-modules/op-wms/src/main/java/com/op/wms/mapper/OdsProcureOrderMapper.java index 2b045f17..697f57df 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/mapper/OdsProcureOrderMapper.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/mapper/OdsProcureOrderMapper.java @@ -6,14 +6,14 @@ import com.op.wms.domain.OdsProcureOrder; /** * 包材采购单Mapper接口 - * + * * @author Open Platform * @date 2023-07-06 */ public interface OdsProcureOrderMapper { /** * 查询包材采购单 - * + * * @param ID 包材采购单主键 * @return 包材采购单 */ @@ -21,7 +21,7 @@ public interface OdsProcureOrderMapper { /** * 查询包材采购单列表 - * + * * @param odsProcureOrder 包材采购单 * @return 包材采购单集合 */ @@ -29,7 +29,7 @@ public interface OdsProcureOrderMapper { /** * 新增包材采购单 - * + * * @param odsProcureOrder 包材采购单 * @return 结果 */ @@ -37,7 +37,7 @@ public interface OdsProcureOrderMapper { /** * 修改包材采购单 - * + * * @param odsProcureOrder 包材采购单 * @return 结果 */ @@ -45,7 +45,7 @@ public interface OdsProcureOrderMapper { /** * 删除包材采购单 - * + * * @param ID 包材采购单主键 * @return 结果 */ @@ -53,9 +53,11 @@ public interface OdsProcureOrderMapper { /** * 批量删除包材采购单 - * + * * @param IDs 需要删除的数据主键集合 * @return 结果 */ public int deleteOdsProcureOrderByIDs(String[] IDs); + + Integer updateRealityNuById(OdsProcureOrder odsProcureOrder); } diff --git a/op-modules/op-wms/src/main/java/com/op/wms/mapper/WmsOdsEmStorageNewsMapper.java b/op-modules/op-wms/src/main/java/com/op/wms/mapper/WmsOdsEmStorageNewsMapper.java index 954d4b69..461f2c50 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/mapper/WmsOdsEmStorageNewsMapper.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/mapper/WmsOdsEmStorageNewsMapper.java @@ -58,4 +58,6 @@ public interface WmsOdsEmStorageNewsMapper { * @return 结果 */ public int deleteWmsOdsEmStorageNewsByStorageIds(String[] storageIds); + + void updateAdd(WmsOdsEmStorageNews wmsOdsEmStorageNews); } diff --git a/op-modules/op-wms/src/main/java/com/op/wms/mapper/WmsOdsMateStorageNewsMapper.java b/op-modules/op-wms/src/main/java/com/op/wms/mapper/WmsOdsMateStorageNewsMapper.java index 3aa63134..8b83fd85 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/mapper/WmsOdsMateStorageNewsMapper.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/mapper/WmsOdsMateStorageNewsMapper.java @@ -2,18 +2,19 @@ package com.op.wms.mapper; import java.util.List; +import com.op.wms.domain.WmsOdsEmStorageNews; import com.op.wms.domain.WmsOdsMateStorageNews; /** * 包材库存主表Mapper接口 - * + * * @author Open Platform * @date 2023-08-30 */ public interface WmsOdsMateStorageNewsMapper { /** * 查询包材库存主表 - * + * * @param storageId 包材库存主表主键 * @return 包材库存主表 */ @@ -21,7 +22,7 @@ public interface WmsOdsMateStorageNewsMapper { /** * 查询包材库存主表列表 - * + * * @param wmsOdsMateStorageNews 包材库存主表 * @return 包材库存主表集合 */ @@ -29,7 +30,7 @@ public interface WmsOdsMateStorageNewsMapper { /** * 新增包材库存主表 - * + * * @param wmsOdsMateStorageNews 包材库存主表 * @return 结果 */ @@ -37,7 +38,7 @@ public interface WmsOdsMateStorageNewsMapper { /** * 修改包材库存主表 - * + * * @param wmsOdsMateStorageNews 包材库存主表 * @return 结果 */ @@ -45,7 +46,7 @@ public interface WmsOdsMateStorageNewsMapper { /** * 删除包材库存主表 - * + * * @param storageId 包材库存主表主键 * @return 结果 */ @@ -53,9 +54,11 @@ public interface WmsOdsMateStorageNewsMapper { /** * 批量删除包材库存主表 - * + * * @param storageIds 需要删除的数据主键集合 * @return 结果 */ public int deleteWmsOdsMateStorageNewsByStorageIds(String[] storageIds); + + WmsOdsMateStorageNews selectByWhCodeAndMate(WmsOdsEmStorageNews wmsOdsEmStorageNews); } diff --git a/op-modules/op-wms/src/main/java/com/op/wms/mapper/WmsOdsMateStorageNewsSnMapper.java b/op-modules/op-wms/src/main/java/com/op/wms/mapper/WmsOdsMateStorageNewsSnMapper.java index c029f89c..0d286a22 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/mapper/WmsOdsMateStorageNewsSnMapper.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/mapper/WmsOdsMateStorageNewsSnMapper.java @@ -2,18 +2,19 @@ package com.op.wms.mapper; import java.util.List; +import com.op.wms.domain.WmsOdsEmStorageNews; import com.op.wms.domain.WmsOdsMateStorageNewsSn; /** - * 包材库存明细表Mapper接口 - * + * 包材库存明细表Mapper接口是 + * * @author Open Platform * @date 2023-08-30 */ public interface WmsOdsMateStorageNewsSnMapper { /** * 查询包材库存明细表 - * + * * @param mateOrderInSnId 包材库存明细表主键 * @return 包材库存明细表 */ @@ -21,7 +22,7 @@ public interface WmsOdsMateStorageNewsSnMapper { /** * 查询包材库存明细表列表 - * + * * @param wmsOdsMateStorageNewsSn 包材库存明细表 * @return 包材库存明细表集合 */ @@ -29,7 +30,7 @@ public interface WmsOdsMateStorageNewsSnMapper { /** * 新增包材库存明细表 - * + * * @param wmsOdsMateStorageNewsSn 包材库存明细表 * @return 结果 */ @@ -37,7 +38,7 @@ public interface WmsOdsMateStorageNewsSnMapper { /** * 修改包材库存明细表 - * + * * @param wmsOdsMateStorageNewsSn 包材库存明细表 * @return 结果 */ @@ -45,7 +46,7 @@ public interface WmsOdsMateStorageNewsSnMapper { /** * 删除包材库存明细表 - * + * * @param mateOrderInSnId 包材库存明细表主键 * @return 结果 */ @@ -53,9 +54,13 @@ public interface WmsOdsMateStorageNewsSnMapper { /** * 批量删除包材库存明细表 - * + * * @param mateOrderInSnIds 需要删除的数据主键集合 * @return 结果 */ public int deleteWmsOdsMateStorageNewsSnByMateOrderInSnIds(Long[] mateOrderInSnIds); + + void updateAdd(WmsOdsEmStorageNews wmsOdsEmStorageNews); + + } diff --git a/op-modules/op-wms/src/main/java/com/op/wms/mapper/WmsOdsWhiteEmbryoInMapper.java b/op-modules/op-wms/src/main/java/com/op/wms/mapper/WmsOdsWhiteEmbryoInMapper.java index 0c6b35aa..be84ffc2 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/mapper/WmsOdsWhiteEmbryoInMapper.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/mapper/WmsOdsWhiteEmbryoInMapper.java @@ -6,14 +6,14 @@ import com.op.wms.domain.WmsOdsWhiteEmbryoIn; /** * 白胚入库单Mapper接口 - * + * * @author Open Platform * @date 2023-07-20 */ public interface WmsOdsWhiteEmbryoInMapper { /** * 查询白胚入库单 - * + * * @param ID 白胚入库单主键 * @return 白胚入库单 */ @@ -21,7 +21,7 @@ public interface WmsOdsWhiteEmbryoInMapper { /** * 查询白胚入库单列表 - * + * * @param wmsOdsWhiteEmbryoIn 白胚入库单 * @return 白胚入库单集合 */ @@ -29,7 +29,7 @@ public interface WmsOdsWhiteEmbryoInMapper { /** * 新增白胚入库单 - * + * * @param wmsOdsWhiteEmbryoIn 白胚入库单 * @return 结果 */ @@ -37,7 +37,7 @@ public interface WmsOdsWhiteEmbryoInMapper { /** * 修改白胚入库单 - * + * * @param wmsOdsWhiteEmbryoIn 白胚入库单 * @return 结果 */ @@ -45,7 +45,7 @@ public interface WmsOdsWhiteEmbryoInMapper { /** * 删除白胚入库单 - * + * * @param ID 白胚入库单主键 * @return 结果 */ @@ -53,9 +53,13 @@ public interface WmsOdsWhiteEmbryoInMapper { /** * 批量删除白胚入库单 - * + * * @param IDs 需要删除的数据主键集合 * @return 结果 */ public int deleteWmsOdsWhiteEmbryoInByIDs(String[] IDs); + + WmsOdsWhiteEmbryoIn selectWmsOdsWhiteEmbryoInByWorkorderCode(String workorderCode); + + void updateWmsOdsWhiteEmbryoInByOrderCode(WmsOdsWhiteEmbryoIn wmsOdsWhiteEmbryoIn); } diff --git a/op-modules/op-wms/src/main/java/com/op/wms/mapper/WmsRawOrderInMapper.java b/op-modules/op-wms/src/main/java/com/op/wms/mapper/WmsRawOrderInMapper.java index 6db7da4a..4ab94c6d 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/mapper/WmsRawOrderInMapper.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/mapper/WmsRawOrderInMapper.java @@ -3,17 +3,18 @@ package com.op.wms.mapper; import java.util.List; import com.op.wms.domain.WmsRawOrderIn; +import com.op.wms.domain.WmsToWCSDTO; /** * 包材到货单Mapper接口 - * + * * @author Open Platform * @date 2023-08-30 */ public interface WmsRawOrderInMapper { /** * 查询包材到货单 - * + * * @param rawOrderInId 包材到货单主键 * @return 包材到货单 */ @@ -21,7 +22,7 @@ public interface WmsRawOrderInMapper { /** * 查询包材到货单列表 - * + * * @param wmsRawOrderIn 包材到货单 * @return 包材到货单集合 */ @@ -29,7 +30,7 @@ public interface WmsRawOrderInMapper { /** * 新增包材到货单 - * + * * @param wmsRawOrderIn 包材到货单 * @return 结果 */ @@ -37,7 +38,7 @@ public interface WmsRawOrderInMapper { /** * 修改包材到货单 - * + * * @param wmsRawOrderIn 包材到货单 * @return 结果 */ @@ -45,7 +46,7 @@ public interface WmsRawOrderInMapper { /** * 删除包材到货单 - * + * * @param rawOrderInId 包材到货单主键 * @return 结果 */ @@ -53,9 +54,11 @@ public interface WmsRawOrderInMapper { /** * 批量删除包材到货单 - * + * * @param rawOrderInIds 需要删除的数据主键集合 * @return 结果 */ public int deleteWmsRawOrderInByRawOrderInIds(String[] rawOrderInIds); + + WmsToWCSDTO packagingStorage(WmsToWCSDTO wcsdto); } diff --git a/op-modules/op-wms/src/main/java/com/op/wms/mapper/WmsRawOrderInSnMapper.java b/op-modules/op-wms/src/main/java/com/op/wms/mapper/WmsRawOrderInSnMapper.java index 0c845218..ab778b3e 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/mapper/WmsRawOrderInSnMapper.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/mapper/WmsRawOrderInSnMapper.java @@ -3,17 +3,18 @@ package com.op.wms.mapper; import java.util.List; import com.op.wms.domain.WmsRawOrderInSn; +import com.op.wms.domain.WmsToWCSDTO; /** * 原材料收货明细Mapper接口 - * + * * @author Open Platform * @date 2023-08-30 */ public interface WmsRawOrderInSnMapper { /** * 查询原材料收货明细 - * + * * @param rawOrderInSnId 原材料收货明细主键 * @return 原材料收货明细 */ @@ -21,7 +22,7 @@ public interface WmsRawOrderInSnMapper { /** * 查询原材料收货明细列表 - * + * * @param wmsRawOrderInSn 原材料收货明细 * @return 原材料收货明细集合 */ @@ -29,7 +30,7 @@ public interface WmsRawOrderInSnMapper { /** * 新增原材料收货明细 - * + * * @param wmsRawOrderInSn 原材料收货明细 * @return 结果 */ @@ -37,7 +38,7 @@ public interface WmsRawOrderInSnMapper { /** * 修改原材料收货明细 - * + * * @param wmsRawOrderInSn 原材料收货明细 * @return 结果 */ @@ -45,7 +46,7 @@ public interface WmsRawOrderInSnMapper { /** * 删除原材料收货明细 - * + * * @param rawOrderInSnId 原材料收货明细主键 * @return 结果 */ @@ -53,9 +54,13 @@ public interface WmsRawOrderInSnMapper { /** * 批量删除原材料收货明细 - * + * * @param rawOrderInSnIds 需要删除的数据主键集合 * @return 结果 */ public int deleteWmsRawOrderInSnByRawOrderInSnIds(Long[] rawOrderInSnIds); + + WmsRawOrderInSn selectwmsRfidNo(WmsToWCSDTO wmsToWCSDTO); + + void updateU1Byid(WmsRawOrderInSn wmsRawOrderInSn); } diff --git a/op-modules/op-wms/src/main/java/com/op/wms/mapper/WmsToWCSInterfaceMapper.java b/op-modules/op-wms/src/main/java/com/op/wms/mapper/WmsToWCSInterfaceMapper.java new file mode 100644 index 00000000..5956bae8 --- /dev/null +++ b/op-modules/op-wms/src/main/java/com/op/wms/mapper/WmsToWCSInterfaceMapper.java @@ -0,0 +1,7 @@ +package com.op.wms.mapper; + +import com.op.wms.domain.WmsToWCSDTO; + +public interface WmsToWCSInterfaceMapper { + WmsToWCSDTO selectWmsToWCSDTO(WmsToWCSDTO wcsdto); +} diff --git a/op-modules/op-wms/src/main/java/com/op/wms/service/IOdsProcureOrderService.java b/op-modules/op-wms/src/main/java/com/op/wms/service/IOdsProcureOrderService.java index ba034e1d..cf621972 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/service/IOdsProcureOrderService.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/service/IOdsProcureOrderService.java @@ -2,17 +2,18 @@ package com.op.wms.service; import java.util.List; import com.op.wms.domain.OdsProcureOrder; +import com.op.wms.domain.WmsRawOrderInSn; /** * 包材采购单Service接口 - * + * * @author Open Platform * @date 2023-07-06 */ public interface IOdsProcureOrderService { /** * 查询包材采购单 - * + * * @param ID 包材采购单主键 * @return 包材采购单 */ @@ -20,7 +21,7 @@ public interface IOdsProcureOrderService { /** * 查询包材采购单列表 - * + * * @param odsProcureOrder 包材采购单 * @return 包材采购单集合 */ @@ -28,7 +29,7 @@ public interface IOdsProcureOrderService { /** * 新增包材采购单 - * + * * @param odsProcureOrder 包材采购单 * @return 结果 */ @@ -36,7 +37,7 @@ public interface IOdsProcureOrderService { /** * 修改包材采购单 - * + * * @param odsProcureOrder 包材采购单 * @return 结果 */ @@ -44,7 +45,7 @@ public interface IOdsProcureOrderService { /** * 批量删除包材采购单 - * + * * @param IDs 需要删除的包材采购单主键集合 * @return 结果 */ @@ -52,9 +53,19 @@ public interface IOdsProcureOrderService { /** * 删除包材采购单信息 - * + * * @param ID 包材采购单主键 * @return 结果 */ public int deleteOdsProcureOrderByID(String ID); + + List PurchaseOrderPda(OdsProcureOrder odsProcureOrder); + + int PurchaseOrderdeliPda(OdsProcureOrder odsProcureOrder); + + List PurchaseOrderdetailPda(WmsRawOrderInSn wmsRawOrderInSn); + + List PurchaseOrderWarehousingPda(WmsRawOrderInSn wmsRawOrderInSn); + + void PurchaseOrderRKPda(WmsRawOrderInSn wmsRawOrderInSn); } diff --git a/op-modules/op-wms/src/main/java/com/op/wms/service/IWmsToWCSInterfaceService.java b/op-modules/op-wms/src/main/java/com/op/wms/service/IWmsToWCSInterfaceService.java new file mode 100644 index 00000000..53250efe --- /dev/null +++ b/op-modules/op-wms/src/main/java/com/op/wms/service/IWmsToWCSInterfaceService.java @@ -0,0 +1,15 @@ +package com.op.wms.service; + +import com.op.wms.domain.WmsToWCSDTO; + +public interface IWmsToWCSInterfaceService { + WmsToWCSDTO requestMaterialLoadNo(WmsToWCSDTO wcsdto); + + WmsToWCSDTO blankStorageOrTransferCompleted(WmsToWCSDTO wcsdto); + + WmsToWCSDTO blankInventoryStatusUpdate(WmsToWCSDTO wcsdto); + + WmsToWCSDTO issuanceOfBlankOutboundDemand(WmsToWCSDTO wcsdto); + + WmsToWCSDTO blankDesignatedPalletOutbound(WmsToWCSDTO wcsdto); +} diff --git a/op-modules/op-wms/src/main/java/com/op/wms/service/IWmsToWCSmissionService.java b/op-modules/op-wms/src/main/java/com/op/wms/service/IWmsToWCSmissionService.java new file mode 100644 index 00000000..9d247385 --- /dev/null +++ b/op-modules/op-wms/src/main/java/com/op/wms/service/IWmsToWCSmissionService.java @@ -0,0 +1,11 @@ +package com.op.wms.service; + +import com.op.wms.domain.WmsToWCSDTO; + +public interface IWmsToWCSmissionService { + WmsToWCSDTO packagingStorage(WmsToWCSDTO wcsdto); + + WmsToWCSDTO packingMaterialsInboundCompleted(WmsToWCSDTO wcsdto); + + WmsToWCSDTO packingMaterialsOutBoundCompleted(WmsToWCSDTO wcsdto); +} diff --git a/op-modules/op-wms/src/main/java/com/op/wms/service/impl/OdsProcureOrderServiceImpl.java b/op-modules/op-wms/src/main/java/com/op/wms/service/impl/OdsProcureOrderServiceImpl.java index 45a513e7..10f6d23b 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/service/impl/OdsProcureOrderServiceImpl.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/service/impl/OdsProcureOrderServiceImpl.java @@ -1,12 +1,19 @@ package com.op.wms.service.impl; +import java.math.BigDecimal; +import java.util.Date; import java.util.List; import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder; +import com.op.common.core.utils.uuid.IdUtils; +import com.op.wms.domain.*; +import com.op.wms.mapper.WmsOdsMateStorageNewsMapper; +import com.op.wms.mapper.WmsOdsMateStorageNewsSnMapper; +import com.op.wms.mapper.WmsRawOrderInSnMapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.op.wms.mapper.OdsProcureOrderMapper; -import com.op.wms.domain.OdsProcureOrder; import com.op.wms.service.IOdsProcureOrderService; /** @@ -19,6 +26,12 @@ import com.op.wms.service.IOdsProcureOrderService; public class OdsProcureOrderServiceImpl implements IOdsProcureOrderService { @Autowired private OdsProcureOrderMapper odsProcureOrderMapper; + @Autowired + private WmsRawOrderInSnMapper wmsRawOrderInSnMapper; + @Autowired + private WmsOdsMateStorageNewsSnMapper wmsOdsMateStorageNewsSnMapper; + @Autowired + private WmsOdsMateStorageNewsMapper wmsOdsMateStorageNewsMapper; /** * 查询包材采购单 @@ -91,4 +104,118 @@ public class OdsProcureOrderServiceImpl implements IOdsProcureOrderService { public int deleteOdsProcureOrderByID(String ID) { return odsProcureOrderMapper.deleteOdsProcureOrderByID(ID); } + + @Override +// @DS("#header.poolName") + public List PurchaseOrderPda(OdsProcureOrder odsProcureOrder) { + DynamicDataSourceContextHolder.push("ds_" + odsProcureOrder.getFactoryCode()); + return odsProcureOrderMapper.selectOdsProcureOrderList(odsProcureOrder); + } + + @Override + //@DS("#header.poolName") + public int PurchaseOrderdeliPda(OdsProcureOrder odsProcureOrder) { + //收货记录--rawOrderInSnId。修改收货数量 + DynamicDataSourceContextHolder.push("ds_" + odsProcureOrder.getFactoryCode()); + + OdsProcureOrder order= odsProcureOrderMapper.selectOdsProcureOrderByID(odsProcureOrder.getID()); + //wms_raw_order_in_sn + WmsRawOrderInSn wmsRawOrderInSn=new WmsRawOrderInSn(); + wmsRawOrderInSn.setRawOrderInSnId(IdUtils.fastSimpleUUID()); + wmsRawOrderInSn.setUserDefined1("1");//出入库 + wmsRawOrderInSn.setUserDefined2(odsProcureOrder.getIncomeBatchNo());//批次 + wmsRawOrderInSn.setWhCode(odsProcureOrder.getWhCode());//厂库编号 + wmsRawOrderInSn.setPoNo(order.getProcureCode());//采购单号 +// wmsRawOrderInSn.setPoLine(odsProcureOrder.getPoLine());//行项目 + wmsRawOrderInSn.setMaterialCode(odsProcureOrder.getMaterialCode()); + wmsRawOrderInSn.setMaterialDesc(odsProcureOrder.getMaterialDesc()); + wmsRawOrderInSn.setAmount(odsProcureOrder.getPlanNumber()); + wmsRawOrderInSn.setCreateBy(odsProcureOrder.getCreateBy()); + wmsRawOrderInSn.setGmtCreate(new Date()); + wmsRawOrderInSn.setActiveFlag("1"); + wmsRawOrderInSn.setUserDefined4(order.getUnit());//单位 + wmsRawOrderInSn.setSn(odsProcureOrder.getSn());//托盘号 + wmsRawOrderInSn.setFactoryCode(odsProcureOrder.getSiteCode()); + wmsRawOrderInSn.setUserDefined3(order.getID()); + wmsRawOrderInSnMapper.insertWmsRawOrderInSn(wmsRawOrderInSn); + //插入收货记录 + //如果收货完成了的话,就插入信息收货完成 + odsProcureOrder.setOrderStatus("1"); + BigDecimal result =order.getRealityNumber().add(odsProcureOrder.getPlanNumber()); + if (result.equals(order.getPlanNumber())){ + odsProcureOrder.setOrderStatus("2"); + } + Integer tem= odsProcureOrderMapper.updateRealityNuById(odsProcureOrder); + return tem; + } + + @Override + //@DS("#header.poolName") + public List PurchaseOrderdetailPda(WmsRawOrderInSn wmsRawOrderInSn) { + DynamicDataSourceContextHolder.push("ds_" + wmsRawOrderInSn.getFactoryCode()); + wmsRawOrderInSn.setActiveFlag("1"); + //u3备注 + return wmsRawOrderInSnMapper.selectWmsRawOrderInSnList(wmsRawOrderInSn); + } + + @Override + public List PurchaseOrderWarehousingPda(WmsRawOrderInSn wmsRawOrderInSn) { + DynamicDataSourceContextHolder.push("ds_" + wmsRawOrderInSn.getFactoryCode()); + wmsRawOrderInSn.setActiveFlag("1"); + //u3备注 + return wmsRawOrderInSnMapper.selectWmsRawOrderInSnList(wmsRawOrderInSn); + } + + @Override + public void PurchaseOrderRKPda(WmsRawOrderInSn wmsRawOrderInSn) { + //入库//修改备用1为2 + DynamicDataSourceContextHolder.push("ds_" + wmsRawOrderInSn.getFactoryCode()); + //判断如果收过就不能收了 +// if("2".equals(wmsRawOrderInSn.getUserDefined1())){//已经入库--前端判断吧 +// +// } + WmsOdsMateStorageNewsSn wmsOdsMateStorageNewsSn=new WmsOdsMateStorageNewsSn(); + wmsOdsMateStorageNewsSn.setWhCode(wmsRawOrderInSn.getWhCode());//仓库编码 + wmsOdsMateStorageNewsSn.setWlCode(wmsRawOrderInSn.getWlCode());//库位编码 + wmsOdsMateStorageNewsSn.setMaterialCode(wmsRawOrderInSn.getMaterialCode()); + wmsOdsMateStorageNewsSn.setMaterialDesc(wmsRawOrderInSn.getMaterialDesc()); + wmsOdsMateStorageNewsSn.setSn(wmsRawOrderInSn.getSn()); + wmsOdsMateStorageNewsSn.setAmount(wmsRawOrderInSn.getAmount()); + wmsOdsMateStorageNewsSn.setCreateBy(wmsRawOrderInSn.getCreateBy()); + wmsOdsMateStorageNewsSn.setGmtCreate(new Date()); + wmsOdsMateStorageNewsSn.setFactoryCode(wmsRawOrderInSn.getFactoryCode()); + wmsOdsMateStorageNewsSn.setSapFactoryCode(wmsRawOrderInSn.getFactoryCode()); + wmsOdsMateStorageNewsSnMapper.insertWmsOdsMateStorageNewsSn(wmsOdsMateStorageNewsSn); + //修改库存 + //2,修改库存---/加库存数量-/-冻结数量 + WmsOdsEmStorageNews wmsOdsEmStorageNews=new WmsOdsEmStorageNews(); + wmsOdsEmStorageNews.setWhCode(wmsRawOrderInSn.getWhCode());//仓库编码 + wmsOdsEmStorageNews.setWlCode(wmsRawOrderInSn.getWlCode());//库位编码 + wmsOdsEmStorageNews.setMaterialCode(wmsRawOrderInSn.getMaterialCode()); + wmsOdsEmStorageNews.setAmount(wmsRawOrderInSn.getAmount()); + //添加库存--这个要有个判断有没有这个库存如果没有的话,就插入 + WmsOdsMateStorageNews wmsOdsMateStorageNews= wmsOdsMateStorageNewsMapper.selectByWhCodeAndMate(wmsOdsEmStorageNews); + if (wmsOdsMateStorageNews==null){ + WmsOdsMateStorageNews wmsOdsMateStorageNews1=new WmsOdsMateStorageNews(); + wmsOdsMateStorageNews1.setStorageId(IdUtils.fastSimpleUUID()); + wmsOdsMateStorageNews1.setWhCode(wmsRawOrderInSn.getWhCode()); + wmsOdsMateStorageNews1.setWlCode(wmsRawOrderInSn.getWlCode()); + wmsOdsMateStorageNews1.setAmount(wmsRawOrderInSn.getAmount()); + wmsOdsMateStorageNews1.setStorageAmount(wmsRawOrderInSn.getAmount()); + wmsOdsMateStorageNews1.setMaterialCode(wmsRawOrderInSn.getMaterialCode()); + wmsOdsMateStorageNews1.setMaterialDesc(wmsRawOrderInSn.getMaterialDesc()); + wmsOdsMateStorageNews1.setStorageType("BC"); + wmsOdsMateStorageNews1.setCreateBy(wmsRawOrderInSn.getCreateBy()); + wmsOdsMateStorageNews1.setGmtCreate(new Date()); + wmsOdsMateStorageNews1.setActiveFlag("1"); + wmsOdsMateStorageNews1.setFactoryCode(wmsRawOrderInSn.getFactoryCode()); + wmsOdsMateStorageNews1.setSapFactoryCode(wmsRawOrderInSn.getSapFactoryCode()); + wmsOdsMateStorageNews1.setUserDefined1(wmsRawOrderInSn.getUserDefined4());//单位 + wmsOdsMateStorageNewsMapper.insertWmsOdsMateStorageNews(wmsOdsMateStorageNews1); + }else { + wmsOdsMateStorageNewsSnMapper.updateAdd(wmsOdsEmStorageNews); + } + wmsRawOrderInSnMapper.updateU1Byid(wmsRawOrderInSn); + //修改库存--加,并且为冻结的,sap过账后再解 + } } diff --git a/op-modules/op-wms/src/main/java/com/op/wms/service/impl/WmsToWCSInterfaceServiceImpl.java b/op-modules/op-wms/src/main/java/com/op/wms/service/impl/WmsToWCSInterfaceServiceImpl.java new file mode 100644 index 00000000..e038dd2f --- /dev/null +++ b/op-modules/op-wms/src/main/java/com/op/wms/service/impl/WmsToWCSInterfaceServiceImpl.java @@ -0,0 +1,146 @@ +package com.op.wms.service.impl; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.op.common.core.utils.uuid.IdUtils; +import com.op.wms.domain.*; +import com.op.wms.mapper.*; +import com.op.wms.service.IWmsToWCSInterfaceService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; + +@Service +public class WmsToWCSInterfaceServiceImpl implements IWmsToWCSInterfaceService { + @Autowired + private WmsToWCSInterfaceMapper wmsToWCSInterfaceMapper; + @Autowired + private WmsOdsWhiteEmbryoInMapper wmsOdsWhiteEmbryoInMapper; + @Autowired + private WmsOdsEmStorageNewsSnMapper wmsOdsEmStorageNewsSnMapper; + @Autowired + private WmsOdsEmStorageNewsMapper wmsOdsEmStorageNewsMapper; + @Autowired + private OdsWhiteEmbryoMapper odsWhiteEmbryoMapper; + + @Override + @DS("#header.poolName") + public WmsToWCSDTO requestMaterialLoadNo(WmsToWCSDTO wcsdto) { + WmsToWCSDTO wmsToWCSDTO= wmsToWCSInterfaceMapper.selectWmsToWCSDTO(wcsdto); + // wmsToWCSDTO.set// + wmsToWCSDTO.setCode("0"); + wmsToWCSDTO.setReqCode(wcsdto.getReqCode()); + wmsToWCSDTO.setMessage("OK"); + return wmsToWCSDTO; + } + + /** + * 白坯入库或移库完成 + * @param wcsdto + * @return + */ + @Transactional + @Override + @DS("#header.poolName") + public WmsToWCSDTO blankStorageOrTransferCompleted(WmsToWCSDTO wcsdto) { + WmsOdsWhiteEmbryoIn wmsOdsWhiteEmbryoIn1=new WmsOdsWhiteEmbryoIn(); + //rfidNo-托盘 + WmsToWCSDTO wmsToWCSDTO= wmsToWCSInterfaceMapper.selectWmsToWCSDTO(wcsdto); + //AGV 将白坯放到库内-- + + String workorderCode= wmsToWCSDTO.getWorkorderCode();//单号 + wmsOdsWhiteEmbryoIn1.setOrderCode(workorderCode); + WmsOdsWhiteEmbryoIn wmsOdsWhiteEmbryoIn= wmsOdsWhiteEmbryoInMapper.selectWmsOdsWhiteEmbryoInByWorkorderCode(workorderCode); + String qty = wmsToWCSDTO.getQty();//操作数量 + BigDecimal planNumber = wmsOdsWhiteEmbryoIn.getPlanNumber();//计划数量 + BigDecimal realityNumber = wmsOdsWhiteEmbryoIn.getRealityNumber();//已入数量 + BigDecimal sum = new BigDecimal(qty).add(realityNumber); // 将qty转换为BigDecimal类型,并与realityNumber相加 + boolean ten = sum.compareTo(planNumber) >= 0; // 判断sum是否大于等于planNumber + if (ten) { + wmsOdsWhiteEmbryoIn1.setOrderStatus("1"); + + } else { + //小于 + wmsOdsWhiteEmbryoIn1.setOrderStatus("2"); + + } + wmsOdsWhiteEmbryoIn1.setRealityNumber(sum);///操作数量+已入数量 + //1,修改订单 + wmsOdsWhiteEmbryoInMapper.updateWmsOdsWhiteEmbryoInByOrderCode(wmsOdsWhiteEmbryoIn1); + //2,修改库存---减冻结数量//加库存数量 + WmsOdsEmStorageNews wmsOdsEmStorageNews=new WmsOdsEmStorageNews(); + wmsOdsEmStorageNews.setWhCode(wcsdto.getWarehouseNo());//仓库编码 + wmsOdsEmStorageNews.setWlCode(wcsdto.getLocation());//库位编码 + wmsOdsEmStorageNews.setMaterialCode(wmsOdsWhiteEmbryoIn.getMaterialCode()); + wmsOdsEmStorageNews.setAmount(new BigDecimal(wmsToWCSDTO.getQty())); + //解冻 + wmsOdsEmStorageNewsMapper.updateAdd(wmsOdsEmStorageNews); + //3,添加记录 + WmsOdsEmStorageNewsSn wmsOdsEmStorageNewsSn=new WmsOdsEmStorageNewsSn(); + wmsOdsEmStorageNewsSn.setWhCode(wcsdto.getWarehouseNo());//仓库编码 + wmsOdsEmStorageNewsSn.setWaCode(wcsdto.getLocation());//库区编码 + wmsOdsEmStorageNewsSn.setWlCode(wcsdto.getLocation());//库位编码 + wmsOdsEmStorageNewsSn.setMaterialCode(wmsOdsWhiteEmbryoIn.getMaterialCode()); + wmsOdsEmStorageNewsSn.setMaterialDesc(wmsOdsWhiteEmbryoIn.getMaterialDesc()); + wmsOdsEmStorageNewsSn.setSn(wcsdto.getRfidNo());//托盘号 + wmsOdsEmStorageNewsSn.setAmount(new BigDecimal(wmsToWCSDTO.getQty())); + wmsOdsEmStorageNewsSn.setCreateTime(new Date()); + wmsOdsEmStorageNewsSnMapper.insertWmsOdsEmStorageNewsSn(wmsOdsEmStorageNewsSn); + // + wmsToWCSDTO.setCode("0"); + wmsToWCSDTO.setReqCode(wcsdto.getReqCode()); + wmsToWCSDTO.setMessage("OK"); + return wmsToWCSDTO; + } + + @Override + public WmsToWCSDTO blankInventoryStatusUpdate(WmsToWCSDTO wcsdto) { + + + + + return null; + } + + @Override + public WmsToWCSDTO issuanceOfBlankOutboundDemand(WmsToWCSDTO wcsdto) { + //默认合格即可-- 白坯出库需求下发 + WmsToWCSDTO wmsToWCSDTO=new WmsToWCSDTO(); + List orderLineList= wcsdto.getOrderLines(); + for (OrderLine orderLine: + orderLineList) { + //少传字段 + orderLine.setOrderNo(wcsdto.getOrderNo()); + orderLine.setWarehouseNo(wcsdto.getWarehouseNo()); + OdsWhiteEmbryo odsWhiteEmbryo=new OdsWhiteEmbryo(); + odsWhiteEmbryo.setID(IdUtils.fastSimpleUUID()); + odsWhiteEmbryo.setSiteCode(wcsdto.getFactory());//工厂编码 + odsWhiteEmbryo.setOrderCode(orderLine.getOrderNo());//出库单号 + odsWhiteEmbryo.setMaterialCode(orderLine.getSku());//型号编码 + odsWhiteEmbryo.setPlanDate(wcsdto.getReqTime());//计划日期 + odsWhiteEmbryo.setPlanNumber(orderLine.getQty());//计划数量 + odsWhiteEmbryo.setOrderStatus("0"); + odsWhiteEmbryo.setUserDefined1(orderLine.getBatchNo()); + odsWhiteEmbryo.setProductionLineCode(orderLine.getStationNo());//产线编号 + //Loc_Code + //odsWhiteEmbryo.setUnit(); + odsWhiteEmbryoMapper.insertOdsWhiteEmbryo(odsWhiteEmbryo); + } + wmsToWCSDTO.setCode("0"); + wmsToWCSDTO.setReqCode(wcsdto.getReqCode()); + wmsToWCSDTO.setMessage("OK"); + return wmsToWCSDTO; + } + + @Override + public WmsToWCSDTO blankDesignatedPalletOutbound(WmsToWCSDTO wcsdto) { + //先确定数量---托盘确定数量,在库存明细中取,然后出库 + //orderNo--订单号--修改出库订单,修改库存数量,修改库存明细,--记录出库明细,--- + + + return null; + } +} diff --git a/op-modules/op-wms/src/main/java/com/op/wms/service/impl/WmsToWCSmissionServiceImpl.java b/op-modules/op-wms/src/main/java/com/op/wms/service/impl/WmsToWCSmissionServiceImpl.java new file mode 100644 index 00000000..ac7d94c1 --- /dev/null +++ b/op-modules/op-wms/src/main/java/com/op/wms/service/impl/WmsToWCSmissionServiceImpl.java @@ -0,0 +1,104 @@ +package com.op.wms.service.impl; + + +import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder; +import com.op.wms.domain.WmsOdsEmStorageNews; +import com.op.wms.domain.WmsOdsMateStorageNewsSn; +import com.op.wms.domain.WmsRawOrderInSn; +import com.op.wms.domain.WmsToWCSDTO; +import com.op.wms.mapper.WmsOdsEmStorageNewsMapper; +import com.op.wms.mapper.WmsOdsMateStorageNewsSnMapper; +import com.op.wms.mapper.WmsRawOrderInMapper; +import com.op.wms.mapper.WmsRawOrderInSnMapper; +import com.op.wms.service.IWmsToWCSmissionService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.math.BigDecimal; +import java.util.Date; + +@Service +public class WmsToWCSmissionServiceImpl implements IWmsToWCSmissionService { + @Autowired + private WmsRawOrderInMapper wmsRawOrderInMapper; + @Autowired + private WmsRawOrderInSnMapper wmsRawOrderInSnMapper; + @Autowired + private WmsOdsMateStorageNewsSnMapper wmsOdsMateStorageNewsSnMapper; + @Autowired + private WmsOdsEmStorageNewsMapper wmsOdsEmStorageNewsMapper; + + @Override + public WmsToWCSDTO packagingStorage(WmsToWCSDTO wcsdto) { + DynamicDataSourceContextHolder.push("ds_" + wcsdto.getFactory()); + WmsToWCSDTO wmsToWCSDTO= wmsRawOrderInMapper.packagingStorage(wcsdto); + // wmsToWCSDTO.set// + if (wmsToWCSDTO==null){ + WmsToWCSDTO wms=new WmsToWCSDTO(); + wms.setCode("0"); + wms.setReqCode(wcsdto.getReqCode()); + wms.setMessage("OK"); + return wms; + } + wmsToWCSDTO.setQualityStatus("1"); + wmsToWCSDTO.setCode("0"); + wmsToWCSDTO.setReqCode(wcsdto.getReqCode()); + wmsToWCSDTO.setMessage("OK"); + return wmsToWCSDTO; + } + + /** + * 包材入库完成,WCS 通知 WMS 入库完成信息,将最终入库的库位返回至 WMS + * @param wcsdto + * @return + */ + @Override + public WmsToWCSDTO packingMaterialsInboundCompleted(WmsToWCSDTO wmsToWCSDTO) { + DynamicDataSourceContextHolder.push("ds_" + wmsToWCSDTO.getFactory()); + WmsRawOrderInSn wmsRawOrderInSn= wmsRawOrderInSnMapper.selectwmsRfidNo(wmsToWCSDTO); + wmsRawOrderInSn.setWhCode(wmsToWCSDTO.getWarehouseNo()); + wmsRawOrderInSn.setWlCode(wmsToWCSDTO.getLocation()); + WmsOdsMateStorageNewsSn wmsOdsMateStorageNewsSn=new WmsOdsMateStorageNewsSn(); + wmsOdsMateStorageNewsSn.setWhCode(wmsRawOrderInSn.getWhCode());//仓库编码 + wmsOdsMateStorageNewsSn.setWlCode(wmsRawOrderInSn.getWlCode());//库位编码 + wmsOdsMateStorageNewsSn.setMaterialCode(wmsRawOrderInSn.getMaterialCode()); + wmsOdsMateStorageNewsSn.setMaterialDesc(wmsRawOrderInSn.getMaterialDesc()); + wmsOdsMateStorageNewsSn.setSn(wmsRawOrderInSn.getSn()); + wmsOdsMateStorageNewsSn.setAmount(wmsRawOrderInSn.getAmount()); + wmsOdsMateStorageNewsSn.setCreateBy("AGV"); + wmsOdsMateStorageNewsSn.setGmtCreate(new Date()); + wmsOdsMateStorageNewsSn.setFactoryCode(wmsToWCSDTO.getFactory()); + wmsOdsMateStorageNewsSn.setSapFactoryCode(wmsToWCSDTO.getFactory()); + wmsOdsMateStorageNewsSnMapper.insertWmsOdsMateStorageNewsSn(wmsOdsMateStorageNewsSn); + //修改库存 + //2,修改库存---/加库存数量-/-冻结数量 + WmsOdsEmStorageNews wmsOdsEmStorageNews=new WmsOdsEmStorageNews(); + wmsOdsEmStorageNews.setWhCode(wmsRawOrderInSn.getWhCode());//仓库编码 + wmsOdsEmStorageNews.setWlCode(wmsRawOrderInSn.getWlCode());//库位编码 + wmsOdsEmStorageNews.setMaterialCode(wmsRawOrderInSn.getMaterialCode()); + wmsOdsEmStorageNews.setAmount(new BigDecimal(wmsToWCSDTO.getQty())); + //添加库存--这个要有个判断有没有这个库存如果没有的话,就插入 + wmsOdsMateStorageNewsSnMapper.updateAdd(wmsOdsEmStorageNews); + //修改托盘记录为入库 + wmsRawOrderInSnMapper.updateU1Byid(wmsRawOrderInSn); + + wmsToWCSDTO.setCode("0"); + + wmsToWCSDTO.setMessage("OK"); + return wmsToWCSDTO; + } + + /** + * 包材出库完成回传 + * @param wcsdto + * @return + */ + @Override + public WmsToWCSDTO packingMaterialsOutBoundCompleted(WmsToWCSDTO wcsdto) { + //记录明细消减库存 + DynamicDataSourceContextHolder.push("ds_" + wcsdto.getFactory()); + + return wcsdto; + } +} diff --git a/op-modules/op-wms/src/main/resources/mapper/wms/OdsProcureOrderMapper.xml b/op-modules/op-wms/src/main/resources/mapper/wms/OdsProcureOrderMapper.xml index f4afca53..60db94ef 100644 --- a/op-modules/op-wms/src/main/resources/mapper/wms/OdsProcureOrderMapper.xml +++ b/op-modules/op-wms/src/main/resources/mapper/wms/OdsProcureOrderMapper.xml @@ -3,7 +3,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + @@ -39,12 +39,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select Site_code, ID, Procure_Code, Material_Code, Material_Desc, Plan_Date, Plan_Number, Unit, Reality_Number, Order_Status, User_Defined1, User_Defined2, User_Defined3, User_Defined4, User_Defined5, User_Defined6, User_Defined7, User_Defined8, User_Defined9, User_Defined10, User_Defined11, Supplier_Code, Supplier_Name, Remark, Create_By, Create_Date, Last_Update_By, Last_Update_Date, Active, Enterprise_Id, Enterprise_Code from ods_procure_order + select Site_code, ID, Procure_Code, Material_Code, Material_Desc, Plan_Date, Plan_Number, Unit,COALESCE(Reality_Number, 0) Reality_Number, Order_Status, User_Defined1, User_Defined2, User_Defined3, User_Defined4, User_Defined5, User_Defined6, User_Defined7, User_Defined8, User_Defined9, User_Defined10, User_Defined11, Supplier_Code, Supplier_Name, Remark, Create_By, Create_Date, Last_Update_By, Last_Update_Date, Active, Enterprise_Id, Enterprise_Code from ods_procure_order - + - + insert into ods_procure_order @@ -195,9 +195,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - delete from ods_procure_order where ID in + delete from ods_procure_order where ID in #{ID} - \ No newline at end of file + + update ods_procure_order + SET Reality_Number = COALESCE(Reality_Number, 0) + #{planNumber}, + Order_Status=#{orderStatus} + where ID = #{ID} + + + diff --git a/op-modules/op-wms/src/main/resources/mapper/wms/WmsOdsEmStorageNewsMapper.xml b/op-modules/op-wms/src/main/resources/mapper/wms/WmsOdsEmStorageNewsMapper.xml index dd3cde8a..dcfa49cb 100644 --- a/op-modules/op-wms/src/main/resources/mapper/wms/WmsOdsEmStorageNewsMapper.xml +++ b/op-modules/op-wms/src/main/resources/mapper/wms/WmsOdsEmStorageNewsMapper.xml @@ -3,7 +3,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + @@ -46,7 +46,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - + - + insert into wms_ods_em_storage_news @@ -205,9 +205,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - delete from wms_ods_em_storage_news where storage_id in + delete from wms_ods_em_storage_news where storage_id in #{storageId} - \ No newline at end of file + + update wms_ods_em_storage_news + set + storage_amount = IFNULL(storage_amount, 0) - #{amount}, + gmt_modified=now() + where wh_code=#{whCode} and wl_code=#{wlCode} and material_code=#{materialCode} + + diff --git a/op-modules/op-wms/src/main/resources/mapper/wms/WmsOdsMateStorageNewsMapper.xml b/op-modules/op-wms/src/main/resources/mapper/wms/WmsOdsMateStorageNewsMapper.xml index 5cdf65da..892d7633 100644 --- a/op-modules/op-wms/src/main/resources/mapper/wms/WmsOdsMateStorageNewsMapper.xml +++ b/op-modules/op-wms/src/main/resources/mapper/wms/WmsOdsMateStorageNewsMapper.xml @@ -3,7 +3,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + @@ -46,7 +46,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - + - + insert into wms_ods_mate_storage_news @@ -205,9 +205,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - delete from wms_ods_mate_storage_news where storage_id in + delete from wms_ods_mate_storage_news where storage_id in #{storageId} - \ No newline at end of file + + diff --git a/op-modules/op-wms/src/main/resources/mapper/wms/WmsOdsMateStorageNewsSnMapper.xml b/op-modules/op-wms/src/main/resources/mapper/wms/WmsOdsMateStorageNewsSnMapper.xml index 7cb49b69..e623fe4c 100644 --- a/op-modules/op-wms/src/main/resources/mapper/wms/WmsOdsMateStorageNewsSnMapper.xml +++ b/op-modules/op-wms/src/main/resources/mapper/wms/WmsOdsMateStorageNewsSnMapper.xml @@ -3,7 +3,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + @@ -42,7 +42,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - + - + insert into wms_ods_mate_storage_news_sn @@ -182,9 +182,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - delete from wms_ods_mate_storage_news_sn where mate_order_in_sn_id in + delete from wms_ods_mate_storage_news_sn where mate_order_in_sn_id in #{mateOrderInSnId} - \ No newline at end of file + + update wms_ods_mate_storage_news + set amount = IFNULL(amount, 0) + #{amount}, + storage_amount = IFNULL(storage_amount, 0) + #{amount}, + gmt_modified=now() + where wh_code=#{whCode} and wl_code=#{wlCode} and material_code=#{materialCode} + + + diff --git a/op-modules/op-wms/src/main/resources/mapper/wms/WmsOdsWhiteEmbryoInMapper.xml b/op-modules/op-wms/src/main/resources/mapper/wms/WmsOdsWhiteEmbryoInMapper.xml index 3a49d4ba..8b915888 100644 --- a/op-modules/op-wms/src/main/resources/mapper/wms/WmsOdsWhiteEmbryoInMapper.xml +++ b/op-modules/op-wms/src/main/resources/mapper/wms/WmsOdsWhiteEmbryoInMapper.xml @@ -3,7 +3,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + @@ -47,7 +47,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - + + + + + + - + insert into wms_ods_white_embryo_in @@ -210,9 +218,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - delete from wms_ods_white_embryo_in where ID in + delete from wms_ods_white_embryo_in where ID in #{ID} - \ No newline at end of file + + + update wms_ods_white_embryo_in + set + Order_Status = #{orderStatus}, + Reality_Number=#{realityNumber}, + Last_Update_Date = now() + where Order_Code=#{orderCode} + + diff --git a/op-modules/op-wms/src/main/resources/mapper/wms/WmsRawOrderInMapper.xml b/op-modules/op-wms/src/main/resources/mapper/wms/WmsRawOrderInMapper.xml index dd97d3e1..17adb8f6 100644 --- a/op-modules/op-wms/src/main/resources/mapper/wms/WmsRawOrderInMapper.xml +++ b/op-modules/op-wms/src/main/resources/mapper/wms/WmsRawOrderInMapper.xml @@ -3,7 +3,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + @@ -65,7 +65,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - + - + insert into wms_raw_order_in @@ -299,9 +299,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - delete from wms_raw_order_in where raw_order_in_id in + delete from wms_raw_order_in where raw_order_in_id in #{rawOrderInId} - \ No newline at end of file + + + diff --git a/op-modules/op-wms/src/main/resources/mapper/wms/WmsRawOrderInSnMapper.xml b/op-modules/op-wms/src/main/resources/mapper/wms/WmsRawOrderInSnMapper.xml index 347ccaf7..a90f5baa 100644 --- a/op-modules/op-wms/src/main/resources/mapper/wms/WmsRawOrderInSnMapper.xml +++ b/op-modules/op-wms/src/main/resources/mapper/wms/WmsRawOrderInSnMapper.xml @@ -3,7 +3,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + @@ -41,7 +41,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - + - + insert into wms_raw_order_in_sn + raw_order_in_sn_id, wh_code, wa_code, wl_code, @@ -108,6 +110,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" sap_factory_code, + #{rawOrderInSnId}, #{whCode}, #{waCode}, #{wlCode}, @@ -177,9 +180,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - delete from wms_raw_order_in_sn where raw_order_in_sn_id in + delete from wms_raw_order_in_sn where raw_order_in_sn_id in #{rawOrderInSnId} - \ No newline at end of file + + + update wms_raw_order_in_sn + set + user_defined1 = '2' + where raw_order_in_sn_id=#{rawOrderInSnId} + +