分销申请新增问题修复及分销团队查询接口部分开发

This commit is contained in:
donqi 2022-08-12 22:24:19 +08:00
parent ec3bccd734
commit 5c2c31fb7b
4 changed files with 52 additions and 1 deletions

View File

@ -44,6 +44,15 @@ public class CustomerController extends BaseController {
return getDataTable(list); return getDataTable(list);
} }
@PostMapping("/app/list")
@ResponseBody
public TableDataInfo appList(@RequestBody Customer customer)
{
startPage();
List<Customer> list = customerService.getCustomerList(customer);
return getDataTable(list);
}
@RequiresPermissions("customer:customer:resetPwd") @RequiresPermissions("customer:customer:resetPwd")
@GetMapping("/resetPwd/{customerId}") @GetMapping("/resetPwd/{customerId}")
public String resetPwd(@PathVariable("customerId") Long customerId, ModelMap mmap) public String resetPwd(@PathVariable("customerId") Long customerId, ModelMap mmap)

View File

@ -2,7 +2,10 @@ package com.ghy.web.controller.customer;
import java.util.List; import java.util.List;
import com.ghy.common.enums.PlaceStatus;
import com.ghy.common.utils.CacheUtils; 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.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
@ -32,6 +35,9 @@ public class CustomerPlaceController extends BaseController
@Autowired @Autowired
private ICustomerPlaceService customerPlaceService; private ICustomerPlaceService customerPlaceService;
@Autowired
private CustomerService customerService;
@RequiresPermissions("customer:place:view") @RequiresPermissions("customer:place:view")
@GetMapping() @GetMapping()
public String place() public String place()
@ -114,7 +120,11 @@ public class CustomerPlaceController extends BaseController
// 验证码校验正确 // 验证码校验正确
if(CacheUtils.get(customerPlace.getPhone()).toString().equals(customerPlace.getCode())){ if(CacheUtils.get(customerPlace.getPhone()).toString().equals(customerPlace.getCode())){
int result = customerPlaceService.insertCustomerPlace(customerPlace); 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()); CacheUtils.remove(customerPlace.getPhone());
return AjaxResult.success("分销申请成功!"); return AjaxResult.success("分销申请成功!");
}else { }else {

View File

@ -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;
}
}

View File

@ -33,6 +33,9 @@
<if test="openId != null and openId != ''"> <if test="openId != null and openId != ''">
AND open_id = #{openId} AND open_id = #{openId}
</if> </if>
<if test="customerPlace != null and customerPlace != ''">
AND customer_place = #{customerPlace}
</if>
</where> </where>
</select> </select>