|
@@ -3,6 +3,7 @@
|
|
|
*/
|
|
|
package com.jeeplus.modules.sg.balancedlibrary.onPassageMaterials.service;
|
|
|
|
|
|
+import com.jeeplus.common.utils.StringUtils;
|
|
|
import com.jeeplus.core.service.CrudService;
|
|
|
import com.jeeplus.modules.sg.balancedlibrary.onPassageMaterials.entity.MaterialInformation;
|
|
|
import com.jeeplus.modules.sg.balancedlibrary.onPassageMaterials.entity.OnPassageMaterials;
|
|
@@ -51,27 +52,32 @@ public class OnPassageMaterialsService extends CrudService<OnPassageMaterialsMap
|
|
|
|
|
|
//在途物资统计表 去重汇总统计
|
|
|
onPassageMaterialsList.forEach(opm -> {
|
|
|
+ if(StringUtils.isBlank(opm.getContractCount())){
|
|
|
+ opm.setContractCount("0");
|
|
|
+ }
|
|
|
//根据提报人 找到对应部门
|
|
|
String reportPersonOfDepartment = reportPersonMap.get(opm.getPlanner());
|
|
|
//如果没有部门 表示空部门 物料编码-部门
|
|
|
String key = opm.getMaterialCode() + "-" + (reportPersonOfDepartment==null?"":reportPersonOfDepartment);
|
|
|
- System.out.println("----------->" + key);
|
|
|
if (onPassageMaterialsMap.containsKey(key)) {
|
|
|
onPassageMaterialsMap.put(key, new BigDecimal(opm.getContractCount()).add(onPassageMaterialsMap.get(key)));
|
|
|
} else {
|
|
|
- if(!opm.getMaterialCode().isEmpty()&& !opm.getContractCount().isEmpty())
|
|
|
+ if(!opm.getMaterialCode().isEmpty())
|
|
|
onPassageMaterialsMap.put(key, new BigDecimal(opm.getContractCount()));
|
|
|
}
|
|
|
});
|
|
|
|
|
|
//项目物资需求表 去重汇总统计
|
|
|
materialInformationList.forEach(m -> {
|
|
|
+ if(StringUtils.isBlank(m.getTotal())){
|
|
|
+ m.setTotal("0");
|
|
|
+ }
|
|
|
//物料编码-部门
|
|
|
String key = m.getMaterialCode() + "-" + m.getReportingDepartment();
|
|
|
if (materialInformationMap.containsKey(key)) {
|
|
|
materialInformationMap.put(key, new BigDecimal(m.getTotal()).add(materialInformationMap.get(key)));
|
|
|
} else {
|
|
|
- if(!m.getMaterialCode().isEmpty()&&!m.getTotal().isEmpty())
|
|
|
+ if(!m.getMaterialCode().isEmpty())
|
|
|
materialInformationMap.put(key, new BigDecimal(m.getTotal()));
|
|
|
|
|
|
}
|