Commit 0bacebd53068af2b719749d503eae0fb94618874

Authored by 廖磊
1 parent f68bab4f

车辆用电管理

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/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/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/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&lt;Jdl, Integer&gt;{
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/YlxxbRepository.java
... ... @@ -19,8 +19,8 @@ public interface YlxxbRepository extends BaseRepository&lt;Ylxxb, Integer&gt;{
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/service/forms/impl/FormsServiceImpl.java
... ... @@ -712,22 +712,20 @@ public class FormsServiceImpl implements FormsService {
712 712  
713 713 @Override
714 714 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   -
  715 + String sql="select t.schedule_date_str,"
  716 + + " t.cl_zbh,t.j_gh,t.j_name,x.yh from (select r.schedule_date_str,r.xl_bm,r.xl_name,"
  717 + + " r.cl_zbh,r.j_gh,r.j_name from bsth_c_s_sp_info_real r WHERE "
  718 + + " r.xl_bm='" + map.get("line").toString() + "' and to_days(r.schedule_date)=to_days('"+map.get("date").toString()+"') "
  719 + + " and r.gs_bm like '%"+map.get("gsdmDaily").toString()+"%' "
  720 + + " and r.fgs_bm like '%"+map.get("fgsdmDaily").toString()+"%' "
  721 + + " GROUP BY r.schedule_date_str,r.xl_bm,r.xl_name,r.cl_zbh,r.j_gh,r.j_name) t"
  722 + + " left join (select * from bsth_c_ylb y where "
  723 + + " to_days(y.rq)=to_days('"+map.get("date").toString()+"') "
  724 + + " and y.xlbm= '" + map.get("line").toString() + "'"
  725 + + " and y.ssgsdm like '%"+map.get("gsdmDaily").toString()+"%' "
  726 + + " and y.fgsdm like '%"+map.get("fgsdmDaily").toString()+"%'"
  727 + + " ) x"
  728 + + " on t.cl_zbh = x.nbbm ";
731 729 List<Daily> list = jdbcTemplate.query(sql, new RowMapper<Daily>() {
732 730 @Override
733 731 public Daily mapRow(ResultSet arg0, int arg1) throws SQLException {
... ... @@ -736,7 +734,7 @@ public class FormsServiceImpl implements FormsService {
736 734 daily.setZbh(arg0.getString("cl_zbh"));
737 735 daily.setJgh(arg0.getString("j_gh"));
738 736 daily.setjName(arg0.getString("j_name"));
739   - daily.setYh(arg0.getString("YH"));
  737 + daily.setYh(arg0.getString("yh"));
740 738 return daily;
741 739 }
742 740 });
... ...
src/main/java/com/bsth/service/oil/CdlService.java 0 → 100644
  1 +package com.bsth.service.oil;
  2 +
  3 +
  4 +import com.bsth.entity.oil.Cdl;
  5 +import com.bsth.service.BaseService;
  6 +
  7 +public interface CdlService extends BaseService<Cdl, Integer>{
  8 +}
... ...
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/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,10 +26,12 @@ 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;
... ... @@ -51,6 +53,9 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
51 53 CylRepository cylRepository;
52 54  
53 55 @Autowired
  56 + CarsRepository carsRepository;
  57 +
  58 + @Autowired
54 59 ScheduleRealInfoService scheduleRealInfoService;
55 60  
56 61 @Autowired
... ... @@ -67,6 +72,12 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
67 72 @Transactional
68 73 @Override
69 74 public String obtainDsq() {
  75 + List<Cars> carsList=carsRepository.findCars();
  76 + Map<String, Boolean> carsMap=new HashMap<String, Boolean>();
  77 + for (int i = 0; i < carsList.size(); i++) {
  78 + Cars c=carsList.get(i);
  79 + carsMap.put(c.getInsideCode(), c.getSfdc());
  80 + }
70 81 String result = "failure";
71 82 SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
72 83 Date dNow = new Date(); //当前时间
... ... @@ -91,66 +102,77 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
91 102 List<Map<String,Object>> listpb=scheduleRealInfoService.yesterdayDataList("",rq);
92 103  
93 104 for(int x=0;x<listpb.size();x++){
94   -
  105 + boolean sfdc=true;
95 106 Map<String, Object> map=listpb.get(x);
96   -
97   - //判断驾驶员驾驶的该车辆是否已经存入了(查出的结果集中日期是相同的,根据驾驶员、内部编号、线路编码判断)
98   - Ylb t=new Ylb();
99   - for(int k=0;k<ylList.size();k++){
100   - Ylb t1=ylList.get(k);
101   - if(t1.getNbbm().equals(map.get("clZbh").toString())
102   - &&t1.getJsy().equals(map.get("jGh").toString())
103   - &&t1.getXlbm().equals(map.get("xlBm").toString()))
104   - {
105   - t=t1;
106   - }
  107 + if (carsMap.get(map.get("clZbh").toString())!=null) {
  108 + sfdc= carsMap.get(map.get("clZbh").toString());
  109 + }else{
  110 + sfdc=true;
107 111 }
108   - try {
109   - //当日的第一个班次,出场油量等于前一天的最后一个班次的进场油量
110   - if(map.get("seqNumber").toString().equals("1")){
111   - for (int y = 0; y < clyList.size(); y++) {
112   - Cyl cyl=clyList.get(y);
113   - if(map.get("clZbh").toString().equals(cyl.getNbbm())){
114   - t.setCzyl(cyl.getCyl());
115   - break;
116   - }else{
117   - for (int i = 0; i < ylListBe.size(); i++) {
118   - Ylb ylb=ylListBe.get(i);
119   - if(map.get("clZbh").toString().equals(ylb.getNbbm())){
120   - t.setCzyl(ylb.getJzyl());
  112 + if(!sfdc){
  113 + //判断驾驶员驾驶的该车辆是否已经存入了(查出的结果集中日期是相同的,根据驾驶员、内部编号、线路编码判断)
  114 + Ylb t=new Ylb();
  115 + for(int k=0;k<ylList.size();k++){
  116 + Ylb t1=ylList.get(k);
  117 + if(t1.getNbbm().equals(map.get("clZbh").toString())
  118 + &&t1.getJsy().equals(map.get("jGh").toString())
  119 + &&t1.getXlbm().equals(map.get("xlBm").toString()))
  120 + {
  121 + t=t1;
  122 + }
  123 + }
  124 + try {
  125 + //当日的第一个班次,出场油量等于前一天的最后一个班次的进场油量
  126 + if(map.get("seqNumber").toString().equals("1")){
  127 + boolean fage=true;
  128 + for (int i = 0; i < ylListBe.size(); i++) {
  129 + Ylb ylb=ylListBe.get(i);
  130 + if(map.get("clZbh").toString().equals(ylb.getNbbm())){
  131 + t.setCzyl(ylb.getJzyl());
  132 + fage=false;
  133 + break;
  134 + }
  135 + }
  136 + if(fage){
  137 + for (int y = 0; y < clyList.size(); y++) {
  138 + Cyl cyl=clyList.get(y);
  139 + if(map.get("clZbh").toString().equals(cyl.getNbbm())){
  140 + t.setCzyl(cyl.getCyl());
  141 + fage=false;
121 142 break;
122   - }else{
123   - t.setCzyl(0.0);
124 143 }
125 144 }
126 145 }
  146 + if(fage){
  147 + t.setCzyl(0.0);
  148 + }
127 149 }
128   - }
129   -
130   - /*Double jzl=0.0;
131   - //把当天的YLXXB的加注量设置为当天YLB的加注量(根据车号,驾驶员判断)
132   - for(int j=0;j<ylxxList.size();j++){
133   - Ylxxb ylxxb= ylxxList.get(j);
134   - if(map.get("clZbh").toString().equals(ylxxb.getNbbm()) &&map.get("jGh").toString().equals(ylxxb.getJsy())){
135   - jzl+=ylxxb.getJzl();
  150 +
  151 + /*Double jzl=0.0;
  152 + //把当天的YLXXB的加注量设置为当天YLB的加注量(根据车号,驾驶员判断)
  153 + for(int j=0;j<ylxxList.size();j++){
  154 + Ylxxb ylxxb= ylxxList.get(j);
  155 + if(map.get("clZbh").toString().equals(ylxxb.getNbbm()) &&map.get("jGh").toString().equals(ylxxb.getJsy())){
  156 + jzl+=ylxxb.getJzl();
  157 + }
136 158 }
  159 + t.setJzl(jzl);*/
  160 + t.setNbbm(map.get("clZbh").toString());
  161 + t.setJsy(map.get("jGh")==null?"":map.get("jGh").toString());
  162 + t.setZlc(map.get("totalKilometers")==null?0.0:Double.parseDouble(df.format(Double.parseDouble(map.get("totalKilometers").toString()))));
  163 + t.setXlbm(map.get("xlBm")==null?"":map.get("xlBm").toString());
  164 + t.setJcsx(Integer.parseInt(map.get("seqNumber").toString()));
  165 + t.setSsgsdm(map.get("company")==null?"":map.get("company").toString());
  166 + t.setFgsdm(map.get("bCompany")==null?"":map.get("bCompany").toString());
  167 + t.setRq(sdf.parse(rq));
  168 + repository.save(t);
  169 + result = "success";
  170 + } catch (Exception e) {
  171 + // TODO Auto-generated catch block
  172 + e.printStackTrace();
  173 + }finally{
  174 + logger.info("setDDRB:"+result);
137 175 }
138   - t.setJzl(jzl);*/
139   - t.setNbbm(map.get("clZbh").toString());
140   - t.setJsy(map.get("jGh")==null?"":map.get("jGh").toString());
141   - t.setZlc(map.get("totalKilometers")==null?0.0:Double.parseDouble(df.format(Double.parseDouble(map.get("totalKilometers").toString()))));
142   - t.setXlbm(map.get("xlBm")==null?"":map.get("xlBm").toString());
143   - t.setJcsx(Integer.parseInt(map.get("seqNumber").toString()));
144   - t.setSsgsdm(map.get("company")==null?"":map.get("company").toString());
145   - t.setFgsdm(map.get("bCompany")==null?"":map.get("bCompany").toString());
146   - t.setRq(sdf.parse(rq));
147   - repository.save(t);
148   - result = "success";
149   - } catch (Exception e) {
150   - // TODO Auto-generated catch block
151   - e.printStackTrace();
152   - }finally{
153   - logger.info("setDDRB:"+result);
154 176 }
155 177 }
156 178  
... ... @@ -164,6 +186,12 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
164 186 @Transactional
165 187 @Override
166 188 public Map<String, Object> obtain(Map<String, Object> map2) {
  189 + List<Cars> carsList=carsRepository.findCars();
  190 + Map<String, Boolean> carsMap=new HashMap<String, Boolean>();
  191 + for (int i = 0; i < carsList.size(); i++) {
  192 + Cars c=carsList.get(i);
  193 + carsMap.put(c.getInsideCode(), c.getSfdc());
  194 + }
167 195 String rq=map2.get("rq").toString();
168 196 String line="";
169 197 if(map2.get("xlbm_eq")!=null){
... ... @@ -178,7 +206,7 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
178 206 //当天YLB信息
179 207 List<Ylb> ylList=repository.obtainYl(rq);
180 208 //当天YLXXB信息
181   - List<Ylxxb> ylxxList=ylxxbRepository.obtainYlxx(rq);
  209 + List<Ylxxb> ylxxList=ylxxbRepository.obtainYlxx(rq,0);
182 210 //前一天所有车辆最后进场班次信息
183 211 List<Ylb> ylListBe=repository.obtainYlbefore(rq);
184 212 List<Cyl> clyList=cylRepository.obtainCyl();
... ... @@ -188,70 +216,82 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
188 216 List<Ylb> updateList=new ArrayList<Ylb>();
189 217 for(int x=0;x<listpb.size();x++){
190 218 String type="add";
  219 + boolean sfdc=true;
191 220 Map<String, Object> map=listpb.get(x);
192   -
193   - //判断驾驶员驾驶的该车辆是否已经存入了(查出的结果集中日期是相同的,根据驾驶员、内部编号、线路编码判断)
194   - Ylb t=new Ylb();
195   - for(int k=0;k<ylList.size();k++){
196   - Ylb t1=ylList.get(k);
197   - if(t1.getNbbm().equals(map.get("clZbh").toString())
198   - &&t1.getJsy().equals(map.get("jGh").toString())
199   - &&t1.getXlbm().equals(map.get("xlBm").toString()))
200   - {
201   - t=t1;
202   - type="update";
203   - }
  221 + if (carsMap.get(map.get("clZbh").toString())!=null) {
  222 + sfdc= carsMap.get(map.get("clZbh").toString());
  223 + }else{
  224 + sfdc=true;
204 225 }
205   - try {
206   - //当日的第一个班次,出场油量等于前一天的最后一个班次的进场油量
207   - if(map.get("seqNumber").toString().equals("1")){
208   - for (int y = 0; y < clyList.size(); y++) {
209   - Cyl cyl=clyList.get(y);
210   - if(map.get("clZbh").toString().equals(cyl.getNbbm())){
211   - t.setCzyl(cyl.getCyl());
212   - break;
213   - }else{
214   - for (int i = 0; i < ylListBe.size(); i++) {
215   - Ylb ylb=ylListBe.get(i);
216   - if(map.get("clZbh").toString().equals(ylb.getNbbm())){
217   - t.setCzyl(ylb.getJzyl());
  226 + if(!sfdc){
  227 + //判断驾驶员驾驶的该车辆是否已经存入了(查出的结果集中日期是相同的,根据驾驶员、内部编号、线路编码判断)
  228 + Ylb t=new Ylb();
  229 + for(int k=0;k<ylList.size();k++){
  230 + Ylb t1=ylList.get(k);
  231 + if(t1.getNbbm().equals(map.get("clZbh").toString())
  232 + &&t1.getJsy().equals(map.get("jGh").toString())
  233 + &&t1.getXlbm().equals(map.get("xlBm").toString()))
  234 + {
  235 + t=t1;
  236 + type="update";
  237 + }
  238 + }
  239 + try {
  240 + //当日的第一个班次,出场油量等于前一天的最后一个班次的进场油量
  241 + if(map.get("seqNumber").toString().equals("1")){
  242 + boolean fage=true;
  243 + for (int i = 0; i < ylListBe.size(); i++) {
  244 + Ylb ylb=ylListBe.get(i);
  245 + if(map.get("clZbh").toString().equals(ylb.getNbbm())){
  246 + t.setCzyl(ylb.getJzyl());
  247 + fage=false;
  248 + break;
  249 + }
  250 + }
  251 + if(fage){
  252 + for (int y = 0; y < clyList.size(); y++) {
  253 + Cyl cyl=clyList.get(y);
  254 + if(map.get("clZbh").toString().equals(cyl.getNbbm())){
  255 + t.setCzyl(cyl.getCyl());
  256 + fage=false;
218 257 break;
219   - }else{
220   - t.setCzyl(0.0);
221 258 }
222 259 }
223 260 }
  261 + if(fage){
  262 + t.setCzyl(0.0);
  263 + }
224 264 }
225   - }
226   -
227   - Double jzl=0.0;
228   - //把当天的YLXXB的加注量设置为当天YLB的加注量(根据车号,驾驶员判断)
229   - for(int j=0;j<ylxxList.size();j++){
230   - Ylxxb ylxxb= ylxxList.get(j);
231   - if(map.get("clZbh").toString().equals(ylxxb.getNbbm()) &&map.get("jGh").toString().equals(ylxxb.getJsy())){
232   - jzl+=ylxxb.getJzl();
  265 +
  266 + Double jzl=0.0;
  267 + //把当天的YLXXB的加注量设置为当天YLB的加注量(根据车号,驾驶员判断)
  268 + for(int j=0;j<ylxxList.size();j++){
  269 + Ylxxb ylxxb= ylxxList.get(j);
  270 + if(map.get("clZbh").toString().equals(ylxxb.getNbbm()) &&map.get("jGh").toString().equals(ylxxb.getJsy())){
  271 + jzl+=ylxxb.getJzl();
  272 + }
233 273 }
  274 + t.setJzl(jzl);
  275 + t.setNbbm(map.get("clZbh").toString());
  276 + t.setJsy(map.get("jGh")==null?"":map.get("jGh").toString());
  277 + t.setZlc(map.get("totalKilometers")==null?0.0:Double.parseDouble(df.format(Double.parseDouble(map.get("totalKilometers").toString()))));
  278 + t.setXlbm(map.get("xlBm")==null?"":map.get("xlBm").toString());
  279 + t.setJcsx(Integer.parseInt(map.get("seqNumber").toString()));
  280 + t.setSsgsdm(map.get("company")==null?"":map.get("company").toString());
  281 + t.setFgsdm(map.get("bCompany")==null?"":map.get("bCompany").toString());
  282 + t.setRq(sdf.parse(rq));
  283 + /*if(type.equals("add")){
  284 + addList.add(t);
  285 + }else{
  286 + updateList.add(t);
  287 + }*/
  288 + repository.save(t);
  289 + newMap.put("status", ResponseCode.SUCCESS);
  290 + } catch (ParseException e) {
  291 + // TODO Auto-generated catch block
  292 + newMap.put("status", ResponseCode.ERROR);
  293 + e.printStackTrace();
234 294 }
235   - t.setJzl(jzl);
236   - t.setNbbm(map.get("clZbh").toString());
237   - t.setJsy(map.get("jGh")==null?"":map.get("jGh").toString());
238   - t.setZlc(map.get("totalKilometers")==null?0.0:Double.parseDouble(df.format(Double.parseDouble(map.get("totalKilometers").toString()))));
239   - t.setXlbm(map.get("xlBm")==null?"":map.get("xlBm").toString());
240   - t.setJcsx(Integer.parseInt(map.get("seqNumber").toString()));
241   - t.setSsgsdm(map.get("company")==null?"":map.get("company").toString());
242   - t.setFgsdm(map.get("bCompany")==null?"":map.get("bCompany").toString());
243   - t.setRq(sdf.parse(rq));
244   - /*if(type.equals("add")){
245   - addList.add(t);
246   - }else{
247   - updateList.add(t);
248   - }*/
249   - repository.save(t);
250   - newMap.put("status", ResponseCode.SUCCESS);
251   - } catch (ParseException e) {
252   - // TODO Auto-generated catch block
253   - newMap.put("status", ResponseCode.ERROR);
254   - e.printStackTrace();
255 295 }
256 296 }
257 297 /* try {
... ... @@ -482,7 +522,7 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
482 522 List<Cyl> cylList=cylRepository.findAll(new CustomerSpecs<Cyl>(newMap));
483 523 String rq=map.get("rq").toString();
484 524 List<Ylb> ylbList=repository.obtainYl(rq);
485   - List<Ylxxb> ylxxbList=ylxxbRepository.obtainYlxx(rq);
  525 + List<Ylxxb> ylxxbList=ylxxbRepository.obtainYlxx(rq,0);
486 526 for (int i = 0; i < ylxxbList.size(); i++) {
487 527 Boolean fage=true;
488 528 Ylxxb y1=ylxxbList.get(i);
... ...
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
... ... @@ -2376,7 +2376,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2376 2376 if (childTaskPlans.isEmpty()) {
2377 2377 if (scheduleRealInfo.getBcType().equals("in") ||
2378 2378 scheduleRealInfo.getBcType().equals("out")) {
2379   - jcclc += tempJhlc;
  2379 + if (scheduleRealInfo.getStatus() != -1) {
  2380 + jcclc += tempJhlc;
  2381 + }
2380 2382 }
2381 2383 //主任务 放空班次属于营运
2382 2384 // else if(scheduleRealInfo.getBcType().equals("venting")){
... ... @@ -3143,7 +3145,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3143 3145 ScheduleRealInfo s = scheduleRealInfoRepository.findOne(id);
3144 3146 String xlbm = s.getXlBm();
3145 3147 String fcrq = s.getScheduleDateStr();
3146   -
  3148 + //保留两位小数
  3149 + DecimalFormat df = new DecimalFormat("#.00");
3147 3150 List<Ylxxb> listYlxxb = ylxxbRepository.queryListYlxxb(s.getClZbh(), fcrq);
3148 3151 Double jzl = 0.0;
3149 3152 for (int t = 0; t < listYlxxb.size(); t++) {
... ... @@ -3162,7 +3165,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3162 3165 yh += y.getYh();
3163 3166  
3164 3167 }
3165   - map.put("jzl", jzl);
  3168 + map.put("jzl", df.format(jzl));
3166 3169 map.put("yh", yh);
3167 3170 map.put("ccyl", ccyl);
3168 3171 map.put("jcyl", jcyl);
... ...
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,7 +10,7 @@
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">
... ... @@ -21,15 +21,18 @@
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
... ... @@ -18,7 +18,7 @@
18 18  
19 19 <div class="page-head">
20 20 <div class="page-title">
21   - <h1>统计日报</h1>
  21 + <h1>工作汇总</h1>
22 22 </div>
23 23 </div>
24 24  
... ...
src/main/resources/static/pages/oil/list_ph.html
... ... @@ -554,7 +554,6 @@
554 554 for(var code in result){
555 555 data.push({id: code, text: result[code]});
556 556 }
557   - console.log(data);
558 557 initPinYinSelect2('#xlbm',data,'');
559 558  
560 559 })
... ... @@ -618,9 +617,7 @@
618 617 }
619 618 }
620 619 });
621   - console.log(params);
622 620 $post('/ylb/listExport', params, function (result) {
623   - console.log(result);
624 621 window.open("/downloadFile/download?fileName=进出场存油量" + moment($("#rq").val()).format("YYYYMMDD"));
625 622 });
626 623 } else {
... ...