Commit ba55cf9e3034ff526e782ff98478bec8affa894d

Authored by 房远帅
1 parent 4163aded

楚江ERP:延期发货基础方法完善

Showing 25 changed files with 300 additions and 89 deletions
@@ -2,6 +2,7 @@ package com.lframework.xingyun.sc.bo.shipments.delay; @@ -2,6 +2,7 @@ package com.lframework.xingyun.sc.bo.shipments.delay;
2 2
3 import com.fasterxml.jackson.annotation.JsonFormat; 3 import com.fasterxml.jackson.annotation.JsonFormat;
4 import com.lframework.starter.common.constants.StringPool; 4 import com.lframework.starter.common.constants.StringPool;
  5 +import java.math.BigDecimal;
5 import java.time.LocalDate; 6 import java.time.LocalDate;
6 import java.util.List; 7 import java.util.List;
7 import com.lframework.starter.web.core.bo.BaseBo; 8 import com.lframework.starter.web.core.bo.BaseBo;
@@ -46,6 +47,12 @@ public class GetDelayedShipmentBo extends BaseBo<DelayedShipment> { @@ -46,6 +47,12 @@ public class GetDelayedShipmentBo extends BaseBo<DelayedShipment> {
46 private LocalDate applyDate; 47 private LocalDate applyDate;
47 48
48 /** 49 /**
  50 + * 总数量
  51 + */
  52 + @ApiModelProperty("总数量")
  53 + private BigDecimal totalQuantity;
  54 +
  55 + /**
49 * 审核状态 56 * 审核状态
50 */ 57 */
51 @ApiModelProperty("审核状态") 58 @ApiModelProperty("审核状态")
@@ -38,18 +38,48 @@ public class ShipmentsPlanDetailBo extends BaseBo<ShipmentsPlanDetail> { @@ -38,18 +38,48 @@ public class ShipmentsPlanDetailBo extends BaseBo<ShipmentsPlanDetail> {
38 private String planId; 38 private String planId;
39 39
40 /** 40 /**
  41 + * 发货单ID
  42 + */
  43 + @ApiModelProperty("发货单ID")
  44 + private String shipmentOrderId;
  45 +
  46 + /**
41 * 订货单ID 47 * 订货单ID
42 */ 48 */
43 @ApiModelProperty("订货单ID") 49 @ApiModelProperty("订货单ID")
44 private String orderId; 50 private String orderId;
45 51
46 /** 52 /**
  53 + * 订货单规格ID
  54 + */
  55 + @ApiModelProperty("订货单规格ID")
  56 + private String orderSpecId;
  57 +
  58 + /**
47 * 订单编号 59 * 订单编号
48 */ 60 */
49 @ApiModelProperty("订单编号") 61 @ApiModelProperty("订单编号")
50 private String orderNo; 62 private String orderNo;
51 63
52 /** 64 /**
  65 + * 订单类型
  66 + */
  67 + @ApiModelProperty("订单类型")
  68 + private String orderType;
  69 +
  70 + /**
  71 + * 所属分厂
  72 + */
  73 + @ApiModelProperty("所属分厂")
  74 + private String workshopName;
  75 +
  76 + /**
  77 + * 申请次数
  78 + */
  79 + @ApiModelProperty("申请次数")
  80 + private Integer applyCount;
  81 +
  82 + /**
53 * 客户ID 83 * 客户ID
54 */ 84 */
55 @ApiModelProperty("客户ID") 85 @ApiModelProperty("客户ID")
@@ -13,6 +13,7 @@ import com.lframework.starter.web.core.utils.JsonUtil; @@ -13,6 +13,7 @@ import com.lframework.starter.web.core.utils.JsonUtil;
13 import com.lframework.starter.web.inner.bo.system.user.QuerySysUserBo; 13 import com.lframework.starter.web.inner.bo.system.user.QuerySysUserBo;
14 import com.lframework.starter.web.inner.entity.SysUser; 14 import com.lframework.starter.web.inner.entity.SysUser;
15 import com.lframework.starter.web.inner.service.system.SysUserService; 15 import com.lframework.starter.web.inner.service.system.SysUserService;
  16 +import com.lframework.xingyun.basedata.entity.Customer;
16 import com.lframework.xingyun.basedata.service.customer.CustomerService; 17 import com.lframework.xingyun.basedata.service.customer.CustomerService;
17 import com.lframework.xingyun.sc.bo.customer.credit.GetCustomerCreditBo; 18 import com.lframework.xingyun.sc.bo.customer.credit.GetCustomerCreditBo;
18 import com.lframework.xingyun.sc.entity.CorePersonnel; 19 import com.lframework.xingyun.sc.entity.CorePersonnel;
@@ -498,6 +499,13 @@ public class CustomerCreditController extends DefaultBaseController { @@ -498,6 +499,13 @@ public class CustomerCreditController extends DefaultBaseController {
498 credit.setSupervisorReviewName(sysUser.getName()); 499 credit.setSupervisorReviewName(sysUser.getName());
499 } 500 }
500 } 501 }
  502 + //公司名称
  503 + if (StringUtil.isNotEmpty(credit.getCompanyId())) {
  504 + Customer customer = customerService.findById(credit.getCompanyId());
  505 + if (customer != null) {
  506 + credit.setCompanyName(customer.getName());
  507 + }
  508 + }
501 return credit; 509 return credit;
502 } 510 }
503 } 511 }
1 package com.lframework.xingyun.sc.controller.shipments; 1 package com.lframework.xingyun.sc.controller.shipments;
2 2
3 import com.lframework.xingyun.sc.bo.shipments.plan.ShipmentsPlanDetailBo; 3 import com.lframework.xingyun.sc.bo.shipments.plan.ShipmentsPlanDetailBo;
  4 +import com.lframework.xingyun.sc.entity.DelayedShipmentDetail;
  5 +import com.lframework.xingyun.sc.service.shipments.delay.DelayedShipmentDetailService;
  6 +import com.lframework.xingyun.sc.vo.shipments.delay.QueryDelayedShipmentDetailVo;
4 import com.lframework.xingyun.sc.vo.shipments.plan.QueryShipmentsPlanDetailVo; 7 import com.lframework.xingyun.sc.vo.shipments.plan.QueryShipmentsPlanDetailVo;
5 import com.lframework.xingyun.sc.service.shipments.ShipmentsPlanDetailService; 8 import com.lframework.xingyun.sc.service.shipments.ShipmentsPlanDetailService;
6 import com.lframework.xingyun.sc.vo.shipments.plan.CreateShipmentsPlanDetailVo; 9 import com.lframework.xingyun.sc.vo.shipments.plan.CreateShipmentsPlanDetailVo;
@@ -40,6 +43,8 @@ public class ShipmentsPlanDetailController extends DefaultBaseController { @@ -40,6 +43,8 @@ public class ShipmentsPlanDetailController extends DefaultBaseController {
40 43
41 @Resource 44 @Resource
42 private ShipmentsPlanDetailService shipmentsPlanDetailService; 45 private ShipmentsPlanDetailService shipmentsPlanDetailService;
  46 + @Resource
  47 + private DelayedShipmentDetailService delayedShipmentDetailService;
43 48
44 /** 49 /**
45 * 查询列表 50 * 查询列表
@@ -70,6 +75,15 @@ public class ShipmentsPlanDetailController extends DefaultBaseController { @@ -70,6 +75,15 @@ public class ShipmentsPlanDetailController extends DefaultBaseController {
70 throw new DefaultClientException("发货计划明细不存在!"); 75 throw new DefaultClientException("发货计划明细不存在!");
71 } 76 }
72 ShipmentsPlanDetailBo result = new ShipmentsPlanDetailBo(data); 77 ShipmentsPlanDetailBo result = new ShipmentsPlanDetailBo(data);
  78 + //添加申请次数
  79 + QueryDelayedShipmentDetailVo vo = new QueryDelayedShipmentDetailVo();
  80 + vo.setOrderSpecId(data.getOrderSpecId());
  81 + List<DelayedShipmentDetail> query = delayedShipmentDetailService.query(vo);
  82 + if (CollectionUtil.isEmpty(query)) {
  83 + result.setApplyCount(1);
  84 + } else {
  85 + result.setApplyCount(query.size() + 1);
  86 + }
73 87
74 return InvokeResultBuilder.success(result); 88 return InvokeResultBuilder.success(result);
75 } 89 }
@@ -36,7 +36,7 @@ import java.util.stream.Collectors; @@ -36,7 +36,7 @@ import java.util.stream.Collectors;
36 @Api(tags = "延期发货表") 36 @Api(tags = "延期发货表")
37 @Validated 37 @Validated
38 @RestController 38 @RestController
39 -@RequestMapping("/delayedShipment/delayedshipment") 39 +@RequestMapping("/delayedShipment")
40 public class DelayedShipmentController extends DefaultBaseController { 40 public class DelayedShipmentController extends DefaultBaseController {
41 41
42 @Autowired 42 @Autowired
@@ -93,7 +93,7 @@ public class DelayedShipmentController extends DefaultBaseController { @@ -93,7 +93,7 @@ public class DelayedShipmentController extends DefaultBaseController {
93 @ApiOperation("新增") 93 @ApiOperation("新增")
94 @HasPermission({"delayedShipment:delayedshipment:add"}) 94 @HasPermission({"delayedShipment:delayedshipment:add"})
95 @PostMapping 95 @PostMapping
96 - public InvokeResult<Void> create(@Valid CreateDelayedShipmentVo vo) { 96 + public InvokeResult<Void> create(@Valid @RequestBody CreateDelayedShipmentVo vo) {
97 97
98 delayedShipmentService.create(vo); 98 delayedShipmentService.create(vo);
99 99
@@ -106,7 +106,7 @@ public class DelayedShipmentController extends DefaultBaseController { @@ -106,7 +106,7 @@ public class DelayedShipmentController extends DefaultBaseController {
106 @ApiOperation("修改") 106 @ApiOperation("修改")
107 @HasPermission({"delayedShipment:delayedshipment:modify"}) 107 @HasPermission({"delayedShipment:delayedshipment:modify"})
108 @PutMapping 108 @PutMapping
109 - public InvokeResult<Void> update(@Valid UpdateDelayedShipmentVo vo) { 109 + public InvokeResult<Void> update(@Valid @RequestBody UpdateDelayedShipmentVo vo) {
110 110
111 delayedShipmentService.update(vo); 111 delayedShipmentService.update(vo);
112 112
@@ -34,7 +34,7 @@ import java.util.stream.Collectors; @@ -34,7 +34,7 @@ import java.util.stream.Collectors;
34 @Api(tags = "延期发货详情表") 34 @Api(tags = "延期发货详情表")
35 @Validated 35 @Validated
36 @RestController 36 @RestController
37 -@RequestMapping("/delayedShipmentDetail/delayedshipmentdetail") 37 +@RequestMapping("/delayedShipmentDetail")
38 public class DelayedShipmentDetailController extends DefaultBaseController { 38 public class DelayedShipmentDetailController extends DefaultBaseController {
39 39
40 @Autowired 40 @Autowired
@@ -2,6 +2,8 @@ package com.lframework.xingyun.sc.entity; @@ -2,6 +2,8 @@ package com.lframework.xingyun.sc.entity;
2 2
3 import com.baomidou.mybatisplus.annotation.TableName; 3 import com.baomidou.mybatisplus.annotation.TableName;
4 import com.lframework.starter.web.core.dto.BaseDto; 4 import com.lframework.starter.web.core.dto.BaseDto;
  5 +
  6 +import java.math.BigDecimal;
5 import java.time.LocalDate; 7 import java.time.LocalDate;
6 import java.time.LocalDateTime; 8 import java.time.LocalDateTime;
7 import java.util.List; 9 import java.util.List;
@@ -9,6 +11,7 @@ import java.util.List; @@ -9,6 +11,7 @@ import java.util.List;
9 import com.baomidou.mybatisplus.annotation.FieldFill; 11 import com.baomidou.mybatisplus.annotation.FieldFill;
10 import com.lframework.starter.web.core.entity.BaseEntity; 12 import com.lframework.starter.web.core.entity.BaseEntity;
11 import com.baomidou.mybatisplus.annotation.TableField; 13 import com.baomidou.mybatisplus.annotation.TableField;
  14 +import io.swagger.annotations.ApiModelProperty;
12 import lombok.Data; 15 import lombok.Data;
13 16
14 /** 17 /**
@@ -52,6 +55,11 @@ public class DelayedShipment extends BaseEntity implements BaseDto { @@ -52,6 +55,11 @@ public class DelayedShipment extends BaseEntity implements BaseDto {
52 private String status; 55 private String status;
53 56
54 /** 57 /**
  58 + * 总数量
  59 + */
  60 + private BigDecimal totalQuantity;
  61 +
  62 + /**
55 * 延期发货详情 63 * 延期发货详情
56 */ 64 */
57 @TableField(exist = false) 65 @TableField(exist = false)
@@ -58,6 +58,18 @@ public class ShipmentsPlanDetail extends BaseEntity implements BaseDto { @@ -58,6 +58,18 @@ public class ShipmentsPlanDetail extends BaseEntity implements BaseDto {
58 private String orderNo; 58 private String orderNo;
59 59
60 /** 60 /**
  61 + * 订单类型
  62 + */
  63 + @TableField(exist = false)
  64 + private String orderType;
  65 +
  66 + /**
  67 + * 所属分厂
  68 + */
  69 + @TableField(exist = false)
  70 + private String workshopName;
  71 +
  72 + /**
61 * 合同类型 73 * 合同类型
62 */ 74 */
63 @TableField(exist = false) 75 @TableField(exist = false)
@@ -1376,6 +1376,18 @@ public class CustomerCreditServiceImpl extends BaseMpServiceImpl<CustomerCreditM @@ -1376,6 +1376,18 @@ public class CustomerCreditServiceImpl extends BaseMpServiceImpl<CustomerCreditM
1376 data.setEnterpriseType(enterpriseType); 1376 data.setEnterpriseType(enterpriseType);
1377 } 1377 }
1378 1378
  1379 + // enterpriseOperationType 转中文
  1380 + String opType = credit.getEnterpriseOperationType();
  1381 + if ("NEW_CUSTOMER".equals(opType)) {
  1382 + data.setEnterpriseOperationType("新开发客户");
  1383 + } else if ("RECONNECT_CUSTOMER".equals(opType)) {
  1384 + data.setEnterpriseOperationType("再接轨客户");
  1385 + } else if ("OLD_CUSTOMER".equals(opType)) {
  1386 + data.setEnterpriseOperationType("老客户");
  1387 + } else {
  1388 + data.setEnterpriseOperationType("");
  1389 + }
  1390 +
1379 // 核心人员列表 - 确保放入数据模型供模板遍历 1391 // 核心人员列表 - 确保放入数据模型供模板遍历
1380 List<GetCorePersonnelBo> corePersonnelBoList = new ArrayList<>(); 1392 List<GetCorePersonnelBo> corePersonnelBoList = new ArrayList<>();
1381 if (CollectionUtils.isNotEmpty(corePersonnelList)) { 1393 if (CollectionUtils.isNotEmpty(corePersonnelList)) {
@@ -80,7 +80,7 @@ public class ShipmentsPlanDetailServiceImpl extends BaseMpServiceImpl<ShipmentsP @@ -80,7 +80,7 @@ public class ShipmentsPlanDetailServiceImpl extends BaseMpServiceImpl<ShipmentsP
80 @Override 80 @Override
81 public ShipmentsPlanDetail findById(String id) { 81 public ShipmentsPlanDetail findById(String id) {
82 82
83 - return getBaseMapper().selectById(id); 83 + return getBaseMapper().findById(id);
84 } 84 }
85 85
86 @OpLog(type = OtherOpLogType.class, name = "新增发货计划明细,ID:{}", params = {"#id"}) 86 @OpLog(type = OtherOpLogType.class, name = "新增发货计划明细,ID:{}", params = {"#id"})
@@ -3,6 +3,7 @@ package com.lframework.xingyun.sc.impl.shipments.delay; @@ -3,6 +3,7 @@ package com.lframework.xingyun.sc.impl.shipments.delay;
3 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; 3 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
4 import com.baomidou.mybatisplus.core.toolkit.Wrappers; 4 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
5 import com.github.pagehelper.PageInfo; 5 import com.github.pagehelper.PageInfo;
  6 +import com.lframework.starter.common.utils.StringUtil;
6 import com.lframework.starter.web.core.impl.BaseMpServiceImpl; 7 import com.lframework.starter.web.core.impl.BaseMpServiceImpl;
7 import com.lframework.starter.web.core.utils.PageResultUtil; 8 import com.lframework.starter.web.core.utils.PageResultUtil;
8 import com.lframework.starter.web.core.utils.OpLogUtil; 9 import com.lframework.starter.web.core.utils.OpLogUtil;
@@ -23,8 +24,6 @@ import com.lframework.xingyun.sc.vo.shipments.delay.QueryDelayedShipmentDetailVo @@ -23,8 +24,6 @@ import com.lframework.xingyun.sc.vo.shipments.delay.QueryDelayedShipmentDetailVo
23 import com.lframework.xingyun.sc.vo.shipments.delay.UpdateDelayedShipmentDetailVo; 24 import com.lframework.xingyun.sc.vo.shipments.delay.UpdateDelayedShipmentDetailVo;
24 import org.springframework.transaction.annotation.Transactional; 25 import org.springframework.transaction.annotation.Transactional;
25 import org.springframework.stereotype.Service; 26 import org.springframework.stereotype.Service;
26 -  
27 -import java.util.Collection;  
28 import java.util.List; 27 import java.util.List;
29 28
30 @Service 29 @Service
@@ -51,7 +50,7 @@ public class DelayedShipmentDetailServiceImpl extends BaseMpServiceImpl<DelayedS @@ -51,7 +50,7 @@ public class DelayedShipmentDetailServiceImpl extends BaseMpServiceImpl<DelayedS
51 @Override 50 @Override
52 public DelayedShipmentDetail findById(String id) { 51 public DelayedShipmentDetail findById(String id) {
53 52
54 - return getBaseMapper().selectById(id); 53 + return getBaseMapper().findById(id);
55 } 54 }
56 55
57 @OpLog(type = OtherOpLogType.class, name = "新增延期发货详情表,ID:{}", params = {"#id"}) 56 @OpLog(type = OtherOpLogType.class, name = "新增延期发货详情表,ID:{}", params = {"#id"})
@@ -61,15 +60,33 @@ public class DelayedShipmentDetailServiceImpl extends BaseMpServiceImpl<DelayedS @@ -61,15 +60,33 @@ public class DelayedShipmentDetailServiceImpl extends BaseMpServiceImpl<DelayedS
61 60
62 DelayedShipmentDetail data = new DelayedShipmentDetail(); 61 DelayedShipmentDetail data = new DelayedShipmentDetail();
63 data.setId(IdUtil.getId()); 62 data.setId(IdUtil.getId());
64 - data.setDelayedShipmentId(vo.getDelayedShipmentId());  
65 - data.setOrderId(vo.getOrderId());  
66 - data.setShipmentsPlanDetailId(vo.getShipmentsPlanDetailId());  
67 - data.setOrderSpecId(vo.getOrderSpecId());  
68 - data.setDeliveryDate(vo.getDeliveryDate());  
69 - data.setApplyShipmentDate(vo.getApplyShipmentDate());  
70 - data.setApplyCount(vo.getApplyCount());  
71 - data.setQuantity(vo.getQuantity());  
72 - data.setDelayReason(vo.getDelayReason()); 63 + if (!StringUtil.isBlank(vo.getDelayedShipmentId())) {
  64 + data.setDelayedShipmentId(vo.getDelayedShipmentId());
  65 + }
  66 + if (!StringUtil.isBlank(vo.getOrderId())) {
  67 + data.setOrderId(vo.getOrderId());
  68 + }
  69 + if (!StringUtil.isBlank(vo.getShipmentsPlanDetailId())) {
  70 + data.setShipmentsPlanDetailId(vo.getShipmentsPlanDetailId());
  71 + }
  72 + if (!StringUtil.isBlank(vo.getOrderSpecId())) {
  73 + data.setOrderSpecId(vo.getOrderSpecId());
  74 + }
  75 + if (vo.getDeliveryDate() != null) {
  76 + data.setDeliveryDate(vo.getDeliveryDate());
  77 + }
  78 + if (vo.getApplyShipmentDate() != null) {
  79 + data.setApplyShipmentDate(vo.getApplyShipmentDate());
  80 + }
  81 + if (vo.getApplyCount() != null) {
  82 + data.setApplyCount(vo.getApplyCount());
  83 + }
  84 + if (vo.getQuantity() != null) {
  85 + data.setQuantity(vo.getQuantity());
  86 + }
  87 + if (!StringUtil.isBlank(vo.getDelayReason())) {
  88 + data.setDelayReason(vo.getDelayReason());
  89 + }
73 90
74 getBaseMapper().insert(data); 91 getBaseMapper().insert(data);
75 92
@@ -90,14 +107,7 @@ public class DelayedShipmentDetailServiceImpl extends BaseMpServiceImpl<DelayedS @@ -90,14 +107,7 @@ public class DelayedShipmentDetailServiceImpl extends BaseMpServiceImpl<DelayedS
90 } 107 }
91 108
92 LambdaUpdateWrapper<DelayedShipmentDetail> updateWrapper = Wrappers.lambdaUpdate(DelayedShipmentDetail.class) 109 LambdaUpdateWrapper<DelayedShipmentDetail> updateWrapper = Wrappers.lambdaUpdate(DelayedShipmentDetail.class)
93 - .set(DelayedShipmentDetail::getDelayedShipmentId, vo.getDelayedShipmentId())  
94 - .set(DelayedShipmentDetail::getOrderId, vo.getOrderId())  
95 - .set(DelayedShipmentDetail::getShipmentsPlanDetailId, vo.getShipmentsPlanDetailId())  
96 - .set(DelayedShipmentDetail::getOrderSpecId, vo.getOrderSpecId())  
97 - .set(DelayedShipmentDetail::getDeliveryDate, vo.getDeliveryDate())  
98 .set(DelayedShipmentDetail::getApplyShipmentDate, vo.getApplyShipmentDate()) 110 .set(DelayedShipmentDetail::getApplyShipmentDate, vo.getApplyShipmentDate())
99 - .set(DelayedShipmentDetail::getApplyCount, vo.getApplyCount())  
100 - .set(DelayedShipmentDetail::getQuantity, vo.getQuantity())  
101 .set(DelayedShipmentDetail::getDelayReason, vo.getDelayReason()) 111 .set(DelayedShipmentDetail::getDelayReason, vo.getDelayReason())
102 .eq(DelayedShipmentDetail::getId, vo.getId()); 112 .eq(DelayedShipmentDetail::getId, vo.getId());
103 113
@@ -3,6 +3,8 @@ package com.lframework.xingyun.sc.impl.shipments.delay; @@ -3,6 +3,8 @@ package com.lframework.xingyun.sc.impl.shipments.delay;
3 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; 3 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
4 import com.baomidou.mybatisplus.core.toolkit.Wrappers; 4 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
5 import com.github.pagehelper.PageInfo; 5 import com.github.pagehelper.PageInfo;
  6 +import com.lframework.starter.common.utils.CollectionUtil;
  7 +import com.lframework.starter.common.utils.StringUtil;
6 import com.lframework.starter.web.core.impl.BaseMpServiceImpl; 8 import com.lframework.starter.web.core.impl.BaseMpServiceImpl;
7 import com.lframework.starter.web.core.utils.PageResultUtil;; 9 import com.lframework.starter.web.core.utils.PageResultUtil;;
8 import com.lframework.starter.web.core.components.resp.PageResult; 10 import com.lframework.starter.web.core.components.resp.PageResult;
@@ -17,17 +19,19 @@ import com.lframework.starter.common.utils.Assert; @@ -17,17 +19,19 @@ import com.lframework.starter.common.utils.Assert;
17 import com.lframework.starter.web.inner.components.oplog.OtherOpLogType; 19 import com.lframework.starter.web.inner.components.oplog.OtherOpLogType;
18 import com.lframework.xingyun.sc.entity.DelayedShipment; 20 import com.lframework.xingyun.sc.entity.DelayedShipment;
19 import com.lframework.xingyun.sc.mappers.DelayedShipmentMapper; 21 import com.lframework.xingyun.sc.mappers.DelayedShipmentMapper;
  22 +import com.lframework.xingyun.sc.service.shipments.delay.DelayedShipmentDetailService;
20 import com.lframework.xingyun.sc.service.shipments.delay.DelayedShipmentService; 23 import com.lframework.xingyun.sc.service.shipments.delay.DelayedShipmentService;
21 -import com.lframework.xingyun.sc.vo.shipments.delay.CreateDelayedShipmentVo;  
22 -import com.lframework.xingyun.sc.vo.shipments.delay.QueryDelayedShipmentVo;  
23 -import com.lframework.xingyun.sc.vo.shipments.delay.UpdateDelayedShipmentVo; 24 +import com.lframework.xingyun.sc.vo.shipments.delay.*;
24 import org.springframework.transaction.annotation.Transactional; 25 import org.springframework.transaction.annotation.Transactional;
25 import org.springframework.stereotype.Service; 26 import org.springframework.stereotype.Service;
26 - 27 +import javax.annotation.Resource;
  28 +import java.time.LocalDate;
27 import java.util.List; 29 import java.util.List;
28 30
29 @Service 31 @Service
30 public class DelayedShipmentServiceImpl extends BaseMpServiceImpl<DelayedShipmentMapper, DelayedShipment> implements DelayedShipmentService { 32 public class DelayedShipmentServiceImpl extends BaseMpServiceImpl<DelayedShipmentMapper, DelayedShipment> implements DelayedShipmentService {
  33 + @Resource
  34 + private DelayedShipmentDetailService delayedShipmentDetailService;
31 35
32 @Override 36 @Override
33 public PageResult<DelayedShipment> query(Integer pageIndex, Integer pageSize, QueryDelayedShipmentVo vo) { 37 public PageResult<DelayedShipment> query(Integer pageIndex, Integer pageSize, QueryDelayedShipmentVo vo) {
@@ -50,7 +54,7 @@ public class DelayedShipmentServiceImpl extends BaseMpServiceImpl<DelayedShipmen @@ -50,7 +54,7 @@ public class DelayedShipmentServiceImpl extends BaseMpServiceImpl<DelayedShipmen
50 @Override 54 @Override
51 public DelayedShipment findById(String id) { 55 public DelayedShipment findById(String id) {
52 56
53 - return getBaseMapper().selectById(id); 57 + return getBaseMapper().findById(id);
54 } 58 }
55 59
56 @OpLog(type = OtherOpLogType.class, name = "新增延期发货表,ID:{}", params = {"#id"}) 60 @OpLog(type = OtherOpLogType.class, name = "新增延期发货表,ID:{}", params = {"#id"})
@@ -60,12 +64,34 @@ public class DelayedShipmentServiceImpl extends BaseMpServiceImpl<DelayedShipmen @@ -60,12 +64,34 @@ public class DelayedShipmentServiceImpl extends BaseMpServiceImpl<DelayedShipmen
60 64
61 DelayedShipment data = new DelayedShipment(); 65 DelayedShipment data = new DelayedShipment();
62 data.setId(IdUtil.getId()); 66 data.setId(IdUtil.getId());
63 - data.setDeptId(vo.getDeptId());  
64 - data.setApplyDate(vo.getApplyDate());  
65 - data.setStatus(vo.getStatus()); 67 + if (!StringUtil.isBlank(vo.getDeptId())) {
  68 + data.setDeptId(vo.getDeptId());
  69 + }
  70 + if (vo.getApplyDate() != null) {
  71 + data.setApplyDate(vo.getApplyDate());
  72 + } else {
  73 + data.setApplyDate(LocalDate.now());
  74 + }
  75 + if (vo.getTotalQuantity() != null) {
  76 + data.setTotalQuantity(vo.getTotalQuantity());
  77 + }
  78 + if (!StringUtil.isBlank(vo.getStatus())) {
  79 + data.setStatus(vo.getStatus());
  80 + } else {
  81 + data.setStatus("AUDIT");
  82 + }
66 83
67 getBaseMapper().insert(data); 84 getBaseMapper().insert(data);
68 85
  86 + //新增延期发货详情列
  87 + if (CollectionUtil.isNotEmpty(vo.getDelayedShipmentDetailList())) {
  88 + List<CreateDelayedShipmentDetailVo> delayedShipmentDetailList = vo.getDelayedShipmentDetailList();
  89 + for (CreateDelayedShipmentDetailVo createDelayedShipmentDetailVo : delayedShipmentDetailList) {
  90 + createDelayedShipmentDetailVo.setDelayedShipmentId(data.getId());
  91 + delayedShipmentDetailService.create(createDelayedShipmentDetailVo);
  92 + }
  93 + }
  94 +
69 OpLogUtil.setVariable("id", data.getId()); 95 OpLogUtil.setVariable("id", data.getId());
70 OpLogUtil.setExtra(vo); 96 OpLogUtil.setExtra(vo);
71 97
@@ -85,11 +111,20 @@ public class DelayedShipmentServiceImpl extends BaseMpServiceImpl<DelayedShipmen @@ -85,11 +111,20 @@ public class DelayedShipmentServiceImpl extends BaseMpServiceImpl<DelayedShipmen
85 LambdaUpdateWrapper<DelayedShipment> updateWrapper = Wrappers.lambdaUpdate(DelayedShipment.class) 111 LambdaUpdateWrapper<DelayedShipment> updateWrapper = Wrappers.lambdaUpdate(DelayedShipment.class)
86 .set(DelayedShipment::getDeptId, vo.getDeptId()) 112 .set(DelayedShipment::getDeptId, vo.getDeptId())
87 .set(DelayedShipment::getApplyDate, vo.getApplyDate()) 113 .set(DelayedShipment::getApplyDate, vo.getApplyDate())
88 - .set(DelayedShipment::getStatus, vo.getStatus()) 114 + .set(DelayedShipment::getTotalQuantity, vo.getTotalQuantity())
  115 + .set(DelayedShipment::getStatus, "AUDIT")
89 .eq(DelayedShipment::getId, vo.getId()); 116 .eq(DelayedShipment::getId, vo.getId());
90 117
91 getBaseMapper().update(updateWrapper); 118 getBaseMapper().update(updateWrapper);
92 119
  120 + //更新延期发货详情列
  121 + if (CollectionUtil.isNotEmpty(vo.getDelayedShipmentDetailList())) {
  122 + List<UpdateDelayedShipmentDetailVo> delayedShipmentDetailList = vo.getDelayedShipmentDetailList();
  123 + for (UpdateDelayedShipmentDetailVo updateDelayedShipmentDetailVo : delayedShipmentDetailList) {
  124 + delayedShipmentDetailService.update(updateDelayedShipmentDetailVo);
  125 + }
  126 + }
  127 +
93 OpLogUtil.setVariable("id", data.getId()); 128 OpLogUtil.setVariable("id", data.getId());
94 OpLogUtil.setExtra(vo); 129 OpLogUtil.setExtra(vo);
95 } 130 }
@@ -21,4 +21,12 @@ public interface DelayedShipmentDetailMapper extends BaseMapper<DelayedShipmentD @@ -21,4 +21,12 @@ public interface DelayedShipmentDetailMapper extends BaseMapper<DelayedShipmentD
21 * @return 21 * @return
22 */ 22 */
23 List<DelayedShipmentDetail> query(@Param("vo") QueryDelayedShipmentDetailVo vo); 23 List<DelayedShipmentDetail> query(@Param("vo") QueryDelayedShipmentDetailVo vo);
  24 +
  25 + /**
  26 + * 查询
  27 + *
  28 + * @param id
  29 + * @return DelayedShipmentDetail
  30 + */
  31 + DelayedShipmentDetail findById(@Param("id") String id);
24 } 32 }
@@ -21,4 +21,12 @@ public interface DelayedShipmentMapper extends BaseMapper<DelayedShipment> { @@ -21,4 +21,12 @@ public interface DelayedShipmentMapper extends BaseMapper<DelayedShipment> {
21 * @return 21 * @return
22 */ 22 */
23 List<DelayedShipment> query(@Param("vo") QueryDelayedShipmentVo vo); 23 List<DelayedShipment> query(@Param("vo") QueryDelayedShipmentVo vo);
  24 +
  25 + /**
  26 + * 查询
  27 + *
  28 + * @param id
  29 + * @return DelayedShipment
  30 + */
  31 + DelayedShipment findById(@Param("id") String id);
24 } 32 }
@@ -55,4 +55,12 @@ public interface ShipmentsPlanDetailMapper extends BaseMapper<ShipmentsPlanDetai @@ -55,4 +55,12 @@ public interface ShipmentsPlanDetailMapper extends BaseMapper<ShipmentsPlanDetai
55 * @return List<ShipmentsPlanDetail> 55 * @return List<ShipmentsPlanDetail>
56 */ 56 */
57 List<ShipmentsPlanDetail> listByPlanId(@Param("planId") String planId); 57 List<ShipmentsPlanDetail> listByPlanId(@Param("planId") String planId);
  58 +
  59 + /**
  60 + * 查询
  61 + *
  62 + * @param id 主键
  63 + * @return ShipmentsPlanDetail
  64 + */
  65 + ShipmentsPlanDetail findById(@Param("id") String id);
58 } 66 }
@@ -2,10 +2,8 @@ package com.lframework.xingyun.sc.vo.shipments.delay; @@ -2,10 +2,8 @@ package com.lframework.xingyun.sc.vo.shipments.delay;
2 2
3 import com.lframework.starter.web.core.components.validation.IsNumberPrecision; 3 import com.lframework.starter.web.core.components.validation.IsNumberPrecision;
4 import java.math.BigDecimal; 4 import java.math.BigDecimal;
5 -import javax.validation.constraints.NotBlank;  
6 import java.time.LocalDate; 5 import java.time.LocalDate;
7 import com.lframework.starter.web.core.vo.BaseVo; 6 import com.lframework.starter.web.core.vo.BaseVo;
8 -import javax.validation.constraints.NotNull;  
9 import io.swagger.annotations.ApiModelProperty; 7 import io.swagger.annotations.ApiModelProperty;
10 import com.lframework.starter.web.core.components.validation.TypeMismatch; 8 import com.lframework.starter.web.core.components.validation.TypeMismatch;
11 import org.hibernate.validator.constraints.Length; 9 import org.hibernate.validator.constraints.Length;
@@ -20,64 +18,56 @@ public class CreateDelayedShipmentDetailVo implements BaseVo, Serializable { @@ -20,64 +18,56 @@ public class CreateDelayedShipmentDetailVo implements BaseVo, Serializable {
20 /** 18 /**
21 * 延期发货ID 19 * 延期发货ID
22 */ 20 */
23 - @ApiModelProperty(value = "延期发货ID", required = true)  
24 - @NotBlank(message = "请输入延期发货ID!") 21 + @ApiModelProperty("延期发货ID")
25 @Length(message = "延期发货ID最多允许32个字符!") 22 @Length(message = "延期发货ID最多允许32个字符!")
26 private String delayedShipmentId; 23 private String delayedShipmentId;
27 24
28 /** 25 /**
29 * 订货单ID 26 * 订货单ID
30 */ 27 */
31 - @ApiModelProperty(value = "订货单ID", required = true)  
32 - @NotBlank(message = "请输入订货单ID!") 28 + @ApiModelProperty("订货单ID")
33 @Length(message = "订货单ID最多允许32个字符!") 29 @Length(message = "订货单ID最多允许32个字符!")
34 private String orderId; 30 private String orderId;
35 31
36 /** 32 /**
37 * 发货计划明细ID 33 * 发货计划明细ID
38 */ 34 */
39 - @ApiModelProperty(value = "发货计划明细ID", required = true)  
40 - @NotBlank(message = "请输入发货计划明细ID!") 35 + @ApiModelProperty("发货计划明细ID")
41 @Length(message = "发货计划明细ID最多允许32个字符!") 36 @Length(message = "发货计划明细ID最多允许32个字符!")
42 private String shipmentsPlanDetailId; 37 private String shipmentsPlanDetailId;
43 38
44 /** 39 /**
45 * 订货单物料行ID 40 * 订货单物料行ID
46 */ 41 */
47 - @ApiModelProperty(value = "订货单物料行ID", required = true)  
48 - @NotBlank(message = "请输入订货单物料行ID!") 42 + @ApiModelProperty("订货单物料行ID")
49 @Length(message = "订货单物料行ID最多允许32个字符!") 43 @Length(message = "订货单物料行ID最多允许32个字符!")
50 private String orderSpecId; 44 private String orderSpecId;
51 45
52 /** 46 /**
53 * 原订单计划发货日期 47 * 原订单计划发货日期
54 */ 48 */
55 - @ApiModelProperty(value = "原订单计划发货日期", required = true)  
56 - @NotNull(message = "请输入原订单计划发货日期!") 49 + @ApiModelProperty("原订单计划发货日期")
57 @TypeMismatch(message = "原订单计划发货日期格式有误!") 50 @TypeMismatch(message = "原订单计划发货日期格式有误!")
58 private LocalDate deliveryDate; 51 private LocalDate deliveryDate;
59 52
60 /** 53 /**
61 * 现申请发货日期 54 * 现申请发货日期
62 */ 55 */
63 - @ApiModelProperty(value = "现申请发货日期", required = true)  
64 - @NotNull(message = "请输入现申请发货日期!") 56 + @ApiModelProperty("现申请发货日期")
65 @TypeMismatch(message = "现申请发货日期格式有误!") 57 @TypeMismatch(message = "现申请发货日期格式有误!")
66 private LocalDate applyShipmentDate; 58 private LocalDate applyShipmentDate;
67 59
68 /** 60 /**
69 * 申请次数 61 * 申请次数
70 */ 62 */
71 - @ApiModelProperty(value = "申请次数", required = true)  
72 - @NotNull(message = "请输入申请次数!") 63 + @ApiModelProperty("申请次数")
73 @TypeMismatch(message = "申请次数格式有误!") 64 @TypeMismatch(message = "申请次数格式有误!")
74 private Integer applyCount; 65 private Integer applyCount;
75 66
76 /** 67 /**
77 * 发货数量 68 * 发货数量
78 */ 69 */
79 - @ApiModelProperty(value = "发货数量", required = true)  
80 - @NotNull(message = "请输入发货数量!") 70 + @ApiModelProperty("发货数量")
81 @TypeMismatch(message = "发货数量格式有误!") 71 @TypeMismatch(message = "发货数量格式有误!")
82 @IsNumberPrecision(message = "发货数量最多允许4位小数!", value = 4) 72 @IsNumberPrecision(message = "发货数量最多允许4位小数!", value = 4)
83 private BigDecimal quantity; 73 private BigDecimal quantity;
@@ -85,8 +75,7 @@ public class CreateDelayedShipmentDetailVo implements BaseVo, Serializable { @@ -85,8 +75,7 @@ public class CreateDelayedShipmentDetailVo implements BaseVo, Serializable {
85 /** 75 /**
86 * 延迟原因 76 * 延迟原因
87 */ 77 */
88 - @ApiModelProperty(value = "延迟原因", required = true)  
89 - @NotBlank(message = "请输入延迟原因!") 78 + @ApiModelProperty("延迟原因")
90 private String delayReason; 79 private String delayReason;
91 80
92 } 81 }
1 package com.lframework.xingyun.sc.vo.shipments.delay; 1 package com.lframework.xingyun.sc.vo.shipments.delay;
2 2
3 -import javax.validation.constraints.NotBlank; 3 +import java.math.BigDecimal;
4 import java.time.LocalDate; 4 import java.time.LocalDate;
5 import com.lframework.starter.web.core.vo.BaseVo; 5 import com.lframework.starter.web.core.vo.BaseVo;
6 -import javax.validation.constraints.NotNull;  
7 import io.swagger.annotations.ApiModelProperty; 6 import io.swagger.annotations.ApiModelProperty;
8 import com.lframework.starter.web.core.components.validation.TypeMismatch; 7 import com.lframework.starter.web.core.components.validation.TypeMismatch;
9 import org.hibernate.validator.constraints.Length; 8 import org.hibernate.validator.constraints.Length;
10 import java.io.Serializable; 9 import java.io.Serializable;
  10 +import java.util.List;
11 import lombok.Data; 11 import lombok.Data;
12 12
13 @Data 13 @Data
@@ -18,25 +18,34 @@ public class CreateDelayedShipmentVo implements BaseVo, Serializable { @@ -18,25 +18,34 @@ public class CreateDelayedShipmentVo implements BaseVo, Serializable {
18 /** 18 /**
19 * 所属办ID 19 * 所属办ID
20 */ 20 */
21 - @ApiModelProperty(value = "所属办ID", required = true)  
22 - @NotBlank(message = "请输入所属办ID!") 21 + @ApiModelProperty("所属办ID")
23 @Length(message = "所属办ID最多允许32个字符!") 22 @Length(message = "所属办ID最多允许32个字符!")
24 private String deptId; 23 private String deptId;
25 24
26 /** 25 /**
27 * 申请日期 26 * 申请日期
28 */ 27 */
29 - @ApiModelProperty(value = "申请日期", required = true)  
30 - @NotNull(message = "请输入申请日期!") 28 + @ApiModelProperty("申请日期")
31 @TypeMismatch(message = "申请日期格式有误!") 29 @TypeMismatch(message = "申请日期格式有误!")
32 private LocalDate applyDate; 30 private LocalDate applyDate;
33 31
34 /** 32 /**
35 * 审核状态 33 * 审核状态
36 */ 34 */
37 - @ApiModelProperty(value = "审核状态", required = true)  
38 - @NotBlank(message = "请输入审核状态!") 35 + @ApiModelProperty("审核状态")
39 @Length(message = "审核状态最多允许20个字符!") 36 @Length(message = "审核状态最多允许20个字符!")
40 private String status; 37 private String status;
41 38
  39 + /**
  40 + * 总数量
  41 + */
  42 + @ApiModelProperty("总数量")
  43 + private BigDecimal totalQuantity;
  44 +
  45 + /**
  46 + * 延期发货详情
  47 + */
  48 + @ApiModelProperty("延期发货详情")
  49 + private List<CreateDelayedShipmentDetailVo> delayedShipmentDetailList;
  50 +
42 } 51 }
@@ -17,4 +17,11 @@ public class QueryDelayedShipmentDetailVo extends PageVo implements BaseVo, Seri @@ -17,4 +17,11 @@ public class QueryDelayedShipmentDetailVo extends PageVo implements BaseVo, Seri
17 @ApiModelProperty("延期发货ID") 17 @ApiModelProperty("延期发货ID")
18 private String delayedShipmentId; 18 private String delayedShipmentId;
19 19
  20 + /**
  21 + * 订货单物料行ID
  22 + */
  23 + @ApiModelProperty("订货单物料行ID")
  24 + private String orderSpecId;
  25 +
  26 +
20 } 27 }
@@ -6,7 +6,6 @@ import java.math.BigDecimal; @@ -6,7 +6,6 @@ import java.math.BigDecimal;
6 import javax.validation.constraints.NotBlank; 6 import javax.validation.constraints.NotBlank;
7 import java.time.LocalDate; 7 import java.time.LocalDate;
8 import com.lframework.starter.web.core.vo.BaseVo; 8 import com.lframework.starter.web.core.vo.BaseVo;
9 -import javax.validation.constraints.NotNull;  
10 import com.lframework.starter.web.core.components.validation.TypeMismatch; 9 import com.lframework.starter.web.core.components.validation.TypeMismatch;
11 import io.swagger.annotations.ApiModelProperty; 10 import io.swagger.annotations.ApiModelProperty;
12 import org.hibernate.validator.constraints.Length; 11 import org.hibernate.validator.constraints.Length;
@@ -27,73 +26,64 @@ public class UpdateDelayedShipmentDetailVo implements BaseVo, Serializable { @@ -27,73 +26,64 @@ public class UpdateDelayedShipmentDetailVo implements BaseVo, Serializable {
27 /** 26 /**
28 * 延期发货ID 27 * 延期发货ID
29 */ 28 */
30 - @ApiModelProperty(value = "延期发货ID", required = true)  
31 - @NotBlank(message = "请输入延期发货ID!") 29 + @ApiModelProperty("延期发货ID")
32 @Length(message = "延期发货ID最多允许32个字符!") 30 @Length(message = "延期发货ID最多允许32个字符!")
33 private String delayedShipmentId; 31 private String delayedShipmentId;
34 32
35 /** 33 /**
36 * 订货单ID 34 * 订货单ID
37 */ 35 */
38 - @ApiModelProperty(value = "订货单ID", required = true)  
39 - @NotBlank(message = "请输入订货单ID!") 36 + @ApiModelProperty("订货单ID")
40 @Length(message = "订货单ID最多允许32个字符!") 37 @Length(message = "订货单ID最多允许32个字符!")
41 private String orderId; 38 private String orderId;
42 39
43 /** 40 /**
44 * 发货计划明细ID 41 * 发货计划明细ID
45 */ 42 */
46 - @ApiModelProperty(value = "发货计划明细ID", required = true)  
47 - @NotBlank(message = "请输入发货计划明细ID!") 43 + @ApiModelProperty("发货计划明细ID")
48 @Length(message = "发货计划明细ID最多允许32个字符!") 44 @Length(message = "发货计划明细ID最多允许32个字符!")
49 private String shipmentsPlanDetailId; 45 private String shipmentsPlanDetailId;
50 46
51 /** 47 /**
52 * 订货单物料行ID 48 * 订货单物料行ID
53 */ 49 */
54 - @ApiModelProperty(value = "订货单物料行ID", required = true)  
55 - @NotBlank(message = "请输入订货单物料行ID!") 50 + @ApiModelProperty("订货单物料行ID")
56 @Length(message = "订货单物料行ID最多允许32个字符!") 51 @Length(message = "订货单物料行ID最多允许32个字符!")
57 private String orderSpecId; 52 private String orderSpecId;
58 53
59 /** 54 /**
60 * 原订单计划发货日期 55 * 原订单计划发货日期
61 */ 56 */
62 - @ApiModelProperty(value = "原订单计划发货日期", required = true) 57 + @ApiModelProperty("原订单计划发货日期")
63 @TypeMismatch(message = "原订单计划发货日期格式有误!") 58 @TypeMismatch(message = "原订单计划发货日期格式有误!")
64 - @NotNull(message = "请输入原订单计划发货日期!")  
65 private LocalDate deliveryDate; 59 private LocalDate deliveryDate;
66 60
67 /** 61 /**
68 * 现申请发货日期 62 * 现申请发货日期
69 */ 63 */
70 - @ApiModelProperty(value = "现申请发货日期", required = true) 64 + @ApiModelProperty("现申请发货日期")
71 @TypeMismatch(message = "现申请发货日期格式有误!") 65 @TypeMismatch(message = "现申请发货日期格式有误!")
72 - @NotNull(message = "请输入现申请发货日期!")  
73 private LocalDate applyShipmentDate; 66 private LocalDate applyShipmentDate;
74 67
75 /** 68 /**
76 * 申请次数 69 * 申请次数
77 */ 70 */
78 - @ApiModelProperty(value = "申请次数", required = true) 71 + @ApiModelProperty("申请次数")
79 @TypeMismatch(message = "申请次数格式有误!") 72 @TypeMismatch(message = "申请次数格式有误!")
80 - @NotNull(message = "请输入申请次数!")  
81 private Integer applyCount; 73 private Integer applyCount;
82 74
83 /** 75 /**
84 * 发货数量 76 * 发货数量
85 */ 77 */
86 - @ApiModelProperty(value = "发货数量", required = true) 78 + @ApiModelProperty("发货数量")
87 @TypeMismatch(message = "发货数量格式有误!") 79 @TypeMismatch(message = "发货数量格式有误!")
88 - @NotNull(message = "请输入发货数量!")  
89 @IsNumberPrecision(message = "发货数量最多允许4位小数!", value = 4) 80 @IsNumberPrecision(message = "发货数量最多允许4位小数!", value = 4)
90 private BigDecimal quantity; 81 private BigDecimal quantity;
91 82
92 /** 83 /**
93 * 延迟原因 84 * 延迟原因
94 */ 85 */
95 - @ApiModelProperty(value = "延迟原因", required = true)  
96 - @NotBlank(message = "请输入延迟原因!") 86 + @ApiModelProperty("延迟原因")
97 private String delayReason; 87 private String delayReason;
98 88
99 } 89 }
@@ -2,13 +2,14 @@ package com.lframework.xingyun.sc.vo.shipments.delay; @@ -2,13 +2,14 @@ package com.lframework.xingyun.sc.vo.shipments.delay;
2 2
3 import lombok.Data; 3 import lombok.Data;
4 import javax.validation.constraints.NotBlank; 4 import javax.validation.constraints.NotBlank;
  5 +import java.math.BigDecimal;
5 import java.time.LocalDate; 6 import java.time.LocalDate;
6 import com.lframework.starter.web.core.vo.BaseVo; 7 import com.lframework.starter.web.core.vo.BaseVo;
7 -import javax.validation.constraints.NotNull;  
8 import com.lframework.starter.web.core.components.validation.TypeMismatch; 8 import com.lframework.starter.web.core.components.validation.TypeMismatch;
9 import io.swagger.annotations.ApiModelProperty; 9 import io.swagger.annotations.ApiModelProperty;
10 import org.hibernate.validator.constraints.Length; 10 import org.hibernate.validator.constraints.Length;
11 import java.io.Serializable; 11 import java.io.Serializable;
  12 +import java.util.List;
12 13
13 @Data 14 @Data
14 public class UpdateDelayedShipmentVo implements BaseVo, Serializable { 15 public class UpdateDelayedShipmentVo implements BaseVo, Serializable {
@@ -25,25 +26,35 @@ public class UpdateDelayedShipmentVo implements BaseVo, Serializable { @@ -25,25 +26,35 @@ public class UpdateDelayedShipmentVo implements BaseVo, Serializable {
25 /** 26 /**
26 * 所属办ID 27 * 所属办ID
27 */ 28 */
28 - @ApiModelProperty(value = "所属办ID", required = true)  
29 - @NotBlank(message = "请输入所属办ID!") 29 + @ApiModelProperty("所属办ID")
30 @Length(message = "所属办ID最多允许32个字符!") 30 @Length(message = "所属办ID最多允许32个字符!")
31 private String deptId; 31 private String deptId;
32 32
33 /** 33 /**
34 * 申请日期 34 * 申请日期
35 */ 35 */
36 - @ApiModelProperty(value = "申请日期", required = true) 36 + @ApiModelProperty("申请日期")
37 @TypeMismatch(message = "申请日期格式有误!") 37 @TypeMismatch(message = "申请日期格式有误!")
38 - @NotNull(message = "请输入申请日期!")  
39 private LocalDate applyDate; 38 private LocalDate applyDate;
40 39
41 /** 40 /**
42 * 审核状态 41 * 审核状态
43 */ 42 */
44 - @ApiModelProperty(value = "审核状态", required = true)  
45 - @NotBlank(message = "请输入审核状态!") 43 + @ApiModelProperty("审核状态")
46 @Length(message = "审核状态最多允许20个字符!") 44 @Length(message = "审核状态最多允许20个字符!")
47 private String status; 45 private String status;
48 46
  47 + /**
  48 + * 总数量
  49 + */
  50 + @ApiModelProperty("总数量")
  51 + private BigDecimal totalQuantity;
  52 +
  53 + /**
  54 + * 延期发货详情
  55 + */
  56 + @ApiModelProperty("延期发货详情")
  57 + private List<UpdateDelayedShipmentDetailVo> delayedShipmentDetailList;
  58 +
  59 +
49 } 60 }
@@ -196,6 +196,7 @@ @@ -196,6 +196,7 @@
196 AND cu.name LIKE CONCAT('%', #{vo.companyName},'%') 196 AND cu.name LIKE CONCAT('%', #{vo.companyName},'%')
197 </if> 197 </if>
198 </where> 198 </where>
  199 + ORDER BY tb.create_time DESC
199 </select> 200 </select>
200 201
201 <select id="findById" resultType="com.lframework.xingyun.sc.entity.CustomerCredit"> 202 <select id="findById" resultType="com.lframework.xingyun.sc.entity.CustomerCredit">
@@ -7,6 +7,7 @@ @@ -7,6 +7,7 @@
7 <result column="plan_id" property="planId"/> 7 <result column="plan_id" property="planId"/>
8 <result column="order_id" property="orderId"/> 8 <result column="order_id" property="orderId"/>
9 <result column="order_no" property="orderNo"/> 9 <result column="order_no" property="orderNo"/>
  10 + <result column="order_type" property="orderType"/>
10 <result column="customer_id" property="customerId"/> 11 <result column="customer_id" property="customerId"/>
11 <result column="customer_name" property="customerName"/> 12 <result column="customer_name" property="customerName"/>
12 <result column="thickness" property="thickness"/> 13 <result column="thickness" property="thickness"/>
@@ -36,6 +37,12 @@ @@ -36,6 +37,12 @@
36 tb.plan_id, 37 tb.plan_id,
37 tb.order_id, 38 tb.order_id,
38 o.order_no, 39 o.order_no,
  40 + CASE
  41 + WHEN s.type IN ('DISTRIB_STD', 'DIST_STOCK_CONTRACT', 'DRAFT_DIST_AGMT') THEN '经销'
  42 + WHEN s.type IN ('INTL_STD_CONTRACT', 'INTL_INVENTORY_AGMT', 'INTL_OPEN_SPEC_AGMT') THEN '外贸'
  43 + WHEN s.type = 'PROCESS_STD_AGMT' THEN '加工'
  44 + ELSE '其它'
  45 + END AS order_type,
39 o.ordering_unit AS customer_id, 46 o.ordering_unit AS customer_id,
40 c.name AS customer_name, 47 c.name AS customer_name,
41 tb.order_spec_id, 48 tb.order_spec_id,
@@ -55,6 +62,7 @@ @@ -55,6 +62,7 @@
55 tb.shipments_time, 62 tb.shipments_time,
56 tb.can_shipments, 63 tb.can_shipments,
57 tb.del_flag, 64 tb.del_flag,
  65 + ws.name AS workshop_name,
58 tb.create_by_id, 66 tb.create_by_id,
59 tb.update_by_id, 67 tb.update_by_id,
60 tb.create_time, 68 tb.create_time,
@@ -64,6 +72,8 @@ @@ -64,6 +72,8 @@
64 LEFT JOIN purchase_order_info o ON tb.order_id = o.id 72 LEFT JOIN purchase_order_info o ON tb.order_id = o.id
65 LEFT JOIN base_data_customer c ON o.ordering_unit = c.id 73 LEFT JOIN base_data_customer c ON o.ordering_unit = c.id
66 LEFT JOIN tbl_purchase_order_line ol ON tb.order_spec_id = ol.id 74 LEFT JOIN tbl_purchase_order_line ol ON tb.order_spec_id = ol.id
  75 + LEFT JOIN tbl_contract_distributor_standard s on s.id = o.contract_id
  76 + LEFT JOIN base_data_workshop ws on ws.id = o.workshop_id
67 </sql> 77 </sql>
68 78
69 <select id="query" resultMap="ShipmentsPlanDetail"> 79 <select id="query" resultMap="ShipmentsPlanDetail">
@@ -210,4 +220,13 @@ @@ -210,4 +220,13 @@
210 where pd.del_flag = false 220 where pd.del_flag = false
211 and pd.plan_id = #{planId} 221 and pd.plan_id = #{planId}
212 </select> 222 </select>
  223 +
  224 + <select id="findById" resultType="com.lframework.xingyun.sc.entity.ShipmentsPlanDetail">
  225 + <include refid="ShipmentsPlanDetail_sql"/>
  226 + <where>
  227 + <if test="id != null and id != ''">
  228 + AND tb.id = #{id}
  229 + </if>
  230 + </where>
  231 + </select>
213 </mapper> 232 </mapper>
@@ -33,7 +33,12 @@ @@ -33,7 +33,12 @@
33 tb.delayed_shipment_id, 33 tb.delayed_shipment_id,
34 tb.order_id, 34 tb.order_id,
35 o.order_no, 35 o.order_no,
36 - s.type AS order_type, 36 + CASE
  37 + WHEN s.type IN ('DISTRIB_STD', 'DIST_STOCK_CONTRACT', 'DRAFT_DIST_AGMT') THEN '经销'
  38 + WHEN s.type IN ('INTL_STD_CONTRACT', 'INTL_INVENTORY_AGMT', 'INTL_OPEN_SPEC_AGMT') THEN '外贸'
  39 + WHEN s.type = 'PROCESS_STD_AGMT' THEN '加工'
  40 + ELSE '其它'
  41 + END AS order_type,
37 o.workshop_id, 42 o.workshop_id,
38 ws.name AS workshop_name, 43 ws.name AS workshop_name,
39 o.ordering_unit AS customer_id, 44 o.ordering_unit AS customer_id,
@@ -67,4 +72,13 @@ @@ -67,4 +72,13 @@
67 </where> 72 </where>
68 ORDER BY tb.create_time DESC 73 ORDER BY tb.create_time DESC
69 </select> 74 </select>
  75 +
  76 + <select id="findById" resultType="com.lframework.xingyun.sc.entity.DelayedShipmentDetail">
  77 + <include refid="DelayedShipmentDetail_sql"/>
  78 + <where>
  79 + <if test="id != null and id != ''">
  80 + AND tb.id = #{id}
  81 + </if>
  82 + </where>
  83 + </select>
70 </mapper> 84 </mapper>
@@ -7,6 +7,7 @@ @@ -7,6 +7,7 @@
7 <result column="apply_date" property="applyDate"/> 7 <result column="apply_date" property="applyDate"/>
8 <result column="dept_id" property="deptId"/> 8 <result column="dept_id" property="deptId"/>
9 <result column="dept_name" property="deptName"/> 9 <result column="dept_name" property="deptName"/>
  10 + <result column="total_quantity" property="totalQuantity"/>
10 <result column="status" property="status"/> 11 <result column="status" property="status"/>
11 <result column="create_by_id" property="createById"/> 12 <result column="create_by_id" property="createById"/>
12 <result column="create_by" property="createBy"/> 13 <result column="create_by" property="createBy"/>
@@ -22,6 +23,7 @@ @@ -22,6 +23,7 @@
22 tb.apply_date, 23 tb.apply_date,
23 tb.dept_id, 24 tb.dept_id,
24 sd.name AS dept_name, 25 sd.name AS dept_name,
  26 + tb.total_quantity,
25 tb.status, 27 tb.status,
26 tb.create_by_id, 28 tb.create_by_id,
27 tb.create_by, 29 tb.create_by,
@@ -53,4 +55,13 @@ @@ -53,4 +55,13 @@
53 </where> 55 </where>
54 ORDER BY tb.create_time DESC 56 ORDER BY tb.create_time DESC
55 </select> 57 </select>
  58 +
  59 + <select id="findById" resultType="com.lframework.xingyun.sc.entity.DelayedShipment">
  60 + <include refid="DelayedShipment_sql"/>
  61 + <where>
  62 + <if test="id != null and id != ''">
  63 + AND tb.id = #{id}
  64 + </if>
  65 + </where>
  66 + </select>
56 </mapper> 67 </mapper>
@@ -83,7 +83,7 @@ @@ -83,7 +83,7 @@
83 <w:szCs w:val="32"/> 83 <w:szCs w:val="32"/>
84 <w:lang w:val="en-US" w:eastAsia="zh-CN"/> 84 <w:lang w:val="en-US" w:eastAsia="zh-CN"/>
85 </w:rPr> 85 </w:rPr>
86 - <w:t>老客户</w:t> 86 + <w:t>${enterpriseOperationType!}</w:t>
87 </w:r> 87 </w:r>
88 <w:bookmarkStart w:id="0" w:name="_GoBack"/> 88 <w:bookmarkStart w:id="0" w:name="_GoBack"/>
89 <w:bookmarkEnd w:id="0"/> 89 <w:bookmarkEnd w:id="0"/>