|
@@ -9,14 +9,13 @@ import com.huiju.estateagents.base.BaseController;
|
9
|
9
|
import com.huiju.estateagents.base.ResponseBean;
|
10
|
10
|
import com.huiju.estateagents.center.taUser.entity.TaUser;
|
11
|
11
|
import com.huiju.estateagents.center.taUser.service.ITaUserService;
|
12
|
|
-import com.huiju.estateagents.common.CommConstant;
|
13
|
|
-import com.huiju.estateagents.common.SMSUtils;
|
14
|
|
-import com.huiju.estateagents.common.StringUtils;
|
|
12
|
+import com.huiju.estateagents.common.*;
|
15
|
13
|
import com.huiju.estateagents.common.smsService.Captcha;
|
16
|
14
|
import com.huiju.estateagents.entity.TaChannel;
|
17
|
15
|
import com.huiju.estateagents.entity.TaChannelPerson;
|
18
|
16
|
import com.huiju.estateagents.entity.TaPerson;
|
19
|
17
|
import com.huiju.estateagents.entity.TaPersonBuilding;
|
|
18
|
+import com.huiju.estateagents.excel.TaPersonExport;
|
20
|
19
|
import com.huiju.estateagents.service.*;
|
21
|
20
|
import com.huiju.estateagents.third.entity.TaThirdPartyMiniappConfig;
|
22
|
21
|
import com.huiju.estateagents.third.service.ITaThirdPartyMiniappConfigService;
|
|
@@ -28,6 +27,8 @@ import org.springframework.web.bind.annotation.*;
|
28
|
27
|
import org.springframework.web.client.RestTemplate;
|
29
|
28
|
|
30
|
29
|
import javax.servlet.http.HttpServletRequest;
|
|
30
|
+import javax.servlet.http.HttpServletResponse;
|
|
31
|
+import java.io.IOException;
|
31
|
32
|
import java.time.LocalDateTime;
|
32
|
33
|
import java.util.ArrayList;
|
33
|
34
|
import java.util.HashMap;
|
|
@@ -826,4 +827,42 @@ public class TaPersonController extends BaseController {
|
826
|
827
|
return ResponseBean.success(result);
|
827
|
828
|
}
|
828
|
829
|
|
|
830
|
+ @GetMapping("/admin/person-list/export")
|
|
831
|
+ public ResponseBean getPersonListExport(@RequestParam(value = "name", required = false) String name,
|
|
832
|
+ @RequestParam(value = "phone", required = false) String phone,
|
|
833
|
+ @RequestParam(value = "recommended", required = false) String recommended,
|
|
834
|
+ HttpServletRequest request,
|
|
835
|
+ HttpServletResponse response) {
|
|
836
|
+ Integer orgId = getOrgId(request);
|
|
837
|
+
|
|
838
|
+ IPage<TaPerson> page = new Page<>(1, 9999);
|
|
839
|
+ IPage<TaPerson> result = taPersonService.getPersonBy(page, orgId, name, phone, recommended);
|
|
840
|
+
|
|
841
|
+ List<TaPerson> personList = result.getRecords();
|
|
842
|
+ List<TaPersonExport> data = new ArrayList<>();
|
|
843
|
+ if (null != personList) {
|
|
844
|
+// String senRegx = "(\\\\d{3})\\\\d{4}(\\\\d{4})";
|
|
845
|
+// String senRepl = "$1****$2";
|
|
846
|
+ for (TaPerson person: personList) {
|
|
847
|
+ TaPersonExport row = new TaPersonExport();
|
|
848
|
+ row.setNickname(person.getNickname());
|
|
849
|
+// row.setPhone(StringUtils.simpleSensitive(person.getPhone(), senRegx, senRepl));
|
|
850
|
+ row.setPhone(person.getPhone());
|
|
851
|
+ row.setSharePersonName(person.getSharePersonName());
|
|
852
|
+ row.setPoints(person.getPoints());
|
|
853
|
+ row.setCreateDate(DateUtils.format(person.getCreateDate(), "yyyy-MM-dd HH:mm"));
|
|
854
|
+ data.add(row);
|
|
855
|
+ }
|
|
856
|
+ }
|
|
857
|
+
|
|
858
|
+ try {
|
|
859
|
+ ExcelUtils.flush(response, TaPersonExport.class, data, "会员列表");
|
|
860
|
+ } catch (IOException e) {
|
|
861
|
+ e.printStackTrace();
|
|
862
|
+ return ResponseBean.error(e.getMessage(), ResponseBean.ERROR_UNAVAILABLE);
|
|
863
|
+ }
|
|
864
|
+
|
|
865
|
+ return null;
|
|
866
|
+ }
|
|
867
|
+
|
829
|
868
|
}
|