作者 lixiang

1、bug修正,导入投中标明细

... ... @@ -315,60 +315,75 @@ public class TblTradePriceInquiryController {
//标段(包)名称 物料编码
//SRM编码 物料长描述 单位 品牌 数量 中标单价 税率(%) 总价(不含税,元) 需求单位 交货时间 合同编号 合同日期
ArrayList<TblTradeBidMaterialDetails> tblTradeBidMaterialDetails = new ArrayList<>();
// ArrayList<TblTradeBidMaterialDetails> tblTradeBidMaterialDetails = new ArrayList<>();
for (int i = 10; i <= sheet.getLastRowNum(); i++) {
Row row = sheet.getRow(i);
if (row == null) continue;
//物料编码
//物料编码
String materialCode = cellTypeToString(row.getCell(2));
materialCode = materialCode.split("\\.")[0];
TblTradeBidSub tblTradeBidSubInfo = subMap.get(materialCode);
TblTradeBidMaterialDetails materialInfo = new TblTradeBidMaterialDetails();
materialInfo.setPackageName(cellTypeToString(row.getCell(1))); //标段(包)名称
materialInfo.setMaterialCode(materialCode);//物料编码
materialInfo.setSrmCode(cellTypeToString(row.getCell(3))); //SRM编码
materialInfo.setMaterialDescription(cellTypeToString(row.getCell(4))); //物料长描述
materialInfo.setMeasurementUnit(cellTypeToString(row.getCell(5))); //单位
materialInfo.setBrand(cellTypeToString(row.getCell(6))); //品牌
String value = cellTypeToString(row.getCell(7)); // 假设值为 "20.000"
value = value.split("\\.")[0]; // 去除小数点及其后面的部分
int intValue = Integer.parseInt(value); // 解析为整数
materialInfo.setDemandQuantity(intValue); //数量
tblTradeBidSubInfo.setPackageName(cellTypeToString(row.getCell(1)));
BigDecimal zbjg = new BigDecimal(cellTypeToString(row.getCell(8)));
materialInfo.setWinningBidPrice(zbjg); // 中标单价
//是否中标
if (StringUtils.isBlank(cellTypeToString(row.getCell(8)))){
materialInfo.setIsBid(2);
}else {
materialInfo.setIsBid(1);
}
materialInfo.setTaxRate(cellTypeToString(row.getCell(9))); // 税率
materialInfo.setBidTotalPrice(new BigDecimal(cellTypeToString(row.getCell(10)))); // 总价(不含税,元)
Cell cell = row.getCell(12);
Date dateCellValue = cell.getDateCellValue();
SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd");
materialInfo.setRequiredDeliveryTime(fmt.format(dateCellValue)); // 交货时间
materialInfo.setDemandUnit(cellTypeToString(row.getCell(11))); // 需求单位
tblTradeBidSubInfo.setZbj(zbjg);
tblTradeBidSubInfo.setSfzb("1");
tblTradeBidSubInfo.setBidDate(bidDate);
//投标价格
if (tblTradeBidSubInfo != null && tblTradeBidSubInfo.getTbjg() != null){
BigDecimal tbjg = new BigDecimal(tblTradeBidSubInfo.getTbjg());
materialInfo.setBidPrice(tbjg);
materialInfo.setDiffPrice(tbjg.subtract(zbjg));
if (tblTradeBidSubInfo.getTbjg() != null){
BigDecimal tbjg = new BigDecimal(tblTradeBidSubInfo.getXydj());
tblTradeBidSubInfo.setDjchay(tbjg.subtract(zbjg));
}
materialInfo.setBidNum(projectNumber);
materialInfo.setBidDate(bidDate);
tblTradeBidMaterialDetails.add(materialInfo);
tblTradeBidSubService.update(
Wrappers.lambdaUpdate(TblTradeBidSub.class)
.eq(TblTradeBidSub::getWlbm, materialCode)
.eq(TblTradeBidSub::getXjbswjh,projectNumber)
.set(TblTradeBidSub::getSfzb,"1")
);
tblTradeBidSubInfo.setBidTotalPrice(new BigDecimal(cellTypeToString(row.getCell(10)))); // 总价(不含税,元)
tblTradeBidSubService.updateById(tblTradeBidSubInfo);
// TblTradeBidMaterialDetails materialInfo = new TblTradeBidMaterialDetails();
// materialInfo.setPackageName(cellTypeToString(row.getCell(1))); //标段(包)名称
// materialInfo.setMaterialCode(materialCode);//物料编码
// materialInfo.setSrmCode(cellTypeToString(row.getCell(3))); //SRM编码
// materialInfo.setMaterialDescription(cellTypeToString(row.getCell(4))); //物料长描述
// materialInfo.setMeasurementUnit(cellTypeToString(row.getCell(5))); //单位
// materialInfo.setBrand(cellTypeToString(row.getCell(6))); //品牌
// String value = cellTypeToString(row.getCell(7)); // 假设值为 "20.000"
// value = value.split("\\.")[0]; // 去除小数点及其后面的部分
// int intValue = Integer.parseInt(value); // 解析为整数
// materialInfo.setDemandQuantity(intValue); //数量
//
//
// materialInfo.setWinningBidPrice(zbjg); // 中标单价
// //是否中标
// if (StringUtils.isBlank(cellTypeToString(row.getCell(8)))){
// materialInfo.setIsBid(2);
// }else {
// materialInfo.setIsBid(1);
// }
// materialInfo.setTaxRate(cellTypeToString(row.getCell(9))); // 税率
// materialInfo.setBidTotalPrice(new BigDecimal(cellTypeToString(row.getCell(10)))); // 总价(不含税,元)
// Cell cell = row.getCell(12);
// Date dateCellValue = cell.getDateCellValue();
// SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd");
// materialInfo.setRequiredDeliveryTime(fmt.format(dateCellValue)); // 交货时间
// materialInfo.setDemandUnit(cellTypeToString(row.getCell(11))); // 需求单位
// //投标价格
// if (tblTradeBidSubInfo != null && tblTradeBidSubInfo.getTbjg() != null){
// BigDecimal tbjg = new BigDecimal(tblTradeBidSubInfo.getTbjg());
// materialInfo.setBidPrice(tbjg);
// materialInfo.setDiffPrice(tbjg.subtract(zbjg));
// }
//
// materialInfo.setBidNum(projectNumber);
// materialInfo.setBidDate(bidDate);
// tblTradeBidMaterialDetails.add(materialInfo);
// tblTradeBidSubService.update(
// Wrappers.lambdaUpdate(TblTradeBidSub.class)
// .eq(TblTradeBidSub::getWlbm, materialCode)
// .eq(TblTradeBidSub::getXjbswjh,projectNumber)
// .set(TblTradeBidSub::getSfzb,"1")
// );
}
tblTradeBidMaterialDetailsService.saveBatch(tblTradeBidMaterialDetails);
// tblTradeBidMaterialDetailsService.saveBatch(tblTradeBidMaterialDetails);
} catch (Exception e) {
log.error(e.getMessage(), e);
... ...
... ... @@ -52,6 +52,11 @@ public class TblTradeBidSub implements Serializable {
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "更新日期")
private java.util.Date updateTime;
/**中标时间*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "中标时间")
private String bidDate;
/**所属部门*/
@ApiModelProperty(value = "所属部门")
private java.lang.String sysOrgCode;
... ... @@ -102,11 +107,15 @@ public class TblTradeBidSub implements Serializable {
/**中标价*/
@Excel(name = "中标价", width = 15)
@ApiModelProperty(value = "中标价")
private java.lang.String zbj;
private BigDecimal zbj;
/**单价差异*/
@Excel(name = "单价差异", width = 15)
@ApiModelProperty(value = "单价差异")
private java.lang.String djchay;
private BigDecimal djchay;
/**单价差异*/
@Excel(name = "总价", width = 15)
@ApiModelProperty(value = "总价")
private BigDecimal bidTotalPrice;
/**税率(%)*/
@Excel(name = "税率(%)", width = 15)
@ApiModelProperty(value = "税率(%)")
... ... @@ -260,6 +269,10 @@ public class TblTradeBidSub implements Serializable {
@Excel(name = "投标状态", width = 15)
@ApiModelProperty(value = "投标状态")
private java.lang.String status;
/**标段(包)名称*/
@Excel(name = "标段(包)名称", width = 15)
@ApiModelProperty(value = "标段(包)名称")
private java.lang.String packageName;
@TableField(exist = false)
... ... @@ -284,4 +297,5 @@ public class TblTradeBidSub implements Serializable {
}
... ...