opt:生产入库单增加源单及单据明细行号
This commit is contained in:
@@ -8,7 +8,6 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import com.github.javaparser.utils.Log;
|
import com.github.javaparser.utils.Log;
|
||||||
import com.kingdee.bos.webapi.entity.IdentifyInfo;
|
import com.kingdee.bos.webapi.entity.IdentifyInfo;
|
||||||
import com.kingdee.bos.webapi.sdk.K3CloudApi;
|
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.apache.commons.lang3.ObjectUtils;
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
@@ -72,7 +71,6 @@ public class SyncReceiptProcessHandler implements ClassProcess {
|
|||||||
try {
|
try {
|
||||||
IdentifyInfo identifyInfo = new IdentifyInfo();
|
IdentifyInfo identifyInfo = new IdentifyInfo();
|
||||||
BeanUtils.copyProperties(erpSec, identifyInfo);
|
BeanUtils.copyProperties(erpSec, identifyInfo);
|
||||||
K3CloudApi cloudApi = new K3CloudApi(identifyInfo);
|
|
||||||
JSONObject res;
|
JSONObject res;
|
||||||
if (Integer.parseInt(StatusEnum.ERP_TYPE.code(formid)) > 22) {
|
if (Integer.parseInt(StatusEnum.ERP_TYPE.code(formid)) > 22) {
|
||||||
String result = erpServiceUtils.audit(formData).getString("result");
|
String result = erpServiceUtils.audit(formData).getString("result");
|
||||||
@@ -121,38 +119,37 @@ public class SyncReceiptProcessHandler implements ClassProcess {
|
|||||||
if ("RECEIPT_PRD".equals(formType)) {
|
if ("RECEIPT_PRD".equals(formType)) {
|
||||||
for (int i = 0; i < fEntityArray.size(); i++) {
|
for (int i = 0; i < fEntityArray.size(); i++) {
|
||||||
JSONObject fEntity = fEntityArray.getJSONObject(i);
|
JSONObject fEntity = fEntityArray.getJSONObject(i);
|
||||||
if ("0".equals(fEntity.getString("FSrcEntryId"))) {
|
//查询工序汇报单
|
||||||
//查询工序汇报单
|
ErpQuery reportQuery = new ErpQuery();
|
||||||
ErpQuery reportQuery = new ErpQuery();
|
reportQuery.setFilterString("FMoNumber ='" + fEntity.getString("FMoBillNo") + "'");
|
||||||
reportQuery.setFilterString("FMoNumber ='" + fEntity.getString("FMoBillNo") + "'");
|
reportQuery.setOrderString("FId desc");
|
||||||
reportQuery.setOrderString("FId desc");
|
reportQuery.setFormId("SFC_OperationReport");
|
||||||
reportQuery.setFormId("SFC_OperationReport");
|
JSONArray jsonArray = erpServiceUtils.queryBills(reportQuery);
|
||||||
JSONArray jsonArray = erpServiceUtils.queryBills(reportQuery);
|
if (CollectionUtils.isEmpty(jsonArray)) {
|
||||||
if (CollectionUtils.isEmpty(jsonArray)) {
|
throw new BadRequestException("该生产订单未找到对应生产汇报单");
|
||||||
throw new BadRequestException("该生产订单未找到对应生产汇报单");
|
|
||||||
}
|
|
||||||
JSONArray optRptEntry = jsonArray.getJSONObject(0).getJSONArray("OptRptEntry");
|
|
||||||
if (fEntity.containsKey("FSrcEntryId")) {
|
|
||||||
//增加源单分录id
|
|
||||||
fEntity.put("FSrcEntryId", optRptEntry.getJSONObject(0).getString("SrcEntryId"));
|
|
||||||
fEntity.put("FSrcEntrySeq", optRptEntry.getJSONObject(0).getString("SrcEntrySeq"));
|
|
||||||
fEntity.put("FSrcBillType", "SFC_OperationReport");
|
|
||||||
}
|
|
||||||
Map<String, Object> linkedMap = new LinkedHashMap<>();
|
|
||||||
for (String key : fEntity.keySet()) {
|
|
||||||
linkedMap.put(key, fEntity.get(key));
|
|
||||||
}
|
|
||||||
Map<String, Object> tempMap = new LinkedHashMap<>();
|
|
||||||
for (Map.Entry<String, Object> entry : linkedMap.entrySet()) {
|
|
||||||
tempMap.put(entry.getKey(), entry.getValue());
|
|
||||||
if ("FMoEntryId".equals(entry.getKey())) {
|
|
||||||
//源单编号为工序汇报单号
|
|
||||||
tempMap.put("FSrcBillNo", jsonArray.getJSONObject(0).getString("BillNo"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
fEntity.clear();
|
|
||||||
fEntity.putAll(tempMap);
|
|
||||||
}
|
}
|
||||||
|
JSONArray optRptEntry = jsonArray.getJSONObject(0).getJSONArray("OptRptEntry");
|
||||||
|
if (fEntity.containsKey("FSrcEntryId")) {
|
||||||
|
//增加源单分录id
|
||||||
|
fEntity.put("FSrcEntryId", optRptEntry.getJSONObject(0).getString("SrcEntryId"));
|
||||||
|
fEntity.put("FSrcEntrySeq", optRptEntry.getJSONObject(0).getString("SrcEntrySeq"));
|
||||||
|
fEntity.put("FSrcBillType", "SFC_OperationReport");
|
||||||
|
}
|
||||||
|
Map<String, Object> linkedMap = new LinkedHashMap<>();
|
||||||
|
for (String key : fEntity.keySet()) {
|
||||||
|
linkedMap.put(key, fEntity.get(key));
|
||||||
|
}
|
||||||
|
Map<String, Object> tempMap = new LinkedHashMap<>();
|
||||||
|
for (Map.Entry<String, Object> entry : linkedMap.entrySet()) {
|
||||||
|
tempMap.put(entry.getKey(), entry.getValue());
|
||||||
|
if ("FMoEntryId".equals(entry.getKey())) {
|
||||||
|
//源单编号为工序汇报单号
|
||||||
|
tempMap.put("FSrcBillNo", jsonArray.getJSONObject(0).getString("BillNo"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fEntity.clear();
|
||||||
|
fEntity.putAll(tempMap);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//判断生产领料单的批次与辅助单位
|
//判断生产领料单的批次与辅助单位
|
||||||
@@ -180,12 +177,11 @@ public class SyncReceiptProcessHandler implements ClassProcess {
|
|||||||
fUnit.put("FNumber", materialInfo.getAssist_unit_id());
|
fUnit.put("FNumber", materialInfo.getAssist_unit_id());
|
||||||
tempMap.put("FSecUnitId", fUnit);
|
tempMap.put("FSecUnitId", fUnit);
|
||||||
}
|
}
|
||||||
if ("FStockId".equals(entry.getKey())) {
|
// if ("FStockId".equals(entry.getKey())) {
|
||||||
JSONObject fStockId = new JSONObject();
|
// JSONObject fStockId = new JSONObject();
|
||||||
//tofix 目前都入料箱库
|
// fStockId.put("FNumber", "25");
|
||||||
fStockId.put("FNumber", "25");
|
// tempMap.put("FStockId", fStockId);
|
||||||
tempMap.put("FStockId", fStockId);
|
// }
|
||||||
}
|
|
||||||
}
|
}
|
||||||
fEntity.clear();
|
fEntity.clear();
|
||||||
fEntity.putAll(tempMap);
|
fEntity.putAll(tempMap);
|
||||||
|
|||||||
@@ -20,4 +20,9 @@ public class GroupItemData {
|
|||||||
*/
|
*/
|
||||||
private String single_weight;
|
private String single_weight;
|
||||||
|
|
||||||
|
|
||||||
|
@JsonProperty("FMoEntrySeq")
|
||||||
|
@JSONField(name = "FMoEntrySeq")
|
||||||
|
private String FMoEntrySeq;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package org.nl.wms.pda_manage.iostorage.server.dto;
|
package org.nl.wms.pda_manage.iostorage.server.dto;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
@@ -182,6 +183,11 @@ public class PdaFormInMst implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private String ownerIdHead_Id;
|
private String ownerIdHead_Id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生产订单行号
|
||||||
|
*/
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String moEntrySeq;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 对应表头:采购入库单-业务类型FBusinessType:默认(CG)
|
* 对应表头:采购入库单-业务类型FBusinessType:默认(CG)
|
||||||
|
|||||||
@@ -421,7 +421,6 @@ public class PdaIOService {
|
|||||||
String workShopId1;
|
String workShopId1;
|
||||||
BigDecimal qty;
|
BigDecimal qty;
|
||||||
String ownerId_Id;
|
String ownerId_Id;
|
||||||
String stockId;
|
|
||||||
String keeperId;
|
String keeperId;
|
||||||
String srcBillNo;
|
String srcBillNo;
|
||||||
JSONObject pFormJson;
|
JSONObject pFormJson;
|
||||||
@@ -445,8 +444,6 @@ public class PdaIOService {
|
|||||||
workShopId1 = dFormJson.getString("product_code");
|
workShopId1 = dFormJson.getString("product_code");
|
||||||
qty = prdMoBillData.getQty();
|
qty = prdMoBillData.getQty();
|
||||||
ownerId_Id = dFormJson.getString("InStockOwnerId");
|
ownerId_Id = dFormJson.getString("InStockOwnerId");
|
||||||
//tofix 目前都入料箱库
|
|
||||||
stockId = "25";
|
|
||||||
keeperId = dFormJson.getString("StockOrgId");
|
keeperId = dFormJson.getString("StockOrgId");
|
||||||
srcBillNo = dFormJson.getString("saleOrderEntryId");
|
srcBillNo = dFormJson.getString("saleOrderEntryId");
|
||||||
} else {
|
} else {
|
||||||
@@ -473,8 +470,6 @@ public class PdaIOService {
|
|||||||
ownerId_Id = JSON.parseObject(entity.getString("InStockOwnerId")).getString("Number");
|
ownerId_Id = JSON.parseObject(entity.getString("InStockOwnerId")).getString("Number");
|
||||||
keeperId = JSON.parseObject(entity.getString("InStockOwnerId")).getString("Number");
|
keeperId = JSON.parseObject(entity.getString("InStockOwnerId")).getString("Number");
|
||||||
srcBillNo = entity.getString("SaleOrderEntryId");
|
srcBillNo = entity.getString("SaleOrderEntryId");
|
||||||
//tofix 目前都入料箱库
|
|
||||||
stockId = "25";
|
|
||||||
} else {
|
} else {
|
||||||
throw new BadRequestException("查询合格证关联的生产订单明细信息异常!");
|
throw new BadRequestException("查询合格证关联的生产订单明细信息异常!");
|
||||||
}
|
}
|
||||||
@@ -497,7 +492,6 @@ public class PdaIOService {
|
|||||||
result.setOwnerTypeId(StringUtils.isBlank(dataList.get(13).toString()) ? "BD_OwnerOrg" : dataList.get(13).toString());
|
result.setOwnerTypeId(StringUtils.isBlank(dataList.get(13).toString()) ? "BD_OwnerOrg" : dataList.get(13).toString());
|
||||||
result.setOwnerId_Id(ownerId_Id);
|
result.setOwnerId_Id(ownerId_Id);
|
||||||
result.setStockStatusId("KCZT01_SYS");
|
result.setStockStatusId("KCZT01_SYS");
|
||||||
result.setStockId(stockId);
|
|
||||||
result.setKeeperId(keeperId);
|
result.setKeeperId(keeperId);
|
||||||
result.setKeeperTypeId("BD_KeeperOrg");
|
result.setKeeperTypeId("BD_KeeperOrg");
|
||||||
result.setSrcBillNo(srcBillNo);
|
result.setSrcBillNo(srcBillNo);
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ public class PdaInIOService {
|
|||||||
String materialId = mst.getMaterial_id();
|
String materialId = mst.getMaterial_id();
|
||||||
String vehicleCode = mst.getVehicle_code();
|
String vehicleCode = mst.getVehicle_code();
|
||||||
String unitId = mst.getUnit_id();
|
String unitId = mst.getUnit_id();
|
||||||
|
mst.setStockId("FStockPallet".equals(mst.getStor_code())? "24" : "25");
|
||||||
if (StringUtils.isBlank(mst.getSrcBillNo())) {
|
if (StringUtils.isBlank(mst.getSrcBillNo())) {
|
||||||
throw new BadRequestException("操作失败,源单信息不存在!");
|
throw new BadRequestException("操作失败,源单信息不存在!");
|
||||||
}
|
}
|
||||||
@@ -87,6 +88,7 @@ public class PdaInIOService {
|
|||||||
GroupItemData groupItemData = new GroupItemData();
|
GroupItemData groupItemData = new GroupItemData();
|
||||||
groupItemData.setSingle_weight(mst.getSingle_weight());
|
groupItemData.setSingle_weight(mst.getSingle_weight());
|
||||||
groupItemData.setFMoBillNo(mst.getBillNo());
|
groupItemData.setFMoBillNo(mst.getBillNo());
|
||||||
|
groupItemData.setFMoEntrySeq(mst.getMoEntrySeq());
|
||||||
materItem.setForm_data(groupItemData);
|
materItem.setForm_data(groupItemData);
|
||||||
groupDto.setItem(ListOf.of(materItem));
|
groupDto.setItem(ListOf.of(materItem));
|
||||||
iMdGruopDickService.groupDick((JSONObject) JSONObject.toJSON(groupDto));
|
iMdGruopDickService.groupDick((JSONObject) JSONObject.toJSON(groupDto));
|
||||||
|
|||||||
Reference in New Issue
Block a user