diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ServerInfoDTO.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ServerInfoDTO.java new file mode 100644 index 0000000000..39bdd462f5 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ServerInfoDTO.java @@ -0,0 +1,15 @@ +package com.epmet.entity; + +import lombok.Data; + +/** + * @Description + * @Author yzm + * @Date 2022/7/27 16:23 + */ +@Data +public class ServerInfoDTO { + private String serviceName; + private String mobile; +} + diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java index c1acbcd859..b85121ff68 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java @@ -43,6 +43,7 @@ import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.ScanContentUtils; import com.epmet.constant.ReadFlagConstant; +import com.epmet.constant.SmsTemplateConstant; import com.epmet.constant.UserDemandConstant; import com.epmet.constant.UserMessageTypeConstant; import com.epmet.dao.IcUserDemandOperateLogDao; @@ -414,11 +415,11 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl smsList=new ArrayList<>(); + SendSmsFormDTO sms = new SendSmsFormDTO(); + sms.setCustomerId(customerId); + sms.setMobile(mobile); + sms.setAliyunTemplateCode(SmsTemplateConstant.PROJECT_TRANSFER); + List paramsContent=new ArrayList<>(); + paramsContent.add(String.format("%s给您指派了一个新的需求,请查看",staffInfoCacheResult.getAgencyName())); + sms.setParamsContent(paramsContent); + smsList.add(sms); + messageOpenFeignClient.sendMsg(smsList); + } /** @@ -438,21 +465,25 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl paramsContent; + + private String customerId; +} + diff --git a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/EpmetMessageOpenFeignClient.java b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/EpmetMessageOpenFeignClient.java index 920d508b89..447111aca6 100644 --- a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/EpmetMessageOpenFeignClient.java +++ b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/EpmetMessageOpenFeignClient.java @@ -21,8 +21,8 @@ import java.util.List; * @author yinzuomei@elink-cn.com * @date 2020/6/4 13:47 */ -//@FeignClient(name = ServiceConstant.EPMET_MESSAGE_SERVER, fallbackFactory = EpmetMessageOpenFeignClientFallbackFactory.class, url = "http://127.0.0.1:8085") -@FeignClient(name = ServiceConstant.EPMET_MESSAGE_SERVER, fallbackFactory = EpmetMessageOpenFeignClientFallbackFactory.class) +@FeignClient(name = ServiceConstant.EPMET_MESSAGE_SERVER, fallbackFactory = EpmetMessageOpenFeignClientFallbackFactory.class, url = "http://127.0.0.1:8085") +// @FeignClient(name = ServiceConstant.EPMET_MESSAGE_SERVER, fallbackFactory = EpmetMessageOpenFeignClientFallbackFactory.class) public interface EpmetMessageOpenFeignClient { /** * 发送短信 @@ -123,4 +123,8 @@ public interface EpmetMessageOpenFeignClient { */ @PostMapping("/message/system/pendding-mq-msg-scan") Result penddingMqMsgScan(); + + + @PostMapping(value = "message/sms/send-msg", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) + Result sendMsg(@RequestBody List formDTO); } diff --git a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/fallback/EpmetMessageOpenFeignClientFallback.java b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/fallback/EpmetMessageOpenFeignClientFallback.java index eba096ff0f..2d5c0d9073 100644 --- a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/fallback/EpmetMessageOpenFeignClientFallback.java +++ b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/fallback/EpmetMessageOpenFeignClientFallback.java @@ -73,4 +73,9 @@ public class EpmetMessageOpenFeignClientFallback implements EpmetMessageOpenFeig public Result penddingMqMsgScan() { return ModuleUtils.feignConError(ServiceConstant.EPMET_MESSAGE_SERVER, "penddingMqMsgScan"); } + + @Override + public Result sendMsg(List formDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_MESSAGE_SERVER, "sendMsg",formDTO); + } } diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/SmsController.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/SmsController.java index c41ad3195d..47684b67c7 100644 --- a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/SmsController.java +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/SmsController.java @@ -16,6 +16,7 @@ import com.epmet.commons.tools.validator.group.AliyunGroup; import com.epmet.commons.tools.validator.group.QcloudGroup; import com.epmet.dto.SysSmsDTO; import com.epmet.dto.form.ProjectSendMsgFormDTO; +import com.epmet.dto.form.SendSmsFormDTO; import com.epmet.dto.form.SendVerificationCodeFormDTO; import com.epmet.dto.result.SendVerificationCodeResultDTO; import com.epmet.enums.PlatformEnum; @@ -128,4 +129,17 @@ public class SmsController { return new Result(); } + /** + * 通用发短信方法,传入短信模板,内容 + * + * @param formDTOList + * @return + */ + @PostMapping("send-msg") + public Result sendMsg(@RequestBody List formDTOList) { + ValidatorUtils.validateEntity(formDTOList, SendSmsFormDTO.AddUserShowGroup.class, SendSmsFormDTO.AddUserInternalGroup.class); + sysSmsService.sendMsg(formDTOList); + return new Result(); + } + } diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/SysSmsService.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/SysSmsService.java index 1327aff692..0025768d94 100644 --- a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/SysSmsService.java +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/SysSmsService.java @@ -13,6 +13,7 @@ import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.SysSmsDTO; import com.epmet.dto.form.ProjectSendMsgFormDTO; +import com.epmet.dto.form.SendSmsFormDTO; import com.epmet.dto.form.SendVerificationCodeFormDTO; import com.epmet.dto.result.SendVerificationCodeResultDTO; import com.epmet.entity.SysSmsEntity; @@ -77,5 +78,6 @@ public interface SysSmsService extends BaseService { **/ void projectSendMsg(List formDTOList); + void sendMsg(List formDTOList); } diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SysSmsServiceImpl.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SysSmsServiceImpl.java index 1fc41bc718..ee4c3be657 100644 --- a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SysSmsServiceImpl.java +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SysSmsServiceImpl.java @@ -13,6 +13,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.Constant; +import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.ErrorCode; import com.epmet.commons.tools.exception.RenException; @@ -25,6 +26,7 @@ import com.epmet.dao.SysSmsDao; import com.epmet.dto.SysSmsDTO; import com.epmet.dto.form.CrmParameterFormDTO; import com.epmet.dto.form.ProjectSendMsgFormDTO; +import com.epmet.dto.form.SendSmsFormDTO; import com.epmet.dto.form.SendVerificationCodeFormDTO; import com.epmet.dto.result.CrmParameterResultDTO; import com.epmet.dto.result.SendVerificationCodeResultDTO; @@ -323,7 +325,33 @@ public class SysSmsServiceImpl extends BaseServiceImpl service.sendSmsMsg(sysSmsDTO); } } catch (Exception e) { - logger.warn(String.format("项目提醒发送短信失败,失败手机号:%s,ErrorCode:%s", sysSmsDTO.getMobile(), e.getMessage())); + logger.warn(String.format("发送短信失败,失败手机号:%s,ErrorCode:%s", sysSmsDTO.getMobile(), e.getMessage())); + } + } + + @Override + public void sendMsg(List formDTOList) { + try { + for(SendSmsFormDTO formDTO:formDTOList){ + SysSmsDTO sysSmsDTO = new SysSmsDTO(); + sysSmsDTO.setMobile(formDTO.getMobile()); + sysSmsDTO.setAliyunTemplateCode(formDTO.getAliyunTemplateCode()); + sysSmsDTO.setCustomerId(formDTO.getCustomerId()); + HashMap map = new HashMap<>(); + try{ + if(SmsTemplateConstant.PROJECT_TRANSFER.equals(formDTO.getAliyunTemplateCode())){ + map.put("params1", formDTO.getParamsContent().get(NumConstant.ZERO)); + } + String paramJson = new ObjectMapper().writeValueAsString(map); + sysSmsDTO.setParams(paramJson); + } catch (JsonProcessingException e) { + log.warn("sendMsg JsonProcessingException", e); + } + //推送短信 + this.sendMsg(sysSmsDTO); + } + } catch (Exception e) { + logger.error("sendMsg exception", e); } } diff --git a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/GovRoleListDTO.java b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/GovRoleListDTO.java new file mode 100644 index 0000000000..7ff4de4670 --- /dev/null +++ b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/GovRoleListDTO.java @@ -0,0 +1,49 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + + +/** + * 角色管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-18 + */ +@Data +public class GovRoleListDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 角色名称 + */ + private String name; + + +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/feign/GovAccessFeignClient.java b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/feign/GovAccessFeignClient.java index ce7fc27c82..aa56275f68 100644 --- a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/feign/GovAccessFeignClient.java +++ b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/feign/GovAccessFeignClient.java @@ -2,6 +2,8 @@ package com.epmet.feign; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.GovRoleDTO; +import com.epmet.dto.form.*; import com.epmet.dto.GovMenuDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.NewUserRoleResultDTO; @@ -59,4 +61,7 @@ public interface GovAccessFeignClient { @PostMapping("/gov/access/menu/getCustomerMenuList") Result> getCustomerMenuList(@RequestBody GetCustomerMenuListFormDTO formDTO); + @PostMapping("/gov/access/govrole/getgovrole") + Result getGovRole(@RequestBody GovRoleListDTO formDTO); + } diff --git a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/feign/fallback/GovAccessFeignClientFallBack.java b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/feign/fallback/GovAccessFeignClientFallBack.java index ed19d5728c..2a2d88498d 100644 --- a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/feign/fallback/GovAccessFeignClientFallBack.java +++ b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/feign/fallback/GovAccessFeignClientFallBack.java @@ -3,6 +3,8 @@ package com.epmet.feign.fallback; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.GovRoleDTO; +import com.epmet.dto.form.*; import com.epmet.dto.GovMenuDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.NewUserRoleResultDTO; @@ -43,4 +45,9 @@ public class GovAccessFeignClientFallBack implements GovAccessFeignClient { public Result> getCustomerMenuList(GetCustomerMenuListFormDTO formDTO) { return ModuleUtils.feignConError(ServiceConstant.GOV_ACCESS_SERVER, "getCustomerMenuList", formDTO); } + + @Override + public Result getGovRole(GovRoleListDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ACCESS_SERVER, "getGovRole", formDTO); + } } diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/GovRoleController.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/GovRoleController.java index c11faba160..0159a8d891 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/GovRoleController.java +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/GovRoleController.java @@ -27,6 +27,7 @@ import com.epmet.commons.tools.validator.group.AddGroup; import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.dto.GovRoleDTO; +import com.epmet.dto.form.GovRoleListDTO; import com.epmet.service.GovRoleMenuService; import com.epmet.service.GovRoleService; import org.springframework.beans.factory.annotation.Autowired; @@ -102,4 +103,9 @@ public class GovRoleController { return new Result>().ok(data); } + @PostMapping("getgovrole") + public Result getGovRole(@RequestBody GovRoleListDTO fromDTO){ + return new Result().ok(govRoleService.getGovRole(fromDTO)); + } + } diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/GovRoleDao.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/GovRoleDao.java index 526dbf9b37..a70c839a63 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/GovRoleDao.java +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/GovRoleDao.java @@ -9,6 +9,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.GovRoleDTO; import com.epmet.dto.result.NewUserRoleResultDTO; import com.epmet.entity.GovRoleEntity; import org.apache.ibatis.annotations.Mapper; @@ -33,4 +34,5 @@ public interface GovRoleDao extends BaseDao { */ List getCustomerRoles(@Param("customerId")String customerId); + GovRoleDTO selectGovRole(@Param("customerId") String customerId, @Param("name") String name); } diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/GovRoleService.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/GovRoleService.java index 4fbf7e0f58..b7ca62a420 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/GovRoleService.java +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/GovRoleService.java @@ -20,6 +20,7 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.GovRoleDTO; +import com.epmet.dto.form.GovRoleListDTO; import com.epmet.entity.GovRoleEntity; import java.util.List; @@ -92,4 +93,6 @@ public interface GovRoleService extends BaseService { * @date 2020-03-18 */ void delete(String[] ids); + + GovRoleDTO getGovRole(GovRoleListDTO fromDTO); } \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovRoleServiceImpl.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovRoleServiceImpl.java index 72a542c9e7..c171d081d9 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovRoleServiceImpl.java +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovRoleServiceImpl.java @@ -28,6 +28,7 @@ import com.epmet.commons.tools.security.user.LoginUserUtil; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.dao.GovRoleDao; import com.epmet.dto.GovRoleDTO; +import com.epmet.dto.form.GovRoleListDTO; import com.epmet.entity.GovRoleEntity; import com.epmet.redis.GovRoleRedis; import com.epmet.service.GovRoleMenuService; @@ -122,4 +123,9 @@ public class GovRoleServiceImpl extends BaseServiceImpl + + + diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.34__formitem_zhzl.sql b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.35__formitem_zhzl.sql similarity index 100% rename from epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.34__formitem_zhzl.sql rename to epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.35__formitem_zhzl.sql