LIVE_YE 2 éve
szülő
commit
67a9b2cfb9

+ 36 - 0
boman-web-core/src/main/java/com/boman/web/core/controller/AccountingDataController.java

@@ -38,6 +38,42 @@ public class AccountingDataController extends BaseController {
     @Resource
     private TaskService taskService;
 
+
+    /***
+     *  潜山核酸数据列表页(根据检测点)
+     * @return
+     */
+    @GetMapping("/nucleicAcid/jcd")
+    public TableDataInfo nucleicAcidJcd( AccountingDataVo accountingData) {
+        List<AccountingDataVo> list = accountingDataService.nucleicAcidJcd(accountingData);
+        return getDataTable(list);
+    }
+
+    /**
+     *  核酸数据导出(核酸点)
+     * @param response
+     * @param accountingData
+     * @throws IOException
+     */
+    @Log(title = "核酸数据", businessType = BusinessType.EXPORT)
+    @PreAuthorize(hasPermi = "system:accountingData:exportHsd")
+    @PostMapping("/exportHsd")
+    public void exportHsd(HttpServletResponse response, @RequestBody AccountingDataVo accountingData) throws IOException
+    {
+        List<AccountingDataVo> accountingDataList = accountingDataService.exportHsd(accountingData);
+        ExcelUtil<AccountingDataVo> util = new ExcelUtil<>(AccountingDataVo.class);
+        util.exportExcel(response, accountingDataList, "核酸点数据");
+    }
+
+    /***
+     *  潜山核酸详细数据列表页(小程序)
+     * @return
+     */
+    @GetMapping("/nucleicAcid/detailedJcd/{id}")
+    public AjaxResult detailedJcd( @PathVariable("id") String id) {
+        return accountingDataService.detailedJcd(id);
+    }
+
     /***
      *  潜山核酸数据列表页(根据户籍地)
      * @return

+ 13 - 1
boman-web-core/src/main/java/com/boman/web/core/domain/vo/AccountingDataVo.java

@@ -92,9 +92,15 @@ public class AccountingDataVo extends BaseEntity {
      * 采集人名称
      */
     private String collectorName;
+
+    /**
+     * 采集县区区划
+     */
+    private String cjqxqh;
     /**
      * 采集县区
      */
+    @Excel(name = "采集县区")
     private String cjssxq;
 
     /**
@@ -221,7 +227,9 @@ public class AccountingDataVo extends BaseEntity {
 
     private String token;
 
-
+    public String getCjqxqh() {
+        return cjqxqh;
+    }
 
     public String getNowXjd() {
         return nowXjd;
@@ -632,4 +640,8 @@ public class AccountingDataVo extends BaseEntity {
     public void setToken(String token) {
         this.token = token;
     }
+
+    public void setCjqxqh(String cjqxqh) {
+        this.cjqxqh = cjqxqh;
+    }
 }

+ 5 - 1
boman-web-core/src/main/java/com/boman/web/core/mapper/AccountingDataMapper.java

@@ -52,7 +52,7 @@ public interface AccountingDataMapper {
      * @param id
      * @return
      */
-    int selectById(@Param("id") String id);
+    int selectById(AccountingDataVo accountingData);
 
     AccountingDataVo getAccountingDataOne();
 
@@ -81,4 +81,8 @@ public interface AccountingDataMapper {
     List<AccountingDataVo> selectWanShiTongList(AccountingDataVo accountingData);
 
     AccountingDataVo selectWanShiTongInfo(AccountingDataVo accountingData);
+
+    List<AccountingDataVo>  nucleicAcidJcd(AccountingDataVo accountingData);
+
+    AccountingDataVo detailedJcd(@Param("id")String id);
 }

+ 40 - 3
boman-web-core/src/main/java/com/boman/web/core/service/TaskService.java

@@ -1062,10 +1062,47 @@ public class TaskService {
                 //去更新常住人口表中数据
                 czrkMapper.updateCzrkByNucleicAcid(czrk);
             }
-            String mainKey = accountingData.getMainKey();
-            accountingData.setId(mainKey);
-            int result = mapper.selectById(mainKey);
+            int result = mapper.selectById(accountingData);
             if (result == 0) {
+                if(accountingData.getCjssxq().contains("梅城镇")){
+                    accountingData.setCjqxqh("340882100000");
+                }else if(accountingData.getCjssxq().contains("源潭镇")){
+                    accountingData.setCjqxqh("340882101000");
+                }else if(accountingData.getCjssxq().contains("黄铺镇")){
+                    accountingData.setCjqxqh("340882104000");
+                }else if(accountingData.getCjssxq().contains("王河镇")){
+                    accountingData.setCjqxqh("340882103000");
+                }else if(accountingData.getCjssxq().contains("余井镇")){
+                    accountingData.setCjqxqh("340882102000");
+                }else if(accountingData.getCjssxq().contains("官庄镇")){
+                    accountingData.setCjqxqh("340882107000");
+                }else if(accountingData.getCjssxq().contains("槎水镇")){
+                    accountingData.setCjqxqh("340882105000");
+                }else if(accountingData.getCjssxq().contains("水吼镇")){
+                    accountingData.setCjqxqh("340882106000");
+                }else if(accountingData.getCjssxq().contains("塔畈乡")){
+                    accountingData.setCjqxqh("340882200000");
+                }else if(accountingData.getCjssxq().contains("油坝乡")){
+                    accountingData.setCjqxqh("340882201000");
+                }else if(accountingData.getCjssxq().contains("黄泥镇")){
+                    accountingData.setCjqxqh("340882108000");
+                }else if(accountingData.getCjssxq().contains("天柱山镇")){
+                    accountingData.setCjqxqh("340882110000");
+                }else if(accountingData.getCjssxq().contains("龙潭乡")){
+                    accountingData.setCjqxqh("340882202000");
+                }else if(accountingData.getCjssxq().contains("黄柏镇")){
+                    accountingData.setCjqxqh("340882109000");
+                }else if(accountingData.getCjssxq().contains("痘姆乡")){
+                    accountingData.setCjqxqh("340882203000");
+                }else if(accountingData.getCjssxq().contains("五庙乡")){
+                    accountingData.setCjqxqh("340882204000");
+                }else if(accountingData.getCjssxq().contains("开发区")){
+                    accountingData.setCjqxqh("340882400000");
+                }else if(accountingData.getCjssxq().contains("lis")){
+                    accountingData.setCjqxqh("123456789");
+                }else{
+                    accountingData.setCjqxqh("340882000000");
+                }
                 accountingData.setId(IdUtils.simpleUUID());
                 mapper.insertAccountingData(accountingData);
             }

+ 39 - 0
boman-web-core/src/main/java/com/boman/web/core/service/accounting/AccountingDataServiceImpl.java

@@ -38,6 +38,7 @@ import java.io.IOException;
 import java.util.*;
 
 import static com.boman.web.core.utils.CzrkUtils.setQueryRole;
+import static com.boman.web.core.utils.CzrkUtils.setQueryRoleJcd;
 
 /**
  * @author tjf
@@ -64,6 +65,44 @@ public class AccountingDataServiceImpl implements IAccountingDataService {
     @Resource
     TaskService taskService;
 
+
+    /***
+     *  潜山核酸数据列表页(根据检测点)
+     * @return
+     */
+    @Override
+    public List<AccountingDataVo> nucleicAcidJcd(AccountingDataVo accountingData) {
+        SysUser sysUser = AuthUtils.getLoginUser().getSysUser();
+        //权限判断
+        setQueryRoleJcd(accountingData, sysUser);
+        startPage();
+        List<AccountingDataVo> list = accountingDataMapper.nucleicAcidJcd(accountingData);
+        return list;
+    }
+
+    @Override
+    public AjaxResult detailedJcd(String id) {
+        if(StringUtils.isEmpty(id)){
+            return AjaxResult.error("参数错误");
+        }
+        AccountingDataVo accountingDataVo = accountingDataMapper.detailedJcd(id);
+        return AjaxResult.success("访问成功",accountingDataVo);
+    }
+
+    @Override
+    public List<AccountingDataVo> exportHsd(AccountingDataVo accountingData) {
+        SysUser sysUser = AuthUtils.getLoginUser().getSysUser();
+        setQueryRoleJcd(accountingData, sysUser);
+        List<AccountingDataVo> list = accountingDataMapper.nucleicAcidJcd(accountingData);
+        if (list == null || list.size() <= 0) {
+            throw new BaseException("请下载属于本乡镇数据");
+        }
+        if(list.size()>150000){
+            throw new BaseException("文件过大,到处失败,请分批到处");
+        }
+        return list;
+    }
+
     /**
      * 潜山核酸数据列表页(户籍地址)
      *

+ 6 - 0
boman-web-core/src/main/java/com/boman/web/core/service/accounting/IAccountingDataService.java

@@ -65,4 +65,10 @@ public interface IAccountingDataService {
     AjaxResult detailedInfo(AccountingDataVo accountingData);
     AjaxResult wanShiTongList(AccountingDataVo accountingData);
     AjaxResult wanShiTongInfo(AccountingDataVo accountingData);
+
+    List<AccountingDataVo> nucleicAcidJcd(AccountingDataVo accountingData);
+
+    AjaxResult detailedJcd(String id);
+
+    List<AccountingDataVo> exportHsd(AccountingDataVo accountingData);
 }

+ 34 - 0
boman-web-core/src/main/java/com/boman/web/core/utils/CzrkUtils.java

@@ -216,6 +216,40 @@ public class CzrkUtils {
     }
 
 
+    /**
+     * 查询使用(检测点查询)
+     * 根据当前登录人判断该用户是什么角色权限字符,来进行判断该用户能查询到什么层级的数据
+     *
+     * @param accountingDataVo
+     * @param sysUser
+     * @param
+     */
+    public static void setQueryRoleJcd(AccountingDataVo accountingDataVo, SysUser sysUser) {
+        SysDept dept = sysUser.getDept();
+        if (dept == null) {
+            throw new BaseException("对不起,未获相关部门信息");
+        }
+        // 从部门中获取行政区域规划id
+        String areaId = dept.getAreaId();
+        if (StringUtils.isBlank(areaId)) {
+            throw new BaseException(dept.getDeptName() + "当前未获取到部门下行政区域id");
+        }
+        //判断该用户是什么角色权限字符
+        List<SysRole> roles = sysUser.getRoles();
+        if (roles != null && roles.size() > 0) {
+            for (SysRole role : roles) {
+                if (role != null) {
+                    String roleKey = role.getRoleKey();
+                    if (StringUtils.isNotBlank(roleKey)) {
+                        if ("region".equals(roleKey)) {
+                            accountingDataVo.setCjqxqh(areaId);
+                        }
+                    }
+                }
+            }
+        }
+    }
+
     /**
      * 查询使用(死亡导入人员权限)
      * 根据当前登录人判断该用户是什么角色权限字符,来进行判断该用户能查询到什么层级的数据

+ 57 - 27
boman-web-core/src/main/resources/mapper/AccountingDateMapper.xml

@@ -23,6 +23,7 @@
         <result property="xm" column="xm"/>
         <result property="transit" column="transit"/>
         <result property="collectorName" column="collector_name"/>
+        <result property="cjqxqh" column="cjqxqh"/>
         <result property="cjssxq" column="cjssxq"/>
         <result property="mainKey" column="main_key"/>
         <result property="modifyDate" column="modify_date"/>
@@ -56,34 +57,56 @@
     </resultMap>
 
     <sql id="selectAccountingDataVo">
-        select d.id,
-               d.jcsj,
-               d.lxdh,
-               d.address,
-               d.batch_number,
-               d.focus_person,
-               d.jcjg,
-               d.from_city,
-               d.jcdd,
-               d.cjdd,
-               d.to_city,
-               d.source,
-               d.zjhm,
-               d.cjsj,
-               d.certificate_no_type,
-               d.xm,
-               d.transit,
-               d.collector_name,
-               d.cjssxq,
-               d.main_key,
-               d.modify_date,
-               d.create_by,
-               d.create_time,
-               d.update_by,
-               d.update_time
-        from accounting_data d
+        select id,
+               jcsj,
+               lxdh,
+               address,
+               batch_number,
+               focus_person,
+               jcjg,
+               from_city,
+               jcdd,
+               cjdd,
+               to_city,
+               source,
+               zjhm,
+               cjsj,
+               certificate_no_type,
+               xm,
+               transit,
+               collector_name,
+               cjqxqh,
+               cjssxq,
+               main_key,
+               modify_date,
+               create_by,
+               create_time,
+               update_by,
+               update_time
+        from accounting_data
     </sql>
 
+
+    <select id="nucleicAcidJcd" resultMap="AccountingDataResult"
+            parameterType="com.boman.web.core.domain.vo.AccountingDataVo">
+        <include refid="selectAccountingDataVo"/>
+        <where>
+            1=1
+            <if test="zjhm != null  and zjhm != ''">and zjhm = #{zjhm}</if>
+            <if test="xm != null  and xm != ''">and xm like concat(#{xm}, '%')</if>
+            <if test="lxdh != null  and lxdh != ''">and lxdh = #{lxdh}</if>
+            <if test="params.startTime != null  and params.startTime != '' and params.startTime != 'null'">and
+                DATE_FORMAT(cjsj,'%Y-%m-%d %H:%i:%s') &gt;= DATE_FORMAT(#{params.startTime},'%Y-%m-%d %H:%i:%s')
+            </if>
+            <if test="params.endTime != null  and params.endTime != ''  and params.endTime != 'null'">and
+                DATE_FORMAT(cjsj,'%Y-%m-%d %H:%i:%s') &lt;= DATE_FORMAT(#{params.endTime},'%Y-%m-%d %H:%i:%s')
+            </if>
+            <if test="cjssxq != null  and cjssxq != ''">and cjssxq like concat('%',#{cjssxq}, '%')</if>
+            <if test="cjqxqh != null  and cjqxqh != ''">and cjqxqh = #{cjqxqh}</if>
+        </where>
+    </select>
+
+
     <select id="selectAccountingDataHjList" parameterType="com.boman.web.core.domain.vo.AccountingDataVo"
             resultMap="AccountingDataResult">
         SELECT
@@ -263,6 +286,7 @@
             <if test="certificateNoType != null">certificate_no_type,</if>
             <if test="xm != null">xm,</if>
             <if test="collectorName != null">collector_name,</if>
+            <if test="cjqxqh != null">cjqxqh,</if>
             <if test="cjssxq != null">cjssxq,</if>
             <if test="createBy != null">create_by,</if>
             create_time
@@ -285,6 +309,7 @@
             <if test="certificateNoType != null">#{certificateNoType},</if>
             <if test="xm != null">#{xm},</if>
             <if test="collectorName != null">#{collectorName},</if>
+            <if test="cjqxqh != null">#{cjqxqh},</if>
             <if test="cjssxq != null">#{cjssxq},</if>
             <if test="createBy != null">#{createBy},</if>
             sysdate()
@@ -294,7 +319,7 @@
     <select id="selectById" parameterType="String" resultType="int">
         select count(1)
         from accounting_data
-        where id = #{id}
+        where zjhm = #{zjhm} and cjsj = #{cjsj}
     </select>
 
     <select id="getExportHj" resultMap="AccountingDataResult">
@@ -578,5 +603,10 @@
           AND sfzhm = #{zjhm}
         limit 1
     </select>
+    <select id="detailedJcd" resultMap="AccountingDataResult">
+        <include refid="selectAccountingDataVo"/>
+        where id = #{id}
+    </select>
+
 
 </mapper>