Helius
2021-04-06 997831bb8c314d781e6cc5533898ffbe077dd3b6
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
package com.matrix.system.hive.action;
 
import com.matrix.core.pojo.AjaxResult;
import com.matrix.core.pojo.PaginationVO;
import com.matrix.core.tools.WebUtil;
import com.matrix.system.constance.Dictionary;
import com.matrix.system.hive.bean.ServiceRecord;
import com.matrix.system.hive.bean.SysVipInfo;
import com.matrix.system.hive.service.ServiceRecordService;
import com.matrix.system.hive.service.SysVipInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
 
import javax.annotation.Resource;
import java.util.Date;
 
/**
 * 服务记录
 *
 * @author 姜友瑶
 * @date 2016-08-06 16:15
 */
@Controller
@RequestMapping(value = "admin/serviceRecord")
public class ServiceRecordController extends BaseController {
 
    @Resource
    private ServiceRecordService currentService;
 
 
    @RequestMapping(value = "/showAllList")
    public @ResponseBody
    AjaxResult showAllList(ServiceRecord serviceRecord, PaginationVO pageVo) {
 
        if (!getMe().getShopRole().equals(Dictionary.FLAG_YES_Y)) {
            serviceRecord.setShopId(getMe().getShopId());
        }
        pageVo.setSort("createTime");
        pageVo.setOrder("desc");
        return showList(currentService, serviceRecord, pageVo);
    }
 
 
    /**
     * 列表显示
     */
    @RequestMapping(value = "/showList")
    public @ResponseBody
    AjaxResult showList(ServiceRecord serviceRecord, PaginationVO pageVo) {
 
        serviceRecord.setVipId(getLookViP().getId());
        pageVo.setSort("createTime");
        pageVo.setOrder("desc");
        return showList(currentService, serviceRecord, pageVo);
    }
 
    /**
     * 新增或者修改页面
     */
    @RequestMapping(value = "/addOrModify")
    public @ResponseBody
    AjaxResult addOrModify(ServiceRecord serviceRecord) {
        if (serviceRecord.getId() != null) {
            return modify(currentService, serviceRecord, "跟进记录");
        } else {
            serviceRecord.setStaffId(getMe().getSuId());
            serviceRecord.setVipId(getLookViP().getId());
            serviceRecord.setCreateTime(new Date());
            serviceRecord.setShopId(getMe().getShopId());
            return add(currentService, serviceRecord, "跟进记录");
        }
    }
 
    /**
     * 进入修改界面
     */
    @RequestMapping(value = "/editForm")
    public String editForm(Long id) {
        ServiceRecord serviceRecord;
        if (id != null) {
            serviceRecord = currentService.findById(id);
            WebUtil.getRequest().setAttribute("obj", serviceRecord);
        }
        return "admin/hive/mobile/CRM-account-follow-add";
    }
 
    @RequestMapping(value = "/editFormPC")
    public String editFormPC(Long id) {
        ServiceRecord serviceRecord;
        if (id != null) {
            serviceRecord = currentService.findById(id);
            WebUtil.getRequest().setAttribute("obj", serviceRecord);
        }
        return "admin/hive/vip/servicefollow-form";
    }
 
    /**
     * 删除
     */
    @RequestMapping(value = "/del")
    public @ResponseBody
    AjaxResult del(String keys) {
        return remove(currentService, keys);
    }
 
    @Autowired
    SysVipInfoService vipInfoService;
 
 
    @RequestMapping(value = "/toServicefollowList")
    public String toServicefollowList(Long id) {
        SysVipInfo info = vipInfoService.findById(id);
        WebUtil.getSession().setAttribute("lookVipInfo", info);
        return "admin/hive/vip/servicefollow-list";
    }
 
    @RequestMapping(value = "/toServicefollowListForZd")
    public String toServicefollowListForZd(Long id) {
        SysVipInfo info = vipInfoService.findById(id);
        WebUtil.getSession().setAttribute("lookVipInfo", info);
        return "admin/hive-erp/vip/servicefollow-list";
    }
 
 
    /**
     * 获取当前查询的会员信息
     *
     * @return
     * @author 姜友瑶
     * @time 2016年8月6日
     */
    private SysVipInfo getLookViP() {
        return (SysVipInfo) (WebUtil.getSession().getAttribute("lookVipInfo"));
    }
}