Compare commits
2 Commits
43713a781d
...
4b34647c5a
| Author | SHA1 | Date |
|---|---|---|
|
|
4b34647c5a | |
|
|
f76321586c |
|
|
@ -1,14 +1,20 @@
|
|||
package com.zcloud.basic.info.command;
|
||||
|
||||
import com.alibaba.cola.dto.Response;
|
||||
import com.alibaba.cola.exception.BizException;
|
||||
import com.jjb.saas.system.client.tenant.facade.TenantFacade;
|
||||
import com.jjb.saas.system.client.tenant.request.OtaPlatformUserUpdateCmd;
|
||||
import com.zcloud.basic.info.domain.gateway.CorpInfoGateway;
|
||||
import com.zcloud.basic.info.domain.model.CorpInfoE;
|
||||
import com.zcloud.basic.info.dto.CorpInfoUpdateCmd;
|
||||
import com.zcloud.basic.info.persistence.dataobject.CorpInfoDO;
|
||||
import com.zcloud.basic.info.persistence.repository.CorpInfoRepository;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.apache.dubbo.config.annotation.DubboReference;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* web-app
|
||||
|
|
@ -18,8 +24,12 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
*/
|
||||
@Component
|
||||
@AllArgsConstructor
|
||||
@Slf4j
|
||||
public class CorpInfoUpdateExe {
|
||||
private final CorpInfoGateway corpInfoGateway;
|
||||
private final CorpInfoRepository corpInfoRepository;
|
||||
@DubboReference
|
||||
private TenantFacade tenantFacade;
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void execute(CorpInfoUpdateCmd corpInfoUpdateCmd) {
|
||||
|
|
@ -32,9 +42,24 @@ public class CorpInfoUpdateExe {
|
|||
}
|
||||
|
||||
public void changeCompanyName(CorpInfoUpdateCmd corpInfoUpdateCmd) {
|
||||
CorpInfoDO corpInfoDO = corpInfoRepository.getById(corpInfoUpdateCmd.getId());
|
||||
|
||||
CorpInfoE corpInfoE = new CorpInfoE();
|
||||
BeanUtils.copyProperties(corpInfoUpdateCmd, corpInfoE);
|
||||
corpInfoGateway.changeCompanyName(corpInfoE);
|
||||
|
||||
|
||||
OtaPlatformUserUpdateCmd otaUpdateCmd = new OtaPlatformUserUpdateCmd();
|
||||
otaUpdateCmd.setAccount(corpInfoE.getCorpName());
|
||||
otaUpdateCmd.setTenantName(corpInfoE.getCorpName());
|
||||
otaUpdateCmd.setOriginalAccount(corpInfoE.getCorpName());
|
||||
log.info("CorpInfoXgfUpdateExe,修改企业信息调用GBS请求:{}",otaUpdateCmd.toString());
|
||||
Response response = tenantFacade.updateOtaPlatformUser(otaUpdateCmd);
|
||||
log.info("CorpInfoXgfUpdateExe,修改企业信息调用GBS返回:{}",response.toString());
|
||||
|
||||
if(!corpInfoDO.getCorpName().equals(corpInfoE.getCorpName())){
|
||||
//TODO 名字有变动,发送mq
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -25,5 +25,7 @@ public class CorpInfoPageQry extends PageQuery {
|
|||
*/
|
||||
private String likeCorpinfoId;
|
||||
private Long corpinfoId;
|
||||
private String corpName;
|
||||
private String type;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,22 @@
|
|||
package com.zcloud.basic.info.domain.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
public enum CorpStateEnum {
|
||||
ZC(1,"filialstate01","在产"),
|
||||
ZJ(2,"filialstate02","在建"),
|
||||
DJ(3,"filialstate03","代建"),
|
||||
TC(4,"filialstate04","停产"),
|
||||
PC(5,"filialstate05","破产"),
|
||||
;
|
||||
private final Integer code;
|
||||
private final String bianma;
|
||||
private final String name;
|
||||
|
||||
CorpStateEnum(Integer code, String bianma, String name) {
|
||||
this.code = code;
|
||||
this.bianma = bianma;
|
||||
this.name = name;
|
||||
}
|
||||
}
|
||||
|
|
@ -36,6 +36,12 @@ public class CorpInfoRepositoryImpl extends BaseRepositoryImpl<CorpInfoMapper, C
|
|||
if (ObjectUtil.isNotEmpty(params.get("corpinfoId"))){
|
||||
queryWrapper.eq("corpinfo_id",params.get("corpinfoId"));
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(params.get("corpName"))){
|
||||
queryWrapper.like("corp_name",params.get("corpName"));
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(params.get("type"))){
|
||||
queryWrapper.eq("type",params.get("type"));
|
||||
}
|
||||
queryWrapper.orderByDesc("create_time");
|
||||
IPage<CorpInfoDO> result = corpInfoMapper.selectPage(iPage, queryWrapper);
|
||||
return PageHelper.pageToResponse(result, result.getRecords());
|
||||
|
|
|
|||
Loading…
Reference in New Issue