Commit 5681d0891e69d614e747d4fa44eb828b814b182e
Merge branch 'minhang' of http://222.66.0.204:8090//panzhaov5/bsth_control into minhang
Showing
45 changed files
with
1923 additions
and
523 deletions
src/main/java/com/bsth/controller/oil/CdlController.java
0 → 100644
| 1 | +package com.bsth.controller.oil; | |
| 2 | + | |
| 3 | +import java.util.Date; | |
| 4 | +import java.util.Map; | |
| 5 | + | |
| 6 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 7 | +import org.springframework.web.bind.annotation.RequestMapping; | |
| 8 | +import org.springframework.web.bind.annotation.RequestMethod; | |
| 9 | +import org.springframework.web.bind.annotation.RestController; | |
| 10 | + | |
| 11 | +import com.bsth.controller.BaseController; | |
| 12 | +import com.bsth.entity.oil.Cdl; | |
| 13 | +import com.bsth.service.oil.CdlService; | |
| 14 | + | |
| 15 | +@RestController | |
| 16 | +@RequestMapping("cdl") | |
| 17 | +public class CdlController extends BaseController<Cdl, Integer>{ | |
| 18 | + @Autowired | |
| 19 | + CdlService service; | |
| 20 | + @RequestMapping(value = "/save",method = RequestMethod.POST) | |
| 21 | + public Map<String, Object> saveCdl(Cdl t){ | |
| 22 | +// SysUser user = SecurityUtils.getCurrentUser(); | |
| 23 | + t.setUpdatetime(new Date()); | |
| 24 | + /*SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); | |
| 25 | + try { | |
| 26 | + t.setUpdatetime(sdf.parse("2016-10-13")); | |
| 27 | + } catch (ParseException e) { | |
| 28 | + // TODO Auto-generated catch block | |
| 29 | + e.printStackTrace(); | |
| 30 | + }*/ | |
| 31 | + return service.save(t); | |
| 32 | + } | |
| 33 | +} | ... | ... |
src/main/java/com/bsth/controller/oil/DlbController.java
| 1 | 1 | package com.bsth.controller.oil; |
| 2 | 2 | |
| 3 | +import java.util.List; | |
| 4 | +import java.util.Map; | |
| 5 | + | |
| 6 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 7 | +import org.springframework.data.domain.Page; | |
| 8 | +import org.springframework.data.domain.PageRequest; | |
| 9 | +import org.springframework.data.domain.Sort; | |
| 10 | +import org.springframework.data.domain.Sort.Direction; | |
| 3 | 11 | import org.springframework.web.bind.annotation.RequestMapping; |
| 12 | +import org.springframework.web.bind.annotation.RequestMethod; | |
| 13 | +import org.springframework.web.bind.annotation.RequestParam; | |
| 4 | 14 | import org.springframework.web.bind.annotation.RestController; |
| 5 | 15 | import com.bsth.controller.BaseController; |
| 6 | 16 | import com.bsth.entity.oil.Dlb; |
| 17 | +import com.bsth.entity.oil.Ylb; | |
| 18 | +import com.bsth.service.oil.DlbService; | |
| 19 | +import com.google.common.base.Splitter; | |
| 7 | 20 | |
| 8 | 21 | @RestController |
| 9 | 22 | @RequestMapping("dlb") |
| 10 | 23 | public class DlbController extends BaseController<Dlb, Integer>{ |
| 24 | + @Autowired | |
| 25 | + DlbService service; | |
| 26 | + /** | |
| 27 | + * | |
| 28 | + * @Title: list | |
| 29 | + * @Description: TODO(多条件分页查询) | |
| 30 | + * @param @param map 查询条件 | |
| 31 | + * @param @param page 页码 | |
| 32 | + * @param @param size 每页显示数量 | |
| 33 | + * @throws | |
| 34 | + */ | |
| 35 | + @RequestMapping(method = RequestMethod.GET) | |
| 36 | + public Page<Dlb> list(@RequestParam Map<String, Object> map, | |
| 37 | + @RequestParam(defaultValue = "0") int page, | |
| 38 | + @RequestParam(defaultValue = "10") int size, | |
| 39 | + @RequestParam(defaultValue = "id") String order, | |
| 40 | + @RequestParam(defaultValue = "DESC") String direction){ | |
| 41 | + | |
| 42 | + Direction d; | |
| 43 | +// map.put("xlbm_like", map.get("xlbm_like").toString().trim()); | |
| 44 | +// try { | |
| 45 | + String rq=map.get("rq").toString(); | |
| 46 | + if(!(rq=="")){ | |
| 47 | +// | |
| 48 | +// SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); | |
| 49 | +// Calendar calendar = new GregorianCalendar(); | |
| 50 | +// calendar.setTime(sdf.parse(rq)); | |
| 51 | +// calendar.add(calendar.DATE,1); | |
| 52 | +// Date date=calendar.getTime(); | |
| 53 | + map.put("rq_eq", rq); | |
| 54 | +// map.put("rq_lt", sdf.format(date)); | |
| 55 | +// System.out.println(rq); | |
| 56 | +// System.out.println(sdf.format(date)); | |
| 57 | + } | |
| 58 | +// } catch (ParseException e) { | |
| 59 | +// // TODO Auto-generated catch block | |
| 60 | +// e.printStackTrace(); | |
| 61 | +// } | |
| 62 | + if(null != direction && direction.equals("ASC")) | |
| 63 | + d = Direction.ASC; | |
| 64 | + else | |
| 65 | + d = Direction.DESC; | |
| 66 | + | |
| 67 | + // 允许多个字段排序,order可以写单个字段,也可以写多个字段 | |
| 68 | + // 多个字段格式:{col1},{col2},{col3},....,{coln} | |
| 69 | + // 每个字段的排序方向都是一致,这个以后再看要不要改 | |
| 70 | + List<String> list = Splitter.on(",").trimResults().splitToList(order); | |
| 71 | + return baseService.list(map, new PageRequest(page, size, new Sort(d, list))); | |
| 72 | + } | |
| 73 | + | |
| 74 | + @RequestMapping(value = "/obtain",method = RequestMethod.GET) | |
| 75 | + public Map<String, Object> obtain(@RequestParam Map<String, Object> map){ | |
| 76 | + Map<String, Object> list=service.obtain(map); | |
| 77 | + System.out.println(); | |
| 78 | + return list; | |
| 79 | + } | |
| 80 | + | |
| 81 | + /** | |
| 82 | + * 保存电量 | |
| 83 | + * @param map | |
| 84 | + * @return | |
| 85 | + */ | |
| 86 | + @RequestMapping(value = "/sort",method = RequestMethod.GET) | |
| 87 | + public Map<String, Object> sort(@RequestParam Map<String, Object> map){ | |
| 88 | + Map<String, Object> list=service.sort(map); | |
| 89 | + return list; | |
| 90 | + } | |
| 11 | 91 | |
| 92 | + /** | |
| 93 | + * 核对电量(有加电没里程) | |
| 94 | + * @param map | |
| 95 | + * @return | |
| 96 | + */ | |
| 97 | + @RequestMapping(value = "/checkDl",method = RequestMethod.GET) | |
| 98 | + public Map<String, Object> checkDl(@RequestParam Map<String, Object> map){ | |
| 99 | + Map<String, Object> list=service.checkDl(map); | |
| 100 | + return list; | |
| 101 | + } | |
| 12 | 102 | } | ... | ... |
src/main/java/com/bsth/controller/oil/YlbController.java
| ... | ... | @@ -50,8 +50,14 @@ public class YlbController extends BaseController<Ylb, Integer>{ |
| 50 | 50 | * @return |
| 51 | 51 | */ |
| 52 | 52 | @RequestMapping(value = "/obtain",method = RequestMethod.GET) |
| 53 | - public Map<String, Object> obtain(@RequestParam Map<String, Object> map){ | |
| 54 | - Map<String, Object> list=yblService.obtain(map); | |
| 53 | + public Map<String, Object> obtain(@RequestParam Map<String, Object> map) throws Exception{ | |
| 54 | + Map<String, Object> list =new HashMap<String, Object>(); | |
| 55 | + try { | |
| 56 | + list = yblService.obtain(map); | |
| 57 | + } catch (Exception e) { | |
| 58 | + // TODO Auto-generated catch block | |
| 59 | + throw e; | |
| 60 | + } | |
| 55 | 61 | System.out.println(); |
| 56 | 62 | return list; |
| 57 | 63 | } |
| ... | ... | @@ -73,8 +79,14 @@ public class YlbController extends BaseController<Ylb, Integer>{ |
| 73 | 79 | * @return |
| 74 | 80 | */ |
| 75 | 81 | @RequestMapping(value = "/outAndIn",method = RequestMethod.GET) |
| 76 | - public Map<String, Object> outAndIn(@RequestParam Map<String, Object> map){ | |
| 77 | - Map<String, Object> list=yblService.outAndIn(map); | |
| 82 | + public Map<String, Object> outAndIn(@RequestParam Map<String, Object> map) throws Exception{ | |
| 83 | + Map<String, Object> list=new HashMap<String, Object>(); | |
| 84 | + try { | |
| 85 | + list=yblService.outAndIn(map); | |
| 86 | + } catch (Exception e) { | |
| 87 | + // TODO: handle exception | |
| 88 | + } | |
| 89 | + | |
| 78 | 90 | return list; |
| 79 | 91 | } |
| 80 | 92 | ... | ... |
src/main/java/com/bsth/controller/realcontrol/PageForwardingController.java
| 1 | 1 | package com.bsth.controller.realcontrol; |
| 2 | 2 | |
| 3 | +import com.bsth.entity.sys.Role; | |
| 3 | 4 | import com.bsth.entity.sys.SysUser; |
| 4 | 5 | import com.bsth.security.util.SecurityUtils; |
| 6 | +import org.slf4j.Logger; | |
| 7 | +import org.slf4j.LoggerFactory; | |
| 5 | 8 | import org.springframework.stereotype.Controller; |
| 6 | 9 | import org.springframework.web.bind.annotation.RequestMapping; |
| 7 | 10 | import org.springframework.web.servlet.ModelAndView; |
| 8 | 11 | |
| 12 | +import javax.servlet.http.HttpServletResponse; | |
| 13 | + | |
| 9 | 14 | /** |
| 10 | 15 | * 线调登入页面转发 |
| 11 | 16 | * Created by panzhao on 2017/1/21. |
| ... | ... | @@ -14,18 +19,36 @@ import org.springframework.web.servlet.ModelAndView; |
| 14 | 19 | @RequestMapping("real_control") |
| 15 | 20 | public class PageForwardingController { |
| 16 | 21 | |
| 22 | + Logger logger = LoggerFactory.getLogger(this.getClass()); | |
| 23 | + | |
| 17 | 24 | @RequestMapping("/v2") |
| 18 | - public ModelAndView v2(){ | |
| 25 | + public ModelAndView v2(HttpServletResponse response){ | |
| 19 | 26 | ModelAndView mv = new ModelAndView(); |
| 20 | 27 | SysUser user = SecurityUtils.getCurrentUser(); |
| 21 | 28 | |
| 22 | 29 | //班次管理员 |
| 23 | 30 | if(user.getUserName().equals("bcgly")){ |
| 24 | 31 | mv.setViewName("/real_control_v2/sch_manage/sch_imitate.html"); |
| 32 | + return mv; | |
| 25 | 33 | } |
| 34 | + | |
| 35 | + try{ | |
| 36 | + //闵行运管所,直接打开地图页面 | |
| 37 | + if(user.getRoles().size() == 1){ | |
| 38 | + for(Role role : user.getRoles()){ | |
| 39 | + if(role.getCodeName().equals("MH_YGS")){ | |
| 40 | + // 直接重定向 | |
| 41 | + response.sendRedirect("/pages/mapmonitor/alone/wrap.html"); | |
| 42 | + return null; | |
| 43 | + } | |
| 44 | + } | |
| 45 | + } | |
| 46 | + }catch (Exception e){ | |
| 47 | + logger.error("", e); | |
| 48 | + } | |
| 49 | + | |
| 26 | 50 | //正常线调主页 |
| 27 | - else | |
| 28 | - mv.setViewName("/real_control_v2/main.html"); | |
| 51 | + mv.setViewName("/real_control_v2/main.html"); | |
| 29 | 52 | return mv; |
| 30 | 53 | } |
| 31 | 54 | } | ... | ... |
src/main/java/com/bsth/data/schedule/DayOfSchedule.java
src/main/java/com/bsth/entity/oil/Cdl.java
0 → 100644
| 1 | +package com.bsth.entity.oil; | |
| 2 | + | |
| 3 | +import java.util.Date; | |
| 4 | + | |
| 5 | +import javax.persistence.Entity; | |
| 6 | +import javax.persistence.GeneratedValue; | |
| 7 | +import javax.persistence.Id; | |
| 8 | +import javax.persistence.Table; | |
| 9 | +import javax.persistence.Transient; | |
| 10 | + | |
| 11 | +import com.bsth.data.BasicData; | |
| 12 | + | |
| 13 | +@Entity | |
| 14 | +@Table(name = "bsth_c_cdl") | |
| 15 | +public class Cdl { | |
| 16 | + @Id | |
| 17 | + @GeneratedValue | |
| 18 | + private Integer id; | |
| 19 | + | |
| 20 | + private String nbbm; | |
| 21 | + | |
| 22 | + //存电量 | |
| 23 | + private Double cdl; | |
| 24 | + | |
| 25 | + private Date updatetime; | |
| 26 | + | |
| 27 | + //恒定存电 | |
| 28 | + private Double clcd; | |
| 29 | + //公司代码 | |
| 30 | + private String gsdm; | |
| 31 | + | |
| 32 | + @Transient | |
| 33 | + private String gsname; | |
| 34 | + | |
| 35 | + @Transient | |
| 36 | + private String fgsname; | |
| 37 | + | |
| 38 | + //分公司代码 | |
| 39 | + private String fgsdm; | |
| 40 | + | |
| 41 | + public Integer getId() { | |
| 42 | + return id; | |
| 43 | + } | |
| 44 | + | |
| 45 | + public void setId(Integer id) { | |
| 46 | + this.id = id; | |
| 47 | + } | |
| 48 | + | |
| 49 | + public String getNbbm() { | |
| 50 | + return nbbm; | |
| 51 | + } | |
| 52 | + | |
| 53 | + public void setNbbm(String nbbm) { | |
| 54 | + this.nbbm = nbbm; | |
| 55 | + } | |
| 56 | + | |
| 57 | + | |
| 58 | + public Double getCdl() { | |
| 59 | + return cdl; | |
| 60 | + } | |
| 61 | + | |
| 62 | + public void setCdl(Double cdl) { | |
| 63 | + this.cdl = cdl; | |
| 64 | + } | |
| 65 | + | |
| 66 | + public Double getClcd() { | |
| 67 | + return clcd; | |
| 68 | + } | |
| 69 | + | |
| 70 | + public void setClcd(Double clcd) { | |
| 71 | + this.clcd = clcd; | |
| 72 | + } | |
| 73 | + | |
| 74 | + public Date getUpdatetime() { | |
| 75 | + return updatetime; | |
| 76 | + } | |
| 77 | + | |
| 78 | + public void setUpdatetime(Date updatetime) { | |
| 79 | + this.updatetime = updatetime; | |
| 80 | + } | |
| 81 | + | |
| 82 | + | |
| 83 | + public String getGsdm(){ | |
| 84 | + return gsdm; | |
| 85 | + } | |
| 86 | + | |
| 87 | + public void setGsdm(String gsdm){ | |
| 88 | + this.gsdm=gsdm; | |
| 89 | + } | |
| 90 | + | |
| 91 | + public String getFgsdm() { | |
| 92 | + return fgsdm; | |
| 93 | + } | |
| 94 | + | |
| 95 | + public void setFgsdm(String fgsdm) { | |
| 96 | + this.fgsdm = fgsdm; | |
| 97 | + } | |
| 98 | + | |
| 99 | + public String getGsname() { | |
| 100 | + return BasicData.businessCodeNameMap.get(this.gsdm); | |
| 101 | + } | |
| 102 | + | |
| 103 | + public void setGsname(String gsname) { | |
| 104 | + this.gsname = gsname; | |
| 105 | + } | |
| 106 | + | |
| 107 | + public String getFgsname() { | |
| 108 | + return BasicData.businessFgsCodeNameMap.get(this.fgsdm+"_"+this.gsdm); | |
| 109 | + } | |
| 110 | + | |
| 111 | + public void setFgsname(String fgsname) { | |
| 112 | + this.fgsname = fgsname; | |
| 113 | + } | |
| 114 | + | |
| 115 | + | |
| 116 | +} | ... | ... |
src/main/java/com/bsth/entity/realcontrol/ScheduleRealInfo.java
| ... | ... | @@ -87,6 +87,9 @@ public class ScheduleRealInfo { |
| 87 | 87 | private Integer bcs; |
| 88 | 88 | /** 计划里程 */ |
| 89 | 89 | private Double jhlc; |
| 90 | + | |
| 91 | + /** 实际里程 */ | |
| 92 | + private Double realMileage; | |
| 90 | 93 | |
| 91 | 94 | /** 实际里程 */ |
| 92 | 95 | @Transient |
| ... | ... | @@ -834,4 +837,12 @@ public class ScheduleRealInfo { |
| 834 | 837 | public void setReissue(boolean reissue) { |
| 835 | 838 | this.reissue = reissue; |
| 836 | 839 | } |
| 840 | + | |
| 841 | + public Double getRealMileage() { | |
| 842 | + return realMileage; | |
| 843 | + } | |
| 844 | + | |
| 845 | + public void setRealMileage(Double realMileage) { | |
| 846 | + this.realMileage = realMileage; | |
| 847 | + } | |
| 837 | 848 | } | ... | ... |
src/main/java/com/bsth/entity/sys/RealControAuthority.java
src/main/java/com/bsth/filter/ResourceFilter.java
src/main/java/com/bsth/repository/CarsRepository.java
| ... | ... | @@ -12,4 +12,7 @@ public interface CarsRepository extends BaseRepository<Cars, Integer>{ |
| 12 | 12 | |
| 13 | 13 | @Query(value="select s from Cars s where s.id in(select e.cl.id from CarConfigInfo e where e.xl.id = ?1) ") |
| 14 | 14 | List<Cars> findCarsByLineId(Integer lineId); |
| 15 | + | |
| 16 | + @Query(value="select s from Cars s") | |
| 17 | + List<Cars> findCars(); | |
| 15 | 18 | } | ... | ... |
src/main/java/com/bsth/repository/oil/CdlRepository.java
0 → 100644
| 1 | +package com.bsth.repository.oil; | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | +import java.util.List; | |
| 6 | + | |
| 7 | +import org.springframework.data.jpa.repository.Modifying; | |
| 8 | +import org.springframework.data.jpa.repository.Query; | |
| 9 | +import org.springframework.stereotype.Repository; | |
| 10 | +import org.springframework.transaction.annotation.Transactional; | |
| 11 | + | |
| 12 | +import com.bsth.entity.oil.Cdl; | |
| 13 | +import com.bsth.entity.oil.Cyl; | |
| 14 | +import com.bsth.repository.BaseRepository; | |
| 15 | + | |
| 16 | +@Repository | |
| 17 | +public interface CdlRepository extends BaseRepository<Cdl, Integer>{ | |
| 18 | + @Transactional | |
| 19 | + @Modifying | |
| 20 | + @Query(value="SELECT * FROM bsth_c_cdl ",nativeQuery=true) | |
| 21 | + List<Cdl> obtainCdl(); | |
| 22 | +} | ... | ... |
src/main/java/com/bsth/repository/oil/CylRepository.java
| ... | ... | @@ -15,6 +15,6 @@ import com.bsth.repository.BaseRepository; |
| 15 | 15 | public interface CylRepository extends BaseRepository<Cyl, Integer>{ |
| 16 | 16 | @Transactional |
| 17 | 17 | @Modifying |
| 18 | - @Query(value="SELECT * FROM bsth_c_cyl ",nativeQuery=true) | |
| 19 | - List<Cyl> obtainCyl(); | |
| 18 | + @Query(value="SELECT * FROM bsth_c_cyl where nbbm like %?1% and gsdm like %?2%",nativeQuery=true) | |
| 19 | + List<Cyl> obtainCyl(String nbbm,String gsdm); | |
| 20 | 20 | } | ... | ... |
src/main/java/com/bsth/repository/oil/DlbRepository.java
| 1 | 1 | package com.bsth.repository.oil; |
| 2 | 2 | |
| 3 | +import java.util.List; | |
| 4 | + | |
| 5 | +import org.springframework.data.jpa.repository.Modifying; | |
| 6 | +import org.springframework.data.jpa.repository.Query; | |
| 3 | 7 | import org.springframework.stereotype.Repository; |
| 8 | +import org.springframework.transaction.annotation.Transactional; | |
| 9 | + | |
| 4 | 10 | import com.bsth.entity.oil.Dlb; |
| 11 | +import com.bsth.entity.oil.Ylb; | |
| 5 | 12 | import com.bsth.repository.BaseRepository; |
| 6 | 13 | |
| 7 | 14 | @Repository |
| 8 | 15 | public interface DlbRepository extends BaseRepository<Dlb, Integer>{ |
| 16 | + /** | |
| 17 | + * 前一天DLB信息 | |
| 18 | + * @param rq | |
| 19 | + * @return | |
| 20 | + */ | |
| 21 | + @Transactional | |
| 22 | + @Modifying | |
| 23 | + @Query(value="SELECT a.* FROM bsth_c_dlb a where to_days(?1)-to_days(a.rq)=1" | |
| 24 | + + " and jcsx=(select max(b.jcsx) from bsth_c_dlb b where a.nbbm=b.nbbm and " | |
| 25 | + + " to_days(?1)-to_days(b.rq)=1 )",nativeQuery=true) | |
| 26 | + List<Dlb> obtainYlbefore(String rq); | |
| 27 | + /** | |
| 28 | + * 当天DLB信息 | |
| 29 | + * @param rq | |
| 30 | + * @return | |
| 31 | + */ | |
| 32 | + @Transactional | |
| 33 | + @Modifying | |
| 34 | + @Query(value="SELECT * FROM bsth_c_dlb where to_days(?)=to_days(rq)",nativeQuery=true) | |
| 35 | + List<Dlb> obtainDl(String rq); | |
| 9 | 36 | |
| 10 | 37 | } | ... | ... |
src/main/java/com/bsth/repository/oil/JdlRepository.java
| ... | ... | @@ -27,6 +27,12 @@ public interface JdlRepository extends BaseRepository<Jdl, Integer>{ |
| 27 | 27 | @Query(value="SELECT * FROM bsth_c_jdl where gs_bm = ?1 and fgs_bm = ?2 and rq = ?3 and nbbm like %?4%",nativeQuery=true) |
| 28 | 28 | List<Jdl> query(String gsbm, String fgsbm, String rq, String nbbm); |
| 29 | 29 | |
| 30 | + | |
| 31 | + @Transactional | |
| 32 | + @Modifying | |
| 33 | + @Query(value="SELECT * FROM bsth_c_jdl where rq = ?",nativeQuery=true) | |
| 34 | + List<Jdl> JdlList( String rq); | |
| 35 | + | |
| 30 | 36 | @Transactional |
| 31 | 37 | @Modifying |
| 32 | 38 | @Query(value="SELECT jdl FROM bsth_c_jdl where gs_bm = ?1 and fgs_bm = ?2 and rq = ?3 and nbbm = ?4 and jdz = ?5",nativeQuery=true) | ... | ... |
src/main/java/com/bsth/repository/oil/YlbRepository.java
| ... | ... | @@ -33,8 +33,10 @@ public interface YlbRepository extends BaseRepository<Ylb, Integer>{ |
| 33 | 33 | */ |
| 34 | 34 | @Transactional |
| 35 | 35 | @Modifying |
| 36 | - @Query(value="SELECT * FROM bsth_c_ylb where to_days(?)=to_days(rq)",nativeQuery=true) | |
| 37 | - List<Ylb> obtainYl(String rq); | |
| 36 | + @Query(value="SELECT * FROM bsth_c_ylb where to_days(?1)=to_days(rq) and ssgsdm like %?2% " | |
| 37 | + + " and fgsdm like %?3%" | |
| 38 | + + " and xlbm like %?4% and nbbm like %?5% order by ?6 asc ",nativeQuery=true) | |
| 39 | + List<Ylb> obtainYl(String rq,String gsdm,String fgsdm,String xlbm,String nbbm,String px); | |
| 38 | 40 | |
| 39 | 41 | |
| 40 | 42 | @Transactional |
| ... | ... | @@ -48,6 +50,6 @@ public interface YlbRepository extends BaseRepository<Ylb, Integer>{ |
| 48 | 50 | */ |
| 49 | 51 | @Transactional |
| 50 | 52 | @Modifying |
| 51 | - @Query(value="select sum(jzl) as jzl,sum(zlc) as zlc from bsth_c_ylb where nbbm=?1 and rq=?2",nativeQuery=true) | |
| 53 | + @Query(value="select sum(jzl) as jzl,sum(zlc) as zlc ,sum(sh) as sh from bsth_c_ylb where nbbm=?1 and rq=?2",nativeQuery=true) | |
| 52 | 54 | List<Object[]> sumLcYl(String nbbm,Date rq); |
| 53 | 55 | } | ... | ... |
src/main/java/com/bsth/repository/oil/YlxxbRepository.java
| ... | ... | @@ -19,8 +19,8 @@ public interface YlxxbRepository extends BaseRepository<Ylxxb, Integer>{ |
| 19 | 19 | */ |
| 20 | 20 | @Transactional |
| 21 | 21 | @Modifying |
| 22 | - @Query(value="SELECT * FROM bsth_c_ylxxb where to_days(?)=to_days(yyrq)",nativeQuery=true) | |
| 23 | - List<Ylxxb> obtainYlxx(String rq); | |
| 22 | + @Query(value="SELECT * FROM bsth_c_ylxxb where to_days(?1)=to_days(yyrq) and nylx=?2",nativeQuery=true) | |
| 23 | + List<Ylxxb> obtainYlxx(String rq,int nylx); | |
| 24 | 24 | |
| 25 | 25 | @Transactional |
| 26 | 26 | @Modifying | ... | ... |
src/main/java/com/bsth/repository/realcontrol/ScheduleRealInfoRepository.java
| ... | ... | @@ -28,14 +28,8 @@ public interface ScheduleRealInfoRepository extends BaseRepository<ScheduleRealI |
| 28 | 28 | @Query(value="select s from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 GROUP BY s.id,s.jGh,s.clZbh,s.lpName order by (lpName+1)") |
| 29 | 29 | List<ScheduleRealInfo> queryUserInfo(String line,String date); |
| 30 | 30 | |
| 31 | - @Query(value="select min(s.id), s.jGh,s.clZbh,s.lpName,s.jName,s.sGh,s.sName from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 GROUP BY s.jGh,s.clZbh,s.lpName ,s.jName,s.sGh,s.sName order by (lpName+1)") | |
| 31 | + @Query(value="select min(s.id), s.jGh,s.clZbh,s.lpName,s.jName from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 GROUP BY s.jGh,s.clZbh,s.lpName ,s.jName order by (lpName+1)") | |
| 32 | 32 | List<ScheduleRealInfo> queryUserInfo2(String line,String date); |
| 33 | - | |
| 34 | - @Query(value="select min(s.id), s.jGh,s.clZbh,s.lpName,s.jName,s.sGh,s.sName from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 GROUP BY s.jGh,s.clZbh,s.lpName ,s.jName,s.sGh,s.sName order by ?3 desc") | |
| 35 | - List<ScheduleRealInfo> queryUserInfoPxDesc(String line,String date,String state); | |
| 36 | - | |
| 37 | - @Query(value="select min(s.id), s.jGh,s.clZbh,s.lpName,s.jName,s.sGh,s.sName from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 GROUP BY s.jGh,s.clZbh,s.lpName ,s.jName,s.sGh,s.sName order by ?3 asc") | |
| 38 | - List<ScheduleRealInfo> queryUserInfoPxAsc(String line,String date,String state); | |
| 39 | 33 | |
| 40 | 34 | @Query(value="select min(s.id), s.clZbh from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 GROUP BY s.clZbh ") |
| 41 | 35 | List<ScheduleRealInfo> queryUserInfo3(String line,String date); | ... | ... |
src/main/java/com/bsth/service/forms/impl/FormsServiceImpl.java
| ... | ... | @@ -2,6 +2,7 @@ package com.bsth.service.forms.impl; |
| 2 | 2 | |
| 3 | 3 | import java.sql.ResultSet; |
| 4 | 4 | import java.sql.SQLException; |
| 5 | +import java.text.DecimalFormat; | |
| 5 | 6 | import java.text.NumberFormat; |
| 6 | 7 | import java.text.ParseException; |
| 7 | 8 | import java.text.SimpleDateFormat; |
| ... | ... | @@ -23,6 +24,7 @@ import com.bsth.entity.mcy_forms.Singledata; |
| 23 | 24 | import com.bsth.entity.mcy_forms.Turnoutrate; |
| 24 | 25 | import com.bsth.entity.mcy_forms.Vehicleloading; |
| 25 | 26 | import com.bsth.entity.mcy_forms.Waybillday; |
| 27 | +import com.bsth.data.BasicData; | |
| 26 | 28 | import com.bsth.entity.mcy_forms.Allline; |
| 27 | 29 | import com.bsth.entity.mcy_forms.Changetochange; |
| 28 | 30 | import com.bsth.entity.mcy_forms.Daily; |
| ... | ... | @@ -47,33 +49,33 @@ public class FormsServiceImpl implements FormsService { |
| 47 | 49 | @Override |
| 48 | 50 | public List<Waybillday> waybillday(Map<String, Object> map) { |
| 49 | 51 | |
| 50 | - String sql ="select x.j_gh,x.cl_zbh,z.JZL,z.YH,z.personnel_name,x.schedule_date,x.gs_bm,x.gs_name,x.fgs_bm,x.fgs_name " | |
| 51 | - + " from bsth_c_s_sp_info_real x INNER join " | |
| 52 | - + " ( select y.RQ,y.XLBM,y.NBBM,y.JSY,y.JZL,y.YH,c.personnel_name from" | |
| 53 | - + " bsth_c_ylb y LEFT JOIN bsth_c_personnel c ON c.job_code=y.JSY " | |
| 54 | - + " where 1=1 "; | |
| 55 | - if(map.get("date").toString()!=""){ | |
| 56 | - sql+=" and to_days(y.RQ)=to_days('"+map.get("date").toString() + "') "; | |
| 57 | - } | |
| 58 | - if( map.get("line").toString()!=""){ | |
| 59 | - sql+=" and y.XLBM= '"+ map.get("line").toString()+"' GROUP BY y.NBBM) "; | |
| 60 | - } | |
| 61 | - sql+= " z on x.cl_zbh=z.nbbm where to_days( x.schedule_date)=to_days('"+map.get("date").toString()+"') "; | |
| 62 | - if(map.get("gsdmWaybillday").toString()!=""){ | |
| 63 | - sql+=" and x.gs_bm='"+map.get("gsdmWaybillday").toString()+"'"; | |
| 64 | - } | |
| 65 | - if(map.get("fgsdmWaybillday").toString()!=""){ | |
| 66 | - sql+=" and x.fgs_bm='"+map.get("fgsdmWaybillday").toString()+"'"; | |
| 67 | - } | |
| 68 | - sql += " GROUP BY x.j_gh,x.cl_zbh,z.JZL,z.YH,z.personnel_name,x.schedule_date,x.gs_bm,x.gs_name,x.fgs_bm,x.fgs_name "; | |
| 52 | + | |
| 53 | + | |
| 54 | + String sql=" select t.*,z.jzl,z.yh from (" | |
| 55 | + + " select x.j_gh,x.cl_zbh,x.j_name,x.schedule_date," | |
| 56 | + + " x.gs_bm,x.gs_name,x.fgs_bm,x.fgs_name from bsth_c_s_sp_info_real x " | |
| 57 | + + " where to_days( x.schedule_date)=to_days('"+map.get("date").toString() + "') " | |
| 58 | + + " and x.gs_bm='"+map.get("gsdmWaybillday").toString()+"' " | |
| 59 | + + " and x.fgs_bm='"+map.get("fgsdmWaybillday").toString()+"' " | |
| 60 | + + " and xl_bm like '%"+ map.get("line").toString().trim()+"%'" | |
| 61 | + + " GROUP BY x.j_gh,x.cl_zbh,x.j_name," | |
| 62 | + + " x.schedule_date,x.gs_bm,x.gs_name,x.fgs_bm,x.fgs_name ) t" | |
| 63 | + + " LEFT join (select y.rq,y.xlbm,y.nbbm,y.jsy,y.jzl,y.yh from" | |
| 64 | + + " bsth_c_ylb y where 1=1 " | |
| 65 | + + " and to_days(y.RQ)=to_days('"+map.get("date").toString() + "') " | |
| 66 | + + " and y.XLBM like '%"+ map.get("line").toString().trim()+"%'" | |
| 67 | + + " and y.ssgsdm='"+map.get("gsdmWaybillday").toString()+"'" | |
| 68 | + + " and y.fgsdm='"+map.get("gsdmWaybillday").toString()+"') z " | |
| 69 | + + " on t.cl_zbh=z.nbbm "; | |
| 70 | + | |
| 69 | 71 | List<Waybillday> list = jdbcTemplate.query(sql, new RowMapper<Waybillday>() { |
| 70 | 72 | @Override |
| 71 | 73 | public Waybillday mapRow(ResultSet arg0, int arg1) throws SQLException { |
| 72 | 74 | Waybillday wbd = new Waybillday(); |
| 73 | 75 | wbd.setCarPlate(arg0.getString("cl_zbh")); |
| 74 | - wbd.setJzl(arg0.getString("JZL")); | |
| 75 | - wbd.setYh(arg0.getString("YH")); | |
| 76 | - wbd.setjName(arg0.getString("personnel_name")); | |
| 76 | + wbd.setJzl(arg0.getString("jzl")); | |
| 77 | + wbd.setYh(arg0.getString("yh")); | |
| 78 | + wbd.setjName(arg0.getString("j_name")); | |
| 77 | 79 | wbd.setRq(arg0.getString("schedule_date")); |
| 78 | 80 | wbd.setJgh(arg0.getString("j_gh")); |
| 79 | 81 | return wbd; |
| ... | ... | @@ -193,7 +195,15 @@ public class FormsServiceImpl implements FormsService { |
| 193 | 195 | // 班次车辆人员日统计 |
| 194 | 196 | @Override |
| 195 | 197 | public List<Shifday> shifday(Map<String, Object> map) { |
| 196 | - String sql = " select r.schedule_date,r.lp_name,r.xl_name,r.j_name,r.s_name, r.cl_zbh,r.xl_bm," | |
| 198 | + | |
| 199 | + String sql ="select t.* from (select r.schedule_date,r.j_name,IFNULL(r.s_name,'')as s_name," | |
| 200 | + + " r.cl_zbh,r.xl_bm, r.j_gh,r.gs_bm,r.fgs_bm FROM bsth_c_s_sp_info_real r where 1=1 " | |
| 201 | + + " and to_days(r.schedule_date)=to_days('"+ map.get("date").toString() + "') " | |
| 202 | + + " and r.xl_bm like '%"+map.get("line").toString()+"%' " | |
| 203 | + + " and r.gs_bm='"+map.get("gsdmShif").toString()+"' " | |
| 204 | + + " and r.fgs_bm='"+map.get("fgsdmShif").toString()+"' ) t" | |
| 205 | + + " GROUP BY t.schedule_date,t.j_name,t.s_name, t.cl_zbh,t.xl_bm,t.j_gh,t.gs_bm,t.fgs_bm "; | |
| 206 | + /*String sql = " select r.schedule_date,r.lp_name,r.xl_name,r.j_name,r.s_name, r.cl_zbh,r.xl_bm," | |
| 197 | 207 | + " r.cl_zbh,r.j_gh,r.j_gh,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name,r.bc_type " |
| 198 | 208 | + " FROM bsth_c_s_sp_info_real r " |
| 199 | 209 | + " where 1=1 "; |
| ... | ... | @@ -211,20 +221,18 @@ public class FormsServiceImpl implements FormsService { |
| 211 | 221 | sql+=" and r.fgs_bm='"+map.get("fgsdmShif").toString()+"'"; |
| 212 | 222 | } |
| 213 | 223 | sql += " GROUP BY r.schedule_date,r.lp_name,r.xl_name,r.j_name,r.s_name, r.cl_zbh,r.xl_bm,r.cl_zbh,r.j_gh,r.j_gh,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name " |
| 214 | - + " ORDER BY r.lp_name asc"; | |
| 224 | + + " ORDER BY r.lp_name asc";*/ | |
| 215 | 225 | |
| 216 | 226 | List<Shifday> list = jdbcTemplate.query(sql, new RowMapper<Shifday>() { |
| 217 | 227 | |
| 218 | 228 | @Override |
| 219 | 229 | public Shifday mapRow(ResultSet arg0, int arg1) throws SQLException { |
| 220 | 230 | Shifday shifday = new Shifday(); |
| 231 | + shifday.setRq(arg0.getString("schedule_date")); | |
| 221 | 232 | shifday.setjName(arg0.getString("j_name").toString()); |
| 222 | 233 | shifday.setsName(arg0.getString("s_name") == null ? "" : arg0.getString("s_name").toString()); |
| 223 | - shifday.setLpName(arg0.getString("r.lp_name").toString()); | |
| 224 | 234 | shifday.setCarPlate(arg0.getString("cl_zbh").toString()); |
| 225 | 235 | shifday.setJgh(arg0.getString("j_gh")); |
| 226 | - shifday.setZbh(arg0.getString("cl_zbh")); | |
| 227 | - shifday.setRq(arg0.getString("schedule_date")); | |
| 228 | 236 | return shifday; |
| 229 | 237 | } |
| 230 | 238 | |
| ... | ... | @@ -335,33 +343,28 @@ public class FormsServiceImpl implements FormsService { |
| 335 | 343 | String rq3 = sdf1.format(d1); |
| 336 | 344 | |
| 337 | 345 | rq = rq2 + "-" + rq3; |
| 338 | - | |
| 339 | - String sql = " SELECT r.xl_bm,r.xl_name,r.cl_zbh,r.j_gh,r.j_name,y.YH,y.JZL,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name " | |
| 340 | - + " FROM bsth_c_s_sp_info_real r " | |
| 341 | - + " left join bsth_c_ylb y" | |
| 342 | - + " ON r.cl_zbh = y.nbbm " | |
| 343 | - + " where r.schedule_date_str BETWEEN '" + map.get("startDate").toString() + "'" | |
| 344 | - + " and '"+ map.get("endDate").toString() + "'" | |
| 345 | - + " and r.xl_bm='" + map.get("line").toString() + "'" | |
| 346 | - + " AND r.gs_bm is not null"; | |
| 347 | - | |
| 348 | - if(map.get("gsdmSing").toString()!=""){ | |
| 349 | - sql+=" and r.gs_bm='"+map.get("gsdmSing").toString()+"'"; | |
| 350 | - } | |
| 351 | - if(map.get("fgsdmSing").toString()!=""){ | |
| 352 | - sql+=" and r.fgs_bm='"+map.get("fgsdmSing").toString()+"'"; | |
| 353 | - } | |
| 354 | - sql += " GROUP BY r.xl_bm,r.cl_zbh,r.j_gh,r.j_name,y.YH,y.JZL,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name "; | |
| 355 | - | |
| 356 | 346 | startDate = map.get("startDate").toString(); |
| 357 | 347 | endDate = map.get("endDate").toString(); |
| 348 | + String sql = "select t.*,y.yh,y.jzl from (" | |
| 349 | + + " select r.xl_bm,r.xl_name,r.cl_zbh,r.j_gh,r.j_name,r.gs_bm,r.fgs_bm" | |
| 350 | + + " from bsth_c_s_sp_info_real r where r.schedule_date_str " | |
| 351 | + + " BETWEEN '"+startDate+"' and '"+endDate+"' and r.xl_bm='"+map.get("line").toString()+"' " | |
| 352 | + + " AND r.gs_bm is not null and r.gs_bm='"+map.get("gsdmSing").toString()+"' " | |
| 353 | + + " and r.fgs_bm='"+map.get("fgsdmSing").toString()+"' " | |
| 354 | + + " group by r.xl_bm,r.xl_name,r.cl_zbh,r.j_gh,r.j_name,r.gs_bm,r.fgs_bm) t " | |
| 355 | + + " LEFT JOIN (select a.nbbm,a.jsy,SUM(a.yh) as yh,SUM(a.jzl) as jzl " | |
| 356 | + + " from bsth_c_ylb a where a.rq BETWEEN '"+startDate+"' and '"+endDate+"'and " | |
| 357 | + + " a.ssgsdm='"+map.get("gsdmSing").toString()+"' and a.fgsdm='"+map.get("fgsdmSing").toString()+"' " | |
| 358 | + + "group by a.nbbm,a.jsy) y" | |
| 359 | + + " on y.nbbm=t.cl_zbh and y.jsy= t.j_gh"; | |
| 360 | + | |
| 358 | 361 | List<Singledata> list = jdbcTemplate.query(sql, new RowMapper<Singledata>() { |
| 359 | 362 | //SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| 360 | 363 | @Override |
| 361 | 364 | public Singledata mapRow(ResultSet arg0, int arg1) throws SQLException { |
| 362 | 365 | Singledata sin = new Singledata(); |
| 363 | 366 | sin.setrQ(rq); |
| 364 | - sin.setgS(arg0.getString("gs_name")); | |
| 367 | + sin.setgS(arg0.getString("gs_bm")); | |
| 365 | 368 | sin.setxL(arg0.getString("xl_name")); |
| 366 | 369 | sin.setClzbh(arg0.getString("cl_zbh")); |
| 367 | 370 | sin.setJsy(arg0.getString("j_gh")); |
| ... | ... | @@ -374,8 +377,13 @@ public class FormsServiceImpl implements FormsService { |
| 374 | 377 | return sin; |
| 375 | 378 | } |
| 376 | 379 | }); |
| 380 | + DecimalFormat df = new DecimalFormat("0.00"); | |
| 377 | 381 | for(int i=0;i<list.size();i++){ |
| 382 | + | |
| 378 | 383 | Singledata si=list.get(i); |
| 384 | + si.setgS(BasicData.businessCodeNameMap.get(si.getgS())); | |
| 385 | + si.setJzl(df.format(Double.parseDouble(si.getJzl()))); | |
| 386 | + si.setHyl(df.format(Double.parseDouble(si.getHyl()))); | |
| 379 | 387 | Map<String, Object> maps = new HashMap<>(); |
| 380 | 388 | maps = commonService.findKMBC1(si.getjName(),si.getClzbh(), startDate, |
| 381 | 389 | endDate); |
| ... | ... | @@ -712,22 +720,20 @@ public class FormsServiceImpl implements FormsService { |
| 712 | 720 | |
| 713 | 721 | @Override |
| 714 | 722 | public List<Daily> daily(Map<String, Object> map) { |
| 715 | - | |
| 716 | - String sql ="select r.schedule_date_str,r.xl_bm,r.xl_name,r.cl_zbh,r.j_gh,r.j_name,y.YH,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name " | |
| 717 | - + " from bsth_c_s_sp_info_real r LEFT JOIN bsth_c_ylb y ON r.cl_zbh = y.nbbm " | |
| 718 | - + " WHERE 1 = 1" | |
| 719 | - + " and r.xl_bm='" + map.get("line").toString() + "'" | |
| 720 | - + " and to_days(r.schedule_date)=to_days('"+map.get("date").toString()+"')" | |
| 721 | - + " AND r.gs_bm is not null"; | |
| 722 | - | |
| 723 | - if(map.get("gsdmDaily").toString()!=""){ | |
| 724 | - sql+=" and r.gs_bm='"+map.get("gsdmDaily").toString()+"'"; | |
| 725 | - } | |
| 726 | - if(map.get("fgsdmDaily").toString()!=""){ | |
| 727 | - sql+=" and r.fgs_bm='"+map.get("fgsdmDaily").toString()+"'"; | |
| 728 | - } | |
| 729 | - sql += " GROUP BY r.schedule_date_str,r.xl_bm,r.xl_name,r.cl_zbh,r.j_gh,r.j_name,y.YH,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name "; | |
| 730 | - | |
| 723 | + String sql="select t.schedule_date_str," | |
| 724 | + + " t.cl_zbh,t.j_gh,t.j_name,x.yh from (select r.schedule_date_str,r.xl_bm,r.xl_name," | |
| 725 | + + " r.cl_zbh,r.j_gh,r.j_name from bsth_c_s_sp_info_real r WHERE " | |
| 726 | + + " r.xl_bm='" + map.get("line").toString() + "' and to_days(r.schedule_date)=to_days('"+map.get("date").toString()+"') " | |
| 727 | + + " and r.gs_bm like '%"+map.get("gsdmDaily").toString()+"%' " | |
| 728 | + + " and r.fgs_bm like '%"+map.get("fgsdmDaily").toString()+"%' " | |
| 729 | + + " GROUP BY r.schedule_date_str,r.xl_bm,r.xl_name,r.cl_zbh,r.j_gh,r.j_name) t" | |
| 730 | + + " left join (select * from bsth_c_ylb y where " | |
| 731 | + + " to_days(y.rq)=to_days('"+map.get("date").toString()+"') " | |
| 732 | + + " and y.xlbm= '" + map.get("line").toString() + "'" | |
| 733 | + + " and y.ssgsdm like '%"+map.get("gsdmDaily").toString()+"%' " | |
| 734 | + + " and y.fgsdm like '%"+map.get("fgsdmDaily").toString()+"%'" | |
| 735 | + + " ) x" | |
| 736 | + + " on t.cl_zbh = x.nbbm "; | |
| 731 | 737 | List<Daily> list = jdbcTemplate.query(sql, new RowMapper<Daily>() { |
| 732 | 738 | @Override |
| 733 | 739 | public Daily mapRow(ResultSet arg0, int arg1) throws SQLException { |
| ... | ... | @@ -736,7 +742,7 @@ public class FormsServiceImpl implements FormsService { |
| 736 | 742 | daily.setZbh(arg0.getString("cl_zbh")); |
| 737 | 743 | daily.setJgh(arg0.getString("j_gh")); |
| 738 | 744 | daily.setjName(arg0.getString("j_name")); |
| 739 | - daily.setYh(arg0.getString("YH")); | |
| 745 | + daily.setYh(arg0.getString("yh")); | |
| 740 | 746 | return daily; |
| 741 | 747 | } |
| 742 | 748 | }); | ... | ... |
src/main/java/com/bsth/service/impl/BusIntervalServiceImpl.java
| ... | ... | @@ -1345,8 +1345,8 @@ public class BusIntervalServiceImpl implements BusIntervalService { |
| 1345 | 1345 | Collections.sort(keyMap1.get(key), new Comparator<Map<String, Object>>() { |
| 1346 | 1346 | |
| 1347 | 1347 | public int compare(Map<String, Object> o1, Map<String, Object> o2) { |
| 1348 | - Integer a; | |
| 1349 | - Integer b; | |
| 1348 | + Long a; | |
| 1349 | + Long b; | |
| 1350 | 1350 | String lp1 = o1.get("lp").toString(); |
| 1351 | 1351 | String lp2 = o2.get("lp").toString(); |
| 1352 | 1352 | String str1 = ""; |
| ... | ... | @@ -1358,8 +1358,8 @@ public class BusIntervalServiceImpl implements BusIntervalService { |
| 1358 | 1358 | str2 += (int)lp2.charAt(i); |
| 1359 | 1359 | } |
| 1360 | 1360 | |
| 1361 | - a = Integer.valueOf(str1); | |
| 1362 | - b = Integer.valueOf(str2); | |
| 1361 | + a = Long.valueOf(str1); | |
| 1362 | + b = Long.valueOf(str2); | |
| 1363 | 1363 | |
| 1364 | 1364 | // 升序 |
| 1365 | 1365 | return a.compareTo(b); | ... | ... |
src/main/java/com/bsth/service/impl/PersonnelServiceImpl.java
| ... | ... | @@ -34,8 +34,9 @@ public class PersonnelServiceImpl extends BaseServiceImpl<Personnel, Integer> im |
| 34 | 34 | per=perIterator.next(); |
| 35 | 35 | if(per.getJobCode().indexOf(jobCode)!=-1){ |
| 36 | 36 | Map<String, String> jobCodeMap= new HashMap<>(); |
| 37 | - jobCodeMap.put("id",per.getJobCode()); | |
| 38 | - jobCodeMap.put("text", per.getJobCode()+"/"+per.getPersonnelName()); | |
| 37 | + String jboCode=per.getJobCode().substring(per.getJobCode().indexOf("-")+1); | |
| 38 | + jobCodeMap.put("id",jboCode); | |
| 39 | + jobCodeMap.put("text", jboCode+"/"+per.getPersonnelName()); | |
| 39 | 40 | jobCodeMap.put("gs", per.getCompanyCode()); |
| 40 | 41 | list.add(jobCodeMap); |
| 41 | 42 | } | ... | ... |
src/main/java/com/bsth/service/oil/CdlService.java
0 → 100644
src/main/java/com/bsth/service/oil/DlbService.java
| 1 | 1 | package com.bsth.service.oil; |
| 2 | 2 | |
| 3 | +import java.util.Map; | |
| 4 | + | |
| 3 | 5 | import com.bsth.entity.oil.Dlb; |
| 4 | 6 | import com.bsth.service.BaseService; |
| 5 | 7 | |
| 6 | 8 | public interface DlbService extends BaseService<Dlb, Integer>{ |
| 9 | + Map<String, Object> obtain(Map<String, Object> map); | |
| 10 | + | |
| 11 | + Map<String, Object> sort(Map<String, Object> map); | |
| 12 | + | |
| 13 | + Map<String, Object> checkDl(Map<String, Object> map); | |
| 7 | 14 | } | ... | ... |
src/main/java/com/bsth/service/oil/YlbService.java
| ... | ... | @@ -7,11 +7,11 @@ import com.bsth.entity.oil.Ylb; |
| 7 | 7 | import com.bsth.service.BaseService; |
| 8 | 8 | |
| 9 | 9 | public interface YlbService extends BaseService<Ylb, Integer>{ |
| 10 | - Map<String, Object> obtain(Map<String, Object> map); | |
| 11 | - String obtainDsq(); | |
| 10 | + Map<String, Object> obtain(Map<String, Object> map) throws Exception; | |
| 11 | + String obtainDsq() throws Exception; | |
| 12 | 12 | Map<String, Object> sort(Map<String, Object> map); |
| 13 | 13 | |
| 14 | - Map<String, Object> outAndIn(Map<String, Object> map); | |
| 14 | + Map<String, Object> outAndIn(Map<String, Object> map) throws Exception; | |
| 15 | 15 | |
| 16 | 16 | Map<String, Object> checkYl(Map<String, Object> map); |
| 17 | 17 | ... | ... |
src/main/java/com/bsth/service/oil/impl/CdlServiceImpl.java
0 → 100644
| 1 | +package com.bsth.service.oil.impl; | |
| 2 | + | |
| 3 | +import org.springframework.stereotype.Service; | |
| 4 | + | |
| 5 | +import com.bsth.entity.oil.Cdl; | |
| 6 | +import com.bsth.service.impl.BaseServiceImpl; | |
| 7 | +import com.bsth.service.oil.CdlService; | |
| 8 | + | |
| 9 | +@Service | |
| 10 | +public class CdlServiceImpl extends BaseServiceImpl<Cdl,Integer> implements CdlService | |
| 11 | +{ | |
| 12 | + | |
| 13 | +} | ... | ... |
src/main/java/com/bsth/service/oil/impl/DlbServiceImpl.java
| ... | ... | @@ -2,14 +2,309 @@ package com.bsth.service.oil.impl; |
| 2 | 2 | |
| 3 | 3 | |
| 4 | 4 | |
| 5 | +import java.text.DecimalFormat; | |
| 6 | +import java.text.ParseException; | |
| 7 | +import java.text.SimpleDateFormat; | |
| 8 | +import java.util.ArrayList; | |
| 9 | +import java.util.Date; | |
| 10 | +import java.util.HashMap; | |
| 11 | +import java.util.Iterator; | |
| 12 | +import java.util.List; | |
| 13 | +import java.util.Map; | |
| 14 | + | |
| 15 | +import javax.transaction.Transactional; | |
| 16 | + | |
| 17 | +import org.slf4j.Logger; | |
| 18 | +import org.slf4j.LoggerFactory; | |
| 19 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 20 | +import org.springframework.data.domain.Sort; | |
| 21 | +import org.springframework.data.domain.Sort.Direction; | |
| 22 | +import org.springframework.jdbc.core.JdbcTemplate; | |
| 5 | 23 | import org.springframework.stereotype.Service; |
| 6 | 24 | |
| 25 | +import com.bsth.common.ResponseCode; | |
| 26 | +import com.bsth.entity.Cars; | |
| 27 | +import com.bsth.entity.oil.Cdl; | |
| 28 | +import com.bsth.entity.oil.Cyl; | |
| 7 | 29 | import com.bsth.entity.oil.Dlb; |
| 30 | +import com.bsth.entity.oil.Jdl; | |
| 31 | +import com.bsth.entity.oil.Ylb; | |
| 32 | +import com.bsth.entity.oil.Ylxxb; | |
| 33 | +import com.bsth.entity.search.CustomerSpecs; | |
| 34 | +import com.bsth.repository.CarsRepository; | |
| 35 | +import com.bsth.repository.oil.CdlRepository; | |
| 36 | +import com.bsth.repository.oil.CylRepository; | |
| 37 | +import com.bsth.repository.oil.DlbRepository; | |
| 38 | +import com.bsth.repository.oil.JdlRepository; | |
| 39 | +import com.bsth.repository.oil.YlbRepository; | |
| 40 | +import com.bsth.repository.oil.YlxxbRepository; | |
| 8 | 41 | import com.bsth.service.impl.BaseServiceImpl; |
| 9 | 42 | import com.bsth.service.oil.DlbService; |
| 43 | +import com.bsth.service.realcontrol.ScheduleRealInfoService; | |
| 10 | 44 | |
| 11 | 45 | @Service |
| 12 | 46 | public class DlbServiceImpl extends BaseServiceImpl<Dlb,Integer> implements DlbService{ |
| 47 | + @Autowired | |
| 48 | + DlbRepository repository; | |
| 49 | + | |
| 50 | + @Autowired | |
| 51 | + YlxxbRepository ylxxbRepository; | |
| 52 | + | |
| 53 | + @Autowired | |
| 54 | + CdlRepository cdlRepository; | |
| 55 | + @Autowired | |
| 56 | + JdlRepository jdlRepository; | |
| 57 | + @Autowired | |
| 58 | + CarsRepository carsRepository; | |
| 13 | 59 | |
| 60 | + @Autowired | |
| 61 | + ScheduleRealInfoService scheduleRealInfoService; | |
| 62 | + | |
| 63 | + @Autowired | |
| 64 | + JdbcTemplate jdbcTemplate; | |
| 65 | + | |
| 66 | + Logger logger = LoggerFactory.getLogger(this.getClass()); | |
| 67 | + /** | |
| 68 | + * 获取进存油信息 | |
| 69 | + * @Transactional 回滚事物 | |
| 70 | + */ | |
| 71 | + @Transactional | |
| 72 | + @Override | |
| 73 | + public Map<String, Object> obtain(Map<String, Object> map2) { | |
| 74 | + List<Cars> carsList=carsRepository.findCars(); | |
| 75 | + Map<String, Boolean> carsMap=new HashMap<String, Boolean>(); | |
| 76 | + for (int i = 0; i < carsList.size(); i++) { | |
| 77 | + Cars c=carsList.get(i); | |
| 78 | + carsMap.put(c.getInsideCode(), c.getSfdc()); | |
| 79 | + } | |
| 80 | + String rq=map2.get("rq").toString(); | |
| 81 | + String line=""; | |
| 82 | + if(map2.get("xlbm_eq")!=null){ | |
| 83 | + line=map2.get("xlbm_eq").toString(); | |
| 84 | + } | |
| 85 | + | |
| 86 | + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); | |
| 87 | + //保留两位小数 | |
| 88 | + DecimalFormat df = new DecimalFormat("#.00"); | |
| 89 | + // TODO Auto-generated method stub | |
| 90 | + Map<String, Object> newMap=new HashMap<String,Object>(); | |
| 91 | + //当天DLB信息 | |
| 92 | + List<Dlb> dlList=repository.obtainDl(rq); | |
| 93 | + //当天YLXXB信息 | |
| 94 | + List<Ylxxb> ylxxList=ylxxbRepository.obtainYlxx(rq,1); | |
| 95 | + //当天加电信息表 | |
| 96 | + List<Jdl> jdlList=jdlRepository.JdlList(rq); | |
| 97 | + //前一天所有车辆最后进场班次信息 | |
| 98 | + List<Dlb> dlListBe=repository.obtainYlbefore(rq); | |
| 99 | + List<Cdl> cdyList=cdlRepository.obtainCdl(); | |
| 100 | + //从排班表中计算出行驶的总里程 | |
| 101 | + List<Map<String,Object>> listpb=scheduleRealInfoService.yesterdayDataList(line,rq); | |
| 102 | + List<Ylb> addList=new ArrayList<Ylb>(); | |
| 103 | + List<Ylb> updateList=new ArrayList<Ylb>(); | |
| 104 | + for(int x=0;x<listpb.size();x++){ | |
| 105 | + String type="add"; | |
| 106 | + boolean sfdc=false; | |
| 107 | + Map<String, Object> map=listpb.get(x); | |
| 108 | + if (carsMap.get(map.get("clZbh").toString())!=null) { | |
| 109 | + sfdc= carsMap.get(map.get("clZbh").toString()); | |
| 110 | + }else{ | |
| 111 | + sfdc=false; | |
| 112 | + } | |
| 113 | + if(sfdc){ | |
| 114 | + //判断驾驶员驾驶的该车辆是否已经存入了(查出的结果集中日期是相同的,根据驾驶员、内部编号、线路编码判断) | |
| 115 | + Dlb t=new Dlb(); | |
| 116 | + for(int k=0;k<dlList.size();k++){ | |
| 117 | + Dlb t1=dlList.get(k); | |
| 118 | + if(t1.getNbbm().equals(map.get("clZbh").toString()) | |
| 119 | + &&t1.getJsy().equals(map.get("jGh").toString()) | |
| 120 | + &&t1.getXlbm().equals(map.get("xlBm").toString())) | |
| 121 | + { | |
| 122 | + t=t1; | |
| 123 | + type="update"; | |
| 124 | + } | |
| 125 | + } | |
| 126 | + try { | |
| 127 | + //当日的第一个班次,出场油量等于前一天的最后一个班次的进场油量 | |
| 128 | + if(map.get("seqNumber").toString().equals("1")){ | |
| 129 | + boolean fage=true; | |
| 130 | + for (int i = 0; i < dlListBe.size(); i++) { | |
| 131 | + Dlb dlb=dlListBe.get(i); | |
| 132 | + if(map.get("clZbh").toString().equals(dlb.getNbbm())){ | |
| 133 | + t.setCzcd(dlb.getJzcd()); | |
| 134 | + fage=false; | |
| 135 | + break; | |
| 136 | + } | |
| 137 | + } | |
| 138 | + if(fage){ | |
| 139 | + for (int y = 0; y < cdyList.size(); y++) { | |
| 140 | + Cdl cdl=cdyList.get(y); | |
| 141 | + if(map.get("clZbh").toString().equals(cdl.getNbbm())){ | |
| 142 | + t.setCzcd(cdl.getClcd()); | |
| 143 | + fage=false; | |
| 144 | + break; | |
| 145 | + } | |
| 146 | + } | |
| 147 | + } | |
| 148 | + if(fage){ | |
| 149 | + t.setCzcd(0.0); | |
| 150 | + } | |
| 151 | + } | |
| 152 | + | |
| 153 | + Double jzl=0.0; | |
| 154 | + //把当天的YLXXB的加注量设置为当天YLB的加注量(根据车号,驾驶员判断) | |
| 155 | + for(int j=0;j<ylxxList.size();j++){ | |
| 156 | + Ylxxb ylxxb= ylxxList.get(j); | |
| 157 | + if(map.get("clZbh").toString().equals(ylxxb.getNbbm()) &&map.get("jGh").toString().equals(ylxxb.getJsy())){ | |
| 158 | + jzl+=ylxxb.getJzl(); | |
| 159 | + } | |
| 160 | + } | |
| 161 | + | |
| 162 | + //手动导入没有驾驶员工号 | |
| 163 | + for (int i = 0; i < jdlList.size(); i++) { | |
| 164 | + Jdl jdl=jdlList.get(i); | |
| 165 | + if(map.get("clZbh").toString().equals(jdl.getNbbm()) ){ | |
| 166 | + jzl+=jdl.getJdl(); | |
| 167 | + } | |
| 168 | + } | |
| 169 | + t.setCdl(jzl); | |
| 170 | + t.setJzcd(t.getCzcd()); | |
| 171 | + t.setNbbm(map.get("clZbh").toString()); | |
| 172 | + t.setJsy(map.get("jGh")==null?"":map.get("jGh").toString()); | |
| 173 | + t.setZlc(map.get("totalKilometers")==null?0.0:Double.parseDouble(df.format(Double.parseDouble(map.get("totalKilometers").toString())))); | |
| 174 | + t.setXlbm(map.get("xlBm")==null?"":map.get("xlBm").toString()); | |
| 175 | + t.setHd(jzl); | |
| 176 | + t.setJcsx(Integer.parseInt(map.get("seqNumber").toString())); | |
| 177 | + t.setSsgsdm(map.get("company")==null?"":map.get("company").toString()); | |
| 178 | + t.setFgsdm(map.get("bCompany")==null?"":map.get("bCompany").toString()); | |
| 179 | + t.setRq(sdf.parse(rq)); | |
| 180 | + /*if(type.equals("add")){ | |
| 181 | + addList.add(t); | |
| 182 | + }else{ | |
| 183 | + updateList.add(t); | |
| 184 | + }*/ | |
| 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 | + /* try { | |
| 195 | + if(addList.size()>0){ | |
| 196 | + new BatchSaveUtils<Ylb>().saveList(addList, Ylb.class); | |
| 197 | + } | |
| 198 | + | |
| 199 | + if(updateList.size()>0){ | |
| 200 | + | |
| 201 | + } | |
| 202 | + newMap.put("status", ResponseCode.SUCCESS); | |
| 203 | + } | |
| 204 | + catch (Exception e) { | |
| 205 | + // TODO: handle exception | |
| 206 | + newMap.put("status", ResponseCode.ERROR); | |
| 207 | + }*/ | |
| 208 | + return newMap; | |
| 209 | + } | |
| 210 | + | |
| 211 | + /** | |
| 212 | + * 拆分 | |
| 213 | + */ | |
| 214 | + @Transactional | |
| 215 | + @Override | |
| 216 | + public Map<String, Object> sort(Map<String, Object> map) { | |
| 217 | + // TODO Auto-generated method stub | |
| 218 | + Map<String, Object> newMap = new HashMap<String, Object>(); | |
| 219 | + try{ | |
| 220 | + int id=Integer.parseInt(map.get("id").toString()); | |
| 221 | + //最后存油量 | |
| 222 | + Double jzdl=Double.parseDouble(map.get("jzdl").toString()); | |
| 223 | + Double hdl=Double.parseDouble(map.get("hdl").toString()); | |
| 224 | + Dlb dlb=repository.findOne(id); | |
| 225 | + dlb.setJzcd(jzdl); | |
| 226 | + dlb.setHd(hdl); | |
| 227 | + repository.save(dlb); | |
| 228 | + newMap.put("status", ResponseCode.SUCCESS); | |
| 229 | + }catch(Exception e){ | |
| 230 | + newMap.put("status", ResponseCode.ERROR); | |
| 231 | + logger.error("save erro.", e); | |
| 232 | + } | |
| 233 | + return newMap; | |
| 234 | + } | |
| 14 | 235 | |
| 236 | + | |
| 237 | + /** | |
| 238 | + * 核对,有加注没里程 | |
| 239 | + * @param map | |
| 240 | + * @return | |
| 241 | + */ | |
| 242 | + @Transactional | |
| 243 | + @Override | |
| 244 | + public Map<String, Object> checkDl(Map<String, Object> map) { | |
| 245 | + Map<String, Object> newMap=new HashMap<String,Object>(); | |
| 246 | + String xlbm=map.get("xlbm_eq").toString(); | |
| 247 | + | |
| 248 | + // TODO Auto-generated method stub | |
| 249 | + try{ | |
| 250 | + //获取车辆存油信息 | |
| 251 | +// List<Cyl> cylList=cylRepository.findAll(new CustomerSpecs<Cyl>(newMap)); | |
| 252 | + String rq=map.get("rq").toString(); | |
| 253 | + List<Dlb> dlbList=repository.obtainDl(rq); | |
| 254 | + List<Ylxxb> ylxxbList=ylxxbRepository.obtainYlxx(rq,1); | |
| 255 | + //当天加电信息表 | |
| 256 | + List<Jdl> jdlList=jdlRepository.JdlList(rq); | |
| 257 | + for (int i = 0; i < ylxxbList.size(); i++) { | |
| 258 | + Boolean fage=true; | |
| 259 | + Ylxxb y1=ylxxbList.get(i); | |
| 260 | + for(int y=0;y<dlbList.size();y++){ | |
| 261 | + Dlb y2=dlbList.get(y); | |
| 262 | + if(y1.getNbbm().equals(y2.getNbbm())){ | |
| 263 | + fage=false; | |
| 264 | + break; | |
| 265 | + } | |
| 266 | + } | |
| 267 | + | |
| 268 | + if(fage){ | |
| 269 | + Dlb t=new Dlb(); | |
| 270 | + t.setNbbm(y1.getNbbm()); | |
| 271 | + t.setRq(y1.getYyrq()); | |
| 272 | + t.setJsy(y1.getJsy()); | |
| 273 | + t.setCdl(y1.getJzl()); | |
| 274 | + t.setSsgsdm(y1.getGsdm()); | |
| 275 | + t.setXlbm(xlbm); | |
| 276 | + repository.save(t); | |
| 277 | + } | |
| 278 | + } | |
| 279 | + | |
| 280 | + for (int i = 0; i < jdlList.size(); i++) { | |
| 281 | + Boolean fage=true; | |
| 282 | + Jdl y1=jdlList.get(i); | |
| 283 | + for(int y=0;y<dlbList.size();y++){ | |
| 284 | + Dlb y2=dlbList.get(y); | |
| 285 | + if(y1.getNbbm().equals(y2.getNbbm())){ | |
| 286 | + fage=false; | |
| 287 | + break; | |
| 288 | + } | |
| 289 | + } | |
| 290 | + | |
| 291 | + if(fage){ | |
| 292 | + Dlb t=new Dlb(); | |
| 293 | + t.setNbbm(y1.getNbbm()); | |
| 294 | + t.setRq(y1.getRq()); | |
| 295 | +// t.setJsy(y1.getJsy()); | |
| 296 | + t.setCdl(y1.getJdl()); | |
| 297 | + t.setSsgsdm(y1.getGsBm()); | |
| 298 | + t.setXlbm(xlbm); | |
| 299 | + repository.save(t); | |
| 300 | + } | |
| 301 | + } | |
| 302 | + newMap.put("status", ResponseCode.SUCCESS); | |
| 303 | + }catch(Exception e){ | |
| 304 | + newMap.put("status", ResponseCode.ERROR); | |
| 305 | + logger.error("save erro.", e); | |
| 306 | + } | |
| 307 | + | |
| 308 | + return newMap; | |
| 309 | + } | |
| 15 | 310 | } | ... | ... |
src/main/java/com/bsth/service/oil/impl/YlbServiceImpl.java
| ... | ... | @@ -26,16 +26,19 @@ import org.springframework.stereotype.Service; |
| 26 | 26 | |
| 27 | 27 | import com.bsth.common.ResponseCode; |
| 28 | 28 | import com.bsth.data.BasicData; |
| 29 | +import com.bsth.entity.Cars; | |
| 29 | 30 | import com.bsth.entity.oil.Cyl; |
| 30 | 31 | import com.bsth.entity.oil.Ylb; |
| 31 | 32 | import com.bsth.entity.oil.Ylxxb; |
| 32 | 33 | import com.bsth.entity.search.CustomerSpecs; |
| 34 | +import com.bsth.repository.CarsRepository; | |
| 33 | 35 | import com.bsth.repository.oil.CylRepository; |
| 34 | 36 | import com.bsth.repository.oil.YlbRepository; |
| 35 | 37 | import com.bsth.repository.oil.YlxxbRepository; |
| 36 | 38 | import com.bsth.service.impl.BaseServiceImpl; |
| 37 | 39 | import com.bsth.service.oil.YlbService; |
| 38 | 40 | import com.bsth.service.realcontrol.ScheduleRealInfoService; |
| 41 | +import com.bsth.util.BatchSaveUtils; | |
| 39 | 42 | import com.github.abel533.echarts.code.Y; |
| 40 | 43 | |
| 41 | 44 | @Service |
| ... | ... | @@ -50,6 +53,9 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS |
| 50 | 53 | CylRepository cylRepository; |
| 51 | 54 | |
| 52 | 55 | @Autowired |
| 56 | + CarsRepository carsRepository; | |
| 57 | + | |
| 58 | + @Autowired | |
| 53 | 59 | ScheduleRealInfoService scheduleRealInfoService; |
| 54 | 60 | |
| 55 | 61 | @Autowired |
| ... | ... | @@ -65,92 +71,113 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS |
| 65 | 71 | */ |
| 66 | 72 | @Transactional |
| 67 | 73 | @Override |
| 68 | - public String obtainDsq() { | |
| 74 | + public String obtainDsq() throws Exception{ | |
| 69 | 75 | String result = "failure"; |
| 70 | - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); | |
| 71 | - Date dNow = new Date(); //当前时间 | |
| 72 | - Date dBefore = new Date(); | |
| 73 | - Calendar calendar = Calendar.getInstance(); //得到日历 | |
| 74 | - calendar.setTime(dNow);//把当前时间赋给日历 | |
| 75 | - calendar.add(Calendar.DAY_OF_MONTH, -1); //设置为前一天 | |
| 76 | - dBefore = calendar.getTime(); //得到前一天的时间 | |
| 77 | - String rq=sdf.format(dBefore); | |
| 78 | - //保留两位小数 | |
| 79 | - DecimalFormat df = new DecimalFormat("#.00"); | |
| 80 | - // TODO Auto-generated method stub | |
| 81 | - Map<String, Object> newMap=new HashMap<String,Object>(); | |
| 82 | - //当天YLB信息 | |
| 83 | - List<Ylb> ylList=repository.obtainYl(rq); | |
| 84 | - //当天YLXXB信息 | |
| 85 | -// List<Ylxxb> ylxxList=ylxxbRepository.obtainYlxx(rq); | |
| 86 | - //前一天所有车辆最后进场班次信息 | |
| 87 | - List<Ylb> ylListBe=repository.obtainYlbefore(rq); | |
| 88 | - List<Cyl> clyList=cylRepository.obtainCyl(); | |
| 89 | - //从排班表中计算出行驶的总里程 | |
| 90 | - List<Map<String,Object>> listpb=scheduleRealInfoService.yesterdayDataList("",rq); | |
| 91 | - | |
| 92 | - for(int x=0;x<listpb.size();x++){ | |
| 76 | + try { | |
| 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.getSfdc()); | |
| 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 | + //保留两位小数 | |
| 92 | + DecimalFormat df = new DecimalFormat("#.00"); | |
| 93 | + // TODO Auto-generated method stub | |
| 94 | + Map<String, Object> newMap=new HashMap<String,Object>(); | |
| 95 | + //当天YLB信息 | |
| 96 | + List<Ylb> ylList=repository.obtainYl(rq,"","","","","nbbm"); | |
| 97 | + //当天YLXXB信息 | |
| 98 | + // List<Ylxxb> ylxxList=ylxxbRepository.obtainYlxx(rq); | |
| 99 | + //前一天所有车辆最后进场班次信息 | |
| 100 | + List<Ylb> ylListBe=repository.obtainYlbefore(rq); | |
| 101 | + List<Cyl> clyList=cylRepository.obtainCyl("",""); | |
| 102 | + //从排班表中计算出行驶的总里程 | |
| 103 | + List<Map<String,Object>> listpb=scheduleRealInfoService.yesterdayDataList("",rq); | |
| 93 | 104 | |
| 94 | - Map<String, Object> map=listpb.get(x); | |
| 95 | - | |
| 96 | - //判断驾驶员驾驶的该车辆是否已经存入了(查出的结果集中日期是相同的,根据驾驶员、内部编号、线路编码判断) | |
| 97 | - Ylb t=new Ylb(); | |
| 98 | - for(int k=0;k<ylList.size();k++){ | |
| 99 | - Ylb t1=ylList.get(k); | |
| 100 | - if(t1.getNbbm().equals(map.get("clZbh").toString()) | |
| 101 | - &&t1.getJsy().equals(map.get("jGh").toString()) | |
| 102 | - &&t1.getXlbm().equals(map.get("xlBm").toString())) | |
| 103 | - { | |
| 104 | - t=t1; | |
| 105 | + for(int x=0;x<listpb.size();x++){ | |
| 106 | + boolean sfdc=true; | |
| 107 | + Map<String, Object> map=listpb.get(x); | |
| 108 | + if (carsMap.get(map.get("clZbh").toString())!=null) { | |
| 109 | + sfdc= carsMap.get(map.get("clZbh").toString()); | |
| 110 | + }else{ | |
| 111 | + sfdc=true; | |
| 105 | 112 | } |
| 106 | - } | |
| 107 | - try { | |
| 108 | - //当日的第一个班次,出场油量等于前一天的最后一个班次的进场油量 | |
| 109 | - if(map.get("seqNumber").toString().equals("1")){ | |
| 110 | - for (int y = 0; y < clyList.size(); y++) { | |
| 111 | - Cyl cyl=clyList.get(y); | |
| 112 | - if(map.get("clZbh").toString().equals(cyl.getNbbm())){ | |
| 113 | - t.setCzyl(cyl.getCyl()); | |
| 114 | - break; | |
| 115 | - }else{ | |
| 113 | + if(!sfdc){ | |
| 114 | + //判断驾驶员驾驶的该车辆是否已经存入了(查出的结果集中日期是相同的,根据驾驶员、内部编号、线路编码判断) | |
| 115 | + Ylb t=new Ylb(); | |
| 116 | + for(int k=0;k<ylList.size();k++){ | |
| 117 | + Ylb t1=ylList.get(k); | |
| 118 | + if(t1.getNbbm().equals(map.get("clZbh").toString()) | |
| 119 | + &&t1.getJsy().equals(map.get("jGh").toString()) | |
| 120 | + &&t1.getXlbm().equals(map.get("xlBm").toString())) | |
| 121 | + { | |
| 122 | + t=t1; | |
| 123 | + } | |
| 124 | + } | |
| 125 | + | |
| 126 | + //当日的第一个班次,出场油量等于前一天的最后一个班次的进场油量 | |
| 127 | + if(map.get("seqNumber").toString().equals("1")){ | |
| 128 | + boolean fage=true; | |
| 116 | 129 | for (int i = 0; i < ylListBe.size(); i++) { |
| 117 | 130 | Ylb ylb=ylListBe.get(i); |
| 118 | 131 | if(map.get("clZbh").toString().equals(ylb.getNbbm())){ |
| 119 | - t.setCzyl(ylb.getJzyl()); | |
| 120 | - break; | |
| 121 | - }else{ | |
| 122 | - t.setCzyl(0.0); | |
| 132 | + if(ylb.getJzyl()>0){ | |
| 133 | + t.setCzyl(ylb.getJzyl()); | |
| 134 | + fage=false; | |
| 135 | + break; | |
| 136 | + } | |
| 137 | + } | |
| 138 | + } | |
| 139 | + if(fage){ | |
| 140 | + for (int y = 0; y < clyList.size(); y++) { | |
| 141 | + Cyl cyl=clyList.get(y); | |
| 142 | + if(map.get("clZbh").toString().equals(cyl.getNbbm())){ | |
| 143 | + t.setCzyl(cyl.getCyl()); | |
| 144 | + fage=false; | |
| 145 | + break; | |
| 146 | + } | |
| 123 | 147 | } |
| 124 | 148 | } |
| 149 | + if(fage){ | |
| 150 | + t.setCzyl(0.0); | |
| 151 | + } | |
| 125 | 152 | } |
| 126 | - } | |
| 127 | - } | |
| 153 | + | |
| 154 | + /*Double jzl=0.0; | |
| 155 | + //把当天的YLXXB的加注量设置为当天YLB的加注量(根据车号,驾驶员判断) | |
| 156 | + for(int j=0;j<ylxxList.size();j++){ | |
| 157 | + Ylxxb ylxxb= ylxxList.get(j); | |
| 158 | + if(map.get("clZbh").toString().equals(ylxxb.getNbbm()) &&map.get("jGh").toString().equals(ylxxb.getJsy())){ | |
| 159 | + jzl+=ylxxb.getJzl(); | |
| 160 | + } | |
| 161 | + } | |
| 162 | + t.setJzl(jzl);*/ | |
| 163 | + t.setNbbm(map.get("clZbh").toString()); | |
| 164 | + t.setJsy(map.get("jGh")==null?"":map.get("jGh").toString()); | |
| 165 | + t.setZlc(map.get("totalKilometers")==null?0.0:Double.parseDouble(df.format(Double.parseDouble(map.get("totalKilometers").toString())))); | |
| 166 | + t.setXlbm(map.get("xlBm")==null?"":map.get("xlBm").toString()); | |
| 167 | + t.setJcsx(Integer.parseInt(map.get("seqNumber").toString())); | |
| 168 | + t.setSsgsdm(map.get("company")==null?"":map.get("company").toString()); | |
| 169 | + t.setFgsdm(map.get("bCompany")==null?"":map.get("bCompany").toString()); | |
| 170 | + t.setRq(sdf.parse(rq)); | |
| 171 | + repository.save(t); | |
| 128 | 172 | |
| 129 | - /*Double jzl=0.0; | |
| 130 | - //把当天的YLXXB的加注量设置为当天YLB的加注量(根据车号,驾驶员判断) | |
| 131 | - for(int j=0;j<ylxxList.size();j++){ | |
| 132 | - Ylxxb ylxxb= ylxxList.get(j); | |
| 133 | - if(map.get("clZbh").toString().equals(ylxxb.getNbbm()) &&map.get("jGh").toString().equals(ylxxb.getJsy())){ | |
| 134 | - jzl+=ylxxb.getJzl(); | |
| 135 | - } | |
| 136 | - } | |
| 137 | - t.setJzl(jzl);*/ | |
| 138 | - t.setNbbm(map.get("clZbh").toString()); | |
| 139 | - t.setJsy(map.get("jGh")==null?"":map.get("jGh").toString()); | |
| 140 | - t.setZlc(map.get("totalKilometers")==null?0.0:Double.parseDouble(df.format(Double.parseDouble(map.get("totalKilometers").toString())))); | |
| 141 | - t.setXlbm(map.get("xlBm")==null?"":map.get("xlBm").toString()); | |
| 142 | - t.setJcsx(Integer.parseInt(map.get("seqNumber").toString())); | |
| 143 | - t.setSsgsdm(map.get("company")==null?"":map.get("company").toString()); | |
| 144 | - t.setFgsdm(map.get("bCompany")==null?"":map.get("bCompany").toString()); | |
| 145 | - t.setRq(sdf.parse(rq)); | |
| 146 | - repository.save(t); | |
| 147 | - result = "success"; | |
| 148 | - } catch (Exception e) { | |
| 149 | - // TODO Auto-generated catch block | |
| 150 | - e.printStackTrace(); | |
| 151 | - }finally{ | |
| 152 | - logger.info("setDDRB:"+result); | |
| 153 | 173 | } |
| 174 | + result = "success"; | |
| 175 | + } | |
| 176 | + }catch (Exception e) { | |
| 177 | + // TODO Auto-generated catch block | |
| 178 | + throw e; | |
| 179 | + }finally{ | |
| 180 | + logger.info("setDDRB:"+result); | |
| 154 | 181 | } |
| 155 | 182 | |
| 156 | 183 | return result; |
| ... | ... | @@ -162,91 +189,152 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS |
| 162 | 189 | */ |
| 163 | 190 | @Transactional |
| 164 | 191 | @Override |
| 165 | - public Map<String, Object> obtain(Map<String, Object> map2) { | |
| 166 | - String rq=map2.get("rq").toString(); | |
| 167 | - String line=""; | |
| 168 | - if(map2.get("xlbm_eq")!=null){ | |
| 169 | - line=map2.get("xlbm_eq").toString(); | |
| 170 | - } | |
| 171 | - | |
| 172 | - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); | |
| 173 | - //保留两位小数 | |
| 174 | - DecimalFormat df = new DecimalFormat("#.00"); | |
| 175 | - // TODO Auto-generated method stub | |
| 176 | - Map<String, Object> newMap=new HashMap<String,Object>(); | |
| 177 | - //当天YLB信息 | |
| 178 | - List<Ylb> ylList=repository.obtainYl(rq); | |
| 179 | - //当天YLXXB信息 | |
| 180 | - List<Ylxxb> ylxxList=ylxxbRepository.obtainYlxx(rq); | |
| 181 | - //前一天所有车辆最后进场班次信息 | |
| 182 | - List<Ylb> ylListBe=repository.obtainYlbefore(rq); | |
| 183 | - List<Cyl> clyList=cylRepository.obtainCyl(); | |
| 184 | - //从排班表中计算出行驶的总里程 | |
| 185 | - List<Map<String,Object>> listpb=scheduleRealInfoService.yesterdayDataList(line,rq); | |
| 186 | - | |
| 187 | - for(int x=0;x<listpb.size();x++){ | |
| 188 | - | |
| 189 | - Map<String, Object> map=listpb.get(x); | |
| 190 | - | |
| 191 | - //判断驾驶员驾驶的该车辆是否已经存入了(查出的结果集中日期是相同的,根据驾驶员、内部编号、线路编码判断) | |
| 192 | - Ylb t=new Ylb(); | |
| 193 | - for(int k=0;k<ylList.size();k++){ | |
| 194 | - Ylb t1=ylList.get(k); | |
| 195 | - if(t1.getNbbm().equals(map.get("clZbh").toString()) | |
| 196 | - &&t1.getJsy().equals(map.get("jGh").toString()) | |
| 197 | - &&t1.getXlbm().equals(map.get("xlBm").toString())) | |
| 198 | - { | |
| 199 | - t=t1; | |
| 200 | - } | |
| 192 | + public Map<String, Object> obtain(Map<String, Object> map2) throws Exception{ | |
| 193 | + Map<String, Object> newMap = new HashMap<String, Object>(); | |
| 194 | + try { | |
| 195 | + List<Cars> carsList = carsRepository.findCars(); | |
| 196 | + Map<String, Boolean> carsMap = new HashMap<String, Boolean>(); | |
| 197 | + for (int i = 0; i < carsList.size(); i++) { | |
| 198 | + Cars c = carsList.get(i); | |
| 199 | + carsMap.put(c.getInsideCode(), c.getSfdc()); | |
| 201 | 200 | } |
| 202 | - try { | |
| 203 | - //当日的第一个班次,出场油量等于前一天的最后一个班次的进场油量 | |
| 204 | - if(map.get("seqNumber").toString().equals("1")){ | |
| 205 | - for (int y = 0; y < clyList.size(); y++) { | |
| 206 | - Cyl cyl=clyList.get(y); | |
| 207 | - if(map.get("clZbh").toString().equals(cyl.getNbbm())){ | |
| 208 | - t.setCzyl(cyl.getCyl()); | |
| 209 | - break; | |
| 210 | - }else{ | |
| 211 | - for (int i = 0; i < ylListBe.size(); i++) { | |
| 212 | - Ylb ylb=ylListBe.get(i); | |
| 213 | - if(map.get("clZbh").toString().equals(ylb.getNbbm())){ | |
| 201 | + String rq = map2.get("rq").toString(); | |
| 202 | + String line = ""; | |
| 203 | + if (map2.get("xlbm_like") != null) { | |
| 204 | + line = map2.get("xlbm_like").toString().trim(); | |
| 205 | + } | |
| 206 | + String gsbm=""; | |
| 207 | + if(map2.get("ssgsdm_like")!=null){ | |
| 208 | + gsbm=map2.get("ssgsdm_like").toString(); | |
| 209 | + } | |
| 210 | + String fgsbm=""; | |
| 211 | + if(map2.get("fgsdm_like")!=null){ | |
| 212 | + fgsbm=map2.get("fgsdm_like").toString(); | |
| 213 | + } | |
| 214 | + String nbbm=""; | |
| 215 | + if(map2.get("nbbm_eq")!=null){ | |
| 216 | + nbbm=map2.get("nbbm_eq").toString(); | |
| 217 | + } | |
| 218 | + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); | |
| 219 | + // 保留两位小数 | |
| 220 | + DecimalFormat df = new DecimalFormat("#.00"); | |
| 221 | + // TODO Auto-generated method stub | |
| 222 | + // 当天YLB信息 | |
| 223 | + List<Ylb> ylList = repository.obtainYl(rq,gsbm,fgsbm,line,nbbm,"nbbm"); | |
| 224 | + // 当天YLXXB信息 | |
| 225 | + List<Ylxxb> ylxxList = ylxxbRepository.obtainYlxx(rq, 0); | |
| 226 | + // 前一天所有车辆最后进场班次信息 | |
| 227 | + List<Ylb> ylListBe = repository.obtainYlbefore(rq); | |
| 228 | + List<Cyl> clyList = cylRepository.obtainCyl(nbbm,gsbm); | |
| 229 | + // 从排班表中计算出行驶的总里程 | |
| 230 | + List<Map<String, Object>> listpb = scheduleRealInfoService.yesterdayDataList(line, rq); | |
| 231 | + List<Ylb> addList = new ArrayList<Ylb>(); | |
| 232 | + List<Ylb> updateList = new ArrayList<Ylb>(); | |
| 233 | + for (int x = 0; x < listpb.size(); x++) { | |
| 234 | + String type = "add"; | |
| 235 | + boolean sfdc = true; | |
| 236 | + Map<String, Object> map = listpb.get(x); | |
| 237 | + if (carsMap.get(map.get("clZbh").toString()) != null) { | |
| 238 | + sfdc = carsMap.get(map.get("clZbh").toString()); | |
| 239 | + } else { | |
| 240 | + sfdc = true; | |
| 241 | + } | |
| 242 | + if (!sfdc) { | |
| 243 | + // 判断驾驶员驾驶的该车辆是否已经存入了(查出的结果集中日期是相同的,根据驾驶员、内部编号、线路编码判断) | |
| 244 | + Ylb t = new Ylb(); | |
| 245 | + for (int k = 0; k < ylList.size(); k++) { | |
| 246 | + Ylb t1 = ylList.get(k); | |
| 247 | + if (t1.getNbbm().equals(map.get("clZbh").toString()) | |
| 248 | + && t1.getJsy().equals(map.get("jGh").toString()) | |
| 249 | + && t1.getXlbm().equals(map.get("xlBm").toString())) { | |
| 250 | + t = t1; | |
| 251 | + type = "update"; | |
| 252 | + } | |
| 253 | + } | |
| 254 | + | |
| 255 | + // 当日的第一个班次,出场油量等于前一天的最后一个班次的进场油量 | |
| 256 | + if (map.get("seqNumber").toString().equals("1")) { | |
| 257 | + boolean fage = true; | |
| 258 | + for (int i = 0; i < ylListBe.size(); i++) { | |
| 259 | + Ylb ylb = ylListBe.get(i); | |
| 260 | + if (map.get("clZbh").toString().equals(ylb.getNbbm())) { | |
| 261 | + if(ylb.getJzyl()>0){ | |
| 214 | 262 | t.setCzyl(ylb.getJzyl()); |
| 263 | + fage = false; | |
| 215 | 264 | break; |
| 216 | - }else{ | |
| 217 | - t.setCzyl(0.0); | |
| 218 | 265 | } |
| 266 | + | |
| 219 | 267 | } |
| 220 | 268 | } |
| 269 | + if (fage) { | |
| 270 | + for (int y = 0; y < clyList.size(); y++) { | |
| 271 | + Cyl cyl = clyList.get(y); | |
| 272 | + if (map.get("clZbh").toString().equals(cyl.getNbbm())) { | |
| 273 | + if(cyl.getCyl()>0){ | |
| 274 | + t.setCzyl(cyl.getCyl()); | |
| 275 | + fage = false; | |
| 276 | + break; | |
| 277 | + }else { | |
| 278 | + if(cyl.getCxrl()!=null){ | |
| 279 | + if(cyl.getCxrl()>0){ | |
| 280 | + t.setCzyl(cyl.getCxrl()); | |
| 281 | + fage = false; | |
| 282 | + break; | |
| 283 | + } | |
| 284 | + } | |
| 285 | + | |
| 286 | + } | |
| 287 | + | |
| 288 | + } | |
| 289 | + } | |
| 290 | + } | |
| 291 | + if (fage) { | |
| 292 | + t.setCzyl(0.0); | |
| 293 | + } | |
| 221 | 294 | } |
| 222 | - } | |
| 223 | - | |
| 224 | - Double jzl=0.0; | |
| 225 | - //把当天的YLXXB的加注量设置为当天YLB的加注量(根据车号,驾驶员判断) | |
| 226 | - for(int j=0;j<ylxxList.size();j++){ | |
| 227 | - Ylxxb ylxxb= ylxxList.get(j); | |
| 228 | - if(map.get("clZbh").toString().equals(ylxxb.getNbbm()) &&map.get("jGh").toString().equals(ylxxb.getJsy())){ | |
| 229 | - jzl+=ylxxb.getJzl(); | |
| 295 | + | |
| 296 | + Double jzl = 0.0; | |
| 297 | + // 把当天的YLXXB的加注量设置为当天YLB的加注量(根据车号,驾驶员判断) | |
| 298 | + for (int j = 0; j < ylxxList.size(); j++) { | |
| 299 | + Ylxxb ylxxb = ylxxList.get(j); | |
| 300 | + if (map.get("clZbh").toString().equals(ylxxb.getNbbm()) | |
| 301 | + && map.get("jGh").toString().equals(ylxxb.getJsy())) { | |
| 302 | + jzl += ylxxb.getJzl(); | |
| 303 | + } | |
| 230 | 304 | } |
| 305 | + t.setJzl(jzl); | |
| 306 | + t.setNbbm(map.get("clZbh").toString()); | |
| 307 | + t.setJsy(map.get("jGh") == null ? "" : map.get("jGh").toString()); | |
| 308 | + t.setZlc(map.get("totalKilometers") == null ? 0.0 | |
| 309 | + : Double.parseDouble(df.format(Double.parseDouble(map.get("totalKilometers").toString())))); | |
| 310 | + t.setXlbm(map.get("xlBm") == null ? "" : map.get("xlBm").toString()); | |
| 311 | + t.setJcsx(Integer.parseInt(map.get("seqNumber").toString())); | |
| 312 | + t.setSsgsdm(map.get("company") == null ? "" : map.get("company").toString()); | |
| 313 | + t.setFgsdm(map.get("bCompany") == null ? "" : map.get("bCompany").toString()); | |
| 314 | + t.setRq(sdf.parse(rq)); | |
| 315 | + /* | |
| 316 | + * if(type.equals("add")){ addList.add(t); }else{ | |
| 317 | + * updateList.add(t); } | |
| 318 | + */ | |
| 319 | + repository.save(t); | |
| 320 | + newMap.put("status", ResponseCode.SUCCESS); | |
| 321 | + | |
| 231 | 322 | } |
| 232 | - t.setJzl(jzl); | |
| 233 | - t.setNbbm(map.get("clZbh").toString()); | |
| 234 | - t.setJsy(map.get("jGh")==null?"":map.get("jGh").toString()); | |
| 235 | - t.setZlc(map.get("totalKilometers")==null?0.0:Double.parseDouble(df.format(Double.parseDouble(map.get("totalKilometers").toString())))); | |
| 236 | - t.setXlbm(map.get("xlBm")==null?"":map.get("xlBm").toString()); | |
| 237 | - t.setJcsx(Integer.parseInt(map.get("seqNumber").toString())); | |
| 238 | - t.setSsgsdm(map.get("company")==null?"":map.get("company").toString()); | |
| 239 | - t.setFgsdm(map.get("bCompany")==null?"":map.get("bCompany").toString()); | |
| 240 | - t.setRq(sdf.parse(rq)); | |
| 241 | - repository.save(t); | |
| 242 | - newMap.put("status", ResponseCode.SUCCESS); | |
| 243 | - } catch (ParseException e) { | |
| 244 | - // TODO Auto-generated catch block | |
| 245 | - newMap.put("status", ResponseCode.ERROR); | |
| 246 | - e.printStackTrace(); | |
| 247 | 323 | } |
| 324 | + } catch (ParseException e) { | |
| 325 | + // TODO Auto-generated catch block | |
| 326 | + newMap.put("status", ResponseCode.ERROR); | |
| 327 | + throw e; | |
| 248 | 328 | } |
| 249 | - | |
| 329 | + /* | |
| 330 | + * try { if(addList.size()>0){ new | |
| 331 | + * BatchSaveUtils<Ylb>().saveList(addList, Ylb.class); } | |
| 332 | + * | |
| 333 | + * if(updateList.size()>0){ | |
| 334 | + * | |
| 335 | + * } newMap.put("status", ResponseCode.SUCCESS); } catch (Exception e) { | |
| 336 | + * // TODO: handle exception newMap.put("status", ResponseCode.ERROR); } | |
| 337 | + */ | |
| 250 | 338 | return newMap; |
| 251 | 339 | } |
| 252 | 340 | |
| ... | ... | @@ -256,104 +344,121 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS |
| 256 | 344 | */ |
| 257 | 345 | @Transactional |
| 258 | 346 | @Override |
| 259 | - public Map<String, Object> outAndIn(Map<String, Object> map){ | |
| 347 | + public Map<String, Object> outAndIn(Map<String, Object> map) throws Exception{ | |
| 260 | 348 | // TODO Auto-generated method stub |
| 349 | + String xlbm=""; | |
| 350 | + if(map.get("xlbm_like")!=null){ | |
| 351 | + xlbm= map.get("xlbm_like").toString().trim(); | |
| 352 | + } | |
| 353 | + String gsbm=""; | |
| 354 | + if(map.get("ssgsdm_like")!=null){ | |
| 355 | + gsbm=map.get("ssgsdm_like").toString(); | |
| 356 | + } | |
| 357 | + String fgsbm=""; | |
| 358 | + if(map.get("fgsdm_like")!=null){ | |
| 359 | + fgsbm=map.get("fgsdm_like").toString(); | |
| 360 | + } | |
| 361 | + String rq = map.get("rq").toString(); | |
| 362 | + String nbbm=""; | |
| 363 | + if(map.get("nbbm_eq")!=null){ | |
| 364 | + nbbm=map.get("nbbm_eq").toString(); | |
| 365 | + } | |
| 366 | + | |
| 261 | 367 | Map<String, Object> newMap=new HashMap<String,Object>(); |
| 262 | 368 | Map<String, Object> map2=new HashMap<String,Object>(); |
| 263 | - String rq=map.get("rq").toString(); | |
| 264 | - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); | |
| 265 | - | |
| 266 | 369 | try { |
| 370 | + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); | |
| 371 | + | |
| 267 | 372 | map.put("rq_eq", sdf.parse(rq)); |
| 268 | - } catch (ParseException e1) { | |
| 269 | - // TODO Auto-generated catch block | |
| 270 | - e1.printStackTrace(); | |
| 271 | - } | |
| 272 | - //获取车辆存油信息 | |
| 273 | - List<Cyl> cylList=cylRepository.findAll(new CustomerSpecs<Cyl>(newMap)); | |
| 274 | - //指定日期YLB信息 | |
| 275 | - Iterator<Ylb> iterator= repository.findAll(new CustomerSpecs<Ylb>(map)).iterator(); | |
| 276 | - while(iterator.hasNext()){ | |
| 277 | - Ylb ylb=iterator.next(); | |
| 278 | - //判断是否已经计算过 | |
| 279 | - if(newMap.get("nbbm"+ylb.getNbbm())==null){ | |
| 280 | - String nbbm_eq=ylb.getNbbm(); | |
| 281 | - Date rq_eq=ylb.getRq(); | |
| 282 | - //得到一天总的加油和里程(根据车,时间) | |
| 283 | - List<Object[]> sumList=repository.sumLcYl(nbbm_eq, rq_eq); | |
| 284 | - //保存总的加油量 | |
| 285 | - Double jzl=Double.valueOf(sumList.get(0)[0].toString()); | |
| 286 | - //保存总的里程 | |
| 287 | - Double zlc=Double.valueOf(sumList.get(0)[1].toString()); | |
| 288 | - //保留两位小数 | |
| 289 | - DecimalFormat df = new DecimalFormat("#.00"); | |
| 290 | - Double zyl=0.0; | |
| 291 | - Double nextJzyl=0.0; | |
| 373 | +// List<Cyl> clyList = cylRepository.obtainCyl(); | |
| 374 | + // 获取车辆存油信息 | |
| 375 | + List<Cyl> cylList = cylRepository.obtainCyl(nbbm,gsbm); | |
| 376 | + // 指定日期YLB信息 | |
| 377 | + List<Ylb> ylbList =repository.obtainYl(rq,gsbm,fgsbm,xlbm,nbbm,"nbbm"); | |
| 378 | + List<Ylb> iterator2=repository.obtainYl(rq,gsbm,fgsbm,xlbm,nbbm,"jcsx"); | |
| 379 | + for (int i=0;i<ylbList.size();i++) { | |
| 380 | + Ylb ylb = ylbList.get(i); | |
| 381 | + // 判断是否已经计算过 | |
| 382 | + if (newMap.get("nbbm" + ylb.getNbbm()) == null) { | |
| 383 | + String nbbm_eq = ylb.getNbbm(); | |
| 384 | + Date rq_eq = ylb.getRq(); | |
| 385 | + // 得到一天总的加油和里程(根据车,时间) | |
| 386 | + List<Object[]> sumList = repository.sumLcYl(nbbm_eq, rq_eq); | |
| 387 | + // 保存总的加油量 | |
| 388 | + Double jzl = Double.valueOf(sumList.get(0)[0].toString()); | |
| 389 | + // 保存总的里程 | |
| 390 | + Double zlc = Double.valueOf(sumList.get(0)[1].toString()); | |
| 292 | 391 | |
| 293 | - //保存已经计算过的车辆,相同车辆编号的车不在计算 | |
| 294 | - newMap.put("nbbm"+ylb.getNbbm(), ylb.getNbbm()); | |
| 392 | + Double zsh = Double.valueOf(sumList.get(0)[2].toString()); | |
| 295 | 393 | |
| 296 | - //查询指定车辆,设置进、存、耗油量 | |
| 394 | + jzl=jzl-zsh; | |
| 395 | + // 保留两位小数 | |
| 396 | + DecimalFormat df = new DecimalFormat("#.00"); | |
| 397 | + Double zyl = 0.0; | |
| 398 | + Double nextJzyl = 0.0; | |
| 399 | + // 保存已经计算过的车辆,相同车辆编号的车不在计算 | |
| 400 | + newMap.put("nbbm" + ylb.getNbbm(), ylb.getNbbm()); | |
| 401 | + | |
| 402 | + // 查询指定车辆,设置进、存、耗油量 | |
| 297 | 403 | map.remove("nbbm_eq"); |
| 298 | 404 | map.put("nbbm_eq", ylb.getNbbm()); |
| 299 | - Iterator<Ylb> iterator2= repository.findAll(new CustomerSpecs<Ylb>(map),new Sort(Direction.ASC, "jcsx")).iterator(); | |
| 300 | - while(iterator2.hasNext()){ | |
| 301 | - try{ | |
| 302 | - Ylb t = iterator2.next(); | |
| 303 | - if(t.getJcsx()==1){ | |
| 304 | - //进场等于出场的操作 既 最后进场存油量等于第一次的出场存油量 | |
| 305 | - Double yl=t.getCzyl(); | |
| 306 | - Double jcyl=t.getCzyl(); | |
| 307 | - zyl=jcyl+jzl-yl; | |
| 308 | - Double yh=Double.parseDouble(df.format(zyl*(t.getZlc()/zlc))); | |
| 405 | + map.put("xlbm_like", ylb.getXlbm()); | |
| 406 | +// Iterator<Ylb> iterator2 = repository | |
| 407 | +// .findAll(new CustomerSpecs<Ylb>(map), new Sort(Direction.ASC, "jcsx")).iterator(); | |
| 408 | + for (int j = 0; j < iterator2.size(); j++) { | |
| 409 | + | |
| 410 | + Ylb t = iterator2.get(j); | |
| 411 | + if(t.getNbbm().equals(ylb.getNbbm())){ | |
| 412 | + if (t.getJcsx() == 1) { | |
| 413 | + // 进场等于出场的操作 既 最后进场存油量等于第一次的出场存油量 | |
| 414 | + Double yl = t.getCzyl(); | |
| 415 | + Double jcyl = t.getCzyl(); | |
| 416 | + zyl = jcyl + jzl - yl; | |
| 417 | + Double yh = Double.parseDouble(df.format(zyl * (t.getZlc() / zlc))); | |
| 309 | 418 | t.setYh(yh); |
| 310 | - nextJzyl=t.getJzl()+t.getCzyl()-yh; | |
| 419 | + nextJzyl = t.getJzl() + t.getCzyl() - yh; | |
| 311 | 420 | t.setJzyl(Double.parseDouble(df.format(nextJzyl))); |
| 312 | - }else{ | |
| 421 | + } else { | |
| 313 | 422 | t.setCzyl(Double.parseDouble(df.format(nextJzyl))); |
| 314 | - Double yh=Double.parseDouble(df.format(zyl*(t.getZlc()/zlc))); | |
| 423 | + Double yh = Double.parseDouble(df.format(zyl * (t.getZlc() / zlc))); | |
| 315 | 424 | t.setYh(yh); |
| 316 | - nextJzyl=t.getJzl()+nextJzyl-yh; | |
| 425 | + nextJzyl = t.getJzl() + nextJzyl - yh; | |
| 317 | 426 | t.setJzyl(Double.parseDouble(df.format(nextJzyl))); |
| 318 | 427 | } |
| 319 | - | |
| 320 | 428 | repository.save(t); |
| 321 | - //设置存油量 | |
| 322 | - Cyl cyl=null; | |
| 323 | - boolean fage=false; | |
| 324 | - for(int z=0;z<cylList.size();z++){ | |
| 325 | - cyl=cylList.get(z); | |
| 326 | - if(t.getNbbm().equals(cyl.getNbbm())){ | |
| 327 | - cyl.setCyl(t.getJzyl()); | |
| 328 | - cyl.setUpdatetime(t.getRq()); | |
| 329 | - fage=true; | |
| 330 | - break; | |
| 331 | - } | |
| 332 | - } | |
| 333 | - | |
| 334 | - if(fage){ | |
| 335 | - cylRepository.save(cyl); | |
| 336 | - }else{ | |
| 337 | - cyl=new Cyl(); | |
| 338 | - cyl.setNbbm(t.getNbbm()); | |
| 429 | + } | |
| 430 | + | |
| 431 | + // 设置存油量 | |
| 432 | + Cyl cyl = null; | |
| 433 | + boolean fage = false; | |
| 434 | + for (int z = 0; z < cylList.size(); z++) { | |
| 435 | + cyl = cylList.get(z); | |
| 436 | + if (t.getNbbm().equals(cyl.getNbbm())) { | |
| 339 | 437 | cyl.setCyl(t.getJzyl()); |
| 340 | - cyl.setGsdm(t.getSsgsdm()); | |
| 341 | 438 | cyl.setUpdatetime(t.getRq()); |
| 342 | - cylRepository.save(cyl); | |
| 439 | + fage = true; | |
| 440 | + break; | |
| 343 | 441 | } |
| 344 | - | |
| 345 | - | |
| 346 | - map2.put("status", ResponseCode.SUCCESS); | |
| 347 | - }catch(Exception e){ | |
| 348 | - map2.put("status", ResponseCode.ERROR); | |
| 349 | - logger.error("save erro.", e); | |
| 350 | 442 | } |
| 443 | + if (fage) { | |
| 444 | + cylRepository.save(cyl); | |
| 445 | + } else { | |
| 446 | + cyl = new Cyl(); | |
| 447 | + cyl.setNbbm(t.getNbbm()); | |
| 448 | + cyl.setCyl(t.getJzyl()); | |
| 449 | + cyl.setGsdm(t.getSsgsdm()); | |
| 450 | + cyl.setUpdatetime(t.getRq()); | |
| 451 | + cylRepository.save(cyl); | |
| 452 | + } | |
| 453 | + map2.put("status", ResponseCode.SUCCESS); | |
| 351 | 454 | } |
| 352 | - | |
| 353 | - | |
| 354 | 455 | } |
| 456 | + } | |
| 457 | + } catch (Exception e) { | |
| 458 | + map2.put("status", ResponseCode.ERROR); | |
| 459 | + logger.error("save erro.", e); | |
| 460 | + throw e; | |
| 355 | 461 | } |
| 356 | - | |
| 357 | 462 | return map2; |
| 358 | 463 | } |
| 359 | 464 | |
| ... | ... | @@ -365,82 +470,107 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS |
| 365 | 470 | public Map<String, Object> sort(Map<String, Object> map) { |
| 366 | 471 | // TODO Auto-generated method stub |
| 367 | 472 | Map<String, Object> newMap = new HashMap<String, Object>(); |
| 368 | - //获取车辆存油信息 | |
| 369 | - List<Cyl> cylList=cylRepository.findAll(new CustomerSpecs<Cyl>(newMap)); | |
| 370 | - int id=Integer.parseInt(map.get("id").toString()); | |
| 371 | - //最后存油量 | |
| 372 | - Double yl=Double.parseDouble(map.get("jzyl").toString()); | |
| 373 | - Ylb ylb=repository.findOne(id); | |
| 374 | - String nbbm_eq=ylb.getNbbm(); | |
| 375 | - Date rq_eq=ylb.getRq(); | |
| 376 | - //得到一天总的加油和里程(根据车,时间) | |
| 377 | - List<Object[]> sumList=repository.sumLcYl(nbbm_eq, rq_eq); | |
| 378 | - //保存总的加油量 | |
| 379 | - Double jzl=Double.valueOf(sumList.get(0)[0].toString()); | |
| 380 | - //保存总的里程 | |
| 381 | - Double zlc=Double.valueOf(sumList.get(0)[1].toString()); | |
| 382 | - map.put("nbbm_eq", nbbm_eq); | |
| 383 | - map.put("rq_eq",rq_eq); | |
| 384 | - Iterator<Ylb> iterator= repository.findAll(new CustomerSpecs<Ylb>(map),new Sort(Direction.ASC, "jcsx")).iterator(); | |
| 385 | - //根据jcyl排序1为该车当日第一个出场,出场油量为前一天的存油 | |
| 386 | - //保留两位小数 | |
| 387 | - DecimalFormat df = new DecimalFormat("#.00"); | |
| 388 | - Double zyl=0.0; | |
| 389 | - Double nextJzyl=0.0; | |
| 390 | - //车的,进,出油量及耗油 | |
| 391 | - while(iterator.hasNext()){ | |
| 392 | - try{ | |
| 393 | - Ylb t = iterator.next(); | |
| 394 | - if(t.getJcsx()==1){ | |
| 395 | - Double jcyl=t.getCzyl(); | |
| 396 | - zyl=jcyl+jzl-yl; | |
| 397 | - Double yh=0.0; | |
| 398 | - if(zlc>0&&t.getZlc()>0){ | |
| 399 | - yh=Double.parseDouble(df.format(zyl*(t.getZlc()/zlc))); | |
| 473 | + SimpleDateFormat sdf =new SimpleDateFormat("yyyy-MM-dd"); | |
| 474 | + try { | |
| 475 | + // 获取车辆存油信息 | |
| 476 | + List<Cyl> cylList = cylRepository.findAll(new CustomerSpecs<Cyl>(newMap)); | |
| 477 | + int id = Integer.parseInt(map.get("id").toString()); | |
| 478 | + // 最后存油量 | |
| 479 | + Double yl = Double.parseDouble(map.get("jzyl").toString()); | |
| 480 | + Double sh= Double.parseDouble(map.get("sh").toString()); | |
| 481 | + String shyy=map.get("shyy").toString(); | |
| 482 | + Ylb ylb = repository.findOne(id); | |
| 483 | + | |
| 484 | + String nbbm_eq = ylb.getNbbm(); | |
| 485 | + Date rq_eq = ylb.getRq(); | |
| 486 | + // 得到一天总的加油和里程(根据车,时间) | |
| 487 | + List<Object[]> sumList = repository.sumLcYl(nbbm_eq, rq_eq); | |
| 488 | + // 保存总的加油量 | |
| 489 | + Double jzl = Double.valueOf(sumList.get(0)[0].toString()); | |
| 490 | + // 保存总的里程 | |
| 491 | + Double zlc = Double.valueOf(sumList.get(0)[1].toString()); | |
| 492 | + // 保存总的损耗 | |
| 493 | + Double zsh = Double.valueOf(sumList.get(0)[2].toString()); | |
| 494 | + | |
| 495 | + //新的 损耗不等于 旧的损耗 总损耗从新算 | |
| 496 | + if(ylb.getSh() - sh >0.0000001 || ylb.getSh()-sh <0.00000001){ | |
| 497 | + zsh =zsh-ylb.getSh()+sh; | |
| 498 | + jzl =jzl-zsh; | |
| 499 | + }else{ | |
| 500 | + jzl=jzl-zsh; | |
| 501 | + } | |
| 502 | + map.put("nbbm_eq", nbbm_eq); | |
| 503 | + map.put("rq_eq", rq_eq); | |
| 504 | + List<Ylb> iterator2=repository.obtainYl(sdf.format(rq_eq),ylb.getSsgsdm(),ylb.getFgsdm(),ylb.getXlbm(), | |
| 505 | + ylb.getNbbm(),"jcsx"); | |
| 506 | +// Iterator<Ylb> iterator = repository.findAll(new CustomerSpecs<Ylb>(map), new Sort(Direction.ASC, "jcsx")) | |
| 507 | +// .iterator(); | |
| 508 | + // 根据jcyl排序1为该车当日第一个出场,出场油量为前一天的存油 | |
| 509 | + // 保留两位小数 | |
| 510 | + DecimalFormat df = new DecimalFormat("#.00"); | |
| 511 | + Double zyl = 0.0; | |
| 512 | + Double nextJzyl = 0.0; | |
| 513 | + // 车的,进,出油量及耗油 | |
| 514 | + for (int i = 0; i < iterator2.size(); i++) { | |
| 515 | + Ylb t = iterator2.get(i); | |
| 516 | + if (t.getJcsx() == 1) { | |
| 517 | + if(t.getId()==id){ | |
| 518 | + t.setSh(sh); | |
| 519 | + t.setShyy(shyy); | |
| 520 | + } | |
| 521 | + Double jcyl = t.getCzyl(); | |
| 522 | + zyl = jcyl + jzl - yl; | |
| 523 | + Double yh = 0.0; | |
| 524 | + if (zlc > 0 && t.getZlc() > 0) { | |
| 525 | + yh = Double.parseDouble(df.format(zyl * (t.getZlc() / zlc))); | |
| 400 | 526 | } |
| 401 | 527 | t.setYh(yh); |
| 402 | - nextJzyl=t.getJzl()+t.getCzyl()-yh; | |
| 528 | + nextJzyl = t.getJzl() + t.getCzyl() - yh-t.getSh(); | |
| 403 | 529 | t.setJzyl(Double.parseDouble(df.format(nextJzyl))); |
| 404 | - }else{ | |
| 405 | - if(t.getZlc()!=0){ | |
| 530 | + } else { | |
| 531 | + if(t.getId()==id){ | |
| 532 | + t.setSh(sh); | |
| 533 | + t.setShyy(shyy); | |
| 534 | + } | |
| 535 | + if (t.getZlc() != 0) { | |
| 406 | 536 | t.setCzyl(Double.parseDouble(df.format(nextJzyl))); |
| 407 | - Double yh=Double.parseDouble(df.format(zyl*(t.getZlc()/zlc))); | |
| 537 | + Double yh = Double.parseDouble(df.format(zyl * (t.getZlc() / zlc))); | |
| 408 | 538 | t.setYh(yh); |
| 409 | - nextJzyl=t.getJzl()+nextJzyl-yh; | |
| 539 | + nextJzyl = t.getJzl() + nextJzyl - yh-t.getSh(); | |
| 410 | 540 | t.setJzyl(Double.parseDouble(df.format(nextJzyl))); |
| 411 | 541 | } |
| 412 | - | |
| 542 | + | |
| 413 | 543 | } |
| 414 | 544 | repository.save(t); |
| 415 | - | |
| 416 | - //设置存油量 | |
| 417 | - Cyl cyl=null; | |
| 418 | - boolean fage=false; | |
| 419 | - for(int z=0;z<cylList.size();z++){ | |
| 420 | - cyl=cylList.get(z); | |
| 421 | - if(t.getNbbm().equals(cyl.getNbbm())){ | |
| 545 | + | |
| 546 | + // 设置存油量 | |
| 547 | + Cyl cyl = null; | |
| 548 | + boolean fage = false; | |
| 549 | + for (int z = 0; z < cylList.size(); z++) { | |
| 550 | + cyl = cylList.get(z); | |
| 551 | + if (t.getNbbm().equals(cyl.getNbbm())) { | |
| 422 | 552 | cyl.setCyl(t.getJzyl()); |
| 423 | 553 | cyl.setUpdatetime(t.getRq()); |
| 424 | - fage=true; | |
| 554 | + fage = true; | |
| 425 | 555 | break; |
| 426 | 556 | } |
| 427 | 557 | } |
| 428 | - if(fage){ | |
| 558 | + if (fage) { | |
| 429 | 559 | cylRepository.save(cyl); |
| 430 | - }else{ | |
| 431 | - cyl=new Cyl(); | |
| 560 | + } else { | |
| 561 | + cyl = new Cyl(); | |
| 432 | 562 | cyl.setNbbm(t.getNbbm()); |
| 433 | 563 | cyl.setCyl(t.getJzyl()); |
| 434 | 564 | cyl.setGsdm(t.getSsgsdm()); |
| 435 | 565 | cyl.setUpdatetime(t.getRq()); |
| 436 | 566 | cylRepository.save(cyl); |
| 437 | 567 | } |
| 438 | - | |
| 568 | + | |
| 439 | 569 | newMap.put("status", ResponseCode.SUCCESS); |
| 440 | - }catch(Exception e){ | |
| 441 | - newMap.put("status", ResponseCode.ERROR); | |
| 442 | - logger.error("save erro.", e); | |
| 443 | 570 | } |
| 571 | + } catch (Exception e) { | |
| 572 | + newMap.put("status", ResponseCode.ERROR); | |
| 573 | + logger.error("save erro.", e); | |
| 444 | 574 | } |
| 445 | 575 | return newMap; |
| 446 | 576 | } |
| ... | ... | @@ -454,14 +584,33 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS |
| 454 | 584 | @Override |
| 455 | 585 | public Map<String, Object> checkYl(Map<String, Object> map) { |
| 456 | 586 | Map<String, Object> newMap=new HashMap<String,Object>(); |
| 457 | - String xlbm=map.get("xlbm_eq").toString(); | |
| 587 | +// String xlbm=""; | |
| 588 | +// if(map.get("xlbm_like")!=null){ | |
| 589 | +// xlbm=map.get("xlbm_like").toString(); | |
| 590 | +// } | |
| 458 | 591 | // TODO Auto-generated method stub |
| 459 | 592 | try{ |
| 460 | 593 | //获取车辆存油信息 |
| 461 | 594 | List<Cyl> cylList=cylRepository.findAll(new CustomerSpecs<Cyl>(newMap)); |
| 462 | 595 | String rq=map.get("rq").toString(); |
| 463 | - List<Ylb> ylbList=repository.obtainYl(rq); | |
| 464 | - List<Ylxxb> ylxxbList=ylxxbRepository.obtainYlxx(rq); | |
| 596 | + String xlbm=""; | |
| 597 | + if(map.get("xlbm_like")!=null){ | |
| 598 | + xlbm= map.get("xlbm_like").toString().trim(); | |
| 599 | + } | |
| 600 | + String gsbm=""; | |
| 601 | + if(map.get("ssgsdm_like")!=null){ | |
| 602 | + gsbm=map.get("ssgsdm_like").toString(); | |
| 603 | + } | |
| 604 | + String fgsbm=""; | |
| 605 | + if(map.get("fgsdm_like")!=null){ | |
| 606 | + fgsbm=map.get("fgsdm_like").toString(); | |
| 607 | + } | |
| 608 | + String nbbm=""; | |
| 609 | + if(map.get("nbbm_eq")!=null){ | |
| 610 | + nbbm=map.get("nbbm_eq").toString(); | |
| 611 | + } | |
| 612 | + List<Ylb> ylbList=repository.obtainYl(rq,gsbm,fgsbm,xlbm,nbbm,"nbbm"); | |
| 613 | + List<Ylxxb> ylxxbList=ylxxbRepository.obtainYlxx(rq,0); | |
| 465 | 614 | for (int i = 0; i < ylxxbList.size(); i++) { |
| 466 | 615 | Boolean fage=true; |
| 467 | 616 | Ylxxb y1=ylxxbList.get(i); |
| ... | ... | @@ -513,6 +662,7 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS |
| 513 | 662 | }catch(Exception e){ |
| 514 | 663 | newMap.put("status", ResponseCode.ERROR); |
| 515 | 664 | logger.error("save erro.", e); |
| 665 | + throw e; | |
| 516 | 666 | } |
| 517 | 667 | |
| 518 | 668 | return newMap; | ... | ... |
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
| ... | ... | @@ -476,11 +476,11 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 476 | 476 | type = "asc"; |
| 477 | 477 | } |
| 478 | 478 | String sqlPlan = "select min(s.id) as id,s.j_Gh as jGh,s.cl_Zbh as clZbh," |
| 479 | - + " s.lp_Name as lpName,s.j_Name as jName,s.s_Gh as sGh,s.s_Name as sName" | |
| 479 | + + " s.lp_Name as lpName,s.j_Name as jName" | |
| 480 | 480 | + " from bsth_c_s_sp_info_real s " |
| 481 | 481 | + " where s.xl_Bm = '" + line + "' and DATE_FORMAT(s.schedule_Date,'%Y-%m-%d') ='" + date + "' " |
| 482 | - + " GROUP BY s.j_Gh,s.cl_Zbh,s.lp_Name ,s.j_Name,s.s_Gh," | |
| 483 | - + " s.s_Name order by (" + state + ") " + type; | |
| 482 | + + " GROUP BY s.j_Gh,s.cl_Zbh,s.lp_Name ,s.j_Name" | |
| 483 | + + " order by (" + state + ") " + type; | |
| 484 | 484 | List<ScheduleRealInfo> list = jdbcTemplate.query(sqlPlan, |
| 485 | 485 | new RowMapper<ScheduleRealInfo>() { |
| 486 | 486 | @Override |
| ... | ... | @@ -491,8 +491,6 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 491 | 491 | t.setClZbh(rs.getString("clZbh")); |
| 492 | 492 | t.setLpName(rs.getString("lpName")); |
| 493 | 493 | t.setjName(rs.getString("jName")); |
| 494 | - t.setsGh(rs.getString("sGh")); | |
| 495 | - t.setsName(rs.getString("sName")); | |
| 496 | 494 | return t; |
| 497 | 495 | } |
| 498 | 496 | }); |
| ... | ... | @@ -2378,7 +2376,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 2378 | 2376 | if (childTaskPlans.isEmpty()) { |
| 2379 | 2377 | if (scheduleRealInfo.getBcType().equals("in") || |
| 2380 | 2378 | scheduleRealInfo.getBcType().equals("out")) { |
| 2381 | - jcclc += tempJhlc; | |
| 2379 | + if (scheduleRealInfo.getStatus() != -1) { | |
| 2380 | + jcclc += tempJhlc; | |
| 2381 | + } | |
| 2382 | 2382 | } |
| 2383 | 2383 | //主任务 放空班次属于营运 |
| 2384 | 2384 | // else if(scheduleRealInfo.getBcType().equals("venting")){ |
| ... | ... | @@ -3145,7 +3145,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 3145 | 3145 | ScheduleRealInfo s = scheduleRealInfoRepository.findOne(id); |
| 3146 | 3146 | String xlbm = s.getXlBm(); |
| 3147 | 3147 | String fcrq = s.getScheduleDateStr(); |
| 3148 | - | |
| 3148 | + //保留两位小数 | |
| 3149 | + DecimalFormat df = new DecimalFormat("#.00"); | |
| 3149 | 3150 | List<Ylxxb> listYlxxb = ylxxbRepository.queryListYlxxb(s.getClZbh(), fcrq); |
| 3150 | 3151 | Double jzl = 0.0; |
| 3151 | 3152 | for (int t = 0; t < listYlxxb.size(); t++) { |
| ... | ... | @@ -3164,7 +3165,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 3164 | 3165 | yh += y.getYh(); |
| 3165 | 3166 | |
| 3166 | 3167 | } |
| 3167 | - map.put("jzl", jzl); | |
| 3168 | + map.put("jzl", df.format(jzl)); | |
| 3168 | 3169 | map.put("yh", yh); |
| 3169 | 3170 | map.put("ccyl", ccyl); |
| 3170 | 3171 | map.put("jcyl", jcyl); |
| ... | ... | @@ -3173,6 +3174,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 3173 | 3174 | map.put("fcsjActual", s.getFcsjActual()); |
| 3174 | 3175 | map.put("zdzName", s.getZdzName()); |
| 3175 | 3176 | map.put("scheduleDate", s.getScheduleDateStr()); |
| 3177 | + map.put("lpName", s.getLpName()); | |
| 3176 | 3178 | String zdp = "", zwdp = "", wdp = ""; |
| 3177 | 3179 | String zdpT = "", zwdpT = "", wdpT = ""; |
| 3178 | 3180 | ... | ... |
src/main/java/com/bsth/service/schedule/PeopleCarPlanServiceImpl.java
| ... | ... | @@ -229,22 +229,22 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { |
| 229 | 229 | temp.get(key).add(m); |
| 230 | 230 | } |
| 231 | 231 | for(String key : temp.keySet()){ |
| 232 | - Map<Integer, List<Map<String, Object>>> tempList = new HashMap<Integer, List<Map<String,Object>>>(); | |
| 233 | - List<Integer> keyList = new ArrayList<Integer>(); | |
| 232 | + Map<Long, List<Map<String, Object>>> tempList = new HashMap<Long, List<Map<String,Object>>>(); | |
| 233 | + List<Long> keyList = new ArrayList<Long>(); | |
| 234 | 234 | for(Map<String, Object> m : temp.get(key)){ |
| 235 | 235 | String lp = m.get("lp").toString(); |
| 236 | 236 | String str = ""; |
| 237 | 237 | for(int i = 0; i < lp.length(); i++){ |
| 238 | 238 | str += (int)lp.charAt(i); |
| 239 | 239 | } |
| 240 | - int i = Integer.valueOf(str); | |
| 240 | + Long i = Long.valueOf(str); | |
| 241 | 241 | if(!tempList.containsKey(i)) |
| 242 | 242 | tempList.put(i, new ArrayList<Map<String, Object>>()); |
| 243 | 243 | tempList.get(i).add(m); |
| 244 | 244 | keyList.add(i); |
| 245 | 245 | } |
| 246 | 246 | Collections.sort(keyList); |
| 247 | - for(Integer i : keyList){ | |
| 247 | + for(Long i : keyList){ | |
| 248 | 248 | for(Map<String, Object> m : tempList.get(i)){ |
| 249 | 249 | resList.add(m); |
| 250 | 250 | } | ... | ... |
src/main/java/com/bsth/websocket/handler/RealControlSocketHandler.java
| 1 | 1 | package com.bsth.websocket.handler; |
| 2 | 2 | |
| 3 | -import java.util.ArrayList; | |
| 4 | -import java.util.HashMap; | |
| 5 | -import java.util.Iterator; | |
| 6 | -import java.util.List; | |
| 7 | -import java.util.Map; | |
| 8 | -import java.util.Set; | |
| 9 | - | |
| 3 | +import com.alibaba.fastjson.JSONObject; | |
| 4 | +import com.bsth.data.BasicData; | |
| 5 | +import com.google.common.base.Splitter; | |
| 6 | +import com.google.common.collect.ArrayListMultimap; | |
| 10 | 7 | import org.slf4j.Logger; |
| 11 | 8 | import org.slf4j.LoggerFactory; |
| 12 | 9 | import org.springframework.context.annotation.Scope; |
| 13 | 10 | import org.springframework.stereotype.Component; |
| 14 | -import org.springframework.web.socket.CloseStatus; | |
| 15 | -import org.springframework.web.socket.TextMessage; | |
| 16 | -import org.springframework.web.socket.WebSocketHandler; | |
| 17 | -import org.springframework.web.socket.WebSocketMessage; | |
| 18 | -import org.springframework.web.socket.WebSocketSession; | |
| 11 | +import org.springframework.web.socket.*; | |
| 19 | 12 | |
| 20 | -import com.alibaba.fastjson.JSONObject; | |
| 21 | -import com.bsth.data.BasicData; | |
| 22 | -import com.google.common.base.Splitter; | |
| 23 | -import com.google.common.collect.ArrayListMultimap; | |
| 13 | +import java.util.*; | |
| 24 | 14 | |
| 25 | 15 | /** |
| 26 | 16 | * @author PanZhao |
| ... | ... | @@ -99,43 +89,6 @@ public class RealControlSocketHandler implements WebSocketHandler { |
| 99 | 89 | return false; |
| 100 | 90 | } |
| 101 | 91 | |
| 102 | - /** | |
| 103 | - * 给所有在线用户发送消息 | |
| 104 | - * | |
| 105 | - * @param message | |
| 106 | - | |
| 107 | - public synchronized void sendMessageToUsers(TextMessage message) { | |
| 108 | - for (WebSocketSession user : users) { | |
| 109 | - try { | |
| 110 | - if (user.isOpen()) { | |
| 111 | - user.sendMessage(message); | |
| 112 | - } | |
| 113 | - } catch (IOException e) { | |
| 114 | - e.printStackTrace(); | |
| 115 | - } | |
| 116 | - } | |
| 117 | - }*/ | |
| 118 | - | |
| 119 | - /** | |
| 120 | - * 给某些用户发送消息 | |
| 121 | - * | |
| 122 | - * @param userId | |
| 123 | - * @param message | |
| 124 | - | |
| 125 | - public synchronized void sendMessageToUser(Set<String> uids, String msg) { | |
| 126 | - TextMessage message = new TextMessage(msg.getBytes()); | |
| 127 | - for (WebSocketSession user : users) { | |
| 128 | - if (uids.contains(user.getAttributes().get(Constants.SESSION_USERNAME))) { | |
| 129 | - try { | |
| 130 | - if (user.isOpen()) { | |
| 131 | - user.sendMessage(message); | |
| 132 | - } | |
| 133 | - } catch (IOException e) { | |
| 134 | - e.printStackTrace(); | |
| 135 | - } | |
| 136 | - } | |
| 137 | - } | |
| 138 | - }*/ | |
| 139 | 92 | |
| 140 | 93 | /** |
| 141 | 94 | * 根据线路推送消息 | ... | ... |
src/main/resources/ms-jdbc.properties
| 1 | 1 | #ms.mysql.driver= com.mysql.jdbc.Driver |
| 2 | -#ms.mysql.url= jdbc:mysql://192.168.40.82:3306/ms?useUnicode=true&characterEncoding=utf-8&useSSL=false | |
| 2 | +#ms.mysql.url= jdbc:mysql://192.168.168.201:3306/ms?useUnicode=true&characterEncoding=utf-8&useSSL=false | |
| 3 | 3 | #ms.mysql.username= root |
| 4 | 4 | #ms.mysql.password= 123456 |
| 5 | 5 | |
| 6 | 6 | ms.mysql.driver= com.mysql.jdbc.Driver |
| 7 | -ms.mysql.url= jdbc:mysql://192.168.168.201:3306/ms?useUnicode=true&characterEncoding=utf-8&useSSL=false | |
| 7 | +ms.mysql.url= jdbc:mysql://192.168.168.171:3306/ms?useUnicode=true&characterEncoding=utf-8 | |
| 8 | 8 | ms.mysql.username= root |
| 9 | -ms.mysql.password= 123456 | |
| 10 | 9 | \ No newline at end of file |
| 10 | +ms.mysql.password= root2jsp | |
| 11 | 11 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/electricity/cdl/cdlAdd.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="cylList.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 action="/addCyl" class="form-horizontal" id="cyl_add_form" > | |
| 23 | + <div class="alert alert-danger display-hide"> | |
| 24 | + <button class="close" data-close="alert"></button> | |
| 25 | + 您的输入有误,请检查下面的输入项 | |
| 26 | + </div> | |
| 27 | + <div class="form-body"> | |
| 28 | + <div class="form-group" id="gsdmDivId"> | |
| 29 | + <label class="col-md-3 control-label">公司</label> | |
| 30 | + <div class="col-md-4"> | |
| 31 | + <select class="form-control" name="gsdm" id="gsdm" ></select> | |
| 32 | + <span class="help-block"> 公司</span> | |
| 33 | + </div> | |
| 34 | + </div> | |
| 35 | + <div class="form-group" id="fgsdmDivId"> | |
| 36 | + <label class="col-md-3 control-label">分公司</label> | |
| 37 | + <div class="col-md-4"> | |
| 38 | + <select class="form-control" name="fgsdm" id="fgsdm" ></select> | |
| 39 | + <span class="help-block"> 分公司</span> | |
| 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 | + <input type="text" class="form-control" name="nbbm" > | |
| 46 | + <span class="help-block"> 车辆内部编号</span> | |
| 47 | + </div> | |
| 48 | + </div> | |
| 49 | + <div class="form-group"> | |
| 50 | + <label class="col-md-3 control-label">恒定存电量</label> | |
| 51 | + <div class="col-md-4"> | |
| 52 | + | |
| 53 | + <input type="text" style=" width:120px; height: 34px; padding: 6px 12px ; background-color: #fff;border: 1px solid #c2cad8;" | |
| 54 | + name="clcd" > | |
| 55 | + <span style="font-size: 30px">% | |
| 56 | + </span> | |
| 57 | + | |
| 58 | + </div> | |
| 59 | + </div> | |
| 60 | + </div> | |
| 61 | + <div class="form-actions"> | |
| 62 | + <div class="row"> | |
| 63 | + <div class="col-md-offset-3 col-md-4"> | |
| 64 | + <button type="submit" class="btn green" ><i class="fa fa-check"></i> 提交</button> | |
| 65 | + <a type="button" class="btn default" href="list.html" data-pjax><i class="fa fa-times"></i> 取消</a> | |
| 66 | + </div> | |
| 67 | + </div> | |
| 68 | + </div> | |
| 69 | + </form> | |
| 70 | + <!-- END FORM--> | |
| 71 | + </div> | |
| 72 | +</div> | |
| 73 | +<script> | |
| 74 | + $(function(){ | |
| 75 | + | |
| 76 | + var form = $('#cyl_add_form'); | |
| 77 | + var error = $('.alert-danger', form); | |
| 78 | + | |
| 79 | + var obj = []; | |
| 80 | + $.get('/user/companyData', function(result){ | |
| 81 | + obj = result; | |
| 82 | + var options = ''; | |
| 83 | + for(var i = 0; i < obj.length; i++){ | |
| 84 | + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>'; | |
| 85 | + } | |
| 86 | + | |
| 87 | + if(obj.length ==0){ | |
| 88 | + $("#gsdmDivId").css('display','none'); | |
| 89 | + $('#fgsdmDivId').css('display','none'); | |
| 90 | + }else if(obj.length ==1){ | |
| 91 | + $("#gsdmDivId").css('display','none'); | |
| 92 | + if(obj[0].children.length == 1 || obj[0].children.length ==0) | |
| 93 | + $('#fgsdmDivId').css('display','none'); | |
| 94 | + } | |
| 95 | + $('#gsdm').html(options); | |
| 96 | + updateCompany(); | |
| 97 | + }); | |
| 98 | + | |
| 99 | + $("#gsdm").on("change",updateCompany); | |
| 100 | + function updateCompany(){ | |
| 101 | + var company = $('#gsdm').val(); | |
| 102 | + var options = ''; | |
| 103 | + for(var i = 0; i < obj.length; i++){ | |
| 104 | + if(obj[i].companyCode == company){ | |
| 105 | + var children = obj[i].children; | |
| 106 | + for(var j = 0; j < children.length; j++){ | |
| 107 | + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>'; | |
| 108 | + } | |
| 109 | + } | |
| 110 | + } | |
| 111 | + $('#fgsdm').html(options); | |
| 112 | + } | |
| 113 | + | |
| 114 | + | |
| 115 | + //表单 validate | |
| 116 | + form.validate({ | |
| 117 | + errorElement : 'span', | |
| 118 | + errorClass : 'help-block help-block-error', | |
| 119 | + focusInvalid : false, | |
| 120 | + rules : { | |
| 121 | + 'nbbm' : { | |
| 122 | + minlength : 2, | |
| 123 | + required : true, | |
| 124 | + maxlength : 10 | |
| 125 | + }, | |
| 126 | + 'clcd' : { | |
| 127 | + number:true, | |
| 128 | + required : true, | |
| 129 | + min:0 | |
| 130 | + } | |
| 131 | + }, | |
| 132 | + invalidHandler : function(event, validator) { | |
| 133 | + error.show(); | |
| 134 | + App.scrollTo(error, -200); | |
| 135 | + }, | |
| 136 | + | |
| 137 | + highlight : function(element) { | |
| 138 | + $(element).closest('.form-group').addClass('has-error'); | |
| 139 | + }, | |
| 140 | + | |
| 141 | + unhighlight : function(element) { | |
| 142 | + $(element).closest('.form-group').removeClass('has-error'); | |
| 143 | + }, | |
| 144 | + | |
| 145 | + success : function(label) { | |
| 146 | + label.closest('.form-group').removeClass('has-error'); | |
| 147 | + }, | |
| 148 | + | |
| 149 | + submitHandler : function(f) { | |
| 150 | + var params = form.serializeJSON(); | |
| 151 | + error.hide(); | |
| 152 | + //检查一下车辆是否存在 | |
| 153 | + $get('/cdl/all', {nbbm_eq: params.nbbm}, function(list){ | |
| 154 | + if(!list || list.length == 0){ | |
| 155 | + $.ajax({ | |
| 156 | + url: '/cdl/save', | |
| 157 | + type: 'POST', | |
| 158 | + traditional: true, | |
| 159 | + data: params, | |
| 160 | + success: function(res){ | |
| 161 | + layer.msg('添加信息成功.'); | |
| 162 | + loadPage('cdlList.html'); | |
| 163 | + } | |
| 164 | + }); | |
| 165 | + } | |
| 166 | + else | |
| 167 | + layer.alert('内部编码【' + params.nbbm + '】已存在', {icon: 2, title: '提交被拒绝'}); | |
| 168 | + }); | |
| 169 | + } | |
| 170 | + }); | |
| 171 | + }); | |
| 172 | +</script> | |
| 0 | 173 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/electricity/cdl/cdlList.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><span class="active">车辆存电</span></li> | |
| 11 | +</ul> | |
| 12 | + | |
| 13 | +<div class="row"> | |
| 14 | + <div class="col-md-12"> | |
| 15 | + <!-- Begin: life time stats --> | |
| 16 | + <div class="portlet light portlet-fit portlet-datatable bordered"> | |
| 17 | + <div class="portlet-title"> | |
| 18 | + <div class="caption"> | |
| 19 | + <i class="fa fa-users font-dark"></i> <span | |
| 20 | + class="caption-subject font-dark sbold uppercase">车辆存电信息表</span> | |
| 21 | + </div> | |
| 22 | + <div class="actions"> | |
| 23 | + <a class="btn btn-circle blue" href="cdlAdd.html" data-pjax><i class="fa fa-plus"></i> 添加</a> | |
| 24 | + </div> | |
| 25 | + </div> | |
| 26 | + <div class="portlet-body"> | |
| 27 | + <div class="table-container" style="margin-top: 10px"> | |
| 28 | + <table | |
| 29 | + class="table table-striped table-bordered table-hover table-checkable" | |
| 30 | + id="datatable_cdl"> | |
| 31 | + <thead> | |
| 32 | + <tr role="row" class="heading"> | |
| 33 | + <th width="3%">#</th> | |
| 34 | + <th width="15%">公司</th> | |
| 35 | + <th width="15%">分公司</th> | |
| 36 | + <th width="14%">车辆编码</th> | |
| 37 | + <th width="16%">车辆存电</th> | |
| 38 | + <th width="18%">最后更新时间</th> | |
| 39 | + <th width="19%">操作</th> | |
| 40 | + </tr> | |
| 41 | + <tr role="row" class="filter"> | |
| 42 | + <td></td> | |
| 43 | + <td> | |
| 44 | + <select class="form-control" name="gsdm_like" id="cylListGsdmId" ></select> | |
| 45 | + </td> | |
| 46 | + <td> | |
| 47 | + <select class="form-control" name="fgsdm_like" id="cylListFgsdmId" ></select> | |
| 48 | + </td> | |
| 49 | + <td> | |
| 50 | + <input type="text" class="form-control form-filter input-sm" name="nbbm_like"> | |
| 51 | + </td> | |
| 52 | + <td></td> | |
| 53 | + <td></td> | |
| 54 | + <td> | |
| 55 | + <button class="btn btn-sm green btn-outline filter-submit margin-bottom" > | |
| 56 | + <i class="fa fa-search"></i> 搜索</button> | |
| 57 | + | |
| 58 | + <button class="btn btn-sm red btn-outline filter-cancel"> | |
| 59 | + <i class="fa fa-times"></i> 重置</button> | |
| 60 | + </td> | |
| 61 | + </tr> | |
| 62 | + </thead> | |
| 63 | + <tbody></tbody> | |
| 64 | + </table> | |
| 65 | + <div style="text-align: right;"> | |
| 66 | + <ul id="pagination" class="pagination"></ul> | |
| 67 | + </div> | |
| 68 | + </div> | |
| 69 | + </div> | |
| 70 | + </div> | |
| 71 | + </div> | |
| 72 | +</div> | |
| 73 | + | |
| 74 | +<script id="cdl_list_temp" type="text/html"> | |
| 75 | +{{each list as obj i}} | |
| 76 | +<tr> | |
| 77 | + <td style="vertical-align: middle;"> | |
| 78 | + <input type="checkbox" class="group-checkable icheck" data-id="{{obj.id}}"> | |
| 79 | + </td> | |
| 80 | + <td> | |
| 81 | + {{obj.gsname}} | |
| 82 | + </td> | |
| 83 | + <td> | |
| 84 | + {{obj.fgsname}} | |
| 85 | + </td> | |
| 86 | + <td> | |
| 87 | + {{obj.nbbm}} | |
| 88 | + </td> | |
| 89 | + <td> | |
| 90 | + {{obj.clcd}}% | |
| 91 | + </td> | |
| 92 | + <td> | |
| 93 | + {{obj.updatetime}} | |
| 94 | + </td> | |
| 95 | + <td> | |
| 96 | + <!--<a class="btn btn-sm blue btn-outline" href="edit.html?no={{obj.id}}" data-pjax><i class="fa fa-edit"></i> 编辑</a>--> | |
| 97 | + </td> | |
| 98 | +</tr> | |
| 99 | +{{/each}} | |
| 100 | +{{if list.length == 0}} | |
| 101 | +<tr> | |
| 102 | + <td colspan=8><h6 class="muted">没有找到相关数据</h6></td> | |
| 103 | +</tr> | |
| 104 | +{{/if}} | |
| 105 | +</script> | |
| 106 | + | |
| 107 | +<script> | |
| 108 | +$(function(){ | |
| 109 | + var page = 0, initPagination; | |
| 110 | + var icheckOptions = { | |
| 111 | + checkboxClass: 'icheckbox_flat-blue', | |
| 112 | + increaseArea: '20%' | |
| 113 | + } | |
| 114 | + | |
| 115 | +// var gsqx=""; | |
| 116 | +// var fgsqx=""; | |
| 117 | + | |
| 118 | + $.get('/user/companyData', function(result){ | |
| 119 | + obj = result; | |
| 120 | + var options = ''; | |
| 121 | +// '<option value="">请选择</option>'; | |
| 122 | + for(var i = 0; i < obj.length; i++){ | |
| 123 | + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>'; | |
| 124 | +// setFgsqx(obj[i].companyCode); | |
| 125 | +// gsqx +=obj[i].companyCode+","; | |
| 126 | + } | |
| 127 | + $('#cylListGsdmId').html(options); | |
| 128 | + updateCompany(); | |
| 129 | +// jsDoQuery(null,true); | |
| 130 | + }); | |
| 131 | + | |
| 132 | + /* function setFgsqx(gs){ | |
| 133 | + var company =gs | |
| 134 | + var options = ''; | |
| 135 | + for(var i = 0; i < obj.length; i++){ | |
| 136 | + if(obj[i].companyCode == company){ | |
| 137 | + var children = obj[i].children; | |
| 138 | + for(var j = 0; j < children.length; j++){ | |
| 139 | + fgsqx +=children[j].code+","; | |
| 140 | + } | |
| 141 | + } | |
| 142 | + } | |
| 143 | + } */ | |
| 144 | + | |
| 145 | + $("#cylListGsdmId").on("change",updateCompany); | |
| 146 | + function updateCompany(){ | |
| 147 | + var company = $('#cylListGsdmId').val(); | |
| 148 | + var options = ''; | |
| 149 | +// '<option value="">请选择</option>'; | |
| 150 | + for(var i = 0; i < obj.length; i++){ | |
| 151 | + if(obj[i].companyCode == company){ | |
| 152 | + var children = obj[i].children; | |
| 153 | + for(var j = 0; j < children.length; j++){ | |
| 154 | + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>'; | |
| 155 | + } | |
| 156 | + } | |
| 157 | + } | |
| 158 | + $('#cylListFgsdmId').html(options); | |
| 159 | + } | |
| 160 | + | |
| 161 | + //重置 | |
| 162 | + $('tr.filter .filter-cancel').on('click', function(){ | |
| 163 | + $('tr.filter input, select').val('').change(); | |
| 164 | +// jsDoQuery(null, true); | |
| 165 | + }); | |
| 166 | + | |
| 167 | + //提交 | |
| 168 | + $('tr.filter .filter-submit').on('click', function(){ | |
| 169 | + var cylGsdm=$("#cylListGsdmId").val(); | |
| 170 | + var cylFgsdm=$("#cylListFgsdmId").val(); | |
| 171 | + if(cylGsdm=="" ||cylGsdm ==null ||cylFgsdm=="" ||cylFgsdm ==null){ | |
| 172 | + layer.msg("请选择公司和分公司"); | |
| 173 | + }else{ | |
| 174 | + var cells = $('tr.filter')[0].cells | |
| 175 | + ,params = {} | |
| 176 | + ,name; | |
| 177 | + $.each(cells, function(i, cell){ | |
| 178 | + var items = $('input,select', cell); | |
| 179 | + for(var j = 0, item; item = items[j++];){ | |
| 180 | + name = $(item).attr('name'); | |
| 181 | + if(name){ | |
| 182 | + params[name] = $(item).val(); | |
| 183 | + } | |
| 184 | + } | |
| 185 | + }); | |
| 186 | + page = 0; | |
| 187 | + jsDoQuery(params, true); | |
| 188 | + } | |
| 189 | + }); | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + /* | |
| 194 | + * 获取数据 p: 要提交的参数, pagination: 是否重新分页 | |
| 195 | + */ | |
| 196 | + function jsDoQuery(p, pagination){ | |
| 197 | + var params = {}; | |
| 198 | + if(p) | |
| 199 | + params = p; | |
| 200 | + //更新时间排序 | |
| 201 | + params['order'] = 'nbbm'; | |
| 202 | + params['page'] = page; | |
| 203 | + var i = 2; | |
| 204 | + /* var cylGsdm=$("#cylListGsdmId").val(); | |
| 205 | + var cylFgsdm=$("#cylListFgsdmId").val(); | |
| 206 | + if(cylGsdm==''|| cylGsdm==null){ | |
| 207 | + params['gsdm_in']=gsqx; | |
| 208 | + params['fgsdm_in']=fgsqx; | |
| 209 | + }else{ | |
| 210 | + if(cylFgsdm==''||cylFgsdm==null){ | |
| 211 | + var fgsqx1=''; | |
| 212 | + for(var i = 0; i < obj.length; i++){ | |
| 213 | + if(obj[i].companyCode == cylGsdm){ | |
| 214 | + var children = obj[i].children; | |
| 215 | + for(var j = 0; j < children.length; j++){ | |
| 216 | + fgsqx1 +=children[j].code+","; | |
| 217 | + } | |
| 218 | + } | |
| 219 | + } | |
| 220 | + params['fgsdm_in']=fgsqx1; | |
| 221 | + } | |
| 222 | + } */ | |
| 223 | + $get('/cdl' ,params, function(data){ | |
| 224 | + $.each(data.content, function(i, obj) { | |
| 225 | + obj.updatetime = moment(obj.updatetime).format("YYYY-MM-DD"); | |
| 226 | + }); | |
| 227 | + var bodyHtm = template('cdl_list_temp', {list: data.content}); | |
| 228 | + | |
| 229 | + $('#datatable_cdl tbody').html(bodyHtm) | |
| 230 | + .find('.icheck').iCheck(icheckOptions) | |
| 231 | + .on('ifChanged', iCheckChange); | |
| 232 | + if(pagination && data.content.length > 0){ | |
| 233 | + //重新分页 | |
| 234 | + initPagination = true; | |
| 235 | + showPagination(data); | |
| 236 | + } | |
| 237 | + layer.close(i); | |
| 238 | + }); | |
| 239 | + } | |
| 240 | + | |
| 241 | + function iCheckChange(){ | |
| 242 | + var tr = $(this).parents('tr'); | |
| 243 | + if(this.checked) | |
| 244 | + tr.addClass('row-active'); | |
| 245 | + else | |
| 246 | + tr.removeClass('row-active'); | |
| 247 | + | |
| 248 | + if($('#datatable_resource input.icheck:checked').length == 1) | |
| 249 | + $('#removeButton').removeAttr('disabled'); | |
| 250 | + else | |
| 251 | + $('#removeButton').attr('disabled', 'disabled'); | |
| 252 | + } | |
| 253 | + | |
| 254 | + function showPagination(data){ | |
| 255 | + //分页 | |
| 256 | + $('#pagination').jqPaginator({ | |
| 257 | + totalPages: data.totalPages, | |
| 258 | + visiblePages: 6, | |
| 259 | + currentPage: page + 1, | |
| 260 | + first: '<li class="first"><a href="javascript:void(0);">首页<\/a><\/li>', | |
| 261 | + prev: '<li class="prev"><a href="javascript:void(0);">上一页<\/a><\/li>', | |
| 262 | + next: '<li class="next"><a href="javascript:void(0);">下一页<\/a><\/li>', | |
| 263 | + last: '<li class="last"><a href="javascript:void(0);">尾页<\/a><\/li>', | |
| 264 | + page: '<li class="page"><a href="javascript:void(0);">{{page}}<\/a><\/li>', | |
| 265 | + onPageChange: function (num, type) { | |
| 266 | + if(initPagination){ | |
| 267 | + initPagination = false; | |
| 268 | + return; | |
| 269 | + } | |
| 270 | + page = num - 1; | |
| 271 | + var cells = $('tr.filter')[0].cells | |
| 272 | + ,params = {} | |
| 273 | + ,name; | |
| 274 | + $.each(cells, function(i, cell){ | |
| 275 | + var items = $('input,select', cell); | |
| 276 | + for(var j = 0, item; item = items[j++];){ | |
| 277 | + name = $(item).attr('name'); | |
| 278 | + if(name){ | |
| 279 | + params[name] = $(item).val(); | |
| 280 | + } | |
| 281 | + } | |
| 282 | + }); | |
| 283 | + jsDoQuery(params, false); | |
| 284 | + } | |
| 285 | + }); | |
| 286 | + } | |
| 287 | + | |
| 288 | + | |
| 289 | + //删除 | |
| 290 | + $('#removeButton').on('click', function(){ | |
| 291 | + if($(this).attr('disabled')) | |
| 292 | + return; | |
| 293 | + | |
| 294 | + var id = $('#datatable_resource input.icheck:checked').data('id'); | |
| 295 | + | |
| 296 | + removeConfirm('确定要删除选中的数据?', '/resource/' + id ,function(){ | |
| 297 | + $('tr.filter .filter-submit').click(); | |
| 298 | + }); | |
| 299 | + }); | |
| 300 | +}); | |
| 301 | +</script> | |
| 0 | 302 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/electricity/list/list.html
| ... | ... | @@ -10,26 +10,29 @@ |
| 10 | 10 | <li><span class="active">进出场存电量</span></li> |
| 11 | 11 | </ul> |
| 12 | 12 | |
| 13 | -<div class="row" id="ll_oil_list"> | |
| 13 | +<div class="row" id="ll_dlb_list"> | |
| 14 | 14 | <div class="col-md-12"> |
| 15 | 15 | <!-- Begin: life time stats --> |
| 16 | 16 | <div class="portlet light portlet-fit portlet-datatable bordered"> |
| 17 | 17 | <div class="portlet-title"> |
| 18 | 18 | <div class="caption"> |
| 19 | - <i class="fa fa-fire-extinguisher"></i> <span | |
| 19 | + <i class="fa fa-battery-quarter"></i> <span | |
| 20 | 20 | class="caption-subject font-dark sbold uppercase">进出场存电量表</span> |
| 21 | 21 | </div> |
| 22 | 22 | <div class="actions"> |
| 23 | 23 | <!-- <button type="button" class="btn btn-circle blue" id="removeButton"><i class="fa fa-trash-o"></i> 删除</button> --> |
| 24 | + <button type="button" class="btn btn-circle blue" id="sortButton"><i class="fa fa-minus-square"></i> | |
| 25 | + 保存 | |
| 26 | + </button> | |
| 24 | 27 | <button type="button" class="btn btn-circle blue" id="obtain"><i class="fa fa-hourglass-half"></i> |
| 25 | 28 | 获取加/存电信息 |
| 26 | 29 | </button> |
| 27 | - <button type="button" class="btn btn-circle blue" id="checkYl"><i class="fa fa-gg-circle"></i> | |
| 30 | + <button type="button" class="btn btn-circle blue" id="checkDl"><i class="fa fa-gg-circle"></i> | |
| 28 | 31 | 核对加注量(有加电无里程) |
| 29 | 32 | </button> |
| 30 | - <button type="button" class="btn btn-circle blue" id="export"><i class="fa fa-file-excel-o"></i> | |
| 33 | + <!-- <button type="button" class="btn btn-circle blue" id="export"><i class="fa fa-file-excel-o"></i> | |
| 31 | 34 | 导出Excel |
| 32 | - </button> | |
| 35 | + </button> --> | |
| 33 | 36 | <!-- <button type="button" class="btn btn-circle red" disabled="disabled" id="removeButton"><i class="fa fa-trash"></i> 删除用户</button> --> |
| 34 | 37 | </div> |
| 35 | 38 | </div> |
| ... | ... | @@ -117,7 +120,7 @@ |
| 117 | 120 | </div> |
| 118 | 121 | </div> |
| 119 | 122 | |
| 120 | -<script id="ylb_list_temp" type="text/html"> | |
| 123 | +<script id="dlb_list_temp" type="text/html"> | |
| 121 | 124 | {{each list as obj i}} |
| 122 | 125 | <tr> |
| 123 | 126 | <td style="vertical-align: middle;"> |
| ... | ... | @@ -140,7 +143,7 @@ |
| 140 | 143 | {{obj.jsy}} |
| 141 | 144 | </td> |
| 142 | 145 | <td> |
| 143 | - {{obj.jzl}} | |
| 146 | + {{obj.cdl}} | |
| 144 | 147 | </td> |
| 145 | 148 | <td> |
| 146 | 149 | {{obj.czlc}} |
| ... | ... | @@ -149,15 +152,19 @@ |
| 149 | 152 | {{obj.jzlc}} |
| 150 | 153 | </td> |
| 151 | 154 | <td> |
| 152 | - {{obj.czyl}} | |
| 155 | + {{obj.czcd}} | |
| 153 | 156 | </td> |
| 154 | 157 | <td> |
| 155 | - <a data-id="{{obj.id}}" href="javascript:;" class="in_carpark_jzyl"> | |
| 156 | - {{obj.jzyl}} | |
| 158 | + <a data-id="{{obj.id}}" href="javascript:;" class="in_carpark_jzdl"> | |
| 159 | + {{obj.jzcd}} | |
| 157 | 160 | </a> |
| 161 | + % | |
| 158 | 162 | </td> |
| 159 | 163 | <td> |
| 160 | - {{obj.yh}} | |
| 164 | + | |
| 165 | + <a data-id="{{obj.id}}" href="javascript:;" class="in_carpark_hdl"> | |
| 166 | + {{obj.hd}} | |
| 167 | + </a> | |
| 161 | 168 | </td> |
| 162 | 169 | <td> |
| 163 | 170 | {{obj.ns}} |
| ... | ... | @@ -177,9 +184,7 @@ |
| 177 | 184 | <td> |
| 178 | 185 | {{obj.bglyh}} |
| 179 | 186 | </td> |
| 180 | - <td> | |
| 181 | - <!--<a class="btn btn-sm blue btn-outline" href="edit.html?no={{obj.id}}" data-pjax><i class="fa fa-edit"></i> 编辑</a>--> | |
| 182 | - </td> | |
| 187 | + | |
| 183 | 188 | </tr> |
| 184 | 189 | {{/each}} |
| 185 | 190 | {{if list.length == 0}} |
| ... | ... | @@ -192,9 +197,9 @@ |
| 192 | 197 | <script> |
| 193 | 198 | $(function () { |
| 194 | 199 | //var id = 15; |
| 195 | - //$('.in_carpark_jzyl[data-id='+id+']', '#ll_oil_list') | |
| 200 | + //$('.in_carpark_jzdl[data-id='+id+']', '#ll_dlb_list') | |
| 196 | 201 | |
| 197 | - $("#checkYl").on('click', function () { | |
| 202 | + $("#checkDl").on('click', function () { | |
| 198 | 203 | if ($("#rq").val() != "") { |
| 199 | 204 | var cells = $('tr.filter')[0].cells |
| 200 | 205 | , params = {} |
| ... | ... | @@ -208,15 +213,67 @@ |
| 208 | 213 | } |
| 209 | 214 | } |
| 210 | 215 | }); |
| 211 | - $get('/ylb/checkYl', params, function () { | |
| 212 | - jsDoQuery(null, true); | |
| 216 | + var i = layer.load(2); | |
| 217 | + $get('/dlb/checkDl', params, function () { | |
| 218 | + layer.close(i); | |
| 219 | + var cells = $('tr.filter')[0].cells | |
| 220 | + , params1 = {} | |
| 221 | + , name; | |
| 222 | + $.each(cells, function (i, cell) { | |
| 223 | + var items = $('input,select', cell); | |
| 224 | + for (var j = 0, item; item = items[j++];) { | |
| 225 | + name = $(item).attr('name'); | |
| 226 | + if (name) { | |
| 227 | + params1[name] = $(item).val(); | |
| 228 | + } | |
| 229 | + } | |
| 230 | + }); | |
| 231 | + jsDoQuery(params1, true); | |
| 213 | 232 | }); |
| 214 | 233 | } else { |
| 215 | 234 | layer.msg('请选择日期.'); |
| 216 | 235 | } |
| 217 | 236 | }) |
| 218 | 237 | |
| 219 | - | |
| 238 | + //拆分 | |
| 239 | + $("#sortButton").on('click', function () { | |
| 240 | + if ($("#rq").val() != "") { | |
| 241 | + var id = $('input.icheck:checked').data('id'); | |
| 242 | + | |
| 243 | + if (typeof(id) == 'undefined') { | |
| 244 | + layer.msg("请选择一行进行拆分"); | |
| 245 | + } else { | |
| 246 | + //获取输入的进场存油 | |
| 247 | + var jzdl = $('.in_carpark_jzdl[data-id='+id+']', '#ll_dlb_list').html(); | |
| 248 | + var hdl= $('.in_carpark_hdl[data-id='+id+']', '#ll_dlb_list').html(); | |
| 249 | + // $("#jzyl" + id).html(); | |
| 250 | + var params = {}; | |
| 251 | + params['jzdl'] = jzdl; | |
| 252 | + params['id'] = id; | |
| 253 | + params['hdl']=hdl; | |
| 254 | + var i = layer.load(2); | |
| 255 | + $get('/dlb/sort', params, function () { | |
| 256 | + layer.close(i); | |
| 257 | + var cells = $('tr.filter')[0].cells | |
| 258 | + , params1 = {} | |
| 259 | + , name; | |
| 260 | + $.each(cells, function (i, cell) { | |
| 261 | + var items = $('input,select', cell); | |
| 262 | + for (var j = 0, item; item = items[j++];) { | |
| 263 | + name = $(item).attr('name'); | |
| 264 | + if (name) { | |
| 265 | + params1[name] = $(item).val(); | |
| 266 | + } | |
| 267 | + } | |
| 268 | + }); | |
| 269 | + jsDoQuery(params1, true); | |
| 270 | + }); | |
| 271 | + | |
| 272 | + } | |
| 273 | + } else { | |
| 274 | + layer.msg('请选择日期.'); | |
| 275 | + } | |
| 276 | + }) | |
| 220 | 277 | //获取加存信息 |
| 221 | 278 | $("#obtain").on('click', function () { |
| 222 | 279 | if ($("#rq").val() != "") { |
| ... | ... | @@ -232,7 +289,9 @@ |
| 232 | 289 | } |
| 233 | 290 | } |
| 234 | 291 | }); |
| 235 | - $get('/ylb/obtain', params, function () { | |
| 292 | + var i = layer.load(2); | |
| 293 | + $get('/dlb/obtain', params, function (s) { | |
| 294 | + layer.close(i); | |
| 236 | 295 | jsDoQuery(params, true); |
| 237 | 296 | }); |
| 238 | 297 | } else { |
| ... | ... | @@ -355,11 +414,11 @@ |
| 355 | 414 | } |
| 356 | 415 | } */ |
| 357 | 416 | var i = layer.load(2); |
| 358 | - $get('/ylb', params, function (data) { | |
| 417 | + $get('/dlb', params, function (data) { | |
| 359 | 418 | $.each(data.content, function (i, obj) { |
| 360 | 419 | obj.rq = moment(obj.rq).format("YYYY-MM-DD"); |
| 361 | 420 | }); |
| 362 | - var bodyHtm = template('ylb_list_temp', {list: data.content}); | |
| 421 | + var bodyHtm = template('dlb_list_temp', {list: data.content}); | |
| 363 | 422 | |
| 364 | 423 | $('#datatable_dlb tbody').html(bodyHtm) |
| 365 | 424 | .find('.icheck').iCheck(icheckOptions) |
| ... | ... | @@ -371,7 +430,9 @@ |
| 371 | 430 | } |
| 372 | 431 | layer.close(i); |
| 373 | 432 | |
| 374 | - startOptJzylLink($('#ll_oil_list .in_carpark_jzyl')); | |
| 433 | + startOptHdlLink($('#ll_dlb_list .in_carpark_hdl')); | |
| 434 | + startOptJzylLink($('#ll_dlb_list .in_carpark_jzdl')); | |
| 435 | + | |
| 375 | 436 | }); |
| 376 | 437 | } |
| 377 | 438 | |
| ... | ... | @@ -389,6 +450,29 @@ |
| 389 | 450 | return '只能为数字!'; |
| 390 | 451 | if (value < 0) |
| 391 | 452 | return '值不能小于0!'; |
| 453 | + if (value > 100) | |
| 454 | + return '值不能大于100!'; | |
| 455 | + }, | |
| 456 | + inputclass: 'form-control input-medium input-edtable-sm' | |
| 457 | + }) | |
| 458 | + .on('save', function (e, params) { | |
| 459 | + $(this).text(params.newValue); | |
| 460 | + }); | |
| 461 | + } | |
| 462 | + | |
| 463 | + function startOptHdlLink(es2) { | |
| 464 | + es2.editable({ | |
| 465 | + type: 'text', | |
| 466 | + placement: 'right', | |
| 467 | + width: 100, | |
| 468 | + display: false, | |
| 469 | + validate: function (value) { | |
| 470 | + if (!value) | |
| 471 | + return '值不能为空!'; | |
| 472 | + if (isNaN(value)) | |
| 473 | + return '只能为数字!'; | |
| 474 | + if (value < 0) | |
| 475 | + return '值不能小于0!'; | |
| 392 | 476 | }, |
| 393 | 477 | inputclass: 'form-control input-medium input-edtable-sm' |
| 394 | 478 | }) | ... | ... |
src/main/resources/static/pages/forms/statement/jobSummary.html
src/main/resources/static/pages/forms/statement/lineTimeAnaly.html
| ... | ... | @@ -288,6 +288,7 @@ |
| 288 | 288 | params['type'] = "query"; |
| 289 | 289 | $("#forms .hidden").removeClass("hidden"); |
| 290 | 290 | $get('/busInterval/lineTimeAnaliy', params, function(result){ |
| 291 | + console.log(result); | |
| 291 | 292 | // 把数据填充到模版中 |
| 292 | 293 | var tbodyHtml = template('list_lineTimeAnaly',{list:result}); |
| 293 | 294 | // 把渲染好的模版html文本追加到表格中 | ... | ... |
src/main/resources/static/pages/mforms/changetochanges/changetochange.html
| ... | ... | @@ -59,6 +59,7 @@ |
| 59 | 59 | <span class="item-label" style="width: 80px;">线路: </span> <select |
| 60 | 60 | class="form-control" name="line" id="line" style="width: 180px;"></select> |
| 61 | 61 | </div> |
| 62 | + <div style="margin-top: 10px"></div> | |
| 62 | 63 | <div style="display: inline-block; margin-left: 15px;"> |
| 63 | 64 | <span class="item-label" style="width: 80px;">开始时间: </span> <input |
| 64 | 65 | class="form-control" type="text" id="startDate" | ... | ... |
src/main/resources/static/pages/mforms/shifdays/shifday.html
| ... | ... | @@ -156,15 +156,19 @@ $(function(){ |
| 156 | 156 | var date = $("#date").val(); |
| 157 | 157 | var gsdmShif = $("#gsdmShif").val(); |
| 158 | 158 | var fgsdmShif = $("#fgsdmShif").val(); |
| 159 | - $post('/mcy_forms/shifday',{gsdmShif:gsdmShif,fgsdmShif:fgsdmShif, line:line,date:date},function(result){ | |
| 160 | - $.each(result, function(i, obj) { | |
| 161 | - obj.requestType = reqCodeMap[obj.requestType]; | |
| 162 | - }); | |
| 163 | - // 把数据填充到模版中 | |
| 164 | - var tbodyHtml = template('shifday',{list:result}); | |
| 165 | - // 把渲染好的模版html文本追加到表格中 | |
| 166 | - $('#forms tbody').html(tbodyHtml); | |
| 167 | - }); | |
| 159 | + if(date=="" || date ==null){ | |
| 160 | + layer.msg('请选择日期.'); | |
| 161 | + }else{ | |
| 162 | + $post('/mcy_forms/shifday',{gsdmShif:gsdmShif,fgsdmShif:fgsdmShif, line:line,date:date},function(result){ | |
| 163 | + $.each(result, function(i, obj) { | |
| 164 | + obj.requestType = reqCodeMap[obj.requestType]; | |
| 165 | + }); | |
| 166 | + // 把数据填充到模版中 | |
| 167 | + var tbodyHtml = template('shifday',{list:result}); | |
| 168 | + // 把渲染好的模版html文本追加到表格中 | |
| 169 | + $('#forms tbody').html(tbodyHtml); | |
| 170 | + }); | |
| 171 | + } | |
| 168 | 172 | }); |
| 169 | 173 | |
| 170 | 174 | $("#export").on("click",function(){ | ... | ... |
src/main/resources/static/pages/mforms/shiftuehiclemanths/shiftuehiclemanth.html
| ... | ... | @@ -40,6 +40,9 @@ |
| 40 | 40 | <span class="item-label" style="width: 80px;">线路: </span> |
| 41 | 41 | <select class="form-control" name="line" id="line" style="width: 136px;"></select> |
| 42 | 42 | </div> |
| 43 | + <div style="margin-top: 10px"> | |
| 44 | + | |
| 45 | + </div> | |
| 43 | 46 | <div style="display: inline-block;margin-left: 15px;"> |
| 44 | 47 | <span class="item-label" style="width: 80px;">开始时间: </span> |
| 45 | 48 | <input class="form-control" type="text" id="startDate" style="width: 120px;"/> | ... | ... |
src/main/resources/static/pages/mforms/singledatas/singledata.html
| ... | ... | @@ -40,6 +40,7 @@ |
| 40 | 40 | <span class="item-label" style="width: 80px;">线路: </span> |
| 41 | 41 | <select class="form-control" name="line" id="line" style="width: 136px;"></select> |
| 42 | 42 | </div> |
| 43 | + <div style="margin-top: 10px"></div> | |
| 43 | 44 | <div style="display: inline-block;margin-left: 15px;"> |
| 44 | 45 | <span class="item-label" style="width: 80px;">开始时间: </span> |
| 45 | 46 | <input class="form-control" type="text" id="startDate" style="width: 120px;"/> | ... | ... |
src/main/resources/static/pages/mforms/turnoutrates/turnoutrate.html
| ... | ... | @@ -183,7 +183,9 @@ |
| 183 | 183 | gsdmTurn=$("#gsdmTurn").val(); |
| 184 | 184 | fgsdmTurn=$("#fgsdmTurn").val(); |
| 185 | 185 | if(startDate1!=''&&endDate1!=''){ |
| 186 | - $post('/mcy_forms/turnoutrate',{ gsdmTurn:gsdmTurn,fgsdmTurn:fgsdmTurn, line:line,startDate:$("#startDate").val(),endDate:$("#endDate").val(),type:'query'},function(result){ | |
| 186 | +// $post('/mcy_forms/turnoutrate', | |
| 187 | +// { gsdmTurn:gsdmTurn,fgsdmTurn:fgsdmTurn, line:line,startDate:$("#startDate").val(),endDate:$("#endDate").val(),type:'query'},function(result){ | |
| 188 | + var result=[]; | |
| 187 | 189 | // 把数据填充到模版中 |
| 188 | 190 | var tbodyHtml = template('turnoutrate',{list:result}); |
| 189 | 191 | // 把渲染好的模版html文本追加到表格中 |
| ... | ... | @@ -235,7 +237,7 @@ |
| 235 | 237 | obj.updateDate = moment(obj.startDate).format("YYYY-MM-DD HH:mm:ss"); |
| 236 | 238 | }); |
| 237 | 239 | |
| 238 | - }) | |
| 240 | +// }) | |
| 239 | 241 | |
| 240 | 242 | }else{ |
| 241 | 243 | alert("请选择时间范围!"); | ... | ... |
src/main/resources/static/pages/mforms/waybilldays/waybillday.html
| ... | ... | @@ -141,16 +141,19 @@ |
| 141 | 141 | date = $("#date").val(); |
| 142 | 142 | gsdmWaybillday=$("#gsdmWaybillday").val(); |
| 143 | 143 | fgsdmWaybillday = $("#fgsdmWaybillday").val(); |
| 144 | - | |
| 145 | - $post('/mcy_forms/waybillday',{gsdmWaybillday:gsdmWaybillday,fgsdmWaybillday:fgsdmWaybillday, line:line,date:$("#date").val(),type:'query'},function(result){ | |
| 146 | - $.each(result, function(i, obj) { | |
| 147 | - obj.requestType = reqCodeMap[obj.requestType]; | |
| 148 | - }); | |
| 149 | - // 把数据填充到模版中 | |
| 150 | - var tbodyHtml = template('waybillday',{list:result}); | |
| 151 | - // 把渲染好的模版html文本追加到表格中 | |
| 152 | - $('#forms tbody').html(tbodyHtml); | |
| 153 | - }); | |
| 144 | + if(date=="" || date ==null){ | |
| 145 | + layer.msg('请选择日期.'); | |
| 146 | + }else{ | |
| 147 | + $post('/mcy_forms/waybillday',{gsdmWaybillday:gsdmWaybillday,fgsdmWaybillday:fgsdmWaybillday, line:line,date:date,type:'query'},function(result){ | |
| 148 | + $.each(result, function(i, obj) { | |
| 149 | + obj.requestType = reqCodeMap[obj.requestType]; | |
| 150 | + }); | |
| 151 | + // 把数据填充到模版中 | |
| 152 | + var tbodyHtml = template('waybillday',{list:result}); | |
| 153 | + // 把渲染好的模版html文本追加到表格中 | |
| 154 | + $('#forms tbody').html(tbodyHtml); | |
| 155 | + }); | |
| 156 | + } | |
| 154 | 157 | }); |
| 155 | 158 | |
| 156 | 159 | $("#export").on("click",function(){ | ... | ... |
src/main/resources/static/pages/oil/list_ph.html
| ... | ... | @@ -81,24 +81,30 @@ |
| 81 | 81 | <td > |
| 82 | 82 | 线路: |
| 83 | 83 | </td> |
| 84 | - <td colspan="3"> | |
| 84 | + <td colspan="2"> | |
| 85 | 85 | <select class="form-control" name="xlbm_like" id="xlbm" style="width: 120px;"></select> |
| 86 | - | |
| 87 | 86 | </td> |
| 88 | 87 | <td > |
| 89 | 88 | 内部编码: |
| 90 | 89 | </td> |
| 91 | - <td colspan="3"> | |
| 90 | + <td colspan="4"> | |
| 91 | + <div style="float:left;"> | |
| 92 | 92 | <select class="form-control" name="nbbm_eq" id="nbbm" style="width: 120px;"></select> |
| 93 | + </div> | |
| 94 | + <div style="float:left;"> | |
| 95 | + <button class="btn btn-sm #000 btn-outline filter-cancel" style="margin-right:0px"> | |
| 96 | + <i class="fa fa-times"></i> | |
| 97 | + </button> | |
| 98 | + </div> | |
| 93 | 99 | </td> |
| 94 | - <td colspan="4"> | |
| 100 | + <td colspan="1"> | |
| 95 | 101 | <button class="btn btn-sm green btn-outline filter-submit margin-bottom" style="margin-right:0px"> |
| 96 | 102 | <i class="fa fa-search"></i> 搜索 |
| 97 | 103 | </button> |
| 98 | 104 | |
| 99 | - <button class="btn btn-sm red btn-outline filter-cancel" style="margin-right:0px"> | |
| 100 | - <i class="fa fa-times"></i> 重置 | |
| 101 | - </button> | |
| 105 | +<!-- <button class="btn btn-sm red btn-outline filter-cancel" style="margin-right:0px"> --> | |
| 106 | +<!-- <i class="fa fa-times"></i> 重置 --> | |
| 107 | +<!-- </button> --> | |
| 102 | 108 | |
| 103 | 109 | </td> |
| 104 | 110 | </tr> |
| ... | ... | @@ -110,8 +116,6 @@ |
| 110 | 116 | <th width="5%">自编号</th> |
| 111 | 117 | <th width="6%">驾驶员</th> |
| 112 | 118 | <th width="4%">加油量</th> |
| 113 | - <th width="5%">出场公里</th> | |
| 114 | - <th width="4%">进场公里</th> | |
| 115 | 119 | <th width="4%">出场存油</th> |
| 116 | 120 | <th width="4%">进场存油</th> |
| 117 | 121 | <th width="5%">油耗</th> |
| ... | ... | @@ -122,7 +126,7 @@ |
| 122 | 126 | <th width="5%">当日总里程</th> |
| 123 | 127 | <th width="5%">数据类型</th> |
| 124 | 128 | <th width="5%">百公里油耗</th> |
| 125 | - <!-- <th width="5%">操作</th> --> | |
| 129 | +<!-- <th width="5%">操作</th> --> | |
| 126 | 130 | </tr> |
| 127 | 131 | </thead> |
| 128 | 132 | <tbody></tbody> |
| ... | ... | @@ -162,12 +166,6 @@ |
| 162 | 166 | {{obj.jzl}} |
| 163 | 167 | </td> |
| 164 | 168 | <td> |
| 165 | - {{obj.czlc}} | |
| 166 | - </td> | |
| 167 | - <td> | |
| 168 | - {{obj.jzlc}} | |
| 169 | - </td> | |
| 170 | - <td> | |
| 171 | 169 | {{obj.czyl}} |
| 172 | 170 | </td> |
| 173 | 171 | <td> |
| ... | ... | @@ -185,10 +183,22 @@ |
| 185 | 183 | {{obj.ns}} |
| 186 | 184 | </td> |
| 187 | 185 | <td> |
| 188 | - {{obj.shyy}} | |
| 186 | + <select data-id="{{obj.id}}" class="in_carpark_shyy"> | |
| 187 | + <option value='0' {{if obj.shyy==0}} selected = 'selected' {{/if}}>请选择</option> | |
| 188 | + <option value='1' {{if obj.shyy==1}} selected = 'selected' {{/if}}>票务用油</option> | |
| 189 | + <option value='2' {{if obj.shyy==2}} selected = 'selected' {{/if}}>保养用油</option> | |
| 190 | + <option value='3' {{if obj.shyy==3}} selected = 'selected' {{/if}}>报废车用油</option> | |
| 191 | + <option value='4' {{if obj.shyy==4}} selected = 'selected' {{/if}}>其它用油</option> | |
| 192 | + <option value='5' {{if obj.shyy==5}} selected = 'selected' {{/if}}>人保部</option> | |
| 193 | + <option value='6' {{if obj.shyy==6}} selected = 'selected' {{/if}}>车队</option> | |
| 194 | + <option value='7' {{if obj.shyy==7}} selected = 'selected' {{/if}}>车间(高保)</option> | |
| 195 | + <option value='8' {{if obj.shyy==8}} selected = 'selected' {{/if}}>车间(小修)</option> | |
| 196 | + </select> | |
| 189 | 197 | </td> |
| 190 | 198 | <td> |
| 191 | - {{obj.sh}} | |
| 199 | + <a data-id="{{obj.id}}" href="javascript:;" class="in_carpark_shyl"> | |
| 200 | + {{obj.sh}} | |
| 201 | + </a> | |
| 192 | 202 | </td> |
| 193 | 203 | <td> |
| 194 | 204 | {{obj.zlc}} |
| ... | ... | @@ -199,14 +209,11 @@ |
| 199 | 209 | <td> |
| 200 | 210 | {{obj.bglyh}} |
| 201 | 211 | </td> |
| 202 | - <td> | |
| 203 | - <!--<a class="btn btn-sm blue btn-outline" href="edit.html?no={{obj.id}}" data-pjax><i class="fa fa-edit"></i> 编辑</a>--> | |
| 204 | - </td> | |
| 205 | 212 | </tr> |
| 206 | 213 | {{/each}} |
| 207 | 214 | {{if list.length == 0}} |
| 208 | 215 | <tr> |
| 209 | - <td colspan=20><h6 class="muted">没有找到相关数据</h6></td> | |
| 216 | + <td colspan=17><h6 class="muted">没有找到相关数据</h6></td> | |
| 210 | 217 | </tr> |
| 211 | 218 | {{/if}} |
| 212 | 219 | </script> |
| ... | ... | @@ -234,7 +241,7 @@ |
| 234 | 241 | var i = layer.load(2); |
| 235 | 242 | $get('/ylb/checkYl', params, function () { |
| 236 | 243 | layer.close(i); |
| 237 | - jsDoQuery(null, true); | |
| 244 | + jsDoQuery(params, true); | |
| 238 | 245 | }); |
| 239 | 246 | } else { |
| 240 | 247 | layer.msg('请选择日期.'); |
| ... | ... | @@ -260,7 +267,7 @@ |
| 260 | 267 | var i = layer.load(2); |
| 261 | 268 | $get('/ylb/outAndIn', params, function () { |
| 262 | 269 | layer.close(i); |
| 263 | - jsDoQuery(null, true); | |
| 270 | + jsDoQuery(params, true); | |
| 264 | 271 | }); |
| 265 | 272 | } else { |
| 266 | 273 | layer.msg('请选择日期.'); |
| ... | ... | @@ -276,15 +283,31 @@ |
| 276 | 283 | } else { |
| 277 | 284 | //获取输入的进场存油 |
| 278 | 285 | var jzyl = $('.in_carpark_jzyl[data-id='+id+']', '#ll_oil_list').html(); |
| 286 | + var sh = $('.in_carpark_shyl[data-id='+id+']', '#ll_oil_list').html(); | |
| 287 | + var shyy = $('.in_carpark_shyy[data-id='+id+']', '#ll_oil_list').val(); | |
| 279 | 288 | // $("#jzyl" + id).html(); |
| 280 | 289 | var params = {}; |
| 281 | 290 | params['jzyl'] = jzyl; |
| 291 | + params['sh'] =sh; | |
| 292 | + params['shyy']=shyy; | |
| 282 | 293 | params['id'] = id; |
| 283 | - var i = layer.load(2); | |
| 294 | + var i = layer.load(2); | |
| 284 | 295 | $get('/ylb/sort', params, function () { |
| 285 | 296 | layer.close(i); |
| 286 | - jsDoQuery(null, true); | |
| 287 | - }); | |
| 297 | + var cells = $('tr.filter')[0].cells | |
| 298 | + , params1 = {} | |
| 299 | + , name; | |
| 300 | + $.each(cells, function (i, cell) { | |
| 301 | + var items = $('input,select', cell); | |
| 302 | + for (var j = 0, item; item = items[j++];) { | |
| 303 | + name = $(item).attr('name'); | |
| 304 | + if (name) { | |
| 305 | + params1[name] = $(item).val(); | |
| 306 | + } | |
| 307 | + } | |
| 308 | + }); | |
| 309 | + jsDoQuery(params1, true); | |
| 310 | + }); | |
| 288 | 311 | |
| 289 | 312 | } |
| 290 | 313 | } else { |
| ... | ... | @@ -330,7 +353,7 @@ |
| 330 | 353 | |
| 331 | 354 | //重置 |
| 332 | 355 | $('tr.filter .filter-cancel').on('click', function () { |
| 333 | - $('tr.filter input, select').val('').change(); | |
| 356 | + $('tr.filter , #nbbm').val('').change(); | |
| 334 | 357 | }); |
| 335 | 358 | |
| 336 | 359 | //提交 |
| ... | ... | @@ -431,7 +454,7 @@ |
| 431 | 454 | params['fgsdm_in']=fgsqx1; |
| 432 | 455 | } |
| 433 | 456 | } */ |
| 434 | - var i = layer.load(2); | |
| 457 | + var l = layer.load(2); | |
| 435 | 458 | $get('/ylb', params, function (data) { |
| 436 | 459 | $.each(data.content, function (i, obj) { |
| 437 | 460 | obj.rq = moment(obj.rq).format("YYYY-MM-DD"); |
| ... | ... | @@ -446,9 +469,10 @@ |
| 446 | 469 | initPagination = true; |
| 447 | 470 | showPagination(data); |
| 448 | 471 | } |
| 449 | - layer.close(i); | |
| 472 | + layer.close(l); | |
| 450 | 473 | |
| 451 | 474 | startOptJzylLink($('#ll_oil_list .in_carpark_jzyl')); |
| 475 | + startOptShylLink($('#ll_oil_list .in_carpark_shyl')); | |
| 452 | 476 | }); |
| 453 | 477 | } |
| 454 | 478 | |
| ... | ... | @@ -474,6 +498,27 @@ |
| 474 | 498 | }); |
| 475 | 499 | } |
| 476 | 500 | |
| 501 | + //改变状态 | |
| 502 | + function startOptShylLink(es) { | |
| 503 | + es.editable({ | |
| 504 | + type: 'text', | |
| 505 | + placement: 'right', | |
| 506 | + width: 100, | |
| 507 | + display: false, | |
| 508 | + validate: function (value) { | |
| 509 | + if (!value) | |
| 510 | + return '值不能为空!'; | |
| 511 | + if (isNaN(value)) | |
| 512 | + return '只能为数字!'; | |
| 513 | + if (value < 0) | |
| 514 | + return '值不能小于0!'; | |
| 515 | + }, | |
| 516 | + inputclass: 'form-control input-medium input-edtable-sm' | |
| 517 | + }) | |
| 518 | + .on('save', function (e, params) { | |
| 519 | + $(this).text(params.newValue); | |
| 520 | + }); | |
| 521 | + } | |
| 477 | 522 | function iCheckChange() { |
| 478 | 523 | var tr = $(this).parents('tr'); |
| 479 | 524 | if (this.checked) |
| ... | ... | @@ -541,11 +586,10 @@ |
| 541 | 586 | for(var code in result){ |
| 542 | 587 | data.push({id: code, text: result[code]}); |
| 543 | 588 | } |
| 544 | - console.log(data); | |
| 545 | 589 | initPinYinSelect2('#xlbm',data,''); |
| 546 | 590 | |
| 547 | 591 | }) |
| 548 | - | |
| 592 | + | |
| 549 | 593 | $('#nbbm').select2({ |
| 550 | 594 | placeholder: '搜索车辆...', |
| 551 | 595 | ajax: { |
| ... | ... | @@ -586,8 +630,7 @@ |
| 586 | 630 | return '<span style="color:gray;font-size: 12px;"> 正在搜索车辆...</span>'; |
| 587 | 631 | } |
| 588 | 632 | } |
| 589 | - }) | |
| 590 | - | |
| 633 | + }); | |
| 591 | 634 | |
| 592 | 635 | //导出 |
| 593 | 636 | |
| ... | ... | @@ -605,9 +648,7 @@ |
| 605 | 648 | } |
| 606 | 649 | } |
| 607 | 650 | }); |
| 608 | - console.log(params); | |
| 609 | 651 | $post('/ylb/listExport', params, function (result) { |
| 610 | - console.log(result); | |
| 611 | 652 | window.open("/downloadFile/download?fileName=进出场存油量" + moment($("#rq").val()).format("YYYYMMDD")); |
| 612 | 653 | }); |
| 613 | 654 | } else { | ... | ... |
src/main/resources/static/real_control_v2/fragments/north/nav/line_config/line_config.html
| ... | ... | @@ -28,6 +28,7 @@ |
| 28 | 28 | <li><a data-href="#in_park_source_panel" >原线路回场</a></li> |
| 29 | 29 | <li><a>到站缓冲区设置</a></li> |
| 30 | 30 | <li><a>应急停靠</a></li> |
| 31 | + <li><a>社会加油站</a></li> | |
| 31 | 32 | <li><a class="disabled">漂移判定</a></li> |
| 32 | 33 | <li><a class="disabled">到离站预测</a></li> |
| 33 | 34 | <li><a class="disabled">挂牌时刻表</a></li> | ... | ... |
src/main/resources/static/real_control_v2/js/forms/wrap.html
| ... | ... | @@ -62,6 +62,10 @@ |
| 62 | 62 | $('.form-page-content').load(pageUrl, function () { |
| 63 | 63 | //时间默认当天 |
| 64 | 64 | $('#date', '.form-page-content').val(moment().format('YYYY-MM-DD')); |
| 65 | + | |
| 66 | + if($("#ddrbBody").length > 0){ | |
| 67 | + $("#ddrbBody").height("620px"); | |
| 68 | + } | |
| 65 | 69 | }); |
| 66 | 70 | |
| 67 | 71 | //iframe 自适应高度 | ... | ... |
src/main/resources/static/real_control_v2/js/north/toolbar.js
| ... | ... | @@ -179,6 +179,12 @@ var gb_northToolbar = (function () { |
| 179 | 179 | }, |
| 180 | 180 | curr_date_schedule: function () { |
| 181 | 181 | open_modal('/real_control_v2/fragments/north/nav/curr_date_schedule.html', {}, modal_opts); |
| 182 | + }, | |
| 183 | + form_schedule_daily_qp: function () { | |
| 184 | + gb_embed_form_hanlde.open_modal_form_fragment('/pages/forms/statement/scheduleDailyQp.html', '调度工作日报表'); | |
| 185 | + }, | |
| 186 | + form_schedule_daily: function () { | |
| 187 | + gb_embed_form_hanlde.open_modal_form_fragment('/pages/forms/statement/scheduleDaily.html', '调度工作日报表'); | |
| 182 | 188 | } |
| 183 | 189 | }; |
| 184 | 190 | ... | ... |