Commit ac131605132b7742778f09b2f8a7ada2759d0973
1 parent
a92b3a2c
1.维修上报
Showing
11 changed files
with
356 additions
and
83 deletions
src/main/java/com/bsth/controller/realcontrol/ScheduleRealInfoController.java
| 1 | package com.bsth.controller.realcontrol; | 1 | package com.bsth.controller.realcontrol; |
| 2 | 2 | ||
| 3 | -import java.io.ByteArrayOutputStream; | ||
| 4 | -import java.io.IOException; | ||
| 5 | -import java.io.InputStream; | ||
| 6 | -import java.io.OutputStream; | ||
| 7 | -import java.net.HttpURLConnection; | ||
| 8 | -import java.net.URL; | ||
| 9 | import java.util.ArrayList; | 3 | import java.util.ArrayList; |
| 10 | import java.util.Collection; | 4 | import java.util.Collection; |
| 11 | import java.util.HashMap; | 5 | import java.util.HashMap; |
| 12 | import java.util.List; | 6 | import java.util.List; |
| 13 | import java.util.Map; | 7 | import java.util.Map; |
| 14 | 8 | ||
| 15 | -import org.apache.commons.io.IOUtils; | ||
| 16 | import org.apache.commons.lang3.StringEscapeUtils; | 9 | import org.apache.commons.lang3.StringEscapeUtils; |
| 17 | import org.joda.time.format.DateTimeFormat; | 10 | import org.joda.time.format.DateTimeFormat; |
| 18 | import org.joda.time.format.DateTimeFormatter; | 11 | import org.joda.time.format.DateTimeFormatter; |
| @@ -33,11 +26,7 @@ import com.bsth.data.schedule.DayOfSchedule; | @@ -33,11 +26,7 @@ import com.bsth.data.schedule.DayOfSchedule; | ||
| 33 | import com.bsth.data.schedule.edit_logs.service.dto.SchEditInfoDto; | 26 | import com.bsth.data.schedule.edit_logs.service.dto.SchEditInfoDto; |
| 34 | import com.bsth.entity.realcontrol.ScheduleRealInfo; | 27 | import com.bsth.entity.realcontrol.ScheduleRealInfo; |
| 35 | import com.bsth.entity.schedule.SchedulePlanInfo; | 28 | import com.bsth.entity.schedule.SchedulePlanInfo; |
| 36 | -import com.bsth.entity.sys.SysUser; | ||
| 37 | -import com.bsth.security.util.SecurityUtils; | ||
| 38 | import com.bsth.service.realcontrol.ScheduleRealInfoService; | 29 | import com.bsth.service.realcontrol.ScheduleRealInfoService; |
| 39 | -import com.bsth.util.ConfigUtil; | ||
| 40 | -import com.fasterxml.jackson.databind.ObjectMapper; | ||
| 41 | 30 | ||
| 42 | @RestController | 31 | @RestController |
| 43 | @RequestMapping("/realSchedule") | 32 | @RequestMapping("/realSchedule") |
| @@ -725,67 +714,9 @@ public class ScheduleRealInfoController extends BaseController<ScheduleRealInfo, | @@ -725,67 +714,9 @@ public class ScheduleRealInfoController extends BaseController<ScheduleRealInfo, | ||
| 725 | * @return | 714 | * @return |
| 726 | */ | 715 | */ |
| 727 | @RequestMapping(value = "wxsb", method = RequestMethod.POST) | 716 | @RequestMapping(value = "wxsb", method = RequestMethod.POST) |
| 728 | - public Map<String, Object> deleteToHistory(@RequestParam Map<String, Object> param){ | ||
| 729 | - SysUser user = SecurityUtils.getCurrentUser(); | ||
| 730 | - String uname = user.getUserName(); | ||
| 731 | - StringBuilder url = new StringBuilder(ConfigUtil.get("http.report.url")); | ||
| 732 | - url.append("?nbbm=").append(param.get("nbbm")).append("&bxy=").append(uname).append("&bxbm=").append(param.get("bxType")); | ||
| 733 | - // 分公司保存格式 分公司编码_公司编码 | ||
| 734 | - String val = BasicData.nbbm2FgsCompanyCodeMap.get(param.get("nbbm")); | ||
| 735 | - String[] arr = val.split("_"); | ||
| 736 | - if (!"22".equals(arr[1])) { | ||
| 737 | - Map<String, Object> res = new HashMap<String, Object>(); | ||
| 738 | - res.put("status", ResponseCode.ERROR); | ||
| 739 | - res.put("msg", "除金高公司外暂未开通此功能"); | ||
| 740 | - | ||
| 741 | - return res; | ||
| 742 | - } | ||
| 743 | - url.append("&fgs=").append(arr[0]); | ||
| 744 | - | ||
| 745 | - return request(url.toString()); | 717 | + public Map<String, Object> repairReport(@RequestParam Map<String, Object> param){ |
| 718 | + return scheduleRealInfoService.repairReport(param, true); | ||
| 746 | } | 719 | } |
| 747 | 720 | ||
| 748 | - @SuppressWarnings("unchecked") | ||
| 749 | - private static Map<String, Object> request(String url) { | ||
| 750 | - Map<String, Object> res = new HashMap<String, Object>(); | ||
| 751 | - res.put("status", ResponseCode.SUCCESS); | ||
| 752 | - InputStream in = null; | ||
| 753 | - HttpURLConnection con = null; | ||
| 754 | - try { | ||
| 755 | - con = (HttpURLConnection)new URL(url).openConnection(); | ||
| 756 | - con.setRequestMethod("POST"); | ||
| 757 | - con.setRequestProperty("keep-alive", "true"); | ||
| 758 | - con.setRequestProperty("accept", "application/json"); | ||
| 759 | - con.setRequestProperty("content-type", "application/json"); | ||
| 760 | - con.setDoInput(true); | ||
| 761 | - con.setReadTimeout(2500); | ||
| 762 | - con.setConnectTimeout(2500); | ||
| 763 | - | ||
| 764 | - con.connect(); | ||
| 765 | - if (con.getResponseCode() == 200) { | ||
| 766 | - in = con.getInputStream(); | ||
| 767 | - ByteArrayOutputStream bout = new ByteArrayOutputStream(); | ||
| 768 | - IOUtils.copy(in, bout); bout.close(); | ||
| 769 | - Map<String, Object> response = new ObjectMapper().readValue(bout.toByteArray(), Map.class); | ||
| 770 | - if (!"报修成功".equals(response.get("msg"))) { | ||
| 771 | - res.put("status", ResponseCode.ERROR); | ||
| 772 | - res.putAll(response); | ||
| 773 | - } | ||
| 774 | - } | ||
| 775 | - } catch (IOException e) { | ||
| 776 | - // TODO Auto-generated catch block | ||
| 777 | - res.put("status", ResponseCode.ERROR); | ||
| 778 | - res.put("msg", "调用上报接口异常"); | ||
| 779 | - } finally { | ||
| 780 | - try { | ||
| 781 | - if (in != null) in.close(); | ||
| 782 | - if (con != null) con.disconnect(); | ||
| 783 | - } catch (IOException e) { | ||
| 784 | - // TODO Auto-generated catch block | ||
| 785 | - e.printStackTrace(); | ||
| 786 | - } | ||
| 787 | - } | ||
| 788 | - | ||
| 789 | - return res; | ||
| 790 | - } | 721 | + |
| 791 | } | 722 | } |
src/main/java/com/bsth/data/schedule/DayOfSchedule.java
| @@ -10,6 +10,7 @@ import com.bsth.data.gpsdata_v2.utils.GpsDataRecovery; | @@ -10,6 +10,7 @@ import com.bsth.data.gpsdata_v2.utils.GpsDataRecovery; | ||
| 10 | import com.bsth.data.schedule.f_a_l.FirstAndLastHandler; | 10 | import com.bsth.data.schedule.f_a_l.FirstAndLastHandler; |
| 11 | import com.bsth.entity.realcontrol.LineConfig; | 11 | import com.bsth.entity.realcontrol.LineConfig; |
| 12 | import com.bsth.entity.realcontrol.ScheduleRealInfo; | 12 | import com.bsth.entity.realcontrol.ScheduleRealInfo; |
| 13 | +import com.bsth.entity.report.RepairReport; | ||
| 13 | import com.bsth.entity.schedule.SchedulePlanInfo; | 14 | import com.bsth.entity.schedule.SchedulePlanInfo; |
| 14 | import com.bsth.repository.realcontrol.ScheduleRealInfoRepository; | 15 | import com.bsth.repository.realcontrol.ScheduleRealInfoRepository; |
| 15 | import com.bsth.service.schedule.SchedulePlanInfoService; | 16 | import com.bsth.service.schedule.SchedulePlanInfoService; |
| @@ -83,6 +84,8 @@ public class DayOfSchedule { | @@ -83,6 +84,8 @@ public class DayOfSchedule { | ||
| 83 | private static ScheduleComparator.DFSJ schDFSJComparator; | 84 | private static ScheduleComparator.DFSJ schDFSJComparator; |
| 84 | 85 | ||
| 85 | private static Long sch_max_id=-1L; | 86 | private static Long sch_max_id=-1L; |
| 87 | + | ||
| 88 | + private Map<String, RepairReport> incode2report = new ConcurrentHashMap<String, RepairReport>(); | ||
| 86 | 89 | ||
| 87 | @Autowired | 90 | @Autowired |
| 88 | LineConfigData lineConfigData; | 91 | LineConfigData lineConfigData; |
| @@ -1180,4 +1183,19 @@ public class DayOfSchedule { | @@ -1180,4 +1183,19 @@ public class DayOfSchedule { | ||
| 1180 | reCalcExecPlan(sch.getClZbh()); | 1183 | reCalcExecPlan(sch.getClZbh()); |
| 1181 | } | 1184 | } |
| 1182 | } | 1185 | } |
| 1186 | + | ||
| 1187 | + /** | ||
| 1188 | + ** 用于重置维修上报计数,一般只应该在翻班的时候调用 | ||
| 1189 | + */ | ||
| 1190 | + public void resetRepairReport(String incode) { | ||
| 1191 | + incode2report.remove(incode); | ||
| 1192 | + } | ||
| 1193 | + | ||
| 1194 | + public RepairReport getLastestRepairReport(String incode) { | ||
| 1195 | + return incode2report.get(incode); | ||
| 1196 | + } | ||
| 1197 | + | ||
| 1198 | + public void setLastestRepairReport(RepairReport rr) { | ||
| 1199 | + incode2report.put(rr.getIncode(), rr); | ||
| 1200 | + } | ||
| 1183 | } | 1201 | } |
| 1184 | \ No newline at end of file | 1202 | \ No newline at end of file |
src/main/java/com/bsth/data/schedule/thread/ScheduleRefreshThread.java
| @@ -59,6 +59,7 @@ public class ScheduleRefreshThread extends Thread{ | @@ -59,6 +59,7 @@ public class ScheduleRefreshThread extends Thread{ | ||
| 59 | Set<String> cars = dayOfSchedule.findCarByLineCode(lineCode); | 59 | Set<String> cars = dayOfSchedule.findCarByLineCode(lineCode); |
| 60 | for(String car : cars){ | 60 | for(String car : cars){ |
| 61 | GpsCacheData.remove(car); | 61 | GpsCacheData.remove(car); |
| 62 | + dayOfSchedule.resetRepairReport(car); | ||
| 62 | } | 63 | } |
| 63 | //清除驾驶员上报数据 | 64 | //清除驾驶员上报数据 |
| 64 | pilotReport.clear(lineCode); | 65 | pilotReport.clear(lineCode); |
src/main/java/com/bsth/entity/report/RepairReport.java
0 → 100644
| 1 | +package com.bsth.entity.report; | ||
| 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 | + | ||
| 10 | +/** | ||
| 11 | + ** 维修上报信息 | ||
| 12 | + * @author Hill | ||
| 13 | + * | ||
| 14 | + */ | ||
| 15 | +@Entity | ||
| 16 | +@Table(name = "bsth_c_repair_report") | ||
| 17 | +public class RepairReport { | ||
| 18 | + | ||
| 19 | + @Id | ||
| 20 | + @GeneratedValue | ||
| 21 | + private Integer id; | ||
| 22 | + // 上报用户名 | ||
| 23 | + private String reportUser; | ||
| 24 | + // 上报姓名 | ||
| 25 | + private String reportName; | ||
| 26 | + // 班次ID | ||
| 27 | + private Long schId; | ||
| 28 | + // 内部编码 | ||
| 29 | + private String incode; | ||
| 30 | + // 发车时间 | ||
| 31 | + private String departureTime; | ||
| 32 | + // 报修类型 | ||
| 33 | + private String repairType; | ||
| 34 | + // 报修时间 | ||
| 35 | + private Date reportDate; | ||
| 36 | + // 报修状态 0 不报 1上报成功 -1上报失败 | ||
| 37 | + private int reportState; | ||
| 38 | + | ||
| 39 | + public Integer getId() { | ||
| 40 | + return id; | ||
| 41 | + } | ||
| 42 | + | ||
| 43 | + public void setId(Integer id) { | ||
| 44 | + this.id = id; | ||
| 45 | + } | ||
| 46 | + | ||
| 47 | + public String getReportUser() { | ||
| 48 | + return reportUser; | ||
| 49 | + } | ||
| 50 | + | ||
| 51 | + public void setReportUser(String reportUser) { | ||
| 52 | + this.reportUser = reportUser; | ||
| 53 | + } | ||
| 54 | + | ||
| 55 | + public String getReportName() { | ||
| 56 | + return reportName; | ||
| 57 | + } | ||
| 58 | + | ||
| 59 | + public void setReportName(String reportName) { | ||
| 60 | + this.reportName = reportName; | ||
| 61 | + } | ||
| 62 | + | ||
| 63 | + public Long getSchId() { | ||
| 64 | + return schId; | ||
| 65 | + } | ||
| 66 | + | ||
| 67 | + public void setSchId(Long schId) { | ||
| 68 | + this.schId = schId; | ||
| 69 | + } | ||
| 70 | + | ||
| 71 | + public String getIncode() { | ||
| 72 | + return incode; | ||
| 73 | + } | ||
| 74 | + | ||
| 75 | + public void setIncode(String incode) { | ||
| 76 | + this.incode = incode; | ||
| 77 | + } | ||
| 78 | + | ||
| 79 | + public String getDepartureTime() { | ||
| 80 | + return departureTime; | ||
| 81 | + } | ||
| 82 | + | ||
| 83 | + public void setDepartureTime(String departureTime) { | ||
| 84 | + this.departureTime = departureTime; | ||
| 85 | + } | ||
| 86 | + | ||
| 87 | + public String getRepairType() { | ||
| 88 | + return repairType; | ||
| 89 | + } | ||
| 90 | + | ||
| 91 | + public void setRepairType(String repairType) { | ||
| 92 | + this.repairType = repairType; | ||
| 93 | + } | ||
| 94 | + | ||
| 95 | + public Date getReportDate() { | ||
| 96 | + return reportDate; | ||
| 97 | + } | ||
| 98 | + | ||
| 99 | + public void setReportDate(Date reportDate) { | ||
| 100 | + this.reportDate = reportDate; | ||
| 101 | + } | ||
| 102 | + | ||
| 103 | + public int getReportState() { | ||
| 104 | + return reportState; | ||
| 105 | + } | ||
| 106 | + | ||
| 107 | + public void setReportState(int reportState) { | ||
| 108 | + this.reportState = reportState; | ||
| 109 | + } | ||
| 110 | +} |
src/main/java/com/bsth/repository/RepairReportRepository.java
0 → 100644
| 1 | +package com.bsth.repository; | ||
| 2 | + | ||
| 3 | +import org.springframework.stereotype.Repository; | ||
| 4 | + | ||
| 5 | +import com.bsth.entity.report.RepairReport; | ||
| 6 | + | ||
| 7 | +/** | ||
| 8 | + * | ||
| 9 | + * @Interface: RepairReportRepository | ||
| 10 | + * | ||
| 11 | + * @Extends : BaseRepository | ||
| 12 | + * | ||
| 13 | + * @Description: 维修上报持久化层 | ||
| 14 | + * | ||
| 15 | + * @Author Hill | ||
| 16 | + * | ||
| 17 | + * @Date 2019-09-25 | ||
| 18 | + * | ||
| 19 | + * @Version | ||
| 20 | + * | ||
| 21 | + */ | ||
| 22 | + | ||
| 23 | +@Repository | ||
| 24 | +public interface RepairReportRepository extends BaseRepository<RepairReport, Integer> { | ||
| 25 | + | ||
| 26 | +} |
src/main/java/com/bsth/service/realcontrol/ScheduleRealInfoService.java
| @@ -194,4 +194,6 @@ public interface ScheduleRealInfoService extends BaseService<ScheduleRealInfo, L | @@ -194,4 +194,6 @@ public interface ScheduleRealInfoService extends BaseService<ScheduleRealInfo, L | ||
| 194 | List<Map<String, Object>> scheduleCorrectionReport(String gsdm, String fgsdm, | 194 | List<Map<String, Object>> scheduleCorrectionReport(String gsdm, String fgsdm, |
| 195 | String line, String date, String date2); | 195 | String line, String date, String date2); |
| 196 | Integer isCircleQdz(String clzbh,String sdr,String xlbm,String qdzCode); | 196 | Integer isCircleQdz(String clzbh,String sdr,String xlbm,String qdzCode); |
| 197 | + | ||
| 198 | + Map<String, Object> repairReport(Map<String, Object> map, boolean isActive); | ||
| 197 | } | 199 | } |
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
| @@ -33,6 +33,7 @@ import com.bsth.entity.realcontrol.LineConfig; | @@ -33,6 +33,7 @@ import com.bsth.entity.realcontrol.LineConfig; | ||
| 33 | import com.bsth.entity.realcontrol.ScheduleRealInfo; | 33 | import com.bsth.entity.realcontrol.ScheduleRealInfo; |
| 34 | import com.bsth.entity.realcontrol.SvgAttribute; | 34 | import com.bsth.entity.realcontrol.SvgAttribute; |
| 35 | import com.bsth.entity.report.MileageReport; | 35 | import com.bsth.entity.report.MileageReport; |
| 36 | +import com.bsth.entity.report.RepairReport; | ||
| 36 | import com.bsth.entity.report.ScheduleCorrectionReport; | 37 | import com.bsth.entity.report.ScheduleCorrectionReport; |
| 37 | import com.bsth.entity.schedule.CarConfigInfo; | 38 | import com.bsth.entity.schedule.CarConfigInfo; |
| 38 | import com.bsth.entity.schedule.EmployeeConfigInfo; | 39 | import com.bsth.entity.schedule.EmployeeConfigInfo; |
| @@ -44,6 +45,7 @@ import com.bsth.entity.sys.SysUser; | @@ -44,6 +45,7 @@ import com.bsth.entity.sys.SysUser; | ||
| 44 | import com.bsth.repository.CarDeviceRepository; | 45 | import com.bsth.repository.CarDeviceRepository; |
| 45 | import com.bsth.repository.CarsRepository; | 46 | import com.bsth.repository.CarsRepository; |
| 46 | import com.bsth.repository.LineRepository; | 47 | import com.bsth.repository.LineRepository; |
| 48 | +import com.bsth.repository.RepairReportRepository; | ||
| 47 | import com.bsth.repository.oil.DlbRepository; | 49 | import com.bsth.repository.oil.DlbRepository; |
| 48 | import com.bsth.repository.oil.YlbRepository; | 50 | import com.bsth.repository.oil.YlbRepository; |
| 49 | import com.bsth.repository.oil.YlxxbRepository; | 51 | import com.bsth.repository.oil.YlxxbRepository; |
| @@ -66,11 +68,14 @@ import com.bsth.service.sys.DictionaryService; | @@ -66,11 +68,14 @@ import com.bsth.service.sys.DictionaryService; | ||
| 66 | import com.bsth.service.sys.DutyEmployeeService; | 68 | import com.bsth.service.sys.DutyEmployeeService; |
| 67 | import com.bsth.util.*; | 69 | import com.bsth.util.*; |
| 68 | import com.bsth.websocket.handler.SendUtils; | 70 | import com.bsth.websocket.handler.SendUtils; |
| 71 | +import com.fasterxml.jackson.databind.ObjectMapper; | ||
| 69 | import com.github.stuxuhai.jpinyin.PinyinException; | 72 | import com.github.stuxuhai.jpinyin.PinyinException; |
| 70 | import com.github.stuxuhai.jpinyin.PinyinFormat; | 73 | import com.github.stuxuhai.jpinyin.PinyinFormat; |
| 71 | import com.github.stuxuhai.jpinyin.PinyinHelper; | 74 | import com.github.stuxuhai.jpinyin.PinyinHelper; |
| 72 | import com.google.common.base.Splitter; | 75 | import com.google.common.base.Splitter; |
| 73 | import com.google.common.collect.Lists; | 76 | import com.google.common.collect.Lists; |
| 77 | + | ||
| 78 | +import org.apache.commons.io.IOUtils; | ||
| 74 | import org.apache.commons.lang3.StringEscapeUtils; | 79 | import org.apache.commons.lang3.StringEscapeUtils; |
| 75 | import org.apache.commons.lang3.StringUtils; | 80 | import org.apache.commons.lang3.StringUtils; |
| 76 | import org.joda.time.format.DateTimeFormat; | 81 | import org.joda.time.format.DateTimeFormat; |
| @@ -82,8 +87,14 @@ import org.springframework.jdbc.core.BeanPropertyRowMapper; | @@ -82,8 +87,14 @@ import org.springframework.jdbc.core.BeanPropertyRowMapper; | ||
| 82 | import org.springframework.jdbc.core.JdbcTemplate; | 87 | import org.springframework.jdbc.core.JdbcTemplate; |
| 83 | import org.springframework.jdbc.core.RowMapper; | 88 | import org.springframework.jdbc.core.RowMapper; |
| 84 | import org.springframework.stereotype.Service; | 89 | import org.springframework.stereotype.Service; |
| 90 | +import org.springframework.transaction.annotation.Transactional; | ||
| 85 | 91 | ||
| 92 | +import java.io.ByteArrayOutputStream; | ||
| 86 | import java.io.File; | 93 | import java.io.File; |
| 94 | +import java.io.IOException; | ||
| 95 | +import java.io.InputStream; | ||
| 96 | +import java.net.HttpURLConnection; | ||
| 97 | +import java.net.URL; | ||
| 87 | import java.sql.ResultSet; | 98 | import java.sql.ResultSet; |
| 88 | import java.sql.SQLException; | 99 | import java.sql.SQLException; |
| 89 | import java.text.DecimalFormat; | 100 | import java.text.DecimalFormat; |
| @@ -168,6 +179,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -168,6 +179,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 168 | 179 | ||
| 169 | @Autowired | 180 | @Autowired |
| 170 | CarsRepository carsRepository; | 181 | CarsRepository carsRepository; |
| 182 | + | ||
| 183 | + @Autowired | ||
| 184 | + RepairReportRepository repairReportRepository; | ||
| 171 | Logger logger = LoggerFactory.getLogger(this.getClass()); | 185 | Logger logger = LoggerFactory.getLogger(this.getClass()); |
| 172 | 186 | ||
| 173 | SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), | 187 | SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), |
| @@ -1525,6 +1539,13 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -1525,6 +1539,13 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 1525 | Map<String, Object> rs = new HashMap<>(); | 1539 | Map<String, Object> rs = new HashMap<>(); |
| 1526 | List<ScheduleRealInfo> ts = new ArrayList<>(); | 1540 | List<ScheduleRealInfo> ts = new ArrayList<>(); |
| 1527 | try { | 1541 | try { |
| 1542 | + // 维修上报 | ||
| 1543 | + if (StringUtils.isNotBlank(map.get("repairTypes"))) { | ||
| 1544 | + Map<String, Object> param = new HashMap<String, Object>(); | ||
| 1545 | + param.putAll(map); | ||
| 1546 | + repairReport(param, false); | ||
| 1547 | + } | ||
| 1548 | + | ||
| 1528 | Long id = Long.parseLong(map.get("id")); | 1549 | Long id = Long.parseLong(map.get("id")); |
| 1529 | String remarks = map.get("remarks"); | 1550 | String remarks = map.get("remarks"); |
| 1530 | 1551 | ||
| @@ -6020,6 +6041,104 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -6020,6 +6041,104 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 6020 | Integer num2=num==0L?0:1; | 6041 | Integer num2=num==0L?0:1; |
| 6021 | return num2; | 6042 | return num2; |
| 6022 | } | 6043 | } |
| 6044 | + | ||
| 6045 | + @SuppressWarnings("unchecked") | ||
| 6046 | + private static Map<String, Object> request(String url) { | ||
| 6047 | + Map<String, Object> res = new HashMap<String, Object>(); | ||
| 6048 | + res.put("status", ResponseCode.SUCCESS); | ||
| 6049 | + InputStream in = null; | ||
| 6050 | + HttpURLConnection con = null; | ||
| 6051 | + try { | ||
| 6052 | + con = (HttpURLConnection)new URL(url).openConnection(); | ||
| 6053 | + con.setRequestMethod("POST"); | ||
| 6054 | + con.setRequestProperty("keep-alive", "true"); | ||
| 6055 | + con.setRequestProperty("accept", "application/json"); | ||
| 6056 | + con.setRequestProperty("content-type", "application/json"); | ||
| 6057 | + con.setDoInput(true); | ||
| 6058 | + con.setReadTimeout(2500); | ||
| 6059 | + con.setConnectTimeout(2500); | ||
| 6060 | + | ||
| 6061 | + con.connect(); | ||
| 6062 | + if (con.getResponseCode() == 200) { | ||
| 6063 | + in = con.getInputStream(); | ||
| 6064 | + ByteArrayOutputStream bout = new ByteArrayOutputStream(); | ||
| 6065 | + IOUtils.copy(in, bout); bout.close(); | ||
| 6066 | + Map<String, Object> response = new ObjectMapper().readValue(bout.toByteArray(), Map.class); | ||
| 6067 | + if (!"报修成功".equals(response.get("msg"))) { | ||
| 6068 | + res.put("status", ResponseCode.ERROR); | ||
| 6069 | + res.putAll(response); | ||
| 6070 | + } | ||
| 6071 | + } | ||
| 6072 | + } catch (IOException e) { | ||
| 6073 | + // TODO Auto-generated catch block | ||
| 6074 | + res.put("status", ResponseCode.ERROR); | ||
| 6075 | + res.put("msg", "调用上报接口异常"); | ||
| 6076 | + } finally { | ||
| 6077 | + try { | ||
| 6078 | + if (in != null) in.close(); | ||
| 6079 | + if (con != null) con.disconnect(); | ||
| 6080 | + } catch (IOException e) { | ||
| 6081 | + // TODO Auto-generated catch block | ||
| 6082 | + e.printStackTrace(); | ||
| 6083 | + } | ||
| 6084 | + } | ||
| 6085 | + | ||
| 6086 | + return res; | ||
| 6087 | + } | ||
| 6088 | + | ||
| 6089 | + /** | ||
| 6090 | + ** 维修记录上报 | ||
| 6091 | + * @param param 参数信息 | ||
| 6092 | + * @param isActive 主/被动上报 | ||
| 6093 | + */ | ||
| 6094 | + @Override | ||
| 6095 | + @Transactional | ||
| 6096 | + public Map<String, Object> repairReport(Map<String, Object> param, boolean isActive) { | ||
| 6097 | + Map<String, Object> res = new HashMap<String, Object>(); | ||
| 6098 | + res.put("status", ResponseCode.SUCCESS); | ||
| 6099 | + // 获取实际排班信息 | ||
| 6100 | + Long id = Long.parseLong((String)param.get("id")); | ||
| 6101 | + ScheduleRealInfo sch = dayOfSchedule.get(id); | ||
| 6102 | + | ||
| 6103 | + if (null == sch) { | ||
| 6104 | + res.put("status", ResponseCode.ERROR); | ||
| 6105 | + res.put("msg", "不存在的班次!"); | ||
| 6106 | + | ||
| 6107 | + return res; | ||
| 6108 | + } | ||
| 6109 | + | ||
| 6110 | + int reportState = -1; | ||
| 6111 | + SysUser user = SecurityUtils.getCurrentUser(); | ||
| 6112 | + String reportUser = user.getUserName(), reportName = user.getName(), incode = (String)param.get("clZbh"), repairTypes = (String)param.get("repairTypes"); | ||
| 6113 | + // 分公司保存格式 分公司编码_公司编码 | ||
| 6114 | + String val = BasicData.nbbm2FgsCompanyCodeMap.get(incode); | ||
| 6115 | + String[] arr = val.split("_"); | ||
| 6116 | + StringBuilder url = new StringBuilder(ConfigUtil.get("http.report.url." + arr[1])); | ||
| 6117 | + url.append("?nbbm=").append(incode).append("&bxy=").append(reportUser).append("&bxbm=").append(repairTypes).append("&fgs=").append(arr[0]); | ||
| 6118 | + | ||
| 6119 | + RepairReport lrr = dayOfSchedule.getLastestRepairReport(incode); | ||
| 6120 | + // 非主动上报并且无上报记录或上次已上报或上次上报的同一个班次 则不用上报 | ||
| 6121 | + if (!isActive && (lrr == null || lrr.getReportState() != 0 || lrr.getSchId().equals(id))) { | ||
| 6122 | + reportState = 0; | ||
| 6123 | + } else { | ||
| 6124 | + res = request(url.toString()); | ||
| 6125 | + if (ResponseCode.SUCCESS.equals(res.get("status"))) reportState = 1; | ||
| 6126 | + } | ||
| 6127 | + // 持久化此次上报记录 | ||
| 6128 | + RepairReport rr = new RepairReport(); | ||
| 6129 | + rr.setReportUser(reportUser); | ||
| 6130 | + rr.setReportName(reportName); | ||
| 6131 | + rr.setSchId(id); | ||
| 6132 | + rr.setIncode(incode); | ||
| 6133 | + rr.setDepartureTime(sch.getFcsj()); | ||
| 6134 | + rr.setRepairType(repairTypes); | ||
| 6135 | + rr.setReportDate(new Date()); | ||
| 6136 | + rr.setReportState(reportState); | ||
| 6137 | + repairReportRepository.save(rr); | ||
| 6138 | + dayOfSchedule.setLastestRepairReport(rr); | ||
| 6139 | + | ||
| 6140 | + return res; | ||
| 6141 | + } | ||
| 6023 | } | 6142 | } |
| 6024 | 6143 | ||
| 6025 | class AccountMap implements Comparator<Map<String, Object>> { | 6144 | class AccountMap implements Comparator<Map<String, Object>> { |
src/main/resources/application-prod.properties
| @@ -2,7 +2,7 @@ server.port=9088 | @@ -2,7 +2,7 @@ server.port=9088 | ||
| 2 | management.port= 9001 | 2 | management.port= 9001 |
| 3 | management.address= 127.0.0.1 | 3 | management.address= 127.0.0.1 |
| 4 | 4 | ||
| 5 | -spring.jpa.hibernate.ddl-auto= none | 5 | +spring.jpa.hibernate.ddl-auto= update |
| 6 | spring.jpa.hibernate.naming_strategy= org.hibernate.cfg.ImprovedNamingStrategy | 6 | spring.jpa.hibernate.naming_strategy= org.hibernate.cfg.ImprovedNamingStrategy |
| 7 | #DATABASE | 7 | #DATABASE |
| 8 | spring.jpa.database= MYSQL | 8 | spring.jpa.database= MYSQL |
| @@ -30,4 +30,11 @@ http.gps.real.url= http://10.10.200.79:8080/transport_server/rtgps/ | @@ -30,4 +30,11 @@ http.gps.real.url= http://10.10.200.79:8080/transport_server/rtgps/ | ||
| 30 | ## gateway send directive | 30 | ## gateway send directive |
| 31 | http.send.directive = http://10.10.200.79:8080/transport_server/message/ | 31 | http.send.directive = http://10.10.200.79:8080/transport_server/message/ |
| 32 | ## wxsb | 32 | ## wxsb |
| 33 | -http.report.url= http://116.247.73.122:9098/jgjwsystem_j2ee/clbx/clbx_dd_gps.do | ||
| 34 | \ No newline at end of file | 33 | \ No newline at end of file |
| 34 | +#http.report.url.05= http://192.168.168.154:8088/ygjwsystem_j2ee/clbx/clbx_dd.do | ||
| 35 | +#http.report.url.22= http://192.168.168.154:8088/jgjwsystem_j2ee/clbx/clbx_dd.do | ||
| 36 | +#http.report.url.26= http://192.168.168.154:8088/nhjwsystem_j2ee/clbx/clbx_dd.do | ||
| 37 | +#http.report.url.55= http://192.168.168.154:8088/snjwsystem_j2ee/clbx/clbx_dd.do | ||
| 38 | +http.report.url.05= http://116.228.197.222:8081/ygjwsystem_j2ee/clbx/clbx_dd.do | ||
| 39 | +http.report.url.22= http://116.247.73.122:9098/jgjwsystem_j2ee/clbx/clbx_dd.do | ||
| 40 | +http.report.url.26= http://116.236.141.34:8088/nhjwsystem_j2ee/clbx/clbx_dd.do | ||
| 41 | +http.report.url.55= http://180.168.216.248:8088/snjwsystem_j2ee/clbx/clbx_dd.do | ||
| 35 | \ No newline at end of file | 42 | \ No newline at end of file |
src/main/resources/static/real_control_v2/css/line_schedule.css
| @@ -370,6 +370,23 @@ span.fcsj-diff { | @@ -370,6 +370,23 @@ span.fcsj-diff { | ||
| 370 | padding-left: 12px; | 370 | padding-left: 12px; |
| 371 | } | 371 | } |
| 372 | 372 | ||
| 373 | +.repair-type-checkbox-list { | ||
| 374 | + height: 180px; | ||
| 375 | + overflow: auto; | ||
| 376 | + border: 1px solid #c4c4c4; | ||
| 377 | + border-radius: 4px; | ||
| 378 | + padding: 9px 0; | ||
| 379 | +} | ||
| 380 | + | ||
| 381 | +.repair-type-checkbox-list label { | ||
| 382 | + display: block; | ||
| 383 | + font-size: 14px; | ||
| 384 | + border-bottom: 1px dashed #e6e3e3; | ||
| 385 | + height: 30px; | ||
| 386 | + line-height: 30px; | ||
| 387 | + padding-left: 12px; | ||
| 388 | +} | ||
| 389 | + | ||
| 373 | /*.sch-time-checkbox-list label input[type=checkbox] { | 390 | /*.sch-time-checkbox-list label input[type=checkbox] { |
| 374 | width: 20px; | 391 | width: 20px; |
| 375 | height: 18px !important; | 392 | height: 18px !important; |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/fcxxwt.html
| @@ -125,6 +125,21 @@ | @@ -125,6 +125,21 @@ | ||
| 125 | </div> | 125 | </div> |
| 126 | </div> | 126 | </div> |
| 127 | </div> | 127 | </div> |
| 128 | + <div class="uk-grid"> | ||
| 129 | + <div class="uk-width-1-1"> | ||
| 130 | + <div class="uk-form-row"> | ||
| 131 | + <label class="uk-form-label" >维修类型</label> | ||
| 132 | + <div class="uk-form-controls repair-type-checkbox-list"> | ||
| 133 | + {{each repairTypes as repair i}} | ||
| 134 | + <label> | ||
| 135 | + <input class="i-cbox" name="repairTypes[]" value="{{repair.code}}" type="checkbox" title="{{repair.name}}"> | ||
| 136 | + {{repair.name}} | ||
| 137 | + </label> | ||
| 138 | + {{/each}} | ||
| 139 | + </div> | ||
| 140 | + </div> | ||
| 141 | + </div> | ||
| 142 | + </div> | ||
| 128 | <div class="uk-grid"> | 143 | <div class="uk-grid"> |
| 129 | <div class="uk-width-1-1"> | 144 | <div class="uk-width-1-1"> |
| 130 | <div class="uk-form-row ct-stacked"> | 145 | <div class="uk-form-row ct-stacked"> |
| @@ -166,13 +181,23 @@ | @@ -166,13 +181,23 @@ | ||
| 166 | <script> | 181 | <script> |
| 167 | (function() { | 182 | (function() { |
| 168 | var adjustExps = ['配车', '保养', '故障', '肇事', '路阻', '纠纷', '缺人', '客稀', '缺车', '气候', '援外', '吊慢', '抽减', '其他']; | 183 | var adjustExps = ['配车', '保养', '故障', '肇事', '路阻', '纠纷', '缺人', '客稀', '缺车', '气候', '援外', '吊慢', '抽减', '其他']; |
| 184 | + var repairTypes = [{name:"轨迹不连续", code:"9101"}, {name:"无轨迹", code:"9102"}, {name:"收不到调度指令", code:"9103"}, {name:"调度指令延迟", code:"9105"}, {name:"信号漂移", code:"9104"}, {name:"其它GPS报修", code:"9109"}]; | ||
| 169 | var modal = '#schedule-fcxxwt-modal' | 185 | var modal = '#schedule-fcxxwt-modal' |
| 170 | ,sch; | 186 | ,sch; |
| 171 | $(modal).on('init', function(e, data) { | 187 | $(modal).on('init', function(e, data) { |
| 172 | e.stopPropagation(); | 188 | e.stopPropagation(); |
| 173 | sch=data.sch; | 189 | sch=data.sch; |
| 174 | - var formHtml = template('schedule-fcxxwt-form-temp', {sch: sch, adjustExps:adjustExps}); | 190 | + var formHtml = template('schedule-fcxxwt-form-temp', {sch: sch, adjustExps:adjustExps, repairTypes:repairTypes}); |
| 175 | $('form', modal).html(formHtml); | 191 | $('form', modal).html(formHtml); |
| 192 | + $('input:checkbox').click(function(){ | ||
| 193 | + var remark = $('[name=remarks]').val(), title = $(this).prop("title"); | ||
| 194 | + if ($(this).prop('checked')) { | ||
| 195 | + if (remark.indexOf(title) > -1) return; | ||
| 196 | + $('[name=remarks]').val((remark ? remark + ";" : "") + title); | ||
| 197 | + } else { | ||
| 198 | + $('[name=remarks]').val(remark.replace(";" + title, "").replace(title + ";", "").replace(title, "")); | ||
| 199 | + } | ||
| 200 | + }); | ||
| 176 | //字典转换 | 201 | //字典转换 |
| 177 | dictionaryUtils.transformDom($('.nt-dictionary', modal)); | 202 | dictionaryUtils.transformDom($('.nt-dictionary', modal)); |
| 178 | 203 | ||
| @@ -184,6 +209,20 @@ | @@ -184,6 +209,20 @@ | ||
| 184 | gb_common.personAutocomplete($('.jsy-autocom', modal)); | 209 | gb_common.personAutocomplete($('.jsy-autocom', modal)); |
| 185 | //售票员 | 210 | //售票员 |
| 186 | gb_common.personAutocomplete($('.spy-autocom', modal)); | 211 | gb_common.personAutocomplete($('.spy-autocom', modal)); |
| 212 | + // 维修类型选中 | ||
| 213 | + var initRepair = function() { | ||
| 214 | + var remark = $('[name=remarks]').val(), items = remark.split(';'); | ||
| 215 | + for (var i = 0;i < items.length;i++) { | ||
| 216 | + if (items[i].length > 2) { | ||
| 217 | + for (var j = 0;j < repairTypes.length;j++) { | ||
| 218 | + if (items[i] == repairTypes[j].name) { | ||
| 219 | + $('input:checkbox[value=' + repairTypes[j].code + ']').prop('checked', true); | ||
| 220 | + } | ||
| 221 | + } | ||
| 222 | + } | ||
| 223 | + } | ||
| 224 | + } | ||
| 225 | + initRepair(); | ||
| 187 | 226 | ||
| 188 | //submit | 227 | //submit |
| 189 | var f = $('form', modal).formValidation(gb_form_validation_opts); | 228 | var f = $('form', modal).formValidation(gb_form_validation_opts); |
| @@ -201,6 +240,8 @@ | @@ -201,6 +240,8 @@ | ||
| 201 | var normalDestory = data.jhlc==0 && sch.bcType != 'in' && sch.bcType != 'out'; | 240 | var normalDestory = data.jhlc==0 && sch.bcType != 'in' && sch.bcType != 'out'; |
| 202 | //修改里程 | 241 | //修改里程 |
| 203 | var editJhlc = data.jhlc != sch.jhlc && data.jhlc != 0; | 242 | var editJhlc = data.jhlc != sch.jhlc && data.jhlc != 0; |
| 243 | + // 修改报修类型为字符串 | ||
| 244 | + if (data.repairTypes) data.repairTypes = data.repairTypes.join(";"); | ||
| 204 | if(!data.adjustExps && (data.status==-1 || normalDestory || editJhlc)){ | 245 | if(!data.adjustExps && (data.status==-1 || normalDestory || editJhlc)){ |
| 205 | notify_err("当前操作需要选择调整原因!"); | 246 | notify_err("当前操作需要选择调整原因!"); |
| 206 | return; | 247 | return; |
| @@ -240,7 +281,7 @@ | @@ -240,7 +281,7 @@ | ||
| 240 | 281 | ||
| 241 | $('[name=adjustExps]', f).on('change', function(){ | 282 | $('[name=adjustExps]', f).on('change', function(){ |
| 242 | var rem=$('[name=remarks]', f); | 283 | var rem=$('[name=remarks]', f); |
| 243 | - rem.val(rem.val() + $(this).val() + ',').trigger('input'); | 284 | + rem.val((rem.val() ? rem.val() + ";" : "") + $(this).val()).trigger('input'); |
| 244 | }); | 285 | }); |
| 245 | 286 | ||
| 246 | 287 |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/wxsb.html
| @@ -14,7 +14,7 @@ | @@ -14,7 +14,7 @@ | ||
| 14 | <div class="uk-form-row"> | 14 | <div class="uk-form-row"> |
| 15 | <label class="uk-form-label" >车辆编码</label> | 15 | <label class="uk-form-label" >车辆编码</label> |
| 16 | <div class="uk-form-controls"> | 16 | <div class="uk-form-controls"> |
| 17 | - <input type="text" name="nbbm" value="{{clZbh}}" readonly> | 17 | + <input type="text" name="clZbh" value="{{clZbh}}" readonly> |
| 18 | </div> | 18 | </div> |
| 19 | </div> | 19 | </div> |
| 20 | </div> | 20 | </div> |
| @@ -22,7 +22,7 @@ | @@ -22,7 +22,7 @@ | ||
| 22 | <div class="uk-form-row"> | 22 | <div class="uk-form-row"> |
| 23 | <label class="uk-form-label" >报修类型</label> | 23 | <label class="uk-form-label" >报修类型</label> |
| 24 | <div class="uk-form-controls"> | 24 | <div class="uk-form-controls"> |
| 25 | - <select name="bxType"></select> | 25 | + <select name="repairTypes"></select> |
| 26 | </div> | 26 | </div> |
| 27 | </div> | 27 | </div> |
| 28 | </div> | 28 | </div> |
| @@ -44,12 +44,13 @@ | @@ -44,12 +44,13 @@ | ||
| 44 | var formHtml = template('schedule-wxsb-form-temp', sch); | 44 | var formHtml = template('schedule-wxsb-form-temp', sch); |
| 45 | $('form', modal).html(formHtml); | 45 | $('form', modal).html(formHtml); |
| 46 | 46 | ||
| 47 | - //班次类型字典 | ||
| 48 | - var bxtypes=[{code:"9101", des:"轨迹不连续"}, {code:"9102", des:"无轨迹"}, {code:"9103", des:"收不到调度指令"}, {code:"9104", des:"漂移"}, {code:"9109", des:"其它"}],opts=''; | ||
| 49 | - for(var i = 0;i < bxtypes.length;i++){ | ||
| 50 | - opts+='<option value="'+bxtypes[i].code+'">'+bxtypes[i].des+'</option>'; | 47 | + //报修类型字典 |
| 48 | + var opts = new Array(); | ||
| 49 | + var repairTypes=[{name:"录像不连续", code:"9201"}, {name:"无录像", code:"9202"}, {name:"录像缺通告", code:"9203"}, {name:"无法调取录像", code:"9204"}, {name:"其它录像报修", code:"9209"}, {name:"黑屏", code:"9301"}, {name:"间歇性黑屏", code:"9302"}, {name:"中门视屏无", code:"9303"}, {name:"卡在启动界面", code:"9304"}, {name:"倒车视频无", code:"9305"}, {name:"启动后显示倒车", code:"9306"}, {name:"其它屏幕报修", code:"9309"}]; | ||
| 50 | + for(var i = 0;i < repairTypes.length;i++){ | ||
| 51 | + opts.push('<option value="'+repairTypes[i].code+'">'+repairTypes[i].name+'</option>'); | ||
| 51 | } | 52 | } |
| 52 | - $('[name=bxType]', modal).html(opts); | 53 | + $('[name=repairTypes]', modal).html(opts.join("")); |
| 53 | 54 | ||
| 54 | //submit | 55 | //submit |
| 55 | var f = $('form', modal).formValidation(gb_form_validation_opts); | 56 | var f = $('form', modal).formValidation(gb_form_validation_opts); |