Commit b791dea4 by “zcwang”

Merge remote-tracking branch 'origin/feature-changeFlow-221110' into feature-changeFlow-221110

parents 19ce167c 8fc593b3
...@@ -379,32 +379,33 @@ ...@@ -379,32 +379,33 @@
</exclusions> </exclusions>
</dependency> </dependency>
<!--qc --> <!--qc -->
<dependency> <!-- <dependency>-->
<groupId>com.netease.yanxuan</groupId> <!-- <groupId>com.netease.yanxuan</groupId>-->
<artifactId>yanxuan-qc-service-client</artifactId> <!-- <artifactId>yanxuan-qc-service-client</artifactId>-->
<version>2.0.0-SNAPSHOT</version> <!-- <version>2.0.0-SNAPSHOT</version>-->
</dependency> <!-- </dependency>-->
<dependency> <!-- <dependency>-->
<groupId>com.netease.yanxuan</groupId> <!-- <groupId>com.netease.yanxuan</groupId>-->
<artifactId>yanxuan-qc-parent</artifactId> <!-- <artifactId>yanxuan-qc-parent</artifactId>-->
<version>2.0.0-SNAPSHOT</version> <!-- <version>2.0.0-SNAPSHOT</version>-->
</dependency> <!-- </dependency>-->
<dependency> <!-- <dependency>-->
<groupId>com.netease.mail.yanxuan</groupId> <!-- <groupId>com.netease.mail.yanxuan</groupId>-->
<artifactId>dschedule-boot-starter</artifactId> <!-- <artifactId>dschedule-boot-starter</artifactId>-->
<version>1.0.3-SNAPSHOT</version> <!-- <version>1.0.3-SNAPSHOT</version>-->
</dependency> <!-- </dependency>-->
<dependency> <!-- <dependency>-->
<groupId>com.netease.mailsaas</groupId> <!-- <groupId>com.netease.mailsaas</groupId>-->
<artifactId>saas-kit-java-bundle</artifactId> <!-- <artifactId>saas-kit-java-bundle</artifactId>-->
<version>0.1.0-SNAPSHOT</version> <!-- <version>0.1.0-SNAPSHOT</version>-->
</dependency> <!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>org.assertj</groupId>-->
<!-- <artifactId>assertj-core</artifactId>-->
<!-- <version>3.18.1</version>-->
<!-- </dependency>-->
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>3.18.1</version>
</dependency>
</dependencies> </dependencies>
......
package com.netease.mail.yanxuan.change.integration.email.conig; //package com.netease.mail.yanxuan.change.integration.email.conig;
//
//
import java.util.List; //import java.util.List;
import java.util.Optional; //import java.util.Optional;
import java.util.stream.Collectors; //import java.util.stream.Collectors;
//
//
import com.netease.mail.yanxuan.change.integration.email.email.JumpLinkModel; //import com.netease.mail.yanxuan.change.integration.email.email.JumpLinkModel;
import com.netease.mail.yanxuan.change.integration.email.email.ProblemConfigureModel; //import com.netease.mail.yanxuan.change.integration.email.email.ProblemConfigureModel;
import org.springframework.beans.factory.annotation.Value; //import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component; //import org.springframework.stereotype.Component;
//
import com.ctrip.framework.apollo.spring.annotation.EnableAutoUpdateApolloConfig; //import com.ctrip.framework.apollo.spring.annotation.EnableAutoUpdateApolloConfig;
import com.ctrip.framework.apollo.spring.annotation.ValueMapping; //import com.ctrip.framework.apollo.spring.annotation.ValueMapping;
//
import lombok.Data; //import lombok.Data;
import org.springframework.util.CollectionUtils; //import org.springframework.util.CollectionUtils;
/** ///**
* 第三方平台通用apollo配置 // * 第三方平台通用apollo配置
*/ // */
@Data //@Data
@Component //@Component
@EnableAutoUpdateApolloConfig("3rd.base") //@EnableAutoUpdateApolloConfig("3rd.base")
public class ThirdCommonApolloConfig { //public class ThirdCommonApolloConfig {
//
private static final String DEFAULT = "default"; // private static final String DEFAULT = "default";
//
/** // /**
* 异常超级管理员(各个接入的服务业务架构统一角色id) // * 异常超级管理员(各个接入的服务业务架构统一角色id)
*/ // */
@Value("${abnormalAdminRoleId:7956010101}") // @Value("${abnormalAdminRoleId:7956010101}")
private Long abnormalAdminRoleId; // private Long abnormalAdminRoleId;
//
/** // /**
* 各工作台待办跳转链接 // * 各工作台待办跳转链接
*/ // */
@ValueMapping("${jumpLink:[]}") // @ValueMapping("${jumpLink:[]}")
private List<JumpLinkModel> jumpLinkMap; // private List<JumpLinkModel> jumpLinkMap;
//
/** // /**
* 各工作台邮件 // * 各工作台邮件
*/ // */
@ValueMapping("${emailFlowUrl:[]}") // @ValueMapping("${emailFlowUrl:[]}")
private List<JumpLinkModel> emailFlowUrl; // private List<JumpLinkModel> emailFlowUrl;
//
//
/** // /**
* 根据产品号获取跳转链接 // * 根据产品号获取跳转链接
* // *
* @param productCode // * @param productCode
* @return // * @return
*/ // */
public Optional<JumpLinkModel> getJumpLinkByProductCode(String productCode) { // public Optional<JumpLinkModel> getJumpLinkByProductCode(String productCode) {
List<JumpLinkModel> list = jumpLinkMap.stream().filter(x -> productCode.equals(x.getProductCode())) // List<JumpLinkModel> list = jumpLinkMap.stream().filter(x -> productCode.equals(x.getProductCode()))
.collect(Collectors.toList()); // .collect(Collectors.toList());
if (!CollectionUtils.isEmpty(list)) { // if (!CollectionUtils.isEmpty(list)) {
return Optional.of(list.get(0)); // return Optional.of(list.get(0));
} else { // } else {
list = jumpLinkMap.stream().filter(x -> DEFAULT.equals(x.getProductCode())).collect(Collectors.toList()); // list = jumpLinkMap.stream().filter(x -> DEFAULT.equals(x.getProductCode())).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(list)) { // if (!CollectionUtils.isEmpty(list)) {
return Optional.of(list.get(0)); // return Optional.of(list.get(0));
} // }
} // }
return Optional.of(jumpLinkMap.get(0)); // return Optional.of(jumpLinkMap.get(0));
} // }
//
@ValueMapping("${warehouseConfigureModel:{}}") // @ValueMapping("${warehouseConfigureModel:{}}")
private ProblemConfigureModel warehouseConfigureModel; // private ProblemConfigureModel warehouseConfigureModel;
//
@ValueMapping("${carrierConfigureModel:{}}") // @ValueMapping("${carrierConfigureModel:{}}")
private ProblemConfigureModel carrierConfigureModel; // private ProblemConfigureModel carrierConfigureModel;
//
} //}
package com.netease.mail.yanxuan.change.integration.email.email; //package com.netease.mail.yanxuan.change.integration.email.email;
//
import org.assertj.core.util.Lists; //import org.assertj.core.util.Lists;
import lombok.SneakyThrows; //import lombok.SneakyThrows;
import org.springframework.beans.BeanUtils; //import org.springframework.beans.BeanUtils;
//
import java.util.ArrayList; //import java.util.ArrayList;
import java.util.List; //import java.util.List;
//
public class BaseConvertor { //public class BaseConvertor {
@SneakyThrows // @SneakyThrows
public static <T> T convert(Object object, final Class<T> clazz) { // public static <T> T convert(Object object, final Class<T> clazz) {
if (object == null) { // if (object == null) {
return null; // return null;
} // }
T t = clazz.newInstance(); // T t = clazz.newInstance();
BeanUtils.copyProperties(object, t); // BeanUtils.copyProperties(object, t);
return t; // return t;
} // }
//
@SneakyThrows // @SneakyThrows
public static void copyProperties(Object source, Object target) { // public static void copyProperties(Object source, Object target) {
BeanUtils.copyProperties(source, target); // BeanUtils.copyProperties(source, target);
} // }
//
@SneakyThrows // @SneakyThrows
public static <T> List<T> convert(List<?> objects, final Class<T> clazz) { // public static <T> List<T> convert(List<?> objects, final Class<T> clazz) {
if (org.apache.commons.collections.CollectionUtils.isEmpty(objects)) { // if (org.apache.commons.collections.CollectionUtils.isEmpty(objects)) {
return new ArrayList<>(); // return new ArrayList<>();
} // }
List<T> retList = Lists.newArrayList(); // List<T> retList = Lists.newArrayList();
objects.forEach(object -> { // objects.forEach(object -> {
try { // try {
T t = clazz.newInstance(); // T t = clazz.newInstance();
BeanUtils.copyProperties(object, t); // BeanUtils.copyProperties(object, t);
retList.add(t); // retList.add(t);
} catch (Exception ex) { // } catch (Exception ex) {
try { // try {
throw ex; // throw ex;
} catch (InstantiationException e) { // } catch (InstantiationException e) {
e.printStackTrace(); // e.printStackTrace();
} catch (IllegalAccessException e) { // } catch (IllegalAccessException e) {
e.printStackTrace(); // e.printStackTrace();
} // }
} // }
}); // });
return retList; // return retList;
} // }
} //}
package com.netease.mail.yanxuan.change.integration.email.email; //package com.netease.mail.yanxuan.change.integration.email.email;
//
import com.alibaba.fastjson.JSON; //import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; //import com.alibaba.fastjson.JSONObject;
import com.netease.mail.yanxuan.change.integration.email.conig.RpcTemplate; //import com.netease.mail.yanxuan.change.integration.email.conig.RpcTemplate;
import com.netease.mail.yanxuan.change.common.bean.ResponseCode; //import com.netease.mail.yanxuan.change.common.bean.ResponseCode;
import com.netease.mail.yanxuan.change.integration.email.exception.RpcException; //import com.netease.mail.yanxuan.change.integration.email.exception.RpcException;
//
import java.io.IOException; //import java.io.IOException;
//
public class EmailTemplateRpcResult<T> implements RpcTemplate.CallHandler<T> { //public class EmailTemplateRpcResult<T> implements RpcTemplate.CallHandler<T> {
//
private static final String CODE = "code"; // private static final String CODE = "code";
//
private static final String RESULT = "data"; // private static final String RESULT = "data";
//
private static final String MESSAGE = "errorMessage"; // private static final String MESSAGE = "errorMessage";
//
private Class<T> tClass; // private Class<T> tClass;
//
public EmailTemplateRpcResult(Class<T> tClass){ // public EmailTemplateRpcResult(Class<T> tClass){
this.tClass = tClass; // this.tClass = tClass;
} // }
//
@Override // @Override
public T handle(String resp) throws IOException { // public T handle(String resp) throws IOException {
JSONObject rpcResult = JSON.parseObject(resp); // JSONObject rpcResult = JSON.parseObject(resp);
EmailTemplateResponResult responResult = new EmailTemplateResponResult(); // EmailTemplateResponResult responResult = new EmailTemplateResponResult();
int code = rpcResult.getIntValue(CODE); // int code = rpcResult.getIntValue(CODE);
if(code == ResponseCode.SUCCESS.getCode()){ // if(code == ResponseCode.SUCCESS.getCode()){
String data = rpcResult.getString(RESULT); // String data = rpcResult.getString(RESULT);
responResult.setData(data); // responResult.setData(data);
return (T) responResult; // return (T) responResult;
} // }
String errorMessage = rpcResult.getString(MESSAGE); // String errorMessage = rpcResult.getString(MESSAGE);
throw new RpcException("email template response error, code : " + code + " , errorMessage : " + errorMessage); // throw new RpcException("email template response error, code : " + code + " , errorMessage : " + errorMessage);
} // }
} //}
package com.netease.mail.yanxuan.change.integration.email.email; //package com.netease.mail.yanxuan.change.integration.email.email;
//
import com.alibaba.fastjson.JSON; //import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; //import com.alibaba.fastjson.JSONObject;
import com.netease.mail.yanxuan.change.integration.email.conig.RpcTemplate; //import com.netease.mail.yanxuan.change.integration.email.conig.RpcTemplate;
import com.netease.mail.yanxuan.change.common.bean.ResponseCode; //import com.netease.mail.yanxuan.change.common.bean.ResponseCode;
import com.netease.mail.yanxuan.change.integration.email.exception.RpcException; //import com.netease.mail.yanxuan.change.integration.email.exception.RpcException;
import com.netease.mail.yanxuan.change.integration.email.dto.UserInfoDTO; //import com.netease.mail.yanxuan.change.integration.email.dto.UserInfoDTO;
import java.io.IOException; //import java.io.IOException;
//
public class IusRpcResult<T> implements RpcTemplate.CallHandler<T> { //public class IusRpcResult<T> implements RpcTemplate.CallHandler<T> {
//
private static final String CODE = "code"; // private static final String CODE = "code";
//
private static final String RESULT = "data"; // private static final String RESULT = "data";
//
private static final String ERROR_CODE = "errorCode"; // private static final String ERROR_CODE = "errorCode";
//
private static final String ERROR_MESSAGE = "errorMsg"; // private static final String ERROR_MESSAGE = "errorMsg";
//
private Class<T> tClass; // private Class<T> tClass;
//
public IusRpcResult(Class<T> tClass) { // public IusRpcResult(Class<T> tClass) {
this.tClass = tClass; // this.tClass = tClass;
} // }
//
@Override // @Override
public T handle(String resp) throws IOException { // public T handle(String resp) throws IOException {
JSONObject rpcResult = JSON.parseObject(resp); // JSONObject rpcResult = JSON.parseObject(resp);
ResponseResult responResult = new ResponseResult(); // ResponseResult responResult = new ResponseResult();
int code = rpcResult.getIntValue(CODE); // int code = rpcResult.getIntValue(CODE);
if (code == ResponseCode.SUCCESS.getCode()) { // if (code == ResponseCode.SUCCESS.getCode()) {
String data = rpcResult.getString(RESULT); // String data = rpcResult.getString(RESULT);
UserInfoDTO jsonObject = JSON.parseObject(data, UserInfoDTO.class); // UserInfoDTO jsonObject = JSON.parseObject(data, UserInfoDTO.class);
responResult.setData(jsonObject); // responResult.setData(jsonObject);
return (T) responResult; // return (T) responResult;
} // }
String errorMessage = rpcResult.getString(ERROR_MESSAGE); // String errorMessage = rpcResult.getString(ERROR_MESSAGE);
Integer errorCode = rpcResult.getInteger(ERROR_CODE); // Integer errorCode = rpcResult.getInteger(ERROR_CODE);
throw new RpcException("ius response error, resp=" + JSON.toJSONString(resp) + " , errorCode : " + errorCode // throw new RpcException("ius response error, resp=" + JSON.toJSONString(resp) + " , errorCode : " + errorCode
+ " , errorMessage : " + errorMessage); // + " , errorMessage : " + errorMessage);
} // }
} //}
package com.netease.mail.yanxuan.change.integration.email.email; //package com.netease.mail.yanxuan.change.integration.email.email;
//
import lombok.Builder; //import lombok.Builder;
import lombok.Data; //import lombok.Data;
import java.util.List; //import java.util.List;
//
@Data //@Data
@Builder //@Builder
public class OverTimeFlowVo { //public class OverTimeFlowVo {
//
/** // /**
* 用户邮箱 // * 用户邮箱
*/ // */
private String uid; // private String uid;
//
/** // /**
* 工单列表 // * 工单列表
*/ // */
private List<OverTimeUserVo> flowIdList; // private List<OverTimeUserVo> flowIdList;
//
@Override // @Override
protected Object clone() throws CloneNotSupportedException { // protected Object clone() throws CloneNotSupportedException {
OverTimeFlowVo vo = (OverTimeFlowVo) super.clone(); // OverTimeFlowVo vo = (OverTimeFlowVo) super.clone();
vo.setUid(vo.getUid()); // vo.setUid(vo.getUid());
vo.setFlowIdList(BaseConvertor.convert(vo.getFlowIdList(), OverTimeUserVo.class)); // vo.setFlowIdList(BaseConvertor.convert(vo.getFlowIdList(), OverTimeUserVo.class));
return vo; // return vo;
} // }
} //}
package com.netease.mail.yanxuan.change.integration.email.email; //package com.netease.mail.yanxuan.change.integration.email.email;
//
import com.netease.mail.yanxuan.qc.service.client.meta.abnormal.LabelModel; //import com.netease.mail.yanxuan.qc.service.client.meta.abnormal.LabelModel;
import lombok.Data; //import lombok.Data;
//
import java.util.List; //import java.util.List;
//
@Data //@Data
public class ProblemConfigureModel { //public class ProblemConfigureModel {
/** // /**
* 问题类型配置表id // * 问题类型配置表id
*/ // */
private Long problemTypeId; // private Long problemTypeId;
/** // /**
* 异常环节 // * 异常环节
*/ // */
private List<LabelModel> abnormalLinks; // private List<LabelModel> abnormalLinks;
/** // /**
* 问题分类 // * 问题分类
*/ // */
private List<LabelModel> flowProblems; // private List<LabelModel> flowProblems;
} //}
package com.netease.mail.yanxuan.change.integration.email.email; //package com.netease.mail.yanxuan.change.integration.email.email;
//
import com.alibaba.fastjson.JSON; //import com.alibaba.fastjson.JSON;
import com.netease.mail.yanxuan.change.integration.email.conig.RpcTemplate; //import com.netease.mail.yanxuan.change.integration.email.conig.RpcTemplate;
//
import java.io.IOException; //import java.io.IOException;
//
/** ///**
* 直接序列化返回对象 // * 直接序列化返回对象
* // *
* @author lwtang // * @author lwtang
* @date 2019-02-20 // * @date 2019-02-20
*/ // */
public class RpcObjectHandler<T> implements RpcTemplate.CallHandler<T> { //public class RpcObjectHandler<T> implements RpcTemplate.CallHandler<T> {
//
private Class<T> tClass; // private Class<T> tClass;
//
//
public RpcObjectHandler(Class<T> tClass) {this.tClass = tClass;} // public RpcObjectHandler(Class<T> tClass) {this.tClass = tClass;}
//
@Override // @Override
public T handle(String resp) throws IOException { // public T handle(String resp) throws IOException {
return JSON.parseObject(resp, tClass); // return JSON.parseObject(resp, tClass);
} // }
} //}
package com.netease.mail.yanxuan.change.integration.email.service; //package com.netease.mail.yanxuan.change.integration.email.service;
//
import com.netease.mail.yanxuan.change.integration.email.email.*; //import com.netease.mail.yanxuan.change.integration.email.email.*;
import com.netease.mail.yanxuan.change.integration.email.enums.EmailEhcFlowEnum; //import com.netease.mail.yanxuan.change.integration.email.enums.EmailEhcFlowEnum;
import java.io.File; //import java.io.File;
import java.util.Collection; //import java.util.Collection;
import java.util.List; //import java.util.List;
//
public interface IEmailEhcService { //public interface IEmailEhcService {
/** // /**
* 任务工单发送邮件 // * 任务工单发送邮件
* // *
* @param toList // * @param toList
* 收件人列表 // * 收件人列表
* @param ccList // * @param ccList
* 抄送人列表 // * 抄送人列表
* @param model // * @param model
* 要素 // * 要素
* @param emailEhcFlowEnum // * @param emailEhcFlowEnum
*/ // */
void sendTaskEmail(Collection<String> toList, Collection<String> ccList, AbnormalTaskFlowEhcEmailModel model, // void sendTaskEmail(Collection<String> toList, Collection<String> ccList, AbnormalTaskFlowEhcEmailModel model,
EmailEhcFlowEnum emailEhcFlowEnum); // EmailEhcFlowEnum emailEhcFlowEnum);
//
/** // /**
* 供应商专属邮件发送 // * 供应商专属邮件发送
* // *
* @param supplierId // * @param supplierId
* @param model // * @param model
* @param emailEhcFlowEnum // * @param emailEhcFlowEnum
*/ // */
void sendSupplierEmail(String supplierId, AbnormalTaskFlowEhcEmailModel model, EmailEhcFlowEnum emailEhcFlowEnum); // void sendSupplierEmail(String supplierId, AbnormalTaskFlowEhcEmailModel model, EmailEhcFlowEnum emailEhcFlowEnum);
//
/** // /**
* 供应商惩罚工单发送邮件 // * 供应商惩罚工单发送邮件
* // *
* @param toList // * @param toList
* @param ccList // * @param ccList
* @param model // * @param model
* @param emailEhcFlowEnum // * @param emailEhcFlowEnum
*/ // */
void sendPunishEmail(Collection<String> toList, Collection<String> ccList, AbnormalPunishFlowEhcEmailModel model, // void sendPunishEmail(Collection<String> toList, Collection<String> ccList, AbnormalPunishFlowEhcEmailModel model,
EmailEhcFlowEnum emailEhcFlowEnum); // EmailEhcFlowEnum emailEhcFlowEnum);
//
/** // /**
* 异常问题工单发送邮件 // * 异常问题工单发送邮件
* // *
* @param toList // * @param toList
* 收件人列表 // * 收件人列表
* @param ccList // * @param ccList
* 抄送人列表. // * 抄送人列表.
* @param emailEhcFlowEnum // * @param emailEhcFlowEnum
* 邮件模板 // * 邮件模板
* @param abnormalEhcEmailModel // * @param abnormalEhcEmailModel
* 数据 // * 数据
*/ // */
void sendAbnormalEmail(Collection<String> toList, Collection<String> ccList, EmailEhcFlowEnum emailEhcFlowEnum, // void sendAbnormalEmail(Collection<String> toList, Collection<String> ccList, EmailEhcFlowEnum emailEhcFlowEnum,
AbnormalEhcEmailModel abnormalEhcEmailModel); // AbnormalEhcEmailModel abnormalEhcEmailModel);
//
/** // /**
* 批量事件工单发送邮件 // * 批量事件工单发送邮件
* // *
* @param toList // * @param toList
* @param ccList // * @param ccList
* @param model // * @param model
* @param // * @param
*/ // */
void sendBathEventEmail(Collection<String> toList, Collection<String> ccList, AbnormalBathEventEhcEmailModel model, // void sendBathEventEmail(Collection<String> toList, Collection<String> ccList, AbnormalBathEventEhcEmailModel model,
EmailEhcFlowEnum emailEhcFlowEnum); // EmailEhcFlowEnum emailEhcFlowEnum);
//
/** // /**
* 临期/过期工单发送邮件 // * 临期/过期工单发送邮件
* // *
* @param toList // * @param toList
* @param ccList // * @param ccList
* @param model // * @param model
* @param emailEhcFlowEnum // * @param emailEhcFlowEnum
*/ // */
void sendOverTimeEmail(Collection<String> toList, Collection<String> ccList, FlowEhcOverTimeEmailModel model, // void sendOverTimeEmail(Collection<String> toList, Collection<String> ccList, FlowEhcOverTimeEmailModel model,
EmailEhcFlowEnum emailEhcFlowEnum); // EmailEhcFlowEnum emailEhcFlowEnum);
//
/** // /**
* 邮件发送 // * 邮件发送
* // *
* @param toList // * @param toList
* 收件人列表 // * 收件人列表
* @param ccList // * @param ccList
* 抄送人列表 // * 抄送人列表
* @param factor // * @param factor
* 要素 // * 要素
* @param fileList // * @param fileList
* 附件 // * 附件
*/ // */
void sendEmail(Collection<String> toList, Collection<String> ccList, EmailEhcFactor factor, List<File> fileList); // void sendEmail(Collection<String> toList, Collection<String> ccList, EmailEhcFactor factor, List<File> fileList);
//
/** // /**
* 获取邮件发送工单地址 // * 获取邮件发送工单地址
* // *
* @param uid // * @param uid
* @return // * @return
*/ // */
String getEmailContentUrl(String uid); // String getEmailContentUrl(String uid);
//
/** // /**
* 获取异常任务工单邮件发送地址 // * 获取异常任务工单邮件发送地址
* // *
* @param uid // * @param uid
* @param execUserType // * @param execUserType
* @return // * @return
*/ // */
String getTaskFlowEmailUrl(String uid, Integer execUserType); // String getTaskFlowEmailUrl(String uid, Integer execUserType);
} //}
package com.netease.mail.yanxuan.change.integration.email.service; //package com.netease.mail.yanxuan.change.integration.email.service;
//
import com.netease.mail.yanxuan.change.integration.email.email.EmailFactor; //import com.netease.mail.yanxuan.change.integration.email.email.EmailFactor;
import java.io.File; //import java.io.File;
import java.util.Collection; //import java.util.Collection;
import java.util.List; //import java.util.List;
//
/** ///**
* 发送邮件 // * 发送邮件
*/ // */
public interface IEmailService { //public interface IEmailService {
//
/** // /**
* @param to 收件人 // * @param to 收件人
* @param emailFactor 邮件要素 // * @param emailFactor 邮件要素
*/ // */
void sendEmail(String to, EmailFactor emailFactor); // void sendEmail(String to, EmailFactor emailFactor);
//
/** // /**
* @param toList 收件人列表 // * @param toList 收件人列表
* @param factor 要素 // * @param factor 要素
*/ // */
void sendEmail(Collection<String> toList, EmailFactor factor); // void sendEmail(Collection<String> toList, EmailFactor factor);
//
/** // /**
* @param toList 收件人 // * @param toList 收件人
* @param ccList 抄送人 // * @param ccList 抄送人
* @param factor 要素 // * @param factor 要素
* @param fileList 附件 // * @param fileList 附件
*/ // */
void sendEmail(String toList, String ccList, EmailFactor factor,List<File> fileList); // void sendEmail(String toList, String ccList, EmailFactor factor,List<File> fileList);
//
/** // /**
* // *
* @param toList 收件人列表 // * @param toList 收件人列表
* @param ccList 抄送人列表 // * @param ccList 抄送人列表
* @param factor 要素 // * @param factor 要素
*/ // */
void sendEmail(Collection<String> toList, Collection<String> ccList, EmailFactor factor); // void sendEmail(Collection<String> toList, Collection<String> ccList, EmailFactor factor);
//
/** // /**
* @param toList 收件人列表 // * @param toList 收件人列表
* @param ccList 抄送人列表 // * @param ccList 抄送人列表
* @param factor 要素 // * @param factor 要素
* @param fileList 附件 // * @param fileList 附件
*/ // */
void sendEmail(Collection<String> toList, Collection<String> ccList, EmailFactor factor, List<File> fileList); // void sendEmail(Collection<String> toList, Collection<String> ccList, EmailFactor factor, List<File> fileList);
//
//
} //}
package com.netease.mail.yanxuan.change.integration.email.service; //package com.netease.mail.yanxuan.change.integration.email.service;
//
import java.util.List; //import java.util.List;
//
import com.netease.mail.yanxuan.change.integration.email.dto.DeptIdLevelLeaderDTO; //import com.netease.mail.yanxuan.change.integration.email.dto.DeptIdLevelLeaderDTO;
import com.netease.mail.yanxuan.change.integration.email.dto.ThirdOrgPosDTO; //import com.netease.mail.yanxuan.change.integration.email.dto.ThirdOrgPosDTO;
import com.netease.mail.yanxuan.change.integration.email.dto.UserInfoDTO; //import com.netease.mail.yanxuan.change.integration.email.dto.UserInfoDTO;
import com.netease.mail.yanxuan.change.integration.email.dto.UserUniteOrgMetaDTO; //import com.netease.mail.yanxuan.change.integration.email.dto.UserUniteOrgMetaDTO;
import com.netease.mail.yanxuan.change.integration.email.email.SearchResult; //import com.netease.mail.yanxuan.change.integration.email.email.SearchResult;
import com.netease.mail.yanxuan.change.integration.email.dto.UserProductRoleStaticsInfosDTO; //import com.netease.mail.yanxuan.change.integration.email.dto.UserProductRoleStaticsInfosDTO;
import com.netease.mail.yanxuan.change.integration.email.email.UserVO; //import com.netease.mail.yanxuan.change.integration.email.email.UserVO;
import com.netease.yanxuan.flowx.sdk.meta.dto.base.UserBaseDTO; //import com.netease.yanxuan.flowx.sdk.meta.dto.base.UserBaseDTO;
//
/** ///**
* @author jiyuwang 商品是否有模块化受控标准 // * @author jiyuwang 商品是否有模块化受控标准
*/ // */
public interface IIusService { //public interface IIusService {
//
/** // /**
* 获取用户的部门信息和在职情况 // * 获取用户的部门信息和在职情况
* // *
* @param uid // * @param uid
* @return // * @return
*/ // */
UserInfoDTO getUserInfo(String uid); // UserInfoDTO getUserInfo(String uid);
//
/** // /**
* 查询用户集合,不传时查全部 // * 查询用户集合,不传时查全部
* http://yx.mail.netease.com/bee#/interface/list;serviceCode=yanxuan-ius;branchName=master;selectedInterface=1010712 // * http://yx.mail.netease.com/bee#/interface/list;serviceCode=yanxuan-ius;branchName=master;selectedInterface=1010712
* @param productCode // * @param productCode
* @param uid // * @param uid
* @return // * @return
*/ // */
List<UserInfoDTO> queryUserInfo(String productCode, String uid); // List<UserInfoDTO> queryUserInfo(String productCode, String uid);
//
/** // /**
* 根据uid获取部门 // * 根据uid获取部门
* // *
* @param uid // * @param uid
* @return // * @return
*/ // */
String getOrgByUid(String uid); // String getOrgByUid(String uid);
//
/** // /**
* 判断用户是否离职 // * 判断用户是否离职
* // *
* @param uid // * @param uid
* @return true: 离职;false: 未离职 // * @return true: 离职;false: 未离职
*/ // */
boolean checkUserIsLeave(String uid); // boolean checkUserIsLeave(String uid);
//
/** // /**
* 获取部门负责人 // * 获取部门负责人
* // *
* @param uid // * @param uid
* @param orgPosId // * @param orgPosId
* @return // * @return
*/ // */
List<DeptIdLevelLeaderDTO> getDeptIdLevelLeader(String uid, Integer orgPosId); // List<DeptIdLevelLeaderDTO> getDeptIdLevelLeader(String uid, Integer orgPosId);
//
/** // /**
* 根据用户获取三级部门负责人 // * 根据用户获取三级部门负责人
* // *
* @param uid // * @param uid
* @return // * @return
*/ // */
List<DeptIdLevelLeaderDTO> getThreeLevelDeptLeader(String uid); // List<DeptIdLevelLeaderDTO> getThreeLevelDeptLeader(String uid);
//
/** // /**
* 获取四级部门负责人 // * 获取四级部门负责人
* @param uid // * @param uid
* @return // * @return
*/ // */
List<DeptIdLevelLeaderDTO> getForthLevelDeptLeader(String uid); // List<DeptIdLevelLeaderDTO> getForthLevelDeptLeader(String uid);
//
/** // /**
* 模糊查询用户信息 // * 模糊查询用户信息
*/ // */
List<UserUniteOrgMetaDTO> fuzzyQueryUserInformation(int queryType, String keyword); // List<UserUniteOrgMetaDTO> fuzzyQueryUserInformation(int queryType, String keyword);
//
/** // /**
* 模糊查询用户信息(权限中心) // * 模糊查询用户信息(权限中心)
*/ // */
List<UserUniteOrgMetaDTO> fuzzyQueryUserInfo(Long orgPosId, int level, int type, int queryType, String keyword); // List<UserUniteOrgMetaDTO> fuzzyQueryUserInfo(Long orgPosId, int level, int type, int queryType, String keyword);
//
/** // /**
* 获得该系统下的该用户组织身份权限或者特殊权限 // * 获得该系统下的该用户组织身份权限或者特殊权限
* // *
* @param staff // * @param staff
* @param roleId // * @param roleId
* @param orgPosId // * @param orgPosId
* @param stationId // * @param stationId
* @param locked // * @param locked
* @param keyword // * @param keyword
* @param curPage // * @param curPage
* @param pageSize // * @param pageSize
* @return // * @return
*/ // */
SearchResult<UserProductRoleStaticsInfosDTO> getAllUserProductRoleInfos(Integer staff, Long roleId, Long orgPosId, // SearchResult<UserProductRoleStaticsInfosDTO> getAllUserProductRoleInfos(Integer staff, Long roleId, Long orgPosId,
Integer stationId, Integer locked, String keyword, Integer curPage, Integer pageSize); // Integer stationId, Integer locked, String keyword, Integer curPage, Integer pageSize);
//
/** // /**
* 根据产品号和 roleId 获取用户列表 // * 根据产品号和 roleId 获取用户列表
* // *
* @param productCode // * @param productCode
* @param roleId // * @param roleId
* @return // * @return
*/ // */
List<UserBaseDTO> listUserByRoleId(String productCode, Long roleId); // List<UserBaseDTO> listUserByRoleId(String productCode, Long roleId);
//
/** // /**
* 根据uid获取三级部门人员相关信息 // * 根据uid获取三级部门人员相关信息
* @param uid // * @param uid
* @return // * @return
*/ // */
UserVO lv3UserInfo(String uid); // UserVO lv3UserInfo(String uid);
//
/** // /**
* 获取用户所在系统编码(弃用) // * 获取用户所在系统编码(弃用)
* // *
* @param uid // * @param uid
* @return // * @return
*/ // */
@Deprecated // @Deprecated
List<String> listProductHasUid(String uid); // List<String> listProductHasUid(String uid);
//
/** // /**
* 三级部门查询列表 // * 三级部门查询列表
* @param name // * @param name
* @return // * @return
*/ // */
List<ThirdOrgPosDTO> getThirdOrgPosName(String name); // List<ThirdOrgPosDTO> getThirdOrgPosName(String name);
//
//
//
//
} //}
package com.netease.mail.yanxuan.change.integration.email.service; //package com.netease.mail.yanxuan.change.integration.email.service;
//
//
import com.netease.mail.yanxuan.change.integration.email.email.SupplierEmailResponseResult; //import com.netease.mail.yanxuan.change.integration.email.email.SupplierEmailResponseResult;
import com.netease.mail.yanxuan.change.integration.email.email.SupplierEmailSendReq; //import com.netease.mail.yanxuan.change.integration.email.email.SupplierEmailSendReq;
//
public interface ISupplierEmailService { //public interface ISupplierEmailService {
//
SupplierEmailResponseResult sendSupplierEmail(SupplierEmailSendReq req); // SupplierEmailResponseResult sendSupplierEmail(SupplierEmailSendReq req);
} //}
\ No newline at end of file \ No newline at end of file
package com.netease.mail.yanxuan.change.integration.email.service; //package com.netease.mail.yanxuan.change.integration.email.service;
//
import java.io.File; //import java.io.File;
import java.util.Collection; //import java.util.Collection;
import java.util.List; //import java.util.List;
//
public interface IUasEhcClient { //public interface IUasEhcClient {
//
/** // /**
* 邮件发送 // * 邮件发送
* // *
* @param subject // * @param subject
* @param content // * @param content
* @param toList // * @param toList
* @param ccList // * @param ccList
* @param fileList // * @param fileList
*/ // */
void sendEmail(String subject, String content, Collection<String> toList, Collection<String> ccList, // void sendEmail(String subject, String content, Collection<String> toList, Collection<String> ccList,
List<File> fileList); // List<File> fileList);
} //}
\ No newline at end of file \ No newline at end of file
package com.netease.mail.yanxuan.change.integration.email.util; //package com.netease.mail.yanxuan.change.integration.email.util;
//
import java.net.URLDecoder; //import java.net.URLDecoder;
import java.net.URLEncoder; //import java.net.URLEncoder;
import java.util.ArrayList; //import java.util.ArrayList;
import java.util.List; //import java.util.List;
import java.util.Map; //import java.util.Map;
import org.apache.commons.lang3.StringUtils; //import org.apache.commons.lang3.StringUtils;
//
/** ///**
* @author lwtang // * @author lwtang
* @date 2019-02-19 // * @date 2019-02-19
*/ // */
public class EncodeUtil { //public class EncodeUtil {
//
private static final char[] CHARS = new char[] { '0', '1', '2', '3', '4', '5', '6', '7', '8', // private static final char[] CHARS = new char[] { '0', '1', '2', '3', '4', '5', '6', '7', '8',
'9', 'a', 'b', 'c', 'd', 'e', 'f' }; // '9', 'a', 'b', 'c', 'd', 'e', 'f' };
//
public static String encode(String text) { // public static String encode(String text) {
try { // try {
return URLEncoder.encode(text, "UTF-8"); // return URLEncoder.encode(text, "UTF-8");
} catch (Exception e) { // } catch (Exception e) {
return text; // return text;
} // }
} // }
//
public static String encodeMap(Map<?, ?> map) { // public static String encodeMap(Map<?, ?> map) {
List<String> lines = new ArrayList<>(); // List<String> lines = new ArrayList<>();
for (Map.Entry<?, ?> entry: map.entrySet()) { // for (Map.Entry<?, ?> entry: map.entrySet()) {
lines.add(String.valueOf(entry.getKey()) + "=" + String.valueOf(entry.getValue())); // lines.add(String.valueOf(entry.getKey()) + "=" + String.valueOf(entry.getValue()));
} // }
return StringUtils.join(lines, "&"); // return StringUtils.join(lines, "&");
} // }
//
public static String decode(String text) { // public static String decode(String text) {
try { // try {
return URLDecoder.decode(text, "UTF-8"); // return URLDecoder.decode(text, "UTF-8");
} catch (Exception e) { // } catch (Exception e) {
return text; // return text;
} // }
} // }
//
public static String ASCIIHex(String text) { // public static String ASCIIHex(String text) {
byte[] bytes = text.getBytes(); // byte[] bytes = text.getBytes();
char[] chars = new char[bytes.length * 2]; // char[] chars = new char[bytes.length * 2];
for (int i = 0; i < bytes.length; i++) { // for (int i = 0; i < bytes.length; i++) {
chars[2 * i] = CHARS[bytes[i] >> 4]; // chars[2 * i] = CHARS[bytes[i] >> 4];
chars[2 * i + 1] = CHARS[bytes[i] % 16]; // chars[2 * i + 1] = CHARS[bytes[i] % 16];
} // }
return new String(chars).toUpperCase(); // return new String(chars).toUpperCase();
} // }
//
} //}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment