|
@@ -7,6 +7,7 @@ import com.huaxu.model.AjaxMessage;
|
|
import com.huaxu.model.LoginUser;
|
|
import com.huaxu.model.LoginUser;
|
|
import com.huaxu.model.Pagination;
|
|
import com.huaxu.model.Pagination;
|
|
import com.huaxu.model.ResultStatus;
|
|
import com.huaxu.model.ResultStatus;
|
|
|
|
+import com.huaxu.order.entity.WorkFlowDetail;
|
|
import com.huaxu.order.entity.WorkFlowLog;
|
|
import com.huaxu.order.entity.WorkFlowLog;
|
|
import com.huaxu.order.service.WorkFlowLogService;
|
|
import com.huaxu.order.service.WorkFlowLogService;
|
|
import com.huaxu.process.entity.ProcessDefinition;
|
|
import com.huaxu.process.entity.ProcessDefinition;
|
|
@@ -100,7 +101,7 @@ public class PlanManageController {
|
|
|
|
|
|
@GetMapping("/plan/select")
|
|
@GetMapping("/plan/select")
|
|
@ApiOperation(value = "查询巡检计划")
|
|
@ApiOperation(value = "查询巡检计划")
|
|
- public AjaxMessage<Pagination<TaskManage>> selectPlan(
|
|
|
|
|
|
+ public AjaxMessage<Pagination<PlanManageDto>> selectPlan(
|
|
@ApiParam(value = "页数", required = true)@RequestParam Integer pageNum,
|
|
@ApiParam(value = "页数", required = true)@RequestParam Integer pageNum,
|
|
@ApiParam(value = "条数", required = true)@RequestParam Integer pageSize,
|
|
@ApiParam(value = "条数", required = true)@RequestParam Integer pageSize,
|
|
@ApiParam(value = "任务类型(巡检:7,侧漏:8,养护:9)", required = false) @RequestParam(required = false) Integer taskType,
|
|
@ApiParam(value = "任务类型(巡检:7,侧漏:8,养护:9)", required = false) @RequestParam(required = false) Integer taskType,
|
|
@@ -123,16 +124,16 @@ public class PlanManageController {
|
|
planManageDto.setUserType(loginUser.getType());
|
|
planManageDto.setUserType(loginUser.getType());
|
|
//1是公司,2是公司及以下,3部门,4部门及以下,5自定义
|
|
//1是公司,2是公司及以下,3部门,4部门及以下,5自定义
|
|
planManageDto.setPermissonType(loginUser.getPermissonType());
|
|
planManageDto.setPermissonType(loginUser.getPermissonType());
|
|
- IPage<TaskManage> iPage = new Page<>(pageNum, pageSize);
|
|
|
|
|
|
+ IPage<PlanManageDto> iPage = new Page<>(pageNum, pageSize);
|
|
iPage = planManageService.selectPage(iPage, planManageDto);
|
|
iPage = planManageService.selectPage(iPage, planManageDto);
|
|
- Pagination<TaskManage> pages = new Pagination<>(iPage);
|
|
|
|
- setUserName(pages);
|
|
|
|
|
|
+ Pagination<PlanManageDto> pages = new Pagination<>(iPage);
|
|
|
|
+ setName(pages.getList());
|
|
return new AjaxMessage<>(ResultStatus.OK, pages);
|
|
return new AjaxMessage<>(ResultStatus.OK, pages);
|
|
}
|
|
}
|
|
|
|
|
|
@GetMapping("/plan/pending")
|
|
@GetMapping("/plan/pending")
|
|
@ApiOperation(value = "查询待处理任务")
|
|
@ApiOperation(value = "查询待处理任务")
|
|
- public AjaxMessage<Pagination<TaskManage>> selectPendingTask(
|
|
|
|
|
|
+ public AjaxMessage<Pagination<PlanManageDto>> selectPendingTask(
|
|
@ApiParam(value = "页数", required = true)@RequestParam Integer pageNum,
|
|
@ApiParam(value = "页数", required = true)@RequestParam Integer pageNum,
|
|
@ApiParam(value = "条数", required = true)@RequestParam Integer pageSize,
|
|
@ApiParam(value = "条数", required = true)@RequestParam Integer pageSize,
|
|
@ApiParam(value = "任务类型(巡检:7,侧漏:8,养护:9)", required = false) @RequestParam(required = false) Integer taskType,
|
|
@ApiParam(value = "任务类型(巡检:7,侧漏:8,养护:9)", required = false) @RequestParam(required = false) Integer taskType,
|
|
@@ -151,10 +152,10 @@ public class PlanManageController {
|
|
if(loginUser.getId() != null) {
|
|
if(loginUser.getId() != null) {
|
|
planManageDto.setCurrentUsers(String.format("%s,", loginUser.getId()));
|
|
planManageDto.setCurrentUsers(String.format("%s,", loginUser.getId()));
|
|
}
|
|
}
|
|
- IPage<TaskManage> iPage = new Page<>(pageNum, pageSize);
|
|
|
|
|
|
+ IPage<PlanManageDto> iPage = new Page<>(pageNum, pageSize);
|
|
iPage = planManageService.selectPage(iPage, planManageDto);
|
|
iPage = planManageService.selectPage(iPage, planManageDto);
|
|
- Pagination<TaskManage> pages = new Pagination<>(iPage);
|
|
|
|
- setUserName(pages);
|
|
|
|
|
|
+ Pagination<PlanManageDto> pages = new Pagination<>(iPage);
|
|
|
|
+ setName(pages.getList());
|
|
return new AjaxMessage<>(ResultStatus.OK, pages);
|
|
return new AjaxMessage<>(ResultStatus.OK, pages);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -308,60 +309,6 @@ public class PlanManageController {
|
|
return new AjaxMessage<>(ResultStatus.ERROR);
|
|
return new AjaxMessage<>(ResultStatus.ERROR);
|
|
}
|
|
}
|
|
|
|
|
|
- /**
|
|
|
|
- * 获取并设置用户名称
|
|
|
|
- * @param pages
|
|
|
|
- */
|
|
|
|
- private void setUserName(Pagination<TaskManage> pages){
|
|
|
|
- if(pages.getTotal()>0) {
|
|
|
|
- int total = (int) pages.getTotal();
|
|
|
|
- List<Long> idList = new ArrayList<Long>();
|
|
|
|
- for (PlanManage plan : pages.getList()) {
|
|
|
|
- if(plan.getUserId() != null) {
|
|
|
|
- idList.add(Long.parseLong(plan.getUserId()));
|
|
|
|
- }
|
|
|
|
- if(plan.getPlanUserId() != null){
|
|
|
|
- idList.add(Long.parseLong(plan.getPlanUserId()));
|
|
|
|
- }
|
|
|
|
- if(plan.getCreateBy() != null){
|
|
|
|
- idList.add(Long.parseLong(plan.getCreateBy()));
|
|
|
|
- }
|
|
|
|
-// if(plan.getUpdateBy() != null){
|
|
|
|
-// idList.add(Long.parseLong(plan.getUpdateBy()));
|
|
|
|
-// }
|
|
|
|
- }
|
|
|
|
- Long [] ids = new Long[idList.size()];
|
|
|
|
- for( int i =0 ;i<idList.size(); i++){
|
|
|
|
- ids[i] = idList.get(i);
|
|
|
|
- }
|
|
|
|
- List<UserEntity> userList = userCenterClient.findUserIdsByUserIds(ids);
|
|
|
|
- for (PlanManage plan : pages.getList()) {
|
|
|
|
- for(UserEntity userEntity : userList){
|
|
|
|
- if(plan.getUserId() != null) {
|
|
|
|
- if(userEntity.getId()== Long.parseLong(plan.getUserId())){
|
|
|
|
- plan.setUserName(userEntity.getUsername());
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- if(plan.getPlanUserId() != null){
|
|
|
|
- if(userEntity.getId()== Long.parseLong(plan.getPlanUserId())){
|
|
|
|
- plan.setPlanUserName(userEntity.getUsername());
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- if(plan.getCreateBy() != null){
|
|
|
|
- if(userEntity.getId()== Long.parseLong(plan.getCreateBy())){
|
|
|
|
- plan.setCreateByName(userEntity.getUsername());
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-// if(plan.getUpdateBy() != null) {
|
|
|
|
-// if(userEntity.getId()== Long.parseLong(plan.getUpdateBy())){
|
|
|
|
-// plan.setUpdateByName(userEntity.getUsername());
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* 获取并设置用户、任务工单类型名称
|
|
* 获取并设置用户、任务工单类型名称
|
|
* @param
|
|
* @param
|
|
@@ -387,21 +334,49 @@ public class PlanManageController {
|
|
Long[] ids = idList.toArray(new Long[0]);
|
|
Long[] ids = idList.toArray(new Long[0]);
|
|
Map<Long,String> userMap = userCenterClient.findUserIdsByUserIds(ids).stream().collect(Collectors.toMap(UserEntity::getId, UserEntity::getUsername));
|
|
Map<Long,String> userMap = userCenterClient.findUserIdsByUserIds(ids).stream().collect(Collectors.toMap(UserEntity::getId, UserEntity::getUsername));
|
|
Map<String,String> dictMap=userCenterClient.selectListByPCodes("SC_WORK_ORDER_TYPE,SC_TASK_TYPE");
|
|
Map<String,String> dictMap=userCenterClient.selectListByPCodes("SC_WORK_ORDER_TYPE,SC_TASK_TYPE");
|
|
- for (PlanManageDto plan : planManageDtoList) {
|
|
|
|
- if(plan.getTaskType() != null){
|
|
|
|
- plan.setTypeName(dictMap.get(plan.getTaskType().toString()));
|
|
|
|
- }
|
|
|
|
- if(plan.getUserId() != null) {
|
|
|
|
- plan.setUserName(userMap.get(Long.valueOf(plan.getUserId())));
|
|
|
|
- }
|
|
|
|
- if(plan.getPlanUserId() != null){
|
|
|
|
- plan.setPlanUserName(userMap.get(Long.valueOf(plan.getPlanUserId())));
|
|
|
|
- }
|
|
|
|
- if(plan.getCreateBy() != null){
|
|
|
|
- plan.setCreateByName(userMap.get(Long.valueOf(plan.getCreateBy())));
|
|
|
|
- }
|
|
|
|
- if(plan.getUpdateBy() != null){
|
|
|
|
- plan.setUpdateByName(userMap.get(Long.valueOf(plan.getUpdateBy())));
|
|
|
|
|
|
+ for(int i=0; i<planManageDtoList.size();i++){
|
|
|
|
+ PlanManageDto plan = planManageDtoList.get(i);
|
|
|
|
+ try {
|
|
|
|
+ if (plan.getTaskType() != null) {
|
|
|
|
+ plan.setTypeName(dictMap.get(plan.getTaskType().toString()));
|
|
|
|
+ }
|
|
|
|
+ if (plan.getUserId() != null) {
|
|
|
|
+ plan.setUserName(userMap.get(Long.valueOf(plan.getUserId())));
|
|
|
|
+ }
|
|
|
|
+ if (plan.getPlanUserId() != null) {
|
|
|
|
+ plan.setPlanUserName(userMap.get(Long.valueOf(plan.getPlanUserId())));
|
|
|
|
+ }
|
|
|
|
+ if (plan.getCreateBy() != null) {
|
|
|
|
+ plan.setCreateByName(userMap.get(Long.valueOf(plan.getCreateBy())));
|
|
|
|
+ }
|
|
|
|
+ if (plan.getUpdateBy() != null) {
|
|
|
|
+ plan.setUpdateByName(userMap.get(Long.valueOf(plan.getUpdateBy())));
|
|
|
|
+ }
|
|
|
|
+ if (plan.getWorkFlowDetail() != null) {
|
|
|
|
+ WorkFlowDetail workFlowDetail = plan.getWorkFlowDetail();
|
|
|
|
+ if (workFlowDetail.getCreateBy() != null) {
|
|
|
|
+ workFlowDetail.setCreateByName(userMap.get(Long.valueOf(workFlowDetail.getCreateBy())));
|
|
|
|
+ }
|
|
|
|
+ if (workFlowDetail.getUpdateBy() != null) {
|
|
|
|
+ workFlowDetail.setUpdateByName(userMap.get(Long.valueOf(workFlowDetail.getUpdateBy())));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (plan.getWorkFlowLogList() != null) {
|
|
|
|
+ for (WorkFlowLog workFlowLog : plan.getWorkFlowLogList()) {
|
|
|
|
+ try {
|
|
|
|
+ if (workFlowLog.getCreateBy() != null) {
|
|
|
|
+ workFlowLog.setCreateByName(userMap.get(Long.valueOf(workFlowLog.getCreateBy())));
|
|
|
|
+ }
|
|
|
|
+ if (workFlowLog.getUpdateBy() != null) {
|
|
|
|
+ workFlowLog.setUpdateByName(userMap.get(Long.valueOf(workFlowLog.getUpdateBy())));
|
|
|
|
+ }
|
|
|
|
+ }catch (Exception e){
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }catch(Exception e){
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|