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