Browse Source

Merge branch 'dev' into pre-production

pre-production
zhaoqiaobo 1 week ago
parent
commit
c4303d6411
  1. 76
      blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/job/FactoryJob.java
  2. 2
      blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/mapper/OrderInfoMapper.java
  3. 9
      blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/mapper/OrderInfoMapper.xml
  4. 2
      blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/service/OrderInfoService.java
  5. 5
      blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/service/impl/OrderInfoServiceImpl.java

76
blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/job/FactoryJob.java

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

2
blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/mapper/OrderInfoMapper.java

@ -3,6 +3,7 @@ package com.logpm.factorydata.suofeiya.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.logpm.factorydata.suofeiya.entity.OrderInfoEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@ -17,4 +18,5 @@ public interface OrderInfoMapper extends BaseMapper<OrderInfoEntity> {
List<OrderInfoEntity> findNotFullOrder();
void updateFullSetByMianOrderCode(@Param("mainOrderNo") List<String> mainOrderNo);
}

9
blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/mapper/OrderInfoMapper.xml

@ -7,4 +7,13 @@
from sfy_order_info
where order_full = 'N'
</select>
<update id="updateFullSetByMianOrderCode">
update sfy_order_info
set order_full = 'Y'
where main_order_no in
<foreach collection="mainOrderNo" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</update>
</mapper>

2
blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/service/OrderInfoService.java

@ -15,4 +15,6 @@ public interface OrderInfoService extends BaseService<OrderInfoEntity> {
List<OrderInfoEntity> findNotFullOrder();
void updateFullSetByMianOrderCode(List<String> mainOrderNo);
}

5
blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/service/impl/OrderInfoServiceImpl.java

@ -25,4 +25,9 @@ public class OrderInfoServiceImpl extends BaseServiceImpl<OrderInfoMapper, Order
public List<OrderInfoEntity> findNotFullOrder() {
return baseMapper.findNotFullOrder();
}
@Override
public void updateFullSetByMianOrderCode(List<String> mainOrderNo) {
baseMapper.updateFullSetByMianOrderCode(mainOrderNo);
}
}

Loading…
Cancel
Save