作者 lixiang

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

@@ -315,60 +315,75 @@ public class TblTradePriceInquiryController { @@ -315,60 +315,75 @@ public class TblTradePriceInquiryController {
315 315
316 //标段(包)名称 物料编码 316 //标段(包)名称 物料编码
317 //SRM编码 物料长描述 单位 品牌 数量 中标单价 税率(%) 总价(不含税,元) 需求单位 交货时间 合同编号 合同日期 317 //SRM编码 物料长描述 单位 品牌 数量 中标单价 税率(%) 总价(不含税,元) 需求单位 交货时间 合同编号 合同日期
318 - ArrayList<TblTradeBidMaterialDetails> tblTradeBidMaterialDetails = new ArrayList<>(); 318 +// ArrayList<TblTradeBidMaterialDetails> tblTradeBidMaterialDetails = new ArrayList<>();
319 for (int i = 10; i <= sheet.getLastRowNum(); i++) { 319 for (int i = 10; i <= sheet.getLastRowNum(); i++) {
320 Row row = sheet.getRow(i); 320 Row row = sheet.getRow(i);
321 if (row == null) continue; 321 if (row == null) continue;
322 - //物料编码 322 +//物料编码
323 String materialCode = cellTypeToString(row.getCell(2)); 323 String materialCode = cellTypeToString(row.getCell(2));
324 materialCode = materialCode.split("\\.")[0]; 324 materialCode = materialCode.split("\\.")[0];
325 TblTradeBidSub tblTradeBidSubInfo = subMap.get(materialCode); 325 TblTradeBidSub tblTradeBidSubInfo = subMap.get(materialCode);
326 -  
327 - TblTradeBidMaterialDetails materialInfo = new TblTradeBidMaterialDetails();  
328 - materialInfo.setPackageName(cellTypeToString(row.getCell(1))); //标段(包)名称  
329 - materialInfo.setMaterialCode(materialCode);//物料编码  
330 - materialInfo.setSrmCode(cellTypeToString(row.getCell(3))); //SRM编码  
331 - materialInfo.setMaterialDescription(cellTypeToString(row.getCell(4))); //物料长描述  
332 - materialInfo.setMeasurementUnit(cellTypeToString(row.getCell(5))); //单位  
333 - materialInfo.setBrand(cellTypeToString(row.getCell(6))); //品牌  
334 - String value = cellTypeToString(row.getCell(7)); // 假设值为 "20.000"  
335 - value = value.split("\\.")[0]; // 去除小数点及其后面的部分  
336 - int intValue = Integer.parseInt(value); // 解析为整数  
337 - materialInfo.setDemandQuantity(intValue); //数量  
338 - 326 + tblTradeBidSubInfo.setPackageName(cellTypeToString(row.getCell(1)));
339 BigDecimal zbjg = new BigDecimal(cellTypeToString(row.getCell(8))); 327 BigDecimal zbjg = new BigDecimal(cellTypeToString(row.getCell(8)));
340 - materialInfo.setWinningBidPrice(zbjg); // 中标单价  
341 - //是否中标  
342 - if (StringUtils.isBlank(cellTypeToString(row.getCell(8)))){  
343 - materialInfo.setIsBid(2);  
344 - }else {  
345 - materialInfo.setIsBid(1);  
346 - }  
347 - materialInfo.setTaxRate(cellTypeToString(row.getCell(9))); // 税率  
348 - materialInfo.setBidTotalPrice(new BigDecimal(cellTypeToString(row.getCell(10)))); // 总价(不含税,元)  
349 - Cell cell = row.getCell(12);  
350 - Date dateCellValue = cell.getDateCellValue();  
351 - SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd");  
352 - materialInfo.setRequiredDeliveryTime(fmt.format(dateCellValue)); // 交货时间  
353 - materialInfo.setDemandUnit(cellTypeToString(row.getCell(11))); // 需求单位 328 + tblTradeBidSubInfo.setZbj(zbjg);
  329 + tblTradeBidSubInfo.setSfzb("1");
  330 + tblTradeBidSubInfo.setBidDate(bidDate);
354 //投标价格 331 //投标价格
355 - if (tblTradeBidSubInfo != null && tblTradeBidSubInfo.getTbjg() != null){  
356 - BigDecimal tbjg = new BigDecimal(tblTradeBidSubInfo.getTbjg());  
357 - materialInfo.setBidPrice(tbjg);  
358 - materialInfo.setDiffPrice(tbjg.subtract(zbjg)); 332 + if (tblTradeBidSubInfo.getTbjg() != null){
  333 + BigDecimal tbjg = new BigDecimal(tblTradeBidSubInfo.getXydj());
  334 + tblTradeBidSubInfo.setDjchay(tbjg.subtract(zbjg));
359 } 335 }
360 336
361 - materialInfo.setBidNum(projectNumber);  
362 - materialInfo.setBidDate(bidDate);  
363 - tblTradeBidMaterialDetails.add(materialInfo);  
364 - tblTradeBidSubService.update(  
365 - Wrappers.lambdaUpdate(TblTradeBidSub.class)  
366 - .eq(TblTradeBidSub::getWlbm, materialCode)  
367 - .eq(TblTradeBidSub::getXjbswjh,projectNumber)  
368 - .set(TblTradeBidSub::getSfzb,"1")  
369 - ); 337 + tblTradeBidSubInfo.setBidTotalPrice(new BigDecimal(cellTypeToString(row.getCell(10)))); // 总价(不含税,元)
  338 + tblTradeBidSubService.updateById(tblTradeBidSubInfo);
  339 +
  340 +
  341 +
  342 +// TblTradeBidMaterialDetails materialInfo = new TblTradeBidMaterialDetails();
  343 +// materialInfo.setPackageName(cellTypeToString(row.getCell(1))); //标段(包)名称
  344 +// materialInfo.setMaterialCode(materialCode);//物料编码
  345 +// materialInfo.setSrmCode(cellTypeToString(row.getCell(3))); //SRM编码
  346 +// materialInfo.setMaterialDescription(cellTypeToString(row.getCell(4))); //物料长描述
  347 +// materialInfo.setMeasurementUnit(cellTypeToString(row.getCell(5))); //单位
  348 +// materialInfo.setBrand(cellTypeToString(row.getCell(6))); //品牌
  349 +// String value = cellTypeToString(row.getCell(7)); // 假设值为 "20.000"
  350 +// value = value.split("\\.")[0]; // 去除小数点及其后面的部分
  351 +// int intValue = Integer.parseInt(value); // 解析为整数
  352 +// materialInfo.setDemandQuantity(intValue); //数量
  353 +//
  354 +//
  355 +// materialInfo.setWinningBidPrice(zbjg); // 中标单价
  356 +// //是否中标
  357 +// if (StringUtils.isBlank(cellTypeToString(row.getCell(8)))){
  358 +// materialInfo.setIsBid(2);
  359 +// }else {
  360 +// materialInfo.setIsBid(1);
  361 +// }
  362 +// materialInfo.setTaxRate(cellTypeToString(row.getCell(9))); // 税率
  363 +// materialInfo.setBidTotalPrice(new BigDecimal(cellTypeToString(row.getCell(10)))); // 总价(不含税,元)
  364 +// Cell cell = row.getCell(12);
  365 +// Date dateCellValue = cell.getDateCellValue();
  366 +// SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd");
  367 +// materialInfo.setRequiredDeliveryTime(fmt.format(dateCellValue)); // 交货时间
  368 +// materialInfo.setDemandUnit(cellTypeToString(row.getCell(11))); // 需求单位
  369 +// //投标价格
  370 +// if (tblTradeBidSubInfo != null && tblTradeBidSubInfo.getTbjg() != null){
  371 +// BigDecimal tbjg = new BigDecimal(tblTradeBidSubInfo.getTbjg());
  372 +// materialInfo.setBidPrice(tbjg);
  373 +// materialInfo.setDiffPrice(tbjg.subtract(zbjg));
  374 +// }
  375 +//
  376 +// materialInfo.setBidNum(projectNumber);
  377 +// materialInfo.setBidDate(bidDate);
  378 +// tblTradeBidMaterialDetails.add(materialInfo);
  379 +// tblTradeBidSubService.update(
  380 +// Wrappers.lambdaUpdate(TblTradeBidSub.class)
  381 +// .eq(TblTradeBidSub::getWlbm, materialCode)
  382 +// .eq(TblTradeBidSub::getXjbswjh,projectNumber)
  383 +// .set(TblTradeBidSub::getSfzb,"1")
  384 +// );
370 } 385 }
371 - tblTradeBidMaterialDetailsService.saveBatch(tblTradeBidMaterialDetails); 386 +// tblTradeBidMaterialDetailsService.saveBatch(tblTradeBidMaterialDetails);
372 387
373 } catch (Exception e) { 388 } catch (Exception e) {
374 log.error(e.getMessage(), e); 389 log.error(e.getMessage(), e);
@@ -52,6 +52,11 @@ public class TblTradeBidSub implements Serializable { @@ -52,6 +52,11 @@ public class TblTradeBidSub implements Serializable {
52 @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") 52 @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
53 @ApiModelProperty(value = "更新日期") 53 @ApiModelProperty(value = "更新日期")
54 private java.util.Date updateTime; 54 private java.util.Date updateTime;
  55 + /**中标时间*/
  56 + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
  57 + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
  58 + @ApiModelProperty(value = "中标时间")
  59 + private String bidDate;
55 /**所属部门*/ 60 /**所属部门*/
56 @ApiModelProperty(value = "所属部门") 61 @ApiModelProperty(value = "所属部门")
57 private java.lang.String sysOrgCode; 62 private java.lang.String sysOrgCode;
@@ -102,11 +107,15 @@ public class TblTradeBidSub implements Serializable { @@ -102,11 +107,15 @@ public class TblTradeBidSub implements Serializable {
102 /**中标价*/ 107 /**中标价*/
103 @Excel(name = "中标价", width = 15) 108 @Excel(name = "中标价", width = 15)
104 @ApiModelProperty(value = "中标价") 109 @ApiModelProperty(value = "中标价")
105 - private java.lang.String zbj; 110 + private BigDecimal zbj;
106 /**单价差异*/ 111 /**单价差异*/
107 @Excel(name = "单价差异", width = 15) 112 @Excel(name = "单价差异", width = 15)
108 @ApiModelProperty(value = "单价差异") 113 @ApiModelProperty(value = "单价差异")
109 - private java.lang.String djchay; 114 + private BigDecimal djchay;
  115 + /**单价差异*/
  116 + @Excel(name = "总价", width = 15)
  117 + @ApiModelProperty(value = "总价")
  118 + private BigDecimal bidTotalPrice;
110 /**税率(%)*/ 119 /**税率(%)*/
111 @Excel(name = "税率(%)", width = 15) 120 @Excel(name = "税率(%)", width = 15)
112 @ApiModelProperty(value = "税率(%)") 121 @ApiModelProperty(value = "税率(%)")
@@ -260,6 +269,10 @@ public class TblTradeBidSub implements Serializable { @@ -260,6 +269,10 @@ public class TblTradeBidSub implements Serializable {
260 @Excel(name = "投标状态", width = 15) 269 @Excel(name = "投标状态", width = 15)
261 @ApiModelProperty(value = "投标状态") 270 @ApiModelProperty(value = "投标状态")
262 private java.lang.String status; 271 private java.lang.String status;
  272 + /**标段(包)名称*/
  273 + @Excel(name = "标段(包)名称", width = 15)
  274 + @ApiModelProperty(value = "标段(包)名称")
  275 + private java.lang.String packageName;
263 276
264 277
265 @TableField(exist = false) 278 @TableField(exist = false)
@@ -284,4 +297,5 @@ public class TblTradeBidSub implements Serializable { @@ -284,4 +297,5 @@ public class TblTradeBidSub implements Serializable {
284 297
285 298
286 299
  300 +
287 } 301 }