From 377a33726780491cbf7a9dfbbb5231fc30edb20f Mon Sep 17 00:00:00 2001 From: zhenghaoyu Date: Wed, 24 Apr 2024 17:10:56 +0800 Subject: [PATCH] =?UTF-8?q?1.=E5=B9=B2=E7=BA=BF-=E6=94=B9=E5=8D=95?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../feign/IBasicdataClientClient.java | 6 +- .../feign/BasicdataClientClient.java | 6 + .../mapper/BasicdataClientMapper.java | 2 + .../mapper/BasicdataClientMapper.xml | 15 + .../service/IBasicdataClientService.java | 1 + .../impl/BasicdataClientServiceImpl.java | 36 +- .../service/IOpenOrderAsyncService.java | 2 +- .../service/impl/InComingServiceImpl.java | 6 +- .../impl/OpenOrderAsyncServiceImpl.java | 3 +- .../service/impl/OpenOrderServiceImpl.java | 482 +++++++++++++----- 10 files changed, 411 insertions(+), 148 deletions(-) diff --git a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataClientClient.java b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataClientClient.java index b2a8f1adb..e37a3a006 100644 --- a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataClientClient.java +++ b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataClientClient.java @@ -19,6 +19,7 @@ package com.logpm.basicdata.feign; import com.alibaba.fastjson.JSONObject; import com.logpm.basicdata.entity.BasicdataClientEntity; import com.logpm.basicdata.entity.BasicdataClientUserEntity; +import com.logpm.basicdata.vo.BasicdataClientVO; import org.springblade.common.constant.ModuleNameConstant; import org.springblade.core.mp.support.BladePage; import org.springframework.cloud.openfeign.FeignClient; @@ -73,7 +74,10 @@ public interface IBasicdataClientClient { List getBasicdataClientUserEntityListByUserId(@RequestParam("userId") Long userId); @GetMapping(API_PREFIX+"/findEntityById") - BasicdataClientEntity findEntityById(@RequestParam Long clientId); + BasicdataClientEntity findEntityById(@RequestParam Long clientId); + + @GetMapping(API_PREFIX+"/findEntityVoById") + BasicdataClientVO findEntityVoById(@RequestParam Long clientId); @PostMapping(API_PREFIX+"/addReturnId") Long addReturnId(@RequestBody BasicdataClientEntity basicdataClientEntity); diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataClientClient.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataClientClient.java index b0ab86b1c..6e8c83122 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataClientClient.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataClientClient.java @@ -26,6 +26,7 @@ import com.logpm.basicdata.entity.BasicdataClientEntity; import com.logpm.basicdata.entity.BasicdataClientUserEntity; import com.logpm.basicdata.service.IBasicdataClientService; import com.logpm.basicdata.service.IBasicdataClientUserService; +import com.logpm.basicdata.vo.BasicdataClientVO; import lombok.AllArgsConstructor; import org.springblade.core.mp.support.BladePage; import org.springblade.core.mp.support.Condition; @@ -99,6 +100,11 @@ public class BasicdataClientClient implements IBasicdataClientClient { return basicdataClientService.getById(clientId); } + @Override + public BasicdataClientVO findEntityVoById(Long clientId) { + return basicdataClientService.findEntityVoById(clientId); + } + @Override @PostMapping(API_PREFIX+"/addReturnId") public Long addReturnId(BasicdataClientEntity basicdataClientEntity) { diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataClientMapper.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataClientMapper.java index a49dbb91c..4b1363753 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataClientMapper.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataClientMapper.java @@ -59,4 +59,6 @@ public interface BasicdataClientMapper extends BaseMapper List findListByClientName(@Param("clientName") String clientName,@Param("linkMan") String linkMan,@Param("linkPhone") String linkPhone); List findNameByIds(@Param("sendOrgIds") List sendOrgIds); + + BasicdataClientVO findEntityVoById(@Param("clientId") Long clientId); } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataClientMapper.xml b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataClientMapper.xml index 4d373699e..29f91070f 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataClientMapper.xml +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataClientMapper.xml @@ -81,4 +81,19 @@ + + diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataClientService.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataClientService.java index a56b0478b..e02ac41ca 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataClientService.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataClientService.java @@ -99,4 +99,5 @@ public interface IBasicdataClientService extends BaseService findNameByIds(List sendOrgIds); + BasicdataClientVO findEntityVoById(Long clientId); } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataClientServiceImpl.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataClientServiceImpl.java index e046609bc..10f3228b2 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataClientServiceImpl.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataClientServiceImpl.java @@ -17,6 +17,7 @@ package com.logpm.basicdata.service.impl; import cn.hutool.core.collection.CollUtil; +import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; @@ -25,26 +26,10 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; import com.baomidou.mybatisplus.core.toolkit.StringUtils; import com.baomidou.mybatisplus.core.toolkit.Wrappers; -import com.logpm.basicdata.entity.BasicdataBrandEntity; -import com.logpm.basicdata.entity.BasicdataClientEntity; -import com.logpm.basicdata.entity.BasicdataHistoricalContractEntity; -import com.logpm.basicdata.entity.BasicdataStorageServicesEntity; -import com.logpm.basicdata.entity.BasicdataStoreBrandEntity; -import com.logpm.basicdata.entity.BasicdataStoreBusinessEntity; -import com.logpm.basicdata.entity.BasicdataStoreContactEntity; -import com.logpm.basicdata.entity.BasicdataTripartiteMallEntity; -import com.logpm.basicdata.entity.BasicdataWarehouseEntity; +import com.logpm.basicdata.entity.*; import com.logpm.basicdata.excel.BasicdataClientExcel; import com.logpm.basicdata.mapper.BasicdataClientMapper; -import com.logpm.basicdata.service.IBasicdataBrandService; -import com.logpm.basicdata.service.IBasicdataClientService; -import com.logpm.basicdata.service.IBasicdataHistoricalContractService; -import com.logpm.basicdata.service.IBasicdataStorageServicesService; -import com.logpm.basicdata.service.IBasicdataStoreBrandService; -import com.logpm.basicdata.service.IBasicdataStoreBusinessService; -import com.logpm.basicdata.service.IBasicdataStoreContactService; -import com.logpm.basicdata.service.IBasicdataTripartiteMallService; -import com.logpm.basicdata.service.IBasicdataWarehouseService; +import com.logpm.basicdata.service.*; import com.logpm.basicdata.vo.BasicdataClientVO; import com.logpm.basicdata.vo.ClientInfoVO; import lombok.extern.slf4j.Slf4j; @@ -64,13 +49,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.security.NoSuchAlgorithmException; -import java.util.ArrayList; -import java.util.Date; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Optional; -import java.util.Set; +import java.util.*; import java.util.stream.Collectors; import static org.springblade.common.constant.DictBizConstant.OPEN_ORDER_PAY_WAY; @@ -610,7 +589,7 @@ public class BasicdataClientServiceImpl extends BaseServiceImpl ls = baseMapper.findListByClientName(clientName, linkMan, linkPhone); List list = new ArrayList<>(); for (ClientInfoVO clientInfoVO : ls) { - list.add(JSONObject.parseObject(JSONObject.toJSONString(clientInfoVO))); + list.add(JSON.parseObject(JSON.toJSONString(clientInfoVO))); } return list; } @@ -623,4 +602,9 @@ public class BasicdataClientServiceImpl extends BaseServiceImpl advanceIds, Long userId, Long deptId, String tenantId, String nickName,Integer incomingType); + void incomingPackageBatch(List advanceIds, Long userId, Long deptId, String tenantId, String nickName,Integer incomingType,Long warehouseId); } diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/InComingServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/InComingServiceImpl.java index df09c01c1..92fc73c71 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/InComingServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/InComingServiceImpl.java @@ -33,6 +33,7 @@ public class InComingServiceImpl implements IInComingService { private final IWarehouseTrayTypeClient warehouseTrayTypeClient; private final IBasicdataWarehouseClient warehouseClient; private final IPackageTrackLogAsyncService packageTrackLogAsyncService; +// private final DynamicDataSourceProvider dynamicDataSourceProvider; @Override @@ -170,10 +171,12 @@ public class InComingServiceImpl implements IInComingService { String tenantId = inComingDTO.getTenantId(); String nickName = inComingDTO.getNickName(); +// DynamicDataSourceContextHolder.push(tenantId); + for (Long advanceId : advanceIds) { QueryWrapper queryWrapper = new QueryWrapper<>(); queryWrapper.eq("advance_id",advanceId) - .eq("package_status",0); + .eq("package_status","0"); //查询所有包件 List detailList = advanceDetailService.list(queryWrapper); @@ -189,6 +192,7 @@ public class InComingServiceImpl implements IInComingService { } +// DynamicDataSourceContextHolder.clear(); return R.success("入库成功"); } diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderAsyncServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderAsyncServiceImpl.java index 5b3acbad4..1edbec97d 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderAsyncServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderAsyncServiceImpl.java @@ -225,9 +225,10 @@ public class OpenOrderAsyncServiceImpl implements IOpenOrderAsyncService { @Async @Override - public void incomingPackageBatch(List advanceIds, Long userId, Long deptId, String tenantId, String nickName,Integer incomingType) { + public void incomingPackageBatch(List advanceIds, Long userId, Long deptId, String tenantId, String nickName,Integer incomingType,Long warehouseId) { InComingDTO inComingDTO = new InComingDTO(); inComingDTO.setAdvanceIds(advanceIds); + inComingDTO.setWarehouseId(warehouseId); inComingDTO.setUserId(userId); inComingDTO.setDeptId(deptId); inComingDTO.setTenantId(tenantId); 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 01efcd775..4ba1bcf3d 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 @@ -1,5 +1,6 @@ package com.logpm.trunkline.service.impl; +import cn.hutool.core.util.ObjectUtil; import com.alibaba.excel.EasyExcel; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; @@ -11,6 +12,7 @@ import com.logpm.basic.entity.BasicMaterialEntity; import com.logpm.basic.feign.IBasicMaterialClient; import com.logpm.basicdata.entity.*; import com.logpm.basicdata.feign.*; +import com.logpm.basicdata.vo.BasicdataClientVO; import com.logpm.basicdata.vo.BasicdataFreightApiVO; import com.logpm.distribution.entity.DistributionParcelListEntity; import com.logpm.distribution.entity.DistributionParcelNumberEntity; @@ -35,7 +37,6 @@ import org.springblade.common.constant.IncomingTypeEnum; import org.springblade.common.constant.order.*; import org.springblade.common.exception.CustomerException; import org.springblade.common.utils.CommonUtil; -import org.springblade.core.log.exception.ServiceException; import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.tool.api.R; import org.springblade.core.tool.utils.BeanUtil; @@ -87,6 +88,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService { private final ITrunklineWaybillReturnService trunklineWaybillReturnService; private final IBasicdataOpenIncomingClient basicdataOpenIncomingClient; private final ITrunklineCarsLoadService carsLoadService; + private final IBasicdataStoreContactClient basicdataStoreContactClient; @Override public IPage advancePageList(AdvanceDTO advanceDTO) { @@ -148,20 +150,39 @@ public class OpenOrderServiceImpl implements IOpenOrderService { //发货单位 Long shipperId = basicdataForwardingUnitClient.findForwardingUnitByWarehouseId(warehouseId); if (!Objects.isNull(shipperId)) { - BasicdataClientEntity basicdataClientEntity = basicdataClientClient.findEntityById(shipperId); + BasicdataClientVO basicdataClientEntity = basicdataClientClient.findEntityVoById(shipperId); if (!Objects.isNull(basicdataClientEntity)) { openOrderVO.setShipperClientId(shipperId); openOrderVO.setShipper(basicdataClientEntity.getClientName()); openOrderVO.setShipperName(basicdataClientEntity.getLinkman()); openOrderVO.setShipperMobile(basicdataClientEntity.getPhone()); openOrderVO.setShipperAddress(basicdataClientEntity.getDetailedly()); + + List departureArray = new ArrayList<>(); + String badeRegionAreaId = basicdataClientEntity.getBladeRegionAreaId(); + String bladeRegionProvinceId = basicdataClientEntity.getBladeRegionProvinceId(); + String bladeRegionCityId = basicdataClientEntity.getBladeRegionCityId(); + departureArray.add(bladeRegionProvinceId); + departureArray.add(bladeRegionCityId); + String name = regionFeign.getName(bladeRegionCityId); + String areaId = bladeRegionCityId; + if (!StringUtil.isBlank(badeRegionAreaId)) { + departureArray.add(badeRegionAreaId); + name = regionFeign.getName(badeRegionAreaId); + areaId = badeRegionAreaId; + } + + openOrderVO.setDeparture(name); + openOrderVO.setDepartureCode(areaId); + openOrderVO.setDepartureArray(departureArray); + } } //收货单位-----根据三方商场找到对应的clientId Long clientId = basicdataTripartiteMallClient.getClientIdByNameAndBrand(dealerName, brand); - BasicdataClientEntity basicdataClientEntity = basicdataClientClient.findEntityById(clientId); + BasicdataClientVO basicdataClientEntity = basicdataClientClient.findEntityVoById(clientId); if (!Objects.isNull(basicdataClientEntity)) { openOrderVO.setConsigneeClientId(clientId); openOrderVO.setConsignee(basicdataClientEntity.getClientName()); @@ -277,7 +298,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService { return R.success("验证成功"); } - @Transactional(rollbackFor = ServiceException.class) +// @Transactional(rollbackFor = ServiceException.class) @Override public R openWaybill(OpenOrderDTO openOrderDTO) { log.info("############openWaybill: 开单开始 openOrderDTO={}", openOrderDTO); @@ -352,10 +373,14 @@ public class OpenOrderServiceImpl implements IOpenOrderService { waybillEntity.setDestination(openOrderDTO.getDestination()); waybillEntity.setDestinationCode(openOrderDTO.getDestinationCode()); + waybillEntity.setDeparture(openOrderDTO.getDeparture()); + waybillEntity.setDepartureCode(openOrderDTO.getDepartureCode()); waybillEntity.setGoodsName(openOrderDTO.getGoodsName()); waybillEntity.setTotalCount(openOrderDTO.getTotalCount()); waybillEntity.setTotalVolume(openOrderDTO.getTotalVolume()); waybillEntity.setTotalWeight(openOrderDTO.getTotalWeghit()); + waybillEntity.setDearCode(openOrderDTO.getDearCode()); + waybillEntity.setDearName(openOrderDTO.getDearName()); //统计当前订单的在库数 List advanceIds = openOrderDTO.getAdvanceIds(); AdvanceDetailStockNumVO advanceDetailStockNumVO = advanceDetailService.findStockNumByAdvanceIds(advanceIds); @@ -536,7 +561,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService { //判断是否是开单及入库的配置 Boolean aBoolean = basicdataOpenIncomingClient.checkOpenIncoming(warehouseId, brandId); if (Boolean.TRUE.equals(aBoolean)) { - openOrderAsyncService.incomingPackageBatch(advanceIds, AuthUtil.getUserId(), Func.firstLong(AuthUtil.getDeptId()), AuthUtil.getTenantId(), AuthUtil.getNickName(), IncomingTypeEnum.OPEN_TO_IN.getCode()); + openOrderAsyncService.incomingPackageBatch(advanceIds, AuthUtil.getUserId(), Func.firstLong(AuthUtil.getDeptId()), AuthUtil.getTenantId(), AuthUtil.getNickName(), IncomingTypeEnum.OPEN_TO_IN.getCode(),warehouseId); } //异步存入日志 @@ -1407,13 +1432,14 @@ public class OpenOrderServiceImpl implements IOpenOrderService { Map map = new HashMap<>(); - map.put("warehouseWaybill", warehouseWaybillVO); - map.put("payTypeList", DictBizCache.getList(DictBizConstant.OPEN_ORDER_PAY_TYPE)); - map.put("payWayList", DictBizCache.getList(DictBizConstant.OPEN_ORDER_PAY_WAY)); - map.put("deliveryWayList", DictBizCache.getList(DictBizConstant.OPEN_ORDER_DELIVERY_WAY)); - map.put("urgencyList", DictBizCache.getList(DictBizConstant.OPEN_ORDER_URGENCY)); - map.put("receiptList", DictBizCache.getList(DictBizConstant.OPEN_ORDER_RECEIPT)); - map.put("transportTypeList", DictBizCache.getList(DictBizConstant.OPEN_ORDER_TRANSPORT_TYPE)); + map.put("warehouseWaybill",warehouseWaybillVO); + map.put("payTypeList",DictBizCache.getList(DictBizConstant.OPEN_ORDER_PAY_TYPE)); + map.put("payWayList",DictBizCache.getList(DictBizConstant.OPEN_ORDER_PAY_WAY)); + map.put("deliveryWayList",DictBizCache.getList(DictBizConstant.OPEN_ORDER_DELIVERY_WAY)); + map.put("urgencyList",DictBizCache.getList(DictBizConstant.OPEN_ORDER_URGENCY)); + map.put("receiptList",DictBizCache.getList(DictBizConstant.OPEN_ORDER_RECEIPT)); + map.put("transportTypeList",DictBizCache.getList(DictBizConstant.OPEN_ORDER_TRANSPORT_TYPE)); + map.put("editWaybillReasonTypeList",DictBizCache.getList(DictBizConstant.EDIT_WAYBILL_REASON_TYPE)); return R.data(map); } @@ -1450,9 +1476,10 @@ public class OpenOrderServiceImpl implements IOpenOrderService { log.warn("#############updateWaybill: 运单信息不存在 waybillId={}", waybillId); return R.fail(405, "运单信息不存在"); } - String updateMsg = verifyData(openOrderDTO, waybillEntity); +// String updateMsg = verifyData(openOrderDTO,waybillEntity); + List list = verifyData(openOrderDTO,waybillEntity); - return R.data(updateMsg); + return R.data(list); } @Override @@ -1926,7 +1953,8 @@ public class OpenOrderServiceImpl implements IOpenOrderService { //绑定订单和运单的关系 List advanceEntityList = advanceService.findListByIds(advanceIds); List waybillOrderEntities = new ArrayList<>(); - for (TrunklineAdvanceEntity advanceEntity : advanceEntityList) { + Set orderCodes = new TreeSet<>(); + for (TrunklineAdvanceEntity advanceEntity:advanceEntityList){ Long advanceId = advanceEntity.getId(); String waybillStatus = advanceEntity.getWaybillStatus(); if ("1".equals(waybillStatus)) { @@ -1946,6 +1974,10 @@ public class OpenOrderServiceImpl implements IOpenOrderService { waybillOrderEntities.add(waybillOrderEntity); +// List list = advanceDetailService.findList(advanceEntity.getId()); +// trunklineWaybillPackageService.saveList(list,waybillEntity); +// distributionParcelListClient.updateEntityByOpenOrder(advanceId,warehouseId,waybillId); +// orderCodes.add(advanceEntity.getOrderCode()); advanceEntity.setWaybillStatus("1"); advanceEntity.setWaybillNo(waybillEntity.getWaybillNo()); } @@ -1953,6 +1985,15 @@ public class OpenOrderServiceImpl implements IOpenOrderService { //修改暂存单的状态为已开单 advanceService.updateBatchById(advanceEntityList); +// Integer isTransfer = 1; +// if(departureWarehouseId.equals(destinationWarehouseId)){ +// isTransfer = 0; +// } + +// for (String orderCode : orderCodes) { +// distributionParcelListClient.updateTransferStatus(orderCode,warehouseId,isTransfer); +// } + //计算扫码入库的包件是否需要把运单和提货单挂上 List billladingPackageList = advanceDetailService.findBillladingPackageByAdvanceIdsAnd(advanceIds); @@ -2095,76 +2136,128 @@ public class OpenOrderServiceImpl implements IOpenOrderService { return R.data(list); } - private String verifyData(OpenOrderDTO openOrderDTO, WarehouseWaybillEntity waybillEntity) { + private List verifyData(OpenOrderDTO openOrderDTO, WarehouseWaybillEntity waybillEntity) { log.info("###################verifyData: 验证改单数据"); StringBuilder stringBuilder = new StringBuilder(); + List msgList = new ArrayList<>(); String newDestination = openOrderDTO.getDestination(); String destination = waybillEntity.getDestination(); - if (!destination.equals(newDestination)) { - stringBuilder.append("到站:").append(destination).append("-->").append(newDestination).append(";"); + if(!ObjectUtil.equals(newDestination,destination)){ +// stringBuilder.append("到站:").append(destination).append("-->").append(newDestination).append(";"); + EditOrderMsgVO editOrderMsgVO = new EditOrderMsgVO(); + editOrderMsgVO.setItemName("到站"); + editOrderMsgVO.setOldValue(destination); + editOrderMsgVO.setNewValue(newDestination); + msgList.add(editOrderMsgVO); } Long newDestinationWarehouseId = openOrderDTO.getDestinationWarehouseId(); String newDestinationWarehouseName = openOrderDTO.getDestinationWarehouseName(); Long destinationWarehouseId = waybillEntity.getDestinationWarehouseId(); String departureWarehouseName = waybillEntity.getDepartureWarehouseName(); - if (!destinationWarehouseId.equals(newDestinationWarehouseId)) { - stringBuilder.append("目的仓:").append(departureWarehouseName).append("-->").append(newDestinationWarehouseName).append(";"); + if(!ObjectUtil.equals(destinationWarehouseId,newDestinationWarehouseId)){ +// stringBuilder.append("目的仓:").append(departureWarehouseName).append("-->").append(newDestinationWarehouseName).append(";"); + EditOrderMsgVO editOrderMsgVO = new EditOrderMsgVO(); + editOrderMsgVO.setItemName("目的仓"); + editOrderMsgVO.setOldValue(departureWarehouseName); + editOrderMsgVO.setNewValue(newDestinationWarehouseName); + msgList.add(editOrderMsgVO); } Long newShipperId = openOrderDTO.getShipperId(); String newShipper = openOrderDTO.getShipper(); Long shipperId = waybillEntity.getShipperId(); String shipper = waybillEntity.getShipper(); - if (!shipperId.equals(newShipperId)) { - stringBuilder.append("发货单位:").append(shipper).append("-->").append(newShipper).append(";"); + if(!ObjectUtil.equals(shipperId,newShipperId)){ +// stringBuilder.append("发货单位:").append(shipper).append("-->").append(newShipper).append(";"); + EditOrderMsgVO editOrderMsgVO = new EditOrderMsgVO(); + editOrderMsgVO.setItemName("发货单位"); + editOrderMsgVO.setOldValue(shipper); + editOrderMsgVO.setNewValue(newShipper); + msgList.add(editOrderMsgVO); } + String newShipperName = openOrderDTO.getShipperName(); String shipperName = waybillEntity.getShipperName(); - shipperName = StringUtil.isBlank(shipperName) ? "" : shipperName; - if (!shipperName.equals(newShipperName)) { - stringBuilder.append("发货人:").append(shipperName).append("-->").append(newShipperName).append(";"); + shipperName = StringUtil.isBlank(shipperName)?"":shipperName; + if(!ObjectUtil.equals(shipperName,newShipperName)){ +// stringBuilder.append("发货人:").append(shipperName).append("-->").append(newShipperName).append(";"); + EditOrderMsgVO editOrderMsgVO = new EditOrderMsgVO(); + editOrderMsgVO.setItemName("发货人"); + editOrderMsgVO.setOldValue(shipperName); + editOrderMsgVO.setNewValue(newShipperName); + msgList.add(editOrderMsgVO); } String newShipperMobile = openOrderDTO.getShipperMobile(); String shipperMobile = waybillEntity.getShipperMobile(); - shipperMobile = StringUtil.isBlank(shipperMobile) ? "" : shipperMobile; - if (!shipperMobile.equals(newShipperMobile)) { - stringBuilder.append("发货人电话:").append(shipperMobile).append("-->").append(newShipperMobile).append(";"); + shipperMobile = StringUtil.isBlank(shipperMobile)?"":shipperMobile; + if(!ObjectUtil.equals(shipperMobile,newShipperMobile)){ +// stringBuilder.append("发货人电话:").append(shipperMobile).append("-->").append(newShipperMobile).append(";"); + EditOrderMsgVO editOrderMsgVO = new EditOrderMsgVO(); + editOrderMsgVO.setItemName("发货人电话"); + editOrderMsgVO.setOldValue(shipperMobile); + editOrderMsgVO.setNewValue(newShipperMobile); + msgList.add(editOrderMsgVO); } String newShipperAddress = openOrderDTO.getShipperAddress(); String shipperAddress = waybillEntity.getShipperAddress(); - shipperAddress = StringUtil.isBlank(shipperAddress) ? "" : shipperAddress; - if (!shipperAddress.equals(newShipperAddress)) { - stringBuilder.append("发货人地址:").append(shipperAddress).append("-->").append(newShipperAddress).append(";"); + shipperAddress = StringUtil.isBlank(shipperAddress)?"":shipperAddress; + if(!ObjectUtil.equals(shipperAddress,newShipperAddress)){ +// stringBuilder.append("发货人地址:").append(shipperAddress).append("-->").append(newShipperAddress).append(";"); + EditOrderMsgVO editOrderMsgVO = new EditOrderMsgVO(); + editOrderMsgVO.setItemName("发货人电话"); + editOrderMsgVO.setOldValue(shipperAddress); + editOrderMsgVO.setNewValue(newShipperAddress); + msgList.add(editOrderMsgVO); } Long newConsigneeId = openOrderDTO.getConsigneeId(); String newConsignee = openOrderDTO.getConsignee(); Long consigneeId = waybillEntity.getConsigneeId(); String consignee = waybillEntity.getConsignee(); - if (!consigneeId.equals(newConsigneeId)) { - stringBuilder.append("收货单位:").append(consignee).append("-->").append(newConsignee).append(";"); + if(!ObjectUtil.equals(consigneeId,newConsigneeId)){ +// stringBuilder.append("收货单位:").append(consignee).append("-->").append(newConsignee).append(";"); + EditOrderMsgVO editOrderMsgVO = new EditOrderMsgVO(); + editOrderMsgVO.setItemName("收货单位"); + editOrderMsgVO.setOldValue(consignee); + editOrderMsgVO.setNewValue(newConsignee); + msgList.add(editOrderMsgVO); } String newConsigneeName = openOrderDTO.getConsigneeName(); String consigneeName = waybillEntity.getConsigneeName(); - consigneeName = StringUtil.isBlank(consigneeName) ? "" : consigneeName; - if (!consigneeName.equals(newConsigneeName)) { - stringBuilder.append("收货人:").append(consigneeName).append("-->").append(newConsigneeName).append(";"); + consigneeName = StringUtil.isBlank(consigneeName)?"":consigneeName; + if(!ObjectUtil.equals(consigneeName,newConsigneeName)){ +// stringBuilder.append("收货人:").append(consigneeName).append("-->").append(newConsigneeName).append(";"); + EditOrderMsgVO editOrderMsgVO = new EditOrderMsgVO(); + editOrderMsgVO.setItemName("收货人"); + editOrderMsgVO.setOldValue(consigneeName); + editOrderMsgVO.setNewValue(newConsigneeName); + msgList.add(editOrderMsgVO); } String newConsigneeMobile = openOrderDTO.getConsigneeMobile(); String consigneeMobile = waybillEntity.getConsigneeMobile(); - consigneeMobile = StringUtil.isBlank(consigneeMobile) ? "" : consigneeMobile; - if (!consigneeMobile.equals(newConsigneeMobile)) { - stringBuilder.append("收货人电话:").append(consigneeMobile).append("-->").append(newConsigneeMobile).append(";"); + consigneeMobile = StringUtil.isBlank(consigneeMobile)?"":consigneeMobile; + if(!ObjectUtil.equals(consigneeMobile,newConsigneeMobile)){ +// stringBuilder.append("收货人电话:").append(consigneeMobile).append("-->").append(newConsigneeMobile).append(";"); + EditOrderMsgVO editOrderMsgVO = new EditOrderMsgVO(); + editOrderMsgVO.setItemName("收货人电话"); + editOrderMsgVO.setOldValue(consigneeMobile); + editOrderMsgVO.setNewValue(newConsigneeMobile); + msgList.add(editOrderMsgVO); } String newConsigneeAddress = openOrderDTO.getConsigneeAddress(); String consigneeAddress = waybillEntity.getConsigneeAddress(); - consigneeAddress = StringUtil.isBlank(consigneeAddress) ? "" : consigneeAddress; - if (!shipperAddress.equals(newShipperAddress)) { - stringBuilder.append("发货人地址:").append(consigneeAddress).append("-->").append(newConsigneeAddress).append(";"); + consigneeAddress = StringUtil.isBlank(consigneeAddress)?"":consigneeAddress; + if(!ObjectUtil.equals(shipperAddress,newShipperAddress)){ +// stringBuilder.append("发货人地址:").append(consigneeAddress).append("-->").append(newConsigneeAddress).append(";"); + EditOrderMsgVO editOrderMsgVO = new EditOrderMsgVO(); + editOrderMsgVO.setItemName("发货人地址"); + editOrderMsgVO.setOldValue(shipperAddress); + editOrderMsgVO.setNewValue(newShipperAddress); + msgList.add(editOrderMsgVO); } String removeMsg = null; @@ -2174,20 +2267,24 @@ public class OpenOrderServiceImpl implements IOpenOrderService { Long waybillDetailId = waybillDetailDTO.getId(); WarehouseWayBillDetail warehouseWayBillDetail = warehouseWaybillDetailClient.findEntityByWaybillDetailId(waybillDetailId); - if (Objects.isNull(warehouseWayBillDetail)) { + if(Objects.isNull(warehouseWayBillDetail)){ log.warn("#################verifyUpdateData: 明细不存在"); continue; } - if (StringUtil.isBlank(removeMsg)) { - removeMsg = warehouseWayBillDetail.getProductName() + "(" + warehouseWayBillDetail.getNum() + ")"; - } else { - removeMsg = removeMsg + "," + warehouseWayBillDetail.getProductName() + "(" + warehouseWayBillDetail.getNum() + ")"; + if(StringUtil.isBlank(removeMsg)){ + removeMsg = warehouseWayBillDetail.getProductName()+"("+warehouseWayBillDetail.getNum()+")"; + }else{ + removeMsg = removeMsg + "," + warehouseWayBillDetail.getProductName()+"("+warehouseWayBillDetail.getNum()+")"; } } - if (StringUtil.isNotBlank(removeMsg)) { - stringBuilder.append("明细移除:").append(removeMsg).append(";"); + if(StringUtil.isNotBlank(removeMsg)){ +// stringBuilder.append("明细移除:").append(removeMsg).append(";"); + EditOrderMsgVO editOrderMsgVO = new EditOrderMsgVO(); + editOrderMsgVO.setItemName("明细移除"); + editOrderMsgVO.setOldValue(removeMsg); + msgList.add(editOrderMsgVO); } List addList = openOrderDTO.getAddList(); @@ -2195,197 +2292,346 @@ public class OpenOrderServiceImpl implements IOpenOrderService { Integer updateType = waybillDetailDTO.getUpdateType(); - if (1 == updateType) { + if(1 == updateType){ //新增 - stringBuilder.append("明细新增:").append(waybillDetailDTO.getGoodsName()).append(" 数量 ").append(waybillDetailDTO.getNum()).append(" 单价 ").append(waybillDetailDTO.getPrice()).append(";"); +// stringBuilder.append("明细新增:").append(waybillDetailDTO.getGoodsName()).append(" 数量 ").append(waybillDetailDTO.getNum()).append(" 单价 ").append(waybillDetailDTO.getPrice()).append(";"); + EditOrderMsgVO editOrderMsgVO = new EditOrderMsgVO(); + editOrderMsgVO.setItemName("明细新增 "+waybillDetailDTO.getGoodsName()); + editOrderMsgVO.setNewValue(" 数量 "+waybillDetailDTO.getNum()+" 单价 "+waybillDetailDTO.getPrice()); + msgList.add(editOrderMsgVO); - } else if (2 == updateType) { + + }else if(2 == updateType){ //更新 Long waybillDetailId = waybillDetailDTO.getId(); WarehouseWayBillDetail warehouseWayBillDetail = warehouseWaybillDetailClient.findEntityByWaybillDetailId(waybillDetailId); - if (Objects.isNull(warehouseWayBillDetail)) { + if(Objects.isNull(warehouseWayBillDetail)){ log.warn("#################verifyUpdateData: 明细不存在"); continue; } Integer newNum = waybillDetailDTO.getNum(); Integer num = warehouseWayBillDetail.getNum(); - if (!num.equals(newNum)) { - stringBuilder.append("明细更新:").append(warehouseWayBillDetail.getProductName()).append(" 数量修改").append(num).append("-->").append(newNum).append(";"); + if(!num.equals(newNum)){ +// stringBuilder.append("明细更新:").append(warehouseWayBillDetail.getProductName()).append(" 数量修改").append(num).append("-->").append(newNum).append(";"); + EditOrderMsgVO editOrderMsgVO = new EditOrderMsgVO(); + editOrderMsgVO.setItemName("明细更新 "+warehouseWayBillDetail.getProductName() +" 数量修改 "); + editOrderMsgVO.setOldValue(num+""); + editOrderMsgVO.setNewValue(newNum+""); + msgList.add(editOrderMsgVO); } BigDecimal newPrice = waybillDetailDTO.getPrice(); BigDecimal price = warehouseWayBillDetail.getPrice(); - if (price.compareTo(newPrice) != 0) { - stringBuilder.append("明细更新:").append(warehouseWayBillDetail.getProductName()).append(" 单价修改").append(price).append("-->").append(newPrice).append(";"); + if(price.compareTo(newPrice) != 0){ +// stringBuilder.append("明细更新:").append(warehouseWayBillDetail.getProductName()).append(" 单价修改").append(price).append("-->").append(newPrice).append(";"); + EditOrderMsgVO editOrderMsgVO = new EditOrderMsgVO(); + editOrderMsgVO.setItemName("明细更新 "+warehouseWayBillDetail.getProductName() +" 单价修改 "); + editOrderMsgVO.setOldValue(price.toPlainString()); + editOrderMsgVO.setNewValue(newPrice.toPlainString()); + msgList.add(editOrderMsgVO); } Integer newChargeType = waybillDetailDTO.getChargeType(); Integer chargeType = warehouseWayBillDetail.getChargeType(); - if (!chargeType.equals(newChargeType)) { - stringBuilder.append("明细更新:").append(warehouseWayBillDetail.getProductName()).append(" 计价方式修改").append(chargeType).append("-->").append(newChargeType).append(";"); + if(!ObjectUtil.equals(chargeType,newChargeType)){ +// stringBuilder.append("明细更新:").append(warehouseWayBillDetail.getProductName()).append(" 计价方式修改").append(chargeType).append("-->").append(newChargeType).append(";"); + EditOrderMsgVO editOrderMsgVO = new EditOrderMsgVO(); + editOrderMsgVO.setItemName("明细更新 "+warehouseWayBillDetail.getProductName() +" 计价方式修改 "); + editOrderMsgVO.setOldValue(DictBizCache.getValue(DictBizConstant.OPEN_ORDER_CHARGE_TYPE,chargeType+"")); + editOrderMsgVO.setNewValue(DictBizCache.getValue(DictBizConstant.OPEN_ORDER_CHARGE_TYPE,newChargeType+"")); + msgList.add(editOrderMsgVO); } } } Integer newTotalCount = openOrderDTO.getTotalCount(); Integer totalCount = waybillEntity.getTotalCount(); - if (!totalCount.equals(newTotalCount)) { - stringBuilder.append("货物总数:").append(totalCount).append("-->").append(newTotalCount).append(";"); + if(!ObjectUtil.equals(totalCount,newTotalCount)){ +// stringBuilder.append("货物总数:").append(totalCount).append("-->").append(newTotalCount).append(";"); + EditOrderMsgVO editOrderMsgVO = new EditOrderMsgVO(); + editOrderMsgVO.setItemName("货物总数"); + editOrderMsgVO.setOldValue(totalCount+""); + editOrderMsgVO.setNewValue(newTotalCount+""); + msgList.add(editOrderMsgVO); } BigDecimal newTotalFreight = openOrderDTO.getTotalFreight(); BigDecimal totalFreight = waybillEntity.getTotalFreight(); - if (totalFreight.compareTo(newTotalFreight) != 0) { - stringBuilder.append("运费:").append(totalFreight).append("-->").append(newTotalFreight).append(";"); + if(totalFreight.compareTo(newTotalFreight) != 0){ +// stringBuilder.append("运费:").append(totalFreight).append("-->").append(newTotalFreight).append(";"); + EditOrderMsgVO editOrderMsgVO = new EditOrderMsgVO(); + editOrderMsgVO.setItemName("运费"); + editOrderMsgVO.setOldValue(totalFreight+""); + editOrderMsgVO.setNewValue(newTotalFreight+""); + msgList.add(editOrderMsgVO); } BigDecimal newDeliveryFee = openOrderDTO.getDeliveryFee(); BigDecimal deliveryFee = waybillEntity.getDeliveryFee(); - if (deliveryFee.compareTo(newDeliveryFee) != 0) { - stringBuilder.append("送货费:").append(deliveryFee).append("-->").append(newDeliveryFee).append(";"); + if(deliveryFee.compareTo(newDeliveryFee) != 0){ +// stringBuilder.append("送货费:").append(deliveryFee).append("-->").append(newDeliveryFee).append(";"); + EditOrderMsgVO editOrderMsgVO = new EditOrderMsgVO(); + editOrderMsgVO.setItemName("送货费"); + editOrderMsgVO.setOldValue(deliveryFee.toPlainString()); + editOrderMsgVO.setNewValue(newDeliveryFee.toPlainString()); + msgList.add(editOrderMsgVO); } BigDecimal newPickupFee = openOrderDTO.getPickupFee(); BigDecimal pickupFee = waybillEntity.getPickupFee(); - if (pickupFee.compareTo(newPickupFee) != 0) { - stringBuilder.append("提货费:").append(pickupFee).append("-->").append(newPickupFee).append(";"); + if(pickupFee.compareTo(newPickupFee) != 0){ +// stringBuilder.append("提货费:").append(pickupFee).append("-->").append(newPickupFee).append(";"); + EditOrderMsgVO editOrderMsgVO = new EditOrderMsgVO(); + editOrderMsgVO.setItemName("提货费"); + editOrderMsgVO.setOldValue(pickupFee.toPlainString()); + editOrderMsgVO.setNewValue(newPickupFee.toPlainString()); + msgList.add(editOrderMsgVO); } BigDecimal newWarehouseManagementFee = openOrderDTO.getWarehouseManagementFee(); BigDecimal warehouseManagementFee = waybillEntity.getWarehouseManagementFee(); - if (warehouseManagementFee.compareTo(newWarehouseManagementFee) != 0) { - stringBuilder.append("仓库管理费:").append(warehouseManagementFee).append("-->").append(newWarehouseManagementFee).append(";"); + if(warehouseManagementFee.compareTo(newWarehouseManagementFee) != 0){ +// stringBuilder.append("仓库管理费:").append(warehouseManagementFee).append("-->").append(newWarehouseManagementFee).append(";"); + EditOrderMsgVO editOrderMsgVO = new EditOrderMsgVO(); + editOrderMsgVO.setItemName("仓库管理费"); + editOrderMsgVO.setOldValue(warehouseManagementFee.toPlainString()); + editOrderMsgVO.setNewValue(newWarehouseManagementFee.toPlainString()); + msgList.add(editOrderMsgVO); } BigDecimal newStorageFee = openOrderDTO.getStorageFee(); BigDecimal storageFee = waybillEntity.getStorageFee(); - if (storageFee.compareTo(newStorageFee) != 0) { - stringBuilder.append("仓储费:").append(storageFee).append("-->").append(newStorageFee).append(";"); + if(storageFee.compareTo(newStorageFee) != 0){ +// stringBuilder.append("仓储费:").append(storageFee).append("-->").append(newStorageFee).append(";"); + EditOrderMsgVO editOrderMsgVO = new EditOrderMsgVO(); + editOrderMsgVO.setItemName("仓储费"); + editOrderMsgVO.setOldValue(storageFee.toPlainString()); + editOrderMsgVO.setNewValue(newStorageFee.toPlainString()); + msgList.add(editOrderMsgVO); } BigDecimal newHandlingFee = openOrderDTO.getHandlingFee(); BigDecimal handlingFee = waybillEntity.getHandlingFee(); - if (handlingFee.compareTo(newHandlingFee) != 0) { - stringBuilder.append("装卸费:").append(handlingFee).append("-->").append(newHandlingFee).append(";"); + if(handlingFee.compareTo(newHandlingFee) != 0){ +// stringBuilder.append("装卸费:").append(handlingFee).append("-->").append(newHandlingFee).append(";"); + EditOrderMsgVO editOrderMsgVO = new EditOrderMsgVO(); + editOrderMsgVO.setItemName("装卸费"); + editOrderMsgVO.setOldValue(handlingFee.toPlainString()); + editOrderMsgVO.setNewValue(newHandlingFee.toPlainString()); + msgList.add(editOrderMsgVO); } BigDecimal newInstallFee = openOrderDTO.getInstallFee(); BigDecimal installFee = waybillEntity.getInstallFee(); - if (installFee.compareTo(newInstallFee) != 0) { - stringBuilder.append("安装费:").append(installFee).append("-->").append(newInstallFee).append(";"); + if(installFee.compareTo(newInstallFee) != 0){ +// stringBuilder.append("安装费:").append(installFee).append("-->").append(newInstallFee).append(";"); + EditOrderMsgVO editOrderMsgVO = new EditOrderMsgVO(); + editOrderMsgVO.setItemName("安装费"); + editOrderMsgVO.setOldValue(installFee.toPlainString()); + editOrderMsgVO.setNewValue(newInstallFee.toPlainString()); + msgList.add(editOrderMsgVO); } BigDecimal newOtherFee = openOrderDTO.getOtherFee(); BigDecimal otherFee = waybillEntity.getOtherFee(); - if (otherFee.compareTo(newOtherFee) != 0) { - stringBuilder.append("其他费:").append(otherFee).append("-->").append(newOtherFee).append(";"); + if(otherFee.compareTo(newOtherFee) != 0){ +// stringBuilder.append("其他费:").append(otherFee).append("-->").append(newOtherFee).append(";"); + EditOrderMsgVO editOrderMsgVO = new EditOrderMsgVO(); + editOrderMsgVO.setItemName("其他费"); + editOrderMsgVO.setOldValue(otherFee.toPlainString()); + editOrderMsgVO.setNewValue(newOtherFee.toPlainString()); + msgList.add(editOrderMsgVO); } BigDecimal newInsuranceFee = openOrderDTO.getInsuranceFee(); BigDecimal insuranceFee = waybillEntity.getInsuranceFee(); - if (insuranceFee.compareTo(newInsuranceFee) != 0) { - stringBuilder.append("保价费:").append(insuranceFee).append("-->").append(newInsuranceFee).append(";"); + if(insuranceFee.compareTo(newInsuranceFee) != 0){ +// stringBuilder.append("保价费:").append(insuranceFee).append("-->").append(newInsuranceFee).append(";"); + EditOrderMsgVO editOrderMsgVO = new EditOrderMsgVO(); + editOrderMsgVO.setItemName("保价费"); + editOrderMsgVO.setOldValue(insuranceFee.toPlainString()); + editOrderMsgVO.setNewValue(newInsuranceFee.toPlainString()); + msgList.add(editOrderMsgVO); } BigDecimal newClaimingValue = openOrderDTO.getClaimingValue(); BigDecimal claimingValue = waybillEntity.getClaimingValue(); - if (claimingValue.compareTo(newClaimingValue) != 0) { - stringBuilder.append("申明价值:").append(claimingValue).append("-->").append(newClaimingValue).append(";"); + if(claimingValue.compareTo(newClaimingValue) != 0){ +// stringBuilder.append("申明价值:").append(claimingValue).append("-->").append(newClaimingValue).append(";"); + EditOrderMsgVO editOrderMsgVO = new EditOrderMsgVO(); + editOrderMsgVO.setItemName("申明价值"); + editOrderMsgVO.setOldValue(claimingValue.toPlainString()); + editOrderMsgVO.setNewValue(newClaimingValue.toPlainString()); + msgList.add(editOrderMsgVO); } String newPayType = openOrderDTO.getPayType(); String payType = waybillEntity.getPayType(); - if (!payType.equals(newPayType)) { - stringBuilder.append("支付方式:").append(payType).append("-->").append(newPayType).append(";"); + if(!ObjectUtil.equals(payType,newPayType)){ +// stringBuilder.append("支付方式:").append(payType).append("-->").append(newPayType).append(";"); + EditOrderMsgVO editOrderMsgVO = new EditOrderMsgVO(); + editOrderMsgVO.setItemName("支付方式"); + editOrderMsgVO.setOldValue(DictBizCache.getValue(DictBizConstant.OPEN_ORDER_PAY_TYPE,payType)); + editOrderMsgVO.setNewValue(DictBizCache.getValue(DictBizConstant.OPEN_ORDER_PAY_TYPE,newPayType)); + msgList.add(editOrderMsgVO); } String newPayWay = openOrderDTO.getPayWay(); String payWay = waybillEntity.getPayWay(); - if (!payWay.equals(newPayWay)) { - stringBuilder.append("付款方式:").append(payWay).append("-->").append(newPayWay).append(";"); + if(!ObjectUtil.equals(payWay,newPayWay)){ +// stringBuilder.append("付款方式:").append(payWay).append("-->").append(newPayWay).append(";"); + EditOrderMsgVO editOrderMsgVO = new EditOrderMsgVO(); + editOrderMsgVO.setItemName("付款方式"); + editOrderMsgVO.setOldValue(DictBizCache.getValue(DictBizConstant.OPEN_ORDER_PAY_WAY,payWay)); + editOrderMsgVO.setNewValue(DictBizCache.getValue(DictBizConstant.OPEN_ORDER_PAY_WAY,newPayWay)); + msgList.add(editOrderMsgVO); } BigDecimal xianPay = openOrderDTO.getXianPay(); BigDecimal xPay = waybillEntity.getXPay(); - if (xPay.compareTo(xianPay) != 0) { - stringBuilder.append("现付:").append(xPay).append("-->").append(xianPay).append(";"); + if(xPay.compareTo(xianPay) != 0){ +// stringBuilder.append("现付:").append(xPay).append("-->").append(xianPay).append(";"); + EditOrderMsgVO editOrderMsgVO = new EditOrderMsgVO(); + editOrderMsgVO.setItemName("现付"); + editOrderMsgVO.setOldValue(xPay.toPlainString()); + editOrderMsgVO.setNewValue(xianPay.toPlainString()); + msgList.add(editOrderMsgVO); } BigDecimal daoPay = openOrderDTO.getDaoPay(); BigDecimal dPay = waybillEntity.getDPay(); - if (dPay.compareTo(daoPay) != 0) { - stringBuilder.append("到付:").append(dPay).append("-->").append(daoPay).append(";"); + if(dPay.compareTo(daoPay) != 0){ +// stringBuilder.append("到付:").append(dPay).append("-->").append(daoPay).append(";"); + EditOrderMsgVO editOrderMsgVO = new EditOrderMsgVO(); + editOrderMsgVO.setItemName("到付"); + editOrderMsgVO.setOldValue(dPay.toPlainString()); + editOrderMsgVO.setNewValue(daoPay.toPlainString()); + msgList.add(editOrderMsgVO); } BigDecimal yuePay = openOrderDTO.getYuePay(); BigDecimal yPay = waybillEntity.getYPay(); - if (yPay.compareTo(yuePay) != 0) { - stringBuilder.append("月结:").append(yPay).append("-->").append(yuePay).append(";"); + if(yPay.compareTo(yuePay) != 0){ +// stringBuilder.append("月结:").append(yPay).append("-->").append(yuePay).append(";"); + EditOrderMsgVO editOrderMsgVO = new EditOrderMsgVO(); + editOrderMsgVO.setItemName("月结"); + editOrderMsgVO.setOldValue(yPay.toPlainString()); + editOrderMsgVO.setNewValue(yuePay.toPlainString()); + msgList.add(editOrderMsgVO); } BigDecimal huiPay = openOrderDTO.getHuiPay(); BigDecimal hPay = waybillEntity.getHPay(); - if (hPay.compareTo(huiPay) != 0) { - stringBuilder.append("月结:").append(hPay).append("-->").append(huiPay).append(";"); + if(hPay.compareTo(huiPay) != 0){ +// stringBuilder.append("回付:").append(hPay).append("-->").append(huiPay).append(";"); + EditOrderMsgVO editOrderMsgVO = new EditOrderMsgVO(); + editOrderMsgVO.setItemName("回付"); + editOrderMsgVO.setOldValue(hPay.toPlainString()); + editOrderMsgVO.setNewValue(huiPay.toPlainString()); + msgList.add(editOrderMsgVO); } BigDecimal newthirdOperationFee = openOrderDTO.getThirdOperationFee(); BigDecimal thirdOperationFee = waybillEntity.getThirdOperationFee(); - if (thirdOperationFee.compareTo(newthirdOperationFee) != 0) { - stringBuilder.append("三方操作费:").append(thirdOperationFee).append("-->").append(newthirdOperationFee).append(";"); + if(thirdOperationFee.compareTo(newthirdOperationFee) != 0){ +// stringBuilder.append("三方操作费:").append(thirdOperationFee).append("-->").append(newthirdOperationFee).append(";"); + EditOrderMsgVO editOrderMsgVO = new EditOrderMsgVO(); + editOrderMsgVO.setItemName("三方操作费"); + editOrderMsgVO.setOldValue(thirdOperationFee.toPlainString()); + editOrderMsgVO.setNewValue(newthirdOperationFee.toPlainString()); + msgList.add(editOrderMsgVO); } String newdeliveryWay = openOrderDTO.getDeliveryWay(); String deliveryWay = waybillEntity.getDeliveryWay(); - if (!deliveryWay.equals(newdeliveryWay)) { - stringBuilder.append("送货方式:").append(deliveryWay).append("-->").append(newdeliveryWay).append(";"); + if(!ObjectUtil.equals(deliveryWay,newdeliveryWay)){ +// stringBuilder.append("送货方式:").append(deliveryWay).append("-->").append(newdeliveryWay).append(";"); + EditOrderMsgVO editOrderMsgVO = new EditOrderMsgVO(); + editOrderMsgVO.setItemName("送货方式"); + editOrderMsgVO.setOldValue(DictBizCache.getValue(DictBizConstant.OPEN_ORDER_DELIVERY_WAY,deliveryWay)); + editOrderMsgVO.setNewValue(DictBizCache.getValue(DictBizConstant.OPEN_ORDER_DELIVERY_WAY,newdeliveryWay)); + msgList.add(editOrderMsgVO); } String newurgency = openOrderDTO.getUrgency(); String urgency = waybillEntity.getUrgency(); - if (!urgency.equals(newurgency)) { - stringBuilder.append("紧急度:").append(urgency).append("-->").append(newurgency).append(";"); + if(!ObjectUtil.equals(urgency,newurgency)){ +// stringBuilder.append("紧急度:").append(urgency).append("-->").append(newurgency).append(";"); + EditOrderMsgVO editOrderMsgVO = new EditOrderMsgVO(); + editOrderMsgVO.setItemName("紧急度"); + editOrderMsgVO.setOldValue(DictBizCache.getValue(DictBizConstant.OPEN_ORDER_URGENCY,urgency)); + editOrderMsgVO.setNewValue(DictBizCache.getValue(DictBizConstant.OPEN_ORDER_URGENCY,newurgency)); + msgList.add(editOrderMsgVO); } String newreceipt = openOrderDTO.getReceipt(); String receipt = waybillEntity.getReceipt(); - if (!receipt.equals(newreceipt)) { - stringBuilder.append("回单方式:").append(receipt).append("-->").append(newreceipt).append(";"); + if(!ObjectUtil.equals(receipt,newreceipt)){ +// stringBuilder.append("回单方式:").append(receipt).append("-->").append(newreceipt).append(";"); + EditOrderMsgVO editOrderMsgVO = new EditOrderMsgVO(); + editOrderMsgVO.setItemName("回单方式"); + editOrderMsgVO.setOldValue(DictBizCache.getValue(DictBizConstant.OPEN_ORDER_RECEIPT,receipt)); + editOrderMsgVO.setNewValue(DictBizCache.getValue(DictBizConstant.OPEN_ORDER_RECEIPT,newreceipt)); + msgList.add(editOrderMsgVO); } String newtransportType = openOrderDTO.getTransportType(); String transportType = waybillEntity.getTransportType(); - if (!transportType.equals(newtransportType)) { - stringBuilder.append("运输方式:").append(transportType).append("-->").append(newtransportType).append(";"); + if(!ObjectUtil.equals(transportType,newtransportType)){ +// stringBuilder.append("运输方式:").append(transportType).append("-->").append(newtransportType).append(";"); + EditOrderMsgVO editOrderMsgVO = new EditOrderMsgVO(); + editOrderMsgVO.setItemName("运输方式"); + editOrderMsgVO.setOldValue(DictBizCache.getValue(DictBizConstant.OPEN_ORDER_TRANSPORT_TYPE,transportType)); + editOrderMsgVO.setNewValue(DictBizCache.getValue(DictBizConstant.OPEN_ORDER_TRANSPORT_TYPE,newtransportType)); + msgList.add(editOrderMsgVO); } Integer newreceiptNum = openOrderDTO.getReceiptNum(); Integer receiptNum = waybillEntity.getReceiptNum(); - if (!receiptNum.equals(newreceiptNum)) { - stringBuilder.append("回单数量:").append(receiptNum).append("-->").append(newreceiptNum).append(";"); + if(!ObjectUtil.equals(receiptNum,newreceiptNum)){ +// stringBuilder.append("回单数量:").append(receiptNum).append("-->").append(newreceiptNum).append(";"); + EditOrderMsgVO editOrderMsgVO = new EditOrderMsgVO(); + editOrderMsgVO.setItemName("回单数量"); + editOrderMsgVO.setOldValue(receiptNum+""); + editOrderMsgVO.setNewValue(newreceiptNum+""); + msgList.add(editOrderMsgVO); } BigDecimal newrebate = openOrderDTO.getRebate(); BigDecimal rebate = waybillEntity.getRebate(); - if (!Objects.isNull(rebate)) { - if (rebate.compareTo(newrebate) != 0) { - stringBuilder.append("回扣:").append(rebate).append("-->").append(newrebate).append(";"); + if(!Objects.isNull(rebate)){ + if(rebate.compareTo(newrebate) != 0){ +// stringBuilder.append("回扣:").append(rebate).append("-->").append(newrebate).append(";"); + EditOrderMsgVO editOrderMsgVO = new EditOrderMsgVO(); + editOrderMsgVO.setItemName("回扣"); + editOrderMsgVO.setOldValue(rebate+""); + editOrderMsgVO.setNewValue(newrebate+""); + msgList.add(editOrderMsgVO); } } String newRemark = openOrderDTO.getRemark(); String remark = waybillEntity.getRemark(); - if (!StringUtil.isBlank(remark)) { - if (!remark.equals(newRemark)) { - stringBuilder.append("备注:").append(remark).append("-->").append(newRemark).append(";"); - } - } else { - if (!StringUtil.isBlank(newRemark)) { - stringBuilder.append("备注:").append(remark).append("-->").append(newRemark).append(";"); - } - } + if(!ObjectUtil.equals(remark,newRemark)){ + stringBuilder.append("备注:").append(remark).append("-->").append(newRemark).append(";"); + EditOrderMsgVO editOrderMsgVO = new EditOrderMsgVO(); + editOrderMsgVO.setItemName("备注"); + editOrderMsgVO.setOldValue(remark); + editOrderMsgVO.setNewValue(newRemark); + msgList.add(editOrderMsgVO); + } + +// if(!StringUtil.isBlank(remark)){ +// if(!remark.equals(newRemark)){ +// +// } +// }else{ +// if(!StringUtil.isBlank(newRemark)){ +// stringBuilder.append("备注:").append(remark).append("-->").append(newRemark).append(";"); +// } +// } - return stringBuilder.toString(); + return msgList; }