Commit 5e0e8f39f4ca09e9a64e22f9dbf8affcb637bfbd

Authored by 杨鸣坤
1 parent 87670dcb

楚江ERP:加工标准合同物料行实体

@@ -167,4 +167,45 @@ create table if not exists `tbl_contract_distributor_line` @@ -167,4 +167,45 @@ create table if not exists `tbl_contract_distributor_line`
167 `update_by` varchar(20) not null comment '更新人', 167 `update_by` varchar(20) not null comment '更新人',
168 `create_time` datetime default now() comment '创建时间', 168 `create_time` datetime default now() comment '创建时间',
169 `update_time` datetime default now() comment '更新时间' 169 `update_time` datetime default now() comment '更新时间'
170 -)  
  170 +)
  171 +
  172 +-- 加工标准合同物料行
  173 +DROP TABLE IF EXISTS `tbl_contract_std_processing_line`;
  174 +create table `tbl_contract_std_processing_line`
  175 +(
  176 + `id` varchar(32) primary key comment 'ID',
  177 + `contract_id` varchar(32) NOT NULL COMMENT '合同主表ID',
  178 + `raw_product_id` VARCHAR(50) COMMENT '原材料名称',
  179 + `raw_product_grade` VARCHAR(100) COMMENT '原材料牌号',
  180 + `industry` VARCHAR(100) COMMENT '行业',
  181 + `quality` VARCHAR(100) COMMENT '品质',
  182 + `loss_rate` VARCHAR(50) COMMENT '损耗',
  183 + `supply_time` DATE COMMENT '提供时间',
  184 + `material_product_ratio` VARCHAR(50) COMMENT '原材料与产品数量比',
  185 + `material_product_ratio_remarks` VARCHAR(100) COMMENT '原材料与产品数量比备注',
  186 + `product_id` VARCHAR(50) NOT NULL COMMENT '定作物名称',
  187 + `product_grade` VARCHAR(100) COMMENT '定作物牌号',
  188 + `product_status` VARCHAR(100) COMMENT '定作物状态',
  189 + `product_quantity` DECIMAL(15, 4) NOT NULL COMMENT '定作物数量',
  190 + `thickness` DECIMAL(10, 4) COMMENT '厚度',
  191 + `thickness_tol_pos` DECIMAL(10, 4) COMMENT '厚度公差正',
  192 + `thickness_tol_neg` DECIMAL(10, 4) COMMENT '厚度公差负',
  193 + `width` DECIMAL(10, 4) COMMENT '宽度',
  194 + `width_tol_pos` DECIMAL(10, 4) COMMENT '宽度公差正',
  195 + `width_tol_neg` DECIMAL(10, 4) COMMENT '宽度公差负',
  196 + `length` DECIMAL(10, 4) COMMENT '长度',
  197 + `length_tol_pos` DECIMAL(10, 4) COMMENT '长度公差正',
  198 + `length_tol_neg` DECIMAL(10, 4) COMMENT '长度公差负',
  199 + `unit_price` DECIMAL(12, 4) NOT NULL COMMENT '单价',
  200 + `amount_excluding_tax` DECIMAL(14, 2) COMMENT '不含税金额',
  201 + `total_amount` DECIMAL(14, 2) NOT NULL COMMENT '总金额',
  202 + `delivery_date` DATE COMMENT '发货日期',
  203 + `show_order` INT DEFAULT 0 COMMENT '排序',
  204 + `item_id` varchar(50) COMMENT '前端用ID',
  205 + `create_by_id` varchar(32) not null comment '创建人ID',
  206 + `create_by` varchar(20) not null comment '创建人',
  207 + `update_by_id` varchar(32) not null comment '更新人ID',
  208 + `update_by` varchar(20) not null comment '更新人',
  209 + `create_time` datetime default now() comment '创建时间',
  210 + `update_time` datetime default now() comment '更新时间'
  211 +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '加工标准合同物料行' ROW_FORMAT = DYNAMIC;
  1 +package com.lframework.xingyun.sc.bo.contract;
  2 +
  3 +import com.fasterxml.jackson.annotation.JsonFormat;
  4 +import com.lframework.starter.common.constants.StringPool;
  5 +import com.lframework.starter.web.core.bo.BaseBo;
  6 +import com.lframework.xingyun.sc.entity.ContractStdProcessingLine;
  7 +import io.swagger.annotations.ApiModelProperty;
  8 +import lombok.Data;
  9 +
  10 +import java.math.BigDecimal;
  11 +import java.time.LocalDate;
  12 +
  13 +/**
  14 + * <p>
  15 + * 加工标准合同物料行 GetBo
  16 + * </p>
  17 + */
  18 +@Data
  19 +public class GetContractStdProcessingLineBo extends BaseBo<ContractStdProcessingLine> {
  20 +
  21 + /**
  22 + * ID
  23 + */
  24 + @ApiModelProperty("ID")
  25 + private String id;
  26 +
  27 + /**
  28 + * 合同主表ID
  29 + */
  30 + @ApiModelProperty("合同主表ID")
  31 + private String contractId;
  32 +
  33 + /**
  34 + * 原材料名称
  35 + */
  36 + @ApiModelProperty("原材料名称")
  37 + private String rawProductId;
  38 +
  39 + /**
  40 + * 原材料名称
  41 + */
  42 + @ApiModelProperty("原材料名称")
  43 + private String rawProductName;
  44 +
  45 + /**
  46 + * 原材料牌号
  47 + */
  48 + @ApiModelProperty("原材料牌号")
  49 + private String rawProductGrade;
  50 +
  51 + /**
  52 + * 行业
  53 + */
  54 + @ApiModelProperty("行业")
  55 + private String industry;
  56 +
  57 + /**
  58 + * 品质
  59 + */
  60 + @ApiModelProperty("品质")
  61 + private String quality;
  62 +
  63 + /**
  64 + * 损耗
  65 + */
  66 + @ApiModelProperty("损耗")
  67 + private String lossRate;
  68 +
  69 + /**
  70 + * 提供时间
  71 + */
  72 + @ApiModelProperty("提供时间")
  73 + @JsonFormat(pattern = StringPool.DATE_PATTERN)
  74 + private LocalDate supplyTime;
  75 +
  76 + /**
  77 + * 原材料与产品数量比
  78 + */
  79 + @ApiModelProperty("原材料与产品数量比")
  80 + private String materialProductRatio;
  81 +
  82 + /**
  83 + * 原材料与产品数量比
  84 + */
  85 + @ApiModelProperty("原材料与产品数量比")
  86 + private String materialProductRatioName;
  87 +
  88 + /**
  89 + * 原材料与产品数量比备注
  90 + */
  91 + @ApiModelProperty("原材料与产品数量比备注")
  92 + private String materialProductRatioRemarks;
  93 +
  94 + /**
  95 + * 定作物名称
  96 + */
  97 + @ApiModelProperty("定作物名称")
  98 + private String productId;
  99 +
  100 + /**
  101 + * 定作物名称
  102 + */
  103 + @ApiModelProperty("定作物名称")
  104 + private String productName;
  105 +
  106 + /**
  107 + * 定作物牌号
  108 + */
  109 + @ApiModelProperty("定作物牌号")
  110 + private String productGrade;
  111 +
  112 + /**
  113 + * 定作物状态
  114 + */
  115 + @ApiModelProperty("定作物状态")
  116 + private String productStatus;
  117 +
  118 + /**
  119 + * 定作物数量
  120 + */
  121 + @ApiModelProperty("定作物数量")
  122 + private BigDecimal productQuantity;
  123 +
  124 + /**
  125 + * 厚度
  126 + */
  127 + @ApiModelProperty("厚度")
  128 + private BigDecimal thickness;
  129 +
  130 + /**
  131 + * 厚度公差正
  132 + */
  133 + @ApiModelProperty("厚度公差正")
  134 + private BigDecimal thicknessTolPos;
  135 +
  136 + /**
  137 + * 厚度公差负
  138 + */
  139 + @ApiModelProperty("厚度公差负")
  140 + private BigDecimal thicknessTolNeg;
  141 +
  142 + /**
  143 + * 宽度
  144 + */
  145 + @ApiModelProperty("宽度")
  146 + private BigDecimal width;
  147 +
  148 + /**
  149 + * 宽度公差正
  150 + */
  151 + @ApiModelProperty("宽度公差正")
  152 + private BigDecimal widthTolPos;
  153 +
  154 + /**
  155 + * 宽度公差负
  156 + */
  157 + @ApiModelProperty("宽度公差负")
  158 + private BigDecimal widthTolNeg;
  159 +
  160 + /**
  161 + * 长度
  162 + */
  163 + @ApiModelProperty("长度")
  164 + private BigDecimal length;
  165 +
  166 + /**
  167 + * 长度公差正
  168 + */
  169 + @ApiModelProperty("长度公差正")
  170 + private BigDecimal lengthTolPos;
  171 +
  172 + /**
  173 + * 长度公差负
  174 + */
  175 + @ApiModelProperty("长度公差负")
  176 + private BigDecimal lengthTolNeg;
  177 +
  178 + /**
  179 + * 单价
  180 + */
  181 + @ApiModelProperty("单价")
  182 + private BigDecimal unitPrice;
  183 +
  184 + /**
  185 + * 不含税金额
  186 + */
  187 + @ApiModelProperty("不含税金额")
  188 + private BigDecimal amountExcludingTax;
  189 +
  190 + /**
  191 + * 总金额
  192 + */
  193 + @ApiModelProperty("总金额")
  194 + private BigDecimal totalAmount;
  195 +
  196 + /**
  197 + * 发货日期
  198 + */
  199 + @ApiModelProperty("发货日期")
  200 + @JsonFormat(pattern = StringPool.DATE_PATTERN)
  201 + private LocalDate deliveryDate;
  202 +
  203 + /**
  204 + * 排序
  205 + */
  206 + @ApiModelProperty("排序")
  207 + private Integer showOrder;
  208 +
  209 + /**
  210 + * 前端用ID
  211 + */
  212 + @ApiModelProperty("前端用ID")
  213 + private String itemId;
  214 +
  215 + public GetContractStdProcessingLineBo() {
  216 +
  217 + }
  218 +
  219 + public GetContractStdProcessingLineBo(ContractStdProcessingLine dto) {
  220 +
  221 + super(dto);
  222 + }
  223 +
  224 + @Override
  225 + public BaseBo<ContractStdProcessingLine> convert(ContractStdProcessingLine dto) {
  226 + return super.convert(dto);
  227 + }
  228 +
  229 + @Override
  230 + protected void afterInit(ContractStdProcessingLine dto) {
  231 +
  232 + }
  233 +}
  1 +package com.lframework.xingyun.sc.entity;
  2 +
  3 +import com.baomidou.mybatisplus.annotation.TableName;
  4 +
  5 +import java.math.BigDecimal;
  6 +
  7 +import com.lframework.starter.web.core.dto.BaseDto;
  8 +
  9 +import java.time.LocalDate;
  10 +import java.time.LocalDateTime;
  11 +
  12 +import com.baomidou.mybatisplus.annotation.FieldFill;
  13 +import com.lframework.starter.web.core.entity.BaseEntity;
  14 +import com.baomidou.mybatisplus.annotation.TableField;
  15 +import lombok.Data;
  16 +
  17 +/**
  18 + * <p>
  19 + * 加工标准合同物料行
  20 + * </p>
  21 + */
  22 +@Data
  23 +@TableName("tbl_contract_std_processing_line")
  24 +public class ContractStdProcessingLine extends BaseEntity implements BaseDto {
  25 +
  26 + private static final long serialVersionUID = 1L;
  27 +
  28 + public static final String CACHE_NAME = "ContractStdProcessingLine";
  29 +
  30 + /**
  31 + * ID
  32 + */
  33 + private String id;
  34 +
  35 + /**
  36 + * 合同主表ID
  37 + */
  38 + private String contractId;
  39 +
  40 + /**
  41 + * 原材料名称
  42 + */
  43 + private String rawProductId;
  44 +
  45 + /**
  46 + * 原材料牌号
  47 + */
  48 + private String rawProductGrade;
  49 +
  50 + /**
  51 + * 行业
  52 + */
  53 + private String industry;
  54 +
  55 + /**
  56 + * 品质
  57 + */
  58 + private String quality;
  59 +
  60 + /**
  61 + * 损耗
  62 + */
  63 + private String lossRate;
  64 +
  65 + /**
  66 + * 提供时间
  67 + */
  68 + private LocalDate supplyTime;
  69 +
  70 + /**
  71 + * 原材料与产品数量比
  72 + */
  73 + private String materialProductRatio;
  74 +
  75 + /**
  76 + * 原材料与产品数量比备注
  77 + */
  78 + private String materialProductRatioRemarks;
  79 +
  80 + /**
  81 + * 定作物名称
  82 + */
  83 + private String productId;
  84 +
  85 + /**
  86 + * 定作物牌号
  87 + */
  88 + private String productGrade;
  89 +
  90 + /**
  91 + * 定作物状态
  92 + */
  93 + private String productStatus;
  94 +
  95 + /**
  96 + * 定作物数量
  97 + */
  98 + private BigDecimal productQuantity;
  99 +
  100 + /**
  101 + * 厚度
  102 + */
  103 + private BigDecimal thickness;
  104 +
  105 + /**
  106 + * 厚度公差正
  107 + */
  108 + private BigDecimal thicknessTolPos;
  109 +
  110 + /**
  111 + * 厚度公差负
  112 + */
  113 + private BigDecimal thicknessTolNeg;
  114 +
  115 + /**
  116 + * 宽度
  117 + */
  118 + private BigDecimal width;
  119 +
  120 + /**
  121 + * 宽度公差正
  122 + */
  123 + private BigDecimal widthTolPos;
  124 +
  125 + /**
  126 + * 宽度公差负
  127 + */
  128 + private BigDecimal widthTolNeg;
  129 +
  130 + /**
  131 + * 长度
  132 + */
  133 + private BigDecimal length;
  134 +
  135 + /**
  136 + * 长度公差正
  137 + */
  138 + private BigDecimal lengthTolPos;
  139 +
  140 + /**
  141 + * 长度公差负
  142 + */
  143 + private BigDecimal lengthTolNeg;
  144 +
  145 + /**
  146 + * 单价
  147 + */
  148 + private BigDecimal unitPrice;
  149 +
  150 + /**
  151 + * 不含税金额
  152 + */
  153 + private BigDecimal amountExcludingTax;
  154 +
  155 + /**
  156 + * 总金额
  157 + */
  158 + private BigDecimal totalAmount;
  159 +
  160 + /**
  161 + * 发货日期
  162 + */
  163 + private LocalDate deliveryDate;
  164 +
  165 + /**
  166 + * 排序
  167 + */
  168 + private Integer showOrder;
  169 +
  170 + /**
  171 + * 前端用ID
  172 + */
  173 + private String itemId;
  174 +
  175 + /**
  176 + * 创建人ID
  177 + */
  178 + @TableField(fill = FieldFill.INSERT)
  179 + private String createById;
  180 +
  181 + /**
  182 + * 创建人
  183 + */
  184 + @TableField(fill = FieldFill.INSERT)
  185 + private String createBy;
  186 +
  187 + /**
  188 + * 更新人ID
  189 + */
  190 + @TableField(fill = FieldFill.INSERT_UPDATE)
  191 + private String updateById;
  192 +
  193 + /**
  194 + * 更新人
  195 + */
  196 + @TableField(fill = FieldFill.INSERT_UPDATE)
  197 + private String updateBy;
  198 +
  199 + /**
  200 + * 创建时间
  201 + */
  202 + @TableField(fill = FieldFill.INSERT)
  203 + private LocalDateTime createTime;
  204 +
  205 + /**
  206 + * 更新时间
  207 + */
  208 + @TableField(fill = FieldFill.INSERT_UPDATE)
  209 + private LocalDateTime updateTime;
  210 +
  211 +}
@@ -303,6 +303,8 @@ public class ContractDistributorStandardServiceImpl extends @@ -303,6 +303,8 @@ public class ContractDistributorStandardServiceImpl extends
303 OpLogUtil.setVariable("id", data.getId()); 303 OpLogUtil.setVariable("id", data.getId());
304 OpLogUtil.setExtra(vo); 304 OpLogUtil.setExtra(vo);
305 305
  306 + clearChildContractDistributorStandardCache(vo.getId());
  307 +
306 data.setFormalFileId(vo.getFormalFileId()); 308 data.setFormalFileId(vo.getFormalFileId());
307 data.setFormalFileName(vo.getFormalFileName()); 309 data.setFormalFileName(vo.getFormalFileName());
308 data.setFormalStandardized(vo.getFormalStandardized()); 310 data.setFormalStandardized(vo.getFormalStandardized());
@@ -311,6 +313,20 @@ public class ContractDistributorStandardServiceImpl extends @@ -311,6 +313,20 @@ public class ContractDistributorStandardServiceImpl extends
311 flowInstanceWrapperService.startInstance(FORMAL_FLAG, data.getId(), FORMAL_FLAG, data); 313 flowInstanceWrapperService.startInstance(FORMAL_FLAG, data.getId(), FORMAL_FLAG, data);
312 } 314 }
313 315
  316 + private void clearChildContractDistributorStandardCache(String id) {
  317 + if (StringUtils.isBlank(id)) {
  318 + return;
  319 + }
  320 +
  321 + Wrapper<ContractDistributorStandard> childWrapper = Wrappers.lambdaQuery(ContractDistributorStandard.class)
  322 + .eq(ContractDistributorStandard::getParentId, id);
  323 +
  324 + List<ContractDistributorStandard> childList = getBaseMapper().selectList(childWrapper);
  325 + CollectionUtils.emptyIfNull(childList).forEach(contractDistributorStandard -> {
  326 + cleanCacheByKey(contractDistributorStandard.getId());
  327 + });
  328 + }
  329 +
314 @OpLog(type = OtherOpLogType.class, name = "上传标准合同附件,ID:{}", params = {"#id"}) 330 @OpLog(type = OtherOpLogType.class, name = "上传标准合同附件,ID:{}", params = {"#id"})
315 @Transactional(rollbackFor = Exception.class) 331 @Transactional(rollbackFor = Exception.class)
316 @Override 332 @Override
@@ -374,6 +390,7 @@ public class ContractDistributorStandardServiceImpl extends @@ -374,6 +390,7 @@ public class ContractDistributorStandardServiceImpl extends
374 OpLogUtil.setExtra(vo); 390 OpLogUtil.setExtra(vo);
375 391
376 cleanCacheByKey(id); 392 cleanCacheByKey(id);
  393 + clearChildContractDistributorStandardCache(id);
377 } 394 }
378 395
379 @Override 396 @Override
  1 +package com.lframework.xingyun.sc.impl.contract;
  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.common.exceptions.impl.DefaultClientException;
  7 +import com.lframework.starter.common.utils.Assert;
  8 +import com.lframework.starter.common.utils.ObjectUtil;
  9 +import com.lframework.starter.common.utils.StringUtil;
  10 +import com.lframework.starter.web.core.annotations.oplog.OpLog;
  11 +import com.lframework.starter.web.core.components.resp.PageResult;
  12 +import com.lframework.starter.web.core.impl.BaseMpServiceImpl;
  13 +import com.lframework.starter.web.core.utils.IdUtil;
  14 +import com.lframework.starter.web.core.utils.OpLogUtil;
  15 +import com.lframework.starter.web.core.utils.PageHelperUtil;
  16 +import com.lframework.starter.web.core.utils.PageResultUtil;
  17 +import com.lframework.starter.web.inner.components.oplog.OtherOpLogType;
  18 +import com.lframework.xingyun.sc.entity.ContractStdProcessingLine;
  19 +import com.lframework.xingyun.sc.mappers.ContractStdProcessingLineMapper;
  20 +import com.lframework.xingyun.sc.service.contract.ContractStdProcessingLineService;
  21 +import com.lframework.xingyun.sc.vo.contract.createVo.CreateContractStdProcessingLineVo;
  22 +import com.lframework.xingyun.sc.vo.contract.queryVo.QueryContractStdProcessingLineVo;
  23 +import com.lframework.xingyun.sc.vo.contract.updateVo.UpdateContractStdProcessingLineVo;
  24 +import org.springframework.cache.annotation.CacheEvict;
  25 +import org.springframework.cache.annotation.Cacheable;
  26 +import org.springframework.stereotype.Service;
  27 +import org.springframework.transaction.annotation.Transactional;
  28 +
  29 +import java.io.Serializable;
  30 +import java.util.List;
  31 +
  32 +@Service
  33 +public class ContractStdProcessingLineServiceImpl extends BaseMpServiceImpl<ContractStdProcessingLineMapper, ContractStdProcessingLine> implements ContractStdProcessingLineService {
  34 +
  35 + @Override
  36 + public PageResult<ContractStdProcessingLine> query(Integer pageIndex, Integer pageSize, QueryContractStdProcessingLineVo vo) {
  37 +
  38 + Assert.greaterThanZero(pageIndex);
  39 + Assert.greaterThanZero(pageSize);
  40 +
  41 + PageHelperUtil.startPage(pageIndex, pageSize);
  42 + List<ContractStdProcessingLine> datas = this.query(vo);
  43 +
  44 + return PageResultUtil.convert(new PageInfo<>(datas));
  45 + }
  46 +
  47 + @Override
  48 + public List<ContractStdProcessingLine> query(QueryContractStdProcessingLineVo vo) {
  49 +
  50 + return getBaseMapper().query(vo);
  51 + }
  52 +
  53 + @Cacheable(value = ContractStdProcessingLine.CACHE_NAME, key = "@cacheVariables.tenantId() + #id", unless = "#result == null")
  54 + @Override
  55 + public ContractStdProcessingLine findById(String id) {
  56 +
  57 + return getBaseMapper().selectById(id);
  58 + }
  59 +
  60 + @OpLog(type = OtherOpLogType.class, name = "新增加工标准合同物料行,ID:{}", params = {"#id"})
  61 + @Transactional(rollbackFor = Exception.class)
  62 + @Override
  63 + public String create(CreateContractStdProcessingLineVo vo) {
  64 +
  65 + ContractStdProcessingLine data = new ContractStdProcessingLine();
  66 + data.setId(IdUtil.getUUID());
  67 + if (!StringUtil.isBlank(vo.getContractId())) {
  68 + data.setContractId(vo.getContractId());
  69 + }
  70 + if (!StringUtil.isBlank(vo.getRawProductId())) {
  71 + data.setRawProductId(vo.getRawProductId());
  72 + }
  73 + if (!StringUtil.isBlank(vo.getRawProductGrade())) {
  74 + data.setRawProductGrade(vo.getRawProductGrade());
  75 + }
  76 + if (!StringUtil.isBlank(vo.getIndustry())) {
  77 + data.setIndustry(vo.getIndustry());
  78 + }
  79 + if (!StringUtil.isBlank(vo.getQuality())) {
  80 + data.setQuality(vo.getQuality());
  81 + }
  82 + if (!StringUtil.isBlank(vo.getLossRate())) {
  83 + data.setLossRate(vo.getLossRate());
  84 + }
  85 + if (vo.getSupplyTime() != null) {
  86 + data.setSupplyTime(vo.getSupplyTime());
  87 + }
  88 + if (!StringUtil.isBlank(vo.getMaterialProductRatio())) {
  89 + data.setMaterialProductRatio(vo.getMaterialProductRatio());
  90 + }
  91 + if (!StringUtil.isBlank(vo.getMaterialProductRatioRemarks())) {
  92 + data.setMaterialProductRatioRemarks(vo.getMaterialProductRatioRemarks());
  93 + }
  94 + if (!StringUtil.isBlank(vo.getProductId())) {
  95 + data.setProductId(vo.getProductId());
  96 + }
  97 + if (!StringUtil.isBlank(vo.getProductGrade())) {
  98 + data.setProductGrade(vo.getProductGrade());
  99 + }
  100 + if (!StringUtil.isBlank(vo.getProductStatus())) {
  101 + data.setProductStatus(vo.getProductStatus());
  102 + }
  103 + if (vo.getProductQuantity() != null) {
  104 + data.setProductQuantity(vo.getProductQuantity());
  105 + }
  106 + if (vo.getThickness() != null) {
  107 + data.setThickness(vo.getThickness());
  108 + }
  109 + if (vo.getThicknessTolPos() != null) {
  110 + data.setThicknessTolPos(vo.getThicknessTolPos());
  111 + }
  112 + if (vo.getThicknessTolNeg() != null) {
  113 + data.setThicknessTolNeg(vo.getThicknessTolNeg());
  114 + }
  115 + if (vo.getWidth() != null) {
  116 + data.setWidth(vo.getWidth());
  117 + }
  118 + if (vo.getWidthTolPos() != null) {
  119 + data.setWidthTolPos(vo.getWidthTolPos());
  120 + }
  121 + if (vo.getWidthTolNeg() != null) {
  122 + data.setWidthTolNeg(vo.getWidthTolNeg());
  123 + }
  124 + if (vo.getLength() != null) {
  125 + data.setLength(vo.getLength());
  126 + }
  127 + if (vo.getLengthTolPos() != null) {
  128 + data.setLengthTolPos(vo.getLengthTolPos());
  129 + }
  130 + if (vo.getLengthTolNeg() != null) {
  131 + data.setLengthTolNeg(vo.getLengthTolNeg());
  132 + }
  133 + if (vo.getUnitPrice() != null) {
  134 + data.setUnitPrice(vo.getUnitPrice());
  135 + }
  136 + if (vo.getAmountExcludingTax() != null) {
  137 + data.setAmountExcludingTax(vo.getAmountExcludingTax());
  138 + }
  139 + if (vo.getTotalAmount() != null) {
  140 + data.setTotalAmount(vo.getTotalAmount());
  141 + }
  142 + if (vo.getDeliveryDate() != null) {
  143 + data.setDeliveryDate(vo.getDeliveryDate());
  144 + }
  145 + if (vo.getShowOrder() != null) {
  146 + data.setShowOrder(vo.getShowOrder());
  147 + }
  148 + if (!StringUtil.isBlank(vo.getItemId())) {
  149 + data.setItemId(vo.getItemId());
  150 + }
  151 +
  152 + getBaseMapper().insert(data);
  153 +
  154 + OpLogUtil.setVariable("id", data.getId());
  155 + OpLogUtil.setExtra(vo);
  156 +
  157 + return data.getId();
  158 + }
  159 +
  160 + @OpLog(type = OtherOpLogType.class, name = "修改加工标准合同物料行,ID:{}", params = {"#id"})
  161 + @Transactional(rollbackFor = Exception.class)
  162 + @Override
  163 + public void update(UpdateContractStdProcessingLineVo vo) {
  164 +
  165 + ContractStdProcessingLine data = getBaseMapper().selectById(vo.getId());
  166 + if (ObjectUtil.isNull(data)) {
  167 + throw new DefaultClientException("加工标准合同物料行不存在!");
  168 + }
  169 +
  170 + LambdaUpdateWrapper<ContractStdProcessingLine> updateWrapper = Wrappers.lambdaUpdate(ContractStdProcessingLine.class)
  171 + .set(ContractStdProcessingLine::getContractId, StringUtil.isBlank(vo.getContractId()) ? null : vo.getContractId())
  172 + .set(ContractStdProcessingLine::getRawProductId, StringUtil.isBlank(vo.getRawProductId()) ? null : vo.getRawProductId())
  173 + .set(ContractStdProcessingLine::getRawProductGrade, StringUtil.isBlank(vo.getRawProductGrade()) ? null : vo.getRawProductGrade())
  174 + .set(ContractStdProcessingLine::getIndustry, StringUtil.isBlank(vo.getIndustry()) ? null : vo.getIndustry())
  175 + .set(ContractStdProcessingLine::getQuality, StringUtil.isBlank(vo.getQuality()) ? null : vo.getQuality())
  176 + .set(ContractStdProcessingLine::getLossRate, StringUtil.isBlank(vo.getLossRate()) ? null : vo.getLossRate())
  177 + .set(ContractStdProcessingLine::getSupplyTime, vo.getSupplyTime() == null ? null : vo.getSupplyTime())
  178 + .set(ContractStdProcessingLine::getMaterialProductRatio, StringUtil.isBlank(vo.getMaterialProductRatio()) ? null : vo.getMaterialProductRatio())
  179 + .set(ContractStdProcessingLine::getMaterialProductRatioRemarks, StringUtil.isBlank(vo.getMaterialProductRatioRemarks()) ? null : vo.getMaterialProductRatioRemarks())
  180 + .set(ContractStdProcessingLine::getProductId, StringUtil.isBlank(vo.getProductId()) ? null : vo.getProductId())
  181 + .set(ContractStdProcessingLine::getProductGrade, StringUtil.isBlank(vo.getProductGrade()) ? null : vo.getProductGrade())
  182 + .set(ContractStdProcessingLine::getProductStatus, StringUtil.isBlank(vo.getProductStatus()) ? null : vo.getProductStatus())
  183 + .set(ContractStdProcessingLine::getProductQuantity, vo.getProductQuantity() == null ? null : vo.getProductQuantity())
  184 + .set(ContractStdProcessingLine::getThickness, vo.getThickness() == null ? null : vo.getThickness())
  185 + .set(ContractStdProcessingLine::getThicknessTolPos, vo.getThicknessTolPos() == null ? null : vo.getThicknessTolPos())
  186 + .set(ContractStdProcessingLine::getThicknessTolNeg, vo.getThicknessTolNeg() == null ? null : vo.getThicknessTolNeg())
  187 + .set(ContractStdProcessingLine::getWidth, vo.getWidth() == null ? null : vo.getWidth())
  188 + .set(ContractStdProcessingLine::getWidthTolPos, vo.getWidthTolPos() == null ? null : vo.getWidthTolPos())
  189 + .set(ContractStdProcessingLine::getWidthTolNeg, vo.getWidthTolNeg() == null ? null : vo.getWidthTolNeg())
  190 + .set(ContractStdProcessingLine::getLength, vo.getLength() == null ? null : vo.getLength())
  191 + .set(ContractStdProcessingLine::getLengthTolPos, vo.getLengthTolPos() == null ? null : vo.getLengthTolPos())
  192 + .set(ContractStdProcessingLine::getLengthTolNeg, vo.getLengthTolNeg() == null ? null : vo.getLengthTolNeg())
  193 + .set(ContractStdProcessingLine::getUnitPrice, vo.getUnitPrice() == null ? null : vo.getUnitPrice())
  194 + .set(ContractStdProcessingLine::getAmountExcludingTax, vo.getAmountExcludingTax() == null ? null : vo.getAmountExcludingTax())
  195 + .set(ContractStdProcessingLine::getTotalAmount, vo.getTotalAmount() == null ? null : vo.getTotalAmount())
  196 + .set(ContractStdProcessingLine::getDeliveryDate, vo.getDeliveryDate() == null ? null : vo.getDeliveryDate())
  197 + .set(ContractStdProcessingLine::getShowOrder, vo.getShowOrder() == null ? null : vo.getShowOrder())
  198 + .set(ContractStdProcessingLine::getItemId, StringUtil.isBlank(vo.getItemId()) ? null : vo.getItemId())
  199 + .eq(ContractStdProcessingLine::getId, vo.getId());
  200 +
  201 + getBaseMapper().update(updateWrapper);
  202 +
  203 + OpLogUtil.setVariable("id", data.getId());
  204 + OpLogUtil.setExtra(vo);
  205 + }
  206 +
  207 + @CacheEvict(value = ContractStdProcessingLine.CACHE_NAME, key = "@cacheVariables.tenantId() + #key")
  208 + @Override
  209 + public void cleanCacheByKey(Serializable key) {
  210 +
  211 + }
  212 +}
  1 +package com.lframework.xingyun.sc.mappers;
  2 +
  3 +import com.lframework.starter.web.core.mapper.BaseMapper;
  4 +import com.lframework.xingyun.sc.entity.ContractStdProcessingLine;
  5 +import com.lframework.xingyun.sc.vo.contract.queryVo.QueryContractStdProcessingLineVo;
  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 ContractStdProcessingLineMapper extends BaseMapper<ContractStdProcessingLine> {
  17 +
  18 + /**
  19 + * 查询列表
  20 + * @param vo
  21 + * @return
  22 + */
  23 + List<ContractStdProcessingLine> query(@Param("vo") QueryContractStdProcessingLineVo vo);
  24 +}
  1 +package com.lframework.xingyun.sc.service.contract;
  2 +
  3 +import com.lframework.starter.web.core.components.resp.PageResult;
  4 +import com.lframework.starter.web.core.service.BaseMpService;
  5 +import com.lframework.xingyun.sc.entity.ContractStdProcessingLine;
  6 +import com.lframework.xingyun.sc.vo.contract.createVo.CreateContractStdProcessingLineVo;
  7 +import com.lframework.xingyun.sc.vo.contract.queryVo.QueryContractStdProcessingLineVo;
  8 +import com.lframework.xingyun.sc.vo.contract.updateVo.UpdateContractStdProcessingLineVo;
  9 +
  10 +import java.util.List;
  11 +
  12 +/**
  13 + * 加工标准合同物料行 Service
  14 + */
  15 +public interface ContractStdProcessingLineService extends BaseMpService<ContractStdProcessingLine> {
  16 +
  17 + /**
  18 + * 查询列表
  19 + *
  20 + * @return
  21 + */
  22 + PageResult<ContractStdProcessingLine> query(Integer pageIndex, Integer pageSize, QueryContractStdProcessingLineVo vo);
  23 +
  24 + /**
  25 + * 查询列表
  26 + *
  27 + * @param vo
  28 + * @return
  29 + */
  30 + List<ContractStdProcessingLine> query(QueryContractStdProcessingLineVo vo);
  31 +
  32 + /**
  33 + * 根据ID查询
  34 + *
  35 + * @param id
  36 + * @return
  37 + */
  38 + ContractStdProcessingLine findById(String id);
  39 +
  40 + /**
  41 + * 创建
  42 + *
  43 + * @param vo
  44 + * @return
  45 + */
  46 + String create(CreateContractStdProcessingLineVo vo);
  47 +
  48 + /**
  49 + * 修改
  50 + *
  51 + * @param vo
  52 + */
  53 + void update(UpdateContractStdProcessingLineVo vo);
  54 +
  55 +}
  1 +package com.lframework.xingyun.sc.vo.contract.createVo;
  2 +
  3 +import com.lframework.starter.web.core.components.validation.IsNumberPrecision;
  4 +import com.lframework.starter.web.core.components.validation.TypeMismatch;
  5 +import com.lframework.starter.web.core.vo.BaseVo;
  6 +import io.swagger.annotations.ApiModelProperty;
  7 +import lombok.Data;
  8 +import org.hibernate.validator.constraints.Length;
  9 +
  10 +import java.io.Serializable;
  11 +import java.math.BigDecimal;
  12 +import java.time.LocalDate;
  13 +
  14 +@Data
  15 +public class CreateContractStdProcessingLineVo implements BaseVo, Serializable {
  16 +
  17 + private static final long serialVersionUID = 1L;
  18 +
  19 + /**
  20 + * 合同主表ID
  21 + */
  22 + @ApiModelProperty("合同主表ID")
  23 + @Length(message = "合同主表ID最多允许32个字符!")
  24 + private String contractId;
  25 +
  26 + /**
  27 + * 原材料名称
  28 + */
  29 + @ApiModelProperty("原材料名称")
  30 + @Length(message = "原材料名称最多允许50个字符!")
  31 + private String rawProductId;
  32 +
  33 + /**
  34 + * 原材料牌号
  35 + */
  36 + @ApiModelProperty("原材料牌号")
  37 + @Length(message = "原材料牌号最多允许100个字符!")
  38 + private String rawProductGrade;
  39 +
  40 + /**
  41 + * 行业
  42 + */
  43 + @ApiModelProperty("行业")
  44 + @Length(message = "行业最多允许100个字符!")
  45 + private String industry;
  46 +
  47 + /**
  48 + * 品质
  49 + */
  50 + @ApiModelProperty("品质")
  51 + @Length(message = "品质最多允许100个字符!")
  52 + private String quality;
  53 +
  54 + /**
  55 + * 损耗
  56 + */
  57 + @ApiModelProperty("损耗")
  58 + @Length(message = "损耗最多允许50个字符!")
  59 + private String lossRate;
  60 +
  61 + /**
  62 + * 提供时间
  63 + */
  64 + @ApiModelProperty("提供时间")
  65 + @TypeMismatch(message = "提供时间格式有误!")
  66 + private LocalDate supplyTime;
  67 +
  68 + /**
  69 + * 原材料与产品数量比
  70 + */
  71 + @ApiModelProperty("原材料与产品数量比")
  72 + @Length(message = "原材料与产品数量比最多允许50个字符!")
  73 + private String materialProductRatio;
  74 +
  75 + /**
  76 + * 原材料与产品数量比备注
  77 + */
  78 + @ApiModelProperty("原材料与产品数量比备注")
  79 + @Length(message = "原材料与产品数量比备注最多允许100个字符!")
  80 + private String materialProductRatioRemarks;
  81 +
  82 + /**
  83 + * 定作物名称
  84 + */
  85 + @ApiModelProperty("定作物名称")
  86 + @Length(message = "定作物名称最多允许50个字符!")
  87 + private String productId;
  88 +
  89 + /**
  90 + * 定作物牌号
  91 + */
  92 + @ApiModelProperty("定作物牌号")
  93 + @Length(message = "定作物牌号最多允许100个字符!")
  94 + private String productGrade;
  95 +
  96 + /**
  97 + * 定作物状态
  98 + */
  99 + @ApiModelProperty("定作物状态")
  100 + @Length(message = "定作物状态最多允许100个字符!")
  101 + private String productStatus;
  102 +
  103 + /**
  104 + * 定作物数量
  105 + */
  106 + @ApiModelProperty("定作物数量")
  107 + @TypeMismatch(message = "定作物数量格式有误!")
  108 + @IsNumberPrecision(message = "定作物数量最多允许4位小数!", value = 4)
  109 + private BigDecimal productQuantity;
  110 +
  111 + /**
  112 + * 厚度
  113 + */
  114 + @ApiModelProperty("厚度")
  115 + @TypeMismatch(message = "厚度格式有误!")
  116 + @IsNumberPrecision(message = "厚度最多允许4位小数!", value = 4)
  117 + private BigDecimal thickness;
  118 +
  119 + /**
  120 + * 厚度公差正
  121 + */
  122 + @ApiModelProperty("厚度公差正")
  123 + @TypeMismatch(message = "厚度公差正格式有误!")
  124 + @IsNumberPrecision(message = "厚度公差正最多允许4位小数!", value = 4)
  125 + private BigDecimal thicknessTolPos;
  126 +
  127 + /**
  128 + * 厚度公差负
  129 + */
  130 + @ApiModelProperty("厚度公差负")
  131 + @TypeMismatch(message = "厚度公差负格式有误!")
  132 + @IsNumberPrecision(message = "厚度公差负最多允许4位小数!", value = 4)
  133 + private BigDecimal thicknessTolNeg;
  134 +
  135 + /**
  136 + * 宽度
  137 + */
  138 + @ApiModelProperty("宽度")
  139 + @TypeMismatch(message = "宽度格式有误!")
  140 + @IsNumberPrecision(message = "宽度最多允许4位小数!", value = 4)
  141 + private BigDecimal width;
  142 +
  143 + /**
  144 + * 宽度公差正
  145 + */
  146 + @ApiModelProperty("宽度公差正")
  147 + @TypeMismatch(message = "宽度公差正格式有误!")
  148 + @IsNumberPrecision(message = "宽度公差正最多允许4位小数!", value = 4)
  149 + private BigDecimal widthTolPos;
  150 +
  151 + /**
  152 + * 宽度公差负
  153 + */
  154 + @ApiModelProperty("宽度公差负")
  155 + @TypeMismatch(message = "宽度公差负格式有误!")
  156 + @IsNumberPrecision(message = "宽度公差负最多允许4位小数!", value = 4)
  157 + private BigDecimal widthTolNeg;
  158 +
  159 + /**
  160 + * 长度
  161 + */
  162 + @ApiModelProperty("长度")
  163 + @TypeMismatch(message = "长度格式有误!")
  164 + @IsNumberPrecision(message = "长度最多允许4位小数!", value = 4)
  165 + private BigDecimal length;
  166 +
  167 + /**
  168 + * 长度公差正
  169 + */
  170 + @ApiModelProperty("长度公差正")
  171 + @TypeMismatch(message = "长度公差正格式有误!")
  172 + @IsNumberPrecision(message = "长度公差正最多允许4位小数!", value = 4)
  173 + private BigDecimal lengthTolPos;
  174 +
  175 + /**
  176 + * 长度公差负
  177 + */
  178 + @ApiModelProperty("长度公差负")
  179 + @TypeMismatch(message = "长度公差负格式有误!")
  180 + @IsNumberPrecision(message = "长度公差负最多允许4位小数!", value = 4)
  181 + private BigDecimal lengthTolNeg;
  182 +
  183 + /**
  184 + * 单价
  185 + */
  186 + @ApiModelProperty("单价")
  187 + @TypeMismatch(message = "单价格式有误!")
  188 + @IsNumberPrecision(message = "单价最多允许4位小数!", value = 4)
  189 + private BigDecimal unitPrice;
  190 +
  191 + /**
  192 + * 不含税金额
  193 + */
  194 + @ApiModelProperty("不含税金额")
  195 + @TypeMismatch(message = "不含税金额格式有误!")
  196 + @IsNumberPrecision(message = "不含税金额最多允许2位小数!", value = 2)
  197 + private BigDecimal amountExcludingTax;
  198 +
  199 + /**
  200 + * 总金额
  201 + */
  202 + @ApiModelProperty("总金额")
  203 + @TypeMismatch(message = "总金额格式有误!")
  204 + @IsNumberPrecision(message = "总金额最多允许2位小数!", value = 2)
  205 + private BigDecimal totalAmount;
  206 +
  207 + /**
  208 + * 发货日期
  209 + */
  210 + @ApiModelProperty("发货日期")
  211 + @TypeMismatch(message = "发货日期格式有误!")
  212 + private LocalDate deliveryDate;
  213 +
  214 + /**
  215 + * 排序
  216 + */
  217 + @ApiModelProperty("排序")
  218 + @TypeMismatch(message = "排序格式有误!")
  219 + private Integer showOrder;
  220 +
  221 + /**
  222 + * 前端用ID
  223 + */
  224 + @ApiModelProperty("前端用ID")
  225 + @Length(message = "前端用ID最多允许50个字符!")
  226 + private String itemId;
  227 +
  228 +}
  229 +
  1 +package com.lframework.xingyun.sc.vo.contract.queryVo;
  2 +
  3 +import com.lframework.starter.web.core.vo.BaseVo;
  4 +import com.lframework.starter.web.core.vo.PageVo;
  5 +import io.swagger.annotations.ApiModelProperty;
  6 +import lombok.Data;
  7 +
  8 +import java.io.Serializable;
  9 +
  10 +@Data
  11 +public class QueryContractStdProcessingLineVo extends PageVo implements BaseVo, Serializable {
  12 +
  13 + private static final long serialVersionUID = 1L;
  14 +
  15 + /**
  16 + * 合同主表ID
  17 + */
  18 + @ApiModelProperty("合同主表ID")
  19 + private String contractId;
  20 +
  21 +}
  1 +package com.lframework.xingyun.sc.vo.contract.updateVo;
  2 +
  3 +import com.lframework.starter.web.core.components.validation.IsNumberPrecision;
  4 +import com.lframework.starter.web.core.components.validation.TypeMismatch;
  5 +import com.lframework.starter.web.core.vo.BaseVo;
  6 +import io.swagger.annotations.ApiModelProperty;
  7 +import lombok.Data;
  8 +import org.hibernate.validator.constraints.Length;
  9 +
  10 +import javax.validation.constraints.NotBlank;
  11 +import java.io.Serializable;
  12 +import java.math.BigDecimal;
  13 +import java.time.LocalDate;
  14 +
  15 +@Data
  16 +public class UpdateContractStdProcessingLineVo implements BaseVo, Serializable {
  17 +
  18 + private static final long serialVersionUID = 1L;
  19 +
  20 + /**
  21 + * ID
  22 + */
  23 + @ApiModelProperty(value = "ID", required = true)
  24 + @NotBlank(message = "id不能为空!")
  25 + private String id;
  26 +
  27 + /**
  28 + * 合同主表ID
  29 + */
  30 + @ApiModelProperty("合同主表ID")
  31 + @Length(message = "合同主表ID最多允许32个字符!")
  32 + private String contractId;
  33 +
  34 + /**
  35 + * 原材料名称
  36 + */
  37 + @ApiModelProperty("原材料名称")
  38 + @Length(message = "原材料名称最多允许50个字符!")
  39 + private String rawProductId;
  40 +
  41 + /**
  42 + * 原材料牌号
  43 + */
  44 + @ApiModelProperty("原材料牌号")
  45 + @Length(message = "原材料牌号最多允许100个字符!")
  46 + private String rawProductGrade;
  47 +
  48 + /**
  49 + * 行业
  50 + */
  51 + @ApiModelProperty("行业")
  52 + @Length(message = "行业最多允许100个字符!")
  53 + private String industry;
  54 +
  55 + /**
  56 + * 品质
  57 + */
  58 + @ApiModelProperty("品质")
  59 + @Length(message = "品质最多允许100个字符!")
  60 + private String quality;
  61 +
  62 + /**
  63 + * 损耗
  64 + */
  65 + @ApiModelProperty("损耗")
  66 + @Length(message = "损耗最多允许50个字符!")
  67 + private String lossRate;
  68 +
  69 + /**
  70 + * 提供时间
  71 + */
  72 + @ApiModelProperty("提供时间")
  73 + @TypeMismatch(message = "提供时间格式有误!")
  74 + private LocalDate supplyTime;
  75 +
  76 + /**
  77 + * 原材料与产品数量比
  78 + */
  79 + @ApiModelProperty("原材料与产品数量比")
  80 + @Length(message = "原材料与产品数量比最多允许50个字符!")
  81 + private String materialProductRatio;
  82 +
  83 + /**
  84 + * 原材料与产品数量比备注
  85 + */
  86 + @ApiModelProperty("原材料与产品数量比备注")
  87 + @Length(message = "原材料与产品数量比备注最多允许100个字符!")
  88 + private String materialProductRatioRemarks;
  89 +
  90 + /**
  91 + * 定作物名称
  92 + */
  93 + @ApiModelProperty("定作物名称")
  94 + @Length(message = "定作物名称最多允许50个字符!")
  95 + private String productId;
  96 +
  97 + /**
  98 + * 定作物牌号
  99 + */
  100 + @ApiModelProperty("定作物牌号")
  101 + @Length(message = "定作物牌号最多允许100个字符!")
  102 + private String productGrade;
  103 +
  104 + /**
  105 + * 定作物状态
  106 + */
  107 + @ApiModelProperty("定作物状态")
  108 + @Length(message = "定作物状态最多允许100个字符!")
  109 + private String productStatus;
  110 +
  111 + /**
  112 + * 定作物数量
  113 + */
  114 + @ApiModelProperty("定作物数量")
  115 + @TypeMismatch(message = "定作物数量格式有误!")
  116 + @IsNumberPrecision(message = "定作物数量最多允许4位小数!", value = 4)
  117 + private BigDecimal productQuantity;
  118 +
  119 + /**
  120 + * 厚度
  121 + */
  122 + @ApiModelProperty("厚度")
  123 + @TypeMismatch(message = "厚度格式有误!")
  124 + @IsNumberPrecision(message = "厚度最多允许4位小数!", value = 4)
  125 + private BigDecimal thickness;
  126 +
  127 + /**
  128 + * 厚度公差正
  129 + */
  130 + @ApiModelProperty("厚度公差正")
  131 + @TypeMismatch(message = "厚度公差正格式有误!")
  132 + @IsNumberPrecision(message = "厚度公差正最多允许4位小数!", value = 4)
  133 + private BigDecimal thicknessTolPos;
  134 +
  135 + /**
  136 + * 厚度公差负
  137 + */
  138 + @ApiModelProperty("厚度公差负")
  139 + @TypeMismatch(message = "厚度公差负格式有误!")
  140 + @IsNumberPrecision(message = "厚度公差负最多允许4位小数!", value = 4)
  141 + private BigDecimal thicknessTolNeg;
  142 +
  143 + /**
  144 + * 宽度
  145 + */
  146 + @ApiModelProperty("宽度")
  147 + @TypeMismatch(message = "宽度格式有误!")
  148 + @IsNumberPrecision(message = "宽度最多允许4位小数!", value = 4)
  149 + private BigDecimal width;
  150 +
  151 + /**
  152 + * 宽度公差正
  153 + */
  154 + @ApiModelProperty("宽度公差正")
  155 + @TypeMismatch(message = "宽度公差正格式有误!")
  156 + @IsNumberPrecision(message = "宽度公差正最多允许4位小数!", value = 4)
  157 + private BigDecimal widthTolPos;
  158 +
  159 + /**
  160 + * 宽度公差负
  161 + */
  162 + @ApiModelProperty("宽度公差负")
  163 + @TypeMismatch(message = "宽度公差负格式有误!")
  164 + @IsNumberPrecision(message = "宽度公差负最多允许4位小数!", value = 4)
  165 + private BigDecimal widthTolNeg;
  166 +
  167 + /**
  168 + * 长度
  169 + */
  170 + @ApiModelProperty("长度")
  171 + @TypeMismatch(message = "长度格式有误!")
  172 + @IsNumberPrecision(message = "长度最多允许4位小数!", value = 4)
  173 + private BigDecimal length;
  174 +
  175 + /**
  176 + * 长度公差正
  177 + */
  178 + @ApiModelProperty("长度公差正")
  179 + @TypeMismatch(message = "长度公差正格式有误!")
  180 + @IsNumberPrecision(message = "长度公差正最多允许4位小数!", value = 4)
  181 + private BigDecimal lengthTolPos;
  182 +
  183 + /**
  184 + * 长度公差负
  185 + */
  186 + @ApiModelProperty("长度公差负")
  187 + @TypeMismatch(message = "长度公差负格式有误!")
  188 + @IsNumberPrecision(message = "长度公差负最多允许4位小数!", value = 4)
  189 + private BigDecimal lengthTolNeg;
  190 +
  191 + /**
  192 + * 单价
  193 + */
  194 + @ApiModelProperty("单价")
  195 + @TypeMismatch(message = "单价格式有误!")
  196 + @IsNumberPrecision(message = "单价最多允许4位小数!", value = 4)
  197 + private BigDecimal unitPrice;
  198 +
  199 + /**
  200 + * 不含税金额
  201 + */
  202 + @ApiModelProperty("不含税金额")
  203 + @TypeMismatch(message = "不含税金额格式有误!")
  204 + @IsNumberPrecision(message = "不含税金额最多允许2位小数!", value = 2)
  205 + private BigDecimal amountExcludingTax;
  206 +
  207 + /**
  208 + * 总金额
  209 + */
  210 + @ApiModelProperty("总金额")
  211 + @TypeMismatch(message = "总金额格式有误!")
  212 + @IsNumberPrecision(message = "总金额最多允许2位小数!", value = 2)
  213 + private BigDecimal totalAmount;
  214 +
  215 + /**
  216 + * 发货日期
  217 + */
  218 + @ApiModelProperty("发货日期")
  219 + @TypeMismatch(message = "发货日期格式有误!")
  220 + private LocalDate deliveryDate;
  221 +
  222 + /**
  223 + * 排序
  224 + */
  225 + @ApiModelProperty("排序")
  226 + @TypeMismatch(message = "排序格式有误!")
  227 + private Integer showOrder;
  228 +
  229 + /**
  230 + * 前端用ID
  231 + */
  232 + @ApiModelProperty("前端用ID")
  233 + @Length(message = "前端用ID最多允许50个字符!")
  234 + private String itemId;
  235 +
  236 +}
  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.ContractStdProcessingLineMapper">
  4 +
  5 + <resultMap id="ContractStdProcessingLine" type="com.lframework.xingyun.sc.entity.ContractStdProcessingLine">
  6 + <id column="id" property="id"/>
  7 + <result column="contract_id" property="contractId"/>
  8 + <result column="raw_product_id" property="rawProductId"/>
  9 + <result column="raw_product_grade" property="rawProductGrade"/>
  10 + <result column="industry" property="industry"/>
  11 + <result column="quality" property="quality"/>
  12 + <result column="loss_rate" property="lossRate"/>
  13 + <result column="supply_time" property="supplyTime"/>
  14 + <result column="material_product_ratio" property="materialProductRatio"/>
  15 + <result column="material_product_ratio_remarks" property="materialProductRatioRemarks"/>
  16 + <result column="product_id" property="productId"/>
  17 + <result column="product_grade" property="productGrade"/>
  18 + <result column="product_status" property="productStatus"/>
  19 + <result column="product_quantity" property="productQuantity"/>
  20 + <result column="thickness" property="thickness"/>
  21 + <result column="thickness_tol_pos" property="thicknessTolPos"/>
  22 + <result column="thickness_tol_neg" property="thicknessTolNeg"/>
  23 + <result column="width" property="width"/>
  24 + <result column="width_tol_pos" property="widthTolPos"/>
  25 + <result column="width_tol_neg" property="widthTolNeg"/>
  26 + <result column="length" property="length"/>
  27 + <result column="length_tol_pos" property="lengthTolPos"/>
  28 + <result column="length_tol_neg" property="lengthTolNeg"/>
  29 + <result column="unit_price" property="unitPrice"/>
  30 + <result column="amount_excluding_tax" property="amountExcludingTax"/>
  31 + <result column="total_amount" property="totalAmount"/>
  32 + <result column="delivery_date" property="deliveryDate"/>
  33 + <result column="show_order" property="showOrder"/>
  34 + <result column="item_id" property="itemId"/>
  35 + <result column="create_by_id" property="createById"/>
  36 + <result column="create_by" property="createBy"/>
  37 + <result column="update_by_id" property="updateById"/>
  38 + <result column="update_by" property="updateBy"/>
  39 + <result column="create_time" property="createTime"/>
  40 + <result column="update_time" property="updateTime"/>
  41 + </resultMap>
  42 +
  43 + <sql id="ContractStdProcessingLine_sql">
  44 + SELECT
  45 + tb.id,
  46 + tb.contract_id,
  47 + tb.raw_product_id,
  48 + tb.raw_product_grade,
  49 + tb.industry,
  50 + tb.quality,
  51 + tb.loss_rate,
  52 + tb.supply_time,
  53 + tb.material_product_ratio,
  54 + tb.material_product_ratio_remarks,
  55 + tb.product_id,
  56 + tb.product_grade,
  57 + tb.product_status,
  58 + tb.product_quantity,
  59 + tb.thickness,
  60 + tb.thickness_tol_pos,
  61 + tb.thickness_tol_neg,
  62 + tb.width,
  63 + tb.width_tol_pos,
  64 + tb.width_tol_neg,
  65 + tb.length,
  66 + tb.length_tol_pos,
  67 + tb.length_tol_neg,
  68 + tb.unit_price,
  69 + tb.amount_excluding_tax,
  70 + tb.total_amount,
  71 + tb.delivery_date,
  72 + tb.show_order,
  73 + tb.item_id,
  74 + tb.create_by_id,
  75 + tb.create_by,
  76 + tb.update_by_id,
  77 + tb.update_by,
  78 + tb.create_time,
  79 + tb.update_time
  80 + FROM tbl_contract_std_processing_line AS tb
  81 + </sql>
  82 +
  83 + <select id="query" resultMap="ContractStdProcessingLine">
  84 + <include refid="ContractStdProcessingLine_sql"/>
  85 + <where>
  86 + <if test="vo.contractId != null and vo.contractId != ''">
  87 + AND tb.contract_id = #{vo.contractId}
  88 + </if>
  89 + </where>
  90 + </select>
  91 +</mapper>