Commit 987fa649 authored by yangyang's avatar yangyang

fix(经销商人员管理): Add 用户是否有业务操作记录的字段用于前端判断

parent 4b7a5874
......@@ -29,4 +29,8 @@ public class UserDataJBDto {
private String nowAddress;
private String politicalOutlook;
private String nativePlace;
/**
* 是否有业务操作
*/
private Boolean hasOperationRecords;
}
......@@ -16,4 +16,8 @@ public class UserDataZHDto {
private String password;
private String rePassword;
private List<Long> role;
/**
* 是否有业务操作
*/
private Boolean hasOperationRecords;
}
......@@ -494,9 +494,44 @@ public class PersonnelBusinessServiceImpl extends BaseService<PersonnelBusinessD
userDataJBDto.setPosition(JSONArray.parseArray(publicAgencyUse.getPosition(),String.class));
userDataJBDto.setRegionalCompaniesSeq(personnelBusines.getRegionalCompaniesSeq()!=null?personnelBusines.getRegionalCompaniesSeq().toString():null);
userDataJBDto.setAmosUnitId(personnelBusines.getAmosUnitId());
Boolean hasOperationRecords = hasOperationRecords(id);
userDataZHDto.setHasOperationRecords(hasOperationRecords);
userDataJBDto.setHasOperationRecords(hasOperationRecords);
return new UserDataDto( userDataZHDto, userDataJBDto , userDataZZDto);
}
/**
* 用户是否有业务操作
*
*
* @param id id
* @return {@link Boolean}
* @author yangyang
* @throws
* @date 2024/7/3 16:24
*/
public Boolean hasOperationRecords(String id) {
if (StringUtils.isEmpty(id)) {
return false;
}
Boolean operateRecord = false;
String userId = personnelBusinessMapper.selectUserInfo(Long.parseLong(id));
//添加校验,如果业务表里面有相关的用户id不能删除
List<String> tableName = personnelBusinessMapper.selectHygfTableName();
if (CollectionUtil.isNotEmpty(tableName)) {
for (String table : tableName) {
int count = personnelBusinessMapper.countByUserId(table, userId);
if (count > 0) {
operateRecord = true;
break;
}
}
}
return operateRecord;
}
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean deleteAllBySequenceNbr(Long sequenceNbr) {
......
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