瀏覽代碼

凌云集团更改公司

peiguo 5 年之前
父節點
當前提交
220c9a5396

+ 10 - 0
whepi-web/src/main/java/com/bofeng/dao/MsReportMapper.java

@@ -192,4 +192,14 @@ public interface MsReportMapper extends BaseMapper<MsReport> {
             "=c.today_local or c.work_local_other =c.today_local_other) and c.is_trip=0 and a.report_status=1 and a.user_create=#{userId} and a.report_date>#{reportDate} ORDER BY a.report_date desc LIMIT 15")
     List<MsReport> returnWorkTime(@Param("reportDate") String reportDate, @Param("userId") Long userId);
 
+    /**
+     * 当前人员今天的地址
+     * @param userId
+     * @return
+     */
+    @Select("SELECT a.*,CASE WHEN c.work_local = 4 THEN c.work_local_other ELSE c.work_local END as workMsg,CASE WHEN c.today_local = 4 THEN c.today_local_other ELSE c.today_local END as todayMsg " +
+            "FROM ms_report a LEFT JOIN ms_suspected b ON a.report_id = b.report_id LEFT JOIN ms_trip c ON b.suspected_id = c.trip_id WHERE a.report_status = 1 AND a.user_create = #{userId} ORDER BY a.report_date DESC LIMIT 1")
+    MsReport msAddr(@Param("userId") Long userId);
+
+
 }

+ 5 - 0
whepi-web/src/main/java/com/bofeng/entity/MsReport.java

@@ -80,4 +80,9 @@ public class MsReport {
     private String userCreateName = "";
     @TableField(exist = false)
     private String userUpdateName = "";
+
+    @TableField(exist = false)
+    private String workMsg;
+    @TableField(exist = false)
+    private String todayMsg;
 }

+ 17 - 0
whepi-web/src/main/java/com/bofeng/wx/controller/ScanController.java

@@ -187,6 +187,15 @@ public class ScanController {
                             return new ModelAndView("/user/scan.ftl", model);
                         }
                     }
+                    MsReport msReport1 = msReportMapper.msAddr(userOpen.getUserId());
+                    if (msReport1 != null && !msReport1.getWorkMsg().equals(msReport1.getTodayMsg())) {
+                        model.put("collor", "red");
+                        model.put("collor2", "red");
+                        model.put("into", "不许进入");
+                        model.put("errorMsg", "您本人不在工作驻地,不许进入。");
+                        scanService.saveOutScan(userOpen.getUserId(), inType, uptownDoor.getUptownId(), uptownDoor.getDoorId(), -1, model.get("errorMsg").toString());
+                        return new ModelAndView("/user/scan.ftl", model);
+                    }
                     //您近期内离开过工作单位驻地,请遵守返回工作驻地15日隔离规定,您目前未满15日,禁止进入。
                     model.put("collor", "green");
                     model.put("collor2", "green");
@@ -476,6 +485,14 @@ public class ScanController {
                         return new ModelAndView("/user/returnWork.ftl", model);
                     }
                 }
+                MsReport msReport1 = msReportMapper.msAddr(userOpen.getUserId());
+                if (msReport1 != null && !msReport1.getWorkMsg().equals(msReport1.getTodayMsg())) {
+                    model.put("collor", "red");
+                    model.put("collor2", "red");
+                    model.put("into", "不可复工");
+                    model.put("errorMsg", "您本人不在工作驻地,不可复工。");
+                    return new ModelAndView("/user/returnWork.ftl", model);
+                }
                 model.put("collor", "green");
                 model.put("collor2", "green");
                 model.put("into", "允许复工");