Commit e02470ac6d4cc89691e86af2ae0bce251b91a503

Authored by 房远帅
1 parent 3c76385c

楚江ERP:订货单管理-实体、基础方法

Showing 20 changed files with 2564 additions and 0 deletions
  1 +package com.lframework.xingyun.sc.bo.order;
  2 +
  3 +import com.baomidou.mybatisplus.annotation.TableField;
  4 +import com.fasterxml.jackson.annotation.JsonFormat;
  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.PurchaseOrderInfo;
  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 GetPurchaseOrderInfoBo extends BaseBo<PurchaseOrderInfo> {
  21 +
  22 + /**
  23 + * ID
  24 + */
  25 + @ApiModelProperty("ID")
  26 + private String id;
  27 +
  28 + /**
  29 + * 订单编号
  30 + */
  31 + @ApiModelProperty("订单编号")
  32 + private String orderNo;
  33 +
  34 + /**
  35 + * 供货单位:安徽楚江高精铜带有限公司(GJ)、安徽楚江科技新材料股份有限公司(XC)
  36 + */
  37 + @ApiModelProperty("供货单位")
  38 + private String supplyUnit;
  39 +
  40 + /**
  41 + * 订货单位ID
  42 + */
  43 + @ApiModelProperty("订货单位ID")
  44 + private String orderingUnit;
  45 +
  46 + /**
  47 + * 订货日期
  48 + */
  49 + @ApiModelProperty("订货日期")
  50 + @JsonFormat(pattern = StringPool.DATE_PATTERN)
  51 + private LocalDate orderDate;
  52 +
  53 + /**
  54 + * 结算方式或期限
  55 + */
  56 + @ApiModelProperty("结算方式或期限")
  57 + private String settlementTerms;
  58 +
  59 + /**
  60 + * 交货方式
  61 + */
  62 + @ApiModelProperty("交货方式")
  63 + private String deliveryMethod;
  64 +
  65 + /**
  66 + * 价格表编号
  67 + */
  68 + @ApiModelProperty("价格表编号")
  69 + private String priceListNo;
  70 +
  71 + /**
  72 + * 执行标准
  73 + */
  74 + @ApiModelProperty("执行标准")
  75 + private String executionStandard;
  76 +
  77 + /**
  78 + * 开票情况
  79 + */
  80 + @ApiModelProperty("开票情况")
  81 + private String invoicingStatus;
  82 +
  83 + /**
  84 + * 运费
  85 + */
  86 + @ApiModelProperty("运费")
  87 + private String shippingCost;
  88 +
  89 + /**
  90 + * 件重条头
  91 + */
  92 + @ApiModelProperty("件重条头")
  93 + private String pieceWeightHeader;
  94 +
  95 + /**
  96 + * 表面
  97 + */
  98 + @ApiModelProperty("表面")
  99 + private String surface;
  100 +
  101 + /**
  102 + * 公差
  103 + */
  104 + @ApiModelProperty("公差")
  105 + private String tolerance;
  106 +
  107 + /**
  108 + * 性能
  109 + */
  110 + @ApiModelProperty("性能")
  111 + private String performance;
  112 +
  113 + /**
  114 + * 元素
  115 + */
  116 + @ApiModelProperty("元素")
  117 + private String element;
  118 +
  119 + /**
  120 + * 包装
  121 + */
  122 + @ApiModelProperty("包装")
  123 + private String packaging;
  124 +
  125 + /**
  126 + * 备注
  127 + */
  128 + @ApiModelProperty("备注")
  129 + private String remarks;
  130 +
  131 + /**
  132 + * 状态
  133 + */
  134 + @ApiModelProperty("状态")
  135 + private String status;
  136 +
  137 + /**
  138 + * 审核状态
  139 + */
  140 + @ApiModelProperty("审核状态")
  141 + private String examineStatus;
  142 +
  143 + /**
  144 + * 生产工艺
  145 + */
  146 + @ApiModelProperty("生产工艺")
  147 + private String productionProcess;
  148 +
  149 + /**
  150 + * 办事处
  151 + */
  152 + @ApiModelProperty("办事处")
  153 + private String deptId;
  154 +
  155 + /**
  156 + * 办事处名称(非持久化字段)
  157 + */
  158 + @ApiModelProperty("办事处名称")
  159 + private String deptName;
  160 +
  161 + /**
  162 + * 生产厂
  163 + */
  164 + @ApiModelProperty("生产厂")
  165 + private String workshopId;
  166 +
  167 + /**
  168 + * 生产厂名称(非持久化字段)
  169 + */
  170 + @ApiModelProperty("生产厂名称")
  171 + private String workshopName;
  172 +
  173 + /**
  174 + * 客户资信Id
  175 + */
  176 + @ApiModelProperty("客户资信Id")
  177 + private String customerCreditId;
  178 +
  179 + /**
  180 + * 客户资信等级(非持久化字段)
  181 + */
  182 + @ApiModelProperty("客户资信等级")
  183 + private String customerTier;
  184 +
  185 + /**
  186 + * 总数量
  187 + */
  188 + @ApiModelProperty("总数量")
  189 + private String sumNumber;
  190 +
  191 + /**
  192 + * 撤销数量
  193 + */
  194 + @ApiModelProperty("撤销数量")
  195 + private String revocationNumber;
  196 +
  197 + /**
  198 + * 实际订货数量=总数量-撤销数量
  199 + */
  200 + @ApiModelProperty("实际订货数量")
  201 + private String actualOrderNumber;
  202 +
  203 +
  204 +
  205 + public GetPurchaseOrderInfoBo() {
  206 +
  207 + }
  208 +
  209 + public GetPurchaseOrderInfoBo(PurchaseOrderInfo dto) {
  210 +
  211 + super(dto);
  212 + }
  213 +
  214 + @Override
  215 + public BaseBo<PurchaseOrderInfo> convert(PurchaseOrderInfo dto) {
  216 + return super.convert(dto);
  217 + }
  218 +
  219 + @Override
  220 + protected void afterInit(PurchaseOrderInfo dto) {
  221 +
  222 + }
  223 +}
  1 +package com.lframework.xingyun.sc.bo.order;
  2 +
  3 +import com.fasterxml.jackson.annotation.JsonFormat;
  4 +import java.math.BigDecimal;
  5 +import com.lframework.starter.common.constants.StringPool;
  6 +import java.time.LocalDate;
  7 +
  8 +import com.lframework.starter.web.core.bo.BaseBo;
  9 +import com.lframework.xingyun.sc.entity.PurchaseOrderLine;
  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 GetPurchaseOrderLineBo extends BaseBo<PurchaseOrderLine> {
  22 +
  23 + /**
  24 + * ID
  25 + */
  26 + @ApiModelProperty("ID")
  27 + private String id;
  28 +
  29 + /**
  30 + * 订货单主表ID
  31 + */
  32 + @ApiModelProperty("订货单主表ID")
  33 + private String purchaseOrderId;
  34 +
  35 + /**
  36 + * 行业
  37 + */
  38 + @ApiModelProperty("行业")
  39 + private String industry;
  40 +
  41 + /**
  42 + * 品质
  43 + */
  44 + @ApiModelProperty("品质")
  45 + private String quality;
  46 +
  47 + /**
  48 + * 牌号
  49 + */
  50 + @ApiModelProperty("牌号")
  51 + private String brand;
  52 +
  53 + /**
  54 + * 厚度
  55 + */
  56 + @ApiModelProperty("厚度")
  57 + private BigDecimal thickness;
  58 +
  59 + /**
  60 + * 厚度公差正
  61 + */
  62 + @ApiModelProperty("厚度公差正")
  63 + private BigDecimal thicknessTolPos;
  64 +
  65 + /**
  66 + * 厚度公差负
  67 + */
  68 + @ApiModelProperty("厚度公差负")
  69 + private BigDecimal thicknessTolNeg;
  70 +
  71 + /**
  72 + * 宽度
  73 + */
  74 + @ApiModelProperty("宽度")
  75 + private BigDecimal width;
  76 +
  77 + /**
  78 + * 宽度公差正
  79 + */
  80 + @ApiModelProperty("宽度公差正")
  81 + private BigDecimal widthTolPos;
  82 +
  83 + /**
  84 + * 宽度公差负
  85 + */
  86 + @ApiModelProperty("宽度公差负")
  87 + private BigDecimal widthTolNeg;
  88 +
  89 + /**
  90 + * 长度
  91 + */
  92 + @ApiModelProperty("长度")
  93 + private BigDecimal length;
  94 +
  95 + /**
  96 + * 长度公差正
  97 + */
  98 + @ApiModelProperty("长度公差正")
  99 + private BigDecimal lengthTolPos;
  100 +
  101 + /**
  102 + * 长度公差负
  103 + */
  104 + @ApiModelProperty("长度公差负")
  105 + private BigDecimal lengthTolNeg;
  106 +
  107 + /**
  108 + * 状态
  109 + */
  110 + @ApiModelProperty("状态")
  111 + private String status;
  112 +
  113 + /**
  114 + * 数量
  115 + */
  116 + @ApiModelProperty("数量")
  117 + private BigDecimal quantity;
  118 +
  119 + /**
  120 + * 销售价格
  121 + */
  122 + @ApiModelProperty("销售价格")
  123 + private BigDecimal salesPrice;
  124 +
  125 + /**
  126 + * 交货日期
  127 + */
  128 + @ApiModelProperty("交货日期")
  129 + @JsonFormat(pattern = StringPool.DATE_PATTERN)
  130 + private LocalDate deliveryDate;
  131 +
  132 + /**
  133 + * 排序
  134 + */
  135 + @ApiModelProperty("排序")
  136 + private Integer showOrder;
  137 +
  138 + /**
  139 + * 考核超协
  140 + */
  141 + @ApiModelProperty("考核超协")
  142 + private String assessmentExceedsAgreement;
  143 +
  144 + public GetPurchaseOrderLineBo() {
  145 +
  146 + }
  147 +
  148 + public GetPurchaseOrderLineBo(PurchaseOrderLine dto) {
  149 +
  150 + super(dto);
  151 + }
  152 +
  153 + @Override
  154 + public BaseBo<PurchaseOrderLine> convert(PurchaseOrderLine dto) {
  155 + return super.convert(dto);
  156 + }
  157 +
  158 + @Override
  159 + protected void afterInit(PurchaseOrderLine dto) {
  160 +
  161 + }
  162 +}
  1 +package com.lframework.xingyun.sc.controller.order;
  2 +
  3 +import com.lframework.starter.web.core.annotations.security.HasPermission;
  4 +import com.lframework.starter.web.core.controller.DefaultBaseController;
  5 +import com.lframework.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.order.GetPurchaseOrderInfoBo;
  10 +import com.lframework.xingyun.sc.entity.PurchaseOrderInfo;
  11 +import com.lframework.xingyun.sc.service.order.PurchaseOrderInfoService;
  12 +import com.lframework.xingyun.sc.vo.order.CreatePurchaseOrderInfoVo;
  13 +import com.lframework.xingyun.sc.vo.order.QueryPurchaseOrderInfoVo;
  14 +import com.lframework.xingyun.sc.vo.order.UpdatePurchaseOrderInfoVo;
  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("/purchaseOrderInfo")
  38 +public class PurchaseOrderInfoController extends DefaultBaseController {
  39 +
  40 + @Autowired
  41 + private PurchaseOrderInfoService purchaseOrderInfoService;
  42 +
  43 + /**
  44 + * 查询列表
  45 + */
  46 + @ApiOperation("查询列表")
  47 + @HasPermission({"purchaseOrderInfo:purchaseorderinfo:query"})
  48 + @GetMapping("/query")
  49 + public InvokeResult<PageResult<GetPurchaseOrderInfoBo>> query(@Valid QueryPurchaseOrderInfoVo vo) {
  50 +
  51 + PageResult<PurchaseOrderInfo> pageResult = purchaseOrderInfoService.query(getPageIndex(vo), getPageSize(vo), vo);
  52 +
  53 + List<PurchaseOrderInfo> datas = pageResult.getDatas();
  54 + List<GetPurchaseOrderInfoBo> results = null;
  55 +
  56 + if (!CollectionUtil.isEmpty(datas)) {
  57 + results = datas.stream().map(GetPurchaseOrderInfoBo::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({"purchaseOrderInfo:purchaseorderinfo:query"})
  69 + @GetMapping
  70 + public InvokeResult<GetPurchaseOrderInfoBo> get(@NotBlank(message = "id不能为空!") String id) {
  71 +
  72 + PurchaseOrderInfo data = purchaseOrderInfoService.findById(id);
  73 + if (data == null) {
  74 + throw new DefaultClientException("订货单表不存在!");
  75 + }
  76 +
  77 + GetPurchaseOrderInfoBo result = new GetPurchaseOrderInfoBo(data);
  78 +
  79 + return InvokeResultBuilder.success(result);
  80 + }
  81 +
  82 + /**
  83 + * 新增
  84 + */
  85 + @ApiOperation("新增")
  86 + @HasPermission({"purchaseOrderInfo:purchaseorderinfo:add"})
  87 + @PostMapping
  88 + public InvokeResult<Void> create(@Valid CreatePurchaseOrderInfoVo vo) {
  89 +
  90 + purchaseOrderInfoService.create(vo);
  91 +
  92 + return InvokeResultBuilder.success();
  93 + }
  94 +
  95 + /**
  96 + * 修改
  97 + */
  98 + @ApiOperation("修改")
  99 + @HasPermission({"purchaseOrderInfo:purchaseorderinfo:modify"})
  100 + @PutMapping
  101 + public InvokeResult<Void> update(@Valid UpdatePurchaseOrderInfoVo vo) {
  102 +
  103 + purchaseOrderInfoService.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({"purchaseOrderInfo:purchaseorderinfo:delete"})
  114 + @DeleteMapping
  115 + public InvokeResult<Void> deleteById(@NotBlank(message = "id不能为空!") String id) {
  116 +
  117 + purchaseOrderInfoService.deleteById(id);
  118 +
  119 + return InvokeResultBuilder.success();
  120 + }
  121 +}
  1 +package com.lframework.xingyun.sc.controller.order;
  2 +
  3 +import com.lframework.starter.web.core.annotations.security.HasPermission;
  4 +import com.lframework.starter.web.core.controller.DefaultBaseController;
  5 +import com.lframework.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.order.GetPurchaseOrderLineBo;
  10 +import com.lframework.xingyun.sc.entity.PurchaseOrderLine;
  11 +import com.lframework.xingyun.sc.service.order.PurchaseOrderLineService;
  12 +import com.lframework.xingyun.sc.vo.order.CreatePurchaseOrderLineVo;
  13 +import com.lframework.xingyun.sc.vo.order.QueryPurchaseOrderLineVo;
  14 +import com.lframework.xingyun.sc.vo.order.UpdatePurchaseOrderLineVo;
  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("/purchaseOrderLine")
  38 +public class PurchaseOrderLineController extends DefaultBaseController {
  39 +
  40 + @Autowired
  41 + private PurchaseOrderLineService purchaseOrderLineService;
  42 +
  43 + /**
  44 + * 查询列表
  45 + */
  46 + @ApiOperation("查询列表")
  47 + @HasPermission({"purchaseOrderLine:purchaseorderline:query"})
  48 + @GetMapping("/query")
  49 + public InvokeResult<PageResult<GetPurchaseOrderLineBo>> query(@Valid QueryPurchaseOrderLineVo vo) {
  50 +
  51 + PageResult<PurchaseOrderLine> pageResult = purchaseOrderLineService.query(getPageIndex(vo), getPageSize(vo), vo);
  52 +
  53 + List<PurchaseOrderLine> datas = pageResult.getDatas();
  54 + List<GetPurchaseOrderLineBo> results = null;
  55 +
  56 + if (!CollectionUtil.isEmpty(datas)) {
  57 + results = datas.stream().map(GetPurchaseOrderLineBo::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({"purchaseOrderLine:purchaseorderline:query"})
  69 + @GetMapping
  70 + public InvokeResult<GetPurchaseOrderLineBo> get(@NotBlank(message = "id不能为空!") String id) {
  71 +
  72 + PurchaseOrderLine data = purchaseOrderLineService.findById(id);
  73 + if (data == null) {
  74 + throw new DefaultClientException("订货单表物料行不存在!");
  75 + }
  76 +
  77 + GetPurchaseOrderLineBo result = new GetPurchaseOrderLineBo(data);
  78 +
  79 + return InvokeResultBuilder.success(result);
  80 + }
  81 +
  82 + /**
  83 + * 新增
  84 + */
  85 + @ApiOperation("新增")
  86 + @HasPermission({"purchaseOrderLine:purchaseorderline:add"})
  87 + @PostMapping
  88 + public InvokeResult<Void> create(@Valid CreatePurchaseOrderLineVo vo) {
  89 +
  90 + purchaseOrderLineService.create(vo);
  91 +
  92 + return InvokeResultBuilder.success();
  93 + }
  94 +
  95 + /**
  96 + * 修改
  97 + */
  98 + @ApiOperation("修改")
  99 + @HasPermission({"purchaseOrderLine:purchaseorderline:modify"})
  100 + @PutMapping
  101 + public InvokeResult<Void> update(@Valid UpdatePurchaseOrderLineVo vo) {
  102 +
  103 + purchaseOrderLineService.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({"purchaseOrderLine:purchaseorderline:delete"})
  114 + @DeleteMapping
  115 + public InvokeResult<Void> deleteById(@NotBlank(message = "id不能为空!") String id) {
  116 +
  117 + purchaseOrderLineService.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 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 io.swagger.annotations.ApiModelProperty;
  11 +import lombok.Data;
  12 +
  13 +/**
  14 + * <p>
  15 + * 订货单表
  16 + * </p>
  17 + *
  18 + */
  19 +@Data
  20 +@TableName("purchase_order_info")
  21 +public class PurchaseOrderInfo extends BaseEntity implements BaseDto {
  22 +
  23 + private static final long serialVersionUID = 1L;
  24 +
  25 + public static final String CACHE_NAME = "PurchaseOrderInfo";
  26 +
  27 + /**
  28 + * ID
  29 + */
  30 + private String id;
  31 +
  32 + /**
  33 + * 订单编号
  34 + */
  35 + private String orderNo;
  36 +
  37 + /**
  38 + * 供货单位:安徽楚江高精铜带有限公司(GJ)、安徽楚江科技新材料股份有限公司(XC)
  39 + */
  40 + private String supplyUnit;
  41 +
  42 + /**
  43 + * 订货单位ID
  44 + */
  45 + private String orderingUnit;
  46 +
  47 + /**
  48 + * 订货单位名称(非持久化字段)
  49 + */
  50 + @TableField(exist = false)
  51 + private String orderingUnitName;
  52 +
  53 + /**
  54 + * 订货日期
  55 + */
  56 + private LocalDate orderDate;
  57 +
  58 + /**
  59 + * 结算方式或期限
  60 + */
  61 + private String settlementTerms;
  62 +
  63 + /**
  64 + * 交货方式
  65 + */
  66 + private String deliveryMethod;
  67 +
  68 + /**
  69 + * 价格表编号
  70 + */
  71 + private String priceListNo;
  72 +
  73 + /**
  74 + * 执行标准
  75 + */
  76 + private String executionStandard;
  77 +
  78 + /**
  79 + * 开票情况
  80 + */
  81 + private String invoicingStatus;
  82 +
  83 + /**
  84 + * 运费
  85 + */
  86 + private String shippingCost;
  87 +
  88 + /**
  89 + * 件重条头
  90 + */
  91 + private String pieceWeightHeader;
  92 +
  93 + /**
  94 + * 表面
  95 + */
  96 + private String surface;
  97 +
  98 + /**
  99 + * 公差
  100 + */
  101 + private String tolerance;
  102 +
  103 + /**
  104 + * 性能
  105 + */
  106 + private String performance;
  107 +
  108 + /**
  109 + * 元素
  110 + */
  111 + private String element;
  112 +
  113 + /**
  114 + * 包装
  115 + */
  116 + private String packaging;
  117 +
  118 + /**
  119 + * 备注
  120 + */
  121 + private String remarks;
  122 +
  123 + /**
  124 + * 状态
  125 + */
  126 + private String status;
  127 +
  128 + /**
  129 + * 审核状态
  130 + */
  131 + private String examineStatus;
  132 +
  133 + /**
  134 + * 生产工艺
  135 + */
  136 + private String productionProcess;
  137 +
  138 + /**
  139 + * 办事处
  140 + */
  141 + private String deptId;
  142 +
  143 + /**
  144 + * 办事处名称(非持久化字段)
  145 + */
  146 + @TableField(exist = false)
  147 + private String deptName;
  148 +
  149 + /**
  150 + * 生产厂
  151 + */
  152 + private String workshopId;
  153 +
  154 + /**
  155 + * 生产厂名称(非持久化字段)
  156 + */
  157 + @TableField(exist = false)
  158 + private String workshopName;
  159 +
  160 +
  161 + /**
  162 + * 客户资信Id
  163 + */
  164 + private String customerCreditId;
  165 +
  166 + /**
  167 + * 客户资信等级(非持久化字段)
  168 + */
  169 + @TableField(exist = false)
  170 + private String customerTier;
  171 +
  172 + /**
  173 + * 创建人ID
  174 + */
  175 + @TableField(fill = FieldFill.INSERT)
  176 + private String createById;
  177 +
  178 + /**
  179 + * 创建人
  180 + */
  181 + @TableField(fill = FieldFill.INSERT)
  182 + private String createBy;
  183 +
  184 + /**
  185 + * 更新人ID
  186 + */
  187 + @TableField(fill = FieldFill.INSERT_UPDATE)
  188 + private String updateById;
  189 +
  190 + /**
  191 + * 更新人
  192 + */
  193 + @TableField(fill = FieldFill.INSERT_UPDATE)
  194 + private String updateBy;
  195 +
  196 + /**
  197 + * 创建时间
  198 + */
  199 + @TableField(fill = FieldFill.INSERT)
  200 + private LocalDateTime createTime;
  201 +
  202 + /**
  203 + * 更新时间
  204 + */
  205 + @TableField(fill = FieldFill.INSERT_UPDATE)
  206 + private LocalDateTime updateTime;
  207 +
  208 +}
  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("tbl_purchase_order_line")
  21 +public class PurchaseOrderLine extends BaseEntity implements BaseDto {
  22 +
  23 + private static final long serialVersionUID = 1L;
  24 +
  25 + public static final String CACHE_NAME = "PurchaseOrderLine";
  26 +
  27 + /**
  28 + * ID
  29 + */
  30 + private String id;
  31 +
  32 + /**
  33 + * 订货单主表ID
  34 + */
  35 + private String purchaseOrderId;
  36 +
  37 + /**
  38 + * 行业
  39 + */
  40 + private String industry;
  41 +
  42 + /**
  43 + * 品质
  44 + */
  45 + private String quality;
  46 +
  47 + /**
  48 + * 牌号
  49 + */
  50 + private String brand;
  51 +
  52 + /**
  53 + * 厚度
  54 + */
  55 + private BigDecimal thickness;
  56 +
  57 + /**
  58 + * 厚度公差正
  59 + */
  60 + private BigDecimal thicknessTolPos;
  61 +
  62 + /**
  63 + * 厚度公差负
  64 + */
  65 + private BigDecimal thicknessTolNeg;
  66 +
  67 + /**
  68 + * 宽度
  69 + */
  70 + private BigDecimal width;
  71 +
  72 + /**
  73 + * 宽度公差正
  74 + */
  75 + private BigDecimal widthTolPos;
  76 +
  77 + /**
  78 + * 宽度公差负
  79 + */
  80 + private BigDecimal widthTolNeg;
  81 +
  82 + /**
  83 + * 长度
  84 + */
  85 + private BigDecimal length;
  86 +
  87 + /**
  88 + * 长度公差正
  89 + */
  90 + private BigDecimal lengthTolPos;
  91 +
  92 + /**
  93 + * 长度公差负
  94 + */
  95 + private BigDecimal lengthTolNeg;
  96 +
  97 + /**
  98 + * 状态
  99 + */
  100 + private String status;
  101 +
  102 + /**
  103 + * 数量
  104 + */
  105 + private BigDecimal quantity;
  106 +
  107 + /**
  108 + * 销售价格
  109 + */
  110 + private BigDecimal salesPrice;
  111 +
  112 + /**
  113 + * 交货日期
  114 + */
  115 + private LocalDate deliveryDate;
  116 +
  117 + /**
  118 + * 排序
  119 + */
  120 + private Integer showOrder;
  121 +
  122 + /**
  123 + * 考核超协
  124 + */
  125 + private String assessmentExceedsAgreement;
  126 +
  127 + /**
  128 + * 创建人ID
  129 + */
  130 + @TableField(fill = FieldFill.INSERT)
  131 + private String createById;
  132 +
  133 + /**
  134 + * 创建人
  135 + */
  136 + @TableField(fill = FieldFill.INSERT)
  137 + private String createBy;
  138 +
  139 + /**
  140 + * 更新人ID
  141 + */
  142 + @TableField(fill = FieldFill.INSERT_UPDATE)
  143 + private String updateById;
  144 +
  145 + /**
  146 + * 更新人
  147 + */
  148 + @TableField(fill = FieldFill.INSERT_UPDATE)
  149 + private String updateBy;
  150 +
  151 + /**
  152 + * 创建时间
  153 + */
  154 + @TableField(fill = FieldFill.INSERT)
  155 + private LocalDateTime createTime;
  156 +
  157 + /**
  158 + * 更新时间
  159 + */
  160 + @TableField(fill = FieldFill.INSERT_UPDATE)
  161 + private LocalDateTime updateTime;
  162 +
  163 +}
  1 +package com.lframework.xingyun.sc.impl.order;
  2 +
  3 +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
  4 +import com.baomidou.mybatisplus.core.toolkit.Wrappers;
  5 +import com.github.pagehelper.PageInfo;
  6 +import com.lframework.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.PurchaseOrderInfo;
  20 +import com.lframework.xingyun.sc.mappers.PurchaseOrderInfoMapper;
  21 +import com.lframework.xingyun.sc.service.order.PurchaseOrderInfoService;
  22 +import com.lframework.xingyun.sc.service.order.PurchaseOrderLineService;
  23 +import com.lframework.xingyun.sc.vo.order.CreatePurchaseOrderInfoVo;
  24 +import com.lframework.xingyun.sc.vo.order.CreatePurchaseOrderLineVo;
  25 +import com.lframework.xingyun.sc.vo.order.QueryPurchaseOrderInfoVo;
  26 +import com.lframework.xingyun.sc.vo.order.UpdatePurchaseOrderInfoVo;
  27 +import org.apache.commons.collections.CollectionUtils;
  28 +import org.springframework.transaction.annotation.Transactional;
  29 +import org.springframework.stereotype.Service;
  30 +
  31 +import javax.annotation.Resource;
  32 +import java.util.Collection;
  33 +import java.util.List;
  34 +
  35 +@Service
  36 +public class PurchaseOrderInfoServiceImpl extends BaseMpServiceImpl<PurchaseOrderInfoMapper, PurchaseOrderInfo> implements PurchaseOrderInfoService {
  37 +
  38 + @Resource
  39 + private PurchaseOrderLineService purchaseOrderLineService;
  40 +
  41 + @Override
  42 + public PageResult<PurchaseOrderInfo> query(Integer pageIndex, Integer pageSize, QueryPurchaseOrderInfoVo vo) {
  43 +
  44 + Assert.greaterThanZero(pageIndex);
  45 + Assert.greaterThanZero(pageSize);
  46 +
  47 + PageHelperUtil.startPage(pageIndex, pageSize);
  48 + List<PurchaseOrderInfo> datas = this.query(vo);
  49 +
  50 + return PageResultUtil.convert(new PageInfo<>(datas));
  51 + }
  52 +
  53 + @Override
  54 + public List<PurchaseOrderInfo> query(QueryPurchaseOrderInfoVo vo) {
  55 +
  56 + return getBaseMapper().query(vo);
  57 + }
  58 +
  59 + @Override
  60 + public PurchaseOrderInfo findById(String id) {
  61 +
  62 + return getBaseMapper().selectById(id);
  63 + }
  64 +
  65 + @OpLog(type = OtherOpLogType.class, name = "新增订货单表,ID:{}", params = {"#id"})
  66 + @Transactional(rollbackFor = Exception.class)
  67 + @Override
  68 + public String create(CreatePurchaseOrderInfoVo vo) {
  69 +
  70 + PurchaseOrderInfo data = new PurchaseOrderInfo();
  71 + data.setId(IdUtil.getId());
  72 + if (!StringUtil.isBlank(vo.getOrderNo())) {
  73 + data.setOrderNo(vo.getOrderNo());
  74 + }
  75 + if (!StringUtil.isBlank(vo.getSupplyUnit())) {
  76 + data.setSupplyUnit(vo.getSupplyUnit());
  77 + }
  78 + if (!StringUtil.isBlank(vo.getOrderingUnit())) {
  79 + data.setOrderingUnit(vo.getOrderingUnit());
  80 + }
  81 + if (vo.getOrderDate() != null) {
  82 + data.setOrderDate(vo.getOrderDate());
  83 + }
  84 + if (!StringUtil.isBlank(vo.getSettlementTerms())) {
  85 + data.setSettlementTerms(vo.getSettlementTerms());
  86 + }
  87 + if (!StringUtil.isBlank(vo.getDeliveryMethod())) {
  88 + data.setDeliveryMethod(vo.getDeliveryMethod());
  89 + }
  90 + if (!StringUtil.isBlank(vo.getPriceListNo())) {
  91 + data.setPriceListNo(vo.getPriceListNo());
  92 + }
  93 + if (!StringUtil.isBlank(vo.getExecutionStandard())) {
  94 + data.setExecutionStandard(vo.getExecutionStandard());
  95 + }
  96 + if (!StringUtil.isBlank(vo.getInvoicingStatus())) {
  97 + data.setInvoicingStatus(vo.getInvoicingStatus());
  98 + }
  99 + if (!StringUtil.isBlank(vo.getShippingCost())) {
  100 + data.setShippingCost(vo.getShippingCost());
  101 + }
  102 + if (!StringUtil.isBlank(vo.getPieceWeightHeader())) {
  103 + data.setPieceWeightHeader(vo.getPieceWeightHeader());
  104 + }
  105 + if (!StringUtil.isBlank(vo.getSurface())) {
  106 + data.setSurface(vo.getSurface());
  107 + }
  108 + if (!StringUtil.isBlank(vo.getTolerance())) {
  109 + data.setTolerance(vo.getTolerance());
  110 + }
  111 + if (!StringUtil.isBlank(vo.getPerformance())) {
  112 + data.setPerformance(vo.getPerformance());
  113 + }
  114 + if (!StringUtil.isBlank(vo.getElement())) {
  115 + data.setElement(vo.getElement());
  116 + }
  117 + if (!StringUtil.isBlank(vo.getPackaging())) {
  118 + data.setPackaging(vo.getPackaging());
  119 + }
  120 + if (!StringUtil.isBlank(vo.getRemarks())) {
  121 + data.setRemarks(vo.getRemarks());
  122 + }
  123 + if (!StringUtil.isBlank(vo.getStatus())) {
  124 + data.setStatus(vo.getStatus());
  125 + }
  126 + if (!StringUtil.isBlank(vo.getExamineStatus())) {
  127 + data.setExamineStatus(vo.getExamineStatus());
  128 + }
  129 + if (!StringUtil.isBlank(vo.getProductionProcess())) {
  130 + data.setProductionProcess(vo.getProductionProcess());
  131 + }
  132 + if (!StringUtil.isBlank(vo.getDeptId())) {
  133 + data.setDeptId(vo.getDeptId());
  134 + }
  135 + if (!StringUtil.isBlank(vo.getWorkshopId())) {
  136 + data.setWorkshopId(vo.getWorkshopId());
  137 + }
  138 + if (!StringUtil.isBlank(vo.getCustomerCreditId())) {
  139 + data.setCustomerCreditId(vo.getCustomerCreditId());
  140 + }
  141 +
  142 + getBaseMapper().insert(data);
  143 +
  144 + OpLogUtil.setVariable("id", data.getId());
  145 + OpLogUtil.setExtra(vo);
  146 +
  147 + //新增订货单物料行
  148 + List<CreatePurchaseOrderLineVo> createPurchaseOrderLineVoList = vo.getCreatePurchaseOrderLineVoList();
  149 + if (CollectionUtils.isNotEmpty(createPurchaseOrderLineVoList)) {
  150 + for (CreatePurchaseOrderLineVo createPurchaseOrderLineVo : createPurchaseOrderLineVoList) {
  151 + createPurchaseOrderLineVo.setPurchaseOrderId(data.getId());
  152 + purchaseOrderLineService.create(createPurchaseOrderLineVo);
  153 + }
  154 + }
  155 +
  156 + return data.getId();
  157 + }
  158 +
  159 + @OpLog(type = OtherOpLogType.class, name = "修改订货单表,ID:{}", params = {"#id"})
  160 + @Transactional(rollbackFor = Exception.class)
  161 + @Override
  162 + public void update(UpdatePurchaseOrderInfoVo vo) {
  163 +
  164 + PurchaseOrderInfo data = getBaseMapper().selectById(vo.getId());
  165 + if (ObjectUtil.isNull(data)) {
  166 + throw new DefaultClientException("订货单表不存在!");
  167 + }
  168 +
  169 + LambdaUpdateWrapper<PurchaseOrderInfo> updateWrapper = Wrappers.lambdaUpdate(PurchaseOrderInfo.class)
  170 + .set(PurchaseOrderInfo::getOrderNo, StringUtil.isBlank(vo.getOrderNo()) ? null : vo.getOrderNo())
  171 + .set(PurchaseOrderInfo::getSupplyUnit, StringUtil.isBlank(vo.getSupplyUnit()) ? null : vo.getSupplyUnit())
  172 + .set(PurchaseOrderInfo::getOrderingUnit, StringUtil.isBlank(vo.getOrderingUnit()) ? null : vo.getOrderingUnit())
  173 + .set(PurchaseOrderInfo::getOrderDate, vo.getOrderDate() == null ? null : vo.getOrderDate())
  174 + .set(PurchaseOrderInfo::getSettlementTerms, StringUtil.isBlank(vo.getSettlementTerms()) ? null : vo.getSettlementTerms())
  175 + .set(PurchaseOrderInfo::getDeliveryMethod, StringUtil.isBlank(vo.getDeliveryMethod()) ? null : vo.getDeliveryMethod())
  176 + .set(PurchaseOrderInfo::getPriceListNo, StringUtil.isBlank(vo.getPriceListNo()) ? null : vo.getPriceListNo())
  177 + .set(PurchaseOrderInfo::getExecutionStandard, StringUtil.isBlank(vo.getExecutionStandard()) ? null : vo.getExecutionStandard())
  178 + .set(PurchaseOrderInfo::getInvoicingStatus, StringUtil.isBlank(vo.getInvoicingStatus()) ? null : vo.getInvoicingStatus())
  179 + .set(PurchaseOrderInfo::getShippingCost, StringUtil.isBlank(vo.getShippingCost()) ? null : vo.getShippingCost())
  180 + .set(PurchaseOrderInfo::getPieceWeightHeader, StringUtil.isBlank(vo.getPieceWeightHeader()) ? null : vo.getPieceWeightHeader())
  181 + .set(PurchaseOrderInfo::getSurface, StringUtil.isBlank(vo.getSurface()) ? null : vo.getSurface())
  182 + .set(PurchaseOrderInfo::getTolerance, StringUtil.isBlank(vo.getTolerance()) ? null : vo.getTolerance())
  183 + .set(PurchaseOrderInfo::getPerformance, StringUtil.isBlank(vo.getPerformance()) ? null : vo.getPerformance())
  184 + .set(PurchaseOrderInfo::getElement, StringUtil.isBlank(vo.getElement()) ? null : vo.getElement())
  185 + .set(PurchaseOrderInfo::getPackaging, StringUtil.isBlank(vo.getPackaging()) ? null : vo.getPackaging())
  186 + .set(PurchaseOrderInfo::getRemarks, StringUtil.isBlank(vo.getRemarks()) ? null : vo.getRemarks())
  187 + .set(PurchaseOrderInfo::getStatus, StringUtil.isBlank(vo.getStatus()) ? null : vo.getStatus())
  188 + .set(PurchaseOrderInfo::getExamineStatus, StringUtil.isBlank(vo.getExamineStatus()) ? null : vo.getExamineStatus())
  189 + .set(PurchaseOrderInfo::getProductionProcess, StringUtil.isBlank(vo.getProductionProcess()) ? null : vo.getProductionProcess())
  190 + .set(PurchaseOrderInfo::getDeptId, StringUtil.isBlank(vo.getDeptId()) ? null : vo.getDeptId())
  191 + .set(PurchaseOrderInfo::getWorkshopId, StringUtil.isBlank(vo.getWorkshopId()) ? null : vo.getWorkshopId())
  192 + .set(PurchaseOrderInfo::getCustomerCreditId, StringUtil.isBlank(vo.getCustomerCreditId()) ? null : vo.getCustomerCreditId())
  193 + .eq(PurchaseOrderInfo::getId, vo.getId());
  194 +
  195 + getBaseMapper().update(updateWrapper);
  196 +
  197 + OpLogUtil.setVariable("id", data.getId());
  198 + OpLogUtil.setExtra(vo);
  199 + }
  200 +
  201 + @OpLog(type = OtherOpLogType.class, name = "删除订货单表,ID:{}", params = {"#id"})
  202 + @Transactional(rollbackFor = Exception.class)
  203 + @Override
  204 + public void deleteById(String id) {
  205 +
  206 + getBaseMapper().deleteById(id);
  207 + }
  208 +
  209 + @Override
  210 + public void cleanCacheByKey(Serializable key) {
  211 +
  212 + }
  213 +}
  1 +package com.lframework.xingyun.sc.impl.order;
  2 +
  3 +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
  4 +import com.baomidou.mybatisplus.core.toolkit.Wrappers;
  5 +import com.github.pagehelper.PageInfo;
  6 +import com.lframework.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.PurchaseOrderLine;
  20 +import com.lframework.xingyun.sc.mappers.PurchaseOrderLineMapper;
  21 +import com.lframework.xingyun.sc.service.order.PurchaseOrderLineService;
  22 +import com.lframework.xingyun.sc.vo.order.CreatePurchaseOrderLineVo;
  23 +import com.lframework.xingyun.sc.vo.order.QueryPurchaseOrderLineVo;
  24 +import com.lframework.xingyun.sc.vo.order.UpdatePurchaseOrderLineVo;
  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 PurchaseOrderLineServiceImpl extends BaseMpServiceImpl<PurchaseOrderLineMapper, PurchaseOrderLine> implements PurchaseOrderLineService {
  32 +
  33 + @Override
  34 + public PageResult<PurchaseOrderLine> query(Integer pageIndex, Integer pageSize, QueryPurchaseOrderLineVo vo) {
  35 +
  36 + Assert.greaterThanZero(pageIndex);
  37 + Assert.greaterThanZero(pageSize);
  38 +
  39 + PageHelperUtil.startPage(pageIndex, pageSize);
  40 + List<PurchaseOrderLine> datas = this.query(vo);
  41 +
  42 + return PageResultUtil.convert(new PageInfo<>(datas));
  43 + }
  44 +
  45 + @Override
  46 + public List<PurchaseOrderLine> query(QueryPurchaseOrderLineVo vo) {
  47 +
  48 + return getBaseMapper().query(vo);
  49 + }
  50 +
  51 + @Override
  52 + public PurchaseOrderLine 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(CreatePurchaseOrderLineVo vo) {
  61 +
  62 + PurchaseOrderLine data = new PurchaseOrderLine();
  63 + data.setId(IdUtil.getId());
  64 + data.setPurchaseOrderId(vo.getPurchaseOrderId());
  65 + if (!StringUtil.isBlank(vo.getIndustry())) {
  66 + data.setIndustry(vo.getIndustry());
  67 + }
  68 + if (!StringUtil.isBlank(vo.getQuality())) {
  69 + data.setQuality(vo.getQuality());
  70 + }
  71 + if (!StringUtil.isBlank(vo.getBrand())) {
  72 + data.setBrand(vo.getBrand());
  73 + }
  74 + if (vo.getThickness() != null) {
  75 + data.setThickness(vo.getThickness());
  76 + }
  77 + if (vo.getThicknessTolPos() != null) {
  78 + data.setThicknessTolPos(vo.getThicknessTolPos());
  79 + }
  80 + if (vo.getThicknessTolNeg() != null) {
  81 + data.setThicknessTolNeg(vo.getThicknessTolNeg());
  82 + }
  83 + if (vo.getWidth() != null) {
  84 + data.setWidth(vo.getWidth());
  85 + }
  86 + if (vo.getWidthTolPos() != null) {
  87 + data.setWidthTolPos(vo.getWidthTolPos());
  88 + }
  89 + if (vo.getWidthTolNeg() != null) {
  90 + data.setWidthTolNeg(vo.getWidthTolNeg());
  91 + }
  92 + if (vo.getLength() != null) {
  93 + data.setLength(vo.getLength());
  94 + }
  95 + if (vo.getLengthTolPos() != null) {
  96 + data.setLengthTolPos(vo.getLengthTolPos());
  97 + }
  98 + if (vo.getLengthTolNeg() != null) {
  99 + data.setLengthTolNeg(vo.getLengthTolNeg());
  100 + }
  101 + if (!StringUtil.isBlank(vo.getStatus())) {
  102 + data.setStatus(vo.getStatus());
  103 + }
  104 + if (vo.getQuantity() != null) {
  105 + data.setQuantity(vo.getQuantity());
  106 + }
  107 + if (vo.getSalesPrice() != null) {
  108 + data.setSalesPrice(vo.getSalesPrice());
  109 + }
  110 + if (vo.getDeliveryDate() != null) {
  111 + data.setDeliveryDate(vo.getDeliveryDate());
  112 + }
  113 + if (vo.getShowOrder() != null) {
  114 + data.setShowOrder(vo.getShowOrder());
  115 + }
  116 + if (!StringUtil.isBlank(vo.getAssessmentExceedsAgreement())) {
  117 + data.setAssessmentExceedsAgreement(vo.getAssessmentExceedsAgreement());
  118 + }
  119 +
  120 + getBaseMapper().insert(data);
  121 +
  122 + OpLogUtil.setVariable("id", data.getId());
  123 + OpLogUtil.setExtra(vo);
  124 +
  125 + return data.getId();
  126 + }
  127 +
  128 + @OpLog(type = OtherOpLogType.class, name = "修改订货单表物料行,ID:{}", params = {"#id"})
  129 + @Transactional(rollbackFor = Exception.class)
  130 + @Override
  131 + public void update(UpdatePurchaseOrderLineVo vo) {
  132 +
  133 + PurchaseOrderLine data = getBaseMapper().selectById(vo.getId());
  134 + if (ObjectUtil.isNull(data)) {
  135 + throw new DefaultClientException("订货单表物料行不存在!");
  136 + }
  137 +
  138 + LambdaUpdateWrapper<PurchaseOrderLine> updateWrapper = Wrappers.lambdaUpdate(PurchaseOrderLine.class)
  139 + .set(PurchaseOrderLine::getPurchaseOrderId, vo.getPurchaseOrderId())
  140 + .set(PurchaseOrderLine::getIndustry, StringUtil.isBlank(vo.getIndustry()) ? null : vo.getIndustry())
  141 + .set(PurchaseOrderLine::getQuality, StringUtil.isBlank(vo.getQuality()) ? null : vo.getQuality())
  142 + .set(PurchaseOrderLine::getBrand, StringUtil.isBlank(vo.getBrand()) ? null : vo.getBrand())
  143 + .set(PurchaseOrderLine::getThickness, vo.getThickness() == null ? null : vo.getThickness())
  144 + .set(PurchaseOrderLine::getThicknessTolPos, vo.getThicknessTolPos() == null ? null : vo.getThicknessTolPos())
  145 + .set(PurchaseOrderLine::getThicknessTolNeg, vo.getThicknessTolNeg() == null ? null : vo.getThicknessTolNeg())
  146 + .set(PurchaseOrderLine::getWidth, vo.getWidth() == null ? null : vo.getWidth())
  147 + .set(PurchaseOrderLine::getWidthTolPos, vo.getWidthTolPos() == null ? null : vo.getWidthTolPos())
  148 + .set(PurchaseOrderLine::getWidthTolNeg, vo.getWidthTolNeg() == null ? null : vo.getWidthTolNeg())
  149 + .set(PurchaseOrderLine::getLength, vo.getLength() == null ? null : vo.getLength())
  150 + .set(PurchaseOrderLine::getLengthTolPos, vo.getLengthTolPos() == null ? null : vo.getLengthTolPos())
  151 + .set(PurchaseOrderLine::getLengthTolNeg, vo.getLengthTolNeg() == null ? null : vo.getLengthTolNeg())
  152 + .set(PurchaseOrderLine::getStatus, StringUtil.isBlank(vo.getStatus()) ? null : vo.getStatus())
  153 + .set(PurchaseOrderLine::getQuantity, vo.getQuantity() == null ? null : vo.getQuantity())
  154 + .set(PurchaseOrderLine::getSalesPrice, vo.getSalesPrice() == null ? null : vo.getSalesPrice())
  155 + .set(PurchaseOrderLine::getDeliveryDate, vo.getDeliveryDate() == null ? null : vo.getDeliveryDate())
  156 + .set(PurchaseOrderLine::getShowOrder, vo.getShowOrder() == null ? null : vo.getShowOrder())
  157 + .set(PurchaseOrderLine::getAssessmentExceedsAgreement, StringUtil.isBlank(vo.getAssessmentExceedsAgreement()) ? null : vo.getAssessmentExceedsAgreement())
  158 + .eq(PurchaseOrderLine::getId, vo.getId());
  159 +
  160 + getBaseMapper().update(updateWrapper);
  161 +
  162 + OpLogUtil.setVariable("id", data.getId());
  163 + OpLogUtil.setExtra(vo);
  164 + }
  165 +
  166 + @OpLog(type = OtherOpLogType.class, name = "删除订货单表物料行,ID:{}", params = {"#id"})
  167 + @Transactional(rollbackFor = Exception.class)
  168 + @Override
  169 + public void deleteById(String id) {
  170 +
  171 + getBaseMapper().deleteById(id);
  172 + }
  173 +
  174 + @Override
  175 + public void cleanCacheByKey(Serializable key) {
  176 +
  177 + }
  178 +}
  1 +package com.lframework.xingyun.sc.mappers;
  2 +
  3 +import com.lframework.starter.web.core.mapper.BaseMapper;
  4 +import com.lframework.xingyun.sc.entity.PurchaseOrderInfo;
  5 +import com.lframework.xingyun.sc.vo.order.QueryPurchaseOrderInfoVo;
  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 PurchaseOrderInfoMapper extends BaseMapper<PurchaseOrderInfo> {
  17 +
  18 + /**
  19 + * 查询列表
  20 + * @param vo
  21 + * @return
  22 + */
  23 + List<PurchaseOrderInfo> query(@Param("vo") QueryPurchaseOrderInfoVo vo);
  24 +}
  1 +package com.lframework.xingyun.sc.mappers;
  2 +
  3 +import com.lframework.starter.web.core.mapper.BaseMapper;
  4 +import com.lframework.xingyun.sc.entity.PurchaseOrderLine;
  5 +import com.lframework.xingyun.sc.vo.order.QueryPurchaseOrderLineVo;
  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 PurchaseOrderLineMapper extends BaseMapper<PurchaseOrderLine> {
  17 +
  18 + /**
  19 + * 查询列表
  20 + * @param vo
  21 + * @return
  22 + */
  23 + List<PurchaseOrderLine> query(@Param("vo") QueryPurchaseOrderLineVo vo);
  24 +}
  1 +package com.lframework.xingyun.sc.service.order;
  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.PurchaseOrderInfo;
  6 +import com.lframework.xingyun.sc.vo.order.CreatePurchaseOrderInfoVo;
  7 +import com.lframework.xingyun.sc.vo.order.QueryPurchaseOrderInfoVo;
  8 +import com.lframework.xingyun.sc.vo.order.UpdatePurchaseOrderInfoVo;
  9 +import java.util.List;
  10 +
  11 +/**
  12 + * 订货单表 Service
  13 + */
  14 +public interface PurchaseOrderInfoService extends BaseMpService<PurchaseOrderInfo> {
  15 +
  16 + /**
  17 + * 查询列表
  18 + * @return
  19 + */
  20 + PageResult<PurchaseOrderInfo> query(Integer pageIndex, Integer pageSize, QueryPurchaseOrderInfoVo vo);
  21 +
  22 + /**
  23 + * 查询列表
  24 + * @param vo
  25 + * @return
  26 + */
  27 + List<PurchaseOrderInfo> query(QueryPurchaseOrderInfoVo vo);
  28 +
  29 + /**
  30 + * 根据ID查询
  31 + * @param id
  32 + * @return
  33 + */
  34 + PurchaseOrderInfo findById(String id);
  35 +
  36 + /**
  37 + * 创建
  38 + * @param vo
  39 + * @return
  40 + */
  41 + String create(CreatePurchaseOrderInfoVo vo);
  42 +
  43 + /**
  44 + * 修改
  45 + * @param vo
  46 + */
  47 + void update(UpdatePurchaseOrderInfoVo vo);
  48 +
  49 + /**
  50 + * 根据ID删除
  51 + * @param id
  52 + * @return
  53 + */
  54 + void deleteById(String id);
  55 +}
  1 +package com.lframework.xingyun.sc.service.order;
  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.PurchaseOrderLine;
  6 +import com.lframework.xingyun.sc.vo.order.CreatePurchaseOrderLineVo;
  7 +import com.lframework.xingyun.sc.vo.order.QueryPurchaseOrderLineVo;
  8 +import com.lframework.xingyun.sc.vo.order.UpdatePurchaseOrderLineVo;
  9 +import java.util.List;
  10 +
  11 +/**
  12 + * 订货单表物料行 Service
  13 + */
  14 +public interface PurchaseOrderLineService extends BaseMpService<PurchaseOrderLine> {
  15 +
  16 + /**
  17 + * 查询列表
  18 + * @return
  19 + */
  20 + PageResult<PurchaseOrderLine> query(Integer pageIndex, Integer pageSize, QueryPurchaseOrderLineVo vo);
  21 +
  22 + /**
  23 + * 查询列表
  24 + * @param vo
  25 + * @return
  26 + */
  27 + List<PurchaseOrderLine> query(QueryPurchaseOrderLineVo vo);
  28 +
  29 + /**
  30 + * 根据ID查询
  31 + * @param id
  32 + * @return
  33 + */
  34 + PurchaseOrderLine findById(String id);
  35 +
  36 + /**
  37 + * 创建
  38 + * @param vo
  39 + * @return
  40 + */
  41 + String create(CreatePurchaseOrderLineVo vo);
  42 +
  43 + /**
  44 + * 修改
  45 + * @param vo
  46 + */
  47 + void update(UpdatePurchaseOrderLineVo vo);
  48 +
  49 + /**
  50 + * 根据ID删除
  51 + * @param id
  52 + * @return
  53 + */
  54 + void deleteById(String id);
  55 +}
  1 +package com.lframework.xingyun.sc.vo.order;
  2 +
  3 +import java.time.LocalDate;
  4 +import com.lframework.starter.web.core.vo.BaseVo;
  5 +import io.swagger.annotations.ApiModelProperty;
  6 +import com.lframework.starter.web.core.components.validation.TypeMismatch;
  7 +import org.hibernate.validator.constraints.Length;
  8 +import java.io.Serializable;
  9 +import java.util.List;
  10 +
  11 +import lombok.Data;
  12 +
  13 +@Data
  14 +public class CreatePurchaseOrderInfoVo implements BaseVo, Serializable {
  15 +
  16 + private static final long serialVersionUID = 1L;
  17 +
  18 + /**
  19 + * 订单编号
  20 + */
  21 + @ApiModelProperty("订单编号")
  22 + @Length(message = "订单编号最多允许50个字符!")
  23 + private String orderNo;
  24 +
  25 + /**
  26 + * 供货单位:安徽楚江高精铜带有限公司(GJ)、安徽楚江科技新材料股份有限公司(XC)
  27 + */
  28 + @ApiModelProperty("供货单位")
  29 + @Length(message = "供货单位最多允许100个字符!")
  30 + private String supplyUnit;
  31 +
  32 + /**
  33 + * 订货单位ID
  34 + */
  35 + @ApiModelProperty("订货单位ID")
  36 + @Length(message = "订货单位ID最多允许100个字符!")
  37 + private String orderingUnit;
  38 +
  39 + /**
  40 + * 订货单位名称
  41 + */
  42 + @ApiModelProperty("订货单位名称")
  43 + private String orderingUnitName;
  44 +
  45 + /**
  46 + * 订货日期
  47 + */
  48 + @ApiModelProperty("订货日期")
  49 + @TypeMismatch(message = "订货日期格式有误!")
  50 + private LocalDate orderDate;
  51 +
  52 + /**
  53 + * 结算方式或期限
  54 + */
  55 + @ApiModelProperty("结算方式或期限")
  56 + @Length(message = "结算方式或期限最多允许100个字符!")
  57 + private String settlementTerms;
  58 +
  59 + /**
  60 + * 交货方式
  61 + */
  62 + @ApiModelProperty("交货方式")
  63 + @Length(message = "交货方式最多允许50个字符!")
  64 + private String deliveryMethod;
  65 +
  66 + /**
  67 + * 价格表编号
  68 + */
  69 + @ApiModelProperty("价格表编号")
  70 + @Length(message = "价格表编号最多允许50个字符!")
  71 + private String priceListNo;
  72 +
  73 + /**
  74 + * 执行标准
  75 + */
  76 + @ApiModelProperty("执行标准")
  77 + @Length(message = "执行标准最多允许100个字符!")
  78 + private String executionStandard;
  79 +
  80 + /**
  81 + * 开票情况
  82 + */
  83 + @ApiModelProperty("开票情况")
  84 + @Length(message = "开票情况最多允许50个字符!")
  85 + private String invoicingStatus;
  86 +
  87 + /**
  88 + * 运费
  89 + */
  90 + @ApiModelProperty("运费")
  91 + @Length(message = "运费最多允许20个字符!")
  92 + private String shippingCost;
  93 +
  94 + /**
  95 + * 件重条头
  96 + */
  97 + @ApiModelProperty("件重条头")
  98 + @Length(message = "件重条头最多允许500个字符!")
  99 + private String pieceWeightHeader;
  100 +
  101 + /**
  102 + * 表面
  103 + */
  104 + @ApiModelProperty("表面")
  105 + @Length(message = "表面最多允许500个字符!")
  106 + private String surface;
  107 +
  108 + /**
  109 + * 公差
  110 + */
  111 + @ApiModelProperty("公差")
  112 + @Length(message = "公差最多允许500个字符!")
  113 + private String tolerance;
  114 +
  115 + /**
  116 + * 性能
  117 + */
  118 + @ApiModelProperty("性能")
  119 + @Length(message = "性能最多允许500个字符!")
  120 + private String performance;
  121 +
  122 + /**
  123 + * 元素
  124 + */
  125 + @ApiModelProperty("元素")
  126 + @Length(message = "元素最多允许500个字符!")
  127 + private String element;
  128 +
  129 + /**
  130 + * 包装
  131 + */
  132 + @ApiModelProperty("包装")
  133 + @Length(message = "包装最多允许500个字符!")
  134 + private String packaging;
  135 +
  136 + /**
  137 + * 备注
  138 + */
  139 + @ApiModelProperty("备注")
  140 + @Length(message = "备注最多允许500个字符!")
  141 + private String remarks;
  142 +
  143 + /**
  144 + * 状态
  145 + */
  146 + @ApiModelProperty("状态")
  147 + @Length(message = "状态最多允许20个字符!")
  148 + private String status;
  149 +
  150 + /**
  151 + * 审核状态
  152 + */
  153 + @ApiModelProperty("审核状态")
  154 + private String examineStatus;
  155 +
  156 + /**
  157 + * 生产工艺
  158 + */
  159 + @ApiModelProperty("生产工艺")
  160 + private String productionProcess;
  161 +
  162 + /**
  163 + * 办事处
  164 + */
  165 + @ApiModelProperty("办事处")
  166 + private String deptId;
  167 +
  168 + /**
  169 + * 生产厂
  170 + */
  171 + @ApiModelProperty("生产厂")
  172 + private String workshopId;
  173 +
  174 + /**
  175 + * 客户资信Id
  176 + */
  177 + @ApiModelProperty("客户资信Id")
  178 + private String customerCreditId;
  179 +
  180 + /**
  181 + * 订货单物料行
  182 + */
  183 + @ApiModelProperty("订货单物料行")
  184 + private List<CreatePurchaseOrderLineVo> createPurchaseOrderLineVoList;
  185 +
  186 +}
  1 +package com.lframework.xingyun.sc.vo.order;
  2 +
  3 +import com.lframework.starter.web.core.components.validation.IsNumberPrecision;
  4 +import java.math.BigDecimal;
  5 +import javax.validation.constraints.NotBlank;
  6 +import java.time.LocalDate;
  7 +import com.lframework.starter.web.core.vo.BaseVo;
  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 CreatePurchaseOrderLineVo 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 purchaseOrderId;
  26 +
  27 + /**
  28 + * 行业
  29 + */
  30 + @ApiModelProperty("行业")
  31 + @Length(message = "行业最多允许100个字符!")
  32 + private String industry;
  33 +
  34 + /**
  35 + * 品质
  36 + */
  37 + @ApiModelProperty("品质")
  38 + @Length(message = "品质最多允许100个字符!")
  39 + private String quality;
  40 +
  41 + /**
  42 + * 牌号
  43 + */
  44 + @ApiModelProperty("牌号")
  45 + @Length(message = "牌号最多允许100个字符!")
  46 + private String brand;
  47 +
  48 + /**
  49 + * 厚度
  50 + */
  51 + @ApiModelProperty("厚度")
  52 + @TypeMismatch(message = "厚度格式有误!")
  53 + @IsNumberPrecision(message = "厚度最多允许4位小数!", value = 4)
  54 + private BigDecimal thickness;
  55 +
  56 + /**
  57 + * 厚度公差正
  58 + */
  59 + @ApiModelProperty("厚度公差正")
  60 + @TypeMismatch(message = "厚度公差正格式有误!")
  61 + @IsNumberPrecision(message = "厚度公差正最多允许4位小数!", value = 4)
  62 + private BigDecimal thicknessTolPos;
  63 +
  64 + /**
  65 + * 厚度公差负
  66 + */
  67 + @ApiModelProperty("厚度公差负")
  68 + @TypeMismatch(message = "厚度公差负格式有误!")
  69 + @IsNumberPrecision(message = "厚度公差负最多允许4位小数!", value = 4)
  70 + private BigDecimal thicknessTolNeg;
  71 +
  72 + /**
  73 + * 宽度
  74 + */
  75 + @ApiModelProperty("宽度")
  76 + @TypeMismatch(message = "宽度格式有误!")
  77 + @IsNumberPrecision(message = "宽度最多允许4位小数!", value = 4)
  78 + private BigDecimal width;
  79 +
  80 + /**
  81 + * 宽度公差正
  82 + */
  83 + @ApiModelProperty("宽度公差正")
  84 + @TypeMismatch(message = "宽度公差正格式有误!")
  85 + @IsNumberPrecision(message = "宽度公差正最多允许4位小数!", value = 4)
  86 + private BigDecimal widthTolPos;
  87 +
  88 + /**
  89 + * 宽度公差负
  90 + */
  91 + @ApiModelProperty("宽度公差负")
  92 + @TypeMismatch(message = "宽度公差负格式有误!")
  93 + @IsNumberPrecision(message = "宽度公差负最多允许4位小数!", value = 4)
  94 + private BigDecimal widthTolNeg;
  95 +
  96 + /**
  97 + * 长度
  98 + */
  99 + @ApiModelProperty("长度")
  100 + @TypeMismatch(message = "长度格式有误!")
  101 + @IsNumberPrecision(message = "长度最多允许4位小数!", value = 4)
  102 + private BigDecimal length;
  103 +
  104 + /**
  105 + * 长度公差正
  106 + */
  107 + @ApiModelProperty("长度公差正")
  108 + @TypeMismatch(message = "长度公差正格式有误!")
  109 + @IsNumberPrecision(message = "长度公差正最多允许4位小数!", value = 4)
  110 + private BigDecimal lengthTolPos;
  111 +
  112 + /**
  113 + * 长度公差负
  114 + */
  115 + @ApiModelProperty("长度公差负")
  116 + @TypeMismatch(message = "长度公差负格式有误!")
  117 + @IsNumberPrecision(message = "长度公差负最多允许4位小数!", value = 4)
  118 + private BigDecimal lengthTolNeg;
  119 +
  120 + /**
  121 + * 状态
  122 + */
  123 + @ApiModelProperty("状态")
  124 + @Length(message = "状态最多允许50个字符!")
  125 + private String status;
  126 +
  127 + /**
  128 + * 数量
  129 + */
  130 + @ApiModelProperty("数量")
  131 + @TypeMismatch(message = "数量格式有误!")
  132 + @IsNumberPrecision(message = "数量最多允许4位小数!", value = 4)
  133 + private BigDecimal quantity;
  134 +
  135 + /**
  136 + * 销售价格
  137 + */
  138 + @ApiModelProperty("销售价格")
  139 + @TypeMismatch(message = "销售价格格式有误!")
  140 + @IsNumberPrecision(message = "销售价格最多允许4位小数!", value = 4)
  141 + private BigDecimal salesPrice;
  142 +
  143 + /**
  144 + * 交货日期
  145 + */
  146 + @ApiModelProperty("交货日期")
  147 + @TypeMismatch(message = "交货日期格式有误!")
  148 + private LocalDate deliveryDate;
  149 +
  150 + /**
  151 + * 排序
  152 + */
  153 + @ApiModelProperty("排序")
  154 + @TypeMismatch(message = "排序格式有误!")
  155 + private Integer showOrder;
  156 +
  157 + /**
  158 + * 考核超协
  159 + */
  160 + @ApiModelProperty("考核超协")
  161 + @Length(message = "考核超协最多允许20个字符!")
  162 + private String assessmentExceedsAgreement;
  163 +
  164 +}
  1 +package com.lframework.xingyun.sc.vo.order;
  2 +
  3 +import lombok.Data;
  4 +import com.lframework.starter.web.core.vo.PageVo;
  5 +import com.lframework.starter.web.core.vo.BaseVo;
  6 +import io.swagger.annotations.ApiModelProperty;
  7 +import java.io.Serializable;
  8 +
  9 +@Data
  10 +public class QueryPurchaseOrderInfoVo extends PageVo implements BaseVo, Serializable {
  11 +
  12 + private static final long serialVersionUID = 1L;
  13 +
  14 + /**
  15 + * 订单编号
  16 + */
  17 + @ApiModelProperty("订单编号")
  18 + private String orderNo;
  19 +
  20 + /**
  21 + * 订货单位名称
  22 + */
  23 + @ApiModelProperty("订货单位名称")
  24 + private String orderingUnitName;
  25 +
  26 + /**
  27 + * 订货单位ID
  28 + */
  29 + @ApiModelProperty("订货单位ID")
  30 + private String orderingUnitId;
  31 +
  32 + /**
  33 + * 订货开始日期
  34 + */
  35 + @ApiModelProperty("登记开始日期")
  36 + private String orderDateStart;
  37 +
  38 + /**
  39 + * 订货结束日期
  40 + */
  41 + @ApiModelProperty("登记结束日期")
  42 + private String orderDateEnd;
  43 +
  44 + /**
  45 + * 状态
  46 + */
  47 + @ApiModelProperty("状态")
  48 + private String status;
  49 +
  50 + /**
  51 + * 审核状态
  52 + */
  53 + @ApiModelProperty("审核状态")
  54 + private String examineStatus;
  55 +
  56 + /**
  57 + * 办事处
  58 + */
  59 + @ApiModelProperty("办事处")
  60 + private String deptId;
  61 +
  62 + /**
  63 + * 生产厂
  64 + */
  65 + @ApiModelProperty("生产厂")
  66 + private String workshopId;
  67 +
  68 +}
  1 +package com.lframework.xingyun.sc.vo.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 QueryPurchaseOrderLineVo extends PageVo implements BaseVo, Serializable {
  13 +
  14 + private static final long serialVersionUID = 1L;
  15 +
  16 + /**
  17 + * 订货单主表ID
  18 + */
  19 + @ApiModelProperty("订货单主表ID")
  20 + private String purchaseOrderId;
  21 +
  22 + /**
  23 + * 牌号
  24 + */
  25 + @ApiModelProperty("牌号")
  26 + private String brand;
  27 +
  28 + /**
  29 + * 状态
  30 + */
  31 + @ApiModelProperty("状态")
  32 + private String status;
  33 +
  34 + /**
  35 + * 交货日期
  36 + */
  37 + @ApiModelProperty("交货日期")
  38 + @TypeMismatch(message = "交货日期格式有误!")
  39 + private LocalDate deliveryDate;
  40 +
  41 +}
  1 +package com.lframework.xingyun.sc.vo.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 com.lframework.starter.web.core.components.validation.TypeMismatch;
  8 +import io.swagger.annotations.ApiModelProperty;
  9 +import org.hibernate.validator.constraints.Length;
  10 +import java.io.Serializable;
  11 +
  12 +@Data
  13 +public class UpdatePurchaseOrderInfoVo implements BaseVo, Serializable {
  14 +
  15 + private static final long serialVersionUID = 1L;
  16 +
  17 + /**
  18 + * ID
  19 + */
  20 + @ApiModelProperty(value = "ID", required = true)
  21 + @NotBlank(message = "id不能为空!")
  22 + private String id;
  23 +
  24 + /**
  25 + * 订单编号
  26 + */
  27 + @ApiModelProperty("订单编号")
  28 + @Length(message = "订单编号最多允许50个字符!")
  29 + private String orderNo;
  30 +
  31 + /**
  32 + * 供货单位:安徽楚江高精铜带有限公司(GJ)、安徽楚江科技新材料股份有限公司(XC)
  33 + */
  34 + @ApiModelProperty("供货单位")
  35 + @Length(message = "供货单位最多允许100个字符!")
  36 + private String supplyUnit;
  37 +
  38 + /**
  39 + * 订货单位ID
  40 + */
  41 + @ApiModelProperty("订货单位ID")
  42 + @Length(message = "订货单位ID最多允许100个字符!")
  43 + private String orderingUnit;
  44 +
  45 + /**
  46 + * 订货单位名称
  47 + */
  48 + @ApiModelProperty("订货单位名称")
  49 + private String orderingUnitName;
  50 +
  51 + /**
  52 + * 订货日期
  53 + */
  54 + @ApiModelProperty("订货日期")
  55 + @TypeMismatch(message = "订货日期格式有误!")
  56 + private LocalDate orderDate;
  57 +
  58 + /**
  59 + * 结算方式或期限
  60 + */
  61 + @ApiModelProperty("结算方式或期限")
  62 + @Length(message = "结算方式或期限最多允许100个字符!")
  63 + private String settlementTerms;
  64 +
  65 + /**
  66 + * 交货方式
  67 + */
  68 + @ApiModelProperty("交货方式")
  69 + @Length(message = "交货方式最多允许50个字符!")
  70 + private String deliveryMethod;
  71 +
  72 + /**
  73 + * 价格表编号
  74 + */
  75 + @ApiModelProperty("价格表编号")
  76 + @Length(message = "价格表编号最多允许50个字符!")
  77 + private String priceListNo;
  78 +
  79 + /**
  80 + * 执行标准
  81 + */
  82 + @ApiModelProperty("执行标准")
  83 + @Length(message = "执行标准最多允许100个字符!")
  84 + private String executionStandard;
  85 +
  86 + /**
  87 + * 开票情况
  88 + */
  89 + @ApiModelProperty("开票情况")
  90 + @Length(message = "开票情况最多允许50个字符!")
  91 + private String invoicingStatus;
  92 +
  93 + /**
  94 + * 运费
  95 + */
  96 + @ApiModelProperty("运费")
  97 + @Length(message = "运费最多允许20个字符!")
  98 + private String shippingCost;
  99 +
  100 + /**
  101 + * 件重条头
  102 + */
  103 + @ApiModelProperty("件重条头")
  104 + @Length(message = "件重条头最多允许500个字符!")
  105 + private String pieceWeightHeader;
  106 +
  107 + /**
  108 + * 表面
  109 + */
  110 + @ApiModelProperty("表面")
  111 + @Length(message = "表面最多允许500个字符!")
  112 + private String surface;
  113 +
  114 + /**
  115 + * 公差
  116 + */
  117 + @ApiModelProperty("公差")
  118 + @Length(message = "公差最多允许500个字符!")
  119 + private String tolerance;
  120 +
  121 + /**
  122 + * 性能
  123 + */
  124 + @ApiModelProperty("性能")
  125 + @Length(message = "性能最多允许500个字符!")
  126 + private String performance;
  127 +
  128 + /**
  129 + * 元素
  130 + */
  131 + @ApiModelProperty("元素")
  132 + @Length(message = "元素最多允许500个字符!")
  133 + private String element;
  134 +
  135 + /**
  136 + * 包装
  137 + */
  138 + @ApiModelProperty("包装")
  139 + @Length(message = "包装最多允许500个字符!")
  140 + private String packaging;
  141 +
  142 + /**
  143 + * 备注
  144 + */
  145 + @ApiModelProperty("备注")
  146 + @Length(message = "备注最多允许500个字符!")
  147 + private String remarks;
  148 +
  149 + /**
  150 + * 状态
  151 + */
  152 + @ApiModelProperty("状态")
  153 + @Length(message = "状态最多允许20个字符!")
  154 + private String status;
  155 +
  156 + /**
  157 + * 审核状态
  158 + */
  159 + @ApiModelProperty("审核状态")
  160 + private String examineStatus;
  161 +
  162 + /**
  163 + * 生产工艺
  164 + */
  165 + @ApiModelProperty("生产工艺")
  166 + @Length(message = "生产工艺最多允许500个字符!")
  167 + private String productionProcess;
  168 +
  169 + /**
  170 + * 办事处
  171 + */
  172 + @ApiModelProperty("办事处")
  173 + private String deptId;
  174 +
  175 + /**
  176 + * 生产厂
  177 + */
  178 + @ApiModelProperty("生产厂")
  179 + private String workshopId;
  180 +
  181 + /**
  182 + * 客户资信Id
  183 + */
  184 + @ApiModelProperty("客户资信Id")
  185 + private String customerCreditId;
  186 +
  187 +}
  1 +package com.lframework.xingyun.sc.vo.order;
  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 UpdatePurchaseOrderLineVo 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 + * 订货单主表ID
  28 + */
  29 + @ApiModelProperty(value = "订货单主表ID", required = true)
  30 + @NotBlank(message = "请输入订货单主表ID!")
  31 + @Length(message = "订货单主表ID最多允许32个字符!")
  32 + private String purchaseOrderId;
  33 +
  34 + /**
  35 + * 行业
  36 + */
  37 + @ApiModelProperty("行业")
  38 + @Length(message = "行业最多允许100个字符!")
  39 + private String industry;
  40 +
  41 + /**
  42 + * 品质
  43 + */
  44 + @ApiModelProperty("品质")
  45 + @Length(message = "品质最多允许100个字符!")
  46 + private String quality;
  47 +
  48 + /**
  49 + * 牌号
  50 + */
  51 + @ApiModelProperty("牌号")
  52 + @Length(message = "牌号最多允许100个字符!")
  53 + private String brand;
  54 +
  55 + /**
  56 + * 厚度
  57 + */
  58 + @ApiModelProperty("厚度")
  59 + @TypeMismatch(message = "厚度格式有误!")
  60 + @IsNumberPrecision(message = "厚度最多允许4位小数!", value = 4)
  61 + private BigDecimal thickness;
  62 +
  63 + /**
  64 + * 厚度公差正
  65 + */
  66 + @ApiModelProperty("厚度公差正")
  67 + @TypeMismatch(message = "厚度公差正格式有误!")
  68 + @IsNumberPrecision(message = "厚度公差正最多允许4位小数!", value = 4)
  69 + private BigDecimal thicknessTolPos;
  70 +
  71 + /**
  72 + * 厚度公差负
  73 + */
  74 + @ApiModelProperty("厚度公差负")
  75 + @TypeMismatch(message = "厚度公差负格式有误!")
  76 + @IsNumberPrecision(message = "厚度公差负最多允许4位小数!", value = 4)
  77 + private BigDecimal thicknessTolNeg;
  78 +
  79 + /**
  80 + * 宽度
  81 + */
  82 + @ApiModelProperty("宽度")
  83 + @TypeMismatch(message = "宽度格式有误!")
  84 + @IsNumberPrecision(message = "宽度最多允许4位小数!", value = 4)
  85 + private BigDecimal width;
  86 +
  87 + /**
  88 + * 宽度公差正
  89 + */
  90 + @ApiModelProperty("宽度公差正")
  91 + @TypeMismatch(message = "宽度公差正格式有误!")
  92 + @IsNumberPrecision(message = "宽度公差正最多允许4位小数!", value = 4)
  93 + private BigDecimal widthTolPos;
  94 +
  95 + /**
  96 + * 宽度公差负
  97 + */
  98 + @ApiModelProperty("宽度公差负")
  99 + @TypeMismatch(message = "宽度公差负格式有误!")
  100 + @IsNumberPrecision(message = "宽度公差负最多允许4位小数!", value = 4)
  101 + private BigDecimal widthTolNeg;
  102 +
  103 + /**
  104 + * 长度
  105 + */
  106 + @ApiModelProperty("长度")
  107 + @TypeMismatch(message = "长度格式有误!")
  108 + @IsNumberPrecision(message = "长度最多允许4位小数!", value = 4)
  109 + private BigDecimal length;
  110 +
  111 + /**
  112 + * 长度公差正
  113 + */
  114 + @ApiModelProperty("长度公差正")
  115 + @TypeMismatch(message = "长度公差正格式有误!")
  116 + @IsNumberPrecision(message = "长度公差正最多允许4位小数!", value = 4)
  117 + private BigDecimal lengthTolPos;
  118 +
  119 + /**
  120 + * 长度公差负
  121 + */
  122 + @ApiModelProperty("长度公差负")
  123 + @TypeMismatch(message = "长度公差负格式有误!")
  124 + @IsNumberPrecision(message = "长度公差负最多允许4位小数!", value = 4)
  125 + private BigDecimal lengthTolNeg;
  126 +
  127 + /**
  128 + * 状态
  129 + */
  130 + @ApiModelProperty("状态")
  131 + @Length(message = "状态最多允许50个字符!")
  132 + private String status;
  133 +
  134 + /**
  135 + * 数量
  136 + */
  137 + @ApiModelProperty("数量")
  138 + @TypeMismatch(message = "数量格式有误!")
  139 + @IsNumberPrecision(message = "数量最多允许4位小数!", value = 4)
  140 + private BigDecimal quantity;
  141 +
  142 + /**
  143 + * 销售价格
  144 + */
  145 + @ApiModelProperty("销售价格")
  146 + @TypeMismatch(message = "销售价格格式有误!")
  147 + @IsNumberPrecision(message = "销售价格最多允许4位小数!", value = 4)
  148 + private BigDecimal salesPrice;
  149 +
  150 + /**
  151 + * 交货日期
  152 + */
  153 + @ApiModelProperty("交货日期")
  154 + @TypeMismatch(message = "交货日期格式有误!")
  155 + private LocalDate deliveryDate;
  156 +
  157 + /**
  158 + * 排序
  159 + */
  160 + @ApiModelProperty("排序")
  161 + @TypeMismatch(message = "排序格式有误!")
  162 + private Integer showOrder;
  163 +
  164 + /**
  165 + * 考核超协
  166 + */
  167 + @ApiModelProperty("考核超协")
  168 + @Length(message = "考核超协最多允许20个字符!")
  169 + private String assessmentExceedsAgreement;
  170 +
  171 +}
  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.PurchaseOrderInfoMapper">
  4 +
  5 + <resultMap id="PurchaseOrderInfo" type="com.lframework.xingyun.sc.entity.PurchaseOrderInfo">
  6 + <id column="id" property="id"/>
  7 + <result column="order_no" property="orderNo"/>
  8 + <result column="supply_unit" property="supplyUnit"/>
  9 + <result column="ordering_unit" property="orderingUnit"/>
  10 + <result column="ordering_unit_name" property="orderingUnitName"/>
  11 + <result column="order_date" property="orderDate"/>
  12 + <result column="settlement_terms" property="settlementTerms"/>
  13 + <result column="delivery_method" property="deliveryMethod"/>
  14 + <result column="price_list_no" property="priceListNo"/>
  15 + <result column="execution_standard" property="executionStandard"/>
  16 + <result column="invoicing_status" property="invoicingStatus"/>
  17 + <result column="shipping_cost" property="shippingCost"/>
  18 + <result column="piece_weight_header" property="pieceWeightHeader"/>
  19 + <result column="surface" property="surface"/>
  20 + <result column="tolerance" property="tolerance"/>
  21 + <result column="performance" property="performance"/>
  22 + <result column="element" property="element"/>
  23 + <result column="packaging" property="packaging"/>
  24 + <result column="remarks" property="remarks"/>
  25 + <result column="status" property="status"/>
  26 + <result column="examine_status" property="examineStatus"/>
  27 + <result column="production_process" property="productionProcess"/>
  28 + <result column="dept_id" property="deptId"/>
  29 + <result column="dept_name" property="deptName"/>
  30 + <result column="workshop_id" property="workshopId"/>
  31 + <result column="workshop_name" property="workshopName"/>
  32 + <result column="customer_credit_id" property="customerCreditId"/>
  33 + <result column="customer_tier" property="customerTier"/>
  34 + <result column="create_by_id" property="createById"/>
  35 + <result column="create_by" property="createBy"/>
  36 + <result column="update_by_id" property="updateById"/>
  37 + <result column="update_by" property="updateBy"/>
  38 + <result column="create_time" property="createTime"/>
  39 + <result column="update_time" property="updateTime"/>
  40 + </resultMap>
  41 +
  42 + <sql id="PurchaseOrderInfo_sql">
  43 + SELECT
  44 + tb.id,
  45 + tb.order_no,
  46 + tb.supply_unit,
  47 + tb.ordering_unit,
  48 + cu.name AS ordering_unit_name,
  49 + tb.order_date,
  50 + tb.settlement_terms,
  51 + tb.delivery_method,
  52 + tb.price_list_no,
  53 + tb.execution_standard,
  54 + tb.invoicing_status,
  55 + tb.shipping_cost,
  56 + tb.piece_weight_header,
  57 + tb.surface,
  58 + tb.tolerance,
  59 + tb.performance,
  60 + tb.element,
  61 + tb.packaging,
  62 + tb.remarks,
  63 + tb.status,
  64 + tb.examine_status,
  65 + tb.production_process,
  66 + tb.dept_id,
  67 + sd.name AS dept_name,
  68 + tb.workshop_id,
  69 + ws.name AS workshop_name,
  70 + tb.customer_credit_id,
  71 + cc.company_suggested_category AS customer_tier,
  72 + tb.create_by_id,
  73 + tb.create_by,
  74 + tb.update_by_id,
  75 + tb.update_by,
  76 + tb.create_time,
  77 + tb.update_time
  78 + FROM purchase_order_info AS tb
  79 + left join base_data_customer as cu on cu.id = tb.ordering_unit
  80 + left join sys_dept as sd on sd.id = tb.dept_id
  81 + left join base_data_workshop as ws on ws.id = tb.workshop_id
  82 + left join customer_credit as cc on cc.id = tb.customer_credit_id
  83 + </sql>
  84 +
  85 + <select id="query" resultMap="PurchaseOrderInfo">
  86 + <include refid="PurchaseOrderInfo_sql"/>
  87 + <where>
  88 + <if test="vo.orderNo != null and vo.orderNo != ''">
  89 + AND tb.order_no = #{vo.orderNo}
  90 + </if>
  91 + <if test="vo.orderingUnitName != null and vo.orderingUnitName != ''">
  92 + AND cu.name LIKE CONCAT('%', #{vo.orderingUnitName},'%')
  93 + </if>
  94 + <if test="vo.orderDateStart != null">
  95 + AND tb.order_date >= #{vo.orderDate}
  96 + </if>
  97 + <if test="vo.orderDateEnd != null">
  98 + <![CDATA[
  99 + AND tb.order_date <= #{vo.orderDate}
  100 + ]]>
  101 + </if>
  102 + <if test="vo.status != null and vo.status != ''">
  103 + AND tb.status = #{vo.status}
  104 + </if>
  105 + <if test="vo.examineStatus != null and vo.examineStatus != ''">
  106 + AND tb.examine_status = #{vo.examineStatus}
  107 + </if>
  108 + <if test="vo.deptId != null and vo.deptId != ''">
  109 + AND tb.dept_id = #{vo.deptId}
  110 + </if>
  111 + <if test="vo.workshopId != null and vo.workshopId != ''">
  112 + AND tb.workshop_id = #{vo.workshopId}
  113 + </if>
  114 + </where>
  115 + ORDER BY tb.update_time DESC
  116 + </select>
  117 +</mapper>
  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.PurchaseOrderLineMapper">
  4 +
  5 + <resultMap id="PurchaseOrderLine" type="com.lframework.xingyun.sc.entity.PurchaseOrderLine">
  6 + <id column="id" property="id"/>
  7 + <result column="purchase_order_id" property="purchaseOrderId"/>
  8 + <result column="industry" property="industry"/>
  9 + <result column="quality" property="quality"/>
  10 + <result column="brand" property="brand"/>
  11 + <result column="thickness" property="thickness"/>
  12 + <result column="thickness_tol_pos" property="thicknessTolPos"/>
  13 + <result column="thickness_tol_neg" property="thicknessTolNeg"/>
  14 + <result column="width" property="width"/>
  15 + <result column="width_tol_pos" property="widthTolPos"/>
  16 + <result column="width_tol_neg" property="widthTolNeg"/>
  17 + <result column="length" property="length"/>
  18 + <result column="length_tol_pos" property="lengthTolPos"/>
  19 + <result column="length_tol_neg" property="lengthTolNeg"/>
  20 + <result column="status" property="status"/>
  21 + <result column="quantity" property="quantity"/>
  22 + <result column="sales_price" property="salesPrice"/>
  23 + <result column="delivery_date" property="deliveryDate"/>
  24 + <result column="show_order" property="showOrder"/>
  25 + <result column="assessment_exceeds_agreement" property="assessmentExceedsAgreement"/>
  26 + <result column="create_by_id" property="createById"/>
  27 + <result column="create_by" property="createBy"/>
  28 + <result column="update_by_id" property="updateById"/>
  29 + <result column="update_by" property="updateBy"/>
  30 + <result column="create_time" property="createTime"/>
  31 + <result column="update_time" property="updateTime"/>
  32 + </resultMap>
  33 +
  34 + <sql id="PurchaseOrderLine_sql">
  35 + SELECT
  36 + tb.id,
  37 + tb.purchase_order_id,
  38 + tb.industry,
  39 + tb.quality,
  40 + tb.brand,
  41 + tb.thickness,
  42 + tb.thickness_tol_pos,
  43 + tb.thickness_tol_neg,
  44 + tb.width,
  45 + tb.width_tol_pos,
  46 + tb.width_tol_neg,
  47 + tb.length,
  48 + tb.length_tol_pos,
  49 + tb.length_tol_neg,
  50 + tb.status,
  51 + tb.quantity,
  52 + tb.sales_price,
  53 + tb.delivery_date,
  54 + tb.show_order,
  55 + tb.assessment_exceeds_agreement,
  56 + tb.create_by_id,
  57 + tb.create_by,
  58 + tb.update_by_id,
  59 + tb.update_by,
  60 + tb.create_time,
  61 + tb.update_time
  62 + FROM tbl_purchase_order_line AS tb
  63 + </sql>
  64 +
  65 + <select id="query" resultMap="PurchaseOrderLine">
  66 + <include refid="PurchaseOrderLine_sql"/>
  67 + <where>
  68 + <if test="vo.purchaseOrderId != null and vo.purchaseOrderId != ''">
  69 + AND tb.purchase_order_id = #{vo.purchaseOrderId}
  70 + </if>
  71 + <if test="vo.brand != null and vo.brand != ''">
  72 + AND tb.brand = #{vo.brand}
  73 + </if>
  74 + <if test="vo.status != null and vo.status != ''">
  75 + AND tb.status = #{vo.status}
  76 + </if>
  77 + <if test="vo.deliveryDate != null">
  78 + AND tb.delivery_date = #{vo.deliveryDate}
  79 + </if>
  80 + </where>
  81 + ORDER BY tb.show_order ASC
  82 + </select>
  83 +</mapper>