Browse Source

1.干线bug修复提交

single_db
zhenghaoyu 1 year ago
parent
commit
560f5c9268
  1. 36
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/CarsLoadController.java
  2. 3
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadMapper.java
  3. 52
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadMapper.xml
  4. 3
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadService.java
  5. 70
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/InComingServiceImpl.java
  6. 46
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceServiceImpl.java
  7. 44
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java

36
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/CarsLoadController.java

@ -1056,7 +1056,7 @@ public class CarsLoadController {
@ResponseBody
@PostMapping("/loadingDetail")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "三方中转装车明细", notes = "传入loadCarsDTO")
@ApiOperation(value = "装车明细", notes = "传入loadCarsDTO")
public R loadingDetail(@RequestBody LoadCarsDTO loadCarsDTO) {
String method = "############loadingDetail: ";
log.info(method+"请求参数{}",loadCarsDTO);
@ -1086,5 +1086,39 @@ public class CarsLoadController {
}
}
@ResponseBody
@PostMapping("/carsLoadDetailInfo")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "配载计划详情", notes = "传入loadCarsDTO")
public R carsLoadDetailInfo(@RequestBody LoadCarsDTO loadCarsDTO) {
String method = "############carsLoadDetailInfo: ";
log.info(method+"请求参数{}",loadCarsDTO);
Long loadId = loadCarsDTO.getLoadId();
try{
//当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(Objects.isNull(myCurrentWarehouse)){
log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse);
return R.fail(400,"仓库信息为空");
}
loadCarsDTO.setWarehouseId(myCurrentWarehouse.getId());
if(Objects.isNull(loadId)){
log.warn(method+"配载计划id为空 loadId={}",loadId);
return R.fail(400,"配载计划id为空");
}
return carsLoadService.carsLoadDetailInfo(loadCarsDTO);
}catch (CustomerException e){
log.error(e.message,e);
return R.fail(e.code,e.message);
}catch (Exception e){
log.error(method+"系统异常",e);
return R.fail(500,"系统异常");
}
}
}

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

@ -10,6 +10,8 @@ import com.logpm.trunkline.vo.TrunklineCarsLoadVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface TrunklineCarsLoadMapper extends BaseMapper<TrunklineCarsLoadEntity> {
@ -27,4 +29,5 @@ public interface TrunklineCarsLoadMapper extends BaseMapper<TrunklineCarsLoadEnt
IPage<TrunklineCarsLoadVO> arriveUnloadPageList(IPage<Object> page, @Param("param") LoadCarsDTO loadCarsDTO);
List<CarsLoadAllOrderVO> findUseOrderListNoPage(@Param("param") LoadCarsDTO loadCarsDTO);
}

52
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadMapper.xml

@ -194,8 +194,8 @@
from logpm_trunkline_cars_order ltco
left join logpm_warehouse_waybill lww on lww.waybill_no = ltco.waybill_no
left join logpm_distribution_parcel_list ldpl on ltco.order_code = ldpl.order_code and ldpl.waybill_number = ltco.waybill_no
where ltco.load_id = #{loadId}
and ltco.final_node_id = #{finalNodeId}
where ltco.load_id = #{param.loadId}
and ltco.final_node_id = #{param.finalNodeId}
and ldpl.is_deleted = 0
and ldpl.order_package_status in ('20','30')
<if test="param.warehouseId != null">
@ -220,6 +220,54 @@
lww.waybill_type
</select>
<select id="findUseOrderListNoPage" resultType="com.logpm.trunkline.vo.CarsLoadAllOrderVO">
select ltco.id carsOrderId,
ltco.order_code orderCode,
ltco.waybill_no waybillNo,
lww.create_time createTime,
lww.destination destination,
lww.destination_warehouse_name destinationWarehouseName,
lww.shipper shipper,
lww.consignee consignee,
lww.consignee_name consigneeName,
lww.customer_train customerTrain,
lww.remark remark,
lww.waybill_type type,
IFNULL(ltco.total_num,0) totalNum,
IF(lww.waybill_type = 1,count( ldpl.id ),SUM(ldpl.quantity)) stockNum,
ltco.plan_num planNum,
ltco.real_num realNum,
IFNULL(TRUNCATE(lww.total_freight/lww.total_count,4),0) price,
IFNULL(TRUNCATE(lww.total_freight/lww.total_count,4),0)*count(ldpl.id) freight
from logpm_trunkline_cars_order ltco
left join logpm_warehouse_waybill lww on lww.waybill_no = ltco.waybill_no
left join logpm_distribution_parcel_list ldpl on ltco.order_code = ldpl.order_code and ldpl.waybill_number = ltco.waybill_no
where ltco.load_id = #{param.loadId}
and ltco.final_node_id = #{param.finalNodeId}
and ldpl.is_deleted = 0
and ldpl.order_package_status in ('20','30')
<if test="param.warehouseId != null">
and ldpl.warehouse_id = #{param.warehouseId}
</if>
group by ltco.id,
ltco.order_code,
ltco.waybill_no,
lww.create_time,
lww.destination,
lww.destination_warehouse_name,
lww.shipper,
lww.consignee,
lww.consignee_name,
lww.customer_train,
lww.remark,
ltco.total_num,
ltco.plan_num,
ltco.real_num,
lww.total_freight,
lww.total_count,
lww.waybill_type
</select>
<select id="tripartiteTransferPageList" resultType="com.logpm.trunkline.vo.TripartiteTransferVO">
select ltcl.id id,
ltcl.cars_no carsNo,

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

@ -113,4 +113,7 @@ public interface ITrunklineCarsLoadService extends BaseService<TrunklineCarsLoad
R updateLoadFeeByNodeId(TrunklineCarsLoadLineVO carsLoadLineVO);
R findCarsLoadingOrderDetail(Long loadId, String orderCode, Long warehouseId);
R carsLoadDetailInfo(LoadCarsDTO loadCarsDTO);
}

70
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/InComingServiceImpl.java

@ -38,45 +38,47 @@ public class InComingServiceImpl implements IInComingService {
String trayCode = inComingDTO.getTrayCode();//托盘码
String trayType = inComingDTO.getTrayType();//打托方式
log.info("############incomingPackage: 包件入库开始 orderPackageCode={} billladingId={} warehouseId={}",orderPackageCode,billladingId,warehouseId);
//包件入库开始
//查询包件是否有数据
QueryWrapper<TrunklineAdvanceDetailEntity> advanceDetailQueryWrapper = new QueryWrapper<>();
advanceDetailQueryWrapper.eq("order_package_code",orderPackageCode)
.eq("warehouse_id",warehouseId);
TrunklineAdvanceDetailEntity advanceDetailEntity = advanceDetailService.getOne(advanceDetailQueryWrapper);
if(Objects.isNull(advanceDetailEntity)){
log.warn("############incomingPackage: 包件不存在 orderPackageCode={} warehouseId={}",orderPackageCode,warehouseId);
return Resp.scanFail(405,"包件无数据","包件无数据");
}
Long advanceDetailId = advanceDetailEntity.getId();
String packageStatus = advanceDetailEntity.getPackageStatus();
if("1".equals(packageStatus)){
log.warn("############incomingPackage: 包件已入库 orderPackageCode={} warehouseId={}",orderPackageCode,warehouseId);
return Resp.scanFail(405,"包件已入库","包件已入库");
}
String[] packageCodes = orderPackageCode.split(",");
for (String packageCode : packageCodes) {
log.info("############incomingPackage: 包件入库开始 packageCode={} billladingId={} warehouseId={}",packageCode,billladingId,warehouseId);
//包件入库开始
//查询包件是否有数据
QueryWrapper<TrunklineAdvanceDetailEntity> advanceDetailQueryWrapper = new QueryWrapper<>();
advanceDetailQueryWrapper.eq("order_package_code",packageCode)
.eq("warehouse_id",warehouseId);
TrunklineAdvanceDetailEntity advanceDetailEntity = advanceDetailService.getOne(advanceDetailQueryWrapper);
if(Objects.isNull(advanceDetailEntity)){
log.warn("############incomingPackage: 包件不存在 packageCode={} warehouseId={}",packageCode,warehouseId);
return Resp.scanFail(405,"包件无数据","包件无数据");
}
Long advanceDetailId = advanceDetailEntity.getId();
String packageStatus = advanceDetailEntity.getPackageStatus();
if("1".equals(packageStatus)){
log.warn("############incomingPackage: 包件已入库 packageCode={} warehouseId={}",packageCode,warehouseId);
return Resp.scanFail(405,"包件已入库","包件已入库");
}
//1.修改暂存单包件入库状态
advanceDetailService.updatePackageStatusById("1",advanceDetailId);
//1.修改暂存单包件入库状态
advanceDetailService.updatePackageStatusById("1",advanceDetailId);
//2.判断包件和订单是否已经存入在库订单
advanceService.saveOrderAndPackage(advanceDetailEntity,warehouseId);
//2.判断包件和订单是否已经存入在库订单
advanceService.saveOrderAndPackage(advanceDetailEntity,warehouseId);
//3.根据是否有提货单id绑定提货单
if(!Objects.isNull(billladingId)){
billladingPackageServicie.saveEntity(orderPackageCode,billladingId,warehouseId,incomingType);
}
//3.根据是否有提货单id绑定提货单
if(!Objects.isNull(billladingId)){
billladingPackageServicie.saveEntity(packageCode,billladingId,warehouseId,incomingType);
}
//4.如果有托盘码
if(StringUtil.isNotBlank(trayCode) && StringUtil.isNotBlank(trayType)){
Map<String,Object> map = new HashMap<>();
map.put("trayType",trayType);
map.put("trayCode",trayCode);
map.put("warehouseId",warehouseId);
map.put("orderPackageCode",orderPackageCode);
warehouseTrayTypeClient.orderScanOrderPackageCode(map);
//4.如果有托盘码
if(StringUtil.isNotBlank(trayCode) && StringUtil.isNotBlank(trayType)){
Map<String,Object> map = new HashMap<>();
map.put("trayType",trayType);
map.put("trayCode",trayCode);
map.put("warehouseId",warehouseId);
map.put("orderPackageCode",packageCode);
warehouseTrayTypeClient.orderScanOrderPackageCode(map);
}
}
return R.success("入库成功");
}
}

46
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceServiceImpl.java

@ -211,29 +211,29 @@ public class TrunklineAdvanceServiceImpl extends BaseServiceImpl<TrunklineAdvanc
log.info("################saveOrderAndPackage: 包件信息保存成功 OrderPackageCode={}",advanceDetailEntity.getOrderPackageCode());
//1.修改订单在库件数和最后入库时间和入库状态
List<DistributionParcelListEntity> parcelListEntityList = parcelListClient.findEntityListByOrderCode(orderCode, warehouseId);
int size = parcelListEntityList.size();
Integer totalNumber = stockArticleEntity.getTotalNumber();//总件数
Integer handQuantity = stockArticleEntity.getHandQuantity();//在库件数
Integer incomingNum = stockArticleEntity.getIncomingNum();//入库件数
if(size == 1){
stockArticleEntity.setWarehouseEntryTime(date);
stockArticleEntity.setWarehouseEntryTimeEnd(new Date());
stockArticleEntity.setHandQuantity(handQuantity+1);
stockArticleEntity.setIncomingNum(incomingNum+1);
}else{
stockArticleEntity.setWarehouseEntryTimeEnd(new Date());
stockArticleEntity.setHandQuantity(handQuantity+1);
stockArticleEntity.setIncomingNum(incomingNum+1);
}
if(incomingNum+1 < totalNumber){
stockArticleEntity.setOrderStatus("10");
}else{
stockArticleEntity.setOrderStatus("20");
}
stockArticleClient.saveOrUpdate(stockArticleEntity);
// List<DistributionParcelListEntity> parcelListEntityList = parcelListClient.findEntityListByOrderCode(orderCode, warehouseId);
// int size = parcelListEntityList.size();
// Integer totalNumber = stockArticleEntity.getTotalNumber();//总件数
// Integer handQuantity = stockArticleEntity.getHandQuantity();//在库件数
// Integer incomingNum = stockArticleEntity.getIncomingNum();//入库件数
//
// if(size == 1){
// stockArticleEntity.setWarehouseEntryTime(date);
// stockArticleEntity.setWarehouseEntryTimeEnd(new Date());
// stockArticleEntity.setHandQuantity(handQuantity+1);
// stockArticleEntity.setIncomingNum(incomingNum+1);
// }else{
// stockArticleEntity.setWarehouseEntryTimeEnd(new Date());
// stockArticleEntity.setHandQuantity(handQuantity+1);
// stockArticleEntity.setIncomingNum(incomingNum+1);
// }
//
// if(incomingNum+1 < totalNumber){
// stockArticleEntity.setOrderStatus("10");
// }else{
// stockArticleEntity.setOrderStatus("20");
// }
// stockArticleClient.saveOrUpdate(stockArticleEntity);
}
log.info("#############saveOrderAndPackage: 订单包件信息保存完成 OrderPackageCode={}",advanceDetailEntity.getOrderPackageCode());
}

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

@ -878,6 +878,15 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
Map<String,Object> map = new HashMap<>();
map.put("carsLoadEntity",loadEntity);
map.put("allCarsLineList",allCarsLineList);
List<DictBiz> loadingType = DictBizCache.getList(DictBizConstant.CARS_LOADING_TYPE);
map.put("loadingType",loadingType);
List<DictBiz> chargeType = DictBizCache.getList(DictBizConstant.BILLLADING_CHARGE_TYPE);
map.put("chargeType",chargeType);
List<DictBiz> loadType = DictBizCache.getList(DictBizConstant.CARS_LOAD_TYPE);
map.put("loadType",loadType);
BasicdataWarehouseEntity basicdataWarehouseEntity = basicdataWarehouseClient.getEntityWarehouseId(warehouseId);
map.put("warehouseId",basicdataWarehouseEntity.getId());
map.put("warehouseName",basicdataWarehouseEntity.getName());
// map.put("moreCarsLineList",moreCarsLineList);
return R.data(map);
}
@ -920,12 +929,13 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
@Override
public R findUseOrderList(LoadCarsDTO loadCarsDTO) {
IPage<Object> page = new Page<>();
page.setCurrent(loadCarsDTO.getPageNum());
page.setSize(loadCarsDTO.getPageSize());
// IPage<Object> page = new Page<>();
// page.setCurrent(loadCarsDTO.getPageNum());
// page.setSize(loadCarsDTO.getPageSize());
IPage<CarsLoadAllOrderVO> pageList = baseMapper.findUseOrderList(page,loadCarsDTO);
return R.data(pageList);
// IPage<CarsLoadAllOrderVO> pageList = baseMapper.findUseOrderList(page,loadCarsDTO);
List<CarsLoadAllOrderVO> lsit = baseMapper.findUseOrderListNoPage(loadCarsDTO);
return R.data(lsit);
}
@Override
@ -1829,6 +1839,30 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
return R.data(orderScanDetailList);
}
@Override
public R carsLoadDetailInfo(LoadCarsDTO loadCarsDTO) {
Long loadId = loadCarsDTO.getLoadId();
//查询配载计划
TrunklineCarsLoadEntity carsLoadEntity = baseMapper.selectById(loadId);
if(Objects.isNull(carsLoadEntity)){
log.warn("###################carsLoadDetailInfo: 配载计划信息为空 loadId={}",loadId);
return R.fail(405,"配载计划信息为空");
}
List<TrunklineCarsLoadLineEntity> loadLineList = trunklineCarsLoadLineService.findListByLoadId(loadId);
TrunklineCarsLoadVO trunklineCarsLoadVO = new TrunklineCarsLoadVO();
BeanUtil.copy(carsLoadEntity,trunklineCarsLoadVO);
trunklineCarsLoadVO.setCarsLoadLineList(loadLineList);
// trunklineCarsOrderService.find
return null;
}
@Override
public R loadingTrayInfo(LoadCarsDTO loadCarsDTO) {
log.info("##############loadingTrayInfo: 查询托盘的货物信息");

Loading…
Cancel
Save