Merge remote-tracking branch 'origin/feature-20240104' into feature-20240104

master
elliott 2 years ago
commit 86cced104a

@ -44,6 +44,12 @@ public class WxUserMember extends BaseEntity {
@Excel(name = "积分")
private Integer credit;
/**
*
*/
@Excel(name = "即将过期积分")
private Integer expireCredit;
/**
* openid
*/
@ -367,15 +373,24 @@ public class WxUserMember extends BaseEntity {
this.devicesNum = devicesNum;
}
public Integer getExpireCredit() {
return expireCredit;
}
public void setExpireCredit(Integer expireCredit) {
this.expireCredit = expireCredit;
}
public WxUserMember() {
}
public WxUserMember(Long id, String nickname, String headimg, String username, Integer credit, String openid, String unionid, Integer userType, Integer level, String mobile, Long provinceId, String province, Long cityId, String city, Long areaId, String area, Date birthday, Integer clock, Integer activity, String wechat, Integer isAbutment, Integer isCompleteInformation, Integer devicesNum, Date loginTime, Integer status) {
public WxUserMember(Long id, String nickname, String headimg, String username, Integer credit, Integer expireCredit, String openid, String unionid, Integer userType, Integer level, String mobile, Long provinceId, String province, Long cityId, String city, Long areaId, String area, Date birthday, Integer clock, Integer activity, String wechat, Integer isAbutment, Integer isCompleteInformation, Integer devicesNum, Date loginTime, Integer status) {
this.id = id;
this.nickname = nickname;
this.headimg = headimg;
this.username = username;
this.credit = credit;
this.expireCredit = expireCredit;
this.openid = openid;
this.unionid = unionid;
this.userType = userType;

@ -0,0 +1,230 @@
package com.flossom.common.core.domain.export;
import com.flossom.common.core.annotation.Excel;
import java.util.Date;
import java.util.List;
public class WxUserMemberExport {
/**
* id
*/
@Excel(name = "用户编号")
private Long id;
/**
*
*/
@Excel(name = "会员昵称")
private String nickname;
/**
*
*/
@Excel(name = "积分")
private Integer credit;
/**
*
*/
@Excel(name = "即将过期积分")
private Integer expireCredit;
/**
* unionid
*/
@Excel(name = "unionid")
private String unionid;
/**
*
*/
@Excel(name = "手机号")
private String mobile;
/**
*
*/
@Excel(name = "省")
private String province;
/**
*
*/
@Excel(name = "市")
private String city;
/**
*
*/
@Excel(name = "区")
private String area;
/**
*
*/
@Excel(name = "生日", width = 30, dateFormat = "yyyy-MM-dd")
private Date birthday;
/**
*
*/
@Excel(name = "仪器数量")
private Integer devicesNum;
// @Excel(name = "仪器名称")
private List<String> devicesName;
/**
*
*/
@Excel(name = "用户注册时间", dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
@Excel(name = "企微标签")
String wecomTags;
@Excel(name = "小程序标签")
String miniProgramTags;
public WxUserMemberExport() {
}
public WxUserMemberExport(Long id, String nickname, Integer credit, Integer expireCredit, String unionid, String mobile, String province, String city, String area, Date birthday, Integer devicesNum, Date createTime) {
this.id = id;
this.nickname = nickname;
this.credit = credit;
this.expireCredit = expireCredit;
this.unionid = unionid;
this.mobile = mobile;
this.province = province;
this.city = city;
this.area = area;
this.birthday = birthday;
this.devicesNum = devicesNum;
this.createTime = createTime;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getNickname() {
return nickname;
}
public void setNickname(String nickname) {
this.nickname = nickname;
}
public Integer getCredit() {
return credit;
}
public void setCredit(Integer credit) {
this.credit = credit;
}
public Integer getExpireCredit() {
return expireCredit;
}
public void setExpireCredit(Integer expireCredit) {
this.expireCredit = expireCredit;
}
public String getUnionid() {
return unionid;
}
public void setUnionid(String unionid) {
this.unionid = unionid;
}
public String getMobile() {
return mobile;
}
public void setMobile(String mobile) {
this.mobile = mobile;
}
public String getProvince() {
return province;
}
public void setProvince(String province) {
this.province = province;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public String getArea() {
return area;
}
public void setArea(String area) {
this.area = area;
}
public Date getBirthday() {
return birthday;
}
public void setBirthday(Date birthday) {
this.birthday = birthday;
}
public Integer getDevicesNum() {
return devicesNum;
}
public void setDevicesNum(Integer devicesNum) {
this.devicesNum = devicesNum;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public String getWecomTags() {
return wecomTags;
}
public void setWecomTags(String wecomTags) {
this.wecomTags = wecomTags;
}
public String getMiniProgramTags() {
return miniProgramTags;
}
public void setMiniProgramTags(String miniProgramTags) {
this.miniProgramTags = miniProgramTags;
}
public List<String> getDevicesName() {
return devicesName;
}
public void setDevicesName(List<String> devicesName) {
this.devicesName = devicesName;
}
}

@ -0,0 +1,42 @@
package com.flossom.common.core.domain.req;
import com.flossom.common.core.web.domain.BaseEntity;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
*
*
* @author flossom
* @date 2023-12-08
*/
public class WxUserMemberExportVm extends WxUserMemberVm {
/**
*
*/
private List<String> exportFields = new ArrayList<>();
private List<Integer> userIdList = new ArrayList<>();
public List<String> getExportFields() {
return exportFields;
}
public void setExportFields(List<String> exportFields) {
this.exportFields = exportFields;
}
public List<Integer> getUserIdList() {
return userIdList;
}
public void setUserIdList(List<Integer> userIdList) {
this.userIdList = userIdList;
}
}

@ -2,6 +2,7 @@ package com.flossom.common.core.domain.req;
import com.flossom.common.core.web.domain.BaseEntity;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@ -106,6 +107,8 @@ public class WxUserMemberVm extends BaseEntity {
*/
List<Integer> miniProgramTags;
public WxUserMemberVm() {
}
@ -259,4 +262,5 @@ public class WxUserMemberVm extends BaseEntity {
public void setMiniProgramTags(List<Integer> miniProgramTags) {
this.miniProgramTags = miniProgramTags;
}
}

@ -82,4 +82,6 @@ public interface WxUserMemberMapper {
List<WxUserMember> selectWxUserMemberByMobile(@Param("mobile") String mobile);
List<WxUserMember> selectWxUserMemberByIdList(@Param("userIdList") List<Integer> userIdList);
}

@ -62,4 +62,8 @@ public interface WxUserScriptLogMapper {
public int deleteWxUserScriptLogByIds(Long[] ids);
void deleteWxUserScriptLogByWxUserId(@Param("userId") Long userId);
Integer getNoReadMessageNum(WxUserScriptLog query);
void hasBeenRead(WxUserScriptLog query);
}

@ -31,6 +31,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="floatScore != null "> and float_score = #{floatScore}</if>
<if test="soureId != null "> and soure_id = #{soureId}</if>
<if test="remarkContent != null and remarkContent != ''"> and remark_content = #{remarkContent}</if>
<if test="createTime != null">
and create_time &lt;= #{createTime}
</if>
</where>
</select>

@ -10,6 +10,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="headimg" column="headimg" />
<result property="username" column="username" />
<result property="credit" column="credit" />
<result property="expireCredit" column="expire_credit" />
<result property="openid" column="openid" />
<result property="unionid" column="unionid" />
<result property="userType" column="user_type" />
@ -38,11 +39,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectWxUserMemberVo">
select id, nickname, headimg, username, credit, openid, unionid, user_type, level, mobile, province_id, city_id, area_id, province, city, area, birthday, clock, activity, wechat, is_abutment, login_time, is_complete_information, devices_num, status, create_by, create_time, update_by, update_time, remark from wx_user_member
select id, nickname, headimg, username, credit, expire_credit, openid, unionid, user_type, level, mobile, province_id, city_id, area_id, province, city, area, birthday, clock, activity, wechat, is_abutment, login_time, is_complete_information, devices_num, status, create_by, create_time, update_by, update_time, remark from wx_user_member
</sql>
<sql id="fieldList">
member.id, member.nickname, member.headimg, member.username, member.credit, member.openid, member.unionid, member.user_type, member.level, member.mobile,
member.id, member.nickname, member.headimg, member.username, member.credit, member.expire_credit, member.openid, member.unionid, member.user_type, member.level, member.mobile,
member.province_id, member.city_id, member.area_id, member.province, member.city, member.area, member.birthday, member.clock, member.activity,
member.wechat, member.is_abutment, member.login_time, member.is_complete_information, member.devices_num, member.status, member.create_by,
member.create_time, member.update_by, member.update_time, member.remark
@ -56,6 +57,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="headimg != null and headimg != ''"> and headimg = #{headimg}</if>
<if test="username != null and username != ''"> and username like concat('%', #{username}, '%')</if>
<if test="credit != null "> and credit = #{credit}</if>
<if test="expireCredit != null "> and expire_credit = #{expireCredit}</if>
<if test="openid != null and openid != ''"> and openid = #{openid}</if>
<if test="unionid != null and unionid != ''"> and unionid = #{unionid}</if>
<if test="userType != null "> and user_type = #{userType}</if>
@ -113,10 +115,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="cityId != null and cityId != ''"> and member.city_id = #{cityId}</if>
<if test="areaId != null and areaId != ''"> and member.area_id = #{areaId}</if>
<if test="birthday != null "> and member.birthday = #{birthday}</if>
<if test="params.beginTime != null and params.beginTime != ''">
<if test="params != null and params.beginTime != null">
and member.create_time &gt;= #{params.beginTime}
</if>
<if test="params.endTime != null and params.endTime != ''">
<if test="params != null and params.endTime != null">
and member.create_time &lt;= #{params.endTime}
</if>
<if test="deviceNumStart != null and deviceNumEnd != null"> and member.devices_num &gt;= #{deviceNumStart} and member.devices_num &lt;= #{deviceNumEnd}</if>
@ -158,6 +160,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="headimg != null">headimg,</if>
<if test="username != null">username,</if>
<if test="credit != null">credit,</if>
<if test="expireCredit != null">expire_credit,</if>
<if test="openid != null">openid,</if>
<if test="unionid != null">unionid,</if>
<if test="userType != null">user_type,</if>
@ -189,6 +192,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="headimg != null">#{headimg},</if>
<if test="username != null">#{username},</if>
<if test="credit != null">#{credit},</if>
<if test="expireCredit != null">#{expireCredit},</if>
<if test="openid != null">#{openid},</if>
<if test="unionid != null">#{unionid},</if>
<if test="userType != null">#{userType},</if>
@ -224,6 +228,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="headimg != null">headimg = #{headimg},</if>
<if test="username != null">username = #{username},</if>
<if test="credit != null">credit = #{credit},</if>
<if test="expireCredit != null">expire_credit = #{expireCredit},</if>
<if test="openid != null">openid = #{openid},</if>
<if test="unionid != null">unionid = #{unionid},</if>
<if test="userType != null">user_type = #{userType},</if>
@ -297,5 +302,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
mobile = #{mobile}
</select>
<select id="selectWxUserMemberByIdList" resultType="com.flossom.common.core.domain.entity.WxUserMember">
<include refid="selectWxUserMemberVo"/>
where id in
<foreach item="id" collection="userIdList" open="(" separator="," close=")">
#{id}
</foreach>
</select>
</mapper>

@ -56,13 +56,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="tagIds != null and tagIds != ''"> and tag_ids = #{tagIds}</if>
<if test="status != null "> and status = #{status}</if>
</where>
order by create_time desc
</select>
<select id="selectWxUserScriptLogById" parameterType="Long" resultMap="WxUserScriptLogResult">
<include refid="selectWxUserScriptLogVo"/>
where id = #{id}
</select>
<select id="getNoReadMessageNum" resultType="java.lang.Integer">
select count(1) from wx_user_script_log
<where>
<if test="wxUserId != null "> and wx_user_id = #{wxUserId}</if>
<if test="isRead != null "> and is_read = #{isRead}</if>
<if test="status != null "> and status = #{status}</if>
</where>
</select>
<insert id="insertWxUserScriptLog" parameterType="WxUserScriptLog" useGeneratedKeys="true" keyProperty="id">
insert into wx_user_script_log
<trim prefix="(" suffix=")" suffixOverrides=",">
@ -141,6 +151,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where id = #{id}
</update>
<update id="hasBeenRead">
update wx_user_script_log set
`is_read` = 1
<where>
<if test="wxUserId != null "> and wx_user_id = #{wxUserId}</if>
<if test="isRead != null "> and is_read = #{isRead}</if>
<if test="status != null "> and status = #{status}</if>
</where>
</update>
<delete id="deleteWxUserScriptLogById" parameterType="Long">
delete from wx_user_script_log where id = #{id}
</delete>
@ -154,4 +174,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<delete id="deleteWxUserScriptLogByWxUserId" parameterType="Long">
delete from wx_user_script_log where wx_user_id = #{userId}
</delete>
</mapper>

@ -0,0 +1,55 @@
package com.flossom.miniProgram.controller;
import com.flossom.common.core.domain.R;
import com.flossom.common.core.domain.entity.WxUserScriptLog;
import com.flossom.common.core.web.controller.BaseController;
import com.flossom.common.core.web.page.TableDataInfo;
import com.flossom.miniProgram.service.IWxUserScriptLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* Controller
*
* @author flossom
* @date 2023-12-20
*/
@RestController
@RequestMapping("/userScriptLog")
public class WxUserScriptLogController extends BaseController {
@Autowired
private IWxUserScriptLogService wxUserScriptLogService;
/**
*
*/
@GetMapping("/list")
public TableDataInfo list() {
startPage();
List<WxUserScriptLog> list = wxUserScriptLogService.selectWxUserScriptLogList();
return getDataTable(list);
}
/**
*
*/
@GetMapping("getNoReadMessageNum")
public R getNoReadMessageNum() {
return R.ok(wxUserScriptLogService.getNoReadMessageNum());
}
/**
*
*/
@GetMapping("/hasBeenRead")
public R hasBeenRead() {
wxUserScriptLogService.hasBeenRead();
return R.ok();
}
}

@ -36,6 +36,12 @@ public class LoginUserVo {
@Excel(name = "积分")
private Integer credit;
/**
*
*/
@Excel(name = "即将过期积分")
private Integer expireCredit;
/**
*
*/
@ -96,12 +102,13 @@ public class LoginUserVo {
public LoginUserVo() {
}
public LoginUserVo(Long id, String nickname, String headimg, String username, Integer credit, String mobile, Long provinceId, String province, Long cityId, String city, Long areaId, String area, Date birthday, String token) {
public LoginUserVo(Long id, String nickname, String headimg, String username, Integer credit, Integer expireCredit, String mobile, Long provinceId, String province, Long cityId, String city, Long areaId, String area, Date birthday, String token, String integralText) {
this.id = id;
this.nickname = nickname;
this.headimg = headimg;
this.username = username;
this.credit = credit;
this.expireCredit = expireCredit;
this.mobile = mobile;
this.provinceId = provinceId;
this.province = province;
@ -111,6 +118,7 @@ public class LoginUserVo {
this.area = area;
this.birthday = birthday;
this.token = token;
this.integralText = integralText;
}
public Long getId() {
@ -232,4 +240,12 @@ public class LoginUserVo {
public void setIntegralText(String integralText) {
this.integralText = integralText;
}
public Integer getExpireCredit() {
return expireCredit;
}
public void setExpireCredit(Integer expireCredit) {
this.expireCredit = expireCredit;
}
}

@ -0,0 +1,14 @@
package com.flossom.miniProgram.service;
import com.flossom.common.core.domain.entity.WxUserScriptLog;
import java.util.List;
public interface IWxUserScriptLogService {
List<WxUserScriptLog> selectWxUserScriptLogList();
Integer getNoReadMessageNum();
void hasBeenRead();
}

@ -0,0 +1,53 @@
package com.flossom.miniProgram.service.impl;
import com.flossom.common.core.domain.entity.WxUserScriptLog;
import com.flossom.common.core.enums.Status;
import com.flossom.common.core.mapper.WxUserScriptLogMapper;
import com.flossom.common.security.utils.SecurityUtils;
import com.flossom.miniProgram.service.IWxUserScriptLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class WxUserScriptLogServiceImpl implements IWxUserScriptLogService {
@Autowired
private WxUserScriptLogMapper wxUserScriptLogMapper;
@Override
public List<WxUserScriptLog> selectWxUserScriptLogList() {
WxUserScriptLog query = new WxUserScriptLog();
// 消息归属人
query.setWxUserId(SecurityUtils.getWxUserId());
// 消息状态正常
query.setStatus(Status.OK.getCode());
return wxUserScriptLogMapper.selectWxUserScriptLogList(query);
}
@Override
public Integer getNoReadMessageNum() {
WxUserScriptLog query = new WxUserScriptLog();
// 消息归属人
query.setWxUserId(SecurityUtils.getWxUserId());
// 消息状态正常
query.setStatus(Status.OK.getCode());
// 未读
query.setIsRead(0);
return wxUserScriptLogMapper.getNoReadMessageNum(query);
}
@Override
public void hasBeenRead() {
WxUserScriptLog query = new WxUserScriptLog();
// 消息归属人
query.setWxUserId(20L);
// 消息状态正常
query.setStatus(Status.OK.getCode());
// 未读
query.setIsRead(0);
wxUserScriptLogMapper.hasBeenRead(query);
}
}

@ -4,6 +4,7 @@ import java.util.List;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;
import com.flossom.common.core.domain.R;
import com.flossom.common.core.domain.entity.WxUserIntegralLog;
import com.flossom.common.core.utils.poi.ExcelUtil;
import com.flossom.common.core.web.controller.BaseController;
@ -13,14 +14,7 @@ import com.flossom.common.log.annotation.Log;
import com.flossom.common.log.enums.BusinessType;
import com.flossom.common.security.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import com.flossom.system.service.IWxUserIntegralLogService;
/**
@ -31,8 +25,7 @@ import com.flossom.system.service.IWxUserIntegralLogService;
*/
@RestController
@RequestMapping("/integralLog")
public class WxUserIntegralLogController extends BaseController
{
public class WxUserIntegralLogController extends BaseController {
@Autowired
private IWxUserIntegralLogService wxUserIntegralLogService;
@ -41,8 +34,7 @@ public class WxUserIntegralLogController extends BaseController
*/
@RequiresPermissions("system:integralLog:list")
@GetMapping("/list")
public TableDataInfo list(WxUserIntegralLog wxUserIntegralLog)
{
public TableDataInfo list(WxUserIntegralLog wxUserIntegralLog) {
startPage();
List<WxUserIntegralLog> list = wxUserIntegralLogService.selectWxUserIntegralLogList(wxUserIntegralLog);
return getDataTable(list);
@ -54,8 +46,7 @@ public class WxUserIntegralLogController extends BaseController
@RequiresPermissions("system:integralLog:export")
@Log(title = "微信用户积分流水", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, WxUserIntegralLog wxUserIntegralLog)
{
public void export(HttpServletResponse response, WxUserIntegralLog wxUserIntegralLog) {
List<WxUserIntegralLog> list = wxUserIntegralLogService.selectWxUserIntegralLogList(wxUserIntegralLog);
ExcelUtil<WxUserIntegralLog> util = new ExcelUtil<WxUserIntegralLog>(WxUserIntegralLog.class);
util.exportExcel(response, list, "微信用户积分流水数据");
@ -66,8 +57,7 @@ public class WxUserIntegralLogController extends BaseController
*/
@RequiresPermissions("system:integralLog:query")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
public AjaxResult getInfo(@PathVariable("id") Long id) {
return success(wxUserIntegralLogService.selectWxUserIntegralLogById(id));
}
@ -77,8 +67,7 @@ public class WxUserIntegralLogController extends BaseController
@RequiresPermissions("system:integralLog:add")
@Log(title = "微信用户积分流水", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody WxUserIntegralLog wxUserIntegralLog)
{
public AjaxResult add(@RequestBody WxUserIntegralLog wxUserIntegralLog) {
return toAjax(wxUserIntegralLogService.insertWxUserIntegralLog(wxUserIntegralLog));
}
@ -88,8 +77,7 @@ public class WxUserIntegralLogController extends BaseController
@RequiresPermissions("system:integralLog:edit")
@Log(title = "微信用户积分流水", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody WxUserIntegralLog wxUserIntegralLog)
{
public AjaxResult edit(@RequestBody WxUserIntegralLog wxUserIntegralLog) {
return toAjax(wxUserIntegralLogService.updateWxUserIntegralLog(wxUserIntegralLog));
}
@ -98,9 +86,17 @@ public class WxUserIntegralLogController extends BaseController
*/
@RequiresPermissions("system:integralLog:remove")
@Log(title = "微信用户积分流水", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(wxUserIntegralLogService.deleteWxUserIntegralLogByIds(ids));
}
/**
*
*/
@GetMapping("/countUserExpireIntegral")
public R countUserExpireIntegral(@RequestParam(required = false, value = "idList") List<Long> idList) {
wxUserIntegralLogService.countUserExpireIntegral(idList);
return R.ok();
}
}

@ -4,10 +4,9 @@ import javax.servlet.http.HttpServletResponse;
import com.flossom.common.core.domain.R;
import com.flossom.common.core.domain.entity.WxUserMember;
import com.flossom.common.core.domain.req.AllChangIntegralOperateReq;
import com.flossom.common.core.domain.req.WxUserIntegralVm;
import com.flossom.common.core.domain.req.WxUserMemberReq;
import com.flossom.common.core.domain.req.WxUserMemberVm;
import com.flossom.common.core.domain.entity.WxUserTag;
import com.flossom.common.core.domain.export.WxUserMemberExport;
import com.flossom.common.core.domain.req.*;
import com.flossom.common.core.domain.ret.WxUserMemberRet;
import com.flossom.common.core.enums.IntegralChangeTypeEnum;
import com.flossom.common.core.exception.ServiceException;
@ -20,10 +19,15 @@ import com.flossom.common.log.annotation.Log;
import com.flossom.common.log.enums.BusinessType;
import com.flossom.common.security.annotation.RequiresPermissions;
import com.flossom.system.service.IWxUserMemberService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.lang.reflect.Array;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
@ -61,15 +65,49 @@ public class WxUserMemberController extends BaseController {
}
/**
*
*
*/
@RequiresPermissions("system:member:export")
@Log(title = "用户", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, WxUserMember wxUserMember) {
List<WxUserMember> list = wxUserMemberService.selectWxUserMemberList(wxUserMember);
ExcelUtil<WxUserMember> util = new ExcelUtil<WxUserMember>(WxUserMember.class);
util.exportExcel(response, list, "用户数据");
@PostMapping("/allExport")
public void allExport(HttpServletResponse response, WxUserMemberExportVm wxUserMemberExportVm) {
List<WxUserMemberRet> list = wxUserMemberService.selectWxUserMemberRetList(wxUserMemberExportVm);
export(response, list, wxUserMemberExportVm.getExportFields());
}
/**
*
*/
@RequiresPermissions("system:member:export")
@Log(title = "用户", businessType = BusinessType.EXPORT)
@PostMapping("/batchExport")
public void batchExport(HttpServletResponse response, WxUserMemberExportVm wxUserMemberExportVm) {
List<Integer> userIdList = wxUserMemberExportVm.getUserIdList();
if (userIdList == null || userIdList.size() == 0) {
throw new ServiceException("请选择导出用户");
}
List<WxUserMemberRet> list = wxUserMemberService.selectWxUserMemberByIdList(wxUserMemberExportVm.getUserIdList());
export(response, list, wxUserMemberExportVm.getExportFields());
}
private static void export(HttpServletResponse response, List<WxUserMemberRet> list, List<String> exportFields) {
List<WxUserMemberExport> exportList = new ArrayList<>();
WxUserMemberExport export;
for (WxUserMemberRet wxUserMemberRet : list) {
export = new WxUserMemberExport();
BeanUtils.copyProperties(wxUserMemberRet, export);
List<WxUserTag> miniProgramTags = wxUserMemberRet.getMiniProgramTags();
if (miniProgramTags != null && miniProgramTags.size() > 0) {
export.setMiniProgramTags(miniProgramTags.stream().map(WxUserTag::getTagName).collect(Collectors.joining(",")));
}
List<WxUserTag> wecomTags = wxUserMemberRet.getWecomTags();
if (wecomTags != null && wecomTags.size() > 0) {
export.setWecomTags(wecomTags.stream().map(WxUserTag::getTagName).collect(Collectors.joining(",")));
}
exportList.add(export);
}
ExcelUtil<WxUserMemberExport> util = new ExcelUtil(WxUserMemberExport.class);
util.exportExcel(response, exportList, "用户数据", exportFields);
}
/**

@ -59,4 +59,7 @@ public interface IWxUserIntegralLogService
* @return
*/
public int deleteWxUserIntegralLogById(Long id);
void countUserExpireIntegral(List<Long> idList);
}

@ -87,4 +87,6 @@ public interface IWxUserMemberService
void openOrCloseActivity(Long id);
List<WxUserMemberRet> selectWxUserMemberRetList(WxUserMemberVm wxUserMemberVm);
List<WxUserMemberRet> selectWxUserMemberByIdList(List<Integer> userIdList);
}

@ -1,10 +1,20 @@
package com.flossom.system.service.impl;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.ZoneId;
import java.time.temporal.TemporalAdjusters;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import com.flossom.common.core.domain.entity.WxUserIntegralLog;
import com.flossom.common.core.domain.entity.WxUserMember;
import com.flossom.common.core.enums.Status;
import com.flossom.common.core.mapper.WxUserIntegralLogMapper;
import com.flossom.common.core.mapper.WxUserMemberMapper;
import com.flossom.common.core.utils.DateUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.flossom.system.service.IWxUserIntegralLogService;
@ -16,11 +26,13 @@ import com.flossom.system.service.IWxUserIntegralLogService;
* @date 2023-12-14
*/
@Service
public class WxUserIntegralLogServiceImpl implements IWxUserIntegralLogService
{
public class WxUserIntegralLogServiceImpl implements IWxUserIntegralLogService {
@Autowired
private WxUserIntegralLogMapper wxUserIntegralLogMapper;
@Autowired
private WxUserMemberMapper wxUserMemberMapper;
/**
*
*
@ -28,8 +40,7 @@ public class WxUserIntegralLogServiceImpl implements IWxUserIntegralLogService
* @return
*/
@Override
public WxUserIntegralLog selectWxUserIntegralLogById(Long id)
{
public WxUserIntegralLog selectWxUserIntegralLogById(Long id) {
return wxUserIntegralLogMapper.selectWxUserIntegralLogById(id);
}
@ -40,8 +51,7 @@ public class WxUserIntegralLogServiceImpl implements IWxUserIntegralLogService
* @return
*/
@Override
public List<WxUserIntegralLog> selectWxUserIntegralLogList(WxUserIntegralLog wxUserIntegralLog)
{
public List<WxUserIntegralLog> selectWxUserIntegralLogList(WxUserIntegralLog wxUserIntegralLog) {
return wxUserIntegralLogMapper.selectWxUserIntegralLogList(wxUserIntegralLog);
}
@ -52,8 +62,7 @@ public class WxUserIntegralLogServiceImpl implements IWxUserIntegralLogService
* @return
*/
@Override
public int insertWxUserIntegralLog(WxUserIntegralLog wxUserIntegralLog)
{
public int insertWxUserIntegralLog(WxUserIntegralLog wxUserIntegralLog) {
wxUserIntegralLog.setCreateTime(DateUtils.getNowDate());
return wxUserIntegralLogMapper.insertWxUserIntegralLog(wxUserIntegralLog);
}
@ -65,8 +74,7 @@ public class WxUserIntegralLogServiceImpl implements IWxUserIntegralLogService
* @return
*/
@Override
public int updateWxUserIntegralLog(WxUserIntegralLog wxUserIntegralLog)
{
public int updateWxUserIntegralLog(WxUserIntegralLog wxUserIntegralLog) {
return wxUserIntegralLogMapper.updateWxUserIntegralLog(wxUserIntegralLog);
}
@ -77,8 +85,7 @@ public class WxUserIntegralLogServiceImpl implements IWxUserIntegralLogService
* @return
*/
@Override
public int deleteWxUserIntegralLogByIds(Long[] ids)
{
public int deleteWxUserIntegralLogByIds(Long[] ids) {
return wxUserIntegralLogMapper.deleteWxUserIntegralLogByIds(ids);
}
@ -89,8 +96,55 @@ public class WxUserIntegralLogServiceImpl implements IWxUserIntegralLogService
* @return
*/
@Override
public int deleteWxUserIntegralLogById(Long id)
{
public int deleteWxUserIntegralLogById(Long id) {
return wxUserIntegralLogMapper.deleteWxUserIntegralLogById(id);
}
@Override
public void countUserExpireIntegral(List<Long> idList) {
// 1、获取所有用户
List<WxUserMember> wxUserMembers = new ArrayList<>();
if (idList != null && idList.size() > 0) {
for (Long aLong : idList) {
WxUserMember wxUserMember = wxUserMemberMapper.selectWxUserMemberById(aLong);
if (wxUserMember != null) {
wxUserMembers.add(wxUserMember);
}
}
} else {
WxUserMember wxUserMember = new WxUserMember();
wxUserMember.setUserType(1); // 会员
wxUserMember.setStatus(Status.OK.getCode());
wxUserMembers = wxUserMemberMapper.selectWxUserMemberList(wxUserMember);
}
for (WxUserMember userMember : wxUserMembers) {
WxUserIntegralLog query = new WxUserIntegralLog();
query.setUserId(userMember.getId());
// 2、根据用户id获取用户的历史积分记录
// 增加: 时间为 当前时间上一年的最后一天的最后一刻
LocalDateTime queryTime = LocalDateTime.now().minusYears(1).with(TemporalAdjusters.lastDayOfYear()).with(LocalTime.MAX);
query.setCreateTime(Date.from(queryTime.atZone(ZoneId.systemDefault()).toInstant()));
List<WxUserIntegralLog> increaseUserIntegralLogList = wxUserIntegralLogMapper.selectWxUserIntegralLogList(query);
Long increaseIntegral = increaseUserIntegralLogList.stream().filter(wxUserIntegralLog ->
StringUtils.equals(wxUserIntegralLog.getSource(), "1")
).mapToLong(WxUserIntegralLog::getFloatScore).sum();
// 扣减: 时间为当前
query.setCreateTime(null);
List<WxUserIntegralLog> reduceUserIntegralLogList = wxUserIntegralLogMapper.selectWxUserIntegralLogList(query);
Long reduceIntegral = reduceUserIntegralLogList.stream().filter(wxUserIntegralLog ->
StringUtils.equals(wxUserIntegralLog.getSource(), "2")
).mapToLong(WxUserIntegralLog::getFloatScore).sum();
// 3、计算该用户得过期积分并保存到用户信息表得过期积分中
// 当增加的大于扣除的就直接扣减
if (increaseIntegral > reduceIntegral) {
userMember.setExpireCredit(increaseIntegral.intValue() - reduceIntegral.intValue());
} else {
userMember.setExpireCredit(0);
}
wxUserMemberMapper.updateWxUserMember(userMember);
}
}
}

@ -373,4 +373,25 @@ public class WxUserMemberServiceImpl implements IWxUserMemberService {
}
return list;
}
@Override
public List<WxUserMemberRet> selectWxUserMemberByIdList(List<Integer> userIdList) {
List<WxUserMemberRet> list = new ArrayList<>();
List<WxUserMember> wxUserMembers = wxUserMemberMapper.selectWxUserMemberByIdList(userIdList);
if (wxUserMembers != null && wxUserMembers.size() > 0) {
WxUserMemberRet wxUserMemberRet;
for (WxUserMember wxUserMember : wxUserMembers) {
wxUserMemberRet = new WxUserMemberRet();
BeanUtils.copyProperties(wxUserMember, wxUserMemberRet);
WxUserTag wxUserTag = new WxUserTag();
wxUserTag.setUserId(wxUserMember.getId());
wxUserTag.setType(TagTypeStatus.MINI_PROGRAM.getCode());
wxUserMemberRet.setMiniProgramTags(wxUserTagMapper.selectWxUserTagList(wxUserTag));
wxUserTag.setType(TagTypeStatus.ENTERPRISE_WECHAT.getCode());
wxUserMemberRet.setWecomTags(wxUserTagMapper.selectWxUserTagList(wxUserTag));
list.add(wxUserMemberRet);
}
}
return list;
}
}

@ -56,7 +56,15 @@ public class WxUserScriptLogServiceImpl implements IWxUserScriptLogService {
*/
@Override
public List<WxUserScriptLog> selectWxUserScriptLogList(WxUserScriptLog wxUserScriptLog) {
return wxUserScriptLogMapper.selectWxUserScriptLogList(wxUserScriptLog);
List<WxUserScriptLog> wxUserScriptLogs = wxUserScriptLogMapper.selectWxUserScriptLogList(wxUserScriptLog);
for (WxUserScriptLog userScriptLog : wxUserScriptLogs) {
if (userScriptLog.getIsCustom() == 0 && userScriptLog.getScriptTemplateId() != null) {
WxScriptTemplate wxScriptTemplate = wxScriptTemplateMapper.selectWxScriptTemplateById(userScriptLog.getScriptTemplateId().longValue());
userScriptLog.setContent(wxScriptTemplate.getContent());
userScriptLog.setTitile(wxScriptTemplate.getTitile());
}
}
return wxUserScriptLogs;
}
/**

@ -1,6 +1,6 @@
<template>
<div class="app-container">
<el-descriptions size="medium">
<el-descriptions class="margin-top" style="font-size: 1.5em;">
<el-descriptions-item label="用户总数">{{ count.userNum }}</el-descriptions-item>
<el-descriptions-item label="已注册用户">{{ count.userRegisterNum }}</el-descriptions-item>
<el-descriptions-item label="已绑定仪器用户数">{{ count.userDeviceNum }}</el-descriptions-item>
@ -21,22 +21,28 @@
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="手机号码" prop="mobile">
<el-input
v-model="queryParams.mobile"
placeholder="搜索多个请用英文逗号隔开"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="用户编号" prop="id">
<el-input
v-model="queryParams.id"
placeholder="搜索多个请用英文逗号隔开"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-popover placement="top-start" width="200" trigger="click"
content="手机号码和用户编号,满足其中之一内容即可">
<el-form-item label="手机号码" prop="mobile" slot="reference">
<el-input
v-model="queryParams.mobile"
placeholder="搜索多个请用英文逗号隔开"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
</el-popover>
<el-popover placement="top-start" width="200" trigger="click"
content="手机号码和用户编号,满足其中之一内容即可">
<el-form-item label="用户编号" prop="id" slot="reference">
<el-input
v-model="queryParams.id"
placeholder="搜索多个请用英文逗号隔开"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
</el-popover>
<el-form-item label="生日" prop="birthday">
<el-date-picker
clearable
@ -89,62 +95,69 @@
align="right">
</el-date-picker>
</el-form-item>
<el-form-item label="仪器数量" prop="credit">
<el-input-number v-model="queryParams.deviceNumStart" @keyup.enter.native="handleQuery"></el-input-number>
<el-input-number v-model="queryParams.deviceNumEnd" @keyup.enter.native="handleQuery"></el-input-number>
</el-form-item>
<el-form-item label="积分范围" prop="credit">
<el-input-number v-model="queryParams.creditStart" @keyup.enter.native="handleQuery"></el-input-number>
<el-input-number v-model="queryParams.creditEnd" @keyup.enter.native="handleQuery"></el-input-number>
</el-form-item>
<!-- <el-form-item label="仪器绑定" prop="devicesTags">-->
<!-- <el-select v-model="queryParams.devicesTags" multiple placeholder="请选择">-->
<!-- <el-option-->
<!-- v-for="item in devicesTags"-->
<!-- :key="item.value"-->
<!-- :label="item.label"-->
<!-- :value="item.value">-->
<!-- </el-option>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="购买渠道" prop="purchaseChannels">-->
<!-- <el-select v-model="queryParams.purchaseChannels" multiple placeholder="请选择">-->
<!-- <el-select v-model="queryParams.devicesName" multiple placeholder="请选择">-->
<!-- <el-option-->
<!-- v-for="item in purchaseChannels"-->
<!-- v-for="item in devicesName"-->
<!-- :key="item.value"-->
<!-- :label="item.label"-->
<!-- :value="item.value">-->
<!-- </el-option>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<el-form-item label="企微标签" prop="wecomTags">
<el-select v-model="queryParams.wecomTags" multiple placeholder="请选择">
<el-option
v-for="item in wecomTags"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
<el-form-item label="仪器数量" prop="credit">
<el-input-number v-model="queryParams.deviceNumStart" @keyup.enter.native="handleQuery"></el-input-number>
<el-input-number v-model="queryParams.deviceNumEnd" @keyup.enter.native="handleQuery"></el-input-number>
</el-form-item>
<el-form-item label="小程序标签" prop="miniProgramTags">
<el-select v-model="queryParams.miniProgramTags" multiple placeholder="请选择">
<el-option
v-for="item in miniProgramTags"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
<el-form-item label="积分范围" prop="credit">
<el-input-number v-model="queryParams.creditStart" @keyup.enter.native="handleQuery"></el-input-number>
<el-input-number v-model="queryParams.creditEnd" @keyup.enter.native="handleQuery"></el-input-number>
</el-form-item>
<!-- <el-form-item label="购买渠道" prop="purchaseChannels">-->
<!-- <el-select v-model="queryParams.purchaseChannels" multiple placeholder="请选择">-->
<!-- <el-option-->
<!-- v-for="item in purchaseChannels"-->
<!-- :key="item.value"-->
<!-- :label="item.label"-->
<!-- :value="item.value">-->
<!-- </el-option>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<el-popover placement="top-start" width="200" trigger="click"
content="企微标签和小程序标签,同时满足所选内容">
<el-form-item label="企微标签" prop="wecomTags" slot="reference">
<el-select v-model="queryParams.wecomTags" multiple placeholder="请选择">
<el-option
v-for="item in wecomTags"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
</el-popover>
<el-popover placement="top-start" width="200" trigger="click"
content="企微标签和小程序标签,同时满足所选内容">
<el-form-item label="小程序标签" prop="miniProgramTags" slot="reference">
<el-select v-model="queryParams.miniProgramTags" multiple placeholder="请选择">
<el-option
v-for="item in miniProgramTags"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
</el-popover>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
</el-form-item>
</el-form>
<!-- 批量操作下拉选项 -->
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-select v-model="batchOperateValue" placeholder="批量操作" size="mini" clearable>
@ -173,19 +186,10 @@
>确认
</el-button>
</el-col>
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="warning"-->
<!-- plain-->
<!-- icon="el-icon-download"-->
<!-- size="mini"-->
<!-- @click="handleExport"-->
<!-- v-hasPermi="['system:member:export']"-->
<!-- >导出</el-button>-->
<!-- </el-col>-->
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<!-- 显示表格 -->
<el-table v-loading="loading" :data="memberList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center"/>
<el-table-column label="头像" align="center">
@ -240,7 +244,7 @@
</el-button>
</template>
</el-table-column>
<el-table-column label="即将过期积分" align="center" prop=""/>
<el-table-column label="即将过期积分" align="center" prop="expireCredit"/>
<el-table-column label="用户类型" align="center" prop="userType">
<template slot-scope="scope">
<span v-show="scope.row.userType == 0"></span>
@ -623,8 +627,8 @@
<el-table-column type="index" width="50"></el-table-column>
<el-table-column prop="source" label="类型" width="100px">
<template slot-scope="scope">
<span v-show="scope.row.source == 0"></span>
<span v-show="scope.row.source == 1"></span>
<span v-show="scope.row.source == 2"></span>
</template>
</el-table-column>
<el-table-column prop="floatScore" label="变动积分"
@ -642,6 +646,61 @@
@pagination="getUserIntegralLogList"
/>
</el-dialog>
<!-- 导出字段选择弹窗 -->
<el-dialog title="自定义导出字段" :visible.sync="exportFieldsVisible" width="50%"
:before-close="cancelExportFieldsDialog">
<el-form ref="form" label-width="150px">
<el-form-item label="全部字段" prop="allFields">
<el-switch v-model="allFields" @click.native="isExportAllFields()"/>
</el-form-item>
</el-form>
<el-form :inline="true" ref="form" :model="exportFieldList" label-width="150px">
<el-form-item label="会员昵称" prop="nickname">
<el-switch v-model="exportFieldList.nickname" :active-value="'nickname'" :inactive-value="null"/>
</el-form-item>
<el-form-item label="用户编号 " prop="id">
<el-switch v-model="exportFieldList.id" active-value="id" :inactive-value="null"/>
</el-form-item>
<el-form-item label="手机号 " prop="mobile">
<el-switch v-model="exportFieldList.mobile" active-value="mobile" :inactive-value="null"/>
</el-form-item>
<el-form-item label="生日 " prop="birthday">
<el-switch v-model="exportFieldList.birthday" active-value="birthday" :inactive-value="null"/>
</el-form-item>
<el-form-item label="地区 " prop="province" @click.native="exportArea()">
<el-switch v-model="exportFieldList.province" active-value="province" :inactive-value="null"/>
</el-form-item>
<el-form-item label="用户注册时间 " prop="createTime">
<el-switch v-model="exportFieldList.createTime" active-value="createTime" :inactive-value="null"/>
</el-form-item>
<el-form-item label="仪器数量 " prop="devicesNum">
<el-switch v-model="exportFieldList.devicesNum" active-value="devicesNum" :inactive-value="null"/>
</el-form-item>
<el-form-item label="仪器名称 " prop="devicesName">
<el-switch v-model="exportFieldList.devicesName" active-value="devicesName" :inactive-value="null"/>
</el-form-item>
<el-form-item label="小程序标签 " prop="miniProgramTags">
<el-switch v-model="exportFieldList.miniProgramTags" active-value="miniProgramTags" :inactive-value="null"/>
</el-form-item>
<el-form-item label="企微标签 " prop="wecomTags">
<el-switch v-model="exportFieldList.wecomTags" active-value="wecomTags" :inactive-value="null"/>
</el-form-item>
<el-form-item label="积分 " prop="credit">
<el-switch v-model="exportFieldList.credit" active-value="credit" :inactive-value="null"/>
</el-form-item>
<el-form-item label="即将过期积分 " prop="expireCredit">
<el-switch v-model="exportFieldList.expireCredit" active-value="expireCredit" :inactive-value="null"/>
</el-form-item>
<el-form-item label="unionid " prop="unionid">
<el-switch v-model="exportFieldList.unionid" active-value="unionid" :inactive-value="null"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="cancelExportFieldsDialog()"> </el-button>
<el-button type="primary" @click="submitBatchOperate"> </el-button>
</div>
</el-dialog>
</div>
</template>
@ -650,7 +709,6 @@ import {
listMember,
getMember,
delMember,
addMember,
updateMember,
selectUserCount,
getMiniProgramTags,
@ -681,23 +739,6 @@ export default {
components: {Treeselect},
data() {
return {
tableData: [{
date: '2016-05-02',
name: '王小虎',
address: '上海市普陀区金沙江路 1518 弄'
}, {
date: '2016-05-04',
name: '王小虎',
address: '上海市普陀区金沙江路 1517 弄'
}, {
date: '2016-05-01',
name: '王小虎',
address: '上海市普陀区金沙江路 1519 弄'
}, {
date: '2016-05-03',
name: '王小虎',
address: '上海市普陀区金沙江路 1516 弄'
}],
//
loading: true,
//
@ -811,6 +852,31 @@ export default {
orderByColumn: "createTime",
isAsc: "desc"
},
//
exportFieldsVisible: false,
exportFieldsForm: {
userIdList: null,
exportFields: null,
},
allFields: false,
exportFieldList: {
id: null,
nickname: null,
credit: null,
expireCredit: null,
unionid: null,
mobile: null,
province: null,
city: null,
area: null,
birthday: null,
devicesNum: null,
devicesName: null,
createTime: null,
wecomTags: null,
miniProgramTags: null,
},
//
queryParams: {
pageNum: 1,
@ -846,7 +912,7 @@ export default {
loginTime: null,
status: null,
// createTime: [],
devicesTags: [], //
devicesName: [], //
wecomTags: [], //
miniProgramTags: [], //
purchaseChannels: [], //
@ -941,26 +1007,20 @@ export default {
this.reset();
},
//
cancelMiniProgramDialog(isclose) {
cancelMiniProgramDialog() {
this.title = null;
this.tagIdArray = [];
if (isclose) {
this.batchMiniProgramVisible = false;
}
this.batchMiniProgramVisible = false;
},
cancelIntegralDialog(isclose) {
cancelIntegralDialog() {
this.integralForm.source = null;
this.integralForm.floatScore = null;
this.integralForm.remarkContent = "后台操作";
if (isclose) {
this.batchIntegralVisible = false;
}
this.batchIntegralVisible = false;
},
cancelRemarkDialog(isclose) {
cancelRemarkDialog() {
this.remarkForm.content = null;
if (isclose) {
this.batchRemarkVisible = false;
}
this.batchRemarkVisible = false;
},
cancelUserScriptLogDialog() {
this.userScriptLogVisible = false;
@ -978,7 +1038,26 @@ export default {
this.userIntegralLogQuery.userId = null;
this.userIntegralLogQuery.userIntegralLogList = null;
},
cancelscriptDialog(isclose) {
cancelExportFieldsDialog() {
this.allFields = false;
this.exportFieldList.nickname = null;
this.exportFieldList.id = null;
this.exportFieldList.credit = null;
this.exportFieldList.expireCredit = null;
this.exportFieldList.unionid = null;
this.exportFieldList.mobile = null;
this.exportFieldList.province = null;
this.exportFieldList.city = null;
this.exportFieldList.area = null;
this.exportFieldList.birthday = null;
this.exportFieldList.devicesNum = null;
this.exportFieldList.devicesName = null;
this.exportFieldList.createTime = null;
this.exportFieldList.wecomTags = null;
this.exportFieldList.miniProgramTags = null;
this.exportFieldsVisible = false
},
cancelscriptDialog() {
this.scriptForm.isCustom = null;
this.scriptForm.scriptName = null;
this.scriptForm.titile = null;
@ -997,9 +1076,7 @@ export default {
this.tagIdArray = [];
this.scriptForm.scriptTemplateId = null;
this.scriptForm.scriptContent = null;
if (isclose) {
this.batchScriptVisible = false;
}
this.batchScriptVisible = false;
},
/** 查询部门下拉树结构 */
getDeptTree() {
@ -1213,9 +1290,11 @@ export default {
})
return
}
this.exportFieldsVisible = true;
}
if (this.batchOperateValue == 13) {
console.log("导出全量数据");
this.exportFieldsVisible = true;
}
}
},
@ -1413,6 +1492,32 @@ export default {
this.cancelRemarkDialog(true);
})
}
//
if (this.batchOperateValue == 12) {
let exportFields = Object.values(this.exportFieldList).filter(val => val != null);
if (exportFields.length == 0) {
this.$modal.msgError("请选择导出字段");
return;
}
this.exportFieldsForm.userIdList = this.ids;
this.exportFieldsForm.exportFields = exportFields;
this.download('/system/member/batchExport', {
...this.exportFieldsForm
}, `微信会员_${new Date().getTime()}.xlsx`);
this.cancelExportFieldsDialog();
}
if (this.batchOperateValue == 13) {
let exportFields = Object.values(this.exportFieldList).filter(val => val != null);
if (exportFields.length == 0) {
this.$modal.msgError("请选择导出字段");
return;
}
this.download('/system/member/allExport', {
...Object.assign({}, this.queryParams, {exportFields: exportFields})
}, `微信会员_${new Date().getTime()}.xlsx`)
this.cancelExportFieldsDialog();
}
},
//
ocEditRemarkDialog(row) {
@ -1471,12 +1576,6 @@ export default {
}).catch(() => {
});
},
/** 导出按钮操作 */
handleExport() {
this.download('system/member/export', {
...this.queryParams
}, `member_${new Date().getTime()}.xlsx`)
},
//
viewMessageDetail(row) {
this.userScriptLogQuery.wxUserId = row.id;
@ -1518,8 +1617,52 @@ export default {
this.userIntegralLogQuery.orderByColumn = prop;
this.userIntegralLogQuery.isAsc = column.order == 'ascending' ? 'asc' : 'desc';
this.getUserIntegralLogList();
},
isExportAllFields() {
if (this.allFields) {
this.exportFieldList.nickname = "nickname";
this.exportFieldList.id = "id";
this.exportFieldList.credit = "credit";
this.exportFieldList.expireCredit = "expireCredit";
this.exportFieldList.unionid = "unionid";
this.exportFieldList.mobile = "mobile";
this.exportFieldList.province = "province";
this.exportFieldList.city = "city";
this.exportFieldList.area = "area";
this.exportFieldList.birthday = "birthday";
this.exportFieldList.devicesNum = "devicesNum";
this.exportFieldList.devicesName = "devicesName";
this.exportFieldList.createTime = "createTime";
this.exportFieldList.wecomTags = "wecomTags";
this.exportFieldList.miniProgramTags = "miniProgramTags";
} else {
this.exportFieldList.nickname = null;
this.exportFieldList.id = null;
this.exportFieldList.credit = null;
this.exportFieldList.expireCredit = null;
this.exportFieldList.unionid = null;
this.exportFieldList.mobile = null;
this.exportFieldList.province = null;
this.exportFieldList.city = null;
this.exportFieldList.area = null;
this.exportFieldList.birthday = null;
this.exportFieldList.devicesNum = null;
this.exportFieldList.devicesName = null;
this.exportFieldList.createTime = null;
this.exportFieldList.wecomTags = null;
this.exportFieldList.miniProgramTags = null;
}
},
exportArea() {
if (this.exportFieldList.province != null) {
this.exportFieldList.city = "city";
this.exportFieldList.area = "area";
} else {
this.exportFieldList.city = null;
this.exportFieldList.area = null;
}
}
}
},
}
;
</script>

Loading…
Cancel
Save