opt:6.15上线装箱区代码修改

This commit is contained in:
2024-06-17 11:01:36 +08:00
parent 78fb4e7a5f
commit 12e72ae6fd
31 changed files with 427 additions and 338 deletions

View File

@@ -1,8 +1,11 @@
package org.nl.b_lms.pdm.subpackagerelation.dao.mapper; package org.nl.b_lms.pdm.subpackagerelation.dao.mapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.nl.b_lms.pdm.subpackagerelation.dao.PdmBiSubpackagerelation; import org.nl.b_lms.pdm.subpackagerelation.dao.PdmBiSubpackagerelation;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.nl.common.domain.query.PageQuery;
import java.util.List; import java.util.List;
@@ -17,6 +20,12 @@ import java.util.Map;
public interface PdmBiSubpackagerelationMapper extends BaseMapper<PdmBiSubpackagerelation> { public interface PdmBiSubpackagerelationMapper extends BaseMapper<PdmBiSubpackagerelation> {
List<PdmBiSubpackagerelation> selectGroupedSubPackageRelation(Page<PdmBiSubpackagerelation> page, Map<String, Object> whereJson); List<PdmBiSubpackagerelation> selectGroupedSubPackageRelation1(@Param("page") Integer page,@Param("size") Integer size, @Param("whereJson") Map<String, Object> whereJson);
Page<PdmBiSubpackagerelation> selectGroupedSubPackageRelation(Page<PdmBiSubpackagerelation> page, @Param("sale_order_name") String sale_order_name,
@Param("customer_name") String customer_name,
@Param("customer_description") String customer_description,
@Param("status") String status);
} }

View File

@@ -0,0 +1,76 @@
<?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.b_lms.pdm.subpackagerelation.dao.mapper.PdmBiSubpackagerelationMapper">
<select id="selectGroupedSubPackageRelation" resultType="org.nl.b_lms.pdm.subpackagerelation.dao.PdmBiSubpackagerelation">
SELECT
sale_order_name,
MAX(create_time) AS create_time,
workorder_id,
package_box_sn,
quanlity_in_box,
box_weight,
quality_guaran_period,
customer_name,
customer_description,
product_name,
product_description,
date_of_FG_inbound,
container_name,
width,
thickness,
mass_per_unit_area,
net_weight,
length,
date_of_production,
is_un_plan_production,
un_plan_product_property1,
un_plan_product_property2,
un_plan_product_property3,
remark,
create_id,
create_name,
status,
isRePrintPackageBoxLabel,
isUnPackBox,
box_type,
sap_pcsn,
vbeln,
posnr,
box_length,
box_width,
box_high,
sale_order_description,
width_standard,
thickness_request,
real_weight,
sub_type,
demand_limit,
standard_limit,
actual_value,
need_delete,
ext_code,
box_group
FROM
pdm_bi_subpackagerelation
WHERE
container_name IN (SELECT container_name FROM bst_ivt_packageinfoivt WHERE point_status = '3')
<if test="sale_order_name != null and sale_order_name != ''">
AND sale_order_name LIKE CONCAT('%', #{sale_order_name}, '%')
</if>
<if test="customer_name != null and customer_name != ''">
AND customer_name LIKE CONCAT('%', #{customer_name}, '%')
</if>
<if test="customer_description != null and customer_description != ''">
AND customer_description LIKE CONCAT('%', #{customer_description}, '%')
</if>
<if test="status != null and status != ''">
AND status = #{status}
</if>
GROUP BY
sale_order_name
ORDER BY
MAX(create_time) DESC
</select>
</mapper>

View File

@@ -1,20 +0,0 @@
<?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.b_lms.pdm.subpackagerelation.dao.mapper.PdmBiSubpackagerelationMapper">
<select id="selectGroupedSubPackageRelation" resultType="org.nl.b_lms.pdm.subpackagerelation.dao.PdmBiSubpackagerelation">
SELECT *
FROM pdm_bi_subpackagerelation
WHERE (sale_order_name, create_time) IN (
SELECT sale_order_name, MAX(create_time) AS create_time
FROM pdm_bi_subpackagerelation
<if test="_parameter.containsKey('customer_name')">
WHERE customer_name = #{customer_name}
</if>
GROUP BY sale_order_name
)
ORDER BY create_time DESC
LIMIT #{page.offset}, #{page.size}
</select>
</mapper>

View File

@@ -7,7 +7,6 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.nl.b_lms.pdm.bi.slittingproductionplan.service.dao.PdmBiSlittingproductionplan;
import org.nl.b_lms.pdm.bi.slittingproductionplan.service.dao.mapper.PdmBiSlittingproductionplanMapper; import org.nl.b_lms.pdm.bi.slittingproductionplan.service.dao.mapper.PdmBiSlittingproductionplanMapper;
import org.nl.b_lms.pdm.subpackagerelation.dao.PdmBiSubpackagerelation; import org.nl.b_lms.pdm.subpackagerelation.dao.PdmBiSubpackagerelation;
import org.nl.b_lms.pdm.subpackagerelation.dao.mapper.PdmBiSubpackagerelationMapper; import org.nl.b_lms.pdm.subpackagerelation.dao.mapper.PdmBiSubpackagerelationMapper;
@@ -19,8 +18,8 @@ import org.nl.b_lms.sch.point.service.IbstIvtPackageinfoivtService;
import org.nl.b_lms.sch.task.dao.SchBaseTask; import org.nl.b_lms.sch.task.dao.SchBaseTask;
import org.nl.b_lms.sch.tasks.first_floor_area.*; import org.nl.b_lms.sch.tasks.first_floor_area.*;
import org.nl.b_lms.sch.tasks.first_floor_area.auto.TaskQueueManager; import org.nl.b_lms.sch.tasks.first_floor_area.auto.TaskQueueManager;
import org.nl.b_lms.sch.tasks.first_floor_area.auto.TaskQueue;
import org.nl.b_lms.storage_manage.ios.service.iostorInv.util.service.OutBoxManageService; import org.nl.b_lms.storage_manage.ios.service.iostorInv.util.service.OutBoxManageService;
import org.nl.common.enums.ContainerLevelEnum;
import org.nl.common.enums.PackageInfoIvtEnum; import org.nl.common.enums.PackageInfoIvtEnum;
import org.nl.common.utils.SecurityUtils; import org.nl.common.utils.SecurityUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -36,7 +35,6 @@ import javax.annotation.Resource;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.stream.Stream;
/** /**
@@ -56,6 +54,8 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
@Resource @Resource
private ISysParamService iSysParamService; private ISysParamService iSysParamService;
@Resource @Resource
private DjqTask djqTask; private DjqTask djqTask;
@Resource @Resource
@@ -80,6 +80,10 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
@Resource @Resource
private BstIvtPackageinfoivtMapper bstIvtPackageinfoivtMapper; private BstIvtPackageinfoivtMapper bstIvtPackageinfoivtMapper;
@Resource
private TaskQueueManager taskQueueManager;
@Resource
private TaskQueue taskQueue;
/** /**
* 查询数据分页 * 查询数据分页
@@ -94,14 +98,21 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
} }
@Override
public IPage<PdmBiSubpackagerelation> queryContainerization(Map whereJson, PageQuery pageable) {
Page<PdmBiSubpackagerelation> pageObject = new Page<>(pageable.getPage(), pageable.getSize());
return pdmBiSubpackagerelationMapper.selectGroupedSubPackageRelation(pageObject,(String)whereJson.get("sale_order_name"),(String)whereJson.get("customer_name"),(String)whereJson.get("customer_description"),(String)whereJson.get("status"));
}
/** /**
* 查询订单装箱信息 * 查询订单装箱信息
* *
* @param whereJson 查询条件 * @param whereJson 查询条件
* @param pageable 分页参数 * @param pageable 分页参数
*/ */
@Override public IPage<PdmBiSubpackagerelation> queryContainerization1(Map whereJson, PageQuery pageable) {
public IPage<PdmBiSubpackagerelation> queryContainerization(Map whereJson, PageQuery pageable) {
IPage<PdmBiSubpackagerelation> resultPage = new Page<>(pageable.getPage(), pageable.getSize()); IPage<PdmBiSubpackagerelation> resultPage = new Page<>(pageable.getPage(), pageable.getSize());
LambdaQueryWrapper<PdmBiSubpackagerelation> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<PdmBiSubpackagerelation> queryWrapper = new LambdaQueryWrapper<>();
if (whereJson.containsKey("customer_description")) { if (whereJson.containsKey("customer_description")) {
@@ -120,12 +131,19 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
queryWrapper.lt(PdmBiSubpackagerelation::getStatus, "99"); queryWrapper.lt(PdmBiSubpackagerelation::getStatus, "99");
} }
} }
queryWrapper.groupBy(PdmBiSubpackagerelation::getSale_order_name) queryWrapper.groupBy(PdmBiSubpackagerelation::getSale_order_name)
.orderByDesc(PdmBiSubpackagerelation::getCreate_time); .orderByDesc(PdmBiSubpackagerelation::getCreate_time);
return pdmBiSubpackagerelationMapper.selectPage(resultPage, queryWrapper); return pdmBiSubpackagerelationMapper.selectPage(resultPage, queryWrapper);
} }
/** /**
* 根据订单号查询子卷信息 * 根据订单号查询子卷信息
* *
@@ -384,9 +402,9 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
public void updateEntityList(JSONObject whereJson) { public void updateEntityList(JSONObject whereJson) {
List<PdmBiSubpackagerelation> packagerelationList = JSONObject.parseArray(whereJson.getJSONArray("tableMater").toJSONString(), PdmBiSubpackagerelation.class); List<PdmBiSubpackagerelation> packagerelationList = JSONObject.parseArray(whereJson.getJSONArray("tableMater").toJSONString(), PdmBiSubpackagerelation.class);
List<PdmBiSubpackagerelation> isOutBox = packagerelationList.stream().filter(r -> r.getStatus().equals("0")).collect(Collectors.toList()); List<PdmBiSubpackagerelation> isOutBox = packagerelationList.stream().filter(r -> r.getStatus().equals("0")).collect(Collectors.toList());
// if (isOutBox.size() > 0) { // if (isOutBox.size() > 0) {
// throw new BadRequestException("标记为黄色的子卷号已分配木箱,请重新选择未分配木箱的子卷"); // throw new BadRequestException("标记为黄色的子卷号已分配木箱,请重新选择未分配木箱的子卷");
// } // }
List<String> entityList = JSONObject.parseArray(whereJson.getJSONArray("tableMater").toJSONString(), PdmBiSubpackagerelation.class).stream() List<String> entityList = JSONObject.parseArray(whereJson.getJSONArray("tableMater").toJSONString(), PdmBiSubpackagerelation.class).stream()
.map(PdmBiSubpackagerelation::getWorkorder_id) .map(PdmBiSubpackagerelation::getWorkorder_id)
.map(String::valueOf) .map(String::valueOf)
@@ -411,7 +429,7 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
updateWrapper.set("status", "0"); updateWrapper.set("status", "0");
updateWrapper.in("workorder_id", entityList); updateWrapper.in("workorder_id", entityList);
pdmBiSubpackagerelationMapper.update(null, updateWrapper); pdmBiSubpackagerelationMapper.update(null, updateWrapper);
outBox(entityList, packagerelationList, boxType); outBox(entityList, packagerelationList, boxType);
} catch (Exception e) { } catch (Exception e) {
throw new BadRequestException(e.getMessage()); throw new BadRequestException(e.getMessage());
} }
@@ -429,40 +447,42 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
if (CollectionUtils.isEmpty(bstIvtPackageinfoivtList)) { if (CollectionUtils.isEmpty(bstIvtPackageinfoivtList)) {
throw new BadRequestException("没有可用的装箱区对接位"); throw new BadRequestException("没有可用的装箱区对接位");
} }
List<Map<String, Integer>> pointCodeList = bstIvtPackageinfoivtList.stream() Map<String, Integer> resultMap = new HashMap<>();
.map(p -> {
Map<String, Integer> map = new HashMap<>();
map.put(p.getPoint_code(), StringUtils.isNotBlank(p.getContainer_name()) ? 1 : 0);
return map;
})
.collect(Collectors.toList());
//获取装箱位任务数量 //获取装箱位任务数量
// List<Map<String, Integer>> taskCount = bstIvtPackageinfoivtMapper.getPointTaskCount(); List<Map<String, Object>> taskCount = bstIvtPackageinfoivtMapper.getPointTaskCount();
// if (CollectionUtils.isNotEmpty(taskCount)) { if (taskCount != null) {
// for (Map<String, Integer> p : pointCodeList) { for (Map<String, Object> map : taskCount) {
// for (Map.Entry<String, Integer> e : p.entrySet()) { Object pointCode2Obj = map.get("point_code2");
// String pointCode = e.getKey(); Object countObj = map.get("count");
// for (Map<String, Integer> taskMap : taskCount) { if (pointCode2Obj != null && countObj != null) {
// if (taskMap.containsKey(pointCode)) { String pointCode2 = pointCode2Obj.toString();
// e.setValue(taskMap.get(pointCode)); Long countLong = (Long) countObj;
// break; Integer count = countLong.intValue();
// } resultMap.merge(pointCode2, count, Integer::sum);
// } }
// } }
// } }
// //获取资源最少的装箱对接位 bstIvtPackageinfoivtList.stream()
// Optional<String> minPointKey = pointCodeList.stream() .collect(Collectors.toMap(
// .min(Comparator.comparingInt(map -> map.entrySet().iterator().next().getValue())) BstIvtPackageinfoivt::getPoint_code,
// .map(map -> map.keySet().iterator().next()); p -> StringUtils.isNotBlank(p.getContainer_name()) ? 1 : 0,
// deviceCode = minPointKey.orElse(""); Integer::sum
// } else { ))
deviceCode = bstIvtPackageinfoivtList.get(0).getPoint_code(); .forEach((key, value) -> resultMap.merge(key, value, Integer::sum));
// } List<Map<String, Integer>> result = resultMap.entrySet().stream()
.map(entry -> Collections.singletonMap(entry.getKey(), entry.getValue()))
.collect(Collectors.toList());
//获取数量最少的点位
Optional<String> minPointCode = result.stream()
.min(Comparator.comparingInt(map -> map.entrySet().iterator().next().getValue()))
.map(map -> map.keySet().iterator().next());
deviceCode = minPointCode.orElseGet(() -> bstIvtPackageinfoivtList.get(0).getPoint_code());
//确定装箱区终点 //确定装箱区终点
boxInfo.put("device_code", deviceCode); boxInfo.put("device_code", deviceCode);
boxInfo.put("material_code", boxType); boxInfo.put("material_code", boxType);
boxInfo.put("num", entityList.size()); boxInfo.put("num", entityList.size());
String boxSn = outBoxManageService.outBox(boxInfo); //String boxSn = outBoxManageService.outBox(boxInfo);
String boxSn = "MX61401";
if (StringUtils.isBlank(boxSn)) { if (StringUtils.isBlank(boxSn)) {
throw new BadRequestException("库位 -> 装箱对接位,木箱码不能为空!"); throw new BadRequestException("库位 -> 装箱对接位,木箱码不能为空!");
} }
@@ -472,14 +492,14 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
updateWrapper1.in("workorder_id", entityList); updateWrapper1.in("workorder_id", entityList);
pdmBiSubpackagerelationMapper.update(null, updateWrapper1); pdmBiSubpackagerelationMapper.update(null, updateWrapper1);
//待检区->装箱区agv任务 //待检区->装箱区agv任务
//agvTransfer(packagerelationList, deviceCode, boxSn); agvTransfer(packagerelationList, deviceCode, boxSn);
} }
/** /**
* 待检区->装箱区agv任务 * 待检区->装箱区agv任务
*/ */
private void agvTransfer(List<PdmBiSubpackagerelation> packagerelationList, String deviceCode, String boxSn) { private void agvTransfer1(List<PdmBiSubpackagerelation> packagerelationList, String deviceCode, String boxSn) {
//待检区点位 //待检区点位
List<BstIvtPackageinfoivt> djqPointList = packageinfoivtService List<BstIvtPackageinfoivt> djqPointList = packageinfoivtService
.list(new LambdaUpdateWrapper<BstIvtPackageinfoivt>() .list(new LambdaUpdateWrapper<BstIvtPackageinfoivt>()
@@ -519,13 +539,14 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
} }
private void agvTransfer1(List<PdmBiSubpackagerelation> packagerelationList, String deviceCode, String boxSn) { private void agvTransfer(List<PdmBiSubpackagerelation> packagerelationList, String deviceCode, String boxSn) {
//待检区点位 //待检区点位
List<BstIvtPackageinfoivt> djqPointList = packageinfoivtService List<BstIvtPackageinfoivt> djqPointList = packageinfoivtService
.list(new LambdaUpdateWrapper<BstIvtPackageinfoivt>() .list(new LambdaUpdateWrapper<BstIvtPackageinfoivt>()
.eq(BstIvtPackageinfoivt::getPoint_status, PackageInfoIvtEnum.POINT_STATUS.code("待检区")) .eq(BstIvtPackageinfoivt::getPoint_status, PackageInfoIvtEnum.POINT_STATUS.code("待检区"))
.eq(BstIvtPackageinfoivt::getIs_used, PackageInfoIvtEnum.IS_USED.code("启用")) .eq(BstIvtPackageinfoivt::getIs_used, PackageInfoIvtEnum.IS_USED.code("启用"))
.eq(BstIvtPackageinfoivt::getIvt_status, PackageInfoIvtEnum.IVT_STATUS.code("合格品")) //.eq(BstIvtPackageinfoivt::getIvt_status, PackageInfoIvtEnum.IVT_STATUS.code("合格品"))
.eq(BstIvtPackageinfoivt::getIvt_status, PackageInfoIvtEnum.IVT_STATUS.code("有子卷"))
.orderByAsc(BstIvtPackageinfoivt::getSort_seq)); .orderByAsc(BstIvtPackageinfoivt::getSort_seq));
Set<String> containerNames = packagerelationList.stream() Set<String> containerNames = packagerelationList.stream()
.map(PdmBiSubpackagerelation::getContainer_name) .map(PdmBiSubpackagerelation::getContainer_name)
@@ -534,7 +555,7 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
.filter(djqPoint -> containerNames.contains(djqPoint.getContainer_name())) .filter(djqPoint -> containerNames.contains(djqPoint.getContainer_name()))
.collect(Collectors.toList()); .collect(Collectors.toList());
//任务组id //任务组id
String groupId = deviceCode.substring(deviceCode.indexOf("_") + 1); String groupId = deviceCode.substring(deviceCode.lastIndexOf("_") + 1);
List<SchBaseTask> schBaseTaskList = new ArrayList<>(); List<SchBaseTask> schBaseTaskList = new ArrayList<>();
//确定起点,安装装箱组标识加入任务队列 //确定起点,安装装箱组标识加入任务队列
djqPoints.forEach(r -> { djqPoints.forEach(r -> {
@@ -544,12 +565,13 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
jo.put("point_code1", r.getPoint_code()); jo.put("point_code1", r.getPoint_code());
//木箱号 //木箱号
jo.put("vehicle_code2", boxSn); jo.put("vehicle_code2", boxSn);
SchBaseTask task = zxqTask.dynamicCreateTask(jo); SchBaseTask task = new SchBaseTask();
task.setTask_id(zxqTask.createTask(jo));
//增加任务到队列 //增加任务到队列
schBaseTaskList.add(task); schBaseTaskList.add(task);
}); });
TaskQueueManager taskQueueManager = new TaskQueueManager(); //taskQueueManager.addTasksToQueue(groupId, schBaseTaskList);
taskQueueManager.addTasksToQueue(deviceCode, schBaseTaskList); taskQueue.addTasksToQueue(groupId, schBaseTaskList);
} }

View File

@@ -19,6 +19,6 @@ public interface BstIvtPackageinfoivtMapper extends BaseMapper<BstIvtPackageinfo
/** /**
* 获取对接位任务数量 * 获取对接位任务数量
*/ */
List<Map<String,Integer>> getPointTaskCount(); List<Map<String, Object>> getPointTaskCount();
} }

View File

@@ -3,19 +3,14 @@
<mapper namespace="org.nl.b_lms.sch.point.dao.mapper.BstIvtPackageinfoivtMapper"> <mapper namespace="org.nl.b_lms.sch.point.dao.mapper.BstIvtPackageinfoivtMapper">
<select id="getPointTaskCount" resultType="java.util.Map"> <select id="getPointTaskCount" resultType="java.util.Map">
SELECT SELECT
p.point_code, t.point_code2,
COUNT(t.point_code2) AS count COUNT( t.point_code2 ) AS count
FROM FROM
bst_ivt_packageinfoivt p sch_base_task t
LEFT JOIN
sch_base_task t ON p.point_code = t.point_code2
WHERE WHERE
p.point_status = '5' t.task_type ='010704'
AND t.task_status <![CDATA[ < ]]> '07' AND t.task_status <![CDATA[ < ]]> 08
GROUP BY GROUP BY t.point_code2
p.point_code
ORDER BY
p.point_code;
</select> </select>
</mapper> </mapper>

View File

@@ -1,6 +0,0 @@
<?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.b_lms.sch.point.dao.mapper.StIvtCoolregionioMapper">
</mapper>

View File

@@ -1,6 +0,0 @@
<?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.b_lms.sch.point.dao.mapper.StIvtCutpointivtMapper">
</mapper>

View File

@@ -1,6 +0,0 @@
<?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.b_lms.sch.point.dao.mapper.StIvtDeliverypointivtMapper">
</mapper>

View File

@@ -1,6 +0,0 @@
<?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.b_lms.sch.point.dao.mapper.StIvtEmptytubeivtMapper">
</mapper>

View File

@@ -1,6 +0,0 @@
<?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.b_lms.sch.point.dao.mapper.StIvtEmptyvehiclerecordMapper">
</mapper>

View File

@@ -1,6 +0,0 @@
<?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.b_lms.sch.point.dao.mapper.StIvtHotpointivtMapper">
</mapper>

View File

@@ -1,6 +0,0 @@
<?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.b_lms.sch.point.dao.mapper.StIvtSbpointivtMapper">
</mapper>

View File

@@ -1,6 +0,0 @@
<?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.b_lms.sch.point.dao.mapper.StIvtShaftivtMapper">
</mapper>

View File

@@ -1,7 +1,9 @@
package org.nl.b_lms.sch.point.service.impl; package org.nl.b_lms.sch.point.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.nl.b_lms.sch.point.dao.BstIvtPackageinfoivt; import org.nl.b_lms.sch.point.dao.BstIvtPackageinfoivt;
import org.nl.b_lms.sch.point.dao.mapper.BstIvtPackageinfoivtMapper; import org.nl.b_lms.sch.point.dao.mapper.BstIvtPackageinfoivtMapper;
@@ -9,6 +11,7 @@ import org.nl.b_lms.sch.point.service.IbstIvtPackageinfoivtService;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import org.nl.b_lms.sch.task.dao.SchBaseTask; import org.nl.b_lms.sch.task.dao.SchBaseTask;
import org.nl.b_lms.sch.task.service.IschBaseTaskService; import org.nl.b_lms.sch.task.service.IschBaseTaskService;
import org.nl.b_lms.storage_manage.ios.enums.IOSEnum;
import org.nl.common.enums.PackageInfoIvtEnum; import org.nl.common.enums.PackageInfoIvtEnum;
import org.nl.common.utils.SecurityUtils; import org.nl.common.utils.SecurityUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -56,7 +59,7 @@ public class BstIvtPackageinfoivtServiceImpl extends ServiceImpl<BstIvtPackagein
@Override @Override
public List<BstIvtPackageinfoivt> checkEndPointTask(String ivtType, String ivtStatus, String pointCode,String taskType) { public List<BstIvtPackageinfoivt> checkEndPointTask(String ivtType, String ivtStatus, String pointCode, String taskType) {
List<BstIvtPackageinfoivt> packageinfoivtList = bstIvtPackageinfoivtMapper List<BstIvtPackageinfoivt> packageinfoivtList = bstIvtPackageinfoivtMapper
.selectList(new LambdaUpdateWrapper<BstIvtPackageinfoivt>() .selectList(new LambdaUpdateWrapper<BstIvtPackageinfoivt>()
.eq(BstIvtPackageinfoivt::getIs_used, PackageInfoIvtEnum.IS_USED.code("启用")) .eq(BstIvtPackageinfoivt::getIs_used, PackageInfoIvtEnum.IS_USED.code("启用"))
@@ -64,28 +67,61 @@ public class BstIvtPackageinfoivtServiceImpl extends ServiceImpl<BstIvtPackagein
.eq(BstIvtPackageinfoivt::getIvt_status, ivtStatus) .eq(BstIvtPackageinfoivt::getIvt_status, ivtStatus)
.orderByAsc(BstIvtPackageinfoivt::getSort_seq)); .orderByAsc(BstIvtPackageinfoivt::getSort_seq));
Set<String> pointIds = packageinfoivtList.stream().map(BstIvtPackageinfoivt::getPoint_code).collect(Collectors.toSet()); Set<String> pointIds = packageinfoivtList.stream().map(BstIvtPackageinfoivt::getPoint_code).collect(Collectors.toSet());
if (CollectionUtils.isNotEmpty(pointIds)) { if (CollectionUtils.isEmpty(pointIds)) {
if (pointCode.equals("1")) {
List<SchBaseTask> taskList = taskService.list(new LambdaUpdateWrapper<SchBaseTask>()
//起点未完成任务
.lt(SchBaseTask::getTask_status, TaskStatusEnum.FINISHED.getCode())
.and(
r -> r.in(SchBaseTask::getPoint_code1, pointIds)
));
return packageinfoivtList.stream().filter(r -> !taskList.stream().map(SchBaseTask::getPoint_code1).collect(Collectors.toSet()).contains(r.getPoint_code())).collect(Collectors.toList());
} else {
List<SchBaseTask> taskList = taskService.list(new LambdaUpdateWrapper<SchBaseTask>()
//终点未完成任务
.lt(SchBaseTask::getTask_status, TaskStatusEnum.FINISHED.getCode())
.eq(SchBaseTask::getTask_type,taskType)
.and(
r -> r.in(SchBaseTask::getPoint_code2, pointIds)
));
return packageinfoivtList.stream().filter(r -> !taskList.stream().map(SchBaseTask::getPoint_code2).collect(Collectors.toSet()).contains(r.getPoint_code())).collect(Collectors.toList());
}
} else {
return null; return null;
} }
if (pointCode.equals("1")) {
List<SchBaseTask> taskList = taskService.list(new LambdaUpdateWrapper<SchBaseTask>()
//起点未完成任务
.lt(SchBaseTask::getTask_status, TaskStatusEnum.FINISHED.getCode())
.eq(taskType != null && !taskType.equals(""), SchBaseTask::getTask_type, taskType)
.and(
r -> r.in(SchBaseTask::getPoint_code1, pointIds)
));
return packageinfoivtList.stream().filter(r -> !taskList.stream().map(SchBaseTask::getPoint_code1).collect(Collectors.toSet()).contains(r.getPoint_code())).collect(Collectors.toList());
} else {
List<SchBaseTask> taskList = taskService.list(new LambdaUpdateWrapper<SchBaseTask>()
//终点未完成任务
.lt(SchBaseTask::getTask_status, TaskStatusEnum.FINISHED.getCode())
.eq(taskType != null && !taskType.equals(""), SchBaseTask::getTask_type, taskType)
.and(
r -> r.in(SchBaseTask::getPoint_code2, pointIds)
));
return packageinfoivtList.stream().filter(r -> !taskList.stream().map(SchBaseTask::getPoint_code2).collect(Collectors.toSet()).contains(r.getPoint_code())).collect(Collectors.toList());
}
}
public List<BstIvtPackageinfoivt> checkEndPointTask1(String ivtType, String ivtStatus, String pointCode, String taskType) {
List<BstIvtPackageinfoivt> packageinfoivtList = bstIvtPackageinfoivtMapper
.selectList(new LambdaQueryWrapper<BstIvtPackageinfoivt>()
.eq(BstIvtPackageinfoivt::getIs_used, PackageInfoIvtEnum.IS_USED.code("启用"))
.eq(BstIvtPackageinfoivt::getPoint_status, ivtType)
.eq(BstIvtPackageinfoivt::getIvt_status, ivtStatus)
.orderByAsc(BstIvtPackageinfoivt::getSort_seq));
Set<String> pointIds = packageinfoivtList.stream()
.map(BstIvtPackageinfoivt::getPoint_code)
.collect(Collectors.toSet());
if (CollectionUtils.isEmpty(pointIds)) {
return null;
}
//1起点2终点
SFunction<SchBaseTask, String> pointCodeType = pointCode.equals("1") ? SchBaseTask::getPoint_code1 : SchBaseTask::getPoint_code2;
// 查询未完成任务
LambdaQueryWrapper<SchBaseTask> taskQueryWrapper = new LambdaQueryWrapper<SchBaseTask>()
.lt(SchBaseTask::getTask_status, TaskStatusEnum.FINISHED.getCode())
.in(pointCodeType, pointIds);
if (taskType != null && !taskType.isEmpty()) {
taskQueryWrapper.eq(SchBaseTask::getTask_type, taskType);
}
List<SchBaseTask> taskList = taskService.list(taskQueryWrapper);
Set<String> taskPointCodes = taskList.stream()
.map(pointCodeType)
.collect(Collectors.toSet());
// 过滤未完成任务的任务
return packageinfoivtList.stream()
.filter(packageInfo -> !taskPointCodes.contains(packageInfo.getPoint_code()))
.collect(Collectors.toList());
} }

View File

@@ -29,6 +29,7 @@ import org.nl.wms.sch.manage.TaskStatusEnum;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
@@ -52,6 +53,8 @@ public class DjqTask extends AbstractAcsTask {
private IbstIvtPackageinfoivtService packageinfoivtService; private IbstIvtPackageinfoivtService packageinfoivtService;
@Resource @Resource
private MzhcwTask mzhcwTask; private MzhcwTask mzhcwTask;
@Resource
private TaskQueueManager taskQueueManager;
private final String THIS_CLASS = DjqTask.class.getName(); private final String THIS_CLASS = DjqTask.class.getName();
@@ -134,8 +137,8 @@ public class DjqTask extends AbstractAcsTask {
if (Integer.parseInt(schBaseTask.getTask_status()) > Integer.parseInt(TaskStatusEnum.ISSUE.getCode())) { if (Integer.parseInt(schBaseTask.getTask_status()) > Integer.parseInt(TaskStatusEnum.ISSUE.getCode())) {
throw new BadRequestException("任务已执行不能取消"); throw new BadRequestException("任务已执行不能取消");
} }
//更新任务表删除字段 //任务被标记为取消
schBaseTask.setIs_delete(IOSEnum.IS_NOTANDYES.code("")); schBaseTask.setTask_status(TaskStatusEnum.CANCEL.getCode());
} }
schBaseTask.setUpdate_time(DateUtil.now()); schBaseTask.setUpdate_time(DateUtil.now());
schBaseTask.setUpdate_optid(SecurityUtils.getCurrentUserId()); schBaseTask.setUpdate_optid(SecurityUtils.getCurrentUserId());
@@ -167,6 +170,7 @@ public class DjqTask extends AbstractAcsTask {
SchBaseTaskVO schBaseTaskVo = SchBaseTaskVO.builder() SchBaseTaskVO schBaseTaskVo = SchBaseTaskVO.builder()
.task_type(taskType) .task_type(taskType)
.vehicle_code(vehicleCode) .vehicle_code(vehicleCode)
.vehicle_code2(form.getString("vehicle_code2"))
.point_code1(pointCode1) .point_code1(pointCode1)
.point_code2(pointCode2) .point_code2(pointCode2)
.point_code3(form.getString("point_code3")) .point_code3(form.getString("point_code3"))
@@ -194,7 +198,7 @@ public class DjqTask extends AbstractAcsTask {
public void sendDjqToZxq(SchBaseTask schBaseTask) { public void sendDjqToZxq(SchBaseTask schBaseTask) {
//装箱区有空位 //装箱区有空位
List<BstIvtPackageinfoivt> bstIvtPackageinfoivtList = packageinfoivtService.checkEndPointTask(PackageInfoIvtEnum.POINT_STATUS.code("装箱区"), PackageInfoIvtEnum.IVT_STATUS.code(""),"2",""); List<BstIvtPackageinfoivt> bstIvtPackageinfoivtList = packageinfoivtService.checkEndPointTask(PackageInfoIvtEnum.POINT_STATUS.code("装箱区"), PackageInfoIvtEnum.IVT_STATUS.code(""), "2", "");
if (CollectionUtils.isNotEmpty(bstIvtPackageinfoivtList)) { if (CollectionUtils.isNotEmpty(bstIvtPackageinfoivtList)) {
Map<String, List<String>> ivtList = bstIvtPackageinfoivtList.stream() Map<String, List<String>> ivtList = bstIvtPackageinfoivtList.stream()
.collect(Collectors.groupingBy( .collect(Collectors.groupingBy(
@@ -202,24 +206,23 @@ public class DjqTask extends AbstractAcsTask {
LinkedHashMap::new, LinkedHashMap::new,
Collectors.mapping(BstIvtPackageinfoivt::getPoint_name, Collectors.toList()) Collectors.mapping(BstIvtPackageinfoivt::getPoint_name, Collectors.toList())
)); ));
TaskQueueManager taskQueueManager =new TaskQueueManager();
taskQueueManager.processTasks(ivtList); taskQueueManager.processTasks(ivtList);
} }
} }
@Override @Override
@Transactional
public void forceFinish(String taskId) { public void forceFinish(String taskId) {
SchBaseTask schBaseTask = taskService.getOne(new LambdaUpdateWrapper<SchBaseTask>() SchBaseTask schBaseTask = taskService.getOne(new LambdaUpdateWrapper<SchBaseTask>()
.eq(SchBaseTask::getTask_id, taskId), false); .eq(SchBaseTask::getTask_id, taskId), false);
if (schBaseTask == null) { if (schBaseTask == null) {
throw new BadRequestException("满轴缓存位 -> 待检区强制完成接口任务号为空!"); throw new BadRequestException("满轴缓存位 -> 待检区强制完成接口任务号为空!");
} }
schBaseTask.setTask_status(TaskStatusEnum.FINISHED.getCode()); updateTaskStatus(JSONObject.parseObject(JSON.toJSONString(schBaseTask)), TaskStatusEnum.FINISHED.getCode());
schBaseTask.setUpdate_time(DateUtil.now());
schBaseTask.setUpdate_optid(SecurityUtils.getCurrentUserId());
schBaseTask.setUpdate_optname(SecurityUtils.getCurrentNickName());
taskService.update(schBaseTask);
} }
@Override @Override
public void cancel(String taskId) { public void cancel(String taskId) {
SchBaseTask schBaseTask = taskService.getOne(new LambdaUpdateWrapper<SchBaseTask>() SchBaseTask schBaseTask = taskService.getOne(new LambdaUpdateWrapper<SchBaseTask>()
@@ -227,7 +230,7 @@ public class DjqTask extends AbstractAcsTask {
if (schBaseTask == null) { if (schBaseTask == null) {
throw new BadRequestException("满轴缓存位 -> 待检区取消接口任务号为空!"); throw new BadRequestException("满轴缓存位 -> 待检区取消接口任务号为空!");
} }
schBaseTask.setTask_status(IOSEnum.ACS_RESULT.code("取消")); schBaseTask.setTask_status(TaskStatusEnum.CANCEL.getCode());
schBaseTask.setUpdate_time(DateUtil.now()); schBaseTask.setUpdate_time(DateUtil.now());
schBaseTask.setUpdate_optid(SecurityUtils.getCurrentUserId()); schBaseTask.setUpdate_optid(SecurityUtils.getCurrentUserId());
schBaseTask.setUpdate_optname(SecurityUtils.getCurrentNickName()); schBaseTask.setUpdate_optname(SecurityUtils.getCurrentNickName());

View File

@@ -122,8 +122,8 @@ public class GzqTask extends AbstractAcsTask {
if (Integer.parseInt(schBaseTask.getTask_status()) > Integer.parseInt(TaskStatusEnum.ISSUE.getCode())) { if (Integer.parseInt(schBaseTask.getTask_status()) > Integer.parseInt(TaskStatusEnum.ISSUE.getCode())) {
throw new BadRequestException("任务已执行不能取消"); throw new BadRequestException("任务已执行不能取消");
} }
//更新任务表删除字段 //任务被标记为取消
schBaseTask.setIs_delete(IOSEnum.IS_NOTANDYES.code("")); schBaseTask.setTask_status(TaskStatusEnum.CANCEL.getCode());
} }
schBaseTask.setUpdate_time(DateUtil.now()); schBaseTask.setUpdate_time(DateUtil.now());
schBaseTask.setUpdate_optid(SecurityUtils.getCurrentUserId()); schBaseTask.setUpdate_optid(SecurityUtils.getCurrentUserId());
@@ -155,6 +155,7 @@ public class GzqTask extends AbstractAcsTask {
SchBaseTaskVO schBaseTaskVo = SchBaseTaskVO.builder() SchBaseTaskVO schBaseTaskVo = SchBaseTaskVO.builder()
.task_type(taskType) .task_type(taskType)
.vehicle_code(vehicleCode) .vehicle_code(vehicleCode)
.vehicle_code2(form.getString("vehicle_code2"))
.point_code1(pointCode1) .point_code1(pointCode1)
.point_code2(pointCode2) .point_code2(pointCode2)
.point_code3(form.getString("point_code3")) .point_code3(form.getString("point_code3"))
@@ -180,21 +181,20 @@ public class GzqTask extends AbstractAcsTask {
return task.getTask_id(); return task.getTask_id();
} }
@Override @Override
@Transactional
public void forceFinish(String taskId) { public void forceFinish(String taskId) {
SchBaseTask schBaseTask = taskService.getOne(new LambdaUpdateWrapper<SchBaseTask>() SchBaseTask schBaseTask = taskService.getOne(new LambdaUpdateWrapper<SchBaseTask>()
.eq(SchBaseTask::getTask_id, taskId), false); .eq(SchBaseTask::getTask_id, taskId), false);
if (schBaseTask == null) { if (schBaseTask == null) {
throw new BadRequestException("满轴缓存位 -> 管制区强制完成接口任务号为空!"); throw new BadRequestException("满轴缓存位 -> 管制区强制完成接口任务号为空!");
} }
schBaseTask.setTask_status(TaskStatusEnum.FINISHED.getCode()); updateTaskStatus(JSONObject.parseObject(JSON.toJSONString(schBaseTask)), TaskStatusEnum.FINISHED.getCode());
schBaseTask.setUpdate_time(DateUtil.now());
schBaseTask.setUpdate_optid(SecurityUtils.getCurrentUserId());
schBaseTask.setUpdate_optname(SecurityUtils.getCurrentNickName());
taskService.update(schBaseTask);
} }
@Override @Override
public void cancel(String taskId) { public void cancel(String taskId) {
SchBaseTask schBaseTask = taskService.getOne(new LambdaUpdateWrapper<SchBaseTask>() SchBaseTask schBaseTask = taskService.getOne(new LambdaUpdateWrapper<SchBaseTask>()
@@ -202,7 +202,7 @@ public class GzqTask extends AbstractAcsTask {
if (schBaseTask == null) { if (schBaseTask == null) {
throw new BadRequestException("满轴缓存位 -> 管制区取消接口任务号为空!"); throw new BadRequestException("满轴缓存位 -> 管制区取消接口任务号为空!");
} }
schBaseTask.setTask_status(IOSEnum.ACS_RESULT.code("取消")); schBaseTask.setTask_status(TaskStatusEnum.CANCEL.getCode());
schBaseTask.setUpdate_time(DateUtil.now()); schBaseTask.setUpdate_time(DateUtil.now());
schBaseTask.setUpdate_optid(SecurityUtils.getCurrentUserId()); schBaseTask.setUpdate_optid(SecurityUtils.getCurrentUserId());
schBaseTask.setUpdate_optname(SecurityUtils.getCurrentNickName()); schBaseTask.setUpdate_optname(SecurityUtils.getCurrentNickName());

View File

@@ -126,8 +126,8 @@ public class KzjhcwTask extends AbstractAcsTask {
if (Integer.parseInt(schBaseTask.getTask_status()) > Integer.parseInt(TaskStatusEnum.ISSUE.getCode())) { if (Integer.parseInt(schBaseTask.getTask_status()) > Integer.parseInt(TaskStatusEnum.ISSUE.getCode())) {
throw new BadRequestException("任务已执行不能取消"); throw new BadRequestException("任务已执行不能取消");
} }
//更新任务表删除字段 //任务被标记为取消
schBaseTask.setIs_delete(IOSEnum.IS_NOTANDYES.code("")); schBaseTask.setTask_status(TaskStatusEnum.CANCEL.getCode());
} }
schBaseTask.setUpdate_time(DateUtil.now()); schBaseTask.setUpdate_time(DateUtil.now());
schBaseTask.setUpdate_optid(SecurityUtils.getCurrentUserId()); schBaseTask.setUpdate_optid(SecurityUtils.getCurrentUserId());
@@ -159,6 +159,7 @@ public class KzjhcwTask extends AbstractAcsTask {
SchBaseTaskVO schBaseTaskVo = SchBaseTaskVO.builder() SchBaseTaskVO schBaseTaskVo = SchBaseTaskVO.builder()
.task_type(taskType) .task_type(taskType)
.vehicle_code(vehicleCode) .vehicle_code(vehicleCode)
.vehicle_code2(form.getString("vehicle_code2"))
.point_code1(pointCode1) .point_code1(pointCode1)
.point_code2(pointCode2) .point_code2(pointCode2)
.point_code3(form.getString("point_code3")) .point_code3(form.getString("point_code3"))
@@ -184,20 +185,19 @@ public class KzjhcwTask extends AbstractAcsTask {
return task.getTask_id(); return task.getTask_id();
} }
@Override @Override
@Transactional
public void forceFinish(String taskId) { public void forceFinish(String taskId) {
SchBaseTask schBaseTask = taskService.getOne(new LambdaUpdateWrapper<SchBaseTask>() SchBaseTask schBaseTask = taskService.getOne(new LambdaUpdateWrapper<SchBaseTask>()
.eq(SchBaseTask::getTask_id, taskId), false); .eq(SchBaseTask::getTask_id, taskId), false);
if (schBaseTask == null) { if (schBaseTask == null) {
throw new BadRequestException("待检区或管制区 -> 空载具缓存位强制完成接口任务号为空!"); throw new BadRequestException("待检区或管制区 -> 空载具缓存位强制完成接口任务号为空!");
} }
schBaseTask.setTask_status(TaskStatusEnum.FINISHED.getCode()); updateTaskStatus(JSONObject.parseObject(JSON.toJSONString(schBaseTask)), TaskStatusEnum.FINISHED.getCode());
schBaseTask.setUpdate_time(DateUtil.now());
schBaseTask.setUpdate_optid(SecurityUtils.getCurrentUserId());
schBaseTask.setUpdate_optname(SecurityUtils.getCurrentNickName());
taskService.update(schBaseTask);
} }
@Override @Override
public void cancel(String taskId) { public void cancel(String taskId) {
SchBaseTask schBaseTask = taskService.getOne(new LambdaUpdateWrapper<SchBaseTask>() SchBaseTask schBaseTask = taskService.getOne(new LambdaUpdateWrapper<SchBaseTask>()
@@ -205,7 +205,7 @@ public class KzjhcwTask extends AbstractAcsTask {
if (schBaseTask == null) { if (schBaseTask == null) {
throw new BadRequestException("待检区或管制区 -> 空载具缓存位取消接口任务号为空!"); throw new BadRequestException("待检区或管制区 -> 空载具缓存位取消接口任务号为空!");
} }
schBaseTask.setTask_status(IOSEnum.ACS_RESULT.code("取消")); schBaseTask.setTask_status(TaskStatusEnum.CANCEL.getCode());
schBaseTask.setUpdate_time(DateUtil.now()); schBaseTask.setUpdate_time(DateUtil.now());
schBaseTask.setUpdate_optid(SecurityUtils.getCurrentUserId()); schBaseTask.setUpdate_optid(SecurityUtils.getCurrentUserId());
schBaseTask.setUpdate_optname(SecurityUtils.getCurrentNickName()); schBaseTask.setUpdate_optname(SecurityUtils.getCurrentNickName());

View File

@@ -75,7 +75,6 @@ public class MzhcwTask extends AbstractAcsTask {
private SsxDjwTask ssxDjwTask; private SsxDjwTask ssxDjwTask;
@Override @Override
public List<AcsTaskDto> addTask() { public List<AcsTaskDto> addTask() {
ArrayList<AcsTaskDto> resultList = new ArrayList<>(); ArrayList<AcsTaskDto> resultList = new ArrayList<>();
@@ -158,7 +157,7 @@ public class MzhcwTask extends AbstractAcsTask {
throw new BadRequestException("任务已执行不能取消"); throw new BadRequestException("任务已执行不能取消");
} }
// 更新任务表删除字段 // 更新任务表删除字段
schBaseTask.setIs_delete(IOSEnum.IS_NOTANDYES.code("")); schBaseTask.setTask_status(TaskStatusEnum.CANCEL.getCode());
} }
schBaseTask.setUpdate_time(DateUtil.now()); schBaseTask.setUpdate_time(DateUtil.now());
schBaseTask.setUpdate_optid(SecurityUtils.getCurrentUserId()); schBaseTask.setUpdate_optid(SecurityUtils.getCurrentUserId());
@@ -314,6 +313,7 @@ public class MzhcwTask extends AbstractAcsTask {
SchBaseTaskVO schBaseTaskVo = SchBaseTaskVO.builder() SchBaseTaskVO schBaseTaskVo = SchBaseTaskVO.builder()
.task_type(taskType) .task_type(taskType)
.vehicle_code(vehicleCode) .vehicle_code(vehicleCode)
.vehicle_code2(form.getString("vehicle_code2"))
.point_code1(pointCode1) .point_code1(pointCode1)
.point_code2(pointCode2) .point_code2(pointCode2)
.point_code3(form.getString("point_code3")) .point_code3(form.getString("point_code3"))
@@ -339,20 +339,19 @@ public class MzhcwTask extends AbstractAcsTask {
return task.getTask_id(); return task.getTask_id();
} }
@Override @Override
@Transactional
public void forceFinish(String taskId) { public void forceFinish(String taskId) {
SchBaseTask schBaseTask = taskService.getOne(new LambdaUpdateWrapper<SchBaseTask>() SchBaseTask schBaseTask = taskService.getOne(new LambdaUpdateWrapper<SchBaseTask>()
.eq(SchBaseTask::getTask_id, taskId), false); .eq(SchBaseTask::getTask_id, taskId), false);
if (schBaseTask == null) { if (schBaseTask == null) {
throw new BadRequestException("输送线点位 -> 满轴缓存位强制完成接口任务号为空!"); throw new BadRequestException("输送线点位 -> 满轴缓存位强制完成接口任务号为空!");
} }
schBaseTask.setTask_status(TaskStatusEnum.FINISHED.getCode()); updateTaskStatus(JSONObject.parseObject(JSON.toJSONString(schBaseTask)), TaskStatusEnum.FINISHED.getCode());
schBaseTask.setUpdate_time(DateUtil.now());
schBaseTask.setUpdate_optid(SecurityUtils.getCurrentUserId());
schBaseTask.setUpdate_optname(SecurityUtils.getCurrentNickName());
taskService.update(schBaseTask);
} }
@Override @Override
public void cancel(String taskId) { public void cancel(String taskId) {
SchBaseTask schBaseTask = taskService.getOne(new LambdaUpdateWrapper<SchBaseTask>() SchBaseTask schBaseTask = taskService.getOne(new LambdaUpdateWrapper<SchBaseTask>()
@@ -360,7 +359,7 @@ public class MzhcwTask extends AbstractAcsTask {
if (schBaseTask == null) { if (schBaseTask == null) {
throw new BadRequestException("输送线点位 -> 满轴缓存位取消接口任务号为空!"); throw new BadRequestException("输送线点位 -> 满轴缓存位取消接口任务号为空!");
} }
schBaseTask.setTask_status(IOSEnum.ACS_RESULT.code("取消")); schBaseTask.setTask_status(TaskStatusEnum.CANCEL.getCode());
schBaseTask.setUpdate_time(DateUtil.now()); schBaseTask.setUpdate_time(DateUtil.now());
schBaseTask.setUpdate_optid(SecurityUtils.getCurrentUserId()); schBaseTask.setUpdate_optid(SecurityUtils.getCurrentUserId());
schBaseTask.setUpdate_optname(SecurityUtils.getCurrentNickName()); schBaseTask.setUpdate_optname(SecurityUtils.getCurrentNickName());

View File

@@ -99,8 +99,8 @@ public class SendKzjTask extends AbstractAcsTask {
if (Integer.parseInt(schBaseTask.getTask_status()) > Integer.parseInt(TaskStatusEnum.ISSUE.getCode())) { if (Integer.parseInt(schBaseTask.getTask_status()) > Integer.parseInt(TaskStatusEnum.ISSUE.getCode())) {
throw new BadRequestException("任务已执行不能取消"); throw new BadRequestException("任务已执行不能取消");
} }
//更新任务表删除字段 //任务被标记为取消
schBaseTask.setIs_delete(IOSEnum.IS_NOTANDYES.code("")); schBaseTask.setTask_status(TaskStatusEnum.CANCEL.getCode());
} }
schBaseTask.setUpdate_time(DateUtil.now()); schBaseTask.setUpdate_time(DateUtil.now());
schBaseTask.setUpdate_optid(SecurityUtils.getCurrentUserId()); schBaseTask.setUpdate_optid(SecurityUtils.getCurrentUserId());
@@ -131,7 +131,8 @@ public class SendKzjTask extends AbstractAcsTask {
boolean isSend = !StrUtil.isNotBlank(form.getString("is_send")) || BooleanUtil.toBoolean(form.getString("is_send")); boolean isSend = !StrUtil.isNotBlank(form.getString("is_send")) || BooleanUtil.toBoolean(form.getString("is_send"));
SchBaseTaskVO schBaseTaskVo = SchBaseTaskVO.builder() SchBaseTaskVO schBaseTaskVo = SchBaseTaskVO.builder()
.task_type(taskType) .task_type(taskType)
.vehicle_code(vehicleCode) .vehicle_code(vehicleCode)
.vehicle_code2(form.getString("vehicle_code2"))
.point_code1(pointCode1) .point_code1(pointCode1)
.point_code2(pointCode2) .point_code2(pointCode2)
.point_code3(form.getString("point_code3")) .point_code3(form.getString("point_code3"))
@@ -159,19 +160,17 @@ public class SendKzjTask extends AbstractAcsTask {
@Override @Override
@Transactional
public void forceFinish(String taskId) { public void forceFinish(String taskId) {
SchBaseTask schBaseTask = taskService.getOne(new LambdaUpdateWrapper<SchBaseTask>() SchBaseTask schBaseTask = taskService.getOne(new LambdaUpdateWrapper<SchBaseTask>()
.eq(SchBaseTask::getTask_id, taskId), false); .eq(SchBaseTask::getTask_id, taskId), false);
if (schBaseTask == null) { if (schBaseTask == null) {
throw new BadRequestException("装箱区->待检区或管制区送空载具强制完成接口任务号为空!"); throw new BadRequestException("装箱区->待检区或管制区送空载具强制完成接口任务号为空!");
} }
schBaseTask.setTask_status(TaskStatusEnum.FINISHED.getCode()); updateTaskStatus(JSONObject.parseObject(JSON.toJSONString(schBaseTask)), TaskStatusEnum.FINISHED.getCode());
schBaseTask.setUpdate_time(DateUtil.now());
schBaseTask.setUpdate_optid(SecurityUtils.getCurrentUserId());
schBaseTask.setUpdate_optname(SecurityUtils.getCurrentNickName());
taskService.update(schBaseTask);
} }
@Override @Override
public void cancel(String taskId) { public void cancel(String taskId) {
SchBaseTask schBaseTask = taskService.getOne(new LambdaUpdateWrapper<SchBaseTask>() SchBaseTask schBaseTask = taskService.getOne(new LambdaUpdateWrapper<SchBaseTask>()
@@ -179,7 +178,7 @@ public class SendKzjTask extends AbstractAcsTask {
if (schBaseTask == null) { if (schBaseTask == null) {
throw new BadRequestException("装箱区->待检区或管制区送空载具取消接口任务号为空!"); throw new BadRequestException("装箱区->待检区或管制区送空载具取消接口任务号为空!");
} }
schBaseTask.setTask_status(IOSEnum.ACS_RESULT.code("取消")); schBaseTask.setTask_status(TaskStatusEnum.CANCEL.getCode());
schBaseTask.setUpdate_time(DateUtil.now()); schBaseTask.setUpdate_time(DateUtil.now());
schBaseTask.setUpdate_optid(SecurityUtils.getCurrentUserId()); schBaseTask.setUpdate_optid(SecurityUtils.getCurrentUserId());
schBaseTask.setUpdate_optname(SecurityUtils.getCurrentNickName()); schBaseTask.setUpdate_optname(SecurityUtils.getCurrentNickName());

View File

@@ -117,8 +117,9 @@ public class SsxDjwTask extends AbstractAcsTask {
if (Integer.parseInt(schBaseTask.getTask_status()) > Integer.parseInt(TaskStatusEnum.ISSUE.getCode())) { if (Integer.parseInt(schBaseTask.getTask_status()) > Integer.parseInt(TaskStatusEnum.ISSUE.getCode())) {
throw new BadRequestException("任务已执行不能取消"); throw new BadRequestException("任务已执行不能取消");
} }
//更新任务表删除字段 //任务被标记为取消
schBaseTask.setIs_delete(IOSEnum.IS_NOTANDYES.code("")); schBaseTask.setTask_status(TaskStatusEnum.CANCEL.getCode());
schBaseTask.setTask_status(TaskStatusEnum.CANCEL.getCode());
} }
schBaseTask.setUpdate_time(DateUtil.now()); schBaseTask.setUpdate_time(DateUtil.now());
schBaseTask.setUpdate_optid(SecurityUtils.getCurrentUserId()); schBaseTask.setUpdate_optid(SecurityUtils.getCurrentUserId());
@@ -150,6 +151,7 @@ public class SsxDjwTask extends AbstractAcsTask {
SchBaseTaskVO schBaseTaskVo = SchBaseTaskVO.builder() SchBaseTaskVO schBaseTaskVo = SchBaseTaskVO.builder()
.task_type(taskType) .task_type(taskType)
.vehicle_code(vehicleCode) .vehicle_code(vehicleCode)
.vehicle_code2(form.getString("vehicle_code2"))
.point_code1(pointCode1) .point_code1(pointCode1)
.point_code2(pointCode2) .point_code2(pointCode2)
.point_code3(form.getString("point_code3")) .point_code3(form.getString("point_code3"))
@@ -176,17 +178,14 @@ public class SsxDjwTask extends AbstractAcsTask {
} }
@Override @Override
@Transactional
public void forceFinish(String taskId) { public void forceFinish(String taskId) {
SchBaseTask schBaseTask = taskService.getOne(new LambdaUpdateWrapper<SchBaseTask>() SchBaseTask schBaseTask = taskService.getOne(new LambdaUpdateWrapper<SchBaseTask>()
.eq(SchBaseTask::getTask_id, taskId), false) ; .eq(SchBaseTask::getTask_id, taskId), false);
if (schBaseTask == null) { if (schBaseTask == null) {
throw new BadRequestException("空载具缓存位 -> 输送线强制完成接口任务号为空!"); throw new BadRequestException("空载具缓存位 -> 输送线强制完成接口任务号为空!");
} }
schBaseTask.setTask_status(TaskStatusEnum.FINISHED.getCode()); updateTaskStatus(JSONObject.parseObject(JSON.toJSONString(schBaseTask)), TaskStatusEnum.FINISHED.getCode());
schBaseTask.setUpdate_time(DateUtil.now());
schBaseTask.setUpdate_optid(SecurityUtils.getCurrentUserId());
schBaseTask.setUpdate_optname(SecurityUtils.getCurrentNickName());
taskService.update(schBaseTask);
} }
@Override @Override
@@ -196,7 +195,7 @@ public class SsxDjwTask extends AbstractAcsTask {
if (schBaseTask == null) { if (schBaseTask == null) {
throw new BadRequestException("空载具缓存位 -> 输送线取消接口任务号为空!"); throw new BadRequestException("空载具缓存位 -> 输送线取消接口任务号为空!");
} }
schBaseTask.setTask_status(IOSEnum.ACS_RESULT.code("取消")); schBaseTask.setTask_status(TaskStatusEnum.CANCEL.getCode());
schBaseTask.setUpdate_time(DateUtil.now()); schBaseTask.setUpdate_time(DateUtil.now());
schBaseTask.setUpdate_optid(SecurityUtils.getCurrentUserId()); schBaseTask.setUpdate_optid(SecurityUtils.getCurrentUserId());
schBaseTask.setUpdate_optname(SecurityUtils.getCurrentNickName()); schBaseTask.setUpdate_optname(SecurityUtils.getCurrentNickName());

View File

@@ -122,7 +122,7 @@ public class ZxDjwTask extends AbstractAcsTask {
//2.改变起点点位状态 //2.改变起点点位状态
packageinfoivtService.update(new UpdateWrapper<BstIvtPackageinfoivt>().set("ivt_status", PackageInfoIvtEnum.IVT_STATUS.code("空载具")).set("container_name", null).eq("point_code", schBaseTask.getPoint_code1())); packageinfoivtService.update(new UpdateWrapper<BstIvtPackageinfoivt>().set("ivt_status", PackageInfoIvtEnum.IVT_STATUS.code("空载具")).set("container_name", null).eq("point_code", schBaseTask.getPoint_code1()));
//更新库存记录 //更新库存记录
packageinfoivtService.update(new UpdateWrapper<BstIvtPackageinfoivt>().set("ivt_status", PackageInfoIvtEnum.IVT_STATUS.code("有子卷")).set("container_name", schBaseTask.getVehicle_code()).eq("point_code", schBaseTask.getPoint_code2())); packageinfoivtService.update(new UpdateWrapper<BstIvtPackageinfoivt>().set("ivt_status", PackageInfoIvtEnum.IVT_STATUS.code("")).set("container_name", null).eq("point_code", schBaseTask.getPoint_code2()));
//3.更改子卷信息状态为包装1创建装箱区->装箱位桁架任务的时候判断是否最后一个子卷相同木箱号如果生成状态0个数等于1且子卷号等于当前载具号就是最后一个子卷 //3.更改子卷信息状态为包装1创建装箱区->装箱位桁架任务的时候判断是否最后一个子卷相同木箱号如果生成状态0个数等于1且子卷号等于当前载具号就是最后一个子卷
PdmBiSubpackagerelation pdmBiSubpackagerelation = subpackageRelationService PdmBiSubpackagerelation pdmBiSubpackagerelation = subpackageRelationService
.getOne(new LambdaUpdateWrapper<PdmBiSubpackagerelation>().eq(PdmBiSubpackagerelation::getContainer_name, schBaseTask.getVehicle_code()), false); .getOne(new LambdaUpdateWrapper<PdmBiSubpackagerelation>().eq(PdmBiSubpackagerelation::getContainer_name, schBaseTask.getVehicle_code()), false);
@@ -131,7 +131,10 @@ public class ZxDjwTask extends AbstractAcsTask {
//4.查询同一个木箱号如果生成状态0个数等于0更新该木箱信息表为包装1 //4.查询同一个木箱号如果生成状态0个数等于0更新该木箱信息表为包装1
List<PdmBiSubpackagerelation> packagerelationList = subpackageRelationService.list(new LambdaQueryWrapper<PdmBiSubpackagerelation>().eq(PdmBiSubpackagerelation::getPackage_box_sn, schBaseTask.getVehicle_code2()).eq(PdmBiSubpackagerelation::getStatus, "0")); List<PdmBiSubpackagerelation> packagerelationList = subpackageRelationService.list(new LambdaQueryWrapper<PdmBiSubpackagerelation>().eq(PdmBiSubpackagerelation::getPackage_box_sn, schBaseTask.getVehicle_code2()).eq(PdmBiSubpackagerelation::getStatus, "0"));
if (CollectionUtils.isEmpty(packagerelationList)) { if (CollectionUtils.isEmpty(packagerelationList)) {
BstIvtBoxinfo bstIvtBoxinfo = bstIvtBoxinfoMapper.selectOne(new LambdaQueryWrapper<BstIvtBoxinfo>().eq(BstIvtBoxinfo::getBox_no, schBaseTask.getVehicle_code2()).eq(BstIvtBoxinfo::getIs_packing, null)); BstIvtBoxinfo bstIvtBoxinfo = bstIvtBoxinfoMapper.selectOne(new LambdaQueryWrapper<BstIvtBoxinfo>().eq(BstIvtBoxinfo::getBox_no, schBaseTask.getVehicle_code2()).ne(BstIvtBoxinfo::getIs_packing, "1"));
if (bstIvtBoxinfo == null) {
throw new BadRequestException("找不到该木箱信息!");
}
bstIvtBoxinfo.setIs_packing("1"); bstIvtBoxinfo.setIs_packing("1");
bstIvtBoxinfoMapper.updateById(bstIvtBoxinfo); bstIvtBoxinfoMapper.updateById(bstIvtBoxinfo);
} }
@@ -143,9 +146,10 @@ public class ZxDjwTask extends AbstractAcsTask {
if (Integer.parseInt(schBaseTask.getTask_status()) > Integer.parseInt(TaskStatusEnum.ISSUE.getCode())) { if (Integer.parseInt(schBaseTask.getTask_status()) > Integer.parseInt(TaskStatusEnum.ISSUE.getCode())) {
throw new BadRequestException("任务已执行不能取消"); throw new BadRequestException("任务已执行不能取消");
} }
//更新任务表删除字段 //任务被标记为取消
schBaseTask.setIs_delete(IOSEnum.IS_NOTANDYES.code("")); schBaseTask.setTask_status(TaskStatusEnum.CANCEL.getCode());
} }
schBaseTask.setRemark("任务被强制取消,不执行任何逻辑!");
schBaseTask.setUpdate_time(DateUtil.now()); schBaseTask.setUpdate_time(DateUtil.now());
schBaseTask.setUpdate_optid(SecurityUtils.getCurrentUserId()); schBaseTask.setUpdate_optid(SecurityUtils.getCurrentUserId());
schBaseTask.setUpdate_optname(SecurityUtils.getCurrentNickName()); schBaseTask.setUpdate_optname(SecurityUtils.getCurrentNickName());
@@ -153,9 +157,6 @@ public class ZxDjwTask extends AbstractAcsTask {
} }
@Override @Override
public String createTask(JSONObject form) { public String createTask(JSONObject form) {
Assert.notNull(form, "请求参数不能为空"); Assert.notNull(form, "请求参数不能为空");
@@ -179,9 +180,10 @@ public class ZxDjwTask extends AbstractAcsTask {
boolean isSend = !StrUtil.isNotBlank(form.getString("is_send")) || BooleanUtil.toBoolean(form.getString("is_send")); boolean isSend = !StrUtil.isNotBlank(form.getString("is_send")) || BooleanUtil.toBoolean(form.getString("is_send"));
SchBaseTaskVO schBaseTaskVo = SchBaseTaskVO.builder() SchBaseTaskVO schBaseTaskVo = SchBaseTaskVO.builder()
.task_type(taskType) .task_type(taskType)
.vehicle_code(vehicleCode)
.point_code1(pointCode1) .point_code1(pointCode1)
.point_code2(pointCode2) .point_code2(pointCode2)
.vehicle_code(vehicleCode)
.vehicle_code2(form.getString("vehicle_code2"))
.point_code3(form.getString("point_code3")) .point_code3(form.getString("point_code3"))
.point_code4(form.getString("point_code4")) .point_code4(form.getString("point_code4"))
.request_param(form.getString("request_param")) .request_param(form.getString("request_param"))
@@ -208,17 +210,14 @@ public class ZxDjwTask extends AbstractAcsTask {
@Override @Override
@Transactional(rollbackFor = Exception.class)
public void forceFinish(String taskId) { public void forceFinish(String taskId) {
SchBaseTask schBaseTask = taskService.getOne(new LambdaUpdateWrapper<SchBaseTask>() SchBaseTask schBaseTask = taskService.getOne(new LambdaUpdateWrapper<SchBaseTask>()
.eq(SchBaseTask::getTask_id, taskId), false); .eq(SchBaseTask::getTask_id, taskId), false);
if (schBaseTask == null) { if (schBaseTask == null) {
throw new BadRequestException("装箱区 -> 装箱对接位强制完成接口任务号为空!"); throw new BadRequestException("装箱区 -> 装箱对接位强制完成接口任务号为空!");
} }
schBaseTask.setTask_status(TaskStatusEnum.FINISHED.getCode()); updateTaskStatus(JSONObject.parseObject(JSON.toJSONString(schBaseTask)), TaskStatusEnum.FINISHED.getCode());
schBaseTask.setUpdate_time(DateUtil.now());
schBaseTask.setUpdate_optid(SecurityUtils.getCurrentUserId());
schBaseTask.setUpdate_optname(SecurityUtils.getCurrentNickName());
taskService.update(schBaseTask);
} }
@Override @Override
@@ -228,10 +227,11 @@ public class ZxDjwTask extends AbstractAcsTask {
if (schBaseTask == null) { if (schBaseTask == null) {
throw new BadRequestException("装箱区 -> 装箱对接位取消接口任务号为空!"); throw new BadRequestException("装箱区 -> 装箱对接位取消接口任务号为空!");
} }
schBaseTask.setTask_status(IOSEnum.ACS_RESULT.code("取消")); schBaseTask.setTask_status(TaskStatusEnum.CANCEL.getCode());
schBaseTask.setUpdate_time(DateUtil.now()); schBaseTask.setUpdate_time(DateUtil.now());
schBaseTask.setUpdate_optid(SecurityUtils.getCurrentUserId()); schBaseTask.setUpdate_optid(SecurityUtils.getCurrentUserId());
schBaseTask.setUpdate_optname(SecurityUtils.getCurrentNickName()); schBaseTask.setUpdate_optname(SecurityUtils.getCurrentNickName());
schBaseTask.setRemark("任务被强制取消,不执行任何逻辑!");
taskService.update(schBaseTask); taskService.update(schBaseTask);
} }
} }

View File

@@ -78,55 +78,6 @@ public class ZxqTask extends AbstractAcsTask {
private final String THIS_CLASS = ZxqTask.class.getName(); private final String THIS_CLASS = ZxqTask.class.getName();
public SchBaseTask dynamicCreateTask(JSONObject form) {
Assert.notNull(form, "请求参数不能为空");
String taskType = form.getString("task_type");
if (StrUtil.isBlank(taskType)) {
throw new BadRequestException("业务类型不能为空");
}
String vehicleCode = form.getString("vehicle_code");
if (StrUtil.isBlank(vehicleCode)) {
throw new BadRequestException("载具号不能为空");
}
String pointCode1 = form.getString("point_code1");
if (StrUtil.isBlank(pointCode1)) {
throw new BadRequestException("起点不能为空");
}
String pointCode2 = form.getString("point_code2");
if (StrUtil.isBlank(pointCode2)) {
throw new BadRequestException("下一点不能为空");
}
//是否立即下发
boolean isSend = !StrUtil.isNotBlank(form.getString("is_send")) || BooleanUtil.toBoolean(form.getString("is_send"));
SchBaseTaskVO schBaseTaskVo = SchBaseTaskVO.builder()
.task_type(taskType)
.vehicle_code(vehicleCode)
.point_code1(pointCode1)
.point_code2(pointCode2)
.point_code3(form.getString("point_code3"))
.point_code4(form.getString("point_code4"))
.task_id(org.nl.common.utils.IdUtil.getStringId())
.task_code(org.nl.common.utils.IdUtil.getStringId())
.handle_class(THIS_CLASS)
.create_id(SecurityUtils.getCurrentUserId())
.create_name(SecurityUtils.getCurrentUsername())
.create_time(DateUtil.now())
.is_send(isSend ? "1" : "0")
.request_param(form.getString("request_param"))
.acs_task_type(StrUtil.isEmpty(form.getString("acs_task_type")) ? PackageInfoIvtEnum.ACS_TASK_TYPE.code("agv任务") : form.getString("acs_task_type"))
.task_status(StrUtil.isEmpty(form.getString("task_status")) ? TaskStatusEnum.START_AND_POINT.getCode() : form.getString("task_status"))
.product_area(StrUtil.isEmpty(form.getString("product_area")) ? "B2" : form.getString("product_area"))
.build();
SchBaseTask task = new SchBaseTask();
BeanUtils.copyProperties(schBaseTaskVo, task);
taskService.save(task);
//如果目标点位没有空位先创建不下发
if (isSend) {
this.immediateNotifyAcs(null);
}
return task;
}
@Override @Override
public List<AcsTaskDto> addTask() { public List<AcsTaskDto> addTask() {
ArrayList<AcsTaskDto> resultList = new ArrayList<>(); ArrayList<AcsTaskDto> resultList = new ArrayList<>();
@@ -190,8 +141,8 @@ public class ZxqTask extends AbstractAcsTask {
if (Integer.parseInt(schBaseTask.getTask_status()) > Integer.parseInt(TaskStatusEnum.ISSUE.getCode())) { if (Integer.parseInt(schBaseTask.getTask_status()) > Integer.parseInt(TaskStatusEnum.ISSUE.getCode())) {
throw new BadRequestException("任务已执行不能取消"); throw new BadRequestException("任务已执行不能取消");
} }
//更新任务表删除字段 //任务被标记为取消
schBaseTask.setIs_delete(IOSEnum.IS_NOTANDYES.code("")); schBaseTask.setTask_status(TaskStatusEnum.CANCEL.getCode());
} }
schBaseTask.setUpdate_time(DateUtil.now()); schBaseTask.setUpdate_time(DateUtil.now());
schBaseTask.setUpdate_optid(SecurityUtils.getCurrentUserId()); schBaseTask.setUpdate_optid(SecurityUtils.getCurrentUserId());
@@ -237,9 +188,9 @@ public class ZxqTask extends AbstractAcsTask {
//扩展参数 //扩展参数
JSONObject param = new JSONObject(); JSONObject param = new JSONObject();
//获取木箱信息,未包装的木箱 //获取木箱信息,未包装的木箱
BstIvtBoxinfo bstIvtBoxinfo = bstIvtBoxinfoMapper.selectOne(new LambdaQueryWrapper<BstIvtBoxinfo>().eq(BstIvtBoxinfo::getBox_no, schBaseTask.getVehicle_code2()).eq(BstIvtBoxinfo::getIs_packing, null)); BstIvtBoxinfo bstIvtBoxinfo = bstIvtBoxinfoMapper.selectOne(new LambdaQueryWrapper<BstIvtBoxinfo>().eq(BstIvtBoxinfo::getBox_no, schBaseTask.getVehicle_code2()).ne(BstIvtBoxinfo::getIs_packing, "1"));
if (bstIvtBoxinfo == null) { if (bstIvtBoxinfo == null) {
throw new BadRequestException("找不到木箱信息!"); throw new BadRequestException("找不到木箱信息!");
} }
//获取木箱高度等级 //获取木箱高度等级
String height = ""; String height = "";
@@ -296,14 +247,15 @@ public class ZxqTask extends AbstractAcsTask {
throw new BadRequestException("起点不能为空"); throw new BadRequestException("起点不能为空");
} }
String pointCode2 = form.getString("point_code2"); String pointCode2 = form.getString("point_code2");
if (StrUtil.isBlank(pointCode2)) { // if (StrUtil.isBlank(pointCode2)) {
throw new BadRequestException("下一点不能为空"); // throw new BadRequestException("下一点不能为空");
} // }
//是否立即下发 //是否立即下发
boolean isSend = !StrUtil.isNotBlank(form.getString("is_send")) || BooleanUtil.toBoolean(form.getString("is_send")); boolean isSend = !StrUtil.isNotBlank(form.getString("is_send")) || BooleanUtil.toBoolean(form.getString("is_send"));
SchBaseTaskVO schBaseTaskVo = SchBaseTaskVO.builder() SchBaseTaskVO schBaseTaskVo = SchBaseTaskVO.builder()
.task_type(taskType) .task_type(taskType)
.vehicle_code(vehicleCode) .vehicle_code(vehicleCode)
.vehicle_code2(form.getString("vehicle_code2"))
.point_code1(pointCode1) .point_code1(pointCode1)
.point_code2(pointCode2) .point_code2(pointCode2)
.point_code3(form.getString("point_code3")) .point_code3(form.getString("point_code3"))
@@ -331,17 +283,14 @@ public class ZxqTask extends AbstractAcsTask {
} }
@Override @Override
@Transactional
public void forceFinish(String taskId) { public void forceFinish(String taskId) {
SchBaseTask schBaseTask = taskService.getOne(new LambdaUpdateWrapper<SchBaseTask>() SchBaseTask schBaseTask = taskService.getOne(new LambdaUpdateWrapper<SchBaseTask>()
.eq(SchBaseTask::getTask_id, taskId), false); .eq(SchBaseTask::getTask_id, taskId), false);
if (schBaseTask == null) { if (schBaseTask == null) {
throw new BadRequestException("待检区 -> 装箱区强制完成接口任务号为空!"); throw new BadRequestException("待检区 -> 装箱区强制完成接口任务号为空!");
} }
schBaseTask.setTask_status(TaskStatusEnum.FINISHED.getCode()); updateTaskStatus(JSONObject.parseObject(JSON.toJSONString(schBaseTask)), TaskStatusEnum.FINISHED.getCode());
schBaseTask.setUpdate_time(DateUtil.now());
schBaseTask.setUpdate_optid(SecurityUtils.getCurrentUserId());
schBaseTask.setUpdate_optname(SecurityUtils.getCurrentNickName());
taskService.update(schBaseTask);
} }
@Override @Override
@@ -351,7 +300,7 @@ public class ZxqTask extends AbstractAcsTask {
if (schBaseTask == null) { if (schBaseTask == null) {
throw new BadRequestException("待检区 -> 装箱区取消接口任务号为空!"); throw new BadRequestException("待检区 -> 装箱区取消接口任务号为空!");
} }
schBaseTask.setTask_status(IOSEnum.ACS_RESULT.code("取消")); schBaseTask.setTask_status(TaskStatusEnum.CANCEL.getCode());
schBaseTask.setUpdate_time(DateUtil.now()); schBaseTask.setUpdate_time(DateUtil.now());
schBaseTask.setUpdate_optid(SecurityUtils.getCurrentUserId()); schBaseTask.setUpdate_optid(SecurityUtils.getCurrentUserId());
schBaseTask.setUpdate_optname(SecurityUtils.getCurrentNickName()); schBaseTask.setUpdate_optname(SecurityUtils.getCurrentNickName());

View File

@@ -6,7 +6,6 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.nl.b_lms.sch.point.dao.BstIvtPackageinfoivt; import org.nl.b_lms.sch.point.dao.BstIvtPackageinfoivt;
import org.nl.b_lms.sch.point.service.IbstIvtPackageinfoivtService; import org.nl.b_lms.sch.point.service.IbstIvtPackageinfoivtService;
import org.nl.b_lms.sch.tasks.first_floor_area.DjqTask;
import org.nl.b_lms.sch.tasks.first_floor_area.ZxqTask; import org.nl.b_lms.sch.tasks.first_floor_area.ZxqTask;
import org.nl.common.enums.PackageInfoIvtEnum; import org.nl.common.enums.PackageInfoIvtEnum;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
@@ -28,13 +27,16 @@ public class AutoSendToZxq {
private IbstIvtPackageinfoivtService packageinfoivtService; private IbstIvtPackageinfoivtService packageinfoivtService;
@Resource @Resource
private ZxqTask zxqTask; private ZxqTask zxqTask;
@Resource
private TaskQueueManager taskQueueManager;
@Resource
private TaskQueue taskQueue;
//待检区->装箱区agv自动搬运任务 //待检区->装箱区agv自动搬运任务
public void run() { public void run() {
this.sendDjqToZxq(); this.sendDjqToZxq();
} }
void sendDjqToZxq() { void sendDjqToZxq1() {
JSONObject toDjqTask =new JSONObject(); JSONObject toDjqTask =new JSONObject();
//待检区有子卷且没有未完成任务 //待检区有子卷且没有未完成任务
List<BstIvtPackageinfoivt> djqPackageinfoivtList = packageinfoivtService.checkEndPointTask(PackageInfoIvtEnum.POINT_STATUS.code("待检区"), PackageInfoIvtEnum.IVT_STATUS.code("有子卷"), "1",""); List<BstIvtPackageinfoivt> djqPackageinfoivtList = packageinfoivtService.checkEndPointTask(PackageInfoIvtEnum.POINT_STATUS.code("待检区"), PackageInfoIvtEnum.IVT_STATUS.code("有子卷"), "1","");
@@ -49,18 +51,21 @@ public class AutoSendToZxq {
} }
void sendDjqToZxq1() { public void sendDjqToZxq() {
//装箱区有空位 //装箱区有空位,去待检区消费合格品子卷
List<BstIvtPackageinfoivt> bstIvtPackageinfoivtList = packageinfoivtService.checkEndPointTask(PackageInfoIvtEnum.POINT_STATUS.code("装箱区"), PackageInfoIvtEnum.IVT_STATUS.code(""),"2",""); List<BstIvtPackageinfoivt> bstIvtPackageinfoivtList = packageinfoivtService.checkEndPointTask(
PackageInfoIvtEnum.POINT_STATUS.code("装箱区"),
PackageInfoIvtEnum.IVT_STATUS.code(""),"2","");
if (CollectionUtils.isNotEmpty(bstIvtPackageinfoivtList)) { if (CollectionUtils.isNotEmpty(bstIvtPackageinfoivtList)) {
Map<String, List<String>> ivtList = bstIvtPackageinfoivtList.stream() Map<String, List<String>> ivtList = bstIvtPackageinfoivtList.stream()
.collect(Collectors.groupingBy( .collect(Collectors.groupingBy(
BstIvtPackageinfoivt::getPoint_code, BstIvtPackageinfoivt::getBlock,
LinkedHashMap::new, LinkedHashMap::new,
Collectors.mapping(BstIvtPackageinfoivt::getPoint_name, Collectors.toList()) Collectors.mapping(BstIvtPackageinfoivt::getPoint_code, Collectors.toList())
)); ));
TaskQueueManager taskQueueManager =new TaskQueueManager(); //taskQueueManager.processTasks(ivtList);
taskQueueManager.processTasks(ivtList); taskQueue.processTasks(ivtList);
} }
} }
} }

View File

@@ -67,8 +67,9 @@ public class AutoSendZxToDjw {
if (pdmBiSubpackagerelation == null) { if (pdmBiSubpackagerelation == null) {
throw new BadRequestException("装箱位木箱号无对应子卷包装关系的木箱号!"); throw new BadRequestException("装箱位木箱号无对应子卷包装关系的木箱号!");
} }
String containerName = pdmBiSubpackagerelation.getContainer_name(); //装箱位上的木箱号
String boxNo = zxwPackageinfoivtList.get(0).getContainer_name(); String boxNo = zxwPackageinfoivtList.get(0).getContainer_name();
String containerName = pdmBiSubpackagerelation.getContainer_name();
List<BstIvtPackageinfoivt> zxqPoint = zxqPackageinfoivtList.stream().filter(r -> r.getContainer_name().equals(containerName)).collect(Collectors.toList()); List<BstIvtPackageinfoivt> zxqPoint = zxqPackageinfoivtList.stream().filter(r -> r.getContainer_name().equals(containerName)).collect(Collectors.toList());
if (CollectionUtils.isEmpty(zxqPoint)) { if (CollectionUtils.isEmpty(zxqPoint)) {
throw new BadRequestException("装箱区暂无该子卷信息"); throw new BadRequestException("装箱区暂无该子卷信息");
@@ -84,6 +85,7 @@ public class AutoSendZxToDjw {
jo.put("point_code1", zxqPoint.get(0).getPoint_code()); jo.put("point_code1", zxqPoint.get(0).getPoint_code());
jo.put("point_code2", zxwPackageinfoivtList.get(0).getPoint_code()); jo.put("point_code2", zxwPackageinfoivtList.get(0).getPoint_code());
jo.put("vehicle_code", pdmBiSubpackagerelation.getContainer_name()); jo.put("vehicle_code", pdmBiSubpackagerelation.getContainer_name());
jo.put("vehicle_code2", boxNo);
jo.put("is_send", "1"); jo.put("is_send", "1");
//获取纸管长度 //获取纸管长度
String containerLength = productionPlanList.get(0).getPaper_tube_or_FRP().equals("1") ? productionPlanList.get(0).getPaper_tube_description() : productionPlanList.get(0).getFRP_description(); String containerLength = productionPlanList.get(0).getPaper_tube_or_FRP().equals("1") ? productionPlanList.get(0).getPaper_tube_description() : productionPlanList.get(0).getFRP_description();
@@ -100,8 +102,7 @@ public class AutoSendZxToDjw {
//扩展参数 //扩展参数
JSONObject param = new JSONObject(); JSONObject param = new JSONObject();
//获取木箱信息,未包装的木箱 //获取木箱信息,未包装的木箱
// BstIvtBoxinfo bstIvtBoxinfo = bstIvtBoxinfoMapper.selectOne(new LambdaQueryWrapper<BstIvtBoxinfo>().eq(BstIvtBoxinfo::getBox_no,boxNo).eq(BstIvtBoxinfo::getIs_packing, null)); BstIvtBoxinfo bstIvtBoxinfo = bstIvtBoxinfoMapper.selectOne(new LambdaQueryWrapper<BstIvtBoxinfo>().eq(BstIvtBoxinfo::getBox_no, boxNo).ne(BstIvtBoxinfo::getIs_packing, "1"));
BstIvtBoxinfo bstIvtBoxinfo = bstIvtBoxinfoMapper.selectOne(new LambdaQueryWrapper<BstIvtBoxinfo>().eq(BstIvtBoxinfo::getBox_no, boxNo));
if (bstIvtBoxinfo == null) { if (bstIvtBoxinfo == null) {
throw new BadRequestException("找不到木箱信息!"); throw new BadRequestException("找不到木箱信息!");
} }

View File

@@ -0,0 +1,50 @@
package org.nl.b_lms.sch.tasks.first_floor_area.auto;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.nl.b_lms.sch.task.dao.SchBaseTask;
import org.nl.b_lms.sch.task.service.IschBaseTaskService;
import org.nl.b_lms.sch.tasks.first_floor_area.ZxqTask;
import org.nl.modules.common.utils.RedisUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
@Service
@RequiredArgsConstructor
@Slf4j
public class TaskQueue {
@Resource
private IschBaseTaskService taskService;
private final RedisUtils redisUtils;
private static final String TASK_QUEUE_PREFIX = "taskQueue:";
public void addTasksToQueue(String groupId, List<SchBaseTask> tasks) {
tasks.forEach(task -> redisUtils.pushToList(TASK_QUEUE_PREFIX + groupId, task));
}
public void processTasks(Map<String, List<String>> tasksToProcessPerQueue) {
tasksToProcessPerQueue.forEach((groupId, points) -> {
int taskCount = points.size();
for (int i = 0; i < taskCount; i++) {
SchBaseTask task = (SchBaseTask) redisUtils.popFromList(TASK_QUEUE_PREFIX + groupId, SchBaseTask.class);
if (task != null) {
String pointCode = points.get(i);
executeTask(task, pointCode);
}
}
});
}
private void executeTask(SchBaseTask task, String pointCode) {
if (task != null) {
task.setPoint_code2(pointCode);
taskService.updateById(task);
ZxqTask taskBean = new ZxqTask();
taskBean.immediateNotifyAcs(null);
}
}
}

View File

@@ -1,17 +1,14 @@
package org.nl.b_lms.sch.tasks.first_floor_area.auto; package org.nl.b_lms.sch.tasks.first_floor_area.auto;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.nl.b_lms.sch.task.dao.SchBaseTask; import org.nl.b_lms.sch.task.dao.SchBaseTask;
import org.nl.b_lms.sch.task.service.IschBaseTaskService; import org.nl.b_lms.sch.task.service.IschBaseTaskService;
import org.nl.b_lms.sch.tasks.first_floor_area.ZxqTask; import org.nl.b_lms.sch.tasks.first_floor_area.ZxqTask;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.*; import java.util.*;
@Service() @Service
@RequiredArgsConstructor @RequiredArgsConstructor
@Slf4j @Slf4j
public class TaskQueueManager { public class TaskQueueManager {
@@ -25,22 +22,15 @@ public class TaskQueueManager {
taskGroupQueues = new HashMap<>(); taskGroupQueues = new HashMap<>();
} }
public void addTasksToQueue(String groupId, List<SchBaseTask> tasks) {
public void addTasksToQueue(String groupIdentifier, List<SchBaseTask> tasks) { if (!taskGroupQueues.containsKey(groupId)) {
if (!taskGroupQueues.containsKey(groupIdentifier)) { taskGroupQueues.put(groupId, new LinkedList<>());
taskGroupQueues.put(groupIdentifier, new LinkedList<>());
} }
Queue<SchBaseTask> queue = taskGroupQueues.get(groupIdentifier); Queue<SchBaseTask> queue = taskGroupQueues.get(groupId);
queue.addAll(tasks); queue.addAll(tasks);
} }
public void processTasks(Map<String, List<String>> tasksToProcessPerQueue) { public void processTasks(Map<String, List<String>> tasksToProcessPerQueue) {
//队列剩余数量
// int tasksCount = taskQueueManager.taskGroupQueues.getOrDefault("Group1", new LinkedList<>()).size();
//队列为空
// boolean isEmpty = taskQueueManager.taskGroupQueues.values().stream().allMatch(Queue::isEmpty);
for (Map.Entry<String, List<String>> entry : tasksToProcessPerQueue.entrySet()) { for (Map.Entry<String, List<String>> entry : tasksToProcessPerQueue.entrySet()) {
String groupId = entry.getKey(); String groupId = entry.getKey();
int taskCount = entry.getValue().size(); int taskCount = entry.getValue().size();
@@ -50,26 +40,20 @@ public class TaskQueueManager {
} }
int getCount = 0; int getCount = 0;
while (!queue.isEmpty() && getCount < taskCount) { while (!queue.isEmpty() && getCount < taskCount) {
String PointCode = entry.getValue().get(getCount); String pointCode = entry.getValue().get(getCount);
//从队列中移除任务
SchBaseTask task = queue.poll(); SchBaseTask task = queue.poll();
executeTask(task, PointCode); executeTask(task, pointCode);
getCount++; getCount++;
} }
} }
} }
// 执行任务
private void executeTask(SchBaseTask task, String pointCode) { private void executeTask(SchBaseTask task, String pointCode) {
if (task != null) { if (task != null) {
UpdateWrapper<SchBaseTask> updateWrapper = new UpdateWrapper<>(); task.setPoint_code2(pointCode);
updateWrapper.set("point_code2", pointCode); taskService.updateById(task);
taskService.update(task, updateWrapper);
ZxqTask taskBean = new ZxqTask(); ZxqTask taskBean = new ZxqTask();
//任务下发
taskBean.immediateNotifyAcs(null); taskBean.immediateNotifyAcs(null);
} }
} }
} }

View File

@@ -205,28 +205,28 @@ public class InBoxManageServiceImpl implements InBoxManageService {
if (boxDao == null) { if (boxDao == null) {
throw new BadRequestException("木箱不存在!"); throw new BadRequestException("木箱不存在!");
} }
JSONObject jsonVehicle = vehicleTab.query("storagevehicle_code = '" + whereJson.getString("vehicle_code") + "'") // JSONObject jsonVehicle = vehicleTab.query("storagevehicle_code = '" + whereJson.getString("vehicle_code") + "'")
.uniqueResult(0); // .uniqueResult(0);
if (ObjectUtil.isEmpty(jsonVehicle)) { // if (ObjectUtil.isEmpty(jsonVehicle)) {
throw new BadRequestException("载具不存在!"); // throw new BadRequestException("载具不存在!");
} // }
JSONObject ext_jo = veExtTab.query("storagevehicle_code = '"+jsonVehicle.getString("storagevehicle_code")+"'").uniqueResult(0); // JSONObject ext_jo = veExtTab.query("storagevehicle_code = '"+jsonVehicle.getString("storagevehicle_code")+"'").uniqueResult(0);
if (ObjectUtil.isEmpty(ext_jo)) { // if (ObjectUtil.isEmpty(ext_jo)) {
JSONObject jsonVeExt = new JSONObject(); // JSONObject jsonVeExt = new JSONObject();
jsonVeExt.put("storagevehicleext_id", IdUtil.getLongId()); // jsonVeExt.put("storagevehicleext_id", IdUtil.getLongId());
jsonVeExt.put("storagevehicle_id", jsonVehicle.getLongValue("storagevehicle_id")); // jsonVeExt.put("storagevehicle_id", jsonVehicle.getLongValue("storagevehicle_id"));
jsonVeExt.put("storagevehicle_code", jsonVehicle.getString("storagevehicle_code")); // jsonVeExt.put("storagevehicle_code", jsonVehicle.getString("storagevehicle_code"));
jsonVeExt.put("storagevehicle_type", jsonVehicle.getString("storagevehicle_type")); // jsonVeExt.put("storagevehicle_type", jsonVehicle.getString("storagevehicle_type"));
jsonVeExt.put("pcsn", whereJson.getString("box_no")); // jsonVeExt.put("pcsn", whereJson.getString("box_no"));
jsonVeExt.put("device_uuid", IdUtil.getLongId()); // jsonVeExt.put("device_uuid", IdUtil.getLongId());
jsonVeExt.put("update_time", DateUtil.now()); // jsonVeExt.put("update_time", DateUtil.now());
veExtTab.insert(jsonVeExt); // veExtTab.insert(jsonVeExt);
}else { // }else {
ext_jo.put("pcsn", whereJson.getString("box_no")); // ext_jo.put("pcsn", whereJson.getString("box_no"));
ext_jo.put("device_uuid", IdUtil.getLongId()); // ext_jo.put("device_uuid", IdUtil.getLongId());
ext_jo.put("update_time", DateUtil.now()); // ext_jo.put("update_time", DateUtil.now());
veExtTab.update(ext_jo); // veExtTab.update(ext_jo);
} // }
// 下发桁架任务 // 下发桁架任务

View File

@@ -161,6 +161,7 @@ public class OutBussManageServiceImpl implements OutBussManageService {
) )
.collect(Collectors.toList()); .collect(Collectors.toList());
if (ObjectUtil.isEmpty(likePcsnBoxList)) { if (ObjectUtil.isEmpty(likePcsnBoxList)) {
throw new BadRequestException("库存不足!"); throw new BadRequestException("库存不足!");
} }

View File

@@ -15,6 +15,8 @@
*/ */
package org.nl.modules.common.utils; package org.nl.modules.common.utils;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.google.common.collect.Sets; import com.google.common.collect.Sets;
import org.slf4j.Logger; import org.slf4j.Logger;
@@ -42,6 +44,11 @@ public class RedisUtils {
@Value("${jwt.online-key}") @Value("${jwt.online-key}")
private String onlineKey; private String onlineKey;
private final ObjectMapper objectMapper = new ObjectMapper();
public RedisUtils(RedisTemplate<Object, Object> redisTemplate) { public RedisUtils(RedisTemplate<Object, Object> redisTemplate) {
this.redisTemplate = redisTemplate; this.redisTemplate = redisTemplate;
} }
@@ -708,4 +715,25 @@ public class RedisUtils {
log.debug("缓存删除数量:" + count + ""); log.debug("缓存删除数量:" + count + "");
log.debug("--------------------------------------------"); log.debug("--------------------------------------------");
} }
public void pushToList(String key, Object value) {
try {
String valueJson = objectMapper.writeValueAsString(value);
redisTemplate.opsForList().rightPush(key, valueJson);
} catch (JsonProcessingException e) {
log.error("序列化对象出错:", e);
}
}
public Object popFromList(String key, Class<?> valueType) {
String valueJson = (String) redisTemplate.opsForList().leftPop(key);
if (valueJson != null) {
try {
return objectMapper.readValue(valueJson, valueType);
} catch (JsonProcessingException e) {
log.error("反序列化对象出错:", e);
}
}
return null;
}
} }

View File

@@ -8,7 +8,8 @@ public enum TaskStatusEnum {
START_AND_POINT("04", "起点终点确认"), START_AND_POINT("04", "起点终点确认"),
ISSUE("05", "下发"), ISSUE("05", "下发"),
EXECUTING("06", "执行中"), EXECUTING("06", "执行中"),
FINISHED("07", "完成"); FINISHED("07", "完成"),
CANCEL("08", "取消");
private String name; private String name;
private String code; private String code;