Browse Source

一键移库增加是否可用和是否有货判断

master
psh 4 months ago
parent
commit
075d6ba99f
  1. 2
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/dao/SchBasePoint.java
  2. 1
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/impl/SchBasePointServiceImpl.java
  3. 74
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task/service/impl/SchBaseTaskServiceImpl.java

2
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/dao/SchBasePoint.java

@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import java.math.BigDecimal;
import java.io.Serializable;
@ -20,6 +21,7 @@ import java.util.List;
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("sch_base_point")
@ToString
public class SchBasePoint implements Serializable {
private static final long serialVersionUID = 1L;

1
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/impl/SchBasePointServiceImpl.java

@ -138,6 +138,7 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
@Override
public void update(SchBasePoint entity) {
log.info("管理端手动变更点位信息:{}",entity.toString());
String currentUserId = SecurityUtils.getCurrentUserId();
String nickName = SecurityUtils.getCurrentNickName();
String now = DateUtil.now();

74
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task/service/impl/SchBaseTaskServiceImpl.java

@ -67,7 +67,7 @@ public class SchBaseTaskServiceImpl extends ServiceImpl<SchBaseTaskMapper, SchBa
String begin_time = ObjectUtil.isNotEmpty(whereJson.get("begin_time")) ? whereJson.get("begin_time").toString() : null;
String end_time = ObjectUtil.isNotEmpty(whereJson.get("end_time")) ? whereJson.get("end_time").toString() : null;
String more_task_status = ObjectUtil.isNotEmpty(whereJson.get("more_task_status")) ? whereJson.get("more_task_status").toString() : null;
List<String> collect = ObjectUtil.isNotEmpty(more_task_status)?Arrays.stream(more_task_status.split(",")).collect(Collectors.toList()):null;
List<String> collect = ObjectUtil.isNotEmpty(more_task_status) ? Arrays.stream(more_task_status.split(",")).collect(Collectors.toList()) : null;
String unFinished = null;
if (collect != null) {
if (collect.contains(TaskStatus.UNFINISHED.getCode())) {
@ -189,30 +189,30 @@ public class SchBaseTaskServiceImpl extends ServiceImpl<SchBaseTaskMapper, SchBa
String vehicle_code = ObjectUtil.isNotEmpty(param.getString("vehicle_code")) ? param.getString("vehicle_code") : null;
String config_code = param.getString("config_code");
if("4".equals(type)){
//4-叫料
if ("4".equals(type)) {
//4-叫料
}else if("5".equals(type)){
//5-满料出库
if(device_code.startsWith("TBX")){
config_code="MJXLTask";
param.put("config_code",config_code);
}
} else if ("5".equals(type)) {
//5-满料出库
if (device_code.startsWith("TBX")) {
config_code = "MJXLTask";
param.put("config_code", config_code);
}
}else if("6".equals(type)){
//6-申请空盘
} else if ("6".equals(type)) {
//6-申请空盘
}else if("7".equals(type)){
//7-空托盘出库
} else if ("7".equals(type)) {
//7-空托盘出库
}
}
if(ObjectUtil.isEmpty(config_code)){
throw new BadRequestException("任务类型不正确!device_code:"+device_code+",type:"+type);
}
AbstractTask task = taskFactory.getTask(config_code);
// 执行创建任务
task.apply(param);
if (ObjectUtil.isEmpty(config_code)) {
throw new BadRequestException("任务类型不正确!device_code:" + device_code + ",type:" + type);
}
AbstractTask task = taskFactory.getTask(config_code);
// 执行创建任务
task.apply(param);
}
@Override
@ -239,7 +239,7 @@ public class SchBaseTaskServiceImpl extends ServiceImpl<SchBaseTaskMapper, SchBa
// 根据标识找到任务
SchBaseTask taskOne = schBaseTaskMapper.selectById(task_id);
if (Integer.parseInt(taskOne.getTask_status()) >= Integer.parseInt(TaskStatus.FINISHED.getCode())
&&!"feedback".equals(method_name)) {
&& !"feedback".equals(method_name)) {
throw new BadRequestException("任务已完成或已取消!");
}
// 根据配置去工厂类获得类对象
@ -267,12 +267,12 @@ public class SchBaseTaskServiceImpl extends ServiceImpl<SchBaseTaskMapper, SchBa
}
}
private void sendToMes(SchBaseTask task){
if(task.getPoint_code2().startsWith("YL")){
private void sendToMes(SchBaseTask task) {
if (task.getPoint_code2().startsWith("YL")) {
// QPMES062
}else if(task.getPoint_code2().startsWith("HW")){
} else if (task.getPoint_code2().startsWith("HW")) {
// QPMES065
}else{
} else {
throw new RuntimeException("目的地非入原材料库或出库,无需反馈MES!");
}
}
@ -283,29 +283,31 @@ public class SchBaseTaskServiceImpl extends ServiceImpl<SchBaseTaskMapper, SchBa
* @return
*/
@Override
public void move(){
public void move() {
log.info("管理端发起一键移库!");
List<SchBasePoint> schBasePointList=schBasePointService.list(new LambdaQueryWrapper<SchBasePoint>()
.eq(SchBasePoint::getIs_used,true)
List<SchBasePoint> schBasePointList = schBasePointService.list(new LambdaQueryWrapper<SchBasePoint>()
.eq(SchBasePoint::getIs_used, true)
.eq(SchBasePoint::getRegion_code, "YLHC")
.notLike(SchBasePoint::getVehicle_code2,"YBHC")
.notLike(SchBasePoint::getVehicle_code2, "YBHC")
.and(slam -> slam.isNull(SchBasePoint::getIng_task_code)
.or()
.eq(SchBasePoint::getIng_task_code, "")
));
List<SchBasePoint> nextList=schBasePointService.list(new LambdaQueryWrapper<SchBasePoint>()
List<SchBasePoint> nextList = schBasePointService.list(new LambdaQueryWrapper<SchBasePoint>()
.eq(SchBasePoint::getRegion_code, "YL")
.eq(SchBasePoint::getIs_used, true)
.eq(SchBasePoint::getVehicle_qty, 0)
.and(slam -> slam.isNull(SchBasePoint::getIng_task_code)
.or()
.eq(SchBasePoint::getIng_task_code, "")));
for(SchBasePoint schBasePoint:schBasePointList){
JSONObject param =new JSONObject();
param.put("start_point",schBasePoint.getPoint_code());
param.put("next_point",nextList.get(0).getPoint_code());
for (SchBasePoint schBasePoint : schBasePointList) {
JSONObject param = new JSONObject();
param.put("start_point", schBasePoint.getPoint_code());
param.put("next_point", nextList.get(0).getPoint_code());
param.put("request_medthod_code", "POINTTask");
param.put("request_medthod_name", "点对点任务");
param.put("device_code",param.getString("start_point"));
BaseResponse baseResponse=acsToWmsService.acsApply(param);
param.put("device_code", param.getString("start_point"));
BaseResponse baseResponse = acsToWmsService.acsApply(param);
nextList.remove(0);
}
}

Loading…
Cancel
Save