瀏覽代碼

Merge branch 'develop' of http://code.dashoo.cn/chengjian/opms_backend into develop

liuyaqi 2 年之前
父節點
當前提交
19af4042b1

+ 409 - 2
doc/订单全流程管理平台.pdma.json

@@ -4,7 +4,7 @@
   "avatar": "",
   "version": "4.3.0",
   "createdTime": "2023-1-6 11:43:05",
-  "updatedTime": "2023-2-16 10:23:30",
+  "updatedTime": "2023-2-22 11:58:54",
   "dbConns": [],
   "profile": {
     "default": {
@@ -16213,6 +16213,412 @@
       ],
       "correlations": [],
       "indexes": []
+    },
+    {
+      "id": "F4A7EC79-1B42-4530-B710-DE7C73AA68C8",
+      "env": {
+        "base": {
+          "nameSpace": "",
+          "codeRoot": ""
+        }
+      },
+      "defKey": "plat_punch_records",
+      "defName": "打卡记录表",
+      "comment": "",
+      "properties": {
+        "partitioned by": "(date string)",
+        "row format delimited": "",
+        "fields terminated by ','": "",
+        "collection items terminated by '-'": "",
+        "map keys terminated by ':'": "",
+        "store as textfile;": ""
+      },
+      "nameTemplate": "{defKey}[{defName}]",
+      "notes": {},
+      "headers": [
+        {
+          "refKey": "hideInGraph",
+          "hideInGraph": true
+        },
+        {
+          "refKey": "defKey",
+          "hideInGraph": false
+        },
+        {
+          "refKey": "defName",
+          "hideInGraph": false
+        },
+        {
+          "refKey": "primaryKey",
+          "hideInGraph": false
+        },
+        {
+          "refKey": "notNull",
+          "hideInGraph": true
+        },
+        {
+          "refKey": "autoIncrement",
+          "hideInGraph": true
+        },
+        {
+          "refKey": "domain",
+          "hideInGraph": true
+        },
+        {
+          "refKey": "type",
+          "hideInGraph": false
+        },
+        {
+          "refKey": "len",
+          "hideInGraph": false
+        },
+        {
+          "refKey": "scale",
+          "hideInGraph": false
+        },
+        {
+          "refKey": "comment",
+          "hideInGraph": true
+        },
+        {
+          "refKey": "refDict",
+          "hideInGraph": true
+        },
+        {
+          "refKey": "defaultValue",
+          "hideInGraph": true
+        },
+        {
+          "refKey": "isStandard",
+          "hideInGraph": false
+        },
+        {
+          "refKey": "uiHint",
+          "hideInGraph": true
+        },
+        {
+          "refKey": "extProps",
+          "hideInGraph": true
+        }
+      ],
+      "fields": [
+        {
+          "defKey": "id",
+          "defName": "主键",
+          "comment": "",
+          "type": "",
+          "len": "",
+          "scale": "",
+          "primaryKey": true,
+          "notNull": true,
+          "autoIncrement": true,
+          "defaultValue": "",
+          "hideInGraph": false,
+          "refDict": "",
+          "extProps": {},
+          "domain": "16120F75-6AA7-4483-868D-F07F511BB081",
+          "id": "7B989865-19D1-48E6-8E5F-B0ADD2508747"
+        },
+        {
+          "defKey": "user_id",
+          "defName": "关联用户",
+          "comment": "",
+          "type": "",
+          "len": "",
+          "scale": "",
+          "primaryKey": false,
+          "notNull": true,
+          "autoIncrement": false,
+          "defaultValue": "",
+          "hideInGraph": false,
+          "refDict": "",
+          "extProps": {},
+          "domain": "16120F75-6AA7-4483-868D-F07F511BB081",
+          "id": "D21EBC58-2481-4488-B51A-D7E77AD1CBEC"
+        },
+        {
+          "defKey": "user_nick_name",
+          "defName": "用户昵称",
+          "comment": "",
+          "type": "",
+          "len": "",
+          "scale": "",
+          "primaryKey": false,
+          "notNull": true,
+          "autoIncrement": false,
+          "defaultValue": "",
+          "hideInGraph": false,
+          "refDict": "",
+          "extProps": {},
+          "domain": "54611CCC-CA4B-42E1-9F32-4944C85B85A6",
+          "id": "4196847D-72E2-4884-BD21-6C79DE34E23E"
+        },
+        {
+          "defKey": "user_post_name",
+          "defName": "用户岗位",
+          "comment": "",
+          "type": "",
+          "len": "",
+          "scale": "",
+          "primaryKey": false,
+          "notNull": false,
+          "autoIncrement": false,
+          "defaultValue": "",
+          "hideInGraph": false,
+          "refDict": "",
+          "extProps": {},
+          "domain": "9092C4E0-1A54-4859-ABBB-5B62DBC27573",
+          "id": "F32B47FF-6C7C-4A9D-B0AE-6DBA587979C0"
+        },
+        {
+          "defKey": "user_avatar",
+          "defName": "用户头像",
+          "comment": "",
+          "type": "",
+          "len": "",
+          "scale": "",
+          "primaryKey": false,
+          "notNull": false,
+          "autoIncrement": false,
+          "defaultValue": "",
+          "hideInGraph": false,
+          "refDict": "",
+          "extProps": {},
+          "domain": "9092C4E0-1A54-4859-ABBB-5B62DBC27573",
+          "id": "62DE36BB-6E82-4543-9CE9-8CA3B9FF0800"
+        },
+        {
+          "defKey": "punch_time",
+          "defName": "打卡时间",
+          "comment": "",
+          "type": "",
+          "len": "",
+          "scale": "",
+          "primaryKey": false,
+          "notNull": true,
+          "autoIncrement": false,
+          "defaultValue": "",
+          "hideInGraph": false,
+          "refDict": "",
+          "extProps": {},
+          "domain": "7CFFA0D3-6A93-4DDC-BC10-DF21211064DC",
+          "id": "82F1F0AA-6073-438D-BA8A-48A221B24725"
+        },
+        {
+          "defKey": "punch_img",
+          "defName": "打卡照片",
+          "comment": "",
+          "type": "",
+          "len": "",
+          "scale": "",
+          "primaryKey": false,
+          "notNull": true,
+          "autoIncrement": false,
+          "defaultValue": "",
+          "hideInGraph": false,
+          "refDict": "",
+          "extProps": {},
+          "domain": "9092C4E0-1A54-4859-ABBB-5B62DBC27573",
+          "id": "45F0E442-46E1-47C4-8C69-D33DEA2F63C3"
+        },
+        {
+          "defKey": "punch_lng",
+          "defName": "经度",
+          "comment": "",
+          "type": "",
+          "len": "",
+          "scale": "",
+          "primaryKey": false,
+          "notNull": true,
+          "autoIncrement": false,
+          "defaultValue": "",
+          "hideInGraph": false,
+          "refDict": "",
+          "extProps": {},
+          "domain": "9092C4E0-1A54-4859-ABBB-5B62DBC27573",
+          "id": "8CA2543E-0392-45FC-AD52-10D25A7D682D"
+        },
+        {
+          "defKey": "punch_lat",
+          "defName": "纬度",
+          "comment": "",
+          "type": "",
+          "len": "",
+          "scale": "",
+          "primaryKey": false,
+          "notNull": true,
+          "autoIncrement": false,
+          "defaultValue": "",
+          "hideInGraph": false,
+          "refDict": "",
+          "extProps": {},
+          "domain": "9092C4E0-1A54-4859-ABBB-5B62DBC27573",
+          "id": "20BA0E5E-4423-402F-9751-402C951C4C8E"
+        },
+        {
+          "defKey": "punch_location",
+          "defName": "打卡地址",
+          "comment": "",
+          "type": "",
+          "len": "",
+          "scale": "",
+          "primaryKey": false,
+          "notNull": true,
+          "autoIncrement": false,
+          "defaultValue": "",
+          "hideInGraph": false,
+          "refDict": "",
+          "extProps": {},
+          "domain": "9092C4E0-1A54-4859-ABBB-5B62DBC27573",
+          "id": "DB8AC5C3-2030-47ED-808F-4F306AA05CAB"
+        },
+        {
+          "defKey": "remark",
+          "defName": "备注",
+          "comment": "",
+          "type": "",
+          "len": "",
+          "scale": "",
+          "primaryKey": false,
+          "notNull": false,
+          "autoIncrement": false,
+          "defaultValue": "",
+          "hideInGraph": false,
+          "domain": "3E948CEC-3070-472C-AF92-F3CA11EC9D15",
+          "refDict": "",
+          "extProps": {},
+          "notes": {},
+          "id": "C3FD42C0-3834-4BA8-9F24-F6489E290D23"
+        },
+        {
+          "defKey": "created_by",
+          "defName": "创建者",
+          "comment": "",
+          "type": "",
+          "len": "",
+          "scale": "",
+          "primaryKey": false,
+          "notNull": true,
+          "autoIncrement": false,
+          "defaultValue": "",
+          "hideInGraph": false,
+          "domain": "16120F75-6AA7-4483-868D-F07F511BB081",
+          "refDict": "",
+          "extProps": {},
+          "notes": {},
+          "id": "8222AD49-7CE6-4741-A727-F5BF15357430"
+        },
+        {
+          "defKey": "created_name",
+          "defName": "创建人",
+          "comment": "",
+          "type": "VARCHAR",
+          "len": "",
+          "scale": "",
+          "primaryKey": false,
+          "notNull": true,
+          "autoIncrement": false,
+          "defaultValue": "",
+          "hideInGraph": false,
+          "domain": "54611CCC-CA4B-42E1-9F32-4944C85B85A6",
+          "refDict": "",
+          "extProps": {},
+          "notes": {},
+          "id": "D8E6C1E1-969C-43FE-BCC6-C09EDD059D8F"
+        },
+        {
+          "defKey": "created_time",
+          "defName": "创建时间",
+          "comment": "",
+          "type": "DATETIME",
+          "len": "",
+          "scale": "",
+          "primaryKey": false,
+          "notNull": true,
+          "autoIncrement": false,
+          "defaultValue": "",
+          "hideInGraph": false,
+          "domain": "7CFFA0D3-6A93-4DDC-BC10-DF21211064DC",
+          "refDict": "",
+          "extProps": {},
+          "notes": {},
+          "id": "180CAEB3-940F-4BA4-BBEF-E18C5C36C7FD"
+        },
+        {
+          "defKey": "updated_by",
+          "defName": "更新者",
+          "comment": "",
+          "type": "",
+          "len": "",
+          "scale": "",
+          "primaryKey": false,
+          "notNull": false,
+          "autoIncrement": false,
+          "defaultValue": "",
+          "hideInGraph": false,
+          "domain": "16120F75-6AA7-4483-868D-F07F511BB081",
+          "refDict": "",
+          "extProps": {},
+          "notes": {},
+          "id": "B0EA4671-CAD1-4B3A-AE8B-1C7CDF713A32"
+        },
+        {
+          "defKey": "updated_name",
+          "defName": "更新人",
+          "comment": "",
+          "type": "VARCHAR",
+          "len": "",
+          "scale": "",
+          "primaryKey": false,
+          "notNull": false,
+          "autoIncrement": false,
+          "defaultValue": "",
+          "hideInGraph": false,
+          "domain": "54611CCC-CA4B-42E1-9F32-4944C85B85A6",
+          "refDict": "",
+          "extProps": {},
+          "notes": {},
+          "id": "70209889-2586-49A3-B9FC-F140D5C5FF3D"
+        },
+        {
+          "defKey": "updated_time",
+          "defName": "更新时间",
+          "comment": "",
+          "type": "DATETIME",
+          "len": "",
+          "scale": "",
+          "primaryKey": false,
+          "notNull": false,
+          "autoIncrement": false,
+          "defaultValue": "",
+          "hideInGraph": false,
+          "domain": "7CFFA0D3-6A93-4DDC-BC10-DF21211064DC",
+          "refDict": "",
+          "extProps": {},
+          "notes": {},
+          "id": "C2660DF4-B23C-4E91-8FF6-753FAC81FD60"
+        },
+        {
+          "defKey": "deleted_time",
+          "defName": "删除时间",
+          "comment": "",
+          "type": "DATETIME",
+          "len": "",
+          "scale": "",
+          "primaryKey": false,
+          "notNull": false,
+          "autoIncrement": false,
+          "defaultValue": "",
+          "hideInGraph": false,
+          "domain": "7CFFA0D3-6A93-4DDC-BC10-DF21211064DC",
+          "refDict": "",
+          "extProps": {},
+          "notes": {},
+          "id": "1B4DA594-BA7F-421B-943C-FCAF4C11E889"
+        }
+      ],
+      "correlations": [],
+      "indexes": []
     }
   ],
   "views": [],
@@ -16666,7 +17072,8 @@
         "DCB362BC-4FD6-489F-852D-E5728570275E",
         "9DEB5CFB-923E-4C90-A6BC-602093A99B3A",
         "1213FF4D-0686-4882-A33A-8E48C7D239CA",
-        "C9C0EFF0-7A8A-44AC-9504-1EC2730C47D0"
+        "C9C0EFF0-7A8A-44AC-9504-1EC2730C47D0",
+        "F4A7EC79-1B42-4530-B710-DE7C73AA68C8"
       ],
       "refViews": [],
       "refDiagrams": [],

+ 1 - 1
opms_admin/app/handler/auth.go

@@ -40,7 +40,7 @@ func (h *AuthHandler) Login(ctx context.Context, req *user_def.LoginReq, rsp *co
 	}
 	userInfo, err := userService.Login(req.UserName, req.Password)
 	loginLogService, _ := service.NewLoginLogService(ctx)
-	loginLogService.Invoke(ctx, req.UserName, rsp.Msg)
+	loginLogService.Invoke(ctx, req.UserName, err)
 	if err != nil {
 		return err
 	}

+ 8 - 0
opms_admin/app/handler/user.go

@@ -3,6 +3,7 @@ package handler
 import (
 	"context"
 	"dashoo.cn/opms_libary/myerrors"
+	"strings"
 
 	"dashoo.cn/common_definition/admin/user_def"
 	"github.com/gogf/gf/util/gvalid"
@@ -102,6 +103,13 @@ func (e *UserHandler) GetUserInfo(ctx context.Context, req *comm_def.IdReq, rsp
 	if err != nil {
 		return err
 	}
+	postService, _ := service.NewPostService(ctx)
+	postNames, err := postService.GetEntityNameByIds(userPosts)
+	if err != nil {
+		return err
+	}
+	data.PostName = strings.Join(postNames, ",")
+
 	userGroups, err := userService.GetUserGroupIds(userId)
 	if err != nil {
 		return err

+ 1 - 0
opms_admin/app/model/sys_user.go

@@ -50,6 +50,7 @@ type SysUserSearchReq struct {
 type SysUserRes struct {
 	SysUser
 	DeptName string `json:"deptName"` //部门名称
+	PostName string `json:"postName"` //岗位名称
 }
 
 // SetUserReq 添加修改用户公用请求字段

+ 3 - 1
opms_admin/app/service/base_product_auth.go

@@ -96,7 +96,9 @@ func (s *lineService) GetProductLineUsers(req *model.SysUserSearchReq) (total in
 		return 0, nil, err
 	}
 
-	total, users, err := userService.GetUsersByDeptEx(req)
+	//total, users, err := userService.GetUsersByDeptEx(req)
+	req.Status = "10"
+	total, users, err := userService.GetUserList(req)
 	if err != nil {
 		return 0, nil, err
 	}

+ 3 - 1
opms_admin/app/service/base_region_auth.go

@@ -137,7 +137,9 @@ func (s *regionService) GetRegionUsers(req *model.SysUserSearchReq) (total int,
 		return 0, nil, err
 	}
 
-	total, users, err := userService.GetUsersByDeptEx(req)
+	//total, users, err := userService.GetUsersByDeptEx(req)
+	req.Status = "10"
+	total, users, err := userService.GetUserList(req)
 	if err != nil {
 		return 0, nil, err
 	}

+ 6 - 6
opms_admin/app/service/sys_login_log.go

@@ -30,10 +30,10 @@ func NewLoginLogService(ctx context.Context) (svc *LoginLogService, err error) {
 	return svc, nil
 }
 
-func (s *LoginLogService) Invoke(ctx context.Context, userName, msg string) {
+func (s *LoginLogService) Invoke(ctx context.Context, userName string, err error) {
 	s.Pool.Add(func() {
 		//写入日志数据
-		s.Create(ctx, userName, msg)
+		s.Create(ctx, userName, err)
 	})
 }
 
@@ -81,7 +81,7 @@ func (s *LoginLogService) GetList(req *model.SysLoginLogSearchReq) (total int, l
 }
 
 // Create 记录登录日志
-func (s *LoginLogService) Create(ctx context.Context, userName, msg string) {
+func (s *LoginLogService) Create(ctx context.Context, userName string, loginErr error) {
 	clientIP, userAgent, err := micro_srv.GetBrowserInfo(ctx)
 	if err != nil {
 		// 非必要信息,只输出错误日志
@@ -90,10 +90,10 @@ func (s *LoginLogService) Create(ctx context.Context, userName, msg string) {
 	ua := user_agent.New(userAgent)
 	browser, _ := ua.Browser()
 	status := "10"
-	if msg != "操作成功" {
+	msg := "登录成功"
+	if loginErr != nil {
 		status = "20"
-	} else {
-		msg = "登录成功"
+		msg = err.Error()
 	}
 	loginData := &model.SysLogin{
 		UserName:      userName,

+ 6 - 0
opms_admin/app/service/sys_post.go

@@ -69,6 +69,12 @@ func (s *PostService) GetEntity(id int64) (post *model.SysPostRes, err error) {
 	return
 }
 
+// GetEntityNameByIds根据ID获取名称
+func (s *PostService) GetEntityNameByIds(ids []int) ([]string, error) {
+	result, err := s.Dao.WhereIn(s.Dao.C.Id, ids).Fields(s.Dao.C.PostName).Array()
+	return gconv.Strings(result), err
+}
+
 func (s *PostService) Create(params *model.SysPostReq) error {
 	data := new(model.SysPost)
 	if err := gconv.Struct(params, data); err != nil {

+ 10 - 2
opms_admin/app/service/sys_user.go

@@ -125,7 +125,15 @@ func (s *UserService) GetUserList(req *model.SysUserSearchReq) (total int, userL
 	if err != nil {
 		return
 	}
-	err = userModel.Page(req.PageNum, req.PageSize).Order("u.id asc").Scan(&userList)
+
+	userModel = userModel.OrderAsc("u.id")
+	if req.OrderBy == "userName" {
+		userModel = userModel.OrderAsc("u.user_name")
+	}
+	if req.OrderBy == "createdTime" {
+		userModel = userModel.OrderAsc("u.created_time")
+	}
+	err = userModel.Page(req.PageNum, req.PageSize).Scan(&userList)
 	deptService, _ := NewDeptService(s.Ctx)
 	deptInfo, err := deptService.GetAllDeptName()
 	if err != nil {
@@ -252,7 +260,7 @@ func (s *UserService) GetUserByUsername(ctx context.Context, userName string) (u
 }
 
 // GetUserInfoById 通过Id获取用户信息
-func (s *UserService) GetUserInfoById(id int, withPwd ...bool) (user *model.SysUser, err error) {
+func (s *UserService) GetUserInfoById(id int, withPwd ...bool) (user *model.SysUserRes, err error) {
 	if len(withPwd) > 0 && withPwd[0] {
 		//用户用户信息
 		err = s.Dao.Where(s.Dao.C.Id, id).Scan(&user)

+ 737 - 0
opms_parent/app/dao/plat/internal/plat_punch_records.go

@@ -0,0 +1,737 @@
+// ==========================================================================
+// This is auto-generated by gf cli tool. DO NOT EDIT THIS FILE MANUALLY.
+// ==========================================================================
+
+package internal
+
+import (
+	"context"
+	"database/sql"
+	"github.com/gogf/gf/database/gdb"
+	"github.com/gogf/gf/frame/g"
+	"github.com/gogf/gf/frame/gmvc"
+	"github.com/gogf/gf/util/gconv"
+	"strings"
+	"time"
+
+	model "dashoo.cn/micro/app/model/plat"
+)
+
+// PlatPunchRecordsDao is the manager for logic model data accessing and custom defined data operations functions management.
+type PlatPunchRecordsDao struct {
+	gmvc.M                          // M is the core and embedded struct that inherits all chaining operations from gdb.Model.
+	C       platPunchRecordsColumns // C is the short type for Columns, which contains all the column names of Table for convenient usage.
+	DB      gdb.DB                  // DB is the raw underlying database management object.
+	Table   string                  // Table is the underlying table name of the DAO.
+	TableAs string                  // TableAs is the underlying table alias name of the DAO.
+}
+
+// PlatPunchRecordsColumns defines and stores column names for table plat_punch_records.
+type platPunchRecordsColumns struct {
+	Id            string // 主键
+	UserId        string // 关联用户
+	UserNickName  string // 用户昵称
+	UserPostName  string // 用户岗位
+	UserAvatar    string // 用户头像
+	PunchTime     string // 打卡时间
+	PunchImg      string // 打卡照片
+	PunchLng      string // 经度
+	PunchLat      string // 纬度
+	PunchLocation string // 打卡地址
+	Remark        string // 备注
+	CreatedBy     string // 创建者
+	CreatedName   string // 创建人
+	CreatedTime   string // 创建时间
+	UpdatedBy     string // 更新者
+	UpdatedName   string // 更新人
+	UpdatedTime   string // 更新时间
+	DeletedTime   string // 删除时间
+}
+
+var (
+	// PlatPunchRecords is globally public accessible object for table plat_punch_records operations.
+	PlatPunchRecords = PlatPunchRecordsDao{
+		M:     g.DB("default").Model("plat_punch_records").Safe(),
+		DB:    g.DB("default"),
+		Table: "plat_punch_records",
+		C: platPunchRecordsColumns{
+			Id:            "id",
+			UserId:        "user_id",
+			UserNickName:  "user_nick_name",
+			UserPostName:  "user_post_name",
+			UserAvatar:    "user_avatar",
+			PunchTime:     "punch_time",
+			PunchImg:      "punch_img",
+			PunchLng:      "punch_lng",
+			PunchLat:      "punch_lat",
+			PunchLocation: "punch_location",
+			Remark:        "remark",
+			CreatedBy:     "created_by",
+			CreatedName:   "created_name",
+			CreatedTime:   "created_time",
+			UpdatedBy:     "updated_by",
+			UpdatedName:   "updated_name",
+			UpdatedTime:   "updated_time",
+			DeletedTime:   "deleted_time",
+		},
+	}
+)
+
+func NewPlatPunchRecordsDao(tenant string) PlatPunchRecordsDao {
+	var dao PlatPunchRecordsDao
+	dao = PlatPunchRecordsDao{
+		M:     g.DB(tenant).Model("plat_punch_records").Safe(),
+		DB:    g.DB(tenant),
+		Table: "plat_punch_records",
+		C: platPunchRecordsColumns{
+			Id:            "id",
+			UserId:        "user_id",
+			UserNickName:  "user_nick_name",
+			UserPostName:  "user_post_name",
+			UserAvatar:    "user_avatar",
+			PunchTime:     "punch_time",
+			PunchImg:      "punch_img",
+			PunchLng:      "punch_lng",
+			PunchLat:      "punch_lat",
+			PunchLocation: "punch_location",
+			Remark:        "remark",
+			CreatedBy:     "created_by",
+			CreatedName:   "created_name",
+			CreatedTime:   "created_time",
+			UpdatedBy:     "updated_by",
+			UpdatedName:   "updated_name",
+			UpdatedTime:   "updated_time",
+			DeletedTime:   "deleted_time",
+		},
+	}
+	return dao
+}
+
+// Ctx is a chaining function, which creates and returns a new DB that is a shallow copy
+// of current DB object and with given context in it.
+// Note that this returned DB object can be used only once, so do not assign it to
+// a global or package variable for long using.
+func (d *PlatPunchRecordsDao) Ctx(ctx context.Context) *PlatPunchRecordsDao {
+	return &PlatPunchRecordsDao{M: d.M.Ctx(ctx), Table: d.Table, TableAs: d.TableAs}
+}
+
+// GetCtx returns the context for current Model.
+// It returns "context.Background() i"s there's no context previously set.
+func (d *PlatPunchRecordsDao) GetCtx() context.Context {
+	return d.M.GetCtx()
+}
+
+// As sets an alias name for current table.
+func (d *PlatPunchRecordsDao) As(as string) *PlatPunchRecordsDao {
+	return &PlatPunchRecordsDao{M: d.M.As(as), Table: d.Table, TableAs: as}
+}
+
+// TX sets the transaction for current operation.
+func (d *PlatPunchRecordsDao) TX(tx *gdb.TX) *PlatPunchRecordsDao {
+	return &PlatPunchRecordsDao{M: d.M.TX(tx), Table: d.Table, TableAs: d.TableAs}
+}
+
+// Master marks the following operation on master node.
+func (d *PlatPunchRecordsDao) Master() *PlatPunchRecordsDao {
+	return &PlatPunchRecordsDao{M: d.M.Master(), Table: d.Table, TableAs: d.TableAs}
+}
+
+// Slave marks the following operation on slave node.
+// Note that it makes sense only if there's any slave node configured.
+func (d *PlatPunchRecordsDao) Slave() *PlatPunchRecordsDao {
+	return &PlatPunchRecordsDao{M: d.M.Slave(), Table: d.Table, TableAs: d.TableAs}
+}
+
+// Args sets custom arguments for model operation.
+func (d *PlatPunchRecordsDao) Args(args ...interface{}) *PlatPunchRecordsDao {
+	return &PlatPunchRecordsDao{M: d.M.Args(args...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// Handler calls each of "handlers" on current Model and returns a new Model.
+// ModelHandler is a function that handles given Model and returns a new Model that is custom modified.
+func (d *PlatPunchRecordsDao) Handler(handlers ...gdb.ModelHandler) *PlatPunchRecordsDao {
+	return &PlatPunchRecordsDao{M: d.M.Handler(handlers...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// LeftJoin does "LEFT JOIN ... ON ..." statement on the model.
+// The parameter <table> can be joined table and its joined condition,
+// and also with its alias name, like:
+// Table("user").LeftJoin("user_detail", "user_detail.uid=user.uid")
+// Table("user", "u").LeftJoin("user_detail", "ud", "ud.uid=u.uid")
+func (d *PlatPunchRecordsDao) LeftJoin(table ...string) *PlatPunchRecordsDao {
+	return &PlatPunchRecordsDao{M: d.M.LeftJoin(table...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// RightJoin does "RIGHT JOIN ... ON ..." statement on the model.
+// The parameter <table> can be joined table and its joined condition,
+// and also with its alias name, like:
+// Table("user").RightJoin("user_detail", "user_detail.uid=user.uid")
+// Table("user", "u").RightJoin("user_detail", "ud", "ud.uid=u.uid")
+func (d *PlatPunchRecordsDao) RightJoin(table ...string) *PlatPunchRecordsDao {
+	return &PlatPunchRecordsDao{M: d.M.RightJoin(table...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// InnerJoin does "INNER JOIN ... ON ..." statement on the model.
+// The parameter <table> can be joined table and its joined condition,
+// and also with its alias name, like:
+// Table("user").InnerJoin("user_detail", "user_detail.uid=user.uid")
+// Table("user", "u").InnerJoin("user_detail", "ud", "ud.uid=u.uid")
+func (d *PlatPunchRecordsDao) InnerJoin(table ...string) *PlatPunchRecordsDao {
+	return &PlatPunchRecordsDao{M: d.M.InnerJoin(table...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// Fields sets the operation fields of the model, multiple fields joined using char ','.
+// The parameter <fieldNamesOrMapStruct> can be type of string/map/*map/struct/*struct.
+func (d *PlatPunchRecordsDao) Fields(fieldNamesOrMapStruct ...interface{}) *PlatPunchRecordsDao {
+	return &PlatPunchRecordsDao{M: d.M.Fields(fieldNamesOrMapStruct...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// FieldsEx sets the excluded operation fields of the model, multiple fields joined using char ','.
+// The parameter <fieldNamesOrMapStruct> can be type of string/map/*map/struct/*struct.
+func (d *PlatPunchRecordsDao) FieldsEx(fieldNamesOrMapStruct ...interface{}) *PlatPunchRecordsDao {
+	return &PlatPunchRecordsDao{M: d.M.FieldsEx(fieldNamesOrMapStruct...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// FieldCount formats and appends commonly used field "COUNT(column)" to the select fields of model.
+func (d *PlatPunchRecordsDao) FieldCount(column string, as ...string) *PlatPunchRecordsDao {
+	return &PlatPunchRecordsDao{M: d.M.FieldCount(column, as...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// FieldSum formats and appends commonly used field "SUM(column)" to the select fields of model.
+func (d *PlatPunchRecordsDao) FieldSum(column string, as ...string) *PlatPunchRecordsDao {
+	return &PlatPunchRecordsDao{M: d.M.FieldSum(column, as...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// FieldMin formats and appends commonly used field "MIN(column)" to the select fields of model.
+func (d *PlatPunchRecordsDao) FieldMin(column string, as ...string) *PlatPunchRecordsDao {
+	return &PlatPunchRecordsDao{M: d.M.FieldMin(column, as...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// FieldMax formats and appends commonly used field "MAX(column)" to the select fields of model.
+func (d *PlatPunchRecordsDao) FieldMax(column string, as ...string) *PlatPunchRecordsDao {
+	return &PlatPunchRecordsDao{M: d.M.FieldMax(column, as...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// FieldAvg formats and appends commonly used field "AVG(column)" to the select fields of model.
+func (d *PlatPunchRecordsDao) FieldAvg(column string, as ...string) *PlatPunchRecordsDao {
+	return &PlatPunchRecordsDao{M: d.M.FieldAvg(column, as...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// Option adds extra operation option for the model.
+// Deprecated, use separate operations instead.
+func (d *PlatPunchRecordsDao) Option(option int) *PlatPunchRecordsDao {
+	return &PlatPunchRecordsDao{M: d.M.Option(option), Table: d.Table, TableAs: d.TableAs}
+}
+
+// OmitEmpty sets OPTION_OMITEMPTY option for the model, which automatically filers
+// the data and where attributes for empty values.
+func (d *PlatPunchRecordsDao) OmitEmpty() *PlatPunchRecordsDao {
+	return &PlatPunchRecordsDao{M: d.M.OmitEmpty(), Table: d.Table, TableAs: d.TableAs}
+}
+
+// OmitEmptyWhere sets optionOmitEmptyWhere option for the model, which automatically filers
+// the Where/Having parameters for "empty" values.
+func (d *PlatPunchRecordsDao) OmitEmptyWhere() *PlatPunchRecordsDao {
+	return &PlatPunchRecordsDao{M: d.M.OmitEmptyWhere(), Table: d.Table, TableAs: d.TableAs}
+}
+
+// OmitEmptyData sets optionOmitEmptyData option for the model, which automatically filers
+// the Data parameters for "empty" values.
+func (d *PlatPunchRecordsDao) OmitEmptyData() *PlatPunchRecordsDao {
+	return &PlatPunchRecordsDao{M: d.M.OmitEmptyData(), Table: d.Table, TableAs: d.TableAs}
+}
+
+// OmitNil sets optionOmitNil option for the model, which automatically filers
+// the data and where parameters for "nil" values.
+func (d *PlatPunchRecordsDao) OmitNil() *PlatPunchRecordsDao {
+	return &PlatPunchRecordsDao{M: d.M.OmitNil(), Table: d.Table, TableAs: d.TableAs}
+}
+
+// OmitNilWhere sets optionOmitNilWhere option for the model, which automatically filers
+// the Where/Having parameters for "nil" values.
+func (d *PlatPunchRecordsDao) OmitNilWhere() *PlatPunchRecordsDao {
+	return &PlatPunchRecordsDao{M: d.M.OmitNilWhere(), Table: d.Table, TableAs: d.TableAs}
+}
+
+// OmitNilData sets optionOmitNilData option for the model, which automatically filers
+// the Data parameters for "nil" values.
+func (d *PlatPunchRecordsDao) OmitNilData() *PlatPunchRecordsDao {
+	return &PlatPunchRecordsDao{M: d.M.OmitNilData(), Table: d.Table, TableAs: d.TableAs}
+}
+
+// Filter marks filtering the fields which does not exist in the fields of the operated table.
+// Note that this function supports only single table operations.
+// Deprecated, filter feature is automatically enabled from GoFrame v1.16.0, it is so no longer used.
+func (d *PlatPunchRecordsDao) Filter() *PlatPunchRecordsDao {
+	return &PlatPunchRecordsDao{M: d.M.Filter(), Table: d.Table, TableAs: d.TableAs}
+}
+
+// Where sets the condition statement for the model. The parameter <where> can be type of
+// string/map/gmap/slice/struct/*struct, etc. Note that, if it's called more than one times,
+// multiple conditions will be joined into where statement using "AND".
+// Eg:
+// Where("uid=10000")
+// Where("uid", 10000)
+// Where("money>? AND name like ?", 99999, "vip_%")
+// Where("uid", 1).Where("name", "john")
+// Where("status IN (?)", g.Slice{1,2,3})
+// Where("age IN(?,?)", 18, 50)
+// Where(User{ Id : 1, UserName : "john"})
+func (d *PlatPunchRecordsDao) Where(where interface{}, args ...interface{}) *PlatPunchRecordsDao {
+	return &PlatPunchRecordsDao{M: d.M.Where(where, args...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WherePri does the same logic as M.Where except that if the parameter <where>
+// is a single condition like int/string/float/slice, it treats the condition as the primary
+// key value. That is, if primary key is "id" and given <where> parameter as "123", the
+// WherePri function treats the condition as "id=123", but M.Where treats the condition
+// as string "123".
+func (d *PlatPunchRecordsDao) WherePri(where interface{}, args ...interface{}) *PlatPunchRecordsDao {
+	return &PlatPunchRecordsDao{M: d.M.WherePri(where, args...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// Having sets the having statement for the model.
+// The parameters of this function usage are as the same as function Where.
+// See Where.
+func (d *PlatPunchRecordsDao) Having(having interface{}, args ...interface{}) *PlatPunchRecordsDao {
+	return &PlatPunchRecordsDao{M: d.M.Having(having, args...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// Wheref builds condition string using fmt.Sprintf and arguments.
+// Note that if the number of "args" is more than the place holder in "format",
+// the extra "args" will be used as the where condition arguments of the Model.
+func (d *PlatPunchRecordsDao) Wheref(format string, args ...interface{}) *PlatPunchRecordsDao {
+	return &PlatPunchRecordsDao{M: d.M.Wheref(format, args...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereLT builds "column < value" statement.
+func (d *PlatPunchRecordsDao) WhereLT(column string, value interface{}) *PlatPunchRecordsDao {
+	return &PlatPunchRecordsDao{M: d.M.WhereLT(column, value), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereLTE builds "column <= value" statement.
+func (d *PlatPunchRecordsDao) WhereLTE(column string, value interface{}) *PlatPunchRecordsDao {
+	return &PlatPunchRecordsDao{M: d.M.WhereLTE(column, value), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereGT builds "column > value" statement.
+func (d *PlatPunchRecordsDao) WhereGT(column string, value interface{}) *PlatPunchRecordsDao {
+	return &PlatPunchRecordsDao{M: d.M.WhereGT(column, value), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereGTE builds "column >= value" statement.
+func (d *PlatPunchRecordsDao) WhereGTE(column string, value interface{}) *PlatPunchRecordsDao {
+	return &PlatPunchRecordsDao{M: d.M.WhereGTE(column, value), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereBetween builds "column BETWEEN min AND max" statement.
+func (d *PlatPunchRecordsDao) WhereBetween(column string, min, max interface{}) *PlatPunchRecordsDao {
+	return &PlatPunchRecordsDao{M: d.M.WhereBetween(column, min, max), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereLike builds "column LIKE like" statement.
+func (d *PlatPunchRecordsDao) WhereLike(column string, like interface{}) *PlatPunchRecordsDao {
+	return &PlatPunchRecordsDao{M: d.M.WhereLike(column, like), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereIn builds "column IN (in)" statement.
+func (d *PlatPunchRecordsDao) WhereIn(column string, in interface{}) *PlatPunchRecordsDao {
+	return &PlatPunchRecordsDao{M: d.M.WhereIn(column, in), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereNull builds "columns[0] IS NULL AND columns[1] IS NULL ..." statement.
+func (d *PlatPunchRecordsDao) WhereNull(columns ...string) *PlatPunchRecordsDao {
+	return &PlatPunchRecordsDao{M: d.M.WhereNull(columns...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereNotBetween builds "column NOT BETWEEN min AND max" statement.
+func (d *PlatPunchRecordsDao) WhereNotBetween(column string, min, max interface{}) *PlatPunchRecordsDao {
+	return &PlatPunchRecordsDao{M: d.M.WhereNotBetween(column, min, max), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereNotLike builds "column NOT LIKE like" statement.
+func (d *PlatPunchRecordsDao) WhereNotLike(column string, like interface{}) *PlatPunchRecordsDao {
+	return &PlatPunchRecordsDao{M: d.M.WhereNotLike(column, like), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereNot builds "column != value" statement.
+func (d *PlatPunchRecordsDao) WhereNot(column string, value interface{}) *PlatPunchRecordsDao {
+	return &PlatPunchRecordsDao{M: d.M.WhereNot(column, value), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereNotIn builds "column NOT IN (in)" statement.
+func (d *PlatPunchRecordsDao) WhereNotIn(column string, in interface{}) *PlatPunchRecordsDao {
+	return &PlatPunchRecordsDao{M: d.M.WhereNotIn(column, in), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereNotNull builds "columns[0] IS NOT NULL AND columns[1] IS NOT NULL ..." statement.
+func (d *PlatPunchRecordsDao) WhereNotNull(columns ...string) *PlatPunchRecordsDao {
+	return &PlatPunchRecordsDao{M: d.M.WhereNotNull(columns...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereOr adds "OR" condition to the where statement.
+func (d *PlatPunchRecordsDao) WhereOr(where interface{}, args ...interface{}) *PlatPunchRecordsDao {
+	return &PlatPunchRecordsDao{M: d.M.WhereOr(where, args...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereOrf builds "OR" condition string using fmt.Sprintf and arguments.
+func (d *PlatPunchRecordsDao) WhereOrf(format string, args ...interface{}) *PlatPunchRecordsDao {
+	return &PlatPunchRecordsDao{M: d.M.WhereOrf(format, args...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereOrLT builds "column < value" statement in "OR" conditions..
+func (d *PlatPunchRecordsDao) WhereOrLT(column string, value interface{}) *PlatPunchRecordsDao {
+	return &PlatPunchRecordsDao{M: d.M.WhereOrLT(column, value), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereOrLTE builds "column <= value" statement in "OR" conditions..
+func (d *PlatPunchRecordsDao) WhereOrLTE(column string, value interface{}) *PlatPunchRecordsDao {
+	return &PlatPunchRecordsDao{M: d.M.WhereOrLTE(column, value), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereOrGT builds "column > value" statement in "OR" conditions..
+func (d *PlatPunchRecordsDao) WhereOrGT(column string, value interface{}) *PlatPunchRecordsDao {
+	return &PlatPunchRecordsDao{M: d.M.WhereOrGT(column, value), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereOrGTE builds "column >= value" statement in "OR" conditions..
+func (d *PlatPunchRecordsDao) WhereOrGTE(column string, value interface{}) *PlatPunchRecordsDao {
+	return &PlatPunchRecordsDao{M: d.M.WhereOrGTE(column, value), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereOrBetween builds "column BETWEEN min AND max" statement in "OR" conditions.
+func (d *PlatPunchRecordsDao) WhereOrBetween(column string, min, max interface{}) *PlatPunchRecordsDao {
+	return &PlatPunchRecordsDao{M: d.M.WhereOrBetween(column, min, max), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereOrLike builds "column LIKE like" statement in "OR" conditions.
+func (d *PlatPunchRecordsDao) WhereOrLike(column string, like interface{}) *PlatPunchRecordsDao {
+	return &PlatPunchRecordsDao{M: d.M.WhereOrLike(column, like), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereOrIn builds "column IN (in)" statement in "OR" conditions.
+func (d *PlatPunchRecordsDao) WhereOrIn(column string, in interface{}) *PlatPunchRecordsDao {
+	return &PlatPunchRecordsDao{M: d.M.WhereOrIn(column, in), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereOrNull builds "columns[0] IS NULL OR columns[1] IS NULL ..." statement in "OR" conditions.
+func (d *PlatPunchRecordsDao) WhereOrNull(columns ...string) *PlatPunchRecordsDao {
+	return &PlatPunchRecordsDao{M: d.M.WhereOrNull(columns...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereOrNotBetween builds "column NOT BETWEEN min AND max" statement in "OR" conditions.
+func (d *PlatPunchRecordsDao) WhereOrNotBetween(column string, min, max interface{}) *PlatPunchRecordsDao {
+	return &PlatPunchRecordsDao{M: d.M.WhereOrNotBetween(column, min, max), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereOrNotLike builds "column NOT LIKE like" statement in "OR" conditions.
+func (d *PlatPunchRecordsDao) WhereOrNotLike(column string, like interface{}) *PlatPunchRecordsDao {
+	return &PlatPunchRecordsDao{M: d.M.WhereOrNotLike(column, like), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereOrNotIn builds "column NOT IN (in)" statement.
+func (d *PlatPunchRecordsDao) WhereOrNotIn(column string, in interface{}) *PlatPunchRecordsDao {
+	return &PlatPunchRecordsDao{M: d.M.WhereOrNotIn(column, in), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereOrNotNull builds "columns[0] IS NOT NULL OR columns[1] IS NOT NULL ..." statement in "OR" conditions.
+func (d *PlatPunchRecordsDao) WhereOrNotNull(columns ...string) *PlatPunchRecordsDao {
+	return &PlatPunchRecordsDao{M: d.M.WhereOrNotNull(columns...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// Group sets the "GROUP BY" statement for the model.
+func (d *PlatPunchRecordsDao) Group(groupBy ...string) *PlatPunchRecordsDao {
+	return &PlatPunchRecordsDao{M: d.M.Group(groupBy...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// And adds "AND" condition to the where statement.
+// Deprecated, use Where instead.
+func (d *PlatPunchRecordsDao) And(where interface{}, args ...interface{}) *PlatPunchRecordsDao {
+	return &PlatPunchRecordsDao{M: d.M.And(where, args...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// Or adds "OR" condition to the where statement.
+// Deprecated, use WhereOr instead.
+func (d *PlatPunchRecordsDao) Or(where interface{}, args ...interface{}) *PlatPunchRecordsDao {
+	return &PlatPunchRecordsDao{M: d.M.Or(where, args...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// GroupBy sets the "GROUP BY" statement for the model.
+func (d *PlatPunchRecordsDao) GroupBy(groupBy string) *PlatPunchRecordsDao {
+	return &PlatPunchRecordsDao{M: d.M.Group(groupBy), Table: d.Table, TableAs: d.TableAs}
+}
+
+// Order sets the "ORDER BY" statement for the model.
+func (d *PlatPunchRecordsDao) Order(orderBy ...string) *PlatPunchRecordsDao {
+	return &PlatPunchRecordsDao{M: d.M.Order(orderBy...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// OrderAsc sets the "ORDER BY xxx ASC" statement for the model.
+func (d *PlatPunchRecordsDao) OrderAsc(column string) *PlatPunchRecordsDao {
+	return &PlatPunchRecordsDao{M: d.M.OrderAsc(column), Table: d.Table, TableAs: d.TableAs}
+}
+
+// OrderDesc sets the "ORDER BY xxx DESC" statement for the model.
+func (d *PlatPunchRecordsDao) OrderDesc(column string) *PlatPunchRecordsDao {
+	return &PlatPunchRecordsDao{M: d.M.OrderDesc(column), Table: d.Table, TableAs: d.TableAs}
+}
+
+// OrderRandom sets the "ORDER BY RANDOM()" statement for the model.
+func (d *PlatPunchRecordsDao) OrderRandom() *PlatPunchRecordsDao {
+	return &PlatPunchRecordsDao{M: d.M.OrderRandom(), Table: d.Table, TableAs: d.TableAs}
+}
+
+// OrderBy is alias of Model.Order.
+// See Model.Order.
+// Deprecated, use Order instead.
+func (d *PlatPunchRecordsDao) OrderBy(orderBy string) *PlatPunchRecordsDao {
+	return &PlatPunchRecordsDao{M: d.M.Order(orderBy), Table: d.Table, TableAs: d.TableAs}
+}
+
+// Limit sets the "LIMIT" statement for the model.
+// The parameter <limit> can be either one or two number, if passed two number is passed,
+// it then sets "LIMIT limit[0],limit[1]" statement for the model, or else it sets "LIMIT limit[0]"
+// statement.
+func (d *PlatPunchRecordsDao) Limit(limit ...int) *PlatPunchRecordsDao {
+	return &PlatPunchRecordsDao{M: d.M.Limit(limit...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// Offset sets the "OFFSET" statement for the model.
+// It only makes sense for some databases like SQLServer, PostgreSQL, etc.
+func (d *PlatPunchRecordsDao) Offset(offset int) *PlatPunchRecordsDao {
+	return &PlatPunchRecordsDao{M: d.M.Offset(offset), Table: d.Table, TableAs: d.TableAs}
+}
+
+// Distinct forces the query to only return distinct results.
+func (d *PlatPunchRecordsDao) Distinct() *PlatPunchRecordsDao {
+	return &PlatPunchRecordsDao{M: d.M.Distinct(), Table: d.Table, TableAs: d.TableAs}
+}
+
+// Page sets the paging number for the model.
+// The parameter <page> is started from 1 for paging.
+// Note that, it differs that the Limit function start from 0 for "LIMIT" statement.
+func (d *PlatPunchRecordsDao) Page(page, limit int) *PlatPunchRecordsDao {
+	return &PlatPunchRecordsDao{M: d.M.Page(page, limit), Table: d.Table, TableAs: d.TableAs}
+}
+
+// Batch sets the batch operation number for the model.
+func (d *PlatPunchRecordsDao) Batch(batch int) *PlatPunchRecordsDao {
+	return &PlatPunchRecordsDao{M: d.M.Batch(batch), Table: d.Table, TableAs: d.TableAs}
+}
+
+// Cache sets the cache feature for the model. It caches the result of the sql, which means
+// if there's another same sql request, it just reads and returns the result from cache, it
+// but not committed and executed into the database.
+//
+// If the parameter <duration> < 0, which means it clear the cache with given <name>.
+// If the parameter <duration> = 0, which means it never expires.
+// If the parameter <duration> > 0, which means it expires after <duration>.
+//
+// The optional parameter <name> is used to bind a name to the cache, which means you can later
+// control the cache like changing the <duration> or clearing the cache with specified <name>.
+//
+// Note that, the cache feature is disabled if the model is operating on a transaction.
+func (d *PlatPunchRecordsDao) Cache(duration time.Duration, name ...string) *PlatPunchRecordsDao {
+	return &PlatPunchRecordsDao{M: d.M.Cache(duration, name...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// Data sets the operation data for the model.
+// The parameter <data> can be type of string/map/gmap/slice/struct/*struct, etc.
+// Eg:
+// Data("uid=10000")
+// Data("uid", 10000)
+// Data(g.Map{"uid": 10000, "name":"john"})
+// Data(g.Slice{g.Map{"uid": 10000, "name":"john"}, g.Map{"uid": 20000, "name":"smith"})
+func (d *PlatPunchRecordsDao) Data(data ...interface{}) *PlatPunchRecordsDao {
+	return &PlatPunchRecordsDao{M: d.M.Data(data...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// All does "SELECT FROM ..." statement for the model.
+// It retrieves the records from table and returns the result as []*model.PlatPunchRecords.
+// It returns nil if there's no record retrieved with the given conditions from table.
+//
+// The optional parameter <where> is the same as the parameter of M.Where function,
+// see M.Where.
+func (d *PlatPunchRecordsDao) All(where ...interface{}) ([]*model.PlatPunchRecords, error) {
+	all, err := d.M.All(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entities []*model.PlatPunchRecords
+	if err = all.Structs(&entities); err != nil && err != sql.ErrNoRows {
+		return nil, err
+	}
+	return entities, nil
+}
+
+// One retrieves one record from table and returns the result as *model.PlatPunchRecords.
+// It returns nil if there's no record retrieved with the given conditions from table.
+//
+// The optional parameter <where> is the same as the parameter of M.Where function,
+// see M.Where.
+func (d *PlatPunchRecordsDao) One(where ...interface{}) (*model.PlatPunchRecords, error) {
+	one, err := d.M.One(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entity *model.PlatPunchRecords
+	if err = one.Struct(&entity); err != nil && err != sql.ErrNoRows {
+		return nil, err
+	}
+	return entity, nil
+}
+
+// FindOne retrieves and returns a single Record by M.WherePri and M.One.
+// Also see M.WherePri and M.One.
+func (d *PlatPunchRecordsDao) FindOne(where ...interface{}) (*model.PlatPunchRecords, error) {
+	one, err := d.M.FindOne(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entity *model.PlatPunchRecords
+	if err = one.Struct(&entity); err != nil && err != sql.ErrNoRows {
+		return nil, err
+	}
+	return entity, nil
+}
+
+// FindAll retrieves and returns Result by by M.WherePri and M.All.
+// Also see M.WherePri and M.All.
+func (d *PlatPunchRecordsDao) FindAll(where ...interface{}) ([]*model.PlatPunchRecords, error) {
+	all, err := d.M.FindAll(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entities []*model.PlatPunchRecords
+	if err = all.Structs(&entities); err != nil && err != sql.ErrNoRows {
+		return nil, err
+	}
+	return entities, nil
+}
+
+// Struct retrieves one record from table and converts it into given struct.
+// The parameter <pointer> should be type of *struct/**struct. If type **struct is given,
+// it can create the struct internally during converting.
+//
+// The optional parameter <where> is the same as the parameter of Model.Where function,
+// see Model.Where.
+//
+// Note that it returns sql.ErrNoRows if there's no record retrieved with the given conditions
+// from table and <pointer> is not nil.
+//
+// Eg:
+// user := new(User)
+// err  := dao.User.Where("id", 1).Struct(user)
+//
+// user := (*User)(nil)
+// err  := dao.User.Where("id", 1).Struct(&user)
+func (d *PlatPunchRecordsDao) Struct(pointer interface{}, where ...interface{}) error {
+	return d.M.Struct(pointer, where...)
+}
+
+// Structs retrieves records from table and converts them into given struct slice.
+// The parameter <pointer> should be type of *[]struct/*[]*struct. It can create and fill the struct
+// slice internally during converting.
+//
+// The optional parameter <where> is the same as the parameter of Model.Where function,
+// see Model.Where.
+//
+// Note that it returns sql.ErrNoRows if there's no record retrieved with the given conditions
+// from table and <pointer> is not empty.
+//
+// Eg:
+// users := ([]User)(nil)
+// err   := dao.User.Structs(&users)
+//
+// users := ([]*User)(nil)
+// err   := dao.User.Structs(&users)
+func (d *PlatPunchRecordsDao) Structs(pointer interface{}, where ...interface{}) error {
+	return d.M.Structs(pointer, where...)
+}
+
+// Scan automatically calls Struct or Structs function according to the type of parameter <pointer>.
+// It calls function Struct if <pointer> is type of *struct/**struct.
+// It calls function Structs if <pointer> is type of *[]struct/*[]*struct.
+//
+// The optional parameter <where> is the same as the parameter of Model.Where function,
+// see Model.Where.
+//
+// Note that it returns sql.ErrNoRows if there's no record retrieved and given pointer is not empty or nil.
+//
+// Eg:
+// user  := new(User)
+// err   := dao.User.Where("id", 1).Scan(user)
+//
+// user  := (*User)(nil)
+// err   := dao.User.Where("id", 1).Scan(&user)
+//
+// users := ([]User)(nil)
+// err   := dao.User.Scan(&users)
+//
+// users := ([]*User)(nil)
+// err   := dao.User.Scan(&users)
+func (d *PlatPunchRecordsDao) Scan(pointer interface{}, where ...interface{}) error {
+	return d.M.Scan(pointer, where...)
+}
+
+// Chunk iterates the table with given size and callback function.
+func (d *PlatPunchRecordsDao) Chunk(limit int, callback func(entities []*model.PlatPunchRecords, err error) bool) {
+	d.M.Chunk(limit, func(result gdb.Result, err error) bool {
+		var entities []*model.PlatPunchRecords
+		err = result.Structs(&entities)
+		if err == sql.ErrNoRows {
+			return false
+		}
+		return callback(entities, err)
+	})
+}
+
+// LockUpdate sets the lock for update for current operation.
+func (d *PlatPunchRecordsDao) LockUpdate() *PlatPunchRecordsDao {
+	return &PlatPunchRecordsDao{M: d.M.LockUpdate(), Table: d.Table, TableAs: d.TableAs}
+}
+
+// LockShared sets the lock in share mode for current operation.
+func (d *PlatPunchRecordsDao) LockShared() *PlatPunchRecordsDao {
+	return &PlatPunchRecordsDao{M: d.M.LockShared(), Table: d.Table, TableAs: d.TableAs}
+}
+
+// Unscoped enables/disables the soft deleting feature.
+func (d *PlatPunchRecordsDao) Unscoped() *PlatPunchRecordsDao {
+	return &PlatPunchRecordsDao{M: d.M.Unscoped(), Table: d.Table, TableAs: d.TableAs}
+}
+
+// DataScope enables the DataScope feature.
+func (d *PlatPunchRecordsDao) DataScope(ctx context.Context, userCol ...string) *PlatPunchRecordsDao {
+	cs := ctx.Value("contextService")
+	dataScope := gconv.Map(cs)["dataScope"].(g.Map)
+	if dataScope != nil {
+		userIds, ok := dataScope["userIds"]
+		delete(dataScope, "userIds")
+		var columns []string
+		var values []interface{}
+		if ok && userIds != "-1" {
+			column := "created_by"
+			if len(userCol) == 1 {
+				column = userCol[0]
+			}
+			dataScope[column] = userIds
+			if d.Table == "sys_user" {
+				dataScope["id"] = userIds
+			}
+		}
+		tableAs := d.TableAs
+		if d.TableAs != "" {
+			tableAs += "."
+		}
+		for k, v := range dataScope {
+			if ok, _ := d.M.HasField(k); ok {
+				columns = append(columns, tableAs+k+" IN (?) ")
+				values = append(values, v)
+			}
+		}
+		whereSql := strings.Join(columns, " OR ")
+		return &PlatPunchRecordsDao{M: d.M.Where(whereSql, values).Ctx(ctx), Table: d.Table, TableAs: d.TableAs}
+	}
+	return d
+}

+ 2 - 1
opms_parent/app/dao/plat/internal/plat_user_config.go

@@ -6,12 +6,13 @@ package internal
 
 import (
 	"context"
-	model "dashoo.cn/micro/app/model/plat"
 	"database/sql"
 	"github.com/gogf/gf/database/gdb"
 	"github.com/gogf/gf/frame/g"
 	"github.com/gogf/gf/frame/gmvc"
 	"time"
+
+	model "dashoo.cn/micro/app/model/plat"
 )
 
 // PlatUserConfigDao is the manager for logic model data accessing

+ 36 - 0
opms_parent/app/dao/plat/plat_punch_records.go

@@ -0,0 +1,36 @@
+// ============================================================================
+// This is auto-generated by gf cli tool only once. Fill this file as you wish.
+// ============================================================================
+
+package plat
+
+import (
+	"dashoo.cn/micro/app/dao/plat/internal"
+)
+
+// platPunchRecordsDao is the manager for logic model data accessing
+// and custom defined data operations functions management. You can define
+// methods on it to extend its functionality as you wish.
+type platPunchRecordsDao struct {
+	internal.PlatPunchRecordsDao
+}
+
+var (
+	// PlatPunchRecords is globally public accessible object for table plat_punch_records operations.
+	PlatPunchRecords = platPunchRecordsDao{
+		internal.PlatPunchRecords,
+	}
+)
+
+type PlatPunchRecordsDao struct {
+	internal.PlatPunchRecordsDao
+}
+
+func NewPlatPunchRecordsDao(tenant string) *PlatPunchRecordsDao {
+	dao := internal.NewPlatPunchRecordsDao(tenant)
+	return &PlatPunchRecordsDao{
+		dao,
+	}
+}
+
+// Fill with you ideas below.

+ 47 - 0
opms_parent/app/handler/plat/punch_records.go

@@ -0,0 +1,47 @@
+package plat
+
+import (
+	"context"
+
+	"dashoo.cn/common_definition/comm_def"
+	"github.com/gogf/gf/frame/g"
+	"github.com/gogf/gf/util/gvalid"
+
+	platModel "dashoo.cn/micro/app/model/plat"
+	platService "dashoo.cn/micro/app/service/plat"
+)
+
+type PunchRecordsHandler struct{}
+
+// GetList 打卡记录列表
+// Swagger:PunchRecords 打卡记录 打卡记录列表
+func (h *PunchRecordsHandler) GetList(ctx context.Context, req *platModel.SearchPunchRecordsReq, rsp *comm_def.CommonMsg) error {
+	punchService, err := platService.NewPunchRecordsService(ctx)
+	if err != nil {
+		return err
+	}
+	total, list, err := punchService.GetList(req)
+	if err != nil {
+		return err
+	}
+	rsp.Data = g.Map{"list": list, "total": total}
+	return nil
+}
+
+// Create 添加打卡记录
+// Swagger:PunchRecords 打卡记录 打卡
+func (h *PunchRecordsHandler) Create(ctx context.Context, req *platModel.AddPunchRecordsReq, rsp *comm_def.CommonMsg) error {
+	// 参数校验
+	if err := gvalid.CheckStruct(ctx, req, nil); err != nil {
+		return err
+	}
+	punchService, err := platService.NewPunchRecordsService(ctx)
+	if err != nil {
+		return err
+	}
+	err = punchService.Create(req)
+	if err != nil {
+		return err
+	}
+	return nil
+}

+ 31 - 0
opms_parent/app/model/plat/internal/plat_punch_records.go

@@ -0,0 +1,31 @@
+// ==========================================================================
+// This is auto-generated by gf cli tool. DO NOT EDIT THIS FILE MANUALLY.
+// ==========================================================================
+
+package internal
+
+import (
+	"github.com/gogf/gf/os/gtime"
+)
+
+// PlatPunchRecords is the golang structure for table plat_punch_records.
+type PlatPunchRecords struct {
+	Id            int         `orm:"id,primary"     json:"id"`            // 主键
+	UserId        int         `orm:"user_id"        json:"userId"`        // 关联用户
+	UserNickName  string      `orm:"user_nick_name" json:"userNickName"`  // 用户昵称
+	UserPostName  string      `orm:"user_post_name" json:"userPostName"`  // 用户岗位
+	UserAvatar    string      `orm:"user_avatar"    json:"userAvatar"`    // 用户头像
+	PunchTime     *gtime.Time `orm:"punch_time"     json:"punchTime"`     // 打卡时间
+	PunchImg      string      `orm:"punch_img"      json:"punchImg"`      // 打卡照片
+	PunchLng      string      `orm:"punch_lng"      json:"punchLng"`      // 经度
+	PunchLat      string      `orm:"punch_lat"      json:"punchLat"`      // 纬度
+	PunchLocation string      `orm:"punch_location" json:"punchLocation"` // 打卡地址
+	Remark        string      `orm:"remark"         json:"remark"`        // 备注
+	CreatedBy     int         `orm:"created_by"     json:"createdBy"`     // 创建者
+	CreatedName   string      `orm:"created_name"   json:"createdName"`   // 创建人
+	CreatedTime   *gtime.Time `orm:"created_time"   json:"createdTime"`   // 创建时间
+	UpdatedBy     int         `orm:"updated_by"     json:"updatedBy"`     // 更新者
+	UpdatedName   string      `orm:"updated_name"   json:"updatedName"`   // 更新人
+	UpdatedTime   *gtime.Time `orm:"updated_time"   json:"updatedTime"`   // 更新时间
+	DeletedTime   *gtime.Time `orm:"deleted_time"   json:"deletedTime"`   // 删除时间
+}

+ 30 - 0
opms_parent/app/model/plat/plat_punch_records.go

@@ -0,0 +1,30 @@
+// ==========================================================================
+// This is auto-generated by gf cli tool. Fill this file as you wish.
+// ==========================================================================
+
+package plat
+
+import (
+	"dashoo.cn/micro/app/model/plat/internal"
+	"dashoo.cn/opms_libary/request"
+)
+
+// PlatPunchRecords is the golang structure for table plat_punch_records.
+type PlatPunchRecords internal.PlatPunchRecords
+
+// Fill with you ideas below.
+
+type SearchPunchRecordsReq struct {
+	UserId int `json:"userId"` // 关联用户
+	request.PageReq
+}
+
+type AddPunchRecordsReq struct {
+	UserPostName  string `json:"userPostName"`                           // 用户岗位
+	UserAvatar    string `json:"userAvatar"`                             // 用户头像
+	PunchImg      string `json:"punchImg"         v:"required#打卡照片不能为空"` // 打卡照片
+	PunchLng      string `json:"punchLng"         v:"required#经度不能为空"`   // 经度
+	PunchLat      string `json:"punchLat"         v:"required#纬度不能为空"`   // 纬度
+	PunchLocation string `json:"punchLocation"    v:"required#打卡地址不能为空"` // 打卡地址
+	Remark        string `json:"remark"`                                 // 备注
+}

+ 3 - 3
opms_parent/app/model/plat/plat_task.go

@@ -5,18 +5,18 @@
 package plat
 
 import (
-	internal2 "dashoo.cn/micro/app/model/plat/internal"
+	"dashoo.cn/micro/app/model/plat/internal"
 	"dashoo.cn/opms_libary/request"
 	"github.com/gogf/gf/os/gtime"
 )
 
 // PlatTask is the golang structure for table plat_task.
-type PlatTask internal2.PlatTask
+type PlatTask internal.PlatTask
 
 // Fill with you ideas below.
 
 type PlatTaskEx struct {
-	internal2.PlatTask
+	internal.PlatTask
 	Step int `orm:"step"           json:"step"` // 步骤号
 }
 

+ 2 - 2
opms_parent/app/model/plat/plat_task_comment.go

@@ -5,12 +5,12 @@
 package plat
 
 import (
-	internal2 "dashoo.cn/micro/app/model/plat/internal"
+	"dashoo.cn/micro/app/model/plat/internal"
 	"dashoo.cn/opms_libary/request"
 )
 
 // PlatTaskComment is the golang structure for table plat_task_comment.
-type PlatTaskComment internal2.PlatTaskComment
+type PlatTaskComment internal.PlatTaskComment
 
 // Fill with you ideas below.
 

+ 2 - 2
opms_parent/app/model/plat/plat_task_handle.go

@@ -5,10 +5,10 @@
 package plat
 
 import (
-	internal2 "dashoo.cn/micro/app/model/plat/internal"
+	"dashoo.cn/micro/app/model/plat/internal"
 )
 
 // PlatTaskHandle is the golang structure for table plat_task_handle.
-type PlatTaskHandle internal2.PlatTaskHandle
+type PlatTaskHandle internal.PlatTaskHandle
 
 // Fill with you ideas below.

+ 2 - 2
opms_parent/app/model/plat/plat_task_log.go

@@ -5,12 +5,12 @@
 package plat
 
 import (
-	internal2 "dashoo.cn/micro/app/model/plat/internal"
+	"dashoo.cn/micro/app/model/plat/internal"
 	"dashoo.cn/opms_libary/request"
 )
 
 // PlatTaskLog is the golang structure for table plat_task_log.
-type PlatTaskLog internal2.PlatTaskLog
+type PlatTaskLog internal.PlatTaskLog
 
 // Fill with you ideas below.
 

+ 2 - 2
opms_parent/app/model/plat/plat_task_progress.go

@@ -5,12 +5,12 @@
 package plat
 
 import (
-	internal2 "dashoo.cn/micro/app/model/plat/internal"
+	"dashoo.cn/micro/app/model/plat/internal"
 	"dashoo.cn/opms_libary/request"
 )
 
 // PlatTaskProgress is the golang structure for table plat_task_progress.
-type PlatTaskProgress internal2.PlatTaskProgress
+type PlatTaskProgress internal.PlatTaskProgress
 
 // Fill with you ideas below.
 

+ 61 - 0
opms_parent/app/service/plat/plat_punch_records.go

@@ -0,0 +1,61 @@
+package plat
+
+import (
+	"context"
+	"github.com/gogf/gf/os/gtime"
+
+	"dashoo.cn/opms_libary/myerrors"
+	"github.com/gogf/gf/util/gconv"
+
+	"dashoo.cn/micro/app/dao/plat"
+	model "dashoo.cn/micro/app/model/plat"
+	"dashoo.cn/micro/app/service"
+)
+
+type PunchRecordsService struct {
+	*service.ContextService
+	Dao *plat.PlatPunchRecordsDao
+}
+
+func NewPunchRecordsService(ctx context.Context) (svc *PunchRecordsService, err error) {
+	svc = new(PunchRecordsService)
+	if svc.ContextService, err = svc.Init(ctx); err != nil {
+		return nil, err
+	}
+	svc.Dao = plat.NewPlatPunchRecordsDao(svc.Tenant)
+	return svc, nil
+}
+
+func (s *PunchRecordsService) GetList(req *model.SearchPunchRecordsReq) (total int, taskProgressList []*model.PlatPunchRecords, err error) {
+	db := s.Dao.Where(s.Dao.C.UserId, s.GetCxtUserId())
+	if req.BeginTime != "" {
+		db = db.WhereGTE(s.Dao.C.CreatedTime, req.BeginTime)
+	}
+	if req.EndTime != "" {
+		db = db.WhereLTE(s.Dao.C.CreatedTime, req.EndTime)
+	}
+	total, err = db.Count()
+	if err != nil {
+		err = myerrors.DbError("获取总行数失败。")
+		return
+	}
+
+	err = db.OrderDesc(s.Dao.C.CreatedTime).Page(req.GetPage()).Scan(&taskProgressList)
+	return
+}
+
+func (s *PunchRecordsService) Create(req *model.AddPunchRecordsReq) (err error) {
+	platPunchRecords := new(model.PlatPunchRecords)
+	if err = gconv.Struct(req, platPunchRecords); err != nil {
+		return
+	}
+	platPunchRecords.UserId = s.GetCxtUserId()
+	platPunchRecords.UserNickName = s.GetCxtUserName()
+	platPunchRecords.PunchTime = gtime.Now()
+	service.SetCreatedInfo(platPunchRecords, s.GetCxtUserId(), s.GetCxtUserName())
+	_, err = s.Dao.Data(platPunchRecords).Insert()
+	if err != nil {
+		return
+	}
+	return
+}

+ 6 - 1
opms_parent/app/service/proj/business.go

@@ -51,7 +51,12 @@ func (p *businessService) GetList(req *model.ProjBusinessSearchReq) (total int,
 	if req.NboType != "" {
 		db = db.Where("proj."+p.Dao.C.NboType, req.NboType)
 	}
-	db = db
+	if req.BeginTime != "" {
+		db = db.WhereGTE("proj."+p.Dao.C.CreatedTime, req.BeginTime)
+	}
+	if req.EndTime != "" {
+		db = db.WhereLTE("proj."+p.Dao.C.CreatedTime, req.EndTime)
+	}
 	total, err = db.Count()
 	if err != nil {
 		err = myerrors.DbError("获取总行数失败。")

+ 1 - 1
opms_parent/main.go

@@ -45,7 +45,7 @@ func main() {
 	s.RegisterName("TaskComment", new(plat.TaskCommentHandler), "")
 	s.RegisterName("TaskLog", new(plat.TaskLogHandler), "")
 	s.RegisterName("TaskProgress", new(plat.TaskProgressHandler), "")
-
+	s.RegisterName("PunchRecords", new(plat.PunchRecordsHandler), "")
 	s.RegisterName("Business", new(projHandler.BusinessHandler), "")
 	s.RegisterName("BusinessContact", new(projHandler.BusinessContactHandler), "")
 	s.RegisterName("BusinessFile", new(projHandler.BusinessFileHandler), "")