liyanqi
2022-10-27 509b52219b44cbbf16c3b364da566ed00f8aabbe
Merge branch 'master' of http://42.193.1.25:9521/r/sccg_server
15个文件已修改
439 ■■■■■ 已修改文件
ycl-common/src/main/java/com/ycl/bo/AdminUserDetails.java 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-common/src/main/java/com/ycl/service/user/UmsAdminCacheService.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-common/src/main/java/com/ycl/service/user/UmsAdminService.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-common/src/main/java/com/ycl/service/user/impl/UmsAdminCacheServiceImpl.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-common/src/main/java/com/ycl/service/user/impl/UmsAdminServiceImpl.java 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/config/YclSecurityConfig.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/controller/caseHandler/DispatchHandleController.java 63 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/dto/message/MessageParam.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/service/caseHandler/IDisposeRecordService.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/service/caseHandler/impl/DisposeRecordServiceImpl.java 108 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/service/caseHandler/impl/IDispatchHandleServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/service/message/factory/InnerSender.java 106 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/service/message/factory/MailSender.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/resources/application.yml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/resources/mapper/caseHandler/DisposeRecordMapper.xml 68 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-common/src/main/java/com/ycl/bo/AdminUserDetails.java
@@ -1,7 +1,7 @@
package com.ycl.bo;
import com.ycl.entity.user.UmsAdmin;
import com.ycl.entity.user.UmsResource;
import com.ycl.entity.user.UmsMenu;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;
@@ -15,8 +15,9 @@
 */
public class AdminUserDetails implements UserDetails {
    private UmsAdmin umsAdmin;
    private List<UmsResource> resourceList;
    public AdminUserDetails(UmsAdmin umsAdmin, List<UmsResource> resourceList) {
    private List<UmsMenu> resourceList;
    public AdminUserDetails(UmsAdmin umsAdmin, List<UmsMenu> resourceList) {
        this.umsAdmin = umsAdmin;
        this.resourceList = resourceList;
    }
@@ -25,7 +26,7 @@
    public Collection<? extends GrantedAuthority> getAuthorities() {
        //返回当前用户的角色
        return resourceList.stream()
                .map(role ->new SimpleGrantedAuthority(role.getId()+":"+role.getName()))
                .map(role -> new SimpleGrantedAuthority(role.getId() + ":" + role.getTitle()))
                .collect(Collectors.toList());
    }
@@ -59,7 +60,7 @@
        return umsAdmin.getStatus().equals(1);
    }
    public Long getUserId(){
    public Long getUserId() {
        return umsAdmin.getId();
    }
}
ycl-common/src/main/java/com/ycl/service/user/UmsAdminCacheService.java
@@ -4,6 +4,7 @@
import com.ycl.entity.user.UmsAdmin;
import com.ycl.entity.user.UmsMenu;
import com.ycl.entity.user.UmsResource;
import java.util.List;
@@ -50,12 +51,12 @@
    /**
     * 获取缓存后台用户资源列表
     */
    List<UmsResource> getResourceList(Long adminId);
    List<UmsMenu> getResourceList(Long adminId);
    /**
     * 设置后台后台用户资源列表
     */
    void setResourceList(Long adminId, List<UmsResource> resourceList);
    void setResourceList(Long adminId, List<UmsMenu> umsMenuList);
    /**
     * 批量删除缓存用户
ycl-common/src/main/java/com/ycl/service/user/UmsAdminService.java
@@ -6,6 +6,7 @@
import com.ycl.dto.UmsAdminParam;
import com.ycl.dto.UpdateAdminPasswordParam;
import com.ycl.entity.user.UmsAdmin;
import com.ycl.entity.user.UmsMenu;
import com.ycl.entity.user.UmsResource;
import com.ycl.entity.user.UmsRole;
import com.ycl.vo.user.UserVO;
@@ -72,7 +73,7 @@
    /**
     * 获取指定用户的可访问资源
     */
    List<UmsResource> getResourceList(Long adminId);
    List<UmsMenu> getResourceList(Long adminId);
    /**
     * 修改密码
ycl-common/src/main/java/com/ycl/service/user/impl/UmsAdminCacheServiceImpl.java
@@ -5,6 +5,7 @@
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ycl.entity.user.UmsAdmin;
import com.ycl.entity.user.UmsAdminRoleRelation;
import com.ycl.entity.user.UmsMenu;
import com.ycl.entity.user.UmsResource;
import com.ycl.mapper.user.UmsAdminMapper;
import com.ycl.service.redis.RedisService;
@@ -106,18 +107,18 @@
    }
    @Override
    public List<UmsResource> getResourceList(Long adminId) {
    public List<UmsMenu> getResourceList(Long adminId) {
        String key = REDIS_DATABASE + ":" + REDIS_KEY_RESOURCE_LIST + ":" + adminId;
        String s = (String) redisService.get(key);
//        return (List<UmsResource>) redisService.get(key);
        List<UmsResource> umsResources = JSON.parseArray(s, UmsResource.class);
        List<UmsMenu> umsResources = JSON.parseArray(s, UmsMenu.class);
        return umsResources;
    }
    @Override
    public void setResourceList(Long adminId, List<UmsResource> resourceList) {
    public void setResourceList(Long adminId, List<UmsMenu> menuList) {
        String key = REDIS_DATABASE + ":" + REDIS_KEY_RESOURCE_LIST + ":" + adminId;
        redisService.set(key, JSON.toJSONString(resourceList), REDIS_EXPIRE);
        redisService.set(key, JSON.toJSONString(menuList), REDIS_EXPIRE);
    }
    @Override
ycl-common/src/main/java/com/ycl/service/user/impl/UmsAdminServiceImpl.java
@@ -156,8 +156,15 @@
        }
        //对用户名系统默认添加
        //umsAdmin.setNickName(RandomUtils.getUserId(umsAdmin.getId()));
        baseMapper.updateById(umsAdmin);
        //添加部门
        UmsDepartManage departManage = new UmsDepartManage();
        departManage.setUserId(umsAdmin.getId());
        departManage.setDepartId(umsAdmin.getDepartmentId());
        departManage.setCreateTime(new Date());
        departManage.setUpdateTime(new Date());
        umsDepartManageMapper.insert(departManage);
        baseMapper.updateById(umsAdmin);
        return umsAdmin;
    }
@@ -288,16 +295,14 @@
    }
    @Override
    public List<UmsResource> getResourceList(Long adminId) {
        List<UmsResource> resourceList = getCacheService().getResourceList(adminId);
        if (CollUtil.isNotEmpty(resourceList)) {
            return resourceList;
    public List<UmsMenu> getResourceList(Long adminId) {
        List<UmsMenu> umsMenuList = getCacheService().getResourceList(adminId);
        if (CollUtil.isNotEmpty(umsMenuList)) {
            return umsMenuList;
        }
        resourceList = umsResourceMapper.getResourceList(adminId);
        if (CollUtil.isNotEmpty(resourceList)) {
            getCacheService().setResourceList(adminId, resourceList);
        }
        return resourceList;
        umsMenuList = umsMenuMapper.getMenuList(adminId);
            getCacheService().setResourceList(adminId, umsMenuList);
        return umsMenuList;
    }
    @Override
@@ -328,7 +333,7 @@
        //获取用户信息
        UmsAdmin admin = getAdminByUsername(username);
        if (admin != null) {
            List<UmsResource> resourceList = getResourceList(admin.getId());
            List<UmsMenu> resourceList = getResourceList(admin.getId());
            return new AdminUserDetails(admin, resourceList);
        }
        throw new UsernameNotFoundException("用户名或密码错误");
ycl-platform/src/main/java/com/ycl/config/YclSecurityConfig.java
@@ -1,8 +1,10 @@
package com.ycl.config;
import com.ycl.component.DynamicSecurityService;
import com.ycl.entity.user.UmsMenu;
import com.ycl.entity.user.UmsResource;
import com.ycl.service.user.UmsAdminService;
import com.ycl.service.user.UmsMenuService;
import com.ycl.service.user.UmsResourceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
@@ -24,7 +26,7 @@
    @Autowired
    private UmsAdminService adminService;
    @Autowired
    private UmsResourceService resourceService;
    private UmsMenuService umsMenuService;
    @Bean
    public UserDetailsService userDetailsService() {
@@ -38,9 +40,9 @@
            @Override
            public Map<String, ConfigAttribute> loadDataSource() {
                Map<String, ConfigAttribute> map = new ConcurrentHashMap<>();
                List<UmsResource> resourceList = resourceService.list();
                for (UmsResource resource : resourceList) {
                    map.put(resource.getUrl(), new org.springframework.security.access.SecurityConfig(resource.getId() + ":" + resource.getName()));
                List<UmsMenu> resourceList = umsMenuService.list();
                for (UmsMenu resource : resourceList) {
                    map.put(resource.getTitle(), new org.springframework.security.access.SecurityConfig(resource.getId() + ":" + resource.getTitle()));
                }
                return map;
            }
ycl-platform/src/main/java/com/ycl/controller/caseHandler/DispatchHandleController.java
@@ -69,68 +69,7 @@
    public CommonResult searchDisposeList(@RequestParam Long caseId,
                                          @RequestParam Integer type,
                                          @RequestBody UploadDisposingResultParam uploadDisposingResultParam) {
        AdminUserDetails user = (AdminUserDetails) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
        //当事人
        PartyInfo partyInfo = new PartyInfo();
        BeanUtils.copyProperties(uploadDisposingResultParam, partyInfo);
        partyInfo.setCreateUser(user.getUserId().intValue());
        partyInfo.setCreateTime(LocalDateTime.now());
        iPartyInfoService.save(partyInfo);
        //调查取证
        Investigation investigation = new Investigation();
        BeanUtils.copyProperties(uploadDisposingResultParam, investigation);
        investigation.setBaseCaseId(caseId);
        investigation.setCreateTime(LocalDateTime.now());
        investigation.setCreateUser(user.getUserId());
        investigation.setPartyId(partyInfo.getId());
        iInvestigationService.save(investigation);
        //到达
        ArrivalSituation arrivalSituation = new ArrivalSituation();
        BeanUtils.copyProperties(uploadDisposingResultParam, arrivalSituation);
        arrivalSituation.setBaseCaseId(caseId);
        arrivalSituation.setCreateTime(LocalDateTime.now());
        arrivalSituation.setCreateUser(user.getUserId());
        iArrivalSituationService.save(arrivalSituation);
        //文书
        Integer illegalBuildingType = 2;
        Integer violation = 1;
        String handType = "02";
        ImageResources imageResources = new ImageResources();
        imageResources.setType(handType);
        imageResources.setBelongToId(caseId);
        imageResources.setCreateTime(LocalDateTime.now());
        imageResources.setCreateUser(user.getUserId());
        if (type == violation) {
            imageResources.setUrl(StringUtils.joinWith(",", uploadDisposingResultParam.getPic(), uploadDisposingResultParam.getSituationPic()));
            iImageResourcesService.save(imageResources);
        }
        if (type==illegalBuildingType) {
            Writ writ = new Writ();
            BeanUtils.copyProperties(uploadDisposingResultParam, writ);
            writ.setBaseCaseId(caseId);
            writ.setIllegalBuildingId(caseId);
            writ.setCreateTime(LocalDateTime.now());
            writ.setCreateUser(user.getUserId());
            iWritService.save(writ);
            imageResources.setUrl(StringUtils
                    .joinWith(",", uploadDisposingResultParam.getPic()
                            , uploadDisposingResultParam.getSituationPic()
                            , uploadDisposingResultParam.getOriginalPic()
                            , uploadDisposingResultParam.getOtherPic()
                            , uploadDisposingResultParam.getRectifiedPic()
                            , uploadDisposingResultParam.getWritPic()));
            iImageResourcesService.save(imageResources);
        }
        baseCaseService.update(new LambdaUpdateWrapper<BaseCase>().eq(BaseCase::getId, caseId).set(BaseCase::getState, BaseCaseStatus.DISPOSE));
        String stepName = StepName.CHECK.getName();
        DisposeRecord disposeRecord = new DisposeRecord();
        disposeRecord.setBaseCaseId(caseId);
        disposeRecord.setState(0);
        disposeRecord.setCreateTime(LocalDateTime.now());
        disposeRecord.setCreateUser(user.getUserId());
        disposeRecord.setStepName(stepName);
        disposeRecord.setStartTime(LocalDateTime.now());
        iDisposeRecordService.addRecord(disposeRecord);
        iDisposeRecordService.saveUpload(caseId,type,uploadDisposingResultParam);
        return CommonResult.success("add success");
    }
}
ycl-platform/src/main/java/com/ycl/dto/message/MessageParam.java
@@ -16,6 +16,12 @@
@Data
@ApiModel("消息参数体")
public class MessageParam extends BasePageVO {
    /**
     * 主键id
     */
    @ApiModelProperty(value = "主键id")
    private Long id;
    /**
     * 标题
     */
ycl-platform/src/main/java/com/ycl/service/caseHandler/IDisposeRecordService.java
@@ -1,6 +1,7 @@
package com.ycl.service.caseHandler;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ycl.dto.dispatch.UploadDisposingResultParam;
import com.ycl.entity.caseHandler.DisposeRecord;
import com.ycl.vo.MyBacklogVO;
@@ -18,5 +19,5 @@
    List<MyBacklogVO> listMyTask(String num, Long userId);
    Boolean addRecord(DisposeRecord disposeRecord);
    Boolean saveUpload(Long caseId, Integer type, UploadDisposingResultParam uploadDisposingResultParam);
}
ycl-platform/src/main/java/com/ycl/service/caseHandler/impl/DisposeRecordServiceImpl.java
@@ -1,30 +1,30 @@
package com.ycl.service.caseHandler.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ycl.bo.AdminUserDetails;
import com.ycl.common.constant.BaseCaseStatus;
import com.ycl.common.constant.StepName;
import com.ycl.entity.caseHandler.BaseCase;
import com.ycl.entity.caseHandler.DisposeRecord;
import com.ycl.entity.caseHandler.WorkflowConfigStep;
import com.ycl.entity.user.UmsAdminRoleRelation;
import com.ycl.dto.dispatch.UploadDisposingResultParam;
import com.ycl.entity.caseHandler.*;
import com.ycl.exception.ApiException;
import com.ycl.mapper.caseHandler.BaseCaseMapper;
import com.ycl.mapper.caseHandler.DisposeRecordMapper;
import com.ycl.mapper.caseHandler.WorkflowConfigStepMapper;
import com.ycl.mapper.user.UmsAdminRoleRelationMapper;
import com.ycl.service.caseHandler.IDisposeRecordService;
import com.ycl.service.caseHandler.*;
import com.ycl.vo.MyBacklogVO;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
/**
 * <p>
@@ -45,21 +45,94 @@
    @Resource
    WorkflowConfigStepMapper workflowConfigStepMapper;
    @Resource
    UmsAdminRoleRelationMapper umsAdminRoleRelationMapper;
    @Autowired
    IInvestigationService iInvestigationService;
    @Autowired
    IArrivalSituationService iArrivalSituationService;
    @Autowired
    IPartyInfoService iPartyInfoService;
    @Autowired
    IWritService iWritService;
    @Autowired
    IBaseCaseService baseCaseService;
    @Autowired
    IDisposeRecordService iDisposeRecordService;
    @Autowired
    IImageResourcesService iImageResourcesService;
    @Override
    public List<MyBacklogVO> listMyTask(String num, Long userId) {
        return disposeRecordMapper.selectMyBackList(userId,num);
        return disposeRecordMapper.selectMyBackList(userId, num);
    }
    @Override
    public Boolean addRecord(DisposeRecord disposeRecord) {
    @Transactional(rollbackFor = Exception.class)
    public Boolean saveUpload(Long caseId, Integer type, UploadDisposingResultParam uploadDisposingResultParam) {
        AdminUserDetails user = (AdminUserDetails) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
        //当事人
        PartyInfo partyInfo = new PartyInfo();
        BeanUtils.copyProperties(uploadDisposingResultParam, partyInfo);
        partyInfo.setCreateUser(user.getUserId().intValue());
        partyInfo.setCreateTime(LocalDateTime.now());
        iPartyInfoService.save(partyInfo);
        //调查取证
        Investigation investigation = new Investigation();
        BeanUtils.copyProperties(uploadDisposingResultParam, investigation);
        investigation.setBaseCaseId(caseId);
        investigation.setCreateTime(LocalDateTime.now());
        investigation.setCreateUser(user.getUserId());
        investigation.setPartyId(partyInfo.getId());
        iInvestigationService.save(investigation);
        //到达
        ArrivalSituation arrivalSituation = new ArrivalSituation();
        BeanUtils.copyProperties(uploadDisposingResultParam, arrivalSituation);
        arrivalSituation.setBaseCaseId(caseId);
        arrivalSituation.setCreateTime(LocalDateTime.now());
        arrivalSituation.setCreateUser(user.getUserId());
        iArrivalSituationService.save(arrivalSituation);
        //文书
        Integer illegalBuildingType = 2;
        Integer violation = 1;
        String handType = "02";
        ImageResources imageResources = new ImageResources();
        imageResources.setType(handType);
        imageResources.setBelongToId(caseId);
        imageResources.setCreateTime(LocalDateTime.now());
        imageResources.setCreateUser(user.getUserId());
        if (type == violation) {
            imageResources.setUrl(StringUtils.joinWith(",", uploadDisposingResultParam.getPic(), uploadDisposingResultParam.getSituationPic()));
            iImageResourcesService.save(imageResources);
        }
        if (type == illegalBuildingType) {
            Writ writ = new Writ();
            BeanUtils.copyProperties(uploadDisposingResultParam, writ);
            writ.setBaseCaseId(caseId);
            writ.setIllegalBuildingId(caseId);
            writ.setCreateTime(LocalDateTime.now());
            writ.setCreateUser(user.getUserId());
            iWritService.save(writ);
            imageResources.setUrl(StringUtils
                    .joinWith(",", uploadDisposingResultParam.getPic()
                            , uploadDisposingResultParam.getSituationPic()
                            , uploadDisposingResultParam.getOriginalPic()
                            , uploadDisposingResultParam.getOtherPic()
                            , uploadDisposingResultParam.getRectifiedPic()
                            , uploadDisposingResultParam.getWritPic()));
            iImageResourcesService.save(imageResources);
        }
        baseCaseService.update(new LambdaUpdateWrapper<BaseCase>().eq(BaseCase::getId, caseId).set(BaseCase::getState, BaseCaseStatus.DISPOSE));
        String stepName = StepName.CHECK.getName();
        DisposeRecord disposeRecord = new DisposeRecord();
        disposeRecord.setBaseCaseId(caseId);
        disposeRecord.setState(0);
        disposeRecord.setCreateTime(LocalDateTime.now());
        disposeRecord.setCreateUser(user.getUserId());
        disposeRecord.setStepName(stepName);
        disposeRecord.setStartTime(LocalDateTime.now());
        //结束上传处置流程
        String stepName = StepName.DISPOSE.getName();
        QueryWrapper<WorkflowConfigStep> qureyDispatch = new QueryWrapper<>();
        qureyDispatch.eq("name", stepName);
        qureyDispatch.eq("name", StepName.DISPOSE.getName());
        WorkflowConfigStep dispatchStep = workflowConfigStepMapper.selectOne(qureyDispatch);
        UpdateWrapper<DisposeRecord> updateWrapper = new UpdateWrapper<>();
@@ -80,7 +153,6 @@
        //设置流程环节数据
        disposeRecord.setWorkflowConfigStepId(workflowConfigStep.getId());
        disposeRecord.setHandlerRoleId(workflowConfigStep.getRoleId());
        baseMapper.insert(disposeRecord);
        return true;
        return baseMapper.insert(disposeRecord) == 1 ? true : false;
    }
}
ycl-platform/src/main/java/com/ycl/service/caseHandler/impl/IDispatchHandleServiceImpl.java
@@ -86,8 +86,8 @@
        stepNextRecord.setBaseCaseId(baseCase.getId());
        stepNextRecord.setWorkflowConfigStepId(stepNext.getId());
        stepNextRecord.setStepName(stepNext.getName());
        stepNextRecord.setHandlerRoleId(stepNext.getRoleId());
        stepNextRecord.setLimitTime(dispatchInfoParam.getDisposeDate());
        stepNextRecord.setHandlerId(dispatchInfoParam.getLawEnforcer());
        //上传处置未结束
        stepNextRecord.setState(0);
        stepNextRecord.setStartTime(LocalDateTime.now());
ycl-platform/src/main/java/com/ycl/service/message/factory/InnerSender.java
@@ -1,6 +1,7 @@
package com.ycl.service.message.factory;
import com.ycl.common.constant.ChannelCode;
import com.ycl.common.util.CommonUtils;
import com.ycl.common.util.UtilNumber;
import com.ycl.dto.message.MessageParam;
import com.ycl.entity.message.Message;
@@ -42,56 +43,67 @@
    @Override
    public Message sendMessage(MessageParam messageParam) {
        Message message = new Message();
        String messageNumber = UtilNumber.getNumber("MC", 6);
        List<Message> messages = new ArrayList<>();
        BeanUtils.copyProperties(messageParam, message);
        //父Id为0
        message.setParentId(0L);
        //生成消息编码
        message.setMessageNumber(messageNumber);
        //生成默认参数
        //发送时间
        if (message.getSendTime() == null) {
            message.setSendTime(new Date());
        }
        message.setIsView(0);
        message.setVersion(0);
        message.setIsScan(1);
        message.setCreateTime(new Date());
        message.setUpdateTime(new Date());
        message.setCreateUser(messageParam.getCreateUser());
        message.setUpdateUser(messageParam.getCreateUser());
        messageMapper.insert(message);
        String[] ids = messageParam.getTargetTo().split(",");
        for (String id : ids) {
            Message messageAdd = new Message();
            BeanUtils.copyProperties(messageParam, messageAdd);
            //设置父类Id
            messageAdd.setParentId(message.getId());
            //设置接收者
            messageAdd.setTargetTo(id);
            //生成8位随机数消息编码
            messageAdd.setMessageNumber(messageNumber);
            //发送时间
            if (messageAdd.getSendTime() == null) {
                messageAdd.setSendTime(new Date());
            }
            if (ChannelCode.MAIL.equals(messageParam.getChannelCode())) {
                messageAdd.setIsScan(1);
            } else {
                messageAdd.setIsScan(0);
            }
        if (CommonUtils.isEmpty(messageParam.getId())) {
            String messageNumber = UtilNumber.getNumber("MC", 6);
            BeanUtils.copyProperties(messageParam, message);
            //父Id为0
            message.setParentId(0L);
            //生成消息编码
            message.setMessageNumber(messageNumber);
            //生成默认参数
            messageAdd.setCreateTime(new Date());
            messageAdd.setUpdateTime(new Date());
            messageAdd.setCreateUser(messageParam.getCreateUser());
            messageAdd.setUpdateUser(messageParam.getCreateUser());
            messageAdd.setIsView(0);
            messageAdd.setVersion(0);
            messages.add(messageAdd);
            //发送时间
            if (message.getSendTime() == null) {
                message.setSendTime(new Date());
            }
            message.setIsView(0);
            message.setVersion(0);
            message.setIsScan(1);
            message.setCreateTime(new Date());
            message.setUpdateTime(new Date());
            message.setCreateUser(messageParam.getCreateUser());
            message.setUpdateUser(messageParam.getCreateUser());
            messageMapper.insert(message);
        } else {
            message.setId(messageParam.getId());
            BeanUtils.copyProperties(messageParam, message);
            message.setUpdateTime(new Date());
            message.setUpdateUser(messageParam.getCreateUser());
            messageMapper.updateById(message);
        }
        //批量新增
        iMessageService.saveBatch(messages);
        //发布消息
        if (message.getStatus() == 1) {
            String[] ids = messageParam.getTargetTo().split(",");
            for (String id : ids) {
                Message messageAdd = new Message();
                BeanUtils.copyProperties(messageParam, messageAdd);
                //设置父类Id
                messageAdd.setParentId(message.getId());
                //设置接收者
                messageAdd.setTargetTo(id);
                //生成8位随机数消息编码
                messageAdd.setMessageNumber(message.getMessageNumber());
                //发送时间
                if (messageAdd.getSendTime() == null) {
                    messageAdd.setSendTime(new Date());
                }
                if (ChannelCode.MAIL.equals(messageParam.getChannelCode())) {
                    messageAdd.setIsScan(1);
                } else {
                    messageAdd.setIsScan(0);
                }
                //生成默认参数
                messageAdd.setCreateTime(new Date());
                messageAdd.setUpdateTime(new Date());
                messageAdd.setCreateUser(messageParam.getCreateUser());
                messageAdd.setUpdateUser(messageParam.getCreateUser());
                messageAdd.setIsView(0);
                messageAdd.setVersion(0);
                messages.add(messageAdd);
            }
            //批量新增
            iMessageService.saveBatch(messages);
        }
        return message;
    }
}
ycl-platform/src/main/java/com/ycl/service/message/factory/MailSender.java
@@ -53,13 +53,15 @@
    public Message sendMessage(MessageParam messageParam) {
        //入库保存
        Message message = innerSender.sendMessage(messageParam);
        //发起审核
        iSmsAuditService.startAuditSms(message);
        //id换成邮箱号
        String targetToMail = adminService.getTargetTo(messageParam.getTargetTo(), messageParam.getChannelCode());
        message.setTargetTo(targetToMail);
        //发送邮件
        sendMail(message);
        if (messageParam.getStatus() == 1) {
            //发起审核
            iSmsAuditService.startAuditSms(message);
            //id换成邮箱号
            String targetToMail = adminService.getTargetTo(messageParam.getTargetTo(), messageParam.getChannelCode());
            message.setTargetTo(targetToMail);
            //发送邮件
            sendMail(message);
        }
        return message;
    }
ycl-platform/src/main/resources/application.yml
@@ -36,7 +36,7 @@
  database: sccg
  key:
    admin: 'ums:admin'
    resourceList: 'ums:resourceList'
    resourceList: 'ums:menuList'
  expire:
    common: 86400 # 24小时
ycl-platform/src/main/resources/mapper/caseHandler/DisposeRecordMapper.xml
@@ -4,41 +4,63 @@
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.ycl.entity.caseHandler.DisposeRecord">
        <id column="id" property="id" />
        <result column="base_case_id" property="baseCaseId" />
        <result column="workflow_config_step_id" property="workflowConfigStepId" />
        <result column="step_name" property="stepName" />
        <result column="start_time" property="startTime" />
        <result column="handler_role_id" property="handlerRoleId" />
        <result column="end_time" property="endTime" />
        <result column="state" property="state" />
        <result column="handler_id" property="handlerId" />
        <result column="create_user" property="createUser" />
        <result column="create_time" property="createTime" />
        <id column="id" property="id"/>
        <result column="base_case_id" property="baseCaseId"/>
        <result column="workflow_config_step_id" property="workflowConfigStepId"/>
        <result column="step_name" property="stepName"/>
        <result column="start_time" property="startTime"/>
        <result column="handler_role_id" property="handlerRoleId"/>
        <result column="end_time" property="endTime"/>
        <result column="state" property="state"/>
        <result column="handler_id" property="handlerId"/>
        <result column="create_user" property="createUser"/>
        <result column="create_time" property="createTime"/>
    </resultMap>
    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id, base_case_id, step_name, start_time, handler_role_id, end_time, state, handler_id, create_user, create_time
        id
        , base_case_id, step_name, start_time, handler_role_id, end_time, state, handler_id, create_user, create_time
    </sql>
    <select id="selectMyBackList" resultType="com.ycl.vo.MyBacklogVO">
        SELECT
            t3.event_source,
            t3.category,
            t2.step_name,
            t3.`code`,
            t2.create_time
        t3.event_source,
        t3.category,
        t2.step_name,
        t3.`code`,
        t2.create_time,
        t2.limit_time
        FROM
            ums_admin_role_relation t1
                JOIN ums_dispose_record t2 ON t1.role_id = t2.handler_role_id
                JOIN ums_base_case t3 ON t2.base_case_id=t3.id
        ums_admin_role_relation t1
        left JOIN ums_dispose_record t2 ON t1.role_id = t2.handler_role_id
        left JOIN ums_base_case t3 ON t2.base_case_id=t3.id
        <where>
            t1.admin_id = #{id}
            AND ISNULL( t2.end_time )
        <if test="code!='' and code!=null">
            and t3.`code` LIKE CONCAT('%',#{code},'%')
        </if>
            <if test="code!='' and code!=null">
                and t3.`code` LIKE CONCAT('%',#{code},'%')
            </if>
        </where>
        union all
        SELECT
        t3.event_source,
        t3.category,
        t2.step_name,
        t3.`code`,
        t2.create_time,
        t2.limit_time
        FROM
        ums_dispose_record t2
        LEFT JOIN ums_base_case t3 ON t2.base_case_id = t3.id
        <where>
            t2.handler_id = #{id}
            AND ISNULL(
            t2.end_time
            )
            <if test="code!='' and code!=null">
                and t3.`code` LIKE CONCAT('%',#{code},'%')
            </if>
        </where>
    </select>
</mapper>