Commit 27a98db627326817846c0fcbb5133b11b09e3603

Authored by 房远帅
1 parent 52cd7fe1

楚江ERP:发货计划-要车单实体新建

  1 +package com.lframework.xingyun.sc.bo.shipments.car;
  2 +
  3 +import com.fasterxml.jackson.annotation.JsonFormat;
  4 +import java.math.BigDecimal;
  5 +import com.lframework.starter.common.constants.StringPool;
  6 +import com.lframework.starter.web.core.bo.BaseBo;
  7 +import java.time.LocalDate;
  8 +import com.lframework.xingyun.sc.entity.RequestCarTicket;
  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 GetRequestCarTicketBo extends BaseBo<RequestCarTicket> {
  21 +
  22 + /**
  23 + * ID
  24 + */
  25 + @ApiModelProperty("ID")
  26 + private String id;
  27 +
  28 + /**
  29 + * 要车日期
  30 + */
  31 + @ApiModelProperty("要车日期")
  32 + @JsonFormat(pattern = StringPool.DATE_PATTERN)
  33 + private LocalDate requestCarData;
  34 +
  35 + /**
  36 + * 要车办事处
  37 + */
  38 + @ApiModelProperty("要车办事处")
  39 + private String deptId;
  40 +
  41 + /**
  42 + * 计划装货日期
  43 + */
  44 + @ApiModelProperty("计划装货日期")
  45 + @JsonFormat(pattern = StringPool.DATE_PATTERN)
  46 + private LocalDate deliveryDate;
  47 +
  48 + /**
  49 + * 装货厂别
  50 + */
  51 + @ApiModelProperty("装货厂别")
  52 + private String workshopId;
  53 +
  54 + /**
  55 + * 订单编号
  56 + */
  57 + @ApiModelProperty("订单编号")
  58 + private String orderNo;
  59 +
  60 + /**
  61 + * 客户名称【简称】
  62 + */
  63 + @ApiModelProperty("客户名称【简称】")
  64 + private String customerShortName;
  65 +
  66 + /**
  67 + * 卸货地点
  68 + */
  69 + @ApiModelProperty("卸货地点")
  70 + private String destination;
  71 +
  72 + /**
  73 + * 计划吨位
  74 + */
  75 + @ApiModelProperty("计划吨位")
  76 + private BigDecimal quantity;
  77 +
  78 + /**
  79 + * 接货人联络人
  80 + */
  81 + @ApiModelProperty("接货人联络人")
  82 + private String consignee;
  83 +
  84 + /**
  85 + * 联系电话
  86 + */
  87 + @ApiModelProperty("联系电话")
  88 + private String phone;
  89 +
  90 + /**
  91 + * 回货计划安排(退料/角料)
  92 + */
  93 + @ApiModelProperty("回货计划安排(退料/角料)")
  94 + private String returnPlanArrangement;
  95 +
  96 + /**
  97 + * 特殊需求、其他等
  98 + */
  99 + @ApiModelProperty("特殊需求、其他等")
  100 + private String other;
  101 +
  102 + /**
  103 + * 外办审核人
  104 + */
  105 + @ApiModelProperty("外办审核人")
  106 + private String externalAuditor;
  107 +
  108 + /**
  109 + * 装货时间
  110 + */
  111 + @ApiModelProperty("装货时间")
  112 + private String loadingTime;
  113 +
  114 + /**
  115 + * 装货特别要求/需求
  116 + */
  117 + @ApiModelProperty("装货特别要求/需求")
  118 + private String specialLoadingRequirement;
  119 +
  120 + /**
  121 + * 经营办审核人
  122 + */
  123 + @ApiModelProperty("经营办审核人")
  124 + private String businessOfficeAuditor;
  125 +
  126 + /**
  127 + * 运作科审核人
  128 + */
  129 + @ApiModelProperty("运作科审核人")
  130 + private String operationsDepartmentAuditor;
  131 +
  132 + public GetRequestCarTicketBo() {
  133 +
  134 + }
  135 +
  136 + public GetRequestCarTicketBo(RequestCarTicket dto) {
  137 +
  138 + super(dto);
  139 + }
  140 +
  141 + @Override
  142 + public BaseBo<RequestCarTicket> convert(RequestCarTicket dto) {
  143 + return super.convert(dto);
  144 + }
  145 +
  146 + @Override
  147 + protected void afterInit(RequestCarTicket dto) {
  148 +
  149 + }
  150 +}
... ...
  1 +package com.lframework.xingyun.sc.controller.shipments.car;
  2 +
  3 +import com.lframework.starter.web.core.annotations.security.HasPermission;
  4 +import com.lframework.starter.web.core.controller.DefaultBaseController;
  5 +import com.lframework.starter.web.core.utils.PageResultUtil;
  6 +import com.lframework.starter.web.core.components.resp.PageResult;
  7 +import com.lframework.starter.web.core.components.resp.InvokeResult;
  8 +import javax.validation.constraints.NotBlank;
  9 +import com.lframework.xingyun.sc.bo.shipments.car.GetRequestCarTicketBo;
  10 +import com.lframework.xingyun.sc.entity.RequestCarTicket;
  11 +import com.lframework.xingyun.sc.service.shipments.car.RequestCarTicketService;
  12 +import com.lframework.xingyun.sc.vo.shipments.car.CreateRequestCarTicketVo;
  13 +import com.lframework.xingyun.sc.vo.shipments.car.QueryRequestCarTicketVo;
  14 +import com.lframework.xingyun.sc.vo.shipments.car.UpdateRequestCarTicketVo;
  15 +import io.swagger.annotations.ApiImplicitParam;
  16 +import com.lframework.starter.web.core.components.resp.InvokeResultBuilder;
  17 +import com.lframework.starter.common.exceptions.impl.DefaultClientException;
  18 +import io.swagger.annotations.ApiOperation;
  19 +import com.lframework.starter.common.utils.CollectionUtil;
  20 +import io.swagger.annotations.Api;
  21 +import org.springframework.web.bind.annotation.DeleteMapping;
  22 +import org.springframework.beans.factory.annotation.Autowired;
  23 +import org.springframework.validation.annotation.Validated;
  24 +import org.springframework.web.bind.annotation.*;
  25 +
  26 +import javax.validation.Valid;
  27 +import java.util.List;
  28 +import java.util.stream.Collectors;
  29 +
  30 +/**
  31 + * 要车单表 Controller
  32 + *
  33 + */
  34 +@Api(tags = "要车单表")
  35 +@Validated
  36 +@RestController
  37 +@RequestMapping("/requestCarTicket")
  38 +public class RequestCarTicketController extends DefaultBaseController {
  39 +
  40 + @Autowired
  41 + private RequestCarTicketService requestCarTicketService;
  42 +
  43 + /**
  44 + * 查询列表
  45 + */
  46 + @ApiOperation("查询列表")
  47 + @HasPermission({"requestCarTicket:requestcarticket:query"})
  48 + @GetMapping("/query")
  49 + public InvokeResult<PageResult<GetRequestCarTicketBo>> query(@Valid QueryRequestCarTicketVo vo) {
  50 +
  51 + PageResult<RequestCarTicket> pageResult = requestCarTicketService.query(getPageIndex(vo), getPageSize(vo), vo);
  52 +
  53 + List<RequestCarTicket> datas = pageResult.getDatas();
  54 + List<GetRequestCarTicketBo> results = null;
  55 +
  56 + if (!CollectionUtil.isEmpty(datas)) {
  57 + results = datas.stream().map(GetRequestCarTicketBo::new).collect(Collectors.toList());
  58 + }
  59 +
  60 + return InvokeResultBuilder.success(PageResultUtil.rebuild(pageResult, results));
  61 + }
  62 +
  63 + /**
  64 + * 根据ID查询
  65 + */
  66 + @ApiOperation("根据ID查询")
  67 + @ApiImplicitParam(value = "id", name = "id", paramType = "query", required = true)
  68 + @HasPermission({"requestCarTicket:requestcarticket:query"})
  69 + @GetMapping
  70 + public InvokeResult<GetRequestCarTicketBo> get(@NotBlank(message = "id不能为空!") String id) {
  71 +
  72 + RequestCarTicket data = requestCarTicketService.findById(id);
  73 + if (data == null) {
  74 + throw new DefaultClientException("要车单表不存在!");
  75 + }
  76 +
  77 + GetRequestCarTicketBo result = new GetRequestCarTicketBo(data);
  78 +
  79 + return InvokeResultBuilder.success(result);
  80 + }
  81 +
  82 + /**
  83 + * 新增
  84 + */
  85 + @ApiOperation("新增")
  86 + @HasPermission({"requestCarTicket:requestcarticket:add"})
  87 + @PostMapping
  88 + public InvokeResult<Void> create(@Valid CreateRequestCarTicketVo vo) {
  89 +
  90 + requestCarTicketService.create(vo);
  91 +
  92 + return InvokeResultBuilder.success();
  93 + }
  94 +
  95 + /**
  96 + * 修改
  97 + */
  98 + @ApiOperation("修改")
  99 + @HasPermission({"requestCarTicket:requestcarticket:modify"})
  100 + @PutMapping
  101 + public InvokeResult<Void> update(@Valid UpdateRequestCarTicketVo vo) {
  102 +
  103 + requestCarTicketService.update(vo);
  104 +
  105 + return InvokeResultBuilder.success();
  106 + }
  107 +
  108 + /**
  109 + * 根据ID删除
  110 + */
  111 + @ApiOperation("根据ID删除")
  112 + @ApiImplicitParam(value = "id", name = "id", paramType = "query", required = true)
  113 + @HasPermission({"requestCarTicket:requestcarticket:delete"})
  114 + @DeleteMapping
  115 + public InvokeResult<Void> deleteById(@NotBlank(message = "id不能为空!") String id) {
  116 +
  117 + requestCarTicketService.deleteById(id);
  118 +
  119 + return InvokeResultBuilder.success();
  120 + }
  121 +}
... ...
  1 +package com.lframework.xingyun.sc.entity;
  2 +
  3 +import com.baomidou.mybatisplus.annotation.TableName;
  4 +import java.math.BigDecimal;
  5 +import com.lframework.starter.web.core.dto.BaseDto;
  6 +import java.time.LocalDate;
  7 +import java.time.LocalDateTime;
  8 +import com.baomidou.mybatisplus.annotation.FieldFill;
  9 +import com.lframework.starter.web.core.entity.BaseEntity;
  10 +import com.baomidou.mybatisplus.annotation.TableField;
  11 +import lombok.Data;
  12 +
  13 +/**
  14 + * <p>
  15 + * 要车单表
  16 + * </p>
  17 + *
  18 + */
  19 +@Data
  20 +@TableName("request_car_ticket")
  21 +public class RequestCarTicket extends BaseEntity implements BaseDto {
  22 +
  23 + private static final long serialVersionUID = 1L;
  24 +
  25 + public static final String CACHE_NAME = "RequestCarTicket";
  26 +
  27 + /**
  28 + * ID
  29 + */
  30 + private String id;
  31 +
  32 + /**
  33 + * 要车日期
  34 + */
  35 + private LocalDate requestCarData;
  36 +
  37 + /**
  38 + * 要车办事处
  39 + */
  40 + private String deptId;
  41 +
  42 + /**
  43 + * 计划装货日期
  44 + */
  45 + private LocalDate deliveryDate;
  46 +
  47 + /**
  48 + * 装货厂别
  49 + */
  50 + private String workshopId;
  51 +
  52 + /**
  53 + * 订单编号
  54 + */
  55 + private String orderNo;
  56 +
  57 + /**
  58 + * 客户名称【简称】
  59 + */
  60 + private String customerShortName;
  61 +
  62 + /**
  63 + * 卸货地点
  64 + */
  65 + private String destination;
  66 +
  67 + /**
  68 + * 计划吨位
  69 + */
  70 + private BigDecimal quantity;
  71 +
  72 + /**
  73 + * 接货人联络人
  74 + */
  75 + private String consignee;
  76 +
  77 + /**
  78 + * 联系电话
  79 + */
  80 + private String phone;
  81 +
  82 + /**
  83 + * 回货计划安排(退料/角料)
  84 + */
  85 + private String returnPlanArrangement;
  86 +
  87 + /**
  88 + * 特殊需求、其他等
  89 + */
  90 + private String other;
  91 +
  92 + /**
  93 + * 外办审核人
  94 + */
  95 + private String externalAuditor;
  96 +
  97 + /**
  98 + * 装货时间
  99 + */
  100 + private String loadingTime;
  101 +
  102 + /**
  103 + * 装货特别要求/需求
  104 + */
  105 + private String specialLoadingRequirement;
  106 +
  107 + /**
  108 + * 经营办审核人
  109 + */
  110 + private String businessOfficeAuditor;
  111 +
  112 + /**
  113 + * 运作科审核人
  114 + */
  115 + private String operationsDepartmentAuditor;
  116 +
  117 + /**
  118 + * 创建人ID
  119 + */
  120 + @TableField(fill = FieldFill.INSERT)
  121 + private String createById;
  122 +
  123 + /**
  124 + * 创建人
  125 + */
  126 + @TableField(fill = FieldFill.INSERT)
  127 + private String createBy;
  128 +
  129 + /**
  130 + * 更新人ID
  131 + */
  132 + @TableField(fill = FieldFill.INSERT_UPDATE)
  133 + private String updateById;
  134 +
  135 + /**
  136 + * 更新人
  137 + */
  138 + @TableField(fill = FieldFill.INSERT_UPDATE)
  139 + private String updateBy;
  140 +
  141 + /**
  142 + * 创建时间
  143 + */
  144 + @TableField(fill = FieldFill.INSERT)
  145 + private LocalDateTime createTime;
  146 +
  147 + /**
  148 + * 更新时间
  149 + */
  150 + @TableField(fill = FieldFill.INSERT_UPDATE)
  151 + private LocalDateTime updateTime;
  152 +
  153 +}
... ...
  1 +package com.lframework.xingyun.sc.impl.shipments.car;
  2 +
  3 +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
  4 +import com.baomidou.mybatisplus.core.toolkit.Wrappers;
  5 +import com.github.pagehelper.PageInfo;
  6 +import com.lframework.starter.web.core.impl.BaseMpServiceImpl;
  7 +import com.lframework.starter.web.core.utils.PageResultUtil;
  8 +import com.lframework.starter.web.core.components.resp.PageResult;
  9 +import com.lframework.starter.web.core.utils.OpLogUtil;
  10 +import com.lframework.starter.common.utils.StringUtil;
  11 +import com.lframework.starter.common.exceptions.impl.DefaultClientException;
  12 +import java.io.Serializable;
  13 +import com.lframework.starter.web.core.utils.IdUtil;
  14 +import com.lframework.starter.common.utils.ObjectUtil;
  15 +import com.lframework.starter.web.core.annotations.oplog.OpLog;
  16 +import com.lframework.starter.web.core.utils.PageHelperUtil;
  17 +import com.lframework.starter.common.utils.Assert;
  18 +import com.lframework.starter.web.inner.components.oplog.OtherOpLogType;
  19 +import com.lframework.xingyun.sc.entity.RequestCarTicket;
  20 +import com.lframework.xingyun.sc.mappers.RequestCarTicketMapper;
  21 +import com.lframework.xingyun.sc.service.shipments.car.RequestCarTicketService;
  22 +import com.lframework.xingyun.sc.vo.shipments.car.CreateRequestCarTicketVo;
  23 +import com.lframework.xingyun.sc.vo.shipments.car.QueryRequestCarTicketVo;
  24 +import com.lframework.xingyun.sc.vo.shipments.car.UpdateRequestCarTicketVo;
  25 +import org.springframework.transaction.annotation.Transactional;
  26 +import org.springframework.stereotype.Service;
  27 +
  28 +import java.util.List;
  29 +
  30 +@Service
  31 +public class RequestCarTicketServiceImpl extends BaseMpServiceImpl<RequestCarTicketMapper, RequestCarTicket> implements RequestCarTicketService {
  32 +
  33 + @Override
  34 + public PageResult<RequestCarTicket> query(Integer pageIndex, Integer pageSize, QueryRequestCarTicketVo vo) {
  35 +
  36 + Assert.greaterThanZero(pageIndex);
  37 + Assert.greaterThanZero(pageSize);
  38 +
  39 + PageHelperUtil.startPage(pageIndex, pageSize);
  40 + List<RequestCarTicket> datas = this.query(vo);
  41 +
  42 + return PageResultUtil.convert(new PageInfo<>(datas));
  43 + }
  44 +
  45 + @Override
  46 + public List<RequestCarTicket> query(QueryRequestCarTicketVo vo) {
  47 +
  48 + return getBaseMapper().query(vo);
  49 + }
  50 +
  51 + @Override
  52 + public RequestCarTicket findById(String id) {
  53 +
  54 + return getBaseMapper().selectById(id);
  55 + }
  56 +
  57 + @OpLog(type = OtherOpLogType.class, name = "新增要车单表,ID:{}", params = {"#id"})
  58 + @Transactional(rollbackFor = Exception.class)
  59 + @Override
  60 + public String create(CreateRequestCarTicketVo vo) {
  61 +
  62 + RequestCarTicket data = new RequestCarTicket();
  63 + data.setId(IdUtil.getId());
  64 + if (vo.getRequestCarData() != null) {
  65 + data.setRequestCarData(vo.getRequestCarData());
  66 + }
  67 + if (!StringUtil.isBlank(vo.getDeptId())) {
  68 + data.setDeptId(vo.getDeptId());
  69 + }
  70 + if (vo.getDeliveryDate() != null) {
  71 + data.setDeliveryDate(vo.getDeliveryDate());
  72 + }
  73 + if (!StringUtil.isBlank(vo.getWorkshopId())) {
  74 + data.setWorkshopId(vo.getWorkshopId());
  75 + }
  76 + if (!StringUtil.isBlank(vo.getOrderNo())) {
  77 + data.setOrderNo(vo.getOrderNo());
  78 + }
  79 + if (!StringUtil.isBlank(vo.getCustomerShortName())) {
  80 + data.setCustomerShortName(vo.getCustomerShortName());
  81 + }
  82 + if (!StringUtil.isBlank(vo.getDestination())) {
  83 + data.setDestination(vo.getDestination());
  84 + }
  85 + if (vo.getQuantity() != null) {
  86 + data.setQuantity(vo.getQuantity());
  87 + }
  88 + if (!StringUtil.isBlank(vo.getConsignee())) {
  89 + data.setConsignee(vo.getConsignee());
  90 + }
  91 + if (!StringUtil.isBlank(vo.getPhone())) {
  92 + data.setPhone(vo.getPhone());
  93 + }
  94 + if (!StringUtil.isBlank(vo.getReturnPlanArrangement())) {
  95 + data.setReturnPlanArrangement(vo.getReturnPlanArrangement());
  96 + }
  97 + if (!StringUtil.isBlank(vo.getOther())) {
  98 + data.setOther(vo.getOther());
  99 + }
  100 + if (!StringUtil.isBlank(vo.getExternalAuditor())) {
  101 + data.setExternalAuditor(vo.getExternalAuditor());
  102 + }
  103 + if (!StringUtil.isBlank(vo.getLoadingTime())) {
  104 + data.setLoadingTime(vo.getLoadingTime());
  105 + }
  106 + if (!StringUtil.isBlank(vo.getSpecialLoadingRequirement())) {
  107 + data.setSpecialLoadingRequirement(vo.getSpecialLoadingRequirement());
  108 + }
  109 + if (!StringUtil.isBlank(vo.getBusinessOfficeAuditor())) {
  110 + data.setBusinessOfficeAuditor(vo.getBusinessOfficeAuditor());
  111 + }
  112 + if (!StringUtil.isBlank(vo.getOperationsDepartmentAuditor())) {
  113 + data.setOperationsDepartmentAuditor(vo.getOperationsDepartmentAuditor());
  114 + }
  115 +
  116 + getBaseMapper().insert(data);
  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(UpdateRequestCarTicketVo vo) {
  128 +
  129 + RequestCarTicket data = getBaseMapper().selectById(vo.getId());
  130 + if (ObjectUtil.isNull(data)) {
  131 + throw new DefaultClientException("要车单表不存在!");
  132 + }
  133 +
  134 + LambdaUpdateWrapper<RequestCarTicket> updateWrapper = Wrappers.lambdaUpdate(RequestCarTicket.class)
  135 + .set(RequestCarTicket::getRequestCarData, vo.getRequestCarData() == null ? null : vo.getRequestCarData())
  136 + .set(RequestCarTicket::getDeptId, StringUtil.isBlank(vo.getDeptId()) ? null : vo.getDeptId())
  137 + .set(RequestCarTicket::getDeliveryDate, vo.getDeliveryDate() == null ? null : vo.getDeliveryDate())
  138 + .set(RequestCarTicket::getWorkshopId, StringUtil.isBlank(vo.getWorkshopId()) ? null : vo.getWorkshopId())
  139 + .set(RequestCarTicket::getOrderNo, StringUtil.isBlank(vo.getOrderNo()) ? null : vo.getOrderNo())
  140 + .set(RequestCarTicket::getCustomerShortName, StringUtil.isBlank(vo.getCustomerShortName()) ? null : vo.getCustomerShortName())
  141 + .set(RequestCarTicket::getDestination, StringUtil.isBlank(vo.getDestination()) ? null : vo.getDestination())
  142 + .set(RequestCarTicket::getQuantity, vo.getQuantity() == null ? null : vo.getQuantity())
  143 + .set(RequestCarTicket::getConsignee, StringUtil.isBlank(vo.getConsignee()) ? null : vo.getConsignee())
  144 + .set(RequestCarTicket::getPhone, StringUtil.isBlank(vo.getPhone()) ? null : vo.getPhone())
  145 + .set(RequestCarTicket::getReturnPlanArrangement, StringUtil.isBlank(vo.getReturnPlanArrangement()) ? null : vo.getReturnPlanArrangement())
  146 + .set(RequestCarTicket::getOther, StringUtil.isBlank(vo.getOther()) ? null : vo.getOther())
  147 + .set(RequestCarTicket::getExternalAuditor, StringUtil.isBlank(vo.getExternalAuditor()) ? null : vo.getExternalAuditor())
  148 + .set(RequestCarTicket::getLoadingTime, StringUtil.isBlank(vo.getLoadingTime()) ? null : vo.getLoadingTime())
  149 + .set(RequestCarTicket::getSpecialLoadingRequirement, StringUtil.isBlank(vo.getSpecialLoadingRequirement()) ? null : vo.getSpecialLoadingRequirement())
  150 + .set(RequestCarTicket::getBusinessOfficeAuditor, StringUtil.isBlank(vo.getBusinessOfficeAuditor()) ? null : vo.getBusinessOfficeAuditor())
  151 + .set(RequestCarTicket::getOperationsDepartmentAuditor, StringUtil.isBlank(vo.getOperationsDepartmentAuditor()) ? null : vo.getOperationsDepartmentAuditor())
  152 + .eq(RequestCarTicket::getId, vo.getId());
  153 +
  154 + getBaseMapper().update(updateWrapper);
  155 +
  156 + OpLogUtil.setVariable("id", data.getId());
  157 + OpLogUtil.setExtra(vo);
  158 + }
  159 +
  160 + @OpLog(type = OtherOpLogType.class, name = "删除要车单表,ID:{}", params = {"#id"})
  161 + @Transactional(rollbackFor = Exception.class)
  162 + @Override
  163 + public void deleteById(String id) {
  164 +
  165 + getBaseMapper().deleteById(id);
  166 + }
  167 +
  168 + @Override
  169 + public void cleanCacheByKey(Serializable key) {
  170 +
  171 + }
  172 +}
... ...
  1 +package com.lframework.xingyun.sc.mappers;
  2 +
  3 +import com.lframework.starter.web.core.mapper.BaseMapper;
  4 +import com.lframework.xingyun.sc.entity.RequestCarTicket;
  5 +import com.lframework.xingyun.sc.vo.shipments.car.QueryRequestCarTicketVo;
  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 RequestCarTicketMapper extends BaseMapper<RequestCarTicket> {
  17 +
  18 + /**
  19 + * 查询列表
  20 + * @param vo
  21 + * @return
  22 + */
  23 + List<RequestCarTicket> query(@Param("vo") QueryRequestCarTicketVo vo);
  24 +}
... ...
  1 +package com.lframework.xingyun.sc.service.shipments.car;
  2 +
  3 +import com.lframework.starter.web.core.service.BaseMpService;
  4 +import com.lframework.starter.web.core.components.resp.PageResult;
  5 +import com.lframework.xingyun.sc.entity.RequestCarTicket;
  6 +import com.lframework.xingyun.sc.vo.shipments.car.CreateRequestCarTicketVo;
  7 +import com.lframework.xingyun.sc.vo.shipments.car.QueryRequestCarTicketVo;
  8 +import com.lframework.xingyun.sc.vo.shipments.car.UpdateRequestCarTicketVo;
  9 +import java.util.List;
  10 +
  11 +/**
  12 + * 要车单表 Service
  13 + */
  14 +public interface RequestCarTicketService extends BaseMpService<RequestCarTicket> {
  15 +
  16 + /**
  17 + * 查询列表
  18 + * @return
  19 + */
  20 + PageResult<RequestCarTicket> query(Integer pageIndex, Integer pageSize, QueryRequestCarTicketVo vo);
  21 +
  22 + /**
  23 + * 查询列表
  24 + * @param vo
  25 + * @return
  26 + */
  27 + List<RequestCarTicket> query(QueryRequestCarTicketVo vo);
  28 +
  29 + /**
  30 + * 根据ID查询
  31 + * @param id
  32 + * @return
  33 + */
  34 + RequestCarTicket findById(String id);
  35 +
  36 + /**
  37 + * 创建
  38 + * @param vo
  39 + * @return
  40 + */
  41 + String create(CreateRequestCarTicketVo vo);
  42 +
  43 + /**
  44 + * 修改
  45 + * @param vo
  46 + */
  47 + void update(UpdateRequestCarTicketVo vo);
  48 +
  49 + /**
  50 + * 根据ID删除
  51 + * @param id
  52 + * @return
  53 + */
  54 + void deleteById(String id);
  55 +}
... ...
  1 +package com.lframework.xingyun.sc.vo.shipments.car;
  2 +
  3 +import com.lframework.starter.web.core.components.validation.IsNumberPrecision;
  4 +import java.math.BigDecimal;
  5 +import java.time.LocalDate;
  6 +import com.lframework.starter.web.core.vo.BaseVo;
  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 CreateRequestCarTicketVo implements BaseVo, Serializable {
  15 +
  16 + private static final long serialVersionUID = 1L;
  17 +
  18 + /**
  19 + * 要车日期
  20 + */
  21 + @ApiModelProperty("要车日期")
  22 + @TypeMismatch(message = "要车日期格式有误!")
  23 + private LocalDate requestCarData;
  24 +
  25 + /**
  26 + * 要车办事处
  27 + */
  28 + @ApiModelProperty("要车办事处")
  29 + @Length(message = "要车办事处最多允许32个字符!")
  30 + private String deptId;
  31 +
  32 + /**
  33 + * 计划装货日期
  34 + */
  35 + @ApiModelProperty("计划装货日期")
  36 + @TypeMismatch(message = "计划装货日期格式有误!")
  37 + private LocalDate deliveryDate;
  38 +
  39 + /**
  40 + * 装货厂别
  41 + */
  42 + @ApiModelProperty("装货厂别")
  43 + @Length(message = "装货厂别最多允许32个字符!")
  44 + private String workshopId;
  45 +
  46 + /**
  47 + * 订单编号
  48 + */
  49 + @ApiModelProperty("订单编号")
  50 + @Length(message = "订单编号最多允许50个字符!")
  51 + private String orderNo;
  52 +
  53 + /**
  54 + * 客户名称【简称】
  55 + */
  56 + @ApiModelProperty("客户名称【简称】")
  57 + @Length(message = "客户名称【简称】最多允许100个字符!")
  58 + private String customerShortName;
  59 +
  60 + /**
  61 + * 卸货地点
  62 + */
  63 + @ApiModelProperty("卸货地点")
  64 + @Length(message = "卸货地点最多允许200个字符!")
  65 + private String destination;
  66 +
  67 + /**
  68 + * 计划吨位
  69 + */
  70 + @ApiModelProperty("计划吨位")
  71 + @TypeMismatch(message = "计划吨位格式有误!")
  72 + @IsNumberPrecision(message = "计划吨位最多允许4位小数!", value = 4)
  73 + private BigDecimal quantity;
  74 +
  75 + /**
  76 + * 接货人联络人
  77 + */
  78 + @ApiModelProperty("接货人联络人")
  79 + @Length(message = "接货人联络人最多允许50个字符!")
  80 + private String consignee;
  81 +
  82 + /**
  83 + * 联系电话
  84 + */
  85 + @ApiModelProperty("联系电话")
  86 + @Length(message = "联系电话最多允许50个字符!")
  87 + private String phone;
  88 +
  89 + /**
  90 + * 回货计划安排(退料/角料)
  91 + */
  92 + @ApiModelProperty("回货计划安排(退料/角料)")
  93 + @Length(message = "回货计划安排(退料/角料)最多允许500个字符!")
  94 + private String returnPlanArrangement;
  95 +
  96 + /**
  97 + * 特殊需求、其他等
  98 + */
  99 + @ApiModelProperty("特殊需求、其他等")
  100 + @Length(message = "特殊需求、其他等最多允许500个字符!")
  101 + private String other;
  102 +
  103 + /**
  104 + * 外办审核人
  105 + */
  106 + @ApiModelProperty("外办审核人")
  107 + @Length(message = "外办审核人最多允许50个字符!")
  108 + private String externalAuditor;
  109 +
  110 + /**
  111 + * 装货时间
  112 + */
  113 + @ApiModelProperty("装货时间")
  114 + @Length(message = "装货时间最多允许20个字符!")
  115 + private String loadingTime;
  116 +
  117 + /**
  118 + * 装货特别要求/需求
  119 + */
  120 + @ApiModelProperty("装货特别要求/需求")
  121 + @Length(message = "装货特别要求/需求最多允许500个字符!")
  122 + private String specialLoadingRequirement;
  123 +
  124 + /**
  125 + * 经营办审核人
  126 + */
  127 + @ApiModelProperty("经营办审核人")
  128 + @Length(message = "经营办审核人最多允许50个字符!")
  129 + private String businessOfficeAuditor;
  130 +
  131 + /**
  132 + * 运作科审核人
  133 + */
  134 + @ApiModelProperty("运作科审核人")
  135 + @Length(message = "运作科审核人最多允许50个字符!")
  136 + private String operationsDepartmentAuditor;
  137 +
  138 +}
... ...
  1 +package com.lframework.xingyun.sc.vo.shipments.car;
  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 QueryRequestCarTicketVo extends PageVo implements BaseVo, Serializable {
  13 +
  14 + private static final long serialVersionUID = 1L;
  15 +
  16 + /**
  17 + * 要车日期
  18 + */
  19 + @ApiModelProperty("要车日期")
  20 + @TypeMismatch(message = "要车日期格式有误!")
  21 + private LocalDate requestCarData;
  22 +
  23 + /**
  24 + * 装货厂别
  25 + */
  26 + @ApiModelProperty("装货厂别")
  27 + private String workshopId;
  28 +
  29 + /**
  30 + * 订单编号
  31 + */
  32 + @ApiModelProperty("订单编号")
  33 + private String orderNo;
  34 +
  35 + /**
  36 + * 客户名称【简称】
  37 + */
  38 + @ApiModelProperty("客户名称【简称】")
  39 + private String customerShortName;
  40 +
  41 +}
... ...
  1 +package com.lframework.xingyun.sc.vo.shipments.car;
  2 +
  3 +import lombok.Data;
  4 +import com.lframework.starter.web.core.components.validation.IsNumberPrecision;
  5 +import java.math.BigDecimal;
  6 +import javax.validation.constraints.NotBlank;
  7 +import java.time.LocalDate;
  8 +import com.lframework.starter.web.core.vo.BaseVo;
  9 +import com.lframework.starter.web.core.components.validation.TypeMismatch;
  10 +import io.swagger.annotations.ApiModelProperty;
  11 +import org.hibernate.validator.constraints.Length;
  12 +import java.io.Serializable;
  13 +
  14 +@Data
  15 +public class UpdateRequestCarTicketVo 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 + private String id;
  25 +
  26 + /**
  27 + * 要车日期
  28 + */
  29 + @ApiModelProperty("要车日期")
  30 + @TypeMismatch(message = "要车日期格式有误!")
  31 + private LocalDate requestCarData;
  32 +
  33 + /**
  34 + * 要车办事处
  35 + */
  36 + @ApiModelProperty("要车办事处")
  37 + @Length(message = "要车办事处最多允许32个字符!")
  38 + private String deptId;
  39 +
  40 + /**
  41 + * 计划装货日期
  42 + */
  43 + @ApiModelProperty("计划装货日期")
  44 + @TypeMismatch(message = "计划装货日期格式有误!")
  45 + private LocalDate deliveryDate;
  46 +
  47 + /**
  48 + * 装货厂别
  49 + */
  50 + @ApiModelProperty("装货厂别")
  51 + @Length(message = "装货厂别最多允许32个字符!")
  52 + private String workshopId;
  53 +
  54 + /**
  55 + * 订单编号
  56 + */
  57 + @ApiModelProperty("订单编号")
  58 + @Length(message = "订单编号最多允许50个字符!")
  59 + private String orderNo;
  60 +
  61 + /**
  62 + * 客户名称【简称】
  63 + */
  64 + @ApiModelProperty("客户名称【简称】")
  65 + @Length(message = "客户名称【简称】最多允许100个字符!")
  66 + private String customerShortName;
  67 +
  68 + /**
  69 + * 卸货地点
  70 + */
  71 + @ApiModelProperty("卸货地点")
  72 + @Length(message = "卸货地点最多允许200个字符!")
  73 + private String destination;
  74 +
  75 + /**
  76 + * 计划吨位
  77 + */
  78 + @ApiModelProperty("计划吨位")
  79 + @TypeMismatch(message = "计划吨位格式有误!")
  80 + @IsNumberPrecision(message = "计划吨位最多允许4位小数!", value = 4)
  81 + private BigDecimal quantity;
  82 +
  83 + /**
  84 + * 接货人联络人
  85 + */
  86 + @ApiModelProperty("接货人联络人")
  87 + @Length(message = "接货人联络人最多允许50个字符!")
  88 + private String consignee;
  89 +
  90 + /**
  91 + * 联系电话
  92 + */
  93 + @ApiModelProperty("联系电话")
  94 + @Length(message = "联系电话最多允许50个字符!")
  95 + private String phone;
  96 +
  97 + /**
  98 + * 回货计划安排(退料/角料)
  99 + */
  100 + @ApiModelProperty("回货计划安排(退料/角料)")
  101 + @Length(message = "回货计划安排(退料/角料)最多允许500个字符!")
  102 + private String returnPlanArrangement;
  103 +
  104 + /**
  105 + * 特殊需求、其他等
  106 + */
  107 + @ApiModelProperty("特殊需求、其他等")
  108 + @Length(message = "特殊需求、其他等最多允许500个字符!")
  109 + private String other;
  110 +
  111 + /**
  112 + * 外办审核人
  113 + */
  114 + @ApiModelProperty("外办审核人")
  115 + @Length(message = "外办审核人最多允许50个字符!")
  116 + private String externalAuditor;
  117 +
  118 + /**
  119 + * 装货时间
  120 + */
  121 + @ApiModelProperty("装货时间")
  122 + @Length(message = "装货时间最多允许20个字符!")
  123 + private String loadingTime;
  124 +
  125 + /**
  126 + * 装货特别要求/需求
  127 + */
  128 + @ApiModelProperty("装货特别要求/需求")
  129 + @Length(message = "装货特别要求/需求最多允许500个字符!")
  130 + private String specialLoadingRequirement;
  131 +
  132 + /**
  133 + * 经营办审核人
  134 + */
  135 + @ApiModelProperty("经营办审核人")
  136 + @Length(message = "经营办审核人最多允许50个字符!")
  137 + private String businessOfficeAuditor;
  138 +
  139 + /**
  140 + * 运作科审核人
  141 + */
  142 + @ApiModelProperty("运作科审核人")
  143 + @Length(message = "运作科审核人最多允许50个字符!")
  144 + private String operationsDepartmentAuditor;
  145 +
  146 +}
... ...
  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.RequestCarTicketMapper">
  4 +
  5 + <resultMap id="RequestCarTicket" type="com.lframework.xingyun.sc.entity.RequestCarTicket">
  6 + <id column="id" property="id"/>
  7 + <result column="request_car_data" property="requestCarData"/>
  8 + <result column="dept_id" property="deptId"/>
  9 + <result column="delivery_date" property="deliveryDate"/>
  10 + <result column="workshop_id" property="workshopId"/>
  11 + <result column="order_no" property="orderNo"/>
  12 + <result column="customer_short_name" property="customerShortName"/>
  13 + <result column="destination" property="destination"/>
  14 + <result column="quantity" property="quantity"/>
  15 + <result column="consignee" property="consignee"/>
  16 + <result column="phone" property="phone"/>
  17 + <result column="return_plan_arrangement" property="returnPlanArrangement"/>
  18 + <result column="other" property="other"/>
  19 + <result column="external_auditor" property="externalAuditor"/>
  20 + <result column="loading_time" property="loadingTime"/>
  21 + <result column="special_loading_requirement" property="specialLoadingRequirement"/>
  22 + <result column="business_office_auditor" property="businessOfficeAuditor"/>
  23 + <result column="operations_department_auditor" property="operationsDepartmentAuditor"/>
  24 + <result column="create_by_id" property="createById"/>
  25 + <result column="create_by" property="createBy"/>
  26 + <result column="update_by_id" property="updateById"/>
  27 + <result column="update_by" property="updateBy"/>
  28 + <result column="create_time" property="createTime"/>
  29 + <result column="update_time" property="updateTime"/>
  30 + </resultMap>
  31 +
  32 + <sql id="RequestCarTicket_sql">
  33 + SELECT
  34 + tb.id,
  35 + tb.request_car_data,
  36 + tb.dept_id,
  37 + tb.delivery_date,
  38 + tb.workshop_id,
  39 + tb.order_no,
  40 + tb.customer_short_name,
  41 + tb.destination,
  42 + tb.quantity,
  43 + tb.consignee,
  44 + tb.phone,
  45 + tb.return_plan_arrangement,
  46 + tb.other,
  47 + tb.external_auditor,
  48 + tb.loading_time,
  49 + tb.special_loading_requirement,
  50 + tb.business_office_auditor,
  51 + tb.operations_department_auditor,
  52 + tb.create_by_id,
  53 + tb.create_by,
  54 + tb.update_by_id,
  55 + tb.update_by,
  56 + tb.create_time,
  57 + tb.update_time
  58 + FROM request_car_ticket AS tb
  59 + </sql>
  60 +
  61 + <select id="query" resultMap="RequestCarTicket">
  62 + <include refid="RequestCarTicket_sql"/>
  63 + <where>
  64 + <if test="vo.requestCarData != null">
  65 + AND tb.request_car_data = #{vo.requestCarData}
  66 + </if>
  67 + <if test="vo.workshopId != null and vo.workshopId != ''">
  68 + AND tb.workshop_id = #{vo.workshopId}
  69 + </if>
  70 + <if test="vo.orderNo != null and vo.orderNo != ''">
  71 + AND tb.order_no = #{vo.orderNo}
  72 + </if>
  73 + <if test="vo.customerShortName != null and vo.customerShortName != ''">
  74 + AND tb.customer_short_name LIKE CONCAT('%', #{vo.customerShortName})
  75 + </if>
  76 + </where>
  77 + ORDER BY tb.update_time DESC
  78 + </select>
  79 +</mapper>
... ...