Browse Source

1.bug修复

single_db
zhenghaoyu 1 year ago
parent
commit
68eccd911f
  1. 15
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/AdvanceDetailMapper.xml
  2. 3
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/OrderMapper.xml
  3. 125
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/CarsLoadController.java
  4. 9
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadMapper.xml
  5. 2
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsOrderMapper.java
  6. 7
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsOrderMapper.xml
  7. 3
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadService.java
  8. 2
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsOrderService.java
  9. 80
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java
  10. 5
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsOrderEntityServiceImpl.java

15
blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/AdvanceDetailMapper.xml

@ -76,14 +76,19 @@
<select id="getSupplyData" resultType="Map">
SELECT
wo.waybill_no logiBillNo,
wb.waybill_no logiBillNo,
wb.warehouse_name destinationWarehouse,
cast (wb.warehouse_id as char) destinationWarehouseId,
wb.take_company takeCompany
FROM ht_advance_detail d
left join ht_waybill_order wo on wo.advance_id = d.advance_id and wo.delete_time = 0 and wo.status!=-1
left join ht_way_bill wb on wb.id = wo.way_bill_id and wb.delete_time = 0
where d.unitNo = #{unitNo}
FROM
ht_advance_detail d
LEFT JOIN ht_advance ha ON ha.id = d.advance_id
AND ha.delete_time = 0
LEFT JOIN ht_way_bill wb ON wb.waybill_no = ha.waybill_no
AND wb.delete_time = 0
WHERE
d.unitNo = #{unitNo}
and d.delete_time = 0
</select>

3
blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/OrderMapper.xml

@ -54,8 +54,7 @@
left join `ht_order_count` i on `o`.order_code = i.orderSelfNum
where 1=1
AND `i`.`delete_time` = '0'
and `i`.warehouse_id = 30
and `o`.is_update = 0
and `i`.warehouse_id = #{oldWarehouseId}
<if test="param != null and param != ''">
AND t.orderSelfNum = #{param}
</if>

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

@ -9,7 +9,6 @@ import com.logpm.trunkline.dto.TrunklineCarsLoadDTO;
import com.logpm.trunkline.dto.TrunklineCarsLoadLineDTO;
import com.logpm.trunkline.dto.TrunklineCarsOrderDTO;
import com.logpm.trunkline.service.ITrunklineCarsLoadService;
import com.logpm.trunkline.vo.TrunklineCarsLoadLineVO;
import com.logpm.trunkline.vo.TrunklineCarsLoadVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@ -156,8 +155,16 @@ public class CarsLoadController {
String method = "############updateCarsLoadBasicData: ";
log.info(method+"请求参数{}",carsLoadDTO);
Long loadId = carsLoadDTO.getId();//配载计划id
String loadingType = carsLoadDTO.getLoadingType();//装车方式 1=手动装车,2=扫描装车
BigDecimal countTransportCost = carsLoadDTO.getCountTransportCost();//合计运费
Long driverId = carsLoadDTO.getDriverId();
Long assistantId = carsLoadDTO.getAssistantId();
String driverName = carsLoadDTO.getDriverName();
String driverMobile = carsLoadDTO.getDriverMobile();
Long carId = carsLoadDTO.getCarId();
String chargeType = carsLoadDTO.getChargeType();
String carNumber = carsLoadDTO.getCarNumber();
String remark = carsLoadDTO.getRemark();
String loadType = carsLoadDTO.getLoadType();
try{
//当前登录人选择的仓库
@ -172,19 +179,42 @@ public class CarsLoadController {
return R.fail(400,"配载id为空");
}
if(StringUtil.isBlank(loadingType)){
log.warn(method+"装车类型为空 loadingType={}",loadingType);
return R.fail(400,"装车类型为空");
if(Objects.isNull(assistantId)){
log.warn(method+"副驾id为空 assistantId={}",assistantId);
return R.fail(400,"副驾id为空");
}
if(!"1".equals(loadingType) && !"2".equals(loadingType)){
log.warn(method+"装车类型值不正确 loadingType={}",loadingType);
return R.fail(400,"装车类型值不正确");
if(Objects.isNull(driverId)){
log.warn(method+"司机id为空 driverId={}",driverId);
return R.fail(400,"司机id为空");
}
if(Objects.isNull(countTransportCost)){
log.warn(method+"合计运费为空 countTransportCost={}",countTransportCost);
return R.fail(400,"合计运费为空");
if(StringUtil.isBlank(driverName)){
log.warn(method+"司机名称为空 driverName={}",driverName);
return R.fail(400,"司机名称为空");
}
if(StringUtil.isBlank(driverMobile)){
log.warn(method+"司机电话为空 driverMobile={}",driverMobile);
return R.fail(400,"司机电话为空");
}
if(Objects.isNull(carId)){
log.warn(method+"车辆id为空 carId={}",carId);
return R.fail(400,"车辆id为空");
}
if(StringUtil.isBlank(chargeType)){
log.warn(method+"分摊方式为空 chargeType={}",chargeType);
return R.fail(400,"分摊方式为空");
}
if(StringUtil.isBlank(carNumber)){
log.warn(method+"车牌号为空 carNumber={}",carNumber);
return R.fail(400,"车牌号为空");
}
if(StringUtil.isBlank(loadType)){
log.warn(method+"配载类型为空 loadType={}",loadType);
return R.fail(400,"配载类型为空");
}
return carsLoadService.updateCarsLoadBasicData(carsLoadDTO,myCurrentWarehouse.getId());
}catch (CustomerException e){
@ -1032,9 +1062,23 @@ public class CarsLoadController {
@PostMapping("/updateLoadFeeByNodeId")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "更新配载计划节点费用信息", notes = "传入loadCarsDTO")
public R updateLoadFeeByNodeId(@RequestBody TrunklineCarsLoadLineVO carsLoadLineVO) {
public R updateLoadFeeByNodeId(@RequestBody TrunklineCarsLoadDTO carsLoadDTO) {
String method = "############updateLoadFeeByNodeId: ";
log.info(method + "请求参数{}", carsLoadLineVO);
log.info(method + "请求参数{}", carsLoadDTO);
Long loadId = carsLoadDTO.getId();//配载计划id
Long carId = carsLoadDTO.getCarId();
String carNumber = carsLoadDTO.getCarNumber();
Long driverId = carsLoadDTO.getDriverId();
Long assistantId = carsLoadDTO.getAssistantId();
String driverName = carsLoadDTO.getDriverName();
String driverMobile = carsLoadDTO.getDriverMobile();
String loadingType = carsLoadDTO.getLoadingType();
String chargeType = carsLoadDTO.getChargeType();
String loadType = carsLoadDTO.getLoadType();
BigDecimal countTransportCost = carsLoadDTO.getCountTransportCost();
List<TrunklineCarsLoadLineDTO> carsLoadLineList = carsLoadDTO.getCarsLoadLineList();
try{
//当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
@ -1042,7 +1086,58 @@ public class CarsLoadController {
log.warn(method + "仓库信息为空 myCurrentWarehouse={}", myCurrentWarehouse);
return R.fail(405, "仓库信息为空");
}
return carsLoadService.updateLoadFeeByNodeId(carsLoadLineVO);
if(Objects.isNull(loadId)){
log.warn(method+"配载id为空 loadId={}",loadId);
return R.fail(400,"配载id为空");
}
if(Objects.isNull(countTransportCost)){
log.warn(method+"合计费用为空 countTransportCost={}",countTransportCost);
return R.fail(400,"合计费用为空");
}
if(Objects.isNull(driverId)){
log.warn(method+"司机id为空 driverId={}",driverId);
return R.fail(400,"司机id为空");
}
if(StringUtil.isBlank(loadingType)){
log.warn(method+"装车方式为空 loadingType={}",loadingType);
return R.fail(400,"装车方式为空");
}
if(StringUtil.isBlank(driverName)){
log.warn(method+"司机名称为空 driverName={}",driverName);
return R.fail(400,"司机名称为空");
}
if(StringUtil.isBlank(driverMobile)){
log.warn(method+"司机电话为空 driverMobile={}",driverMobile);
return R.fail(400,"司机电话为空");
}
if(Objects.isNull(carId)){
log.warn(method+"车辆id为空 carId={}",carId);
return R.fail(400,"车辆id为空");
}
if(StringUtil.isBlank(chargeType)){
log.warn(method+"分摊方式为空 chargeType={}",chargeType);
return R.fail(400,"分摊方式为空");
}
if(StringUtil.isBlank(carNumber)){
log.warn(method+"车牌号为空 carNumber={}",carNumber);
return R.fail(400,"车牌号为空");
}
if(StringUtil.isBlank(loadType)){
log.warn(method+"配载类型为空 loadType={}",loadType);
return R.fail(400,"配载类型为空");
}
if(Objects.isNull(carsLoadLineList) || carsLoadLineList.size() == 0){
log.warn(method+"节点信息为空 carsLoadLineList={}",carsLoadLineList);
return R.fail(400,"节点信息为空");
}
return carsLoadService.updateLoadFeeByNodeId(carsLoadDTO,myCurrentWarehouse.getId());
}catch (CustomerException e){
log.error(e.message,e);
return R.fail(e.code,e.message);

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

@ -21,6 +21,7 @@
ltcl.start_time startTime,
ltcl.create_user_name createUserName,
ltcl.create_time createTime,
ltcl.now_warehouse_id nowWarehouseId,
sum(ltcll.now_transport_cost) nowTransportCost,
sum(ltcll.oil_cost) oilCost,
sum(ltcll.back_transport_cost) backTransportCost,
@ -54,7 +55,8 @@
ltcl.start_warehouse_name,
ltcl.end_warehouse_names,
ltcl.arrive_time,
ltcl.start_time
ltcl.start_time,
ltcl.now_warehouse_id
</select>
@ -76,6 +78,7 @@
ltcl.start_time startTime,
ltcl.create_user_name createUserName,
ltcl.create_time createTime,
ltcl.now_warehouse_id nowWarehouseId,
sum(ltcll.now_transport_cost) nowTransportCost,
sum(ltcll.oil_cost) oilCost,
sum(ltcll.back_transport_cost) backTransportCost,
@ -139,9 +142,9 @@
where ldsa.is_deleted = 0
and ldpl.order_package_status in ('20','30')
and ldpl.is_deleted = 0
<if test="param.ordercodes != null">
<if test="param.orderCodes != null">
and concat(ldsa.order_code,',',ldpl.waybill_number) not in
<foreach collection="param.ordercodes" item="item" open="(" separator="," close=")">
<foreach collection="param.orderCodes" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>

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

@ -25,4 +25,6 @@ public interface TrunklineCarsOrderMapper extends BaseMapper<TrunklineCarsOrderE
List<LoadScanOrderVO> findLoadScanPackageWithOrder(@Param("loadId") Long loadId, @Param("warehouseId") Long warehouseId);
void deleteByCarsOrderId(@Param("carsOrderId") Long carsOrderId);
List<String> findUseOrderWaybilllList(@Param("loadId") Long loadId, @Param("warehouseId") Long warehouseId);
}

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

@ -94,4 +94,11 @@
where id = #{carsOrderId}
</delete>
<select id="findUseOrderWaybilllList" resultType="string">
select concat(order_code,',',waybill_no)
from logpm_trunkline_cars_order
where load_id = #{loadId}
and node_id = #{warehouseId}
</select>
</mapper>

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

@ -5,7 +5,6 @@ import com.logpm.trunkline.dto.LoadCarsDTO;
import com.logpm.trunkline.dto.TrunklineCarsLoadDTO;
import com.logpm.trunkline.entity.TrunklineCarsLoadEntity;
import com.logpm.trunkline.vo.TripartiteTransferVO;
import com.logpm.trunkline.vo.TrunklineCarsLoadLineVO;
import com.logpm.trunkline.vo.TrunklineCarsLoadVO;
import org.springblade.core.mp.base.BaseService;
import org.springblade.core.tool.api.R;
@ -110,7 +109,7 @@ public interface ITrunklineCarsLoadService extends BaseService<TrunklineCarsLoad
R findLoadFeeByNodeId(Long loadId,Long warehouseId);
R updateLoadFeeByNodeId(TrunklineCarsLoadLineVO carsLoadLineVO);
R updateLoadFeeByNodeId(TrunklineCarsLoadDTO carsLoadDTO,Long warehouseId);
R findCarsLoadingOrderDetail(Long loadId, String orderCode, Long warehouseId);

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

@ -22,4 +22,6 @@ public interface ITrunklineCarsOrderService extends BaseService<TrunklineCarsOrd
List<UnloadZeroVO> findUnloadZeroList(Long loadId, Long warehouseId);
List<LoadScanOrderVO> findLoadScanPackageWithOrder(Long loadId, Long warehouseId);
List<String> findUseOrderWaybilllList(Long loadId, Long warehouseId);
}

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

@ -894,17 +894,29 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
@Override
public R updateCarsLoadBasicData(TrunklineCarsLoadDTO carsLoadDTO, Long warehouseId) {
Long loadId = carsLoadDTO.getId();
String loadingType = carsLoadDTO.getLoadingType();
BigDecimal countTransportCost = carsLoadDTO.getCountTransportCost();
Long driverId = carsLoadDTO.getDriverId();
Long assistantId = carsLoadDTO.getAssistantId();
String driverName = carsLoadDTO.getDriverName();
String driverMobile = carsLoadDTO.getDriverMobile();
Long carId = carsLoadDTO.getCarId();
String chargeType = carsLoadDTO.getChargeType();
String carNumber = carsLoadDTO.getCarNumber();
String remark = carsLoadDTO.getRemark();
String loadType = carsLoadDTO.getLoadType();
TrunklineCarsLoadEntity carsLoadEntity = baseMapper.selectById(loadId);
if(Objects.isNull(carsLoadEntity)){
log.warn("###############updateCarsLoadBasicData: 配载计划不存在 loadId={}",loadId);
return R.fail(405,"配载计划不存在");
}
carsLoadEntity.setLoadingType(loadingType);
carsLoadEntity.setCountTransportCost(countTransportCost);
carsLoadEntity.setDriverId(driverId);
carsLoadEntity.setAssistantId(assistantId);
carsLoadEntity.setDriverName(driverName);
carsLoadEntity.setDriverMobile(driverMobile);
carsLoadEntity.setCarId(carId);
carsLoadEntity.setChargeType(chargeType);
carsLoadEntity.setCarNumber(carNumber);
carsLoadEntity.setLoadType(loadType);
carsLoadEntity.setRemark(remark);
updateById(carsLoadEntity);
@ -922,7 +934,14 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
IPage<Object> page = new Page<>();
page.setCurrent(loadCarsDTO.getPageNum());
page.setSize(loadCarsDTO.getPageSize());
Long loadId = loadCarsDTO.getLoadId();
Long warehouseId = loadCarsDTO.getWarehouseId();
if(!Objects.isNull(loadId)){
List<String> orderCodes = trunklineCarsOrderService.findUseOrderWaybilllList(loadId,warehouseId);
if(!Objects.isNull(orderCodes) && orderCodes.size() > 0){
loadCarsDTO.setOrderCodes(orderCodes);
}
}
IPage<CarsLoadAllOrderVO> pageList = baseMapper.findAllOrderList(page,loadCarsDTO);
return R.data(pageList);
}
@ -1810,11 +1829,8 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
}
@Override
public R updateLoadFeeByNodeId(TrunklineCarsLoadLineVO carsLoadLineVO) {
trunklineCarsLoadLineService.updateById(carsLoadLineVO);
Long loadId = carsLoadLineVO.getLoadId();
public R updateLoadFeeByNodeId(TrunklineCarsLoadDTO carsLoadDTO,Long warehouseId) {
Long loadId = carsLoadDTO.getId();
TrunklineCarsLoadEntity carsLoadEntity = baseMapper.selectById(loadId);
if(Objects.isNull(carsLoadEntity)){
@ -1822,12 +1838,50 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
return R.fail(405,"配载计划信息不存在");
}
//重新计算配载计划的费用
BigDecimal countTransportCost = trunklineCarsLoadLineService.getAllNodeFee(loadId);
carsLoadEntity.setCountTransportCost(countTransportCost);
Long carId = carsLoadDTO.getCarId();
String carNumber = carsLoadDTO.getCarNumber();
Long driverId = carsLoadDTO.getDriverId();
Long assistantId = carsLoadDTO.getAssistantId();
String driverName = carsLoadDTO.getDriverName();
String driverMobile = carsLoadDTO.getDriverMobile();
String loadingType = carsLoadDTO.getLoadingType();
String chargeType = carsLoadDTO.getChargeType();
String loadType = carsLoadDTO.getLoadType();
BigDecimal countTransportCost = carsLoadDTO.getCountTransportCost();
carsLoadEntity.setCarId(carId);
carsLoadEntity.setCarNumber(carNumber);
carsLoadEntity.setDriverId(driverId);
carsLoadEntity.setDriverName(driverName);
carsLoadEntity.setDriverMobile(driverMobile);
carsLoadEntity.setAssistantId(assistantId);
carsLoadEntity.setLoadingType(loadingType);
carsLoadEntity.setChargeType(chargeType);
carsLoadEntity.setLoadType(loadType);
carsLoadEntity.setCountTransportCost(countTransportCost);
updateById(carsLoadEntity);
List<TrunklineCarsLoadLineDTO> carsLoadLineList = carsLoadDTO.getCarsLoadLineList();
for (TrunklineCarsLoadLineDTO carsLoadLineDTO : carsLoadLineList) {
Long loadCarsLineId = carsLoadLineDTO.getId();
TrunklineCarsLoadLineEntity loadLineEntity = trunklineCarsLoadLineService.getById(loadCarsLineId);
loadLineEntity.setNowTransportCost(carsLoadLineDTO.getNowTransportCost());
loadLineEntity.setOilCost(carsLoadLineDTO.getOilCost());
loadLineEntity.setBackTransportCost(carsLoadLineDTO.getBackTransportCost());
loadLineEntity.setReachTransportCost(carsLoadLineDTO.getReachTransportCost());
loadLineEntity.setWholeCarInfoCost(carsLoadLineDTO.getWholeCarInfoCost());
loadLineEntity.setWholeCarInsuranceCost(carsLoadLineDTO.getWholeCarInsuranceCost());
loadLineEntity.setWholeCarGroundCost(carsLoadLineDTO.getWholeCarGroundCost());
loadLineEntity.setHairWholeCost(carsLoadLineDTO.getHairWholeCost());
loadLineEntity.setHairWholeOtherCost(carsLoadLineDTO.getHairWholeOtherCost());
loadLineEntity.setUnloadCost(carsLoadLineDTO.getUnloadCost());
loadLineEntity.setUnloadOtherCost(carsLoadLineDTO.getUnloadOtherCost());
loadLineEntity.setFuel(carsLoadLineDTO.getFuel());
loadLineEntity.setTollFee(carsLoadLineDTO.getTollFee());
trunklineCarsLoadLineService.updateById(loadLineEntity);
}
return R.success("修改成功");
}

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

@ -52,4 +52,9 @@ public class TrunklineCarsOrderEntityServiceImpl extends BaseServiceImpl<Trunkli
return baseMapper.findLoadScanPackageWithOrder(loadId,warehouseId);
}
@Override
public List<String> findUseOrderWaybilllList(Long loadId, Long warehouseId) {
return baseMapper.findUseOrderWaybilllList(loadId,warehouseId);
}
}

Loading…
Cancel
Save