opt: 手持操作,取空笼框优化
This commit is contained in:
@@ -62,14 +62,13 @@ public class HandheldController {
|
||||
@ApiOperation("点位锁定释放")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> applyPointLock(@RequestBody JSONObject param) {
|
||||
handheldService.pointLock(param);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
return new ResponseEntity<>(handheldService.pointLock(param), HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/sourehouse")
|
||||
@Log("物料回库")
|
||||
@ApiOperation("物料回库")
|
||||
@Log("补空框")
|
||||
@ApiOperation("补空框")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> createToStorehouse(@RequestBody JSONObject param) {
|
||||
handheldService.toStorehouse(param);
|
||||
|
||||
@@ -33,10 +33,10 @@ public interface HandheldService {
|
||||
* 点位锁定
|
||||
* @param param
|
||||
*/
|
||||
void pointLock(JSONObject param);
|
||||
String pointLock(JSONObject param);
|
||||
|
||||
/**
|
||||
* 物料回库任务
|
||||
* 补空框
|
||||
* @param param
|
||||
*/
|
||||
void toStorehouse(JSONObject param);
|
||||
|
||||
@@ -9,11 +9,15 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import nl.basjes.shaded.org.springframework.util.Assert;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.system.service.notice.ISysNoticeService;
|
||||
import org.nl.wms.ext.handheld.service.HandheldService;
|
||||
import org.nl.wms.sch.group.service.ISchBaseVehiclematerialgroupService;
|
||||
import org.nl.wms.sch.group.service.dao.SchBaseVehiclematerialgroup;
|
||||
import org.nl.wms.sch.point.service.ISchBasePointService;
|
||||
import org.nl.wms.sch.point.service.dao.SchBasePoint;
|
||||
import org.nl.wms.sch.region.service.ISchBaseRegionService;
|
||||
import org.nl.wms.sch.region.service.dao.SchBaseRegion;
|
||||
import org.nl.wms.sch.task.service.ISchBaseTaskService;
|
||||
import org.nl.wms.sch.task_manage.AbstractTask;
|
||||
import org.nl.wms.sch.task_manage.GeneralDefinition;
|
||||
import org.nl.wms.sch.task_manage.task.TaskFactory;
|
||||
@@ -30,12 +34,14 @@ public class HandheldServiceImpl implements HandheldService {
|
||||
|
||||
@Autowired
|
||||
private ISchBasePointService iSchBasePointService;
|
||||
|
||||
@Autowired
|
||||
private TaskFactory taskFactory;
|
||||
|
||||
@Autowired
|
||||
private ISchBaseRegionService iSchBaseRegionService;
|
||||
@Autowired
|
||||
private ISchBaseVehiclematerialgroupService iSchBaseVehiclematerialgroupService;
|
||||
@Autowired
|
||||
private ISchBaseTaskService iSchBaseTaskService;
|
||||
|
||||
|
||||
@Override
|
||||
@@ -82,12 +88,12 @@ public class HandheldServiceImpl implements HandheldService {
|
||||
@Override
|
||||
public void cageBlankingTask(JSONObject param) {
|
||||
Assert.noNullElements(new Object[]{param.getString("device_code"), param.getString("vehicle_code")
|
||||
, param.getString("material_id"), param.getString("region_code"), param.getString("has_report")}, "参数不能为空!");
|
||||
, param.getString("material_qty"), param.getString("region_code"), param.getString("order_code")}, "参数不能为空!");
|
||||
String device_code = param.getString("device_code");
|
||||
String vehicle_code = param.getString("vehicle_code");
|
||||
String material_id = param.getString("material_id");
|
||||
String material_qty = param.getString("material_qty");
|
||||
String region_code = param.getString("region_code");
|
||||
String has_report = param.getString("has_report");
|
||||
String order_code = param.getString("order_id");
|
||||
SchBasePoint schBasePoint = iSchBasePointService.selectByPointCode(device_code);
|
||||
if (ObjectUtil.isEmpty(schBasePoint)) throw new BadRequestException("设备点位不存在!");
|
||||
iSchBasePointService.update(Wrappers.lambdaUpdate(SchBasePoint.class)
|
||||
@@ -103,43 +109,53 @@ public class HandheldServiceImpl implements HandheldService {
|
||||
jo.put("region_code", region_code);
|
||||
jo.put("ext_data", param);
|
||||
connectorTask.apply(jo);
|
||||
iSchBaseVehiclematerialgroupService.remove(Wrappers.lambdaQuery(SchBaseVehiclematerialgroup.class)
|
||||
.eq(SchBaseVehiclematerialgroup::getVehicle_code, vehicle_code));
|
||||
SchBaseVehiclematerialgroup schBaseVehiclematerialgroup = new SchBaseVehiclematerialgroup();
|
||||
schBaseVehiclematerialgroup.setVehicle_code(vehicle_code);
|
||||
schBaseVehiclematerialgroup.setMaterial_qty(Integer.parseInt(material_qty));
|
||||
schBaseVehiclematerialgroup.setOrder_code(order_code);
|
||||
iSchBaseVehiclematerialgroupService.create(schBaseVehiclematerialgroup);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void pointLock(JSONObject param) {
|
||||
public String pointLock(JSONObject param) {
|
||||
Assert.noNullElements(new Object[]{param.getString("region_code"), param.getString("status")}, "参数不能为空!");
|
||||
String region_code = param.getString("region_code");
|
||||
String status = param.getString("status");
|
||||
SchBaseRegion schBaseRegion = iSchBaseRegionService.getOne(Wrappers.lambdaQuery(SchBaseRegion.class)
|
||||
.eq(SchBaseRegion::getRegion_code, region_code));
|
||||
if (ObjectUtil.isEmpty(schBaseRegion)) throw new BadRequestException("该区域不存在!");
|
||||
List<String> byRegionCode = iSchBasePointService.getByRegionCode(region_code);
|
||||
if (StrUtil.equals(status, "0")) {
|
||||
iSchBasePointService.releasePoint(region_code);
|
||||
} else if (StrUtil.equals(status, "1")) {
|
||||
iSchBasePointService.lockPoint(region_code);
|
||||
}
|
||||
if(CollUtil.isNotEmpty(byRegionCode) && byRegionCode.size()>0){
|
||||
return "当前区域已存在的任务有" + byRegionCode.size() + "个";
|
||||
}
|
||||
return "操作成功";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void toStorehouse(JSONObject param) {
|
||||
Assert.noNullElements(new Object[]{param.getString("device_code"), param.getString("vehicle_code"), param.getString("ext")}, "参数不能为空!");
|
||||
Assert.noNullElements(new Object[]{param.getString("device_code"), param.getString("vehicle_type")}, "参数不能为空!");
|
||||
//点位编码
|
||||
String device_code = param.getString("device_code");
|
||||
//载具号
|
||||
String vehicle_code = param.getString("vehicle_code");
|
||||
String region_code = param.getString("region_code");
|
||||
String vehicle_type = param.getString("vehicle_type");
|
||||
//物料数据
|
||||
String ext = param.getString("ext");
|
||||
SchBasePoint schBasePoint = iSchBasePointService.selectByPointCode(device_code);
|
||||
if (ObjectUtil.isEmpty(schBasePoint)) throw new BadRequestException("设备点位不存在!");
|
||||
AbstractTask connectorTask = taskFactory.getTask("BLANKINGTask");
|
||||
AbstractTask connectorTask = taskFactory.getTask("TOSTOREHOUSETask");
|
||||
// 准备参数:设备编码
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("device_code", device_code);
|
||||
jo.put("config_code", "TOSTOREHOUSETask");
|
||||
jo.put("create_mode", GeneralDefinition.AUTO_CREATION);
|
||||
jo.put("vehicle_code", vehicle_code);
|
||||
jo.put("region_code", region_code);
|
||||
jo.put("vehicle_code", vehicle_type);
|
||||
jo.put("ext_data", param);
|
||||
connectorTask.apply(jo);
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
|
||||
@@ -179,4 +179,11 @@ public interface ISchBasePointService extends IService<SchBasePoint> {
|
||||
* @param region_code
|
||||
*/
|
||||
void lockPoint(String region_code);
|
||||
|
||||
/**
|
||||
* 根据区域编码查找点位名称
|
||||
* @return
|
||||
*/
|
||||
List<String> getByRegionCode(String region_code);
|
||||
|
||||
}
|
||||
|
||||
@@ -23,4 +23,7 @@ public interface SchBasePointMapper extends BaseMapper<SchBasePoint> {
|
||||
SchBasePoint selectByIdLock(String id);
|
||||
|
||||
List<PointMaterialInfo> getStructList(@Param("region_code") String region_code, @Param("vehicle_type")String vehicle_type);
|
||||
|
||||
List<String> selectByRegionCode(@Param("region_code") String region_code);
|
||||
|
||||
}
|
||||
|
||||
@@ -42,4 +42,14 @@
|
||||
AND sch_base_point.region_code = #{region_code}
|
||||
|
||||
</select>
|
||||
<select id="selectByRegionCode" resultType="java.lang.String">
|
||||
select
|
||||
sbp.vehicle_code
|
||||
from
|
||||
sch_base_point sbp
|
||||
where
|
||||
sbp.region_code = #{region_code}
|
||||
and sbp.is_lock = true
|
||||
and sbp.is_used = true
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -68,6 +68,9 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
|
||||
@Autowired
|
||||
private ISysNoticeService noticeService;
|
||||
|
||||
private final String nameClass = "SchBasePoint";
|
||||
|
||||
|
||||
@Override
|
||||
public IPage<SchBasePoint> queryAll(Map whereJson, PageQuery page) {
|
||||
String blurry = ObjectUtil.isNotEmpty(whereJson.get("blurry")) ? whereJson.get("blurry").toString() : null;
|
||||
@@ -240,7 +243,7 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public SchBasePoint selectByRegionCode(String region_code, String vehicleCode,String piont_type) {
|
||||
public SchBasePoint selectByRegionCode(String region_code, String vehicleCode, String piont_type) {
|
||||
//查询载具的类型
|
||||
MdBaseVehicle mdBaseVehicle = iMdBaseVehicleService.getById(vehicleCode);
|
||||
if (ObjectUtil.isEmpty(mdBaseVehicle)) throw new BadRequestException("载具类型不存在!");
|
||||
@@ -376,8 +379,8 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
|
||||
.eq(SchBasePoint::getIs_used, true)
|
||||
.eq(SchBasePoint::getPoint_status, pointStatus)
|
||||
.eq(SchBasePoint::getCan_vehicle_type, vehicle_type)
|
||||
.isNull(seq == 2,SchBasePoint::getVehicles)
|
||||
.isNull(seq == 1,SchBasePoint::getVehicle_code)
|
||||
.isNull(seq == 2, SchBasePoint::getVehicles)
|
||||
.isNull(seq == 1, SchBasePoint::getVehicle_code)
|
||||
.eq(StrUtil.isNotBlank(region_code), SchBasePoint::getRegion_code, region_code)
|
||||
.orderByAsc(seq == 2, SchBasePoint::getIn_order_seq));
|
||||
return (CollUtil.isNotEmpty(schBasePoints) && schBasePoints.size() > 0) ? schBasePoints.get(0) : null;
|
||||
@@ -386,49 +389,59 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRES_NEW)
|
||||
public SchBasePoint selectByEmptyCage(String region_code, String vehicle_type, String pointStatus, boolean isVehicle, SchBaseTask task) {
|
||||
List<SchBasePoint> schBasePoints = pointMapper.selectList(Wrappers.lambdaQuery(SchBasePoint.class)
|
||||
.eq(SchBasePoint::getIs_lock, false)
|
||||
.eq(SchBasePoint::getIs_used, true)
|
||||
.eq(SchBasePoint::getPoint_status, pointStatus)
|
||||
.eq(SchBasePoint::getCan_vehicle_type, vehicle_type)
|
||||
.eq(SchBasePoint::getRegion_code, region_code)
|
||||
.isNotNull(SchBasePoint::getVehicles)
|
||||
.orderByDesc(SchBasePoint::getIn_order_seq));
|
||||
if (CollUtil.isNotEmpty(schBasePoints) && schBasePoints.size() > 0) {
|
||||
SchBasePoint schBasePoint = schBasePoints.get(0);
|
||||
if (schBasePoints.size() == 1 && isVehicle) {
|
||||
if (schBasePoint.getVehicle_qty() == 1) {
|
||||
task.setRemark("没有多余空笼框,待补充!");
|
||||
taskService.updateById(task);
|
||||
// 消息通知
|
||||
noticeService.createNotice("没有多余空笼框,待补充!", task.getConfig_code() + task.getTask_code(),
|
||||
NoticeTypeEnum.WARN.getCode());
|
||||
return null;
|
||||
synchronized (this.nameClass){
|
||||
List<SchBasePoint> schBasePoints = pointMapper.selectList(Wrappers.lambdaQuery(SchBasePoint.class)
|
||||
.eq(SchBasePoint::getIs_lock, false)
|
||||
.eq(SchBasePoint::getIs_used, true)
|
||||
.eq(SchBasePoint::getPoint_status, pointStatus)
|
||||
.eq(SchBasePoint::getCan_vehicle_type, vehicle_type)
|
||||
.isNotNull(SchBasePoint::getVehicle_code));
|
||||
if(CollUtil.isNotEmpty(schBasePoints) && schBasePoints.size() > 0){
|
||||
return schBasePoints.get(0);
|
||||
}
|
||||
schBasePoints = pointMapper.selectList(Wrappers.lambdaQuery(SchBasePoint.class)
|
||||
.eq(SchBasePoint::getIs_lock, false)
|
||||
.eq(SchBasePoint::getIs_used, true)
|
||||
.eq(SchBasePoint::getPoint_status, pointStatus)
|
||||
.eq(SchBasePoint::getCan_vehicle_type, vehicle_type)
|
||||
.eq(SchBasePoint::getRegion_code, region_code)
|
||||
.isNotNull(SchBasePoint::getVehicles)
|
||||
.orderByDesc(SchBasePoint::getIn_order_seq));
|
||||
if (CollUtil.isNotEmpty(schBasePoints) && schBasePoints.size() > 0) {
|
||||
SchBasePoint schBasePoint = schBasePoints.get(0);
|
||||
/*if (schBasePoints.size() == 1 && isVehicle) {
|
||||
if (schBasePoint.getVehicle_qty() <= 1) {
|
||||
task.setRemark("没有多余空笼框,待补充!");
|
||||
taskService.updateById(task);
|
||||
// 消息通知
|
||||
noticeService.createNotice("没有多余空笼框,待补充!", task.getConfig_code() + task.getTask_code(),
|
||||
NoticeTypeEnum.WARN.getCode());
|
||||
return null;
|
||||
}
|
||||
}*/
|
||||
Gson gson = new Gson();
|
||||
Type setType = new TypeToken<List<String>>() {
|
||||
}.getType();
|
||||
List<String> msg = gson.fromJson(schBasePoint.getVehicles(), setType);
|
||||
Integer vehicle_qty = schBasePoint.getVehicle_qty();
|
||||
if (vehicle_qty != msg.size()) throw new BadRequestException("载具数量与载具编码数量不一致!");
|
||||
String s = msg.get(msg.size() - 1);
|
||||
schBasePoint.setVehicle_qty(vehicle_qty - 1);
|
||||
msg.remove(s);
|
||||
schBasePoint.setVehicles(JSONUtil.toJsonStr(msg));
|
||||
this.updateById(schBasePoint);
|
||||
if (schBasePoint.getVehicle_qty() == 0) {
|
||||
update(Wrappers.lambdaUpdate(SchBasePoint.class)
|
||||
.eq(SchBasePoint::getPoint_code, schBasePoint.getPoint_code())
|
||||
.set(SchBasePoint::getPoint_status, GoodsEnum.OUT_OF_STOCK.getValue())
|
||||
.set(SchBasePoint::getVehicles, null));
|
||||
}
|
||||
SchBasePoint schBasePoint1 = selectByPointCode(schBasePoint.getPoint_code() + "_" + (vehicle_qty - 1));
|
||||
schBasePoint1.setVehicle_code(s);
|
||||
return schBasePoint1;
|
||||
}
|
||||
Gson gson = new Gson();
|
||||
Type setType = new TypeToken<List<String>>() {
|
||||
}.getType();
|
||||
List<String> msg = gson.fromJson(schBasePoint.getVehicles(), setType);
|
||||
Integer vehicle_qty = schBasePoint.getVehicle_qty();
|
||||
if (vehicle_qty != msg.size()) throw new BadRequestException("载具数量与载具编码数量不一致!");
|
||||
String s = msg.get(msg.size() - 1);
|
||||
schBasePoint.setVehicle_qty(vehicle_qty - 1);
|
||||
msg.remove(s);
|
||||
schBasePoint.setVehicles(JSONUtil.toJsonStr(msg));
|
||||
/*schBasePoint.setIs_lock(true);*/
|
||||
this.updateById(schBasePoint);
|
||||
if (schBasePoint.getVehicle_qty() == 0) {
|
||||
update(Wrappers.lambdaUpdate(SchBasePoint.class)
|
||||
.eq(SchBasePoint::getPoint_code, schBasePoint.getPoint_code())
|
||||
.set(SchBasePoint::getPoint_status, GoodsEnum.OUT_OF_STOCK.getValue())
|
||||
.set(SchBasePoint::getVehicles, null));
|
||||
}
|
||||
SchBasePoint schBasePoint1 = selectByPointCode(schBasePoint.getPoint_code() + "_" + (vehicle_qty - 1));
|
||||
schBasePoint1.setVehicle_code(s);
|
||||
return schBasePoint1;
|
||||
return null;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -441,6 +454,12 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
|
||||
update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getRegion_code, region_code).set(SchBasePoint::getIs_lock, true));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getByRegionCode(String region_code) {
|
||||
List<String> list = pointMapper.selectByRegionCode(region_code);
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PointMaterialInfo> getStructList(String region_code, String vehicle_type) {
|
||||
List<PointMaterialInfo> structList = pointMapper.getStructList(region_code, vehicle_type);
|
||||
|
||||
@@ -56,7 +56,7 @@ public class BlankingTask extends AbstractTask {
|
||||
// 配置信息
|
||||
for (SchBaseTask task : tasks) {
|
||||
MdBaseVehicle mdBaseVehicle = iMdBaseVehicleService.selectByVehicleCode(task.getVehicle_code());
|
||||
if(ObjectUtil.isEmpty(mdBaseVehicle)){
|
||||
if (ObjectUtil.isEmpty(mdBaseVehicle)) {
|
||||
task.setRemark("载具号不存在!");
|
||||
taskService.updateById(task);
|
||||
// 消息通知
|
||||
@@ -64,8 +64,14 @@ public class BlankingTask extends AbstractTask {
|
||||
NoticeTypeEnum.WARN.getCode());
|
||||
continue;
|
||||
}
|
||||
SchBasePoint schBasePoint = schBasePointService.selectByGroundPoint(task.getRegion_code(),
|
||||
GoodsEnum.OUT_OF_STOCK.getValue(),mdBaseVehicle.getVehicle_type(),1);
|
||||
SchBasePoint schBasePoint = null;
|
||||
if (ObjectUtil.isEmpty(task.getRegion_code())) {
|
||||
schBasePoint = schBasePointService.selectByGroundPoint(null,
|
||||
GoodsEnum.OUT_OF_STOCK.getValue(), mdBaseVehicle.getVehicle_type(), 1);
|
||||
} else {
|
||||
schBasePoint = schBasePointService.selectByGroundPoint(task.getRegion_code(),
|
||||
GoodsEnum.OUT_OF_STOCK.getValue(), mdBaseVehicle.getVehicle_type(), 1);
|
||||
}
|
||||
if (ObjectUtil.isEmpty(schBasePoint)) {
|
||||
task.setRemark("未找到所需点位!");
|
||||
taskService.updateById(task);
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
package org.nl.wms.sch.task_manage.task.tasks.handheld;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONArray;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import org.nl.common.enums.GoodsEnum;
|
||||
@@ -56,22 +59,32 @@ public class EmptyCageTask extends AbstractTask {
|
||||
for (SchBaseTask task : tasks) {
|
||||
TaskUtils.setUpdateByAcs(task);
|
||||
// 查询是空料笼还是,空料架
|
||||
Integer vehicle_qty = task.getVehicle_qty();
|
||||
String vehicle_type = task.getVehicle_type();
|
||||
/*String vehicle_code = task.getVehicle_code();
|
||||
if(StrUtil.isNotEmpty(vehicle_code)){
|
||||
JSONArray json = JSONUtil.parseArray(vehicle_code);
|
||||
String s = json.get(0, String.class);
|
||||
|
||||
}*/
|
||||
SchBasePoint schBasePoint = null;
|
||||
switch (vehicle_qty) {
|
||||
case 1:
|
||||
switch (vehicle_type) {
|
||||
case "S04":
|
||||
//空料架
|
||||
/*schBasePoint = schBasePointService.selectByGroundPoint(GoodsEnum.OUT_OF_STOCK.getValue(),task.getVehicle_type(),1);*/
|
||||
schBasePoint = schBasePointService.selectByGroundPoint(null, GoodsEnum.OUT_OF_STOCK.getValue(), task.getVehicle_type(), 1);
|
||||
break;
|
||||
case 2:
|
||||
case "S06":
|
||||
//空料架
|
||||
schBasePoint = schBasePointService.selectByGroundPoint(null, GoodsEnum.OUT_OF_STOCK.getValue(), task.getVehicle_type(), 1);
|
||||
break;
|
||||
case "R01":
|
||||
//RO1空料容
|
||||
schBasePoint = schBasePointService.selectByGroundPoint(RegionEnum.DDLK.getRegion_code(),
|
||||
GoodsEnum.OUT_OF_STOCK.getValue(), VehicleTypeEnum.FRAME_R01.getVehicleCode(),2);
|
||||
GoodsEnum.OUT_OF_STOCK.getValue(), VehicleTypeEnum.FRAME_R01.getVehicleCode(), 2);
|
||||
break;
|
||||
case 4:
|
||||
case "R02":
|
||||
//RO2空料容
|
||||
schBasePoint = schBasePointService.selectByGroundPoint(RegionEnum.DDLK.getRegion_code(),
|
||||
GoodsEnum.OUT_OF_STOCK.getValue(),VehicleTypeEnum.FRAME_R02.getVehicleCode(),2);
|
||||
GoodsEnum.OUT_OF_STOCK.getValue(), VehicleTypeEnum.FRAME_R02.getVehicleCode(), 2);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -29,7 +29,7 @@ import java.util.List;
|
||||
|
||||
/**
|
||||
* @author LENOVO
|
||||
* 物料回库
|
||||
* 补空框任务
|
||||
*/
|
||||
@Component("TOSTOREHOUSETask")
|
||||
public class ToStoreHouseTask extends AbstractTask {
|
||||
@@ -55,18 +55,8 @@ public class ToStoreHouseTask extends AbstractTask {
|
||||
List<SchBaseTask> tasks = taskService.findTasksByTaskStatus(TASK_CONFIG_CODE, TaskStatus.APPLY);
|
||||
// 配置信息
|
||||
for (SchBaseTask task : tasks) {
|
||||
TaskUtils.setUpdateByAcs(task);
|
||||
MdBaseVehicle mdBaseVehicle = iMdBaseVehicleService.selectByVehicleCode(task.getVehicle_code());
|
||||
if(ObjectUtil.isEmpty(mdBaseVehicle)){
|
||||
task.setRemark("该载具不存在!");
|
||||
taskService.updateById(task);
|
||||
// 消息通知
|
||||
noticeService.createNotice("该载具不存在!", TASK_CONFIG_CODE + task.getTask_code(),
|
||||
NoticeTypeEnum.WARN.getCode());
|
||||
continue;
|
||||
}
|
||||
SchBasePoint schBasePoint = schBasePointService.selectByGroundPoint(task.getRegion_code(), GoodsEnum.OUT_OF_STOCK.getValue()
|
||||
,mdBaseVehicle.getVehicle_type(),1);
|
||||
SchBasePoint schBasePoint = schBasePointService.selectByGroundPoint(null, GoodsEnum.EMPTY_PALLETS.getValue()
|
||||
,task.getVehicle_type(),0);
|
||||
if (ObjectUtil.isEmpty(schBasePoint)) {
|
||||
task.setRemark("未找到所需点位!");
|
||||
taskService.updateById(task);
|
||||
@@ -76,8 +66,8 @@ public class ToStoreHouseTask extends AbstractTask {
|
||||
continue;
|
||||
}
|
||||
// 设置终点并修改创建成功状态
|
||||
task.setPoint_code2(schBasePoint.getPoint_code());
|
||||
task.setVehicle_type(schBasePoint.getCan_vehicle_type());
|
||||
task.setPoint_code1(schBasePoint.getPoint_code());
|
||||
task.setVehicle_code(schBasePoint.getVehicle_code());
|
||||
task.setRemark("");
|
||||
task.setTask_status(TaskStatus.CREATED.getCode());
|
||||
taskService.updateById(task);
|
||||
|
||||
@@ -78,6 +78,8 @@ public class SortingSMTTask extends AbstractTask {
|
||||
NoticeTypeEnum.WARN.getCode());
|
||||
continue;
|
||||
}
|
||||
schBaseVehiclematerialgroupService.remove(Wrappers.lambdaQuery(SchBaseVehiclematerialgroup.class)
|
||||
.eq(SchBaseVehiclematerialgroup::getVehicle_code, task.getVehicle_code()));
|
||||
JSONArray pallet_detail = jsonObject.getJSONArray("pallet_detail");
|
||||
for (Object o : pallet_detail) {
|
||||
JSONObject jO = (JSONObject)JSONObject.toJSON(o);
|
||||
|
||||
Reference in New Issue
Block a user