Commit 2c5ab4db by wancheng

app代码优化

parent 88191fb9
...@@ -103,7 +103,10 @@ public class ServiceHPMT001 extends ServiceBase { ...@@ -103,7 +103,10 @@ public class ServiceHPMT001 extends ServiceBase {
resultMap.put("actualWt_s_qoq", 0);//实际环比 resultMap.put("actualWt_s_qoq", 0);//实际环比
} else { } else {
resultMap.put("actualWt_s", row4.get(0).get("actualWt")); resultMap.put("actualWt_s", row4.get(0).get("actualWt"));
BigDecimal actualWt = (BigDecimal) row2.get(0).get("actualWt"); BigDecimal actualWt = BigDecimal.ZERO;
if(row2.get(0).get("actualWt")!=null){
actualWt = (BigDecimal) row2.get(0).get("actualWt");
}
BigDecimal actualWt2 = (BigDecimal) row4.get(0).get("actualWt"); BigDecimal actualWt2 = (BigDecimal) row4.get(0).get("actualWt");
resultMap.put("actualWt_s_qoq",actualWt.subtract(actualWt2).divide(actualWt2,BigDecimal.ROUND_UP). resultMap.put("actualWt_s_qoq",actualWt.subtract(actualWt2).divide(actualWt2,BigDecimal.ROUND_UP).
multiply(new BigDecimal(100)).doubleValue()); multiply(new BigDecimal(100)).doubleValue());
...@@ -124,7 +127,10 @@ public class ServiceHPMT001 extends ServiceBase { ...@@ -124,7 +127,10 @@ public class ServiceHPMT001 extends ServiceBase {
resultMap.put("actualWt_h_yoy", 0);//实际同比 resultMap.put("actualWt_h_yoy", 0);//实际同比
} else { } else {
resultMap.put("actualWt_h", row6.get(0).get("actualWt")); resultMap.put("actualWt_h", row6.get(0).get("actualWt"));
BigDecimal actualWt = (BigDecimal) row2.get(0).get("actualWt"); BigDecimal actualWt = BigDecimal.ZERO;
if(row2.get(0).get("actualWt")!=null){
actualWt = (BigDecimal) row2.get(0).get("actualWt");
}
BigDecimal actualWt2 = (BigDecimal) row6.get(0).get("actualWt"); BigDecimal actualWt2 = (BigDecimal) row6.get(0).get("actualWt");
resultMap.put("actualWt_h_yoy", actualWt.subtract(actualWt2).divide(actualWt2,BigDecimal.ROUND_UP). resultMap.put("actualWt_h_yoy", actualWt.subtract(actualWt2).divide(actualWt2,BigDecimal.ROUND_UP).
multiply(new BigDecimal(100)).doubleValue()); multiply(new BigDecimal(100)).doubleValue());
......
...@@ -22,6 +22,7 @@ import com.baosight.hpjx.hp.zl.domain.HPZL001A; ...@@ -22,6 +22,7 @@ import com.baosight.hpjx.hp.zl.domain.HPZL001A;
import com.baosight.hpjx.util.*; import com.baosight.hpjx.util.*;
import com.baosight.iplat4j.common.ed.domain.TEDCM01; import com.baosight.iplat4j.common.ed.domain.TEDCM01;
import com.baosight.iplat4j.core.ProjectInfo;
import com.baosight.iplat4j.core.ei.EiBlock; import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant; import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo; import com.baosight.iplat4j.core.ei.EiInfo;
...@@ -196,7 +197,14 @@ public class ServiceHPMT002 extends ServiceBase { ...@@ -196,7 +197,14 @@ public class ServiceHPMT002 extends ServiceBase {
Map Map = new HashMap(); Map Map = new HashMap();
Map.put("checkId", id); Map.put("checkId", id);
Map.put("docType",1); Map.put("docType",1);
List<HPZL001A> docIdlist = this.dao.query("HPZL001A.queryRun", Map); String projectEnv = ProjectInfo.getProjectEnv();
List<HPZL001A> docIdlist = new ArrayList<>();
if(projectEnv.equals("run")){
docIdlist = this.dao.query("HPZL001A.queryRun", Map);
}else{
docIdlist = this.dao.query("HPZL001A.queryDev", Map);
}
List<String> imgList = new ArrayList<>(); List<String> imgList = new ArrayList<>();
for (int i = 0; i < docIdlist.size(); i++) { for (int i = 0; i < docIdlist.size(); i++) {
HPZL001A hpzl001A = docIdlist.get(i); HPZL001A hpzl001A = docIdlist.get(i);
...@@ -207,7 +215,12 @@ public class ServiceHPMT002 extends ServiceBase { ...@@ -207,7 +215,12 @@ public class ServiceHPMT002 extends ServiceBase {
Map Map2 = new HashMap(); Map Map2 = new HashMap();
Map2.put("checkId", id); Map2.put("checkId", id);
Map2.put("docType",2); Map2.put("docType",2);
List<HPZL001A> docIdlist2 = this.dao.query("HPZL001A.queryRun", Map2); List<HPZL001A> docIdlist2 = new ArrayList<>();
if(projectEnv.equals("run")){
docIdlist2 = this.dao.query("HPZL001A.queryRun", Map2);
}else{
docIdlist2 = this.dao.query("HPZL001A.queryDev", Map2);
}
List<String> imgList2 = new ArrayList<>(); List<String> imgList2 = new ArrayList<>();
for (int i = 0; i < docIdlist2.size(); i++) { for (int i = 0; i < docIdlist2.size(); i++) {
HPZL001A hpzl001A = docIdlist2.get(i); HPZL001A hpzl001A = docIdlist2.get(i);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment