Commit 2afa32bd authored by xixinzhao's avatar xixinzhao

fix(jg):安装告知补充es字段

parent 83739154
......@@ -12,6 +12,8 @@ import com.yeejoin.amos.boot.biz.common.entity.DataDictionary;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.jg.api.dto.ByteArrayMultipartFile;
import com.yeejoin.amos.boot.module.jg.api.dto.JgInstallationNoticeDto;
import com.yeejoin.amos.boot.module.jg.api.entity.JgInstallationNotice;
......@@ -58,6 +60,8 @@ import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.nio.file.Files;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.*;
......@@ -117,6 +121,9 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
@Autowired
private DataDictionaryMapper dataDictionaryMapper;
@Autowired
private RedisUtils redisUtils;
public static byte[] file2byte(File file) {
......@@ -153,6 +160,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
installationInfo.put("county", notice.getCounty() + "_" + notice.getCountyName());
installationInfo.put("useUnitCreditCode", notice.getUseUnitCreditCode() + "_" + notice.getUseUnitName());
installationInfo.put("receiveOrgCreditCode", notice.getReceiveOrgCreditCode() + "_" + notice.getReceiveOrgName());
installationInfo.put("installLeaderId", notice.getInstallLeaderId() + "_" + notice.getInstallLeaderName());
if(!ValidationUtil.isEmpty(notice.getInspectUnitId()) && !ValidationUtil.isEmpty(notice.getInspectUnitName())) {
installationInfo.put("inspectUnitId", notice.getInspectUnitId() + "_" + notice.getInspectUnitName());
}
......@@ -427,18 +435,19 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
// 获取告知设备列表
List<Map<String, Object>> deviceList = model.getDeviceList();
if (CollectionUtils.isEmpty(deviceList)) {
return;
throw new BadRequest("设备列表为空");
}
// 获取告知单号
ResponseModel<List<String>> listResponseModel = tzsServiceFeignClient.applicationFormCode(ApplicationFormTypeEnum.AZGZ.getCode(), deviceList.size());
if (!ObjectUtils.isEmpty(listResponseModel) && listResponseModel.getStatus() != HttpStatus.OK.value()) {
log.error("告知单获取失败: {}", listResponseModel.getMessage());
return;
throw new BadRequest("告知单生成失败!");
}
List<String> applyNoList = listResponseModel.getResult();
if (CollectionUtils.isEmpty(applyNoList)) {
return;
log.error("告知单返回为空");
throw new BadRequest("告知单生成失败!");
}
ArrayList<String> roleListFirst = new ArrayList<>();
......@@ -638,6 +647,15 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
model.setInspectUnitName(inspectUnitIdList[1]);
}
}
String installLeaderId = model.getInstallLeaderId();
if (!ObjectUtils.isEmpty(installLeaderId)) {
String[] leaderList = installLeaderId.split("_");
if (leaderList.length > 1) {
model.setInstallLeaderId(leaderList[0]);
model.setInstallLeaderName(leaderList[1]);
}
}
}
private String convertImageUrl(List<Map<String, String>> urlList) {
......@@ -764,13 +782,20 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
Map<String,Map<String,Object>> objMap = new HashMap<>();
map1.put("EQU_CODE",tzsJgRegistrationInfo.getEquCode() );
map1.put("SUPERVISORY_CODE",tzsJgOtherInfo.getSupervisoryCode());
map1.put("USE_UNIT_CREDIT_CODE",jgInstallationNotice.getUseUnitCreditCode());
map1.put("USE_UNIT_NAME",jgInstallationNotice.getUseUnitName());
ReginParams reginParams = JSON.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(),
RequestContext.getToken())).toString(), ReginParams.class);
map1.put("USC_UNIT_CREDIT_CODE",reginParams.getCompany().getCompanyCode());
map1.put("USC_UNIT_NAME",reginParams.getCompany().getCompanyName());
objMap.put(tzsJgOtherInfo.getRecord(),map1);
jgInstallationNotice.setPromoter("");
tzsServiceFeignClient.commonUpdateEsDataByIds(objMap);
tzsJgOtherInfoMapper.updateById(tzsJgOtherInfo);
tzsJgRegistrationInfoMapper.updateById(tzsJgRegistrationInfo);
// 更新维保备案信息表
// 更新施工信息表
IdxBizJgConstructionInfo idxBizJgConstructionInfo = constructionInfoService.queryNewestDetailByRecord(jgRelationEquip.getEquId());
if (!ObjectUtils.isEmpty(idxBizJgConstructionInfo)) {
idxBizJgConstructionInfo.setUscUnitCreditCode(jgInstallationNotice.getInstallUnitCreditCode());
......
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