Commit e0da842f authored by yangyang's avatar yangyang

fix(编辑企业信息): 新增手动刷新用户组的接口

parent ca21bc75
......@@ -495,4 +495,12 @@ public class TzsUserInfoController extends BaseController {
public ResponseModel<String> deletePersonSubtypeHistoricalData() {
return ResponseHelper.buildResponse(tzsUserInfoService.deletePersonSubtypeHistoricalData());
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/refreshUserGroupInfo")
@ApiOperation(httpMethod = "POST", value = "同步人员信息", notes = "同步人员信息")
public ResponseModel<TzsUserInfoDto> refreshUserInfo(@RequestBody List<String> userIds) {
tzsUserInfoServiceImpl.refreshUserGroupInfo(userIds);
return ResponseHelper.buildResponse(null);
}
}
......@@ -1079,6 +1079,7 @@ public class TzBaseEnterpriseInfoServiceImpl
@Override
public TzBaseEnterpriseInfoDto updateCompanyInfoById(Map<String, Object> map, ReginParams reginParams) {
log.info("根据ID修改企业信息 => {}, 更新人 => {}", map, RequestContext.getExeUserId());
RegUnitInfo olrRegUnitInfo = new RegUnitInfo();
try {
TzBaseEnterpriseInfo tzBaseEnterpriseInfo = new TzBaseEnterpriseInfo();
tzBaseEnterpriseInfo.setSequenceNbr(Long.valueOf(map.get("sequenceNbr").toString()));
......@@ -1137,6 +1138,7 @@ public class TzBaseEnterpriseInfoServiceImpl
if (ValidationUtil.isEmpty(regUnitInfo)) {
throw new BadRequest("未找到单位注册信息");
}
BeanUtils.copyProperties(regUnitInfo, olrRegUnitInfo);
FeignClientResult<AgencyUserModel> userResult = Privilege.agencyUserClient.queryByUserId(regUnitInfo.getAdminUserId());
AgencyUserModel agencyUserModel = Optional.ofNullable(userResult).map(FeignClientResult::getResult).orElse(null);
if (ValidationUtil.isEmpty(agencyUserModel)) {
......@@ -1155,9 +1157,9 @@ public class TzBaseEnterpriseInfoServiceImpl
handleUnitType(map, regUnitInfo, agencyUserModel);
String[] unitTypes = regUnitInfo.getUnitType().split(",");
regUnitInfoService.saveOrUpdate(regUnitInfo);
// -- 20250627 调整为监管单位不能修改工商信息和资质
// -- 20250627 调整为监管单位不能修改工商信息和资质
regUnitInfoService.updateBySeq(regUnitInfo);
// 企业信息变更-同步修改企业下人员绑定设备类型
ArrayList<String> newData = new ArrayList<>();
JSONArray objects = JSON.parseArray(tzBaseEnterpriseInfo.getEquipCategory());
......@@ -1192,6 +1194,9 @@ public class TzBaseEnterpriseInfoServiceImpl
return null;
}
} catch (Exception e) {
if (!ValidationUtil.isEmpty(olrRegUnitInfo)) {
regUnitInfoService.updateBySeq(olrRegUnitInfo);
}
log.error("更新企业信息失败: ", e);
throw new BadRequest("更新企业信息失败!");
}
......
......@@ -62,6 +62,7 @@ import org.springframework.mock.web.MockMultipartFile;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StopWatch;
import org.springframework.web.client.RestTemplate;
......@@ -1152,4 +1153,9 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
}
return regUnitInfoDto;
}
@Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRES_NEW)
public void updateBySeq(RegUnitInfo regUnitInfo) {
this.updateById(regUnitInfo);
}
}
\ No newline at end of file
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