张延森 4 vuotta sitten
vanhempi
commit
818b65ee6a

+ 41
- 0
src/main/java/com/huiju/estateagents/excel/TpBuildingOwnerInfoExport.java Näytä tiedosto

@@ -0,0 +1,41 @@
1
+package com.huiju.estateagents.excel;
2
+
3
+import com.alibaba.excel.annotation.ExcelProperty;
4
+import com.alibaba.excel.annotation.write.style.ColumnWidth;
5
+import lombok.Data;
6
+
7
+@Data
8
+public class TpBuildingOwnerInfoExport {
9
+
10
+    @ColumnWidth(15)
11
+    @ExcelProperty(value = "姓名", index = 0)
12
+    private String ownerName;
13
+
14
+    @ColumnWidth(15)
15
+    @ExcelProperty(value = "手机号", index = 1)
16
+    private String ownerTel;
17
+
18
+    @ColumnWidth(25)
19
+    @ExcelProperty(value = "身份证", index = 2)
20
+    private String idCard;
21
+
22
+    @ColumnWidth(10)
23
+    @ExcelProperty(value = "性别", index = 3)
24
+    private String sex;
25
+
26
+    @ColumnWidth(60)
27
+    @ExcelProperty(value = "房间号", index = 4)
28
+    private String roomNoName;
29
+
30
+    @ColumnWidth(10)
31
+    @ExcelProperty(value = "身份", index = 5)
32
+    private String roleName;
33
+
34
+    @ColumnWidth(15)
35
+    @ExcelProperty(value = "审核状态", index = 6)
36
+    private String verifyStatus;
37
+
38
+    @ColumnWidth(25)
39
+    @ExcelProperty(value = "操作时间", index = 7)
40
+    private String createDate;
41
+}

+ 61
- 0
src/main/java/com/huiju/estateagents/property/controller/BuildingOwnerInfoController.java Näytä tiedosto

@@ -2,12 +2,18 @@ package com.huiju.estateagents.property.controller;
2 2
 
3 3
 
4 4
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
5
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
5 6
 import com.huiju.estateagents.base.BaseController;
6 7
 import com.huiju.estateagents.base.ResponseBean;
7 8
 import com.huiju.estateagents.center.taUser.entity.TaUser;
9
+import com.huiju.estateagents.common.DateUtils;
10
+import com.huiju.estateagents.common.ExcelUtils;
11
+import com.huiju.estateagents.common.StringUtils;
12
+import com.huiju.estateagents.excel.TpBuildingOwnerInfoExport;
8 13
 import com.huiju.estateagents.property.common.UserElement;
9 14
 import com.huiju.estateagents.property.model.TaFace;
10 15
 import com.huiju.estateagents.property.model.TaUserVerify;
16
+import com.huiju.estateagents.property.model.TpBuildingOwnerInfo;
11 17
 import com.huiju.estateagents.property.service.IBuildingOwnerInfoService;
12 18
 import com.huiju.estateagents.property.service.ITaFaceService;
13 19
 import com.huiju.estateagents.property.service.ITaUserVerifyService;
@@ -24,7 +30,9 @@ import org.springframework.web.multipart.MultipartFile;
24 30
 import javax.servlet.http.HttpServletRequest;
25 31
 import javax.servlet.http.HttpServletResponse;
26 32
 import javax.servlet.http.HttpSession;
33
+import java.io.IOException;
27 34
 import java.io.OutputStream;
35
+import java.util.ArrayList;
28 36
 import java.util.List;
29 37
 import java.util.Map;
30 38
 
@@ -66,6 +74,59 @@ public class BuildingOwnerInfoController extends BaseController {
66 74
         return responseBean;
67 75
     }
68 76
 
77
+    /**
78
+     * 业主导出
79
+     * @param parameter
80
+     * @param request
81
+     * @return
82
+     */
83
+    @RequestMapping(value = "/admin/buildingInfo/list/export", method = RequestMethod.POST)
84
+    public ResponseBean getListExport(@RequestBody String parameter,
85
+                                      HttpServletRequest request,
86
+                                      HttpServletResponse response){
87
+        ResponseBean responseBean = new ResponseBean();
88
+        TaUser userElement = getTaUser(request);
89
+        responseBean = iBuildingOwnerInfoService.listQuery(parameter, userElement);
90
+
91
+        List<TpBuildingOwnerInfo> records = (List<TpBuildingOwnerInfo>) ((Map<String, Object>) responseBean.getData()).get("list");
92
+
93
+        if (null != records) {
94
+            List<TpBuildingOwnerInfoExport> list = new ArrayList<>();
95
+            for (TpBuildingOwnerInfo item: records) {
96
+                TpBuildingOwnerInfoExport ownerInfo = new TpBuildingOwnerInfoExport();
97
+                ownerInfo.setOwnerName(item.getOwnerName());
98
+                ownerInfo.setIdCard(item.getIdCard());
99
+                ownerInfo.setOwnerTel(item.getOwnerTel());
100
+                ownerInfo.setSex(getSexFromIdCard(item.getIdCard()));
101
+                ownerInfo.setRoomNoName(item.getPhaseName()+item.getBuildingName()+item.getUnitName()+item.getLevelName()+item.getRoomNoName());
102
+                ownerInfo.setRoleName(item.getRoleName());
103
+                ownerInfo.setVerifyStatus("0".equals(item.getVerifyStatus()) ? "未审核" : ("1".equals(item.getVerifyStatus()) ? "审核通过" : ("1".equals(item.getVerifyStatus()) ? "审核不通过": "") ));
104
+                ownerInfo.setCreateDate(DateUtils.format(item.getCreateDate(), "yyyy-MM-dd HH:mm"));
105
+                list.add(ownerInfo);
106
+            }
107
+
108
+            try {
109
+                ExcelUtils.flush(response, TpBuildingOwnerInfoExport.class, list, "业主记录.xlsx");
110
+                return null;
111
+            } catch (IOException e) {
112
+                return ResponseBean.error("导出 Excel 失败 "+ e.getMessage(), ResponseBean.ERROR_UNAVAILABLE);
113
+            }
114
+        }
115
+
116
+        return responseBean;
117
+    }
118
+
119
+    private String getSexFromIdCard(String idCard) {
120
+        if (StringUtils.isEmpty(idCard) || idCard.length() != 18) {
121
+            return null;
122
+        }
123
+
124
+        String sign = idCard.split("")[16];
125
+
126
+        return Integer.parseInt(sign) % 2 == 1 ? "男" : "女";
127
+    }
128
+
129
+
69 130
     // @ApiOperation(value = "获取楼栋业主审核详情", notes = "获取楼栋业主审核详情")
70 131
     @ApiImplicitParams({
71 132
             @ApiImplicitParam(paramType = "query", dataTypeClass = Integer.class, name = "userVerifyId",value = "审核Id")

+ 1
- 1
src/main/resources/application-dev.yml Näytä tiedosto

@@ -80,7 +80,7 @@ pay-refund: https://dev.fangdeal.cn/api/refund/
80 80
 
81 81
 # 支付回调
82 82
 pay-new-notify:
83
-  wx-bill-notify: https://a.t.njyunzhi.com/api/wxBillNotify
83
+  wx-bill-notify: https://xs.njyunzhi.com/api/wxBillNotify
84 84
   ali-bill-notify:
85 85
   wx-car-notify:
86 86
   ali-car-notify:

+ 1
- 1
src/main/resources/application-prod.yml Näytä tiedosto

@@ -86,7 +86,7 @@ pay-refund: https://wx.fangdeal.cn/api/refund/
86 86
 
87 87
 # 支付回调
88 88
 pay-new-notify:
89
-  wx-bill-notify: https://a.t.njyunzhi.com/api/wxBillNotify
89
+  wx-bill-notify: https://xs.njyunzhi.com/api/wxBillNotify
90 90
   ali-bill-notify:
91 91
   wx-car-notify:
92 92
   ali-car-notify:

+ 2
- 2
src/main/resources/application.yml Näytä tiedosto

@@ -15,5 +15,5 @@ wx:
15 15
   miniapp:
16 16
     index: /pages/ShouYe/index
17 17
   mp:
18
-    festivalH5: https://xs.ycjcjy.com/jierih5.html
19
-    birthdayH5: https://xs.ycjcjy.com/shengrih5.html
18
+    festivalH5: https://xs.njyunzhi.com/jierih5.html
19
+    birthdayH5: https://xs.njyunzhi.com/shengrih5.html

+ 5
- 0
src/main/resources/mapper/property/TpBuildingOwnerInfoMapper.xml Näytä tiedosto

@@ -60,6 +60,7 @@
60 60
 
61 61
     <select id="selectListByParams" resultType="com.huiju.estateagents.property.model.TpBuildingOwnerInfo">
62 62
         SELECT
63
+            distinct
63 64
             u.id,
64 65
             u.phase_name,
65 66
             u.building_name,
@@ -76,6 +77,7 @@
76 77
             u.create_date AS createDate
77 78
         FROM
78 79
         tp_building_owner_info u
80
+        left join ta_user_verify t on t.id = u.ta_user_verify_id
79 81
         WHERE
80 82
 
81 83
         u.org_id=#{tpBuildingOwnerInfo.orgId,jdbcType=INTEGER}
@@ -103,6 +105,9 @@
103 105
         <if test="tpBuildingOwnerInfo.idCard != null and tpBuildingOwnerInfo.idCard != ''">
104 106
             and u.id_card like concat('%',#{tpBuildingOwnerInfo.idCard,jdbcType=VARCHAR},'%')
105 107
         </if>
108
+        <if test="tpBuildingOwnerInfo.roleName != null and tpBuildingOwnerInfo.roleName != ''">
109
+            and t.role_id = #{tpBuildingOwnerInfo.roleName}
110
+        </if>
106 111
         order by u.create_date desc
107 112
     </select>
108 113
 </mapper>