|
@@ -6,8 +6,9 @@ package com.kexun.controller;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.kexun.common.utils.Result;
|
|
|
+import com.kexun.entity.CooperatorField;
|
|
|
import com.kexun.entity.CooperatorInfo;
|
|
|
-import com.kexun.service.CooperatorInfoService;
|
|
|
+import com.kexun.service.CooperatorService;
|
|
|
import lombok.extern.java.Log;
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -24,32 +25,59 @@ import java.util.List;
|
|
|
*/
|
|
|
|
|
|
@RestController
|
|
|
-@RequestMapping("/admin/partner")
|
|
|
+@RequestMapping("/admin/cooperator")
|
|
|
@Log
|
|
|
public class CooperatorController {
|
|
|
|
|
|
@Autowired
|
|
|
- private CooperatorInfoService CooperatorInfoService;
|
|
|
+ private CooperatorService CooperatorService;
|
|
|
|
|
|
// 获取合作方信息
|
|
|
@GetMapping("cooperatorList")
|
|
|
public Result cooperatorList() {
|
|
|
JSONObject resJson=new JSONObject();
|
|
|
- List<CooperatorInfo> list=CooperatorInfoService.list();
|
|
|
+ List<CooperatorInfo> list= CooperatorService.list();
|
|
|
resJson.put("cooperator_List",list);
|
|
|
+// System.out.println(list);
|
|
|
|
|
|
return Result.success("ok",resJson);
|
|
|
+ }
|
|
|
+
|
|
|
+// @GetMapping("findCooperatorListByName")
|
|
|
+// public Result findCooperatorListByName(String partnerName) {
|
|
|
+//
|
|
|
+// JSONObject result = new JSONObject();
|
|
|
+// CooperatorInfo cooperatorInfo = CooperatorService.findByCooperatorNum(partnerName);
|
|
|
+//
|
|
|
+// result.put("cooperatorName", cooperatorInfo.getCooperatorName());
|
|
|
+// result.put("fieldCount", cooperatorInfo.getFieldCount());
|
|
|
+// result.put("cooperatorNum", cooperatorInfo.getCooperatorNum());
|
|
|
+// result.put("modelCount", cooperatorInfo.getModelCount());
|
|
|
+// result.put("createTime", cooperatorInfo.getCreateTime());
|
|
|
+// return Result.success("ok", result);
|
|
|
+// }
|
|
|
+
|
|
|
+ @GetMapping("findCooperatorFieldByNum")
|
|
|
+ public Result findCooperatorFieldByNum(String cooperatorNum) {
|
|
|
|
|
|
+ JSONObject result = new JSONObject();
|
|
|
+ List<CooperatorField> list = CooperatorService.findCooperatorFieldByNum();
|
|
|
+// System.out.println(list);
|
|
|
+ result.put("cooperator_field",list);
|
|
|
+
|
|
|
+ return Result.success("ok", result);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
@GetMapping("list")
|
|
|
public Result list(String partnerName) {
|
|
|
+
|
|
|
QueryWrapper<CooperatorInfo> w = new QueryWrapper<>();
|
|
|
if (!StringUtils.isEmpty(partnerName)) {
|
|
|
w.like("partner_name", partnerName);
|
|
|
}
|
|
|
|
|
|
- List<CooperatorInfo> list = CooperatorInfoService.list(w);
|
|
|
+ List<CooperatorInfo> list = CooperatorService.list(w);
|
|
|
return Result.success("ok", list);
|
|
|
}
|
|
|
|