Commit 5517e639aa0162247776dff899a07e0bb42aec01
1 parent
aec90255
楚江erp:1、新增发货计划相关接口开发;2、可发货列表数据逻辑调整;3、发货计划列表增加是否系统自动生成标识
Showing
9 changed files
with
85 additions
and
30 deletions
| @@ -129,7 +129,7 @@ CREATE TABLE IF NOT EXISTS `customer_credit` | @@ -129,7 +129,7 @@ CREATE TABLE IF NOT EXISTS `customer_credit` | ||
| 129 | `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', | 129 | `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', |
| 130 | `update_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间', | 130 | `update_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间', |
| 131 | `status` varchar(20) DEFAULT NULL COMMENT '审核状态', | 131 | `status` varchar(20) DEFAULT NULL COMMENT '审核状态', |
| 132 | - `certification_certificate` varchar(100) DEFAULT NULL COMMENT '认证证书', | 132 | + `certification_certificate` varchar(500) DEFAULT NULL COMMENT '认证证书', |
| 133 | `business_file_name` varchar(100) DEFAULT NULL COMMENT '工商信息文件名', | 133 | `business_file_name` varchar(100) DEFAULT NULL COMMENT '工商信息文件名', |
| 134 | `business_file_id` varchar(100) DEFAULT NULL COMMENT '工商信息文件ID', | 134 | `business_file_id` varchar(100) DEFAULT NULL COMMENT '工商信息文件ID', |
| 135 | `shareholder_file_name` varchar(100) DEFAULT NULL COMMENT '股东信息文件名', | 135 | `shareholder_file_name` varchar(100) DEFAULT NULL COMMENT '股东信息文件名', |
| @@ -212,7 +212,7 @@ CREATE TABLE IF NOT EXISTS `customer_credit_history` | @@ -212,7 +212,7 @@ CREATE TABLE IF NOT EXISTS `customer_credit_history` | ||
| 212 | `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', | 212 | `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', |
| 213 | `update_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间', | 213 | `update_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间', |
| 214 | `status` varchar(20) DEFAULT NULL COMMENT '审核状态', | 214 | `status` varchar(20) DEFAULT NULL COMMENT '审核状态', |
| 215 | - `certification_certificate` varchar(100) DEFAULT NULL COMMENT '认证证书', | 215 | + `certification_certificate` varchar(500) DEFAULT NULL COMMENT '认证证书', |
| 216 | PRIMARY KEY (`id`), | 216 | PRIMARY KEY (`id`), |
| 217 | KEY `idx_serial_number` (`serial_number`), | 217 | KEY `idx_serial_number` (`serial_number`), |
| 218 | KEY `idx_register_date` (`register_date`), | 218 | KEY `idx_register_date` (`register_date`), |
| @@ -72,6 +72,12 @@ public class ShipmentsPlanBo extends BaseBo<ShipmentsPlan> { | @@ -72,6 +72,12 @@ public class ShipmentsPlanBo extends BaseBo<ShipmentsPlan> { | ||
| 72 | private Boolean operate; | 72 | private Boolean operate; |
| 73 | 73 | ||
| 74 | /** | 74 | /** |
| 75 | + * 是否系统自动生成 | ||
| 76 | + */ | ||
| 77 | + @ApiModelProperty("是否系统自动生成") | ||
| 78 | + private Boolean autoGenerate; | ||
| 79 | + | ||
| 80 | + /** | ||
| 75 | * 创建人ID | 81 | * 创建人ID |
| 76 | */ | 82 | */ |
| 77 | @ApiModelProperty("创建人ID") | 83 | @ApiModelProperty("创建人ID") |
xingyun-sc/src/main/java/com/lframework/xingyun/sc/controller/shipments/ShipmentsPlanController.java
| @@ -3,6 +3,8 @@ package com.lframework.xingyun.sc.controller.shipments; | @@ -3,6 +3,8 @@ package com.lframework.xingyun.sc.controller.shipments; | ||
| 3 | import com.lframework.starter.web.core.controller.DefaultBaseController; | 3 | import com.lframework.starter.web.core.controller.DefaultBaseController; |
| 4 | import com.lframework.xingyun.sc.bo.shipments.plan.ShipmentsPlanBo; | 4 | import com.lframework.xingyun.sc.bo.shipments.plan.ShipmentsPlanBo; |
| 5 | import com.lframework.xingyun.sc.service.shipments.ShipmentsPlanDetailService; | 5 | import com.lframework.xingyun.sc.service.shipments.ShipmentsPlanDetailService; |
| 6 | +import com.lframework.xingyun.sc.vo.shipments.plan.CreateShipmentsPlanDetailVo; | ||
| 7 | +import com.lframework.xingyun.sc.vo.shipments.plan.CreateShipmentsPlanVo; | ||
| 6 | import com.lframework.xingyun.sc.vo.shipments.plan.QueryShipmentsPlanVo; | 8 | import com.lframework.xingyun.sc.vo.shipments.plan.QueryShipmentsPlanVo; |
| 7 | import com.lframework.xingyun.sc.service.shipments.ShipmentsPlanService; | 9 | import com.lframework.xingyun.sc.service.shipments.ShipmentsPlanService; |
| 8 | import com.lframework.xingyun.sc.vo.shipments.plan.UpdateShipmentsPlanVo; | 10 | import com.lframework.xingyun.sc.vo.shipments.plan.UpdateShipmentsPlanVo; |
| @@ -25,6 +27,7 @@ import org.springframework.validation.annotation.Validated; | @@ -25,6 +27,7 @@ import org.springframework.validation.annotation.Validated; | ||
| 25 | import org.springframework.web.bind.annotation.*; | 27 | import org.springframework.web.bind.annotation.*; |
| 26 | 28 | ||
| 27 | import javax.validation.Valid; | 29 | import javax.validation.Valid; |
| 30 | +import java.time.LocalDate; | ||
| 28 | import java.util.List; | 31 | import java.util.List; |
| 29 | import java.util.stream.Collectors; | 32 | import java.util.stream.Collectors; |
| 30 | 33 | ||
| @@ -99,4 +102,38 @@ public class ShipmentsPlanController extends DefaultBaseController { | @@ -99,4 +102,38 @@ public class ShipmentsPlanController extends DefaultBaseController { | ||
| 99 | public void autoCreateShipmentPlan() { | 102 | public void autoCreateShipmentPlan() { |
| 100 | shipmentsPlanDetailService.autoCreateShipmentPlan(); | 103 | shipmentsPlanDetailService.autoCreateShipmentPlan(); |
| 101 | } | 104 | } |
| 105 | + | ||
| 106 | + | ||
| 107 | + /** | ||
| 108 | + * 新增 | ||
| 109 | + */ | ||
| 110 | + @ApiOperation("新增") | ||
| 111 | + @HasPermission({"shipping-plan-manage:shipping-plan:add"}) | ||
| 112 | + @PostMapping | ||
| 113 | + public InvokeResult<Void> create(@RequestBody CreateShipmentsPlanVo vo) { | ||
| 114 | + // 日期处理 | ||
| 115 | + LocalDate now = LocalDate.now(); | ||
| 116 | + vo.setTomoPreShipDate(now.plusDays(1)); | ||
| 117 | + vo.setAfTomoPreShipDate(now.plusDays(2)); | ||
| 118 | + // 新增发货计划 | ||
| 119 | + String planId = shipmentsPlanService.create(vo); | ||
| 120 | + // 处理发货明细 | ||
| 121 | + CreateShipmentsPlanDetailVo planDetailVo = new CreateShipmentsPlanDetailVo(); | ||
| 122 | + planDetailVo.setPlanId(planId); | ||
| 123 | + List<String> tomoPreShipOrderSpecIds = vo.getTomoPreShipOrderSpecIds(); | ||
| 124 | + if (CollectionUtil.isNotEmpty(tomoPreShipOrderSpecIds)) { | ||
| 125 | + planDetailVo.setOrderSpecIds(tomoPreShipOrderSpecIds); | ||
| 126 | + planDetailVo.setShipmentDate(vo.getTomoPreShipDate()); | ||
| 127 | + | ||
| 128 | + shipmentsPlanDetailService.create(planDetailVo); | ||
| 129 | + } | ||
| 130 | + List<String> afTomoPreShipOrderSpecIds = vo.getAfTomoPreShipOrderSpecIds(); | ||
| 131 | + if (CollectionUtil.isNotEmpty(afTomoPreShipOrderSpecIds)) { | ||
| 132 | + planDetailVo.setOrderSpecIds(afTomoPreShipOrderSpecIds); | ||
| 133 | + planDetailVo.setShipmentDate(vo.getAfTomoPreShipDate()); | ||
| 134 | + | ||
| 135 | + shipmentsPlanDetailService.create(planDetailVo); | ||
| 136 | + } | ||
| 137 | + return InvokeResultBuilder.success(); | ||
| 138 | + } | ||
| 102 | } | 139 | } |
| @@ -53,6 +53,11 @@ public class ShipmentsPlan extends BaseEntity implements BaseDto { | @@ -53,6 +53,11 @@ public class ShipmentsPlan extends BaseEntity implements BaseDto { | ||
| 53 | private LocalDate afTomoPreShipDate; | 53 | private LocalDate afTomoPreShipDate; |
| 54 | 54 | ||
| 55 | /** | 55 | /** |
| 56 | + * 是否系统自动生成 | ||
| 57 | + */ | ||
| 58 | + private Boolean autoGenerate; | ||
| 59 | + | ||
| 60 | + /** | ||
| 56 | * 创建人ID | 61 | * 创建人ID |
| 57 | */ | 62 | */ |
| 58 | @TableField(fill = FieldFill.INSERT) | 63 | @TableField(fill = FieldFill.INSERT) |
xingyun-sc/src/main/java/com/lframework/xingyun/sc/impl/shipments/ShipmentsOrderInfoServiceImpl.java
| @@ -346,10 +346,6 @@ public class ShipmentsOrderInfoServiceImpl extends BaseMpServiceImpl<ShipmentsOr | @@ -346,10 +346,6 @@ public class ShipmentsOrderInfoServiceImpl extends BaseMpServiceImpl<ShipmentsOr | ||
| 346 | if (shipmentsTime == null) { | 346 | if (shipmentsTime == null) { |
| 347 | throw new DefaultClientException("发货时点不能为空!"); | 347 | throw new DefaultClientException("发货时点不能为空!"); |
| 348 | } | 348 | } |
| 349 | - UpdateShipmentsPlanDetailVo detailVo = new UpdateShipmentsPlanDetailVo(); | ||
| 350 | - detailVo.setId(detail.getId()); | ||
| 351 | - detailVo.setCanShipments(Boolean.TRUE); | ||
| 352 | - shipmentsPlanDetailService.update(detailVo); | ||
| 353 | } | 349 | } |
| 354 | List<List<ShipmentsPlanDetail>> batchList = CommonUtil.partition(detailList, 8); | 350 | List<List<ShipmentsPlanDetail>> batchList = CommonUtil.partition(detailList, 8); |
| 355 | handleBatchData(batchList, planId); | 351 | handleBatchData(batchList, planId); |
| @@ -181,10 +181,14 @@ public class ShipmentsPlanDetailServiceImpl extends BaseMpServiceImpl<ShipmentsP | @@ -181,10 +181,14 @@ public class ShipmentsPlanDetailServiceImpl extends BaseMpServiceImpl<ShipmentsP | ||
| 181 | public PageResult<ShipmentsPlanDetail> queryCanShipmentsData(Integer pageIndex, Integer pageSize, QueryShipmentsPlanDetailVo vo) { | 181 | public PageResult<ShipmentsPlanDetail> queryCanShipmentsData(Integer pageIndex, Integer pageSize, QueryShipmentsPlanDetailVo vo) { |
| 182 | // 获取发货计划数据 | 182 | // 获取发货计划数据 |
| 183 | ShipmentsPlan plan = shipmentsPlanService.findById(vo.getPlanId()); | 183 | ShipmentsPlan plan = shipmentsPlanService.findById(vo.getPlanId()); |
| 184 | - if (plan == null) { | ||
| 185 | - throw new DefaultClientException("发货计划不存在!"); | 184 | + String workshopId = vo.getWorkshopId(); |
| 185 | + if (plan != null) { | ||
| 186 | + workshopId = plan.getWorkshopId(); | ||
| 186 | } | 187 | } |
| 187 | - vo.setWorkshopId(plan.getWorkshopId()); | 188 | + if (StringUtils.isEmpty(workshopId)) { |
| 189 | + throw new DefaultClientException("厂房数据不能为空,请选择对应厂房!"); | ||
| 190 | + } | ||
| 191 | + vo.setWorkshopId(workshopId); | ||
| 188 | List<String> existOrderSpecIds = new ArrayList<>(); | 192 | List<String> existOrderSpecIds = new ArrayList<>(); |
| 189 | // 获取已经存在的明细数据 | 193 | // 获取已经存在的明细数据 |
| 190 | LambdaQueryWrapper<ShipmentsPlanDetail> queryWrapper = Wrappers.lambdaQuery(ShipmentsPlanDetail.class); | 194 | LambdaQueryWrapper<ShipmentsPlanDetail> queryWrapper = Wrappers.lambdaQuery(ShipmentsPlanDetail.class); |
| @@ -195,10 +199,12 @@ public class ShipmentsPlanDetailServiceImpl extends BaseMpServiceImpl<ShipmentsP | @@ -195,10 +199,12 @@ public class ShipmentsPlanDetailServiceImpl extends BaseMpServiceImpl<ShipmentsP | ||
| 195 | List<String> orderSpecIds = detailList.stream().map(ShipmentsPlanDetail::getOrderSpecId).collect(Collectors.toList()); | 199 | List<String> orderSpecIds = detailList.stream().map(ShipmentsPlanDetail::getOrderSpecId).collect(Collectors.toList()); |
| 196 | existOrderSpecIds.addAll(orderSpecIds); | 200 | existOrderSpecIds.addAll(orderSpecIds); |
| 197 | } | 201 | } |
| 198 | - detailList = listByPlanId(plan.getId(), true); | ||
| 199 | - if (CollectionUtils.isNotEmpty(detailList)) { | ||
| 200 | - List<String> orderSpecIds = detailList.stream().map(ShipmentsPlanDetail::getOrderSpecId).collect(Collectors.toList()); | ||
| 201 | - existOrderSpecIds.addAll(orderSpecIds); | 202 | + if (plan != null) { |
| 203 | + detailList = listByPlanId(plan.getId(), true); | ||
| 204 | + if (CollectionUtils.isNotEmpty(detailList)) { | ||
| 205 | + List<String> orderSpecIds = detailList.stream().map(ShipmentsPlanDetail::getOrderSpecId).collect(Collectors.toList()); | ||
| 206 | + existOrderSpecIds.addAll(orderSpecIds); | ||
| 207 | + } | ||
| 202 | } | 208 | } |
| 203 | vo.setOrderSpecIds(existOrderSpecIds); | 209 | vo.setOrderSpecIds(existOrderSpecIds); |
| 204 | // 业务员做权限控制 | 210 | // 业务员做权限控制 |
| @@ -89,7 +89,8 @@ public class ShipmentsPlanServiceImpl extends BaseMpServiceImpl<ShipmentsPlanMap | @@ -89,7 +89,8 @@ public class ShipmentsPlanServiceImpl extends BaseMpServiceImpl<ShipmentsPlanMap | ||
| 89 | ShipmentsPlan data = new ShipmentsPlan(); | 89 | ShipmentsPlan data = new ShipmentsPlan(); |
| 90 | data.setId(IdUtil.getId()); | 90 | data.setId(IdUtil.getId()); |
| 91 | data.setWorkshopId(vo.getWorkshopId()); | 91 | data.setWorkshopId(vo.getWorkshopId()); |
| 92 | - data.setStatus(vo.getStatus()); | 92 | + data.setStatus("DRAFT"); |
| 93 | + data.setAutoGenerate(Boolean.FALSE); | ||
| 93 | data.setTomoPreShipDate(vo.getTomoPreShipDate()); | 94 | data.setTomoPreShipDate(vo.getTomoPreShipDate()); |
| 94 | data.setAfTomoPreShipDate(vo.getAfTomoPreShipDate()); | 95 | data.setAfTomoPreShipDate(vo.getAfTomoPreShipDate()); |
| 95 | 96 |
| 1 | package com.lframework.xingyun.sc.vo.shipments.plan; | 1 | package com.lframework.xingyun.sc.vo.shipments.plan; |
| 2 | 2 | ||
| 3 | import javax.validation.constraints.NotBlank; | 3 | import javax.validation.constraints.NotBlank; |
| 4 | -import java.time.LocalDate; | ||
| 5 | -import com.lframework.starter.web.core.utils.IdUtil; | 4 | + |
| 5 | +import com.lframework.starter.web.core.components.validation.TypeMismatch; | ||
| 6 | import com.lframework.starter.web.core.vo.BaseVo; | 6 | import com.lframework.starter.web.core.vo.BaseVo; |
| 7 | -import javax.validation.constraints.NotNull; | ||
| 8 | import io.swagger.annotations.ApiModelProperty; | 7 | import io.swagger.annotations.ApiModelProperty; |
| 9 | -import com.lframework.starter.web.core.components.validation.TypeMismatch; | ||
| 10 | import org.hibernate.validator.constraints.Length; | 8 | import org.hibernate.validator.constraints.Length; |
| 11 | import java.io.Serializable; | 9 | import java.io.Serializable; |
| 10 | +import java.time.LocalDate; | ||
| 11 | +import java.util.List; | ||
| 12 | + | ||
| 12 | import lombok.Data; | 13 | import lombok.Data; |
| 13 | 14 | ||
| 14 | @Data | 15 | @Data |
| @@ -25,27 +26,28 @@ public class CreateShipmentsPlanVo implements BaseVo, Serializable { | @@ -25,27 +26,28 @@ public class CreateShipmentsPlanVo implements BaseVo, Serializable { | ||
| 25 | private String workshopId; | 26 | private String workshopId; |
| 26 | 27 | ||
| 27 | /** | 28 | /** |
| 28 | - * 状态 | ||
| 29 | - */ | ||
| 30 | - @ApiModelProperty(value = "状态", required = true) | ||
| 31 | - @NotBlank(message = "请输入状态!") | ||
| 32 | - @Length(message = "状态最多允许20个字符!") | ||
| 33 | - private String status; | ||
| 34 | - | ||
| 35 | - /** | ||
| 36 | * 明日预发日期 | 29 | * 明日预发日期 |
| 37 | */ | 30 | */ |
| 38 | - @ApiModelProperty(value = "明日预发日期", required = true) | ||
| 39 | - @NotNull(message = "请输入明日预发日期!") | 31 | + @ApiModelProperty(value = "明日预发日期") |
| 40 | @TypeMismatch(message = "明日预发日期格式有误!") | 32 | @TypeMismatch(message = "明日预发日期格式有误!") |
| 41 | private LocalDate tomoPreShipDate; | 33 | private LocalDate tomoPreShipDate; |
| 42 | 34 | ||
| 43 | /** | 35 | /** |
| 44 | * 后日预发日期 | 36 | * 后日预发日期 |
| 45 | */ | 37 | */ |
| 46 | - @ApiModelProperty(value = "后日预发日期", required = true) | ||
| 47 | - @NotNull(message = "请输入后日预发日期!") | 38 | + @ApiModelProperty(value = "后日预发日期") |
| 48 | @TypeMismatch(message = "后日预发日期格式有误!") | 39 | @TypeMismatch(message = "后日预发日期格式有误!") |
| 49 | private LocalDate afTomoPreShipDate; | 40 | private LocalDate afTomoPreShipDate; |
| 50 | 41 | ||
| 42 | + /** | ||
| 43 | + * 明日预发规格集合 | ||
| 44 | + */ | ||
| 45 | + @ApiModelProperty(value = "明日预发规格集合") | ||
| 46 | + private List<String> tomoPreShipOrderSpecIds; | ||
| 47 | + | ||
| 48 | + /** | ||
| 49 | + * 后日预发规格集合 | ||
| 50 | + */ | ||
| 51 | + @ApiModelProperty(value = "后日预发规格集合") | ||
| 52 | + private List<String> afTomoPreShipOrderSpecIds; | ||
| 51 | } | 53 | } |
| @@ -9,6 +9,7 @@ | @@ -9,6 +9,7 @@ | ||
| 9 | <result column="status" property="status"/> | 9 | <result column="status" property="status"/> |
| 10 | <result column="tomo_pre_ship_date" property="tomoPreShipDate"/> | 10 | <result column="tomo_pre_ship_date" property="tomoPreShipDate"/> |
| 11 | <result column="af_tomo_pre_ship_date" property="afTomoPreShipDate"/> | 11 | <result column="af_tomo_pre_ship_date" property="afTomoPreShipDate"/> |
| 12 | + <result column="auto_generate" property="autoGenerate"/> | ||
| 12 | <result column="create_by_id" property="createById"/> | 13 | <result column="create_by_id" property="createById"/> |
| 13 | <result column="update_by_id" property="updateById"/> | 14 | <result column="update_by_id" property="updateById"/> |
| 14 | <result column="create_time" property="createTime"/> | 15 | <result column="create_time" property="createTime"/> |
| @@ -23,6 +24,7 @@ | @@ -23,6 +24,7 @@ | ||
| 23 | tb.status, | 24 | tb.status, |
| 24 | tb.tomo_pre_ship_date, | 25 | tb.tomo_pre_ship_date, |
| 25 | tb.af_tomo_pre_ship_date, | 26 | tb.af_tomo_pre_ship_date, |
| 27 | + tb.auto_generate, | ||
| 26 | tb.create_by_id, | 28 | tb.create_by_id, |
| 27 | tb.update_by_id, | 29 | tb.update_by_id, |
| 28 | tb.create_time, | 30 | tb.create_time, |