Commit 76ae1d28 authored by tianyiming's avatar tianyiming

feat: 检验业务开通/监督检验列表查询增加监管单位查看逻辑

parent 6b282219
...@@ -35,7 +35,14 @@ public interface JyjcInspectionApplicationMapper extends BaseMapper<JyjcInspecti ...@@ -35,7 +35,14 @@ public interface JyjcInspectionApplicationMapper extends BaseMapper<JyjcInspecti
void updatePromoter(@org.apache.ibatis.annotations.Param("id") Long id); void updatePromoter(@org.apache.ibatis.annotations.Param("id") Long id);
Page<JyjcInspectionApplicationModel> selectForPage(@Param("page") Page<JyjcInspectionApplication> page, @Param("jyjcInspectionApplicationModel") JyjcInspectionApplicationModel jyjcInspectionApplicationModel, @Param("identity") String identity, @Param("currentApplicationUnitCode") String currentApplicationUnitCode, @Param("currentInspectionUnitCode") String currentInspectionUnitCode, @Param("currentUserId") String currentUserId, @Param("sort") SortVo sortMap); Page<JyjcInspectionApplicationModel> selectForPage(@Param("page") Page<JyjcInspectionApplication> page,
@Param("jyjcInspectionApplicationModel") JyjcInspectionApplicationModel jyjcInspectionApplicationModel,
@Param("identity") String identity,
@Param("currentApplicationUnitCode") String currentApplicationUnitCode,
@Param("currentInspectionUnitCode") String currentInspectionUnitCode,
@Param("currentUserId") String currentUserId,
@Param("sort") SortVo sortMap,
@Param("orgCode") String orgCode);
/** /**
* 查询待受理流流程状态的设备 * 查询待受理流流程状态的设备
......
...@@ -25,7 +25,8 @@ public interface JyjcOpeningApplicationMapper extends BaseMapper<JyjcOpeningAppl ...@@ -25,7 +25,8 @@ public interface JyjcOpeningApplicationMapper extends BaseMapper<JyjcOpeningAppl
@Param("jyjcOpeningApplicationRequstDto") JyjcOpeningApplicationRequstDto jyjcOpeningApplicationRequstDto, @Param("jyjcOpeningApplicationRequstDto") JyjcOpeningApplicationRequstDto jyjcOpeningApplicationRequstDto,
@Param("applyStartTime") String applyStartTime, @Param("applyStartTime") String applyStartTime,
@Param("currentUserId") String currentUserId, @Param("currentUserId") String currentUserId,
@Param("applyendTime") String applyendTime); @Param("applyendTime") String applyendTime,
@Param("orgCode") String orgCode);
void updatePromoter(@Param("id") Long id); void updatePromoter(@Param("id") Long id);
......
...@@ -16,7 +16,7 @@ import java.util.List; ...@@ -16,7 +16,7 @@ import java.util.List;
public interface IJyjcInspectionApplicationService { public interface IJyjcInspectionApplicationService {
Boolean deleteBatchData(List<Long> sequenceNbr); Boolean deleteBatchData(List<Long> sequenceNbr);
Page<JyjcInspectionApplicationModel> queryForPageList(Page<JyjcInspectionApplication> page, JyjcInspectionApplicationModel model, String sort); Page<JyjcInspectionApplicationModel> queryForPageList(Page<JyjcInspectionApplication> page, JyjcInspectionApplicationModel model, String sort,String client);
void export(String bizType, HttpServletResponse response, List<String> ids); void export(String bizType, HttpServletResponse response, List<String> ids);
} }
...@@ -62,18 +62,33 @@ ...@@ -62,18 +62,33 @@
</select> </select>
<sql id="page-list"> <sql id="page-list">
SELECT tzjia.*, <![CDATA[/*+ set(query_dop 16)*/ ]]>
WITH equip_data as (
SELECT
application_seq,
equip_unicode,
group_concat(distinct si."ORG_BRANCH_CODE") as orgBranchCodes
FROM
tz_jyjc_inspection_application_equip tzjiaeq
LEFT JOIN idx_biz_jg_supervision_info si ON si.record = tzjiaeq.equip_unicode
GROUP BY application_seq
)
SELECT
DISTINCT tzjia.sequence_nbr AS sequenceNbr,
tzjia.*,
case case
when tzjia.plan_data<![CDATA[ <>]]> '' then TRUE when tzjia.plan_data<![CDATA[ <>]]> '' then TRUE
else false END as isExistPlanData, else false END as isExistPlanData,
cdd1.NAME AS inspectionClassify, cdd1.NAME AS inspectionClassify,
cdd3.NAME AS inspectionType, cdd3.NAME AS inspectionType,
(SELECT name FROM "tz_equipment_category" ca where ca.code = tzjia.equip_classify) AS equipClassify, (SELECT name FROM "tz_equipment_category" ca where ca.code = tzjia.equip_classify) AS equipClassify,
cdd2.NAME AS statusName cdd2.NAME AS statusName,
ed.orgBranchCodes
FROM tz_jyjc_inspection_application AS tzjia FROM tz_jyjc_inspection_application AS tzjia
LEFT JOIN cb_data_dictionary cdd1 ON cdd1.code = tzjia.inspection_classify AND cdd1.TYPE = 'JYJCLB' LEFT JOIN cb_data_dictionary cdd1 ON cdd1.code = tzjia.inspection_classify AND cdd1.TYPE = 'JYJCLB'
LEFT JOIN cb_data_dictionary cdd2 ON cdd2.code = tzjia.status and cdd2.type = 'JYLCZT' LEFT JOIN cb_data_dictionary cdd2 ON cdd2.code = tzjia.status and cdd2.type = 'JYLCZT'
LEFT JOIN cb_data_dictionary cdd3 ON cdd3.code = tzjia.inspection_type AND cdd3.TYPE = 'JYJC' LEFT JOIN cb_data_dictionary cdd3 ON cdd3.code = tzjia.inspection_type AND cdd3.TYPE = 'JYJC'
LEFT JOIN equip_data ed on ed.application_seq = tzjia.sequence_nbr
</sql> </sql>
<select id="selectForPage" resultType="com.yeejoin.amos.boot.module.jyjc.api.model.JyjcInspectionApplicationModel"> <select id="selectForPage" resultType="com.yeejoin.amos.boot.module.jyjc.api.model.JyjcInspectionApplicationModel">
...@@ -120,20 +135,22 @@ ...@@ -120,20 +135,22 @@
<if test="jyjcInspectionApplicationModel.applicationUnitCode != null and jyjcInspectionApplicationModel.applicationUnitCode != ''"> <if test="jyjcInspectionApplicationModel.applicationUnitCode != null and jyjcInspectionApplicationModel.applicationUnitCode != ''">
and tzjia.application_unit_code = #{jyjcInspectionApplicationModel.applicationUnitCode} and tzjia.application_unit_code = #{jyjcInspectionApplicationModel.applicationUnitCode}
</if> </if>
<choose> <if test="identity == 'apply'">
<when test="identity == 'apply'"> and (tzjia.application_unit_code = #{currentApplicationUnitCode} OR tzjia.transfer_to_user_ids LIKE concat ( '%', #{currentUserId}, '%' ))
and (tzjia.application_unit_code = #{currentApplicationUnitCode} OR tzjia.transfer_to_user_ids LIKE concat ( '%', #{currentUserId}, '%' )) </if>
</when> <if test="identity == 'receive'">
<when test="identity == 'receive'"> and (tzjia.inspection_unit_code = #{currentInspectionUnitCode} OR tzjia.transfer_to_user_ids LIKE concat ( '%', #{currentUserId}, '%' ))
and (tzjia.inspection_unit_code = #{currentInspectionUnitCode} OR tzjia.transfer_to_user_ids LIKE concat ( '%', #{currentUserId}, '%' )) </if>
</when> <if test="identity == 'all'">
<when test="identity == 'all'"> and ((tzjia.application_unit_code = #{currentApplicationUnitCode} or tzjia.inspection_unit_code = #{currentInspectionUnitCode}) OR tzjia.transfer_to_user_ids LIKE concat ( '%', #{currentUserId}, '%' ))
and ((tzjia.application_unit_code = #{currentApplicationUnitCode} or tzjia.inspection_unit_code = #{currentInspectionUnitCode}) OR tzjia.transfer_to_user_ids LIKE concat ( '%', #{currentUserId}, '%' )) </if>
</when> <if test="orgCode != null and orgCode != ''">
<otherwise> AND tzjia.instance_id <![CDATA[<>]]> ''
1=2 AND EXISTS (
</otherwise> SELECT 1
</choose> FROM unnest(string_to_array(ed.orgBranchCodes, ',')) AS elem
WHERE elem LIKE concat(#{orgCode},'%' ) )
</if>
</where> </where>
order by order by
<if test="sort != null"> <if test="sort != null">
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
a.* a.*
from from
tz_jyjc_opening_application a tz_jyjc_opening_application a
LEFT JOIN tz_base_enterprise_info tbei ON a.unit_code = tbei.use_code
<where> <where>
<if test="jyjcOpeningApplicationRequstDto.applicationSeq != '' and jyjcOpeningApplicationRequstDto.applicationSeq != null"> <if test="jyjcOpeningApplicationRequstDto.applicationSeq != '' and jyjcOpeningApplicationRequstDto.applicationSeq != null">
and a.application_seq like concat('%',#{jyjcOpeningApplicationRequstDto.applicationSeq},'%') and a.application_seq like concat('%',#{jyjcOpeningApplicationRequstDto.applicationSeq},'%')
...@@ -37,6 +38,9 @@ ...@@ -37,6 +38,9 @@
<if test="jyjcOpeningApplicationRequstDto.unitCodeName != '' and jyjcOpeningApplicationRequstDto.unitCodeName != null"> <if test="jyjcOpeningApplicationRequstDto.unitCodeName != '' and jyjcOpeningApplicationRequstDto.unitCodeName != null">
and a.unit_code_name like concat('%',#{jyjcOpeningApplicationRequstDto.unitCodeName},'%') and a.unit_code_name like concat('%',#{jyjcOpeningApplicationRequstDto.unitCodeName},'%')
</if> </if>
<if test="orgCode != '' and orgCode != null">
and tbei.supervise_org_code like concat(#{orgCode},'%')
</if>
</where> </where>
order by sequence_nbr desc order by sequence_nbr desc
......
...@@ -18,6 +18,7 @@ import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgProjectContraption; ...@@ -18,6 +18,7 @@ import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgProjectContraption;
import com.yeejoin.amos.feign.systemctl.model.DictionarieModel; import com.yeejoin.amos.feign.systemctl.model.DictionarieModel;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.Assert; import org.springframework.util.Assert;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -142,11 +143,13 @@ public class JyjcInspectionApplicationController extends BaseController { ...@@ -142,11 +143,13 @@ public class JyjcInspectionApplicationController extends BaseController {
public ResponseModel<Page<JyjcInspectionApplicationModel>> queryForPageList(@RequestParam(value = "current") int current, public ResponseModel<Page<JyjcInspectionApplicationModel>> queryForPageList(@RequestParam(value = "current") int current,
@RequestParam(value = "size") int size, @RequestParam(value = "size") int size,
@RequestParam(value = "sort", required = false) String sort, @RequestParam(value = "sort", required = false) String sort,
@RequestBody JyjcInspectionApplicationModel model) { @RequestBody JyjcInspectionApplicationModel model,
@ApiParam(value = "客户端类型: jgAudit-监管审核;jgLook-监管查看") @RequestParam(value = "client", required = false, defaultValue = "jgAudit") String client
) {
Page<JyjcInspectionApplication> page = new Page<JyjcInspectionApplication>(); Page<JyjcInspectionApplication> page = new Page<JyjcInspectionApplication>();
page.setCurrent(current); page.setCurrent(current);
page.setSize(size); page.setSize(size);
return ResponseHelper.buildResponse(jyjcInspectionApplicationServiceImpl.queryForPageList(page, model, sort)); return ResponseHelper.buildResponse(jyjcInspectionApplicationServiceImpl.queryForPageList(page, model, sort,client));
} }
/** /**
......
...@@ -151,12 +151,15 @@ public class JyjcOpeningApplicationController extends BaseController { ...@@ -151,12 +151,15 @@ public class JyjcOpeningApplicationController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/page") @PostMapping(value = "/page")
@ApiOperation(httpMethod = "POST", value = "分页查询", notes = "分页查询") @ApiOperation(httpMethod = "POST", value = "分页查询", notes = "分页查询")
public ResponseModel<Page<JyjcOpeningApplicationModel>> queryForPage(@RequestParam(value = "current") int current, @RequestParam public ResponseModel<Page<JyjcOpeningApplicationModel>> queryForPage(@RequestParam(value = "current") int current,
(value = "size") int size, @RequestBody JyjcOpeningApplicationRequstDto jyjcOpeningApplicationRequstDto) { @RequestParam(value = "size") int size,
@RequestBody JyjcOpeningApplicationRequstDto jyjcOpeningApplicationRequstDto,
@ApiParam(value = "客户端类型: jgAudit-监管审核;jgLook-监管查看") @RequestParam(value = "client", required = false, defaultValue = "jgAudit") String client
) {
Page<JyjcOpeningApplication> page = new Page<JyjcOpeningApplication>(); Page<JyjcOpeningApplication> page = new Page<JyjcOpeningApplication>();
page.setCurrent(current); page.setCurrent(current);
page.setSize(size); page.setSize(size);
return ResponseHelper.buildResponse(jyjcOpeningApplicationServiceImpl.queryForJyjcOpeningApplicationPage(page, jyjcOpeningApplicationRequstDto)); return ResponseHelper.buildResponse(jyjcOpeningApplicationServiceImpl.queryForJyjcOpeningApplicationPage(page, jyjcOpeningApplicationRequstDto,client));
} }
/** /**
......
...@@ -9,7 +9,6 @@ import com.alibaba.fastjson.JSONArray; ...@@ -9,7 +9,6 @@ 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.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
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.CompanyBo;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
...@@ -44,7 +43,6 @@ import com.yeejoin.amos.boot.module.ymt.api.enums.ApplicationFormTypeEnum; ...@@ -44,7 +43,6 @@ import com.yeejoin.amos.boot.module.ymt.api.enums.ApplicationFormTypeEnum;
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.enums.EquipmentClassifityEnum; import com.yeejoin.amos.boot.module.ymt.api.enums.EquipmentClassifityEnum;
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.IdxBizJgProjectConstructionMapper;
import com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgProjectContraptionMapper; import com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgProjectContraptionMapper;
import com.yeejoin.amos.feign.privilege.Privilege; import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.CompanyModel; import com.yeejoin.amos.feign.privilege.model.CompanyModel;
...@@ -494,7 +492,7 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec ...@@ -494,7 +492,7 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
} }
@Override @Override
public Page<JyjcInspectionApplicationModel> queryForPageList(Page<JyjcInspectionApplication> page, JyjcInspectionApplicationModel model, String sort) { public Page<JyjcInspectionApplicationModel> queryForPageList(Page<JyjcInspectionApplication> page, JyjcInspectionApplicationModel model, String sort,String client) {
ReginParams reginParams = JSON.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class); ReginParams reginParams = JSON.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class);
SortVo sortMap = commonService.sortFieldConversion(sort); SortVo sortMap = commonService.sortFieldConversion(sort);
String companyType = reginParams.getCompany().getCompanyType(); String companyType = reginParams.getCompany().getCompanyType();
...@@ -517,7 +515,8 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec ...@@ -517,7 +515,8 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
currentApplicationUnitCode = companyCode; currentApplicationUnitCode = companyCode;
currentInspectionUnitCode = companyCode; currentInspectionUnitCode = companyCode;
} }
return this.getBaseMapper().selectForPage(page, model, identity, currentApplicationUnitCode, currentInspectionUnitCode, currentUserId, sortMap); String orgCode = "jgLook".equals(client) ? reginParams.getCompany().getOrgCode() : null;
return this.getBaseMapper().selectForPage(page, model, identity, currentApplicationUnitCode, currentInspectionUnitCode, currentUserId, sortMap,orgCode);
} }
/** /**
......
...@@ -456,7 +456,7 @@ public class JyjcOpeningApplicationServiceImpl extends BaseService<JyjcOpeningAp ...@@ -456,7 +456,7 @@ public class JyjcOpeningApplicationServiceImpl extends BaseService<JyjcOpeningAp
return this.queryForList("", false); return this.queryForList("", false);
} }
public Page<JyjcOpeningApplicationModel> queryForJyjcOpeningApplicationPage(Page<JyjcOpeningApplication> page, JyjcOpeningApplicationRequstDto dto) { public Page<JyjcOpeningApplicationModel> queryForJyjcOpeningApplicationPage(Page<JyjcOpeningApplication> page, JyjcOpeningApplicationRequstDto dto,String client) {
ReginParams reginParams = commonService.getReginParamsOfCurrentUser(); ReginParams reginParams = commonService.getReginParamsOfCurrentUser();
String companyLevel = CommonServiceImpl.getCompanyLevel(reginParams.getCompany()); String companyLevel = CommonServiceImpl.getCompanyLevel(reginParams.getCompany());
String currentUserId = RequestContext.getExeUserId(); String currentUserId = RequestContext.getExeUserId();
...@@ -467,6 +467,8 @@ public class JyjcOpeningApplicationServiceImpl extends BaseService<JyjcOpeningAp ...@@ -467,6 +467,8 @@ public class JyjcOpeningApplicationServiceImpl extends BaseService<JyjcOpeningAp
} else { } else {
dto.setType("supervision"); dto.setType("supervision");
} }
dto.setType("jgLook".equals(client) ? null : dto.getType());
String orgCode = "jgLook".equals(client) ? reginParams.getCompany().getOrgCode() : null;
String applyStartTime = ""; String applyStartTime = "";
String applyEndTime = ""; String applyEndTime = "";
if (ObjectUtils.isNotEmpty(dto.getApplyTime())) { if (ObjectUtils.isNotEmpty(dto.getApplyTime())) {
...@@ -474,7 +476,7 @@ public class JyjcOpeningApplicationServiceImpl extends BaseService<JyjcOpeningAp ...@@ -474,7 +476,7 @@ public class JyjcOpeningApplicationServiceImpl extends BaseService<JyjcOpeningAp
applyStartTime = date + " 00:00:00"; applyStartTime = date + " 00:00:00";
applyEndTime = date + " 23:59:59"; applyEndTime = date + " 23:59:59";
} }
Page<JyjcOpeningApplicationModel> result = jyjcOpeningApplicationMapper.selectJyjcOpeningApplicationList(page, dto, applyStartTime, currentUserId, applyEndTime); Page<JyjcOpeningApplicationModel> result = jyjcOpeningApplicationMapper.selectJyjcOpeningApplicationList(page, dto, applyStartTime, currentUserId, applyEndTime,orgCode);
for (JyjcOpeningApplicationModel openingApplicationModel : result.getRecords()) { for (JyjcOpeningApplicationModel openingApplicationModel : result.getRecords()) {
openingApplicationModel.setIdentityType(dto.getType()); openingApplicationModel.setIdentityType(dto.getType());
openingApplicationModel.setOpenBizTypeName(this.getOpenBizTypeName(openingApplicationModel.getOpenBizType())); openingApplicationModel.setOpenBizTypeName(this.getOpenBizTypeName(openingApplicationModel.getOpenBizType()));
......
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