opt:株洲中钨优化
This commit is contained in:
@@ -32,6 +32,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
@@ -146,6 +147,28 @@ public class SchBaseTaskServiceImpl extends ServiceImpl<SchBaseTaskMapper, SchBa
|
||||
break;
|
||||
// 强制完成
|
||||
case "forceFinish":
|
||||
// 判断同一个任务组中,上一个任务是否已经完成,不允许跳着完成
|
||||
SchBaseTask currentTask = getByCode(task_code);
|
||||
if (currentTask != null && StringUtils.isNotEmpty(currentTask.getTask_group_id())) {
|
||||
// 获取当前任务的任务组ID和顺序号
|
||||
String taskGroupId = currentTask.getTask_group_id();
|
||||
BigDecimal currentSeq = currentTask.getTask_group_seq();
|
||||
|
||||
if (currentSeq != null && currentSeq.compareTo(BigDecimal.ZERO) > 0) {
|
||||
// 查询同一任务组中,顺序号小于当前任务的所有任务
|
||||
LambdaQueryWrapper<SchBaseTask> wrapper = new QueryWrapper<SchBaseTask>().lambda();
|
||||
wrapper.eq(SchBaseTask::getTask_group_id, taskGroupId);
|
||||
wrapper.lt(SchBaseTask::getTask_group_seq, currentSeq);
|
||||
wrapper.ne(SchBaseTask::getTask_status, TaskStatus.FINISHED.getCode());
|
||||
wrapper.ne(SchBaseTask::getIs_delete, BaseDataEnum.IS_YES_NOT.code("是"));
|
||||
|
||||
List<SchBaseTask> unfinishedTasks = this.list(wrapper);
|
||||
if (!unfinishedTasks.isEmpty()) {
|
||||
throw new BadRequestException("同一任务组中存在未完成的前置任务,不允许跳过完成");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
abstractTask.forceFinish(task_code);
|
||||
break;
|
||||
case "cancel":
|
||||
|
||||
@@ -13,6 +13,7 @@ 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.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.CodeUtil;
|
||||
@@ -994,6 +995,16 @@ public class InBillServiceImpl extends ServiceImpl<IOStorInvMapper, IOStorInv> i
|
||||
finish_map.put("inv_code", null);
|
||||
finish_map.put("occupancy_state","3");
|
||||
iStructattrService.updateStatusByCode("1",finish_map);
|
||||
|
||||
List<MdPbStoragevehicleinfo> mdPbStoragevehicleinfoList = mdPbStoragevehicleinfoMapper.selectList(new LambdaQueryWrapper<>(MdPbStoragevehicleinfo.class)
|
||||
.eq(MdPbStoragevehicleinfo::getStoragevehicle_code, ioStorInvDis.getStoragevehicle_code())
|
||||
);
|
||||
|
||||
if(CollectionUtils.isNotEmpty(mdPbStoragevehicleinfoList)){
|
||||
mdPbStoragevehicleinfoList.get(0).setRecommended_sect_code(ioStorInvDis.getSect_code());
|
||||
mdPbStoragevehicleinfoList.get(0).setUpdate_time(DateUtil.now());
|
||||
mdPbStoragevehicleinfoMapper.updateById(mdPbStoragevehicleinfoList.get(0));
|
||||
}
|
||||
//库存变动
|
||||
StructattrChangeDto changeDto = StructattrChangeDto.builder()
|
||||
.inv(ioStorInv.getIostorinv_id())
|
||||
|
||||
Reference in New Issue
Block a user