|
@@ -3,9 +3,12 @@ package com.jeeplus.modules.sg.project.service;
|
|
|
import com.jeeplus.common.json.AjaxJson;
|
|
|
import com.jeeplus.common.utils.StringUtils;
|
|
|
import com.jeeplus.common.utils.excel.ImportExcel;
|
|
|
+import com.jeeplus.common.utils.sg.ExcelUtil;
|
|
|
import com.jeeplus.core.persistence.Page;
|
|
|
import com.jeeplus.core.service.CrudService;
|
|
|
+import com.jeeplus.modules.sg.overheadline.entity.JkxlDetailFee;
|
|
|
import com.jeeplus.modules.sg.overheadline.entity.Settlement;
|
|
|
+import com.jeeplus.modules.sg.overheadline.mapper.OverheadLineMapper;
|
|
|
import com.jeeplus.modules.sg.overheadline.service.FeeAdjustService;
|
|
|
import com.jeeplus.modules.sg.overheadline.service.OverheadLineService;
|
|
|
import com.jeeplus.modules.sg.overheadline.service.SettlementService;
|
|
@@ -44,6 +47,8 @@ public class ProjectService extends CrudService<ProjectMapper, WbsProject> {
|
|
|
private SettlementService settlementService;
|
|
|
@Autowired
|
|
|
private FeeAdjustService feeAdjustService;
|
|
|
+ @Autowired
|
|
|
+ private OverheadLineMapper overheadLineMapper;
|
|
|
|
|
|
|
|
|
public WbsProject get(String id) {
|
|
@@ -80,10 +85,125 @@ public class ProjectService extends CrudService<ProjectMapper, WbsProject> {
|
|
|
substationService.save(file,wbsItem);
|
|
|
return BashInfo.PROJECT_BDZ;
|
|
|
}
|
|
|
+ //WBS类型判断
|
|
|
+ ImportExcel importExcel = new ImportExcel(file,1,0);
|
|
|
+ double bdzJzTotal = ExcelUtil.getDouble(importExcel,BashInfo.BZDWBS,1,4);
|
|
|
+ double bdzAzTotal = ExcelUtil.getDouble(importExcel,BashInfo.BZDWBS,1,7);
|
|
|
+ double dlJzTotal = ExcelUtil.getDouble(importExcel,BashInfo.DLWBS,1,4);
|
|
|
+ double dlAzTotal = ExcelUtil.getDouble(importExcel,BashInfo.DLWBS,1,7);
|
|
|
+ double jkxlTotal = ExcelUtil.getDouble(importExcel,BashInfo.JKXLWBS,1,7);
|
|
|
+ if(bdzAzTotal != 0.00 || bdzJzTotal != 0.00){
|
|
|
+ String id = wbsItem.getId();
|
|
|
+ WbsItem wbsItem1 = itemService.get(id);
|
|
|
+ if(wbsItem1 == null){
|
|
|
+ wbsItem.setType(BashInfo.PROJECT_BDZ);
|
|
|
+ wbsItem.setDelFlag("0");
|
|
|
+ //保存项目
|
|
|
+ itemService.save(wbsItem);
|
|
|
+ }
|
|
|
+ double[] totalJzFees = ExcelUtil.getDoubleArray(importExcel,SubstationInfo.BDZJZWBS,1,4);
|
|
|
+ double[] totalAzFees = ExcelUtil.getDoubleArray(importExcel,SubstationInfo.BDZAZWBS,1,7);
|
|
|
+ double[] otherFees = ExcelUtil.getDoubleArray(importExcel,SubstationInfo.BDZOTHWBS,1,9);
|
|
|
+ List<JkxlDetailFee> list = new ArrayList<>();
|
|
|
+ JkxlDetailFee jkxlDetailFee = null;
|
|
|
+ for(int i=0;i<totalJzFees.length;i++){
|
|
|
+ jkxlDetailFee = new JkxlDetailFee();
|
|
|
+ jkxlDetailFee.setId(id);
|
|
|
+ jkxlDetailFee.setWbsCode(SubstationInfo.BDZJZWBS[i]);
|
|
|
+ jkxlDetailFee.setTotalFee(totalJzFees[i]);
|
|
|
+ list.add(jkxlDetailFee);
|
|
|
+ }
|
|
|
+ for(int i=0;i<totalAzFees.length;i++){
|
|
|
+ jkxlDetailFee = new JkxlDetailFee();
|
|
|
+ jkxlDetailFee.setId(id);
|
|
|
+ jkxlDetailFee.setWbsCode(SubstationInfo.BDZAZWBS[i]);
|
|
|
+ jkxlDetailFee.setTotalFee(totalAzFees[i]);
|
|
|
+ list.add(jkxlDetailFee);
|
|
|
+ }
|
|
|
+ for(int j=0;j<otherFees.length;j++){
|
|
|
+ jkxlDetailFee = new JkxlDetailFee();
|
|
|
+ jkxlDetailFee.setId(id);
|
|
|
+ jkxlDetailFee.setWbsCode(SubstationInfo.BDZOTHWBS[j]);
|
|
|
+ jkxlDetailFee.setTotalFee(otherFees[j]);
|
|
|
+ list.add(jkxlDetailFee);
|
|
|
+ }
|
|
|
+ overheadLineMapper.saveList(list);
|
|
|
+ return BashInfo.PROJECT_BDZ;
|
|
|
+ }
|
|
|
+ if(dlJzTotal != 0.00 || dlAzTotal != 0.00){
|
|
|
+ String id = wbsItem.getId();
|
|
|
+ WbsItem wbsItem1 = itemService.get(id);
|
|
|
+ if(wbsItem1 == null){
|
|
|
+ wbsItem.setType(BashInfo.PROJECT_DLXL);
|
|
|
+ wbsItem.setDelFlag("0");
|
|
|
+ //保存项目
|
|
|
+ itemService.save(wbsItem);
|
|
|
+ }
|
|
|
+ double[] totalJzFees = ExcelUtil.getDoubleArray(importExcel,BashInfo.JZWBSIDS,1,4);
|
|
|
+ double[] totalAzFees = ExcelUtil.getDoubleArray(importExcel,BashInfo.AZWBSIDS,1,7);
|
|
|
+ double[] otherFees = ExcelUtil.getDoubleArray(importExcel,BashInfo.DLOTHIDS,1,9);
|
|
|
+ List<JkxlDetailFee> list = new ArrayList<>();
|
|
|
+ JkxlDetailFee jkxlDetailFee = null;
|
|
|
+ for(int i=0;i<totalJzFees.length;i++){
|
|
|
+ jkxlDetailFee = new JkxlDetailFee();
|
|
|
+ jkxlDetailFee.setId(id);
|
|
|
+ jkxlDetailFee.setWbsCode(BashInfo.JZWBSIDS[i]);
|
|
|
+ jkxlDetailFee.setTotalFee(totalJzFees[i]);
|
|
|
+ list.add(jkxlDetailFee);
|
|
|
+ }
|
|
|
+ for(int i=0;i<totalAzFees.length;i++){
|
|
|
+ jkxlDetailFee = new JkxlDetailFee();
|
|
|
+ jkxlDetailFee.setId(id);
|
|
|
+ jkxlDetailFee.setWbsCode(BashInfo.AZWBSIDS[i]);
|
|
|
+ jkxlDetailFee.setTotalFee(totalAzFees[i]);
|
|
|
+ list.add(jkxlDetailFee);
|
|
|
+ }
|
|
|
+ for(int j=0;j<otherFees.length;j++){
|
|
|
+ jkxlDetailFee = new JkxlDetailFee();
|
|
|
+ jkxlDetailFee.setId(id);
|
|
|
+ jkxlDetailFee.setWbsCode(BashInfo.DLOTHIDS[j]);
|
|
|
+ jkxlDetailFee.setTotalFee(otherFees[j]);
|
|
|
+ list.add(jkxlDetailFee);
|
|
|
+ }
|
|
|
+ overheadLineMapper.saveList(list);
|
|
|
+ return BashInfo.PROJECT_DLXL;
|
|
|
+ }
|
|
|
+ if(jkxlTotal != 0.00){
|
|
|
+ String id = wbsItem.getId();
|
|
|
+ WbsItem wbsItem1 = itemService.get(id);
|
|
|
+ if(wbsItem1 == null){
|
|
|
+ wbsItem.setType(BashInfo.PROJECT_JKXL);
|
|
|
+ wbsItem.setDelFlag("0");
|
|
|
+ //保存项目
|
|
|
+ itemService.save(wbsItem);
|
|
|
+ }
|
|
|
+ double[] totalFees = ExcelUtil.getDoubleArray(importExcel,BashInfo.WBSIDS,1,7);
|
|
|
+ double[] otherFees = ExcelUtil.getDoubleArray(importExcel,BashInfo.WBSOTHIDS,1,9);
|
|
|
+ List<JkxlDetailFee> list = new ArrayList<>();
|
|
|
+ JkxlDetailFee jkxlDetailFee = null;
|
|
|
+ for(int i=0;i<totalFees.length;i++){
|
|
|
+ jkxlDetailFee = new JkxlDetailFee();
|
|
|
+ jkxlDetailFee.setId(id);
|
|
|
+ jkxlDetailFee.setWbsCode(BashInfo.WBSIDS[i]);
|
|
|
+ jkxlDetailFee.setTotalFee(totalFees[i]);
|
|
|
+ list.add(jkxlDetailFee);
|
|
|
+ }
|
|
|
+ for(int j=0;j<otherFees.length;j++){
|
|
|
+ jkxlDetailFee = new JkxlDetailFee();
|
|
|
+ jkxlDetailFee.setId(id);
|
|
|
+ jkxlDetailFee.setWbsCode(BashInfo.WBSOTHIDS[j]);
|
|
|
+ jkxlDetailFee.setTotalFee(otherFees[j]);
|
|
|
+ list.add(jkxlDetailFee);
|
|
|
+ }
|
|
|
+ overheadLineMapper.saveList(list);
|
|
|
+ return BashInfo.PROJECT_JKXL;
|
|
|
+ }
|
|
|
+
|
|
|
return BashInfo.INVALIDFORMAT;
|
|
|
}
|
|
|
|
|
|
|
|
|
+
|
|
|
public List<WbsProject> findList(WbsProject wbsProject) {
|
|
|
List<WbsProject> list = projectMapper.findList(wbsProject);
|
|
|
for(WbsProject wbsProject1 : list){
|