Commit 1cf7d7af authored by yangyang's avatar yangyang

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

parents e50e227b 97797e4b
package com.yeejoin.amos.boot.module.jg.api.service; package com.yeejoin.amos.boot.module.jg.api.service;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.jg.api.dto.JgChangeRegistrationReformDto;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/** /**
* 改造变更登记接口类 * 改造变更登记接口类
* *
...@@ -8,5 +16,12 @@ package com.yeejoin.amos.boot.module.jg.api.service; ...@@ -8,5 +16,12 @@ package com.yeejoin.amos.boot.module.jg.api.service;
* @date 2023-12-20 * @date 2023-12-20
*/ */
public interface IJgChangeRegistrationReformService { public interface IJgChangeRegistrationReformService {
Page<Map<String, Object>> getList(JgChangeRegistrationReformDto dto, Page<Map<String, Object>> page, List<String> roleIds);
void save(JSONObject map);
void updateExecuteIds(String instanceId, Long sequenceNbr, String operate);
void flowExecute(Long id, String instanceId, String operate, String comment);
void withdraw(String instanceId);
void deleteBatch(List<Long> ids);
Map<String, Object> getDetail(String currentDocumentId, String equipId);
void exportUseRegistrationCertificate(String sequenceNbr, HttpServletResponse response);
} }
...@@ -99,7 +99,6 @@ ...@@ -99,7 +99,6 @@
fi.factory_standard AS factoryStandard, fi.factory_standard AS factoryStandard,
fi.product_quality_yield_prove AS productQualityYieldProve, fi.product_quality_yield_prove AS productQualityYieldProve,
fi.ins_use_maintain_explain AS insUseMaintainExplain, fi.ins_use_maintain_explain AS insUseMaintainExplain,
ui.safety_manager AS safetyManager,
ei.legal_person AS safetyManager, ei.legal_person AS safetyManager,
ei.legal_phone AS safetyManagerPhone, ei.legal_phone AS safetyManagerPhone,
ui.CITY_NAME AS useUnitCityName, ui.CITY_NAME AS useUnitCityName,
......
...@@ -25,6 +25,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; ...@@ -25,6 +25,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
import javax.servlet.http.HttpServletResponse;
/** /**
* 改造变更登记 * 改造变更登记
* *
...@@ -130,10 +132,9 @@ public class JgChangeRegistrationReformController extends BaseController { ...@@ -130,10 +132,9 @@ public class JgChangeRegistrationReformController extends BaseController {
} }
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "打印历史数据", notes = "打印历史数据") @GetMapping(value = "/export")
@GetMapping(value = "/printHistoryData") @ApiOperation(httpMethod = "GET", value = "改造登记-导出使用登记证", notes = "改造登记-导出使用登记证")
public ResponseModel<Map<String, Object>> printHistoryData(@RequestParam("currentDocumentId") String currentDocumentId,@RequestParam(value = "equipId",required = false) String equipId) { public void exportImageZip(HttpServletResponse response, @RequestParam("sequenceNbr") String sequenceNbr){
return ResponseHelper.buildResponse(jgChangeRegistrationReformServiceImpl.getDetail(currentDocumentId,equipId)); jgChangeRegistrationReformServiceImpl.exportUseRegistrationCertificate(sequenceNbr, response);
} }
} }
...@@ -27,13 +27,11 @@ import org.springframework.util.CollectionUtils; ...@@ -27,13 +27,11 @@ import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import org.typroject.tyboot.core.foundation.context.RequestContext; import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.ByteArrayInputStream;
import java.io.File; import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.io.InputStream;
import java.nio.file.Files; import java.nio.file.Files;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -99,16 +97,20 @@ public class CommonServiceImpl implements ICommonService { ...@@ -99,16 +97,20 @@ public class CommonServiceImpl implements ICommonService {
public List<EquipmentCategory> getEquipmentCategoryList(String code, String type) { public List<EquipmentCategory> getEquipmentCategoryList(String code, String type) {
List<EquipmentCategory> result = new ArrayList<>(); List<EquipmentCategory> result = new ArrayList<>();
LambdaQueryWrapper<EquipmentCategory> wrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<EquipmentCategory> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(EquipmentCategory::getCode, code); wrapper.eq(EquipmentCategory::getCode, code);
EquipmentCategory equipmentCategory = equipmentCategoryMapper.selectOne(wrapper); EquipmentCategory equipmentCategory = equipmentCategoryMapper.selectOne(wrapper);
if (ObjectUtils.isEmpty(type)) { if (ObjectUtils.isEmpty(type)) {
result.add(equipmentCategory); if(!ValidationUtil.isEmpty(equipmentCategory)){
result.add(equipmentCategory);
}
} else { } else {
LambdaQueryWrapper<EquipmentCategory> wrapper2 = new LambdaQueryWrapper<>(); LambdaQueryWrapper<EquipmentCategory> wrapper2 = new LambdaQueryWrapper<>();
wrapper2.eq(EquipmentCategory::getParentId, equipmentCategory.getId()); wrapper2.eq(EquipmentCategory::getParentId, equipmentCategory.getId());
result = equipmentCategoryMapper.selectList(wrapper2); List<EquipmentCategory> equipmentCategories = equipmentCategoryMapper.selectList(wrapper2);
if(!ValidationUtil.isEmpty(equipmentCategories)){
result = equipmentCategories;
}
} }
return result; return result;
} }
......
...@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject; ...@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.StringUtils; import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.CompanyBo;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey; import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
...@@ -12,17 +13,13 @@ import com.yeejoin.amos.boot.module.jg.api.enums.ConstructionEnum; ...@@ -12,17 +13,13 @@ import com.yeejoin.amos.boot.module.jg.api.enums.ConstructionEnum;
import com.yeejoin.amos.boot.module.jg.biz.dao.ESEquipmentCategory; import com.yeejoin.amos.boot.module.jg.biz.dao.ESEquipmentCategory;
import com.yeejoin.amos.boot.module.jg.biz.service.*; import com.yeejoin.amos.boot.module.jg.biz.service.*;
import com.yeejoin.amos.boot.module.ymt.api.dto.ESEquipmentCategoryDto; import com.yeejoin.amos.boot.module.ymt.api.dto.ESEquipmentCategoryDto;
import com.yeejoin.amos.boot.module.ymt.api.dto.IdxBizJgConstructionInfoDto;
import com.yeejoin.amos.boot.module.ymt.api.dto.IdxBizJgInspectionDetectionInfoDto;
import com.yeejoin.amos.boot.module.ymt.api.dto.IdxBizJgMainPartsDto;
import com.yeejoin.amos.boot.module.ymt.api.dto.IdxBizJgMaintenanceRecordInfoDto;
import com.yeejoin.amos.boot.module.ymt.api.dto.IdxBizJgProtectionDevicesDto;
import com.yeejoin.amos.boot.module.ymt.api.dto.IdxBizJgRegisterInfoDto; import com.yeejoin.amos.boot.module.ymt.api.dto.IdxBizJgRegisterInfoDto;
import com.yeejoin.amos.boot.module.ymt.api.entity.*; import com.yeejoin.amos.boot.module.ymt.api.entity.*;
import com.yeejoin.amos.boot.module.ymt.api.enums.EquimentEnum; import com.yeejoin.amos.boot.module.ymt.api.enums.EquimentEnum;
import com.yeejoin.amos.boot.module.ymt.api.mapper.CategoryOtherInfoMapper; import com.yeejoin.amos.boot.module.ymt.api.mapper.CategoryOtherInfoMapper;
import com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgRegisterInfoMapper; import com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgRegisterInfoMapper;
import com.yeejoin.amos.boot.module.ymt.api.mapper.SuperviseInfoMapper; import com.yeejoin.amos.boot.module.ymt.api.mapper.SuperviseInfoMapper;
import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.CompanyModel; import com.yeejoin.amos.feign.privilege.model.CompanyModel;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.lucene.queryparser.classic.QueryParser; import org.apache.lucene.queryparser.classic.QueryParser;
...@@ -30,7 +27,6 @@ import org.elasticsearch.action.search.SearchRequest; ...@@ -30,7 +27,6 @@ import org.elasticsearch.action.search.SearchRequest;
import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.client.RequestOptions; import org.elasticsearch.client.RequestOptions;
import org.elasticsearch.client.RestHighLevelClient; import org.elasticsearch.client.RestHighLevelClient;
import org.elasticsearch.common.recycler.Recycler;
import org.elasticsearch.index.query.BoolQueryBuilder; import org.elasticsearch.index.query.BoolQueryBuilder;
import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.index.query.QueryBuilders;
import org.elasticsearch.search.builder.SearchSourceBuilder; import org.elasticsearch.search.builder.SearchSourceBuilder;
...@@ -69,13 +65,6 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -69,13 +65,6 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
private static final String EQUDEFINE = "EQU_DEFINE"; private static final String EQUDEFINE = "EQU_DEFINE";
private static final String EQUDEFINECODE = "EQU_DEFINE_CODE"; private static final String EQUDEFINECODE = "EQU_DEFINE_CODE";
/**
* levlel=company,是企业,如果不是都是监管单位,
* * 在接口中查询当前登录人所属单位是监管单位还是企业。
* * 如果为监管单位添加监管机构查询参数(ORG_BRANCH_CODE);
* * 如果为企业添加使用单位查询参数(USE_UNIT_CREDIT_CODE)
*/
private static final String LEVEL = "company";
// 新增修改标识 // 新增修改标识
private static final String OPERATESAVE = "save"; private static final String OPERATESAVE = "save";
private static final String OPERATEEDIT = "edit"; private static final String OPERATEEDIT = "edit";
...@@ -123,6 +112,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -123,6 +112,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
@Autowired @Autowired
private SuperviseInfoMapper superviseInfoMapper; private SuperviseInfoMapper superviseInfoMapper;
/** /**
* 设备注册信息 * 设备注册信息
* *
...@@ -541,53 +531,32 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -541,53 +531,32 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
builder.trackTotalHits(true); builder.trackTotalHits(true);
BoolQueryBuilder boolMust = QueryBuilders.boolQuery(); BoolQueryBuilder boolMust = QueryBuilders.boolQuery();
//获取当前登录人单位类型
JSONObject company = getCompanyType();
if (ValidationUtil.isEmpty(company)) {
result.setRecords(new ArrayList<>());
result.setTotal(0);
return result;
}
String companyCode = company.getString("companyCode").contains("_") ?
company.getString("companyCode").split("_")[1] : company.getString("companyCode");
String type = company.getString("companyType");
if (ValidationUtil.isEmpty(type) || ValidationUtil.isEmpty(companyCode)) {
result.setRecords(new ArrayList<>());
result.setTotal(0);
return result;
}
//根据当前登录人查询 //根据当前登录人查询
if (!ValidationUtil.isEmpty(map.get(EQUSTATE))) { if (!ValidationUtil.isEmpty(map.get(EQUSTATE))) {
map.put(EQUSTATE, EquimentEnum.getCode.get(map.get(EQUSTATE).toString()).toString()); map.put(EQUSTATE, EquimentEnum.getCode.get(map.get(EQUSTATE).toString()).toString());
} }
//获取当前登录人单位类型
List<JSONObject> companyType = getCompanyType();
if (!ValidationUtil.isEmpty(companyType)) {
JSONObject object = getCompanyType().get(0);
String level = object.getString("level");
String code = object.getString("orgCode");
String companyCode = object.getString("companyCode").contains("_") ?
object.getString("companyCode").split("_")[1] : object.getString("companyCode");
String type = object.getString("companyType");
// 根据当前登录用户类型及管辖机构筛选条件添加对应参数
if (!ValidationUtil.isEmpty(level)) {
if (LEVEL.equals(level)) {
//企业
if (!ValidationUtil.isEmpty(type) && ValidationUtil.equals(type, "使用单位")) {
map.put("USE_UNIT_CREDIT_CODE", companyCode);
} else if (!ValidationUtil.isEmpty(type) && ValidationUtil.equals(type, "安装改造维修单位")) {
map.put("USC_UNIT_CREDIT_CODE", companyCode);
}
if (!ObjectUtils.isEmpty(map.getString("ORG_BRANCH_CODE"))) { // 根据当前登录用户类型及管辖机构筛选条件添加对应参数
BoolQueryBuilder query = QueryBuilders.boolQuery(); if (!ValidationUtil.isEmpty(type) && ValidationUtil.equals(type, "使用单位")) {
String test = QueryParser.escape(map.getString("ORG_BRANCH_CODE")); map.put("USE_UNIT_CREDIT_CODE", companyCode);
query.must(QueryBuilders.matchPhrasePrefixQuery("ORG_BRANCH_CODE", test)); } else if (!ValidationUtil.isEmpty(type) && ValidationUtil.equals(type, "安装改造维修单位")) {
boolMust.must(query); map.put("USC_UNIT_CREDIT_CODE", companyCode);
}
} else {
if (!ObjectUtils.isEmpty(map.getString("ORG_BRANCH_CODE"))) {
String paramCode = map.getString("ORG_BRANCH_CODE");
if (paramCode.contains(code)) {
BoolQueryBuilder query = QueryBuilders.boolQuery();
String test = QueryParser.escape(map.getString("ORG_BRANCH_CODE"));
query.must(QueryBuilders.matchPhrasePrefixQuery("ORG_BRANCH_CODE", test));
boolMust.must(query);
} else {
return result;
}
} else {
//监管单位
map.put("ORG_BRANCH_CODE", code);
}
}
}
} }
// 默认条件【STATUS==="" || null】 // 默认条件【STATUS==="" || null】
...@@ -732,23 +701,22 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -732,23 +701,22 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
* *
* @return * @return
*/ */
public List<JSONObject> getCompanyType() { public JSONObject getCompanyType() {
ReginParams reginParams = JSON.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class); ReginParams reginParams = JSONObject.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class);
List<CompanyModel> companys = reginParams.getUserModel().getCompanys(); CompanyBo company = reginParams.getCompany();
List<JSONObject> objectList = new ArrayList<>(); JSONObject object = new JSONObject();
if (!ValidationUtil.isEmpty(companys)) { if (!ValidationUtil.isEmpty(company)) {
for (CompanyModel company : companys) { object.put("level", company.getLevel());
JSONObject object = new JSONObject(); object.put("orgCode", company.getOrgCode());
object.put("level", company.getLevel()); object.put("companyCode", company.getCompanyCode());
object.put("orgCode", company.getOrgCode()); CompanyModel result = Privilege.companyClient.queryByCompanyCode(company.getCompanyCode()).getResult();
object.put("companyCode", company.getCompanyCode()); if(!ValidationUtil.isEmpty(result)){
object.put("companyType", company.getCompanyType()); object.put("companyType", result.getCompanyType());
objectList.add(object);
} }
} }
return objectList; return object;
} }
private String batchSubmitOrUpdate(Map<String, Object> map) { private String batchSubmitOrUpdate(Map<String, Object> map) {
......
...@@ -15,13 +15,13 @@ import com.yeejoin.amos.boot.module.jg.api.enums.WorkFlowStatusEnum; ...@@ -15,13 +15,13 @@ import com.yeejoin.amos.boot.module.jg.api.enums.WorkFlowStatusEnum;
import com.yeejoin.amos.boot.module.jg.api.mapper.*; import com.yeejoin.amos.boot.module.jg.api.mapper.*;
import com.yeejoin.amos.boot.module.jg.api.service.IJgChangeRegistrationReformService; import com.yeejoin.amos.boot.module.jg.api.service.IJgChangeRegistrationReformService;
import com.yeejoin.amos.boot.module.jg.api.dto.JgChangeRegistrationReformDto; import com.yeejoin.amos.boot.module.jg.api.dto.JgChangeRegistrationReformDto;
import com.yeejoin.amos.boot.module.jg.api.service.IJgRegistrationHistoryService;
import com.yeejoin.amos.boot.module.jg.biz.feign.TzsServiceFeignClient; import com.yeejoin.amos.boot.module.jg.biz.feign.TzsServiceFeignClient;
import com.yeejoin.amos.boot.module.jg.biz.service.ICommonService;
import com.yeejoin.amos.boot.module.jg.biz.service.IIdxBizJgRegisterInfoService; import com.yeejoin.amos.boot.module.jg.biz.service.IIdxBizJgRegisterInfoService;
import com.yeejoin.amos.boot.module.jg.biz.service.IIdxBizJgUseInfoService;
import com.yeejoin.amos.boot.module.jg.flc.api.fegin.WorkFlowFeignService; import com.yeejoin.amos.boot.module.jg.flc.api.fegin.WorkFlowFeignService;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgTechParamsElevator; import com.yeejoin.amos.boot.module.ymt.api.entity.*;
import com.yeejoin.amos.boot.module.ymt.api.entity.InspectionDetectionInfo;
import com.yeejoin.amos.boot.module.ymt.api.entity.OtherInfo;
import com.yeejoin.amos.boot.module.ymt.api.entity.UseInfo;
import com.yeejoin.amos.boot.module.ymt.api.enums.ApplicationFormTypeEnum; import com.yeejoin.amos.boot.module.ymt.api.enums.ApplicationFormTypeEnum;
import com.yeejoin.amos.boot.module.ymt.api.enums.FlowStatusEnum; import com.yeejoin.amos.boot.module.ymt.api.enums.FlowStatusEnum;
import com.yeejoin.amos.boot.module.ymt.api.mapper.*; import com.yeejoin.amos.boot.module.ymt.api.mapper.*;
...@@ -30,15 +30,20 @@ import com.yeejoin.amos.feign.workflow.Workflow; ...@@ -30,15 +30,20 @@ import com.yeejoin.amos.feign.workflow.Workflow;
import com.yeejoin.amos.feign.workflow.model.ActWorkflowStartDTO; import com.yeejoin.amos.feign.workflow.model.ActWorkflowStartDTO;
import com.yeejoin.amos.feign.workflow.model.AjaxResult; import com.yeejoin.amos.feign.workflow.model.AjaxResult;
import com.yeejoin.amos.feign.workflow.model.TaskResultDTO; import com.yeejoin.amos.feign.workflow.model.TaskResultDTO;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.context.RequestContext; import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest; 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 javax.servlet.http.HttpServletResponse;
import java.time.LocalDate;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -51,15 +56,22 @@ import java.util.stream.Collectors; ...@@ -51,15 +56,22 @@ import java.util.stream.Collectors;
@Service @Service
public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeRegistrationReformDto, JgChangeRegistrationReform, JgChangeRegistrationReformMapper> implements IJgChangeRegistrationReformService { public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeRegistrationReformDto, JgChangeRegistrationReform, JgChangeRegistrationReformMapper> implements IJgChangeRegistrationReformService {
@Autowired @Autowired
IIdxBizJgRegisterInfoService idxBizJgRegisterInfoService;
@Autowired
WorkFlowFeignService workFlowFeginService; WorkFlowFeignService workFlowFeginService;
@Autowired @Autowired
TzsServiceFeignClient tzsServiceFeignClient; TzsServiceFeignClient tzsServiceFeignClient;
@Autowired @Autowired
RedisUtils redisUtils; RedisUtils redisUtils;
@Autowired @Autowired
ICommonService commonService;
@Autowired
private IIdxBizJgUseInfoService useInfoService;
@Autowired
private IdxBizJgUseInfoServiceImpl idxBizJgUseInfoService;
@Autowired
private IdxBizJgRegisterInfoServiceImpl idxBizJgRegisterInfoService;
@Autowired
private IdxBizJgFactoryInfoServiceImpl idxBizJgFactoryInfoService;
@Autowired
private UseInfoMapper useInfoMapper; private UseInfoMapper useInfoMapper;
@Autowired @Autowired
private InspectionDetectionInfoMapper inspectionDetectionInfoMapper; private InspectionDetectionInfoMapper inspectionDetectionInfoMapper;
...@@ -88,6 +100,8 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR ...@@ -88,6 +100,8 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
//更名变更登记关系表mapper //更名变更登记关系表mapper
@Autowired @Autowired
private JgChangeRegistrationNameEqMapper jgChangeRegistrationNameEqMapper; private JgChangeRegistrationNameEqMapper jgChangeRegistrationNameEqMapper;
@Autowired
private IJgRegistrationHistoryService jgRegistrationHistoryService;
/** /**
* 分页查询 * 分页查询
...@@ -106,9 +120,9 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR ...@@ -106,9 +120,9 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
ReginParams reginParams = JSONObject.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class); ReginParams reginParams = JSONObject.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class);
UseInfo useInfo = new UseInfo(); UseInfo useInfo = new UseInfo();
BeanUtil.copyProperties(map, useInfo); BeanUtil.copyProperties(map, useInfo);
String equipId = map.get("record").toString(); String equipId = map.get("record").toString();
LambdaQueryWrapper<UseInfo> lambda = new QueryWrapper<UseInfo>().lambda(); LambdaQueryWrapper<UseInfo> lambda = new QueryWrapper<UseInfo>().lambda();
lambda.eq(UseInfo::getRecord,equipId); lambda.eq(UseInfo::getRecord, equipId);
// 更新使用信息 // 更新使用信息
useInfoMapper.update(useInfo, lambda); useInfoMapper.update(useInfo, lambda);
InspectionDetectionInfo inspectionDetectionInfo = new InspectionDetectionInfo(); InspectionDetectionInfo inspectionDetectionInfo = new InspectionDetectionInfo();
...@@ -126,10 +140,10 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR ...@@ -126,10 +140,10 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
jgChangeRegistrationReform.setSupervisoryCode(supervisoryCode); jgChangeRegistrationReform.setSupervisoryCode(supervisoryCode);
jgChangeRegistrationReform.setUseUnitName(useInfo.getUseUnitName()); jgChangeRegistrationReform.setUseUnitName(useInfo.getUseUnitName());
jgChangeRegistrationReform.setUseUnitCreditCode(useInfo.getUseUnitCreditCode()); jgChangeRegistrationReform.setUseUnitCreditCode(useInfo.getUseUnitCreditCode());
if(!ObjectUtils.isEmpty(map.get("transformationQualityCertificate"))){ if (!ObjectUtils.isEmpty(map.get("transformationQualityCertificate"))) {
jgChangeRegistrationReform.setTransformationQualityCertificate(JSONObject.toJSONString(map.get("transformationQualityCertificate"))); jgChangeRegistrationReform.setTransformationQualityCertificate(JSONObject.toJSONString(map.get("transformationQualityCertificate")));
} }
if(!ObjectUtils.isEmpty(map.get("renovationSupervisioninspectionCertificate"))) { if (!ObjectUtils.isEmpty(map.get("renovationSupervisioninspectionCertificate"))) {
jgChangeRegistrationReform.setRenovationSupervisioninspectionCertificate(JSONObject.toJSONString(map.get("renovationSupervisioninspectionCertificate"))); jgChangeRegistrationReform.setRenovationSupervisioninspectionCertificate(JSONObject.toJSONString(map.get("renovationSupervisioninspectionCertificate")));
} }
// 使用单位提交 // 使用单位提交
...@@ -145,7 +159,7 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR ...@@ -145,7 +159,7 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
jgChangeRegistrationReform.setInspectUnitName(reginParams.getCompany().getCompanyName()); jgChangeRegistrationReform.setInspectUnitName(reginParams.getCompany().getCompanyName());
} }
if (map.containsKey("receiveCompanyCode")) { if (map.containsKey("receiveCompanyCode")) {
String receiveCompanyCode = String.valueOf(map.getString("receiveCompanyCode")); String receiveCompanyCode = String.valueOf(map.getString("receiveCompanyCode"));
jgChangeRegistrationReform.setReceiveCompanyCode(receiveCompanyCode); jgChangeRegistrationReform.setReceiveCompanyCode(receiveCompanyCode);
jgChangeRegistrationReform.setReceiveOrgCode(receiveCompanyCode.split("_")[0]); jgChangeRegistrationReform.setReceiveOrgCode(receiveCompanyCode.split("_")[0]);
jgChangeRegistrationReform.setReceiveOrgName(receiveCompanyCode.split("_")[1]); jgChangeRegistrationReform.setReceiveOrgName(receiveCompanyCode.split("_")[1]);
...@@ -174,18 +188,18 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR ...@@ -174,18 +188,18 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
jgChangeRegistrationReform.setUseUnitCreditCode(null); jgChangeRegistrationReform.setUseUnitCreditCode(null);
jgChangeRegistrationReform.setSequenceNbr(Long.valueOf(String.valueOf(map.get("sequenceNbr")))); jgChangeRegistrationReform.setSequenceNbr(Long.valueOf(String.valueOf(map.get("sequenceNbr"))));
this.getBaseMapper().updateById(jgChangeRegistrationReform); this.getBaseMapper().updateById(jgChangeRegistrationReform);
jgRegistrationHistory.setSequenceNbr(jgRegistrationHistoryMapper.getSequenceNbrByEquidAndDocumentId(equipId, String.valueOf(map.get("sequenceNbr")))); jgRegistrationHistory.setSequenceNbr(jgRegistrationHistoryMapper.getSequenceNbrByEquidAndDocumentId(equipId, jgChangeRegistrationReform.getApplyNo()));
jgRegistrationHistoryMapper.updateById(jgRegistrationHistory); jgRegistrationHistoryMapper.updateById(jgRegistrationHistory);
} else { } else {
// 业务管理设备信息保存 // 业务管理设备信息保存
JgChangeRegistrationReformEq jgChangeRegistrationReformEq = new JgChangeRegistrationReformEq(); JgChangeRegistrationReformEq jgChangeRegistrationReformEq = new JgChangeRegistrationReformEq();
jgChangeRegistrationReformEq.setEquId(equipId); jgChangeRegistrationReformEq.setEquId(equipId);
ResponseModel<List<String>> result =tzsServiceFeignClient.applicationFormCode(ApplicationFormTypeEnum.GZBG.getCode(), 1); ResponseModel<List<String>> result = tzsServiceFeignClient.applicationFormCode(ApplicationFormTypeEnum.GZBG.getCode(), 1);
if(!result.getResult().isEmpty()){ if (!result.getResult().isEmpty()) {
jgChangeRegistrationReform.setApplyNo(result.getResult().get(0)); jgChangeRegistrationReform.setApplyNo(result.getResult().get(0));
}else { } else {
throw new BadRequest("申请单编号生成失败,请稍后重试!"); throw new BadRequest("申请单编号生成失败,请稍后重试!");
} }
jgChangeRegistrationReform.setAuditStatus(WorkFlowStatusEnum.CHANGE_SUBMIT.getPass()); jgChangeRegistrationReform.setAuditStatus(WorkFlowStatusEnum.CHANGE_SUBMIT.getPass());
jgChangeRegistrationReform.setStatus(WorkFlowStatusEnum.CHANGE_SUBMIT.getPass()); jgChangeRegistrationReform.setStatus(WorkFlowStatusEnum.CHANGE_SUBMIT.getPass());
...@@ -222,7 +236,7 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR ...@@ -222,7 +236,7 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
//启动流程 //启动流程
try { try {
ActWorkflowStartDTO dto = new ActWorkflowStartDTO(); ActWorkflowStartDTO dto = new ActWorkflowStartDTO();
dto.setProcessDefinitionKey("renovationRegistrationReview"); dto.setProcessDefinitionKey("renovationRegistrationReviewNew");
dto.setBusinessKey("submit"); dto.setBusinessKey("submit");
AjaxResult ajaxResult = Workflow.taskClient.startByVariable(dto); AjaxResult ajaxResult = Workflow.taskClient.startByVariable(dto);
instanceId = ((Map) ajaxResult.get("data")).get("id").toString(); instanceId = ((Map) ajaxResult.get("data")).get("id").toString();
...@@ -287,7 +301,7 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR ...@@ -287,7 +301,7 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
JgChangeRegistrationReformEq jgChangeRegistrationReformEq = jgChangeRegistrationReformEqMapper.selectOne(new QueryWrapper<JgChangeRegistrationReformEq>().eq("equip_transfer_id", jgChangeRegistrationReform.getSequenceNbr())); JgChangeRegistrationReformEq jgChangeRegistrationReformEq = jgChangeRegistrationReformEqMapper.selectOne(new QueryWrapper<JgChangeRegistrationReformEq>().eq("equip_transfer_id", jgChangeRegistrationReform.getSequenceNbr()));
String newUseRegistrationCertificateNumber = getCode(jgChangeRegistrationReform.getSupervisoryCode()); String newUseRegistrationCertificateNumber = getCode(jgChangeRegistrationReform.getSupervisoryCode());
jgChangeRegistrationReform.setUseRegistrationCode(newUseRegistrationCertificateNumber); jgChangeRegistrationReform.setUseRegistrationCode(newUseRegistrationCertificateNumber);
updateTechparamsByEquIdAndCurrentDoucumentId(jgChangeRegistrationReformEq.getEquId(), jgChangeRegistrationReform.getSequenceNbr().toString(),newUseRegistrationCertificateNumber,jgChangeRegistrationReform.getApplyNo() ); updateTechparamsByEquIdAndCurrentDoucumentId(jgChangeRegistrationReformEq.getEquId(), jgChangeRegistrationReform.getSequenceNbr().toString(), newUseRegistrationCertificateNumber, jgChangeRegistrationReform.getApplyNo());
} }
this.getBaseMapper().updateById(jgChangeRegistrationReform); this.getBaseMapper().updateById(jgChangeRegistrationReform);
} }
...@@ -428,8 +442,8 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR ...@@ -428,8 +442,8 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
} }
public void deleteBatch(List<Long> ids) { public void deleteBatch(List<Long> ids) {
List<JgChangeRegistrationReform> jgChangeRegistrationReformList = this.getBaseMapper().selectList(new QueryWrapper<JgChangeRegistrationReform>().in("sequence_nbr", ids)); List<JgChangeRegistrationReform> jgChangeRegistrationReformList = this.getBaseMapper().selectList(new QueryWrapper<JgChangeRegistrationReform>().in("sequence_nbr", ids));
List<String> applyNos =jgChangeRegistrationReformList.stream().map(JgChangeRegistrationReform::getApplyNo).collect(Collectors.toList()); List<String> applyNos = jgChangeRegistrationReformList.stream().map(JgChangeRegistrationReform::getApplyNo).collect(Collectors.toList());
JgChangeRegistrationReform jgChangeRegistrationReform = new JgChangeRegistrationReform(); JgChangeRegistrationReform jgChangeRegistrationReform = new JgChangeRegistrationReform();
jgChangeRegistrationReform.setIsDelete(true); jgChangeRegistrationReform.setIsDelete(true);
LambdaQueryWrapper<JgChangeRegistrationReform> lambda = new QueryWrapper<JgChangeRegistrationReform>().lambda(); LambdaQueryWrapper<JgChangeRegistrationReform> lambda = new QueryWrapper<JgChangeRegistrationReform>().lambda();
...@@ -445,7 +459,7 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR ...@@ -445,7 +459,7 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
public Map<String, Object> getDetail(String currentDocumentId, String equipId) { public Map<String, Object> getDetail(String currentDocumentId, String equipId) {
JgChangeRegistrationReform jgChangeRegistrationReform = this.getBaseMapper().selectById(currentDocumentId); JgChangeRegistrationReform jgChangeRegistrationReform = this.getBaseMapper().selectById(currentDocumentId);
if(ObjectUtils.isEmpty(equipId)){ if (ObjectUtils.isEmpty(equipId)) {
equipId = jgChangeRegistrationReformEqMapper.selectEquipId(currentDocumentId); equipId = jgChangeRegistrationReformEqMapper.selectEquipId(currentDocumentId);
} }
Map<String, Object> detail = JSONObject.parseObject(JSONObject.toJSONString(jgChangeRegistrationReform), Map.class); Map<String, Object> detail = JSONObject.parseObject(JSONObject.toJSONString(jgChangeRegistrationReform), Map.class);
...@@ -454,10 +468,10 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR ...@@ -454,10 +468,10 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
if ((detail.get("status").equals("已完成") || detail.get("status").equals("流程结束"))) { if ((detail.get("status").equals("已完成") || detail.get("status").equals("流程结束"))) {
originalData = idxBizJgRegisterInfoService.getDetailFieldCamelCaseByRecord(equipId); originalData = idxBizJgRegisterInfoService.getDetailFieldCamelCaseByRecord(equipId);
originalData.remove("sequenceNbr"); originalData.remove("sequenceNbr");
if(!ObjectUtils.isEmpty(detail.get("transformationQualityCertificate"))){ if (!ObjectUtils.isEmpty(detail.get("transformationQualityCertificate"))) {
detail.put("transformationQualityCertificate", JSONObject.parse(detail.get("transformationQualityCertificate").toString())); detail.put("transformationQualityCertificate", JSONObject.parse(detail.get("transformationQualityCertificate").toString()));
} }
if(!ObjectUtils.isEmpty(detail.get("renovationSupervisioninspectionCertificate"))){ if (!ObjectUtils.isEmpty(detail.get("renovationSupervisioninspectionCertificate"))) {
detail.put("renovationSupervisioninspectionCertificate", JSONObject.parse(detail.get("renovationSupervisioninspectionCertificate").toString())); detail.put("renovationSupervisioninspectionCertificate", JSONObject.parse(detail.get("renovationSupervisioninspectionCertificate").toString()));
} }
} else { } else {
...@@ -495,7 +509,7 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR ...@@ -495,7 +509,7 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
* @param equipId * @param equipId
* @param currentDocumentId * @param currentDocumentId
*/ */
public void updateTechparamsByEquIdAndCurrentDoucumentId(String equipId, String currentDocumentId, String newUseRegistrationCertificateNumber,String applyNo) { public void updateTechparamsByEquIdAndCurrentDoucumentId(String equipId, String currentDocumentId, String newUseRegistrationCertificateNumber, String applyNo) {
IdxBizJgTechParamsElevator idxBizJgTechParamsElevator = idxBizJgTechParamsElevatorMapper.selectOne(new QueryWrapper<IdxBizJgTechParamsElevator>().eq("RECORD", equipId)); IdxBizJgTechParamsElevator idxBizJgTechParamsElevator = idxBizJgTechParamsElevatorMapper.selectOne(new QueryWrapper<IdxBizJgTechParamsElevator>().eq("RECORD", equipId));
JgRegistrationHistory jgRegistrationHistory = jgRegistrationHistoryMapper.selectOne(new QueryWrapper<JgRegistrationHistory>() JgRegistrationHistory jgRegistrationHistory = jgRegistrationHistoryMapper.selectOne(new QueryWrapper<JgRegistrationHistory>()
...@@ -559,4 +573,122 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR ...@@ -559,4 +573,122 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
} }
return null; return null;
} }
@Override
public void exportUseRegistrationCertificate(String sequenceNbr, HttpServletResponse response) {
Map<String, Object> exportParamsMap = new HashMap<>();
//查询移装变更详情
JgChangeRegistrationReform jgChangeRegistrationReform = this.getById(sequenceNbr);
JgChangeRegistrationReformEq jgChangeRegistrationReformEq = jgChangeRegistrationReformEqMapper.selectOne(new QueryWrapper<JgChangeRegistrationReformEq>().eq("equip_transfer_id", sequenceNbr));
if (ValidationUtil.isEmpty(jgChangeRegistrationReform) || ValidationUtil.isEmpty(jgChangeRegistrationReformEq)) {
throw new BadRequest("使用登记证导出失败,请稍后重试!");
}
//是否废弃
exportParamsMap.put("isInvalid", jgChangeRegistrationReformEq.getIsInvalid());
if (ValidationUtil.isEmpty(jgChangeRegistrationReform.getReceiveOrgName())) {
throw new BadRequest("使用登记证导出失败,登记机关为空!");
}
exportParamsMap.put("receiveOrgName", jgChangeRegistrationReform.getReceiveOrgName());
//使用登记证编号
if (ValidationUtil.isEmpty(jgChangeRegistrationReform.getUseRegistrationCode())) {
throw new BadRequest("使用登记证导出失败,使用登记证编号为空!");
}
exportParamsMap.put("useRegistrationCode", jgChangeRegistrationReform.getUseRegistrationCode());
//使用单位名称
if (ValidationUtil.isEmpty(jgChangeRegistrationReform.getUseUnitName())) {
throw new BadRequest("使用登记证导出失败,使用单位名称为空!");
}
exportParamsMap.put("useUnitName", jgChangeRegistrationReform.getUseUnitName());
//监管码
if (ValidationUtil.isEmpty(jgChangeRegistrationReform.getSupervisoryCode())) {
throw new BadRequest("使用登记证导出失败,监管码为空!");
}
exportParamsMap.put("supervisoryCode", jgChangeRegistrationReform.getSupervisoryCode());
//发证日期(当前时间)
LocalDate today = LocalDate.now();
exportParamsMap.put("giveOutYear", today.getYear());
exportParamsMap.put("giveOutMonth", today.getMonthValue());
exportParamsMap.put("giveOutDay", today.getDayOfMonth());
//查询设备注册信息
IdxBizJgRegisterInfo registerInfo = idxBizJgRegisterInfoService.getOne(new QueryWrapper<IdxBizJgRegisterInfo>().eq("RECORD", jgChangeRegistrationReformEq.getEquId()));
if (!ValidationUtil.isEmpty(registerInfo)) {
//设备种类、类别、品种
String equList = registerInfo.getEquList();//设备种类
String equCategory = registerInfo.getEquCategory();//设备类别
String equDefine = registerInfo.getEquDefine();//设备品种
List<EquipmentCategory> categoryList0 = commonService.getEquipmentCategoryList(equList, null);
List<EquipmentCategory> categoryList1 = commonService.getEquipmentCategoryList(equCategory, null);
List<EquipmentCategory> categoryList2 = commonService.getEquipmentCategoryList(equDefine, null);
if (CollectionUtils.isNotEmpty(categoryList0)) {
if (ValidationUtil.isEmpty(categoryList0.get(0).getName())) {
throw new BadRequest("使用登记证导出失败,设备种类为空!");
}
exportParamsMap.put("equList", categoryList0.get(0).getName());
}
if (CollectionUtils.isNotEmpty(categoryList1)) {
if (ValidationUtil.isEmpty(categoryList1.get(0).getName())) {
throw new BadRequest("使用登记证导出失败,设备类别为空!");
}
exportParamsMap.put("equCategory", categoryList1.get(0).getName());
}
if (CollectionUtils.isNotEmpty(categoryList2)) {
if (ValidationUtil.isEmpty(categoryList2.get(0).getName())) {
throw new BadRequest("使用登记证导出失败,设备品种为空!");
}
exportParamsMap.put("equDefine", categoryList2.get(0).getName());
}
//设备代码
if (ValidationUtil.isEmpty(registerInfo.getEquCode())) {
throw new BadRequest("使用登记证导出失败,设备代码为空!");
}
exportParamsMap.put("equCode", registerInfo.getEquCode());
}
//单位内部编码
IdxBizJgUseInfo useInfo = idxBizJgUseInfoService.getOneData(jgChangeRegistrationReformEq.getEquId());
if (!ValidationUtil.isEmpty(useInfo)) {
if (ValidationUtil.isEmpty(useInfo.getUseInnerCode())) {
throw new BadRequest("使用登记证导出失败,设备单位内部编码为空!");
}
exportParamsMap.put("useInnerCode", useInfo.getUseInnerCode());
String fullAddress = "";
String province = useInfo.getProvinceName();
String city = useInfo.getCityName();
String county = useInfo.getCountyName();
String street = useInfo.getStreetName();
String address = useInfo.getAddress();
if (!ObjectUtils.isEmpty(province)) {
fullAddress += province;
}
if (!ObjectUtils.isEmpty(city)) {
fullAddress += city;
}
if (!ObjectUtils.isEmpty(county)) {
fullAddress += county;
}
if (!ObjectUtils.isEmpty(street)) {
fullAddress += street;
}
if (!ObjectUtils.isEmpty(address)) {
fullAddress += address;
}
if (ValidationUtil.isEmpty(fullAddress)) {
throw new BadRequest("使用登记证导出失败,设备使用地址为空!");
}
exportParamsMap.put("fullAddress", fullAddress);
}
IdxBizJgFactoryInfo factoryInfo = idxBizJgFactoryInfoService.getOneData(jgChangeRegistrationReformEq.getEquId());
//产品编号(出厂编号)
if (!ValidationUtil.isEmpty(factoryInfo)) {
if (ValidationUtil.isEmpty(factoryInfo.getFactoryNum())) {
throw new BadRequest("使用登记证导出失败,产品编号为空!");
}
exportParamsMap.put("factoryNum", factoryInfo.getFactoryNum());
}
//调用生成使用登记证
commonService.generateCertificateReport(exportParamsMap, response);
}
} }
\ No newline at end of file
...@@ -704,11 +704,11 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg ...@@ -704,11 +704,11 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
throw new BadRequest("使用登记证导出失败,请稍后重试!"); throw new BadRequest("使用登记证导出失败,请稍后重试!");
} }
//是否废弃 //是否废弃
exportParamsMap.put("isInvalid", jgChangeRegistrationUnitEq.getIsInvalid()); exportParamsMap.put("isInvalid", ValidationUtil.isEmpty(jgChangeRegistrationUnitEq.getIsInvalid()) ? "0" : jgChangeRegistrationUnitEq.getIsInvalid());
//登记机关 //登记机关
exportParamsMap.put("receiveOrgName", transfer.getReceiveOrgName()); exportParamsMap.put("receiveOrgName", transfer.getReceiveOrgName());
//使用登记证编号 //使用登记证编号
exportParamsMap.put("useRegistrationCode", transfer.getUseRegistCode()); exportParamsMap.put("useRegistrationCode", ValidationUtil.isEmpty(transfer.getUseRegistCode()) ? "" : transfer.getUseRegistCode());
//使用单位名称 //使用单位名称
exportParamsMap.put("useUnitName", transfer.getUseUnitName()); exportParamsMap.put("useUnitName", transfer.getUseUnitName());
//监管码 //监管码
...@@ -733,15 +733,17 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg ...@@ -733,15 +733,17 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
String equDefine = registerInfo.getEquDefine();//设备品种 String equDefine = registerInfo.getEquDefine();//设备品种
List<EquipmentCategory> categoryList0 = commonService.getEquipmentCategoryList(equList, null); List<EquipmentCategory> categoryList0 = commonService.getEquipmentCategoryList(equList, null);
List<EquipmentCategory> categoryList1 = commonService.getEquipmentCategoryList(equCategory, null); List<EquipmentCategory> categoryList1 = commonService.getEquipmentCategoryList(equCategory, null);
List<EquipmentCategory> categoryList2 = commonService.getEquipmentCategoryList(equDefine, null);
if (org.apache.commons.collections.CollectionUtils.isNotEmpty(categoryList1)) { if (org.apache.commons.collections.CollectionUtils.isNotEmpty(categoryList1)) {
exportParamsMap.put("equList", categoryList0.get(0).getName()); exportParamsMap.put("equList", categoryList0.get(0).getName());
} }
if (org.apache.commons.collections.CollectionUtils.isNotEmpty(categoryList1)) { if (org.apache.commons.collections.CollectionUtils.isNotEmpty(categoryList1)) {
exportParamsMap.put("equCategory", categoryList1.get(0).getName()); exportParamsMap.put("equCategory", categoryList1.get(0).getName());
} }
if (org.apache.commons.collections.CollectionUtils.isNotEmpty(categoryList2)) { if(!ValidationUtil.isEmpty(equDefine)) {
exportParamsMap.put("equDefine", categoryList2.get(0).getName()); List<EquipmentCategory> categoryList2 = commonService.getEquipmentCategoryList(equDefine, null);
if (org.apache.commons.collections.CollectionUtils.isNotEmpty(categoryList2)) {
exportParamsMap.put("equDefine", categoryList2.get(0).getName());
}
} }
//设备代码 //设备代码
exportParamsMap.put("equCode", registerInfo.getEquCode()); exportParamsMap.put("equCode", registerInfo.getEquCode());
...@@ -753,11 +755,11 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg ...@@ -753,11 +755,11 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
exportParamsMap.put("useInnerCode", useInfo.getUseInnerCode()); exportParamsMap.put("useInnerCode", useInfo.getUseInnerCode());
String fullAddress=""; String fullAddress="";
String province = useInfo.getProvinceName(); String province = ValidationUtil.isEmpty(useInfo.getProvinceName()) ? "" : useInfo.getProvinceName();
String city = useInfo.getCityName(); String city = ValidationUtil.isEmpty(useInfo.getCityName()) ? "" : useInfo.getCityName();
String county = useInfo.getCountyName(); String county = ValidationUtil.isEmpty(useInfo.getCountyName()) ? "" : useInfo.getCountyName();
String street = useInfo.getStreetName(); String street = ValidationUtil.isEmpty(useInfo.getStreetName()) ? "" : useInfo.getStreetName();
String address = useInfo.getAddress(); String address = ValidationUtil.isEmpty(useInfo.getAddress()) ? "" : useInfo.getAddress();
fullAddress = province + city + county + street + address; fullAddress = province + city + county + street + address;
exportParamsMap.put("fullAddress", fullAddress); exportParamsMap.put("fullAddress", fullAddress);
} }
......
package com.yeejoin.amos.boot.module.ymt.biz.config;
import org.apache.http.HttpHost;
import org.apache.http.auth.AuthScope;
import org.apache.http.auth.UsernamePasswordCredentials;
import org.apache.http.client.CredentialsProvider;
import org.apache.http.impl.client.BasicCredentialsProvider;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestClientBuilder;
import org.elasticsearch.client.RestHighLevelClient;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import java.util.Arrays;
@Configuration
public class ElasticSearchClientConfig {
@Value("${spring.elasticsearch.rest.uris}")
private String uris;
@Value("${elasticsearch.username}")
private String username;
@Value("${elasticsearch.password}")
private String password;
@Bean(destroyMethod = "close")
public RestHighLevelClient restHighLevelClient() {
final CredentialsProvider credentialsProvider = new BasicCredentialsProvider();
credentialsProvider.setCredentials(AuthScope.ANY,
new UsernamePasswordCredentials(username, password));
try {
HttpHost[] httpHosts = Arrays.stream(uris.split(",")).map(HttpHost::create).toArray(HttpHost[]::new);
RestClientBuilder builder = RestClient.builder(httpHosts);
builder.setHttpClientConfigCallback(httpClientBuilder -> {
httpClientBuilder.disableAuthCaching();
return httpClientBuilder.setDefaultCredentialsProvider(credentialsProvider);
});
// 该方法接收一个RequestConfig.Builder对象,对该对象进行修改后然后返回。
builder.setRequestConfigCallback(requestConfigBuilder -> {
// 连接超时(默认为1秒)
return requestConfigBuilder.setConnectTimeout(5000 * 1000)
// 套接字超时(默认为30秒)//更改客户端的超时限制默认30秒现在改为100*1000分钟
.setSocketTimeout(6000 * 1000);
});
return new RestHighLevelClient(builder);
} catch (Exception e) {
throw new IllegalStateException("Invalid ES nodes " + "property '" + uris + "'", e);
}
}
}
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