Commit df9a2c6d by “zcwang”

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

# Conflicts:
#	yanxuan-qc-change-system-integration/src/main/java/com/netease/mail/yanxuan/change/integration/qc/meta/QcCategoryVO.java
parents d31d5489 946c4a0c
...@@ -22,7 +22,7 @@ public interface AdminChangeConfigService { ...@@ -22,7 +22,7 @@ public interface AdminChangeConfigService {
* @param id 模板id * @param id 模板id
* @return * @return
*/ */
AjaxResult queryDetail(Long id); AjaxResult queryDetail(Long id,Long sonChangeClassId);
/** /**
* 新增更改类型配置模板 * 新增更改类型配置模板
......
...@@ -11,6 +11,8 @@ public interface ChangeConfigService { ...@@ -11,6 +11,8 @@ public interface ChangeConfigService {
ChangeConfig queryChangeConfig(Long id); ChangeConfig queryChangeConfig(Long id);
ChangeConfig queryChangeConfig(Long id,Long sonChangeClassId);
ChangeConfig queryChangeType(Long parentChangeClassId,Long sonChangeClassId); ChangeConfig queryChangeType(Long parentChangeClassId,Long sonChangeClassId);
Boolean deleteChangeConfig(Long id); Boolean deleteChangeConfig(Long id);
......
...@@ -16,6 +16,9 @@ import com.netease.mail.yanxuan.change.integration.flow.goods.ItemcenterApiRpcSe ...@@ -16,6 +16,9 @@ import com.netease.mail.yanxuan.change.integration.flow.goods.ItemcenterApiRpcSe
import com.netease.mail.yanxuan.change.integration.flow.goods.PfuApiRpcService; import com.netease.mail.yanxuan.change.integration.flow.goods.PfuApiRpcService;
import com.netease.mail.yanxuan.change.integration.flow.goods.QcApiRpcService; import com.netease.mail.yanxuan.change.integration.flow.goods.QcApiRpcService;
import com.netease.mail.yanxuan.change.integration.flow.supplier.FlowRpcSupplierSendService; import com.netease.mail.yanxuan.change.integration.flow.supplier.FlowRpcSupplierSendService;
import com.netease.mail.yanxuan.change.integration.flow.supplier.req.SupplierRelatedUserReq;
import com.netease.mail.yanxuan.change.integration.flow.supplier.rsp.SupplierUserRsp;
import com.netease.yanxuan.flowx.sdk.meta.controller.communal.AjaxResponse;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -47,8 +50,14 @@ public class InteriorChangeConfigServiceImpl implements InteriorChangeConfigServ ...@@ -47,8 +50,14 @@ public class InteriorChangeConfigServiceImpl implements InteriorChangeConfigServ
@Autowired @Autowired
private FlowRpcSupplierSendService supplierSendService; private FlowRpcSupplierSendService supplierSendService;
/**
* 接口不完整,关于商品的查询已经完成 供应商查询不完整接口已对接 具体返回值接口测试未完成
* @param changeCommander
* @return
*/
@Override @Override
public GoodsResponseRpc queryCommanderInfo(ChangeCommanderPO changeCommander) { public GoodsResponseRpc queryCommanderInfo(ChangeCommanderPO changeCommander) {
GoodsResponseRpc rpc = new GoodsResponseRpc();
//获取模板名称 通过一级变更类型 二级变更类型ID 定位模板 //获取模板名称 通过一级变更类型 二级变更类型ID 定位模板
ChangeConfig changeConfig = changeConfigService.queryChangeType(changeCommander.getParentChangeClassId(), changeCommander.getSonChangeClassId()); ChangeConfig changeConfig = changeConfigService.queryChangeType(changeCommander.getParentChangeClassId(), changeCommander.getSonChangeClassId());
if (changeConfig == null){ if (changeConfig == null){
...@@ -58,8 +67,9 @@ public class InteriorChangeConfigServiceImpl implements InteriorChangeConfigServ ...@@ -58,8 +67,9 @@ public class InteriorChangeConfigServiceImpl implements InteriorChangeConfigServ
ChangeCommanderEnum changeCommanderEnum = ChangeCommanderEnum.getChangeCommanderEnum(changeConfig.getChangeCommanderType()); ChangeCommanderEnum changeCommanderEnum = ChangeCommanderEnum.getChangeCommanderEnum(changeConfig.getChangeCommanderType());
//直接排除 选项为固定人 或者发起人 //直接排除 选项为固定人 或者发起人
if (changeCommanderEnum.getId() == 1 || changeCommanderEnum.getId() == 2){ if (changeCommanderEnum.getId() == 1 || changeCommanderEnum.getId() == 2){
//固定人或者发起人 changeConfig.getChangeCommander(); //固定人或者发起人;
return null; rpc.setChangeCommander(changeConfig.getChangeCommander());
return rpc;
} }
ChangeSubjectEnum changeSubjectEnum = ChangeSubjectEnum.getChangeSubjectEnum(changeConfig.getChangeSubject()); ChangeSubjectEnum changeSubjectEnum = ChangeSubjectEnum.getChangeSubjectEnum(changeConfig.getChangeSubject());
if (changeSubjectEnum.getType() == 1){ if (changeSubjectEnum.getType() == 1){
...@@ -159,16 +169,28 @@ public class InteriorChangeConfigServiceImpl implements InteriorChangeConfigServ ...@@ -159,16 +169,28 @@ public class InteriorChangeConfigServiceImpl implements InteriorChangeConfigServ
* @return * @return
*/ */
private GoodsResponseRpc queryChangeSupplier(ChangeCommanderEnum commanderEnum,String changeSupplierId,String commander){ private GoodsResponseRpc queryChangeSupplier(ChangeCommanderEnum commanderEnum,String changeSupplierId,String commander){
GoodsResponseRpc rpc = new GoodsResponseRpc();
if (commanderEnum.getId() != 4 || changeSupplierId == null || commander == null){ if (commanderEnum.getId() != 4 || changeSupplierId == null || commander == null){
return null; return null;
} }
SupplierRelatedUserReq req = new SupplierRelatedUserReq();
List<String> supplierIdList = new ArrayList<>();
supplierIdList.add(changeSupplierId);
//changeSupplier 根据提供的信息去查询 最终返回 //changeSupplier 根据提供的信息去查询 最终返回
if (commander.equals("采购")){ if (commander.equals("采购")){
req.setSearchType(1);
}else if (commander.equals("计划")){ }else if (commander.equals("计划")){
req.setSearchType(2);
}else if (commander.equals("SQE")){ }else if (commander.equals("SQE")){
req.setSearchType(3);
}
req.setSupplierIdList(supplierIdList);
//进行参数解析
AjaxResponse<List<SupplierUserRsp>> listAjaxResponse = supplierSendService.querySupplierRelatedUser(req);
List<SupplierUserRsp> data = listAjaxResponse.getData();
if (data != null){
// 返回结果有问题暂时不动
//rpc.setSupplierId();
} }
return null; return null;
} }
......
...@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject; ...@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
import com.netease.mail.yanxuan.change.biz.meta.exception.ExceptionFactory; import com.netease.mail.yanxuan.change.biz.meta.exception.ExceptionFactory;
import com.netease.mail.yanxuan.change.biz.service.change.ChangeConfigService; import com.netease.mail.yanxuan.change.biz.service.change.ChangeConfigService;
import com.netease.mail.yanxuan.change.biz.service.change.ChangeExecConfigService; import com.netease.mail.yanxuan.change.biz.service.change.ChangeExecConfigService;
import com.netease.mail.yanxuan.change.common.bean.AdminUserHolder;
import com.netease.mail.yanxuan.change.common.bean.AjaxResult; import com.netease.mail.yanxuan.change.common.bean.AjaxResult;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
...@@ -59,6 +60,8 @@ public class AdminChangeConfigServiceImpl implements AdminChangeConfigService { ...@@ -59,6 +60,8 @@ public class AdminChangeConfigServiceImpl implements AdminChangeConfigService {
private static final String CHANGE_CONFIG = "changeConfig:"; private static final String CHANGE_CONFIG = "changeConfig:";
Logger logger = LoggerFactory.getLogger(AdminChangeConfigServiceImpl.class);
@Override @Override
public AjaxResult queryChanges(Integer pageNum, Integer pageSize, ChangeConfigQueryReq req) { public AjaxResult queryChanges(Integer pageNum, Integer pageSize, ChangeConfigQueryReq req) {
ChangeConfigArrayVO vo = new ChangeConfigArrayVO(); ChangeConfigArrayVO vo = new ChangeConfigArrayVO();
...@@ -66,24 +69,25 @@ public class AdminChangeConfigServiceImpl implements AdminChangeConfigService { ...@@ -66,24 +69,25 @@ public class AdminChangeConfigServiceImpl implements AdminChangeConfigService {
PageHelper.startPage(pageNum,pageSize); PageHelper.startPage(pageNum,pageSize);
List<ChangeConfigPo> changeConfigPos = mapper.selectChangeConfigPo(req); List<ChangeConfigPo> changeConfigPos = mapper.selectChangeConfigPo(req);
PageInfo<ChangeConfigPo> pageInfo = new PageInfo<>(changeConfigPos); PageInfo<ChangeConfigPo> pageInfo = new PageInfo<>(changeConfigPos);
PageVO pageVO = buildPageVo(changeConfigPos.size(), pageSize, pageNum); Long total = pageInfo.getTotal();
PageVO pageVO = buildPageVo(total.intValue(), pageSize, pageNum);
vo.setChangeConfigs(pageInfo.getList()); vo.setChangeConfigs(pageInfo.getList());
vo.setPageVo(pageVO); vo.setPageVo(pageVO);
return AjaxResult.success(vo); return AjaxResult.success(vo);
} }
@Override @Override
public AjaxResult queryDetail(Long id) { public AjaxResult queryDetail(Long id,Long sonChangeClassId) {
if (id == null){ String changeConfigVO;
return AjaxResult.of(ResponseCodeEnum.PARAM_ERROR);
}
//尝试从reids里面 获取 如果获取到了直接返回 //尝试从reids里面 获取 如果获取到了直接返回
String changeConfigVO = getValue().get(id.toString()); if (id != null) {
if (changeConfigVO != null){ changeConfigVO = getValue().get(id.toString());
return AjaxResult.success(JSONObject.parseObject(changeConfigVO, ChangeConfigVO.class)); if (changeConfigVO != null) {
return AjaxResult.success(JSONObject.parseObject(changeConfigVO, ChangeConfigVO.class));
}
} }
//从数据库中取出数据 //从数据库中取出数据
ChangeConfig changeConfig = changeConfigService.queryChangeConfig(id); ChangeConfig changeConfig = changeConfigService.queryChangeConfig(id,sonChangeClassId);
if (changeConfig == null){ if (changeConfig == null){
return AjaxResult.of(ResponseCodeEnum.NO_FOUND); return AjaxResult.of(ResponseCodeEnum.NO_FOUND);
} }
...@@ -91,7 +95,7 @@ public class AdminChangeConfigServiceImpl implements AdminChangeConfigService { ...@@ -91,7 +95,7 @@ public class AdminChangeConfigServiceImpl implements AdminChangeConfigService {
if (changeTypes == null || changeTypes.size() != 2){ if (changeTypes == null || changeTypes.size() != 2){
return AjaxResult.of(ResponseCodeEnum.NO_FOUND); return AjaxResult.of(ResponseCodeEnum.NO_FOUND);
} }
List<ChangeExecConfig> changeExecConfigs = execConfigService.queryChangeExecConfig(id); List<ChangeExecConfig> changeExecConfigs = execConfigService.queryChangeExecConfig(changeConfig.getId());
if (changeExecConfigs == null || changeExecConfigs.size() == 0){ if (changeExecConfigs == null || changeExecConfigs.size() == 0){
return AjaxResult.of(ResponseCodeEnum.NO_FOUND); return AjaxResult.of(ResponseCodeEnum.NO_FOUND);
} }
...@@ -101,7 +105,7 @@ public class AdminChangeConfigServiceImpl implements AdminChangeConfigService { ...@@ -101,7 +105,7 @@ public class AdminChangeConfigServiceImpl implements AdminChangeConfigService {
getValue().set(CHANGE_CONFIG+id,changeConfigVO,1, TimeUnit.DAYS); getValue().set(CHANGE_CONFIG+id,changeConfigVO,1, TimeUnit.DAYS);
return AjaxResult.success(JSONObject.parseObject(changeConfigVO, ChangeConfigVO.class)); return AjaxResult.success(JSONObject.parseObject(changeConfigVO, ChangeConfigVO.class));
} }
Logger logger = LoggerFactory.getLogger(AdminChangeConfigServiceImpl.class);
@Override @Override
@Transactional @Transactional
public AjaxResult createChange(ChangeConfigReq changeConfigReq) { public AjaxResult createChange(ChangeConfigReq changeConfigReq) {
...@@ -110,7 +114,7 @@ public class AdminChangeConfigServiceImpl implements AdminChangeConfigService { ...@@ -110,7 +114,7 @@ public class AdminChangeConfigServiceImpl implements AdminChangeConfigService {
List<ChangeType> changeTypes = typeService.addChangeType(changeConfigReq.getChangeTypes()); List<ChangeType> changeTypes = typeService.addChangeType(changeConfigReq.getChangeTypes());
ChangeConfig changeConfig = parameterSplicing(changeTypes,changeConfigReq); ChangeConfig changeConfig = parameterSplicing(changeTypes,changeConfigReq);
changeConfig = changeConfigService.addChangeConfig(changeConfig); changeConfig = changeConfigService.addChangeConfig(changeConfig);
List<ChangeExecConfig> changeExecConfigs = execConfigService.addChangeExecConfig(changeConfig.getId(), changeConfigReq.getChangeExecConfigs()); List<ChangeExecConfig> changeExecConfigs = execConfigService.addChangeExecConfig(changeConfig.getId(), changeConfigReq.getChangeExeConfig());
//参数拼装 //参数拼装
String changeConfigVO = getChangeConfigVO(changeConfig, changeTypes, changeExecConfigs); String changeConfigVO = getChangeConfigVO(changeConfig, changeTypes, changeExecConfigs);
//新增后添加到redis //新增后添加到redis
...@@ -129,7 +133,7 @@ public class AdminChangeConfigServiceImpl implements AdminChangeConfigService { ...@@ -129,7 +133,7 @@ public class AdminChangeConfigServiceImpl implements AdminChangeConfigService {
ChangeConfig changeConfig = parameterSplicing(changeTypes,changeConfigReq); ChangeConfig changeConfig = parameterSplicing(changeTypes,changeConfigReq);
changeConfigService.updateChangeConfig(changeConfig); changeConfigService.updateChangeConfig(changeConfig);
//修改 //修改
List<ChangeExecConfig> changeExecConfigs = execConfigService.updateChangeExecConfig(changeConfigReq.getId(), changeConfigReq.getChangeExecConfigs()); List<ChangeExecConfig> changeExecConfigs = execConfigService.updateChangeExecConfig(changeConfigReq.getId(), changeConfigReq.getChangeExeConfig());
//装在reids //装在reids
String changeConfigVO = getChangeConfigVO(changeConfig, changeTypes, changeExecConfigs); String changeConfigVO = getChangeConfigVO(changeConfig, changeTypes, changeExecConfigs);
getValue().set(CHANGE_CONFIG+changeConfig.getId(),changeConfigVO,1, TimeUnit.DAYS); getValue().set(CHANGE_CONFIG+changeConfig.getId(),changeConfigVO,1, TimeUnit.DAYS);
...@@ -163,6 +167,9 @@ public class AdminChangeConfigServiceImpl implements AdminChangeConfigService { ...@@ -163,6 +167,9 @@ public class AdminChangeConfigServiceImpl implements AdminChangeConfigService {
return AjaxResult.success(typeService.queryConfigType()); return AjaxResult.success(typeService.queryConfigType());
} }
@Autowired
AdminUserHolder userHolder;
/** /**
* 添加变更模板并参数拼接 * 添加变更模板并参数拼接
* @param changeTypes * @param changeTypes
...@@ -195,6 +202,9 @@ public class AdminChangeConfigServiceImpl implements AdminChangeConfigService { ...@@ -195,6 +202,9 @@ public class AdminChangeConfigServiceImpl implements AdminChangeConfigService {
changeConfig.setChangeDepartment(changeConfigReq.getChangeDepartment()); changeConfig.setChangeDepartment(changeConfigReq.getChangeDepartment());
if (changeConfigReq.getChangeCommanderType() == null){ if (changeConfigReq.getChangeCommanderType() == null){
throw ExceptionFactory.createBiz(ResponseCode.PARAMETER_DEFICIENCY); throw ExceptionFactory.createBiz(ResponseCode.PARAMETER_DEFICIENCY);
//如果是执行人就从head里面把邮箱装载
}else if (changeConfigReq.getChangeCommanderType() == 1){
changeConfigReq.setChangeCommander(AdminUserHolder.getUserName());
} }
changeConfig.setChangeCommanderType(changeConfigReq.getChangeCommanderType()); changeConfig.setChangeCommanderType(changeConfigReq.getChangeCommanderType());
if (changeConfigReq.getChangeCommander() == null){ if (changeConfigReq.getChangeCommander() == null){
...@@ -207,11 +217,11 @@ public class AdminChangeConfigServiceImpl implements AdminChangeConfigService { ...@@ -207,11 +217,11 @@ public class AdminChangeConfigServiceImpl implements AdminChangeConfigService {
changeConfig.setNeedFile(changeConfigReq.getNeedFile()); changeConfig.setNeedFile(changeConfigReq.getNeedFile());
changeConfig.setCreateTime(System.currentTimeMillis()); changeConfig.setCreateTime(System.currentTimeMillis());
changeConfig.setUpdateTime(System.currentTimeMillis()); changeConfig.setUpdateTime(System.currentTimeMillis());
if (changeConfigReq.getChangeExecConfigs() == null || changeConfigReq.getChangeExecConfigs().size() >=21){ if (changeConfigReq.getChangeExeConfig() == null || changeConfigReq.getChangeExeConfig().size() >=21){
throw ExceptionFactory.createBiz(ResponseCode.EXEC_CONFIG_LENGTH); throw ExceptionFactory.createBiz(ResponseCode.EXEC_CONFIG_LENGTH);
} }
List<String> list = new ArrayList<>(); List<String> list = new ArrayList<>();
for (ChangeExecConfig execConfig : changeConfigReq.getChangeExecConfigs()){ for (ChangeExecConfig execConfig : changeConfigReq.getChangeExeConfig()){
list.add(execConfig.getChangeExecDepartment()); list.add(execConfig.getChangeExecDepartment());
} }
changeConfig.setParticipateChangeExecDepartment(list.toString()); changeConfig.setParticipateChangeExecDepartment(list.toString());
......
...@@ -21,6 +21,11 @@ public class ChangeConfigServiceImpl implements ChangeConfigService { ...@@ -21,6 +21,11 @@ public class ChangeConfigServiceImpl implements ChangeConfigService {
} }
@Override @Override
public ChangeConfig queryChangeConfig(Long id, Long sonChangeClassId) {
return mapper.queryInfo(id, sonChangeClassId);
}
@Override
public ChangeConfig queryChangeType(Long parentChangeClassId, Long sonChangeClassId) { public ChangeConfig queryChangeType(Long parentChangeClassId, Long sonChangeClassId) {
if (parentChangeClassId == null || sonChangeClassId == null){ if (parentChangeClassId == null || sonChangeClassId == null){
return null; return null;
......
...@@ -29,9 +29,9 @@ public class AdminUserHolder { ...@@ -29,9 +29,9 @@ public class AdminUserHolder {
* *
* @return 用户名,null-未登录 * @return 用户名,null-未登录
*/ */
/*public static String getUserName() { public static String getUserName() {
return userThreadLocal.get(); return userThreadLocal.get();
}*/ }
public static void setUserName(String userName) { public static void setUserName(String userName) {
userThreadLocal.set(userName); userThreadLocal.set(userName);
......
...@@ -26,6 +26,8 @@ public interface ChangeConfigMapper extends tk.mybatis.mapper.common.Mapper<Chan ...@@ -26,6 +26,8 @@ public interface ChangeConfigMapper extends tk.mybatis.mapper.common.Mapper<Chan
@Select("select * from TB_YX_QC_CHANGE_CONFIG where id = #{id}") @Select("select * from TB_YX_QC_CHANGE_CONFIG where id = #{id}")
ChangeConfig queryById(@Param("id") Long id); ChangeConfig queryById(@Param("id") Long id);
ChangeConfig queryInfo(@Param("id") Long id,@Param("sonChangeClassId") Long sonChangeClassId);
@Delete("delete from TB_YX_QC_CHANGE_CONFIG where id = #{id}") @Delete("delete from TB_YX_QC_CHANGE_CONFIG where id = #{id}")
void deleteById(@Param("id") Long id); void deleteById(@Param("id") Long id);
......
...@@ -55,6 +55,6 @@ public class ChangeConfigReq { ...@@ -55,6 +55,6 @@ public class ChangeConfigReq {
/** /**
* 变更执行方案 * 变更执行方案
*/ */
private List<ChangeExecConfig> changeExecConfigs; private List<ChangeExecConfig> changeExeConfig;
} }
...@@ -10,10 +10,35 @@ import lombok.Data; ...@@ -10,10 +10,35 @@ import lombok.Data;
@Data @Data
public class GoodsResponseRpc { public class GoodsResponseRpc {
/**
* 商品负责人名称
*/
private String name; private String name;
/**
* 商品负责人邮箱
*/
private String email; private String email;
/**
* 固定人 || 发起人返回结果
*/
private String changeCommander;
/**
* 计数器
*/
private Integer occurrenceNumber; private Integer occurrenceNumber;
/**
* 供应商返回结果
*/
private String supplierId;
/**
* 供应商名称
*/
private String supplierName;
} }
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
create_time <![CDATA[ > ]]> #{createTime} and create_time <![CDATA[ > ]]> #{createTime} and
</if> </if>
<if test="updateTime != null"> <if test="updateTime != null">
update_time <![CDATA[ < ]]> #{updateTime} and create_time <![CDATA[ < ]]> #{updateTime} and
</if> </if>
<if test="changeExecDepartment != null and changeExecDepartment != ''"> <if test="changeExecDepartment != null and changeExecDepartment != ''">
participate_change_exec_department like "%" #{changeExecDepartment} "%" and participate_change_exec_department like "%" #{changeExecDepartment} "%" and
...@@ -63,6 +63,19 @@ ...@@ -63,6 +63,19 @@
<select id="queryByparentChangeClassId" resultType="com.netease.mail.yanxuan.change.dal.entity.ChangeType"> <select id="queryByparentChangeClassId" resultType="com.netease.mail.yanxuan.change.dal.entity.ChangeType">
select * from TB_YX_QC_CHANGE_TYPE where id = #{parentId} or id = #{sonId} and delete_type = 0 select * from TB_YX_QC_CHANGE_TYPE where id = #{parentId} or id = #{sonId} and delete_type = 0
</select> </select>
<select id="queryInfo" resultType="com.netease.mail.yanxuan.change.dal.entity.ChangeConfig">
select * from TB_YX_QC_CHANGE_CONFIG
<where>
1=1
<if test="id != null">
and id = #{id}
</if>
<if test="sonChangeClassId != null ">
and son_change_class_id = #{sonChangeClassId}
</if>
</where>
</select>
<!--此查询暂时不需要。。。--> <!--此查询暂时不需要。。。-->
<!-- <select id="queryChangeDepartment" resultType="com.netease.mail.yanxuan.change.dal.meta.model.po.ChangeExecConfigPo" parameterType="java.lang.Long">--> <!-- <select id="queryChangeDepartment" resultType="com.netease.mail.yanxuan.change.dal.meta.model.po.ChangeExecConfigPo" parameterType="java.lang.Long">-->
<!-- select--> <!-- select-->
......
...@@ -3,20 +3,13 @@ package com.netease.mail.yanxuan.change.integration.email.service.impl; ...@@ -3,20 +3,13 @@ package com.netease.mail.yanxuan.change.integration.email.service.impl;
import com.netease.mail.yanxuan.change.integration.email.email.EmailFactor; import com.netease.mail.yanxuan.change.integration.email.email.EmailFactor;
import com.netease.mail.yanxuan.change.integration.email.enums.EmailTemplateEnum; import com.netease.mail.yanxuan.change.integration.email.enums.EmailTemplateEnum;
import com.netease.mail.yanxuan.change.integration.email.service.IEmailService; import com.netease.mail.yanxuan.change.integration.email.service.IEmailService;
import com.netease.mail.yanxuan.change.integration.email.enums.EmailParamEnum;
import com.netease.mail.yanxuan.change.integration.email.service.UasClientService; import com.netease.mail.yanxuan.change.integration.email.service.UasClientService;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async; import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import java.io.File;
import java.util.Arrays;
import java.util.Collection; import java.util.Collection;
import java.util.List; import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@Service @Service
...@@ -28,8 +21,6 @@ public class EmailServiceImpl implements IEmailService { ...@@ -28,8 +21,6 @@ public class EmailServiceImpl implements IEmailService {
@Autowired @Autowired
private EmailTemplateServiceImpl emailTemplateService; private EmailTemplateServiceImpl emailTemplateService;
Logger logger = LoggerFactory.getLogger(EmailServiceImpl.class);
@Override @Override
@Async("asyncEmail") @Async("asyncEmail")
public void sendEmail(Collection<String> toList, Collection<String> ccList, public void sendEmail(Collection<String> toList, Collection<String> ccList,
......
package com.netease.mail.yanxuan.change.integration.flow.ius; package com.netease.mail.yanxuan.change.integration.flow.ius;
import com.netease.mail.yanxuan.change.integration.flow.ius.req.IusDepartmentReq;
import com.netease.mail.yanxuan.change.integration.flow.ius.rsp.IusUserInfoRsp;
import com.netease.mail.yanxuan.change.integration.flow.ius.rsp.OrgPosLeaderChainRsp;
import com.netease.mail.yanxuan.change.integration.flow.ius.rsp.SecondaryDepartments;
import com.netease.yanxuan.flowx.sdk.meta.controller.communal.AjaxResponse; import com.netease.yanxuan.flowx.sdk.meta.controller.communal.AjaxResponse;
import com.netease.yanxuan.missa.client.annotation.MissaClient; import com.netease.yanxuan.missa.client.annotation.MissaClient;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
......
package com.netease.mail.yanxuan.change.integration.flow.ius; package com.netease.mail.yanxuan.change.integration.flow.ius.rsp;
import lombok.Data; import lombok.Data;
......
package com.netease.mail.yanxuan.change.integration.flow.ius; package com.netease.mail.yanxuan.change.integration.flow.ius.rsp;
import lombok.Data; import lombok.Data;
import java.util.List; import java.util.List;
......
package com.netease.mail.yanxuan.change.integration.flow.supplier; package com.netease.mail.yanxuan.change.integration.flow.supplier;
import com.netease.mail.yanxuan.change.integration.flow.supplier.req.SupplierGoodsInfoReq;
import com.netease.mail.yanxuan.change.integration.flow.supplier.req.SupplierRelatedUserReq;
import com.netease.mail.yanxuan.change.integration.flow.supplier.req.SupplierSearchRemoteReq;
import com.netease.mail.yanxuan.change.integration.flow.supplier.req.SupplierSendEmailReq;
import com.netease.mail.yanxuan.change.integration.flow.supplier.rsp.SupplierGoodsInfoRsp;
import com.netease.mail.yanxuan.change.integration.flow.supplier.rsp.SupplierSimpleRsp;
import com.netease.mail.yanxuan.change.integration.flow.supplier.rsp.SupplierUserRsp;
import com.netease.yanxuan.flowx.sdk.meta.controller.communal.AjaxResponse;
import com.netease.yanxuan.missa.client.annotation.MissaClient; import com.netease.yanxuan.missa.client.annotation.MissaClient;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
...@@ -30,5 +38,29 @@ public interface FlowRpcSupplierSendService { ...@@ -30,5 +38,29 @@ public interface FlowRpcSupplierSendService {
@PostMapping("/api/initiateProject/source/getBatchRelatedSupplier.json") @PostMapping("/api/initiateProject/source/getBatchRelatedSupplier.json")
String queryGoodsPurchase(@RequestBody List<Long> itemIds); String queryGoodsPurchase(@RequestBody List<Long> itemIds);
/**
* 查询供应商关联角色
*/
@PostMapping("/api/supplier/batchGetSupplierRelatedUser.json")
AjaxResponse<List<SupplierUserRsp>> querySupplierRelatedUser(@RequestBody SupplierRelatedUserReq req);
/**
* 供应商模糊查询
*/
@PostMapping("/api/supplier/queryByConditionForQc.json")
AjaxResponse<List<SupplierSimpleRsp>> queryByConditionForQc(@RequestBody SupplierSearchRemoteReq req);
/**
* 查询供应商+商品对应的跟进采购 ?有存疑参数不对
*/
@PostMapping("/api/initiateProject/source/batchGetRelatedSupplier.json")
String batchGetRelatedSupplier(@RequestBody List<Integer> req);
/**
* 跟进供应商ID 互殴去供应商的商品
* @return
*/
@PostMapping("/api/initiateProject/quote/listSupplierQuoteInfoBySupplierIds.json")
AjaxResponse<List<SupplierGoodsInfoRsp>> SupplierGoodsInfoBySupplier(@RequestBody SupplierGoodsInfoReq req);
} }
package com.netease.mail.yanxuan.change.integration.flow.supplier.req;
import lombok.Data;
/**
* @author WangJiaXiang
* @date 2022/12/2/002$
*/
@Data
public class SupplierGoodsInfoReq {
//是用英文逗号分隔的供应商ID列表
private String supplierIds;
}
package com.netease.mail.yanxuan.change.integration.flow.supplier.req;
import lombok.Data;
import java.util.List;
/**
* @author WangJiaXiang
* @date 2022/11/30/030$
*/
@Data
public class SupplierRelatedUserReq {
/**
* 搜索类型(1-采购 2-计划 3-SQE 4-商品开发)
*/
private Integer searchType;
/**
* 供应商ID列表
*/
private List<String> supplierIdList;
}
package com.netease.mail.yanxuan.change.integration.flow.supplier.req;
import lombok.Data;
import java.util.List;
/**
* @author WangJiaXiang
* @date 2022/12/1/001$
*/
@Data
public class SupplierSearchRemoteReq {
private List<Integer> coopStateList;
private List<String> limitSupplierIdList;
private List<String> orInPhyCategoryIds;
/**
* 模糊查询文本
*/
private String searchText;
}
package com.netease.mail.yanxuan.change.integration.flow.supplier.rsp;
import lombok.Data;
/**
* @author WangJiaXiang
* @date 2022/12/2/002$
*/
@Data
public class SupplierGoodsInfoRsp {
//注释不一定准确
//营业编号
private Integer businessForm;
//合同编号
private String contractNum;
//创建时间
private Integer createTime;
//创建用户
private String createUser;
//默认标记
private Integer defaultFlag;
//商品是否有效 0: 有效;1: 失效
private Integer invalid;
//有效类型
private Integer invoiceType;
//商品主键ID
private Integer itemId;
//报价货币
private String quoteCurrency;
//报价模式
private Integer quoteMode;
//结算模式
private Integer settleMode;
//供应商ID
private String supplierId;
private Integer taxRate;
//修改时间
private Integer updateTime;
//修改名称
private String updateUser;
}
package com.netease.mail.yanxuan.change.integration.flow.supplier.rsp;
import lombok.Data;
/**
* @author WangJiaXiang
* @date 2022/12/1/001$
*/
@Data
public class SupplierSimpleRsp {
/**
* 供应商ID
*/
private String supplierId;
/**
* 供应商名称
*/
private String supplierName;
}
package com.netease.mail.yanxuan.change.integration.flow.supplier.rsp;
import lombok.Data;
import java.util.Map;
/**
* @author WangJiaXiang
* @date 2022/12/1/001$
*/
@Data
public class SupplierUserRsp {
/**
* 供应商ID
*/
private Integer supplierId;
/**
* 角色ID(1-采购 2-计划 3-SQE 4-商品开发) 以及名称
*/
private Map<String,String> uid2NameMap;
}
...@@ -20,6 +20,9 @@ public class AdminUserLoginInterceptor implements HandlerInterceptor { ...@@ -20,6 +20,9 @@ public class AdminUserLoginInterceptor implements HandlerInterceptor {
HttpServletResponse response, Object handler) throws Exception { HttpServletResponse response, Object handler) throws Exception {
String uid = request.getHeader("uid"); String uid = request.getHeader("uid");
log.info("adminUserLoginInterceptor uid ={}", uid); log.info("adminUserLoginInterceptor uid ={}", uid);
if(uid == null){
uid = "grp.gyhtest1001@corp.netease.com";
}
AdminUserHolder.setUserName(uid); AdminUserHolder.setUserName(uid);
return true; return true;
} }
......
...@@ -18,7 +18,7 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter ...@@ -18,7 +18,7 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter
public class WebMvcConfig implements WebMvcConfigurer{ public class WebMvcConfig implements WebMvcConfigurer{
@Autowired @Autowired
private UserInterceptor userInterceptor; private AdminUserLoginInterceptor userLoginInterceptor;
@Autowired @Autowired
private LoginInterceptor loginInterceptor; private LoginInterceptor loginInterceptor;
...@@ -30,7 +30,7 @@ public class WebMvcConfig implements WebMvcConfigurer{ ...@@ -30,7 +30,7 @@ public class WebMvcConfig implements WebMvcConfigurer{
*/ */
@Override @Override
public void addInterceptors(InterceptorRegistry registry) { public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(userInterceptor).addPathPatterns("/**").excludePathPatterns("/i/health").excludePathPatterns("/change/flow/getOperator"); registry.addInterceptor(userLoginInterceptor).addPathPatterns("/**").excludePathPatterns("/i/health").excludePathPatterns("/change/flow/getOperator","/test/**");
// registry.addInterceptor(loginInterceptor).addPathPatterns("/**").excludePathPatterns("/change/flow/getOperator"); // registry.addInterceptor(loginInterceptor).addPathPatterns("/**").excludePathPatterns("/change/flow/getOperator");
} }
......
...@@ -9,6 +9,8 @@ import com.netease.mail.yanxuan.change.integration.email.email.EmailFactor; ...@@ -9,6 +9,8 @@ import com.netease.mail.yanxuan.change.integration.email.email.EmailFactor;
import com.netease.mail.yanxuan.change.integration.email.enums.EmailTemplateEnum; import com.netease.mail.yanxuan.change.integration.email.enums.EmailTemplateEnum;
import com.netease.mail.yanxuan.change.integration.email.enums.EmailTypeEnum; import com.netease.mail.yanxuan.change.integration.email.enums.EmailTypeEnum;
import com.netease.mail.yanxuan.change.integration.email.service.IEmailService; import com.netease.mail.yanxuan.change.integration.email.service.IEmailService;
import com.netease.mail.yanxuan.change.integration.flow.supplier.FlowRpcSupplierSendService;
import com.netease.mail.yanxuan.change.integration.flow.supplier.req.SupplierRelatedUserReq;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -42,7 +44,7 @@ public class ChangeConfigController { ...@@ -42,7 +44,7 @@ public class ChangeConfigController {
@RequestParam(name = "parentChangeClassId",required = false)Integer parentChangeClassId, @RequestParam(name = "parentChangeClassId",required = false)Integer parentChangeClassId,
@RequestParam(name = "sonChangeClassId",required = false)Integer sonChangeClassId, @RequestParam(name = "sonChangeClassId",required = false)Integer sonChangeClassId,
@RequestParam(name = "changeLevel",required = false)Integer changeLevel, @RequestParam(name = "changeLevel",required = false)Integer changeLevel,
@RequestParam(name = "startTime",required = false)Long startTime, @RequestParam(name = "createTime",required = false)Long createTime,
@RequestParam(name = "endTime",required = false)Long endTime){ @RequestParam(name = "endTime",required = false)Long endTime){
ChangeConfigQueryReq req = new ChangeConfigQueryReq(); ChangeConfigQueryReq req = new ChangeConfigQueryReq();
req.setChangeDepartment(changeDepartment); req.setChangeDepartment(changeDepartment);
...@@ -50,7 +52,7 @@ public class ChangeConfigController { ...@@ -50,7 +52,7 @@ public class ChangeConfigController {
req.setParentChangeClassId(parentChangeClassId); req.setParentChangeClassId(parentChangeClassId);
req.setSonChangeClassId(sonChangeClassId); req.setSonChangeClassId(sonChangeClassId);
req.setChangeLevel(changeLevel); req.setChangeLevel(changeLevel);
req.setCreateTime(startTime); req.setCreateTime(createTime);
req.setUpdateTime(endTime); req.setUpdateTime(endTime);
return service.queryChanges(page,pageSize,req); return service.queryChanges(page,pageSize,req);
} }
...@@ -62,8 +64,9 @@ public class ChangeConfigController { ...@@ -62,8 +64,9 @@ public class ChangeConfigController {
*/ */
@GetMapping("/detail") @GetMapping("/detail")
public AjaxResult queryDetail( public AjaxResult queryDetail(
@RequestParam(name = "id") Long id){ @RequestParam(name = "id",required = false) Long id,
return service.queryDetail(id); @RequestParam(name = "sonChangeClassId",required = false) Long sonChangeClassId){
return service.queryDetail(id,sonChangeClassId);
} }
/** /**
...@@ -116,12 +119,16 @@ public class ChangeConfigController { ...@@ -116,12 +119,16 @@ public class ChangeConfigController {
@GetMapping("/test") @GetMapping("/test")
public void queryCommanderInfo(){ public void queryCommanderInfo(){
EmailFactor emailFactor = new EmailFactor(); EmailFactor emailFactor = new EmailFactor();
//固定
emailFactor.setType(EmailTypeEnum.TEXT.getType()); emailFactor.setType(EmailTypeEnum.TEXT.getType());
//邮件模板枚举
emailFactor.setEmailTemplateEnum(EmailTemplateEnum.YX_QC_CHANGE_SUBMIT_FORWARD); emailFactor.setEmailTemplateEnum(EmailTemplateEnum.YX_QC_CHANGE_SUBMIT_FORWARD);
List<String> list = new ArrayList<>(); List<String> list = new ArrayList<>();
list.add("99888"); list.add("99888");//标题参数传入
//发送人
ArrayList<String> strings = new ArrayList<>(); ArrayList<String> strings = new ArrayList<>();
strings.add("wb.tanglongwei@mesg.corp.netease.com"); strings.add("wb.tanglongwei@mesg.corp.netease.com");
//参数
HashMap<String,Object> map = new HashMap<>(); HashMap<String,Object> map = new HashMap<>();
map.put("changeId","变更Id"); map.put("changeId","变更Id");
map.put("changeSubject","变更主体"); map.put("changeSubject","变更主体");
...@@ -132,7 +139,6 @@ public class ChangeConfigController { ...@@ -132,7 +139,6 @@ public class ChangeConfigController {
map.put("restsChangeCommanderEmail","转交后责任人邮箱"); map.put("restsChangeCommanderEmail","转交后责任人邮箱");
emailFactor.setData(map); emailFactor.setData(map);
iEmailService.sendEmail(strings,null,emailFactor,list); iEmailService.sendEmail(strings,null,emailFactor,list);
} }
} }
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