Commit 18b48aa84d2d2b49129f8aff1259046357f5db44
Merge remote-tracking branch 'origin/lingang' into lingang
Showing
18 changed files
with
3848 additions
and
525 deletions
Too many changes to show.
To preserve performance only 18 of 22 files are displayed.
src/main/java/com/bsth/controller/oil/JqlController.java
0 → 100644
| 1 | +package com.bsth.controller.oil; | |
| 2 | + | |
| 3 | +import java.io.File; | |
| 4 | +import java.util.HashMap; | |
| 5 | +import java.util.Map; | |
| 6 | + | |
| 7 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 8 | +import org.springframework.web.bind.annotation.RequestMapping; | |
| 9 | +import org.springframework.web.bind.annotation.RequestMethod; | |
| 10 | +import org.springframework.web.bind.annotation.RequestParam; | |
| 11 | +import org.springframework.web.bind.annotation.RestController; | |
| 12 | +import org.springframework.web.multipart.MultipartFile; | |
| 13 | + | |
| 14 | +import com.bsth.controller.BaseController; | |
| 15 | +import com.bsth.entity.oil.Jql; | |
| 16 | +import com.bsth.service.oil.JqlService; | |
| 17 | +import com.google.common.io.Files; | |
| 18 | + | |
| 19 | +@RestController | |
| 20 | +@RequestMapping("jql") | |
| 21 | +public class JqlController extends BaseController<Jql, Integer> { | |
| 22 | + | |
| 23 | + @Autowired | |
| 24 | + JqlService jqlService; | |
| 25 | + | |
| 26 | + public String getDataImportClasspath(){ | |
| 27 | + return this.getClass().getResource("/").getPath() + "/static/pages/hydrogen/jql"; | |
| 28 | + } | |
| 29 | + | |
| 30 | + @RequestMapping(value = "/uploadFile",method = RequestMethod.POST) | |
| 31 | + public String uploadFile(MultipartFile file, String gsbm_, String gsName, | |
| 32 | + String fgsbm_, String fgsName) throws Exception{ | |
| 33 | + Map<String, Object> map = new HashMap<String, Object>(); | |
| 34 | + File newFile = new File( | |
| 35 | + getDataImportClasspath() + File.separator + | |
| 36 | + file.getOriginalFilename()); | |
| 37 | + Files.write(file.getBytes(), newFile); | |
| 38 | + String result = jqlService.importExcel(newFile, gsbm_, gsName, fgsbm_, fgsName); | |
| 39 | + return "{\"result\":" + "\""+result+"\"}"; | |
| 40 | + } | |
| 41 | + | |
| 42 | + @RequestMapping(value = "/query",method = RequestMethod.GET) | |
| 43 | + public Map<String, Object> query(@RequestParam Map<String, Object> map) throws Exception{ | |
| 44 | + return jqlService.query(map); | |
| 45 | + } | |
| 46 | + | |
| 47 | +} | ... | ... |
src/main/java/com/bsth/controller/oil/QlbController.java
0 → 100644
| 1 | +package com.bsth.controller.oil; | |
| 2 | + | |
| 3 | +import java.text.SimpleDateFormat; | |
| 4 | +import java.util.ArrayList; | |
| 5 | +import java.util.Date; | |
| 6 | +import java.util.HashMap; | |
| 7 | +import java.util.Iterator; | |
| 8 | +import java.util.List; | |
| 9 | +import java.util.Map; | |
| 10 | + | |
| 11 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 12 | +import org.springframework.data.domain.Page; | |
| 13 | +import org.springframework.data.domain.PageRequest; | |
| 14 | +import org.springframework.data.domain.Sort; | |
| 15 | +import org.springframework.data.domain.Sort.Direction; | |
| 16 | +import org.springframework.web.bind.annotation.RequestMapping; | |
| 17 | +import org.springframework.web.bind.annotation.RequestMethod; | |
| 18 | +import org.springframework.web.bind.annotation.RequestParam; | |
| 19 | +import org.springframework.web.bind.annotation.RestController; | |
| 20 | +import com.bsth.controller.BaseController; | |
| 21 | +import com.bsth.entity.oil.Qlb; | |
| 22 | +import com.bsth.service.oil.QlbService; | |
| 23 | +import com.bsth.util.Arith; | |
| 24 | +import com.bsth.util.ReportUtils; | |
| 25 | +import com.google.common.base.Splitter; | |
| 26 | + | |
| 27 | +@RestController | |
| 28 | +@RequestMapping("qlb") | |
| 29 | +public class QlbController extends BaseController<Qlb, Integer>{ | |
| 30 | + @Autowired | |
| 31 | + QlbService service; | |
| 32 | + /** | |
| 33 | + * | |
| 34 | + * @Title: list | |
| 35 | + * @Description: TODO(多条件分页查询) | |
| 36 | + * @param @param map 查询条件 | |
| 37 | + * @param @param page 页码 | |
| 38 | + * @param @param size 每页显示数量 | |
| 39 | + * @throws | |
| 40 | + */ | |
| 41 | + @RequestMapping(method = RequestMethod.GET) | |
| 42 | + public Page<Qlb> list(@RequestParam Map<String, Object> map, | |
| 43 | + @RequestParam(defaultValue = "0") int page, | |
| 44 | + @RequestParam(defaultValue = "10") int size, | |
| 45 | + @RequestParam(defaultValue = "id") String order, | |
| 46 | + @RequestParam(defaultValue = "DESC") String direction){ | |
| 47 | + | |
| 48 | + Direction d; | |
| 49 | +// map.put("xlbm_like", map.get("xlbm_like").toString().trim()); | |
| 50 | +// try { | |
| 51 | + String rq=map.get("rq").toString(); | |
| 52 | + if(!(rq=="")){ | |
| 53 | +// | |
| 54 | +// SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); | |
| 55 | +// Calendar calendar = new GregorianCalendar(); | |
| 56 | +// calendar.setTime(sdf.parse(rq)); | |
| 57 | +// calendar.add(calendar.DATE,1); | |
| 58 | +// Date date=calendar.getTime(); | |
| 59 | + map.put("rq_eq", rq); | |
| 60 | +// map.put("rq_lt", sdf.format(date)); | |
| 61 | +// System.out.println(rq); | |
| 62 | +// System.out.println(sdf.format(date)); | |
| 63 | + } | |
| 64 | +// } catch (ParseException e) { | |
| 65 | +// // TODO Auto-generated catch block | |
| 66 | +// e.printStackTrace(); | |
| 67 | +// } | |
| 68 | + if(null != direction && direction.equals("ASC")) | |
| 69 | + d = Direction.ASC; | |
| 70 | + else | |
| 71 | + d = Direction.DESC; | |
| 72 | + | |
| 73 | + // 允许多个字段排序,order可以写单个字段,也可以写多个字段 | |
| 74 | + // 多个字段格式:{col1},{col2},{col3},....,{coln} | |
| 75 | + // 每个字段的排序方向都是一致,这个以后再看要不要改 | |
| 76 | + List<String> list = Splitter.on(",").trimResults().splitToList(order); | |
| 77 | + return baseService.list(map, new PageRequest(page, size, new Sort(d, list))); | |
| 78 | + } | |
| 79 | + @RequestMapping(value = "/qlbList",method = RequestMethod.GET) | |
| 80 | + public List<Qlb> qlbList(@RequestParam Map<String, Object> map){ | |
| 81 | + List<Qlb> list=service.listQlb(map); | |
| 82 | + return list; | |
| 83 | + } | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + @RequestMapping(value = "/obtain",method = RequestMethod.GET) | |
| 88 | + public Map<String, Object> obtain(@RequestParam Map<String, Object> map) throws Exception{ | |
| 89 | + Map<String, Object> list=new HashMap<String, Object>(); | |
| 90 | + try { | |
| 91 | + list = service.obtain(map); | |
| 92 | + } catch (Exception e) { | |
| 93 | + // TODO Auto-generated catch block | |
| 94 | + throw e; | |
| 95 | + } | |
| 96 | + return list; | |
| 97 | + } | |
| 98 | + | |
| 99 | + /** | |
| 100 | + * 保存氢量 | |
| 101 | + * @param map | |
| 102 | + * @return | |
| 103 | + */ | |
| 104 | + @RequestMapping(value = "/sort",method = RequestMethod.GET) | |
| 105 | + public Map<String, Object> sort(@RequestParam Map<String, Object> map){ | |
| 106 | + Map<String, Object> list=service.sort(map); | |
| 107 | + return list; | |
| 108 | + } | |
| 109 | + | |
| 110 | + /** | |
| 111 | + * 核对氢量(有加氢没里程) | |
| 112 | + * @param map | |
| 113 | + * @return | |
| 114 | + */ | |
| 115 | + @RequestMapping(value = "/checkQl",method = RequestMethod.GET) | |
| 116 | + public Map<String, Object> checkQl(@RequestParam Map<String, Object> map){ | |
| 117 | + Map<String, Object> list=service.checkQl(map); | |
| 118 | + return list; | |
| 119 | + } | |
| 120 | + | |
| 121 | + @RequestMapping(value = "/sumQlb",method = RequestMethod.GET) | |
| 122 | + public Map<String, Object> sumQlb(@RequestParam Map<String, Object> map){ | |
| 123 | + Map<String, Object> list=service.sumQlb(map); | |
| 124 | + return list; | |
| 125 | + } | |
| 126 | + | |
| 127 | + @RequestMapping(value = "/saveQlbList",method = RequestMethod.POST) | |
| 128 | + public Map<String, Object> saveQlbList(@RequestParam Map<String, Object> map){ | |
| 129 | + Map<String, Object> list=new HashMap<String, Object>(); | |
| 130 | + try { | |
| 131 | + list = service.saveQlbList(map); | |
| 132 | + } catch (Exception e) { | |
| 133 | + // TODO Auto-generated catch block | |
| 134 | + e.printStackTrace(); | |
| 135 | + } | |
| 136 | + return list; | |
| 137 | + } | |
| 138 | + | |
| 139 | + | |
| 140 | + @RequestMapping(value = "/listExport",method = RequestMethod.POST) | |
| 141 | + public List<Map<String, Object>> listExport(@RequestParam Map<String, Object> map){ | |
| 142 | + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), | |
| 143 | + sdfSimple = new SimpleDateFormat("yyyyMMdd"); | |
| 144 | + List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | |
| 145 | + ReportUtils ee = new ReportUtils(); | |
| 146 | + List<Qlb> qlb = service.listQlb(map); | |
| 147 | +// (new CustomerSpecs<Ylb>(map)).iterator(); | |
| 148 | + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | |
| 149 | + for (Qlb y : qlb) { | |
| 150 | + Map<String, Object> m = new HashMap<String, Object>(); | |
| 151 | + m.put("rq", y.getRq()); | |
| 152 | + m.put("gsname",y.getGsname() ); | |
| 153 | + m.put("fgsname", y.getFgsname()); | |
| 154 | + if(y.getLinename()==null){ | |
| 155 | + m.put("xlname", y.getXlname()==null?"":y.getXlname()); | |
| 156 | + }else{ | |
| 157 | + m.put("xlname", y.getLinename()); | |
| 158 | + } | |
| 159 | + m.put("nbbm", y.getNbbm()); | |
| 160 | + m.put("jsy", y.getJsy()); | |
| 161 | + m.put("name", y.getName()); | |
| 162 | + m.put("jql", y.getJql()<=0?"0":y.getJql()); | |
| 163 | + m.put("czcl", y.getCzcl()<=0?"0":y.getCzcl()+"%"); | |
| 164 | + m.put("jzcl", y.getJzcl()<=0?"0":y.getJzcl()+"%"); | |
| 165 | + m.put("czlc", y.getCzlc()<=0?"0":y.getCzlc()); | |
| 166 | + m.put("jzlc", y.getJzlc()<=0?"0":y.getJzlc()); | |
| 167 | + m.put("hn", y.getHn()<=0?"0":y.getHn()); | |
| 168 | + String shyy ="无"; | |
| 169 | + if(y.getShyy()!=null){ | |
| 170 | + shyy=y.getShyy(); | |
| 171 | + if(shyy.equals("1")){shyy="票务用";} | |
| 172 | + else if(shyy.equals("2")){shyy="保养用";} | |
| 173 | + else if(shyy.equals("3")){shyy="报废车用";} | |
| 174 | + else if(shyy.equals("4")){shyy="其它用";} | |
| 175 | + else if(shyy.equals("5")){shyy="人保部";} | |
| 176 | + else if(shyy.equals("6")){shyy="车队";} | |
| 177 | + else if(shyy.equals("7")){shyy="车间(高保)";} | |
| 178 | + else if(shyy.equals("8")){shyy="车间(小修)";} | |
| 179 | + else{shyy ="无";} | |
| 180 | + } | |
| 181 | + m.put("ns", y.getNs()<=0?"0":y.getNs()); | |
| 182 | + m.put("shyy", shyy); | |
| 183 | + m.put("sh", y.getSh()<=0?"0":y.getSh()); | |
| 184 | + m.put("zlc", y.getZlc()<=0?"0":y.getZlc()); | |
| 185 | + m.put("rdlx", ""); | |
| 186 | + m.put("bglnh", y.getBglhn()); | |
| 187 | + m.put("znh", Arith.add(y.getSh(), y.getHn())); | |
| 188 | + resList.add(m); | |
| 189 | + } | |
| 190 | + try { | |
| 191 | + map.put("sheetName", map.get("rq")); | |
| 192 | + listI.add(resList.iterator()); | |
| 193 | + String path = this.getClass().getResource("/").getPath()+"static/pages/forms/"; | |
| 194 | + ee.excelReplace(listI, new Object[] { map }, path+"mould/listQl.xls", | |
| 195 | + path+"export/"+map.get("rq").toString()+ "进出场存氢量.xls"); | |
| 196 | + } catch (Exception e) { | |
| 197 | + e.printStackTrace(); | |
| 198 | + } | |
| 199 | + | |
| 200 | + return resList; | |
| 201 | + | |
| 202 | + } | |
| 203 | + | |
| 204 | + | |
| 205 | + @RequestMapping(value = "/checkJsy",method = RequestMethod.GET) | |
| 206 | + public String checkJsy(@RequestParam Map<String, Object> map){ | |
| 207 | + String list=service.checkJsy(map); | |
| 208 | + return list; | |
| 209 | + } | |
| 210 | + | |
| 211 | + @RequestMapping(value = "/deleteIds", method = RequestMethod.POST) | |
| 212 | + public Map<String, Object> deleteIds(@RequestParam Map<String, Object> map) { | |
| 213 | + Map<String, Object> maps=new HashMap<String, Object>(); | |
| 214 | + try { | |
| 215 | + maps= service.deleteIds(map); | |
| 216 | + } catch (Exception e) { | |
| 217 | + // TODO Auto-generated catch block | |
| 218 | + e.printStackTrace(); | |
| 219 | + } | |
| 220 | + return maps; | |
| 221 | + } | |
| 222 | + | |
| 223 | + @RequestMapping(value = "/saveQlb",method = RequestMethod.POST) | |
| 224 | + public Map<String, Object> saveQlb(Qlb t){ | |
| 225 | +// SysUser user = SecurityUtils.getCurrentUser(); | |
| 226 | + t.setCreatetime(new Date()); | |
| 227 | +// Ylb t=new Ylb(); | |
| 228 | + return service.saveQlb(t); | |
| 229 | + } | |
| 230 | + | |
| 231 | + @RequestMapping(value = "/updateJsy",method = RequestMethod.GET) | |
| 232 | + public Map<String, Object> updateJsy(@RequestParam Map<String, Object> map){ | |
| 233 | + return service.update(map); | |
| 234 | + } | |
| 235 | +} | ... | ... |
src/main/java/com/bsth/entity/Cars.java
| 1 | -package com.bsth.entity; | |
| 2 | - | |
| 3 | -import com.bsth.entity.schedule.BEntity; | |
| 4 | -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | |
| 5 | -import org.hibernate.annotations.Formula; | |
| 6 | - | |
| 7 | -import javax.persistence.*; | |
| 8 | -import java.io.Serializable; | |
| 9 | -import java.util.Date; | |
| 10 | - | |
| 11 | -/** | |
| 12 | - * | |
| 13 | - * @ClassName : Cars(车实体类) | |
| 14 | - * | |
| 15 | - * @Author : bsth@lq | |
| 16 | - * | |
| 17 | - * @Description : TODO(车辆基本信息) | |
| 18 | - * | |
| 19 | - * @Data : 2016-04-27 | |
| 20 | - * | |
| 21 | - * @Version 公交调度系统BS版 0.1 | |
| 22 | - * | |
| 23 | - */ | |
| 24 | - | |
| 25 | -@Entity | |
| 26 | -@Table(name = "bsth_c_cars") | |
| 27 | -@JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"}) | |
| 28 | -public class Cars extends BEntity implements Serializable { | |
| 29 | - | |
| 30 | - /** 主键Id */ | |
| 31 | - @Id | |
| 32 | - @GeneratedValue(strategy = GenerationType.IDENTITY) | |
| 33 | - private Integer id; | |
| 34 | - | |
| 35 | - /** 自编号/内部编号 */ | |
| 36 | - @Column(nullable = false, length = 20, unique = true) | |
| 37 | - private String insideCode; | |
| 38 | - | |
| 39 | - // 公司、分公司暂时不用关联实体 | |
| 40 | - /** 公司代码 */ | |
| 41 | - @Column(nullable = false) | |
| 42 | - private String businessCode; | |
| 43 | - /** 公司名称 */ | |
| 44 | - @Column(nullable = false) | |
| 45 | - private String company; | |
| 46 | - /** 分公司编码 */ | |
| 47 | - private String brancheCompanyCode; | |
| 48 | - /** 分公司 */ | |
| 49 | - private String brancheCompany; | |
| 50 | - | |
| 51 | - /** 组合公司分公司编码 */ | |
| 52 | - @Formula(" concat(business_code, '_', branche_company_code) ") | |
| 53 | - private String cgsbm; | |
| 54 | - | |
| 55 | - /** 车辆编码(TODO:在原系统里没有,这里暂时留着) */ | |
| 56 | - @Column(nullable = false) | |
| 57 | - private String carCode; | |
| 58 | - /** 车牌号 */ | |
| 59 | - @Column(nullable = false) | |
| 60 | - private String carPlate; | |
| 61 | - /** 供应商名称 */ | |
| 62 | - @Column(nullable = false) | |
| 63 | - private String supplierName; | |
| 64 | - /** 设备终端号 */ | |
| 65 | - @Column(nullable = false) | |
| 66 | - private String equipmentCode; | |
| 67 | - | |
| 68 | - // 以下信息来自总公司的业务系统,可能需要调用相关接口 | |
| 69 | - /** 车型类别 */ | |
| 70 | - private String carClass ; | |
| 71 | - /** 技术速度 */ | |
| 72 | - private Double speed; | |
| 73 | - /** 座位数 */ | |
| 74 | - private Integer carSeatnNumber; | |
| 75 | - /** 载客标准 */ | |
| 76 | - private String carStandard; | |
| 77 | - /** 标准油耗(开空调) */ | |
| 78 | - private Double kburnStandard; | |
| 79 | - /** 标准油耗(关空调) */ | |
| 80 | - private Double gburnStandard; | |
| 81 | - /** 报废号 */ | |
| 82 | - private String scrapCode; | |
| 83 | - /** 报废日期 */ | |
| 84 | - private Date scrapDate; | |
| 85 | - /** 厂牌型号1 */ | |
| 86 | - private String makeCodeOne; | |
| 87 | - /** 厂牌型号2 */ | |
| 88 | - private String makeCodeTwo; | |
| 89 | - /** 车辆等级标准 */ | |
| 90 | - private String carGride; | |
| 91 | - /** 出厂排放标准 */ | |
| 92 | - private String emissionsStandard; | |
| 93 | - /** 发动机号码1 */ | |
| 94 | - private String engineCodeOne; | |
| 95 | - /** 发动机号码2 */ | |
| 96 | - private String engineCodeTwo; | |
| 97 | - /** 车架号码1 */ | |
| 98 | - private String carNumberOne; | |
| 99 | - /** 车架号码2 */ | |
| 100 | - private String carNumberTwo; | |
| 101 | - /** 启用日期(2008-10-10)*/ | |
| 102 | - private Date openDate; | |
| 103 | - /** 取消日期 */ | |
| 104 | - private Date closeDate; | |
| 105 | - | |
| 106 | - /** 是否空调车 */ | |
| 107 | - @Column(nullable = true) | |
| 108 | - private Boolean hvacCar; | |
| 109 | - /** 有无人售票 */ | |
| 110 | - @Column(nullable = true) | |
| 111 | - private Boolean ticketType; | |
| 112 | - /** 是否有LED服务屏 */ | |
| 113 | - @Column(nullable = true) | |
| 114 | - private Boolean ledScreen; | |
| 115 | - /** 是否有TV视频 */ | |
| 116 | - @Column(nullable = true) | |
| 117 | - private Boolean tvVideoType; | |
| 118 | - | |
| 119 | - /** 车辆类型 */ | |
| 120 | - private String carType; | |
| 121 | - /** 是否机动车(机动车类型选择)*/ | |
| 122 | - private String vehicleStats; | |
| 123 | - /** 营运状态 */ | |
| 124 | - private String operatorsState; | |
| 125 | - /** 营运证编码 */ | |
| 126 | - private String serviceNo; | |
| 127 | - /** 是否电车(TODO:在原系统里没有,这里暂时留着) */ | |
| 128 | - private Boolean sfdc; | |
| 129 | - /** 是否混合动力(TODO:在原系统里没有,这里暂时留着) */ | |
| 130 | - private Boolean sfmix; | |
| 131 | - /** 备注/描述 */ | |
| 132 | - private String descriptions; | |
| 133 | - | |
| 134 | - /** 车辆序号(TODO:在原系统里没有,这里暂时留着) */ | |
| 135 | - private String carOrdinal; | |
| 136 | - /** 视频编号 */ | |
| 137 | - private String videoCode; | |
| 138 | - /** 是否报废 */ | |
| 139 | - @Column(nullable = true) | |
| 140 | - private Boolean scrapState; | |
| 141 | - /** 是否切换(TODO:在原系统里没有,这里暂时留着)*/ | |
| 142 | - private Integer isSwitch; | |
| 143 | - /** 线路名称(TODO:在原系统里没有,这里暂时留着,并且不做线路关联,只保留个名字) */ | |
| 144 | - private String xlmc; | |
| 145 | - | |
| 146 | - public Cars() {} | |
| 147 | - | |
| 148 | - public Cars(Object id, Object nbbh, Object clbh, Object cph, Object sbbh) { | |
| 149 | - if (id != null) { | |
| 150 | - this.id = Integer.valueOf(id.toString()); | |
| 151 | - } | |
| 152 | - if (nbbh != null) { | |
| 153 | - this.insideCode = nbbh.toString(); | |
| 154 | - } | |
| 155 | - if (clbh != null) { | |
| 156 | - this.carCode = clbh.toString(); | |
| 157 | - } | |
| 158 | - if (cph != null) { | |
| 159 | - this.carPlate = cph.toString(); | |
| 160 | - } | |
| 161 | - if (sbbh != null) { | |
| 162 | - this.equipmentCode = sbbh.toString(); | |
| 163 | - } | |
| 164 | - } | |
| 165 | - | |
| 166 | - public String getServiceNo() { | |
| 167 | - return serviceNo; | |
| 168 | - } | |
| 169 | - | |
| 170 | - public void setServiceNo(String serviceNo) { | |
| 171 | - this.serviceNo = serviceNo; | |
| 172 | - } | |
| 173 | - | |
| 174 | - public Integer getId() { | |
| 175 | - return id; | |
| 176 | - } | |
| 177 | - | |
| 178 | - public void setId(Integer id) { | |
| 179 | - this.id = id; | |
| 180 | - } | |
| 181 | - | |
| 182 | - public String getInsideCode() { | |
| 183 | - return insideCode; | |
| 184 | - } | |
| 185 | - | |
| 186 | - public void setInsideCode(String insideCode) { | |
| 187 | - this.insideCode = insideCode; | |
| 188 | - } | |
| 189 | - | |
| 190 | - public String getBusinessCode() { | |
| 191 | - return businessCode; | |
| 192 | - } | |
| 193 | - | |
| 194 | - public void setBusinessCode(String businessCode) { | |
| 195 | - this.businessCode = businessCode; | |
| 196 | - } | |
| 197 | - | |
| 198 | - public String getCompany() { | |
| 199 | - return company; | |
| 200 | - } | |
| 201 | - | |
| 202 | - public void setCompany(String company) { | |
| 203 | - this.company = company; | |
| 204 | - } | |
| 205 | - | |
| 206 | - public String getBrancheCompanyCode() { | |
| 207 | - return brancheCompanyCode; | |
| 208 | - } | |
| 209 | - | |
| 210 | - public void setBrancheCompanyCode(String brancheCompanyCode) { | |
| 211 | - this.brancheCompanyCode = brancheCompanyCode; | |
| 212 | - } | |
| 213 | - | |
| 214 | - public String getBrancheCompany() { | |
| 215 | - return brancheCompany; | |
| 216 | - } | |
| 217 | - | |
| 218 | - public void setBrancheCompany(String brancheCompany) { | |
| 219 | - this.brancheCompany = brancheCompany; | |
| 220 | - } | |
| 221 | - | |
| 222 | - public String getCarCode() { | |
| 223 | - return carCode; | |
| 224 | - } | |
| 225 | - | |
| 226 | - public void setCarCode(String carCode) { | |
| 227 | - this.carCode = carCode; | |
| 228 | - } | |
| 229 | - | |
| 230 | - public String getCarPlate() { | |
| 231 | - return carPlate; | |
| 232 | - } | |
| 233 | - | |
| 234 | - public void setCarPlate(String carPlate) { | |
| 235 | - this.carPlate = carPlate; | |
| 236 | - } | |
| 237 | - | |
| 238 | - public String getSupplierName() { | |
| 239 | - return supplierName; | |
| 240 | - } | |
| 241 | - | |
| 242 | - public void setSupplierName(String supplierName) { | |
| 243 | - this.supplierName = supplierName; | |
| 244 | - } | |
| 245 | - | |
| 246 | - public String getEquipmentCode() { | |
| 247 | - return equipmentCode; | |
| 248 | - } | |
| 249 | - | |
| 250 | - public void setEquipmentCode(String equipmentCode) { | |
| 251 | - this.equipmentCode = equipmentCode; | |
| 252 | - } | |
| 253 | - | |
| 254 | - public String getCarClass() { | |
| 255 | - return carClass; | |
| 256 | - } | |
| 257 | - | |
| 258 | - public void setCarClass(String carClass) { | |
| 259 | - this.carClass = carClass; | |
| 260 | - } | |
| 261 | - | |
| 262 | - public Double getSpeed() { | |
| 263 | - return speed; | |
| 264 | - } | |
| 265 | - | |
| 266 | - public void setSpeed(Double speed) { | |
| 267 | - this.speed = speed; | |
| 268 | - } | |
| 269 | - | |
| 270 | - public Integer getCarSeatnNumber() { | |
| 271 | - return carSeatnNumber; | |
| 272 | - } | |
| 273 | - | |
| 274 | - public void setCarSeatnNumber(Integer carSeatnNumber) { | |
| 275 | - this.carSeatnNumber = carSeatnNumber; | |
| 276 | - } | |
| 277 | - | |
| 278 | - public String getCarStandard() { | |
| 279 | - return carStandard; | |
| 280 | - } | |
| 281 | - | |
| 282 | - public void setCarStandard(String carStandard) { | |
| 283 | - this.carStandard = carStandard; | |
| 284 | - } | |
| 285 | - | |
| 286 | - public Double getKburnStandard() { | |
| 287 | - return kburnStandard; | |
| 288 | - } | |
| 289 | - | |
| 290 | - public void setKburnStandard(Double kburnStandard) { | |
| 291 | - this.kburnStandard = kburnStandard; | |
| 292 | - } | |
| 293 | - | |
| 294 | - public Double getGburnStandard() { | |
| 295 | - return gburnStandard; | |
| 296 | - } | |
| 297 | - | |
| 298 | - public void setGburnStandard(Double gburnStandard) { | |
| 299 | - this.gburnStandard = gburnStandard; | |
| 300 | - } | |
| 301 | - | |
| 302 | - public String getScrapCode() { | |
| 303 | - return scrapCode; | |
| 304 | - } | |
| 305 | - | |
| 306 | - public void setScrapCode(String scrapCode) { | |
| 307 | - this.scrapCode = scrapCode; | |
| 308 | - } | |
| 309 | - | |
| 310 | - public Date getScrapDate() { | |
| 311 | - return scrapDate; | |
| 312 | - } | |
| 313 | - | |
| 314 | - public void setScrapDate(Date scrapDate) { | |
| 315 | - this.scrapDate = scrapDate; | |
| 316 | - } | |
| 317 | - | |
| 318 | - public String getMakeCodeOne() { | |
| 319 | - return makeCodeOne; | |
| 320 | - } | |
| 321 | - | |
| 322 | - public void setMakeCodeOne(String makeCodeOne) { | |
| 323 | - this.makeCodeOne = makeCodeOne; | |
| 324 | - } | |
| 325 | - | |
| 326 | - public String getMakeCodeTwo() { | |
| 327 | - return makeCodeTwo; | |
| 328 | - } | |
| 329 | - | |
| 330 | - public void setMakeCodeTwo(String makeCodeTwo) { | |
| 331 | - this.makeCodeTwo = makeCodeTwo; | |
| 332 | - } | |
| 333 | - | |
| 334 | - public String getCarGride() { | |
| 335 | - return carGride; | |
| 336 | - } | |
| 337 | - | |
| 338 | - public void setCarGride(String carGride) { | |
| 339 | - this.carGride = carGride; | |
| 340 | - } | |
| 341 | - | |
| 342 | - public String getEmissionsStandard() { | |
| 343 | - return emissionsStandard; | |
| 344 | - } | |
| 345 | - | |
| 346 | - public void setEmissionsStandard(String emissionsStandard) { | |
| 347 | - this.emissionsStandard = emissionsStandard; | |
| 348 | - } | |
| 349 | - | |
| 350 | - public String getEngineCodeOne() { | |
| 351 | - return engineCodeOne; | |
| 352 | - } | |
| 353 | - | |
| 354 | - public void setEngineCodeOne(String engineCodeOne) { | |
| 355 | - this.engineCodeOne = engineCodeOne; | |
| 356 | - } | |
| 357 | - | |
| 358 | - public String getEngineCodeTwo() { | |
| 359 | - return engineCodeTwo; | |
| 360 | - } | |
| 361 | - | |
| 362 | - public void setEngineCodeTwo(String engineCodeTwo) { | |
| 363 | - this.engineCodeTwo = engineCodeTwo; | |
| 364 | - } | |
| 365 | - | |
| 366 | - public String getCarNumberOne() { | |
| 367 | - return carNumberOne; | |
| 368 | - } | |
| 369 | - | |
| 370 | - public void setCarNumberOne(String carNumberOne) { | |
| 371 | - this.carNumberOne = carNumberOne; | |
| 372 | - } | |
| 373 | - | |
| 374 | - public String getCarNumberTwo() { | |
| 375 | - return carNumberTwo; | |
| 376 | - } | |
| 377 | - | |
| 378 | - public void setCarNumberTwo(String carNumberTwo) { | |
| 379 | - this.carNumberTwo = carNumberTwo; | |
| 380 | - } | |
| 381 | - | |
| 382 | - public Date getOpenDate() { | |
| 383 | - return openDate; | |
| 384 | - } | |
| 385 | - | |
| 386 | - public void setOpenDate(Date openDate) { | |
| 387 | - this.openDate = openDate; | |
| 388 | - } | |
| 389 | - | |
| 390 | - public Date getCloseDate() { | |
| 391 | - return closeDate; | |
| 392 | - } | |
| 393 | - | |
| 394 | - public void setCloseDate(Date closeDate) { | |
| 395 | - this.closeDate = closeDate; | |
| 396 | - } | |
| 397 | - | |
| 398 | - public Boolean getHvacCar() { | |
| 399 | - return hvacCar; | |
| 400 | - } | |
| 401 | - | |
| 402 | - public void setHvacCar(Boolean hvacCar) { | |
| 403 | - this.hvacCar = hvacCar; | |
| 404 | - } | |
| 405 | - | |
| 406 | - public Boolean getTicketType() { | |
| 407 | - return ticketType; | |
| 408 | - } | |
| 409 | - | |
| 410 | - public void setTicketType(Boolean ticketType) { | |
| 411 | - this.ticketType = ticketType; | |
| 412 | - } | |
| 413 | - | |
| 414 | - public Boolean getLedScreen() { | |
| 415 | - return ledScreen; | |
| 416 | - } | |
| 417 | - | |
| 418 | - public void setLedScreen(Boolean ledScreen) { | |
| 419 | - this.ledScreen = ledScreen; | |
| 420 | - } | |
| 421 | - | |
| 422 | - public Boolean getTvVideoType() { | |
| 423 | - return tvVideoType; | |
| 424 | - } | |
| 425 | - | |
| 426 | - public void setTvVideoType(Boolean tvVideoType) { | |
| 427 | - this.tvVideoType = tvVideoType; | |
| 428 | - } | |
| 429 | - | |
| 430 | - public String getCarType() { | |
| 431 | - return carType; | |
| 432 | - } | |
| 433 | - | |
| 434 | - public void setCarType(String carType) { | |
| 435 | - this.carType = carType; | |
| 436 | - } | |
| 437 | - | |
| 438 | - public String getVehicleStats() { | |
| 439 | - return vehicleStats; | |
| 440 | - } | |
| 441 | - | |
| 442 | - public void setVehicleStats(String vehicleStats) { | |
| 443 | - this.vehicleStats = vehicleStats; | |
| 444 | - } | |
| 445 | - | |
| 446 | - public String getOperatorsState() { | |
| 447 | - return operatorsState; | |
| 448 | - } | |
| 449 | - | |
| 450 | - public void setOperatorsState(String operatorsState) { | |
| 451 | - this.operatorsState = operatorsState; | |
| 452 | - } | |
| 453 | - | |
| 454 | - public Boolean getSfdc() { | |
| 455 | - return sfdc; | |
| 456 | - } | |
| 457 | - | |
| 458 | - public void setSfdc(Boolean sfdc) { | |
| 459 | - this.sfdc = sfdc; | |
| 460 | - } | |
| 461 | - | |
| 462 | - public String getDescriptions() { | |
| 463 | - return descriptions; | |
| 464 | - } | |
| 465 | - | |
| 466 | - public void setDescriptions(String descriptions) { | |
| 467 | - this.descriptions = descriptions; | |
| 468 | - } | |
| 469 | - | |
| 470 | - public String getCarOrdinal() { | |
| 471 | - return carOrdinal; | |
| 472 | - } | |
| 473 | - | |
| 474 | - public void setCarOrdinal(String carOrdinal) { | |
| 475 | - this.carOrdinal = carOrdinal; | |
| 476 | - } | |
| 477 | - | |
| 478 | - public String getVideoCode() { | |
| 479 | - return videoCode; | |
| 480 | - } | |
| 481 | - | |
| 482 | - public void setVideoCode(String videoCode) { | |
| 483 | - this.videoCode = videoCode; | |
| 484 | - } | |
| 485 | - | |
| 486 | - public Boolean getScrapState() { | |
| 487 | - return scrapState; | |
| 488 | - } | |
| 489 | - | |
| 490 | - public void setScrapState(Boolean scrapState) { | |
| 491 | - this.scrapState = scrapState; | |
| 492 | - } | |
| 493 | - | |
| 494 | - public Integer getIsSwitch() { | |
| 495 | - return isSwitch; | |
| 496 | - } | |
| 497 | - | |
| 498 | - public void setIsSwitch(Integer isSwitch) { | |
| 499 | - this.isSwitch = isSwitch; | |
| 500 | - } | |
| 501 | - | |
| 502 | - public String getXlmc() { | |
| 503 | - return xlmc; | |
| 504 | - } | |
| 505 | - | |
| 506 | - public void setXlmc(String xlmc) { | |
| 507 | - this.xlmc = xlmc; | |
| 508 | - } | |
| 509 | - | |
| 510 | - public String getCgsbm() { | |
| 511 | - return cgsbm; | |
| 512 | - } | |
| 513 | - | |
| 514 | - public void setCgsbm(String cgsbm) { | |
| 515 | - this.cgsbm = cgsbm; | |
| 516 | - } | |
| 517 | - | |
| 518 | - public Boolean getSfmix() { | |
| 519 | - return sfmix; | |
| 520 | - } | |
| 521 | - | |
| 522 | - public void setSfmix(Boolean sfmix) { | |
| 523 | - this.sfmix = sfmix; | |
| 524 | - } | |
| 525 | -} | |
| 1 | +package com.bsth.entity; | |
| 2 | + | |
| 3 | +import com.bsth.entity.schedule.BEntity; | |
| 4 | +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | |
| 5 | +import org.hibernate.annotations.Formula; | |
| 6 | + | |
| 7 | +import javax.persistence.*; | |
| 8 | +import java.io.Serializable; | |
| 9 | +import java.util.Date; | |
| 10 | + | |
| 11 | +/** | |
| 12 | + * | |
| 13 | + * @ClassName : Cars(车实体类) | |
| 14 | + * | |
| 15 | + * @Author : bsth@lq | |
| 16 | + * | |
| 17 | + * @Description : TODO(车辆基本信息) | |
| 18 | + * | |
| 19 | + * @Data : 2016-04-27 | |
| 20 | + * | |
| 21 | + * @Version 公交调度系统BS版 0.1 | |
| 22 | + * | |
| 23 | + */ | |
| 24 | + | |
| 25 | +@Entity | |
| 26 | +@Table(name = "bsth_c_cars") | |
| 27 | +@JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"}) | |
| 28 | +public class Cars extends BEntity implements Serializable { | |
| 29 | + | |
| 30 | + /** 主键Id */ | |
| 31 | + @Id | |
| 32 | + @GeneratedValue(strategy = GenerationType.IDENTITY) | |
| 33 | + private Integer id; | |
| 34 | + | |
| 35 | + /** 自编号/内部编号 */ | |
| 36 | + @Column(nullable = false, length = 20, unique = true) | |
| 37 | + private String insideCode; | |
| 38 | + | |
| 39 | + // 公司、分公司暂时不用关联实体 | |
| 40 | + /** 公司代码 */ | |
| 41 | + @Column(nullable = false) | |
| 42 | + private String businessCode; | |
| 43 | + /** 公司名称 */ | |
| 44 | + @Column(nullable = false) | |
| 45 | + private String company; | |
| 46 | + /** 分公司编码 */ | |
| 47 | + private String brancheCompanyCode; | |
| 48 | + /** 分公司 */ | |
| 49 | + private String brancheCompany; | |
| 50 | + | |
| 51 | + /** 组合公司分公司编码 */ | |
| 52 | + @Formula(" concat(business_code, '_', branche_company_code) ") | |
| 53 | + private String cgsbm; | |
| 54 | + | |
| 55 | + /** 车辆编码(TODO:在原系统里没有,这里暂时留着) */ | |
| 56 | + @Column(nullable = false) | |
| 57 | + private String carCode; | |
| 58 | + /** 车牌号 */ | |
| 59 | + @Column(nullable = false) | |
| 60 | + private String carPlate; | |
| 61 | + /** 供应商名称 */ | |
| 62 | + @Column(nullable = false) | |
| 63 | + private String supplierName; | |
| 64 | + /** 设备终端号 */ | |
| 65 | + @Column(nullable = false) | |
| 66 | + private String equipmentCode; | |
| 67 | + | |
| 68 | + // 以下信息来自总公司的业务系统,可能需要调用相关接口 | |
| 69 | + /** 车型类别 */ | |
| 70 | + private String carClass ; | |
| 71 | + /** 技术速度 */ | |
| 72 | + private Double speed; | |
| 73 | + /** 座位数 */ | |
| 74 | + private Integer carSeatnNumber; | |
| 75 | + /** 载客标准 */ | |
| 76 | + private String carStandard; | |
| 77 | + /** 标准油耗(开空调) */ | |
| 78 | + private Double kburnStandard; | |
| 79 | + /** 标准油耗(关空调) */ | |
| 80 | + private Double gburnStandard; | |
| 81 | + /** 报废号 */ | |
| 82 | + private String scrapCode; | |
| 83 | + /** 报废日期 */ | |
| 84 | + private Date scrapDate; | |
| 85 | + /** 厂牌型号1 */ | |
| 86 | + private String makeCodeOne; | |
| 87 | + /** 厂牌型号2 */ | |
| 88 | + private String makeCodeTwo; | |
| 89 | + /** 车辆等级标准 */ | |
| 90 | + private String carGride; | |
| 91 | + /** 出厂排放标准 */ | |
| 92 | + private String emissionsStandard; | |
| 93 | + /** 发动机号码1 */ | |
| 94 | + private String engineCodeOne; | |
| 95 | + /** 发动机号码2 */ | |
| 96 | + private String engineCodeTwo; | |
| 97 | + /** 车架号码1 */ | |
| 98 | + private String carNumberOne; | |
| 99 | + /** 车架号码2 */ | |
| 100 | + private String carNumberTwo; | |
| 101 | + /** 启用日期(2008-10-10)*/ | |
| 102 | + private Date openDate; | |
| 103 | + /** 取消日期 */ | |
| 104 | + private Date closeDate; | |
| 105 | + | |
| 106 | + /** 是否空调车 */ | |
| 107 | + @Column(nullable = true) | |
| 108 | + private Boolean hvacCar; | |
| 109 | + /** 有无人售票 */ | |
| 110 | + @Column(nullable = true) | |
| 111 | + private Boolean ticketType; | |
| 112 | + /** 是否有LED服务屏 */ | |
| 113 | + @Column(nullable = true) | |
| 114 | + private Boolean ledScreen; | |
| 115 | + /** 是否有TV视频 */ | |
| 116 | + @Column(nullable = true) | |
| 117 | + private Boolean tvVideoType; | |
| 118 | + | |
| 119 | + /** 车辆类型 */ | |
| 120 | + private String carType; | |
| 121 | + /** 是否机动车(机动车类型选择)*/ | |
| 122 | + private String vehicleStats; | |
| 123 | + /** 营运状态 */ | |
| 124 | + private String operatorsState; | |
| 125 | + /** 营运证编码 */ | |
| 126 | + private String serviceNo; | |
| 127 | + /** 是否电车(TODO:在原系统里没有,这里暂时留着) */ | |
| 128 | + private Boolean sfdc; | |
| 129 | + /** 是否混合动力(TODO:在原系统里没有,这里暂时留着) */ | |
| 130 | + private Boolean sfmix; | |
| 131 | + /** 是否氢能源车 */ | |
| 132 | + private Boolean hydrogen; | |
| 133 | + /** 备注/描述 */ | |
| 134 | + private String descriptions; | |
| 135 | + | |
| 136 | + /** 车辆序号(TODO:在原系统里没有,这里暂时留着) */ | |
| 137 | + private String carOrdinal; | |
| 138 | + /** 视频编号 */ | |
| 139 | + private String videoCode; | |
| 140 | + /** 是否报废 */ | |
| 141 | + @Column(nullable = true) | |
| 142 | + private Boolean scrapState; | |
| 143 | + /** 是否切换(TODO:在原系统里没有,这里暂时留着)*/ | |
| 144 | + private Integer isSwitch; | |
| 145 | + /** 线路名称(TODO:在原系统里没有,这里暂时留着,并且不做线路关联,只保留个名字) */ | |
| 146 | + private String xlmc; | |
| 147 | + | |
| 148 | + public Cars() {} | |
| 149 | + | |
| 150 | + public Cars(Object id, Object nbbh, Object clbh, Object cph, Object sbbh) { | |
| 151 | + if (id != null) { | |
| 152 | + this.id = Integer.valueOf(id.toString()); | |
| 153 | + } | |
| 154 | + if (nbbh != null) { | |
| 155 | + this.insideCode = nbbh.toString(); | |
| 156 | + } | |
| 157 | + if (clbh != null) { | |
| 158 | + this.carCode = clbh.toString(); | |
| 159 | + } | |
| 160 | + if (cph != null) { | |
| 161 | + this.carPlate = cph.toString(); | |
| 162 | + } | |
| 163 | + if (sbbh != null) { | |
| 164 | + this.equipmentCode = sbbh.toString(); | |
| 165 | + } | |
| 166 | + } | |
| 167 | + | |
| 168 | + public String getServiceNo() { | |
| 169 | + return serviceNo; | |
| 170 | + } | |
| 171 | + | |
| 172 | + public void setServiceNo(String serviceNo) { | |
| 173 | + this.serviceNo = serviceNo; | |
| 174 | + } | |
| 175 | + | |
| 176 | + public Integer getId() { | |
| 177 | + return id; | |
| 178 | + } | |
| 179 | + | |
| 180 | + public void setId(Integer id) { | |
| 181 | + this.id = id; | |
| 182 | + } | |
| 183 | + | |
| 184 | + public String getInsideCode() { | |
| 185 | + return insideCode; | |
| 186 | + } | |
| 187 | + | |
| 188 | + public void setInsideCode(String insideCode) { | |
| 189 | + this.insideCode = insideCode; | |
| 190 | + } | |
| 191 | + | |
| 192 | + public String getBusinessCode() { | |
| 193 | + return businessCode; | |
| 194 | + } | |
| 195 | + | |
| 196 | + public void setBusinessCode(String businessCode) { | |
| 197 | + this.businessCode = businessCode; | |
| 198 | + } | |
| 199 | + | |
| 200 | + public String getCompany() { | |
| 201 | + return company; | |
| 202 | + } | |
| 203 | + | |
| 204 | + public void setCompany(String company) { | |
| 205 | + this.company = company; | |
| 206 | + } | |
| 207 | + | |
| 208 | + public String getBrancheCompanyCode() { | |
| 209 | + return brancheCompanyCode; | |
| 210 | + } | |
| 211 | + | |
| 212 | + public void setBrancheCompanyCode(String brancheCompanyCode) { | |
| 213 | + this.brancheCompanyCode = brancheCompanyCode; | |
| 214 | + } | |
| 215 | + | |
| 216 | + public String getBrancheCompany() { | |
| 217 | + return brancheCompany; | |
| 218 | + } | |
| 219 | + | |
| 220 | + public void setBrancheCompany(String brancheCompany) { | |
| 221 | + this.brancheCompany = brancheCompany; | |
| 222 | + } | |
| 223 | + | |
| 224 | + public String getCarCode() { | |
| 225 | + return carCode; | |
| 226 | + } | |
| 227 | + | |
| 228 | + public void setCarCode(String carCode) { | |
| 229 | + this.carCode = carCode; | |
| 230 | + } | |
| 231 | + | |
| 232 | + public String getCarPlate() { | |
| 233 | + return carPlate; | |
| 234 | + } | |
| 235 | + | |
| 236 | + public void setCarPlate(String carPlate) { | |
| 237 | + this.carPlate = carPlate; | |
| 238 | + } | |
| 239 | + | |
| 240 | + public String getSupplierName() { | |
| 241 | + return supplierName; | |
| 242 | + } | |
| 243 | + | |
| 244 | + public void setSupplierName(String supplierName) { | |
| 245 | + this.supplierName = supplierName; | |
| 246 | + } | |
| 247 | + | |
| 248 | + public String getEquipmentCode() { | |
| 249 | + return equipmentCode; | |
| 250 | + } | |
| 251 | + | |
| 252 | + public void setEquipmentCode(String equipmentCode) { | |
| 253 | + this.equipmentCode = equipmentCode; | |
| 254 | + } | |
| 255 | + | |
| 256 | + public String getCarClass() { | |
| 257 | + return carClass; | |
| 258 | + } | |
| 259 | + | |
| 260 | + public void setCarClass(String carClass) { | |
| 261 | + this.carClass = carClass; | |
| 262 | + } | |
| 263 | + | |
| 264 | + public Double getSpeed() { | |
| 265 | + return speed; | |
| 266 | + } | |
| 267 | + | |
| 268 | + public void setSpeed(Double speed) { | |
| 269 | + this.speed = speed; | |
| 270 | + } | |
| 271 | + | |
| 272 | + public Integer getCarSeatnNumber() { | |
| 273 | + return carSeatnNumber; | |
| 274 | + } | |
| 275 | + | |
| 276 | + public void setCarSeatnNumber(Integer carSeatnNumber) { | |
| 277 | + this.carSeatnNumber = carSeatnNumber; | |
| 278 | + } | |
| 279 | + | |
| 280 | + public String getCarStandard() { | |
| 281 | + return carStandard; | |
| 282 | + } | |
| 283 | + | |
| 284 | + public void setCarStandard(String carStandard) { | |
| 285 | + this.carStandard = carStandard; | |
| 286 | + } | |
| 287 | + | |
| 288 | + public Double getKburnStandard() { | |
| 289 | + return kburnStandard; | |
| 290 | + } | |
| 291 | + | |
| 292 | + public void setKburnStandard(Double kburnStandard) { | |
| 293 | + this.kburnStandard = kburnStandard; | |
| 294 | + } | |
| 295 | + | |
| 296 | + public Double getGburnStandard() { | |
| 297 | + return gburnStandard; | |
| 298 | + } | |
| 299 | + | |
| 300 | + public void setGburnStandard(Double gburnStandard) { | |
| 301 | + this.gburnStandard = gburnStandard; | |
| 302 | + } | |
| 303 | + | |
| 304 | + public String getScrapCode() { | |
| 305 | + return scrapCode; | |
| 306 | + } | |
| 307 | + | |
| 308 | + public void setScrapCode(String scrapCode) { | |
| 309 | + this.scrapCode = scrapCode; | |
| 310 | + } | |
| 311 | + | |
| 312 | + public Date getScrapDate() { | |
| 313 | + return scrapDate; | |
| 314 | + } | |
| 315 | + | |
| 316 | + public void setScrapDate(Date scrapDate) { | |
| 317 | + this.scrapDate = scrapDate; | |
| 318 | + } | |
| 319 | + | |
| 320 | + public String getMakeCodeOne() { | |
| 321 | + return makeCodeOne; | |
| 322 | + } | |
| 323 | + | |
| 324 | + public void setMakeCodeOne(String makeCodeOne) { | |
| 325 | + this.makeCodeOne = makeCodeOne; | |
| 326 | + } | |
| 327 | + | |
| 328 | + public String getMakeCodeTwo() { | |
| 329 | + return makeCodeTwo; | |
| 330 | + } | |
| 331 | + | |
| 332 | + public void setMakeCodeTwo(String makeCodeTwo) { | |
| 333 | + this.makeCodeTwo = makeCodeTwo; | |
| 334 | + } | |
| 335 | + | |
| 336 | + public String getCarGride() { | |
| 337 | + return carGride; | |
| 338 | + } | |
| 339 | + | |
| 340 | + public void setCarGride(String carGride) { | |
| 341 | + this.carGride = carGride; | |
| 342 | + } | |
| 343 | + | |
| 344 | + public String getEmissionsStandard() { | |
| 345 | + return emissionsStandard; | |
| 346 | + } | |
| 347 | + | |
| 348 | + public void setEmissionsStandard(String emissionsStandard) { | |
| 349 | + this.emissionsStandard = emissionsStandard; | |
| 350 | + } | |
| 351 | + | |
| 352 | + public String getEngineCodeOne() { | |
| 353 | + return engineCodeOne; | |
| 354 | + } | |
| 355 | + | |
| 356 | + public void setEngineCodeOne(String engineCodeOne) { | |
| 357 | + this.engineCodeOne = engineCodeOne; | |
| 358 | + } | |
| 359 | + | |
| 360 | + public String getEngineCodeTwo() { | |
| 361 | + return engineCodeTwo; | |
| 362 | + } | |
| 363 | + | |
| 364 | + public void setEngineCodeTwo(String engineCodeTwo) { | |
| 365 | + this.engineCodeTwo = engineCodeTwo; | |
| 366 | + } | |
| 367 | + | |
| 368 | + public String getCarNumberOne() { | |
| 369 | + return carNumberOne; | |
| 370 | + } | |
| 371 | + | |
| 372 | + public void setCarNumberOne(String carNumberOne) { | |
| 373 | + this.carNumberOne = carNumberOne; | |
| 374 | + } | |
| 375 | + | |
| 376 | + public String getCarNumberTwo() { | |
| 377 | + return carNumberTwo; | |
| 378 | + } | |
| 379 | + | |
| 380 | + public void setCarNumberTwo(String carNumberTwo) { | |
| 381 | + this.carNumberTwo = carNumberTwo; | |
| 382 | + } | |
| 383 | + | |
| 384 | + public Date getOpenDate() { | |
| 385 | + return openDate; | |
| 386 | + } | |
| 387 | + | |
| 388 | + public void setOpenDate(Date openDate) { | |
| 389 | + this.openDate = openDate; | |
| 390 | + } | |
| 391 | + | |
| 392 | + public Date getCloseDate() { | |
| 393 | + return closeDate; | |
| 394 | + } | |
| 395 | + | |
| 396 | + public void setCloseDate(Date closeDate) { | |
| 397 | + this.closeDate = closeDate; | |
| 398 | + } | |
| 399 | + | |
| 400 | + public Boolean getHvacCar() { | |
| 401 | + return hvacCar; | |
| 402 | + } | |
| 403 | + | |
| 404 | + public void setHvacCar(Boolean hvacCar) { | |
| 405 | + this.hvacCar = hvacCar; | |
| 406 | + } | |
| 407 | + | |
| 408 | + public Boolean getTicketType() { | |
| 409 | + return ticketType; | |
| 410 | + } | |
| 411 | + | |
| 412 | + public void setTicketType(Boolean ticketType) { | |
| 413 | + this.ticketType = ticketType; | |
| 414 | + } | |
| 415 | + | |
| 416 | + public Boolean getLedScreen() { | |
| 417 | + return ledScreen; | |
| 418 | + } | |
| 419 | + | |
| 420 | + public void setLedScreen(Boolean ledScreen) { | |
| 421 | + this.ledScreen = ledScreen; | |
| 422 | + } | |
| 423 | + | |
| 424 | + public Boolean getTvVideoType() { | |
| 425 | + return tvVideoType; | |
| 426 | + } | |
| 427 | + | |
| 428 | + public void setTvVideoType(Boolean tvVideoType) { | |
| 429 | + this.tvVideoType = tvVideoType; | |
| 430 | + } | |
| 431 | + | |
| 432 | + public String getCarType() { | |
| 433 | + return carType; | |
| 434 | + } | |
| 435 | + | |
| 436 | + public void setCarType(String carType) { | |
| 437 | + this.carType = carType; | |
| 438 | + } | |
| 439 | + | |
| 440 | + public String getVehicleStats() { | |
| 441 | + return vehicleStats; | |
| 442 | + } | |
| 443 | + | |
| 444 | + public void setVehicleStats(String vehicleStats) { | |
| 445 | + this.vehicleStats = vehicleStats; | |
| 446 | + } | |
| 447 | + | |
| 448 | + public String getOperatorsState() { | |
| 449 | + return operatorsState; | |
| 450 | + } | |
| 451 | + | |
| 452 | + public void setOperatorsState(String operatorsState) { | |
| 453 | + this.operatorsState = operatorsState; | |
| 454 | + } | |
| 455 | + | |
| 456 | + public Boolean getSfdc() { | |
| 457 | + return sfdc; | |
| 458 | + } | |
| 459 | + | |
| 460 | + public void setSfdc(Boolean sfdc) { | |
| 461 | + this.sfdc = sfdc; | |
| 462 | + } | |
| 463 | + | |
| 464 | + public String getDescriptions() { | |
| 465 | + return descriptions; | |
| 466 | + } | |
| 467 | + | |
| 468 | + public void setDescriptions(String descriptions) { | |
| 469 | + this.descriptions = descriptions; | |
| 470 | + } | |
| 471 | + | |
| 472 | + public String getCarOrdinal() { | |
| 473 | + return carOrdinal; | |
| 474 | + } | |
| 475 | + | |
| 476 | + public void setCarOrdinal(String carOrdinal) { | |
| 477 | + this.carOrdinal = carOrdinal; | |
| 478 | + } | |
| 479 | + | |
| 480 | + public String getVideoCode() { | |
| 481 | + return videoCode; | |
| 482 | + } | |
| 483 | + | |
| 484 | + public void setVideoCode(String videoCode) { | |
| 485 | + this.videoCode = videoCode; | |
| 486 | + } | |
| 487 | + | |
| 488 | + public Boolean getScrapState() { | |
| 489 | + return scrapState; | |
| 490 | + } | |
| 491 | + | |
| 492 | + public void setScrapState(Boolean scrapState) { | |
| 493 | + this.scrapState = scrapState; | |
| 494 | + } | |
| 495 | + | |
| 496 | + public Integer getIsSwitch() { | |
| 497 | + return isSwitch; | |
| 498 | + } | |
| 499 | + | |
| 500 | + public void setIsSwitch(Integer isSwitch) { | |
| 501 | + this.isSwitch = isSwitch; | |
| 502 | + } | |
| 503 | + | |
| 504 | + public String getXlmc() { | |
| 505 | + return xlmc; | |
| 506 | + } | |
| 507 | + | |
| 508 | + public void setXlmc(String xlmc) { | |
| 509 | + this.xlmc = xlmc; | |
| 510 | + } | |
| 511 | + | |
| 512 | + public String getCgsbm() { | |
| 513 | + return cgsbm; | |
| 514 | + } | |
| 515 | + | |
| 516 | + public void setCgsbm(String cgsbm) { | |
| 517 | + this.cgsbm = cgsbm; | |
| 518 | + } | |
| 519 | + | |
| 520 | + public Boolean getSfmix() { | |
| 521 | + return sfmix; | |
| 522 | + } | |
| 523 | + | |
| 524 | + public void setSfmix(Boolean sfmix) { | |
| 525 | + this.sfmix = sfmix; | |
| 526 | + } | |
| 527 | + | |
| 528 | + public Boolean getHydrogen() { | |
| 529 | + return hydrogen; | |
| 530 | + } | |
| 531 | + | |
| 532 | + public void setHydrogen(Boolean hydrogen) { | |
| 533 | + this.hydrogen = hydrogen; | |
| 534 | + } | |
| 535 | +} | ... | ... |
src/main/java/com/bsth/entity/oil/Jql.java
0 → 100644
| 1 | +package com.bsth.entity.oil; | |
| 2 | + | |
| 3 | +import java.util.Date; | |
| 4 | + | |
| 5 | +import javax.persistence.*; | |
| 6 | + | |
| 7 | +import org.springframework.format.annotation.DateTimeFormat; | |
| 8 | + | |
| 9 | +@Entity | |
| 10 | +@Table(name = "bsth_c_jql") | |
| 11 | +public class Jql { | |
| 12 | + @Id | |
| 13 | + @GeneratedValue(strategy = GenerationType.IDENTITY) | |
| 14 | + private Integer id; | |
| 15 | + @DateTimeFormat(pattern="yyyy-MM-dd") | |
| 16 | + private Date rq; | |
| 17 | + private String gsBm; | |
| 18 | + private String gsName; | |
| 19 | + private String fgsBm; | |
| 20 | + private String fgsName; | |
| 21 | + private String nbbm; | |
| 22 | + private String jsy; | |
| 23 | + private Double jql = 0.0; | |
| 24 | + private String jqz; | |
| 25 | + private String remarks; | |
| 26 | + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") | |
| 27 | + private Date createrDate; | |
| 28 | + | |
| 29 | + | |
| 30 | + public Integer getId() { | |
| 31 | + return id; | |
| 32 | + } | |
| 33 | + public void setId(Integer id) { | |
| 34 | + this.id = id; | |
| 35 | + } | |
| 36 | + public Date getRq() { | |
| 37 | + return rq; | |
| 38 | + } | |
| 39 | + public void setRq(Date rq) { | |
| 40 | + this.rq = rq; | |
| 41 | + } | |
| 42 | + public String getGsBm() { | |
| 43 | + return gsBm; | |
| 44 | + } | |
| 45 | + public void setGsBm(String gsBm) { | |
| 46 | + this.gsBm = gsBm; | |
| 47 | + } | |
| 48 | + public String getGsName() { | |
| 49 | + return gsName; | |
| 50 | + } | |
| 51 | + public void setGsName(String gsName) { | |
| 52 | + this.gsName = gsName; | |
| 53 | + } | |
| 54 | + public String getFgsBm() { | |
| 55 | + return fgsBm; | |
| 56 | + } | |
| 57 | + public void setFgsBm(String fgsBm) { | |
| 58 | + this.fgsBm = fgsBm; | |
| 59 | + } | |
| 60 | + public String getFgsName() { | |
| 61 | + return fgsName; | |
| 62 | + } | |
| 63 | + public void setFgsName(String fgsName) { | |
| 64 | + this.fgsName = fgsName; | |
| 65 | + } | |
| 66 | + public String getNbbm() { | |
| 67 | + return nbbm; | |
| 68 | + } | |
| 69 | + public void setNbbm(String nbbm) { | |
| 70 | + this.nbbm = nbbm; | |
| 71 | + } | |
| 72 | + public Double getJql() { | |
| 73 | + return jql; | |
| 74 | + } | |
| 75 | + public void setJql(Double jql) { | |
| 76 | + this.jql = jql; | |
| 77 | + } | |
| 78 | + public String getJqz() { | |
| 79 | + return jqz; | |
| 80 | + } | |
| 81 | + public void setJqz(String jqz) { | |
| 82 | + this.jqz = jqz; | |
| 83 | + } | |
| 84 | + public String getRemarks() { | |
| 85 | + return remarks; | |
| 86 | + } | |
| 87 | + public void setRemarks(String remarks) { | |
| 88 | + this.remarks = remarks; | |
| 89 | + } | |
| 90 | + public Date getCreaterDate() { | |
| 91 | + return createrDate; | |
| 92 | + } | |
| 93 | + public void setCreaterDate(Date createrDate) { | |
| 94 | + this.createrDate = createrDate; | |
| 95 | + } | |
| 96 | + public String getJsy() { | |
| 97 | + return jsy; | |
| 98 | + } | |
| 99 | + public void setJsy(String jsy) { | |
| 100 | + this.jsy = jsy; | |
| 101 | + } | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | +} | ... | ... |
src/main/java/com/bsth/entity/oil/Qlb.java
0 → 100644
| 1 | +package com.bsth.entity.oil; | |
| 2 | + | |
| 3 | +import java.text.DecimalFormat; | |
| 4 | +import java.util.Date; | |
| 5 | + | |
| 6 | +import javax.persistence.*; | |
| 7 | + | |
| 8 | +import org.springframework.format.annotation.DateTimeFormat; | |
| 9 | + | |
| 10 | +import com.bsth.data.BasicData; | |
| 11 | + | |
| 12 | +@Entity | |
| 13 | +@Table(name = "bsth_c_qlb") | |
| 14 | +public class Qlb { | |
| 15 | + @Id | |
| 16 | + @GeneratedValue(strategy = GenerationType.IDENTITY) | |
| 17 | + private Integer id; | |
| 18 | + @DateTimeFormat(pattern="yyyy-MM-dd") | |
| 19 | + private Date rq; | |
| 20 | + private String xlbm; | |
| 21 | + private String linename; | |
| 22 | + private String ssgsdm; | |
| 23 | + private String fgsdm; | |
| 24 | + private String nbbm; | |
| 25 | + private String jsy; | |
| 26 | + private Double czlc=0.0; | |
| 27 | + private Double jzlc=0.0; | |
| 28 | + //出站存量 | |
| 29 | + private Double czcl=0.0; | |
| 30 | + //进站存量 | |
| 31 | + private Double jzcl=0.0; | |
| 32 | + //充电量 | |
| 33 | + private Double jql; | |
| 34 | + //是否跨天营运 | |
| 35 | + private int sfkt; | |
| 36 | + private String jhsj; | |
| 37 | + //耗能 | |
| 38 | + private Double hn=0.0; | |
| 39 | + //损耗 | |
| 40 | + private Double sh=0.0; | |
| 41 | + //损耗原因 | |
| 42 | + private String shyy; | |
| 43 | + private Double zlc=0.0; | |
| 44 | + //能耗类型 | |
| 45 | + private int nhlx; | |
| 46 | + //尿素 | |
| 47 | + private Double ns=0.0; | |
| 48 | + private Double fyylc=0.0; | |
| 49 | + private Double jhzlc=0.0; | |
| 50 | + private Double jhfyylc=0.0; | |
| 51 | + private int jhzbc; | |
| 52 | + private int jhbc; | |
| 53 | + private int sjzbc; | |
| 54 | + private int sjbc; | |
| 55 | + private String edituser; | |
| 56 | + private Date edittime; | |
| 57 | + private Date createtime; | |
| 58 | + private Date updatetime; | |
| 59 | + //能源类型 | |
| 60 | + private int nylx; | |
| 61 | + //进场顺序(根据最先出场和最后进场来关联车辆的存电量) | |
| 62 | + private int jcsx; | |
| 63 | + | |
| 64 | + private String jname; | |
| 65 | + @Transient | |
| 66 | + private String name; | |
| 67 | + @Transient | |
| 68 | + private String bglhn; | |
| 69 | + | |
| 70 | + @Transient | |
| 71 | + private String xlname; | |
| 72 | + | |
| 73 | + @Transient | |
| 74 | + private String gsname; | |
| 75 | + | |
| 76 | + @Transient | |
| 77 | + private String fgsname; | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + private String lp; | |
| 82 | + | |
| 83 | + public Integer getId() { | |
| 84 | + return id; | |
| 85 | + } | |
| 86 | + | |
| 87 | + public void setId(Integer id) { | |
| 88 | + this.id = id; | |
| 89 | + } | |
| 90 | + | |
| 91 | + public Date getRq() { | |
| 92 | + return rq; | |
| 93 | + } | |
| 94 | + | |
| 95 | + public void setRq(Date rq) { | |
| 96 | + this.rq = rq; | |
| 97 | + } | |
| 98 | + | |
| 99 | + public String getXlbm() { | |
| 100 | + return xlbm; | |
| 101 | + } | |
| 102 | + | |
| 103 | + public void setXlbm(String xlbm) { | |
| 104 | + this.xlbm = xlbm; | |
| 105 | + } | |
| 106 | + | |
| 107 | + public String getLinename() { | |
| 108 | + return linename; | |
| 109 | + } | |
| 110 | + | |
| 111 | + public void setLinename(String linename) { | |
| 112 | + this.linename = linename; | |
| 113 | + } | |
| 114 | + | |
| 115 | + public String getSsgsdm() { | |
| 116 | + return ssgsdm; | |
| 117 | + } | |
| 118 | + | |
| 119 | + public void setSsgsdm(String ssgsdm) { | |
| 120 | + this.ssgsdm = ssgsdm; | |
| 121 | + } | |
| 122 | + | |
| 123 | + public String getFgsdm() { | |
| 124 | + return fgsdm; | |
| 125 | + } | |
| 126 | + | |
| 127 | + public void setFgsdm(String fgsdm) { | |
| 128 | + this.fgsdm = fgsdm; | |
| 129 | + } | |
| 130 | + | |
| 131 | + public String getNbbm() { | |
| 132 | + return nbbm; | |
| 133 | + } | |
| 134 | + | |
| 135 | + public void setNbbm(String nbbm) { | |
| 136 | + this.nbbm = nbbm; | |
| 137 | + } | |
| 138 | + | |
| 139 | + public String getJsy() { | |
| 140 | + return jsy; | |
| 141 | + } | |
| 142 | + | |
| 143 | + public void setJsy(String jsy) { | |
| 144 | + this.jsy = jsy; | |
| 145 | + } | |
| 146 | + | |
| 147 | + public Double getCzlc() { | |
| 148 | + return czlc; | |
| 149 | + } | |
| 150 | + | |
| 151 | + public void setCzlc(Double czlc) { | |
| 152 | + this.czlc = czlc; | |
| 153 | + } | |
| 154 | + | |
| 155 | + public Double getJzlc() { | |
| 156 | + return jzlc; | |
| 157 | + } | |
| 158 | + | |
| 159 | + public void setJzlc(Double jzlc) { | |
| 160 | + this.jzlc = jzlc; | |
| 161 | + } | |
| 162 | + | |
| 163 | + public Double getCzcl() { | |
| 164 | + return czcl; | |
| 165 | + } | |
| 166 | + | |
| 167 | + public void setCzcl(Double czcl) { | |
| 168 | + this.czcl = czcl; | |
| 169 | + } | |
| 170 | + | |
| 171 | + public Double getJzcl() { | |
| 172 | + return jzcl; | |
| 173 | + } | |
| 174 | + | |
| 175 | + public void setJzcl(Double jzcl) { | |
| 176 | + this.jzcl = jzcl; | |
| 177 | + } | |
| 178 | + | |
| 179 | + public Double getJql() { | |
| 180 | + return jql; | |
| 181 | + } | |
| 182 | + | |
| 183 | + public void setJql(Double jql) { | |
| 184 | + this.jql = jql; | |
| 185 | + } | |
| 186 | + | |
| 187 | + public int getSfkt() { | |
| 188 | + return sfkt; | |
| 189 | + } | |
| 190 | + | |
| 191 | + public void setSfkt(int sfkt) { | |
| 192 | + this.sfkt = sfkt; | |
| 193 | + } | |
| 194 | + | |
| 195 | + public String getJhsj() { | |
| 196 | + return jhsj; | |
| 197 | + } | |
| 198 | + | |
| 199 | + public void setJhsj(String jhsj) { | |
| 200 | + this.jhsj = jhsj; | |
| 201 | + } | |
| 202 | + | |
| 203 | + public Double getHn() { | |
| 204 | + return hn; | |
| 205 | + } | |
| 206 | + | |
| 207 | + public void setHn(Double hn) { | |
| 208 | + this.hn = hn; | |
| 209 | + } | |
| 210 | + | |
| 211 | + public Double getSh() { | |
| 212 | + return sh; | |
| 213 | + } | |
| 214 | + | |
| 215 | + public void setSh(Double sh) { | |
| 216 | + this.sh = sh; | |
| 217 | + } | |
| 218 | + | |
| 219 | + public String getShyy() { | |
| 220 | + return shyy; | |
| 221 | + } | |
| 222 | + | |
| 223 | + public void setShyy(String shyy) { | |
| 224 | + this.shyy = shyy; | |
| 225 | + } | |
| 226 | + | |
| 227 | + public Double getZlc() { | |
| 228 | + return zlc; | |
| 229 | + } | |
| 230 | + | |
| 231 | + public void setZlc(Double zlc) { | |
| 232 | + this.zlc = zlc; | |
| 233 | + } | |
| 234 | + | |
| 235 | + public int getNhlx() { | |
| 236 | + return nhlx; | |
| 237 | + } | |
| 238 | + | |
| 239 | + public void setNhlx(int nhlx) { | |
| 240 | + this.nhlx = nhlx; | |
| 241 | + } | |
| 242 | + | |
| 243 | + public Double getNs() { | |
| 244 | + return ns; | |
| 245 | + } | |
| 246 | + | |
| 247 | + public void setNs(Double ns) { | |
| 248 | + this.ns = ns; | |
| 249 | + } | |
| 250 | + | |
| 251 | + public Double getFyylc() { | |
| 252 | + return fyylc; | |
| 253 | + } | |
| 254 | + | |
| 255 | + public void setFyylc(Double fyylc) { | |
| 256 | + this.fyylc = fyylc; | |
| 257 | + } | |
| 258 | + | |
| 259 | + public Double getJhzlc() { | |
| 260 | + return jhzlc; | |
| 261 | + } | |
| 262 | + | |
| 263 | + public void setJhzlc(Double jhzlc) { | |
| 264 | + this.jhzlc = jhzlc; | |
| 265 | + } | |
| 266 | + | |
| 267 | + public Double getJhfyylc() { | |
| 268 | + return jhfyylc; | |
| 269 | + } | |
| 270 | + | |
| 271 | + public void setJhfyylc(Double jhfyylc) { | |
| 272 | + this.jhfyylc = jhfyylc; | |
| 273 | + } | |
| 274 | + | |
| 275 | + public int getJhzbc() { | |
| 276 | + return jhzbc; | |
| 277 | + } | |
| 278 | + | |
| 279 | + public void setJhzbc(int jhzbc) { | |
| 280 | + this.jhzbc = jhzbc; | |
| 281 | + } | |
| 282 | + | |
| 283 | + public int getJhbc() { | |
| 284 | + return jhbc; | |
| 285 | + } | |
| 286 | + | |
| 287 | + public void setJhbc(int jhbc) { | |
| 288 | + this.jhbc = jhbc; | |
| 289 | + } | |
| 290 | + | |
| 291 | + public int getSjzbc() { | |
| 292 | + return sjzbc; | |
| 293 | + } | |
| 294 | + | |
| 295 | + public void setSjzbc(int sjzbc) { | |
| 296 | + this.sjzbc = sjzbc; | |
| 297 | + } | |
| 298 | + | |
| 299 | + public int getSjbc() { | |
| 300 | + return sjbc; | |
| 301 | + } | |
| 302 | + | |
| 303 | + public void setSjbc(int sjbc) { | |
| 304 | + this.sjbc = sjbc; | |
| 305 | + } | |
| 306 | + | |
| 307 | + public String getEdituser() { | |
| 308 | + return edituser; | |
| 309 | + } | |
| 310 | + | |
| 311 | + public void setEdituser(String edituser) { | |
| 312 | + this.edituser = edituser; | |
| 313 | + } | |
| 314 | + | |
| 315 | + public Date getEdittime() { | |
| 316 | + return edittime; | |
| 317 | + } | |
| 318 | + | |
| 319 | + public void setEdittime(Date edittime) { | |
| 320 | + this.edittime = edittime; | |
| 321 | + } | |
| 322 | + | |
| 323 | + public Date getCreatetime() { | |
| 324 | + return createtime; | |
| 325 | + } | |
| 326 | + | |
| 327 | + public void setCreatetime(Date createtime) { | |
| 328 | + this.createtime = createtime; | |
| 329 | + } | |
| 330 | + | |
| 331 | + public int getNylx() { | |
| 332 | + return nylx; | |
| 333 | + } | |
| 334 | + | |
| 335 | + public void setNylx(int nylx) { | |
| 336 | + this.nylx = nylx; | |
| 337 | + } | |
| 338 | + | |
| 339 | + public int getJcsx() { | |
| 340 | + return jcsx; | |
| 341 | + } | |
| 342 | + | |
| 343 | + public void setJcsx(int jcsx) { | |
| 344 | + this.jcsx = jcsx; | |
| 345 | + } | |
| 346 | + | |
| 347 | + public String getBglhn() { | |
| 348 | + if(this.getZlc()==0){ | |
| 349 | + return "0"; | |
| 350 | + }else{ | |
| 351 | + DecimalFormat df = new DecimalFormat("0.00"); | |
| 352 | + return df.format(this.getHn()/this.getZlc()*100); | |
| 353 | + } | |
| 354 | + } | |
| 355 | + | |
| 356 | + public void setBglhn(String bglhn) { | |
| 357 | + this.bglhn = bglhn; | |
| 358 | + } | |
| 359 | + | |
| 360 | + public String getXlname() { | |
| 361 | + return BasicData.lineCodeAllNameMap.get(this.xlbm); | |
| 362 | + } | |
| 363 | + | |
| 364 | + public void setXlname(String xlname) { | |
| 365 | + this.xlname = xlname; | |
| 366 | + } | |
| 367 | + | |
| 368 | + public String getGsname() { | |
| 369 | + return BasicData.businessCodeNameMap.get(this.ssgsdm); | |
| 370 | + } | |
| 371 | + | |
| 372 | + public void setGsname(String gsname) { | |
| 373 | + this.gsname = gsname; | |
| 374 | + } | |
| 375 | + | |
| 376 | + public String getName() { | |
| 377 | + return BasicData.allPerson.get(this.ssgsdm+"-"+this.jsy); | |
| 378 | + } | |
| 379 | + | |
| 380 | + public void setName(String name) { | |
| 381 | + this.name = name; | |
| 382 | + } | |
| 383 | + | |
| 384 | + public String getFgsname() { | |
| 385 | + return BasicData.businessFgsCodeNameMap.get(this.fgsdm+"_"+this.ssgsdm); | |
| 386 | + } | |
| 387 | + | |
| 388 | + public void setFgsname(String fgsname) { | |
| 389 | + this.fgsname = fgsname; | |
| 390 | + } | |
| 391 | + | |
| 392 | + public Date getUpdatetime() { | |
| 393 | + return updatetime; | |
| 394 | + } | |
| 395 | + | |
| 396 | + public void setUpdatetime(Date updatetime) { | |
| 397 | + this.updatetime = updatetime; | |
| 398 | + } | |
| 399 | + | |
| 400 | + public String getLp() { | |
| 401 | + return lp; | |
| 402 | + } | |
| 403 | + | |
| 404 | + public void setLp(String lp) { | |
| 405 | + this.lp = lp; | |
| 406 | + } | |
| 407 | + | |
| 408 | + public String getJname() { | |
| 409 | + return jname; | |
| 410 | + } | |
| 411 | + | |
| 412 | + public void setJname(String jname) { | |
| 413 | + this.jname = jname; | |
| 414 | + } | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | +} | ... | ... |
src/main/java/com/bsth/repository/oil/JdlRepository.java
| ... | ... | @@ -38,4 +38,7 @@ public interface JdlRepository extends BaseRepository<Jdl, Integer>{ |
| 38 | 38 | @Query(value="UPDATE bsth_c_jdl set jdl = ?1 where gs_bm = ?2 and fgs_bm = ?3 and rq = ?4 and nbbm = ?5",nativeQuery=true) |
| 39 | 39 | void UpdateJdl(String jdl, String gsbm, String fgsbm, String rq, String nbbm); |
| 40 | 40 | |
| 41 | + @Query(value="SELECT * FROM bsth_c_jdl where rq=?1 and gs_bm like %?2%",nativeQuery=true) | |
| 42 | + List<Jdl> obtainJdl(String rq, String gsbm); | |
| 43 | + | |
| 41 | 44 | } | ... | ... |
src/main/java/com/bsth/repository/oil/JqlRepository.java
0 → 100644
| 1 | +package com.bsth.repository.oil; | |
| 2 | + | |
| 3 | + | |
| 4 | +import java.util.List; | |
| 5 | + | |
| 6 | +import org.springframework.data.jpa.repository.Modifying; | |
| 7 | +import org.springframework.data.jpa.repository.Query; | |
| 8 | +import org.springframework.stereotype.Repository; | |
| 9 | +import org.springframework.transaction.annotation.Transactional; | |
| 10 | + | |
| 11 | +import com.bsth.entity.oil.Jql; | |
| 12 | +import com.bsth.repository.BaseRepository; | |
| 13 | + | |
| 14 | +@Repository | |
| 15 | +public interface JqlRepository extends BaseRepository<Jql, Integer>{ | |
| 16 | + | |
| 17 | + @Transactional | |
| 18 | + @Modifying | |
| 19 | + @Query(value="INSERT INTO bsth_c_jql("+ | |
| 20 | + "gs_bm, gs_name, fgs_bm, fgs_name, rq, nbbm, jql, jqz, remarks, creater_date)" + | |
| 21 | + " VALUES(" + | |
| 22 | + "?1,?2,?3,?4,str_to_date(?5,'%Y-%m-%d'),?6,?7,?8,?9,str_to_date(?10,'%Y-%m-%d %H:%i:%s'))", nativeQuery=true) | |
| 23 | + void insertData(String gsbm, String gsName, String fgsbm, String fgsName, String rq, String nbbm, String jql, String jqz, String remarks, String createrDate); | |
| 24 | + | |
| 25 | + @Query(value="SELECT * FROM bsth_c_jql where gs_bm = ?1 and fgs_bm = ?2 and rq = ?3 and nbbm like %?4% " ,nativeQuery=true) | |
| 26 | + List<Jql> query(String gsbm, String fgsbm, String rq, String nbbm); | |
| 27 | + | |
| 28 | + | |
| 29 | + @Query(value="SELECT * FROM bsth_c_jql where rq = ?",nativeQuery=true) | |
| 30 | + List<Jql> JqlList( String rq); | |
| 31 | + | |
| 32 | + @Query(value="SELECT jql FROM bsth_c_jql where gs_bm = ?1 and fgs_bm = ?2 and rq = ?3 and nbbm = ?4 ",nativeQuery=true) | |
| 33 | + List<Double> queryBySame(String gsbm, String fgsbm, String rq, String nbbm); | |
| 34 | + | |
| 35 | + | |
| 36 | + @Transactional | |
| 37 | + @Modifying | |
| 38 | + @Query(value="UPDATE bsth_c_jql set jql = ?1 where gs_bm = ?2 and fgs_bm = ?3 and rq = ?4 and nbbm = ?5",nativeQuery=true) | |
| 39 | + void UpdateJql(String jql, String gsbm, String fgsbm, String rq, String nbbm); | |
| 40 | + | |
| 41 | +} | ... | ... |
src/main/java/com/bsth/repository/oil/QlbRepository.java
0 → 100644
| 1 | +package com.bsth.repository.oil; | |
| 2 | + | |
| 3 | +import java.util.Date; | |
| 4 | +import java.util.List; | |
| 5 | + | |
| 6 | +import org.springframework.data.jpa.repository.Modifying; | |
| 7 | +import org.springframework.data.jpa.repository.Query; | |
| 8 | +import org.springframework.stereotype.Repository; | |
| 9 | +import org.springframework.transaction.annotation.Transactional; | |
| 10 | + | |
| 11 | +import com.bsth.entity.oil.Qlb; | |
| 12 | +import com.bsth.repository.BaseRepository; | |
| 13 | + | |
| 14 | +@Repository | |
| 15 | +public interface QlbRepository extends BaseRepository<Qlb, Integer>{ | |
| 16 | + /** | |
| 17 | + * 前一天DLB信息 | |
| 18 | + * @param rq | |
| 19 | + * @return | |
| 20 | + */ | |
| 21 | + @Query(value="SELECT a.* FROM bsth_c_qlb a where to_days(?1)-to_days(a.rq)=1 " | |
| 22 | + + " and jcsx=(select max(b.jcsx) from bsth_c_qlb b where a.nbbm=b.nbbm and " | |
| 23 | + + " to_days(?1)-to_days(b.rq)=1) and ssgsdm like %?2% and fgsdm like %?3% and " | |
| 24 | + + " xlbm like %?4% and nbbm like %?5%",nativeQuery=true) | |
| 25 | + List<Qlb> obtainQlbefore(String rq,String gsdm,String fgsdm,String xlbm,String nbbm); | |
| 26 | + /** | |
| 27 | + * 当天DLB信息 | |
| 28 | + * @param rq | |
| 29 | + * @return | |
| 30 | + */ | |
| 31 | + @Query(value="SELECT * FROM bsth_c_qlb where rq=?1 and ssgsdm like %?2% " | |
| 32 | + + " and fgsdm like %?3%" | |
| 33 | + + " and xlbm like %?4% and nbbm like %?5% order by ?6 asc",nativeQuery=true) | |
| 34 | + List<Qlb> obtainQl(String rq,String gsbm,String fgsdm,String xlbm,String nbbm,String px); | |
| 35 | + | |
| 36 | + @Query(value="select s from Qlb s " | |
| 37 | + + " where to_days(s.rq)=to_days(?1) " | |
| 38 | + + " and s.ssgsdm like %?2% " | |
| 39 | + + " and s.fgsdm like %?3%" | |
| 40 | + + " and s.xlbm like %?4% " | |
| 41 | + + " and s.nbbm in ?5 order by nbbm,jcsx") | |
| 42 | + List<Qlb> listQlb(String rq, String gsbm,String fgsbm,String xlbm,List<String> listNbbm); | |
| 43 | + | |
| 44 | + @Query(value="select s from Qlb s " | |
| 45 | + + " where s.rq=?1 " | |
| 46 | + + " and s.ssgsdm like %?2% " | |
| 47 | + + " and s.fgsdm like %?3%" | |
| 48 | + + " and s.xlbm like %?4% " | |
| 49 | + + " and s.nbbm in ?5 order by nbbm,jcsx") | |
| 50 | + List<Qlb> listQlb_s(Date rq, String gsbm,String fgsbm,String xlbm,List<String> listNbbm); | |
| 51 | + | |
| 52 | + | |
| 53 | + /** | |
| 54 | + * | |
| 55 | + * @param nbbm | |
| 56 | + * @param rq | |
| 57 | + * @param xlbm | |
| 58 | + * @return | |
| 59 | + */ | |
| 60 | + @Query(value="select nbbm,count(nbbm) from bsth_c_qlb where rq=?1 " | |
| 61 | + + " and ssgsdm like %?2% " | |
| 62 | + + " and fgsdm like %?3% " | |
| 63 | + + " and xlbm like %?4% and nbbm like %?5% " | |
| 64 | + + " group by nbbm,rq,ssgsdm,fgsdm",nativeQuery=true) | |
| 65 | + List<Object[]> checkNbmmNum(String rq, String gsbm,String fgsbm,String xlbm,String nbbm); | |
| 66 | + | |
| 67 | + @Query(value="select nbbm,sum(jql*100) as jql ,sum(zlc*100) as zlc from bsth_c_qlb where rq= ?1 " | |
| 68 | + + " and ssgsdm like %?2% " | |
| 69 | + + " and fgsdm like %?3% " | |
| 70 | + + " and xlbm like %?4% and nbbm like %?5% " | |
| 71 | + + " group by nbbm,rq,ssgsdm,fgsdm,xlbm",nativeQuery=true) | |
| 72 | + List<Object[]> checkNbmmQl(String rq, String gsbm,String fgsbm,String xlbm,String nbbm); | |
| 73 | + | |
| 74 | + | |
| 75 | + @Query(value="select jql,hn,sh from Qlb s " | |
| 76 | + + " where to_days(s.rq)=to_days(?1) " | |
| 77 | + + " and s.ssgsdm like %?2% " | |
| 78 | + + " and s.fgsdm like %?3% " | |
| 79 | + + " and s.xlbm like %?4% " | |
| 80 | + + " and s.nbbm in ?5 ") | |
| 81 | + List<Object[]> sumQlb(String rq, String gsbm,String fgsbm,String xlbm,List<String> listNbbm); | |
| 82 | + | |
| 83 | + @Query(value="select jql,hn,sh from Qlb s " | |
| 84 | + + " where s.rq=?1 " | |
| 85 | + + " and s.ssgsdm like %?2% " | |
| 86 | + + " and s.fgsdm like %?3% " | |
| 87 | + + " and s.xlbm like %?4% " | |
| 88 | + + " and s.nbbm in ?5 ") | |
| 89 | + List<Object[]> sumQlb_s(Date rq, String gsbm,String fgsbm,String xlbm,List<String> listNbbm); | |
| 90 | + | |
| 91 | + | |
| 92 | + @Query(value="select ifnull(jql,0),ifnull(hn,0),ifnull(sh,0) from bsth_c_qlb " | |
| 93 | + + " where rq=?1 " | |
| 94 | + + " and ssgsdm like %?2% " | |
| 95 | + + " and fgsdm like %?3% " | |
| 96 | + + " and xlbm like %?4% " | |
| 97 | + + " and nbbm like %?5%",nativeQuery=true) | |
| 98 | + List<Object[]> sumQlb2(String rq, String gsbm,String fgsbm,String xlbm,String nbbm); | |
| 99 | + | |
| 100 | + @Transactional | |
| 101 | + @Modifying | |
| 102 | + @Query(value="UPDATE bsth_c_qlb SET " + | |
| 103 | + " czcl= ?2," + | |
| 104 | + " jzcl = ?3, " + | |
| 105 | + " hn = ?4, " + | |
| 106 | + " sh = ?5, " + | |
| 107 | + " shyy = ?6, " + | |
| 108 | + " nhlx = ?7 " + | |
| 109 | + " WHERE id = ?1", nativeQuery=true) | |
| 110 | + public void qlbUpdate(Integer id,double czcl,double jzcl,double hn, double sh,String shyy,int nhlx); | |
| 111 | + | |
| 112 | + @Query(value="SELECT * FROM bsth_c_qlb where rq=?1 and nbbm=?2 and jsy=?3 and xlbm=?4",nativeQuery=true) | |
| 113 | + List<Qlb> queryListQlb(String rq,String nbbm,String jgh,String xlbm); | |
| 114 | + | |
| 115 | + @Query(value="SELECT * FROM bsth_c_qlb where rq=?1 and xlbm=?2",nativeQuery=true) | |
| 116 | + List<Qlb> queryQlbByRqXlbm(String rq, String xlbm); | |
| 117 | + | |
| 118 | +} | ... | ... |
src/main/java/com/bsth/service/oil/JqlService.java
0 → 100644
| 1 | +package com.bsth.service.oil; | |
| 2 | + | |
| 3 | +import java.io.File; | |
| 4 | +import java.util.Map; | |
| 5 | + | |
| 6 | +import com.bsth.entity.oil.Jql; | |
| 7 | +import com.bsth.service.BaseService; | |
| 8 | + | |
| 9 | +public interface JqlService extends BaseService<Jql, Integer> { | |
| 10 | + | |
| 11 | + public String importExcel(File file, String gsbm_, String gsName, String fgsbm, String fgsName); | |
| 12 | + | |
| 13 | + public Map<String, Object> query(Map<String, Object> map); | |
| 14 | + | |
| 15 | +} | ... | ... |
src/main/java/com/bsth/service/oil/QlbService.java
0 → 100644
| 1 | +package com.bsth.service.oil; | |
| 2 | + | |
| 3 | +import java.util.List; | |
| 4 | +import java.util.Map; | |
| 5 | + | |
| 6 | +import com.bsth.entity.oil.Qlb; | |
| 7 | +import com.bsth.service.BaseService; | |
| 8 | + | |
| 9 | +public interface QlbService extends BaseService<Qlb, Integer>{ | |
| 10 | + Map<String, Object> obtain(Map<String, Object> map) throws Exception; | |
| 11 | + | |
| 12 | + Map<String, Object> sort(Map<String, Object> map); | |
| 13 | + | |
| 14 | + Map<String, Object> checkQl(Map<String, Object> map); | |
| 15 | + | |
| 16 | + List<Qlb> listQlb(Map<String, Object> map); | |
| 17 | + | |
| 18 | + Map<String, Object> sumQlb(Map<String, Object> map); | |
| 19 | + | |
| 20 | + Map<String, Object> saveQlbList(Map<String, Object> map) throws Exception; | |
| 21 | + | |
| 22 | + String obtainDsq() throws Exception; | |
| 23 | + | |
| 24 | + String checkJsy(Map<String, Object> map); | |
| 25 | + | |
| 26 | + Map<String, Object> saveQlb(Qlb t); | |
| 27 | + | |
| 28 | + Map<String, Object> deleteIds(Map<String, Object> map) throws Exception; | |
| 29 | + | |
| 30 | + Map<String, List<Qlb>> updeteHistory(List<Map<String, Object>> list,String date, | |
| 31 | + String gsdm,String fgsdm,String line) ; | |
| 32 | + | |
| 33 | + Map<String, Object> update(Map<String, Object> map); | |
| 34 | + | |
| 35 | + | |
| 36 | +} | ... | ... |
src/main/java/com/bsth/service/oil/impl/JqlServiceImpl.java
0 → 100644
| 1 | +package com.bsth.service.oil.impl; | |
| 2 | + | |
| 3 | +import java.io.File; | |
| 4 | +import java.io.FileInputStream; | |
| 5 | +import java.text.DecimalFormat; | |
| 6 | +import java.text.SimpleDateFormat; | |
| 7 | +import java.util.ArrayList; | |
| 8 | +import java.util.Date; | |
| 9 | +import java.util.HashMap; | |
| 10 | +import java.util.Iterator; | |
| 11 | +import java.util.List; | |
| 12 | +import java.util.Map; | |
| 13 | + | |
| 14 | +import org.apache.poi.hssf.usermodel.HSSFCell; | |
| 15 | +import org.apache.poi.hssf.usermodel.HSSFRow; | |
| 16 | +import org.apache.poi.hssf.usermodel.HSSFSheet; | |
| 17 | +import org.apache.poi.hssf.usermodel.HSSFWorkbook; | |
| 18 | +import org.apache.poi.poifs.filesystem.POIFSFileSystem; | |
| 19 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 20 | +import org.springframework.stereotype.Service; | |
| 21 | + | |
| 22 | +import com.bsth.entity.oil.Jql; | |
| 23 | +import com.bsth.repository.oil.JqlRepository; | |
| 24 | +import com.bsth.service.impl.BaseServiceImpl; | |
| 25 | +import com.bsth.service.oil.JqlService; | |
| 26 | +import com.bsth.util.ReportUtils; | |
| 27 | + | |
| 28 | +@Service | |
| 29 | +public class JqlServiceImpl extends BaseServiceImpl<Jql, Integer> implements JqlService { | |
| 30 | + | |
| 31 | + @Autowired | |
| 32 | + JqlRepository repository; | |
| 33 | + | |
| 34 | + @Override | |
| 35 | + public String importExcel(File file, String gsbm, String gsName, String fgsbm, String fgsName) { | |
| 36 | + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); | |
| 37 | + SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | |
| 38 | + DecimalFormat df = new DecimalFormat("######0.00"); | |
| 39 | + List<String> textList = new ArrayList<String>(); | |
| 40 | + try { | |
| 41 | + POIFSFileSystem fs = new POIFSFileSystem(new FileInputStream(file)); | |
| 42 | + HSSFWorkbook wb = new HSSFWorkbook(fs); | |
| 43 | + HSSFSheet sheet = wb.getSheetAt(0); | |
| 44 | + // 取得总行数 | |
| 45 | + int rowNum = sheet.getLastRowNum() + 1; | |
| 46 | + // 取得总列数 | |
| 47 | + int cellNum = sheet.getRow(0).getLastCellNum(); | |
| 48 | + HSSFRow row = null; | |
| 49 | + HSSFCell cell = null; | |
| 50 | + for(int i = 2; i < rowNum; i++){ | |
| 51 | + row = sheet.getRow(i); | |
| 52 | + if (row == null){ | |
| 53 | + continue; | |
| 54 | + } | |
| 55 | + String text = ""; | |
| 56 | + for(int j = 0; j < cellNum; j++){ | |
| 57 | + cell = row.getCell(j); | |
| 58 | + if(cell == null){ | |
| 59 | + text += ","; | |
| 60 | + continue; | |
| 61 | + } | |
| 62 | + text += String.valueOf(cell) + ","; | |
| 63 | + } | |
| 64 | + String[] split = (text+";").split(","); | |
| 65 | + String str = ""; | |
| 66 | + for(int j = 0; j < split.length && j < 5; j++){ | |
| 67 | + str += split[j]; | |
| 68 | + } | |
| 69 | + if(str.trim().length() == 0) | |
| 70 | + continue; | |
| 71 | + textList.add(text + ";"); | |
| 72 | + } | |
| 73 | + for(int i = 0; i < textList.size(); i++){ | |
| 74 | + String text = textList.get(i); | |
| 75 | + String[] split = text.split(","); | |
| 76 | + String rq = split[0].trim(); | |
| 77 | + String nbbm = split[1].trim(); | |
| 78 | +// String jsy= split[2].trim(); | |
| 79 | + double jql = Double.valueOf(split[2].trim().length()!=0?split[2]:"0"); | |
| 80 | + String jqz = split[3].trim(); | |
| 81 | + String remarks = split[4].trim(); | |
| 82 | + if(rq.trim().length() == 0){ | |
| 83 | + rq = sdf.format(new Date()); | |
| 84 | + } | |
| 85 | + | |
| 86 | + List<Double> jql_ = repository.queryBySame(gsbm, fgsbm, rq, nbbm); | |
| 87 | + | |
| 88 | + if(jql_.size() == 0){ | |
| 89 | + repository.insertData(gsbm, gsName, fgsbm, fgsName, rq, nbbm, | |
| 90 | + df.format(jql), jqz, remarks, sd.format(new Date())); | |
| 91 | + }else{ | |
| 92 | +// jql += jql_.get(0); | |
| 93 | + repository.UpdateJql(df.format(jql), gsbm, fgsbm, rq, nbbm); | |
| 94 | + } | |
| 95 | + } | |
| 96 | + wb.close(); | |
| 97 | + fs.close(); | |
| 98 | + } catch (Exception e) { | |
| 99 | + // TODO Auto-generated catch block | |
| 100 | + e.printStackTrace(); | |
| 101 | + return "文件导入失败"; | |
| 102 | + } finally { | |
| 103 | + file.delete(); | |
| 104 | + } | |
| 105 | + return "文件导入成功"; | |
| 106 | + } | |
| 107 | + | |
| 108 | + @Override | |
| 109 | + public Map<String, Object> query(Map<String, Object> map) { | |
| 110 | + Map<String, Object> modelMap = new HashMap<String, Object>(); | |
| 111 | + String gsbm = map.get("gsbm").toString(); | |
| 112 | + String fgsbm = map.get("fgsbm").toString(); | |
| 113 | + String rq = map.get("rq").toString(); | |
| 114 | + String nbbm = map.get("nbbm").toString(); | |
| 115 | +// String jsy =map.get("jsy").toString(); | |
| 116 | + Integer page = Integer.valueOf(map.containsKey("page")?map.get("page").toString():"0"); | |
| 117 | + List<Jql> query = repository.query(gsbm, fgsbm, rq, nbbm); | |
| 118 | + | |
| 119 | + if(!map.containsKey("type")){ | |
| 120 | + | |
| 121 | + int end = (page+1)*10>query.size()?query.size():(page+1)*10; | |
| 122 | + modelMap.put("dataList", query.subList(page*10, end)); | |
| 123 | + modelMap.put("totalPages", query.size()%10>0?query.size()/10+1:query.size()/10); | |
| 124 | + | |
| 125 | + } else if(map.get("type").toString().equals("export")){ | |
| 126 | + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), | |
| 127 | + sdfSimple = new SimpleDateFormat("yyyyMMdd"); | |
| 128 | + | |
| 129 | + List<Map<String, Object>> list = new ArrayList<Map<String, Object>>(); | |
| 130 | + for(Jql jql : query){ | |
| 131 | + Map<String, Object> m = new HashMap<String, Object>(); | |
| 132 | + m.put("rq", sdfMonth.format(jql.getRq())); | |
| 133 | + m.put("nbbm", jql.getNbbm()); | |
| 134 | + m.put("jql", jql.getJql()); | |
| 135 | + m.put("jqz", jql.getJqz()); | |
| 136 | + m.put("remarks", jql.getRemarks()); | |
| 137 | + list.add(m); | |
| 138 | + } | |
| 139 | + | |
| 140 | + List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | |
| 141 | + Map<String, Object> m = new HashMap<String, Object>(); | |
| 142 | + ReportUtils ee = new ReportUtils(); | |
| 143 | + try { | |
| 144 | + listI.add(list.iterator()); | |
| 145 | + String path = this.getClass().getResource("/").getPath()+"static/pages/forms/"; | |
| 146 | + ee.excelReplace(listI, new Object[] { m }, path+"mould/export_Jql.xls", | |
| 147 | + path+"export/车辆加氢量" + sdfSimple.format(sdfMonth.parse(rq)) + ".xls"); | |
| 148 | + } catch (Exception e) { | |
| 149 | + // TODO: handle exception | |
| 150 | + e.printStackTrace(); | |
| 151 | + } | |
| 152 | + } | |
| 153 | + return modelMap; | |
| 154 | + } | |
| 155 | + | |
| 156 | +} | ... | ... |
src/main/java/com/bsth/service/oil/impl/QlbServiceImpl.java
0 → 100644
| 1 | +package com.bsth.service.oil.impl; | |
| 2 | + | |
| 3 | +import java.sql.ResultSet; | |
| 4 | +import java.sql.SQLException; | |
| 5 | +import java.text.DecimalFormat; | |
| 6 | +import java.text.ParseException; | |
| 7 | +import java.text.SimpleDateFormat; | |
| 8 | +import java.util.ArrayList; | |
| 9 | +import java.util.Calendar; | |
| 10 | +import java.util.Collections; | |
| 11 | +import java.util.Comparator; | |
| 12 | +import java.util.Date; | |
| 13 | +import java.util.HashMap; | |
| 14 | +import java.util.List; | |
| 15 | +import java.util.Map; | |
| 16 | + | |
| 17 | +import javax.transaction.Transactional; | |
| 18 | + | |
| 19 | +import org.apache.commons.lang3.StringEscapeUtils; | |
| 20 | +import org.apache.commons.lang3.StringUtils; | |
| 21 | +import org.slf4j.Logger; | |
| 22 | +import org.slf4j.LoggerFactory; | |
| 23 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 24 | +import org.springframework.jdbc.core.JdbcTemplate; | |
| 25 | +import org.springframework.jdbc.core.RowMapper; | |
| 26 | +import org.springframework.stereotype.Service; | |
| 27 | + | |
| 28 | +import com.alibaba.fastjson.JSONArray; | |
| 29 | +import com.alibaba.fastjson.JSONObject; | |
| 30 | +import com.bsth.common.ResponseCode; | |
| 31 | +import com.bsth.data.BasicData; | |
| 32 | +import com.bsth.entity.Cars; | |
| 33 | +import com.bsth.entity.Line; | |
| 34 | +import com.bsth.entity.oil.Jql; | |
| 35 | +import com.bsth.entity.oil.Nylog; | |
| 36 | +import com.bsth.entity.oil.Qlb; | |
| 37 | +import com.bsth.entity.oil.Ylxxb; | |
| 38 | +import com.bsth.entity.sys.SysUser; | |
| 39 | +import com.bsth.repository.CarsRepository; | |
| 40 | +import com.bsth.repository.oil.JdlRepository; | |
| 41 | +import com.bsth.repository.oil.JqlRepository; | |
| 42 | +import com.bsth.repository.oil.NylogRepository; | |
| 43 | +import com.bsth.repository.oil.QlbRepository; | |
| 44 | +import com.bsth.repository.oil.YlxxbRepository; | |
| 45 | +import com.bsth.security.util.SecurityUtils; | |
| 46 | +import com.bsth.service.impl.BaseServiceImpl; | |
| 47 | +import com.bsth.service.oil.QlbService; | |
| 48 | +import com.bsth.service.realcontrol.ScheduleRealInfoService; | |
| 49 | +import com.bsth.util.Arith; | |
| 50 | +import com.bsth.util.BatchSaveUtils; | |
| 51 | + | |
| 52 | +@Service | |
| 53 | +public class QlbServiceImpl extends BaseServiceImpl<Qlb,Integer> implements QlbService{ | |
| 54 | + @Autowired | |
| 55 | + QlbRepository repository; | |
| 56 | + @Autowired | |
| 57 | + NylogRepository nylogRepository; | |
| 58 | + @Autowired | |
| 59 | + YlxxbRepository ylxxbRepository; | |
| 60 | + @Autowired | |
| 61 | + JdlRepository jdlRepository; | |
| 62 | + @Autowired | |
| 63 | + JqlRepository jqlRepository; | |
| 64 | + @Autowired | |
| 65 | + CarsRepository carsRepository; | |
| 66 | + @Autowired | |
| 67 | + ScheduleRealInfoService scheduleRealInfoService; | |
| 68 | + @Autowired | |
| 69 | + JdbcTemplate jdbcTemplate; | |
| 70 | + | |
| 71 | + Logger logger = LoggerFactory.getLogger(this.getClass()); | |
| 72 | + | |
| 73 | + @Transactional | |
| 74 | + @Override | |
| 75 | + public String obtainDsq() throws Exception{ | |
| 76 | + String result = "failure"; | |
| 77 | + List<Cars> carsList=carsRepository.findCars(); | |
| 78 | + Map<String, Boolean> carsMap=new HashMap<String, Boolean>(); | |
| 79 | + for (int i = 0; i < carsList.size(); i++) { | |
| 80 | + Cars c=carsList.get(i); | |
| 81 | + carsMap.put(c.getInsideCode(), c.getHydrogen()); | |
| 82 | + } | |
| 83 | + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); | |
| 84 | + Date dNow = new Date(); //当前时间 | |
| 85 | + Date dBefore = new Date(); | |
| 86 | + Calendar calendar = Calendar.getInstance(); //得到日历 | |
| 87 | + calendar.setTime(dNow);//把当前时间赋给日历 | |
| 88 | + calendar.add(Calendar.DAY_OF_MONTH, -1); //设置为前一天 | |
| 89 | + dBefore = calendar.getTime(); //得到前一天的时间 | |
| 90 | + String rq=sdf.format(dBefore); | |
| 91 | +// String rq="2017-11-02"; | |
| 92 | + String line=""; | |
| 93 | + //保留两位小数 | |
| 94 | + DecimalFormat df = new DecimalFormat("#.00"); | |
| 95 | + // TODO Auto-generated method stub | |
| 96 | + Map<String, Object> newMap=new HashMap<String,Object>(); | |
| 97 | + //当天QLB信息 | |
| 98 | + List<Qlb> qlList=repository.obtainQl(rq, "", "", line, "", "nbbm"); | |
| 99 | + //当天YLXXB信息 | |
| 100 | + List<Ylxxb> ylxxList=ylxxbRepository.obtainYlxx(rq,1,""); | |
| 101 | + //当天加氢信息表 | |
| 102 | + List<Jql> jqlList=jqlRepository.JqlList(rq); | |
| 103 | + //前一天所有车辆最后进场班次信息 | |
| 104 | + List<Qlb> qlListBe=repository.obtainQlbefore(rq, "", "", "", ""); | |
| 105 | + //从排班表中计算出行驶的总里程 | |
| 106 | + List<Map<String,Object>> listpb=scheduleRealInfoService.yesterdayDataList(line,rq,"","","",""); | |
| 107 | + for(int x=0;x<listpb.size();x++){ | |
| 108 | + String type="add"; | |
| 109 | + boolean sfHydrogen=false; | |
| 110 | + Map<String, Object> map=listpb.get(x); | |
| 111 | + if (carsMap.get(map.get("clZbh").toString())!=null) { | |
| 112 | + sfHydrogen = carsMap.get(map.get("clZbh").toString()); | |
| 113 | + }else{ | |
| 114 | + sfHydrogen = false; | |
| 115 | + } | |
| 116 | + if(sfHydrogen){ | |
| 117 | + //判断驾驶员驾驶的该车辆是否已经存入了(查出的结果集中日期是相同的,根据驾驶员、内部编号、线路编码判断) | |
| 118 | + Qlb t=new Qlb(); | |
| 119 | + for(int k=0;k<qlList.size();k++){ | |
| 120 | + Qlb t1=qlList.get(k); | |
| 121 | + if(t1.getNbbm().equals(map.get("clZbh").toString()) | |
| 122 | + &&t1.getJsy().equals(map.get("jGh").toString()) | |
| 123 | + &&t1.getXlbm().equals(map.get("xlBm").toString()) | |
| 124 | + &&t1.getLp().equals(map.get("lpName").toString())) | |
| 125 | + { | |
| 126 | + t=t1; | |
| 127 | + type="update"; | |
| 128 | + } | |
| 129 | + } | |
| 130 | + try { | |
| 131 | + //当日的第一个班次,出场油量等于前一天的最后一个班次的进场油量 | |
| 132 | + Double jzl=0.0; | |
| 133 | + if(map.get("seqNumber").toString().equals("1")){ | |
| 134 | + boolean fage=true; | |
| 135 | + for (int i = 0; i < qlListBe.size(); i++) { | |
| 136 | + Qlb qlb=qlListBe.get(i); | |
| 137 | + if(map.get("clZbh").toString().equals(qlb.getNbbm())){ | |
| 138 | + t.setCzcl(qlb.getJzcl()); | |
| 139 | + fage=false; | |
| 140 | + break; | |
| 141 | + } | |
| 142 | + } | |
| 143 | + if(fage){ | |
| 144 | + t.setCzcl(0.0); | |
| 145 | + } | |
| 146 | + | |
| 147 | + //手动导入没有驾驶员工号 | |
| 148 | + for (int i = 0; i < jqlList.size(); i++) { | |
| 149 | + Jql jql=jqlList.get(i); | |
| 150 | + if(map.get("clZbh").toString().equals(jql.getNbbm()) | |
| 151 | + &&map.get("jGh").toString().equals(jql.getJsy())){ | |
| 152 | + jzl+=jql.getJql(); | |
| 153 | + } | |
| 154 | + } | |
| 155 | + } | |
| 156 | + | |
| 157 | + | |
| 158 | +// //把当天的YLXXB的加注量设置为当天YLB的加注量(根据车号,驾驶员判断) | |
| 159 | +// for(int j=0;j<ylxxList.size();j++){ | |
| 160 | +// Ylxxb ylxxb = ylxxList.get(j); | |
| 161 | +// if(map.get("clZbh").toString().equals(ylxxb.getNbbm()) &&map.get("jGh").toString().equals(ylxxb.getJsy())){ | |
| 162 | +// jzl+=ylxxb.getJzl(); | |
| 163 | +// } | |
| 164 | +// } | |
| 165 | + | |
| 166 | + t.setJql(jzl); | |
| 167 | + if(type.equals("add")){ | |
| 168 | + t.setHn(jzl); | |
| 169 | + t.setJzcl(t.getCzcl()); | |
| 170 | + } | |
| 171 | + | |
| 172 | + t.setNbbm(map.get("clZbh").toString()); | |
| 173 | + t.setJsy(map.get("jGh")==null?"":map.get("jGh").toString()); | |
| 174 | + t.setZlc(map.get("totalKilometers")==null?0.0:Double.parseDouble(df.format(Double.parseDouble(map.get("totalKilometers").toString())))); | |
| 175 | + t.setXlbm(map.get("xlBm")==null?"":map.get("xlBm").toString()); | |
| 176 | + t.setLinename(map.get("lineName")==null?"":map.get("lineName").toString()); | |
| 177 | + t.setJcsx(Integer.parseInt(map.get("seqNumber").toString())); | |
| 178 | + t.setSsgsdm(map.get("company")==null?"":map.get("company").toString()); | |
| 179 | + t.setFgsdm(map.get("bCompany")==null?"":map.get("bCompany").toString()); | |
| 180 | + t.setJhsj(map.get("fcsj")==null?"":map.get("fcsj").toString()); | |
| 181 | + t.setLp(map.get("lpName").toString()); | |
| 182 | + t.setRq(sdf.parse(rq)); | |
| 183 | + t.setCreatetime(new Date()); | |
| 184 | + t.setJname(map.get("jName").toString()); | |
| 185 | + repository.save(t); | |
| 186 | + newMap.put("status", ResponseCode.SUCCESS); | |
| 187 | + } catch (ParseException e) { | |
| 188 | + // TODO Auto-generated catch block | |
| 189 | + newMap.put("status", ResponseCode.ERROR); | |
| 190 | + e.printStackTrace(); | |
| 191 | + } | |
| 192 | + } | |
| 193 | + } | |
| 194 | + return result; | |
| 195 | + } | |
| 196 | + | |
| 197 | + /** | |
| 198 | + * 获取进存油信息 | |
| 199 | + * @Transactional 回滚事物 | |
| 200 | + */ | |
| 201 | + @Transactional | |
| 202 | + @Override | |
| 203 | + public Map<String, Object> obtain(Map<String, Object> map2) throws Exception{ | |
| 204 | + Map<String, Object> newMap = new HashMap<String, Object>(); | |
| 205 | + try { | |
| 206 | + Date date=new Date(); | |
| 207 | + List<Cars> carsList = carsRepository.findCars(); | |
| 208 | + Map<String, Boolean> carsMap = new HashMap<String, Boolean>(); | |
| 209 | + for (int i = 0; i < carsList.size(); i++) { | |
| 210 | + Cars c = carsList.get(i); | |
| 211 | + carsMap.put(c.getInsideCode(), c.getHydrogen()); | |
| 212 | + } | |
| 213 | + String rq = map2.get("rq").toString(); | |
| 214 | + String line = ""; | |
| 215 | + if (map2.get("xlbm_like") != null) { | |
| 216 | + line = map2.get("xlbm_like").toString().trim(); | |
| 217 | + } | |
| 218 | + String gsbm=""; | |
| 219 | + if(map2.get("ssgsdm_like")!=null){ | |
| 220 | + gsbm=map2.get("ssgsdm_like").toString(); | |
| 221 | + } | |
| 222 | + String fgsbm=""; | |
| 223 | + if(map2.get("fgsdm_like")!=null){ | |
| 224 | + fgsbm=map2.get("fgsdm_like").toString(); | |
| 225 | + } | |
| 226 | + String nbbm=""; | |
| 227 | + if(map2.get("nbbm_eq")!=null){ | |
| 228 | + nbbm=map2.get("nbbm_eq").toString(); | |
| 229 | + } | |
| 230 | + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); | |
| 231 | + // 保留两位小数 | |
| 232 | + DecimalFormat df = new DecimalFormat("#.00"); | |
| 233 | + // TODO Auto-generated method stub | |
| 234 | + // 当天QLB信息 | |
| 235 | + List<Qlb> qlList = this.listOrderBy(rq,gsbm,fgsbm,"",nbbm,"nbbm"); | |
| 236 | + // 当天YLXXB信息 | |
| 237 | + List<Ylxxb> ylxxList = ylxxbRepository.obtainYlxx(rq, 0, gsbm); | |
| 238 | + // 从排班表中计算出行驶的总里程 | |
| 239 | + List<Map<String, Object>> listpb =new ArrayList<Map<String, Object>>(); | |
| 240 | + List<Map<String, Object>> listpbs=scheduleRealInfoService.yesterdayDataList("", rq, gsbm, fgsbm, "", nbbm); | |
| 241 | + Map<String, Double> lcMap=new HashMap<String,Double>(); | |
| 242 | + for (int i = 0; i < listpbs.size(); i++) { | |
| 243 | + String cl=listpbs.get(i).get("clZbh").toString(); | |
| 244 | + Double lc=listpbs.get(i).get("totalKilometers") == null ? 0.0 | |
| 245 | + : Double.parseDouble(listpbs.get(i).get("totalKilometers").toString()); | |
| 246 | + if(lcMap.get(cl)==null){ | |
| 247 | + lcMap.put(cl, lc); | |
| 248 | + }else{ | |
| 249 | + double lc_=lcMap.get(cl); | |
| 250 | + lcMap.remove(cl); | |
| 251 | + lcMap.put(cl, Arith.add(lc, lc_)); | |
| 252 | + } | |
| 253 | + } | |
| 254 | + | |
| 255 | + List<Jql> jqlList=jqlRepository.JqlList(rq); | |
| 256 | + String sxtj=map2.get("sxtj").toString(); | |
| 257 | + if(sxtj.equals("0")){ | |
| 258 | + listpb=listpbs; | |
| 259 | + }else{ | |
| 260 | + List<Object[]> objectLists=repository.checkNbmmNum(rq, gsbm, fgsbm, "", nbbm); | |
| 261 | + List<String> stringList=new ArrayList<String>(); | |
| 262 | + for (int i = 0; i < objectLists.size(); i++) { | |
| 263 | + String clbm=objectLists.get(i)[0].toString(); | |
| 264 | + int cs=Integer.parseInt(objectLists.get(i)[1].toString()); | |
| 265 | + //一车一单 | |
| 266 | + if(sxtj.equals("1")){ | |
| 267 | + if(cs==1){ | |
| 268 | + stringList.add(clbm); | |
| 269 | + } | |
| 270 | + } | |
| 271 | + //一车多单 | |
| 272 | + if(sxtj.equals("2")){ | |
| 273 | + if(cs>1){ | |
| 274 | + stringList.add(clbm); | |
| 275 | + } | |
| 276 | + } | |
| 277 | + } | |
| 278 | + | |
| 279 | + for (int i = 0; i < stringList.size(); i++) { | |
| 280 | + String strNbbm=stringList.get(i); | |
| 281 | + for (int j = 0; j < listpbs.size(); j++) { | |
| 282 | + Map<String, Object> map = listpbs.get(j); | |
| 283 | + String mapNbbm=map.get("clZbh").toString(); | |
| 284 | + if(strNbbm.equals(mapNbbm)){ | |
| 285 | + listpb.add(map); | |
| 286 | + } | |
| 287 | + } | |
| 288 | + } | |
| 289 | + } | |
| 290 | + Map<String, Object> newMap_=new HashMap<String,Object>(); | |
| 291 | + List<Qlb> addList = new ArrayList<Qlb>(); | |
| 292 | + List<Qlb> updateList = new ArrayList<Qlb>(); | |
| 293 | + Map<String, Object> cMap=new HashMap<String, Object>(); | |
| 294 | + List<Map<String, Object>> listpb_=listpb; | |
| 295 | + Collections.sort(listpb,new NbbmJcsxMap2()); | |
| 296 | + for (int x = 0; x < listpb_.size(); x++) { | |
| 297 | + String type = "add"; | |
| 298 | + boolean sfHydrogen = false; | |
| 299 | + Map<String, Object> map_ = listpb_.get(x); | |
| 300 | + if (carsMap.get(map_.get("clZbh").toString()) != null) { | |
| 301 | + sfHydrogen = carsMap.get(map_.get("clZbh").toString()); | |
| 302 | + } else { | |
| 303 | + sfHydrogen = false; | |
| 304 | + } | |
| 305 | + if (sfHydrogen) { | |
| 306 | + if(newMap_.get(map_.get("clZbh").toString())==null){ | |
| 307 | + newMap_.put(map_.get("clZbh").toString(), map_.get("clZbh").toString()); | |
| 308 | + //车辆总里程 | |
| 309 | + double zlc =lcMap.get(map_.get("clZbh").toString()); | |
| 310 | + //车辆总加氢量 | |
| 311 | + double zjzl = 0.0; | |
| 312 | +// for (int j = 0; j < ylxxList.size(); j++) { | |
| 313 | +// Ylxxb ylxxb = ylxxList.get(j); | |
| 314 | +// if (map_.get("clZbh").toString().equals(ylxxb.getNbbm()) | |
| 315 | +// && map_.get("company").toString().equals(ylxxb.getGsdm())) { | |
| 316 | +// zjzl = Arith.add(zjzl, ylxxb.getJzl()); | |
| 317 | +// } | |
| 318 | +// } | |
| 319 | + for (int i = 0; i < jqlList.size(); i++) { | |
| 320 | + Jql jql=jqlList.get(i); | |
| 321 | + if(map_.get("clZbh").toString().equals(jql.getNbbm()) | |
| 322 | + &&map_.get("company").toString().equals(jql.getGsBm()) | |
| 323 | + &&map_.get("bCompany").toString().equals(jql.getFgsBm())){ | |
| 324 | + zjzl = Arith.add(zjzl,jql.getJql()); | |
| 325 | + } | |
| 326 | + } | |
| 327 | + Double nextJzyl = 0.0; | |
| 328 | + for (int i = 0; i < listpb.size(); i++) { | |
| 329 | + Map<String, Object> map = listpb.get(i); | |
| 330 | + if(map_.get("clZbh").toString().equals(map.get("clZbh").toString())){ | |
| 331 | + // 判断驾驶员驾驶的该车辆是否已经存入了(查出的结果集中日期是相同的,根据驾驶员、内部编号、线路编码判断) | |
| 332 | + Qlb t = new Qlb(); | |
| 333 | + for (int k = 0; k < qlList.size(); k++) { | |
| 334 | + Qlb t1 = qlList.get(k); | |
| 335 | + if (t1.getNbbm().equals(map.get("clZbh").toString()) | |
| 336 | + && t1.getJsy().equals(map.get("jGh").toString()) | |
| 337 | + && t1.getXlbm().equals(map.get("xlBm").toString())) { | |
| 338 | + if(t1.getLp()==null){ | |
| 339 | + //同人同车同线路不同路牌的过滤 (考虑到历史数据) | |
| 340 | + if (cMap.get(map.get("clZbh").toString()+map.get("jGh").toString()+map.get("xlBm").toString())==null) { | |
| 341 | + t = t1; | |
| 342 | + type = "update"; | |
| 343 | + cMap.put(map.get("clZbh").toString()+map.get("jGh").toString()+map.get("xlBm").toString(), | |
| 344 | + map.get("clZbh").toString()); | |
| 345 | + } | |
| 346 | + }else{ | |
| 347 | + if(t1.getLp().equals(map.get("lpName").toString())){ | |
| 348 | + t = t1; | |
| 349 | + type = "update"; | |
| 350 | + } | |
| 351 | + | |
| 352 | + } | |
| 353 | + } | |
| 354 | + } | |
| 355 | + Double lc= Double.parseDouble(map.get("totalKilometers").toString()); | |
| 356 | + if(map.get("seqNumber").toString().equals("1")){ | |
| 357 | + // 当日的第一个班次,出场油量等于前一天的最后一个班次的进场油量 | |
| 358 | + Double dh=0.0; | |
| 359 | + if(zlc>0){ | |
| 360 | + dh = Double.parseDouble(df.format(zjzl * (lc / zlc))); | |
| 361 | + } | |
| 362 | + nextJzyl =Arith.sub(zjzl,dh); | |
| 363 | + if(zlc>0){ | |
| 364 | +// long l=Math.round(nextJzyl); | |
| 365 | + double ylxs=nextJzyl; | |
| 366 | + dh=Arith.add(dh, Arith.sub(nextJzyl,ylxs)); | |
| 367 | + if(dh<0){ | |
| 368 | + t.setHn(0.0); | |
| 369 | + t.setJql(0.0); | |
| 370 | + nextJzyl=Arith.add(ylxs, dh); | |
| 371 | + }else{ | |
| 372 | + t.setHn(dh); | |
| 373 | + t.setJql(dh); | |
| 374 | + nextJzyl=ylxs; | |
| 375 | + } | |
| 376 | + }else{ | |
| 377 | + t.setHn(0.0); | |
| 378 | + t.setJql(0.0); | |
| 379 | + } | |
| 380 | + }else{ | |
| 381 | + Double dh=0.0; | |
| 382 | + if(zlc>0){ | |
| 383 | + dh = Double.parseDouble(df.format(zjzl * (lc / zlc))); | |
| 384 | + } | |
| 385 | + nextJzyl =Arith.sub( nextJzyl,dh); | |
| 386 | + if(zlc>0){ | |
| 387 | +// long l=0l; | |
| 388 | + double ylxs=0.0; | |
| 389 | + if(i==listpb.size()-1){ | |
| 390 | +// ylxs=czyl; | |
| 391 | + }else{ | |
| 392 | + if(listpb.get(i+1).get("clZbh").toString().equals(map.get("clZbh").toString())){ | |
| 393 | +// l=Math.round(nextJzyl); | |
| 394 | + ylxs=nextJzyl; | |
| 395 | + } | |
| 396 | + | |
| 397 | + } | |
| 398 | + dh=Arith.add(dh, Arith.sub(nextJzyl,ylxs)); | |
| 399 | + if(dh<0){ | |
| 400 | + t.setHn(0.0); | |
| 401 | + t.setJql(0.0); | |
| 402 | + nextJzyl=Arith.add(ylxs, dh); | |
| 403 | + }else{ | |
| 404 | + t.setHn(dh); | |
| 405 | + t.setJql(dh); | |
| 406 | + nextJzyl=ylxs; | |
| 407 | + } | |
| 408 | + }else{ | |
| 409 | + t.setHn(0.0); | |
| 410 | + t.setJql(0.0); | |
| 411 | + } | |
| 412 | + } | |
| 413 | + t.setCzcl(100.0); | |
| 414 | + t.setJzcl(100.0); | |
| 415 | + t.setNbbm(map.get("clZbh").toString()); | |
| 416 | + t.setJsy(map.get("jGh") == null ? "" : map.get("jGh").toString()); | |
| 417 | + t.setZlc(map.get("totalKilometers") == null ? 0.0 | |
| 418 | + : Double.parseDouble(map.get("totalKilometers").toString())); | |
| 419 | + t.setXlbm(map.get("xlBm") == null ? "" : map.get("xlBm").toString()); | |
| 420 | + t.setLinename(map.get("lineName")==null?"":map.get("lineName").toString()); | |
| 421 | + t.setJcsx(Integer.parseInt(map.get("seqNumber").toString())); | |
| 422 | + t.setSsgsdm(map.get("company") == null ? "" : map.get("company").toString()); | |
| 423 | + t.setFgsdm(map.get("bCompany") == null ? "" : map.get("bCompany").toString()); | |
| 424 | + t.setJhsj(map.get("fcsj")==null?"":map.get("fcsj").toString()); | |
| 425 | + t.setRq(sdf.parse(rq)); | |
| 426 | + t.setLp(map.get("lpName").toString()); | |
| 427 | + t.setJname(map.get("jName").toString()); | |
| 428 | + if (!(t.getSsgsdm().equals("") || t.getFgsdm().equals(""))) { | |
| 429 | + if (t.getHn() < 0) { | |
| 430 | + t.setHn(0.0); | |
| 431 | + } | |
| 432 | + if (t.getJql() < 0) { | |
| 433 | + t.setJql(0.0); | |
| 434 | + } | |
| 435 | + if (type.equals("add")) { | |
| 436 | + t.setCreatetime(date); | |
| 437 | + addList.add(t); | |
| 438 | + } else { | |
| 439 | + t.setUpdatetime(date); | |
| 440 | + updateList.add(t); | |
| 441 | + } | |
| 442 | + } | |
| 443 | + newMap.put("status", ResponseCode.SUCCESS); | |
| 444 | + } | |
| 445 | + } | |
| 446 | + } | |
| 447 | + } | |
| 448 | + } | |
| 449 | + if(addList.size()>0){ | |
| 450 | + try { | |
| 451 | + new BatchSaveUtils<Qlb>().saveList2(addList, Qlb.class); | |
| 452 | + } catch (Exception e) { | |
| 453 | + // TODO: handle exception | |
| 454 | + if(e.getMessage().indexOf("PK_QLB_UK")>0){ | |
| 455 | + newMap.put("fage", "存在相同数据,数据已经过滤"); | |
| 456 | + logger.info("获取:存在相同数据,数据已经过滤"); | |
| 457 | + } | |
| 458 | + } | |
| 459 | + | |
| 460 | + } | |
| 461 | + | |
| 462 | + if(updateList.size()>0){ | |
| 463 | + for (int i = 0; i < updateList.size(); i++) { | |
| 464 | + repository.save(updateList.get(i)); | |
| 465 | + } | |
| 466 | + } | |
| 467 | + SysUser user = SecurityUtils.getCurrentUser(); | |
| 468 | + Nylog nylog=new Nylog(); | |
| 469 | + nylog.setCreatedate(new Date()); | |
| 470 | + nylog.setCzmc("获取"); | |
| 471 | + nylog.setNylx("氢"); | |
| 472 | + nylog.setUserid(user.getUserName()); | |
| 473 | + nylog.setUsername(user.getName()); | |
| 474 | + nylog.setCxtj(line+"-"+ date+"-"+gsbm+"-"+fgsbm); | |
| 475 | + nylogRepository.save(nylog); | |
| 476 | + newMap.put("status", ResponseCode.SUCCESS); | |
| 477 | + } catch (Exception e) { | |
| 478 | + // TODO Auto-generated catch block | |
| 479 | + newMap.put("status", ResponseCode.ERROR); | |
| 480 | + throw e; | |
| 481 | + } | |
| 482 | + | |
| 483 | + return newMap; | |
| 484 | + } | |
| 485 | + | |
| 486 | + /** | |
| 487 | + * 拆分 | |
| 488 | + */ | |
| 489 | + @Transactional | |
| 490 | + @Override | |
| 491 | + public Map<String, Object> sort(Map<String, Object> map) { | |
| 492 | + // TODO Auto-generated method stub | |
| 493 | + Map<String, Object> newMap = new HashMap<String, Object>(); | |
| 494 | + try{ | |
| 495 | + int id=Integer.parseInt(map.get("id").toString()); | |
| 496 | + //最后存油量 | |
| 497 | + Double jzcl=Double.parseDouble(map.get("jzdl").toString()); | |
| 498 | + Double hn=Double.parseDouble(map.get("hdl").toString()); | |
| 499 | + Qlb qlb=repository.findById(id).get(); | |
| 500 | + qlb.setJzcl(jzcl); | |
| 501 | + qlb.setHn(hn); | |
| 502 | + repository.save(qlb); | |
| 503 | + newMap.put("status", ResponseCode.SUCCESS); | |
| 504 | + }catch(Exception e){ | |
| 505 | + newMap.put("status", ResponseCode.ERROR); | |
| 506 | + logger.error("save erro.", e); | |
| 507 | + } | |
| 508 | + return newMap; | |
| 509 | + } | |
| 510 | + | |
| 511 | + | |
| 512 | + /** | |
| 513 | + * 核对,有加注没里程 | |
| 514 | + * @param map | |
| 515 | + * @return | |
| 516 | + */ | |
| 517 | + @Transactional | |
| 518 | + @Override | |
| 519 | + public Map<String, Object> checkQl(Map<String, Object> map) { | |
| 520 | + Map<String, Object> newMap=new HashMap<String,Object>(); | |
| 521 | + | |
| 522 | + try{ | |
| 523 | + //获取车辆存油信息 | |
| 524 | + | |
| 525 | + String rq=map.get("rq").toString(); | |
| 526 | + String xlbm=""; | |
| 527 | + if(map.get("xlbm_like")!=null){ | |
| 528 | + xlbm= map.get("xlbm_like").toString().trim(); | |
| 529 | + } | |
| 530 | + String gsbm=""; | |
| 531 | + if(map.get("ssgsdm_like")!=null){ | |
| 532 | + gsbm=map.get("ssgsdm_like").toString(); | |
| 533 | + } | |
| 534 | + String fgsbm=""; | |
| 535 | + if(map.get("fgsdm_like")!=null){ | |
| 536 | + fgsbm=map.get("fgsdm_like").toString(); | |
| 537 | + } | |
| 538 | + String nbbm=""; | |
| 539 | + if(map.get("nbbm_eq")!=null){ | |
| 540 | + nbbm=map.get("nbbm_eq").toString(); | |
| 541 | + } | |
| 542 | + | |
| 543 | + String sql="select * from bsth_c_jql j where" | |
| 544 | + + " j.gs_bm = ? and j.fgs_bm = ? and rq = ? " | |
| 545 | + + " and nbbm not in (select nbbm from bsth_c_qlb d " | |
| 546 | + + " where ssgsdm = ? and fgsdm = ? and rq = ?)"; | |
| 547 | + Object[] objects = {gsbm, fgsbm, rq, gsbm, fgsbm, rq}; | |
| 548 | + List<Jql> listJql=jdbcTemplate.query(sql, | |
| 549 | + objects, | |
| 550 | + new RowMapper<Jql>(){ | |
| 551 | + @Override | |
| 552 | + public Jql mapRow(ResultSet rs, int rowNum) throws SQLException { | |
| 553 | + Jql s = new Jql(); | |
| 554 | + s.setNbbm(rs.getString("nbbm")); | |
| 555 | + s.setGsBm(rs.getString("gs_bm")); | |
| 556 | + s.setFgsBm(rs.getString("fgs_bm")); | |
| 557 | + s.setJql(rs.getDouble("jql")); | |
| 558 | + s.setRq(rs.getDate("rq")); | |
| 559 | + return s; | |
| 560 | + } | |
| 561 | + }); | |
| 562 | + for (int i = 0; i < listJql.size(); i++) { | |
| 563 | + Jql j=listJql.get(i); | |
| 564 | + Qlb t=new Qlb(); | |
| 565 | + Line line = BasicData.nbbm2LineMap.get(j.getNbbm()); | |
| 566 | + if(null !=line){ | |
| 567 | + t.setJql(j.getJql()); | |
| 568 | + t.setNbbm(j.getNbbm()); | |
| 569 | + t.setRq(j.getRq()); | |
| 570 | + t.setJsy(""); | |
| 571 | + t.setJql(j.getJql()); | |
| 572 | + t.setSsgsdm(j.getGsBm()); | |
| 573 | + t.setFgsdm(j.getFgsBm()); | |
| 574 | + t.setJzcl(100.0); | |
| 575 | + t.setCzcl(100.0); | |
| 576 | + t.setHn(0.0); | |
| 577 | + t.setJcsx(1); | |
| 578 | + t.setXlbm(line.getLineCode()); | |
| 579 | + t.setLp(""); | |
| 580 | + repository.save(t); | |
| 581 | + } | |
| 582 | + } | |
| 583 | + | |
| 584 | + SysUser user = SecurityUtils.getCurrentUser(); | |
| 585 | + Nylog nylog=new Nylog(); | |
| 586 | + nylog.setCreatedate(new Date()); | |
| 587 | + nylog.setCzmc("核对"); | |
| 588 | + nylog.setNylx("氢"); | |
| 589 | + nylog.setUserid(user.getUserName()); | |
| 590 | + nylog.setUsername(user.getName()); | |
| 591 | + nylog.setCxtj(xlbm+"-"+ rq+"-"+gsbm+"-"+fgsbm); | |
| 592 | + nylogRepository.save(nylog); | |
| 593 | + newMap.put("status", ResponseCode.SUCCESS); | |
| 594 | + }catch(Exception e){ | |
| 595 | + newMap.put("status", ResponseCode.ERROR); | |
| 596 | + logger.error("save erro.", e); | |
| 597 | + throw e; | |
| 598 | + } | |
| 599 | + | |
| 600 | + return newMap; | |
| 601 | + } | |
| 602 | + | |
| 603 | + @Override | |
| 604 | + public List<Qlb> listQlb(Map<String, Object> map) { | |
| 605 | + // TODO Auto-generated method stub | |
| 606 | + List<Qlb> listQlb = new ArrayList<Qlb>(); | |
| 607 | + List<String> stringList = new ArrayList<String>(); | |
| 608 | + String rq = map.get("rq").toString(); | |
| 609 | + String gsbm = map.get("ssgsdm_like").toString(); | |
| 610 | + String fgsbm = map.get("fgsdm_like").toString(); | |
| 611 | + String xlbm = map.get("xlbm_like").toString().trim(); | |
| 612 | + String nbbm = map.get("nbbm_eq").toString(); | |
| 613 | + String sxtj = map.get("sxtj").toString(); | |
| 614 | + String type = map.get("type").toString(); | |
| 615 | + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | |
| 616 | + try { | |
| 617 | + if (nbbm.trim() != "") { | |
| 618 | + stringList.add(nbbm); | |
| 619 | + if (type.equals("1")) | |
| 620 | + listQlb = repository.listQlb(rq, gsbm, fgsbm, xlbm, stringList); | |
| 621 | + else | |
| 622 | + listQlb = repository.listQlb_s(sdf.parse(rq + " 00:00:00"), gsbm, fgsbm, xlbm, stringList); | |
| 623 | + | |
| 624 | + } else { | |
| 625 | + // 全部 | |
| 626 | + if (sxtj.equals("0")) { | |
| 627 | + List<Object[]> objectLists = repository.checkNbmmNum(rq, gsbm, fgsbm, xlbm, nbbm); | |
| 628 | + for (int i = 0; i < objectLists.size(); i++) { | |
| 629 | + String clbm = objectLists.get(i)[0].toString(); | |
| 630 | + stringList.add(clbm); | |
| 631 | + } | |
| 632 | + if (stringList.size() > 0) { | |
| 633 | + if (type.equals("1")) | |
| 634 | + listQlb = repository.listQlb(rq, gsbm, fgsbm, xlbm, stringList); | |
| 635 | + else | |
| 636 | + listQlb = repository.listQlb_s(sdf.parse(rq + " 00:00:00"), gsbm, fgsbm, xlbm, stringList); | |
| 637 | + } | |
| 638 | + } else { | |
| 639 | + List<Object[]> objectLists; | |
| 640 | + if (sxtj.equals("3")) { | |
| 641 | + // 有加油没里程 | |
| 642 | + objectLists = repository.checkNbmmQl(rq, gsbm, fgsbm, xlbm, nbbm); | |
| 643 | + for (int i = 0; i < objectLists.size(); i++) { | |
| 644 | + String clbm = objectLists.get(i)[0].toString(); | |
| 645 | + double jzl = Double.parseDouble(objectLists.get(i)[1].toString()); | |
| 646 | + double zlc = Double.parseDouble(objectLists.get(i)[2].toString()); | |
| 647 | + if (jzl > 0 && zlc <= 0) { | |
| 648 | + stringList.add(clbm); | |
| 649 | + } | |
| 650 | + | |
| 651 | + } | |
| 652 | + | |
| 653 | + } else if (sxtj.equals("4")) { | |
| 654 | + // 有里程没加油 | |
| 655 | + objectLists = repository.checkNbmmQl(rq, gsbm, fgsbm, xlbm, nbbm); | |
| 656 | + for (int i = 0; i < objectLists.size(); i++) { | |
| 657 | + String clbm = objectLists.get(i)[0].toString(); | |
| 658 | + double jzl = Double.parseDouble(objectLists.get(i)[1].toString()); | |
| 659 | + double zlc = Double.parseDouble(objectLists.get(i)[2].toString()); | |
| 660 | + if (zlc > 0 && jzl <= 0) { | |
| 661 | + stringList.add(clbm); | |
| 662 | + } | |
| 663 | + | |
| 664 | + } | |
| 665 | + } else { | |
| 666 | + objectLists = repository.checkNbmmNum(rq, gsbm, fgsbm, xlbm, nbbm); | |
| 667 | + for (int i = 0; i < objectLists.size(); i++) { | |
| 668 | + String clbm = objectLists.get(i)[0].toString(); | |
| 669 | + int cs = Integer.parseInt(objectLists.get(i)[1].toString()); | |
| 670 | + // 一车一单 | |
| 671 | + if (sxtj.equals("1")) { | |
| 672 | + if (cs == 1) { | |
| 673 | + stringList.add(clbm); | |
| 674 | + } | |
| 675 | + } | |
| 676 | + // 一车多单 | |
| 677 | + if (sxtj.equals("2")) { | |
| 678 | + if (cs > 1) { | |
| 679 | + stringList.add(clbm); | |
| 680 | + } | |
| 681 | + } | |
| 682 | + } | |
| 683 | + } | |
| 684 | + | |
| 685 | + if (stringList.size() > 0) { | |
| 686 | + if (type.equals("1")) | |
| 687 | + listQlb = repository.listQlb(rq, gsbm, fgsbm, xlbm, stringList); | |
| 688 | + else | |
| 689 | + listQlb = repository.listQlb_s(sdf.parse(rq + " 00:00:00"), gsbm, fgsbm, xlbm, stringList); | |
| 690 | + } | |
| 691 | + } | |
| 692 | + } | |
| 693 | + } catch (ParseException e) { | |
| 694 | + // TODO Auto-generated catch block | |
| 695 | + e.printStackTrace(); | |
| 696 | + } | |
| 697 | + return listQlb; | |
| 698 | + } | |
| 699 | + | |
| 700 | + @Override | |
| 701 | + public Map<String, Object> sumQlb(Map<String, Object> map) { | |
| 702 | + // TODO Auto-generated method stub | |
| 703 | + List<String> stringList = new ArrayList<String>(); | |
| 704 | + String rq = map.get("rq").toString(); | |
| 705 | + String gsbm = map.get("ssgsdm_like").toString(); | |
| 706 | + String fgsbm = map.get("fgsdm_like").toString(); | |
| 707 | + String xlbm = map.get("xlbm_like").toString().trim(); | |
| 708 | + String nbbm = map.get("nbbm_eq").toString(); | |
| 709 | + String sxtj = map.get("sxtj").toString(); | |
| 710 | + String type = map.get("type").toString(); | |
| 711 | + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | |
| 712 | + List<Object[]> sumQlbList = new ArrayList<Object[]>(); | |
| 713 | + try { | |
| 714 | + if (nbbm.trim() != "") { | |
| 715 | + stringList.add(nbbm); | |
| 716 | + } else { | |
| 717 | + if (!sxtj.equals("0")) { | |
| 718 | + List<Object[]> objectLists; | |
| 719 | + if (sxtj.equals("3")) { | |
| 720 | + // 有加油没里程 | |
| 721 | + objectLists = repository.checkNbmmQl(rq, gsbm, fgsbm, xlbm, nbbm); | |
| 722 | + for (int i = 0; i < objectLists.size(); i++) { | |
| 723 | + String clbm = objectLists.get(i)[0].toString(); | |
| 724 | + double jzl = Double.parseDouble(objectLists.get(i)[1].toString()); | |
| 725 | + double zlc = Double.parseDouble(objectLists.get(i)[2].toString()); | |
| 726 | + if (jzl > 0 && zlc <= 0) { | |
| 727 | + stringList.add(clbm); | |
| 728 | + } | |
| 729 | + | |
| 730 | + } | |
| 731 | + | |
| 732 | + } else if (sxtj.equals("4")) { | |
| 733 | + // 有里程没加油 | |
| 734 | + objectLists = repository.checkNbmmQl(rq, gsbm, fgsbm, xlbm, nbbm); | |
| 735 | + for (int i = 0; i < objectLists.size(); i++) { | |
| 736 | + String clbm = objectLists.get(i)[0].toString(); | |
| 737 | + double jzl = Double.parseDouble(objectLists.get(i)[1].toString()); | |
| 738 | + double zlc = Double.parseDouble(objectLists.get(i)[2].toString()); | |
| 739 | + if (zlc > 0 && jzl <= 0) { | |
| 740 | + stringList.add(clbm); | |
| 741 | + } | |
| 742 | + | |
| 743 | + } | |
| 744 | + } else { | |
| 745 | + objectLists = repository.checkNbmmNum(rq, gsbm, fgsbm, xlbm, nbbm); | |
| 746 | + for (int i = 0; i < objectLists.size(); i++) { | |
| 747 | + String clbm = objectLists.get(i)[0].toString(); | |
| 748 | + int cs = Integer.parseInt(objectLists.get(i)[1].toString()); | |
| 749 | + // 一车一单 | |
| 750 | + if (sxtj.equals("1")) { | |
| 751 | + if (cs == 1) { | |
| 752 | + stringList.add(clbm); | |
| 753 | + } | |
| 754 | + } | |
| 755 | + // 一车多单 | |
| 756 | + if (sxtj.equals("2")) { | |
| 757 | + if (cs > 1) { | |
| 758 | + stringList.add(clbm); | |
| 759 | + } | |
| 760 | + } | |
| 761 | + } | |
| 762 | + } | |
| 763 | + } | |
| 764 | + } | |
| 765 | + if (sxtj.equals("0")) { | |
| 766 | + sumQlbList = repository.sumQlb2(rq, gsbm, fgsbm, xlbm, nbbm); | |
| 767 | + } else { | |
| 768 | + if (stringList.size() > 0) { | |
| 769 | + if (type.equals("1")) | |
| 770 | + sumQlbList = repository.sumQlb(rq, gsbm, fgsbm, xlbm, stringList); | |
| 771 | + else | |
| 772 | + sumQlbList = repository.sumQlb_s(sdf.parse(rq + " 00:00:00"), gsbm, fgsbm, xlbm, stringList); | |
| 773 | + | |
| 774 | + } | |
| 775 | + } | |
| 776 | + } catch (ParseException e) { | |
| 777 | + // TODO Auto-generated catch block | |
| 778 | + e.printStackTrace(); | |
| 779 | + } | |
| 780 | + Double jzl = 0.0, yh = 0.0, sh = 0.0; | |
| 781 | + for (int i = 0; i < sumQlbList.size(); i++) { | |
| 782 | + jzl = Arith.add(jzl, Double.valueOf(sumQlbList.get(i)[0].toString())); | |
| 783 | + yh = Arith.add(yh, Double.valueOf(sumQlbList.get(i)[1].toString())); | |
| 784 | + sh = Arith.add(sh, Double.valueOf(sumQlbList.get(i)[2].toString())); | |
| 785 | + } | |
| 786 | + | |
| 787 | + Map<String, Object> sumMap = new HashMap<String, Object>(); | |
| 788 | + sumMap.put("jzl", jzl); | |
| 789 | + sumMap.put("yh", yh); | |
| 790 | + sumMap.put("sh", sh); | |
| 791 | + return sumMap; | |
| 792 | + } | |
| 793 | + | |
| 794 | + | |
| 795 | + @Transactional | |
| 796 | + @Override | |
| 797 | + public Map<String, Object> saveQlbList(Map<String, Object> map) throws Exception { | |
| 798 | + // TODO Auto-generated method stub | |
| 799 | + Map<String, Object> newMap=new HashMap<String,Object>(); | |
| 800 | + try{ | |
| 801 | + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); | |
| 802 | + String json =StringEscapeUtils.unescapeHtml4(map.get("qlbList").toString()); | |
| 803 | + JSONArray jsonArray=JSONArray.parseArray(json); | |
| 804 | + JSONObject jsonObject; | |
| 805 | + for (int i = 0; i < jsonArray.size(); i++) { | |
| 806 | + jsonObject=jsonArray.getJSONObject(i); | |
| 807 | + double czcl = jsonObject.getDoubleValue("czcl"); | |
| 808 | +// double jql =jsonObject.getDoubleValue("jql"); | |
| 809 | + double jzcl =jsonObject.getDoubleValue("jzcl"); | |
| 810 | + double sh =jsonObject.getDoubleValue("sh"); | |
| 811 | + String shyy =jsonObject.getString("shyy"); | |
| 812 | + double hn = jsonObject.getDoubleValue("hn"); | |
| 813 | + int nhlx =jsonObject.getIntValue("nhlx"); | |
| 814 | + Integer id =jsonObject.getInteger("id"); | |
| 815 | + repository.qlbUpdate(id, czcl, jzcl, hn, sh, shyy, nhlx); | |
| 816 | + | |
| 817 | + } | |
| 818 | + | |
| 819 | + SysUser user = SecurityUtils.getCurrentUser(); | |
| 820 | + Nylog nylog=new Nylog(); | |
| 821 | + nylog.setCreatedate(new Date()); | |
| 822 | + nylog.setCzmc("保存全部"); | |
| 823 | + nylog.setNylx("氢"); | |
| 824 | + nylog.setUserid(user.getUserName()); | |
| 825 | + nylog.setUsername(user.getName()); | |
| 826 | + nylog.setCxtj(""); | |
| 827 | + nylogRepository.save(nylog); | |
| 828 | + newMap.put("status", ResponseCode.SUCCESS); | |
| 829 | + }catch(Exception e){ | |
| 830 | + newMap.put("status", ResponseCode.ERROR); | |
| 831 | + logger.error("save erro.", e); | |
| 832 | + throw e; | |
| 833 | + } | |
| 834 | + return newMap; | |
| 835 | + } | |
| 836 | + | |
| 837 | + public List<Qlb> listOrderBy(String rq,String gsdm, | |
| 838 | + String fgsdm,String xlbm,String nbbm, | |
| 839 | + String px) { | |
| 840 | + | |
| 841 | + List<String> objList = new ArrayList<>(); | |
| 842 | + String sql="SELECT * FROM bsth_c_qlb " | |
| 843 | + + " where rq=? "; | |
| 844 | + objList.add(rq); | |
| 845 | + if(gsdm.trim().length() > 0 && fgsdm.trim().length() > 0){ | |
| 846 | + sql += " and ssgsdm like CONCAT('%',?,'%') " | |
| 847 | + + " and fgsdm like CONCAT('%',?,'%') "; | |
| 848 | + objList.add(gsdm); | |
| 849 | + objList.add(fgsdm); | |
| 850 | + } else if(gsdm.trim().length() > 0){ | |
| 851 | + sql += " and ssgsdm like CONCAT('%',?,'%') "; | |
| 852 | + objList.add(gsdm); | |
| 853 | + } | |
| 854 | + if(xlbm.trim().length() > 0){ | |
| 855 | + sql+= " and xlbm = ? "; | |
| 856 | + objList.add(xlbm); | |
| 857 | + } | |
| 858 | + sql += "and nbbm like CONCAT('%',?,'%') order by "+px+" asc "; | |
| 859 | + objList.add(nbbm); | |
| 860 | + | |
| 861 | + List<Qlb> list = jdbcTemplate.query(sql, objList.toArray(), new RowMapper<Qlb>() { | |
| 862 | + @Override | |
| 863 | + public Qlb mapRow(ResultSet arg0, int arg1) throws SQLException { | |
| 864 | + Qlb y = new Qlb(); | |
| 865 | + y.setId(arg0.getInt("id")); | |
| 866 | + return y; | |
| 867 | + } | |
| 868 | + }); | |
| 869 | + List<Qlb> lists=new ArrayList<Qlb>(); | |
| 870 | + List<Qlb> qlbLists=repository.obtainQl(rq,gsdm,fgsdm,xlbm,nbbm,"jcsx"); | |
| 871 | + for (int i = 0; i < list.size(); i++) { | |
| 872 | + Qlb t=list.get(i); | |
| 873 | + for (int j = 0; j < qlbLists.size(); j++) { | |
| 874 | + Qlb t2=qlbLists.get(j); | |
| 875 | + if(t.getId().intValue()==t2.getId().intValue()){ | |
| 876 | + lists.add(t2); | |
| 877 | + break; | |
| 878 | + } | |
| 879 | + } | |
| 880 | + } | |
| 881 | + | |
| 882 | + return lists; | |
| 883 | + } | |
| 884 | + | |
| 885 | + | |
| 886 | + @Override | |
| 887 | + public String checkJsy(Map<String, Object> map) { | |
| 888 | + // TODO Auto-generated method stub | |
| 889 | + String rq=map.get("date").toString(); | |
| 890 | + String nbbm=map.get("nbbm").toString(); | |
| 891 | + String jsy =map.get("jsy").toString(); | |
| 892 | + String xlbm=map.get("xlbm").toString(); | |
| 893 | + List<Qlb> list= repository.queryListQlb(rq, nbbm, jsy, xlbm); | |
| 894 | + String type="1"; | |
| 895 | + if(list.size()>0){ | |
| 896 | + type="0"; | |
| 897 | + } | |
| 898 | + return type; | |
| 899 | + } | |
| 900 | + | |
| 901 | + @Override | |
| 902 | + public Map<String, Object> saveQlb(Qlb t) { | |
| 903 | + // TODO Auto-generated method stub | |
| 904 | + Map<String, Object> map = new HashMap<>(); | |
| 905 | + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); | |
| 906 | + String rq=sdf.format(t.getRq()); | |
| 907 | + String gsdm=t.getSsgsdm(); | |
| 908 | + String fgsdm=t.getFgsdm(); | |
| 909 | + String xlbm=t.getXlbm(); | |
| 910 | + String jhsj=t.getJhsj(); | |
| 911 | + String nbbm=t.getNbbm(); | |
| 912 | + t.setCreatetime(new Date()); | |
| 913 | + String[] jhsjStr = jhsj.split(":"); | |
| 914 | + long fcsjL= Long.parseLong(jhsjStr[0])*60+Long.parseLong(jhsjStr[1]); | |
| 915 | + List<Qlb> list=this.listOrderBy(rq, gsdm, fgsdm, xlbm, nbbm, "jhsj"); | |
| 916 | + int jcsx=1; | |
| 917 | + if(list.size()>0){ | |
| 918 | + for (int i = 0; i < list.size(); i++) { | |
| 919 | + Qlb y=list.get(i); | |
| 920 | + String[] fcsjStr = y.getJhsj().split(":"); | |
| 921 | + long fcsj=Long.parseLong(fcsjStr[0])*60+Long.parseLong(fcsjStr[1]); | |
| 922 | + if(fcsjL>fcsj){ | |
| 923 | + jcsx=jcsx+y.getJcsx(); | |
| 924 | + }else{ | |
| 925 | + y.setJcsx(y.getJcsx()+1); | |
| 926 | + repository.save(y); | |
| 927 | + } | |
| 928 | + } | |
| 929 | + } | |
| 930 | + t.setJcsx(jcsx); | |
| 931 | + repository.save(t); | |
| 932 | + | |
| 933 | + SysUser user = SecurityUtils.getCurrentUser(); | |
| 934 | + Nylog nylog=new Nylog(); | |
| 935 | + nylog.setCreatedate(new Date()); | |
| 936 | + nylog.setCzmc("手动添加"); | |
| 937 | + nylog.setNylx("氢"); | |
| 938 | + nylog.setUserid(user.getUserName()); | |
| 939 | + nylog.setUsername(user.getName()); | |
| 940 | + nylog.setCxtj(""); | |
| 941 | + nylogRepository.save(nylog); | |
| 942 | + map.put("status", ResponseCode.SUCCESS); | |
| 943 | + map.put("t", t); | |
| 944 | + return map; | |
| 945 | + } | |
| 946 | + | |
| 947 | + @Transactional | |
| 948 | + @Override | |
| 949 | + public Map<String, Object> deleteIds(Map<String, Object> map) throws Exception{ | |
| 950 | + // TODO Auto-generated method stub | |
| 951 | + Map<String, Object> maps = new HashMap<>(); | |
| 952 | + try{ | |
| 953 | + String json =StringEscapeUtils.unescapeHtml4(map.get("ids").toString()); | |
| 954 | + JSONArray jsonArray=JSONArray.parseArray(json); | |
| 955 | + JSONObject jsonObject; | |
| 956 | + for (int x = 0; x < jsonArray.size(); x++) { | |
| 957 | + jsonObject=jsonArray.getJSONObject(x); | |
| 958 | + Integer id =jsonObject.getInteger("id"); | |
| 959 | + repository.deleteById(id); | |
| 960 | + } | |
| 961 | + | |
| 962 | + SysUser user = SecurityUtils.getCurrentUser(); | |
| 963 | + Nylog nylog=new Nylog(); | |
| 964 | + nylog.setCreatedate(new Date()); | |
| 965 | + nylog.setCzmc("删除"); | |
| 966 | + nylog.setNylx("氢"); | |
| 967 | + nylog.setUserid(user.getUserName()); | |
| 968 | + nylog.setUsername(user.getName()); | |
| 969 | + nylog.setCxtj(""); | |
| 970 | + nylogRepository.save(nylog); | |
| 971 | + maps.put("status", ResponseCode.SUCCESS); | |
| 972 | + } catch (Exception e) { | |
| 973 | + maps.put("status", ResponseCode.ERROR); | |
| 974 | + logger.error("save erro.", e); | |
| 975 | + throw e; | |
| 976 | + } | |
| 977 | + return maps; | |
| 978 | + } | |
| 979 | + | |
| 980 | + @Override | |
| 981 | + public Map<String, List<Qlb>> updeteHistory(List<Map<String, Object>> listpbQc,String date, | |
| 982 | + String gsdm,String fgsdm,String line) { | |
| 983 | + // TODO Auto-generated method stub | |
| 984 | + Map<String, List<Qlb>> mapList=new HashMap<String,List<Qlb>>(); | |
| 985 | + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); | |
| 986 | + // 保留两位小数 | |
| 987 | + DecimalFormat df = new DecimalFormat("#.00"); | |
| 988 | + List<Qlb> qlbList=this.listOrderBy(date,gsdm,fgsdm,"","","nbbm"); | |
| 989 | + List<Qlb> qlbList_upd=new ArrayList<Qlb>(); | |
| 990 | + List<Qlb> qlbList_del=new ArrayList<Qlb>(); | |
| 991 | + try{ | |
| 992 | + for (int j = 0; j < qlbList.size(); j++) { | |
| 993 | + Qlb t=qlbList.get(j); | |
| 994 | + boolean fage=true; | |
| 995 | + if(StringUtils.isEmpty(t.getLp())){ | |
| 996 | + fage=false; | |
| 997 | + }else{ | |
| 998 | + for (int i = 0; i < listpbQc.size(); i++) { | |
| 999 | + Map<String, Object> m = listpbQc.get(i); | |
| 1000 | + if(t.getNbbm().equals(m.get("clZbh").toString()) | |
| 1001 | + &&t.getJsy().equals(m.get("jGh").toString()) | |
| 1002 | + &&t.getXlbm().equals(m.get("xlBm").toString()) | |
| 1003 | + &&t.getLp().equals(m.get("lpName").toString())){ | |
| 1004 | + //该条记录不用删除 | |
| 1005 | + fage =false; | |
| 1006 | + qlbList_upd.add(t); | |
| 1007 | + } | |
| 1008 | + } | |
| 1009 | + } | |
| 1010 | + | |
| 1011 | + if(fage){ | |
| 1012 | + if(t.getXlbm().equals(line)){ | |
| 1013 | + qlbList_del.add(t); | |
| 1014 | + } | |
| 1015 | + } | |
| 1016 | + } | |
| 1017 | + mapList.put("delList", qlbList_del); | |
| 1018 | + Map<String, Double> lcMap=new HashMap<String,Double>(); | |
| 1019 | + for (int i = 0; i < listpbQc.size(); i++) { | |
| 1020 | + String cl=listpbQc.get(i).get("clZbh").toString(); | |
| 1021 | + Double lc= listpbQc.get(i).get("totalKilometers") == null ? 0.0 | |
| 1022 | + : Double.parseDouble(listpbQc.get(i).get("totalKilometers").toString()); | |
| 1023 | + if(lcMap.get(cl)==null){ | |
| 1024 | + lcMap.put(cl, lc); | |
| 1025 | + }else{ | |
| 1026 | + double lc_=lcMap.get(cl); | |
| 1027 | + lcMap.remove(cl); | |
| 1028 | + lcMap.put(cl, Arith.add(lc, lc_)); | |
| 1029 | + } | |
| 1030 | + } | |
| 1031 | + Map<String, Double> shMap=new HashMap<String,Double>(); | |
| 1032 | + for (int i = 0; i < qlbList_upd.size(); i++) { | |
| 1033 | + Qlb qlb=qlbList_upd.get(i); | |
| 1034 | + String cl=qlb.getNbbm(); | |
| 1035 | + if(shMap.get(cl)==null){ | |
| 1036 | + shMap.put(cl, qlb.getSh()); | |
| 1037 | + }else{ | |
| 1038 | + double sh=shMap.get(cl); | |
| 1039 | + shMap.remove(cl); | |
| 1040 | + shMap.put(cl, Arith.add(sh, qlb.getSh())); | |
| 1041 | + } | |
| 1042 | + } | |
| 1043 | + List<Jql> jqlList=jqlRepository.JqlList(date); | |
| 1044 | + List<Ylxxb> ylxxList = ylxxbRepository.obtainYlxx(date, 0, gsdm); | |
| 1045 | + Map<String, Object> newMap_=new HashMap<String,Object>(); | |
| 1046 | + Map<String, Object> cMap=new HashMap<String, Object>(); | |
| 1047 | + List<Map<String, Object>> listpb_=listpbQc; | |
| 1048 | + Collections.sort(listpbQc,new NbbmJcsxMap2()); | |
| 1049 | + List<Qlb> updateQlb=new ArrayList<Qlb>(); | |
| 1050 | + for (int x = 0; x < listpb_.size(); x++) { | |
| 1051 | + String type = "add"; | |
| 1052 | + Map<String, Object> map_ = listpb_.get(x); | |
| 1053 | + if(newMap_.get(map_.get("clZbh").toString())==null){ | |
| 1054 | + newMap_.put(map_.get("clZbh").toString(), map_.get("clZbh").toString()); | |
| 1055 | + //车辆总里程 | |
| 1056 | + double zlc =lcMap.get(map_.get("clZbh").toString()); | |
| 1057 | + //车辆总加氢量 | |
| 1058 | + double zjzl = 0.0; | |
| 1059 | +// for (int j = 0; j < ylxxList.size(); j++) { | |
| 1060 | +// Ylxxb ylxxb = ylxxList.get(j); | |
| 1061 | +// if (map_.get("clZbh").toString().equals(ylxxb.getNbbm()) | |
| 1062 | +// && map_.get("company").toString().equals(ylxxb.getGsdm())) { | |
| 1063 | +// zjzl = Arith.add(zjzl, ylxxb.getJzl()); | |
| 1064 | +// } | |
| 1065 | +// } | |
| 1066 | + for (int i = 0; i < jqlList.size(); i++) { | |
| 1067 | + Jql jql=jqlList.get(i); | |
| 1068 | + if(map_.get("clZbh").toString().equals(jql.getNbbm()) | |
| 1069 | + &&map_.get("company").toString().equals(jql.getGsBm()) | |
| 1070 | + &&map_.get("bCompany").toString().equals(jql.getFgsBm())){ | |
| 1071 | + zjzl = Arith.add(zjzl,jql.getJql()); | |
| 1072 | + } | |
| 1073 | + } | |
| 1074 | + double clsh=0.0; | |
| 1075 | + if(shMap.get(map_.get("clZbh").toString())==null){ | |
| 1076 | + clsh=0.0; | |
| 1077 | + }else{ | |
| 1078 | + clsh=shMap.get(map_.get("clZbh").toString()); | |
| 1079 | + } | |
| 1080 | + zjzl =Arith.sub(zjzl, clsh); | |
| 1081 | + Double nextJzyl = 0.0; | |
| 1082 | + for (int i = 0; i < listpbQc.size(); i++) { | |
| 1083 | + Map<String, Object> map = listpbQc.get(i); | |
| 1084 | + if(map_.get("clZbh").toString().equals(map.get("clZbh").toString())){ | |
| 1085 | + // 判断驾驶员驾驶的该车辆是否已经存入了(查出的结果集中日期是相同的,根据驾驶员、内部编号、线路编码判断) | |
| 1086 | + Qlb t = new Qlb(); | |
| 1087 | + for (int k = 0; k < qlbList_upd.size(); k++) { | |
| 1088 | + Qlb t1 = qlbList_upd.get(k); | |
| 1089 | + if (t1.getNbbm().equals(map.get("clZbh").toString()) | |
| 1090 | + && t1.getJsy().equals(map.get("jGh").toString()) | |
| 1091 | + && t1.getXlbm().equals(map.get("xlBm").toString()) | |
| 1092 | + && t1.getLp().equals(map.get("lpName").toString())) { | |
| 1093 | + t = t1; | |
| 1094 | + type = "update"; | |
| 1095 | + } | |
| 1096 | + | |
| 1097 | + } | |
| 1098 | + Double lc= Double.parseDouble(map.get("totalKilometers").toString()); | |
| 1099 | + if(map.get("seqNumber").toString().equals("1")){ | |
| 1100 | + // 当日的第一个班次,出场油量等于前一天的最后一个班次的进场油量 | |
| 1101 | + Double dh=0.0; | |
| 1102 | + if(zlc>0){ | |
| 1103 | + dh = Double.parseDouble(df.format(zjzl * (lc / zlc))); | |
| 1104 | + } | |
| 1105 | + nextJzyl =Arith.sub(zjzl,dh); | |
| 1106 | + if(zlc>0){ | |
| 1107 | +// long l=Math.round(nextJzyl); | |
| 1108 | + double ylxs=nextJzyl; | |
| 1109 | + dh=Arith.add(dh, Arith.sub(nextJzyl,ylxs)); | |
| 1110 | + if(dh<0){ | |
| 1111 | + t.setHn(0.0); | |
| 1112 | + t.setJql(0.0); | |
| 1113 | + nextJzyl=Arith.add(ylxs, dh); | |
| 1114 | + }else{ | |
| 1115 | + t.setHn(dh); | |
| 1116 | + t.setJql(dh); | |
| 1117 | + nextJzyl=ylxs; | |
| 1118 | + } | |
| 1119 | + }else{ | |
| 1120 | + t.setHn(0.0); | |
| 1121 | + t.setJql(0.0); | |
| 1122 | + } | |
| 1123 | + }else{ | |
| 1124 | + Double dh=0.0; | |
| 1125 | + if(zlc>0){ | |
| 1126 | + dh = Double.parseDouble(df.format(zjzl * (lc / zlc))); | |
| 1127 | + } | |
| 1128 | + nextJzyl =Arith.sub( nextJzyl,dh); | |
| 1129 | + if(zlc>0){ | |
| 1130 | +// long l=0l; | |
| 1131 | + double ylxs=0.0; | |
| 1132 | + if(i==listpbQc.size()-1){ | |
| 1133 | +// ylxs=czyl; | |
| 1134 | + }else{ | |
| 1135 | + if(listpbQc.get(i+1).get("clZbh").toString().equals(map.get("clZbh").toString())){ | |
| 1136 | +// l=Math.round(nextJzyl); | |
| 1137 | + ylxs=nextJzyl; | |
| 1138 | + } | |
| 1139 | + | |
| 1140 | + } | |
| 1141 | + dh=Arith.add(dh, Arith.sub(nextJzyl,ylxs)); | |
| 1142 | + if(dh<0){ | |
| 1143 | + t.setHn(0.0); | |
| 1144 | + t.setJql(0.0); | |
| 1145 | + nextJzyl=Arith.add(ylxs, dh); | |
| 1146 | + }else{ | |
| 1147 | + t.setHn(dh); | |
| 1148 | + t.setJql(dh); | |
| 1149 | + nextJzyl=ylxs; | |
| 1150 | + } | |
| 1151 | + }else{ | |
| 1152 | + t.setHn(0.0); | |
| 1153 | + t.setJql(0.0); | |
| 1154 | + } | |
| 1155 | + } | |
| 1156 | + t.setCzcl(100.0); | |
| 1157 | + t.setJzcl(100.0); | |
| 1158 | + t.setNbbm(map.get("clZbh").toString()); | |
| 1159 | + t.setJsy(map.get("jGh") == null ? "" : map.get("jGh").toString()); | |
| 1160 | + t.setZlc(map.get("totalKilometers") == null ? 0.0 | |
| 1161 | + : Double.parseDouble(map.get("totalKilometers").toString())); | |
| 1162 | + t.setXlbm(map.get("xlBm") == null ? "" : map.get("xlBm").toString()); | |
| 1163 | + t.setJcsx(Integer.parseInt(map.get("seqNumber").toString())); | |
| 1164 | + t.setSsgsdm(map.get("company") == null ? "" : map.get("company").toString()); | |
| 1165 | + t.setFgsdm(map.get("bCompany") == null ? "" : map.get("bCompany").toString()); | |
| 1166 | + t.setJhsj(map.get("fcsj")==null?"":map.get("fcsj").toString()); | |
| 1167 | + t.setRq(sdf.parse(date)); | |
| 1168 | + t.setLp(map.get("lpName").toString()); | |
| 1169 | + t.setJql(Arith.add(t.getJql(), t.getSh())); | |
| 1170 | + if(!(t.getSsgsdm().equals("") || t.getFgsdm().equals(""))){ | |
| 1171 | + if(type.equals("add")){ | |
| 1172 | + t.setCreatetime(new Date()); | |
| 1173 | + }else{ | |
| 1174 | + t.setUpdatetime(new Date()); | |
| 1175 | + } | |
| 1176 | + } | |
| 1177 | + | |
| 1178 | + if(t.getHn()<0){ | |
| 1179 | + t.setHn(0.0); | |
| 1180 | + } | |
| 1181 | + if(t.getJql()<0){ | |
| 1182 | + t.setJql(0.0); | |
| 1183 | + } | |
| 1184 | + updateQlb.add(t); | |
| 1185 | + } | |
| 1186 | + } | |
| 1187 | + } | |
| 1188 | + } | |
| 1189 | + mapList.put("updList", updateQlb); | |
| 1190 | + }catch(Exception e){ | |
| 1191 | + logger.error("save erro.", e); | |
| 1192 | + } | |
| 1193 | + return mapList; | |
| 1194 | + } | |
| 1195 | + | |
| 1196 | + @Override | |
| 1197 | + public Map<String, Object> update(Map<String, Object> map) { | |
| 1198 | + if(map.get("id")!=null){ | |
| 1199 | + if(map.get("id").toString().length()>0){ | |
| 1200 | + Integer id=Integer.parseInt(map.get("id").toString()); | |
| 1201 | + String jsy=map.get("jsy").toString(); | |
| 1202 | + Qlb t=repository.findById(id).get(); | |
| 1203 | + t.setJsy(jsy); | |
| 1204 | + repository.save(t); | |
| 1205 | + map.put("status", ResponseCode.SUCCESS); | |
| 1206 | + } | |
| 1207 | + } | |
| 1208 | + return map; | |
| 1209 | + } | |
| 1210 | + | |
| 1211 | +} | |
| 1212 | + | |
| 1213 | +class NbbmJcsxMap2 implements Comparator<Map<String, Object>>{ | |
| 1214 | + @Override | |
| 1215 | + public int compare(Map<String, Object> o1, Map<String, Object> o2) { | |
| 1216 | + // TODO Auto-generated method stub | |
| 1217 | + return (o1.get("clZbh").toString()+o1.get("seqNumber").toString()).compareTo((o2.get("clZbh").toString()+o1.get("seqNumber").toString())); | |
| 1218 | + } | |
| 1219 | +} | ... | ... |
src/main/resources/static/pages/forms/export/import_Jql.xls
0 → 100644
No preview for this file type
src/main/resources/static/pages/forms/mould/export_Jql.xls
0 → 100644
No preview for this file type
src/main/resources/static/pages/forms/mould/listQl.xls
0 → 100644
No preview for this file type
src/main/resources/static/pages/hydrogen/jql/list.html
0 → 100644
| 1 | +<style> | |
| 2 | +.blue{ | |
| 3 | + background-color: #87CEFF | |
| 4 | +} | |
| 5 | +</style> | |
| 6 | +<div class="page-head"> | |
| 7 | + <div class="page-title"> | |
| 8 | + <h1>车辆加氢量</h1> | |
| 9 | + </div> | |
| 10 | +</div> | |
| 11 | +<ul class="page-breadcrumb breadcrumb"> | |
| 12 | + <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li> | |
| 13 | + <li><span class="active">用氢管理</span> <i class="fa fa-circle"></i></li> | |
| 14 | + <li><span class="active">车辆加氢管理</span></li> | |
| 15 | +</ul> | |
| 16 | + | |
| 17 | +<div class="row" id="ll_oil_list"> | |
| 18 | + <div class="col-md-12"> | |
| 19 | + <!-- Begin: life time stats --> | |
| 20 | + <div class="portlet light portlet-fit portlet-datatable bordered"> | |
| 21 | + <div class="portlet-title"> | |
| 22 | + <div class="caption"> | |
| 23 | + <i class="fa fa-fire-extinguisher"></i> <span | |
| 24 | + class="caption-subject font-dark sbold uppercase">车辆加氢量</span> | |
| 25 | + </div> | |
| 26 | + <div class="actions"> | |
| 27 | + <button type="button" class="btn btn-circle blue" id="upload"><i class="fa fa-file-excel-o"></i> | |
| 28 | + 导入Excel | |
| 29 | + </button> | |
| 30 | + <button type="button" class="btn btn-circle blue" id="export"><i class="fa fa-file-excel-o"></i> | |
| 31 | + 导出Excel | |
| 32 | + </button> | |
| 33 | + </div> | |
| 34 | + </div> | |
| 35 | + <div class="portlet-body"> | |
| 36 | + <div class="table-container" style="margin-top: 0px"> | |
| 37 | + <table | |
| 38 | + class="table table-striped table-bordered table-hover table-checkable" | |
| 39 | + id="datatable_qlb"> | |
| 40 | + <thead> | |
| 41 | + <tr role="row" class="filter"> | |
| 42 | + <td>公司:</td> | |
| 43 | + <td> | |
| 44 | + <select class="form-control" id="gsbm" ></select> | |
| 45 | + </td> | |
| 46 | + <td>分公司:</td> | |
| 47 | + <td> | |
| 48 | + <select class="form-control" id="fgsbm" ></select> | |
| 49 | + </td> | |
| 50 | + <td>日期:</td> | |
| 51 | + <td width="86px"> | |
| 52 | + <input type="text" style="width: 80px" name="rq" id="rq"/> | |
| 53 | + </td> | |
| 54 | + <td>内部编码:</td> | |
| 55 | + <td> | |
| 56 | + <select class="form-control" name="nbbm" id="nbbm" style="width: 120px;"></select> | |
| 57 | + </td> | |
| 58 | + | |
| 59 | + <td width="20%"> | |
| 60 | + <button class="btn btn-sm green btn-outline filter-submit margin-bottom" style="margin-right:0px"> | |
| 61 | + <i class="fa fa-search"></i> 搜索 | |
| 62 | + </button> | |
| 63 | + <button class="btn btn-sm red btn-outline filter-cancel" style="margin-right:0px"> | |
| 64 | + <i class="fa fa-times"></i> 重置 | |
| 65 | + </button> | |
| 66 | +<!-- <button class="btn btn-danger btn-sm red" id="del" style="margin-right:0px"> --> | |
| 67 | +<!-- <i class="fa fa-times"></i> 删除 --> | |
| 68 | +<!-- </button> --> | |
| 69 | + </td> | |
| 70 | + </tr> | |
| 71 | + <tr role="row" class="heading"> | |
| 72 | + <th>#</th> | |
| 73 | + <th>日期</th> | |
| 74 | + <th colspan="2">内部编码</th> | |
| 75 | + <th colspan="2">加氢量</th> | |
| 76 | + <th colspan="2">加氢站</th> | |
| 77 | + <th colspan="2">备注</th> | |
| 78 | +<!-- <td>操作</td> --> | |
| 79 | + </tr> | |
| 80 | + </thead> | |
| 81 | + <tbody></tbody> | |
| 82 | + </table> | |
| 83 | + <div style="text-align: right;"> | |
| 84 | + <ul id="pagination" class="pagination"></ul> | |
| 85 | + </div> | |
| 86 | + </div> | |
| 87 | + </div> | |
| 88 | + <div class="portlet-body"> | |
| 89 | + <div id="modules_tree"></div> | |
| 90 | + </div> | |
| 91 | + </div> | |
| 92 | + </div> | |
| 93 | +</div> | |
| 94 | + | |
| 95 | + | |
| 96 | +<script src="/assets/js/ajaxfileupload/ajaxfileupload.js"></script> | |
| 97 | +<script> | |
| 98 | + $(function () { | |
| 99 | + | |
| 100 | + // 关闭左侧栏 | |
| 101 | + if (!$('body').hasClass('page-sidebar-closed')) | |
| 102 | + $('.menu-toggler.sidebar-toggler').click(); | |
| 103 | + | |
| 104 | + $("#rq").datetimepicker({ | |
| 105 | + format: 'YYYY-MM-DD', | |
| 106 | + locale: 'zh-cn' | |
| 107 | + }); | |
| 108 | + | |
| 109 | + var page = 0, initPagination; | |
| 110 | + var icheckOptions = { | |
| 111 | + radioClass: 'iradio_square-blue icheck', | |
| 112 | + increaseArea: '20%' | |
| 113 | + } | |
| 114 | + | |
| 115 | + //重置 | |
| 116 | + $('tr.filter .filter-cancel').on('click', function () { | |
| 117 | + $('tr.filter input, select').val('').change(); | |
| 118 | + }); | |
| 119 | + | |
| 120 | + //提交 | |
| 121 | + $('tr.filter .filter-submit').on('click', function () { | |
| 122 | + var gsbm = $('#gsbm').val(); | |
| 123 | + var fgsbm = $('#fgsbm').val(); | |
| 124 | + if ($("#rq").val() == "" || $("#rq").val() ==null){ | |
| 125 | + layer.msg('请选择日期.'); | |
| 126 | + }else if(gsbm=="" || gsbm==null || fgsbm=="" ||fgsbm==null){ | |
| 127 | + layer.msg('请选择公司和分公司.'); | |
| 128 | + }else { | |
| 129 | + | |
| 130 | + var params = getParams(); | |
| 131 | + | |
| 132 | + page = 0; | |
| 133 | + jsDoQuery(params, true); | |
| 134 | + } | |
| 135 | + }); | |
| 136 | + | |
| 137 | + | |
| 138 | + $.get('/user/companyData', function(result){ | |
| 139 | + obj = result; | |
| 140 | + var options=""; | |
| 141 | +// = '<option value="">请选择</option>'; | |
| 142 | + for(var i = 0; i < obj.length; i++){ | |
| 143 | + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>'; | |
| 144 | +// setFgsqx(obj[i].companyCode); | |
| 145 | + } | |
| 146 | + $('#gsbm').html(options); | |
| 147 | + updateCompany(); | |
| 148 | + }); | |
| 149 | + | |
| 150 | + $("#gsbm").on("change",updateCompany); | |
| 151 | + function updateCompany(){ | |
| 152 | + var company = $('#gsbm').val(); | |
| 153 | + var options =""; | |
| 154 | +// = '<option value="">请选择</option>'; | |
| 155 | + for(var i = 0; i < obj.length; i++){ | |
| 156 | + if(obj[i].companyCode == company){ | |
| 157 | + var children = obj[i].children; | |
| 158 | + for(var j = 0; j < children.length; j++){ | |
| 159 | + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>'; | |
| 160 | + } | |
| 161 | + } | |
| 162 | + } | |
| 163 | + $('#fgsbm').html(options); | |
| 164 | + } | |
| 165 | + /* | |
| 166 | + * 获取数据 p: 要提交的参数, pagination: 是否重新分页 | |
| 167 | + */ | |
| 168 | + function jsDoQuery(p, pagination) { | |
| 169 | + var params = {}; | |
| 170 | + if (p) | |
| 171 | + params = p; | |
| 172 | + params['order'] = 'nbbm'; | |
| 173 | + params['page'] = page; | |
| 174 | + params['rq'] = $("#rq").val(); | |
| 175 | + | |
| 176 | + var j = layer.load(2); | |
| 177 | + $get('/jql/query', params, function (data) { | |
| 178 | + $.each(data.dataList, function (i, obj) { | |
| 179 | + obj.rq = moment(obj.rq).format("YYYY-MM-DD"); | |
| 180 | + }); | |
| 181 | + var bodyHtm = template('jql_list', {list:data.dataList}); | |
| 182 | + | |
| 183 | + $('#datatable_qlb tbody').html(bodyHtm) | |
| 184 | + .find('.icheck').iCheck(icheckOptions) | |
| 185 | + .on('ifChanged', iCheckChange); | |
| 186 | + if (pagination && data.dataList.length > 0) { | |
| 187 | + //重新分页 | |
| 188 | + initPagination = true; | |
| 189 | + showPagination(data); | |
| 190 | + $('#pagination').show(); | |
| 191 | + } else if(data.dataList.length == 0){ | |
| 192 | + $('#pagination').hide(); | |
| 193 | + } | |
| 194 | + | |
| 195 | + layer.close(j); | |
| 196 | + | |
| 197 | + startOptJzylLink($('#ll_oil_list .in_carpark_jzyl')); | |
| 198 | + }); | |
| 199 | + } | |
| 200 | + | |
| 201 | + //改变状态 | |
| 202 | + function startOptJzylLink(es) { | |
| 203 | + es.editable({ | |
| 204 | + type: 'text', | |
| 205 | + placement: 'right', | |
| 206 | + width: 100, | |
| 207 | + display: false, | |
| 208 | + validate: function (value) { | |
| 209 | + if (!value) | |
| 210 | + return '值不能为空!'; | |
| 211 | + if (isNaN(value)) | |
| 212 | + return '只能为数字!'; | |
| 213 | + if (value < 0) | |
| 214 | + return '值不能小于0!'; | |
| 215 | + }, | |
| 216 | + inputclass: 'form-control input-medium input-edtable-sm' | |
| 217 | + }).on('save', function (e, params) { | |
| 218 | + $(this).text(params.newValue); | |
| 219 | + }); | |
| 220 | + } | |
| 221 | + | |
| 222 | + function iCheckChange() { | |
| 223 | + var tr = $(this).parents('tr'); | |
| 224 | + if (this.checked) | |
| 225 | + tr.addClass('row-active'); | |
| 226 | + else | |
| 227 | + tr.removeClass('row-active'); | |
| 228 | + | |
| 229 | + /* if($('#datatable_resource input.icheck:checked').length == 1) | |
| 230 | + $('#removeButton').removeAttr('disabled'); | |
| 231 | + else | |
| 232 | + $('#removeButton').attr('disabled', 'disabled'); */ | |
| 233 | + } | |
| 234 | + | |
| 235 | + function showPagination(data) { | |
| 236 | + //分页 | |
| 237 | + $('#pagination').jqPaginator({ | |
| 238 | + totalPages: data.totalPages, | |
| 239 | + visiblePages: 6, | |
| 240 | + currentPage: page + 1, | |
| 241 | + first: '<li class="first"><a href="javascript:void(0);">首页<\/a><\/li>', | |
| 242 | + prev: '<li class="prev"><a href="javascript:void(0);">上一页<\/a><\/li>', | |
| 243 | + next: '<li class="next"><a href="javascript:void(0);">下一页<\/a><\/li>', | |
| 244 | + last: '<li class="last"><a href="javascript:void(0);">尾页<\/a><\/li>', | |
| 245 | + page: '<li class="page"><a href="javascript:void(0);">{{page}}<\/a><\/li>', | |
| 246 | + onPageChange: function (num, type) { | |
| 247 | + if (initPagination) { | |
| 248 | + initPagination = false; | |
| 249 | + return; | |
| 250 | + } | |
| 251 | + | |
| 252 | + var params = getParams(); | |
| 253 | + | |
| 254 | + page = num - 1; | |
| 255 | + jsDoQuery(params, true); | |
| 256 | + } | |
| 257 | + }); | |
| 258 | + } | |
| 259 | + | |
| 260 | + | |
| 261 | + //删除 | |
| 262 | + $('#del').on('click', function () { | |
| 263 | + if ($(this).attr('disabled')) | |
| 264 | + return; | |
| 265 | + | |
| 266 | + var id = $('input.icheck:checked').data('id'); | |
| 267 | + removeConfirm('确定要删除选中的数据?', '/resource/' + id, function () { | |
| 268 | + $('tr.filter .filter-submit').click(); | |
| 269 | + }); | |
| 270 | + }); | |
| 271 | + | |
| 272 | + //搜索线路 | |
| 273 | + $.get('/basic/lineCode2Name',function(result){ | |
| 274 | + var data=[]; | |
| 275 | + | |
| 276 | + for(var code in result){ | |
| 277 | + data.push({id: code, text: result[code]}); | |
| 278 | + } | |
| 279 | + initPinYinSelect2('#xlbm',data,''); | |
| 280 | + | |
| 281 | + }); | |
| 282 | + | |
| 283 | + $('#nbbm').select2({ | |
| 284 | + placeholder: '搜索车辆...', | |
| 285 | + ajax: { | |
| 286 | + url: '/realSchedule/sreachVehic', | |
| 287 | + dataType: 'json', | |
| 288 | + delay: 150, | |
| 289 | + data: function (params) { | |
| 290 | + return {nbbm: params.term}; | |
| 291 | + }, | |
| 292 | + processResults: function (data) { | |
| 293 | + return { | |
| 294 | + results: data | |
| 295 | + }; | |
| 296 | + }, | |
| 297 | + cache: true | |
| 298 | + }, | |
| 299 | + templateResult: function (repo) { | |
| 300 | + if (repo.loading) return repo.text; | |
| 301 | + var h = '<span>' + repo.text + '</span>'; | |
| 302 | + h += (repo.lineName ? ' <span class="select2-desc">' + repo.lineName + '</span>' : ''); | |
| 303 | + return h; | |
| 304 | + }, | |
| 305 | + escapeMarkup: function (markup) { | |
| 306 | + return markup; | |
| 307 | + }, | |
| 308 | + minimumInputLength: 1, | |
| 309 | + templateSelection: function (repo) { | |
| 310 | + return repo.text; | |
| 311 | + }, | |
| 312 | + language: { | |
| 313 | + noResults: function () { | |
| 314 | + return '<span style="color:red;font-size: 12px;">没有搜索到车辆!</span>'; | |
| 315 | + }, | |
| 316 | + inputTooShort: function (e) { | |
| 317 | + return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入自编号搜索车辆</span>'; | |
| 318 | + }, | |
| 319 | + searching: function () { | |
| 320 | + return '<span style="color:gray;font-size: 12px;"> 正在搜索车辆...</span>'; | |
| 321 | + } | |
| 322 | + } | |
| 323 | + }) | |
| 324 | + | |
| 325 | + //导入 | |
| 326 | + $("#upload").on("click", function(){ | |
| 327 | + $.get('upload.html', function(m){$(pjaxContainer).append(m);}); | |
| 328 | + }); | |
| 329 | + | |
| 330 | + //导出 | |
| 331 | + $("#export").on("click", function () { | |
| 332 | + if ($("#rq").val() != "") { | |
| 333 | + var gsbm=$("#gsbm").val(); | |
| 334 | + var fgsbm=$("#fgsbm").val(); | |
| 335 | + if(gsbm=="" || gsbm==null || fgsbm=="" ||fgsbm==null){ | |
| 336 | + layer.msg('请选择公司和分公司.'); | |
| 337 | + return; | |
| 338 | + } | |
| 339 | + var params = getParams(); | |
| 340 | + | |
| 341 | + params["type"] = "export"; | |
| 342 | + $get('/jql/query', params, function (result) { | |
| 343 | + window.open("/downloadFile/download?fileName=车辆加氢量" + moment($("#rq").val()).format("YYYYMMDD")); | |
| 344 | + }); | |
| 345 | + } else { | |
| 346 | + layer.msg('请选择日期.'); | |
| 347 | + } | |
| 348 | + }); | |
| 349 | + | |
| 350 | + function getParams(){ | |
| 351 | + var gsbm=$("#gsbm").val(); | |
| 352 | + var fgsbm=$("#fgsbm").val(); | |
| 353 | + var cells = $('tr.filter')[0].cells | |
| 354 | + , params = {} | |
| 355 | + , name; | |
| 356 | + params["gsbm"] = gsbm; | |
| 357 | + params["fgsbm"] = fgsbm; | |
| 358 | + $.each(cells, function (i, cell) { | |
| 359 | + var items = $('input,select', cell); | |
| 360 | + for (var j = 0, item; item = items[j++];) { | |
| 361 | + name = $(item).attr('name'); | |
| 362 | + if (name) { | |
| 363 | + params[name] = $(item).val(); | |
| 364 | + } | |
| 365 | + } | |
| 366 | + }); | |
| 367 | + return params; | |
| 368 | + }; | |
| 369 | + | |
| 370 | + }); | |
| 371 | + | |
| 372 | +</script> | |
| 373 | + | |
| 374 | +<script id="jql_list" type="text/html"> | |
| 375 | + {{each list as obj i}} | |
| 376 | + <tr> | |
| 377 | + <td style="vertical-align: middle;"> | |
| 378 | + <!-- <input type="radio" name="id" class="group-checkable icheck" data-id="{{obj.id}}"> --> | |
| 379 | + {{i + 1}} | |
| 380 | + </td> | |
| 381 | + <td>{{obj.rq}}</td> | |
| 382 | + <td colspan="2">{{obj.nbbm}}</td> | |
| 383 | + | |
| 384 | + <td colspan="2">{{obj.jql}}</td> | |
| 385 | + <td colspan="2">{{obj.jqz}}</td> | |
| 386 | + <td>{{obj.remarks}}</td> | |
| 387 | + <!-- <td> | |
| 388 | + <button class="btn btn-info btn-sm"> | |
| 389 | + <i class="fa fa-search"></i> 修改 | |
| 390 | + </button> | |
| 391 | + <button class="btn btn-danger btn-sm"> | |
| 392 | + <i class="fa fa-trash-o"></i> 删除 | |
| 393 | + </button> | |
| 394 | + </td> --> | |
| 395 | + </tr> | |
| 396 | + {{/each}} | |
| 397 | + {{if list.length == 0}} | |
| 398 | + <tr> | |
| 399 | + <td colspan=9><h6 class="muted">没有找到相关数据</h6></td> | |
| 400 | + </tr> | |
| 401 | + {{/if}} | |
| 402 | +</script> | |
| 0 | 403 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/hydrogen/jql/upload.html
0 → 100644
| 1 | +<div class="modal fade" id="uploadFile" tabindex="-1" role="basic" | |
| 2 | + aria-hidden="true"> | |
| 3 | + <div class="modal-dialog"> | |
| 4 | + <div class="modal-content"> | |
| 5 | + <div class="modal-header"> | |
| 6 | + <button type="button" class="close" data-dismiss="modal" | |
| 7 | + aria-hidden="true"></button> | |
| 8 | + <h4 class="modal-title">导入Excel</h4> | |
| 9 | + </div> | |
| 10 | + <div class="modal-body"> | |
| 11 | + <form class="form-horizontal" role="form" id="excelFile" method="post" | |
| 12 | + action="" enctype="multipart/form-data"> | |
| 13 | + <input type="hidden" name="groupType" value="3"> | |
| 14 | + <div class="alert alert-danger display-hide"> | |
| 15 | + <button class="close" data-close="alert"></button> | |
| 16 | + 您的输入有误,请检查下面的输入项 | |
| 17 | + </div> | |
| 18 | + <div class="form-body"> | |
| 19 | + <div class="form-group"> | |
| 20 | + <label class="col-md-3 control-label">选择文件</label> | |
| 21 | + <div class="col-md-9"> | |
| 22 | + <input type="file" name="file" id="file" | |
| 23 | + accept="application/vnd.ms-excel"/> | |
| 24 | + <input type="hidden" name="gsbm_" id="gsbm_"> | |
| 25 | + <input type="hidden" name="gsName" id="gsName"> | |
| 26 | + <input type="hidden" name="fgsbm_" id="fgsbm_"> | |
| 27 | + <input type="hidden" name="fgsName" id="fgsName"> | |
| 28 | + </div> | |
| 29 | + </div> | |
| 30 | + </div> | |
| 31 | + </form> | |
| 32 | + </div> | |
| 33 | + <div class="modal-footer"> | |
| 34 | + <button type="button" class="btn default" id="downLoad">下载模板</button> | |
| 35 | + <button type="button" class="btn default" data-dismiss="modal">取消</button> | |
| 36 | + <button type="button" class="btn btn-primary" id="submit">确认导入</button> | |
| 37 | + </div> | |
| 38 | + </div> | |
| 39 | + </div> | |
| 40 | +</div> | |
| 41 | +<script id="res_tbody_temp" type="text/html"> | |
| 42 | + | |
| 43 | +</script> | |
| 44 | +<script data-exclude=1> | |
| 45 | + $(function() { | |
| 46 | + var form = $('#excelFile'); | |
| 47 | + var error = $('.alert-danger', form); | |
| 48 | + | |
| 49 | + $('#gsbm_').val($("#gsbm").val()); | |
| 50 | + $('#gsName').val($("#gsbm").find("option:selected").text()); | |
| 51 | + $('#fgsbm_').val($("#fgsbm").val()); | |
| 52 | + $('#fgsName').val($("#fgsbm").find("option:selected").text()); | |
| 53 | + | |
| 54 | + //modal 显示事件 | |
| 55 | + $('#uploadFile').on('show.bs.modal', function(){ | |
| 56 | + }) | |
| 57 | + .modal('show'); | |
| 58 | + | |
| 59 | + $('#submit').on('click', function() { | |
| 60 | + var j = layer.load(2); | |
| 61 | + var param = {}; | |
| 62 | + param.uploadDir = 'upload'; | |
| 63 | + param["gsbm_"] = $('#gsbm_').val(); | |
| 64 | + param["gsName"] = $('#gsName').val(); | |
| 65 | + param["fgsbm_"] = $('#fgsbm_').val(); | |
| 66 | + param["fgsName"] = $('#fgsName').val(); | |
| 67 | + $.ajaxFileUpload({ | |
| 68 | + url : '/jql/uploadFile', | |
| 69 | + secureuri : false, | |
| 70 | + fileElementId : 'file', | |
| 71 | + dataType : 'json', | |
| 72 | + data : param, | |
| 73 | + success : function(data) { | |
| 74 | + layer.close(j); | |
| 75 | + alert(data.result); | |
| 76 | +// alert("文件导入成功"); | |
| 77 | + $('#uploadFile').modal('hide'); | |
| 78 | + $('tr.filter .filter-submit').click(); | |
| 79 | + }, | |
| 80 | + error : function(data, status, e) { | |
| 81 | + layer.close(j); | |
| 82 | + alert("文件导入失败"); | |
| 83 | + } | |
| 84 | + }) | |
| 85 | + }); | |
| 86 | + | |
| 87 | + $('#downLoad').on('click', function(){ | |
| 88 | + window.open("/downloadFile/downloadModel?fileName=import_Jql"); | |
| 89 | + }); | |
| 90 | + | |
| 91 | + function getCurrSelNode(){ | |
| 92 | + return $.jstree.reference("#modules_tree").get_selected(true); | |
| 93 | + } | |
| 94 | + }); | |
| 95 | +</script> | |
| 0 | 96 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/hydrogen/list/add.html
0 → 100644
| 1 | +<div class="page-head"> | |
| 2 | + <div class="page-title"> | |
| 3 | + <h1>进出站氢量量信息编辑</h1> | |
| 4 | + </div> | |
| 5 | +</div> | |
| 6 | + | |
| 7 | +<ul class="page-breadcrumb breadcrumb"> | |
| 8 | + <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li> | |
| 9 | + <li><span class="active">用氢管理</span> <i class="fa fa-circle"></i></li> | |
| 10 | + <li><a href="list.html" data-pjax>进出场氢量</a> <i class="fa fa-circle"></i></li> | |
| 11 | + <li><span class="active">进出站氢量信息编辑</span></li> | |
| 12 | +</ul> | |
| 13 | + | |
| 14 | +<div class="portlet light bordered"> | |
| 15 | + <div class="portlet-title"> | |
| 16 | + <div class="caption"> | |
| 17 | + <i class="icon-equalizer font-red-sunglo"></i> <span | |
| 18 | + class="caption-subject font-red-sunglo bold uppercase">表单</span> | |
| 19 | + </div> | |
| 20 | + </div> | |
| 21 | + <div class="portlet-body form"> | |
| 22 | + <form class="form-horizontal" id="qlb_add_form" > | |
| 23 | + | |
| 24 | + <div class="alert alert-danger display-hide"> | |
| 25 | + <button class="close" data-close="alert"></button> | |
| 26 | + 您的输入有误,请检查下面的输入项 | |
| 27 | + </div> | |
| 28 | + <input type="hidden" value="0" name="yhlx" /> | |
| 29 | + <div class="form-body"> | |
| 30 | + <div class="form-group"> | |
| 31 | + <label class="col-md-3 control-label">公司</label> | |
| 32 | + <div class="col-md-4"> | |
| 33 | + <select class="form-control" name="ssgsdm" id="ssgsdm" ></select> | |
| 34 | + </div> | |
| 35 | + </div> | |
| 36 | + <div class="form-group"> | |
| 37 | + <label class="col-md-3 control-label">分公司</label> | |
| 38 | + <div class="col-md-4"> | |
| 39 | + <select class="form-control" name="fgsdm" id="fgsdm" ></select> | |
| 40 | + </div> | |
| 41 | + </div> | |
| 42 | + <div class="form-group"> | |
| 43 | + <label class="col-md-3 control-label">线路</label> | |
| 44 | + <div class="col-md-4"> | |
| 45 | + <select class="form-control" name="xlbm" id="xlbm" ></select> | |
| 46 | + </div> | |
| 47 | + </div> | |
| 48 | + <div class="form-group"> | |
| 49 | + <label class="col-md-3 control-label">内部编码</label> | |
| 50 | + <div class="col-md-4"> | |
| 51 | + <select class="form-control" name="nbbm" id="nbbm" ></select> | |
| 52 | + </div> | |
| 53 | + </div> | |
| 54 | + <div class="form-group"> | |
| 55 | + <label class="col-md-3 control-label">日期</label> | |
| 56 | + <div class="col-md-4"> | |
| 57 | + <input type="text" class="form-control" name="rq" id="date"> | |
| 58 | + <label>跨天营运</label> | |
| 59 | + <select id="sfkt" name="sfkt"> | |
| 60 | + <option value="0">否</option> | |
| 61 | + <option value="1">是</option> | |
| 62 | + </select> | |
| 63 | + </div> | |
| 64 | + </div> | |
| 65 | + <div class="form-group"> | |
| 66 | + <label class="col-md-3 control-label">开始营运时间</label> | |
| 67 | + <div class="col-md-4"> | |
| 68 | + <input type="time" class="form-control" name="jhsj" > | |
| 69 | + <span class="help-block"> 如:12:12</span> | |
| 70 | + </div> | |
| 71 | + </div> | |
| 72 | + <div class="form-group"> | |
| 73 | + <label class="col-md-3 control-label">驾驶员</label> | |
| 74 | + <div class="col-md-4"> | |
| 75 | + <select class="form-control" name="jsy" id="jsy"> </select> | |
| 76 | + </div> | |
| 77 | + </div> | |
| 78 | + | |
| 79 | + <div class="form-group"> | |
| 80 | + <label class="col-md-3 control-label">出场里程</label> | |
| 81 | + <div class="col-md-4"> | |
| 82 | + <input type="text" value="0" class="form-control" name="czlc" onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')" | |
| 83 | + onafterpaste="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')"> | |
| 84 | + </div> | |
| 85 | + </div> | |
| 86 | + | |
| 87 | + <div class="form-group"> | |
| 88 | + <label class="col-md-3 control-label">出场氢量</label> | |
| 89 | + <div class="col-md-4"> | |
| 90 | + <input type="text" value="100" class="form-control" name="czcl" onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')" | |
| 91 | + onafterpaste="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')"> | |
| 92 | + </div> | |
| 93 | + </div> | |
| 94 | + | |
| 95 | + <div class="form-group"> | |
| 96 | + <label class="col-md-3 control-label">充氢量</label> | |
| 97 | + <div class="col-md-4"> | |
| 98 | + <input type="text" value="0" class="form-control" name="jql" onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')" | |
| 99 | + onafterpaste="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')"> | |
| 100 | + </div> | |
| 101 | + </div> | |
| 102 | + | |
| 103 | + <div class="form-group"> | |
| 104 | + <label class="col-md-3 control-label">进场氢量</label> | |
| 105 | + <div class="col-md-4"> | |
| 106 | + <input type="text" value="100" class="form-control" name="jzcl" onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')" | |
| 107 | + onafterpaste="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')"> | |
| 108 | + </div> | |
| 109 | + </div> | |
| 110 | + | |
| 111 | + <div class="form-group"> | |
| 112 | + <label class="col-md-3 control-label">耗氢量</label> | |
| 113 | + <div class="col-md-4"> | |
| 114 | + <input type="text" value="0" class="form-control" name="hn" onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')" | |
| 115 | + onafterpaste="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')"> | |
| 116 | + </div> | |
| 117 | + </div> | |
| 118 | + | |
| 119 | + <div class="form-group"> | |
| 120 | + <label class="col-md-3 control-label">尿素</label> | |
| 121 | + <div class="col-md-4"> | |
| 122 | + <input type="text" value="0" class="form-control" name="ns" onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')" | |
| 123 | + onafterpaste="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')"> | |
| 124 | + </div> | |
| 125 | + </div> | |
| 126 | + | |
| 127 | + <div class="form-group"> | |
| 128 | + <label class="col-md-3 control-label">进场里程</label> | |
| 129 | + <div class="col-md-4"> | |
| 130 | + <input type="text" value="0" class="form-control" name="jzlc" onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')" | |
| 131 | + onafterpaste="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')"> | |
| 132 | + </div> | |
| 133 | + </div> | |
| 134 | + <div class="form-group"> | |
| 135 | + <label class="col-md-3 control-label">损耗原因</label> | |
| 136 | + <div class="col-md-4"> | |
| 137 | + <select class="form-control" name="shyy"> | |
| 138 | + <option value='0'>请选择</option> | |
| 139 | + <option value='1'>票务用</option> | |
| 140 | + <option value='2'>保养用</option> | |
| 141 | + <option value='3'>报废车用</option> | |
| 142 | + <option value='4'>其它用</option> | |
| 143 | + <option value='5'>人保部</option> | |
| 144 | + <option value='6'>车队</option> | |
| 145 | + <option value='7'>车间(高保)</option> | |
| 146 | + <option value='8'>车间(小修)</option> | |
| 147 | + </select> | |
| 148 | + </div> | |
| 149 | + </div> | |
| 150 | + <div class="form-group"> | |
| 151 | + <label class="col-md-3 control-label">损耗氢量</label> | |
| 152 | + <div class="col-md-4"> | |
| 153 | + <input type="text" value="0" class="form-control" name="sh" onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')" | |
| 154 | + onafterpaste="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')"> | |
| 155 | + </div> | |
| 156 | + </div> | |
| 157 | + <div class="form-group"> | |
| 158 | + <label class="col-md-3 control-label">行驶总里程</label> | |
| 159 | + <div class="col-md-4"> | |
| 160 | + <input type="text" value="0" class="form-control" name="zlc" onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')" | |
| 161 | + onafterpaste="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')"> | |
| 162 | + </div> | |
| 163 | + </div> | |
| 164 | + | |
| 165 | + | |
| 166 | + </div> | |
| 167 | + <div class="form-actions"> | |
| 168 | + <div class="row"> | |
| 169 | + <div class="col-md-offset-3 col-md-4"> | |
| 170 | + <button type="submit" class="btn green" ><i class="fa fa-check"></i> 提交</button> | |
| 171 | + <a type="button" class="btn default" href="list.html" data-pjax><i class="fa fa-times"></i> 取消</a> | |
| 172 | + </div> | |
| 173 | + </div> | |
| 174 | + </div> | |
| 175 | + </form> | |
| 176 | + <!-- END FORM--> | |
| 177 | + </div> | |
| 178 | +</div> | |
| 179 | +<script> | |
| 180 | +(function(){ | |
| 181 | + var fage=false; | |
| 182 | + var obj = []; | |
| 183 | + var xlList; | |
| 184 | + $.get('/report/lineList',function(result){ | |
| 185 | + xlList=result; | |
| 186 | + $.get('/user/companyData', function(result){ | |
| 187 | + obj = result; | |
| 188 | + var options = ''; | |
| 189 | + for(var i = 0; i < obj.length; i++){ | |
| 190 | + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>'; | |
| 191 | + } | |
| 192 | + $('#ssgsdm').html(options); | |
| 193 | + | |
| 194 | + updateCompany(); | |
| 195 | + }); | |
| 196 | + }); | |
| 197 | + | |
| 198 | + $("#ssgsdm").on("change",updateCompany); | |
| 199 | + function updateCompany(){ | |
| 200 | + var company = $('#ssgsdm').val(); | |
| 201 | + var options = ''; | |
| 202 | + for(var i = 0; i < obj.length; i++){ | |
| 203 | + if(obj[i].companyCode == company){ | |
| 204 | + var children = obj[i].children; | |
| 205 | + for(var j = 0; j < children.length; j++){ | |
| 206 | + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>'; | |
| 207 | + } | |
| 208 | + } | |
| 209 | + } | |
| 210 | + $('#fgsdm').html(options); | |
| 211 | + initXl(); | |
| 212 | + selectNbbm(); | |
| 213 | + selectJsy(); | |
| 214 | + } | |
| 215 | + $("#fgsdm").on("change",initXl); | |
| 216 | + function initXl(){ | |
| 217 | + var data=[]; | |
| 218 | + if(fage){ | |
| 219 | + $("#xlbm").select2("destroy").html(''); | |
| 220 | + } | |
| 221 | + var fgs=$('#fgsdm').val(); | |
| 222 | + var gs=$('#ssgsdm').val(); | |
| 223 | + for(var i=0;i<xlList.length;i++){ | |
| 224 | + if(gs!=""){ | |
| 225 | + if(fgs!=""){ | |
| 226 | + if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){ | |
| 227 | + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]}); | |
| 228 | + } | |
| 229 | + }else{ | |
| 230 | + if(xlList[i]["gsbm"]==gs){ | |
| 231 | + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]}); | |
| 232 | + } | |
| 233 | + } | |
| 234 | + } | |
| 235 | + } | |
| 236 | + initPinYinSelect2('#xlbm',data,''); | |
| 237 | + fage=true; | |
| 238 | + selectNbbm(); | |
| 239 | + selectJsy(); | |
| 240 | + } | |
| 241 | + $("#date").datetimepicker({ | |
| 242 | + format : 'YYYY-MM-DD', | |
| 243 | + locale : 'zh-cn' | |
| 244 | + }); | |
| 245 | + | |
| 246 | + function selectNbbm(){ | |
| 247 | + $('#nbbm').select2({ | |
| 248 | + placeholder: '搜索车辆...', | |
| 249 | + ajax: { | |
| 250 | + url: '/report/carList', | |
| 251 | + dataType: 'json', | |
| 252 | + delay: 150, | |
| 253 | + data: function(params){ | |
| 254 | + return{nbbm: params.term, | |
| 255 | + gsbm:$('#ssgsdm').val(), | |
| 256 | + fgsbm:$('#fgsdm').val(), | |
| 257 | + xlbm:"" | |
| 258 | + }; | |
| 259 | + }, | |
| 260 | + processResults: function (data) { | |
| 261 | + return { | |
| 262 | + results: data | |
| 263 | + }; | |
| 264 | + }, | |
| 265 | + cache: true | |
| 266 | + }, | |
| 267 | + templateResult: function(repo){ | |
| 268 | + if (repo.loading) return repo.text; | |
| 269 | + var h = '<span>'+repo.text+'</span>'; | |
| 270 | + h += (repo.lineName?' <span class="select2-desc">'+repo.lineName+'</span>':''); | |
| 271 | + return h; | |
| 272 | + }, | |
| 273 | + escapeMarkup: function (markup) { return markup; }, | |
| 274 | + minimumInputLength: 1, | |
| 275 | + templateSelection: function(repo){ | |
| 276 | + return repo.text; | |
| 277 | + }, | |
| 278 | + language: { | |
| 279 | + noResults: function(){ | |
| 280 | + return '<span style="color:red;font-size: 12px;">没有搜索到车辆!</span>'; | |
| 281 | + }, | |
| 282 | + inputTooShort : function(e) { | |
| 283 | + return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入自编号搜索车辆</span>'; | |
| 284 | + }, | |
| 285 | + searching : function() { | |
| 286 | + return '<span style="color:gray;font-size: 12px;"> 正在搜索车辆...</span>'; | |
| 287 | + } | |
| 288 | + } | |
| 289 | + }) | |
| 290 | + } | |
| 291 | + | |
| 292 | + | |
| 293 | + function selectJsy(){ | |
| 294 | + $('#jsy').select2({ | |
| 295 | + placeholder: '搜索驾驶员...', | |
| 296 | + ajax: { | |
| 297 | + url: '/report/userList', | |
| 298 | + dataType: 'json', | |
| 299 | + delay: 150, | |
| 300 | + data: function(params){ | |
| 301 | + return{jsy: params.term,gsbm:$('#ssgsdm').val()}; | |
| 302 | + }, | |
| 303 | + processResults: function (data) { | |
| 304 | + return { | |
| 305 | + results: data | |
| 306 | + }; | |
| 307 | + }, | |
| 308 | + cache: true | |
| 309 | + }, | |
| 310 | + templateResult: function(repo){ | |
| 311 | + if (repo.loading) return repo.text; | |
| 312 | + var h = '<span>'+repo.text+'</span>'; | |
| 313 | + return h; | |
| 314 | + }, | |
| 315 | + escapeMarkup: function (markup) { return markup; }, | |
| 316 | + minimumInputLength: 1, | |
| 317 | + templateSelection: function(repo){ | |
| 318 | + return repo.text; | |
| 319 | + }, | |
| 320 | + language: { | |
| 321 | + noResults: function(){ | |
| 322 | + return '<span style="color:red;font-size: 12px;">没有搜索到驾驶员!</span>'; | |
| 323 | + }, | |
| 324 | + inputTooShort : function(e) { | |
| 325 | + return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入工号搜索驾驶员</span>'; | |
| 326 | + }, | |
| 327 | + searching : function() { | |
| 328 | + return '<span style="color:gray;font-size: 12px;"> 正在搜索驾驶员...</span>'; | |
| 329 | + } | |
| 330 | + } | |
| 331 | + }); | |
| 332 | + } | |
| 333 | + $(function(){ | |
| 334 | + /* $get('/role/all',null,function(result){ | |
| 335 | + $.each(result,function(i,obj){ | |
| 336 | + $("#role").append("<option value='"+obj.id+"'>"+obj.roleName+"</option>"); | |
| 337 | + }); | |
| 338 | + }); */ | |
| 339 | + | |
| 340 | + var form = $('#qlb_add_form'); | |
| 341 | + var error = $('.alert-danger', form); | |
| 342 | + | |
| 343 | + //表单 validate | |
| 344 | + form.validate({ | |
| 345 | + errorElement : 'span', | |
| 346 | + errorClass : 'help-block help-block-error', | |
| 347 | + focusInvalid : false, | |
| 348 | + rules : { | |
| 349 | + 'xlbm' : { | |
| 350 | + required : true, | |
| 351 | + maxlength: 25 | |
| 352 | + }, | |
| 353 | + 'nbbm' : { | |
| 354 | + required : true, | |
| 355 | + maxlength: 25 | |
| 356 | + }, | |
| 357 | + 'rq' : { | |
| 358 | + required : true, | |
| 359 | + maxlength: 25 | |
| 360 | + }, | |
| 361 | + 'jsy' : { | |
| 362 | + required : true, | |
| 363 | + maxlength: 20 | |
| 364 | + } | |
| 365 | + }, | |
| 366 | + invalidHandler : function(event, validator) { | |
| 367 | + error.show(); | |
| 368 | + App.scrollTo(error, -200); | |
| 369 | + }, | |
| 370 | + | |
| 371 | + highlight : function(element) { | |
| 372 | + $(element).closest('.form-group').addClass('has-error'); | |
| 373 | + }, | |
| 374 | + | |
| 375 | + unhighlight : function(element) { | |
| 376 | + $(element).closest('.form-group').removeClass('has-error'); | |
| 377 | + }, | |
| 378 | + | |
| 379 | + success : function(label) { | |
| 380 | + label.closest('.form-group').removeClass('has-error'); | |
| 381 | + }, | |
| 382 | + | |
| 383 | + submitHandler : function(f) { | |
| 384 | + var params = form.serializeJSON(); | |
| 385 | + error.hide(); | |
| 386 | + var nbbm=$("#nbbm").val(); | |
| 387 | + var date=$("#date").val(); | |
| 388 | + var jsy=$("#jsy").val(); | |
| 389 | + var xlbm=$("#xlbm").val(); | |
| 390 | + var gsdm=$("#ssgsdm").val(); | |
| 391 | + var map={}; | |
| 392 | + map["nbbm"]=nbbm; | |
| 393 | + map["date"]=date; | |
| 394 | + map["jsy"]=jsy; | |
| 395 | + map["xlbm"]=xlbm; | |
| 396 | + map["rq"]=date; | |
| 397 | + map["ssgsdm_like"]=gsdm; | |
| 398 | + //检查一下用户是否存在 | |
| 399 | + var i = layer.load(2); | |
| 400 | + $get('/ylb/checkDate', map, function(fage){ | |
| 401 | + if(fage=="2"){ | |
| 402 | + layer.msg('只能操作三天内数据.'); | |
| 403 | + layer.close(i); | |
| 404 | + }else{ | |
| 405 | + $get('/qlb/checkJsy', map, function(fage){ | |
| 406 | + if(fage=="0"){ | |
| 407 | + layer.msg('该驾驶员当天已存在.'); | |
| 408 | + layer.close(i); | |
| 409 | + }else{ | |
| 410 | + $post('/qlb/saveQlb', params, function(){ | |
| 411 | + layer.close(i); | |
| 412 | + layer.msg('添加信息成功.'); | |
| 413 | + loadPage('list.html'); | |
| 414 | + }); | |
| 415 | + } | |
| 416 | + }); | |
| 417 | + } | |
| 418 | + }) | |
| 419 | + } | |
| 420 | + }); | |
| 421 | + }); | |
| 422 | +})(); | |
| 423 | +</script> | |
| 0 | 424 | \ No newline at end of file | ... | ... |