Browse Source

Merge remote-tracking branch 'origin/dev' into dev

visual
zhaoqiaobo 5 months ago
parent
commit
9be42136bf
  1. 8
      blade-biz-common/src/main/java/org/springblade/common/constant/DictBizConstant.java
  2. 4
      blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/entity/AftersalesWorkOrderEntity.java
  3. 13
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataClientEntity.java
  4. 3
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionStockArticleClient.java
  5. 1
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/LoadCarsDTO.java
  6. 9
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/feign/ITrunklineAdvanceDetailClient.java
  7. 14
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/controller/AftersalesWorkOrderController.java
  8. 29
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderExcel.java
  9. 3
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.java
  10. 179
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.xml
  11. 7
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/IAftersalesWorkOrderService.java
  12. 2
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesAbnormalRecordServiceImpl.java
  13. 56
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java
  14. 6
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/excel/BasicdataClientExcel.java
  15. 83
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataClientServiceImpl.java
  16. 11
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockArticleController.java
  17. 5
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionStockArticleClient.java
  18. 6
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/BusinessPreOrderDataQueueHandler.java
  19. 8
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockArticleService.java
  20. 102
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java
  21. 26
      blade-service/logpm-patch/src/main/java/com/logpm/patch/jobhandle/SyncOrderInfoToPlatform.java
  22. 16
      blade-service/logpm-patch/src/main/java/com/logpm/patch/mapper/WarehouseMappingDataMapper.java
  23. 50
      blade-service/logpm-patch/src/main/java/com/logpm/patch/mapper/WarehouseMappingDataMapper.xml
  24. 10
      blade-service/logpm-patch/src/main/java/com/logpm/patch/service/IWarehouseMappingDataService.java
  25. 27
      blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/WarehouseMappingDataServiceImpl.java
  26. 45
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/CarsLoadController.java
  27. 144
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/excel/TrunklineCarsLoadExcel.java
  28. 10
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/feign/TrunklineAdvanceDetailClient.java
  29. 8
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadMapper.java
  30. 152
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadMapper.xml
  31. 7
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadService.java
  32. 13
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceServiceImpl.java
  33. 110
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java

8
blade-biz-common/src/main/java/org/springblade/common/constant/DictBizConstant.java

@ -5,7 +5,7 @@ public class DictBizConstant {
public static final String DELIVERY_METHOD = "delivery_method";//发送方式
public static final String URGENCY = "urgency";//紧急程度
public static final String WAY_BILL_STATUS = "way_bill_status";//运单状态
public static final String DISTRIBUTION_TYPE = "distribution_type";//服务类型
public static final String DISTRIBUTION_TYPE = "distribution_type";//客户配送类型
public static final String FREEZE_STATUS = "freeze_status";//冻结状态
public static final String DEFAULT_PASSWORD = "default_password";//默认密码
public static final String DEFAULT_MALL_ROLE_ID = "default_mall_role_id";//默认角色
@ -115,6 +115,12 @@ public class DictBizConstant {
//---------------2023-11-18
public static final String OPEN_ORDER_PAY_TYPE = "open_order_pay_type";
public static final String OPEN_ORDER_PAY_WAY = "open_order_pay_way";
/**
* 结算对象类型
*/
public static final String CLEAN_OBJ_TYPE = "clean_obj_type";
public static final String OPEN_ORDER_DELIVERY_WAY = "open_order_delivery_way";
public static final String OPEN_ORDER_URGENCY = "open_order_urgency";
public static final String OPEN_ORDER_RECEIPT = "open_order_receipt";

4
blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/entity/AftersalesWorkOrderEntity.java

@ -312,6 +312,10 @@ public class AftersalesWorkOrderEntity extends TenantEntity {
private String totalAmountNum;
@TableField(exist=false)
private String workOrderStatusNameS;
@TableField(exist=false)
private String resultTypes;
@TableField(exist=false)
private String compensationMethods;

13
blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataClientEntity.java

@ -142,10 +142,15 @@ public class BasicdataClientEntity extends TenantEntity {
*/
@ApiModelProperty(value = "联系电话")
private String phone;
/**
* 客户类型;1 C端 2 B端
* 配送服务类型
* 1.商配 2市配 3自提 4三方中转
* 该值未 配送包含配送的服务类中 存在的配送服务方式
* 为了减少查询 做的冗余字段
*/
@ApiModelProperty(value = "客户类型;1 C端 2 B端")
@ApiModelProperty(value = "配送服务类型")
private Integer typeService;
/**
@ -213,13 +218,13 @@ public class BasicdataClientEntity extends TenantEntity {
* 合同开始时间
*/
@ApiModelProperty(value = "合同开始时间")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd", timezone = "GMT+8")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date contractStartTime;
/**
* 合同结束时间
*/
@ApiModelProperty(value = "合同结束时间")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd", timezone = "GMT+8")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date contractEntTime;
@ApiModelProperty(value = "默认付款方式 1现付 2到付 3月结 4回付 5内部结算 ")

3
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionStockArticleClient.java

@ -222,4 +222,7 @@ public interface IDistributionStockArticleClient {
@PostMapping(API_PREFIX + "/findWaybillNoByOrderIds")
List<DistributionStockArticleEntity> findWaybillNoByOrderIds(@RequestBody Set<Long> stockArticleIds);
@PostMapping(API_PREFIX + "/updateEntity")
void updateEntity(@RequestBody DistributionStockArticleEntity stockArticleEntity);
}

1
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/LoadCarsDTO.java

@ -213,5 +213,6 @@ public class LoadCarsDTO implements Serializable {
private String arriveTime;
private String createUserName;
private String createTime;
private String ids;
}

9
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/feign/ITrunklineAdvanceDetailClient.java

@ -28,4 +28,13 @@ public interface ITrunklineAdvanceDetailClient {
@GetMapping(API_PREFIX+"/findListByWaybillId")
List<TrunklineAdvanceDetailEntity> findListByWaybillId(@RequestParam Long waybillId);
/**
* 查询暂存单详情
* @param orderCode
* @param warehouseIds
* @return
*/
@GetMapping(API_PREFIX+"/selectByOrderCodeAndWarehouseId")
List<TrunklineAdvanceDetailEntity> selectByOrderCodeAndWarehouseId(@RequestParam String orderCode,@RequestParam String warehouseIds);
}

14
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/controller/AftersalesWorkOrderController.java

@ -722,6 +722,20 @@ public class AftersalesWorkOrderController extends BladeController {
ExcelUtil.export(response, "异常工单数据" + DateUtil.time(), "异常工单数据", list, AftersalesWorkOrderExcel.class);
}
/**
* 导出数据
*
*/
@GetMapping("/exportWorkOrder")
@ApiOperationSupport(order = 9)
@ApiOperation(value = "导出数据", notes = "传入aftersalesWorkOrder")
public void exportWorkOrder(@ApiIgnore @RequestParam Map<String, Object> aftersalesWorkOrder, BladeUser bladeUser, HttpServletResponse response) {
// List<AftersalesWorkOrderExcel> list = aftersalesWorkOrderService.exportAftersalesWorkOrder(aftersalesWorkOrder);
List<AftersalesWorkOrderExcel> list = aftersalesWorkOrderService.exportWorkOrder(aftersalesWorkOrder);
ExcelUtil.export(response, "异常工单数据" + DateUtil.time(), "异常工单数据", list, AftersalesWorkOrderExcel.class);
}
@GetMapping("/exportAftersalesWorkOrderList")
@ApiOperationSupport(order = 9)
@ApiOperation(value = "导出数据", notes = "传入aftersalesWorkOrder")

29
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderExcel.java

@ -49,8 +49,7 @@ public class AftersalesWorkOrderExcel implements Serializable {
@ColumnWidth(20)
@ExcelProperty("工单异常类型")
private String workOrderTypeName;
@ExcelIgnore //工单异常类型
private String workOrderType;
/**
* 发现节点;提货发货干线库内配送其他签收PC安装PC
*/
@ -107,7 +106,8 @@ public class AftersalesWorkOrderExcel implements Serializable {
*/
@ColumnWidth(20)
@ExcelProperty("工单状态")
private String workOrderStatus;
private String workOrderStatusName;
@ColumnWidth(20)
@ExcelProperty("品牌")
private String brandName;
@ -241,4 +241,27 @@ public class AftersalesWorkOrderExcel implements Serializable {
private String processNumber;
/**
* 钉钉流程号
*/
@ColumnWidth(20)
@ExcelProperty("赔款金额")
private String totalAmountNum;
/**
* 钉钉流程号
*/
@ColumnWidth(20)
@ExcelProperty("处理结果")
private String resultTypes;
/**
* 钉钉流程号
*/
@ColumnWidth(20)
@ExcelProperty("赔付方式")
private String compensationMethods;
}

3
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.java

@ -108,4 +108,7 @@ public interface AftersalesWorkOrderMapper extends BaseMapper<AftersalesWorkOrde
List<AftersalesWorkOrderExcel> selectWaitAftersalesWorkOrderList(@Param("warehouseIds")List<Long> warehouseListIds);
List<AftersalesWorkOrderExcel> exportListOwn(@Param("param") AftersalesWorkOrderEntity workOrderEntity);
}

179
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.xml

@ -89,7 +89,183 @@
lawo.customer_service_name customerServiceName,
lawo.warehouse_id warehouseId,
lawo.investigation_process investigationProcess,
lawo.customer_service_id customerServiceId
lawo.customer_service_id customerServiceId,
IFNULL( sum( lapr.money ), 0 ) AS totalAmountNum,
GROUP_CONCAT(DISTINCT lapr.result_type) AS resultTypes,
GROUP_CONCAT(DISTINCT lapr.compensation_method) AS compensationMethods
FROM
logpm_aftersales_work_order lawo
LEFT JOIN logpm_aftersales_processor lap ON lawo.id = lap.work_order_id
AND lap.types_of = '2'
AND lap.conditions IN ( 1, 2 )
LEFT JOIN logpm_aftersales_completion_record lacr ON lacr.work_order_id = lawo.id
AND lacr.is_deleted = '0'
LEFT JOIN (SELECT
a.id,
group_concat( DISTINCT b.`first` SEPARATOR ',' ) AS `first`,
group_concat( DISTINCT b.secondary SEPARATOR ',' ) AS secondary,
group_concat( DISTINCT b.brand_name SEPARATOR ',' ) AS brand_name,
group_concat( DISTINCT b.package_code SEPARATOR ',' ) AS package_code,
group_concat( DISTINCT b.waybill_number SEPARATOR ',' ) AS waybill_number
FROM
logpm_aftersales_work_order AS a
LEFT JOIN logpm_aftersales_abnormal_package AS b ON a.id = b.work_order_id
WHERE
a.is_deleted = 0
AND b.is_deleted = 0
GROUP BY
a.id) AS t ON t.id = lawo.id
LEFT JOIN logpm_aftersales_processing_results AS lapr ON lapr.work_order_id = lawo.id
<where>
lawo.is_deleted = 0
<if test="param.workOrderStatusNameS != null and param.workOrderStatusNameS != '' ">and lawo.work_order_status = #{param.workOrderStatusNameS } </if>
<if test="param.id != null and param.id != '' ">and lawo.id = #{param.id } </if>
<if test="param.workOrderType != null and param.workOrderType != '' ">and lawo.work_order_type = #{param.workOrderType } </if>
<if test="param.initiationIdentification != null and param.initiationIdentification != '' ">and lawo.initiation_identification = #{param.initiationIdentification } </if>
<if test="param.discoveryNode != null and param.discoveryNode != '' ">and lawo.discovery_node = #{param.discoveryNode } </if>
<if test="param.workOrderNumber != null and param.workOrderNumber != '' ">and lawo.work_order_number like concat('%',#{param.workOrderNumber },'%') </if>
<if test="param.waybillNumber != null and param.waybillNumber != '' ">and lawo.waybill_number like concat('%', #{param.waybillNumber },'%') </if>
<if test="param.orderCode != null and param.orderCode != '' ">and lawo.order_code like concat('%', #{param.orderCode },'%') </if>
<if test="param.trainNumber != null and param.trainNumber != '' ">and lawo.train_number like concat('%', #{param.trainNumber },'%') </if>
<if test="param.vehicleRoute != null and param.vehicleRoute != '' ">and lawo.vehicle_route like concat('%', #{param.vehicleRoute },'%') </if>
<if test="param.deliverGoodsTime != null ">and date_format(from_unixtime( lawo.deliver_goods_time),'%Y-%m-%d') = date_format(#{param.deliverGoodsTime },'%Y-%m-%d') </if>
<if test="param.discoveryTime != null ">and date_format(from_unixtime(lawo.discovery_time),'%Y-%m-%d') = date_format( #{param.discoveryTime},'%Y-%m-%d') </if>
<if test="param.warehousingTime != null "> and date_format(from_unixtime(lawo.warehousing_time),'%Y-%m-%d') = date_format( #{param.warehousingTime},'%Y-%m-%d') </if>
<if test="param.deliveryTime != null ">and date_format(from_unixtime( lawo.delivery_time),'%Y-%m-%d') = date_format(#{param.deliveryTime} param.deliveryTime,'%Y-%m-%d') </if>
<if test="param.auditTime != null ">and date_format(from_unixtime(lawo.audit_time),'%Y-%m-%d') = date_format(#{param.auditTime},'%Y-%m-%d') </if>
<if test="param.entryTime != null ">and date_format(from_unixtime(lawo.entry_time),'%Y-%m-%d') = date_format(#{param.entryTime},'%Y-%m-%d') </if>
<if test="param.overTime != null ">and date_format(from_unixtime(lawo.over_time),'%Y-%m-%d') = date_format(#{param.overTime}),'%Y-%m-%d') </if>
<if test="param.waybillMall != null and param.waybillMall != '' ">and lawo.waybill_mall like concat('%', #{param.waybillMall },'%') </if>
<if test="param.deliveryDriver != null and param.deliveryDriver != '' ">and lawo.delivery_driver = #{param.deliveryDriver } </if>
<if test="param.customerServiceState != null and param.customerServiceState == 30 "> and lawo.work_order_status in ('40') </if>
<if test="param.customerServiceState != null and param.customerServiceState == 40 "> and lawo.work_order_status in ('20') </if>
<if test="param.customerServiceState != null and param.customerServiceState == 31 "> and lawo.work_order_status in ('30') </if>
<if test="param.customerServiceState != null and param.customerServiceState == 60 "> and lawo.work_order_status in ('30') </if>
<if test="param.customerServiceState != null and param.customerServiceState == 10 "> and lawo.work_order_status in ('70','80','100') </if>
<if test="param.customerServiceId != null and param.customerServiceId != '' ">and lawo.customer_service_id = #{param.customerServiceId } </if>
<if test="param.customerServiceName != null and param.customerServiceName != '' ">and lawo.customer_service_name like concat('%', #{param.customerServiceName },'%') </if>
<if test="param.waybillMallId != null and param.waybillMallId != '' ">and lawo.waybill_mall_id = #{param.waybillMallId } </if>
<if test="param.problemDescription != null and param.problemDescription != '' ">and lawo.problem_description = #{param.problemDescription} </if>
<if test="param.warehouseId != null and param.warehouseId != '' and param.handleStatus != null ">and (lap.warehouse_id = #{param.warehouseId} OR lap.business_id = #{param.warehouseId}) </if>
<if test="param.personResponsible != null and param.personResponsible != '' ">and lawo.person_responsible = #{param.personResponsible } </if>
<if test="param.processNumber != null and param.processNumber != '' ">and lawo.process_number = #{param.processNumber } </if>
<if test="param.reviewedBy != null and param.reviewedBy != '' ">and lawo.reviewed_by = #{param.reviewedBy } </if>
<if test="param.operator != null and param.operator != '' ">and lawo.operator = #{param.operator } </if>
<if test="param.responsiblePerson != null and param.responsiblePerson != '' ">and lawo.responsible_person = #{param.responsiblePerson } </if>
<if test="param.processedBy != null and param.processedBy != '' ">and lawo.processed_by = #{param.processedBy} </if>
<if test="param.investigationProcess != null and param.investigationProcess != '' ">and lawo.investigation_process = #{param.investigationProcess } </if>
<if test="param.relatedWorkOrdersId != null and param.relatedWorkOrdersId != '' ">and lawo.related_work_orders_id = #{param.relatedWorkOrdersId } </if>
<if test="param.workOrderStatus != null and param.workOrderStatus != ''">and lawo.work_order_status in( #{param.workOrderStatus }) </if>
<if test="param.customerIdentification != null and param.customerIdentification == 1 ">
and lawo.work_order_status IN ( '10', '20', '21', '30', '40', '50', '60', '70', '80', '90' ,'100','110')
</if>
<if test="param.handleStatus != null and param.handleStatus == 40 "> and lawo.work_order_status in ('10') and lap.types_of = '2' and lap.processing_status in ('1') </if>
<if test="param.handleStatus != null and param.handleStatus == 50 "> and lawo.work_order_status in ('20') and lap.types_of = '2' </if>
<if test="param.handleStatus!= null and param.handleStatus == 30"> and lawo.work_order_status in (21,30) and lap.processing_status = '4' </if>
<if test="param.handleStatus!= null and param.handleStatus == 10 ">and lap.types_of = '2' </if>
<if test="param.handleStatus!= null and param.handleStatus == 20 ">and ((lawo.work_order_status in (80,100,70) OR lacr.warehouse_id=#{param.warehouseId})) </if>
<if test="param.workOrderType != null and param.workOrderType != '' ">and lawo.work_order_type = #{param.workOrderType } </if>
<if test="param.discoveryNode != null and param.discoveryNode != '' ">and lawo.discovery_node = #{param.discoveryNode } </if>
<if test="param.workOrderNumber != null and param.workOrderNumber != '' ">and lawo.work_order_number like concat('%',#{param.workOrderNumber },'%') </if>
<if test="param.trainNumber != null and param.trainNumber != '' ">and lawo.train_number like concat('%', #{param.trainNumber },'%') </if>
<if test="param.vehicleRoute != null and param.vehicleRoute != '' ">and lawo.vehicle_route like concat('%', #{param.vehicleRoute },'%') </if>
<if test="param.workOrderStatus != null and param.workOrderStatus != '' and param.handleStatus != 40 "> and lawo.work_order_status in ( #{param.workOrderStatus }) </if>
<if test="param.customerServiceState!= null and param.customerServiceState == 80 ">and lawo.work_order_status in ('10') </if>
<if test="param.first != null and param.first != '' ">and t.first like concat('%',#{param.first},'%') </if>
<if test="param.secondary != null and param.secondary != '' ">and t.secondary like concat('%',#{param.secondary},'%') </if>
<if test="param.brandName != null and param.brandName != '' ">and t.brand_name like concat('%',#{param.brandName},'%') </if>
<if test="param.waybillNumber != null and param.waybillNumber != ''">and t.waybill_number like concat('%',#{param.waybillNumber},'%') </if>
<if test="param.packageCode != null and param.packageCode != ''">and t.package_code like concat('%',#{param.packageCode},'%') </if>
</where>
group by lawo.id
ORDER BY lawo.create_time DESC
</select>
<select id="exportListOwn" resultType="com.logpm.aftersales.excel.AftersalesWorkOrderExcel">
SELECT DISTINCT
lawo.id,
CASE
lawo.work_order_type
WHEN 1 THEN
'货损'
WHEN 2 THEN
'少货'
WHEN 3 THEN
'窜货'
WHEN 4 THEN
'加急'
WHEN 5 THEN
'其他' ELSE '未知类型'
END workOrderTypeName,
CASE
lawo.discovery_node
WHEN 1 THEN
'提货环节'
WHEN 2 THEN
'发货环节'
WHEN 3 THEN
'干线卸车环节'
WHEN 4 THEN
'库内作业环节'
WHEN 5 THEN
'配送装车环节'
WHEN 6 THEN
'配送签收环节'
WHEN 7 THEN
'安装环节'
WHEN 7 THEN
'其他' ELSE '未知节点'
END discoveryNodeName,
CASE
lawo.work_order_status
WHEN '10' THEN '待处理'
WHEN '20' THEN '处理中'
WHEN '30' THEN '已处理'
WHEN '40' THEN '待审核'
WHEN '50' THEN '已审核'
WHEN '60' THEN '超时未处理'
WHEN '70' THEN '客服介入中'
WHEN '80' THEN '仲裁中'
WHEN '90' THEN '理赔金额未出'
WHEN '21' THEN '处理结果已提交'
WHEN '100' THEN '申述中'
WHEN '110' THEN '已结束' ELSE '未知状态'
END workOrderStatusName,
lawo.work_order_number,
lawo.order_code,
lawo.train_number,
t.`first` AS `first`,
t.secondary AS secondary,
t.brand_name AS brandName,
t.waybill_number AS waybillNumber,
t.package_code AS packageCode,
lawo.vehicle_route,
lawo.deliver_goods_time,
lawo.discovery_time,
lawo.warehousing_time,
lawo.waybill_mall,
lawo.remarks,
lawo.delivery_time,
lawo.delivery_driver,
lawo.problem_description,
lawo.responsible_person,
lawo.processed_by,
lawo.create_time,
lawo.over_time,
lawo.reviewed_by,
lawo.audit_time,
lawo.entry_time,
lawo.operator,
lawo.person_responsible,
lawo.process_number,
lawo.customer_service_name customerServiceName,
lawo.warehouse_id warehouseId,
lawo.investigation_process investigationProcess,
lawo.customer_service_id customerServiceId,
IFNULL( sum( lapr.money ), 0 ) AS totalAmountNum,
GROUP_CONCAT(DISTINCT lapr.result_type) AS resultTypes,
GROUP_CONCAT(DISTINCT lapr.compensation_method) AS compensationMethods
FROM
logpm_aftersales_work_order lawo
LEFT JOIN logpm_aftersales_processor lap ON lawo.id = lap.work_order_id
@ -112,6 +288,7 @@
AND b.is_deleted = 0
GROUP BY
a.id) AS t ON t.id = lawo.id
LEFT JOIN logpm_aftersales_processing_results AS lapr ON lapr.work_order_id = lawo.id
<where>
lawo.is_deleted = 0
<if test="param.workOrderStatusNameS != null and param.workOrderStatusNameS != '' ">and lawo.work_order_status = #{param.workOrderStatusNameS } </if>

7
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/IAftersalesWorkOrderService.java

@ -300,4 +300,11 @@ public interface IAftersalesWorkOrderService extends BaseService<AftersalesWorkO
AftersalesWorkOrderListExcelDTO exportAftersalesWorkOrderList();
/**
* 工单导出
* @param aftersalesWorkOrder
* @return
*/
List<AftersalesWorkOrderExcel> exportWorkOrder(Map<String, Object> aftersalesWorkOrder);
}

2
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesAbnormalRecordServiceImpl.java

@ -160,7 +160,7 @@ public class AftersalesAbnormalRecordServiceImpl extends BaseServiceImpl<Aftersa
abnormalRecordEntity.setRemark("本车次少货("+upWarehouseName+" "+AuthUtil.getNickName()+")");
}else if(dealType.equals(4)){
Long warehouseId = abnormalRecordDTO.getWarehouseId();
Long warehouseId = abnormalRecordEntity.getWarehouseId();
R r = trunklineCarsLoadScanClient.adnormalHasStock(carsLoadScanId,warehouseId);
int code = r.getCode();
if(code != 200){

56
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java

@ -260,7 +260,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
BeanUtil.copyProperties(i, aftersalesWorkOrderExcel);
aftersalesWorkOrderList.add(aftersalesWorkOrderExcel);
aftersalesWorkOrderExcel.setWorkOrderTypeName(DictBizCache.getValue(DictBizConstant.PC_WORK_ORDER, i.getWorkOrderStatus()));
aftersalesWorkOrderExcel.setWorkOrderStatus(DictBizCache.getValue(DictBizConstant.WORK_ORDER_STATUS, i.getWorkOrderStatus()));
// aftersalesWorkOrderExcel.setWorkOrderStatus(DictBizCache.getValue(DictBizConstant.WORK_ORDER_STATUS, i.getWorkOrderStatus()));
if ("PC".equals(aftersalesWorkOrderExcel.getInitiationIdentification())) {
//PC
aftersalesWorkOrderExcel.setDiscoveryNodeName(DictBizCache.getValue(DictBizConstant.PC_DISCOVERY_NODE, i.getDiscoveryNode()));
@ -2587,4 +2587,58 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
return null;
}
@Override
public List<AftersalesWorkOrderExcel> exportWorkOrder(Map<String, Object> aftersalesWorkOrder) {
String o = (String) aftersalesWorkOrder.get("ids");
if (!Objects.isNull(o)) {
aftersalesWorkOrder.put("ids", o);
}
//查询用户角色信息
BladeUser user = AuthUtil.getUser();
String roleName = user.getRoleName();
//查询客服岗位
List<DictBiz> warehouseType = DictBizCache.getList("after_sales_visits");
if (warehouseType.isEmpty()) {
throw new ServiceException("注意,注意!售后访问字典未配置!请配置!");
}
List<String> roleList = Arrays.asList(user.getRoleName().split(","));
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if (!roleList.isEmpty()) {
Optional<DictBiz> matchingDictBiz = warehouseType.stream()
.filter(i -> roleList.contains(i.getDictValue()))
.findFirst();
Object workOrderStatus = aftersalesWorkOrder.get("workOrderStatus");
if (matchingDictBiz.isPresent()) {
String dictValue = matchingDictBiz.get().getDictKey();
switch (dictValue) {
case "1": // 客服经理
updateWorkOrderForManager(aftersalesWorkOrder, workOrderStatus);
break;
case "2": // 营业部客服
if (Objects.isNull(myCurrentWarehouse)){
//营业部客服未选择仓库进行作业
throw new ServiceException("请选择仓库");
}
updateWorkOrderForSales(aftersalesWorkOrder, workOrderStatus);
break;
case "3": // 职能客服
updateWorkOrderForFunctional(aftersalesWorkOrder, workOrderStatus, user.getUserId());
break;
}
} else {
updateWorkOrderForOthers(aftersalesWorkOrder, workOrderStatus);
}
}else {
throw new CustomerException("当前登录人无工单操作权限!!!");
}
AftersalesWorkOrderEntity workOrderEntity = JSONObject.parseObject(JSONObject.toJSONString(aftersalesWorkOrder), AftersalesWorkOrderEntity.class);
List<AftersalesWorkOrderExcel> list = baseMapper.exportListOwn(workOrderEntity);
return list;
}
}

6
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/excel/BasicdataClientExcel.java

@ -184,6 +184,12 @@ public class BasicdataClientExcel implements Serializable {
private String defaultPaymentMethods;
/**
* 结算对象类型1.工厂 2.商场 3.个人
*/
@ExcelProperty("结算对象类型")
private String cleanObjType;
}

83
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataClientServiceImpl.java

@ -69,6 +69,7 @@ import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.core.tool.utils.StringUtil;
import org.springblade.system.cache.DictBizCache;
import org.springblade.system.entity.DictBiz;
import org.springblade.system.feign.IRegionFeign;
@ -93,7 +94,7 @@ import java.util.Set;
import java.util.function.Predicate;
import java.util.stream.Collectors;
import static org.springblade.common.constant.DictBizConstant.OPEN_ORDER_PAY_WAY;
import static org.springblade.common.constant.DictBizConstant.*;
/**
* 基础客户表 服务实现类
@ -506,6 +507,13 @@ public class BasicdataClientServiceImpl extends BaseServiceImpl<BasicdataClientM
@Transactional(rollbackFor = Exception.class)
public void importClient(List<BasicdataClientExcel> data, Boolean isCovered) {
log.info("客户导入数据");
QueryWrapper<BasicdataClientEntity> queryWrapper = new QueryWrapper<>();
List<BasicdataClientEntity> basicdataClients = baseMapper.selectList(queryWrapper);
// 验证数据
checkImportBasicDataClient(data,basicdataClients);
List<BasicdataStoreContactEntity> storeContactEntities = new ArrayList<>(); // 联系人
List<BasicdataTripartiteMallEntity> tripartiteMallEntities = new ArrayList<>(); // 三方商场
List<BasicdataStoreBrandEntity> storeBrandEntities = new ArrayList<>(); // 品牌
@ -515,34 +523,24 @@ public class BasicdataClientServiceImpl extends BaseServiceImpl<BasicdataClientM
List<BasicdataWarehouseEntity> list1 = warehouseService.warehouseListqx();
List<DictBiz> dictBizs = DictBizCache.getList(DictBizConstant.DISTRIBUTION_TYPE);//商 市 自
List<DictBiz> clientBiz = DictBizCache.getList(DictBizConstant.CLIENT_TYPE); //客 工
List<DictBiz> freightBiz = DictBizCache.getList(DictBizConstant.BASIC_FREIGHT_TYPE); //客 工
List<DictBiz> freightBiz = DictBizCache.getList(BASIC_FREIGHT_TYPE); //客 工
Set<String> set = new HashSet<>();
QueryWrapper<BasicdataClientEntity> queryWrapper = new QueryWrapper<>();
List<BasicdataClientEntity> basicdataClients = baseMapper.selectList(queryWrapper);
LambdaQueryWrapper<BasicdataBrandEntity> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(BasicdataBrandEntity::getIsDeleted, 0);
List<BasicdataBrandEntity> basicdataBrandEntityList = basicdataBrandService.list(lambdaQueryWrapper);
for (BasicdataClientExcel i : data) {
// 处理下空格 换行
i.setClientName(i.getClientName().trim());
// i.setClientCode(i.getClientCode().trim());
log.info("导入数据《》《》{}", i);
// if (set.isEmpty()) {
// set.add(i.getClientCode());
// } else {
// boolean b = set.stream().anyMatch(a -> a.equals(i.getClientCode()));
// if (b) {
// continue;
// }
// }
// if (ObjectUtils.isNull(i.getClientCode()) || ObjectUtils.isNull(i.getClientName())) {
// throw new ServiceException("客户编码或客户名称不能为空!");
// }
if (ObjectUtils.isNull(i.getClientName())) {
throw new ServiceException("客户编码或客户名称不能为空!");
}
@ -554,26 +552,21 @@ public class BasicdataClientServiceImpl extends BaseServiceImpl<BasicdataClientM
//将这个最新的防止缓存中
log.info(">>>>>> basicdataClient.getClientCode() {}", basicdataClient.getClientCode());
//查询客户编码和客户名称是否存在
boolean b = basicdataClients.stream().anyMatch(ii -> {
if (ii.getClientCode() != null && !ii.getClientCode().isEmpty()) {
log.info(">>>>>>>>>>>>> 1{}", ii.getClientCode());
log.info(">>>>>>>>>>>>> 2{}", ii.getClientName());
return ii.getClientCode().equals(basicdataClient.getClientCode())
|| ii.getClientName().equals(basicdataClient.getClientName().trim());
if(!basicdataClients.isEmpty()){
List<BasicdataClientEntity> basicdataClientEntities = basicdataClients.stream().filter(ii -> ii.getClientName().equals(basicdataClient.getClientName()) && ii.getClientCode().equals(basicdataClient.getClientCode())).collect(Collectors.toList());
if(!basicdataClientEntities.isEmpty()){
// 获取全部重复的数据
List<String> clientNames = basicdataClientEntities.stream().map(BasicdataClientEntity::getClientName).collect(Collectors.toList());
List<String> clientCodes = basicdataClientEntities.stream().map(BasicdataClientEntity::getClientCode).collect(Collectors.toList());
String clientNameStr = String.join(",", clientNames);
String clientCodeStr = String.join(",", clientCodes);
throw new ServiceException("客户编码 "+clientCodeStr+" 或客户名称 "+clientNameStr+" 已存在");
}
return false;
});
if (b) {
List<BasicdataClientEntity> basicdataClientEntities = basicdataClients.stream().filter(ii -> ii.getClientName().equals(basicdataClient.getClientName())).collect(Collectors.toList());
log.info("###############basicdataClientEntities重复客户:{}", basicdataClientEntities);
throw new ServiceException("客户编码或客户名称已存在");
}
// Optional<DictBiz> first = dictBizs.stream().filter(ii -> ii.getDictValue().equals(i.getTypeService())).findFirst();
Optional<DictBiz> clientFirst = clientBiz.stream().filter(ii -> ii.getDictValue().equals(i.getClientType())).findFirst();
// i.setTypeService(first.get().getDictValue());
basicdataClient.setClientType(clientFirst.get().getDictKey());
//查询客户名称是不是重复
List<BasicdataClientEntity> basicdataClientEntities = baseMapper.selectList(Wrappers.<BasicdataClientEntity>query().lambda()
@ -587,12 +580,22 @@ public class BasicdataClientServiceImpl extends BaseServiceImpl<BasicdataClientM
basicdataClient.setStatus(1);
basicdataClient.setIsDeleted(0);
basicdataClient.setCreateTime(new Date());
basicdataClient.setUpdateTime(new Date());
// 默认付款方式
String keyValue = matchDictValue(DictBizCache.getList(OPEN_ORDER_PAY_WAY), i.getDefaultPaymentMethods().trim());
basicdataClient.setDefaultPaymentMethods(keyValue);
basicdataClient.setTypeService(Integer.parseInt(i.getTypeService()));
String s = matchDictValue(DictBizCache.getList(CLEAN_OBJ_TYPE), i.getCleanObjType());
basicdataClient.setCleanObjType(s);
String typeValue= matchDictValue(DictBizCache.getList(DISTRIBUTION_TYPE), i.getMold());
basicdataClient.setTypeService(StringUtil.isNoneBlank(typeValue)?Integer.parseInt(typeValue):null);
baseMapper.insert(basicdataClient);
redis.set(RedisKeyConstant.FINAL_CLIENT_CODE + AuthUtil.getTenantId(), basicdataClient.getClientCode());
if (ObjectUtils.isNull(basicdataClient.getId())) {
@ -791,6 +794,22 @@ public class BasicdataClientServiceImpl extends BaseServiceImpl<BasicdataClientM
}
}
private void checkImportBasicDataClient(List<BasicdataClientExcel> data, List<BasicdataClientEntity> basicdataClients) {
// 验证导入数据是否存在重复
boolean hasDuplicates = data.stream()
.map(BasicdataClientExcel::getClientName)
.distinct()
.count() != data.size();
if(hasDuplicates){
throw new CustomerException("存在相同的数据");
}
}
/**
* 匹配品牌
*

11
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockArticleController.java

@ -189,6 +189,17 @@ public class DistributionStockArticleController extends BladeController {
return R.data(parcelNumberVOS);
}
/**
* 查询订单入库详情
*/
@GetMapping("/getOrderWarehouseDetail")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "分页", notes = "传入distributionStockArticle")
public R getOrderWarehouseDetail(@ApiIgnore @RequestParam String orderCode) {
R r = distributionStockArticleService.getOrderWarehouseDetail(orderCode);
return r;
}
// BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
// if (Func.isEmpty(myCurrentWarehouse)){

5
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionStockArticleClient.java

@ -451,4 +451,9 @@ public class DistributionStockArticleClient implements IDistributionStockArticle
return distributionParcelListService.findWaybillNoByOrderIds(stockArticleIds);
}
@Override
public void updateEntity(DistributionStockArticleEntity stockArticleEntity) {
distributionStockArticleService.updateById(stockArticleEntity);
}
}

6
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/BusinessPreOrderDataQueueHandler.java

@ -59,7 +59,7 @@ public class BusinessPreOrderDataQueueHandler {
if(tenant1.isSuccess() && tenant1.getData() != null ){
Tenant data = tenant1.getData();
if(1==data.getTenantType()){
if(2==data.getTenantType()){
log.info(">>>>>>>>> 当前作业对象 {} 未 商家对象",data.getTenantName() );
return ;
}
@ -71,9 +71,6 @@ public class BusinessPreOrderDataQueueHandler {
if (tenantList.isSuccess()) {
List<Tenant> data = tenantList.getData();
data.forEach(tenant -> {
if (!ObjectUtil.isEmpty(tenant.getTenantType())) {
if (2 == tenant.getTenantType()) {
List<BasicdataClientEntity> basicdataClientEntitysTenantId = basicdataClientClient.findBasicdataClientEntitysTenantId(tenant.getTenantId());
@ -93,7 +90,6 @@ public class BusinessPreOrderDataQueueHandler {
if (list != null && !list.isEmpty()) {
resoveData(tenant,distributionDeliveryListEntity, basicdataClientEntitysTenantId, list);
}
}
}
}

8
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockArticleService.java

@ -323,4 +323,12 @@ public interface IDistributionStockArticleService extends BaseService<Distributi
IPage<DistributionStockArticleVO> pageListOweTransfer(IPage<Object> page, Map<String, Object> distributionStockArticle);
R findZeroOrderInfo(Long orderId);
/**
* 查询订单入库详情
* @param orderCode
* @return
*/
R getOrderWarehouseDetail(String orderCode);
}

102
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java

@ -47,6 +47,8 @@ import com.logpm.distribution.vo.app.queryOrderVO;
import com.logpm.distribution.wrapper.DistributionParcelListWrapper;
import com.logpm.distribution.wrapper.DistributionStockArticleNewWrapper;
import com.logpm.distribution.wrapper.DistributionStockArticleWrapper;
import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity;
import com.logpm.trunkline.feign.ITrunklineAdvanceDetailClient;
import com.logpm.warehouse.entity.WarehouseWayBillDetail;
import com.logpm.warehouse.entity.WarehouseWaybillEntity;
import com.logpm.warehouse.feign.IWarehouseTrayGoodsClient;
@ -150,6 +152,7 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
private final DistributionSignforMapper distributionSignforMapper;
private final IWarehouseWaybillClient warehouseWaybillClient;
private final IWarehouseWaybillDetailClient warehouseWaybillDetailClient;
private final ITrunklineAdvanceDetailClient trunklineAdvanceDetailClient;
@Override
public IPage<DistributionStockArticleVO> selectDistributionStockArticlePage(IPage<DistributionStockArticleVO> page, DistributionStockArticleVO distributionStockArticle) {
@ -2828,6 +2831,105 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
return R.data(map);
}
@Override
public R getOrderWarehouseDetail(String orderCode) {
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
List<Long> warehouseIdList = new ArrayList<>();
if (Objects.isNull(myCurrentWarehouse)){
//查询当前人的仓库列表
List<BasicdataWarehouseEntity> warehouseList = warehouseClient.getMyWarehouseList();
if (!warehouseList.isEmpty()) {
warehouseIdList.addAll(warehouseList.stream().map(BasicdataWarehouseEntity::getId).collect(Collectors.toList()));
}
}else {
warehouseIdList.add(myCurrentWarehouse.getId());
}
if (warehouseIdList.isEmpty()){
return R.fail("当前登录人仓库信息错误");
}
Map<String,List<DistributionParcelListVO>> info = new HashMap<>();
//查询此暂存单数据在仓库的情况
List<TrunklineAdvanceDetailEntity> list = trunklineAdvanceDetailClient.selectByOrderCodeAndWarehouseId(orderCode,warehouseIdList.stream().map(String::valueOf).collect(Collectors.joining(",")));
if (!list.isEmpty()) {
List<String> orderPackageCodes = list.stream().map(TrunklineAdvanceDetailEntity::getOrderPackageCode).collect(Collectors.toList());
info = handlePackageGroupByWarehouse(list,warehouseIdList,orderPackageCodes,Objects.isNull(myCurrentWarehouse),orderCode);
return R.data(info);
}
return R.data(info,"未查询到相关出入库信息");
}
private Map<String, List<DistributionParcelListVO>> handlePackageGroupByWarehouse(List<TrunklineAdvanceDetailEntity> list, List<Long> warehouseIdList, List<String> orderPackageCodes, boolean aNull,String orderCode) {
Map<String,List<DistributionParcelListVO>> info = new HashMap<>();
List<DistributionParcelListEntity> parcelListEntities = distributionParcelListService.list(Wrappers.<DistributionParcelListEntity>query().lambda()
.eq(DistributionParcelListEntity::getOrderCode, orderCode)
.in(DistributionParcelListEntity::getOrderPackageCode, orderPackageCodes)
.eq(DistributionParcelListEntity::getIsTransfer, 0)
.in(!aNull,DistributionParcelListEntity::getWarehouseId,warehouseIdList)
);
if (!parcelListEntities.isEmpty()) {
List<DistributionParcelListVO> distributionParcelListVOS = DistributionParcelListWrapper.build().listVO(parcelListEntities);
info.put("warehouse",distributionParcelListVOS);
List<String> collect = parcelListEntities.stream().map(DistributionParcelListEntity::getOrderPackageCode).collect(Collectors.toList());
Iterator<String> iterator = collect.iterator();
while (iterator.hasNext()){
String next = iterator.next();
orderPackageCodes.remove(next);
iterator.remove();
}
}
if (!orderPackageCodes.isEmpty()) {
//存在未入库的包件
//进行数据组装
List<TrunklineAdvanceDetailEntity> collect = list.stream().filter(f -> orderPackageCodes.contains(f.getOrderPackageCode())).collect(Collectors.toList());
List<DistributionParcelListVO> unWarehousePackage= handleUnWarehousePackage(collect);
if (!unWarehousePackage.isEmpty()) {
info.put("unWarehouse",unWarehousePackage);
}
}
return info;
}
private List<DistributionParcelListVO> handleUnWarehousePackage(List<TrunklineAdvanceDetailEntity> collect) {
List<DistributionParcelListVO> parcelListVOS = new ArrayList<>();
List<Long> waybillNos = collect.stream().map(TrunklineAdvanceDetailEntity::getWaybillId).collect(Collectors.toList());
Map<Long, List<WarehouseWaybillEntity>> waybillMap = null;
if (!waybillNos.isEmpty()) {
List<WarehouseWaybillEntity> listByWaybillIds = warehouseWaybillClient.findListByWaybillIds(waybillNos);
if (!listByWaybillIds.isEmpty()) {
waybillMap = listByWaybillIds.stream().collect(Collectors.groupingBy(WarehouseWaybillEntity::getId));
}
}
for (TrunklineAdvanceDetailEntity trunklineAdvanceDetailEntity : collect) {
DistributionParcelListVO distributionParcelListVO = new DistributionParcelListVO();
distributionParcelListVO.setWaybillNumber(trunklineAdvanceDetailEntity.getWaybillNo());
distributionParcelListVO.setOrderCode(trunklineAdvanceDetailEntity.getOrderCode());
distributionParcelListVO.setOrderPackageCode(trunklineAdvanceDetailEntity.getOrderPackageCode());
distributionParcelListVO.setWarehouse(trunklineAdvanceDetailEntity.getWarehouseName());
distributionParcelListVO.setOrderPackageStatusName(OrderPackageStatusConstant.weiruku.getName());
distributionParcelListVO.setFirsts(trunklineAdvanceDetailEntity.getFirstPackName());
distributionParcelListVO.setSecond(trunklineAdvanceDetailEntity.getSecondPackName());
distributionParcelListVO.setThirdProduct(trunklineAdvanceDetailEntity.getThirdPackName());
distributionParcelListVO.setMaterialName(trunklineAdvanceDetailEntity.getMaterialName());
distributionParcelListVO.setMaterialCode(trunklineAdvanceDetailEntity.getMaterialCode());
distributionParcelListVO.setQuantity(trunklineAdvanceDetailEntity.getQuantity());
distributionParcelListVO.setTrainNumber(trunklineAdvanceDetailEntity.getTrainNumber());
if (!Objects.isNull(waybillMap) && !Objects.isNull(trunklineAdvanceDetailEntity.getWaybillId())){
WarehouseWaybillEntity warehouseWaybillEntities = waybillMap.get(trunklineAdvanceDetailEntity.getWaybillId()).get(0);
distributionParcelListVO.setSendWarehouseName(warehouseWaybillEntities.getDepartureWarehouseName());
distributionParcelListVO.setAcceptWarehouseName(warehouseWaybillEntities.getDestinationWarehouseName());
distributionParcelListVO.setServiceNumber(warehouseWaybillEntities.getServiceNo());
}
parcelListVOS.add(distributionParcelListVO);
}
return parcelListVOS;
}
/**
* @param page
* @param distributionSignforStockArticle

26
blade-service/logpm-patch/src/main/java/com/logpm/patch/jobhandle/SyncOrderInfoToPlatform.java

@ -1042,4 +1042,30 @@ public class SyncOrderInfoToPlatform {
}
@XxlJob("dealWaybillPayType")
public ReturnT<String> dealWaybillPayType(String param) {
log.info("############dealWaybillPayType: 处理运单支付类型为月结 开始");
List<JSONObject> ls = warehouseMappingDataService.findAllDealWithWaybillNo();
ls.forEach(json -> {
Integer id = json.getInt("id");
String waybillNo = json.getStr("waybillNo");
warehouseMappingDataService.deleteStatisticsdata(waybillNo);
warehouseMappingDataService.updateStatusDealwithWaybillById(id);
});
log.info("############dealWaybillPayType: 处理运单支付类型为月结 完成");
return ReturnT.SUCCESS;
}
}

16
blade-service/logpm-patch/src/main/java/com/logpm/patch/mapper/WarehouseMappingDataMapper.java

@ -148,5 +148,21 @@ public interface WarehouseMappingDataMapper {
void updateRepairParcelListWaybillById(@Param("id") Integer id, @Param("status") int status);
void updatePackageStatusList(@Param("orderPackageCodes") List<String> orderPackageCodes, @Param("warehouseId") Long warehouseId, @Param("packageStatus") String packageStatus);
List<JSONObject> findAllDealWithWaybillNo();
void updateStatusDealwithWaybillById(@Param("id") Integer id);
void udpateWaybillPayWay(@Param("waybillNo") String waybillNo, @Param("payWay") String payWay);
void deletedTrunklinePackageByWaybillNo(@Param("waybillNo") String waybillNo);
void deletedWarehousePackageByWaybillNo(@Param("waybillNo") String waybillNo);
void deletedDistributionPackageByWaybillNo(@Param("waybillNo") String waybillNo);
void deletedOrderByWaybillNo(@Param("waybillNo") String waybillNo);
void deletedBalanceOrderByWaybillNo(@Param("waybillNo") String waybillNo);
}

50
blade-service/logpm-patch/src/main/java/com/logpm/patch/mapper/WarehouseMappingDataMapper.xml

@ -504,4 +504,54 @@
where ldpl.warehouse_id = #{warehouseId}
</update>
<select id="findAllDealWithWaybillNo" resultType="cn.hutool.json.JSONObject">
select id id,
waybill_no waybillNo,
status status
from deal_with_waybill_pay_type
where status = 0
</select>
<update id="updateStatusDealwithWaybillById">
update deal_with_waybill_pay_type
set status = 1
where id = #{id}
</update>
<update id="udpateWaybillPayWay">
update logpm_warehouse_waybill
set pay_way = #{payWay},
check_status = 1
where waybill_no = #{waybillNo}
</update>
<delete id="deletedTrunklinePackageByWaybillNo">
delete from logpm_statistics_trunkline_package
where waybill_no = #{waybillNo}
</delete>
<delete id="deletedWarehousePackageByWaybillNo">
delete from logpm_statistics_warehouse_package
where waybill_no = #{waybillNo}
</delete>
<delete id="deletedDistributionPackageByWaybillNo">
delete from logpm_statistics_distribution_package
where waybill_no = #{waybillNo}
</delete>
<delete id="deletedOrderByWaybillNo">
delete from logpm_statistics_order_info
where waybill_no = #{waybillNo}
</delete>
<delete id="deletedBalanceOrderByWaybillNo">
delete from logpm_statistics_balance_order_info
where waybill_no = #{waybillNo}
</delete>
</mapper>

10
blade-service/logpm-patch/src/main/java/com/logpm/patch/service/IWarehouseMappingDataService.java

@ -129,4 +129,14 @@ public interface IWarehouseMappingDataService {
void updateRepairParcelListWaybillById(Integer id, int status);
void updatePackageStatusList(List<String> orderPackageCodes, Long warehouseId, String packageStatus);
List<JSONObject> findAllDealWithWaybillNo();
void updateStatusDealwithWaybillById(Integer id);
void deleteStatisticsdata(String waybillNo);
}

27
blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/WarehouseMappingDataServiceImpl.java

@ -311,4 +311,31 @@ public class WarehouseMappingDataServiceImpl implements IWarehouseMappingDataSer
warehouseMappingDataMapper.updatePackageStatusList(orderPackageCodes,warehouseId,packageStatus);
}
@Override
public List<JSONObject> findAllDealWithWaybillNo() {
return warehouseMappingDataMapper.findAllDealWithWaybillNo();
}
@Override
public void updateStatusDealwithWaybillById(Integer id) {
warehouseMappingDataMapper.updateStatusDealwithWaybillById(id);
}
@Override
public void deleteStatisticsdata(String waybillNo) {
warehouseMappingDataMapper.udpateWaybillPayWay(waybillNo,"3");
warehouseMappingDataMapper.deletedTrunklinePackageByWaybillNo(waybillNo);
warehouseMappingDataMapper.deletedWarehousePackageByWaybillNo(waybillNo);
warehouseMappingDataMapper.deletedDistributionPackageByWaybillNo(waybillNo);
warehouseMappingDataMapper.deletedOrderByWaybillNo(waybillNo);
warehouseMappingDataMapper.deletedBalanceOrderByWaybillNo(waybillNo);
}
}

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

@ -8,6 +8,7 @@ import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import com.logpm.trunkline.dto.*;
import com.logpm.trunkline.entity.TrunklineCarsLoadEntity;
import com.logpm.trunkline.excel.TrunklineCarsLoadExcel;
import com.logpm.trunkline.service.ITrunklineCarsLoadService;
import com.logpm.trunkline.vo.LoadingDetailExportVO;
import com.logpm.trunkline.vo.TrunklineCarsLoadVO;
@ -18,17 +19,17 @@ import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.exception.CustomerException;
import org.springblade.core.excel.util.ExcelUtil;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.StringUtil;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.List;
import java.util.Objects;
import java.util.*;
@Slf4j
@RestController
@ -2819,4 +2820,40 @@ public class CarsLoadController {
}
}
@ResponseBody
@PostMapping("/exportLoadCarsPageList")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "配载计划分页列表", notes = "传入loadCarsDTO")
public void exportLoadCarsPageList(@RequestBody LoadCarsDTO loadCarsDTO, HttpServletRequest request, HttpServletResponse response) {
String method = "############loadCarsPageList: ";
log.info(method+"请求参数{}",loadCarsDTO);
try{
Enumeration<String> headerNames = request.getHeaderNames();
//当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
List<Long> warehouseIds = new ArrayList<>();
if(!Objects.isNull(myCurrentWarehouse)){
Long warehouseId = myCurrentWarehouse.getId();
warehouseIds.add(warehouseId);
}else{
List<BasicdataWarehouseEntity> myWatchWarehouse = warehouseClient.getMyWatchWarehouse();
myWatchWarehouse.forEach(warehouseEntity -> {
warehouseIds.add(warehouseEntity.getId());
});
}
loadCarsDTO.setWarehouseIds(warehouseIds);
List<TrunklineCarsLoadExcel> list = carsLoadService.exportLoadCarsPageList(loadCarsDTO);
ExcelUtil.export(response, "车辆配载数据" + DateUtil.time(), "车辆配载数据", list, TrunklineCarsLoadExcel.class);
}catch (CustomerException e){
log.error(e.message,e);
}catch (Exception e){
log.error(method+"系统异常",e);
}
}
}

144
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/excel/TrunklineCarsLoadExcel.java

@ -0,0 +1,144 @@
package com.logpm.trunkline.excel;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
import lombok.Data;
import java.io.Serializable;
@Data
@ColumnWidth(25)
@HeadRowHeight(20)
@ContentRowHeight(18)
public class TrunklineCarsLoadExcel implements Serializable {
private static final long serialVersionUID = 1L;
@ColumnWidth(20)
@ExcelProperty("车次号")
private String carsNo;
@ColumnWidth(20)
@ExcelProperty("路线")
private String carsLineName;
@ColumnWidth(20)
@ExcelProperty("计划装车")
private String planLoadingNumber;
@ColumnWidth(20)
@ExcelProperty("装车件数")
private String realLoadingNumber;
@ColumnWidth(20)
@ExcelProperty("在库件数")
private String stockCarsNum;
@ColumnWidth(20)
@ExcelProperty("卸车件数")
private String unloadNumber;
// @ColumnWidth(20)
// @ExcelProperty("路线")
// private String loadingType;
@ColumnWidth(20)
@ExcelProperty("满载率")
private String fullLoadRate;
@ColumnWidth(20)
@ExcelProperty("车辆状态")
private String loadStatusName;
@ColumnWidth(20)
@ExcelProperty("主驾司机")
private String driverName;
@ColumnWidth(20)
@ExcelProperty("主驾司机手机号")
private String driverMobile;
@ColumnWidth(20)
@ExcelProperty("车牌号")
private String carNumber;
@ColumnWidth(20)
@ExcelProperty("起点仓库")
private String startWarehouseName;
@ColumnWidth(20)
@ExcelProperty("终点仓库")
private String endWarehouseNames;
@ColumnWidth(20)
@ExcelProperty("到车时间")
private String arriveTime;
@ColumnWidth(20)
@ExcelProperty("实际发车时间")
private String startTime;
@ColumnWidth(20)
@ExcelProperty("经办人")
private String createUserName;
@ColumnWidth(20)
@ExcelProperty("创建时间")
private String createTime;
@ColumnWidth(20)
@ExcelProperty("现付运输费")
private String nowTransportCost;
@ColumnWidth(20)
@ExcelProperty("到付油卡费")
private String oilCost;
@ColumnWidth(20)
@ExcelProperty("路桥费")
private String tollFee;
@ColumnWidth(20)
@ExcelProperty("回付运输费")
private String backTransportCost;
@ColumnWidth(20)
@ExcelProperty("到付运输费")
private String reachTransportCost;
@ColumnWidth(20)
@ExcelProperty("整车信息费")
private String wholeCarInfoCost;
@ColumnWidth(20)
@ExcelProperty("整车保险费")
private String wholeCarInsuranceCost;
@ColumnWidth(20)
@ExcelProperty("整车落地费")
private String wholeCarGroundCost;
@ColumnWidth(20)
@ExcelProperty("发站装车费")
private String hairWholeCost;
@ColumnWidth(20)
@ExcelProperty("发站其他费")
private String hairWholeOtherCost;
@ColumnWidth(20)
@ExcelProperty("到站卸车费")
private String unloadCost;
}

10
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/feign/TrunklineAdvanceDetailClient.java

@ -1,11 +1,13 @@
package com.logpm.trunkline.feign;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity;
import com.logpm.trunkline.service.ITrunklineAdvanceDetailService;
import com.logpm.trunkline.vo.TrunklineAdvanceDetailVO;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.tool.utils.Func;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;
@ -41,4 +43,12 @@ public class TrunklineAdvanceDetailClient implements ITrunklineAdvanceDetailClie
.eq("is_deleted",0);
return advanceDetailService.list(queryWrapper);
}
@Override
public List<TrunklineAdvanceDetailEntity> selectByOrderCodeAndWarehouseId(String orderCode, String warehouseIds) {
return advanceDetailService.list(Wrappers.<TrunklineAdvanceDetailEntity>query().lambda()
.eq(TrunklineAdvanceDetailEntity::getOrderCode,orderCode)
.in(TrunklineAdvanceDetailEntity::getWarehouseId, Func.toLongList(warehouseIds))
);
}
}

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

@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.trunkline.dto.LoadCarsDTO;
import com.logpm.trunkline.dto.LoadScanBrandDTO;
import com.logpm.trunkline.entity.TrunklineCarsLoadEntity;
import com.logpm.trunkline.excel.TrunklineCarsLoadExcel;
import com.logpm.trunkline.vo.CarsLoadAllOrderVO;
import com.logpm.trunkline.vo.TripartiteTransferVO;
import com.logpm.trunkline.vo.TrunklineCarsLoadVO;
@ -49,5 +50,12 @@ public interface TrunklineCarsLoadMapper extends BaseMapper<TrunklineCarsLoadEnt
void updateWaybillOrderIsCustemer(@Param("list") List<Long> carsOrderIdList, @Param("isCustomer") String isCustomer);
List<LoadScanBrandDTO> fingPackageCodeByLoadId(@Param("loadId") Long loadId, @Param("warehouseId") Long warehouseId);
/**
* 导出查询
* @param loadCarsDTO
* @return
*/
List<TrunklineCarsLoadExcel> exportLoadCarsList(@Param("param") LoadCarsDTO loadCarsDTO,@Param("idList")List<Long> idList);
}

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

@ -838,6 +838,158 @@
and Locate(#{param.waybillNo},lww.waybill_no) > 0
</if>
</select>
<select id="exportLoadCarsList" resultType="com.logpm.trunkline.excel.TrunklineCarsLoadExcel">
select ltcl.id id,
ltcl.cars_no carsNo,
ltcl.cars_line_name carsLineName,
ltcl.plan_loading_number planLoadingNumber,
ltcl.real_loading_number realLoadingNumber,
ltcl.stock_number stockCarsNum,
ltcl.unload_number unloadNumber,
ltcl.loading_type loadingType,
ltcl.full_load_rate fullLoadRate,
ltcl.is_customer isCustomer,
CASE ltcl.load_status
WHEN '0' THEN '未发车'
WHEN '10' THEN '已发车'
WHEN '20' THEN '网点到车'
WHEN '30' THEN '网点发车'
WHEN '40' THEN '终点到车'
WHEN '80' THEN '已卸车'
WHEN '90' THEN '已签收'
WHEN '100' THEN '取消配载'
ELSE
'未知状态'
END loadStatusName,
ltcl.driver_name driverName,
ltcl.driver_mobile driverMobile,
ltcl.car_number carNumber,
ltcl.start_warehouse_name startWarehouseName,
ltcl.end_warehouse_names endWarehouseNames,
ltcl.arrive_time arriveTime,
ltcl.start_time startTime,
ltcl.create_user_name createUserName,
ltcl.create_time createTime,
ltcl.now_warehouse_id nowWarehouseId,
ltcl.count_transport_cost countTransportCost,
sum(ltcll.now_transport_cost) nowTransportCost,
sum(ltcll.oil_cost) oilCost,
sum(ltcll.back_transport_cost) backTransportCost,
sum(ltcll.reach_transport_cost) reachTransportCost,
sum(ltcll.whole_car_info_cost) wholeCarInfoCost,
sum(ltcll.whole_car_insurance_cost) wholeCarInsuranceCost,
sum(ltcll.whole_car_ground_cost) wholeCarGroundCost,
sum(ltcll.hair_whole_cost) hairWholeCost,
sum(ltcll.hair_whole_other_cost) hairWholeOtherCost,
sum(ltcll.unload_cost) unloadCost,
sum(ltcll.unload_other_cost) unloadOtherCost,
sum(ltcll.fuel) fuel,
sum(ltcll.toll_fee) tollFee
from logpm_trunkline_cars_load ltcl
left join logpm_trunkline_cars_load_line ltcll on ltcll.load_id = ltcl.id
where ltcl.is_deleted = 0
and ltcl.load_type != '4'
and ltcl.load_status != '100'
<if test="param.warehouseIds != null and param.warehouseIds.size() > 0" >
and ltcl.start_warehouse_id in
<foreach collection="param.warehouseIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="param.warehouseId != null" >
and ltcl.start_warehouse_id = #{param.warehouseId}
</if>
<if test="idList != null" >
AND ltcl.id IN
<foreach collection="idList" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</if>
<if test="param.endWarehouseId != null" >
and Locate(#{param.endWarehouseId},ltcl.end_warehouse_ids) > 0
</if>
<if test="param.loadCarsNo != null and param.loadCarsNo != ''">
and ltcl.cars_no = #{param.loadCarsNo}
</if>
<if test="param.loadStatus != null and param.loadStatus != ''">
and ltcl.load_status = #{param.loadStatus}
</if>
<if test="param.warehouseName != null and param.warehouseName != ''">
and (Locate(#{param.warehouseName},ltcl.start_warehouse_name) > 0 or Locate(#{param.warehouseName},ltcl.end_warehouse_names) > 0)
</if>
<if test="param.createTimeStart != null ">
and ltcl.create_time &gt;= #{param.createTimeStart}
</if>
<if test="param.createTimeEnd != null ">
and ltcl.create_time &lt;= #{param.createTimeEnd}
</if>
<if test="param.startTime != null ">
and ltcl.start_time &gt;= #{param.startTime}
</if>
<if test="param.endTime != null ">
and ltcl.start_time &lt;= #{param.endTime}
</if>
<if test="param.arriveTimeStart != null ">
and ltcl.arrive_time &gt;= #{param.arriveTimeStart}
</if>
<if test="param.arriveTimeEnd != null ">
and ltcl.arrive_time &lt;= #{param.arriveTimeEnd}
</if>
<if test="param.driverName != null and param.driverName != ''">
and ltcl.driver_name like CONCAT('%',#{param.driverName},'%')
</if>
<if test="param.driverMobile != null and param.driverMobile != ''">
and ltcl.driver_mobile like CONCAT('%',#{param.driverMobile},'%')
</if>
<if test="param.driverMobile != null and param.driverMobile != ''">
and ltcl.driver_mobile like CONCAT('%',#{param.driverMobile},'%')
</if>
<if test="param.driverMobile != null and param.driverMobile != ''">
and ltcl.driver_mobile like CONCAT('%',#{param.driverMobile},'%')
</if>
<if test="param.driverMobile != null and param.driverMobile != ''">
and ltcl.driver_mobile like CONCAT('%',#{param.driverMobile},'%')
</if>
<if test="param.carNumber != null and param.carNumber != ''">
and ltcl.car_number like CONCAT('%',#{param.carNumber},'%')
</if>
<if test="param.startWarehouseName != null and param.startWarehouseName != ''">
and ltcl.start_warehouse_name like CONCAT('%',#{param.startWarehouseName},'%')
</if>
<if test="param.endWarehouseNames != null and param.endWarehouseNames != ''">
and ltcl.end_warehouse_names like CONCAT('%',#{param.endWarehouseNames},'%')
</if>
<if test="param.createUserName != null and param.createUserName != ''">
and ltcl.create_user_name like CONCAT('%',#{param.createUserName},'%')
</if>
<if test="param.arriveTime != null ">
and DATE_FORMAT(ltcl.arrive_time,'%y%d%m') = DATE_FORMAT(#{param.arriveTime},'%y%d%m')
</if>
<if test="param.startTime != null ">
and DATE_FORMAT(ltcl.start_time,'%y%d%m') = DATE_FORMAT(#{param.startTime},'%y%d%m')
</if>
<if test="param.createTime != null ">
and DATE_FORMAT(ltcl.create_time,'%y%d%m') = DATE_FORMAT(#{param.createTime},'%y%d%m')
</if>
group by ltcl.id,ltcl.cars_no,
ltcl.plan_loading_number,
ltcl.real_loading_number,
ltcl.unload_number,
ltcl.loading_type,
ltcl.full_load_rate,
ltcl.is_customer,
ltcl.load_status,
ltcl.driver_name,
ltcl.driver_mobile,
ltcl.car_number,
ltcl.start_warehouse_name,
ltcl.end_warehouse_names,
ltcl.arrive_time,
ltcl.start_time,
ltcl.now_warehouse_id,
ltcl.count_transport_cost
order by ltcl.create_time desc
</select>
</mapper>

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

@ -6,6 +6,7 @@ import com.logpm.trunkline.dto.LoadCarsDTO;
import com.logpm.trunkline.dto.TrunklineCarsLoadDTO;
import com.logpm.trunkline.dto.ZeroPackageDTO;
import com.logpm.trunkline.entity.TrunklineCarsLoadEntity;
import com.logpm.trunkline.excel.TrunklineCarsLoadExcel;
import com.logpm.trunkline.vo.LoadingDetailExportVO;
import com.logpm.trunkline.vo.TripartiteTransferVO;
import com.logpm.trunkline.vo.TrunklineCarsLoadVO;
@ -254,4 +255,10 @@ public interface ITrunklineCarsLoadService extends BaseService<TrunklineCarsLoad
R unloadPackageNoXz(Long loadId, String orderPackageCode, Long warehouseId,Integer unbindTray,String remark,Integer incomingType,String unloadTrayName,String unloadTrayCode);
/**
* 导出数据
* @param loadCarsDTO
* @return
*/
List<TrunklineCarsLoadExcel> exportLoadCarsPageList(LoadCarsDTO loadCarsDTO);
}

13
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceServiceImpl.java

@ -589,6 +589,7 @@ public class TrunklineAdvanceServiceImpl extends BaseServiceImpl<TrunklineAdvanc
orderId = stockArticleClient.addData(stockArticleEntity);
} else {
stockArticleEntity.setTotalNumber(total);
stockArticleEntity.setGenre(1);
stockArticleClient.saveOrUpdate(stockArticleEntity);
orderId = stockArticleEntity.getId();
@ -852,10 +853,13 @@ public class TrunklineAdvanceServiceImpl extends BaseServiceImpl<TrunklineAdvanc
stockArticleEntity.setDescriptionGoods(incomeCategoryName);
BasicdataClientEntity clientEntity = basicdataClientClient.findByName(consigneeName1);
// 如果在入库的时候发现客户信息不存在,则不设置客户信息 默认采用商配
if (!Objects.isNull(clientEntity)) {
stockArticleEntity.setMallId(clientEntity.getId());
stockArticleEntity.setMallName(clientEntity.getClientName());
stockArticleEntity.setMallCode(clientEntity.getClientCode());
stockArticleEntity.setTypeService(clientEntity.getTypeService()+"");
}
String consignee = waybillEntity.getConsignee();
String consigneeName = waybillEntity.getConsigneeName();
@ -866,10 +870,10 @@ public class TrunklineAdvanceServiceImpl extends BaseServiceImpl<TrunklineAdvanc
stockArticleEntity.setConsigneeMobile(consigneeMobile);
stockArticleEntity.setConsigneeAddress(consigneeAddress);
BasicdataStoreBusinessEntity basicdataStoreBusinessEntity = basicdataStoreBusinessClient.findByClientIdAndTypeService(clientEntity.getId(), 3);
if (!Objects.isNull(basicdataStoreBusinessEntity)) {
stockArticleEntity.setTypeService(basicdataStoreBusinessEntity.getMold());
}
// BasicdataStoreBusinessEntity basicdataStoreBusinessEntity = basicdataStoreBusinessClient.findByClientIdAndTypeService(clientEntity.getId(), 3);
// if (!Objects.isNull(basicdataStoreBusinessEntity)) {
// stockArticleEntity.setTypeService(basicdataStoreBusinessEntity.getMold());
// }
}
} else {
Long clientId = basicdataTripartiteMallClient.getClientIdByNameAndBrand(dealerName, advanceEntity.getBrand());
@ -930,6 +934,7 @@ public class TrunklineAdvanceServiceImpl extends BaseServiceImpl<TrunklineAdvanc
}
} else {
stockArticleEntity.setTotalNumber(total);
stockArticleEntity.setGenre(1);
updateStockArticleEntities.add(stockArticleEntity);
}
});

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

@ -42,6 +42,7 @@ import com.logpm.factorydata.vo.PushData;
import com.logpm.trunkline.bean.Resp;
import com.logpm.trunkline.dto.*;
import com.logpm.trunkline.entity.*;
import com.logpm.trunkline.excel.TrunklineCarsLoadExcel;
import com.logpm.trunkline.feign.ITrunklinePackageTrackLogClient;
import com.logpm.trunkline.mapper.TrunklineCarsLoadMapper;
import com.logpm.trunkline.service.*;
@ -3589,6 +3590,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
carsLoadScanEntity.setWaybillNo(trunklineAdvanceDetailEntity.getWaybillNo());
carsLoadScanEntity.setWaybillId(trunklineAdvanceDetailEntity.getWaybillId());
carsLoadScanEntity.setIsData(1);
carsLoadScanEntity.setFromWarehouseId(trunklineAdvanceDetailEntity.getNowWarehouseId());
String packageStatus = trunklineAdvanceDetailEntity.getPackageStatus();
if ("0".equals(packageStatus)) {
//未入库
@ -7705,13 +7707,16 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
DistributionParcelListEntity parcelListEntity = distributionParcelListClient.findByOrderPackageCodeAndStatus(scanCode);
if (!Objects.isNull(parcelListEntity)) {
Long warehouseId = parcelListEntity.getWarehouseId();
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleClient.findStockArticleByOrderCodeAndWarehouseId(orderCode, warehouseId);
DistributionStockArticleEntity newStockArticle = new DistributionStockArticleEntity();
BeanUtil.copy(stockArticleEntity, newStockArticle);
newStockArticle.setId(null);
newStockArticle.setHandQuantity(0);
Long orderId = distributionStockArticleClient.addData(newStockArticle);
// 判断包件查询出来的入库数据 和当前操作的入库仓 是否一致
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
if(myCurrentWarehouse == null){
return R.fail(405, "仓库信息不存在 ,请选择入库仓库");
}
if(NumberUtil.equals(myCurrentWarehouse.getId(),warehouseId)){
return R.fail(405, "包件已入库!");
}
DistributionStockArticleEntity stockArticleEntity = getDistributionStockArticle(orderCode,warehouseId,myCurrentWarehouse.getName(),scanCode);
BasicdataWarehouseEntity warehouseEntity = basicdataWarehouseClient.getEntityWarehouseId(unloadNodeId);
DistributionParcelListEntity newParcelList = new DistributionParcelListEntity();
BeanUtil.copy(parcelListEntity, newParcelList);
@ -7725,7 +7730,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
newParcelList.setIsTransfer(1);
}
newParcelList.setTrainNumber(loadCode);
newParcelList.setStockArticleId(orderId);
newParcelList.setStockArticleId(stockArticleEntity.getId());
distributionParcelListClient.add(newParcelList);
// stockArticleEntity.setHandQuantity(stockArticleEntity.getHandQuantity() - 1);
@ -7747,6 +7752,52 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
}
}
private DistributionStockArticleEntity getDistributionStockArticle(String orderCode, Long warehouseId,String warehouseName,String scanCode) {
DistributionStockArticleEntity stockArticleByOrderCodeAndWarehouseId = distributionStockArticleClient.findStockArticleByOrderCodeAndWarehouseId(orderCode, warehouseId);
if(Objects.isNull(stockArticleByOrderCodeAndWarehouseId)) {
TrunklineAdvanceDetailEntity entityByOrderPackageCode = trunklineAdvanceDetailService.findEntityByOrderPackageCode(scanCode);
if(Objects.isNull(entityByOrderPackageCode)){
stockArticleByOrderCodeAndWarehouseId = distributionStockArticleClient.findStockArticleByOrderCodeAndWarehouseId(orderCode, entityByOrderPackageCode.getNowWarehouseId());
if(Objects.isNull(stockArticleByOrderCodeAndWarehouseId)){
stockArticleByOrderCodeAndWarehouseId.setId(null);
stockArticleByOrderCodeAndWarehouseId.setWarehouseId(warehouseId);
stockArticleByOrderCodeAndWarehouseId.setWarehouseId(warehouseId);
stockArticleByOrderCodeAndWarehouseId.setWarehouse(warehouseName);
stockArticleByOrderCodeAndWarehouseId.setGenre(1);
stockArticleByOrderCodeAndWarehouseId.setHandQuantity(0);
stockArticleByOrderCodeAndWarehouseId.setCompleteSet(1);
stockArticleByOrderCodeAndWarehouseId.setStockupStatus("10");
stockArticleByOrderCodeAndWarehouseId.setReservationStatus("10");
stockArticleByOrderCodeAndWarehouseId.setOrderStatus("10");
stockArticleByOrderCodeAndWarehouseId.setGroundingStatus("10");
stockArticleByOrderCodeAndWarehouseId.setOrderReceiveStatus("10");
stockArticleByOrderCodeAndWarehouseId.setFreezeStatus("10");
stockArticleByOrderCodeAndWarehouseId.setSortingQuantity(0);
stockArticleByOrderCodeAndWarehouseId.setDeliveryQuantity(0);
stockArticleByOrderCodeAndWarehouseId.setTransferQuantity(0);
stockArticleByOrderCodeAndWarehouseId.setSigninQuantity(0);
stockArticleByOrderCodeAndWarehouseId.setIncomingNum(0);
stockArticleByOrderCodeAndWarehouseId.setAllocation(null);
stockArticleByOrderCodeAndWarehouseId.setTrays(null);
Long orderId = distributionStockArticleClient.addData(stockArticleByOrderCodeAndWarehouseId);
stockArticleByOrderCodeAndWarehouseId.setId(orderId);
}
}
}
// 存在就返回
return stockArticleByOrderCodeAndWarehouseId;
}
@Override
public R transitOrderPageList(LoadCarsDTO loadCarsDTO) {
IPage<Object> page = new Page<>();
@ -8881,7 +8932,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
//查询包件是否签收
DistributionParcelListEntity signDistributionParcelListEntity = distributionParcelListClient.findOrderPackageCodeAndStatus(orderPackageCode,"70");
if (!Objects.isNull(distributionParcelListEntity)) {
if (!Objects.isNull(signDistributionParcelListEntity)) {
log.warn("##############unloadPackage: 包件已签收 orderPackageCode={} warehouseId={}", orderPackageCode, warehouseId);
return R.fail(405, "包件已签收");
}
@ -9051,6 +9102,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
currentStockArticleEntity.setId(null);
currentStockArticleEntity.setWarehouseId(warehouseId);
currentStockArticleEntity.setWarehouse(warehouseName);
currentStockArticleEntity.setGenre(1);
currentStockArticleEntity.setHandQuantity(0);
currentStockArticleEntity.setCompleteSet(1);
currentStockArticleEntity.setStockupStatus("10");
@ -9070,6 +9122,8 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
currentStockArticleEntity.setId(currentOrderId);
} else {
currentOrderId = currentStockArticleEntity.getId();
currentStockArticleEntity.setGenre(1);
distributionStockArticleClient.updateEntity(currentStockArticleEntity);
}
//判断包件当前仓是否是目的仓
@ -9248,12 +9302,15 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
currentStockArticleEntity.setTransferQuantity(0);
currentStockArticleEntity.setSigninQuantity(0);
currentStockArticleEntity.setIncomingNum(0);
currentStockArticleEntity.setGenre(1);
currentStockArticleEntity.setAllocation(null);
currentStockArticleEntity.setTrays(null);
currentOrderId = distributionStockArticleClient.addData(currentStockArticleEntity);
currentStockArticleEntity.setId(currentOrderId);
} else {
currentOrderId = currentStockArticleEntity.getId();
stockArticleEntity.setGenre(1);
distributionStockArticleClient.updateEntity(stockArticleEntity);
}
//判断包件当前仓是否是目的仓
@ -9406,6 +9463,8 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
stockArticleEntity.setId(currentOrderId);
} else {
currentOrderId = stockArticleEntity.getId();
stockArticleEntity.setGenre(1);
distributionStockArticleClient.updateEntity(stockArticleEntity);
}
//判断包件当前仓是否是目的仓
@ -9639,7 +9698,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
//查询包件是否签收
DistributionParcelListEntity signDistributionParcelListEntity = distributionParcelListClient.findOrderPackageCodeAndStatus(orderPackageCode,"70");
if (!Objects.isNull(distributionParcelListEntity)) {
if (!Objects.isNull(signDistributionParcelListEntity)) {
log.warn("##############unloadPackage: 包件已签收 orderPackageCode={} warehouseId={}", orderPackageCode, warehouseId);
return R.fail(405, "包件已签收");
}
@ -9668,6 +9727,17 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
.eq("scan_code", orderPackageCode)
.eq("scan_status","1");
TrunklineCarsLoadScanEntity carsLoadScanEntity = trunklineCarsLoadScanService.getOne(loadScanQueryWrapper);
// if(Objects.isNull(carsLoadScanEntity)){
// QueryWrapper<TrunklineCarsLoadScanEntity> loadScanQueryWrapper1 = new QueryWrapper<>();
// loadScanQueryWrapper1.eq("load_id", loadId)
// .eq("scan_code", orderPackageCode)
// .eq("scan_status","2")
// .eq("unload_node_id", warehouseId);
// carsLoadScanEntity = trunklineCarsLoadScanService.getOne(loadScanQueryWrapper);
// }
//判断是否有装车扫描记录
if (Objects.isNull(carsLoadScanEntity)) {
//没有装车扫码记录
@ -10324,6 +10394,28 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
return Resp.scanSuccess("卸车成功", audio.toString());
}
@Override
public List<TrunklineCarsLoadExcel> exportLoadCarsPageList(LoadCarsDTO loadCarsDTO) {
loadCarsDTO.setCreateTimeStart(CommonUtil.getStartByDateStr(loadCarsDTO.getCreateTimeStartStr()));
loadCarsDTO.setCreateTimeEnd(CommonUtil.getEndByDateStr(loadCarsDTO.getCreateTimeEndStr()));
loadCarsDTO.setStartTime(CommonUtil.getStartByDateStr(loadCarsDTO.getStartDate()));
loadCarsDTO.setEndTime(CommonUtil.getEndByDateStr(loadCarsDTO.getEndDate()));
loadCarsDTO.setArriveTimeStart(CommonUtil.getStartByDateStr(loadCarsDTO.getArriveTimeStartStr()));
loadCarsDTO.setArriveTimeEnd(CommonUtil.getEndByDateStr(loadCarsDTO.getArriveTimeEndStr()));
List<Long> idList =null;
if (!Objects.isNull(loadCarsDTO.getIds())){
idList = new ArrayList<>();
idList.addAll(Arrays.asList(Func.toLongArray(loadCarsDTO.getIds())));
}
List<TrunklineCarsLoadExcel> pageList = baseMapper.exportLoadCarsList(loadCarsDTO,idList);
return pageList;
}
@Override
public R unloadZero(Long carsLoadScanId,Long loadId, String waybillNo, Integer enterNun, Long warehouseId, Integer unbindTray, String trayCode, String orderCode, String remark,String unloadTrayName,String unloadTrayCode,List<ZeroPackageDTO> zeroPackageList) {

Loading…
Cancel
Save