Compare commits

...

10 Commits

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

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

@ -187,6 +187,28 @@ public class EquUpkeepServiceImpl implements IEquUpkeepService {
EquPlanDetail detail = new EquPlanDetail();
BeanUtils.copyProperties(checkItem,detail);
if (!detail.getItemCode().isEmpty()) {
itemTempName.append(detail.getItemName()).append(",");
// 获取检查项详情list
List<EquCheckItemDetail> equCheckItemDetailList = equCheckItemDetailMapper.selectCheckItemDetailByItemCode(detail.getItemCode());
if (equCheckItemList.size() > 0) {
List<EquPlanStandard> standardList = new ArrayList<>();
for (EquCheckItemDetail standardTemp : equCheckItemDetailList) {
EquPlanStandard standard = new EquPlanStandard();
BeanUtils.copyProperties(standardTemp,standard);
standard.setShowFlag(true);
standardList.add(standard);
}
detail.setEquPlanStandardList(standardList);
}
}
detailList.add(detail);
}
if (data.getItemLoop() == 0) {
EquPlanDetail detail = new EquPlanDetail();
BeanUtils.copyProperties(checkItem,detail);
if (!detail.getItemCode().isEmpty()) {
itemTempName.append(detail.getItemName()).append(",");
// 获取检查项详情list

@ -113,13 +113,14 @@
<if test="itemTools != null">#{itemTools},</if>
</trim>
</insert>
<insert id="insertEquOrderDetails">
insert into equ_order_detail
(
id, order_code,
item_code, item_name, item_method,
item_type, item_type_name, factory_code, del_flag,
create_by, create_time,item_tools
create_by, create_time
)
VALUES
<foreach collection="list" index="index" item="item" separator=",">
@ -127,7 +128,7 @@
#{item.id},#{item.parentCode},
#{item.itemCode},#{item.itemName},#{item.itemMethod},
#{item.itemType},#{item.itemTypeName},#{item.factoryCode},#{item.delFlag},
#{item.createBy},#{item.createTime},#{itemTools}
#{item.createBy},#{item.createTime}
)
</foreach>

@ -298,7 +298,7 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService {
SapRFW sapRFW = new SapRFW();
sapRFW.setAufnr(work.getWorkorderCodeSap());//虚拟工单号
sapRFW.setGamng(work.getQuantityFeedback().toString());//报工数量
SapRFW.lt_gs ltgs = sapRFW.new lt_gs();//生产订单报工工时修改
SapRFW.lt_gs ltgs = sapRFW.getLt_gs();//生产订单报工工时修改
ltgs.setConf_activity1(work.getSac1());//人工
ltgs.setConf_activity2(work.getSac2());
ltgs.setConf_activity3(work.getSac3());//机器

@ -168,7 +168,7 @@ public class OpenServiceImpl implements OpenService {
SapRFW sapRFW = new SapRFW();
sapRFW.setAufnr(work.getWorkorderCodeSap());//虚拟工单号
sapRFW.setGamng(work.getQuantityFeedback().toString());//报工数量
SapRFW.lt_gs ltgs = sapRFW.new lt_gs();//生产订单报工工时修改
SapRFW.lt_gs ltgs = sapRFW.getLt_gs();//生产订单报工工时修改
ltgs.setConf_activity1(work.getSac1());//人工
ltgs.setConf_activity2(work.getSac2());
ltgs.setConf_activity3(work.getSac3());//机器
@ -213,7 +213,6 @@ public class OpenServiceImpl implements OpenService {
if(proResult.getQuantityFeedback().compareTo(work.getQuantitySplit())>=0||"1".equals(work.getEndReport())//最终报工标识
){
logger.info("工单请求关闭调用remoteSapService.sapCloseOrder,参数:"+work.getWorkorderCodeSap());
//工单完成,关闭母工单
List<String> sapWorkOrders = openMapper.getSapWorkOrder(work.getWorkorderCode());//根据belong_work_order找到所有要关闭的虚拟工单
//关闭母子订单//订单的订单编码

@ -52,27 +52,8 @@ public class SapController extends BaseController {
@Autowired
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
@ -113,7 +94,7 @@ public class SapController extends BaseController {
}
/**
*
* BOM
* @return
*/
@PostMapping("/bomSync")
@ -151,7 +132,6 @@ public class SapController extends BaseController {
}
/**
* 线
* @return
@ -176,7 +156,7 @@ public class SapController extends BaseController {
calendar.setTime(maxTime0);
calendar.add(Calendar.DAY_OF_YEAR, 1);
Date maxTime = calendar.getTime();
// qo.setAedat(DateFormatUtils.format(maxTime, "yyyyMMdd"));//修改日期20230923
// qo.setAedat(DateFormatUtils.format(maxTime, "yyyyMMdd"));//修改日期20230923
}
qo.setWerks(dateSource.get("poolName").replace("ds_", ""));//工厂
@ -190,74 +170,6 @@ public class SapController extends BaseController {
return R.ok();
}
/**
*
* @param shopOrder
* @return
*/
@PostMapping("/materialPreparation")
@Log(title = "生产订单备料单接口", businessType = BusinessType.SAP)
public R<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
@ -382,6 +294,98 @@ 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);
}
/**
*
*/

@ -8,11 +8,125 @@ public class SapPurchaseOrderQuery {
* S_MATNR
* S_PWERK
*/
/**
* EBELN
* EBELP
* MATNR
* MAKTX
* MENGE
* MEINS
* ZMENGE
* ZMEINS
* LIFNR
* WERKS
* LGORT
* EINDT
* ELIKZ
* BEIZHU
*/
private String ebeln;
private String ebelp;
private String matnr;
private String pwerk;
private String maktx;
private String menge;
private String meins;
private String zmenge;
private String zmeins;
private String lifnr;
private String werks;
private String lgort;
private String eindt;
private String elikz;
private String beizhu;
public String getMaktx() {
return maktx;
}
public void setMaktx(String maktx) {
this.maktx = maktx;
}
public String getMenge() {
return menge;
}
public void setMenge(String menge) {
this.menge = menge;
}
public String getMeins() {
return meins;
}
public void setMeins(String meins) {
this.meins = meins;
}
public String getZmenge() {
return zmenge;
}
public void setZmenge(String zmenge) {
this.zmenge = zmenge;
}
public String getZmeins() {
return zmeins;
}
public void setZmeins(String zmeins) {
this.zmeins = zmeins;
}
public String getLifnr() {
return lifnr;
}
public void setLifnr(String lifnr) {
this.lifnr = lifnr;
}
public String getWerks() {
return werks;
}
public void setWerks(String werks) {
this.werks = werks;
}
public String getLgort() {
return lgort;
}
public void setLgort(String lgort) {
this.lgort = lgort;
}
public String getEindt() {
return eindt;
}
public void setEindt(String eindt) {
this.eindt = eindt;
}
public String getElikz() {
return elikz;
}
public void setElikz(String elikz) {
this.elikz = elikz;
}
public String getBeizhu() {
return beizhu;
}
public void setBeizhu(String beizhu) {
this.beizhu = beizhu;
}
public String getEbeln() {
return ebeln;

@ -1,5 +1,6 @@
package com.op.sap.service.impl;
import com.alibaba.fastjson2.JSONObject;
import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
import com.op.common.core.constant.Constants;
import com.op.common.core.domain.R;
@ -54,6 +55,7 @@ public class SapItemSyncImpl implements SapItemSyncService {
// 获取调用 RFC 函数对象
//获取连接
// JCoDestination dest = SAPConnUtils.connect();
log.info("物料基础数据同步输入参数---------"+JSONObject.toJSONString(sapItemQuery));
JCoRepository repository = dest.getRepository();
JCoFunction func = repository.getFunction("ZMMR_MES_MAT_GET");
@ -104,7 +106,7 @@ public class SapItemSyncImpl implements SapItemSyncService {
// 获取 内表 - ZMES_PRO
JCoTable maraTable = func.getTableParameterList().getTable("LT_MARA");
JCoRecordMetaData metaData = maraTable.getRecordMetaData();
System.out.println("###" + metaData.toString());
// System.out.println("###" + metaData.toString());
// 加载数据源
DynamicDataSourceContextHolder.push("ds_1000");
List<SapBaseProduct> sapBaseProductList=new ArrayList<>();
@ -143,35 +145,64 @@ public class SapItemSyncImpl implements SapItemSyncService {
String MVGR5_NM = maraTable.getString("MVGR5_NM");
String LAEDA = maraTable.getString("LAEDA");
String ERSDA = maraTable.getString("LAEDA");
System.out.println(
log.info("物料基础数据同步数据输出----"+
"物料号:" + MATNR+
"物料描述(短文本):" + MAKTX+
"国际文件号(EAN/UPC)" + EAN11+
"物料类型:" + MTART+
"物料类型描述:" + MTBEZ+
"物料组:" + MATKL+
"物料组描述:" + WGBEZ+
"毛重:" + BRGEW+
"净重:" + NTGEW+
"体积:" + VOLUM+
"体积单位:" + VOLEH+
"基本计量单位:" + MEINS+
"帐面库存单位的可选计量单位 " + MEINH+
"基本计量单位转换分子:" + UMREZ+
"转换为基本计量单位的分母:" + UMREN+
"在客户级标记要删除的物料:" + LVORM+
"数量:" + MENGE+
"总货架寿命 " + MHDHB+
"产品组:" + SPART+
"产品组描述:" + SPART_NM+
"物料组1" + MVGR1+
"物料组1描述" + MVGR1_NM+
"物料组2" + MVGR2+
"物料组2描述" + MVGR2_NM+
" 物料组3" + MVGR3+
" 物料组描述 " + MVGR3_NM+
"创建日期:"+ERSDA+
"物料描述(短文本):" + MAKTX+
"国际文件号(EAN/UPC)" + EAN11+
"物料类型:" + MTART+
"物料类型描述:" + MTBEZ+
"物料组:" + MATKL+
"物料组描述:" + WGBEZ+
"毛重:" + BRGEW+
"净重:" + NTGEW+
"体积:" + VOLUM+
"体积单位:" + VOLEH+
"基本计量单位:" + MEINS+
"帐面库存单位的可选计量单位 " + MEINH+
"基本计量单位转换分子:" + UMREZ+
"转换为基本计量单位的分母:" + UMREN+
"在客户级标记要删除的物料:" + LVORM+
"数量:" + MENGE+
"总货架寿命 " + MHDHB+
"产品组:" + SPART+
"产品组描述:" + SPART_NM+
"物料组1" + MVGR1+
"物料组1描述" + MVGR1_NM+
"物料组2" + MVGR2+
"物料组2描述" + MVGR2_NM+
" 物料组3" + MVGR3+
" 物料组描述 " + MVGR3_NM+
"创建日期:"+ERSDA+
"上次更改日期:"+LAEDA);
// System.out.println(
// "物料号:" + MATNR+
// "物料描述(短文本):" + MAKTX+
// "国际文件号(EAN/UPC)" + EAN11+
// "物料类型:" + MTART+
// "物料类型描述:" + MTBEZ+
// "物料组:" + MATKL+
// "物料组描述:" + WGBEZ+
// "毛重:" + BRGEW+
// "净重:" + NTGEW+
// "体积:" + VOLUM+
// "体积单位:" + VOLEH+
// "基本计量单位:" + MEINS+
// "帐面库存单位的可选计量单位 " + MEINH+
// "基本计量单位转换分子:" + UMREZ+
// "转换为基本计量单位的分母:" + UMREN+
// "在客户级标记要删除的物料:" + LVORM+
// "数量:" + MENGE+
// "总货架寿命 " + MHDHB+
// "产品组:" + SPART+
// "产品组描述:" + SPART_NM+
// "物料组1" + MVGR1+
// "物料组1描述" + MVGR1_NM+
// "物料组2" + MVGR2+
// "物料组2描述" + MVGR2_NM+
// " 物料组3" + MVGR3+
// " 物料组描述 " + MVGR3_NM+
// "创建日期:"+ERSDA+
// "上次更改日期:"+LAEDA);
baseProduct.setProductCode(MATNR);
baseProduct.setProductDescZh(MAKTX);
baseProduct.setProductGroup(MATKL);
@ -314,7 +345,7 @@ public class SapItemSyncImpl implements SapItemSyncService {
// int failureNum = 0;
// StringBuilder successMsg = new StringBuilder();
// StringBuilder failureMsg = new StringBuilder();
// log.info("反冲物料开始过账----------------------------------------");
log.info("反冲物料开始过账----------------------------------------");
// for (int i = 0; i < sapBackflushMPQueryList.size(); i++) {
// L_ITEM.setRow(i);
@ -340,6 +371,26 @@ public class SapItemSyncImpl implements SapItemSyncService {
L_ITEM.setValue("MOVE_BATCH",sfp.getMove_batch());
}
func.execute(dest);
JCoTable maraTable = func.getTableParameterList().getTable("LT_RETURN");
JCoRecordMetaData metaData = maraTable.getRecordMetaData();
System.out.println("###" + metaData.toString());
for (int i = 0; i < maraTable.getNumRows(); i++) {
maraTable.setRow(i);
String TYPE = maraTable.getString("TYPE");
System.out.println(TYPE);
}
String L_MSG= func.getExportParameterList().getString("L_MSG");
String RETCODE= func.getExportParameterList().getString("RETCODE");
String MATERIALDOCUMENT= func.getExportParameterList().getString("MATERIALDOCUMENT");
String MATDOCUMENTYEAR= func.getExportParameterList().getString("MATDOCUMENTYEAR");
System.out.println(L_MSG);
System.out.println(RETCODE);
System.out.println(MATERIALDOCUMENT);
System.out.println(MATDOCUMENTYEAR);
return R.ok();
}catch (Exception e){

@ -8,6 +8,8 @@ import com.op.sap.service.SapMaterialPreparationService;
import com.op.sap.util.SAPConnUtils;
import com.op.system.api.domain.sap.SapMaterialPreparation;
import com.sap.conn.jco.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
@ -18,7 +20,7 @@ import java.util.List;
@Component
@Service
public class SapMaterialPreparationServiceImpl implements SapMaterialPreparationService {
private static final Logger log = LoggerFactory.getLogger(SapMaterialPreparationServiceImpl.class);
@Autowired
SapMaterialPreparationMapper sapMaterialPreparationMapper;
@ -33,6 +35,7 @@ public class SapMaterialPreparationServiceImpl implements SapMaterialPreparation
// 获取调用 RFC 函数对象
//获取连接
// JCoDestination dest = SAPConnUtils.connect();
log.info("备料单入参-----"+shopOrder);
JCoRepository repository = dest.getRepository();
JCoFunction func = repository.getFunction("ZPPR_MES_MATERIAL_PREPARATION");
if (func == null) {
@ -48,7 +51,7 @@ public class SapMaterialPreparationServiceImpl implements SapMaterialPreparation
// 获取 内表 - ZMES_PRO
JCoTable maraTable = func.getTableParameterList().getTable("LT_MAPRE");
JCoRecordMetaData metaData = maraTable.getRecordMetaData();
System.out.println("###" + metaData.toString());
//System.out.println("###" + metaData.toString());
List<SapMaterialPreparation> sapMaterialPreparationList =new ArrayList<>();
// 循环输出 Table 数据
@ -66,7 +69,7 @@ public class SapMaterialPreparationServiceImpl implements SapMaterialPreparation
String MEINS = maraTable.getString("MEINS");
String RGEKZ = maraTable.getString("RGEKZ");
String DBSKZ = maraTable.getString("DBSKZ");
System.out.println("订单号:" + AUFNR
log.info( "备料单输出------"+ "订单号:" + AUFNR
+ " - 预留/相关需求的项目编号:" + RSPOS +
" - 物料号:" + MATNR +
" - 物料描述(短文本):" + MAKTX +
@ -78,6 +81,18 @@ public class SapMaterialPreparationServiceImpl implements SapMaterialPreparation
" - 基本计量单位:" + MEINS +
" - 标识:反冲:" + RGEKZ +
" - 直接采购标识:" + DBSKZ );
// System.out.println("订单号:" + AUFNR
// + " - 预留/相关需求的项目编号:" + RSPOS +
// " - 物料号:" + MATNR +
// " - 物料描述(短文本):" + MAKTX +
// " - 工厂:" + WERKS +
// " - 库存地点:" + LGORT +
// " - 组件的需求日期 " + BDTER +
// " - 需求量:" + BDMNG +
// " - 欠料数量:" + ZQLSL +
// " - 基本计量单位:" + MEINS +
// " - 标识:反冲:" + RGEKZ +
// " - 直接采购标识:" + DBSKZ );
SapMaterialPreparation sapMaterialPreparation = new SapMaterialPreparation();
sapMaterialPreparation.setAUFNR(AUFNR);
sapMaterialPreparation.setBDMNG(BDMNG);
@ -93,8 +108,10 @@ public class SapMaterialPreparationServiceImpl implements SapMaterialPreparation
sapMaterialPreparation.setZQLSL(ZQLSL);
sapMaterialPreparationList.add(sapMaterialPreparation);
}
return R.ok(sapMaterialPreparationList);
String MSG= func.getExportParameterList().getString("MSG");
return R.ok(sapMaterialPreparationList,MSG);
} catch (Exception e) {
log.error("同步领料单报错-----"+e.getMessage());
return R.fail(e.getMessage());
}
}

@ -1,5 +1,6 @@
package com.op.sap.service.impl;
import com.alibaba.fastjson2.JSONObject;
import com.op.common.core.constant.Constants;
import com.op.common.core.domain.R;
import com.op.common.core.utils.DateUtils;
@ -17,6 +18,8 @@ import com.op.system.api.domain.sap.SapShopOrderQuery;
import com.op.system.api.model.SapProOrder;
import com.sap.conn.jco.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
@ -30,7 +33,7 @@ import java.util.Map;
@Component
@Service
public class SapOrderServiceImpl implements SapOrderService {
private static final Logger log = LoggerFactory.getLogger(SapOrderServiceImpl.class);
private static final String END_DATE="99991231";
@Autowired
private JCoDestination dest;
@ -42,6 +45,7 @@ public class SapOrderServiceImpl implements SapOrderService {
// 获取调用 RFC 函数对象
//获取连接
//JCoDestination dest = SAPConnUtils.connect();
log.info("订单同步入参-----"+sapShopOrderQuery.toString());
JCoRepository repository = dest.getRepository();
JCoFunction func = repository.getFunction("ZPPR_MES_PRO_TO");
if (func == null) {
@ -50,8 +54,8 @@ public class SapOrderServiceImpl implements SapOrderService {
JCoParameterList jCoParameterList= func.getTableParameterList();
JCoParameterList js= func.getExportParameterList();
System.out.println(js);
System.out.println(jCoParameterList);
// System.out.println(js);
// System.out.println(jCoParameterList);
// 配置传入参数
// S_WERKS(工厂) S_AUFNR订单号 S_MATNR物料号 S_ERDAT(创建日期) 例如20230923
@ -94,7 +98,7 @@ public class SapOrderServiceImpl implements SapOrderService {
// 获取 内表 - ZMES_PRO
JCoTable maraTable = func.getTableParameterList().getTable("ZMES_PRO");
JCoRecordMetaData metaData = maraTable.getRecordMetaData();
System.out.println("###" + metaData.toString());
// System.out.println("###" + metaData.toString());
List<SapProOrder> proOrderList = new ArrayList<>();
// 循环输出 Table 数据
@ -114,9 +118,12 @@ public class SapOrderServiceImpl implements SapOrderService {
String ERNAM = maraTable.getString("ERNAM");
String ERDAT = maraTable.getString("ERDAT");
String STTXT = maraTable.getString("STTXT");
System.out.println("订单号:" + AUFNR + " - 订单类型:" + AUART + " - 上级订单编号:" + MAUFNR + " - 物料号:" + PLNBEZ + " - 物料描述(短文本):" + MAKTX
log.info("订单输出------"+"订单号:" + AUFNR + " - 订单类型:" + AUART + " - 上级订单编号:" + MAUFNR + " - 物料号:" + PLNBEZ + " - 物料描述(短文本):" + MAKTX
+ " - 订单的计划工厂:" + PWERK + " - 订单数量总计:" + GAMNG + " - 基本计量单位:" + GMEIN + " - 任务清单组码:" + PLNNR + " - 基本开始日期:" + GSTRP
+ " - 基本完成日期:" + GLTRP + " - 输入者:" + ERNAM + " - 创建日期:" + ERDAT + " - 系统状态:" + STTXT);
// System.out.println("订单号:" + AUFNR + " - 订单类型:" + AUART + " - 上级订单编号:" + MAUFNR + " - 物料号:" + PLNBEZ + " - 物料描述(短文本):" + MAKTX
// + " - 订单的计划工厂:" + PWERK + " - 订单数量总计:" + GAMNG + " - 基本计量单位:" + GMEIN + " - 任务清单组码:" + PLNNR + " - 基本开始日期:" + GSTRP
// + " - 基本完成日期:" + GLTRP + " - 输入者:" + ERNAM + " - 创建日期:" + ERDAT + " - 系统状态:" + STTXT);
SapProOrder proOrder = new SapProOrder();
proOrder.setId(IdUtils.fastSimpleUUID());
proOrder.setPlanFactoryCode(PWERK);
@ -144,7 +151,7 @@ public class SapOrderServiceImpl implements SapOrderService {
return R.ok(proOrderList);
} catch (Exception e) {
System.out.println(e.getMessage());
return R.fail(e.getMessage());
}
}
@ -155,6 +162,7 @@ public class SapOrderServiceImpl implements SapOrderService {
try {
//获取连接
// JCoDestination dest = SAPConnUtils.connect();
log.info("订单创建入参-----"+JSONObject.toJSONString(sapCreateOrderList));
JCoRepository repository = dest.getRepository();
JCoFunction func = repository.getFunction("ZPPR_MES_PRODORD_CREATE");
if (func == null) {
@ -175,12 +183,12 @@ public class SapOrderServiceImpl implements SapOrderService {
jCoParameterList.setValue("P_DATEE",sapCreateOrder.getDatee());
func.execute(dest);//执行调用函数
JCoParameterList J= func.getExportParameterList();
System.out.println(J);
// System.out.println(J);
L_MSG= func.getExportParameterList().getString("L_MSG");
String LV_ORDER_NUMBER= func.getExportParameterList().getString("LV_ORDER_NUMBER");
JCoTable LT_ZGD=func.getTableParameterList().getTable("LT_ZGD");
System.out.println(LT_ZGD);
// System.out.println(LT_ZGD);
//DynamicDataSourceContextHolder.push("ds_1000");//controller已经完成切换
for (int i = 0; i <LT_ZGD.getNumRows(); i++) {
LT_ZGD.setRow(i);
@ -192,11 +200,14 @@ public class SapOrderServiceImpl implements SapOrderService {
LV_ORDER_NUM_List.add(map);
}
}
log.info("订单创建结果----"+L_MSG+"|"+JSONObject.toJSONString(LV_ORDER_NUM_List));
return R.ok(LV_ORDER_NUM_List,L_MSG);
}else {
log.error("接收的数据为空");
return R.fail("接收的数据为空");
}
}catch (Exception e){
log.error(L_MSG+e.getMessage());
return R.fail(L_MSG);
}
@ -209,6 +220,7 @@ public class SapOrderServiceImpl implements SapOrderService {
try {
//获取连接
// JCoDestination dest = SAPConnUtils.connect();
log.info("订单关闭入参------"+sapCloseOrderQuery.toString());
JCoRepository repository = dest.getRepository();
JCoFunction func = repository.getFunction("ZPPR_MES_PRODORD_CLOSE");
if (func == null) {
@ -236,14 +248,18 @@ public class SapOrderServiceImpl implements SapOrderService {
func.execute(dest);//执行调用函数
String L_MSG2= func.getExportParameterList().getString("L_MSG");
Msg.append(sapCloseOrderQuery.getOrder()+L_MSG2);
log.info("订单关闭结果"+Msg.toString());
return R.ok(null,Msg.toString());
}catch (Exception e){
log.error("订单关闭失败"+e.getMessage());
return R.fail(e.getMessage());
}
}
@Override
public R sapRFWOrder(SapRFW sapRFW) {
String json= JSONObject.toJSONString(sapRFW);
System.out.println(json);
String MESSAGE=null;
try {
//获取连接
@ -300,10 +316,10 @@ public class SapOrderServiceImpl implements SapOrderService {
JCoParameterList J= func.getExportParameterList();
System.out.println(J);
MESSAGE= func.getExportParameterList().getString("MESSAGE");
if (StringUtils.isEmpty(MESSAGE)){
return R.fail("订单号:"+sapRFW.getAufnr()+"报工失败");
if (StringUtils.contains(MESSAGE,"错误")){
return R.fail("订单号:"+sapRFW.getAufnr()+"报工失败"+MESSAGE);
}
return R.ok(MESSAGE);
return R.ok("",MESSAGE);
}catch (Exception e){
return R.fail(e.getMessage());
@ -335,12 +351,12 @@ public class SapOrderServiceImpl implements SapOrderService {
S_EBELN.setValue(Constants.OPTION, "EQ");
S_EBELN.setValue(Constants.LOW, sapPurchaseOrderQuery.getEbeln());
}
if (!StringUtils.isNull(sapPurchaseOrderQuery.getEbeln())){
JCoTable S_EBELN = func.getTableParameterList().getTable("S_EBELP");
S_EBELN.appendRow();
S_EBELN.setValue(Constants.SIGN, "I");
S_EBELN.setValue(Constants.OPTION, "EQ");
S_EBELN.setValue(Constants.LOW, sapPurchaseOrderQuery.getEbeln());
if (!StringUtils.isNull(sapPurchaseOrderQuery.getEbelp())){
JCoTable S_EBELP = func.getTableParameterList().getTable("S_EBELP");
S_EBELP.appendRow();
S_EBELP.setValue(Constants.SIGN, "I");
S_EBELP.setValue(Constants.OPTION, "EQ");
S_EBELP.setValue(Constants.LOW, sapPurchaseOrderQuery.getEbelp());
}
if (!StringUtils.isNull(sapPurchaseOrderQuery.getMatnr())){
JCoTable S_MATNR = func.getTableParameterList().getTable("S_MATNR");
@ -362,7 +378,57 @@ public class SapOrderServiceImpl implements SapOrderService {
JCoTable maraTable = func.getTableParameterList().getTable("LT_PROCURE");
JCoRecordMetaData metaData = maraTable.getRecordMetaData();
System.out.println("###" + metaData.toString());
return R.ok();
List<SapPurchaseOrderQuery> sapPurchaseOrderQueryList=new ArrayList<>();
for (int i = 0; i < maraTable.getNumRows(); i++) {
maraTable.setRow(i);
SapPurchaseOrderQuery sapPCorder=new SapPurchaseOrderQuery();
String EBELN = maraTable.getString("EBELN");
String EBELP = maraTable.getString("EBELP");
String MATNR = maraTable.getString("MATNR");
String MAKTX = maraTable.getString("MAKTX");
String MENGE = maraTable.getString("MENGE");
String MEINS = maraTable.getString("MEINS");
String ZMENGE = maraTable.getString("ZMENGE");
String ZMEINS = maraTable.getString("ZMEINS");
String LIFNR = maraTable.getString("LIFNR");
String WERKS = maraTable.getString("WERKS");
String LGORT = maraTable.getString("LGORT");
String EINDT = maraTable.getString("EINDT");
String ELIKZ = maraTable.getString("ELIKZ");
String BEIZHU = maraTable.getString("BEIZHU");
System.out.println(
"采购凭证号"+EBELN+
"采购凭证的项目编号"+EBELP+
"物料号"+MATNR+
"物料描述(短文本)"+MAKTX+
"采购订单数量"+MENGE+
"采购订单的计量单位"+MEINS+
"交货数量"+ZMENGE+
"基本计量单位"+ZMEINS+
"供应商帐户号"+LIFNR+
"工厂"+WERKS+
"库存地点"+LGORT+
"项目交货日期"+EINDT+
"交货已完成标识"+ELIKZ+
"注释"+BEIZHU);
sapPCorder.setEbeln(EBELN);
sapPCorder.setEbelp(EBELP);
sapPCorder.setMatnr(MATNR);
sapPCorder.setMaktx(MAKTX);
sapPCorder.setMenge(MENGE);
sapPCorder.setMeins(MEINS);
sapPCorder.setZmenge(ZMENGE);
sapPCorder.setZmeins(ZMEINS);
sapPCorder.setLifnr(LIFNR);
sapPCorder.setWerks(WERKS);
sapPCorder.setLgort(LGORT);
sapPCorder.setEindt(EINDT);
sapPCorder.setElikz(ELIKZ);
sapPCorder.setBeizhu(BEIZHU);
sapPurchaseOrderQueryList.add(sapPCorder);
}
return R.ok(sapPurchaseOrderQueryList);
}catch (Exception e){
return R.fail(e.getMessage());
}
@ -372,6 +438,7 @@ public class SapOrderServiceImpl implements SapOrderService {
@Override
public R shopUpdateSync(SapShopOrderQuery sapProOrder) {
try {
log.info("订单修改入参-------"+sapProOrder.toString());
JCoRepository repository = dest.getRepository();
JCoFunction func = repository.getFunction("ZPPR_MES_PRODORD_CHANGE");
// 配置传入参数
@ -396,14 +463,19 @@ public class SapOrderServiceImpl implements SapOrderService {
String RETCODE= func.getExportParameterList().getString("RETCODE");
String MESSAGE= func.getExportParameterList().getString("MESSAGE");
if ((Constants.FAIL).equals(Integer.parseInt(RETCODE))){
log.error("订单修改结果-----"+MESSAGE);
return R.fail(null,"订单号:"+sapProOrder.getAufnr()+MESSAGE);
}else {
log.info("订单修改结果-----"+MESSAGE);
return R.ok(null,"订单号:"+sapProOrder.getAufnr()+MESSAGE);
}
}catch (Exception e){
log.error(e.getMessage());
return R.fail(e.getMessage());
}
}
}

@ -2,6 +2,7 @@ package com.op.wms.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.op.wms.domain.WmsRawOrderInSn;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
@ -23,7 +24,7 @@ import com.op.common.core.web.page.TableDataInfo;
/**
* Controller
*
*
* @author Open Platform
* @date 2023-07-06
*/
@ -94,4 +95,50 @@ public class OdsProcureOrderController extends BaseController {
public AjaxResult remove(@PathVariable String[] IDs) {
return toAjax(odsProcureOrderService.deleteOdsProcureOrderByIDs(IDs));
}
/**
*
*/
@PostMapping("/PurchaseOrderPda")
public AjaxResult PurchaseOrderPda(@RequestBody OdsProcureOrder odsProcureOrder) {
List<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")
public TableDataInfo list(WmsOdsWhiteEmbryoIn wmsOdsWhiteEmbryoIn) {
startPage();
@ -47,7 +47,7 @@ public class WmsOdsWhiteEmbryoInController extends BaseController {
/**
*
*/
@RequiresPermissions("wms:wmsEmbryoin:export")
//@RequiresPermissions("wms:wmsEmbryoin:export")
@Log(title = "白胚入库单", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, WmsOdsWhiteEmbryoIn wmsOdsWhiteEmbryoIn) {
@ -59,7 +59,7 @@ public class WmsOdsWhiteEmbryoInController extends BaseController {
/**
*
*/
@RequiresPermissions("wms:wmsEmbryoin:query")
//@RequiresPermissions("wms:wmsEmbryoin:query")
@GetMapping(value = "/{ID}")
public AjaxResult getInfo(@PathVariable("ID") String ID) {
return success(wmsOdsWhiteEmbryoInService.selectWmsOdsWhiteEmbryoInByID(ID));
@ -76,7 +76,7 @@ public class WmsOdsWhiteEmbryoInController extends BaseController {
/**
*
*/
@RequiresPermissions("wms:wmsEmbryoin:edit")
//@RequiresPermissions("wms:wmsEmbryoin:edit")
@Log(title = "白胚入库单", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody WmsOdsWhiteEmbryoIn wmsOdsWhiteEmbryoIn) {
@ -86,7 +86,7 @@ public class WmsOdsWhiteEmbryoInController extends BaseController {
/**
*
*/
@RequiresPermissions("wms:wmsEmbryoin:remove")
//@RequiresPermissions("wms:wmsEmbryoin:remove")
@Log(title = "白胚入库单", businessType = BusinessType.DELETE)
@DeleteMapping("/{IDs}")
public AjaxResult remove(@PathVariable String[] IDs) {

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

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

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

@ -6,14 +6,14 @@ import com.op.wms.domain.OdsProcureOrder;
/**
* Mapper
*
*
* @author Open Platform
* @date 2023-07-06
*/
public interface OdsProcureOrderMapper {
/**
*
*
*
* @param ID
* @return
*/
@ -21,7 +21,7 @@ public interface OdsProcureOrderMapper {
/**
*
*
*
* @param odsProcureOrder
* @return
*/
@ -29,7 +29,7 @@ public interface OdsProcureOrderMapper {
/**
*
*
*
* @param odsProcureOrder
* @return
*/
@ -37,7 +37,7 @@ public interface OdsProcureOrderMapper {
/**
*
*
*
* @param odsProcureOrder
* @return
*/
@ -45,7 +45,7 @@ public interface OdsProcureOrderMapper {
/**
*
*
*
* @param ID
* @return
*/
@ -53,9 +53,11 @@ public interface OdsProcureOrderMapper {
/**
*
*
*
* @param IDs
* @return
*/
public int deleteOdsProcureOrderByIDs(String[] IDs);
Integer updateRealityNuById(OdsProcureOrder odsProcureOrder);
}

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

@ -2,18 +2,19 @@ package com.op.wms.mapper;
import java.util.List;
import com.op.wms.domain.WmsOdsEmStorageNews;
import com.op.wms.domain.WmsOdsMateStorageNews;
/**
* Mapper
*
*
* @author Open Platform
* @date 2023-08-30
*/
public interface WmsOdsMateStorageNewsMapper {
/**
*
*
*
* @param storageId
* @return
*/
@ -21,7 +22,7 @@ public interface WmsOdsMateStorageNewsMapper {
/**
*
*
*
* @param wmsOdsMateStorageNews
* @return
*/
@ -29,7 +30,7 @@ public interface WmsOdsMateStorageNewsMapper {
/**
*
*
*
* @param wmsOdsMateStorageNews
* @return
*/
@ -37,7 +38,7 @@ public interface WmsOdsMateStorageNewsMapper {
/**
*
*
*
* @param wmsOdsMateStorageNews
* @return
*/
@ -45,7 +46,7 @@ public interface WmsOdsMateStorageNewsMapper {
/**
*
*
*
* @param storageId
* @return
*/
@ -53,9 +54,11 @@ public interface WmsOdsMateStorageNewsMapper {
/**
*
*
*
* @param storageIds
* @return
*/
public int deleteWmsOdsMateStorageNewsByStorageIds(String[] storageIds);
WmsOdsMateStorageNews selectByWhCodeAndMate(WmsOdsEmStorageNews wmsOdsEmStorageNews);
}

@ -2,18 +2,19 @@ package com.op.wms.mapper;
import java.util.List;
import com.op.wms.domain.WmsOdsEmStorageNews;
import com.op.wms.domain.WmsOdsMateStorageNewsSn;
/**
* Mapper
*
* Mapper
*
* @author Open Platform
* @date 2023-08-30
*/
public interface WmsOdsMateStorageNewsSnMapper {
/**
*
*
*
* @param mateOrderInSnId
* @return
*/
@ -21,7 +22,7 @@ public interface WmsOdsMateStorageNewsSnMapper {
/**
*
*
*
* @param wmsOdsMateStorageNewsSn
* @return
*/
@ -29,7 +30,7 @@ public interface WmsOdsMateStorageNewsSnMapper {
/**
*
*
*
* @param wmsOdsMateStorageNewsSn
* @return
*/
@ -37,7 +38,7 @@ public interface WmsOdsMateStorageNewsSnMapper {
/**
*
*
*
* @param wmsOdsMateStorageNewsSn
* @return
*/
@ -45,7 +46,7 @@ public interface WmsOdsMateStorageNewsSnMapper {
/**
*
*
*
* @param mateOrderInSnId
* @return
*/
@ -53,9 +54,13 @@ public interface WmsOdsMateStorageNewsSnMapper {
/**
*
*
*
* @param mateOrderInSnIds
* @return
*/
public int deleteWmsOdsMateStorageNewsSnByMateOrderInSnIds(Long[] mateOrderInSnIds);
void updateAdd(WmsOdsEmStorageNews wmsOdsEmStorageNews);
}

@ -6,14 +6,14 @@ import com.op.wms.domain.WmsOdsWhiteEmbryoIn;
/**
* Mapper
*
*
* @author Open Platform
* @date 2023-07-20
*/
public interface WmsOdsWhiteEmbryoInMapper {
/**
*
*
*
* @param ID
* @return
*/
@ -21,7 +21,7 @@ public interface WmsOdsWhiteEmbryoInMapper {
/**
*
*
*
* @param wmsOdsWhiteEmbryoIn
* @return
*/
@ -29,7 +29,7 @@ public interface WmsOdsWhiteEmbryoInMapper {
/**
*
*
*
* @param wmsOdsWhiteEmbryoIn
* @return
*/
@ -37,7 +37,7 @@ public interface WmsOdsWhiteEmbryoInMapper {
/**
*
*
*
* @param wmsOdsWhiteEmbryoIn
* @return
*/
@ -45,7 +45,7 @@ public interface WmsOdsWhiteEmbryoInMapper {
/**
*
*
*
* @param ID
* @return
*/
@ -53,9 +53,13 @@ public interface WmsOdsWhiteEmbryoInMapper {
/**
*
*
*
* @param IDs
* @return
*/
public int deleteWmsOdsWhiteEmbryoInByIDs(String[] IDs);
WmsOdsWhiteEmbryoIn selectWmsOdsWhiteEmbryoInByWorkorderCode(String workorderCode);
void updateWmsOdsWhiteEmbryoInByOrderCode(WmsOdsWhiteEmbryoIn wmsOdsWhiteEmbryoIn);
}

@ -3,17 +3,18 @@ package com.op.wms.mapper;
import java.util.List;
import com.op.wms.domain.WmsRawOrderIn;
import com.op.wms.domain.WmsToWCSDTO;
/**
* Mapper
*
*
* @author Open Platform
* @date 2023-08-30
*/
public interface WmsRawOrderInMapper {
/**
*
*
*
* @param rawOrderInId
* @return
*/
@ -21,7 +22,7 @@ public interface WmsRawOrderInMapper {
/**
*
*
*
* @param wmsRawOrderIn
* @return
*/
@ -29,7 +30,7 @@ public interface WmsRawOrderInMapper {
/**
*
*
*
* @param wmsRawOrderIn
* @return
*/
@ -37,7 +38,7 @@ public interface WmsRawOrderInMapper {
/**
*
*
*
* @param wmsRawOrderIn
* @return
*/
@ -45,7 +46,7 @@ public interface WmsRawOrderInMapper {
/**
*
*
*
* @param rawOrderInId
* @return
*/
@ -53,9 +54,11 @@ public interface WmsRawOrderInMapper {
/**
*
*
*
* @param rawOrderInIds
* @return
*/
public int deleteWmsRawOrderInByRawOrderInIds(String[] rawOrderInIds);
WmsToWCSDTO packagingStorage(WmsToWCSDTO wcsdto);
}

@ -3,17 +3,18 @@ package com.op.wms.mapper;
import java.util.List;
import com.op.wms.domain.WmsRawOrderInSn;
import com.op.wms.domain.WmsToWCSDTO;
/**
* Mapper
*
*
* @author Open Platform
* @date 2023-08-30
*/
public interface WmsRawOrderInSnMapper {
/**
*
*
*
* @param rawOrderInSnId
* @return
*/
@ -21,7 +22,7 @@ public interface WmsRawOrderInSnMapper {
/**
*
*
*
* @param wmsRawOrderInSn
* @return
*/
@ -29,7 +30,7 @@ public interface WmsRawOrderInSnMapper {
/**
*
*
*
* @param wmsRawOrderInSn
* @return
*/
@ -37,7 +38,7 @@ public interface WmsRawOrderInSnMapper {
/**
*
*
*
* @param wmsRawOrderInSn
* @return
*/
@ -45,7 +46,7 @@ public interface WmsRawOrderInSnMapper {
/**
*
*
*
* @param rawOrderInSnId
* @return
*/
@ -53,9 +54,13 @@ public interface WmsRawOrderInSnMapper {
/**
*
*
*
* @param rawOrderInSnIds
* @return
*/
public int deleteWmsRawOrderInSnByRawOrderInSnIds(Long[] rawOrderInSnIds);
WmsRawOrderInSn selectwmsRfidNo(WmsToWCSDTO wmsToWCSDTO);
void updateU1Byid(WmsRawOrderInSn wmsRawOrderInSn);
}

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

@ -2,17 +2,18 @@ package com.op.wms.service;
import java.util.List;
import com.op.wms.domain.OdsProcureOrder;
import com.op.wms.domain.WmsRawOrderInSn;
/**
* Service
*
*
* @author Open Platform
* @date 2023-07-06
*/
public interface IOdsProcureOrderService {
/**
*
*
*
* @param ID
* @return
*/
@ -20,7 +21,7 @@ public interface IOdsProcureOrderService {
/**
*
*
*
* @param odsProcureOrder
* @return
*/
@ -28,7 +29,7 @@ public interface IOdsProcureOrderService {
/**
*
*
*
* @param odsProcureOrder
* @return
*/
@ -36,7 +37,7 @@ public interface IOdsProcureOrderService {
/**
*
*
*
* @param odsProcureOrder
* @return
*/
@ -44,7 +45,7 @@ public interface IOdsProcureOrderService {
/**
*
*
*
* @param IDs
* @return
*/
@ -52,9 +53,19 @@ public interface IOdsProcureOrderService {
/**
*
*
*
* @param ID
* @return
*/
public int deleteOdsProcureOrderByID(String ID);
List<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;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
import com.op.common.core.utils.uuid.IdUtils;
import com.op.wms.domain.*;
import com.op.wms.mapper.WmsOdsMateStorageNewsMapper;
import com.op.wms.mapper.WmsOdsMateStorageNewsSnMapper;
import com.op.wms.mapper.WmsRawOrderInSnMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.op.wms.mapper.OdsProcureOrderMapper;
import com.op.wms.domain.OdsProcureOrder;
import com.op.wms.service.IOdsProcureOrderService;
/**
@ -19,6 +26,12 @@ import com.op.wms.service.IOdsProcureOrderService;
public class OdsProcureOrderServiceImpl implements IOdsProcureOrderService {
@Autowired
private OdsProcureOrderMapper odsProcureOrderMapper;
@Autowired
private WmsRawOrderInSnMapper wmsRawOrderInSnMapper;
@Autowired
private WmsOdsMateStorageNewsSnMapper wmsOdsMateStorageNewsSnMapper;
@Autowired
private WmsOdsMateStorageNewsMapper wmsOdsMateStorageNewsMapper;
/**
*
@ -91,4 +104,118 @@ public class OdsProcureOrderServiceImpl implements IOdsProcureOrderService {
public int deleteOdsProcureOrderByID(String ID) {
return odsProcureOrderMapper.deleteOdsProcureOrderByID(ID);
}
@Override
// @DS("#header.poolName")
public List<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;
}
}

@ -3,7 +3,7 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.op.wms.mapper.OdsProcureOrderMapper">
<resultMap type="OdsProcureOrder" id="OdsProcureOrderResult">
<result property="siteCode" column="Site_code" />
<result property="ID" column="ID" />
@ -39,12 +39,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<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>
<select id="selectOdsProcureOrderList" parameterType="OdsProcureOrder" resultMap="OdsProcureOrderResult">
<include refid="selectOdsProcureOrderVo"/>
<where>
<where>
<if test="siteCode != null and siteCode != ''"> and Site_code = #{siteCode}</if>
<if test="procureCode != null and procureCode != ''"> and Procure_Code = #{procureCode}</if>
<if test="materialCode != null and materialCode != ''"> and Material_Code = #{materialCode}</if>
@ -77,12 +77,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="enterpriseCode != null and enterpriseCode != ''"> and Enterprise_Code = #{enterpriseCode}</if>
</where>
</select>
<select id="selectOdsProcureOrderByID" parameterType="String" resultMap="OdsProcureOrderResult">
<include refid="selectOdsProcureOrderVo"/>
where ID = #{ID}
</select>
<insert id="insertOdsProcureOrder" parameterType="OdsProcureOrder">
insert into ods_procure_order
<trim prefix="(" suffix=")" suffixOverrides=",">
@ -195,9 +195,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<delete id="deleteOdsProcureOrderByIDs" parameterType="String">
delete from ods_procure_order where ID in
delete from ods_procure_order where ID in
<foreach item="ID" collection="array" open="(" separator="," close=")">
#{ID}
</foreach>
</delete>
</mapper>
<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>

@ -3,7 +3,7 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.op.wms.mapper.WmsOdsEmStorageNewsMapper">
<resultMap type="WmsOdsEmStorageNews" id="WmsOdsEmStorageNewsResult">
<result property="storageId" column="storage_id" />
<result property="whCode" column="wh_code" />
@ -46,7 +46,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectWmsOdsEmStorageNewsList" parameterType="WmsOdsEmStorageNews" resultMap="WmsOdsEmStorageNewsResult">
<include refid="selectWmsOdsEmStorageNewsVo"/>
<where>
<where>
<if test="storageId != null and storageId != ''"> and storage_id = #{storageId}</if>
<if test="whCode != null and whCode != ''"> and wh_code = #{whCode}</if>
<if test="regionCode != null and regionCode != ''"> and region_code = #{regionCode}</if>
@ -81,12 +81,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="wlName != null and wlName != ''"> and wl_name like concat('%', #{wlName}, '%')</if>
</where>
</select>
<select id="selectWmsOdsEmStorageNewsByStorageId" parameterType="String" resultMap="WmsOdsEmStorageNewsResult">
<include refid="selectWmsOdsEmStorageNewsVo"/>
where storage_id = #{storageId}
</select>
<insert id="insertWmsOdsEmStorageNews" parameterType="WmsOdsEmStorageNews">
insert into wms_ods_em_storage_news
<trim prefix="(" suffix=")" suffixOverrides=",">
@ -205,9 +205,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<delete id="deleteWmsOdsEmStorageNewsByStorageIds" parameterType="String">
delete from wms_ods_em_storage_news where storage_id in
delete from wms_ods_em_storage_news where storage_id in
<foreach item="storageId" collection="array" open="(" separator="," close=")">
#{storageId}
</foreach>
</delete>
</mapper>
<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>

@ -3,7 +3,7 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.op.wms.mapper.WmsOdsMateStorageNewsMapper">
<resultMap type="WmsOdsMateStorageNews" id="WmsOdsMateStorageNewsResult">
<result property="storageId" column="storage_id" />
<result property="whCode" column="wh_code" />
@ -46,7 +46,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectWmsOdsMateStorageNewsList" parameterType="WmsOdsMateStorageNews" resultMap="WmsOdsMateStorageNewsResult">
<include refid="selectWmsOdsMateStorageNewsVo"/>
<where>
<where>
<if test="storageId != null and storageId != ''"> and storage_id = #{storageId}</if>
<if test="whCode != null and whCode != ''"> and wh_code = #{whCode}</if>
<if test="regionCode != null and regionCode != ''"> and region_code = #{regionCode}</if>
@ -81,12 +81,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="wlName != null and wlName != ''"> and wl_name like concat('%', #{wlName}, '%')</if>
</where>
</select>
<select id="selectWmsOdsMateStorageNewsByStorageId" parameterType="String" resultMap="WmsOdsMateStorageNewsResult">
<include refid="selectWmsOdsMateStorageNewsVo"/>
where storage_id = #{storageId}
</select>
<insert id="insertWmsOdsMateStorageNews" parameterType="WmsOdsMateStorageNews">
insert into wms_ods_mate_storage_news
<trim prefix="(" suffix=")" suffixOverrides=",">
@ -205,9 +205,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<delete id="deleteWmsOdsMateStorageNewsByStorageIds" parameterType="String">
delete from wms_ods_mate_storage_news where storage_id in
delete from wms_ods_mate_storage_news where storage_id in
<foreach item="storageId" collection="array" open="(" separator="," close=")">
#{storageId}
</foreach>
</delete>
</mapper>
<select id="selectByWhCodeAndMate">
</select>
</mapper>

@ -3,7 +3,7 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.op.wms.mapper.WmsOdsMateStorageNewsSnMapper">
<resultMap type="WmsOdsMateStorageNewsSn" id="WmsOdsMateStorageNewsSnResult">
<result property="mateOrderInSnId" column="mate_order_in_sn_id" />
<result property="whCode" column="wh_code" />
@ -42,7 +42,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectWmsOdsMateStorageNewsSnList" parameterType="WmsOdsMateStorageNewsSn" resultMap="WmsOdsMateStorageNewsSnResult">
<include refid="selectWmsOdsMateStorageNewsSnVo"/>
<where>
<where>
<if test="whCode != null and whCode != ''"> and wh_code = #{whCode}</if>
<if test="waCode != null and waCode != ''"> and wa_code = #{waCode}</if>
<if test="wlCode != null and wlCode != ''"> and wl_code = #{wlCode}</if>
@ -72,12 +72,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="sapFactoryCode != null and sapFactoryCode != ''"> and sap_factory_code = #{sapFactoryCode}</if>
</where>
</select>
<select id="selectWmsOdsMateStorageNewsSnByMateOrderInSnId" parameterType="Long" resultMap="WmsOdsMateStorageNewsSnResult">
<include refid="selectWmsOdsMateStorageNewsSnVo"/>
where mate_order_in_sn_id = #{mateOrderInSnId}
</select>
<insert id="insertWmsOdsMateStorageNewsSn" parameterType="WmsOdsMateStorageNewsSn" useGeneratedKeys="true" keyProperty="mateOrderInSnId">
insert into wms_ods_mate_storage_news_sn
<trim prefix="(" suffix=")" suffixOverrides=",">
@ -182,9 +182,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<delete id="deleteWmsOdsMateStorageNewsSnByMateOrderInSnIds" parameterType="String">
delete from wms_ods_mate_storage_news_sn where mate_order_in_sn_id in
delete from wms_ods_mate_storage_news_sn where mate_order_in_sn_id in
<foreach item="mateOrderInSnId" collection="array" open="(" separator="," close=")">
#{mateOrderInSnId}
</foreach>
</delete>
</mapper>
<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>

@ -3,7 +3,7 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.op.wms.mapper.WmsOdsWhiteEmbryoInMapper">
<resultMap type="WmsOdsWhiteEmbryoIn" id="WmsOdsWhiteEmbryoInResult">
<result property="siteCode" column="Site_code" />
<result property="ID" column="ID" />
@ -47,7 +47,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectWmsOdsWhiteEmbryoInList" parameterType="WmsOdsWhiteEmbryoIn" resultMap="WmsOdsWhiteEmbryoInResult">
<include refid="selectWmsOdsWhiteEmbryoInVo"/>
<where>
<where>
<if test="siteCode != null and siteCode != ''"> and Site_code = #{siteCode}</if>
<if test="orderCode != null and orderCode != ''"> and Order_Code = #{orderCode}</if>
<if test="materialCode != null and materialCode != ''"> and Material_Code = #{materialCode}</if>
@ -83,12 +83,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="enterpriseCode != null and enterpriseCode != ''"> and Enterprise_Code = #{enterpriseCode}</if>
</where>
</select>
<select id="selectWmsOdsWhiteEmbryoInByWorkorderCode" parameterType="String" resultMap="WmsOdsWhiteEmbryoInResult">
<include refid="selectWmsOdsWhiteEmbryoInVo"/>
where Order_Code = #{workorderCode}
</select>
<select id="selectWmsOdsWhiteEmbryoInByID" parameterType="String" resultMap="WmsOdsWhiteEmbryoInResult">
<include refid="selectWmsOdsWhiteEmbryoInVo"/>
where ID = #{ID}
</select>
<insert id="insertWmsOdsWhiteEmbryoIn" parameterType="WmsOdsWhiteEmbryoIn">
insert into wms_ods_white_embryo_in
<trim prefix="(" suffix=")" suffixOverrides=",">
@ -210,9 +218,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<delete id="deleteWmsOdsWhiteEmbryoInByIDs" parameterType="String">
delete from wms_ods_white_embryo_in where ID in
delete from wms_ods_white_embryo_in where ID in
<foreach item="ID" collection="array" open="(" separator="," close=")">
#{ID}
</foreach>
</delete>
</mapper>
<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>

@ -3,7 +3,7 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.op.wms.mapper.WmsRawOrderInMapper">
<resultMap type="WmsRawOrderIn" id="WmsRawOrderInResult">
<result property="rawOrderInId" column="raw_order_in_id" />
<result property="factoryCode" column="factory_code" />
@ -65,7 +65,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectWmsRawOrderInList" parameterType="WmsRawOrderIn" resultMap="WmsRawOrderInResult">
<include refid="selectWmsRawOrderInVo"/>
<where>
<where>
<if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if>
<if test="whCode != null and whCode != ''"> and wh_code = #{whCode}</if>
<if test="waCode != null and waCode != ''"> and wa_code = #{waCode}</if>
@ -118,12 +118,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="activeFlag != null and activeFlag != ''"> and active_flag = #{activeFlag}</if>
</where>
</select>
<select id="selectWmsRawOrderInByRawOrderInId" parameterType="String" resultMap="WmsRawOrderInResult">
<include refid="selectWmsRawOrderInVo"/>
where raw_order_in_id = #{rawOrderInId}
</select>
<insert id="insertWmsRawOrderIn" parameterType="WmsRawOrderIn">
insert into wms_raw_order_in
<trim prefix="(" suffix=")" suffixOverrides=",">
@ -299,9 +299,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<delete id="deleteWmsRawOrderInByRawOrderInIds" parameterType="String">
delete from wms_raw_order_in where raw_order_in_id in
delete from wms_raw_order_in where raw_order_in_id in
<foreach item="rawOrderInId" collection="array" open="(" separator="," close=")">
#{rawOrderInId}
</foreach>
</delete>
</mapper>
<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>

@ -3,7 +3,7 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.op.wms.mapper.WmsRawOrderInSnMapper">
<resultMap type="WmsRawOrderInSn" id="WmsRawOrderInSnResult">
<result property="rawOrderInSnId" column="raw_order_in_sn_id" />
<result property="whCode" column="wh_code" />
@ -41,7 +41,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectWmsRawOrderInSnList" parameterType="WmsRawOrderInSn" resultMap="WmsRawOrderInSnResult">
<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="waCode != null and waCode != ''"> and wa_code = #{waCode}</if>
<if test="wlCode != null and wlCode != ''"> and wl_code = #{wlCode}</if>
@ -70,15 +71,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="sapFactoryCode != null and sapFactoryCode != ''"> and sap_factory_code = #{sapFactoryCode}</if>
</where>
</select>
<select id="selectWmsRawOrderInSnByRawOrderInSnId" parameterType="Long" resultMap="WmsRawOrderInSnResult">
<include refid="selectWmsRawOrderInSnVo"/>
where raw_order_in_sn_id = #{rawOrderInSnId}
</select>
<insert id="insertWmsRawOrderInSn" parameterType="WmsRawOrderInSn" useGeneratedKeys="true" keyProperty="rawOrderInSnId">
insert into wms_raw_order_in_sn
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="whCode != null">raw_order_in_sn_id,</if>
<if test="whCode != null">wh_code,</if>
<if test="waCode != null">wa_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>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="whCode != null">#{rawOrderInSnId},</if>
<if test="whCode != null">#{whCode},</if>
<if test="waCode != null">#{waCode},</if>
<if test="wlCode != null">#{wlCode},</if>
@ -177,9 +180,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<delete id="deleteWmsRawOrderInSnByRawOrderInSnIds" parameterType="String">
delete from wms_raw_order_in_sn where raw_order_in_sn_id in
delete from wms_raw_order_in_sn where raw_order_in_sn_id in
<foreach item="rawOrderInSnId" collection="array" open="(" separator="," close=")">
#{rawOrderInSnId}
</foreach>
</delete>
</mapper>
<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>

Loading…
Cancel
Save