Compare commits
No commits in common. "4b34647c5a0f3a092b3d2b7d0904dc88a325a43b" and "43713a781d82e9065ad8abe99c5a4fc2833bd956" have entirely different histories.
4b34647c5a
...
43713a781d
|
|
@ -1,20 +1,14 @@
|
||||||
package com.zcloud.basic.info.command;
|
package com.zcloud.basic.info.command;
|
||||||
|
|
||||||
import com.alibaba.cola.dto.Response;
|
|
||||||
import com.alibaba.cola.exception.BizException;
|
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.gateway.CorpInfoGateway;
|
||||||
import com.zcloud.basic.info.domain.model.CorpInfoE;
|
import com.zcloud.basic.info.domain.model.CorpInfoE;
|
||||||
import com.zcloud.basic.info.dto.CorpInfoUpdateCmd;
|
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 lombok.AllArgsConstructor;
|
||||||
import org.apache.dubbo.config.annotation.DubboReference;
|
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* web-app
|
* web-app
|
||||||
|
|
@ -24,12 +18,8 @@ import lombok.extern.slf4j.Slf4j;
|
||||||
*/
|
*/
|
||||||
@Component
|
@Component
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@Slf4j
|
|
||||||
public class CorpInfoUpdateExe {
|
public class CorpInfoUpdateExe {
|
||||||
private final CorpInfoGateway corpInfoGateway;
|
private final CorpInfoGateway corpInfoGateway;
|
||||||
private final CorpInfoRepository corpInfoRepository;
|
|
||||||
@DubboReference
|
|
||||||
private TenantFacade tenantFacade;
|
|
||||||
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void execute(CorpInfoUpdateCmd corpInfoUpdateCmd) {
|
public void execute(CorpInfoUpdateCmd corpInfoUpdateCmd) {
|
||||||
|
|
@ -42,24 +32,9 @@ public class CorpInfoUpdateExe {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void changeCompanyName(CorpInfoUpdateCmd corpInfoUpdateCmd) {
|
public void changeCompanyName(CorpInfoUpdateCmd corpInfoUpdateCmd) {
|
||||||
CorpInfoDO corpInfoDO = corpInfoRepository.getById(corpInfoUpdateCmd.getId());
|
|
||||||
|
|
||||||
CorpInfoE corpInfoE = new CorpInfoE();
|
CorpInfoE corpInfoE = new CorpInfoE();
|
||||||
BeanUtils.copyProperties(corpInfoUpdateCmd, corpInfoE);
|
BeanUtils.copyProperties(corpInfoUpdateCmd, corpInfoE);
|
||||||
corpInfoGateway.changeCompanyName(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,7 +25,5 @@ public class CorpInfoPageQry extends PageQuery {
|
||||||
*/
|
*/
|
||||||
private String likeCorpinfoId;
|
private String likeCorpinfoId;
|
||||||
private Long corpinfoId;
|
private Long corpinfoId;
|
||||||
private String corpName;
|
|
||||||
private String type;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,22 +0,0 @@
|
||||||
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,12 +36,6 @@ public class CorpInfoRepositoryImpl extends BaseRepositoryImpl<CorpInfoMapper, C
|
||||||
if (ObjectUtil.isNotEmpty(params.get("corpinfoId"))){
|
if (ObjectUtil.isNotEmpty(params.get("corpinfoId"))){
|
||||||
queryWrapper.eq("corpinfo_id",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");
|
queryWrapper.orderByDesc("create_time");
|
||||||
IPage<CorpInfoDO> result = corpInfoMapper.selectPage(iPage, queryWrapper);
|
IPage<CorpInfoDO> result = corpInfoMapper.selectPage(iPage, queryWrapper);
|
||||||
return PageHelper.pageToResponse(result, result.getRecords());
|
return PageHelper.pageToResponse(result, result.getRecords());
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue