Commit d8974e8ecdd7edf8b7af5ecc92b6fb57133b10c4

Authored by yeqianyong
2 parents e6518dab 08899f18

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

Showing 20 changed files with 1568 additions and 0 deletions
  1 +package com.lframework.xingyun.sc.bo.shipments.delay;
  2 +
  3 +import com.fasterxml.jackson.annotation.JsonFormat;
  4 +import com.lframework.starter.common.constants.StringPool;
  5 +import java.time.LocalDate;
  6 +import java.util.List;
  7 +import com.lframework.starter.web.core.bo.BaseBo;
  8 +import com.lframework.xingyun.sc.entity.DelayedShipment;
  9 +import com.lframework.xingyun.sc.entity.DelayedShipmentDetail;
  10 +import io.swagger.annotations.ApiModelProperty;
  11 +
  12 +import lombok.Data;
  13 +
  14 +/**
  15 + * <p>
  16 + * 延期发货表 GetBo
  17 + * </p>
  18 + *
  19 + */
  20 +@Data
  21 +public class GetDelayedShipmentBo extends BaseBo<DelayedShipment> {
  22 +
  23 + /**
  24 + * ID
  25 + */
  26 + @ApiModelProperty("ID")
  27 + private String id;
  28 +
  29 + /**
  30 + * 所属办ID
  31 + */
  32 + @ApiModelProperty("所属办ID")
  33 + private String deptId;
  34 +
  35 + /**
  36 + * 所属办名称
  37 + */
  38 + @ApiModelProperty("所属办名称")
  39 + private String deptName;
  40 +
  41 + /**
  42 + * 申请日期
  43 + */
  44 + @ApiModelProperty("申请日期")
  45 + @JsonFormat(pattern = StringPool.DATE_PATTERN)
  46 + private LocalDate applyDate;
  47 +
  48 + /**
  49 + * 审核状态
  50 + */
  51 + @ApiModelProperty("审核状态")
  52 + private String status;
  53 +
  54 + /**
  55 + * 延期发货详情
  56 + */
  57 + @ApiModelProperty("延期发货详情")
  58 + private List<DelayedShipmentDetail> delayedShipmentDetailList;
  59 +
  60 + public GetDelayedShipmentBo() {
  61 +
  62 + }
  63 +
  64 + public GetDelayedShipmentBo(DelayedShipment dto) {
  65 +
  66 + super(dto);
  67 + }
  68 +
  69 + @Override
  70 + public BaseBo<DelayedShipment> convert(DelayedShipment dto) {
  71 + return super.convert(dto);
  72 + }
  73 +
  74 + @Override
  75 + protected void afterInit(DelayedShipment dto) {
  76 +
  77 + }
  78 +}
... ...
  1 +package com.lframework.xingyun.sc.bo.shipments.delay;
  2 +
  3 +import com.fasterxml.jackson.annotation.JsonFormat;
  4 +import java.math.BigDecimal;
  5 +import com.lframework.starter.common.constants.StringPool;
  6 +import com.lframework.starter.web.core.bo.BaseBo;
  7 +import java.time.LocalDate;
  8 +import com.lframework.xingyun.sc.entity.DelayedShipmentDetail;
  9 +import io.swagger.annotations.ApiModelProperty;
  10 +
  11 +import lombok.Data;
  12 +
  13 +/**
  14 + * <p>
  15 + * 延期发货详情表 GetBo
  16 + * </p>
  17 + *
  18 + */
  19 +@Data
  20 +public class GetDelayedShipmentDetailBo extends BaseBo<DelayedShipmentDetail> {
  21 +
  22 + /**
  23 + * ID
  24 + */
  25 + @ApiModelProperty("ID")
  26 + private String id;
  27 +
  28 + /**
  29 + * 延期发货ID
  30 + */
  31 + @ApiModelProperty("延期发货ID")
  32 + private String delayedShipmentId;
  33 +
  34 + /**
  35 + * 订货单ID
  36 + */
  37 + @ApiModelProperty("订货单ID")
  38 + private String orderId;
  39 +
  40 + /**
  41 + * 订货单编码
  42 + */
  43 + @ApiModelProperty("订货单编码")
  44 + private String orderNo;
  45 +
  46 + /**
  47 + * 订货单类型
  48 + */
  49 + @ApiModelProperty("订货单类型")
  50 + private String orderType;
  51 +
  52 + /**
  53 + * 所属分厂ID
  54 + */
  55 + @ApiModelProperty("所属分厂ID")
  56 + private String workshopId;
  57 +
  58 + /**
  59 + * 所属分厂
  60 + */
  61 + @ApiModelProperty("所属分厂")
  62 + private String workshopName;
  63 +
  64 + /**
  65 + * 客户ID
  66 + */
  67 + @ApiModelProperty("客户ID")
  68 + private String customerId;
  69 +
  70 + /**
  71 + * 客户名称
  72 + */
  73 + @ApiModelProperty("客户名称")
  74 + private String customerName;
  75 +
  76 + /**
  77 + * 发货计划明细ID
  78 + */
  79 + @ApiModelProperty("发货计划明细ID")
  80 + private String shipmentsPlanDetailId;
  81 +
  82 + /**
  83 + * 订货单物料行ID
  84 + */
  85 + @ApiModelProperty("订货单物料行ID")
  86 + private String orderSpecId;
  87 +
  88 + /**
  89 + * 原订单计划发货日期
  90 + */
  91 + @ApiModelProperty("原订单计划发货日期")
  92 + @JsonFormat(pattern = StringPool.DATE_PATTERN)
  93 + private LocalDate deliveryDate;
  94 +
  95 + /**
  96 + * 现申请发货日期
  97 + */
  98 + @ApiModelProperty("现申请发货日期")
  99 + @JsonFormat(pattern = StringPool.DATE_PATTERN)
  100 + private LocalDate applyShipmentDate;
  101 +
  102 + /**
  103 + * 申请次数
  104 + */
  105 + @ApiModelProperty("申请次数")
  106 + private Integer applyCount;
  107 +
  108 + /**
  109 + * 发货数量
  110 + */
  111 + @ApiModelProperty("发货数量")
  112 + private BigDecimal quantity;
  113 +
  114 + /**
  115 + * 延迟原因
  116 + */
  117 + @ApiModelProperty("延迟原因")
  118 + private String delayReason;
  119 +
  120 + public GetDelayedShipmentDetailBo() {
  121 +
  122 + }
  123 +
  124 + public GetDelayedShipmentDetailBo(DelayedShipmentDetail dto) {
  125 +
  126 + super(dto);
  127 + }
  128 +
  129 + @Override
  130 + public BaseBo<DelayedShipmentDetail> convert(DelayedShipmentDetail dto) {
  131 + return super.convert(dto);
  132 + }
  133 +
  134 + @Override
  135 + protected void afterInit(DelayedShipmentDetail dto) {
  136 +
  137 + }
  138 +}
... ...
  1 +package com.lframework.xingyun.sc.controller.shipments.delay;
  2 +
  3 +import com.lframework.starter.web.core.annotations.security.HasPermission;
  4 +import com.lframework.starter.web.core.controller.DefaultBaseController;
  5 +import com.lframework.starter.web.core.utils.PageResultUtil;
  6 +import com.lframework.starter.web.core.components.resp.PageResult;
  7 +import com.lframework.starter.web.core.components.resp.InvokeResult;
  8 +import javax.validation.constraints.NotBlank;
  9 +import com.lframework.xingyun.sc.bo.shipments.delay.GetDelayedShipmentBo;
  10 +import com.lframework.xingyun.sc.entity.DelayedShipment;
  11 +import com.lframework.xingyun.sc.entity.DelayedShipmentDetail;
  12 +import com.lframework.xingyun.sc.service.shipments.delay.DelayedShipmentDetailService;
  13 +import com.lframework.xingyun.sc.service.shipments.delay.DelayedShipmentService;
  14 +import com.lframework.xingyun.sc.vo.shipments.delay.CreateDelayedShipmentVo;
  15 +import com.lframework.xingyun.sc.vo.shipments.delay.QueryDelayedShipmentDetailVo;
  16 +import com.lframework.xingyun.sc.vo.shipments.delay.QueryDelayedShipmentVo;
  17 +import com.lframework.xingyun.sc.vo.shipments.delay.UpdateDelayedShipmentVo;
  18 +import io.swagger.annotations.ApiImplicitParam;
  19 +import com.lframework.starter.web.core.components.resp.InvokeResultBuilder;
  20 +import com.lframework.starter.common.exceptions.impl.DefaultClientException;
  21 +import io.swagger.annotations.ApiOperation;
  22 +import com.lframework.starter.common.utils.CollectionUtil;
  23 +import io.swagger.annotations.Api;
  24 +import org.springframework.web.bind.annotation.DeleteMapping;
  25 +import org.springframework.beans.factory.annotation.Autowired;
  26 +import org.springframework.validation.annotation.Validated;
  27 +import org.springframework.web.bind.annotation.*;
  28 +import javax.validation.Valid;
  29 +import java.util.List;
  30 +import java.util.stream.Collectors;
  31 +
  32 +/**
  33 + * 延期发货表 Controller
  34 + *
  35 + */
  36 +@Api(tags = "延期发货表")
  37 +@Validated
  38 +@RestController
  39 +@RequestMapping("/delayedShipment/delayedshipment")
  40 +public class DelayedShipmentController extends DefaultBaseController {
  41 +
  42 + @Autowired
  43 + private DelayedShipmentService delayedShipmentService;
  44 + @Autowired
  45 + private DelayedShipmentDetailService delayedShipmentDetailService;
  46 +
  47 + /**
  48 + * 查询列表
  49 + */
  50 + @ApiOperation("查询列表")
  51 + @HasPermission({"delayedShipment:delayedshipment:query"})
  52 + @GetMapping("/query")
  53 + public InvokeResult<PageResult<GetDelayedShipmentBo>> query(@Valid QueryDelayedShipmentVo vo) {
  54 +
  55 + PageResult<DelayedShipment> pageResult = delayedShipmentService.query(getPageIndex(vo), getPageSize(vo), vo);
  56 +
  57 + List<DelayedShipment> datas = pageResult.getDatas();
  58 + List<GetDelayedShipmentBo> results = null;
  59 +
  60 + if (!CollectionUtil.isEmpty(datas)) {
  61 + results = datas.stream().map(GetDelayedShipmentBo::new).collect(Collectors.toList());
  62 + }
  63 +
  64 + return InvokeResultBuilder.success(PageResultUtil.rebuild(pageResult, results));
  65 + }
  66 +
  67 + /**
  68 + * 根据ID查询
  69 + */
  70 + @ApiOperation("根据ID查询")
  71 + @ApiImplicitParam(value = "id", name = "id", paramType = "query", required = true)
  72 + @HasPermission({"delayedShipment:delayedshipment:query"})
  73 + @GetMapping
  74 + public InvokeResult<GetDelayedShipmentBo> get(@NotBlank(message = "id不能为空!") String id) {
  75 +
  76 + DelayedShipment data = delayedShipmentService.findById(id);
  77 + if (data == null) {
  78 + throw new DefaultClientException("延期发货表不存在!");
  79 + }
  80 +
  81 + GetDelayedShipmentBo result = new GetDelayedShipmentBo(data);
  82 + QueryDelayedShipmentDetailVo vo = new QueryDelayedShipmentDetailVo();
  83 + vo.setDelayedShipmentId(id);
  84 + List<DelayedShipmentDetail> delayedShipmentDetailList = delayedShipmentDetailService.query(vo);
  85 + result.setDelayedShipmentDetailList(delayedShipmentDetailList);
  86 +
  87 + return InvokeResultBuilder.success(result);
  88 + }
  89 +
  90 + /**
  91 + * 新增
  92 + */
  93 + @ApiOperation("新增")
  94 + @HasPermission({"delayedShipment:delayedshipment:add"})
  95 + @PostMapping
  96 + public InvokeResult<Void> create(@Valid CreateDelayedShipmentVo vo) {
  97 +
  98 + delayedShipmentService.create(vo);
  99 +
  100 + return InvokeResultBuilder.success();
  101 + }
  102 +
  103 + /**
  104 + * 修改
  105 + */
  106 + @ApiOperation("修改")
  107 + @HasPermission({"delayedShipment:delayedshipment:modify"})
  108 + @PutMapping
  109 + public InvokeResult<Void> update(@Valid UpdateDelayedShipmentVo vo) {
  110 +
  111 + delayedShipmentService.update(vo);
  112 +
  113 + return InvokeResultBuilder.success();
  114 + }
  115 +
  116 + /**
  117 + * 根据ID删除
  118 + */
  119 + @ApiOperation("根据ID删除")
  120 + @ApiImplicitParam(value = "id", name = "id", paramType = "query", required = true)
  121 + @HasPermission({"delayedShipment:delayedshipment:delete"})
  122 + @DeleteMapping
  123 + public InvokeResult<Void> deleteById(@NotBlank(message = "id不能为空!") String id) {
  124 +
  125 + delayedShipmentService.deleteById(id);
  126 +
  127 + return InvokeResultBuilder.success();
  128 + }
  129 +}
... ...
  1 +package com.lframework.xingyun.sc.controller.shipments.delay;
  2 +
  3 +import com.lframework.starter.web.core.annotations.security.HasPermission;
  4 +import com.lframework.starter.web.core.controller.DefaultBaseController;
  5 +import com.lframework.starter.web.core.utils.PageResultUtil;
  6 +import com.lframework.starter.web.core.components.resp.PageResult;
  7 +import com.lframework.starter.web.core.components.resp.InvokeResult;
  8 +import javax.validation.constraints.NotBlank;
  9 +import com.lframework.xingyun.sc.bo.shipments.delay.GetDelayedShipmentDetailBo;
  10 +import com.lframework.xingyun.sc.entity.DelayedShipmentDetail;
  11 +import com.lframework.xingyun.sc.service.shipments.delay.DelayedShipmentDetailService;
  12 +import com.lframework.xingyun.sc.vo.shipments.delay.CreateDelayedShipmentDetailVo;
  13 +import com.lframework.xingyun.sc.vo.shipments.delay.QueryDelayedShipmentDetailVo;
  14 +import com.lframework.xingyun.sc.vo.shipments.delay.UpdateDelayedShipmentDetailVo;
  15 +import io.swagger.annotations.ApiImplicitParam;
  16 +import com.lframework.starter.web.core.components.resp.InvokeResultBuilder;
  17 +import com.lframework.starter.common.exceptions.impl.DefaultClientException;
  18 +import io.swagger.annotations.ApiOperation;
  19 +import com.lframework.starter.common.utils.CollectionUtil;
  20 +import io.swagger.annotations.Api;
  21 +import org.springframework.web.bind.annotation.DeleteMapping;
  22 +import org.springframework.beans.factory.annotation.Autowired;
  23 +import org.springframework.validation.annotation.Validated;
  24 +import org.springframework.web.bind.annotation.*;
  25 +
  26 +import javax.validation.Valid;
  27 +import java.util.List;
  28 +import java.util.stream.Collectors;
  29 +
  30 +/**
  31 + * 延期发货详情表 Controller
  32 + *
  33 + */
  34 +@Api(tags = "延期发货详情表")
  35 +@Validated
  36 +@RestController
  37 +@RequestMapping("/delayedShipmentDetail/delayedshipmentdetail")
  38 +public class DelayedShipmentDetailController extends DefaultBaseController {
  39 +
  40 + @Autowired
  41 + private DelayedShipmentDetailService delayedShipmentDetailService;
  42 +
  43 + /**
  44 + * 查询列表
  45 + */
  46 + @ApiOperation("查询列表")
  47 + @HasPermission({"delayedShipmentDetail:delayedshipmentdetail:query"})
  48 + @GetMapping("/query")
  49 + public InvokeResult<PageResult<GetDelayedShipmentDetailBo>> query(@Valid QueryDelayedShipmentDetailVo vo) {
  50 +
  51 + PageResult<DelayedShipmentDetail> pageResult = delayedShipmentDetailService.query(getPageIndex(vo), getPageSize(vo), vo);
  52 +
  53 + List<DelayedShipmentDetail> datas = pageResult.getDatas();
  54 + List<GetDelayedShipmentDetailBo> results = null;
  55 +
  56 + if (!CollectionUtil.isEmpty(datas)) {
  57 + results = datas.stream().map(GetDelayedShipmentDetailBo::new).collect(Collectors.toList());
  58 + }
  59 +
  60 + return InvokeResultBuilder.success(PageResultUtil.rebuild(pageResult, results));
  61 + }
  62 +
  63 + /**
  64 + * 根据ID查询
  65 + */
  66 + @ApiOperation("根据ID查询")
  67 + @ApiImplicitParam(value = "id", name = "id", paramType = "query", required = true)
  68 + @HasPermission({"delayedShipmentDetail:delayedshipmentdetail:query"})
  69 + @GetMapping
  70 + public InvokeResult<GetDelayedShipmentDetailBo> get(@NotBlank(message = "id不能为空!") String id) {
  71 +
  72 + DelayedShipmentDetail data = delayedShipmentDetailService.findById(id);
  73 + if (data == null) {
  74 + throw new DefaultClientException("延期发货详情表不存在!");
  75 + }
  76 +
  77 + GetDelayedShipmentDetailBo result = new GetDelayedShipmentDetailBo(data);
  78 +
  79 + return InvokeResultBuilder.success(result);
  80 + }
  81 +
  82 + /**
  83 + * 新增
  84 + */
  85 + @ApiOperation("新增")
  86 + @HasPermission({"delayedShipmentDetail:delayedshipmentdetail:add"})
  87 + @PostMapping
  88 + public InvokeResult<Void> create(@Valid CreateDelayedShipmentDetailVo vo) {
  89 +
  90 + delayedShipmentDetailService.create(vo);
  91 +
  92 + return InvokeResultBuilder.success();
  93 + }
  94 +
  95 + /**
  96 + * 修改
  97 + */
  98 + @ApiOperation("修改")
  99 + @HasPermission({"delayedShipmentDetail:delayedshipmentdetail:modify"})
  100 + @PutMapping
  101 + public InvokeResult<Void> update(@Valid UpdateDelayedShipmentDetailVo vo) {
  102 +
  103 + delayedShipmentDetailService.update(vo);
  104 +
  105 + return InvokeResultBuilder.success();
  106 + }
  107 +
  108 + /**
  109 + * 根据ID删除
  110 + */
  111 + @ApiOperation("根据ID删除")
  112 + @ApiImplicitParam(value = "id", name = "id", paramType = "query", required = true)
  113 + @HasPermission({"delayedShipmentDetail:delayedshipmentdetail:delete"})
  114 + @DeleteMapping
  115 + public InvokeResult<Void> deleteById(@NotBlank(message = "id不能为空!") String id) {
  116 +
  117 + delayedShipmentDetailService.deleteById(id);
  118 +
  119 + return InvokeResultBuilder.success();
  120 + }
  121 +}
... ...
  1 +package com.lframework.xingyun.sc.entity;
  2 +
  3 +import com.baomidou.mybatisplus.annotation.TableName;
  4 +import com.lframework.starter.web.core.dto.BaseDto;
  5 +import java.time.LocalDate;
  6 +import java.time.LocalDateTime;
  7 +import java.util.List;
  8 +
  9 +import com.baomidou.mybatisplus.annotation.FieldFill;
  10 +import com.lframework.starter.web.core.entity.BaseEntity;
  11 +import com.baomidou.mybatisplus.annotation.TableField;
  12 +import lombok.Data;
  13 +
  14 +/**
  15 + * <p>
  16 + * 延期发货表
  17 + * </p>
  18 + *
  19 + */
  20 +@Data
  21 +@TableName("delayed_shipment")
  22 +public class DelayedShipment extends BaseEntity implements BaseDto {
  23 +
  24 + private static final long serialVersionUID = 1L;
  25 +
  26 + public static final String CACHE_NAME = "DelayedShipment";
  27 +
  28 + /**
  29 + * ID
  30 + */
  31 + private String id;
  32 +
  33 + /**
  34 + * 申请日期
  35 + */
  36 + private LocalDate applyDate;
  37 +
  38 + /**
  39 + * 所属办ID
  40 + */
  41 + private String deptId;
  42 +
  43 + /**
  44 + * 所属办ID
  45 + */
  46 + @TableField(exist = false)
  47 + private String deptName;
  48 +
  49 + /**
  50 + * 审核状态
  51 + */
  52 + private String status;
  53 +
  54 + /**
  55 + * 延期发货详情
  56 + */
  57 + @TableField(exist = false)
  58 + private List<DelayedShipmentDetail> delayedShipmentDetailList;
  59 +
  60 + /**
  61 + * 创建人ID
  62 + */
  63 + @TableField(fill = FieldFill.INSERT)
  64 + private String createById;
  65 +
  66 + /**
  67 + * 创建人
  68 + */
  69 + @TableField(fill = FieldFill.INSERT)
  70 + private String createBy;
  71 +
  72 + /**
  73 + * 更新人ID
  74 + */
  75 + @TableField(fill = FieldFill.INSERT_UPDATE)
  76 + private String updateById;
  77 +
  78 + /**
  79 + * 更新人
  80 + */
  81 + @TableField(fill = FieldFill.INSERT_UPDATE)
  82 + private String updateBy;
  83 +
  84 + /**
  85 + * 创建时间
  86 + */
  87 + @TableField(fill = FieldFill.INSERT)
  88 + private LocalDateTime createTime;
  89 +
  90 + /**
  91 + * 更新时间
  92 + */
  93 + @TableField(fill = FieldFill.INSERT_UPDATE)
  94 + private LocalDateTime updateTime;
  95 +
  96 +}
... ...
  1 +package com.lframework.xingyun.sc.entity;
  2 +
  3 +import com.baomidou.mybatisplus.annotation.TableName;
  4 +import java.math.BigDecimal;
  5 +import com.lframework.starter.web.core.dto.BaseDto;
  6 +import java.time.LocalDate;
  7 +import java.time.LocalDateTime;
  8 +import com.baomidou.mybatisplus.annotation.FieldFill;
  9 +import com.lframework.starter.web.core.entity.BaseEntity;
  10 +import com.baomidou.mybatisplus.annotation.TableField;
  11 +import lombok.Data;
  12 +
  13 +/**
  14 + * <p>
  15 + * 延期发货详情表
  16 + * </p>
  17 + *
  18 + */
  19 +@Data
  20 +@TableName("delayed_shipment_detail")
  21 +public class DelayedShipmentDetail extends BaseEntity implements BaseDto {
  22 +
  23 + private static final long serialVersionUID = 1L;
  24 +
  25 + public static final String CACHE_NAME = "DelayedShipmentDetail";
  26 +
  27 + /**
  28 + * ID
  29 + */
  30 + private String id;
  31 +
  32 + /**
  33 + * 延期发货ID
  34 + */
  35 + private String delayedShipmentId;
  36 +
  37 + /**
  38 + * 订货单ID
  39 + */
  40 + private String orderId;
  41 +
  42 + /**
  43 + * 订货单编码
  44 + */
  45 + @TableField(exist = false)
  46 + private String orderNo;
  47 +
  48 + /**
  49 + * 订货单类型
  50 + */
  51 + @TableField(exist = false)
  52 + private String orderType;
  53 +
  54 + /**
  55 + * 所属分厂ID
  56 + */
  57 + @TableField(exist = false)
  58 + private String workshopId;
  59 +
  60 + /**
  61 + * 所属分厂
  62 + */
  63 + @TableField(exist = false)
  64 + private String workshopName;
  65 +
  66 + /**
  67 + * 客户ID
  68 + */
  69 + @TableField(exist = false)
  70 + private String customerId;
  71 +
  72 + /**
  73 + * 客户名称
  74 + */
  75 + @TableField(exist = false)
  76 + private String customerName;
  77 +
  78 + /**
  79 + * 发货计划明细ID
  80 + */
  81 + private String shipmentsPlanDetailId;
  82 +
  83 + /**
  84 + * 订货单物料行ID
  85 + */
  86 + private String orderSpecId;
  87 +
  88 + /**
  89 + * 原订单计划发货日期
  90 + */
  91 + private LocalDate deliveryDate;
  92 +
  93 + /**
  94 + * 现申请发货日期
  95 + */
  96 + private LocalDate applyShipmentDate;
  97 +
  98 + /**
  99 + * 申请次数
  100 + */
  101 + private Integer applyCount;
  102 +
  103 + /**
  104 + * 发货数量
  105 + */
  106 + private BigDecimal quantity;
  107 +
  108 + /**
  109 + * 延迟原因
  110 + */
  111 + private String delayReason;
  112 +
  113 + /**
  114 + * 创建人ID
  115 + */
  116 + @TableField(fill = FieldFill.INSERT)
  117 + private String createById;
  118 +
  119 + /**
  120 + * 创建人
  121 + */
  122 + @TableField(fill = FieldFill.INSERT)
  123 + private String createBy;
  124 +
  125 + /**
  126 + * 更新人ID
  127 + */
  128 + @TableField(fill = FieldFill.INSERT_UPDATE)
  129 + private String updateById;
  130 +
  131 + /**
  132 + * 更新人
  133 + */
  134 + @TableField(fill = FieldFill.INSERT_UPDATE)
  135 + private String updateBy;
  136 +
  137 + /**
  138 + * 创建时间
  139 + */
  140 + @TableField(fill = FieldFill.INSERT)
  141 + private LocalDateTime createTime;
  142 +
  143 + /**
  144 + * 更新时间
  145 + */
  146 + @TableField(fill = FieldFill.INSERT_UPDATE)
  147 + private LocalDateTime updateTime;
  148 +
  149 +}
... ...
  1 +package com.lframework.xingyun.sc.impl.shipments.delay;
  2 +
  3 +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
  4 +import com.baomidou.mybatisplus.core.toolkit.Wrappers;
  5 +import com.github.pagehelper.PageInfo;
  6 +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.OpLogUtil;
  9 +import com.lframework.starter.common.exceptions.impl.DefaultClientException;
  10 +import java.io.Serializable;
  11 +import com.lframework.starter.web.core.utils.IdUtil;
  12 +import com.lframework.starter.web.core.annotations.oplog.OpLog;
  13 +import com.lframework.starter.web.core.utils.PageHelperUtil;
  14 +import com.lframework.starter.web.inner.components.oplog.OtherOpLogType;
  15 +import com.lframework.starter.web.core.components.resp.PageResult;
  16 +import com.lframework.starter.common.utils.ObjectUtil;
  17 +import com.lframework.starter.common.utils.Assert;
  18 +import com.lframework.xingyun.sc.entity.DelayedShipmentDetail;
  19 +import com.lframework.xingyun.sc.mappers.DelayedShipmentDetailMapper;
  20 +import com.lframework.xingyun.sc.service.shipments.delay.DelayedShipmentDetailService;
  21 +import com.lframework.xingyun.sc.vo.shipments.delay.CreateDelayedShipmentDetailVo;
  22 +import com.lframework.xingyun.sc.vo.shipments.delay.QueryDelayedShipmentDetailVo;
  23 +import com.lframework.xingyun.sc.vo.shipments.delay.UpdateDelayedShipmentDetailVo;
  24 +import org.springframework.transaction.annotation.Transactional;
  25 +import org.springframework.stereotype.Service;
  26 +
  27 +import java.util.Collection;
  28 +import java.util.List;
  29 +
  30 +@Service
  31 +public class DelayedShipmentDetailServiceImpl extends BaseMpServiceImpl<DelayedShipmentDetailMapper, DelayedShipmentDetail> implements DelayedShipmentDetailService {
  32 +
  33 + @Override
  34 + public PageResult<DelayedShipmentDetail> query(Integer pageIndex, Integer pageSize, QueryDelayedShipmentDetailVo vo) {
  35 +
  36 + Assert.greaterThanZero(pageIndex);
  37 + Assert.greaterThanZero(pageSize);
  38 +
  39 + PageHelperUtil.startPage(pageIndex, pageSize);
  40 + List<DelayedShipmentDetail> datas = this.query(vo);
  41 +
  42 + return PageResultUtil.convert(new PageInfo<>(datas));
  43 + }
  44 +
  45 + @Override
  46 + public List<DelayedShipmentDetail> query(QueryDelayedShipmentDetailVo vo) {
  47 +
  48 + return getBaseMapper().query(vo);
  49 + }
  50 +
  51 + @Override
  52 + public DelayedShipmentDetail findById(String id) {
  53 +
  54 + return getBaseMapper().selectById(id);
  55 + }
  56 +
  57 + @OpLog(type = OtherOpLogType.class, name = "新增延期发货详情表,ID:{}", params = {"#id"})
  58 + @Transactional(rollbackFor = Exception.class)
  59 + @Override
  60 + public String create(CreateDelayedShipmentDetailVo vo) {
  61 +
  62 + DelayedShipmentDetail data = new DelayedShipmentDetail();
  63 + 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());
  73 +
  74 + getBaseMapper().insert(data);
  75 +
  76 + OpLogUtil.setVariable("id", data.getId());
  77 + OpLogUtil.setExtra(vo);
  78 +
  79 + return data.getId();
  80 + }
  81 +
  82 + @OpLog(type = OtherOpLogType.class, name = "修改延期发货详情表,ID:{}", params = {"#id"})
  83 + @Transactional(rollbackFor = Exception.class)
  84 + @Override
  85 + public void update(UpdateDelayedShipmentDetailVo vo) {
  86 +
  87 + DelayedShipmentDetail data = getBaseMapper().selectById(vo.getId());
  88 + if (ObjectUtil.isNull(data)) {
  89 + throw new DefaultClientException("延期发货详情表不存在!");
  90 + }
  91 +
  92 + 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())
  99 + .set(DelayedShipmentDetail::getApplyCount, vo.getApplyCount())
  100 + .set(DelayedShipmentDetail::getQuantity, vo.getQuantity())
  101 + .set(DelayedShipmentDetail::getDelayReason, vo.getDelayReason())
  102 + .eq(DelayedShipmentDetail::getId, vo.getId());
  103 +
  104 + getBaseMapper().update(updateWrapper);
  105 +
  106 + OpLogUtil.setVariable("id", data.getId());
  107 + OpLogUtil.setExtra(vo);
  108 + }
  109 +
  110 + @OpLog(type = OtherOpLogType.class, name = "删除延期发货详情表,ID:{}", params = {"#id"})
  111 + @Transactional(rollbackFor = Exception.class)
  112 + @Override
  113 + public void deleteById(String id) {
  114 +
  115 + getBaseMapper().deleteById(id);
  116 + }
  117 +
  118 + @Override
  119 + public void cleanCacheByKey(Serializable key) {
  120 +
  121 + }
  122 +}
... ...
  1 +package com.lframework.xingyun.sc.impl.shipments.delay;
  2 +
  3 +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
  4 +import com.baomidou.mybatisplus.core.toolkit.Wrappers;
  5 +import com.github.pagehelper.PageInfo;
  6 +import com.lframework.starter.web.core.impl.BaseMpServiceImpl;
  7 +import com.lframework.starter.web.core.utils.PageResultUtil;;
  8 +import com.lframework.starter.web.core.components.resp.PageResult;
  9 +import com.lframework.starter.web.core.utils.OpLogUtil;
  10 +import com.lframework.starter.common.exceptions.impl.DefaultClientException;
  11 +import java.io.Serializable;
  12 +import com.lframework.starter.web.core.utils.IdUtil;
  13 +import com.lframework.starter.common.utils.ObjectUtil;
  14 +import com.lframework.starter.web.core.annotations.oplog.OpLog;
  15 +import com.lframework.starter.web.core.utils.PageHelperUtil;
  16 +import com.lframework.starter.common.utils.Assert;
  17 +import com.lframework.starter.web.inner.components.oplog.OtherOpLogType;
  18 +import com.lframework.xingyun.sc.entity.DelayedShipment;
  19 +import com.lframework.xingyun.sc.mappers.DelayedShipmentMapper;
  20 +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 org.springframework.transaction.annotation.Transactional;
  25 +import org.springframework.stereotype.Service;
  26 +
  27 +import java.util.List;
  28 +
  29 +@Service
  30 +public class DelayedShipmentServiceImpl extends BaseMpServiceImpl<DelayedShipmentMapper, DelayedShipment> implements DelayedShipmentService {
  31 +
  32 + @Override
  33 + public PageResult<DelayedShipment> query(Integer pageIndex, Integer pageSize, QueryDelayedShipmentVo vo) {
  34 +
  35 + Assert.greaterThanZero(pageIndex);
  36 + Assert.greaterThanZero(pageSize);
  37 +
  38 + PageHelperUtil.startPage(pageIndex, pageSize);
  39 + List<DelayedShipment> datas = this.query(vo);
  40 +
  41 + return PageResultUtil.convert(new PageInfo<>(datas));
  42 + }
  43 +
  44 + @Override
  45 + public List<DelayedShipment> query(QueryDelayedShipmentVo vo) {
  46 +
  47 + return getBaseMapper().query(vo);
  48 + }
  49 +
  50 + @Override
  51 + public DelayedShipment findById(String id) {
  52 +
  53 + return getBaseMapper().selectById(id);
  54 + }
  55 +
  56 + @OpLog(type = OtherOpLogType.class, name = "新增延期发货表,ID:{}", params = {"#id"})
  57 + @Transactional(rollbackFor = Exception.class)
  58 + @Override
  59 + public String create(CreateDelayedShipmentVo vo) {
  60 +
  61 + DelayedShipment data = new DelayedShipment();
  62 + data.setId(IdUtil.getId());
  63 + data.setDeptId(vo.getDeptId());
  64 + data.setApplyDate(vo.getApplyDate());
  65 + data.setStatus(vo.getStatus());
  66 +
  67 + getBaseMapper().insert(data);
  68 +
  69 + OpLogUtil.setVariable("id", data.getId());
  70 + OpLogUtil.setExtra(vo);
  71 +
  72 + return data.getId();
  73 + }
  74 +
  75 + @OpLog(type = OtherOpLogType.class, name = "修改延期发货表,ID:{}", params = {"#id"})
  76 + @Transactional(rollbackFor = Exception.class)
  77 + @Override
  78 + public void update(UpdateDelayedShipmentVo vo) {
  79 +
  80 + DelayedShipment data = getBaseMapper().selectById(vo.getId());
  81 + if (ObjectUtil.isNull(data)) {
  82 + throw new DefaultClientException("延期发货表不存在!");
  83 + }
  84 +
  85 + LambdaUpdateWrapper<DelayedShipment> updateWrapper = Wrappers.lambdaUpdate(DelayedShipment.class)
  86 + .set(DelayedShipment::getDeptId, vo.getDeptId())
  87 + .set(DelayedShipment::getApplyDate, vo.getApplyDate())
  88 + .set(DelayedShipment::getStatus, vo.getStatus())
  89 + .eq(DelayedShipment::getId, vo.getId());
  90 +
  91 + getBaseMapper().update(updateWrapper);
  92 +
  93 + OpLogUtil.setVariable("id", data.getId());
  94 + OpLogUtil.setExtra(vo);
  95 + }
  96 +
  97 + @OpLog(type = OtherOpLogType.class, name = "删除延期发货表,ID:{}", params = {"#id"})
  98 + @Transactional(rollbackFor = Exception.class)
  99 + @Override
  100 + public void deleteById(String id) {
  101 +
  102 + getBaseMapper().deleteById(id);
  103 + }
  104 +
  105 + @Override
  106 + public void cleanCacheByKey(Serializable key) {
  107 +
  108 + }
  109 +}
... ...
  1 +package com.lframework.xingyun.sc.mappers;
  2 +
  3 +import com.lframework.starter.web.core.mapper.BaseMapper;
  4 +import com.lframework.xingyun.sc.entity.DelayedShipmentDetail;
  5 +import com.lframework.xingyun.sc.vo.shipments.delay.QueryDelayedShipmentDetailVo;
  6 +import org.apache.ibatis.annotations.Param;
  7 +
  8 +import java.util.List;
  9 +
  10 +/**
  11 + * <p>
  12 + * 延期发货详情表 Mapper 接口
  13 + * </p>
  14 + *
  15 + */
  16 +public interface DelayedShipmentDetailMapper extends BaseMapper<DelayedShipmentDetail> {
  17 +
  18 + /**
  19 + * 查询列表
  20 + * @param vo
  21 + * @return
  22 + */
  23 + List<DelayedShipmentDetail> query(@Param("vo") QueryDelayedShipmentDetailVo vo);
  24 +}
... ...
  1 +package com.lframework.xingyun.sc.mappers;
  2 +
  3 +import com.lframework.starter.web.core.mapper.BaseMapper;
  4 +import com.lframework.xingyun.sc.entity.DelayedShipment;
  5 +import com.lframework.xingyun.sc.vo.shipments.delay.QueryDelayedShipmentVo;
  6 +import org.apache.ibatis.annotations.Param;
  7 +
  8 +import java.util.List;
  9 +
  10 +/**
  11 + * <p>
  12 + * 延期发货表 Mapper 接口
  13 + * </p>
  14 + *
  15 + */
  16 +public interface DelayedShipmentMapper extends BaseMapper<DelayedShipment> {
  17 +
  18 + /**
  19 + * 查询列表
  20 + * @param vo
  21 + * @return
  22 + */
  23 + List<DelayedShipment> query(@Param("vo") QueryDelayedShipmentVo vo);
  24 +}
... ...
  1 +package com.lframework.xingyun.sc.service.shipments.delay;
  2 +
  3 +import com.lframework.starter.web.core.service.BaseMpService;
  4 +import com.lframework.starter.web.core.components.resp.PageResult;
  5 +import com.lframework.xingyun.sc.entity.DelayedShipmentDetail;
  6 +import com.lframework.xingyun.sc.vo.shipments.delay.CreateDelayedShipmentDetailVo;
  7 +import com.lframework.xingyun.sc.vo.shipments.delay.QueryDelayedShipmentDetailVo;
  8 +import com.lframework.xingyun.sc.vo.shipments.delay.UpdateDelayedShipmentDetailVo;
  9 +import java.util.List;
  10 +
  11 +/**
  12 + * 延期发货详情表 Service
  13 + */
  14 +public interface DelayedShipmentDetailService extends BaseMpService<DelayedShipmentDetail> {
  15 +
  16 + /**
  17 + * 查询列表
  18 + * @return
  19 + */
  20 + PageResult<DelayedShipmentDetail> query(Integer pageIndex, Integer pageSize, QueryDelayedShipmentDetailVo vo);
  21 +
  22 + /**
  23 + * 查询列表
  24 + * @param vo
  25 + * @return
  26 + */
  27 + List<DelayedShipmentDetail> query(QueryDelayedShipmentDetailVo vo);
  28 +
  29 + /**
  30 + * 根据ID查询
  31 + * @param id
  32 + * @return
  33 + */
  34 + DelayedShipmentDetail findById(String id);
  35 +
  36 + /**
  37 + * 创建
  38 + * @param vo
  39 + * @return
  40 + */
  41 + String create(CreateDelayedShipmentDetailVo vo);
  42 +
  43 + /**
  44 + * 修改
  45 + * @param vo
  46 + */
  47 + void update(UpdateDelayedShipmentDetailVo vo);
  48 +
  49 + /**
  50 + * 根据ID删除
  51 + * @param id
  52 + * @return
  53 + */
  54 + void deleteById(String id);
  55 +}
... ...
  1 +package com.lframework.xingyun.sc.service.shipments.delay;
  2 +
  3 +import com.lframework.starter.web.core.service.BaseMpService;
  4 +import com.lframework.starter.web.core.components.resp.PageResult;
  5 +import com.lframework.xingyun.sc.entity.DelayedShipment;
  6 +import com.lframework.xingyun.sc.vo.shipments.delay.CreateDelayedShipmentVo;
  7 +import com.lframework.xingyun.sc.vo.shipments.delay.QueryDelayedShipmentVo;
  8 +import com.lframework.xingyun.sc.vo.shipments.delay.UpdateDelayedShipmentVo;
  9 +import java.util.List;
  10 +
  11 +/**
  12 + * 延期发货表 Service
  13 + */
  14 +public interface DelayedShipmentService extends BaseMpService<DelayedShipment> {
  15 +
  16 + /**
  17 + * 查询列表
  18 + * @return
  19 + */
  20 + PageResult<DelayedShipment> query(Integer pageIndex, Integer pageSize, QueryDelayedShipmentVo vo);
  21 +
  22 + /**
  23 + * 查询列表
  24 + * @param vo
  25 + * @return
  26 + */
  27 + List<DelayedShipment> query(QueryDelayedShipmentVo vo);
  28 +
  29 + /**
  30 + * 根据ID查询
  31 + * @param id
  32 + * @return
  33 + */
  34 + DelayedShipment findById(String id);
  35 +
  36 + /**
  37 + * 创建
  38 + * @param vo
  39 + * @return
  40 + */
  41 + String create(CreateDelayedShipmentVo vo);
  42 +
  43 + /**
  44 + * 修改
  45 + * @param vo
  46 + */
  47 + void update(UpdateDelayedShipmentVo vo);
  48 +
  49 + /**
  50 + * 根据ID删除
  51 + * @param id
  52 + * @return
  53 + */
  54 + void deleteById(String id);
  55 +}
... ...
  1 +package com.lframework.xingyun.sc.vo.shipments.delay;
  2 +
  3 +import com.lframework.starter.web.core.components.validation.IsNumberPrecision;
  4 +import java.math.BigDecimal;
  5 +import javax.validation.constraints.NotBlank;
  6 +import java.time.LocalDate;
  7 +import com.lframework.starter.web.core.vo.BaseVo;
  8 +import javax.validation.constraints.NotNull;
  9 +import io.swagger.annotations.ApiModelProperty;
  10 +import com.lframework.starter.web.core.components.validation.TypeMismatch;
  11 +import org.hibernate.validator.constraints.Length;
  12 +import java.io.Serializable;
  13 +import lombok.Data;
  14 +
  15 +@Data
  16 +public class CreateDelayedShipmentDetailVo implements BaseVo, Serializable {
  17 +
  18 + private static final long serialVersionUID = 1L;
  19 +
  20 + /**
  21 + * 延期发货ID
  22 + */
  23 + @ApiModelProperty(value = "延期发货ID", required = true)
  24 + @NotBlank(message = "请输入延期发货ID!")
  25 + @Length(message = "延期发货ID最多允许32个字符!")
  26 + private String delayedShipmentId;
  27 +
  28 + /**
  29 + * 订货单ID
  30 + */
  31 + @ApiModelProperty(value = "订货单ID", required = true)
  32 + @NotBlank(message = "请输入订货单ID!")
  33 + @Length(message = "订货单ID最多允许32个字符!")
  34 + private String orderId;
  35 +
  36 + /**
  37 + * 发货计划明细ID
  38 + */
  39 + @ApiModelProperty(value = "发货计划明细ID", required = true)
  40 + @NotBlank(message = "请输入发货计划明细ID!")
  41 + @Length(message = "发货计划明细ID最多允许32个字符!")
  42 + private String shipmentsPlanDetailId;
  43 +
  44 + /**
  45 + * 订货单物料行ID
  46 + */
  47 + @ApiModelProperty(value = "订货单物料行ID", required = true)
  48 + @NotBlank(message = "请输入订货单物料行ID!")
  49 + @Length(message = "订货单物料行ID最多允许32个字符!")
  50 + private String orderSpecId;
  51 +
  52 + /**
  53 + * 原订单计划发货日期
  54 + */
  55 + @ApiModelProperty(value = "原订单计划发货日期", required = true)
  56 + @NotNull(message = "请输入原订单计划发货日期!")
  57 + @TypeMismatch(message = "原订单计划发货日期格式有误!")
  58 + private LocalDate deliveryDate;
  59 +
  60 + /**
  61 + * 现申请发货日期
  62 + */
  63 + @ApiModelProperty(value = "现申请发货日期", required = true)
  64 + @NotNull(message = "请输入现申请发货日期!")
  65 + @TypeMismatch(message = "现申请发货日期格式有误!")
  66 + private LocalDate applyShipmentDate;
  67 +
  68 + /**
  69 + * 申请次数
  70 + */
  71 + @ApiModelProperty(value = "申请次数", required = true)
  72 + @NotNull(message = "请输入申请次数!")
  73 + @TypeMismatch(message = "申请次数格式有误!")
  74 + private Integer applyCount;
  75 +
  76 + /**
  77 + * 发货数量
  78 + */
  79 + @ApiModelProperty(value = "发货数量", required = true)
  80 + @NotNull(message = "请输入发货数量!")
  81 + @TypeMismatch(message = "发货数量格式有误!")
  82 + @IsNumberPrecision(message = "发货数量最多允许4位小数!", value = 4)
  83 + private BigDecimal quantity;
  84 +
  85 + /**
  86 + * 延迟原因
  87 + */
  88 + @ApiModelProperty(value = "延迟原因", required = true)
  89 + @NotBlank(message = "请输入延迟原因!")
  90 + @Length(message = "延迟原因最多允许500个字符!")
  91 + private String delayReason;
  92 +
  93 +}
... ...
  1 +package com.lframework.xingyun.sc.vo.shipments.delay;
  2 +
  3 +import javax.validation.constraints.NotBlank;
  4 +import java.time.LocalDate;
  5 +import com.lframework.starter.web.core.vo.BaseVo;
  6 +import javax.validation.constraints.NotNull;
  7 +import io.swagger.annotations.ApiModelProperty;
  8 +import com.lframework.starter.web.core.components.validation.TypeMismatch;
  9 +import org.hibernate.validator.constraints.Length;
  10 +import java.io.Serializable;
  11 +import lombok.Data;
  12 +
  13 +@Data
  14 +public class CreateDelayedShipmentVo implements BaseVo, Serializable {
  15 +
  16 + private static final long serialVersionUID = 1L;
  17 +
  18 + /**
  19 + * 所属办ID
  20 + */
  21 + @ApiModelProperty(value = "所属办ID", required = true)
  22 + @NotBlank(message = "请输入所属办ID!")
  23 + @Length(message = "所属办ID最多允许32个字符!")
  24 + private String deptId;
  25 +
  26 + /**
  27 + * 申请日期
  28 + */
  29 + @ApiModelProperty(value = "申请日期", required = true)
  30 + @NotNull(message = "请输入申请日期!")
  31 + @TypeMismatch(message = "申请日期格式有误!")
  32 + private LocalDate applyDate;
  33 +
  34 + /**
  35 + * 审核状态
  36 + */
  37 + @ApiModelProperty(value = "审核状态", required = true)
  38 + @NotBlank(message = "请输入审核状态!")
  39 + @Length(message = "审核状态最多允许20个字符!")
  40 + private String status;
  41 +
  42 +}
... ...
  1 +package com.lframework.xingyun.sc.vo.shipments.delay;
  2 +
  3 +import lombok.Data;
  4 +import com.lframework.starter.web.core.vo.PageVo;
  5 +import com.lframework.starter.web.core.vo.BaseVo;
  6 +import io.swagger.annotations.ApiModelProperty;
  7 +import java.io.Serializable;
  8 +
  9 +@Data
  10 +public class QueryDelayedShipmentDetailVo extends PageVo implements BaseVo, Serializable {
  11 +
  12 + private static final long serialVersionUID = 1L;
  13 +
  14 + /**
  15 + * 延期发货ID
  16 + */
  17 + @ApiModelProperty("延期发货ID")
  18 + private String delayedShipmentId;
  19 +
  20 +}
... ...
  1 +package com.lframework.xingyun.sc.vo.shipments.delay;
  2 +
  3 +import lombok.Data;
  4 +import com.lframework.starter.web.core.vo.PageVo;
  5 +import com.lframework.starter.web.core.vo.BaseVo;
  6 +import io.swagger.annotations.ApiModelProperty;
  7 +import java.io.Serializable;
  8 +
  9 +@Data
  10 +public class QueryDelayedShipmentVo extends PageVo implements BaseVo, Serializable {
  11 +
  12 + private static final long serialVersionUID = 1L;
  13 +
  14 + /**
  15 + * 所属办名称
  16 + */
  17 + @ApiModelProperty("所属办名称")
  18 + private String deptName;
  19 +
  20 + /**
  21 + * 申请日期开始
  22 + */
  23 + @ApiModelProperty("申请日期开始")
  24 + private String applyDateStart;
  25 +
  26 + /**
  27 + * 申请日期结束
  28 + */
  29 + @ApiModelProperty("申请日期结束")
  30 + private String applyDateEnd;
  31 +
  32 + /**
  33 + * 审核状态
  34 + */
  35 + @ApiModelProperty("审核状态")
  36 + private String status;
  37 +
  38 +}
... ...
  1 +package com.lframework.xingyun.sc.vo.shipments.delay;
  2 +
  3 +import lombok.Data;
  4 +import com.lframework.starter.web.core.components.validation.IsNumberPrecision;
  5 +import java.math.BigDecimal;
  6 +import javax.validation.constraints.NotBlank;
  7 +import java.time.LocalDate;
  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;
  11 +import io.swagger.annotations.ApiModelProperty;
  12 +import org.hibernate.validator.constraints.Length;
  13 +import java.io.Serializable;
  14 +
  15 +@Data
  16 +public class UpdateDelayedShipmentDetailVo implements BaseVo, Serializable {
  17 +
  18 + private static final long serialVersionUID = 1L;
  19 +
  20 + /**
  21 + * ID
  22 + */
  23 + @ApiModelProperty(value = "ID", required = true)
  24 + @NotBlank(message = "id不能为空!")
  25 + private String id;
  26 +
  27 + /**
  28 + * 延期发货ID
  29 + */
  30 + @ApiModelProperty(value = "延期发货ID", required = true)
  31 + @NotBlank(message = "请输入延期发货ID!")
  32 + @Length(message = "延期发货ID最多允许32个字符!")
  33 + private String delayedShipmentId;
  34 +
  35 + /**
  36 + * 订货单ID
  37 + */
  38 + @ApiModelProperty(value = "订货单ID", required = true)
  39 + @NotBlank(message = "请输入订货单ID!")
  40 + @Length(message = "订货单ID最多允许32个字符!")
  41 + private String orderId;
  42 +
  43 + /**
  44 + * 发货计划明细ID
  45 + */
  46 + @ApiModelProperty(value = "发货计划明细ID", required = true)
  47 + @NotBlank(message = "请输入发货计划明细ID!")
  48 + @Length(message = "发货计划明细ID最多允许32个字符!")
  49 + private String shipmentsPlanDetailId;
  50 +
  51 + /**
  52 + * 订货单物料行ID
  53 + */
  54 + @ApiModelProperty(value = "订货单物料行ID", required = true)
  55 + @NotBlank(message = "请输入订货单物料行ID!")
  56 + @Length(message = "订货单物料行ID最多允许32个字符!")
  57 + private String orderSpecId;
  58 +
  59 + /**
  60 + * 原订单计划发货日期
  61 + */
  62 + @ApiModelProperty(value = "原订单计划发货日期", required = true)
  63 + @TypeMismatch(message = "原订单计划发货日期格式有误!")
  64 + @NotNull(message = "请输入原订单计划发货日期!")
  65 + private LocalDate deliveryDate;
  66 +
  67 + /**
  68 + * 现申请发货日期
  69 + */
  70 + @ApiModelProperty(value = "现申请发货日期", required = true)
  71 + @TypeMismatch(message = "现申请发货日期格式有误!")
  72 + @NotNull(message = "请输入现申请发货日期!")
  73 + private LocalDate applyShipmentDate;
  74 +
  75 + /**
  76 + * 申请次数
  77 + */
  78 + @ApiModelProperty(value = "申请次数", required = true)
  79 + @TypeMismatch(message = "申请次数格式有误!")
  80 + @NotNull(message = "请输入申请次数!")
  81 + private Integer applyCount;
  82 +
  83 + /**
  84 + * 发货数量
  85 + */
  86 + @ApiModelProperty(value = "发货数量", required = true)
  87 + @TypeMismatch(message = "发货数量格式有误!")
  88 + @NotNull(message = "请输入发货数量!")
  89 + @IsNumberPrecision(message = "发货数量最多允许4位小数!", value = 4)
  90 + private BigDecimal quantity;
  91 +
  92 + /**
  93 + * 延迟原因
  94 + */
  95 + @ApiModelProperty(value = "延迟原因", required = true)
  96 + @NotBlank(message = "请输入延迟原因!")
  97 + @Length(message = "延迟原因最多允许500个字符!")
  98 + private String delayReason;
  99 +
  100 +}
... ...
  1 +package com.lframework.xingyun.sc.vo.shipments.delay;
  2 +
  3 +import lombok.Data;
  4 +import javax.validation.constraints.NotBlank;
  5 +import java.time.LocalDate;
  6 +import com.lframework.starter.web.core.vo.BaseVo;
  7 +import javax.validation.constraints.NotNull;
  8 +import com.lframework.starter.web.core.components.validation.TypeMismatch;
  9 +import io.swagger.annotations.ApiModelProperty;
  10 +import org.hibernate.validator.constraints.Length;
  11 +import java.io.Serializable;
  12 +
  13 +@Data
  14 +public class UpdateDelayedShipmentVo implements BaseVo, Serializable {
  15 +
  16 + private static final long serialVersionUID = 1L;
  17 +
  18 + /**
  19 + * ID
  20 + */
  21 + @ApiModelProperty(value = "ID", required = true)
  22 + @NotBlank(message = "id不能为空!")
  23 + private String id;
  24 +
  25 + /**
  26 + * 所属办ID
  27 + */
  28 + @ApiModelProperty(value = "所属办ID", required = true)
  29 + @NotBlank(message = "请输入所属办ID!")
  30 + @Length(message = "所属办ID最多允许32个字符!")
  31 + private String deptId;
  32 +
  33 + /**
  34 + * 申请日期
  35 + */
  36 + @ApiModelProperty(value = "申请日期", required = true)
  37 + @TypeMismatch(message = "申请日期格式有误!")
  38 + @NotNull(message = "请输入申请日期!")
  39 + private LocalDate applyDate;
  40 +
  41 + /**
  42 + * 审核状态
  43 + */
  44 + @ApiModelProperty(value = "审核状态", required = true)
  45 + @NotBlank(message = "请输入审核状态!")
  46 + @Length(message = "审核状态最多允许20个字符!")
  47 + private String status;
  48 +
  49 +}
... ...
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3 +<mapper namespace="com.lframework.xingyun.sc.mappers.DelayedShipmentDetailMapper">
  4 +
  5 + <resultMap id="DelayedShipmentDetail" type="com.lframework.xingyun.sc.entity.DelayedShipmentDetail">
  6 + <id column="id" property="id"/>
  7 + <result column="delayed_shipment_id" property="delayedShipmentId"/>
  8 + <result column="order_id" property="orderId"/>
  9 + <result column="order_no" property="orderNo"/>
  10 + <result column="order_type" property="orderType"/>
  11 + <result column="workshop_id" property="workshopId"/>
  12 + <result column="workshop_name" property="workshopName"/>
  13 + <result column="customer_id" property="customerId"/>
  14 + <result column="customer_name" property="customerName"/>
  15 + <result column="shipments_plan_detail_id" property="shipmentsPlanDetailId"/>
  16 + <result column="order_spec_id" property="orderSpecId"/>
  17 + <result column="delivery_date" property="deliveryDate"/>
  18 + <result column="apply_shipment_date" property="applyShipmentDate"/>
  19 + <result column="apply_count" property="applyCount"/>
  20 + <result column="quantity" property="quantity"/>
  21 + <result column="delay_reason" property="delayReason"/>
  22 + <result column="create_by_id" property="createById"/>
  23 + <result column="create_by" property="createBy"/>
  24 + <result column="update_by_id" property="updateById"/>
  25 + <result column="update_by" property="updateBy"/>
  26 + <result column="create_time" property="createTime"/>
  27 + <result column="update_time" property="updateTime"/>
  28 + </resultMap>
  29 +
  30 + <sql id="DelayedShipmentDetail_sql">
  31 + SELECT
  32 + tb.id,
  33 + tb.delayed_shipment_id,
  34 + tb.order_id,
  35 + o.order_no,
  36 + s.type AS order_type,
  37 + o.workshop_id,
  38 + ws.name AS workshop_name,
  39 + o.ordering_unit AS customer_id,
  40 + c.name AS customer_name,
  41 + tb.shipments_plan_detail_id,
  42 + tb.order_spec_id,
  43 + tb.delivery_date,
  44 + tb.apply_shipment_date,
  45 + tb.apply_count,
  46 + tb.quantity,
  47 + tb.delay_reason,
  48 + tb.create_by_id,
  49 + tb.create_by,
  50 + tb.update_by_id,
  51 + tb.update_by,
  52 + tb.create_time,
  53 + tb.update_time
  54 + FROM delayed_shipment_detail AS tb
  55 + LEFT JOIN purchase_order_info o ON tb.order_id = o.id
  56 + LEFT JOIN base_data_customer c ON o.ordering_unit = c.id
  57 + LEFT JOIN base_data_workshop ws on ws.id = o.workshop_id
  58 + LEFT JOIN tbl_contract_distributor_standard s on s.id = o.contract_id
  59 + </sql>
  60 +
  61 + <select id="query" resultMap="DelayedShipmentDetail">
  62 + <include refid="DelayedShipmentDetail_sql"/>
  63 + <where>
  64 + <if test="vo.delayedShipmentId != null and vo.delayedShipmentId != ''">
  65 + AND tb.delayed_shipment_id = #{vo.delayedShipmentId}
  66 + </if>
  67 + </where>
  68 + ORDER BY tb.create_time DESC
  69 + </select>
  70 +</mapper>
... ...
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3 +<mapper namespace="com.lframework.xingyun.sc.mappers.DelayedShipmentMapper">
  4 +
  5 + <resultMap id="DelayedShipment" type="com.lframework.xingyun.sc.entity.DelayedShipment">
  6 + <id column="id" property="id"/>
  7 + <result column="apply_date" property="applyDate"/>
  8 + <result column="dept_id" property="deptId"/>
  9 + <result column="dept_name" property="deptName"/>
  10 + <result column="status" property="status"/>
  11 + <result column="create_by_id" property="createById"/>
  12 + <result column="create_by" property="createBy"/>
  13 + <result column="update_by_id" property="updateById"/>
  14 + <result column="update_by" property="updateBy"/>
  15 + <result column="create_time" property="createTime"/>
  16 + <result column="update_time" property="updateTime"/>
  17 + </resultMap>
  18 +
  19 + <sql id="DelayedShipment_sql">
  20 + SELECT
  21 + tb.id,
  22 + tb.apply_date,
  23 + tb.dept_id,
  24 + sd.name AS dept_name,
  25 + tb.status,
  26 + tb.create_by_id,
  27 + tb.create_by,
  28 + tb.update_by_id,
  29 + tb.update_by,
  30 + tb.create_time,
  31 + tb.update_time
  32 + FROM delayed_shipment AS tb
  33 + left join sys_dept as sd on sd.id = tb.dept_id
  34 + </sql>
  35 +
  36 + <select id="query" resultMap="DelayedShipment">
  37 + <include refid="DelayedShipment_sql"/>
  38 + <where>
  39 + <if test="vo.deptName != null and vo.deptName != ''">
  40 + AND sd.name LIKE CONCAT('%', #{vo.deptName},'%')
  41 + </if>
  42 + <if test="vo.applyDateStart != null">
  43 + AND tb.apply_date >= #{vo.applyDateStart}
  44 + </if>
  45 + <if test="vo.applyDateEnd != null">
  46 + <![CDATA[
  47 + AND tb.apply_date <= #{vo.applyDateEnd}
  48 + ]]>
  49 + </if>
  50 + <if test="vo.status != null and vo.status != ''">
  51 + AND tb.status = #{vo.status}
  52 + </if>
  53 + </where>
  54 + ORDER BY tb.create_time DESC
  55 + </select>
  56 +</mapper>
... ...