Commit a7c322c4799fc9cca235595e41240c606715da70
1 parent
cc334fea
烂班查询报错
Showing
1 changed file
with
13 additions
and
16 deletions
src/main/java/com/bsth/service/impl/BusIntervalServiceImpl.java
| @@ -17,7 +17,6 @@ import java.util.List; | @@ -17,7 +17,6 @@ import java.util.List; | ||
| 17 | import java.util.Map; | 17 | import java.util.Map; |
| 18 | import java.util.Set; | 18 | import java.util.Set; |
| 19 | 19 | ||
| 20 | -import org.apache.commons.lang3.StringEscapeUtils; | ||
| 21 | import org.springframework.beans.factory.annotation.Autowired; | 20 | import org.springframework.beans.factory.annotation.Autowired; |
| 22 | import org.springframework.jdbc.core.BeanPropertyRowMapper; | 21 | import org.springframework.jdbc.core.BeanPropertyRowMapper; |
| 23 | import org.springframework.jdbc.core.JdbcTemplate; | 22 | import org.springframework.jdbc.core.JdbcTemplate; |
| @@ -25,7 +24,6 @@ import org.springframework.jdbc.core.RowMapper; | @@ -25,7 +24,6 @@ import org.springframework.jdbc.core.RowMapper; | ||
| 25 | import org.springframework.stereotype.Service; | 24 | import org.springframework.stereotype.Service; |
| 26 | 25 | ||
| 27 | import com.alibaba.fastjson.JSONArray; | 26 | import com.alibaba.fastjson.JSONArray; |
| 28 | -import com.alibaba.fastjson.JSONObject; | ||
| 29 | import com.bsth.data.BasicData; | 27 | import com.bsth.data.BasicData; |
| 30 | import com.bsth.data.schedule.edit_logs.service.dto.SchEditInfoDto; | 28 | import com.bsth.data.schedule.edit_logs.service.dto.SchEditInfoDto; |
| 31 | import com.bsth.entity.realcontrol.ChildTaskPlan; | 29 | import com.bsth.entity.realcontrol.ChildTaskPlan; |
| @@ -1715,13 +1713,13 @@ public class BusIntervalServiceImpl implements BusIntervalService { | @@ -1715,13 +1713,13 @@ public class BusIntervalServiceImpl implements BusIntervalService { | ||
| 1715 | } | 1713 | } |
| 1716 | } | 1714 | } |
| 1717 | boolean flag = true; | 1715 | boolean flag = true; |
| 1718 | - if(jhlc.toString().equals("0")){ | 1716 | + if(jhlc.doubleValue() == 0d){ |
| 1719 | flag = false; | 1717 | flag = false; |
| 1720 | } | 1718 | } |
| 1721 | tempMap.put("date", Date); | 1719 | tempMap.put("date", Date); |
| 1722 | tempMap.put("company", companyName); | 1720 | tempMap.put("company", companyName); |
| 1723 | tempMap.put("subCompany", subCompanyName); | 1721 | tempMap.put("subCompany", subCompanyName); |
| 1724 | - tempMap.put("times", times); | 1722 | + tempMap.put("times", sfqr == 1 ? times : "全日"); |
| 1725 | tempMap.put("line", key); | 1723 | tempMap.put("line", key); |
| 1726 | tempMap.put("jhbc", jhbc); | 1724 | tempMap.put("jhbc", jhbc); |
| 1727 | tempMap.put("sjbc", sjbc); | 1725 | tempMap.put("sjbc", sjbc); |
| @@ -1732,37 +1730,37 @@ public class BusIntervalServiceImpl implements BusIntervalService { | @@ -1732,37 +1730,37 @@ public class BusIntervalServiceImpl implements BusIntervalService { | ||
| 1732 | tempMap.put("lcbfb", df.format(flag?sjlc.divide(jhlc, 4, BigDecimal.ROUND_HALF_UP).doubleValue()*100:0)+"%"); | 1730 | tempMap.put("lcbfb", df.format(flag?sjlc.divide(jhlc, 4, BigDecimal.ROUND_HALF_UP).doubleValue()*100:0)+"%"); |
| 1733 | tempMap.put("lzbc", lzbc); | 1731 | tempMap.put("lzbc", lzbc); |
| 1734 | tempMap.put("lzlc", lzlc.doubleValue()); | 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 | tempMap.put("dmbc", dmbc); | 1734 | tempMap.put("dmbc", dmbc); |
| 1737 | tempMap.put("dmlc", dmlc.doubleValue()); | 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 | tempMap.put("gzbc", gzbc); | 1737 | tempMap.put("gzbc", gzbc); |
| 1740 | tempMap.put("gzlc", gzlc.doubleValue()); | 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 | tempMap.put("jfbc", jfbc); | 1740 | tempMap.put("jfbc", jfbc); |
| 1743 | tempMap.put("jflc", jflc.doubleValue()); | 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 | tempMap.put("zsbc", zsbc); | 1743 | tempMap.put("zsbc", zsbc); |
| 1746 | tempMap.put("zslc", zslc.doubleValue()); | 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 | tempMap.put("qrbc", qrbc); | 1746 | tempMap.put("qrbc", qrbc); |
| 1749 | tempMap.put("qrlc", qrlc.doubleValue()); | 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 | tempMap.put("qcbc", qcbc); | 1749 | tempMap.put("qcbc", qcbc); |
| 1752 | tempMap.put("qclc", qclc.doubleValue()); | 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 | tempMap.put("kxbc", kxbc); | 1752 | tempMap.put("kxbc", kxbc); |
| 1755 | tempMap.put("kxlc", kxlc.doubleValue()); | 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 | tempMap.put("qhbc", qhbc); | 1755 | tempMap.put("qhbc", qhbc); |
| 1758 | tempMap.put("qhlc", qhlc.doubleValue()); | 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 | tempMap.put("wybc", wybc); | 1758 | tempMap.put("wybc", wybc); |
| 1761 | tempMap.put("wylc", wylc.doubleValue()); | 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 | tempMap.put("qtbc", qtbc); | 1761 | tempMap.put("qtbc", qtbc); |
| 1764 | tempMap.put("qtlc", qtlc.doubleValue()); | 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 | resList.add(tempMap); | 1765 | resList.add(tempMap); |
| 1768 | } | 1766 | } |
| @@ -1784,7 +1782,6 @@ public class BusIntervalServiceImpl implements BusIntervalService { | @@ -1784,7 +1782,6 @@ public class BusIntervalServiceImpl implements BusIntervalService { | ||
| 1784 | e.printStackTrace(); | 1782 | e.printStackTrace(); |
| 1785 | } | 1783 | } |
| 1786 | } | 1784 | } |
| 1787 | - System.out.println(map); | ||
| 1788 | 1785 | ||
| 1789 | return resList; | 1786 | return resList; |
| 1790 | } | 1787 | } |