This commit is contained in:
cjw 2024-11-15 16:57:46 +08:00
parent 0964356f2f
commit ce3abafec4
25 changed files with 163 additions and 93 deletions

View File

@ -153,6 +153,7 @@ public class SysLoginService {
loginUser.setUsername(user.getUserName());
loginUser.setNickname(user.getNickName());
loginUser.setUserType(user.getUserType());
loginUser.setOpenid(user.getOpenId());
loginUser.setMenuPermission(permissionService.getMenuPermission(user.getUserId()));
loginUser.setRolePermission(permissionService.getRolePermission(user.getUserId()));
TenantHelper.dynamic(user.getTenantId(), () -> {

View File

@ -122,7 +122,6 @@ public class XcxAuthStrategy implements IAuthStrategy {
loginVo.setAccessToken(StpUtil.getTokenValue());
loginVo.setExpireIn(StpUtil.getTokenTimeout());
loginVo.setClientId(client.getClientId());
loginVo.setOpenid(openid);
return loginVo;
}

View File

@ -10,6 +10,7 @@ import org.dromara.common.log.annotation.Log;
import org.dromara.common.log.enums.BusinessType;
import org.dromara.common.mybatis.core.page.PageQuery;
import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.common.tenant.helper.TenantHelper;
import org.dromara.common.web.core.BaseController;
import org.dromara.system.domain.bo.ActivityEnterBo;
import org.dromara.system.domain.vo.ActivityEnterVo;
@ -39,7 +40,7 @@ public class ActivityEnterController extends BaseController {
@SaCheckPermission("activity:enter:pageList")
@GetMapping("/pageList")
public TableDataInfo<ActivityEnterVo> list(ActivityEnterBo bo, PageQuery pageQuery) {
return activityEnterService.queryPageList(bo, pageQuery);
return TenantHelper.ignore(() -> activityEnterService.queryPageList(bo, pageQuery));
}
/**
@ -49,7 +50,7 @@ public class ActivityEnterController extends BaseController {
@Log(title = "活动报名", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(ActivityEnterBo bo, HttpServletResponse response) {
List<ActivityEnterVo> list = activityEnterService.queryList(bo);
List<ActivityEnterVo> list = TenantHelper.ignore(() -> activityEnterService.queryList(bo));
ExcelUtil.exportExcel(list, "活动报名", ActivityEnterVo.class, response);
}

View File

@ -10,6 +10,7 @@ import org.dromara.common.log.annotation.Log;
import org.dromara.common.log.enums.BusinessType;
import org.dromara.common.mybatis.core.page.PageQuery;
import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.common.tenant.helper.TenantHelper;
import org.dromara.common.web.core.BaseController;
import org.dromara.system.domain.bo.ReservationOrderBo;
import org.dromara.system.domain.vo.ReservationOrderVo;
@ -39,7 +40,7 @@ public class ReservationOrderController extends BaseController {
@SaCheckPermission("reservation:order:list")
@GetMapping("/list")
public TableDataInfo<ReservationOrderVo> list(ReservationOrderBo bo, PageQuery pageQuery) {
return reservationOrderService.queryPageList(bo, pageQuery);
return TenantHelper.ignore(() -> reservationOrderService.queryPageList(bo, pageQuery));
}
/**

View File

@ -12,6 +12,7 @@ import org.dromara.common.log.annotation.Log;
import org.dromara.common.log.enums.BusinessType;
import org.dromara.common.mybatis.core.page.PageQuery;
import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.common.tenant.helper.TenantHelper;
import org.dromara.common.web.core.BaseController;
import org.dromara.system.domain.bo.ReservationRefundBo;
import org.dromara.system.domain.vo.ReservationRefundVo;
@ -41,7 +42,7 @@ public class ReservationRefundController extends BaseController {
@SaCheckPermission("reservation:refund:list")
@GetMapping("/list")
public TableDataInfo<ReservationRefundVo> list(ReservationRefundBo bo, PageQuery pageQuery) {
return reservationRefundService.queryPageList(bo, pageQuery);
return TenantHelper.ignore(() -> reservationRefundService.queryPageList(bo, pageQuery));
}
/**
@ -77,7 +78,13 @@ public class ReservationRefundController extends BaseController {
@Log(title = "同意退款", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping("/agree")
public R<Void> refundAgree(@Validated(EditGroup.class) @RequestBody ReservationRefundBo bo) throws Exception {
return toAjax(reservationRefundService.agree(bo));
public R<Void> refundAgree(@Validated(EditGroup.class) @RequestBody ReservationRefundBo bo) {
return toAjax(TenantHelper.ignore(() -> {
try {
return reservationRefundService.agree(bo);
} catch (Exception e) {
throw new RuntimeException(e);
}
}));
}
}

View File

@ -10,6 +10,7 @@ import org.dromara.common.log.annotation.Log;
import org.dromara.common.log.enums.BusinessType;
import org.dromara.common.mybatis.core.page.PageQuery;
import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.common.tenant.helper.TenantHelper;
import org.dromara.common.web.core.BaseController;
import org.dromara.system.domain.bo.SysScaleOrderBo;
import org.dromara.system.domain.vo.SysScaleOrderVo;
@ -39,7 +40,7 @@ public class ScaleOrderController extends BaseController {
@SaCheckPermission("scale:order:list")
@GetMapping("/list")
public TableDataInfo<SysScaleOrderVo> list(SysScaleOrderBo bo, PageQuery pageQuery) {
return scaleOrderService.queryPageList(bo, pageQuery);
return TenantHelper.ignore(() -> scaleOrderService.queryPageList(bo, pageQuery));
}
/**

View File

@ -103,7 +103,7 @@ public class WxMyController extends BaseController {
*/
@GetMapping("/reservation/pageList")
public TableDataInfo<ReservationOrderVo> reservationList(ReservationOrderBo bo, PageQuery pageQuery) {
return myService.queryReservationPageList(bo, pageQuery);
return TenantHelper.ignore(() -> myService.queryReservationPageList(bo, pageQuery));
}
/**

View File

@ -12,6 +12,7 @@ import org.dromara.common.log.enums.BusinessType;
import org.dromara.common.mybatis.core.page.PageQuery;
import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.common.satoken.utils.LoginHelper;
import org.dromara.common.tenant.helper.TenantHelper;
import org.dromara.common.web.core.BaseController;
import org.dromara.system.domain.bo.ReservationOrderBo;
import org.dromara.system.domain.bo.ReservationRefundBo;
@ -93,7 +94,7 @@ public class WxOrderController extends BaseController {
Long userId = LoginHelper.getUserId();
bo.setCreateBy(userId);
bo.setCounselorId(null);
return reservationOrderService.queryPageList(bo, pageQuery);
return TenantHelper.ignore(() -> reservationOrderService.queryPageList(bo, pageQuery));
}
/**
@ -104,7 +105,7 @@ public class WxOrderController extends BaseController {
Long userId = LoginHelper.getUserId();
bo.setCounselorId(userId);
bo.setCreateBy(null);
return reservationOrderService.queryPageList(bo, pageQuery);
return TenantHelper.ignore(() ->reservationOrderService.queryPageList(bo, pageQuery));
}
/**

View File

@ -25,26 +25,30 @@ public class ScoreRecordBo extends BaseEntity {
/**
*
*/
@NotNull(message = "不能为空", groups = { EditGroup.class })
@NotNull(message = "不能为空", groups = {EditGroup.class})
private Long id;
/**
* status为0是量表id1是咨询师id
*/
@NotNull(message = "status为0是量表id1是咨询师id不能为空", groups = { AddGroup.class, EditGroup.class })
@NotNull(message = "业务id不能为空", groups = {AddGroup.class, EditGroup.class})
private Long businessId;
/**
* 0为scale 1为咨询师
*/
@NotNull(message = "0为scale 1为咨询师不能为空", groups = { AddGroup.class, EditGroup.class })
@NotNull(message = "业务状态不能为空", groups = {AddGroup.class, EditGroup.class})
private Integer recordStatus;
/**
*
*/
@NotNull(message = "不能为空", groups = { AddGroup.class, EditGroup.class })
private BigDecimal score;
@NotNull(message = "评分不能为空", groups = {AddGroup.class, EditGroup.class})
private BigDecimal oneScore;
@NotNull(message = "评分不能为空", groups = {AddGroup.class, EditGroup.class})
private BigDecimal twoScore;
@NotNull(message = "评分不能为空", groups = {AddGroup.class, EditGroup.class})
private BigDecimal threeScore;
}

View File

@ -3,17 +3,13 @@ package org.dromara.system.domain.vo;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import io.github.linpeilie.annotations.AutoMapper;
import io.github.linpeilie.annotations.AutoMapping;
import lombok.Data;
import org.dromara.common.translation.annotation.Translation;
import org.dromara.common.translation.constant.TransConstant;
import org.dromara.system.domain.ActivityEnter;
import java.io.Serial;
import java.io.Serializable;
/**
* 活动报名视图对象 m_activity_enter
*
@ -45,9 +41,9 @@ public class ActivityEnterVo implements Serializable {
*/
private Integer status;
@Translation(type = TransConstant.USER_ID_TO_NICKNAME)
@AutoMapping(target = "createBy")
private Long createName;
private Long createBy;
private String createName;
}

View File

@ -35,8 +35,7 @@ public class CounselorVo implements Serializable {
/**
* 姓名
*/
@Translation(type = TransConstant.USER_ID_TO_NICKNAME)
private Long name;
private String name;
/**
* 手机号

View File

@ -41,9 +41,9 @@ public class ReservationOrderVo implements Serializable {
*/
private Long counselorId;
@Translation(type = TransConstant.USER_ID_TO_NICKNAME)
@AutoMapping(target = "counselorId")
private Long counselorName;
private String counselorName;
private String counselorUrl;
private String transactionId;
@ -85,8 +85,10 @@ public class ReservationOrderVo implements Serializable {
private Long createBy;
@Translation(type = TransConstant.USER_ID_TO_NICKNAME)
@AutoMapping(target = "createBy")
private Long createName;
private String createName;
private Boolean isRefund;
private String timeFrame;
}

View File

@ -41,7 +41,9 @@ public class SysScaleOrderVo implements Serializable {
@ExcelProperty(value = "量表id")
private Long scaleId;
private String scaleName;
private String scaleUrl;
private Long recordId;
/**
* 发布批次号
*/

View File

@ -88,7 +88,7 @@ public interface SysUserMapper extends BaseMapperPlus<SysUser, SysUserVo> {
})
int updateById(@Param(Constants.ENTITY) SysUser user);
List<SysUser> selectStudentListByDeptIds(String deptIds);
List<SysUser> selectUserListByDeptIds(String deptIds);
List<SysUser> findUserByIds(String userIds);

View File

@ -11,9 +11,11 @@ import org.dromara.common.mybatis.core.page.PageQuery;
import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.common.satoken.utils.LoginHelper;
import org.dromara.system.domain.ActivityEnter;
import org.dromara.system.domain.SysUser;
import org.dromara.system.domain.bo.ActivityEnterBo;
import org.dromara.system.domain.vo.ActivityEnterVo;
import org.dromara.system.mapper.ActivityEnterMapper;
import org.dromara.system.mapper.SysUserMapper;
import org.dromara.system.service.IActivityEnterService;
import org.springframework.stereotype.Service;
@ -33,6 +35,7 @@ import java.util.Map;
public class ActivityEnterServiceImpl implements IActivityEnterService {
private final ActivityEnterMapper baseMapper;
private final SysUserMapper userMapper;
/**
* 查询活动报名
@ -56,6 +59,11 @@ public class ActivityEnterServiceImpl implements IActivityEnterService {
public TableDataInfo<ActivityEnterVo> queryPageList(ActivityEnterBo bo, PageQuery pageQuery) {
LambdaQueryWrapper<ActivityEnter> lqw = buildQueryWrapper(bo);
Page<ActivityEnterVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
List<ActivityEnterVo> records = result.getRecords();
for (ActivityEnterVo record : records) {
SysUser sysUser = userMapper.selectById(record.getCreateBy());
record.setCreateName(sysUser.getNickName());
}
return TableDataInfo.build(result);
}

View File

@ -50,8 +50,7 @@ public class ActivityServiceImpl implements IActivityService {
.eq(ActivityEnter::getActivityId, id)
.eq(ActivityEnter::getCreateBy, userId));
Long join = enterMapper.selectCount(new LambdaQueryWrapper<ActivityEnter>()
.eq(ActivityEnter::getActivityId, id)
.eq(ActivityEnter::getStatus, 1));
.eq(ActivityEnter::getActivityId, id));
ActivityVo activityVo = baseMapper.selectVoById(id);
activityVo.setJoinFlag(l.intValue());
activityVo.setJoinNums(join);

View File

@ -73,6 +73,8 @@ public class CounselorServiceImpl implements ICounselorService {
@Override
public CounselorVo queryById4Wx(Long id) {
CounselorVo counselorVo = baseMapper.selectVoById(id);
SysUserVo user = userService.selectUserById(id);
counselorVo.setName(user.getNickName());
Long l = experienceMapper.selectCount(new LambdaQueryWrapper<CounselorExperience>()
.eq(CounselorExperience::getCounselorId, id));
counselorVo.setExperienceNum(l.intValue());

View File

@ -22,9 +22,7 @@ import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.common.satoken.utils.LoginHelper;
import org.dromara.common.tenant.helper.TenantHelper;
import org.dromara.system.constant.StatusEnum;
import org.dromara.system.domain.ReservationOrder;
import org.dromara.system.domain.SysEvaluationRecord;
import org.dromara.system.domain.SysScale;
import org.dromara.system.domain.*;
import org.dromara.system.domain.bo.BaseQueryBo;
import org.dromara.system.domain.bo.ReservationOrderBo;
import org.dromara.system.domain.bo.SysScaleBo;
@ -33,10 +31,7 @@ import org.dromara.system.domain.word.EvaluationRecordWordData;
import org.dromara.system.domain.word.WordEvaluationFactor;
import org.dromara.system.domain.word.WordFactor;
import org.dromara.system.domain.word.WordRadar;
import org.dromara.system.mapper.ReservationOrderMapper;
import org.dromara.system.mapper.SysEvaluationRecordMapper;
import org.dromara.system.mapper.SysScaleMapper;
import org.dromara.system.mapper.SysUserMapper;
import org.dromara.system.mapper.*;
import org.dromara.system.service.IMyService;
import org.springframework.stereotype.Service;
@ -65,6 +60,9 @@ public class MyServiceImpl implements IMyService {
private final SysScaleMapper scaleMapper;
private final ReservationOrderMapper reservationOrderMapper;
private final SysUserMapper userMapper;
private final ReservationRefundMapper refundMapper;
private final ReservationTimeMapper timeMapper;
private final ReservationDayMapper dayMapper;
//private final DeptService deptService;
private final OssService ossService;
@ -134,6 +132,7 @@ public class MyServiceImpl implements IMyService {
lqw.eq(SysEvaluationRecord::getUserId, userId);
//根据flag查询个人或发布
lqw.eq(SysEvaluationRecord::getPublishFlag, 1);
lqw.eq(SysEvaluationRecord::getStatus, 0);
lqw.orderByDesc(SysEvaluationRecord::getCreateTime);
return queryEvaluationRecordPageList(lqw, pageQuery);
}
@ -167,6 +166,25 @@ public class MyServiceImpl implements IMyService {
new LambdaQueryWrapper<ReservationOrder>()
.eq(ReservationOrder::getCreateBy, userId)
.eq(bo.getOrderStatus() != null, ReservationOrder::getOrderStatus, bo.getOrderStatus()));
List<ReservationOrderVo> records = page.getRecords();
for (ReservationOrderVo record : records) {
SysUser sysCounselor = userMapper.selectById(record.getCounselorId());
if (sysCounselor.getAvatar() != null) {
String s = ossService.selectUrlByIds(sysCounselor.getAvatar().toString());
record.setCounselorUrl(s);
}
record.setCounselorName(sysCounselor.getNickName());
boolean exists = refundMapper.exists(new LambdaQueryWrapper<ReservationRefund>().eq(ReservationRefund::getOrderId, record.getId()));
record.setIsRefund(exists);
Long timeId = record.getTimeId();
ReservationTime reservationTime = timeMapper.selectById(timeId);
String startTime = DateUtils.parseDateToStr("HH:mm", reservationTime.getStartTime());
String endTime = DateUtils.parseDateToStr("HH:mm", reservationTime.getEndTime());
ReservationDay reservationDay = dayMapper.selectById(reservationTime.getDayId());
String dayTime = DateUtils.parseDateToStr("yyyy/MM/dd", reservationDay.getDayTime());
record.setTimeFrame(dayTime + " " + startTime + " - " + endTime);
}
return TableDataInfo.build(page);
}

View File

@ -9,6 +9,7 @@ import com.github.binarywang.wxpay.bean.request.WxPayUnifiedOrderRequest;
import com.github.binarywang.wxpay.service.WxPayService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.dromara.common.core.service.OssService;
import org.dromara.common.core.utils.MapstructUtils;
import org.dromara.common.mybatis.core.page.PageQuery;
import org.dromara.common.mybatis.core.page.TableDataInfo;
@ -17,11 +18,13 @@ import org.dromara.system.constant.StatusEnum;
import org.dromara.system.domain.Counselor;
import org.dromara.system.domain.ReservationOrder;
import org.dromara.system.domain.ReservationTime;
import org.dromara.system.domain.SysUser;
import org.dromara.system.domain.bo.ReservationOrderBo;
import org.dromara.system.domain.vo.ReservationOrderVo;
import org.dromara.system.mapper.CounselorMapper;
import org.dromara.system.mapper.ReservationOrderMapper;
import org.dromara.system.mapper.ReservationTimeMapper;
import org.dromara.system.mapper.SysUserMapper;
import org.dromara.system.service.IReservationOrderService;
import org.springframework.stereotype.Service;
@ -41,9 +44,12 @@ import java.util.Map;
public class ReservationOrderServiceImpl implements IReservationOrderService {
private final ReservationOrderMapper baseMapper;
private final WxPayService payService;
private final ReservationTimeMapper timeMapper;
private final CounselorMapper counselorMapper;
private final SysUserMapper userMapper;
private final WxPayService payService;
private final OssService ossService;
/**
* 查询预约订单
@ -67,6 +73,17 @@ public class ReservationOrderServiceImpl implements IReservationOrderService {
public TableDataInfo<ReservationOrderVo> queryPageList(ReservationOrderBo bo, PageQuery pageQuery) {
LambdaQueryWrapper<ReservationOrder> lqw = buildQueryWrapper(bo);
Page<ReservationOrderVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
List<ReservationOrderVo> records = result.getRecords();
for (ReservationOrderVo record : records) {
SysUser sysCounselor = userMapper.selectById(record.getCounselorId());
if (sysCounselor.getAvatar() != null) {
String s = ossService.selectUrlByIds(sysCounselor.getAvatar().toString());
record.setCounselorUrl(s);
}
record.setCounselorName(sysCounselor.getNickName());
SysUser sysUser = userMapper.selectById(record.getCreateBy());
record.setCreateName(sysUser.getNickName());
}
return TableDataInfo.build(result);
}
@ -141,10 +158,10 @@ public class ReservationOrderServiceImpl implements IReservationOrderService {
return false;
}
String resultCode = notifyResult.getResultCode();
if("FAIL".equals(resultCode)){
if ("FAIL".equals(resultCode)) {
String errCode = notifyResult.getErrCode();
String errCodeDes = notifyResult.getErrCodeDes();
log.error("预约订单:{},支付异常。异常代码:{}。异常原因:{}", orderId, errCode,errCodeDes);
log.error("预约订单:{},支付异常。异常代码:{}。异常原因:{}", orderId, errCode, errCodeDes);
return false;
}
String transactionId = notifyResult.getTransactionId();

View File

@ -9,6 +9,7 @@ import com.github.binarywang.wxpay.bean.request.WxPayUnifiedOrderRequest;
import com.github.binarywang.wxpay.service.WxPayService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.dromara.common.core.service.OssService;
import org.dromara.common.core.utils.MapstructUtils;
import org.dromara.common.mybatis.core.page.PageQuery;
import org.dromara.common.mybatis.core.page.TableDataInfo;
@ -42,12 +43,11 @@ import java.util.Map;
public class SysScaleOrderServiceImpl implements ISysScaleOrderService {
private final SysScaleOrderMapper baseMapper;
private final SysScaleMapper sysScaleMapper;
private final SysEvaluationRecordMapper recordMapper;
private final WxPayService payService;
private final SysScaleMapper sysScaleMapper;
private final SysEvaluationRecordMapper recordMapper;
private final OssService ossService;
/**
@ -76,6 +76,8 @@ public class SysScaleOrderServiceImpl implements ISysScaleOrderService {
for (SysScaleOrderVo record : records) {
SysScale scale = sysScaleMapper.selectById(record.getScaleId());
record.setScaleName(scale.getScaleName());
String s = ossService.selectUrlByIds(scale.getAppCover().toString());
record.setScaleUrl(s);
}
return TableDataInfo.build(result);
}
@ -110,6 +112,9 @@ public class SysScaleOrderServiceImpl implements ISysScaleOrderService {
@Override
public WxPayMpOrderResult insertByBo(SysScaleOrderBo bo) throws Exception {
String openId = LoginHelper.getOpenId();
BigDecimal price;
Long id = bo.getId();
if (id == null) {
Long userId = LoginHelper.getUserId();
SysScaleOrder add = MapstructUtils.convert(bo, SysScaleOrder.class);
Long scaleId = add.getScaleId();
@ -123,7 +128,7 @@ public class SysScaleOrderServiceImpl implements ISysScaleOrderService {
recordMapper.insert(record);
//初始订单
SysScale sysScale = sysScaleMapper.selectById(scaleId);
BigDecimal price = sysScale.getPrice();
price = sysScale.getPrice();
add.setActualPrice(price);
add.setOrderPrice(price);
add.setRecordId(record.getRecordId());
@ -131,9 +136,15 @@ public class SysScaleOrderServiceImpl implements ISysScaleOrderService {
add.setOrderStatus(StatusEnum.DISABLED.getValue());
validEntityBeforeSave(add);
baseMapper.insert(add);
id = add.getId();
} else {
SysScaleOrder sysScaleOrder = baseMapper.selectById(id);
SysScale sysScale = sysScaleMapper.selectById(sysScaleOrder.getId());
price = sysScale.getPrice();
}
WxPayUnifiedOrderRequest orderRequest = new WxPayUnifiedOrderRequest();
orderRequest.setBody("墨者科技-量表支付");
orderRequest.setOutTradeNo(add.getId().toString());
orderRequest.setOutTradeNo(id.toString());
int totalFee = price.multiply(new BigDecimal(100)).intValue();
orderRequest.setTotalFee(totalFee);
orderRequest.setNotifyUrl("https://api.ysmental.com/tenant/wx/pay/notify/order/scale");
@ -185,7 +196,7 @@ public class SysScaleOrderServiceImpl implements ISysScaleOrderService {
SysScaleOrder order = new SysScaleOrder();
order.setId(id);
order.setOrderStatus(1);
//order.setUpdateBy(userId);
order.setUpdateBy(userId);
order.setUpdateTime(date);
order.setTransactionId(transactionId);
boolean orderFlag = baseMapper.updateById(order) > 0;

View File

@ -170,7 +170,7 @@ public class SysScalePublishServiceImpl implements ISysScalePublishService {
List<SysDeptVo> deptList = deptMapper.findDeptByIds(deptIds);
add.setDeptNames(deptList.stream().map(SysDeptVo::getDeptName).collect(Collectors.joining(StrUtil.COMMA)));
//计算用户
userList = userMapper.selectStudentListByDeptIds(deptIds);
userList = userMapper.selectUserListByDeptIds(deptIds);
} else {
if (StringUtils.isEmpty(userIds)) {
throw new ServiceException("用户id以逗号隔开不能为空");

View File

@ -87,7 +87,8 @@ public class SysScaleServiceImpl implements ISysScaleService {
.eq(SysEvaluationRecord::getUserId, userId)
.eq(SysEvaluationRecord::getScaleId, scaleId)
.eq(SysEvaluationRecord::getPublishFlag, 0)
.eq(SysEvaluationRecord::getStatus, 0));
.eq(SysEvaluationRecord::getStatus, 0)
.last("limit 1"));
sysScaleVo.setRecordId(sysEvaluationRecord != null ? sysEvaluationRecord.getRecordId() : null);
return sysScaleVo;
}

View File

@ -41,7 +41,7 @@
left join sys_user u on u.user_id = ro.create_by
where DATE_FORMAT(rd.day_time, '%Y-%m-%d') = #{time}
and rt.counselor_id = #{userId}
and ro.order_status = 1
and rt.`status` > 0
#and ro.order_status = 1
#and rt.`status` > 0
</select>
</mapper>

View File

@ -5,7 +5,7 @@
<mapper namespace="org.dromara.system.mapper.StatisticMapper">
<select id="selectCompleteAvaluation" resultType="org.dromara.system.domain.vo.StatisticNumVo">
select d.dept_name,
parent.dept_name as `parentName`,
IFNULL(parent.dept_name, d.dept_name) as `parentName`,
count(if(er.status = 1, 1, null)) as `value`,
count(if(er.status = -1, 1, null)) as `spareValue`
from sys_evaluation_record er
@ -18,7 +18,7 @@
<select id="selectStatisticWarn" resultType="org.dromara.system.domain.vo.StatisticWarnVo">
select d.dept_name,
parent.dept_name as `parentName`,
IFNULL(parent.dept_name, d.dept_name) as `parentName`,
count(if(t.situation = 1, 1, null)) as `noneNum`,
count(if(t.situation = 2, 1, null)) as `lowNum`,
count(if(t.situation = 3, 1, null)) as `middleNum`,
@ -29,6 +29,7 @@
left join sys_evaluation_conclusion ec
on ec.record_id = er.record_id and ec.status = 1
where er.status = 1
and publish_flag = 1
and er.batch_no = #{batchNo}
and er.scale_id = #{scaleId}
group by er.record_id) t
@ -40,7 +41,7 @@
<select id="selectStatisticFactor" resultType="org.dromara.system.domain.vo.StatisticFactorVo">
select IFNULL(sf.factor_name, 'absent') as `factorName`,
d.dept_name as `deptName`,
parent.dept_name as `parentName`
IFNULL(parent.dept_name, d.dept_name) as `parentName`
from sys_dept parent
left join sys_dept d on d.parent_id = parent.dept_id
left join sys_evaluation_record er on er.dept_id = d.dept_id

View File

@ -69,12 +69,11 @@
select count(*) from sys_user where del_flag = '0' and user_id = #{userId}
</select>
<select id="selectStudentListByDeptIds" resultType="org.dromara.system.domain.SysUser">
<select id="selectUserListByDeptIds" resultType="org.dromara.system.domain.SysUser">
select u.*
from sys_dept d
left join sys_user u on u.dept_id = d.dept_id
where u.user_type = 'app_user'
and u.del_flag = 0
where u.del_flag = 0
and find_in_set(d.dept_id, #{deptIds})
</select>