Bladeren bron

研发打卡修改

anderx 2 jaren geleden
bovenliggende
commit
7b7e0ff51e

+ 4 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ProjectTaskController.java

@@ -27,6 +27,7 @@ import org.springframework.web.multipart.MultipartFile;
 
 import javax.servlet.http.HttpServletResponse;
 import java.awt.print.Pageable;
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -76,6 +77,9 @@ public class ProjectTaskController extends BaseController {
      */
     @PostMapping("/addRecord")
     public AjaxResult addRecord( @RequestBody ProjectStaffRecord in){
+        if (in.getRecordTime()==null){
+            in.setRecordTime(new Date());
+        }
         Long userId = SecurityUtils.getUserId();
         in.setAid(userId);
         AjaxResult ajaxResult = projectStaffRecordService.addCheckMaxDuration(in);

+ 1 - 2
ruoyi-system/src/main/java/com/ruoyi/project/service/impl/ProjectStaffRecordServiceImpl.java

@@ -91,7 +91,7 @@ public class ProjectStaffRecordServiceImpl implements ProjectStaffRecordService
         BigDecimal maxDuration= new BigDecimal(SecurityUtils.getLoginUser().getUser().getDept().getMaxDuration());
         String maxDurationProjectFlag = configService.selectConfigByKey("maxDurationProject");
         Boolean maxflag = Boolean.parseBoolean(maxDurationProjectFlag);
-        Double myDuration=0d;
+        Double myDuration;
         myDuration=getMyDuration(in,maxflag);
         BigDecimal mySum = new BigDecimal(myDuration).add(new BigDecimal(in.getDuration()));
 
@@ -408,7 +408,6 @@ public class ProjectStaffRecordServiceImpl implements ProjectStaffRecordService
 
 
     public Double getMyDuration(ProjectStaffRecord in ,boolean flag) {
-        Double myDuration = 0d;
         Long pid=in.getPid();
         Long aid=in.getAid();
         if (!flag)pid=null;