init
This commit is contained in:
+75
@@ -0,0 +1,75 @@
|
||||
package io.v.nutz.zhgh.psychology.controller;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.wizzer.framework.base.Result;
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.service.BaseService;
|
||||
import io.v.nutz.base.utils.MsgApi;
|
||||
import io.v.nutz.zhgh.psychology.models.PsychologyAppointmentInfo;
|
||||
import io.v.nutz.sys.models.Sys_user;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Map;
|
||||
|
||||
@IocBean
|
||||
@At("/platform/psychology/appointmentApply")
|
||||
@Ok("json:full")
|
||||
public class PsychologyAppointmentApplyController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
|
||||
@Inject
|
||||
private BaseService baseService;
|
||||
|
||||
@Inject
|
||||
private MsgApi msgApi;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/psychology/appointmentApply.html")
|
||||
@RequiresPermissions("psychology.appointmentApply")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("psychology.appointmentApply")
|
||||
public Object doApply(String id, String appointmentUserNote, String appointmentAskTypeValue) {
|
||||
PsychologyAppointmentInfo info = dao.fetch(PsychologyAppointmentInfo.class, id);
|
||||
if (StrUtil.isNotBlank(info.getAppointmentUser())) {
|
||||
return Result.error(2, "该时段刚刚已经被人预约过了喔!");
|
||||
}
|
||||
info.setAppointmentUserNote(appointmentUserNote);
|
||||
info.setAppointmentUser((String) ShiroUtil.getPrincipalProperty("id"));
|
||||
info.setAppointmentAskTypeValue(appointmentAskTypeValue);
|
||||
//info.setStateId(2100);
|
||||
info.setStateId(2300);
|
||||
int update = dao.update(info);
|
||||
if (update > 0) {
|
||||
Sys_user doctorUser = dao.fetch(Sys_user.class, info.getDoctorUser());
|
||||
Sys_user applyUser = dao.fetch(Sys_user.class, info.getAppointmentUser());
|
||||
String content = "%s老师您好,%s老师预约了%s至%s的心理咨询!"
|
||||
.formatted(doctorUser.getUsername(), applyUser.getUsername(), info.getStartTime(), info.getEndTime());
|
||||
ArrayList<Map> list2 = new ArrayList<>();
|
||||
list2.add(Map.of("type", "User", "userId", doctorUser.getLoginname(), "name", doctorUser.getUsername()));
|
||||
// msgApi.sendMsg(content, list2, "心理咨询", "WeChat", MsgApi.sendMode.normal.name());
|
||||
|
||||
String contentAdmin = "%s老师预约了%s至%s的心理咨询!"
|
||||
.formatted(applyUser.getUsername(), info.getStartTime(), info.getEndTime());
|
||||
ArrayList<Map> list1 = new ArrayList<>();
|
||||
list1.add(Map.of("type", "User", "userId", "02449", "name", "金自如"));
|
||||
list1.add(Map.of("type", "User", "userId", "80141", "name", "朱汇博"));
|
||||
// msgApi.sendMsg(contentAdmin, list1, "心理咨询", "WeChat", MsgApi.sendMode.normal.name());
|
||||
}
|
||||
return Result.success().addMsg("预约成功!");
|
||||
}
|
||||
|
||||
}
|
||||
+102
@@ -0,0 +1,102 @@
|
||||
package io.v.nutz.zhgh.psychology.controller;
|
||||
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.service.BaseService;
|
||||
import io.v.nutz.base.query.PageForm;
|
||||
import io.v.nutz.zhgh.psychology.models.PsychologyAppointmentInfo;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.nutz.dao.Chain;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
/**
|
||||
* 我的申请列表
|
||||
*/
|
||||
@IocBean
|
||||
@At("/platform/psychology/appointment/applyList")
|
||||
@Ok("json:full")
|
||||
public class PsychologyAppointmentApplyList {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
|
||||
@Inject
|
||||
private BaseService baseService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/psychology/applyList.html")
|
||||
@RequiresPermissions("psychology.appointment.applyList")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("psychology.appointment.applyList")
|
||||
public Object pageData(PageForm page,
|
||||
@Param(value = "year", required = false) Integer year,
|
||||
@Param(value = "stateId", required = false) Integer stateId) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
pai.*,
|
||||
au.username AS appointmentUserName,
|
||||
au.loginname AS appointmentLoginName,
|
||||
au.unitname AS appointmentUnitName,
|
||||
au.mobile AS appointmentMobile,
|
||||
au.sex AS appointmentSex,
|
||||
pd.specialty AS doctorSpecialty,
|
||||
pd.introduce AS doctorIntroduce,
|
||||
pd.sex AS doctorSex,
|
||||
pd.jobTitle AS doctorJobTitle,
|
||||
pd.unitName AS doctorUnitName,
|
||||
pd.avatar AS doctorAvatar,
|
||||
pd.mobile AS doctorMobile,
|
||||
doctor.username AS doctorUserName,
|
||||
state.stateName,
|
||||
state.stateColor
|
||||
FROM
|
||||
`psychology_appointment_info` pai
|
||||
LEFT JOIN `user` au ON au.id = pai.appointmentUser
|
||||
LEFT JOIN psychology_doctor pd ON pd.userid = pai.doctorUser
|
||||
LEFT JOIN sys_user doctor ON doctor.id = pai.doctorUser
|
||||
LEFT JOIN audit_state state ON state.stateId = pai.stateId
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("pai.appointmentUser", "IS NOT", null);
|
||||
if (!ShiroUtil.hasRole("sysadmin")) {
|
||||
cnd.and("pai.appointmentUser", "=", ShiroUtil.getPrincipalProperty("id"));
|
||||
}
|
||||
cnd.andEX("YEAR(pai.startTime)", "=", year);
|
||||
cnd.andEX("pai.stateId", "=", stateId);
|
||||
cnd.desc("pai.startTime");
|
||||
sql.setCondition(cnd);
|
||||
return baseService.listPageMap(page.getPageNumber(), page.getPageSize(), sql);
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消预约
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("psychology.appointment.applyList")
|
||||
public Object doCancel(String id) {
|
||||
Chain cancelChain = Chain.make("appointmentUser", null);
|
||||
cancelChain.add("appointmentUserNote", null);
|
||||
cancelChain.add("stateId", null);
|
||||
//cancelChain.add("doctorUser", null).add("stateId", null);
|
||||
dao.update(PsychologyAppointmentInfo.class, cancelChain, Cnd.where("id", "=", id));
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
+249
@@ -0,0 +1,249 @@
|
||||
package io.v.nutz.zhgh.psychology.controller;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.page.Pagination;
|
||||
import io.v.nutz.base.service.BaseService;
|
||||
import io.v.nutz.base.utils.DateUtil;
|
||||
import io.v.nutz.base.utils.MsgApi;
|
||||
import io.v.nutz.zhgh.psychology.models.PsychologyAppointmentInfo;
|
||||
import io.v.nutz.zhgh.psychology.models.PsychologyMsg;
|
||||
import io.v.nutz.sys.models.Sys_user;
|
||||
import org.apache.shiro.authz.annotation.Logical;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.nutz.dao.Chain;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.Lang;
|
||||
import org.nutz.lang.Strings;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 预约时间设置
|
||||
*/
|
||||
@IocBean
|
||||
@At("/platform/psychology/appointmentSet")
|
||||
@Ok("json:full")
|
||||
public class PsychologyAppointmentSetController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
|
||||
@Inject
|
||||
private BaseService baseService;
|
||||
|
||||
@Inject
|
||||
private MsgApi msgApi;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/psychology/appointmentSet.html")
|
||||
@RequiresPermissions("psychology.appointmentSet")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询时间段内的预约信息
|
||||
*
|
||||
* @param startTimeTs
|
||||
* @param endTimeTs
|
||||
* @return
|
||||
*/
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions(value = {"psychology.appointmentSet", "psychology.appointmentApply", "psychology.appointment.applyList"}, logical = Logical.OR)
|
||||
public Object getAppointmentInfo(Long startTimeTs, Long endTimeTs) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("startTimeTs", ">=", startTimeTs);
|
||||
cnd.and("endTimeTs", "<=", endTimeTs);
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
pai.*,
|
||||
au.username AS appointmentUserName,
|
||||
au.loginname AS appointmentLoginName,
|
||||
au.unitname AS appointmentUnitName,
|
||||
au.mobile AS appointmentMobile,
|
||||
au.sex AS appointmentSex,
|
||||
pd.specialty AS doctorSpecialty,
|
||||
pd.introduce AS doctorIntroduce,
|
||||
pd.sex AS doctorSex,
|
||||
pd.jobTitle AS doctorJobTitle,
|
||||
pd.unitName AS doctorUnitName,
|
||||
pd.avatar AS doctorAvatar,
|
||||
pd.mobile AS doctorMobile,
|
||||
doctor.username AS doctorUserName,
|
||||
state.stateName,
|
||||
state.stateColor
|
||||
FROM
|
||||
`psychology_appointment_info` pai
|
||||
LEFT JOIN `user` au ON au.id = pai.appointmentUser
|
||||
LEFT JOIN psychology_doctor pd ON pd.userid = pai.doctorUser
|
||||
LEFT JOIN sys_user doctor ON doctor.id = pai.doctorUser
|
||||
LEFT JOIN audit_state state ON state.stateId = pai.stateId
|
||||
$condition
|
||||
""");
|
||||
sql.setCondition(cnd);
|
||||
return baseService.listMap(sql);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增预约时间段 安排咨询师
|
||||
* @param appointmentInfo
|
||||
* @return
|
||||
*/
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("psychology.appointmentSet")
|
||||
public Object doAdd(PsychologyAppointmentInfo appointmentInfo) {
|
||||
long startTimeTs = DateUtil.formatDate(appointmentInfo.getStartTime());
|
||||
long endTimeTs = DateUtil.formatDate(appointmentInfo.getEndTime());
|
||||
|
||||
List<PsychologyAppointmentInfo> list = new ArrayList<>();
|
||||
for (long i = startTimeTs; i < endTimeTs; i = i + 3600000) {
|
||||
|
||||
PsychologyAppointmentInfo app = new PsychologyAppointmentInfo();
|
||||
PsychologyAppointmentInfo psychologyAppointmentInfo = Lang.copyProperties(appointmentInfo, app);
|
||||
|
||||
String start = DateUtil.getDate(i / 1000);
|
||||
long e = i + 3600000;
|
||||
|
||||
if ((endTimeTs - e) <= 0) {
|
||||
e = i + (endTimeTs - i);
|
||||
}
|
||||
String end = DateUtil.getDate(e / 1000);
|
||||
|
||||
psychologyAppointmentInfo.setStartTimeTs(i);
|
||||
psychologyAppointmentInfo.setEndTimeTs(e);
|
||||
psychologyAppointmentInfo.setStartTime(start);
|
||||
psychologyAppointmentInfo.setEndTime(end);
|
||||
list.add(psychologyAppointmentInfo);
|
||||
}
|
||||
|
||||
dao.insert(list);
|
||||
return null;
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("psychology.appointmentSet")
|
||||
public Object doDelete(String id) {
|
||||
PsychologyAppointmentInfo info = dao.fetch(PsychologyAppointmentInfo.class, id);
|
||||
int rows = dao.clear(PsychologyAppointmentInfo.class, Cnd.where("id", "=", id));
|
||||
if (rows > 0) {
|
||||
Sys_user doctorUser = dao.fetch(Sys_user.class, info.getDoctorUser());
|
||||
if (Strings.isNotBlank(info.getAppointmentUser())) {
|
||||
Sys_user applyUser = dao.fetch(Sys_user.class, info.getAppointmentUser());
|
||||
String content = "%s老师您好,关于%s老师%s至%s时间段的心理咨询安排已被取消,请您知悉!"
|
||||
.formatted(applyUser.getUsername(), doctorUser.getUsername(), info.getStartTime(), info.getEndTime());
|
||||
ArrayList<Map> list2 = new ArrayList<>();
|
||||
list2.add(Map.of("type", "User", "userId", applyUser.getLoginname(), "name", applyUser.getUsername()));
|
||||
// msgApi.sendMsg(content, list2, "心理咨询", "WeChat", MsgApi.sendMode.normal.name());
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("psychology.appointmentSet")
|
||||
public Object selectQueryDoctorUser(String keyWord, long startTimeTs, long endTimeTs) {
|
||||
//先查询该时间段没时间的咨询师
|
||||
Sql doctorSql = Sqls.create("""
|
||||
SELECT
|
||||
pd.userid AS id,
|
||||
u.username AS doctorUserName,
|
||||
replace(pd.mobile,' ','') as mobile
|
||||
FROM
|
||||
psychology_doctor pd
|
||||
LEFT JOIN sys_user u ON u.id = pd.userid
|
||||
WHERE
|
||||
pd.userid NOT IN
|
||||
(
|
||||
SELECT doctorUser FROM psychology_appointment_info
|
||||
WHERE startTimeTs >= @startTimeTs AND endTimeTs <= @endTimeTs
|
||||
AND doctorUser IS NOT NULL
|
||||
)
|
||||
and u.username like @username
|
||||
""");
|
||||
doctorSql.setParam("startTimeTs", startTimeTs);
|
||||
doctorSql.setParam("endTimeTs", endTimeTs);
|
||||
doctorSql.setParam("username", "%" + keyWord + "%");
|
||||
Pagination pagination = baseService.listPageMap(1, 10, doctorSql);
|
||||
return pagination.getList();
|
||||
}
|
||||
|
||||
/**
|
||||
* 分配心理咨询师
|
||||
*
|
||||
* @param id
|
||||
* @param doctorUser
|
||||
* @return
|
||||
*/
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("psychology.appointmentSet")
|
||||
public Object doSetDoctor(String id, String doctorUser) {
|
||||
Chain chain = Chain.make("doctorUser", doctorUser);
|
||||
|
||||
PsychologyAppointmentInfo appointmentInfo = dao.fetch(PsychologyAppointmentInfo.class, Cnd.where("id", "=", id));
|
||||
|
||||
if (StrUtil.isNotBlank(appointmentInfo.getAppointmentUser())) {
|
||||
chain.add("stateId", 2300);
|
||||
}
|
||||
|
||||
dao.update(PsychologyAppointmentInfo.class, chain, Cnd.where("id", "=", id));
|
||||
return null;
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("psychology.appointmentSet")
|
||||
public Object getIsSendMsg() {
|
||||
PsychologyMsg psychologyMsg = dao.fetch(PsychologyMsg.class);
|
||||
return psychologyMsg != null && psychologyMsg.getIsSendMsg();
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("psychology.appointmentSet")
|
||||
public Object msgChange(Boolean isSend) {
|
||||
PsychologyMsg psychologyMsg = dao.fetch(PsychologyMsg.class);
|
||||
if (psychologyMsg == null) {
|
||||
psychologyMsg = new PsychologyMsg();
|
||||
}
|
||||
psychologyMsg.setIsSendMsg(isSend);
|
||||
dao.insertOrUpdate(psychologyMsg);
|
||||
return null;
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("psychology.appointmentSet")
|
||||
public Object updateType(String id, String[] askType) {
|
||||
|
||||
PsychologyAppointmentInfo info = dao.fetch(PsychologyAppointmentInfo.class, id);
|
||||
info.setAskType(askType != null ? Arrays.asList(askType) : new ArrayList<>());
|
||||
info.setAppointmentAskTypeValue("");
|
||||
int update = dao.update(info);
|
||||
if (Strings.isNotBlank(info.getAppointmentUser()) && update > 0) {
|
||||
//给预约人发短信
|
||||
Sys_user applyUser = dao.fetch(Sys_user.class, info.getAppointmentUser());
|
||||
Sys_user doctorUser = dao.fetch(Sys_user.class, info.getDoctorUser());
|
||||
String content = "%s老师您好,由于特殊情况,您预约的%s老师%s至%s的心理咨询方式已变更,请您登陆智慧工会修改咨询方式,给您造成不便敬请谅解,祝您工作生活愉快!"
|
||||
.formatted(applyUser.getUsername(), doctorUser.getUsername(), info.getStartTime(), info.getEndTime());
|
||||
ArrayList<Map> list1 = new ArrayList<>();
|
||||
list1.add(Map.of("type", "User", "userId", applyUser.getLoginname(), "name", applyUser.getUsername()));
|
||||
// msgApi.sendMsg(content, list1, "心理咨询", "WeChat", MsgApi.sendMode.normal.name());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
+119
@@ -0,0 +1,119 @@
|
||||
package io.v.nutz.zhgh.psychology.controller;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.wizzer.framework.base.Result;
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.query.PageForm;
|
||||
import io.v.nutz.base.service.BaseService;
|
||||
import io.v.nutz.sys.models.Sys_user_role;
|
||||
import io.v.nutz.zhgh.psychology.models.PsychologyDoctor;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.trans.Trans;
|
||||
|
||||
/**
|
||||
* 心理咨询 咨询师管理
|
||||
*/
|
||||
@IocBean
|
||||
@At("/platform/psychology/doctorManager")
|
||||
@Ok("json:full")
|
||||
public class PsychologyDoctorManageController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
|
||||
@Inject
|
||||
private BaseService baseService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/psychology/doctorManager.html")
|
||||
@RequiresPermissions("psychology.doctor.manage")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加咨询师
|
||||
*
|
||||
* @param psychologyDoctor
|
||||
* @return
|
||||
*/
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("psychology.doctor.manage")
|
||||
public Object doAdd(PsychologyDoctor psychologyDoctor) {
|
||||
if (dao.count(PsychologyDoctor.class, Cnd.where("userid", "=", psychologyDoctor.getUserid())) > 0) {
|
||||
return Result.error(2, "不能重复录入!");
|
||||
}
|
||||
Trans.exec(() -> {
|
||||
dao.insert(psychologyDoctor);
|
||||
Sys_user_role role = new Sys_user_role();
|
||||
role.setUserId(psychologyDoctor.getId());
|
||||
role.setRoleId("1063009510c747b8ad81c0441cd5713b");
|
||||
dao.insert(role);
|
||||
});
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑咨询师信息
|
||||
*
|
||||
* @param psychologyDoctor
|
||||
* @return
|
||||
*/
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("psychology.doctor.manage")
|
||||
public Object doEdit(PsychologyDoctor psychologyDoctor) {
|
||||
Trans.exec(() -> {
|
||||
dao.updateIgnoreNull(psychologyDoctor);
|
||||
});
|
||||
return null;
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("psychology.doctor.manage")
|
||||
public Object pageData(PageForm pageForm) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (StrUtil.isNotBlank(pageForm.getSearchName())) {
|
||||
cnd.and(Cnd.likeEX(pageForm.getSearchName(), pageForm.getSearchKeyword()));
|
||||
}
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
pd.*,
|
||||
u.username,
|
||||
u.loginname
|
||||
FROM
|
||||
psychology_doctor pd
|
||||
left join `user` u on u.id = pd.userid
|
||||
$condition
|
||||
""");
|
||||
sql.setCondition(cnd);
|
||||
return baseService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除咨询师
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("psychology.doctor.manage")
|
||||
public Object doDelete(String id) {
|
||||
Trans.exec(() -> {
|
||||
PsychologyDoctor psychologyDoctor = dao.fetch(PsychologyDoctor.class, id);
|
||||
dao.clear(Sys_user_role.class, Cnd.where("userid", "=", psychologyDoctor.getUserid()).and("roleid", "=", "1063009510c747b8ad81c0441cd5713b"));
|
||||
dao.clear(PsychologyDoctor.class, Cnd.where("id", "=", id));
|
||||
});
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
package io.v.nutz.zhgh.psychology.controller;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.query.PageForm;
|
||||
import io.v.nutz.base.service.BaseService;
|
||||
import io.v.nutz.sys.models.Sys_user_role;
|
||||
import io.v.nutz.zhgh.psychology.models.PsychologyDoctor;
|
||||
import io.v.nutz.zhgh.psychology.models.PsychologyNotice;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
import org.nutz.trans.Trans;
|
||||
|
||||
/**
|
||||
* 预约通知安排
|
||||
*/
|
||||
@IocBean
|
||||
@At("/platform/psychology/notice")
|
||||
@Ok("json:full")
|
||||
public class PsychologyNoticeController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private BaseService baseService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/psychology/notice.html")
|
||||
@RequiresPermissions("psychology.notice")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("psychology.notice.insert")
|
||||
public Object doAdd(@Param("notice") PsychologyNotice psychologyNotice) {
|
||||
dao.insert(psychologyNotice);
|
||||
return null;
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("psychology.notice.update")
|
||||
public Object doEdit(@Param("notice") PsychologyNotice psychologyNotice) {
|
||||
dao.updateIgnoreNull(psychologyNotice);
|
||||
return null;
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("psychology.notice")
|
||||
public Object pageData(PageForm pageForm) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if(StrUtil.isNotBlank(pageForm.getSearchKeyword())){
|
||||
cnd.where().andLike("title",pageForm.getSearchKeyword());
|
||||
}
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
pn.*
|
||||
FROM
|
||||
psychology_notice pn
|
||||
$condition
|
||||
""");
|
||||
sql.setCondition(cnd);
|
||||
return baseService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("psychology.notice.delete")
|
||||
public Object doDelete(String id) {
|
||||
dao.delete(PsychologyNotice.class,id);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
+158
@@ -0,0 +1,158 @@
|
||||
package io.v.nutz.zhgh.psychology.controller.onlinePost;
|
||||
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.page.Pagination;
|
||||
import io.v.nutz.base.service.BaseService;
|
||||
import io.v.nutz.base.utils.DateUtil;
|
||||
import io.v.nutz.base.query.PageForm;
|
||||
import io.v.nutz.zhgh.psychology.models.PsychologyOnlinePosts;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.nutz.dao.Chain;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 线上心理咨询
|
||||
*/
|
||||
@IocBean
|
||||
@At("/platform/psychology/onlinePost")
|
||||
@Ok("json:full")
|
||||
public class PsychologyOnlinePostController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
|
||||
@Inject
|
||||
private BaseService baseService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/psychology/onlinePost/post.html")
|
||||
@RequiresPermissions("psychology.onlinepost")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("psychology.onlinepost")
|
||||
public Object pageData(PageForm page, @Param(value = "year",required = false) Integer year,
|
||||
@Param(value = "isReply",required = false) String isReply) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
pop.*,
|
||||
poster.username AS posterUserName,
|
||||
poster.loginname AS posterLoginName,
|
||||
IF( count( popr.id ) = 0, false, true ) AS isReply
|
||||
FROM
|
||||
psychology_online_posts pop
|
||||
LEFT JOIN sys_user poster on poster.id = pop.poster
|
||||
LEFT JOIN psychology_online_posts_reply popr on popr.postId = pop.id
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (!ShiroUtil.hasRole("sysadmin")) {
|
||||
cnd.and("poster", "=", ShiroUtil.getPrincipalProperty("id"));
|
||||
}
|
||||
cnd.andEX("YEAR(pop.postingTime)", "=", year);
|
||||
cnd.groupBy("pop.id");
|
||||
switch (isReply) {
|
||||
case "true" -> cnd.having(Cnd.where("count(popr.id)", ">", 0));
|
||||
case "false" -> cnd.having(Cnd.where("count(popr.id)", "=", 0));
|
||||
}
|
||||
sql.setCondition(cnd);
|
||||
Pagination pagination = baseService.listPageMap(page.getPageNumber(), page.getPageSize(), sql);
|
||||
List<NutMap> list = pagination.getList(NutMap.class);
|
||||
list.forEach(v -> {
|
||||
String postId = v.getString("id");
|
||||
Sql replySql = Sqls.create("""
|
||||
SELECT
|
||||
popr.*,
|
||||
u.username AS replyUserName
|
||||
FROM
|
||||
psychology_online_posts_reply popr
|
||||
LEFT JOIN sys_user u ON u.id = popr.replyUser
|
||||
WHERE
|
||||
postId = @postId
|
||||
""").setParam("postId", postId);
|
||||
replySql.setCallback(Sqls.callback.maps());
|
||||
dao.execute(replySql);
|
||||
List<NutMap> replyList = replySql.getList(NutMap.class);
|
||||
v.setv("replyList", replyList);
|
||||
});
|
||||
pagination.setList(list);
|
||||
return pagination;
|
||||
}
|
||||
|
||||
/**
|
||||
* 发布咨询
|
||||
*
|
||||
* @param posts
|
||||
* @return
|
||||
*/
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("psychology.onlinepost")
|
||||
public Object doAdd(PsychologyOnlinePosts posts) {
|
||||
posts.setPoster((String) ShiroUtil.getPrincipalProperty("id"));
|
||||
posts.setPostingTime(DateUtil.getDateTime());
|
||||
dao.insert(posts);
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param posts
|
||||
* @return
|
||||
*/
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("psychology.onlinepost")
|
||||
public Object doEdit(PsychologyOnlinePosts posts) {
|
||||
dao.updateIgnoreNull(posts);
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("psychology.onlinepost")
|
||||
public Object doDelete(String id) {
|
||||
dao.clear(PsychologyOnlinePosts.class, Cnd.where("id", "=", id));
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 咨询师回复
|
||||
*
|
||||
* @param id
|
||||
* @param replyContent
|
||||
* @return
|
||||
*/
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("psychology.onlinepost")
|
||||
public Object doReply(String id, String replyContent) {
|
||||
Chain chain = Chain.make("replyContent", replyContent);
|
||||
chain.add("replyTime", DateUtil.getDateTime());
|
||||
chain.add("replyUser", ShiroUtil.getPrincipalProperty("id"));
|
||||
dao.update(PsychologyOnlinePosts.class, chain, Cnd.where("id", "=", id));
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
+107
@@ -0,0 +1,107 @@
|
||||
package io.v.nutz.zhgh.psychology.controller.onlinePost;
|
||||
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.page.Pagination;
|
||||
import io.v.nutz.base.service.BaseService;
|
||||
import io.v.nutz.base.utils.DateUtil;
|
||||
import io.v.nutz.base.query.PageForm;
|
||||
import io.v.nutz.zhgh.psychology.models.PsychologyOnlinePostsReply;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@IocBean
|
||||
@At("/platform/psychology/onlinePostReply")
|
||||
@Ok("json:full")
|
||||
public class PsychologyOnlinePostReplyController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
|
||||
@Inject
|
||||
private BaseService baseService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/psychology/onlinePost/reply.html")
|
||||
@RequiresPermissions("psychology.onlinepost.reply")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("psychology.onlinepost.reply")
|
||||
public Object pageData(PageForm page, @Param(value = "year",required = false) Integer year,
|
||||
@Param(value = "isReply",required = false) String isReply) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
pop.*,
|
||||
CONCAT(LEFT(poster.username,1),'**') AS posterUserName,
|
||||
count( popr.id ) AS replyCount
|
||||
FROM
|
||||
psychology_online_posts pop
|
||||
LEFT JOIN sys_user poster ON poster.id = pop.poster
|
||||
LEFT JOIN psychology_online_posts_reply popr ON popr.postId = pop.id
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.andEX("YEAR(pop.postingTime)", "=", year);
|
||||
cnd.groupBy("pop.id");
|
||||
switch (isReply) {
|
||||
case "true" -> cnd.having(Cnd.where("count(popr.id)", ">", 0));
|
||||
case "false" -> cnd.having(Cnd.where("count(popr.id)", "=", 0));
|
||||
}
|
||||
sql.setCondition(cnd);
|
||||
Pagination pagination = baseService.listPageMap(page.getPageNumber(), page.getPageSize(), sql);
|
||||
List<NutMap> list = pagination.getList(NutMap.class);
|
||||
list.forEach(v -> {
|
||||
String postId = v.getString("id");
|
||||
Sql replySql = Sqls.create("""
|
||||
SELECT
|
||||
popr.*,
|
||||
CONCAT(LEFT(u.username,1),'**') AS replyUserName
|
||||
FROM
|
||||
psychology_online_posts_reply popr
|
||||
LEFT JOIN sys_user u ON u.id = popr.replyUser
|
||||
WHERE
|
||||
postId = @postId
|
||||
""").setParam("postId", postId);
|
||||
replySql.setCallback(Sqls.callback.maps());
|
||||
dao.execute(replySql);
|
||||
List<NutMap> replyList = replySql.getList(NutMap.class);
|
||||
v.setv("replyList", replyList);
|
||||
});
|
||||
pagination.setList(list);
|
||||
return pagination;
|
||||
}
|
||||
|
||||
/**
|
||||
* 回复咨询
|
||||
* @param postId
|
||||
* @param replyContent
|
||||
* @return
|
||||
*/
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("psychology.onlinepost.reply")
|
||||
public Object doReply(String postId, String replyContent) {
|
||||
PsychologyOnlinePostsReply postsReply = new PsychologyOnlinePostsReply();
|
||||
postsReply.setPostId(postId);
|
||||
postsReply.setReplyTime(DateUtil.getDateTime());
|
||||
postsReply.setReplyContent(replyContent);
|
||||
postsReply.setReplyUser((String) ShiroUtil.getPrincipalProperty("id"));
|
||||
dao.insert(postsReply);
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
+156
@@ -0,0 +1,156 @@
|
||||
package io.v.nutz.zhgh.psychology.controller.statistics;
|
||||
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.service.BaseService;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@IocBean
|
||||
@At("/platform/psychology/statistics")
|
||||
@Ok("json:full")
|
||||
public class PsychologyStatisticsController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
|
||||
@Inject
|
||||
private BaseService baseService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/psychology/statistics/apply.html")
|
||||
@RequiresPermissions("psychology.statistics")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("psychology.statistics")
|
||||
public Object getData(@Param(value = "year",required = false) Integer year) {
|
||||
//查询一共开放了多少次预约场次 预约成功的场次
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
count( 1 ) AS total,
|
||||
count( CASE stateId WHEN 2300 THEN 1 END ) AS successNum
|
||||
FROM
|
||||
psychology_appointment_info
|
||||
$condition
|
||||
""");
|
||||
sql.setCondition(Cnd.NEW().andEX("YEAR(startTime)", "=", year));
|
||||
sql.setCallback(Sqls.callback.map());
|
||||
dao.execute(sql);
|
||||
NutMap numberSessionMap = (NutMap) sql.getResult();
|
||||
|
||||
//为多少教师服务过
|
||||
Sql serviceTeacherSql = Sqls.create("""
|
||||
SELECT
|
||||
COUNT(pai.appointmentUser)
|
||||
FROM
|
||||
psychology_appointment_info pai
|
||||
WHERE
|
||||
pai.stateId = 2300
|
||||
""");
|
||||
serviceTeacherSql.setCallback(Sqls.callback.longValue());
|
||||
dao.execute(serviceTeacherSql);
|
||||
long serviceTeacherCount = (long) serviceTeacherSql.getResult();
|
||||
|
||||
Sql unionSql = Sqls.create("""
|
||||
SELECT
|
||||
gh.id,
|
||||
gh.unionname AS unionName,
|
||||
gh.unioncode AS unionCode,
|
||||
count( pai.appointmentUser ) AS userNum
|
||||
FROM
|
||||
sys_union gh
|
||||
LEFT JOIN `user` u ON u.unionid = gh.id
|
||||
LEFT JOIN psychology_appointment_info pai ON pai.appointmentUser = u.id
|
||||
$condition
|
||||
""");
|
||||
|
||||
unionSql.setCondition(Cnd.NEW().andEX("pai.stateId", "=", 2300).andEX("YEAR(pai.startTime)", "=", year)
|
||||
.groupBy("gh.id").asc("gh.unioncode"));
|
||||
|
||||
List unionList = baseService.listMap(unionSql);
|
||||
|
||||
Sql doctorSql = Sqls.create("""
|
||||
SELECT
|
||||
pd.userId,
|
||||
u.username AS doctorUserName,
|
||||
pd.sex,
|
||||
pd.jobTitle,
|
||||
(select count(*) from psychology_appointment_info ai where ai.doctorUser = pd.userid and ai.stateId='2300') AS serviceNum
|
||||
FROM
|
||||
psychology_doctor pd
|
||||
LEFT JOIN sys_user u ON u.id = pd.userid
|
||||
LEFT JOIN psychology_appointment_info pai ON pai.doctorUser = pd.userid
|
||||
$condition
|
||||
""");
|
||||
doctorSql.setCondition(Cnd.NEW().andEX("YEAR(pai.startTime)", "=", year)
|
||||
.groupBy("pd.userid").desc("serviceNum"));
|
||||
List doctorList = baseService.listMap(doctorSql);
|
||||
|
||||
return Map.of(
|
||||
"numberSessionMap", numberSessionMap,
|
||||
"unionList", unionList,
|
||||
"doctorList", doctorList,
|
||||
"serviceTeacherCount", serviceTeacherCount);
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("psychology.statistics")
|
||||
public Object tableChangeData(@Param(value = "year",required = false) Integer year,
|
||||
@Param(value = "tableIndex",required = false) Integer tableIndex,
|
||||
@Param(value = "doctorUser",required = false) String doctorUser) {
|
||||
Sql sql = null;
|
||||
if (tableIndex == 1) {
|
||||
sql = Sqls.create("""
|
||||
SELECT
|
||||
pd.userId,
|
||||
u.username AS doctorUserName,
|
||||
pd.sex,
|
||||
pd.jobTitle,
|
||||
(select count(*) from psychology_appointment_info ai where ai.doctorUser = pd.userid and ai.stateId='2300') AS serviceNum
|
||||
FROM
|
||||
psychology_doctor pd
|
||||
LEFT JOIN sys_user u ON u.id = pd.userid
|
||||
LEFT JOIN psychology_appointment_info pai ON pai.doctorUser = pd.userid
|
||||
$condition
|
||||
""");
|
||||
sql.setCondition(Cnd.NEW().andEX("YEAR(pai.startTime)", "=", year)
|
||||
.groupBy("pd.userid").desc("serviceNum"));
|
||||
} else if (tableIndex == 2) {
|
||||
sql = Sqls.create("""
|
||||
SELECT
|
||||
ai.*,
|
||||
u.username AS applyUserName,
|
||||
u.sex,
|
||||
us.username AS doctorUserName,
|
||||
unit.`name` as unitName,
|
||||
su.unionname as unionName
|
||||
FROM
|
||||
psychology_appointment_info ai
|
||||
LEFT JOIN sys_user u ON u.id = ai.appointmentUser
|
||||
LEFT JOIN sys_user us ON us.id = ai.doctorUser
|
||||
LEFT JOIN sys_unit unit ON unit.id = u.unitid
|
||||
LEFT JOIN sys_union su ON su.id = unit.unionid
|
||||
$condition
|
||||
""");
|
||||
sql.setCondition(Cnd.NEW().andEX("ai.stateId", "=", 2300)
|
||||
.andEX("ai.doctorUser", "=", doctorUser)
|
||||
.andEX("YEAR(ai.startTime)", "=", year));
|
||||
}
|
||||
return baseService.listMap(sql);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
package io.v.nutz.zhgh.psychology.models;
|
||||
|
||||
import lombok.Data;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
import org.nutz.dao.interceptor.annotation.PrevInsert;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 心理咨询预约
|
||||
*/
|
||||
@Table
|
||||
@Data
|
||||
public class PsychologyAppointmentInfo {
|
||||
|
||||
@Name
|
||||
@PrevInsert(uu32 = true)
|
||||
private String id;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 30)
|
||||
@Comment("日期")
|
||||
private String date;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 30)
|
||||
@Comment("开始时间")
|
||||
private String startTime;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 30)
|
||||
@Comment("结束时间")
|
||||
private String endTime;
|
||||
|
||||
@Column
|
||||
@Comment("开始时间")
|
||||
private Long startTimeTs;
|
||||
|
||||
@Column
|
||||
@Comment("结束时间")
|
||||
private Long endTimeTs;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@Comment("预约人")
|
||||
private String appointmentUser;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
@Comment("预约人备注")
|
||||
private String appointmentUserNote;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 10)
|
||||
@Comment("预约人选择的咨询方式")
|
||||
private String appointmentAskTypeValue;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@Comment("咨询师")
|
||||
private String doctorUser;
|
||||
|
||||
@Column
|
||||
@ColDefine(customType = "SMALLINT")
|
||||
@Comment("预约状态")
|
||||
private Integer stateId;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
@Comment("咨询方式")
|
||||
private List<String> askType;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package io.v.nutz.zhgh.psychology.models;
|
||||
|
||||
import lombok.Data;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
import org.nutz.dao.interceptor.annotation.PrevInsert;
|
||||
|
||||
@Table("psychology_doctor")
|
||||
@Comment("心理咨询专家")
|
||||
@Data
|
||||
public class PsychologyDoctor {
|
||||
|
||||
@Name
|
||||
@PrevInsert(uu32 = true)
|
||||
private String id;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@Comment("用户id")
|
||||
private String userid;
|
||||
|
||||
/* @Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 30)
|
||||
@Comment("用户姓名")
|
||||
private String userName;*/
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 1)
|
||||
@Comment("性别")
|
||||
private String sex;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@Comment("职称")
|
||||
private String jobTitle;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@Comment("单位")
|
||||
private String unitName;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 500)
|
||||
@Comment("特长")
|
||||
private String specialty;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 500)
|
||||
@Comment("简介")
|
||||
private String introduce;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 500)
|
||||
@Comment("头像")
|
||||
private String avatar;
|
||||
|
||||
@Column
|
||||
@Comment("是否禁用")
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
private boolean disabled;
|
||||
|
||||
@Column
|
||||
@Comment("电话")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 11)
|
||||
private String mobile;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package io.v.nutz.zhgh.psychology.models;
|
||||
|
||||
import lombok.Data;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
|
||||
@Table("psychology_msg")
|
||||
@Data
|
||||
public class PsychologyMsg {
|
||||
|
||||
@Column
|
||||
@Name
|
||||
@Comment("ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@Prev(els = {@EL("uuid()")})
|
||||
private String id;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
@Comment("是否发送短信通知")
|
||||
private Boolean isSendMsg;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package io.v.nutz.zhgh.psychology.models;
|
||||
|
||||
import cn.wizzer.framework.base.model.BaseModel;
|
||||
import io.v.nutz.sys.models.Sys_file;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
import org.nutz.dao.interceptor.annotation.PrevInsert;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Table
|
||||
@Data
|
||||
@Comment("心理咨询预约安排")
|
||||
public class PsychologyNotice extends BaseModel {
|
||||
|
||||
@Name
|
||||
@PrevInsert(uu32 = true)
|
||||
private String id;
|
||||
|
||||
@Column
|
||||
@Comment("标题")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String title;
|
||||
|
||||
@Column
|
||||
@Comment("内容")
|
||||
@ColDefine(customType = "longtext")
|
||||
private String content;
|
||||
|
||||
@Column
|
||||
@Comment("附件")
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
private List<Sys_file> files;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package io.v.nutz.zhgh.psychology.models;
|
||||
|
||||
import lombok.Data;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
import org.nutz.dao.interceptor.annotation.PrevInsert;
|
||||
|
||||
/**
|
||||
* 线上心理咨询帖子
|
||||
*/
|
||||
@Table
|
||||
@Data
|
||||
public class PsychologyOnlinePosts {
|
||||
|
||||
@Name
|
||||
@PrevInsert(uu32 = true)
|
||||
private String id;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@Comment("发帖人")
|
||||
private String poster;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 30)
|
||||
@Comment("发帖时间")
|
||||
private String postingTime;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 20)
|
||||
@Comment("发帖标题")
|
||||
private String postTitle;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 1000)
|
||||
@Comment("发帖内容")
|
||||
private String postContent;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package io.v.nutz.zhgh.psychology.models;
|
||||
|
||||
import lombok.Data;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
import org.nutz.dao.interceptor.annotation.PrevInsert;
|
||||
|
||||
/**
|
||||
* 线上心理咨询帖子回复
|
||||
*/
|
||||
@Table
|
||||
@Data
|
||||
public class PsychologyOnlinePostsReply {
|
||||
|
||||
@Name
|
||||
@PrevInsert(uu32 = true)
|
||||
private String id;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@Comment("帖子Id")
|
||||
private String postId;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@Comment("答复人")
|
||||
private String replyUser;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 30)
|
||||
@Comment("答复时间")
|
||||
private String replyTime;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 1000)
|
||||
@Comment("答复内容")
|
||||
private String replyContent;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user