Commit 4ea488e4 authored by chenzhao's avatar chenzhao

修改bug

parent 70bc9dc9
...@@ -51,7 +51,9 @@ public class FireStationDto extends BaseDto { ...@@ -51,7 +51,9 @@ public class FireStationDto extends BaseDto {
@ApiModelProperty(value = "负责人名称id") @ApiModelProperty(value = "负责人名称id")
private String personChargeId; private String personChargeId;
@ExcelProperty(value = "负责人名称", index = 4)
@ExplicitConstraint(indexNum = 4, sourceClass = CommonExplicitConstraint.class, method = "getFireStationContactUser")
@ExcelProperty(value = "负责人", index = 4)
@ApiModelProperty(value = "负责人名称") @ApiModelProperty(value = "负责人名称")
private String personChargeName; private String personChargeName;
......
...@@ -181,6 +181,9 @@ public class DataSourcesImpl implements DataSources { ...@@ -181,6 +181,9 @@ public class DataSourcesImpl implements DataSources {
case "getFireTeamContactUser": case "getFireTeamContactUser":
str = getFireTeamContactUser(); str = getFireTeamContactUser();
break; break;
case "getFireStationContactUser":
str = getFireStationContactUser();
break;
} }
} }
return str; return str;
...@@ -214,6 +217,23 @@ public class DataSourcesImpl implements DataSources { ...@@ -214,6 +217,23 @@ public class DataSourcesImpl implements DataSources {
return str; return str;
} }
private String[] getFireStationContactUser() {
ReginParams reginParams = JSONObject.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class);
// 权限处理
PermissionInterceptorContext.setDataAuthRule("fire_station_info");
Map<String, Object> map = new HashMap<>();
map.put("bizOrgCode",reginParams.getPersonIdentity().getBizOrgCode());
IPage<Map<String, Object>> mapIPage = iOrgUsrService.pagePerson(null, null, map);
List<Map<String, Object>> records = mapIPage.getRecords();
List<String> carNameList = Lists.newArrayList();
records.forEach(result -> {
carNameList.add(result.get("bizOrgName") + "@" + result.get("sequenceNbr"));
});
String[] str = carNameList.toArray(new String[carNameList.size()]);
return str;
}
private String[] getFireTeamContactUser() { private String[] getFireTeamContactUser() {
ReginParams reginParams = JSONObject.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class); ReginParams reginParams = JSONObject.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class);
// 权限处理 // 权限处理
......
...@@ -800,12 +800,19 @@ public class ExcelServiceImpl { ...@@ -800,12 +800,19 @@ public class ExcelServiceImpl {
if (fireStation.getBizCompany() != null) { if (fireStation.getBizCompany() != null) {
String[] bizCompany = fireStation.getBizCompany().split("@"); String[] bizCompany = fireStation.getBizCompany().split("@");
fireStation.setBizCompany(bizCompany[0]); fireStation.setBizCompany(bizCompany[0]);
fireStation.setBizOrgName(bizCompany[0]);
fireStation.setBizCompanyId(Long.valueOf(bizCompany[1])); fireStation.setBizCompanyId(Long.valueOf(bizCompany[1]));
OrgUsr byId = orgUsrService.getById(Long.valueOf(bizCompany[1])); OrgUsr byId = orgUsrService.getById(Long.valueOf(bizCompany[1]));
if (byId != null && byId.getBizOrgCode() != null){ if (byId != null && byId.getBizOrgCode() != null){
fireStation.setBizCompanyCode(byId.getBizOrgCode()); fireStation.setBizCompanyCode(byId.getBizOrgCode());
fireStation.setBizOrgCode(byId.getBizOrgCode());
} }
} }
if (fireStation.getPersonChargeName() != null){
String[] personChargeName = fireStation.getPersonChargeName().split("@");
fireStation.setPersonChargeName(personChargeName[0]);
fireStation.setPersonChargeId(personChargeName[1]);
}
excelEntityList.add(fireStation); excelEntityList.add(fireStation);
}); });
fireStationService.saveBatch(excelEntityList); fireStationService.saveBatch(excelEntityList);
......
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