代码更新
This commit is contained in:
parent
3be86adb1a
commit
1281754432
|
|
@ -9,6 +9,7 @@ import lombok.RequiredArgsConstructor;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.scheduling.annotation.Async;
|
||||||
import org.springframework.scheduling.annotation.Scheduled;
|
import org.springframework.scheduling.annotation.Scheduled;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import org.springframework.transaction.annotation.Isolation;
|
import org.springframework.transaction.annotation.Isolation;
|
||||||
|
|
@ -45,6 +46,7 @@ public class JobComponent {
|
||||||
* 向Wcs下发任务
|
* 向Wcs下发任务
|
||||||
* 每2秒执行一次
|
* 每2秒执行一次
|
||||||
*/
|
*/
|
||||||
|
@Async
|
||||||
@Scheduled(fixedDelay = 2000)
|
@Scheduled(fixedDelay = 2000)
|
||||||
@Transactional(isolation = Isolation.REPEATABLE_READ, propagation = Propagation.REQUIRED)
|
@Transactional(isolation = Isolation.REPEATABLE_READ, propagation = Propagation.REQUIRED)
|
||||||
public void executeTasks() {
|
public void executeTasks() {
|
||||||
|
|
@ -74,6 +76,7 @@ public class JobComponent {
|
||||||
/**
|
/**
|
||||||
* 检测工作
|
* 检测工作
|
||||||
*/
|
*/
|
||||||
|
@Async
|
||||||
@Scheduled(fixedDelay = 2000)
|
@Scheduled(fixedDelay = 2000)
|
||||||
@Transactional(isolation = Isolation.REPEATABLE_READ, propagation = Propagation.REQUIRED)
|
@Transactional(isolation = Isolation.REPEATABLE_READ, propagation = Propagation.REQUIRED)
|
||||||
public void detectWork() {
|
public void detectWork() {
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,9 @@ import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import static com.wms.utils.StringUtils.convertJsonString;
|
import static com.wms.utils.StringUtils.convertJsonString;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -172,6 +175,80 @@ public class LocationController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生成库位表数据
|
||||||
|
*
|
||||||
|
* @param locationQuery 库位
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@PostMapping("/genLocations")
|
||||||
|
@ResponseBody
|
||||||
|
@Transactional(isolation = Isolation.REPEATABLE_READ, propagation = Propagation.REQUIRED)
|
||||||
|
@MyLog(logTitle = "更新库位信息", logMethod = "genLocations")
|
||||||
|
public String genLocations(@RequestBody LocationQuery locationQuery) {
|
||||||
|
// 9*64*22
|
||||||
|
logger.info("接收到生成库位表数据请求:{},请求ip地址:{}", convertJsonString(locationQuery), HttpUtils.getIpAddr(servletRequest));
|
||||||
|
// 创建响应信息
|
||||||
|
ResponseEntity rsp = new ResponseEntity();
|
||||||
|
try {
|
||||||
|
if (locationQuery.getWRow() == null || locationQuery.getWCol() == null || locationQuery.getWLayer() == null) {
|
||||||
|
logger.error("缺少排列层。");
|
||||||
|
rsp.setCode(ResponseCode.ERROR.getCode());
|
||||||
|
rsp.setMessage("缺少排列层。");
|
||||||
|
return convertJsonString(rsp);
|
||||||
|
}
|
||||||
|
if (locationQuery.getWRow() <= 0 || locationQuery.getWCol() <= 0 || locationQuery.getWLayer() <= 0) {
|
||||||
|
logger.error("排列层必须为正整数。");
|
||||||
|
rsp.setCode(ResponseCode.ERROR.getCode());
|
||||||
|
rsp.setMessage("排列层必须为正整数。");
|
||||||
|
return convertJsonString(rsp);
|
||||||
|
}
|
||||||
|
List<Location> locations = new ArrayList<>();
|
||||||
|
for (int i = 1; i <= locationQuery.getWRow(); i++) {
|
||||||
|
for (int j = 1; j <= locationQuery.getWCol(); j++) {
|
||||||
|
for (int k = 1; k <= locationQuery.getWLayer(); k++) {
|
||||||
|
Location location = new Location();
|
||||||
|
location.setLocationId(StringUtils.padLeft(String.valueOf(i), 2, "0") + "-" + StringUtils.padLeft(String.valueOf(j), 2, "0") + "-" + StringUtils.padLeft(String.valueOf(k), 2, "0"));
|
||||||
|
location.setAreaId(1);
|
||||||
|
location.setWRow(i);
|
||||||
|
location.setWCol(j);
|
||||||
|
location.setWLayer(k);
|
||||||
|
location.setLocationType(1);
|
||||||
|
location.setLocationStatus(0);
|
||||||
|
location.setIsLock(0);
|
||||||
|
// 设置设备号
|
||||||
|
if (i == 2) {
|
||||||
|
// 第二排
|
||||||
|
if (k%2==1) {
|
||||||
|
// 第二排奇数层
|
||||||
|
location.setEquipmentId(1);
|
||||||
|
} else {
|
||||||
|
// 第二排偶数层
|
||||||
|
location.setEquipmentId(2);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
location.setEquipmentId(Math.round((float) (i + 1) / 2));
|
||||||
|
}
|
||||||
|
locations.add(location);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
locationService.saveBatch(locations);
|
||||||
|
|
||||||
|
rsp.setCode(ResponseCode.OK.getCode());
|
||||||
|
rsp.setMessage("生成库位成功。");
|
||||||
|
return convertJsonString(rsp);
|
||||||
|
} catch (Exception e) {
|
||||||
|
// 回滚事务
|
||||||
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||||
|
logger.info("生成库位发生异常:{}", convertJsonString(e));
|
||||||
|
// 返回其他异常
|
||||||
|
rsp.setCode(ResponseCode.ERROR.getCode());
|
||||||
|
rsp.setMessage("生成库位发生异常");
|
||||||
|
return convertJsonString(rsp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询料箱信息
|
* 查询料箱信息
|
||||||
* @param vehicleQuery 查询参数
|
* @param vehicleQuery 查询参数
|
||||||
|
|
|
||||||
|
|
@ -145,6 +145,7 @@ public class TaskController {
|
||||||
ResponseEntity response = new ResponseEntity();
|
ResponseEntity response = new ResponseEntity();
|
||||||
try {
|
try {
|
||||||
// 验证入库请求
|
// 验证入库请求
|
||||||
|
// TODO 这里需要判断这个箱子里面的其他物料是否能和当前物料放在一起
|
||||||
String validationInfo = validateService.validateTaskInRequest(taskInRequest);
|
String validationInfo = validateService.validateTaskInRequest(taskInRequest);
|
||||||
if (!Objects.equals(validationInfo, TaskInValidationEnum.OK.getErrorMessage())) {
|
if (!Objects.equals(validationInfo, TaskInValidationEnum.OK.getErrorMessage())) {
|
||||||
logger.error("入库请求验证错误!{}", validationInfo);
|
logger.error("入库请求验证错误!{}", validationInfo);
|
||||||
|
|
@ -152,13 +153,28 @@ public class TaskController {
|
||||||
response.setMessage("入库请求验证错误!" + validationInfo);
|
response.setMessage("入库请求验证错误!" + validationInfo);
|
||||||
return convertJsonString(response);
|
return convertJsonString(response);
|
||||||
}
|
}
|
||||||
|
// 查找当前箱子是否有其他等待入库的箱子
|
||||||
|
Task sameVehicleTempTask = taskService.getOne(new LambdaQueryWrapper<Task>()
|
||||||
|
.eq(Task::getVehicleId, taskInRequest.getVehicleId())
|
||||||
|
.eq(Task::getTaskStatus, WmsTaskStatus.TEMP.getCode())
|
||||||
|
.eq(Task::getTaskType, TaskType.IN.getCode()));
|
||||||
// 生成入库任务
|
// 生成入库任务
|
||||||
String saveTaskResult;
|
String saveTaskResult;
|
||||||
|
if (sameVehicleTempTask != null) {// 有相同的箱子任务
|
||||||
|
if (taskInRequest.getGoodsList() == null || taskInRequest.getGoodsList().isEmpty()) {// 空托入库
|
||||||
|
saveTaskResult = "不允许重复入空箱";
|
||||||
|
} else {// 带料入库
|
||||||
|
// 判断当前的料能否放入这个箱子里面
|
||||||
|
saveTaskResult = wmsTaskService.genGoodsInTask(taskInRequest, sameVehicleTempTask);
|
||||||
|
}
|
||||||
|
} else {// 没有这个箱子的任务
|
||||||
if (taskInRequest.getGoodsList() == null || taskInRequest.getGoodsList().isEmpty()) {// 空托入库
|
if (taskInRequest.getGoodsList() == null || taskInRequest.getGoodsList().isEmpty()) {// 空托入库
|
||||||
saveTaskResult = wmsTaskService.genEmptyInTask(taskInRequest);
|
saveTaskResult = wmsTaskService.genEmptyInTask(taskInRequest);
|
||||||
} else {// 带料入库
|
} else {// 带料入库
|
||||||
saveTaskResult = wmsTaskService.genGoodsInTask(taskInRequest);
|
saveTaskResult = wmsTaskService.genGoodsInTask(taskInRequest, null);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!saveTaskResult.equals("")) {
|
if (!saveTaskResult.equals("")) {
|
||||||
// 返回失败
|
// 返回失败
|
||||||
logger.error(saveTaskResult);
|
logger.error(saveTaskResult);
|
||||||
|
|
@ -1444,21 +1460,8 @@ public class TaskController {
|
||||||
return convertJsonString(response);
|
return convertJsonString(response);
|
||||||
}
|
}
|
||||||
// 验证请求信息
|
// 验证请求信息
|
||||||
if (Objects.equals(callEmptyVehicleRequest.getVehicleType2(), "CLC一箱一料")) {
|
if (Objects.equals(callEmptyVehicleRequest.getVehicleType2(), "间接物料")) {
|
||||||
if (!Objects.equals(callEmptyVehicleRequest.getVehicleType1(), "LR02") && !Objects.equals(callEmptyVehicleRequest.getVehicleType1(), "FC01")) {
|
// TODO 间接物料需要确认
|
||||||
logger.error("料箱类型选择错误,{}与{}不对应。", callEmptyVehicleRequest.getVehicleType1(), callEmptyVehicleRequest.getVehicleType2());
|
|
||||||
response.setCode(ResponseCode.ERROR.getCode());
|
|
||||||
response.setMessage("料箱类型选择错误,与存放类型不对应。");
|
|
||||||
return convertJsonString(response);
|
|
||||||
}
|
|
||||||
} else if (Objects.equals(callEmptyVehicleRequest.getVehicleType2(), "CLC一箱两料")) {
|
|
||||||
if (!Objects.equals(callEmptyVehicleRequest.getVehicleType1(), "LR01") && !Objects.equals(callEmptyVehicleRequest.getVehicleType1(), "UD01")) {
|
|
||||||
logger.error("料箱类型选择错误,{}与{}不对应。", callEmptyVehicleRequest.getVehicleType1(), callEmptyVehicleRequest.getVehicleType2());
|
|
||||||
response.setCode(ResponseCode.ERROR.getCode());
|
|
||||||
response.setMessage("料箱类型选择错误,与存放类型不对应。");
|
|
||||||
return convertJsonString(response);
|
|
||||||
}
|
|
||||||
} else if (Objects.equals(callEmptyVehicleRequest.getVehicleType2(), "间接物料")) {
|
|
||||||
if (StringUtils.isEmpty(callEmptyVehicleRequest.getGoodsId())) {
|
if (StringUtils.isEmpty(callEmptyVehicleRequest.getGoodsId())) {
|
||||||
logger.error("间接物料必须输入物料号");
|
logger.error("间接物料必须输入物料号");
|
||||||
response.setCode(ResponseCode.ERROR.getCode());
|
response.setCode(ResponseCode.ERROR.getCode());
|
||||||
|
|
@ -1474,14 +1477,6 @@ public class TaskController {
|
||||||
return convertJsonString(response);
|
return convertJsonString(response);
|
||||||
}
|
}
|
||||||
callEmptyVehicleRequest.setVehicleType1(goods.getVehicleType());
|
callEmptyVehicleRequest.setVehicleType1(goods.getVehicleType());
|
||||||
} else if (Objects.equals(callEmptyVehicleRequest.getVehicleType2(), "No-CLC")) {
|
|
||||||
// 设定料箱类型
|
|
||||||
callEmptyVehicleRequest.setVehicleType1("FB01");
|
|
||||||
} else {
|
|
||||||
logger.error("请选择正确的存放类型");
|
|
||||||
response.setCode(ResponseCode.ERROR.getCode());
|
|
||||||
response.setMessage("请选择正确的存放类型");
|
|
||||||
return convertJsonString(response);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 生成料箱出库任务
|
// 生成料箱出库任务
|
||||||
|
|
@ -1490,36 +1485,121 @@ public class TaskController {
|
||||||
while (needNum > 0) {
|
while (needNum > 0) {
|
||||||
// 先找空箱
|
// 先找空箱
|
||||||
Vehicle emptyVehicle = vehicleService.getOne(new LambdaQueryWrapper<Vehicle>()
|
Vehicle emptyVehicle = vehicleService.getOne(new LambdaQueryWrapper<Vehicle>()
|
||||||
.eq(Vehicle::getVehicleType, callEmptyVehicleRequest.getVehicleType1())
|
.eq(StringUtils.isNotEmpty(callEmptyVehicleRequest.getVehicleType1()), Vehicle::getVehicleType, callEmptyVehicleRequest.getVehicleType1())
|
||||||
.eq(Vehicle::getIsEmpty, 1)
|
.eq(Vehicle::getIsEmpty, 1)
|
||||||
|
.eq(Vehicle::getVehicleStatus, VehicleStatus.ON.getCode())
|
||||||
.orderByAsc(Vehicle::getLastInTime));
|
.orderByAsc(Vehicle::getLastInTime));
|
||||||
if (emptyVehicle != null) {// 有可用的空箱
|
if (emptyVehicle != null) {// 有可用的空箱
|
||||||
// 创建一个空箱出库任务
|
// 创建一个空箱出库任务
|
||||||
Task emptyVehicleTask = new Task();
|
Task emptyVehicleTask = new Task();
|
||||||
emptyVehicleTask.setTaskId("VCK_");
|
emptyVehicleTask.setTaskId(generateId("VCK_"));
|
||||||
emptyVehicleTask.setTaskType(TaskType.OUT.getCode());
|
emptyVehicleTask.setTaskType(TaskType.OUT.getCode());
|
||||||
emptyVehicleTask.setTaskStatus(WmsTaskStatus.NEW.getCode());
|
emptyVehicleTask.setTaskStatus(WmsTaskStatus.NEW.getCode());
|
||||||
emptyVehicleTask.setOrigin(emptyVehicle.getCurrentLocation());
|
emptyVehicleTask.setOrigin(emptyVehicle.getCurrentLocation());
|
||||||
// TODO 这里的终点与Wcs商量传不传
|
// TODO 这里的终点与Wcs商量传不传
|
||||||
emptyVehicleTask.setDestination("");
|
emptyVehicleTask.setDestination("");
|
||||||
|
emptyVehicleTask.setTaskPriority(1);
|
||||||
|
emptyVehicleTask.setTaskGroup(generateId(""));
|
||||||
|
emptyVehicleTask.setVehicleId(emptyVehicle.getVehicleId());
|
||||||
|
emptyVehicleTask.setWeight(BigDecimal.ZERO);
|
||||||
|
emptyVehicleTask.setVehicleSize(1);
|
||||||
|
emptyVehicleTask.setCreateTime(LocalDateTime.now());
|
||||||
|
emptyVehicleTask.setUserName(callEmptyVehicleRequest.getUserName());
|
||||||
|
emptyVehicleTask.setIsPicking(0);
|
||||||
|
vehicleOutTasks.add(emptyVehicleTask);
|
||||||
|
// 更新料箱信息
|
||||||
|
emptyVehicle.setVehicleStatus(VehicleStatus.OUT.getCode());
|
||||||
|
vehicleService.updateById(emptyVehicle);
|
||||||
} else {// 已经没有空箱可用了
|
} else {// 已经没有空箱可用了
|
||||||
|
// TODO 这里后续增加出不出带料箱子的配置
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
needNum--;
|
needNum--;
|
||||||
}
|
}
|
||||||
|
taskService.saveBatch(vehicleOutTasks);
|
||||||
|
if (needNum <= 0) {
|
||||||
|
response.setCode(ResponseCode.OK.getCode());
|
||||||
|
response.setMessage("呼叫空箱成功,请等待箱子出库。");
|
||||||
|
} else if (needNum < callEmptyVehicleRequest.getNeedNum()) {
|
||||||
|
response.setCode(ResponseCode.OK.getCode());
|
||||||
|
response.setMessage("已呼叫空箱,但库中空箱数量不足。需求" + callEmptyVehicleRequest.getNeedNum() + "个,实际呼叫" + (callEmptyVehicleRequest.getNeedNum() - needNum) + "个。");
|
||||||
|
} else {
|
||||||
|
response.setCode(ResponseCode.ERROR.getCode());
|
||||||
|
response.setMessage("库中没有空箱了。");
|
||||||
|
}
|
||||||
return convertJsonString(response);
|
return convertJsonString(response);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
// 回滚事务
|
// 回滚事务
|
||||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||||
logger.error("工作完成确认异常");
|
logger.error("呼叫空箱发生异常,{}", convertJsonString(e));
|
||||||
response.setCode(ResponseCode.ERROR.getCode());
|
response.setCode(ResponseCode.ERROR.getCode());
|
||||||
response.setMessage("工作完成确认异常");
|
response.setMessage("呼叫空箱发生异常");
|
||||||
return convertJsonString(response);
|
return convertJsonString(response);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO 接收Wcs询问是否回库的请求
|
// TODO 接收Wcs询问是否回库的请求
|
||||||
|
/**
|
||||||
|
* Wcs请求箱子是否回库
|
||||||
|
* @param requestBackQuery 请求信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@PostMapping("/requestBack")
|
||||||
|
@ResponseBody
|
||||||
|
@Transactional(isolation = Isolation.REPEATABLE_READ, propagation = Propagation.REQUIRED)
|
||||||
|
@MyLog(logTitle = "呼叫空箱", logMethod = "requestBack")
|
||||||
|
public String requestBack(@RequestBody RequestBackQuery requestBackQuery) {
|
||||||
|
logger.info("Wcs请求箱子是否回库:{},ip地址:{}", convertJsonString(requestBackQuery), HttpUtils.getIpAddr(servletRequest));
|
||||||
|
ResponseEntity response = new ResponseEntity();
|
||||||
|
try {
|
||||||
|
// 验证数量
|
||||||
|
if (StringUtils.isEmpty(requestBackQuery.getVehicleId())) {
|
||||||
|
logger.error("缺少箱子号。");
|
||||||
|
response.setCode(ResponseCode.ERROR.getCode());
|
||||||
|
response.setMessage("缺少箱子号。");
|
||||||
|
return convertJsonString(response);
|
||||||
|
}
|
||||||
|
// 判断这个箱子是否还有拣选任务
|
||||||
|
boolean hasPickTasks = pickTaskService.exists(new LambdaQueryWrapper<PickTask>()
|
||||||
|
.eq(PickTask::getVehicleId, requestBackQuery.getVehicleId()));
|
||||||
|
if (!hasPickTasks) {
|
||||||
|
// 判断当前载具是否有回库任务
|
||||||
|
boolean hasBackTask = taskService.exists(new LambdaQueryWrapper<Task>()
|
||||||
|
.eq(Task::getVehicleId, requestBackQuery.getVehicleId())
|
||||||
|
.eq(Task::getTaskType, TaskType.IN.getCode())
|
||||||
|
.likeLeft(Task::getTaskId, "HK"));
|
||||||
|
if (!hasBackTask) {
|
||||||
|
// 生成回库任务
|
||||||
|
Task backTask = new Task();
|
||||||
|
backTask.setTaskId(generateId("HK_"));
|
||||||
|
backTask.setTaskGroup(generateId(""));
|
||||||
|
backTask.setTaskType(TaskType.IN.getCode());
|
||||||
|
backTask.setTaskStatus(WmsTaskStatus.TEMP.getCode());
|
||||||
|
backTask.setVehicleId(requestBackQuery.getVehicleId());
|
||||||
|
backTask.setVehicleSize(1);
|
||||||
|
backTask.setWeight(BigDecimal.ZERO);
|
||||||
|
backTask.setTaskPriority(1);
|
||||||
|
backTask.setUserName("WMS");
|
||||||
|
backTask.setCreateTime(LocalDateTime.now());
|
||||||
|
if (!taskService.save(backTask)) {
|
||||||
|
logger.error("生成回库任务失败,箱号:{}", requestBackQuery.getVehicleId());
|
||||||
|
response.setCode(ResponseCode.ERROR.getCode());
|
||||||
|
response.setMessage("生成回库任务失败。");
|
||||||
|
return convertJsonString(response);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
response.setCode(ResponseCode.OK.getCode());
|
||||||
|
response.setMessage("可以回库。");
|
||||||
|
return convertJsonString(response);
|
||||||
|
} catch (Exception e) {
|
||||||
|
// 回滚事务
|
||||||
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||||
|
logger.error("处理回库请求异常,{}", convertJsonString(e));
|
||||||
|
response.setCode(ResponseCode.ERROR.getCode());
|
||||||
|
response.setMessage("处理回库请求异常。");
|
||||||
|
return convertJsonString(response);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -25,4 +25,9 @@ public class CallEmptyVehicleRequest {
|
||||||
*/
|
*/
|
||||||
@JsonProperty("needNum")
|
@JsonProperty("needNum")
|
||||||
private Integer needNum;
|
private Integer needNum;
|
||||||
|
/**
|
||||||
|
* 用户名
|
||||||
|
*/
|
||||||
|
@JsonProperty("userName")
|
||||||
|
private String userName;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
14
src/main/java/com/wms/entity/app/wcs/RequestBackQuery.java
Normal file
14
src/main/java/com/wms/entity/app/wcs/RequestBackQuery.java
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
package com.wms.entity.app.wcs;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 请求当前箱子是否要回库
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class RequestBackQuery {
|
||||||
|
/**
|
||||||
|
* 载具号
|
||||||
|
*/
|
||||||
|
private String vehicleId;
|
||||||
|
}
|
||||||
|
|
@ -4,10 +4,16 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.wms.entity.table.OutsideVehicles;
|
import com.wms.entity.table.OutsideVehicles;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 库外载具
|
* 库外载具
|
||||||
*/
|
*/
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface OutsideVehiclesMapper extends BaseMapper<OutsideVehicles> {
|
public interface OutsideVehiclesMapper extends BaseMapper<OutsideVehicles> {
|
||||||
|
/**
|
||||||
|
* 查询流转中的箱子列表
|
||||||
|
* @return 箱子列表
|
||||||
|
*/
|
||||||
|
List<String> selectDistinctVehicles();
|
||||||
}
|
}
|
||||||
|
|
@ -3,8 +3,15 @@ package com.wms.service;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.wms.entity.table.OutsideVehicles;
|
import com.wms.entity.table.OutsideVehicles;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 流转中的载具物料服务接口
|
* 流转中的载具物料服务接口
|
||||||
*/
|
*/
|
||||||
public interface OutsideVehiclesService extends IService<OutsideVehicles> {
|
public interface OutsideVehiclesService extends IService<OutsideVehicles> {
|
||||||
|
/**
|
||||||
|
* 查询流转中的箱子列表
|
||||||
|
* @return 箱子列表
|
||||||
|
*/
|
||||||
|
List<String> selectDistinctVehicles();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ package com.wms.service.business;
|
||||||
|
|
||||||
import com.wms.entity.app.request.TaskInRequest;
|
import com.wms.entity.app.request.TaskInRequest;
|
||||||
import com.wms.entity.app.request.TaskOutRequest;
|
import com.wms.entity.app.request.TaskOutRequest;
|
||||||
|
import com.wms.entity.table.Task;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* WMS任务服务接口
|
* WMS任务服务接口
|
||||||
|
|
@ -17,9 +18,10 @@ public interface IWmsTaskService {
|
||||||
/**
|
/**
|
||||||
* 创建物料入库任务
|
* 创建物料入库任务
|
||||||
* @param taskInRequest 入库请求
|
* @param taskInRequest 入库请求
|
||||||
|
* @param sameVehicleTask 相同载具任务
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
String genGoodsInTask(TaskInRequest taskInRequest);
|
String genGoodsInTask(TaskInRequest taskInRequest, Task sameVehicleTask);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建载具或库位出库任务
|
* 创建载具或库位出库任务
|
||||||
|
|
|
||||||
|
|
@ -9,10 +9,7 @@ import com.wms.entity.app.request.WorkQuery;
|
||||||
import com.wms.entity.app.wcs.WcsBoxArriveRequest;
|
import com.wms.entity.app.wcs.WcsBoxArriveRequest;
|
||||||
import com.wms.entity.app.wcs.WcsTaskResultRequest;
|
import com.wms.entity.app.wcs.WcsTaskResultRequest;
|
||||||
import com.wms.entity.app.wcs.WcsVehicleInRequest;
|
import com.wms.entity.app.wcs.WcsVehicleInRequest;
|
||||||
import com.wms.entity.table.Location;
|
import com.wms.entity.table.*;
|
||||||
import com.wms.entity.table.Stock;
|
|
||||||
import com.wms.entity.table.Task;
|
|
||||||
import com.wms.entity.table.Vehicle;
|
|
||||||
import com.wms.service.*;
|
import com.wms.service.*;
|
||||||
import com.wms.service.business.IValidateService;
|
import com.wms.service.business.IValidateService;
|
||||||
import com.wms.utils.StringUtils;
|
import com.wms.utils.StringUtils;
|
||||||
|
|
@ -57,37 +54,10 @@ public class ValidateServiceImplements implements IValidateService {
|
||||||
}
|
}
|
||||||
// 验证载具号是否重复入库
|
// 验证载具号是否重复入库
|
||||||
if (vehicleService.exists(new LambdaQueryWrapper<Vehicle>().eq(Vehicle::getVehicleId, taskInRequest.getVehicleId())
|
if (vehicleService.exists(new LambdaQueryWrapper<Vehicle>().eq(Vehicle::getVehicleId, taskInRequest.getVehicleId())
|
||||||
.and(wrapper -> wrapper.eq(Vehicle::getVehicleStatus, VehicleStatus.ON.getCode())
|
.and(wrapper -> wrapper.eq(Vehicle::getVehicleStatus, VehicleStatus.ON.getCode())))) {
|
||||||
.or().eq(Vehicle::getVehicleStatus, VehicleStatus.MOVE.getCode())))) {
|
|
||||||
return TaskInValidationEnum.DUPLICATE_VEHICLE_ID.getErrorMessage();
|
return TaskInValidationEnum.DUPLICATE_VEHICLE_ID.getErrorMessage();
|
||||||
}
|
}
|
||||||
// 验证当前载具是否已经有入库任务
|
|
||||||
if (taskService.exists(new LambdaQueryWrapper<Task>().eq(Task::getVehicleId, taskInRequest.getVehicleId())
|
|
||||||
.and(wrapper -> wrapper.eq(Task::getTaskType, TaskType.IN.getCode())))) {
|
|
||||||
return TaskInValidationEnum.DUPLICATE_VEHICLE_ID.getErrorMessage();
|
|
||||||
}
|
|
||||||
// 验证重量
|
|
||||||
if (taskInRequest.getTotalWeight() == null) {
|
|
||||||
return TaskInValidationEnum.NO_WEIGHT.getErrorMessage();
|
|
||||||
}
|
|
||||||
BigDecimal max_weight = BigDecimal.valueOf(10000000);
|
|
||||||
try {
|
|
||||||
max_weight = new BigDecimal(configMap.get(ConfigMapKeyEnum.MAX_WEIGHT.getConfigKey()));
|
|
||||||
} catch (Exception e) {
|
|
||||||
logger.error("转换配置项---最大承重,发生错误");
|
|
||||||
}
|
|
||||||
if (taskInRequest.getTotalWeight().compareTo(max_weight) > 0) {
|
|
||||||
// 超重
|
|
||||||
return TaskInValidationEnum.OVER_WEIGHT.getErrorMessage();
|
|
||||||
}
|
|
||||||
// 验证起点
|
|
||||||
if (StringUtils.isEmpty(taskInRequest.getOriginPoint())) {
|
|
||||||
return TaskInValidationEnum.NO_IN_POINT.getErrorMessage();
|
|
||||||
} else {
|
|
||||||
if (!standService.validateStand(taskInRequest.getOriginPoint(), TaskType.IN.getCode())) {
|
|
||||||
return TaskInValidationEnum.ERROR_IN_POINT.getErrorMessage();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 验证物料信息
|
// 验证物料信息
|
||||||
if (taskInRequest.getGoodsList() != null && !taskInRequest.getGoodsList().isEmpty()) {
|
if (taskInRequest.getGoodsList() != null && !taskInRequest.getGoodsList().isEmpty()) {
|
||||||
for (GoodsInRequest goodsInRequest : taskInRequest.getGoodsList()) {
|
for (GoodsInRequest goodsInRequest : taskInRequest.getGoodsList()) {
|
||||||
|
|
@ -95,9 +65,22 @@ public class ValidateServiceImplements implements IValidateService {
|
||||||
if (StringUtils.isEmpty(goodsInRequest.getGoodsId())) {
|
if (StringUtils.isEmpty(goodsInRequest.getGoodsId())) {
|
||||||
return TaskInValidationEnum.NO_GOODS_ID.getErrorMessage();
|
return TaskInValidationEnum.NO_GOODS_ID.getErrorMessage();
|
||||||
} else {
|
} else {
|
||||||
if (!goodsService.validateGoodsId(goodsInRequest.getGoodsId())) {
|
Goods goods = goodsService.getOne(new LambdaQueryWrapper<Goods>().eq(Goods::getGoodsId, goodsInRequest.getGoodsId()));
|
||||||
|
if (goods == null) {
|
||||||
return TaskInValidationEnum.ERROR_GOODS_ID.getErrorMessage();
|
return TaskInValidationEnum.ERROR_GOODS_ID.getErrorMessage();
|
||||||
}
|
}
|
||||||
|
// TODO 超重验证
|
||||||
|
// // 验证重量
|
||||||
|
// BigDecimal max_weight = BigDecimal.valueOf(10000000);
|
||||||
|
// try {
|
||||||
|
// max_weight = new BigDecimal(configMap.get(ConfigMapKeyEnum.MAX_WEIGHT.getConfigKey()));
|
||||||
|
// } catch (Exception e) {
|
||||||
|
// logger.error("转换配置项---最大承重,发生错误");
|
||||||
|
// }
|
||||||
|
// if (taskInRequest.getTotalWeight().compareTo(max_weight) > 0) {
|
||||||
|
// // 超重
|
||||||
|
// return TaskInValidationEnum.OVER_WEIGHT.getErrorMessage();
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
// 验证数量
|
// 验证数量
|
||||||
if (goodsInRequest.getGoodsNum() == null || goodsInRequest.getGoodsNum().compareTo(BigDecimal.ZERO) <= 0) {
|
if (goodsInRequest.getGoodsNum() == null || goodsInRequest.getGoodsNum().compareTo(BigDecimal.ZERO) <= 0) {
|
||||||
|
|
|
||||||
|
|
@ -7,10 +7,12 @@ import com.wms.constants.enums.*;
|
||||||
import com.wms.entity.app.ResponseEntity;
|
import com.wms.entity.app.ResponseEntity;
|
||||||
import com.wms.entity.app.wcs.WcsStandTaskRequest;
|
import com.wms.entity.app.wcs.WcsStandTaskRequest;
|
||||||
import com.wms.entity.app.wcs.WcsTaskRequest;
|
import com.wms.entity.app.wcs.WcsTaskRequest;
|
||||||
|
import com.wms.entity.table.OutsideVehicles;
|
||||||
import com.wms.entity.table.PickTask;
|
import com.wms.entity.table.PickTask;
|
||||||
import com.wms.entity.table.Task;
|
import com.wms.entity.table.Task;
|
||||||
import com.wms.entity.table.WmsLog;
|
import com.wms.entity.table.WmsLog;
|
||||||
import com.wms.service.LogService;
|
import com.wms.service.LogService;
|
||||||
|
import com.wms.service.OutsideVehiclesService;
|
||||||
import com.wms.service.PickTaskService;
|
import com.wms.service.PickTaskService;
|
||||||
import com.wms.service.TaskService;
|
import com.wms.service.TaskService;
|
||||||
import com.wms.service.business.IWmsJobService;
|
import com.wms.service.business.IWmsJobService;
|
||||||
|
|
@ -39,11 +41,24 @@ public class WmsJobServiceImplements implements IWmsJobService {
|
||||||
private final LogService logService;// 日志服务
|
private final LogService logService;// 日志服务
|
||||||
private final TaskService taskService;// 任务服务
|
private final TaskService taskService;// 任务服务
|
||||||
private final PickTaskService pickTaskService;// 拣选任务服务
|
private final PickTaskService pickTaskService;// 拣选任务服务
|
||||||
|
private final OutsideVehiclesService outsideVehiclesService;// 流转中箱子服务
|
||||||
/**
|
/**
|
||||||
* 发送正常的任务
|
* 发送正常的任务
|
||||||
*/
|
*/
|
||||||
public void sendCommonTasks() throws Exception {
|
public void sendCommonTasks() throws Exception {
|
||||||
try {
|
try {
|
||||||
|
String max_vehicle_nums = configMap.get("MAX_VEHICLE_NUMS");
|
||||||
|
if (StringUtils.isEmpty(max_vehicle_nums)) {
|
||||||
|
logger.error("配置未生成");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
int maxVehicleNums = Integer.parseInt(max_vehicle_nums);
|
||||||
|
List<String> outsideVehicles = outsideVehiclesService.selectDistinctVehicles();
|
||||||
|
if (outsideVehicles == null || outsideVehicles.size() >= maxVehicleNums) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
int remainVehicleNums = maxVehicleNums - outsideVehicles.size();
|
||||||
|
|
||||||
// 检索任务表---新建未下发的任务
|
// 检索任务表---新建未下发的任务
|
||||||
LambdaQueryWrapper<Task> waitForDistributeTaskQuery = new LambdaQueryWrapper<Task>()
|
LambdaQueryWrapper<Task> waitForDistributeTaskQuery = new LambdaQueryWrapper<Task>()
|
||||||
.eq(Task::getTaskStatus, WmsTaskStatus.NEW.getCode());
|
.eq(Task::getTaskStatus, WmsTaskStatus.NEW.getCode());
|
||||||
|
|
@ -54,6 +69,9 @@ public class WmsJobServiceImplements implements IWmsJobService {
|
||||||
List<String> taskGroupIds = new ArrayList<>();
|
List<String> taskGroupIds = new ArrayList<>();
|
||||||
if (!allTasks.isEmpty()) {
|
if (!allTasks.isEmpty()) {
|
||||||
for (Task task : allTasks) {
|
for (Task task : allTasks) {
|
||||||
|
if (taskGroupIds.size() >= remainVehicleNums) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
if (StringUtils.isNotEmpty(task.getPreTask())) {// 当前任务具有前置任务
|
if (StringUtils.isNotEmpty(task.getPreTask())) {// 当前任务具有前置任务
|
||||||
// 查询一下前置的任务有没有存在,存在则不下发
|
// 查询一下前置的任务有没有存在,存在则不下发
|
||||||
if (taskService.exists(new LambdaQueryWrapper<Task>().eq(Task::getTaskId, task.getPreTask()))) {
|
if (taskService.exists(new LambdaQueryWrapper<Task>().eq(Task::getTaskId, task.getPreTask()))) {
|
||||||
|
|
|
||||||
|
|
@ -10,10 +10,7 @@ import com.wms.entity.app.dto.extend.TaskDetailInfo;
|
||||||
import com.wms.entity.app.request.GoodsInRequest;
|
import com.wms.entity.app.request.GoodsInRequest;
|
||||||
import com.wms.entity.app.request.TaskInRequest;
|
import com.wms.entity.app.request.TaskInRequest;
|
||||||
import com.wms.entity.app.request.TaskOutRequest;
|
import com.wms.entity.app.request.TaskOutRequest;
|
||||||
import com.wms.entity.table.Location;
|
import com.wms.entity.table.*;
|
||||||
import com.wms.entity.table.Stock;
|
|
||||||
import com.wms.entity.table.Task;
|
|
||||||
import com.wms.entity.table.Vehicle;
|
|
||||||
import com.wms.service.*;
|
import com.wms.service.*;
|
||||||
import com.wms.service.business.IWmsTaskService;
|
import com.wms.service.business.IWmsTaskService;
|
||||||
import com.wms.utils.StringUtils;
|
import com.wms.utils.StringUtils;
|
||||||
|
|
@ -43,6 +40,7 @@ public class WmsTaskServiceImplements implements IWmsTaskService {
|
||||||
private final TaskService taskService;// 任务服务
|
private final TaskService taskService;// 任务服务
|
||||||
private final LocationService locationService;// 库位服务
|
private final LocationService locationService;// 库位服务
|
||||||
private final StockService stockService;// 库存服务
|
private final StockService stockService;// 库存服务
|
||||||
|
private final GoodsService goodsService;// 物料服务
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -80,12 +78,13 @@ public class WmsTaskServiceImplements implements IWmsTaskService {
|
||||||
* 添加入库任务
|
* 添加入库任务
|
||||||
*
|
*
|
||||||
* @param taskInRequest 入库请求
|
* @param taskInRequest 入库请求
|
||||||
|
* @param sameVehicleTask 相同载具任务
|
||||||
* @return 添加结果
|
* @return 添加结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String genGoodsInTask(TaskInRequest taskInRequest) {
|
public String genGoodsInTask(TaskInRequest taskInRequest, Task sameVehicleTask) {
|
||||||
String result = "";
|
String result = "";
|
||||||
String taskGroupId = generateId("");
|
String taskGroupId = sameVehicleTask != null ? sameVehicleTask.getTaskGroup() : generateId("");
|
||||||
List<Task> tempTasks = new ArrayList<>();
|
List<Task> tempTasks = new ArrayList<>();
|
||||||
for (GoodsInRequest goodsInRequest : taskInRequest.getGoodsList()) {
|
for (GoodsInRequest goodsInRequest : taskInRequest.getGoodsList()) {
|
||||||
Task tempInTask = new Task();
|
Task tempInTask = new Task();
|
||||||
|
|
@ -101,9 +100,11 @@ public class WmsTaskServiceImplements implements IWmsTaskService {
|
||||||
tempInTask.setUserName(taskInRequest.getUserName());
|
tempInTask.setUserName(taskInRequest.getUserName());
|
||||||
// 物料相关信息
|
// 物料相关信息
|
||||||
TaskDetailInfo goodsRelatedInfo = new TaskDetailInfo();
|
TaskDetailInfo goodsRelatedInfo = new TaskDetailInfo();
|
||||||
|
// 查询物料信息
|
||||||
|
Goods goods = goodsService.getOne(new LambdaQueryWrapper<Goods>().eq(Goods::getGoodsId, goodsInRequest.getGoodsId()));
|
||||||
// TODO 物料信息需要完善
|
// TODO 物料信息需要完善
|
||||||
goodsRelatedInfo.setGoodsId(goodsInRequest.getGoodsId());
|
goodsRelatedInfo.setGoodsId(goods.getGoodsId());
|
||||||
goodsRelatedInfo.setGoodsName("");
|
goodsRelatedInfo.setGoodsName(goods.getGoodsName());
|
||||||
goodsRelatedInfo.setOpNum(goodsInRequest.getGoodsNum());
|
goodsRelatedInfo.setOpNum(goodsInRequest.getGoodsNum());
|
||||||
goodsRelatedInfo.setOriginNum(BigDecimal.ZERO);
|
goodsRelatedInfo.setOriginNum(BigDecimal.ZERO);
|
||||||
tempInTask.setGoodsRelated(goodsRelatedInfo);
|
tempInTask.setGoodsRelated(goodsRelatedInfo);
|
||||||
|
|
|
||||||
|
|
@ -8,10 +8,22 @@ import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 流转中的载具物料服务实现
|
* 流转中的载具物料服务实现
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
||||||
public class OutsideVehiclesServiceImpl extends ServiceImpl<OutsideVehiclesMapper, OutsideVehicles> implements OutsideVehiclesService {
|
public class OutsideVehiclesServiceImpl extends ServiceImpl<OutsideVehiclesMapper, OutsideVehicles> implements OutsideVehiclesService {
|
||||||
|
private final OutsideVehiclesMapper outsideVehiclesMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询流转中的箱子列表
|
||||||
|
* @return 箱子列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<String> selectDistinctVehicles() {
|
||||||
|
return outsideVehiclesMapper.selectDistinctVehicles();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -118,4 +118,26 @@ public class StringUtils {
|
||||||
public static String convertJsonString(Object o) {
|
public static String convertJsonString(Object o) {
|
||||||
return JSON.toJSONString(o);
|
return JSON.toJSONString(o);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 往字符串左侧添加字符
|
||||||
|
* @param value 原字符
|
||||||
|
* @param size 目标字符串长度
|
||||||
|
* @param padStr 添加的字符
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public static String padLeft(String value, int size, String padStr) {
|
||||||
|
return org.apache.commons.lang3.StringUtils.leftPad(value, size, padStr);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 往字符串右侧添加字符
|
||||||
|
* @param value 原字符
|
||||||
|
* @param size 目标字符串长度
|
||||||
|
* @param padStr 添加的字符
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public static String padRight(String value, int size, String padStr) {
|
||||||
|
return org.apache.commons.lang3.StringUtils.rightPad(value, size, padStr);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,20 +8,20 @@ spring:
|
||||||
# 主库
|
# 主库
|
||||||
master:
|
master:
|
||||||
# 宝开服务器--外网
|
# 宝开服务器--外网
|
||||||
# url: jdbc:mysql://112.4.208.194:3001/wms_miniload_bk7?characterEncoding=utf8&serverTimezone=Asia/Shanghai&allowMultiQueries=true&rewriteBatchedStatements=true
|
# url: jdbc:mysql://112.4.208.194:3001/wms_kate_suzhou?characterEncoding=utf8&serverTimezone=Asia/Shanghai&allowMultiQueries=true&rewriteBatchedStatements=true
|
||||||
# username: coder
|
# username: coder
|
||||||
# password: coder
|
# password: coder
|
||||||
# driver-class-name: com.mysql.cj.jdbc.Driver
|
# driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
# 宝开服务器--内网
|
# 宝开服务器--内网
|
||||||
url: jdbc:mysql://192.168.3.254:3306/wms_kate_suzhou?characterEncoding=utf8&serverTimezone=Asia/Shanghai&allowMultiQueries=true&rewriteBatchedStatements=true
|
# url: jdbc:mysql://192.168.3.254:3306/wms_kate_suzhou?characterEncoding=utf8&serverTimezone=Asia/Shanghai&allowMultiQueries=true&rewriteBatchedStatements=true
|
||||||
username: coder
|
# username: coder
|
||||||
password: coder
|
# password: coder
|
||||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
|
||||||
# 上线环境
|
|
||||||
# url: jdbc:mysql://localhost:3306/wms_xizhou?characterEncoding=utf8&serverTimezone=Asia/Shanghai&allowMultiQueries=true&rewriteBatchedStatements=true
|
|
||||||
# username: developer
|
|
||||||
# password: developer
|
|
||||||
# driver-class-name: com.mysql.cj.jdbc.Driver
|
# driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
|
# 上线环境
|
||||||
|
url: jdbc:mysql://localhost:3306/wms_kate_suzhou?characterEncoding=utf8&serverTimezone=Asia/Shanghai&allowMultiQueries=true&rewriteBatchedStatements=true
|
||||||
|
username: developer
|
||||||
|
password: developer
|
||||||
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
# 从库
|
# 从库
|
||||||
slave_1:
|
slave_1:
|
||||||
url: jdbc:mysql://localhost:3306/wms_xizhou?characterEncoding=utf8&serverTimezone=Asia/Shanghai&allowMultiQueries=true&rewriteBatchedStatements=true
|
url: jdbc:mysql://localhost:3306/wms_xizhou?characterEncoding=utf8&serverTimezone=Asia/Shanghai&allowMultiQueries=true&rewriteBatchedStatements=true
|
||||||
|
|
|
||||||
|
|
@ -2,5 +2,7 @@
|
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.wms.mapper.OutsideVehiclesMapper">
|
<mapper namespace="com.wms.mapper.OutsideVehiclesMapper">
|
||||||
|
<select id="selectDistinctVehicles" resultType="string">
|
||||||
|
select distinct vehicle_id from tbl_app_outside_vehicles;
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user