Commit 41afbd8f7aa8b18f4dacccb35be583559c488331
1 parent
f5047440
feat: 更新配置
Showing
3 changed files
with
19 additions
and
198 deletions
ruoyi-admin/src/main/java/com/ruoyi/service/ThreadJobService.java
| @@ -481,7 +481,9 @@ public class ThreadJobService { | @@ -481,7 +481,9 @@ public class ThreadJobService { | ||
| 481 | DriverScheduling scheduling = new DriverScheduling(); | 481 | DriverScheduling scheduling = new DriverScheduling(); |
| 482 | BeanUtils.copyProperties(item, scheduling, "id"); | 482 | BeanUtils.copyProperties(item, scheduling, "id"); |
| 483 | return scheduling; | 483 | return scheduling; |
| 484 | - }).collect(Collectors.toList()); | 484 | + }) |
| 485 | + .sorted(Comparator.comparing(DriverScheduling::getFcsjT)) | ||
| 486 | + .collect(Collectors.toList()); | ||
| 485 | if (nowScheduling.size() % 2 == 1 && nowScheduling.size() > 2) { | 487 | if (nowScheduling.size() % 2 == 1 && nowScheduling.size() > 2) { |
| 486 | // 处理错误班次 | 488 | // 处理错误班次 |
| 487 | nowScheduling = handleErrorBc(schedulingList); | 489 | nowScheduling = handleErrorBc(schedulingList); |
| @@ -497,28 +499,28 @@ public class ThreadJobService { | @@ -497,28 +499,28 @@ public class ThreadJobService { | ||
| 497 | } | 499 | } |
| 498 | 500 | ||
| 499 | private void updateScheduling(List<DriverScheduling> nowScheduling) { | 501 | private void updateScheduling(List<DriverScheduling> nowScheduling) { |
| 500 | - switch (nowScheduling.get(0).getLpName()){ | 502 | + switch (nowScheduling.get(0).getLpName()) { |
| 501 | case "松1": | 503 | case "松1": |
| 502 | - nowScheduling.get(0).setFcsjT(ConstDateUtil.dateAddition(ConstDateUtil.formatDate("yyyy-MM-dd",new Date(nowScheduling.get(0).getFcsjT())),"07:20:00").getTime()); | ||
| 503 | - nowScheduling.get(nowScheduling.size() - 1).setZdsjT(ConstDateUtil.dateAddition(ConstDateUtil.formatDate("yyyy-MM-dd",new Date(nowScheduling.get(nowScheduling.size() - 1).getFcsjT())),"15:30:00").getTime()); | 504 | + nowScheduling.get(0).setFcsjT(ConstDateUtil.dateAddition(ConstDateUtil.formatDate("yyyy-MM-dd", new Date(nowScheduling.get(0).getFcsjT())), "07:20:00").getTime()); |
| 505 | + nowScheduling.get(nowScheduling.size() - 1).setZdsjT(ConstDateUtil.dateAddition(ConstDateUtil.formatDate("yyyy-MM-dd", new Date(nowScheduling.get(nowScheduling.size() - 1).getFcsjT())), "15:30:00").getTime()); | ||
| 504 | break; | 506 | break; |
| 505 | case "松2": | 507 | case "松2": |
| 506 | - nowScheduling.get(0).setFcsjT(ConstDateUtil.dateAddition(ConstDateUtil.formatDate("yyyy-MM-dd",new Date(nowScheduling.get(0).getFcsjT())),"07:40:00").getTime()); | ||
| 507 | - nowScheduling.get(nowScheduling.size() - 1).setZdsjT(ConstDateUtil.dateAddition(ConstDateUtil.formatDate("yyyy-MM-dd",new Date(nowScheduling.get(nowScheduling.size() - 1).getFcsjT())),"19:00:00").getTime()); | 508 | + nowScheduling.get(0).setFcsjT(ConstDateUtil.dateAddition(ConstDateUtil.formatDate("yyyy-MM-dd", new Date(nowScheduling.get(0).getFcsjT())), "07:40:00").getTime()); |
| 509 | + nowScheduling.get(nowScheduling.size() - 1).setZdsjT(ConstDateUtil.dateAddition(ConstDateUtil.formatDate("yyyy-MM-dd", new Date(nowScheduling.get(nowScheduling.size() - 1).getFcsjT())), "19:00:00").getTime()); | ||
| 508 | break; | 510 | break; |
| 509 | case "松3": | 511 | case "松3": |
| 510 | - nowScheduling.get(0).setFcsjT(ConstDateUtil.dateAddition(ConstDateUtil.formatDate("yyyy-MM-dd",new Date(nowScheduling.get(0).getFcsjT())),"08:35:00").getTime()); | ||
| 511 | - nowScheduling.get(nowScheduling.size() - 1).setZdsjT(ConstDateUtil.dateAddition(ConstDateUtil.formatDate("yyyy-MM-dd",new Date(nowScheduling.get(nowScheduling.size() - 1).getFcsjT())),"18:10:00").getTime()); | 512 | + nowScheduling.get(0).setFcsjT(ConstDateUtil.dateAddition(ConstDateUtil.formatDate("yyyy-MM-dd", new Date(nowScheduling.get(0).getFcsjT())), "08:35:00").getTime()); |
| 513 | + nowScheduling.get(nowScheduling.size() - 1).setZdsjT(ConstDateUtil.dateAddition(ConstDateUtil.formatDate("yyyy-MM-dd", new Date(nowScheduling.get(nowScheduling.size() - 1).getFcsjT())), "18:10:00").getTime()); | ||
| 512 | break; | 514 | break; |
| 513 | case "松4": | 515 | case "松4": |
| 514 | - nowScheduling.get(0).setFcsjT(ConstDateUtil.dateAddition(ConstDateUtil.formatDate("yyyy-MM-dd",new Date(nowScheduling.get(0).getFcsjT())),"10:30:00").getTime()); | ||
| 515 | - nowScheduling.get(nowScheduling.size() - 1).setZdsjT(ConstDateUtil.dateAddition(ConstDateUtil.formatDate("yyyy-MM-dd",new Date(nowScheduling.get(nowScheduling.size() - 1).getFcsjT())),"18:35:00").getTime()); | 516 | + nowScheduling.get(0).setFcsjT(ConstDateUtil.dateAddition(ConstDateUtil.formatDate("yyyy-MM-dd", new Date(nowScheduling.get(0).getFcsjT())), "10:30:00").getTime()); |
| 517 | + nowScheduling.get(nowScheduling.size() - 1).setZdsjT(ConstDateUtil.dateAddition(ConstDateUtil.formatDate("yyyy-MM-dd", new Date(nowScheduling.get(nowScheduling.size() - 1).getFcsjT())), "18:35:00").getTime()); | ||
| 516 | break; | 518 | break; |
| 517 | } | 519 | } |
| 518 | } | 520 | } |
| 519 | 521 | ||
| 520 | private boolean checkLpName(DriverScheduling driverScheduling) { | 522 | private boolean checkLpName(DriverScheduling driverScheduling) { |
| 521 | - switch (driverScheduling.getLpName()){ | 523 | + switch (driverScheduling.getLpName()) { |
| 522 | case "松1": | 524 | case "松1": |
| 523 | case "松2": | 525 | case "松2": |
| 524 | case "松3": | 526 | case "松3": |
| @@ -564,7 +566,7 @@ public class ThreadJobService { | @@ -564,7 +566,7 @@ public class ThreadJobService { | ||
| 564 | for (int i = 0; i < length; i++) { | 566 | for (int i = 0; i < length; i++) { |
| 565 | if (i < length - 1) { | 567 | if (i < length - 1) { |
| 566 | // 判断是否出现连续 | 568 | // 判断是否出现连续 |
| 567 | - if (driverSchedulingList.get(i) == driverSchedulingList.get(i + 1)) { | 569 | + if (driverSchedulingList.get(i).getBcType().equals(driverSchedulingList.get(i + 1).getBcType())) { |
| 568 | if (BC_TYPE_IN.equals(driverSchedulingList.get(i).getBcType())) inContinuousFlag = true; | 570 | if (BC_TYPE_IN.equals(driverSchedulingList.get(i).getBcType())) inContinuousFlag = true; |
| 569 | else outContinuousFlag = true; | 571 | else outContinuousFlag = true; |
| 570 | } | 572 | } |
ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/TestController.java deleted
100644 → 0
| 1 | -package com.ruoyi.web.controller.tool; | ||
| 2 | - | ||
| 3 | -import java.util.ArrayList; | ||
| 4 | -import java.util.LinkedHashMap; | ||
| 5 | -import java.util.List; | ||
| 6 | -import java.util.Map; | ||
| 7 | -import org.springframework.web.bind.annotation.DeleteMapping; | ||
| 8 | -import org.springframework.web.bind.annotation.GetMapping; | ||
| 9 | -import org.springframework.web.bind.annotation.PathVariable; | ||
| 10 | -import org.springframework.web.bind.annotation.PostMapping; | ||
| 11 | -import org.springframework.web.bind.annotation.PutMapping; | ||
| 12 | -import org.springframework.web.bind.annotation.RequestBody; | ||
| 13 | -import org.springframework.web.bind.annotation.RequestMapping; | ||
| 14 | -import org.springframework.web.bind.annotation.RestController; | ||
| 15 | -import com.ruoyi.common.core.controller.BaseController; | ||
| 16 | -import com.ruoyi.common.core.domain.R; | ||
| 17 | -import com.ruoyi.common.utils.StringUtils; | ||
| 18 | -import io.swagger.annotations.Api; | ||
| 19 | -import io.swagger.annotations.ApiImplicitParam; | ||
| 20 | -import io.swagger.annotations.ApiImplicitParams; | ||
| 21 | -import io.swagger.annotations.ApiModel; | ||
| 22 | -import io.swagger.annotations.ApiModelProperty; | ||
| 23 | -import io.swagger.annotations.ApiOperation; | ||
| 24 | - | ||
| 25 | -/** | ||
| 26 | - * swagger 用户测试方法 | ||
| 27 | - * | ||
| 28 | - * @author ruoyi | ||
| 29 | - */ | ||
| 30 | -@Api("用户信息管理") | ||
| 31 | -@RestController | ||
| 32 | -@RequestMapping("/test/user") | ||
| 33 | -public class TestController extends BaseController | ||
| 34 | -{ | ||
| 35 | - private final static Map<Integer, UserEntity> users = new LinkedHashMap<Integer, UserEntity>(); | ||
| 36 | - { | ||
| 37 | - users.put(1, new UserEntity(1, "admin", "admin123", "15888888888")); | ||
| 38 | - users.put(2, new UserEntity(2, "ry", "admin123", "15666666666")); | ||
| 39 | - } | ||
| 40 | - | ||
| 41 | - @ApiOperation("获取用户列表") | ||
| 42 | - @GetMapping("/list") | ||
| 43 | - public R<List<UserEntity>> userList() | ||
| 44 | - { | ||
| 45 | - List<UserEntity> userList = new ArrayList<UserEntity>(users.values()); | ||
| 46 | - return R.ok(userList); | ||
| 47 | - } | ||
| 48 | - | ||
| 49 | - @ApiOperation("获取用户详细") | ||
| 50 | - @ApiImplicitParam(name = "userId", value = "用户ID", required = true, dataType = "int", paramType = "path", dataTypeClass = Integer.class) | ||
| 51 | - @GetMapping("/{userId}") | ||
| 52 | - public R<UserEntity> getUser(@PathVariable Integer userId) | ||
| 53 | - { | ||
| 54 | - if (!users.isEmpty() && users.containsKey(userId)) | ||
| 55 | - { | ||
| 56 | - return R.ok(users.get(userId)); | ||
| 57 | - } | ||
| 58 | - else | ||
| 59 | - { | ||
| 60 | - return R.fail("用户不存在"); | ||
| 61 | - } | ||
| 62 | - } | ||
| 63 | - | ||
| 64 | - @ApiOperation("新增用户") | ||
| 65 | - @ApiImplicitParams({ | ||
| 66 | - @ApiImplicitParam(name = "userId", value = "用户id", dataType = "Integer", dataTypeClass = Integer.class), | ||
| 67 | - @ApiImplicitParam(name = "username", value = "用户名称", dataType = "String", dataTypeClass = String.class), | ||
| 68 | - @ApiImplicitParam(name = "password", value = "用户密码", dataType = "String", dataTypeClass = String.class), | ||
| 69 | - @ApiImplicitParam(name = "mobile", value = "用户手机", dataType = "String", dataTypeClass = String.class) | ||
| 70 | - }) | ||
| 71 | - @PostMapping("/save") | ||
| 72 | - public R<String> save(UserEntity user) | ||
| 73 | - { | ||
| 74 | - if (StringUtils.isNull(user) || StringUtils.isNull(user.getUserId())) | ||
| 75 | - { | ||
| 76 | - return R.fail("用户ID不能为空"); | ||
| 77 | - } | ||
| 78 | - users.put(user.getUserId(), user); | ||
| 79 | - return R.ok(); | ||
| 80 | - } | ||
| 81 | - | ||
| 82 | - @ApiOperation("更新用户") | ||
| 83 | - @PutMapping("/update") | ||
| 84 | - public R<String> update(@RequestBody UserEntity user) | ||
| 85 | - { | ||
| 86 | - if (StringUtils.isNull(user) || StringUtils.isNull(user.getUserId())) | ||
| 87 | - { | ||
| 88 | - return R.fail("用户ID不能为空"); | ||
| 89 | - } | ||
| 90 | - if (users.isEmpty() || !users.containsKey(user.getUserId())) | ||
| 91 | - { | ||
| 92 | - return R.fail("用户不存在"); | ||
| 93 | - } | ||
| 94 | - users.remove(user.getUserId()); | ||
| 95 | - users.put(user.getUserId(), user); | ||
| 96 | - return R.ok(); | ||
| 97 | - } | ||
| 98 | - | ||
| 99 | - @ApiOperation("删除用户信息") | ||
| 100 | - @ApiImplicitParam(name = "userId", value = "用户ID", required = true, dataType = "int", paramType = "path", dataTypeClass = Integer.class) | ||
| 101 | - @DeleteMapping("/{userId}") | ||
| 102 | - public R<String> delete(@PathVariable Integer userId) | ||
| 103 | - { | ||
| 104 | - if (!users.isEmpty() && users.containsKey(userId)) | ||
| 105 | - { | ||
| 106 | - users.remove(userId); | ||
| 107 | - return R.ok(); | ||
| 108 | - } | ||
| 109 | - else | ||
| 110 | - { | ||
| 111 | - return R.fail("用户不存在"); | ||
| 112 | - } | ||
| 113 | - } | ||
| 114 | -} | ||
| 115 | - | ||
| 116 | -@ApiModel(value = "UserEntity", description = "用户实体") | ||
| 117 | -class UserEntity | ||
| 118 | -{ | ||
| 119 | - @ApiModelProperty("用户ID") | ||
| 120 | - private Integer userId; | ||
| 121 | - | ||
| 122 | - @ApiModelProperty("用户名称") | ||
| 123 | - private String username; | ||
| 124 | - | ||
| 125 | - @ApiModelProperty("用户密码") | ||
| 126 | - private String password; | ||
| 127 | - | ||
| 128 | - @ApiModelProperty("用户手机") | ||
| 129 | - private String mobile; | ||
| 130 | - | ||
| 131 | - public UserEntity() | ||
| 132 | - { | ||
| 133 | - | ||
| 134 | - } | ||
| 135 | - | ||
| 136 | - public UserEntity(Integer userId, String username, String password, String mobile) | ||
| 137 | - { | ||
| 138 | - this.userId = userId; | ||
| 139 | - this.username = username; | ||
| 140 | - this.password = password; | ||
| 141 | - this.mobile = mobile; | ||
| 142 | - } | ||
| 143 | - | ||
| 144 | - public Integer getUserId() | ||
| 145 | - { | ||
| 146 | - return userId; | ||
| 147 | - } | ||
| 148 | - | ||
| 149 | - public void setUserId(Integer userId) | ||
| 150 | - { | ||
| 151 | - this.userId = userId; | ||
| 152 | - } | ||
| 153 | - | ||
| 154 | - public String getUsername() | ||
| 155 | - { | ||
| 156 | - return username; | ||
| 157 | - } | ||
| 158 | - | ||
| 159 | - public void setUsername(String username) | ||
| 160 | - { | ||
| 161 | - this.username = username; | ||
| 162 | - } | ||
| 163 | - | ||
| 164 | - public String getPassword() | ||
| 165 | - { | ||
| 166 | - return password; | ||
| 167 | - } | ||
| 168 | - | ||
| 169 | - public void setPassword(String password) | ||
| 170 | - { | ||
| 171 | - this.password = password; | ||
| 172 | - } | ||
| 173 | - | ||
| 174 | - public String getMobile() | ||
| 175 | - { | ||
| 176 | - return mobile; | ||
| 177 | - } | ||
| 178 | - | ||
| 179 | - public void setMobile(String mobile) | ||
| 180 | - { | ||
| 181 | - this.mobile = mobile; | ||
| 182 | - } | ||
| 183 | -} |
ruoyi-admin/src/main/java/com/ruoyi/web/core/config/SwaggerConfig.java
| @@ -2,6 +2,8 @@ package com.ruoyi.web.core.config; | @@ -2,6 +2,8 @@ package com.ruoyi.web.core.config; | ||
| 2 | 2 | ||
| 3 | import java.util.ArrayList; | 3 | import java.util.ArrayList; |
| 4 | import java.util.List; | 4 | import java.util.List; |
| 5 | + | ||
| 6 | +import io.swagger.annotations.Api; | ||
| 5 | import org.springframework.beans.factory.annotation.Autowired; | 7 | import org.springframework.beans.factory.annotation.Autowired; |
| 6 | import org.springframework.beans.factory.annotation.Value; | 8 | import org.springframework.beans.factory.annotation.Value; |
| 7 | import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; | 9 | import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; |
| @@ -26,9 +28,8 @@ import springfox.documentation.spring.web.plugins.Docket; | @@ -26,9 +28,8 @@ import springfox.documentation.spring.web.plugins.Docket; | ||
| 26 | /** | 28 | /** |
| 27 | * Swagger2的接口配置 | 29 | * Swagger2的接口配置 |
| 28 | * | 30 | * |
| 29 | - * @author ruoyi | 31 | + * @author guzijian |
| 30 | */ | 32 | */ |
| 31 | -@ConditionalOnProperty(name = "springfox.documentation.auto-startup", havingValue = "true") | ||
| 32 | @Configuration | 33 | @Configuration |
| 33 | public class SwaggerConfig | 34 | public class SwaggerConfig |
| 34 | { | 35 | { |
| @@ -61,7 +62,8 @@ public class SwaggerConfig | @@ -61,7 +62,8 @@ public class SwaggerConfig | ||
| 61 | .apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class)) | 62 | .apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class)) |
| 62 | // 扫描指定包中的swagger注解 | 63 | // 扫描指定包中的swagger注解 |
| 63 | // .apis(RequestHandlerSelectors.basePackage("com.ruoyi.project.tool.swagger")) | 64 | // .apis(RequestHandlerSelectors.basePackage("com.ruoyi.project.tool.swagger")) |
| 64 | - // 扫描所有 .apis(RequestHandlerSelectors.any()) | 65 | + // 扫描所有 |
| 66 | + .apis(RequestHandlerSelectors.any()) | ||
| 65 | .paths(PathSelectors.any()) | 67 | .paths(PathSelectors.any()) |
| 66 | .build() | 68 | .build() |
| 67 | /* 设置安全模式,swagger可以设置访问token */ | 69 | /* 设置安全模式,swagger可以设置访问token */ |