Browse Source

执法端-修改其他计划查询逻辑同一时间,同一企业的才显示到其他计划中

dev-V1.0.6
niujiyi 3 months ago
parent
commit
d80f9f87d1
  1. 4
      zdxt-modules/zdxt-enforcement-code/src/main/java/com/zdxt/enforcementcode/controller/app/enforcement/AppEnfCpPlanController.java
  2. 7
      zdxt-modules/zdxt-enforcement-code/src/main/java/com/zdxt/enforcementcode/domain/bo/ComprehensiveAnalysisBo.java
  3. 10
      zdxt-modules/zdxt-enforcement-code/src/main/java/com/zdxt/enforcementcode/mapper/EfcodeCpPlanMapper.java
  4. 10
      zdxt-modules/zdxt-enforcement-code/src/main/java/com/zdxt/enforcementcode/service/IEfcodeCpPlanService.java
  5. 15
      zdxt-modules/zdxt-enforcement-code/src/main/java/com/zdxt/enforcementcode/service/impl/EfcodeCpPlanServiceImpl.java
  6. 59
      zdxt-modules/zdxt-enforcement-code/src/main/resources/mapper/enforcementcode/EfcodeCpPlanMapper.xml

4
zdxt-modules/zdxt-enforcement-code/src/main/java/com/zdxt/enforcementcode/controller/app/enforcement/AppEnfCpPlanController.java

@ -54,13 +54,13 @@ public class AppEnfCpPlanController extends EfcodeCpPlanController {
} }
/** /**
* 查询其他计划列表(本单位全部 + 其他单位公开,仅待预约状态) * 查询其他计划列表(与当前用户计划同一时间段、同一企业的其他用户的计划)
*/ */
@GetMapping("/otherList") @GetMapping("/otherList")
public TableDataInfo<EfcodeCpPlanVo> otherList(EfcodeCpPlanBo bo, PageQuery pageQuery) { public TableDataInfo<EfcodeCpPlanVo> otherList(EfcodeCpPlanBo bo, PageQuery pageQuery) {
// 获取当前用户所属执法单位 // 获取当前用户所属执法单位
String bureauDeptId = resolveCurrentBureauDeptId(); String bureauDeptId = resolveCurrentBureauDeptId();
return cpPlanService.queryOtherPageList(bo, pageQuery, bureauDeptId); return cpPlanService.queryOverlapPageList(bo, pageQuery, bureauDeptId);
} }
/** /**

7
zdxt-modules/zdxt-enforcement-code/src/main/java/com/zdxt/enforcementcode/domain/bo/ComprehensiveAnalysisBo.java

@ -1,7 +1,10 @@
package com.zdxt.enforcementcode.domain.bo; package com.zdxt.enforcementcode.domain.bo;
import lombok.Data;
import java.util.List; import java.util.List;
@Data
public class ComprehensiveAnalysisBo { public class ComprehensiveAnalysisBo {
/** /**
* 企业社会统一信用代码 * 企业社会统一信用代码
@ -74,6 +77,8 @@ public class ComprehensiveAnalysisBo {
private Long userId; private Long userId;
private String bureauDeptId; private String bureauDeptId;
private String bureauDeptName; private String bureauDeptName;
//执法证件号码
private String lawCertificateNum;
/** /**
* user or bureauDept * user or bureauDept
*/ */
@ -526,4 +531,6 @@ public class ComprehensiveAnalysisBo {
public void setAuthTotal(Integer authTotal) { public void setAuthTotal(Integer authTotal) {
this.authTotal = authTotal; this.authTotal = authTotal;
} }
} }

10
zdxt-modules/zdxt-enforcement-code/src/main/java/com/zdxt/enforcementcode/mapper/EfcodeCpPlanMapper.java

@ -25,4 +25,14 @@ public interface EfcodeCpPlanMapper extends BaseMapperPlus<EfcodeCpPlan, EfcodeC
@Param("bureauDeptId") String bureauDeptId @Param("bureauDeptId") String bureauDeptId
); );
/**
* 分页查询重叠计划列表:查找与当前用户计划同一时间段、同一企业的其他用户的计划
*/
Page<EfcodeCpPlanVo> selectOverlapPageList(
@Param("page") Page<EfcodeCpPlanVo> page,
@Param("bo") EfcodeCpPlanBo bo,
@Param("currentUserId") String currentUserId,
@Param("bureauDeptId") String bureauDeptId
);
} }

10
zdxt-modules/zdxt-enforcement-code/src/main/java/com/zdxt/enforcementcode/service/IEfcodeCpPlanService.java

@ -70,6 +70,16 @@ public interface IEfcodeCpPlanService {
*/ */
TableDataInfo<EfcodeCpPlanVo> queryOtherPageList(EfcodeCpPlanBo bo, PageQuery pageQuery, String bureauDeptId); TableDataInfo<EfcodeCpPlanVo> queryOtherPageList(EfcodeCpPlanBo bo, PageQuery pageQuery, String bureauDeptId);
/**
* 分页查询重叠计划列表:查找与当前用户计划同一时间段、同一企业的其他用户的计划
*
* @param bo 搜索条件
* @param pageQuery 分页参数
* @param bureauDeptId 当前用户的执法单位ID
* @return 计划分页列表
*/
TableDataInfo<EfcodeCpPlanVo> queryOverlapPageList(EfcodeCpPlanBo bo, PageQuery pageQuery, String bureauDeptId);
/** /**
* 校验并批量删除行政执法检查计划-计划信息 * 校验并批量删除行政执法检查计划-计划信息
* *

15
zdxt-modules/zdxt-enforcement-code/src/main/java/com/zdxt/enforcementcode/service/impl/EfcodeCpPlanServiceImpl.java

@ -126,6 +126,21 @@ public class EfcodeCpPlanServiceImpl implements IEfcodeCpPlanService {
return TableDataInfo.build(result); return TableDataInfo.build(result);
} }
/**
* 分页查询重叠计划列表
* <p>查找与当前用户计划同一时间段、同一企业的其他用户的计划</p>
*/
@Override
public TableDataInfo<EfcodeCpPlanVo> queryOverlapPageList(EfcodeCpPlanBo bo, PageQuery pageQuery, String bureauDeptId) {
Long currentUserId = LoginHelper.getUserId();
Page<EfcodeCpPlanVo> page = pageQuery.build();
Page<EfcodeCpPlanVo> result = baseMapper.selectOverlapPageList(page, bo, String.valueOf(currentUserId), bureauDeptId);
// 后置处理:控制记录是否可预约
afterQueryOtherList(result.getRecords(), bureauDeptId, currentUserId);
return TableDataInfo.build(result);
}
/** /**
* 其他计划列表后置处理:控制每条记录是否可以预约 * 其他计划列表后置处理:控制每条记录是否可以预约
* <p>当前规则:待预约状态均可预约(后续可扩展更多业务规则)</p> * <p>当前规则:待预约状态均可预约(后续可扩展更多业务规则)</p>

59
zdxt-modules/zdxt-enforcement-code/src/main/resources/mapper/enforcementcode/EfcodeCpPlanMapper.xml

@ -57,4 +57,63 @@
ORDER BY plan_date DESC ORDER BY plan_date DESC
</select> </select>
<!-- 重叠计划列表:查找与当前用户计划同一时间段、同一企业的其他用户的计划 -->
<select id="selectOverlapPageList" resultType="com.zdxt.enforcementcode.domain.vo.EfcodeCpPlanVo">
SELECT
id, plan_type, plan_date, plan_time,
enforce_content, enterprise_name, enterprise_number, enterprise_id,
enforce_user_names, enforce_user_ids, enforce_user_codes, enforce_user_tels,
is_public, is_union, union_bureau_dept_names,
reserve_status, system_reserved, manual_reserved,
bureau_dept_id, bureau_dept_name,
organ_id, organ_name, dept_id, dept_name,
is_delete, remark, my_remark,
create_by, create_dept, create_time, update_by, update_time
FROM efcode_cp_plan cp
<where>
cp.is_delete = 0
<!-- 排除当前用户自己的计划 -->
<if test="currentUserId != null">
AND cp.create_by != #{currentUserId}
</if>
<!-- 只查当前用户有计划的时间段和企业的重叠计划 -->
<if test="currentUserId != null">
AND EXISTS (
SELECT 1 FROM efcode_cp_plan myp
WHERE myp.create_by = #{currentUserId}
AND myp.is_delete = 0
AND myp.plan_date = cp.plan_date
AND myp.plan_time = cp.plan_time
AND myp.enterprise_id = cp.enterprise_id
)
</if>
<!-- 可见性:本单位全部 OR 其他单位公开 -->
<choose>
<when test="bureauDeptId != null and bureauDeptId != ''">
AND (
cp.bureau_dept_id = #{bureauDeptId}
OR (cp.bureau_dept_id != #{bureauDeptId} AND cp.is_public = 1)
)
</when>
<otherwise>
AND cp.is_public = 1
</otherwise>
</choose>
<!-- 搜索条件 -->
<if test="bo.planDate != null">
AND cp.plan_date = #{bo.planDate}
</if>
<if test="bo.enterpriseId != null and bo.enterpriseId != ''">
AND cp.enterprise_id = #{bo.enterpriseId}
</if>
<if test="bo.enterpriseName != null and bo.enterpriseName != ''">
AND cp.enterprise_name LIKE CONCAT('%', #{bo.enterpriseName}, '%')
</if>
<if test="bo.enforceContent != null and bo.enforceContent != ''">
AND cp.enforce_content LIKE CONCAT('%', #{bo.enforceContent}, '%')
</if>
</where>
ORDER BY cp.plan_date DESC, cp.plan_time DESC
</select>
</mapper> </mapper>

Loading…
Cancel
Save