提交 6e933109 authored 作者: zhoushaopan's avatar zhoushaopan

Merge remote-tracking branch 'origin/dev' into read-dev

# Conflicts: # dev-repair/src/main/java/com/tykj/dev/device/repair/controller/RepairController.java
......@@ -24,9 +24,11 @@ import com.tykj.dev.device.task.service.TaskLogService;
import com.tykj.dev.device.task.service.TaskService;
import com.tykj.dev.device.task.subject.bto.TaskBto;
import com.tykj.dev.device.task.subject.domin.Task;
import com.tykj.dev.device.user.cache.UnitsCache;
import com.tykj.dev.device.user.read.service.MessageService;
import com.tykj.dev.device.user.read.subject.bto.MessageBto;
import com.tykj.dev.device.user.subject.dao.UserDao;
import com.tykj.dev.device.user.subject.entity.Units;
import com.tykj.dev.device.user.subject.entity.User;
import com.tykj.dev.device.user.subject.service.AreaService;
import com.tykj.dev.device.user.subject.service.UnitsService;
......@@ -128,6 +130,9 @@ public class AllotBillController {
@Autowired
private PackingController packingController;
@Autowired
private UnitsCache unitsCache;
@ApiOperation(value = "导入二维码获取配发装备", notes = "可以通过这个接口导入二维码获取配发装备")
@PostMapping(value = "/load")
public ResponseEntity loadDevice(@RequestBody RfidVo rfidVo) {
......@@ -298,7 +303,11 @@ public class AllotBillController {
Map<Integer, Integer> changeMap = new HashMap<>();
Map<String, PackingLibrary> packingLibraryHashMap = new HashMap<>();
if (unitsService.findbyName(allotBillSaveVo.getSendUnit()).getLevel() == 1) {
// if (unitsService.findbyName(allotBillSaveVo.getSendUnit()).getLevel() == 1) {
// createPacking(strings, allotBillSaveVo, packingLibraryHashMap);
// }
Units units = unitsCache.findById(allotBillSaveVo.getSendUnitId());
if (units.getLevel() == 1 && units.getType() == 1) {
createPacking(strings, allotBillSaveVo, packingLibraryHashMap);
}
......
......@@ -25,9 +25,12 @@ import com.tykj.dev.device.task.service.TaskService;
import com.tykj.dev.device.task.subject.bto.TaskBto;
import com.tykj.dev.device.task.subject.domin.Task;
import com.tykj.dev.device.task.subject.vo.TaskLogUserVo;
import com.tykj.dev.device.user.cache.UnitsCache;
import com.tykj.dev.device.user.cache.UserCache;
import com.tykj.dev.device.user.read.service.MessageService;
import com.tykj.dev.device.user.read.subject.bto.MessageBto;
import com.tykj.dev.device.user.subject.dao.UserDao;
import com.tykj.dev.device.user.subject.entity.Units;
import com.tykj.dev.device.user.subject.entity.User;
import com.tykj.dev.device.user.subject.service.UserPublicService;
import com.tykj.dev.device.user.util.UserUtils;
......@@ -121,6 +124,9 @@ public class DeviceApplyController {
@Qualifier("taskExecutor")
private Executor executor;
@Autowired
private UnitsCache unitsCache;
// @Autowired
// private DeviceLibraryDao deviceLibraryDao;
......@@ -160,7 +166,10 @@ public class DeviceApplyController {
default:
title = "装备申请";
}
if (userUtils.getCurrentUnitLevel()==1){
// if (userUtils.getCurrentUnitLevel()==1){
Integer currentUnitLevel = userUtils.getCurrentUnitLevel();
Units units = unitsCache.findById(userUtils.getCurrentUnitId());
if (units.getLevel()==1 && units.getType() == 1){
//如果是省 等待中办 设置状态为3
deviceApplyBillEntity.setApplyStatus(3);
deviceApplyBillService.update(deviceApplyBillEntity);
......
......@@ -342,6 +342,12 @@ public class DeviceCheckController {
@ApiOperation(value = "根据billId查询核查详情数据", notes = "可以通过这个接口查询核查详情数据")
@GetMapping("/detail/{id}")
public ResponseEntity<ResultObj<CheckDetailVo>> findDetail(@PathVariable Integer id) {
DeviceCheckDetail detail = detailRepo.findById(id).orElseThrow(() -> new ApiException("给出的bill id 不存在"));
if (CHECK_DETAIL_REGION_0.equals(detail.getCheckStatus()) || CHECK_DETAIL_CITY_0.equals((detail.getCheckStatus()))) {
refreshDetail(id);
}
CheckDetailVo detailVoList = detailRepo.findById(id)
.map(transUtil::CheckDetailDo2Vo)
.orElse(null);
......
......@@ -95,9 +95,9 @@ public class LossBillServiceImpl implements LossBillService {
Units units=unitsService.findById(deviceLoss.getUnitId());
Area area=areaService.findByid(units.getAreaId());
TaskBto taskBto;
if (units.getLevel() == 1) {
if (units.getLevel() == 1 && units.getType()==1) {
taskBto=end(deviceLossThis.getCreateUserId(), deviceLossThis.getId(), units.getName() + "丢失装备任务", units.getUnitId());
} else if (units.getLevel()==2){
} else if (units.getLevel()==2 || units.getType()==2){
Units parentUnits=unitsService.findUnitAreaId(area.getFatherId());
taskBto= newLossCityTask(parentUnits.getUnitId(), deviceLossThis.getId(), units.getName() + "丢失装备任务",securityUser.getCurrentUserInfo().getUserId());
}else {
......@@ -159,10 +159,10 @@ public class LossBillServiceImpl implements LossBillService {
Units units=unitsService.findById(deviceLoss.getUnitId());
Area area=areaService.findByid(units.getAreaId());
TaskBto taskBto;
if (units.getLevel() == 1) {
if (units.getLevel() == 1 && units.getType()==1) {
taskBto= endRetrieve(deviceLossThis.getCreateUserId(), deviceLossThis.getId(), units.getName() + "找回装备任务", units.getUnitId());
deviceLibraryService.upDateLeftStatus(DeviceLifeStatus.IN_LIBRARY.id,deviceLoss.getDevIdsList());
} else if (units.getLevel()==2){
} else if (units.getLevel()==2 || units.getType()==2){
Units parentUnits=unitsService.findUnitAreaId(area.getFatherId());
taskBto= newRetrieveCityTask(parentUnits.getUnitId(), deviceLossThis.getId(), units.getName() + "找回装备任务",securityUser.getCurrentUserInfo().getUserId());
}else {
......
......@@ -193,6 +193,7 @@ public class RepairController {
@Transactional(rollbackFor = Exception.class)
public ResponseEntity saveRepairBill(@RequestBody RepairBillSaveVo repairBillSaveVo) {
Integer currentUnitLevel = userUtils.getCurrentUnitLevel();
Units units = unitsCache.findById(userUtils.getCurrentUnitId());
//判断装备的状态是否在库或维修中
deviceLibraryService.isInStockOrRepairing(StringSplitUtil.split(repairBillSaveVo.getRepairDeviceCheckDetail()));
//第一次保存
......@@ -232,7 +233,7 @@ public class RepairController {
// TaskBto taskBto = new TaskBto(StatusEnum.REPAIR_SEND_DRAFT.id, "["+repairBillSaveVo.getReceiveUnit().substring(0,3) + "]型号" + StringSplitUtil.stringListToString(repairBillSaveVo.getScriptSaveVos().stream().map(ScriptSaveVo::getModel).distinct().collect(Collectors.toList())) + "共有" + repairBillSaveVo.getSendingCount() + "件",null, ".", repairBill1.getId(), 5, userUtils.getCurrentUnitId(), 0, null, userIds);
TaskBto taskBto = new TaskBto(StatusEnum.REPAIR_SEND_DRAFT.id, "["+DeviceModelSort.unitNameToDisName(repairBillSaveVo.getReceiveUnit()) + "]型号" + StringSplitUtil.stringListToString(repairBillSaveVo.getScriptSaveVos().stream().map(ScriptSaveVo::getModel).distinct().collect(Collectors.toList())) + "共有" + repairBillSaveVo.getSendingCount() + "件",null, ".", repairBill1.getId(), 5, userUtils.getCurrentUnitId(), 0, null, userIds);
//如果是省发起的维修
if (currentUnitLevel == 1){
if (currentUnitLevel == 1 && units.getType() == 1){
taskBto.setCustomInfo("country");
}
TaskBto taskBto1 = taskService.start(taskBto);
......@@ -339,9 +340,8 @@ public class RepairController {
});
}
Integer userId = userUtils.getCurrentUserId();
// Integer level = userUtils.getCurrentUnitLevel();
Integer unitId = userUtils.getCurrentUnitId();
Units units = unitsCache.findById(unitId);
Integer level = userUtils.getCurrentUnitLevel();
Units units = unitsCache.findById(userUtils.getCurrentUnitId());
//添加维修单和送修单
RepairBill repairBill;
RepairSendBill deviceRepairSendBillEntity;
......@@ -364,7 +364,7 @@ public class RepairController {
deviceRepairSendBillEntity.setScriptJson(JacksonUtil.toJSon(repairBillSaveVo.getScriptSaveVos()));
}
//如果当前为省向国家发起的
if (units.getType() == 1 && units.getLevel() == 1) {
if (level == 1 && units.getType() == 1) {
repairBill.setRepairStatus(4);//维修中
deviceRepairSendBillEntity.setRepairStatus(5);//维修中
} else {
......@@ -475,27 +475,17 @@ public class RepairController {
//当前单位其他专管员id集合
List<Integer> ids = userPublicService.findOtherUser(userUtils.getCurrentUserId());
//省向国家发起的
if (units.getType() == 1 && units.getLevel() == 1) {
if (level == 1) {
ownUnit = userUtils.getCurrentUnitId();
//直接发起的
if (repairBillSaveVo.getTaskId() == null) {
TaskBto taskBto;
if (repairBillSaveVo.getReceiveUnit().contains("中办")){
// taskBto = new TaskBto(StatusEnum.WAIT_UPLOAD_FILE.id, "["+repairBillSaveVo.getReceiveUnit() + "]型号" + StringSplitUtil.stringListToString(repairBillSaveVo.getScriptSaveVos().stream().map(ScriptSaveVo::getModel).distinct().collect(Collectors.toList())) + "共有" + repairBillSaveVo.getSendingCount() + "件", null, ".", repairBill1.getId(), 5, ownUnit, 1, "country", userIds);
taskBto = new TaskBto(StatusEnum.WAIT_UPLOAD_FILE.id,
"["+DeviceModelSort.unitNameToDisName(repairBillSaveVo.getReceiveUnit()) + "]型号"
+ StringSplitUtil.stringListToString(repairBillSaveVo.getScriptSaveVos().stream()
.map(ScriptSaveVo::getModel).distinct().collect(Collectors.toList())) + "共有"
+ repairBillSaveVo.getSendingCount() + "件", null, ".",
repairBill1.getId(), 5, ownUnit, 1, "country", userIds);
taskBto = new TaskBto(StatusEnum.WAIT_UPLOAD_FILE.id, "["+DeviceModelSort.unitNameToDisName(repairBillSaveVo.getReceiveUnit()) + "]型号" + StringSplitUtil.stringListToString(repairBillSaveVo.getScriptSaveVos().stream().map(ScriptSaveVo::getModel).distinct().collect(Collectors.toList())) + "共有" + repairBillSaveVo.getSendingCount() + "件", null, ".", repairBill1.getId(), 5, ownUnit, 1, "country", userIds);
}else {
// taskBto = new TaskBto(StatusEnum.WAIT_UPLOAD_FILE.id, "["+repairBillSaveVo.getReceiveUnit().substring(0,3) + "]型号" + StringSplitUtil.stringListToString(repairBillSaveVo.getScriptSaveVos().stream().map(ScriptSaveVo::getModel).distinct().collect(Collectors.toList())) + "共有" + repairBillSaveVo.getSendingCount() + "件", null, ".", repairBill1.getId(), 5, ownUnit, 1, "country", userIds);
taskBto = new TaskBto(StatusEnum.WAIT_UPLOAD_FILE.id,
"["+DeviceModelSort.unitNameToDisName(repairBillSaveVo.getReceiveUnit()) + "]型号"
+ StringSplitUtil.stringListToString(repairBillSaveVo.getScriptSaveVos().stream()
.map(ScriptSaveVo::getModel).distinct().collect(Collectors.toList())) + "共有"
+ repairBillSaveVo.getSendingCount() + "件", null, ".",
repairBill1.getId(), 5, ownUnit, 1, "country", userIds);
taskBto = new TaskBto(StatusEnum.WAIT_UPLOAD_FILE.id, "["+DeviceModelSort.unitNameToDisName(repairBillSaveVo.getReceiveUnit()) + "]型号" + StringSplitUtil.stringListToString(repairBillSaveVo.getScriptSaveVos().stream().map(ScriptSaveVo::getModel).distinct().collect(Collectors.toList())) + "共有" + repairBillSaveVo.getSendingCount() + "件", null, ".", repairBill1.getId(), 5, ownUnit, 1, "country", userIds);
}
saveEntity = taskService.start(taskBto);
}
......@@ -600,7 +590,7 @@ public class RepairController {
deviceRepairDetailService.save(repairDetail);
}
//如果当前为省像国家发起的
if (units.getType() == 1 && units.getLevel() == 1) {
if (level == 1) {
deviceLibraryEntity.setLifeStatus(4);
deviceLibraryEntity.setLocationUnit(repairBillSaveVo.getReceiveUnit());
} else {
......@@ -619,7 +609,7 @@ public class RepairController {
String deviceIdDetail = deviceRepairSendBillEntity.getRepairDeviceCheckDetail();
List<Integer> idList = StringSplitUtil.split(deviceIdDetail);
//如果当前为省,改变装备的所在为中办
if (units.getType() == 1 && units.getLevel() == 1) {
if (level == 1) {
//获取当前业务维修详情 记录
List<RepairDetail> repairDetailEntities = deviceRepairDetailService.findByBillId(repairBill.getId());
//改变维修详情装备所在单位为中办,状态为维修中
......@@ -1001,9 +991,6 @@ public class RepairController {
//发起任务
// TaskBto taskBto = new TaskBto(StatusEnum.REPAIR_BACK_DRAFT.id, "["+repairBackBillSaveVo.getReceiveUnit().substring(0,3) + "]型号" + repairBackBillSaveVo.getScriptSaveVos().get(0).getModel() + "共有" + repairBackBillSaveVo.getSendingCount() + "件至", null, ".", repairBackBill1.getId(), BusinessEnum.REPAIR_BACK.id, userUtils.getCurrentUnitId(), 0, null, userIds);
TaskBto taskBto = new TaskBto(StatusEnum.REPAIR_BACK_DRAFT.id, "["+DeviceModelSort.unitNameToDisName(repairBackBillSaveVo.getReceiveUnit()) + "]型号" + repairBackBillSaveVo.getScriptSaveVos().get(0).getModel() + "共有" + repairBackBillSaveVo.getSendingCount() + "件至", null, ".", repairBackBill1.getId(), BusinessEnum.REPAIR_BACK.id, userUtils.getCurrentUnitId(), 0, null, userIds);
// if (currentUnitLevel == 1){
// taskBto.setCustomInfo("country");
// }
if (currentUnitLevel == 1 && units.getType() == 1){
taskBto.setCustomInfo("country");
}
......@@ -1989,11 +1976,9 @@ public class RepairController {
//已领取装备
else if (type == 4) {
Integer level = userUtils.getCurrentUnitLevel();
Units byId = unitsCache.findById(unitId);
String currentUserUnitName = userUtils.getCurrentUserUnitName();
Units units1 = unitsCache.findById(userUtils.getCurrentUnitId());
List<RepairDetail> repairDetails;
// if (level == 1) {
if (level == 1 && byId.getType() == 1) {
if (level == 1 && units1.getType() == 1) {
repairDetails = repairDetailDao.findAllByRepairStatus(5, repairTaskSelectVo.getPageable().getSort());
} else if (level == 2) {
......@@ -2053,8 +2038,9 @@ public class RepairController {
//已报废装备
else if (type == 5) {
Integer level = userUtils.getCurrentUnitLevel();
Units units = unitsCache.findById(userUtils.getCurrentUnitId());
List<RepairDetail> repairDetails;
if (level == 1) {
if (level == 1 && units.getType() == 1) {
repairDetails = repairDetailDao.findAllByRepairStatus(4, repairTaskSelectVo.getPageable().getSort());
} else {
throw new ApiException("区县没有维修完成列表");
......@@ -2134,9 +2120,10 @@ public class RepairController {
@PostMapping(value = "/uploadRecord")
public ResponseEntity uploadRecord(@RequestBody RepairRecord repairRecord) {
Integer level = userUtils.getCurrentUnitLevel();
Units units = unitsCache.findById(userUtils.getCurrentUnitId());
// RepairDetail repairDetail = deviceRepairDetailService.getOne(repairRecord.getId());
//省市县三种备注
if (level == 1) {
if (level == 1 && units.getType() == 2) {
// repairDetail.setRecord(repairRecord.getRecord());
repairDetailDao.updateRecord(repairRecord.getRecord(),repairRecord.getId());
} else if (level == 2) {
......@@ -2847,6 +2834,7 @@ public class RepairController {
}
Integer userId = userUtils.getCurrentUserId();
Integer level = userUtils.getCurrentUnitLevel();
Units units = unitsCache.findById(userUtils.getCurrentUnitId());
//添加维修单和送修单
RepairBill repairBill = null;
RepairSendBill deviceRepairSendBillEntity = null;
......@@ -2977,7 +2965,7 @@ public class RepairController {
//当前单位其他专管员id集合
List<Integer> ids = userPublicService.findOtherUser(userUtils.getCurrentUserId());
//省向国家发起的
if (level == 1) {
if (level == 1 && units.getType() == 1) {
ownUnit = userUtils.getCurrentUnitId();
//直接发起的
if (repairBillSaveVo.getTaskId() == null) {
......@@ -3044,7 +3032,7 @@ public class RepairController {
deviceRepairDetailService.save(repairDetail);
}
//如果当前为省像国家发起的
if (level == 1) {
if (level == 1 && units.getType() == 2) {
deviceLibraryEntity.setLifeStatus(4);
deviceLibraryEntity.setLocationUnit(repairBillSaveVo.getReceiveUnit());
}
......@@ -3059,7 +3047,7 @@ public class RepairController {
String deviceIdDetail = deviceRepairSendBillEntity.getRepairDeviceCheckDetail();
List<Integer> idList = StringSplitUtil.split(deviceIdDetail);
//如果当前为省,改变装备的所在为中办
if (level == 1) {
if (level == 1 && units.getType() == 1) {
//获取当前业务维修详情 记录
List<RepairDetail> repairDetailEntities = deviceRepairDetailService.findByBillId(repairBill.getId());
//改变维修详情装备所在单位为中办,状态为维修中
......@@ -3223,6 +3211,7 @@ public class RepairController {
@Transactional(rollbackFor = Exception.class)
public ResponseEntity saveRepairUnderBill(@RequestBody RepairBillSaveVo repairBillSaveVo) {
Integer currentUnitLevel = userUtils.getCurrentUnitLevel();
Units units = unitsCache.findById(userUtils.getCurrentUnitId());
//判断装备的状态是否在库或维修中
deviceLibraryService.isInStockOrRepairing(StringSplitUtil.split(repairBillSaveVo.getRepairDeviceCheckDetail()));
//第一次保存
......@@ -3273,7 +3262,7 @@ public class RepairController {
+ "共有" + repairBillSaveVo.getSendingCount() + "件",null, ".",
repairBill1.getId(), 5, userUtils.getCurrentUnitId(), 0, null, userIds);
//如果是省发起的维修
if (currentUnitLevel == 1){
if (currentUnitLevel == 1 && units.getType() == 1){
taskBto.setCustomInfo("country1");
}
TaskBto taskBto1 = taskService.start(taskBto);
......
......@@ -995,7 +995,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
deviceRepelDetail.setRepelStatus(2);
repelTaskStatistical.setTaskStatus(1);
if (units.getLevel() == 1) {
if (units.getLevel() == 1 && units.getType()==1) {
deviceLibraryService.upDateLeftStatusAndUnitNameAndLockStatus(filterTypeReturnLeftStatus(deviceRepel.getType()), deviceRepelDetail.getReceiveUnit(), 0, StringUtils.stringToList(deviceRepelDetail.getDeviceIds()));
} else {
deviceLibraryService.upDateLeftStatusAndUnitNameAndLockStatus(DeviceLifeStatus.IN_LIBRARY.id, deviceRepelDetail.getReceiveUnit(), 0, StringUtils.stringToList(deviceRepelDetail.getDeviceIds()));
......@@ -1024,7 +1024,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
} else {
repelTaskStatistical.setTaskStatus(1);
if (units.getLevel() == 1) {
if (units.getLevel() == 1 && units.getType() == 1) {
deviceLibraryService.upDateLeftStatusAndUnitNameAndLockStatus(filterTypeReturnLeftStatus(deviceRepel.getType()), deviceRepelDetail.getReceiveUnit(), 0, StringUtils.stringToList(deviceRepelDetail.getDeviceIds()));
} else {
deviceLibraryService.upDateLeftStatusAndUnitNameAndLockStatus(DeviceLifeStatus.SEND_BACK.id, deviceRepelDetail.getReceiveUnit(), 0, StringUtils.stringToList(deviceRepelDetail.getDeviceIds()));
......
......@@ -16,6 +16,7 @@ import com.tykj.dev.device.task.subject.domin.TaskLog;
import com.tykj.dev.device.task.subject.vo.TaskSelectVo;
import com.tykj.dev.device.task.subject.vo.TaskUserVo;
import com.tykj.dev.device.task.utils.TaskUtils;
import com.tykj.dev.device.user.cache.UnitsCache;
import com.tykj.dev.device.user.cache.UserCache;
import com.tykj.dev.device.user.read.service.MessageService;
import com.tykj.dev.device.user.read.subject.bto.MessageBto;
......@@ -93,6 +94,9 @@ public class TaskServiceImpl implements TaskService {
@Autowired
UnitsDao unitsDao;
@Autowired
UnitsCache unitsCache;
@Override
public Task deleteById(Task task) {
......@@ -625,21 +629,20 @@ public class TaskServiceImpl implements TaskService {
//办结 4 封存 5 全部 0 我发起的 1
if (num == 4 || num == 5 || num == 1 || num == 0) {
//获取单位等级
Integer level = userUtils.getCurrentUnitLevel();
Units unit= unitsCache.findById(userUtils.getCurrentUnitId());
//获取该单位以及下属单位所有用户Id
List<Integer> idLists = userPublicService.findAllUserIdByUnitsName(userUtils.getCurrentUserUnitName());
List<TaskUserVo> taskUserVos = new ArrayList<>();
//省能看到所有业务
if (level == 1) {
if (unit.getType() == 1 && unit.getLevel()==1) {
taskUserVos = taskDao.findAll(getSelectSpecification(taskSelectVo)).stream()
.filter(taskBto -> taskSelectVo.getType() == null
|| taskSelectVo.getType()==1?(taskBto.getCustomInfo()==null || !"country".equals(taskBto.getCustomInfo())):(taskBto.getCustomInfo()!=null&& "country".equals(taskBto.getCustomInfo())))
.map(Task::parse2Bto)
.map(TaskBto::toVo)
.collect(Collectors.toList());
}
//市或县只能看到涉及人员和idLists有交集的
if (level == 2 || level == 3) {
}else {
//市或县只能看到涉及人员和idLists有交集的
taskUserVos = taskDao.findAll(getSelectSpecification(taskSelectVo)).stream()
.map(Task::parse2Bto)
.map(TaskBto::toVo)
......@@ -856,22 +859,21 @@ public class TaskServiceImpl implements TaskService {
//办结 封存 全部 我发起的
if (num == 4 || num == 5 || num == 1 || num == 0) {
//获取单位等级
Integer level = userUtils.getCurrentUnitLevel();
Units units= unitsCache.findById(userUtils.getCurrentUnitId());
//获取该单位以及下属单位所有用户Id
// List<Integer> idLists = userPublicService.findAllUserIdByUnitsName(userUtils.getCurrentUserUnitName());
List<Integer> idLists = userPublicService.findOtherUser(userUtils.getCurrentUserId());
List<TaskUserVo> taskUserVos = new ArrayList<>();
//省能看到所有业务
if (level == 1) {
if (units.getLevel() == 1 && units.getType()==1) {
taskUserVos = taskDao.findAll(getSelectSpecification(taskSelectVo)).stream()
.filter(taskBto -> taskSelectVo.getType() == null
|| taskSelectVo.getType()==1?(taskBto.getCustomInfo()==null || !"country".equals(taskBto.getCustomInfo())):(taskBto.getCustomInfo()!=null&& "country".equals(taskBto.getCustomInfo())))
.map(Task::parse2Bto)
.map(TaskBto::toVo)
.collect(Collectors.toList());
}
//市或县只能看到涉及人员和idLists有交集的
if (level == 2 || level == 3) {
}else {
//市或县只能看到涉及人员和idLists有交集的
taskUserVos = taskDao.findAll(getSelectSpecification(taskSelectVo)).stream()
.map(Task::parse2Bto)
.map(TaskBto::toVo)
......
......@@ -183,7 +183,7 @@ public class TrainJobController {
taskService.start(taskBto);
}
);
if (securityUser.getCurrentUserInfo().getUnits().getLevel()==1){
if (securityUser.getCurrentUserInfo().getUnits().getLevel()==1 && securityUser.getCurrentUserInfo().getUnits().getType()==1){
List<Integer> userIds=userService.findAllByUnite(securityUser.getCurrentUserInfo().getUnitsId()).stream().map(User::getUserId).collect(Collectors.toList());
userIds.remove(securityUser.getCurrentUserInfo().getUserId());
messageService.add(new MessageBto(task.getId(),BusinessEnum.TRAIN.id,"发起"+(trainTheme.getTrainType()==0 ? "线上" : "线下")+ "培训业务:【"+messageToString(trainTheme)+"】",userIds,trainTheme.getTrainId().toString()));
......
......@@ -352,8 +352,10 @@ public class TrainThemeServiceImpl implements TrainThemeService {
predicateBuilder.lt("createTime", conditionsTrainVo.getEndTime());
}
Units units= unitsCache.findById(conditionsTrainVo.getUnitId());
if (units.getLevel()!=1){
if (units.getLevel() != 1){
predicateBuilder.eq("unitsId",conditionsTrainVo.getUnitId());
}
if (conditionsTrainVo.getDimName() != null) {
Class<TrainTheme> trainThemeClass = TrainTheme.class;
......
......@@ -197,7 +197,7 @@ public class UnitsServiceImpl implements UnitsService {
Units units = unitsDao.findById(unitsId).get();
List<Integer> areaIds = areaDao.findAllByFatherId(units.getAreaId()).stream().filter(area -> area.getType() <= 3).map(Area::getId).collect(Collectors.toList());
List<Units> units1 = unitsDao.findAllByAreaIdIn(areaIds);
if (units.getLevel() == 1) {
if (units.getLevel() == 1 && units.getType()==1) {
units1.add(units);
units1.addAll(unitsDao.findAllByType(2));
}
......@@ -209,7 +209,7 @@ public class UnitsServiceImpl implements UnitsService {
Units units = unitsDao.findById(unitsId).get();
List<Integer> areaIds= areaDao.findAllByFatherId(units.getAreaId()).stream().filter(area -> area.getType() <= 3).map(Area::getId).collect(Collectors.toList());
List<Units> units1= unitsDao.findAllByAreaIdIn(areaIds);
if (units.getLevel()==1){
if (units.getLevel()==1 && units.getType()==1){
units1.addAll(unitsDao.findAllByType(2));
}
units1.add(units);
......@@ -221,7 +221,7 @@ public class UnitsServiceImpl implements UnitsService {
Units units = unitsDao.findById(unitsId).get();
List<Integer> areaIds = areaDao.findAllByFatherId(units.getAreaId()).stream().filter(area -> area.getType() <= 3).map(Area::getId).collect(Collectors.toList());
List<Units> units1 = unitsDao.findAllByAreaIdIn(areaIds);
if (units.getLevel() == 1) {
if (units.getLevel() == 1 && units.getType()==1) {
// units1.add(units);
units1.addAll(unitsDao.findAllByType(2));
}
......
......@@ -28,6 +28,7 @@ import com.tykj.dev.device.sendback.service.RepelQueryService;
import com.tykj.dev.device.storage.repository.StorageBillDao;
import com.tykj.dev.device.storage.subject.domin.StorageBill;
import com.tykj.dev.device.user.cache.UnitsCache;
import com.tykj.dev.device.user.subject.entity.Units;
import com.tykj.dev.device.user.subject.service.UnitsService;
import com.tykj.dev.device.user.subject.service.UserPublicService;
import com.tykj.dev.device.user.util.UserUtils;
......@@ -351,6 +352,7 @@ public class DeviceUseReportServiceImpl implements DeviceUseReportService {
int decommissioningStatisticsNum = 0;//退役
int toRepairBackNum = 0;//向下级进行维修退回
int toRepairNum = 0;// 接收下级单位维修
Units units = unitsCache.findById(userUtils.getCurrentUnitId());
//筛选出日期范围内所有入库账单
List<StorageBill> storageBillEntities = storageBillDao.findAll().stream()
.filter(storageBillEntity -> storageBillEntity.getStorageStatus() == 2 && userUtils.getCurrentUserUnitName().equals(userPublicService.findUnitsNameByUserId(storageBillEntity.getReceiveUseraId())) && storageBillEntity.getUpdateTime().after(date) && storageBillEntity.getUpdateTime().before(date2))
......@@ -419,7 +421,7 @@ public class DeviceUseReportServiceImpl implements DeviceUseReportService {
}
}
//筛选出配接收退回的账单 接收退回
if (userUtils.getCurrentUnitLevel() != 1){
if (userUtils.getCurrentUnitLevel() != 1 && units.getType() == 1){
//发起退回
// List<AllotBackBill> sendAllotBackBills = allotBackBillDao.findAll().stream()
// .filter(allotBackBill -> allotStatusBackList.contains(allotBackBill.getBackStatus()) && userUtils.getCurrentUserUnitName().equals(allotBackBill.getSendUnit()) && allotBackBill.getSendTime().after(date) && allotBackBill.getSendTime().before(date2))
......@@ -441,7 +443,7 @@ public class DeviceUseReportServiceImpl implements DeviceUseReportService {
}
//省级才能销毁,列装,退装 退役 报废
if (userUtils.getCurrentUnitLevel() == 1) {
if (userUtils.getCurrentUnitLevel() == 1 && units.getType() == 1) {
//报废
int scrapStatisticsCount = this.getScrapStatisticsCount(date, date2);
scrapStatisticsNum = scrapStatisticsCount;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论