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

会员管理

parent 85cba2f2
......@@ -262,15 +262,23 @@
"aTargets": [1],
"mData": "consultId",
"mRender": function (a, b, c, d) {
if(a){
return a;
}else{
return null;
}
}
},
{
"aTargets": [2],
"mData": "userName",
"mRender": function (a, b, c, d) {
if(a){
return a;
}else{
return null;
}
}
},
{
......@@ -289,7 +297,11 @@
"aTargets": [4],
"mData": "iphone",
"mRender": function (a, b, c, d) {
if(a){
return a;
}else{
return null;
}
}
},
......@@ -297,7 +309,11 @@
"aTargets": [5],
"mData": "pastRecords",
"mRender": function (a, b, c, d) {
if(a){
return a;
}else{
return null;
}
}
},
{
......@@ -313,28 +329,44 @@
"aTargets": [7],
"mData": "illness",
"mRender": function (a, b, c, d) {
if(a){
return a;
}else{
return null;
}
}
},
{
"aTargets": [8],
"mData": "allergy",
"mRender": function (a, b, c, d) {
if(a){
return a;
}else{
return null;
}
}
},
{
"aTargets": [9],
"mData": "doctorName",
"mRender": function (a, b, c, d) {
if(a){
return a;
}else{
return null;
}
}
},
{
"aTargets": [10],
"mData": "customerName",
"mRender": function (a, b, c, d) {
if(a){
return a;
}else{
return null;
}
}
},
{
......@@ -354,7 +386,11 @@
"aTargets": [12],
"mData": "description",
"mRender": function (a, b, c, d) {
if(a){
return a;
}else{
return null;
}
}
},
{
......
......@@ -12,16 +12,14 @@ import com.cftech.core.sql.Conds;
import com.cftech.core.sql.Sort;
import com.cftech.core.util.Constants;
import com.cftech.sys.security.UserUtils;
import com.sun.deploy.util.StringUtils;
import jdk.nashorn.internal.ir.ReturnNode;
import org.springframework.util.StringUtils;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.util.SystemOutLogger;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
......
......@@ -97,26 +97,26 @@
<form id="seachTableForm" action="#springUrl('/a/member/exportExcel')" method="get" onkeydown="if(event.keyCode==13){return false;}">
<div class="col-xs-2">
<input type="text" class="form-control required"
name="name" placeholder="名">
name="phone" placeholder="手机号">
</div>
<div class="col-xs-2">
<input type="text" class="form-control required"
name="compan" 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>
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 class="col-xs-5">
<a href="javascript:void(0)" class="btn btn-primary search">搜索</a>
#if($shiro.hasPermission("qy:member:edit"))
<!-- <a href="#springUrl('/a/member/form')" class="btn btn-primary">新增</a>-->
#end
<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>
</form>
</div><!-- /.box-header -->
......@@ -127,15 +127,16 @@
<td hidden="true">Id</td>
<th>头像</th>
<th>性别</th>
<th></th>
<th></th>
<!-- <th>姓</th>-->
<!-- <th>名</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>
</thead>
<tbody id="tablebody">
......@@ -228,26 +229,23 @@
},
{
"mData": "sex"
},{
"mData":"surname"
},{
"mData":"name"
},{
},
{
"mData": "open_id"
},{
},
{
"mData":"phone"
},{
"mData": "compan"
},
{
"mData": "invitcode"
},{
"mData":"peopletype"
},{
"mData":"storeid"
},{
"mData":"status"
}],
"mData":"name"
},
{
"mData":"source"
},
{
"mData":"createTime"
}
],
"aoColumnDefs": [
{ // set default column settings
'visible': false,
......@@ -282,34 +280,52 @@
return formatDates(a, "yyyy-MM-dd HH:mm:ss");
}
},*/
// {
// "aTargets": [3],
// "mData": "surname",
// "mRender": function (a, b, c, d) {
// return a;
// }
// },
{
"aTargets": [3],
"mData": "surname",
"mData": "open_id",
"mRender": function (a, b, c, d) {
return a;
}
},
{
"aTargets": [4],
"mData": "surname",
"mRender": function (a, b, c, d) {
},{
"aTargets":[4],
"mData":"phone",
"mRender":function(a,b,c,d){
return a;
}
},{
"aTargets":[10],
"mData":"storeid",
"aTargets":[5],
"mData":"name",
"mRender":function(a,b,c,d){
return '<img src="'+a+'" style="width:80px;height:80px;">';
return a;
}
},{
"aTargets":[11],
"mData":"status",
"aTargets":[6],
"mData":"source",
"mRender":function(a,b,c,d){
if(a==1){
return "虚拟会员";
if (a==1){
return "普通关注";
}else if (a==2){
return "医师二维码";
}else if (a==3){
return "客服二维码";
}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 @@
<result column="open_id" property="open_id"/>
<result column="storeid" property="storeid"/>
<result column="status" property="status"/>
<result column="create_time" property="createTime"/>
<result column="source" property="source"/>
</resultMap>
<sql id="sqlWhere">
......@@ -327,20 +329,16 @@
<select id="selectmemberDto" parameterType="java.util.Map" resultMap="resultMapDto">
SELECT
m.id,
m.imageurl,
m.sex,
m.surname,
m.`name`,
m.name,
m.phone,
m.compan,
m.invitcode,
m.open_id,
w.peopletype,
m.storeid,
m.status
m.create_time,
m.source
FROM
wx_mp_member m
LEFT JOIN wx_mp_workshop w ON w.invitcode = m.invitcode
<include refid="sqlWhere"/>
<if test="sort!=null">ORDER BY ${sort.param} ${sort.type}</if>
<if test="limit>0">limit #{offset},#{limit}</if>
......@@ -350,7 +348,6 @@
COUNT(1)
FROM
wx_mp_member m
LEFT JOIN wx_mp_workshop w ON w.invitcode = m.invitcode
<include refid="sqlWhere"/>
</select>
</mapper>
\ No newline at end of file
package com.cftech.member.model;
import com.alibaba.fastjson.annotation.JSONField;
import com.cftech.core.poi.ExportConfig;
import lombok.Data;
import java.util.Date;
/**
* Created by Ago on 2018/8/7.
*/
......@@ -13,22 +16,19 @@ public class MemberDto {
private String imageurl;
@ExportConfig(value = "会员性别",width = 100)
private String sex;
@ExportConfig(value = "会员姓",width = 100)
private String surname;
@ExportConfig(value = "微信OPENID",width = 100)
private String open_id;
@ExportConfig(value = "会员名",width = 100)
private String name;
@ExportConfig(value = "会员手机",width = 100)
private String phone;
@ExportConfig(value = "会员公司",width = 100)
private String compan;
@ExportConfig(value = "邀请码",width = 100)
private String invitcode;
@ExportConfig(value = "微信OPENID",width = 100)
private String open_id;
@ExportConfig(value = "客户分类",width = 100)
private String peopletype;
@ExportConfig(value = "名片",width = 100)
private String storeid;
@ExportConfig(value = "状态",width = 100)
private String status;
/* 来源 */
@ExportConfig(value = "会员手机",width = 100)
private String source;
/*创建时间*/
@ExportConfig(value = "创建时间",width = 100)
private String createTime;
}
package com.cftech.member.web;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.cftech.base.codingrule.utils.CodingruleUtils;
import com.cftech.core.annotation.CSRFTokenRef;
......@@ -35,6 +36,9 @@ import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.UUID;
......@@ -161,17 +165,21 @@ public class MemberController {
Conds conds = new Conds();
conds.equal("m.del_flag", Constants.DEL_FLAG_0);
conds.equal("m.accounts_id", accountsId);
if(member.getStatus().equals("1")){ //注册会员
conds.isNull("m.status");
}else if(member.getStatus().equals("2")){ //虚拟会员
conds.equal("m.status",1);
}
if (!StringUtils.isEmpty(member.getCompan())) {
conds.like("m.compan", member.getCompan());
}
// if(member.getStatus().equals("1")){ //注册会员
// conds.isNull("m.status");
// }else if(member.getStatus().equals("2")){ //虚拟会员
// conds.equal("m.status",1);
// }
// if (!StringUtils.isEmpty(member.getCompan())) {
// conds.like("m.compan", member.getCompan());
// }
if (!StringUtils.isEmpty(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);
......@@ -248,45 +256,58 @@ public class MemberController {
@RequestMapping("/exportExcel")
@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);
Conds conds = new Conds();
conds.equal("m.del_flag", Constants.DEL_FLAG_0);
conds.equal("m.accounts_id", accountsId);
if(member.getStatus().equals("1")){ //注册会员
conds.isNull("m.status");
}else if(member.getStatus().equals("2")){ //虚拟会员
conds.equal("m.status",1);
}
if (!StringUtils.isEmpty(member.getCompan())) {
conds.like("m.compan", member.getCompan());
}
if (!StringUtils.isEmpty(member.getName())) {
conds.like("m.name", member.getName());
}
// if(member.getStatus().equals("1")){ //注册会员
// conds.isNull("m.status");
// }else if(member.getStatus().equals("2")){ //虚拟会员
// conds.equal("m.status",1);
// }
// if (!StringUtils.isEmpty(member.getCompan())) {
// conds.like("m.compan", member.getCompan());
// }
// if (!StringUtils.isEmpty(member.getName())) {
// conds.like("m.name", member.getName());
// }
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);
if(list.size()>0){
for(MemberDto memberDto:list){
if(memberDto.getStatus()==null){
memberDto.setStatus("注册会员");
if(memberDto.getSex().equals("1")){
if (list.size() > 0) {
for (MemberDto memberDto : list) {
// if(memberDto.get==null){
// memberDto.setStatus("注册会员");
// 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("男");
}else if(memberDto.getSex().equals("0")){
} else if ("0".equals(memberDto.getSex())) {
memberDto.setSex("女");
}
}else{
memberDto.setStatus("虚拟会员");
if ("1".equals(memberDto.getSource())) {
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并使用浏览器下载
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