|
|
@@ -0,0 +1,38 @@
|
|
|
+package com.izouma.zhumj.web.sale;
|
|
|
+import java.util.HashMap;
|
|
|
+
|
|
|
+import com.izouma.zhumj.repo.sale.ContractRepo;
|
|
|
+import com.izouma.zhumj.repo.sale.CustomerRepo;
|
|
|
+import com.izouma.zhumj.utils.SecurityUtils;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.web.bind.annotation.GetMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 销售个人工作台总计
|
|
|
+ * @Author: Pine
|
|
|
+ * @Date: 2019/10/19
|
|
|
+ * @Email:771190883@qq.com
|
|
|
+ */
|
|
|
+@RestController
|
|
|
+@RequestMapping("/saleWork")
|
|
|
+public class SaleWorkController {
|
|
|
+ @Autowired
|
|
|
+ private ContractRepo contractRepo;
|
|
|
+ @Autowired
|
|
|
+ private CustomerRepo customerRepo;
|
|
|
+
|
|
|
+ @GetMapping("/getTotalInfo")
|
|
|
+ public Map<String,Object> getTotalInfo(){
|
|
|
+ Long saleId = SecurityUtils.getAuthenticatedUser().getId();
|
|
|
+ int contract = contractRepo.findAllBySaleId(saleId).size();
|
|
|
+ int customer = customerRepo.findAllBySaleId(saleId).size();
|
|
|
+ Map<String,Object> data = new HashMap<String, Object> ();;
|
|
|
+ data.putIfAbsent("contract",contract);
|
|
|
+ data.putIfAbsent("customer",customer);
|
|
|
+ return data;
|
|
|
+ }
|
|
|
+}
|