|
|
@ -21,6 +21,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|
|
|
import com.epmet.commons.tools.constant.AppClientConstant; |
|
|
|
import com.epmet.commons.tools.constant.Constant; |
|
|
|
import com.epmet.commons.tools.constant.FieldConstant; |
|
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
|
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|
|
@ -30,6 +31,7 @@ import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
|
import com.epmet.commons.tools.utils.Result; |
|
|
|
import com.epmet.constant.ParameterKeyConstant; |
|
|
|
import com.epmet.constant.ProjectConstant; |
|
|
|
import com.epmet.constant.UserMessageConstant; |
|
|
|
import com.epmet.dao.ProjectDao; |
|
|
|
import com.epmet.dto.*; |
|
|
|
import com.epmet.dto.form.*; |
|
|
@ -41,6 +43,7 @@ import com.epmet.entity.ProjectStaffEntity; |
|
|
|
import com.epmet.feign.CommonFeignClient; |
|
|
|
import com.epmet.feign.EpmetUserFeignClient; |
|
|
|
import com.epmet.feign.GovOrgFeignClient; |
|
|
|
import com.epmet.feign.MessageFeignClient; |
|
|
|
import com.epmet.redis.ProjectRedis; |
|
|
|
import com.epmet.service.*; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
@ -76,6 +79,8 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit |
|
|
|
@Autowired |
|
|
|
private GovOrgFeignClient govOrgFeignClient; |
|
|
|
@Autowired |
|
|
|
private MessageFeignClient messageFeignClient; |
|
|
|
@Autowired |
|
|
|
private ProjectRelatedPersonnelService projectRelatedPersonnelService; |
|
|
|
|
|
|
|
private final static String ONE_DAY = "<1"; |
|
|
@ -312,6 +317,37 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit |
|
|
|
projectProcessEntity.setStaffId(fromDTO.getUserId()); |
|
|
|
projectProcessEntity.setCostWorkdays(getDetentionDays(ConvertUtils.sourceToTarget(projectEntity, ProjectDTO.class))); |
|
|
|
projectProcessService.insert(projectProcessEntity); |
|
|
|
|
|
|
|
//通知
|
|
|
|
List<UserMessageFormDTO> msgList = new ArrayList<>(); |
|
|
|
//通知项目相关人员
|
|
|
|
List<ProjectRelatedPersonnelDTO> personnelList = projectRelatedPersonnelService.getPersonnelListByProjectId(fromDTO.getProjectId()); |
|
|
|
personnelList.forEach(p -> { |
|
|
|
UserMessageFormDTO messageFormDTO = new UserMessageFormDTO(); |
|
|
|
messageFormDTO.setCustomerId(projectEntity.getCustomerId()); |
|
|
|
messageFormDTO.setApp(p.getApp()); |
|
|
|
messageFormDTO.setGridId(p.getGridId()); |
|
|
|
messageFormDTO.setUserId(p.getUserId()); |
|
|
|
messageFormDTO.setTitle(UserMessageConstant.PROJECT_TITLE); |
|
|
|
messageFormDTO.setMessageContent(String.format(UserMessageConstant.PROJECT_CLOSED_MSG, projectEntity.getTitle(), fromDTO.getPublicReply())); |
|
|
|
messageFormDTO.setReadFlag(Constant.UNREAD); |
|
|
|
msgList.add(messageFormDTO); |
|
|
|
}); |
|
|
|
//通知项目关联的部门人员
|
|
|
|
List<String> staffList = projectStaffService.getStaffsByProjectId(fromDTO.getProjectId()); |
|
|
|
staffList.add(projectEntity.getCreatedBy()); |
|
|
|
staffList.stream().distinct().forEach(s -> { |
|
|
|
UserMessageFormDTO messageFormDTO = new UserMessageFormDTO(); |
|
|
|
messageFormDTO.setCustomerId(projectEntity.getCustomerId()); |
|
|
|
messageFormDTO.setApp(ProjectConstant.GOV); |
|
|
|
messageFormDTO.setGridId("*"); |
|
|
|
messageFormDTO.setUserId(s); |
|
|
|
messageFormDTO.setTitle(UserMessageConstant.PROJECT_TITLE); |
|
|
|
messageFormDTO.setMessageContent(String.format(UserMessageConstant.PROJECT_CLOSED_MSG, projectEntity.getTitle(), fromDTO.getPublicReply())); |
|
|
|
messageFormDTO.setReadFlag(Constant.UNREAD); |
|
|
|
msgList.add(messageFormDTO); |
|
|
|
}); |
|
|
|
messageFeignClient.saveUserMessageList(msgList); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
@ -347,7 +383,18 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit |
|
|
|
projectStaff.setIsHandle(ProjectConstant.UNHANDLED); |
|
|
|
projectStaffService.insert(projectStaff); |
|
|
|
|
|
|
|
//TODO 通知
|
|
|
|
//通知
|
|
|
|
List<UserMessageFormDTO> msgList = new ArrayList<>(); |
|
|
|
UserMessageFormDTO messageFormDTO = new UserMessageFormDTO(); |
|
|
|
messageFormDTO.setCustomerId(projectEntity.getCustomerId()); |
|
|
|
messageFormDTO.setApp(ProjectConstant.GOV); |
|
|
|
messageFormDTO.setGridId("*"); |
|
|
|
messageFormDTO.setUserId(projectStaffDTO.getStaffId()); |
|
|
|
messageFormDTO.setTitle(UserMessageConstant.PROJECT_TITLE); |
|
|
|
messageFormDTO.setMessageContent(String.format(UserMessageConstant.PROJECT_RESOLVED_MSG, projectEntity.getTitle())); |
|
|
|
messageFormDTO.setReadFlag(Constant.UNREAD); |
|
|
|
msgList.add(messageFormDTO); |
|
|
|
messageFeignClient.saveUserMessageList(msgList); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|