|
|
|
|
@ -73,6 +73,7 @@ import org.springframework.web.bind.annotation.*; |
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.Map; |
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* [检验任务] 控制器 |
|
|
|
|
@ -206,15 +207,15 @@ public class InspectionTaskController extends BladeController { |
|
|
|
|
log.info("query = {}", query); |
|
|
|
|
log.info("getUserRole = {}", AuthUtil.getUserRole()); |
|
|
|
|
// 热表 烧结 检验员 数据区分。
|
|
|
|
|
// if (RoleUtil.hasRole(roleConfig.getRbCheckerAlias())) {
|
|
|
|
|
// search.setFromType(InspectionTaskConst.FROM_TYPE_RB);
|
|
|
|
|
// }
|
|
|
|
|
// if (RoleUtil.hasRole(roleConfig.getSjCheckerAlias())) {
|
|
|
|
|
// search.setFromType(InspectionTaskConst.FROM_TYPE_SJ);
|
|
|
|
|
// }
|
|
|
|
|
// if (RoleUtil.hasAllRole(roleConfig.getRbCheckerAlias(), roleConfig.getSjCheckerAlias())) {
|
|
|
|
|
// search.setFromType(null);
|
|
|
|
|
// }
|
|
|
|
|
if (RoleUtil.hasRole(roleConfig.getRbCheckerAlias())) { |
|
|
|
|
search.setFromType(InspectionTaskConst.FROM_TYPE_RB); |
|
|
|
|
} |
|
|
|
|
if (RoleUtil.hasRole(roleConfig.getSjCheckerAlias())) { |
|
|
|
|
search.setFromType(InspectionTaskConst.FROM_TYPE_SJ); |
|
|
|
|
} |
|
|
|
|
if (RoleUtil.hasAllRole(roleConfig.getRbCheckerAlias(), roleConfig.getSjCheckerAlias())) { |
|
|
|
|
search.setFromType(null); |
|
|
|
|
} |
|
|
|
|
IPage<InspectionTaskListVO> pagesVO = service.listSearch(Condition.getPage(query), search); |
|
|
|
|
return R.data(pagesVO); |
|
|
|
|
} |
|
|
|
|
@ -227,15 +228,15 @@ public class InspectionTaskController extends BladeController { |
|
|
|
|
log.info("query = {}", query); |
|
|
|
|
log.info("getUserRole = {}", AuthUtil.getUserRole()); |
|
|
|
|
// 热表 烧结 检验员 数据区分。
|
|
|
|
|
// if (RoleUtil.hasRole(roleConfig.getRbCheckerAlias())) {
|
|
|
|
|
// search.setFromType(InspectionTaskConst.FROM_TYPE_RB);
|
|
|
|
|
// }
|
|
|
|
|
// if (RoleUtil.hasRole(roleConfig.getSjCheckerAlias())) {
|
|
|
|
|
// search.setFromType(InspectionTaskConst.FROM_TYPE_SJ);
|
|
|
|
|
// }
|
|
|
|
|
// if (RoleUtil.hasAllRole(roleConfig.getRbCheckerAlias(), roleConfig.getSjCheckerAlias())) {
|
|
|
|
|
// search.setFromType(null);
|
|
|
|
|
// }
|
|
|
|
|
if (RoleUtil.hasRole(roleConfig.getRbCheckerAlias())) { |
|
|
|
|
search.setFromType(InspectionTaskConst.FROM_TYPE_RB); |
|
|
|
|
} |
|
|
|
|
if (RoleUtil.hasRole(roleConfig.getSjCheckerAlias())) { |
|
|
|
|
search.setFromType(InspectionTaskConst.FROM_TYPE_SJ); |
|
|
|
|
} |
|
|
|
|
if (RoleUtil.hasAllRole(roleConfig.getRbCheckerAlias(), roleConfig.getSjCheckerAlias())) { |
|
|
|
|
search.setFromType(null); |
|
|
|
|
} |
|
|
|
|
IPage<InspectionTaskListVO> pagesVO = service.queryWorkOrder(Condition.getPage(query), search); |
|
|
|
|
return R.data(pagesVO); |
|
|
|
|
} |
|
|
|
|
@ -360,10 +361,49 @@ public class InspectionTaskController extends BladeController { |
|
|
|
|
|
|
|
|
|
// List<MesRbFilePreserveSlotEntity> submitList = JSONArray.parseArray(data.get("submitList").toString(), MesRbFilePreserveSlotEntity.class);
|
|
|
|
|
List<MesRbFilePreserveSlotEntity> submitList = dto.getSubmitList(); |
|
|
|
|
|
|
|
|
|
// List<Long> deleteIds = JSONArray.parseArray(data.get("deleteIds").toString(), Long.class);
|
|
|
|
|
List<Long> deleteIds = dto.getDeleteIds(); |
|
|
|
|
|
|
|
|
|
List<String> uniqueNames = submitList.stream().distinct() |
|
|
|
|
.map(MesRbFilePreserveSlotEntity::getSlotName) // 提取name字段
|
|
|
|
|
.collect(Collectors.toList()); |
|
|
|
|
if (uniqueNames.size() != submitList.size()) { |
|
|
|
|
return R.fail("槽号名称不能重复"); |
|
|
|
|
}else{ |
|
|
|
|
for(MesRbFilePreserveSlotEntity slot : submitList){ |
|
|
|
|
if(null != slot.getId()){ |
|
|
|
|
QueryWrapper<MesRbFilePreserveSlotEntity> queryWrapper = new QueryWrapper<>(); |
|
|
|
|
queryWrapper.eq("slot_name", slot.getSlotName()); |
|
|
|
|
// queryWrapper.ne("id", slot.getId());
|
|
|
|
|
if(null != deleteIds && deleteIds.size() > 0){ |
|
|
|
|
deleteIds.add(slot.getId()); |
|
|
|
|
queryWrapper.notIn("id", deleteIds); |
|
|
|
|
}else{ |
|
|
|
|
queryWrapper.ne("id", slot.getId()); |
|
|
|
|
} |
|
|
|
|
List<MesRbFilePreserveSlotEntity> list = mesRbFilePreserveSlotService.list(queryWrapper); |
|
|
|
|
if(null != list && list.size() > 0){ |
|
|
|
|
return R.fail("槽号名称不能重复"); |
|
|
|
|
} |
|
|
|
|
}else{ |
|
|
|
|
QueryWrapper<MesRbFilePreserveSlotEntity> queryWrapper = new QueryWrapper<>(); |
|
|
|
|
queryWrapper.eq("slot_name", slot.getSlotName()); |
|
|
|
|
if(null != deleteIds && deleteIds.size() > 0){ |
|
|
|
|
queryWrapper.notIn("id", deleteIds); |
|
|
|
|
} |
|
|
|
|
List<MesRbFilePreserveSlotEntity> list = mesRbFilePreserveSlotService.list(queryWrapper); |
|
|
|
|
if(null != list && list.size() > 0){ |
|
|
|
|
return R.fail("槽号名称不能重复"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BladeUser curUserInfo = AuthUtil.getUser(); |
|
|
|
|
// PfUserInfo curUserInfo = (PfUserInfo) ControllerUtils.getCurUserInfo(request);
|
|
|
|
|
// Long rfpId = data.getLong("rfpId");
|
|
|
|
|
|