fix
This commit is contained in:
@@ -111,7 +111,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<InstructionDto> queryAll(InstructionQueryParam query){
|
||||
public List<InstructionDto> queryAll(InstructionQueryParam query) {
|
||||
return ConvertUtil.convertList(instructionMapper.selectList(QueryHelpMybatisPlus.getPredicate(query)), InstructionDto.class);
|
||||
}
|
||||
|
||||
@@ -128,7 +128,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int updateById(InstructionDto resources){
|
||||
public int updateById(InstructionDto resources) {
|
||||
InstructionMybatis entity = ConvertUtil.convert(resources, InstructionMybatis.class);
|
||||
int ret = instructionMapper.updateById(entity);
|
||||
// delCaches(resources.id);
|
||||
@@ -137,14 +137,14 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int removeByIds(Set<String> ids){
|
||||
public int removeByIds(Set<String> ids) {
|
||||
// delCaches(ids);
|
||||
return instructionMapper.deleteBatchIds(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int removeById(String id){
|
||||
public int removeById(String id) {
|
||||
Set<String> set = new HashSet<>(1);
|
||||
set.add(id);
|
||||
return this.removeByIds(set);
|
||||
@@ -176,7 +176,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
||||
.eq(InstructionMybatis::getIs_delete, "0")
|
||||
.list();
|
||||
// List list = this.queryAll("instruction_status <2 and is_delete =0");
|
||||
this.instructions = new CopyOnWriteArrayList<>(ConvertUtil.convertList(list,Instruction.class));
|
||||
this.instructions = new CopyOnWriteArrayList<>(ConvertUtil.convertList(list, Instruction.class));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -192,20 +192,20 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
||||
IPage<InstructionMybatis> queryPage = PageUtil.toMybatisPage(page);
|
||||
LambdaQueryWrapper<InstructionMybatis> wrapper = new LambdaQueryWrapper<>();
|
||||
// wrapper.eq(InstructionMybatis::getIs_delete,0);
|
||||
wrapper.and(StringUtils.isNotBlank(code), instructionMybatis -> instructionMybatis.like(InstructionMybatis::getInstruction_code,code).or().like(InstructionMybatis::getTask_code,code));
|
||||
wrapper.like(StringUtils.isNotBlank(vehicle_code),InstructionMybatis::getVehicle_code,vehicle_code);
|
||||
wrapper.eq(StringUtils.isNotBlank(material_type),InstructionMybatis::getMaterial,material_type);
|
||||
wrapper.eq(StringUtils.isNotBlank(status),InstructionMybatis::getInstruction_status,status);
|
||||
wrapper.and(StringUtils.isNotBlank(point_code),instructionMybatis -> instructionMybatis.like(InstructionMybatis::getStart_point_code,point_code).or().like(InstructionMybatis::getNext_point_code,point_code));
|
||||
wrapper.eq(StringUtils.isNotBlank(instruction_type),InstructionMybatis::getInstruction_type,instruction_type);
|
||||
wrapper.and(StringUtils.isNotBlank(code), instructionMybatis -> instructionMybatis.like(InstructionMybatis::getInstruction_code, code).or().like(InstructionMybatis::getTask_code, code));
|
||||
wrapper.like(StringUtils.isNotBlank(vehicle_code), InstructionMybatis::getVehicle_code, vehicle_code);
|
||||
wrapper.eq(StringUtils.isNotBlank(material_type), InstructionMybatis::getMaterial, material_type);
|
||||
wrapper.eq(StringUtils.isNotBlank(status), InstructionMybatis::getInstruction_status, status);
|
||||
wrapper.and(StringUtils.isNotBlank(point_code), instructionMybatis -> instructionMybatis.like(InstructionMybatis::getStart_point_code, point_code).or().like(InstructionMybatis::getNext_point_code, point_code));
|
||||
wrapper.eq(StringUtils.isNotBlank(instruction_type), InstructionMybatis::getInstruction_type, instruction_type);
|
||||
if (!StrUtil.isEmpty(is_over)) {
|
||||
if (StrUtil.equals(is_over,"1")){
|
||||
wrapper.ge(InstructionMybatis::getInstruction_status,2);
|
||||
}else{
|
||||
wrapper.lt(InstructionMybatis::getInstruction_status,2);
|
||||
if (StrUtil.equals(is_over, "1")) {
|
||||
wrapper.ge(InstructionMybatis::getInstruction_status, 2);
|
||||
} else {
|
||||
wrapper.lt(InstructionMybatis::getInstruction_status, 2);
|
||||
}
|
||||
}
|
||||
IPage<InstructionMybatis> insPage = instructionMapper.selectPage(queryPage,wrapper);
|
||||
IPage<InstructionMybatis> insPage = instructionMapper.selectPage(queryPage, wrapper);
|
||||
final JSONObject json = (JSONObject) JSON.toJSON(ConvertUtil.convertPage(insPage, InstructionDto.class));
|
||||
return json;
|
||||
}
|
||||
@@ -224,32 +224,32 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
||||
LambdaQueryWrapper<InstructionMybatis> wrapper = new LambdaQueryWrapper<>();
|
||||
// wrapper.eq(InstructionMybatis::getIs_delete,"0");
|
||||
if (!StrUtil.isEmpty(code)) {
|
||||
wrapper.and(instructionMybatis -> instructionMybatis.like(InstructionMybatis::getInstruction_code,code).or().like(InstructionMybatis::getTask_code,code));
|
||||
wrapper.and(instructionMybatis -> instructionMybatis.like(InstructionMybatis::getInstruction_code, code).or().like(InstructionMybatis::getTask_code, code));
|
||||
}
|
||||
if (!StrUtil.isEmpty(vehicle_code)) {
|
||||
wrapper.like(InstructionMybatis::getVehicle_code,vehicle_code);
|
||||
wrapper.like(InstructionMybatis::getVehicle_code, vehicle_code);
|
||||
}
|
||||
if (!StrUtil.isEmpty(material_type)) {
|
||||
wrapper.eq(InstructionMybatis::getMaterial,material_type);
|
||||
wrapper.eq(InstructionMybatis::getMaterial, material_type);
|
||||
}
|
||||
if (!StrUtil.isEmpty(status)) {
|
||||
wrapper.eq(InstructionMybatis::getInstruction_status,status);
|
||||
wrapper.eq(InstructionMybatis::getInstruction_status, status);
|
||||
}
|
||||
if (!StrUtil.isEmpty(point_code)) {
|
||||
wrapper.and(instructionMybatis -> instructionMybatis.like(InstructionMybatis::getStart_point_code,point_code).or().like(InstructionMybatis::getNext_point_code,point_code));
|
||||
wrapper.and(instructionMybatis -> instructionMybatis.like(InstructionMybatis::getStart_point_code, point_code).or().like(InstructionMybatis::getNext_point_code, point_code));
|
||||
}
|
||||
if (!StrUtil.isEmpty(create_time) && !StrUtil.isEmpty(end_time)) {
|
||||
wrapper.between(InstructionMybatis::getCreate_time,create_time,end_time);
|
||||
wrapper.between(InstructionMybatis::getCreate_time, create_time, end_time);
|
||||
}
|
||||
wrapper.orderByDesc(InstructionMybatis::getCreate_time);
|
||||
IPage<InstructionMybatis> insPage = instructionMapper.selectPage(queryPage,wrapper);
|
||||
IPage<InstructionMybatis> insPage = instructionMapper.selectPage(queryPage, wrapper);
|
||||
final JSONObject json = (JSONObject) JSON.toJSON(ConvertUtil.convertPage(insPage, InstructionDto.class));
|
||||
return json;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getByTaskId(String id) {
|
||||
List<InstructionMybatis> insList= new LambdaQueryChainWrapper<>(instructionMapper)
|
||||
List<InstructionMybatis> insList = new LambdaQueryChainWrapper<>(instructionMapper)
|
||||
.eq(InstructionMybatis::getTask_id, id)
|
||||
.list();
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
@@ -275,9 +275,9 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
||||
|
||||
@Override
|
||||
public List<Instruction> queryAll(Map whereJson) {
|
||||
List<InstructionMybatis> insList= new LambdaQueryChainWrapper<>(instructionMapper)
|
||||
List<InstructionMybatis> insList = new LambdaQueryChainWrapper<>(instructionMapper)
|
||||
.list();
|
||||
return ConvertUtil.convertList(insList,Instruction.class);
|
||||
return ConvertUtil.convertList(insList, Instruction.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -285,10 +285,10 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
||||
// WQLObject wo = WQLObject.getWQLObject("acs_instruction");
|
||||
// JSONArray arr = wo.query(whereJson, "create_time").getResultJSONArray(0);
|
||||
// List<Instruction> list = arr.toJavaList(Instruction.class);
|
||||
List<InstructionMybatis> insList= new LambdaQueryChainWrapper<>(instructionMapper)
|
||||
List<InstructionMybatis> insList = new LambdaQueryChainWrapper<>(instructionMapper)
|
||||
.lt(InstructionMybatis::getInstruction_status, "2")
|
||||
.list();
|
||||
return ConvertUtil.convertList(insList,Instruction.class);
|
||||
return ConvertUtil.convertList(insList, Instruction.class);
|
||||
}
|
||||
|
||||
|
||||
@@ -302,13 +302,13 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
||||
// final Instruction obj = json.toJavaObject(Instruction.class);
|
||||
// return obj;
|
||||
|
||||
InstructionMybatis ins= new LambdaQueryChainWrapper<>(instructionMapper)
|
||||
InstructionMybatis ins = new LambdaQueryChainWrapper<>(instructionMapper)
|
||||
.eq(InstructionMybatis::getInstruction_code, code)
|
||||
.one();
|
||||
if(ObjectUtil.isEmpty(ins)){
|
||||
if (ObjectUtil.isEmpty(ins)) {
|
||||
return null;
|
||||
}
|
||||
return ConvertUtil.convert(ins,Instruction.class);
|
||||
return ConvertUtil.convert(ins, Instruction.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -317,13 +317,13 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
||||
// JSONObject json = wo.query("task_code ='" + code + "'").uniqueResult(0);
|
||||
// final Instruction obj = json.toJavaObject(Instruction.class);
|
||||
// return obj;
|
||||
InstructionMybatis ins= new LambdaQueryChainWrapper<>(instructionMapper)
|
||||
InstructionMybatis ins = new LambdaQueryChainWrapper<>(instructionMapper)
|
||||
.eq(InstructionMybatis::getTask_code, code)
|
||||
.one();
|
||||
if(ObjectUtil.isEmpty(ins)){
|
||||
if (ObjectUtil.isEmpty(ins)) {
|
||||
return null;
|
||||
}
|
||||
return ConvertUtil.convert(ins,Instruction.class);
|
||||
return ConvertUtil.convert(ins, Instruction.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -352,11 +352,11 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
||||
// return null;
|
||||
|
||||
LambdaQueryWrapper<InstructionMybatis> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(InstructionMybatis::getTask_id,id);
|
||||
wrapper.apply(StringUtils.isNotBlank(wherecaluse),wherecaluse);
|
||||
wrapper.eq(InstructionMybatis::getTask_id, id);
|
||||
wrapper.apply(StringUtils.isNotBlank(wherecaluse), wherecaluse);
|
||||
InstructionMybatis ins = instructionMapper.selectOne(wrapper);
|
||||
if (ObjectUtil.isNotEmpty(ins)) {
|
||||
return ConvertUtil.convert(ins,Instruction.class);
|
||||
return ConvertUtil.convert(ins, Instruction.class);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -412,8 +412,8 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
||||
}
|
||||
}
|
||||
|
||||
dto.setCreate_by(ObjectUtil.isNotEmpty(currentUsername)?currentUsername:"admin");
|
||||
dto.setUpdate_by(ObjectUtil.isNotEmpty(currentUsername)?currentUsername:"admin");
|
||||
dto.setCreate_by(ObjectUtil.isNotEmpty(currentUsername) ? currentUsername : "admin");
|
||||
dto.setUpdate_by(ObjectUtil.isNotEmpty(currentUsername) ? currentUsername : "admin");
|
||||
dto.setUpdate_time(now);
|
||||
dto.setCreate_time(now);
|
||||
dto.setStart_parent_code(task.getStart_parent_code());
|
||||
@@ -452,7 +452,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
||||
if (StrUtil.equals(shortPathsList.get(0).getType(), "1")) {
|
||||
NDCAgvService ndcAgvService = SpringContextHolder.getBean(NDCAgvService.class);
|
||||
ndcAgvService.sendAgvInstToNDC(task.getAgv_system_type(), dto);
|
||||
}else if(StrUtil.equals(shortPathsList.get(0).getType(), "2")) {
|
||||
} else if (StrUtil.equals(shortPathsList.get(0).getType(), "2")) {
|
||||
ZheDaAgvService zheDaAgvService = SpringContextHolder.getBean(ZheDaAgvService.class);
|
||||
HttpResponse result = zheDaAgvService.sendAgvInstToAgv(dto);
|
||||
if (!ObjectUtils.isEmpty(result)) {
|
||||
@@ -569,7 +569,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
||||
if (StrUtil.equals(shortPathsList.get(0).getType(), "1")) {
|
||||
NDCAgvService ndcAgvService = SpringContextHolder.getBean(NDCAgvService.class);
|
||||
ndcAgvService.sendAgvInstToNDC(task.getAgv_system_type(), dto);
|
||||
}else if(StrUtil.equals(shortPathsList.get(0).getType(), "2")) {
|
||||
} else if (StrUtil.equals(shortPathsList.get(0).getType(), "2")) {
|
||||
ZheDaAgvService zheDaAgvService = SpringContextHolder.getBean(ZheDaAgvService.class);
|
||||
HttpResponse result = zheDaAgvService.sendAgvInstToAgv(dto);
|
||||
if (!ObjectUtils.isEmpty(result)) {
|
||||
@@ -630,11 +630,11 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
||||
// + dto.getTask_id()
|
||||
// + "'")
|
||||
// .uniqueResult(0);
|
||||
InstructionMybatis ins= new LambdaQueryChainWrapper<>(instructionMapper)
|
||||
InstructionMybatis ins = new LambdaQueryChainWrapper<>(instructionMapper)
|
||||
.lt(InstructionMybatis::getInstruction_status, 3)
|
||||
.eq(InstructionMybatis::getNext_point_code,dto.getNext_point_code())
|
||||
.eq(InstructionMybatis::getStart_point_code,dto.getStart_point_code())
|
||||
.eq(InstructionMybatis::getTask_id,dto.getTask_id())
|
||||
.eq(InstructionMybatis::getNext_point_code, dto.getNext_point_code())
|
||||
.eq(InstructionMybatis::getStart_point_code, dto.getStart_point_code())
|
||||
.eq(InstructionMybatis::getTask_id, dto.getTask_id())
|
||||
.one();
|
||||
|
||||
|
||||
@@ -829,7 +829,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
||||
// TaskDto obj = taskjson.toJavaObject(TaskDto.class);
|
||||
|
||||
Task task = new LambdaQueryChainWrapper<>(taskMapper)
|
||||
.eq(Task::getTask_id,insttaskid)
|
||||
.eq(Task::getTask_id, insttaskid)
|
||||
.one();
|
||||
// =0 则不用再次请求
|
||||
if (StrUtil.equals(task.getRequest_again(), "0")) {
|
||||
@@ -864,7 +864,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
||||
// TaskDto obj = taskjson.toJavaObject(TaskDto.class);
|
||||
|
||||
Task task = new LambdaQueryChainWrapper<>(taskMapper)
|
||||
.eq(Task::getTask_id,insttaskid)
|
||||
.eq(Task::getTask_id, insttaskid)
|
||||
.one();
|
||||
// =0 则不用再次请求
|
||||
if (StrUtil.equals(task.getRequest_again(), "0")) {
|
||||
@@ -918,7 +918,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
||||
// JSONObject taskjson = taskwo.query("task_id ='" + dto.getTask_id() + "'").uniqueResult(0);
|
||||
// TaskDto acsTask = taskjson.toJavaObject(TaskDto.class);
|
||||
Task acsTask = new LambdaQueryChainWrapper<>(taskMapper)
|
||||
.eq(Task::getTask_id,dto.getTask_id())
|
||||
.eq(Task::getTask_id, dto.getTask_id())
|
||||
.one();
|
||||
|
||||
RouteLineService routeLineService = SpringContextHolder.getBean(RouteLineServiceImpl.class);
|
||||
@@ -1021,10 +1021,10 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
||||
// } else {
|
||||
flag = true;
|
||||
// }
|
||||
}else {
|
||||
} else {
|
||||
flag = true;
|
||||
}
|
||||
if (StrUtil.equals(entity.getInstruction_type(), "4")||
|
||||
if (StrUtil.equals(entity.getInstruction_type(), "4") ||
|
||||
StrUtil.equals(entity.getInstruction_type(), "3")) {
|
||||
ZheDaAgvService zheDaAgvService = SpringContextHolder.getBean(ZheDaAgvService.class);
|
||||
zheDaAgvService.deleteZDAgvInst(entity.getInstruction_code());
|
||||
@@ -1142,6 +1142,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
||||
@Override
|
||||
public void cancelNOSendAgv(String id) throws Exception {
|
||||
// flag= true时取消指令
|
||||
boolean flag = false;
|
||||
InstructionDto entity = this.findById(id);
|
||||
if (entity == null) {
|
||||
throw new BadRequestException("被删除或无权限,操作失败!");
|
||||
@@ -1150,16 +1151,14 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
||||
if (StrUtil.isEmpty(entity.getRoute_plan_code())) {
|
||||
entity.setRoute_plan_code(task.getRoute_plan_code());
|
||||
}
|
||||
|
||||
String currentUsername = SecurityUtils.getCurrentUsername();
|
||||
String now = DateUtil.now();
|
||||
entity.setUpdate_time(now);
|
||||
entity.setUpdate_by(currentUsername);
|
||||
entity.setInstruction_status("3");
|
||||
// WQLObject wo = WQLObject.getWQLObject("acs_instruction");
|
||||
// JSONObject json = (JSONObject) JSONObject.toJSON(entity);
|
||||
// wo.update(json);
|
||||
|
||||
// WQLObject wo = WQLObject.getWQLObject("acs_instruction");
|
||||
// JSONObject json = (JSONObject) JSONObject.toJSON(entity);
|
||||
// wo.update(json);
|
||||
InstructionMybatis ins = ConvertUtil.convert(entity, InstructionMybatis.class);
|
||||
instructionMapper.updateById(ins);
|
||||
DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class);
|
||||
@@ -1195,8 +1194,8 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
||||
log.debug("地址对应设备未找到");
|
||||
return;
|
||||
}
|
||||
|
||||
removeByCodeFromCache(entity.getInstruction_code());
|
||||
taskService.cancel(entity.getTask_id());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1533,7 +1532,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
||||
|
||||
@Override
|
||||
public void init(String id) {
|
||||
InstructionDto inst = this.findById(id);
|
||||
InstructionDto inst = this.findById(id);
|
||||
if (inst == null) {
|
||||
throw new BadRequestException("指令不存在或已删除");
|
||||
}
|
||||
|
||||
@@ -84,6 +84,11 @@ public class GHCMLTask extends AbstractTask {
|
||||
param.put("vehicle_code", point.getVehicle_code());
|
||||
param.put("vehicle_type", point.getVehicle_type());
|
||||
param.put("create_mode", GeneralDefinition.AUTO_CREATION);
|
||||
SchBaseVehiclematerialgroup groupInfo = vehiclematerialgroupService.getVehicleGroupInfo(
|
||||
point.getVehicle_code(),
|
||||
point.getVehicle_type(),
|
||||
GroupBindMaterialStatusEnum.BOUND.getValue());
|
||||
param.put("material_id", groupInfo.getMaterial_id());
|
||||
task.apply(param);
|
||||
});
|
||||
}
|
||||
@@ -103,7 +108,7 @@ public class GHCMLTask extends AbstractTask {
|
||||
// 找终点
|
||||
String requestParam = task.getRequest_param();
|
||||
JSONObject jsonObject = JSONObject.parseObject(requestParam);
|
||||
jsonObject.put("material_id", ObjectUtil.isNotEmpty(groupInfo)?groupInfo.getMaterial_id():null);
|
||||
jsonObject.put("material_id", ObjectUtil.isNotEmpty(groupInfo) ? groupInfo.getMaterial_id() : null);
|
||||
SchBasePoint point = findNextPoint(nextRegionStr, jsonObject);
|
||||
if (ObjectUtil.isEmpty(point)) {
|
||||
throw new BadRequestException("涂板线[" + task.getPoint_code1() + "]未找到所需点位!");
|
||||
@@ -111,6 +116,7 @@ public class GHCMLTask extends AbstractTask {
|
||||
// 设置组盘 - 需要的话由子类自行实现
|
||||
task.setGroup_id(setGroupPlate(jsonObject));
|
||||
// 设置等待点并修改创建成功状态
|
||||
// task.setNext_wait_point(point.getPoint_code());
|
||||
task.setPoint_code2(point.getPoint_code());
|
||||
task.setTask_status(TaskStatus.CREATED.getCode());
|
||||
task.setRemark("");
|
||||
@@ -120,10 +126,15 @@ public class GHCMLTask extends AbstractTask {
|
||||
PointUtils.setUpdateByAcs(point);
|
||||
pointService.updateById(point);
|
||||
|
||||
//任务创建后锁住起点
|
||||
startPoint.setIng_task_code(task.getTask_code());
|
||||
pointService.updateById(startPoint);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 寻找终点等待点
|
||||
*
|
||||
* @param nextRegionStr: 只有一个区域
|
||||
* @param jsonObject
|
||||
* @return
|
||||
@@ -136,10 +147,11 @@ public class GHCMLTask extends AbstractTask {
|
||||
, jsonObject.getString("material_id"));
|
||||
if (ObjectUtil.isNotEmpty(sameMaterialPoints)) {
|
||||
// 找到相同物料。分配等待点。
|
||||
SchBasePoint point = pointService.getOne(new LambdaQueryWrapper<SchBasePoint>()
|
||||
SchBasePoint point = pointService.getOne(new LambdaQueryWrapper<SchBasePoint>()
|
||||
.in(SchBasePoint::getRegion_code, nextRegionStr)
|
||||
.eq(SchBasePoint::getRow_num, sameMaterialPoints.getRow_num())
|
||||
.eq(SchBasePoint::getIs_used, true)
|
||||
.eq(SchBasePoint::getPoint_status, PointStatusEnum.EMPTY_POINT.getCode())
|
||||
.orderByAsc(SchBasePoint::getCol_num), false);
|
||||
if (ObjectUtil.isNotEmpty(point)) {
|
||||
return point;
|
||||
@@ -237,6 +249,14 @@ public class GHCMLTask extends AbstractTask {
|
||||
|
||||
public void cancelTask(SchBaseTask taskObj, TaskFinishedTypeEnum taskFinishedType) {
|
||||
// 获取参数
|
||||
String startPoint = taskObj.getPoint_code1();
|
||||
SchBasePoint startPointObj = pointService.getById(startPoint);
|
||||
// 起点点解锁
|
||||
if (ObjectUtil.isNotEmpty(startPointObj)) {
|
||||
startPointObj.setIng_task_code("");
|
||||
PointUtils.setUpdateByType(startPointObj, taskFinishedType);
|
||||
pointService.updateById(startPointObj);
|
||||
}
|
||||
String endPoint = taskObj.getPoint_code2();
|
||||
SchBasePoint endPointObj = pointService.getById(endPoint);
|
||||
// 终点解锁
|
||||
@@ -269,6 +289,7 @@ public class GHCMLTask extends AbstractTask {
|
||||
|
||||
/**
|
||||
* 二次申请
|
||||
*
|
||||
* @param task_id: 任务标识
|
||||
* @return
|
||||
*/
|
||||
|
||||
@@ -97,9 +97,11 @@ public class GHCQLTask extends AbstractTask {
|
||||
SchBasePoint point = findStartPoint(startRegionStr, extGroupData);
|
||||
if (ObjectUtil.isEmpty(point)) {
|
||||
// 消息通知
|
||||
noticeService.createNotice("固化室没有所需物料!", TASK_CONFIG_CODE + task.getPoint_code2(),
|
||||
noticeService.createNotice("固化室没有所需物料,将该固化室改为无货状态!", TASK_CONFIG_CODE + task.getPoint_code2(),
|
||||
NoticeTypeEnum.WARN.getCode());
|
||||
throw new BadRequestException("固化室没有所需物料!");
|
||||
SchBasePoint schBasePoint=pointService.getById(task.getPoint_code2().substring(0, task.getPoint_code2().length() - 1));
|
||||
schBasePoint.setPoint_status(PointStatusEnum.EMPTY_POINT.getCode());
|
||||
pointService.update(schBasePoint);
|
||||
}
|
||||
// 设置起点并修改创建成功状态
|
||||
task.setPoint_code1(point.getPoint_code());
|
||||
|
||||
@@ -17,82 +17,30 @@
|
||||
p.*
|
||||
FROM
|
||||
`sch_base_point` p
|
||||
WHERE p.region_code = 'GH' AND p.point_type = '3' AND p.point_status = '2'
|
||||
WHERE p.region_code = 'GH' AND p.point_type = '3' AND p.point_status = '2' and (p.ing_task_code = '' OR p.ing_task_code IS NULL)
|
||||
ORDER BY p.row_num, p.col_num
|
||||
</select>
|
||||
<select id="getZCSameMaterialPoint" resultType="org.nl.wms.sch.point.service.dao.SchBasePoint">
|
||||
SELECT p.*
|
||||
FROM `sch_base_point` p
|
||||
LEFT JOIN sch_base_vehiclematerialgroup vg ON p.vehicle_code = vg.vehicle_code
|
||||
AND p.vehicle_type = vg.vehicle_type AND vg.group_bind_material_status = '2'
|
||||
WHERE p.region_code = #{regionCode}
|
||||
AND p.point_status = '2'
|
||||
AND vg.material_id = #{materialId}
|
||||
AND p.col_num >
|
||||
(SELECT MIN(p2.col_num)
|
||||
FROM sch_base_point p2
|
||||
WHERE p2.region_code = #{regionCode}
|
||||
AND p2.row_num = p.row_num
|
||||
AND p2.is_used = TRUE)
|
||||
AND (SELECT COUNT(*)
|
||||
FROM sch_base_point p3
|
||||
WHERE p3.col_num <![CDATA[ < ]]> p.col_num
|
||||
AND p3.region_code = #{regionCode}
|
||||
AND p3.is_used = TRUE
|
||||
AND p3.row_num = p.row_num
|
||||
AND p3.point_status = '1') <![CDATA[ > ]]>
|
||||
(SELECT COUNT(*)
|
||||
FROM sch_base_task t
|
||||
WHERE t.next_wait_point = (SELECT p4.point_code
|
||||
FROM sch_base_point p4
|
||||
WHERE p4.region_code = #{regionCode}
|
||||
AND p4.is_used = TRUE
|
||||
AND p4.row_num = p.row_num
|
||||
ORDER BY p4.col_num
|
||||
LIMIT 1
|
||||
)
|
||||
AND t.task_status IN ('1'
|
||||
, '2'
|
||||
, '3'
|
||||
, '4'))
|
||||
ORDER BY p.row_num, p.out_order_seq
|
||||
LIMIT 1
|
||||
FROM sch_base_point p
|
||||
LEFT JOIN sch_base_vehiclematerialgroup vg
|
||||
ON p.vehicle_code = vg.vehicle_code
|
||||
AND p.vehicle_type = vg.vehicle_type
|
||||
AND vg.group_bind_material_status = '2'
|
||||
WHERE p.region_code = 'ZC'
|
||||
AND p.point_status = '1'
|
||||
AND p.is_used = TRUE
|
||||
ORDER BY p.row_num, p.col_num
|
||||
LIMIT 1;
|
||||
</select>
|
||||
<select id="getZCEmptyMaterialPoint" resultType="org.nl.wms.sch.point.service.dao.SchBasePoint">
|
||||
SELECT p.*
|
||||
FROM `sch_base_point` p
|
||||
WHERE p.region_code = #{regionCode}
|
||||
FROM sch_base_point p
|
||||
WHERE p.region_code = 'ZC'
|
||||
AND p.point_status = '1'
|
||||
AND p.is_used = TRUE
|
||||
AND (p.ing_task_code = '' OR p.ing_task_code IS NULL)
|
||||
AND 0 = (SELECT COUNT(*)
|
||||
FROM sch_base_point p1
|
||||
WHERE p1.region_code = #{regionCode}
|
||||
AND p1.is_used = TRUE
|
||||
AND p1.row_num = p.row_num
|
||||
AND (p1.point_status = '2' AND p1.ing_task_code IS NOT NULL AND p1.ing_task_code <![CDATA[ <> ]]> ''))
|
||||
AND p.col_num = (SELECT MIN(p2.col_num)
|
||||
FROM sch_base_point p2
|
||||
WHERE p2.region_code = #{regionCode}
|
||||
AND p2.is_used = TRUE
|
||||
AND p2.row_num = p.row_num)
|
||||
AND (SELECT COUNT(*)
|
||||
FROM sch_base_point p3
|
||||
WHERE p3.region_code = #{regionCode} AND p3.row_num = p.row_num AND p3.is_used)
|
||||
<![CDATA[ > ]]> (SELECT COUNT(*)
|
||||
FROM sch_base_task t
|
||||
WHERE t.next_wait_point = p.point_code AND t.task_status IN ('1', '2', '3', '4'))
|
||||
AND (
|
||||
0 = (SELECT COUNT(*)
|
||||
FROM sch_base_task t
|
||||
WHERE t.next_wait_point = p.point_code AND t.task_status IN ('1', '2', '3', '4'))
|
||||
OR
|
||||
#{materialId} IN (SELECT vg.material_id
|
||||
FROM sch_base_task t
|
||||
LEFT JOIN sch_base_vehiclematerialgroup vg ON vg.vehicle_code = t.vehicle_code AND vg.vehicle_type = t.vehicle_type
|
||||
AND vg.group_bind_material_status = '2'
|
||||
WHERE t.next_wait_point = p.point_code AND t.task_status IN ('1', '2', '3', '4'))
|
||||
)
|
||||
ORDER BY p.row_num, p.out_order_seq
|
||||
LIMIT 1
|
||||
AND p.point_code like '%01-01%'
|
||||
ORDER BY p.row_num, p.col_num
|
||||
LIMIT 1;
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -54,7 +54,7 @@ spring:
|
||||
multi-statement-allow: true
|
||||
redis:
|
||||
#数据库索引
|
||||
database: ${REDIS_DB:2}
|
||||
database: ${REDIS_DB:5}
|
||||
host: ${REDIS_HOST:10.44.101.19}
|
||||
port: ${REDIS_PORT:6379}
|
||||
password: ${REDIS_PWD:}
|
||||
@@ -152,7 +152,7 @@ sa-token:
|
||||
token-session-check-login: false
|
||||
alone-redis:
|
||||
# Redis数据库索引(默认为0)
|
||||
database: 2
|
||||
database: 5
|
||||
# Redis服务器地址
|
||||
host: 10.44.101.19
|
||||
# Redis服务器连接端口
|
||||
|
||||
Reference in New Issue
Block a user