Commit 02299408 authored by 韩桐桐's avatar 韩桐桐

bugfix

parent 4d92df65
...@@ -306,7 +306,7 @@ public class TzBaseEnterpriseInfoDto extends BaseDto { ...@@ -306,7 +306,7 @@ public class TzBaseEnterpriseInfoDto extends BaseDto {
private String cityCode; private String cityCode;
@ApiModelProperty(value = "创建时间") @ApiModelProperty(value = "创建时间")
protected Date createDate; protected String createDate;
/** /**
......
...@@ -36,8 +36,15 @@ ...@@ -36,8 +36,15 @@
<select id="page" <select id="page"
resultType="com.yeejoin.amos.boot.module.jczs.api.dto.TzBaseEnterpriseInfoDto"> resultType="com.yeejoin.amos.boot.module.jczs.api.dto.TzBaseEnterpriseInfoDto">
SELECT SELECT "sequence_nbr","use_unit_code","supervise_code","use_unit_certificate","unit_type","use_code","use_unit","supervise_org_code",
*, "supervise_org_name","key_unit","class_places","province","city","district","street","community",
"address","legal_person","legal_phone","use_contact","contact_phone","safety_one","safety_one_id","safety_one_phone",
"safety_two","safety_two_id","safety_two_phone","longitude","latitude","sync_date","sync_state","app_id","rec_date","rec_user_id",
"governing_body","data_sources","industry","registration_authority","approval_time","operating_status","mainten_person","mainten_telephone",
"sqa","quality_person","quality_telephone","technical_person","is_delete","rec_user_name","equip_category","unit_business_license","unit_exequatur",
"safety_two_photo","safety_one_photo","sqa_phone","qr_code","industry_supervisor","regulatory_labels",
"register_type","other_accessories","status" ,"org_code","office_region","office_address",
DATE_FORMAT(create_date,'%Y-%m-%d') as createDate,
CONCAT(province,'/',city,'/',district) AS region, CONCAT(province,'/',city,'/',district) AS region,
CONCAT(street,'/',address) AS full_address CONCAT(street,'/',address) AS full_address
FROM FROM
...@@ -87,8 +94,15 @@ ...@@ -87,8 +94,15 @@
<select id="pageList" <select id="pageList"
resultType="com.yeejoin.amos.boot.module.jczs.api.dto.TzBaseEnterpriseInfoDto"> resultType="com.yeejoin.amos.boot.module.jczs.api.dto.TzBaseEnterpriseInfoDto">
SELECT SELECT "sequence_nbr","use_unit_code","supervise_code","use_unit_certificate","unit_type","use_code","use_unit","supervise_org_code",
*, "supervise_org_name","key_unit","class_places","province","city","district","street","community",
"address","legal_person","legal_phone","use_contact","contact_phone","safety_one","safety_one_id","safety_one_phone",
"safety_two","safety_two_id","safety_two_phone","longitude","latitude","sync_date","sync_state","app_id","rec_date","rec_user_id",
"governing_body","data_sources","industry","registration_authority","approval_time","operating_status","mainten_person","mainten_telephone",
"sqa","quality_person","quality_telephone","technical_person","is_delete","rec_user_name","equip_category","unit_business_license","unit_exequatur",
"safety_two_photo","safety_one_photo","sqa_phone","qr_code","industry_supervisor","regulatory_labels",
"register_type","other_accessories","status" ,"org_code","office_region","office_address",
DATE_FORMAT(create_date,'%Y-%m-%d') as createDate,
CONCAT(province,'/',city,'/',district) AS region, CONCAT(province,'/',city,'/',district) AS region,
CONCAT(street,'/',address) AS full_address CONCAT(street,'/',address) AS full_address
FROM FROM
...@@ -164,7 +178,7 @@ ...@@ -164,7 +178,7 @@
<if test="sort != null"> <if test="sort != null">
${sort.field} ${sort.sortType}, ${sort.field} ${sort.sortType},
</if> </if>
rec_date DESC,sequence_nbr DESC create_date DESC,sequence_nbr DESC
</select> </select>
<select id="queryBaseEnterpriseInIds" resultType="com.yeejoin.amos.boot.module.jczs.api.vo.BaseEnterpriseVo"> <select id="queryBaseEnterpriseInIds" resultType="com.yeejoin.amos.boot.module.jczs.api.vo.BaseEnterpriseVo">
......
...@@ -1487,6 +1487,9 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI ...@@ -1487,6 +1487,9 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
}).headRowNumber(2).sheet(sheetNo, sheetName).doRead(); }).headRowNumber(2).sheet(sheetNo, sheetName).doRead();
} }
} }
} catch (Exception e) {
throw new RuntimeException(e);
}
// 存在检验不通过的数据则返回错误信息,不在向下写入库 // 存在检验不通过的数据则返回错误信息,不在向下写入库
if (!sheetError.isEmpty()) { if (!sheetError.isEmpty()) {
sendErrorContext(sheetError); sendErrorContext(sheetError);
...@@ -1506,14 +1509,12 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI ...@@ -1506,14 +1509,12 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
if (!sheetError.isEmpty()) { if (!sheetError.isEmpty()) {
sendErrorContext(sheetError); sendErrorContext(sheetError);
} }
} catch (Exception e) {
throw new RuntimeException(e);
}
return ResponseHelper.buildResponse("success"); return ResponseHelper.buildResponse("success");
} }
private void sendErrorContext(ArrayList<String> sheetError) throws IOException { private void sendErrorContext(ArrayList<String> sheetError) {
// 发送错误文件 // 发送错误文件
try {
String uuid = UUID.randomUUID().toString(); String uuid = UUID.randomUUID().toString();
startDownLoadMsg("人员导入错误文件", uuid); startDownLoadMsg("人员导入错误文件", uuid);
File tempFile = File.createTempFile("errors", ".txt"); File tempFile = File.createTempFile("errors", ".txt");
...@@ -1532,7 +1533,9 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI ...@@ -1532,7 +1533,9 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
.fluentPut("url", urlString) .fluentPut("url", urlString)
.fluentPut("time", new Date().getTime())); .fluentPut("time", new Date().getTime()));
tempFile.delete(); tempFile.delete();
throw new BadRequest("校验出错,请查看错误文件!"); } finally {
throw new BadRequest("数据校验错误,详见人员导入错误文件!");
}
} }
private void companyUserCheckField(ArrayList<String> sheetError, String sheetName, List<CompanyUserImportDto> dataList, private void companyUserCheckField(ArrayList<String> sheetError, String sheetName, List<CompanyUserImportDto> dataList,
...@@ -2203,7 +2206,12 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI ...@@ -2203,7 +2206,12 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
Map.Entry<String, JsonNode> entry = fields.next(); Map.Entry<String, JsonNode> entry = fields.next();
String postCode = entry.getKey();// 主岗位 String postCode = entry.getKey();// 主岗位
JsonNode subPostCode = entry.getValue();// 子岗位 JsonNode subPostCode = entry.getValue();// 子岗位
// 确保最大范围包含子类型
if (subPostCode.isEmpty()){
allPostUnderTheUnit.put(postCode, subPostCode); allPostUnderTheUnit.put(postCode, subPostCode);
}else {
allPostUnderTheUnit.putIfAbsent(postCode, subPostCode);
}
} }
} }
}); });
......
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