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