Forráskód Böngészése

app要求可以上报他人填报日志(startTaskTheLog)

“zhifk” 2 éve
szülő
commit
cc5505313f

+ 6 - 2
blade-service/blade-business/src/main/java/org/springblade/business/controller/ContractLogController.java

@@ -226,15 +226,19 @@ public class ContractLogController extends BladeController {
             if (json.containsKey("recordTime")) {
                 recordTime = json.getString("recordTime");
             }
-
             if (StringUtils.isEmpty(startTaskVO.getIds())) {
                 if (StringUtils.isEmpty(nodePrimaryKeyId) && StringUtils.isEmpty(recordTime)) {
                     return R.fail("未找到业务数据");
                 }
+                //app要求可以上报他人填报日志
+                long userId = AuthUtil.getUserId();
+                if (json.containsKey("userId")) {
+                    userId = json.getLong("userId");
+                }
                 //如果ids为空,说明是填报页上报,那么需要根据 nodePrimaryKeyId 和 recordTime 获取当前用户的填写记录
                 ContractLog log = this.contractLogService.getOne(Wrappers.<ContractLog>lambdaQuery().eq(ContractLog::getWbsNodeId, nodePrimaryKeyId)
                         .eq(ContractLog::getRecordTime, recordTime).eq(ContractLog::getContractId, startTaskVO.getContractId())
-                        .eq(ContractLog::getCreateUser, AuthUtil.getUserId()));
+                        .eq(ContractLog::getCreateUser, userId));
                 if (log == null) {
                     return R.fail("未找到业务数据");
                 }