opt:优化点位及任务相关查询,操作
This commit is contained in:
@@ -77,6 +77,12 @@ public enum StatusEnum {
|
||||
|
||||
SORT_TYPE(ForkMap.of(
|
||||
"升序", "1", null, "降序", "2", null
|
||||
)),
|
||||
POINT_TYPE(ForkMap.of(
|
||||
"空货架", "0", null, "满货架", "1", null
|
||||
)),
|
||||
BIND_TYPE(ForkMap.of(
|
||||
"解绑", "0", null, "绑定", "1", null
|
||||
));
|
||||
/**
|
||||
* L:label
|
||||
|
||||
@@ -60,8 +60,8 @@ public class InterationUtil {
|
||||
}
|
||||
return response.toJavaObject(TableDataInfo.class);
|
||||
} catch (Exception ex) {
|
||||
log.info("ACS反馈异常----------------------------------------+"+api+",---"+ex.getMessage());
|
||||
throw new BadRequestException("acs网络不通:"+ex.getMessage());
|
||||
log.error("ACS反馈异常----------------------------------------+"+api+",---"+ex.getMessage());
|
||||
throw new BadRequestException("ACS反馈异常:"+ex.getMessage());
|
||||
}
|
||||
}
|
||||
public static TableDataInfo asyncNotifyExt(String api, JSONObject param) {
|
||||
|
||||
@@ -5,6 +5,7 @@ import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.nl.common.TableDataInfo;
|
||||
@@ -45,7 +46,7 @@ public class SchBasePointController {
|
||||
|
||||
@GetMapping
|
||||
public ResponseEntity<Object> query(SchBasePointQuery whereJson, PageQuery page) {
|
||||
return new ResponseEntity<>(TableDataInfo.build(pointService.page(page.build(SchBasePoint.class), whereJson.build())), HttpStatus.OK);
|
||||
return new ResponseEntity<>(TableDataInfo.build(pointService.queryAll(whereJson, page)), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@@ -61,9 +62,23 @@ public class SchBasePointController {
|
||||
@PutMapping
|
||||
@Log("更新点位")
|
||||
public ResponseEntity<Object> update(@Validated @RequestBody SchBasePoint entity) {
|
||||
entity.setUpdate_name(SecurityUtils.getCurrentNickName());
|
||||
entity.setUpdate_time(DateUtil.now());
|
||||
pointService.updateById(entity);
|
||||
LambdaUpdateWrapper<SchBasePoint> lambdaUpdateWrapper = new LambdaUpdateWrapper<>();
|
||||
//绑定或解绑
|
||||
if (entity.getVehicle_code() != null) {
|
||||
TableDataInfo result = pointService.bindOrUnbind(entity.getCode(), entity.getVehicle_code(), (entity.getPriority()));
|
||||
if (!"200".equals(result.getCode())) {
|
||||
throw new BadRequestException( "地面站点:" + entity.getCode() + "绑定或解绑" + entity.getVehicle_code() + "指令下发CTU,返回操作失败,失败原因:" +result.getMsg());
|
||||
}
|
||||
}
|
||||
lambdaUpdateWrapper.set(SchBasePoint::getProduct_area, entity.getProduct_area());
|
||||
lambdaUpdateWrapper.set(SchBasePoint::getRegion_code, entity.getRegion_code());
|
||||
lambdaUpdateWrapper.set(SchBasePoint::getPoint_type, entity.getPoint_type());
|
||||
lambdaUpdateWrapper.set(SchBasePoint::getLock_type, entity.getLock_type());
|
||||
lambdaUpdateWrapper.set(SchBasePoint::getIs_used, entity.getIs_used());
|
||||
lambdaUpdateWrapper.set(SchBasePoint::getUpdate_name, SecurityUtils.getCurrentNickName());
|
||||
lambdaUpdateWrapper.set(SchBasePoint::getUpdate_time, DateUtil.now());
|
||||
lambdaUpdateWrapper.eq(SchBasePoint::getId, entity.getId());
|
||||
pointService.update(lambdaUpdateWrapper);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,13 @@
|
||||
package org.nl.wms.dispatch_manage.point.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.common.TableDataInfo;
|
||||
import org.nl.common.domain.entity.PageQuery;
|
||||
import org.nl.wms.dispatch_manage.point.service.dao.SchBasePoint;
|
||||
import org.nl.wms.dispatch_manage.point.service.dto.SchBasePointQuery;
|
||||
import org.nl.wms.dispatch_manage.task.service.dao.SchBaseTask;
|
||||
import org.nl.wms.dispatch_manage.task.service.dto.SchBaseTaskQuery;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -15,13 +21,23 @@ import java.util.List;
|
||||
*/
|
||||
public interface ISchBasePointService extends IService<SchBasePoint> {
|
||||
|
||||
|
||||
/**
|
||||
* 查询数据分页
|
||||
*
|
||||
* @param whereJson 条件
|
||||
* @param pageable 分页参数
|
||||
* @return IPage<SchBaseTask>
|
||||
*/
|
||||
IPage<SchBasePoint> queryAll(SchBasePointQuery whereJson, PageQuery pageable);
|
||||
|
||||
/**
|
||||
* 二楼货架与地面站点绑定或解绑
|
||||
* @param siteCode 点位
|
||||
* @param shelfCode 货架编号
|
||||
* @param mode 0解绑1绑定
|
||||
*/
|
||||
void bindOrUnbind(String siteCode,String shelfCode,String mode);
|
||||
TableDataInfo bindOrUnbind(String siteCode, String shelfCode, String mode);
|
||||
|
||||
|
||||
/**
|
||||
@@ -32,9 +48,10 @@ public interface ISchBasePointService extends IService<SchBasePoint> {
|
||||
* @param sortType 点位排序规则1:升序2:降序
|
||||
* @param pointType 0空载具1满载具
|
||||
* @param pointCode 点位编码
|
||||
* @param vehicleIsNull 载具是否为空
|
||||
* @return List<SchBasePoint>
|
||||
*/
|
||||
List<SchBasePoint> checkEndPointTask(String regionCode, String getLockType, String sortType, String
|
||||
pointType, String pointCode);
|
||||
pointType, String pointCode, String vehicleIsNull);
|
||||
|
||||
}
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
package org.nl.wms.dispatch_manage.point.service.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 点位基础表
|
||||
@@ -100,6 +101,9 @@ public class SchBasePoint implements Serializable {
|
||||
*/
|
||||
private String form_data;
|
||||
|
||||
/**
|
||||
* 是否解绑
|
||||
*/
|
||||
private String priority;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
package org.nl.wms.dispatch_manage.point.service.dao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.nl.wms.dispatch_manage.point.service.dao.SchBasePoint;
|
||||
import org.nl.wms.dispatch_manage.point.service.dto.SchBasePointQuery;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -12,5 +15,6 @@ import org.nl.wms.dispatch_manage.point.service.dao.SchBasePoint;
|
||||
* @since 2024-06-12
|
||||
*/
|
||||
public interface SchBasePointMapper extends BaseMapper<SchBasePoint> {
|
||||
IPage<SchBasePoint> selectPointPage(IPage<SchBasePoint> pages, @Param("whereJson") SchBasePointQuery whereJson);
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,28 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.nl.wms.dispatch_manage.point.service.dao.mapper.SchBasePointMapper">
|
||||
|
||||
<select id="selectPointPage" resultType="org.nl.wms.dispatch_manage.point.service.dao.SchBasePoint">
|
||||
SELECT
|
||||
t.*
|
||||
FROM
|
||||
`sch_base_point` t
|
||||
<where>
|
||||
<if test="whereJson.product_area != null">
|
||||
AND t.product_area = #{whereJson.product_area}
|
||||
</if>
|
||||
<if test="whereJson.search != null">
|
||||
AND t.code LIKE '%${whereJson.search}%'
|
||||
</if>
|
||||
<if test="whereJson.region_code != null">
|
||||
AND t.region_code = #{whereJson.region_code}
|
||||
</if>
|
||||
<if test="whereJson.point_type != null">
|
||||
AND t.point_type = #{whereJson.point_type}
|
||||
</if>
|
||||
<if test="whereJson.lock_type != null">
|
||||
AND t.lock_type = #{whereJson.lock_type}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY t.create_time
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -13,6 +13,10 @@ import org.nl.wms.dispatch_manage.point.service.dao.SchBasePoint;
|
||||
@Data
|
||||
public class SchBasePointQuery extends BaseQuery<SchBasePoint> {
|
||||
private String search;
|
||||
private String product_area;
|
||||
private String region_code;
|
||||
private String point_type;
|
||||
private String lock_type;
|
||||
|
||||
@Override
|
||||
public void paramMapping() {
|
||||
|
||||
@@ -1,27 +1,33 @@
|
||||
package org.nl.wms.dispatch_manage.point.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.nl.common.TableDataInfo;
|
||||
import org.nl.common.domain.entity.PageQuery;
|
||||
import org.nl.common.domain.exception.BadRequestException;
|
||||
import org.nl.common.enums.StatusEnum;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.wms.dispatch_manage.point.service.ISchBasePointService;
|
||||
import org.nl.wms.dispatch_manage.point.service.dao.SchBasePoint;
|
||||
import org.nl.wms.dispatch_manage.point.service.dao.mapper.SchBasePointMapper;
|
||||
import org.nl.wms.dispatch_manage.point.service.dto.SchBasePointQuery;
|
||||
import org.nl.wms.dispatch_manage.task.service.ISchBaseTaskService;
|
||||
import org.nl.wms.dispatch_manage.task.service.dao.SchBaseTask;
|
||||
import org.nl.wms.external_system.acs.service.WmsToAcsService;
|
||||
import org.nl.wms.stor_manage.struct.service.IStIvtStructattrService;
|
||||
import org.nl.wms.stor_manage.struct.service.dao.StIvtStructattr;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -46,6 +52,15 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
|
||||
private IStIvtStructattrService iStIvtStructattrService;
|
||||
|
||||
|
||||
@Override
|
||||
public IPage<SchBasePoint> queryAll(SchBasePointQuery whereJson, PageQuery page) {
|
||||
page.setSize(20);
|
||||
IPage<SchBasePoint> pages = new Page<>(page.getPage() + 1, page.getSize());
|
||||
pages = this.baseMapper.selectPointPage(pages, whereJson);
|
||||
return pages;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 二楼货架与地面站点绑定或解绑
|
||||
*
|
||||
@@ -55,19 +70,19 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void bindOrUnbind(String siteCode, String shelfCode, String mode) {
|
||||
public TableDataInfo bindOrUnbind(String siteCode, String shelfCode, String mode) {
|
||||
List<SchBasePoint> pointList = this.list(new LambdaQueryWrapper<SchBasePoint>().eq(SchBasePoint::getCode, siteCode).eq(SchBasePoint::getIs_used, true));
|
||||
if (ObjectUtils.isEmpty(pointList)) {
|
||||
throw new BadRequestException("输入的站点编号有误或被禁用,请检查!");
|
||||
}
|
||||
//检查是否为空架
|
||||
List<StIvtStructattr> stIvtStructattrList = iStIvtStructattrService.list(new LambdaQueryWrapper<StIvtStructattr>()
|
||||
.eq(StIvtStructattr::getIs_used, true)
|
||||
.eq(StIvtStructattr::getSect_code, shelfCode));
|
||||
List<StIvtStructattr> notEmptyList = stIvtStructattrList.stream().filter(r -> StringUtils.isNotBlank(r.getVehicle_code())).collect(Collectors.toList());
|
||||
if (ObjectUtils.isNotEmpty(notEmptyList)) {
|
||||
throw new BadRequestException("该货架的货位:" + notEmptyList.get(0).getStruct_code() + ",存在未出库的料箱:" + notEmptyList.get(0).getVehicle_code() + ",请检查!");
|
||||
}
|
||||
// List<StIvtStructattr> stIvtStructattrList = iStIvtStructattrService.list(new LambdaQueryWrapper<StIvtStructattr>()
|
||||
// .eq(StIvtStructattr::getIs_used, true)
|
||||
// .eq(StIvtStructattr::getSect_code, shelfCode));
|
||||
// List<StIvtStructattr> notEmptyList = stIvtStructattrList.stream().filter(r -> StringUtils.isNotBlank(r.getVehicle_code())).collect(Collectors.toList());
|
||||
// if (ObjectUtils.isNotEmpty(notEmptyList)) {
|
||||
// throw new BadRequestException("该货架的货位:" + notEmptyList.get(0).getStruct_code() + ",存在未出库的料箱:" + notEmptyList.get(0).getVehicle_code() + ",请检查!");
|
||||
// }
|
||||
List<SchBasePoint> shelfCodePointList = this.list(new LambdaQueryWrapper<SchBasePoint>().eq(SchBasePoint::getVehicle_code, shelfCode));
|
||||
LambdaUpdateWrapper<SchBasePoint> wrapper = new LambdaUpdateWrapper<SchBasePoint>()
|
||||
.eq(SchBasePoint::getCode, siteCode);
|
||||
@@ -103,22 +118,23 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
|
||||
.set(SchBasePoint::getUpdate_name, SecurityUtils.getCurrentNickName());
|
||||
this.update(wrapper);
|
||||
//绑定状态同步至ACS
|
||||
wmsToAcsService.bindPodAndBerth(shelfCode,siteCode,mode, "bindPodAndBerth");
|
||||
return wmsToAcsService.bindPodAndBerth(shelfCode, siteCode, mode, "bindPodAndBerth");
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询没有搬运任务的空的目标点位
|
||||
*
|
||||
* @param regionCode 点位类型
|
||||
* @param getLockType 锁定状态
|
||||
* @param sortType 点位排序规则1:升序2:降序
|
||||
* @param pointType 0空载具1满载具
|
||||
* @param pointCode 点位编码
|
||||
* @param regionCode 点位类型
|
||||
* @param getLockType 锁定状态
|
||||
* @param sortType 点位排序规则1:升序2:降序
|
||||
* @param pointType 0空载具1满载具
|
||||
* @param pointCode 点位编码
|
||||
* @param vehicleIsNull 载具是否为空
|
||||
* @return List<SchBasePoint>
|
||||
*/
|
||||
@Override
|
||||
public List<SchBasePoint> checkEndPointTask(String regionCode, String getLockType, String sortType, String
|
||||
pointType, String pointCode) {
|
||||
pointType, String pointCode, String vehicleIsNull) {
|
||||
Set<String> pointSets;
|
||||
List<SchBaseTask> taskList;
|
||||
List<SchBasePoint> returList = new ArrayList<>();
|
||||
@@ -135,6 +151,14 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
|
||||
if (StringUtils.isNotEmpty(pointType)) {
|
||||
queryWrapper.eq(SchBasePoint::getPoint_type, pointType);
|
||||
}
|
||||
if (StringUtils.isNotEmpty(vehicleIsNull)) {
|
||||
boolean isNull = Boolean.parseBoolean(vehicleIsNull);
|
||||
if (isNull) {
|
||||
queryWrapper.isNull(SchBasePoint::getVehicle_code);
|
||||
} else {
|
||||
queryWrapper.isNotNull(SchBasePoint::getVehicle_code);
|
||||
}
|
||||
}
|
||||
if (StatusEnum.SORT_TYPE.code("升序").equals(sortType)) {
|
||||
queryWrapper.orderByAsc(SchBasePoint::getCode);
|
||||
} else if (StatusEnum.SORT_TYPE.code("降序").equals(sortType)) {
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.TableDataInfo;
|
||||
import org.nl.common.domain.exception.BadRequestException;
|
||||
import org.nl.common.enums.StatusEnum;
|
||||
import org.nl.common.utils.CodeUtil;
|
||||
@@ -16,6 +17,7 @@ import org.nl.wms.dispatch_manage.point.service.dao.SchBasePoint;
|
||||
import org.nl.wms.dispatch_manage.task.handler.AbstractTask;
|
||||
import org.nl.wms.dispatch_manage.task.service.ISchBaseTaskService;
|
||||
import org.nl.wms.dispatch_manage.task.service.dao.SchBaseTask;
|
||||
import org.nl.wms.external_system.acs.service.WmsToAcsService;
|
||||
import org.nl.wms.md_manage.vehicleMater.service.IMdPbVehicleMaterService;
|
||||
import org.nl.wms.md_manage.vehicleMater.service.dao.MdPbVehicleMater;
|
||||
import org.nl.wms.stor_manage.record.service.IStIvtStructivtflowService;
|
||||
@@ -32,7 +34,8 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
@Service("secondFloorAgvTransfer")
|
||||
@Slf4j
|
||||
public class SecondFloorAgvTransferTask extends AbstractTask {
|
||||
|
||||
@Autowired
|
||||
private WmsToAcsService wmsToAcsService;
|
||||
@Autowired
|
||||
private IStIvtStructivtflowService structIvtFlowService;
|
||||
@Autowired
|
||||
@@ -80,11 +83,19 @@ public class SecondFloorAgvTransferTask extends AbstractTask {
|
||||
data.put("status", StatusEnum.FORM_STATUS.code("完成"));
|
||||
this.updateTask(data);
|
||||
SchBaseTask schBaseTask = iSchBaseTaskService.getOne(new QueryWrapper<SchBaseTask>().eq("task_code", data.getString("task_code")));
|
||||
//货架解绑
|
||||
TableDataInfo tableDataInfo = wmsToAcsService.bindPodAndBerth(schBaseTask.getPoint_code3(), schBaseTask.getPoint_code1(), "0", "bindPodAndBerth");
|
||||
String bindResult = "200".equals(tableDataInfo.getCode()) ? "地面站点:" + schBaseTask.getPoint_code1() + "解绑" + schBaseTask.getPoint_code3() + "指令下发CTU,返回解绑成功!" :
|
||||
"地面站点:" + schBaseTask.getPoint_code1() + "解绑" + schBaseTask.getPoint_code3() + "指令下发CTU,返回解绑失败,请操作站点解绑,失败原因:" + tableDataInfo.getMsg();
|
||||
iSchBaseTaskService.update(new LambdaUpdateWrapper<SchBaseTask>()
|
||||
.set(SchBaseTask::getRemark, bindResult)
|
||||
.eq(SchBaseTask::getId, schBaseTask.getId()));
|
||||
//起点位解锁
|
||||
iSchBasePointService.update(new LambdaUpdateWrapper<SchBasePoint>()
|
||||
.set(SchBasePoint::getLock_type, StatusEnum.LOCK.code("无锁"))
|
||||
.set(SchBasePoint::getVehicle_code, null)
|
||||
.set(SchBasePoint::getUpdate_time, DateUtil.now())
|
||||
.set(SchBasePoint::getRemark, bindResult)
|
||||
.set(SchBasePoint::getUpdate_name, SecurityUtils.getCurrentNickName())
|
||||
.eq(SchBasePoint::getCode, schBaseTask.getPoint_code1()));
|
||||
//终点点位绑定货架,Point_type为满架
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.TableDataInfo;
|
||||
import org.nl.common.domain.exception.BadRequestException;
|
||||
import org.nl.common.enums.StatusEnum;
|
||||
import org.nl.common.utils.CodeUtil;
|
||||
@@ -85,7 +86,12 @@ public class SecondFloorEmptyShelfTask extends AbstractTask {
|
||||
.set(SchBasePoint::getUpdate_name, SecurityUtils.getCurrentNickName())
|
||||
.eq(SchBasePoint::getCode, schBaseTask.getPoint_code1()));
|
||||
//货架绑定
|
||||
iSchBasePointService.bindOrUnbind(schBaseTask.getPoint_code2(), schBaseTask.getVehicle_code(), "1");
|
||||
TableDataInfo tableDataInfo = iSchBasePointService.bindOrUnbind(schBaseTask.getPoint_code2(), schBaseTask.getVehicle_code(), "1");
|
||||
String bindResult = "200".equals(tableDataInfo.getCode()) ? "地面站点:" + schBaseTask.getPoint_code2() + "解绑" + schBaseTask.getVehicle_code() + "指令下发CTU,返回解绑成功!" :
|
||||
"地面站点:" + schBaseTask.getPoint_code2() + "解绑" + schBaseTask.getVehicle_code() + "指令下发CTU,返回解绑失败,请操作站点绑定,失败原因:" + tableDataInfo.getMsg();
|
||||
iSchBaseTaskService.update(new LambdaUpdateWrapper<SchBaseTask>()
|
||||
.set(SchBaseTask::getRemark, bindResult)
|
||||
.eq(SchBaseTask::getId, schBaseTask.getId()));
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ import java.util.Set;
|
||||
* @since 2024-05-06
|
||||
*/
|
||||
public interface SchBaseTaskMapper extends BaseMapper<SchBaseTask> {
|
||||
IPage<SchBaseTask> selectPageLeftJoin(IPage<SchBaseTask> pages, @Param("whereJson") SchBaseTaskQuery whereJson, @Param("collect") List<String> collect);
|
||||
IPage<SchBaseTask> selectPageLeftJoin(IPage<SchBaseTask> pages, @Param("whereJson") SchBaseTaskQuery whereJson, @Param("collect") List<String> collect, @Param("taskTypes") List<String> taskTypes);
|
||||
|
||||
List<Map> getByVehicle(@Param("vehicles") List<String> vehicles);
|
||||
|
||||
|
||||
@@ -38,6 +38,12 @@
|
||||
#{code}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="taskTypes != null and taskTypes != ''">
|
||||
AND t.task_type IN
|
||||
<foreach collection="taskTypes" item="code" separator="," open="(" close=")">
|
||||
#{code}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY t.create_time DESC
|
||||
</select>
|
||||
|
||||
@@ -12,6 +12,7 @@ import java.io.Serializable;
|
||||
public class SchBaseTaskQuery implements Serializable {
|
||||
private String task_id;
|
||||
private String task_code;
|
||||
private String task_type;
|
||||
private String vehicle_code;
|
||||
private String point_code;
|
||||
private String start_time;
|
||||
|
||||
@@ -82,8 +82,15 @@ public class SchBaseTaskServiceImpl extends ServiceImpl<SchBaseTaskMapper, SchBa
|
||||
whereJson.setUnFinished(StatusEnum.FORM_STATUS.code("执行中"));
|
||||
}
|
||||
}
|
||||
List<String> taskTypes = ObjectUtil.isNotEmpty(whereJson.getTask_type())
|
||||
? Arrays.stream(whereJson.getTask_type().split(",")).collect(Collectors.toList()) : null;
|
||||
if (taskTypes != null) {
|
||||
if (taskTypes.contains("")) {
|
||||
taskTypes = null;
|
||||
}
|
||||
}
|
||||
IPage<SchBaseTask> pages = new Page<>(page.getPage() + 1, page.getSize());
|
||||
pages = this.baseMapper.selectPageLeftJoin(pages, whereJson, collect);
|
||||
pages = this.baseMapper.selectPageLeftJoin(pages, whereJson, collect,taskTypes);
|
||||
return pages;
|
||||
}
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@ public class ApplyShelfScheduleService {
|
||||
List<SchBasePoint> cxPointLists = iSchBasePointService.checkEndPointTask(
|
||||
StatusEnum.REGION_INFO.code("二楼AGV产线对接位"),
|
||||
StatusEnum.LOCK.code("无锁"),
|
||||
StatusEnum.SORT_TYPE.code("升序"), "0", null);
|
||||
StatusEnum.SORT_TYPE.code("升序"), "0", null,"false");
|
||||
if (ObjectUtils.isNotEmpty(cxPointLists)) {
|
||||
startPointCode = cxPointLists.get(0).getCode();
|
||||
vehicleCode = cxPointLists.get(0).getVehicle_code();
|
||||
@@ -87,7 +87,7 @@ public class ApplyShelfScheduleService {
|
||||
StatusEnum.REGION_INFO.code("二楼CTU货架对接位"),
|
||||
StatusEnum.LOCK.code("无锁"),
|
||||
StatusEnum.SORT_TYPE.code("升序"), null, null
|
||||
);
|
||||
,"true");
|
||||
if (ObjectUtils.isNotEmpty(ctuPointList)) {
|
||||
endPointCode = ctuPointList.get(0).getCode();
|
||||
}
|
||||
@@ -96,7 +96,7 @@ public class ApplyShelfScheduleService {
|
||||
endPointCode = iSchBasePointService.checkEndPointTask(
|
||||
StatusEnum.REGION_INFO.code("二楼CTU货架对接位"),
|
||||
StatusEnum.LOCK.code("无锁"),
|
||||
StatusEnum.SORT_TYPE.code("升序"), null, null
|
||||
StatusEnum.SORT_TYPE.code("升序"), null, null,"true"
|
||||
).get(0).getCode();
|
||||
}
|
||||
if (StringUtils.isNotBlank(startPointCode) && StringUtils.isNotBlank(endPointCode)) {
|
||||
|
||||
@@ -108,7 +108,7 @@ public class TaskScheduleService {
|
||||
// 终点满足条件
|
||||
List<SchBasePoint> endPointList = iSchBasePointService.checkEndPointTask(null,
|
||||
StatusEnum.LOCK.code("无锁"),
|
||||
StatusEnum.SORT_TYPE.code("升序"), "0",targetCode);
|
||||
StatusEnum.SORT_TYPE.code("升序"), "0", targetCode, "true");
|
||||
if (ObjectUtils.isEmpty(endPointList)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -39,17 +39,16 @@
|
||||
<el-form-item label="区域类型">
|
||||
<el-select
|
||||
v-model="query.region_code"
|
||||
clearable
|
||||
filterable
|
||||
size="mini"
|
||||
placeholder="区域类型"
|
||||
class="filter-item"
|
||||
@change="getPointStatusAndTypeList(query.region_code, 1)"
|
||||
clearable
|
||||
@change="hand"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in regionList"
|
||||
:label="item.region_name"
|
||||
:value="item.region_code"
|
||||
v-for="item in statusEnum.REGION_INFO"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
@@ -63,21 +62,29 @@
|
||||
@change="hand"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in pointTypesList"
|
||||
v-for="item in statusEnum.POINT_TYPE"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否锁定">
|
||||
<el-switch
|
||||
<el-form-item label="锁定类型">
|
||||
<el-select
|
||||
v-model="query.lock_type"
|
||||
active-value="1"
|
||||
inactive-value="0"
|
||||
active-color="#409EFF"
|
||||
inactive-color="#C0CCDA"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="锁定类型"
|
||||
class="filter-item"
|
||||
@change="hand"
|
||||
/>
|
||||
>
|
||||
<el-option
|
||||
v-for="item in statusEnum.LOCK"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<rrOperation/>
|
||||
</el-form>
|
||||
@@ -97,6 +104,7 @@
|
||||
<el-form-item label="生产车间" prop="product_area">
|
||||
<el-select
|
||||
v-model="form.product_area"
|
||||
disabled
|
||||
placeholder=""
|
||||
style="width: 370px"
|
||||
>
|
||||
@@ -110,6 +118,7 @@
|
||||
</el-form-item>
|
||||
<el-form-item label="所属区域" prop="region_code">
|
||||
<el-select
|
||||
disabled
|
||||
v-model="form.region_code"
|
||||
placeholder="请选择"
|
||||
style="width: 370px;"
|
||||
@@ -122,10 +131,28 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="点位编码" prop="code">
|
||||
<el-input v-model="form.code" style="width: 370px;"/>
|
||||
<el-input v-model="form.code" disabled style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="点位名称" prop="name">
|
||||
<el-input v-model="form.name" style="width: 370px;"/>
|
||||
<el-input v-model="form.name" disabled style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="载具编码" prop="vehicle_code">
|
||||
<el-input v-model="form.vehicle_code" clearable style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="绑定/解绑" prop="priority">
|
||||
<el-select
|
||||
v-model="form.priority"
|
||||
size="mini"
|
||||
placeholder="绑定/解绑"
|
||||
class="filter-item"
|
||||
style="width: 370px;"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in statusEnum.BIND_TYPE"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="锁定类型" prop="lock_type">
|
||||
<el-select
|
||||
@@ -160,15 +187,13 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="载具编码" prop="vehicle_code">
|
||||
<el-input v-model="form.vehicle_code" clearable style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="位置" prop="point_location">
|
||||
<el-input v-model="form.point_location" clearable style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="优先级" prop="priority">
|
||||
<el-input v-model="form.priority" clearable style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="优先级" prop="priority">-->
|
||||
<!-- <el-input v-model="form.priority" clearable style="width: 370px;"/>-->
|
||||
<!-- </el-form-item>-->
|
||||
<el-form-item label="表单数据" prop="form_data">
|
||||
<el-input type="textarea" v-model="form.form_data" clearable style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
@@ -194,26 +219,30 @@
|
||||
<el-table-column prop="code" label="点位编码" sortable width="120" show-overflow-tooltip />
|
||||
<el-table-column prop="name" label="点位名称" width="150" sortable show-overflow-tooltip/>
|
||||
<el-table-column prop="region_code" label="区域编码" min-width="120" show-overflow-tooltip/>
|
||||
<el-table-column prop="group_code" label="点位组编码" min-width="120" show-overflow-tooltip/>
|
||||
<el-table-column prop="point_location" label="位置" min-width="120" show-overflow-tooltip/>
|
||||
<el-table-column prop="point_type_name" label="点位类型"/>
|
||||
<el-table-column prop="point_type" label="点位类型">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.point_type == '1' ? '满货架' : '空货架' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="lock_type" label="锁定类型" min-width="120" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
{{ statusEnum.label.LOCK[scope.row.lock_type] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="priority" label="优先级"/>
|
||||
<el-table-column prop="vehicle_code" label="载具编码" min-width="120" show-overflow-tooltip/>
|
||||
<el-table-column prop="form_data" label="表单数据" min-width="120" show-overflow-tooltip/>
|
||||
<el-table-column prop="remark" label="备注" min-width="100" show-overflow-tooltip/>
|
||||
<el-table-column prop="is_used" label="是否启用">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.is_used == '1' ? '是' : '否' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="vehicle_code" label="载具编码" min-width="120" show-overflow-tooltip/>
|
||||
<el-table-column prop="priority" label="优先级"/>
|
||||
<el-table-column prop="point_location" label="位置" min-width="120" show-overflow-tooltip/>
|
||||
<el-table-column prop="group_code" label="点位组编码" min-width="120" show-overflow-tooltip/>
|
||||
<el-table-column prop="form_data" label="表单数据" min-width="120" show-overflow-tooltip/>
|
||||
<el-table-column prop="remark" label="备注" min-width="100" show-overflow-tooltip/>
|
||||
<el-table-column prop="create_name" label="创建人"/>
|
||||
<el-table-column prop="create_time" label="创建时间" width="150"/>
|
||||
<el-table-column prop="update_name" label="修改人"/>
|
||||
<el-table-column prop="update_name" label="修改人" width="100"/>
|
||||
<el-table-column prop="update_time" label="修改时间" width="150"/>
|
||||
<el-table-column
|
||||
v-permission="[]"
|
||||
@@ -267,7 +296,7 @@ const defaultForm = {
|
||||
export default {
|
||||
name: 'Point',
|
||||
dicts: ['storagevehicle_type', 'd_lock_type', 'SCH_TASK_TYPE_DTL', 'point_location', 'product_area'],
|
||||
statusEnums: ['LOCK'],
|
||||
statusEnums: ['LOCK','REGION_INFO','POINT_TYPE','BIND_TYPE'],
|
||||
components: {pagination, crudOperation, rrOperation, udOperation},
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
@@ -284,7 +313,7 @@ export default {
|
||||
},
|
||||
crudMethod: {...crudPoint},
|
||||
query: {
|
||||
product_area: 'A1'
|
||||
product_area: 'A2'
|
||||
}
|
||||
})
|
||||
},
|
||||
@@ -307,6 +336,9 @@ export default {
|
||||
point_type: [
|
||||
{required: true, message: '点位类型不能为空', trigger: 'blur'}
|
||||
],
|
||||
priority: [
|
||||
{required: true, message: '绑定或解绑操作不能为空', trigger: 'blur'}
|
||||
],
|
||||
lock_type: [
|
||||
{required: true, message: '锁定类型不能为空', trigger: 'blur'}
|
||||
]
|
||||
|
||||
@@ -78,6 +78,24 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="任务类型">
|
||||
<el-select
|
||||
v-model="query.task_type"
|
||||
multiple
|
||||
style="width: 360px"
|
||||
placeholder="任务类型"
|
||||
class="filter-item"
|
||||
clearable
|
||||
@change="handTaskStatus"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in statusEnum.TASK_TYPE"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<rrOperation />
|
||||
</el-form>
|
||||
</div>
|
||||
@@ -162,37 +180,39 @@
|
||||
<el-table-column prop="product_area" show-overflow-tooltip show-tooltip-when-overflow label="生产区域" />
|
||||
<el-table-column prop="id" show-overflow-tooltip show-tooltip-when-overflow label="任务ID" />
|
||||
<el-table-column prop="task_code" show-overflow-tooltip show-tooltip-when-overflow label="任务编码" />
|
||||
<el-table-column prop="task_type" show-overflow-tooltip show-tooltip-when-overflow label="任务类型">
|
||||
<el-table-column prop="task_type" show-overflow-tooltip show-tooltip-when-overflow width="140" label="任务类型">
|
||||
<template slot-scope="scope">
|
||||
{{ statusEnum.label.TASK_TYPE[scope.row.task_type] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="vehicle_code" show-overflow-tooltip show-tooltip-when-overflow label="载具编码">
|
||||
<el-table-column prop="vehicle_code" show-overflow-tooltip show-tooltip-when-overflow :min-width="flexWidth('vehicle_code',crud.data,'载具编码')" label="载具编码">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.vehicle_code ? scope.row.vehicle_code : '-' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="acs_type" show-overflow-tooltip show-tooltip-when-overflow width="130" label="ACS任务类型" />
|
||||
|
||||
<el-table-column prop="status" show-overflow-tooltip show-tooltip-when-overflow label="任务状态">
|
||||
<template slot-scope="scope">
|
||||
{{ statusEnum.label.FORM_STATUS[scope.row.status] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="task_step" show-overflow-tooltip show-tooltip-when-overflow width="130" label="任务执行步骤" />
|
||||
<el-table-column prop="group_code" show-overflow-tooltip show-tooltip-when-overflow label="任务组" />
|
||||
|
||||
<el-table-column prop="point_code1" show-overflow-tooltip show-tooltip-when-overflow width="130" label="起点1" />
|
||||
<el-table-column prop="point_code2" show-overflow-tooltip show-tooltip-when-overflow width="130" label="终点1" />
|
||||
<el-table-column prop="point_code3" show-overflow-tooltip show-tooltip-when-overflow width="130" label="起点2" />
|
||||
<el-table-column prop="point_code4" show-overflow-tooltip show-tooltip-when-overflow width="130" label="终点2" />
|
||||
|
||||
<el-table-column prop="create_time" show-overflow-tooltip show-tooltip-when-overflow :min-width="flexWidth('create_time',crud.data,'创建时间')" label="创建时间" />
|
||||
<el-table-column prop="update_time" show-overflow-tooltip show-tooltip-when-overflow :min-width="flexWidth('update_time',crud.data,'修改时间')" label="修改时间" />
|
||||
<el-table-column prop="task_step" show-overflow-tooltip show-tooltip-when-overflow width="130" label="任务执行步骤" />
|
||||
<el-table-column prop="update_name" show-overflow-tooltip show-tooltip-when-overflow label="修改人" />
|
||||
<el-table-column prop="remark" show-overflow-tooltip show-tooltip-when-overflow :min-width="flexWidth('remark',crud.data,'备注')" label="备注" />
|
||||
<el-table-column prop="acs_type" show-overflow-tooltip show-tooltip-when-overflow width="130" label="ACS任务类型" />
|
||||
<el-table-column prop="priority" show-overflow-tooltip show-tooltip-when-overflow label="优先级" />
|
||||
<el-table-column prop="handle_class" show-overflow-tooltip show-tooltip-when-overflow width="150" label="处理类" />
|
||||
<el-table-column prop="is_send" show-overflow-tooltip show-tooltip-when-overflow label="立即下发" />
|
||||
<el-table-column prop="remark" show-overflow-tooltip show-tooltip-when-overflow label="备注" />
|
||||
<el-table-column prop="group_code" show-overflow-tooltip show-tooltip-when-overflow label="任务组" />
|
||||
<el-table-column prop="form_data" show-overflow-tooltip show-tooltip-when-overflow width="130" label="自定义参数" />
|
||||
<el-table-column prop="create_time" show-overflow-tooltip show-tooltip-when-overflow label="创建时间" />
|
||||
<el-table-column prop="update_name" show-overflow-tooltip show-tooltip-when-overflow label="修改人" />
|
||||
<el-table-column prop="update_time" show-overflow-tooltip show-tooltip-when-overflow label="修改时间" />
|
||||
|
||||
<el-table-column v-permission="[]" label="操作" width="250px" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
|
||||
Reference in New Issue
Block a user