提交 5da40544 authored 作者: 邓砥奕's avatar 邓砥奕

更新

上级 50f3ecce
...@@ -118,7 +118,7 @@ public class DeviceApplyController { ...@@ -118,7 +118,7 @@ public class DeviceApplyController {
List<Integer> userIds = new ArrayList<>(); List<Integer> userIds = new ArrayList<>();
userIds.add(userId); userIds.add(userId);
userIds.add(0); userIds.add(0);
taskBto = new TaskBto(StatusEnum.WAIT_APPLY_FILE.id, "申请业务", null, ".", deviceApplyBillEntity.getId(), 9,userUtils.getCurrentUnitId(), 1, null, userIds); taskBto = new TaskBto(StatusEnum.WAIT_APPLY_FILE.id, "申请业务", null, ".", deviceApplyBillEntity.getId(), 9,userUtils.getCurrentUnitId(), 1, "country", userIds);
} }
else { else {
//指定批复人 //指定批复人
......
...@@ -54,7 +54,7 @@ public enum LogType { ...@@ -54,7 +54,7 @@ public enum LogType {
SELF_CHECK_2(18,SELF_CHECK.id, WAIT_SELF_CHECK.id, SELF_CHECK_CONFIRM.id, "周期自查"), SELF_CHECK_2(18,SELF_CHECK.id, WAIT_SELF_CHECK.id, SELF_CHECK_CONFIRM.id, "周期自查"),
SELF_CHECK_3(19,SELF_CHECK.id, SELF_CHECK_CONFIRM.id, END.id, "自查审核成功"), SELF_CHECK_3(19,SELF_CHECK.id, SELF_CHECK_CONFIRM.id, END.id, "上传自查单"),
SELF_CHECK_4(20,SELF_CHECK.id, SELF_CHECK_CONFIRM.id, ARCHIVE.id, "自查审核失败"), SELF_CHECK_4(20,SELF_CHECK.id, SELF_CHECK_CONFIRM.id, ARCHIVE.id, "自查审核失败"),
......
...@@ -12,6 +12,7 @@ import com.tykj.dev.device.library.subject.domin.DeviceLibrary; ...@@ -12,6 +12,7 @@ import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import com.tykj.dev.device.library.subject.domin.DeviceLog; import com.tykj.dev.device.library.subject.domin.DeviceLog;
import com.tykj.dev.device.library.subject.vo.*; import com.tykj.dev.device.library.subject.vo.*;
import com.tykj.dev.device.user.util.UserUtils; import com.tykj.dev.device.user.util.UserUtils;
import com.tykj.dev.misc.base.CustomOrder;
import com.tykj.dev.misc.exception.ApiException; import com.tykj.dev.misc.exception.ApiException;
import com.tykj.dev.misc.utils.GetTreeUtils; import com.tykj.dev.misc.utils.GetTreeUtils;
import com.tykj.dev.misc.utils.PageUtil; import com.tykj.dev.misc.utils.PageUtil;
...@@ -152,12 +153,50 @@ public class DeviceLibraryController { ...@@ -152,12 +153,50 @@ public class DeviceLibraryController {
resultList.forEach(DeviceLibrary::setConfigName); resultList.forEach(DeviceLibrary::setConfigName);
Map<Integer, DeviceLibrary> nodeCollect = Map<Integer, DeviceLibrary> nodeCollect =
resultList.stream().collect(Collectors.toMap(DeviceLibrary::getId, deviceLibraryEntity -> deviceLibraryEntity)); resultList.stream().collect(Collectors.toMap(DeviceLibrary::getId, deviceLibraryEntity -> deviceLibraryEntity));
List<Comparator<DeviceVo>> comparators = new ArrayList<>();
if (deviceLibrarySelectVo.getOrders().size() > 0) {
for (CustomOrder c:deviceLibrarySelectVo.getOrders()) {
if ("model".equals(c.getCoulmn())){
if ("ASC".equals(c.getDirection().toString())) {
comparators.add(Comparator.comparing(DeviceVo::getModel,Comparator.nullsFirst(String::compareTo)));
}
else if ("DESC".equals(c.getDirection().toString())) {
comparators.add(Comparator.comparing(DeviceVo::getModel,Comparator.nullsFirst(String::compareTo)).reversed());
}
}
else if ("name".equals(c.getCoulmn())){
if ("ASC".equals(c.getDirection().toString())) {
comparators.add(Comparator.comparing(DeviceVo::getName,Comparator.nullsFirst(String::compareTo)));
}
else if ("DESC".equals(c.getDirection().toString())) {
comparators.add(Comparator.comparing(DeviceVo::getName,Comparator.nullsFirst(String::compareTo)).reversed());
}
}
else if ("seqNumber".equals(c.getCoulmn())){
if ("ASC".equals(c.getDirection().toString())) {
comparators.add(Comparator.comparing(DeviceVo::getSeqNumber,Comparator.nullsFirst(String::compareTo)));
}
else if ("DESC".equals(c.getDirection().toString())) {
comparators.add(Comparator.comparing(DeviceVo::getSeqNumber,Comparator.nullsFirst(String::compareTo)).reversed());
}
}
}
}
List<DeviceVo> containList = GetTreeUtils.parseTreeFromDown( List<DeviceVo> containList = GetTreeUtils.parseTreeFromDown(
resultList, resultList,
DeviceLibrary::getId, DeviceLibrary::getId,
deviceLibraryEntity -> Optional.ofNullable(nodeCollect.get(deviceLibraryEntity.getPartParentId())), deviceLibraryEntity -> Optional.ofNullable(nodeCollect.get(deviceLibraryEntity.getPartParentId())),
DeviceLibrary::addChildNode DeviceLibrary::addChildNode
).stream().map(DeviceLibrary::parseVo).sorted(Comparator.comparing(DeviceVo::getLifeStatus)).collect(Collectors.toList()); ).stream().map(DeviceLibrary::parseVo).sorted(Comparator.comparing(DeviceVo::getLifeStatus)).collect(Collectors.toList());
if (comparators.size()==1){
containList = containList.stream().sorted(comparators.get(0)).collect(Collectors.toList());
}
else if(comparators.size()==2){
containList = containList.stream().sorted(comparators.get(0).thenComparing(comparators.get(1))).collect(Collectors.toList());
}
else if(comparators.size()==3){
containList = containList.stream().sorted(comparators.get(0).thenComparing(comparators.get(1)).thenComparing(comparators.get(2))).collect(Collectors.toList());
}
map.put("models",resultList.stream().map(DeviceLibrary::getModel).collect(Collectors.toSet())); map.put("models",resultList.stream().map(DeviceLibrary::getModel).collect(Collectors.toSet()));
map.put("names",resultList.stream().map(DeviceLibrary::getName).collect(Collectors.toSet())); map.put("names",resultList.stream().map(DeviceLibrary::getName).collect(Collectors.toSet()));
Set<Integer> status = resultList.stream().map(DeviceLibrary::getLifeStatus).collect(Collectors.toSet()); Set<Integer> status = resultList.stream().map(DeviceLibrary::getLifeStatus).collect(Collectors.toSet());
......
package com.tykj.dev.misc.base; package com.tykj.dev.misc.base;
import lombok.Data; import lombok.Data;
import org.springframework.data.domain.Sort;
/** /**
* 描述:Jpa排序类 * 描述:Jpa排序类
...@@ -15,6 +14,8 @@ public class CustomOrder { ...@@ -15,6 +14,8 @@ public class CustomOrder {
private String coulmn; private String coulmn;
private Sort.Direction direction; // private Sort.Direction direction;
private String direction;
} }
...@@ -3,7 +3,6 @@ package com.tykj.dev.misc.base; ...@@ -3,7 +3,6 @@ package com.tykj.dev.misc.base;
import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Sort;
import org.springframework.util.Assert; import org.springframework.util.Assert;
import javax.validation.constraints.Min; import javax.validation.constraints.Min;
...@@ -25,7 +24,7 @@ public class CustomPage { ...@@ -25,7 +24,7 @@ public class CustomPage {
@Min(1) @Min(1)
private Integer size = 15; private Integer size = 15;
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY) // @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
private List<CustomOrder> orders = new ArrayList<>(); private List<CustomOrder> orders = new ArrayList<>();
public Integer getPage() { public Integer getPage() {
...@@ -65,12 +64,12 @@ public class CustomPage { ...@@ -65,12 +64,12 @@ public class CustomPage {
@JsonIgnore @JsonIgnore
public PageRequest getPageable() { public PageRequest getPageable() {
if (orders.size() != 0) { // if (orders.size() != 0) {
List<Sort.Order> orders = new ArrayList<>(); // List<Sort.Order> orders = new ArrayList<>();
this.orders.stream().forEach(item -> // this.orders.stream().forEach(item ->
orders.add(new Sort.Order(item.getDirection(), item.getCoulmn()))); // orders.add(new Sort.Order(item.getDirection(), item.getCoulmn())));
return PageRequest.of(getPage(), getLimit(), Sort.by(orders)); // return PageRequest.of(getPage(), getLimit(), Sort.by(orders));
} // }
return PageRequest.of(getPage(), getLimit()); return PageRequest.of(getPage(), getLimit());
......
...@@ -191,9 +191,9 @@ public enum StatusEnum { ...@@ -191,9 +191,9 @@ public enum StatusEnum {
WAIT_SELF_CHECK(400, "待自查"), WAIT_SELF_CHECK(400, "待自查"),
/** /**
* 自查待审核 * 待上传自查单
*/ */
SELF_CHECK_CONFIRM(401, "自查待审核"), SELF_CHECK_CONFIRM(401, "待上传自查单"),
/** /**
* 装备申请待批复 * 装备申请待批复
......
...@@ -297,7 +297,7 @@ public class RepairController { ...@@ -297,7 +297,7 @@ public class RepairController {
List<Integer> ids = userPublicService.findOtherUser(userUtils.getCurrentUserId()); List<Integer> ids = userPublicService.findOtherUser(userUtils.getCurrentUserId());
if (level == 1) { if (level == 1) {
ownUnit = userUtils.getCurrentUnitId(); ownUnit = userUtils.getCurrentUnitId();
TaskBto taskBto = new TaskBto(StatusEnum.WAIT_UPLOAD_FILE.id, "维修业务", null, ".", repairBill1.getId(), 5, ownUnit, 1, null, userIds); TaskBto taskBto = new TaskBto(StatusEnum.WAIT_UPLOAD_FILE.id, "维修业务", null, ".", repairBill1.getId(), 5, ownUnit, 1, "country", userIds);
saveEntity = taskService.start(taskBto); saveEntity = taskService.start(taskBto);
} else { } else {
ownUnit = userPublicService.findUnitIdByName(repairBill.getReceiveUnit()); ownUnit = userPublicService.findUnitIdByName(repairBill.getReceiveUnit());
...@@ -963,7 +963,7 @@ public class RepairController { ...@@ -963,7 +963,7 @@ public class RepairController {
} }
else { else {
userIds.add(0); userIds.add(0);
TaskBto taskBto1 = new TaskBto(StatusEnum.WAIT_UPLOAD_BACK_FILE.id, "维修退回", null, ".", repairBackBill1.getId(), BusinessEnum.REPAIR_BACK.id, userUtils.getCurrentUnitId(), 0, null, userIds); TaskBto taskBto1 = new TaskBto(StatusEnum.WAIT_UPLOAD_BACK_FILE.id, "维修退回", null, ".", repairBackBill1.getId(), BusinessEnum.REPAIR_BACK.id, userUtils.getCurrentUnitId(), 0, "country", userIds);
taskBto2 = taskService.start(taskBto1); taskBto2 = taskService.start(taskBto1);
} }
for (DeviceDetailVo d : repairReceiveVo.getDeviceList()) { for (DeviceDetailVo d : repairReceiveVo.getDeviceList()) {
......
...@@ -16,6 +16,8 @@ import com.tykj.dev.device.selfcheck.subject.vo.*; ...@@ -16,6 +16,8 @@ import com.tykj.dev.device.selfcheck.subject.vo.*;
import com.tykj.dev.device.task.service.TaskLogService; import com.tykj.dev.device.task.service.TaskLogService;
import com.tykj.dev.device.task.service.TaskService; import com.tykj.dev.device.task.service.TaskService;
import com.tykj.dev.device.task.subject.bto.TaskBto; import com.tykj.dev.device.task.subject.bto.TaskBto;
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.service.UserPublicService; import com.tykj.dev.device.user.subject.service.UserPublicService;
import com.tykj.dev.device.user.util.UserUtils; import com.tykj.dev.device.user.util.UserUtils;
import com.tykj.dev.misc.base.BusinessEnum; import com.tykj.dev.misc.base.BusinessEnum;
...@@ -83,6 +85,9 @@ public class SelfCheckController { ...@@ -83,6 +85,9 @@ public class SelfCheckController {
@Autowired @Autowired
private SelfCheckSchedulerTask selfCheckSchedulerTask; private SelfCheckSchedulerTask selfCheckSchedulerTask;
@Autowired
private MessageService messageService;
/** /**
* 月度 * 月度
*/ */
...@@ -311,13 +316,24 @@ public class SelfCheckController { ...@@ -311,13 +316,24 @@ public class SelfCheckController {
//添加涉及人员 //添加涉及人员
taskService.addInvolveUser(taskBto,userId); taskService.addInvolveUser(taskBto,userId);
//推至下一阶段 //推至下一阶段
taskService.moveToNext(taskBto,selfCheckSaveVo.getUserbId()); taskService.moveToNext(taskBto,selfExaminationBillEntity1.getUseraId());
} }
else if (selfCheckSaveVo.getType()==1){ else if (selfCheckSaveVo.getType()==1){
taskBto.setCustomInfo("扫码"); taskBto.setCustomInfo("扫码");
//添加涉及人员 //添加涉及人员
taskService.addInvolveUser(taskBto,userId); taskService.addInvolveUser(taskBto,userId);
taskService.moveToEnd(taskBto); if (selfCheckSaveVo.getUserbId()!=null) {
taskService.moveToEnd(taskBto);
selfExaminationBillEntity1.setUserbId(selfCheckSaveVo.getUserbId());
List<Integer> idList = new ArrayList<>();
idList.add(selfCheckSaveVo.getUserbId());
//阅知
MessageBto messageBto = new MessageBto(taskBto.getId(), taskBto.getBusinessType(), "完成终端自查", idList, 0);
messageService.add(messageBto);
}
else {
taskService.moveToNext(taskBto,selfExaminationBillEntity1.getUseraId());
}
selfExaminationBillEntity1.setCheckStatus(2); selfExaminationBillEntity1.setCheckStatus(2);
selfExaminationBillService.update(selfExaminationBillEntity1); selfExaminationBillService.update(selfExaminationBillEntity1);
} }
...@@ -329,22 +345,29 @@ public class SelfCheckController { ...@@ -329,22 +345,29 @@ public class SelfCheckController {
//发起任务 //发起任务
List<Integer> userIds = new ArrayList<>(); List<Integer> userIds = new ArrayList<>();
userIds.add(userId); userIds.add(userId);
if (selfExaminationBillEntity1.getUserbId()!=null){ // if (selfExaminationBillEntity1.getUserbId()!=null){
userIds.add(selfExaminationBillEntity1.getUserbId()); // userIds.add(selfExaminationBillEntity1.getUserbId());
} // }
TaskBto taskBto = new TaskBto(StatusEnum.SELF_CHECK_CONFIRM.id, "自查业务", null, ".", selfExaminationBillEntity1.getId(), 4, userUtils.getCurrentUnitId(), 1, null, userIds); TaskBto taskBto = new TaskBto(StatusEnum.SELF_CHECK_CONFIRM.id, "自查业务", null, ".", selfExaminationBillEntity1.getId(), 4, userUtils.getCurrentUnitId(), 0, null, userIds);
if (selfCheckSaveVo.getType()==0){ if (selfCheckSaveVo.getType()==0){
if (selfCheckSaveVo.getUserbId()==null){
throw new ApiException("审核人不能为空");
}
taskBto.setCustomInfo("手动"); taskBto.setCustomInfo("手动");
taskService.start(taskBto); taskService.start(taskBto);
} }
else if (selfCheckSaveVo.getType()==1){ else if (selfCheckSaveVo.getType()==1){
taskBto.setCustomInfo("扫码"); taskBto.setCustomInfo("扫码");
taskBto.setBillStatus(StatusEnum.END.id); if (selfCheckSaveVo.getUserbId()!=null) {
taskBto.setCurrentPoint(0); taskBto.setBillStatus(StatusEnum.END.id);
taskService.start(taskBto); }
// taskBto.setCurrentPoint(0);
TaskBto taskBto1 = taskService.start(taskBto);
if (selfCheckSaveVo.getUserbId()!=null) {
selfExaminationBillEntity1.setUserbId(selfCheckSaveVo.getUserbId());
List<Integer> idList = new ArrayList<>();
idList.add(selfCheckSaveVo.getUserbId());
//阅知
MessageBto messageBto = new MessageBto(taskBto1.getId(), taskBto1.getBusinessType(), "完成终端自查", idList, 0);
messageService.add(messageBto);
}
selfExaminationBillEntity1.setCheckStatus(2); selfExaminationBillEntity1.setCheckStatus(2);
selfExaminationBillService.update(selfExaminationBillEntity1); selfExaminationBillService.update(selfExaminationBillEntity1);
} }
...@@ -378,11 +401,17 @@ public class SelfCheckController { ...@@ -378,11 +401,17 @@ public class SelfCheckController {
if (selfCheckConfirmVo.getStatus() == 0) { if (selfCheckConfirmVo.getStatus() == 0) {
taskService.update(taskService.moveToEnd(taskBto)); taskService.update(taskService.moveToEnd(taskBto));
selfExaminationBillEntity.setCheckStatus(2); selfExaminationBillEntity.setCheckStatus(2);
selfExaminationBillEntity.setUserbId(selfCheckConfirmVo.getUserbId());
selfExaminationBillService.update(selfExaminationBillEntity); selfExaminationBillService.update(selfExaminationBillEntity);
//阅知
List<Integer> idList = new ArrayList<>();
idList.add(selfCheckConfirmVo.getUserbId());
MessageBto messageBto = new MessageBto(taskBto.getId(), taskBto.getBusinessType(), "完成终端自查", idList, 0);
messageService.add(messageBto);
for (String s:strings) { for (String s:strings) {
if (s.length()>=2) { if (s.length()>=2) {
Integer id = Integer.parseInt(s.substring(0, s.length() - 1)); Integer id = Integer.parseInt(s.substring(0, s.length() - 1));
DeviceLogDto deviceLogDto = new DeviceLogDto(id,"自查审核成功",null); DeviceLogDto deviceLogDto = new DeviceLogDto(id,"上传自查单",null);
deviceLogService.addLog(deviceLogDto); deviceLogService.addLog(deviceLogDto);
} }
} }
......
...@@ -28,4 +28,7 @@ public class SelfCheckConfirmVo { ...@@ -28,4 +28,7 @@ public class SelfCheckConfirmVo {
@Min(value = 0,message = "status不能小于0") @Min(value = 0,message = "status不能小于0")
@ApiModelProperty(name = "需要修改的状态", example = "0", value = "0为审核通过,1为驳回") @ApiModelProperty(name = "需要修改的状态", example = "0", value = "0为审核通过,1为驳回")
private Integer status; private Integer status;
@ApiModelProperty(name = "审核人ID", example = "1")
private Integer userbId;
} }
...@@ -643,7 +643,8 @@ public class TaskServiceImpl implements TaskService { ...@@ -643,7 +643,8 @@ public class TaskServiceImpl implements TaskService {
boolean userConfirm = userId.equals(taskBto.getInvolveUserIdList().get(taskBto.getCurrentPoint())); boolean userConfirm = userId.equals(taskBto.getInvolveUserIdList().get(taskBto.getCurrentPoint()));
boolean noUserHandle = taskBto.getInvolveUserIdList().get(taskBto.getCurrentPoint()) == 0; boolean noUserHandle = taskBto.getInvolveUserIdList().get(taskBto.getCurrentPoint()) == 0;
boolean belongUnit = taskBto.getOwnUnit().equals(userUtils.getCurrentUnitId()); boolean belongUnit = taskBto.getOwnUnit().equals(userUtils.getCurrentUnitId());
return involveExists && pointExists && (userConfirm || (noUserHandle && belongUnit)); boolean isCountry = taskSelectVo.getType()==1?(taskBto.getCustomInfo()==null|| !"country".equals(taskBto.getCustomInfo())):(taskBto.getCustomInfo()!=null&& "country".equals(taskBto.getCustomInfo()));
return involveExists && pointExists && (userConfirm || (noUserHandle && belongUnit)) && isCountry;
}) })
.collect(Collectors.toList()); .collect(Collectors.toList());
//查询所有的业务 //查询所有的业务
......
...@@ -25,5 +25,7 @@ public class TaskSelectVo extends CustomPage { ...@@ -25,5 +25,7 @@ public class TaskSelectVo extends CustomPage {
private Integer selectNum; private Integer selectNum;
@ApiModelProperty(value = "业务类型id", example = "1") @ApiModelProperty(value = "业务类型id", example = "1")
private List<Integer> businessType; private List<Integer> businessType;
@ApiModelProperty(value = "待办类型(1:省内待办,2:省外待办)", example = "1")
private Integer type;
} }
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论