Merge remote-tracking branch 'origin/dev' into dev
commit
d26cd68a1a
|
|
@ -128,4 +128,10 @@ public class ImagesOpenController {
|
||||||
return fileUploadApi.uploadInternal(file);
|
return fileUploadApi.uploadInternal(file);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ApiOperation("通过用户账号查询机构信息")
|
||||||
|
@PostMapping("/org-info/getByAccount")
|
||||||
|
public SingleResponse<OrgInfoCO> getByAccount(@ApiParam("账号") @RequestBody Req<String> req) {
|
||||||
|
return orgInfoApi.getByAccount(req.getData());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
package org.qinan.safetyeval.app.executor;
|
package org.qinan.safetyeval.app.executor;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import com.jjb.saas.system.client.user.request.UserAddCmd;
|
import com.jjb.saas.system.client.user.request.UserAddCmd;
|
||||||
import com.zcloud.gbscommon.utils.MD5;
|
import com.zcloud.gbscommon.utils.MD5;
|
||||||
import com.zcloud.gbscommon.utils.Sm2Util;
|
import com.zcloud.gbscommon.utils.Sm2Util;
|
||||||
|
|
@ -17,7 +17,8 @@ import org.qinan.safetyeval.domain.query.PageResult;
|
||||||
import org.qinan.safetyeval.domain.service.AccountDomainService;
|
import org.qinan.safetyeval.domain.service.AccountDomainService;
|
||||||
import org.qinan.safetyeval.infrastructure.adapter.auth.AuthUserContextAdapter;
|
import org.qinan.safetyeval.infrastructure.adapter.auth.AuthUserContextAdapter;
|
||||||
import org.qinan.safetyeval.infrastructure.adapter.gbs.GbsUserFacadeClient;
|
import org.qinan.safetyeval.infrastructure.adapter.gbs.GbsUserFacadeClient;
|
||||||
import org.qinan.safetyeval.infrastructure.dataobject.OrgInfoDO;
|
import org.qinan.safetyeval.infrastructure.dataobject.AccountDO;
|
||||||
|
import org.qinan.safetyeval.infrastructure.mapper.AccountMapper;
|
||||||
import org.qinan.safetyeval.infrastructure.mapper.OrgInfoMapper;
|
import org.qinan.safetyeval.infrastructure.mapper.OrgInfoMapper;
|
||||||
import org.qinan.safetyeval.infrastructure.remote.SmsRemote;
|
import org.qinan.safetyeval.infrastructure.remote.SmsRemote;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
@ -48,6 +49,8 @@ public class AccountExecutor implements AccountApi {
|
||||||
private SmsRemote smsRemote;
|
private SmsRemote smsRemote;
|
||||||
@Autowired
|
@Autowired
|
||||||
private OrgInfoMapper orgInfoMapper;
|
private OrgInfoMapper orgInfoMapper;
|
||||||
|
@Autowired
|
||||||
|
private AccountMapper accountMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
|
@ -129,16 +132,22 @@ public class AccountExecutor implements AccountApi {
|
||||||
log.info("同步用户密码:{}", pas);
|
log.info("同步用户密码:{}", pas);
|
||||||
String encrypt = Sm2Util.encryptHex(MD5.md5(pas), publicKey);
|
String encrypt = Sm2Util.encryptHex(MD5.md5(pas), publicKey);
|
||||||
userAddCmd.setPassword(encrypt);
|
userAddCmd.setPassword(encrypt);
|
||||||
try {
|
int add = gbsUserFacadeClient.add(userAddCmd);
|
||||||
gbsUserFacadeClient.add(userAddCmd);
|
if (add == 2) {
|
||||||
} catch (Exception e) {
|
accountMapper.update(null, new LambdaUpdateWrapper<AccountDO>()
|
||||||
// 回滚数据, 清除account表示数据,orgInfo数据
|
.eq(AccountDO::getId, result.getId())
|
||||||
orgInfoMapper.delete(new LambdaQueryWrapper<OrgInfoDO>()
|
.set(AccountDO::getSyncGbs, add));
|
||||||
.eq(OrgInfoDO::getCreateId, result.getId()));
|
|
||||||
accountDomainService.delete(result.getId());
|
|
||||||
log.error("同步用户失败: {}", e.getMessage());
|
|
||||||
throw new BizException(ErrorCode.GBS_USER_SYNC_ERROR);
|
|
||||||
}
|
}
|
||||||
|
// try {
|
||||||
|
|
||||||
|
// } catch (Exception e) {
|
||||||
|
// // 回滚数据, 清除account表示数据,orgInfo数据
|
||||||
|
// orgInfoMapper.delete(new LambdaQueryWrapper<OrgInfoDO>()
|
||||||
|
// .eq(OrgInfoDO::getCreateId, result.getId()));
|
||||||
|
// accountDomainService.delete(result.getId());
|
||||||
|
// log.error("同步用户失败: {}", e.getMessage());
|
||||||
|
// throw new BizException(ErrorCode.GBS_USER_SYNC_ERROR);
|
||||||
|
// }
|
||||||
return SingleResponse.success(toCO(result));
|
return SingleResponse.success(toCO(result));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -171,6 +180,7 @@ public class AccountExecutor implements AccountApi {
|
||||||
co.setProfileUrl(entity.getProfileUrl());
|
co.setProfileUrl(entity.getProfileUrl());
|
||||||
co.setType(entity.getType());
|
co.setType(entity.getType());
|
||||||
co.setTenantId(entity.getTenantId());
|
co.setTenantId(entity.getTenantId());
|
||||||
|
co.setSyncGbs(entity.getSyncGbs());
|
||||||
return co;
|
return co;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -77,6 +77,7 @@ public class OrgInfoExecutor implements OrgInfoApi {
|
||||||
entity.setFilingRecordStatusName(cmd.getFilingRecordStatusName());
|
entity.setFilingRecordStatusName(cmd.getFilingRecordStatusName());
|
||||||
entity.setAttachmentUrls(cmd.getAttachmentUrls());
|
entity.setAttachmentUrls(cmd.getAttachmentUrls());
|
||||||
entity.setRegisterUserId(cmd.getRegisterUserId());
|
entity.setRegisterUserId(cmd.getRegisterUserId());
|
||||||
|
entity.setId(cmd.getId());
|
||||||
|
|
||||||
OrgInfoEntity result = orgInfoDomainService.add(entity);
|
OrgInfoEntity result = orgInfoDomainService.add(entity);
|
||||||
return SingleResponse.success(toCO(result));
|
return SingleResponse.success(toCO(result));
|
||||||
|
|
@ -196,6 +197,12 @@ public class OrgInfoExecutor implements OrgInfoApi {
|
||||||
return SingleResponse.success(toCO(entity));
|
return SingleResponse.success(toCO(entity));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SingleResponse<OrgInfoCO> getByAccount(String data) {
|
||||||
|
OrgInfoEntity entity = orgInfoDomainService.getByAccount(data);
|
||||||
|
return SingleResponse.success(toCO(entity));
|
||||||
|
}
|
||||||
|
|
||||||
private OrgInfoCO toCO(OrgInfoEntity entity) {
|
private OrgInfoCO toCO(OrgInfoEntity entity) {
|
||||||
if (entity == null) {
|
if (entity == null) {
|
||||||
return null;
|
return null;
|
||||||
|
|
|
||||||
|
|
@ -30,4 +30,6 @@ public interface OrgInfoApi {
|
||||||
PageResponse<OrgInfoCO> page(OrgInfoPageQuery query);
|
PageResponse<OrgInfoCO> page(OrgInfoPageQuery query);
|
||||||
|
|
||||||
SingleResponse<OrgInfoCO> getInfo();
|
SingleResponse<OrgInfoCO> getInfo();
|
||||||
|
|
||||||
|
SingleResponse<OrgInfoCO> getByAccount(String data);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -31,4 +31,7 @@ public class AccountCO {
|
||||||
|
|
||||||
@ApiModelProperty(value = "租户ID")
|
@ApiModelProperty(value = "租户ID")
|
||||||
private Long tenantId;
|
private Long tenantId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "同步gbs 1-未同步, 2-同步")
|
||||||
|
private Integer syncGbs;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -159,4 +159,6 @@ public class OrgInfoCO {
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
private LocalDateTime createTime;
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,9 @@ import java.time.LocalDate;
|
||||||
@Data
|
@Data
|
||||||
public class OrgInfoAddCmd {
|
public class OrgInfoAddCmd {
|
||||||
|
|
||||||
|
/** 主键ID */
|
||||||
|
private Long id;
|
||||||
|
|
||||||
@ApiModelProperty(value = "生产经营单位名称")
|
@ApiModelProperty(value = "生产经营单位名称")
|
||||||
private String unitName;
|
private String unitName;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package org.qinan.safetyeval.domain.entity;
|
package org.qinan.safetyeval.domain.entity;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -33,4 +34,7 @@ public class AccountEntity {
|
||||||
|
|
||||||
/** 租户ID */
|
/** 租户ID */
|
||||||
private Long tenantId;
|
private Long tenantId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "同步gbs 1-未同步, 2-同步")
|
||||||
|
private Integer syncGbs;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,4 +28,6 @@ public interface OrgInfoGateway {
|
||||||
OrgInfoEntity getInfo();
|
OrgInfoEntity getInfo();
|
||||||
|
|
||||||
void resetPassword(Long id);
|
void resetPassword(Long id);
|
||||||
|
|
||||||
|
OrgInfoEntity getByAccount(String data);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,9 +6,9 @@ import org.qinan.safetyeval.domain.exception.ErrorCode;
|
||||||
import org.qinan.safetyeval.domain.gateway.OrgInfoGateway;
|
import org.qinan.safetyeval.domain.gateway.OrgInfoGateway;
|
||||||
import org.qinan.safetyeval.domain.query.OrgInfoQuery;
|
import org.qinan.safetyeval.domain.query.OrgInfoQuery;
|
||||||
import org.qinan.safetyeval.domain.query.PageResult;
|
import org.qinan.safetyeval.domain.query.PageResult;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 机构信息领域服务
|
* 机构信息领域服务
|
||||||
|
|
@ -64,4 +64,8 @@ public class OrgInfoDomainService {
|
||||||
public void resetPassword(Long id) {
|
public void resetPassword(Long id) {
|
||||||
orgInfoGateway.resetPassword(id);
|
orgInfoGateway.resetPassword(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public OrgInfoEntity getByAccount(String data) {
|
||||||
|
return orgInfoGateway.getByAccount(data);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ public class GbsUserFacadeClient {
|
||||||
private Long roleId;
|
private Long roleId;
|
||||||
|
|
||||||
|
|
||||||
public void add(UserAddCmd cmd) {
|
public Integer add(UserAddCmd cmd) {
|
||||||
//2069596397920849920{key: "1782463085576", deptId: "2069596397920849920", roleId: "2069671307598893058"}
|
//2069596397920849920{key: "1782463085576", deptId: "2069596397920849920", roleId: "2069671307598893058"}
|
||||||
List<RoleDeptAddCmd> list = new ArrayList<>();
|
List<RoleDeptAddCmd> list = new ArrayList<>();
|
||||||
RoleDeptAddCmd roleDeptAddCmd = new RoleDeptAddCmd();
|
RoleDeptAddCmd roleDeptAddCmd = new RoleDeptAddCmd();
|
||||||
|
|
@ -39,6 +39,8 @@ public class GbsUserFacadeClient {
|
||||||
SingleResponse<Long> singleResponse = userFacade.add(cmd);
|
SingleResponse<Long> singleResponse = userFacade.add(cmd);
|
||||||
if (!singleResponse.isSuccess()) {
|
if (!singleResponse.isSuccess()) {
|
||||||
throw new BizException(singleResponse.getErrCode(), singleResponse.getErrMessage());
|
throw new BizException(singleResponse.getErrCode(), singleResponse.getErrMessage());
|
||||||
|
} else {
|
||||||
|
return 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,10 @@ public class AccountDO {
|
||||||
private String password;
|
private String password;
|
||||||
private String profileUrl;
|
private String profileUrl;
|
||||||
private Integer type;
|
private Integer type;
|
||||||
|
/**
|
||||||
|
* gbs同步, 1-未同步, 2-同步
|
||||||
|
*/
|
||||||
|
private Integer syncGbs;
|
||||||
|
|
||||||
// ---- GBS默认字段 ----
|
// ---- GBS默认字段 ----
|
||||||
private String deleteEnum;
|
private String deleteEnum;
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ import org.qinan.safetyeval.domain.query.PageResult;
|
||||||
import org.qinan.safetyeval.infrastructure.dataobject.AccountDO;
|
import org.qinan.safetyeval.infrastructure.dataobject.AccountDO;
|
||||||
import org.qinan.safetyeval.infrastructure.mapper.AccountMapper;
|
import org.qinan.safetyeval.infrastructure.mapper.AccountMapper;
|
||||||
import org.qinan.safetyeval.infrastructure.support.InsertFieldDefaults;
|
import org.qinan.safetyeval.infrastructure.support.InsertFieldDefaults;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import org.springframework.util.StringUtils;
|
import org.springframework.util.StringUtils;
|
||||||
|
|
||||||
|
|
@ -28,6 +29,9 @@ public class AccountGatewayImpl implements AccountGateway {
|
||||||
@Resource
|
@Resource
|
||||||
private AccountMapper accountMapper;
|
private AccountMapper accountMapper;
|
||||||
|
|
||||||
|
@Value("${def.tenantId:2067161116369793024L}")
|
||||||
|
private String tenantId;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AccountEntity save(AccountEntity entity) {
|
public AccountEntity save(AccountEntity entity) {
|
||||||
AccountDO dataObject = toDO(entity);
|
AccountDO dataObject = toDO(entity);
|
||||||
|
|
@ -48,6 +52,7 @@ public class AccountGatewayImpl implements AccountGateway {
|
||||||
public AccountEntity getByAccount(String account) {
|
public AccountEntity getByAccount(String account) {
|
||||||
LambdaQueryWrapper<AccountDO> wrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<AccountDO> wrapper = new LambdaQueryWrapper<>();
|
||||||
wrapper.eq(AccountDO::getAccount, account);
|
wrapper.eq(AccountDO::getAccount, account);
|
||||||
|
wrapper.eq(AccountDO::getTenantId, tenantId);
|
||||||
wrapper.eq(AccountDO::getDeleteEnum, "false");
|
wrapper.eq(AccountDO::getDeleteEnum, "false");
|
||||||
AccountDO dataObject = accountMapper.selectOne(wrapper);
|
AccountDO dataObject = accountMapper.selectOne(wrapper);
|
||||||
return toEntity(dataObject);
|
return toEntity(dataObject);
|
||||||
|
|
@ -98,6 +103,7 @@ public class AccountGatewayImpl implements AccountGateway {
|
||||||
public AccountEntity foundByPhone(String phone) {
|
public AccountEntity foundByPhone(String phone) {
|
||||||
LambdaQueryWrapper<AccountDO> wrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<AccountDO> wrapper = new LambdaQueryWrapper<>();
|
||||||
wrapper.eq(AccountDO::getPhone, phone);
|
wrapper.eq(AccountDO::getPhone, phone);
|
||||||
|
wrapper.eq(AccountDO::getTenantId, tenantId);
|
||||||
wrapper.eq(AccountDO::getDeleteEnum, "false");
|
wrapper.eq(AccountDO::getDeleteEnum, "false");
|
||||||
AccountDO dataObject = accountMapper.selectOne(wrapper);
|
AccountDO dataObject = accountMapper.selectOne(wrapper);
|
||||||
return toEntity(dataObject);
|
return toEntity(dataObject);
|
||||||
|
|
@ -128,6 +134,7 @@ public class AccountGatewayImpl implements AccountGateway {
|
||||||
entity.setProfileUrl(dataObject.getProfileUrl());
|
entity.setProfileUrl(dataObject.getProfileUrl());
|
||||||
entity.setType(dataObject.getType());
|
entity.setType(dataObject.getType());
|
||||||
entity.setTenantId(dataObject.getTenantId());
|
entity.setTenantId(dataObject.getTenantId());
|
||||||
|
entity.setSyncGbs(dataObject.getSyncGbs());
|
||||||
return entity;
|
return entity;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,8 +18,10 @@ import org.qinan.safetyeval.domain.query.OrgInfoQuery;
|
||||||
import org.qinan.safetyeval.domain.query.PageResult;
|
import org.qinan.safetyeval.domain.query.PageResult;
|
||||||
import org.qinan.safetyeval.infrastructure.adapter.auth.AuthUserContextAdapter;
|
import org.qinan.safetyeval.infrastructure.adapter.auth.AuthUserContextAdapter;
|
||||||
import org.qinan.safetyeval.infrastructure.adapter.gbs.GbsUserFacadeClient;
|
import org.qinan.safetyeval.infrastructure.adapter.gbs.GbsUserFacadeClient;
|
||||||
|
import org.qinan.safetyeval.infrastructure.dataobject.AccountDO;
|
||||||
import org.qinan.safetyeval.infrastructure.dataobject.OrgInfoDO;
|
import org.qinan.safetyeval.infrastructure.dataobject.OrgInfoDO;
|
||||||
import org.qinan.safetyeval.infrastructure.dataobject.OrgPersonnelDO;
|
import org.qinan.safetyeval.infrastructure.dataobject.OrgPersonnelDO;
|
||||||
|
import org.qinan.safetyeval.infrastructure.mapper.AccountMapper;
|
||||||
import org.qinan.safetyeval.infrastructure.mapper.OrgInfoMapper;
|
import org.qinan.safetyeval.infrastructure.mapper.OrgInfoMapper;
|
||||||
import org.qinan.safetyeval.infrastructure.mapper.OrgPersonnelMapper;
|
import org.qinan.safetyeval.infrastructure.mapper.OrgPersonnelMapper;
|
||||||
import org.qinan.safetyeval.infrastructure.support.InsertFieldDefaults;
|
import org.qinan.safetyeval.infrastructure.support.InsertFieldDefaults;
|
||||||
|
|
@ -58,12 +60,16 @@ public class OrgInfoGatewayImpl implements OrgInfoGateway {
|
||||||
private GbsUserFacadeClient gbsUserFacadeClient;
|
private GbsUserFacadeClient gbsUserFacadeClient;
|
||||||
@Value("${def.password:a123456}")
|
@Value("${def.password:a123456}")
|
||||||
private String defPassword;
|
private String defPassword;
|
||||||
|
@Value("${def.tenantId:2067161116369793024L}")
|
||||||
|
private String tenantId;
|
||||||
@Value("${def.publicKey:0402df2195296d4062ac85ad766994d73e871b887e18efb9a9a06b4cebc72372869b7da6c347c129dee2b46a0f279ff066b01c76208c2a052af75977c722a2ccee}")
|
@Value("${def.publicKey:0402df2195296d4062ac85ad766994d73e871b887e18efb9a9a06b4cebc72372869b7da6c347c129dee2b46a0f279ff066b01c76208c2a052af75977c722a2ccee}")
|
||||||
private String publicKey;
|
private String publicKey;
|
||||||
|
|
||||||
|
|
||||||
@Value("${safety-eval.gbs-user-sync.fail-fast:true}")
|
@Value("${safety-eval.gbs-user-sync.fail-fast:true}")
|
||||||
private boolean gbsUserSyncFailFast;
|
private boolean gbsUserSyncFailFast;
|
||||||
|
@Autowired
|
||||||
|
private AccountMapper accountMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public OrgInfoEntity save(OrgInfoEntity entity) {
|
public OrgInfoEntity save(OrgInfoEntity entity) {
|
||||||
|
|
@ -71,6 +77,12 @@ public class OrgInfoGatewayImpl implements OrgInfoGateway {
|
||||||
List<OrgInfoDO> orgInfoDOS = orgInfoMapper.selectList(new LambdaQueryWrapper<OrgInfoDO>()
|
List<OrgInfoDO> orgInfoDOS = orgInfoMapper.selectList(new LambdaQueryWrapper<OrgInfoDO>()
|
||||||
.eq(OrgInfoDO::getCreateId, entity.getRegisterUserId()).last("limit 1"));
|
.eq(OrgInfoDO::getCreateId, entity.getRegisterUserId()).last("limit 1"));
|
||||||
if (!CollectionUtils.isEmpty(orgInfoDOS)) {
|
if (!CollectionUtils.isEmpty(orgInfoDOS)) {
|
||||||
|
if (entity.getId() != null) {
|
||||||
|
OrgInfoDO aDo = toDO(entity);
|
||||||
|
InsertFieldDefaults.applyForUpdate(aDo);
|
||||||
|
orgInfoMapper.updateById(aDo);
|
||||||
|
toEntity(aDo);
|
||||||
|
}
|
||||||
return toEntity(orgInfoDOS.get(0));
|
return toEntity(orgInfoDOS.get(0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -258,6 +270,27 @@ public class OrgInfoGatewayImpl implements OrgInfoGateway {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public OrgInfoEntity getByAccount(String data) {
|
||||||
|
AccountDO accountDO = accountMapper.selectOne(new LambdaQueryWrapper<AccountDO>()
|
||||||
|
.eq(AccountDO::getAccount, data)
|
||||||
|
.eq(AccountDO::getDeleteEnum, "false")
|
||||||
|
.eq(AccountDO::getTenantId, tenantId));
|
||||||
|
if (accountDO == null || accountDO.getId() == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
LambdaQueryWrapper<OrgInfoDO> lqw = new LambdaQueryWrapper<OrgInfoDO>()
|
||||||
|
.eq(OrgInfoDO::getCreateId, accountDO.getId())
|
||||||
|
.eq(OrgInfoDO::getDeleteEnum, "false")
|
||||||
|
.eq(OrgInfoDO::getTenantId, tenantId);
|
||||||
|
lqw.last("limit 1").orderByDesc(OrgInfoDO::getId);
|
||||||
|
List<OrgInfoDO> dataObject = orgInfoMapper.selectList(lqw);
|
||||||
|
if (dataObject.isEmpty()) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return toEntity(dataObject.get(0));
|
||||||
|
}
|
||||||
|
|
||||||
private void syncGbsUser(String action, Runnable runnable) {
|
private void syncGbsUser(String action, Runnable runnable) {
|
||||||
try {
|
try {
|
||||||
runnable.run();
|
runnable.run();
|
||||||
|
|
@ -271,6 +304,7 @@ public class OrgInfoGatewayImpl implements OrgInfoGateway {
|
||||||
|
|
||||||
private OrgInfoDO toDO(OrgInfoEntity entity) {
|
private OrgInfoDO toDO(OrgInfoEntity entity) {
|
||||||
OrgInfoDO dataObject = new OrgInfoDO();
|
OrgInfoDO dataObject = new OrgInfoDO();
|
||||||
|
dataObject.setId(entity.getId());
|
||||||
dataObject.setUnitName(entity.getUnitName());
|
dataObject.setUnitName(entity.getUnitName());
|
||||||
dataObject.setCreditCode(entity.getCreditCode());
|
dataObject.setCreditCode(entity.getCreditCode());
|
||||||
dataObject.setSafetyIndustryCategoryCode(entity.getSafetyIndustryCategoryCode());
|
dataObject.setSafetyIndustryCategoryCode(entity.getSafetyIndustryCategoryCode());
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ public final class InsertFieldDefaults {
|
||||||
}
|
}
|
||||||
Long tenantId = AuthUserContextAdapter.getCurrentTenantId();
|
Long tenantId = AuthUserContextAdapter.getCurrentTenantId();
|
||||||
if (tenantId == null) {
|
if (tenantId == null) {
|
||||||
tenantId = 2069596397920849920L;
|
tenantId = 2067161116369793024L;
|
||||||
}
|
}
|
||||||
setIfNull(dataObject, "createId", userId);
|
setIfNull(dataObject, "createId", userId);
|
||||||
setIfNull(dataObject, "updateId", userId);
|
setIfNull(dataObject, "updateId", userId);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue