diff --git a/ghy-admin/src/main/java/com/ghy/web/controller/customer/CustomerController.java b/ghy-admin/src/main/java/com/ghy/web/controller/customer/CustomerController.java index b5040b27..4a8c1534 100644 --- a/ghy-admin/src/main/java/com/ghy/web/controller/customer/CustomerController.java +++ b/ghy-admin/src/main/java/com/ghy/web/controller/customer/CustomerController.java @@ -44,6 +44,15 @@ public class CustomerController extends BaseController { return getDataTable(list); } + @PostMapping("/app/list") + @ResponseBody + public TableDataInfo appList(@RequestBody Customer customer) + { + startPage(); + List list = customerService.getCustomerList(customer); + return getDataTable(list); + } + @RequiresPermissions("customer:customer:resetPwd") @GetMapping("/resetPwd/{customerId}") public String resetPwd(@PathVariable("customerId") Long customerId, ModelMap mmap) diff --git a/ghy-admin/src/main/java/com/ghy/web/controller/customer/CustomerPlaceController.java b/ghy-admin/src/main/java/com/ghy/web/controller/customer/CustomerPlaceController.java index 904b410b..17a95d46 100644 --- a/ghy-admin/src/main/java/com/ghy/web/controller/customer/CustomerPlaceController.java +++ b/ghy-admin/src/main/java/com/ghy/web/controller/customer/CustomerPlaceController.java @@ -2,7 +2,10 @@ package com.ghy.web.controller.customer; import java.util.List; +import com.ghy.common.enums.PlaceStatus; import com.ghy.common.utils.CacheUtils; +import com.ghy.customer.domain.Customer; +import com.ghy.customer.service.CustomerService; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; @@ -32,6 +35,9 @@ public class CustomerPlaceController extends BaseController @Autowired private ICustomerPlaceService customerPlaceService; + @Autowired + private CustomerService customerService; + @RequiresPermissions("customer:place:view") @GetMapping() public String place() @@ -114,7 +120,11 @@ public class CustomerPlaceController extends BaseController // 验证码校验正确 if(CacheUtils.get(customerPlace.getPhone()).toString().equals(customerPlace.getCode())){ int result = customerPlaceService.insertCustomerPlace(customerPlace); - if(result > 0){ + Customer params = new Customer(); + params.setCustomerId(customerPlace.getCustomerId()); + params.setPlaceStatus(PlaceStatus.PLACE_APPLYING.getCode()); + int updateStatusResult = customerService.updateCustomer(params); + if(result > 0 && updateStatusResult > 0){ CacheUtils.remove(customerPlace.getPhone()); return AjaxResult.success("分销申请成功!"); }else { diff --git a/ghy-common/src/main/java/com/ghy/common/enums/PlaceStatus.java b/ghy-common/src/main/java/com/ghy/common/enums/PlaceStatus.java new file mode 100644 index 00000000..8880387b --- /dev/null +++ b/ghy-common/src/main/java/com/ghy/common/enums/PlaceStatus.java @@ -0,0 +1,29 @@ +package com.ghy.common.enums; + +/** + * 分销审核状态 + * + * @author ydq + * @date : 2022-08-12 21:40 + */ +public enum PlaceStatus { + NO_PLACE(0, "未提交分销资格审核"), + PLACE_APPLYING(1, "分销资格审核中"), + CAN_PLACE(2, "分销资格审核通过"); + + private Integer code; + private String desc; + + PlaceStatus(Integer code, String desc) { + this.code = code; + this.desc = desc; + } + + public Integer getCode() { + return code; + } + + public String getDesc() { + return desc; + } +} diff --git a/ghy-custom/src/main/resources/mapper/customer/CustomerMapper.xml b/ghy-custom/src/main/resources/mapper/customer/CustomerMapper.xml index 71671333..be793c63 100644 --- a/ghy-custom/src/main/resources/mapper/customer/CustomerMapper.xml +++ b/ghy-custom/src/main/resources/mapper/customer/CustomerMapper.xml @@ -33,6 +33,9 @@ AND open_id = #{openId} + + AND customer_place = #{customerPlace} +