Parcourir la source

报工bug修复

seyason il y a 1 an
Parent
commit
a966850421

+ 2 - 2
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/impl/ReportServiceImpl.java

@@ -135,11 +135,11 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
         double curReportTime = 0.0;
         //查找上一次该工序的报工
         Integer currentProgress = 0;
-        Report lastReport = reportMapper.selectOne(new QueryWrapper<Report>().eq("creator_id", token).eq("prod_procedure_id", report.getProdProcedureId()).lt("create_date", today).orderByDesc("create_date").last("limit 1"));
+        Report lastReport = reportMapper.selectOne(new QueryWrapper<Report>().eq("creator_id", token).eq("user_procedure_team_id", report.getUserProcedureTeamId()).lt("create_date", today).orderByDesc("create_date").last("limit 1"));
         //查找上次是否有报工,有的话取上次报工进度,没有的话取分配下来时的报工进度
         if (lastReport != null) {
             if (report.getProgress() <= lastReport.getProgress()) {
-                httpRespMsg.setError("进度必须大于上次报工进度("+currentProgress+"%)");
+                httpRespMsg.setError("进度必须大于上次报工进度("+lastReport.getProgress()+"%)");
                 return httpRespMsg;
             }
             currentProgress = report.getProgress();