Browse Source

1.修复同步数据逻辑

pull/2/head
zhenghaoyu 10 months ago
parent
commit
25741aa02e
  1. 3
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/CarsLoadOrderInfoVO.java
  2. 3
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/CarsLoadWaybillInfoVO.java
  3. 2
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/TrunklineBillladingDetailListVO.java
  4. 1
      blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/impl/PanFactoryDataServiceImpl.java
  5. 46
      blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/SyncOrderInfoServiceImpl.java
  6. 5
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/api/BillladingApiController.java
  7. 3
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineBillladingMapper.java
  8. 4
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineBillladingMapper.xml
  9. 27
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsOrderMapper.xml
  10. 2
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCostShareRecordMapper.java
  11. 9
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCostShareRecordMapper.xml
  12. 2
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineBillladingService.java
  13. 2
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCostShareRecordService.java
  14. 14
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineBillladingServiceImpl.java
  15. 5
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java
  16. 5
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCostShareRecordServiceImpl.java

3
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/CarsLoadOrderInfoVO.java

@ -14,7 +14,8 @@ public class CarsLoadOrderInfoVO implements Serializable {
private Integer loadingNum; private Integer loadingNum;
private Integer unloadNum; private Integer unloadNum;
private BigDecimal unloadIncome; private BigDecimal unloadIncome;
private BigDecimal orderLineCost; private BigDecimal costZhang;
private BigDecimal costPiece;
private BigDecimal weight; private BigDecimal weight;
private BigDecimal volume; private BigDecimal volume;
private BigDecimal orderFreight; private BigDecimal orderFreight;

3
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/CarsLoadWaybillInfoVO.java

@ -32,6 +32,9 @@ public class CarsLoadWaybillInfoVO implements Serializable {
private BigDecimal otherFee; private BigDecimal otherFee;
private BigDecimal insuranceFee; private BigDecimal insuranceFee;
private BigDecimal totalFee; private BigDecimal totalFee;
private BigDecimal costPiece;
private BigDecimal costZhang;
private Integer costNum;
List<CarsLoadOrderInfoVO> carsLoadOrderInfoList = new ArrayList<>(); List<CarsLoadOrderInfoVO> carsLoadOrderInfoList = new ArrayList<>();

2
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/TrunklineBillladingDetailListVO.java

@ -9,5 +9,7 @@ public class TrunklineBillladingDetailListVO implements Serializable {
private String orderPackageCode; private String orderPackageCode;
private String packageStatus; private String packageStatus;
private String materialName;
private String thirdPackName;
} }

1
blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/impl/PanFactoryDataServiceImpl.java

@ -737,6 +737,7 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
entity.setUpdateUser(1714696768639311873L); entity.setUpdateUser(1714696768639311873L);
entity.setCreateDept(1649331096241836033L); entity.setCreateDept(1649331096241836033L);
entity.setTenantId(TenantNum.HUITONGCODE); entity.setTenantId(TenantNum.HUITONGCODE);
entity.setIsTransfer(0);
if (StringUtil.isNoneBlank(entity.getMaterialName()) && StringUtil.isNoneBlank(entity.getMaterialCode())) { if (StringUtil.isNoneBlank(entity.getMaterialName()) && StringUtil.isNoneBlank(entity.getMaterialCode())) {
// 查询物料信息 // 查询物料信息
String sku = ""; String sku = "";

46
blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/SyncOrderInfoServiceImpl.java

@ -1540,13 +1540,7 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
log.info("###########saveOrderPackage: 包条已存在,不同步 unitNo={}",unitNo); log.info("###########saveOrderPackage: 包条已存在,不同步 unitNo={}",unitNo);
continue; continue;
} }
String productName = null;
if(!Objects.isNull(inventoryId)){
InventoryDetailEntity inventoryDetailEntity = inventoryDetailClient.findUnitNoIsExist(unitNo,inventoryId);
if(!Objects.isNull(inventoryDetailEntity)){
productName = inventoryDetailEntity.getProductname();
}
}
Integer status = orderDetailEntity.getStatus(); Integer status = orderDetailEntity.getStatus();
Integer carsType = orderDetailEntity.getCarsType(); Integer carsType = orderDetailEntity.getCarsType();
@ -1589,21 +1583,37 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
// if(3==carsType||4 == carsType){ // if(3==carsType||4 == carsType){
// entity.setOrderPackageStatus(OrderPackageStatusConstant.yichuku.getValue()); // entity.setOrderPackageStatus(OrderPackageStatusConstant.yichuku.getValue());
// } // }
if(2 == signState){
entity.setOrderPackageStatus(OrderPackageStatusConstant.yiqianshou.getValue()); String productName = null;
if(!Objects.isNull(inventoryId)){
InventoryDetailEntity inventoryDetailEntity = inventoryDetailClient.findUnitNoIsExist(unitNo,inventoryId);
if(!Objects.isNull(inventoryDetailEntity)){
productName = inventoryDetailEntity.getProductname();
entity.setOrderPackageStatus(OrderPackageStatusConstant.yiruku.getValue());
}else{
entity.setOrderPackageStatus(OrderPackageStatusConstant.yiqianshou.getValue());
}
entity.setIsTransfer(0);
}else{ }else{
entity.setOrderPackageStatus(OrderPackageStatusConstant.zhongzhuanruku.getValue()); if(2 == signState){
if(!Objects.isNull(waybillEntity)){ entity.setOrderPackageStatus(OrderPackageStatusConstant.yiqianshou.getValue());
String warehouseName = waybillEntity.getWarehouseName();//目的仓 entity.setIsTransfer(0);
BasicdataWarehouseEntity endhouse = basicdataWarehouseClient.findByName(warehouseName); }else{
Long endWarehouseId = endhouse.getId(); entity.setOrderPackageStatus(OrderPackageStatusConstant.yiruku.getValue());
if(endWarehouseId.equals(warehouseId)){ if(!Objects.isNull(waybillEntity)){
entity.setOrderPackageStatus(OrderPackageStatusConstant.yiruku.getValue()); String warehouseName = waybillEntity.getWarehouseName();//目的仓
}else{ BasicdataWarehouseEntity endhouse = basicdataWarehouseClient.findByName(warehouseName);
entity.setOrderPackageStatus(OrderPackageStatusConstant.yiruku.getValue()); Long endWarehouseId = endhouse.getId();
if(endWarehouseId.equals(warehouseId)){
entity.setIsTransfer(0);
}else{
entity.setIsTransfer(1);
}
} }
} }
} }
entity.setOrderPackageFreezeStatus(OrderPackageFreezeStatusConstant.weidongjie.getValue()); entity.setOrderPackageFreezeStatus(OrderPackageFreezeStatusConstant.weidongjie.getValue());
entity.setOrderPackageReservationStatus(OrderPackageReservationStatusConstant.daiyuyue.getValue()); entity.setOrderPackageReservationStatus(OrderPackageReservationStatusConstant.daiyuyue.getValue());
entity.setOrderPackageGroundingStatus(OrderPackageGroundingStatusConstant.daishangjia.getValue()); entity.setOrderPackageGroundingStatus(OrderPackageGroundingStatusConstant.daishangjia.getValue());

5
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/api/BillladingApiController.java

@ -17,6 +17,7 @@ import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.StringUtil; import org.springblade.core.tool.utils.StringUtil;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Objects; import java.util.Objects;
@Slf4j @Slf4j
@ -115,9 +116,9 @@ public class BillladingApiController {
return R.fail(403,"订单号为空"); return R.fail(403,"订单号为空");
} }
IPage<TrunklineBillladingDetailListVO> pages = billladingService.findAdvanceDetailList(billladingDTO); List<TrunklineBillladingDetailListVO> ls = billladingService.findAdvanceDetailList(billladingDTO);
return R.data(pages); return R.data(ls);
}catch (CustomerException e){ }catch (CustomerException e){
log.error(e.message,e); log.error(e.message,e);
return R.fail(e.code,e.message); return R.fail(e.code,e.message);

3
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineBillladingMapper.java

@ -12,6 +12,7 @@ import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.Date; import java.util.Date;
import java.util.List;
import java.util.Map; import java.util.Map;
@Mapper @Mapper
@ -25,7 +26,7 @@ public interface TrunklineBillladingMapper extends BaseMapper<TrunklineBillladin
IPage<TrunklineBillladingDetailVO> billladingList(IPage<Object> page, @Param("warehouseId") Long warehouseId, @Param("startByDateStr") Date startByDateStr, @Param("endByDateStr") Date endByDateStr); IPage<TrunklineBillladingDetailVO> billladingList(IPage<Object> page, @Param("warehouseId") Long warehouseId, @Param("startByDateStr") Date startByDateStr, @Param("endByDateStr") Date endByDateStr);
IPage<TrunklineBillladingDetailListVO> findAdvanceDetailList(IPage<Object> page, @Param("orderCode") String orderCode); List<TrunklineBillladingDetailListVO> findAdvanceDetailList(@Param("orderCode") String orderCode);
Map<String, Integer> billladingNum(@Param("warehouseId") Long warehouseId, @Param("startByDateStr") Date startByDateStr, @Param("endByDateStr") Date endByDateStr); Map<String, Integer> billladingNum(@Param("warehouseId") Long warehouseId, @Param("startByDateStr") Date startByDateStr, @Param("endByDateStr") Date endByDateStr);
} }

4
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineBillladingMapper.xml

@ -158,7 +158,9 @@
<select id="findAdvanceDetailList" resultType="com.logpm.trunkline.vo.TrunklineBillladingDetailListVO"> <select id="findAdvanceDetailList" resultType="com.logpm.trunkline.vo.TrunklineBillladingDetailListVO">
select order_package_code, select order_package_code,
package_status package_status,
material_name,
third_pack_name
from logpm_trunkline_advance_detail from logpm_trunkline_advance_detail
where order_code = #{orderCode} where order_code = #{orderCode}
</select> </select>

27
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsOrderMapper.xml

@ -131,15 +131,32 @@
<select id="findCarsLoadOrderInfoList" resultType="com.logpm.trunkline.vo.CarsLoadOrderInfoVO"> <select id="findCarsLoadOrderInfoList" resultType="com.logpm.trunkline.vo.CarsLoadOrderInfoVO">
select ltco.order_code orderCode, select ltco.order_code orderCode,
ltco.plan_num planNum, IFNULL(ltco.plan_num,0) planNum,
ltco.real_num loadingNum, t.loadingNum,
lww.total_freight orderFreight, lww.total_freight orderFreight,
lww.check_user_name checkUserName, lww.check_user_name checkUserName,
IFNULL(ltco.unload_num,0) unloadNum, IFNULL(ltco.unload_num,0) unloadNum,
IFNULL(lww.total_freight/lww.total_count*ltco.unload_num,0) unloadIncome, IFNULL(lww.total_freight/lww.total_count*t.unloadNum,0) unloadIncome,
IFNULL(lww.total_freight/lww.total_count*ltco.plan_num,0) orderLineCost, m.costPiece,
m.costZhang,
sum(ltwo.total_number) orderNum sum(ltwo.total_number) orderNum
from logpm_trunkline_cars_order ltco from (select ltcls.waybill_no waybillNo,
ltcls.order_code orderCode,
sum(IFNULL(ltcls.num,0)) loadingNum,
sum(IFNULL(ltcls.unload_num,0)) unloadNum
from logpm_trunkline_cars_load_scan ltcls
where ltcls.load_id = #{loadId}
group by ltcls.waybill_no,
ltcls.order_code) t
left join (select ltcsr.waybill_no waybillNo,
ltcsr.order_code orderCode,
sum(IFNULL(ltcsr.cost_piece,0)) costPiece,
sum(IFNULL(ltcsr.cost_zhang,0)) costZhang
from logpm_trunkline_cost_share_record ltcsr
where ltcsr.load_id = #{loadId}
group by ltcsr.waybill_no,
ltcsr.order_code) m on m.waybillNo = t.waybillNo and m.orderCode = t.orderCode
left join logpm_trunkline_cars_order ltco on ltco.waybill_no = t.waybillNo and ltco.order_code = t.orderCode
left join logpm_trunkline_waybill_order ltwo on ltwo.order_code = ltco.order_code and ltwo.waybill_no = ltco.waybill_no left join logpm_trunkline_waybill_order ltwo on ltwo.order_code = ltco.order_code and ltwo.waybill_no = ltco.waybill_no
left join logpm_warehouse_waybill lww on lww.waybill_no = ltwo.waybill_no left join logpm_warehouse_waybill lww on lww.waybill_no = ltwo.waybill_no
where ltco.load_id = #{loadId} where ltco.load_id = #{loadId}

2
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCostShareRecordMapper.java

@ -20,4 +20,6 @@ public interface TrunklineCostShareRecordMapper extends BaseMapper<TrunklineCost
List<String> findUpdateWaybill(@Param("loadId") Long loadId); List<String> findUpdateWaybill(@Param("loadId") Long loadId);
TrunklineCostShareRecordEntity sumTotalCost(@Param("waybillNo") String waybillNo); TrunklineCostShareRecordEntity sumTotalCost(@Param("waybillNo") String waybillNo);
TrunklineCostShareRecordEntity findTotalUnloadNumByLoadAndWaybillNo(@Param("loadId") Long loadId, @Param("waybillNo") String waybillNo);
} }

9
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCostShareRecordMapper.xml

@ -38,4 +38,13 @@
where waybill_no = #{waybillNo} where waybill_no = #{waybillNo}
</select> </select>
<select id="findTotalUnloadNumByLoadAndWaybillNo" resultType="com.logpm.trunkline.entity.TrunklineCostShareRecordEntity">
select IFNULL(sum(cost_piece),0) costPiece,
IFNULL(sum(cost_zhang),0) costZhang,
IFNULL(sum(num),0) num
from logpm_trunkline_cost_share_record
where waybill_no = #{waybillNo}
and load_id = #{loadId}
</select>
</mapper> </mapper>

2
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineBillladingService.java

@ -43,5 +43,5 @@ public interface ITrunklineBillladingService extends BaseService<TrunklineBillla
R billladingList(BillladingDTO billladingDTO); R billladingList(BillladingDTO billladingDTO);
IPage<TrunklineBillladingDetailListVO> findAdvanceDetailList(BillladingDTO billladingDTO); List<TrunklineBillladingDetailListVO> findAdvanceDetailList(BillladingDTO billladingDTO);
} }

2
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCostShareRecordService.java

@ -15,4 +15,6 @@ public interface ITrunklineCostShareRecordService extends BaseService<TrunklineC
List<String> findUpdateWaybill(Long loadId); List<String> findUpdateWaybill(Long loadId);
TrunklineCostShareRecordEntity sumTotalCost(String waybillNo); TrunklineCostShareRecordEntity sumTotalCost(String waybillNo);
TrunklineCostShareRecordEntity findTotalUnloadNumByLoadAndWaybillNo(Long loadId, String waybillNo);
} }

14
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineBillladingServiceImpl.java

@ -547,15 +547,15 @@ public class TrunklineBillladingServiceImpl extends BaseServiceImpl<TrunklineBil
} }
@Override @Override
public IPage<TrunklineBillladingDetailListVO> findAdvanceDetailList(BillladingDTO billladingDTO) { public List<TrunklineBillladingDetailListVO> findAdvanceDetailList(BillladingDTO billladingDTO) {
Integer pageNum = billladingDTO.getPageNum(); // Integer pageNum = billladingDTO.getPageNum();
Integer pageSize = billladingDTO.getPageSize(); // Integer pageSize = billladingDTO.getPageSize();
String orderCode = billladingDTO.getOrderCode(); String orderCode = billladingDTO.getOrderCode();
IPage<Object> page = new Page<>(); // IPage<Object> page = new Page<>();
page.setCurrent(pageNum); // page.setCurrent(pageNum);
page.setSize(pageSize); // page.setSize(pageSize);
IPage<TrunklineBillladingDetailListVO> ls = baseMapper.findAdvanceDetailList(page,orderCode); List<TrunklineBillladingDetailListVO> ls = baseMapper.findAdvanceDetailList(orderCode);
return ls; return ls;
} }

5
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java

@ -85,6 +85,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
private final ICarsLoadAsyncService carsLoadAsyncService; private final ICarsLoadAsyncService carsLoadAsyncService;
private final IOpenOrderAsyncService openOrderAsyncService; private final IOpenOrderAsyncService openOrderAsyncService;
private final IDistributionParcelNumberClient distributionParcelNumberClient; private final IDistributionParcelNumberClient distributionParcelNumberClient;
private final ITrunklineCostShareRecordService trunklineCostShareRecordService;
@Override @Override
public IPage<TrunklineCarsLoadVO> loadCarsPageList(LoadCarsDTO loadCarsDTO) { public IPage<TrunklineCarsLoadVO> loadCarsPageList(LoadCarsDTO loadCarsDTO) {
@ -2440,6 +2441,10 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
carsLoadWaybillInfoVO.setCarsLoadOrderInfoList(carsLoadOrderInfoList); carsLoadWaybillInfoVO.setCarsLoadOrderInfoList(carsLoadOrderInfoList);
TrunklineCostShareRecordEntity costShareRecordEntity = trunklineCostShareRecordService.findTotalUnloadNumByLoadAndWaybillNo(loadId,waybillNo);
carsLoadWaybillInfoVO.setCostPiece(costShareRecordEntity.getCostPiece());
carsLoadWaybillInfoVO.setCostZhang(costShareRecordEntity.getCostZhang());
carsLoadWaybillInfoVO.setCostNum(costShareRecordEntity.getNum());
} }
trunklineCarsLoadVO.setCarsLoadWaybillInfoList(carsLoadWaybillInfoList); trunklineCarsLoadVO.setCarsLoadWaybillInfoList(carsLoadWaybillInfoList);

5
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCostShareRecordServiceImpl.java

@ -38,4 +38,9 @@ public class TrunklineCostShareRecordServiceImpl extends BaseServiceImpl<Trunkli
public TrunklineCostShareRecordEntity sumTotalCost(String waybillNo) { public TrunklineCostShareRecordEntity sumTotalCost(String waybillNo) {
return baseMapper.sumTotalCost(waybillNo); return baseMapper.sumTotalCost(waybillNo);
} }
@Override
public TrunklineCostShareRecordEntity findTotalUnloadNumByLoadAndWaybillNo(Long loadId, String waybillNo) {
return baseMapper.findTotalUnloadNumByLoadAndWaybillNo(loadId,waybillNo);
}
} }

Loading…
Cancel
Save