Showing
15 changed files
with
1047 additions
and
0 deletions
xingyun-sc/src/main/java/com/lframework/xingyun/sc/bo/shipments/order/GetShipmentsOrderInfoBo.java
0 → 100644
| 1 | +package com.lframework.xingyun.sc.bo.shipments.order; | ||
| 2 | + | ||
| 3 | +import com.fasterxml.jackson.annotation.JsonFormat; | ||
| 4 | +import com.lframework.xingyun.sc.entity.ShipmentsOrderInfo; | ||
| 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 io.swagger.annotations.ApiModelProperty; | ||
| 10 | + | ||
| 11 | +import lombok.Data; | ||
| 12 | + | ||
| 13 | +/** | ||
| 14 | + * <p> | ||
| 15 | + * 发货单 GetBo | ||
| 16 | + * </p> | ||
| 17 | + * | ||
| 18 | + */ | ||
| 19 | +@Data | ||
| 20 | +public class GetShipmentsOrderInfoBo extends BaseBo<ShipmentsOrderInfo> { | ||
| 21 | + | ||
| 22 | + /** | ||
| 23 | + * ID | ||
| 24 | + */ | ||
| 25 | + @ApiModelProperty("ID") | ||
| 26 | + private String id; | ||
| 27 | + | ||
| 28 | + /** | ||
| 29 | + * 发货计划ID | ||
| 30 | + */ | ||
| 31 | + @ApiModelProperty("发货计划ID") | ||
| 32 | + private String planId; | ||
| 33 | + | ||
| 34 | + /** | ||
| 35 | + * 购货单位ID | ||
| 36 | + */ | ||
| 37 | + @ApiModelProperty("购货单位ID") | ||
| 38 | + private String customerId; | ||
| 39 | + | ||
| 40 | + /** | ||
| 41 | + * 厂房ID | ||
| 42 | + */ | ||
| 43 | + @ApiModelProperty("厂房ID") | ||
| 44 | + private String workshopId; | ||
| 45 | + | ||
| 46 | + /** | ||
| 47 | + * 发货日期 | ||
| 48 | + */ | ||
| 49 | + @ApiModelProperty("发货日期") | ||
| 50 | + @JsonFormat(pattern = StringPool.DATE_PATTERN) | ||
| 51 | + private LocalDate shipmentsDate; | ||
| 52 | + | ||
| 53 | + /** | ||
| 54 | + * 办事处ID | ||
| 55 | + */ | ||
| 56 | + @ApiModelProperty("办事处ID") | ||
| 57 | + private String deptId; | ||
| 58 | + | ||
| 59 | + /** | ||
| 60 | + * 交货方式 | ||
| 61 | + */ | ||
| 62 | + @ApiModelProperty("交货方式") | ||
| 63 | + private String deliveryType; | ||
| 64 | + | ||
| 65 | + /** | ||
| 66 | + * 目的地 | ||
| 67 | + */ | ||
| 68 | + @ApiModelProperty("目的地") | ||
| 69 | + private String destination; | ||
| 70 | + | ||
| 71 | + /** | ||
| 72 | + * 实发数量 | ||
| 73 | + */ | ||
| 74 | + @ApiModelProperty("实发数量") | ||
| 75 | + private Double actualShipmentQuantity; | ||
| 76 | + | ||
| 77 | + /** | ||
| 78 | + * 状态 | ||
| 79 | + */ | ||
| 80 | + @ApiModelProperty("状态") | ||
| 81 | + private String status; | ||
| 82 | + | ||
| 83 | + /** | ||
| 84 | + * 创建人ID | ||
| 85 | + */ | ||
| 86 | + @ApiModelProperty("创建人ID") | ||
| 87 | + private String createById; | ||
| 88 | + | ||
| 89 | + /** | ||
| 90 | + * 更新人ID | ||
| 91 | + */ | ||
| 92 | + @ApiModelProperty("更新人ID") | ||
| 93 | + private String updateById; | ||
| 94 | + | ||
| 95 | + /** | ||
| 96 | + * 创建时间 | ||
| 97 | + */ | ||
| 98 | + @ApiModelProperty("创建时间") | ||
| 99 | + @JsonFormat(pattern = StringPool.DATE_TIME_PATTERN) | ||
| 100 | + private LocalDateTime createTime; | ||
| 101 | + | ||
| 102 | + /** | ||
| 103 | + * 更新时间 | ||
| 104 | + */ | ||
| 105 | + @ApiModelProperty("更新时间") | ||
| 106 | + @JsonFormat(pattern = StringPool.DATE_TIME_PATTERN) | ||
| 107 | + private LocalDateTime updateTime; | ||
| 108 | + | ||
| 109 | + public GetShipmentsOrderInfoBo() { | ||
| 110 | + | ||
| 111 | + } | ||
| 112 | + | ||
| 113 | + public GetShipmentsOrderInfoBo(ShipmentsOrderInfo dto) { | ||
| 114 | + | ||
| 115 | + super(dto); | ||
| 116 | + } | ||
| 117 | + | ||
| 118 | + @Override | ||
| 119 | + public BaseBo<ShipmentsOrderInfo> convert(ShipmentsOrderInfo dto) { | ||
| 120 | + return super.convert(dto); | ||
| 121 | + } | ||
| 122 | + | ||
| 123 | + @Override | ||
| 124 | + protected void afterInit(ShipmentsOrderInfo dto) { | ||
| 125 | + | ||
| 126 | + } | ||
| 127 | +} |
xingyun-sc/src/main/java/com/lframework/xingyun/sc/bo/shipments/order/QueryShipmentsOrderInfoBo.java
0 → 100644
| 1 | +package com.lframework.xingyun.sc.bo.shipments.order; | ||
| 2 | + | ||
| 3 | +import com.fasterxml.jackson.annotation.JsonFormat; | ||
| 4 | +import com.lframework.xingyun.sc.entity.ShipmentsOrderInfo; | ||
| 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 io.swagger.annotations.ApiModelProperty; | ||
| 10 | + | ||
| 11 | +import lombok.Data; | ||
| 12 | + | ||
| 13 | +/** | ||
| 14 | + * <p> | ||
| 15 | + * 发货单 QueryBo | ||
| 16 | + * </p> | ||
| 17 | + * | ||
| 18 | + */ | ||
| 19 | +@Data | ||
| 20 | +public class QueryShipmentsOrderInfoBo extends BaseBo<ShipmentsOrderInfo> { | ||
| 21 | + | ||
| 22 | + /** | ||
| 23 | + * ID | ||
| 24 | + */ | ||
| 25 | + @ApiModelProperty("ID") | ||
| 26 | + private String id; | ||
| 27 | + | ||
| 28 | + /** | ||
| 29 | + * 发货计划ID | ||
| 30 | + */ | ||
| 31 | + @ApiModelProperty("发货计划ID") | ||
| 32 | + private String planId; | ||
| 33 | + | ||
| 34 | + /** | ||
| 35 | + * 购货单位ID | ||
| 36 | + */ | ||
| 37 | + @ApiModelProperty("购货单位ID") | ||
| 38 | + private String customerId; | ||
| 39 | + | ||
| 40 | + /** | ||
| 41 | + * 购货单位名称 | ||
| 42 | + */ | ||
| 43 | + @ApiModelProperty("购货单位名称") | ||
| 44 | + private String customerName; | ||
| 45 | + | ||
| 46 | + /** | ||
| 47 | + * 厂房ID | ||
| 48 | + */ | ||
| 49 | + @ApiModelProperty("厂房ID") | ||
| 50 | + private String workshopId; | ||
| 51 | + | ||
| 52 | + /** | ||
| 53 | + * 厂房名称 | ||
| 54 | + */ | ||
| 55 | + @ApiModelProperty("厂房名称") | ||
| 56 | + private String workshopName; | ||
| 57 | + | ||
| 58 | + /** | ||
| 59 | + * 发货日期 | ||
| 60 | + */ | ||
| 61 | + @ApiModelProperty("发货日期") | ||
| 62 | + @JsonFormat(pattern = StringPool.DATE_PATTERN) | ||
| 63 | + private LocalDate shipmentsDate; | ||
| 64 | + | ||
| 65 | + /** | ||
| 66 | + * 办事处ID | ||
| 67 | + */ | ||
| 68 | + @ApiModelProperty("办事处ID") | ||
| 69 | + private String deptId; | ||
| 70 | + | ||
| 71 | + /** | ||
| 72 | + * 办事处名称 | ||
| 73 | + */ | ||
| 74 | + @ApiModelProperty("办事处名称") | ||
| 75 | + private String deptName; | ||
| 76 | + | ||
| 77 | + /** | ||
| 78 | + * 交货方式 | ||
| 79 | + */ | ||
| 80 | + @ApiModelProperty("交货方式") | ||
| 81 | + private String deliveryType; | ||
| 82 | + | ||
| 83 | + /** | ||
| 84 | + * 目的地 | ||
| 85 | + */ | ||
| 86 | + @ApiModelProperty("目的地") | ||
| 87 | + private String destination; | ||
| 88 | + | ||
| 89 | + /** | ||
| 90 | + * 实发数量 | ||
| 91 | + */ | ||
| 92 | + @ApiModelProperty("实发数量") | ||
| 93 | + private Double actualShipmentQuantity; | ||
| 94 | + | ||
| 95 | + /** | ||
| 96 | + * 状态 | ||
| 97 | + */ | ||
| 98 | + @ApiModelProperty("状态") | ||
| 99 | + private String status; | ||
| 100 | + | ||
| 101 | + /** | ||
| 102 | + * 创建人ID | ||
| 103 | + */ | ||
| 104 | + @ApiModelProperty("创建人ID") | ||
| 105 | + private String createById; | ||
| 106 | + | ||
| 107 | + /** | ||
| 108 | + * 更新人ID | ||
| 109 | + */ | ||
| 110 | + @ApiModelProperty("更新人ID") | ||
| 111 | + private String updateById; | ||
| 112 | + | ||
| 113 | + /** | ||
| 114 | + * 创建时间 | ||
| 115 | + */ | ||
| 116 | + @ApiModelProperty("创建时间") | ||
| 117 | + @JsonFormat(pattern = StringPool.DATE_TIME_PATTERN) | ||
| 118 | + private LocalDateTime createTime; | ||
| 119 | + | ||
| 120 | + /** | ||
| 121 | + * 更新时间 | ||
| 122 | + */ | ||
| 123 | + @ApiModelProperty("更新时间") | ||
| 124 | + @JsonFormat(pattern = StringPool.DATE_TIME_PATTERN) | ||
| 125 | + private LocalDateTime updateTime; | ||
| 126 | + | ||
| 127 | + public QueryShipmentsOrderInfoBo() { | ||
| 128 | + | ||
| 129 | + } | ||
| 130 | + | ||
| 131 | + public QueryShipmentsOrderInfoBo(ShipmentsOrderInfo dto) { | ||
| 132 | + | ||
| 133 | + super(dto); | ||
| 134 | + } | ||
| 135 | + | ||
| 136 | + @Override | ||
| 137 | + public BaseBo<ShipmentsOrderInfo> convert(ShipmentsOrderInfo dto) { | ||
| 138 | + return super.convert(dto); | ||
| 139 | + } | ||
| 140 | + | ||
| 141 | + @Override | ||
| 142 | + protected void afterInit(ShipmentsOrderInfo dto) { | ||
| 143 | + | ||
| 144 | + } | ||
| 145 | +} |
| 1 | +package com.lframework.xingyun.sc.controller.shipments; | ||
| 2 | + | ||
| 3 | +import com.lframework.xingyun.sc.bo.shipments.order.GetShipmentsOrderInfoBo; | ||
| 4 | +import com.lframework.xingyun.sc.bo.shipments.order.QueryShipmentsOrderInfoBo; | ||
| 5 | +import com.lframework.xingyun.sc.vo.shipments.order.QueryShipmentsOrderInfoVo; | ||
| 6 | +import com.lframework.xingyun.sc.service.shipments.ShipmentsOrderInfoService; | ||
| 7 | +import com.lframework.xingyun.sc.vo.shipments.order.CreateShipmentsOrderInfoVo; | ||
| 8 | +import com.lframework.xingyun.sc.vo.shipments.order.UpdateShipmentsOrderInfoVo; | ||
| 9 | +import com.lframework.xingyun.sc.entity.ShipmentsOrderInfo; | ||
| 10 | +import com.lframework.starter.web.core.utils.PageResultUtil; | ||
| 11 | +import com.lframework.starter.web.core.components.resp.PageResult; | ||
| 12 | +import com.lframework.starter.web.core.components.resp.InvokeResult; | ||
| 13 | + | ||
| 14 | +import javax.annotation.Resource; | ||
| 15 | +import javax.validation.constraints.NotBlank; | ||
| 16 | +import io.swagger.annotations.ApiImplicitParam; | ||
| 17 | +import com.lframework.starter.web.core.components.resp.InvokeResultBuilder; | ||
| 18 | +import com.lframework.starter.common.exceptions.impl.DefaultClientException; | ||
| 19 | +import io.swagger.annotations.ApiOperation; | ||
| 20 | +import com.lframework.starter.common.utils.CollectionUtil; | ||
| 21 | +import io.swagger.annotations.Api; | ||
| 22 | +import org.springframework.web.bind.annotation.DeleteMapping; | ||
| 23 | +import com.lframework.starter.web.core.controller.DefaultBaseController; | ||
| 24 | +import com.lframework.starter.web.core.annotations.security.HasPermission; | ||
| 25 | +import org.springframework.validation.annotation.Validated; | ||
| 26 | +import org.springframework.web.bind.annotation.*; | ||
| 27 | + | ||
| 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("/shipments/order") | ||
| 40 | +public class ShipmentsOrderInfoController extends DefaultBaseController { | ||
| 41 | + | ||
| 42 | + | ||
| 43 | + @Resource | ||
| 44 | + private ShipmentsOrderInfoService shipmentsOrderInfoService; | ||
| 45 | + | ||
| 46 | + | ||
| 47 | + /** | ||
| 48 | + * 查询列表 | ||
| 49 | + */ | ||
| 50 | + @ApiOperation("查询列表") | ||
| 51 | + @HasPermission({"shipments:order:query"}) | ||
| 52 | + @GetMapping("/query") | ||
| 53 | + public InvokeResult<PageResult<QueryShipmentsOrderInfoBo>> query(@Valid QueryShipmentsOrderInfoVo vo) { | ||
| 54 | + PageResult<ShipmentsOrderInfo> pageResult = shipmentsOrderInfoService.query(getPageIndex(vo), getPageSize(vo), vo); | ||
| 55 | + List<ShipmentsOrderInfo> dataList = pageResult.getDatas(); | ||
| 56 | + List<QueryShipmentsOrderInfoBo> results = null; | ||
| 57 | + if (!CollectionUtil.isEmpty(dataList)) { | ||
| 58 | + results = dataList.stream().map(QueryShipmentsOrderInfoBo::new).collect(Collectors.toList()); | ||
| 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({"shipments:order:query"}) | ||
| 69 | + @GetMapping | ||
| 70 | + public InvokeResult<GetShipmentsOrderInfoBo> get(@NotBlank(message = "id不能为空!") String id) { | ||
| 71 | + ShipmentsOrderInfo data = shipmentsOrderInfoService.findById(id); | ||
| 72 | + if (data == null) { | ||
| 73 | + throw new DefaultClientException("发货单不存在!"); | ||
| 74 | + } | ||
| 75 | + GetShipmentsOrderInfoBo result = new GetShipmentsOrderInfoBo(data); | ||
| 76 | + | ||
| 77 | + return InvokeResultBuilder.success(result); | ||
| 78 | + } | ||
| 79 | + | ||
| 80 | + /** | ||
| 81 | + * 新增 | ||
| 82 | + */ | ||
| 83 | + @ApiOperation("新增") | ||
| 84 | + @HasPermission({"shipments:order:add"}) | ||
| 85 | + @PostMapping | ||
| 86 | + public InvokeResult<Void> create(@Valid CreateShipmentsOrderInfoVo vo) { | ||
| 87 | + shipmentsOrderInfoService.create(vo); | ||
| 88 | + return InvokeResultBuilder.success(); | ||
| 89 | + } | ||
| 90 | + | ||
| 91 | + /** | ||
| 92 | + * 修改 | ||
| 93 | + */ | ||
| 94 | + @ApiOperation("修改") | ||
| 95 | + @HasPermission({"shipments:order:modify"}) | ||
| 96 | + @PutMapping | ||
| 97 | + public InvokeResult<Void> update(@Valid UpdateShipmentsOrderInfoVo vo) { | ||
| 98 | + shipmentsOrderInfoService.update(vo); | ||
| 99 | + return InvokeResultBuilder.success(); | ||
| 100 | + } | ||
| 101 | + | ||
| 102 | + /** | ||
| 103 | + * 根据ID删除 | ||
| 104 | + */ | ||
| 105 | + @ApiOperation("根据ID删除") | ||
| 106 | + @ApiImplicitParam(value = "id", name = "id", paramType = "query", required = true) | ||
| 107 | + @HasPermission({"shipments:order:delete"}) | ||
| 108 | + @DeleteMapping | ||
| 109 | + public InvokeResult<Void> deleteById(@NotBlank(message = "id不能为空!") String id) { | ||
| 110 | + shipmentsOrderInfoService.deleteById(id); | ||
| 111 | + return InvokeResultBuilder.success(); | ||
| 112 | + } | ||
| 113 | +} |
| @@ -120,4 +120,15 @@ public class ShipmentsPlanDetailController extends DefaultBaseController { | @@ -120,4 +120,15 @@ public class ShipmentsPlanDetailController extends DefaultBaseController { | ||
| 120 | shipmentsPlanDetailService.planDetailSplit(vo); | 120 | shipmentsPlanDetailService.planDetailSplit(vo); |
| 121 | return InvokeResultBuilder.success(); | 121 | return InvokeResultBuilder.success(); |
| 122 | } | 122 | } |
| 123 | + | ||
| 124 | + /** | ||
| 125 | + * 批量删除 | ||
| 126 | + */ | ||
| 127 | + @ApiOperation("批量删除") | ||
| 128 | + @HasPermission({"shipments:plan:add"}) | ||
| 129 | + @PostMapping("/batchDelete") | ||
| 130 | + public InvokeResult<Void> batchDelete(@Valid @RequestBody List<String> ids) { | ||
| 131 | + shipmentsPlanDetailService.batchDelete(ids); | ||
| 132 | + return InvokeResultBuilder.success(); | ||
| 133 | + } | ||
| 123 | } | 134 | } |
| 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 com.baomidou.mybatisplus.annotation.FieldFill; | ||
| 8 | +import com.lframework.starter.web.core.entity.BaseEntity; | ||
| 9 | +import com.baomidou.mybatisplus.annotation.TableField; | ||
| 10 | +import lombok.Data; | ||
| 11 | + | ||
| 12 | +/** | ||
| 13 | + * <p> | ||
| 14 | + * 发货单 | ||
| 15 | + * </p> | ||
| 16 | + * | ||
| 17 | + */ | ||
| 18 | +@Data | ||
| 19 | +@TableName("shipments_order_info") | ||
| 20 | +public class ShipmentsOrderInfo extends BaseEntity implements BaseDto { | ||
| 21 | + | ||
| 22 | + private static final long serialVersionUID = 1L; | ||
| 23 | + | ||
| 24 | + public static final String CACHE_NAME = "ShipmentsOrderInfo"; | ||
| 25 | + | ||
| 26 | + /** | ||
| 27 | + * ID | ||
| 28 | + */ | ||
| 29 | + private String id; | ||
| 30 | + | ||
| 31 | + /** | ||
| 32 | + * 发货计划ID | ||
| 33 | + */ | ||
| 34 | + private String planId; | ||
| 35 | + | ||
| 36 | + /** | ||
| 37 | + * 购货单位ID | ||
| 38 | + */ | ||
| 39 | + private String customerId; | ||
| 40 | + | ||
| 41 | + /** | ||
| 42 | + * 购货单位名称 | ||
| 43 | + */ | ||
| 44 | + @TableField(exist = false) | ||
| 45 | + private String customerName; | ||
| 46 | + | ||
| 47 | + /** | ||
| 48 | + * 厂房ID | ||
| 49 | + */ | ||
| 50 | + private String workshopId; | ||
| 51 | + | ||
| 52 | + /** | ||
| 53 | + * 厂房名称 | ||
| 54 | + */ | ||
| 55 | + @TableField(exist = false) | ||
| 56 | + private String workshopName; | ||
| 57 | + | ||
| 58 | + /** | ||
| 59 | + * 发货日期 | ||
| 60 | + */ | ||
| 61 | + private LocalDate shipmentsDate; | ||
| 62 | + | ||
| 63 | + /** | ||
| 64 | + * 办事处ID | ||
| 65 | + */ | ||
| 66 | + private String deptId; | ||
| 67 | + | ||
| 68 | + /** | ||
| 69 | + * 办事处名称 | ||
| 70 | + */ | ||
| 71 | + @TableField(exist = false) | ||
| 72 | + private String deptName; | ||
| 73 | + | ||
| 74 | + /** | ||
| 75 | + * 交货方式 | ||
| 76 | + */ | ||
| 77 | + private String deliveryType; | ||
| 78 | + | ||
| 79 | + /** | ||
| 80 | + * 目的地 | ||
| 81 | + */ | ||
| 82 | + private String destination; | ||
| 83 | + | ||
| 84 | + /** | ||
| 85 | + * 实发数量 | ||
| 86 | + */ | ||
| 87 | + private Double actualShipmentQuantity; | ||
| 88 | + | ||
| 89 | + /** | ||
| 90 | + * 状态 | ||
| 91 | + */ | ||
| 92 | + private String status; | ||
| 93 | + | ||
| 94 | + /** | ||
| 95 | + * 创建人ID | ||
| 96 | + */ | ||
| 97 | + @TableField(fill = FieldFill.INSERT) | ||
| 98 | + private String createById; | ||
| 99 | + | ||
| 100 | + /** | ||
| 101 | + * 更新人ID | ||
| 102 | + */ | ||
| 103 | + @TableField(fill = FieldFill.INSERT_UPDATE) | ||
| 104 | + private String updateById; | ||
| 105 | + | ||
| 106 | + /** | ||
| 107 | + * 创建时间 | ||
| 108 | + */ | ||
| 109 | + @TableField(fill = FieldFill.INSERT) | ||
| 110 | + private LocalDateTime createTime; | ||
| 111 | + | ||
| 112 | + /** | ||
| 113 | + * 更新时间 | ||
| 114 | + */ | ||
| 115 | + @TableField(fill = FieldFill.INSERT_UPDATE) | ||
| 116 | + private LocalDateTime updateTime; | ||
| 117 | + | ||
| 118 | +} |
xingyun-sc/src/main/java/com/lframework/xingyun/sc/impl/shipments/ShipmentsOrderInfoServiceImpl.java
0 → 100644
| 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.starter.web.inner.entity.SysDept; | ||
| 7 | +import com.lframework.starter.web.inner.service.system.SysDeptService; | ||
| 8 | +import com.lframework.xingyun.sc.entity.ShipmentsOrderInfo; | ||
| 9 | +import com.lframework.starter.web.core.impl.BaseMpServiceImpl; | ||
| 10 | +import com.lframework.starter.web.core.utils.PageResultUtil; | ||
| 11 | +import com.lframework.starter.web.core.components.resp.PageResult; | ||
| 12 | +import com.lframework.starter.web.core.utils.OpLogUtil; | ||
| 13 | +import com.lframework.starter.common.exceptions.impl.DefaultClientException; | ||
| 14 | +import com.lframework.starter.web.core.utils.IdUtil; | ||
| 15 | +import com.lframework.starter.common.utils.ObjectUtil; | ||
| 16 | +import com.lframework.starter.web.core.annotations.oplog.OpLog; | ||
| 17 | +import com.lframework.starter.web.core.utils.PageHelperUtil; | ||
| 18 | +import com.lframework.starter.common.utils.Assert; | ||
| 19 | +import com.lframework.starter.web.inner.components.oplog.OtherOpLogType; | ||
| 20 | +import org.apache.commons.collections4.CollectionUtils; | ||
| 21 | +import org.apache.commons.lang3.StringUtils; | ||
| 22 | +import org.springframework.transaction.annotation.Transactional; | ||
| 23 | +import com.lframework.xingyun.sc.mappers.ShipmentsOrderInfoMapper; | ||
| 24 | +import com.lframework.xingyun.sc.service.shipments.ShipmentsOrderInfoService; | ||
| 25 | +import com.lframework.xingyun.sc.vo.shipments.order.CreateShipmentsOrderInfoVo; | ||
| 26 | +import com.lframework.xingyun.sc.vo.shipments.order.QueryShipmentsOrderInfoVo; | ||
| 27 | +import com.lframework.xingyun.sc.vo.shipments.order.UpdateShipmentsOrderInfoVo; | ||
| 28 | +import org.springframework.stereotype.Service; | ||
| 29 | + | ||
| 30 | +import javax.annotation.Resource; | ||
| 31 | +import java.util.*; | ||
| 32 | +import java.util.function.Function; | ||
| 33 | +import java.util.stream.Collectors; | ||
| 34 | + | ||
| 35 | +@Service | ||
| 36 | +public class ShipmentsOrderInfoServiceImpl extends BaseMpServiceImpl<ShipmentsOrderInfoMapper, ShipmentsOrderInfo> implements ShipmentsOrderInfoService { | ||
| 37 | + | ||
| 38 | + | ||
| 39 | + | ||
| 40 | + @Resource | ||
| 41 | + private SysDeptService sysDeptService; | ||
| 42 | + | ||
| 43 | + | ||
| 44 | + | ||
| 45 | + public ShipmentsOrderInfoServiceImpl(SysDeptService sysDeptService) { | ||
| 46 | + this.sysDeptService = sysDeptService; | ||
| 47 | + } | ||
| 48 | + | ||
| 49 | + @Override | ||
| 50 | + public PageResult<ShipmentsOrderInfo> query(Integer pageIndex, Integer pageSize, QueryShipmentsOrderInfoVo vo) { | ||
| 51 | + Assert.greaterThanZero(pageIndex); | ||
| 52 | + Assert.greaterThanZero(pageSize); | ||
| 53 | + | ||
| 54 | + PageHelperUtil.startPage(pageIndex, pageSize); | ||
| 55 | + List<ShipmentsOrderInfo> dataList = this.query(vo); | ||
| 56 | + | ||
| 57 | + return PageResultUtil.convert(new PageInfo<>(dataList)); | ||
| 58 | + } | ||
| 59 | + | ||
| 60 | + @Override | ||
| 61 | + public List<ShipmentsOrderInfo> query(QueryShipmentsOrderInfoVo vo) { | ||
| 62 | + List<ShipmentsOrderInfo> shipmentsOrderList = getBaseMapper().query(vo); | ||
| 63 | + if (CollectionUtils.isEmpty(shipmentsOrderList)) { | ||
| 64 | + return Collections.emptyList(); | ||
| 65 | + } | ||
| 66 | + // 办事处处理 | ||
| 67 | + List<String> deptIds = new ArrayList<>(); | ||
| 68 | + for (ShipmentsOrderInfo orderInfo : shipmentsOrderList) { | ||
| 69 | + String deptId = orderInfo.getDeptId(); | ||
| 70 | + if (StringUtils.isBlank(deptId)) { | ||
| 71 | + continue; | ||
| 72 | + } | ||
| 73 | + String[] split = deptId.split(","); | ||
| 74 | + Collections.addAll(deptIds, split); | ||
| 75 | + } | ||
| 76 | + Map<String, SysDept> deptMap = new HashMap<>(); | ||
| 77 | + if (CollectionUtils.isNotEmpty(deptIds)) { | ||
| 78 | + List<SysDept> deptList = sysDeptService.listByIds(deptIds); | ||
| 79 | + deptMap = deptList.stream().collect(Collectors.toMap(SysDept::getId, Function.identity())); | ||
| 80 | + } | ||
| 81 | + for (ShipmentsOrderInfo orderInfo : shipmentsOrderList) { | ||
| 82 | + String deptId = orderInfo.getDeptId(); | ||
| 83 | + if (StringUtils.isBlank(deptId)) { | ||
| 84 | + continue; | ||
| 85 | + } | ||
| 86 | + String[] split = deptId.split(","); | ||
| 87 | + if (split.length > 1) { | ||
| 88 | + StringBuilder builder = new StringBuilder(); | ||
| 89 | + for (int i = 1; i < split.length; i++) { | ||
| 90 | + builder.append(split[i]); | ||
| 91 | + builder.append(","); | ||
| 92 | + } | ||
| 93 | + builder.deleteCharAt(builder.length() - 1); | ||
| 94 | + | ||
| 95 | + orderInfo.setDeptName(builder.toString()); | ||
| 96 | + } else { | ||
| 97 | + SysDept sysDept = deptMap.get(split[0]); | ||
| 98 | + if (sysDept != null) { | ||
| 99 | + orderInfo.setDeptName(sysDept.getName()); | ||
| 100 | + } | ||
| 101 | + } | ||
| 102 | + } | ||
| 103 | + | ||
| 104 | + return shipmentsOrderList; | ||
| 105 | + } | ||
| 106 | + | ||
| 107 | + @Override | ||
| 108 | + public ShipmentsOrderInfo findById(String id) { | ||
| 109 | + return getBaseMapper().selectById(id); | ||
| 110 | + } | ||
| 111 | + | ||
| 112 | + @OpLog(type = OtherOpLogType.class, name = "新增发货单,ID:{}", params = {"#id"}) | ||
| 113 | + @Transactional(rollbackFor = Exception.class) | ||
| 114 | + @Override | ||
| 115 | + public String create(CreateShipmentsOrderInfoVo vo) { | ||
| 116 | + ShipmentsOrderInfo data = new ShipmentsOrderInfo(); | ||
| 117 | + data.setId(IdUtil.getId()); | ||
| 118 | + data.setPlanId(vo.getPlanId()); | ||
| 119 | + data.setCustomerId(vo.getCustomerId()); | ||
| 120 | + data.setWorkshopId(vo.getWorkshopId()); | ||
| 121 | + data.setShipmentsDate(vo.getShipmentsDate()); | ||
| 122 | + data.setDeptId(vo.getDeptId()); | ||
| 123 | + data.setDeliveryType(vo.getDeliveryType()); | ||
| 124 | + data.setDestination(vo.getDestination()); | ||
| 125 | + | ||
| 126 | + getBaseMapper().insert(data); | ||
| 127 | + | ||
| 128 | + OpLogUtil.setVariable("id", data.getId()); | ||
| 129 | + OpLogUtil.setExtra(vo); | ||
| 130 | + | ||
| 131 | + return data.getId(); | ||
| 132 | + } | ||
| 133 | + | ||
| 134 | + @OpLog(type = OtherOpLogType.class, name = "修改发货单,ID:{}", params = {"#id"}) | ||
| 135 | + @Transactional(rollbackFor = Exception.class) | ||
| 136 | + @Override | ||
| 137 | + public void update(UpdateShipmentsOrderInfoVo vo) { | ||
| 138 | + ShipmentsOrderInfo data = getBaseMapper().selectById(vo.getId()); | ||
| 139 | + if (ObjectUtil.isNull(data)) { | ||
| 140 | + throw new DefaultClientException("发货单不存在!"); | ||
| 141 | + } | ||
| 142 | + LambdaUpdateWrapper<ShipmentsOrderInfo> updateWrapper = Wrappers.lambdaUpdate(ShipmentsOrderInfo.class) | ||
| 143 | + .set(ShipmentsOrderInfo::getPlanId, vo.getPlanId()) | ||
| 144 | + .set(ShipmentsOrderInfo::getCustomerId, vo.getCustomerId()) | ||
| 145 | + .set(ShipmentsOrderInfo::getWorkshopId, vo.getWorkshopId()) | ||
| 146 | + .set(ShipmentsOrderInfo::getShipmentsDate, vo.getShipmentsDate()) | ||
| 147 | + .set(ShipmentsOrderInfo::getDeptId, vo.getDeptId()) | ||
| 148 | + .set(ShipmentsOrderInfo::getDeliveryType, vo.getDeliveryType()) | ||
| 149 | + .set(ShipmentsOrderInfo::getDestination, vo.getDestination()) | ||
| 150 | + .eq(ShipmentsOrderInfo::getId, vo.getId()); | ||
| 151 | + | ||
| 152 | + getBaseMapper().update(updateWrapper); | ||
| 153 | + | ||
| 154 | + OpLogUtil.setVariable("id", data.getId()); | ||
| 155 | + OpLogUtil.setExtra(vo); | ||
| 156 | + } | ||
| 157 | + | ||
| 158 | + @OpLog(type = OtherOpLogType.class, name = "删除发货单,ID:{}", params = {"#id"}) | ||
| 159 | + @Transactional(rollbackFor = Exception.class) | ||
| 160 | + @Override | ||
| 161 | + public void deleteById(String id) { | ||
| 162 | + getBaseMapper().deleteById(id); | ||
| 163 | + } | ||
| 164 | +} |
| @@ -281,6 +281,22 @@ public class ShipmentsPlanDetailServiceImpl extends BaseMpServiceImpl<ShipmentsP | @@ -281,6 +281,22 @@ public class ShipmentsPlanDetailServiceImpl extends BaseMpServiceImpl<ShipmentsP | ||
| 281 | } | 281 | } |
| 282 | } | 282 | } |
| 283 | 283 | ||
| 284 | + /** | ||
| 285 | + * 批量删除 | ||
| 286 | + * | ||
| 287 | + * @param ids 主键ID集合 | ||
| 288 | + */ | ||
| 289 | + @Override | ||
| 290 | + public void batchDelete(List<String> ids) { | ||
| 291 | + if (CollectionUtils.isEmpty(ids)) { | ||
| 292 | + return; | ||
| 293 | + } | ||
| 294 | + LambdaUpdateWrapper<ShipmentsPlanDetail> updateWrapper = Wrappers.lambdaUpdate(ShipmentsPlanDetail.class); | ||
| 295 | + updateWrapper.in(ShipmentsPlanDetail::getId, ids); | ||
| 296 | + | ||
| 297 | + getBaseMapper().delete(updateWrapper); | ||
| 298 | + } | ||
| 299 | + | ||
| 284 | 300 | ||
| 285 | /** | 301 | /** |
| 286 | * 封装发货计划明细数据 | 302 | * 封装发货计划明细数据 |
| 1 | +package com.lframework.xingyun.sc.mappers; | ||
| 2 | + | ||
| 3 | +import com.lframework.xingyun.sc.entity.ShipmentsOrderInfo; | ||
| 4 | +import com.lframework.starter.web.core.mapper.BaseMapper; | ||
| 5 | +import com.lframework.xingyun.sc.vo.shipments.order.QueryShipmentsOrderInfoVo; | ||
| 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 ShipmentsOrderInfoMapper extends BaseMapper<ShipmentsOrderInfo> { | ||
| 17 | + | ||
| 18 | + /** | ||
| 19 | + * 查询列表 | ||
| 20 | + * | ||
| 21 | + * @param vo 查询条件 | ||
| 22 | + * @return List<ShipmentsOrderInfo> | ||
| 23 | + */ | ||
| 24 | + List<ShipmentsOrderInfo> query(@Param("vo") QueryShipmentsOrderInfoVo vo); | ||
| 25 | +} |
xingyun-sc/src/main/java/com/lframework/xingyun/sc/service/shipments/ShipmentsOrderInfoService.java
0 → 100644
| 1 | +package com.lframework.xingyun.sc.service.shipments; | ||
| 2 | + | ||
| 3 | +import com.lframework.xingyun.sc.vo.shipments.order.CreateShipmentsOrderInfoVo; | ||
| 4 | +import com.lframework.xingyun.sc.vo.shipments.order.QueryShipmentsOrderInfoVo; | ||
| 5 | +import com.lframework.xingyun.sc.vo.shipments.order.UpdateShipmentsOrderInfoVo; | ||
| 6 | +import com.lframework.xingyun.sc.entity.ShipmentsOrderInfo; | ||
| 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 ShipmentsOrderInfoService extends BaseMpService<ShipmentsOrderInfo> { | ||
| 15 | + | ||
| 16 | + /** | ||
| 17 | + * 查询列表 | ||
| 18 | + * | ||
| 19 | + * @return PageResult<ShipmentsOrderInfo> | ||
| 20 | + */ | ||
| 21 | + PageResult<ShipmentsOrderInfo> query(Integer pageIndex, Integer pageSize, QueryShipmentsOrderInfoVo vo); | ||
| 22 | + | ||
| 23 | + /** | ||
| 24 | + * 查询列表 | ||
| 25 | + * | ||
| 26 | + * @param vo 查询条件 | ||
| 27 | + * @return List<ShipmentsOrderInfo> | ||
| 28 | + */ | ||
| 29 | + List<ShipmentsOrderInfo> query(QueryShipmentsOrderInfoVo vo); | ||
| 30 | + | ||
| 31 | + /** | ||
| 32 | + * 根据ID查询 | ||
| 33 | + * | ||
| 34 | + * @param id 主键ID | ||
| 35 | + * @return ShipmentsOrderInfo | ||
| 36 | + */ | ||
| 37 | + ShipmentsOrderInfo findById(String id); | ||
| 38 | + | ||
| 39 | + /** | ||
| 40 | + * 创建 | ||
| 41 | + * | ||
| 42 | + * @param vo 数据实体 | ||
| 43 | + * @return String | ||
| 44 | + */ | ||
| 45 | + String create(CreateShipmentsOrderInfoVo vo); | ||
| 46 | + | ||
| 47 | + /** | ||
| 48 | + * 修改 | ||
| 49 | + * | ||
| 50 | + * @param vo 数据实体 | ||
| 51 | + */ | ||
| 52 | + void update(UpdateShipmentsOrderInfoVo vo); | ||
| 53 | + | ||
| 54 | + /** | ||
| 55 | + * 根据ID删除 | ||
| 56 | + * | ||
| 57 | + * @param id 主键ID | ||
| 58 | + */ | ||
| 59 | + void deleteById(String id); | ||
| 60 | +} |
xingyun-sc/src/main/java/com/lframework/xingyun/sc/service/shipments/ShipmentsPlanDetailService.java
| @@ -73,4 +73,11 @@ public interface ShipmentsPlanDetailService extends BaseMpService<ShipmentsPlanD | @@ -73,4 +73,11 @@ public interface ShipmentsPlanDetailService extends BaseMpService<ShipmentsPlanD | ||
| 73 | * 自动生成发货计划 | 73 | * 自动生成发货计划 |
| 74 | */ | 74 | */ |
| 75 | void autoCreateShipmentPlan(); | 75 | void autoCreateShipmentPlan(); |
| 76 | + | ||
| 77 | + /** | ||
| 78 | + * 批量删除 | ||
| 79 | + * | ||
| 80 | + * @param ids 主键ID集合 | ||
| 81 | + */ | ||
| 82 | + void batchDelete(List<String> ids); | ||
| 76 | } | 83 | } |
| 1 | +package com.lframework.xingyun.sc.vo.shipments.order; | ||
| 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 CreateShipmentsOrderInfoVo 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 planId; | ||
| 25 | + | ||
| 26 | + /** | ||
| 27 | + * 购货单位ID | ||
| 28 | + */ | ||
| 29 | + @ApiModelProperty(value = "购货单位ID", required = true) | ||
| 30 | + @NotBlank(message = "请输入购货单位ID!") | ||
| 31 | + @Length(message = "购货单位ID最多允许32个字符!") | ||
| 32 | + private String customerId; | ||
| 33 | + | ||
| 34 | + /** | ||
| 35 | + * 厂房ID | ||
| 36 | + */ | ||
| 37 | + @ApiModelProperty(value = "厂房ID", required = true) | ||
| 38 | + @NotBlank(message = "请输入厂房ID!") | ||
| 39 | + @Length(message = "厂房ID最多允许32个字符!") | ||
| 40 | + private String workshopId; | ||
| 41 | + | ||
| 42 | + /** | ||
| 43 | + * 发货日期 | ||
| 44 | + */ | ||
| 45 | + @ApiModelProperty(value = "发货日期", required = true) | ||
| 46 | + @NotNull(message = "请输入发货日期!") | ||
| 47 | + @TypeMismatch(message = "发货日期格式有误!") | ||
| 48 | + private LocalDate shipmentsDate; | ||
| 49 | + | ||
| 50 | + /** | ||
| 51 | + * 办事处ID | ||
| 52 | + */ | ||
| 53 | + @ApiModelProperty(value = "办事处ID", required = true) | ||
| 54 | + @NotBlank(message = "请输入办事处ID!") | ||
| 55 | + @Length(message = "办事处ID最多允许500个字符!") | ||
| 56 | + private String deptId; | ||
| 57 | + | ||
| 58 | + /** | ||
| 59 | + * 交货方式 | ||
| 60 | + */ | ||
| 61 | + @ApiModelProperty(value = "交货方式", required = true) | ||
| 62 | + @NotBlank(message = "请输入交货方式!") | ||
| 63 | + @Length(message = "交货方式最多允许100个字符!") | ||
| 64 | + private String deliveryType; | ||
| 65 | + | ||
| 66 | + /** | ||
| 67 | + * 目的地 | ||
| 68 | + */ | ||
| 69 | + @ApiModelProperty(value = "目的地", required = true) | ||
| 70 | + @NotBlank(message = "请输入目的地!") | ||
| 71 | + @Length(message = "目的地最多允许100个字符!") | ||
| 72 | + private String destination; | ||
| 73 | + | ||
| 74 | +} |
xingyun-sc/src/main/java/com/lframework/xingyun/sc/vo/shipments/order/QueryShipmentsOrderInfoVo.java
0 → 100644
| 1 | +package com.lframework.xingyun.sc.vo.shipments.order; | ||
| 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 | + | ||
| 11 | +@Data | ||
| 12 | +public class QueryShipmentsOrderInfoVo extends PageVo implements BaseVo, Serializable { | ||
| 13 | + | ||
| 14 | + private static final long serialVersionUID = 1L; | ||
| 15 | + | ||
| 16 | + /** | ||
| 17 | + * 厂房ID | ||
| 18 | + */ | ||
| 19 | + @ApiModelProperty("厂房ID") | ||
| 20 | + private String workshopId; | ||
| 21 | + | ||
| 22 | + /** | ||
| 23 | + * 发货日期 | ||
| 24 | + */ | ||
| 25 | + @ApiModelProperty("发货日期") | ||
| 26 | + @TypeMismatch(message = "发货日期格式有误!") | ||
| 27 | + private LocalDate shipmentsDate; | ||
| 28 | + | ||
| 29 | + /** | ||
| 30 | + * 办事处ID | ||
| 31 | + */ | ||
| 32 | + @ApiModelProperty("办事处ID") | ||
| 33 | + private String deptId; | ||
| 34 | + | ||
| 35 | + /** | ||
| 36 | + * 状态 | ||
| 37 | + */ | ||
| 38 | + @ApiModelProperty("状态") | ||
| 39 | + private String status; | ||
| 40 | + | ||
| 41 | +} |
| 1 | +package com.lframework.xingyun.sc.vo.shipments.order; | ||
| 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 UpdateShipmentsOrderInfoVo 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 planId; | ||
| 32 | + | ||
| 33 | + /** | ||
| 34 | + * 购货单位ID | ||
| 35 | + */ | ||
| 36 | + @ApiModelProperty(value = "购货单位ID", required = true) | ||
| 37 | + @NotBlank(message = "请输入购货单位ID!") | ||
| 38 | + @Length(message = "购货单位ID最多允许32个字符!") | ||
| 39 | + private String customerId; | ||
| 40 | + | ||
| 41 | + /** | ||
| 42 | + * 厂房ID | ||
| 43 | + */ | ||
| 44 | + @ApiModelProperty(value = "厂房ID", required = true) | ||
| 45 | + @NotBlank(message = "请输入厂房ID!") | ||
| 46 | + @Length(message = "厂房ID最多允许32个字符!") | ||
| 47 | + private String workshopId; | ||
| 48 | + | ||
| 49 | + /** | ||
| 50 | + * 发货日期 | ||
| 51 | + */ | ||
| 52 | + @ApiModelProperty(value = "发货日期", required = true) | ||
| 53 | + @TypeMismatch(message = "发货日期格式有误!") | ||
| 54 | + @NotNull(message = "请输入发货日期!") | ||
| 55 | + private LocalDate shipmentsDate; | ||
| 56 | + | ||
| 57 | + /** | ||
| 58 | + * 办事处ID | ||
| 59 | + */ | ||
| 60 | + @ApiModelProperty(value = "办事处ID", required = true) | ||
| 61 | + @NotBlank(message = "请输入办事处ID!") | ||
| 62 | + @Length(message = "办事处ID最多允许500个字符!") | ||
| 63 | + private String deptId; | ||
| 64 | + | ||
| 65 | + /** | ||
| 66 | + * 交货方式 | ||
| 67 | + */ | ||
| 68 | + @ApiModelProperty(value = "交货方式", required = true) | ||
| 69 | + @NotBlank(message = "请输入交货方式!") | ||
| 70 | + @Length(message = "交货方式最多允许100个字符!") | ||
| 71 | + private String deliveryType; | ||
| 72 | + | ||
| 73 | + /** | ||
| 74 | + * 目的地 | ||
| 75 | + */ | ||
| 76 | + @ApiModelProperty(value = "目的地", required = true) | ||
| 77 | + @NotBlank(message = "请输入目的地!") | ||
| 78 | + @Length(message = "目的地最多允许100个字符!") | ||
| 79 | + private String destination; | ||
| 80 | + | ||
| 81 | +} |
| 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.ShipmentsOrderInfoMapper"> | ||
| 4 | + | ||
| 5 | + <resultMap id="ShipmentsOrderInfo" type="com.lframework.xingyun.sc.entity.ShipmentsOrderInfo"> | ||
| 6 | + <id column="id" property="id"/> | ||
| 7 | + <result column="plan_id" property="planId"/> | ||
| 8 | + <result column="customer_id" property="customerId"/> | ||
| 9 | + <result column="customer_name" property="customerName"/> | ||
| 10 | + <result column="workshop_id" property="workshopId"/> | ||
| 11 | + <result column="workshop_name" property="workshopName"/> | ||
| 12 | + <result column="shipments_date" property="shipmentsDate"/> | ||
| 13 | + <result column="dept_id" property="deptId"/> | ||
| 14 | + <result column="delivery_type" property="deliveryType"/> | ||
| 15 | + <result column="destination" property="destination"/> | ||
| 16 | + <result column="actual_shipment_quantity" property="actualShipmentQuantity"/> | ||
| 17 | + <result column="status" property="status"/> | ||
| 18 | + <result column="create_by_id" property="createById"/> | ||
| 19 | + <result column="update_by_id" property="updateById"/> | ||
| 20 | + <result column="create_time" property="createTime"/> | ||
| 21 | + <result column="update_time" property="updateTime"/> | ||
| 22 | + </resultMap> | ||
| 23 | + | ||
| 24 | + <sql id="ShipmentsOrderInfo_sql"> | ||
| 25 | + SELECT | ||
| 26 | + tb.id, | ||
| 27 | + tb.plan_id, | ||
| 28 | + tb.customer_id, | ||
| 29 | + c.name AS customer_name, | ||
| 30 | + tb.workshop_id, | ||
| 31 | + w.name AS workshop_name, | ||
| 32 | + tb.shipments_date, | ||
| 33 | + tb.dept_id, | ||
| 34 | + tb.delivery_type, | ||
| 35 | + tb.destination, | ||
| 36 | + tb.actual_shipment_quantity, | ||
| 37 | + tb.status, | ||
| 38 | + tb.create_by_id, | ||
| 39 | + tb.update_by_id, | ||
| 40 | + tb.create_time, | ||
| 41 | + tb.update_time | ||
| 42 | + FROM shipments_order_info AS tb | ||
| 43 | + LEFT JOIN base_data_customer c ON tb.customer_id = c.id | ||
| 44 | + LEFT JOIN base_data_workshop w ON tb.workshop_id = w.id | ||
| 45 | + </sql> | ||
| 46 | + | ||
| 47 | + <select id="query" resultMap="ShipmentsOrderInfo"> | ||
| 48 | + <include refid="ShipmentsOrderInfo_sql"/> | ||
| 49 | + <where> | ||
| 50 | + <if test="vo.workshopId != null and vo.workshopId != ''"> | ||
| 51 | + AND tb.workshop_id = #{vo.workshopId} | ||
| 52 | + </if> | ||
| 53 | + <if test="vo.shipmentsDate != null"> | ||
| 54 | + AND tb.shipments_date = #{vo.shipmentsDate} | ||
| 55 | + </if> | ||
| 56 | + <if test="vo.deptId != null and vo.deptId != ''"> | ||
| 57 | + AND tb.dept_id = #{vo.deptId} | ||
| 58 | + </if> | ||
| 59 | + <if test="vo.status != null and vo.status != ''"> | ||
| 60 | + AND tb.status = #{vo.status} | ||
| 61 | + </if> | ||
| 62 | + </where> | ||
| 63 | + </select> | ||
| 64 | +</mapper> |