chengqiang 2 年 前
コミット
2a6cabe8b2

+ 20 - 2
src/main/java/com/jeeplus/modules/sg/balancedlibrary/materialReportDetails/utils/ExcelUtil.java

@@ -29,6 +29,7 @@ import java.io.*;
 import java.lang.reflect.Field;
 import java.lang.reflect.Method;
 import java.net.URLEncoder;
+import java.text.DecimalFormat;
 import java.text.NumberFormat;
 import java.text.SimpleDateFormat;
 import java.util.*;
@@ -40,6 +41,8 @@ public class ExcelUtil {
 
 	private static Logger log = LoggerFactory.getLogger(ExcelUtil.class);
 
+	DecimalFormat decimalFormat = new DecimalFormat("###################.###########");
+
 	/**
 	 * 工作薄对象
 	 */
@@ -456,7 +459,7 @@ public class ExcelUtil {
 	 * @param quotaList
 	 */
 	public void dealVerify(List<StandardMaterials> standardList, List<String> preferredCodes,
-						   List<MaterialQuota> quotaList){
+						   List<MaterialQuota> quotaList) throws Exception {
 		Map<String,StandardMaterials> standardMap = new HashMap<>();
 		for(StandardMaterials standard:standardList){
 			standardMap.put(standard.getMaterialCode(),standard);
@@ -480,7 +483,7 @@ public class ExcelUtil {
 		//处理数据行
 		for(int i=2;i<=sheet.getLastRowNum();i++){
 			Row row = sheet.getRow(i);
-			String materialCode = row.getCell(2).getStringCellValue();
+			String materialCode = getStringValue(row.getCell(2));
 			if(materialCode!=null&&!materialCode.isEmpty()){
 				Cell standardCell = row.createCell(14);
 				standardCell.setCellValue(standardMap.get(materialCode).getPurchaseStandardId());
@@ -506,6 +509,21 @@ public class ExcelUtil {
 		}
 	}
 
+	public String getStringValue(Cell cell) throws Exception {
+		if(cell !=null){
+			if (cell.getCellType() == Cell.CELL_TYPE_NUMERIC) {
+				return  decimalFormat.format(cell.getNumericCellValue());
+			}else if(cell.getCellType() == Cell.CELL_TYPE_STRING){
+				return cell.getStringCellValue();
+			}else{
+				throw new Exception("物料编码格式错误!");
+			}
+		}else{
+			throw new Exception("物料编码格式错误!");
+		}
+
+	}
+
 	/**
 	 * 将处理好的excel表保存到服务器上
 	 * @param sessionId

+ 68 - 43
src/main/java/com/jeeplus/modules/sg/balancedlibrary/onPassageMaterials/service/OnPassageMaterialsService.java

@@ -45,6 +45,7 @@ public class OnPassageMaterialsService extends CrudService<OnPassageMaterialsMap
 
         //在途物资统计表与项目物资需求表比较  在途物资统计表J列>=项目物资需求表H列 标识
         List<String> flagList = new ArrayList<>();
+        Set<String> flagSet = new HashSet<>();
         /**************************************************************************/
 
 
@@ -53,57 +54,81 @@ 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 = "";
-            if (reportPersonOfDepartment == null) {
-                key = opm.getMaterialCode() + "-";
-            } else {
-                key = opm.getMaterialCode() + "-" + reportPersonOfDepartment;
-            }
-            if (onPassageMaterialsMap.containsKey(key)) {
-                onPassageMaterialsMap.put(key, new BigDecimal(opm.getContractCount()).add(onPassageMaterialsMap.get(key)));
-            } else {
-                if (StringUtils.isNotBlank(opm.getMaterialCode())) {
-                    onPassageMaterialsMap.put(key, new BigDecimal(opm.getContractCount()));
+            if (StringUtils.isNotBlank(opm.getContractCount())&& !"0".equalsIgnoreCase(opm.getContractCount())) {
+
+                //根据提报人 找到对应部门
+                String planner = opm.getPlanner();
+
+                String factory = opm.getFactory();
+                if("01L1".equalsIgnoreCase(factory)){
+                    planner = "丹阳";
+                }else if("01L2".equalsIgnoreCase(factory)){
+                    planner = "句容";
+                }else if("01L3".equalsIgnoreCase(factory)){
+                    planner = "扬中";
                 }
-            }
-        });
-
-        //项目物资需求表 去重汇总统计
-        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 (StringUtils.isNotBlank(m.getMaterialCode())) {
-                    materialInformationMap.put(key, new BigDecimal(m.getTotal()));
+                String reportPersonOfDepartment = reportPersonMap.get(planner);
+                //如果没有部门 表示空部门 物料编码-部门
+                String key = "";
+                if (reportPersonOfDepartment == null) {
+                    key = opm.getMaterialCode() + "-";
+                } else {
+                    key = opm.getMaterialCode() + "-" + reportPersonOfDepartment;
                 }
-            }
-        });
-
-        //两表比较 添加标识
-        materialInformationMap.forEach((k, v) -> {
-            if (onPassageMaterialsMap.containsKey(k)) {
-                if (onPassageMaterialsMap.get(k).compareTo(v) >= 0) {
-                    flagList.add(k);
+                if (onPassageMaterialsMap.containsKey(key)) {
+                    onPassageMaterialsMap.put(key, new BigDecimal(opm.getContractCount()).add(onPassageMaterialsMap.get(key)));
+                } else {
+                    if (StringUtils.isNotBlank(opm.getMaterialCode())) {
+                        onPassageMaterialsMap.put(key, new BigDecimal(opm.getContractCount()));
+                    }
                 }
+                flagSet.add(key);
             }
+
         });
 
+//        //项目物资需求表 去重汇总统计
+//        materialInformationList.forEach(m -> {
+//            if (StringUtils.isBlank(m.getTotal())) {
+//                m.setTotal("0");
+//            }
+//            String depart = m.getReportingDepartment();
+//            String person = m.getPlanner();
+//            if(StringUtils.isBlank(depart)){
+//                depart = reportPersonMap.get(person);
+//                m.setReportingDepartment(depart);
+//            }
+//            //物料编码-部门
+//            String key = m.getMaterialCode() + "-" + depart;
+//            if (materialInformationMap.containsKey(key)) {
+//                materialInformationMap.put(key, new BigDecimal(m.getTotal()).add(materialInformationMap.get(key)));
+//            } else {
+//                if (StringUtils.isNotBlank(m.getMaterialCode())) {
+//                    materialInformationMap.put(key, new BigDecimal(m.getTotal()));
+//                }
+//            }
+//        });
+
+//        //两表比较 添加标识
+//        materialInformationMap.forEach((k, v) -> {
+//            if (onPassageMaterialsMap.containsKey(k)) {
+//                if (onPassageMaterialsMap.get(k).compareTo(v) >= 0) {
+//                    flagList.add(k);
+//                }
+//            }
+//        });
+
         //根据标识在原表中追加备注
         materialInformationList.forEach(l -> {
-            String key = l.getMaterialCode() + "-" + l.getReportingDepartment();
-            if (flagList.contains(key)) {
-                l.setRemarkText("在途已有" + onPassageMaterialsMap.get(key) + "单位,请核实本次需求");
+            String depart = l.getReportingDepartment();
+            String person = l.getPlanner();
+            if(StringUtils.isBlank(depart)){
+                depart = reportPersonMap.get(person);
+                l.setReportingDepartment(depart);
+            }
+            String key = l.getMaterialCode() + "-" + depart;
+            if (flagSet.contains(key)) {
+                l.setRemarkText("在途已有" + onPassageMaterialsMap.get(key) + l.getUnit()+",请核实本次需求");
             }
         });
     }

+ 4 - 4
src/main/java/com/jeeplus/modules/sg/balancedlibrary/onPassageMaterials/web/OnPassageMaterialsController.java

@@ -60,7 +60,7 @@ public class OnPassageMaterialsController extends BaseController {
     /**
      * 物料替换列表页面
      */
-    @RequiresPermissions("sg:balancedlibrary:ReplaceMaterial:list")
+    @RequiresPermissions("sg:balancedlibrary:onPassageMaterials:list")
     @RequestMapping(value = "list")
     public String list(OnPassageMaterials entity, Model model) {
         model.addAttribute("entity", entity);
@@ -78,11 +78,11 @@ public class OnPassageMaterialsController extends BaseController {
 
         try {
             //获取两张excel表
-            ImportExcel onPassageMaterialsFile = new ImportExcel(file[0], 1, 0);
+            ImportExcel onPassageMaterialsFile = new ImportExcel(file[0], 0, 0);
             ImportExcel materialInformationFile = new ImportExcel(file[1], 1, 0);
             //转换为集合
-            List<OnPassageMaterials> onPassageMaterialsList = onPassageMaterialsFile.getDataList(OnPassageMaterials.class);
-            List<MaterialInformation> materialInformationList = materialInformationFile.getDataList(MaterialInformation.class);
+            List<OnPassageMaterials> onPassageMaterialsList = onPassageMaterialsFile.getDataListNew(OnPassageMaterials.class);
+            List<MaterialInformation> materialInformationList = materialInformationFile.getDataListNew(MaterialInformation.class);
 
             service.comparativeData(onPassageMaterialsList,materialInformationList);
 

+ 1 - 1
src/main/java/com/jeeplus/modules/sg/balancedlibrary/preferredMaterials/mapper/xml/PreferredMaterialsMapper.xml

@@ -54,7 +54,7 @@
 			a.material_code
 		FROM bla_preferred_materials a
 		<where>
-			a.del_flag = #{DEL_FLAG_NORMAL}
+			a.del_flag = '0'
 			${dataScope}
 		</where>
 	</select>

+ 6 - 3
src/main/java/com/jeeplus/modules/sg/balancedlibrary/reportPerson/mapper/xml/ReportPersonMapper.xml

@@ -73,9 +73,12 @@
     <select id="findDepartmentGroupByPerson"
             resultType="com.jeeplus.modules.sg.balancedlibrary.reportPerson.entity.ReportPerson">
 		SELECT
-		`report_department` reportDepartment ,`report_person` reportPerson
-		FROM `bla_report_person`
-		group by `report_department` , report_person
+		b.label AS reportDepartment ,a.`report_person` reportPerson
+		FROM `bla_report_person` a
+		left join (select value,label from sys_dict_value where dict_type_id=
+        (select id from sys_dict_type where type='report_department')) b
+        on a.report_department = b.value
+
 	</select>
 
     <insert id="insert">

+ 8 - 11
src/main/java/com/jeeplus/modules/sg/financial/erpcredit/service/ErpCreditService.java

@@ -10,10 +10,7 @@ import com.jeeplus.core.servlet.ValidateCodeServlet;
 import com.jeeplus.modules.sg.audit.information.entity.Information;
 import com.jeeplus.modules.sg.audit.information.service.InformationService;
 import com.jeeplus.modules.sg.audit.information.utils.RandomUtil;
-import com.jeeplus.modules.sg.financial.erpcredit.entity.ErpCredit;
-import com.jeeplus.modules.sg.financial.erpcredit.entity.ErpCreditEquipment;
-import com.jeeplus.modules.sg.financial.erpcredit.entity.ErpCreditMaterial;
-import com.jeeplus.modules.sg.financial.erpcredit.entity.ErpJudge;
+import com.jeeplus.modules.sg.financial.erpcredit.entity.*;
 import com.jeeplus.modules.sg.financial.erpcredit.mapper.ErpCreditEquipmentMapper;
 import com.jeeplus.modules.sg.financial.erpcredit.mapper.ErpCreditMapper;
 import com.jeeplus.modules.sg.financial.erpcredit.mapper.ErpCreditMaterialMapper;
@@ -247,7 +244,7 @@ public class ErpCreditService extends CrudService<ErpCreditMapper,ErpCredit> {
         XSSFSheet sheetLine1 = null;//移交生产总值一览表
         XSSFSheet sheetEquip=null;//移交总值设备表
         XSSFSheet sheetEquipMaterial=null;//设备材料费用
-        XSSFSheet sheetSettlement=null;//结算表
+//        XSSFSheet sheetSettlement=null;//结算表
         XSSFSheet sheetLine2=null;//线路2
         XSSFSheet sheetEquip2=null;//设备2
         XSSFSheet newForm=null;//新表格
@@ -265,8 +262,8 @@ public class ErpCreditService extends CrudService<ErpCreditMapper,ErpCredit> {
 //            sheetEquip=workbook.getSheetAt(6);//设备1
             sheetLine2=workbook.getSheetAt(5);//04-1
             sheetEquip2=workbook.getSheetAt(6);//04-2
-            sheetEquipMaterial=workbook.getSheetAt(7);//设备材料清单表
-            sheetSettlement=workbook.getSheetAt(8);//结算表05
+//            sheetEquipMaterial=workbook.getSheetAt(7);//设备材料清单表
+//            sheetSettlement=workbook.getSheetAt(8);//结算表05
 
 
         } catch (Exception e1) {
@@ -276,8 +273,8 @@ public class ErpCreditService extends CrudService<ErpCreditMapper,ErpCredit> {
             // 写数据
             FileOutputStream fos = new FileOutputStream(newFile);
             ExportUtil.getSheetCover(sheetCover,erpCreditList,maintainDatas); //封面写入数据
-            ExportUtil.getSheetOverView(sheetOverView,erpCreditList,maintainDatas);//概况表写入数据 01
-            ExportUtil.getSheetView(sheetView,erpCreditList,maintainDatas,workbook);//一览表写入数据 02
+            Schedule schedule = ExportUtil.getSheetView(sheetView,erpCreditList,maintainDatas,workbook);//一览表写入数据 02
+            ExportUtil.getSheetOverView(sheetOverView,erpCreditList,maintainDatas,schedule);//概况表写入数据 01
 //            ExportUtil.getSheetOtherFee(sheetOtherFee,erpCreditList,maintainDatas);//其他费用明细表 不用
             ExportUtil.getOtherExpenses(newForm,erpCreditList,maintainDatas,workbook);//其他费用表写入数据 03
             ExportUtil.getSheetAssetsTotal(sheetAssetsTotal,erpCreditList,maintainDatas);//移交资产总表 04
@@ -285,8 +282,8 @@ public class ErpCreditService extends CrudService<ErpCreditMapper,ErpCredit> {
             ExportUtil.getSheetEquip2(sheetEquip2,erpCreditList,maintainDatas,workbook);//04-2
 //            ExportUtil.getSheetLine1(sheetLine1,erpCreditList,workbook);
 //            ExportUtil.getSheetEquip(sheetEquip,erpCreditList,maintainDatas,workbook);
-            ExportUtil.getSheetEquipMaterial(sheetEquipMaterial,erpCreditList,workbook);//设备材料清册
-            ExportUtil.getSheetSettlement(sheetSettlement,erpCreditList,maintainDatas);//竣工工程决算表 05
+//            ExportUtil.getSheetEquipMaterial(sheetEquipMaterial,erpCreditList,workbook);//设备材料清册
+//            ExportUtil.getSheetSettlement(sheetSettlement,erpCreditList,maintainDatas);//竣工工程决算表 05
 
 
 

+ 70 - 36
src/main/java/com/jeeplus/modules/sg/financial/erpcredit/util/ExportUtil.java

@@ -54,11 +54,27 @@ public class ExportUtil {
             XSSFRow row5 = (XSSFRow) sheet.getRow(21);
             XSSFCell cell5 = getViewCell(row5,0);;//财务负责人及编制人
 
+            int largestYear = 0;
+            String largestYearStr = "";
+            for(ErpCredit erpCredit:erpCredits){
+                if(largestYearStr.equals("")){
+                    largestYearStr = erpCredit.getItemId().substring(6,8);
+                    largestYear = Integer.parseInt(largestYearStr);
+                }else{
+                    String tempYearStr = erpCredit.getItemId().substring(6,8);
+                    int tempYear = Integer.parseInt(largestYearStr);
+                    if(tempYear > largestYear){
+                        largestYearStr = tempYearStr;
+                        largestYear = tempYear;
+                    }
+                }
+            }
+
             if("L010010501".equals(profitCenter)){
                 cell1.setCellValue("国网江苏省电力有限公司常州供电分公司");
                 cell5.setCellValue("财务负责人:贺雪霞                       编制人:  王勇");
 
-                String proName = "20"+projectDefinitionCode.substring(6,8)+"年国网江苏省电力有限公司常州供电分公司配网"
+                String proName = "20"+largestYearStr+"年国网江苏省电力有限公司常州供电分公司配网"
                         +erpCredits.size()+"个项目";
                 cell3.setCellValue(proName);
             }else{
@@ -67,7 +83,7 @@ public class ExportUtil {
             String fileName = "20"+projectDefinitionCode.substring(6,8)+"年配网改造工程项目竣工决算报告";
             cell2.setCellValue(fileName);
             Calendar cal = Calendar.getInstance();
-            String submitDate = "报送日期:"+cal.get(Calendar.YEAR)+"年"+(cal.get(Calendar.MINUTE)+1)+"月";
+            String submitDate = "报送日期:"+cal.get(Calendar.YEAR)+"年"+(cal.get(Calendar.MONTH)+1)+"月";
             cell4.setCellValue(submitDate);
 
         }
@@ -79,7 +95,7 @@ public class ExportUtil {
      * @param erpCredits
      * @param maintainDataList
      */
-    public static void getSheetOverView(Sheet sheet, List<ErpCredit> erpCredits, List<MaintainData> maintainDataList){
+    public static void getSheetOverView(Sheet sheet, List<ErpCredit> erpCredits, List<MaintainData> maintainDataList,Schedule schedule){
         if (sheet!=null) {
             GeneralSituation generalSituation = ExportUtilCalculate.getFeneraSituation(erpCredits, maintainDataList);
             XSSFRow row = (XSSFRow) sheet.getRow(6);
@@ -99,6 +115,10 @@ public class ExportUtil {
             cell.setCellValue(generalSituation.getDesignUnit());
 
             row = (XSSFRow) sheet.getRow(5);
+            cell = row.getCell(1);//建设地址
+            if("L010010501".equals(erpCredits.get(0).getProfitCenter())){
+                cell.setCellValue("国网江苏省电力有限公司常州供电分公司");
+            }
             cell = row.getCell(6);//施工单位
             cell.setCellValue(generalSituation.getBuildUnit());
 
@@ -127,20 +147,26 @@ public class ExportUtil {
 //            cell.setCellValue(Double.parseDouble(generalSituation.getInvestmentBudget()));
             setCellDoubleValue(cell, generalSituation.getInvestmentBudget());
 
+
+            String totalSum = schedule.getActualTotalFee();
+
             row = (XSSFRow) sheet.getRow(13);
             cell = row.getCell(7);
 //            cell.setCellValue(Double.parseDouble(generalSituation.getActualInvestment()));//实际投资
-            setCellDoubleValue(cell, generalSituation.getActualInvestment());
+//            setCellDoubleValue(cell, generalSituation.getActualInvestment());
+            setCellDoubleValue(cell, totalSum);
 
             row = (XSSFRow) sheet.getRow(14);
             cell = row.getCell(7);
 //            cell.setCellValue(Double.parseDouble(generalSituation.getTransferAssets()));
-            setCellDoubleValue(cell, generalSituation.getTransferAssets());
+//            setCellDoubleValue(cell, generalSituation.getTransferAssets());
+            setCellDoubleValue(cell, totalSum);
 
             row = (XSSFRow) sheet.getRow(16);
             cell = row.getCell(7);
 //            cell.setCellValue(Double.parseDouble(generalSituation.getHasItsOwn()));
-            setCellDoubleValue(cell, generalSituation.getHasItsOwn());
+//            setCellDoubleValue(cell, generalSituation.getHasItsOwn());
+            setCellDoubleValue(cell,totalSum);
         }
     }
 
@@ -151,7 +177,8 @@ public class ExportUtil {
      * @param maintainDataList
      * @param workbook
      */
-    public static void getSheetView(Sheet sheet,List<ErpCredit> erpCredits,List<MaintainData> maintainDataList,Workbook workbook){
+    public static Schedule getSheetView(Sheet sheet,List<ErpCredit> erpCredits,List<MaintainData> maintainDataList,Workbook workbook){
+        Schedule lastOne = null;
         if (sheet!=null){
             CellStyle cellStyleFont = getCellStyleFont(workbook);
             CellStyle cellStyle = getCellStyle(workbook);
@@ -165,6 +192,9 @@ public class ExportUtil {
             for (int i = 0; i <scheduleList.size(); i++) {
                 int total = scheduleList.size()-1;//总数据条数
                 schedule = scheduleList.get(i);
+                if(i == total){
+                    lastOne = schedule;
+                }
                 row=(XSSFRow)sheet.createRow(i+6);
                 cell = getViewCell(row,0,i,total,cellStyle,cellStyleFont);
                 cell.setCellValue(i+1);//序号
@@ -204,18 +234,19 @@ public class ExportUtil {
                 setCellDoubleValue(cell, schedule.getActualBuildProject());
 
                 cell = getViewCell(row,10,i,total,cellStyle,cellStyleFont);
-                String actualIntallProject = schedule.getActualIntallProject();
-                String actualEquipmentValue = schedule.getActualEquipmentValue();
-                if (null == actualIntallProject || "".equals(actualIntallProject)) {
-                    actualIntallProject = "0.0";
-                }
-                if (null == actualEquipmentValue || "".equals(actualEquipmentValue)) {
-                    actualEquipmentValue = "0.0";
-                }
-                BigDecimal all = new BigDecimal(actualIntallProject);
-                BigDecimal mul = new BigDecimal(actualEquipmentValue);
-                BigDecimal bigDecimal = all.subtract(mul);
-                cell.setCellValue(bigDecimal.doubleValue());//安装工程实际
+                setCellDoubleValue(cell, schedule.getActualIntallProject());
+//                String actualIntallProject = schedule.getActualIntallProject();
+//                String actualEquipmentValue = schedule.getActualEquipmentValue();
+//                if (null == actualIntallProject || "".equals(actualIntallProject)) {
+//                    actualIntallProject = "0.0";
+//                }
+//                if (null == actualEquipmentValue || "".equals(actualEquipmentValue)) {
+//                    actualEquipmentValue = "0.0";
+//                }
+//                BigDecimal all = new BigDecimal(actualIntallProject);
+//                BigDecimal mul = new BigDecimal(actualEquipmentValue);
+//                BigDecimal bigDecimal = all.subtract(mul);
+//                cell.setCellValue(bigDecimal.doubleValue());//安装工程实际
 
                 cell = getViewCell(row,11,i,total,cellStyle,cellStyleFont);
 //                cell.setCellValue(Double.parseDouble(schedule.getActualEquipmentValue()));//设备价值实际
@@ -226,13 +257,14 @@ public class ExportUtil {
                 setCellDoubleValue(cell, schedule.getActualOtherFee());
 
                 cell = getViewCell(row,13,i,total,cellStyle,cellStyleFont);
-                String actualTotalFee = schedule.getActualTotalFee();
-                if (null == actualTotalFee || "".equals(actualTotalFee)) {
-                    actualTotalFee = "0.0";
-                }
-                BigDecimal actual = new BigDecimal(actualTotalFee);
-                BigDecimal subtract = actual.subtract(mul);
-                cell.setCellValue(subtract.doubleValue());//合计实际
+                setCellDoubleValue(cell, schedule.getActualTotalFee());
+//                String actualTotalFee = schedule.getActualTotalFee();
+//                if (null == actualTotalFee || "".equals(actualTotalFee)) {
+//                    actualTotalFee = "0.0";
+//                }
+//                BigDecimal actual = new BigDecimal(actualTotalFee);
+//                BigDecimal subtract = actual.subtract(mul);
+//                cell.setCellValue(subtract.doubleValue());//合计实际
 
 
                 cell = getViewCell(row,14,i,total,cellStyle,cellStyleFont);
@@ -244,26 +276,28 @@ public class ExportUtil {
                 if (null != listDeduction && !"".equals(listDeduction)) {
                     allDecimal = new BigDecimal(listDeduction);
                 }
-                BigDecimal add = allDecimal.add(subtract);
+                BigDecimal add = allDecimal.add(new BigDecimal(schedule.getActualTotalFee()));
 
                 cell = getViewCell(row,15,i,total,cellStyle,cellStyleFont);
                 cell.setCellValue(add.doubleValue());//实际含税投资合计
 
 
                 cell = getViewCell(row,16,i,total,cellStyle,cellStyleFont);
-                String addSubtractionLines = schedule.getAddSubtractionLines();
-                if (null == addSubtractionLines || "".equals(addSubtractionLines)) {
-                    addSubtractionLines = "0.0";
-                }
-                BigDecimal addSub = new BigDecimal(addSubtractionLines);
-                BigDecimal decimal = addSub.subtract(mul);
-                cell.setCellValue(decimal.doubleValue()); //增减额
+                setCellDoubleValue(cell, schedule.getAddSubtractionLines());
+//                String addSubtractionLines = schedule.getAddSubtractionLines();
+//                if (null == addSubtractionLines || "".equals(addSubtractionLines)) {
+//                    addSubtractionLines = "0.0";
+//                }
+//                BigDecimal addSub = new BigDecimal(addSubtractionLines);
+//                BigDecimal decimal = addSub.subtract(mul);
+//                cell.setCellValue(decimal.doubleValue()); //增减额
 
                 cell = getViewCell(row,17,i,total,cellStyle,cellStyleFont);
 //                cell.setCellValue(Double.parseDouble(schedule.getAddSubtractionRate()));//增减率
                 setCellDoubleValue(cell, schedule.getAddSubtractionRate());
             }
         }
+        return lastOne;
 
     }
 
@@ -355,7 +389,7 @@ public class ExportUtil {
             XSSFRow row = (XSSFRow) sheet.createRow(2);
             XSSFCell cell = getViewCell(row,0);//编制单位
             cell.setCellValue(getCompany(erpCredits));
-            cell = getViewCell(row,10);//编制日期
+            cell = getViewCell(row,7);//编制日期
             cell.setCellValue(getCurrentDate());
             List<OtherExpenses> otherList = ExportUtilCalculate.getOtherExpenses(erpCredits, maintainDataList);
             for (int i = 0; i <otherList.size(); i++) {
@@ -1059,7 +1093,7 @@ public class ExportUtil {
      */
     public static String getCurrentDate(){
         Calendar calendar = Calendar.getInstance();
-        return "编制日期:"+calendar.get(Calendar.YEAR)+"年"+calendar.get(Calendar.MONTH)
+        return "编制日期:"+calendar.get(Calendar.YEAR)+"年"+(calendar.get(Calendar.MONTH)+1)
                 +"月"+calendar.get(Calendar.DATE)+"日";
     }
 

+ 12 - 10
src/main/java/com/jeeplus/modules/sg/financial/erpcredit/util/ExportUtilCalculate.java

@@ -70,7 +70,7 @@ public class ExportUtilCalculate {
                 scheduletotal.setBudgetBuildProject(decimalFormat.format(budgetBuildProjectAll));
             }
             if (null!=s.getBudgetTotalFee()){
-                budgetInstallProjectAll+=Double.parseDouble(s.getBudgetTotalFee());
+                budgetInstallProjectAll+=Double.parseDouble(s.getBudgetInstallProject());
                 scheduletotal.setBudgetInstallProject(decimalFormat.format(budgetInstallProjectAll));
             }
             if (null!=s.getBudgetEquipmentValue()){
@@ -120,7 +120,7 @@ public class ExportUtilCalculate {
         }
         //合计行增减率
         scheduletotal.setAddSubtractionRate(decimalFormat.format(
-                Double.parseDouble(schedule.getAddSubtractionLines())/Double.parseDouble(schedule.getBudgetTotalFee())*100
+                Double.parseDouble(scheduletotal.getAddSubtractionLines())/Double.parseDouble(scheduletotal.getBudgetTotalFee())*100
         ));
         scheduletotal.setItemName(itemNameAll);
         schedules.add(scheduletotal);
@@ -215,7 +215,9 @@ public class ExportUtilCalculate {
             }
             if (flag){
                 schedule.setActualEquipmentValue(decimalFormat.format(netAmount));//实际设备价值
-                actualTotalFee+=netAmount;//实际费用累加
+                //安装费包含了设备价值,所以应该从安装费中扣除设备价值,同时合计中不应再计算设备价值
+                schedule.setActualIntallProject(decimalFormat.format(Double.parseDouble(schedule.getActualIntallProject())-netAmount));
+//                actualTotalFee+=netAmount;//实际费用累加
             }
             flag=false;//数据清0
             netAmount=0.0;
@@ -921,13 +923,13 @@ public class ExportUtilCalculate {
             ErpCredit credit = erpCredits.get(0);
             String profitCenter = credit.getProfitCenter();
             String projectDefinitionCode = credit.getItemId();
-            String projectName = "";
-            if("L010010501".equals(profitCenter)){
-                projectName = "20"+projectDefinitionCode.substring(6,8)+"年国网江苏省电力有限公司常州供电分公司配网"
-                        +erpCredits.size()+"个项目";
-            }else{
-
-            }
+            String projectName = credit.getItemName()+"等"+erpCredits.size()+"个项目";
+//            if("L010010501".equals(profitCenter)){
+//                projectName = "20"+projectDefinitionCode.substring(6,8)+"年国网江苏省电力有限公司常州供电分公司配网"
+//                        +erpCredits.size()+"个项目";
+//            }else{
+//
+//            }
             generalSituation.setProjectName(projectName);
 
             for (ErpCredit erpCredit:erpCredits){

+ 3 - 3
src/main/java/com/jeeplus/modules/sg/financial/settlement/web/ProjectBudgetController.java

@@ -660,12 +660,12 @@ public class ProjectBudgetController extends BaseController {
                             nullMsg.append("项目编号" + itemId + "无甲供材数据;");
                             //修改项目donor_material_check状态
                             projectBudgetService.updateCheck(itemId, "donor_material_check", "2");
-                            e.setItemName(e.getItemName() + "(未通过甲供材检查)");
+//                            e.setItemName(e.getItemName() + "(未通过甲供材检查)");
                         } else if (i == 2) {
 //                            notMsg.append("项目编号" + itemId + "领料未完成;");
                             //修改项目donor_material_check状态
                             projectBudgetService.updateCheck(itemId, "donor_material_check", "2");
-                            e.setItemName(e.getItemName() + "(未通过甲供材检查)");
+//                            e.setItemName(e.getItemName() + "(未通过甲供材检查)");
                         } else {
                             //修改项目donor_material_check状态
                             projectBudgetService.updateCheck(itemId, "donor_material_check", "1");
@@ -690,7 +690,7 @@ public class ProjectBudgetController extends BaseController {
                         for (ErpCredit e :
                                 erpCredits) {
                             if (e.getItemId().equals(a)) {
-                                e.setItemName(e.getItemName() + "(未通过费用检查)");
+//                                e.setItemName(e.getItemName() + "(未通过费用检查)");
                             }
                         }
 //                        notMsg.append("项目编号" + a + "费用入账有误;");

BIN
src/main/resources/freemarker/excelmodel/completionModel.xlsx


+ 1 - 0
src/main/resources/properties/jeeplus.properties

@@ -29,6 +29,7 @@ jdbc.username=root
 #jdbc.password=Zjsh5182!
 #103\u79C1\u670D\u73AF\u5883\u3001\u9547\u6C5F\u6D4B\u8BD5\u73AF\u5883
 #jdbc.password=Xgxx1234!
+#jdbc.password=Jsxg20220426!
 jdbc.password=root
 jdbc.testSql=SELECT 'x'
 jdbc.dual =

+ 1 - 1
src/main/webapp/webpage/modules/sg/balancedlibrary/onPassageMaterials/onPassageMaterialsList.jsp

@@ -116,7 +116,7 @@
             <h3 class="panel-title">在途物资统计</h3>
         </div>
         <div class="panel-body">
-            <h5>导入文件不能超过5M,仅允许导入“xls”或“xlsx”格式文件!</h5>
+            <h5>仅允许导入“xls”或“xlsx”格式文件!</h5>
         </div>
         <input type="file" name="onPassageMaterials" id="onPassageMaterials" style="display: none;"
                onchange="onPassageMaterialsFileChange(event)">

+ 2 - 2
src/main/webapp/webpage/modules/sg/balancedlibrary/planSummary/planSummaryList.jsp

@@ -85,7 +85,7 @@
 <div class="wrapper wrapper-content">
     <div class="panel panel-primary">
         <div class="panel-body">
-            <h5>导入文件不能超过5M,仅允许导入“xls”或“xlsx”格式文件!</h5>
+            <h5>仅允许导入“xls”或“xlsx”格式文件!</h5>
         </div>
         <input type="file" name="AgriculturalDistributionNetwork" id="AgriculturalDistributionNetwork" style="display: none;"
                onchange="AgriculturalDistributionNetworkFileChange(event)">
@@ -101,7 +101,7 @@
             </span>
 
             <button class="btn btn-info" onclick="ProcessTracking.click()" style="margin-left: 16px">
-                <i class="fa fa-folder-open-o"></i> 导入2021年第三批配农网、省招协议库存物资需求预测计划上报表
+                <i class="fa fa-folder-open-o"></i> 导入存物资需求预测计划上报表
             </button>
             <span id="ProcessTrackingFileName" class="file_name">
                 未选择文件