|
@@ -83,9 +83,9 @@ public class OnPassageMaterialsController extends BaseController {
|
|
|
//统计物料编码 部门
|
|
|
Map<String, String> materialCountMap = new HashMap<>();
|
|
|
//统计物料编码 计划编制人相同合同数量
|
|
|
- Map<String, String> sameMap = new HashMap<>();
|
|
|
+ Map<String, BigDecimal> sameMap = new HashMap<>();
|
|
|
//统计计划编制人为空合同数量
|
|
|
- Map<String, String> isEmptyMap = new HashMap<>();
|
|
|
+ Map<String, BigDecimal> isEmptyMap = new HashMap<>();
|
|
|
//在途物资表J列
|
|
|
Map<String, BigDecimal> JMap = new HashMap<>();
|
|
|
//项目物资需求表H列
|
|
@@ -164,10 +164,10 @@ public class OnPassageMaterialsController extends BaseController {
|
|
|
//如果有该部门则增加
|
|
|
if(split.length==2){
|
|
|
if (JMap.containsKey(split[1])) {
|
|
|
- BigDecimal temp = new BigDecimal(v).add(JMap.get(split[1]));
|
|
|
+ BigDecimal temp = v.add(JMap.get(split[1]));
|
|
|
JMap.put(split[1], temp);
|
|
|
} else {
|
|
|
- JMap.put(split[1], new BigDecimal(v));
|
|
|
+ JMap.put(split[1], v);
|
|
|
}
|
|
|
}
|
|
|
});
|
|
@@ -178,7 +178,7 @@ public class OnPassageMaterialsController extends BaseController {
|
|
|
|
|
|
HMap.forEach((k, v) -> {
|
|
|
if (JMap.containsKey(k)) {
|
|
|
- if (JMap.get(k).compareTo(v) > 0) {
|
|
|
+ if (JMap.get(k).compareTo(v) >= 0) {
|
|
|
materialInformationList.forEach(m -> {
|
|
|
if (m.getReportingDepartment().equals(k)) {
|
|
|
m.setRemarkText("在途已有" + JMap.get(k) + "单位,请核实本次需求");
|
|
@@ -188,9 +188,7 @@ public class OnPassageMaterialsController extends BaseController {
|
|
|
}
|
|
|
});
|
|
|
|
|
|
- System.out.println(HMap);
|
|
|
- System.out.println("***********************************");
|
|
|
- System.out.println(JMap);
|
|
|
+
|
|
|
|
|
|
/***********************************************/
|
|
|
String fileName = "项目物资需求表" + DateUtils.getDate("yyyyMMddHHmmss") + ".xlsx";
|
|
@@ -210,16 +208,16 @@ public class OnPassageMaterialsController extends BaseController {
|
|
|
return ajaxJson;
|
|
|
}
|
|
|
|
|
|
- private void dataCount(Map<String, String> map, List<OnPassageMaterials> list, String key) {
|
|
|
+ private void dataCount(Map<String, BigDecimal> map, List<OnPassageMaterials> list, String key) {
|
|
|
list.forEach(l -> {
|
|
|
//如果有相同就不加去重
|
|
|
if (map.containsKey(key)) {
|
|
|
- /*BigDecimal temp = new BigDecimal(String.valueOf(map.get(key)));
|
|
|
+ BigDecimal temp = new BigDecimal(String.valueOf(map.get(key)));
|
|
|
temp = new BigDecimal(l.getContractCount()).add(temp);
|
|
|
- map.put(key, temp);*/
|
|
|
+ map.put(key, temp);
|
|
|
|
|
|
} else {
|
|
|
- map.put(key, l.getContractCount());
|
|
|
+ map.put(key, new BigDecimal(l.getContractCount()));
|
|
|
}
|
|
|
});
|
|
|
}
|