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 d3c9df8a1..cd2da4407 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 @@ -13,11 +13,12 @@ public class OpenOrderDTO implements Serializable { private Long waybillId; private String brand;//品牌 - private String customerTrain;//客户车次号 + private String trainNumber;//客户车次号 private String waybillNo;//运单号 private Long departureWarehouseId;//发站仓id private String departureWarehouseName;//发站仓名称 private String destination;//到站 + private String destinationCode; private String destinationWarehouseName;//目的仓名称 private Long destinationWarehouseId;//目的仓Id private String goodsCode;//货号 diff --git a/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/PacakgeDetailExcelDTO.java b/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/PacakgeDetailExcelDTO.java index eb386c3f0..bc8e369c2 100644 --- a/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/PacakgeDetailExcelDTO.java +++ b/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/PacakgeDetailExcelDTO.java @@ -80,4 +80,13 @@ public class PacakgeDetailExcelDTO implements Serializable { @ExcelProperty(value = "配送区域") private String area; + @ExcelProperty(value = "发货基地") + private String siteName; + + @ExcelProperty(value = "发货单位") + private String senderUnit; + + @ExcelProperty(value = "是否干仓配") + private String isGcp; + } diff --git a/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineAdvanceEntity.java b/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineAdvanceEntity.java index 92c8472e6..4bd95dc9d 100644 --- a/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineAdvanceEntity.java +++ b/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineAdvanceEntity.java @@ -54,6 +54,9 @@ public class TrunklineAdvanceEntity extends TenantEntity { /** 订单总数 */ @ApiModelProperty(name = "订单总数",notes = "") private Integer totalNum ; + /** 订单总数 */ + @ApiModelProperty(name = "是否干仓配",notes = "") + private Integer isGcp ; /** 品名 */ @ApiModelProperty(name = "品名",notes = "") private String packName ; 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 f66832355..0c47a3e35 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 @@ -418,4 +418,7 @@ public class WarehouseWaybillEntity extends TenantEntity { @ApiModelProperty(value = "回单份数") private Integer receiptNum; + @ApiModelProperty(value = "到站编码") + private String destinationCode; + } 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 2ab3b890e..b14242367 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 @@ -62,7 +62,7 @@ lbc.detailedly linkAddress from logpm_basicdata_client lbc left join logpm_basicdata_store_contact lbsc on lbsc.shop_id = lbc.id - where is_deleted = 0 + where lbc.is_deleted = 0 and lbc.client_name like CONCAT('%',#{clientName},'%') diff --git a/blade-service/logpm-distribution/src/main/resources/application-dev.yml b/blade-service/logpm-distribution/src/main/resources/application-dev.yml index b067e4795..a4b50cf30 100644 --- a/blade-service/logpm-distribution/src/main/resources/application-dev.yml +++ b/blade-service/logpm-distribution/src/main/resources/application-dev.yml @@ -15,7 +15,7 @@ server: spring: #rabbitmq配置 rabbitmq: - host: 192.168.10.46 + host: 192.168.2.46 port: 5672 username: admin password: admin 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 427d541d4..5b12cc6d6 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 @@ -266,7 +266,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService { waybillEntity.setDestinationWarehouseName(openOrderDTO.getDestinationWarehouseName()); waybillEntity.setDocumentMakingTime(CommonUtil.StringToDate(openOrderDTO.getOpenOrderDate())); waybillEntity.setReceiptNum(openOrderDTO.getReceiptNum()); - waybillEntity.setCustomerTrain(openOrderDTO.getCustomerTrain()); + waybillEntity.setCustomerTrain(openOrderDTO.getTrainNumber()); Long shipperId = openOrderDTO.getShipperId(); if(Objects.isNull(shipperId)){ //如果发货单位没有id值,则把发货单位信息自动添加到client中 @@ -290,6 +290,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService { waybillEntity.setConsigneeAddress(openOrderDTO.getConsigneeAddress()); waybillEntity.setDestination(openOrderDTO.getDestination()); + waybillEntity.setDestinationCode(openOrderDTO.getDestinationCode()); waybillEntity.setGoodsName(openOrderDTO.getGoodsName()); waybillEntity.setTotalCount(openOrderDTO.getTotalCount()); waybillEntity.setTotalVolume(openOrderDTO.getTotalVolume()); @@ -321,6 +322,12 @@ public class OpenOrderServiceImpl implements IOpenOrderService { waybillEntity.setThirdOperationFee(openOrderDTO.getThirdOperationFee()); waybillEntity.setDeliveryWay(openOrderDTO.getDeliveryWay()); + String transportType = openOrderDTO.getTransportType(); + if(StringUtil.isBlank(transportType)){ + waybillEntity.setTransportType("1"); + }else{ + waybillEntity.setTransportType(transportType); + } waybillEntity.setUrgency(openOrderDTO.getUrgency()); waybillEntity.setReceipt(openOrderDTO.getReceipt()); waybillEntity.setRemark(openOrderDTO.getRemark()); @@ -518,7 +525,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService { waybillEntity.setDepartureWarehouseName(openOrderDTO.getDepartureWarehouseName()); waybillEntity.setDestinationWarehouseId(openOrderDTO.getDestinationWarehouseId()); waybillEntity.setDestinationWarehouseName(openOrderDTO.getDestinationWarehouseName()); - waybillEntity.setCustomerTrain(openOrderDTO.getCustomerTrain()); + waybillEntity.setCustomerTrain(openOrderDTO.getTrainNumber()); waybillEntity.setDocumentMakingTime(CommonUtil.StringToDate(openOrderDTO.getOpenOrderDate())); waybillEntity.setReceiptNum(openOrderDTO.getReceiptNum()); waybillEntity.setRebate(openOrderDTO.getRebate()); @@ -546,6 +553,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService { waybillEntity.setConsigneeAddress(openOrderDTO.getConsigneeAddress()); waybillEntity.setDestination(openOrderDTO.getDestination()); + waybillEntity.setDestinationCode(openOrderDTO.getDestinationCode()); waybillEntity.setGoodsName(openOrderDTO.getGoodsName()); waybillEntity.setTotalCount(openOrderDTO.getTotalCount()); waybillEntity.setTotalVolume(openOrderDTO.getTotalVolume()); @@ -574,6 +582,12 @@ public class OpenOrderServiceImpl implements IOpenOrderService { waybillEntity.setHPay(openOrderDTO.getHuiPay()); waybillEntity.setThirdOperationFee(openOrderDTO.getThirdOperationFee()); + String transportType = openOrderDTO.getTransportType(); + if(StringUtil.isBlank(transportType)){ + waybillEntity.setTransportType("1"); + }else{ + waybillEntity.setTransportType(transportType); + } waybillEntity.setDeliveryWay(openOrderDTO.getDeliveryWay()); waybillEntity.setUrgency(openOrderDTO.getUrgency()); waybillEntity.setReceipt(openOrderDTO.getReceipt()); @@ -934,6 +948,13 @@ public class OpenOrderServiceImpl implements IOpenOrderService { advanceEntity.setSenderName(pacakgeDetailExcelDTO.getSenderName()); advanceEntity.setSenderPhone(pacakgeDetailExcelDTO.getSenderPhone()); advanceEntity.setSenderAddress(pacakgeDetailExcelDTO.getSenderAddress()); + advanceEntity.setSenderFactory(pacakgeDetailExcelDTO.getSenderUnit()); + advanceEntity.setSiteName(pacakgeDetailExcelDTO.getSiteName()); + String isGcp = pacakgeDetailExcelDTO.getIsGcp(); + advanceEntity.setIsGcp(0); + if("是".equals(isGcp)){ + advanceEntity.setIsGcp(1); + } advanceEntity.setWaybillStatus("0"); advanceEntity.setFreezeStatus("0"); advanceEntity.setLegacyStatus("0"); @@ -1186,6 +1207,34 @@ public class OpenOrderServiceImpl implements IOpenOrderService { for (ImportStandardOuPaiDTO standardOuPaiDTO : paiDTOList) { String orderPackageCode = standardOuPaiDTO.getOrderPackageCode(); if(orderPackageCodes.contains(orderPackageCode)){ + + TrunklineAdvanceDetailEntity advanceDetailEntity = advanceDetailService.findEntityByOrderPackageCode(orderPackageCode); + String materialCode = standardOuPaiDTO.getMaterialCode(); + String materialName = standardOuPaiDTO.getMaterialName(); + String num = standardOuPaiDTO.getNum(); + + if(StringUtil.isNotBlank(materialCode) && StringUtil.isNotBlank(materialName)){ + BasicMaterialEntity basicMaterialEntity = basicMaterialClient.findEntityByCodeAndName(materialCode, materialName); + if(Objects.isNull(basicMaterialEntity)){ + basicMaterialEntity = new BasicMaterialEntity(); + basicMaterialEntity.setProductCode(materialCode); + basicMaterialEntity.setName(materialName); + basicMaterialEntity.setBrandId("1713382405517201409"); + basicMaterialEntity.setProperty("家配"); + basicMaterialEntity.setSpecification("件"); + basicMaterialEntity.setPackingSpecification(num+"件/箱"); + basicMaterialEntity.setLogpmUnit("箱"); + basicMaterialEntity.setSku(materialCode); + basicMaterialEntity.setPackageNum(num); + basicMaterialEntity.setHide(1); + Long aLong = basicMaterialClient.addMaterial(basicMaterialEntity); + basicMaterialEntity.setId(aLong); + } + advanceDetailEntity.setMaterialId(basicMaterialEntity.getId()); + advanceDetailEntity.setMaterialCode(basicMaterialEntity.getProductCode()); + advanceDetailEntity.setMaterialName(basicMaterialEntity.getName()); + } + advanceDetailService.updateById(advanceDetailEntity); continue; } TrunklineAdvanceDetailEntity advanceDetailModel = new TrunklineAdvanceDetailEntity(); @@ -1193,6 +1242,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService { advanceDetailModel.setWarehouseName(warehouseName); advanceDetailModel.setAdvanceId(trunklineAdvanceEntity.getId()); advanceDetailModel.setOrderPackageCode(orderPackageCode); + advanceDetailModel.setTrainNumber(importStandardOuPaiDTO.getTrainNumber()); advanceDetailModel.setOrderCode(orderCode); advanceDetailModel.setBrand("欧派"); advanceDetailModel.setSystemType("线上"); @@ -1567,7 +1617,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService { String shipperAddress = waybillEntity.getShipperAddress(); shipperAddress = StringUtil.isBlank(shipperAddress)?"":shipperAddress; if(!shipperAddress.equals(newShipperAddress)){ - stringBuilder.append("发货人电话:").append(shipperAddress).append("-->").append(newShipperAddress).append(";"); + stringBuilder.append("发货人地址:").append(shipperAddress).append("-->").append(newShipperAddress).append(";"); } Long newConsigneeId = openOrderDTO.getConsigneeId(); @@ -1641,7 +1691,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService { } Integer newNum = waybillDetailDTO.getNum(); Integer num = warehouseWayBillDetail.getNum(); - if(num != newNum){ + if(!num.equals(newNum)){ stringBuilder.append("明细更新:").append(warehouseWayBillDetail.getProductName()).append(" 数量修改").append(num).append("-->").append(newNum).append(";"); } @@ -1653,7 +1703,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService { Integer newChargeType = waybillDetailDTO.getChargeType(); Integer chargeType = warehouseWayBillDetail.getChargeType(); - if(chargeType != newChargeType){ + if(!chargeType.equals(newChargeType)){ stringBuilder.append("明细更新:").append(warehouseWayBillDetail.getProductName()).append(" 计价方式修改").append(chargeType).append("-->").append(newChargeType).append(";"); } } @@ -1667,55 +1717,61 @@ public class OpenOrderServiceImpl implements IOpenOrderService { BigDecimal newTotalFreight = openOrderDTO.getTotalFreight(); BigDecimal totalFreight = waybillEntity.getTotalFreight(); - if(!totalFreight.equals(newTotalFreight)){ + if(totalFreight.compareTo(newTotalFreight) != 0){ stringBuilder.append("运费:").append(totalFreight).append("-->").append(newTotalFreight).append(";"); } BigDecimal newDeliveryFee = openOrderDTO.getDeliveryFee(); BigDecimal deliveryFee = waybillEntity.getDeliveryFee(); - if(!deliveryFee.equals(newDeliveryFee)){ + if(deliveryFee.compareTo(newDeliveryFee) != 0){ stringBuilder.append("送货费:").append(deliveryFee).append("-->").append(newDeliveryFee).append(";"); } BigDecimal newPickupFee = openOrderDTO.getPickupFee(); BigDecimal pickupFee = waybillEntity.getPickupFee(); - if(!pickupFee.equals(newPickupFee)){ + if(pickupFee.compareTo(newPickupFee) != 0){ stringBuilder.append("提货费:").append(pickupFee).append("-->").append(newPickupFee).append(";"); } BigDecimal newWarehouseManagementFee = openOrderDTO.getWarehouseManagementFee(); BigDecimal warehouseManagementFee = waybillEntity.getWarehouseManagementFee(); - if(!warehouseManagementFee.equals(newWarehouseManagementFee)){ + if(warehouseManagementFee.compareTo(newWarehouseManagementFee) != 0){ stringBuilder.append("仓库管理费:").append(warehouseManagementFee).append("-->").append(newWarehouseManagementFee).append(";"); } BigDecimal newStorageFee = openOrderDTO.getStorageFee(); BigDecimal storageFee = waybillEntity.getStorageFee(); - if(!storageFee.equals(newStorageFee)){ + if(storageFee.compareTo(newStorageFee) != 0){ stringBuilder.append("仓储费:").append(storageFee).append("-->").append(newStorageFee).append(";"); } BigDecimal newHandlingFee = openOrderDTO.getHandlingFee(); BigDecimal handlingFee = waybillEntity.getHandlingFee(); - if(!handlingFee.equals(newHandlingFee)){ + if(handlingFee.compareTo(newHandlingFee) != 0){ stringBuilder.append("装卸费:").append(handlingFee).append("-->").append(newHandlingFee).append(";"); } + BigDecimal newInstallFee = openOrderDTO.getInstallFee(); + BigDecimal installFee = waybillEntity.getInstallFee(); + if(installFee.compareTo(newInstallFee) != 0){ + stringBuilder.append("安装费:").append(installFee).append("-->").append(newInstallFee).append(";"); + } + BigDecimal newOtherFee = openOrderDTO.getOtherFee(); BigDecimal otherFee = waybillEntity.getOtherFee(); - if(!otherFee.equals(newOtherFee)){ + if(otherFee.compareTo(newOtherFee) != 0){ stringBuilder.append("其他费:").append(otherFee).append("-->").append(newOtherFee).append(";"); } BigDecimal newInsuranceFee = openOrderDTO.getInsuranceFee(); BigDecimal insuranceFee = waybillEntity.getInsuranceFee(); - if(!insuranceFee.equals(newInsuranceFee)){ + if(insuranceFee.compareTo(newInsuranceFee) != 0){ stringBuilder.append("保价费:").append(insuranceFee).append("-->").append(newInsuranceFee).append(";"); } BigDecimal newClaimingValue = openOrderDTO.getClaimingValue(); BigDecimal claimingValue = waybillEntity.getClaimingValue(); - if(!claimingValue.equals(newClaimingValue)){ + if(claimingValue.compareTo(newClaimingValue) != 0){ stringBuilder.append("申明价值:").append(claimingValue).append("-->").append(newClaimingValue).append(";"); } @@ -1733,31 +1789,31 @@ public class OpenOrderServiceImpl implements IOpenOrderService { BigDecimal xianPay = openOrderDTO.getXianPay(); BigDecimal xPay = waybillEntity.getXPay(); - if(!xPay.equals(xianPay)){ + if(xPay.compareTo(xianPay) != 0){ stringBuilder.append("现付:").append(xPay).append("-->").append(xianPay).append(";"); } BigDecimal daoPay = openOrderDTO.getDaoPay(); BigDecimal dPay = waybillEntity.getDPay(); - if(!dPay.equals(daoPay)){ + if(dPay.compareTo(daoPay) != 0){ stringBuilder.append("到付:").append(dPay).append("-->").append(daoPay).append(";"); } BigDecimal yuePay = openOrderDTO.getYuePay(); BigDecimal yPay = waybillEntity.getYPay(); - if(!yPay.equals(yuePay)){ + if(yPay.compareTo(yuePay) != 0){ stringBuilder.append("月结:").append(yPay).append("-->").append(yuePay).append(";"); } BigDecimal huiPay = openOrderDTO.getHuiPay(); BigDecimal hPay = waybillEntity.getHPay(); - if(!hPay.equals(huiPay)){ + if(hPay.compareTo(huiPay) != 0){ stringBuilder.append("月结:").append(hPay).append("-->").append(huiPay).append(";"); } BigDecimal newthirdOperationFee = openOrderDTO.getThirdOperationFee(); BigDecimal thirdOperationFee = waybillEntity.getThirdOperationFee(); - if(!thirdOperationFee.equals(newthirdOperationFee)){ + if(thirdOperationFee.compareTo(newthirdOperationFee) != 0){ stringBuilder.append("三方操作费:").append(thirdOperationFee).append("-->").append(newthirdOperationFee).append(";"); } @@ -1793,8 +1849,22 @@ public class OpenOrderServiceImpl implements IOpenOrderService { BigDecimal newrebate = openOrderDTO.getRebate(); BigDecimal rebate = waybillEntity.getRebate(); - if(!rebate.equals(newrebate)){ - 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(";"); + } + } + + 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(";"); + } } return stringBuilder.toString(); @@ -1810,6 +1880,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService { if(!destination.equals(newDestination)){ stringBuilder.append("到站:").append(destination).append("-->").append(newDestination).append(";"); waybillEntity.setDestination(newDestination); + waybillEntity.setDestinationCode(openOrderDTO.getDestinationCode()); } Long newDestinationWarehouseId = openOrderDTO.getDestinationWarehouseId(); String newDestinationWarehouseName = openOrderDTO.getDestinationWarehouseName(); @@ -1849,7 +1920,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService { String shipperAddress = waybillEntity.getShipperAddress(); shipperAddress = StringUtil.isBlank(shipperAddress)?"":shipperAddress; if(!shipperAddress.equals(newShipperAddress)){ - stringBuilder.append("发货人电话:").append(shipperAddress).append("-->").append(newShipperAddress).append(";"); + stringBuilder.append("发货人地址:").append(shipperAddress).append("-->").append(newShipperAddress).append(";"); waybillEntity.setShipperAddress(newShipperAddress); } @@ -1883,7 +1954,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService { String consigneeAddress = waybillEntity.getConsigneeAddress(); consigneeAddress = StringUtil.isBlank(consigneeAddress)?"":consigneeAddress; if(!shipperAddress.equals(newShipperAddress)){ - stringBuilder.append("发货人地址:").append(consigneeAddress).append("-->").append(newConsigneeAddress).append(";"); + stringBuilder.append("收货人地址:").append(consigneeAddress).append("-->").append(newConsigneeAddress).append(";"); waybillEntity.setConsigneeAddress(newConsigneeAddress); } @@ -1942,7 +2013,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService { } Integer newNum = waybillDetailDTO.getNum(); Integer num = warehouseWayBillDetail.getNum(); - if(num != newNum){ + if(!num.equals(newNum)){ stringBuilder.append("明细更新:").append(warehouseWayBillDetail.getProductName()).append(" 数量修改").append(num).append("-->").append(newNum).append(";"); warehouseWayBillDetail.setNum(newNum); } @@ -1956,7 +2027,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService { Integer newChargeType = waybillDetailDTO.getChargeType(); Integer chargeType = warehouseWayBillDetail.getChargeType(); - if(chargeType != newChargeType){ + if(!chargeType.equals(newChargeType)){ stringBuilder.append("明细更新:").append(warehouseWayBillDetail.getProductName()).append(" 计价方式修改").append(chargeType).append("-->").append(newChargeType).append(";"); warehouseWayBillDetail.setChargeType(newChargeType); } @@ -1973,67 +2044,74 @@ public class OpenOrderServiceImpl implements IOpenOrderService { BigDecimal newTotalFreight = openOrderDTO.getTotalFreight(); BigDecimal totalFreight = waybillEntity.getTotalFreight(); - if(!totalFreight.equals(newTotalFreight)){ + if(totalFreight.compareTo(newTotalFreight) != 0){ stringBuilder.append("运费:").append(totalFreight).append("-->").append(newTotalFreight).append(";"); waybillEntity.setTotalFreight(newTotalFreight); } BigDecimal newDeliveryFee = openOrderDTO.getDeliveryFee(); BigDecimal deliveryFee = waybillEntity.getDeliveryFee(); - if(!deliveryFee.equals(newDeliveryFee)){ + if(deliveryFee.compareTo(newDeliveryFee) != 0){ stringBuilder.append("送货费:").append(deliveryFee).append("-->").append(newDeliveryFee).append(";"); waybillEntity.setDeliveryFee(newDeliveryFee); } BigDecimal newPickupFee = openOrderDTO.getPickupFee(); BigDecimal pickupFee = waybillEntity.getPickupFee(); - if(!pickupFee.equals(newPickupFee)){ + if(pickupFee.compareTo(newPickupFee) != 0){ stringBuilder.append("提货费:").append(pickupFee).append("-->").append(newPickupFee).append(";"); waybillEntity.setPickupFee(newPickupFee); } BigDecimal newWarehouseManagementFee = openOrderDTO.getWarehouseManagementFee(); BigDecimal warehouseManagementFee = waybillEntity.getWarehouseManagementFee(); - if(!warehouseManagementFee.equals(newWarehouseManagementFee)){ + if(warehouseManagementFee.compareTo(newWarehouseManagementFee) != 0){ stringBuilder.append("仓库管理费:").append(warehouseManagementFee).append("-->").append(newWarehouseManagementFee).append(";"); waybillEntity.setWarehouseManagementFee(newWarehouseManagementFee); } BigDecimal newStorageFee = openOrderDTO.getStorageFee(); BigDecimal storageFee = waybillEntity.getStorageFee(); - if(!storageFee.equals(newStorageFee)){ + if(storageFee.compareTo(newStorageFee) != 0){ stringBuilder.append("仓储费:").append(storageFee).append("-->").append(newStorageFee).append(";"); waybillEntity.setStorageFee(newStorageFee); } BigDecimal newHandlingFee = openOrderDTO.getHandlingFee(); BigDecimal handlingFee = waybillEntity.getHandlingFee(); - if(!handlingFee.equals(newHandlingFee)){ + if(handlingFee.compareTo(newHandlingFee) != 0){ stringBuilder.append("装卸费:").append(handlingFee).append("-->").append(newHandlingFee).append(";"); waybillEntity.setHandlingFee(newHandlingFee); } BigDecimal newOtherFee = openOrderDTO.getOtherFee(); BigDecimal otherFee = waybillEntity.getOtherFee(); - if(!otherFee.equals(newOtherFee)){ + if(otherFee.compareTo(newOtherFee) != 0){ stringBuilder.append("其他费:").append(otherFee).append("-->").append(newOtherFee).append(";"); waybillEntity.setOtherFee(newOtherFee); } BigDecimal newInsuranceFee = openOrderDTO.getInsuranceFee(); BigDecimal insuranceFee = waybillEntity.getInsuranceFee(); - if(!insuranceFee.equals(newInsuranceFee)){ + if(insuranceFee.compareTo(newInsuranceFee) != 0){ stringBuilder.append("保价费:").append(insuranceFee).append("-->").append(newInsuranceFee).append(";"); waybillEntity.setInsuranceFee(newInsuranceFee); } BigDecimal newClaimingValue = openOrderDTO.getClaimingValue(); BigDecimal claimingValue = waybillEntity.getClaimingValue(); - if(!claimingValue.equals(newClaimingValue)){ + if(claimingValue.compareTo(newClaimingValue) != 0){ stringBuilder.append("申明价值:").append(claimingValue).append("-->").append(newClaimingValue).append(";"); waybillEntity.setClaimingValue(newClaimingValue); } + BigDecimal newInstallFee = openOrderDTO.getInstallFee(); + BigDecimal installFee = waybillEntity.getInstallFee(); + if(installFee.compareTo(newInstallFee) != 0){ + stringBuilder.append("安装费:").append(installFee).append("-->").append(newInstallFee).append(";"); + waybillEntity.setInstallFee(newInstallFee); + } + String newPayType = openOrderDTO.getPayType(); String payType = waybillEntity.getPayType(); if(!payType.equals(newPayType)){ @@ -2050,35 +2128,35 @@ public class OpenOrderServiceImpl implements IOpenOrderService { BigDecimal xianPay = openOrderDTO.getXianPay(); BigDecimal xPay = waybillEntity.getXPay(); - if(!xPay.equals(xianPay)){ + if(xPay.compareTo(xianPay) != 0){ stringBuilder.append("现付:").append(xPay).append("-->").append(xianPay).append(";"); waybillEntity.setXPay(xianPay); } BigDecimal daoPay = openOrderDTO.getDaoPay(); BigDecimal dPay = waybillEntity.getDPay(); - if(!dPay.equals(daoPay)){ + if(dPay.compareTo(daoPay) != 0){ stringBuilder.append("到付:").append(dPay).append("-->").append(daoPay).append(";"); waybillEntity.setDPay(daoPay); } BigDecimal yuePay = openOrderDTO.getYuePay(); BigDecimal yPay = waybillEntity.getYPay(); - if(!yPay.equals(yuePay)){ + if(yPay.compareTo(yuePay) != 0){ stringBuilder.append("月结:").append(yPay).append("-->").append(yuePay).append(";"); waybillEntity.setYPay(yuePay); } BigDecimal huiPay = openOrderDTO.getHuiPay(); BigDecimal hPay = waybillEntity.getHPay(); - if(!hPay.equals(huiPay)){ + if(hPay.compareTo(huiPay) != 0){ stringBuilder.append("月结:").append(hPay).append("-->").append(huiPay).append(";"); waybillEntity.setHPay(huiPay); } BigDecimal newthirdOperationFee = openOrderDTO.getThirdOperationFee(); BigDecimal thirdOperationFee = waybillEntity.getThirdOperationFee(); - if(!thirdOperationFee.equals(newthirdOperationFee)){ + if(thirdOperationFee.compareTo(newthirdOperationFee) != 0){ stringBuilder.append("三方操作费:").append(thirdOperationFee).append("-->").append(newthirdOperationFee).append(";"); waybillEntity.setThirdOperationFee(newthirdOperationFee); } @@ -2120,9 +2198,24 @@ public class OpenOrderServiceImpl implements IOpenOrderService { BigDecimal newrebate = openOrderDTO.getRebate(); BigDecimal rebate = waybillEntity.getRebate(); - if(!rebate.equals(newrebate)){ - stringBuilder.append("回扣:").append(rebate).append("-->").append(newrebate).append(";"); - waybillEntity.setRebate(newrebate); + if(!Objects.isNull(rebate)){ + if(rebate.compareTo(newrebate) != 0){ + stringBuilder.append("回扣:").append(rebate).append("-->").append(newrebate).append(";"); + waybillEntity.setRebate(newrebate); + } + } + String newRemark = openOrderDTO.getRemark(); + String remark = waybillEntity.getRemark(); + if(!StringUtil.isBlank(remark)){ + if(!remark.equals(newRemark)){ + stringBuilder.append("备注:").append(remark).append("-->").append(newRemark).append(";"); + waybillEntity.setRemark(newRemark); + } + }else{ + if(!StringUtil.isBlank(newRemark)){ + stringBuilder.append("备注:").append(remark).append("-->").append(newRemark).append(";"); + waybillEntity.setRemark(newRemark); + } } return stringBuilder.toString(); diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseTaskApiController.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseTaskApiController.java index c4a08d7fe..7534eafeb 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseTaskApiController.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseTaskApiController.java @@ -5,10 +5,8 @@ import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import com.logpm.basicdata.entity.BasicdataWarehouseEntity; import com.logpm.basicdata.feign.IBasicdataWarehouseClient; -import com.logpm.warehouse.dto.QuestDetailDTO; +import com.logpm.distribution.entity.DistributionStockListEntity; import com.logpm.warehouse.dto.TaskSearchDTO; -import com.logpm.warehouse.entity.QuestDetailEntity; -import org.springblade.core.mp.support.Query; import com.logpm.warehouse.service.ITaskQuestService; import com.logpm.warehouse.vo.TaskContractVO; import com.logpm.warehouse.vo.TaskQuestApiVO; @@ -20,13 +18,15 @@ import lombok.AllArgsConstructor; import lombok.extern.log4j.Log4j2; import org.springblade.common.exception.CustomerException; import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; import org.springblade.core.tool.api.R; import org.springblade.core.tool.utils.Func; import org.springblade.core.tool.utils.StringUtil; import org.springframework.web.bind.annotation.*; -import java.util.*; -import java.util.concurrent.atomic.AtomicReference; +import java.util.List; +import java.util.Objects; +import java.util.Optional; @Log4j2 @@ -692,4 +692,39 @@ public class WarehouseTaskApiController { } + @PostMapping("/findStockList") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "查询库存品集合", notes = "code,type") + public R findStockList(@RequestBody TaskSearchDTO taskSearchDTO) { + String method = "###########findStockList: "; + log.info(method+"查询物料集合 参数:{}",taskSearchDTO); + List marketNames = taskSearchDTO.getMarketNames(); + String materialCode = taskSearchDTO.getMaterialCode(); + try{ + + //当前登录人选择的仓库 + BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); + if(Objects.isNull(myCurrentWarehouse)){ + log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse); + return R.fail(403,"仓库信息为空"); + } + taskSearchDTO.setWarehouseId(myCurrentWarehouse.getId()); + + if(StringUtil.isBlank(materialCode)){ + log.warn(method+"物料编码为空 materialCode={}",materialCode); + return R.fail(405,"物料编码为空"); + } + + List list = taskQuestService.findStockList(taskSearchDTO); + return R.data(list); + }catch (CustomerException e){ + log.warn(e.message); + return R.fail(e.code,e.message); + }catch (Exception e){ + log.error(method+"系统异常,联系管理员",e); + return R.fail(500,"系统异常,联系管理员"); + } + } + + } diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/dto/TaskSearchDTO.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/dto/TaskSearchDTO.java index ea2cca650..c6088d168 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/dto/TaskSearchDTO.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/dto/TaskSearchDTO.java @@ -17,11 +17,9 @@ package com.logpm.warehouse.dto; -import com.logpm.warehouse.vo.TaskPackagelistVO; import io.swagger.annotations.ApiModelProperty; import lombok.Data; -import java.util.ArrayList; import java.util.List; diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/TaskQuestMapper.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/TaskQuestMapper.java index cbe188bea..864f0228b 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/TaskQuestMapper.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/TaskQuestMapper.java @@ -16,6 +16,7 @@ */ package com.logpm.warehouse.mapper; +import com.logpm.distribution.entity.DistributionStockListEntity; import com.logpm.warehouse.dto.TaskSearchDTO; import com.logpm.warehouse.entity.QuestDetailChildEntity; import com.logpm.warehouse.entity.QuestDetailEntity; @@ -183,4 +184,6 @@ public interface TaskQuestMapper extends BaseMapper { List findNoAllocationIdAndTray(@Param("questNum") String questNum); List findListByTrayCode(@Param("questNum") String questNum, @Param("trayCode") String trayCode); + + List findStockList(@Param("param") TaskSearchDTO taskSearchDTO); } diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/TaskQuestMapper.xml b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/TaskQuestMapper.xml index a9d6ce07b..737d20b48 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/TaskQuestMapper.xml +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/TaskQuestMapper.xml @@ -640,4 +640,18 @@ + + diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/ITaskQuestService.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/ITaskQuestService.java index 24c23d65d..8479466fc 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/ITaskQuestService.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/ITaskQuestService.java @@ -18,6 +18,7 @@ package com.logpm.warehouse.service; import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.logpm.distribution.entity.DistributionStockListEntity; import com.logpm.warehouse.dto.QuestDetailDTO; import com.logpm.warehouse.dto.TaskQuestDTO; import com.logpm.warehouse.dto.TaskSearchDTO; @@ -291,4 +292,7 @@ public interface ITaskQuestService extends BaseService { List findNoAllocationIdAndTray(String questNum); List findListByTrayCode(String questNum, String trayCode); + + List findStockList(TaskSearchDTO taskSearchDTO); + } diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/TaskQuestServiceImpl.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/TaskQuestServiceImpl.java index c6b6b8a2c..57c826396 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/TaskQuestServiceImpl.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/TaskQuestServiceImpl.java @@ -1494,6 +1494,11 @@ public class TaskQuestServiceImpl extends BaseServiceImpl findStockList(TaskSearchDTO taskSearchDTO) { + return baseMapper.findStockList(taskSearchDTO); + } + /** * 查询货位上的数据 * diff --git a/blade-service/logpm-warehouse/src/main/resources/application-dev.yml b/blade-service/logpm-warehouse/src/main/resources/application-dev.yml index 401f7ed83..d0f017ede 100644 --- a/blade-service/logpm-warehouse/src/main/resources/application-dev.yml +++ b/blade-service/logpm-warehouse/src/main/resources/application-dev.yml @@ -12,7 +12,7 @@ server: spring: #rabbitmq配置 rabbitmq: - host: 192.168.10.46 + host: 192.168.2.46 port: 5672 username: admin password: admin