Bläddra i källkod

户室开锁记录

chenfan 1 vecka sedan
förälder
incheckning
f952a72dc8

+ 1 - 0
doc/cf20250529.sql

@@ -0,0 +1 @@
+alter table park_room_reservation add looking_notes varchar(4000) null comment '看房备注';

+ 67 - 0
pro-base/src/main/java/com/idea/buildManage/controller/ParkRoomReservationController.java

@@ -1,11 +1,13 @@
 package com.idea.buildManage.controller;
 
+import com.alibaba.excel.EasyExcel;
 import com.github.pagehelper.PageInfo;
 import com.idea.buildManage.dto.BindSearchDto;
 import com.idea.buildManage.dto.ParkRoomReservationDto;
 import com.idea.buildManage.dto.RoomSearchDto;
 import com.idea.buildManage.model.ParkRoomBindDoorExample;
 import com.idea.buildManage.model.ParkRoomReservation;
+import com.idea.buildManage.model.ParkRoomReservationExcel;
 import com.idea.buildManage.service.ParkRoomBindDoorService;
 import com.idea.buildManage.service.ParkRoomReservationService;
 import com.idea.buildManage.vo.ParkRoomVo;
@@ -16,10 +18,17 @@ import com.rockstar.frame.model.extend.DateTrans;
 import com.rockstar.frame.model.extend.TableSplitResult;
 import com.rockstar.frame.model.extend.Tablepar;
 import com.rockstar.shiro.util.ShiroUtils;
+import com.rockstar.util.DateUtils;
 import io.swagger.annotations.Api;
+import org.apache.commons.collections.CollectionUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import javax.servlet.http.HttpServletResponse;
+import java.net.URLEncoder;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
 import java.util.List;
 import java.util.Map;
 
@@ -45,6 +54,13 @@ public class ParkRoomReservationController extends BaseController {
         return new TableSplitResult<>(page.getPageNum(), page.getTotal(), page.getList());
     }
 
+    @PostMapping(value = "completeListPage",produces = {"application/json;charset=UTF-8"})
+    public Object completeListPage(Tablepar tablepar, ParkRoomReservationDto model){
+        model.setReservationStatus(4);
+        PageInfo<ParkRoomReservation> page = modelService.listPage(tablepar,model);
+        return new TableSplitResult<>(page.getPageNum(), page.getTotal(), page.getList());
+    }
+
     @PostMapping(value = "roomListPage",produces = {"application/json;charset=UTF-8"})
     public Object roomListPage(Tablepar tablepar, RoomSearchDto model){
         PageInfo<ParkRoomVo> page = modelService.roomListPage(tablepar,model);
@@ -86,6 +102,16 @@ public class ParkRoomReservationController extends BaseController {
         return result(result);
     }
 
+    @PostMapping(value = "editLookingNotes",produces = {"application/json;charset=UTF-8"})
+    public AjaxResult editLookingNotes(String id, String lookingNotes){
+        ParkRoomReservation model = new ParkRoomReservation();
+        model.setId(id);
+        model.setLookingNotes(lookingNotes);
+        model.setUpdateUser(ShiroUtils.getUserId());
+        int result = modelService.updateByPrimaryKeySelective(model);
+        return result(result);
+    }
+
     @PostMapping(value = "getById",produces = {"application/json;charset=UTF-8"})
     public ParkRoomReservation getById(String id) {
         return modelService.selectByPrimaryKey(id);
@@ -126,4 +152,45 @@ public class ParkRoomReservationController extends BaseController {
         }
     }
 
+    @PostMapping(value = "exportData",produces = {"application/json;charset=UTF-8"})
+    public void exportData(HttpServletResponse response, ParkRoomReservationDto model){
+        List<ParkRoomReservation> list = new ArrayList<>();
+        List<ParkRoomReservationExcel> excelList = new ArrayList<>();
+        try{
+            model.setReservationStatus(4);
+            list = modelService.listPageAll(model);
+            if(CollectionUtils.isNotEmpty(list)){
+                for (ParkRoomReservation reservation : list) {
+                    ParkRoomReservationExcel excel = new ParkRoomReservationExcel();
+                    excel.setParkInfoName(reservation.getParkInfoName());
+                    excel.setParkFloorDiscName(reservation.getParkFloorDiscName());
+                    excel.setMnpBuildingNo(reservation.getMnpBuildingNo());
+                    excel.setParkRoomNo(reservation.getParkRoomNo());
+                    excel.setApplicantName(reservation.getApplicantName());
+                    excel.setApplicantPhone(reservation.getApplicantPhone());
+                    excel.setBuyerName(reservation.getBuyerName());
+                    excel.setBuyerPhone(reservation.getBuyerPhone());
+                    excel.setReservationStatusStr(reservation.getReservationStatusStr());
+                    excel.setDoorStatus(reservation.getDoorStatus());
+                    if(null!=reservation.getReservationDate()){
+                        excel.setReservationDate(DateUtils.formatDate(reservation.getReservationDate()));
+                    }
+                    excel.setTimeStr(reservation.getReservationTimeStart() + "~" + reservation.getReservationTimeEnd());
+                    excel.setDoorPassStatusStr(reservation.getDoorPassStatusStr());
+                    excel.setLookingNotes(reservation.getLookingNotes());
+                    excelList.add(excel);
+                }
+                response.setContentType("application/vnd.ms-excel");
+                response.setCharacterEncoding("utf-8");
+                EasyExcel.write(response.getOutputStream(), ParkRoomReservationExcel.class).sheet("my sheet")
+                        .doWrite(excelList);
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        } finally {
+            list.clear();
+            excelList.clear();
+        }
+    }
+
 }

+ 8 - 0
pro-base/src/main/java/com/idea/buildManage/dto/ParkRoomReservationDto.java

@@ -13,4 +13,12 @@ public class ParkRoomReservationDto {
 
     private Integer reservationStatus;
 
+    private String parkRoomNo;
+
+    private String parkInfoId;
+
+    private String mnpBuildingId;
+
+    private String roomAddress;
+
 }

+ 2 - 0
pro-base/src/main/java/com/idea/buildManage/model/ParkRoomReservation.java

@@ -64,6 +64,8 @@ public class ParkRoomReservation implements Serializable {
 
     private Date updateTime;
 
+    private String lookingNotes;
+
     // 额外字段
     private String createUserName;
     private String reservationStatusStr;

+ 70 - 0
pro-base/src/main/java/com/idea/buildManage/model/ParkRoomReservationExample.java

@@ -1934,6 +1934,76 @@ public class ParkRoomReservationExample {
             addCriterion("update_time not between", value1, value2, "updateTime");
             return (Criteria) this;
         }
+
+        public Criteria andLookingNotesIsNull() {
+            addCriterion("looking_notes is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andLookingNotesIsNotNull() {
+            addCriterion("looking_notes is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andLookingNotesEqualTo(String value) {
+            addCriterion("looking_notes =", value, "lookingNotes");
+            return (Criteria) this;
+        }
+
+        public Criteria andLookingNotesNotEqualTo(String value) {
+            addCriterion("looking_notes <>", value, "lookingNotes");
+            return (Criteria) this;
+        }
+
+        public Criteria andLookingNotesGreaterThan(String value) {
+            addCriterion("looking_notes >", value, "lookingNotes");
+            return (Criteria) this;
+        }
+
+        public Criteria andLookingNotesGreaterThanOrEqualTo(String value) {
+            addCriterion("looking_notes >=", value, "lookingNotes");
+            return (Criteria) this;
+        }
+
+        public Criteria andLookingNotesLessThan(String value) {
+            addCriterion("looking_notes <", value, "lookingNotes");
+            return (Criteria) this;
+        }
+
+        public Criteria andLookingNotesLessThanOrEqualTo(String value) {
+            addCriterion("looking_notes <=", value, "lookingNotes");
+            return (Criteria) this;
+        }
+
+        public Criteria andLookingNotesLike(String value) {
+            addCriterion("looking_notes like", value, "lookingNotes");
+            return (Criteria) this;
+        }
+
+        public Criteria andLookingNotesNotLike(String value) {
+            addCriterion("looking_notes not like", value, "lookingNotes");
+            return (Criteria) this;
+        }
+
+        public Criteria andLookingNotesIn(List<String> values) {
+            addCriterion("looking_notes in", values, "lookingNotes");
+            return (Criteria) this;
+        }
+
+        public Criteria andLookingNotesNotIn(List<String> values) {
+            addCriterion("looking_notes not in", values, "lookingNotes");
+            return (Criteria) this;
+        }
+
+        public Criteria andLookingNotesBetween(String value1, String value2) {
+            addCriterion("looking_notes between", value1, value2, "lookingNotes");
+            return (Criteria) this;
+        }
+
+        public Criteria andLookingNotesNotBetween(String value1, String value2) {
+            addCriterion("looking_notes not between", value1, value2, "lookingNotes");
+            return (Criteria) this;
+        }
     }
 
     public static class Criteria extends GeneratedCriteria {

+ 54 - 0
pro-base/src/main/java/com/idea/buildManage/model/ParkRoomReservationExcel.java

@@ -0,0 +1,54 @@
+package com.idea.buildManage.model;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+@Data
+public class ParkRoomReservationExcel implements Serializable {
+
+    @ExcelProperty(value = "楼盘/小区")
+    private String parkInfoName;
+
+    @ExcelProperty(value = "分期")
+    private String parkFloorDiscName;
+
+    @ExcelProperty(value = "单元/楼栋号")
+    private String mnpBuildingNo;
+
+    @ExcelProperty(value = "户室号")
+    private String parkRoomNo;
+
+    @ExcelProperty(value = "申请人")
+    private String applicantName;
+
+    @ExcelProperty(value = "申请人电话")
+    private String applicantPhone;
+
+    @ExcelProperty(value = "购房人")
+    private String buyerName;
+
+    @ExcelProperty(value = "购房人电话")
+    private String buyerPhone;
+
+    @ExcelProperty(value = "状态")
+    private String reservationStatusStr;
+
+    @ExcelProperty(value = "门锁")
+    private String doorStatus;
+
+    @ExcelProperty(value = "开锁日期")
+    private String reservationDate;
+
+    @ExcelProperty(value = "看房时段")
+    private String timeStr;
+
+    @ExcelProperty(value = "开门密码")
+    private String doorPassStatusStr;
+
+    @ExcelProperty(value = "备注")
+    private String lookingNotes;
+
+    private static final long serialVersionUID = 1L;
+}

+ 4 - 0
pro-base/src/main/java/com/idea/buildManage/service/ParkRoomReservationService.java

@@ -55,6 +55,10 @@ public class ParkRoomReservationService implements BaseService<ParkRoomReservati
         return new PageInfo<>(list);
     }
 
+    public List<ParkRoomReservation> listPageAll(ParkRoomReservationDto model) {
+        return parkRoomReservationExtendMapper.listPage(model);
+    }
+
     public PageInfo<ParkRoomVo> roomListPage(Tablepar tablepar, RoomSearchDto model) {
         PageHelper.startPage(tablepar.getPageNum(), tablepar.getPageSize());
         List<ParkRoomVo> list = parkRoomReservationExtendMapper.roomListPage(model);

+ 13 - 0
pro-base/src/main/resources/mybatis/buildManage/ParkRoomReservationExtendMapper.xml

@@ -40,6 +40,7 @@
         a.create_time,
         a.update_user,
         a.update_time,
+        a.looking_notes,
         b.truename as createUserName,
         if(c.id is not null, '已匹配', '未匹配') as doorStatus
         from park_room_reservation a
@@ -62,6 +63,18 @@
             <if test="reservationStatus!=null">
                 and a.reservation_status= #{reservationStatus}
             </if>
+            <if test="parkInfoId!=null and parkInfoId!=''">
+                and a.park_info_id = #{parkInfoId}
+            </if>
+            <if test="mnpBuildingId!=null and mnpBuildingId!=''">
+                and a.mnp_building_id = #{mnpBuildingId}
+            </if>
+            <if test="parkRoomNo!=null and parkRoomNo!=''">
+                and a.park_room_no like concat('%',#{parkRoomNo},'%')
+            </if>
+            <if test="roomAddress!=null and roomAddress!=''">
+                and concat(a.park_info_name, a.park_floor_disc_name, a.mnp_building_no, '号', a.park_room_no, '室') like concat('%',#{roomAddress},'%')
+            </if>
         </where>
         order by create_time desc
     </select>

+ 20 - 5
pro-base/src/main/resources/mybatis/buildManage/ParkRoomReservationMapper.xml

@@ -29,6 +29,7 @@
     <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
     <result column="update_user" jdbcType="VARCHAR" property="updateUser" />
     <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
+    <result column="looking_notes" jdbcType="VARCHAR" property="lookingNotes" />
   </resultMap>
   <sql id="Example_Where_Clause">
     <where>
@@ -93,7 +94,7 @@
     mnp_building_no, park_room_id, park_room_floor, park_room_no, buyer_name, buyer_phone, 
     buyer_gender, buyer_address, applicant_name, applicant_phone, overview_content, reservation_date, 
     reservation_time_start, reservation_time_end, reservation_order, reservation_status, 
-    door_pass_status, create_user, create_time, update_user, update_time
+    door_pass_status, create_user, create_time, update_user, update_time, looking_notes
   </sql>
   <select id="selectByExample" parameterType="com.idea.buildManage.model.ParkRoomReservationExample" resultMap="BaseResultMap">
     select
@@ -135,7 +136,7 @@
       reservation_time_start, reservation_time_end, 
       reservation_order, reservation_status, door_pass_status, 
       create_user, create_time, update_user, 
-      update_time)
+      update_time, looking_notes)
     values (#{id,jdbcType=VARCHAR}, #{parkInfoId,jdbcType=VARCHAR}, #{parkInfoName,jdbcType=VARCHAR}, 
       #{parkFloorDiscId,jdbcType=VARCHAR}, #{parkFloorDiscName,jdbcType=VARCHAR}, #{mnpBuildingId,jdbcType=VARCHAR}, 
       #{mnpBuildingNo,jdbcType=VARCHAR}, #{parkRoomId,jdbcType=VARCHAR}, #{parkRoomFloor,jdbcType=VARCHAR}, 
@@ -145,7 +146,7 @@
       #{reservationTimeStart,jdbcType=VARCHAR}, #{reservationTimeEnd,jdbcType=VARCHAR}, 
       #{reservationOrder,jdbcType=INTEGER}, #{reservationStatus,jdbcType=INTEGER}, #{doorPassStatus,jdbcType=INTEGER}, 
       #{createUser,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateUser,jdbcType=VARCHAR}, 
-      #{updateTime,jdbcType=TIMESTAMP})
+      #{updateTime,jdbcType=TIMESTAMP}, #{lookingNotes,jdbcType=VARCHAR})
   </insert>
   <insert id="insertSelective" parameterType="com.idea.buildManage.model.ParkRoomReservation">
     insert into park_room_reservation
@@ -231,6 +232,9 @@
       <if test="updateTime != null">
         update_time,
       </if>
+      <if test="lookingNotes != null">
+        looking_notes,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="id != null">
@@ -314,6 +318,9 @@
       <if test="updateTime != null">
         #{updateTime,jdbcType=TIMESTAMP},
       </if>
+      <if test="lookingNotes != null">
+        #{lookingNotes,jdbcType=VARCHAR},
+      </if>
     </trim>
   </insert>
   <select id="countByExample" parameterType="com.idea.buildManage.model.ParkRoomReservationExample" resultType="java.lang.Long">
@@ -406,6 +413,9 @@
       <if test="record.updateTime != null">
         update_time = #{record.updateTime,jdbcType=TIMESTAMP},
       </if>
+      <if test="record.lookingNotes != null">
+        looking_notes = #{record.lookingNotes,jdbcType=VARCHAR},
+      </if>
     </set>
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
@@ -439,7 +449,8 @@
       create_user = #{record.createUser,jdbcType=VARCHAR},
       create_time = #{record.createTime,jdbcType=TIMESTAMP},
       update_user = #{record.updateUser,jdbcType=VARCHAR},
-      update_time = #{record.updateTime,jdbcType=TIMESTAMP}
+      update_time = #{record.updateTime,jdbcType=TIMESTAMP},
+      looking_notes = #{record.lookingNotes,jdbcType=VARCHAR}
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
     </if>
@@ -525,6 +536,9 @@
       <if test="updateTime != null">
         update_time = #{updateTime,jdbcType=TIMESTAMP},
       </if>
+      <if test="lookingNotes != null">
+        looking_notes = #{lookingNotes,jdbcType=VARCHAR},
+      </if>
     </set>
     where id = #{id,jdbcType=VARCHAR}
   </update>
@@ -555,7 +569,8 @@
       create_user = #{createUser,jdbcType=VARCHAR},
       create_time = #{createTime,jdbcType=TIMESTAMP},
       update_user = #{updateUser,jdbcType=VARCHAR},
-      update_time = #{updateTime,jdbcType=TIMESTAMP}
+      update_time = #{updateTime,jdbcType=TIMESTAMP},
+      looking_notes = #{lookingNotes,jdbcType=VARCHAR}
     where id = #{id,jdbcType=VARCHAR}
   </update>
 </mapper>