shiqian 3 年 前
コミット
6dfcdb13d9

+ 3 - 0
boman-api/boman-domain/src/main/java/com/boman/domain/Fxry.java

@@ -56,7 +56,10 @@ public class Fxry implements Serializable {
     private String updateBy;
 
     /******************* 查询时间 ************************/
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private Date startTime;
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private Date endTime;
 
 

+ 10 - 0
boman-api/boman-domain/src/main/java/com/boman/domain/VaccineInfoOperation.java

@@ -263,6 +263,16 @@ public class VaccineInfoOperation extends BaseEntity {
      */
     private List<Long> deptIdList;
 
+    /** true已认领,false未认领**/
+    private Boolean ryrl;
+
+    public Boolean isRyrl() {
+        return ryrl;
+    }
+
+    public void setRyrl(Boolean ryrl) {
+        this.ryrl = ryrl;
+    }
 
     public List<Long> getDeptIdList() {
         return deptIdList;

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

@@ -1,11 +1,15 @@
 package com.boman.web.core.controller;
 
+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.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
 /**
- * @description  常驻人口
  * @author shiqian
+ * @description 常驻人口
  * @date 2022年01月05日 15:39
  **/
 @RestController
@@ -14,5 +18,17 @@ public class CzrkController {
 
 
 
+    @Autowired
+    private IVaccineInfoService vaccineInfoService;
+
+    /**
+     * 功能描述: 当前单位:镇,村:7个,组:300个,常住人口:5000人,新增 2人  减少 2人
+     *
+     * @return com.boman.domain.dto.AjaxResult
+     */
+    @GetMapping("/sts")
+    public AjaxResult stsByCzrk() {
+        return AjaxResult.success("成功", vaccineInfoService.stsByCzrk());
+    }
 
 }

+ 11 - 0
boman-web-core/src/main/java/com/boman/web/core/controller/RyrlController.java

@@ -68,4 +68,15 @@ public class RyrlController extends BaseController {
         return AjaxResult.success("成功", vaccineInfoService.getById(id));
     }
 
+    /**
+     * 功能描述: 小程序   人员认领接口 统计
+     *
+     * @return com.boman.domain.dto.AjaxResult
+     */
+    @GetMapping("/sts")
+    public AjaxResult sts() {
+        return AjaxResult.success("成功", vaccineInfoService.sts());
+    }
+
+
 }

+ 5 - 0
boman-web-core/src/main/java/com/boman/web/core/mapper/VaccineInfoMapper.java

@@ -1,6 +1,7 @@
 package com.boman.web.core.mapper;
 
 import com.boman.domain.VaccineInfoOperation;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 
@@ -101,4 +102,8 @@ public interface VaccineInfoMapper
      * @return com.alibaba.fastjson.JSONObject
      */
     VaccineInfoOperation getByIdCard(String idCard);
+
+    int stsByYrl(@Param("deptIdList") List<Long> deptIdList);
+
+    int stsByWrl(@Param("deptIdList") List<Long> deptIdList);
 }

+ 4 - 0
boman-web-core/src/main/java/com/boman/web/core/service/vaccineInfo/IVaccineInfoService.java

@@ -93,4 +93,8 @@ public interface IVaccineInfoService
     AjaxResult editRlry(VaccineInfoOperation vaccineInfo);
 
     VaccineInfoOperation getById(Long id);
+
+    JSONObject sts();
+
+    JSONObject stsByCzrk();
 }

+ 57 - 4
boman-web-core/src/main/java/com/boman/web/core/service/vaccineInfo/impl/VaccineInfoServiceImpl.java

@@ -10,13 +10,10 @@ import com.boman.common.core.utils.obj.ObjectUtils;
 import com.boman.common.core.utils.sql.SqlUtil;
 import com.boman.common.core.web.page.PageDomain;
 import com.boman.common.core.web.page.TableSupport;
-import com.boman.domain.SysDept;
-import com.boman.domain.SysRole;
+import com.boman.domain.*;
 import com.boman.domain.dto.AjaxResult;
 import com.boman.system.api.RemoteDeptService;
 import com.boman.system.api.RemoteDictDataService;
-import com.boman.domain.VaccineInfoOperation;
-import com.boman.domain.VaccineInfoUser;
 import com.boman.web.core.mapper.StandardlyMapper;
 import com.boman.web.core.mapper.VaccineInfoMapper;
 import com.boman.web.core.mapper.VaccineInfoOperationMapper;
@@ -1091,4 +1088,60 @@ public class VaccineInfoServiceImpl implements IVaccineInfoService {
     public VaccineInfoOperation getById(Long id) {
         return vaccineInfoMapper.selectVaccineInfoById(id);
     }
+
+    @Override
+    public JSONObject sts() {
+        Long deptId = AuthUtils.getLoginUser().getSysUser().getDeptId();
+        //判断是否是管理员
+        List<SysRole> roles = AuthUtils.getLoginUser().getSysUser().getRoles();
+        if (isNotEmpty(roles)) {
+            for (SysRole role : roles) {
+                String roleKey = role.getRoleKey();
+                if ("admin".equals(roleKey) || "city".equals(roleKey)) {
+                    deptId = null;
+                    break;
+                }
+            }
+        }
+
+        List<Long> deptIdList = new ArrayList<>(16);
+        if (deptId != null) {
+            List<SysDept> sysDepts = remoteDeptService.listChildrenDepts(deptId);
+            if (sysDepts != null && sysDepts.size() > 0) {
+                for (SysDept sysDept : sysDepts) {
+                    Long id = sysDept.getId();
+                    deptIdList.add(id);
+                }
+            }
+        }
+
+        int yrl = vaccineInfoMapper.stsByYrl(deptIdList);
+        int wrl = vaccineInfoMapper.stsByWrl(deptIdList);
+        JSONObject result = new JSONObject(3);
+        result.put("yrl", yrl);
+        result.put("wrl", wrl);
+        result.put("total", wrl + yrl);
+        return result;
+    }
+
+    /**
+     * 功能描述: 当前单位:镇,村:7个,组:300个,常住人口:5000人,新增 2人  减少 2人
+     *
+     * @return com.alibaba.fastjson.JSONObject
+     */
+    @Override
+    public JSONObject stsByCzrk() {
+        JSONObject result = new JSONObject(6);
+        // 当前登陆人的deptId
+        SysUser sysUser = AuthUtils.getLoginUser().getSysUser();
+        String deptName = sysUser.getDept().getDeptName();
+        result.put("dqdw", deptName);
+
+        Long deptId = AuthUtils.getLoginUser().getSysUser().getDeptId();
+//        int village = remoteDeptService.countChildrenByVillage(deptId);
+
+
+
+        return null;
+    }
 }

+ 13 - 4
boman-web-core/src/main/resources/mapper/FxryMapper.xml

@@ -8,11 +8,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <insert id="add">
         INSERT INTO fxry(`id`, `name`, `sex`, `age`, `id_card`, `village_towns_id`, `village_towns`, `village_id`,
                          `village`, `group_id`, `group`, `detail_addr`, `id_card_hide`, `addr_outside_province`,
-                         `intended_return_time`, `telephone`, `remark`, `detail_addr`, `wzhjdz`
+                         `intended_return_time`, `telephone`, `remark`, `wzhjdz`,
                         `create_time`, `create_by`, `update_time`, `update_by`)
         VALUES (#{id}, #{name}, #{sex}, #{age}, #{idCard}, #{villageTownsId}, #{villageTowns}, #{villageId},
             #{village}, #{groupId}, #{group}, #{detailAddr}, #{idCardHide}, #{addrOutsideProvince},
-            #{intendedReturnTime}, #{telephone}, #{remark}, #{detailAddr}, #{wzhjdz},
+            #{intendedReturnTime}, #{telephone}, #{remark}, #{wzhjdz},
                 SYSDATE(), #{createBy}, SYSDATE(), #{updateBy});
     </insert>
 
@@ -73,11 +73,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <select id="getById" resultType="com.boman.domain.Fxry">
         select id,
                `name`,
-               detail_addr detailAddr,
+               sex,
+               age,
                id_card idCard,
+               village_towns_id villageTownsId,
+               village_towns villageTowns,
+               village_id villageId,
+               village,
+               group_id groupId,
+               `group`,
+               detail_addr detailAddr,
                addr_outside_province addrOutsideProvince,
                intended_return_time intendedReturnTime,
-               telephone
+               telephone,
+               remark
         from fxry
         where id = #{id} limit 1;
     </select>

+ 33 - 4
boman-web-core/src/main/resources/mapper/VaccineInfoMapper.xml

@@ -136,10 +136,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         select vi.id, vi.user_name, vi.phone_num, vi.id_card, vi.gender
         from vaccine_info vi
         <where>
-            vi.is_del = 'N' and
-            (vi.village_towns is null or vi.village_towns = ''
-            <!-- or vi.village is null or vi.village = ''
-            or vi.villager_group is null or vi.villager_group = ''-->)
+            vi.is_del = 'N'
+            <!-- 已认领 -->
+            <if test="ryrl == true">and (vi.village_towns is not null or vi.village_towns != '')</if>
+            <!-- 未认领 -->
+            <if test="ryrl == false">and (vi.village_towns is null or vi.village_towns = '')</if>
 
 
             <if test="houseType != null  and houseType != ''">and vi.house_type = #{houseType}</if>
@@ -194,6 +195,34 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         order by vi.create_time DESC ,vi.vaccination_time DESC
     </select>
 
+    <select id="stsByYrl" resultType="int">
+        select count(vi.id)
+        from vaccine_info vi
+        where vi.is_del = 'N'
+        <!-- 已认领 -->
+        and (vi.village_towns is not null or vi.village_towns != '')
+        <if test="deptIdList != null  and deptIdList.size() > 0">
+            and vi.dept_id in
+            <foreach item="deptId" collection="deptIdList" open="(" separator="," close=")">
+                #{deptId}
+            </foreach>
+        </if>
+    </select>
+
+    <select id="stsByWrl" resultType="int">
+        select count(vi.id)
+        from vaccine_info vi
+        where vi.is_del = 'N'
+        <!-- 未认领 -->
+        and (vi.village_towns is null or vi.village_towns = '')
+        <if test="deptIdList != null  and deptIdList.size() > 0">
+            and vi.dept_id in
+            <foreach item="deptId" collection="deptIdList" open="(" separator="," close=")">
+                #{deptId}
+            </foreach>
+        </if>
+    </select>
+
     <select id="selectVaccineInfoListByPage" parameterType="Integer" resultMap="VaccineInfoResult">
         select * from vaccine_info limit   #{startNum}, #{endNum}
     </select>