作者 Win10-2023FDZSZ\Administrator

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

... ... @@ -52,6 +52,10 @@ public class TblTradeInquiryInfo implements Serializable {
@Excel(name = "供货商名称", width = 15)
@ApiModelProperty(value = "供货商名称")
private java.lang.String ghsmc;
/**联系人*/
@Excel(name = "联系人", width = 15)
@ApiModelProperty(value = "联系人")
private java.lang.String lxr;
/**电话*/
@Excel(name = "电话", width = 15)
@ApiModelProperty(value = "电话")
... ... @@ -64,22 +68,46 @@ public class TblTradeInquiryInfo implements Serializable {
@Excel(name = "微信号", width = 15)
@ApiModelProperty(value = "微信号")
private java.lang.String wxh;
/**单价(元)*/
@Excel(name = "单价(元)", width = 15)
@ApiModelProperty(value = "单价(元)")
private java.lang.String dj;
/**总价(元)*/
@Excel(name = "总价(元)", width = 15)
@ApiModelProperty(value = "总价(元)")
private java.lang.String zj;
/**票据*/
@Excel(name = "票据", width = 15)
@ApiModelProperty(value = "票据")
private java.lang.String piaoju;
/**票据税额比例*/
@Excel(name = "票据税额比例", width = 15)
@ApiModelProperty(value = "票据税额比例")
private java.lang.String pjsebl;
/**网店地址*/
@Excel(name = "网店地址", width = 15)
@ApiModelProperty(value = "网店地址")
private java.lang.String wddz;
/**开户行名称*/
@ApiModelProperty(value = "开户行名称")
private java.lang.String khhmc;
/**银行账号*/
@ApiModelProperty(value = "银行账号")
private java.lang.String yhzh;
/**行号*/
@ApiModelProperty(value = "行号")
private java.lang.String hh;
/**专票单价*/
@ApiModelProperty(value = "专票单价)")
private java.lang.String zpdj;
/**专票税率(%)*/
@ApiModelProperty(value = "专票税率(%)")
private java.lang.String zpsl;
/**普票单价*/
@ApiModelProperty(value = "普票单价")
private java.lang.String ppdj;
/**普票税率(%)*/
@ApiModelProperty(value = "普票税率(%)")
private java.lang.String ppsl;
/**无票单价*/
@ApiModelProperty(value = "无票单价")
private java.lang.String wpdj;
/**单价是否含运费*/
@Excel(name = "是否含运费", width = 15)
@ApiModelProperty(value = "是否含运费")
private java.lang.String sfhyf;
/**含运费单价*/
@Excel(name = "运费", width = 15)
@ApiModelProperty(value = "运费")
private java.lang.String yf;
/**发货地址*/
@Excel(name = "发货地址", width = 15)
@ApiModelProperty(value = "发货地址")
private java.lang.String fhdz;
/**最小出货量*/
@Excel(name = "最小出货量", width = 15)
@ApiModelProperty(value = "最小出货量")
... ... @@ -88,30 +116,10 @@ public class TblTradeInquiryInfo implements Serializable {
@Excel(name = "L/T(交货周期天)", width = 15)
@ApiModelProperty(value = "L/T(交货周期天)")
private java.lang.String jhzqt;
/**发货地址*/
@Excel(name = "发货地址", width = 15)
@ApiModelProperty(value = "发货地址")
private java.lang.String fhdz;
/**单价是否含运费*/
@Excel(name = "单价是否含运费", width = 15)
@ApiModelProperty(value = "单价是否含运费")
private java.lang.String djsfhyf;
/**含运费单价*/
@Excel(name = "含运费单价", width = 15)
@ApiModelProperty(value = "含运费单价")
private java.lang.String hyfdj;
/**价格评价*/
@Excel(name = "价格评价", width = 15)
@ApiModelProperty(value = "价格评价")
private java.lang.String jgpj;
/**含税价格(元)*/
@Excel(name = "含税价格(元)", width = 15)
@ApiModelProperty(value = "含税价格(元)")
private java.lang.String hsjg;
/**不含税价格(元)*/
@Excel(name = "不含税价格(元)", width = 15)
@ApiModelProperty(value = "不含税价格(元)")
private java.lang.String bhsjg;
/**是否需要重新询价*/
@Excel(name = "是否需要重新询价", width = 15, dicCode = "is_open")
@ApiModelProperty(value = "是否需要重新询价")
... ... @@ -123,4 +131,7 @@ public class TblTradeInquiryInfo implements Serializable {
/**关联招标id*/
@ApiModelProperty(value = "关联招标id")
private java.lang.String tradeId;
/**物料编码*/
@ApiModelProperty(value = "物料编码")
private java.lang.String wlbm;
}
... ...
... ... @@ -4,6 +4,8 @@ import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;
import java.util.Objects;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
... ... @@ -138,4 +140,18 @@ public class TblTradeMeterial implements Serializable {
@ApiModelProperty(value = "在库天数")
@TableField(exist = false)
private Integer daysInStock;
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
TblTradeMeterial that = (TblTradeMeterial) o;
return Objects.equals(meterialCode, that.meterialCode);
}
@Override
public int hashCode() {
return Objects.hash(meterialCode);
}
}
... ...
... ... @@ -104,6 +104,9 @@ public class TblTradePriceInquiry implements Serializable {
@Excel(name = "投标时间", width = 15)
@ApiModelProperty(value = "负责人")
private java.lang.String tbsj;
/**标的类型*/
@Excel(name = "标的类型", width = 15)
@ApiModelProperty(value = "标的类型")
private java.lang.String bdlx;
}
... ...
... ... @@ -45,17 +45,6 @@ public class TblTradeBidSubServiceImpl extends ServiceImpl<TblTradeBidSubMapper,
public void updateMain(TblTradeBidSub tblTradeBidSub,List<TblTradeInquiryInfo> tblTradeInquiryInfoList) {
tblTradeBidSubMapper.updateById(tblTradeBidSub);
//1.先删除子表数据
tblTradeInquiryInfoMapper.deleteByMainId(tblTradeBidSub.getId());
//2.子表数据重新插入
if(tblTradeInquiryInfoList!=null && tblTradeInquiryInfoList.size()>0) {
for(TblTradeInquiryInfo entity:tblTradeInquiryInfoList) {
//外键设置
entity.setTradeId(tblTradeBidSub.getId());
tblTradeInquiryInfoMapper.insert(entity);
}
}
}
@Override
... ...
package org.jeecg.modules.erp.trade.service.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.ListUtil;
import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateUtil;
import org.jeecg.modules.erp.trade.entity.TblTradeBidSub;
import org.jeecg.modules.erp.trade.entity.TblTradeInquiryInfo;
import org.jeecg.modules.erp.trade.entity.TblTradePriceInquiry;
import org.jeecg.modules.erp.trade.entity.TblTradeTenderInfo;
import org.jeecg.modules.erp.trade.mapper.TblTradeBidSubMapper;
import org.jeecg.modules.erp.trade.mapper.TblTradeInquiryInfoMapper;
import org.jeecg.modules.erp.trade.mapper.TblTradePriceInquiryMapper;
import org.jeecg.modules.erp.trade.mapper.TblTradeTenderInfoMapper;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import org.jeecg.modules.erp.trade.entity.*;
import org.jeecg.modules.erp.trade.mapper.*;
import org.jeecg.modules.erp.trade.service.ITblTradeBidSubService;
import org.jeecg.modules.erp.trade.service.ITblTradeMeterialService;
import org.jeecg.modules.erp.trade.service.ITblTradeTenderInfoService;
import org.springframework.stereotype.Service;
... ... @@ -45,6 +44,8 @@ public class TblTradeTenderInfoServiceImpl extends ServiceImpl<TblTradeTenderInf
private ITblTradeBidSubService tblTradeBidSubService;
@Autowired
private TblTradePriceInquiryMapper tblTradePriceInquiryMapper;
@Autowired
private ITblTradeMeterialService tblTradeMeterialService;
@Override
public List<TblTradeTenderInfo> selectByMainId(String mainId) {
... ... @@ -88,6 +89,7 @@ public class TblTradeTenderInfoServiceImpl extends ServiceImpl<TblTradeTenderInf
priceInquiry.setXjwcrq(list.get(0).getXjjhwcsj());
priceInquiry.setXmlx(list.get(0).getXmlx());
priceInquiry.setShdz(list.get(0).getShdz());
priceInquiry.setBdlx(list.get(0).getBdlx());
priceInquiry.setXdzt("未完成");
tblTradePriceInquiryMapper.insert(priceInquiry);
... ... @@ -95,6 +97,9 @@ public class TblTradeTenderInfoServiceImpl extends ServiceImpl<TblTradeTenderInf
// 保存sub表
tblTradeBidSubMapper.deleteByMap(map);
List<TblTradeBidSub> bidSubList = new ArrayList<>();
// 20250313新增,导入的时候自动保存物料信息,已有的物料跳过,只入库新的物料
List<TblTradeMeterial> meterialList = tblTradeMeterialService.list(null);
List<TblTradeMeterial> meterialInsertList = new ArrayList<>();
list.forEach(e->{
TblTradeBidSub bidSub = new TblTradeBidSub();
bidSub.setTradeId(e.getId());
... ... @@ -102,9 +107,25 @@ public class TblTradeTenderInfoServiceImpl extends ServiceImpl<TblTradeTenderInf
bidSub.setWlbm(e.getCode());
bidSub.setMiaoshu(e.getMiaoshu());
bidSubList.add(bidSub);
// 排除掉库里已有的物料
TblTradeMeterial tradeMeterial = meterialList.stream().filter(i -> StrUtil.equals(i.getMeterialCode(), e.getCode()))
.findFirst().orElse(null);
if (ObjectUtil.isNotNull(tradeMeterial)) return;
TblTradeMeterial insertObj = new TblTradeMeterial();
insertObj.setMeterialCode(e.getCode());
insertObj.setMeterialReview(e.getMiaoshu());
insertObj.setUnit(e.getJldw());
insertObj.setBrand(e.getPinpai());
meterialInsertList.add(insertObj);
});
tblTradeBidSubService.saveBatch(bidSubList);
// 保存物料信息
if (CollUtil.isNotEmpty(meterialInsertList)){
// 去重入库
tblTradeMeterialService.saveBatch(CollUtil.distinct(meterialInsertList));
}
}
... ...