Commit 777d4661 authored by 黎聪聪's avatar 黎聪聪

会员管理

parent 85cba2f2
...@@ -262,15 +262,23 @@ ...@@ -262,15 +262,23 @@
"aTargets": [1], "aTargets": [1],
"mData": "consultId", "mData": "consultId",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
if(a){
return a; return a;
}else{
return null;
}
} }
}, },
{ {
"aTargets": [2], "aTargets": [2],
"mData": "userName", "mData": "userName",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
if(a){
return a; return a;
}else{
return null;
}
} }
}, },
{ {
...@@ -289,7 +297,11 @@ ...@@ -289,7 +297,11 @@
"aTargets": [4], "aTargets": [4],
"mData": "iphone", "mData": "iphone",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
if(a){
return a; return a;
}else{
return null;
}
} }
}, },
...@@ -297,7 +309,11 @@ ...@@ -297,7 +309,11 @@
"aTargets": [5], "aTargets": [5],
"mData": "pastRecords", "mData": "pastRecords",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
if(a){
return a; return a;
}else{
return null;
}
} }
}, },
{ {
...@@ -313,28 +329,44 @@ ...@@ -313,28 +329,44 @@
"aTargets": [7], "aTargets": [7],
"mData": "illness", "mData": "illness",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
if(a){
return a; return a;
}else{
return null;
}
} }
}, },
{ {
"aTargets": [8], "aTargets": [8],
"mData": "allergy", "mData": "allergy",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
if(a){
return a; return a;
}else{
return null;
}
} }
}, },
{ {
"aTargets": [9], "aTargets": [9],
"mData": "doctorName", "mData": "doctorName",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
if(a){
return a; return a;
}else{
return null;
}
} }
}, },
{ {
"aTargets": [10], "aTargets": [10],
"mData": "customerName", "mData": "customerName",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
if(a){
return a; return a;
}else{
return null;
}
} }
}, },
{ {
...@@ -354,7 +386,11 @@ ...@@ -354,7 +386,11 @@
"aTargets": [12], "aTargets": [12],
"mData": "description", "mData": "description",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
if(a){
return a; return a;
}else{
return null;
}
} }
}, },
{ {
......
...@@ -12,16 +12,14 @@ import com.cftech.core.sql.Conds; ...@@ -12,16 +12,14 @@ import com.cftech.core.sql.Conds;
import com.cftech.core.sql.Sort; import com.cftech.core.sql.Sort;
import com.cftech.core.util.Constants; import com.cftech.core.util.Constants;
import com.cftech.sys.security.UserUtils; import com.cftech.sys.security.UserUtils;
import com.sun.deploy.util.StringUtils; import org.springframework.util.StringUtils;
import jdk.nashorn.internal.ir.ReturnNode;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.poi.util.SystemOutLogger;
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;
import org.springframework.ui.Model; import org.springframework.ui.Model;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
......
...@@ -97,26 +97,26 @@ ...@@ -97,26 +97,26 @@
<form id="seachTableForm" action="#springUrl('/a/member/exportExcel')" method="get" onkeydown="if(event.keyCode==13){return false;}"> <form id="seachTableForm" action="#springUrl('/a/member/exportExcel')" method="get" onkeydown="if(event.keyCode==13){return false;}">
<div class="col-xs-2"> <div class="col-xs-2">
<input type="text" class="form-control required" <input type="text" class="form-control required"
name="name" placeholder="名"> name="phone" placeholder="手机号">
</div> </div>
<div class="col-xs-2"> <div class="col-xs-2">
<input type="text" class="form-control required" <input type="text" class="form-control required"
name="compan" placeholder="公司名称"> name="name" placeholder="会员名称">
</div>
<div class="col-xs-2">
<select name="status" class="form-control">
<option value="0">请选择会员状态</option>
<option value="1">会员注册</option>
<option value="2">虚拟会员</option>
</select>
</div> </div>
<!-- <div class="col-xs-2">-->
<!-- <select name="status" class="form-control">-->
<!-- <option value="0">请选择会员状态</option>-->
<!-- <option value="1">会员注册</option>-->
<!-- <option value="2">虚拟会员</option>-->
<!-- </select>-->
<!-- </div>-->
<div class="col-xs-5"> <div class="col-xs-5">
<a href="javascript:void(0)" class="btn btn-primary search">搜索</a> <a href="javascript:void(0)" class="btn btn-primary search">搜索</a>
#if($shiro.hasPermission("qy:member:edit")) #if($shiro.hasPermission("qy:member:edit"))
<!-- <a href="#springUrl('/a/member/form')" class="btn btn-primary">新增</a>--> <!-- <a href="#springUrl('/a/member/form')" class="btn btn-primary">新增</a>-->
#end #end
<button class="btn btn-primary">导出</button> <button class="btn btn-primary">导出</button>
<a href="javascript:void(0)" onclick="addMemer()" class="btn btn-primary">添加虚拟会员</a> <!-- <a href="javascript:void(0)" onclick="addMemer()" class="btn btn-primary">添加虚拟会员</a>-->
</div> </div>
</form> </form>
</div><!-- /.box-header --> </div><!-- /.box-header -->
...@@ -127,15 +127,16 @@ ...@@ -127,15 +127,16 @@
<td hidden="true">Id</td> <td hidden="true">Id</td>
<th>头像</th> <th>头像</th>
<th>性别</th> <th>性别</th>
<th></th> <!-- <th>姓</th>-->
<th></th> <!-- <th>名</th>-->
<th>微信OPENID</th> <th>微信OPENID</th>
<th>手机号码</th> <th>联系方式</th>
<th>公司名称</th> <th>会员名称</th>
<th>邀请码</th> <th>来源</th>
<th>客户分类</th> <!-- <th>邀请码</th>-->
<th>名片</th> <!-- <th>客户分类</th>-->
<th>状态</th> <!-- <th>名片</th>-->
<th>创建日期</th>
</tr> </tr>
</thead> </thead>
<tbody id="tablebody"> <tbody id="tablebody">
...@@ -228,26 +229,23 @@ ...@@ -228,26 +229,23 @@
}, },
{ {
"mData": "sex" "mData": "sex"
},{ },
"mData":"surname" {
},{
"mData":"name"
},{
"mData": "open_id" "mData": "open_id"
},{ },
{
"mData":"phone" "mData":"phone"
},{
"mData": "compan"
}, },
{ {
"mData": "invitcode" "mData":"name"
},{ },
"mData":"peopletype" {
},{ "mData":"source"
"mData":"storeid" },
},{ {
"mData":"status" "mData":"createTime"
}], }
],
"aoColumnDefs": [ "aoColumnDefs": [
{ // set default column settings { // set default column settings
'visible': false, 'visible': false,
...@@ -282,34 +280,52 @@ ...@@ -282,34 +280,52 @@
return formatDates(a, "yyyy-MM-dd HH:mm:ss"); return formatDates(a, "yyyy-MM-dd HH:mm:ss");
} }
},*/ },*/
// {
// "aTargets": [3],
// "mData": "surname",
// "mRender": function (a, b, c, d) {
// return a;
// }
// },
{ {
"aTargets": [3], "aTargets": [3],
"mData": "surname", "mData": "open_id",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
return a; return a;
} }
}, },{
{ "aTargets":[4],
"aTargets": [4], "mData":"phone",
"mData": "surname", "mRender":function(a,b,c,d){
"mRender": function (a, b, c, d) {
return a; return a;
} }
},{ },{
"aTargets":[10], "aTargets":[5],
"mData":"storeid", "mData":"name",
"mRender":function(a,b,c,d){ "mRender":function(a,b,c,d){
return '<img src="'+a+'" style="width:80px;height:80px;">'; return a;
} }
},{ },{
"aTargets":[11], "aTargets":[6],
"mData":"status", "mData":"source",
"mRender":function(a,b,c,d){ "mRender":function(a,b,c,d){
if(a==1){ if (a==1){
return "虚拟会员"; return "普通关注";
}else if (a==2){
return "医师二维码";
}else if (a==3){
return "客服二维码";
}else{ }else{
return "会员注册"; return "";
}
}
} }
,{
"aTargets":[7],
"mData":"createTime",
"mRender":function(a,b,c,d){
return formatDates(a, "yyyy-MM-dd HH:mm:ss");
} }
} }
......
...@@ -45,6 +45,8 @@ ...@@ -45,6 +45,8 @@
<result column="open_id" property="open_id"/> <result column="open_id" property="open_id"/>
<result column="storeid" property="storeid"/> <result column="storeid" property="storeid"/>
<result column="status" property="status"/> <result column="status" property="status"/>
<result column="create_time" property="createTime"/>
<result column="source" property="source"/>
</resultMap> </resultMap>
<sql id="sqlWhere"> <sql id="sqlWhere">
...@@ -327,20 +329,16 @@ ...@@ -327,20 +329,16 @@
<select id="selectmemberDto" parameterType="java.util.Map" resultMap="resultMapDto"> <select id="selectmemberDto" parameterType="java.util.Map" resultMap="resultMapDto">
SELECT SELECT
m.id,
m.imageurl, m.imageurl,
m.sex, m.sex,
m.surname, m.name,
m.`name`,
m.phone, m.phone,
m.compan,
m.invitcode,
m.open_id, m.open_id,
w.peopletype, m.create_time,
m.storeid, m.source
m.status
FROM FROM
wx_mp_member m wx_mp_member m
LEFT JOIN wx_mp_workshop w ON w.invitcode = m.invitcode
<include refid="sqlWhere"/> <include refid="sqlWhere"/>
<if test="sort!=null">ORDER BY ${sort.param} ${sort.type}</if> <if test="sort!=null">ORDER BY ${sort.param} ${sort.type}</if>
<if test="limit>0">limit #{offset},#{limit}</if> <if test="limit>0">limit #{offset},#{limit}</if>
...@@ -350,7 +348,6 @@ ...@@ -350,7 +348,6 @@
COUNT(1) COUNT(1)
FROM FROM
wx_mp_member m wx_mp_member m
LEFT JOIN wx_mp_workshop w ON w.invitcode = m.invitcode
<include refid="sqlWhere"/> <include refid="sqlWhere"/>
</select> </select>
</mapper> </mapper>
\ No newline at end of file
package com.cftech.member.model; package com.cftech.member.model;
import com.alibaba.fastjson.annotation.JSONField;
import com.cftech.core.poi.ExportConfig; import com.cftech.core.poi.ExportConfig;
import lombok.Data; import lombok.Data;
import java.util.Date;
/** /**
* Created by Ago on 2018/8/7. * Created by Ago on 2018/8/7.
*/ */
...@@ -13,22 +16,19 @@ public class MemberDto { ...@@ -13,22 +16,19 @@ public class MemberDto {
private String imageurl; private String imageurl;
@ExportConfig(value = "会员性别",width = 100) @ExportConfig(value = "会员性别",width = 100)
private String sex; private String sex;
@ExportConfig(value = "会员姓",width = 100) @ExportConfig(value = "微信OPENID",width = 100)
private String surname; private String open_id;
@ExportConfig(value = "会员名",width = 100) @ExportConfig(value = "会员名",width = 100)
private String name; private String name;
@ExportConfig(value = "会员手机",width = 100) @ExportConfig(value = "会员手机",width = 100)
private String phone; private String phone;
@ExportConfig(value = "会员公司",width = 100) /* 来源 */
private String compan; @ExportConfig(value = "会员手机",width = 100)
@ExportConfig(value = "邀请码",width = 100) private String source;
private String invitcode;
@ExportConfig(value = "微信OPENID",width = 100) /*创建时间*/
private String open_id;
@ExportConfig(value = "客户分类",width = 100) @ExportConfig(value = "创建时间",width = 100)
private String peopletype; private String createTime;
@ExportConfig(value = "名片",width = 100)
private String storeid;
@ExportConfig(value = "状态",width = 100)
private String status;
} }
package com.cftech.member.web; package com.cftech.member.web;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.cftech.base.codingrule.utils.CodingruleUtils; import com.cftech.base.codingrule.utils.CodingruleUtils;
import com.cftech.core.annotation.CSRFTokenRef; import com.cftech.core.annotation.CSRFTokenRef;
...@@ -35,6 +36,9 @@ import org.springframework.web.bind.annotation.ResponseBody; ...@@ -35,6 +36,9 @@ import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.UUID; import java.util.UUID;
...@@ -161,17 +165,21 @@ public class MemberController { ...@@ -161,17 +165,21 @@ public class MemberController {
Conds conds = new Conds(); Conds conds = new Conds();
conds.equal("m.del_flag", Constants.DEL_FLAG_0); conds.equal("m.del_flag", Constants.DEL_FLAG_0);
conds.equal("m.accounts_id", accountsId); conds.equal("m.accounts_id", accountsId);
if(member.getStatus().equals("1")){ //注册会员 // if(member.getStatus().equals("1")){ //注册会员
conds.isNull("m.status"); // conds.isNull("m.status");
}else if(member.getStatus().equals("2")){ //虚拟会员 // }else if(member.getStatus().equals("2")){ //虚拟会员
conds.equal("m.status",1); // conds.equal("m.status",1);
} // }
if (!StringUtils.isEmpty(member.getCompan())) { // if (!StringUtils.isEmpty(member.getCompan())) {
conds.like("m.compan", member.getCompan()); // conds.like("m.compan", member.getCompan());
} // }
if (!StringUtils.isEmpty(member.getName())) { if (!StringUtils.isEmpty(member.getName())) {
conds.like("m.name", member.getName()); conds.like("m.name", member.getName());
} }
if (!StringUtils.isEmpty(member.getPhone())){
conds.like("m.phone",member.getPhone());
}
Sort sort = new Sort("m.create_time", OrderType.DESC); Sort sort = new Sort("m.create_time", OrderType.DESC);
...@@ -248,45 +256,58 @@ public class MemberController { ...@@ -248,45 +256,58 @@ public class MemberController {
@RequestMapping("/exportExcel") @RequestMapping("/exportExcel")
@RequiresPermissions(value = MEMBER_VIEW) @RequiresPermissions(value = MEMBER_VIEW)
public void exportExcel(HttpServletRequest request, HttpServletResponse response,Member member) { public void exportExcel(HttpServletRequest request, HttpServletResponse response,Member member) throws ParseException {
Long accountsId = UserUtils.getmpaccounts(request); Long accountsId = UserUtils.getmpaccounts(request);
Conds conds = new Conds(); Conds conds = new Conds();
conds.equal("m.del_flag", Constants.DEL_FLAG_0); conds.equal("m.del_flag", Constants.DEL_FLAG_0);
conds.equal("m.accounts_id", accountsId); conds.equal("m.accounts_id", accountsId);
if(member.getStatus().equals("1")){ //注册会员 // if(member.getStatus().equals("1")){ //注册会员
conds.isNull("m.status"); // conds.isNull("m.status");
}else if(member.getStatus().equals("2")){ //虚拟会员 // }else if(member.getStatus().equals("2")){ //虚拟会员
conds.equal("m.status",1); // conds.equal("m.status",1);
} // }
if (!StringUtils.isEmpty(member.getCompan())) { // if (!StringUtils.isEmpty(member.getCompan())) {
conds.like("m.compan", member.getCompan()); // conds.like("m.compan", member.getCompan());
} // }
if (!StringUtils.isEmpty(member.getName())) { // if (!StringUtils.isEmpty(member.getName())) {
conds.like("m.name", member.getName()); // conds.like("m.name", member.getName());
} // }
Sort sort = new Sort("m.create_time", OrderType.DESC); Sort sort = new Sort("m.create_time", OrderType.DESC);
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
List<MemberDto> list = memberService.selectmemberDto(conds, sort, 0, 0); List<MemberDto> list = memberService.selectmemberDto(conds, sort, 0, 0);
if(list.size()>0){ if (list.size() > 0) {
for(MemberDto memberDto:list){ for (MemberDto memberDto : list) {
if(memberDto.getStatus()==null){ // if(memberDto.get==null){
memberDto.setStatus("注册会员"); // memberDto.setStatus("注册会员");
if(memberDto.getSex().equals("1")){ // if(memberDto.getSex().equals("1")){
// memberDto.setSex("男");
// }else if(memberDto.getSex().equals("0")){
// memberDto.setSex("女");
// }
// }else{
// memberDto.setStatus("虚拟会员");
// }
if ("1".equals(memberDto.getSex())) {
memberDto.setSex("男"); memberDto.setSex("男");
}else if(memberDto.getSex().equals("0")){ } else if ("0".equals(memberDto.getSex())) {
memberDto.setSex("女"); memberDto.setSex("女");
} }
}else{ if ("1".equals(memberDto.getSource())) {
memberDto.setStatus("虚拟会员"); memberDto.setSource("普通关注");
} else if ("2".equals(memberDto.getSource())) {
memberDto.setSource("药师二维码");
} else if ("3".equals(memberDto.getSource())) {
memberDto.setSource("客服二维码");
} }
Date parse = simpleDateFormat.parse(memberDto.getCreateTime());
memberDto.setCreateTime(simpleDateFormat.format(parse));
} }
}
// 生成Excel并使用浏览器下载 // 生成Excel并使用浏览器下载
ExcelKit.$Export(MemberDto.class, response).toExcel(list, "会员信息"); ExcelKit.$Export(MemberDto.class, response).toExcel(list, "会员信息");
} }
}
} }
package com.cftech.mp.fans.model;
import com.alibaba.fastjson.annotation.JSONField;
import com.cftech.core.poi.ExportConfig;
import lombok.Data;
import java.util.Date;
/**
* @author :licc
* @date :Created in 2020/9/25 17:07
* @description:
*/
@Data
public class MpFanssVO {
/* 粉丝头像 */
@ExportConfig(value = "粉丝头像", width = 100, showLevel = 1)
private String headimgurl;
/* 性别 */
@ExportConfig(value = "性别", width = 100, showLevel = 1)
private String sex;
/* openid */
@ExportConfig(value = "openid", width = 100, showLevel = 1)
private String openid;
/* 省份 */
@ExportConfig(value = "省份", width = 100, showLevel = 1)
private String province;
/* 城市 */
@ExportConfig(value="城市",width = 100, showLevel = 1)
private String city;
/* 昵称 */
@ExportConfig(value="昵称",width = 100, showLevel = 1)
private String nickname;
/* 粉丝来源 */
@ExportConfig(value="粉丝来源",width = 100, showLevel = 1)
private String source;
/* 关注日期 */
@ExportConfig(value="关注日期",width = 100, showLevel = 1)
private String subscribetime;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment