Commit 0d0e82035df9db9b491ba2f7bac78f2404a70855
1 parent
33403032
rfid线路签卡率报表
Showing
9 changed files
with
1100 additions
and
0 deletions
src/main/java/com/bsth/controller/report/CardIsingningController.java
0 → 100644
| 1 | +package com.bsth.controller.report; | ||
| 2 | + | ||
| 3 | + | ||
| 4 | +import com.bsth.entity.card_signing.CardSigning; | ||
| 5 | +import com.bsth.service.report.CardSigningService; | ||
| 6 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 7 | +import org.springframework.web.bind.annotation.*; | ||
| 8 | + | ||
| 9 | +import java.util.List; | ||
| 10 | +import java.util.Map; | ||
| 11 | + | ||
| 12 | +@RestController | ||
| 13 | +@RequestMapping("CardSigning") | ||
| 14 | +public class CardIsingningController { | ||
| 15 | + @Autowired | ||
| 16 | + CardSigningService cardSigningService; | ||
| 17 | + | ||
| 18 | + //线路插卡率列表 | ||
| 19 | + @RequestMapping(value = "/cardList",method = RequestMethod.GET) | ||
| 20 | + public List<CardSigning> sheetList(@RequestParam Map<String, Object> map){ | ||
| 21 | + List<CardSigning> list= cardSigningService.cardList(map); | ||
| 22 | + return list; | ||
| 23 | + } | ||
| 24 | + | ||
| 25 | + //线路插卡率 线路详细列表第二级 | ||
| 26 | + @RequestMapping(value = "/calcListSheet",method = RequestMethod.GET) | ||
| 27 | + public List<CardSigning> calcListSheet(@RequestParam Map<String, Object> map){ | ||
| 28 | + List<CardSigning> list= cardSigningService.calcListSheet(map); | ||
| 29 | + return list; | ||
| 30 | + } | ||
| 31 | + | ||
| 32 | + //线路插卡率 线路详细列表第二级 | ||
| 33 | + @RequestMapping(value = "/calcSheet",method = RequestMethod.GET) | ||
| 34 | + public List<CardSigning> calcSheet(@RequestParam Map<String, Object> map){ | ||
| 35 | + List<CardSigning> list= cardSigningService.calcSheet(map); | ||
| 36 | + return list; | ||
| 37 | + } | ||
| 38 | + | ||
| 39 | + | ||
| 40 | + | ||
| 41 | + | ||
| 42 | +} |
src/main/java/com/bsth/entity/card_signing/CardSigning.java
0 → 100644
| 1 | +package com.bsth.entity.card_signing; | ||
| 2 | + | ||
| 3 | +import javax.persistence.GeneratedValue; | ||
| 4 | +import javax.persistence.Id; | ||
| 5 | + | ||
| 6 | +public class CardSigning { | ||
| 7 | + /* 主键*/ | ||
| 8 | + @Id | ||
| 9 | + @GeneratedValue | ||
| 10 | + private Integer id; | ||
| 11 | + //公司名称 | ||
| 12 | + private String gsName; | ||
| 13 | + //公司代码 | ||
| 14 | + private String gsBm; | ||
| 15 | + //分公司名称 | ||
| 16 | + private String fgsName; | ||
| 17 | + //分公司代码 | ||
| 18 | + private String fgsBm; | ||
| 19 | + //线路名称 | ||
| 20 | + private String xlName; | ||
| 21 | + //线路代码 | ||
| 22 | + private String xlBm; | ||
| 23 | + //时间 | ||
| 24 | + private String scheduleDateStr; | ||
| 25 | + //班次数 | ||
| 26 | + private Integer bcs; | ||
| 27 | + //签卡数 | ||
| 28 | + private Integer qks; | ||
| 29 | + /* //签卡率 | ||
| 30 | + private Double qkl;*/ | ||
| 31 | + //签卡率 | ||
| 32 | + private String qklName; | ||
| 33 | + //人卡故障数 | ||
| 34 | + private Integer rkgzs; | ||
| 35 | + /*//人卡故障率 | ||
| 36 | + private double rkgzl;*/ | ||
| 37 | + //人卡故障率 | ||
| 38 | + private String rkgzlName; | ||
| 39 | + //车卡故障数 | ||
| 40 | + private Integer ckgzs; | ||
| 41 | + /* //车卡故障率 | ||
| 42 | + private double ckgzl;*/ | ||
| 43 | + //车卡故障率 | ||
| 44 | + private String ckgzlName; | ||
| 45 | + //起点站 | ||
| 46 | + private String qdzName; | ||
| 47 | + //rfid状态 | ||
| 48 | + private Integer rfidState; | ||
| 49 | + //是否故障 | ||
| 50 | + private String rfidName; | ||
| 51 | + /** 计划发车时间(格式 HH:mm) */ | ||
| 52 | + private String fcsj; | ||
| 53 | + /** 实际发车时间*/ | ||
| 54 | + private String fcsjActual; | ||
| 55 | + | ||
| 56 | + public String getFcsj() { | ||
| 57 | + return fcsj; | ||
| 58 | + } | ||
| 59 | + | ||
| 60 | + public void setFcsj(String fcsj) { | ||
| 61 | + this.fcsj = fcsj; | ||
| 62 | + } | ||
| 63 | + | ||
| 64 | + public String getFcsjActual() { | ||
| 65 | + return fcsjActual; | ||
| 66 | + } | ||
| 67 | + | ||
| 68 | + public void setFcsjActual(String fcsjActual) { | ||
| 69 | + this.fcsjActual = fcsjActual; | ||
| 70 | + } | ||
| 71 | + | ||
| 72 | + public String getQdzName() { | ||
| 73 | + return qdzName; | ||
| 74 | + } | ||
| 75 | + | ||
| 76 | + public void setQdzName(String qdzName) { | ||
| 77 | + this.qdzName = qdzName; | ||
| 78 | + } | ||
| 79 | + | ||
| 80 | + public Integer getRfidState() { | ||
| 81 | + return rfidState; | ||
| 82 | + } | ||
| 83 | + | ||
| 84 | + public void setRfidState(Integer rfidState) { | ||
| 85 | + this.rfidState = rfidState; | ||
| 86 | + } | ||
| 87 | + | ||
| 88 | + public String getRfidName() { | ||
| 89 | + return rfidName; | ||
| 90 | + } | ||
| 91 | + | ||
| 92 | + public Integer getId() { | ||
| 93 | + return id; | ||
| 94 | + } | ||
| 95 | + | ||
| 96 | + public void setId(Integer id) { | ||
| 97 | + this.id = id; | ||
| 98 | + } | ||
| 99 | + | ||
| 100 | + public String getGsName() { | ||
| 101 | + return gsName; | ||
| 102 | + } | ||
| 103 | + | ||
| 104 | + public void setGsName(String gsName) { | ||
| 105 | + this.gsName = gsName; | ||
| 106 | + } | ||
| 107 | + | ||
| 108 | + public String getGsBm() { | ||
| 109 | + return gsBm; | ||
| 110 | + } | ||
| 111 | + | ||
| 112 | + public void setGsBm(String gsBm) { | ||
| 113 | + this.gsBm = gsBm; | ||
| 114 | + } | ||
| 115 | + | ||
| 116 | + public String getFgsName() { | ||
| 117 | + return fgsName; | ||
| 118 | + } | ||
| 119 | + | ||
| 120 | + public void setFgsName(String fgsName) { | ||
| 121 | + this.fgsName = fgsName; | ||
| 122 | + } | ||
| 123 | + | ||
| 124 | + public String getFgsBm() { | ||
| 125 | + return fgsBm; | ||
| 126 | + } | ||
| 127 | + | ||
| 128 | + public Integer getBcs() { | ||
| 129 | + return bcs; | ||
| 130 | + } | ||
| 131 | + | ||
| 132 | + public void setBcs(Integer bcs) { | ||
| 133 | + this.bcs = bcs; | ||
| 134 | + } | ||
| 135 | + | ||
| 136 | + public void setFgsBm(String fgsBm) { | ||
| 137 | + this.fgsBm = fgsBm; | ||
| 138 | + } | ||
| 139 | + | ||
| 140 | + public String getXlName() { | ||
| 141 | + return xlName; | ||
| 142 | + } | ||
| 143 | + | ||
| 144 | + public void setXlName(String xlName) { | ||
| 145 | + this.xlName = xlName; | ||
| 146 | + } | ||
| 147 | + | ||
| 148 | + public String getXlBm() { | ||
| 149 | + return xlBm; | ||
| 150 | + } | ||
| 151 | + | ||
| 152 | + public void setXlBm(String xlBm) { | ||
| 153 | + this.xlBm = xlBm; | ||
| 154 | + } | ||
| 155 | + | ||
| 156 | + public String getScheduleDateStr() { | ||
| 157 | + return scheduleDateStr; | ||
| 158 | + } | ||
| 159 | + | ||
| 160 | + public void setScheduleDateStr(String scheduleDateStr) { | ||
| 161 | + this.scheduleDateStr = scheduleDateStr; | ||
| 162 | + } | ||
| 163 | + | ||
| 164 | + public Integer getQks() { | ||
| 165 | + return qks; | ||
| 166 | + } | ||
| 167 | + | ||
| 168 | + public void setQks(Integer qks) { | ||
| 169 | + this.qks = qks; | ||
| 170 | + } | ||
| 171 | + | ||
| 172 | + public Integer getRkgzs() { | ||
| 173 | + return rkgzs; | ||
| 174 | + } | ||
| 175 | + | ||
| 176 | + public void setRkgzs(Integer rkgzs) { | ||
| 177 | + this.rkgzs = rkgzs; | ||
| 178 | + } | ||
| 179 | + | ||
| 180 | + public Integer getCkgzs() { | ||
| 181 | + return ckgzs; | ||
| 182 | + } | ||
| 183 | + | ||
| 184 | + public void setCkgzs(Integer ckgzs) { | ||
| 185 | + this.ckgzs = ckgzs; | ||
| 186 | + } | ||
| 187 | + | ||
| 188 | + public String getQklName() { | ||
| 189 | + return qklName; | ||
| 190 | + } | ||
| 191 | + | ||
| 192 | + public void setQklName(String qklName) { | ||
| 193 | + this.qklName = qklName; | ||
| 194 | + } | ||
| 195 | + | ||
| 196 | + public String getRkgzlName() { | ||
| 197 | + return rkgzlName; | ||
| 198 | + } | ||
| 199 | + | ||
| 200 | + public void setRkgzlName(String rkgzlName) { | ||
| 201 | + this.rkgzlName = rkgzlName; | ||
| 202 | + } | ||
| 203 | + | ||
| 204 | + public String getCkgzlName() { | ||
| 205 | + return ckgzlName; | ||
| 206 | + } | ||
| 207 | + | ||
| 208 | + public void setCkgzlName(String ckgzlName) { | ||
| 209 | + this.ckgzlName = ckgzlName; | ||
| 210 | + } | ||
| 211 | + | ||
| 212 | + public void setRfidName(String rfidName) { | ||
| 213 | + this.rfidName = rfidName; | ||
| 214 | + } | ||
| 215 | +} |
src/main/java/com/bsth/service/report/CardSigningService.java
0 → 100644
| 1 | +package com.bsth.service.report; | ||
| 2 | + | ||
| 3 | +import com.bsth.entity.card_signing.CardSigning; | ||
| 4 | + | ||
| 5 | +import java.util.List; | ||
| 6 | +import java.util.Map; | ||
| 7 | + | ||
| 8 | +public interface CardSigningService { | ||
| 9 | + | ||
| 10 | + public List<CardSigning> cardList(Map<String, Object> map); | ||
| 11 | + | ||
| 12 | + | ||
| 13 | + public List<CardSigning> calcListSheet(Map<String, Object> map); | ||
| 14 | + | ||
| 15 | + | ||
| 16 | + public List<CardSigning> calcSheet(Map<String, Object> map); | ||
| 17 | + | ||
| 18 | + | ||
| 19 | + | ||
| 20 | +} |
src/main/java/com/bsth/service/report/impl/CardSigningServiceImpl.java
0 → 100644
| 1 | +package com.bsth.service.report.impl; | ||
| 2 | + | ||
| 3 | +import com.bsth.entity.card_signing.CardSigning; | ||
| 4 | +import com.bsth.service.report.CardSigningService; | ||
| 5 | +import com.bsth.util.ReportUtils; | ||
| 6 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 7 | +import org.springframework.jdbc.core.JdbcTemplate; | ||
| 8 | +import org.springframework.jdbc.core.RowMapper; | ||
| 9 | +import org.springframework.stereotype.Service; | ||
| 10 | + | ||
| 11 | +import java.sql.ResultSet; | ||
| 12 | +import java.sql.SQLException; | ||
| 13 | +import java.text.DecimalFormat; | ||
| 14 | +import java.util.*; | ||
| 15 | + | ||
| 16 | +@Service | ||
| 17 | +public class CardSigningServiceImpl implements CardSigningService { | ||
| 18 | + | ||
| 19 | + @Autowired | ||
| 20 | + JdbcTemplate jdbcTemplate; | ||
| 21 | + @Override | ||
| 22 | + public List<CardSigning> cardList(Map<String, Object> map) { | ||
| 23 | + final DecimalFormat df = new DecimalFormat("0.00"); | ||
| 24 | + String line=""; | ||
| 25 | + if(map.get("line")!=null){ | ||
| 26 | + line =map.get("line").toString().trim(); | ||
| 27 | + } | ||
| 28 | + String gs=""; | ||
| 29 | + if(map.get("gs")!=null){ | ||
| 30 | + gs=map.get("gs").toString().trim(); | ||
| 31 | + } | ||
| 32 | + String fgs=""; | ||
| 33 | + if(map.get("fgs")!=null){ | ||
| 34 | + fgs=map.get("fgs").toString().trim(); | ||
| 35 | + } | ||
| 36 | + String nature="0"; | ||
| 37 | + if(map.get("nature")!=null){ | ||
| 38 | + nature=map.get("nature").toString(); | ||
| 39 | + } | ||
| 40 | + | ||
| 41 | + String date=map.get("date").toString(); | ||
| 42 | + String endDate=map.get("endDate").toString(); | ||
| 43 | + String sql="select gs_name,gs_bm,fgs_name,fgs_bm,xl_name,xl_bm,sum(bcs) as bcs,sum(qks) as qks," + | ||
| 44 | + " avg(qkl) as qkl,sum(rkgzs) as rkgzs,avg(rkgzl) as rkgzl ,avg(ckgzs) as ckgzs ,avg(ckgzl) as ckgzl " + | ||
| 45 | + "from card_signing where schedule_date_str BETWEEN '"+date+"' and '"+endDate+"'"; | ||
| 46 | + if(line.trim().equals("")){ | ||
| 47 | + sql +=" and gs_bm = '"+gs+"' and fgs_bm like '%"+fgs+"%'"; | ||
| 48 | + }else{ | ||
| 49 | + sql +=" and xl_bm ='"+line+"'"; | ||
| 50 | + } | ||
| 51 | + sql +=" group by xl_name"; | ||
| 52 | + //条件下所有路单 | ||
| 53 | + List<CardSigning> list=jdbcTemplate.query(sql, | ||
| 54 | + new RowMapper<CardSigning>(){ | ||
| 55 | + @Override | ||
| 56 | + public CardSigning mapRow(ResultSet rs, int rowNum) throws SQLException { | ||
| 57 | + CardSigning s=new CardSigning(); | ||
| 58 | + s.setGsName(rs.getString("gs_name")); | ||
| 59 | + s.setGsBm(rs.getString("gs_bm")); | ||
| 60 | + s.setFgsName(rs.getString("fgs_name")); | ||
| 61 | + s.setFgsBm(rs.getString("fgs_bm")); | ||
| 62 | + s.setXlName(rs.getString("xl_name")); | ||
| 63 | + s.setXlBm(rs.getString("xl_bm")); | ||
| 64 | + s.setBcs(rs.getInt("bcs")); | ||
| 65 | + s.setQks(rs.getInt("qks")); | ||
| 66 | + s.setQklName(df.format(rs.getDouble("qkl"))+"%"); | ||
| 67 | + s.setRkgzs(rs.getInt("rkgzs")); | ||
| 68 | + s.setRkgzlName(df.format(rs.getDouble("rkgzl"))+"%"); | ||
| 69 | + s.setCkgzs(rs.getInt("ckgzs")); | ||
| 70 | + s.setCkgzlName(df.format(rs.getDouble("ckgzl"))+"%"); | ||
| 71 | + return s; | ||
| 72 | + } | ||
| 73 | + }); | ||
| 74 | + | ||
| 75 | + | ||
| 76 | + if(map.get("type").equals("export")){ | ||
| 77 | + List<Map<String, Object>> listmap=new ArrayList<Map<String, Object>>(); | ||
| 78 | + for (CardSigning c:list) { | ||
| 79 | + Map<String, Object> m=new HashMap<String,Object>(); | ||
| 80 | + m.put("gs", c.getGsName()); | ||
| 81 | + m.put("fgs", c.getFgsName()); | ||
| 82 | + m.put("line", c.getXlName()); | ||
| 83 | + m.put("bcs", c.getBcs()); | ||
| 84 | + m.put("qks", c.getQks()); | ||
| 85 | + m.put("qkl", c.getQklName()); | ||
| 86 | + m.put("rkgzs", c.getRkgzs()); | ||
| 87 | + m.put("rkgzl", c.getRkgzlName()); | ||
| 88 | + m.put("ckgzs", c.getCkgzs()); | ||
| 89 | + m.put("ckgzl", c.getCkgzlName()); | ||
| 90 | + listmap.add(m); | ||
| 91 | + } | ||
| 92 | + | ||
| 93 | + List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | ||
| 94 | + Map<String, Object> m = new HashMap<String, Object>(); | ||
| 95 | + m.put("date", date); | ||
| 96 | + m.put("endDate", endDate); | ||
| 97 | + ReportUtils ee = new ReportUtils(); | ||
| 98 | + try { | ||
| 99 | + String dateTime = ""; | ||
| 100 | + if(date.equals(endDate)){ | ||
| 101 | + dateTime = date.replaceAll("-", ""); | ||
| 102 | + } else { | ||
| 103 | + dateTime = date.replaceAll("-", "")+"-"+ | ||
| 104 | + endDate.replaceAll("-", ""); | ||
| 105 | + } | ||
| 106 | + listI.add(listmap.iterator()); | ||
| 107 | + String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; | ||
| 108 | + ee.excelReplace(listI, new Object[]{m}, path + "mould/" + "cardSheetList.xls", | ||
| 109 | + path + "export/"+dateTime+"-签卡率.xls"); | ||
| 110 | + } catch (Exception e) { | ||
| 111 | + // TODO: handle exception | ||
| 112 | + e.printStackTrace(); | ||
| 113 | + } | ||
| 114 | + } | ||
| 115 | + return list; | ||
| 116 | + } | ||
| 117 | + | ||
| 118 | + | ||
| 119 | + | ||
| 120 | + @Override | ||
| 121 | + public List<CardSigning> calcListSheet(Map<String, Object> map) { | ||
| 122 | + String line=map.get("line").toString(); | ||
| 123 | + String date=map.get("date").toString(); | ||
| 124 | + String endDate=map.get("endDate").toString(); | ||
| 125 | + final DecimalFormat df = new DecimalFormat("0.00"); | ||
| 126 | + String sql="select gs_name,gs_bm,fgs_name,fgs_bm,xl_name," + | ||
| 127 | + "xl_bm,schedule_date_str,bcs,qks,qkl,rkgzs,rkgzl,ckgzs,ckgzl from card_signing " + | ||
| 128 | + "where schedule_date_str BETWEEN '"+date+"' and '"+endDate+"' and xl_bm = '"+line+"'" ; | ||
| 129 | + | ||
| 130 | + //条件下所有路单 | ||
| 131 | + List<CardSigning> list=jdbcTemplate.query(sql, | ||
| 132 | + new RowMapper<CardSigning>(){ | ||
| 133 | + @Override | ||
| 134 | + public CardSigning mapRow(ResultSet rs, int rowNum) throws SQLException { | ||
| 135 | + CardSigning s=new CardSigning(); | ||
| 136 | + s.setGsName(rs.getString("gs_name")); | ||
| 137 | + s.setGsBm(rs.getString("gs_bm")); | ||
| 138 | + s.setFgsName(rs.getString("fgs_name")); | ||
| 139 | + s.setFgsBm(rs.getString("fgs_bm")); | ||
| 140 | + s.setXlName(rs.getString("xl_name")); | ||
| 141 | + s.setXlBm(rs.getString("xl_bm")); | ||
| 142 | + s.setBcs(rs.getInt("bcs")); | ||
| 143 | + s.setRkgzs(rs.getInt("rkgzs")); | ||
| 144 | + s.setRkgzlName(df.format(rs.getDouble("rkgzl"))+"%"); | ||
| 145 | + s.setCkgzs(rs.getInt("ckgzs")); | ||
| 146 | + s.setCkgzlName(df.format(rs.getDouble("ckgzl"))+"%"); | ||
| 147 | + s.setScheduleDateStr(rs.getString("schedule_date_str")); | ||
| 148 | + return s; | ||
| 149 | + } | ||
| 150 | + }); | ||
| 151 | + | ||
| 152 | + | ||
| 153 | + | ||
| 154 | + if(map.get("type").equals("export")){ | ||
| 155 | + List<Map<String, Object>> listmap=new ArrayList<Map<String, Object>>(); | ||
| 156 | + for (CardSigning c:list) { | ||
| 157 | + Map<String, Object> m=new HashMap<String,Object>(); | ||
| 158 | + m.put("gs", c.getGsName()); | ||
| 159 | + m.put("fgs", c.getFgsName()); | ||
| 160 | + m.put("schedule_date_str", c.getScheduleDateStr()); | ||
| 161 | + m.put("line", c.getXlName()); | ||
| 162 | + m.put("bcs", c.getBcs()); | ||
| 163 | + m.put("rkgzs", c.getRkgzs()); | ||
| 164 | + m.put("rkgzl", c.getRkgzlName()); | ||
| 165 | + m.put("ckgzs", c.getCkgzs()); | ||
| 166 | + m.put("ckgzl", c.getCkgzlName()); | ||
| 167 | + listmap.add(m); | ||
| 168 | + } | ||
| 169 | + | ||
| 170 | + List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | ||
| 171 | + Map<String, Object> m = new HashMap<String, Object>(); | ||
| 172 | + m.put("date", date); | ||
| 173 | + m.put("endDate", endDate); | ||
| 174 | + ReportUtils ee = new ReportUtils(); | ||
| 175 | + try { | ||
| 176 | + String dateTime = ""; | ||
| 177 | + if(date.equals(endDate)){ | ||
| 178 | + dateTime = date.replaceAll("-", ""); | ||
| 179 | + } else { | ||
| 180 | + dateTime = date.replaceAll("-", "")+"-"+ | ||
| 181 | + endDate.replaceAll("-", ""); | ||
| 182 | + } | ||
| 183 | + listI.add(listmap.iterator()); | ||
| 184 | + String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; | ||
| 185 | + ee.excelReplace(listI, new Object[]{m}, path + "mould/" + "cardSheetList1.xls", | ||
| 186 | + path + "export/班次故障率"+date.replaceAll("-", "")+"-"+endDate.replaceAll("-", "")+".xls"); | ||
| 187 | + } catch (Exception e) { | ||
| 188 | + // TODO: handle exception | ||
| 189 | + e.printStackTrace(); | ||
| 190 | + } | ||
| 191 | + } | ||
| 192 | + | ||
| 193 | + return list; | ||
| 194 | + } | ||
| 195 | + | ||
| 196 | + @Override | ||
| 197 | + public List<CardSigning> calcSheet(Map<String, Object> map) { | ||
| 198 | + String line=map.get("line").toString(); | ||
| 199 | + String date=map.get("date").toString(); | ||
| 200 | + String dir =map.get("dir").toString(); | ||
| 201 | + String sql="select gs_name,gs_bm,fgs_name,fgs_bm, xl_name,xl_bm,schedule_date_str ,qdz_name,rfid_state,fcsj,fcsj_actual " + | ||
| 202 | + "from bsth_c_s_sp_info_real where schedule_date_str = '"+date+"' and xl_bm = '"+line+"' and bc_type='normal' ORDER BY qdz_name,fcsj" ; | ||
| 203 | + //条件下所有路单 | ||
| 204 | + List<CardSigning> list=jdbcTemplate.query(sql, | ||
| 205 | + new RowMapper<CardSigning>(){ | ||
| 206 | + @Override | ||
| 207 | + public CardSigning mapRow(ResultSet rs, int rowNum) throws SQLException { | ||
| 208 | + CardSigning s=new CardSigning(); | ||
| 209 | + s.setGsName(rs.getString("gs_name")); | ||
| 210 | + s.setGsBm(rs.getString("gs_bm")); | ||
| 211 | + s.setFgsName(rs.getString("fgs_name")); | ||
| 212 | + s.setFgsBm(rs.getString("fgs_bm")); | ||
| 213 | + s.setXlName(rs.getString("xl_name")); | ||
| 214 | + s.setXlBm(rs.getString("xl_bm")); | ||
| 215 | + s.setScheduleDateStr(rs.getString("schedule_date_str")); | ||
| 216 | + s.setQdzName(rs.getString("qdz_name")); | ||
| 217 | + s.setRfidState(rs.getInt("rfid_state")); | ||
| 218 | + s.setFcsj(rs.getString("fcsj")); | ||
| 219 | + s.setFcsjActual(rs.getString("fcsj_actual")); | ||
| 220 | + return s; | ||
| 221 | + } | ||
| 222 | + }); | ||
| 223 | + | ||
| 224 | + for (CardSigning c : list){ | ||
| 225 | + String sty = decimalToBinary(c.getRfidState()); | ||
| 226 | + Integer state = Integer.parseInt(sty); | ||
| 227 | + if(dir.equals("1")) { | ||
| 228 | + | ||
| 229 | + if ((state & 4) == 4) { | ||
| 230 | + c.setRfidName("正常"); | ||
| 231 | + } else { | ||
| 232 | + c.setRfidName("人卡故障"); | ||
| 233 | + } | ||
| 234 | + }else { | ||
| 235 | + if ((state & 4) == 4 || (state & 2) == 2) { | ||
| 236 | + c.setRfidName("正常"); | ||
| 237 | + }else { | ||
| 238 | + c.setRfidName("车卡故障"); | ||
| 239 | + } | ||
| 240 | + } | ||
| 241 | + } | ||
| 242 | + | ||
| 243 | + if(map.get("type").equals("export")){ | ||
| 244 | + List<Map<String, Object>> listmap=new ArrayList<Map<String, Object>>(); | ||
| 245 | + int i = 0; | ||
| 246 | + for (CardSigning c:list) { | ||
| 247 | + Map<String, Object> m=new HashMap<String,Object>(); | ||
| 248 | + i++; | ||
| 249 | + m.put("id",i); | ||
| 250 | + m.put("schedule_date_str", c.getScheduleDateStr()); | ||
| 251 | + m.put("line", c.getXlName()); | ||
| 252 | + m.put("qdz_name", c.getQdzName()); | ||
| 253 | + m.put("fcsj", c.getFcsj()); | ||
| 254 | + m.put("fcsj_actual", c.getFcsjActual()); | ||
| 255 | + m.put("rfidname", c.getRfidName()); | ||
| 256 | + listmap.add(m); | ||
| 257 | + } | ||
| 258 | + String fileName=""; | ||
| 259 | + if(dir.equals("1")){ | ||
| 260 | + fileName="人卡故障率"+date; | ||
| 261 | + }else{ | ||
| 262 | + fileName="车卡故障率"+date; | ||
| 263 | + } | ||
| 264 | + List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | ||
| 265 | + Map<String, Object> m = new HashMap<String, Object>(); | ||
| 266 | + m.put("date", date); | ||
| 267 | + ReportUtils ee = new ReportUtils(); | ||
| 268 | + try { | ||
| 269 | + listI.add(listmap.iterator()); | ||
| 270 | + String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; | ||
| 271 | + ee.excelReplace(listI, new Object[]{m}, path + "mould/" + "cardSheetList2.xls", | ||
| 272 | + path + "export/"+fileName+".xls"); | ||
| 273 | + } catch (Exception e) { | ||
| 274 | + // TODO: handle exception | ||
| 275 | + e.printStackTrace(); | ||
| 276 | + } | ||
| 277 | + } | ||
| 278 | + | ||
| 279 | + | ||
| 280 | + return list; | ||
| 281 | + } | ||
| 282 | + | ||
| 283 | + | ||
| 284 | + public static String decimalToBinary(int n) { | ||
| 285 | + String str = ""; | ||
| 286 | + if(n == 0){ | ||
| 287 | + return str = "0"; | ||
| 288 | + } | ||
| 289 | + while (n != 0) { | ||
| 290 | + str = n % 2 + str; | ||
| 291 | + n = n / 2; | ||
| 292 | + } | ||
| 293 | + return str; | ||
| 294 | + } | ||
| 295 | + | ||
| 296 | + | ||
| 297 | + | ||
| 298 | +} |
src/main/resources/static/pages/forms/mould/cardSheetList.xls
0 → 100644
No preview for this file type
src/main/resources/static/pages/forms/mould/cardSheetList1.xls
0 → 100644
No preview for this file type
src/main/resources/static/pages/forms/mould/cardSheetList2.xls
0 → 100644
No preview for this file type
src/main/resources/static/pages/report/cardInsertion/cardInsertionList.html
0 → 100644
| 1 | +<style type="text/css"> | ||
| 2 | + .table-bordered { | ||
| 3 | + border: 1px solid; } | ||
| 4 | + .table-bordered > thead > tr > th, | ||
| 5 | + .table-bordered > thead > tr > td, | ||
| 6 | + .table-bordered > tbody > tr > th, | ||
| 7 | + .table-bordered > tbody > tr > td, | ||
| 8 | + .table-bordered > tfoot > tr > th, | ||
| 9 | + .table-bordered > tfoot > tr > td { | ||
| 10 | + border: 1px solid; } | ||
| 11 | + .table-bordered > thead > tr > th, | ||
| 12 | + .table-bordered > thead > tr > td { | ||
| 13 | + border-bottom-width: 2px; } | ||
| 14 | + | ||
| 15 | + .table > tbody + tbody { | ||
| 16 | + border-top: 1px solid; } | ||
| 17 | +</style> | ||
| 18 | + | ||
| 19 | +<div class="page-head"> | ||
| 20 | + <div class="page-title"> | ||
| 21 | + <h1>线路签卡率</h1> | ||
| 22 | + </div> | ||
| 23 | +</div> | ||
| 24 | + | ||
| 25 | +<div class="row"> | ||
| 26 | + <div class="col-md-12"> | ||
| 27 | + <div class="portlet light porttlet-fit bordered"> | ||
| 28 | + <div class="portlet-title"> | ||
| 29 | + <form class="form-inline" action=""> | ||
| 30 | + <div style="display: inline-block; margin-left: 61px;" id="gsdmDiv"> | ||
| 31 | + <span class="item-label" style="width: 80px;">公司: </span> <select | ||
| 32 | + class="form-control" name="company" id="gsdm" | ||
| 33 | + style="width: 180px;"></select> | ||
| 34 | + </div> | ||
| 35 | + <div style="display: inline-block; margin-left: 38px;" | ||
| 36 | + id="fgsdmDiv"> | ||
| 37 | + <span class="item-label" style="width: 80px;">分公司: </span> <select | ||
| 38 | + class="form-control" name="subCompany" id="fgsdm" | ||
| 39 | + style="width: 180px;"></select> | ||
| 40 | + </div> | ||
| 41 | + | ||
| 42 | + <div style="display: inline-block; margin-left: 53px;"> | ||
| 43 | + <span class="item-label" style="width: 80px;">线路: </span> <select | ||
| 44 | + class="form-control" name="line" id="line" style="width: 180px;"></select> | ||
| 45 | + </div> | ||
| 46 | + <div style="margin-top: 10px"></div> | ||
| 47 | + <div style="display: inline-block; margin-left: 33px;"> | ||
| 48 | + <span class="item-label" style="width: 80px;">线路性质: </span> <select | ||
| 49 | + class="form-control" name="nature" id="nature" | ||
| 50 | + style="width: 180px;"> | ||
| 51 | + <option value="0">全部线路</option> | ||
| 52 | + <option value="1" selected="selected">营运线路</option> | ||
| 53 | + <option value="2">非营运线路</option> | ||
| 54 | + </select> | ||
| 55 | + </div> | ||
| 56 | + <div style="display: inline-block;"> | ||
| 57 | + <span class="item-label" style="width: 80px; margin-left: 24px;">开始时间: | ||
| 58 | + </span> <input class="form-control" type="text" id="date" | ||
| 59 | + style="width: 180px;" /> | ||
| 60 | + </div> | ||
| 61 | + <div style="display: inline-block;"> | ||
| 62 | + <span class="item-label" style="width: 80px; margin-left: 24px;">结束时间: | ||
| 63 | + </span> <input class="form-control" type="text" id="endDate" | ||
| 64 | + style="width: 180px;" /> | ||
| 65 | + </div> | ||
| 66 | + | ||
| 67 | + <div class="form-group"> | ||
| 68 | + <input type="hidden" id="id" /> <input class="btn btn-default" | ||
| 69 | + type="button" id="query" value="查询" /> <input | ||
| 70 | + class="btn btn-default" type="button" id="export" value="导出" /> | ||
| 71 | + </div> | ||
| 72 | + </form> | ||
| 73 | + </div> | ||
| 74 | + <div class="portlet-body"> | ||
| 75 | + <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px"> | ||
| 76 | + <table class="table table-bordered table-hover table-checkable" id="forms"> | ||
| 77 | + <thead> | ||
| 78 | + <tr> | ||
| 79 | + <td>公司</td> | ||
| 80 | + <td>分公司</td> | ||
| 81 | + <td>线路</td> | ||
| 82 | + <td>班次数</td> | ||
| 83 | + <td>签卡班次</td> | ||
| 84 | + <td>签卡率</td> | ||
| 85 | + <td>人卡故障班次</td> | ||
| 86 | + <td>人卡故障率</td> | ||
| 87 | + <td>车卡故障班次</td> | ||
| 88 | + <td>车卡故障数率</td> | ||
| 89 | + <td>查看</td> | ||
| 90 | + </tr> | ||
| 91 | + </thead> | ||
| 92 | + | ||
| 93 | + <tbody> | ||
| 94 | + | ||
| 95 | + </tbody> | ||
| 96 | + </table> | ||
| 97 | + | ||
| 98 | + | ||
| 99 | + </div> | ||
| 100 | + | ||
| 101 | + <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px"> | ||
| 102 | + <input class="btn btn-default hidden" type="button" id="export_1" value="导出"/> | ||
| 103 | + <table class="table table-bordered table-hover table-checkable" id="forms_1"> | ||
| 104 | + <thead> | ||
| 105 | + <tr class="hidden"> | ||
| 106 | + <td>公司</td> | ||
| 107 | + <td>分公司</td> | ||
| 108 | + <td>线路</td> | ||
| 109 | + <td>日期</td> | ||
| 110 | + <td>班次数</td> | ||
| 111 | + <td>人卡故障班次</td> | ||
| 112 | + <td>人卡故障率</td> | ||
| 113 | + <td>查看</td> | ||
| 114 | + <td>车卡故障班次</td> | ||
| 115 | + <td>车卡故障率</td> | ||
| 116 | + <td>查看</td> | ||
| 117 | + </tr> | ||
| 118 | + </thead> | ||
| 119 | + | ||
| 120 | + <tbody> | ||
| 121 | + | ||
| 122 | + </tbody> | ||
| 123 | + </table> | ||
| 124 | + | ||
| 125 | + </div> | ||
| 126 | + </div> | ||
| 127 | + </div> | ||
| 128 | + </div> | ||
| 129 | +</div> | ||
| 130 | +<script src="/pages/mforms/singledatas/jquery.table2excel.min.js"></script> | ||
| 131 | +<script> | ||
| 132 | + $(function(){ | ||
| 133 | + // 关闭左侧栏 | ||
| 134 | + if (!$('body').hasClass('page-sidebar-closed')) | ||
| 135 | + $('.menu-toggler.sidebar-toggler').click(); | ||
| 136 | + | ||
| 137 | + var d = new Date(); | ||
| 138 | + d.setTime(d.getTime() - 1*1000*60*60*24); | ||
| 139 | + var year = d.getFullYear(); | ||
| 140 | + var month = d.getMonth() + 1; | ||
| 141 | + var day = d.getDate(); | ||
| 142 | + if(month < 10) | ||
| 143 | + month = "0"+month; | ||
| 144 | + if(day < 10) | ||
| 145 | + day = "0"+day; | ||
| 146 | + var dateTime = year + "-" + month + "-" + day; | ||
| 147 | + $("#date").datetimepicker({ | ||
| 148 | + format : 'YYYY-MM-DD', | ||
| 149 | + locale : 'zh-cn', | ||
| 150 | + maxDate : dateTime | ||
| 151 | + }); | ||
| 152 | + $("#endDate").datetimepicker({ | ||
| 153 | + format : 'YYYY-MM-DD', | ||
| 154 | + locale : 'zh-cn', | ||
| 155 | + maxDate : dateTime | ||
| 156 | + }); | ||
| 157 | + $("#date").val(dateTime); | ||
| 158 | + $("#endDate").val(dateTime); | ||
| 159 | + | ||
| 160 | + var fage=true; | ||
| 161 | + var obj = []; | ||
| 162 | + var xlList; | ||
| 163 | + $.get('/report/lineList',function(result){ | ||
| 164 | + xlList=result; | ||
| 165 | + | ||
| 166 | + $.get('/user/companyData', function(result){ | ||
| 167 | + obj = result; | ||
| 168 | + var options = ''; | ||
| 169 | + for(var i = 0; i < obj.length; i++){ | ||
| 170 | + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>'; | ||
| 171 | + } | ||
| 172 | + if(obj.length ==0){ | ||
| 173 | + $("#gsdmDiv").css('display','none'); | ||
| 174 | + }else if(obj.length ==1){ | ||
| 175 | + $("#gsdmDiv").css('display','none'); | ||
| 176 | + if(obj[0].children.length == 1 || obj[0].children.length ==0){ | ||
| 177 | + $('#fgsdmDiv').css('display','none'); | ||
| 178 | + fage=false; | ||
| 179 | + } | ||
| 180 | + } | ||
| 181 | + $('#gsdm').html(options); | ||
| 182 | + | ||
| 183 | + updateCompany(); | ||
| 184 | + }); | ||
| 185 | + }); | ||
| 186 | + | ||
| 187 | + $("#gsdm").on("change",updateCompany); | ||
| 188 | + function updateCompany(){ | ||
| 189 | + var company = $('#gsdm').val(); | ||
| 190 | + var options =''; | ||
| 191 | + if(fage){ | ||
| 192 | + options = '<option value="">请选择</option>'; | ||
| 193 | + } | ||
| 194 | + for(var i = 0; i < obj.length; i++){ | ||
| 195 | + if(obj[i].companyCode == company){ | ||
| 196 | + var children = obj[i].children; | ||
| 197 | + for(var j = 0; j < children.length; j++){ | ||
| 198 | + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>'; | ||
| 199 | + } | ||
| 200 | + } | ||
| 201 | + } | ||
| 202 | + $('#fgsdm').html(options); | ||
| 203 | + } | ||
| 204 | + | ||
| 205 | + var tempData = {}; | ||
| 206 | + $.get('/report/lineList',function(xlList){ | ||
| 207 | + var data = []; | ||
| 208 | + data.push({id: " ", text: "全部线路"}); | ||
| 209 | + $.get('/user/companyData', function(result){ | ||
| 210 | + for(var i = 0; i < result.length; i++){ | ||
| 211 | + var companyCode = result[i].companyCode; | ||
| 212 | + var children = result[i].children; | ||
| 213 | + for(var j = 0; j < children.length; j++){ | ||
| 214 | + var code = children[j].code; | ||
| 215 | + for(var k=0;k < xlList.length;k++ ){ | ||
| 216 | + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){ | ||
| 217 | + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]}); | ||
| 218 | + tempData[xlList[k]["xlbm"]] = companyCode+":"+code; | ||
| 219 | + } | ||
| 220 | + } | ||
| 221 | + } | ||
| 222 | + } | ||
| 223 | + initPinYinSelect2('#line',data,''); | ||
| 224 | + | ||
| 225 | + }); | ||
| 226 | + }); | ||
| 227 | + | ||
| 228 | + $("#line").on("change", function(){ | ||
| 229 | + if($("#line").val() == " "){ | ||
| 230 | + $("#gsdm").attr("disabled", false); | ||
| 231 | + $("#fgsdm").attr("disabled", false); | ||
| 232 | + } else { | ||
| 233 | + var temp = tempData[$("#line").val()].split(":"); | ||
| 234 | + $("#gsdm").val(temp[0]); | ||
| 235 | + updateCompany(); | ||
| 236 | + $("#fgsdm").val(temp[1]); | ||
| 237 | + $("#nature").val(0); | ||
| 238 | + $("#gsdm").attr("disabled", true); | ||
| 239 | + $("#fgsdm").attr("disabled", true); | ||
| 240 | + } | ||
| 241 | + }); | ||
| 242 | + | ||
| 243 | + $("#export").attr('disabled',"true"); | ||
| 244 | + | ||
| 245 | + //查询 | ||
| 246 | + $("#query").on('click',function(){ | ||
| 247 | + var line = $("#line").val(); | ||
| 248 | + var date = $("#date").val(); | ||
| 249 | + var endDate = $("#endDate").val(); | ||
| 250 | + var fgs=$('#fgsdm').val(); | ||
| 251 | + var gs=$('#gsdm').val(); | ||
| 252 | + var nature=$("#nature").val(); | ||
| 253 | + var i = layer.load(2); | ||
| 254 | + $get('/CardSigning/cardList',{line:line,date:date,endDate:endDate,gs:gs,fgs:fgs,nature:nature,type:'query'},function(result){ | ||
| 255 | + layer.close(i); | ||
| 256 | + var calcSheetList = template('calcSheetList',{list:result}); | ||
| 257 | + $('#forms tbody').html(calcSheetList); | ||
| 258 | + $('.btn-calcSheetList').on('click', showcalcSheetList); | ||
| 259 | + | ||
| 260 | + if(result.length == 0) | ||
| 261 | + $("#export").attr('disabled',"true"); | ||
| 262 | + else | ||
| 263 | + $("#export").removeAttr("disabled"); | ||
| 264 | + }); | ||
| 265 | + | ||
| 266 | + }); | ||
| 267 | + function showcalcSheetList(){ | ||
| 268 | + debugger; | ||
| 269 | + var id = $(this).data('id'); | ||
| 270 | + var date = $("#date").val(); | ||
| 271 | + var endDate = $("#endDate").val(); | ||
| 272 | + $("#id").val(id); | ||
| 273 | + $get('/CardSigning/calcListSheet',{line:id,date:date,endDate:endDate,type:'query'},function(result){ | ||
| 274 | + debugger; | ||
| 275 | + var calcSheetList = template('calcSheetList_1',{list:result}); | ||
| 276 | + $('#forms_1 tbody').html(calcSheetList); | ||
| 277 | + $('.btn-calcSheetList_1').on('click', opencalcSheetList); | ||
| 278 | + $('.btn-calcSheetList_2').on('click', opencalcSheetList2); | ||
| 279 | + $("#forms_1 .hidden").removeClass("hidden"); | ||
| 280 | + $("html,body").animate({scrollTop:$("#forms_1").offset().top},1000); | ||
| 281 | + $("#export_1").removeClass("hidden"); | ||
| 282 | + }); | ||
| 283 | + } | ||
| 284 | + function opencalcSheetList(){ | ||
| 285 | + var id = $(this).data('id'); | ||
| 286 | + id += ","+$(this).data('date')+",1"; | ||
| 287 | + $.get('/pages/report/cardInsertion/cardList.html', function (content) { | ||
| 288 | + layer.open({ | ||
| 289 | + type: 1, | ||
| 290 | + area: ['800px', '600px'], | ||
| 291 | + content: content, | ||
| 292 | + title: '线路签卡故障率详细', | ||
| 293 | + shift: 5, | ||
| 294 | + scrollbar: false, | ||
| 295 | + success: function () { | ||
| 296 | + $('#calcSheetList').trigger('init', id); | ||
| 297 | + } | ||
| 298 | + }); | ||
| 299 | + }); | ||
| 300 | + } | ||
| 301 | + | ||
| 302 | + function opencalcSheetList2(){ | ||
| 303 | + var id = $(this).data('id'); | ||
| 304 | + id += ","+$(this).data('date')+",2"; | ||
| 305 | + $.get('/pages/report/cardInsertion/cardList.html', function (content) { | ||
| 306 | + layer.open({ | ||
| 307 | + type: 1, | ||
| 308 | + area: ['800px', '600px'], | ||
| 309 | + content: content, | ||
| 310 | + title: '线路签卡故障率详细', | ||
| 311 | + shift: 5, | ||
| 312 | + scrollbar: false, | ||
| 313 | + success: function () { | ||
| 314 | + $('#calcSheetList').trigger('init', id); | ||
| 315 | + } | ||
| 316 | + }); | ||
| 317 | + }); | ||
| 318 | + } | ||
| 319 | + | ||
| 320 | + $("#export").on("click",function(){ | ||
| 321 | + var line = $("#line").val(); | ||
| 322 | + var date = $("#date").val(); | ||
| 323 | + var endDate = $("#endDate").val(); | ||
| 324 | + var fgs=$('#fgsdm').val(); | ||
| 325 | + var gs=$('#gsdm').val(); | ||
| 326 | + var nature=$("#nature").val(); | ||
| 327 | + var lineName = $('#line option:selected').text(); | ||
| 328 | + if(lineName == "全部线路") | ||
| 329 | + lineName = $('#fgsdm option:selected').text(); | ||
| 330 | + if(lineName == "请选择") | ||
| 331 | + lineName =$('#gsdm option:selected').text(); | ||
| 332 | + var i = layer.load(2); | ||
| 333 | + $get('/CardSigning/cardList',{line:line,date:date,endDate:endDate,gs:gs,fgs:fgs,nature:nature,type:'export'},function(result){ | ||
| 334 | + var dateTime = ""; | ||
| 335 | + if(date == endDate){ | ||
| 336 | + dateTime = moment(date).format("YYYYMMDD"); | ||
| 337 | + } else { | ||
| 338 | + dateTime = moment(date).format("YYYYMMDD")+"-"+ | ||
| 339 | + moment(endDate).format("YYYYMMDD"); | ||
| 340 | + } | ||
| 341 | + window.open("/downloadFile/download?fileName=" | ||
| 342 | + +dateTime+"-签卡率"); | ||
| 343 | + layer.close(i); | ||
| 344 | + }); | ||
| 345 | + }); | ||
| 346 | + | ||
| 347 | + $("#export_1").on("click",function(){ | ||
| 348 | + var id = $("#id").val(); | ||
| 349 | + var date = $("#date").val(); | ||
| 350 | + var endDate = $("#endDate").val(); | ||
| 351 | + var i = layer.load(2); | ||
| 352 | + $get('/CardSigning/calcListSheet',{line:id,date:date,endDate:endDate,type:'export'},function(result){ | ||
| 353 | + window.open("/downloadFile/download?fileName=班次故障率"+moment(date).format("YYYYMMDD")+"-"+moment(endDate).format("YYYYMMDD")); | ||
| 354 | + layer.close(i); | ||
| 355 | + }); | ||
| 356 | + }) | ||
| 357 | + | ||
| 358 | + }); | ||
| 359 | +</script> | ||
| 360 | +<script type="text/html" id="calcSheetList"> | ||
| 361 | + {{each list as obj i}} | ||
| 362 | + <tr> | ||
| 363 | + <td>{{obj.gsName}}</td> | ||
| 364 | + <td>{{obj.fgsName}}</td> | ||
| 365 | + <td>{{obj.xlName}}</td> | ||
| 366 | + <td>{{obj.bcs}}</td> | ||
| 367 | + <td>{{obj.qks}}</td> | ||
| 368 | + <td>{{obj.qklName}}</td> | ||
| 369 | + <td>{{obj.rkgzs}}</td> | ||
| 370 | + <td>{{obj.rkgzlName}}</td> | ||
| 371 | + <td>{{obj.ckgzs}}</td> | ||
| 372 | + <td>{{obj.ckgzlName}}</td> | ||
| 373 | + | ||
| 374 | + <td> | ||
| 375 | + <button type="button" class="btn btn-sm blue btn-calcSheetList" | ||
| 376 | + data-id="{{obj.xlBm}}">查看</button> | ||
| 377 | + </td> | ||
| 378 | + </tr> | ||
| 379 | + {{/each}} | ||
| 380 | + {{if list.length == 0}} | ||
| 381 | + <tr> | ||
| 382 | + <td colspan="11"><h6 class="muted">没有找到相关数据</h6></td> | ||
| 383 | + </tr> | ||
| 384 | + {{/if}} | ||
| 385 | +</script> | ||
| 386 | + | ||
| 387 | + | ||
| 388 | + | ||
| 389 | +<script type="text/html" id="calcSheetList_1"> | ||
| 390 | + {{each list as obj i}} | ||
| 391 | + <tr> | ||
| 392 | + <td>{{obj.gsName}}</td> | ||
| 393 | + <td>{{obj.fgsName}}</td> | ||
| 394 | + <td>{{obj.xlName}}</td> | ||
| 395 | + <td>{{obj.scheduleDateStr}}</td> | ||
| 396 | + <td>{{obj.bcs}}</td> | ||
| 397 | + <td>{{obj.rkgzs}}</td> | ||
| 398 | + <td>{{obj.rkgzlName}}</td> | ||
| 399 | + <td> | ||
| 400 | + <button type="button" class="btn btn-sm blue btn-calcSheetList_1" | ||
| 401 | + data-id="{{obj.xlBm}}" data-date="{{obj.scheduleDateStr}}">详细</button> | ||
| 402 | + </td> | ||
| 403 | + <td>{{obj.ckgzs}}</td> | ||
| 404 | + <td>{{obj.ckgzlName}}</td> | ||
| 405 | + <td> | ||
| 406 | + <button type="button" class="btn btn-sm blue btn-calcSheetList_2" | ||
| 407 | + data-id="{{obj.xlBm}}" data-date="{{obj.scheduleDateStr}}">详细</button> | ||
| 408 | + </td> | ||
| 409 | + </tr> | ||
| 410 | + {{/each}} | ||
| 411 | + {{if list.length == 0}} | ||
| 412 | + <tr> | ||
| 413 | + <td colspan="7"><h6 class="muted">没有找到相关数据</h6></td> | ||
| 414 | + </tr> | ||
| 415 | + {{/if}} | ||
| 416 | +</script> | ||
| 417 | + |
src/main/resources/static/pages/report/cardInsertion/cardList.html
0 → 100644
| 1 | +<style type="text/css"> | ||
| 2 | + .table-bordered { | ||
| 3 | + border: 1px solid; } | ||
| 4 | + .table-bordered > thead > tr > th, | ||
| 5 | + .table-bordered > thead > tr > td, | ||
| 6 | + .table-bordered > tbody > tr > th, | ||
| 7 | + .table-bordered > tbody > tr > td, | ||
| 8 | + .table-bordered > tfoot > tr > th, | ||
| 9 | + .table-bordered > tfoot > tr > td { | ||
| 10 | + border: 1px solid; } | ||
| 11 | + .table-bordered > thead > tr > th, | ||
| 12 | + .table-bordered > thead > tr > td { | ||
| 13 | + border-bottom-width: 2px; } | ||
| 14 | + | ||
| 15 | + .table > tbody + tbody { | ||
| 16 | + border-top: 1px solid; } | ||
| 17 | +</style> | ||
| 18 | + | ||
| 19 | +<div class="page-head"> | ||
| 20 | + <div class="page-title" style="margin-left: 20px"> | ||
| 21 | + <button id="exportList">数据导出</button> | ||
| 22 | + </div> | ||
| 23 | +</div> | ||
| 24 | + | ||
| 25 | +<div class="row" id="calcSheetList"> | ||
| 26 | + <div class="col-md-12"> | ||
| 27 | + <div class="portlet light porttlet-fit bordered"> | ||
| 28 | + <div class="portlet-body"> | ||
| 29 | + <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 600px"> | ||
| 30 | + <table class="table table-bordered table-hover table-checkable" id="forms_2"> | ||
| 31 | + <thead> | ||
| 32 | + <tr> | ||
| 33 | + <td></td> | ||
| 34 | + <td>日期</td> | ||
| 35 | + <td>线路</td> | ||
| 36 | + <td>站点</td> | ||
| 37 | + <td>计划时间</td> | ||
| 38 | + <td>实际时间</td> | ||
| 39 | + <td>签卡状态</td> | ||
| 40 | + </tr> | ||
| 41 | + </thead> | ||
| 42 | + | ||
| 43 | + <tbody> | ||
| 44 | + | ||
| 45 | + </tbody> | ||
| 46 | + </table> | ||
| 47 | + </div> | ||
| 48 | + </div> | ||
| 49 | + </div> | ||
| 50 | + </div> | ||
| 51 | +</div> | ||
| 52 | +<script src="/pages/mforms/singledatas/jquery.table2excel.min.js"></script> | ||
| 53 | +<script> | ||
| 54 | + $(function(){ | ||
| 55 | + // 关闭左侧栏 | ||
| 56 | + if (!$('body').hasClass('page-sidebar-closed')) | ||
| 57 | + $('.menu-toggler.sidebar-toggler').click(); | ||
| 58 | + var no=""; | ||
| 59 | + var dates=""; | ||
| 60 | + var dir=""; | ||
| 61 | + $("#calcSheetList").on('init', function (e, id) { | ||
| 62 | + no=id.split(",")[0]; | ||
| 63 | + dates = id.split(",")[1]; | ||
| 64 | + dir =id.split(",")[2]; | ||
| 65 | + var i = layer.load(2); | ||
| 66 | + $get('/CardSigning/calcSheet',{line:no,date:dates,dir:dir,type:'query'},function(result){ | ||
| 67 | + layer.close(i); | ||
| 68 | + debugger; | ||
| 69 | + var calcSheetList_2 = template('calcSheetList_2',{list:result}); | ||
| 70 | + $('#forms_2 tbody').html(calcSheetList_2); | ||
| 71 | + }); | ||
| 72 | + }) | ||
| 73 | + $("#exportList").on('click',function(){ | ||
| 74 | + var i = layer.load(2); | ||
| 75 | + var name=""; | ||
| 76 | + if(dir=="1"){ | ||
| 77 | + fileName="人卡故障率"+dates; | ||
| 78 | + }else{ | ||
| 79 | + fileName="车卡故障率"+dates; | ||
| 80 | + } | ||
| 81 | + $get('/CardSigning/calcSheet',{line:no,date:dates,dir:dir,type:'export'},function(result){ | ||
| 82 | + window.open("/downloadFile/download?fileName="+fileName); | ||
| 83 | + layer.close(i); | ||
| 84 | + | ||
| 85 | + }); | ||
| 86 | + }); | ||
| 87 | + | ||
| 88 | + | ||
| 89 | + }); | ||
| 90 | +</script> | ||
| 91 | +<script type="text/html" id="calcSheetList_2"> | ||
| 92 | + {{each list as obj i}} | ||
| 93 | + <tr {{if obj.rfidName =="人卡故障" || obj.rfidName =="车卡故障" }}style="color: red" {{/if}}> | ||
| 94 | + <td>{{i+1}}</td> | ||
| 95 | + <td>{{obj.scheduleDateStr}}</td> | ||
| 96 | + <td>{{obj.xlName}}</td> | ||
| 97 | + <td>{{obj.qdzName}}</td> | ||
| 98 | + <td>{{obj.fcsj}}</td> | ||
| 99 | + <td>{{obj.fcsjActual}}</td> | ||
| 100 | + <td>{{obj.rfidName}}</td> | ||
| 101 | + </tr> | ||
| 102 | + {{/each}} | ||
| 103 | + {{if list.length == 0}} | ||
| 104 | + <tr> | ||
| 105 | + <td colspan="7"><h6 class="muted">没有找到相关数据</h6></td> | ||
| 106 | + </tr> | ||
| 107 | + {{/if}} | ||
| 108 | +</script> | ||
| 0 | \ No newline at end of file | 109 | \ No newline at end of file |