|
|
|
@ -87,6 +87,7 @@ public class FactoryJob {
|
|
|
|
|
JSONObject jsonObject = JSONUtil.parseObj(s); |
|
|
|
|
if (StrUtil.equals(jsonObject.getStr("result_code"), "0000")) { |
|
|
|
|
List<OrderFullInfoEntity> orderFullInfoEntities = new ArrayList<>(); |
|
|
|
|
List<String> mainOrderCodes = new ArrayList<>(); |
|
|
|
|
// 推送成功
|
|
|
|
|
JSONArray fullSetInfos = jsonObject.getJSONArray("fullSetInfo"); |
|
|
|
|
if (CollUtil.isNotEmpty(fullSetInfos)) { |
|
|
|
@ -94,48 +95,57 @@ public class FactoryJob {
|
|
|
|
|
JSONObject fullSetInfo = JSONUtil.parseObj(fullSetInfoObj); |
|
|
|
|
String mainOrderNo = fullSetInfo.getStr("mainOrderNo"); |
|
|
|
|
String fullSet = fullSetInfo.getStr("fullSet"); |
|
|
|
|
// 家品数据取 orderDetail 衣柜取 paNos
|
|
|
|
|
if ("Z".equals(orderType)) { |
|
|
|
|
JSONArray orderDetails = fullSetInfo.getJSONArray("orderDetail"); |
|
|
|
|
if (CollUtil.isNotEmpty(orderDetails)) { |
|
|
|
|
for (Object orderDetailObj : orderDetails) { |
|
|
|
|
JSONObject orderDetail = JSONUtil.parseObj(orderDetailObj); |
|
|
|
|
String orderNo = orderDetail.getStr("orderNo"); |
|
|
|
|
String itemCode = orderDetail.getStr("itemCode"); |
|
|
|
|
String itemName = orderDetail.getStr("itemName"); |
|
|
|
|
String quantity = orderDetail.getStr("quantity"); |
|
|
|
|
OrderFullInfoEntity entity = new OrderFullInfoEntity(); |
|
|
|
|
entity.setMainOrderNo(mainOrderNo); |
|
|
|
|
entity.setOrderNo(orderNo); |
|
|
|
|
entity.setItemCode(itemCode); |
|
|
|
|
entity.setItemName(itemName); |
|
|
|
|
entity.setQuantity(quantity); |
|
|
|
|
entity.setFullSet(fullSet); |
|
|
|
|
entity.setOrderType(orderType); |
|
|
|
|
entity.setTenantCode(tenantCode); |
|
|
|
|
orderFullInfoEntities.add(entity); |
|
|
|
|
if ("N".equals(fullSet)) { |
|
|
|
|
// 家品数据取 orderDetail 衣柜取 paNos
|
|
|
|
|
if ("Z".equals(orderType)) { |
|
|
|
|
JSONArray orderDetails = fullSetInfo.getJSONArray("orderDetail"); |
|
|
|
|
if (CollUtil.isNotEmpty(orderDetails)) { |
|
|
|
|
for (Object orderDetailObj : orderDetails) { |
|
|
|
|
JSONObject orderDetail = JSONUtil.parseObj(orderDetailObj); |
|
|
|
|
String orderNo = orderDetail.getStr("orderNo"); |
|
|
|
|
String itemCode = orderDetail.getStr("itemCode"); |
|
|
|
|
String itemName = orderDetail.getStr("itemName"); |
|
|
|
|
String quantity = orderDetail.getStr("quantity"); |
|
|
|
|
OrderFullInfoEntity entity = new OrderFullInfoEntity(); |
|
|
|
|
entity.setMainOrderNo(mainOrderNo); |
|
|
|
|
entity.setOrderNo(orderNo); |
|
|
|
|
entity.setItemCode(itemCode); |
|
|
|
|
entity.setItemName(itemName); |
|
|
|
|
entity.setQuantity(quantity); |
|
|
|
|
entity.setFullSet(fullSet); |
|
|
|
|
entity.setOrderType(orderType); |
|
|
|
|
entity.setTenantCode(tenantCode); |
|
|
|
|
orderFullInfoEntities.add(entity); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
JSONArray paNos = fullSetInfo.getJSONArray("paNo"); |
|
|
|
|
if (CollUtil.isNotEmpty(paNos)) { |
|
|
|
|
for (Object paNo : paNos) { |
|
|
|
|
String str = Convert.toStr(paNo); |
|
|
|
|
OrderFullInfoEntity entity = new OrderFullInfoEntity(); |
|
|
|
|
entity.setMainOrderNo(mainOrderNo); |
|
|
|
|
entity.setPaNo(str); |
|
|
|
|
entity.setFullSet(fullSet); |
|
|
|
|
entity.setOrderType(orderType); |
|
|
|
|
entity.setTenantCode(tenantCode); |
|
|
|
|
orderFullInfoEntities.add(entity); |
|
|
|
|
} else { |
|
|
|
|
JSONArray paNos = fullSetInfo.getJSONArray("paNo"); |
|
|
|
|
if (CollUtil.isNotEmpty(paNos)) { |
|
|
|
|
for (Object paNo : paNos) { |
|
|
|
|
String str = Convert.toStr(paNo); |
|
|
|
|
OrderFullInfoEntity entity = new OrderFullInfoEntity(); |
|
|
|
|
entity.setMainOrderNo(mainOrderNo); |
|
|
|
|
entity.setPaNo(str); |
|
|
|
|
entity.setFullSet(fullSet); |
|
|
|
|
entity.setOrderType(orderType); |
|
|
|
|
entity.setTenantCode(tenantCode); |
|
|
|
|
entity.setQuantity("1"); |
|
|
|
|
orderFullInfoEntities.add(entity); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if ("Y".equals(fullSet)) { |
|
|
|
|
mainOrderCodes.add(mainOrderNo); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (CollUtil.isNotEmpty(orderFullInfoEntities)) { |
|
|
|
|
orderFullInfoService.saveBatch(orderFullInfoEntities); |
|
|
|
|
} |
|
|
|
|
if (CollUtil.isNotEmpty(mainOrderCodes)) { |
|
|
|
|
orderInfoService.updateFullSetByMianOrderCode(mainOrderCodes); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|