|
@@ -1,6 +1,7 @@
|
|
|
package com.jeeplus.modules.sg.overheadline.service;
|
|
|
|
|
|
import com.jeeplus.common.utils.excel.ImportExcel;
|
|
|
+import com.jeeplus.common.utils.sg.ExcelUtil;
|
|
|
import com.jeeplus.modules.sg.overheadline.entity.Settlement;
|
|
|
import com.jeeplus.modules.sg.overheadline.mapper.SettlementMapper;
|
|
|
import com.jeeplus.modules.sg.overheadline.util.BashInfo;
|
|
@@ -23,8 +24,8 @@ public class SettlementService {
|
|
|
public void save(MultipartFile file,String id){
|
|
|
try {
|
|
|
List<Settlement> settlementList = getSettlement(file,id);
|
|
|
- for (int i = 0; i < settlementList.size(); i++) {
|
|
|
- settlementMapper.sava(settlementList.get(i));
|
|
|
+ for (Settlement settlement:settlementList){
|
|
|
+ settlementMapper.sava(settlement);
|
|
|
}
|
|
|
}catch (Exception c){
|
|
|
c.printStackTrace();
|
|
@@ -41,28 +42,31 @@ public class SettlementService {
|
|
|
获取结算数据
|
|
|
*/
|
|
|
public List<Settlement> getSettlement(MultipartFile file, String id) throws Exception{
|
|
|
- ImportExcel completion = new ImportExcel(file,1, BashInfo.SHEET_HZB);
|
|
|
- ImportExcel built = new ImportExcel(file,1,BashInfo.SHEET_GCHZ);
|
|
|
- ImportExcel division = new ImportExcel(file,1,BashInfo.SHEET_FBFXJJ);
|
|
|
- ImportExcel wordFirst = new ImportExcel(file,1,BashInfo.SHEET_CSB);
|
|
|
- ImportExcel otherProject = new ImportExcel(file,1,BashInfo.SHEET_QTFY);
|
|
|
- ImportExcel feesProject = new ImportExcel(file,1,BashInfo.SHEET_GFQD);
|
|
|
+ ImportExcel completion = new ImportExcel(file,1, BashInfo.SHEET_HZB);//工程项目竣工结算汇总表
|
|
|
+ ImportExcel built = new ImportExcel(file,1,BashInfo.SHEET_GCHZ);//架空线路工程汇总表
|
|
|
+ ImportExcel division = new ImportExcel(file,1,BashInfo.SHEET_FBFXJJ);//分部分项工程量清单计价表
|
|
|
+ ImportExcel wordFirst = new ImportExcel(file,1,BashInfo.SHEET_CSB);//措施项目清单计价表(一)
|
|
|
+ ImportExcel otherProject = new ImportExcel(file,1,BashInfo.SHEET_QTFY);//其他项目清单计价表
|
|
|
+ ImportExcel feesProject = new ImportExcel(file,1,BashInfo.SHEET_GFQD);//规费项目清单计价表
|
|
|
Map<String,Object[]> builtMap = getCompletionWorks(completion);
|
|
|
- Double builtTotal = getBuiltStilts(built);
|
|
|
- Double[] divisiontotal = getDivisionOf(division);
|
|
|
- Double wordtotal = getWording(wordFirst);
|
|
|
- Double otherTotal = getOtherProject(otherProject);
|
|
|
- Double feescount = getFeesTotal(feesProject);
|
|
|
+ double builtTotal = ExcelUtil.getDouble(built,BashInfo.QT_HJ,0,2);//获取架空线路工程费用汇总表 分部分项 合计
|
|
|
+
|
|
|
+ double wordtotal = ExcelUtil.getDouble(wordFirst,BashInfo.QT_HJ,0,4);//获取措施费清单计价表
|
|
|
+
|
|
|
+ double otherTotal = ExcelUtil.getDouble(otherProject,BashInfo.QT_HJ,0,2);//获取其他项目费合计
|
|
|
+ int[] comlumn2 = {12,14,15};
|
|
|
+ double[] divisiontotal=ExcelUtil.getDoubleArray(division,BashInfo.PROJECTNAME,2,comlumn2);//获取分工清单
|
|
|
+ double feescount = ExcelUtil.getDouble(feesProject,BashInfo.QT_HJ,0,4);//获取规费合计
|
|
|
return getTotality(builtMap,builtTotal,divisiontotal,wordtotal,otherTotal,feescount,id);
|
|
|
}
|
|
|
/*
|
|
|
- 获取工程竣工数据
|
|
|
+ 获取《工程项目竣工结算汇总表》匹配数据
|
|
|
*/
|
|
|
public Map<String,Object[]> getCompletionWorks(ImportExcel importExcel){
|
|
|
Map<String,Object[]> map = new LinkedHashMap<String, Object[]>();
|
|
|
- Integer lastDataRowNum = importExcel.getLastDataRowNum();
|
|
|
+ int lastDataRowNum = importExcel.getLastDataRowNum();
|
|
|
String key="";
|
|
|
- Double val=0.0;
|
|
|
+ double val=0.0;
|
|
|
String text = "";
|
|
|
Object[] objects;
|
|
|
for (int i = 2; i < lastDataRowNum; i++) {
|
|
@@ -153,97 +157,9 @@ public class SettlementService {
|
|
|
return map;
|
|
|
}
|
|
|
/*
|
|
|
- 获取架空合计
|
|
|
- */
|
|
|
- public Double getBuiltStilts(ImportExcel importExcel){
|
|
|
- Double value = 0.0;
|
|
|
- String type="";
|
|
|
- Integer lastDataRowNum = importExcel.getLastDataRowNum();
|
|
|
- for (int i = 2; i < lastDataRowNum ; i++) {
|
|
|
- type = importExcel.getValue(i+1,0);
|
|
|
- if (type.equals(BashInfo.QT_HJ)){
|
|
|
- value = importExcel.getDouble(i+1,2);
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- return value;
|
|
|
- }
|
|
|
- /*
|
|
|
- 获取措施费合计
|
|
|
- */
|
|
|
- public Double getWording(ImportExcel importExcel){
|
|
|
- Double value = 0.0;
|
|
|
- String type = "";
|
|
|
- Integer lastDataRowNum = importExcel.getLastDataRowNum();
|
|
|
- for (int i = 2; i <lastDataRowNum ; i++) {
|
|
|
- type = importExcel.getValue(i+1,0);
|
|
|
- if (type.equals(BashInfo.QT_HJ)){
|
|
|
- value = importExcel.getDouble(i+1,4);
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- return value;
|
|
|
- }
|
|
|
- /*
|
|
|
- 获取其他项目费
|
|
|
- */
|
|
|
- public Double getOtherProject(ImportExcel importExcel){
|
|
|
- Double value = 0.0;
|
|
|
- String type= "";
|
|
|
- Integer lastDataRowNum = importExcel.getLastDataRowNum();
|
|
|
- for (int i = 0; i <lastDataRowNum ; i++) {
|
|
|
- type = importExcel.getValue(i+1,0);
|
|
|
- if (type.equals(BashInfo.QT_HJ)){
|
|
|
- value = importExcel.getDouble(i+1,2);
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- return value;
|
|
|
- }
|
|
|
- /*
|
|
|
- 获取规费合计
|
|
|
- */
|
|
|
- public Double getFeesTotal(ImportExcel importExcel){
|
|
|
- Double value = 0.0;
|
|
|
- String type = "";
|
|
|
- Integer lastDataRowNum = importExcel.getLastDataRowNum();
|
|
|
- for (int i = 2; i < lastDataRowNum; i++) {
|
|
|
- type = importExcel.getValue(i+1,0);
|
|
|
- if (type.equals(BashInfo.QT_HJ)){
|
|
|
- value = importExcel.getDouble(i+1,4);
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- return value;
|
|
|
- }
|
|
|
- /*
|
|
|
- 获取分工清单
|
|
|
- */
|
|
|
- public Double[] getDivisionOf(ImportExcel importExcel){
|
|
|
- Double count = 0.0;
|
|
|
- Double fpermoney = 0.0;
|
|
|
- Double cpermoney = 0.0;
|
|
|
- String type="";
|
|
|
- Integer lastDataRowNum = importExcel.getLastDataRowNum();
|
|
|
- for (int i = 0; i < lastDataRowNum; i++) {
|
|
|
- type = importExcel.getValue(i+1,2);
|
|
|
- if (type.equals(BashInfo.PROJECTNAME)) {
|
|
|
- count = importExcel.getDouble(i + 1, 12);
|
|
|
- cpermoney = importExcel.getDouble(i + 1, 14);
|
|
|
- fpermoney = importExcel.getDouble(i + 1, 15);
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- Double[] val = new Double[3];
|
|
|
- val[0] = count;
|
|
|
- val[1] = cpermoney;
|
|
|
- val[2] = fpermoney;
|
|
|
- return val;
|
|
|
- }
|
|
|
- /*
|
|
|
- 结算汇总
|
|
|
+ 结算汇总数据比对方法
|
|
|
*/
|
|
|
- public List<Settlement> getTotality(Map<String,Object[]> builtMap,Double builtTotal,Double[] divisiontotal,Double wordtotal,Double otherTotal,Double feescount,String id){
|
|
|
+ public List<Settlement> getTotality(Map<String,Object[]> builtMap,double builtTotal,double[] divisiontotal,double wordtotal,double otherTotal,double feescount,String id){
|
|
|
List<Settlement> list = new ArrayList<Settlement>();
|
|
|
String key="";
|
|
|
double count=0.0;
|
|
@@ -331,7 +247,7 @@ public class SettlementService {
|
|
|
if (money==reduce){
|
|
|
status="0";
|
|
|
}else {
|
|
|
- reason = BashInfo.JS_REASON;
|
|
|
+ reason = BashInfo.RESON_GCJS;
|
|
|
}
|
|
|
break;
|
|
|
}
|