Showing
10 changed files
with
616 additions
and
0 deletions
xingyun-sc/src/main/java/com/lframework/xingyun/sc/bo/shipments/plan/ShipmentsPlanBo.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.ShipmentsPlan; | ||
| 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 | + | ||
| 10 | +import io.swagger.annotations.ApiModelProperty; | ||
| 11 | + | ||
| 12 | +import lombok.Data; | ||
| 13 | + | ||
| 14 | +/** | ||
| 15 | + * <p> | ||
| 16 | + * 发货计划 GetBo | ||
| 17 | + * </p> | ||
| 18 | + * | ||
| 19 | + */ | ||
| 20 | +@Data | ||
| 21 | +public class ShipmentsPlanBo extends BaseBo<ShipmentsPlan> { | ||
| 22 | + | ||
| 23 | + /** | ||
| 24 | + * ID | ||
| 25 | + */ | ||
| 26 | + @ApiModelProperty("ID") | ||
| 27 | + private String id; | ||
| 28 | + | ||
| 29 | + /** | ||
| 30 | + * 生产厂ID | ||
| 31 | + */ | ||
| 32 | + @ApiModelProperty("生产厂ID") | ||
| 33 | + private String workshopId; | ||
| 34 | + | ||
| 35 | + /** | ||
| 36 | + * 状态 | ||
| 37 | + */ | ||
| 38 | + @ApiModelProperty("状态") | ||
| 39 | + private String status; | ||
| 40 | + | ||
| 41 | + /** | ||
| 42 | + * 明日预发日期 | ||
| 43 | + */ | ||
| 44 | + @ApiModelProperty("明日预发日期") | ||
| 45 | + @JsonFormat(pattern = StringPool.DATE_PATTERN) | ||
| 46 | + private LocalDate tomoPreShipDate; | ||
| 47 | + | ||
| 48 | + /** | ||
| 49 | + * 后日预发日期 | ||
| 50 | + */ | ||
| 51 | + @ApiModelProperty("后日预发日期") | ||
| 52 | + @JsonFormat(pattern = StringPool.DATE_PATTERN) | ||
| 53 | + private LocalDate afTomoPreShipDate; | ||
| 54 | + | ||
| 55 | + /** | ||
| 56 | + * 创建人ID | ||
| 57 | + */ | ||
| 58 | + @ApiModelProperty("创建人ID") | ||
| 59 | + private String createById; | ||
| 60 | + | ||
| 61 | + /** | ||
| 62 | + * 更新人ID | ||
| 63 | + */ | ||
| 64 | + @ApiModelProperty("更新人ID") | ||
| 65 | + private String updateById; | ||
| 66 | + | ||
| 67 | + /** | ||
| 68 | + * 创建时间 | ||
| 69 | + */ | ||
| 70 | + @ApiModelProperty("创建时间") | ||
| 71 | + @JsonFormat(pattern = StringPool.DATE_TIME_PATTERN) | ||
| 72 | + private LocalDateTime createTime; | ||
| 73 | + | ||
| 74 | + /** | ||
| 75 | + * 更新时间 | ||
| 76 | + */ | ||
| 77 | + @ApiModelProperty("更新时间") | ||
| 78 | + @JsonFormat(pattern = StringPool.DATE_TIME_PATTERN) | ||
| 79 | + private LocalDateTime updateTime; | ||
| 80 | + | ||
| 81 | + public ShipmentsPlanBo() { | ||
| 82 | + | ||
| 83 | + } | ||
| 84 | + | ||
| 85 | + public ShipmentsPlanBo(ShipmentsPlan dto) { | ||
| 86 | + | ||
| 87 | + super(dto); | ||
| 88 | + } | ||
| 89 | + | ||
| 90 | + @Override | ||
| 91 | + public BaseBo<ShipmentsPlan> convert(ShipmentsPlan dto) { | ||
| 92 | + return super.convert(dto); | ||
| 93 | + } | ||
| 94 | + | ||
| 95 | + @Override | ||
| 96 | + protected void afterInit(ShipmentsPlan dto) { | ||
| 97 | + | ||
| 98 | + } | ||
| 99 | +} |
xingyun-sc/src/main/java/com/lframework/xingyun/sc/controller/shipments/ShipmentsPlanController.java
0 → 100644
| 1 | +package com.lframework.xingyun.sc.controller.shipments; | ||
| 2 | + | ||
| 3 | +import com.lframework.starter.web.core.controller.DefaultBaseController; | ||
| 4 | +import com.lframework.xingyun.sc.bo.shipments.plan.ShipmentsPlanBo; | ||
| 5 | +import com.lframework.xingyun.sc.vo.shipments.plan.QueryShipmentsPlanVo; | ||
| 6 | +import com.lframework.xingyun.sc.service.shipments.ShipmentsPlanService; | ||
| 7 | +import com.lframework.xingyun.sc.vo.shipments.plan.UpdateShipmentsPlanVo; | ||
| 8 | +import com.lframework.xingyun.sc.entity.ShipmentsPlan; | ||
| 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.components.resp.InvokeResult; | ||
| 12 | + | ||
| 13 | +import javax.annotation.Resource; | ||
| 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.annotations.security.HasPermission; | ||
| 22 | +import org.springframework.validation.annotation.Validated; | ||
| 23 | +import org.springframework.web.bind.annotation.*; | ||
| 24 | + | ||
| 25 | +import javax.validation.Valid; | ||
| 26 | +import java.util.List; | ||
| 27 | +import java.util.stream.Collectors; | ||
| 28 | + | ||
| 29 | +/** | ||
| 30 | + * 发货计划 Controller | ||
| 31 | + * | ||
| 32 | + */ | ||
| 33 | +@Api(tags = "发货计划") | ||
| 34 | +@Validated | ||
| 35 | +@RestController | ||
| 36 | +@RequestMapping("/shipments/plan") | ||
| 37 | +public class ShipmentsPlanController extends DefaultBaseController { | ||
| 38 | + | ||
| 39 | + | ||
| 40 | + @Resource | ||
| 41 | + private ShipmentsPlanService shipmentsPlanService; | ||
| 42 | + | ||
| 43 | + | ||
| 44 | + /** | ||
| 45 | + * 查询列表 | ||
| 46 | + */ | ||
| 47 | + @ApiOperation("查询列表") | ||
| 48 | + @HasPermission({"shipments:plan:query"}) | ||
| 49 | + @GetMapping("/query") | ||
| 50 | + public InvokeResult<PageResult<ShipmentsPlanBo>> query(@Valid QueryShipmentsPlanVo vo) { | ||
| 51 | + PageResult<ShipmentsPlan> pageResult = shipmentsPlanService.query(getPageIndex(vo), getPageSize(vo), vo); | ||
| 52 | + List<ShipmentsPlan> dataList = pageResult.getDatas(); | ||
| 53 | + List<ShipmentsPlanBo> results = null; | ||
| 54 | + if (!CollectionUtil.isEmpty(dataList)) { | ||
| 55 | + results = dataList.stream().map(ShipmentsPlanBo::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({"shipments:plan:query"}) | ||
| 66 | + @GetMapping | ||
| 67 | + public InvokeResult<ShipmentsPlanBo> get(@NotBlank(message = "id不能为空!") String id) { | ||
| 68 | + ShipmentsPlan data = shipmentsPlanService.findById(id); | ||
| 69 | + if (data == null) { | ||
| 70 | + throw new DefaultClientException("发货计划不存在!"); | ||
| 71 | + } | ||
| 72 | + ShipmentsPlanBo result = new ShipmentsPlanBo(data); | ||
| 73 | + | ||
| 74 | + return InvokeResultBuilder.success(result); | ||
| 75 | + } | ||
| 76 | + | ||
| 77 | + /** | ||
| 78 | + * 修改 | ||
| 79 | + */ | ||
| 80 | + @ApiOperation("修改") | ||
| 81 | + @HasPermission({"shipments:plan:modify"}) | ||
| 82 | + @PutMapping | ||
| 83 | + public InvokeResult<Void> update(@Valid UpdateShipmentsPlanVo vo) { | ||
| 84 | + shipmentsPlanService.update(vo); | ||
| 85 | + return InvokeResultBuilder.success(); | ||
| 86 | + } | ||
| 87 | +} |
| 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_plan") | ||
| 20 | +public class ShipmentsPlan extends BaseEntity implements BaseDto { | ||
| 21 | + | ||
| 22 | + private static final long serialVersionUID = 1L; | ||
| 23 | + | ||
| 24 | + public static final String CACHE_NAME = "ShipmentsPlan"; | ||
| 25 | + | ||
| 26 | + /** | ||
| 27 | + * ID | ||
| 28 | + */ | ||
| 29 | + private String id; | ||
| 30 | + | ||
| 31 | + /** | ||
| 32 | + * 生产厂ID | ||
| 33 | + */ | ||
| 34 | + private String workshopId; | ||
| 35 | + | ||
| 36 | + /** | ||
| 37 | + * 状态 | ||
| 38 | + */ | ||
| 39 | + private String status; | ||
| 40 | + | ||
| 41 | + /** | ||
| 42 | + * 明日预发日期 | ||
| 43 | + */ | ||
| 44 | + private LocalDate tomoPreShipDate; | ||
| 45 | + | ||
| 46 | + /** | ||
| 47 | + * 后日预发日期 | ||
| 48 | + */ | ||
| 49 | + private LocalDate afTomoPreShipDate; | ||
| 50 | + | ||
| 51 | + /** | ||
| 52 | + * 创建人ID | ||
| 53 | + */ | ||
| 54 | + @TableField(fill = FieldFill.INSERT) | ||
| 55 | + private String createById; | ||
| 56 | + | ||
| 57 | + /** | ||
| 58 | + * 更新人ID | ||
| 59 | + */ | ||
| 60 | + @TableField(fill = FieldFill.INSERT_UPDATE) | ||
| 61 | + private String updateById; | ||
| 62 | + | ||
| 63 | + /** | ||
| 64 | + * 创建时间 | ||
| 65 | + */ | ||
| 66 | + @TableField(fill = FieldFill.INSERT) | ||
| 67 | + private LocalDateTime createTime; | ||
| 68 | + | ||
| 69 | + /** | ||
| 70 | + * 更新时间 | ||
| 71 | + */ | ||
| 72 | + @TableField(fill = FieldFill.INSERT_UPDATE) | ||
| 73 | + private LocalDateTime updateTime; | ||
| 74 | + | ||
| 75 | +} |
xingyun-sc/src/main/java/com/lframework/xingyun/sc/impl/shipments/ShipmentsPlanServiceImpl.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.xingyun.sc.entity.ShipmentsPlan; | ||
| 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 org.springframework.transaction.annotation.Transactional; | ||
| 19 | +import com.lframework.xingyun.sc.mappers.ShipmentsPlanMapper; | ||
| 20 | +import com.lframework.xingyun.sc.service.shipments.ShipmentsPlanService; | ||
| 21 | +import com.lframework.xingyun.sc.vo.shipments.plan.CreateShipmentsPlanVo; | ||
| 22 | +import com.lframework.xingyun.sc.vo.shipments.plan.QueryShipmentsPlanVo; | ||
| 23 | +import com.lframework.xingyun.sc.vo.shipments.plan.UpdateShipmentsPlanVo; | ||
| 24 | +import org.springframework.stereotype.Service; | ||
| 25 | + | ||
| 26 | +import java.util.List; | ||
| 27 | + | ||
| 28 | +@Service | ||
| 29 | +public class ShipmentsPlanServiceImpl extends BaseMpServiceImpl<ShipmentsPlanMapper, ShipmentsPlan> implements ShipmentsPlanService { | ||
| 30 | + | ||
| 31 | + | ||
| 32 | + | ||
| 33 | + @Override | ||
| 34 | + public PageResult<ShipmentsPlan> query(Integer pageIndex, Integer pageSize, QueryShipmentsPlanVo vo) { | ||
| 35 | + Assert.greaterThanZero(pageIndex); | ||
| 36 | + Assert.greaterThanZero(pageSize); | ||
| 37 | + // 开启分页 | ||
| 38 | + PageHelperUtil.startPage(pageIndex, pageSize); | ||
| 39 | + List<ShipmentsPlan> dataList = this.query(vo); | ||
| 40 | + | ||
| 41 | + return PageResultUtil.convert(new PageInfo<>(dataList)); | ||
| 42 | + } | ||
| 43 | + | ||
| 44 | + @Override | ||
| 45 | + public List<ShipmentsPlan> query(QueryShipmentsPlanVo vo) { | ||
| 46 | + return getBaseMapper().query(vo); | ||
| 47 | + } | ||
| 48 | + | ||
| 49 | + @Override | ||
| 50 | + public ShipmentsPlan findById(String id) { | ||
| 51 | + return getBaseMapper().selectById(id); | ||
| 52 | + } | ||
| 53 | + | ||
| 54 | + @OpLog(type = OtherOpLogType.class, name = "新增发货计划,ID:{}", params = {"#id"}) | ||
| 55 | + @Transactional(rollbackFor = Exception.class) | ||
| 56 | + @Override | ||
| 57 | + public String create(CreateShipmentsPlanVo vo) { | ||
| 58 | + ShipmentsPlan data = new ShipmentsPlan(); | ||
| 59 | + data.setId(IdUtil.getId()); | ||
| 60 | + data.setWorkshopId(vo.getWorkshopId()); | ||
| 61 | + data.setStatus(vo.getStatus()); | ||
| 62 | + data.setTomoPreShipDate(vo.getTomoPreShipDate()); | ||
| 63 | + data.setAfTomoPreShipDate(vo.getAfTomoPreShipDate()); | ||
| 64 | + | ||
| 65 | + getBaseMapper().insert(data); | ||
| 66 | + | ||
| 67 | + OpLogUtil.setVariable("id", data.getId()); | ||
| 68 | + OpLogUtil.setExtra(vo); | ||
| 69 | + | ||
| 70 | + return data.getId(); | ||
| 71 | + } | ||
| 72 | + | ||
| 73 | + @OpLog(type = OtherOpLogType.class, name = "修改发货计划,ID:{}", params = {"#id"}) | ||
| 74 | + @Transactional(rollbackFor = Exception.class) | ||
| 75 | + @Override | ||
| 76 | + public void update(UpdateShipmentsPlanVo vo) { | ||
| 77 | + ShipmentsPlan data = getBaseMapper().selectById(vo.getId()); | ||
| 78 | + if (ObjectUtil.isNull(data)) { | ||
| 79 | + throw new DefaultClientException("发货计划不存在!"); | ||
| 80 | + } | ||
| 81 | + LambdaUpdateWrapper<ShipmentsPlan> updateWrapper = Wrappers.lambdaUpdate(ShipmentsPlan.class) | ||
| 82 | + .set(ShipmentsPlan::getStatus, vo.getStatus()) | ||
| 83 | + .eq(ShipmentsPlan::getId, vo.getId()); | ||
| 84 | + | ||
| 85 | + getBaseMapper().update(updateWrapper); | ||
| 86 | + | ||
| 87 | + OpLogUtil.setVariable("id", data.getId()); | ||
| 88 | + OpLogUtil.setExtra(vo); | ||
| 89 | + } | ||
| 90 | +} |
| 1 | +package com.lframework.xingyun.sc.mappers; | ||
| 2 | + | ||
| 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; | ||
| 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; | ||
| 10 | +import org.apache.ibatis.annotations.Param; | ||
| 11 | + | ||
| 12 | +import java.util.List; | ||
| 13 | + | ||
| 14 | +/** | ||
| 15 | + * <p> | ||
| 16 | + * 发货计划 Mapper 接口 | ||
| 17 | + * </p> | ||
| 18 | + * | ||
| 19 | + */ | ||
| 20 | +public interface ShipmentsPlanMapper extends BaseMapper<ShipmentsPlan> { | ||
| 21 | + | ||
| 22 | + /** | ||
| 23 | + * 查询列表 | ||
| 24 | + * @param vo | ||
| 25 | + * @return | ||
| 26 | + */ | ||
| 27 | + List<ShipmentsPlan> query(@Param("vo") QueryShipmentsPlanVo vo); | ||
| 28 | +} |
xingyun-sc/src/main/java/com/lframework/xingyun/sc/service/shipments/ShipmentsPlanService.java
0 → 100644
| 1 | +package com.lframework.xingyun.sc.service.shipments; | ||
| 2 | + | ||
| 3 | +import com.lframework.xingyun.sc.vo.shipments.plan.CreateShipmentsPlanVo; | ||
| 4 | +import com.lframework.xingyun.sc.vo.shipments.plan.QueryShipmentsPlanVo; | ||
| 5 | +import com.lframework.xingyun.sc.vo.shipments.plan.UpdateShipmentsPlanVo; | ||
| 6 | +import com.lframework.xingyun.sc.entity.ShipmentsPlan; | ||
| 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 com.lframework.starter.common.utils.ObjectUtil; | ||
| 23 | +import com.lframework.starter.web.core.annotations.oplog.OpLog; | ||
| 24 | +import com.lframework.starter.web.core.utils.PageHelperUtil; | ||
| 25 | +import com.lframework.starter.common.utils.Assert; | ||
| 26 | +import com.lframework.starter.web.inner.components.oplog.OtherOpLogType; | ||
| 27 | +import io.swagger.annotations.ApiModelProperty; | ||
| 28 | +import org.springframework.transaction.annotation.Transactional; | ||
| 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 ShipmentsPlanService extends BaseMpService<ShipmentsPlan> { | ||
| 37 | + | ||
| 38 | + /** | ||
| 39 | + * 查询列表 | ||
| 40 | + * | ||
| 41 | + * @param pageIndex 分页页码 | ||
| 42 | + * @param pageSize 分页大小 | ||
| 43 | + * @param vo 查询条件 | ||
| 44 | + * @return PageResult<ShipmentsPlan> | ||
| 45 | + */ | ||
| 46 | + PageResult<ShipmentsPlan> query(Integer pageIndex, Integer pageSize, QueryShipmentsPlanVo vo); | ||
| 47 | + | ||
| 48 | + /** | ||
| 49 | + * 查询列表 | ||
| 50 | + * | ||
| 51 | + * @param vo 查询条件 | ||
| 52 | + * @return List<ShipmentsPlan> | ||
| 53 | + */ | ||
| 54 | + List<ShipmentsPlan> query(QueryShipmentsPlanVo vo); | ||
| 55 | + | ||
| 56 | + /** | ||
| 57 | + * 根据ID查询 | ||
| 58 | + * | ||
| 59 | + * @param id 主键ID | ||
| 60 | + * @return ShipmentsPlan | ||
| 61 | + */ | ||
| 62 | + ShipmentsPlan findById(String id); | ||
| 63 | + | ||
| 64 | + /** | ||
| 65 | + * 创建 | ||
| 66 | + * | ||
| 67 | + * @param vo 数据实体 | ||
| 68 | + * @return String | ||
| 69 | + */ | ||
| 70 | + String create(CreateShipmentsPlanVo vo); | ||
| 71 | + | ||
| 72 | + /** | ||
| 73 | + * 修改 | ||
| 74 | + * | ||
| 75 | + * @param vo 数据实体 | ||
| 76 | + */ | ||
| 77 | + void update(UpdateShipmentsPlanVo vo); | ||
| 78 | +} |
xingyun-sc/src/main/java/com/lframework/xingyun/sc/vo/shipments/plan/CreateShipmentsPlanVo.java
0 → 100644
| 1 | +package com.lframework.xingyun.sc.vo.shipments.plan; | ||
| 2 | + | ||
| 3 | +import javax.validation.constraints.NotBlank; | ||
| 4 | +import java.time.LocalDate; | ||
| 5 | +import com.lframework.starter.web.core.utils.IdUtil; | ||
| 6 | +import com.lframework.starter.web.core.vo.BaseVo; | ||
| 7 | +import javax.validation.constraints.NotNull; | ||
| 8 | +import io.swagger.annotations.ApiModelProperty; | ||
| 9 | +import com.lframework.starter.web.core.components.validation.TypeMismatch; | ||
| 10 | +import org.hibernate.validator.constraints.Length; | ||
| 11 | +import java.io.Serializable; | ||
| 12 | +import lombok.Data; | ||
| 13 | + | ||
| 14 | +@Data | ||
| 15 | +public class CreateShipmentsPlanVo implements BaseVo, Serializable { | ||
| 16 | + | ||
| 17 | + private static final long serialVersionUID = 1L; | ||
| 18 | + | ||
| 19 | + /** | ||
| 20 | + * 生产厂ID | ||
| 21 | + */ | ||
| 22 | + @ApiModelProperty(value = "生产厂ID", required = true) | ||
| 23 | + @NotBlank(message = "请输入生产厂ID!") | ||
| 24 | + @Length(message = "生产厂ID最多允许32个字符!") | ||
| 25 | + private String workshopId; | ||
| 26 | + | ||
| 27 | + /** | ||
| 28 | + * 状态 | ||
| 29 | + */ | ||
| 30 | + @ApiModelProperty(value = "状态", required = true) | ||
| 31 | + @NotBlank(message = "请输入状态!") | ||
| 32 | + @Length(message = "状态最多允许20个字符!") | ||
| 33 | + private String status; | ||
| 34 | + | ||
| 35 | + /** | ||
| 36 | + * 明日预发日期 | ||
| 37 | + */ | ||
| 38 | + @ApiModelProperty(value = "明日预发日期", required = true) | ||
| 39 | + @NotNull(message = "请输入明日预发日期!") | ||
| 40 | + @TypeMismatch(message = "明日预发日期格式有误!") | ||
| 41 | + private LocalDate tomoPreShipDate; | ||
| 42 | + | ||
| 43 | + /** | ||
| 44 | + * 后日预发日期 | ||
| 45 | + */ | ||
| 46 | + @ApiModelProperty(value = "后日预发日期", required = true) | ||
| 47 | + @NotNull(message = "请输入后日预发日期!") | ||
| 48 | + @TypeMismatch(message = "后日预发日期格式有误!") | ||
| 49 | + private LocalDate afTomoPreShipDate; | ||
| 50 | + | ||
| 51 | +} |
xingyun-sc/src/main/java/com/lframework/xingyun/sc/vo/shipments/plan/QueryShipmentsPlanVo.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 com.lframework.starter.web.core.vo.BaseVo; | ||
| 6 | +import com.lframework.starter.web.core.components.validation.TypeMismatch; | ||
| 7 | +import io.swagger.annotations.ApiModelProperty; | ||
| 8 | +import java.io.Serializable; | ||
| 9 | +import java.time.LocalDateTime; | ||
| 10 | + | ||
| 11 | +@Data | ||
| 12 | +public class QueryShipmentsPlanVo 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 | + private String status; | ||
| 27 | + | ||
| 28 | + | ||
| 29 | + /** | ||
| 30 | + * 制单时间(创建时间) | ||
| 31 | + */ | ||
| 32 | + @ApiModelProperty("制单时间") | ||
| 33 | + private LocalDateTime createStartTime; | ||
| 34 | + private LocalDateTime createEndTime; | ||
| 35 | +} |
xingyun-sc/src/main/java/com/lframework/xingyun/sc/vo/shipments/plan/UpdateShipmentsPlanVo.java
0 → 100644
| 1 | +package com.lframework.xingyun.sc.vo.shipments.plan; | ||
| 2 | + | ||
| 3 | +import lombok.Data; | ||
| 4 | +import javax.validation.constraints.NotBlank; | ||
| 5 | +import com.lframework.starter.web.core.vo.BaseVo; | ||
| 6 | +import com.lframework.starter.web.core.components.validation.TypeMismatch; | ||
| 7 | +import io.swagger.annotations.ApiModelProperty; | ||
| 8 | +import org.hibernate.validator.constraints.Length; | ||
| 9 | +import java.io.Serializable; | ||
| 10 | + | ||
| 11 | +@Data | ||
| 12 | +public class UpdateShipmentsPlanVo implements BaseVo, Serializable { | ||
| 13 | + | ||
| 14 | + private static final long serialVersionUID = 1L; | ||
| 15 | + | ||
| 16 | + /** | ||
| 17 | + * ID | ||
| 18 | + */ | ||
| 19 | + @ApiModelProperty(value = "ID", required = true) | ||
| 20 | + @NotBlank(message = "id不能为空!") | ||
| 21 | + private String id; | ||
| 22 | + | ||
| 23 | + /** | ||
| 24 | + * 状态 | ||
| 25 | + */ | ||
| 26 | + @ApiModelProperty(value = "状态", required = true) | ||
| 27 | + @NotBlank(message = "请输入状态!") | ||
| 28 | + @Length(message = "状态最多允许20个字符!") | ||
| 29 | + private String status; | ||
| 30 | + | ||
| 31 | +} |
| 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.ShipmentsPlanMapper"> | ||
| 4 | + | ||
| 5 | + <resultMap id="ShipmentsPlan" type="com.lframework.xingyun.sc.entity.ShipmentsPlan"> | ||
| 6 | + <id column="id" property="id"/> | ||
| 7 | + <result column="workshop_id" property="workshopId"/> | ||
| 8 | + <result column="status" property="status"/> | ||
| 9 | + <result column="tomo_pre_ship_date" property="tomoPreShipDate"/> | ||
| 10 | + <result column="af_tomo_pre_ship_date" property="afTomoPreShipDate"/> | ||
| 11 | + <result column="create_by_id" property="createById"/> | ||
| 12 | + <result column="update_by_id" property="updateById"/> | ||
| 13 | + <result column="create_time" property="createTime"/> | ||
| 14 | + <result column="update_time" property="updateTime"/> | ||
| 15 | + </resultMap> | ||
| 16 | + | ||
| 17 | + <sql id="ShipmentsPlan_sql"> | ||
| 18 | + SELECT | ||
| 19 | + tb.id, | ||
| 20 | + tb.workshop_id, | ||
| 21 | + tb.status, | ||
| 22 | + tb.tomo_pre_ship_date, | ||
| 23 | + tb.af_tomo_pre_ship_date, | ||
| 24 | + tb.create_by_id, | ||
| 25 | + tb.update_by_id, | ||
| 26 | + tb.create_time, | ||
| 27 | + tb.update_time | ||
| 28 | + FROM shipments_plan AS tb | ||
| 29 | + </sql> | ||
| 30 | + | ||
| 31 | + <select id="query" resultMap="ShipmentsPlan"> | ||
| 32 | + <include refid="ShipmentsPlan_sql"/> | ||
| 33 | + <where> | ||
| 34 | + <if test="vo.workshopId != null and vo.workshopId != ''"> | ||
| 35 | + AND tb.workshop_id = #{vo.workshopId} | ||
| 36 | + </if> | ||
| 37 | + <if test="vo.status != null and vo.status != ''"> | ||
| 38 | + AND tb.status = #{vo.status} | ||
| 39 | + </if> | ||
| 40 | + </where> | ||
| 41 | + </select> | ||
| 42 | +</mapper> |