change - 原材料入库单金蝶接口加字段源单单据内码、源单单据行内码、采购订单号

master
yinq 2 months ago
parent f2e9ac83f2
commit 42aeb647a7

@ -1,9 +1,8 @@
package com.hw.jindie.controller;
import com.alibaba.fastjson2.JSONObject;
import com.hw.common.core.domain.R;
import com.hw.common.core.web.domain.AjaxResult;
import com.hw.common.log.annotation.Log;
import com.hw.common.log.enums.BusinessType;
import com.hw.common.security.annotation.InnerAuth;
import com.hw.jindie.api.domain.vo.ErpSyncInfoVo;
import com.hw.jindie.service.IKingdeeErpSyncService;
@ -53,12 +52,12 @@ public class KingdeeErpSyncController {
@PostMapping("/syncUnitInfoFromErp")
// @Log(title = "ERP单位信息", businessType = BusinessType.INSERT)
// @InnerAuth
public AjaxResult syncUnitInfoFromErp(@RequestBody ErpSyncInfoVo erpSyncInfoVo) {
public R<AjaxResult> syncUnitInfoFromErp(@RequestBody ErpSyncInfoVo erpSyncInfoVo) {
try {
return AjaxResult.success(kingdeeErpSyncService.syncUnitInfoFromErp(0, erpSyncInfoVo));
return R.ok(AjaxResult.success(kingdeeErpSyncService.syncUnitInfoFromErp(0, erpSyncInfoVo)));
} catch (Exception e) {
logger.error("同步单位信息错误:" + e.getMessage());
return AjaxResult.error(e.getMessage());
return R.ok(AjaxResult.error(e.getMessage()));
}
}
@ -68,12 +67,12 @@ public class KingdeeErpSyncController {
@PostMapping("/syncSupplierInfoFromErp")
// @Log(title = "ERP供应商信息", businessType = BusinessType.INSERT)
@InnerAuth
public AjaxResult syncSupplierInfoFromErp(@RequestBody ErpSyncInfoVo erpSyncInfoVo) {
public R<AjaxResult> syncSupplierInfoFromErp(@RequestBody ErpSyncInfoVo erpSyncInfoVo) {
try {
return AjaxResult.success(kingdeeErpSyncService.syncSupplierInfoFromErp(0, erpSyncInfoVo));
return R.ok(AjaxResult.success(kingdeeErpSyncService.syncSupplierInfoFromErp(0, erpSyncInfoVo)));
} catch (Exception e) {
logger.error("同步供应商信息错误:" + e.getMessage());
return AjaxResult.error(e.getMessage());
return R.ok(AjaxResult.error(e.getMessage()));
}
}
@ -83,12 +82,12 @@ public class KingdeeErpSyncController {
// @Log(title = "ERP物料信息", businessType = BusinessType.INSERT)
@PostMapping(("/syncMaterialInfoFromErp"))
// @InnerAuth
public AjaxResult syncMaterialInfoFromErp(@RequestBody ErpSyncInfoVo erpSyncInfoVo) {
public R<AjaxResult> syncMaterialInfoFromErp(@RequestBody ErpSyncInfoVo erpSyncInfoVo) {
try {
return AjaxResult.success(kingdeeErpSyncService.syncMaterialInfoFromErp(0, erpSyncInfoVo));
return R.ok(AjaxResult.success(kingdeeErpSyncService.syncMaterialInfoFromErp(0, erpSyncInfoVo)));
} catch (Exception e) {
logger.error("同步物料信息错误:" + e.getMessage());
return AjaxResult.error(e.getMessage());
return R.ok(AjaxResult.error(e.getMessage()));
}
}
@ -100,12 +99,12 @@ public class KingdeeErpSyncController {
@PostMapping("/syncProjectInfoFromErp")
// @Log(title = "ERP项目信息", businessType = BusinessType.INSERT)
@InnerAuth
public AjaxResult syncProjectInfoFromErp(@RequestBody ErpSyncInfoVo erpSyncInfoVo) {
public R<AjaxResult> syncProjectInfoFromErp(@RequestBody ErpSyncInfoVo erpSyncInfoVo) {
try {
return AjaxResult.success(kingdeeErpSyncService.syncProjectInfoFromErp(0, erpSyncInfoVo));
return R.ok(AjaxResult.success(kingdeeErpSyncService.syncProjectInfoFromErp(0, erpSyncInfoVo)));
} catch (Exception e) {
logger.error("同步项目信息错误:" + e.getMessage());
return AjaxResult.error(e.getMessage());
return R.ok(AjaxResult.error(e.getMessage()));
}
}
@ -115,12 +114,12 @@ public class KingdeeErpSyncController {
@PostMapping("/syncSaleOrderFromErp")
// @Log(title = "ERP销售订单", businessType = BusinessType.INSERT)
// @InnerAuth
public AjaxResult syncSaleOrderFromErp(@RequestBody ErpSyncInfoVo erpSyncInfoVo) {
public R<AjaxResult> syncSaleOrderFromErp(@RequestBody ErpSyncInfoVo erpSyncInfoVo) {
try {
return AjaxResult.success(kingdeeErpSyncService.syncSaleOrderFromErp(0, erpSyncInfoVo));
return R.ok(AjaxResult.success(kingdeeErpSyncService.syncSaleOrderFromErp(0, erpSyncInfoVo)));
} catch (Exception e) {
logger.error("同步销售订单信息错误:" + e.getMessage());
return AjaxResult.error(e.getMessage());
return R.ok(AjaxResult.error(e.getMessage()));
}
}
@ -131,27 +130,27 @@ public class KingdeeErpSyncController {
@PostMapping("/syncPurchaseOrderFromErp")
// @Log(title = "ERP采购订单", businessType = BusinessType.INSERT)
@InnerAuth
public AjaxResult syncPurchaseOrderFromErp(@RequestBody ErpSyncInfoVo erpSyncInfoVo) {
public R<AjaxResult> syncPurchaseOrderFromErp(@RequestBody ErpSyncInfoVo erpSyncInfoVo) {
try {
return AjaxResult.success(kingdeeErpSyncService.syncPurchaseOrderFromErp(0, erpSyncInfoVo));
return R.ok(AjaxResult.success(kingdeeErpSyncService.syncPurchaseOrderFromErp(0, erpSyncInfoVo)));
} catch (Exception e) {
logger.error("同步采购订单信息错误:" + e.getMessage());
return AjaxResult.error(e.getMessage());
return R.ok(AjaxResult.error(e.getMessage()));
}
}
/**
* ERPMES
* ERPMES
*/
@PostMapping("/syncPurchaseReceiveBillFromErp")
// @Log(title = "ERP采购收料单", businessType = BusinessType.INSERT)
// @InnerAuth
public AjaxResult syncPurchaseReceiveBillFromErp(@RequestBody ErpSyncInfoVo erpSyncInfoVo) {
public R<AjaxResult> syncPurchaseReceiveBillFromErp(@RequestBody ErpSyncInfoVo erpSyncInfoVo) {
try {
return AjaxResult.success(kingdeeErpSyncService.syncPurchaseReceiveBillFromErp(0, erpSyncInfoVo));
return R.ok(AjaxResult.success(kingdeeErpSyncService.syncPurchaseReceiveBillFromErp(0, erpSyncInfoVo)));
} catch (Exception e) {
logger.error("同步采购收料单信息错误:" + e.getMessage());
return AjaxResult.error(e.getMessage());
return R.ok(AjaxResult.error(e.getMessage()));
}
}
@ -165,11 +164,11 @@ public class KingdeeErpSyncController {
@PostMapping(("/singleSavePurchaseRequisition"))
// @Log(title = "ERP采购申请单", businessType = BusinessType.INSERT)
@InnerAuth
public AjaxResult singleSavePurchaseRequisition(@RequestBody String params) {
public R<AjaxResult> singleSavePurchaseRequisition(@RequestBody String params) {
try {
return AjaxResult.success(kingdeeErpService.singleSavePurchaseRequisition(params));
return R.ok(AjaxResult.success(kingdeeErpService.singleSavePurchaseRequisition(params)));
} catch (Exception e) {
return AjaxResult.error(e.toString());
return R.ok(AjaxResult.error(e.toString()));
}
}
@ -183,11 +182,11 @@ public class KingdeeErpSyncController {
* }
*/
@PostMapping(("/savePurchaseStorage"))
public AjaxResult savePurchaseStorage(@RequestBody String params) {
public R<AjaxResult> savePurchaseStorage(@RequestBody String params) {
try {
return AjaxResult.success(kingdeeErpService.savePurchaseStorage(params));
return R.ok(AjaxResult.success(kingdeeErpService.savePurchaseStorage(params)));
} catch (Exception e) {
return AjaxResult.error(e.toString());
return R.ok(AjaxResult.error(e.toString()));
}
}
@ -198,11 +197,11 @@ public class KingdeeErpSyncController {
* @return {"msg": "{\"IsSuccess\":true,\"Errors\":[],\"SuccessEntitys\":[{\"Id\":\"116470\",\"Number\":\"QTCK004153\",\"DIndex\":0}]}","code": 200}
*/
@PostMapping(("/saveOtherOutStorage"))
public AjaxResult saveOtherOutStorage(@RequestBody String params) {
public R<AjaxResult> saveOtherOutStorage(@RequestBody String params) {
try {
return AjaxResult.success(kingdeeErpService.saveOtherOutStorage(params));
return R.ok(AjaxResult.success(kingdeeErpService.saveOtherOutStorage(params)));
} catch (Exception e) {
return AjaxResult.error(e.toString());
return R.ok(AjaxResult.error(e.toString()));
}
}
@ -214,11 +213,11 @@ public class KingdeeErpSyncController {
* @return { "msg": "{\"IsSuccess\":true,\"Errors\":[],\"SuccessEntitys\":[{\"Id\":\"100418\",\"Number\":\"QTRK000352\",\"DIndex\":0}]}", "code": 200}
*/
@PostMapping(("/saveOtherInStorage"))
public AjaxResult saveOtherInStorage(@RequestBody String params) {
public R<AjaxResult> saveOtherInStorage(@RequestBody String params) {
try {
return AjaxResult.success(kingdeeErpService.saveOtherInStorage(params));
return R.ok(AjaxResult.success(kingdeeErpService.saveOtherInStorage(params)));
} catch (Exception e) {
return AjaxResult.error(e.toString());
return R.ok(AjaxResult.error(e.toString()));
}
}

@ -228,6 +228,9 @@ public class KingdeeErpService {
String FStockId = (String) objectParams.get("FStockId");//仓库
String F_TOND_Base = (String) objectParams.get("FTondBase");//京源项目
String supplierCode = (String) objectParams.get("FSupplierCode");//供应商编码
String FSBillId = (String) objectParams.get("FSBillId");//源单单据内码(上游单据:单据内码)
String FSId = (String) objectParams.get("FSId");//源单单据行内码(上游单据:单据行内码)
String FPOOrderNo = (String) objectParams.get("FPOOrderNo");//采购订单号
supplierCode = StringUtils.isEmpty(supplierCode)?"VEN04520":supplierCode;
@ -257,16 +260,18 @@ public class KingdeeErpService {
FAuxPropIdObject.put("FAUXPROPID__FF100001", FAuxPropId);
}
FEntity.put("FAuxPropId", FAuxPropIdObject); //辅助属性
FEntity.put("FPOOrderNo", FPOOrderNo);//采购订单号
FEntity.put("FSRCBILLTYPEID", "PUR_ReceiveBill");//(明细信息)源单类型
FEntity.put("FSrcBillNo", FSrcBillNo); //源单编号
/* ArrayList<JSONObject> linkList = new ArrayList<>();
ArrayList<JSONObject> linkList = new ArrayList<>();
JSONObject linkObject = new JSONObject();
linkObject.put("FInStockEntry_Link_FRuleId", "PUR_PurchaseOrder-STK_InStock"); //上游单据和下游单据之间的转换规则
linkObject.put("FInStockEntry_Link_FSTableName", "t_PUR_POOrderEntry"); //源单(上游单据:对应的数据库表名称)
linkObject.put("FInStockEntry_Link_FSBillId", "108022"); //源单单据内码(上游单据:单据内码)
linkObject.put("FInStockEntry_Link_FSId", "165252"); //源单单据行内码(上游单据:单据行内码)
linkObject.put("FInStockEntry_Link_FRuleId", "PUR_ReceiveBill-STK_InStock"); //上游单据和下游单据之间的转换规则
linkObject.put("FInStockEntry_Link_FSTableName", "T_PUR_ReceiveEntry"); //源单(上游单据:对应的数据库表名称)
linkObject.put("FInStockEntry_Link_FSBillId", FSBillId); //源单单据内码(上游单据:单据内码)
linkObject.put("FInStockEntry_Link_FSId", FSId); //源单单据行内码(上游单据:单据行内码)
linkList.add(linkObject);
FEntity.put("FInStockEntry_Link", linkList);*/
FEntity.put("FInStockEntry_Link", linkList);
ArrayList<JSONObject> entityList = new ArrayList<>();

@ -2,6 +2,7 @@ package com.hw.wms.controller;
import com.alibaba.fastjson2.JSONObject;
import com.hw.common.core.constant.WmsConstants;
import com.hw.common.core.domain.R;
import com.hw.common.core.utils.StringUtils;
import com.hw.common.core.web.controller.BaseController;
import com.hw.common.core.web.domain.AjaxResult;
@ -247,13 +248,13 @@ public class WmsApiController extends BaseController {
*/
@PostMapping(("/synchronizeInventoryInformationToERP"))
@Log(title = "同步原材料入库信息", businessType = BusinessType.INSERT)
public AjaxResult synchronizeInventoryInformationToERP() {
public R<AjaxResult> synchronizeInventoryInformationToERP() {
int result = 0;
Map<Long, List<WmsRawInstock>> purchaseOrderIdMap = wmsErpScheduledTaskService.synchronizeInventoryInformationToERP();
for (Long purchaseOrderId : purchaseOrderIdMap.keySet()) {
wmsErpScheduledTaskService.syncInventoryInformation(purchaseOrderIdMap, purchaseOrderId, result);
}
return toAjax(1);
return R.ok();
}
/**
@ -263,7 +264,7 @@ public class WmsApiController extends BaseController {
*/
@PostMapping(("/synchronizeRawMaterialDeliveryInformationToERP"))
@Log(title = "同步原材料出库信息", businessType = BusinessType.INSERT)
public AjaxResult synchronizeRawMaterialDeliveryInformationToERP() {
public R<AjaxResult> synchronizeRawMaterialDeliveryInformationToERP() {
Map<Long, List<WmsRawOutstockDetail>> otherMaterialIdMap = wmsErpScheduledTaskService.synchronizeOtherMaterialDeliveryInformationToERP();
for (Long materialId : otherMaterialIdMap.keySet()) {
wmsErpScheduledTaskService.syncOutstockInformation(otherMaterialIdMap, materialId, "");
@ -274,7 +275,7 @@ public class WmsApiController extends BaseController {
wmsErpScheduledTaskService.syncOutstockInformation(returnMaterialIdMap, materialId, WmsConstants.WMS_RAW_OUTSTOCK_TASK_TYPE_RETURN_OUTSTOCK);
}
return toAjax(1);
return R.ok();
}
@ -285,13 +286,13 @@ public class WmsApiController extends BaseController {
*/
@PostMapping(("/synchronizeRawReturnInformationToERP"))
@Log(title = "同步原材料退库信息", businessType = BusinessType.INSERT)
public AjaxResult synchronizeRawReturnInformationToERP() {
public R<AjaxResult> synchronizeRawReturnInformationToERP() {
Map<Long, List<WmsRawReturnDetail>> purchaseOrderIdMap = wmsErpScheduledTaskService.synchronizeRawReturnInformationToERP();
int result= 0;
for (Long purchaseOrderId : purchaseOrderIdMap.keySet()) {
wmsErpScheduledTaskService.syncRawReturnInformation(purchaseOrderIdMap, purchaseOrderId, result);
}
return toAjax(1);
return R.ok();
}
/**
@ -302,13 +303,13 @@ public class WmsApiController extends BaseController {
*/
@PostMapping(("/synchronizeProductInstockInformationToERP/{days}"))
@Log(title = "同步成品入库信息", businessType = BusinessType.INSERT)
public AjaxResult synchronizeProductInstockInformationToERP(@PathVariable Integer days) {
public R<AjaxResult> synchronizeProductInstockInformationToERP(@PathVariable Integer days) {
Map<Long, List<WmsProductInstock>> productIdMap = wmsErpScheduledTaskService.synchronizeProductInstockInformationToERP(days);
int result = 0;
for (Long productId : productIdMap.keySet()) {
wmsErpScheduledTaskService.syncProductInstockInformation(productIdMap, productId, result);
}
return toAjax(1);
return R.ok();
}
/**
@ -319,13 +320,13 @@ public class WmsApiController extends BaseController {
*/
@PostMapping(("/synchronizeProductOutstockInformationToERP/{days}"))
@Log(title = "同步成品出库信息", businessType = BusinessType.INSERT)
public AjaxResult synchronizeProductOutstockInformationToERP(@PathVariable Integer days) {
public R<AjaxResult> synchronizeProductOutstockInformationToERP(@PathVariable Integer days) {
Map<Long, List<WmsProductOutstock>> productIdMap = wmsErpScheduledTaskService.synchronizeProductOutstockInformationToERP(days);
int result = 0;
for (Long productId : productIdMap.keySet()) {
wmsErpScheduledTaskService.syncProductOutstockInformation(productIdMap, productId, result);
}
return toAjax(1);
return R.ok();
}

@ -136,10 +136,50 @@ public class WmsRawInstock extends BaseEntity
/** 规格参数 */
private String specificationParameter;
/** 源单编号采购订单FSrcBillNo */
private String srcBillNo;
private String unitName;
/**
* ()
*/
private String fsBillId;
/**
* ()
*/
private String fsId;
/**
*
*/
private String billNo;
public String getBillNo() {
return billNo;
}
public void setBillNo(String billNo) {
this.billNo = billNo;
}
public String getFsBillId() {
return fsBillId;
}
public void setFsBillId(String fsBillId) {
this.fsBillId = fsBillId;
}
public String getFsId() {
return fsId;
}
public void setFsId(String fsId) {
this.fsId = fsId;
}
public String getSpecificationParameter() {
return specificationParameter;
}

@ -128,12 +128,15 @@ public class WmsErpScheduledTaskServiceImpl implements IWmsErpScheduledTaskServi
data.put("FDate", fdate);
data.put("FMaterialId", instock.getMaterialCode());
data.put("FAuxPropId", specificationParameter);
data.put("FSrcBillNo", instock.getSrcBillNo());
data.put("FSrcBillNo", instock.getBillNo());//源单编号,采购收料通知单的单据编号
data.put("FUnitID", instock.getUnitCode());
data.put("FRealQty", FRealQty);
data.put("FStockId", wmsConfig.getfStockId());
data.put("FSupplierCode", supplierCode);
data.put("FTondBase", projectNo);
data.put("FSBillId", instock.getFsBillId());
data.put("FSId", instock.getFsId());
data.put("FPOOrderNo", instock.getPoNo());//采购订单的FBillNo
String params = data.toJSONString();
try {
R<AjaxResult> paramsResult = remoteJindieService.savePurchaseStorage(params, SecurityConstants.INNER);
@ -175,6 +178,7 @@ public class WmsErpScheduledTaskServiceImpl implements IWmsErpScheduledTaskServi
rawInstock.setErpAmount(rawInstock.getInstockAmount());
rawInstock.setUpdateDate(DateUtils.getNowDate());
wmsRawInstockMapper.updateWmsRawInstock(rawInstock);
log.info("updateWmsRawInStockWithoutRollback原材料入库单失败状态:" + rawInstock.getRawInstockId());
}
}
@ -268,9 +272,16 @@ public class WmsErpScheduledTaskServiceImpl implements IWmsErpScheduledTaskServi
String params = data.toJSONString();
try {
R<AjaxResult> paramsResult = remoteJindieService.saveOtherOutStorage(params, SecurityConstants.INNER);
String paramsResultData = paramsResult.getMsg();
JSONObject jsonObject = JSONObject.parseObject(paramsResultData);
Boolean isSuccess = (Boolean) jsonObject.get("IsSuccess");
Gson gson = new Gson();
String paramsResulJson = gson.toJson(paramsResult);
log.info("+++++++++paramsResult+++++++" + paramsResulJson);
ObjectMapper mapper = new ObjectMapper();
JsonNode rootNode = mapper.readTree(paramsResulJson);
String msgStr = rootNode.path("data").path("msg").asText();
log.info("+++++++++msgStr+++++++" + msgStr);
JsonNode msgNode = mapper.readTree(msgStr);
boolean isSuccess = msgNode.path("IsSuccess").asBoolean();
log.info("+++++++++isSuccess+++++++" + isSuccess);
if (isSuccess) {
result++;
log.info("synchronizeRawMaterialDeliveryInformationToERP成功:" + paramsResult.toString());
@ -351,9 +362,16 @@ public class WmsErpScheduledTaskServiceImpl implements IWmsErpScheduledTaskServi
String params = data.toJSONString();
try {
R<AjaxResult> paramsResult = remoteJindieService.savePurchaseStorage(params, SecurityConstants.INNER);
String paramsResultData = paramsResult.getMsg();
JSONObject jsonObject = JSONObject.parseObject(paramsResultData);
Boolean isSuccess = (Boolean) jsonObject.get("IsSuccess");
Gson gson = new Gson();
String paramsResulJson = gson.toJson(paramsResult);
log.info("+++++++++paramsResult+++++++" + paramsResulJson);
ObjectMapper mapper = new ObjectMapper();
JsonNode rootNode = mapper.readTree(paramsResulJson);
String msgStr = rootNode.path("data").path("msg").asText();
log.info("+++++++++msgStr+++++++" + msgStr);
JsonNode msgNode = mapper.readTree(msgStr);
boolean isSuccess = msgNode.path("IsSuccess").asBoolean();
log.info("+++++++++isSuccess+++++++" + isSuccess);
if (isSuccess) {
result++;
log.info("synchronizeInventoryInformationToERP同步原材料退库成功:" + paramsResult.toString());
@ -428,9 +446,16 @@ public class WmsErpScheduledTaskServiceImpl implements IWmsErpScheduledTaskServi
String params = data.toJSONString();
try {
R<AjaxResult> paramsResult = remoteJindieService.saveOtherInStorage(params, SecurityConstants.INNER);
String paramsResultData = paramsResult.getMsg();
JSONObject jsonObject = JSONObject.parseObject(paramsResultData);
Boolean isSuccess = (Boolean) jsonObject.get("IsSuccess");
Gson gson = new Gson();
String paramsResulJson = gson.toJson(paramsResult);
log.info("+++++++++paramsResult+++++++" + paramsResulJson);
ObjectMapper mapper = new ObjectMapper();
JsonNode rootNode = mapper.readTree(paramsResulJson);
String msgStr = rootNode.path("data").path("msg").asText();
log.info("+++++++++msgStr+++++++" + msgStr);
JsonNode msgNode = mapper.readTree(msgStr);
boolean isSuccess = msgNode.path("IsSuccess").asBoolean();
log.info("+++++++++isSuccess+++++++" + isSuccess);
if (isSuccess) {
result++;
log.info("synchronizeProductInstockInformationToERP成功:" + paramsResult.toString());
@ -502,9 +527,16 @@ public class WmsErpScheduledTaskServiceImpl implements IWmsErpScheduledTaskServi
String params = data.toJSONString();
try {
R<AjaxResult> paramsResult = remoteJindieService.saveOtherOutStorage(params, SecurityConstants.INNER);
String paramsResultData = paramsResult.getMsg();
JSONObject jsonObject = JSONObject.parseObject(paramsResultData);
Boolean isSuccess = (Boolean) jsonObject.get("IsSuccess");
Gson gson = new Gson();
String paramsResulJson = gson.toJson(paramsResult);
log.info("+++++++++paramsResult+++++++" + paramsResulJson);
ObjectMapper mapper = new ObjectMapper();
JsonNode rootNode = mapper.readTree(paramsResulJson);
String msgStr = rootNode.path("data").path("msg").asText();
log.info("+++++++++msgStr+++++++" + msgStr);
JsonNode msgNode = mapper.readTree(msgStr);
boolean isSuccess = msgNode.path("IsSuccess").asBoolean();
log.info("+++++++++isSuccess+++++++" + isSuccess);
if (isSuccess) {
result++;

@ -41,6 +41,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="specificationParameter" column="specification_parameter" />
<result property="srcBillNo" column="src_bill_no" />
<result property="unitName" column="unit_name" />
<result property="fsBillId" column="fs_bill_id" />
<result property="fsId" column="fs_id" />
<result property="billNo" column="bill_no" />
</resultMap>
<sql id="selectWmsRawInstockVo">
@ -224,12 +227,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
mbui.unit_code,
wri.instock_amount,
if(wri.erp_amount is null, 0, wri.erp_amount) erp_amount,
wri.erp_status
wri.erp_status,
wri.material_barcode,
mprb.bill_no,
mprb.erp_id fs_bill_id,
mprb.fentry_id fs_id
from wms_raw_instock wri
left join wms_base_warehouse wbw on wbw.warehouse_id = wri.warehouse_id
left join mes_base_material_info mbmi on mbmi.material_id = wri.material_id
left join mes_base_unit_info mbui on mbui.erp_id = mbmi.material_unit_id
left join mes_purchase_order mpo on wri.purchase_order_id = mpo.purchase_order_id
left join mes_base_barcode_info mbbi on mbbi.barcode_info = wri.material_barcode
left join mes_purchase_receive_bill mprb on mprb.receive_bill_id = mbbi.receive_bill_id
where wri.execute_status = 2
and (wri.erp_status != 1 or wri.erp_status is null)
and wri.instock_type in (1, 3, 4)

Loading…
Cancel
Save