feat: (REQ-3300) 修复启动报错Bean冲突
This commit is contained in:
parent
5614cdbbb0
commit
b668855ea4
@ -40,6 +40,9 @@ public class BlackUserSyncJob extends IJobHandler{
|
||||
|
||||
@Resource
|
||||
private BlackAndWhiteListService blackAndWhiteListService;
|
||||
|
||||
@Resource
|
||||
private BlackProducer blackProducer;
|
||||
/**
|
||||
* 定时任务执行逻辑
|
||||
* 这具数据比较少,一直性发个几百条我问题不在
|
||||
@ -79,7 +82,7 @@ public class BlackUserSyncJob extends IJobHandler{
|
||||
blackList.forEach(item -> sends.add(item.getParam()));
|
||||
String jsonStr = JSONUtil.toJsonStr(sends);
|
||||
if(Objects.nonNull(blackModuleEnum) && Objects.nonNull(event)){
|
||||
BlackProducer.send(event, jsonStr);
|
||||
blackProducer.send(event, jsonStr);
|
||||
}
|
||||
});
|
||||
return ReturnT.SUCCESS;
|
||||
|
||||
@ -11,13 +11,16 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
public class BlackProducer implements InitializingBean {
|
||||
private static EventProducer<?> eventProducer;
|
||||
public static void send(MQEventEnum mqEventEnum, String data) {
|
||||
public class BlackProducer {
|
||||
|
||||
@Resource
|
||||
private EventProducer<?> eventProducer;
|
||||
public void send(MQEventEnum mqEventEnum, String data) {
|
||||
if(mqEventEnum == null){
|
||||
throw new ServiceException("无法正确发送mq: mqEventEnum不能为空");
|
||||
}
|
||||
@ -33,10 +36,4 @@ public class BlackProducer implements InitializingBean {
|
||||
.data(data)
|
||||
.build());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterPropertiesSet() {
|
||||
eventProducer = SpringUtil.getBean(EventProducer.class);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -133,6 +133,18 @@
|
||||
<version>2.0.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cn.axzo.nanopart</groupId>
|
||||
<artifactId>visa-api</artifactId>
|
||||
<version>2.0.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cn.axzo.nanopart</groupId>
|
||||
<artifactId>visa-server</artifactId>
|
||||
<version>2.0.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cn.axzo.im.center</groupId>
|
||||
<artifactId>im-center-api</artifactId>
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package cn.axzo.nanopart;
|
||||
|
||||
import cn.axzo.basics.report.api.ReportServiceSDK;
|
||||
import cn.axzo.nanopart.config.RocketMQEventConfiguration;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
@ -9,12 +10,15 @@ import org.springframework.context.annotation.EnableAspectJAutoProxy;
|
||||
import org.springframework.context.annotation.Import;
|
||||
|
||||
@MapperScan(value = {"cn.axzo.**.mapper"})
|
||||
@SpringBootApplication
|
||||
@SpringBootApplication(scanBasePackages = "cn.axzo", exclude = {
|
||||
org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration.class
|
||||
,cn.axzo.framework.swagger.yapi.config.SyncSwaggerToYApiAutoConfiguration.class
|
||||
})
|
||||
@EnableFeignClients(basePackages = {
|
||||
"cn.axzo"
|
||||
})
|
||||
@EnableAspectJAutoProxy()
|
||||
@Import(RocketMQEventConfiguration.class)
|
||||
@Import({RocketMQEventConfiguration.class, ReportServiceSDK.class})
|
||||
public class NanopartApplication {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(NanopartApplication.class, args);
|
||||
|
||||
@ -3,7 +3,7 @@ package cn.axzo.nanopart.visa.server.mq.listener.workflow;
|
||||
import cn.axzo.framework.rocketmq.EventProducer;
|
||||
import cn.axzo.maokai.api.vo.request.OrgNodeUserBriefInfoListReq;
|
||||
import cn.axzo.maokai.api.vo.response.OrgNodeUserBriefInfoResp;
|
||||
import cn.axzo.nanopart.visa.server.rpc.OrganizationalNodeUserGateway;
|
||||
import cn.axzo.nanopart.visa.server.rpc.VisaOrganizationalNodeUserGateway;
|
||||
import cn.axzo.workflow.common.model.request.bpmn.task.BpmnTaskDelegateAssigner;
|
||||
import com.google.common.collect.Lists;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
@ -17,11 +17,11 @@ import java.util.Objects;
|
||||
*/
|
||||
public abstract class BasicLogSupport {
|
||||
private final EventProducer eventProducer;
|
||||
protected final OrganizationalNodeUserGateway organizationalNodeUserGateway;
|
||||
protected final VisaOrganizationalNodeUserGateway visaOrganizationalNodeUserGateway;
|
||||
|
||||
protected BasicLogSupport(EventProducer eventProducer, OrganizationalNodeUserGateway organizationalNodeUserGateway) {
|
||||
protected BasicLogSupport(EventProducer eventProducer, VisaOrganizationalNodeUserGateway visaOrganizationalNodeUserGateway) {
|
||||
this.eventProducer = eventProducer;
|
||||
this.organizationalNodeUserGateway = organizationalNodeUserGateway;
|
||||
this.visaOrganizationalNodeUserGateway = visaOrganizationalNodeUserGateway;
|
||||
}
|
||||
|
||||
protected String buildLogUserInfo(BpmnTaskDelegateAssigner assigner) {
|
||||
@ -37,7 +37,7 @@ public abstract class BasicLogSupport {
|
||||
}
|
||||
|
||||
protected OrgNodeUserBriefInfoResp getOneUserInfo(BpmnTaskDelegateAssigner assigner) {
|
||||
List<OrgNodeUserBriefInfoResp> users = organizationalNodeUserGateway.listOrgNodeUsers(OrgNodeUserBriefInfoListReq.builder()
|
||||
List<OrgNodeUserBriefInfoResp> users = visaOrganizationalNodeUserGateway.listOrgNodeUsers(OrgNodeUserBriefInfoListReq.builder()
|
||||
.workspaceId(Long.valueOf(assigner.getTenantId()))
|
||||
.ouId(Long.valueOf(assigner.getOuId()))
|
||||
.personIds(Lists.newArrayList(Long.valueOf(assigner.getPersonId())))
|
||||
|
||||
@ -4,7 +4,7 @@ import cn.axzo.framework.rocketmq.EventProducer;
|
||||
import cn.axzo.nanopart.visa.server.domain.ChangeRecordLog;
|
||||
import cn.axzo.nanopart.visa.server.mq.listener.workflow.BasicLogSupport;
|
||||
import cn.axzo.nanopart.visa.server.mq.producer.VisaChangeLogPayload;
|
||||
import cn.axzo.nanopart.visa.server.rpc.OrganizationalNodeUserGateway;
|
||||
import cn.axzo.nanopart.visa.server.rpc.VisaOrganizationalNodeUserGateway;
|
||||
import cn.axzo.workflow.common.model.request.bpmn.task.BpmnTaskDelegateAssigner;
|
||||
import cn.axzo.workflow.common.model.response.mq.ProcessInstanceDTO;
|
||||
import cn.axzo.workflow.starter.handler.ProcessInstanceEventHandler;
|
||||
@ -25,12 +25,12 @@ import static cn.axzo.nanopart.visa.api.enums.VisaLogTypeEnum.TO_APPRROVE;
|
||||
@Component
|
||||
public class ProcessInstanceAllEventHandler extends BasicLogSupport implements ProcessInstanceEventHandler {
|
||||
private final EventProducer eventProducer;
|
||||
protected final OrganizationalNodeUserGateway organizationalNodeUserGateway;
|
||||
protected final VisaOrganizationalNodeUserGateway visaOrganizationalNodeUserGateway;
|
||||
|
||||
public ProcessInstanceAllEventHandler(EventProducer eventProducer, OrganizationalNodeUserGateway organizationalNodeUserGateway) {
|
||||
super(eventProducer, organizationalNodeUserGateway);
|
||||
public ProcessInstanceAllEventHandler(EventProducer eventProducer, VisaOrganizationalNodeUserGateway visaOrganizationalNodeUserGateway) {
|
||||
super(eventProducer, visaOrganizationalNodeUserGateway);
|
||||
this.eventProducer = eventProducer;
|
||||
this.organizationalNodeUserGateway = organizationalNodeUserGateway;
|
||||
this.visaOrganizationalNodeUserGateway = visaOrganizationalNodeUserGateway;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -5,7 +5,7 @@ import cn.axzo.maokai.api.vo.response.OrgNodeUserBriefInfoResp;
|
||||
import cn.axzo.nanopart.visa.server.domain.ChangeRecordLog;
|
||||
import cn.axzo.nanopart.visa.server.mq.listener.workflow.BasicLogSupport;
|
||||
import cn.axzo.nanopart.visa.server.mq.producer.VisaChangeLogPayload;
|
||||
import cn.axzo.nanopart.visa.server.rpc.OrganizationalNodeUserGateway;
|
||||
import cn.axzo.nanopart.visa.server.rpc.VisaOrganizationalNodeUserGateway;
|
||||
import cn.axzo.workflow.common.model.response.mq.ProcessTaskDTO;
|
||||
import cn.axzo.workflow.starter.handler.ProcessTaskEventHandler;
|
||||
import org.springframework.stereotype.Component;
|
||||
@ -22,12 +22,12 @@ import static cn.axzo.nanopart.visa.api.enums.VisaLogTypeEnum.TRANSMIT_APPROVE;
|
||||
@Component
|
||||
public class ProcessTaskAllEventHandler extends BasicLogSupport implements ProcessTaskEventHandler {
|
||||
private final EventProducer eventProducer;
|
||||
protected final OrganizationalNodeUserGateway organizationalNodeUserGateway;
|
||||
protected final VisaOrganizationalNodeUserGateway visaOrganizationalNodeUserGateway;
|
||||
|
||||
public ProcessTaskAllEventHandler(EventProducer eventProducer, OrganizationalNodeUserGateway organizationalNodeUserGateway) {
|
||||
super(eventProducer, organizationalNodeUserGateway);
|
||||
public ProcessTaskAllEventHandler(EventProducer eventProducer, VisaOrganizationalNodeUserGateway visaOrganizationalNodeUserGateway) {
|
||||
super(eventProducer, visaOrganizationalNodeUserGateway);
|
||||
this.eventProducer = eventProducer;
|
||||
this.organizationalNodeUserGateway = organizationalNodeUserGateway;
|
||||
this.visaOrganizationalNodeUserGateway = visaOrganizationalNodeUserGateway;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -20,7 +20,7 @@ import java.util.Objects;
|
||||
@Slf4j
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class CooperateShipGateway {
|
||||
public class VisaCooperateShipGateway {
|
||||
|
||||
private final CooperateShipQueryApi cooperateShipQueryApi;
|
||||
|
||||
@ -26,7 +26,7 @@ import java.util.Objects;
|
||||
@Service
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
public class OrganizationalNodeUserGateway {
|
||||
public class VisaOrganizationalNodeUserGateway {
|
||||
|
||||
private final OrganizationalNodeUserQueryApi organizationalNodeUserQueryApi;
|
||||
|
||||
@ -43,12 +43,12 @@ public class OrganizationalNodeUserGateway {
|
||||
return new PageResp<OrgNodeUserDTO>();
|
||||
}
|
||||
try {
|
||||
log.info("OrganizationalNodeUserGateway list, params:{}", req);
|
||||
log.info("VisaOrganizationalNodeUserGateway list, params:{}", req);
|
||||
ApiResult<PageResp<OrgNodeUserDTO>> list = orgNodeUserApi.list(req);
|
||||
log.info("OrganizationalNodeUserGateway list, result:{}", JSON.toJSONString(list));
|
||||
log.info("VisaOrganizationalNodeUserGateway list, result:{}", JSON.toJSONString(list));
|
||||
return list.getData();
|
||||
} catch (Exception e) {
|
||||
log.warn("OrganizationalNodeUserGateway list exception", e);
|
||||
log.warn("VisaOrganizationalNodeUserGateway list exception", e);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
@ -21,7 +21,7 @@ import java.util.Objects;
|
||||
@Slf4j
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class ProfileGateway {
|
||||
public class VisaProfileGateway {
|
||||
|
||||
private final UserProfileServiceApi userProfileServiceApi;
|
||||
|
||||
@ -17,7 +17,7 @@ import cn.axzo.nanopart.visa.server.dto.VisaConfirmDto;
|
||||
import cn.axzo.nanopart.visa.server.mapper.ChangeRecordConfirmDao;
|
||||
import cn.axzo.nanopart.visa.server.rpc.DataObjectApiGateway;
|
||||
import cn.axzo.nanopart.visa.server.rpc.OrganizationalUnitGateway;
|
||||
import cn.axzo.nanopart.visa.server.rpc.ProfileGateway;
|
||||
import cn.axzo.nanopart.visa.server.rpc.VisaProfileGateway;
|
||||
import cn.axzo.nanopart.visa.server.rpc.WorkflowGateway;
|
||||
import cn.axzo.nanopart.visa.server.service.ChangeRecordConfirmService;
|
||||
import cn.axzo.nanopart.visa.server.service.ChangeRecordLogService;
|
||||
@ -52,7 +52,7 @@ import java.util.stream.Collectors;
|
||||
public class ChangeRecordConfirmServiceImpl extends ServiceImpl<ChangeRecordConfirmDao, ChangeRecordConfirm> implements ChangeRecordConfirmService {
|
||||
|
||||
@Resource
|
||||
private ProfileGateway profileGateway;
|
||||
private VisaProfileGateway visaProfileGateway;
|
||||
|
||||
@Resource
|
||||
private OrganizationalUnitGateway organizationalUnitGateway;
|
||||
@ -269,7 +269,7 @@ public class ChangeRecordConfirmServiceImpl extends ServiceImpl<ChangeRecordConf
|
||||
if (CollectionUtils.isEmpty(personSet)) {
|
||||
return Maps.newHashMap();
|
||||
}
|
||||
List<PersonProfileDto> profiles = profileGateway.getProfiles(Lists.newArrayList(personSet));
|
||||
List<PersonProfileDto> profiles = visaProfileGateway.getProfiles(Lists.newArrayList(personSet));
|
||||
if (CollectionUtils.isEmpty(profiles)) {
|
||||
return Maps.newHashMap();
|
||||
}
|
||||
|
||||
@ -7,7 +7,7 @@ import cn.axzo.nanopart.visa.server.domain.ChangeRecordLog;
|
||||
import cn.axzo.nanopart.visa.server.dto.VisaLogDto;
|
||||
import cn.axzo.nanopart.visa.server.dto.VisaLogParam;
|
||||
import cn.axzo.nanopart.visa.server.mapper.ChangeRecordLogDao;
|
||||
import cn.axzo.nanopart.visa.server.rpc.OrganizationalNodeUserGateway;
|
||||
import cn.axzo.nanopart.visa.server.rpc.VisaOrganizationalNodeUserGateway;
|
||||
import cn.axzo.orggateway.api.nodeuser.dto.OrgNodeUserDTO;
|
||||
import cn.axzo.orggateway.api.nodeuser.req.ListOrgNodeUserReq;
|
||||
import cn.axzo.orgmanax.dto.nodeuser.req.ListNodeUserReq;
|
||||
@ -37,7 +37,7 @@ import java.util.stream.Collectors;
|
||||
public class ChangeRecordLogServiceImpl extends ServiceImpl<ChangeRecordLogDao, ChangeRecordLog> implements ChangeRecordLogService {
|
||||
|
||||
@Resource
|
||||
private OrganizationalNodeUserGateway organizationalNodeUserGateway;
|
||||
private VisaOrganizationalNodeUserGateway visaOrganizationalNodeUserGateway;
|
||||
|
||||
@Resource
|
||||
private ChangeRecordService changeRecordService;
|
||||
@ -229,7 +229,7 @@ public class ChangeRecordLogServiceImpl extends ServiceImpl<ChangeRecordLogDao,
|
||||
* 构建操作人信息
|
||||
*/
|
||||
public String buildUserName(Long personId, Long ouId, Long workspaceId) {
|
||||
PageResp<OrgNodeUserDTO> pageResp = organizationalNodeUserGateway.list(ListOrgNodeUserReq.builder()
|
||||
PageResp<OrgNodeUserDTO> pageResp = visaOrganizationalNodeUserGateway.list(ListOrgNodeUserReq.builder()
|
||||
.personId(personId)
|
||||
.organizationalUnitId(ouId)
|
||||
.workspaceId(workspaceId)
|
||||
|
||||
@ -17,7 +17,7 @@ import cn.axzo.nanopart.visa.server.domain.ChangeRecord;
|
||||
import cn.axzo.nanopart.visa.server.domain.ChangeRecordRelation;
|
||||
import cn.axzo.nanopart.visa.server.dto.VisaRelationDto;
|
||||
import cn.axzo.nanopart.visa.server.mapper.ChangeRecordRelationDao;
|
||||
import cn.axzo.nanopart.visa.server.rpc.ProfileGateway;
|
||||
import cn.axzo.nanopart.visa.server.rpc.VisaProfileGateway;
|
||||
import cn.axzo.nanopart.visa.server.service.ChangeRecordRelationService;
|
||||
import cn.axzo.nanopart.visa.server.service.ChangeRecordService;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
@ -50,7 +50,7 @@ import static cn.axzo.nanopart.visa.api.constant.VisaConstant.IM_GROUP_PARTICIPA
|
||||
@RequiredArgsConstructor
|
||||
public class ChangeRecordRelationServiceImpl extends ServiceImpl<ChangeRecordRelationDao, ChangeRecordRelation> implements ChangeRecordRelationService {
|
||||
private final ChangeRecordService changeRecordService;
|
||||
private final ProfileGateway profileGateway;
|
||||
private final VisaProfileGateway visaProfileGateway;
|
||||
|
||||
/**
|
||||
* 保存
|
||||
@ -222,7 +222,7 @@ public class ChangeRecordRelationServiceImpl extends ServiceImpl<ChangeRecordRel
|
||||
.filter(i -> Objects.equals(i.getCreateBy(), req.getPersonId()))
|
||||
.anyMatch(i -> Objects.equals(i.getContentExt(), String.valueOf(req.getOuId())));
|
||||
if (!operated) {
|
||||
PersonProfileDto profile = profileGateway.getProfile(record.getCreateBy());
|
||||
PersonProfileDto profile = visaProfileGateway.getProfile(record.getCreateBy());
|
||||
resp.setTipsText(String.format(IM_GROUP_PARTICIPATE_TIPS, profile.getRealName(), record.getTopic()));
|
||||
buttons.add(ImGroupButton.builder()
|
||||
.name(VisaButtonTypeEnum.AGREE.getDesc())
|
||||
|
||||
@ -28,11 +28,11 @@ import cn.axzo.nanopart.visa.server.dto.VisaConfirmDto;
|
||||
import cn.axzo.nanopart.visa.server.dto.VisaLogParam;
|
||||
import cn.axzo.nanopart.visa.server.mapper.ChangeRecordDao;
|
||||
import cn.axzo.nanopart.visa.server.rpc.ApolloConstructionAreaGateway;
|
||||
import cn.axzo.nanopart.visa.server.rpc.CooperateShipGateway;
|
||||
import cn.axzo.nanopart.visa.server.rpc.VisaCooperateShipGateway;
|
||||
import cn.axzo.nanopart.visa.server.rpc.DrawingMajorGateway;
|
||||
import cn.axzo.nanopart.visa.server.rpc.MsgCenterGateway;
|
||||
import cn.axzo.nanopart.visa.server.rpc.OrganizationalNodeUserGateway;
|
||||
import cn.axzo.nanopart.visa.server.rpc.ProfileGateway;
|
||||
import cn.axzo.nanopart.visa.server.rpc.VisaOrganizationalNodeUserGateway;
|
||||
import cn.axzo.nanopart.visa.server.rpc.VisaProfileGateway;
|
||||
import cn.axzo.nanopart.visa.server.rpc.ProjectApiGateway;
|
||||
import cn.axzo.nanopart.visa.server.rpc.WorkflowGateway;
|
||||
import cn.axzo.nanopart.visa.server.rpc.WorkspaceGateway;
|
||||
@ -128,7 +128,7 @@ public class ChangeRecordServiceImpl extends ServiceImpl<ChangeRecordDao, Change
|
||||
private ChangeRecordRelationService changeRecordRelationService;
|
||||
|
||||
@Resource
|
||||
private ProfileGateway profileGateway;
|
||||
private VisaProfileGateway visaProfileGateway;
|
||||
|
||||
@Resource
|
||||
private DrawingMajorGateway drawingMajorGateway;
|
||||
@ -140,10 +140,10 @@ public class ChangeRecordServiceImpl extends ServiceImpl<ChangeRecordDao, Change
|
||||
private ProjectApiGateway projectApiGateway;
|
||||
|
||||
@Resource
|
||||
private CooperateShipGateway cooperateShipGateway;
|
||||
private VisaCooperateShipGateway visaCooperateShipGateway;
|
||||
|
||||
@Resource
|
||||
private OrganizationalNodeUserGateway nodeUserGateway;
|
||||
private VisaOrganizationalNodeUserGateway nodeUserGateway;
|
||||
|
||||
@Resource
|
||||
private ReportServiceSDK reportServiceSDK;
|
||||
@ -303,7 +303,7 @@ public class ChangeRecordServiceImpl extends ServiceImpl<ChangeRecordDao, Change
|
||||
return VisaDetailByIdResponse.builder().build();
|
||||
}
|
||||
ChangeRecord visa = this.getById(visaId);
|
||||
PersonProfileDto profile = profileGateway.getProfile(visa.getCreateBy());
|
||||
PersonProfileDto profile = visaProfileGateway.getProfile(visa.getCreateBy());
|
||||
|
||||
List<ChangeRecordBill> changeRecordBills = changeRecordBillService.listById(visaId);
|
||||
Map<VisaBillTypeEnum, List<Long>> billMap = changeRecordBills.stream().collect(Collectors.groupingBy(ChangeRecordBill::getBillType, Collectors.mapping(ChangeRecordBill::getBillId, Collectors.toList())));
|
||||
|
||||
Loading…
Reference in New Issue
Block a user