|
@@ -6,8 +6,11 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
6
|
6
|
import com.huiju.estateagents.base.BaseController;
|
7
|
7
|
import com.huiju.estateagents.base.ResponseBean;
|
8
|
8
|
import com.huiju.estateagents.common.CommConstant;
|
|
9
|
+import com.huiju.estateagents.common.DateUtils;
|
|
10
|
+import com.huiju.estateagents.common.ExcelUtils;
|
9
|
11
|
import com.huiju.estateagents.entity.TaGoods;
|
10
|
12
|
import com.huiju.estateagents.entity.TaPointsExchange;
|
|
13
|
+import com.huiju.estateagents.excel.TaPointsExchangeExport;
|
11
|
14
|
import com.huiju.estateagents.service.ITaGoodsService;
|
12
|
15
|
import com.huiju.estateagents.service.ITaPointsExchangeService;
|
13
|
16
|
import io.swagger.annotations.Api;
|
|
@@ -26,7 +29,9 @@ import org.springframework.web.bind.annotation.ResponseBody;
|
26
|
29
|
import org.springframework.web.bind.annotation.RestController;
|
27
|
30
|
|
28
|
31
|
import javax.servlet.http.HttpServletRequest;
|
|
32
|
+import javax.servlet.http.HttpServletResponse;
|
29
|
33
|
import java.time.LocalDateTime;
|
|
34
|
+import java.util.ArrayList;
|
30
|
35
|
import java.util.List;
|
31
|
36
|
|
32
|
37
|
/**
|
|
@@ -94,6 +99,69 @@ public class TaPointsExchangeController extends BaseController {
|
94
|
99
|
}
|
95
|
100
|
return responseBean;
|
96
|
101
|
}
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+ /**
|
|
105
|
+ * 分页查询列表
|
|
106
|
+ * @param pageNum
|
|
107
|
+ * @param pageSize
|
|
108
|
+ * @return
|
|
109
|
+ */
|
|
110
|
+ @RequestMapping(value="/admin/taPointsExchange/export",method= RequestMethod.GET)
|
|
111
|
+ public ResponseBean taPointsExchangeExport(@RequestParam(value ="personName",required = false) String personName,
|
|
112
|
+ @RequestParam(value ="phone",required = false) String phone,
|
|
113
|
+ @RequestParam(value ="personType",required = false) String personType,
|
|
114
|
+ @RequestParam(value ="targetName",required = false) String targetName,
|
|
115
|
+ @RequestParam(value ="startCreateDate",required = false) String startCreateDate,
|
|
116
|
+ @RequestParam(value ="endCreateDate",required = false) String endCreateDate,
|
|
117
|
+ @RequestParam(value ="startVerifyDate",required = false) String startVerifyDate,
|
|
118
|
+ @RequestParam(value ="endVerifyDate",required = false) String endVerifyDate,
|
|
119
|
+ @RequestParam(value ="status",required = false) Integer status,
|
|
120
|
+ @RequestParam(value ="tel",required = false) String tel,
|
|
121
|
+ HttpServletRequest request,
|
|
122
|
+ HttpServletResponse response){
|
|
123
|
+ ResponseBean responseBean = new ResponseBean();
|
|
124
|
+ try {
|
|
125
|
+ //使用分页插件
|
|
126
|
+ TaPointsExchange taPointsExchange = new TaPointsExchange();
|
|
127
|
+ taPointsExchange.setPersonName(personName);
|
|
128
|
+ taPointsExchange.setPhone(phone);
|
|
129
|
+ taPointsExchange.setPersonType(personType);
|
|
130
|
+ taPointsExchange.setTargetName(targetName);
|
|
131
|
+ taPointsExchange.setStartCreateDate(startCreateDate);
|
|
132
|
+ taPointsExchange.setEndCreateDate(endCreateDate);
|
|
133
|
+ taPointsExchange.setStartVerifyDate(startVerifyDate);
|
|
134
|
+ taPointsExchange.setEndVerifyDate(endVerifyDate);
|
|
135
|
+ taPointsExchange.setStatus(status);
|
|
136
|
+ taPointsExchange.setTel(tel);
|
|
137
|
+ taPointsExchange.setOrgId(getOrgId(request));
|
|
138
|
+
|
|
139
|
+ responseBean = iTaPointsExchangeService.selectList(1, 9999,taPointsExchange,getTaPersonBuildingListByUserId(request));
|
|
140
|
+ List<TaPointsExchange> records = ((Page<TaPointsExchange>) responseBean.getData()).getRecords();
|
|
141
|
+
|
|
142
|
+ List<TaPointsExchangeExport> list = new ArrayList<>();
|
|
143
|
+ if (null != records) {
|
|
144
|
+ for (TaPointsExchange item: records) {
|
|
145
|
+ TaPointsExchangeExport row = new TaPointsExchangeExport();
|
|
146
|
+ row.setPersonName(item.getPersonName());
|
|
147
|
+ row.setPhone(item.getPhone());
|
|
148
|
+ row.setPersonType("prop".equals(item.getPersonType()) ? "物业相关" : ("life-consultant".equals(item.getPersonType()) ? "生活管家" : null));
|
|
149
|
+ row.setTargetName(item.getTargetName());
|
|
150
|
+ row.setStatus(1 == item.getStatus() ? "已领取" : "未领取");
|
|
151
|
+ row.setCreateDate(DateUtils.format(item.getCreateDate(), "yyyy-MM-dd HH:mm"));
|
|
152
|
+ row.setVerifyDate(DateUtils.format(item.getVerifyDate(), "yyyy-MM-dd HH:mm"));
|
|
153
|
+ list.add(row);
|
|
154
|
+ }
|
|
155
|
+ }
|
|
156
|
+
|
|
157
|
+ ExcelUtils.flush(response, TaPointsExchangeExport.class, list, "积分兑换记录" + DateUtils.today());
|
|
158
|
+ }catch (Exception e){
|
|
159
|
+ e.printStackTrace();
|
|
160
|
+ logger.error("taPointsExchangeList -=- {}",e.toString());
|
|
161
|
+ responseBean.addError(e.getMessage());
|
|
162
|
+ }
|
|
163
|
+ return responseBean;
|
|
164
|
+ }
|
97
|
165
|
|
98
|
166
|
/**
|
99
|
167
|
* 修改对象
|
|
@@ -231,7 +299,13 @@ public class TaPointsExchangeController extends BaseController {
|
231
|
299
|
public ResponseBean wxPointsExchangeList(@RequestParam(value ="pageNumber",defaultValue = "1") Integer pageNumber,
|
232
|
300
|
@RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
|
233
|
301
|
@RequestParam(value = "buildingId", required = false) String buildingId,
|
234
|
|
- @RequestParam(value = "personId", required = false) String personId){
|
|
302
|
+ @RequestParam(value = "personId", required = false) String personId,
|
|
303
|
+ HttpServletRequest request){
|
|
304
|
+
|
|
305
|
+ if (null == personId) {
|
|
306
|
+ personId = getPersonId(request);
|
|
307
|
+ }
|
|
308
|
+
|
235
|
309
|
ResponseBean responseBean = new ResponseBean();
|
236
|
310
|
try {
|
237
|
311
|
//使用分页插件
|