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 { ...@@ -158,4 +158,10 @@ public class ESEquipmentCategoryDto {
@Field(type = FieldType.Keyword) @Field(type = FieldType.Keyword)
private String USE_SITE_CODE; 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; ...@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.jg.api.mapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamDto; 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.EquipBizCountDto;
import com.yeejoin.amos.boot.module.jg.api.dto.JgEnableDisableDto; import com.yeejoin.amos.boot.module.jg.api.dto.JgEnableDisableDto;
import com.yeejoin.amos.boot.module.jg.api.entity.JgEnableDisable; import com.yeejoin.amos.boot.module.jg.api.entity.JgEnableDisable;
...@@ -29,4 +30,6 @@ public interface JgEnableDisableMapper extends BaseMapper<JgEnableDisable> { ...@@ -29,4 +30,6 @@ public interface JgEnableDisableMapper extends BaseMapper<JgEnableDisable> {
Map<String, Object> getDetail(@Param("sequenceNbr") Long sequenceNbr); Map<String, Object> getDetail(@Param("sequenceNbr") Long sequenceNbr);
List<EquipBizCountDto> queryStoppedDeviceStaticListData(DPFilterParamDto dpFilterParamDto); List<EquipBizCountDto> queryStoppedDeviceStaticListData(DPFilterParamDto dpFilterParamDto);
List<CompanyEquipCountDto> queryForFlowingEquipList();
} }
...@@ -151,4 +151,14 @@ ...@@ -151,4 +151,14 @@
c.equ_category, c.equ_category,
c.equ_define c.equ_define
</select> </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> </mapper>
...@@ -283,7 +283,7 @@ ...@@ -283,7 +283,7 @@
tzs_jg_maintain_notice_eq b tzs_jg_maintain_notice_eq b
where where
a.sequence_nbr = b.equip_transfer_id 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 GROUP BY a.install_unit_credit_code
</select> </select>
</mapper> </mapper>
...@@ -453,7 +453,7 @@ ...@@ -453,7 +453,7 @@
pp."MEDIUM" medium, pp."MEDIUM" medium,
pp."REMARKS" remarks, 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 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 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 FROM
idx_biz_jg_use_info ui idx_biz_jg_use_info ui
...@@ -461,6 +461,7 @@ ...@@ -461,6 +461,7 @@
LEFT JOIN idx_biz_jg_tech_params_pipeline pp ON pp."RECORD" = ui."RECORD" LEFT JOIN idx_biz_jg_tech_params_pipeline pp ON pp."RECORD" = ui."RECORD"
</sql> </sql>
<select id="queryForUnitPipelineEquipmentPage" resultType="com.alibaba.fastjson.JSONObject"> <select id="queryForUnitPipelineEquipmentPage" resultType="com.alibaba.fastjson.JSONObject">
select * from (
<include refid="page-list-pipeline"/> <include refid="page-list-pipeline"/>
WHERE WHERE
ri."EQU_CATEGORY" = '8300' ri."EQU_CATEGORY" = '8300'
...@@ -487,6 +488,7 @@ ...@@ -487,6 +488,7 @@
!='一级受理已驳回' and v.status !='使用单位已撤回' and v.status !='已作废' ) !='一级受理已驳回' and v.status !='使用单位已撤回' and v.status !='已作废' )
</if> </if>
ORDER BY ui.REC_DATE DESC ORDER BY ui.REC_DATE DESC
) where uscUnitName is not null
</select> </select>
<select id="queryForUnitPipelineEquipment" resultType="java.util.Map"> <select id="queryForUnitPipelineEquipment" resultType="java.util.Map">
......
...@@ -2,7 +2,9 @@ package com.yeejoin.amos.boot.module.jg.biz.controller; ...@@ -2,7 +2,9 @@ package com.yeejoin.amos.boot.module.jg.biz.controller;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 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.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.boot.module.jg.biz.service.IIdxBizJgRegisterInfoService;
import com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel; import com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
...@@ -215,4 +217,24 @@ public class IdxBizJqEquipmentRegisterController extends BaseController { ...@@ -215,4 +217,24 @@ public class IdxBizJqEquipmentRegisterController extends BaseController {
throw new Exception("系统异常"); 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 { ...@@ -44,4 +44,8 @@ public interface IIdxBizJgRegisterInfoService {
Object importPressureData(MultipartFile multipartFile) throws Exception; Object importPressureData(MultipartFile multipartFile) throws Exception;
Object savePressureVesselData(Map<String, Object> paramMap); Object savePressureVesselData(Map<String, Object> paramMap);
Object getProjectContraption(String uscUnitCreditCode);
Boolean esSynchronousProjectContraption();
} }
...@@ -1369,12 +1369,31 @@ public class DPStatisticsServiceImpl { ...@@ -1369,12 +1369,31 @@ public class DPStatisticsServiceImpl {
regionCodeOrgCodeMap.put(dpFilterParamDto.getCityCode(), orgCode); regionCodeOrgCodeMap.put(dpFilterParamDto.getCityCode(), orgCode);
} }
Long certificateCount = jgUseRegistrationManageMapper.countCertificateByReginCode(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.CERTIFICATE_COUNT.getCode(), certificateCount);
result.put(DPMapStatisticsItemEnum.DEVICE_COUNT.getCode(), deviceCount); result.put(DPMapStatisticsItemEnum.DEVICE_COUNT.getCode(), deviceCount);
return result; 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) { public Map<String, Object> dataStatisticCountByReginCode(DPFilterParamDto dpFilterParamDto) {
Map<String, Object> resultMap = new HashMap<>(); Map<String, Object> resultMap = new HashMap<>();
List<Map<String, Object>> mapList = this.dataStatisticByReginCode(dpFilterParamDto); List<Map<String, Object>> mapList = this.dataStatisticByReginCode(dpFilterParamDto);
......
...@@ -3043,4 +3043,25 @@ private SafetyProblemTracingMapper safetyProblemTracingMapper; ...@@ -3043,4 +3043,25 @@ private SafetyProblemTracingMapper safetyProblemTracingMapper;
.findFirst(); .findFirst();
return optional.map(map -> (String) map.get("useCode")).orElse(null); 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()));
});
}
}
package com.yeejoin.amos.boot.module.jg.biz.service.impl; package com.yeejoin.amos.boot.module.jg.biz.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Sequence;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
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;
import com.yeejoin.amos.boot.module.jg.api.dto.*; import com.yeejoin.amos.boot.module.jg.api.dto.*;
import com.yeejoin.amos.boot.module.jg.api.entity.*; import com.yeejoin.amos.boot.module.jg.api.entity.JgEnableDisable;
import com.yeejoin.amos.boot.module.jg.api.entity.JgEnableDisableEq;
import com.yeejoin.amos.boot.module.jg.api.entity.JgRegistrationHistory;
import com.yeejoin.amos.boot.module.jg.api.enums.BusinessTypeEnum; import com.yeejoin.amos.boot.module.jg.api.enums.BusinessTypeEnum;
import com.yeejoin.amos.boot.module.jg.api.enums.WorkFlowStatusEnum; import com.yeejoin.amos.boot.module.jg.api.enums.WorkFlowStatusEnum;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgEnableDisableEqMapper; import com.yeejoin.amos.boot.module.jg.api.mapper.JgEnableDisableEqMapper;
...@@ -19,6 +22,9 @@ import com.yeejoin.amos.boot.module.jg.api.mapper.JgMaintainNoticeMapper; ...@@ -19,6 +22,9 @@ import com.yeejoin.amos.boot.module.jg.api.mapper.JgMaintainNoticeMapper;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgRegistrationHistoryMapper; import com.yeejoin.amos.boot.module.jg.api.mapper.JgRegistrationHistoryMapper;
import com.yeejoin.amos.boot.module.jg.api.service.IJgEnableDisableService; import com.yeejoin.amos.boot.module.jg.api.service.IJgEnableDisableService;
import com.yeejoin.amos.boot.module.jg.api.vo.SortVo; import com.yeejoin.amos.boot.module.jg.api.vo.SortVo;
import com.yeejoin.amos.boot.module.jg.biz.config.LocalBadRequest;
import com.yeejoin.amos.boot.module.jg.biz.context.EquipUsedCheckStrategyContext;
import com.yeejoin.amos.boot.module.jg.biz.context.FlowingEquipRedisContext;
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.ICmWorkflowService; import com.yeejoin.amos.boot.module.jg.biz.service.ICmWorkflowService;
import com.yeejoin.amos.boot.module.jg.biz.service.IIdxBizJgRegisterInfoService; import com.yeejoin.amos.boot.module.jg.biz.service.IIdxBizJgRegisterInfoService;
...@@ -37,15 +43,13 @@ import org.redisson.api.RLock; ...@@ -37,15 +43,13 @@ import org.redisson.api.RLock;
import org.redisson.api.RedissonClient; import org.redisson.api.RedissonClient;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import org.typroject.tyboot.core.foundation.context.RequestContext; import org.typroject.tyboot.core.foundation.context.RequestContext;
import com.baomidou.mybatisplus.core.toolkit.Sequence;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service;
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;
...@@ -74,14 +78,14 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto, ...@@ -74,14 +78,14 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto,
JgEnableDisableEqMapper jgEnableDisableEqMapper; JgEnableDisableEqMapper jgEnableDisableEqMapper;
@Autowired @Autowired
JgMaintainNoticeMapper jgMaintainNoticeMapper; JgMaintainNoticeMapper jgMaintainNoticeMapper;
@Autowired @Autowired
TzsServiceFeignClient tzsServiceFeignClient; TzsServiceFeignClient tzsServiceFeignClient;
@Autowired @Autowired
IIdxBizJgRegisterInfoService idxBizJgRegisterInfoService; IIdxBizJgRegisterInfoService idxBizJgRegisterInfoService;
private final List<String> NOT_FLOWING_STATE = Arrays.asList("使用单位待提交", "一级受理已驳回", "使用单位已撤回", "已作废", "已完成");
private final String PROCESS_DEFINITION_KEY = "deactivateEnable"; private final String PROCESS_DEFINITION_KEY = "deactivateEnable";
...@@ -117,142 +121,182 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto, ...@@ -117,142 +121,182 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto,
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public List<JgEnableDisable> saveOrUpdate(JSONObject map, ReginParams reginParams) { public List<JgEnableDisable> saveOrUpdate(JSONObject map, ReginParams reginParams) {
JgEnableDisable jgEnableDisable = new JgEnableDisable(); try {
if (!"null".equals(String.valueOf(map.get("sequenceNbr")))) { JgEnableDisable jgEnableDisable = new JgEnableDisable();
jgEnableDisable = this.baseMapper.selectById(String.valueOf(map.get("sequenceNbr"))); if (!"null".equals(String.valueOf(map.get("sequenceNbr")))) {
jgEnableDisable.setRemark(map.get("remark").toString()); jgEnableDisable = this.baseMapper.selectById(String.valueOf(map.get("sequenceNbr")));
} else { jgEnableDisable.setRemark(map.get("remark").toString());
// 获取申请编号 } else {
ResponseModel<List<String>> listResponseModel = tzsServiceFeignClient.applicationFormCode(ApplicationFormTypeEnum.getCode.get(String.valueOf(map.get("businessCode"))), 1); // 获取申请编号
jgEnableDisable.setApplyNo(listResponseModel.getResult().get(0)); ResponseModel<List<String>> listResponseModel = tzsServiceFeignClient.applicationFormCode(ApplicationFormTypeEnum.getCode.get(String.valueOf(map.get("businessCode"))), 1);
jgEnableDisable.setSequenceNbr(sequence.nextId()); jgEnableDisable.setApplyNo(listResponseModel.getResult().get(0));
} jgEnableDisable.setSequenceNbr(sequence.nextId());
jgEnableDisable.setCreateDate(new Date()); }
String submit = String.valueOf(map.get("submit")); jgEnableDisable.setCreateDate(new Date());
String pageType = String.valueOf(map.get("formType")); String submit = String.valueOf(map.get("submit"));
List<Map<String, Object>> equipments = (List<Map<String, Object>>) map.get("equipments"); String pageType = String.valueOf(map.get("formType"));
String businessCode = ObjectUtils.isEmpty(map.get("applyType"))?String.valueOf(map.get("businessCode")):String.valueOf(map.get("applyType")); List<Map<String, Object>> equipments = (List<Map<String, Object>>) map.get("equipments");
// 接收机构 if (SUBMIT_TYPE_FLOW.equals(submit)) {//校验设备不能再多个流程中
String[] receiveOrgCode = String.valueOf(map.getString("receiveOrgCode")).split("_"); this.repeatUsedEquipCheck(equipments, reginParams.getCompany().getCompanyCode());
List<WorkflowResultDto> workflowResultList = new ArrayList<>(); }
String businessCode = ObjectUtils.isEmpty(map.get("applyType")) ? String.valueOf(map.get("businessCode")) : String.valueOf(map.get("applyType"));
// 接收机构
String[] receiveOrgCode = String.valueOf(map.getString("receiveOrgCode")).split("_");
List<WorkflowResultDto> workflowResultList = new ArrayList<>();
WorkflowResultDto workflowResultDto = new WorkflowResultDto();
List<ProcessTaskDTO> processTaskDTOS = new ArrayList<>();
jgEnableDisable.setOtherAccessories(JSONObject.toJSONString(Optional.ofNullable(map.get("otherAccessories")).orElse(Collections.emptyMap())));
if (SUBMIT_TYPE_FLOW.equals(submit)) {
if (map.containsKey("instanceId") && !ObjectUtils.isEmpty(map.get("instanceId"))) {
// 只调用执行API,返回下个节点信息,用于填充业务字段
//组装信息
TaskResultDTO dto = new TaskResultDTO();
dto.setResultCode("approvalStatus");
dto.setTaskId(jgEnableDisable.getNextTaskId());
HashMap<String, Object> commMap = new HashMap<>();
if (FlowStatusEnum.REJECTED.getName().equals(jgEnableDisable.getAuditStatus()) || FlowStatusEnum.ROLLBACK.getName().equals(jgEnableDisable.getAuditStatus())) {
commMap.put("approvalStatus", "提交");
//下一节点执行人单位(下节点接收机构code)
dto.setNextExecuteUserCompanyCode(jgEnableDisable.getReceiveCompanyCode());
} else {
commMap.put("approvalStatus", submit);
//下一节点执行人单位(下节点接收机构code)
dto.setNextExecuteUserCompanyCode(jgEnableDisable.getUseUnitCreditCode());
}
WorkflowResultDto workflowResultDto = new WorkflowResultDto(); dto.setVariable(commMap);
List<ProcessTaskDTO> processTaskDTOS = new ArrayList<>(); ProcessTaskDTO processTaskDTO = iCmWorkflowService.completeOrReject(jgEnableDisable.getNextTaskId(), dto, "0");
jgEnableDisable.setOtherAccessories(JSONObject.toJSONString(Optional.ofNullable(map.get("otherAccessories")).orElse(Collections.emptyMap()))); processTaskDTOS.add(processTaskDTO);
// 提取节点等信息
if (SUBMIT_TYPE_FLOW.equals(submit)) { workflowResultDto = commonService.buildWorkFlowInfo(Collections.singletonList(processTaskDTO)).get(0);
if (map.containsKey("instanceId") && !ObjectUtils.isEmpty(map.get("instanceId"))){ workflowResultList.add(workflowResultDto);
// 只调用执行API,返回下个节点信息,用于填充业务字段 if (!ObjectUtils.isEmpty(jgEnableDisable.getExecuteSequence())) {
//组装信息 jgEnableDisable.setExecuteSequence(jgEnableDisable.getExecuteSequence() + "," + workflowResultDto.getNextExecutorRoleIds());
TaskResultDTO dto = new TaskResultDTO(); } else {
dto.setResultCode("approvalStatus"); jgEnableDisable.setExecuteSequence(workflowResultDto.getNextExecutorRoleIds());
dto.setTaskId(jgEnableDisable.getNextTaskId()); }
HashMap<String, Object> commMap = new HashMap<>(); jgEnableDisable.setPromoter(RequestContext.getExeUserId());
if (FlowStatusEnum.REJECTED.getName().equals(jgEnableDisable.getAuditStatus()) || FlowStatusEnum.ROLLBACK.getName().equals(jgEnableDisable.getAuditStatus())) { jgEnableDisable.setNextExecutorIds(String.join(",", workflowResultDto.getNextExecutorRoleIds()));
commMap.put("approvalStatus", "提交"); jgEnableDisable.setAuditStatus(String.valueOf(FlowStatusEnum.TO_BE_PROCESSED.getName()));
//下一节点执行人单位(下节点接收机构code) jgEnableDisable.setNextTaskId(workflowResultDto.getNextTaskId());
dto.setNextExecuteUserCompanyCode(jgEnableDisable.getReceiveCompanyCode()); jgEnableDisable.setNextExecuteUserIds(workflowResultDto.getNextExecutorUserIds());
this.baseMapper.updateById(jgEnableDisable);
// 上个代办改为已办
HashMap<String, Object> map1 = new HashMap<>();
map1.put("taskStatus", FlowStatusEnum.TO_BE_PROCESSED.getCode());
map1.put("taskStatusLabel", FlowStatusEnum.TO_BE_PROCESSED.getName());
map1.put("relationId", jgEnableDisable.getInstanceId());
map1.put("flowStatus", FlowStatusEnum.TO_BE_PROCESSED.getCode());
map1.put("flowStatusLabel", FlowStatusEnum.TO_BE_PROCESSED.getName());
TaskV2Model taskV2Model = commonService.updateTaskModel(map1);
if (ObjectUtils.isEmpty(taskV2Model)) {
TaskModelDto taskModelDto = new TaskModelDto();
BeanUtils.copyProperties(taskV2Model, taskModelDto);
// 创建新的代办
TaskMessageDto taskMessageDto = new TaskMessageDto();
BeanUtils.copyProperties(jgEnableDisable, taskMessageDto);
taskModelDto.setModel(taskMessageDto);
taskModelDto.setTaskName(workflowResultDto.getNextTaskName());
taskModelDto.setExecuteUserIds(workflowResultDto.getNextExecutorUserIds());
taskModelDto.setFlowStatus(FlowStatusEnum.TO_BE_PROCESSED.getCode());
taskModelDto.setFlowStatusLabel(FlowStatusEnum.TO_BE_PROCESSED.getName());
taskModelDto.setFlowCode(jgEnableDisable.getNextTaskId());
taskModelDto.setNextExecuteUser(workflowResultDto.getNextExecutorRoleIds());
commonService.buildTaskModel(Collections.singletonList(taskModelDto));
}
} else { } else {
commMap.put("approvalStatus", submit); // 启动工作流并返回信息
//下一节点执行人单位(下节点接收机构code) workflowResultList = workFlowInfo(submit, jgEnableDisable, receiveOrgCode[0]);
dto.setNextExecuteUserCompanyCode(jgEnableDisable.getUseUnitCreditCode()); //业务数据组装等
businessData(submit, reginParams, jgEnableDisable, map, workflowResultList);
// 关联设备表
for (Map<String, Object> equipment : equipments) {
JgEnableDisableEq jgEnableDisableEq = new JgEnableDisableEq();
jgEnableDisableEq.setEquId(String.valueOf(equipment.get("SEQUENCE_NBR")));
jgEnableDisableEq.setEnableDisableApplyId(jgEnableDisable.getSequenceNbr().toString());
jgEnableDisableEqService.saveOrUpdate(jgEnableDisableEq);
}
} }
dto.setVariable(commMap); commonService.saveExecuteFlowData2Redis(jgEnableDisable.getInstanceId(), buildInstanceRuntimeData(jgEnableDisable));
ProcessTaskDTO processTaskDTO = iCmWorkflowService.completeOrReject(jgEnableDisable.getNextTaskId(), dto, "0"); } else {
processTaskDTOS.add(processTaskDTO); jgEnableDisable.setNextExecuteUserIds(reginParams.getUserModel().getUserId());
// 提取节点等信息 jgEnableDisable.setCreateUserId(reginParams.getUserModel().getUserId());
workflowResultDto = commonService.buildWorkFlowInfo(Collections.singletonList(processTaskDTO)).get(0); jgEnableDisable.setCreateUserName(reginParams.getUserModel().getRealName());
workflowResultList.add(workflowResultDto); jgEnableDisable.setUseUnitCreditCode(reginParams.getCompany().getCompanyCode());
if (!ObjectUtils.isEmpty(jgEnableDisable.getExecuteSequence())) { jgEnableDisable.setUseUnitName(reginParams.getCompany().getCompanyName());
jgEnableDisable.setExecuteSequence(jgEnableDisable.getExecuteSequence() + "," + workflowResultDto.getNextExecutorRoleIds()); jgEnableDisable.setReceiveCompanyCode(receiveOrgCode[0]);
} else { jgEnableDisable.setReceiveOrgName(receiveOrgCode[1]);
jgEnableDisable.setExecuteSequence(workflowResultDto.getNextExecutorRoleIds()); jgEnableDisable.setRemark(map.get("remark") == null ? "" : map.get("remark").toString());
} jgEnableDisable.setApplyDate(new Date());
jgEnableDisable.setPromoter(RequestContext.getExeUserId()); jgEnableDisable.setApplyType(String.valueOf(map.get("applyType")));
jgEnableDisable.setNextExecutorIds(String.join(",", workflowResultDto.getNextExecutorRoleIds())); jgEnableDisable.setAuditStatus(ObjectUtils.isEmpty(jgEnableDisable.getAuditStatus()) ? FlowStatusEnum.TO_BE_SUBMITTED.getName() : jgEnableDisable.getAuditStatus());
jgEnableDisable.setAuditStatus(String.valueOf(FlowStatusEnum.TO_BE_PROCESSED.getName())); }
jgEnableDisable.setNextTaskId(workflowResultDto.getNextTaskId()); // 仅保存
jgEnableDisable.setNextExecuteUserIds(workflowResultDto.getNextExecutorUserIds()); this.saveOrUpdate(jgEnableDisable);
if ("add".equals(pageType)) {
buildTask(Arrays.asList(jgEnableDisable), businessCode, workflowResultList, Boolean.FALSE);
} else {
// 编辑
jgEnableDisable.setSequenceNbr(Long.valueOf(String.valueOf(map.get("sequenceNbr"))));
this.baseMapper.updateById(jgEnableDisable); this.baseMapper.updateById(jgEnableDisable);
// 上个代办改为已办 LambdaQueryWrapper<JgEnableDisableEq> lambda = new QueryWrapper<JgEnableDisableEq>().lambda();
HashMap<String, Object> map1 = new HashMap<>(); lambda.eq(JgEnableDisableEq::getEnableDisableApplyId, String.valueOf(map.get("sequenceNbr")));
map1.put("taskStatus", FlowStatusEnum.TO_BE_PROCESSED.getCode()); jgEnableDisableEqService.getBaseMapper().delete(lambda);
map1.put("taskStatusLabel", FlowStatusEnum.TO_BE_PROCESSED.getName()); }
map1.put("relationId", jgEnableDisable.getInstanceId()); if (!SUBMIT_TYPE_FLOW.equals(submit)) {
map1.put("flowStatus", FlowStatusEnum.TO_BE_PROCESSED.getCode()); // 暂存任务
map1.put("flowStatusLabel", FlowStatusEnum.TO_BE_PROCESSED.getName()); buildTaskDraft(jgEnableDisable);
TaskV2Model taskV2Model = commonService.updateTaskModel(map1);
if (ObjectUtils.isEmpty(taskV2Model)) {
TaskModelDto taskModelDto = new TaskModelDto();
BeanUtils.copyProperties(taskV2Model, taskModelDto);
// 创建新的代办
TaskMessageDto taskMessageDto = new TaskMessageDto();
BeanUtils.copyProperties(jgEnableDisable, taskMessageDto);
taskModelDto.setModel(taskMessageDto);
taskModelDto.setTaskName(workflowResultDto.getNextTaskName());
taskModelDto.setExecuteUserIds(workflowResultDto.getNextExecutorUserIds());
taskModelDto.setFlowStatus(FlowStatusEnum.TO_BE_PROCESSED.getCode());
taskModelDto.setFlowStatusLabel(FlowStatusEnum.TO_BE_PROCESSED.getName());
taskModelDto.setFlowCode(jgEnableDisable.getNextTaskId());
taskModelDto.setNextExecuteUser(workflowResultDto.getNextExecutorRoleIds());
commonService.buildTaskModel(Collections.singletonList(taskModelDto));
}
} else { } else {
// 启动工作流并返回信息 buildTask(Arrays.asList(jgEnableDisable), businessCode, workflowResultList, Boolean.TRUE);
workflowResultList = workFlowInfo(submit, jgEnableDisable,receiveOrgCode[0]);
//业务数据组装等
businessData(submit, reginParams, jgEnableDisable, map, workflowResultList);
// 关联设备表
for (Map<String, Object> equipment : equipments) {
JgEnableDisableEq jgEnableDisableEq = new JgEnableDisableEq();
jgEnableDisableEq.setEquId(String.valueOf(equipment.get("SEQUENCE_NBR")));
jgEnableDisableEq.setEnableDisableApplyId(jgEnableDisable.getSequenceNbr().toString());
jgEnableDisableEqService.saveOrUpdate(jgEnableDisableEq);
}
} }
// 保存历史表
commonService.saveExecuteFlowData2Redis(jgEnableDisable.getInstanceId(), buildInstanceRuntimeData(jgEnableDisable)); commonService.saveOrUpdateHistory(this.getRegistrationClass(jgEnableDisable), map, null, jgEnableDisable.getSequenceNbr().toString());
} else { return Collections.singletonList(jgEnableDisable);
jgEnableDisable.setNextExecuteUserIds(reginParams.getUserModel().getUserId()); } catch (BadRequest | LocalBadRequest e) {
jgEnableDisable.setCreateUserId(reginParams.getUserModel().getUserId()); log.error(e.getMessage(), e);
jgEnableDisable.setCreateUserName(reginParams.getUserModel().getRealName()); this.rollBackForDelRedisData();
jgEnableDisable.setUseUnitCreditCode(reginParams.getCompany().getCompanyCode()); throw e;
jgEnableDisable.setUseUnitName(reginParams.getCompany().getCompanyName()); } catch (Exception e) {
jgEnableDisable.setReceiveCompanyCode(receiveOrgCode[0]); log.error(e.getMessage(), e);
jgEnableDisable.setReceiveOrgName(receiveOrgCode[1]); this.rollBackForDelRedisData();
jgEnableDisable.setRemark(map.get("remark") == null ? "" : map.get("remark").toString()); throw new BadRequest("保存失败!");
jgEnableDisable.setApplyDate(new Date()); } finally {
jgEnableDisable.setApplyType(String.valueOf(map.get("applyType"))); FlowingEquipRedisContext.clean();
jgEnableDisable.setAuditStatus(ObjectUtils.isEmpty(jgEnableDisable.getAuditStatus()) ? FlowStatusEnum.TO_BE_SUBMITTED.getName() : jgEnableDisable.getAuditStatus());
}
// 仅保存
this.saveOrUpdate(jgEnableDisable);
if ("add".equals(pageType)) {
buildTask(Arrays.asList(jgEnableDisable), businessCode, workflowResultList, Boolean.FALSE);
} else {
// 编辑
jgEnableDisable.setSequenceNbr(Long.valueOf(String.valueOf(map.get("sequenceNbr"))));
this.baseMapper.updateById(jgEnableDisable);
LambdaQueryWrapper<JgEnableDisableEq> lambda = new QueryWrapper<JgEnableDisableEq>().lambda();
lambda.eq(JgEnableDisableEq::getEnableDisableApplyId, String.valueOf(map.get("sequenceNbr")));
jgEnableDisableEqService.getBaseMapper().delete(lambda);
} }
if(!SUBMIT_TYPE_FLOW.equals(submit)){ }
// 暂存任务
buildTaskDraft(jgEnableDisable); private void repeatUsedEquipCheck(List<Map<String, Object>> equipList, String companyCode) {
} else { equipList.forEach(equipMap -> EquipUsedCheckStrategyContext.getUsedStrategy(PROCESS_DEFINITION_KEY)
buildTask(Arrays.asList(jgEnableDisable), businessCode, workflowResultList, Boolean.TRUE); .equipRepeatUsedCheck(String.valueOf(equipMap.get("record")), companyCode));
}
/**
* 删除 redis校验重复引用设备的数据
*/
private void delRepeatUseEquipData(JgEnableDisable notice) {
if (NOT_FLOWING_STATE.contains(notice.getAuditStatus())) {
LambdaQueryWrapper<JgEnableDisableEq> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(JgEnableDisableEq::getEnableDisableApplyId, notice.getSequenceNbr());
List<JgEnableDisableEq> noticeEqList = jgEnableDisableEqService.list(queryWrapper);
noticeEqList.forEach(noticeEq -> EquipUsedCheckStrategyContext.getUsedStrategy(PROCESS_DEFINITION_KEY)
.delDataForCheckEquipRepeatUsed(Collections.singletonList(noticeEq.getEquId()), notice.getUseUnitCreditCode()));
} }
// 保存历史表
commonService.saveOrUpdateHistory(this.getRegistrationClass(jgEnableDisable), map, null, jgEnableDisable.getSequenceNbr().toString());
return Collections.singletonList(jgEnableDisable);
} }
private String getRegistrationClass(JgEnableDisable jgEnableDisable){ private void rollBackForDelRedisData() {
FlowingEquipRedisContext.getContext().forEach(e -> {
EquipUsedCheckStrategyContext.getUsedStrategy(PROCESS_DEFINITION_KEY)
.delDataForCheckWithKey(e.getData(), e.getRedisKey());
});
}
private String getRegistrationClass(JgEnableDisable jgEnableDisable) {
// SB_QY启用,SB_TY停用 // SB_QY启用,SB_TY停用
if(APPLY_TYPE_QY.equals(jgEnableDisable.getApplyType())){ if (APPLY_TYPE_QY.equals(jgEnableDisable.getApplyType())) {
return BusinessTypeEnum.JG_EQUIPMENT_START.getName(); return BusinessTypeEnum.JG_EQUIPMENT_START.getName();
} else { } else {
return BusinessTypeEnum.JG_EQUIPMENT_STOP.getName(); return BusinessTypeEnum.JG_EQUIPMENT_STOP.getName();
...@@ -261,6 +305,7 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto, ...@@ -261,6 +305,7 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto,
/** /**
* 暂存任务生成待办 * 暂存任务生成待办
*
* @param jgEnableDisable 业务信息 * @param jgEnableDisable 业务信息
*/ */
private void buildTaskDraft(JgEnableDisable jgEnableDisable) { private void buildTaskDraft(JgEnableDisable jgEnableDisable) {
...@@ -327,14 +372,14 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto, ...@@ -327,14 +372,14 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto,
/** /**
* 插入代办 * 插入代办
*/ */
private void buildTask(List<JgEnableDisable> list,String businessCode, List<WorkflowResultDto> workflowResultList,Boolean bool) { private void buildTask(List<JgEnableDisable> list, String businessCode, List<WorkflowResultDto> workflowResultList, Boolean bool) {
String taskType = businessCode.equals(ApplicationFormTypeEnum.SBQY.getBusinessCode())?BusinessTypeEnum.JG_EQUIPMENT_START.getCode():BusinessTypeEnum.JG_EQUIPMENT_STOP.getCode(); String taskType = businessCode.equals(ApplicationFormTypeEnum.SBQY.getBusinessCode()) ? BusinessTypeEnum.JG_EQUIPMENT_START.getCode() : BusinessTypeEnum.JG_EQUIPMENT_STOP.getCode();
String taskTypeLabel = businessCode.equals(ApplicationFormTypeEnum.SBQY.getBusinessCode())?BusinessTypeEnum.JG_EQUIPMENT_START.getName():BusinessTypeEnum.JG_EQUIPMENT_STOP.getName(); String taskTypeLabel = businessCode.equals(ApplicationFormTypeEnum.SBQY.getBusinessCode()) ? BusinessTypeEnum.JG_EQUIPMENT_START.getName() : BusinessTypeEnum.JG_EQUIPMENT_STOP.getName();
List<TaskModelDto> taskModelDtoList = new ArrayList<>(); List<TaskModelDto> taskModelDtoList = new ArrayList<>();
list.forEach(item -> { list.forEach(item -> {
TaskModelDto taskModelDto = new TaskModelDto(); TaskModelDto taskModelDto = new TaskModelDto();
taskModelDto.setFlowCreateDate(item.getCreateDate()); taskModelDto.setFlowCreateDate(item.getCreateDate());
if(workflowResultList.size()>0){ if (workflowResultList.size() > 0) {
taskModelDto.setTaskName(workflowResultList.get(0).getNextTaskName()); // 工作流API返回 taskModelDto.setTaskName(workflowResultList.get(0).getNextTaskName()); // 工作流API返回
taskModelDto.setExecuteUserIds(workflowResultList.get(0).getNextExecutorUserIds()); // 工作流API返回 taskModelDto.setExecuteUserIds(workflowResultList.get(0).getNextExecutorUserIds()); // 工作流API返回
} }
...@@ -358,27 +403,26 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto, ...@@ -358,27 +403,26 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto,
taskModelDtoList.add(taskModelDto); taskModelDtoList.add(taskModelDto);
if (bool) { if (bool) {
// 删除暂存时生成的待办 // 删除暂存时生成的待办
commonService.deleteTasksByRelationId(item.getSequenceNbr()+""); commonService.deleteTasksByRelationId(item.getSequenceNbr() + "");
} }
}); });
if(bool){ if (bool) {
commonService.buildTaskModel(taskModelDtoList); commonService.buildTaskModel(taskModelDtoList);
} }
} }
public Page<Map<String, Object>> pageList(Page<Map<String, Object>> page, String sort, JgEnableDisableDto dto) {
public Page<Map<String, Object>> pageList(Page<Map<String, Object>> page,String sort, JgEnableDisableDto dto) {
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);
if ("company".equals(reginParams.getCompany().getLevel())) { if ("company".equals(reginParams.getCompany().getLevel())) {
dto.setUseUnitCreditCode(reginParams.getCompany().getCompanyCode()); dto.setUseUnitCreditCode(reginParams.getCompany().getCompanyCode());
} else { } else {
dto.setReceiveCompanyCode(reginParams.getCompany().getCompanyCode()); dto.setReceiveCompanyCode(reginParams.getCompany().getCompanyCode());
} }
String level = reginParams.getCompany().getLevel(); String level = reginParams.getCompany().getLevel();
String userId = reginParams.getUserModel().getUserId(); String userId = reginParams.getUserModel().getUserId();
SortVo sortMap = commonService.sortFieldConversion(sort); SortVo sortMap = commonService.sortFieldConversion(sort);
return this.baseMapper.pageList(page,sortMap, dto, level,userId); return this.baseMapper.pageList(page, sortMap, dto, level, userId);
} }
...@@ -398,14 +442,14 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto, ...@@ -398,14 +442,14 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto,
} }
/** /**
* 工作流启动并执行 * 工作流启动并执行
* @param submitType 是否提交 *
* @param submitType 是否提交
* @param jgEnableDisable 业务数据 * @param jgEnableDisable 业务数据
* @return 工作流返回相关数据 * @return 工作流返回相关数据
*/ */
private List<WorkflowResultDto> workFlowInfo(String submitType, JgEnableDisable jgEnableDisable,String receiveOrgCode) { private List<WorkflowResultDto> workFlowInfo(String submitType, JgEnableDisable jgEnableDisable, String receiveOrgCode) {
if (SUBMIT_TYPE_FLOW.equals(submitType)) { if (SUBMIT_TYPE_FLOW.equals(submitType)) {
ActWorkflowBatchDTO actWorkflowBatchDTO = new ActWorkflowBatchDTO(); ActWorkflowBatchDTO actWorkflowBatchDTO = new ActWorkflowBatchDTO();
List<ActWorkflowStartDTO> list = new ArrayList<>(); List<ActWorkflowStartDTO> list = new ArrayList<>();
...@@ -435,7 +479,7 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto, ...@@ -435,7 +479,7 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto,
try { try {
boolean isLocked = lock.tryLock(0, 180, TimeUnit.SECONDS); boolean isLocked = lock.tryLock(0, 180, TimeUnit.SECONDS);
// 解决并发问题:多个人同时操作一个流程(并发执行通过、驳回、撤回) // 解决并发问题:多个人同时操作一个流程(并发执行通过、驳回、撤回)
if(!isLocked){ if (!isLocked) {
throw new BadRequest("当前流程已经被执行!请重新打开页面查看并执行!"); throw new BadRequest("当前流程已经被执行!请重新打开页面查看并执行!");
} }
// 流程执行时,状态及权限校验 // 流程执行时,状态及权限校验
...@@ -531,10 +575,11 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto, ...@@ -531,10 +575,11 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto,
// redis流程实时数据更新 // redis流程实时数据更新
commonService.saveExecuteFlowData2Redis(instanceId, this.buildInstanceRuntimeData(jgEnableDisable)); commonService.saveExecuteFlowData2Redis(instanceId, this.buildInstanceRuntimeData(jgEnableDisable));
this.delRepeatUseEquipData(jgEnableDisable);
} catch (InterruptedException e) { } catch (InterruptedException e) {
e.printStackTrace(); e.printStackTrace();
} finally { } finally {
if(lock.isHeldByCurrentThread()){ if (lock.isHeldByCurrentThread()) {
lock.unlock(); lock.unlock();
} }
} }
...@@ -546,7 +591,7 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto, ...@@ -546,7 +591,7 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto,
lambdaEq.eq(JgEnableDisableEq::getEnableDisableApplyId, jgEnableDisable.getSequenceNbr()); lambdaEq.eq(JgEnableDisableEq::getEnableDisableApplyId, jgEnableDisable.getSequenceNbr());
JgEnableDisableEq jgScrapCancelEq = jgEnableDisableEqMapper.selectOne(lambdaEq); JgEnableDisableEq jgScrapCancelEq = jgEnableDisableEqMapper.selectOne(lambdaEq);
IdxBizJgUseInfo idxBizJgUseInfo = new IdxBizJgUseInfo(); IdxBizJgUseInfo idxBizJgUseInfo = new IdxBizJgUseInfo();
if(APPLY_TYPE_QY.equals(jgEnableDisable.getApplyType())){ if (APPLY_TYPE_QY.equals(jgEnableDisable.getApplyType())) {
// 1启用 // 1启用
idxBizJgUseInfo.setEquState(String.valueOf(EquimentEnum.ZAIYONG.getCode())); idxBizJgUseInfo.setEquState(String.valueOf(EquimentEnum.ZAIYONG.getCode()));
} else { } else {
...@@ -568,15 +613,16 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto, ...@@ -568,15 +613,16 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto,
try { try {
tzsServiceFeignClient.commonUpdateEsDataByIds(resultMap); tzsServiceFeignClient.commonUpdateEsDataByIds(resultMap);
} catch (Exception e) { } catch (Exception e) {
log.error("更新es失败", e.getCause()); log.error("更新es失败", e.getCause());
} }
} }
/** /**
* 执行工作流并返回组装好的工作流信息 * 执行工作流并返回组装好的工作流信息
* @param op 是否通过 *
* @param opinion 备注信息 * @param op 是否通过
* @param opinion 备注信息
* @param jgEnableDisable 业务信息 * @param jgEnableDisable 业务信息
* @return 返回组装好的工作流信息 * @return 返回组装好的工作流信息
*/ */
...@@ -607,7 +653,7 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto, ...@@ -607,7 +653,7 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto,
try { try {
boolean isLocked = lock.tryLock(0, 180, TimeUnit.SECONDS); boolean isLocked = lock.tryLock(0, 180, TimeUnit.SECONDS);
// 解决并发问题:多个人同时操作一个流程(并发执行通过、驳回、撤回) // 解决并发问题:多个人同时操作一个流程(并发执行通过、驳回、撤回)
if(!isLocked){ if (!isLocked) {
throw new BadRequest("当前流程已经被执行!请重新打开页面查看并执行!"); throw new BadRequest("当前流程已经被执行!请重新打开页面查看并执行!");
} }
// 流程执行时,状态及权限校验 // 流程执行时,状态及权限校验
...@@ -623,7 +669,6 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto, ...@@ -623,7 +669,6 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto,
jgEnableDisable.setNextTaskId(workflowResultDto.getNextTaskId()); jgEnableDisable.setNextTaskId(workflowResultDto.getNextTaskId());
jgEnableDisable.setNextExecuteUserIds(workflowResultDto.getNextExecutorUserIds()); jgEnableDisable.setNextExecuteUserIds(workflowResultDto.getNextExecutorUserIds());
updateById(jgEnableDisable); updateById(jgEnableDisable);
// 删除待办 // 删除待办
JSONObject jsonObject = JSONObject.parseObject(JSONObject.toJSONString(jgEnableDisable)); JSONObject jsonObject = JSONObject.parseObject(JSONObject.toJSONString(jgEnableDisable));
jsonObject.put("nextExecuteUser", jgEnableDisable.getNextExecutorIds()); jsonObject.put("nextExecuteUser", jgEnableDisable.getNextExecutorIds());
...@@ -634,10 +679,11 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto, ...@@ -634,10 +679,11 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto,
// redis流程实时数据更新 // redis流程实时数据更新
commonService.saveExecuteFlowData2Redis(instanceId, this.buildInstanceRuntimeData(jgEnableDisable)); commonService.saveExecuteFlowData2Redis(instanceId, this.buildInstanceRuntimeData(jgEnableDisable));
this.delRepeatUseEquipData(jgEnableDisable);
} catch (InterruptedException e) { } catch (InterruptedException e) {
e.printStackTrace(); e.printStackTrace();
} finally { } finally {
if(lock.isHeldByCurrentThread()){ if (lock.isHeldByCurrentThread()) {
lock.unlock(); lock.unlock();
} }
} }
...@@ -710,7 +756,7 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto, ...@@ -710,7 +756,7 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto,
public void deleteMessage(Long sequenceNbr) { public void deleteMessage(Long sequenceNbr) {
JgEnableDisable jgEnableDisable = this.baseMapper.selectById(sequenceNbr); JgEnableDisable jgEnableDisable = this.baseMapper.selectById(sequenceNbr);
// 删除代办 + 中止流程 // 删除代办 + 中止流程
commonService.deleteTaskModel(String.valueOf(sequenceNbr),jgEnableDisable.getInstanceId()); commonService.deleteTaskModel(String.valueOf(sequenceNbr), jgEnableDisable.getInstanceId());
// 删除单子 // 删除单子
this.baseMapper.deleteById(sequenceNbr); this.baseMapper.deleteById(sequenceNbr);
// 删除单子对应eq // 删除单子对应eq
......
...@@ -72,6 +72,7 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto ...@@ -72,6 +72,7 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto
private static final String SUBMIT_TYPE_FLOW = "1"; private static final String SUBMIT_TYPE_FLOW = "1";
private static final String PROCESS_DEFINITION_KEY = "maintainNotice"; private static final String PROCESS_DEFINITION_KEY = "maintainNotice";
private static final String TABLE_PAGE_ID = "maintainInfo"; private static final String TABLE_PAGE_ID = "maintainInfo";
private final List<String> NOT_FLOWING_STATE = Arrays.asList("6610", "6614", "6615", "6617", "6616");
@Autowired @Autowired
IJgInstallationNoticeService iJgInstallationNoticeService; IJgInstallationNoticeService iJgInstallationNoticeService;
...@@ -199,15 +200,19 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto ...@@ -199,15 +200,19 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto
private void repeatUsedEquipCheck(List<Map<String, Object>> equipList, String companyCode) { 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)); equipList.forEach(equipMap -> EquipUsedCheckStrategyContext.getUsedStrategy(PROCESS_DEFINITION_KEY).equipRepeatUsedCheck(String.valueOf(equipMap.get("SEQUENCE_NBR")), companyCode));
} }
/** /**
* 删除 redis校验重复引用设备的数据 * 删除 redis校验重复引用设备的数据
*/ */
private void delRepeatUseEquipData(JgMaintainNotice notice) { private void delRepeatUseEquipData(JgMaintainNotice notice) {
LambdaQueryWrapper<JgMaintainNoticeEq> queryWrapper = new LambdaQueryWrapper<>(); if (NOT_FLOWING_STATE.contains(notice.getNoticeStatus())) {
queryWrapper.eq(JgMaintainNoticeEq::getEquipTransferId, notice.getSequenceNbr());
JgMaintainNoticeEq noticeEq = jgMaintainNoticeEqMapper.selectOne(queryWrapper); LambdaQueryWrapper<JgMaintainNoticeEq> queryWrapper = new LambdaQueryWrapper<>();
EquipUsedCheckStrategyContext.getUsedStrategy(PROCESS_DEFINITION_KEY) queryWrapper.eq(JgMaintainNoticeEq::getEquipTransferId, notice.getSequenceNbr());
.delDataForCheckEquipRepeatUsed(Collections.singletonList(noticeEq.getEquId()), notice.getInstallUnitCreditCode()); JgMaintainNoticeEq noticeEq = jgMaintainNoticeEqMapper.selectOne(queryWrapper);
EquipUsedCheckStrategyContext.getUsedStrategy(PROCESS_DEFINITION_KEY)
.delDataForCheckEquipRepeatUsed(Collections.singletonList(noticeEq.getEquId()), notice.getInstallUnitCreditCode());
}
} }
private void rollBackForDelRedisData() { private void rollBackForDelRedisData() {
...@@ -932,9 +937,9 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto ...@@ -932,9 +937,9 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto
jgMaintainNotice.setNextExecuteUserIds(workflowResultDto.getNextExecutorUserIds()); jgMaintainNotice.setNextExecuteUserIds(workflowResultDto.getNextExecutorUserIds());
jgMaintainNotice.setNextTaskId(workflowResultDto.getNextTaskId()); jgMaintainNotice.setNextTaskId(workflowResultDto.getNextTaskId());
jgMaintainNoticeMapper.updateById(jgMaintainNotice); jgMaintainNoticeMapper.updateById(jgMaintainNotice);
this.delRepeatUseEquipData(jgMaintainNotice);
} }
commonService.saveExecuteFlowData2Redis(instanceId, this.buildInstanceRuntimeData(jgMaintainNotice)); commonService.saveExecuteFlowData2Redis(instanceId, this.buildInstanceRuntimeData(jgMaintainNotice));
this.delRepeatUseEquipData(jgMaintainNotice);
} catch (InterruptedException e) { } catch (InterruptedException e) {
e.printStackTrace(); e.printStackTrace();
} finally { } finally {
......
...@@ -1346,8 +1346,8 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -1346,8 +1346,8 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
param.put("STATUS", "已认领"); param.put("STATUS", "已认领");
param.put("EQU_STATE", 1); param.put("EQU_STATE", 1);
param.put("IS_INTO_MANAGEMENT", true); 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", 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_SITE_CODE", String.valueOf(jsonObject.get("usePlace")));
param.put("ORG_BRANCH_CODE", split[0]); param.put("ORG_BRANCH_CODE", split[0]);
param.put("ORG_BRANCH_NAME", split[1]); param.put("ORG_BRANCH_NAME", split[1]);
param.put("EQU_CODE", dataMap.get("equCode")); param.put("EQU_CODE", dataMap.get("equCode"));
......
...@@ -880,7 +880,7 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform ...@@ -880,7 +880,7 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
param.put("STATUS", "已认领"); param.put("STATUS", "已认领");
param.put("EQU_STATE", 1); param.put("EQU_STATE", 1);
param.put("IS_INTO_MANAGEMENT", true); 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_CODE", jgVehicleInformation.getOrgBranchCode());
param.put("ORG_BRANCH_NAME", jgVehicleInformation.getOrgBranchName()); param.put("ORG_BRANCH_NAME", jgVehicleInformation.getOrgBranchName());
param.put("EQU_CODE", dataMap.get("equCode")); param.put("EQU_CODE", dataMap.get("equCode"));
......
...@@ -388,6 +388,7 @@ public class DPSubServiceImpl { ...@@ -388,6 +388,7 @@ public class DPSubServiceImpl {
JSONArray attachmentUploadDatas = matinfo.getJSONArray("datas"); JSONArray attachmentUploadDatas = matinfo.getJSONArray("datas");
if (!ValidationUtil.isEmpty(value)) { if (!ValidationUtil.isEmpty(value)) {
JSONObject attachmentUploadDatasObj = new JSONObject(); JSONObject attachmentUploadDatasObj = new JSONObject();
attachmentUploadDatasObj.put("label", visualParams.getString("label"));
attachmentUploadDatasObj.put("value", value); attachmentUploadDatasObj.put("value", value);
attachmentUploadDatasObj.put("type", "img"); attachmentUploadDatasObj.put("type", "img");
attachmentUploadDatas.add(attachmentUploadDatasObj); attachmentUploadDatas.add(attachmentUploadDatasObj);
...@@ -399,7 +400,7 @@ public class DPSubServiceImpl { ...@@ -399,7 +400,7 @@ public class DPSubServiceImpl {
attachmentUploadDatasObj.put("value", value); attachmentUploadDatasObj.put("value", value);
String accept = visualParams.getString("accept"); String accept = visualParams.getString("accept");
String label = visualParams.getString("label"); String label = visualParams.getString("label");
if (!ValidationUtil.isEmpty(displayName) && ("附件".equals(label) || "其他附件".equals(label))){ if (!ValidationUtil.isEmpty(displayName)){
label = label + "(" + displayName + ")"; label = label + "(" + displayName + ")";
} }
attachmentUploadDatasObj.put("label", label); attachmentUploadDatasObj.put("label", label);
...@@ -434,7 +435,7 @@ public class DPSubServiceImpl { ...@@ -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); datas.add(jsonObject);
} }
return datas; return datas;
...@@ -521,6 +522,11 @@ public class DPSubServiceImpl { ...@@ -521,6 +522,11 @@ public class DPSubServiceImpl {
Object bizResult = convertResult(JSONObject.parseObject(response), resultConvert); Object bizResult = convertResult(JSONObject.parseObject(response), resultConvert);
ResponseModel responseModel = JSONObject.parseObject(response, ResponseModel.class); ResponseModel responseModel = JSONObject.parseObject(response, ResponseModel.class);
if (200 != responseModel.getStatus()){
log.info("调用第三方接口失败, 请求地址:{}", apiObj);
throw new RuntimeException(String.format("调用第三方接口失败!"));
}
JSONObject ruleData = apiObj.getJSONObject("ruleData"); JSONObject ruleData = apiObj.getJSONObject("ruleData");
if (!ValidationUtil.isEmpty(ruleData)) { if (!ValidationUtil.isEmpty(ruleData)) {
String responseSuccess = ruleData.getString("responseSuccess").replace("data", ""); String responseSuccess = ruleData.getString("responseSuccess").replace("data", "");
......
...@@ -307,7 +307,7 @@ public class TzBaseEnterpriseInfoServiceImpl ...@@ -307,7 +307,7 @@ public class TzBaseEnterpriseInfoServiceImpl
TzBaseEnterpriseInfoDto tzBaseEnterpriseInfoDto = detail(tzBaseEnterpriseInfo.getSequenceNbr()); TzBaseEnterpriseInfoDto tzBaseEnterpriseInfoDto = detail(tzBaseEnterpriseInfo.getSequenceNbr());
RegUnitIcDto regUnitIcDto = tzBaseEnterpriseInfoDto.getRegUnitIcDto(); RegUnitIcDto regUnitIcDto = tzBaseEnterpriseInfoDto.getRegUnitIcDto();
String creditCode = tzBaseEnterpriseInfoDto.getUseCode(); 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 证件类型_证件号码) // 个人主体时截取证件号码(eg. 6600_210423195703287959 证件类型_证件号码)
if (creditCode.split("_").length > 1) { if (creditCode.split("_").length > 1) {
creditCode = creditCode.split("_")[1]; creditCode = creditCode.split("_")[1];
......
...@@ -90,6 +90,5 @@ public interface EquipmentCategoryMapper extends BaseMapper<EquipmentCategory> { ...@@ -90,6 +90,5 @@ public interface EquipmentCategoryMapper extends BaseMapper<EquipmentCategory> {
List<String> selectXiXianNew(); List<String> selectXiXianNew();
Long countEquipByReginCode(String orgCode);
} }
...@@ -6,6 +6,7 @@ import com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel; ...@@ -6,6 +6,7 @@ import com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 注册登记信息表 Mapper 接口 * 注册登记信息表 Mapper 接口
...@@ -24,5 +25,10 @@ public interface IdxBizJgRegisterInfoMapper extends BaseMapper<IdxBizJgRegisterI ...@@ -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})") @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); 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 @@ ...@@ -104,7 +104,8 @@
IS_INTO_MANAGEMENT, IS_INTO_MANAGEMENT,
WHETHER_VEHICLE_CYLINDER, WHETHER_VEHICLE_CYLINDER,
WHETHER_SKID_MOUNTED_PRESSURE_VESSEL, 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 from idx_biz_view_jg_all
WHERE SEQUENCE_NBR = #{id} WHERE SEQUENCE_NBR = #{id}
</select> </select>
......
...@@ -680,15 +680,4 @@ ...@@ -680,15 +680,4 @@
AND ( ibjoi."CODE96333" NOT LIKE'31%' OR ibjoi."CODE96333" IS NULL ) AND ( ibjoi."CODE96333" NOT LIKE'31%' OR ibjoi."CODE96333" IS NULL )
AND "CLAIM_STATUS" = '已认领'; AND "CLAIM_STATUS" = '已认领';
</select> </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> </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