Showing
14 changed files
with
868 additions
and
7 deletions
xingyun-sc/src/main/java/com/lframework/xingyun/sc/bo/shipments/plan/ShipmentsPlanDetailBo.java
0 → 100644
| 1 | +package com.lframework.xingyun.sc.bo.shipments.plan; | ||
| 2 | + | ||
| 3 | +import com.fasterxml.jackson.annotation.JsonFormat; | ||
| 4 | +import com.lframework.xingyun.sc.entity.ShipmentsPlanDetail; | ||
| 5 | +import com.lframework.starter.common.constants.StringPool; | ||
| 6 | +import com.lframework.starter.web.core.bo.BaseBo; | ||
| 7 | +import java.time.LocalDate; | ||
| 8 | +import java.time.LocalTime; | ||
| 9 | +import java.time.LocalDateTime; | ||
| 10 | + | ||
| 11 | +import io.swagger.annotations.ApiModelProperty; | ||
| 12 | + | ||
| 13 | +import lombok.Data; | ||
| 14 | + | ||
| 15 | +/** | ||
| 16 | + * <p> | ||
| 17 | + * 发货计划明细 GetBo | ||
| 18 | + * </p> | ||
| 19 | + * | ||
| 20 | + */ | ||
| 21 | +@Data | ||
| 22 | +public class ShipmentsPlanDetailBo extends BaseBo<ShipmentsPlanDetail> { | ||
| 23 | + | ||
| 24 | + /** | ||
| 25 | + * ID | ||
| 26 | + */ | ||
| 27 | + @ApiModelProperty("ID") | ||
| 28 | + private String id; | ||
| 29 | + | ||
| 30 | + /** | ||
| 31 | + * 发货计划ID | ||
| 32 | + */ | ||
| 33 | + @ApiModelProperty("发货计划ID") | ||
| 34 | + private String planId; | ||
| 35 | + | ||
| 36 | + /** | ||
| 37 | + * 订货单ID | ||
| 38 | + */ | ||
| 39 | + @ApiModelProperty("订货单ID") | ||
| 40 | + private String orderId; | ||
| 41 | + | ||
| 42 | + /** | ||
| 43 | + * 父类ID | ||
| 44 | + */ | ||
| 45 | + @ApiModelProperty("父类ID") | ||
| 46 | + private String parentId; | ||
| 47 | + | ||
| 48 | + /** | ||
| 49 | + * 状态 | ||
| 50 | + */ | ||
| 51 | + @ApiModelProperty("状态") | ||
| 52 | + private String status; | ||
| 53 | + | ||
| 54 | + /** | ||
| 55 | + * 发货日期 | ||
| 56 | + */ | ||
| 57 | + @ApiModelProperty("发货日期") | ||
| 58 | + @JsonFormat(pattern = StringPool.DATE_PATTERN) | ||
| 59 | + private LocalDate shipmentsDate; | ||
| 60 | + | ||
| 61 | + /** | ||
| 62 | + * 发货时间点 | ||
| 63 | + */ | ||
| 64 | + @ApiModelProperty("发货时间点") | ||
| 65 | + @JsonFormat(pattern = StringPool.TIME_PATTERN) | ||
| 66 | + private LocalTime shipmentsTime; | ||
| 67 | + | ||
| 68 | + /** | ||
| 69 | + * 是否可以发货 | ||
| 70 | + */ | ||
| 71 | + @ApiModelProperty("是否可以发货") | ||
| 72 | + private Boolean canShipments; | ||
| 73 | + | ||
| 74 | + /** | ||
| 75 | + * 创建人ID | ||
| 76 | + */ | ||
| 77 | + @ApiModelProperty("创建人ID") | ||
| 78 | + private String createById; | ||
| 79 | + | ||
| 80 | + /** | ||
| 81 | + * 更新人ID | ||
| 82 | + */ | ||
| 83 | + @ApiModelProperty("更新人ID") | ||
| 84 | + private String updateById; | ||
| 85 | + | ||
| 86 | + /** | ||
| 87 | + * 创建时间 | ||
| 88 | + */ | ||
| 89 | + @ApiModelProperty("创建时间") | ||
| 90 | + @JsonFormat(pattern = StringPool.DATE_TIME_PATTERN) | ||
| 91 | + private LocalDateTime createTime; | ||
| 92 | + | ||
| 93 | + /** | ||
| 94 | + * 更新时间 | ||
| 95 | + */ | ||
| 96 | + @ApiModelProperty("更新时间") | ||
| 97 | + @JsonFormat(pattern = StringPool.DATE_TIME_PATTERN) | ||
| 98 | + private LocalDateTime updateTime; | ||
| 99 | + | ||
| 100 | + public ShipmentsPlanDetailBo() { | ||
| 101 | + | ||
| 102 | + } | ||
| 103 | + | ||
| 104 | + public ShipmentsPlanDetailBo(ShipmentsPlanDetail dto) { | ||
| 105 | + | ||
| 106 | + super(dto); | ||
| 107 | + } | ||
| 108 | + | ||
| 109 | + @Override | ||
| 110 | + public BaseBo<ShipmentsPlanDetail> convert(ShipmentsPlanDetail dto) { | ||
| 111 | + return super.convert(dto); | ||
| 112 | + } | ||
| 113 | + | ||
| 114 | + @Override | ||
| 115 | + protected void afterInit(ShipmentsPlanDetail dto) { | ||
| 116 | + | ||
| 117 | + } | ||
| 118 | +} |
| 1 | +package com.lframework.xingyun.sc.controller.shipments; | ||
| 2 | + | ||
| 3 | +import com.lframework.xingyun.sc.bo.shipments.plan.ShipmentsPlanDetailBo; | ||
| 4 | +import com.lframework.xingyun.sc.entity.ShipmentsPlan; | ||
| 5 | +import com.lframework.xingyun.sc.service.shipments.ShipmentsPlanService; | ||
| 6 | +import com.lframework.xingyun.sc.vo.shipments.plan.QueryShipmentsPlanDetailVo; | ||
| 7 | +import com.lframework.xingyun.sc.service.shipments.ShipmentsPlanDetailService; | ||
| 8 | +import com.lframework.xingyun.sc.vo.shipments.plan.CreateShipmentsPlanDetailVo; | ||
| 9 | +import com.lframework.xingyun.sc.vo.shipments.plan.UpdateShipmentsPlanDetailVo; | ||
| 10 | +import com.lframework.xingyun.sc.entity.ShipmentsPlanDetail; | ||
| 11 | +import com.lframework.starter.web.core.utils.PageResultUtil; | ||
| 12 | +import com.lframework.starter.web.core.components.resp.PageResult; | ||
| 13 | +import com.lframework.starter.web.core.components.resp.InvokeResult; | ||
| 14 | +import javax.validation.constraints.NotBlank; | ||
| 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 com.lframework.starter.web.core.controller.DefaultBaseController; | ||
| 22 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 23 | +import com.lframework.starter.web.core.annotations.security.HasPermission; | ||
| 24 | +import org.springframework.validation.annotation.Validated; | ||
| 25 | +import org.springframework.web.bind.annotation.*; | ||
| 26 | + | ||
| 27 | +import javax.validation.Valid; | ||
| 28 | +import java.util.List; | ||
| 29 | +import java.util.stream.Collectors; | ||
| 30 | + | ||
| 31 | +/** | ||
| 32 | + * 发货计划明细 Controller | ||
| 33 | + * | ||
| 34 | + */ | ||
| 35 | +@Api(tags = "发货计划明细") | ||
| 36 | +@Validated | ||
| 37 | +@RestController | ||
| 38 | +@RequestMapping("/shipments/plan/detail") | ||
| 39 | +public class ShipmentsPlanDetailController extends DefaultBaseController { | ||
| 40 | + | ||
| 41 | + @Autowired | ||
| 42 | + private ShipmentsPlanDetailService shipmentsPlanDetailService; | ||
| 43 | + @Autowired | ||
| 44 | + private ShipmentsPlanService shipmentsPlanService; | ||
| 45 | + | ||
| 46 | + /** | ||
| 47 | + * 查询列表 | ||
| 48 | + */ | ||
| 49 | + @ApiOperation("查询列表") | ||
| 50 | + @HasPermission({"shipments:plan:query"}) | ||
| 51 | + @GetMapping("/query") | ||
| 52 | + public InvokeResult<PageResult<ShipmentsPlanDetailBo>> query(@Valid QueryShipmentsPlanDetailVo vo) { | ||
| 53 | + PageResult<ShipmentsPlanDetail> pageResult = shipmentsPlanDetailService.query(getPageIndex(vo), getPageSize(vo), vo); | ||
| 54 | + List<ShipmentsPlanDetail> dataList = pageResult.getDatas(); | ||
| 55 | + List<ShipmentsPlanDetailBo> results = null; | ||
| 56 | + if (!CollectionUtil.isEmpty(dataList)) { | ||
| 57 | + results = dataList.stream().map(ShipmentsPlanDetailBo::new).collect(Collectors.toList()); | ||
| 58 | + } | ||
| 59 | + return InvokeResultBuilder.success(PageResultUtil.rebuild(pageResult, results)); | ||
| 60 | + } | ||
| 61 | + | ||
| 62 | + /** | ||
| 63 | + * 根据ID查询 | ||
| 64 | + */ | ||
| 65 | + @ApiOperation("根据ID查询") | ||
| 66 | + @ApiImplicitParam(value = "id", name = "id", paramType = "query", required = true) | ||
| 67 | + @HasPermission({"shipments:plan:query"}) | ||
| 68 | + @GetMapping | ||
| 69 | + public InvokeResult<ShipmentsPlanDetailBo> get(@NotBlank(message = "id不能为空!") String id) { | ||
| 70 | + ShipmentsPlanDetail data = shipmentsPlanDetailService.findById(id); | ||
| 71 | + if (data == null) { | ||
| 72 | + throw new DefaultClientException("发货计划明细不存在!"); | ||
| 73 | + } | ||
| 74 | + ShipmentsPlanDetailBo result = new ShipmentsPlanDetailBo(data); | ||
| 75 | + | ||
| 76 | + return InvokeResultBuilder.success(result); | ||
| 77 | + } | ||
| 78 | + | ||
| 79 | + /** | ||
| 80 | + * 新增 | ||
| 81 | + */ | ||
| 82 | + @ApiOperation("新增") | ||
| 83 | + @HasPermission({"shipments:plan:add"}) | ||
| 84 | + @PostMapping | ||
| 85 | + public InvokeResult<Void> batchAdd(@Valid @RequestBody CreateShipmentsPlanDetailVo vo) { | ||
| 86 | + shipmentsPlanDetailService.create(vo); | ||
| 87 | + return InvokeResultBuilder.success(); | ||
| 88 | + } | ||
| 89 | + | ||
| 90 | + /** | ||
| 91 | + * 修改 | ||
| 92 | + */ | ||
| 93 | + @ApiOperation("修改") | ||
| 94 | + @HasPermission({"shipments:plan:modify"}) | ||
| 95 | + @PutMapping | ||
| 96 | + public InvokeResult<Void> update(@Valid UpdateShipmentsPlanDetailVo vo) { | ||
| 97 | + shipmentsPlanDetailService.update(vo); | ||
| 98 | + return InvokeResultBuilder.success(); | ||
| 99 | + } | ||
| 100 | +} |
| @@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.annotation.TableName; | @@ -4,6 +4,8 @@ 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 | import java.time.LocalDate; | 5 | import java.time.LocalDate; |
| 6 | import java.time.LocalDateTime; | 6 | import java.time.LocalDateTime; |
| 7 | +import java.util.List; | ||
| 8 | + | ||
| 7 | import com.baomidou.mybatisplus.annotation.FieldFill; | 9 | import com.baomidou.mybatisplus.annotation.FieldFill; |
| 8 | import com.lframework.starter.web.core.entity.BaseEntity; | 10 | import com.lframework.starter.web.core.entity.BaseEntity; |
| 9 | import com.baomidou.mybatisplus.annotation.TableField; | 11 | import com.baomidou.mybatisplus.annotation.TableField; |
| @@ -32,6 +34,8 @@ public class ShipmentsPlan extends BaseEntity implements BaseDto { | @@ -32,6 +34,8 @@ public class ShipmentsPlan extends BaseEntity implements BaseDto { | ||
| 32 | * 生产厂ID | 34 | * 生产厂ID |
| 33 | */ | 35 | */ |
| 34 | private String workshopId; | 36 | private String workshopId; |
| 37 | + @TableField(exist = false) | ||
| 38 | + private String workshopName; | ||
| 35 | 39 | ||
| 36 | /** | 40 | /** |
| 37 | * 状态 | 41 | * 状态 |
| @@ -72,4 +76,17 @@ public class ShipmentsPlan extends BaseEntity implements BaseDto { | @@ -72,4 +76,17 @@ public class ShipmentsPlan extends BaseEntity implements BaseDto { | ||
| 72 | @TableField(fill = FieldFill.INSERT_UPDATE) | 76 | @TableField(fill = FieldFill.INSERT_UPDATE) |
| 73 | private LocalDateTime updateTime; | 77 | private LocalDateTime updateTime; |
| 74 | 78 | ||
| 79 | + /** | ||
| 80 | + * 明天发货计划明细 | ||
| 81 | + * 非持久化字段 | ||
| 82 | + */ | ||
| 83 | + @TableField(exist = false) | ||
| 84 | + List<ShipmentsPlanDetail> tomoPlanList; | ||
| 85 | + | ||
| 86 | + /** | ||
| 87 | + * 后天发货计划明细 | ||
| 88 | + * 非持久化字段 | ||
| 89 | + */ | ||
| 90 | + @TableField(exist = false) | ||
| 91 | + List<ShipmentsPlanDetail> afTomoPlanList; | ||
| 75 | } | 92 | } |
| 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 | + | ||
| 6 | +import java.math.BigDecimal; | ||
| 7 | +import java.time.LocalDate; | ||
| 8 | +import java.time.LocalTime; | ||
| 9 | +import java.time.LocalDateTime; | ||
| 10 | +import com.baomidou.mybatisplus.annotation.FieldFill; | ||
| 11 | +import com.lframework.starter.web.core.entity.BaseEntity; | ||
| 12 | +import com.baomidou.mybatisplus.annotation.TableField; | ||
| 13 | +import lombok.Data; | ||
| 14 | + | ||
| 15 | +/** | ||
| 16 | + * <p> | ||
| 17 | + * 发货计划明细 | ||
| 18 | + * </p> | ||
| 19 | + * | ||
| 20 | + */ | ||
| 21 | +@Data | ||
| 22 | +@TableName("shipments_plan_detail") | ||
| 23 | +public class ShipmentsPlanDetail extends BaseEntity implements BaseDto { | ||
| 24 | + | ||
| 25 | + private static final long serialVersionUID = 1L; | ||
| 26 | + | ||
| 27 | + public static final String CACHE_NAME = "ShipmentsPlanDetail"; | ||
| 28 | + | ||
| 29 | + /** | ||
| 30 | + * ID | ||
| 31 | + */ | ||
| 32 | + private String id; | ||
| 33 | + | ||
| 34 | + /** | ||
| 35 | + * 发货计划ID | ||
| 36 | + */ | ||
| 37 | + private String planId; | ||
| 38 | + | ||
| 39 | + /** | ||
| 40 | + * 订货单ID | ||
| 41 | + */ | ||
| 42 | + private String orderId; | ||
| 43 | + | ||
| 44 | + /** | ||
| 45 | + * 订单编号 | ||
| 46 | + */ | ||
| 47 | + @TableField(exist = false) | ||
| 48 | + private String orderNo; | ||
| 49 | + | ||
| 50 | + /** | ||
| 51 | + * 客户名称 | ||
| 52 | + */ | ||
| 53 | + @TableField(exist = false) | ||
| 54 | + private String customerName; | ||
| 55 | + | ||
| 56 | + /** | ||
| 57 | + * 厚度 | ||
| 58 | + */ | ||
| 59 | + @TableField(exist = false) | ||
| 60 | + private BigDecimal thickness; | ||
| 61 | + | ||
| 62 | + /** | ||
| 63 | + * 厚度公差正 | ||
| 64 | + */ | ||
| 65 | + @TableField(exist = false) | ||
| 66 | + private BigDecimal thicknessTolPos; | ||
| 67 | + | ||
| 68 | + /** | ||
| 69 | + * 厚度公差负 | ||
| 70 | + */ | ||
| 71 | + @TableField(exist = false) | ||
| 72 | + private BigDecimal thicknessTolNeg; | ||
| 73 | + | ||
| 74 | + /** | ||
| 75 | + * 宽度 | ||
| 76 | + */ | ||
| 77 | + @TableField(exist = false) | ||
| 78 | + private BigDecimal width; | ||
| 79 | + | ||
| 80 | + /** | ||
| 81 | + * 宽度公差正 | ||
| 82 | + */ | ||
| 83 | + @TableField(exist = false) | ||
| 84 | + private BigDecimal widthTolPos; | ||
| 85 | + | ||
| 86 | + /** | ||
| 87 | + * 宽度公差负 | ||
| 88 | + */ | ||
| 89 | + @TableField(exist = false) | ||
| 90 | + private BigDecimal widthTolNeg; | ||
| 91 | + | ||
| 92 | + /** | ||
| 93 | + * 长度 | ||
| 94 | + */ | ||
| 95 | + @TableField(exist = false) | ||
| 96 | + private BigDecimal length; | ||
| 97 | + | ||
| 98 | + /** | ||
| 99 | + * 长度公差正 | ||
| 100 | + */ | ||
| 101 | + @TableField(exist = false) | ||
| 102 | + private BigDecimal lengthTolPos; | ||
| 103 | + | ||
| 104 | + /** | ||
| 105 | + * 长度公差负 | ||
| 106 | + */ | ||
| 107 | + @TableField(exist = false) | ||
| 108 | + private BigDecimal lengthTolNeg; | ||
| 109 | + | ||
| 110 | + /** | ||
| 111 | + * 计划吨位 | ||
| 112 | + */ | ||
| 113 | + @TableField(exist = false) | ||
| 114 | + private BigDecimal quantity; | ||
| 115 | + | ||
| 116 | + /** | ||
| 117 | + * 父类ID | ||
| 118 | + */ | ||
| 119 | + private String parentId; | ||
| 120 | + | ||
| 121 | + /** | ||
| 122 | + * 状态 | ||
| 123 | + */ | ||
| 124 | + private String status; | ||
| 125 | + | ||
| 126 | + /** | ||
| 127 | + * 发货日期 | ||
| 128 | + */ | ||
| 129 | + private LocalDate shipmentsDate; | ||
| 130 | + | ||
| 131 | + /** | ||
| 132 | + * 发货时间点 | ||
| 133 | + */ | ||
| 134 | + private LocalTime shipmentsTime; | ||
| 135 | + | ||
| 136 | + /** | ||
| 137 | + * 是否可以发货 | ||
| 138 | + */ | ||
| 139 | + private Boolean canShipments; | ||
| 140 | + | ||
| 141 | + /** | ||
| 142 | + * 是否删除 | ||
| 143 | + */ | ||
| 144 | + private Boolean delFlag; | ||
| 145 | + | ||
| 146 | + /** | ||
| 147 | + * 创建人ID | ||
| 148 | + */ | ||
| 149 | + @TableField(fill = FieldFill.INSERT) | ||
| 150 | + private String createById; | ||
| 151 | + | ||
| 152 | + /** | ||
| 153 | + * 更新人ID | ||
| 154 | + */ | ||
| 155 | + @TableField(fill = FieldFill.INSERT_UPDATE) | ||
| 156 | + private String updateById; | ||
| 157 | + | ||
| 158 | + /** | ||
| 159 | + * 创建时间 | ||
| 160 | + */ | ||
| 161 | + @TableField(fill = FieldFill.INSERT) | ||
| 162 | + private LocalDateTime createTime; | ||
| 163 | + | ||
| 164 | + /** | ||
| 165 | + * 更新时间 | ||
| 166 | + */ | ||
| 167 | + @TableField(fill = FieldFill.INSERT_UPDATE) | ||
| 168 | + private LocalDateTime updateTime; | ||
| 169 | + | ||
| 170 | +} |
| 1 | +package com.lframework.xingyun.sc.impl.shipments; | ||
| 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.xingyun.sc.entity.PurchaseOrderInfo; | ||
| 7 | +import com.lframework.xingyun.sc.entity.ShipmentsPlanDetail; | ||
| 8 | +import com.lframework.starter.web.core.impl.BaseMpServiceImpl; | ||
| 9 | +import com.lframework.starter.web.core.utils.PageResultUtil; | ||
| 10 | +import com.lframework.starter.web.core.components.resp.PageResult; | ||
| 11 | +import com.lframework.starter.web.core.utils.OpLogUtil; | ||
| 12 | +import com.lframework.starter.common.exceptions.impl.DefaultClientException; | ||
| 13 | +import com.lframework.starter.web.core.utils.IdUtil; | ||
| 14 | +import com.lframework.starter.common.utils.ObjectUtil; | ||
| 15 | +import com.lframework.starter.web.core.annotations.oplog.OpLog; | ||
| 16 | +import com.lframework.starter.web.core.utils.PageHelperUtil; | ||
| 17 | +import com.lframework.starter.common.utils.Assert; | ||
| 18 | +import com.lframework.starter.web.inner.components.oplog.OtherOpLogType; | ||
| 19 | +import com.lframework.xingyun.sc.mappers.ShipmentsPlanDetailMapper; | ||
| 20 | +import com.lframework.xingyun.sc.service.order.PurchaseOrderInfoService; | ||
| 21 | +import com.lframework.xingyun.sc.service.shipments.ShipmentsPlanDetailService; | ||
| 22 | +import com.lframework.xingyun.sc.vo.shipments.plan.CreateShipmentsPlanDetailVo; | ||
| 23 | +import com.lframework.xingyun.sc.vo.shipments.plan.QueryShipmentsPlanDetailVo; | ||
| 24 | +import com.lframework.xingyun.sc.vo.shipments.plan.UpdateShipmentsPlanDetailVo; | ||
| 25 | +import org.apache.commons.collections4.CollectionUtils; | ||
| 26 | +import org.springframework.data.redis.core.RedisHash; | ||
| 27 | +import org.springframework.stereotype.Service; | ||
| 28 | +import org.springframework.transaction.annotation.Transactional; | ||
| 29 | + | ||
| 30 | +import javax.annotation.Resource; | ||
| 31 | +import java.util.ArrayList; | ||
| 32 | +import java.util.List; | ||
| 33 | + | ||
| 34 | +@Service | ||
| 35 | +public class ShipmentsPlanDetailServiceImpl extends BaseMpServiceImpl<ShipmentsPlanDetailMapper, ShipmentsPlanDetail> implements ShipmentsPlanDetailService { | ||
| 36 | + | ||
| 37 | + | ||
| 38 | + @Resource | ||
| 39 | + private PurchaseOrderInfoService purchaseOrderInfoService; | ||
| 40 | + | ||
| 41 | + @Override | ||
| 42 | + public PageResult<ShipmentsPlanDetail> query(Integer pageIndex, Integer pageSize, QueryShipmentsPlanDetailVo vo) { | ||
| 43 | + | ||
| 44 | + Assert.greaterThanZero(pageIndex); | ||
| 45 | + Assert.greaterThanZero(pageSize); | ||
| 46 | + | ||
| 47 | + PageHelperUtil.startPage(pageIndex, pageSize); | ||
| 48 | + List<ShipmentsPlanDetail> dataList = this.query(vo); | ||
| 49 | + | ||
| 50 | + return PageResultUtil.convert(new PageInfo<>(dataList)); | ||
| 51 | + } | ||
| 52 | + | ||
| 53 | + @Override | ||
| 54 | + public List<ShipmentsPlanDetail> query(QueryShipmentsPlanDetailVo vo) { | ||
| 55 | + | ||
| 56 | + return getBaseMapper().query(vo); | ||
| 57 | + } | ||
| 58 | + | ||
| 59 | + @Override | ||
| 60 | + public ShipmentsPlanDetail findById(String id) { | ||
| 61 | + | ||
| 62 | + return getBaseMapper().selectById(id); | ||
| 63 | + } | ||
| 64 | + | ||
| 65 | + @OpLog(type = OtherOpLogType.class, name = "新增发货计划明细,ID:{}", params = {"#id"}) | ||
| 66 | + @Transactional(rollbackFor = Exception.class) | ||
| 67 | + @Override | ||
| 68 | + public void create(CreateShipmentsPlanDetailVo vo) { | ||
| 69 | + List<String> orderIds = vo.getOrderIds(); | ||
| 70 | + if (CollectionUtils.isEmpty(orderIds)) { | ||
| 71 | + throw new DefaultClientException("订货单ID不能为空!"); | ||
| 72 | + } | ||
| 73 | + List<ShipmentsPlanDetail> detailList = new ArrayList<>(); | ||
| 74 | + for (String orderId : orderIds) { | ||
| 75 | + ShipmentsPlanDetail data = new ShipmentsPlanDetail(); | ||
| 76 | + data.setId(IdUtil.getId()); | ||
| 77 | + data.setPlanId(vo.getPlanId()); | ||
| 78 | + data.setOrderId(orderId); | ||
| 79 | + data.setShipmentsDate(vo.getShipmentDate()); | ||
| 80 | + | ||
| 81 | + detailList.add(data); | ||
| 82 | + } | ||
| 83 | + | ||
| 84 | + } | ||
| 85 | + | ||
| 86 | + @OpLog(type = OtherOpLogType.class, name = "修改发货计划明细,ID:{}", params = {"#id"}) | ||
| 87 | + @Transactional(rollbackFor = Exception.class) | ||
| 88 | + @Override | ||
| 89 | + public void update(UpdateShipmentsPlanDetailVo vo) { | ||
| 90 | + | ||
| 91 | + ShipmentsPlanDetail data = getBaseMapper().selectById(vo.getId()); | ||
| 92 | + if (ObjectUtil.isNull(data)) { | ||
| 93 | + throw new DefaultClientException("发货计划明细不存在!"); | ||
| 94 | + } | ||
| 95 | + | ||
| 96 | + LambdaUpdateWrapper<ShipmentsPlanDetail> updateWrapper = Wrappers.lambdaUpdate(ShipmentsPlanDetail.class) | ||
| 97 | + .set(ShipmentsPlanDetail::getShipmentsTime, vo.getShipmentsTime()) | ||
| 98 | + .set(ShipmentsPlanDetail::getCanShipments, vo.getCanShipments()) | ||
| 99 | + .eq(ShipmentsPlanDetail::getId, vo.getId()); | ||
| 100 | + | ||
| 101 | + getBaseMapper().update(updateWrapper); | ||
| 102 | + | ||
| 103 | + OpLogUtil.setVariable("id", data.getId()); | ||
| 104 | + OpLogUtil.setExtra(vo); | ||
| 105 | + } | ||
| 106 | +} |
| @@ -15,6 +15,10 @@ import com.lframework.starter.web.core.annotations.oplog.OpLog; | @@ -15,6 +15,10 @@ import com.lframework.starter.web.core.annotations.oplog.OpLog; | ||
| 15 | import com.lframework.starter.web.core.utils.PageHelperUtil; | 15 | import com.lframework.starter.web.core.utils.PageHelperUtil; |
| 16 | import com.lframework.starter.common.utils.Assert; | 16 | import com.lframework.starter.common.utils.Assert; |
| 17 | import com.lframework.starter.web.inner.components.oplog.OtherOpLogType; | 17 | import com.lframework.starter.web.inner.components.oplog.OtherOpLogType; |
| 18 | +import com.lframework.xingyun.sc.entity.ShipmentsPlanDetail; | ||
| 19 | +import com.lframework.xingyun.sc.service.shipments.ShipmentsPlanDetailService; | ||
| 20 | +import com.lframework.xingyun.sc.vo.shipments.plan.QueryShipmentsPlanDetailVo; | ||
| 21 | +import org.apache.commons.collections4.CollectionUtils; | ||
| 18 | import org.springframework.transaction.annotation.Transactional; | 22 | import org.springframework.transaction.annotation.Transactional; |
| 19 | import com.lframework.xingyun.sc.mappers.ShipmentsPlanMapper; | 23 | import com.lframework.xingyun.sc.mappers.ShipmentsPlanMapper; |
| 20 | import com.lframework.xingyun.sc.service.shipments.ShipmentsPlanService; | 24 | import com.lframework.xingyun.sc.service.shipments.ShipmentsPlanService; |
| @@ -23,12 +27,18 @@ import com.lframework.xingyun.sc.vo.shipments.plan.QueryShipmentsPlanVo; | @@ -23,12 +27,18 @@ import com.lframework.xingyun.sc.vo.shipments.plan.QueryShipmentsPlanVo; | ||
| 23 | import com.lframework.xingyun.sc.vo.shipments.plan.UpdateShipmentsPlanVo; | 27 | import com.lframework.xingyun.sc.vo.shipments.plan.UpdateShipmentsPlanVo; |
| 24 | import org.springframework.stereotype.Service; | 28 | import org.springframework.stereotype.Service; |
| 25 | 29 | ||
| 30 | +import javax.annotation.Resource; | ||
| 31 | +import java.time.LocalDate; | ||
| 32 | +import java.util.ArrayList; | ||
| 26 | import java.util.List; | 33 | import java.util.List; |
| 27 | 34 | ||
| 28 | @Service | 35 | @Service |
| 29 | public class ShipmentsPlanServiceImpl extends BaseMpServiceImpl<ShipmentsPlanMapper, ShipmentsPlan> implements ShipmentsPlanService { | 36 | public class ShipmentsPlanServiceImpl extends BaseMpServiceImpl<ShipmentsPlanMapper, ShipmentsPlan> implements ShipmentsPlanService { |
| 30 | 37 | ||
| 31 | 38 | ||
| 39 | + @Resource | ||
| 40 | + private ShipmentsPlanDetailService shipmentsPlanDetailService;; | ||
| 41 | + | ||
| 32 | 42 | ||
| 33 | @Override | 43 | @Override |
| 34 | public PageResult<ShipmentsPlan> query(Integer pageIndex, Integer pageSize, QueryShipmentsPlanVo vo) { | 44 | public PageResult<ShipmentsPlan> query(Integer pageIndex, Integer pageSize, QueryShipmentsPlanVo vo) { |
| @@ -48,7 +58,38 @@ public class ShipmentsPlanServiceImpl extends BaseMpServiceImpl<ShipmentsPlanMap | @@ -48,7 +58,38 @@ public class ShipmentsPlanServiceImpl extends BaseMpServiceImpl<ShipmentsPlanMap | ||
| 48 | 58 | ||
| 49 | @Override | 59 | @Override |
| 50 | public ShipmentsPlan findById(String id) { | 60 | public ShipmentsPlan findById(String id) { |
| 51 | - return getBaseMapper().selectById(id); | 61 | + ShipmentsPlan plan = getBaseMapper().getById(id); |
| 62 | + if (plan == null) { | ||
| 63 | + throw new DefaultClientException("发货计划不存在!"); | ||
| 64 | + } | ||
| 65 | + // 获取计划明细 | ||
| 66 | + QueryShipmentsPlanDetailVo detailVo = new QueryShipmentsPlanDetailVo(); | ||
| 67 | + detailVo.setPlanId(plan.getId()); | ||
| 68 | + // 发货日期 | ||
| 69 | + List<LocalDate> dateList = new ArrayList<>(); | ||
| 70 | + dateList.add(plan.getTomoPreShipDate()); | ||
| 71 | + dateList.add(plan.getAfTomoPreShipDate()); | ||
| 72 | + detailVo.setShipmentsDateList(dateList); | ||
| 73 | + | ||
| 74 | + List<ShipmentsPlanDetail> detailList = shipmentsPlanDetailService.query(detailVo); | ||
| 75 | + if (CollectionUtils.isEmpty(detailList)) { | ||
| 76 | + return plan; | ||
| 77 | + } | ||
| 78 | + // 根据日期分组 | ||
| 79 | + List<ShipmentsPlanDetail> tomorrowPlans = new ArrayList<>(); | ||
| 80 | + List<ShipmentsPlanDetail> afterTomorrowPlans = new ArrayList<>(); | ||
| 81 | + for (ShipmentsPlanDetail detail : detailList) { | ||
| 82 | + LocalDate shipmentsDate = detail.getShipmentsDate(); | ||
| 83 | + if (shipmentsDate.equals(plan.getTomoPreShipDate())) { | ||
| 84 | + tomorrowPlans.add(detail); | ||
| 85 | + } else if (shipmentsDate.equals(plan.getAfTomoPreShipDate())) { | ||
| 86 | + afterTomorrowPlans.add(detail); | ||
| 87 | + } | ||
| 88 | + } | ||
| 89 | + plan.setTomoPlanList(tomorrowPlans); | ||
| 90 | + plan.setAfTomoPlanList(afterTomorrowPlans); | ||
| 91 | + | ||
| 92 | + return plan; | ||
| 52 | } | 93 | } |
| 53 | 94 | ||
| 54 | @OpLog(type = OtherOpLogType.class, name = "新增发货计划,ID:{}", params = {"#id"}) | 95 | @OpLog(type = OtherOpLogType.class, name = "新增发货计划,ID:{}", params = {"#id"}) |
xingyun-sc/src/main/java/com/lframework/xingyun/sc/mappers/ShipmentsPlanDetailMapper.java
0 → 100644
| 1 | +package com.lframework.xingyun.sc.mappers; | ||
| 2 | + | ||
| 3 | +import com.lframework.xingyun.sc.entity.ShipmentsPlanDetail; | ||
| 4 | +import com.lframework.starter.web.core.mapper.BaseMapper; | ||
| 5 | +import com.lframework.xingyun.sc.vo.shipments.plan.QueryShipmentsPlanDetailVo; | ||
| 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 ShipmentsPlanDetailMapper extends BaseMapper<ShipmentsPlanDetail> { | ||
| 17 | + | ||
| 18 | + /** | ||
| 19 | + * 查询列表 | ||
| 20 | + * | ||
| 21 | + * @param vo 查询条件 | ||
| 22 | + * @return List<ShipmentsPlanDetail> | ||
| 23 | + */ | ||
| 24 | + List<ShipmentsPlanDetail> query(@Param("vo") QueryShipmentsPlanDetailVo vo); | ||
| 25 | +} |
| 1 | package com.lframework.xingyun.sc.mappers; | 1 | package com.lframework.xingyun.sc.mappers; |
| 2 | 2 | ||
| 3 | import com.lframework.xingyun.sc.entity.ShipmentsPlan; | 3 | import com.lframework.xingyun.sc.entity.ShipmentsPlan; |
| 4 | -import com.lframework.starter.web.core.vo.PageVo; | ||
| 5 | import com.lframework.starter.web.core.mapper.BaseMapper; | 4 | import com.lframework.starter.web.core.mapper.BaseMapper; |
| 6 | -import com.lframework.starter.web.core.vo.BaseVo; | ||
| 7 | -import com.lframework.starter.web.core.components.validation.TypeMismatch; | ||
| 8 | -import io.swagger.annotations.ApiModelProperty; | ||
| 9 | import com.lframework.xingyun.sc.vo.shipments.plan.QueryShipmentsPlanVo; | 5 | import com.lframework.xingyun.sc.vo.shipments.plan.QueryShipmentsPlanVo; |
| 10 | import org.apache.ibatis.annotations.Param; | 6 | import org.apache.ibatis.annotations.Param; |
| 11 | 7 | ||
| @@ -21,8 +17,17 @@ public interface ShipmentsPlanMapper extends BaseMapper<ShipmentsPlan> { | @@ -21,8 +17,17 @@ public interface ShipmentsPlanMapper extends BaseMapper<ShipmentsPlan> { | ||
| 21 | 17 | ||
| 22 | /** | 18 | /** |
| 23 | * 查询列表 | 19 | * 查询列表 |
| 24 | - * @param vo | ||
| 25 | - * @return | 20 | + * |
| 21 | + * @param vo 查询条件 | ||
| 22 | + * @return List<ShipmentsPlan> | ||
| 26 | */ | 23 | */ |
| 27 | List<ShipmentsPlan> query(@Param("vo") QueryShipmentsPlanVo vo); | 24 | List<ShipmentsPlan> query(@Param("vo") QueryShipmentsPlanVo vo); |
| 25 | + | ||
| 26 | + /** | ||
| 27 | + * 查询列表 | ||
| 28 | + * | ||
| 29 | + * @param id 查询条件 | ||
| 30 | + * @return ShipmentsPlan | ||
| 31 | + */ | ||
| 32 | + ShipmentsPlan getById(@Param("id") String id); | ||
| 28 | } | 33 | } |
xingyun-sc/src/main/java/com/lframework/xingyun/sc/service/shipments/ShipmentsPlanDetailService.java
0 → 100644
| 1 | +package com.lframework.xingyun.sc.service.shipments; | ||
| 2 | + | ||
| 3 | +import com.lframework.xingyun.sc.vo.shipments.plan.CreateShipmentsPlanDetailVo; | ||
| 4 | +import com.lframework.xingyun.sc.vo.shipments.plan.QueryShipmentsPlanDetailVo; | ||
| 5 | +import com.lframework.xingyun.sc.vo.shipments.plan.UpdateShipmentsPlanDetailVo; | ||
| 6 | +import com.lframework.xingyun.sc.entity.ShipmentsPlanDetail; | ||
| 7 | +import com.lframework.starter.web.core.impl.BaseMpServiceImpl; | ||
| 8 | +import com.lframework.starter.web.core.utils.PageResultUtil; | ||
| 9 | +import com.lframework.starter.web.core.service.BaseMpService; | ||
| 10 | +import com.lframework.starter.web.core.components.resp.PageResult; | ||
| 11 | +import javax.validation.constraints.NotBlank; | ||
| 12 | +import com.lframework.starter.web.core.vo.PageVo; | ||
| 13 | +import com.lframework.starter.web.core.utils.OpLogUtil; | ||
| 14 | +import com.lframework.starter.common.utils.StringUtil; | ||
| 15 | +import com.lframework.starter.web.core.vo.BaseVo; | ||
| 16 | +import javax.validation.constraints.NotNull; | ||
| 17 | +import com.lframework.starter.web.core.components.validation.TypeMismatch; | ||
| 18 | +import com.lframework.starter.common.exceptions.impl.DefaultClientException; | ||
| 19 | +import java.time.LocalDate; | ||
| 20 | +import com.lframework.starter.web.core.utils.EnumUtil; | ||
| 21 | +import com.lframework.starter.web.core.utils.IdUtil; | ||
| 22 | +import java.time.LocalTime; | ||
| 23 | +import com.lframework.starter.common.utils.ObjectUtil; | ||
| 24 | +import com.lframework.starter.web.core.annotations.oplog.OpLog; | ||
| 25 | +import com.lframework.starter.web.core.utils.PageHelperUtil; | ||
| 26 | +import com.lframework.starter.common.utils.Assert; | ||
| 27 | +import com.lframework.starter.web.inner.components.oplog.OtherOpLogType; | ||
| 28 | +import io.swagger.annotations.ApiModelProperty; | ||
| 29 | +import org.hibernate.validator.constraints.Length; | ||
| 30 | +import java.util.Collection; | ||
| 31 | +import java.util.List; | ||
| 32 | + | ||
| 33 | +/** | ||
| 34 | + * 发货计划明细 Service | ||
| 35 | + */ | ||
| 36 | +public interface ShipmentsPlanDetailService extends BaseMpService<ShipmentsPlanDetail> { | ||
| 37 | + | ||
| 38 | + /** | ||
| 39 | + * 查询列表 | ||
| 40 | + * | ||
| 41 | + * @param vo 查询条件 | ||
| 42 | + * @return PageResult<ShipmentsPlanDetail> | ||
| 43 | + */ | ||
| 44 | + PageResult<ShipmentsPlanDetail> query(Integer pageIndex, Integer pageSize, QueryShipmentsPlanDetailVo vo); | ||
| 45 | + | ||
| 46 | + /** | ||
| 47 | + * 查询列表 | ||
| 48 | + * | ||
| 49 | + * @param vo 查询条件 | ||
| 50 | + * @return List<ShipmentsPlanDetail> | ||
| 51 | + */ | ||
| 52 | + List<ShipmentsPlanDetail> query(QueryShipmentsPlanDetailVo vo); | ||
| 53 | + | ||
| 54 | + /** | ||
| 55 | + * 根据ID查询 | ||
| 56 | + * | ||
| 57 | + * @param id 主键ID | ||
| 58 | + * @return ShipmentsPlanDetail | ||
| 59 | + */ | ||
| 60 | + ShipmentsPlanDetail findById(String id); | ||
| 61 | + | ||
| 62 | + /** | ||
| 63 | + * 创建 | ||
| 64 | + * | ||
| 65 | + * @param vo 数据实体 | ||
| 66 | + */ | ||
| 67 | + void create(CreateShipmentsPlanDetailVo vo); | ||
| 68 | + | ||
| 69 | + /** | ||
| 70 | + * 修改 | ||
| 71 | + * | ||
| 72 | + * @param vo 数据实体 | ||
| 73 | + */ | ||
| 74 | + void update(UpdateShipmentsPlanDetailVo vo); | ||
| 75 | + | ||
| 76 | +} |
| 1 | +package com.lframework.xingyun.sc.vo.shipments.plan; | ||
| 2 | + | ||
| 3 | +import javax.validation.constraints.NotBlank; | ||
| 4 | +import com.lframework.starter.web.core.vo.BaseVo; | ||
| 5 | + | ||
| 6 | +import javax.validation.constraints.NotEmpty; | ||
| 7 | +import io.swagger.annotations.ApiModelProperty; | ||
| 8 | +import org.hibernate.validator.constraints.Length; | ||
| 9 | +import java.io.Serializable; | ||
| 10 | +import java.time.LocalDate; | ||
| 11 | +import java.util.List; | ||
| 12 | + | ||
| 13 | +import lombok.Data; | ||
| 14 | + | ||
| 15 | +@Data | ||
| 16 | +public class CreateShipmentsPlanDetailVo 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 planId; | ||
| 27 | + | ||
| 28 | + /** | ||
| 29 | + * 订货单ID集合 | ||
| 30 | + */ | ||
| 31 | + @ApiModelProperty(value = "订货单ID", required = true) | ||
| 32 | + @NotEmpty(message = "请输入订货单ID!") | ||
| 33 | + private List<String> orderIds; | ||
| 34 | + | ||
| 35 | + /** | ||
| 36 | + * 发货日期 | ||
| 37 | + */ | ||
| 38 | + @ApiModelProperty(value = "发货日期") | ||
| 39 | + private LocalDate shipmentDate; | ||
| 40 | +} |
xingyun-sc/src/main/java/com/lframework/xingyun/sc/vo/shipments/plan/QueryShipmentsPlanDetailVo.java
0 → 100644
| 1 | +package com.lframework.xingyun.sc.vo.shipments.plan; | ||
| 2 | + | ||
| 3 | +import lombok.Data; | ||
| 4 | +import com.lframework.starter.web.core.vo.PageVo; | ||
| 5 | +import java.time.LocalDate; | ||
| 6 | +import com.lframework.starter.web.core.vo.BaseVo; | ||
| 7 | +import com.lframework.starter.web.core.components.validation.TypeMismatch; | ||
| 8 | +import io.swagger.annotations.ApiModelProperty; | ||
| 9 | +import java.io.Serializable; | ||
| 10 | +import java.util.List; | ||
| 11 | + | ||
| 12 | +@Data | ||
| 13 | +public class QueryShipmentsPlanDetailVo extends PageVo implements BaseVo, Serializable { | ||
| 14 | + | ||
| 15 | + private static final long serialVersionUID = 1L; | ||
| 16 | + | ||
| 17 | + /** | ||
| 18 | + * 发货计划ID | ||
| 19 | + */ | ||
| 20 | + @ApiModelProperty("发货计划ID") | ||
| 21 | + private String planId; | ||
| 22 | + | ||
| 23 | + /** | ||
| 24 | + * 发货日期 | ||
| 25 | + */ | ||
| 26 | + @ApiModelProperty("发货日期") | ||
| 27 | + @TypeMismatch(message = "发货日期格式有误!") | ||
| 28 | + private LocalDate shipmentsDate; | ||
| 29 | + | ||
| 30 | + /** | ||
| 31 | + * 发货日期 | ||
| 32 | + */ | ||
| 33 | + @ApiModelProperty("发货日期") | ||
| 34 | + @TypeMismatch(message = "发货日期格式有误!") | ||
| 35 | + private List<LocalDate> shipmentsDateList; | ||
| 36 | +} |
| 1 | +package com.lframework.xingyun.sc.vo.shipments.plan; | ||
| 2 | + | ||
| 3 | +import lombok.Data; | ||
| 4 | +import javax.validation.constraints.NotBlank; | ||
| 5 | +import java.time.LocalTime; | ||
| 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 java.io.Serializable; | ||
| 11 | + | ||
| 12 | +@Data | ||
| 13 | +public class UpdateShipmentsPlanDetailVo implements BaseVo, Serializable { | ||
| 14 | + | ||
| 15 | + private static final long serialVersionUID = 1L; | ||
| 16 | + | ||
| 17 | + /** | ||
| 18 | + * ID | ||
| 19 | + */ | ||
| 20 | + @ApiModelProperty(value = "ID", required = true) | ||
| 21 | + @NotBlank(message = "id不能为空!") | ||
| 22 | + private String id; | ||
| 23 | + | ||
| 24 | + /** | ||
| 25 | + * 发货时间点 | ||
| 26 | + */ | ||
| 27 | + @ApiModelProperty(value = "发货时间点", required = true) | ||
| 28 | + @TypeMismatch(message = "发货时间点格式有误!") | ||
| 29 | + @NotNull(message = "请输入发货时间点!") | ||
| 30 | + private LocalTime shipmentsTime; | ||
| 31 | + | ||
| 32 | + /** | ||
| 33 | + * 是否可以发货 | ||
| 34 | + */ | ||
| 35 | + @ApiModelProperty(value = "是否可以发货", required = true) | ||
| 36 | + @TypeMismatch(message = "是否可以发货格式有误!") | ||
| 37 | + @NotNull(message = "请输入是否可以发货!") | ||
| 38 | + private Boolean canShipments; | ||
| 39 | + | ||
| 40 | +} |
| 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.ShipmentsPlanDetailMapper"> | ||
| 4 | + | ||
| 5 | + <resultMap id="ShipmentsPlanDetail" type="com.lframework.xingyun.sc.entity.ShipmentsPlanDetail"> | ||
| 6 | + <id column="id" property="id"/> | ||
| 7 | + <result column="plan_id" property="planId"/> | ||
| 8 | + <result column="order_id" property="orderId"/> | ||
| 9 | + <result column="order_no" property="orderNo"/> | ||
| 10 | + <result column="customer_name" property="customerName"/> | ||
| 11 | + <result column="thickness" property="thickness"/> | ||
| 12 | + <result column="thickness_tol_pos" property="thicknessTolPos"/> | ||
| 13 | + <result column="thickness_tol_neg" property="thicknessTolNeg"/> | ||
| 14 | + <result column="width" property="width"/> | ||
| 15 | + <result column="width_tol_pos" property="widthTolPos"/> | ||
| 16 | + <result column="width_tol_neg" property="widthTolNeg"/> | ||
| 17 | + <result column="length" property="length"/> | ||
| 18 | + <result column="length_tol_pos" property="lengthTolPos"/> | ||
| 19 | + <result column="length_tol_neg" property="lengthTolNeg"/> | ||
| 20 | + <result column="parent_id" property="parentId"/> | ||
| 21 | + <result column="status" property="status"/> | ||
| 22 | + <result column="shipments_date" property="shipmentsDate"/> | ||
| 23 | + <result column="shipments_time" property="shipmentsTime"/> | ||
| 24 | + <result column="can_shipments" property="canShipments"/> | ||
| 25 | + <result column="del_flag" property="delFlag"/> | ||
| 26 | + <result column="create_by_id" property="createById"/> | ||
| 27 | + <result column="update_by_id" property="updateById"/> | ||
| 28 | + <result column="create_time" property="createTime"/> | ||
| 29 | + <result column="update_time" property="updateTime"/> | ||
| 30 | + </resultMap> | ||
| 31 | + | ||
| 32 | + <sql id="ShipmentsPlanDetail_sql"> | ||
| 33 | + SELECT | ||
| 34 | + tb.id, | ||
| 35 | + tb.plan_id, | ||
| 36 | + tb.order_id, | ||
| 37 | + o.order_no, | ||
| 38 | + c.name AS customer_name, | ||
| 39 | + ol.thickness, | ||
| 40 | + ol.thickness_tol_pos, | ||
| 41 | + ol.thickness_tol_neg, | ||
| 42 | + ol.width, | ||
| 43 | + ol.width_tol_pos, | ||
| 44 | + ol.width_tol_neg, | ||
| 45 | + ol.length, | ||
| 46 | + ol.length_tol_pos, | ||
| 47 | + ol.length_tol_neg, | ||
| 48 | + ol.quantity, | ||
| 49 | + tb.parent_id, | ||
| 50 | + tb.status, | ||
| 51 | + tb.shipments_date, | ||
| 52 | + tb.shipments_time, | ||
| 53 | + tb.can_shipments, | ||
| 54 | + tb.del_flag, | ||
| 55 | + tb.create_by_id, | ||
| 56 | + tb.update_by_id, | ||
| 57 | + tb.create_time, | ||
| 58 | + tb.update_time | ||
| 59 | + FROM shipments_plan_detail AS tb | ||
| 60 | + INNER JOIN shipments_plan p ON tb.plan_id = p.id | ||
| 61 | + LEFT JOIN purchase_order_info o ON tb.order_id = o.id | ||
| 62 | + LEFT JOIN base_data_customer c ON o.ordering_unit = c.id | ||
| 63 | + LEFT JOIN tbl_purchase_order_line ol ON tb.order_id = ol.purchase_order_id | ||
| 64 | + </sql> | ||
| 65 | + | ||
| 66 | + <select id="query" resultMap="ShipmentsPlanDetail"> | ||
| 67 | + <include refid="ShipmentsPlanDetail_sql"/> | ||
| 68 | + <where> | ||
| 69 | + <if test="vo.planId != null and vo.planId != ''"> | ||
| 70 | + AND tb.plan_id = #{vo.planId} | ||
| 71 | + </if> | ||
| 72 | + <if test="vo.shipmentsDate != null"> | ||
| 73 | + AND tb.shipments_date = #{vo.shipmentsDate} | ||
| 74 | + </if> | ||
| 75 | + </where> | ||
| 76 | + </select> | ||
| 77 | +</mapper> |
| @@ -5,6 +5,7 @@ | @@ -5,6 +5,7 @@ | ||
| 5 | <resultMap id="ShipmentsPlan" type="com.lframework.xingyun.sc.entity.ShipmentsPlan"> | 5 | <resultMap id="ShipmentsPlan" type="com.lframework.xingyun.sc.entity.ShipmentsPlan"> |
| 6 | <id column="id" property="id"/> | 6 | <id column="id" property="id"/> |
| 7 | <result column="workshop_id" property="workshopId"/> | 7 | <result column="workshop_id" property="workshopId"/> |
| 8 | + <result column="workshop_name" property="workshopName"/> | ||
| 8 | <result column="status" property="status"/> | 9 | <result column="status" property="status"/> |
| 9 | <result column="tomo_pre_ship_date" property="tomoPreShipDate"/> | 10 | <result column="tomo_pre_ship_date" property="tomoPreShipDate"/> |
| 10 | <result column="af_tomo_pre_ship_date" property="afTomoPreShipDate"/> | 11 | <result column="af_tomo_pre_ship_date" property="afTomoPreShipDate"/> |
| @@ -18,6 +19,7 @@ | @@ -18,6 +19,7 @@ | ||
| 18 | SELECT | 19 | SELECT |
| 19 | tb.id, | 20 | tb.id, |
| 20 | tb.workshop_id, | 21 | tb.workshop_id, |
| 22 | + w.workshop_name, | ||
| 21 | tb.status, | 23 | tb.status, |
| 22 | tb.tomo_pre_ship_date, | 24 | tb.tomo_pre_ship_date, |
| 23 | tb.af_tomo_pre_ship_date, | 25 | tb.af_tomo_pre_ship_date, |
| @@ -26,6 +28,7 @@ | @@ -26,6 +28,7 @@ | ||
| 26 | tb.create_time, | 28 | tb.create_time, |
| 27 | tb.update_time | 29 | tb.update_time |
| 28 | FROM shipments_plan AS tb | 30 | FROM shipments_plan AS tb |
| 31 | + INNER JOIN base_data_workshop w ON tb.workshop_id = w.id | ||
| 29 | </sql> | 32 | </sql> |
| 30 | 33 | ||
| 31 | <select id="query" resultMap="ShipmentsPlan"> | 34 | <select id="query" resultMap="ShipmentsPlan"> |
| @@ -39,4 +42,11 @@ | @@ -39,4 +42,11 @@ | ||
| 39 | </if> | 42 | </if> |
| 40 | </where> | 43 | </where> |
| 41 | </select> | 44 | </select> |
| 45 | + | ||
| 46 | + <select id="getById" resultType="com.lframework.xingyun.sc.entity.ShipmentsPlan"> | ||
| 47 | + <include refid="ShipmentsPlan_sql"/> | ||
| 48 | + <where> | ||
| 49 | + AND tb.id = #{id} | ||
| 50 | + </where> | ||
| 51 | + </select> | ||
| 42 | </mapper> | 52 | </mapper> |