diff --git a/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/feign/IAftersalesAbnormalRecordClient.java b/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/feign/IAftersalesAbnormalRecordClient.java index 6721bec69..4ce50939c 100644 --- a/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/feign/IAftersalesAbnormalRecordClient.java +++ b/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/feign/IAftersalesAbnormalRecordClient.java @@ -16,6 +16,7 @@ */ package com.logpm.aftersales.feign; +import com.alibaba.fastjson.JSONObject; import com.logpm.aftersales.entity.AftersalesAbnormalRecordEntity; import org.springblade.common.constant.ModuleNameConstant; import org.springframework.cloud.openfeign.FeignClient; @@ -48,5 +49,12 @@ public interface IAftersalesAbnormalRecordClient { List findAbnormalList(@RequestParam("carsNo") String carsNo); @GetMapping(API_PREFIX+"/findListByCarsNoAndUpWarehouseId") - Map findListByCarsNoAndUpWarehouseId(@RequestParam("carsNo") String carsNo, @RequestParam("warehouseId") Long warehouseId); + JSONObject findListByCarsNoAndUpWarehouseId(@RequestParam("carsNo") String carsNo, @RequestParam("warehouseId") Long warehouseId); + + @GetMapping(API_PREFIX+"/findOrderPackageAndAbnormalStatus") + List findOrderPackageAndAbnormalStatus(@RequestParam("orderPackageCode") String orderPackageCode, @RequestParam("abnormalStatus") String abnormalStatus); + + @PostMapping(API_PREFIX+"/updateList") + void updateList(@RequestBody List abnormalRecordEntities); + } diff --git a/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/OpenOrderDTO.java b/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/OpenOrderDTO.java index ab14c07b0..392b63911 100644 --- a/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/OpenOrderDTO.java +++ b/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/OpenOrderDTO.java @@ -1,5 +1,6 @@ package com.logpm.trunkline.dto; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.io.Serializable; @@ -28,8 +29,8 @@ public class OpenOrderDTO implements Serializable { private List advanceIds;//暂存单ids private String orderCode;//订单号 private String openOrderDate;//开单时间 - private String dearCode;//商场编码 - private String dearName;//商场名称 + private String dealerCode;//商场编码 + private String dealerName;//商场名称 private Long shipperId;//发货单位id private String shipper;//发货单位 @@ -106,4 +107,12 @@ public class OpenOrderDTO implements Serializable { private String editResonCode;//改单原因编码 private String editReson;//改单原因 + private Integer pickupCompleteOrNot;//提货是否整车 0否 1是 + + private Integer trunklineCompleteOrNot;//干线是否整车 0否 1是 + + private String trunklineVehicleType;//提货车型 + + private String pickupVehicleType;//提货车型 + } diff --git a/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/CarsLoadAllOrderVO.java b/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/CarsLoadAllOrderVO.java index 917f9d485..26db069fe 100644 --- a/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/CarsLoadAllOrderVO.java +++ b/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/CarsLoadAllOrderVO.java @@ -11,6 +11,7 @@ public class CarsLoadAllOrderVO implements Serializable { private Long carsOrderId;//id private String orderCode;//订单号 + private Long waybillId;//运单id private String waybillNo;//运单号 private Date createTime;//创建时间 private String destination;//到站 diff --git a/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseWaybillEntity.java b/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseWaybillEntity.java index 037ab761e..344aba1e8 100644 --- a/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseWaybillEntity.java +++ b/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseWaybillEntity.java @@ -452,11 +452,21 @@ public class WarehouseWaybillEntity extends TenantEntity { private String departureCode; @ApiModelProperty(value = "商场编码") - private String dearCode; + private String dealerCode; @ApiModelProperty(value = "商场名称") - private String dearName; + private String dealerName; + @ApiModelProperty(value = "提货是否整车 0否 1是") + private Integer pickupCompleteOrNot; + @ApiModelProperty(value = "干线是否整车 0否 1是") + private Integer trunklineCompleteOrNot; + + @ApiModelProperty(value = "干线车型 ") + private String trunklineVehicleType; + + @ApiModelProperty(value = "提货车型 ") + private String pickupVehicleType; } diff --git a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/feign/AftersalesAbnormalRecordClient.java b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/feign/AftersalesAbnormalRecordClient.java index 99942a6a2..3e5e07f78 100644 --- a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/feign/AftersalesAbnormalRecordClient.java +++ b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/feign/AftersalesAbnormalRecordClient.java @@ -1,5 +1,6 @@ package com.logpm.aftersales.feign; +import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.logpm.aftersales.entity.AftersalesAbnormalRecordEntity; import com.logpm.aftersales.service.IAftersalesAbnormalRecordService; @@ -8,7 +9,6 @@ import org.springframework.web.bind.annotation.RestController; import springfox.documentation.annotations.ApiIgnore; import java.util.List; -import java.util.Map; @ApiIgnore() @RestController @@ -31,7 +31,22 @@ public class AftersalesAbnormalRecordClient implements IAftersalesAbnormalRecord } @Override - public Map findListByCarsNoAndUpWarehouseId(String carsNo, Long warehouseId) { + public JSONObject findListByCarsNoAndUpWarehouseId(String carsNo, Long warehouseId) { return aftersalesAbnormalRecordService.findListByCarsNoAndUpWarehouseId(carsNo,warehouseId); } + + @Override + public List findOrderPackageAndAbnormalStatus(String orderPackageCode, String abnormalStatus) { + //查询AftersalesAbnormalRecordEntity的list通过aftersalesAbnormalRecordService使用orderPackageCode和abnormalStatus + //返回list + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("order_package_code",orderPackageCode) + .eq("abnormal_status",abnormalStatus); + return aftersalesAbnormalRecordService.list(queryWrapper); + } + + @Override + public void updateList(List abnormalRecordEntities) { + aftersalesAbnormalRecordService.updateBatchById(abnormalRecordEntities); + } } diff --git a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/jobhandler/AftersalesXxlJob.java b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/jobhandler/AftersalesXxlJob.java index ccd53fe71..cfd311e7e 100644 --- a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/jobhandler/AftersalesXxlJob.java +++ b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/jobhandler/AftersalesXxlJob.java @@ -119,13 +119,15 @@ public class AftersalesXxlJob { BasicdataWarehouseEntity warehouseEntity = basicdataWarehouseClient.getEntityWarehouseId(basicdataWarehouseEntity.getId()); if (ObjectUtil.isNotEmpty(warehouseEntity)) { - basicdataWarehouseEntity.setCode(warehouseEntity.getCode()); + basicdataWarehouseEntity.setWarehouseCode(warehouseEntity.getWarehouseCode()); } // 完善数据 List packageEntityList = new ArrayList<>(); AftersalesAbnormalPackageEntity aftersalesAbnormalPackageEntity = new AftersalesAbnormalPackageEntity(); + aftersalesAbnormalPackageEntity.setTenantId(bladeUser.getTenantId()); + aftersalesAbnormalPackageEntity.setCreateUser(bladeUser.getUserId()); aftersalesAbnormalPackageEntity.setPackageCode(aftersalesAbnormalRecordEntity.getOrderPackageCode()); aftersalesAbnormalPackageEntity.setWaybillNumber(aftersalesAbnormalRecordEntity.getWaybillNo()); aftersalesAbnormalPackageEntity.setOrderCode(aftersalesAbnormalRecordEntity.getOrderCode()); @@ -147,7 +149,7 @@ public class AftersalesXxlJob { aftersalesWorkOrder.setWaybillNumber(aftersalesAbnormalRecordEntity.getWaybillNo()); aftersalesWorkOrder.setOrderCode(aftersalesAbnormalRecordEntity.getOrderCode()); - WarehouseWaybillEntity byWaybillNo = wallBillOrderService.findByWaybillNo(aftersalesWorkOrder.getWorkOrderNumber()); + WarehouseWaybillEntity byWaybillNo = wallBillOrderService.findByWaybillNo(aftersalesWorkOrder.getWaybillNumber()); if (byWaybillNo != null) { aftersalesWorkOrder.setWaybillMall(byWaybillNo.getConsignee()); } @@ -158,21 +160,47 @@ public class AftersalesXxlJob { List processorEntityList = new ArrayList<>(); - AftersalesProcessorEntity aftersalesProcessorEntity = new AftersalesProcessorEntity(); - aftersalesProcessorEntity.setWarehouseId(entityByCarsNo.getStartWarehouseId()); + //责任方 - aftersalesProcessorEntity.setTypesOf("1"); + AftersalesProcessorEntity aftersalesProcessorEntity = new AftersalesProcessorEntity(); + aftersalesProcessorEntity.setWarehouseId(warehouseEntity.getId()); + aftersalesProcessorEntity.setBusinessId(entityByCarsNo.getStartWarehouseId()); + BasicdataWarehouseEntity entityWarehouseId = basicdataWarehouseClient.getEntityWarehouseId(entityByCarsNo.getStartWarehouseId()); + + if(entityWarehouseId!=null){ + aftersalesProcessorEntity.setBusinessName(entityWarehouseId.getName()); + } + + aftersalesProcessorEntity.setTypesOf("1"); + aftersalesProcessorEntity.setTenantId(bladeUser.getTenantId()); + aftersalesProcessorEntity.setCreateUser(bladeUser.getUserId()); + aftersalesProcessorEntity.setConditions("1"); processorEntityList.add(aftersalesProcessorEntity); + // 处理方 + AftersalesProcessorEntity aftersalesProcessorEntity1 = new AftersalesProcessorEntity(); + aftersalesProcessorEntity1.setWarehouseId(warehouseEntity.getId()); + aftersalesProcessorEntity1.setBusinessName(warehouseEntity.getName()); + aftersalesProcessorEntity1.setBusinessId(warehouseEntity.getId()); + aftersalesProcessorEntity1.setTypesOf("2"); + aftersalesProcessorEntity1.setTenantId(bladeUser.getTenantId()); + aftersalesProcessorEntity1.setCreateUser(bladeUser.getUserId()); + aftersalesProcessorEntity1.setConditions("1"); + processorEntityList.add(aftersalesProcessorEntity1); + aftersalesWorkOrder.setProcessorEntityList(processorEntityList); - //责任人 + + + + //责任人 List personResponsibleDTO = new ArrayList<>(); AftersalesPersonResponsibleDTO aftersalesPersonResponsibleDTO = new AftersalesPersonResponsibleDTO(); - + aftersalesPersonResponsibleDTO.setTenantId(bladeUser.getTenantId()); + aftersalesPersonResponsibleDTO.setCreateUser(aftersalesAbnormalRecordEntity.getCreateUser()); aftersalesPersonResponsibleDTO.setTypesOf("1"); // 需要获取到仓库的负责人 @@ -182,7 +210,7 @@ public class AftersalesXxlJob { aftersalesPersonResponsibleDTO.setPersonResponsibleId(wareManagerUser.get("userId").toString()); aftersalesPersonResponsibleDTO.setPersonResponsibleName(wareManagerUser.get("userName").toString()); } - warehouseEntity = basicdataWarehouseClient.getEntityWarehouseId(aftersalesProcessorEntity.getWarehouseId()); +// warehouseEntity = basicdataWarehouseClient.getEntityWarehouseId(aftersalesProcessorEntity.getWarehouseId()); aftersalesPersonResponsibleDTO.setResponsibilityRatio("100"); aftersalesPersonResponsibleDTO.setTypesOf("1"); aftersalesPersonResponsibleDTO.setDifference("1"); diff --git a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesAbnormalRecordMapper.java b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesAbnormalRecordMapper.java index 5ba277203..2b404a69e 100644 --- a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesAbnormalRecordMapper.java +++ b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesAbnormalRecordMapper.java @@ -1,5 +1,6 @@ package com.logpm.aftersales.mapper; +import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.logpm.aftersales.dto.AbnormalRecordDTO; @@ -7,13 +8,11 @@ import com.logpm.aftersales.entity.AftersalesAbnormalRecordEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; -import java.util.Map; - @Mapper public interface AftersalesAbnormalRecordMapper extends BaseMapper { IPage findPageList(IPage page, @Param("param") AbnormalRecordDTO abnormalRecordDTO); - Map findListByCarsNoAndUpWarehouseId(@Param("carsNo") String carsNo, @Param("warehouseId") Long warehouseId); + JSONObject findListByCarsNoAndUpWarehouseId(@Param("carsNo") String carsNo, @Param("warehouseId") Long warehouseId); } diff --git a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesAbnormalRecordMapper.xml b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesAbnormalRecordMapper.xml index d34507952..0d1c8059e 100644 --- a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesAbnormalRecordMapper.xml +++ b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesAbnormalRecordMapper.xml @@ -42,9 +42,9 @@ order by up_time desc - + select IFNULL(sum(IF(abnormal_status != 1,1,0)),0) dealwithNum, + IFNULL(sum(IF(abnormal_status = 1,1,0)),0) noDealwithNum from logpm_aftersales_abnormal_record where cars_no = #{carsNo} and up_warehouse_id = #{warehouseId} diff --git a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/IAftersalesAbnormalRecordService.java b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/IAftersalesAbnormalRecordService.java index d8791e2de..b19900864 100644 --- a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/IAftersalesAbnormalRecordService.java +++ b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/IAftersalesAbnormalRecordService.java @@ -1,16 +1,15 @@ package com.logpm.aftersales.service; +import com.alibaba.fastjson.JSONObject; import com.logpm.aftersales.dto.AbnormalRecordDTO; import com.logpm.aftersales.entity.AftersalesAbnormalRecordEntity; import org.springblade.core.mp.base.BaseService; import org.springblade.core.tool.api.R; -import java.util.Map; - public interface IAftersalesAbnormalRecordService extends BaseService { R findPageList(AbnormalRecordDTO abnormalRecordDTO); R dealAbnormal(AbnormalRecordDTO abnormalRecordDTO); - Map findListByCarsNoAndUpWarehouseId(String carsNo, Long warehouseId); + JSONObject findListByCarsNoAndUpWarehouseId(String carsNo, Long warehouseId); } diff --git a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesAbnormalRecordServiceImpl.java b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesAbnormalRecordServiceImpl.java index bd238e5d3..31fb17dc3 100644 --- a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesAbnormalRecordServiceImpl.java +++ b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesAbnormalRecordServiceImpl.java @@ -1,5 +1,6 @@ package com.logpm.aftersales.service.impl; +import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.logpm.aftersales.dto.AbnormalRecordDTO; @@ -15,7 +16,6 @@ import org.springblade.core.tool.api.R; import org.springframework.stereotype.Service; import java.util.Date; -import java.util.Map; import java.util.Objects; @Slf4j @@ -78,7 +78,7 @@ public class AftersalesAbnormalRecordServiceImpl extends BaseServiceImpl findListByCarsNoAndUpWarehouseId(String carsNo, Long warehouseId) { + public JSONObject findListByCarsNoAndUpWarehouseId(String carsNo, Long warehouseId) { return baseMapper.findListByCarsNoAndUpWarehouseId(carsNo,warehouseId); } } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataBrandMapper.xml b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataBrandMapper.xml index 02ed9b94a..91893a6d3 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataBrandMapper.xml +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataBrandMapper.xml @@ -17,7 +17,8 @@ diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataBrandServiceImpl.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataBrandServiceImpl.java index 5a5af037e..533659598 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataBrandServiceImpl.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataBrandServiceImpl.java @@ -57,6 +57,7 @@ public class BasicdataBrandServiceImpl extends BaseServiceImpl findAllList() { List allList = baseMapper.findAllList(); JSONObject jsonObject = new JSONObject(); + jsonObject.put("brandId",0); jsonObject.put("brandName","零担"); allList.add(0,jsonObject); return allList; diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/OpenOrderController.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/OpenOrderController.java index 28766d35b..54067c532 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/OpenOrderController.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/OpenOrderController.java @@ -639,14 +639,14 @@ public class OpenOrderController { // } BigDecimal subtotalFreight = waybillDetailDTO.getSubtotalFreight(); - if(subtotalFreight.compareTo(BigDecimal.ZERO) <= 0){ + if(subtotalFreight.compareTo(BigDecimal.ZERO) < 0){ log.warn("#################openZeroOrderParamVerify: 货物运费小计不正确 subtotalFreight={} ",subtotalFreight); throw new CustomerException(405,"货物运费小计不正确"); } } BigDecimal totalFreight = openOrderDTO.getTotalFreight(); - if(totalFreight.compareTo(BigDecimal.ZERO) <= 0){ + if(totalFreight.compareTo(BigDecimal.ZERO) < 0){ log.warn("#################openZeroOrderParamVerify: 运费不正确 totalFreight={} ",totalFreight); throw new CustomerException(405,"运费不正确"); } @@ -916,14 +916,14 @@ public class OpenOrderController { // } BigDecimal subtotalFreight = waybillDetailDTO.getSubtotalFreight(); - if(subtotalFreight.compareTo(BigDecimal.ZERO) <= 0){ + if(subtotalFreight.compareTo(BigDecimal.ZERO) < 0){ log.warn("#################openOrderParamVerify: 货物运费小计不正确 subtotalFreight={} ",subtotalFreight); throw new CustomerException(405,"货物运费小计不正确"); } } BigDecimal totalFreight = openOrderDTO.getTotalFreight(); - if(totalFreight.compareTo(BigDecimal.ZERO) <= 0){ + if(totalFreight.compareTo(BigDecimal.ZERO) < 0){ log.warn("#################openOrderParamVerify: 运费不正确 totalFreight={} ",totalFreight); throw new CustomerException(405,"运费不正确"); } @@ -1284,7 +1284,7 @@ public class OpenOrderController { @PostMapping("/updateWaybill") @ApiOperationSupport(order = 1) @ApiOperation(value = "改单", notes = "传入openOrderDTO") - public R updateWaybill(@RequestBody OpenOrderDTO openOrderDTO) { + public R updateWaybill(@RequestBody OpenOrderDTO openOrderDTO) { String method = "############updateWaybill: "; log.info(method + "请求参数{}", openOrderDTO); Long waybillId = openOrderDTO.getWaybillId(); diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadMapper.xml b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadMapper.xml index 683252672..6c498d271 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadMapper.xml +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadMapper.xml @@ -127,6 +127,7 @@ select ltco.id carsOrderId, ltco.order_code orderCode, + ltco.waybill_id waybillId, ltco.waybill_no waybillNo, lww.create_time createTime, lww.destination destination, @@ -316,6 +320,7 @@ group by ltco.id, ltco.order_code, + ltco.waybill_id, ltco.waybill_no, lww.create_time, lww.destination, diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.xml b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.xml index 8b1b98d13..36a7ea1e8 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.xml +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.xml @@ -637,8 +637,8 @@ sum(IF(ltcls.final_node_id = #{warehouseId} and ltcls.scan_status = '1',ltcls.num,0))+sum(IF(ltcls.final_node_id = #{warehouseId} and ltcls.scan_status != '1',ltcls.num-ltcls.unload_num,0)) noUnloadNum, sum(IF(ltcls.unload_node_id = #{warehouseId} and ltcls.type = 2 and ltcls.scan_status = '1',ltcls.unload_num,0)) manualNum from logpm_trunkline_cars_load_scan ltcls - left join logpm_trunkline_cars_order ltco on ltco.waybill_id = ltcls.waybill_id and ltco.order_code = ltcls.order_code - where ltcls.load_id = #{loadId} + left join logpm_trunkline_cars_order ltco on ltco.waybill_id = ltcls.waybill_id and ltco.order_code = ltcls.order_code and ltco.load_id = #{loadId} + where ltcls.load_id = diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ICarsLoadAsyncService.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ICarsLoadAsyncService.java index f76c98808..12e54e571 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ICarsLoadAsyncService.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ICarsLoadAsyncService.java @@ -17,4 +17,5 @@ public interface ICarsLoadAsyncService { void abnormalListUnloadCheckByLoadIdAndWarehouseId(Long loadId, Long warehouseId, String nodeName, String tenantId, Long userId, String nickName, Long firstLong); + void dealwithAfterAbnormalPackage(String orderPackageCode, Long warehouseId, String warehouseName, String carsNo, Long userId, Long aLong, String nickName); } diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/CarsLoadAsyncServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/CarsLoadAsyncServiceImpl.java index e3acd3e92..b65b2a901 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/CarsLoadAsyncServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/CarsLoadAsyncServiceImpl.java @@ -2,6 +2,7 @@ package com.logpm.trunkline.service.impl; import com.logpm.aftersales.entity.AftersalesAbnormalRecordEntity; import com.logpm.aftersales.feign.IAftersalesAbnormalRecordClient; +import com.logpm.aftersales.feign.IAftersalesWorkOrderClient; import com.logpm.basicdata.entity.BasicdataWarehouseEntity; import com.logpm.basicdata.feign.IBasicdataWarehouseClient; import com.logpm.distribution.entity.DistributionStockArticleEntity; @@ -50,6 +51,8 @@ public class CarsLoadAsyncServiceImpl implements ICarsLoadAsyncService { @Lazy @Autowired private IAftersalesAbnormalRecordClient abnormalRecordClient; + @Autowired + private IAftersalesWorkOrderClient aftersalesWorkOrderClient; @Async @Override @@ -411,8 +414,8 @@ public class CarsLoadAsyncServiceImpl implements ICarsLoadAsyncService { TrunklineCarsLoadLineEntity carsLoadLineEntity = trunklineCarsLoadLineService.findEntityByLoadIdAndNodeId(loadId, warehouseId); if(!Objects.isNull(carsLoadLineEntity)){ carsLoadLineEntity.setUnloadReportStatus(1); - carsLoadLineEntity.setReportOne("本次装车件数 "+unloadReportVO.getLoadingNum()+" 件,实际卸车件数 "+unloadReportVO.getUnloadNum()+" 件"); - carsLoadLineEntity.setReportTwo("无基础数据货物 "+unloadReportVO.getNoDataNum()+" 件、非计划内货物 "+unloadReportVO.getNoPlanNum()+" 件、少货 "+unloadReportVO.getNoUnloadNum()+" 件、手动确认入库 "+unloadReportVO.getManualNum()+" 件"); + carsLoadLineEntity.setReportOne("本次装车件数 "+unloadReportVO.getLoadingNum()+" 件,实际卸车件数 "+unloadReportVO.getUnloadNum()+" 件,计划未卸车数量 "+(unloadReportVO.getLoadingNum()-unloadReportVO.getUnloadNum())+" 件"); + carsLoadLineEntity.setReportTwo("无基础数据货物 "+unloadReportVO.getNoDataNum()+" 件、非计划内货物 "+unloadReportVO.getNoPlanNum()+" 件、手动确认入库 "+unloadReportVO.getManualNum()+" 件"); trunklineCarsLoadLineService.updateById(carsLoadLineEntity); } @@ -442,6 +445,7 @@ public class CarsLoadAsyncServiceImpl implements ICarsLoadAsyncService { abnormalRecordEntity.setUpUserId(userId); abnormalRecordEntity.setUpUserName(nickName); abnormalRecordEntity.setAbnormalStatus(0); + abnormalRecordEntity.setSendOrderStatus(0); abnormalRecordEntity.setUpTime(new Date()); abnormalRecordEntity.setAssociationId(scanId); abnormalRecordEntity.setAssociationType(1); @@ -474,6 +478,7 @@ public class CarsLoadAsyncServiceImpl implements ICarsLoadAsyncService { abnormalRecordEntity.setUpUserId(userId); abnormalRecordEntity.setUpUserName(nickName); abnormalRecordEntity.setAbnormalStatus(0); + abnormalRecordEntity.setSendOrderStatus(0); abnormalRecordEntity.setUpTime(new Date()); abnormalRecordEntity.setAssociationId(scanId); abnormalRecordEntity.setAssociationType(1); @@ -482,4 +487,26 @@ public class CarsLoadAsyncServiceImpl implements ICarsLoadAsyncService { } } + @Override + public void dealwithAfterAbnormalPackage(String orderPackageCode, Long warehouseId, String warehouseName, String carsNo, Long userId, Long aLong, String nickName) { + + List abnormalRecordEntities = abnormalRecordClient.findOrderPackageAndAbnormalStatus(orderPackageCode,"0"); + //循环abnormalRecordEntities把abnormalStatus改为1 + //如果send_order_status = 1 则修改工单记录 + for (AftersalesAbnormalRecordEntity abnormalRecordEntity : abnormalRecordEntities) { + Integer sendOrderStatus = abnormalRecordEntity.getSendOrderStatus(); + + if(sendOrderStatus == 1){ + //修改对应工单记录 + aftersalesWorkOrderClient.updateWorkOrderStatus(warehouseId,orderPackageCode,1); + } + abnormalRecordEntity.setAbnormalStatus(1); + abnormalRecordEntity.setDealUserId(userId); + abnormalRecordEntity.setDealUserName(nickName); + abnormalRecordEntity.setRemark("包件已在 "+warehouseName+" 车次号:"+carsNo+" 中被卸车"); + } + abnormalRecordClient.updateList(abnormalRecordEntities); + + } + } diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java index 073057e28..1d691e472 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java @@ -379,8 +379,8 @@ public class OpenOrderServiceImpl implements IOpenOrderService { waybillEntity.setTotalCount(openOrderDTO.getTotalCount()); waybillEntity.setTotalVolume(openOrderDTO.getTotalVolume()); waybillEntity.setTotalWeight(openOrderDTO.getTotalWeghit()); - waybillEntity.setDearCode(openOrderDTO.getDearCode()); - waybillEntity.setDearName(openOrderDTO.getDearName()); + waybillEntity.setDealerCode(openOrderDTO.getDealerCode()); + waybillEntity.setDealerName(openOrderDTO.getDealerName()); //统计当前订单的在库数 List advanceIds = openOrderDTO.getAdvanceIds(); AdvanceDetailStockNumVO advanceDetailStockNumVO = advanceDetailService.findStockNumByAdvanceIds(advanceIds); @@ -421,7 +421,10 @@ public class OpenOrderServiceImpl implements IOpenOrderService { waybillEntity.setAgent(AuthUtil.getUserName()); waybillEntity.setAgentId(AuthUtil.getUserId()); waybillEntity.setDocumentMakingTime(CommonUtil.StringToDate(openOrderDTO.getOpenOrderDate())); - + waybillEntity.setPickupCompleteOrNot(openOrderDTO.getPickupCompleteOrNot()); + waybillEntity.setTrunklineCompleteOrNot(openOrderDTO.getTrunklineCompleteOrNot()); + waybillEntity.setTrunklineVehicleType(openOrderDTO.getTrunklineVehicleType()); + waybillEntity.setPickupVehicleType(openOrderDTO.getPickupVehicleType()); Long waybillId = warehouseWaybillClient.addEnntity(waybillEntity); if (!Objects.isNull(waybillId)) { @@ -608,6 +611,16 @@ public class OpenOrderServiceImpl implements IOpenOrderService { WarehouseWaybillEntity waybillEntity = new WarehouseWaybillEntity(); waybillEntity.setWaybillNo(waybillNo); + waybillEntity.setBrandId(openOrderDTO.getBrandId()); + waybillEntity.setBrand(openOrderDTO.getBrand()); + waybillEntity.setDeparture(openOrderDTO.getDeparture()); + waybillEntity.setDepartureCode(openOrderDTO.getDepartureCode()); + waybillEntity.setDealerCode(openOrderDTO.getDealerCode()); + waybillEntity.setDealerName(openOrderDTO.getDealerName()); + waybillEntity.setPickupCompleteOrNot(openOrderDTO.getPickupCompleteOrNot()); + waybillEntity.setTrunklineCompleteOrNot(openOrderDTO.getTrunklineCompleteOrNot()); + waybillEntity.setTrunklineVehicleType(openOrderDTO.getTrunklineVehicleType()); + waybillEntity.setPickupVehicleType(openOrderDTO.getPickupVehicleType()); waybillEntity.setDepartureWarehouseId(openOrderDTO.getDepartureWarehouseId()); waybillEntity.setDepartureWarehouseName(openOrderDTO.getDepartureWarehouseName()); waybillEntity.setDestinationWarehouseId(openOrderDTO.getDestinationWarehouseId()); @@ -2140,6 +2153,74 @@ public class OpenOrderServiceImpl implements IOpenOrderService { log.info("###################verifyData: 验证改单数据"); StringBuilder stringBuilder = new StringBuilder(); List msgList = new ArrayList<>(); + + String newDeparture = openOrderDTO.getDeparture(); + String departure = waybillEntity.getDeparture(); + if(!ObjectUtil.equals(newDeparture,departure)){ +// stringBuilder.append("到站:").append(destination).append("-->").append(newDestination).append(";"); + EditOrderMsgVO editOrderMsgVO = new EditOrderMsgVO(); + editOrderMsgVO.setItemName("发站"); + editOrderMsgVO.setOldValue(departure); + editOrderMsgVO.setNewValue(newDeparture); + msgList.add(editOrderMsgVO); + } + +// String newDepartureCode = openOrderDTO.getDepartureCode(); +// String departureCode = waybillEntity.getDepartureCode(); +// if(!ObjectUtil.equals(newDepartureCode,departureCode)){ +//// stringBuilder.append("到站:").append(destination).append("-->").append(newDestination).append(";"); +// EditOrderMsgVO editOrderMsgVO = new EditOrderMsgVO(); +// editOrderMsgVO.setItemName("发站"); +// editOrderMsgVO.setOldValue(departure); +// editOrderMsgVO.setNewValue(newDeparture); +// msgList.add(editOrderMsgVO); +// } + + Integer newPickupCompleteOrNot = openOrderDTO.getPickupCompleteOrNot(); + Integer pickupCompleteOrNot = waybillEntity.getPickupCompleteOrNot(); + if(!ObjectUtil.equals(newPickupCompleteOrNot,pickupCompleteOrNot)){ +// stringBuilder.append("到站:").append(destination).append("-->").append(newDestination).append(";"); + EditOrderMsgVO editOrderMsgVO = new EditOrderMsgVO(); + editOrderMsgVO.setItemName("提货是否整车"); + editOrderMsgVO.setOldValue(pickupCompleteOrNot==1?"是":"否"); + editOrderMsgVO.setNewValue(newPickupCompleteOrNot==1?"是":"否"); + msgList.add(editOrderMsgVO); + } + + Integer newTrunklineCompleteOrNot = openOrderDTO.getTrunklineCompleteOrNot(); + Integer trunklineCompleteOrNot = waybillEntity.getTrunklineCompleteOrNot(); + if(!ObjectUtil.equals(newTrunklineCompleteOrNot,trunklineCompleteOrNot)){ +// stringBuilder.append("到站:").append(destination).append("-->").append(newDestination).append(";"); + EditOrderMsgVO editOrderMsgVO = new EditOrderMsgVO(); + editOrderMsgVO.setItemName("干线是否整车"); + editOrderMsgVO.setOldValue(trunklineCompleteOrNot==1?"是":"否"); + editOrderMsgVO.setNewValue(newTrunklineCompleteOrNot==1?"是":"否"); + msgList.add(editOrderMsgVO); + } + + String newTrunklineVehicleType = openOrderDTO.getTrunklineVehicleType(); + String trunklineVehicleType = waybillEntity.getTrunklineVehicleType(); + if(!ObjectUtil.equals(newTrunklineVehicleType,trunklineVehicleType)){ +// stringBuilder.append("到站:").append(destination).append("-->").append(newDestination).append(";"); + EditOrderMsgVO editOrderMsgVO = new EditOrderMsgVO(); + editOrderMsgVO.setItemName("干线车型"); + editOrderMsgVO.setOldValue(DictBizCache.getValue("price_vehicle_type",trunklineVehicleType)); + editOrderMsgVO.setNewValue(DictBizCache.getValue("price_vehicle_type",newTrunklineVehicleType)); + msgList.add(editOrderMsgVO); + } + + String newPickupVehicleType = openOrderDTO.getPickupVehicleType(); + String pickupVehicleType = waybillEntity.getPickupVehicleType(); + if(!ObjectUtil.equals(newPickupVehicleType,pickupVehicleType)){ +// stringBuilder.append("到站:").append(destination).append("-->").append(newDestination).append(";"); + EditOrderMsgVO editOrderMsgVO = new EditOrderMsgVO(); + editOrderMsgVO.setItemName("提货车型"); + editOrderMsgVO.setOldValue(DictBizCache.getValue("price_vehicle_type",pickupVehicleType)); + editOrderMsgVO.setNewValue(DictBizCache.getValue("price_vehicle_type",newPickupVehicleType)); + msgList.add(editOrderMsgVO); + } + + String newDestination = openOrderDTO.getDestination(); String destination = waybillEntity.getDestination(); if(!ObjectUtil.equals(newDestination,destination)){ @@ -2639,6 +2720,44 @@ public class OpenOrderServiceImpl implements IOpenOrderService { private String verifyUpdateData(OpenOrderDTO openOrderDTO, WarehouseWaybillEntity waybillEntity) { log.info("###################verifyUpdateData: 验证改单数据"); StringBuilder stringBuilder = new StringBuilder(); + + String newDeparture = openOrderDTO.getDeparture(); + String departure = waybillEntity.getDeparture(); + if(!ObjectUtil.equals(newDeparture,departure)){ + stringBuilder.append("发站:").append(departure).append("-->").append(newDeparture).append(";"); + waybillEntity.setDeparture(newDeparture); + waybillEntity.setDepartureCode(openOrderDTO.getDepartureCode()); + } + + Integer newPickupCompleteOrNot = openOrderDTO.getPickupCompleteOrNot(); + Integer pickupCompleteOrNot = waybillEntity.getPickupCompleteOrNot(); + if(!ObjectUtil.equals(newPickupCompleteOrNot,pickupCompleteOrNot)){ + stringBuilder.append("提货是否整车:").append(pickupCompleteOrNot==1?"是":"否").append("-->").append(newPickupCompleteOrNot==1?"是":"否").append(";"); + waybillEntity.setPickupCompleteOrNot(newPickupCompleteOrNot); + } + + Integer newTrunklineCompleteOrNot = openOrderDTO.getTrunklineCompleteOrNot(); + Integer trunklineCompleteOrNot = waybillEntity.getTrunklineCompleteOrNot(); + if(!ObjectUtil.equals(newTrunklineCompleteOrNot,trunklineCompleteOrNot)){ + stringBuilder.append("干线是否整车:").append(trunklineCompleteOrNot==1?"是":"否").append("-->").append(newTrunklineCompleteOrNot==1?"是":"否").append(";"); + waybillEntity.setTrunklineCompleteOrNot(newTrunklineCompleteOrNot); + } + + String newTrunklineVehicleType = openOrderDTO.getTrunklineVehicleType(); + String trunklineVehicleType = waybillEntity.getTrunklineVehicleType(); + if(!ObjectUtil.equals(newTrunklineVehicleType,trunklineVehicleType)){ + stringBuilder.append("干线车型:").append(DictBizCache.getValue("price_vehicle_type",trunklineVehicleType)).append("-->").append(DictBizCache.getValue("price_vehicle_type",newTrunklineVehicleType)).append(";"); + waybillEntity.setTrunklineVehicleType(newTrunklineVehicleType); + } + + String newPickupVehicleType = openOrderDTO.getPickupVehicleType(); + String pickupVehicleType = waybillEntity.getPickupVehicleType(); + if(!ObjectUtil.equals(newPickupVehicleType,pickupVehicleType)){ + stringBuilder.append("提货车型:").append(DictBizCache.getValue("price_vehicle_type",pickupVehicleType)).append("-->").append(DictBizCache.getValue("price_vehicle_type",newPickupVehicleType)).append(";"); + waybillEntity.setPickupVehicleType(newPickupVehicleType); + } + + String newDestination = openOrderDTO.getDestination(); String destination = waybillEntity.getDestination(); if (!destination.equals(newDestination)) { diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java index 6d92b530f..9810ee88a 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java @@ -4548,8 +4548,9 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl abnormalRecord = abnormalRecordClient.findListByCarsNoAndUpWarehouseId(carsNo,warehouseId); - map.put("three","当前待处理异常 "+abnormalRecord.get("dealwithNum")+" 条、已处理异常 "+abnormalRecord.get("noDealwithNum")+" 条"); + JSONObject abnormalRecord = abnormalRecordClient.findListByCarsNoAndUpWarehouseId(carsNo,warehouseId); + + map.put("three","当前待处理异常 "+abnormalRecord.getInteger("dealwithNum")+" 条、已处理异常 "+abnormalRecord.getInteger("noDealwithNum")+" 条"); return R.data(map); } @@ -5257,6 +5258,9 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl orderPackageCodes = new ArrayList<>(); orderPackageCodes.add(orderPackageCode);