tjf 3 лет назад
Родитель
Сommit
b70d7e3a2f

+ 1 - 0
boman-api/boman-domain/src/main/java/com/boman/domain/Czrk.java

@@ -224,6 +224,7 @@ public class Czrk extends BaseEntity{
     /**
      * 变更时间
      */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private Date changUserTime;
 
     /**

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

@@ -1,104 +0,0 @@
-//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));
-//    }
-//
-//
-//
-//}

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

@@ -185,6 +185,17 @@ public class CzrkController extends BaseController {
         return czrkService.changeCzrk(czrk);
     }
 
+
+    /**
+     * 查询历史变更信息
+     * @param czrk
+     * @return
+     */
+    @PostMapping("/changeCzrkHistory")
+    public AjaxResult changeCzrkHistory(@RequestBody Czrk czrk) {
+        return czrkService.changeCzrkHistory(czrk);
+    }
+
     /**
      * 查询非正常人员列表(死亡,失踪)
      */

+ 9 - 0
boman-web-core/src/main/java/com/boman/web/core/mapper/CzrkChangeMapper.java

@@ -2,6 +2,8 @@ package com.boman.web.core.mapper;
 
 import com.boman.domain.Czrk;
 
+import java.util.List;
+
 
 /**
  * 变更信息历史表
@@ -19,6 +21,13 @@ public interface CzrkChangeMapper {
      */
     int insertCzrkChange(Czrk czrk);
 
+    /**
+     * 根据户籍人口id查询对应信息
+     * @param czrk
+     * @return
+     */
+    List<Czrk> selectListByCzrkId(Czrk czrk);
+
     /**
      * 修改变更信息历史表
      *

+ 28 - 14
boman-web-core/src/main/java/com/boman/web/core/service/czrk/CzrkServiceImpl.java

@@ -175,7 +175,6 @@ public class CzrkServiceImpl implements ICzrkService {
         setAgeScope(czrk);
         //设置权限
         setQueryRole(czrk, sysUser, Czrk.HJ);
-        startPage();
         long startTimeSql = System.currentTimeMillis();
         List<Czrk> czrks = czrkMapper.unusualList(czrk);
         long endTimeSql = System.currentTimeMillis() - startTimeSql;
@@ -627,8 +626,12 @@ public class CzrkServiceImpl implements ICzrkService {
      * @return
      */
     @Override
+    @Transactional(rollbackFor = Exception.class)
     public AjaxResult changeCzrk(Czrk czrk) {
         SysUser sysUser = AuthUtils.getLoginUser().getSysUser();
+        if (sysUser == null) {
+            return AjaxResult.error("未获取到当前登录人");
+        }
         //判断一下id是否存在
         Long id = czrk.getId();
         if (id == null) {
@@ -638,6 +641,9 @@ public class CzrkServiceImpl implements ICzrkService {
         String status = czrk.getStatus();
         //根据id查询出这个人信息
         Czrk czrkQianchu = czrkMapper.selectCzrkById(id);
+        czrkQianchu.setChangUser(sysUser.getUserName());
+        czrkQianchu.setChangNikeUser(sysUser.getNickName());
+        czrkQianchu.setChangUserTime(DateUtils.getNowDate());
         //先保存这个人的信息,当做历史记录
         czrkChangeMapper.insertCzrkChange(czrkQianchu);
         if (StringUtils.isNotBlank(status) && "2".equals(status)) {
@@ -647,24 +653,32 @@ public class CzrkServiceImpl implements ICzrkService {
             czrkQianchu.setIsConfirm("N");
             czrkQianchu.setConfirmInfoUser("");
             czrkQianchu.setChangNikeUser("");
-            czrkQianchu.setChangUserTime(null);
-            czrkQianchu.setChangUser(sysUser.getUserName());
-            czrkQianchu.setChangNikeUser(sysUser.getNickName());
-            czrkQianchu.setChangUserTime(DateUtils.getNowDate());
+            czrkQianchu.setConfirmInfoUserTime(null);
             czrkQianchu.setStatus("1");
             czrkMapper.updateCzrk(czrkQianchu);
             return AjaxResult.success();
         }
         //接下来则放入其他状态中
-        if (sysUser != null) {
-            String userName = sysUser.getUserName();
-            czrk.setChangUser(userName);
-            czrk.setChangUserTime(DateUtils.getNowDate());
-            czrk.setChangNikeUser(sysUser.getNickName());
-            czrkMapper.changeCzrk(czrk);
-            return AjaxResult.success();
-        }
-        return AjaxResult.error("变更失败:没有获取到登录人信息");
+        String userName = sysUser.getUserName();
+        czrk.setChangUser(userName);
+        czrk.setChangUserTime(DateUtils.getNowDate());
+        czrk.setChangNikeUser(sysUser.getNickName());
+        czrkMapper.changeCzrk(czrk);
+        return AjaxResult.success();
+
+    }
+
+    /**
+     * 查询历史变更信息
+     *
+     * @param czrk
+     * @return
+     */
+    @Override
+    public AjaxResult changeCzrkHistory(Czrk czrk) {
+        List<Czrk> czrks = czrkChangeMapper.selectListByCzrkId(czrk);
+        CzrkUtils.packAddr(czrks);
+        return AjaxResult.success(czrks);
     }
 
     /**

+ 7 - 0
boman-web-core/src/main/java/com/boman/web/core/service/czrk/ICzrkService.java

@@ -131,6 +131,13 @@ public interface ICzrkService {
      */
     AjaxResult changeCzrk(Czrk czrk);
 
+    /**
+     * 查询历史变更信息
+     * @param czrk
+     * @return
+     */
+    AjaxResult changeCzrkHistory(Czrk czrk);
+
     List<Czrk> getAllCzrkRegionId(String s);
 
     List<Czrk> getAllCzrk(Czrk czrk);

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

@@ -81,7 +81,7 @@
     </appender>
 
     <!-- 系统模块日志级别控制  -->
-	<logger name="com.boman" level="info" />
+	<logger name="com.boman" level="debug" />
 	<!-- Spring日志级别控制  -->
 	<logger name="org.springframework" level="warn" />
 

+ 8 - 2
boman-web-core/src/main/resources/mapper/CzrkChangeMapper.xml

@@ -56,16 +56,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
 
     <sql id="selectCzrkVo">
-        select id, user_name, gender, age, birthday,dept_id, id_card, phone_num, code, house_type, rlr,rlr_nike, rl_time, yhzgx
-             , work_unit, province_id, province, city_id, city, region_id, region, village_towns_id, village_towns
+        select czrk_id as id, user_name, gender, age, birthday,dept_id, id_card, phone_num, code, house_type, rlr,rlr_nike, rl_time, yhzgx
+             , work_unit, province_id, province, city_id, city, region_id, region, village_towns_id, village_towns,chang_user,chang_nike_user,chang_user_time
              , village_id, village, villager_group_id, villager_group, now_in, remark,grid_id, status,is_confirm,confirm_info_user,confirm_info_nike_user,confirm_info_user_time, create_by, create_time
              , update_by, update_time, is_del, delete_reason, dept_id, is_rl, key_industries from czrk_change
     </sql>
 
+    <select id="selectListByCzrkId" parameterType="Long" resultMap="CzrkResult">
+        <include refid="selectCzrkVo"/>
+        where czrk_id = #{id} and is_del = 'N'
+    </select>
 
     <insert id="insertCzrkChange">
         insert into czrk_change
         <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null">czrk_id,</if>
             <if test="userName != null">user_name,</if>
             <if test="gender != null">gender,</if>
             <if test="age != null">age,</if>
@@ -107,6 +112,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             create_time, update_time
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">#{id},</if>
             <if test="userName != null">#{userName},</if>
             <if test="gender != null">#{gender},</if>
             <if test="age != null">#{age},</if>

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

@@ -1087,29 +1087,18 @@
     </select>
 
     <select id="unusualList" resultMap="CzrkResult">
-        select id, user_name, phone_num,dept_id, id_card, gender, province, city, region, village_towns, village,
-        villager_group, grid_id
-        , house_type, update_by, code, rlr,rlr_nike, update_time, delete_reason,
-        now_in,is_confirm,confirm_info_user,confirm_info_nike_user,confirm_info_user_time
-        from czrk
+        select id, user_name, phone_num,dept_id, id_card, province, city, region, village_towns, village,
+        villager_group,status, house_type,chang_user,chang_nike_user,chang_user_time from czrk
         <where>
             <if test="userName != null  and userName != ''">
                 and user_name like concat(#{userName}, '%')
             </if>
             <if test="params.startAge != null  and params.startAge != ''">and age &gt;= #{params.startAge}</if>
             <if test="params.endAge != null  and params.endAge != ''">and age &lt;= #{params.endAge}</if>
-            <if test="gender != null  and gender != ''">and gender = #{gender}</if>
             <if test="status != null  and status != ''">and status = #{status}</if>
             <if test="age != null ">and age = #{age}</if>
-            <if test="birthday != null ">and birthday = #{birthday}</if>
             <if test="idCard != null  and idCard != ''">and id_card = #{idCard}</if>
             <if test="phoneNum != null  and phoneNum != ''">and phone_num = #{phoneNum}</if>
-            <if test="code != null  and code != ''">and code = #{code}</if>
-            <if test="houseType != null  and houseType != ''">and house_type = #{houseType}</if>
-            <if test="rlr != null  and rlr != ''">and rlr = #{rlr}</if>
-            <if test="rlTime != null ">and rl_time = #{rlTime}</if>
-            <if test="yhzgx != null  and yhzgx != ''">and yhzgx = #{yhzgx}</if>
-            <if test="workUnit != null  and workUnit != ''">and work_unit = #{workUnit}</if>
             <if test="provinceId != null  and provinceId != ''">and province_id = #{provinceId}</if>
             <if test="province != null  and province != ''">and province = #{province}</if>
             <if test="cityId != null  and cityId != ''">and city_id = #{cityId}</if>
@@ -1120,13 +1109,8 @@
             <if test="villageTowns != null  and villageTowns != ''">and village_towns = #{villageTowns}</if>
             <if test="villageId != null  and villageId != ''">and village_id = #{villageId}</if>
             <if test="village != null  and village != ''">and village = #{village}</if>
-            <!--    <if test="villagerGroupId != null  and villagerGroupId != ''"> and villager_group_id = #{villagerGroupId}</if>
-                <if test="villagerGroup != null  and villagerGroup != ''"> and villager_group = #{villagerGroup}</if>-->
-            <if test="nowIn != null  and nowIn != ''">and now_in = #{nowIn}</if>
             <if test="isConfirm != null  and isConfirm != ''">and is_confirm = #{isConfirm}</if>
             <if test="isDel != null  and isDel != ''">and is_del = #{isDel}</if>
-            <if test="deleteReason != null  and deleteReason != ''">and delete_reason = #{deleteReason}</if>
-            <if test="gridId != null  and gridId != ''">and grid_id = #{gridId}</if>
         </where>
         order by create_time DESC
     </select>