Browse Source

增加抄表本未分配、已分配用户查询

sxb 5 months ago
parent
commit
a5a1336507

+ 20 - 0
collect-fees/fees-px-api/src/main/java/com/tofly/feesapi/yhgl/controller/YhKhjbxxController.java

@@ -21,6 +21,8 @@ import com.tofly.feesapi.common.Excel.ExcleFileUtil;
 import com.tofly.feesapi.common.constant.*;
 import com.tofly.feesapi.common.entity.dto.PageDto;
 import com.tofly.feesapi.common.entity.vo.PageResult;
+import com.tofly.feesapi.common.exception.FeesErrorCode;
+import com.tofly.feesapi.common.exception.FeesException;
 import com.tofly.feesapi.common.util.GuidGenerator;
 import com.tofly.feesapi.security.model.CzyUserDetails;
 import com.tofly.feesapi.yhgl.entity.*;
@@ -1100,4 +1102,22 @@ public class YhKhjbxxController {
         PageResult<ZnbYhdaSelect> pageResult = yhKhjbxxService.getZnbDaPage(pageDto, query);
         return ResultRespone.success(pageResult);
     }
+    @ApiOperationSupport(order = 28)
+    @ApiOperation(value = "用户抄表本未分配分页查询")
+    @GetMapping("/cbbwfp/page")
+    public ResultRespone<PageResult<YhkhjbxxSelect>> getCbbWfpPage(PageDto pageDto, @ModelAttribute YhkhjbxxCbbWfpFilter filter) {
+        PageResult<YhkhjbxxSelect> pageResult = yhKhjbxxService.getPage_cbbwfp(pageDto, filter).toVo();
+        return ResultRespone.success(pageResult);
+    }
+    @ApiOperationSupport(order = 29)
+    @ApiOperation(value = "用户抄表本已分配分页查询")
+    @GetMapping("/cbbyfp/page")
+    public ResultRespone<PageResult<YhkhjbxxSelect>> getCbbYfpPage(PageDto pageDto, @ModelAttribute YhkhjbxxCbbWfpFilter filter) {
+        if (StringUtils.isEmpty(filter.getSsgs()))
+            throw new FeesException("所属公司不能为空", FeesErrorCode.BUSINESS_ERROR);
+        if (StringUtils.isEmpty(filter.getSscbpq()))
+            throw new FeesException("所属抄表片区不能为空", FeesErrorCode.BUSINESS_ERROR);
+        PageResult<YhkhjbxxSelect> pageResult = yhKhjbxxService.getPage_cbbyfp(pageDto, filter).toVo();
+        return ResultRespone.success(pageResult);
+    }
 }

+ 19 - 0
collect-fees/fees-px-api/src/main/java/com/tofly/feesapi/yhgl/entity/dto/YhkhjbxxCbbWfpFilter.java

@@ -0,0 +1,19 @@
+package com.tofly.feesapi.yhgl.entity.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+@Data
+@ApiModel("用户档案查询参数DTO")
+public class YhkhjbxxCbbWfpFilter {
+    @ApiModelProperty("关键字(用户编号、用户姓名、用户地址、联系电话)")
+    private String searchText;
+
+    @ApiModelProperty(value = "所属公司编码")
+    private String ssgs;
+
+    @ApiModelProperty(value = "所属抄表片区编码")
+    private String sscbpq;
+
+}

+ 5 - 0
collect-fees/fees-px-api/src/main/java/com/tofly/feesapi/yhgl/mapper/YhKhjbxxMapper.java

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.tofly.feesapi.common.entity.dto.PageDto;
 import com.tofly.feesapi.yhgl.entity.YhKhjbxx;
 import com.tofly.feesapi.yhgl.entity.Yhkhjbxx2;
+import com.tofly.feesapi.yhgl.entity.dto.YhkhjbxxCbbWfpFilter;
 import com.tofly.feesapi.yhgl.entity.vo.YhkhjbxxSelect;
 import com.tofly.feesapi.yhgl.entity.dto.YhkhjbxxFilter;
 import com.tofly.feesapi.yhgl.entity.vo.YhkhjbxxSelect2;
@@ -42,6 +43,10 @@ public interface YhKhjbxxMapper extends BaseMapper<YhKhjbxx> {
 
     PageDto<YhkhjbxxSelect> getPage(PageDto page, @Param("filter") YhkhjbxxFilter filter);
 
+    PageDto<YhkhjbxxSelect> getPage_cbbwfp(PageDto page, @Param("filter") YhkhjbxxCbbWfpFilter filter);
+
+    PageDto<YhkhjbxxSelect> getPage_cbbyfp(PageDto page, @Param("filter") YhkhjbxxCbbWfpFilter filter);
+
     PageDto<ZnbYhdaSelect> getZnbDaPage(PageDto pageDto, @Param("filter") ZnbYhdaFilter filter);
 
     List<YhkhjbxxSelect> getList(@Param("filter") YhkhjbxxFilter filter);

+ 6 - 4
collect-fees/fees-px-api/src/main/java/com/tofly/feesapi/yhgl/service/YhKhjbxxService.java

@@ -10,15 +10,13 @@ import com.tofly.feesapi.bjgl.entity.vo.YhCbkxxSelect;
 import com.tofly.feesapi.common.entity.dto.PageDto;
 import com.tofly.feesapi.common.entity.vo.PageResult;
 import com.tofly.feesapi.yhgl.entity.YhKhjbxx;
-import com.tofly.feesapi.yhgl.entity.dto.YhKhjbxxInsert;
-import com.tofly.feesapi.yhgl.entity.dto.YhKhjbxxSscbbUpdate;
-import com.tofly.feesapi.yhgl.entity.dto.YhKhjbxxUpdate;
+import com.tofly.feesapi.yhgl.entity.dto.*;
 import com.tofly.feesapi.yhgl.entity.vo.YhKhjbxxView;
 import com.tofly.feesapi.yhgl.entity.vo.YhkhjbxxSelect;
-import com.tofly.feesapi.yhgl.entity.dto.YhkhjbxxFilter;
 import com.tofly.feesapi.yhgl.entity.vo.YhkhjbxxSelect2;
 import com.tofly.feesapi.znbgl.entity.dto.ZnbYhdaFilter;
 import com.tofly.feesapi.znbgl.entity.vo.ZnbYhdaSelect;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 
@@ -67,4 +65,8 @@ public interface YhKhjbxxService extends IService<YhKhjbxx> {
 
     //更新当前年累计量
     void updateDjnLjl(String yhbh);
+
+    PageDto<YhkhjbxxSelect> getPage_cbbwfp(PageDto page, @Param("filter") YhkhjbxxCbbWfpFilter filter);
+
+    PageDto<YhkhjbxxSelect> getPage_cbbyfp(PageDto page, @Param("filter") YhkhjbxxCbbWfpFilter filter);
 }

+ 11 - 4
collect-fees/fees-px-api/src/main/java/com/tofly/feesapi/yhgl/service/impl/YhKhjbxxServiceImpl.java

@@ -21,10 +21,7 @@ import com.tofly.feesapi.common.util.GuidGenerator;
 import com.tofly.feesapi.security.model.CzyUserDetails;
 import com.tofly.feesapi.yhgl.entity.YhKhjbxx;
 import com.tofly.feesapi.yhgl.entity.YhKhjbxxLog;
-import com.tofly.feesapi.yhgl.entity.dto.YhKhjbxxInsert;
-import com.tofly.feesapi.yhgl.entity.dto.YhKhjbxxSscbbUpdate;
-import com.tofly.feesapi.yhgl.entity.dto.YhKhjbxxUpdate;
-import com.tofly.feesapi.yhgl.entity.dto.YhkhjbxxFilter;
+import com.tofly.feesapi.yhgl.entity.dto.*;
 import com.tofly.feesapi.yhgl.entity.vo.YhKhjbxxView;
 import com.tofly.feesapi.yhgl.entity.vo.YhkhjbxxSelect;
 import com.tofly.feesapi.yhgl.entity.vo.YhkhjbxxSelect2;
@@ -355,6 +352,16 @@ public class YhKhjbxxServiceImpl extends ServiceImpl<YhKhjbxxMapper, YhKhjbxx> i
         this.lambdaUpdate().set(YhKhjbxx::getJtzqljl, ljl).eq(YhKhjbxx::getYhbh, yhbh).update();
     }
 
+    @Override
+    public PageDto<YhkhjbxxSelect> getPage_cbbwfp(PageDto page, YhkhjbxxCbbWfpFilter filter) {
+        return this.baseMapper.getPage_cbbwfp(page,filter);
+    }
+
+    @Override
+    public PageDto<YhkhjbxxSelect> getPage_cbbyfp(PageDto page, YhkhjbxxCbbWfpFilter filter) {
+        return this.baseMapper.getPage_cbbyfp(page,filter);
+    }
+
     private void check(YhKhjbxx yhKhjbxx, boolean insert) {
         String yhbh = yhKhjbxx.getYhbh();
         if (insert) {

+ 48 - 0
collect-fees/fees-px-api/src/main/resources/mapper/yhgl/YhKhjbxxMapper.xml

@@ -2,6 +2,8 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.ORg//DTD Mapper 3.0//EN" "http://mybatis.ORg/dtd/mybatis-3-mapper.dtd">
 
 <mapper namespace="com.tofly.feesapi.yhgl.mapper.YhKhjbxxMapper">
+
+
     <!--自定义获取用户最大yhbh -->
     <select id="selectMaxYhbh" resultType="int">
         SELECT nvl(max(yhbh),0) from yh_khjbxx
@@ -37,6 +39,46 @@
         LEFT JOIN bm_cbb f on a.sscbb=f.cbbbm
         WHERE a.yhbh=#{yhbh}
     </select>
+  <!--查询未分配抄表本用户-->
+    <sql id="querySql_cbbwfp">
+        select *from yh_khjbxx where 1=1 and  sscbb is null
+        <!--模糊查询 -->
+        <if test="filter.searchText!=null">
+            AND ( yhbh like '%${filter.searchText}%'
+            OR yhxm like '%${filter.searchText}%'
+            OR yhdz like '%${filter.searchText}%'
+            OR lxdh like '%${filter.searchText}%')
+        </if>
+        <!--所属公司-->
+        <if test="filter.ssgs!=null">
+            AND ssgs=#{filter.ssgs}
+        </if>
+        <!--所属片区-->
+        <if test="filter.sscbpq!=null">
+            AND sscbpq=#{filter.sscbpq}
+        </if>
+    </sql>
+
+    <!--查询已分配抄表本用户-->
+    <sql id="querySql_cbbyfp">
+        select *from yh_khjbxx where 1=1 and  sscbb is not  null
+        <!--模糊查询 -->
+        <if test="filter.searchText!=null">
+            AND ( yhbh like '%${filter.searchText}%'
+            OR yhxm like '%${filter.searchText}%'
+            OR yhdz like '%${filter.searchText}%'
+            OR lxdh like '%${filter.searchText}%')
+        </if>
+        <!--所属公司-->
+        <if test="filter.ssgs!=null">
+            AND ssgs=#{filter.ssgs}
+        </if>
+        <!--所属片区-->
+        <if test="filter.sscbpq!=null">
+            AND sscbpq=#{filter.sscbpq}
+        </if>
+    </sql>
+
     <sql id="querySql">
         SELECT a.yhbh,a.ykhbh, a.yhxm,a.yhdz,a.lxdh, a.ssgs,a.sscbpq,a.sscbb,a.xb,a.sj,a.zzdh,a.gzdw,a.bgdh,
         a.dzyx,a.zjlb,a.zjhm,a.sqrq,
@@ -123,6 +165,12 @@
             </if>
         </if>
     </sql>
+    <select id="getPage_cbbwfp" resultType="com.tofly.feesapi.yhgl.entity.vo.YhkhjbxxSelect">
+        <include refid="querySql_cbbwfp"></include>
+    </select>
+    <select id="getPage_cbbyfp" resultType="com.tofly.feesapi.yhgl.entity.vo.YhkhjbxxSelect">
+        <include refid="querySql_cbbyfp"></include>
+    </select>
     <!--自定义用户档案分页查询 -->
     <select id="getPage" resultType="com.tofly.feesapi.yhgl.entity.vo.YhkhjbxxSelect">
         <include refid="querySql"></include>