3 次代码提交 a4f8c371c8 ... 8ea7dddea0

作者 SHA1 备注 提交日期
  zhoutao 8ea7dddea0 SgTimeSheet 5 年之前
  zhoutao 4500a81614 SgTimeSheet 5 年之前
  zhoutao 923a09e18a SgTimeSheet 5 年之前

+ 110 - 0
pigx-inventory/pigx-inventory-biz/src/main/java/com/pig4cloud/pigx/qa/controller/SgTimeSheetController.java

@@ -0,0 +1,110 @@
+/*
+ *    Copyright (c) 2018-2025, lengleng All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * Neither the name of the pig4cloud.com developer nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * Author: lengleng (wangiegie@gmail.com)
+ */
+
+package com.pig4cloud.pigx.qa.controller;
+
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.pig4cloud.pigx.common.core.util.R;
+import com.pig4cloud.pigx.common.log.annotation.SysLog;
+import com.pig4cloud.pigx.qa.entity.SgTimeSheet;
+import com.pig4cloud.pigx.qa.service.SgTimeSheetService;
+import org.springframework.security.access.prepost.PreAuthorize;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.AllArgsConstructor;
+import org.springframework.web.bind.annotation.*;
+
+
+/**
+ * 
+ *
+ * @author georgejiao
+ * @date 2020-08-26 13:11:49
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("/sgtimesheet" )
+@Api(value = "sgtimesheet", tags = "考勤管理")
+public class SgTimeSheetController {
+
+    private final  SgTimeSheetService sgTimeSheetService;
+
+    /**
+     * 分页查询
+     * @param page 分页对象
+     * @param sgTimeSheet 
+     * @return
+     */
+    @ApiOperation(value = "分页查询", notes = "分页查询")
+    @GetMapping("/page" )
+    public R getSgTimeSheetPage(Page page, SgTimeSheet sgTimeSheet) {
+        return R.ok(sgTimeSheetService.page(page, Wrappers.query(sgTimeSheet)));
+    }
+
+
+    /**
+     * 通过id查询
+     * @param id id
+     * @return R
+     */
+    @ApiOperation(value = "通过id查询", notes = "通过id查询")
+    @GetMapping("/{id}" )
+    public R getById(@PathVariable("id" ) Integer id) {
+        return R.ok(sgTimeSheetService.getById(id));
+    }
+
+    /**
+     * 新增
+     * @param sgTimeSheet 
+     * @return R
+     */
+    @ApiOperation(value = "新增", notes = "新增")
+    @SysLog("新增" )
+    @PostMapping
+    @PreAuthorize("@pms.hasPermission('qa_sgtimesheet_add')" )
+    public R save(@RequestBody SgTimeSheet sgTimeSheet) {
+        return R.ok(sgTimeSheetService.save(sgTimeSheet));
+    }
+
+    /**
+     * 修改
+     * @param sgTimeSheet 
+     * @return R
+     */
+    @ApiOperation(value = "修改", notes = "修改")
+    @SysLog("修改" )
+    @PutMapping
+    @PreAuthorize("@pms.hasPermission('qa_sgtimesheet_edit')" )
+    public R updateById(@RequestBody SgTimeSheet sgTimeSheet) {
+        return R.ok(sgTimeSheetService.updateById(sgTimeSheet));
+    }
+
+    /**
+     * 通过id删除
+     * @param id id
+     * @return R
+     */
+    @ApiOperation(value = "通过id删除", notes = "通过id删除")
+    @SysLog("通过id删除" )
+    @DeleteMapping("/{id}" )
+    @PreAuthorize("@pms.hasPermission('qa_sgtimesheet_del')" )
+    public R removeById(@PathVariable Integer id) {
+        return R.ok(sgTimeSheetService.removeById(id));
+    }
+
+}

+ 88 - 0
pigx-inventory/pigx-inventory-biz/src/main/java/com/pig4cloud/pigx/qa/entity/SgTimeSheet.java

@@ -0,0 +1,88 @@
+package com.pig4cloud.pigx.qa.entity;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import java.math.BigDecimal;
+/**
+ *考勤表
+ *
+ * @author zhoutao
+ * @date 2019-04-15 14:10:13
+ */
+@Data
+@TableName("sg_time_sheet")
+@EqualsAndHashCode(callSuper = true)
+public class SgTimeSheet extends Model<SgTimeSheet> {
+	@ApiModelProperty(value = "id")
+	@TableId
+  private Long id;
+
+
+	/**
+	 * [id]
+	 *       ,[time_month]
+	 *       ,[e_id]
+	 *       ,[e_cnname]
+	 *       ,[month_overtime_add]
+	 *       ,[month_overtime_decrease]
+	 *       ,[month_overtime_surplus]
+	 *       ,[annual_leave_decrease]
+	 *       ,[annual_leave_surplus]
+	 *       ,[silk_leave_add]
+	 *       ,[silk_leave_all]
+	 *       ,[leave_absence_add]
+	 *       ,[leave_absence_all]
+	 *       ,[late_less5]
+	 *       ,[late_greate6]
+	 *       ,[late_all]
+	 */
+	@ApiModelProperty(value = "员工编号")
+	private Long eId;
+
+	@ApiModelProperty(value = "年月日期")
+	private Long timeMonth;
+
+	@ApiModelProperty(value = "员工姓名")
+	private String eCnname;
+
+	@ApiModelProperty(value = "当月加班")
+	private BigDecimal monthOvertimeAdd;
+
+	@ApiModelProperty(value = "当月调休")
+	private BigDecimal monthOvertimeDecrease;
+
+	@ApiModelProperty(value = "当月加班剩余")
+	private BigDecimal monthOvertimeSurplus;
+
+	@ApiModelProperty(value = "年假减少")
+	private BigDecimal annualLeaveDecrease;
+
+	@ApiModelProperty(value = "年假剩余")
+	private BigDecimal annualLeaveSurplus;
+
+	@ApiModelProperty(value = "病假增加")
+	private BigDecimal silkLeaveAdd;
+
+	@ApiModelProperty(value = "病假总计")
+	private BigDecimal silkLeaveAll;
+
+	@ApiModelProperty(value = "事假增加")
+	private BigDecimal leaveAbsenceAdd;
+
+	@ApiModelProperty(value = "事假总计")
+	private BigDecimal leaveAbsenceAll;
+
+	@ApiModelProperty(value = "5分内迟到")
+	private Long lateLess5;
+
+	@ApiModelProperty(value = "6分以上迟到")
+	private Long lateGreate6;
+
+	@ApiModelProperty(value = "总计迟到")
+	private Long lateAll;
+
+
+}

+ 9 - 0
pigx-inventory/pigx-inventory-biz/src/main/java/com/pig4cloud/pigx/qa/mapper/SgTimeSheetMapper.java

@@ -0,0 +1,9 @@
+package com.pig4cloud.pigx.qa.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.pig4cloud.pigx.qa.entity.SgTimeSheet;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface SgTimeSheetMapper extends BaseMapper<SgTimeSheet> {
+}

+ 11 - 0
pigx-inventory/pigx-inventory-biz/src/main/java/com/pig4cloud/pigx/qa/service/SgTimeSheetService.java

@@ -0,0 +1,11 @@
+package com.pig4cloud.pigx.qa.service;
+
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.pig4cloud.pigx.qa.entity.SgTimeSheet;
+
+public interface SgTimeSheetService extends IService<SgTimeSheet> {
+
+
+
+}

+ 12 - 0
pigx-inventory/pigx-inventory-biz/src/main/java/com/pig4cloud/pigx/qa/service/impl/SgTimeSheetServiceImpl.java

@@ -0,0 +1,12 @@
+package com.pig4cloud.pigx.qa.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.pig4cloud.pigx.qa.entity.SgTimeSheet;
+import com.pig4cloud.pigx.qa.mapper.SgTimeSheetMapper;
+import com.pig4cloud.pigx.qa.service.SgTimeSheetService;
+import org.springframework.stereotype.Service;
+
+@Service
+public class SgTimeSheetServiceImpl extends ServiceImpl<SgTimeSheetMapper, SgTimeSheet> implements SgTimeSheetService {
+
+}

+ 44 - 0
pigx-inventory/pigx-inventory-biz/src/main/resources/mapper/SgTimeSheetMapper.xml

@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+  ~
+  ~      Copyright (c) 2018-2025, lengleng All rights reserved.
+  ~
+  ~  Redistribution and use in source and binary forms, with or without
+  ~  modification, are permitted provided that the following conditions are met:
+  ~
+  ~ Redistributions of source code must retain the above copyright notice,
+  ~  this list of conditions and the following disclaimer.
+  ~  Redistributions in binary form must reproduce the above copyright
+  ~  notice, this list of conditions and the following disclaimer in the
+  ~  documentation and/or other materials provided with the distribution.
+  ~  Neither the name of the pig4cloud.com developer nor the names of its
+  ~  contributors may be used to endorse or promote products derived from
+  ~  this software without specific prior written permission.
+  ~  Author: lengleng (wangiegie@gmail.com)
+  ~
+  -->
+
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+
+<mapper namespace="com.pig4cloud.pigx.qa.mapper.SgTimeSheetMapper">
+
+  <resultMap id="sgTimeSheetMap" type="com.pig4cloud.pigx.qa.entity.SgTimeSheet">
+                  <id property="id" column="id"/>
+                        <result property="timeMonth" column="time_month"/>
+                        <result property="eId" column="e_id"/>
+                        <result property="eCnname" column="e_cnname"/>
+                        <result property="monthOvertimeAdd" column="month_overtime_add"/>
+                        <result property="monthOvertimeDecrease" column="month_overtime_decrease"/>
+                        <result property="monthOvertimeSurplus" column="month_overtime_surplus"/>
+                        <result property="annualLeaveDecrease" column="annual_leave_decrease"/>
+                        <result property="annualLeaveSurplus" column="annual_leave_surplus"/>
+                        <result property="silkLeaveAdd" column="silk_leave_add"/>
+                        <result property="silkLeaveAll" column="silk_leave_all"/>
+                        <result property="leaveAbsenceAdd" column="leave_absence_add"/>
+                        <result property="leaveAbsenceAll" column="leave_absence_all"/>
+                        <result property="lateLess5" column="late_less5"/>
+                        <result property="lateGreate6" column="late_greate6"/>
+                        <result property="lateAll" column="late_all"/>
+            </resultMap>
+</mapper>