Commit 246d1c1eed4e14f2704e4ebf2ab2eed72409e5b6
1 parent
4f6a1b6a
fix: 添加设备号字段
Showing
22 changed files
with
228 additions
and
99 deletions
ruoyi-admin/src/main/java/com/ruoyi/propertis/SignInEnum.java renamed to ruoyi-admin/src/main/java/com/ruoyi/common/SignInEnum.java
ruoyi-admin/src/main/java/com/ruoyi/eexception/controller/EquipmentExceptionController.java
| ... | ... | @@ -2,9 +2,6 @@ package com.ruoyi.eexception.controller; |
| 2 | 2 | |
| 3 | 3 | import java.util.List; |
| 4 | 4 | import javax.servlet.http.HttpServletResponse; |
| 5 | - | |
| 6 | -import io.swagger.annotations.Api; | |
| 7 | -import io.swagger.annotations.ApiOperation; | |
| 8 | 5 | import org.springframework.security.access.prepost.PreAuthorize; |
| 9 | 6 | import org.springframework.beans.factory.annotation.Autowired; |
| 10 | 7 | import org.springframework.web.bind.annotation.GetMapping; |
| ... | ... | @@ -28,11 +25,10 @@ import com.ruoyi.common.core.page.TableDataInfo; |
| 28 | 25 | * 设备异常记录Controller |
| 29 | 26 | * |
| 30 | 27 | * @author guzijian |
| 31 | - * @date 2023-07-04 | |
| 28 | + * @date 2023-07-05 | |
| 32 | 29 | */ |
| 33 | 30 | @RestController |
| 34 | 31 | @RequestMapping("/eexception/eexception") |
| 35 | -@Api(tags = "异常设备管理") | |
| 36 | 32 | public class EquipmentExceptionController extends BaseController |
| 37 | 33 | { |
| 38 | 34 | @Autowired |
| ... | ... | @@ -41,9 +37,8 @@ public class EquipmentExceptionController extends BaseController |
| 41 | 37 | /** |
| 42 | 38 | * 查询设备异常记录列表 |
| 43 | 39 | */ |
| 44 | -// @PreAuthorize("@ss.hasPermi('eexception:eexception:list')") | |
| 40 | + @PreAuthorize("@ss.hasPermi('eexception:eexception:list')") | |
| 45 | 41 | @GetMapping("/list") |
| 46 | - @ApiOperation("查询设备异常记录列表") | |
| 47 | 42 | public TableDataInfo list(EquipmentException equipmentException) |
| 48 | 43 | { |
| 49 | 44 | startPage(); |
| ... | ... | @@ -54,10 +49,9 @@ public class EquipmentExceptionController extends BaseController |
| 54 | 49 | /** |
| 55 | 50 | * 导出设备异常记录列表 |
| 56 | 51 | */ |
| 57 | -// @PreAuthorize("@ss.hasPermi('eexception:eexception:export')") | |
| 52 | + @PreAuthorize("@ss.hasPermi('eexception:eexception:export')") | |
| 58 | 53 | @Log(title = "设备异常记录", businessType = BusinessType.EXPORT) |
| 59 | 54 | @PostMapping("/export") |
| 60 | - @ApiOperation("导出设备异常记录列表") | |
| 61 | 55 | public void export(HttpServletResponse response, EquipmentException equipmentException) |
| 62 | 56 | { |
| 63 | 57 | List<EquipmentException> list = equipmentExceptionService.selectEquipmentExceptionList(equipmentException); |
| ... | ... | @@ -68,9 +62,8 @@ public class EquipmentExceptionController extends BaseController |
| 68 | 62 | /** |
| 69 | 63 | * 获取设备异常记录详细信息 |
| 70 | 64 | */ |
| 71 | -// @PreAuthorize("@ss.hasPermi('eexception:eexception:query')") | |
| 65 | + @PreAuthorize("@ss.hasPermi('eexception:eexception:query')") | |
| 72 | 66 | @GetMapping(value = "/{id}") |
| 73 | - @ApiOperation("获取设备异常记录详细信息") | |
| 74 | 67 | public AjaxResult getInfo(@PathVariable("id") Long id) |
| 75 | 68 | { |
| 76 | 69 | return success(equipmentExceptionService.selectEquipmentExceptionById(id)); |
| ... | ... | @@ -79,10 +72,9 @@ public class EquipmentExceptionController extends BaseController |
| 79 | 72 | /** |
| 80 | 73 | * 新增设备异常记录 |
| 81 | 74 | */ |
| 82 | -// @PreAuthorize("@ss.hasPermi('eexception:eexception:add')") | |
| 75 | + @PreAuthorize("@ss.hasPermi('eexception:eexception:add')") | |
| 83 | 76 | @Log(title = "设备异常记录", businessType = BusinessType.INSERT) |
| 84 | 77 | @PostMapping |
| 85 | - @ApiOperation("新增设备异常记录") | |
| 86 | 78 | public AjaxResult add(@RequestBody EquipmentException equipmentException) |
| 87 | 79 | { |
| 88 | 80 | return toAjax(equipmentExceptionService.insertEquipmentException(equipmentException)); |
| ... | ... | @@ -91,10 +83,9 @@ public class EquipmentExceptionController extends BaseController |
| 91 | 83 | /** |
| 92 | 84 | * 修改设备异常记录 |
| 93 | 85 | */ |
| 94 | -// @PreAuthorize("@ss.hasPermi('eexception:eexception:edit')") | |
| 86 | + @PreAuthorize("@ss.hasPermi('eexception:eexception:edit')") | |
| 95 | 87 | @Log(title = "设备异常记录", businessType = BusinessType.UPDATE) |
| 96 | 88 | @PutMapping |
| 97 | - @ApiOperation("修改设备异常记录") | |
| 98 | 89 | public AjaxResult edit(@RequestBody EquipmentException equipmentException) |
| 99 | 90 | { |
| 100 | 91 | return toAjax(equipmentExceptionService.updateEquipmentException(equipmentException)); |
| ... | ... | @@ -103,10 +94,9 @@ public class EquipmentExceptionController extends BaseController |
| 103 | 94 | /** |
| 104 | 95 | * 删除设备异常记录 |
| 105 | 96 | */ |
| 106 | -// @PreAuthorize("@ss.hasPermi('eexception:eexception:remove')") | |
| 97 | + @PreAuthorize("@ss.hasPermi('eexception:eexception:remove')") | |
| 107 | 98 | @Log(title = "设备异常记录", businessType = BusinessType.DELETE) |
| 108 | 99 | @DeleteMapping("/{ids}") |
| 109 | - @ApiOperation("删除设备异常记录") | |
| 110 | 100 | public AjaxResult remove(@PathVariable Long[] ids) |
| 111 | 101 | { |
| 112 | 102 | return toAjax(equipmentExceptionService.deleteEquipmentExceptionByIds(ids)); | ... | ... |
ruoyi-admin/src/main/java/com/ruoyi/eexception/domain/EquipmentException.java
| ... | ... | @@ -9,7 +9,7 @@ import com.ruoyi.common.core.domain.BaseEntity; |
| 9 | 9 | * 设备异常记录对象 equipment_exception |
| 10 | 10 | * |
| 11 | 11 | * @author guzijian |
| 12 | - * @date 2023-07-04 | |
| 12 | + * @date 2023-07-05 | |
| 13 | 13 | */ |
| 14 | 14 | public class EquipmentException extends BaseEntity |
| 15 | 15 | { |
| ... | ... | @@ -22,12 +22,12 @@ public class EquipmentException extends BaseEntity |
| 22 | 22 | @Excel(name = "标题") |
| 23 | 23 | private String title; |
| 24 | 24 | |
| 25 | - /** 设备ip */ | |
| 26 | - @Excel(name = "设备ip") | |
| 27 | - private String equipmentIp; | |
| 25 | + /** 设备id */ | |
| 26 | + @Excel(name = "设备id") | |
| 27 | + private Long deviceId; | |
| 28 | 28 | |
| 29 | - /** 人员工号 */ | |
| 30 | - @Excel(name = "人员工号") | |
| 29 | + /** 上报人 */ | |
| 30 | + @Excel(name = "上报人") | |
| 31 | 31 | private String jobCode; |
| 32 | 32 | |
| 33 | 33 | /** 设备图片 */ |
| ... | ... | @@ -56,14 +56,14 @@ public class EquipmentException extends BaseEntity |
| 56 | 56 | { |
| 57 | 57 | return title; |
| 58 | 58 | } |
| 59 | - public void setEquipmentIp(String equipmentIp) | |
| 59 | + public void setDeviceId(Long deviceId) | |
| 60 | 60 | { |
| 61 | - this.equipmentIp = equipmentIp; | |
| 61 | + this.deviceId = deviceId; | |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | - public String getEquipmentIp() | |
| 64 | + public Long getDeviceId() | |
| 65 | 65 | { |
| 66 | - return equipmentIp; | |
| 66 | + return deviceId; | |
| 67 | 67 | } |
| 68 | 68 | public void setJobCode(String jobCode) |
| 69 | 69 | { |
| ... | ... | @@ -98,11 +98,11 @@ public class EquipmentException extends BaseEntity |
| 98 | 98 | return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
| 99 | 99 | .append("id", getId()) |
| 100 | 100 | .append("title", getTitle()) |
| 101 | - .append("equipmentIp", getEquipmentIp()) | |
| 102 | - .append("createTime", getCreateTime()) | |
| 101 | + .append("deviceId", getDeviceId()) | |
| 103 | 102 | .append("jobCode", getJobCode()) |
| 104 | 103 | .append("image", getImage()) |
| 105 | 104 | .append("status", getStatus()) |
| 105 | + .append("createTime", getCreateTime()) | |
| 106 | 106 | .append("remark", getRemark()) |
| 107 | 107 | .toString(); |
| 108 | 108 | } | ... | ... |
ruoyi-admin/src/main/java/com/ruoyi/eexception/mapper/EquipmentExceptionMapper.java
ruoyi-admin/src/main/java/com/ruoyi/eexception/service/IEquipmentExceptionService.java
ruoyi-admin/src/main/java/com/ruoyi/eexception/service/impl/EquipmentExceptionServiceImpl.java
| ... | ... | @@ -13,7 +13,7 @@ import com.ruoyi.eexception.service.IEquipmentExceptionService; |
| 13 | 13 | * 设备异常记录Service业务层处理 |
| 14 | 14 | * |
| 15 | 15 | * @author guzijian |
| 16 | - * @date 2023-07-04 | |
| 16 | + * @date 2023-07-05 | |
| 17 | 17 | */ |
| 18 | 18 | @Service |
| 19 | 19 | public class EquipmentExceptionServiceImpl implements IEquipmentExceptionService | ... | ... |
ruoyi-admin/src/main/java/com/ruoyi/equipment/controller/EquipmentController.java
| ... | ... | @@ -2,9 +2,6 @@ package com.ruoyi.equipment.controller; |
| 2 | 2 | |
| 3 | 3 | import java.util.List; |
| 4 | 4 | import javax.servlet.http.HttpServletResponse; |
| 5 | - | |
| 6 | -import io.swagger.annotations.Api; | |
| 7 | -import io.swagger.annotations.ApiOperation; | |
| 8 | 5 | import org.springframework.security.access.prepost.PreAuthorize; |
| 9 | 6 | import org.springframework.beans.factory.annotation.Autowired; |
| 10 | 7 | import org.springframework.web.bind.annotation.GetMapping; |
| ... | ... | @@ -28,11 +25,10 @@ import com.ruoyi.common.core.page.TableDataInfo; |
| 28 | 25 | * 设备信息Controller |
| 29 | 26 | * |
| 30 | 27 | * @author guzijian |
| 31 | - * @date 2023-07-04 | |
| 28 | + * @date 2023-07-05 | |
| 32 | 29 | */ |
| 33 | 30 | @RestController |
| 34 | 31 | @RequestMapping("/equipment/equipment") |
| 35 | -@Api(tags = "设备信息管理") | |
| 36 | 32 | public class EquipmentController extends BaseController |
| 37 | 33 | { |
| 38 | 34 | @Autowired |
| ... | ... | @@ -41,9 +37,8 @@ public class EquipmentController extends BaseController |
| 41 | 37 | /** |
| 42 | 38 | * 查询设备信息列表 |
| 43 | 39 | */ |
| 44 | -// @PreAuthorize("@ss.hasPermi('equipment:equipment:list')") | |
| 40 | + @PreAuthorize("@ss.hasPermi('equipment:equipment:list')") | |
| 45 | 41 | @GetMapping("/list") |
| 46 | - @ApiOperation("查询设备信息列表") | |
| 47 | 42 | public TableDataInfo list(Equipment equipment) |
| 48 | 43 | { |
| 49 | 44 | startPage(); |
| ... | ... | @@ -54,10 +49,9 @@ public class EquipmentController extends BaseController |
| 54 | 49 | /** |
| 55 | 50 | * 导出设备信息列表 |
| 56 | 51 | */ |
| 57 | -// @PreAuthorize("@ss.hasPermi('equipment:equipment:export')") | |
| 52 | + @PreAuthorize("@ss.hasPermi('equipment:equipment:export')") | |
| 58 | 53 | @Log(title = "设备信息", businessType = BusinessType.EXPORT) |
| 59 | 54 | @PostMapping("/export") |
| 60 | - @ApiOperation("导出设备信息列表") | |
| 61 | 55 | public void export(HttpServletResponse response, Equipment equipment) |
| 62 | 56 | { |
| 63 | 57 | List<Equipment> list = equipmentService.selectEquipmentList(equipment); |
| ... | ... | @@ -68,9 +62,8 @@ public class EquipmentController extends BaseController |
| 68 | 62 | /** |
| 69 | 63 | * 获取设备信息详细信息 |
| 70 | 64 | */ |
| 71 | -// @PreAuthorize("@ss.hasPermi('equipment:equipment:query')") | |
| 65 | + @PreAuthorize("@ss.hasPermi('equipment:equipment:query')") | |
| 72 | 66 | @GetMapping(value = "/{id}") |
| 73 | - @ApiOperation("获取设备信息详细信息") | |
| 74 | 67 | public AjaxResult getInfo(@PathVariable("id") Long id) |
| 75 | 68 | { |
| 76 | 69 | return success(equipmentService.selectEquipmentById(id)); |
| ... | ... | @@ -79,10 +72,9 @@ public class EquipmentController extends BaseController |
| 79 | 72 | /** |
| 80 | 73 | * 新增设备信息 |
| 81 | 74 | */ |
| 82 | -// @PreAuthorize("@ss.hasPermi('equipment:equipment:add')") | |
| 75 | + @PreAuthorize("@ss.hasPermi('equipment:equipment:add')") | |
| 83 | 76 | @Log(title = "设备信息", businessType = BusinessType.INSERT) |
| 84 | 77 | @PostMapping |
| 85 | - @ApiOperation("新增设备信息") | |
| 86 | 78 | public AjaxResult add(@RequestBody Equipment equipment) |
| 87 | 79 | { |
| 88 | 80 | return toAjax(equipmentService.insertEquipment(equipment)); |
| ... | ... | @@ -91,10 +83,9 @@ public class EquipmentController extends BaseController |
| 91 | 83 | /** |
| 92 | 84 | * 修改设备信息 |
| 93 | 85 | */ |
| 94 | -// @PreAuthorize("@ss.hasPermi('equipment:equipment:edit')") | |
| 86 | + @PreAuthorize("@ss.hasPermi('equipment:equipment:edit')") | |
| 95 | 87 | @Log(title = "设备信息", businessType = BusinessType.UPDATE) |
| 96 | 88 | @PutMapping |
| 97 | - @ApiOperation("修改设备信息") | |
| 98 | 89 | public AjaxResult edit(@RequestBody Equipment equipment) |
| 99 | 90 | { |
| 100 | 91 | return toAjax(equipmentService.updateEquipment(equipment)); |
| ... | ... | @@ -103,10 +94,9 @@ public class EquipmentController extends BaseController |
| 103 | 94 | /** |
| 104 | 95 | * 删除设备信息 |
| 105 | 96 | */ |
| 106 | -// @PreAuthorize("@ss.hasPermi('equipment:equipment:remove')") | |
| 97 | + @PreAuthorize("@ss.hasPermi('equipment:equipment:remove')") | |
| 107 | 98 | @Log(title = "设备信息", businessType = BusinessType.DELETE) |
| 108 | 99 | @DeleteMapping("/{ids}") |
| 109 | - @ApiOperation("删除设备信息") | |
| 110 | 100 | public AjaxResult remove(@PathVariable Long[] ids) |
| 111 | 101 | { |
| 112 | 102 | return toAjax(equipmentService.deleteEquipmentByIds(ids)); | ... | ... |
ruoyi-admin/src/main/java/com/ruoyi/equipment/domain/Equipment.java
| ... | ... | @@ -9,7 +9,7 @@ import com.ruoyi.common.core.domain.BaseEntity; |
| 9 | 9 | * 设备信息对象 equipment |
| 10 | 10 | * |
| 11 | 11 | * @author guzijian |
| 12 | - * @date 2023-07-04 | |
| 12 | + * @date 2023-07-05 | |
| 13 | 13 | */ |
| 14 | 14 | public class Equipment extends BaseEntity |
| 15 | 15 | { |
| ... | ... | @@ -26,8 +26,8 @@ public class Equipment extends BaseEntity |
| 26 | 26 | @Excel(name = "安置地址") |
| 27 | 27 | private String address; |
| 28 | 28 | |
| 29 | - /** ip地址 */ | |
| 30 | - @Excel(name = "ip地址") | |
| 29 | + /** 设备ip */ | |
| 30 | + @Excel(name = "设备ip") | |
| 31 | 31 | private String ip; |
| 32 | 32 | |
| 33 | 33 | /** 设备状态 */ |
| ... | ... | @@ -42,6 +42,10 @@ public class Equipment extends BaseEntity |
| 42 | 42 | @Excel(name = "设备图片") |
| 43 | 43 | private String image; |
| 44 | 44 | |
| 45 | + /** 设备号 */ | |
| 46 | + @Excel(name = "设备号") | |
| 47 | + private String deviceId; | |
| 48 | + | |
| 45 | 49 | public void setId(Long id) |
| 46 | 50 | { |
| 47 | 51 | this.id = id; |
| ... | ... | @@ -105,6 +109,15 @@ public class Equipment extends BaseEntity |
| 105 | 109 | { |
| 106 | 110 | return image; |
| 107 | 111 | } |
| 112 | + public void setDeviceId(String deviceId) | |
| 113 | + { | |
| 114 | + this.deviceId = deviceId; | |
| 115 | + } | |
| 116 | + | |
| 117 | + public String getDeviceId() | |
| 118 | + { | |
| 119 | + return deviceId; | |
| 120 | + } | |
| 108 | 121 | |
| 109 | 122 | @Override |
| 110 | 123 | public String toString() { |
| ... | ... | @@ -116,6 +129,7 @@ public class Equipment extends BaseEntity |
| 116 | 129 | .append("status", getStatus()) |
| 117 | 130 | .append("promise", getPromise()) |
| 118 | 131 | .append("image", getImage()) |
| 132 | + .append("deviceId", getDeviceId()) | |
| 119 | 133 | .append("createTime", getCreateTime()) |
| 120 | 134 | .append("updateTime", getUpdateTime()) |
| 121 | 135 | .append("createBy", getCreateBy()) | ... | ... |
ruoyi-admin/src/main/java/com/ruoyi/equipment/mapper/EquipmentMapper.java
ruoyi-admin/src/main/java/com/ruoyi/equipment/service/IEquipmentService.java
ruoyi-admin/src/main/java/com/ruoyi/equipment/service/impl/EquipmentServiceImpl.java
ruoyi-admin/src/main/java/com/ruoyi/in/service/impl/SignInServiceImpl.java
| ... | ... | @@ -2,8 +2,7 @@ package com.ruoyi.in.service.impl; |
| 2 | 2 | |
| 3 | 3 | import java.util.List; |
| 4 | 4 | import com.ruoyi.common.utils.DateUtils; |
| 5 | -import com.ruoyi.common.utils.SecurityUtils; | |
| 6 | -import com.ruoyi.propertis.SignInEnum; | |
| 5 | +import com.ruoyi.common.SignInEnum; | |
| 7 | 6 | import org.springframework.beans.factory.annotation.Autowired; |
| 8 | 7 | import org.springframework.stereotype.Service; |
| 9 | 8 | import com.ruoyi.in.mapper.SignInMapper; | ... | ... |
ruoyi-admin/src/main/java/com/ruoyi/job/DriverJob.java
| 1 | 1 | package com.ruoyi.job; |
| 2 | 2 | |
| 3 | +import com.ruoyi.common.utils.DateUtils; | |
| 3 | 4 | import com.ruoyi.driver.domain.Driver; |
| 4 | 5 | import com.ruoyi.driver.service.IDriverService; |
| 5 | 6 | import com.ruoyi.utils.ListUtils; |
| ... | ... | @@ -35,6 +36,9 @@ public class DriverJob implements InitializingBean { |
| 35 | 36 | @Value("${api.url.getDriverInfo}") |
| 36 | 37 | private String getDriverInfoUrl; |
| 37 | 38 | |
| 39 | + @Value("api.url.getSchedulingInfo") | |
| 40 | + private String getSchedulingInfoUrl; | |
| 41 | + | |
| 38 | 42 | @Value("${api.config.password}") |
| 39 | 43 | private String password; |
| 40 | 44 | |
| ... | ... | @@ -44,36 +48,29 @@ public class DriverJob implements InitializingBean { |
| 44 | 48 | private static IDriverService DRIVER_SERVICE; |
| 45 | 49 | private static RestTemplate RESTTEMPLATE; |
| 46 | 50 | |
| 47 | - private static String GET_DRIVER_INFO_URL; | |
| 48 | 51 | |
| 52 | + private static String GET_SCHEDULING_INFO_URL; | |
| 53 | + private static String GET_DRIVER_INFO_URL; | |
| 49 | 54 | private static String PASSWORD; |
| 50 | - | |
| 51 | 55 | private static String NONCE; |
| 52 | 56 | |
| 53 | 57 | /** |
| 54 | 58 | * 通过该定时任务获取驾驶员信息 并保存到数据库 |
| 59 | + * 排班信息映射 20分钟更新一次 | |
| 55 | 60 | */ |
| 56 | 61 | public void getDriverInfo(String params) throws Exception { |
| 57 | 62 | try { |
| 58 | - String format = String.format(GET_DRIVER_INFO_URL, params); | |
| 59 | - Map<String, String> configMap = new HashMap<>(5); | |
| 63 | + String getDriverInfoUrl = String.format(GET_DRIVER_INFO_URL, params); | |
| 60 | 64 | long timestamp = System.currentTimeMillis(); |
| 61 | - configMap.put("timestamp", String.valueOf(timestamp)); | |
| 62 | - configMap.put("nonce", NONCE); | |
| 63 | - configMap.put("password", PASSWORD); | |
| 64 | - String sign = getSHA1(configMap); | |
| 65 | - String url = format | |
| 66 | - + "?timestamp=" + timestamp | |
| 67 | - + "&nonce=" + NONCE | |
| 68 | - + "&password=" + PASSWORD | |
| 69 | - + "&sign=" + sign; | |
| 70 | - //生成签名 | |
| 71 | - List<Driver> drivers = RESTTEMPLATE.exchange( | |
| 72 | - url, | |
| 73 | - HttpMethod.GET, | |
| 74 | - null, | |
| 75 | - new ParameterizedTypeReference<List<Driver>>() { | |
| 76 | - }).getBody(); | |
| 65 | + | |
| 66 | + // 获取驾驶员信息 | |
| 67 | + List<Driver> drivers = getDrivers(getDriverInfoUrl,String.valueOf(timestamp)); | |
| 68 | + | |
| 69 | + // http://114.80.178.12:9089/webservice/rest/schedule_real/sch_jk/%s/%s?timestamp=%d&nonce=%s&password=%s&sign=%s | |
| 70 | +// String getSchedulingInfoUrl = String.format(GET_SCHEDULING_INFO_URL, "99", DateUtils.getDate("yyyyMMdd"), String.valueOf(timestamp), NONCE, PASSWORD, getSHA1(getStringStringMap(String.valueOf(timestamp)))); | |
| 71 | + // 获取排班信息并存入redis | |
| 72 | +// saveSchedulingToRedis(getSchedulingInfoUrl,drivers); | |
| 73 | + // 分片插入 | |
| 77 | 74 | List<List<Driver>> splitList = ListUtils.splitList(drivers, 1000); |
| 78 | 75 | System.out.println("开始更新数据-----"); |
| 79 | 76 | for (List<Driver> driverList : splitList) { |
| ... | ... | @@ -86,6 +83,43 @@ public class DriverJob implements InitializingBean { |
| 86 | 83 | System.out.println("执行结束"); |
| 87 | 84 | } |
| 88 | 85 | |
| 86 | + private void saveSchedulingToRedis(String getSchedulingInfoUrl, List<Driver> drivers) { | |
| 87 | +// ESTTEMPLATE.exchange( | |
| 88 | +// url, | |
| 89 | +// HttpMethod.GET, | |
| 90 | +// null, | |
| 91 | +// new ParameterizedTypeReference<List<Driver>>() { | |
| 92 | +// }).getBody(); | |
| 93 | +// Object forObject = restTemplate.getForObject(getSchedulingInfoUrl, Object.class); | |
| 94 | + | |
| 95 | + } | |
| 96 | + | |
| 97 | + private static List<Driver> getDrivers(String format,String timestamp) throws Exception { | |
| 98 | + Map<String, String> configMap = getStringStringMap(timestamp); | |
| 99 | + String sign = getSHA1(configMap); | |
| 100 | + String url = format | |
| 101 | + + "?timestamp=" + timestamp | |
| 102 | + + "&nonce=" + NONCE | |
| 103 | + + "&password=" + PASSWORD | |
| 104 | + + "&sign=" + sign; | |
| 105 | + //生成签名 | |
| 106 | + List<Driver> drivers = RESTTEMPLATE.exchange( | |
| 107 | + url, | |
| 108 | + HttpMethod.GET, | |
| 109 | + null, | |
| 110 | + new ParameterizedTypeReference<List<Driver>>() { | |
| 111 | + }).getBody(); | |
| 112 | + return drivers; | |
| 113 | + } | |
| 114 | + | |
| 115 | + private static Map<String, String> getStringStringMap(String timestamp) { | |
| 116 | + Map<String, String> configMap = new HashMap<>(5); | |
| 117 | + configMap.put("timestamp", String.valueOf(timestamp)); | |
| 118 | + configMap.put("nonce", NONCE); | |
| 119 | + configMap.put("password", PASSWORD); | |
| 120 | + return configMap; | |
| 121 | + } | |
| 122 | + | |
| 89 | 123 | |
| 90 | 124 | /** |
| 91 | 125 | * 获取签名 |
| ... | ... | @@ -126,23 +160,25 @@ public class DriverJob implements InitializingBean { |
| 126 | 160 | |
| 127 | 161 | } |
| 128 | 162 | |
| 129 | -// public static void main(String[] args) throws Exception{ | |
| 130 | -// RestTemplate restTemplate1 = new RestTemplate(); | |
| 163 | + public static void main(String[] args) throws Exception{ | |
| 164 | + RestTemplate restTemplate1 = new RestTemplate(); | |
| 131 | 165 | // String url = "http://101.95.136.206:9089/webservice/rest/person/company/%s"; |
| 132 | -// String format = String.format(url,"99"); | |
| 133 | -// Map<String, String> configMap = new HashMap<>(5); | |
| 134 | -// long timestamp = System.currentTimeMillis(); | |
| 135 | -// configMap.put("timestamp", String.valueOf(timestamp)); | |
| 136 | -// configMap.put("nonce", "NONCE"); | |
| 137 | -// configMap.put("password", "c4dd3d8cb9a82f6d6a625818618b28ca7bebb464"); | |
| 166 | + String url = "http://114.80.178.12:9089/webservice/rest/schedule_real/sch_jk/%s/%s?timestamp=%d&nonce=%s&password=%s&sign=%s"; | |
| 167 | + | |
| 168 | + long timestamp = System.currentTimeMillis(); | |
| 169 | + Map<String, String> configMap = new HashMap<>(5); | |
| 170 | + configMap.put("timestamp", String.valueOf(timestamp)); | |
| 171 | + configMap.put("nonce", "NONCE"); | |
| 172 | + configMap.put("password", "c4dd3d8cb9a82f6d6a625818618b28ca7bebb464"); | |
| 173 | + String format = String.format(url,"99",DateUtils.getDate("yyyyMMdd"), timestamp,"NONCE","c4dd3d8cb9a82f6d6a625818618b28ca7bebb464",getSHA1(configMap)); | |
| 138 | 174 | // String sign = getSHA1(configMap); |
| 139 | 175 | // String httpUrl = format |
| 140 | 176 | // + "?timestamp=" + timestamp |
| 141 | 177 | // + "&nonce=" + "NONCE" |
| 142 | 178 | // + "&password=" + "c4dd3d8cb9a82f6d6a625818618b28ca7bebb464" |
| 143 | 179 | // + "&sign=" + sign; |
| 144 | -// Object forObject = restTemplate1.getForObject(httpUrl, Object.class); | |
| 145 | -// } | |
| 180 | + Object forObject = restTemplate1.getForObject(format, Object.class); | |
| 181 | + } | |
| 146 | 182 | |
| 147 | 183 | @Override |
| 148 | 184 | public void afterPropertiesSet() throws Exception { |
| ... | ... | @@ -151,5 +187,6 @@ public class DriverJob implements InitializingBean { |
| 151 | 187 | PASSWORD = password; |
| 152 | 188 | RESTTEMPLATE = restTemplate; |
| 153 | 189 | DRIVER_SERVICE = driverService; |
| 190 | + GET_SCHEDULING_INFO_URL = getSchedulingInfoUrl; | |
| 154 | 191 | } |
| 155 | 192 | } | ... | ... |
ruoyi-admin/src/main/java/com/ruoyi/pojo/response/CTasks.java
0 → 100644
| 1 | +package com.ruoyi.pojo.response; | |
| 2 | + | |
| 3 | + | |
| 4 | +import lombok.Data; | |
| 5 | + | |
| 6 | +/** | |
| 7 | + * Auto-generated: 2023-07-05 21:23:27 | |
| 8 | + * | |
| 9 | + * @author json.cn (i@json.cn) | |
| 10 | + * @website http://www.json.cn/java2pojo/ | |
| 11 | + */ | |
| 12 | +@Data | |
| 13 | +public class CTasks { | |
| 14 | + | |
| 15 | + private int id; | |
| 16 | + private String type1; | |
| 17 | + private String type2; | |
| 18 | + private String startStation; | |
| 19 | + private String startStationName; | |
| 20 | + private String endStation; | |
| 21 | + private String endStationName; | |
| 22 | + private String mileageType; | |
| 23 | + private int mileage; | |
| 24 | + private String startDate; | |
| 25 | + private String endDate; | |
| 26 | + private boolean destroy; | |
| 27 | + private String destroyReason; | |
| 28 | + private long createDate; | |
| 29 | + private String remarks; | |
| 30 | + | |
| 31 | +} | |
| 0 | 32 | \ No newline at end of file | ... | ... |
ruoyi-admin/src/main/java/com/ruoyi/pojo/response/ResponseScheduling.java
0 → 100644
| 1 | +package com.ruoyi.pojo.response; | |
| 2 | + | |
| 3 | +import lombok.Data; | |
| 4 | + | |
| 5 | +import java.util.Date; | |
| 6 | +import java.util.List; | |
| 7 | + | |
| 8 | +/** | |
| 9 | + * Auto-generated: 2023-07-05 21:23:27 | |
| 10 | + * | |
| 11 | + * @author json.cn (i@json.cn) | |
| 12 | + * @website http://www.json.cn/java2pojo/ | |
| 13 | + */ | |
| 14 | +@Data | |
| 15 | +public class ResponseScheduling { | |
| 16 | + | |
| 17 | + private long id; | |
| 18 | + private Date scheduleDate; | |
| 19 | + private String lineName; | |
| 20 | + private String lineCode; | |
| 21 | + private String lpName; | |
| 22 | + private String nbbm; | |
| 23 | + private String jsy; | |
| 24 | + private String spy; | |
| 25 | + private String upDown; | |
| 26 | + private String qdzCode; | |
| 27 | + private String qdzName; | |
| 28 | + private String zdzCode; | |
| 29 | + private String zdzName; | |
| 30 | + private long fcsjT; | |
| 31 | + private long dfsjT; | |
| 32 | + private long zdsjT; | |
| 33 | + private long fcsjActualTime; | |
| 34 | + private long zdsjActualTime; | |
| 35 | + private double jhlc; | |
| 36 | + private double jhlcOrig; | |
| 37 | + private int bcsj; | |
| 38 | + private String bcType; | |
| 39 | + private int status; | |
| 40 | + private String adjustExps; | |
| 41 | + private boolean sflj; | |
| 42 | + private String remarks; | |
| 43 | + private List<CTasks> cTasks; | |
| 44 | +} | |
| 0 | 45 | \ No newline at end of file | ... | ... |
ruoyi-admin/src/main/resources/application-druid-dev.yml
| ... | ... | @@ -127,8 +127,11 @@ api: |
| 127 | 127 | url: |
| 128 | 128 | # all 为获取所有驾驶员信息 |
| 129 | 129 | getDriverInfo: http://101.95.136.206:9089/webservice/rest/person/%s |
| 130 | + # 获取公司编码下的员工信息 暂时没用 | |
| 130 | 131 | getCompanyInfo: http://101.95.136.206:9089/webservice/rest/person/company/%d?timestamp=%&nonce=%s&password=%s&sign=%s |
| 132 | + # 获取排班信息 | |
| 133 | + getSchedulingInfo: http://114.80.178.12:9089/webservice/rest/schedule_real/sch_jk/%s/%s?timestamp=%d&nonce=%s&password=%s&sign=%s | |
| 131 | 134 | config: |
| 132 | 135 | password: c4dd3d8cb9a82f6d6a625818618b28ca7bebb464 |
| 133 | 136 | # 随机字符串 |
| 134 | 137 | - nonce: adfsad |
| 138 | + nonce: adfsad | |
| 135 | 139 | \ No newline at end of file | ... | ... |
ruoyi-admin/src/main/resources/application-druid-prd.yml
| ... | ... | @@ -87,7 +87,10 @@ api: |
| 87 | 87 | url: |
| 88 | 88 | # all 为获取所有驾驶员信息 |
| 89 | 89 | getDriverInfo: http://101.95.136.206:9089/webservice/rest/person/%s |
| 90 | + # 获取公司编码下的员工信息 暂时没用 | |
| 90 | 91 | getCompanyInfo: http://101.95.136.206:9089/webservice/rest/person/company/%d?timestamp=%&nonce=%s&password=%s&sign=%s |
| 92 | + # 获取排班信息 | |
| 93 | + getSchedulingInfo: http://114.80.178.12:9089/webservice/rest/schedule_real/sch_jk/%s/%s?timestamp=%d&nonce=%s&password=%s&sign=%s | |
| 91 | 94 | config: |
| 92 | 95 | password: c4dd3d8cb9a82f6d6a625818618b28ca7bebb464 |
| 93 | 96 | # 随机字符串 | ... | ... |
ruoyi-admin/src/main/resources/application-druid-uat.yml
| ... | ... | @@ -145,8 +145,11 @@ api: |
| 145 | 145 | url: |
| 146 | 146 | # all 为获取所有驾驶员信息 |
| 147 | 147 | getDriverInfo: http://101.95.136.206:9089/webservice/rest/person/%s |
| 148 | + # 获取公司编码下的员工信息 暂时没用 | |
| 148 | 149 | getCompanyInfo: http://101.95.136.206:9089/webservice/rest/person/company/%d?timestamp=%&nonce=%s&password=%s&sign=%s |
| 150 | + # 获取排班信息 | |
| 151 | + getSchedulingInfo: http://114.80.178.12:9089/webservice/rest/schedule_real/sch_jk/%s/%s?timestamp=%d&nonce=%s&password=%s&sign=%s | |
| 149 | 152 | config: |
| 150 | 153 | password: c4dd3d8cb9a82f6d6a625818618b28ca7bebb464 |
| 151 | 154 | # 随机字符串 |
| 152 | 155 | - nonce: adfsad |
| 156 | + nonce: adfsad | |
| 153 | 157 | \ No newline at end of file | ... | ... |
ruoyi-admin/src/main/resources/application.yml
| ... | ... | @@ -139,7 +139,10 @@ api: |
| 139 | 139 | url: |
| 140 | 140 | # all 为获取所有驾驶员信息 |
| 141 | 141 | getDriverInfo: http://101.95.136.206:9089/webservice/rest/person/%s |
| 142 | + # 获取公司编码下的员工信息 暂时没用 | |
| 142 | 143 | getCompanyInfo: http://101.95.136.206:9089/webservice/rest/person/company/%d?timestamp=%&nonce=%s&password=%s&sign=%s |
| 144 | + # 获取排班信息 | |
| 145 | + getSchedulingInfo: http://114.80.178.12:9089/webservice/rest/schedule_real/sch_jk/%s/%s?timestamp=%d&nonce=%s&password=%s&sign=%s | |
| 143 | 146 | config: |
| 144 | 147 | password: c4dd3d8cb9a82f6d6a625818618b28ca7bebb464 |
| 145 | 148 | # 随机字符串 | ... | ... |
ruoyi-admin/src/main/resources/mapper/eexception/EquipmentExceptionMapper.xml
| ... | ... | @@ -7,23 +7,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| 7 | 7 | <resultMap type="EquipmentException" id="EquipmentExceptionResult"> |
| 8 | 8 | <result property="id" column="id" /> |
| 9 | 9 | <result property="title" column="title" /> |
| 10 | - <result property="equipmentIp" column="equipment_ip" /> | |
| 11 | - <result property="createTime" column="create_time" /> | |
| 10 | + <result property="deviceId" column="device_id" /> | |
| 12 | 11 | <result property="jobCode" column="job_code" /> |
| 13 | 12 | <result property="image" column="image" /> |
| 14 | 13 | <result property="status" column="status" /> |
| 14 | + <result property="createTime" column="create_time" /> | |
| 15 | 15 | <result property="remark" column="remark" /> |
| 16 | 16 | </resultMap> |
| 17 | 17 | |
| 18 | 18 | <sql id="selectEquipmentExceptionVo"> |
| 19 | - select id, title, equipment_ip, create_time, job_code, image, status, remark from equipment_exception | |
| 19 | + select id, title, device_id, job_code, image, status, create_time, remark from equipment_exception | |
| 20 | 20 | </sql> |
| 21 | 21 | |
| 22 | 22 | <select id="selectEquipmentExceptionList" parameterType="EquipmentException" resultMap="EquipmentExceptionResult"> |
| 23 | 23 | <include refid="selectEquipmentExceptionVo"/> |
| 24 | 24 | <where> |
| 25 | 25 | <if test="title != null and title != ''"> and title = #{title}</if> |
| 26 | - <if test="equipmentIp != null and equipmentIp != ''"> and equipment_ip = #{equipmentIp}</if> | |
| 26 | + <if test="deviceId != null "> and device_id = #{deviceId}</if> | |
| 27 | 27 | <if test="jobCode != null and jobCode != ''"> and job_code = #{jobCode}</if> |
| 28 | 28 | <if test="image != null and image != ''"> and image = #{image}</if> |
| 29 | 29 | <if test="status != null "> and status = #{status}</if> |
| ... | ... | @@ -39,20 +39,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| 39 | 39 | insert into equipment_exception |
| 40 | 40 | <trim prefix="(" suffix=")" suffixOverrides=","> |
| 41 | 41 | <if test="title != null">title,</if> |
| 42 | - <if test="equipmentIp != null and equipmentIp != ''">equipment_ip,</if> | |
| 43 | - <if test="createTime != null">create_time,</if> | |
| 42 | + <if test="deviceId != null">device_id,</if> | |
| 44 | 43 | <if test="jobCode != null and jobCode != ''">job_code,</if> |
| 45 | 44 | <if test="image != null">image,</if> |
| 46 | 45 | <if test="status != null">status,</if> |
| 46 | + <if test="createTime != null">create_time,</if> | |
| 47 | 47 | <if test="remark != null and remark != ''">remark,</if> |
| 48 | 48 | </trim> |
| 49 | 49 | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| 50 | 50 | <if test="title != null">#{title},</if> |
| 51 | - <if test="equipmentIp != null and equipmentIp != ''">#{equipmentIp},</if> | |
| 52 | - <if test="createTime != null">#{createTime},</if> | |
| 51 | + <if test="deviceId != null">#{deviceId},</if> | |
| 53 | 52 | <if test="jobCode != null and jobCode != ''">#{jobCode},</if> |
| 54 | 53 | <if test="image != null">#{image},</if> |
| 55 | 54 | <if test="status != null">#{status},</if> |
| 55 | + <if test="createTime != null">#{createTime},</if> | |
| 56 | 56 | <if test="remark != null and remark != ''">#{remark},</if> |
| 57 | 57 | </trim> |
| 58 | 58 | </insert> |
| ... | ... | @@ -61,11 +61,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| 61 | 61 | update equipment_exception |
| 62 | 62 | <trim prefix="SET" suffixOverrides=","> |
| 63 | 63 | <if test="title != null">title = #{title},</if> |
| 64 | - <if test="equipmentIp != null and equipmentIp != ''">equipment_ip = #{equipmentIp},</if> | |
| 65 | - <if test="createTime != null">create_time = #{createTime},</if> | |
| 64 | + <if test="deviceId != null">device_id = #{deviceId},</if> | |
| 66 | 65 | <if test="jobCode != null and jobCode != ''">job_code = #{jobCode},</if> |
| 67 | 66 | <if test="image != null">image = #{image},</if> |
| 68 | 67 | <if test="status != null">status = #{status},</if> |
| 68 | + <if test="createTime != null">create_time = #{createTime},</if> | |
| 69 | 69 | <if test="remark != null and remark != ''">remark = #{remark},</if> |
| 70 | 70 | </trim> |
| 71 | 71 | where id = #{id} | ... | ... |
ruoyi-admin/src/main/resources/mapper/equipment/EquipmentMapper.xml
| ... | ... | @@ -12,6 +12,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| 12 | 12 | <result property="status" column="status" /> |
| 13 | 13 | <result property="promise" column="promise" /> |
| 14 | 14 | <result property="image" column="image" /> |
| 15 | + <result property="deviceId" column="device_id" /> | |
| 15 | 16 | <result property="createTime" column="create_time" /> |
| 16 | 17 | <result property="updateTime" column="update_time" /> |
| 17 | 18 | <result property="createBy" column="create_by" /> |
| ... | ... | @@ -20,7 +21,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| 20 | 21 | </resultMap> |
| 21 | 22 | |
| 22 | 23 | <sql id="selectEquipmentVo"> |
| 23 | - select id, site_name, address, ip, status, promise, image, create_time, update_time, create_by, update_by, remark from equipment | |
| 24 | + select id, site_name, address, ip, status, promise, image, device_id, create_time, update_time, create_by, update_by, remark from equipment | |
| 24 | 25 | </sql> |
| 25 | 26 | |
| 26 | 27 | <select id="selectEquipmentList" parameterType="Equipment" resultMap="EquipmentResult"> |
| ... | ... | @@ -32,6 +33,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| 32 | 33 | <if test="status != null "> and status = #{status}</if> |
| 33 | 34 | <if test="promise != null and promise != ''"> and promise = #{promise}</if> |
| 34 | 35 | <if test="image != null and image != ''"> and image = #{image}</if> |
| 36 | + <if test="deviceId != null and deviceId != ''"> and device_id = #{deviceId}</if> | |
| 35 | 37 | </where> |
| 36 | 38 | </select> |
| 37 | 39 | |
| ... | ... | @@ -49,6 +51,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| 49 | 51 | <if test="status != null">status,</if> |
| 50 | 52 | <if test="promise != null and promise != ''">promise,</if> |
| 51 | 53 | <if test="image != null">image,</if> |
| 54 | + <if test="deviceId != null">device_id,</if> | |
| 52 | 55 | <if test="createTime != null">create_time,</if> |
| 53 | 56 | <if test="updateTime != null">update_time,</if> |
| 54 | 57 | <if test="createBy != null">create_by,</if> |
| ... | ... | @@ -62,6 +65,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| 62 | 65 | <if test="status != null">#{status},</if> |
| 63 | 66 | <if test="promise != null and promise != ''">#{promise},</if> |
| 64 | 67 | <if test="image != null">#{image},</if> |
| 68 | + <if test="deviceId != null">#{deviceId},</if> | |
| 65 | 69 | <if test="createTime != null">#{createTime},</if> |
| 66 | 70 | <if test="updateTime != null">#{updateTime},</if> |
| 67 | 71 | <if test="createBy != null">#{createBy},</if> |
| ... | ... | @@ -79,6 +83,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| 79 | 83 | <if test="status != null">status = #{status},</if> |
| 80 | 84 | <if test="promise != null and promise != ''">promise = #{promise},</if> |
| 81 | 85 | <if test="image != null">image = #{image},</if> |
| 86 | + <if test="deviceId != null">device_id = #{deviceId},</if> | |
| 82 | 87 | <if test="createTime != null">create_time = #{createTime},</if> |
| 83 | 88 | <if test="updateTime != null">update_time = #{updateTime},</if> |
| 84 | 89 | <if test="createBy != null">create_by = #{createBy},</if> | ... | ... |
ruoyi-common/src/main/java/com/ruoyi/common/utils/DateUtils.java
| ... | ... | @@ -53,6 +53,11 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils |
| 53 | 53 | return dateTimeNow(YYYY_MM_DD); |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | + public static String getDate(String format) | |
| 57 | + { | |
| 58 | + return dateTimeNow(format); | |
| 59 | + } | |
| 60 | + | |
| 56 | 61 | public static final String getTime() |
| 57 | 62 | { |
| 58 | 63 | return dateTimeNow(YYYY_MM_DD_HH_MM_SS); | ... | ... |