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 c5812c6c..845ed2c9 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 @@ -73,6 +73,7 @@ public interface RemoteSapService { public R sapBackflushMP(List sapBackflushMPQueryList); /**订单物料领料过账、原材料补料、订单物料退料过账接口(MB1A)**/ + @PostMapping("/sap/sapMaterialPosting") public R sapMaterialPosting(@RequestBody List sapMaterialPostingList); /**智慧工厂储位信息*/ 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 317cb951..5568bd0f 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 @@ -255,6 +255,7 @@ public class OdsProcureOrderController extends BaseController { List result= odsProcureOrderService.ProductionMaterialRequisition(odsProcureOutOrder); return success(result); } + /** * 生产领料--托盘数据查询 * @param wmsOdsMateStorageNewsSn @@ -277,4 +278,15 @@ public class OdsProcureOrderController extends BaseController { Integer result= odsProcureOrderService.ProductionMaterialRequisitionAdd(orderList); return success(result); } + + /** + * 出库过账 + * @param orderList + * @return + */ + @PostMapping("/OutboundPostingSAP") + public AjaxResult OutboundPostingSAP(@RequestBody List orderList) { + odsProcureOrderService.OutboundPostingSAP(orderList); + return success(); + } } diff --git a/op-modules/op-wms/src/main/java/com/op/wms/controller/WmsToWCSmissionController.java b/op-modules/op-wms/src/main/java/com/op/wms/controller/WmsToWCSmissionController.java index 1af86c7b..add308c5 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/controller/WmsToWCSmissionController.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/controller/WmsToWCSmissionController.java @@ -152,5 +152,34 @@ public WmsToWCSDTO packingMaterialsOutBoundCompleted(@RequestBody WmsToWCSDTO wc List result= odsProcureOrderService.ProductionMaterialRequisition(odsProcureOutOrder); return success(result); } - + /** + * 生产领料--托盘数据查询 + * @param wmsOdsMateStorageNewsSn + * @return + */ + @PostMapping("/ProductionMaterialRequisitionsn") + public AjaxResult ProductionMaterialRequisitionsn(@RequestBody WmsOdsMateStorageNewsSn wmsOdsMateStorageNewsSn) { + WmsOdsMateStorageNewsSn wmsOdsMateStorageNewsSn1= odsProcureOrderService.ProductionMaterialRequisitionsn(wmsOdsMateStorageNewsSn); + return success(wmsOdsMateStorageNewsSn1); + } + /** + * 出库过账 + * @param orderList + * @return + */ + @PostMapping("/OutboundPostingSAP") + public AjaxResult OutboundPostingSAP(@RequestBody List orderList) { + odsProcureOrderService.OutboundPostingSAP(orderList); + return success(); + } + /** + * 生产领料--确认 + * @param orderList + * @return + */ + @PostMapping("/ProductionMaterialRequisitionAdd") + public AjaxResult ProductionMaterialRequisitionAdd(@RequestBody List orderList) { + Integer result= odsProcureOrderService.ProductionMaterialRequisitionAdd(orderList); + return success(result); + } } diff --git a/op-modules/op-wms/src/main/java/com/op/wms/domain/OdsProcureOutOrder.java b/op-modules/op-wms/src/main/java/com/op/wms/domain/OdsProcureOutOrder.java index 0c01a494..1648f081 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/domain/OdsProcureOutOrder.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/domain/OdsProcureOutOrder.java @@ -66,6 +66,16 @@ public class OdsProcureOutOrder extends BaseEntity { @Excel(name = "计划数量") private BigDecimal planNumber; + private String sn; + + public String getSn() { + return sn; + } + + public void setSn(String sn) { + this.sn = sn; + } + /** 单位 */ @Excel(name = "单位") private String Unit; 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 index 9bcb71a2..22f1a2b4 100644 --- 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 @@ -30,6 +30,15 @@ public class OrderLine extends BaseEntity { private String siteCode; private String unit; private String userDefined2; + private String userDefined3; + + public String getUserDefined3() { + return userDefined3; + } + + public void setUserDefined3(String userDefined3) { + this.userDefined3 = userDefined3; + } public String getMaterialCode() { return materialCode; diff --git a/op-modules/op-wms/src/main/java/com/op/wms/mapper/BaseWarehouseMapper.java b/op-modules/op-wms/src/main/java/com/op/wms/mapper/BaseWarehouseMapper.java index 3834bd30..3235d268 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/mapper/BaseWarehouseMapper.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/mapper/BaseWarehouseMapper.java @@ -7,14 +7,14 @@ import com.op.wms.domain.BaseWarehouse; /** * 仓库管理Mapper接口 - * + * * @author Open Platform * @date 2023-07-04 */ public interface BaseWarehouseMapper { /** * 查询仓库管理 - * + * * @param warehouseId 仓库管理主键 * @return 仓库管理 */ @@ -22,7 +22,7 @@ public interface BaseWarehouseMapper { /** * 查询仓库管理列表 - * + * * @param baseWarehouse 仓库管理 * @return 仓库管理集合 */ @@ -30,7 +30,7 @@ public interface BaseWarehouseMapper { /** * 新增仓库管理 - * + * * @param baseWarehouse 仓库管理 * @return 结果 */ @@ -38,7 +38,7 @@ public interface BaseWarehouseMapper { /** * 修改仓库管理 - * + * * @param baseWarehouse 仓库管理 * @return 结果 */ @@ -46,7 +46,7 @@ public interface BaseWarehouseMapper { /** * 删除仓库管理 - * + * * @param warehouseId 仓库管理主键 * @return 结果 */ @@ -54,7 +54,7 @@ public interface BaseWarehouseMapper { /** * 批量删除仓库管理 - * + * * @param warehouseIds 需要删除的数据主键集合 * @return 结果 */ @@ -64,4 +64,6 @@ public interface BaseWarehouseMapper { String checkWarehouseCodeUnique(BaseWarehouse baseWarehouse); String checkWarehouseNameUnique(BaseWarehouse baseWarehouse); + + String selectByCode(String locCode); } diff --git a/op-modules/op-wms/src/main/java/com/op/wms/mapper/OdsProcureOutOrderMapper.java b/op-modules/op-wms/src/main/java/com/op/wms/mapper/OdsProcureOutOrderMapper.java index b4aad6b5..d48005bf 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/mapper/OdsProcureOutOrderMapper.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/mapper/OdsProcureOutOrderMapper.java @@ -3,6 +3,7 @@ package com.op.wms.mapper; import java.util.List; import com.op.wms.domain.OdsProcureOutOrder; +import org.apache.ibatis.annotations.Param; /** * 包材出库单Mapper接口 @@ -62,4 +63,10 @@ public interface OdsProcureOutOrderMapper { OdsProcureOutOrder selectmesPrepare(OdsProcureOutOrder odsProcureOrder); List selectmesPrepareDetail(OdsProcureOutOrder odsProcureOutOrder); + + void insertWmsRawMissionOut(OdsProcureOutOrder order); + + void updateOdsProcureOutOrderByid(OdsProcureOutOrder odsProcureOutOrder); + + List selectOdsProcureOutOrderListByIds(@Param("list") List orderList); } 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 3a0b9173..7c79cc8f 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 @@ -88,4 +88,6 @@ public interface IOdsProcureOrderService { Integer ProductionMaterialRequisitionAdd(List orderList); WmsOdsMateStorageNewsSn ProductionMaterialRequisitionsn(WmsOdsMateStorageNewsSn wmsOdsMateStorageNewsSn); + + void OutboundPostingSAP(List odsProcureOutOrder); } 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 9120c4c1..723ddc47 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 @@ -17,7 +17,10 @@ import java.util.List; import com.op.common.core.domain.R; - +import com.op.common.security.utils.SecurityUtils; +import com.op.system.api.RemoteSapService; +import com.op.system.api.domain.sap.SapBackflushMPQuery; +import com.op.system.api.domain.sap.SapMaterialPosting; import okhttp3.OkHttpClient; import okhttp3.MediaType; import okhttp3.RequestBody; @@ -53,7 +56,11 @@ public class OdsProcureOrderServiceImpl implements IOdsProcureOrderService { private WmsOdsMateStorageNewsMapper wmsOdsMateStorageNewsMapper; @Autowired private OdsProcureOutOrderMapper odsProcureOutOrderMapper; + @Autowired + private RemoteSapService remoteSapService; + @Autowired + private BaseWarehouseMapper baseWarehouseMapper; /** * 查询包材采购单 * @@ -262,7 +269,7 @@ public class OdsProcureOrderServiceImpl implements IOdsProcureOrderService { public OrderLine addPurchaseOrderOutbound(OrderLine orderLine) { //自己生成行项目,,批次号 List orderList= orderLine.getList(); - SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHH:mm:ss"); + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss"); Date date = new Date(); String formattedDate = dateFormat.format(date); //根据订单号查询对应的最大批次号 @@ -280,7 +287,9 @@ public class OdsProcureOrderServiceImpl implements IOdsProcureOrderService { orderList) { OdsProcureOutOrder odsProcureOutOrder=new OdsProcureOutOrder(); odsProcureOutOrder.setID(IdUtils.fastSimpleUUID()); + odsProcureOutOrder.setSiteCode(orderLine1.getSiteCode()); odsProcureOutOrder.setProduceCode(orderLine.getOrderNo()); + odsProcureOutOrder.setLocCode(orderLine.getWarehouseNo()); odsProcureOutOrder.setMaterialCode(orderLine1.getMaterialCode()); odsProcureOutOrder.setMaterialDesc(orderLine1.getMaterialDesc()); odsProcureOutOrder.setPlanDate(new Date()); @@ -291,6 +300,8 @@ public class OdsProcureOrderServiceImpl implements IOdsProcureOrderService { odsProcureOutOrder.setOrderStatus("1"); odsProcureOutOrder.setPlanNumber(orderLine1.getPlanNumber()); odsProcureOutOrder.setUserDefined2(orderLine1.getOrderLineNo()); + odsProcureOutOrder.setUserDefined3(orderLine1.getUserDefined3()); + odsProcureOutOrder.setUserDefined10("1"); //odsProcureOutOrder.set odsProcureOutOrderMapper.insertOdsProcureOutOrder(odsProcureOutOrder); } @@ -301,7 +312,9 @@ public class OdsProcureOrderServiceImpl implements IOdsProcureOrderService { orderList) { OdsProcureOutOrder odsProcureOutOrder=new OdsProcureOutOrder(); odsProcureOutOrder.setID(IdUtils.fastSimpleUUID()); + odsProcureOutOrder.setLocCode(orderLine.getWarehouseNo()); odsProcureOutOrder.setProduceCode(orderLine.getOrderNo()); + odsProcureOutOrder.setSiteCode(orderLine1.getSiteCode()); odsProcureOutOrder.setMaterialCode(orderLine1.getMaterialCode()); odsProcureOutOrder.setMaterialDesc(orderLine1.getMaterialDesc()); odsProcureOutOrder.setPlanDate(new Date()); @@ -310,9 +323,11 @@ public class OdsProcureOrderServiceImpl implements IOdsProcureOrderService { odsProcureOutOrder.setUserDefined1(orderLine1.getBatchNo()); odsProcureOutOrder.setActive("1"); odsProcureOutOrder.setOrderStatus("1"); + odsProcureOutOrder.setUserDefined10("1"); odsProcureOutOrder.setPlanNumber(orderLine1.getPlanNumber()); odsProcureOutOrder.setUserDefined2(orderLine1.getOrderLineNo()); //odsProcureOutOrder.set + odsProcureOutOrder.setUserDefined3(orderLine1.getUserDefined3()); odsProcureOutOrderMapper.insertOdsProcureOutOrder(odsProcureOutOrder); } } @@ -441,10 +456,64 @@ public class OdsProcureOrderServiceImpl implements IOdsProcureOrderService { //修改对应订单--插入对应出库托盘数据数据 // for (OdsProcureOutOrder odsProcureOutOrder: // orderList) { -// //领料单,物料编号,物料名称,托盘号,出库数量,库位号, +// //领料单,物料编号,领料单批次,物料名称,托盘号,出库数量,库位号, // odsProcureOutOrder. // } + String factoryCode =orderList.get(0).getFactoryCode(); + DynamicDataSourceContextHolder.push("ds_" +factoryCode); + for (OdsProcureOutOrder odsProcureOutOrder: + orderList) { + //领料单,物料编号,领料单批次,物料名称,托盘号,出库数量,库位号, + WmsToWCSDTO wcsdto =new WmsToWCSDTO(); + + wcsdto.setRfidNo(odsProcureOutOrder.getSn()); + WmsOdsMateStorageNewsSn wmsOdsMateStorageNewsSn= wmsOdsMateStorageNewsSnMapper.selectwmsRfidNotwo(wcsdto); + //明细 + //wms_raw_mission_out--保存 + //ods_procure_out_order--修改 + WCSInventoryPlan wcsInventoryPlan=new WCSInventoryPlan(); + wcsInventoryPlan.setSku(odsProcureOutOrder.getMaterialCode()); + WmsOdsMateStorageNews wmsOdsMateStorageNews= wmsOdsMateStorageNewsMapper.selectBaseProductByCode(wcsInventoryPlan); + + OdsProcureOutOrder order=new OdsProcureOutOrder(); + order.setProduceCode(odsProcureOutOrder.getProduceCode());//领料单 + order.setMaterialCode(odsProcureOutOrder.getMaterialCode());// + order.setMaterialDesc(odsProcureOutOrder.getMaterialDesc()); + order.setUserDefined1(odsProcureOutOrder.getUserDefined1());//批次 + order.setSn(odsProcureOutOrder.getSn()); + order.setPlanNumber(odsProcureOutOrder.getPlanNumber()); + order.setLocCode(odsProcureOutOrder.getLocCode()); + order.setID(IdUtils.fastSimpleUUID()); + order.setUnit(wmsOdsMateStorageNews.getUserDefined1()); + order.setFactoryCode(factoryCode); + order.setActive("1"); + order.setCreateBy(SecurityUtils.getUsername()); + order.setCreateDate(new Date()); + odsProcureOutOrderMapper.insertWmsRawMissionOut(order); + + OdsProcureOutOrder odsProcureOutOrder1= odsProcureOutOrderMapper.selectOdsProcureOutOrderByID(odsProcureOutOrder.getID()); + BigDecimal realityNumber1 = odsProcureOutOrder1.getOutNumber();//累计数 + BigDecimal realityNumber = odsProcureOutOrder1.getPlanNumber();//计划 + BigDecimal planNumber =odsProcureOutOrder.getPlanNumber(); + BigDecimal tem= realityNumber1.add(planNumber); + boolean isEqual = tem.equals(realityNumber); + if (isEqual){ + odsProcureOutOrder1.setOrderStatus("3"); + }else { + odsProcureOutOrder1.setOrderStatus("2"); + } + odsProcureOutOrder1.setOutNumber(tem); + odsProcureOutOrderMapper.updateOdsProcureOutOrder(odsProcureOutOrder1); + WmsOdsEmStorageNews wmsOdsEmStorageNews=new WmsOdsEmStorageNews(); + wmsOdsEmStorageNews.setWhCode(wmsOdsMateStorageNewsSn.getWhCode());//仓库编码 + wmsOdsEmStorageNews.setWlCode(wmsOdsMateStorageNewsSn.getWlCode());//库位编码 + wmsOdsEmStorageNews.setMaterialCode(wmsOdsMateStorageNewsSn.getMaterialCode()); + wmsOdsEmStorageNews.setAmount(wmsOdsMateStorageNewsSn.getAmount());//库存 + wmsOdsMateStorageNewsSnMapper.updatekdd(wmsOdsEmStorageNews);//库存调整 + wmsOdsMateStorageNewsSn.setUserDefined1("1"); + wmsOdsMateStorageNewsSnMapper.updateWmsOdsMateStorageNewsSn(wmsOdsMateStorageNewsSn);//库存明细 + } return null; } @@ -457,6 +526,70 @@ public class OdsProcureOrderServiceImpl implements IOdsProcureOrderService { return wmsOdsMateStorageNewsSn1; } + @Override + @DS("#header.poolName") + public void OutboundPostingSAP(List orderList) { + +// * 退料的移动类型为 262 +// * 领料的移动类型为 261 + List orderList1=odsProcureOutOrderMapper.selectOdsProcureOutOrderListByIds(orderList); + for (OdsProcureOutOrder odsProcureOutOrder: + orderList1) { + //取sap仓库号 + if ("X".equals(odsProcureOutOrder.getUserDefined3())){ + List sapBackflushMPQueryList=new ArrayList<>(); + SapBackflushMPQuery sapBackflushMPQuery=new SapBackflushMPQuery(); + sapBackflushMPQuery.setPlant(odsProcureOutOrder.getSiteCode()); //工厂 + String lgort= baseWarehouseMapper.selectByCode(odsProcureOutOrder.getLocCode()); + sapBackflushMPQuery.setLgort(lgort);//库存地点 + sapBackflushMPQuery.setMatnr(odsProcureOutOrder.getMaterialCode());//物料号 + sapBackflushMPQuery.setQuantity(odsProcureOutOrder.getOutNumber().toString()); //数量 + sapBackflushMPQuery.setMeins(odsProcureOutOrder.getUnit()); //基本计量单位 + sapBackflushMPQuery.setBatch(odsProcureOutOrder.getUserDefined2()); //批号 + sapBackflushMPQueryList.add(sapBackflushMPQuery); + R result2= remoteSapService.sapBackflushMP(sapBackflushMPQueryList);//x + int code= result2.getCode(); + String msg= result2.getMsg(); + odsProcureOutOrder.setUserDefined11(msg); + if (code==200){//过账成功 + odsProcureOutOrder.setUserDefined10("2");//成功 + odsProcureOutOrderMapper.updateOdsProcureOutOrderByid(odsProcureOutOrder); + + }else {// + odsProcureOutOrder.setUserDefined10("3");//失败 + odsProcureOutOrderMapper.updateOdsProcureOutOrderByid(odsProcureOutOrder); + } + }else { + List sapMaterialPostingList=new ArrayList<>(); + SapMaterialPosting sapMaterialPosting =new SapMaterialPosting(); + sapMaterialPosting.setAufnr(odsProcureOutOrder.getProduceCode());//订单号 + sapMaterialPosting.setBwart("261"); //移动类型 + sapMaterialPosting.setPlant(odsProcureOutOrder.getSiteCode()); //工厂 + String lgort= baseWarehouseMapper.selectByCode(odsProcureOutOrder.getLocCode()); + sapMaterialPosting.setLgort(lgort);//库存地点 + sapMaterialPosting.setMatnr(odsProcureOutOrder.getMaterialCode());//物料号 + sapMaterialPosting.setQuantity(odsProcureOutOrder.getOutNumber().toString()); //数量 + sapMaterialPosting.setMeins(odsProcureOutOrder.getUnit()); //基本计量单位 + sapMaterialPosting.setBatch(odsProcureOutOrder.getUserDefined2()); //批号 + sapMaterialPostingList.add(sapMaterialPosting); + R result= remoteSapService.sapMaterialPosting(sapMaterialPostingList); + int code= result.getCode(); + String msg= result.getMsg(); + odsProcureOutOrder.setUserDefined11(msg); + if (code==200){//过账成功 + odsProcureOutOrder.setUserDefined10("2");//成功 + odsProcureOutOrderMapper.updateOdsProcureOutOrderByid(odsProcureOutOrder); + + }else {// + odsProcureOutOrder.setUserDefined10("3");//失败 + odsProcureOutOrderMapper.updateOdsProcureOutOrderByid(odsProcureOutOrder); + } + } + + } + + } + public String DesignatedPalletOutboundWCS(WMSDesignatedPalle wmsDesignatedPalle){ // 定义请求的URL地址 String url = "http://192.168.202.37:9001/api/v1/ReceiveMesMsg/packingMaterialsOutBoundByPallet"; 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 index 557a2ece..a5e67ebd 100644 --- 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 @@ -128,7 +128,7 @@ public class WmsToWCSmissionServiceImpl implements IWmsToWCSmissionService { */ @Override public WmsToWCSDTO packingMaterialsOutBoundCompleted(WmsToWCSDTO wcsdto) { - //记录明细消减库存 + //记录明细消减库存--wms_raw_mission_out- DynamicDataSourceContextHolder.push("ds_" + wcsdto.getFactory()); WmsOdsMateStorageNewsSn wmsOdsMateStorageNewsSn= wmsOdsMateStorageNewsSnMapper.selectwmsRfidNotwo(wcsdto); diff --git a/op-modules/op-wms/src/main/resources/mapper/wms/BaseWarehouseMapper.xml b/op-modules/op-wms/src/main/resources/mapper/wms/BaseWarehouseMapper.xml index cda0ed11..7a931996 100644 --- a/op-modules/op-wms/src/main/resources/mapper/wms/BaseWarehouseMapper.xml +++ b/op-modules/op-wms/src/main/resources/mapper/wms/BaseWarehouseMapper.xml @@ -3,7 +3,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + @@ -33,7 +33,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - + - + insert into base_warehouse @@ -162,5 +162,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where warehouse_code = #{warehouseCode} and del_flag = '0' - - \ No newline at end of file + + diff --git a/op-modules/op-wms/src/main/resources/mapper/wms/OdsProcureOutOrderMapper.xml b/op-modules/op-wms/src/main/resources/mapper/wms/OdsProcureOutOrderMapper.xml index 67471bfc..c589f17b 100644 --- a/op-modules/op-wms/src/main/resources/mapper/wms/OdsProcureOutOrderMapper.xml +++ b/op-modules/op-wms/src/main/resources/mapper/wms/OdsProcureOutOrderMapper.xml @@ -42,7 +42,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select Site_code, ID, Produce_Code, Material_Code, Material_Desc, Plan_Date, Plan_Number, Unit, Out_Number, Loc_Code, Loc_Desc, Production_Line_Desc, Production_Line_Code, 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, Create_By, Create_Date, Last_Update_By, Last_Update_Date, Active, Enterprise_Id, Enterprise_Code from ods_procure_out_order + select Site_code, ID, Produce_Code, Material_Code, Material_Desc, Plan_Date, Plan_Number, Unit, COALESCE(Out_Number, 0) as Out_Number , Loc_Code, Loc_Desc, Production_Line_Desc, Production_Line_Code, 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, Create_By, Create_Date, Last_Update_By, Last_Update_Date, Active, Enterprise_Id, Enterprise_Code from ods_procure_out_order + + insert into wms_raw_mission_out(id, + prd_order, + material_code, + material_desc, + unit, + user_defined1, + sn, + amount, + origin_location, + factory_code, + active_flag, + create_by, + gmt_create + )values ( + #{ID}, + #{produceCode}, + #{materialCode}, + #{materialDesc}, + #{Unit}, + #{userDefined1}, + #{sn}, + #{planNumber}, + #{locCode}, + #{factoryCode}, + #{Active}, + #{createBy}, + #{createDate} ) + + + + update ods_procure_out_order + set User_Defined10 = #{userDefined10}, + User_Defined11 = #{userDefined11} + where ID = #{ID} + +