diff --git a/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/LoadCarsDTO.java b/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/LoadCarsDTO.java index d91e7c82d..8775e120e 100644 --- a/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/LoadCarsDTO.java +++ b/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/LoadCarsDTO.java @@ -135,4 +135,17 @@ public class LoadCarsDTO implements Serializable { private Integer unloadAbnormal; private Integer isSupple; + + private String createTimeStartStr; + private String createTimeEndStr; + + private Date createTimeStart; + private Date createTimeEnd; + + private String unloadTimeStartStr; + private String unloadTimeEndStr; + + private Date unloadTimeStart; + private Date unloadTimeEnd; + } 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 291de11cc..20b2c01e7 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 @@ -110,6 +110,8 @@ public class OpenOrderDTO implements Serializable { private String editResonCode;//改单原因编码 private String editReson;//改单原因 + private String abolishReson;//作废原因 + private Integer pickupCompleteOrNot;//提货是否整车 0否 1是 private Integer trunklineCompleteOrNot;//干线是否整车 0否 1是 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 9bf3452bd..dec3776b0 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 @@ -1685,6 +1685,7 @@ public class OpenOrderController { String method = "############abolishWaybill: "; log.info(method + "请求参数{}", openOrderDTO); List waybillIds = openOrderDTO.getWaybillIds(); + String abolishReson = openOrderDTO.getAbolishReson(); try{ BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); @@ -1698,7 +1699,12 @@ public class OpenOrderController { return R.fail(405,"运单ids为空"); } - return openOrderService.abolishWaybill(waybillIds,myCurrentWarehouse.getId(),myCurrentWarehouse.getName()); + if(StringUtil.isBlank(abolishReson)){ + log.warn(method+"请填写作废原因 abolishReson={}",abolishReson); + return R.fail(405,"请填写作废原因"); + } + + return openOrderService.abolishWaybill(waybillIds,myCurrentWarehouse.getId(),myCurrentWarehouse.getName(),abolishReson); }catch (CustomerException e){ log.error(e.message,e); return R.fail(e.code,e.message); 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 7dcf09cf8..f95b0a17c 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 @@ -134,7 +134,18 @@ and is_supple = #{param.isSupple} - + + and create_time >= #{param.createTimeStart} + + + and create_time <= #{param.createTimeEnd} + + + and unload_time >= #{param.unloadTimeStart} + + + and unload_time <= #{param.unloadTimeEnd} + diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/IOpenOrderService.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/IOpenOrderService.java index ec6946060..4fd39ba48 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/IOpenOrderService.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/IOpenOrderService.java @@ -86,7 +86,7 @@ public interface IOpenOrderService { R unFreezeWaybill(List waybillIds, Long warehouseId, String warehouseName); - R abolishWaybill(List waybillIds, Long warehouseId, String warehouseName); + R abolishWaybill(List waybillIds, Long warehouseId, String warehouseName, String abolishReson); // R findWaybillInfo(String waybillNo); 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 3f5b94d3a..860a4cdae 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 @@ -230,25 +230,51 @@ public class OpenOrderServiceImpl implements IOpenOrderService { basicdataFreightApiVO.setDestination(openOrderVO.getDestinationCode()); basicdataFreightApiVO.setArrivalWarehouse(openOrderVO.getDestinationWarehouseId() + ""); - for (AdvanceDetailGoodsVO advanceDetailGoodsVO : goodsList) { - String goodsName = advanceDetailGoodsVO.getGoodsName(); - BasicdataCategoryEntity basicdataCategoryEntity = basicdataCategoryClient.findByName(goodsName); - Long goodsId = null; - if (Objects.isNull(basicdataCategoryEntity)) { - basicdataCategoryEntity = new BasicdataCategoryEntity(); - basicdataCategoryEntity.setType(1); - basicdataCategoryEntity.setName(goodsName); - goodsId = basicdataCategoryClient.addReturnId(basicdataCategoryEntity); - } else { - goodsId = basicdataCategoryEntity.getId(); + if(goodsList.isEmpty()){ + List ls = new ArrayList<>(); + //把list中的元素通过packName分组如果pickName为空则换为"其他" + Map> groupedEntities = list.stream() + .collect(Collectors.groupingBy(entity -> { + String packName = entity.getPackName(); + return packName != null ? packName : "其他"; + })); + + groupedEntities.keySet().forEach(packName -> { + int total; + List advanceEntityList = groupedEntities.get(packName); + total = advanceEntityList.stream().mapToInt(TrunklineAdvanceEntity::getTotalNum).sum(); + AdvanceDetailGoodsVO advanceDetailGoodsVO = new AdvanceDetailGoodsVO(); + advanceDetailGoodsVO.setChargeType(1); + advanceDetailGoodsVO.setGoodsName(packName); + advanceDetailGoodsVO.setNum(total); + advanceDetailGoodsVO.setVolume(BigDecimal.ZERO); + advanceDetailGoodsVO.setWeight(BigDecimal.ZERO); + ls.add(advanceDetailGoodsVO); + }); + goodsList = new ArrayList<>(ls); + }else{ + for (AdvanceDetailGoodsVO advanceDetailGoodsVO : goodsList) { + String goodsName = advanceDetailGoodsVO.getGoodsName(); + BasicdataCategoryEntity basicdataCategoryEntity = basicdataCategoryClient.findByName(goodsName); + Long goodsId = null; + if (Objects.isNull(basicdataCategoryEntity)) { + basicdataCategoryEntity = new BasicdataCategoryEntity(); + basicdataCategoryEntity.setType(1); + basicdataCategoryEntity.setName(goodsName); + goodsId = basicdataCategoryClient.addReturnId(basicdataCategoryEntity); + } else { + goodsId = basicdataCategoryEntity.getId(); + } + advanceDetailGoodsVO.setGoodsId(goodsId); + basicdataFreightApiVO.setCategory(goodsId + ""); + List pirceList = basicdataFreightClient.pirce(basicdataFreightApiVO); + JSONArray price = JSONArray.parseArray(JSON.toJSONString(pirceList)); + advanceDetailGoodsVO.setArrPirce(price); } - advanceDetailGoodsVO.setGoodsId(goodsId); - basicdataFreightApiVO.setCategory(goodsId + ""); - List pirceList = basicdataFreightClient.pirce(basicdataFreightApiVO); - JSONArray price = JSONArray.parseArray(JSON.toJSONString(pirceList)); - advanceDetailGoodsVO.setArrPirce(price); } + + openOrderVO.setGoodsList(goodsList); //查询支付方式 @@ -2127,7 +2153,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService { advanceEntity.setLegacyStatus("1"); } advanceEntity.setHasPackage(0); - advanceEntity.setCreateUserName(AuthUtil.getUserName()); + advanceEntity.setCreateUserName(AuthUtil.getNickName()); list.add(advanceEntity); } }); @@ -2731,7 +2757,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService { @Transactional(rollbackFor = Exception.class) @Override - public R abolishWaybill(List waybillIds, Long warehouseId, String warehouseName) { + public R abolishWaybill(List waybillIds, Long warehouseId, String warehouseName, String abolishReson) { List waybillList = warehouseWaybillClient.findListByWaybillIds(waybillIds); List waybillEntities = warehouseWaybillClient.findListByWaybillIds(waybillIds); waybillList.forEach(waybillEntity -> { @@ -2785,7 +2811,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService { waybillEntities.forEach(waybillEntity -> { String createOperationRemark = "作废运单" + waybillEntity.getWaybillNo() + ",时间:" + CommonUtil.dateToString(new Date()); - openOrderAsyncService.saveLog(waybillEntity.getId(), waybillEntity.getWaybillNo(), "1000", "作废运单", createOperationRemark, AuthUtil.getNickName(), AuthUtil.getUserId(), warehouseId, warehouseName); + openOrderAsyncService.saveLog(waybillEntity.getId(), waybillEntity.getWaybillNo(), "1000", "作废运单", createOperationRemark+" 原因:"+abolishReson, AuthUtil.getNickName(), AuthUtil.getUserId(), warehouseId, warehouseName); }); return R.success("作废成功"); } 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 ed4bfe45a..b6dbd378a 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 @@ -2054,6 +2054,11 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl pageList = trunklineCarsLoadScanService.loadingDetail(page, loadCarsDTO); return R.data(pageList); diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.xml b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.xml index a55b29270..53547d8e9 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.xml +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.xml @@ -236,6 +236,33 @@ and create_time <= #{param.createTimeEndDate} + + and Locate(#{param.agent},agent) > 0 + + + and Locate(#{param.goodsName},goods_name) > 0 + + + and freeze_status = #{param.freezeStatus} + + + and abolish_status = #{param.abolishStatus} + + + and Locate(#{param.remark},remark) > 0 + + + and Locate(#{param.consigneeAddress},consignee_address) > 0 + + + and total_count = #{param.totalCount} + + + and total_weight = #{param.totalWeight} + + + and total_volume = #{param.totalVolume} + order by create_time desc