|
@@ -633,52 +633,49 @@ public class WorkProjectNotifyController extends BaseController {
|
|
|
public List<Map<String, Object>> getList(WorkProjectNotify workProjectNotify, Page<WorkProjectNotify> page) {
|
|
|
User user = UserUtils.getUser();
|
|
|
workProjectNotify.setUser(user);
|
|
|
- if (StringUtils.isNotBlank(workProjectNotify.getUserName())) {
|
|
|
- workProjectNotify.setUserName(workProjectNotify.getUserName());
|
|
|
- }
|
|
|
- if (StringUtils.isNotBlank(workProjectNotify.getTitle())) {
|
|
|
- workProjectNotify.setTitle(workProjectNotify.getTitle());
|
|
|
- }
|
|
|
- if (Objects.nonNull(workProjectNotify.getStartDate())) {
|
|
|
- workProjectNotify.setStartDate(workProjectNotify.getStartDate());
|
|
|
- }
|
|
|
- if (Objects.nonNull(workProjectNotify.getEndDate())) {
|
|
|
- workProjectNotify.setEndDate(workProjectNotify.getEndDate());
|
|
|
- }
|
|
|
workProjectNotify.setCompanyId(UserUtils.getSelectCompany().getId());
|
|
|
workProjectNotify.setRemarks("待审批");
|
|
|
Page<WorkProjectNotify> workProjectNotifyPage = workProjectNotifyService.findPage(new Page<>(1,-1),workProjectNotify);
|
|
|
- if(workProjectNotifyPage.getList().size()>0){
|
|
|
- for (WorkProjectNotify info: workProjectNotifyPage.getList()) {
|
|
|
+ formatNotifyResp(workProjectNotifyPage.getList()); // 格式化待办数据
|
|
|
+ List<Map<String, Object>> maps = new ArrayList<>();
|
|
|
+ if (StringUtils.isNotBlank(workProjectNotify.getBelongProject())&&"ccpm".equals(workProjectNotify.getBelongProject())) {
|
|
|
+ JSON.DEFAULT_GENERATE_FEATURE = SerializerFeature.config(
|
|
|
+ JSON.DEFAULT_GENERATE_FEATURE, SerializerFeature.SkipTransientField, false);
|
|
|
+ maps.addAll((List)JSONArray.parseArray(JSON.toJSONString(workProjectNotifyPage.getList())));
|
|
|
+ } else {
|
|
|
+ maps = ConvertServiceUtil.copyNotifyListToCenter(workProjectNotifyPage.getList());
|
|
|
+ }
|
|
|
+ return maps;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 格式化待办数据
|
|
|
+ */
|
|
|
+ public void formatNotifyResp(List<WorkProjectNotify> list) {
|
|
|
+ if (list.size() > 0) {
|
|
|
+ for (WorkProjectNotify info: list) {
|
|
|
// 获取流程类型
|
|
|
String typeLabel = DictUtils.getDictLabel(info.getType(),"project_notify_type","");
|
|
|
info.setTypeLabel(typeLabel);
|
|
|
// 获取流程提交人
|
|
|
- User cUser = UserUtils.getByUserId(info.getInitiator());
|
|
|
- if (Objects.nonNull(cUser)) {
|
|
|
- info.setCreateUserName(cUser.getName());
|
|
|
+ if (Objects.nonNull(info.getCreateBy())) {
|
|
|
+ User cUser = UserUtils.getByUserId(info.getCreateBy().getId());
|
|
|
+ if (Objects.nonNull(cUser)) {
|
|
|
+ info.setCreateUserName(cUser.getName());
|
|
|
+ }
|
|
|
}
|
|
|
// 获取流程审核人
|
|
|
User audit = UserUtils.getByUserId(info.getAuditor());
|
|
|
if (Objects.nonNull(audit)) {
|
|
|
info.setAuditUserName(audit.getName());
|
|
|
}
|
|
|
+ // 设置所属系统为ccpm
|
|
|
info.setBelongProject("ccpm");
|
|
|
}
|
|
|
}
|
|
|
- List<Map<String, Object>> maps = new ArrayList<>();
|
|
|
- if (StringUtils.isNotBlank(workProjectNotify.getBelongProject())&&"ccpm".equals(workProjectNotify.getBelongProject())) {
|
|
|
- JSON.DEFAULT_GENERATE_FEATURE = SerializerFeature.config(
|
|
|
- JSON.DEFAULT_GENERATE_FEATURE, SerializerFeature.SkipTransientField, false);
|
|
|
- maps.addAll((List)JSONArray.parseArray(JSON.toJSONString(workProjectNotifyPage.getList())));
|
|
|
- } else {
|
|
|
- maps = ConvertServiceUtil.copyNotifyListToCenter(workProjectNotifyPage.getList());
|
|
|
- }
|
|
|
- return maps;
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 已审批待办列表页面
|
|
|
*/
|
|
@@ -707,6 +704,31 @@ public class WorkProjectNotifyController extends BaseController {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * 已审批待办(全部已办数据)
|
|
|
+ */
|
|
|
+ @RequestMapping(value = {"backlogListReadAll"}, method = RequestMethod.GET)
|
|
|
+ @ResponseBody
|
|
|
+ public List<Map<String, Object>> backlogListReadAll(WorkProjectNotify workProjectNotify) {
|
|
|
+ User user = UserUtils.getUser();
|
|
|
+ workProjectNotify.setCreateBy(user);
|
|
|
+ workProjectNotify.setUser(user);
|
|
|
+ workProjectNotify.setStatus("2");
|
|
|
+ workProjectNotify.setRemarks("待通知");
|
|
|
+ workProjectNotify.setCompanyId(UserUtils.getSelectCompany().getId());
|
|
|
+ Page<WorkProjectNotify> pageList = workProjectNotifyService.findReadPage(new Page<WorkProjectNotify>(1,-1),workProjectNotify);
|
|
|
+ formatNotifyResp(pageList.getList()); // 格式化已办数据
|
|
|
+ List<Map<String, Object>> maps = new ArrayList<>();
|
|
|
+ if (StringUtils.isNotBlank(workProjectNotify.getBelongProject())&&"ccpm".equals(workProjectNotify.getBelongProject())) {
|
|
|
+ JSON.DEFAULT_GENERATE_FEATURE = SerializerFeature.config(
|
|
|
+ JSON.DEFAULT_GENERATE_FEATURE, SerializerFeature.SkipTransientField, false);
|
|
|
+ maps.addAll((List)JSONArray.parseArray(JSON.toJSONString(pageList.getList())));
|
|
|
+ } else {
|
|
|
+ maps = ConvertServiceUtil.copyHisTaskListToCenter(pageList.getList());
|
|
|
+ }
|
|
|
+ return maps;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* 已审批待办列表页面
|
|
|
*/
|
|
|
@RequestMapping(value = {"readShowCount"})
|