销售订单修改接口调整删除物料行的逻辑
This commit is contained in:
parent
1d534fd13a
commit
e2be42eace
|
@ -320,17 +320,24 @@ public class APISaleOrderMaitainImpl implements IAPISaleOrderMaitain {
|
||||||
if (null == originVos || originVos.length == 0) {
|
if (null == originVos || originVos.length == 0) {
|
||||||
ExceptionUtils.wrappBusinessException("根据传入数据未匹配到相关数据");
|
ExceptionUtils.wrappBusinessException("根据传入数据未匹配到相关数据");
|
||||||
}
|
}
|
||||||
Map<String, String> delMap = new HashMap<>();
|
Map<String, List<String>> delBipMap = new HashMap<>();
|
||||||
for (Map<String, Object> objectMap : paramList) {
|
for (Map<String, Object> objectMap : paramList) {
|
||||||
Map<String, Object> headdata = (Map<String, Object>) objectMap.get(HEADTABLE);
|
Map<String, Object> headdata = (Map<String, Object>) objectMap.get(HEADTABLE);
|
||||||
delMap.put(headdata.get("csaleorderid") + "", headdata.getOrDefault("delId", "") + "");
|
String csaleorderid = headdata.get("csaleorderid") + "";
|
||||||
List<Object> bodyArr = (List<Object>) objectMap.get(BODYTABLE);
|
List<Object> bodyArr = (List<Object>) objectMap.get(BODYTABLE);
|
||||||
|
List<String> delIds = new ArrayList<>();
|
||||||
for (Object body : bodyArr) {
|
for (Object body : bodyArr) {
|
||||||
Map<String, Object> bodydata = (Map<String, Object>) body;
|
Map<String, Object> bodydata = (Map<String, Object>) body;
|
||||||
if ((bodydata.getOrDefault("vbdef11", "") + "").isEmpty()) {
|
if ((bodydata.getOrDefault("vbdef11", "") + "").isEmpty()) {
|
||||||
// 如果vbdef11为空则标记为新增行
|
// 如果vbdef11为空则标记为新增行
|
||||||
bodydata.put("status", "add");
|
bodydata.put("status", "add");
|
||||||
}
|
}
|
||||||
|
if (!(bodydata.getOrDefault("csaleorderbid", "") + "").isEmpty()) {
|
||||||
|
delIds.add(bodydata.get("csaleorderbid") + "");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!delIds.isEmpty()) {
|
||||||
|
delBipMap.put(csaleorderid, delIds);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -356,20 +363,17 @@ public class APISaleOrderMaitainImpl implements IAPISaleOrderMaitain {
|
||||||
SaleOrderVO bipVo = vosMap.get(primaryKey);
|
SaleOrderVO bipVo = vosMap.get(primaryKey);
|
||||||
// 设置单据状态
|
// 设置单据状态
|
||||||
hvo.setStatus(VOStatus.UPDATED);
|
hvo.setStatus(VOStatus.UPDATED);
|
||||||
String delId = delMap.get(primaryKey);
|
List<String> bipIds = delBipMap.get(primaryKey);
|
||||||
|
|
||||||
// 比较combinBillVOs中的BVO和vos中的BVO
|
// 比较combinBillVOs中的BVO和vos中的BVO
|
||||||
for (SaleOrderBVO bvo : vo.getChildrenVO()) {
|
for (SaleOrderBVO bvo : vo.getChildrenVO()) {
|
||||||
bvo.setStatus(VOStatus.UPDATED);
|
bvo.setStatus(VOStatus.DELETED);
|
||||||
String csaleorderbid = bvo.getCsaleorderbid();
|
String csaleorderbid = bvo.getCsaleorderbid();
|
||||||
// 设置删除的物料行的状态,在bip传的数据中找不到
|
// 设置物料行的状态,在bip传的数据中找到则修改
|
||||||
if (StringUtils.isNotEmpty(delId)) {
|
if (bipIds != null && !bipIds.isEmpty()) {
|
||||||
String[] delIds = delId.split(",", -1);
|
// 明细行设置为修改状态
|
||||||
String vbdef11 = bvo.getVbdef11();
|
if (bipIds.contains(csaleorderbid)) {
|
||||||
// 如果BIP合同销售订单的主键在删除的数组中,则设置为删除状态
|
bvo.setStatus(VOStatus.UPDATED);
|
||||||
if (Arrays.asList(delIds).contains(vbdef11)) {
|
|
||||||
bvo.setStatus(VOStatus.DELETED);
|
|
||||||
NCCForUAPLogger.debug("findDeletedBids:" + VOStatus.DELETED + ",csaleorderbid = " + csaleorderbid);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue