Showing
15 changed files
with
1075 additions
and
0 deletions
| 1 | +package com.lframework.xingyun.sc.bo.order.change; | |
| 2 | + | |
| 3 | +import com.fasterxml.jackson.annotation.JsonFormat; | |
| 4 | +import com.lframework.xingyun.sc.entity.OrderSpecificationChangeRecord; | |
| 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.LocalDateTime; | |
| 9 | +import java.util.List; | |
| 10 | + | |
| 11 | +import com.lframework.xingyun.sc.entity.PurchaseOrderLine; | |
| 12 | +import io.swagger.annotations.ApiModelProperty; | |
| 13 | + | |
| 14 | +import lombok.Data; | |
| 15 | + | |
| 16 | +/** | |
| 17 | + * <p> | |
| 18 | + * 订货单规格变更记录 Bo | |
| 19 | + * </p> | |
| 20 | + * | |
| 21 | + */ | |
| 22 | +@Data | |
| 23 | +public class OrderSpecificationChangeRecordBo extends BaseBo<OrderSpecificationChangeRecord> { | |
| 24 | + | |
| 25 | + /** | |
| 26 | + * ID | |
| 27 | + */ | |
| 28 | + @ApiModelProperty("ID") | |
| 29 | + private String id; | |
| 30 | + | |
| 31 | + /** | |
| 32 | + * 订货单ID | |
| 33 | + */ | |
| 34 | + @ApiModelProperty("订货单ID") | |
| 35 | + private String orderId; | |
| 36 | + | |
| 37 | + /** | |
| 38 | + * 订货单位名称 | |
| 39 | + */ | |
| 40 | + @ApiModelProperty("订货单位名称") | |
| 41 | + private String orderingUnitName; | |
| 42 | + | |
| 43 | + /** | |
| 44 | + * 订货单编号 | |
| 45 | + */ | |
| 46 | + @ApiModelProperty("订货单编号") | |
| 47 | + private String orderNo; | |
| 48 | + | |
| 49 | + /** | |
| 50 | + * 订货日期 | |
| 51 | + */ | |
| 52 | + @ApiModelProperty("订货日期") | |
| 53 | + private LocalDate orderDate; | |
| 54 | + | |
| 55 | + /** | |
| 56 | + * 订货数量 | |
| 57 | + */ | |
| 58 | + @ApiModelProperty("订货数量") | |
| 59 | + private Double orderQuantity; | |
| 60 | + | |
| 61 | + /** | |
| 62 | + * 交货日期 | |
| 63 | + */ | |
| 64 | + @ApiModelProperty("交货日期") | |
| 65 | + @JsonFormat(pattern = StringPool.DATE_PATTERN) | |
| 66 | + private LocalDate deliveryDate; | |
| 67 | + | |
| 68 | + /** | |
| 69 | + * 状态 | |
| 70 | + */ | |
| 71 | + @ApiModelProperty("状态") | |
| 72 | + private String status; | |
| 73 | + | |
| 74 | + /** | |
| 75 | + * 创建人ID | |
| 76 | + */ | |
| 77 | + @ApiModelProperty("创建人ID") | |
| 78 | + private String createById; | |
| 79 | + | |
| 80 | + /** | |
| 81 | + * 创建人 | |
| 82 | + */ | |
| 83 | + @ApiModelProperty("创建人") | |
| 84 | + private String createBy; | |
| 85 | + | |
| 86 | + /** | |
| 87 | + * 更新人ID | |
| 88 | + */ | |
| 89 | + @ApiModelProperty("更新人ID") | |
| 90 | + private String updateById; | |
| 91 | + | |
| 92 | + /** | |
| 93 | + * 更新人 | |
| 94 | + */ | |
| 95 | + @ApiModelProperty("更新人") | |
| 96 | + private String updateBy; | |
| 97 | + | |
| 98 | + /** | |
| 99 | + * 创建时间 | |
| 100 | + */ | |
| 101 | + @ApiModelProperty("创建时间") | |
| 102 | + @JsonFormat(pattern = StringPool.DATE_TIME_PATTERN) | |
| 103 | + private LocalDateTime createTime; | |
| 104 | + | |
| 105 | + /** | |
| 106 | + * 更新时间 | |
| 107 | + */ | |
| 108 | + @ApiModelProperty("更新时间") | |
| 109 | + @JsonFormat(pattern = StringPool.DATE_TIME_PATTERN) | |
| 110 | + private LocalDateTime updateTime; | |
| 111 | + | |
| 112 | + /** | |
| 113 | + * 变更前规格数据 | |
| 114 | + */ | |
| 115 | + @ApiModelProperty("变更前规格数据") | |
| 116 | + private List<PurchaseOrderLine> beforeChangeSpecList; | |
| 117 | + | |
| 118 | + /** | |
| 119 | + * 变更后规格数据 | |
| 120 | + */ | |
| 121 | + @ApiModelProperty("变更后规格数据") | |
| 122 | + private List<PurchaseOrderLine> afterChangeSpecList; | |
| 123 | + | |
| 124 | + | |
| 125 | + public OrderSpecificationChangeRecordBo() { | |
| 126 | + | |
| 127 | + } | |
| 128 | + | |
| 129 | + public OrderSpecificationChangeRecordBo(OrderSpecificationChangeRecord dto) { | |
| 130 | + super(dto); | |
| 131 | + } | |
| 132 | + | |
| 133 | + @Override | |
| 134 | + public BaseBo<OrderSpecificationChangeRecord> convert(OrderSpecificationChangeRecord dto) { | |
| 135 | + return super.convert(dto); | |
| 136 | + } | |
| 137 | + | |
| 138 | + @Override | |
| 139 | + protected void afterInit(OrderSpecificationChangeRecord dto) { | |
| 140 | + | |
| 141 | + } | |
| 142 | +} | ... | ... |
| 1 | +package com.lframework.xingyun.sc.controller.order; | |
| 2 | + | |
| 3 | +import com.lframework.starter.web.core.annotations.security.HasPermission; | |
| 4 | +import com.lframework.starter.web.core.controller.DefaultBaseController; | |
| 5 | +import com.lframework.xingyun.sc.bo.order.change.OrderSpecificationChangeRecordBo; | |
| 6 | +import com.lframework.xingyun.sc.vo.order.change.QueryOrderSpecificationChangeRecordVo; | |
| 7 | +import com.lframework.xingyun.sc.service.order.OrderSpecificationChangeRecordService; | |
| 8 | +import com.lframework.xingyun.sc.vo.order.change.CreateOrderSpecificationChangeRecordVo; | |
| 9 | +import com.lframework.xingyun.sc.vo.order.change.UpdateOrderSpecificationChangeRecordVo; | |
| 10 | +import com.lframework.xingyun.sc.entity.OrderSpecificationChangeRecord; | |
| 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 | + | |
| 15 | +import javax.annotation.Resource; | |
| 16 | +import javax.validation.constraints.NotBlank; | |
| 17 | +import io.swagger.annotations.ApiImplicitParam; | |
| 18 | +import com.lframework.starter.web.core.components.resp.InvokeResultBuilder; | |
| 19 | +import com.lframework.starter.common.exceptions.impl.DefaultClientException; | |
| 20 | +import io.swagger.annotations.ApiOperation; | |
| 21 | +import com.lframework.starter.common.utils.CollectionUtil; | |
| 22 | +import io.swagger.annotations.Api; | |
| 23 | +import org.springframework.web.bind.annotation.DeleteMapping; | |
| 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("/order/change") | |
| 39 | +public class OrderSpecificationChangeRecordController extends DefaultBaseController { | |
| 40 | + | |
| 41 | + @Resource | |
| 42 | + private OrderSpecificationChangeRecordService orderSpecificationChangeRecordService; | |
| 43 | + | |
| 44 | + /** | |
| 45 | + * 查询列表 | |
| 46 | + */ | |
| 47 | + @ApiOperation("查询列表") | |
| 48 | + @HasPermission({"order:change:query"}) | |
| 49 | + @GetMapping("/query") | |
| 50 | + public InvokeResult<PageResult<OrderSpecificationChangeRecordBo>> query(@Valid QueryOrderSpecificationChangeRecordVo vo) { | |
| 51 | + PageResult<OrderSpecificationChangeRecord> pageResult = orderSpecificationChangeRecordService.query(getPageIndex(vo), getPageSize(vo), vo); | |
| 52 | + List<OrderSpecificationChangeRecord> dataList = pageResult.getDatas(); | |
| 53 | + List<OrderSpecificationChangeRecordBo> results = null; | |
| 54 | + if (!CollectionUtil.isEmpty(dataList)) { | |
| 55 | + results = dataList.stream().map(OrderSpecificationChangeRecordBo::new).collect(Collectors.toList()); | |
| 56 | + } | |
| 57 | + return InvokeResultBuilder.success(PageResultUtil.rebuild(pageResult, results)); | |
| 58 | + } | |
| 59 | + | |
| 60 | + /** | |
| 61 | + * 根据ID查询 | |
| 62 | + */ | |
| 63 | + @ApiOperation("根据ID查询") | |
| 64 | + @ApiImplicitParam(value = "id", name = "id", paramType = "query", required = true) | |
| 65 | + @HasPermission({"order:change:query"}) | |
| 66 | + @GetMapping | |
| 67 | + public InvokeResult<OrderSpecificationChangeRecordBo> get(@NotBlank(message = "id不能为空!") String id) { | |
| 68 | + OrderSpecificationChangeRecord data = orderSpecificationChangeRecordService.findById(id); | |
| 69 | + if (data == null) { | |
| 70 | + throw new DefaultClientException("订货单规格变更记录不存在!"); | |
| 71 | + } | |
| 72 | + OrderSpecificationChangeRecordBo result = new OrderSpecificationChangeRecordBo(data); | |
| 73 | + | |
| 74 | + return InvokeResultBuilder.success(result); | |
| 75 | + } | |
| 76 | + | |
| 77 | + /** | |
| 78 | + * 新增 | |
| 79 | + */ | |
| 80 | + @ApiOperation("新增") | |
| 81 | + @HasPermission({"order:change:add"}) | |
| 82 | + @PostMapping | |
| 83 | + public InvokeResult<Void> create(@Valid @RequestBody CreateOrderSpecificationChangeRecordVo vo) { | |
| 84 | + orderSpecificationChangeRecordService.create(vo); | |
| 85 | + return InvokeResultBuilder.success(); | |
| 86 | + } | |
| 87 | + | |
| 88 | + /** | |
| 89 | + * 修改 | |
| 90 | + */ | |
| 91 | + @ApiOperation("修改") | |
| 92 | + @HasPermission({"order:change:modify"}) | |
| 93 | + @PutMapping | |
| 94 | + public InvokeResult<Void> update(@Valid @RequestBody UpdateOrderSpecificationChangeRecordVo vo) { | |
| 95 | + orderSpecificationChangeRecordService.update(vo); | |
| 96 | + return InvokeResultBuilder.success(); | |
| 97 | + } | |
| 98 | + | |
| 99 | + /** | |
| 100 | + * 根据ID删除 | |
| 101 | + */ | |
| 102 | + @ApiOperation("根据ID删除") | |
| 103 | + @ApiImplicitParam(value = "id", name = "id", paramType = "query", required = true) | |
| 104 | + @HasPermission({"order:change:delete"}) | |
| 105 | + @DeleteMapping | |
| 106 | + public InvokeResult<Void> deleteById(@NotBlank(message = "id不能为空!") String id) { | |
| 107 | + orderSpecificationChangeRecordService.deleteById(id); | |
| 108 | + return InvokeResultBuilder.success(); | |
| 109 | + } | |
| 110 | +} | ... | ... |
xingyun-sc/src/main/java/com/lframework/xingyun/sc/entity/OrderSpecificationChangeRecord.java
0 → 100644
| 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("order_specification_change_record") | |
| 22 | +public class OrderSpecificationChangeRecord extends BaseEntity implements BaseDto { | |
| 23 | + | |
| 24 | + private static final long serialVersionUID = 1L; | |
| 25 | + | |
| 26 | + public static final String CACHE_NAME = "OrderSpecificationChangeRecord"; | |
| 27 | + | |
| 28 | + /** | |
| 29 | + * ID | |
| 30 | + */ | |
| 31 | + private String id; | |
| 32 | + | |
| 33 | + /** | |
| 34 | + * 订货单ID | |
| 35 | + */ | |
| 36 | + private String orderId; | |
| 37 | + | |
| 38 | + /** | |
| 39 | + * 订货单位名称 | |
| 40 | + * 非持久化字段 | |
| 41 | + */ | |
| 42 | + @TableField(exist = false) | |
| 43 | + private String orderingUnitName; | |
| 44 | + | |
| 45 | + /** | |
| 46 | + * 订货单编号 | |
| 47 | + * 非持久化字段 | |
| 48 | + */ | |
| 49 | + @TableField(exist = false) | |
| 50 | + private String orderNo; | |
| 51 | + | |
| 52 | + /** | |
| 53 | + * 订货日期 | |
| 54 | + * 非持久化字段 | |
| 55 | + */ | |
| 56 | + @TableField(exist = false) | |
| 57 | + private LocalDate orderDate; | |
| 58 | + | |
| 59 | + /** | |
| 60 | + * 订货数量 | |
| 61 | + */ | |
| 62 | + private Double orderQuantity; | |
| 63 | + | |
| 64 | + /** | |
| 65 | + * 交货日期 | |
| 66 | + */ | |
| 67 | + private LocalDate deliveryDate; | |
| 68 | + | |
| 69 | + /** | |
| 70 | + * 已产出 | |
| 71 | + */ | |
| 72 | + private Boolean output; | |
| 73 | + | |
| 74 | + /** | |
| 75 | + * 状态 | |
| 76 | + */ | |
| 77 | + private String status; | |
| 78 | + | |
| 79 | + /** | |
| 80 | + * 创建人ID | |
| 81 | + */ | |
| 82 | + @TableField(fill = FieldFill.INSERT) | |
| 83 | + private String createById; | |
| 84 | + | |
| 85 | + /** | |
| 86 | + * 创建人 | |
| 87 | + */ | |
| 88 | + @TableField(fill = FieldFill.INSERT) | |
| 89 | + private String createBy; | |
| 90 | + | |
| 91 | + /** | |
| 92 | + * 更新人ID | |
| 93 | + */ | |
| 94 | + @TableField(fill = FieldFill.INSERT_UPDATE) | |
| 95 | + private String updateById; | |
| 96 | + | |
| 97 | + /** | |
| 98 | + * 更新人 | |
| 99 | + */ | |
| 100 | + @TableField(fill = FieldFill.INSERT_UPDATE) | |
| 101 | + private String updateBy; | |
| 102 | + | |
| 103 | + /** | |
| 104 | + * 创建时间 | |
| 105 | + */ | |
| 106 | + @TableField(fill = FieldFill.INSERT) | |
| 107 | + private LocalDateTime createTime; | |
| 108 | + | |
| 109 | + /** | |
| 110 | + * 更新时间 | |
| 111 | + */ | |
| 112 | + @TableField(fill = FieldFill.INSERT_UPDATE) | |
| 113 | + private LocalDateTime updateTime; | |
| 114 | + | |
| 115 | + /** | |
| 116 | + * 变更前规格数据 | |
| 117 | + * 非持久化字段 | |
| 118 | + */ | |
| 119 | + @TableField(exist = false) | |
| 120 | + private List<PurchaseOrderLine> beforeChangeSpecList; | |
| 121 | + | |
| 122 | + /** | |
| 123 | + * 变更后规格数据 | |
| 124 | + * 非持久化字段 | |
| 125 | + */ | |
| 126 | + @TableField(exist = false) | |
| 127 | + private List<PurchaseOrderLine> afterChangeSpecList; | |
| 128 | +} | ... | ... |
| 1 | +package com.lframework.xingyun.sc.impl.order; | |
| 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.OrderSpecificationChangeRecord; | |
| 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.components.resp.PageResult; | |
| 10 | +import com.lframework.starter.web.core.utils.OpLogUtil; | |
| 11 | +import com.lframework.starter.common.exceptions.impl.DefaultClientException; | |
| 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.PurchaseOrderLine; | |
| 19 | +import com.lframework.xingyun.sc.service.order.PurchaseOrderLineService; | |
| 20 | +import com.lframework.xingyun.sc.vo.order.CreatePurchaseOrderLineVo; | |
| 21 | +import com.lframework.xingyun.sc.vo.order.UpdatePurchaseOrderLineVo; | |
| 22 | +import com.lframework.xingyun.sc.vo.order.change.*; | |
| 23 | +import org.apache.commons.collections4.CollectionUtils; | |
| 24 | +import org.springframework.transaction.annotation.Transactional; | |
| 25 | +import com.lframework.xingyun.sc.mappers.OrderSpecificationChangeRecordMapper; | |
| 26 | +import com.lframework.xingyun.sc.service.order.OrderSpecificationChangeRecordService; | |
| 27 | +import org.springframework.stereotype.Service; | |
| 28 | + | |
| 29 | +import javax.annotation.Resource; | |
| 30 | +import java.util.*; | |
| 31 | + | |
| 32 | +@Service | |
| 33 | +public class OrderSpecificationChangeRecordServiceImpl extends BaseMpServiceImpl<OrderSpecificationChangeRecordMapper, OrderSpecificationChangeRecord> implements OrderSpecificationChangeRecordService { | |
| 34 | + | |
| 35 | + | |
| 36 | + @Resource | |
| 37 | + private PurchaseOrderLineService purchaseOrderLineService; | |
| 38 | + | |
| 39 | + | |
| 40 | + @Override | |
| 41 | + public PageResult<OrderSpecificationChangeRecord> query(Integer pageIndex, Integer pageSize, QueryOrderSpecificationChangeRecordVo vo) { | |
| 42 | + Assert.greaterThanZero(pageIndex); | |
| 43 | + Assert.greaterThanZero(pageSize); | |
| 44 | + | |
| 45 | + PageHelperUtil.startPage(pageIndex, pageSize); | |
| 46 | + List<OrderSpecificationChangeRecord> dataList = this.query(vo); | |
| 47 | + | |
| 48 | + return PageResultUtil.convert(new PageInfo<>(dataList)); | |
| 49 | + } | |
| 50 | + | |
| 51 | + @Override | |
| 52 | + public List<OrderSpecificationChangeRecord> query(QueryOrderSpecificationChangeRecordVo vo) { | |
| 53 | + List<OrderSpecificationChangeRecord> changeRecords = getBaseMapper().query(vo); | |
| 54 | + if (CollectionUtils.isEmpty(changeRecords)) { | |
| 55 | + return Collections.emptyList(); | |
| 56 | + } | |
| 57 | + // 处理规格数据 | |
| 58 | + List<String> orderIds = new ArrayList<>(); | |
| 59 | + List<String> changeIds = new ArrayList<>(); | |
| 60 | + for (OrderSpecificationChangeRecord record : changeRecords) { | |
| 61 | + String orderId = record.getOrderId(); | |
| 62 | + String id = record.getId(); | |
| 63 | + if (!orderIds.contains(orderId)) { | |
| 64 | + orderIds.add(orderId); | |
| 65 | + } | |
| 66 | + if (!changeIds.contains(id)) { | |
| 67 | + changeIds.add(id); | |
| 68 | + } | |
| 69 | + } | |
| 70 | + // 变更前 | |
| 71 | + Map<String, List<PurchaseOrderLine>> beforeChangeMap = new HashMap<>(orderIds.size()); | |
| 72 | + List<PurchaseOrderLine> beforeChangeList = purchaseOrderLineService.listByIds(orderIds); | |
| 73 | + for (PurchaseOrderLine purchaseOrderLine : beforeChangeList) { | |
| 74 | + String purchaseOrderId = purchaseOrderLine.getPurchaseOrderId(); | |
| 75 | + List<PurchaseOrderLine> list = beforeChangeMap.computeIfAbsent(purchaseOrderId, k -> new ArrayList<>()); | |
| 76 | + list.add(purchaseOrderLine); | |
| 77 | + } | |
| 78 | + // 变更后 | |
| 79 | + Map<String, List<PurchaseOrderLine>> afterChangeMap = new HashMap<>(orderIds.size()); | |
| 80 | + List<PurchaseOrderLine> afterChangeList = purchaseOrderLineService.listByChangeIds(changeIds); | |
| 81 | + for (PurchaseOrderLine purchaseOrderLine : afterChangeList) { | |
| 82 | + String changeId = purchaseOrderLine.getChangeId(); | |
| 83 | + List<PurchaseOrderLine> list = afterChangeMap.computeIfAbsent(changeId, k -> new ArrayList<>()); | |
| 84 | + list.add(purchaseOrderLine); | |
| 85 | + } | |
| 86 | + for (OrderSpecificationChangeRecord record : changeRecords) { | |
| 87 | + String orderId = record.getOrderId(); | |
| 88 | + String id = record.getId(); | |
| 89 | + | |
| 90 | + record.setBeforeChangeSpecList(beforeChangeMap.get(orderId)); | |
| 91 | + record.setAfterChangeSpecList(afterChangeMap.get(id)); | |
| 92 | + } | |
| 93 | + return changeRecords; | |
| 94 | + } | |
| 95 | + | |
| 96 | + @Override | |
| 97 | + public OrderSpecificationChangeRecord findById(String id) { | |
| 98 | + | |
| 99 | + | |
| 100 | + return getBaseMapper().selectById(id); | |
| 101 | + } | |
| 102 | + | |
| 103 | + @OpLog(type = OtherOpLogType.class, name = "新增订货单规格变更记录,ID:{}", params = {"#id"}) | |
| 104 | + @Transactional(rollbackFor = Exception.class) | |
| 105 | + @Override | |
| 106 | + public String create(CreateOrderSpecificationChangeRecordVo vo) { | |
| 107 | + OrderSpecificationChangeRecord data = new OrderSpecificationChangeRecord(); | |
| 108 | + String id = IdUtil.getId(); | |
| 109 | + data.setId(id); | |
| 110 | + data.setOrderId(vo.getOrderId()); | |
| 111 | + data.setOrderQuantity(vo.getOrderQuantity()); | |
| 112 | + data.setDeliveryDate(vo.getDeliveryDate()); | |
| 113 | + | |
| 114 | + getBaseMapper().insert(data); | |
| 115 | + // 处理规格数据 | |
| 116 | + List<CreateOrderSpecificationInfoVo> orderSpecList = vo.getOrderSpecList(); | |
| 117 | + | |
| 118 | + OpLogUtil.setVariable("id", data.getId()); | |
| 119 | + OpLogUtil.setExtra(vo); | |
| 120 | + | |
| 121 | + return data.getId(); | |
| 122 | + } | |
| 123 | + | |
| 124 | + @OpLog(type = OtherOpLogType.class, name = "修改订货单规格变更记录,ID:{}", params = {"#id"}) | |
| 125 | + @Transactional(rollbackFor = Exception.class) | |
| 126 | + @Override | |
| 127 | + public void update(UpdateOrderSpecificationChangeRecordVo vo) { | |
| 128 | + OrderSpecificationChangeRecord data = getBaseMapper().selectById(vo.getId()); | |
| 129 | + if (ObjectUtil.isNull(data)) { | |
| 130 | + throw new DefaultClientException("订货单规格变更记录不存在!"); | |
| 131 | + } | |
| 132 | + LambdaUpdateWrapper<OrderSpecificationChangeRecord> updateWrapper = Wrappers.lambdaUpdate(OrderSpecificationChangeRecord.class) | |
| 133 | + .set(OrderSpecificationChangeRecord::getOrderId, vo.getOrderId()) | |
| 134 | + .set(OrderSpecificationChangeRecord::getOrderQuantity, vo.getOrderQuantity()) | |
| 135 | + .set(OrderSpecificationChangeRecord::getDeliveryDate, vo.getDeliveryDate()) | |
| 136 | + .eq(OrderSpecificationChangeRecord::getId, vo.getId()); | |
| 137 | + getBaseMapper().update(updateWrapper); | |
| 138 | + // 更新规格数据 | |
| 139 | + List<UpdateOrderSpecificationInfoVo> orderSpecList = vo.getOrderSpecList(); | |
| 140 | + | |
| 141 | + OpLogUtil.setVariable("id", data.getId()); | |
| 142 | + OpLogUtil.setExtra(vo); | |
| 143 | + } | |
| 144 | + | |
| 145 | + @OpLog(type = OtherOpLogType.class, name = "删除订货单规格变更记录,ID:{}", params = {"#id"}) | |
| 146 | + @Transactional(rollbackFor = Exception.class) | |
| 147 | + @Override | |
| 148 | + public void deleteById(String id) { | |
| 149 | + getBaseMapper().deleteById(id); | |
| 150 | + } | |
| 151 | +} | ... | ... |
| 1 | 1 | package com.lframework.xingyun.sc.impl.order; |
| 2 | 2 | |
| 3 | +import cn.hutool.core.collection.CollectionUtil; | |
| 4 | +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |
| 3 | 5 | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| 4 | 6 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| 5 | 7 | import com.github.pagehelper.PageInfo; |
| ... | ... | @@ -22,9 +24,11 @@ import com.lframework.xingyun.sc.service.order.PurchaseOrderLineService; |
| 22 | 24 | import com.lframework.xingyun.sc.vo.order.CreatePurchaseOrderLineVo; |
| 23 | 25 | import com.lframework.xingyun.sc.vo.order.QueryPurchaseOrderLineVo; |
| 24 | 26 | import com.lframework.xingyun.sc.vo.order.UpdatePurchaseOrderLineVo; |
| 27 | +import org.apache.commons.lang3.StringUtils; | |
| 25 | 28 | import org.springframework.transaction.annotation.Transactional; |
| 26 | 29 | import org.springframework.stereotype.Service; |
| 27 | 30 | |
| 31 | +import java.util.Collections; | |
| 28 | 32 | import java.util.List; |
| 29 | 33 | |
| 30 | 34 | @Service |
| ... | ... | @@ -172,6 +176,30 @@ public class PurchaseOrderLineServiceImpl extends BaseMpServiceImpl<PurchaseOrde |
| 172 | 176 | } |
| 173 | 177 | |
| 174 | 178 | @Override |
| 179 | + public List<PurchaseOrderLine> listByChangeIds(List<String> changeIds) { | |
| 180 | + if (CollectionUtil.isEmpty(changeIds)) { | |
| 181 | + return Collections.emptyList(); | |
| 182 | + } | |
| 183 | + LambdaQueryWrapper<PurchaseOrderLine> queryWrapper = Wrappers.lambdaQuery(PurchaseOrderLine.class); | |
| 184 | + queryWrapper.in(PurchaseOrderLine::getChangeId, changeIds) | |
| 185 | + .orderByAsc(PurchaseOrderLine::getShowOrder); | |
| 186 | + | |
| 187 | + return getBaseMapper().selectList(queryWrapper); | |
| 188 | + } | |
| 189 | + | |
| 190 | + @Override | |
| 191 | + public List<PurchaseOrderLine> listByOrderId(String orderId) { | |
| 192 | + if (StringUtils.isBlank(orderId)) { | |
| 193 | + return Collections.emptyList(); | |
| 194 | + } | |
| 195 | + LambdaQueryWrapper<PurchaseOrderLine> queryWrapper = Wrappers.lambdaQuery(PurchaseOrderLine.class); | |
| 196 | + queryWrapper.eq(PurchaseOrderLine::getChangeId, orderId) | |
| 197 | + .orderByAsc(PurchaseOrderLine::getShowOrder); | |
| 198 | + | |
| 199 | + return getBaseMapper().selectList(queryWrapper); | |
| 200 | + } | |
| 201 | + | |
| 202 | + @Override | |
| 175 | 203 | public void cleanCacheByKey(Serializable key) { |
| 176 | 204 | |
| 177 | 205 | } | ... | ... |
xingyun-sc/src/main/java/com/lframework/xingyun/sc/mappers/OrderSpecificationChangeRecordMapper.java
0 → 100644
| 1 | +package com.lframework.xingyun.sc.mappers; | |
| 2 | + | |
| 3 | +import com.lframework.xingyun.sc.entity.OrderSpecificationChangeRecord; | |
| 4 | +import com.lframework.starter.web.core.mapper.BaseMapper; | |
| 5 | +import com.lframework.xingyun.sc.vo.order.change.QueryOrderSpecificationChangeRecordVo; | |
| 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 OrderSpecificationChangeRecordMapper extends BaseMapper<OrderSpecificationChangeRecord> { | |
| 17 | + | |
| 18 | + /** | |
| 19 | + * 查询列表 | |
| 20 | + * | |
| 21 | + * @param vo 查询条件 | |
| 22 | + * @return List<OrderSpecificationChangeRecord> | |
| 23 | + */ | |
| 24 | + List<OrderSpecificationChangeRecord> query(@Param("vo") QueryOrderSpecificationChangeRecordVo vo); | |
| 25 | +} | ... | ... |
| 1 | +package com.lframework.xingyun.sc.service.order; | |
| 2 | + | |
| 3 | +import com.lframework.xingyun.sc.vo.order.change.CreateOrderSpecificationChangeRecordVo; | |
| 4 | +import com.lframework.xingyun.sc.vo.order.change.QueryOrderSpecificationChangeRecordVo; | |
| 5 | +import com.lframework.xingyun.sc.vo.order.change.UpdateOrderSpecificationChangeRecordVo; | |
| 6 | +import com.lframework.xingyun.sc.entity.OrderSpecificationChangeRecord; | |
| 7 | +import com.lframework.starter.web.core.service.BaseMpService; | |
| 8 | +import com.lframework.starter.web.core.components.resp.PageResult; | |
| 9 | +import java.util.List; | |
| 10 | + | |
| 11 | +/** | |
| 12 | + * 订货单规格变更记录 Service | |
| 13 | + */ | |
| 14 | +public interface OrderSpecificationChangeRecordService extends BaseMpService<OrderSpecificationChangeRecord> { | |
| 15 | + | |
| 16 | + /** | |
| 17 | + * 查询列表 | |
| 18 | + * | |
| 19 | + * @return PageResult<OrderSpecificationChangeRecord> | |
| 20 | + */ | |
| 21 | + PageResult<OrderSpecificationChangeRecord> query(Integer pageIndex, Integer pageSize, QueryOrderSpecificationChangeRecordVo vo); | |
| 22 | + | |
| 23 | + /** | |
| 24 | + * 查询列表 | |
| 25 | + * | |
| 26 | + * @param vo 差查询条件 | |
| 27 | + * @return List<OrderSpecificationChangeRecord> | |
| 28 | + */ | |
| 29 | + List<OrderSpecificationChangeRecord> query(QueryOrderSpecificationChangeRecordVo vo); | |
| 30 | + | |
| 31 | + /** | |
| 32 | + * 根据ID查询 | |
| 33 | + * | |
| 34 | + * @param id 主键ID | |
| 35 | + * @return OrderSpecificationChangeRecord | |
| 36 | + */ | |
| 37 | + OrderSpecificationChangeRecord findById(String id); | |
| 38 | + | |
| 39 | + /** | |
| 40 | + * 创建 | |
| 41 | + * | |
| 42 | + * @param vo 数据实体 | |
| 43 | + * @return String | |
| 44 | + */ | |
| 45 | + String create(CreateOrderSpecificationChangeRecordVo vo); | |
| 46 | + | |
| 47 | + /** | |
| 48 | + * 修改 | |
| 49 | + * | |
| 50 | + * @param vo 数据实体 | |
| 51 | + */ | |
| 52 | + void update(UpdateOrderSpecificationChangeRecordVo vo); | |
| 53 | + | |
| 54 | + /** | |
| 55 | + * 根据ID删除 | |
| 56 | + * | |
| 57 | + * @param id 主键ID | |
| 58 | + */ | |
| 59 | + void deleteById(String id); | |
| 60 | +} | ... | ... |
| ... | ... | @@ -52,4 +52,21 @@ public interface PurchaseOrderLineService extends BaseMpService<PurchaseOrderLin |
| 52 | 52 | * @return |
| 53 | 53 | */ |
| 54 | 54 | void deleteById(String id); |
| 55 | + | |
| 56 | + | |
| 57 | + /** | |
| 58 | + * 根据规格变更记录ID查询 | |
| 59 | + * | |
| 60 | + * @param changeIds 变更记录主键ID集合 | |
| 61 | + * @return List<PurchaseOrderLine> | |
| 62 | + */ | |
| 63 | + List<PurchaseOrderLine> listByChangeIds(List<String> changeIds); | |
| 64 | + | |
| 65 | + /** | |
| 66 | + * 根据订货单ID查询 | |
| 67 | + * | |
| 68 | + * @param orderId 订货单ID | |
| 69 | + * @return List<PurchaseOrderLine> | |
| 70 | + */ | |
| 71 | + List<PurchaseOrderLine> listByOrderId(String orderId); | |
| 55 | 72 | } | ... | ... |
| 1 | +package com.lframework.xingyun.sc.vo.order.change; | |
| 2 | + | |
| 3 | + | |
| 4 | +import javax.validation.Valid; | |
| 5 | +import javax.validation.constraints.NotBlank; | |
| 6 | +import java.time.LocalDate; | |
| 7 | +import com.lframework.starter.web.core.vo.BaseVo; | |
| 8 | + | |
| 9 | +import javax.validation.constraints.NotEmpty; | |
| 10 | +import javax.validation.constraints.NotNull; | |
| 11 | + | |
| 12 | +import com.lframework.xingyun.sc.vo.order.CreatePurchaseOrderLineVo; | |
| 13 | +import io.swagger.annotations.ApiModelProperty; | |
| 14 | +import com.lframework.starter.web.core.components.validation.TypeMismatch; | |
| 15 | +import org.hibernate.validator.constraints.Length; | |
| 16 | +import java.io.Serializable; | |
| 17 | +import java.util.List; | |
| 18 | + | |
| 19 | +import lombok.Data; | |
| 20 | + | |
| 21 | +@Data | |
| 22 | +public class CreateOrderSpecificationChangeRecordVo implements BaseVo, Serializable { | |
| 23 | + | |
| 24 | + private static final long serialVersionUID = 1L; | |
| 25 | + | |
| 26 | + /** | |
| 27 | + * 订货单ID | |
| 28 | + */ | |
| 29 | + @ApiModelProperty(value = "订货单ID", required = true) | |
| 30 | + @NotBlank(message = "请输入订货单ID!") | |
| 31 | + @Length(message = "订货单ID最多允许32个字符!") | |
| 32 | + private String orderId; | |
| 33 | + | |
| 34 | + /** | |
| 35 | + * 订货数量 | |
| 36 | + */ | |
| 37 | + @ApiModelProperty(value = "订货数量", required = true) | |
| 38 | + @NotNull(message = "请输入订货数量!") | |
| 39 | + @TypeMismatch(message = "订货数量格式有误!") | |
| 40 | + private Double orderQuantity; | |
| 41 | + | |
| 42 | + /** | |
| 43 | + * 交货日期 | |
| 44 | + */ | |
| 45 | + @ApiModelProperty(value = "交货日期", required = true) | |
| 46 | + @NotNull(message = "请输入交货日期!") | |
| 47 | + @TypeMismatch(message = "交货日期格式有误!") | |
| 48 | + private LocalDate deliveryDate; | |
| 49 | + | |
| 50 | + /** | |
| 51 | + * 规格变更记录 | |
| 52 | + */ | |
| 53 | + @Valid | |
| 54 | + @ApiModelProperty(value = "规格变更记录", required = true) | |
| 55 | + @NotEmpty(message = "请输入规格变更记录!") | |
| 56 | + List<CreateOrderSpecificationInfoVo> orderSpecList; | |
| 57 | +} | ... | ... |
| 1 | +package com.lframework.xingyun.sc.vo.order.change; | |
| 2 | + | |
| 3 | +import com.lframework.starter.web.core.components.validation.IsNumberPrecision; | |
| 4 | +import com.lframework.starter.web.core.components.validation.TypeMismatch; | |
| 5 | +import com.lframework.starter.web.core.vo.BaseVo; | |
| 6 | +import io.swagger.annotations.ApiModelProperty; | |
| 7 | +import lombok.Data; | |
| 8 | +import org.hibernate.validator.constraints.Length; | |
| 9 | + | |
| 10 | +import java.io.Serializable; | |
| 11 | +import java.math.BigDecimal; | |
| 12 | +import java.time.LocalDate; | |
| 13 | + | |
| 14 | +@Data | |
| 15 | +public class CreateOrderSpecificationInfoVo implements BaseVo, Serializable { | |
| 16 | + | |
| 17 | + private static final long serialVersionUID = 1L; | |
| 18 | + | |
| 19 | + /** | |
| 20 | + * 变更记录ID | |
| 21 | + */ | |
| 22 | + @ApiModelProperty(value = "变更记录ID", required = true) | |
| 23 | + @Length(message = "变更记录ID最多允许32个字符!") | |
| 24 | + private String changeId; | |
| 25 | + | |
| 26 | + /** | |
| 27 | + * 牌号 | |
| 28 | + */ | |
| 29 | + @ApiModelProperty("牌号") | |
| 30 | + @Length(message = "牌号最多允许100个字符!") | |
| 31 | + private String brand; | |
| 32 | + | |
| 33 | + /** | |
| 34 | + * 厚度 | |
| 35 | + */ | |
| 36 | + @ApiModelProperty("厚度") | |
| 37 | + @TypeMismatch(message = "厚度格式有误!") | |
| 38 | + @IsNumberPrecision(message = "厚度最多允许4位小数!", value = 4) | |
| 39 | + private BigDecimal thickness; | |
| 40 | + | |
| 41 | + /** | |
| 42 | + * 宽度 | |
| 43 | + */ | |
| 44 | + @ApiModelProperty("宽度") | |
| 45 | + @TypeMismatch(message = "宽度格式有误!") | |
| 46 | + @IsNumberPrecision(message = "宽度最多允许4位小数!", value = 4) | |
| 47 | + private BigDecimal width; | |
| 48 | + | |
| 49 | + | |
| 50 | + /** | |
| 51 | + * 长度 | |
| 52 | + */ | |
| 53 | + @ApiModelProperty("长度") | |
| 54 | + @TypeMismatch(message = "长度格式有误!") | |
| 55 | + @IsNumberPrecision(message = "长度最多允许4位小数!", value = 4) | |
| 56 | + private BigDecimal length; | |
| 57 | + | |
| 58 | + /** | |
| 59 | + * 状态 | |
| 60 | + */ | |
| 61 | + @ApiModelProperty("状态") | |
| 62 | + @Length(message = "状态最多允许50个字符!") | |
| 63 | + private String status; | |
| 64 | + | |
| 65 | + /** | |
| 66 | + * 数量 | |
| 67 | + */ | |
| 68 | + @ApiModelProperty("数量") | |
| 69 | + @TypeMismatch(message = "数量格式有误!") | |
| 70 | + @IsNumberPrecision(message = "数量最多允许4位小数!", value = 4) | |
| 71 | + private BigDecimal quantity; | |
| 72 | + | |
| 73 | + /** | |
| 74 | + * 价格 | |
| 75 | + */ | |
| 76 | + @ApiModelProperty("价格") | |
| 77 | + @TypeMismatch(message = "价格格式有误!") | |
| 78 | + private Double salesPrice; | |
| 79 | + | |
| 80 | + /** | |
| 81 | + * 现计划发货日期 | |
| 82 | + */ | |
| 83 | + @ApiModelProperty("现计划发货日期") | |
| 84 | + @TypeMismatch(message = "现计划发货日期格式有误!") | |
| 85 | + private LocalDate deliveryDate; | |
| 86 | + | |
| 87 | + /** | |
| 88 | + * 排序 | |
| 89 | + */ | |
| 90 | + @ApiModelProperty("排序") | |
| 91 | + @TypeMismatch(message = "排序格式有误!") | |
| 92 | + private Integer showOrder; | |
| 93 | +} | ... | ... |
| 1 | +package com.lframework.xingyun.sc.vo.order.change; | |
| 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 | +import java.time.LocalDateTime; | |
| 9 | + | |
| 10 | +@Data | |
| 11 | +public class QueryOrderSpecificationChangeRecordVo extends PageVo implements BaseVo, Serializable { | |
| 12 | + | |
| 13 | + private static final long serialVersionUID = 1L; | |
| 14 | + | |
| 15 | + /** | |
| 16 | + * 订货单位名称 | |
| 17 | + */ | |
| 18 | + @ApiModelProperty("订货单位名称") | |
| 19 | + private String orderingUnitName; | |
| 20 | + | |
| 21 | + /** | |
| 22 | + * 订货单编号 | |
| 23 | + */ | |
| 24 | + @ApiModelProperty("订货单编号") | |
| 25 | + private String orderNo; | |
| 26 | + | |
| 27 | + /** | |
| 28 | + * 制单日期范围 | |
| 29 | + */ | |
| 30 | + @ApiModelProperty("制单日期范围") | |
| 31 | + private LocalDateTime createStartTime; | |
| 32 | + private LocalDateTime createEndTime; | |
| 33 | +} | ... | ... |
| 1 | +package com.lframework.xingyun.sc.vo.order.change; | |
| 2 | + | |
| 3 | +import com.lframework.xingyun.sc.vo.order.UpdatePurchaseOrderLineVo; | |
| 4 | +import lombok.Data; | |
| 5 | + | |
| 6 | +import javax.validation.Valid; | |
| 7 | +import javax.validation.constraints.NotBlank; | |
| 8 | +import java.time.LocalDate; | |
| 9 | +import com.lframework.starter.web.core.vo.BaseVo; | |
| 10 | + | |
| 11 | +import javax.validation.constraints.NotEmpty; | |
| 12 | +import javax.validation.constraints.NotNull; | |
| 13 | +import com.lframework.starter.web.core.components.validation.TypeMismatch; | |
| 14 | +import io.swagger.annotations.ApiModelProperty; | |
| 15 | +import org.hibernate.validator.constraints.Length; | |
| 16 | +import java.io.Serializable; | |
| 17 | +import java.util.List; | |
| 18 | + | |
| 19 | +@Data | |
| 20 | +public class UpdateOrderSpecificationChangeRecordVo implements BaseVo, Serializable { | |
| 21 | + | |
| 22 | + private static final long serialVersionUID = 1L; | |
| 23 | + | |
| 24 | + /** | |
| 25 | + * ID | |
| 26 | + */ | |
| 27 | + @ApiModelProperty(value = "ID", required = true) | |
| 28 | + @NotBlank(message = "id不能为空!") | |
| 29 | + private String id; | |
| 30 | + | |
| 31 | + /** | |
| 32 | + * 订货单ID | |
| 33 | + */ | |
| 34 | + @ApiModelProperty(value = "订货单ID", required = true) | |
| 35 | + @NotBlank(message = "请输入订货单ID!") | |
| 36 | + @Length(message = "订货单ID最多允许32个字符!") | |
| 37 | + private String orderId; | |
| 38 | + | |
| 39 | + /** | |
| 40 | + * 订货数量 | |
| 41 | + */ | |
| 42 | + @ApiModelProperty(value = "订货数量", required = true) | |
| 43 | + @TypeMismatch(message = "订货数量格式有误!") | |
| 44 | + @NotNull(message = "请输入订货数量!") | |
| 45 | + private Double orderQuantity; | |
| 46 | + | |
| 47 | + /** | |
| 48 | + * 交货日期 | |
| 49 | + */ | |
| 50 | + @ApiModelProperty(value = "交货日期", required = true) | |
| 51 | + @TypeMismatch(message = "交货日期格式有误!") | |
| 52 | + @NotNull(message = "请输入交货日期!") | |
| 53 | + private LocalDate deliveryDate; | |
| 54 | + | |
| 55 | + /** | |
| 56 | + * 规格变更记录 | |
| 57 | + */ | |
| 58 | + @Valid | |
| 59 | + @ApiModelProperty(value = "规格变更记录", required = true) | |
| 60 | + @NotEmpty(message = "请输入规格变更记录!") | |
| 61 | + List<UpdateOrderSpecificationInfoVo> orderSpecList; | |
| 62 | +} | ... | ... |
| 1 | +package com.lframework.xingyun.sc.vo.order.change; | |
| 2 | + | |
| 3 | +import com.lframework.starter.web.core.components.validation.IsNumberPrecision; | |
| 4 | +import com.lframework.starter.web.core.components.validation.TypeMismatch; | |
| 5 | +import com.lframework.starter.web.core.vo.BaseVo; | |
| 6 | +import io.swagger.annotations.ApiModelProperty; | |
| 7 | +import lombok.Data; | |
| 8 | +import org.hibernate.validator.constraints.Length; | |
| 9 | + | |
| 10 | +import javax.validation.constraints.NotBlank; | |
| 11 | +import java.io.Serializable; | |
| 12 | +import java.math.BigDecimal; | |
| 13 | +import java.time.LocalDate; | |
| 14 | + | |
| 15 | +@Data | |
| 16 | +public class UpdateOrderSpecificationInfoVo implements BaseVo, Serializable { | |
| 17 | + | |
| 18 | + private static final long serialVersionUID = 1L; | |
| 19 | + | |
| 20 | + | |
| 21 | + /** | |
| 22 | + * ID | |
| 23 | + */ | |
| 24 | + @ApiModelProperty(value = "ID", required = true) | |
| 25 | + @NotBlank(message = "id不能为空!") | |
| 26 | + private String id; | |
| 27 | + | |
| 28 | + /** | |
| 29 | + * 变更记录ID | |
| 30 | + */ | |
| 31 | + @ApiModelProperty(value = "变更记录ID", required = true) | |
| 32 | + @Length(message = "变更记录ID最多允许32个字符!") | |
| 33 | + private String changeId; | |
| 34 | + | |
| 35 | + /** | |
| 36 | + * 牌号 | |
| 37 | + */ | |
| 38 | + @ApiModelProperty("牌号") | |
| 39 | + @Length(message = "牌号最多允许100个字符!") | |
| 40 | + private String brand; | |
| 41 | + | |
| 42 | + /** | |
| 43 | + * 厚度 | |
| 44 | + */ | |
| 45 | + @ApiModelProperty("厚度") | |
| 46 | + @TypeMismatch(message = "厚度格式有误!") | |
| 47 | + @IsNumberPrecision(message = "厚度最多允许4位小数!", value = 4) | |
| 48 | + private BigDecimal thickness; | |
| 49 | + | |
| 50 | + /** | |
| 51 | + * 宽度 | |
| 52 | + */ | |
| 53 | + @ApiModelProperty("宽度") | |
| 54 | + @TypeMismatch(message = "宽度格式有误!") | |
| 55 | + @IsNumberPrecision(message = "宽度最多允许4位小数!", value = 4) | |
| 56 | + private BigDecimal width; | |
| 57 | + | |
| 58 | + | |
| 59 | + /** | |
| 60 | + * 长度 | |
| 61 | + */ | |
| 62 | + @ApiModelProperty("长度") | |
| 63 | + @TypeMismatch(message = "长度格式有误!") | |
| 64 | + @IsNumberPrecision(message = "长度最多允许4位小数!", value = 4) | |
| 65 | + private BigDecimal length; | |
| 66 | + | |
| 67 | + /** | |
| 68 | + * 状态 | |
| 69 | + */ | |
| 70 | + @ApiModelProperty("状态") | |
| 71 | + @Length(message = "状态最多允许50个字符!") | |
| 72 | + private String status; | |
| 73 | + | |
| 74 | + /** | |
| 75 | + * 数量 | |
| 76 | + */ | |
| 77 | + @ApiModelProperty("数量") | |
| 78 | + @TypeMismatch(message = "数量格式有误!") | |
| 79 | + @IsNumberPrecision(message = "数量最多允许4位小数!", value = 4) | |
| 80 | + private BigDecimal quantity; | |
| 81 | + | |
| 82 | + /** | |
| 83 | + * 价格 | |
| 84 | + */ | |
| 85 | + @ApiModelProperty("价格") | |
| 86 | + @TypeMismatch(message = "价格格式有误!") | |
| 87 | + private Double salesPrice; | |
| 88 | + | |
| 89 | + /** | |
| 90 | + * 现计划发货日期 | |
| 91 | + */ | |
| 92 | + @ApiModelProperty("现计划发货日期") | |
| 93 | + @TypeMismatch(message = "现计划发货日期格式有误!") | |
| 94 | + private LocalDate deliveryDate; | |
| 95 | + | |
| 96 | + /** | |
| 97 | + * 排序 | |
| 98 | + */ | |
| 99 | + @ApiModelProperty("排序") | |
| 100 | + @TypeMismatch(message = "排序格式有误!") | |
| 101 | + private Integer showOrder; | |
| 102 | +} | ... | ... |
| 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.OrderSpecificationChangeRecordMapper"> | |
| 4 | + | |
| 5 | + <resultMap id="OrderSpecificationChangeRecord" type="com.lframework.xingyun.sc.entity.OrderSpecificationChangeRecord"> | |
| 6 | + <id column="id" property="id"/> | |
| 7 | + <result column="order_id" property="orderId"/> | |
| 8 | + <result column="order_no" property="orderNo"/> | |
| 9 | + <result column="ordering_unit_name" property="orderingUnitName"/> | |
| 10 | + <result column="order_date" property="orderDate"/> | |
| 11 | + <result column="order_quantity" property="orderQuantity"/> | |
| 12 | + <result column="delivery_date" property="deliveryDate"/> | |
| 13 | + <result column="output" property="output"/> | |
| 14 | + <result column="status" property="status"/> | |
| 15 | + <result column="create_by_id" property="createById"/> | |
| 16 | + <result column="create_by" property="createBy"/> | |
| 17 | + <result column="update_by_id" property="updateById"/> | |
| 18 | + <result column="update_by" property="updateBy"/> | |
| 19 | + <result column="create_time" property="createTime"/> | |
| 20 | + <result column="update_time" property="updateTime"/> | |
| 21 | + </resultMap> | |
| 22 | + | |
| 23 | + <sql id="OrderSpecificationChangeRecord_sql"> | |
| 24 | + SELECT | |
| 25 | + tb.id, | |
| 26 | + tb.order_id, | |
| 27 | + o.order_no, | |
| 28 | + c.name as ordering_unit_name, | |
| 29 | + o.order_date, | |
| 30 | + tb.order_quantity, | |
| 31 | + tb.delivery_date, | |
| 32 | + tb.output, | |
| 33 | + tb.status, | |
| 34 | + tb.create_by_id, | |
| 35 | + tb.create_by, | |
| 36 | + tb.update_by_id, | |
| 37 | + tb.update_by, | |
| 38 | + tb.create_time, | |
| 39 | + tb.update_time | |
| 40 | + FROM order_specification_change_record AS tb | |
| 41 | + LEFT JOIN purchase_order_info o ON tb.order_id = o.id | |
| 42 | + LEFT JOIN base_data_customer c ON o.ordering_unit = c.id | |
| 43 | + </sql> | |
| 44 | + | |
| 45 | + <select id="query" resultMap="OrderSpecificationChangeRecord"> | |
| 46 | + <include refid="OrderSpecificationChangeRecord_sql"/> | |
| 47 | + <where> | |
| 48 | + <if test="vo.orderingUnitName != null and vo.orderingUnitName != ''"> | |
| 49 | + AND c.name LIKE CONCAT('%', #{vo.orderingUnitName}, '%') | |
| 50 | + </if> | |
| 51 | + <if test="vo.orderNo != null and vo.orderNo != ''"> | |
| 52 | + AND o.order_no LIKE CONCAT('%', #{vo.orderNo}, '%') | |
| 53 | + </if> | |
| 54 | + <if test="vo.createStartTime != null"> | |
| 55 | + AND tb.create_time >= #{vo.createStartTime} | |
| 56 | + </if> | |
| 57 | + <if test="vo.createEndTime != null"> | |
| 58 | + AND tb.create_time <= #{vo.createEndTime} | |
| 59 | + </if> | |
| 60 | + </where> | |
| 61 | + </select> | |
| 62 | +</mapper> | ... | ... |