Commit 47e4b052 authored by suhuiguang's avatar suhuiguang

Merge branch 'develop_tzs_register_to_0715' of…

Merge branch 'develop_tzs_register_to_0715' of http://36.40.66.175:5000/moa/amos-boot-biz into develop_tzs_register_to_0715
parents b1a4aa7c 1ba76e9c
......@@ -158,4 +158,10 @@ public class ESEquipmentCategoryDto {
@Field(type = FieldType.Keyword)
private String USE_SITE_CODE;
/**
* 工程装置(工业管道使用)
*/
@Field(type = FieldType.Keyword)
private String PROJECT_CONTRAPTION;
}
......@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.jg.api.mapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamDto;
import com.yeejoin.amos.boot.module.jg.api.dto.CompanyEquipCountDto;
import com.yeejoin.amos.boot.module.jg.api.dto.EquipBizCountDto;
import com.yeejoin.amos.boot.module.jg.api.dto.JgEnableDisableDto;
import com.yeejoin.amos.boot.module.jg.api.entity.JgEnableDisable;
......@@ -29,4 +30,6 @@ public interface JgEnableDisableMapper extends BaseMapper<JgEnableDisable> {
Map<String, Object> getDetail(@Param("sequenceNbr") Long sequenceNbr);
List<EquipBizCountDto> queryStoppedDeviceStaticListData(DPFilterParamDto dpFilterParamDto);
List<CompanyEquipCountDto> queryForFlowingEquipList();
}
......@@ -151,4 +151,14 @@
c.equ_category,
c.equ_define
</select>
<select id="queryForFlowingEquipList" resultType="com.yeejoin.amos.boot.module.jg.api.dto.CompanyEquipCountDto">
select a.use_unit_credit_code as companyCode,
group_concat(b.equ_id) as records
from tzs_jg_enable_disable a,
tzs_jg_enable_disable_eq b
where a.sequence_nbr = b.enable_disable_apply_id
and a.audit_status in ('待受理')
GROUP BY a.use_unit_credit_code
</select>
</mapper>
......@@ -283,7 +283,7 @@
tzs_jg_maintain_notice_eq b
where
a.sequence_nbr = b.equip_transfer_id
and a.notice_status not in('6614','6615','6610','6617','6616')
and a.notice_status = '6612'
GROUP BY a.install_unit_credit_code
</select>
</mapper>
......@@ -453,7 +453,7 @@
pp."MEDIUM" medium,
pp."REMARKS" remarks,
(select INSPECT_ORG_NAME from idx_biz_jg_inspection_detection_info where "RECORD" = ui."RECORD" ORDER BY REC_DATE DESC limit 1) inspectOrgName,
(select name from cb_data_dictionary where type = 'JYJL' and code = (select INSPECT_CONCLUSION from idx_biz_jg_inspection_detection_info where "RECORD" = ui."RECORD" ORDER BY REC_DATE limit 1)) inspectConclusion,
(select name from cb_data_dictionary where type = 'JYJL' and code = (select INSPECT_CONCLUSION from idx_biz_jg_inspection_detection_info where "RECORD" = ui."RECORD" ORDER BY DESC REC_DATE limit 1)) inspectConclusion,
to_char((select NEXT_INSPECT_DATE from idx_biz_jg_inspection_detection_info where "RECORD" = ui."RECORD" ORDER BY REC_DATE DESC limit 1), 'YYYY-MM-DD') nextInspectDate
FROM
idx_biz_jg_use_info ui
......@@ -461,6 +461,7 @@
LEFT JOIN idx_biz_jg_tech_params_pipeline pp ON pp."RECORD" = ui."RECORD"
</sql>
<select id="queryForUnitPipelineEquipmentPage" resultType="com.alibaba.fastjson.JSONObject">
select * from (
<include refid="page-list-pipeline"/>
WHERE
ri."EQU_CATEGORY" = '8300'
......@@ -487,6 +488,7 @@
!='一级受理已驳回' and v.status !='使用单位已撤回' and v.status !='已作废' )
</if>
ORDER BY ui.REC_DATE DESC
) where uscUnitName is not null
</select>
<select id="queryForUnitPipelineEquipment" resultType="java.util.Map">
......
......@@ -2,7 +2,9 @@ package com.yeejoin.amos.boot.module.jg.biz.controller;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.jg.api.enums.CompanyTypeEnum;
import com.yeejoin.amos.boot.module.jg.biz.service.IIdxBizJgRegisterInfoService;
import com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel;
import io.swagger.annotations.Api;
......@@ -215,4 +217,24 @@ public class IdxBizJqEquipmentRegisterController extends BaseController {
throw new Exception("系统异常");
}
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getProjectContraption")
@ApiOperation(httpMethod = "GET", value = "查询当前单位下工程装置信息", notes = "查询当前单位下工程装置信息")
public ResponseModel<Object> queryEquipCanUsedByVesselPageHistory() {
ReginParams info = getSelectedOrgInfo();
if (info.getCompany().getLevel().equals(BaseController.COMPANY_TYPE_COMPANY)) {
return ResponseHelper.buildResponse(idxBizJgRegisterInfoService.getProjectContraption(info.getCompany().getCompanyCode()));
} else {
return ResponseHelper.buildResponse(new ArrayList<String>());
}
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/esSynchronousProjectContraption")
@ApiOperation(httpMethod = "GET", value = "ES历史数据同步工程装置字段值", notes = "ES历史数据同步工程装置字段值")
public ResponseModel<Object> esSynchronousProjectContraption() {
return ResponseHelper.buildResponse(idxBizJgRegisterInfoService.esSynchronousProjectContraption());
}
}
......@@ -44,4 +44,8 @@ public interface IIdxBizJgRegisterInfoService {
Object importPressureData(MultipartFile multipartFile) throws Exception;
Object savePressureVesselData(Map<String, Object> paramMap);
Object getProjectContraption(String uscUnitCreditCode);
Boolean esSynchronousProjectContraption();
}
......@@ -1369,12 +1369,31 @@ public class DPStatisticsServiceImpl {
regionCodeOrgCodeMap.put(dpFilterParamDto.getCityCode(), orgCode);
}
Long certificateCount = jgUseRegistrationManageMapper.countCertificateByReginCode(orgCode);
Long deviceCount = equipmentCategoryMapper.countEquipByReginCode(orgCode);
Long deviceCount = countEquipByReginCode(orgCode);
result.put(DPMapStatisticsItemEnum.CERTIFICATE_COUNT.getCode(), certificateCount);
result.put(DPMapStatisticsItemEnum.DEVICE_COUNT.getCode(), deviceCount);
return result;
}
private Long countEquipByReginCode(String orgCode) {
long num = 0;
CountRequest request = new CountRequest();
request.indices("idx_biz_view_jg_all");
BoolQueryBuilder boolMust = QueryBuilders.boolQuery();
// 按照管辖机构区域信息模糊查询
boolMust.must(QueryBuilders.wildcardQuery("ORG_BRANCH_CODE.keyword", orgCode + "*"));
// 纳管状态为已纳管
boolMust.must(QueryBuilders.termQuery("IS_INTO_MANAGEMENT", true));
request.query(boolMust);
try {
CountResponse response = restHighLevelClient.count(request, RequestOptions.DEFAULT);
num = response.getCount();
} catch (IOException e) {
throw new RuntimeException(e);
}
return num;
}
public Map<String, Object> dataStatisticCountByReginCode(DPFilterParamDto dpFilterParamDto) {
Map<String, Object> resultMap = new HashMap<>();
List<Map<String, Object>> mapList = this.dataStatisticByReginCode(dpFilterParamDto);
......
......@@ -3043,4 +3043,25 @@ private SafetyProblemTracingMapper safetyProblemTracingMapper;
.findFirst();
return optional.map(map -> (String) map.get("useCode")).orElse(null);
}
@Override
public Object getProjectContraption(String uscUnitCreditCode) {
return this.baseMapper.getProjectContraption(uscUnitCreditCode);
}
@Override
public Boolean esSynchronousProjectContraption() {
List<Map<String, Object>> list = this.baseMapper.esSynchronousProjectContraption();
if (!ObjectUtils.isEmpty(list)) {
HashMap<String, Map<String, Object>> objMap = new HashMap<>();
list.forEach(item -> {
HashMap<String, Object> param = new HashMap<>();
param.put("PROJECT_CONTRAPTION", item.get("PROJECT_CONTRAPTION"));
objMap.put(item.get("SEQUENCE_NBR").toString(), param);
});
// 更新es
tzsServiceFeignClient.commonUpdateEsDataByIds(objMap);
}
return Boolean.TRUE;
}
}
\ No newline at end of file
package com.yeejoin.amos.boot.module.jg.biz.service.impl;
import com.yeejoin.amos.boot.module.jg.api.dto.CompanyEquipCountDto;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgEnableDisableMapper;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgInstallationNoticeMapper;
import lombok.extern.slf4j.Slf4j;
import org.redisson.api.RBucket;
import org.redisson.api.RedissonClient;
import org.springframework.stereotype.Component;
import java.util.Arrays;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
/**
* @author Administrator
*/
@Component
@Slf4j
public class JgEnableDisableEquipUsedCheckImpl extends BaseEquipUsedCheckService {
private RedissonClient redissonClient;
private String bizType = "deactivateEnable";
private JgEnableDisableMapper mapper;
public JgEnableDisableEquipUsedCheckImpl(RedissonClient redissonClient, JgEnableDisableMapper mapper) {
this.redissonClient = redissonClient;
this.mapper = mapper;
}
@Override
public RedissonClient getRedisClient() {
return redissonClient;
}
@Override
public String getApplyBizType() {
return bizType;
}
@Override
public void init() {
// 初始化已经完成或者在流程中安装告知的设备数据
List<CompanyEquipCountDto> companyEquipCountDtos = mapper.queryForFlowingEquipList();
companyEquipCountDtos.forEach(c -> {
RBucket<Set<String>> rBucket = redissonClient.getBucket(getFlowingEquipRedisKey(c.getCompanyCode(), bizType));
rBucket.set(Arrays.stream(c.getRecords().split(",")).collect(Collectors.toSet()));
});
}
}
......@@ -72,6 +72,7 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto
private static final String SUBMIT_TYPE_FLOW = "1";
private static final String PROCESS_DEFINITION_KEY = "maintainNotice";
private static final String TABLE_PAGE_ID = "maintainInfo";
private final List<String> NOT_FLOWING_STATE = Arrays.asList("6610", "6614", "6615", "6617", "6616");
@Autowired
IJgInstallationNoticeService iJgInstallationNoticeService;
......@@ -199,16 +200,20 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto
private void repeatUsedEquipCheck(List<Map<String, Object>> equipList, String companyCode) {
equipList.forEach(equipMap -> EquipUsedCheckStrategyContext.getUsedStrategy(PROCESS_DEFINITION_KEY).equipRepeatUsedCheck(String.valueOf(equipMap.get("SEQUENCE_NBR")), companyCode));
}
/**
* 删除 redis校验重复引用设备的数据
*/
private void delRepeatUseEquipData(JgMaintainNotice notice) {
if (NOT_FLOWING_STATE.contains(notice.getNoticeStatus())) {
LambdaQueryWrapper<JgMaintainNoticeEq> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(JgMaintainNoticeEq::getEquipTransferId, notice.getSequenceNbr());
JgMaintainNoticeEq noticeEq = jgMaintainNoticeEqMapper.selectOne(queryWrapper);
EquipUsedCheckStrategyContext.getUsedStrategy(PROCESS_DEFINITION_KEY)
.delDataForCheckEquipRepeatUsed(Collections.singletonList(noticeEq.getEquId()), notice.getInstallUnitCreditCode());
}
}
private void rollBackForDelRedisData() {
FlowingEquipRedisContext.getContext().forEach(e -> {
......@@ -932,9 +937,9 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto
jgMaintainNotice.setNextExecuteUserIds(workflowResultDto.getNextExecutorUserIds());
jgMaintainNotice.setNextTaskId(workflowResultDto.getNextTaskId());
jgMaintainNoticeMapper.updateById(jgMaintainNotice);
this.delRepeatUseEquipData(jgMaintainNotice);
}
commonService.saveExecuteFlowData2Redis(instanceId, this.buildInstanceRuntimeData(jgMaintainNotice));
this.delRepeatUseEquipData(jgMaintainNotice);
} catch (InterruptedException e) {
e.printStackTrace();
} finally {
......
......@@ -1346,8 +1346,8 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
param.put("STATUS", "已认领");
param.put("EQU_STATE", 1);
param.put("IS_INTO_MANAGEMENT", true);
param.put("USE_SITE_CODE", jsonObject.get("province") + "#" + jsonObject.get("city") + "#" + jsonObject.get("county") + "#" + jsonObject.get("factoryUseSiteStreet"));
param.put("USE_PLACE_CODE", String.valueOf(jsonObject.get("usePlace")));
param.put("USE_PLACE_CODE", jsonObject.get("province") + "#" + jsonObject.get("city") + "#" + jsonObject.get("county") + "#" + jsonObject.get("factoryUseSiteStreet"));
param.put("USE_SITE_CODE", String.valueOf(jsonObject.get("usePlace")));
param.put("ORG_BRANCH_CODE", split[0]);
param.put("ORG_BRANCH_NAME", split[1]);
param.put("EQU_CODE", dataMap.get("equCode"));
......
......@@ -880,7 +880,7 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
param.put("STATUS", "已认领");
param.put("EQU_STATE", 1);
param.put("IS_INTO_MANAGEMENT", true);
param.put("USE_SITE_CODE", "610000#" + jgVehicleInformation.getVehicleApanage());
param.put("USE_PLACE_CODE", "610000#" + jgVehicleInformation.getVehicleApanage());
param.put("ORG_BRANCH_CODE", jgVehicleInformation.getOrgBranchCode());
param.put("ORG_BRANCH_NAME", jgVehicleInformation.getOrgBranchName());
param.put("EQU_CODE", dataMap.get("equCode"));
......
......@@ -388,6 +388,7 @@ public class DPSubServiceImpl {
JSONArray attachmentUploadDatas = matinfo.getJSONArray("datas");
if (!ValidationUtil.isEmpty(value)) {
JSONObject attachmentUploadDatasObj = new JSONObject();
attachmentUploadDatasObj.put("label", visualParams.getString("label"));
attachmentUploadDatasObj.put("value", value);
attachmentUploadDatasObj.put("type", "img");
attachmentUploadDatas.add(attachmentUploadDatasObj);
......@@ -399,7 +400,7 @@ public class DPSubServiceImpl {
attachmentUploadDatasObj.put("value", value);
String accept = visualParams.getString("accept");
String label = visualParams.getString("label");
if (!ValidationUtil.isEmpty(displayName) && ("附件".equals(label) || "其他附件".equals(label))){
if (!ValidationUtil.isEmpty(displayName)){
label = label + "(" + displayName + ")";
}
attachmentUploadDatasObj.put("label", label);
......@@ -434,7 +435,7 @@ public class DPSubServiceImpl {
}
}
}
if (!"upload".equals(xObj.getString("componentKey")) || !"attachmentUpload".equals(xObj.getString("componentKey"))){
if (!("upload".equals(xObj.getString("componentKey")) || "attachmentUpload".equals(xObj.getString("componentKey")))){
datas.add(jsonObject);
}
return datas;
......@@ -521,6 +522,11 @@ public class DPSubServiceImpl {
Object bizResult = convertResult(JSONObject.parseObject(response), resultConvert);
ResponseModel responseModel = JSONObject.parseObject(response, ResponseModel.class);
if (200 != responseModel.getStatus()){
log.info("调用第三方接口失败, 请求地址:{}", apiObj);
throw new RuntimeException(String.format("调用第三方接口失败!"));
}
JSONObject ruleData = apiObj.getJSONObject("ruleData");
if (!ValidationUtil.isEmpty(ruleData)) {
String responseSuccess = ruleData.getString("responseSuccess").replace("data", "");
......
......@@ -307,7 +307,7 @@ public class TzBaseEnterpriseInfoServiceImpl
TzBaseEnterpriseInfoDto tzBaseEnterpriseInfoDto = detail(tzBaseEnterpriseInfo.getSequenceNbr());
RegUnitIcDto regUnitIcDto = tzBaseEnterpriseInfoDto.getRegUnitIcDto();
String creditCode = tzBaseEnterpriseInfoDto.getUseCode();
if (tzBaseEnterpriseInfo.getRegisterType().contains(UnitTypeEnum.grzt.getName())) {
if (!ObjectUtils.isEmpty(tzBaseEnterpriseInfo.getRegisterType()) && tzBaseEnterpriseInfo.getRegisterType().contains(UnitTypeEnum.grzt.getName())) {
// 个人主体时截取证件号码(eg. 6600_210423195703287959 证件类型_证件号码)
if (creditCode.split("_").length > 1) {
creditCode = creditCode.split("_")[1];
......
......@@ -90,6 +90,5 @@ public interface EquipmentCategoryMapper extends BaseMapper<EquipmentCategory> {
List<String> selectXiXianNew();
Long countEquipByReginCode(String orgCode);
}
......@@ -6,6 +6,7 @@ import com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
import java.util.Map;
/**
* 注册登记信息表 Mapper 接口
......@@ -24,5 +25,10 @@ public interface IdxBizJgRegisterInfoMapper extends BaseMapper<IdxBizJgRegisterI
@Select("select code as dictDataKey,name as dictDataValue from tz_equipment_category where parent_id = ( SELECT sub.id from tz_equipment_category as sub where sub.code = #{equipCode})")
List<DictionarieValueModel> queryAllEquCategoriesUnderTheEquList(@Param("equipCode") String equipCode);
@Select("SELECT jui.PROJECT_CONTRAPTION as value FROM idx_biz_jg_construction_info jci LEFT JOIN idx_biz_jg_use_info jui on jci.RECORD = jui.RECORD where jci.USC_UNIT_CREDIT_CODE = #{uscUnitCreditCode} and jui.PROJECT_CONTRAPTION is not null GROUP BY jui.PROJECT_CONTRAPTION")
List<Map<String, Object>> getProjectContraption(@Param("uscUnitCreditCode")String uscUnitCreditCode);
@Select("SELECT SEQUENCE_NBR,REC_DATE,ORG_BRANCH_NAME,ORG_BRANCH_CODE,USE_UNIT_NAME,USE_UNIT_CREDIT_CODE,EQU_LIST_CODE,EQU_LIST,EQU_CATEGORY,EQU_CATEGORY_CODE,USE_ORG_CODE,CODE96333,EQU_CODE,SUPERVISORY_CODE,USE_PLACE,ADDRESS,EQU_STATE,STATUS,USE_INNER_CODE,FACTORY_NUM,PRODUCE_UNIT_NAME,INSPECT_REPORT,NEXT_INSPECT_DATE,CONSTRUCTION_TYPE,USC_UNIT_CREDIT_CODE,USC_UNIT_NAME,EQU_DEFINE,EQU_DEFINE_CODE,PRODUCT_NAME,BRAND_NAME,EQU_TYPE,DATA_SOURCE,IS_INTO_MANAGEMENT,WHETHER_VEHICLE_CYLINDER,WHETHER_SKID_MOUNTED_PRESSURE_VESSEL,DATE_FORMAT(PRODUCE_DATE,'%Y-%m-%d %H:%i:%s')as PRODUCE_DATE,PROJECT_CONTRAPTION from idx_biz_view_jg_all WHERE PROJECT_CONTRAPTION is not null")
List<Map<String, Object>> esSynchronousProjectContraption();
}
......@@ -104,7 +104,8 @@
IS_INTO_MANAGEMENT,
WHETHER_VEHICLE_CYLINDER,
WHETHER_SKID_MOUNTED_PRESSURE_VESSEL,
DATE_FORMAT(PRODUCE_DATE, '%Y-%m-%d %H:%i:%s') as PRODUCE_DATE
DATE_FORMAT(PRODUCE_DATE, '%Y-%m-%d %H:%i:%s') as PRODUCE_DATE,
PROJECT_CONTRAPTION
from idx_biz_view_jg_all
WHERE SEQUENCE_NBR = #{id}
</select>
......
......@@ -680,15 +680,4 @@
AND ( ibjoi."CODE96333" NOT LIKE'31%' OR ibjoi."CODE96333" IS NULL )
AND "CLAIM_STATUS" = '已认领';
</select>
<select id="countEquipByReginCode" resultType="java.lang.Long">
select
count(1)
from
idx_biz_jg_use_info ibjui,
idx_biz_jg_supervision_info ibjsi
where
ibjui."RECORD" = ibjsi."RECORD"
and ibjsi."ORG_BRANCH_CODE" like concat (#{reginCode},'%')
and ibjui."IS_INTO_MANAGEMENT" = true
</select>
</mapper>
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