|
@@ -1,19 +1,25 @@
|
|
|
package com.pj.api.h5;
|
|
|
|
|
|
|
|
|
+import com.pj.api.bo.InOutRecordBO;
|
|
|
+import com.pj.api.service.ApiService;
|
|
|
+import com.pj.constants.UserTypeEnum;
|
|
|
+import com.pj.current.satoken.StpUserUtil;
|
|
|
+import com.pj.project.tb_business.TbBusinessService;
|
|
|
import com.pj.project.tb_costomer.TbCostomer;
|
|
|
import com.pj.project.tb_costomer.TbCostomerService;
|
|
|
import com.pj.project4sp.admin4login.SpAccAdminService;
|
|
|
import com.pj.utils.sg.AjaxJson;
|
|
|
import com.pj.utils.sg.NbUtil;
|
|
|
+import com.pj.utils.so.SoMap;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
-import org.aspectj.weaver.loadtime.Aj;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.List;
|
|
|
|
|
|
@RequestMapping(value = "/api")
|
|
|
@RestController
|
|
@@ -21,9 +27,14 @@ import javax.annotation.Resource;
|
|
|
public class ApiController {
|
|
|
|
|
|
@Resource
|
|
|
+ ApiService apiService;
|
|
|
+ @Resource
|
|
|
SpAccAdminService spAccAdminService;
|
|
|
@Resource
|
|
|
TbCostomerService tbCostomerService;
|
|
|
+ @Resource
|
|
|
+ TbBusinessService tbBusinessService;
|
|
|
+
|
|
|
/** 账号、密码登录 */
|
|
|
@RequestMapping("doLogin")
|
|
|
AjaxJson doLogin(String key, String password) {
|
|
@@ -39,4 +50,33 @@ public class ApiController {
|
|
|
tbCostomerService.register(costomer);
|
|
|
return AjaxJson.getSuccess();
|
|
|
}
|
|
|
+
|
|
|
+ @RequestMapping(value = "getInOutRecord")
|
|
|
+ public AjaxJson getInOutRecord(){
|
|
|
+ SoMap so = SoMap.getRequestSoMap();
|
|
|
+ String currentCustomerId = StpUserUtil.getCustomerId();
|
|
|
+ if (!currentCustomerId.equals(UserTypeEnum.PLATFORM_ADMIN.getCustomerId())) {
|
|
|
+ so.put("customerId",currentCustomerId);
|
|
|
+ }
|
|
|
+ List<InOutRecordBO> recordList = apiService.getInOutRecord(so);
|
|
|
+ return AjaxJson.getSuccessData(recordList);
|
|
|
+ }
|
|
|
+
|
|
|
+ @RequestMapping(value = "getCustomerList")
|
|
|
+ public AjaxJson getCustomerList(){
|
|
|
+ SoMap so = SoMap.getRequestSoMap();
|
|
|
+ String currentCustomerId = StpUserUtil.getCustomerId();
|
|
|
+ if (!currentCustomerId.equals(UserTypeEnum.PLATFORM_ADMIN.getCustomerId())) {
|
|
|
+ so.put("id",currentCustomerId);
|
|
|
+ }
|
|
|
+ List<TbCostomer> list = apiService.getCustomerList(so);
|
|
|
+ return AjaxJson.getSuccessData(list);
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping(value = "confirmCustomer")
|
|
|
+ public AjaxJson confirmCustomer(Long customerId){
|
|
|
+ apiService.confirmCustomer(customerId);
|
|
|
+ return AjaxJson.getSuccess();
|
|
|
+ }
|
|
|
+
|
|
|
}
|