Commit ada6d160 authored by tianyiming's avatar tianyiming

feat: 补证登记/车用气瓶变更登记/设备移交列表查询增加监管单位查看逻辑

parent 8c934585
......@@ -34,6 +34,8 @@ public class JgChangeVehicleRegistrationUnitDto extends BaseDto {
private String applyNo;
@ApiModelProperty(value = "申请日期")
@JsonFormat(pattern = "yyyy-MM-dd")
@JsonSerialize(using = BizCustomDateSerializer.class)
private Date applyDate;
@ApiModelProperty(value = "登记机构")
......@@ -46,6 +48,8 @@ public class JgChangeVehicleRegistrationUnitDto extends BaseDto {
private String receiveCompanyCode;
@ApiModelProperty(value = "终审通过时间")
@JsonFormat(pattern = "yyyy-MM-dd")
@JsonSerialize(using = BizCustomDateSerializer.class)
private Date auditPassDate;
@ApiModelProperty(value = "备注")
......
package com.yeejoin.amos.boot.module.jg.api.mapper;
import com.yeejoin.amos.boot.module.jg.api.entity.JgCertificateReplenish;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.jg.api.dto.JgCertificateReplenishDto;
import com.yeejoin.amos.boot.module.jg.api.entity.JgCertificateReplenish;
import com.yeejoin.amos.boot.module.jg.api.vo.SortVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 使用登记表补证 Mapper 接口
......@@ -9,6 +14,9 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* @author system_generator
* @date 2025-03-19
*/
@Mapper
public interface JgCertificateReplenishMapper extends BaseMapper<JgCertificateReplenish> {
Page<JgCertificateReplenish> queryForPage(Page<JgCertificateReplenish> page, @Param("sort") SortVo sortMap, @Param("dto") JgCertificateReplenishDto dto, @Param("type") String type, @Param("companyCode") String companyCode, @Param("orgCode") String orgCode);
}
......@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.jg.api.dto.CompanyEquipCountDto;
import com.yeejoin.amos.boot.module.jg.api.dto.JgChangeVehicleRegistrationUnitDto;
import com.yeejoin.amos.boot.module.jg.api.entity.JgChangeVehicleRegistrationUnit;
import com.yeejoin.amos.boot.module.jg.api.vo.SortVo;
import com.yeejoin.amos.boot.module.jg.api.vo.tableDataExportVo.ChangeVehicleRegistrationUnitVo;
import org.apache.ibatis.annotations.Param;
......@@ -21,12 +22,14 @@ public interface JgChangeVehicleRegistrationUnitMapper extends BaseMapper<JgChan
List<Map<String, Object>> getEquList(@Param("records") List<String>records);
Page<Map<String, Object>> getPage(@Param("page")Page<JgChangeVehicleRegistrationUnit>page,
@Param("dto")JgChangeVehicleRegistrationUnitDto dto,
@Param("type") String type,
@Param("orgCode") String orgCode,
@Param("currentUserId") String currentUserId,
@Param("roleIds") List<String> roleIds);
Page<Map<String, Object>> getPage(@Param("page") Page<JgChangeVehicleRegistrationUnit> page,
@Param("sort") SortVo sortMap,
@Param("dto") JgChangeVehicleRegistrationUnitDto dto,
@Param("type") String type,
@Param("companyCode") String companyCode,
@Param("currentUserId") String currentUserId,
@Param("roleIds") List<String> roleIds,
@Param("orgCode") String orgCode);
List<ChangeVehicleRegistrationUnitVo> queryChangeVehicleRegistrationUnitInIds(@Param("ids") List<String> ids);
......
......@@ -22,7 +22,9 @@ public interface JgEquipTransferMapper extends CustomBaseMapper<JgEquipTransfer>
Page<JgEquipTransferDto> queryForPage(Page<JgEquipTransferDto> page,
@Param("sort") SortVo sortMap,
@Param("param") JgEquipTransferDto model,
@Param("currentUserId") String currentUserId);
@Param("currentUserId") String currentUserId,
@Param("type") String type,
@Param("orgCode") String orgCode);
List<EquipTransferVo> queryEquipTransferInIds(@Param("ids") List<String> ids);
......
......@@ -24,7 +24,7 @@ public interface IJgEquipTransferService extends IService<JgEquipTransfer> {
* @param dto 查询参数
* @return 设备移交分页列表
*/
Page<JgEquipTransferDto> queryForJgEquipTransferPage(Page<JgEquipTransferDto> page,String sort, JgEquipTransferDto dto, ReginParams reginParams);
Page<JgEquipTransferDto> queryForJgEquipTransferPage(Page<JgEquipTransferDto> page,String sort, JgEquipTransferDto dto, ReginParams reginParams,String client);
/**
* 根据sequenceNbr查询
*
......
......@@ -2,4 +2,82 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.jg.api.mapper.JgCertificateReplenishMapper">
<sql id="page_list">
<![CDATA[/*+ set(query_dop 16)*/ ]]>
WITH equip_data as (
SELECT
certificate_replenish_id,
equ_id,
group_concat(distinct si."ORG_BRANCH_CODE") as orgBranchCodes
FROM
tzs_jg_certificate_replenish_eq tjcreq
LEFT JOIN idx_biz_jg_supervision_info si ON si.record = tjcreq.equ_id
GROUP BY certificate_replenish_id
)
select
DISTINCT tjcr.sequence_nbr AS sequenceNbr,
tjcr.*,
ed.orgBranchCodes
</sql>
<select id="queryForPage" resultType="com.yeejoin.amos.boot.module.jg.api.entity.JgCertificateReplenish">
<include refid="page_list"/>
FROM tzs_jg_certificate_replenish tjcr
LEFT JOIN equip_data ed on ed.certificate_replenish_id = tjcr.sequence_nbr
<where>
tjcr.is_delete = 0
<if test="dto != null">
<if test="dto.applyNo != null and dto.applyNo != ''">
AND tjcr.apply_no LIKE CONCAT('%', #{dto.applyNo}, '%')
</if>
<if test="dto.useRegistrationCode != null and dto.useRegistrationCode != ''">
AND tjcr.use_registration_code LIKE CONCAT('%', #{dto.useRegistrationCode}, '%')
</if>
<if test="dto.useRegistrationCode != null and dto.useRegistrationCode != ''">
AND tjcr.use_registration_code LIKE CONCAT('%', #{dto.useRegistrationCode}, '%')
</if>
<if test="dto.useUnitCode != null and dto.useUnitCode != ''">
AND tjcr.use_unit_code LIKE CONCAT('%', #{dto.useUnitCode}, '%')
</if>
<if test="dto.useUnitName != null and dto.useUnitName != ''">
AND tjcr.use_unit_name LIKE CONCAT('%', #{dto.useUnitName}, '%')
</if>
<if test="dto.applyStatus != null and dto.applyStatus != ''">
AND tjcr.apply_status = #{dto.applyStatus}
</if>
<if test="dto.equListCode != null and dto.equListCode != ''">
AND tjcr.equ_list_code LIKE CONCAT('%', #{dto.equListCode}, '%')
</if>
<if test="dto.applicationReason != null and dto.applicationReason != ''">
AND tjcr.application_reason = #{dto.applicationReason}
</if>
<if test="dto.lossDamageTime != null and dto.lossDamageTime != ''">
AND tjcr.loss_damage_time = #{dto.lossDamageTime}
</if>
<if test="dto.acceptDate != null and dto.acceptDate != ''">
AND tjcr.accept_date = #{dto.acceptDate}
</if>
<if test="type == 'supervision'">
AND tjcr.instance_id <![CDATA[<>]]> ''
AND tjcr.receive_company_code = #{companyCode}
</if>
<if test="type == 'enterprise'">
AND tjcr.use_unit_code = #{dto.useUnitCode}
</if>
<if test="orgCode != null and orgCode != ''">
AND tjcr.instance_id <![CDATA[<>]]> ''
AND EXISTS (
SELECT 1
FROM unnest(string_to_array(ed.orgBranchCodes, ',')) AS elem
WHERE elem LIKE concat(#{orgCode},'%' ) )
</if>
</if>
</where>
ORDER BY
<if test="sort != null">
tjcr.${sort.field} ${sort.sortType},
</if>
tjcr.create_date DESC, tjcr.apply_no DESC
</select>
</mapper>
......@@ -48,7 +48,8 @@
concat(use."PROVINCE_NAME", '', use."CITY_NAME", '', use."COUNTY_NAME", '', use."STREET_NAME") as allAddress,
(SELECT name from tz_equipment_category WHERE code = jri.EQU_LIST) AS equList,
(SELECT name from tz_equipment_category where code = jri.EQU_CATEGORY) as equCategory,
(SELECT name from tz_equipment_category where code = jri.EQU_DEFINE) as equDefine
(SELECT name from tz_equipment_category where code = jri.EQU_DEFINE) as equDefine,
ed.orgBranchCodes
from tzs_jg_change_registration_transfer crt
LEFT JOIN crteq_limited crteq ON crt.sequence_nbr = crteq.equip_transfer_id AND crteq.rn = 1
LEFT JOIN idx_biz_jg_register_info jri on crteq.equ_id = jri.RECORD
......
......@@ -15,7 +15,9 @@
GROUP BY unit_change_registration_id
)
select
isn.*
DISTINCT ins.sequence_nbr AS sequenceNbr,
isn.*,
ed.orgBranchCodes
FROM
tzs_jg_change_registration_unit isn
LEFT JOIN equip_data ed on ed.unit_change_registration_id = isn.sequence_nbr
......
......@@ -39,8 +39,19 @@
</select>
<sql id="page_list">
<![CDATA[/*+ set(query_dop 16)*/ ]]>
WITH equip_data as (
SELECT
unit_change_id,
equ_id,
group_concat(distinct si."ORG_BRANCH_CODE") as orgBranchCodes
FROM
tzs_jg_change_vehicle_registration_unit_eq crueq
LEFT JOIN idx_biz_jg_supervision_info si ON si.record = crueq.equ_id
GROUP BY unit_change_id
)
select
cru.sequence_nbr as sequenceNbr,
DISTINCT cru.sequence_nbr as sequenceNbr,
cru.change_type as changeType,
cru.apply_no as applyNo,
date_format(cru.apply_date,'%Y-%m-%d') as applyDate,
......@@ -61,11 +72,12 @@
cru.promoter,
cru.next_executor_ids as nextExecutorIds,
cru.instance_id as instanceId,
cru.create_user_id as createUserId
cru.create_user_id as createUserId,
ed.orgBranchCodes
from tzs_jg_change_vehicle_registration_unit cru
LEFT JOIN equip_data ed on ed.unit_change_id = cru.sequence_nbr
</sql>
<select id="getPage"
resultType="java.util.Map">
<select id="getPage" resultType="java.util.Map">
<include refid="page_list"/>
<where>
<if test="dto.applyNo != null and dto.applyNo != ''">
......@@ -78,7 +90,7 @@
and cru.status = #{dto.status}
</if>
<if test="dto.auditPassDate != null and dto.auditPassDate != ''">
and cru.audit_pass_date = #{dto.auditPassDate}
AND cru.audit_pass_date like concat('%',DATE_FORMAT(#{dto.auditPassDate},'%Y-%m-%d'),'%')
</if>
<if test="dto.newUseUnitCreditCode != null and dto.newUseUnitCreditCode != ''">
and cru.new_use_unit_credit_code = #{dto.newUseUnitCreditCode}
......@@ -96,19 +108,30 @@
AND cru.create_date LIKE concat(DATE_FORMAT(#{dto.createDate},'%Y-%m-%d'),'%')
</if>
<if test="type == 'supervision'">
AND (cru.receive_org_code = #{orgCode} or cru.transfer_to_user_ids LIKE concat ( '%', #{currentUserId}, '%' ))
AND (cru.receive_org_code = #{companyCode} or cru.transfer_to_user_ids LIKE concat ( '%', #{currentUserId}, '%' ))
AND cru.instance_id <![CDATA[<>]]> ''
</if>
<if test="type == 'enterprise'">
AND (cru.new_use_unit_credit_code = #{orgCode} or cru.transfer_to_user_ids LIKE concat ( '%', #{currentUserId}, '%' ))
AND (cru.new_use_unit_credit_code = #{dto.newUseUnitCreditCode} or cru.transfer_to_user_ids LIKE concat ( '%', #{currentUserId}, '%' ))
</if>
<if test="roleIds != null and type == 'supervision'">
<foreach collection='roleIds' item='role' open='and (' close=')' separator='or'>
cru.instance_status like concat('%',#{role},'%')
</foreach>
</if>
<if test="orgCode != null and orgCode != ''">
AND cru.instance_id <![CDATA[<>]]> ''
AND EXISTS (
SELECT 1
FROM unnest(string_to_array(ed.orgBranchCodes, ',')) AS elem
WHERE elem LIKE concat(#{orgCode},'%' ) )
</if>
</where>
order by cru.create_date DESC, cru.apply_no DESC
order by
<if test="sort != null">
cru.${sort.field} ${sort.sortType},
</if>
cru.create_date DESC, cru.apply_no DESC
</select>
......
......@@ -2,8 +2,19 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.jg.api.mapper.JgEquipTransferMapper">
<sql id="page_list">
<![CDATA[/*+ set(query_dop 16)*/ ]]>
WITH equip_data as (
SELECT
equip_transfer_id,
equ_id,
group_concat(distinct si."ORG_BRANCH_CODE") as orgBranchCodes
FROM
tzs_jg_equip_transfer_eq jeteq
LEFT JOIN idx_biz_jg_supervision_info si ON si.record = jeteq.equ_id
GROUP BY equip_transfer_id
)
select
jet.sequence_nbr AS sequenceNbr,
DISTINCT jet.sequence_nbr AS sequenceNbr,
jet.apply_no AS applyNo,
jet.use_unit_credit_code AS useUnitCreditCode,
jet.use_unit_name AS useUnitName,
......@@ -60,7 +71,8 @@
oi.CODE96333 as code96333,
(select name from tz_equipment_category tec1 where tec1.code = ri."EQU_LIST") AS equList,
(select name from tz_equipment_category tec2 where tec2.code = ri."EQU_CATEGORY") AS equCategory,
(select name from tz_equipment_category tec3 where tec3.code = ri."EQU_DEFINE") AS equDefine
(select name from tz_equipment_category tec3 where tec3.code = ri."EQU_DEFINE") AS equDefine,
ed.orgBranchCodes
FROM tzs_jg_equip_transfer jet
LEFT JOIN (SELECT *,
ROW_NUMBER() OVER (PARTITION BY equip_transfer_id ORDER BY equip_transfer_id) AS rn
......@@ -71,6 +83,7 @@
LEFT JOIN idx_biz_jg_factory_info fi ON fi.record = ete.equ_id
LEFT JOIN idx_biz_jg_use_info ui ON ui.record = ete.equ_id
LEFT JOIN idx_biz_jg_other_info oi ON oi.RECORD = ete.equ_id
LEFT JOIN equip_data ed on ed.equip_transfer_id = jet.sequence_nbr
</sql>
<select id="queryForPage" resultType="com.yeejoin.amos.boot.module.jg.api.dto.JgEquipTransferDto">
<include refid="page_list"/>
......@@ -125,27 +138,27 @@
AND jet.create_date LIKE concat(DATE_FORMAT(#{param.createDate},'%Y-%m-%d'),'%')
</if>
</if>
<choose>
<when test="param.useUnitCodeFilter != '' and param.useUnitCodeFilter != null and
param.installUnitCodeFilter != '' and param.installUnitCodeFilter != null">
-- 同时有使用单位和施工单位
and (
jet.use_unit_credit_code = #{param.useUnitCodeFilter}
or jet.install_unit_credit_code = #{param.installUnitCodeFilter}
or jet.transfer_to_user_ids LIKE concat ( '%', #{currentUserId}, '%' )
)
</when>
<otherwise >
-- 只有使用单位或者施工单位
<if test="param.useUnitCodeFilter != '' and param.useUnitCodeFilter != null">
and (jet.use_unit_credit_code = #{param.useUnitCodeFilter} or jet.transfer_to_user_ids LIKE concat ( '%', #{currentUserId}, '%' ))
</if>
<if test="param.installUnitCodeFilter != '' and param.installUnitCodeFilter != null">
and (jet.install_unit_credit_code = #{param.installUnitCodeFilter} or jet.transfer_to_user_ids LIKE concat ( '%', #{currentUserId}, '%' ))
AND jet.instance_id <![CDATA[<>]]> ''
</if>
</otherwise>
</choose>
<if test="type == 'use,install'">
and (
jet.use_unit_credit_code = #{param.useUnitCodeFilter}
or jet.install_unit_credit_code = #{param.installUnitCodeFilter}
or jet.transfer_to_user_ids LIKE concat ( '%', #{currentUserId}, '%' )
)
</if>
<if test="type == 'use'">
and (jet.use_unit_credit_code = #{param.useUnitCodeFilter} or jet.transfer_to_user_ids LIKE concat ( '%', #{currentUserId}, '%' ))
</if>
<if test="type == 'install'">
and (jet.install_unit_credit_code = #{param.installUnitCodeFilter} or jet.transfer_to_user_ids LIKE concat ( '%', #{currentUserId}, '%' ))
AND jet.instance_id <![CDATA[<>]]> ''
</if>
<if test="orgCode != null and orgCode != ''">
AND jet.instance_id <![CDATA[<>]]> ''
AND EXISTS (
SELECT 1
FROM unnest(string_to_array(ed.orgBranchCodes, ',')) AS elem
WHERE elem LIKE concat(#{orgCode},'%' ) )
</if>
</where>
ORDER BY
<if test="sort != null">
......
......@@ -80,7 +80,8 @@
isn.cancel_reason AS cancelReason,
(SELECT name from tz_equipment_category ec WHERE ec.code = isn.equ_list_code) AS equListName,
DATE_FORMAT(isn.create_date,'%Y-%m-%d') AS createDate,
(select name from tz_equipment_category ec WHERE ec.code = isn.equ_category) AS equCategoryName
(select name from tz_equipment_category ec WHERE ec.code = isn.equ_category) AS equCategoryName,
ed.orgBranchCodes
</sql>
<select id="queryForPage" resultType="java.util.Map">
<include refid="page_list"/>
......@@ -131,10 +132,10 @@
</if>
<if test="type != 'company' and type != null">
AND isn.instance_id <![CDATA[<>]]> ''
AND (isn.receive_company_code = #{orgCode} or isn.transfer_to_user_ids like concat('%',#{userId},'%'))
AND (isn.receive_company_code = #{companyCode} or isn.transfer_to_user_ids like concat('%',#{userId},'%'))
</if>
<if test="type == 'company'">
AND (isn.install_unit_credit_code = #{orgCode} or isn.transfer_to_user_ids like
AND (isn.install_unit_credit_code = #{param.useUnitCreditCode} or isn.transfer_to_user_ids like
concat('%',#{userId},'%'))
</if>
<if test="orgCode != null and orgCode != ''">
......
......@@ -21,7 +21,7 @@
GROUP BY equip_transfer_id
)
select
tjsc.sequence_nbr,
DISTINCT tjsc.sequence_nbr,
tjsc.instance_id,
tjsc.create_user_id,
tjsc.audit_status,
......@@ -45,7 +45,8 @@
tjsc.use_unit_name,
tjsc.use_unit_code,
tjsc.use_registration_code,
tjsc.equ_list_code
tjsc.equ_list_code,
ed.orgBranchCodes
from tzs_jg_scrap_cancel tjsc
LEFT JOIN equip_data ed on ed.equip_transfer_id = tjsc.sequence_nbr
</sql>
......
......@@ -10,6 +10,7 @@ import com.yeejoin.amos.boot.module.jg.api.entity.JgCertificateReplenish;
import com.yeejoin.amos.boot.module.jg.biz.service.impl.JgCertificateReplenishServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.component.event.RestEventTrigger;
......@@ -101,12 +102,15 @@ public class JgCertificateReplenishController extends BaseController {
@ApiOperation(httpMethod = "GET", value = "分页查询", notes = "分页查询")
@RestEventTrigger(value = "operateLogRestEventHandler")
public ResponseModel<Page<JgCertificateReplenish>> queryForPage(JgCertificateReplenishDto dto,
@RequestParam(value = "current") int current,
@RequestParam(value = "size") int size) {
@ApiParam(value = "当前页码", required = true) @RequestParam(value = "current", defaultValue = "1") int current,
@ApiParam(value = "每页大小", required = true) @RequestParam(value = "size", defaultValue = "20") int size,
@ApiParam(value = "排序字段",required = false) @RequestParam(value = "sort",required = false) String sort,
@ApiParam(value = "客户端类型: jgAudit-监管审核;jgLook-监管查看") @RequestParam(value = "client", required = false, defaultValue = "jgAudit") String client
) {
Page<JgCertificateReplenish> page = new Page<JgCertificateReplenish>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(jgCertificateReplenishServiceImpl.queryForJgCertificateReplenishPage(page, dto));
return ResponseHelper.buildResponse(jgCertificateReplenishServiceImpl.queryForJgCertificateReplenishPage(page, dto, sort, client));
}
/**
......
......@@ -12,6 +12,7 @@ import com.yeejoin.amos.boot.module.jg.biz.service.impl.CommonServiceImpl;
import com.yeejoin.amos.boot.module.jg.biz.service.impl.JgChangeVehicleRegistrationUnitServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*;
......@@ -204,19 +205,20 @@ public class JgChangeVehicleRegistrationUnitController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/getPage")
@ApiOperation(httpMethod = "POST", value = "车用气瓶列表", notes = "车用气瓶列表")
public ResponseModel<Object> getPage(JgChangeVehicleRegistrationUnitDto dto,
public ResponseModel<Object> getPage(@RequestBody(required = false) JgChangeVehicleRegistrationUnitDto dto,
@RequestParam(value = "number") int number,
@RequestParam(value = "size") int size) {
@RequestParam(value = "size") int size,
@ApiParam(value = "排序字段", required = false) @RequestParam(value = "sort", required = false) String sort,
@ApiParam(value = "客户端类型: jgAudit-监管审核;jgLook-监管查看") @RequestParam(value = "client", required = false, defaultValue = "jgAudit") String client
) {
Page<JgChangeVehicleRegistrationUnit> page = new Page<>(number, size);
ReginParams reginParams = getSelectedOrgInfo();
ReginParams info = getSelectedOrgInfo();
String type = "";
if (info.getCompany().getLevel().equals(BaseController.COMPANY_TYPE_COMPANY)){
if (reginParams.getCompany().getLevel().equals(BaseController.COMPANY_TYPE_COMPANY)) {
type = "enterprise";
}else {
} else {
type = "supervision";
}
return ResponseHelper.buildResponse(jgChangeVehicleRegistrationUnitServiceImpl.getPage(page, dto, type, reginParams));
return ResponseHelper.buildResponse(jgChangeVehicleRegistrationUnitServiceImpl.getPage(page, sort, dto, type, reginParams, client));
}
}
......@@ -14,6 +14,7 @@ import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.privilege.model.CompanyModel;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.context.RequestContext;
......@@ -115,9 +116,10 @@ public class JgEquipTransferController extends BaseController {
public ResponseModel<Page<JgEquipTransferDto>> queryForPage(@RequestParam(value = "current") int current,
@RequestParam(value = "size") int size,
@RequestParam(value = "sort", required = false) String sort,
@RequestBody(required = false) JgEquipTransferDto dto) {
@RequestBody(required = false) JgEquipTransferDto dto,
@ApiParam(value = "客户端类型: jgAudit-监管审核;jgLook-监管查看") @RequestParam(value = "client", required = false, defaultValue = "jgAudit") String client) {
Page<JgEquipTransferDto> page = new Page<>(current, size);
return ResponseHelper.buildResponse(jgEquipTransferServiceImpl.queryForJgEquipTransferPage(page, sort, dto, getSelectedOrgInfo()));
return ResponseHelper.buildResponse(jgEquipTransferServiceImpl.queryForJgEquipTransferPage(page, sort, dto, getSelectedOrgInfo(),client));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
......
......@@ -7,7 +7,6 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
......@@ -23,6 +22,7 @@ import com.yeejoin.amos.boot.module.jg.api.enums.BusinessTypeEnum;
import com.yeejoin.amos.boot.module.jg.api.enums.CompanyTypeEnum;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgCertificateReplenishMapper;
import com.yeejoin.amos.boot.module.jg.api.service.IJgCertificateReplenishService;
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;
......@@ -148,6 +148,7 @@ public class JgCertificateReplenishServiceImpl extends BaseService<JgCertificate
private final JgCertificateChangeRecordServiceImpl certificateChangeRecordService;
private final JgCertificateChangeRecordEqServiceImpl certificateChangeRecordEqService;
private final IdxBizJgFactoryInfoServiceImpl idxBizJgFactoryInfoService;
private final JgCertificateReplenishMapper jgCertificateReplenishMapper;
/**
* 用户信息
......@@ -695,36 +696,22 @@ public class JgCertificateReplenishServiceImpl extends BaseService<JgCertificate
/**
* 分页查询
*/
public Page<JgCertificateReplenish> queryForJgCertificateReplenishPage(Page<JgCertificateReplenish> page, JgCertificateReplenishDto dto) {
CompanyBo company = getSelectedOrgInfo().getCompany();
boolean isCompany = !company.getCompanyType().equals(JG_COMAPNY_TYPE);
boolean isSupervision = company.getCompanyType().equals(JG_COMAPNY_TYPE);
String useUnitCode = "";
if (isCompany) {
useUnitCode = CompanyTypeEnum.INDIVIDUAL.getName().equals(company.getCompanyType()) ? company.getCompanyCode().split("_")[1] : company.getCompanyCode();
public Page<JgCertificateReplenish> queryForJgCertificateReplenishPage(Page<JgCertificateReplenish> page, JgCertificateReplenishDto dto, String sort, String client) {
ReginParams reginParams = getSelectedOrgInfo();
CompanyBo company = reginParams.getCompany();
String companyCode = company.getCompanyCode();
String orgCode = "jgLook".equals(client) ? reginParams.getCompany().getOrgCode() : null;
String type = "jgLook".equals(client) ? null : company.getLevel().equals(BaseController.COMPANY_TYPE_COMPANY) ? "enterprise" : "supervision";
SortVo sortMap = commonService.sortFieldConversion(sort);
if("enterprise".equals(type)){
String useUnitCode = CompanyTypeEnum.INDIVIDUAL.getName().equals(company.getCompanyType()) ? company.getCompanyCode().split("_")[1] : company.getCompanyCode();
dto.setUseUnitCode(useUnitCode);
}
Page<JgCertificateReplenish> replenishIPage = jgCertificateReplenishMapper.queryForPage(page, sortMap, dto, type, companyCode, orgCode);
Page<JgCertificateReplenish> result = new Page<>();
IPage<JgCertificateReplenish> replenishIPage = this.lambdaQuery()
// 监管
.eq(isSupervision, JgCertificateReplenish::getReceiveOrgCode, company.getCompanyCode())
.isNotNull(isSupervision, JgCertificateReplenish::getInstanceId)
// 非监管
.eq(isCompany, JgCertificateReplenish::getUseUnitCode, useUnitCode)
.eq(JgCertificateReplenish::getIsDelete, Boolean.FALSE)
.like(!ValidationUtil.isEmpty(dto.getUseRegistrationCode()), JgCertificateReplenish::getUseRegistrationCode, dto.getUseRegistrationCode())
.eq(!ValidationUtil.isEmpty(dto.getEquListCode()), JgCertificateReplenish::getEquListCode, dto.getEquListCode())
.like(!ValidationUtil.isEmpty(dto.getApplyNo()), JgCertificateReplenish::getApplyNo, dto.getApplyNo())
.eq(!ValidationUtil.isEmpty(dto.getApplyStatus()), JgCertificateReplenish::getApplyStatus, dto.getApplyStatus())
.eq(!ValidationUtil.isEmpty(dto.getUseUnitCode()), JgCertificateReplenish::getUseUnitCode, dto.getUseUnitCode())
.like(!ValidationUtil.isEmpty(dto.getUseUnitName()), JgCertificateReplenish::getUseUnitName, dto.getUseUnitName())
.eq(!ValidationUtil.isEmpty(dto.getApplicationReason()), JgCertificateReplenish::getApplicationReason, dto.getApplicationReason())
.eq(!ValidationUtil.isEmpty(dto.getLossDamageTime()), JgCertificateReplenish::getLossDamageTime, dto.getLossDamageTime())
.eq(!ValidationUtil.isEmpty(dto.getAcceptDate()), JgCertificateReplenish::getAcceptDate, dto.getAcceptDate())
.orderByDesc(JgCertificateReplenish::getCreateDate)
.page(page);
result.setRecords(replenishIPage.getRecords().stream().peek(item -> {
item.setApplyStatusDes(FlowStatusEnum.getNameByType(Long.parseLong(item.getApplyStatus())));
item.setIsCompany(isCompany);
item.setIsCompany(company.getLevel().equals(BaseController.COMPANY_TYPE_COMPANY));
item.setApplicationReason("0".equals(item.getApplicationReason()) ? "遗失" : "损毁");
}).collect(Collectors.toList()));
result.setTotal(replenishIPage.getTotal());
......
......@@ -22,13 +22,13 @@ import com.yeejoin.amos.boot.module.jg.api.enums.VehicleApanageEnum;
import com.yeejoin.amos.boot.module.jg.api.enums.WorkFlowStatusEnum;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgChangeVehicleRegistrationUnitMapper;
import com.yeejoin.amos.boot.module.jg.api.service.IJgChangeVehicleRegistrationUnitService;
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.edit.permission.FillingEditPermForCurrentUser;
import com.yeejoin.amos.boot.module.jg.biz.event.publisher.EventPublisher;
import com.yeejoin.amos.boot.module.jg.biz.feign.TzsServiceFeignClient;
import com.yeejoin.amos.boot.module.jg.biz.service.ICommonService;
import com.yeejoin.amos.boot.module.jg.biz.service.ICompensateFlowDataOfRedis;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgOtherInfo;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgRegisterInfo;
......@@ -95,7 +95,7 @@ public class JgChangeVehicleRegistrationUnitServiceImpl extends BaseService<JgCh
@Autowired
RedisUtils redisUtils;
@Autowired
ICommonService commonService;
private CommonServiceImpl commonService;
@Autowired
TzsServiceFeignClient tzsServiceFeignClient;
@Autowired
......@@ -306,18 +306,16 @@ public class JgChangeVehicleRegistrationUnitServiceImpl extends BaseService<JgCh
});
}
public Page<Map<String, Object>> getPage
(Page<JgChangeVehicleRegistrationUnit> page, JgChangeVehicleRegistrationUnitDto dto, String type, ReginParams
reginParams) {
String orgCode = reginParams.getCompany().getCompanyCode();
String reslut = orgCode;
if (orgCode.contains("_")) {
String[] parts = orgCode.split("_");
reslut = parts[1];
}
public Page<Map<String, Object>> getPage(
Page<JgChangeVehicleRegistrationUnit> page, String sort, JgChangeVehicleRegistrationUnitDto dto, String type, ReginParams reginParams, String client) {
CompanyBo company = reginParams.getCompany();
String companyCode = company.getCompanyCode().contains("_") ? company.getCompanyCode().split("_")[1] : company.getCompanyCode();
type = "jgLook".equals(client) ? null : type;
String orgCode = "jgLook".equals(client) ? company.getOrgCode() : null;
String currentUserId = reginParams.getUserModel().getUserId();
return this.getBaseMapper().getPage(page, dto, type, reslut, currentUserId, dto.getRoleIds());
SortVo sortMap = commonService.sortFieldConversion(sort);
return this.getBaseMapper().getPage(page, sortMap, dto, type, companyCode, currentUserId, dto.getRoleIds(), orgCode);
}
@Transactional(rollbackFor = Exception.class)
......
......@@ -696,21 +696,25 @@ public class JgEquipTransferServiceImpl extends BaseService<JgEquipTransferDto,
}
@Override
public Page<JgEquipTransferDto> queryForJgEquipTransferPage(Page<JgEquipTransferDto> page, String sort, JgEquipTransferDto dto, ReginParams reginParams) {
public Page<JgEquipTransferDto> queryForJgEquipTransferPage(Page<JgEquipTransferDto> page, String sort, JgEquipTransferDto dto, ReginParams reginParams,String client) {
CompanyBo company = reginParams.getCompany();
Map<String, Object> companyTypeMap = jrmInstallationNoticeService.getCompanyType();
String companyLevel = getStringFromMap(companyTypeMap, "companyLevel");
String companyType = getStringFromMap(companyTypeMap, "companyType");
String companyLevel = company.getLevel();
String companyType = company.getCompanyType();
List<String> typeList = new ArrayList<>();
if ("company".equals(companyLevel) && companyType != null) {
if (companyType.contains(CompanyTypeEnum.USE.getCode()) || companyType.contains(CompanyTypeEnum.INDIVIDUAL.getCode())) {
dto.setUseUnitCodeFilter(company.getCompanyCode().contains("_") ? company.getCompanyCode().split("_")[1] : company.getCompanyCode());
typeList.add("use");
}
if (companyType.contains(CompanyTypeEnum.CONSTRUCTION.getCode())) {
dto.setInstallUnitCodeFilter(company.getCompanyCode());
typeList.add("install");
}
}
String type = String.join(",", typeList);
SortVo sortMap = commonService.sortFieldConversion(sort);
Page<JgEquipTransferDto> equipTransferPage = this.baseMapper.queryForPage(page, sortMap, dto, reginParams.getUserModel().getUserId());
String orgCode = "jgLook".equals(client) ? company.getOrgCode() : null;
Page<JgEquipTransferDto> equipTransferPage = this.baseMapper.queryForPage(page, sortMap, dto, reginParams.getUserModel().getUserId(),type,orgCode);
equipTransferPage.getRecords().forEach(transfer -> {
if (Objects.nonNull(transfer.getApplyStatus())) {
transfer.setApplyStatusDesc(FlowStatusEnum.getNameByType(Long.valueOf(transfer.getApplyStatus())));
......
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