Merge remote-tracking branch 'origin/master'

highway
wws 12 months ago
commit 84bbed960a

@ -40,7 +40,7 @@ public interface RemoteSapService {
/**关闭订单**/ /**关闭订单**/
@PostMapping("/sap/sapCloseOrder") @PostMapping("/sap/sapCloseOrder")
public R sapCloseOrder(@RequestParam("shopOrder") String shopOrder); public R sapCloseOrder(@RequestBody SapCloseOrderQuery sapCloseOrderQuery);
/**报工**/ /**报工**/
@PostMapping("/sap/sapRFWOrder") @PostMapping("/sap/sapRFWOrder")

@ -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();
}
}

@ -1,4 +1,4 @@
package com.op.sap.domain.vo; package com.op.system.api.domain.sap;
public class SapCloseOrderQuery { public class SapCloseOrderQuery {

@ -44,7 +44,7 @@ public class SapRFW {
} }
public class lt_gs public static class lt_gs
{ {
String conf_activity1; String conf_activity1;
String conf_activity2; String conf_activity2;

@ -40,7 +40,7 @@ public class RemoteSapFallbackFactory implements FallbackFactory<RemoteSapServic
} }
@Override @Override
public R sapCloseOrder(String shopOrder) { public R sapCloseOrder(SapCloseOrderQuery sapCloseOrderQuery) {
return R.fail("关闭订单失败:" + throwable.getMessage()); return R.fail("关闭订单失败:" + throwable.getMessage());
} }

@ -137,4 +137,14 @@ public class Constants {
public static final String LOW="LOW"; public static final String LOW="LOW";
public static final String HIGH="HIGH"; public static final String HIGH="HIGH";
/**
* SAP
*/
//退料
public static final Integer TL=262;
//领料
public static final Integer LL=261;
} }

@ -9,13 +9,11 @@ import com.op.common.core.utils.DateUtils;
import com.op.common.core.utils.bean.BeanUtils; import com.op.common.core.utils.bean.BeanUtils;
import com.op.common.core.utils.http.HttpUtils; import com.op.common.core.utils.http.HttpUtils;
import com.op.common.core.utils.uuid.IdUtils; import com.op.common.core.utils.uuid.IdUtils;
import com.op.mes.domain.BufferInfoParam; import com.op.mes.domain.*;
import com.op.mes.domain.MesReportWork;
import com.op.mes.domain.MesShift;
import com.op.mes.domain.ProOrderWorkorder;
import com.op.mes.domain.buffer.JsonRootBean; import com.op.mes.domain.buffer.JsonRootBean;
import com.op.mes.domain.dto.LGInfoDto; import com.op.mes.domain.dto.LGInfoDto;
import com.op.mes.mapper.MesMapper; import com.op.mes.mapper.MesMapper;
import com.op.mes.mapper.MesReportWorkConsumeMapper;
import com.op.mes.mapper.MesReportWorkMapper; import com.op.mes.mapper.MesReportWorkMapper;
import com.op.mes.mapper.ProRfidProcessDetailMapper; import com.op.mes.mapper.ProRfidProcessDetailMapper;
import com.op.mes.service.IWCSInterfaceService; import com.op.mes.service.IWCSInterfaceService;
@ -28,6 +26,7 @@ import com.op.system.api.domain.dto.BoardDTO;
import com.op.system.api.domain.dto.WCSDTO; import com.op.system.api.domain.dto.WCSDTO;
import com.op.system.api.domain.dto.WCSDataDTO; import com.op.system.api.domain.dto.WCSDataDTO;
import com.op.system.api.domain.mes.ProRfidProcessDetail; 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 com.op.system.api.domain.sap.SapRFW;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
@ -69,6 +68,9 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService {
@Autowired @Autowired
private RemoteSapService remoteSapService; private RemoteSapService remoteSapService;
@Autowired
private MesReportWorkConsumeMapper mesReportWorkConsumeMapper;
/** /**
* JSON * JSON
* { * {
@ -296,7 +298,7 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService {
SapRFW sapRFW = new SapRFW(); SapRFW sapRFW = new SapRFW();
sapRFW.setAufnr(work.getWorkorderCodeSap());//虚拟工单号 sapRFW.setAufnr(work.getWorkorderCodeSap());//虚拟工单号
sapRFW.setGamng(work.getQuantityFeedback().toString());//报工数量 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_activity1(work.getSac1());//人工
ltgs.setConf_activity2(work.getSac2()); ltgs.setConf_activity2(work.getSac2());
ltgs.setConf_activity3(work.getSac3());//机器 ltgs.setConf_activity3(work.getSac3());//机器
@ -305,21 +307,27 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService {
ltgs.setConf_activity6(work.getSac6()); ltgs.setConf_activity6(work.getSac6());
sapRFW.setLt_gs(ltgs); sapRFW.setLt_gs(ltgs);
List<SapRFW.lt_hw> lt_hwList =new ArrayList<>(); List<SapRFW.lt_hw> lt_hwList =new ArrayList<>();
logger.info(work.getWorkorderCodeSap()+"母sap工单报工报工数量"+sapRFW.getGamng());
MesReportWorkConsume consumeqo = new MesReportWorkConsume();
consumeqo.setWorkorderCode(work.getWorkorderCode());
List<MesReportWorkConsume> 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生产订单报工货物移动修改 SapRFW.lt_hw lthw = sapRFW.new lt_hw();//MES生产订单报工货物移动修改
lthw.setEntry_qnt(work.getQuantityFeedback().toString());//TODO; lthw.setEntry_qnt(consume.getQuantity()+"");//数量
lthw.setMaterial(work.getProcessCode()); lthw.setMaterial(consume.getMaterialCode());//物料编码
lt_hwList.add(lthw); 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); 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); R r = remoteSapService.sapRFWOrder(sapRFW);
logger.info(work.getWorkorderCodeSap()+"母sap工单报工结果"+r.getCode()+","+r.getData()+","+r.getMsg());
//上传成功更改mes_report_work状态 //上传成功更改mes_report_work状态
if (r.getCode() == 200) { if (r.getCode() == 200) {
work.setUploadStatus("1"); work.setUploadStatus("1");
@ -339,10 +347,16 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService {
logger.info("工单请求关闭调用remoteSapService.sapCloseOrder,参数:"+work.getWorkorderCodeSap()); logger.info("工单请求关闭调用remoteSapService.sapCloseOrder,参数:"+work.getWorkorderCodeSap());
//工单完成,关闭工单 //工单完成,关闭工单
List<String> sapWorkOrders = mesReportWorkMapper.getSapWorkOrder(work.getWorkorderCode());//根据belong_work_order找到所有要关闭的虚拟工单 List<String> sapWorkOrders = mesReportWorkMapper.getSapWorkOrder(work.getWorkorderCode());//根据belong_work_order找到所有要关闭的虚拟工单
for(String sapWorkOrder:sapWorkOrders){ //关闭母子订单//订单的订单编码
R r2= remoteSapService.sapCloseOrder(sapWorkOrder); SapCloseOrderQuery sapCloseOrderQuery = new SapCloseOrderQuery();
logger.info("工单"+work.getWorkorderCode()+",sapworkorder:"+sapWorkOrder+",sap关闭"+r2.getCode()+",返回信息:"+r2.getMsg()); 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.setStatus("w3");
work.setUpdateTime(DateUtils.getNowDate()); work.setUpdateTime(DateUtils.getNowDate());

@ -2,6 +2,7 @@ package com.op.open.mapper;
import com.op.system.api.domain.SysSapLog; import com.op.system.api.domain.SysSapLog;
import com.op.system.api.domain.dto.WCSDTO; 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.MesReportWorkDTO;
import com.op.system.api.domain.mes.ProOrderWorkorderDTO; import com.op.system.api.domain.mes.ProOrderWorkorderDTO;
import com.op.system.api.domain.mes.ProRfidProcessDetail; import com.op.system.api.domain.mes.ProRfidProcessDetail;
@ -43,5 +44,7 @@ public interface OpenMapper {
List<WCSDTO> getLGInfo(WCSDTO wcsDTO); List<WCSDTO> getLGInfo(WCSDTO wcsDTO);
List<String> getSapWorkOrder(String workorderCode); List<String> getSapWorkOrder(String workorderCode);
List<MesReportWorkConsumeDTO> selectMesReportWorkConsumeList(MesReportWorkConsumeDTO consumeqo);
} }

@ -1,6 +1,7 @@
package com.op.open.service.impl; package com.op.open.service.impl;
import com.alibaba.fastjson2.JSONArray; import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder; import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
import com.op.common.core.domain.R; import com.op.common.core.domain.R;
import com.op.common.core.utils.DateUtils; 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.SysSapLog;
import com.op.system.api.domain.dto.WCSDTO; import com.op.system.api.domain.dto.WCSDTO;
import com.op.system.api.domain.dto.WCSDataDTO; 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.MesReportWorkDTO;
import com.op.system.api.domain.mes.ProOrderWorkorderDTO; import com.op.system.api.domain.mes.ProOrderWorkorderDTO;
import com.op.system.api.domain.mes.ProRfidProcessDetail; 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 com.op.system.api.domain.sap.SapRFW;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
@ -165,7 +168,7 @@ public class OpenServiceImpl implements OpenService {
SapRFW sapRFW = new SapRFW(); SapRFW sapRFW = new SapRFW();
sapRFW.setAufnr(work.getWorkorderCodeSap());//虚拟工单号 sapRFW.setAufnr(work.getWorkorderCodeSap());//虚拟工单号
sapRFW.setGamng(work.getQuantityFeedback().toString());//报工数量 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_activity1(work.getSac1());//人工
ltgs.setConf_activity2(work.getSac2()); ltgs.setConf_activity2(work.getSac2());
ltgs.setConf_activity3(work.getSac3());//机器 ltgs.setConf_activity3(work.getSac3());//机器
@ -173,20 +176,28 @@ public class OpenServiceImpl implements OpenService {
ltgs.setConf_activity5(work.getSac5());//折旧 ltgs.setConf_activity5(work.getSac5());//折旧
ltgs.setConf_activity6(work.getSac6()); ltgs.setConf_activity6(work.getSac6());
sapRFW.setLt_gs(ltgs); sapRFW.setLt_gs(ltgs);
List<SapRFW.lt_hw> lt_hwList =new ArrayList<>();
logger.info(work.getWorkorderCodeSap()+"母sap工单报工报工数量"+sapRFW.getGamng());
MesReportWorkConsumeDTO consumeqo = new MesReportWorkConsumeDTO();
consumeqo.setWorkorderCode(work.getWorkorderCode());
List<MesReportWorkConsumeDTO> 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生产订单报工货物移动修改 SapRFW.lt_hw lthw = sapRFW.new lt_hw();//MES生产订单报工货物移动修改
lthw.setEntry_qnt(work.getQuantityFeedback().toString());//TODO; lthw.setEntry_qnt(consume.getQuantity()+"");//数量
lthw.setMaterial(work.getProcessCode()); lthw.setMaterial(consume.getMaterialCode());//物料编码
sapRFW.setLt_hw(lthw); lt_hwList.add(lthw);
//添加调用sap日志 }
SysSapLog sysSapLog = new SysSapLog(); }else{
sysSapLog.setId(IdUtils.fastSimpleUUID()); logger.info(work.getWorkorderCodeSap()+"母sap工单报工工单"+work.getWorkorderCode()+"==mes_report_work_consume没有数据");
sysSapLog.setMesssge(sapRFW.toString()); //return R.fail("mes_report_work_consume没有数据");
sysSapLog.setMethod("reportWork"); }
sysSapLog.setReqcode("请求"); sapRFW.setLt_hwList(lt_hwList);
sysSapLog.setCreateTime(DateUtils.getNowDate()); logger.info(work.getWorkorderCodeSap()+"母sap工单报工请求"+ JSONObject.toJSONString(sapRFW));
openMapper.addSapLog(sysSapLog);
R r = remoteSapService.sapRFWOrder(sapRFW); R r = remoteSapService.sapRFWOrder(sapRFW);
logger.info(work.getWorkorderCodeSap()+"母sap工单报工结果"+r.getCode()+","+r.getData()+","+r.getMsg());
//上传成功更改mes_report_work状态 //上传成功更改mes_report_work状态
if (r.getCode() == 200) { if (r.getCode() == 200) {
work.setUploadStatus("1"); work.setUploadStatus("1");
@ -199,18 +210,21 @@ public class OpenServiceImpl implements OpenService {
//工单完成数量>工单数量:关闭订单 //工单完成数量>工单数量:关闭订单
MesReportWorkDTO proResult = openMapper.getProdResult(work); MesReportWorkDTO proResult = openMapper.getProdResult(work);
//ProOrderWorkorderDTO topOrder = this.getTopOrder(work.getWorkorderCode()); //ProOrderWorkorderDTO topOrder = this.getTopOrder(work.getWorkorderCode());
if(proResult.getQuantityFeedback().compareTo(work.getQuantitySplit())>=0 if(proResult.getQuantityFeedback().compareTo(work.getQuantitySplit())>=0||"1".equals(work.getEndReport())//最终报工标识
||
"1".equals(work.getEndReport())//最终报工标识
){ ){
logger.info("工单请求关闭调用remoteSapService.sapCloseOrder,参数:"+work.getWorkorderCodeSap()); logger.info("工单请求关闭调用remoteSapService.sapCloseOrder,参数:"+work.getWorkorderCodeSap());
//工单完成,关闭母工单 //工单完成,关闭母工单
List<String> sapWorkOrders = openMapper.getSapWorkOrder(work.getWorkorderCode());//根据belong_work_order找到所有要关闭的虚拟工单 List<String> sapWorkOrders = openMapper.getSapWorkOrder(work.getWorkorderCode());//根据belong_work_order找到所有要关闭的虚拟工单
for(String sapWorkOrder:sapWorkOrders){ //关闭母子订单//订单的订单编码
R rclose = remoteSapService.sapCloseOrder(sapWorkOrder); SapCloseOrderQuery sapCloseOrderQuery = new SapCloseOrderQuery();
logger.info("工单"+work.getWorkorderCode()+",sapworkorder:"+sapWorkOrder+",sap关闭"+rclose.getCode()+",返回信息:"+rclose.getMsg()); 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.setStatus("w3");
work.setUpdateTime(DateUtils.getNowDate()); work.setUpdateTime(DateUtils.getNowDate());
//pro_work_order status->w3报工--belong_work_order //pro_work_order status->w3报工--belong_work_order

@ -126,5 +126,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select workorder_code_sap from pro_order_workorder select workorder_code_sap from pro_order_workorder
where belong_work_order = #{workorderCode} and del_flag = '0' where belong_work_order = #{workorderCode} and del_flag = '0'
</select> </select>
<select id="selectMesReportWorkConsumeList"
resultType="com.op.system.api.domain.mes.MesReportWorkConsumeDTO">
select
material_code materialCode,
quantity
from mes_report_work_consume
where
workorder_code = #{workorderCode} and del_flag = '0'
</select>
</mapper> </mapper>

@ -21,6 +21,7 @@ import com.op.system.api.RemoteSapService;
import com.op.system.api.domain.SysSapLog; import com.op.system.api.domain.SysSapLog;
import com.op.system.api.domain.dto.MesPrepareDTO; import com.op.system.api.domain.dto.MesPrepareDTO;
import com.op.system.api.domain.dto.MesPrepareDetailDTO; 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.SapCreateOrder;
import com.op.system.api.domain.sap.SapMaterialPreparation; import com.op.system.api.domain.sap.SapMaterialPreparation;
import com.op.system.api.domain.sap.SapShopOrderQuery; import com.op.system.api.domain.sap.SapShopOrderQuery;
@ -306,14 +307,14 @@ public class ProOrderWorkorderServiceImpl implements IProOrderWorkorderService {
sapList.add(sap); sapList.add(sap);
//添加调用sap日志 //添加调用sap日志
SysSapLog sysSapLog = new SysSapLog(); // SysSapLog sysSapLog = new SysSapLog();
sysSapLog.setId(IdUtils.fastSimpleUUID()); // sysSapLog.setId(IdUtils.fastSimpleUUID());
sysSapLog.setMesssge(Arrays.asList(sapList).toString()); // sysSapLog.setMesssge(Arrays.asList(sapList).toString());
sysSapLog.setMethod("downProOrderWorkorderByWorkorderIds"); // sysSapLog.setMethod("downProOrderWorkorderByWorkorderIds");
sysSapLog.setReqcode("请求"); // sysSapLog.setReqcode("请求");
sysSapLog.setCreateTime(DateUtils.getNowDate()); // sysSapLog.setCreateTime(DateUtils.getNowDate());
proOrderMapper.addSapLog(sysSapLog); // proOrderMapper.addSapLog(sysSapLog);
logger.info(whiteOrder.getWorkorderCode()+"sap工单回传sap虚拟工单号开始"+Arrays.asList(sapList).toString());
R<List<Map<String, String>>> r = remoteSapService.SapCreateOrder(sapList); R<List<Map<String, String>>> r = remoteSapService.SapCreateOrder(sapList);
logger.info("sap工单回传" + r.getMsg()); logger.info("sap工单回传" + r.getMsg());
if (500 == r.getCode()) { if (500 == r.getCode()) {
@ -328,7 +329,7 @@ public class ProOrderWorkorderServiceImpl implements IProOrderWorkorderService {
} }
Date updateTime = DateUtils.getNowDate(); Date updateTime = DateUtils.getNowDate();
if (!CollectionUtils.isEmpty(returnCodes)) { if (!CollectionUtils.isEmpty(returnCodes)) {
logger.info("sap工单回传sap虚拟工单号" + StringUtils.join(returnCodes, ",")); logger.info("sap工单回传sap虚拟工单号结束" + StringUtils.join(returnCodes, ","));
//按照母子顺序进行更新 //按照母子顺序进行更新
for (int m=0;m<returnCodes.size();m++) { for (int m=0;m<returnCodes.size();m++) {
ProOrderWorkorder oworkSap = new ProOrderWorkorder(); ProOrderWorkorder oworkSap = new ProOrderWorkorder();
@ -348,18 +349,20 @@ public class ProOrderWorkorderServiceImpl implements IProOrderWorkorderService {
this.getMesPrepare(returnCodes,wcodes); this.getMesPrepare(returnCodes,wcodes);
//关闭母子订单//订单的订单编码 //关闭母子订单//订单的订单编码
R closeR = null; SapCloseOrderQuery sapCloseOrderQuery = new SapCloseOrderQuery();
for(String orderCode:ordercodes){ sapCloseOrderQuery.setLeadOrder(ordercodes.get(0));
closeR= remoteSapService.sapCloseOrder(orderCode); sapCloseOrderQuery.setOrder(ordercodes.get(1));
logger.info(workorderId+"下发工单后关闭母订单"+orderCode+":"+closeR.getCode()+","+closeR.getMsg()); R closeR= remoteSapService.sapCloseOrder(sapCloseOrderQuery);
} logger.info(whiteOrder.getWorkorderCode()+"下发工单后关闭母订单"+sapCloseOrderQuery.getLeadOrder()+":"+
if(closeR.getCode()==200){ sapCloseOrderQuery.getOrder()+":"+
closeR.getCode()+","+
closeR.getMsg()+","+
closeR.getData());
//下达工单 //下达工单
String[] idsArrayAll = (String[])wids.toArray(new String[wids.size()]); String[] idsArrayAll = (String[])wids.toArray(new String[wids.size()]);
proOrderWorkorderMapper.downWorkorders(idsArrayAll); proOrderWorkorderMapper.downWorkorders(idsArrayAll);
} }
} }
}
return 1; return 1;
} }

@ -52,27 +52,8 @@ public class SapController extends BaseController {
@Autowired @Autowired
private SapBomMapper sapBomMapper; private SapBomMapper sapBomMapper;
/**
*
* @return
*/
@PostMapping("/shopOrderSync")
@Log(title = "同步SAP订单", businessType = BusinessType.SAP)
public R<List<SapProOrder>> 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 * @param
@ -113,7 +94,7 @@ public class SapController extends BaseController {
} }
/** /**
* * BOM
* @return * @return
*/ */
@PostMapping("/bomSync") @PostMapping("/bomSync")
@ -151,7 +132,6 @@ public class SapController extends BaseController {
} }
/** /**
* 线 * 线
* @return * @return
@ -190,74 +170,6 @@ public class SapController extends BaseController {
return R.ok(); return R.ok();
} }
/**
*
* @param shopOrder
* @return
*/
@PostMapping("/materialPreparation")
@Log(title = "生产订单备料单接口", businessType = BusinessType.SAP)
public R<List<SapMaterialPreparation>> materialPreparation(@RequestParam("shopOrder") String shopOrder){
return sapMaterialPreparationService.MaterialPreparation(shopOrder);
}
/**
*
* ***
* @param sapBackflushMPQueryList
* @return
*/
@PostMapping("/sapBackflushMP")
@Log(title = "", businessType = BusinessType.SAP)
public R sapBackflushMP(@RequestBody List<SapBackflushMPQuery> 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<List<Map<String, String>>> SapCreateOrder(@RequestBody List<SapCreateOrder> 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 * @return
@ -382,6 +294,96 @@ public class SapController extends BaseController {
} }
/**==================================生产订单相关============================================================================*/
/**
*
* @return
*/
@PostMapping("/shopOrderSync")
@Log(title = "同步SAP订单", businessType = BusinessType.SAP)
public R<List<SapProOrder>> shopOrderSync(@RequestBody SapShopOrderQuery sapProOrder){
return sapOrderService.shopOrderSync(sapProOrder);
}
/**
*
* @param sapCreateOrderList
* @return
*/
@PostMapping("/sapCreateOrder")
@Log(title = "生产订单创建接口", businessType = BusinessType.SAP)
public R<List<Map<String, String>>> SapCreateOrder(@RequestBody List<SapCreateOrder> 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<List<SapMaterialPreparation>> materialPreparation(@RequestParam("shopOrder") String shopOrder){
return sapMaterialPreparationService.MaterialPreparation(shopOrder);
}
/**
*
* ***
* @param sapBackflushMPQueryList
* @return
*/
@PostMapping("/sapBackflushMP")
@Log(title = "", businessType = BusinessType.SAP)
public R sapBackflushMP(@RequestBody List<SapBackflushMPQuery> sapBackflushMPQueryList){
return sapItemSyncService.sapBackflushMP(sapBackflushMPQueryList);
}
@PostMapping("/sapMaterialPosting")
@Log(title = "订单物料领料过账、原材料补料、订单物料退料过账接口MB1A", businessType = BusinessType.SAP)
public R sapMaterialPosting(@RequestBody SapMaterialPosting sapMaterialPosting){
return sapItemSyncService.sapMaterialPosting(sapMaterialPosting);
}
/** /**
* *
*/ */

@ -2,8 +2,8 @@ package com.op.sap.service;
import com.op.common.core.domain.R; import com.op.common.core.domain.R;
import com.op.sap.domain.vo.SapCloseOrderQuery;
import com.op.sap.domain.vo.SapPurchaseOrderQuery; 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.SapCreateOrder;
import com.op.system.api.domain.sap.SapRFW; import com.op.system.api.domain.sap.SapRFW;
import com.op.system.api.domain.sap.SapShopOrderQuery; import com.op.system.api.domain.sap.SapShopOrderQuery;

@ -1,16 +1,17 @@
package com.op.sap.service.impl; package com.op.sap.service.impl;
import com.alibaba.fastjson2.JSONObject;
import com.op.common.core.constant.Constants; import com.op.common.core.constant.Constants;
import com.op.common.core.domain.R; import com.op.common.core.domain.R;
import com.op.common.core.utils.DateUtils; import com.op.common.core.utils.DateUtils;
import com.op.common.core.utils.StringUtils; import com.op.common.core.utils.StringUtils;
import com.op.common.core.utils.uuid.IdUtils; 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.domain.vo.SapPurchaseOrderQuery;
import com.op.sap.service.SapOrderService; import com.op.sap.service.SapOrderService;
import com.op.sap.util.SAPConnUtils; 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.SapCreateOrder;
import com.op.system.api.domain.sap.SapRFW; import com.op.system.api.domain.sap.SapRFW;
import com.op.system.api.domain.sap.SapShopOrderQuery; import com.op.system.api.domain.sap.SapShopOrderQuery;
@ -244,6 +245,8 @@ public class SapOrderServiceImpl implements SapOrderService {
@Override @Override
public R sapRFWOrder(SapRFW sapRFW) { public R sapRFWOrder(SapRFW sapRFW) {
String json= JSONObject.toJSONString(sapRFW);
System.out.println(json);
String MESSAGE=null; String MESSAGE=null;
try { try {
//获取连接 //获取连接
@ -300,10 +303,10 @@ public class SapOrderServiceImpl implements SapOrderService {
JCoParameterList J= func.getExportParameterList(); JCoParameterList J= func.getExportParameterList();
System.out.println(J); System.out.println(J);
MESSAGE= func.getExportParameterList().getString("MESSAGE"); MESSAGE= func.getExportParameterList().getString("MESSAGE");
if (StringUtils.isEmpty(MESSAGE)){ if (StringUtils.contains(MESSAGE,"错误")){
return R.fail("订单号:"+sapRFW.getAufnr()+"报工失败"); return R.fail("订单号:"+sapRFW.getAufnr()+"报工失败"+MESSAGE);
} }
return R.ok(MESSAGE); return R.ok("",MESSAGE);
}catch (Exception e){ }catch (Exception e){
return R.fail(e.getMessage()); return R.fail(e.getMessage());
@ -404,6 +407,8 @@ public class SapOrderServiceImpl implements SapOrderService {
return R.fail(e.getMessage()); return R.fail(e.getMessage());
} }
} }
} }

@ -2,6 +2,7 @@ package com.op.wms.controller;
import java.util.List; import java.util.List;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.op.wms.domain.WmsRawOrderInSn;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
@ -94,4 +95,50 @@ public class OdsProcureOrderController extends BaseController {
public AjaxResult remove(@PathVariable String[] IDs) { public AjaxResult remove(@PathVariable String[] IDs) {
return toAjax(odsProcureOrderService.deleteOdsProcureOrderByIDs(IDs)); return toAjax(odsProcureOrderService.deleteOdsProcureOrderByIDs(IDs));
} }
/**
*
*/
@PostMapping("/PurchaseOrderPda")
public AjaxResult PurchaseOrderPda(@RequestBody OdsProcureOrder odsProcureOrder) {
List<OdsProcureOrder> orderList =odsProcureOrderService.PurchaseOrderPda(odsProcureOrder);
return success(orderList);
}
//**
/**
*
* @param odsProcureOrder
* @return
*/
@PostMapping("/PurchaseOrderOutboundTask")
public AjaxResult PurchaseOrderOutboundTask(@RequestBody OdsProcureOrder odsProcureOrder) {
List<OdsProcureOrder> 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<WmsRawOrderInSn> wmsRawOrderInSns =odsProcureOrderService.PurchaseOrderdetailPda(wmsRawOrderInSn);
return success(wmsRawOrderInSns);
}
} }

@ -36,7 +36,7 @@ public class WmsOdsWhiteEmbryoInController extends BaseController {
/** /**
* *
*/ */
@RequiresPermissions("wms:wmsEmbryoin:list") // @RequiresPermissions("wms:wmsEmbryoin:list")
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo list(WmsOdsWhiteEmbryoIn wmsOdsWhiteEmbryoIn) { public TableDataInfo list(WmsOdsWhiteEmbryoIn wmsOdsWhiteEmbryoIn) {
startPage(); startPage();
@ -47,7 +47,7 @@ public class WmsOdsWhiteEmbryoInController extends BaseController {
/** /**
* *
*/ */
@RequiresPermissions("wms:wmsEmbryoin:export") //@RequiresPermissions("wms:wmsEmbryoin:export")
@Log(title = "白胚入库单", businessType = BusinessType.EXPORT) @Log(title = "白胚入库单", businessType = BusinessType.EXPORT)
@PostMapping("/export") @PostMapping("/export")
public void export(HttpServletResponse response, WmsOdsWhiteEmbryoIn wmsOdsWhiteEmbryoIn) { 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}") @GetMapping(value = "/{ID}")
public AjaxResult getInfo(@PathVariable("ID") String ID) { public AjaxResult getInfo(@PathVariable("ID") String ID) {
return success(wmsOdsWhiteEmbryoInService.selectWmsOdsWhiteEmbryoInByID(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) @Log(title = "白胚入库单", businessType = BusinessType.UPDATE)
@PutMapping @PutMapping
public AjaxResult edit(@RequestBody WmsOdsWhiteEmbryoIn wmsOdsWhiteEmbryoIn) { 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) @Log(title = "白胚入库单", businessType = BusinessType.DELETE)
@DeleteMapping("/{IDs}") @DeleteMapping("/{IDs}")
public AjaxResult remove(@PathVariable String[] IDs) { public AjaxResult remove(@PathVariable String[] IDs) {

@ -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);
}
}

@ -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<OdsProcureOrder> 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<WmsRawOrderInSn> wmsRawOrderInSns =odsProcureOrderService.PurchaseOrderdetailPda(wmsRawOrderInSn);
return success(wmsRawOrderInSns);
}
/**
*
* userDefined1;//备用1收货入库
*/
@PostMapping("/PurchaseOrderWarehousingPda")
public AjaxResult PurchaseOrderWarehousingPda(@RequestBody WmsRawOrderInSn wmsRawOrderInSn) {
List<WmsRawOrderInSn> 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();
}
}

@ -3,6 +3,7 @@ package com.op.wms.domain;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat; 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.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle; import org.apache.commons.lang3.builder.ToStringStyle;
import com.op.common.core.annotation.Excel; import com.op.common.core.annotation.Excel;
@ -14,15 +15,61 @@ import com.op.common.core.web.domain.BaseEntity;
* @author Open Platform * @author Open Platform
* @date 2023-07-06 * @date 2023-07-06
*/ */
@JsonInclude(JsonInclude.Include.NON_NULL)
public class OdsProcureOrder extends BaseEntity { public class OdsProcureOrder extends BaseEntity {
private static final long serialVersionUID = 1L; 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 = "工厂编码") @Excel(name = "工厂编码")
private String siteCode; private String siteCode;
/** 仓库编码--收货仓库 */
@Excel(name = "仓库编码")
private String whCode;
/** ID */ public String getWhCode() {
private String ID; 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 = "采购单号") @Excel(name = "采购单号")
@ -31,6 +78,17 @@ public class OdsProcureOrder extends BaseEntity {
/** 物料编码 */ /** 物料编码 */
@Excel(name = "物料编码") @Excel(name = "物料编码")
private String materialCode; private String materialCode;
/** 批次号 */
@Excel(name = "批次号")
private String incomeBatchNo;
public String getIncomeBatchNo() {
return incomeBatchNo;
}
public void setIncomeBatchNo(String incomeBatchNo) {
this.incomeBatchNo = incomeBatchNo;
}
/** 物料描述 */ /** 物料描述 */
@Excel(name = "物料描述") @Excel(name = "物料描述")

@ -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;
}
}

@ -3,6 +3,7 @@ package com.op.wms.domain;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat; 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.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle; import org.apache.commons.lang3.builder.ToStringStyle;
import com.op.common.core.annotation.Excel; import com.op.common.core.annotation.Excel;
@ -14,16 +15,29 @@ import com.op.common.core.web.domain.BaseEntity;
* @author Open Platform * @author Open Platform
* @date 2023-08-30 * @date 2023-08-30
*/ */
@JsonInclude(JsonInclude.Include.NON_NULL)
public class WmsRawOrderInSn extends BaseEntity { public class WmsRawOrderInSn extends BaseEntity {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** 唯一序列号 */ /** 唯一序列号 */
private Long rawOrderInSnId; private String rawOrderInSnId;
/** 仓库编码 */ /** 仓库编码--收货仓库 */
@Excel(name = "仓库编码") @Excel(name = "仓库编码")
private String whCode; private String whCode;
/** 批次号 */
@Excel(name = "批次号")
private String incomeBatchNo;
public String getIncomeBatchNo() {
return incomeBatchNo;
}
public void setIncomeBatchNo(String incomeBatchNo) {
this.incomeBatchNo = incomeBatchNo;
}
/** 库区编码 */ /** 库区编码 */
@Excel(name = "库区编码") @Excel(name = "库区编码")
private String waCode; private String waCode;
@ -52,7 +66,7 @@ public class WmsRawOrderInSn extends BaseEntity {
@Excel(name = "物料描述") @Excel(name = "物料描述")
private String materialDesc; private String materialDesc;
/** 托盘号 */ /** 托盘号--托盘号 */
@Excel(name = "托盘号") @Excel(name = "托盘号")
private String sn; private String sn;
@ -62,7 +76,7 @@ public class WmsRawOrderInSn extends BaseEntity {
/** 备用1 */ /** 备用1 */
@Excel(name = "备用1") @Excel(name = "备用1")
private String userDefined1; private String userDefined1;//备用1收货入库
/** 备用2 */ /** 备用2 */
@Excel(name = "备用2") @Excel(name = "备用2")
@ -118,7 +132,7 @@ public class WmsRawOrderInSn extends BaseEntity {
@Excel(name = "有效标记") @Excel(name = "有效标记")
private String activeFlag; private String activeFlag;
/** $column.columnComment */ /** $column.columnComment 工厂*/
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String factoryCode; private String factoryCode;
@ -126,11 +140,11 @@ public class WmsRawOrderInSn extends BaseEntity {
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String sapFactoryCode; private String sapFactoryCode;
public void setRawOrderInSnId(Long rawOrderInSnId) { public void setRawOrderInSnId(String rawOrderInSnId) {
this.rawOrderInSnId = rawOrderInSnId; this.rawOrderInSnId = rawOrderInSnId;
} }
public Long getRawOrderInSnId() { public String getRawOrderInSnId() {
return rawOrderInSnId; return rawOrderInSnId;
} }
public void setWhCode(String whCode) { public void setWhCode(String whCode) {

@ -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 List<OrderLine>orderLines;
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<OrderLine> getOrderLines() {
return orderLines;
}
public void setOrderLines(List<OrderLine> 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;
}
}

@ -58,4 +58,6 @@ public interface OdsProcureOrderMapper {
* @return * @return
*/ */
public int deleteOdsProcureOrderByIDs(String[] IDs); public int deleteOdsProcureOrderByIDs(String[] IDs);
Integer updateRealityNuById(OdsProcureOrder odsProcureOrder);
} }

@ -58,4 +58,6 @@ public interface WmsOdsEmStorageNewsMapper {
* @return * @return
*/ */
public int deleteWmsOdsEmStorageNewsByStorageIds(String[] storageIds); public int deleteWmsOdsEmStorageNewsByStorageIds(String[] storageIds);
void updateAdd(WmsOdsEmStorageNews wmsOdsEmStorageNews);
} }

@ -2,6 +2,7 @@ package com.op.wms.mapper;
import java.util.List; import java.util.List;
import com.op.wms.domain.WmsOdsEmStorageNews;
import com.op.wms.domain.WmsOdsMateStorageNews; import com.op.wms.domain.WmsOdsMateStorageNews;
/** /**
@ -58,4 +59,6 @@ public interface WmsOdsMateStorageNewsMapper {
* @return * @return
*/ */
public int deleteWmsOdsMateStorageNewsByStorageIds(String[] storageIds); public int deleteWmsOdsMateStorageNewsByStorageIds(String[] storageIds);
WmsOdsMateStorageNews selectByWhCodeAndMate(WmsOdsEmStorageNews wmsOdsEmStorageNews);
} }

@ -2,10 +2,11 @@ package com.op.wms.mapper;
import java.util.List; import java.util.List;
import com.op.wms.domain.WmsOdsEmStorageNews;
import com.op.wms.domain.WmsOdsMateStorageNewsSn; import com.op.wms.domain.WmsOdsMateStorageNewsSn;
/** /**
* Mapper * Mapper
* *
* @author Open Platform * @author Open Platform
* @date 2023-08-30 * @date 2023-08-30
@ -58,4 +59,8 @@ public interface WmsOdsMateStorageNewsSnMapper {
* @return * @return
*/ */
public int deleteWmsOdsMateStorageNewsSnByMateOrderInSnIds(Long[] mateOrderInSnIds); public int deleteWmsOdsMateStorageNewsSnByMateOrderInSnIds(Long[] mateOrderInSnIds);
void updateAdd(WmsOdsEmStorageNews wmsOdsEmStorageNews);
} }

@ -58,4 +58,8 @@ public interface WmsOdsWhiteEmbryoInMapper {
* @return * @return
*/ */
public int deleteWmsOdsWhiteEmbryoInByIDs(String[] IDs); public int deleteWmsOdsWhiteEmbryoInByIDs(String[] IDs);
WmsOdsWhiteEmbryoIn selectWmsOdsWhiteEmbryoInByWorkorderCode(String workorderCode);
void updateWmsOdsWhiteEmbryoInByOrderCode(WmsOdsWhiteEmbryoIn wmsOdsWhiteEmbryoIn);
} }

@ -3,6 +3,7 @@ package com.op.wms.mapper;
import java.util.List; import java.util.List;
import com.op.wms.domain.WmsRawOrderIn; import com.op.wms.domain.WmsRawOrderIn;
import com.op.wms.domain.WmsToWCSDTO;
/** /**
* Mapper * Mapper
@ -58,4 +59,6 @@ public interface WmsRawOrderInMapper {
* @return * @return
*/ */
public int deleteWmsRawOrderInByRawOrderInIds(String[] rawOrderInIds); public int deleteWmsRawOrderInByRawOrderInIds(String[] rawOrderInIds);
WmsToWCSDTO packagingStorage(WmsToWCSDTO wcsdto);
} }

@ -3,6 +3,7 @@ package com.op.wms.mapper;
import java.util.List; import java.util.List;
import com.op.wms.domain.WmsRawOrderInSn; import com.op.wms.domain.WmsRawOrderInSn;
import com.op.wms.domain.WmsToWCSDTO;
/** /**
* Mapper * Mapper
@ -58,4 +59,8 @@ public interface WmsRawOrderInSnMapper {
* @return * @return
*/ */
public int deleteWmsRawOrderInSnByRawOrderInSnIds(Long[] rawOrderInSnIds); public int deleteWmsRawOrderInSnByRawOrderInSnIds(Long[] rawOrderInSnIds);
WmsRawOrderInSn selectwmsRfidNo(WmsToWCSDTO wmsToWCSDTO);
void updateU1Byid(WmsRawOrderInSn wmsRawOrderInSn);
} }

@ -0,0 +1,7 @@
package com.op.wms.mapper;
import com.op.wms.domain.WmsToWCSDTO;
public interface WmsToWCSInterfaceMapper {
WmsToWCSDTO selectWmsToWCSDTO(WmsToWCSDTO wcsdto);
}

@ -2,6 +2,7 @@ package com.op.wms.service;
import java.util.List; import java.util.List;
import com.op.wms.domain.OdsProcureOrder; import com.op.wms.domain.OdsProcureOrder;
import com.op.wms.domain.WmsRawOrderInSn;
/** /**
* Service * Service
@ -57,4 +58,14 @@ public interface IOdsProcureOrderService {
* @return * @return
*/ */
public int deleteOdsProcureOrderByID(String ID); public int deleteOdsProcureOrderByID(String ID);
List<OdsProcureOrder> PurchaseOrderPda(OdsProcureOrder odsProcureOrder);
int PurchaseOrderdeliPda(OdsProcureOrder odsProcureOrder);
List<WmsRawOrderInSn> PurchaseOrderdetailPda(WmsRawOrderInSn wmsRawOrderInSn);
List<WmsRawOrderInSn> PurchaseOrderWarehousingPda(WmsRawOrderInSn wmsRawOrderInSn);
void PurchaseOrderRKPda(WmsRawOrderInSn wmsRawOrderInSn);
} }

@ -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);
}

@ -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);
}

@ -1,12 +1,19 @@
package com.op.wms.service.impl; package com.op.wms.service.impl;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List; import java.util.List;
import com.baomidou.dynamic.datasource.annotation.DS; 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.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.op.wms.mapper.OdsProcureOrderMapper; import com.op.wms.mapper.OdsProcureOrderMapper;
import com.op.wms.domain.OdsProcureOrder;
import com.op.wms.service.IOdsProcureOrderService; import com.op.wms.service.IOdsProcureOrderService;
/** /**
@ -19,6 +26,12 @@ import com.op.wms.service.IOdsProcureOrderService;
public class OdsProcureOrderServiceImpl implements IOdsProcureOrderService { public class OdsProcureOrderServiceImpl implements IOdsProcureOrderService {
@Autowired @Autowired
private OdsProcureOrderMapper odsProcureOrderMapper; 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) { public int deleteOdsProcureOrderByID(String ID) {
return odsProcureOrderMapper.deleteOdsProcureOrderByID(ID); return odsProcureOrderMapper.deleteOdsProcureOrderByID(ID);
} }
@Override
// @DS("#header.poolName")
public List<OdsProcureOrder> 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<WmsRawOrderInSn> PurchaseOrderdetailPda(WmsRawOrderInSn wmsRawOrderInSn) {
DynamicDataSourceContextHolder.push("ds_" + wmsRawOrderInSn.getFactoryCode());
wmsRawOrderInSn.setActiveFlag("1");
//u3备注
return wmsRawOrderInSnMapper.selectWmsRawOrderInSnList(wmsRawOrderInSn);
}
@Override
public List<WmsRawOrderInSn> 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过账后再解
}
} }

@ -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<OrderLine> 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;
}
}

@ -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;
}
}

@ -39,7 +39,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectOdsProcureOrderVo"> <sql id="selectOdsProcureOrderVo">
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
</sql> </sql>
<select id="selectOdsProcureOrderList" parameterType="OdsProcureOrder" resultMap="OdsProcureOrderResult"> <select id="selectOdsProcureOrderList" parameterType="OdsProcureOrder" resultMap="OdsProcureOrderResult">
@ -200,4 +200,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{ID} #{ID}
</foreach> </foreach>
</delete> </delete>
<update id="updateRealityNuById" parameterType="OdsProcureOrder">
update ods_procure_order
SET Reality_Number = COALESCE(Reality_Number, 0) + #{planNumber},
Order_Status=#{orderStatus}
where ID = #{ID}
</update>
</mapper> </mapper>

@ -210,4 +210,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{storageId} #{storageId}
</foreach> </foreach>
</delete> </delete>
<update id="updateAdd">
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}
</update>
</mapper> </mapper>

@ -210,4 +210,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{storageId} #{storageId}
</foreach> </foreach>
</delete> </delete>
<select id="selectByWhCodeAndMate">
</select>
</mapper> </mapper>

@ -187,4 +187,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{mateOrderInSnId} #{mateOrderInSnId}
</foreach> </foreach>
</delete> </delete>
<update id="updateAdd">
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}
</update>
<select id="selectByWhCodeAndMate">
<include refid="selectWmsOdsMateStorageNewsSnVo"/>
where mate_order_in_sn_id = #{mateOrderInSnId}
</select>
</mapper> </mapper>

@ -84,6 +84,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where> </where>
</select> </select>
<select id="selectWmsOdsWhiteEmbryoInByWorkorderCode" parameterType="String" resultMap="WmsOdsWhiteEmbryoInResult">
<include refid="selectWmsOdsWhiteEmbryoInVo"/>
where Order_Code = #{workorderCode}
</select>
<select id="selectWmsOdsWhiteEmbryoInByID" parameterType="String" resultMap="WmsOdsWhiteEmbryoInResult"> <select id="selectWmsOdsWhiteEmbryoInByID" parameterType="String" resultMap="WmsOdsWhiteEmbryoInResult">
<include refid="selectWmsOdsWhiteEmbryoInVo"/> <include refid="selectWmsOdsWhiteEmbryoInVo"/>
where ID = #{ID} where ID = #{ID}
@ -215,4 +223,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{ID} #{ID}
</foreach> </foreach>
</delete> </delete>
<update id="updateWmsOdsWhiteEmbryoInByOrderCode">
update wms_ods_white_embryo_in
set
Order_Status = #{orderStatus},
Reality_Number=#{realityNumber},
Last_Update_Date = now()
where Order_Code=#{orderCode}
</update>
</mapper> </mapper>

@ -304,4 +304,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{rawOrderInId} #{rawOrderInId}
</foreach> </foreach>
</delete> </delete>
<select id="packagingStorage" resultType="com.op.wms.domain.WmsToWCSDTO">
SELECT
material_code as sku,
sn as rfidNo,
amount as qty,
user_defined1 as qualityStatus
FROM
[dbo].[wms_raw_order_in_sn]
where
sn=#{rfidNo}
and user_defined1 = '1'
</select>
</mapper> </mapper>

@ -42,6 +42,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectWmsRawOrderInSnList" parameterType="WmsRawOrderInSn" resultMap="WmsRawOrderInSnResult"> <select id="selectWmsRawOrderInSnList" parameterType="WmsRawOrderInSn" resultMap="WmsRawOrderInSnResult">
<include refid="selectWmsRawOrderInSnVo"/> <include refid="selectWmsRawOrderInSnVo"/>
<where> <where>
<if test="rawOrderInSnId != null and rawOrderInSnId != ''"> and raw_order_in_sn_id = #{rawOrderInSnId}</if>
<if test="whCode != null and whCode != ''"> and wh_code = #{whCode}</if> <if test="whCode != null and whCode != ''"> and wh_code = #{whCode}</if>
<if test="waCode != null and waCode != ''"> and wa_code = #{waCode}</if> <if test="waCode != null and waCode != ''"> and wa_code = #{waCode}</if>
<if test="wlCode != null and wlCode != ''"> and wl_code = #{wlCode}</if> <if test="wlCode != null and wlCode != ''"> and wl_code = #{wlCode}</if>
@ -79,6 +80,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<insert id="insertWmsRawOrderInSn" parameterType="WmsRawOrderInSn" useGeneratedKeys="true" keyProperty="rawOrderInSnId"> <insert id="insertWmsRawOrderInSn" parameterType="WmsRawOrderInSn" useGeneratedKeys="true" keyProperty="rawOrderInSnId">
insert into wms_raw_order_in_sn insert into wms_raw_order_in_sn
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="whCode != null">raw_order_in_sn_id,</if>
<if test="whCode != null">wh_code,</if> <if test="whCode != null">wh_code,</if>
<if test="waCode != null">wa_code,</if> <if test="waCode != null">wa_code,</if>
<if test="wlCode != null">wl_code,</if> <if test="wlCode != null">wl_code,</if>
@ -108,6 +110,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="sapFactoryCode != null">sap_factory_code,</if> <if test="sapFactoryCode != null">sap_factory_code,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="whCode != null">#{rawOrderInSnId},</if>
<if test="whCode != null">#{whCode},</if> <if test="whCode != null">#{whCode},</if>
<if test="waCode != null">#{waCode},</if> <if test="waCode != null">#{waCode},</if>
<if test="wlCode != null">#{wlCode},</if> <if test="wlCode != null">#{wlCode},</if>
@ -182,4 +185,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{rawOrderInSnId} #{rawOrderInSnId}
</foreach> </foreach>
</delete> </delete>
<select id="selectwmsRfidNo" parameterType="com.op.wms.domain.WmsToWCSDTO" resultMap="WmsRawOrderInSnResult">
<include refid="selectWmsRawOrderInSnVo"/>
where
sn=#{rfidNo}
and
user_defined1='1'
</select>
<update id="updateU1Byid">
update wms_raw_order_in_sn
set
user_defined1 = '2'
where raw_order_in_sn_id=#{rawOrderInSnId}
</update>
</mapper> </mapper>
Loading…
Cancel
Save