Showing
9 changed files
with
85 additions
and
30 deletions
| ... | ... | @@ -129,7 +129,7 @@ CREATE TABLE IF NOT EXISTS `customer_credit` |
| 129 | 129 | `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', |
| 130 | 130 | `update_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间', |
| 131 | 131 | `status` varchar(20) DEFAULT NULL COMMENT '审核状态', |
| 132 | - `certification_certificate` varchar(100) DEFAULT NULL COMMENT '认证证书', | |
| 132 | + `certification_certificate` varchar(500) DEFAULT NULL COMMENT '认证证书', | |
| 133 | 133 | `business_file_name` varchar(100) DEFAULT NULL COMMENT '工商信息文件名', |
| 134 | 134 | `business_file_id` varchar(100) DEFAULT NULL COMMENT '工商信息文件ID', |
| 135 | 135 | `shareholder_file_name` varchar(100) DEFAULT NULL COMMENT '股东信息文件名', |
| ... | ... | @@ -212,7 +212,7 @@ CREATE TABLE IF NOT EXISTS `customer_credit_history` |
| 212 | 212 | `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', |
| 213 | 213 | `update_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间', |
| 214 | 214 | `status` varchar(20) DEFAULT NULL COMMENT '审核状态', |
| 215 | - `certification_certificate` varchar(100) DEFAULT NULL COMMENT '认证证书', | |
| 215 | + `certification_certificate` varchar(500) DEFAULT NULL COMMENT '认证证书', | |
| 216 | 216 | PRIMARY KEY (`id`), |
| 217 | 217 | KEY `idx_serial_number` (`serial_number`), |
| 218 | 218 | KEY `idx_register_date` (`register_date`), | ... | ... |
| ... | ... | @@ -72,6 +72,12 @@ public class ShipmentsPlanBo extends BaseBo<ShipmentsPlan> { |
| 72 | 72 | private Boolean operate; |
| 73 | 73 | |
| 74 | 74 | /** |
| 75 | + * 是否系统自动生成 | |
| 76 | + */ | |
| 77 | + @ApiModelProperty("是否系统自动生成") | |
| 78 | + private Boolean autoGenerate; | |
| 79 | + | |
| 80 | + /** | |
| 75 | 81 | * 创建人ID |
| 76 | 82 | */ |
| 77 | 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 | 3 | import com.lframework.starter.web.core.controller.DefaultBaseController; |
| 4 | 4 | import com.lframework.xingyun.sc.bo.shipments.plan.ShipmentsPlanBo; |
| 5 | 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 | 8 | import com.lframework.xingyun.sc.vo.shipments.plan.QueryShipmentsPlanVo; |
| 7 | 9 | import com.lframework.xingyun.sc.service.shipments.ShipmentsPlanService; |
| 8 | 10 | import com.lframework.xingyun.sc.vo.shipments.plan.UpdateShipmentsPlanVo; |
| ... | ... | @@ -25,6 +27,7 @@ import org.springframework.validation.annotation.Validated; |
| 25 | 27 | import org.springframework.web.bind.annotation.*; |
| 26 | 28 | |
| 27 | 29 | import javax.validation.Valid; |
| 30 | +import java.time.LocalDate; | |
| 28 | 31 | import java.util.List; |
| 29 | 32 | import java.util.stream.Collectors; |
| 30 | 33 | |
| ... | ... | @@ -99,4 +102,38 @@ public class ShipmentsPlanController extends DefaultBaseController { |
| 99 | 102 | public void autoCreateShipmentPlan() { |
| 100 | 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 | } | ... | ... |
xingyun-sc/src/main/java/com/lframework/xingyun/sc/impl/shipments/ShipmentsOrderInfoServiceImpl.java
| ... | ... | @@ -350,10 +350,6 @@ public class ShipmentsOrderInfoServiceImpl extends BaseMpServiceImpl<ShipmentsOr |
| 350 | 350 | if (shipmentsTime == null) { |
| 351 | 351 | throw new DefaultClientException("发货时点不能为空!"); |
| 352 | 352 | } |
| 353 | - UpdateShipmentsPlanDetailVo detailVo = new UpdateShipmentsPlanDetailVo(); | |
| 354 | - detailVo.setId(detail.getId()); | |
| 355 | - detailVo.setCanShipments(Boolean.TRUE); | |
| 356 | - shipmentsPlanDetailService.update(detailVo); | |
| 357 | 353 | } |
| 358 | 354 | List<List<ShipmentsPlanDetail>> batchList = CommonUtil.partition(detailList, 8); |
| 359 | 355 | handleBatchData(batchList, planId); | ... | ... |
| ... | ... | @@ -181,10 +181,14 @@ public class ShipmentsPlanDetailServiceImpl extends BaseMpServiceImpl<ShipmentsP |
| 181 | 181 | public PageResult<ShipmentsPlanDetail> queryCanShipmentsData(Integer pageIndex, Integer pageSize, QueryShipmentsPlanDetailVo vo) { |
| 182 | 182 | // 获取发货计划数据 |
| 183 | 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 | 192 | List<String> existOrderSpecIds = new ArrayList<>(); |
| 189 | 193 | // 获取已经存在的明细数据 |
| 190 | 194 | LambdaQueryWrapper<ShipmentsPlanDetail> queryWrapper = Wrappers.lambdaQuery(ShipmentsPlanDetail.class); |
| ... | ... | @@ -195,10 +199,12 @@ public class ShipmentsPlanDetailServiceImpl extends BaseMpServiceImpl<ShipmentsP |
| 195 | 199 | List<String> orderSpecIds = detailList.stream().map(ShipmentsPlanDetail::getOrderSpecId).collect(Collectors.toList()); |
| 196 | 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 | 209 | vo.setOrderSpecIds(existOrderSpecIds); |
| 204 | 210 | // 业务员做权限控制 | ... | ... |
| ... | ... | @@ -89,7 +89,8 @@ public class ShipmentsPlanServiceImpl extends BaseMpServiceImpl<ShipmentsPlanMap |
| 89 | 89 | ShipmentsPlan data = new ShipmentsPlan(); |
| 90 | 90 | data.setId(IdUtil.getId()); |
| 91 | 91 | data.setWorkshopId(vo.getWorkshopId()); |
| 92 | - data.setStatus(vo.getStatus()); | |
| 92 | + data.setStatus("DRAFT"); | |
| 93 | + data.setAutoGenerate(Boolean.FALSE); | |
| 93 | 94 | data.setTomoPreShipDate(vo.getTomoPreShipDate()); |
| 94 | 95 | data.setAfTomoPreShipDate(vo.getAfTomoPreShipDate()); |
| 95 | 96 | ... | ... |
| 1 | 1 | package com.lframework.xingyun.sc.vo.shipments.plan; |
| 2 | 2 | |
| 3 | 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 | 6 | import com.lframework.starter.web.core.vo.BaseVo; |
| 7 | -import javax.validation.constraints.NotNull; | |
| 8 | 7 | import io.swagger.annotations.ApiModelProperty; |
| 9 | -import com.lframework.starter.web.core.components.validation.TypeMismatch; | |
| 10 | 8 | import org.hibernate.validator.constraints.Length; |
| 11 | 9 | import java.io.Serializable; |
| 10 | +import java.time.LocalDate; | |
| 11 | +import java.util.List; | |
| 12 | + | |
| 12 | 13 | import lombok.Data; |
| 13 | 14 | |
| 14 | 15 | @Data |
| ... | ... | @@ -25,27 +26,28 @@ public class CreateShipmentsPlanVo implements BaseVo, Serializable { |
| 25 | 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 | 32 | @TypeMismatch(message = "明日预发日期格式有误!") |
| 41 | 33 | private LocalDate tomoPreShipDate; |
| 42 | 34 | |
| 43 | 35 | /** |
| 44 | 36 | * 后日预发日期 |
| 45 | 37 | */ |
| 46 | - @ApiModelProperty(value = "后日预发日期", required = true) | |
| 47 | - @NotNull(message = "请输入后日预发日期!") | |
| 38 | + @ApiModelProperty(value = "后日预发日期") | |
| 48 | 39 | @TypeMismatch(message = "后日预发日期格式有误!") |
| 49 | 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 | 9 | <result column="status" property="status"/> |
| 10 | 10 | <result column="tomo_pre_ship_date" property="tomoPreShipDate"/> |
| 11 | 11 | <result column="af_tomo_pre_ship_date" property="afTomoPreShipDate"/> |
| 12 | + <result column="auto_generate" property="autoGenerate"/> | |
| 12 | 13 | <result column="create_by_id" property="createById"/> |
| 13 | 14 | <result column="update_by_id" property="updateById"/> |
| 14 | 15 | <result column="create_time" property="createTime"/> |
| ... | ... | @@ -23,6 +24,7 @@ |
| 23 | 24 | tb.status, |
| 24 | 25 | tb.tomo_pre_ship_date, |
| 25 | 26 | tb.af_tomo_pre_ship_date, |
| 27 | + tb.auto_generate, | |
| 26 | 28 | tb.create_by_id, |
| 27 | 29 | tb.update_by_id, |
| 28 | 30 | tb.create_time, | ... | ... |