|
@@ -815,3 +815,168 @@ public class YtiotVCompanyServiceImpl implements YtiotVCompanyService {
|
|
NumberFormat numberFormat = NumberFormat.getInstance();
|
|
NumberFormat numberFormat = NumberFormat.getInstance();
|
|
numberFormat.setMaximumFractionDigits(2);
|
|
numberFormat.setMaximumFractionDigits(2);
|
|
if(hjtotalCount==0) {
|
|
if(hjtotalCount==0) {
|
|
|
|
+ String result = "100";
|
|
|
|
+ json.put("hjbaifenbi", result);
|
|
|
|
+ }else {
|
|
|
|
+ String result = numberFormat.format((float)clhjtotalCount/(float)hjtotalCount*100);
|
|
|
|
+ json.put("hjbaifenbi", result);
|
|
|
|
+// int clhjbaifenbi = Integer.parseInt( result );
|
|
|
|
+// json.put("clhjbaifenbi", clhjbaifenbi);
|
|
|
|
+ }
|
|
|
|
+ if(lxhjtotalCount==0) {
|
|
|
|
+ String result = "100"+"%";
|
|
|
|
+ json.put("lxhjbaifenbi", result);
|
|
|
|
+ }else {
|
|
|
|
+ String result = numberFormat.format((float)cllxhjtotalCount/(float)lxhjtotalCount*100);
|
|
|
|
+ json.put("lxhjbaifenbi", result+"%");
|
|
|
|
+ }
|
|
|
|
+ if(eftotalCount==0) {
|
|
|
|
+ String result = "100";
|
|
|
|
+ json.put("efbaifenbi", result);
|
|
|
|
+ }else {
|
|
|
|
+ String result = numberFormat.format((float)cleftotalCount/(float)eftotalCount*100);
|
|
|
|
+ json.put("efbaifenbi", result);
|
|
|
|
+ }
|
|
|
|
+ if(lxeftotalCount==0) {
|
|
|
|
+ String result = "100"+"%";
|
|
|
|
+ json.put("lxefbaifenbi", result);
|
|
|
|
+ }else {
|
|
|
|
+ String result = numberFormat.format((float)cllxeftotalCount/(float)lxeftotalCount*100);
|
|
|
|
+ json.put("lxefbaifenbi", result+"%");
|
|
|
|
+ }
|
|
|
|
+ if(videototalCount==0) {
|
|
|
|
+ String result = "100";
|
|
|
|
+ json.put("videobaifenbi", result);
|
|
|
|
+ }else {
|
|
|
|
+ String result = numberFormat.format((float)clvideototalCount/(float)videototalCount*100);
|
|
|
|
+ json.put("videobaifenbi", result);
|
|
|
|
+ }
|
|
|
|
+ if(sjtotalCount==0) {
|
|
|
|
+ String result = "100";
|
|
|
|
+ json.put("sjbaifenbi", result);
|
|
|
|
+ }else {
|
|
|
|
+ String result = numberFormat.format((float)clsjtotalCount/(float)sjtotalCount*100);
|
|
|
|
+ json.put("sjbaifenbi", result);
|
|
|
|
+ }
|
|
|
|
+ if(lxsjtotalCount==0) {
|
|
|
|
+ String result = "100"+"%";
|
|
|
|
+ json.put("lxsjbaifenbi", result);
|
|
|
|
+ }else {
|
|
|
|
+ String result = numberFormat.format((float)cllxsjtotalCount/(float)lxsjtotalCount*100);
|
|
|
|
+ json.put("lxsjbaifenbi", result+"%");
|
|
|
|
+ }
|
|
|
|
+ if(rtutotalCount==0) {
|
|
|
|
+ String result = "100";
|
|
|
|
+ json.put("rtubaifenbi", result);
|
|
|
|
+ }else {
|
|
|
|
+ String result = numberFormat.format((float)clrtutotalCount/(float)rtutotalCount*100);
|
|
|
|
+ json.put("rtubaifenbi", result);
|
|
|
|
+ }
|
|
|
|
+ if(lxrtutotalCount==0) {
|
|
|
|
+ String result = "100"+"%";
|
|
|
|
+ json.put("lxrtubaifenbi", result);
|
|
|
|
+ }else {
|
|
|
|
+ String result = numberFormat.format((float)cllxrtutotalCount/(float)lxrtutotalCount*100);
|
|
|
|
+ json.put("lxrtubaifenbi", result+"%");
|
|
|
|
+ }
|
|
|
|
+ if(dwhjtotalCount==0) {
|
|
|
|
+ hjresult = "0";
|
|
|
|
+ lxhjresult = "0";
|
|
|
|
+ }else {
|
|
|
|
+ hjresult = numberFormat.format((float)hjtotalCount/(float)days/(float)dwhjtotalCount);
|
|
|
|
+ lxhjresult = numberFormat.format((float)lxhjtotalCount/(float)days/(float)dwhjtotalCount);
|
|
|
|
+ }
|
|
|
|
+ if(dwsjtotalCount==0) {
|
|
|
|
+ sjresult = "0";
|
|
|
|
+ lxsjresult = "0";
|
|
|
|
+ }else {
|
|
|
|
+ sjresult = numberFormat.format((float)sjtotalCount/(float)days/(float)dwsjtotalCount);
|
|
|
|
+ lxsjresult = numberFormat.format((float)lxsjtotalCount/(float)days/(float)dwsjtotalCount);
|
|
|
|
+ }
|
|
|
|
+ if(dwrtutotalCount==0) {
|
|
|
|
+ rturesult = "0";
|
|
|
|
+ lxrturesult = "0";
|
|
|
|
+ }else {
|
|
|
|
+ rturesult = numberFormat.format((float)rtutotalCount/(float)days/(float)dwrtutotalCount);
|
|
|
|
+ lxrturesult = numberFormat.format((float)lxrtutotalCount/(float)days/(float)dwrtutotalCount);
|
|
|
|
+ }
|
|
|
|
+ if(dweftotalCount==0) {
|
|
|
|
+ efresult = "0";
|
|
|
|
+ lxefresult = "0";
|
|
|
|
+ }else {
|
|
|
|
+ efresult = numberFormat.format((float)eftotalCount/(float)days/(float)dweftotalCount);
|
|
|
|
+ lxefresult = numberFormat.format((float)lxeftotalCount/(float)days/(float)dweftotalCount);
|
|
|
|
+ }
|
|
|
|
+ if(dwvideototalCount==0) {
|
|
|
|
+ videoresult = "0";
|
|
|
|
+ }else {
|
|
|
|
+ videoresult = numberFormat.format((float)videototalCount/(float)days/(float)dwvideototalCount);
|
|
|
|
+ }
|
|
|
|
+ int hjsjrtuCount = hjtotalCount+sjtotalCount+rtutotalCount+eftotalCount+videototalCount;
|
|
|
|
+ String result1 = numberFormat.format((float)hjtotalCount/(float)hjsjrtuCount*100);
|
|
|
|
+ String result2 = numberFormat.format((float)sjtotalCount/(float)hjsjrtuCount*100);
|
|
|
|
+ String result3 = numberFormat.format((float)rtutotalCount/(float)hjsjrtuCount*100);
|
|
|
|
+ String result4 = numberFormat.format((float)eftotalCount/(float)hjsjrtuCount*100);
|
|
|
|
+ String result5 = numberFormat.format((float)videototalCount/(float)hjsjrtuCount*100);
|
|
|
|
+ Map map4 = new HashMap();
|
|
|
|
+ map4.put("lxhjresult", lxhjresult);
|
|
|
|
+ map4.put("lxsjresult", lxsjresult);
|
|
|
|
+ map4.put("lxrturesult", lxrturesult);
|
|
|
|
+ map4.put("lxefresult", lxefresult);
|
|
|
|
+ map4.put("efresult", efresult);
|
|
|
|
+ map4.put("videoresult", videoresult);
|
|
|
|
+ map4.put("dweftotalCount", dweftotalCount);
|
|
|
|
+ map4.put("dwvideototalCount", dwvideototalCount);
|
|
|
|
+ map4.put("eftotalCount", eftotalCount);
|
|
|
|
+ map4.put("cleftotalCount", cleftotalCount);
|
|
|
|
+ map4.put("lxeftotalCount", lxeftotalCount);
|
|
|
|
+ map4.put("cllxeftotalCount", cllxeftotalCount);
|
|
|
|
+ map4.put("videototalCount", videototalCount);
|
|
|
|
+ map4.put("clvideototalCount", clvideototalCount);
|
|
|
|
+ map4.put("result1", result1);
|
|
|
|
+ map4.put("result2", result2);
|
|
|
|
+ map4.put("result3", result3);
|
|
|
|
+ map4.put("result4", result4);
|
|
|
|
+ map4.put("result5", result5);
|
|
|
|
+// map.put("xmlx", g.getXmlx());
|
|
|
|
+ JSONObject jSONObject4 = JSONObject.fromObject(map4);
|
|
|
|
+ jSONArray4.add(jSONObject4);
|
|
|
|
+ json.put("RESULT4", jSONArray4);
|
|
|
|
+ json.put("hjtotalCount", hjtotalCount);
|
|
|
|
+ json.put("clhjtotalCount", clhjtotalCount);
|
|
|
|
+ json.put("lxhjtotalCount", lxhjtotalCount);
|
|
|
|
+ json.put("cllxhjtotalCount", cllxhjtotalCount);
|
|
|
|
+ json.put("sjtotalCount", sjtotalCount);
|
|
|
|
+ json.put("clsjtotalCount", clsjtotalCount);
|
|
|
|
+ json.put("lxsjtotalCount", lxsjtotalCount);
|
|
|
|
+ json.put("cllxsjtotalCount", cllxsjtotalCount);
|
|
|
|
+ json.put("rtutotalCount", rtutotalCount);
|
|
|
|
+ json.put("clrtutotalCount", clrtutotalCount);
|
|
|
|
+ json.put("lxrtutotalCount", lxrtutotalCount);
|
|
|
|
+ json.put("cllxrtutotalCount", cllxrtutotalCount);
|
|
|
|
+ json.put("dwhjtotalCount", dwhjtotalCount);
|
|
|
|
+ json.put("dwsjtotalCount", dwsjtotalCount);
|
|
|
|
+ json.put("dwrtutotalCount", dwrtutotalCount);
|
|
|
|
+ json.put("days", days);
|
|
|
|
+ json.put("hjresult", hjresult);
|
|
|
|
+ json.put("sjresult", sjresult);
|
|
|
|
+ json.put("rturesult", rturesult);
|
|
|
|
+ List list = ytiotVCompanyDao.query1(hqlwhere, null, null, null, null);
|
|
|
|
+ List list1 = ytiotVCompanyDao.query2(hqlwhere, null, null, null, null);
|
|
|
|
+ List list2 = ytiotVCompanyDao.query3(hqlwhere, null, null, null, null);
|
|
|
|
+ List list3 = ytiotVAlarmDao.HJQuery(hswhere, null, null, null, null);
|
|
|
|
+ List list4 = ytiotVAlarmDao.SJQuery(hswhere, null, null, null, null);
|
|
|
|
+ List list5 = ytiotVAlarmDao.RTUQuery(hswhere, null, null, null, null);
|
|
|
|
+
|
|
|
|
+ if(list.size()>0) {
|
|
|
|
+ for(int i=0;i<list.size();i++) {
|
|
|
|
+ YtiotTProjectDetails g = (YtiotTProjectDetails)list.get(0);
|
|
|
|
+// YtiotVCompanyId Id = o.getId();
|
|
|
|
+ Map map = new HashMap();
|
|
|
|
+ map.put("company_name", g.getCompanyName()==null?"":g.getCompanyName());
|
|
|
|
+ map.put("approach_time",g.getApproachTime()==null?"":df.format(g.getApproachTime()));
|
|
|
|
+ map.put("complete_time",g.getCompleteTime()==null?"":df.format(g.getCompleteTime()));
|
|
|
|
+ map.put("check_time", g.getCheckTime()==null?"":df.format(g.getCheckTime()));
|
|
|
|
+// map.put("xmlx", g.getXmlx());
|
|
|
|
+ JSONObject jSONObject = JSONObject.fromObject(map);
|
|
|
|
+ jSONArray.add(jSONObject);
|