Procházet zdrojové kódy

fix: 考勤打卡开始时间改成从t_f_flow_log表取

caozixuan před 1 rokem
rodič
revize
8836b518fb

+ 16 - 1
sop-business/src/main/java/com/qmth/sop/business/service/impl/TBDingServiceImpl.java

@@ -63,6 +63,8 @@ public class TBDingServiceImpl extends ServiceImpl<TBDingMapper, TBDing> impleme
     private SysDingObjService sysDingObjService;
     @Resource
     private TBDingApplyService tbDingApplyService;
+    @Resource
+    private TFFlowLogService tfFlowLogService;
 
     @Override
     public DingElementResult findDingElements(String sopNo, Long userId) {
@@ -477,10 +479,23 @@ public class TBDingServiceImpl extends ServiceImpl<TBDingMapper, TBDing> impleme
                 }
                 TFFlowApprove tfFlowApprove = tfFlowApproves.get(0);
                 FlowStatusEnum flowStatusEnum = tfFlowApprove.getStatus();
-                Long createTime = tfFlowApprove.getCreateTime();
                 Long updateTime = tfFlowApprove.getUpdateTime();
                 Long currentTime = System.currentTimeMillis();
 
+                Long flowId = tfFlowApprove.getFlowId();
+                TFFlowLog tfFlowLog = tfFlowLogService.getOne(new QueryWrapper<TFFlowLog>().lambda()
+                        .eq(TFFlowLog::getFlowId, flowId)
+                        .eq(TFFlowLog::getApproveRemark, "通过")
+                        .eq(TFFlowLog::getApproveSetup, 1)
+                        .eq(TFFlowLog::getApproveOperation, FlowApproveOperationEnum.START)
+                        .orderByDesc(TFFlowLog::getId)
+                        .last("limit 1"));
+                if (Objects.isNull(tfFlowLog)){
+                    throw ExceptionResultEnum.ERROR.exception("未找到流程提交记录");
+                }
+                Long createTime = tfFlowLog.getCreateTime();
+
+
                 if (FlowStatusEnum.FINISH.equals(flowStatusEnum)) {
                     dateList = DateDisposeUtils.getDaysBetween(createTime, updateTime, SystemConstant.DEFAULT_DATE_YMD_S_PATTERN);
                     result.setSopIsEnd(true);

+ 1 - 0
sop-business/src/main/resources/mapper/TBDingMapper.xml

@@ -372,6 +372,7 @@
     </select>
     <select id="findDateAndStatusBySopNo" resultType="com.qmth.sop.business.entity.TFFlowApprove">
         SELECT
+            tffa.flow_id AS flowId,
             tffa.status AS status,
             tffa.create_time AS createTime,
             tffa.update_time AS updateTime