diff --git a/blade-biz-common/src/main/java/org/springblade/common/utils/CommonUtil.java b/blade-biz-common/src/main/java/org/springblade/common/utils/CommonUtil.java index 9432d8745..c4a9d7c80 100644 --- a/blade-biz-common/src/main/java/org/springblade/common/utils/CommonUtil.java +++ b/blade-biz-common/src/main/java/org/springblade/common/utils/CommonUtil.java @@ -19,6 +19,7 @@ package org.springblade.common.utils; import lombok.extern.log4j.Log4j2; import org.springframework.util.StringUtils; +import java.text.ParseException; import java.text.SimpleDateFormat; import java.time.LocalDate; import java.time.format.DateTimeFormatter; @@ -96,4 +97,14 @@ public class CommonUtil { return UUID.randomUUID().toString().replace("-", ""); } + + public static Date StringToDate(String value) { + try { + SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + return format.parse(value); + } catch (Exception e) { + return null; + } + } + } diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionDeliveryListEntity.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionDeliveryListEntity.java index c8ac1faa4..8a2e34543 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionDeliveryListEntity.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionDeliveryListEntity.java @@ -185,6 +185,11 @@ public class DistributionDeliveryListEntity extends TenantEntity { @ApiModelProperty(value = "配送单号") private String noteNumber; + /** + * 数据来源 + */ + @ApiModelProperty(value = "数据来源") + private Integer source; } diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionLoadscanEntity.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionLoadscanEntity.java new file mode 100644 index 000000000..8b2d65d12 --- /dev/null +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionLoadscanEntity.java @@ -0,0 +1,271 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package com.logpm.distribution.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Date; +import lombok.EqualsAndHashCode; +import org.springblade.core.tenant.mp.TenantEntity; + +/** + * 装车扫描表 实体类 + * + * @author lmy + * @since 2023-06-27 + */ +@Data +@TableName("logpm_distribution_loadscan") +@ApiModel(value = "DistributionLoadscan对象", description = "装车扫描表") +@EqualsAndHashCode(callSuper = true) +public class DistributionLoadscanEntity extends TenantEntity { + + /** + * 预留1 + */ + @ApiModelProperty(value = "预留1") + private String reserve1; + /** + * 预留2 + */ + @ApiModelProperty(value = "预留2") + private String reserve2; + /** + * 预留3 + */ + @ApiModelProperty(value = "预留3") + private String reserve3; + /** + * 预留4 + */ + @ApiModelProperty(value = "预留4") + private String reserve4; + /** + * 预留5 + */ + @ApiModelProperty(value = "预留5") + private String reserve5; + /** + * 扫码类型;(1-件装车,2-托盘装车) + */ + @ApiModelProperty(value = "扫码类型;(1-件装车,2-托盘装车)") + private String scanType; + /** + * 托盘id + */ + @ApiModelProperty(value = "托盘id") + private String trayId; + /** + * 品牌id + */ + @ApiModelProperty(value = "品牌id") + private String brandId; + /** + * 品牌名字 + */ + @ApiModelProperty(value = "品牌名字") + private String brandName; + /** + * 托盘码 + */ + @ApiModelProperty(value = "托盘码") + private String trayNo; + + /** + * 车次号 + */ + @ApiModelProperty(value = "车次号") + private String trainNumber; + + /** + * 配送车辆id + */ + @ApiModelProperty(value = "配送车辆id") + private String vehicleId; + + /** + * 配送司机id + */ + @ApiModelProperty(value = "配送司机id") + private String driverId; + + /** + * 配送车辆车牌 + */ + @ApiModelProperty(value = "配送车辆车牌") + private String vehicleName; + + /** + * 配送司机名称 + */ + @ApiModelProperty(value = "配送司机名称") + private String driverName; + + /** + * 扫描仓库id + */ + @ApiModelProperty(value = "扫描仓库id") + private Long warehouseId; + + /** + * 仓库名称 + */ + @ApiModelProperty(value = "仓库名称") + private String warehouseName; + + /** + * 包条表id + */ + @ApiModelProperty(value = "包条表id") + private Long packageId; + + /** + * 包条码 + */ + @ApiModelProperty(value = "包条码") + private String packetBarCode; + + /** + * 扫描状态;(1=未装车,2=扫描,3=确认) + */ + @ApiModelProperty(value = "扫描状态;(1=未装车,2=扫描,3=确认)") + private Integer scanStatus; + + /** + * 确认时间 + */ + @ApiModelProperty(value = "确认时间") + private Date confirmTime; + + /** + * 扫描时间 + */ + @ApiModelProperty(value = "扫描时间") + private Date scanTime; + + /** + * 是否齐套;(1未齐套,2齐套) + */ + @ApiModelProperty(value = "是否齐套;(1未齐套,2齐套)") + private Integer kitting; + + /** + * 类型;(1卸车,2装车) + */ + @ApiModelProperty(value = "类型;(1卸车,2装车)") + private Integer type; + + /** + * 滞留操作人 + */ + @ApiModelProperty(value = "滞留操作人") + private String detentionPerson; + + /** + * 卸货仓库id + */ + @ApiModelProperty(value = "卸货仓库id") + private Long unWarehouseId; + + /** + * 卸货仓库名称 + */ + @ApiModelProperty(value = "卸货仓库名称") + private String unWarehouseName; + + /** + * 卸货人id + */ + @ApiModelProperty(value = "卸货人id") + private Long unAdministratorsId; + + /** + * 卸货人名称 + */ + @ApiModelProperty(value = "卸货人名称") + private String unAdministratorsName; + + /** + * 补录;(1=正常,2=补录数据) + */ + @ApiModelProperty(value = "补录;(1=正常,2=补录数据)") + private Integer isInsert; + + /** + * 扫码状态;(1=无数据装车;2=有数据装车) + */ + @ApiModelProperty(value = "扫码状态;(1=无数据装车;2=有数据装车)") + private Integer scanState; + + /** + * 同步;(1=正常数据,2=无编码未同步,3=无编码已同步待绑定) + */ + @ApiModelProperty(value = "同步;(1=正常数据,2=无编码未同步,3=无编码已同步待绑定)") + private Integer scanSynchronous; + + /** + * 计划目的网点 + */ + @ApiModelProperty(value = "计划目的网点") + private String planDestinationId; + + /** + * 备注信息 + */ + @ApiModelProperty(value = "备注信息") + private String msg; + + /** + * 卸车时间 + */ + @ApiModelProperty(value = "卸车时间") + private Date unloadTime; + + + /** + * 订单表id + */ + @ApiModelProperty(value = "订单表id") + private Long orderId; + + /** + * 客户表id + */ + @ApiModelProperty(value = "客户表id") + private Long reservationId; + + /** + * 配送表id + */ + @ApiModelProperty(value = "配送表id") + private Long deliveryId; + + /** + * 装车数量 + */ + @ApiModelProperty(value = "装车数量") + private Integer loadedNub; + + /** + * 包内数量 + */ + @ApiModelProperty(value = "包内数量") + private Integer packageNub; + +} diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionReservationEntity.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionReservationEntity.java index cac2448ed..9441a9a60 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionReservationEntity.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionReservationEntity.java @@ -42,7 +42,7 @@ public class DistributionReservationEntity extends TenantEntity { * 订单自编号;展示使用 */ @ApiModelProperty(value = "订单自编号;订单自编号,关联订单表") - private String orderId; + private String stockArticleId; /** * 收货人 */ diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionSelfDeliveryEntity.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionSelfDeliveryEntity.java new file mode 100644 index 000000000..e1acfb7af --- /dev/null +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionSelfDeliveryEntity.java @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package com.logpm.distribution.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Date; +import lombok.EqualsAndHashCode; +import org.springblade.core.tenant.mp.TenantEntity; + +/** + * 自主配送信息列表 实体类 + * + * @author TJJ + * @since 2023-06-26 + */ +@Data +@TableName("logpm_distribution_self_delivery") +@ApiModel(value = "DistributionSelfDelivery对象", description = "自主配送信息列表") +@EqualsAndHashCode(callSuper = true) +public class DistributionSelfDeliveryEntity extends TenantEntity { + + /** + * 预约信息编号 + */ + @ApiModelProperty(value = "预约信息编号") + private String reservationIds; + /** + * 车辆编号 + */ + @ApiModelProperty(value = "车辆编号") + private String vehicleIds; + /** + * 司机负责人 + */ + @ApiModelProperty(value = "司机负责人") + private String masterDriverId; + /** + * 配送司机 + */ + @ApiModelProperty(value = "配送司机") + private String slaveDriverIds; + /** + * 预留1 + */ + @ApiModelProperty(value = "预留1") + private String reserve1; + /** + * 预留2 + */ + @ApiModelProperty(value = "预留2") + private String reserve2; + /** + * 预留3 + */ + @ApiModelProperty(value = "预留3") + private String reserve3; + /** + * 预留4 + */ + @ApiModelProperty(value = "预留4") + private String reserve4; + /** + * 预留5 + */ + @ApiModelProperty(value = "预留5") + private String reserve5; + +} diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionSigndetailEntity.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionSigndetailEntity.java index 81b1f15d6..fd843ac37 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionSigndetailEntity.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionSigndetailEntity.java @@ -106,10 +106,15 @@ public class DistributionSigndetailEntity extends TenantEntity { @ApiModelProperty(value = "货物名称") private String goodsName; /** - * 仓库 + * 仓库名称 */ - @ApiModelProperty(value = "仓库") - private String warehouse; + @ApiModelProperty(value = "仓库名称") + private String warehouseName; + /** + * 仓库Id + */ + @ApiModelProperty(value = "仓库Id") + private String warehouseId; /** * 入库时间 */ diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockupEntity.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockupEntity.java index 921c545f8..1ab120f77 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockupEntity.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockupEntity.java @@ -52,7 +52,7 @@ public class DistributionStockupEntity extends TenantEntity { * ids */ @TableField(exist = false) - @ApiModelProperty(value = "备货人") + @ApiModelProperty(value = "预约编号") private String ids; /** * 备货状态 diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionTripartiteDeliveryEntity.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionTripartiteDeliveryEntity.java new file mode 100644 index 000000000..387d28ff5 --- /dev/null +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionTripartiteDeliveryEntity.java @@ -0,0 +1,91 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package com.logpm.distribution.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Date; +import java.math.BigDecimal; +import lombok.EqualsAndHashCode; +import org.springblade.core.tenant.mp.TenantEntity; + +/** + * 外协配送信息列表 实体类 + * + * @author TJJ + * @since 2023-06-26 + */ +@Data +@TableName("logpm_distribution_tripartite_delivery") +@ApiModel(value = "DistributionTripartiteDelivery对象", description = "外协配送信息列表") +@EqualsAndHashCode(callSuper = true) +public class DistributionTripartiteDeliveryEntity extends TenantEntity { + + /** + * 司机名称 + */ + @ApiModelProperty(value = "司机名称") + private String driverName; + /** + * 司机电话 + */ + @ApiModelProperty(value = "司机电话") + private String driverPhone; + /** + * 车辆车牌 + */ + @ApiModelProperty(value = "车辆车牌") + private String vehicleNum; + /** + * 预约信息编号 + */ + @ApiModelProperty(value = "预约信息") + private String reservationIds; + /** + * 配送费用 + */ + @ApiModelProperty(value = "配送费用") + private BigDecimal deliveryFee; + /** + * 预留1 + */ + @ApiModelProperty(value = "预留1") + private String reserve1; + /** + * 预留2 + */ + @ApiModelProperty(value = "预留2") + private String reserve2; + /** + * 预留3 + */ + @ApiModelProperty(value = "预留3") + private String reserve3; + /** + * 预留4 + */ + @ApiModelProperty(value = "预留4") + private String reserve4; + /** + * 预留5 + */ + @ApiModelProperty(value = "预留5") + private String reserve5; + +} diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionLoadscanClient.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionLoadscanClient.java new file mode 100644 index 000000000..1191618e5 --- /dev/null +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionLoadscanClient.java @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package com.logpm.distribution.feign; + +import org.springblade.common.constant.ModuleNameConstant; +import org.springblade.core.mp.support.BladePage; +import com.logpm.distribution.entity.DistributionLoadscanEntity; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestParam; + +/** + * 装车扫描表 Feign接口类 + * + * @author lmy + * @since 2023-06-27 + */ +@FeignClient( + value = ModuleNameConstant.APPLICATION_DISTRIBUTION_NAME +) +public interface IDistributionLoadscanClient { + + String API_PREFIX = "loadscan/client"; + String TOP = API_PREFIX + "/top"; + + /** + * 获取装车扫描表列表 + * + * @param current 页号 + * @param size 页数 + * @return BladePage + */ + @GetMapping(TOP) + BladePage top(@RequestParam("current") Integer current, @RequestParam("size") Integer size); + +} diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionParcelListClient.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionParcelListClient.java index ba7f33a9e..f1ad1cf20 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionParcelListClient.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionParcelListClient.java @@ -17,9 +17,11 @@ package com.logpm.distribution.feign; import com.logpm.distribution.entity.DistributionParcelListEntity; +import org.springblade.common.constant.ModuleNameConstant; import org.springblade.core.mp.support.BladePage; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestParam; @@ -52,6 +54,6 @@ public interface IDistributionParcelListClient { @GetMapping(API_PREFIX+"/findByPacketBarCode") DistributionParcelListEntity findByPacketBarCode(String unitNo); - @GetMapping(API_PREFIX+"/addBatch") + @PostMapping(API_PREFIX+"/addBatch") boolean addBatch(@RequestBody List parcelListEntityList); } diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionSelfDeliveryClient.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionSelfDeliveryClient.java new file mode 100644 index 000000000..40dcc9e57 --- /dev/null +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionSelfDeliveryClient.java @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package com.logpm.distribution.feign; + +import org.springblade.core.mp.support.BladePage; +import com.logpm.distribution.entity.DistributionSelfDeliveryEntity; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestParam; + +/** + * 自主配送信息列表 Feign接口类 + * + * @author TJJ + * @since 2023-06-26 + */ +@FeignClient( + value = "selfDelivery" +) +public interface IDistributionSelfDeliveryClient { + + String API_PREFIX = "selfDelivery/client"; + String TOP = API_PREFIX + "/top"; + + /** + * 获取自主配送信息列表列表 + * + * @param current 页号 + * @param size 页数 + * @return BladePage + */ + @GetMapping(TOP) + BladePage selfDeliveryTop(@RequestParam("current") Integer current, @RequestParam("size") Integer size); + +} diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionTripartiteDeliveryClient.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionTripartiteDeliveryClient.java new file mode 100644 index 000000000..1f2ad9a97 --- /dev/null +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionTripartiteDeliveryClient.java @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package com.logpm.distribution.feign; + +import org.springblade.core.mp.support.BladePage; +import com.logpm.distribution.entity.DistributionTripartiteDeliveryEntity; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestParam; + +/** + * 外协配送信息列表 Feign接口类 + * + * @author TJJ + * @since 2023-06-26 + */ +@FeignClient( + value = "tripartiteDelivery" +) +public interface IDistributionTripartiteDeliveryClient { + + String API_PREFIX = "tripartiteDelivery/client"; + String TOP = API_PREFIX + "/top"; + + /** + * 获取外协配送信息列表列表 + * + * @param current 页号 + * @param size 页数 + * @return BladePage + */ + @GetMapping(TOP) + BladePage tripartiteDeliveryTop(@RequestParam("current") Integer current, @RequestParam("size") Integer size); + +} diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionLoadscanVO.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionLoadscanVO.java new file mode 100644 index 000000000..3485d6b08 --- /dev/null +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionLoadscanVO.java @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package com.logpm.distribution.vo; + +import com.logpm.distribution.entity.DistributionLoadscanEntity; +import org.springblade.core.tool.node.INode; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 装车扫描表 视图实体类 + * + * @author lmy + * @since 2023-06-27 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class DistributionLoadscanVO extends DistributionLoadscanEntity { + private static final long serialVersionUID = 1L; + +} diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionSelfDeliveryVO.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionSelfDeliveryVO.java new file mode 100644 index 000000000..3e484a8aa --- /dev/null +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionSelfDeliveryVO.java @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package com.logpm.distribution.vo; + +import com.logpm.distribution.entity.DistributionSelfDeliveryEntity; +import org.springblade.core.tool.node.INode; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 自主配送信息列表 视图实体类 + * + * @author TJJ + * @since 2023-06-26 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class DistributionSelfDeliveryVO extends DistributionSelfDeliveryEntity { + private static final long serialVersionUID = 1L; + +} diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionSigndetailVO.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionSigndetailVO.java index 88324e366..569e6339a 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionSigndetailVO.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionSigndetailVO.java @@ -38,10 +38,15 @@ import java.util.List; public class DistributionSigndetailVO extends DistributionSigndetailEntity { private static final long serialVersionUID = 1L; /** - * 客户 + * 客户名称 */ - @ApiModelProperty(value = "客户") - private String consignee; + @ApiModelProperty(value = "客户名称") + private String consigneeName; + /** + * 客户Id + */ + @ApiModelProperty(value = "客户Id") + private String consigneeId; /** * 客户电话 */ diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionTripartiteDeliveryVO.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionTripartiteDeliveryVO.java new file mode 100644 index 000000000..80bf29b78 --- /dev/null +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionTripartiteDeliveryVO.java @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package com.logpm.distribution.vo; + +import com.logpm.distribution.entity.DistributionTripartiteDeliveryEntity; +import org.springblade.core.tool.node.INode; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 外协配送信息列表 视图实体类 + * + * @author TJJ + * @since 2023-06-26 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class DistributionTripartiteDeliveryVO extends DistributionTripartiteDeliveryEntity { + private static final long serialVersionUID = 1L; + +} diff --git a/blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/entity/AdvanceDetailEntity.java b/blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/entity/AdvanceDetailEntity.java index 5d6d4eef8..6a001ad6e 100644 --- a/blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/entity/AdvanceDetailEntity.java +++ b/blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/entity/AdvanceDetailEntity.java @@ -17,14 +17,12 @@ package com.logpm.oldproject.entity; import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; -import lombok.EqualsAndHashCode; -import org.springblade.core.mp.base.BaseEntity; -import org.springblade.core.tenant.mp.TenantEntity; import java.time.LocalDate; @@ -59,11 +57,13 @@ public class AdvanceDetailEntity { * 线下订单明细标时 */ @ApiModelProperty(value = "线下订单明细标时") + @TableField("lineID") private String lineID; /** * 序列号 */ @ApiModelProperty(value = "序列号") + @TableField("serialKey") private String serialKey; /** * 区域 @@ -74,6 +74,7 @@ public class AdvanceDetailEntity { * 订单自编号 */ @ApiModelProperty(value = "订单自编号") + @TableField("orderSelfNum") private String orderSelfNum; /** * 订单来源 @@ -84,11 +85,13 @@ public class AdvanceDetailEntity { * 订单类型 */ @ApiModelProperty(value = "订单类型") + @TableField("systemType") private String systemType; /** * MSCS单号 */ @ApiModelProperty(value = "MSCS单号") + @TableField("orderNum") private String orderNum; /** * 是否干仓配:1=是,0=否 @@ -99,101 +102,121 @@ public class AdvanceDetailEntity { * MTDS单号 */ @ApiModelProperty(value = "MTDS单号") + @TableField("mtdsNo") private String mtdsNo; /** * 一级品类 */ @ApiModelProperty(value = "一级品类") + @TableField("firstPackName") private String firstPackName; /** * 二级品类 */ @ApiModelProperty(value = "二级品类") + @TableField("firstPackCode") private String firstPackCode; /** * 基地名称 */ @ApiModelProperty(value = "基地名称") + @TableField("siteName") private String siteName; /** * 基地编码 */ @ApiModelProperty(value = "基地编码") + @TableField("siteCode") private String siteCode; /** * 货品名称 */ @ApiModelProperty(value = "货品名称") + @TableField("productCode") private String productCode; /** * 二级品类名称 */ @ApiModelProperty(value = "二级品类名称") + @TableField("secondPackName") private String secondPackName; /** * 二级品类 */ @ApiModelProperty(value = "二级品类") + @TableField("secondPackCode") private String secondPackCode; /** * 三级品类名称 */ @ApiModelProperty(value = "三级品类名称") + @TableField("thirdPackName") private String thirdPackName; /** * 三级品类 */ @ApiModelProperty(value = "三级品类") + @TableField("thirdPackCode") private String thirdPackCode; /** * 产品类型 */ @ApiModelProperty(value = "产品类型") + @TableField("goodName") private String goodName; /** * 例放:N=正常,Y=例放 */ @ApiModelProperty(value = "例放:N=正常,Y=例放") + @TableField("isAddin") private String isAddin; /** * 三级例放:N=正常,Y=例放 */ @ApiModelProperty(value = "三级例放:N=正常,Y=例放") + @TableField("isThirdAddin") private String isThirdAddin; /** * 补进:N=正常,Y=例放 */ @ApiModelProperty(value = "补进:N=正常,Y=例放") + @TableField("isSuppin") private String isSuppin; /** * 发货数量 */ @ApiModelProperty(value = "发货数量") + @TableField("mscsNum") private String mscsNum; /** * 销售数量 */ @ApiModelProperty(value = "销售数量") + @TableField("mtdsNum") private Integer mtdsNum; /** * 体积 */ @ApiModelProperty(value = "体积") + @TableField("volume") private String volume; /** * 包条码 */ @ApiModelProperty(value = "包条码") + @TableField("unitNo") private String unitNo; /** * 车次号 */ @ApiModelProperty(value = "车次号") + @TableField("mctsTruck") private String mctsTruck; /** * 车牌号 */ @ApiModelProperty(value = "车牌号") + @TableField("mctsTruckNo") private String mctsTruckNo; /** * 基地发货日期 @@ -234,6 +257,7 @@ public class AdvanceDetailEntity { * 服务号 */ @ApiModelProperty(value = "服务号") + @TableField("serviceNum") private String serviceNum; /** * @@ -249,6 +273,7 @@ public class AdvanceDetailEntity { * 交期 */ @ApiModelProperty(value = "交期") + @TableField("dueDate") private LocalDate dueDate; /** * 交期 diff --git a/blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/entity/ServiceNumEntity.java b/blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/entity/ServiceNumEntity.java index 7fe686071..1b8303ede 100644 --- a/blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/entity/ServiceNumEntity.java +++ b/blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/entity/ServiceNumEntity.java @@ -17,14 +17,12 @@ package com.logpm.oldproject.entity; import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; -import lombok.EqualsAndHashCode; -import org.springblade.core.mp.base.BaseEntity; -import org.springblade.core.tenant.mp.TenantEntity; import java.time.LocalDate; @@ -49,11 +47,13 @@ public class ServiceNumEntity { * 服务号 */ @ApiModelProperty(value = "服务号") + @TableField("serviceNum") private String serviceNum; /** * 订单数量 */ @ApiModelProperty(value = "订单数量") + @TableField("total") private String total; /** * 包数量 @@ -64,26 +64,31 @@ public class ServiceNumEntity { * 商场名 */ @ApiModelProperty(value = "商场名") + @TableField("storeName") private String storeName; /** * 商场编号 */ @ApiModelProperty(value = "商场编号") + @TableField("storeNo") private String storeNo; /** * 顾客姓名 */ @ApiModelProperty(value = "顾客姓名") + @TableField("customerName") private String customerName; /** * 顾客电话 */ @ApiModelProperty(value = "顾客电话") + @TableField("customerPhone") private String customerPhone; /** * 顾客地址 */ @ApiModelProperty(value = "顾客地址") + @TableField("customerRoad") private String customerRoad; /** * 是否干仓配 diff --git a/blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IServiceNumClient.java b/blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IServiceNumClient.java index 5d475757b..dabe0e0d7 100644 --- a/blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IServiceNumClient.java +++ b/blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IServiceNumClient.java @@ -18,8 +18,10 @@ package com.logpm.oldproject.feign; import com.logpm.oldproject.entity.ServiceNumEntity; import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestParam; import java.util.List; @@ -53,4 +55,7 @@ public interface IServiceNumClient { */ @PostMapping(API_PREFIX + "/addServiceNum") Boolean addServiceNum(@RequestBody List serviceNumEntity); + + @GetMapping(API_PREFIX + "/findByserviceNum") + ServiceNumEntity findByserviceNum(@RequestParam String sn); } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataDriverArteryController.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataDriverArteryController.java index d7966ae33..540733c00 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataDriverArteryController.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataDriverArteryController.java @@ -116,7 +116,7 @@ public class BasicdataDriverArteryController extends BladeController { public R save(@Valid @RequestBody BasicdataDriverArteryDTO basicdataDriverArtery) { boolean save = basicdataDriverArteryService.save(basicdataDriverArtery); //加入关联表 - if (null !=basicdataDriverArtery.getBindVehicles() && save){ + if (null !=basicdataDriverArtery.getBindVehicles()&& save){ Integer b = basicdataDriverArteryService.updateVehicle(basicdataDriverArtery); } return R.status(save); diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataDriverArteryServiceImpl.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataDriverArteryServiceImpl.java index 488bc8db9..2aaa4d7a3 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataDriverArteryServiceImpl.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataDriverArteryServiceImpl.java @@ -71,8 +71,9 @@ public class BasicdataDriverArteryServiceImpl extends BaseServiceImpl().lambda().eq(BasicdataDrivermiddleEntity::getDriverId, basicdataDriverArtery.getId())); + if (basicdataDriverArtery.getBindVehicles().equals(""))return delete; //新增现有的数据 - if (delete>0){ + //if (delete>0){ List bindVehicles = Arrays.asList(basicdataDriverArtery.getBindVehicles().split(",")); ArrayList basicdataDrivermiddleEntities = new ArrayList<>(); bindVehicles.forEach(e->{ @@ -82,7 +83,7 @@ public class BasicdataDriverArteryServiceImpl extends BaseServiceImpl().lambda().eq(BasicdataDrivermiddleEntity::getBrandId, basicdataVehicle.getId())); + if (basicdataVehicle.getVehicleOwners().equals(""))return delete; //新增现有的数据 - if (delete>0){ + // if (delete>0){ List bindOwners = Arrays.asList(basicdataVehicle.getVehicleOwners().split(",")); ArrayList basicdataDrivermiddleEntities = new ArrayList<>(); bindOwners.forEach(e->{ @@ -94,7 +95,7 @@ public class BasicdataVehicleServiceImpl extends BaseServiceImpl loadingscan(@Valid @RequestBody DistrilbutionloadingscanDTO distrilbutionloadingscanDTO) { + Integer i = distributionDeliveryListService.loadingscan(distrilbutionloadingscanDTO); + return R.data(i); + } + /** * 配送管理 点击发车 */ @@ -130,7 +143,7 @@ public class DistributionDeliveryListController extends BladeController { @GetMapping("/page") @ApiOperationSupport(order = 3) @ApiOperation(value = "分页", notes = "传入distributionDeliveryList") - public R> page(DistributionDeliveryListVO distributionDeliveryList, Query query) { + public R> page(DistributionDeliveryListDTO distributionDeliveryList, Query query) { IPage pages = distributionDeliveryListService.selectDistributionDeliveryListPage(Condition.getPage(query), distributionDeliveryList); return R.data(pages); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionLoadscanController.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionLoadscanController.java new file mode 100644 index 000000000..a4d449906 --- /dev/null +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionLoadscanController.java @@ -0,0 +1,150 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package com.logpm.distribution.controller; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import lombok.AllArgsConstructor; +import javax.validation.Valid; + +import org.springblade.core.secure.BladeUser; +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.springframework.web.bind.annotation.*; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.logpm.distribution.entity.DistributionLoadscanEntity; +import com.logpm.distribution.vo.DistributionLoadscanVO; +import com.logpm.distribution.excel.DistributionLoadscanExcel; +import com.logpm.distribution.service.IDistributionLoadscanService; +import org.springblade.core.boot.ctrl.BladeController; +import org.springblade.core.tool.utils.DateUtil; +import org.springblade.core.excel.util.ExcelUtil; +import org.springblade.core.tool.constant.BladeConstant; +import springfox.documentation.annotations.ApiIgnore; +import java.util.Map; +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +/** + * 装车扫描表 控制器 + * + * @author lmy + * @since 2023-06-27 + */ +@RestController +@AllArgsConstructor +@RequestMapping("loadscan/distributionLoadscan") +@Api(value = "装车扫描表", tags = "装车扫描表接口") +public class DistributionLoadscanController extends BladeController { + + private final IDistributionLoadscanService distributionLoadscanService; + + /** + * 装车扫描表 详情 + */ + @GetMapping("/detail") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "详情", notes = "传入distributionLoadscan") + public R detail(DistributionLoadscanEntity distributionLoadscan) { + DistributionLoadscanEntity detail = distributionLoadscanService.getOne(Condition.getQueryWrapper(distributionLoadscan)); + return R.data(detail); + } + /** + * 装车扫描表 分页 + */ + @GetMapping("/list") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "分页", notes = "传入distributionLoadscan") + public R> list(@ApiIgnore @RequestParam Map distributionLoadscan, Query query) { + IPage pages = distributionLoadscanService.page(Condition.getPage(query), Condition.getQueryWrapper(distributionLoadscan, DistributionLoadscanEntity.class)); + return R.data(pages); + } + + /** + * 装车扫描表 自定义分页 + */ + @GetMapping("/page") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "分页", notes = "传入distributionLoadscan") + public R> page(DistributionLoadscanVO distributionLoadscan, Query query) { + IPage pages = distributionLoadscanService.selectDistributionLoadscanPage(Condition.getPage(query), distributionLoadscan); + return R.data(pages); + } + + /** + * 装车扫描表 新增 + */ + @PostMapping("/save") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "新增", notes = "传入distributionLoadscan") + public R save(@Valid @RequestBody DistributionLoadscanEntity distributionLoadscan) { + return R.status(distributionLoadscanService.save(distributionLoadscan)); + } + + /** + * 装车扫描表 修改 + */ + @PostMapping("/update") + @ApiOperationSupport(order = 5) + @ApiOperation(value = "修改", notes = "传入distributionLoadscan") + public R update(@Valid @RequestBody DistributionLoadscanEntity distributionLoadscan) { + return R.status(distributionLoadscanService.updateById(distributionLoadscan)); + } + + /** + * 装车扫描表 新增或修改 + */ + @PostMapping("/submit") + @ApiOperationSupport(order = 6) + @ApiOperation(value = "新增或修改", notes = "传入distributionLoadscan") + public R submit(@Valid @RequestBody DistributionLoadscanEntity distributionLoadscan) { + return R.status(distributionLoadscanService.saveOrUpdate(distributionLoadscan)); + } + + /** + * 装车扫描表 删除 + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 7) + @ApiOperation(value = "逻辑删除", notes = "传入ids") + public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return R.status(distributionLoadscanService.deleteLogic(Func.toLongList(ids))); + } + + + /** + * 导出数据 + */ + @GetMapping("/export-distributionLoadscan") + @ApiOperationSupport(order = 9) + @ApiOperation(value = "导出数据", notes = "传入distributionLoadscan") + public void exportDistributionLoadscan(@ApiIgnore @RequestParam Map distributionLoadscan, BladeUser bladeUser, HttpServletResponse response) { + QueryWrapper queryWrapper = Condition.getQueryWrapper(distributionLoadscan, DistributionLoadscanEntity.class); + //if (!AuthUtil.isAdministrator()) { + // queryWrapper.lambda().eq(DistributionLoadscan::getTenantId, bladeUser.getTenantId()); + //} + queryWrapper.lambda().eq(DistributionLoadscanEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED); + List list = distributionLoadscanService.exportDistributionLoadscan(queryWrapper); + ExcelUtil.export(response, "装车扫描表数据" + DateUtil.time(), "装车扫描表数据表", list, DistributionLoadscanExcel.class); + } + +} diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionReservationController.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionReservationController.java index d605bafee..06926e97c 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionReservationController.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionReservationController.java @@ -183,4 +183,15 @@ public class DistributionReservationController extends BladeController { List result = reservationService.getReservationAddr(ids); return R.data(result); } + + /** + * 批量预约转配送任务 + */ + @PostMapping("/deliveryTask") + @ApiOperationSupport(order = 7) + @ApiOperation(value = "批量预约转备货任务") + public R deliveryTask(@RequestBody Map deliveryInfo) { + R result = reservationService.deliveryTask(deliveryInfo); + return result; + } } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionSelfDeliveryController.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionSelfDeliveryController.java new file mode 100644 index 000000000..adce7044a --- /dev/null +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionSelfDeliveryController.java @@ -0,0 +1,150 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package com.logpm.distribution.controller; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import lombok.AllArgsConstructor; +import javax.validation.Valid; + +import org.springblade.core.secure.BladeUser; +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.springframework.web.bind.annotation.*; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.logpm.distribution.entity.DistributionSelfDeliveryEntity; +import com.logpm.distribution.vo.DistributionSelfDeliveryVO; +import com.logpm.distribution.excel.DistributionSelfDeliveryExcel; +import com.logpm.distribution.service.IDistributionSelfDeliveryService; +import org.springblade.core.boot.ctrl.BladeController; +import org.springblade.core.tool.utils.DateUtil; +import org.springblade.core.excel.util.ExcelUtil; +import org.springblade.core.tool.constant.BladeConstant; +import springfox.documentation.annotations.ApiIgnore; +import java.util.Map; +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +/** + * 自主配送信息列表 控制器 + * + * @author TJJ + * @since 2023-06-26 + */ +@RestController +@AllArgsConstructor +@RequestMapping("selfDelivery/distributionSelfDelivery") +@Api(value = "自主配送信息列表", tags = "自主配送信息列表接口") +public class DistributionSelfDeliveryController extends BladeController { + + private final IDistributionSelfDeliveryService distributionSelfDeliveryService; + + /** + * 自主配送信息列表 详情 + */ + @GetMapping("/detail") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "详情", notes = "传入distributionSelfDelivery") + public R detail(DistributionSelfDeliveryEntity distributionSelfDelivery) { + DistributionSelfDeliveryEntity detail = distributionSelfDeliveryService.getOne(Condition.getQueryWrapper(distributionSelfDelivery)); + return R.data(detail); + } + /** + * 自主配送信息列表 分页 + */ + @GetMapping("/list") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "分页", notes = "传入distributionSelfDelivery") + public R> list(@ApiIgnore @RequestParam Map distributionSelfDelivery, Query query) { + IPage pages = distributionSelfDeliveryService.page(Condition.getPage(query), Condition.getQueryWrapper(distributionSelfDelivery, DistributionSelfDeliveryEntity.class)); + return R.data(pages); + } + + /** + * 自主配送信息列表 自定义分页 + */ + @GetMapping("/page") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "分页", notes = "传入distributionSelfDelivery") + public R> page(DistributionSelfDeliveryVO distributionSelfDelivery, Query query) { + IPage pages = distributionSelfDeliveryService.selectDistributionSelfDeliveryPage(Condition.getPage(query), distributionSelfDelivery); + return R.data(pages); + } + + /** + * 自主配送信息列表 新增 + */ + @PostMapping("/save") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "新增", notes = "传入distributionSelfDelivery") + public R save(@Valid @RequestBody DistributionSelfDeliveryEntity distributionSelfDelivery) { + return R.status(distributionSelfDeliveryService.save(distributionSelfDelivery)); + } + + /** + * 自主配送信息列表 修改 + */ + @PostMapping("/update") + @ApiOperationSupport(order = 5) + @ApiOperation(value = "修改", notes = "传入distributionSelfDelivery") + public R update(@Valid @RequestBody DistributionSelfDeliveryEntity distributionSelfDelivery) { + return R.status(distributionSelfDeliveryService.updateById(distributionSelfDelivery)); + } + + /** + * 自主配送信息列表 新增或修改 + */ + @PostMapping("/submit") + @ApiOperationSupport(order = 6) + @ApiOperation(value = "新增或修改", notes = "传入distributionSelfDelivery") + public R submit(@Valid @RequestBody DistributionSelfDeliveryEntity distributionSelfDelivery) { + return R.status(distributionSelfDeliveryService.saveOrUpdate(distributionSelfDelivery)); + } + + /** + * 自主配送信息列表 删除 + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 7) + @ApiOperation(value = "逻辑删除", notes = "传入ids") + public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return R.status(distributionSelfDeliveryService.deleteLogic(Func.toLongList(ids))); + } + + + /** + * 导出数据 + */ + @GetMapping("/export-distributionSelfDelivery") + @ApiOperationSupport(order = 9) + @ApiOperation(value = "导出数据", notes = "传入distributionSelfDelivery") + public void exportDistributionSelfDelivery(@ApiIgnore @RequestParam Map distributionSelfDelivery, BladeUser bladeUser, HttpServletResponse response) { + QueryWrapper queryWrapper = Condition.getQueryWrapper(distributionSelfDelivery, DistributionSelfDeliveryEntity.class); + //if (!AuthUtil.isAdministrator()) { + // queryWrapper.lambda().eq(DistributionSelfDelivery::getTenantId, bladeUser.getTenantId()); + //} + queryWrapper.lambda().eq(DistributionSelfDeliveryEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED); + List list = distributionSelfDeliveryService.exportDistributionSelfDelivery(queryWrapper); + ExcelUtil.export(response, "自主配送信息列表数据" + DateUtil.time(), "自主配送信息列表数据表", list, DistributionSelfDeliveryExcel.class); + } + +} diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockArticleController.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockArticleController.java index 9e380b4d5..2975c1b94 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockArticleController.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockArticleController.java @@ -220,4 +220,16 @@ public class DistributionStockArticleController extends BladeController { return result; } + + /** + * 获取批量在库订单信息 + */ + @GetMapping("/stockArticleInfo") + @ApiOperationSupport(order = 7) + @ApiOperation(value = "逻辑删除", notes = "传入ids") + public R getStockArticleInfo(@ApiParam(value = "主键集合", required = true) String ids) { + R> result = distributionStockArticleService.getStockArticleInfo(ids); + return result; + } + } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionTripartiteDeliveryController.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionTripartiteDeliveryController.java new file mode 100644 index 000000000..4cc4c2792 --- /dev/null +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionTripartiteDeliveryController.java @@ -0,0 +1,150 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package com.logpm.distribution.controller; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import lombok.AllArgsConstructor; +import javax.validation.Valid; + +import org.springblade.core.secure.BladeUser; +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.springframework.web.bind.annotation.*; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.logpm.distribution.entity.DistributionTripartiteDeliveryEntity; +import com.logpm.distribution.vo.DistributionTripartiteDeliveryVO; +import com.logpm.distribution.excel.DistributionTripartiteDeliveryExcel; +import com.logpm.distribution.service.IDistributionTripartiteDeliveryService; +import org.springblade.core.boot.ctrl.BladeController; +import org.springblade.core.tool.utils.DateUtil; +import org.springblade.core.excel.util.ExcelUtil; +import org.springblade.core.tool.constant.BladeConstant; +import springfox.documentation.annotations.ApiIgnore; +import java.util.Map; +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +/** + * 外协配送信息列表 控制器 + * + * @author TJJ + * @since 2023-06-26 + */ +@RestController +@AllArgsConstructor +@RequestMapping("tripartiteDelivery/distributionTripartiteDelivery") +@Api(value = "外协配送信息列表", tags = "外协配送信息列表接口") +public class DistributionTripartiteDeliveryController extends BladeController { + + private final IDistributionTripartiteDeliveryService distributionTripartiteDeliveryService; + + /** + * 外协配送信息列表 详情 + */ + @GetMapping("/detail") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "详情", notes = "传入distributionTripartiteDelivery") + public R detail(DistributionTripartiteDeliveryEntity distributionTripartiteDelivery) { + DistributionTripartiteDeliveryEntity detail = distributionTripartiteDeliveryService.getOne(Condition.getQueryWrapper(distributionTripartiteDelivery)); + return R.data(detail); + } + /** + * 外协配送信息列表 分页 + */ + @GetMapping("/list") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "分页", notes = "传入distributionTripartiteDelivery") + public R> list(@ApiIgnore @RequestParam Map distributionTripartiteDelivery, Query query) { + IPage pages = distributionTripartiteDeliveryService.page(Condition.getPage(query), Condition.getQueryWrapper(distributionTripartiteDelivery, DistributionTripartiteDeliveryEntity.class)); + return R.data(pages); + } + + /** + * 外协配送信息列表 自定义分页 + */ + @GetMapping("/page") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "分页", notes = "传入distributionTripartiteDelivery") + public R> page(DistributionTripartiteDeliveryVO distributionTripartiteDelivery, Query query) { + IPage pages = distributionTripartiteDeliveryService.selectDistributionTripartiteDeliveryPage(Condition.getPage(query), distributionTripartiteDelivery); + return R.data(pages); + } + + /** + * 外协配送信息列表 新增 + */ + @PostMapping("/save") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "新增", notes = "传入distributionTripartiteDelivery") + public R save(@Valid @RequestBody DistributionTripartiteDeliveryEntity distributionTripartiteDelivery) { + return R.status(distributionTripartiteDeliveryService.save(distributionTripartiteDelivery)); + } + + /** + * 外协配送信息列表 修改 + */ + @PostMapping("/update") + @ApiOperationSupport(order = 5) + @ApiOperation(value = "修改", notes = "传入distributionTripartiteDelivery") + public R update(@Valid @RequestBody DistributionTripartiteDeliveryEntity distributionTripartiteDelivery) { + return R.status(distributionTripartiteDeliveryService.updateById(distributionTripartiteDelivery)); + } + + /** + * 外协配送信息列表 新增或修改 + */ + @PostMapping("/submit") + @ApiOperationSupport(order = 6) + @ApiOperation(value = "新增或修改", notes = "传入distributionTripartiteDelivery") + public R submit(@Valid @RequestBody DistributionTripartiteDeliveryEntity distributionTripartiteDelivery) { + return R.status(distributionTripartiteDeliveryService.saveOrUpdate(distributionTripartiteDelivery)); + } + + /** + * 外协配送信息列表 删除 + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 7) + @ApiOperation(value = "逻辑删除", notes = "传入ids") + public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return R.status(distributionTripartiteDeliveryService.deleteLogic(Func.toLongList(ids))); + } + + + /** + * 导出数据 + */ + @GetMapping("/export-distributionTripartiteDelivery") + @ApiOperationSupport(order = 9) + @ApiOperation(value = "导出数据", notes = "传入distributionTripartiteDelivery") + public void exportDistributionTripartiteDelivery(@ApiIgnore @RequestParam Map distributionTripartiteDelivery, BladeUser bladeUser, HttpServletResponse response) { + QueryWrapper queryWrapper = Condition.getQueryWrapper(distributionTripartiteDelivery, DistributionTripartiteDeliveryEntity.class); + //if (!AuthUtil.isAdministrator()) { + // queryWrapper.lambda().eq(DistributionTripartiteDelivery::getTenantId, bladeUser.getTenantId()); + //} + queryWrapper.lambda().eq(DistributionTripartiteDeliveryEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED); + List list = distributionTripartiteDeliveryService.exportDistributionTripartiteDelivery(queryWrapper); + ExcelUtil.export(response, "外协配送信息列表数据" + DateUtil.time(), "外协配送信息列表数据表", list, DistributionTripartiteDeliveryExcel.class); + } + +} diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistributionDeliveryListDTO.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistributionDeliveryListDTO.java index 8dee5a04e..f98962e1d 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistributionDeliveryListDTO.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistributionDeliveryListDTO.java @@ -20,6 +20,7 @@ import com.logpm.distribution.entity.DistributionDeliveryListEntity; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; +import lombok.NonNull; /** * 配送管理 数据传输对象实体类 diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistributionLoadscanDTO.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistributionLoadscanDTO.java new file mode 100644 index 000000000..c5da7ff2b --- /dev/null +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistributionLoadscanDTO.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package com.logpm.distribution.dto; + +import com.logpm.distribution.entity.DistributionLoadscanEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 装车扫描表 数据传输对象实体类 + * + * @author lmy + * @since 2023-06-27 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class DistributionLoadscanDTO extends DistributionLoadscanEntity { + private static final long serialVersionUID = 1L; + +} diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistributionSelfDeliveryDTO.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistributionSelfDeliveryDTO.java new file mode 100644 index 000000000..32a399c17 --- /dev/null +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistributionSelfDeliveryDTO.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package com.logpm.distribution.dto; + +import com.logpm.distribution.entity.DistributionSelfDeliveryEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 自主配送信息列表 数据传输对象实体类 + * + * @author TJJ + * @since 2023-06-26 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class DistributionSelfDeliveryDTO extends DistributionSelfDeliveryEntity { + private static final long serialVersionUID = 1L; + +} diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistributionSigndetailDTO.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistributionSigndetailDTO.java index 93a15c093..75e666050 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistributionSigndetailDTO.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistributionSigndetailDTO.java @@ -39,7 +39,7 @@ public class DistributionSigndetailDTO extends DistributionSigndetailEntity { * 客户 */ @ApiModelProperty(value = "客户") - private String consignee; + private String consigneeName; /** * 客户电话 */ diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistributionTripartiteDeliveryDTO.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistributionTripartiteDeliveryDTO.java new file mode 100644 index 000000000..15aa31b21 --- /dev/null +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistributionTripartiteDeliveryDTO.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package com.logpm.distribution.dto; + +import com.logpm.distribution.entity.DistributionTripartiteDeliveryEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 外协配送信息列表 数据传输对象实体类 + * + * @author TJJ + * @since 2023-06-26 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class DistributionTripartiteDeliveryDTO extends DistributionTripartiteDeliveryEntity { + private static final long serialVersionUID = 1L; + +} diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistrilbutionloadingscanDTO.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistrilbutionloadingscanDTO.java new file mode 100644 index 000000000..4c3e3bb40 --- /dev/null +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistrilbutionloadingscanDTO.java @@ -0,0 +1,26 @@ +package com.logpm.distribution.dto; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.NonNull; + +import javax.validation.constraints.NotEmpty; + +@Data +public class DistrilbutionloadingscanDTO { + /** + * 扫描包条信息 + */ + + @ApiModelProperty(value = "扫描包条信息") + @NotEmpty(message = "扫描单号不能为空") + private String barcode; + + + /** + * 扫描类型 + */ + @ApiModelProperty(value = "扫描类型(1-包条,2-托盘)") + @NotEmpty(message = "扫描类型不能为空") + private Integer type; +} diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/excel/DistributionLoadscanExcel.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/excel/DistributionLoadscanExcel.java new file mode 100644 index 000000000..fc6476732 --- /dev/null +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/excel/DistributionLoadscanExcel.java @@ -0,0 +1,316 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package com.logpm.distribution.excel; + + +import lombok.Data; + +import java.util.Date; +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 java.io.Serializable; + + +/** + * 装车扫描表 Excel实体类 + * + * @author lmy + * @since 2023-06-27 + */ +@Data +@ColumnWidth(25) +@HeadRowHeight(20) +@ContentRowHeight(18) +public class DistributionLoadscanExcel implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 租户号 + */ + @ColumnWidth(20) + @ExcelProperty("租户号") + private String tenantId; + /** + * 是否已删除 + */ + @ColumnWidth(20) + @ExcelProperty("是否已删除") + private Integer isDeleted; + /** + * 预留1 + */ + @ColumnWidth(20) + @ExcelProperty("预留1") + private String reserve1; + /** + * 预留2 + */ + @ColumnWidth(20) + @ExcelProperty("预留2") + private String reserve2; + /** + * 预留3 + */ + @ColumnWidth(20) + @ExcelProperty("预留3") + private String reserve3; + /** + * 预留4 + */ + @ColumnWidth(20) + @ExcelProperty("预留4") + private String reserve4; + /** + * 预留5 + */ + @ColumnWidth(20) + @ExcelProperty("预留5") + private String reserve5; + /** + * 扫码类型;(1-件装车,2-托盘装车) + */ + @ColumnWidth(20) + @ExcelProperty("扫码类型;(1-件装车,2-托盘装车)") + private String scanType; + /** + * 托盘id + */ + @ColumnWidth(20) + @ExcelProperty("托盘id") + private String trayId; + /** + * 品牌id + */ + @ColumnWidth(20) + @ExcelProperty("品牌id") + private String brandId; + /** + * 品牌名字 + */ + @ColumnWidth(20) + @ExcelProperty("品牌名字") + private String brandName; + /** + * 托盘码 + */ + @ColumnWidth(20) + @ExcelProperty("托盘码") + private String trayNo; + /** + * 车次号 + */ + @ColumnWidth(20) + @ExcelProperty("车次号") + private String trainNumber; + /** + * 配送车辆id + */ + @ColumnWidth(20) + @ExcelProperty("配送车辆id") + private String vehicleId; + /** + * 配送司机id + */ + @ColumnWidth(20) + @ExcelProperty("配送司机id") + private String driverId; + /** + * 配送车辆车牌 + */ + @ColumnWidth(20) + @ExcelProperty("配送车辆车牌") + private String vehicleName; + /** + * 配送司机名称 + */ + @ColumnWidth(20) + @ExcelProperty("配送司机名称") + private String driverName; + /** + * 扫描仓库id + */ + @ColumnWidth(20) + @ExcelProperty("扫描仓库id") + private Long warehouseId; + + /** + * 仓库名称 + */ + @ColumnWidth(20) + @ExcelProperty("仓库名称") + private String warehouseName; + /** + * 包条表id + */ + @ColumnWidth(20) + @ExcelProperty("包条表id") + private Long packageId; + /** + * 包条码 + */ + @ColumnWidth(20) + @ExcelProperty("包条码") + private String packetBarCode; + /** + * 扫描状态;(1=未装车,2=扫描,3=确认) + */ + @ColumnWidth(20) + @ExcelProperty("扫描状态;(1=未装车,2=扫描,3=确认)") + private Integer scanStatus; + /** + * 确认时间 + */ + @ColumnWidth(20) + @ExcelProperty("确认时间") + private Date confirmTime; + /** + * 扫描时间 + */ + @ColumnWidth(20) + @ExcelProperty("扫描时间") + private Date scanTime; + + /** + * 是否齐套;(1未齐套,2齐套) + */ + @ColumnWidth(20) + @ExcelProperty("是否齐套;(1未齐套,2齐套)") + private Integer kitting; + /** + * 类型;(1卸车,2装车) + */ + @ColumnWidth(20) + @ExcelProperty("类型;(1卸车,2装车)") + private Integer type; + + /** + * 滞留操作人 + */ + @ColumnWidth(20) + @ExcelProperty("滞留操作人") + private String detentionPerson; + + /** + * 卸货仓库id + */ + @ColumnWidth(20) + @ExcelProperty("卸货仓库id") + private Long unWarehouseId; + + /** + * 卸货仓库名称 + */ + @ColumnWidth(20) + @ExcelProperty("卸货仓库名称") + private String unWarehouseName; + + /** + * 卸货人id + */ + @ColumnWidth(20) + @ExcelProperty("卸货人id") + private Long unAdministratorsId; + + /** + * 卸货人名称 + */ + @ColumnWidth(20) + @ExcelProperty("卸货人名称") + private String unAdministratorsName; + + /** + * 补录;(1=正常,2=补录数据) + */ + @ColumnWidth(20) + @ExcelProperty("补录;(1=正常,2=补录数据)") + private Integer isInsert; + + /** + * 扫码状态;(1=无数据装车;2=有数据装车) + */ + @ColumnWidth(20) + @ExcelProperty("扫码状态;(1=无数据装车;2=有数据装车)") + private Integer scanState; + + /** + * 同步;(1=正常数据,2=无编码未同步,3=无编码已同步待绑定) + */ + @ColumnWidth(20) + @ExcelProperty("同步;(1=正常数据,2=无编码未同步,3=无编码已同步待绑定)") + private Integer scanSynchronous; + + /** + * 计划目的网点 + */ + @ColumnWidth(20) + @ExcelProperty("计划目的网点") + private String planDestinationId; + + /** + * 备注信息 + */ + @ColumnWidth(20) + @ExcelProperty("备注信息") + private String msg; + + /** + * 卸车时间 + */ + @ColumnWidth(20) + @ExcelProperty("卸车时间") + private Date unloadTime; + + /** + * 订单表id + */ + @ColumnWidth(20) + @ExcelProperty("订单表id") + private Long orderId; + + /** + * 客户表id + */ + @ColumnWidth(20) + @ExcelProperty("客户表id") + private Long reservationId; + + /** + * 配送表id + */ + @ColumnWidth(20) + @ExcelProperty("配送表id") + private Long deliveryId; + + /** + * 装车数量 + */ + @ColumnWidth(20) + @ExcelProperty("装车数量") + private Integer loadedNub; + + /** + * 包内数量 + */ + @ColumnWidth(20) + @ExcelProperty("包内数量") + private Integer packageNub; + + +} diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/excel/DistributionSelfDeliveryExcel.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/excel/DistributionSelfDeliveryExcel.java new file mode 100644 index 000000000..9c07c1f5a --- /dev/null +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/excel/DistributionSelfDeliveryExcel.java @@ -0,0 +1,111 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package com.logpm.distribution.excel; + + +import lombok.Data; + +import java.util.Date; +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 java.io.Serializable; + + +/** + * 自主配送信息列表 Excel实体类 + * + * @author TJJ + * @since 2023-06-26 + */ +@Data +@ColumnWidth(25) +@HeadRowHeight(20) +@ContentRowHeight(18) +public class DistributionSelfDeliveryExcel implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 租户号 + */ + @ColumnWidth(20) + @ExcelProperty("租户号") + private String tenantId; + /** + * 是否已删除 + */ + @ColumnWidth(20) + @ExcelProperty("是否已删除") + private Integer isDeleted; + /** + * 预约信息编号 + */ + @ColumnWidth(20) + @ExcelProperty("预约信息编号") + private String reservationIds; + /** + * 车辆编号 + */ + @ColumnWidth(20) + @ExcelProperty("车辆编号") + private String vehicleIds; + /** + * 司机负责人 + */ + @ColumnWidth(20) + @ExcelProperty("司机负责人") + private String masterDriverId; + /** + * 配送司机 + */ + @ColumnWidth(20) + @ExcelProperty("配送司机") + private String slaveDriverIds; + /** + * 预留1 + */ + @ColumnWidth(20) + @ExcelProperty("预留1") + private String reserve1; + /** + * 预留2 + */ + @ColumnWidth(20) + @ExcelProperty("预留2") + private String reserve2; + /** + * 预留3 + */ + @ColumnWidth(20) + @ExcelProperty("预留3") + private String reserve3; + /** + * 预留4 + */ + @ColumnWidth(20) + @ExcelProperty("预留4") + private String reserve4; + /** + * 预留5 + */ + @ColumnWidth(20) + @ExcelProperty("预留5") + private String reserve5; + +} diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/excel/DistributionTripartiteDeliveryExcel.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/excel/DistributionTripartiteDeliveryExcel.java new file mode 100644 index 000000000..f2d5b4272 --- /dev/null +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/excel/DistributionTripartiteDeliveryExcel.java @@ -0,0 +1,112 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package com.logpm.distribution.excel; + + +import lombok.Data; + +import java.util.Date; +import java.math.BigDecimal; +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 java.io.Serializable; + + +/** + * 外协配送信息列表 Excel实体类 + * + * @author TJJ + * @since 2023-06-26 + */ +@Data +@ColumnWidth(25) +@HeadRowHeight(20) +@ContentRowHeight(18) +public class DistributionTripartiteDeliveryExcel implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 租户号 + */ + @ColumnWidth(20) + @ExcelProperty("租户号") + private String tenantId; + /** + * 是否已删除 + */ + @ColumnWidth(20) + @ExcelProperty("是否已删除") + private Integer isDeleted; + /** + * 司机名称 + */ + @ColumnWidth(20) + @ExcelProperty("司机名称") + private String driverName; + /** + * 司机电话 + */ + @ColumnWidth(20) + @ExcelProperty("司机电话") + private String driverPhone; + /** + * 车辆车牌 + */ + @ColumnWidth(20) + @ExcelProperty("车辆车牌") + private String vehicleNum; + /** + * 配送费用 + */ + @ColumnWidth(20) + @ExcelProperty("配送费用") + private BigDecimal deliveryFee; + /** + * 预留1 + */ + @ColumnWidth(20) + @ExcelProperty("预留1") + private String reserve1; + /** + * 预留2 + */ + @ColumnWidth(20) + @ExcelProperty("预留2") + private String reserve2; + /** + * 预留3 + */ + @ColumnWidth(20) + @ExcelProperty("预留3") + private String reserve3; + /** + * 预留4 + */ + @ColumnWidth(20) + @ExcelProperty("预留4") + private String reserve4; + /** + * 预留5 + */ + @ColumnWidth(20) + @ExcelProperty("预留5") + private String reserve5; + +} diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionLoadscanClient.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionLoadscanClient.java new file mode 100644 index 000000000..556ed0962 --- /dev/null +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionLoadscanClient.java @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package com.logpm.distribution.feign; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import lombok.AllArgsConstructor; +import org.springblade.core.mp.support.BladePage; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import com.logpm.distribution.entity.DistributionLoadscanEntity; +import com.logpm.distribution.service.IDistributionLoadscanService; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; +import springfox.documentation.annotations.ApiIgnore; + +/** + * 装车扫描表 Feign实现类 + * + * @author lmy + * @since 2023-06-27 + */ +@ApiIgnore() +@RestController +@AllArgsConstructor +public class DistributionLoadscanClient implements IDistributionLoadscanClient { + + private final IDistributionLoadscanService distributionLoadscanService; + + @Override + @GetMapping(TOP) + public BladePage top(Integer current, Integer size) { + Query query = new Query(); + query.setCurrent(current); + query.setSize(size); + IPage page = distributionLoadscanService.page(Condition.getPage(query)); + return BladePage.of(page); + } + +} diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionParcelListClient.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionParcelListClient.java index 25ea5fc26..a9a07bfa7 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionParcelListClient.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionParcelListClient.java @@ -18,13 +18,14 @@ package com.logpm.distribution.feign; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.logpm.distribution.entity.DistributionParcelListEntity; +import com.logpm.distribution.service.IDistributionParcelListService; import lombok.AllArgsConstructor; import org.springblade.core.mp.support.BladePage; import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Query; -import com.logpm.distribution.entity.DistributionParcelListEntity; -import com.logpm.distribution.service.IDistributionParcelListService; import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RestController; import springfox.documentation.annotations.ApiIgnore; @@ -62,6 +63,7 @@ public class DistributionParcelListClient implements IDistributionParcelListClie } @Override + @PostMapping(API_PREFIX+"/addBatch") public boolean addBatch(List parcelListEntityList) { return distributionParcelListService.saveBatch(parcelListEntityList); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.xml index 7502e561b..6fa4ea869 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.xml @@ -32,7 +32,7 @@ SELECT * FROM logpm_distribution_delivery_info ${ew.customSqlSegment} - select * from logpm_distribution_delivery_list where is_deleted = 0 + @@ -53,8 +108,8 @@ SELECT COALESCE(COUNT(1), 0) FROM logpm_distribution_delivery_list type = '2' - - and warehouse like concat('%',#{param.warehouse},'%') + + and warehouse_name like concat('%',#{param.warehouseName},'%') and kind = #{param.kind} @@ -81,13 +136,13 @@ ( COUNT( 1 ), 0 ) FROM logpm_distribution_delivery_list lddl - JOIN logpm_distribution_packadeli ldp ON lddl.id = ldp.delivery_id - JOIN logpm_distribution_parcel_list ldpl ON ldpl.id = ldp.parcel_list_id + JOIN logpm_distribution_loadscan ldl ON lddl.id = ldl.delivery_id + JOIN logpm_distribution_parcel_list ldpl ON ldpl.id = ldl.package_id WHERE lddl.type = '2' - - and lddl.warehouse like concat('%',#{param.warehouse},'%') + + and lddl.warehouse_name like concat('%',#{param.warehouseName},'%') and lddl.kind = #{param.kind} @@ -113,8 +168,8 @@ SELECT COALESCE(COUNT(1), 0) FROM logpm_distribution_delivery_list type = '1' - - and warehouse like concat('%',#{param.warehouse},'%') + + and warehouse_name like concat('%',#{param.warehouseName},'%') and kind = #{param.kind} @@ -141,13 +196,13 @@ ( COUNT( 1 ), 0 ) FROM logpm_distribution_delivery_list lddl - JOIN logpm_distribution_packadeli ldp ON lddl.id = ldp.delivery_id - JOIN logpm_distribution_parcel_list ldpl ON ldpl.id = ldp.parcel_list_id + JOIN logpm_distribution_loadscan ldl ON lddl.id = ldl.delivery_id + JOIN logpm_distribution_parcel_list ldpl ON ldpl.id = ldl.package_id WHERE lddl.type = '1' - - and lddl.warehouse like concat('%',#{param.warehouse},'%') + + and lddl.warehouse_name like concat('%',#{param.warehouseName},'%') and lddl.kind = #{param.kind} diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionLoadscanMapper.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionLoadscanMapper.java new file mode 100644 index 000000000..ea1c42712 --- /dev/null +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionLoadscanMapper.java @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package com.logpm.distribution.mapper; + +import com.logpm.distribution.entity.DistributionLoadscanEntity; +import com.logpm.distribution.vo.DistributionLoadscanVO; +import com.logpm.distribution.excel.DistributionLoadscanExcel; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.apache.ibatis.annotations.Param; +import java.util.List; + +/** + * 装车扫描表 Mapper 接口 + * + * @author lmy + * @since 2023-06-27 + */ +public interface DistributionLoadscanMapper extends BaseMapper { + + /** + * 自定义分页 + * + * @param page + * @param distributionLoadscan + * @return + */ + List selectDistributionLoadscanPage(IPage page, DistributionLoadscanVO distributionLoadscan); + + + /** + * 获取导出数据 + * + * @param queryWrapper + * @return + */ + List exportDistributionLoadscan(@Param("ew") Wrapper queryWrapper); + /** + * 装车扫描修改状态 + * + * @return + */ + Integer updateByPackageId(Long id); +} diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionLoadscanMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionLoadscanMapper.xml new file mode 100644 index 000000000..0a97972cb --- /dev/null +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionLoadscanMapper.xml @@ -0,0 +1,173 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + UPDATE logpm_distribution_loadscan + SET scan_status = 2, + loaded_nub = + CASE + WHEN ( loaded_nub + 1 ) > package_nub THEN + package_nub ELSE ( loaded_nub + 1 ) + END where package_id = #{id} + + + + + + + + + diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml index 40c283da8..bba2a7419 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml @@ -13,7 +13,7 @@ - + diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSelfDeliveryMapper.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSelfDeliveryMapper.java new file mode 100644 index 000000000..c7b6b30fe --- /dev/null +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSelfDeliveryMapper.java @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package com.logpm.distribution.mapper; + +import com.logpm.distribution.entity.DistributionSelfDeliveryEntity; +import com.logpm.distribution.vo.DistributionSelfDeliveryVO; +import com.logpm.distribution.excel.DistributionSelfDeliveryExcel; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.apache.ibatis.annotations.Param; +import java.util.List; + +/** + * 自主配送信息列表 Mapper 接口 + * + * @author TJJ + * @since 2023-06-26 + */ +public interface DistributionSelfDeliveryMapper extends BaseMapper { + + /** + * 自定义分页 + * + * @param page + * @param distributionSelfDelivery + * @return + */ + List selectDistributionSelfDeliveryPage(IPage page, DistributionSelfDeliveryVO distributionSelfDelivery); + + + /** + * 获取导出数据 + * + * @param queryWrapper + * @return + */ + List exportDistributionSelfDelivery(@Param("ew") Wrapper queryWrapper); + +} diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSelfDeliveryMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSelfDeliveryMapper.xml new file mode 100644 index 000000000..905888c4e --- /dev/null +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSelfDeliveryMapper.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSigndetailMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSigndetailMapper.xml index 5ebce6708..8bcf1f8ee 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSigndetailMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSigndetailMapper.xml @@ -26,7 +26,7 @@ - + @@ -54,7 +54,8 @@ ldsd.is_kitting isKitting, ldsd.brand brand, ldsd.signed_number signedNumber, - ldsf.consignee consignee, + ldsf.consignee_name consigneeName, + ldsf.consignee_id consigneeId, ldsf.signing_time signingTime, ldsf.sjsigning_time sjsigningTime, ldsf.delivery_phone deliveryPhone, @@ -85,8 +86,8 @@ and ldsd.goods_name like concat('%',#{param.goodsName},'%') - - and ldsd.warehouse like concat('%',#{param.warehouse},'%') + + and ldsf.warehouse_name like concat('%',#{param.warehouseName},'%') and ldsd.duration_in_stock like concat('%',#{param.durationInStock},'%') @@ -94,8 +95,8 @@ and ldsf.deliveryAddress like concat('%',#{param.deliveryAddress},'%') - - and ldsd.consignee like concat('%',#{param.consignee},'%') + + and ldsd.consignee_name like concat('%',#{param.consigneeName},'%') and ldsd.consignee_phone like concat('%',#{param.consigneePhone},'%') diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionTripartiteDeliveryMapper.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionTripartiteDeliveryMapper.java new file mode 100644 index 000000000..e4087e0bd --- /dev/null +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionTripartiteDeliveryMapper.java @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package com.logpm.distribution.mapper; + +import com.logpm.distribution.entity.DistributionTripartiteDeliveryEntity; +import com.logpm.distribution.vo.DistributionTripartiteDeliveryVO; +import com.logpm.distribution.excel.DistributionTripartiteDeliveryExcel; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.apache.ibatis.annotations.Param; +import java.util.List; + +/** + * 外协配送信息列表 Mapper 接口 + * + * @author TJJ + * @since 2023-06-26 + */ +public interface DistributionTripartiteDeliveryMapper extends BaseMapper { + + /** + * 自定义分页 + * + * @param page + * @param distributionTripartiteDelivery + * @return + */ + List selectDistributionTripartiteDeliveryPage(IPage page, DistributionTripartiteDeliveryVO distributionTripartiteDelivery); + + + /** + * 获取导出数据 + * + * @param queryWrapper + * @return + */ + List exportDistributionTripartiteDelivery(@Param("ew") Wrapper queryWrapper); + +} diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionTripartiteDeliveryMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionTripartiteDeliveryMapper.xml new file mode 100644 index 000000000..86b1f3760 --- /dev/null +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionTripartiteDeliveryMapper.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryListService.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryListService.java index f2aed76b2..4a8ce7a46 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryListService.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryListService.java @@ -18,6 +18,7 @@ package com.logpm.distribution.service; import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.logpm.distribution.dto.DistributionDeliveryListDTO; +import com.logpm.distribution.dto.DistrilbutionloadingscanDTO; import com.logpm.distribution.entity.DistributionDeliveryListEntity; import com.logpm.distribution.vo.DistributionDeliveryListVO; import com.logpm.distribution.excel.DistributionDeliveryListExcel; @@ -41,7 +42,7 @@ public interface IDistributionDeliveryListService extends BaseService selectDistributionDeliveryListPage(IPage page, DistributionDeliveryListVO distributionDeliveryList); + IPage selectDistributionDeliveryListPage(IPage page, DistributionDeliveryListDTO distributionDeliveryList); /** @@ -74,4 +75,8 @@ public interface IDistributionDeliveryListService extends BaseService { + /** + * 自定义分页 + * + * @param page + * @param distributionLoadscan + * @return + */ + IPage selectDistributionLoadscanPage(IPage page, DistributionLoadscanVO distributionLoadscan); + + + /** + * 导出数据 + * + * @param queryWrapper + * @return + */ + List exportDistributionLoadscan(Wrapper queryWrapper); + +} diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationService.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationService.java index 33eb2853e..98dc4d623 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationService.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationService.java @@ -88,4 +88,13 @@ public interface IDistributionReservationService extends BaseService getReservationAddr(String ids); + + /** + * 批量转配送任务 + * @param deliveryInfo + * @return + */ + R deliveryTask(Map deliveryInfo); + + } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionSelfDeliveryService.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionSelfDeliveryService.java new file mode 100644 index 000000000..638abe595 --- /dev/null +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionSelfDeliveryService.java @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package com.logpm.distribution.service; + +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.logpm.distribution.entity.DistributionSelfDeliveryEntity; +import com.logpm.distribution.vo.DistributionSelfDeliveryVO; +import com.logpm.distribution.excel.DistributionSelfDeliveryExcel; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springblade.core.mp.base.BaseService; +import java.util.List; + +/** + * 自主配送信息列表 服务类 + * + * @author TJJ + * @since 2023-06-26 + */ +public interface IDistributionSelfDeliveryService extends BaseService { + /** + * 自定义分页 + * + * @param page + * @param distributionSelfDelivery + * @return + */ + IPage selectDistributionSelfDeliveryPage(IPage page, DistributionSelfDeliveryVO distributionSelfDelivery); + + + /** + * 导出数据 + * + * @param queryWrapper + * @return + */ + List exportDistributionSelfDelivery(Wrapper queryWrapper); + +} diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockArticleService.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockArticleService.java index 92e3b3c54..8320dd39c 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockArticleService.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockArticleService.java @@ -63,4 +63,6 @@ public interface IDistributionStockArticleService extends BaseService addIncrement(Map addvalueInfo); Boolean saveStockRow(DistributionStockArticleDTO distributionStockArticleDTO); + + R> getStockArticleInfo(String ids); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionTripartiteDeliveryService.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionTripartiteDeliveryService.java new file mode 100644 index 000000000..0a43a80c5 --- /dev/null +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionTripartiteDeliveryService.java @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package com.logpm.distribution.service; + +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.logpm.distribution.entity.DistributionTripartiteDeliveryEntity; +import com.logpm.distribution.vo.DistributionTripartiteDeliveryVO; +import com.logpm.distribution.excel.DistributionTripartiteDeliveryExcel; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springblade.core.mp.base.BaseService; +import java.util.List; + +/** + * 外协配送信息列表 服务类 + * + * @author TJJ + * @since 2023-06-26 + */ +public interface IDistributionTripartiteDeliveryService extends BaseService { + /** + * 自定义分页 + * + * @param page + * @param distributionTripartiteDelivery + * @return + */ + IPage selectDistributionTripartiteDeliveryPage(IPage page, DistributionTripartiteDeliveryVO distributionTripartiteDelivery); + + + /** + * 导出数据 + * + * @param queryWrapper + * @return + */ + List exportDistributionTripartiteDelivery(Wrapper queryWrapper); + +} diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java index 47ee52a9d..e43408123 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java @@ -19,6 +19,7 @@ package com.logpm.distribution.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.logpm.distribution.dto.DistributionDeliveryListDTO; import com.logpm.distribution.dto.DistributionSignforDTO; +import com.logpm.distribution.dto.DistrilbutionloadingscanDTO; import com.logpm.distribution.entity.*; import com.logpm.distribution.mapper.*; import com.logpm.distribution.vo.*; @@ -53,19 +54,25 @@ import java.util.List; @AllArgsConstructor @Slf4j public class DistributionDeliveryListServiceImpl extends BaseServiceImpl implements IDistributionDeliveryListService { - private final DistributionPackadeliMapper distributionPackadeliMapper; private final DistributionDeliveryInfoMapper distributionDeliveryInfoMapper; private final DistributionReservationMapper distributionReservationMapper; - private final DistributionSignforMapper distributionSignforMapper; + private final DistributionParcelListMapper distributionParcelListMapper; + private final DistributionLoadscanMapper distributionLoadscanMapper; @Override - public IPage selectDistributionDeliveryListPage(IPage page, DistributionDeliveryListVO distributionDeliveryList) { + public IPage selectDistributionDeliveryListPage(IPage page, DistributionDeliveryListDTO distributionDeliveryList) { + //转换创建时间 + if (null != distributionDeliveryList.getCreateTime()) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + distributionDeliveryList.setCreateTime_query(sdf.format(distributionDeliveryList.getCreateTime())); + } return page.setRecords(baseMapper.selectDistributionDeliveryListPage(page, distributionDeliveryList)); } @Override public List exportDistributionDeliveryList(Wrapper queryWrapper) { + List distributionDeliveryListList = baseMapper.exportDistributionDeliveryList(queryWrapper); //distributionDeliveryListList.forEach(distributionDeliveryList -> { // distributionDeliveryList.setTypeName(DictCache.getValue(DictEnum.YES_NO, DistributionDeliveryList.getType())); @@ -121,6 +128,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl>>>>>>>>{}", distributionDeliveryList); //获取关联的客户信息 + if (distributionDeliveryList.getSource() ==1){ String reservationId = distributionDeliveryList.getReservationId(); List reservationIds = Arrays.asList(Long.valueOf(String.valueOf(reservationId.split(",")))); //查询客户信息,装车情况 @@ -144,16 +152,18 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl distributionParcelListEntities = distributionParcelListMapper.selectList(new QueryWrapper().lambda() + .eq(DistributionParcelListEntity::getPacketBarCode,distrilbutionloadingscanDTO.getBarcode())); + distributionParcelListEntities.forEach(e->{ + //修改对应的装车表 + distributionLoadscanMapper.updateByPackageId(e.getId()); + //TODO 查询本车次是否第一次扫码,没有则更新上车时间 + + // baseMapper.updateloadingTime(e.getId()); + }); + }else if (distrilbutionloadingscanDTO.getType()==2){ + + } + return 1; + } + } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionLoadscanServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionLoadscanServiceImpl.java new file mode 100644 index 000000000..f77cb219b --- /dev/null +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionLoadscanServiceImpl.java @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package com.logpm.distribution.service.impl; + +import com.logpm.distribution.entity.DistributionLoadscanEntity; +import com.logpm.distribution.vo.DistributionLoadscanVO; +import com.logpm.distribution.excel.DistributionLoadscanExcel; +import com.logpm.distribution.mapper.DistributionLoadscanMapper; +import com.logpm.distribution.service.IDistributionLoadscanService; +import org.springframework.stereotype.Service; +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springblade.core.mp.base.BaseServiceImpl; +import java.util.List; + +/** + * 装车扫描表 服务实现类 + * + * @author lmy + * @since 2023-06-27 + */ +@Service +public class DistributionLoadscanServiceImpl extends BaseServiceImpl implements IDistributionLoadscanService { + + @Override + public IPage selectDistributionLoadscanPage(IPage page, DistributionLoadscanVO distributionLoadscan) { + return page.setRecords(baseMapper.selectDistributionLoadscanPage(page, distributionLoadscan)); + } + + + @Override + public List exportDistributionLoadscan(Wrapper queryWrapper) { + List distributionLoadscanList = baseMapper.exportDistributionLoadscan(queryWrapper); + //distributionLoadscanList.forEach(distributionLoadscan -> { + // distributionLoadscan.setTypeName(DictCache.getValue(DictEnum.YES_NO, DistributionLoadscan.getType())); + //}); + return distributionLoadscanList; + } + +} diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java index 37d42f40f..7f095b8d2 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java @@ -19,18 +19,13 @@ package com.logpm.distribution.service.impl; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.extension.toolkit.SqlHelper; import com.logpm.distribution.dto.DistributionReservationDTO; -import com.logpm.distribution.entity.DistributionReservationEntity; -import com.logpm.distribution.entity.DistributionStockArticleEntity; -import com.logpm.distribution.entity.DistributionStockupEntity; -import com.logpm.distribution.entity.DistributionStockupInfoEntity; +import com.logpm.distribution.entity.*; import com.logpm.distribution.excel.DistributionReservationExcel; import com.logpm.distribution.mapper.DistributionReservationMapper; -import com.logpm.distribution.mapper.DistributionStockupInfoMapper; -import com.logpm.distribution.service.IDistributionReservationService; -import com.logpm.distribution.service.IDistributionStockArticleService; -import com.logpm.distribution.service.IDistributionStockupService; +import com.logpm.distribution.service.*; import com.logpm.distribution.vo.DistributionReservationVO; import lombok.AllArgsConstructor; +import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.tool.api.R; import org.springblade.core.tool.utils.Func; import org.springframework.beans.BeanUtils; @@ -44,10 +39,9 @@ import org.springframework.transaction.interceptor.TransactionAspectSupport; import java.math.BigDecimal; import java.text.ParseException; import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; -import java.util.Map; +import java.util.*; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicReference; /** * 预约列表 服务实现类 @@ -59,13 +53,20 @@ import java.util.Map; @AllArgsConstructor public class DistributionReservationServiceImpl extends BaseServiceImpl implements IDistributionReservationService { - private DistributionReservationMapper distributionReservationMapper; + private final DistributionReservationMapper distributionReservationMapper; - private IDistributionStockupService distributionStockupService; + private final IDistributionStockupService distributionStockupService; - private DistributionStockupInfoMapper distributionStockupInfoMapper; + private final IDistributionStockupInfoService distributionStockupInfoService; + + private final IDistributionStockArticleService distributionStockArticleService; + + private final IDistributionDeliveryListService distributionDeliveryListService; + + private final IDistributionTripartiteDeliveryService distributionTripartiteDeliveryService; + + private final IDistributionSelfDeliveryService distributionSelfDeliveryService; - private IDistributionStockArticleService distributionStockArticleService; @Override public IPage selectDistrbutionReservationPage(IPage page, DistributionReservationVO distrbutionReservation) { @@ -83,20 +84,20 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl addReservations(Map param) { + public R addReservations(Map param) { String ids = (String) param.get("ids"); //对参数进行校验 List longs = Func.toLongList(ids); - if (Func.isEmpty(longs)){ - log.error("参数异常:+{"+longs+"}"); + if (Func.isEmpty(longs)) { + log.error("参数异常:+{" + longs + "}"); R.fail("服务器异常,请重新添加!!"); } //这里就对预约信息列表进行批量的确认状态修改 boolean result = SqlHelper.retBool(distributionReservationMapper.addReservations(longs)); - if (result){ + if (result) { return R.status(result); - }else { - log.error("sql执行错误+{"+result+"}"); + } else { + log.error("sql执行错误+{" + result + "}"); return null; } @@ -112,19 +113,19 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl ids = Func.toLongList(idsStr); - if (Func.isEmpty(ids)){ - log.error("ids参数错误:+{"+ids+"}"); + if (Func.isEmpty(ids)) { + log.error("ids参数错误:+{" + ids + "}"); return false; } BigDecimal collectFee = new BigDecimal("0"); - BigDecimal replaceFee = new BigDecimal("0") ; + BigDecimal replaceFee = new BigDecimal("0"); StringBuffer buffer = new StringBuffer(); List deliveryEntities = new ArrayList<>(); for (int i = 0; i < ids.size(); i++) { @@ -137,13 +138,13 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl{ + deliveryEntities.forEach(i -> { i.setReservationId(reservationEntityId); distributionStockArticleService.getBaseMapper().updateById(i); }); - }catch (Exception e){ + } catch (Exception e) { TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); - log.error("出现异常:+{"+e.getMessage()+"}"); + log.error("出现异常:+{" + e.getMessage() + "}"); return false; } return true; @@ -170,9 +171,9 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl stockUpTask(Map stockUpInfo) { - if (Func.isEmpty(stockUpInfo)){ - log.error("参数异常:+{"+stockUpInfo+"}"); + public R stockUpTask(Map stockUpInfo) { + if (Func.isEmpty(stockUpInfo)) { + log.error("参数异常:+{" + stockUpInfo + "}"); return R.fail("服务器正忙!!!"); } boolean result = false; @@ -198,9 +199,9 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl reservationIds = Func.toLongList(ids); for (Long reservationId : reservationIds) { DistributionReservationEntity reservationEntity = distributionReservationMapper.selectById(reservationId); - if (Func.isEmpty(reservationEntity) || !reservationEntity.getReservationStatus().equals("2")){ + if (Func.isEmpty(reservationEntity) || !reservationEntity.getReservationStatus().equals("2")) { TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); - log.error("reservationEntity参数异常:+{"+reservationEntity+"}"); + log.error("reservationEntity参数异常:+{" + reservationEntity + "}"); return R.fail("预约信息状态异常!!!"); } //修改预约备货状态 @@ -211,16 +212,17 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl getReservationAddr(String ids) { - if (Func.isBlank(ids)){ + if (Func.isBlank(ids)) { return null; } String[] split = ids.split(","); List distributionReservationVOS = new ArrayList<>(); - if (split.length==1){ + if (split.length == 1) { DistributionReservationEntity reservationEntity = this.getBaseMapper().selectById(ids); distributionReservationVOS.add(reservationEntity); - }else { + } else { for (String s : split) { DistributionReservationEntity reservationEntity = this.getBaseMapper().selectById(s); distributionReservationVOS.add(reservationEntity); @@ -245,4 +247,135 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl deliveryTask(Map deliveryInfo) { + //获取前端传递的多个预约信息 + String idsStr = (String) deliveryInfo.get("reservationIds"); + String[] ids = idsStr.split(","); + if (Func.isEmpty(ids)) { + log.error("预约参数错误+{" + ids + "}"); + return R.fail("预约信息错误!!!"); + } + String text = "4564654654"; + String[] split = text.split(","); + + //判断是自主配送还是三方配送 + String tripartiteSource = (String) deliveryInfo.get("tripartiteSource"); + boolean result = false; + try { + if (Func.isBlank(tripartiteSource)) { + //自主配送 + DistributionSelfDeliveryEntity distributionSelfDeliveryEntity = new DistributionSelfDeliveryEntity(); + distributionSelfDeliveryEntity.setMasterDriverId((String) deliveryInfo.get("masterDriver")); + distributionSelfDeliveryEntity.setReservationIds(idsStr); + distributionSelfDeliveryEntity.setVehicleIds((String) deliveryInfo.get("vehicleIds")); + distributionSelfDeliveryEntity.setSlaveDriverIds((String) deliveryInfo.get("slaveDriver")); + //保存自主配送信息 + result = distributionSelfDeliveryService.save(distributionSelfDeliveryEntity); + //获取自主配送信息id + Long distributionSelfDeliveryEntityId = distributionSelfDeliveryEntity.getId(); + } else { + //三方配送 + DistributionTripartiteDeliveryEntity distributionTripartiteDeliveryEntity = new DistributionTripartiteDeliveryEntity(); + distributionTripartiteDeliveryEntity.setDriverPhone((String) deliveryInfo.get("driverPhone")); + distributionTripartiteDeliveryEntity.setDriverName((String) deliveryInfo.get("driverName")); + distributionTripartiteDeliveryEntity.setVehicleNum((String) deliveryInfo.get("vehicleNum")); + distributionTripartiteDeliveryEntity.setDeliveryFee(new BigDecimal((String) deliveryInfo.get("deliveryFee")) ); + distributionTripartiteDeliveryEntity.setReservationIds(idsStr); + result = distributionTripartiteDeliveryService.save(distributionTripartiteDeliveryEntity); + Long distributionTripartiteDeliveryEntityId = distributionTripartiteDeliveryEntity.getId(); + } + //备货信息构建 + DistributionStockupEntity stockupEntity = new DistributionStockupEntity(); + stockupEntity.setForklift(Long.parseLong((String) deliveryInfo.get("forklift"))); + stockupEntity.setStockupStatus("2"); + stockupEntity.setStockupArea((String) deliveryInfo.get("goodsAreaId")); + stockupEntity.setStockupUser(AuthUtil.getUser().getUserId().toString()); + stockupEntity.setLoader(Long.parseLong((String) deliveryInfo.get("loader")) ); + stockupEntity.setAssignStatus("2"); + stockupEntity.setAssignTime(new Date()); + String stockUpdate = (String) deliveryInfo.get("stockupDate"); + SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); + Date date = format.parse(stockUpdate); + stockupEntity.setStockupDate(date); + //完成对备货任务信息的保存 + result = distributionStockupService.save(stockupEntity); + Long stockupEntityId = stockupEntity.getId(); + StringBuffer reservationIdBuffer = new StringBuffer(); + StringBuffer stockArticleIdBuffer = new StringBuffer(); + AtomicReference warehouseName = new AtomicReference<>(); + AtomicInteger count = new AtomicInteger(); + Arrays.stream(ids).forEach(id -> { + //对预约信息进行备货状态修改 + DistributionReservationEntity reservationEntity = this.getBaseMapper().selectById(id); + String stockupStatus = reservationEntity.getStockupStatus(); + if (!stockupStatus.equals("1")){ + //预约任务处于未备货状态 + //预约信息编号拼接 + reservationIdBuffer.append(reservationEntity.getId()).append(","); + //修改备货状态为待备货 + reservationEntity.setStockupStatus("2"); + this.updateById(reservationEntity); + reservationEntity.setUpdateTime(new Date()); + reservationEntity.setUpdateUser(AuthUtil.getUserId()); + reservationEntity.setIsDeleted(1); + } + String stockArticleId = reservationEntity.getStockArticleId(); + stockArticleIdBuffer.append(stockArticleId).append(","); + //对预约信息中的订单状态进行修改并且将预约信息从预约列表中清除 + String[] stockArticleIds = stockArticleId.split(","); + for (String articleId : stockArticleIds) { + DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(articleId); + stockArticleEntity.setState(3); + distributionStockArticleService.updateById(stockArticleEntity); + warehouseName.set(stockArticleEntity.getWarehouse()); + //TODO 统计预约单下订单配送包件数量 + + } + //构建预约备货中间表信息 + DistributionStockupInfoEntity distributionStockupInfoEntity = new DistributionStockupInfoEntity(); + distributionStockupInfoEntity.setReservationId(reservationEntity.getId().toString()); + distributionStockupInfoEntity.setStockupId(stockupEntityId.toString()); + distributionStockupInfoService.save(distributionStockupInfoEntity); + count.getAndIncrement(); + }); + reservationIdBuffer.deleteCharAt(reservationIdBuffer.length() - 1); + stockupEntity.setIds(reservationIdBuffer.toString()); + result = distributionStockupService.updateById(stockupEntity); + //这里还需要将数据保存至配送列表中 + DistributionDeliveryListEntity distributionDeliveryListEntity = new DistributionDeliveryListEntity(); + distributionDeliveryListEntity.setReservationId(idsStr); + stockArticleIdBuffer.deleteCharAt(stockArticleIdBuffer.length() - 1); + distributionDeliveryListEntity.setOrderId(stockArticleIdBuffer.toString()); + distributionDeliveryListEntity.setWarehouseId(warehouseName.get()); + String masterDriverName = (String) deliveryInfo.get("masterDriverName"); + String slaveDriverNames = (String) deliveryInfo.get("slaveDriverNames"); + if (Func.isBlank(masterDriverName)){ + //这里就是外协配送的方式 + distributionDeliveryListEntity.setDriverName((String) deliveryInfo.get("driverName")); + distributionDeliveryListEntity.setKind("2"); + distributionDeliveryListEntity.setVehicleName((String) deliveryInfo.get("vehicleNum")); + + }else { + distributionDeliveryListEntity.setVehicleName((String) deliveryInfo.get("vehicleNums")); + distributionDeliveryListEntity.setVehicleId((String) deliveryInfo.get("vehicleIds")); + distributionDeliveryListEntity.setDriverName(masterDriverName+","+slaveDriverNames); + distributionDeliveryListEntity.setDriverId((String) deliveryInfo.get("driverIds")); + distributionDeliveryListEntity.setKind("1"); + } + distributionDeliveryListEntity.setCustomersNumber(Integer.parseInt(count.toString())); + distributionDeliveryListEntity.setState("1"); + distributionDeliveryListEntity.setLoadingTeamId((String) deliveryInfo.get("loader")); + distributionDeliveryListEntity.setLoadingTeamName((String) deliveryInfo.get("loaderName")); + //TODO 配送的来源,这里是通过预约单转配送 + TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); + } catch (Exception e) { + TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); + log.error("异常错误+{"+e.getMessage()+"}"); + return R.fail("操作失败!!!"); + } + return R.status(result); + } } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSelfDeliveryServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSelfDeliveryServiceImpl.java new file mode 100644 index 000000000..57d6dbede --- /dev/null +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSelfDeliveryServiceImpl.java @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package com.logpm.distribution.service.impl; + +import com.logpm.distribution.entity.DistributionSelfDeliveryEntity; +import com.logpm.distribution.vo.DistributionSelfDeliveryVO; +import com.logpm.distribution.excel.DistributionSelfDeliveryExcel; +import com.logpm.distribution.mapper.DistributionSelfDeliveryMapper; +import com.logpm.distribution.service.IDistributionSelfDeliveryService; +import org.springframework.stereotype.Service; +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springblade.core.mp.base.BaseServiceImpl; +import java.util.List; + +/** + * 自主配送信息列表 服务实现类 + * + * @author TJJ + * @since 2023-06-26 + */ +@Service +public class DistributionSelfDeliveryServiceImpl extends BaseServiceImpl implements IDistributionSelfDeliveryService { + + @Override + public IPage selectDistributionSelfDeliveryPage(IPage page, DistributionSelfDeliveryVO distributionSelfDelivery) { + return page.setRecords(baseMapper.selectDistributionSelfDeliveryPage(page, distributionSelfDelivery)); + } + + + @Override + public List exportDistributionSelfDelivery(Wrapper queryWrapper) { + List distributionSelfDeliveryList = baseMapper.exportDistributionSelfDelivery(queryWrapper); + //distributionSelfDeliveryList.forEach(distributionSelfDelivery -> { + // distributionSelfDelivery.setTypeName(DictCache.getValue(DictEnum.YES_NO, DistributionSelfDelivery.getType())); + //}); + return distributionSelfDeliveryList; + } + +} diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java index d8c09f30e..65d4582ce 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java @@ -223,4 +223,23 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl> getStockArticleInfo(String ids) { + if (Func.isBlank(ids)){ + log.error("参数异常:+["+ids+"]"); + return R.fail("操作失败!!!"); + } + List l = Func.toLongList(ids); + List distributionStockArticleEntityList = new ArrayList<>(); + //这里进行订单查询 + l.forEach(id->{ + DistributionStockArticleEntity distributionStockArticleEntity = this.baseMapper.selectById(id); + DistributionStockArticleVO distributionStockArticleVO = Func.copy(distributionStockArticleEntity, DistributionStockArticleVO.class); + distributionStockArticleEntityList.add(distributionStockArticleVO); + }); + + + return R.data(distributionStockArticleEntityList); + } + } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionTripartiteDeliveryServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionTripartiteDeliveryServiceImpl.java new file mode 100644 index 000000000..63712a93c --- /dev/null +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionTripartiteDeliveryServiceImpl.java @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package com.logpm.distribution.service.impl; + +import com.logpm.distribution.entity.DistributionTripartiteDeliveryEntity; +import com.logpm.distribution.vo.DistributionTripartiteDeliveryVO; +import com.logpm.distribution.excel.DistributionTripartiteDeliveryExcel; +import com.logpm.distribution.mapper.DistributionTripartiteDeliveryMapper; +import com.logpm.distribution.service.IDistributionTripartiteDeliveryService; +import org.springframework.stereotype.Service; +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springblade.core.mp.base.BaseServiceImpl; +import java.util.List; + +/** + * 外协配送信息列表 服务实现类 + * + * @author TJJ + * @since 2023-06-26 + */ +@Service +public class DistributionTripartiteDeliveryServiceImpl extends BaseServiceImpl implements IDistributionTripartiteDeliveryService { + + @Override + public IPage selectDistributionTripartiteDeliveryPage(IPage page, DistributionTripartiteDeliveryVO distributionTripartiteDelivery) { + return page.setRecords(baseMapper.selectDistributionTripartiteDeliveryPage(page, distributionTripartiteDelivery)); + } + + + @Override + public List exportDistributionTripartiteDelivery(Wrapper queryWrapper) { + List distributionTripartiteDeliveryList = baseMapper.exportDistributionTripartiteDelivery(queryWrapper); + //distributionTripartiteDeliveryList.forEach(distributionTripartiteDelivery -> { + // distributionTripartiteDelivery.setTypeName(DictCache.getValue(DictEnum.YES_NO, DistributionTripartiteDelivery.getType())); + //}); + return distributionTripartiteDeliveryList; + } + +} diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/controller/FactoryCommonController.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/controller/FactoryCommonController.java index 57c9ea007..517a4468c 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/controller/FactoryCommonController.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/controller/FactoryCommonController.java @@ -113,7 +113,7 @@ public class FactoryCommonController { @ResponseBody @PostMapping("/sendReceiveInfo") @ApiOperationSupport(order = 1) - @ApiOperation(value = "订单状态推送", notes = "传入orderInfoDTO") + @ApiOperation(value = "签收信息推送", notes = "传入receiveInfoDTO") public R sendReceiveInfo(@RequestBody ReceiveInfoDTO receiveInfoDTO) { log.info("############sendReceiveInfo: 请求参数{}", receiveInfoDTO); //处理数据 diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/IAsyncDataService.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/IAsyncDataService.java index 976320984..9294e59b1 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/IAsyncDataService.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/IAsyncDataService.java @@ -3,9 +3,9 @@ package com.logpm.factory.comfac.service; public interface IAsyncDataService { - void handlerPanDataToHt(); + void handlerPanDataToHt(Long orderId); - void handlerMtDataToHt(); + void handlerMtDataToHt(Long mainId); } diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/impl/AsyncDataServiceImpl.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/impl/AsyncDataServiceImpl.java index bff2b418b..3577a09b7 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/impl/AsyncDataServiceImpl.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/impl/AsyncDataServiceImpl.java @@ -57,11 +57,12 @@ public class AsyncDataServiceImpl implements IAsyncDataService { */ @Override @Async - public void handlerPanDataToHt() { + public void handlerPanDataToHt(Long id) { log.info("################handlerDataToHt: 处理皮阿诺订单数据到"); //查询需要同步的订单 QueryWrapper orderQueryWrapper = new QueryWrapper<>(); orderQueryWrapper.eq("status",1) + .eq("id",id) .eq("is_deleted",0); List panFactoryOrders = panFactoryOrderService.list(orderQueryWrapper); List serviceNumEntityList = new ArrayList<>(); @@ -69,7 +70,6 @@ public class AsyncDataServiceImpl implements IAsyncDataService { for (PanFactoryOrder panFactoryOrder:panFactoryOrders){ Long orderId = panFactoryOrder.getId(); log.info("#########handlerDataToHt: 当前处理的订单id={}",orderId); - //添加订单信息 AdvanceEntity advanceEntity = new AdvanceEntity(); advanceEntity.setOrderSelfNum(StringUtil.isBlank(panFactoryOrder.getOrderNo())?"":panFactoryOrder.getOrderNo()); //订单自编号 @@ -93,8 +93,8 @@ public class AsyncDataServiceImpl implements IAsyncDataService { advanceEntity.setCustomerPhone(StringUtil.isBlank(panFactoryOrder.getCustomerNumber())?"":panFactoryOrder.getCustomerNumber()); // 顾客电话 advanceEntity.setCustomerRoad(StringUtil.isBlank(panFactoryOrder.getCustomerAddress())?"":panFactoryOrder.getCustomerAddress());//顾客地址 advanceEntity.setSystemType("线上"); //订单类型 - advanceEntity.setStoreNo(""); //门店编码 - advanceEntity.setStoreName(""); //门店名称 + advanceEntity.setStoreNo(StringUtil.isBlank(panFactoryOrder.getUserId())?"":panFactoryOrder.getUserId()); //门店编码 + advanceEntity.setStoreName(StringUtil.isBlank(panFactoryOrder.getUserName())?"":panFactoryOrder.getUserName()); //门店名称 advanceEntity.setSerialKey(""); //序列号 advanceEntity.setServiceNum(StringUtil.isBlank(panFactoryOrder.getServiceNum())?"":panFactoryOrder.getServiceNum()); //服务号 advanceEntity.setMatingCode("");//齐套模式 可以为空 @@ -103,13 +103,13 @@ public class AsyncDataServiceImpl implements IAsyncDataService { advanceEntity.setSenderMobile(StringUtil.isBlank(panFactoryOrder.getSenderMobile())?"":panFactoryOrder.getSenderMobile());//发货人电话 可以为空 advanceEntity.setSenderAddress(StringUtil.isBlank(panFactoryOrder.getSenderAddress())?"":panFactoryOrder.getSenderAddress()); //发货地址 可以为空 advanceEntity.setSenderName(StringUtil.isBlank(panFactoryOrder.getSendFactory())?"":panFactoryOrder.getSendFactory()); //发货工厂名称 可以为空 - advanceEntity.setAdministratorsId(0);// 导入人 + advanceEntity.setAdministratorsId(1078);// 导入人 advanceEntity.setCreateTime(LocalDate.now()); //添加时间 advanceEntity.setCarsNum(StringUtil.isBlank(panFactoryOrder.getDeliveryNumber())?"":panFactoryOrder.getDeliveryNumber()); //派车单--snm 可以为空 advanceEntity.setDeleteTime(0); // 删除时间 advanceEntity.setWaybillNo("");//运单号 可以为空 - Integer id = PanFactoryEnum.getId(panFactoryOrder.getPlantId()); - advanceEntity.setWarehouseId(id); //导入人仓库id + Integer warehouseId = PanFactoryEnum.getId(panFactoryOrder.getPlantId()); + advanceEntity.setWarehouseId(warehouseId); //导入人仓库id advanceEntity.setWaybillStatus(Byte.parseByte("1"));//开单状态:1=未开单,2=已开单 advanceEntity.setOldId(0);// advanceEntity.setFreeze(Byte.parseByte("1"));//冻结状态:1=正常,2=冻结 @@ -130,6 +130,7 @@ public class AsyncDataServiceImpl implements IAsyncDataService { //通过订单id查询对应的包件 QueryWrapper packageQueryWrapper = new QueryWrapper<>(); packageQueryWrapper.eq("order_id",orderId) + .eq("status",1) .eq("is_deleted",0); List packages = panPackageInfoService.list(packageQueryWrapper); for(PanPackageInfo panPackageInfo:packages){ @@ -222,41 +223,49 @@ public class AsyncDataServiceImpl implements IAsyncDataService { } } - ServiceNumEntity serviceNum = new ServiceNumEntity(); - serviceNum.setServiceNum(StringUtil.isBlank(panFactoryOrder.getServiceNum())?"":panFactoryOrder.getServiceNum()); //服务号 - serviceNum.setTotal("1"); //订单数量 - serviceNum.setDetailTotal(Objects.isNull(panFactoryOrder.getServiceCount())?"":panFactoryOrder.getServiceCount()+""); // 包数量 - serviceNum.setStoreName(StringUtil.isBlank(panFactoryOrder.getUserName())?"":panFactoryOrder.getUserName()); //商场名 - serviceNum.setStoreNo(""); // 商场编号 - serviceNum.setCustomerName(StringUtil.isBlank(panFactoryOrder.getCustomerName())?"":panFactoryOrder.getCustomerName());//顾客姓名 - serviceNum.setCustomerPhone(StringUtil.isBlank(panFactoryOrder.getCustomerNumber())?"":panFactoryOrder.getCustomerNumber()); //顾客电话 - serviceNum.setCustomerRoad(""); //顾客地址 - serviceNum.setIsOpai(1); //是否干仓配 - serviceNum.setCompleteSet("V"); //齐套标识:Y=齐套,N=未齐套,V=未知 + String sn = StringUtil.isBlank(panFactoryOrder.getServiceNum()) ? "" : panFactoryOrder.getServiceNum(); + ServiceNumEntity serviceNum = serviceNumClient.findByserviceNum(sn); + if(Objects.isNull(serviceNum)){ + serviceNum = new ServiceNumEntity(); + serviceNum.setServiceNum(sn); //服务号 + serviceNum.setTotal("1"); //订单数量 + serviceNum.setDetailTotal(Objects.isNull(panFactoryOrder.getServiceCount())?"":panFactoryOrder.getServiceCount()+""); // 包数量 + serviceNum.setStoreName(StringUtil.isBlank(panFactoryOrder.getUserName())?"":panFactoryOrder.getUserName()); //商场名 + serviceNum.setStoreNo(StringUtil.isBlank(panFactoryOrder.getUserId())?"":panFactoryOrder.getUserId()); // 商场编号 + serviceNum.setCustomerName(StringUtil.isBlank(panFactoryOrder.getCustomerName())?"":panFactoryOrder.getCustomerName());//顾客姓名 + serviceNum.setCustomerPhone(StringUtil.isBlank(panFactoryOrder.getCustomerNumber())?"":panFactoryOrder.getCustomerNumber()); //顾客电话 + serviceNum.setCustomerRoad(StringUtil.isBlank(panFactoryOrder.getCustomerAddress())?"":panFactoryOrder.getCustomerAddress()); //顾客地址 + serviceNum.setIsOpai(1); //是否干仓配 + serviceNum.setCompleteSet("V"); //齐套标识:Y=齐套,N=未齐套,V=未知 // serviceNum.setCreateTime(LocalDate.now()); - serviceNum.setDeleteTime(0); - serviceNumEntityList.add(serviceNum); + serviceNum.setDeleteTime(0); + serviceNumEntityList.add(serviceNum); + }else{ + log.info("#############handlerDataToHt: 当前服务号已存在数据serviceNum={}",sn); + } + } + if(!serviceNumEntityList.isEmpty()){ + serviceNumClient.addServiceNum(serviceNumEntityList); } - serviceNumClient.addServiceNum(serviceNumEntityList); log.info("##############handlerDataToHt: 处理数据完成"); } @Override @Async - public void handlerMtDataToHt() { + public void handlerMtDataToHt(Long mainId) { log.info("################handlerMtDataToHt: 处理梦天订单数据到"); //查询需要同步的订单 QueryWrapper orderQueryWrapper = new QueryWrapper<>(); orderQueryWrapper.eq("status",1) + .eq("main_id",mainId) .eq("is_deleted",0); List mtFactoryOrders = mtFactoryOrderService.list(orderQueryWrapper); List serviceNumEntityList = new ArrayList<>(); log.info("#########handlerMtDataToHt: 待处理的订单数量为{}",mtFactoryOrders.size()); + MtFactoryOrderMain mtFactoryOrderMain = mtFactoryOrderMainService.getById(mainId); for (MtFactoryOrder mtFactoryOrder:mtFactoryOrders){ Long orderId = mtFactoryOrder.getId(); - Long mainId = mtFactoryOrder.getMainId(); - MtFactoryOrderMain mtFactoryOrderMain = mtFactoryOrderMainService.getById(mainId); log.info("#########handlerMtDataToHt: 当前处理的订单id={}",orderId); @@ -320,6 +329,7 @@ public class AsyncDataServiceImpl implements IAsyncDataService { //通过订单id查询对应的包件 QueryWrapper packageQueryWrapper = new QueryWrapper<>(); packageQueryWrapper.eq("order_id",orderId) + .eq("status",1) .eq("is_deleted",0); List packages = mtPackageInfoService.list(packageQueryWrapper); for(MtPackageInfo mtPackageInfo:packages){ @@ -380,20 +390,27 @@ public class AsyncDataServiceImpl implements IAsyncDataService { } } - ServiceNumEntity serviceNum = new ServiceNumEntity(); - serviceNum.setServiceNum(StringUtil.isBlank(mtFactoryOrderMain.getInvoiceOrderCode())?"":mtFactoryOrderMain.getInvoiceOrderCode()); //服务号 - serviceNum.setTotal("1"); //订单数量 - serviceNum.setDetailTotal(Objects.isNull(mtFactoryOrder.getQuantity())?"":mtFactoryOrder.getQuantity()+""); // 包数量 - serviceNum.setStoreName(StringUtil.isBlank(mtFactoryOrder.getExclusiveName())?"":mtFactoryOrder.getExclusiveName()); //商场名 - serviceNum.setStoreNo(StringUtil.isBlank(mtFactoryOrder.getExclusiveCode())?"":mtFactoryOrder.getExclusiveCode()); // 商场编号 - serviceNum.setCustomerName(StringUtil.isBlank(mtFactoryOrder.getCustomName())?"":mtFactoryOrder.getCustomName());//顾客姓名 - serviceNum.setCustomerPhone(StringUtil.isBlank(mtFactoryOrder.getCustomPhone())?"":mtFactoryOrder.getCustomPhone()); //顾客电话 - serviceNum.setCustomerRoad(StringUtil.isBlank(mtFactoryOrder.getCustomAddress())?"":mtFactoryOrder.getCustomAddress()); //顾客地址 - serviceNum.setIsOpai(1); //是否干仓配 - serviceNum.setCompleteSet("V"); //齐套标识:Y=齐套,N=未齐套,V=未知 + String sn = StringUtil.isBlank(mtFactoryOrder.getMainOrderCode()) ? "" : mtFactoryOrder.getMainOrderCode(); + ServiceNumEntity serviceNum = serviceNumClient.findByserviceNum(sn); + if(Objects.isNull(serviceNum)){ + serviceNum = new ServiceNumEntity(); + serviceNum.setServiceNum(StringUtil.isBlank(mtFactoryOrder.getMainOrderCode())?"":mtFactoryOrder.getMainOrderCode()); //服务号 + serviceNum.setTotal("1"); //订单数量 + serviceNum.setDetailTotal(Objects.isNull(mtFactoryOrder.getQuantity())?"":mtFactoryOrder.getQuantity()+""); // 包数量 + serviceNum.setStoreName(StringUtil.isBlank(mtFactoryOrder.getExclusiveName())?"":mtFactoryOrder.getExclusiveName()); //商场名 + serviceNum.setStoreNo(StringUtil.isBlank(mtFactoryOrder.getExclusiveCode())?"":mtFactoryOrder.getExclusiveCode()); // 商场编号 + serviceNum.setCustomerName(StringUtil.isBlank(mtFactoryOrder.getCustomName())?"":mtFactoryOrder.getCustomName());//顾客姓名 + serviceNum.setCustomerPhone(StringUtil.isBlank(mtFactoryOrder.getCustomPhone())?"":mtFactoryOrder.getCustomPhone()); //顾客电话 + serviceNum.setCustomerRoad(StringUtil.isBlank(mtFactoryOrder.getCustomAddress())?"":mtFactoryOrder.getCustomAddress()); //顾客地址 + serviceNum.setIsOpai(1); //是否干仓配 + serviceNum.setCompleteSet("V"); //齐套标识:Y=齐套,N=未齐套,V=未知 // serviceNum.setCreateTime(LocalDate.now()); - serviceNum.setDeleteTime(0); - serviceNumEntityList.add(serviceNum); + serviceNum.setDeleteTime(0); + serviceNumEntityList.add(serviceNum); + }else{ + log.info("#############handlerMtDataToHt: 当前服务号已存在数据serviceNum={}",sn); + } + } serviceNumClient.addServiceNum(serviceNumEntityList); log.info("##############handlerMtDataToHt: 处理数据完成"); diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/controller/MtFactoryDataController.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/controller/MtFactoryDataController.java index 61dfbe617..99a993e1b 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/controller/MtFactoryDataController.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/controller/MtFactoryDataController.java @@ -34,6 +34,7 @@ import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletRequest; +import java.util.Map; /** * 梦天数据 控制器 @@ -79,7 +80,8 @@ public class MtFactoryDataController extends BladeController { if(code == 200){ orderStatusLog.setStatus(0); //开启异步线程处理数据 - asyncDataService.handlerMtDataToHt(); + Map map = (Map) r.getData(); + asyncDataService.handlerMtDataToHt(map.get("mainId")); }else{ orderStatusLog.setStatus(2); } diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/service/impl/MtFactoryDataServiceImpl.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/service/impl/MtFactoryDataServiceImpl.java index dea456c1e..1d9246871 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/service/impl/MtFactoryDataServiceImpl.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/service/impl/MtFactoryDataServiceImpl.java @@ -55,6 +55,7 @@ public class MtFactoryDataServiceImpl implements IMtFactoryDataService { //先判断该发货单编码是否已经存在 QueryWrapper queryWrapper = new QueryWrapper<>(); queryWrapper.eq("invoice_order_code",invoiceOrderCode); + Long mainId = null; MtFactoryOrderMain mtFactoryOrderMain = mtFactoryOrderMainService.getOne(queryWrapper); if(!Objects.isNull(mtFactoryOrderMain)){ log.warn("#############dealWithData: 数据已存在 invoiceOrderCode={}",invoiceOrderCode); @@ -64,7 +65,7 @@ public class MtFactoryDataServiceImpl implements IMtFactoryDataService { BeanUtil.copyProperties(mtFactoryDataDTO,mtFactoryOrderMain); boolean saveMain = mtFactoryOrderMainService.save(mtFactoryOrderMain); if(saveMain){ - Long mainId = mtFactoryOrderMain.getId();//发货单id + mainId = mtFactoryOrderMain.getId();//发货单id List orderList = mtFactoryDataDTO.getOrderList();//所有订单数据 for(MtFactoryOrderDTO mtFactoryOrderDTO:orderList){ String orderCode = mtFactoryOrderDTO.getOrderCode(); @@ -73,8 +74,23 @@ public class MtFactoryDataServiceImpl implements IMtFactoryDataService { mtFactoryOrder.setMainId(mainId); boolean saveOrder = mtFactoryOrderService.save(mtFactoryOrder); if(saveOrder){ + //根据订单自编码去查是否有已存在的包件,有就舍去 Long orderId = mtFactoryOrder.getId(); + QueryWrapper qw = new QueryWrapper<>(); + qw.eq("order_id",orderId); + List existPackages = mtPackageInfoService.list(qw); List packageInfos = mtFactoryOrderDTO.getPackageInfos(); + for(MtPackageInfo mtPackageInfo:existPackages){ + String packageCode = mtPackageInfo.getPackageCode(); + for (MtPackageInfoDTO mtPackageInfoDTO:packageInfos){ + String pc = mtPackageInfoDTO.getPackageCode(); + if(packageCode.equals(pc)){ + packageInfos.remove(mtPackageInfoDTO); + break; + } + } + } + List list = new ArrayList<>(); for(MtPackageInfoDTO mtPackageInfoDTO:packageInfos){ MtPackageInfo mtPackageInfo = new MtPackageInfo(); @@ -99,7 +115,10 @@ public class MtFactoryDataServiceImpl implements IMtFactoryDataService { log.warn("#############dealWithData: 保存发货单失败 invoiceOrderCode={}",invoiceOrderCode); throw new CustomerException(405,"保存发货单失败"); } - return R.success("接收成功"); + Map map = new HashMap<>(); + map.put("mainId",mainId); + + return R.data(map); } @Override diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/controller/PanFactoryDataController.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/controller/PanFactoryDataController.java index 66a19ef66..d2a3e474a 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/controller/PanFactoryDataController.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/controller/PanFactoryDataController.java @@ -17,20 +17,16 @@ package com.logpm.factory.pan.controller; import com.alibaba.fastjson.JSONObject; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import com.logpm.factory.comfac.service.IAsyncDataService; import com.logpm.factory.comfac.service.IOrderStatusLogService; import com.logpm.factory.pan.dto.PanFactoryOrderDTO; -import com.logpm.factory.pan.dto.PanPackageInfoDTO; import com.logpm.factory.pan.service.IPanFactoryDataService; import com.logpm.factory.pan.service.IPanFactoryOrderService; import com.logpm.factory.pan.service.IPanPackageInfoService; import com.logpm.factory.pan.service.IPanPackageListService; import com.logpm.factory.snm.bean.Resp; import com.logpm.factory.snm.entity.OrderStatusLog; -import com.logpm.factory.snm.entity.PanFactoryOrder; -import com.logpm.factory.snm.entity.PanPackageInfo; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.AllArgsConstructor; @@ -41,7 +37,6 @@ import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletRequest; -import java.util.List; import java.util.Objects; /** @@ -115,32 +110,9 @@ public class PanFactoryDataController extends BladeController { //判断数据是否已存入 String orderNo = factoryOrderDTO.getOrderNo(); - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("order_no",orderNo); - PanFactoryOrder one = factoryOrderService.getOne(queryWrapper); - if(!Objects.isNull(one)){ -// log.warn("############data: 订单数据已存在 orderNo={}",orderNo); -// return Resp.fail(400,"订单数据已存在"); - //如果订单已存在就去验证订单下面的包件信息 - List order_attributes = factoryOrderDTO.getORDER_ATTRIBUTES(); - QueryWrapper qw = new QueryWrapper<>(); - qw.eq("order_no",orderNo); - List list = packageInfoService.list(qw); - for(PanPackageInfo panPackageInfo:list){ - String unitNo = panPackageInfo.getUnitNo(); - for(int i = 0; i 1){ distributionStockArticleEntity.setReserve1("multiple"); @@ -369,26 +374,52 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService { @Transactional @Override - public void saveData(PanFactoryOrderDTO factoryOrderDTO) { - - QueryWrapper qw = new QueryWrapper<>(); - qw.eq("order_no",factoryOrderDTO.getOrderNo()); - //先查询订单是否存在 - PanFactoryOrder factoryOrder = factoryOrderService.getOne(qw); - boolean flag = false; - if(Objects.isNull(factoryOrder)){ - factoryOrder = new PanFactoryOrder(); - BeanUtil.copyProperties(factoryOrderDTO,factoryOrder); - //保存订单数据 - factoryOrderService.save(factoryOrder); - }else{ - flag = true; + public Long saveData(PanFactoryOrderDTO factoryOrderDTO) { + +// QueryWrapper qw = new QueryWrapper<>(); +// qw.eq("order_no",factoryOrderDTO.getOrderNo()); +// //先查询订单是否存在 +// PanFactoryOrder factoryOrder = factoryOrderService.getOne(qw); +// boolean flag = false; +// if(Objects.isNull(factoryOrder)){ +// factoryOrder = new PanFactoryOrder(); +// BeanUtil.copyProperties(factoryOrderDTO,factoryOrder); +// //保存订单数据 +// factoryOrderService.save(factoryOrder); +// }else{ +// factoryOrder.setStatus(1); +// factoryOrderService.saveOrUpdate(factoryOrder); +// flag = true; +// } + + String orderNo = factoryOrderDTO.getOrderNo(); + + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("order_no",orderNo); + List one = factoryOrderService.list(queryWrapper); + if(!Objects.isNull(one)&& one.size() > 0){ + //如果订单已存在就去验证订单下面的包件信息 + List order_attributes = factoryOrderDTO.getORDER_ATTRIBUTES(); + QueryWrapper qw = new QueryWrapper<>(); + qw.eq("order_no",orderNo); + List list = packageInfoService.list(qw); + for(PanPackageInfo panPackageInfo:list){ + String unitNo = panPackageInfo.getUnitNo(); + for(int i = 0; i packageInfos = factoryOrderDTO.getORDER_ATTRIBUTES(); List panPackageInfos = new ArrayList<>(); @@ -398,11 +429,6 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService { PanPackageInfo packageInfo = new PanPackageInfo(); BeanUtil.copyProperties(dto,packageInfo); packageInfo.setOrderId(factoryOrder.getId()); - if(flag){ - packageInfo.setReissueStatus(1); - }else{ - packageInfo.setReissueStatus(0); - } panPackageInfos.add(packageInfo); //保存包件信息数据 @@ -427,6 +453,8 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService { packageListService.saveBatch(panPackagelist); + return factoryOrder.getId(); + } private void checkListunitNo(PanPackageList packages, List panPackageInfos) { diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/DealWithDataHandler.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/DealWithDataHandler.java index 69a5740d9..d5aacf3b4 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/DealWithDataHandler.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/DealWithDataHandler.java @@ -43,6 +43,7 @@ public class DealWithDataHandler { OrderStatusDTO orderStatusDTO = (OrderStatusDTO) map.get("messageData"); String status = orderStatusDTO.getStatus(); String unitNo = orderStatusDTO.getUnitNo(); + String operationTime = orderStatusDTO.getOperationTime(); if("4".equals(status)){ //继续判断是否到达目的仓 String currentWarehouseId = orderStatusDTO.getCurrentWarehouse();//当前仓Id @@ -58,7 +59,7 @@ public class DealWithDataHandler { // channel.basicAck(deliveryTag,false); }else{ //真正的处理需要的数据 - panFactoryDataService.handleDataToPlatform(unitNo); + panFactoryDataService.handleDataToPlatform(unitNo,operationTime); } } diff --git a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/ServiceNumClient.java b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/ServiceNumClient.java index a83f80e69..f14f17b33 100644 --- a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/ServiceNumClient.java +++ b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/ServiceNumClient.java @@ -46,6 +46,12 @@ public class ServiceNumClient implements IServiceNumClient { return serviceNumService.addServiceNum(serviceNumEntity); } + @Override + @GetMapping(API_PREFIX + "/findByserviceNum") + public ServiceNumEntity findByserviceNum(String sn) { + return serviceNumService.findByserviceNum(sn); + } + // @Override // @GetMapping(TOP) // public BladePage top(Integer current, Integer size) { diff --git a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/AdvanceDetailMapper.xml b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/AdvanceDetailMapper.xml index dac7e55a3..866618c9a 100644 --- a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/AdvanceDetailMapper.xml +++ b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/AdvanceDetailMapper.xml @@ -78,8 +78,8 @@