Procházet zdrojové kódy

操作日志,操作类型修改

yangyue před 1 rokem
rodič
revize
059d04729c

+ 0 - 4
duty-service/src/main/java/cn/com/taiji/duty/controller/DutySignInRecordController.java

@@ -153,10 +153,6 @@ public class DutySignInRecordController {
         }
         ajaxResult = new AjaxResult(200, "请求成功!");
         ajaxResult.put("data", signInRecord);
-        DutyOperLog operLog = new DutyOperLog();
-        operLog.setOperModule("2");
-        operLog.setOperType("9");
-        operLogService.saveOperLog(operLog);
         return ajaxResult;
     }
 

+ 0 - 4
duty-service/src/main/java/cn/com/taiji/duty/service/impl/DutyConfigServiceImpl.java

@@ -127,10 +127,6 @@ public class DutyConfigServiceImpl extends ServiceImpl<DutyConfigMapper, DutyCon
         {
             redisCache.setCacheObject(getCacheKey(config.getConfigKey()), config.getConfigValue());
         }
-        DutyOperLog operLog = new DutyOperLog();
-        operLog.setOperModule("6");
-        operLog.setOperType("9");
-        operLogService.saveOperLog(operLog);
         return row;
     }
 

+ 1 - 1
duty-service/src/main/java/cn/com/taiji/duty/service/impl/DutyDailyReportRecordServiceImpl.java

@@ -98,7 +98,7 @@ public class DutyDailyReportRecordServiceImpl extends ServiceImpl<DutyDailyRepor
         }
         DutyOperLog operLog = new DutyOperLog();
         operLog.setOperModule("3");
-        operLog.setOperType("9");
+        operLog.setOperType("8");
         operLogService.saveOperLog(operLog);
         return save;
     }

+ 0 - 4
duty-service/src/main/java/cn/com/taiji/duty/service/impl/DutyDictDataServiceImpl.java

@@ -105,10 +105,6 @@ public class DutyDictDataServiceImpl extends ServiceImpl<DutyDictDataMapper, Dut
             List<DutyDictData> dictDatas = dictDataMapper.selectDictDataByType(data.getDictType());
             DictUtils.setDictCache(data.getDictType(), dictDatas);
         }
-        DutyOperLog operLog = new DutyOperLog();
-        operLog.setOperModule("7");
-        operLog.setOperType("9");
-        operLogService.saveOperLog(operLog);
         return row;
     }
 

+ 1 - 1
duty-service/src/main/java/cn/com/taiji/duty/service/impl/DutyNoticeInfoServiceImpl.java

@@ -53,7 +53,7 @@ public class DutyNoticeInfoServiceImpl extends ServiceImpl<DutyNoticeInfoMapper,
         boolean save = this.save(noticeInfo);
         DutyOperLog operLog = new DutyOperLog();
         operLog.setOperModule("5");
-        operLog.setOperType("9");
+        operLog.setOperType("4");
         operLogService.saveOperLog(operLog);
         return save;
     }

+ 18 - 4
duty-service/src/main/java/cn/com/taiji/duty/service/impl/DutySignInRecordServiceImpl.java

@@ -1,13 +1,16 @@
 package cn.com.taiji.duty.service.impl;
 
 import cn.com.taiji.duty.model.DutyAccount;
+import cn.com.taiji.duty.model.DutyOperLog;
 import cn.com.taiji.duty.model.DutySignInRecord;
 import cn.com.taiji.duty.mapper.DutySignInRecordMapper;
 import cn.com.taiji.duty.model.DutySignInRecordVo;
 import cn.com.taiji.duty.service.IDutyAccountService;
 import cn.com.taiji.duty.service.IDutyConfigService;
+import cn.com.taiji.duty.service.IDutyOperLogService;
 import cn.com.taiji.duty.service.IDutySignInRecordService;
 import cn.com.taiji.duty.utils.JwtUtils;
+import cn.com.taiji.duty.utils.StringUtils;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -51,6 +54,9 @@ public class DutySignInRecordServiceImpl extends ServiceImpl<DutySignInRecordMap
     @Autowired
     private IDutyAccountService accountService;
 
+    @Autowired
+    private IDutyOperLogService operLogService;
+
     @Override
     public DutySignInRecord search(Long deptId) {
         return signInRecordMapper.search(deptId);
@@ -124,7 +130,6 @@ public class DutySignInRecordServiceImpl extends ServiceImpl<DutySignInRecordMap
             }
             if (signOut != null) {
                 signInRecord.setId(signOut.getId());
-                return this.updateById(signInRecord);
             }
         } else {
             DutySignInRecord sign = signInRecordMapper.queryByAccountId(signInRecord.getDeptId(),1,new Date());
@@ -147,7 +152,6 @@ public class DutySignInRecordServiceImpl extends ServiceImpl<DutySignInRecordMap
                         signInRecord.setStatus("2");
                     }
                     signInRecord.setId(sign.getId());
-                    return this.updateById(signInRecord);
                 } else {
                     DutySignInRecord signOut = signInRecordMapper.queryByAccountId(signInRecord.getDeptId(), 2, new Date());
                     signInRecord.setType("2");
@@ -161,13 +165,23 @@ public class DutySignInRecordServiceImpl extends ServiceImpl<DutySignInRecordMap
                     }
                     if (signOut != null) {
                         signInRecord.setId(signOut.getId());
-                        return this.updateById(signInRecord);
                     }
                 }
             }
         }
 
-        return this.save(signInRecord);
+        DutyOperLog operLog = new DutyOperLog();
+        operLog.setOperModule("2");
+        if ("1".equals(signInRecord.getType())) {
+            operLog.setOperType("6");
+        } else {
+            operLog.setOperType("7");
+        }
+        operLogService.saveOperLog(operLog);
+        if (StringUtils.isNull(signInRecord.getId())) {
+            return this.save(signInRecord);
+        }
+        return this.updateById(signInRecord);
     }
 
     @Override