作者 Win10-2023FDZSZ\Administrator

询价记录字段调整,导入招标信息的时候同步新增物料信息

@@ -52,6 +52,10 @@ public class TblTradeInquiryInfo implements Serializable { @@ -52,6 +52,10 @@ public class TblTradeInquiryInfo implements Serializable {
52 @Excel(name = "供货商名称", width = 15) 52 @Excel(name = "供货商名称", width = 15)
53 @ApiModelProperty(value = "供货商名称") 53 @ApiModelProperty(value = "供货商名称")
54 private java.lang.String ghsmc; 54 private java.lang.String ghsmc;
  55 + /**联系人*/
  56 + @Excel(name = "联系人", width = 15)
  57 + @ApiModelProperty(value = "联系人")
  58 + private java.lang.String lxr;
55 /**电话*/ 59 /**电话*/
56 @Excel(name = "电话", width = 15) 60 @Excel(name = "电话", width = 15)
57 @ApiModelProperty(value = "电话") 61 @ApiModelProperty(value = "电话")
@@ -64,22 +68,46 @@ public class TblTradeInquiryInfo implements Serializable { @@ -64,22 +68,46 @@ public class TblTradeInquiryInfo implements Serializable {
64 @Excel(name = "微信号", width = 15) 68 @Excel(name = "微信号", width = 15)
65 @ApiModelProperty(value = "微信号") 69 @ApiModelProperty(value = "微信号")
66 private java.lang.String wxh; 70 private java.lang.String wxh;
67 - /**单价(元)*/  
68 - @Excel(name = "单价(元)", width = 15)  
69 - @ApiModelProperty(value = "单价(元)")  
70 - private java.lang.String dj;  
71 - /**总价(元)*/  
72 - @Excel(name = "总价(元)", width = 15)  
73 - @ApiModelProperty(value = "总价(元)")  
74 - private java.lang.String zj;  
75 - /**票据*/  
76 - @Excel(name = "票据", width = 15)  
77 - @ApiModelProperty(value = "票据")  
78 - private java.lang.String piaoju;  
79 - /**票据税额比例*/  
80 - @Excel(name = "票据税额比例", width = 15)  
81 - @ApiModelProperty(value = "票据税额比例")  
82 - private java.lang.String pjsebl; 71 + /**网店地址*/
  72 + @Excel(name = "网店地址", width = 15)
  73 + @ApiModelProperty(value = "网店地址")
  74 + private java.lang.String wddz;
  75 + /**开户行名称*/
  76 + @ApiModelProperty(value = "开户行名称")
  77 + private java.lang.String khhmc;
  78 + /**银行账号*/
  79 + @ApiModelProperty(value = "银行账号")
  80 + private java.lang.String yhzh;
  81 + /**行号*/
  82 + @ApiModelProperty(value = "行号")
  83 + private java.lang.String hh;
  84 + /**专票单价*/
  85 + @ApiModelProperty(value = "专票单价)")
  86 + private java.lang.String zpdj;
  87 + /**专票税率(%)*/
  88 + @ApiModelProperty(value = "专票税率(%)")
  89 + private java.lang.String zpsl;
  90 + /**普票单价*/
  91 + @ApiModelProperty(value = "普票单价")
  92 + private java.lang.String ppdj;
  93 + /**普票税率(%)*/
  94 + @ApiModelProperty(value = "普票税率(%)")
  95 + private java.lang.String ppsl;
  96 + /**无票单价*/
  97 + @ApiModelProperty(value = "无票单价")
  98 + private java.lang.String wpdj;
  99 + /**单价是否含运费*/
  100 + @Excel(name = "是否含运费", width = 15)
  101 + @ApiModelProperty(value = "是否含运费")
  102 + private java.lang.String sfhyf;
  103 + /**含运费单价*/
  104 + @Excel(name = "运费", width = 15)
  105 + @ApiModelProperty(value = "运费")
  106 + private java.lang.String yf;
  107 + /**发货地址*/
  108 + @Excel(name = "发货地址", width = 15)
  109 + @ApiModelProperty(value = "发货地址")
  110 + private java.lang.String fhdz;
83 /**最小出货量*/ 111 /**最小出货量*/
84 @Excel(name = "最小出货量", width = 15) 112 @Excel(name = "最小出货量", width = 15)
85 @ApiModelProperty(value = "最小出货量") 113 @ApiModelProperty(value = "最小出货量")
@@ -88,30 +116,10 @@ public class TblTradeInquiryInfo implements Serializable { @@ -88,30 +116,10 @@ public class TblTradeInquiryInfo implements Serializable {
88 @Excel(name = "L/T(交货周期天)", width = 15) 116 @Excel(name = "L/T(交货周期天)", width = 15)
89 @ApiModelProperty(value = "L/T(交货周期天)") 117 @ApiModelProperty(value = "L/T(交货周期天)")
90 private java.lang.String jhzqt; 118 private java.lang.String jhzqt;
91 - /**发货地址*/  
92 - @Excel(name = "发货地址", width = 15)  
93 - @ApiModelProperty(value = "发货地址")  
94 - private java.lang.String fhdz;  
95 - /**单价是否含运费*/  
96 - @Excel(name = "单价是否含运费", width = 15)  
97 - @ApiModelProperty(value = "单价是否含运费")  
98 - private java.lang.String djsfhyf;  
99 - /**含运费单价*/  
100 - @Excel(name = "含运费单价", width = 15)  
101 - @ApiModelProperty(value = "含运费单价")  
102 - private java.lang.String hyfdj;  
103 /**价格评价*/ 119 /**价格评价*/
104 @Excel(name = "价格评价", width = 15) 120 @Excel(name = "价格评价", width = 15)
105 @ApiModelProperty(value = "价格评价") 121 @ApiModelProperty(value = "价格评价")
106 private java.lang.String jgpj; 122 private java.lang.String jgpj;
107 - /**含税价格(元)*/  
108 - @Excel(name = "含税价格(元)", width = 15)  
109 - @ApiModelProperty(value = "含税价格(元)")  
110 - private java.lang.String hsjg;  
111 - /**不含税价格(元)*/  
112 - @Excel(name = "不含税价格(元)", width = 15)  
113 - @ApiModelProperty(value = "不含税价格(元)")  
114 - private java.lang.String bhsjg;  
115 /**是否需要重新询价*/ 123 /**是否需要重新询价*/
116 @Excel(name = "是否需要重新询价", width = 15, dicCode = "is_open") 124 @Excel(name = "是否需要重新询价", width = 15, dicCode = "is_open")
117 @ApiModelProperty(value = "是否需要重新询价") 125 @ApiModelProperty(value = "是否需要重新询价")
@@ -123,4 +131,7 @@ public class TblTradeInquiryInfo implements Serializable { @@ -123,4 +131,7 @@ public class TblTradeInquiryInfo implements Serializable {
123 /**关联招标id*/ 131 /**关联招标id*/
124 @ApiModelProperty(value = "关联招标id") 132 @ApiModelProperty(value = "关联招标id")
125 private java.lang.String tradeId; 133 private java.lang.String tradeId;
  134 + /**物料编码*/
  135 + @ApiModelProperty(value = "物料编码")
  136 + private java.lang.String wlbm;
126 } 137 }
@@ -4,6 +4,8 @@ import java.io.Serializable; @@ -4,6 +4,8 @@ import java.io.Serializable;
4 import java.io.UnsupportedEncodingException; 4 import java.io.UnsupportedEncodingException;
5 import java.util.Date; 5 import java.util.Date;
6 import java.math.BigDecimal; 6 import java.math.BigDecimal;
  7 +import java.util.Objects;
  8 +
7 import com.baomidou.mybatisplus.annotation.IdType; 9 import com.baomidou.mybatisplus.annotation.IdType;
8 import com.baomidou.mybatisplus.annotation.TableField; 10 import com.baomidou.mybatisplus.annotation.TableField;
9 import com.baomidou.mybatisplus.annotation.TableId; 11 import com.baomidou.mybatisplus.annotation.TableId;
@@ -138,4 +140,18 @@ public class TblTradeMeterial implements Serializable { @@ -138,4 +140,18 @@ public class TblTradeMeterial implements Serializable {
138 @ApiModelProperty(value = "在库天数") 140 @ApiModelProperty(value = "在库天数")
139 @TableField(exist = false) 141 @TableField(exist = false)
140 private Integer daysInStock; 142 private Integer daysInStock;
  143 +
  144 +
  145 + @Override
  146 + public boolean equals(Object o) {
  147 + if (this == o) return true;
  148 + if (o == null || getClass() != o.getClass()) return false;
  149 + TblTradeMeterial that = (TblTradeMeterial) o;
  150 + return Objects.equals(meterialCode, that.meterialCode);
  151 + }
  152 +
  153 + @Override
  154 + public int hashCode() {
  155 + return Objects.hash(meterialCode);
  156 + }
141 } 157 }
@@ -104,6 +104,9 @@ public class TblTradePriceInquiry implements Serializable { @@ -104,6 +104,9 @@ public class TblTradePriceInquiry implements Serializable {
104 @Excel(name = "投标时间", width = 15) 104 @Excel(name = "投标时间", width = 15)
105 @ApiModelProperty(value = "负责人") 105 @ApiModelProperty(value = "负责人")
106 private java.lang.String tbsj; 106 private java.lang.String tbsj;
107 - 107 + /**标的类型*/
  108 + @Excel(name = "标的类型", width = 15)
  109 + @ApiModelProperty(value = "标的类型")
  110 + private java.lang.String bdlx;
108 111
109 } 112 }
@@ -45,17 +45,6 @@ public class TblTradeBidSubServiceImpl extends ServiceImpl<TblTradeBidSubMapper, @@ -45,17 +45,6 @@ public class TblTradeBidSubServiceImpl extends ServiceImpl<TblTradeBidSubMapper,
45 public void updateMain(TblTradeBidSub tblTradeBidSub,List<TblTradeInquiryInfo> tblTradeInquiryInfoList) { 45 public void updateMain(TblTradeBidSub tblTradeBidSub,List<TblTradeInquiryInfo> tblTradeInquiryInfoList) {
46 tblTradeBidSubMapper.updateById(tblTradeBidSub); 46 tblTradeBidSubMapper.updateById(tblTradeBidSub);
47 47
48 - //1.先删除子表数据  
49 - tblTradeInquiryInfoMapper.deleteByMainId(tblTradeBidSub.getId());  
50 -  
51 - //2.子表数据重新插入  
52 - if(tblTradeInquiryInfoList!=null && tblTradeInquiryInfoList.size()>0) {  
53 - for(TblTradeInquiryInfo entity:tblTradeInquiryInfoList) {  
54 - //外键设置  
55 - entity.setTradeId(tblTradeBidSub.getId());  
56 - tblTradeInquiryInfoMapper.insert(entity);  
57 - }  
58 - }  
59 } 48 }
60 49
61 @Override 50 @Override
1 package org.jeecg.modules.erp.trade.service.impl; 1 package org.jeecg.modules.erp.trade.service.impl;
2 2
  3 +import cn.hutool.core.collection.CollUtil;
  4 +import cn.hutool.core.collection.ListUtil;
3 import cn.hutool.core.date.DatePattern; 5 import cn.hutool.core.date.DatePattern;
4 import cn.hutool.core.date.DateUtil; 6 import cn.hutool.core.date.DateUtil;
5 -import org.jeecg.modules.erp.trade.entity.TblTradeBidSub;  
6 -import org.jeecg.modules.erp.trade.entity.TblTradeInquiryInfo;  
7 -import org.jeecg.modules.erp.trade.entity.TblTradePriceInquiry;  
8 -import org.jeecg.modules.erp.trade.entity.TblTradeTenderInfo;  
9 -import org.jeecg.modules.erp.trade.mapper.TblTradeBidSubMapper;  
10 -import org.jeecg.modules.erp.trade.mapper.TblTradeInquiryInfoMapper;  
11 -import org.jeecg.modules.erp.trade.mapper.TblTradePriceInquiryMapper;  
12 -import org.jeecg.modules.erp.trade.mapper.TblTradeTenderInfoMapper; 7 +import cn.hutool.core.util.ObjectUtil;
  8 +import cn.hutool.core.util.StrUtil;
  9 +import org.jeecg.modules.erp.trade.entity.*;
  10 +import org.jeecg.modules.erp.trade.mapper.*;
13 import org.jeecg.modules.erp.trade.service.ITblTradeBidSubService; 11 import org.jeecg.modules.erp.trade.service.ITblTradeBidSubService;
  12 +import org.jeecg.modules.erp.trade.service.ITblTradeMeterialService;
14 import org.jeecg.modules.erp.trade.service.ITblTradeTenderInfoService; 13 import org.jeecg.modules.erp.trade.service.ITblTradeTenderInfoService;
15 import org.springframework.stereotype.Service; 14 import org.springframework.stereotype.Service;
16 15
@@ -45,6 +44,8 @@ public class TblTradeTenderInfoServiceImpl extends ServiceImpl<TblTradeTenderInf @@ -45,6 +44,8 @@ public class TblTradeTenderInfoServiceImpl extends ServiceImpl<TblTradeTenderInf
45 private ITblTradeBidSubService tblTradeBidSubService; 44 private ITblTradeBidSubService tblTradeBidSubService;
46 @Autowired 45 @Autowired
47 private TblTradePriceInquiryMapper tblTradePriceInquiryMapper; 46 private TblTradePriceInquiryMapper tblTradePriceInquiryMapper;
  47 + @Autowired
  48 + private ITblTradeMeterialService tblTradeMeterialService;
48 49
49 @Override 50 @Override
50 public List<TblTradeTenderInfo> selectByMainId(String mainId) { 51 public List<TblTradeTenderInfo> selectByMainId(String mainId) {
@@ -88,6 +89,7 @@ public class TblTradeTenderInfoServiceImpl extends ServiceImpl<TblTradeTenderInf @@ -88,6 +89,7 @@ public class TblTradeTenderInfoServiceImpl extends ServiceImpl<TblTradeTenderInf
88 priceInquiry.setXjwcrq(list.get(0).getXjjhwcsj()); 89 priceInquiry.setXjwcrq(list.get(0).getXjjhwcsj());
89 priceInquiry.setXmlx(list.get(0).getXmlx()); 90 priceInquiry.setXmlx(list.get(0).getXmlx());
90 priceInquiry.setShdz(list.get(0).getShdz()); 91 priceInquiry.setShdz(list.get(0).getShdz());
  92 + priceInquiry.setBdlx(list.get(0).getBdlx());
91 priceInquiry.setXdzt("未完成"); 93 priceInquiry.setXdzt("未完成");
92 tblTradePriceInquiryMapper.insert(priceInquiry); 94 tblTradePriceInquiryMapper.insert(priceInquiry);
93 95
@@ -95,6 +97,9 @@ public class TblTradeTenderInfoServiceImpl extends ServiceImpl<TblTradeTenderInf @@ -95,6 +97,9 @@ public class TblTradeTenderInfoServiceImpl extends ServiceImpl<TblTradeTenderInf
95 // 保存sub表 97 // 保存sub表
96 tblTradeBidSubMapper.deleteByMap(map); 98 tblTradeBidSubMapper.deleteByMap(map);
97 List<TblTradeBidSub> bidSubList = new ArrayList<>(); 99 List<TblTradeBidSub> bidSubList = new ArrayList<>();
  100 + // 20250313新增,导入的时候自动保存物料信息,已有的物料跳过,只入库新的物料
  101 + List<TblTradeMeterial> meterialList = tblTradeMeterialService.list(null);
  102 + List<TblTradeMeterial> meterialInsertList = new ArrayList<>();
98 list.forEach(e->{ 103 list.forEach(e->{
99 TblTradeBidSub bidSub = new TblTradeBidSub(); 104 TblTradeBidSub bidSub = new TblTradeBidSub();
100 bidSub.setTradeId(e.getId()); 105 bidSub.setTradeId(e.getId());
@@ -102,9 +107,25 @@ public class TblTradeTenderInfoServiceImpl extends ServiceImpl<TblTradeTenderInf @@ -102,9 +107,25 @@ public class TblTradeTenderInfoServiceImpl extends ServiceImpl<TblTradeTenderInf
102 bidSub.setWlbm(e.getCode()); 107 bidSub.setWlbm(e.getCode());
103 bidSub.setMiaoshu(e.getMiaoshu()); 108 bidSub.setMiaoshu(e.getMiaoshu());
104 bidSubList.add(bidSub); 109 bidSubList.add(bidSub);
  110 + // 排除掉库里已有的物料
  111 + TblTradeMeterial tradeMeterial = meterialList.stream().filter(i -> StrUtil.equals(i.getMeterialCode(), e.getCode()))
  112 + .findFirst().orElse(null);
  113 + if (ObjectUtil.isNotNull(tradeMeterial)) return;
  114 + TblTradeMeterial insertObj = new TblTradeMeterial();
  115 + insertObj.setMeterialCode(e.getCode());
  116 + insertObj.setMeterialReview(e.getMiaoshu());
  117 + insertObj.setUnit(e.getJldw());
  118 + insertObj.setBrand(e.getPinpai());
  119 + meterialInsertList.add(insertObj);
105 }); 120 });
106 tblTradeBidSubService.saveBatch(bidSubList); 121 tblTradeBidSubService.saveBatch(bidSubList);
107 122
  123 + // 保存物料信息
  124 + if (CollUtil.isNotEmpty(meterialInsertList)){
  125 + // 去重入库
  126 + tblTradeMeterialService.saveBatch(CollUtil.distinct(meterialInsertList));
  127 + }
  128 +
108 } 129 }
109 130
110 131