Explorar el Código

常住人口bug

shiqian hace 3 años
padre
commit
a02b4c623a

+ 15 - 19
boman-modules/boman-system/src/main/java/com/boman/system/service/impl/SysDeptServiceImpl.java

@@ -1,38 +1,33 @@
 package com.boman.system.service.impl;
 
-import java.util.*;
-import java.util.stream.Collectors;
-
-import com.boman.common.core.utils.SecurityUtils;
-import com.boman.common.core.utils.number.NumberUtils;
 import com.alibaba.fastjson.JSONObject;
-import com.boman.common.core.utils.obj.ObjectUtils;
-import com.boman.common.redis.service.RedisService;
-import com.boman.common.security.service.TokenService;
-import com.boman.domain.SysUser;
-import com.boman.domain.constant.CacheConstants;
-import com.boman.system.api.model.LoginUser;
-import com.boman.system.mapper.SyncMapper;
-import com.google.common.collect.Lists;
-import com.sun.org.apache.regexp.internal.RE;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import com.boman.domain.constant.UserConstants;
 import com.boman.common.core.exception.CustomException;
+import com.boman.common.core.utils.SecurityUtils;
 import com.boman.common.core.utils.StringUtils;
+import com.boman.common.core.utils.obj.ObjectUtils;
 import com.boman.common.datascope.annotation.DataScope;
+import com.boman.common.redis.service.RedisService;
 import com.boman.domain.SysDept;
 import com.boman.domain.SysRole;
+import com.boman.domain.SysUser;
+import com.boman.domain.constant.CacheConstants;
+import com.boman.domain.constant.UserConstants;
+import com.boman.system.api.model.LoginUser;
 import com.boman.system.domain.vo.TreeSelect;
+import com.boman.system.mapper.SyncMapper;
 import com.boman.system.mapper.SysDeptMapper;
 import com.boman.system.mapper.SysRoleMapper;
 import com.boman.system.service.ISysDeptService;
+import com.google.common.collect.Lists;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
+import java.util.*;
+import java.util.stream.Collectors;
 
-import static com.boman.common.core.utils.StringUtils.isNotEmpty;
 import static com.boman.common.core.utils.obj.ObjectUtils.isEmpty;
-import static com.boman.common.datascope.aspect.DataScopeAspect.DATA_SCOPE_ALL;
 
 /**
  * 部门管理 服务实现
@@ -40,6 +35,7 @@ import static com.boman.common.datascope.aspect.DataScopeAspect.DATA_SCOPE_ALL;
  * @author ruoyi
  */
 @Service
+@Slf4j
 public class SysDeptServiceImpl implements ISysDeptService {
     @Autowired
     private SysDeptMapper deptMapper;

+ 104 - 104
boman-web-core/src/main/java/com/boman/web/core/controller/Czrk1Controller.java

@@ -1,104 +1,104 @@
-package com.boman.web.core.controller;
-
-import com.boman.common.core.web.controller.BaseController;
-import com.boman.domain.TableDataInfo;
-import com.boman.domain.VaccineInfoOperation;
-import com.boman.domain.dto.AjaxResult;
-import com.boman.web.core.service.vaccineInfo.IVaccineInfoService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-import java.util.List;
-
-/**
- * @author shiqian
- * @description 常驻人口
- * @date 2022年01月05日 15:39
- **/
-@RestController
-@RequestMapping("/core/czrk")
-public class Czrk1Controller extends BaseController {
-
-    @Autowired
-    private IVaccineInfoService vaccineInfoService;
-
-    /**
-     * 功能描述: 项目首页统计信息,
-     * 当前单位:镇,村:7个,组:300个,常住人口:5000人,新增 2人  减少 2人
-     *
-     * @return com.boman.domain.dto.AjaxResult
-     */
-    @GetMapping("/stsByCzrkHomePage")
-    public AjaxResult stsByCzrkHomePage() {
-        return AjaxResult.success("成功", vaccineInfoService.stsByCzrkHomePage());
-    }
-
-    /**
-     * 功能描述: 当前单位:镇,村:7个,组:300个,常住人口:5000人,新增 2人  减少 2人
-     *
-     * @return com.boman.domain.dto.AjaxResult
-     */
-    @GetMapping("/stsByCzrk")
-    public AjaxResult stsByCzrk() {
-        return AjaxResult.success("成功", vaccineInfoService.stsByCzrk());
-    }
-
-    /**
-     * 功能描述: ”当前单位:镇,村:7个,组:300个,常住人口:5000人,新增 2人  减少 2人“ 中的新增人员列表
-     *
-     * @return com.boman.domain.dto.AjaxResult
-     */
-    @GetMapping("/listByXz")
-    public TableDataInfo listByXz(VaccineInfoOperation condition) {
-        List<VaccineInfoOperation> list = vaccineInfoService.listByXz(condition);
-        return getDataTable(list);
-    }
-
-    /**
-     * 功能描述: ”当前单位:镇,村:7个,组:300个,常住人口:5000人,新增 2人  减少 2人“ 中的减少人员列表
-     *
-     * @return com.boman.domain.dto.AjaxResult
-     */
-    @GetMapping("/listByJs")
-    public TableDataInfo listByJs(VaccineInfoOperation condition) {
-        List<VaccineInfoOperation> list = vaccineInfoService.listByJs(condition);
-        return getDataTable(list);
-    }
-
-    /**
-     * 功能描述: 删除常住人口,人员认领中的删除也是这个接口
-     *
-     * @return com.boman.domain.dto.AjaxResult
-     */
-    @GetMapping("/deleteCzrk")
-    public AjaxResult deleteCzrk(VaccineInfoOperation vaccineInfoOperation) {
-        return vaccineInfoService.deleteCzrk(vaccineInfoOperation);
-    }
-
-    /**
-     * 功能描述: 回收站的还原功能
-     *
-     * @return com.boman.domain.dto.AjaxResult
-     */
-    @GetMapping("/reduction/{id}")
-    public AjaxResult reduction(@PathVariable("id") String id) {
-        int reduction = vaccineInfoService.reduction(id);
-        return reduction > 0 ? AjaxResult.success() : AjaxResult.error();
-    }
-
-    /**
-     * 功能描述: 根据户号查找家庭中所有人员
-     *
-     * @return com.boman.domain.dto.AjaxResult
-     */
-    @GetMapping("/family/{code}")
-    public AjaxResult family(@PathVariable("code") String code) {
-        return AjaxResult.success(vaccineInfoService.family(code));
-    }
-
-
-
-}
+//package com.boman.web.core.controller;
+//
+//import com.boman.common.core.web.controller.BaseController;
+//import com.boman.domain.TableDataInfo;
+//import com.boman.domain.VaccineInfoOperation;
+//import com.boman.domain.dto.AjaxResult;
+//import com.boman.web.core.service.vaccineInfo.IVaccineInfoService;
+//import org.springframework.beans.factory.annotation.Autowired;
+//import org.springframework.web.bind.annotation.GetMapping;
+//import org.springframework.web.bind.annotation.PathVariable;
+//import org.springframework.web.bind.annotation.RequestMapping;
+//import org.springframework.web.bind.annotation.RestController;
+//
+//import java.util.List;
+//
+///**
+// * @author shiqian
+// * @description 常驻人口
+// * @date 2022年01月05日 15:39
+// **/
+//@RestController
+//@RequestMapping("/core/czrk")
+//public class Czrk1Controller extends BaseController {
+//
+//    @Autowired
+//    private IVaccineInfoService vaccineInfoService;
+//
+//    /**
+//     * 功能描述: 项目首页统计信息,
+//     * 当前单位:镇,村:7个,组:300个,常住人口:5000人,新增 2人  减少 2人
+//     *
+//     * @return com.boman.domain.dto.AjaxResult
+//     */
+//    @GetMapping("/stsByCzrkHomePage")
+//    public AjaxResult stsByCzrkHomePage() {
+//        return AjaxResult.success("成功", vaccineInfoService.stsByCzrkHomePage());
+//    }
+//
+//    /**
+//     * 功能描述: 当前单位:镇,村:7个,组:300个,常住人口:5000人,新增 2人  减少 2人
+//     *
+//     * @return com.boman.domain.dto.AjaxResult
+//     */
+//    @GetMapping("/stsByCzrk")
+//    public AjaxResult stsByCzrk() {
+//        return AjaxResult.success("成功", vaccineInfoService.stsByCzrk());
+//    }
+//
+//    /**
+//     * 功能描述: ”当前单位:镇,村:7个,组:300个,常住人口:5000人,新增 2人  减少 2人“ 中的新增人员列表
+//     *
+//     * @return com.boman.domain.dto.AjaxResult
+//     */
+//    @GetMapping("/listByXz")
+//    public TableDataInfo listByXz(VaccineInfoOperation condition) {
+//        List<VaccineInfoOperation> list = vaccineInfoService.listByXz(condition);
+//        return getDataTable(list);
+//    }
+//
+//    /**
+//     * 功能描述: ”当前单位:镇,村:7个,组:300个,常住人口:5000人,新增 2人  减少 2人“ 中的减少人员列表
+//     *
+//     * @return com.boman.domain.dto.AjaxResult
+//     */
+//    @GetMapping("/listByJs")
+//    public TableDataInfo listByJs(VaccineInfoOperation condition) {
+//        List<VaccineInfoOperation> list = vaccineInfoService.listByJs(condition);
+//        return getDataTable(list);
+//    }
+//
+//    /**
+//     * 功能描述: 删除常住人口,人员认领中的删除也是这个接口
+//     *
+//     * @return com.boman.domain.dto.AjaxResult
+//     */
+//    @GetMapping("/deleteCzrk")
+//    public AjaxResult deleteCzrk(VaccineInfoOperation vaccineInfoOperation) {
+//        return vaccineInfoService.deleteCzrk(vaccineInfoOperation);
+//    }
+//
+//    /**
+//     * 功能描述: 回收站的还原功能
+//     *
+//     * @return com.boman.domain.dto.AjaxResult
+//     */
+//    @GetMapping("/reduction/{id}")
+//    public AjaxResult reduction(@PathVariable("id") String id) {
+//        int reduction = vaccineInfoService.reduction(id);
+//        return reduction > 0 ? AjaxResult.success() : AjaxResult.error();
+//    }
+//
+//    /**
+//     * 功能描述: 根据户号查找家庭中所有人员
+//     *
+//     * @return com.boman.domain.dto.AjaxResult
+//     */
+//    @GetMapping("/family/{code}")
+//    public AjaxResult family(@PathVariable("code") String code) {
+//        return AjaxResult.success(vaccineInfoService.family(code));
+//    }
+//
+//
+//
+//}

+ 1 - 1
boman-web-core/src/main/java/com/boman/web/core/controller/CzrkController.java

@@ -22,7 +22,7 @@ import java.util.List;
  * @date 2022-01-14
  */
 @RestController
-@RequestMapping("/core/czrk1")
+@RequestMapping("/core/czrk")
 public class CzrkController extends BaseController {
 
     @Autowired

+ 4 - 3
boman-web-core/src/main/java/com/boman/web/core/service/czrk/CzrkServiceImpl.java

@@ -35,6 +35,7 @@ import static com.boman.common.core.utils.StringUtils.isNotEmpty;
 import static com.boman.common.core.utils.obj.ObjectUtils.isEmpty;
 import static com.boman.common.core.utils.obj.ObjectUtils.map;
 import static com.boman.common.redis.RedisKey.STS_CZRK_;
+import static com.google.common.base.Strings.nullToEmpty;
 
 /**
  * 常住人口Service业务层处理
@@ -86,8 +87,8 @@ public class CzrkServiceImpl implements ICzrkService {
     private void handleList(List<Czrk> czrks) {
         for (Czrk crk : czrks) {
             // 現在居住地址查询展示 安徽省安庆市潜山市xx乡xx村xx组
-            String addr = crk.getProvince() + crk.getCity() + crk.getRegion() + crk.getVillageTowns() +
-                    crk.getVillage() + crk.getVillagerGroup() + crk.getNowIn();
+            String addr = nullToEmpty(crk.getProvince()) + nullToEmpty((crk.getCity()) + nullToEmpty(crk.getRegion()) + nullToEmpty(crk.getVillageTowns()) +
+                    nullToEmpty(crk.getVillage()) + nullToEmpty(crk.getVillagerGroup()) + nullToEmpty(crk.getNowIn()));
             crk.setNowInSelect(addr);
         }
     }
@@ -124,7 +125,7 @@ public class CzrkServiceImpl implements ICzrkService {
             if (isNotEmpty(roles)) {
                 for (SysRole role : roles) {
                     String roleKey = role.getRoleKey();
-                    if ("admin".equals(roleKey) || "city".equals(roleKey)) {
+                    if ("admin".equals(roleKey) || "city".equals(roleKey) || "yanshi".equals(roleKey)) {
                         return;
                     }
                 }

+ 1 - 1
boman-web-core/src/main/resources/mapper/CzrkMapper.xml

@@ -89,7 +89,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="isDel != null  and isDel != ''"> and is_del = #{isDel}</if>
             <if test="deleteReason != null  and deleteReason != ''"> and delete_reason = #{deleteReason}</if>
             <if test="deptIdList != null and deptIdList.size() > 0">
-                and vi.dept_id in
+                and dept_id in
                 <foreach item="deptId" collection="deptIdList" open="(" separator="," close=")">
                     #{deptId}
                 </foreach>