|
|
|
|
@ -89,17 +89,6 @@ public class WorkService extends ServiceImpl<WorkMapper, Work> {
|
|
|
|
|
return saveBatch(list); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public boolean save(Mail mail, String empNo, LocalDateTime time, String flowName) { |
|
|
|
|
Work work = new Work(); |
|
|
|
|
BeanUtils.copyProperties(mail, work); |
|
|
|
|
work.setMailId(mail.getId()) |
|
|
|
|
.setPoliceEmpNo(empNo) |
|
|
|
|
.setCreateTime(time) |
|
|
|
|
.setUpdateTime(time) |
|
|
|
|
.setFlowName(flowName); |
|
|
|
|
return save(work); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public boolean saveOrUpdate(Mail mail, Integer roleId, Integer deptId, LocalDateTime time, Boolean mainDeptFlag, String flowName) { |
|
|
|
|
return saveOrUpdate(mail, roleId, deptId, time, mainDeptFlag, flowName, null); |
|
|
|
|
} |
|
|
|
|
@ -138,20 +127,23 @@ public class WorkService extends ServiceImpl<WorkMapper, Work> {
|
|
|
|
|
Integer roleId = AdminThreadLocal.getRoleId(); |
|
|
|
|
Integer signRoleId = RoleEnum.MUNICIPAL_DEPT_CLASSES.getRoleId().equals(roleId) ? RoleEnum.SECOND_DEPT_CLASSES.getRoleId() : |
|
|
|
|
RoleEnum.THREE_DEPT_CLASSES.getRoleId(); |
|
|
|
|
List<Work> collect = countersignDeptIds.stream().map(id -> { |
|
|
|
|
Work work = new Work(); |
|
|
|
|
BeanUtils.copyProperties(mail, work); |
|
|
|
|
work.setMailId(mail.getId()) |
|
|
|
|
.setSignRoleId(signRoleId) |
|
|
|
|
.setSignDeptId(id) |
|
|
|
|
.setCreateTime(time) |
|
|
|
|
.setUpdateTime(time) |
|
|
|
|
countersignDeptIds.forEach(id -> { |
|
|
|
|
Work work = getOne(mail.getId(), signRoleId, id); |
|
|
|
|
if (Objects.isNull(work)) { |
|
|
|
|
work = new Work(); |
|
|
|
|
BeanUtils.copyProperties(mail, work); |
|
|
|
|
work.setMailId(mail.getId()) |
|
|
|
|
.setSignRoleId(signRoleId) |
|
|
|
|
.setSignDeptId(id) |
|
|
|
|
.setCreateTime(time); |
|
|
|
|
} |
|
|
|
|
work.setUpdateTime(time) |
|
|
|
|
// 部门会签
|
|
|
|
|
.setWorkType(WorkType.dept_countersign.name()) |
|
|
|
|
.setFlowName(FlowNameEnum.PENDING_COUNTERSIGN.getName()); |
|
|
|
|
return work; |
|
|
|
|
}).collect(Collectors.toList()); |
|
|
|
|
return saveBatch(collect); |
|
|
|
|
saveOrUpdate(work); |
|
|
|
|
}); |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public boolean updateDone(String mailId, Integer roleId, Integer deptId, String flowName) { |
|
|
|
|
@ -232,7 +224,11 @@ public class WorkService extends ServiceImpl<WorkMapper, Work> {
|
|
|
|
|
workVoPage.getRecords().forEach(item -> { |
|
|
|
|
// 会签中
|
|
|
|
|
if (FlowNameEnum.COUNTERSIGNING.getName().equals(item.getFlowName())) { |
|
|
|
|
item.setFlowName(String.format("%s(%s/%s)", item.getFlowName(), item.getCountersignCompleted(), item.getCountersignTotal())); |
|
|
|
|
if (item.getCountersignCompleted().equals(item.getCountersignTotal())) { |
|
|
|
|
item.setFlowName(FlowNameEnum.COUNTERSIGNING.getDoneName()); |
|
|
|
|
} else { |
|
|
|
|
item.setFlowName(String.format("%s(%s/%s)", item.getFlowName(), item.getCountersignCompleted(), item.getCountersignTotal())); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
return workVoPage; |
|
|
|
|
|