Commit a7c322c4799fc9cca235595e41240c606715da70

Authored by 娄高锋
1 parent cc334fea

烂班查询报错

src/main/java/com/bsth/service/impl/BusIntervalServiceImpl.java
... ... @@ -17,7 +17,6 @@ import java.util.List;
17 17 import java.util.Map;
18 18 import java.util.Set;
19 19  
20   -import org.apache.commons.lang3.StringEscapeUtils;
21 20 import org.springframework.beans.factory.annotation.Autowired;
22 21 import org.springframework.jdbc.core.BeanPropertyRowMapper;
23 22 import org.springframework.jdbc.core.JdbcTemplate;
... ... @@ -25,7 +24,6 @@ import org.springframework.jdbc.core.RowMapper;
25 24 import org.springframework.stereotype.Service;
26 25  
27 26 import com.alibaba.fastjson.JSONArray;
28   -import com.alibaba.fastjson.JSONObject;
29 27 import com.bsth.data.BasicData;
30 28 import com.bsth.data.schedule.edit_logs.service.dto.SchEditInfoDto;
31 29 import com.bsth.entity.realcontrol.ChildTaskPlan;
... ... @@ -1715,13 +1713,13 @@ public class BusIntervalServiceImpl implements BusIntervalService {
1715 1713 }
1716 1714 }
1717 1715 boolean flag = true;
1718   - if(jhlc.toString().equals("0")){
  1716 + if(jhlc.doubleValue() == 0d){
1719 1717 flag = false;
1720 1718 }
1721 1719 tempMap.put("date", Date);
1722 1720 tempMap.put("company", companyName);
1723 1721 tempMap.put("subCompany", subCompanyName);
1724   - tempMap.put("times", times);
  1722 + tempMap.put("times", sfqr == 1 ? times : "全日");
1725 1723 tempMap.put("line", key);
1726 1724 tempMap.put("jhbc", jhbc);
1727 1725 tempMap.put("sjbc", sjbc);
... ... @@ -1732,37 +1730,37 @@ public class BusIntervalServiceImpl implements BusIntervalService {
1732 1730 tempMap.put("lcbfb", df.format(flag?sjlc.divide(jhlc, 4, BigDecimal.ROUND_HALF_UP).doubleValue()*100:0)+"%");
1733 1731 tempMap.put("lzbc", lzbc);
1734 1732 tempMap.put("lzlc", lzlc.doubleValue());
1735   - tempMap.put("lzbfb", df.format(flag?(double)lzbc/jhbc*100:0)+"%");
  1733 + tempMap.put("lzbfb", df.format(jhbc>0?(double)lzbc/jhbc*100:0)+"%");
1736 1734 tempMap.put("dmbc", dmbc);
1737 1735 tempMap.put("dmlc", dmlc.doubleValue());
1738   - tempMap.put("dmbfb", df.format(flag?(double)dmbc/jhbc*100:0)+"%");
  1736 + tempMap.put("dmbfb", df.format(jhbc>0?(double)dmbc/jhbc*100:0)+"%");
1739 1737 tempMap.put("gzbc", gzbc);
1740 1738 tempMap.put("gzlc", gzlc.doubleValue());
1741   - tempMap.put("gzbfb", df.format(flag?(double)gzbc/jhbc*100:0)+"%");
  1739 + tempMap.put("gzbfb", df.format(jhbc>0?(double)gzbc/jhbc*100:0)+"%");
1742 1740 tempMap.put("jfbc", jfbc);
1743 1741 tempMap.put("jflc", jflc.doubleValue());
1744   - tempMap.put("jfbfb", df.format(flag?(double)jfbc/jhbc*100:0)+"%");
  1742 + tempMap.put("jfbfb", df.format(jhbc>0?(double)jfbc/jhbc*100:0)+"%");
1745 1743 tempMap.put("zsbc", zsbc);
1746 1744 tempMap.put("zslc", zslc.doubleValue());
1747   - tempMap.put("zsbfb", df.format(flag?(double)zsbc/jhbc*100:0)+"%");
  1745 + tempMap.put("zsbfb", df.format(jhbc>0?(double)zsbc/jhbc*100:0)+"%");
1748 1746 tempMap.put("qrbc", qrbc);
1749 1747 tempMap.put("qrlc", qrlc.doubleValue());
1750   - tempMap.put("qrbfb", df.format(flag?(double)qrbc/jhbc*100:0)+"%");
  1748 + tempMap.put("qrbfb", df.format(jhbc>0?(double)qrbc/jhbc*100:0)+"%");
1751 1749 tempMap.put("qcbc", qcbc);
1752 1750 tempMap.put("qclc", qclc.doubleValue());
1753   - tempMap.put("qcbfb", df.format(flag?(double)qcbc/jhbc*100:0)+"%");
  1751 + tempMap.put("qcbfb", df.format(jhbc>0?(double)qcbc/jhbc*100:0)+"%");
1754 1752 tempMap.put("kxbc", kxbc);
1755 1753 tempMap.put("kxlc", kxlc.doubleValue());
1756   - tempMap.put("kxbfb", df.format(flag?(double)kxbc/jhbc*100:0)+"%");
  1754 + tempMap.put("kxbfb", df.format(jhbc>0?(double)kxbc/jhbc*100:0)+"%");
1757 1755 tempMap.put("qhbc", qhbc);
1758 1756 tempMap.put("qhlc", qhlc.doubleValue());
1759   - tempMap.put("qhbfb", df.format(flag?(double)qhbc/jhbc*100:0)+"%");
  1757 + tempMap.put("qhbfb", df.format(jhbc>0?(double)qhbc/jhbc*100:0)+"%");
1760 1758 tempMap.put("wybc", wybc);
1761 1759 tempMap.put("wylc", wylc.doubleValue());
1762   - tempMap.put("wybfb", df.format(flag?(double)wybc/jhbc*100:0)+"%");
  1760 + tempMap.put("wybfb", df.format(jhbc>0?(double)wybc/jhbc*100:0)+"%");
1763 1761 tempMap.put("qtbc", qtbc);
1764 1762 tempMap.put("qtlc", qtlc.doubleValue());
1765   - tempMap.put("qtbfb", df.format(flag?(double)qtbc/jhbc*100:0)+"%");
  1763 + tempMap.put("qtbfb", df.format(jhbc>0?(double)qtbc/jhbc*100:0)+"%");
1766 1764  
1767 1765 resList.add(tempMap);
1768 1766 }
... ... @@ -1784,7 +1782,6 @@ public class BusIntervalServiceImpl implements BusIntervalService {
1784 1782 e.printStackTrace();
1785 1783 }
1786 1784 }
1787   - System.out.println(map);
1788 1785  
1789 1786 return resList;
1790 1787 }
... ...