Commit 0580fc0c authored by tangwei's avatar tangwei

修改机场人员导出模板。

parent 579c95eb
...@@ -41,7 +41,7 @@ public class OrgUsrExcelDto extends BaseDto { ...@@ -41,7 +41,7 @@ public class OrgUsrExcelDto extends BaseDto {
@ApiModelProperty(value = "amos中公司/部门ID") @ApiModelProperty(value = "amos中公司/部门ID")
private String amosOrgId; private String amosOrgId;
@ExcelIgnore @ExcelProperty(value = "关联平台用户名称", index = 38)
@ApiModelProperty(value = "amos中公司/部门编码") @ApiModelProperty(value = "amos中公司/部门编码")
private String amosOrgCode; private String amosOrgCode;
......
...@@ -36,6 +36,8 @@ public interface OrgUsrMapper extends BaseMapper<OrgUsr> { ...@@ -36,6 +36,8 @@ public interface OrgUsrMapper extends BaseMapper<OrgUsr> {
List<OrgPersonExcelDto> queryOrgPersonDtoList(boolean isDelete); List<OrgPersonExcelDto> queryOrgPersonDtoList(boolean isDelete);
List<OrgUsr> selectAmosorgCode();
/** /**
* 根据id查询当前单位下的所有子单位、部门 * 根据id查询当前单位下的所有子单位、部门
* *
......
...@@ -1075,4 +1075,11 @@ LEFT JOIN ( ...@@ -1075,4 +1075,11 @@ LEFT JOIN (
AND code = #{companyCode} AND code = #{companyCode}
</if> </if>
</select> </select>
<select id="selectAmosorgCode" resultType="com.yeejoin.amos.boot.module.common.api.entity.OrgUsr">
SELECT cb_org_usr.amos_org_id FROM cb_org_usr WHERE
cb_org_usr.is_delete=0 AND cb_org_usr.amos_org_id IS NOT NULL AND cb_org_usr.amos_org_id !=''
</select>
</mapper> </mapper>
...@@ -192,8 +192,43 @@ public class ExcelServiceImpl { ...@@ -192,8 +192,43 @@ public class ExcelServiceImpl {
public void templateExport(HttpServletResponse response, ExcelDto excelDto) throws ClassNotFoundException { public void templateExport(HttpServletResponse response, ExcelDto excelDto) throws ClassNotFoundException {
String url = excelDto.getClassUrl(); String url = excelDto.getClassUrl();
Class<?> clz = Class.forName(url); Class<?> clz = Class.forName(url);
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(), null, clz, dataSourcesImpl, //机场单位人员时填充amosuser 字段
true); if(excelDto.getType().equals("JCDWRY")){
//查询平台所有用户信息
FeignClientResult<List<AgencyUserModel>> userListResult = Privilege.agencyUserClient.list(null,null);
List<AgencyUserModel> userList = userListResult.getResult();
List<OrgUsrExcelDto> data = new ArrayList<>();
//查询已经关联的所有 用户
Set<String> set=new HashSet();
List<OrgUsr> listD=orgUsrMapper.selectAmosorgCode();
if(listD.isEmpty()){
for (OrgUsr orgUsr : listD) {
set.add(orgUsr.getAmosOrgId());
}
}
userList.stream().forEach(u -> {
if(set.isEmpty()&& set.contains(u.getUserId())){
//暂时不处理
}else{
OrgUsrExcelDto dd=new OrgUsrExcelDto();
dd.setAmosOrgCode(u.getUserId()+"@"+u.getRealName());
data.add(dd);
}
});
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(), data, clz, dataSourcesImpl,
true);
}else{
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(), null, clz, dataSourcesImpl,
true);
}
} }
public void commonExport(HttpServletResponse response, ExcelDto excelDto, Map par) { public void commonExport(HttpServletResponse response, ExcelDto excelDto, Map par) {
...@@ -722,7 +757,13 @@ public class ExcelServiceImpl { ...@@ -722,7 +757,13 @@ public class ExcelServiceImpl {
case "telephone": case "telephone":
dynamicFormInstanceDto.setFieldValue(orgUsrExcelDto.getTelephone()); dynamicFormInstanceDto.setFieldValue(orgUsrExcelDto.getTelephone());
break; break;
case "amosOrgCode":
if (orgUsrExcelDto.getAmosOrgCode() != null) {
String[] certificates = orgUsrExcelDto.getAmosOrgCode().split("@");
orgUsrExcelDto.setAmosOrgId(certificates[1]);
orgUsrExcelDto.setAmosOrgCode(certificates[0]);
}
break;
} }
DynamicFormInstance dynamicFormInstance = new DynamicFormInstance(); DynamicFormInstance dynamicFormInstance = new DynamicFormInstance();
......
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