Commit 8bf66b88 authored by 刘林's avatar 刘林

Merge remote-tracking branch 'origin/develop_tzs_bugfix' into develop_tzs_bugfix

parents 500dcdc2 5db7516e
......@@ -306,7 +306,7 @@ public class TzBaseEnterpriseInfoDto extends BaseDto {
private String cityCode;
@ApiModelProperty(value = "创建时间")
protected Date createDate;
protected String createDate;
/**
......
......@@ -36,8 +36,15 @@
<select id="page"
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(street,'/',address) AS full_address
FROM
......@@ -87,8 +94,15 @@
<select id="pageList"
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(street,'/',address) AS full_address
FROM
......@@ -123,6 +137,14 @@
AND legal_phone LIKE CONCAT('%',#{tzBaseEnterpriseInfoDto.legalPhone},'%')
</if>
<if
test="tzBaseEnterpriseInfoDto.useContact!=null and tzBaseEnterpriseInfoDto.useContact!='' ">
AND use_contact LIKE CONCAT('%',#{tzBaseEnterpriseInfoDto.useContact},'%')
</if>
<if
test="tzBaseEnterpriseInfoDto.contactPhone!=null and tzBaseEnterpriseInfoDto.contactPhone!='' ">
AND contact_phone LIKE CONCAT('%',#{tzBaseEnterpriseInfoDto.contactPhone},'%')
</if>
<if
test="tzBaseEnterpriseInfoDto.superviseOrgCode!=null and tzBaseEnterpriseInfoDto.superviseOrgCode!='' ">
AND supervise_org_code LIKE CONCAT('%',#{tzBaseEnterpriseInfoDto.superviseOrgCode},'%')
</if>
......@@ -156,7 +178,7 @@
<if test="sort != null">
${sort.field} ${sort.sortType},
</if>
rec_date DESC,sequence_nbr DESC
create_date DESC,sequence_nbr DESC
</select>
<select id="queryBaseEnterpriseInIds" resultType="com.yeejoin.amos.boot.module.jczs.api.vo.BaseEnterpriseVo">
......
......@@ -717,6 +717,7 @@ public class DataDockServiceImpl {
ESEquipmentCategoryDto equipmentCategoryDto = JSON.parseObject(toJSONString(map), ESEquipmentCategoryDto.class);
if (!ObjectUtils.isEmpty(equipmentCategoryDto)) {
long time = Timestamp.valueOf(map.get("REC_DATE").toString().substring(0, 19)).getTime();
equipmentCategoryDto.setCREATE_DATE(time);
equipmentCategoryDto.setREC_DATE(time);
equipmentCategoryDto.setSTATUS("已认领");
equipmentCategoryDto.setIS_DO_BUSINESS(Boolean.TRUE);
......@@ -2110,6 +2111,7 @@ public class DataDockServiceImpl {
ESEquipmentCategoryDto esEquipmentDto = JSON.parseObject(toJSONString(pipeline), ESEquipmentCategoryDto.class);
esEquipmentDto.setDATA_SOURCE(paramsDto.getDataSource());
esEquipmentDto.setREC_DATE(System.currentTimeMillis());
esEquipmentDto.setCREATE_DATE(System.currentTimeMillis());
esEquipmentDto.setSEQUENCE_NBR(record);
esEquipmentDto.setIS_INTO_MANAGEMENT(Boolean.TRUE);
esEquipmentDto.setEQU_CATEGORY_CODE(paramsDto.getEquCategoryCode());
......
......@@ -3745,9 +3745,8 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
}
if (!ObjectUtils.isEmpty(dto)) {
long time = Timestamp.valueOf(map.get("REC_DATE").toString().substring(0, 19)).getTime();
long now = new Date().getTime();
dto.setREC_DATE(time);
dto.setCREATE_DATE(now);
dto.setCREATE_DATE(time);
// 需要安装的设备 安装告知审批通过 清除设备的USC_UNIT_CREDIT_CODE安装单位信息
// 使用单位编辑 防止更新设备时将安改维单位信息更新到es中
CompanyBo company = getSelectedOrgInfo().getCompany();
......@@ -4142,6 +4141,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
if (inspectionDetectionInfo.getNextInspectDate() != null) {
esEquipmentDto.setNEXT_INSPECT_DATE(inspectionDetectionInfo.getNextInspectDate().getTime());
}
esEquipmentDto.setCREATE_DATE(System.currentTimeMillis());
esEquipmentDto.setREC_DATE(System.currentTimeMillis());
esEquipmentDto.setSEQUENCE_NBR(record);
esEquipmentDto.setFACTORY_NUM(factoryInfo.getFactoryNum());
......
......@@ -1239,7 +1239,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
idxBizJgUseInfoService.update(
new IdxBizJgUseInfo()
.setEstateUnitCreditCode(enterpriseInfo.getUseUnitCode())
.setEquState("1")
.setEquState(EquimentEnum.ZAIYONG.getCode().toString())
.setEstateUnitName(enterpriseInfo.getUseUnit()),
new LambdaQueryWrapper<IdxBizJgUseInfo>()
.in(IdxBizJgUseInfo::getRecord, records)
......
......@@ -32,6 +32,7 @@ import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgOtherInfo;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgRegisterInfo;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgUseInfo;
import com.yeejoin.amos.boot.module.ymt.api.enums.ApplicationFormTypeEnum;
import com.yeejoin.amos.boot.module.ymt.api.enums.EquimentEnum;
import com.yeejoin.amos.boot.module.ymt.api.enums.FlowStatusEnum;
import com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgOtherInfoMapper;
import com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgUseInfoMapper;
......@@ -455,7 +456,7 @@ public class JgChangeVehicleRegistrationUnitServiceImpl extends BaseService<JgCh
HashMap<String, Map<String, Object>> objMap = new HashMap<>();
ids.forEach(item -> {
HashMap<String, Object> param = new HashMap<>();
param.put("EQU_STATE", "1");
param.put("EQU_STATE", EquimentEnum.ZAIYONG.getCode().toString());
param.put("USE_UNIT_NAME", jgChangeVehicleRegistrationUnit.getNewUseUnitName());
param.put("USE_UNIT_CREDIT_CODE", jgChangeVehicleRegistrationUnit.getNewUseUnitCreditCode());
// 更新车用气瓶变更登记后,修改气瓶的单位内部编号为车牌号 bug23732
......@@ -595,7 +596,7 @@ public class JgChangeVehicleRegistrationUnitServiceImpl extends BaseService<JgCh
LambdaUpdateWrapper<IdxBizJgUseInfo> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.in(IdxBizJgUseInfo::getRecord, collect);
updateWrapper.set(IdxBizJgUseInfo::getUseInnerCode, jgChangeVehicleRegistrationUnit.getNewCarNumber());
updateWrapper.set(IdxBizJgUseInfo::getEquState, "1");
updateWrapper.set(IdxBizJgUseInfo::getEquState, EquimentEnum.ZAIYONG.getCode().toString());
jgUseInfoMapper.update(null, updateWrapper);
}
......
......@@ -1487,52 +1487,55 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
}).headRowNumber(2).sheet(sheetNo, sheetName).doRead();
}
}
// 存在检验不通过的数据则返回错误信息,不在向下写入库
if (!sheetError.isEmpty()) {
sendErrorContext(sheetError);
}
// 3.数据入库
dataList.forEach(data -> {
TzsUserInfoDto dto = new TzsUserInfoDto();
BeanUtils.copyProperties(data, dto);
dto.setCreateDate(new Date());
try {
this.saveUserInfo(dto);
} catch (Exception e) {
sheetError.add(dto.getName() + "-" + dto.getCertificateNum() + ":" + e.getMessage());
}
});
// 第二次捕获save中的异常
if (!sheetError.isEmpty()) {
sendErrorContext(sheetError);
}
} catch (Exception e) {
throw new RuntimeException(e);
}
// 存在检验不通过的数据则返回错误信息,不在向下写入库
if (!sheetError.isEmpty()) {
sendErrorContext(sheetError);
}
// 3.数据入库
dataList.forEach(data -> {
TzsUserInfoDto dto = new TzsUserInfoDto();
BeanUtils.copyProperties(data, dto);
dto.setCreateDate(new Date());
try {
this.saveUserInfo(dto);
} catch (Exception e) {
sheetError.add(dto.getName() + "-" + dto.getCertificateNum() + ":" + e.getMessage());
}
});
// 第二次捕获save中的异常
if (!sheetError.isEmpty()) {
sendErrorContext(sheetError);
}
return ResponseHelper.buildResponse("success");
}
private void sendErrorContext(ArrayList<String> sheetError) throws IOException {
private void sendErrorContext(ArrayList<String> sheetError) {
// 发送错误文件
String uuid = UUID.randomUUID().toString();
startDownLoadMsg("人员导入错误文件", uuid);
File tempFile = File.createTempFile("errors", ".txt");
try (FileWriter writer = new FileWriter(tempFile)) {
for (String error : sheetError) {
writer.write(error + System.lineSeparator());
try {
String uuid = UUID.randomUUID().toString();
startDownLoadMsg("人员导入错误文件", uuid);
File tempFile = File.createTempFile("errors", ".txt");
try (FileWriter writer = new FileWriter(tempFile)) {
for (String error : sheetError) {
writer.write(error + System.lineSeparator());
}
}
byte[] fileContent = Files.readAllBytes(tempFile.toPath());
MultipartFile mockMultipartFile = new MockMultipartFile("errors.txt", "errors.txt", "text/plain", fileContent);
String urlString = this.uploadExcelFile(mockMultipartFile);
sendDownLoadExcelMsg(String.format(DOWNLOAD_TOPIC, RequestContext.getToken()), new JSONObject()
.fluentPut("id", uuid)
.fluentPut("status", "done")
.fluentPut("fileName", "人员导入错误文件")
.fluentPut("url", urlString)
.fluentPut("time", new Date().getTime()));
tempFile.delete();
} finally {
throw new BadRequest("数据校验错误,详见人员导入错误文件!");
}
byte[] fileContent = Files.readAllBytes(tempFile.toPath());
MultipartFile mockMultipartFile = new MockMultipartFile("errors.txt", "errors.txt", "text/plain", fileContent);
String urlString = this.uploadExcelFile(mockMultipartFile);
sendDownLoadExcelMsg(String.format(DOWNLOAD_TOPIC, RequestContext.getToken()), new JSONObject()
.fluentPut("id", uuid)
.fluentPut("status", "done")
.fluentPut("fileName", "人员导入错误文件")
.fluentPut("url", urlString)
.fluentPut("time", new Date().getTime()));
tempFile.delete();
throw new BadRequest("校验出错,请查看错误文件!");
}
private void companyUserCheckField(ArrayList<String> sheetError, String sheetName, List<CompanyUserImportDto> dataList,
......@@ -2203,7 +2206,12 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
Map.Entry<String, JsonNode> entry = fields.next();
String postCode = entry.getKey();// 主岗位
JsonNode subPostCode = entry.getValue();// 子岗位
allPostUnderTheUnit.put(postCode, subPostCode);
// 确保最大范围包含子类型
if (subPostCode.isEmpty()){
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