LIVE_YE 6 bulan lalu
induk
melakukan
bdbcb2eb52

+ 8 - 4
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/AskLeaveServiceImpl.java

@@ -1,6 +1,7 @@
 package org.dromara.system.service.impl;
 
 import cn.hutool.core.util.ObjectUtil;
+import org.dromara.common.core.exception.ServiceException;
 import org.dromara.common.core.utils.DateUtils;
 import org.dromara.common.core.utils.MapstructUtils;
 import org.dromara.common.core.utils.StringUtils;
@@ -115,7 +116,7 @@ public class AskLeaveServiceImpl implements IAskLeaveService {
         lqw.eq(StringUtils.isNotBlank(bo.getExamineResult()), AskLeave::getExamineResult, bo.getExamineResult());
         lqw.eq(StringUtils.isNotBlank(bo.getOpinion()), AskLeave::getOpinion, bo.getOpinion());
         lqw.like(StringUtils.isNotBlank(bo.getExamineName()), AskLeave::getExamineName, bo.getExamineName());
-        lqw.orderByDesc(AskLeave::getUpdateTime);
+        lqw.orderByDesc(AskLeave::getCreateTime);
         return lqw;
     }
 
@@ -165,8 +166,12 @@ public class AskLeaveServiceImpl implements IAskLeaveService {
     @Transactional
     public Boolean updateByBo(AskLeaveBo bo) {
 
-
+        if("1".equals(bo.getExamineResult())){
+            throw new ServiceException("不能修改审核通过的数据");
+        }
         int index = 0;
+        bo.setExamineResult("0");
+        bo.setOpinion("");
         bo.setUpdateTime(DateUtils.getNowDate());
         AskLeave update = MapstructUtils.convert(bo, AskLeave.class);
         validEntityBeforeSave(update);
@@ -232,8 +237,7 @@ public class AskLeaveServiceImpl implements IAskLeaveService {
         askLeaveFjMapper.delete(new LambdaQueryWrapper<AskLeaveFj>()
             .eq(AskLeaveFj::getLeaveId,askLeaveFjVo.getId()));
 
-        baseMapper.deleteById(id);
-        return 0;
+        return baseMapper.deleteById(id);
     }
 
     @Override