소스 검색

最新代码

liu 2 년 전
부모
커밋
ad0cbbfa77

+ 5 - 0
src/main/java/com/template/api/SmartAttendanceControllerAPI.java

@@ -98,4 +98,9 @@ public interface SmartAttendanceControllerAPI {
     @ApiOperation(value = "学生考勤记录导出", notes = "学生考勤记录导出", httpMethod = "GET")
     void queryPageExport(HttpServletResponse response, Integer gradeId, Integer classId, String status, String studentNo , String name, @RequestParam String startTime, @RequestParam String endTime);
 
+
+    @GetMapping(value = "/askForLeaveScreenPage")
+    @ApiOperation(value = "大屏——请假数据展示", notes = "大屏——请假数据展示", httpMethod = "GET")
+    CommonResult askForLeaveScreenPage(@RequestParam int currentPage, @RequestParam int pageCount,String cardNo,String ifVerification);
+
 }

+ 10 - 0
src/main/java/com/template/api/SmartVisitorControllerAPI.java

@@ -148,5 +148,15 @@ public interface SmartVisitorControllerAPI {
     @ApiOperation(value = "大屏——家长访客预约数据", notes = "大屏——家长访客预约数据", httpMethod = "GET")
     CommonResult getScreenPage(@RequestParam int currentPage, @RequestParam int pageCount,String phone,String status);
 
+    @GetMapping(value = "/cancel")
+    @ApiOperation(value = "大屏——学生家长预约取消", notes = "大屏——学生家长预约取消", httpMethod = "GET")
+    CommonResult cancel(@RequestParam int id);
+
+    @GetMapping(value = "/verification")
+    @ApiOperation(value = "大屏——学生家长预约核销", notes = "大屏——学生家长预约核销", httpMethod = "GET")
+    CommonResult verification(@RequestParam int id);
+
+
+
 
 }

+ 8 - 0
src/main/java/com/template/controller/SmartAttendanceController.java

@@ -464,6 +464,14 @@ public class SmartAttendanceController implements SmartAttendanceControllerAPI {
         ExcelUtils.excelDownload(workbook, "学生考勤.xlsx", response);
     }
 
+    @Override
+    @DESRespondSecret(validated = true)
+    public CommonResult askForLeaveScreenPage(int currentPage, int pageCount, String cardNo, String ifVerification) {
+        PageUtils<AskForLeaveScreenVo> result= smartAttendanceService.askForLeaveScreenPage(currentPage,pageCount,cardNo,ifVerification);
+
+        return CommonResult.ok(result);
+    }
+
     public PersonalLeaveListSchoolPeriodRecordsResult getXwAttendance(String startDate, String endDate, Integer currentPage, Integer pageSize) {
         //初始化客户端
         SeewoClient seewoClient = new DefaultSeewoClient(new Account(seewoConfig.getAppId(), seewoConfig.getAppSecret()));

+ 42 - 0
src/main/java/com/template/controller/SmartVisitorController.java

@@ -948,6 +948,48 @@ public class SmartVisitorController implements SmartVisitorControllerAPI {
         return CommonResult.ok(page);
     }
 
+    @Override
+    public CommonResult cancel(int id) {
+        boolean b = smartVisitorService.removeById(id);
+        if (b) {
+            return CommonResult.ok();
+        }
+        return CommonResult.fail();
+    }
+
+    @Override
+    public CommonResult verification(int id) {
+        SmartVisitor sv = smartVisitorService.getSmartById(id);
+        if (sv == null) {
+            return CommonResult.fail("访客记录已失效,审核失败!");
+        }
+        Integer statu = sv.getStatu();
+        if (9==statu) {
+            return CommonResult.fail("该记录已完成,请勿重复操作");
+        }
+        if (2==statu) {
+            return CommonResult.fail("该记录未同意");
+        }
+        if (1==statu) {
+            return CommonResult.fail("该记录还未通过审核");
+        }
+        if (7==statu) {
+            sv.setStatu(8);
+            int result = smartVisitorService.updateSmartVisitor(sv);
+            if (result > 0) {
+                return CommonResult.ok("进校核销成功");
+            }
+        }else if(8==statu){
+            sv.setStatu(9);
+            int result = smartVisitorService.updateSmartVisitor(sv);
+            if (result > 0) {
+                return CommonResult.ok("出校核销成功");
+            }
+        }
+
+        return CommonResult.fail();
+    }
+
     /**
      * 1、学生请假:
      * 我们这边调用请假接口之后,把请假数据写到了百胜系统的"学生请假登记"页面中,那到时候学生是通过任意设备都能进出吗?

+ 3 - 0
src/main/java/com/template/mapper/SmartAttendanceMapper.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.template.model.pojo.SmartAttendance;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.template.model.vo.AskForLeaveScreenVo;
 import com.template.model.vo.AskForLeaveVo;
 import com.template.model.vo.SmartAttendanceVo;
 import org.apache.ibatis.annotations.Param;
@@ -30,5 +31,7 @@ public interface SmartAttendanceMapper extends BaseMapper<SmartAttendance> {
 
     List<SmartAttendanceVo> queryExpor(@Param("gradeId") Integer gradeId, @Param("classId") Integer classId, @Param("status") String status, @Param("studentNo") String studentNo, @Param("name") String name, @Param("startTime") String startTime, @Param("endTime") String endTime);
 
+    IPage<AskForLeaveScreenVo> askForLeaveScreenPage(Page<AskForLeaveScreenVo> page, @Param("cardNo") String cardNo, @Param("ifVerification") String ifVerification);
+
 }
 

+ 35 - 0
src/main/java/com/template/model/vo/AskForLeaveScreenVo.java

@@ -0,0 +1,35 @@
+package com.template.model.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+public class AskForLeaveScreenVo {
+    private Integer id;
+
+    @ApiModelProperty(value = "头像")
+    private String headImage;
+
+    @ApiModelProperty(value = "希沃用户名称")
+    private String name;
+
+    @ApiModelProperty(value = "班级名称")
+    private String className;
+
+    @ApiModelProperty(value = "学号")
+    private String cardNo;
+
+    @ApiModelProperty(value = "请假原因")
+    private String reason;
+
+    @ApiModelProperty(value = "开始时间")
+    private Date startTime;
+
+    @ApiModelProperty(value = "结束时间")
+    private Date endTime;
+
+    @ApiModelProperty(value = "请假核销(0:未核销,1:已核销)")
+    private Integer ifVerification;
+}

+ 4 - 0
src/main/java/com/template/services/SmartAttendanceService.java

@@ -4,6 +4,7 @@ import com.template.model.pojo.SmartAttendance;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.template.model.pojo.SmartVisitor;
 import com.template.model.result.PageUtils;
+import com.template.model.vo.AskForLeaveScreenVo;
 import com.template.model.vo.AskForLeaveVo;
 import com.template.model.vo.SmartAttendanceVo;
 
@@ -40,4 +41,7 @@ public interface SmartAttendanceService extends IService<SmartAttendance> {
     List<SmartAttendance> duplicatesList(Date startTime, Date endTime, Date initiateTime);
 
     List<SmartAttendanceVo> queryExpor(Integer gradeId, Integer classId, String status, String studentNo, String name, String startTime, String endTime);
+
+    PageUtils<AskForLeaveScreenVo> askForLeaveScreenPage(int currentPage, int pageCount, String cardNo, String ifVerification);
+
 }

+ 8 - 0
src/main/java/com/template/services/impl/SmartAttendanceServiceImpl.java

@@ -9,6 +9,7 @@ import com.template.model.pojo.SmartAttendance;
 import com.template.mapper.SmartAttendanceMapper;
 import com.template.model.pojo.SmartVisitor;
 import com.template.model.result.PageUtils;
+import com.template.model.vo.AskForLeaveScreenVo;
 import com.template.model.vo.AskForLeaveVo;
 import com.template.model.vo.SmartAttendanceVo;
 import com.template.services.SmartAttendanceService;
@@ -131,4 +132,11 @@ public class SmartAttendanceServiceImpl extends ServiceImpl<SmartAttendanceMappe
         List<SmartAttendanceVo> vos =smartAttendanceMapper.queryExpor(gradeId,classId,status,studentNo,name,startTime,endTime);
         return vos;
     }
+
+    @Override
+    public PageUtils<AskForLeaveScreenVo> askForLeaveScreenPage(int currentPage, int pageCount, String cardNo, String ifVerification) {
+        Page<AskForLeaveScreenVo> page = new Page<>(currentPage,pageCount);
+        IPage<AskForLeaveScreenVo> datas = smartAttendanceMapper.askForLeaveScreenPage(page,cardNo,ifVerification);
+        return new PageUtils(datas);
+    }
 }

+ 26 - 0
src/main/resources/mapper/template/SmartAttendanceMapper.xml

@@ -120,4 +120,30 @@
         </if>
         ORDER BY sa.create_time desc
     </select>
+    <select id="askForLeaveScreenPage" resultType="com.template.model.vo.AskForLeaveScreenVo">
+        SELECT
+            sa.id,
+            su.head_image as headImage,
+            su.`name` as name,
+            sc.`name` as className,
+            su.card_no as cardNo,
+            sa.start_time as startTime,
+            sa.end_time as endTime,
+            sa.reason,
+            sa.if_verification as ifVerification
+        FROM
+            `smart_attendance` sa
+                LEFT JOIN smart_user su ON sa.user_id = su.id
+                LEFT JOIN smart_class sc ON sa.class_id = sc.id
+        WHERE
+            sa.deleted = 0
+          AND sa.`status` =6
+        <if test="cardNo != null and cardNo != ''">
+            and su.card_no like '%' #{cardNo} '%'
+        </if>
+        <if test="ifVerification != null and ifVerification != ''">
+            and sa.if_verification = #{ifVerification}
+        </if>
+        ORDER BY sa.initiate_time desc
+    </select>
 </mapper>