jyy
2021-03-10 7b15b7791474b8b05b7cd31c691efe714da97376
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
package com.matrix.system.shopXcx.api.action;
 
import com.matrix.biz.bean.BizUser;
import com.matrix.component.redis.RedisUserLoginUtils;
import com.matrix.core.pojo.AjaxResult;
import com.matrix.core.tools.StringUtils;
import com.matrix.system.common.bean.BusParameterSettings;
import com.matrix.system.common.dao.BusParameterSettingsDao;
import com.matrix.system.common.interceptor.HostInterceptor;
import com.matrix.system.fenxiao.constant.FenxiaoSettingConstant;
import com.matrix.system.fenxiao.dao.ShopSalesmanApplyDao;
import com.matrix.system.fenxiao.entity.ShopSalesmanApply;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
import java.util.Date;
import java.util.Map;
 
/**
 * @author wzy
 * @date 2021-03-10
 **/
@Api(tags = "推广员接口类")
@RestController
@RequestMapping(value = "/wxapi/salesman")
public class WxSalesmanAction {
 
    @Autowired
    BusParameterSettingsDao busParameterSettingsDao;
 
    @Autowired
    ShopSalesmanApplyDao salesmanApplyDao;
 
    @Autowired
    private RedisUserLoginUtils redisUserLoginUtils;
 
    @ApiOperation(value = "查询推广计划", notes = "")
    @GetMapping(value = "/getTgPlan")
    public AjaxResult getTgPlan() {
        BusParameterSettings busParameterSettings = busParameterSettingsDao.selectCompanyParamByCode(FenxiaoSettingConstant.FX_TG_PLAN, HostInterceptor.getCompanyId());
        AjaxResult ajaxResult = AjaxResult.buildSuccessInstance("");
        ajaxResult.putInMap("tgjh",busParameterSettings.getParamValue3());
        return ajaxResult;
    }
 
 
    @ApiOperation(value = "申请成为推广员", notes = "传入参数invitationId 邀请人openId 如: {invitationId:openId}")
    @ApiResponses({
            @ApiResponse(code = 200, message = "ok", response = Map.class)
    })
    @PostMapping(value = "/applyToBeAnSalesman")
    public AjaxResult applyToBeAnSalesman(@RequestBody Map<String,String> param) {
        BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class);
        ShopSalesmanApply shopSalesmanApply=new ShopSalesmanApply();
        shopSalesmanApply.setUserId(loginUser.getUserId());
        shopSalesmanApply.setCreateBy(loginUser.getNickName());
        shopSalesmanApply.setApplyWay(ShopSalesmanApply.APPLY_WAY_SELF);
        shopSalesmanApply.setApplyStatus(ShopSalesmanApply.APPLY_STATUS_DSH);
        shopSalesmanApply.setCompanyId(loginUser.getCompanyId());
        shopSalesmanApply.setUpdateBy(loginUser.getNickName());
        Date date = new Date();
        shopSalesmanApply.setCreateTime(date);
        shopSalesmanApply.setUpdateTime(date);
        String invitationId = param.get("invitationId");
        if(StringUtils.isNotBlank(invitationId)){
            shopSalesmanApply.setParentUserId(invitationId);
        }
        salesmanApplyDao.insert(shopSalesmanApply);
        return AjaxResult.buildSuccessInstance("申请成功");
    }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
}