|
@@ -1,7 +1,10 @@
|
|
package com.kexun.controller;
|
|
package com.kexun.controller;
|
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.kexun.common.utils.Result;
|
|
import com.kexun.common.utils.Result;
|
|
|
|
+import com.kexun.entity.CooperatorField;
|
|
|
|
+import com.kexun.entity.CooperatorInfo;
|
|
import com.kexun.entity.CooperatorProduct;
|
|
import com.kexun.entity.CooperatorProduct;
|
|
import com.kexun.service.CooperatorProductService;
|
|
import com.kexun.service.CooperatorProductService;
|
|
import lombok.extern.java.Log;
|
|
import lombok.extern.java.Log;
|
|
@@ -10,10 +13,12 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
|
+import java.util.Calendar;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
@RestController
|
|
@RestController
|
|
-@RequestMapping("/admin/cooperator")
|
|
|
|
|
|
+@RequestMapping("/admin/cooperator_product")
|
|
@Log
|
|
@Log
|
|
public class CooperatorProductController {
|
|
public class CooperatorProductController {
|
|
|
|
|
|
@@ -23,7 +28,6 @@ public class CooperatorProductController {
|
|
// 获取合作产品信息
|
|
// 获取合作产品信息
|
|
@GetMapping("cooperatorProductList")
|
|
@GetMapping("cooperatorProductList")
|
|
public Result cooperatorProductList() {
|
|
public Result cooperatorProductList() {
|
|
- System.out.println("aaaa");
|
|
|
|
JSONObject resJson=new JSONObject();
|
|
JSONObject resJson=new JSONObject();
|
|
List<CooperatorProduct> list=CooperatorProductService.productList();
|
|
List<CooperatorProduct> list=CooperatorProductService.productList();
|
|
resJson.put("cooperator_Product_List",list);
|
|
resJson.put("cooperator_Product_List",list);
|
|
@@ -32,4 +36,37 @@ public class CooperatorProductController {
|
|
return Result.success("ok",resJson);
|
|
return Result.success("ok",resJson);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ // 获取合作产品字段
|
|
|
|
+ @GetMapping("findCooperatorProductFieldByNum")
|
|
|
|
+ public Result findCooperatorProductFieldByNum(String productNum) {
|
|
|
|
+
|
|
|
|
+ JSONObject result = new JSONObject();
|
|
|
|
+ List<CooperatorField> list = CooperatorProductService.findCooperatorProductFieldByNum();
|
|
|
|
+ result.put("cooperator_product_field",list);
|
|
|
|
+ System.out.println(list);
|
|
|
|
+
|
|
|
|
+ return Result.success("ok", result);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // 申请合作产品
|
|
|
|
+ @PostMapping("apply")
|
|
|
|
+ public Result cooperatorProductApply(@RequestBody String json)
|
|
|
|
+ {
|
|
|
|
+ JSONObject req = JSON.parseObject(json);
|
|
|
|
+ String cooperatorNo = req.getString("cooperator_no");
|
|
|
|
+ String cooperatorName = req.getString("cooperator_name");
|
|
|
|
+ String productNo = req.getString("product_num");
|
|
|
|
+ String productName = req.getString("product_name");
|
|
|
|
+ String modelId = req.getString("model_id");
|
|
|
|
+ Calendar calendar= Calendar.getInstance();
|
|
|
|
+ SimpleDateFormat dateFormat= new SimpleDateFormat("yyyy-MM-dd :hh:mm:ss");
|
|
|
|
+ String createTime = dateFormat.format(calendar.getTime());
|
|
|
|
+
|
|
|
|
+ CooperatorProductService.Apply(cooperatorNo, cooperatorName, productNo, productName, modelId, createTime);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ return Result.success();
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|