!4 微信开发

Merge pull request !4 from 德仔/develop
This commit is contained in:
德仔 2020-11-30 00:02:28 +08:00 committed by Gitee
commit f86dbaad1d
28 changed files with 2829 additions and 70 deletions

View File

@ -769,11 +769,11 @@ create table sys_order (
drop table if exists sys_wx_user_info; drop table if exists sys_wx_user_info;
create table sys_wx_user_info ( create table sys_wx_user_info (
openid varchar(100) not null comment '微信openid', openid varchar(100) not null comment '微信openid',
appid varchar(100) comment '微信appid',
nick_name varchar(30) comment '昵称', nick_name varchar(30) comment '昵称',
phone varchar(30) comment '电话', phone varchar(30) comment '电话',
avatar_url varchar(255) comment '用户头像', avatar_url varchar(255) comment '用户头像',
gender tinyint comment '性别', sex char(1) comment '用户性别0男 1女 2未知',
path varchar(255) comment '文件路径',
city varchar(16) comment '城市', city varchar(16) comment '城市',
province varchar(16) comment '省份', province varchar(16) comment '省份',
country varchar(16) comment '国家', country varchar(16) comment '国家',
@ -790,19 +790,23 @@ create table sys_wx_user_info (
-- ---------------------------- -- ----------------------------
drop table if exists sys_wx_user_log; drop table if exists sys_wx_user_log;
create table sys_wx_user_log ( create table sys_wx_user_log (
openid varchar(100) not null comment '微信openid', id BIGINT(20) not null auto_increment comment 'id',
openid varchar(100) default 'manual' comment '微信openid',
appid varchar(100) comment '微信appid',
weight decimal(10,2) comment '体重', weight decimal(10,2) comment '体重',
sleep_time datetime comment '睡觉时间', phone varchar(30) comment '电话',
wakeup_time datetime comment '起床时间', sleep_time varchar(10) comment '睡觉时间',
sport tinyint comment '运动情况', avatar_url varchar(255) comment '用户头像',
diet tinyint comment '饮食情况', wakeup_time varchar(10) comment '起床时间',
sleep_quality tinyint comment '睡眠质量', sport char(1) comment '运动情况Y是 N否',
defecation tinyint comment '排便情况', diet char(1) comment '饮食情况Y是 N否',
water tinyint comment '饮水量', insomnia char(1) comment '熬夜失眠Y是 N否',
defecation char(1) comment '排便情况',
water bigint(20) comment '饮水量',
create_by varchar(64) default '' comment '创建者', create_by varchar(64) default '' comment '创建者',
create_time datetime comment '创建时间', create_time datetime comment '创建时间',
update_by varchar(64) default '' comment '更新者', update_by varchar(64) default '' comment '更新者',
update_time datetime comment '更新时间', update_time datetime comment '更新时间',
remark varchar(500) default null comment '备注', remark varchar(500) default null comment '备注',
primary key (openid) primary key (id)
) engine=innodb comment = '微信用户记录'; ) engine=innodb comment = '微信用户记录';

22
sql/wxuser/info.sql Normal file
View File

@ -0,0 +1,22 @@
-- 菜单 SQL
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('微信用户', '2039', '1', 'info', 'custom/wxUserInfo/index', 1, 0, 'C', '0', '0', 'custom:info:list', 'wechat', 'wonder', '2020-11-28', 'wonder', '2020-11-28', '微信用户菜单');
-- 按钮父菜单ID
SELECT @parentId := LAST_INSERT_ID();
-- 按钮 SQL
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('微信用户查询', @parentId, '1', '#', '', 1, 0, 'F', '0', '0', 'custom:info:query', '#', 'wonder', '2020-11-28', 'wonder', '2020-11-28', '');
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('微信用户新增', @parentId, '2', '#', '', 1, 0, 'F', '0', '0', 'custom:info:add', '#', 'wonder', '2020-11-28', 'wonder', '2020-11-28', '');
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('微信用户修改', @parentId, '3', '#', '', 1, 0, 'F', '0', '0', 'custom:info:edit', '#', 'wonder', '2020-11-28', 'wonder', '2020-11-28', '');
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('微信用户删除', @parentId, '4', '#', '', 1, 0, 'F', '0', '0', 'custom:info:remove', '#', 'wonder', '2020-11-28', 'wonder', '2020-11-28', '');
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('微信用户导出', @parentId, '5', '#', '', 1, 0, 'F', '0', '0', 'custom:info:export', '#', 'wonder', '2020-11-28', 'wonder', '2020-11-28', '');

22
sql/wxuser/log.sql Normal file
View File

@ -0,0 +1,22 @@
-- 菜单 SQL
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('微信用户记录', '2039', '1', 'log', 'custom/wxUserLog/index', 1, 0, 'C', '0', '0', 'custom:log:list', 'log', 'wonder', '2020-11-28', 'wonder', '2020-11-28', '微信用户记录菜单');
-- 按钮父菜单ID
SELECT @parentId := LAST_INSERT_ID();
-- 按钮 SQL
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('微信用户记录查询', @parentId, '1', '#', '', 1, 0, 'F', '0', '0', 'custom:log:query', '#', 'wonder', '2020-11-28', 'wonder', '2020-11-28', '');
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('微信用户记录新增', @parentId, '2', '#', '', 1, 0, 'F', '0', '0', 'custom:log:add', '#', 'wonder', '2020-11-28', 'wonder', '2020-11-28', '');
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('微信用户记录修改', @parentId, '3', '#', '', 1, 0, 'F', '0', '0', 'custom:log:edit', '#', 'wonder', '2020-11-28', 'wonder', '2020-11-28', '');
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('微信用户记录删除', @parentId, '4', '#', '', 1, 0, 'F', '0', '0', 'custom:log:remove', '#', 'wonder', '2020-11-28', 'wonder', '2020-11-28', '');
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('微信用户记录导出', @parentId, '5', '#', '', 1, 0, 'F', '0', '0', 'custom:log:export', '#', 'wonder', '2020-11-28', 'wonder', '2020-11-28', '');

View File

@ -0,0 +1,136 @@
package com.stdiet.web.controller.custom;
import com.stdiet.common.annotation.Log;
import com.stdiet.common.core.controller.BaseController;
import com.stdiet.common.core.domain.AjaxResult;
import com.stdiet.common.core.page.TableDataInfo;
import com.stdiet.common.enums.BusinessType;
import com.stdiet.common.utils.StringUtils;
import com.stdiet.common.utils.poi.ExcelUtil;
import com.stdiet.custom.domain.SysOrder;
import com.stdiet.custom.domain.SysWxUserInfo;
import com.stdiet.custom.page.WxServeInfo;
import com.stdiet.custom.service.ISysOrderService;
import com.stdiet.custom.service.ISysWxUserInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 微信用户Controller
*
* @author wonder
* @date 2020-11-28
*/
@RestController
@RequestMapping("/custom/wxUserInfo")
public class SysWxUserInfoController extends BaseController {
@Autowired
private ISysWxUserInfoService sysWxUserInfoService;
@Autowired
private ISysOrderService sysOrderService;
/**
* 查询微信用户列表
*/
@PreAuthorize("@ss.hasPermi('custom:wxUserInfo:list')")
@GetMapping("/list")
public TableDataInfo list(SysWxUserInfo sysWxUserInfo) {
startPage();
List<SysWxUserInfo> list = sysWxUserInfoService.selectSysWxUserInfoList(sysWxUserInfo);
return getDataTable(list);
}
/**
* 导出微信用户列表
*/
@PreAuthorize("@ss.hasPermi('custom:wxUserInfo:export')")
@Log(title = "微信用户", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(SysWxUserInfo sysWxUserInfo) {
List<SysWxUserInfo> list = sysWxUserInfoService.selectSysWxUserInfoList(sysWxUserInfo);
ExcelUtil<SysWxUserInfo> util = new ExcelUtil<SysWxUserInfo>(SysWxUserInfo.class);
return util.exportExcel(list, "wxUserInfo");
}
/**
* 获取微信用户详细信息
*/
@PreAuthorize("@ss.hasPermi('custom:wxUserInfo:query')")
@GetMapping(value = "/{openid}")
public AjaxResult getInfo(@PathVariable("openid") String openid) {
return AjaxResult.success(sysWxUserInfoService.selectSysWxUserInfoById(openid));
}
/**
* 新增微信用户
*/
@PreAuthorize("@ss.hasPermi('custom:wxUserInfo:add')")
@Log(title = "微信用户", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody SysWxUserInfo sysWxUserInfo) {
return toAjax(sysWxUserInfoService.insertSysWxUserInfo(sysWxUserInfo));
}
/**
* 修改微信用户
*/
@PreAuthorize("@ss.hasPermi('custom:wxUserInfo:edit')")
@Log(title = "微信用户", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody SysWxUserInfo sysWxUserInfo) {
return toAjax(sysWxUserInfoService.updateSysWxUserInfo(sysWxUserInfo));
}
/**
* 删除微信用户
*/
@PreAuthorize("@ss.hasPermi('custom:wxUserInfo:remove')")
@Log(title = "微信用户", businessType = BusinessType.DELETE)
@DeleteMapping("/{openids}")
public AjaxResult remove(@PathVariable String[] openids) {
return toAjax(sysWxUserInfoService.deleteSysWxUserInfoByIds(openids));
}
@PostMapping("/wx/serveinfo")
public AjaxResult addUser(@RequestBody SysWxUserInfo sysWxUserInfo) {
// 查询微信用户
SysWxUserInfo userInfo = sysWxUserInfoService.selectSysWxUserInfoById(sysWxUserInfo.getOpenid());
if (StringUtils.isNull(userInfo) && StringUtils.isEmpty(sysWxUserInfo.getPhone())
|| StringUtils.isEmpty(userInfo.getPhone()) && StringUtils.isEmpty(sysWxUserInfo.getPhone())) {
return AjaxResult.error(5001, "没有手机号");
}
// 插入/更新用户信息
if (StringUtils.isNull(userInfo)) {
sysWxUserInfoService.insertSysWxUserInfo(sysWxUserInfo);
} else {
if (StringUtils.isNotEmpty(userInfo.getPhone())) {
sysWxUserInfo.setPhone(userInfo.getPhone());
}
sysWxUserInfoService.updateSysWxUserInfo(sysWxUserInfo);
}
// 查找订单记录
SysOrder querySysOrder = new SysOrder();
querySysOrder.setPhone(sysWxUserInfo.getPhone());
List<SysOrder> list = sysOrderService.selectSysOrderList(querySysOrder);
if (list.isEmpty()) {
return AjaxResult.error(5002, "没有订单信息");
}
WxServeInfo wxServeInfo = new WxServeInfo();
wxServeInfo.setServeStatus(list.get(0).getStatus());
wxServeInfo.setServeTime(list.get(0).getServeTime());
wxServeInfo.setStartTime(list.get(list.size() - 1).getStartTime());
wxServeInfo.setWeight(list.get(list.size() - 1).getWeight());
wxServeInfo.setPhone(list.get(0).getPhone());
return AjaxResult.success(wxServeInfo);
}
}

View File

@ -0,0 +1,120 @@
package com.stdiet.web.controller.custom;
import com.stdiet.common.annotation.Log;
import com.stdiet.common.core.controller.BaseController;
import com.stdiet.common.core.domain.AjaxResult;
import com.stdiet.common.core.page.TableDataInfo;
import com.stdiet.common.enums.BusinessType;
import com.stdiet.common.utils.StringUtils;
import com.stdiet.common.utils.poi.ExcelUtil;
import com.stdiet.custom.domain.SysOrder;
import com.stdiet.custom.domain.SysWxUserInfo;
import com.stdiet.custom.domain.SysWxUserLog;
import com.stdiet.custom.page.WxLogInfo;
import com.stdiet.custom.service.ISysOrderService;
import com.stdiet.custom.service.ISysWxUserInfoService;
import com.stdiet.custom.service.ISysWxUserLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 微信用户记录Controller
*
* @author wonder
* @date 2020-11-28
*/
@RestController
@RequestMapping("/custom/wxUserLog")
public class SysWxUserLogController extends BaseController {
@Autowired
private ISysWxUserLogService sysWxUserLogService;
@Autowired
private ISysWxUserInfoService sysWxUserInfoService;
private ISysOrderService sysOrderService;
/**
* 查询微信用户记录列表
*/
@PreAuthorize("@ss.hasPermi('custom:wxUserLog:list')")
@GetMapping("/list")
public TableDataInfo list(SysWxUserLog sysWxUserLog) {
startPage();
List<SysWxUserLog> list = sysWxUserLogService.selectSysWxUserLogList(sysWxUserLog);
return getDataTable(list);
}
/**
* 导出微信用户记录列表
*/
@PreAuthorize("@ss.hasPermi('custom:wxUserLog:export')")
@Log(title = "微信用户记录", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(SysWxUserLog sysWxUserLog) {
List<SysWxUserLog> list = sysWxUserLogService.selectSysWxUserLogList(sysWxUserLog);
ExcelUtil<SysWxUserLog> util = new ExcelUtil<SysWxUserLog>(SysWxUserLog.class);
return util.exportExcel(list, "wxUserLog");
}
/**
* 获取微信用户记录详细信息
*/
@PreAuthorize("@ss.hasPermi('custom:wxUserLog:query')")
@GetMapping(value = "/{openid}")
public AjaxResult getInfo(@PathVariable("openid") String openid) {
return AjaxResult.success(sysWxUserLogService.selectSysWxUserLogById(openid));
}
/**
* 新增微信用户记录
*/
@PreAuthorize("@ss.hasPermi('custom:wxUserLog:add')")
@Log(title = "微信用户记录", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody SysWxUserLog sysWxUserLog) {
return toAjax(sysWxUserLogService.insertSysWxUserLog(sysWxUserLog));
}
/**
* 修改微信用户记录
*/
@PreAuthorize("@ss.hasPermi('custom:wxUserLog:edit')")
@Log(title = "微信用户记录", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody SysWxUserLog sysWxUserLog) {
return toAjax(sysWxUserLogService.updateSysWxUserLog(sysWxUserLog));
}
/**
* 删除微信用户记录
*/
@PreAuthorize("@ss.hasPermi('custom:wxUserLog:remove')")
@Log(title = "微信用户记录", businessType = BusinessType.DELETE)
@DeleteMapping("/{openids}")
public AjaxResult remove(@PathVariable String[] openids) {
return toAjax(sysWxUserLogService.deleteSysWxUserLogByIds(openids));
}
@GetMapping(value = "/wx/logs/list")
public AjaxResult getLogs(SysWxUserLog sysWxUserLog ) {
List<WxLogInfo> list = sysWxUserLogService.selectWxLogInfoList(sysWxUserLog);
return AjaxResult.success(list);
}
@PostMapping(value = "/wx/logs/add")
public AjaxResult addLog(@RequestBody SysWxUserLog sysWxUserLog) {
// 查询微信用户
SysWxUserInfo userInfo = sysWxUserInfoService.selectSysWxUserInfoById(sysWxUserLog.getOpenid());
if(StringUtils.isNull(userInfo)) {
return AjaxResult.error(5003, "没有用户信息");
}
// 提取有用值
sysWxUserLog.setAvatarUrl(userInfo.getAvatarUrl());
sysWxUserLog.setPhone(userInfo.getPhone());
return add(sysWxUserLog);
}
}

View File

@ -220,4 +220,138 @@ public class SysContract extends BaseEntity {
.toString(); .toString();
} }
/**
* 微信用户对象 sys_wx_user_info
*
* @author wonder
* @date 2020-11-28
*/
public static class SysWxUserInfo extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 微信openid */
private String openid;
/** 昵称 */
@Excel(name = "昵称")
private String nickName;
/** 电话 */
@Excel(name = "电话")
private String phone;
/** 用户头像 */
@Excel(name = "用户头像")
private String avatarUrl;
/** 用户性别0男 1女 2未知 */
@Excel(name = "用户性别", readConverterExp = "0=男,1=女,2=未知")
private String sex;
/** 城市 */
@Excel(name = "城市")
private String city;
/** 省份 */
@Excel(name = "省份")
private String province;
/** 国家 */
@Excel(name = "国家")
private String country;
public void setOpenid(String openid)
{
this.openid = openid;
}
public String getOpenid()
{
return openid;
}
public void setNickName(String nickName)
{
this.nickName = nickName;
}
public String getNickName()
{
return nickName;
}
public void setPhone(String phone)
{
this.phone = phone;
}
public String getPhone()
{
return phone;
}
public void setAvatarUrl(String avatarUrl)
{
this.avatarUrl = avatarUrl;
}
public String getAvatarUrl()
{
return avatarUrl;
}
public void setSex(String sex)
{
this.sex = sex;
}
public String getSex()
{
return sex;
}
public void setCity(String city)
{
this.city = city;
}
public String getCity()
{
return city;
}
public void setProvince(String province)
{
this.province = province;
}
public String getProvince()
{
return province;
}
public void setCountry(String country)
{
this.country = country;
}
public String getCountry()
{
return country;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("openid", getOpenid())
.append("nickName", getNickName())
.append("phone", getPhone())
.append("avatarUrl", getAvatarUrl())
.append("sex", getSex())
.append("city", getCity())
.append("province", getProvince())
.append("country", getCountry())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.toString();
}
}
} }

View File

@ -42,6 +42,14 @@ public class SysOrder extends BaseEntity {
@Excel(name = "金额") @Excel(name = "金额")
private BigDecimal amount; private BigDecimal amount;
private BigDecimal weight;
private String status;
private Date startTime;
private Date pauseTime;
/** /**
* 收款方式 * 收款方式
*/ */
@ -173,6 +181,40 @@ public class SysOrder extends BaseEntity {
@Excel(name = "成交时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") @Excel(name = "成交时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date orderTime; private Date orderTime;
public Date getStartTime() {
return startTime;
}
public BigDecimal getWeight() {
return weight;
}
public Date getPauseTime() {
return pauseTime;
}
public String getStatus() {
return status;
}
public void setStartTime(Date startTime) {
this.startTime = startTime;
}
public void setPauseTime(Date pauseTime) {
this.pauseTime = pauseTime;
}
public void setStatus(String status) {
this.status = status;
}
public void setWeight(BigDecimal weight) {
this.weight = weight;
}
public String getServeTime() { public String getServeTime() {
return serveTime; return serveTime;
} }
@ -442,6 +484,10 @@ public class SysOrder extends BaseEntity {
.append("serveTimeId", getServeTimeId()) .append("serveTimeId", getServeTimeId())
.append("serveTime", getServeTime()) .append("serveTime", getServeTime())
.append("reviewStatus", getReviewStatus()) .append("reviewStatus", getReviewStatus())
.append("status", getStatus())
.append("startTime", getStartTime())
.append("pauseTime", getPauseTime())
.append("weight", getWeight())
.toString(); .toString();
} }
} }

View File

@ -0,0 +1,154 @@
package com.stdiet.custom.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.stdiet.common.annotation.Excel;
import com.stdiet.common.core.domain.BaseEntity;
/**
* 微信用户对象 sys_wx_user_info
*
* @author wonder
* @date 2020-11-28
*/
public class SysWxUserInfo extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 微信openid */
private String openid;
/** 昵称 */
@Excel(name = "昵称")
private String nickName;
/** 微信appid */
@Excel(name = "微信appid")
private String appid;
/** 电话 */
@Excel(name = "电话")
private String phone;
/** 用户头像 */
@Excel(name = "用户头像")
private String avatarUrl;
/** 用户性别0男 1女 2未知 */
@Excel(name = "用户性别", readConverterExp = "0=男,1=女,2=未知")
private String sex;
/** 城市 */
@Excel(name = "城市")
private String city;
/** 省份 */
@Excel(name = "省份")
private String province;
/** 国家 */
@Excel(name = "国家")
private String country;
public void setOpenid(String openid)
{
this.openid = openid;
}
public String getOpenid()
{
return openid;
}
public void setNickName(String nickName)
{
this.nickName = nickName;
}
public String getNickName()
{
return nickName;
}
public void setAppid(String appid)
{
this.appid = appid;
}
public String getAppid()
{
return appid;
}
public void setPhone(String phone)
{
this.phone = phone;
}
public String getPhone()
{
return phone;
}
public void setAvatarUrl(String avatarUrl)
{
this.avatarUrl = avatarUrl;
}
public String getAvatarUrl()
{
return avatarUrl;
}
public void setSex(String sex)
{
this.sex = sex;
}
public String getSex()
{
return sex;
}
public void setCity(String city)
{
this.city = city;
}
public String getCity()
{
return city;
}
public void setProvince(String province)
{
this.province = province;
}
public String getProvince()
{
return province;
}
public void setCountry(String country)
{
this.country = country;
}
public String getCountry()
{
return country;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("openid", getOpenid())
.append("nickName", getNickName())
.append("appid", getAppid())
.append("phone", getPhone())
.append("avatarUrl", getAvatarUrl())
.append("sex", getSex())
.append("city", getCity())
.append("province", getProvince())
.append("country", getCountry())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.toString();
}
}

View File

@ -0,0 +1,199 @@
package com.stdiet.custom.domain;
import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.stdiet.common.annotation.Excel;
import com.stdiet.common.core.domain.BaseEntity;
/**
* 微信用户记录对象 sys_wx_user_log
*
* @author wonder
* @date 2020-11-29
*/
public class SysWxUserLog extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 微信openid */
private String openid;
/** 体重 */
@Excel(name = "体重")
private BigDecimal weight;
/** 微信appid */
@Excel(name = "微信appid")
private String appid;
/** 电话 */
@Excel(name = "电话")
private String phone;
/** 睡觉时间 */
@Excel(name = "睡觉时间")
private String sleepTime;
/** 起床时间 */
@Excel(name = "起床时间")
private String wakeupTime;
/** 运动情况Y是 N否 */
@Excel(name = "运动情况", readConverterExp = "Y=是,N=否")
private String sport;
/** 用户头像 */
@Excel(name = "用户头像")
private String avatarUrl;
/** 饮食情况Y是 N否 */
@Excel(name = "饮食情况", readConverterExp = "Y=是,N=否")
private String diet;
/** 熬夜失眠Y是 N否 */
@Excel(name = "熬夜失眠", readConverterExp = "Y=是,N=否")
private String insomnia;
/** 排便情况Y是 N否 */
@Excel(name = "排便情况", readConverterExp = "Y=是,N=否")
private String defecation;
/** 饮水量 */
@Excel(name = "饮水量")
private Long water;
public void setOpenid(String openid)
{
this.openid = openid;
}
public String getOpenid()
{
return openid;
}
public void setWeight(BigDecimal weight)
{
this.weight = weight;
}
public BigDecimal getWeight()
{
return weight;
}
public void setAppid(String appid)
{
this.appid = appid;
}
public String getAppid()
{
return appid;
}
public void setPhone(String phone)
{
this.phone = phone;
}
public String getPhone()
{
return phone;
}
public void setSleepTime(String sleepTime)
{
this.sleepTime = sleepTime;
}
public String getSleepTime()
{
return sleepTime;
}
public void setWakeupTime(String wakeupTime)
{
this.wakeupTime = wakeupTime;
}
public String getWakeupTime()
{
return wakeupTime;
}
public void setSport(String sport)
{
this.sport = sport;
}
public String getSport()
{
return sport;
}
public void setAvatarUrl(String avatarUrl)
{
this.avatarUrl = avatarUrl;
}
public String getAvatarUrl()
{
return avatarUrl;
}
public void setDiet(String diet)
{
this.diet = diet;
}
public String getDiet()
{
return diet;
}
public void setInsomnia(String insomnia)
{
this.insomnia = insomnia;
}
public String getInsomnia()
{
return insomnia;
}
public void setDefecation(String defecation)
{
this.defecation = defecation;
}
public String getDefecation()
{
return defecation;
}
public void setWater(Long water)
{
this.water = water;
}
public Long getWater()
{
return water;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("openid", getOpenid())
.append("weight", getWeight())
.append("appid", getAppid())
.append("phone", getPhone())
.append("sleepTime", getSleepTime())
.append("wakeupTime", getWakeupTime())
.append("sport", getSport())
.append("avatarUrl", getAvatarUrl())
.append("diet", getDiet())
.append("insomnia", getInsomnia())
.append("defecation", getDefecation())
.append("water", getWater())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.toString();
}
}

View File

@ -0,0 +1,61 @@
package com.stdiet.custom.mapper;
import java.util.List;
import com.stdiet.custom.domain.SysWxUserInfo;
/**
* 微信用户Mapper接口
*
* @author wonder
* @date 2020-11-28
*/
public interface SysWxUserInfoMapper
{
/**
* 查询微信用户
*
* @param openid 微信用户ID
* @return 微信用户
*/
public SysWxUserInfo selectSysWxUserInfoById(String openid);
/**
* 查询微信用户列表
*
* @param sysWxUserInfo 微信用户
* @return 微信用户集合
*/
public List<SysWxUserInfo> selectSysWxUserInfoList(SysWxUserInfo sysWxUserInfo);
/**
* 新增微信用户
*
* @param sysWxUserInfo 微信用户
* @return 结果
*/
public int insertSysWxUserInfo(SysWxUserInfo sysWxUserInfo);
/**
* 修改微信用户
*
* @param sysWxUserInfo 微信用户
* @return 结果
*/
public int updateSysWxUserInfo(SysWxUserInfo sysWxUserInfo);
/**
* 删除微信用户
*
* @param openid 微信用户ID
* @return 结果
*/
public int deleteSysWxUserInfoById(String openid);
/**
* 批量删除微信用户
*
* @param openids 需要删除的数据ID
* @return 结果
*/
public int deleteSysWxUserInfoByIds(String[] openids);
}

View File

@ -0,0 +1,64 @@
package com.stdiet.custom.mapper;
import java.util.List;
import com.stdiet.custom.domain.SysWxUserLog;
import com.stdiet.custom.page.WxLogInfo;
/**
* 微信用户记录Mapper接口
*
* @author wonder
* @date 2020-11-28
*/
public interface SysWxUserLogMapper
{
/**
* 查询微信用户记录
*
* @param openid 微信用户记录ID
* @return 微信用户记录
*/
public SysWxUserLog selectSysWxUserLogById(String openid);
/**
* 查询微信用户记录列表
*
* @param sysWxUserLog 微信用户记录
* @return 微信用户记录集合
*/
public List<SysWxUserLog> selectSysWxUserLogList(SysWxUserLog sysWxUserLog);
public List<WxLogInfo> selectWxLogInfoList(SysWxUserLog sysWxUserLog);
/**
* 新增微信用户记录
*
* @param sysWxUserLog 微信用户记录
* @return 结果
*/
public int insertSysWxUserLog(SysWxUserLog sysWxUserLog);
/**
* 修改微信用户记录
*
* @param sysWxUserLog 微信用户记录
* @return 结果
*/
public int updateSysWxUserLog(SysWxUserLog sysWxUserLog);
/**
* 删除微信用户记录
*
* @param openid 微信用户记录ID
* @return 结果
*/
public int deleteSysWxUserLogById(String openid);
/**
* 批量删除微信用户记录
*
* @param openids 需要删除的数据ID
* @return 结果
*/
public int deleteSysWxUserLogByIds(String[] openids);
}

View File

@ -0,0 +1,9 @@
package com.stdiet.custom.page;
import java.io.Serializable;
public class WxCurUserLogInfo implements Serializable {
private static final long serialVersionUID = 1L;
}

View File

@ -0,0 +1,118 @@
package com.stdiet.custom.page;
import com.stdiet.common.utils.DateUtils;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
public class WxLogInfo implements Serializable {
private static final long serialVersionUID = 1L;
private String date;
private Long water;
private String sleepTime;
private String wakeupTime;
private String sport;
private BigDecimal weight;
private String diet;
private String insomnia;
private String defecation;
public String getDate() {
return date;
}
public String getDefecation() {
return defecation;
}
public String getDiet() {
return diet;
}
public String getSleepTime() {
return sleepTime;
}
public Long getWater() {
return water;
}
public String getInsomnia() {
return insomnia;
}
public String getSport() {
return sport;
}
public String getWakeupTime() {
return wakeupTime;
}
public BigDecimal getWeight() {
return weight;
}
public void setWeight(BigDecimal weight) {
this.weight = weight;
}
public void setDate(Date date) {
this.date = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, date);
}
public void setDiet(String diet) {
this.diet = diet == "Y" ? "" : "";
}
public void setWater(Long water) {
this.water = water;
}
public void setWakeupTime(String wakeupTime) {
this.wakeupTime = wakeupTime;
}
public void setDefecation(String defecation) {
this.defecation = defecation == "Y" ? "" : "";
}
public void setSport(String sport) {
this.sport = sport == "Y" ? "" : "";
}
public void setInsomnia(String insomnia) {
this.insomnia = insomnia == "Y" ? "" : "";
}
public void setSleepTime(String sleepTime) {
this.sleepTime = sleepTime;
}
@Override
public String toString() {
return "WxLogInfo{" +
"date='" + date + '\'' +
", water='" + water + '\'' +
", sleepTime='" + sleepTime + '\'' +
", wakeupTime='" + wakeupTime + '\'' +
", sport='" + sport + '\'' +
", weight='" + weight + '\'' +
", diet='" + diet + '\'' +
", insomnia='" + insomnia + '\'' +
", defecation='" + defecation + '\'' +
'}';
}
}

View File

@ -0,0 +1,78 @@
package com.stdiet.custom.page;
import com.stdiet.common.utils.DateUtils;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
public class WxServeInfo implements Serializable {
private static final long serialVersionUID = 1L;
private String serveTime;
private String serveStatus;
private String startTime;
private String weight;
private String phone;
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getServeTime() {
return serveTime;
}
public void setServeTime(String serveTime) {
this.serveTime = serveTime;
}
public String getServeStatus() {
return serveStatus;
}
public void setServeStatus(String serveStatus) {
if (serveStatus.equals("0")) {
this.serveStatus = "进行中";
} else if (serveStatus.equals("1")) {
this.serveStatus = "暂停";
} else if (serveStatus.equals("")) {
this.serveStatus = "已完成";
}
}
public String getStartTime() {
return startTime;
}
public void setStartTime(Date startTime) {
this.startTime = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, startTime);
}
public String getWeight() {
return weight;
}
public void setWeight(BigDecimal weight) {
this.weight = weight.toString() + "kg";
}
@Override
public String toString() {
return "WxServeInfo{" +
"serveTime='" + serveTime + '\'' +
", serveStatus='" + serveStatus + '\'' +
", startTime='" + startTime + '\'' +
", weight='" + weight + '\'' +
", phone='" + phone + '\'' +
'}';
}
}

View File

@ -0,0 +1,63 @@
package com.stdiet.custom.service;
import java.util.List;
import com.stdiet.custom.domain.SysWxUserInfo;
/**
* 微信用户Service接口
*
* @author wonder
* @date 2020-11-28
*/
public interface ISysWxUserInfoService
{
/**
* 查询微信用户
*
* @param openid 微信用户ID
* @return 微信用户
*/
public SysWxUserInfo selectSysWxUserInfoById(String openid);
/**
* 查询微信用户列表
*
* @param sysWxUserInfo 微信用户
* @return 微信用户集合
*/
public List<SysWxUserInfo> selectSysWxUserInfoList(SysWxUserInfo sysWxUserInfo);
/**
* 新增微信用户
*
* @param sysWxUserInfo 微信用户
* @return 结果
*/
public int insertSysWxUserInfo(SysWxUserInfo sysWxUserInfo);
/**
* 修改微信用户
*
* @param sysWxUserInfo 微信用户
* @return 结果
*/
public int updateSysWxUserInfo(SysWxUserInfo sysWxUserInfo);
/**
* 批量删除微信用户
*
* @param openids 需要删除的微信用户ID
* @return 结果
*/
public int deleteSysWxUserInfoByIds(String[] openids);
/**
* 删除微信用户信息
*
* @param openid 微信用户ID
* @return 结果
*/
public int deleteSysWxUserInfoById(String openid);
}

View File

@ -0,0 +1,64 @@
package com.stdiet.custom.service;
import java.util.List;
import com.stdiet.custom.domain.SysWxUserLog;
import com.stdiet.custom.page.WxLogInfo;
/**
* 微信用户记录Service接口
*
* @author wonder
* @date 2020-11-28
*/
public interface ISysWxUserLogService
{
/**
* 查询微信用户记录
*
* @param openid 微信用户记录ID
* @return 微信用户记录
*/
public SysWxUserLog selectSysWxUserLogById(String openid);
/**
* 查询微信用户记录列表
*
* @param sysWxUserLog 微信用户记录
* @return 微信用户记录集合
*/
public List<SysWxUserLog> selectSysWxUserLogList(SysWxUserLog sysWxUserLog);
public List<WxLogInfo> selectWxLogInfoList(SysWxUserLog sysWxUserLog);
/**
* 新增微信用户记录
*
* @param sysWxUserLog 微信用户记录
* @return 结果
*/
public int insertSysWxUserLog(SysWxUserLog sysWxUserLog);
/**
* 修改微信用户记录
*
* @param sysWxUserLog 微信用户记录
* @return 结果
*/
public int updateSysWxUserLog(SysWxUserLog sysWxUserLog);
/**
* 批量删除微信用户记录
*
* @param openids 需要删除的微信用户记录ID
* @return 结果
*/
public int deleteSysWxUserLogByIds(String[] openids);
/**
* 删除微信用户记录信息
*
* @param openid 微信用户记录ID
* @return 结果
*/
public int deleteSysWxUserLogById(String openid);
}

View File

@ -102,8 +102,8 @@ public class SysContractServiceImpl implements ISysContractService {
@Override @Override
public PdfProcessInfo signContract(SysContract sysContract) { public PdfProcessInfo signContract(SysContract sysContract) {
// String templatePath = "/Users/wonder/Documents/Workspaces/java/RuoYi-Vue/running/pdf/contract.pdf"; // String templatePath = "/Users/wonder/Documents/Workspaces/java/ShengTangMange/running/pdf/contract.pdf";
// String filePath = "/Users/wonder/Documents/Workspaces/java/RuoYi-Vue/running" + sysContract.getPath(); // String filePath = "/Users/wonder/Documents/Workspaces/java/ShengTangMange/running" + sysContract.getPath();
String templatePath = "/home/workspace/ShengTangManage/running/pdf/contract.pdf"; String templatePath = "/home/workspace/ShengTangManage/running/pdf/contract.pdf";
String filePath = "/home/web/manage.shengtangdiet.com" + sysContract.getPath(); String filePath = "/home/web/manage.shengtangdiet.com" + sysContract.getPath();
@ -122,7 +122,7 @@ public class SysContractServiceImpl implements ISysContractService {
AcroFields form = stamper.getAcroFields(); AcroFields form = stamper.getAcroFields();
form.addSubstitutionFont(BaseFont.createFont("STSong-Light", "UniGB-UCS2-H", BaseFont.NOT_EMBEDDED)); form.addSubstitutionFont(BaseFont.createFont("STSong-Light", "UniGB-UCS2-H", BaseFont.NOT_EMBEDDED));
form.setField("signName", sysContract.getSignName(), true); form.setField("name", sysContract.getSignName(), true);
form.setField("serveTime", sysContract.getServeTimeStr(), true); form.setField("serveTime", sysContract.getServeTimeStr(), true);
form.setField("tutor", sysContract.getTutor(), true); form.setField("tutor", sysContract.getTutor(), true);
form.setField("moneyUpper", sysContract.getAmountUpper(), true); form.setField("moneyUpper", sysContract.getAmountUpper(), true);

View File

@ -0,0 +1,96 @@
package com.stdiet.custom.service.impl;
import java.util.List;
import com.stdiet.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.stdiet.custom.mapper.SysWxUserInfoMapper;
import com.stdiet.custom.domain.SysWxUserInfo;
import com.stdiet.custom.service.ISysWxUserInfoService;
/**
* 微信用户Service业务层处理
*
* @author wonder
* @date 2020-11-28
*/
@Service
public class SysWxUserInfoServiceImpl implements ISysWxUserInfoService
{
@Autowired
private SysWxUserInfoMapper sysWxUserInfoMapper;
/**
* 查询微信用户
*
* @param openid 微信用户ID
* @return 微信用户
*/
@Override
public SysWxUserInfo selectSysWxUserInfoById(String openid)
{
return sysWxUserInfoMapper.selectSysWxUserInfoById(openid);
}
/**
* 查询微信用户列表
*
* @param sysWxUserInfo 微信用户
* @return 微信用户
*/
@Override
public List<SysWxUserInfo> selectSysWxUserInfoList(SysWxUserInfo sysWxUserInfo)
{
return sysWxUserInfoMapper.selectSysWxUserInfoList(sysWxUserInfo);
}
/**
* 新增微信用户
*
* @param sysWxUserInfo 微信用户
* @return 结果
*/
@Override
public int insertSysWxUserInfo(SysWxUserInfo sysWxUserInfo)
{
sysWxUserInfo.setCreateTime(DateUtils.getNowDate());
return sysWxUserInfoMapper.insertSysWxUserInfo(sysWxUserInfo);
}
/**
* 修改微信用户
*
* @param sysWxUserInfo 微信用户
* @return 结果
*/
@Override
public int updateSysWxUserInfo(SysWxUserInfo sysWxUserInfo)
{
sysWxUserInfo.setUpdateTime(DateUtils.getNowDate());
return sysWxUserInfoMapper.updateSysWxUserInfo(sysWxUserInfo);
}
/**
* 批量删除微信用户
*
* @param openids 需要删除的微信用户ID
* @return 结果
*/
@Override
public int deleteSysWxUserInfoByIds(String[] openids)
{
return sysWxUserInfoMapper.deleteSysWxUserInfoByIds(openids);
}
/**
* 删除微信用户信息
*
* @param openid 微信用户ID
* @return 结果
*/
@Override
public int deleteSysWxUserInfoById(String openid)
{
return sysWxUserInfoMapper.deleteSysWxUserInfoById(openid);
}
}

View File

@ -0,0 +1,96 @@
package com.stdiet.custom.service.impl;
import java.util.List;
import com.stdiet.common.utils.DateUtils;
import com.stdiet.custom.page.WxLogInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.stdiet.custom.mapper.SysWxUserLogMapper;
import com.stdiet.custom.domain.SysWxUserLog;
import com.stdiet.custom.service.ISysWxUserLogService;
/**
* 微信用户记录Service业务层处理
*
* @author wonder
* @date 2020-11-28
*/
@Service
public class SysWxUserLogServiceImpl implements ISysWxUserLogService {
@Autowired
private SysWxUserLogMapper sysWxUserLogMapper;
/**
* 查询微信用户记录
*
* @param openid 微信用户记录ID
* @return 微信用户记录
*/
@Override
public SysWxUserLog selectSysWxUserLogById(String openid) {
return sysWxUserLogMapper.selectSysWxUserLogById(openid);
}
/**
* 查询微信用户记录列表
*
* @param sysWxUserLog 微信用户记录
* @return 微信用户记录
*/
@Override
public List<SysWxUserLog> selectSysWxUserLogList(SysWxUserLog sysWxUserLog) {
return sysWxUserLogMapper.selectSysWxUserLogList(sysWxUserLog);
}
@Override
public List<WxLogInfo> selectWxLogInfoList(SysWxUserLog sysWxUserLog) {
return sysWxUserLogMapper.selectWxLogInfoList(sysWxUserLog);
}
/**
* 新增微信用户记录
*
* @param sysWxUserLog 微信用户记录
* @return 结果
*/
@Override
public int insertSysWxUserLog(SysWxUserLog sysWxUserLog) {
sysWxUserLog.setCreateTime(DateUtils.getNowDate());
return sysWxUserLogMapper.insertSysWxUserLog(sysWxUserLog);
}
/**
* 修改微信用户记录
*
* @param sysWxUserLog 微信用户记录
* @return 结果
*/
@Override
public int updateSysWxUserLog(SysWxUserLog sysWxUserLog) {
sysWxUserLog.setUpdateTime(DateUtils.getNowDate());
return sysWxUserLogMapper.updateSysWxUserLog(sysWxUserLog);
}
/**
* 批量删除微信用户记录
*
* @param openids 需要删除的微信用户记录ID
* @return 结果
*/
@Override
public int deleteSysWxUserLogByIds(String[] openids) {
return sysWxUserLogMapper.deleteSysWxUserLogByIds(openids);
}
/**
* 删除微信用户记录信息
*
* @param openid 微信用户记录ID
* @return 结果
*/
@Override
public int deleteSysWxUserLogById(String openid) {
return sysWxUserLogMapper.deleteSysWxUserLogById(openid);
}
}

View File

@ -9,6 +9,10 @@
<result property="customer" column="customer"/> <result property="customer" column="customer"/>
<result property="phone" column="phone"/> <result property="phone" column="phone"/>
<result property="amount" column="amount"/> <result property="amount" column="amount"/>
<result property="weight" column="weight"/>
<result property="startTime" column="start_time"/>
<result property="pauseTime" column="pause_time"/>
<result property="status" column="status"/>
<result property="payTypeId" column="pay_type_id"/> <result property="payTypeId" column="pay_type_id"/>
<result property="payType" column="pay_type"/> <result property="payType" column="pay_type"/>
<result property="preSaleId" column="pre_sale_id"/> <result property="preSaleId" column="pre_sale_id"/>
@ -34,7 +38,10 @@
</resultMap> </resultMap>
<sql id="selectSysOrderVo"> <sql id="selectSysOrderVo">
select o.order_id, o.review_status, o.customer, o.phone, o.amount, ser.dict_label as serve_time, o.serve_time_id, o.pay_type_id, pay.dict_label as pay_type, o.pre_sale_id, o.create_by, o.create_time, o.after_sale_id, o.update_by, o.update_time, o.nutritionist_id, o.remark, o.nutri_assis_id, o.account_id, acc.dict_label as account, o.planner_id, o.planner_assis_id, o.operator_id, o.operator_assis_id, o.recommender, o.order_time from sys_order o select o.order_id, o.review_status, o.customer, o.phone, o.amount, o.start_time, o.pause_time, o.status, o.weight, ser.dict_label as serve_time,
o.serve_time_id, o.pay_type_id, pay.dict_label as pay_type, o.pre_sale_id, o.create_by, o.create_time, o.after_sale_id, o.update_by, o.update_time,
o.nutritionist_id, o.remark, o.nutri_assis_id, o.account_id, acc.dict_label as account, o.planner_id, o.planner_assis_id, o.operator_id, o.operator_assis_id,
o.recommender, o.order_time from sys_order o
LEFT JOIN (SELECT dict_label, dict_value FROM sys_dict_data WHERE dict_type = 'cus_pay_type') AS pay ON pay.dict_value = o.pay_type_id LEFT JOIN (SELECT dict_label, dict_value FROM sys_dict_data WHERE dict_type = 'cus_pay_type') AS pay ON pay.dict_value = o.pay_type_id
LEFT JOIN (SELECT dict_label, dict_value FROM sys_dict_data WHERE dict_type = 'cus_account') AS acc ON acc.dict_value = o.account_id LEFT JOIN (SELECT dict_label, dict_value FROM sys_dict_data WHERE dict_type = 'cus_account') AS acc ON acc.dict_value = o.account_id
LEFT JOIN (SELECT dict_label, dict_value FROM sys_dict_data WHERE dict_type = 'cus_serve_time') AS ser ON ser.dict_value = o.serve_time_id LEFT JOIN (SELECT dict_label, dict_value FROM sys_dict_data WHERE dict_type = 'cus_serve_time') AS ser ON ser.dict_value = o.serve_time_id
@ -46,6 +53,7 @@
<if test="orderId != null and orderId != ''">and order_id = #{orderId}</if> <if test="orderId != null and orderId != ''">and order_id = #{orderId}</if>
<if test="customer != null and customer != ''">and customer = #{customer}</if> <if test="customer != null and customer != ''">and customer = #{customer}</if>
<if test="phone != null and phone != ''">and phone = #{phone}</if> <if test="phone != null and phone != ''">and phone = #{phone}</if>
<if test="status != null ">and status = #{status}</if>
<if test="payTypeId != null ">and pay_type_id = #{payTypeId}</if> <if test="payTypeId != null ">and pay_type_id = #{payTypeId}</if>
<if test="preSaleId != null ">and pre_sale_id = #{preSaleId}</if> <if test="preSaleId != null ">and pre_sale_id = #{preSaleId}</if>
<if test="afterSaleId != null ">and after_sale_id = #{afterSaleId}</if> <if test="afterSaleId != null ">and after_sale_id = #{afterSaleId}</if>
@ -70,6 +78,7 @@
<if test="orderId != null and orderId != ''">and order_id = #{orderId}</if> <if test="orderId != null and orderId != ''">and order_id = #{orderId}</if>
<if test="customer != null and customer != ''">and customer = #{customer}</if> <if test="customer != null and customer != ''">and customer = #{customer}</if>
<if test="phone != null and phone != ''">and phone = #{phone}</if> <if test="phone != null and phone != ''">and phone = #{phone}</if>
<if test="status != null ">and status = #{status}</if>
<if test="payTypeId != null ">and pay_type_id = #{payTypeId}</if> <if test="payTypeId != null ">and pay_type_id = #{payTypeId}</if>
<if test="preSaleId != null ">and pre_sale_id = #{preSaleId}</if> <if test="preSaleId != null ">and pre_sale_id = #{preSaleId}</if>
<if test="afterSaleId != null ">and after_sale_id = #{afterSaleId}</if> <if test="afterSaleId != null ">and after_sale_id = #{afterSaleId}</if>
@ -101,6 +110,10 @@
<if test="customer != null and customer != ''">customer,</if> <if test="customer != null and customer != ''">customer,</if>
<if test="phone != null">phone,</if> <if test="phone != null">phone,</if>
<if test="amount != null">amount,</if> <if test="amount != null">amount,</if>
<if test="status != null">status,</if>
<if test="pauseTime != null">pause_time,</if>
<if test="startTime != null">start_time,</if>
<if test="weight != null">weight,</if>
<if test="payTypeId != null">pay_type_id,</if> <if test="payTypeId != null">pay_type_id,</if>
<if test="preSaleId != null">pre_sale_id,</if> <if test="preSaleId != null">pre_sale_id,</if>
<if test="createBy != null">create_by,</if> <if test="createBy != null">create_by,</if>
@ -126,6 +139,10 @@
<if test="customer != null and customer != ''">#{customer},</if> <if test="customer != null and customer != ''">#{customer},</if>
<if test="phone != null">#{phone},</if> <if test="phone != null">#{phone},</if>
<if test="amount != null">#{amount},</if> <if test="amount != null">#{amount},</if>
<if test="status != null">#{status},</if>
<if test="pauseTime != null">#{pauseTime},</if>
<if test="startTime != null">#{startTime},</if>
<if test="weight != null">#{weight},</if>
<if test="payTypeId != null">#{payTypeId},</if> <if test="payTypeId != null">#{payTypeId},</if>
<if test="preSaleId != null">#{preSaleId},</if> <if test="preSaleId != null">#{preSaleId},</if>
<if test="createBy != null">#{createBy},</if> <if test="createBy != null">#{createBy},</if>
@ -154,6 +171,10 @@
<if test="customer != null and customer != ''">customer = #{customer},</if> <if test="customer != null and customer != ''">customer = #{customer},</if>
<if test="phone != null">phone = #{phone},</if> <if test="phone != null">phone = #{phone},</if>
<if test="amount != null">amount = #{amount},</if> <if test="amount != null">amount = #{amount},</if>
<if test="weight != null">weight = #{weight},</if>
<if test="status != null">status = #{status},</if>
<if test="pauseTime != null">pause_time = #{pauseTime},</if>
<if test="startTime != null">start_time = #{startTime},</if>
<if test="payTypeId != null">pay_type_id = #{payTypeId},</if> <if test="payTypeId != null">pay_type_id = #{payTypeId},</if>
<if test="preSaleId != null">pre_sale_id = #{preSaleId},</if> <if test="preSaleId != null">pre_sale_id = #{preSaleId},</if>
<if test="createBy != null">create_by = #{createBy},</if> <if test="createBy != null">create_by = #{createBy},</if>

View File

@ -0,0 +1,110 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.stdiet.custom.mapper.SysWxUserInfoMapper">
<resultMap type="SysWxUserInfo" id="SysWxUserInfoResult">
<result property="openid" column="openid" />
<result property="nickName" column="nick_name" />
<result property="appid" column="appid" />
<result property="phone" column="phone" />
<result property="avatarUrl" column="avatar_url" />
<result property="sex" column="sex" />
<result property="city" column="city" />
<result property="province" column="province" />
<result property="country" column="country" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectSysWxUserInfoVo">
select openid, nick_name, appid, phone, avatar_url, sex, city, province, country, create_by, create_time, update_by, update_time, remark from sys_wx_user_info
</sql>
<select id="selectSysWxUserInfoList" parameterType="SysWxUserInfo" resultMap="SysWxUserInfoResult">
<include refid="selectSysWxUserInfoVo"/>
<where>
<if test="nickName != null and nickName != ''"> and nick_name like concat('%', #{nickName}, '%')</if>
<if test="appid != null and appid != ''"> and appid = #{appid}</if>
<if test="phone != null and phone != ''"> and phone = #{phone}</if>
<if test="sex != null and sex != ''"> and sex = #{sex}</if>
</where>
</select>
<select id="selectSysWxUserInfoById" parameterType="String" resultMap="SysWxUserInfoResult">
<include refid="selectSysWxUserInfoVo"/>
where openid = #{openid}
</select>
<insert id="insertSysWxUserInfo" parameterType="SysWxUserInfo">
insert into sys_wx_user_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="openid != null">openid,</if>
<if test="nickName != null">nick_name,</if>
<if test="appid != null">appid,</if>
<if test="phone != null">phone,</if>
<if test="avatarUrl != null">avatar_url,</if>
<if test="sex != null">sex,</if>
<if test="city != null">city,</if>
<if test="province != null">province,</if>
<if test="country != null">country,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="openid != null">#{openid},</if>
<if test="nickName != null">#{nickName},</if>
<if test="appid != null">#{appid},</if>
<if test="phone != null">#{phone},</if>
<if test="avatarUrl != null">#{avatarUrl},</if>
<if test="sex != null">#{sex},</if>
<if test="city != null">#{city},</if>
<if test="province != null">#{province},</if>
<if test="country != null">#{country},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateSysWxUserInfo" parameterType="SysWxUserInfo">
update sys_wx_user_info
<trim prefix="SET" suffixOverrides=",">
<if test="nickName != null">nick_name = #{nickName},</if>
<if test="appid != null">appid = #{appid},</if>
<if test="phone != null">phone = #{phone},</if>
<if test="avatarUrl != null">avatar_url = #{avatarUrl},</if>
<if test="sex != null">sex = #{sex},</if>
<if test="city != null">city = #{city},</if>
<if test="province != null">province = #{province},</if>
<if test="country != null">country = #{country},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where openid = #{openid}
</update>
<delete id="deleteSysWxUserInfoById" parameterType="String">
delete from sys_wx_user_info where openid = #{openid}
</delete>
<delete id="deleteSysWxUserInfoByIds" parameterType="String">
delete from sys_wx_user_info where openid in
<foreach item="openid" collection="array" open="(" separator="," close=")">
#{openid}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,142 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.stdiet.custom.mapper.SysWxUserLogMapper">
<resultMap type="SysWxUserLog" id="SysWxUserLogResult">
<result property="openid" column="openid" />
<result property="weight" column="weight" />
<result property="appid" column="appid" />
<result property="phone" column="phone" />
<result property="sleepTime" column="sleep_time" />
<result property="wakeupTime" column="wakeup_time" />
<result property="sport" column="sport" />
<result property="avatarUrl" column="avatar_url" />
<result property="diet" column="diet" />
<result property="insomnia" column="insomnia" />
<result property="defecation" column="defecation" />
<result property="water" column="water" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
</resultMap>
<resultMap type="com.stdiet.custom.page.WxLogInfo" id="WxLogInfo">
<result property="weight" column="weight" />
<result property="sleepTime" column="sleep_time" />
<result property="wakeupTime" column="wakeup_time" />
<result property="sport" column="sport" />
<result property="diet" column="diet" />
<result property="insomnia" column="insomnia" />
<result property="defecation" column="defecation" />
<result property="water" column="water" />
<result property="date" column="create_time" />
</resultMap>
<sql id="selectSysWxUserLogVo">
select openid, weight, appid, phone, sleep_time, wakeup_time, sport, avatar_url, diet, insomnia, defecation, water, create_by, create_time, update_by, update_time, remark from sys_wx_user_log
</sql>
<select id="selectSysWxUserLogList" parameterType="SysWxUserLog" resultMap="SysWxUserLogResult">
<include refid="selectSysWxUserLogVo"/>
<where>
<if test="appid != null and appid != ''"> and appid = #{appid}</if>
<if test="phone != null and phone != ''"> and phone = #{phone}</if>
</where>
order by create_time desc
</select>
<select id="selectWxLogInfoList" parameterType="SysWxUserLog" resultMap="WxLogInfo">
<include refid="selectSysWxUserLogVo"/>
<where>
<if test="appid != null and appid != ''"> and appid = #{appid}</if>
<if test="phone != null and phone != ''"> and phone = #{phone}</if>
</where>
order by create_time asc
</select>
<select id="selectSysWxUserLogById" parameterType="String" resultMap="SysWxUserLogResult">
<include refid="selectSysWxUserLogVo"/>
where openid = #{openid}
</select>
<insert id="insertSysWxUserLog" parameterType="SysWxUserLog">
insert into sys_wx_user_log
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="openid != null">openid,</if>
<if test="weight != null">weight,</if>
<if test="appid != null">appid,</if>
<if test="phone != null">phone,</if>
<if test="sleepTime != null">sleep_time,</if>
<if test="wakeupTime != null">wakeup_time,</if>
<if test="sport != null">sport,</if>
<if test="avatarUrl != null">avatar_url,</if>
<if test="diet != null">diet,</if>
<if test="insomnia != null">insomnia,</if>
<if test="defecation != null">defecation,</if>
<if test="water != null">water,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="openid != null">#{openid},</if>
<if test="weight != null">#{weight},</if>
<if test="appid != null">#{appid},</if>
<if test="phone != null">#{phone},</if>
<if test="sleepTime != null">#{sleepTime},</if>
<if test="wakeupTime != null">#{wakeupTime},</if>
<if test="sport != null">#{sport},</if>
<if test="avatarUrl != null">#{avatarUrl},</if>
<if test="diet != null">#{diet},</if>
<if test="insomnia != null">#{insomnia},</if>
<if test="defecation != null">#{defecation},</if>
<if test="water != null">#{water},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateSysWxUserLog" parameterType="SysWxUserLog">
update sys_wx_user_log
<trim prefix="SET" suffixOverrides=",">
<if test="weight != null">weight = #{weight},</if>
<if test="appid != null">appid = #{appid},</if>
<if test="phone != null">phone = #{phone},</if>
<if test="sleepTime != null">sleep_time = #{sleepTime},</if>
<if test="wakeupTime != null">wakeup_time = #{wakeupTime},</if>
<if test="sport != null">sport = #{sport},</if>
<if test="avatarUrl != null">avatar_url = #{avatarUrl},</if>
<if test="diet != null">diet = #{diet},</if>
<if test="insomnia != null">insomnia = #{insomnia},</if>
<if test="defecation != null">defecation = #{defecation},</if>
<if test="water != null">water = #{water},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where openid = #{openid}
</update>
<delete id="deleteSysWxUserLogById" parameterType="String">
delete from sys_wx_user_log where openid = #{openid}
</delete>
<delete id="deleteSysWxUserLogByIds" parameterType="String">
delete from sys_wx_user_log where openid in
<foreach item="openid" collection="array" open="(" separator="," close=")">
#{openid}
</foreach>
</delete>
</mapper>

View File

@ -98,7 +98,9 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
"/login", "/login",
"/captchaImage", "/captchaImage",
"/custom/contract/sign", "/custom/contract/sign",
"/custom/contract/file/**" "/custom/contract/file/**",
"/custom/wxUserInfo/wx/**",
"/custom/wxUserLog/wx/**"
).anonymous() ).anonymous()
.antMatchers( .antMatchers(
HttpMethod.GET, HttpMethod.GET,

View File

@ -0,0 +1,53 @@
import request from '@/utils/request'
// 查询微信用户列表
export function listWxUserInfo(query) {
return request({
url: '/custom/wxUserInfo/list',
method: 'get',
params: query
})
}
// 查询微信用户详细
export function getWxUserInfo(openid) {
return request({
url: '/custom/wxUserInfo/' + openid,
method: 'get'
})
}
// 新增微信用户
export function addWxUserInfo(data) {
return request({
url: '/custom/wxUserInfo',
method: 'post',
data: data
})
}
// 修改微信用户
export function updateWxUserInfo(data) {
return request({
url: '/custom/wxUserInfo',
method: 'put',
data: data
})
}
// 删除微信用户
export function delWxUserInfo(openid) {
return request({
url: '/custom/wxUserInfo/' + openid,
method: 'delete'
})
}
// 导出微信用户
export function exportWxUserInfo(query) {
return request({
url: '/custom/wxUserInfo/export',
method: 'get',
params: query
})
}

View File

@ -0,0 +1,53 @@
import request from '@/utils/request'
// 查询微信用户记录列表
export function listWxUserLog(query) {
return request({
url: '/custom/wxUserLog/list',
method: 'get',
params: query
})
}
// 查询微信用户记录详细
export function getWxUserLog(openid) {
return request({
url: '/custom/wxUserLog/' + openid,
method: 'get'
})
}
// 新增微信用户记录
export function addWxUserLog(data) {
return request({
url: '/custom/wxUserLog',
method: 'post',
data: data
})
}
// 修改微信用户记录
export function updateWxUserLog(data) {
return request({
url: '/custom/wxUserLog',
method: 'put',
data: data
})
}
// 删除微信用户记录
export function delWxUserLog(openid) {
return request({
url: '/custom/wxUserLog/' + openid,
method: 'delete'
})
}
// 导出微信用户记录
export function exportWxUserLog(query) {
return request({
url: '/custom/wxUserLog/export',
method: 'get',
params: query
})
}

View File

@ -3,10 +3,10 @@
<el-row> <el-row>
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="70px"> <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="70px">
<el-col :span="6"> <el-col :span="6">
<el-form-item label="订单编号" prop="orderId"> <el-form-item label="手机号" prop="phone">
<el-input <el-input
v-model="queryParams.orderId" v-model="queryParams.phone"
placeholder="请输入订单编号" placeholder="请输入手机号"
clearable clearable
size="small" size="small"
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
@ -197,7 +197,15 @@
</el-row> </el-row>
<el-table v-loading="loading" :data="orderList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="orderList" @selection-change="handleSelectionChange">
<el-table-column label="编号" align="center" prop="orderId" width="150" fixed="left"/> <el-table-column label="订单状态" align="center" prop="orderId" width="80" fixed="left">
<template slot-scope="scope">
<el-tag
:type="scope.row.reviewStatus === '2' ? 'success' : scope.row.status ==='0'? '': 'danger'"
disable-transitions>
{{scope.row.reviewStatus === '2' ? '已完成': scope.row.status ==='0'? '进行中': '已暂停'}}
</el-tag>
</template>
</el-table-column>
<el-table-column label="审核状态" align="center" prop="reviewStatus" width="80" fixed="left"> <el-table-column label="审核状态" align="center" prop="reviewStatus" width="80" fixed="left">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag <el-tag
@ -214,11 +222,16 @@
</el-table-column> </el-table-column>
<el-table-column label="客户姓名" align="center" prop="customer" width="120" fixed="left"/> <el-table-column label="客户姓名" align="center" prop="customer" width="120" fixed="left"/>
<el-table-column label="金额" align="center" prop="amount" width="120" fixed="left"> <el-table-column label="金额" align="center" prop="amount" width="120" fixed="left">
<template scope="scope"> <template slot-scope="scope">
{{toThousands(scope.row.amount)}} {{toThousands(scope.row.amount)}}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="电话" align="center" prop="phone" width="120"/> <el-table-column label="体重" align="center" prop="weight" width="80">
<template slot-scope="scope">
{{scope.row.weight ? `${scope.row.weight}kg` : ''}}
</template>
</el-table-column>
<el-table-column label="手机号" align="center" prop="phone" width="120"/>
<el-table-column label="服务时长" align="center" prop="serveTime" width="80"/> <el-table-column label="服务时长" align="center" prop="serveTime" width="80"/>
<el-table-column label="收款方式" align="center" prop="payType" width="120"/> <el-table-column label="收款方式" align="center" prop="payType" width="120"/>
<el-table-column label="售前" align="center" prop="preSale" width="120"/> <el-table-column label="售前" align="center" prop="preSale" width="120"/>
@ -266,27 +279,32 @@
</pagination> </pagination>
<!-- 添加或修改销售订单对话框 --> <!-- 添加或修改销售订单对话框 -->
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="720px" append-to-body>
<el-row :gutter="15"> <el-row :gutter="15">
<el-form ref="form" :model="form" :rules="rules" label-width="90px"> <el-form ref="form" :model="form" :rules="rules" label-width="90px">
<el-col :span="12"> <el-col :span="8">
<el-form-item label="客户姓名" prop="customer"> <el-form-item label="客户姓名" prop="customer">
<el-input v-model="form.customer" placeholder="请输入客户姓名"/> <el-input v-model="form.customer" placeholder="请输入姓名"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="8">
<el-form-item label="体重" prop="weight">
<el-input v-model="form.weight" placeholder="请输入体重"/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="电话" prop="phone"> <el-form-item label="电话" prop="phone">
<el-input v-model="form.phone" placeholder="请输入电话"/> <el-input v-model="form.phone" placeholder="请输入电话"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="8">
<el-form-item label="金额" prop="amount"> <el-form-item label="成交金额" prop="amount">
<el-input v-model="form.amount" placeholder="请输入金额"/> <el-input v-model="form.amount" placeholder="请输入金额"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="8">
<el-form-item label="收款方式" prop="payTypeId"> <el-form-item label="收款方式" prop="payTypeId">
<el-select v-model="form.payTypeId" placeholder="请选择收款方式"> <el-select v-model="form.payTypeId" placeholder="请选择">
<el-option <el-option
v-for="dict in payTypeIdOptions" v-for="dict in payTypeIdOptions"
:key="dict.dictValue" :key="dict.dictValue"
@ -296,9 +314,9 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="8">
<el-form-item label="账号" prop="accountId"> <el-form-item label="收款账号" prop="accountId">
<el-select v-model="form.accountId" placeholder="请选择账号"> <el-select v-model="form.accountId" placeholder="请选择">
<el-option <el-option
v-for="dict in accountIdOptions" v-for="dict in accountIdOptions"
:key="dict.dictValue" :key="dict.dictValue"
@ -308,9 +326,9 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="8">
<el-form-item label="服务时长" prop="serveTime"> <el-form-item label="服务时长" prop="serveTime">
<el-select v-model="form.serveTimeId" placeholder="请选服务时长"> <el-select v-model="form.serveTimeId" placeholder="请选服">
<el-option <el-option
v-for="dict in serveTimeIdOption" v-for="dict in serveTimeIdOption"
:key="dict.dictValue" :key="dict.dictValue"
@ -320,9 +338,9 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="8">
<el-form-item label="售前" prop="preSaleId"> <el-form-item label="售前" prop="preSaleId">
<el-select v-model="form.preSaleId" placeholder="请选择售前"> <el-select v-model="form.preSaleId" placeholder="请选择">
<el-option <el-option
v-for="dict in preSaleIdOptions" v-for="dict in preSaleIdOptions"
:key="dict.dictValue" :key="dict.dictValue"
@ -332,9 +350,9 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="8">
<el-form-item label="售后" prop="afterSaleId"> <el-form-item label="售后" prop="afterSaleId">
<el-select v-model="form.afterSaleId" placeholder="请选择售后"> <el-select v-model="form.afterSaleId" placeholder="请选择">
<el-option <el-option
v-for="dict in afterSaleIdOptions" v-for="dict in afterSaleIdOptions"
:key="dict.dictValue" :key="dict.dictValue"
@ -344,9 +362,9 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="8">
<el-form-item label="主营养师" prop="nutritionistId"> <el-form-item label="主营养师" prop="nutritionistId">
<el-select v-model="form.nutritionistId" placeholder="请选择主营养师"> <el-select v-model="form.nutritionistId" placeholder="请选择">
<el-option <el-option
v-for="dict in nutritionistIdOptions" v-for="dict in nutritionistIdOptions"
:key="dict.dictValue" :key="dict.dictValue"
@ -356,9 +374,9 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="8">
<el-form-item label="助理营养师" prop="nutriAssisId"> <el-form-item label="助理营养师" prop="nutriAssisId">
<el-select v-model="form.nutriAssisId" placeholder="请选择助理营养师"> <el-select v-model="form.nutriAssisId" placeholder="请选择">
<el-option <el-option
v-for="dict in nutriAssisIdOptions" v-for="dict in nutriAssisIdOptions"
:key="dict.dictValue" :key="dict.dictValue"
@ -368,9 +386,9 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="8">
<el-form-item label="策划" prop="plannerId"> <el-form-item label="策划" prop="plannerId">
<el-select v-model="form.plannerId" placeholder="请选择策划"> <el-select v-model="form.plannerId" placeholder="请选择">
<el-option <el-option
v-for="dict in plannerIdOptions" v-for="dict in plannerIdOptions"
:key="dict.dictValue" :key="dict.dictValue"
@ -380,9 +398,9 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="8">
<el-form-item label="策划助理" prop="plannerAssisId"> <el-form-item label="策划助理" prop="plannerAssisId">
<el-select v-model="form.plannerAssisId" placeholder="请选择策划助理"> <el-select v-model="form.plannerAssisId" placeholder="请选择">
<el-option <el-option
v-for="dict in plannerAssisIdOptions" v-for="dict in plannerAssisIdOptions"
:key="dict.dictValue" :key="dict.dictValue"
@ -392,9 +410,9 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="8">
<el-form-item label="运营" prop="operatorId"> <el-form-item label="运营" prop="operatorId">
<el-select v-model="form.operatorId" placeholder="请选择运营"> <el-select v-model="form.operatorId" placeholder="请选择">
<el-option <el-option
v-for="dict in operatorIdOptions" v-for="dict in operatorIdOptions"
:key="dict.dictValue" :key="dict.dictValue"
@ -404,9 +422,9 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="8">
<el-form-item label="运营助理" prop="operatorAssisId"> <el-form-item label="运营助理" prop="operatorAssisId">
<el-select v-model="form.operatorAssisId" placeholder="请选择运营"> <el-select v-model="form.operatorAssisId" placeholder="请选择">
<el-option <el-option
v-for="dict in operatorAssisIdOptions" v-for="dict in operatorAssisIdOptions"
:key="dict.dictValue" :key="dict.dictValue"
@ -416,11 +434,23 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="8">
<el-form-item label="推荐人" prop="recommender"> <el-form-item label="推荐人" prop="recommender">
<el-input v-model="form.recommender" placeholder="请输入推荐人"/> <el-input v-model="form.recommender" placeholder="请输入推荐人"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8" v-hasPermi="['custom:order:review']">
<el-form-item label="审核状态" prop="reviewStatus">
<el-select v-model="form.reviewStatus" placeholder="请选择审核状态" @change="handleOnRviewChange">
<el-option
v-for="dict in reviewStatusOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="成交时间" prop="orderTime"> <el-form-item label="成交时间" prop="orderTime">
<el-date-picker <el-date-picker
@ -434,16 +464,17 @@
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" v-hasPermi="['custom:order:review']"> <el-col :span="12">
<el-form-item label="审核状态" prop="reviewStatus"> <el-form-item label="开始时间" prop="startTime">
<el-select v-model="form.reviewStatus" placeholder="请选择审核状态" @change="handleOnRviewChange"> <el-date-picker
<el-option style="width: 182.5px"
v-for="dict in reviewStatusOptions" v-model="form.startTime"
:key="dict.dictValue" type="date"
:label="dict.dictLabel" placeholder="选择开始日期"
:value="dict.dictValue" format="yyyy-MM-dd"
/> value-format="yyyy-MM-dd"
</el-select> :picker-options="startPickerOptions">
</el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col> <el-col>
@ -546,18 +577,27 @@
customer: [ customer: [
{required: true, message: "客户姓名不能为空", trigger: "blur"} {required: true, message: "客户姓名不能为空", trigger: "blur"}
], ],
weight: [
{required: true, message: "客户体重不能为空", trigger: "blur"}
],
amount: [ amount: [
{required: true, message: "金额不能为空", trigger: "blur"} {required: true, message: "金额不能为空", trigger: "blur"}
], ],
payTypeId: [ phone: [
{required: true, message: "收款方式不能为空", trigger: "blur"} {required: true, message: "手机号不能为空", trigger: "blur"}
],
accountId: [
{required: true, message: "账号不能为空", trigger: "blur"}
],
serveTimeId: [
{required: true, message: "服务时长不能为空", trigger: "blur"}
], ],
startTime: [
{required: true, message: "开始时间不能为空", trigger: "blur"}
]
// payTypeId: [
// {required: true, message: "", trigger: "blur"}
// ],
// accountId: [
// {required: true, message: "", trigger: "blur"}
// ],
// serveTimeId: [
// {required: true, message: "", trigger: "blur"}
// ],
// reviewStatus: [ // reviewStatus: [
// {trigger: "change", validator: handleOnPreviewChange} // {trigger: "change", validator: handleOnPreviewChange}
// ] // ]
@ -593,6 +633,11 @@
disabledDate(time) { disabledDate(time) {
return time.getTime() > Date.now(); return time.getTime() > Date.now();
}, },
},
startPickerOptions: {
disabledDate(time) {
return time.getTime() < Date.now();
},
} }
}; };
}, },
@ -702,6 +747,9 @@
customer: null, customer: null,
phone: null, phone: null,
amount: null, amount: null,
weight: null,
startTime: dayjs().format("YYYY-MM-DD"),
pauseTime: null,
payTypeId: defaultPayType ? parseInt(defaultPayType.dictValue) : null, payTypeId: defaultPayType ? parseInt(defaultPayType.dictValue) : null,
preSaleId: defaultPresale ? parseInt(defaultPresale.dictValue) : null, preSaleId: defaultPresale ? parseInt(defaultPresale.dictValue) : null,
createBy: null, createBy: null,
@ -771,6 +819,7 @@
} }
}); });
} else { } else {
this.form.status = '0';
addOrder(this.form).then(response => { addOrder(this.form).then(response => {
if (response.code === 200) { if (response.code === 200) {
this.msgSuccess("新增成功"); this.msgSuccess("新增成功");
@ -813,7 +862,30 @@
}, },
handleOnRviewChange(val) { handleOnRviewChange(val) {
this.review = val; this.review = val;
},
handleStatusClick(data) {
console.log(data);
} }
} }
}; };
</script> </script>
<style lang="scss" scoped>
.s_success {
color: #1ab394;
font-size: 22px;
}
.s_pause {
color: #f56c6c;
font-size: 22px;
cursor: pointer;
}
.s_play {
color: #1c84c6;
font-size: 22px;
cursor: pointer;
}
</style>

View File

@ -0,0 +1,391 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="昵称" prop="nickName">
<el-input
v-model="queryParams.nickName"
placeholder="请输入昵称"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="微信应用" prop="appid">
<el-select v-model="queryParams.appid" placeholder="请选择微信应用" clearable size="small">
<el-option
v-for="dict in appidOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
/>
</el-select>
</el-form-item>
<el-form-item label="电话" prop="phone">
<el-input
v-model="queryParams.phone"
placeholder="请输入电话"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="用户性别" prop="sex">
<el-select v-model="queryParams.sex" placeholder="请选择用户性别" clearable size="small">
<el-option
v-for="dict in sexOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="cyan" 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-button-->
<!-- type="primary"-->
<!-- icon="el-icon-plus"-->
<!-- size="mini"-->
<!-- @click="handleAdd"-->
<!-- v-hasPermi="['custom:wxUserInfo:add']"-->
<!-- >新增-->
<!-- </el-button>-->
<!-- </el-col>-->
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="success"-->
<!-- icon="el-icon-edit"-->
<!-- size="mini"-->
<!-- :disabled="single"-->
<!-- @click="handleUpdate"-->
<!-- v-hasPermi="['custom:wxUserInfo:edit']"-->
<!-- >修改-->
<!-- </el-button>-->
<!-- </el-col>-->
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="danger"-->
<!-- icon="el-icon-delete"-->
<!-- size="mini"-->
<!-- :disabled="multiple"-->
<!-- @click="handleDelete"-->
<!-- v-hasPermi="['custom:wxUserInfo:remove']"-->
<!-- >删除-->
<!-- </el-button>-->
<!-- </el-col>-->
<el-col :span="1.5">
<el-button
type="warning"
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['custom:wxUserInfo:export']"
>导出
</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="wxUserInfoList" @selection-change="handleSelectionChange">
<el-table-column label="用户头像" align="center" prop="avatarUrl">
<template slot-scope="scope">
<el-image :src="scope.row.avatarUrl" style="width: 32px; height: 32px; border-radius: 50%"/>
</template>
</el-table-column>
<!-- <el-table-column type="selection" width="55" align="center"/>-->
<!-- <el-table-column label="微信openid" align="center" prop="openid"/>-->
<el-table-column label="昵称" align="center" prop="nickName"/>
<el-table-column label="微信应用" align="center" prop="appid" :formatter="appidFormat"/>
<el-table-column label="电话" align="center" prop="phone"/>
<el-table-column label="用户性别" align="center" prop="sex" :formatter="sexFormat"/>
<el-table-column label="城市" align="center" prop="city"/>
<el-table-column label="省份" align="center" prop="province"/>
<el-table-column label="国家" align="center" prop="country"/>
<el-table-column label="备注" align="center" prop="remark"/>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['custom:wxUserInfo:edit']"
>修改
</el-button>
<!-- <el-button-->
<!-- size="mini"-->
<!-- type="text"-->
<!-- icon="el-icon-delete"-->
<!-- @click="handleDelete(scope.row)"-->
<!-- v-hasPermi="['custom:wxUserInfo:remove']"-->
<!-- >删除-->
<!-- </el-button>-->
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改微信用户对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<!-- <el-form-item label="昵称" prop="nickName">-->
<!-- <el-input v-model="form.nickName" placeholder="请输入昵称"/>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="微信appid" prop="appid">-->
<!-- <el-select v-model="form.appid" placeholder="请选择微信appid">-->
<!-- <el-option-->
<!-- v-for="dict in appidOptions"-->
<!-- :key="dict.dictValue"-->
<!-- :label="dict.dictLabel"-->
<!-- :value="dict.dictValue"-->
<!-- ></el-option>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<el-form-item label="电话" prop="phone">
<el-input v-model="form.phone" placeholder="请输入电话"/>
</el-form-item>
<!-- <el-form-item label="用户头像" prop="avatarUrl">-->
<!-- <el-input v-model="form.avatarUrl" placeholder="请输入用户头像"/>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="用户性别" prop="sex">-->
<!-- <el-select v-model="form.sex" placeholder="请选择用户性别">-->
<!-- <el-option-->
<!-- v-for="dict in sexOptions"-->
<!-- :key="dict.dictValue"-->
<!-- :label="dict.dictLabel"-->
<!-- :value="dict.dictValue"-->
<!-- ></el-option>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="城市" prop="city">-->
<!-- <el-input v-model="form.city" placeholder="请输入城市"/>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="省份" prop="province">-->
<!-- <el-input v-model="form.province" placeholder="请输入省份"/>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="国家" prop="country">-->
<!-- <el-input v-model="form.country" placeholder="请输入国家"/>-->
<!-- </el-form-item>-->
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
listWxUserInfo,
getWxUserInfo,
delWxUserInfo,
addWxUserInfo,
updateWxUserInfo,
exportWxUserInfo
} from "@/api/custom/wxUserInfo";
export default {
name: "WxUserInfo",
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: false,
//
total: 0,
//
wxUserInfoList: [],
//
title: "",
//
open: false,
// appid
appidOptions: [],
//
sexOptions: [],
//
queryParams: {
pageNum: 1,
pageSize: 10,
nickName: null,
appid: null,
phone: null,
sex: null,
},
//
form: {},
//
rules: {}
};
},
created() {
this.getList();
this.getDicts("cus_wx_app").then(response => {
this.appidOptions = response.data;
});
this.getDicts("sys_user_sex").then(response => {
this.sexOptions = response.data;
});
},
methods: {
/** 查询微信用户列表 */
getList() {
this.loading = true;
listWxUserInfo(this.queryParams).then(response => {
this.wxUserInfoList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// appid
appidFormat(row, column) {
return this.selectDictLabel(this.appidOptions, row.appid);
},
//
sexFormat(row, column) {
return this.selectDictLabel(this.sexOptions, row.sex);
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
openid: null,
nickName: null,
appid: null,
phone: null,
avatarUrl: null,
sex: null,
city: null,
province: null,
country: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.openid)
this.single = selection.length !== 1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加微信用户";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const openid = row.openid || this.ids
getWxUserInfo(openid).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改微信用户";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.openid != null) {
updateWxUserInfo(this.form).then(response => {
if (response.code === 200) {
this.msgSuccess("修改成功");
this.open = false;
this.getList();
}
});
} else {
addWxUserInfo(this.form).then(response => {
if (response.code === 200) {
this.msgSuccess("新增成功");
this.open = false;
this.getList();
}
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const openids = row.openid || this.ids;
this.$confirm('是否确认删除微信用户编号为"' + openids + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function () {
return delWxUserInfo(openids);
}).then(() => {
this.getList();
this.msgSuccess("删除成功");
}).catch(function () {
});
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;
this.$confirm('是否确认导出所有微信用户数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function () {
return exportWxUserInfo(queryParams);
}).then(response => {
this.download(response.msg);
}).catch(function () {
});
}
}
};
</script>
<style lang="scss" scoped>
.avatar {
width: 64px;
height: 64px;
border-radius: 50%;
}
</style>

View File

@ -0,0 +1,429 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="微信appid" prop="appid">
<el-select v-model="queryParams.appid" placeholder="请选择微信appid" clearable size="small">
<el-option
v-for="dict in appidOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
/>
</el-select>
</el-form-item>
<el-form-item label="电话" prop="phone">
<el-input
v-model="queryParams.phone"
placeholder="请输入电话"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="cyan" 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-button
type="primary"
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['custom:wxUserLog:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['custom:wxUserLog:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['custom:wxUserLog:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['custom:wxUserLog:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="wxUserLogList" @selection-change="handleSelectionChange">
<el-table-column label="用户头像" align="center" prop="avatarUrl">
<template slot-scope="scope">
<el-image :src="scope.row.avatarUrl" style="width: 32px; height: 32px; border-radius: 50%"/>
</template>
</el-table-column>
<!-- <el-table-column type="selection" width="55" align="center" />-->
<!-- <el-table-column label="微信openid" align="center" prop="openid" />-->
<el-table-column label="体重" align="center" prop="weight" />
<el-table-column label="微信appid" align="center" prop="appid" :formatter="appidFormat" />
<el-table-column label="电话" align="center" prop="phone" />
<el-table-column label="睡觉时间" align="center" prop="sleepTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.sleepTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="起床时间" align="center" prop="wakeupTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.wakeupTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="运动情况" align="center" prop="sport" :formatter="sportFormat" />
<el-table-column label="饮食情况" align="center" prop="diet" :formatter="dietFormat" />
<el-table-column label="熬夜失眠" align="center" prop="insomnia" :formatter="insomniaFormat" />
<el-table-column label="排便情况" align="center" prop="defecation" :formatter="defecationFormat" />
<el-table-column label="饮水量" align="center" prop="water" />
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['custom:wxUserLog:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['custom:wxUserLog:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改微信用户记录对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="体重" prop="weight">
<el-input v-model="form.weight" placeholder="请输入体重" />
</el-form-item>
<el-form-item label="微信appid" prop="appid">
<el-select v-model="form.appid" placeholder="请选择微信appid">
<el-option
v-for="dict in appidOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="电话" prop="phone">
<el-input v-model="form.phone" placeholder="请输入电话" />
</el-form-item>
<el-form-item label="睡觉时间" prop="sleepTime">
<el-date-picker clearable size="small" style="width: 200px"
v-model="form.sleepTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择睡觉时间">
</el-date-picker>
</el-form-item>
<el-form-item label="起床时间" prop="wakeupTime">
<el-date-picker clearable size="small" style="width: 200px"
v-model="form.wakeupTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择起床时间">
</el-date-picker>
</el-form-item>
<el-form-item label="运动情况" prop="sport">
<el-select v-model="form.sport" placeholder="请选择运动情况">
<el-option
v-for="dict in sportOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="parseInt(dict.dictValue)"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="用户头像" prop="avatarUrl">
<el-input v-model="form.avatarUrl" placeholder="请输入用户头像" />
</el-form-item>
<el-form-item label="饮食情况" prop="diet">
<el-select v-model="form.diet" placeholder="请选择饮食情况">
<el-option
v-for="dict in dietOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="parseInt(dict.dictValue)"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="熬夜失眠" prop="insomnia">
<el-select v-model="form.insomnia" placeholder="请选择熬夜失眠">
<el-option
v-for="dict in insomniaOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="排便情况" prop="defecation">
<el-select v-model="form.defecation" placeholder="请选择排便情况">
<el-option
v-for="dict in defecationOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="parseInt(dict.dictValue)"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="饮水量" prop="water">
<el-input v-model="form.water" placeholder="请输入饮水量" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listWxUserLog, getWxUserLog, delWxUserLog, addWxUserLog, updateWxUserLog, exportWxUserLog } from "@/api/custom/wxUserLog";
export default {
name: "WxUserLog",
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
wxUserLogList: [],
//
title: "",
//
open: false,
// appid
appidOptions: [],
//
sportOptions: [],
//
dietOptions: [],
//
insomniaOptions: [],
// 便
defecationOptions: [],
//
queryParams: {
pageNum: 1,
pageSize: 10,
appid: null,
phone: null,
},
//
form: {},
//
rules: {
}
};
},
created() {
this.getList();
this.getDicts("cus_wx_app").then(response => {
this.appidOptions = response.data;
});
this.getDicts("sys_yes_no").then(response => {
this.sportOptions = response.data;
});
this.getDicts("sys_yes_no").then(response => {
this.dietOptions = response.data;
});
this.getDicts("sys_yes_no").then(response => {
this.insomniaOptions = response.data;
});
this.getDicts("sys_yes_no").then(response => {
this.defecationOptions = response.data;
});
},
methods: {
/** 查询微信用户记录列表 */
getList() {
this.loading = true;
listWxUserLog(this.queryParams).then(response => {
this.wxUserLogList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// appid
appidFormat(row, column) {
return this.selectDictLabel(this.appidOptions, row.appid);
},
//
sportFormat(row, column) {
return this.selectDictLabel(this.sportOptions, row.sport);
},
//
dietFormat(row, column) {
return this.selectDictLabel(this.dietOptions, row.diet);
},
//
insomniaFormat(row, column) {
return this.selectDictLabel(this.insomniaOptions, row.insomnia);
},
// 便
defecationFormat(row, column) {
return this.selectDictLabel(this.defecationOptions, row.defecation);
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
openid: null,
weight: null,
appid: null,
phone: null,
sleepTime: null,
wakeupTime: null,
sport: null,
avatarUrl: null,
diet: null,
insomnia: null,
defecation: null,
water: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.openid)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加微信用户记录";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const openid = row.openid || this.ids
getWxUserLog(openid).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改微信用户记录";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.openid != null) {
updateWxUserLog(this.form).then(response => {
if (response.code === 200) {
this.msgSuccess("修改成功");
this.open = false;
this.getList();
}
});
} else {
addWxUserLog(this.form).then(response => {
if (response.code === 200) {
this.msgSuccess("新增成功");
this.open = false;
this.getList();
}
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const openids = row.openid || this.ids;
this.$confirm('是否确认删除微信用户记录编号为"' + openids + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
return delWxUserLog(openids);
}).then(() => {
this.getList();
this.msgSuccess("删除成功");
}).catch(function() {});
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;
this.$confirm('是否确认导出所有微信用户记录数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
return exportWxUserLog(queryParams);
}).then(response => {
this.download(response.msg);
}).catch(function() {});
}
}
};
</script>