feat:装箱入库
This commit is contained in:
@@ -89,6 +89,18 @@ public class TransportTaskApiImpl implements TransportTaskApi {
|
||||
return success(transportTaskService.countUnfinishedByDestination(pointCode, ownerService));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据任务类型和结果参数中的区块统计未完成任务数
|
||||
*
|
||||
* @param taskType 任务类型
|
||||
* @param block 区块
|
||||
* @return 未完成任务数
|
||||
*/
|
||||
@Override
|
||||
public CommonResult<Long> countUnfinishedByTaskTypeAndResultBlock(String taskType, String block) {
|
||||
return success(transportTaskService.countUnfinishedByTaskTypeAndResultBlock(taskType, block));
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查指定点位是否存在未完成任务
|
||||
*
|
||||
|
||||
@@ -126,6 +126,16 @@ public interface TransportTaskMapper extends BaseMapperX<TransportTaskDO> {
|
||||
*/
|
||||
long selectUnfinishedCountByPointCodes(@Param("pointCodes") List<String> pointCodes);
|
||||
|
||||
/**
|
||||
* 根据任务类型和结果参数中的区块统计未完成任务数
|
||||
*
|
||||
* @param taskType 任务类型
|
||||
* @param block 区块
|
||||
* @return 未完成任务数
|
||||
*/
|
||||
long selectUnfinishedCountByTaskTypeAndResultBlock(
|
||||
@Param("taskType") String taskType, @Param("block") String block);
|
||||
|
||||
/**
|
||||
* 根据点位编码查询第一条未完成任务
|
||||
*
|
||||
|
||||
@@ -135,6 +135,15 @@ public interface TransportTaskService {
|
||||
|
||||
Long countUnfinishedByDestination(String pointCode, String ownerService);
|
||||
|
||||
/**
|
||||
* 根据任务类型和结果参数中的区块统计未完成任务数
|
||||
*
|
||||
* @param taskType 任务类型
|
||||
* @param block 区块
|
||||
* @return 未完成任务数
|
||||
*/
|
||||
Long countUnfinishedByTaskTypeAndResultBlock(String taskType, String block);
|
||||
|
||||
/**
|
||||
* 检查指定点位是否存在未完成任务
|
||||
*
|
||||
|
||||
@@ -26,6 +26,7 @@ import cn.code.nl.module.task.manage.TransportTaskIssueManager;
|
||||
import cn.code.nl.module.task.manage.TransportTaskOperateCheckManager;
|
||||
import cn.code.nl.module.task.manage.TransportTaskOperationManager;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.mzt.logapi.context.LogRecordContext;
|
||||
import com.mzt.logapi.starter.annotation.LogRecord;
|
||||
@@ -88,9 +89,13 @@ public class TransportTaskServiceImpl implements TransportTaskService {
|
||||
codeGenerateReqDTO.setRuleCode("TASK_CODE");
|
||||
CommonResult<String> generate = codeGenApi.generate(codeGenerateReqDTO);
|
||||
task.setTaskCode(generate.getCheckedData());
|
||||
task.setTaskStatus(reqDTO.getIsCreateFinish()
|
||||
? TransportTaskStatusEnum.READY.getCode()
|
||||
: TransportTaskStatusEnum.CREATED.getCode());
|
||||
if (ObjectUtil.isNotEmpty(reqDTO.getTaskStatus())) {
|
||||
task.setTaskStatus(reqDTO.getTaskStatus());
|
||||
} else {
|
||||
task.setTaskStatus(reqDTO.getIsCreateFinish()
|
||||
? TransportTaskStatusEnum.READY.getCode()
|
||||
: TransportTaskStatusEnum.CREATED.getCode());
|
||||
}
|
||||
task.setCallbackStatus(CallbackStatusEnum.PENDING.getCode());
|
||||
task.setCallbackRetryCount(0);
|
||||
task.setCreateMode("RPC");
|
||||
@@ -250,6 +255,18 @@ public class TransportTaskServiceImpl implements TransportTaskService {
|
||||
return transportTaskMapper.selectUnfinishedCountByDestination(pointCode, ownerService);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据任务类型和结果参数中的区块统计未完成任务数
|
||||
*
|
||||
* @param taskType 任务类型
|
||||
* @param block 区块
|
||||
* @return 未完成任务数
|
||||
*/
|
||||
@Override
|
||||
public Long countUnfinishedByTaskTypeAndResultBlock(String taskType, String block) {
|
||||
return transportTaskMapper.selectUnfinishedCountByTaskTypeAndResultBlock(taskType, block);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasUnfinishedByPointCodes(List<String> pointCodes) {
|
||||
return transportTaskMapper.selectUnfinishedCountByPointCodes(pointCodes) > 0;
|
||||
|
||||
@@ -43,6 +43,15 @@
|
||||
LIMIT 1
|
||||
</select>
|
||||
|
||||
<select id="selectUnfinishedCountByTaskTypeAndResultBlock" resultType="long">
|
||||
SELECT COUNT(1)
|
||||
FROM task_transport_job
|
||||
WHERE task_type = #{taskType}
|
||||
AND JSON_UNQUOTE(JSON_EXTRACT(result_param, '$.block')) = #{block}
|
||||
AND task_status < '75'
|
||||
AND deleted = b'0'
|
||||
</select>
|
||||
|
||||
<select id="selectListByTypeAndStatus"
|
||||
resultType="cn.code.nl.module.task.dal.dataobject.transporttask.TransportTaskDO">
|
||||
SELECT *
|
||||
|
||||
Reference in New Issue
Block a user