|
@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
7
|
7
|
import com.huiju.estateagents.base.BaseController;
|
8
|
8
|
import com.huiju.estateagents.base.ResponseBean;
|
9
|
9
|
import com.huiju.estateagents.common.CommConstant;
|
|
10
|
+import com.huiju.estateagents.config.FadadaProperties;
|
10
|
11
|
import org.apache.commons.lang3.StringUtils;
|
11
|
12
|
import org.slf4j.Logger;
|
12
|
13
|
import org.slf4j.LoggerFactory;
|
|
@@ -37,6 +38,9 @@ public class TaCompanyController extends BaseController {
|
37
|
38
|
|
38
|
39
|
private final Logger logger = LoggerFactory.getLogger(TaCompanyController.class);
|
39
|
40
|
|
|
41
|
+ @Autowired
|
|
42
|
+ private FadadaProperties fadadaProperties;
|
|
43
|
+
|
40
|
44
|
@Autowired
|
41
|
45
|
public ITaCompanyService iTaCompanyService;
|
42
|
46
|
|
|
@@ -165,4 +169,41 @@ public class TaCompanyController extends BaseController {
|
165
|
169
|
return responseBean;
|
166
|
170
|
}
|
167
|
171
|
|
|
172
|
+ /**
|
|
173
|
+ * 条件查询企业列表
|
|
174
|
+ *
|
|
175
|
+ * @param pageNum
|
|
176
|
+ * @param pageSize
|
|
177
|
+ * @param companyName
|
|
178
|
+ * @param companyCode
|
|
179
|
+ * @param certifiedStatus
|
|
180
|
+ * @return
|
|
181
|
+ */
|
|
182
|
+ @RequestMapping(value = "/channel/company/list", method = RequestMethod.GET)
|
|
183
|
+ public ResponseBean getCompanyList(@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
|
|
184
|
+ @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
|
|
185
|
+ @RequestParam(value = "companyName", required = false) String companyName,
|
|
186
|
+ @RequestParam(value = "companyCode", required = false) String companyCode,
|
|
187
|
+ @RequestParam(value = "certifiedStatus", required = false) String certifiedStatus) {
|
|
188
|
+ ResponseBean responseBean = new ResponseBean();
|
|
189
|
+ try {
|
|
190
|
+ fadadaProperties.getAppId();
|
|
191
|
+ //使用分页插件
|
|
192
|
+ IPage<TaCompany> pg = new Page<>(pageNum, pageSize);
|
|
193
|
+ QueryWrapper<TaCompany> queryWrapper = new QueryWrapper<>();
|
|
194
|
+ queryWrapper.like(StringUtils.isNotBlank(companyName), "company_name", companyName);
|
|
195
|
+ queryWrapper.like(StringUtils.isNotBlank(companyCode), "company_code", companyCode);
|
|
196
|
+ queryWrapper.eq(StringUtils.isNotBlank(certifiedStatus), "certified_status", certifiedStatus);
|
|
197
|
+ queryWrapper.eq("status", CommConstant.STATUS_NORMAL);
|
|
198
|
+ queryWrapper.orderByDesc("create_date");
|
|
199
|
+
|
|
200
|
+ IPage<TaCompany> result = iTaCompanyService.page(pg, queryWrapper);
|
|
201
|
+ responseBean.addSuccess(result);
|
|
202
|
+ } catch (Exception e) {
|
|
203
|
+ e.printStackTrace();
|
|
204
|
+ logger.error("taCompanyList -=- {}", e.toString());
|
|
205
|
+ responseBean.addError(e.getMessage());
|
|
206
|
+ }
|
|
207
|
+ return responseBean;
|
|
208
|
+ }
|
168
|
209
|
}
|