Commit 3552b0d6 by “zcwang”

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

# Conflicts:
#	yanxuan-qc-change-system-web/src/main/java/com/netease/mail/yanxuan/change/web/controller/TestController.java
parents 1e1f2f01 b146e528
......@@ -128,7 +128,14 @@ public class AdminChangeConfigServiceImpl implements AdminChangeConfigService {
if (changeConfigReq.getId() == null){
return AjaxResult.of(9001,"修改变更模板主键id不能为空");
}
//新增类似 //内嵌行动方案
//先查询注入ID后在修改
ChangeConfig config = changeConfigService.queryChangeConfig(changeConfigReq.getId());
if (config == null){
return AjaxResult.of(9001,"未找到变更类型配置");
}
changeConfigReq.getChangeTypes().get(0).setId(config.getParentChangeClassId());
changeConfigReq.getChangeTypes().get(1).setId(config.getSonChangeClassId());
//新增类似
List<ChangeType> changeTypes = typeService.updateChangeType(changeConfigReq.getChangeTypes());
ChangeConfig changeConfig = parameterSplicing(changeTypes,changeConfigReq);
changeConfigService.updateChangeConfig(changeConfig);
......
......@@ -103,13 +103,14 @@ public class ChangeTypeServiceImpl implements ChangeTypeService {
List<ChangeType> sonChanges = mapper.queryParent(changeParentType.getId());
for (ChangeType sonChange : sonChanges){
if (sonChange.getTypeName().equals(changeTypes.get(1).getTypeName())){
//处理有问题
deleteChangeType(changeTypes.get(1));
changeTypes.set(1,sonChange);
return changeTypes;
changeTypes.get(1).setDeleteType(0);
}
}
//发现没有直接新增并返回
changeTypes.get(1).setId(null);
changeTypes.set(0,changeParentType);
changeTypes.get(1).setParentId(changeParentType.getId());
changeTypes.get(1).setCreateTime(System.currentTimeMillis());
changeTypes.get(1).setUpdateTime(System.currentTimeMillis());
......
......@@ -24,7 +24,7 @@ public interface ChangeTypeMapper extends tk.mybatis.mapper.common.Mapper<Change
ChangeType queryTypeName(@Param("typeName") String typeName);
@Select("select * from TB_YX_QC_CHANGE_TYPE where id in(#{id},#{sonChangeClassId}) and delete_type = #{deleteType} ")
@Select("select * from TB_YX_QC_CHANGE_TYPE where id in(#{id},#{sonChangeClassId}) and delete_type = #{deleteType} order by parent_id ")
List<ChangeType> queryTypes(
@Param("id") Long id,
@Param("sonChangeClassId")Long sonChangeClassId,
......
......@@ -70,11 +70,6 @@ public class ChangeConfigPo {
private String participateChangeExecDepartment;
/**
* 变更执行部门 是否还有必要存在???
*/
ChangeExecConfigPo changeExecConfigPo;
/**
* 关联的一级二级类目
*/
List<ChangeType> changeTypes;
......
package com.netease.mail.yanxuan.change.integration.flow.supplier.rsp;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author WangJiaXiang
* @date 2022/12/1/001$
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class SupplierSimpleRsp {
/**
......
......@@ -5,18 +5,13 @@ import com.netease.mail.yanxuan.change.common.bean.AjaxResult;
import com.netease.mail.yanxuan.change.biz.service.change.AdminChangeConfigService;
import com.netease.mail.yanxuan.change.dal.meta.model.req.ChangeConfigQueryReq;
import com.netease.mail.yanxuan.change.dal.meta.model.req.ChangeConfigReq;
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.EmailTypeEnum;
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.LoggerFactory;
import com.netease.mail.yanxuan.change.integration.flow.supplier.req.SupplierSearchRemoteReq;
import com.netease.mail.yanxuan.change.integration.flow.supplier.rsp.SupplierSimpleRsp;
import com.netease.yanxuan.flowx.sdk.meta.controller.communal.AjaxResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
......@@ -24,13 +19,16 @@ import java.util.List;
* @author WangJiaXiang
* @date 2022/11/11/011$
*/
@RequestMapping("/config/change")
@RestController
@RequestMapping("/config/change")
public class ChangeConfigController {
@Autowired
private AdminChangeConfigService service;
@Autowired
private FlowRpcSupplierSendService supplierSendService;
/**
* 通过参数查询配置模板
* @return
......@@ -111,34 +109,25 @@ public class ChangeConfigController {
return service.queryConfigType();
}
private static Logger logger = LoggerFactory.getLogger(ChangeConfigController.class);
@Autowired
private IEmailService iEmailService;
@GetMapping("/test")
public void queryCommanderInfo(){
EmailFactor emailFactor = new EmailFactor();
//固定
emailFactor.setType(EmailTypeEnum.TEXT.getType());
//邮件模板枚举
emailFactor.setEmailTemplateEnum(EmailTemplateEnum.YX_QC_CHANGE_SUBMIT_FORWARD);
List<String> list = new ArrayList<>();
list.add("99888");//标题参数传入
//发送人
ArrayList<String> strings = new ArrayList<>();
strings.add("wb.tanglongwei@mesg.corp.netease.com");
//参数
HashMap<String,Object> map = new HashMap<>();
map.put("changeId","变更Id");
map.put("changeSubject","变更主体");
map.put("changeContent","变更内容");
map.put("changeCommander","负责人名称");
map.put("changeCommanderEmail","负责人邮箱");
map.put("restsChangeCommander","转交后责任人名称");
map.put("restsChangeCommanderEmail","转交后责任人邮箱");
emailFactor.setData(map);
iEmailService.sendEmail(strings,null,emailFactor,list);
/**
* 跟进供应商名称模糊查询
*/
@GetMapping("/query/supplier/infos")
public AjaxResponse<List<SupplierSimpleRsp>> queryByConditionForQc(@RequestParam(name = "searchText") String searchText){
SupplierSearchRemoteReq req = new SupplierSearchRemoteReq();
req.setSearchText(searchText);
//暂时使用模拟数据
//AjaxResponse<List<SupplierSimpleRsp>> listAjaxResponse = service.queryByConditionForQc(req);
AjaxResponse<List<SupplierSimpleRsp>> listAjaxResponse = new AjaxResponse<List<SupplierSimpleRsp>>();
List<SupplierSimpleRsp> suppliers = new ArrayList<>();
SupplierSimpleRsp supplierSimpleRsp1 = new SupplierSimpleRsp("YX0778","gyhtest1009");
SupplierSimpleRsp supplierSimpleRsp2 = new SupplierSimpleRsp("YX0528","gyhtest1010");
suppliers.add(supplierSimpleRsp1);
suppliers.add(supplierSimpleRsp2);
listAjaxResponse.setData(suppliers);
listAjaxResponse.setCode(200);
//return supplierSendService.queryByConditionForQc(req); 暂用模拟数据
return listAjaxResponse;
}
}
......@@ -6,9 +6,11 @@
*/
package com.netease.mail.yanxuan.change.web.controller;
import java.util.ArrayList;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
......@@ -60,4 +62,22 @@ public class TestController {
req.setSearchText(name);
return service.queryByConditionForQc(req);
}
@GetMapping("/query/supplier/infos")
public AjaxResponse<List<SupplierSimpleRsp>> queryByConditionForQc(@RequestParam(name = "searchText") String searchText){
SupplierSearchRemoteReq req = new SupplierSearchRemoteReq();
req.setSearchText(searchText);
//暂时使用模拟数据
//AjaxResponse<List<SupplierSimpleRsp>> listAjaxResponse = service.queryByConditionForQc(req);
AjaxResponse<List<SupplierSimpleRsp>> listAjaxResponse = new AjaxResponse<List<SupplierSimpleRsp>>();
List<SupplierSimpleRsp> suppliers = new ArrayList<>();
SupplierSimpleRsp supplierSimpleRsp1 = new SupplierSimpleRsp("YX0778","gyhtest1009");
SupplierSimpleRsp supplierSimpleRsp2 = new SupplierSimpleRsp("YX0528","gyhtest1010");
suppliers.add(supplierSimpleRsp1);
suppliers.add(supplierSimpleRsp2);
listAjaxResponse.setData(suppliers);
listAjaxResponse.setCode(200);
//return supplierSendService.queryByConditionForQc(req); 暂用模拟数据
return listAjaxResponse;
}
}
\ No newline at end of file
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