初始
This commit is contained in:
923
internal/app/wxApplet/controller/appPort.go
Normal file
923
internal/app/wxApplet/controller/appPort.go
Normal file
@ -0,0 +1,923 @@
|
||||
package controller
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
|
||||
"github.com/samber/lo"
|
||||
"github.com/tiger1103/gfast/v3/api/v1/system"
|
||||
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/tiger1103/gfast/v3/library/liberr"
|
||||
|
||||
"github.com/gogf/gf/v2/database/gdb"
|
||||
"github.com/jinzhu/copier"
|
||||
"github.com/tiger1103/gfast/v3/api/v1/common/coryCommon"
|
||||
"github.com/tiger1103/gfast/v3/api/wxApplet/wxApplet"
|
||||
wxSystem "github.com/tiger1103/gfast/v3/api/wxApplet/wxApplet"
|
||||
systemController "github.com/tiger1103/gfast/v3/internal/app/system/controller"
|
||||
controllerDao "github.com/tiger1103/gfast/v3/internal/app/system/dao"
|
||||
|
||||
ct "github.com/tiger1103/gfast/v3/internal/app/system/logic/context"
|
||||
"github.com/tiger1103/gfast/v3/internal/app/system/model"
|
||||
"github.com/tiger1103/gfast/v3/internal/app/system/model/entity"
|
||||
serviceController "github.com/tiger1103/gfast/v3/internal/app/system/service"
|
||||
"github.com/tiger1103/gfast/v3/internal/app/wxApplet/dao"
|
||||
wxAppletModel "github.com/tiger1103/gfast/v3/internal/app/wxApplet/model"
|
||||
"github.com/tiger1103/gfast/v3/internal/app/wxApplet/service"
|
||||
"golang.org/x/net/context"
|
||||
)
|
||||
|
||||
type appPortController struct {
|
||||
systemController.BaseController
|
||||
}
|
||||
|
||||
var AppPortController = new(appPortController)
|
||||
|
||||
// ===========================================APP首页===========================================
|
||||
// ===========================================APP首页===========================================
|
||||
// ===========================================APP首页===========================================
|
||||
|
||||
// GetsTheAttendanceOfASpecifiedShiftGroupFunc 班组长人员打卡统计
|
||||
func (c *appPortController) GetsTheAttendanceOfASpecifiedShiftGroupFunc(ctx context.Context, req *wxApplet.GetsTheAttendanceOfASpecifiedShiftGroupReq) (res *wxApplet.GetsTheAttendanceOfASpecifiedShiftGroupRes, err error) {
|
||||
res, err = service.SysProjectTeam().GetsTheAttendanceOfASpecifiedShiftGroupFunc(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
// ListOfAttendancePersonnelFunc 获取用户对应出勤状态的人员列表
|
||||
func (c *appPortController) ListOfAttendancePersonnelFunc(ctx context.Context, req *wxApplet.ListOfAttendancePersonnelReq) (res *wxApplet.ListOfAttendancePersonnelRes, err error) {
|
||||
res, err = service.SysProjectTeam().ListOfAttendancePersonnelFunc(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
// AppUserMenuFunc 获取用户菜单
|
||||
func (c *appPortController) AppUserMenuFunc(ctx context.Context, req *wxApplet.AppUserMenusReq) (*wxApplet.AppUserMenusRes, error) {
|
||||
// 获取用户信息
|
||||
userInfo := ct.New().GetLoginUser(ctx)
|
||||
|
||||
// 获取用户角色
|
||||
roleIds, err := getUserRoles(ctx, userInfo, req.UserType)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var userMenuList []wxApplet.AppUserMenu
|
||||
// 获取用户菜单
|
||||
if err := controllerDao.AppMenus.Ctx(ctx).As("menu").
|
||||
InnerJoin("app_role_menus roleMenu", "menu.menu_id = roleMenu.menu_id").
|
||||
Where("roleMenu.role_id IN (?)", roleIds).
|
||||
Fields("menu.menu_id, menu.menu_name").Scan(&userMenuList); err != nil {
|
||||
return nil, fmt.Errorf("获取用户菜单失败:%w", err)
|
||||
}
|
||||
|
||||
userMenuList = lo.UniqBy(userMenuList, func(item wxApplet.AppUserMenu) uint {
|
||||
return item.MenuID
|
||||
})
|
||||
|
||||
return &wxApplet.AppUserMenusRes{MenuList: userMenuList}, nil
|
||||
}
|
||||
|
||||
// getUserRoles 获取用户角色
|
||||
func getUserRoles(ctx context.Context, user *model.ContextUser, role int) ([]int, error) {
|
||||
rules := []model.Ruler{}
|
||||
|
||||
query := controllerDao.AppUserRoles.Ctx(ctx).As("aur").
|
||||
InnerJoin("app_roles ar", "aur.role_id = ar.role_id").
|
||||
Fields("ar.role_id,ar.role_name,aur.user_id").
|
||||
Where("aur.user_id", user.Id).
|
||||
Where("aur.major_role", role)
|
||||
if err := query.Scan(&rules); err != nil {
|
||||
return nil, fmt.Errorf("获取用户角色失败:%w", err)
|
||||
}
|
||||
|
||||
roleID := lo.FilterMap(rules, func(item model.Ruler, _ int) (int, bool) {
|
||||
return item.RoleId, true
|
||||
})
|
||||
|
||||
return roleID, nil
|
||||
}
|
||||
|
||||
// AppMyAttendanceFunc 我的考勤
|
||||
func (c *appPortController) AppMyAttendanceFunc(ctx context.Context, req *wxApplet.AppMyAttendanceReq) (res *wxApplet.AppMyAttendanceRes, err error) {
|
||||
res = new(wxApplet.AppMyAttendanceRes)
|
||||
res, err = service.BusAttendance().AppMyAttendanceFunc(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
// AppMyAttendanceDetailsFunc 我的考勤详情数据
|
||||
func (c *appPortController) AppMyAttendanceDetailsFunc(ctx context.Context, req *wxApplet.AppMyAttendanceDetailsReq) (res *wxApplet.AppMyAttendanceDetailsRes, err error) {
|
||||
res = new(wxApplet.AppMyAttendanceDetailsRes)
|
||||
res, err = service.BusAttendance().AppMyAttendanceDetailsFunc(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
// AppProjectOverviewFunc 项目概况
|
||||
func (c *appPortController) AppProjectOverviewFunc(ctx context.Context, req *wxApplet.AppProjectOverviewReq) (res *wxApplet.AppProjectOverviewRes, err error) {
|
||||
res = new(wxApplet.AppProjectOverviewRes)
|
||||
res, err = service.BusAttendance().AppProjectOverviewFunc(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
// AppSafetyHazardTodayFunc 项目概况>今日AI安全隐患
|
||||
func (c *appPortController) AppSafetyHazardTodayFunc(ctx context.Context, req *wxApplet.AppSafetyHazardTodayReq) (res *wxApplet.AppSafetyHazardTodayRes, err error) {
|
||||
res, err = serviceController.BusViolationRecord().AppSafetyHazardTodayFunc(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
// AppWeatherFunc 【小程序】获取施工人员天气
|
||||
func (c *appPortController) AppWeatherFunc(ctx context.Context, req *wxApplet.AppWeatherReq) (res *wxApplet.AppWeatherRes, err error) {
|
||||
res = new(wxApplet.AppWeatherRes)
|
||||
we := coryCommon.Weather(req.Location)
|
||||
bodyData := []byte(we)
|
||||
err = json.Unmarshal(bodyData, &res)
|
||||
if err != nil {
|
||||
fmt.Println("Failed to parse JSON data:", err)
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// AppProjectNoticeListFunc 首页获取滚动的项目公告列表
|
||||
func (c *appPortController) AppProjectNoticeListFunc(ctx context.Context, req *wxApplet.AppProjectNoticeReq) (*wxApplet.AppProjectNoticeRes, error) {
|
||||
userId := ct.New().GetLoginUser(ctx).Id
|
||||
|
||||
noticeList := []*wxApplet.ProjectNoticeList{}
|
||||
if err := controllerDao.Notifications.Ctx(ctx).
|
||||
Fields(controllerDao.Notifications.Columns().Title).
|
||||
LeftJoin("notification_recipients nf", "notifications.id = nf.notification_id").
|
||||
Where(controllerDao.Notifications.Columns().ProjectId, req.ProjectId).
|
||||
Where(controllerDao.Notifications.Columns().IsApp, 1).
|
||||
Where("nf.recipient_id", userId).
|
||||
Limit(20).OrderDesc("notifications.id").Scan(¬iceList); err != nil {
|
||||
return nil, fmt.Errorf("获取项目公告失败:%w", err)
|
||||
}
|
||||
return &wxApplet.AppProjectNoticeRes{
|
||||
List: noticeList,
|
||||
}, nil
|
||||
}
|
||||
|
||||
// AppRegisteredButNotVerifiedWithRealName 获取所有已注册未实名的用户
|
||||
func (c *appPortController) AppRegisteredButNotVerifiedWithRealName(ctx context.Context, req *wxApplet.AppRegisteredButNotVerifiedWithRealNameReq) (res *wxApplet.AppRegisteredButNotVerifiedWithRealNameRes, err error) {
|
||||
res, err = serviceController.BusConstructionUser().AppRegisteredButNotVerifiedWithRealNameFunc(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
// ===========================================定位考勤===========================================
|
||||
// ===========================================定位考勤===========================================
|
||||
// ===========================================定位考勤===========================================
|
||||
|
||||
// AppCodedBackwardsByLatitudeAndLongitudeFunc 根据经度纬度逆编码为省市区信息
|
||||
func (c *appPortController) AppCodedBackwardsByLatitudeAndLongitudeFunc(ctx context.Context, req *wxApplet.AppCodedBackwardsByLatitudeAndLongitudeReq) (res *wxApplet.AppCodedBackwardsByLatitudeAndLongitudeRes, err error) {
|
||||
res = new(wxApplet.AppCodedBackwardsByLatitudeAndLongitudeRes)
|
||||
we := coryCommon.InverseGeocoding(req.Location)
|
||||
bodyData := []byte(we)
|
||||
err = json.Unmarshal(bodyData, &res)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// AppOpenidByFounderFunc 返回当前用户所在项目的打卡范围
|
||||
func (c *appPortController) AppOpenidByFounderFunc(ctx context.Context, req *wxApplet.AppOpenidByFounderReq) (res *wxApplet.AppOpenidByFounderRes, err error) {
|
||||
res = new(wxApplet.AppOpenidByFounderRes)
|
||||
founderFunc, err := OpenidByFounderFunc(ctx, req.Openid)
|
||||
err = copier.Copy(&res, founderFunc)
|
||||
return
|
||||
}
|
||||
|
||||
// AppWhetherToEnterTheClockRangeFunc 判断当前用户是否进入打卡范围
|
||||
func (c *appPortController) AppWhetherToEnterTheClockRangeFunc(ctx context.Context, req *wxApplet.AppWhetherToEnterTheClockRangeReq) (res *wxApplet.AppWhetherToEnterTheClockRangeRes, err error) {
|
||||
res = new(wxApplet.AppWhetherToEnterTheClockRangeRes)
|
||||
res, err = service.BusAttendance().AppWhetherToEnterTheClockRangeFunc(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
// AppClockingStatusOfTheDayFunc 判断当前用户当天的打卡状态(1未打卡、2已打上班卡、3已打下班卡)
|
||||
func (c *appPortController) AppClockingStatusOfTheDayFunc(ctx context.Context, req *wxApplet.AppClockingStatusOfTheDayReq) (res *wxApplet.AppClockingStatusOfTheDayRes, err error) {
|
||||
res = new(wxApplet.AppClockingStatusOfTheDayRes)
|
||||
res, err = service.BusAttendance().AppClockingStatusOfTheDayFunc(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
// AppFaceDetectionFunc 人脸检测
|
||||
func (c *appPortController) AppFaceDetectionFunc(ctx context.Context, req *wxApplet.AppFaceDetectionReq) (res *wxApplet.AppFaceDetectionRes, err error) {
|
||||
res = new(wxApplet.AppFaceDetectionRes)
|
||||
res.Path, err = FaceDetectionFunc(ctx, req.File)
|
||||
return
|
||||
}
|
||||
|
||||
// AppAttendanceCardFunc 考勤打卡
|
||||
func (c *appPortController) AppAttendanceCardFunc(ctx context.Context, req *wxApplet.AppAttendanceCardReq) (res *wxApplet.AppAttendanceCardRes, err error) {
|
||||
res = new(wxApplet.AppAttendanceCardRes)
|
||||
addReq := wxApplet.BusAttendanceAddReq{}
|
||||
copier.Copy(&addReq, &req)
|
||||
err = service.BusAttendance().Add(ctx, &addReq)
|
||||
return
|
||||
}
|
||||
|
||||
// AppAllMembersOfTheCurrentGroupFunc 获取当前组的所有成员(除自己)
|
||||
func (c *appPortController) AppAllMembersOfTheCurrentGroupFunc(ctx context.Context, req *wxApplet.AppAllMembersOfTheCurrentGroupReq) (res *wxApplet.AppAllMembersOfTheCurrentGroupRes, err error) {
|
||||
res, err = service.BusConstructionUser().AppAllMembersOfTheCurrentGroupFunc(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
// AppSelectThisUserByCardRecordFunc 为指定用户查询打卡记录
|
||||
func (c *appPortController) AppSelectThisUserByCardRecordFunc(ctx context.Context, req *wxApplet.AppSelectThisUserByCardRecordReq) (res *wxApplet.AppSelectThisUserByCardRecordRes, err error) {
|
||||
res, err = service.BusAttendance().AppSelectThisUserByCardRecordFunc(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
// AppLocationAttendanceStatisticsFunc 定位考勤统计
|
||||
func (c *appPortController) AppLocationAttendanceStatisticsFunc(ctx context.Context, req *wxApplet.AppLocationAttendanceStatisticsReq) (res *wxApplet.AppLocationAttendanceStatisticsRes, err error) {
|
||||
res, err = service.BusAttendance().AppLocationAttendanceStatisticsFunc(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
// AppSelectBySiteDateAndTimeFunc 根据openid获取到项目的逆编码地址及项目的上下班打卡时间
|
||||
func (c *appPortController) AppSelectBySiteDateAndTimeFunc(ctx context.Context, req *wxApplet.AppSelectBySiteDateAndTimeReq) (res *wxApplet.AppSelectBySiteDateAndTimeRes, err error) {
|
||||
res = new(wxApplet.AppSelectBySiteDateAndTimeRes)
|
||||
data, err := serviceController.SysProject().GetById(ctx, req.ProjectId)
|
||||
res.PunchRange = data.PunchRange
|
||||
res.Lng = data.Lng
|
||||
res.Lat = data.Lat
|
||||
// 逆编码
|
||||
var entity *coryCommon.InverseGeocodingRep
|
||||
we := coryCommon.InverseGeocoding(data.Lng + "," + data.Lat)
|
||||
bodyData := []byte(we)
|
||||
err = json.Unmarshal(bodyData, &entity)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
res.Site = entity.Regeocode.FormattedAddress
|
||||
return
|
||||
}
|
||||
|
||||
// AppMyProjectListFunc 获取项目列表
|
||||
func (c *appPortController) AppMyProjectListFunc(ctx context.Context, req *wxApplet.AppMyProjectListReq) (*wxApplet.SysUserProjectRelevancySearchRes, error) {
|
||||
// 获取当前登录用户ID
|
||||
userInfo := ct.New().GetLoginUser(ctx)
|
||||
|
||||
// 当前登录用户ID
|
||||
userID := userInfo.Id
|
||||
|
||||
// 用户手机号
|
||||
phone := userInfo.Mobile
|
||||
|
||||
var query *gdb.Model
|
||||
|
||||
fields := `a.*,
|
||||
CASE WHEN (b.short_name IS NULL OR b.project_name = '') THEN b.project_name ELSE b.short_name END AS project_name,
|
||||
b.lng, b.lat, b.type, b.project_site`
|
||||
|
||||
if req.ProjectType == 0 {
|
||||
// 管理员获取项目时,将获取后台所拥有的项目
|
||||
query = dao.SysUserProjectRelevancy.Ctx(ctx).As("a").
|
||||
InnerJoin("sys_project as b on a.project_id = b.id").
|
||||
Fields(fields).Where("a.user_id", userID)
|
||||
} else {
|
||||
// 当请求者为施工人员时,从 bus_construction_user 表中获取其绑定的项目信息
|
||||
query = dao.BusConstructionUser.Ctx(ctx).As("a").
|
||||
InnerJoin("sys_project as b on a.project_id = b.id").
|
||||
Fields(fields).Where("a.phone", phone)
|
||||
}
|
||||
|
||||
var projectList []*wxAppletModel.SysUserProjectRelevancyListRes
|
||||
if err := query.Scan(&projectList); err != nil {
|
||||
return nil, fmt.Errorf("获取项目列表失败:%w", err)
|
||||
}
|
||||
|
||||
return &wxApplet.SysUserProjectRelevancySearchRes{
|
||||
List: projectList,
|
||||
}, nil
|
||||
}
|
||||
|
||||
// AppReissueACardListFunc 补卡申请列表(目前只会展示缺卡的数据)
|
||||
func (c *appPortController) AppReissueACardListFunc(ctx context.Context, req *wxApplet.AppReissueACardListReq) (res *wxApplet.AppReissueACardListRes, err error) {
|
||||
res, err = service.BusAttendance().AppReissueACardListFunc(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
// AppReissueACardIdFunc 补卡申请ID查询
|
||||
func (c *appPortController) AppReissueACardIdFunc(ctx context.Context, req *wxApplet.AppReissueACardIdReq) (res *wxApplet.AppReissueACardIdRes, err error) {
|
||||
res, err = service.BusAttendance().AppReissueACardIdFunc(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
// AppCardReplacementApplicationAddFunc 新增补卡申请
|
||||
func (c *appPortController) AppCardReplacementApplicationAddFunc(ctx context.Context, req *wxApplet.AppCardReplacementApplicationAddReq) (res *wxApplet.AppCardReplacementApplicationAddRes, err error) {
|
||||
r := wxApplet.ReissueACardWxAddReq{}
|
||||
copier.Copy(&r, &req)
|
||||
err = serviceController.BusReissueACard().ReissueACardWxAdd(ctx, &r)
|
||||
return
|
||||
}
|
||||
|
||||
// AppReplacementCardApplicationRecordFunc 申请人补卡记录(分页)
|
||||
func (c *appPortController) AppReplacementCardApplicationRecordFunc(ctx context.Context, req *wxApplet.AppReplacementCardApplicationRecordReq) (res *wxApplet.AppReplacementCardApplicationRecordRes, err error) {
|
||||
res = new(wxApplet.AppReplacementCardApplicationRecordRes)
|
||||
// 请求
|
||||
r := wxApplet.ReissueACardWxGetByIdReq{}
|
||||
copier.Copy(&r, &req)
|
||||
// 返回
|
||||
idFunc, err := serviceController.BusReissueACard().ReissueACardWxGetByIdFunc(ctx, &r)
|
||||
copier.Copy(&res, &idFunc)
|
||||
return
|
||||
}
|
||||
|
||||
// AppTheTeamLeaderSupplementCardApprovalListFun 班组长补卡审批列表(分页)
|
||||
func (c *appPortController) AppTheTeamLeaderSupplementCardApprovalListFun(ctx context.Context, req *wxApplet.AppTheTeamLeaderSupplementCardApprovalListReq) (res *wxApplet.AppTheTeamLeaderSupplementCardApprovalListRes, err error) {
|
||||
entity := model.AppTheTeamLeaderSupplementCardApprovalRes{}
|
||||
copier.Copy(&entity, &req)
|
||||
entity.Type = "1"
|
||||
res, err = serviceController.BusReissueACard().AppTheTeamLeaderSupplementCardApprovalListFun(ctx, &entity)
|
||||
return
|
||||
}
|
||||
|
||||
// AppTheTeamLeaderSupplementCardApprovalRecordListFunc 班组长补卡审批记录列表(分页)
|
||||
func (c *appPortController) AppTheTeamLeaderSupplementCardApprovalRecordListFunc(ctx context.Context, req *wxApplet.AppTheTeamLeaderSupplementCardApprovalRecordListReq) (res *wxApplet.AppTheTeamLeaderSupplementCardApprovalListRes, err error) {
|
||||
entity := model.AppTheTeamLeaderSupplementCardApprovalRes{}
|
||||
copier.Copy(&entity, &req)
|
||||
entity.Type = "2"
|
||||
res, err = serviceController.BusReissueACard().AppTheTeamLeaderSupplementCardApprovalListFun(ctx, &entity)
|
||||
return
|
||||
}
|
||||
|
||||
// AppApprovalRecordDetailsFunc 审批记录详情
|
||||
func (c *appPortController) AppApprovalRecordDetailsFunc(ctx context.Context, req *wxApplet.AppApprovalRecordDetailsReq) (res *wxApplet.AppApprovalRecordDetailsRes, err error) {
|
||||
res, err = serviceController.BusReissueACard().AppApprovalRecordDetailsFunc(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
// AppForemanApprovalFunc 班组长审批
|
||||
func (c *appPortController) AppForemanApprovalFunc(ctx context.Context, req *wxApplet.AppForemanApprovalReq) (res *wxApplet.AppForemanApprovalRes, err error) {
|
||||
entity := wxApplet.ReissueACardWxEditTeamReq{}
|
||||
copier.Copy(&entity, &req)
|
||||
err = serviceController.BusReissueACard().ReissueACardWxEditTeam(ctx, &entity)
|
||||
return
|
||||
}
|
||||
|
||||
// @Title AdministratorApprovalFunc 2024/7/26 15:20:00
|
||||
// @Description 管理员审批(仅限于管理员操作)
|
||||
// @Auth Cory
|
||||
func (c *appPortController) AdministratorApprovalFunc(ctx context.Context, req *wxApplet.AdministratorApprovalReq) (res *wxApplet.AdministratorApprovalRes, err error) {
|
||||
editReq := system.BusReissueACardEditReq{}
|
||||
copier.Copy(&editReq, &req)
|
||||
err = serviceController.BusReissueACard().Edit(ctx, &editReq)
|
||||
return
|
||||
}
|
||||
|
||||
// ===========================================安全(HSE)巡检工单===========================================
|
||||
// ===========================================安全(HSE)巡检工单===========================================
|
||||
// ===========================================安全(HSE)巡检工单===========================================
|
||||
|
||||
// AppManagementAppletListInformFunc 安全巡检工单列表-全部(分页)
|
||||
func (c *appPortController) AppManagementAppletListInformFunc(ctx context.Context, req *wxApplet.AppManagementAppletListInformReq) (res *wxApplet.AppManagementAppletListRes, err error) {
|
||||
res = new(wxApplet.AppManagementAppletListRes)
|
||||
entity := wxApplet.HseManagementAppletListReq{}
|
||||
copier.Copy(&entity, &req)
|
||||
entity.Status = "0"
|
||||
listFunc, err := serviceController.BusHseManagement().HseManagementAppletListFunc(ctx, &entity)
|
||||
copier.Copy(&res, listFunc)
|
||||
return
|
||||
}
|
||||
|
||||
// AppManagementAppletListAbarbeitungFunc 安全巡检工单列表-整改(分页)
|
||||
func (c *appPortController) AppManagementAppletListAbarbeitungFunc(ctx context.Context, req *wxApplet.AppManagementAppletListAbarbeitungReq) (res *wxApplet.AppManagementAppletListRes, err error) {
|
||||
res = new(wxApplet.AppManagementAppletListRes)
|
||||
entity := wxApplet.HseManagementAppletListReq{}
|
||||
copier.Copy(&entity, &req)
|
||||
entity.Status = "1"
|
||||
listFunc, err := serviceController.BusHseManagement().HseManagementAppletListFunc(ctx, &entity)
|
||||
copier.Copy(&res, listFunc)
|
||||
return
|
||||
}
|
||||
|
||||
// AppManagementAppletListReviewFunc 安全巡检工单列表-复查(分页)
|
||||
func (c *appPortController) AppManagementAppletListReviewFunc(ctx context.Context, req *wxApplet.AppManagementAppletListReviewReq) (res *wxApplet.AppManagementAppletListRes, err error) {
|
||||
res = new(wxApplet.AppManagementAppletListRes)
|
||||
entity := wxApplet.HseManagementAppletListReq{}
|
||||
copier.Copy(&entity, &req)
|
||||
entity.Status = "2"
|
||||
listFunc, err := serviceController.BusHseManagement().HseManagementAppletListFunc(ctx, &entity)
|
||||
copier.Copy(&res, listFunc)
|
||||
return
|
||||
}
|
||||
|
||||
// APPAddedDataSecurityForBackgroundUsersFunc APP的后台用户新增安全数据
|
||||
func (c *appPortController) APPAddedDataSecurityForBackgroundUsersFunc(ctx context.Context, req *wxApplet.APPAddedDataSecurityForBackgroundUsersReq) (res *wxApplet.APPAddedDataSecurityForBackgroundUsersRes, err error) {
|
||||
entity := system.BusHseManagementAddReq{}
|
||||
copier.Copy(&entity, &req)
|
||||
entity.HseManagementAdd = 1
|
||||
entity.FileTwo = req.File
|
||||
err = serviceController.BusHseManagement().Add(ctx, &entity)
|
||||
return
|
||||
}
|
||||
|
||||
// APPReviewDataSecurityForBackgroundUsersFunc APP的后台用户复查安全数据
|
||||
func (c *appPortController) APPReviewDataSecurityForBackgroundUsersFunc(ctx context.Context, req *wxApplet.APPReviewDataSecurityForBackgroundUsersReq) (res *wxApplet.APPReviewDataSecurityForBackgroundUsersRes, err error) {
|
||||
entity := system.EditReviewReq{}
|
||||
copier.Copy(&entity, &req)
|
||||
err = serviceController.BusHseManagement().EditReview(ctx, &entity)
|
||||
return
|
||||
}
|
||||
|
||||
// ===========================================质量管理===========================================
|
||||
// ===========================================质量管理===========================================
|
||||
// ===========================================质量管理===========================================
|
||||
|
||||
// AppInspectionTicketAppletListInformFunc 质量管理列表-全部(分页)
|
||||
func (c *appPortController) AppInspectionTicketAppletListInformFunc(ctx context.Context, req *wxApplet.AppInspectionTicketAppletListInformReq) (res *wxApplet.AppInspectionTicketAppletListRes, err error) {
|
||||
res = new(wxApplet.AppInspectionTicketAppletListRes)
|
||||
entity := wxApplet.InspectionTicketAppletListReq{}
|
||||
copier.Copy(&entity, &req)
|
||||
entity.Status = "0"
|
||||
listFunc, err := serviceController.BusInspectionTicket().InspectionTicketAppletListFunc(ctx, &entity)
|
||||
copier.Copy(&res, listFunc)
|
||||
return
|
||||
}
|
||||
|
||||
// AppInspectionTicketAppletListAbarbeitungFunc 质量管理列表-整改(分页)
|
||||
func (c *appPortController) AppInspectionTicketAppletListAbarbeitungFunc(ctx context.Context, req *wxApplet.AppInspectionTicketAppletListAbarbeitungReq) (res *wxApplet.AppInspectionTicketAppletListRes, err error) {
|
||||
res = new(wxApplet.AppInspectionTicketAppletListRes)
|
||||
entity := wxApplet.InspectionTicketAppletListReq{}
|
||||
copier.Copy(&entity, &req)
|
||||
entity.Status = "1"
|
||||
listFunc, err := serviceController.BusInspectionTicket().InspectionTicketAppletListFunc(ctx, &entity)
|
||||
copier.Copy(&res, listFunc)
|
||||
return
|
||||
}
|
||||
|
||||
// AppInspectionTicketAppletListReviewFunc 质量管理列表-复查(分页)
|
||||
func (c *appPortController) AppInspectionTicketAppletListReviewFunc(ctx context.Context, req *wxApplet.AppInspectionTicketAppletListReviewReq) (res *wxApplet.AppInspectionTicketAppletListRes, err error) {
|
||||
res = new(wxApplet.AppInspectionTicketAppletListRes)
|
||||
entity := wxApplet.InspectionTicketAppletListReq{}
|
||||
copier.Copy(&entity, &req)
|
||||
entity.Status = "2"
|
||||
listFunc, err := serviceController.BusInspectionTicket().InspectionTicketAppletListFunc(ctx, &entity)
|
||||
copier.Copy(&res, listFunc)
|
||||
return
|
||||
}
|
||||
|
||||
// AppQualityDataIsAddedForBackgroundUsersFunc APP的后台用户新增质量数据
|
||||
func (c *appPortController) AppQualityDataIsAddedForBackgroundUsersFunc(ctx context.Context, req *wxApplet.AppQualityDataIsAddedForBackgroundUsersReq) (res *wxApplet.AppQualityDataIsAddedForBackgroundUsersRes, err error) {
|
||||
entity := system.BusInspectionTicketAddReq{}
|
||||
copier.Copy(&entity, &req)
|
||||
entity.HseManagementAdd = 1
|
||||
entity.FileTwo = req.File
|
||||
err = serviceController.BusInspectionTicket().Add(ctx, &entity)
|
||||
return
|
||||
}
|
||||
|
||||
// AppBackgroundUsersReviewQualityDataFunc APP的后台用户复查质量数据
|
||||
func (c *appPortController) AppBackgroundUsersReviewQualityDataFunc(ctx context.Context, req *wxApplet.AppBackgroundUsersReviewQualityDataReq) (res *wxApplet.AppBackgroundUsersReviewQualityDataRes, err error) {
|
||||
entity := system.BusInspectionTicketVerificationReq{}
|
||||
copier.Copy(&entity, &req)
|
||||
err = serviceController.BusInspectionTicket().EditVerification(ctx, &entity)
|
||||
return
|
||||
}
|
||||
|
||||
// ===========================================AI===========================================
|
||||
// ===========================================AI===========================================
|
||||
// ===========================================AI===========================================
|
||||
|
||||
// AppAiInformFunc 选择处理人
|
||||
func (c *appPortController) AppAiInformFunc(ctx context.Context, req *wxApplet.AppAiInformReq) (res *wxApplet.AppAiInformRes, err error) {
|
||||
err = serviceController.BusViolationRecord().AppAiInformFunc(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
// AppGetsAllThePeopleUnderTheCurrentPersonsProjectFunc 取当前人所在项目下的所有人
|
||||
func (c *appPortController) AppGetsAllThePeopleUnderTheCurrentPersonsProjectFunc(ctx context.Context, req *wxApplet.AppGetsAllThePeopleUnderTheCurrentPersonsProjectReq) (res *wxApplet.AppGetsAllThePeopleUnderTheCurrentPersonsProjectRes, err error) {
|
||||
res = new(wxApplet.AppGetsAllThePeopleUnderTheCurrentPersonsProjectRes)
|
||||
projectFunc, err := serviceController.BusViolationRecord().AppGetsAllThePeopleUnderTheCurrentPersonsProjectFunc(ctx, req)
|
||||
res = projectFunc
|
||||
return
|
||||
}
|
||||
|
||||
// AppWorkOrderPcListFunc AI工单列表(根据pc用户主键ID进行分页获取)
|
||||
func (c *appPortController) AppWorkOrderPcListFunc(ctx context.Context, req *wxApplet.AppWorkOrderPcListReq) (res *wxApplet.AppWorkOrderPcListRes, err error) {
|
||||
res = new(wxApplet.AppWorkOrderPcListRes)
|
||||
projectFunc, err := serviceController.BusViolationRecord().AppWorkOrderPcListFunc(ctx, req)
|
||||
res = projectFunc
|
||||
return
|
||||
}
|
||||
|
||||
// AppWorkOrderAppListFunc AI工单列表(根据App用户主键ID进行分页获取)
|
||||
func (c *appPortController) AppWorkOrderAppListFunc(ctx context.Context, req *wxApplet.AppWorkOrderAppListReq) (res *wxApplet.AppWorkOrderPcListRes, err error) {
|
||||
res = new(wxApplet.AppWorkOrderPcListRes)
|
||||
projectFunc, err := serviceController.BusViolationRecord().AppWorkOrderAppListFunc(ctx, req)
|
||||
res = projectFunc
|
||||
return
|
||||
}
|
||||
|
||||
// AppRectificationReplyFunc AI整改回复
|
||||
func (c *appPortController) AppRectificationReplyFunc(ctx context.Context, req *wxApplet.AppRectificationReplyReq) (res *wxApplet.AppRectificationReplyRes, err error) {
|
||||
res = new(wxApplet.AppRectificationReplyRes)
|
||||
err = serviceController.BusViolationRecord().AppRectificationReplyFunc(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
// AppReviewFuncFunc AI复查
|
||||
func (c *appPortController) AppReviewFuncFunc(ctx context.Context, req *wxApplet.AppReviewReq) (res *wxApplet.AppReviewRes, err error) {
|
||||
res = new(wxApplet.AppReviewRes)
|
||||
req.Operator = ct.New().GetLoginUser(ctx).OpenId
|
||||
err = serviceController.BusViolationRecord().AppReviewFuncFunc(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
// AppWorkOrderParticularsFunc AI工单详情
|
||||
func (c *appPortController) AppWorkOrderParticularsFunc(ctx context.Context, req *wxApplet.AppWorkOrderParticularsReq) (res *wxApplet.AppWorkOrderParticularsRes, err error) {
|
||||
res = new(wxApplet.AppWorkOrderParticularsRes)
|
||||
particularsFunc, err := serviceController.BusViolationRecord().AppWorkOrderParticularsFunc(ctx, req)
|
||||
res = particularsFunc
|
||||
return
|
||||
}
|
||||
|
||||
// =========================================== 消息 ===========================================
|
||||
// =========================================== 消息 ===========================================
|
||||
// =========================================== 消息 ===========================================
|
||||
|
||||
// AppMessageListFunc 消息列表
|
||||
func (c *appPortController) AppMessageListFunc(ctx context.Context, req *wxApplet.AppMessageListReq) (res *wxApplet.AppMessageListRes, err error) {
|
||||
// 获取用户信息
|
||||
user := ct.New().GetLoginUser(ctx)
|
||||
|
||||
res = new(wxApplet.AppMessageListRes)
|
||||
|
||||
fields := "title,created_at, (SELECT COUNT(*) FROM reminders WHERE is_read = 0 and user_id = '%s' and project_id = %s) AS unread_count"
|
||||
|
||||
userID := lo.If(req.OpenID != "", user.OpenId).Else(strconv.Itoa(int(user.Id)))
|
||||
|
||||
// 查询提醒
|
||||
controllerDao.Reminders.Ctx(ctx).Fields(fmt.Sprintf(fields, userID, req.ProjectId)).
|
||||
Where("is_read", 0).
|
||||
Where("project_id", req.ProjectId).
|
||||
OrderDesc("id").
|
||||
Where("user_id", userID).
|
||||
Limit(1).Scan(&res.Remind)
|
||||
|
||||
fields = "content as title,created_at, (SELECT COUNT(*) FROM comment_list WHERE is_read = 0 and receiver = %d and project_id = %s) AS unread_count"
|
||||
controllerDao.CommentList.Ctx(ctx).Fields(fmt.Sprintf(fields, user.Id, req.ProjectId)).
|
||||
Where("is_read", 0).
|
||||
Where("receiver", user.Id).
|
||||
Where("project_id", req.ProjectId).
|
||||
OrderDesc("id").
|
||||
Limit(1).Scan(&res.Comment)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ===========================================人员管理===========================================
|
||||
// ===========================================人员管理===========================================
|
||||
// ===========================================人员管理===========================================
|
||||
|
||||
// AppChangeThePunchStatusForTheSpecifiedPersonFunc 给指定人更改打卡状态
|
||||
func (c *appPortController) AppChangeThePunchStatusForTheSpecifiedPersonFunc(ctx context.Context, req *wxApplet.AppChangeThePunchStatusForTheSpecifiedPersonReq) (res *wxApplet.AppChangeThePunchStatusForTheSpecifiedPersonRes, err error) {
|
||||
entity := system.ClockingConditionReq{}
|
||||
copier.Copy(&entity, &req)
|
||||
err = serviceController.BusConstructionUser().ClockingConditionFunc(ctx, &entity)
|
||||
return
|
||||
}
|
||||
|
||||
// AppSelectAppointProjectAllTeamFunc 获取指定项目所有班组
|
||||
func (c *appPortController) AppSelectAppointProjectAllTeamFunc(ctx context.Context, req *wxApplet.AppSelectAppointProjectAllTeamReq) (res *wxApplet.AppSelectAppointProjectAllTeamRes, err error) {
|
||||
res = new(wxApplet.AppSelectAppointProjectAllTeamRes)
|
||||
var entity []*wxAppletModel.SysProjectTeamListRes
|
||||
err = dao.SysProjectTeam.Ctx(ctx).Where(dao.SysProjectTeam.Columns().ProjectId, req.ProjectId).Scan(&entity)
|
||||
res.List = entity
|
||||
return
|
||||
}
|
||||
|
||||
// AppListOfParticipatingUnitsFunc 参建单位列表
|
||||
func (c *appPortController) AppListOfParticipatingUnitsFunc(ctx context.Context, req *wxApplet.AppListOfParticipatingUnitsReq) (res *wxApplet.AppListOfParticipatingUnitsRes, err error) {
|
||||
res, err = service.BusLabourservice().AppListOfParticipatingUnitsFunc(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
// AppListOfConstructionPersonnelFunc 施工人员列表(分页)
|
||||
func (c *appPortController) AppListOfConstructionPersonnelFunc(ctx context.Context, req *wxApplet.AppListOfConstructionPersonnelReq) (res *wxApplet.AppListOfConstructionPersonnelRes, err error) {
|
||||
res, err = service.BusConstructionUser().AppListOfConstructionPersonnelFunc(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
// AppExitFunc 退场
|
||||
func (c *appPortController) AppExitFunc(ctx context.Context, req *wxApplet.AppExitReq) (res *wxApplet.AppExitRes, err error) {
|
||||
res = new(wxApplet.AppExitRes)
|
||||
err = serviceController.BusConstructionUser().AppExitFunc(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
// AppResubmitTheExitAttachmentFunc 补交退场附件
|
||||
func (c *appPortController) AppResubmitTheExitAttachmentFunc(ctx context.Context, req *wxApplet.AppResubmitTheExitAttachmentReq) (res *wxApplet.AppResubmitTheExitAttachmentRes, err error) {
|
||||
res = new(wxApplet.AppResubmitTheExitAttachmentRes)
|
||||
err = serviceController.BusConstructionUser().AppResubmitTheExitAttachmentFunc(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
// AppTeamAttendanceFunc 团队出勤
|
||||
func (c *appPortController) AppTeamAttendanceFunc(ctx context.Context, req *wxApplet.AppTeamAttendanceReq) (res *wxApplet.AppTeamAttendanceRes, err error) {
|
||||
res, err = service.BusAttendance().AppTeamAttendanceFunc(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
// AppGetsThePeopleUnderTheSpecifiedProjectFunc 获取指定项目下已实名认证或已退出班组的人
|
||||
func (c *appPortController) AppGetsThePeopleUnderTheSpecifiedProjectFunc(ctx context.Context, req *wxApplet.AppGetsThePeopleUnderTheSpecifiedProjectReq) (res *wxApplet.AppGetsThePeopleUnderTheSpecifiedProjectRes, err error) {
|
||||
res, err = service.BusConstructionUser().AppGetsThePeopleUnderTheSpecifiedProjectFunc(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
// AppJoinATeamFunc 加入指定项目下的指定班组
|
||||
func (c *appPortController) AppJoinATeamFunc(ctx context.Context, req *wxApplet.AppJoinATeamReq) (res *wxApplet.AppJoinATeamRes, err error) {
|
||||
err = g.DB().Transaction(ctx, func(ctx context.Context, tx gdb.TX) error {
|
||||
err = g.Try(ctx, func(ctx context.Context) {
|
||||
for _, openid := range req.Openids {
|
||||
r := new(wxSystem.SysProjectTeamMemberAddReq)
|
||||
r.Openid = openid
|
||||
r.PostId = 4
|
||||
copier.Copy(r, req)
|
||||
err = service.SysProjectTeamMember().Add(ctx, r)
|
||||
liberr.ErrIsNil(ctx, err)
|
||||
}
|
||||
})
|
||||
return err
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
// AppGetPersonnelDetailsFunc 获取人员详情
|
||||
func (c *appPortController) AppGetPersonnelDetailsFunc(ctx context.Context, req *wxApplet.AppGetPersonnelDetailsReq) (res *wxApplet.AppGetPersonnelDetailsRes, err error) {
|
||||
res, err = service.BusConstructionUser().AppGetPersonnelDetailsFunc(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
// ===========================================提醒===========================================
|
||||
// ===========================================提醒===========================================
|
||||
// ===========================================提醒===========================================
|
||||
|
||||
// AIWorkOrderDetailsFunc AI工单详情
|
||||
func (c *appPortController) AIWorkOrderDetailsFunc(ctx context.Context, req *wxApplet.AIWorkOrderDetailsReq) (res *wxApplet.AIWorkOrderDetailsRes, err error) {
|
||||
res = new(wxApplet.AIWorkOrderDetailsRes)
|
||||
err = g.Try(ctx, func(ctx context.Context) {
|
||||
// 1、获取主体信息
|
||||
err = g.DB().Model("reminders").As("e").
|
||||
LeftJoin("bus_violation_record", "a", "a.id = e.order_id").
|
||||
LeftJoin("sys_dict_data", "b", "b.dict_type = 'tour_type' and b.dict_value = a.tour_type").
|
||||
LeftJoin("sys_dict_data", "c", "c.dict_type = 'violation_record_data_source' and c.dict_value = a.data_source").
|
||||
LeftJoin("sys_project", "d", "d.id = a.project_id").
|
||||
Fields("a.*,b.dict_label as tt,c.dict_label as ds,d.project_name as projectName,e.status").
|
||||
Where("e.id", req.Id).Scan(&res)
|
||||
liberr.ErrIsNil(ctx, err, "获取当前AI数据失败")
|
||||
if res.Openid != "" { // 获取处理人名称
|
||||
value, _ := dao.BusConstructionUser.Ctx(ctx).Where("openid", res.Openid).Fields("user_name").Value()
|
||||
res.OpenidName = value.String()
|
||||
}
|
||||
if res.Status == "3" { // 复查人名称
|
||||
value, _ := g.DB().Model("sys_user").Ctx(ctx).Where("id", res.SelectPeople).Fields("user_nickname").Value()
|
||||
res.ReviewName = value.String()
|
||||
}
|
||||
i2, _ := g.DB().Model("bus_violation_record_correlation").Ctx(ctx).
|
||||
Where("a.record_id", res.Id).As("a").
|
||||
LeftJoin("sys_user", "b", "b.id = a.user_id").
|
||||
Fields("b.user_nickname").Array()
|
||||
for i3 := range i2 { // 哪些人可以复查(只需有一个复查就行了)
|
||||
res.SuperintendName = append(res.SuperintendName, i2[i3].String())
|
||||
}
|
||||
// 2、获取附件
|
||||
var pathEntity []*model.BusViolationRecordPathLogicRes
|
||||
err = g.DB().Model("bus_violation_record_path").Ctx(ctx).Where("ticket_id", req.Id).Scan(&pathEntity)
|
||||
liberr.ErrIsNil(ctx, err, "查询失败")
|
||||
// 3、分类附件
|
||||
var one []*model.BusViolationRecordPathLogicRes
|
||||
var two []*model.BusViolationRecordPathLogicRes
|
||||
for i := range pathEntity {
|
||||
if pathEntity[i].Type == "1" {
|
||||
one = append(one, pathEntity[i])
|
||||
} else {
|
||||
two = append(two, pathEntity[i])
|
||||
}
|
||||
}
|
||||
res.CheckAttachment = one
|
||||
res.AbarbeitungAttachment = two
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
// QualityControlDetailsFunc 质量管理详情
|
||||
func (c *appPortController) QualityControlDetailsFunc(ctx context.Context, req *wxApplet.QualityControlDetailsReq) (res *wxApplet.QualityControlDetailsRes, err error) {
|
||||
res = new(wxApplet.QualityControlDetailsRes)
|
||||
err = g.Try(ctx, func(ctx context.Context) {
|
||||
m := g.DB().Model("reminders").As("e").
|
||||
LeftJoin("bus_inspection_ticket", "a", "a.id = e.order_id").
|
||||
LeftJoin("sys_project", "b", "b.id = a.project_id").
|
||||
LeftJoin("sys_dict_data", "c", "dict_type = 'inspection_type' and dict_value = a.Inspection_type").
|
||||
LeftJoin(dao.BusConstructionUser.Table(), "d", "d.openid = a.corrector").
|
||||
Fields(
|
||||
"a.id,b.project_name as projectName," + // 主键ID、项目名称
|
||||
"c.dict_label," + // 巡检类型
|
||||
"a.inspection_headline," + // 巡检主题
|
||||
"a.inspection_result," + // 巡检结果
|
||||
"d.user_name as abarbeitung," + // 整改人
|
||||
"a.is_reply,a.reply_date," + // 是否回复、回复时间
|
||||
"a.created_by as fill,a.created_at," + // 填报人、填报时间
|
||||
"a.feedback," + // 整改反馈
|
||||
"a.verification_result," + // 验证结果
|
||||
"e.status,a.verification_type," + // 工单状态、验证状态
|
||||
"a.updated_at as updatedAt," + // 更新时间
|
||||
"a.rectification_time as rectificationTime", // 整改时间
|
||||
)
|
||||
err = m.Where("e.id", req.Id).Scan(&res)
|
||||
liberr.ErrIsNil(ctx, err, "查询失败")
|
||||
// 2、获取附件
|
||||
var pathEntity []*wxApplet.SecurityManagementDetailsPath
|
||||
err = g.DB().Model("bus_inspection_ticket_path").Ctx(ctx).Where("ticket_id", res.Id).Scan(&pathEntity)
|
||||
liberr.ErrIsNil(ctx, err, "查询失败")
|
||||
// 3、分类附件
|
||||
var one []*wxApplet.SecurityManagementDetailsPath
|
||||
var two []*wxApplet.SecurityManagementDetailsPath
|
||||
for i := range pathEntity {
|
||||
if pathEntity[i].Type == "1" {
|
||||
one = append(one, pathEntity[i])
|
||||
} else {
|
||||
two = append(two, pathEntity[i])
|
||||
}
|
||||
}
|
||||
res.Inspectionccessories = one
|
||||
res.CorrectiveAttachment = two
|
||||
// 3、获取
|
||||
res.Fill = coryCommon.SelectByString(ctx, coryCommon.IsNumeric(res.Fill), res.Fill)
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
// SecurityManagementDetailsFunc 安全管理详情
|
||||
func (c *appPortController) SecurityManagementDetailsFunc(ctx context.Context, req *wxApplet.SecurityManagementDetailsReq) (res *wxApplet.SecurityManagementDetailsRes, err error) {
|
||||
res = new(wxApplet.SecurityManagementDetailsRes)
|
||||
err = g.Try(ctx, func(ctx context.Context) {
|
||||
m := g.DB().Model("reminders").As("f").
|
||||
LeftJoin("bus_hse_management", "a", "a.id = f.order_id").
|
||||
LeftJoin("sys_project", "b", "b.id = a.project_id").
|
||||
LeftJoin("sys_dict_data", "c", "c.dict_type = 'study_type' and c.dict_value = a.study_type").
|
||||
LeftJoin("sys_dict_data", "e", "e.dict_type = 'tour_type' and e.dict_value = a.tour_type").
|
||||
LeftJoin(dao.BusConstructionUser.Table(), "d", "d.openid = a.corrector").
|
||||
Fields(
|
||||
"a.id,b.project_name as projectName," + // 主键ID、项目名称
|
||||
"c.dict_label as studyTypeName," + // 检查类型
|
||||
"e.dict_label as tourTypeName," + // 违章类型
|
||||
"a.inspection_result," + // 巡检结果
|
||||
"a.check_time," + // 检查时间
|
||||
"a.reply_date," + // 要求整改期限
|
||||
"a.team_name as teamName," + // 班组
|
||||
"d.user_name as abarbeitung," + // 整改人
|
||||
"a.rectification_time," + // 整改时间
|
||||
"a.hidden_danger," + // 问题隐患
|
||||
"a.measure," + // 整改措施
|
||||
"a.review_time," + // 复查时间
|
||||
"a.review," + // 复查情况
|
||||
"f.status," + // 工单状态
|
||||
"a.review_type," + // 复查状态
|
||||
"a.created_by as fill," + // 复查状态
|
||||
"a.created_at") // 创建人(检查、复查)
|
||||
err = m.Where("f.id", req.Id).Scan(&res)
|
||||
|
||||
liberr.ErrIsNil(ctx, err, "查询失败")
|
||||
// 2、获取附件
|
||||
var pathEntity []*wxApplet.SecurityManagementDetailsPath
|
||||
err = g.DB().Model("bus_hse_management_path").Ctx(ctx).Where("ticket_id", req.Id).Scan(&pathEntity)
|
||||
liberr.ErrIsNil(ctx, err, "查询失败")
|
||||
// 3、分类附件
|
||||
var one []*wxApplet.SecurityManagementDetailsPath
|
||||
var two []*wxApplet.SecurityManagementDetailsPath
|
||||
for i := range pathEntity {
|
||||
if pathEntity[i].Type == "1" {
|
||||
one = append(one, pathEntity[i])
|
||||
} else {
|
||||
two = append(two, pathEntity[i])
|
||||
}
|
||||
}
|
||||
res.CheckAttachment = one
|
||||
res.AbarbeitungAttachment = two
|
||||
// 3、获取
|
||||
res.Fill = coryCommon.SelectByString(ctx, coryCommon.IsNumeric(res.Fill), res.Fill)
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
// ===========================================请假===========================================
|
||||
// ===========================================请假===========================================
|
||||
// ===========================================请假===========================================
|
||||
|
||||
// AppAskForLeaveAdd 务工者-请假新增
|
||||
func (c *appPortController) AppAskForLeaveAdd(ctx context.Context, req *wxApplet.AppAskForLeaveAddReq) (res *wxApplet.AppBusAskforleaveAddRes, err error) {
|
||||
err = service.BusAskforleave().AppAskForLeaveAdd(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
// AppAskForLeaveListPage 务工者-请假记录列表-分页
|
||||
func (c *appPortController) AppAskForLeaveListPage(ctx context.Context, req *wxApplet.AppAskForLeaveListPageReq) (res *wxApplet.AppAskForLeaveListPageRes, err error) {
|
||||
return service.BusAskforleave().AppAskForLeaveListPage(ctx, req)
|
||||
}
|
||||
|
||||
// AppAskForLeaveInfo 务工者-请假详情
|
||||
func (c *appPortController) AppAskForLeaveInfo(ctx context.Context, req *wxApplet.AppAskForLeaveInfoReq) (res *wxApplet.AppAskForLeaveInfoRes, err error) {
|
||||
return service.BusAskforleave().AppAskForLeaveInfo(ctx, req)
|
||||
}
|
||||
|
||||
// AppBzzAskForLeaveListPage 班组长-审批
|
||||
func (c *appPortController) AppBzzAskForLeaveUpdate(ctx context.Context, req *wxApplet.AppBzzAskForLeaveUpdateReq) (res *wxApplet.AppBzzAskForLeaveUpdateRes, err error) {
|
||||
err = service.BusAskforleave().AppBzzAskForLeaveUpdate(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
// ===========================================其它===========================================
|
||||
// ===========================================其它===========================================
|
||||
// ===========================================其它===========================================
|
||||
|
||||
// AppBase64ToImgFuncFunc 将图片的base64转成png存储到本地,返回相对路径
|
||||
func (c *appPortController) AppBase64ToImgFuncFunc(ctx context.Context, req *wxApplet.AppBase64ToImgFuncReq) (res *wxApplet.AppBase64ToImgFuncRes, err error) {
|
||||
res = new(wxApplet.AppBase64ToImgFuncRes)
|
||||
path, err := coryCommon.Base64ToImgFunc(req.Base64Str, "1", coryCommon.Helmet)
|
||||
res.Path = "/" + path
|
||||
return
|
||||
}
|
||||
|
||||
// AppGetLatestAppVersionFunc 获取最新的App版本号
|
||||
func (c *appPortController) AppGetLatestAppVersionFunc(ctx context.Context, req *wxApplet.GetLatestAppVersionReq) (*wxApplet.GetLatestAppVersionRes, error) {
|
||||
var AppVersionInfo entity.AppVersions
|
||||
err := controllerDao.AppVersions.Ctx(ctx).Fields(entity.AppVersions{}).
|
||||
Where(controllerDao.AppVersions.Columns().Platform, req.Platform).
|
||||
OrderDesc(controllerDao.AppVersions.Columns().Id).Limit(1).Scan(&AppVersionInfo)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &wxApplet.GetLatestAppVersionRes{
|
||||
Info: AppVersionInfo,
|
||||
}, nil
|
||||
}
|
||||
|
||||
// AppReleaseAppVersionFunc 发布一个新的版本
|
||||
func (c *appPortController) AppReleaseAppVersionFunc(ctx context.Context, req *wxApplet.ReleaseAppVersionReq) (*wxApplet.ReleaseAppVersionRes, error) {
|
||||
var (
|
||||
path, _ = os.Getwd()
|
||||
Version = req.Version
|
||||
plantType = req.Platform
|
||||
)
|
||||
|
||||
// 根据平台类型拼接版本号
|
||||
var devicePlatform string
|
||||
switch plantType {
|
||||
case 0:
|
||||
devicePlatform = "Android"
|
||||
case 1:
|
||||
devicePlatform = "IOS"
|
||||
}
|
||||
|
||||
// 拼接文件保存路径: 当前路径 + resource + public + version + 版本号 + 平台类型
|
||||
filePath := filepath.Join(path, "resource", "public", "version", Version, devicePlatform)
|
||||
|
||||
// 保存到数据库的静态文件托管路径: file + version + 版本号 + 平台类型 + 文件名
|
||||
savePath := filepath.Join("file", "version", Version, devicePlatform, req.File.Filename)
|
||||
|
||||
// 检查版本号是否已存在,如果存在则用新版本替换旧版本
|
||||
var appVersion entity.AppVersions
|
||||
if err := controllerDao.AppVersions.Ctx(ctx).Where(controllerDao.AppVersions.Columns().Version, Version).Where(controllerDao.AppVersions.Columns().Platform, plantType).Scan(&appVersion); err == nil {
|
||||
// 删除旧版本文件
|
||||
if err := os.RemoveAll(filepath.Join(filePath, filepath.Base(appVersion.FilePath))); err != nil {
|
||||
return nil, fmt.Errorf("删除以往的版本文件失败:%w", err)
|
||||
}
|
||||
|
||||
// 保存新版本文件
|
||||
if _, err := req.File.Save(filePath); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// 更新数据库中的文件路径
|
||||
if _, err := controllerDao.AppVersions.Ctx(ctx).Data(gdb.Map{controllerDao.AppVersions.Columns().FilePath: savePath}).Where(controllerDao.AppVersions.Columns().Id, appVersion.Id).Update(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &wxApplet.ReleaseAppVersionRes{}, nil
|
||||
}
|
||||
|
||||
if _, err := req.File.Save(filePath); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// 构造数据库记录
|
||||
appVersionInfo := entity.AppVersions{
|
||||
Version: Version, // 版本号
|
||||
FilePath: savePath, // 文件路径
|
||||
Platform: plantType, // 平台类型
|
||||
}
|
||||
|
||||
// 保存到数据库
|
||||
_, err := controllerDao.AppVersions.Ctx(ctx).Data(appVersionInfo).Insert()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &wxApplet.ReleaseAppVersionRes{}, nil
|
||||
}
|
||||
22
internal/app/wxApplet/controller/base.go
Normal file
22
internal/app/wxApplet/controller/base.go
Normal file
@ -0,0 +1,22 @@
|
||||
/*
|
||||
* @desc:system base controller
|
||||
* @company:云南奇讯科技有限公司
|
||||
* @Author: yixiaohu
|
||||
* @Date: 2022/3/4 18:12
|
||||
*/
|
||||
|
||||
package controller
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/net/ghttp"
|
||||
commonController "github.com/tiger1103/gfast/v3/internal/app/common/controller"
|
||||
)
|
||||
|
||||
type BaseController struct {
|
||||
commonController.BaseController
|
||||
}
|
||||
|
||||
// Init 自动执行的初始化方法
|
||||
func (c *BaseController) Init(r *ghttp.Request) {
|
||||
c.BaseController.Init(r)
|
||||
}
|
||||
145
internal/app/wxApplet/controller/bus_attendance.go
Normal file
145
internal/app/wxApplet/controller/bus_attendance.go
Normal file
@ -0,0 +1,145 @@
|
||||
// ==========================================================================
|
||||
// GFast自动生成controller操作代码。
|
||||
// 生成日期:2023-08-07 16:29:52
|
||||
// 生成路径: internal/app/wxApplet/controller/bus_attendance.go
|
||||
// 生成人:gfast
|
||||
// desc:考勤
|
||||
// company:云南奇讯科技有限公司
|
||||
// ==========================================================================
|
||||
|
||||
package controller
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"github.com/tiger1103/gfast/v3/api/v1/common/coryCommon/excelUtil"
|
||||
"github.com/tiger1103/gfast/v3/api/wxApplet/wxApplet"
|
||||
systemController "github.com/tiger1103/gfast/v3/internal/app/system/controller"
|
||||
"github.com/tiger1103/gfast/v3/internal/app/wxApplet/service"
|
||||
"strings"
|
||||
)
|
||||
|
||||
type busAttendanceController struct {
|
||||
systemController.BaseController
|
||||
}
|
||||
|
||||
var BusAttendance = new(busAttendanceController)
|
||||
|
||||
// SalaryDetailsFunc 小程序工资详情
|
||||
func (c *busAttendanceController) SalaryDetailsFunc(ctx context.Context, req *wxApplet.SalaryDetailsReq) (res *wxApplet.SalaryDetailsRes, err error) {
|
||||
res = new(wxApplet.SalaryDetailsRes)
|
||||
res, err = service.BusAttendance().SalaryDetailsFunc(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
// ProjectExport 导出(项目专用)
|
||||
func (c *busAttendanceController) ProjectExport(ctx context.Context, req *wxApplet.PunchingCardRecordProjectReq) (res *wxApplet.PunchingCardRecordTwoRes, err error) {
|
||||
recordReq := &wxApplet.PunchingCardRecordReq{
|
||||
ProjectId: req.ProjectId,
|
||||
SelectDate: req.SelectDate,
|
||||
Type: req.Type,
|
||||
}
|
||||
res = new(wxApplet.PunchingCardRecordTwoRes)
|
||||
res, err = PublicExport(ctx, recordReq)
|
||||
return res, err
|
||||
}
|
||||
|
||||
// Export 导出
|
||||
func (c *busAttendanceController) Export(ctx context.Context, req *wxApplet.PunchingCardRecordReq) (res *wxApplet.PunchingCardRecordTwoRes, err error) {
|
||||
res = new(wxApplet.PunchingCardRecordTwoRes)
|
||||
res, err = PublicExport(ctx, req)
|
||||
return res, err
|
||||
}
|
||||
|
||||
func PublicExport(ctx context.Context, req *wxApplet.PunchingCardRecordReq) (res *wxApplet.PunchingCardRecordTwoRes, err error) {
|
||||
var resList *wxApplet.PunchingCardRecordRes
|
||||
//1、生成数据
|
||||
resList, err = service.BusAttendance().Export(ctx, req)
|
||||
//2、生成excel数据表
|
||||
_, filePath, _ := excelUtil.ExcelThree(resList.List)
|
||||
if filePath == "" {
|
||||
err = errors.New("导出失败!")
|
||||
return nil, err
|
||||
}
|
||||
res = new(wxApplet.PunchingCardRecordTwoRes)
|
||||
getwd := strings.ReplaceAll(filePath, "\\", "/")
|
||||
all := strings.ReplaceAll(getwd, "/resource/public", "/file")
|
||||
res.Path = all
|
||||
return res, err
|
||||
}
|
||||
|
||||
//// delFile 删除文件
|
||||
//func delFile(file string) {
|
||||
// time.Sleep(10 * time.Second)
|
||||
// // 5. 删除本地临时文件
|
||||
// if err := os.Remove(file); err != nil {
|
||||
// fmt.Println("Failed to delete temporary file:", err)
|
||||
// }
|
||||
//10秒过后自动删除文件
|
||||
//go delFile(file)
|
||||
//}
|
||||
|
||||
// List 列表
|
||||
func (c *busAttendanceController) List(ctx context.Context, req *wxApplet.BusAttendanceSearchReq) (res *wxApplet.BusAttendanceSearchRes, err error) {
|
||||
res, err = service.BusAttendance().List(ctx, req)
|
||||
return res, err
|
||||
}
|
||||
|
||||
// Get 获取考勤
|
||||
func (c *busAttendanceController) Get(ctx context.Context, req *wxApplet.BusAttendanceGetReq) (res *wxApplet.BusAttendanceGetRes, err error) {
|
||||
res = new(wxApplet.BusAttendanceGetRes)
|
||||
res.BusAttendanceInfoRes, err = service.BusAttendance().GetById(ctx, req.Id)
|
||||
return
|
||||
}
|
||||
|
||||
// Add 添加考勤
|
||||
func (c *busAttendanceController) Add(ctx context.Context, req *wxApplet.BusAttendanceAddReq) (res *wxApplet.BusAttendanceAddRes, err error) {
|
||||
err = service.BusAttendance().Add(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
// Edit 修改考勤
|
||||
func (c *busAttendanceController) Edit(ctx context.Context, req *wxApplet.BusAttendanceEditReq) (res *wxApplet.BusAttendanceEditRes, err error) {
|
||||
err = service.BusAttendance().Edit(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
// Delete 删除考勤
|
||||
func (c *busAttendanceController) Delete(ctx context.Context, req *wxApplet.BusAttendanceDeleteReq) (res *wxApplet.BusAttendanceDeleteRes, err error) {
|
||||
err = service.BusAttendance().Delete(ctx, req.Ids)
|
||||
return
|
||||
}
|
||||
|
||||
// ByOpenidFunc 打卡日历
|
||||
func (c *busAttendanceController) ByOpenidFunc(ctx context.Context, req *wxApplet.ByOpenIdFuncReq) (res *wxApplet.ByOpenIdFuncRes, err error) {
|
||||
res, err = service.BusAttendance().ByOpenidFunc(ctx, req)
|
||||
return res, err
|
||||
}
|
||||
|
||||
// PCListFunc 后端pc考勤打卡列表
|
||||
func (c *busAttendanceController) PCListFunc(ctx context.Context, req *wxApplet.PCListReq) (res *wxApplet.PCListRes, err error) {
|
||||
res, err = service.BusAttendance().PCListFunc(ctx, req)
|
||||
return res, err
|
||||
}
|
||||
|
||||
// AttendanceByOpenIdFunc 根据openid去获取到当前用户当天的打卡信息
|
||||
func (c *busAttendanceController) AttendanceByOpenIdFunc(ctx context.Context, req *wxApplet.AttendanceByOpenIdGetReq) (res *wxApplet.AttendanceByOpenIdRes, err error) {
|
||||
res = new(wxApplet.AttendanceByOpenIdRes)
|
||||
idFunc, err := service.BusAttendance().AttendanceByOpenIdFunc(ctx, req.Openid)
|
||||
res = idFunc
|
||||
return
|
||||
}
|
||||
|
||||
// ListOfAttendanceMachines 建立考勤机列表
|
||||
func (c *busAttendanceController) ListOfAttendanceMachines(ctx context.Context, req *wxApplet.AttendanceByOpenIdGetReq) (res *wxApplet.AttendanceByOpenIdRes, err error) {
|
||||
res = new(wxApplet.AttendanceByOpenIdRes)
|
||||
idFunc, err := service.BusAttendance().AttendanceByOpenIdFunc(ctx, req.Openid)
|
||||
res = idFunc
|
||||
return
|
||||
}
|
||||
|
||||
// 修改考勤机的基本信息(如项目选择、班组)
|
||||
|
||||
// 修改考勤机的基本信息(如项)
|
||||
|
||||
// 获取当前设备所关联到的班组下的所有成员消息
|
||||
54
internal/app/wxApplet/controller/bus_construction_project.go
Normal file
54
internal/app/wxApplet/controller/bus_construction_project.go
Normal file
@ -0,0 +1,54 @@
|
||||
// ==========================================================================
|
||||
// GFast自动生成controller操作代码。
|
||||
// 生成日期:2023-08-07 11:17:50
|
||||
// 生成路径: internal/app/wxApplet/controller/bus_construction_project.go
|
||||
// 生成人:gfast
|
||||
// desc:施工人员对应项目
|
||||
// company:云南奇讯科技有限公司
|
||||
// ==========================================================================
|
||||
|
||||
package controller
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/tiger1103/gfast/v3/api/wxApplet/wxApplet"
|
||||
systemController "github.com/tiger1103/gfast/v3/internal/app/system/controller"
|
||||
"github.com/tiger1103/gfast/v3/internal/app/wxApplet/service"
|
||||
)
|
||||
|
||||
type busConstructionProjectController struct {
|
||||
systemController.BaseController
|
||||
}
|
||||
|
||||
var BusConstructionProject = new(busConstructionProjectController)
|
||||
|
||||
// List 列表
|
||||
func (c *busConstructionProjectController) List(ctx context.Context, req *wxApplet.BusConstructionProjectSearchReq) (res *wxApplet.BusConstructionProjectSearchRes, err error) {
|
||||
res, err = service.BusConstructionProject().List(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
// Get 获取施工人员对应项目
|
||||
func (c *busConstructionProjectController) Get(ctx context.Context, req *wxApplet.BusConstructionProjectGetReq) (res *wxApplet.BusConstructionProjectGetRes, err error) {
|
||||
res = new(wxApplet.BusConstructionProjectGetRes)
|
||||
res.BusConstructionProjectInfoRes, err = service.BusConstructionProject().GetById(ctx, req.Id)
|
||||
return
|
||||
}
|
||||
|
||||
// Add 添加施工人员对应项目
|
||||
func (c *busConstructionProjectController) Add(ctx context.Context, req *wxApplet.BusConstructionProjectAddReq) (res *wxApplet.BusConstructionProjectAddRes, err error) {
|
||||
err = service.BusConstructionProject().Add(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
// Edit 修改施工人员对应项目
|
||||
func (c *busConstructionProjectController) Edit(ctx context.Context, req *wxApplet.BusConstructionProjectEditReq) (res *wxApplet.BusConstructionProjectEditRes, err error) {
|
||||
err = service.BusConstructionProject().Edit(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
// Delete 删除施工人员对应项目
|
||||
func (c *busConstructionProjectController) Delete(ctx context.Context, req *wxApplet.BusConstructionProjectDeleteReq) (res *wxApplet.BusConstructionProjectDeleteRes, err error) {
|
||||
err = service.BusConstructionProject().Delete(ctx, req.Ids)
|
||||
return
|
||||
}
|
||||
475
internal/app/wxApplet/controller/bus_construction_user.go
Normal file
475
internal/app/wxApplet/controller/bus_construction_user.go
Normal file
@ -0,0 +1,475 @@
|
||||
// ==========================================================================
|
||||
// GFast自动生成controller操作代码。
|
||||
// 生成日期:2023-08-07 11:17:50
|
||||
// 生成路径: internal/app/wxApplet/controller/bus_construction_user.go
|
||||
// 生成人:gfast
|
||||
// desc:施工人员
|
||||
// company:云南奇讯科技有限公司
|
||||
// ==========================================================================
|
||||
|
||||
package controller
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/net/ghttp"
|
||||
"github.com/gogf/gf/v2/os/gfile"
|
||||
"github.com/tiger1103/gfast/v3/api/v1/common/coryCommon"
|
||||
"github.com/tiger1103/gfast/v3/api/v1/system"
|
||||
"github.com/tiger1103/gfast/v3/api/wxApplet/wxApplet"
|
||||
systemController "github.com/tiger1103/gfast/v3/internal/app/system/controller"
|
||||
"github.com/tiger1103/gfast/v3/internal/app/system/dao"
|
||||
controllerModel "github.com/tiger1103/gfast/v3/internal/app/system/model"
|
||||
systemService "github.com/tiger1103/gfast/v3/internal/app/system/service"
|
||||
daoTwo "github.com/tiger1103/gfast/v3/internal/app/wxApplet/dao"
|
||||
"github.com/tiger1103/gfast/v3/internal/app/wxApplet/model"
|
||||
"github.com/tiger1103/gfast/v3/internal/app/wxApplet/service"
|
||||
"github.com/tiger1103/gfast/v3/library/liberr"
|
||||
"os"
|
||||
"strings"
|
||||
)
|
||||
|
||||
type busConstructionUserController struct {
|
||||
systemController.BaseController
|
||||
}
|
||||
|
||||
var BusConstructionUser = new(busConstructionUserController)
|
||||
|
||||
// ImgUpload 图片(银行卡或身份证)上传并返回图片内容
|
||||
func (c *busConstructionUserController) ImgUpload(ctx context.Context, req *wxApplet.ImgUploadReq) (res *wxApplet.ImgUploadRes, err error) {
|
||||
m := make(map[string]interface{})
|
||||
//1、上传图片
|
||||
str, err := coryCommon.UploadFile(ctx, req.ImgUpload, coryCommon.LargeFilePrivacy)
|
||||
if len(str) > 0 && str[0] == '/' {
|
||||
str = str[1:]
|
||||
}
|
||||
//2、获取图片的二进制
|
||||
getwd, err := os.Getwd()
|
||||
join := gfile.Join(getwd, str)
|
||||
//3、解析图片内容
|
||||
var ocr coryCommon.OcrReq
|
||||
strType := req.StrType
|
||||
switch strType {
|
||||
case "1":
|
||||
err, urlBase64 := coryCommon.ImgDataBase64(join)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
ocr = coryCommon.OcrReq{
|
||||
Image: urlBase64,
|
||||
IdCardSide: "front",
|
||||
DetectPhoto: true,
|
||||
}
|
||||
m = coryCommon.ImgOCR(ocr)
|
||||
case "2":
|
||||
err, urlBase64 := coryCommon.ImgDataBase64(join)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
ocr = coryCommon.OcrReq{
|
||||
Image: urlBase64,
|
||||
IdCardSide: "back",
|
||||
}
|
||||
m = coryCommon.ImgOCR(ocr)
|
||||
case "3":
|
||||
urlBase64Two, err := coryCommon.EncodeAndUrlEncodeImage(join, 4)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
ocr = coryCommon.OcrReq{
|
||||
Image: urlBase64Two,
|
||||
}
|
||||
m = coryCommon.ImgYhkOCR(ocr)
|
||||
}
|
||||
//合同4不进行校验
|
||||
if strType == "3" && len(m) < 3 {
|
||||
err = errors.New("银行卡无效,请重新上传!")
|
||||
return nil, err
|
||||
}
|
||||
if strType != "4" && len(m) < 1 {
|
||||
err = errors.New("身份证无效,请重新上传!")
|
||||
return nil, err
|
||||
}
|
||||
|
||||
//修改str的路径 resource/public 改成 file /resource/public/privacy/2023-08-10/16916519795176443.png
|
||||
str = strings.ReplaceAll(str, "resource/public", "file")
|
||||
m["ImgPath"] = "/" + str
|
||||
res = &wxApplet.ImgUploadRes{}
|
||||
res.MapKV = &m
|
||||
return
|
||||
}
|
||||
|
||||
// PacePhotoFunc 人脸检测()
|
||||
func (c *busConstructionUserController) PacePhotoFunc(ctx context.Context, req *wxApplet.PacePhotoReq) (res *wxApplet.PacePhotoRes, err error) {
|
||||
res = new(wxApplet.PacePhotoRes)
|
||||
res.Path, err = FaceDetectionFunc(ctx, req.File)
|
||||
return
|
||||
}
|
||||
|
||||
// List 列表 获取所有的图片资源(0~10)
|
||||
func (c *busConstructionUserController) List(ctx context.Context, req *wxApplet.BusConstructionUserSearchReq) (res *wxApplet.BusConstructionUserSearchRes, err error) {
|
||||
res, err = service.BusConstructionUser().List(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
// PersonnelListFunc 人员列表(只返回id、头像、名称、电话)
|
||||
func (c *busConstructionUserController) PersonnelListFunc(ctx context.Context, req *wxApplet.PersonnelListReq) (res *wxApplet.PersonnelListRes, err error) {
|
||||
res, err = service.BusConstructionUser().PersonnelListFunc(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
// PersonnelInquiryFunc 查询在职施工人员(只返回id、名称)
|
||||
func (c *busConstructionUserController) PersonnelInquiryFunc(ctx context.Context, req *wxApplet.PersonnelInquiryReq) (res *wxApplet.PersonnelInquiryRes, err error) {
|
||||
res, err = service.BusConstructionUser().PersonnelInquiryFunc(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
// Get 施工人员列表_文件上传【详情】
|
||||
func (c *busConstructionUserController) Get(ctx context.Context, req *wxApplet.BusConstructionUserGetReq) (res *wxApplet.BusConstructionUserGetRes, err error) {
|
||||
res = new(wxApplet.BusConstructionUserGetRes)
|
||||
res.BusConstructionUserInfoRes, err = service.BusConstructionUser().GetById(ctx, req.Id)
|
||||
//2、图片资源
|
||||
var dataInfo2 []*model.BusConstructionUserFileListRes
|
||||
dao.BusConstructionUserFile.Ctx(ctx).Where("user_id", res.Id).Where("user_img_type in (0,1,2,3)").Scan(&dataInfo2)
|
||||
res.ImgFileListTwo = dataInfo2
|
||||
//2、图片资源
|
||||
var dataInfo []*model.BusConstructionUserFileListRes
|
||||
daoTwo.BusConstructionUserFile.Ctx(ctx).As("a").
|
||||
LeftJoin("sys_dict_data", "a.user_img_type = b.dict_value and dict_type= 'user_img_type' ").As("b").
|
||||
Where("a.user_id", res.Id).
|
||||
Where("a.user_img_type in (4,5,6,7,8,10)"). //0,1,2,3,
|
||||
Fields("a.*,b.dict_label").
|
||||
Scan(&dataInfo)
|
||||
res.ImgFileList = dataInfo
|
||||
return
|
||||
}
|
||||
|
||||
// GetDetailsFunc 施工人员列表_详情
|
||||
func (c *busConstructionUserController) GetDetailsFunc(ctx context.Context, req *wxApplet.GetDetailsReq) (res *wxApplet.GetDetailsRes, err error) {
|
||||
res = new(wxApplet.GetDetailsRes)
|
||||
res, err = service.BusConstructionUser().GetDetailsFunc(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
// Add 添加施工人员
|
||||
func (c *busConstructionUserController) Add(ctx context.Context, req *wxApplet.BusConstructionUserAddReq) (res *wxApplet.BusConstructionUserAddRes, err error) {
|
||||
res = new(wxApplet.BusConstructionUserAddRes)
|
||||
add, err := service.BusConstructionUser().Add(ctx, req)
|
||||
res.Id = add
|
||||
return
|
||||
}
|
||||
|
||||
// Edit 修改施工人员
|
||||
func (c *busConstructionUserController) Edit(ctx context.Context, req *wxApplet.BusConstructionUserEditReq) (res *wxApplet.BusConstructionUserEditRes, err error) {
|
||||
err = service.BusConstructionUser().Edit(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
// Delete 删除施工人员
|
||||
func (c *busConstructionUserController) Delete(ctx context.Context, req *wxApplet.BusConstructionUserDeleteReq) (res *wxApplet.BusConstructionUserDeleteRes, err error) {
|
||||
err = service.BusConstructionUser().Delete(ctx, req.Ids)
|
||||
return
|
||||
}
|
||||
|
||||
// ChangeStateFunc 【小程序】变更施工人员在职/离职情况
|
||||
func (c *busConstructionUserController) ChangeStateFunc(ctx context.Context, req *wxApplet.ChangeStateReq) (res *wxApplet.ChangeStateRes, err error) {
|
||||
res = new(wxApplet.ChangeStateRes)
|
||||
err = service.BusConstructionUser().ChangeStateFunc(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
// GetByOpenId 【小程序】获取施工人员 获取部分图片资源(0,1,2,3)
|
||||
func (c *busConstructionUserController) GetByOpenId(ctx context.Context, req *wxApplet.BusConstructionUserByOpenIdGetReq) (res *wxApplet.BusConstructionUserByOpenIdGetRes, err error) {
|
||||
res = new(wxApplet.BusConstructionUserByOpenIdGetRes)
|
||||
res, err = service.BusConstructionUser().GetByOpenId(ctx, req.OpenId)
|
||||
//根据角色获取到所有的模块,然后对模块进行去重
|
||||
var swmi []*controllerModel.SysWechatModuleInfoRes
|
||||
g.DB().Model("sys_wxchat_role_module").As("a").
|
||||
Fields("DISTINCT b.name,b.id,b.list_order").
|
||||
LeftJoin("sys_wechat_module", "b", "a.module_id = b.id").
|
||||
Where("a.role_id in (?)", res.RoleIds).
|
||||
Order("b.list_order asc,b.id asc").Scan(&swmi)
|
||||
var mk []string
|
||||
for i := range swmi {
|
||||
mk = append(mk, swmi[i].Name)
|
||||
}
|
||||
res.ModuleName = mk
|
||||
return
|
||||
}
|
||||
|
||||
// WeatherFunc 【小程序】获取施工人员天气
|
||||
func (c *busConstructionUserController) WeatherFunc(ctx context.Context, req *wxApplet.WeatherReq) (res *wxApplet.WeatherRes, err error) {
|
||||
res = new(wxApplet.WeatherRes)
|
||||
we := coryCommon.Weather(req.Location)
|
||||
bodyData := []byte(we)
|
||||
err = json.Unmarshal(bodyData, &res)
|
||||
if err != nil {
|
||||
fmt.Println("Failed to parse JSON data:", err)
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// GridPointFunc 【小程序】获取格点天气
|
||||
func (c *busConstructionUserController) GridPointFunc(ctx context.Context, req *wxApplet.GridPointFuncReq) (res *wxApplet.GridPointFuncRes, err error) {
|
||||
res = new(wxApplet.GridPointFuncRes)
|
||||
gp, err := coryCommon.GridPoint(req.Location)
|
||||
if err != nil {
|
||||
return
|
||||
} else {
|
||||
res.GridPointRes = gp
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// InverseGeocodingFunc 【小程序】逆地理编码
|
||||
func (c *busConstructionUserController) InverseGeocodingFunc(ctx context.Context, req *wxApplet.InverseGeocodingReq) (res *wxApplet.InverseGeocodingRes, err error) {
|
||||
res = new(wxApplet.InverseGeocodingRes)
|
||||
we := coryCommon.InverseGeocoding(req.Location)
|
||||
bodyData := []byte(we)
|
||||
err = json.Unmarshal(bodyData, &res)
|
||||
if err != nil {
|
||||
fmt.Println("Failed to parse JSON data:", err)
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// GroupLeader 【小程序】班组长成员列表
|
||||
func (c *busConstructionUserController) GroupLeader(ctx context.Context, req *wxApplet.GroupLeaderReq) (res *wxApplet.GroupLeaderRes, err error) {
|
||||
res = new(wxApplet.GroupLeaderRes)
|
||||
res, err = service.BusConstructionUser().GroupLeader(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
// PayFunc 【小程序】薪水变更
|
||||
func (c *busConstructionUserController) PayFunc(ctx context.Context, req *wxApplet.PayFuncReq) (res *wxApplet.PayFuncRes, err error) {
|
||||
res = new(wxApplet.PayFuncRes)
|
||||
res, err = service.BusConstructionUser().PayFunc(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
// AttendanceCountFunc 【小程序】出勤统计情况
|
||||
func (c *busConstructionUserController) AttendanceCountFunc(ctx context.Context, req *wxApplet.AttendanceReq) (res *wxApplet.AttendanceRes, err error) {
|
||||
res, err = service.BusConstructionUser().AttendanceFunc(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
// AttendanceCountListFunc 【小程序】出勤人员列表
|
||||
func (c *busConstructionUserController) AttendanceCountListFunc(ctx context.Context, req *wxApplet.AttendanceListReq) (res *wxApplet.AttendanceListRes, err error) {
|
||||
res, err = service.BusConstructionUser().AttendanceCountListFunc(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
// ProjectRecordFunc 【小程序】是否开启小程序项目备案project_record
|
||||
func (c *busConstructionUserController) ProjectRecordFunc(ctx context.Context, req *wxApplet.ProjectRecordReq) (res *wxApplet.ProjectRecordRes, err error) {
|
||||
res = new(wxApplet.ProjectRecordRes)
|
||||
res, err = service.BusConstructionUser().ProjectRecordFunc(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
// HumanFaceFunc 【小程序】更换实名认证的人脸照片
|
||||
func (c *busConstructionUserController) HumanFaceFunc(ctx context.Context, req *wxApplet.HumanFaceReq) (res *wxApplet.HumanFaceReqRes, err error) {
|
||||
res = new(wxApplet.HumanFaceReqRes)
|
||||
res, err = service.BusConstructionUser().HumanFaceFunc(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
// SubscriptionFunc 【小程序】小程序变更消息订阅状态
|
||||
func (c *busConstructionUserController) SubscriptionFunc(ctx context.Context, req *wxApplet.SubscriptionFuncReq) (res *wxApplet.SubscriptionFuncRes, err error) {
|
||||
res, err = service.BusConstructionUser().SubscriptionFunc(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
// ChangePayFunc 【小程序】根据openid改变当前微信用户的项目id
|
||||
func (c *busConstructionUserController) ChangePayFunc(ctx context.Context, req *wxApplet.ChangePayReq) (res *wxApplet.ChangePayRes, err error) {
|
||||
err = service.BusConstructionUser().ChangePayFunc(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
// OpenidByFounder 【小程序】获取当前用户当前项目的打卡坐标
|
||||
func (c *busConstructionUserController) OpenidByFounder(ctx context.Context, req *wxApplet.OpenidByFounderReq) (res *wxApplet.OpenidByFounderRes, err error) {
|
||||
res = new(wxApplet.OpenidByFounderRes)
|
||||
res, err = OpenidByFounderFunc(ctx, req.Openid)
|
||||
return
|
||||
}
|
||||
|
||||
func OpenidByFounderFunc(ctx context.Context, openid string) (res *wxApplet.OpenidByFounderRes, err error) {
|
||||
res = new(wxApplet.OpenidByFounderRes)
|
||||
var fz []*wxApplet.FangzhengEntity
|
||||
var pp []*wxApplet.ProjectPunchEntity
|
||||
g.Try(ctx, func(ctx context.Context) {
|
||||
pid, err := dao.BusConstructionUser.Ctx(ctx).Where("openid", openid).Fields("project_id").Value()
|
||||
value, err := dao.SysProject.Ctx(ctx).Where("id", pid).Fields("CONCAT(lng,',',lat) as jwd").Value()
|
||||
if err == nil {
|
||||
res.LongAndLat = value.String()
|
||||
}
|
||||
type fzEntity struct {
|
||||
Name string `json:"name" dc:"方正名称"`
|
||||
Detail string `json:"detail" dc:"方正边界坐标"`
|
||||
}
|
||||
//方正坐标范围
|
||||
var fe []*fzEntity
|
||||
err = dao.QianqiFangzhen.Ctx(ctx).Where("project_id", pid).Fields("name", "detail").Scan(&fe)
|
||||
for _, data := range fe {
|
||||
jsonData := data.Detail
|
||||
var fzTwo *wxApplet.FangzhengEntity
|
||||
err = json.Unmarshal([]byte(jsonData), &fzTwo)
|
||||
for i, position := range fzTwo.Entity {
|
||||
//坐标转换
|
||||
fzTwo.Entity[i].Lng, fzTwo.Entity[i].Lat = coryCommon.WGS84toGCJ02(position.Lng, position.Lat)
|
||||
}
|
||||
fzTwo.FangzhengName = data.Name
|
||||
fz = append(fz, fzTwo)
|
||||
}
|
||||
//打卡坐标范围
|
||||
var ppe []*fzEntity
|
||||
err = g.DB().Model("sys_project_punch_range").Ctx(ctx).Where("project_id", pid).Fields("punch_name as name", "punch_range as detail").Scan(&ppe)
|
||||
for _, data := range ppe {
|
||||
jsonData := data.Detail
|
||||
var arr []*wxApplet.Position
|
||||
err = json.Unmarshal([]byte(jsonData), &arr)
|
||||
for i := range arr {
|
||||
arr[i].Lng, arr[i].Lat = coryCommon.WGS84toGCJ02(arr[i].Lng, arr[i].Lat)
|
||||
}
|
||||
ppeTwo := wxApplet.ProjectPunchEntity{
|
||||
PunchName: data.Name,
|
||||
Entity: arr,
|
||||
}
|
||||
pp = append(pp, &ppeTwo)
|
||||
}
|
||||
liberr.ErrIsNil(ctx, err, "获取数据失败!")
|
||||
return
|
||||
})
|
||||
res.FangzhengEntity = fz
|
||||
res.ProjectPunchEntity = pp
|
||||
return
|
||||
}
|
||||
|
||||
// ActionPathFunc 根据openid获取到当前人的行动轨迹(前提是当前人有安全帽)
|
||||
func (c *busConstructionUserController) ActionPathFunc(ctx context.Context, req *wxApplet.ActionPathReq) (res *wxApplet.ActionPathRes, err error) {
|
||||
res = new(wxApplet.ActionPathRes)
|
||||
res.LatAndLonList, err = service.BusConstructionUser().ActionPathFunc(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
// CameraListFunc 获取摄像头列表(坐标进行转换了的)
|
||||
func (c *busConstructionUserController) CameraListFunc(ctx context.Context, req *wxApplet.QianqiCameraSearchReq) (res *wxApplet.QianqiCameraSearchRes, err error) {
|
||||
res = new(wxApplet.QianqiCameraSearchRes)
|
||||
data, err := systemService.QianqiCamera().NotPageList(ctx, req)
|
||||
res = data
|
||||
return
|
||||
}
|
||||
|
||||
// EditNameAndDetail 修改摄像头
|
||||
func (c *busConstructionUserController) EditNameAndDetail(ctx context.Context, req *wxApplet.QianqiCameraEditNameAndDetailReq) (res *wxApplet.QianqiCameraEditNameAndDetailRes, err error) {
|
||||
detailReq := system.QianqiCameraEditNameAndDetailReq{
|
||||
CameraName: req.CameraName,
|
||||
CameraCode: req.CameraCode,
|
||||
Detail: req.Detail,
|
||||
}
|
||||
err = systemService.QianqiCamera().WxEditNameAndDetail(ctx, &detailReq)
|
||||
return
|
||||
}
|
||||
|
||||
// ReissueACardWxAddFunc 《补卡申请》提交补卡申请
|
||||
func (c *busConstructionUserController) ReissueACardWxAddFunc(ctx context.Context, req *wxApplet.ReissueACardWxAddReq) (res *wxApplet.ReissueACardWxAddRes, err error) {
|
||||
err = systemService.BusReissueACard().ReissueACardWxAdd(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
// ReissueACardWxGetByIdFunc 《补卡申请》(我)补卡申请记录查看
|
||||
func (c *busConstructionUserController) ReissueACardWxGetByIdFunc(ctx context.Context, req *wxApplet.ReissueACardWxGetByIdReq) (res *wxApplet.ReissueACardWxGetByIdRes, err error) {
|
||||
res = new(wxApplet.ReissueACardWxGetByIdRes)
|
||||
res, err = systemService.BusReissueACard().ReissueACardWxGetByIdFunc(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
// ReissueACardWxGetByIdTeamFunc 《补卡申请》班组长查看自己需要同意或拒绝的补卡申请
|
||||
func (c *busConstructionUserController) ReissueACardWxGetByIdTeamFunc(ctx context.Context, req *wxApplet.ReissueACardWxGetByIdTeamReq) (res *wxApplet.ReissueACardWxGetByIdTeamRes, err error) {
|
||||
res = new(wxApplet.ReissueACardWxGetByIdTeamRes)
|
||||
res, err = systemService.BusReissueACard().ReissueACardWxGetByIdTeam(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
// ReissueACardWxEditTeamFunc 《补卡申请》班组长审批修改提交补卡申请的状态
|
||||
func (c *busConstructionUserController) ReissueACardWxEditTeamFunc(ctx context.Context, req *wxApplet.ReissueACardWxEditTeamReq) (res *wxApplet.ReissueACardWxGetByIdTeamRes, err error) {
|
||||
err = systemService.BusReissueACard().ReissueACardWxEditTeam(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
// JobForemanSumnumberFunc 《补卡申请》班组长未读的补卡申请有多少条?
|
||||
func (c *busConstructionUserController) JobForemanSumnumberFunc(ctx context.Context, req *wxApplet.JobForemanSumnumberReq) (res *wxApplet.JobForemanSumnumberRes, err error) {
|
||||
res = new(wxApplet.JobForemanSumnumberRes)
|
||||
number, err := systemService.BusReissueACard().JobForemanSumnumberFunc(ctx, req)
|
||||
res.Number = number
|
||||
return
|
||||
}
|
||||
|
||||
// BusConstructiomUserSignatureAddFunc 【签名】给指定用户新增签名
|
||||
func (c *busConstructionUserController) BusConstructiomUserSignatureAddFunc(ctx context.Context, req *wxApplet.BusConstructiomUserSignatureAddReq) (res *wxApplet.BusConstructiomUserSignatureAddRes, err error) {
|
||||
res = new(wxApplet.BusConstructiomUserSignatureAddRes)
|
||||
err = g.Try(ctx, func(ctx context.Context) {
|
||||
m := g.DB().Model("bus_constructiom_user_signature").Safe()
|
||||
//0、图片上传
|
||||
str, imgErr := coryCommon.UploadFile(ctx, req.Sign, coryCommon.Helmet)
|
||||
liberr.ErrIsNil(ctx, imgErr, "签名错误!")
|
||||
//1、删除指定openid的数据
|
||||
value, _ := m.Where("openid", req.Openid).Fields("signature").Value()
|
||||
os.Remove(strings.ReplaceAll(coryCommon.GetCWD()+"/"+value.String(), "\\", "/"))
|
||||
_, err := m.Where("openid", req.Openid).Delete()
|
||||
liberr.ErrIsNil(ctx, err, "添加失败")
|
||||
//2、新增指定用户签名
|
||||
g2 := g.Map{
|
||||
"openid": req.Openid,
|
||||
"signature": str,
|
||||
}
|
||||
_, err = m.Insert(g2)
|
||||
liberr.ErrIsNil(ctx, err, "添加失败")
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
// BusConstructiomUserSignatureQueryFunc 【签名】查询指定用户签名信息
|
||||
func (c *busConstructionUserController) BusConstructiomUserSignatureQueryFunc(ctx context.Context, req *wxApplet.BusConstructiomUserSignatureQueryReq) (res *wxApplet.BusConstructiomUserSignatureQueryRes, err error) {
|
||||
res = new(wxApplet.BusConstructiomUserSignatureQueryRes)
|
||||
err = g.Try(ctx, func(ctx context.Context) {
|
||||
var signature *model.BusConstructiomUserSignatureRes
|
||||
err = g.DB().Model("bus_constructiom_user_signature").Where("openid", req.Openid).Scan(&signature)
|
||||
liberr.ErrIsNil(ctx, err, "获取数据失败")
|
||||
res.Signature = signature
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
func FaceDetectionFunc(ctx context.Context, file *ghttp.UploadFile) (path string, err error) {
|
||||
err = g.Try(ctx, func(ctx context.Context) {
|
||||
//1、获取文件相对路径
|
||||
str, err := coryCommon.UploadFileTwo(ctx, file, coryCommon.Portrait+"/")
|
||||
liberr.ErrIsNil(ctx, err)
|
||||
getwd, err := os.Getwd()
|
||||
liberr.ErrIsNil(ctx, err)
|
||||
join := gfile.Join(getwd, str)
|
||||
//2、根据绝对路径获取到base64
|
||||
urlBase64Two, err := coryCommon.EncodeAndUrlEncodeImage(join, 2)
|
||||
liberr.ErrIsNil(ctx, err)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
//3、检测是否是人脸
|
||||
hfReq := &coryCommon.HumanFaceReq{}
|
||||
hfReq.Image = urlBase64Two
|
||||
hfReq.ImageType = "BASE64"
|
||||
hfReq.FaceField = "face_type,quality"
|
||||
err = coryCommon.HumanFace(hfReq)
|
||||
if err != nil {
|
||||
liberr.ErrIsNil(ctx, err)
|
||||
return
|
||||
}
|
||||
path = strings.Replace(str, "resource/public", "/wxfile", 1)
|
||||
})
|
||||
return
|
||||
}
|
||||
@ -0,0 +1,54 @@
|
||||
// ==========================================================================
|
||||
// GFast自动生成controller操作代码。
|
||||
// 生成日期:2023-08-07 11:17:55
|
||||
// 生成路径: internal/app/wxApplet/controller/bus_construction_user_file.go
|
||||
// 生成人:gfast
|
||||
// desc:微信用户的文件存储
|
||||
// company:云南奇讯科技有限公司
|
||||
// ==========================================================================
|
||||
|
||||
package controller
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/tiger1103/gfast/v3/api/wxApplet/wxApplet"
|
||||
systemController "github.com/tiger1103/gfast/v3/internal/app/system/controller"
|
||||
"github.com/tiger1103/gfast/v3/internal/app/wxApplet/service"
|
||||
)
|
||||
|
||||
type busConstructionUserFileController struct {
|
||||
systemController.BaseController
|
||||
}
|
||||
|
||||
var BusConstructionUserFile = new(busConstructionUserFileController)
|
||||
|
||||
// List 列表
|
||||
func (c *busConstructionUserFileController) List(ctx context.Context, req *wxApplet.BusConstructionUserFileSearchReq) (res *wxApplet.BusConstructionUserFileSearchRes, err error) {
|
||||
res, err = service.BusConstructionUserFile().List(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
// Get 获取微信用户的文件存储
|
||||
func (c *busConstructionUserFileController) Get(ctx context.Context, req *wxApplet.BusConstructionUserFileGetReq) (res *wxApplet.BusConstructionUserFileGetRes, err error) {
|
||||
res = new(wxApplet.BusConstructionUserFileGetRes)
|
||||
res.BusConstructionUserFileInfoRes, err = service.BusConstructionUserFile().GetById(ctx, req.Id)
|
||||
return
|
||||
}
|
||||
|
||||
// Add 添加微信用户的文件存储
|
||||
func (c *busConstructionUserFileController) Add(ctx context.Context, req *wxApplet.BusConstructionUserFileAddReq) (res *wxApplet.BusConstructionUserFileAddRes, err error) {
|
||||
err = service.BusConstructionUserFile().Add(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
// Edit 修改微信用户的文件存储
|
||||
func (c *busConstructionUserFileController) Edit(ctx context.Context, req *wxApplet.BusConstructionUserFileEditReq) (res *wxApplet.BusConstructionUserFileEditRes, err error) {
|
||||
err = service.BusConstructionUserFile().Edit(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
// Delete 删除微信用户的文件存储
|
||||
func (c *busConstructionUserFileController) Delete(ctx context.Context, req *wxApplet.BusConstructionUserFileDeleteReq) (res *wxApplet.BusConstructionUserFileDeleteRes, err error) {
|
||||
err = service.BusConstructionUserFile().Delete(ctx, req.Ids)
|
||||
return
|
||||
}
|
||||
@ -0,0 +1,54 @@
|
||||
// ==========================================================================
|
||||
// GFast自动生成controller操作代码。
|
||||
// 生成日期:2023-08-07 11:17:55
|
||||
// 生成路径: internal/app/wxApplet/controller/bus_construction_user_post.go
|
||||
// 生成人:gfast
|
||||
// desc:施工人员岗位
|
||||
// company:云南奇讯科技有限公司
|
||||
// ==========================================================================
|
||||
|
||||
package controller
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/tiger1103/gfast/v3/api/wxApplet/wxApplet"
|
||||
systemController "github.com/tiger1103/gfast/v3/internal/app/system/controller"
|
||||
"github.com/tiger1103/gfast/v3/internal/app/wxApplet/service"
|
||||
)
|
||||
|
||||
type busConstructionUserPostController struct {
|
||||
systemController.BaseController
|
||||
}
|
||||
|
||||
var BusConstructionUserPost = new(busConstructionUserPostController)
|
||||
|
||||
// List 列表
|
||||
func (c *busConstructionUserPostController) List(ctx context.Context, req *wxApplet.BusConstructionUserPostSearchReq) (res *wxApplet.BusConstructionUserPostSearchRes, err error) {
|
||||
res, err = service.BusConstructionUserPost().List(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
// Get 获取施工人员岗位
|
||||
func (c *busConstructionUserPostController) Get(ctx context.Context, req *wxApplet.BusConstructionUserPostGetReq) (res *wxApplet.BusConstructionUserPostGetRes, err error) {
|
||||
res = new(wxApplet.BusConstructionUserPostGetRes)
|
||||
res.BusConstructionUserPostInfoRes, err = service.BusConstructionUserPost().GetById(ctx, req.Id)
|
||||
return
|
||||
}
|
||||
|
||||
// Add 添加施工人员岗位
|
||||
func (c *busConstructionUserPostController) Add(ctx context.Context, req *wxApplet.BusConstructionUserPostAddReq) (res *wxApplet.BusConstructionUserPostAddRes, err error) {
|
||||
err = service.BusConstructionUserPost().Add(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
// Edit 修改施工人员岗位
|
||||
func (c *busConstructionUserPostController) Edit(ctx context.Context, req *wxApplet.BusConstructionUserPostEditReq) (res *wxApplet.BusConstructionUserPostEditRes, err error) {
|
||||
err = service.BusConstructionUserPost().Edit(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
// Delete 删除施工人员岗位
|
||||
func (c *busConstructionUserPostController) Delete(ctx context.Context, req *wxApplet.BusConstructionUserPostDeleteReq) (res *wxApplet.BusConstructionUserPostDeleteRes, err error) {
|
||||
err = service.BusConstructionUserPost().Delete(ctx, req.Ids)
|
||||
return
|
||||
}
|
||||
72
internal/app/wxApplet/controller/bus_labourservice.go
Normal file
72
internal/app/wxApplet/controller/bus_labourservice.go
Normal file
@ -0,0 +1,72 @@
|
||||
// ==========================================================================
|
||||
// GFast自动生成controller操作代码。
|
||||
// 生成日期:2023-08-14 11:24:31
|
||||
// 生成路径: internal/app/wxApplet/controller/bus_labourservice.go
|
||||
// 生成人:gfast
|
||||
// desc:劳务公司
|
||||
// company:云南奇讯科技有限公司
|
||||
// ==========================================================================
|
||||
|
||||
package controller
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/tiger1103/gfast/v3/api/wxApplet/wxApplet"
|
||||
systemController "github.com/tiger1103/gfast/v3/internal/app/system/controller"
|
||||
"github.com/tiger1103/gfast/v3/internal/app/wxApplet/service"
|
||||
)
|
||||
|
||||
type busLabourserviceController struct {
|
||||
systemController.BaseController
|
||||
}
|
||||
|
||||
var BusLabourservice = new(busLabourserviceController)
|
||||
|
||||
// List 列表
|
||||
func (c *busLabourserviceController) List(ctx context.Context, req *wxApplet.BusLabourserviceSearchReq) (res *wxApplet.BusLabourserviceSearchRes, err error) {
|
||||
res, err = service.BusLabourservice().List(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
// Get 获取劳务公司
|
||||
func (c *busLabourserviceController) Get(ctx context.Context, req *wxApplet.BusLabourserviceGetReq) (res *wxApplet.BusLabourserviceGetRes, err error) {
|
||||
res = new(wxApplet.BusLabourserviceGetRes)
|
||||
res.BusLabourserviceInfoRes, err = service.BusLabourservice().GetById(ctx, req.Id)
|
||||
return
|
||||
}
|
||||
|
||||
// Add 添加劳务公司
|
||||
func (c *busLabourserviceController) Add(ctx context.Context, req *wxApplet.BusLabourserviceAddReq) (res *wxApplet.BusLabourserviceAddRes, err error) {
|
||||
err = service.BusLabourservice().Add(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
// Edit 修改劳务公司
|
||||
func (c *busLabourserviceController) Edit(ctx context.Context, req *wxApplet.BusLabourserviceEditReq) (res *wxApplet.BusLabourserviceEditRes, err error) {
|
||||
err = service.BusLabourservice().Edit(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
// Delete 删除劳务公司
|
||||
func (c *busLabourserviceController) Delete(ctx context.Context, req *wxApplet.BusLabourserviceDeleteReq) (res *wxApplet.BusLabourserviceDeleteRes, err error) {
|
||||
err = service.BusLabourservice().Delete(ctx, req.Ids)
|
||||
return
|
||||
}
|
||||
|
||||
// PcAdd pc劳务公司资料新增
|
||||
func (c *busLabourserviceController) PcAdd(ctx context.Context, req *wxApplet.BusPcAddReq) (res *wxApplet.BusPcAddRes, err error) {
|
||||
err = service.BusLabourservice().PcAdd(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
// PcDel pc劳务公司资料删除
|
||||
func (c *busLabourserviceController) PcDel(ctx context.Context, req *wxApplet.BusPcDelReq) (res *wxApplet.BusPcDelRes, err error) {
|
||||
err = service.BusLabourservice().PcDel(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
// PcFind pc劳务公司资料查询
|
||||
func (c *busLabourserviceController) PcFind(ctx context.Context, req *wxApplet.BusPcFindReq) (res *wxApplet.BusPcFindRes, err error) {
|
||||
res, err = service.BusLabourservice().PcFind(ctx, req)
|
||||
return
|
||||
}
|
||||
54
internal/app/wxApplet/controller/sys_project_team.go
Normal file
54
internal/app/wxApplet/controller/sys_project_team.go
Normal file
@ -0,0 +1,54 @@
|
||||
// ==========================================================================
|
||||
// GFast自动生成controller操作代码。
|
||||
// 生成日期:2023-08-15 09:34:52
|
||||
// 生成路径: internal/app/wxApplet/controller/sys_project_team.go
|
||||
// 生成人:gfast
|
||||
// desc:项目班组
|
||||
// company:云南奇讯科技有限公司
|
||||
// ==========================================================================
|
||||
|
||||
package controller
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/tiger1103/gfast/v3/api/wxApplet/wxApplet"
|
||||
systemController "github.com/tiger1103/gfast/v3/internal/app/system/controller"
|
||||
"github.com/tiger1103/gfast/v3/internal/app/wxApplet/service"
|
||||
)
|
||||
|
||||
type sysProjectTeamController struct {
|
||||
systemController.BaseController
|
||||
}
|
||||
|
||||
var SysProjectTeam = new(sysProjectTeamController)
|
||||
|
||||
// List 列表
|
||||
func (c *sysProjectTeamController) List(ctx context.Context, req *wxApplet.SysProjectTeamSearchReq) (res *wxApplet.SysProjectTeamSearchRes, err error) {
|
||||
res, err = service.SysProjectTeam().List(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
// Get 获取项目班组
|
||||
func (c *sysProjectTeamController) Get(ctx context.Context, req *wxApplet.SysProjectTeamGetReq) (res *wxApplet.SysProjectTeamGetRes, err error) {
|
||||
res = new(wxApplet.SysProjectTeamGetRes)
|
||||
res.SysProjectTeamInfoRes, err = service.SysProjectTeam().GetById(ctx, req.Id)
|
||||
return
|
||||
}
|
||||
|
||||
// Add 添加项目班组
|
||||
func (c *sysProjectTeamController) Add(ctx context.Context, req *wxApplet.SysProjectTeamAddReq) (res *wxApplet.SysProjectTeamAddRes, err error) {
|
||||
err = service.SysProjectTeam().Add(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
// Edit 修改项目班组
|
||||
func (c *sysProjectTeamController) Edit(ctx context.Context, req *wxApplet.SysProjectTeamEditReq) (res *wxApplet.SysProjectTeamEditRes, err error) {
|
||||
err = service.SysProjectTeam().Edit(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
// Delete 删除项目班组
|
||||
func (c *sysProjectTeamController) Delete(ctx context.Context, req *wxApplet.SysProjectTeamDeleteReq) (res *wxApplet.SysProjectTeamDeleteRes, err error) {
|
||||
err = service.SysProjectTeam().Delete(ctx, req.Ids)
|
||||
return
|
||||
}
|
||||
54
internal/app/wxApplet/controller/sys_project_team_member.go
Normal file
54
internal/app/wxApplet/controller/sys_project_team_member.go
Normal file
@ -0,0 +1,54 @@
|
||||
// ==========================================================================
|
||||
// GFast自动生成controller操作代码。
|
||||
// 生成日期:2023-08-15 09:34:52
|
||||
// 生成路径: internal/app/wxApplet/controller/sys_project_team_member.go
|
||||
// 生成人:gfast
|
||||
// desc:项目班组下的成员
|
||||
// company:云南奇讯科技有限公司
|
||||
// ==========================================================================
|
||||
|
||||
package controller
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/tiger1103/gfast/v3/api/wxApplet/wxApplet"
|
||||
systemController "github.com/tiger1103/gfast/v3/internal/app/system/controller"
|
||||
"github.com/tiger1103/gfast/v3/internal/app/wxApplet/service"
|
||||
)
|
||||
|
||||
type sysProjectTeamMemberController struct {
|
||||
systemController.BaseController
|
||||
}
|
||||
|
||||
var SysProjectTeamMember = new(sysProjectTeamMemberController)
|
||||
|
||||
// List 列表
|
||||
func (c *sysProjectTeamMemberController) List(ctx context.Context, req *wxApplet.SysProjectTeamMemberSearchReq) (res *wxApplet.SysProjectTeamMemberSearchRes, err error) {
|
||||
res, err = service.SysProjectTeamMember().List(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
// Get 获取项目班组下的成员
|
||||
func (c *sysProjectTeamMemberController) Get(ctx context.Context, req *wxApplet.SysProjectTeamMemberGetReq) (res *wxApplet.SysProjectTeamMemberGetRes, err error) {
|
||||
res = new(wxApplet.SysProjectTeamMemberGetRes)
|
||||
res.SysProjectTeamMemberInfoRes, err = service.SysProjectTeamMember().GetById(ctx, req.Id)
|
||||
return
|
||||
}
|
||||
|
||||
// Add 添加项目班组下的成员
|
||||
func (c *sysProjectTeamMemberController) Add(ctx context.Context, req *wxApplet.SysProjectTeamMemberAddReq) (res *wxApplet.SysProjectTeamMemberAddRes, err error) {
|
||||
err = service.SysProjectTeamMember().Add(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
// Edit 修改项目班组下的成员
|
||||
func (c *sysProjectTeamMemberController) Edit(ctx context.Context, req *wxApplet.SysProjectTeamMemberEditReq) (res *wxApplet.SysProjectTeamMemberEditRes, err error) {
|
||||
err = service.SysProjectTeamMember().Edit(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
// Delete 删除项目班组下的成员
|
||||
func (c *sysProjectTeamMemberController) Delete(ctx context.Context, req *wxApplet.SysProjectTeamMemberDeleteReq) (res *wxApplet.SysProjectTeamMemberDeleteRes, err error) {
|
||||
err = service.SysProjectTeamMember().Delete(ctx, req.Ids)
|
||||
return
|
||||
}
|
||||
67
internal/app/wxApplet/controller/sys_project_team_squad.go
Normal file
67
internal/app/wxApplet/controller/sys_project_team_squad.go
Normal file
@ -0,0 +1,67 @@
|
||||
// ==========================================================================
|
||||
// GFast自动生成controller操作代码。
|
||||
// 生成日期:2023-08-30 15:24:06
|
||||
// 生成路径: internal/app/wxApplet/controller/sys_project_team_squad.go
|
||||
// 生成人:gfast
|
||||
// desc:站班会
|
||||
// company:云南奇讯科技有限公司
|
||||
// ==========================================================================
|
||||
|
||||
package controller
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/tiger1103/gfast/v3/api/wxApplet/wxApplet"
|
||||
systemController "github.com/tiger1103/gfast/v3/internal/app/system/controller"
|
||||
"github.com/tiger1103/gfast/v3/internal/app/wxApplet/dao"
|
||||
"github.com/tiger1103/gfast/v3/internal/app/wxApplet/service"
|
||||
)
|
||||
|
||||
type sysProjectTeamSquadController struct {
|
||||
systemController.BaseController
|
||||
}
|
||||
|
||||
var SysProjectTeamSquad = new(sysProjectTeamSquadController)
|
||||
|
||||
// List 列表
|
||||
func (c *sysProjectTeamSquadController) List(ctx context.Context, req *wxApplet.SysProjectTeamSquadSearchReq) (res *wxApplet.SysProjectTeamSquadSearchRes, err error) {
|
||||
res, err = service.SysProjectTeamSquad().List(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
// Get 获取站班会
|
||||
func (c *sysProjectTeamSquadController) Get(ctx context.Context, req *wxApplet.SysProjectTeamSquadGetReq) (res *wxApplet.SysProjectTeamSquadGetRes, err error) {
|
||||
res = new(wxApplet.SysProjectTeamSquadGetRes)
|
||||
res.SysProjectTeamSquadInfoRes, err = service.SysProjectTeamSquad().GetById(ctx, req.Id)
|
||||
return
|
||||
}
|
||||
|
||||
// Add 添加站班会
|
||||
func (c *sysProjectTeamSquadController) Add(ctx context.Context, req *wxApplet.SysProjectTeamSquadAddReq) (res *wxApplet.SysProjectTeamSquadAddRes, err error) {
|
||||
err = service.SysProjectTeamSquad().Add(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
// Edit 修改站班会
|
||||
func (c *sysProjectTeamSquadController) Edit(ctx context.Context, req *wxApplet.SysProjectTeamSquadEditReq) (res *wxApplet.SysProjectTeamSquadEditRes, err error) {
|
||||
err = service.SysProjectTeamSquad().Edit(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
// Delete 删除站班会
|
||||
func (c *sysProjectTeamSquadController) Delete(ctx context.Context, req *wxApplet.SysProjectTeamSquadDeleteReq) (res *wxApplet.SysProjectTeamSquadDeleteRes, err error) {
|
||||
err = service.SysProjectTeamSquad().Delete(ctx, req.Ids)
|
||||
return
|
||||
}
|
||||
|
||||
func (c *sysProjectTeamSquadController) Count(ctx context.Context, req *wxApplet.SysProjectTeamSquadCountReq) (res *wxApplet.SysProjectTeamSquadCountRes, err error) {
|
||||
count, err := dao.SysProjectTeamSquad.Ctx(ctx).Count()
|
||||
res.Number = count
|
||||
return
|
||||
}
|
||||
|
||||
// List 列表
|
||||
func (c *sysProjectTeamSquadController) SelectByOpenidTeamSquadSearchFunc(ctx context.Context, req *wxApplet.SelectByOpenidTeamSquadSearchReq) (res *wxApplet.SelectByOpenidTeamSquadSearchRes, err error) {
|
||||
res, err = service.SysProjectTeamSquad().SelectByOpenidTeamSquadSearch(ctx, req)
|
||||
return
|
||||
}
|
||||
@ -0,0 +1,54 @@
|
||||
// ==========================================================================
|
||||
// GFast自动生成controller操作代码。
|
||||
// 生成日期:2023-08-21 09:19:15
|
||||
// 生成路径: internal/app/wxApplet/controller/sys_user_project_relevancy.go
|
||||
// 生成人:gfast
|
||||
// desc:系统用户与项目关联
|
||||
// company:云南奇讯科技有限公司
|
||||
// ==========================================================================
|
||||
|
||||
package controller
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/tiger1103/gfast/v3/api/wxApplet/wxApplet"
|
||||
systemController "github.com/tiger1103/gfast/v3/internal/app/system/controller"
|
||||
"github.com/tiger1103/gfast/v3/internal/app/wxApplet/service"
|
||||
)
|
||||
|
||||
type sysUserProjectRelevancyController struct {
|
||||
systemController.BaseController
|
||||
}
|
||||
|
||||
var SysUserProjectRelevancy = new(sysUserProjectRelevancyController)
|
||||
|
||||
// List 列表
|
||||
func (c *sysUserProjectRelevancyController) List(ctx context.Context, req *wxApplet.SysUserProjectRelevancySearchReq) (res *wxApplet.SysUserProjectRelevancySearchRes, err error) {
|
||||
res, err = service.SysUserProjectRelevancy().List(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
// Get 获取系统用户与项目关联
|
||||
func (c *sysUserProjectRelevancyController) Get(ctx context.Context, req *wxApplet.SysUserProjectRelevancyGetReq) (res *wxApplet.SysUserProjectRelevancyGetRes, err error) {
|
||||
res = new(wxApplet.SysUserProjectRelevancyGetRes)
|
||||
res.SysUserProjectRelevancyInfoRes, err = service.SysUserProjectRelevancy().GetById(ctx, req.Id)
|
||||
return
|
||||
}
|
||||
|
||||
// Add 添加系统用户与项目关联
|
||||
func (c *sysUserProjectRelevancyController) Add(ctx context.Context, req *wxApplet.SysUserProjectRelevancyAddReq) (res *wxApplet.SysUserProjectRelevancyAddRes, err error) {
|
||||
err = service.SysUserProjectRelevancy().Add(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
// Edit 修改系统用户与项目关联
|
||||
func (c *sysUserProjectRelevancyController) Edit(ctx context.Context, req *wxApplet.SysUserProjectRelevancyEditReq) (res *wxApplet.SysUserProjectRelevancyEditRes, err error) {
|
||||
err = service.SysUserProjectRelevancy().Edit(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
// Delete 删除系统用户与项目关联
|
||||
func (c *sysUserProjectRelevancyController) Delete(ctx context.Context, req *wxApplet.SysUserProjectRelevancyDeleteReq) (res *wxApplet.SysUserProjectRelevancyDeleteRes, err error) {
|
||||
err = service.SysUserProjectRelevancy().Delete(ctx, req.Ids)
|
||||
return
|
||||
}
|
||||
200
internal/app/wxApplet/controller/wx_login.go
Normal file
200
internal/app/wxApplet/controller/wx_login.go
Normal file
@ -0,0 +1,200 @@
|
||||
package controller
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"github.com/gogf/gf/v2/crypto/gmd5"
|
||||
"github.com/gogf/gf/v2/database/gdb"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/os/gctx"
|
||||
"github.com/gogf/gf/v2/util/grand"
|
||||
"github.com/medivhzhan/weapp/v3"
|
||||
"github.com/medivhzhan/weapp/v3/auth"
|
||||
"github.com/tiger1103/gfast/v3/api/v1/common/coryCommon"
|
||||
"github.com/tiger1103/gfast/v3/api/wxApplet/wxApplet"
|
||||
systemController "github.com/tiger1103/gfast/v3/internal/app/system/controller"
|
||||
"github.com/tiger1103/gfast/v3/internal/app/system/dao"
|
||||
"github.com/tiger1103/gfast/v3/internal/app/system/model/do"
|
||||
"github.com/tiger1103/gfast/v3/internal/app/system/model/entity"
|
||||
se "github.com/tiger1103/gfast/v3/internal/app/system/service"
|
||||
wxDao "github.com/tiger1103/gfast/v3/internal/app/wxApplet/dao"
|
||||
wxModel "github.com/tiger1103/gfast/v3/internal/app/wxApplet/model/do"
|
||||
"github.com/tiger1103/gfast/v3/internal/app/wxApplet/service"
|
||||
"github.com/tiger1103/gfast/v3/library/libUtils"
|
||||
"github.com/tiger1103/gfast/v3/library/liberr"
|
||||
)
|
||||
|
||||
type WXLoginController struct {
|
||||
systemController.BaseController
|
||||
}
|
||||
|
||||
var WXLogin = new(WXLoginController)
|
||||
|
||||
func (e *WXLoginController) BusLogin(ctx context.Context, req *wxApplet.LoginReq) (res *wxApplet.LoginRes, err error) {
|
||||
res = &wxApplet.LoginRes{}
|
||||
err = g.DB().Transaction(ctx, func(ctx context.Context, tx gdb.TX) error {
|
||||
err = g.Try(ctx, func(ctx context.Context) {
|
||||
appId, err := g.Cfg().Get(gctx.New(), "wx.appId")
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
appSecret, err := g.Cfg().Get(gctx.New(), "wx.appSecret")
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
sdk := weapp.NewClient(appId.String(), appSecret.String())
|
||||
cli := sdk.NewAuth()
|
||||
//// 登录凭证校验
|
||||
rsp, err := cli.Code2Session(&auth.Code2SessionRequest{
|
||||
Appid: appId.String(),
|
||||
Secret: appSecret.String(),
|
||||
JsCode: req.Code,
|
||||
GrantType: "authorization_code",
|
||||
})
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
if rsp.ErrCode != 0 {
|
||||
err = rsp.GetResponseError()
|
||||
return
|
||||
}
|
||||
user := wxApplet.BusConstructionUserAddReq{}
|
||||
user.Openid = rsp.Openid
|
||||
res.Openid = user.Openid
|
||||
value, err := dao.BusConstructionUser.Ctx(ctx).Where("openid=?", user.Openid).Fields("head_icon").Value()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
result := 0
|
||||
if value != nil {
|
||||
result = 1
|
||||
}
|
||||
// 上传微信头像
|
||||
str, err := coryCommon.UploadFileTwo(ctx, req.HeadIcon, coryCommon.Helmet)
|
||||
if err != nil {
|
||||
liberr.ErrIsNil(ctx, err)
|
||||
return
|
||||
}
|
||||
replace := strings.Replace(str, "resource/public", "/wxfile", 1)
|
||||
// 删除以前的头像
|
||||
if strings.Contains(value.String(), "/wxfile/") {
|
||||
s := strings.Replace(value.String(), "/wxfile/", coryCommon.GetCWD()+"/resource/public/", 1)
|
||||
os.Remove(filepath.ToSlash(s))
|
||||
}
|
||||
if result == 0 {
|
||||
// user.HeadIcon = req.HeadIcon
|
||||
//user.NickName = req.NickName
|
||||
//user.HeadIcon = replace
|
||||
_, err := service.BusConstructionUser().Add(ctx, &user)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
} else {
|
||||
_, err = dao.BusConstructionUser.Ctx(ctx).Data(g.Map{
|
||||
//"head_icon": req.HeadIcon,
|
||||
"nick_name": req.NickName,
|
||||
"head_icon": replace,
|
||||
}).Where("openid=?", user.Openid).Update()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
res.Token = gettoken(ctx, user.Openid, user)
|
||||
return
|
||||
})
|
||||
return err
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
//func gettoken(ctx context.Context, openid string, user wxApplet.BusConstructionUserAddReq) string {
|
||||
// key := gmd5.MustEncryptString(openid)
|
||||
// token, err := se.GfToken().GenerateToken(ctx, key+key, user)
|
||||
// fmt.Println("创建的token", token)
|
||||
// fmt.Println(err)
|
||||
// token = "Bearer " + token
|
||||
// fmt.Println("更改的-----", token)
|
||||
// return token
|
||||
//}
|
||||
|
||||
func gettoken(ctx context.Context, openid string, user wxApplet.BusConstructionUserAddReq) string {
|
||||
encryptedKey := gmd5.MustEncryptString(openid)
|
||||
|
||||
key := openid + "-" + encryptedKey
|
||||
authToken, _ := se.GfToken().GenerateToken(ctx, key, user)
|
||||
|
||||
return "Bearer " + authToken
|
||||
}
|
||||
|
||||
// IsBindApp 是否绑定 App
|
||||
func (e *WXLoginController) IsBindApp(ctx context.Context, req *wxApplet.IsBindAppReq) (*wxApplet.IsBindAppRes, error) {
|
||||
exist, err := dao.BusConstructionUser.Ctx(ctx).As("bcu").
|
||||
InnerJoin("sys_user AS su", `bcu.user_name COLLATE utf8mb4_general_ci = su.user_name COLLATE utf8mb4_general_ci
|
||||
AND bcu.phone COLLATE utf8mb4_general_ci = su.mobile COLLATE utf8mb4_general_ci`).
|
||||
Where("bcu.openid", req.Openid).
|
||||
Count()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// 如果已绑定 App 则返回 1,否则返回 0
|
||||
if exist > 0 {
|
||||
return &wxApplet.IsBindAppRes{IsBind: 1}, nil
|
||||
}
|
||||
|
||||
return &wxApplet.IsBindAppRes{IsBind: 0}, nil
|
||||
}
|
||||
|
||||
// AppletBindApp 小程序绑定 App
|
||||
func (e *WXLoginController) AppletBindApp(ctx context.Context, req *wxApplet.AppletBindAppReq) (*wxApplet.AppletBindAppRes, error) {
|
||||
// 获取小程序用户信息
|
||||
busConstructUser := entity.BusConstructionUser{}
|
||||
if err := dao.BusConstructionUser.Ctx(ctx).Where(dao.BusConstructionUser.Columns().Openid, req.Openid).Scan(&busConstructUser); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// 判断当前用户的手机号和用户名是否为空
|
||||
if busConstructUser.Phone == "" || busConstructUser.UserName == "" {
|
||||
return nil, fmt.Errorf("当前用户的手机号和用户名为空")
|
||||
}
|
||||
|
||||
exist, err := dao.SysUser.Ctx(ctx).Where(dao.SysUser.Columns().UserNickname, busConstructUser.UserName).
|
||||
Where(dao.SysUser.Columns().Mobile, busConstructUser.Phone).Count()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// 判断是否已绑定 App
|
||||
if exist > 0 {
|
||||
return nil, fmt.Errorf("当前用户已经绑定了 App")
|
||||
}
|
||||
|
||||
passwordSalt := grand.S(10) // 密码盐值
|
||||
encryptedPassword := libUtils.EncryptPassword(req.Password, passwordSalt) // 加密密码
|
||||
|
||||
err = g.Try(ctx, func(ctx context.Context) {
|
||||
// 创建用户
|
||||
userId, err := dao.SysUser.Ctx(ctx).InsertAndGetId(do.SysUser{
|
||||
UserName: busConstructUser.UserName, // 用户名
|
||||
UserNickname: busConstructUser.NickName, // 用户昵称
|
||||
Mobile: busConstructUser.Phone, // 手机号
|
||||
UserPassword: encryptedPassword, // 密码
|
||||
UserSalt: passwordSalt, // 密码盐
|
||||
Sex: busConstructUser.Sex, // 性别
|
||||
})
|
||||
liberr.ErrIsNil(ctx, err, "创建用户失败")
|
||||
|
||||
// 关联后台项目
|
||||
_, err = wxDao.SysUserProjectRelevancy.Ctx(ctx).Insert(wxModel.SysUserProjectRelevancy{
|
||||
UserId: userId, // 用户 ID
|
||||
ProjectId: busConstructUser.ProjectId, // 项目 ID
|
||||
})
|
||||
liberr.ErrIsNil(ctx, err, "关联后台管理项目失败")
|
||||
})
|
||||
|
||||
return nil, nil
|
||||
}
|
||||
29
internal/app/wxApplet/dao/bus_askforleave.go
Normal file
29
internal/app/wxApplet/dao/bus_askforleave.go
Normal file
@ -0,0 +1,29 @@
|
||||
// ==========================================================================
|
||||
// GFast自动生成dao操作代码。
|
||||
// 生成日期:2025-03-27 14:14:25
|
||||
// 生成路径: internal/app/wxApplet/dao/bus_askforleave.go
|
||||
// 生成人:gfast
|
||||
// desc:请假
|
||||
// company:云南奇讯科技有限公司
|
||||
// ==========================================================================
|
||||
|
||||
package dao
|
||||
|
||||
import (
|
||||
"github.com/tiger1103/gfast/v3/internal/app/wxApplet/dao/internal"
|
||||
)
|
||||
|
||||
// busAskforleaveDao is the manager for logic model data accessing and custom defined data operations functions management.
|
||||
// You can define custom methods on it to extend its functionality as you wish.
|
||||
type busAskforleaveDao struct {
|
||||
*internal.BusAskforleaveDao
|
||||
}
|
||||
|
||||
var (
|
||||
// BusAskforleave is globally public accessible object for table tools_gen_table operations.
|
||||
BusAskforleave = busAskforleaveDao{
|
||||
internal.NewBusAskforleaveDao(),
|
||||
}
|
||||
)
|
||||
|
||||
// Fill with you ideas below.
|
||||
29
internal/app/wxApplet/dao/bus_attendance.go
Normal file
29
internal/app/wxApplet/dao/bus_attendance.go
Normal file
@ -0,0 +1,29 @@
|
||||
// ==========================================================================
|
||||
// GFast自动生成dao操作代码。
|
||||
// 生成日期:2023-08-07 16:29:52
|
||||
// 生成路径: internal/app/wxApplet/dao/bus_attendance.go
|
||||
// 生成人:gfast
|
||||
// desc:考勤
|
||||
// company:云南奇讯科技有限公司
|
||||
// ==========================================================================
|
||||
|
||||
package dao
|
||||
|
||||
import (
|
||||
"github.com/tiger1103/gfast/v3/internal/app/wxApplet/dao/internal"
|
||||
)
|
||||
|
||||
// busAttendanceDao is the manager for logic model data accessing and custom defined data operations functions management.
|
||||
// You can define custom methods on it to extend its functionality as you wish.
|
||||
type busAttendanceDao struct {
|
||||
*internal.BusAttendanceDao
|
||||
}
|
||||
|
||||
var (
|
||||
// BusAttendance is globally public accessible object for table tools_gen_table operations.
|
||||
BusAttendance = busAttendanceDao{
|
||||
internal.NewBusAttendanceDao(),
|
||||
}
|
||||
)
|
||||
|
||||
// Fill with you ideas below.
|
||||
29
internal/app/wxApplet/dao/bus_construction_project.go
Normal file
29
internal/app/wxApplet/dao/bus_construction_project.go
Normal file
@ -0,0 +1,29 @@
|
||||
// ==========================================================================
|
||||
// GFast自动生成dao操作代码。
|
||||
// 生成日期:2023-08-07 11:17:50
|
||||
// 生成路径: internal/app/wxApplet/dao/bus_construction_project.go
|
||||
// 生成人:gfast
|
||||
// desc:施工人员对应项目
|
||||
// company:云南奇讯科技有限公司
|
||||
// ==========================================================================
|
||||
|
||||
package dao
|
||||
|
||||
import (
|
||||
"github.com/tiger1103/gfast/v3/internal/app/wxApplet/dao/internal"
|
||||
)
|
||||
|
||||
// busConstructionProjectDao is the manager for logic model data accessing and custom defined data operations functions management.
|
||||
// You can define custom methods on it to extend its functionality as you wish.
|
||||
type busConstructionProjectDao struct {
|
||||
*internal.BusConstructionProjectDao
|
||||
}
|
||||
|
||||
var (
|
||||
// BusConstructionProject is globally public accessible object for table tools_gen_table operations.
|
||||
BusConstructionProject = busConstructionProjectDao{
|
||||
internal.NewBusConstructionProjectDao(),
|
||||
}
|
||||
)
|
||||
|
||||
// Fill with you ideas below.
|
||||
29
internal/app/wxApplet/dao/bus_construction_user.go
Normal file
29
internal/app/wxApplet/dao/bus_construction_user.go
Normal file
@ -0,0 +1,29 @@
|
||||
// ==========================================================================
|
||||
// GFast自动生成dao操作代码。
|
||||
// 生成日期:2023-08-07 11:17:50
|
||||
// 生成路径: internal/app/wxApplet/dao/bus_construction_user.go
|
||||
// 生成人:gfast
|
||||
// desc:施工人员
|
||||
// company:云南奇讯科技有限公司
|
||||
// ==========================================================================
|
||||
|
||||
package dao
|
||||
|
||||
import (
|
||||
"github.com/tiger1103/gfast/v3/internal/app/wxApplet/dao/internal"
|
||||
)
|
||||
|
||||
// busConstructionUserDao is the manager for logic model data accessing and custom defined data operations functions management.
|
||||
// You can define custom methods on it to extend its functionality as you wish.
|
||||
type busConstructionUserDao struct {
|
||||
*internal.BusConstructionUserDao
|
||||
}
|
||||
|
||||
var (
|
||||
// BusConstructionUser is globally public accessible object for table tools_gen_table operations.
|
||||
BusConstructionUser = busConstructionUserDao{
|
||||
internal.NewBusConstructionUserDao(),
|
||||
}
|
||||
)
|
||||
|
||||
// Fill with you ideas below.
|
||||
29
internal/app/wxApplet/dao/bus_construction_user_file.go
Normal file
29
internal/app/wxApplet/dao/bus_construction_user_file.go
Normal file
@ -0,0 +1,29 @@
|
||||
// ==========================================================================
|
||||
// GFast自动生成dao操作代码。
|
||||
// 生成日期:2023-08-07 11:17:55
|
||||
// 生成路径: internal/app/wxApplet/dao/bus_construction_user_file.go
|
||||
// 生成人:gfast
|
||||
// desc:微信用户的文件存储
|
||||
// company:云南奇讯科技有限公司
|
||||
// ==========================================================================
|
||||
|
||||
package dao
|
||||
|
||||
import (
|
||||
"github.com/tiger1103/gfast/v3/internal/app/wxApplet/dao/internal"
|
||||
)
|
||||
|
||||
// busConstructionUserFileDao is the manager for logic model data accessing and custom defined data operations functions management.
|
||||
// You can define custom methods on it to extend its functionality as you wish.
|
||||
type busConstructionUserFileDao struct {
|
||||
*internal.BusConstructionUserFileDao
|
||||
}
|
||||
|
||||
var (
|
||||
// BusConstructionUserFile is globally public accessible object for table tools_gen_table operations.
|
||||
BusConstructionUserFile = busConstructionUserFileDao{
|
||||
internal.NewBusConstructionUserFileDao(),
|
||||
}
|
||||
)
|
||||
|
||||
// Fill with you ideas below.
|
||||
29
internal/app/wxApplet/dao/bus_construction_user_post.go
Normal file
29
internal/app/wxApplet/dao/bus_construction_user_post.go
Normal file
@ -0,0 +1,29 @@
|
||||
// ==========================================================================
|
||||
// GFast自动生成dao操作代码。
|
||||
// 生成日期:2023-08-07 11:17:55
|
||||
// 生成路径: internal/app/wxApplet/dao/bus_construction_user_post.go
|
||||
// 生成人:gfast
|
||||
// desc:施工人员岗位
|
||||
// company:云南奇讯科技有限公司
|
||||
// ==========================================================================
|
||||
|
||||
package dao
|
||||
|
||||
import (
|
||||
"github.com/tiger1103/gfast/v3/internal/app/wxApplet/dao/internal"
|
||||
)
|
||||
|
||||
// busConstructionUserPostDao is the manager for logic model data accessing and custom defined data operations functions management.
|
||||
// You can define custom methods on it to extend its functionality as you wish.
|
||||
type busConstructionUserPostDao struct {
|
||||
*internal.BusConstructionUserPostDao
|
||||
}
|
||||
|
||||
var (
|
||||
// BusConstructionUserPost is globally public accessible object for table tools_gen_table operations.
|
||||
BusConstructionUserPost = busConstructionUserPostDao{
|
||||
internal.NewBusConstructionUserPostDao(),
|
||||
}
|
||||
)
|
||||
|
||||
// Fill with you ideas below.
|
||||
29
internal/app/wxApplet/dao/bus_labourservice.go
Normal file
29
internal/app/wxApplet/dao/bus_labourservice.go
Normal file
@ -0,0 +1,29 @@
|
||||
// ==========================================================================
|
||||
// GFast自动生成dao操作代码。
|
||||
// 生成日期:2023-08-14 11:24:31
|
||||
// 生成路径: internal/app/wxApplet/dao/bus_labourservice.go
|
||||
// 生成人:gfast
|
||||
// desc:劳务公司
|
||||
// company:云南奇讯科技有限公司
|
||||
// ==========================================================================
|
||||
|
||||
package dao
|
||||
|
||||
import (
|
||||
"github.com/tiger1103/gfast/v3/internal/app/wxApplet/dao/internal"
|
||||
)
|
||||
|
||||
// busLabourserviceDao is the manager for logic model data accessing and custom defined data operations functions management.
|
||||
// You can define custom methods on it to extend its functionality as you wish.
|
||||
type busLabourserviceDao struct {
|
||||
*internal.BusLabourserviceDao
|
||||
}
|
||||
|
||||
var (
|
||||
// BusLabourservice is globally public accessible object for table tools_gen_table operations.
|
||||
BusLabourservice = busLabourserviceDao{
|
||||
internal.NewBusLabourserviceDao(),
|
||||
}
|
||||
)
|
||||
|
||||
// Fill with you ideas below.
|
||||
120
internal/app/wxApplet/dao/internal/bus_askforleave.go
Normal file
120
internal/app/wxApplet/dao/internal/bus_askforleave.go
Normal file
@ -0,0 +1,120 @@
|
||||
// ==========================================================================
|
||||
// GFast自动生成dao internal操作代码。
|
||||
// 生成日期:2025-03-27 14:14:25
|
||||
// 生成路径: internal/app/wxApplet/dao/internal/bus_askforleave.go
|
||||
// 生成人:gfast
|
||||
// desc:请假
|
||||
// company:云南奇讯科技有限公司
|
||||
// ==========================================================================
|
||||
|
||||
package internal
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/database/gdb"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// BusAskforleaveDao is the manager for logic model data accessing and custom defined data operations functions management.
|
||||
type BusAskforleaveDao struct {
|
||||
table string // Table is the underlying table name of the DAO.
|
||||
group string // Group is the database configuration group name of current DAO.
|
||||
columns BusAskforleaveColumns // Columns is the short type for Columns, which contains all the column names of Table for convenient usage.
|
||||
}
|
||||
|
||||
// BusAskforleaveColumns defines and stores column names for table bus_askforleave.
|
||||
type BusAskforleaveColumns struct {
|
||||
Id string // 主键ID
|
||||
ProjectId string // 项目ID
|
||||
ProjectName string // 项目名称
|
||||
TeamId string // 班组ID
|
||||
TeamName string // 班组名称
|
||||
StartTime string // 开始时间
|
||||
EndTime string // 结束时间
|
||||
Argument string // 请假理由
|
||||
Ganger string // 班组长
|
||||
GangerOpinion string // 班组长意见(1未读 2同意 3拒绝)
|
||||
GangerExplain string // 拒绝理由
|
||||
GangerTime string // 班组长操作时间
|
||||
Manager string // 管理员
|
||||
ManagerOpinion string // 管理员意见(1未读 2同意 3拒绝)
|
||||
ManagerExplain string // 拒绝理由
|
||||
ManagerTime string // 管理员操作时间
|
||||
CreateBy string // 创建人
|
||||
UpdateBy string // 更新人
|
||||
CreatedAt string // 创建时间
|
||||
UpdatedAt string // 更新时间
|
||||
DeletedAt string // 删除时间
|
||||
Remark string // 备注
|
||||
Openid string // 备注
|
||||
}
|
||||
|
||||
var busAskforleaveColumns = BusAskforleaveColumns{
|
||||
Id: "id",
|
||||
ProjectId: "project_id",
|
||||
ProjectName: "project_name",
|
||||
TeamId: "team_id",
|
||||
TeamName: "team_name",
|
||||
StartTime: "start time",
|
||||
EndTime: "end_time",
|
||||
Argument: "argument",
|
||||
Ganger: "ganger",
|
||||
GangerOpinion: "ganger_opinion",
|
||||
GangerExplain: "ganger_explain",
|
||||
GangerTime: "ganger_time",
|
||||
Manager: "manager",
|
||||
ManagerOpinion: "manager_opinion",
|
||||
ManagerExplain: "manager_explain",
|
||||
ManagerTime: "manager_time",
|
||||
CreateBy: "create_by",
|
||||
UpdateBy: "update_by",
|
||||
CreatedAt: "created_at",
|
||||
UpdatedAt: "updated_at",
|
||||
DeletedAt: "deleted_at",
|
||||
Remark: "remark",
|
||||
Openid: "openid",
|
||||
}
|
||||
|
||||
// NewBusAskforleaveDao creates and returns a new DAO object for table data access.
|
||||
func NewBusAskforleaveDao() *BusAskforleaveDao {
|
||||
return &BusAskforleaveDao{
|
||||
group: "default",
|
||||
table: "bus_askforleave",
|
||||
columns: busAskforleaveColumns,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
func (dao *BusAskforleaveDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
func (dao *BusAskforleaveDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
func (dao *BusAskforleaveDao) Columns() BusAskforleaveColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
func (dao *BusAskforleaveDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
func (dao *BusAskforleaveDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// as it is automatically handled by this function.
|
||||
func (dao *BusAskforleaveDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
}
|
||||
110
internal/app/wxApplet/dao/internal/bus_attendance.go
Normal file
110
internal/app/wxApplet/dao/internal/bus_attendance.go
Normal file
@ -0,0 +1,110 @@
|
||||
// ==========================================================================
|
||||
// GFast自动生成dao internal操作代码。
|
||||
// 生成日期:2023-08-07 16:29:52
|
||||
// 生成路径: internal/app/wxApplet/dao/internal/bus_attendance.go
|
||||
// 生成人:gfast
|
||||
// desc:考勤
|
||||
// company:云南奇讯科技有限公司
|
||||
// ==========================================================================
|
||||
|
||||
package internal
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/database/gdb"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// BusAttendanceDao is the manager for logic model data accessing and custom defined data operations functions management.
|
||||
type BusAttendanceDao struct {
|
||||
table string // Table is the underlying table name of the DAO.
|
||||
group string // Group is the database configuration group name of current DAO.
|
||||
columns BusAttendanceColumns // Columns is the short type for Columns, which contains all the column names of Table for convenient usage.
|
||||
}
|
||||
|
||||
// BusAttendanceColumns defines and stores column names for table bus_attendance.
|
||||
type BusAttendanceColumns struct {
|
||||
Id string // 序号
|
||||
UserName string // 人员姓名
|
||||
PacePhoto string // 人脸照
|
||||
ProjectId string // 项目id
|
||||
CreateBy string // 创建者
|
||||
UpdateBy string // 更新者
|
||||
CreatedAt string // 创建时间
|
||||
UpdatedAt string // 更新时间
|
||||
DeletedAt string // 删除时间
|
||||
ClockOn string // 上午打卡
|
||||
ClockOff string // 下午打卡
|
||||
PrintingDate string // 年月日打卡时间
|
||||
IsPinch string // 打卡状态
|
||||
Openid string // 微信id
|
||||
PinchOpenId string // 代打id
|
||||
ClockRecord string // 多次打卡时间记录
|
||||
PinchUserName string // 代打人姓名
|
||||
Commuter string // 上下班(1上班2下班)
|
||||
}
|
||||
|
||||
var busAttendanceColumns = BusAttendanceColumns{
|
||||
Id: "id",
|
||||
UserName: "user_name",
|
||||
PacePhoto: "pace_photo",
|
||||
ProjectId: "project_id",
|
||||
CreateBy: "create_by",
|
||||
UpdateBy: "update_by",
|
||||
CreatedAt: "created_at",
|
||||
UpdatedAt: "updated_at",
|
||||
DeletedAt: "deleted_at",
|
||||
ClockOn: "clock_on",
|
||||
ClockOff: "clock_off",
|
||||
PrintingDate: "printing_date",
|
||||
IsPinch: "is_pinch",
|
||||
Openid: "openid",
|
||||
PinchOpenId: "pinch_openId",
|
||||
ClockRecord: "clock_record",
|
||||
PinchUserName: "pinch_user_name",
|
||||
Commuter: "commuter",
|
||||
}
|
||||
|
||||
// NewBusAttendanceDao creates and returns a new DAO object for table data access.
|
||||
func NewBusAttendanceDao() *BusAttendanceDao {
|
||||
return &BusAttendanceDao{
|
||||
group: "default",
|
||||
table: "bus_attendance",
|
||||
columns: busAttendanceColumns,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
func (dao *BusAttendanceDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
func (dao *BusAttendanceDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
func (dao *BusAttendanceDao) Columns() BusAttendanceColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
func (dao *BusAttendanceDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
func (dao *BusAttendanceDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// as it is automatically handled by this function.
|
||||
func (dao *BusAttendanceDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
}
|
||||
@ -0,0 +1,80 @@
|
||||
// ==========================================================================
|
||||
// GFast自动生成dao internal操作代码。
|
||||
// 生成日期:2023-08-07 11:17:50
|
||||
// 生成路径: internal/app/wxApplet/dao/internal/bus_construction_project.go
|
||||
// 生成人:gfast
|
||||
// desc:施工人员对应项目
|
||||
// company:云南奇讯科技有限公司
|
||||
// ==========================================================================
|
||||
|
||||
package internal
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/database/gdb"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// BusConstructionProjectDao is the manager for logic model data accessing and custom defined data operations functions management.
|
||||
type BusConstructionProjectDao struct {
|
||||
table string // Table is the underlying table name of the DAO.
|
||||
group string // Group is the database configuration group name of current DAO.
|
||||
columns BusConstructionProjectColumns // Columns is the short type for Columns, which contains all the column names of Table for convenient usage.
|
||||
}
|
||||
|
||||
// BusConstructionProjectColumns defines and stores column names for table bus_construction_project.
|
||||
type BusConstructionProjectColumns struct {
|
||||
Id string // 序号
|
||||
ConstructionUserId string // 微信用户id
|
||||
ProjectId string // 项目id
|
||||
}
|
||||
|
||||
var busConstructionProjectColumns = BusConstructionProjectColumns{
|
||||
Id: "id",
|
||||
ConstructionUserId: "construction_user_id",
|
||||
ProjectId: "project_id",
|
||||
}
|
||||
|
||||
// NewBusConstructionProjectDao creates and returns a new DAO object for table data access.
|
||||
func NewBusConstructionProjectDao() *BusConstructionProjectDao {
|
||||
return &BusConstructionProjectDao{
|
||||
group: "default",
|
||||
table: "bus_construction_project",
|
||||
columns: busConstructionProjectColumns,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
func (dao *BusConstructionProjectDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
func (dao *BusConstructionProjectDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
func (dao *BusConstructionProjectDao) Columns() BusConstructionProjectColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
func (dao *BusConstructionProjectDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
func (dao *BusConstructionProjectDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// as it is automatically handled by this function.
|
||||
func (dao *BusConstructionProjectDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
}
|
||||
133
internal/app/wxApplet/dao/internal/bus_construction_user.go
Normal file
133
internal/app/wxApplet/dao/internal/bus_construction_user.go
Normal file
@ -0,0 +1,133 @@
|
||||
// ==========================================================================
|
||||
// GFast自动生成dao internal操作代码。
|
||||
// 生成日期:2023-08-07 11:17:50
|
||||
// 生成路径: internal/app/wxApplet/dao/internal/bus_construction_user.go
|
||||
// 生成人:gfast
|
||||
// desc:施工人员
|
||||
// company:云南奇讯科技有限公司
|
||||
// ==========================================================================
|
||||
|
||||
package internal
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/database/gdb"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// BusConstructionUserDao is the manager for logic model data accessing and custom defined data operations functions management.
|
||||
type BusConstructionUserDao struct {
|
||||
table string // Table is the underlying table name of the DAO.
|
||||
group string // Group is the database configuration group name of current DAO.
|
||||
columns BusConstructionUserColumns // Columns is the short type for Columns, which contains all the column names of Table for convenient usage.
|
||||
}
|
||||
|
||||
// BusConstructionUserColumns defines and stores column names for table bus_construction_user.
|
||||
type BusConstructionUserColumns struct {
|
||||
Id string // 序号
|
||||
Openid string // 微信id
|
||||
NickName string // 微信名称
|
||||
TeamId string // 班组id
|
||||
HeadIcon string // 登陆照片
|
||||
PacePhoto string // 人脸照
|
||||
UserName string // 人员姓名
|
||||
ProjectId string // 项目id
|
||||
Status string // 状态
|
||||
WxOrPc string // 状态
|
||||
IsPinch string // 是否代打
|
||||
IfManagement string // 是否班组管理
|
||||
CreateBy string // 创建者
|
||||
UpdateBy string // 更新者
|
||||
CreatedAt string // 创建时间
|
||||
UpdatedAt string // 更新时间
|
||||
DeletedAt string // 删除时间
|
||||
Phone string // 电话
|
||||
Sex string // 性别
|
||||
SfzNation string // 身份证民族
|
||||
SfzNumber string // 身份证号码
|
||||
SfzStart string // 身份证有效开始期
|
||||
SfzEnd string // 身份证有效结束期
|
||||
SfzSite string // 身份证地址
|
||||
NativePlace string // 籍贯
|
||||
YhkNumber string // 银行卡号
|
||||
YhkOpeningBank string // 开户行
|
||||
YhkCardholder string // 持卡人
|
||||
TypeOfWork string // 持卡人
|
||||
LabourserviceId string // 劳务公司ID
|
||||
}
|
||||
|
||||
var busConstructionUserColumns = BusConstructionUserColumns{
|
||||
Id: "id",
|
||||
Openid: "openid",
|
||||
NickName: "nick_name",
|
||||
TeamId: "team_id",
|
||||
HeadIcon: "head_icon",
|
||||
PacePhoto: "pace_photo",
|
||||
UserName: "user_name",
|
||||
ProjectId: "project_id",
|
||||
Status: "status",
|
||||
IsPinch: "is_pinch",
|
||||
IfManagement: "if_management",
|
||||
CreateBy: "create_by",
|
||||
UpdateBy: "update_by",
|
||||
CreatedAt: "created_at",
|
||||
UpdatedAt: "updated_at",
|
||||
DeletedAt: "deleted_at",
|
||||
Phone: "phone",
|
||||
Sex: "sex",
|
||||
SfzNation: "sfz_nation",
|
||||
SfzNumber: "sfz_number",
|
||||
SfzStart: "sfz_start",
|
||||
SfzEnd: "sfz_end",
|
||||
SfzSite: "sfz_site",
|
||||
NativePlace: "native_place",
|
||||
YhkNumber: "yhk_number",
|
||||
YhkOpeningBank: "yhk_opening_bank",
|
||||
YhkCardholder: "yhk_cardholder",
|
||||
TypeOfWork: "type_of_work",
|
||||
LabourserviceId: "labourservice_id",
|
||||
}
|
||||
|
||||
// NewBusConstructionUserDao creates and returns a new DAO object for table data access.
|
||||
func NewBusConstructionUserDao() *BusConstructionUserDao {
|
||||
return &BusConstructionUserDao{
|
||||
group: "default",
|
||||
table: "bus_construction_user",
|
||||
columns: busConstructionUserColumns,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
func (dao *BusConstructionUserDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
func (dao *BusConstructionUserDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
func (dao *BusConstructionUserDao) Columns() BusConstructionUserColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
func (dao *BusConstructionUserDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
func (dao *BusConstructionUserDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// as it is automatically handled by this function.
|
||||
func (dao *BusConstructionUserDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
}
|
||||
@ -0,0 +1,94 @@
|
||||
// ==========================================================================
|
||||
// GFast自动生成dao internal操作代码。
|
||||
// 生成日期:2023-08-07 11:17:55
|
||||
// 生成路径: internal/app/wxApplet/dao/internal/bus_construction_user_file.go
|
||||
// 生成人:gfast
|
||||
// desc:微信用户的文件存储
|
||||
// company:云南奇讯科技有限公司
|
||||
// ==========================================================================
|
||||
|
||||
package internal
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/database/gdb"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// BusConstructionUserFileDao is the manager for logic model data accessing and custom defined data operations functions management.
|
||||
type BusConstructionUserFileDao struct {
|
||||
table string // Table is the underlying table name of the DAO.
|
||||
group string // Group is the database configuration group name of current DAO.
|
||||
columns BusConstructionUserFileColumns // Columns is the short type for Columns, which contains all the column names of Table for convenient usage.
|
||||
}
|
||||
|
||||
// BusConstructionUserFileColumns defines and stores column names for table bus_construction_user_file.
|
||||
type BusConstructionUserFileColumns struct {
|
||||
Id string // 主键ID
|
||||
UserId string // 用户id
|
||||
UserImgType string // 图片类型
|
||||
Path string // 图片路径
|
||||
CreateBy string // 创建者
|
||||
UpdateBy string // 更新者
|
||||
CreatedAt string // 创建时间
|
||||
UpdatedAt string // 更新时间
|
||||
DeletedAt string // 删除时间
|
||||
Remark string // 备注
|
||||
}
|
||||
|
||||
var busConstructionUserFileColumns = BusConstructionUserFileColumns{
|
||||
Id: "id",
|
||||
UserId: "user_id",
|
||||
UserImgType: "user_img_type",
|
||||
Path: "path",
|
||||
CreateBy: "create_by",
|
||||
UpdateBy: "update_by",
|
||||
CreatedAt: "created_at",
|
||||
UpdatedAt: "updated_at",
|
||||
DeletedAt: "deleted_at",
|
||||
Remark: "remark",
|
||||
}
|
||||
|
||||
// NewBusConstructionUserFileDao creates and returns a new DAO object for table data access.
|
||||
func NewBusConstructionUserFileDao() *BusConstructionUserFileDao {
|
||||
return &BusConstructionUserFileDao{
|
||||
group: "default",
|
||||
table: "bus_construction_user_file",
|
||||
columns: busConstructionUserFileColumns,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
func (dao *BusConstructionUserFileDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
func (dao *BusConstructionUserFileDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
func (dao *BusConstructionUserFileDao) Columns() BusConstructionUserFileColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
func (dao *BusConstructionUserFileDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
func (dao *BusConstructionUserFileDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// as it is automatically handled by this function.
|
||||
func (dao *BusConstructionUserFileDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
}
|
||||
@ -0,0 +1,80 @@
|
||||
// ==========================================================================
|
||||
// GFast自动生成dao internal操作代码。
|
||||
// 生成日期:2023-08-07 11:17:55
|
||||
// 生成路径: internal/app/wxApplet/dao/internal/bus_construction_user_post.go
|
||||
// 生成人:gfast
|
||||
// desc:施工人员岗位
|
||||
// company:云南奇讯科技有限公司
|
||||
// ==========================================================================
|
||||
|
||||
package internal
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/database/gdb"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// BusConstructionUserPostDao is the manager for logic model data accessing and custom defined data operations functions management.
|
||||
type BusConstructionUserPostDao struct {
|
||||
table string // Table is the underlying table name of the DAO.
|
||||
group string // Group is the database configuration group name of current DAO.
|
||||
columns BusConstructionUserPostColumns // Columns is the short type for Columns, which contains all the column names of Table for convenient usage.
|
||||
}
|
||||
|
||||
// BusConstructionUserPostColumns defines and stores column names for table bus_construction_user_post.
|
||||
type BusConstructionUserPostColumns struct {
|
||||
Id string // 序号
|
||||
ConstructionUserId string // 施工人员id
|
||||
PostId string // 岗位id
|
||||
}
|
||||
|
||||
var busConstructionUserPostColumns = BusConstructionUserPostColumns{
|
||||
Id: "id",
|
||||
ConstructionUserId: "construction_user_id",
|
||||
PostId: "post_id",
|
||||
}
|
||||
|
||||
// NewBusConstructionUserPostDao creates and returns a new DAO object for table data access.
|
||||
func NewBusConstructionUserPostDao() *BusConstructionUserPostDao {
|
||||
return &BusConstructionUserPostDao{
|
||||
group: "default",
|
||||
table: "bus_construction_user_post",
|
||||
columns: busConstructionUserPostColumns,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
func (dao *BusConstructionUserPostDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
func (dao *BusConstructionUserPostDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
func (dao *BusConstructionUserPostDao) Columns() BusConstructionUserPostColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
func (dao *BusConstructionUserPostDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
func (dao *BusConstructionUserPostDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// as it is automatically handled by this function.
|
||||
func (dao *BusConstructionUserPostDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
}
|
||||
94
internal/app/wxApplet/dao/internal/bus_labourservice.go
Normal file
94
internal/app/wxApplet/dao/internal/bus_labourservice.go
Normal file
@ -0,0 +1,94 @@
|
||||
// ==========================================================================
|
||||
// GFast自动生成dao internal操作代码。
|
||||
// 生成日期:2023-08-14 11:24:31
|
||||
// 生成路径: internal/app/wxApplet/dao/internal/bus_labourservice.go
|
||||
// 生成人:gfast
|
||||
// desc:劳务公司
|
||||
// company:云南奇讯科技有限公司
|
||||
// ==========================================================================
|
||||
|
||||
package internal
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/database/gdb"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// BusLabourserviceDao is the manager for logic model data accessing and custom defined data operations functions management.
|
||||
type BusLabourserviceDao struct {
|
||||
table string // Table is the underlying table name of the DAO.
|
||||
group string // Group is the database configuration group name of current DAO.
|
||||
columns BusLabourserviceColumns // Columns is the short type for Columns, which contains all the column names of Table for convenient usage.
|
||||
}
|
||||
|
||||
// BusLabourserviceColumns defines and stores column names for table bus_labourservice.
|
||||
type BusLabourserviceColumns struct {
|
||||
Id string // 主键ID
|
||||
Name string // 劳务公司
|
||||
Principal string // 负责人
|
||||
Phone string // 联系电话
|
||||
CreateBy string // 创建人
|
||||
UpdateBy string // 更新人
|
||||
CreatedAt string // 创建时间
|
||||
UpdatedAt string // 更新时间
|
||||
DeletedAt string // 删除时间
|
||||
Remark string // 备注
|
||||
}
|
||||
|
||||
var busLabourserviceColumns = BusLabourserviceColumns{
|
||||
Id: "id",
|
||||
Name: "name",
|
||||
Principal: "principal",
|
||||
Phone: "phone",
|
||||
CreateBy: "create_by",
|
||||
UpdateBy: "update_by",
|
||||
CreatedAt: "created_at",
|
||||
UpdatedAt: "updated_at",
|
||||
DeletedAt: "deleted_at",
|
||||
Remark: "remark",
|
||||
}
|
||||
|
||||
// NewBusLabourserviceDao creates and returns a new DAO object for table data access.
|
||||
func NewBusLabourserviceDao() *BusLabourserviceDao {
|
||||
return &BusLabourserviceDao{
|
||||
group: "default",
|
||||
table: "bus_labourservice",
|
||||
columns: busLabourserviceColumns,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
func (dao *BusLabourserviceDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
func (dao *BusLabourserviceDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
func (dao *BusLabourserviceDao) Columns() BusLabourserviceColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
func (dao *BusLabourserviceDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
func (dao *BusLabourserviceDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// as it is automatically handled by this function.
|
||||
func (dao *BusLabourserviceDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
}
|
||||
90
internal/app/wxApplet/dao/internal/sys_project_team.go
Normal file
90
internal/app/wxApplet/dao/internal/sys_project_team.go
Normal file
@ -0,0 +1,90 @@
|
||||
// ==========================================================================
|
||||
// GFast自动生成dao internal操作代码。
|
||||
// 生成日期:2023-08-15 09:34:52
|
||||
// 生成路径: internal/app/wxApplet/dao/internal/sys_project_team.go
|
||||
// 生成人:gfast
|
||||
// desc:项目班组
|
||||
// company:云南奇讯科技有限公司
|
||||
// ==========================================================================
|
||||
|
||||
package internal
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/database/gdb"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// SysProjectTeamDao is the manager for logic model data accessing and custom defined data operations functions management.
|
||||
type SysProjectTeamDao struct {
|
||||
table string // Table is the underlying table name of the DAO.
|
||||
group string // Group is the database configuration group name of current DAO.
|
||||
columns SysProjectTeamColumns // Columns is the short type for Columns, which contains all the column names of Table for convenient usage.
|
||||
}
|
||||
|
||||
// SysProjectTeamColumns defines and stores column names for table sys_project_team.
|
||||
type SysProjectTeamColumns struct {
|
||||
Id string // 主键ID
|
||||
ProjectId string // 项目id
|
||||
Name string // 班组名称
|
||||
CreateBy string // 创建者
|
||||
UpdateBy string // 更新者
|
||||
CreateTime string // 创建时间
|
||||
UpdateTime string // 更新时间
|
||||
DeletedAt string // 删除时间
|
||||
}
|
||||
|
||||
var sysProjectTeamColumns = SysProjectTeamColumns{
|
||||
Id: "id",
|
||||
ProjectId: "project_id",
|
||||
Name: "name",
|
||||
CreateBy: "create_by",
|
||||
UpdateBy: "update_by",
|
||||
CreateTime: "create_time",
|
||||
UpdateTime: "update_time",
|
||||
DeletedAt: "deleted_at",
|
||||
}
|
||||
|
||||
// NewSysProjectTeamDao creates and returns a new DAO object for table data access.
|
||||
func NewSysProjectTeamDao() *SysProjectTeamDao {
|
||||
return &SysProjectTeamDao{
|
||||
group: "default",
|
||||
table: "sys_project_team",
|
||||
columns: sysProjectTeamColumns,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
func (dao *SysProjectTeamDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
func (dao *SysProjectTeamDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
func (dao *SysProjectTeamDao) Columns() SysProjectTeamColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
func (dao *SysProjectTeamDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
func (dao *SysProjectTeamDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// as it is automatically handled by this function.
|
||||
func (dao *SysProjectTeamDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
}
|
||||
@ -0,0 +1,90 @@
|
||||
// ==========================================================================
|
||||
// GFast自动生成dao internal操作代码。
|
||||
// 生成日期:2023-08-15 09:34:52
|
||||
// 生成路径: internal/app/wxApplet/dao/internal/sys_project_team_member.go
|
||||
// 生成人:gfast
|
||||
// desc:项目班组下的成员
|
||||
// company:云南奇讯科技有限公司
|
||||
// ==========================================================================
|
||||
|
||||
package internal
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/database/gdb"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// SysProjectTeamMemberDao is the manager for logic model data accessing and custom defined data operations functions management.
|
||||
type SysProjectTeamMemberDao struct {
|
||||
table string // Table is the underlying table name of the DAO.
|
||||
group string // Group is the database configuration group name of current DAO.
|
||||
columns SysProjectTeamMemberColumns // Columns is the short type for Columns, which contains all the column names of Table for convenient usage.
|
||||
}
|
||||
|
||||
// SysProjectTeamMemberColumns defines and stores column names for table sys_project_team_member.
|
||||
type SysProjectTeamMemberColumns struct {
|
||||
Id string // 主键ID
|
||||
TeamId string // 班组id
|
||||
Openid string // 微信用户标识
|
||||
PostId string // 岗位(默认为4普通员工,组长为10)
|
||||
ProjectId string // 项目id
|
||||
CreateTime string // 创建时间
|
||||
UpdateTime string // 更新时间
|
||||
DeletedAt string // 删除时间
|
||||
}
|
||||
|
||||
var sysProjectTeamMemberColumns = SysProjectTeamMemberColumns{
|
||||
Id: "id",
|
||||
TeamId: "team_id",
|
||||
Openid: "openid",
|
||||
PostId: "post_id",
|
||||
ProjectId: "project_id",
|
||||
CreateTime: "create_time",
|
||||
UpdateTime: "update_time",
|
||||
DeletedAt: "deleted_at",
|
||||
}
|
||||
|
||||
// NewSysProjectTeamMemberDao creates and returns a new DAO object for table data access.
|
||||
func NewSysProjectTeamMemberDao() *SysProjectTeamMemberDao {
|
||||
return &SysProjectTeamMemberDao{
|
||||
group: "default",
|
||||
table: "sys_project_team_member",
|
||||
columns: sysProjectTeamMemberColumns,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
func (dao *SysProjectTeamMemberDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
func (dao *SysProjectTeamMemberDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
func (dao *SysProjectTeamMemberDao) Columns() SysProjectTeamMemberColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
func (dao *SysProjectTeamMemberDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
func (dao *SysProjectTeamMemberDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// as it is automatically handled by this function.
|
||||
func (dao *SysProjectTeamMemberDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
}
|
||||
99
internal/app/wxApplet/dao/internal/sys_project_team_squad.go
Normal file
99
internal/app/wxApplet/dao/internal/sys_project_team_squad.go
Normal file
@ -0,0 +1,99 @@
|
||||
// ==========================================================================
|
||||
// GFast自动生成dao internal操作代码。
|
||||
// 生成日期:2023-08-30 15:24:06
|
||||
// 生成路径: internal/app/wxApplet/dao/internal/sys_project_team_squad.go
|
||||
// 生成人:gfast
|
||||
// desc:站班会
|
||||
// company:云南奇讯科技有限公司
|
||||
// ==========================================================================
|
||||
|
||||
package internal
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/database/gdb"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// SysProjectTeamSquadDao is the manager for logic model data accessing and custom defined data operations functions management.
|
||||
type SysProjectTeamSquadDao struct {
|
||||
table string // Table is the underlying table name of the DAO.
|
||||
group string // Group is the database configuration group name of current DAO.
|
||||
columns SysProjectTeamSquadColumns // Columns is the short type for Columns, which contains all the column names of Table for convenient usage.
|
||||
}
|
||||
|
||||
// SysProjectTeamSquadColumns defines and stores column names for table sys_project_team_squad.
|
||||
type SysProjectTeamSquadColumns struct {
|
||||
Id string // 主键ID
|
||||
TeamId string // 班组ID
|
||||
MeetingDate string // 开会时间
|
||||
CompereId string // 宣讲人
|
||||
ParticipantId string // 参与人ID(多个用,号隔开)
|
||||
Content string // 班会内容
|
||||
Picture string // 班会图片(多个用,号隔开)
|
||||
CreateBy string // 创建人
|
||||
UpdateBy string // 更新人
|
||||
CreatedAt string // 创建时间
|
||||
UpdatedAt string // 更新时间
|
||||
DeletedAt string // 删除时间
|
||||
ProjectId string // 删除时间
|
||||
}
|
||||
|
||||
var sysProjectTeamSquadColumns = SysProjectTeamSquadColumns{
|
||||
Id: "id",
|
||||
TeamId: "team_id",
|
||||
MeetingDate: "meeting_date",
|
||||
CompereId: "compere_id",
|
||||
ParticipantId: "participant_id",
|
||||
Content: "content",
|
||||
Picture: "picture",
|
||||
CreateBy: "create_by",
|
||||
UpdateBy: "update_by",
|
||||
CreatedAt: "created_at",
|
||||
UpdatedAt: "updated_at",
|
||||
ProjectId: "project_id",
|
||||
}
|
||||
|
||||
// NewSysProjectTeamSquadDao creates and returns a new DAO object for table data access.
|
||||
func NewSysProjectTeamSquadDao() *SysProjectTeamSquadDao {
|
||||
return &SysProjectTeamSquadDao{
|
||||
group: "default",
|
||||
table: "sys_project_team_squad",
|
||||
columns: sysProjectTeamSquadColumns,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
func (dao *SysProjectTeamSquadDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
func (dao *SysProjectTeamSquadDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
func (dao *SysProjectTeamSquadDao) Columns() SysProjectTeamSquadColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
func (dao *SysProjectTeamSquadDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
func (dao *SysProjectTeamSquadDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// as it is automatically handled by this function.
|
||||
func (dao *SysProjectTeamSquadDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
}
|
||||
@ -0,0 +1,90 @@
|
||||
// ==========================================================================
|
||||
// GFast自动生成dao internal操作代码。
|
||||
// 生成日期:2023-08-21 09:19:15
|
||||
// 生成路径: internal/app/wxApplet/dao/internal/sys_user_project_relevancy.go
|
||||
// 生成人:gfast
|
||||
// desc:系统用户与项目关联
|
||||
// company:云南奇讯科技有限公司
|
||||
// ==========================================================================
|
||||
|
||||
package internal
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/database/gdb"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// SysUserProjectRelevancyDao is the manager for logic model data accessing and custom defined data operations functions management.
|
||||
type SysUserProjectRelevancyDao struct {
|
||||
table string // Table is the underlying table name of the DAO.
|
||||
group string // Group is the database configuration group name of current DAO.
|
||||
columns SysUserProjectRelevancyColumns // Columns is the short type for Columns, which contains all the column names of Table for convenient usage.
|
||||
}
|
||||
|
||||
// SysUserProjectRelevancyColumns defines and stores column names for table sys_user_project_relevancy.
|
||||
type SysUserProjectRelevancyColumns struct {
|
||||
Id string // 主键ID
|
||||
UserId string // 用户ID
|
||||
ProjectId string // 项目ID
|
||||
CreateBy string // 创建人
|
||||
UpdateBy string // 更新人
|
||||
CreatedAt string // 创建时间
|
||||
UpdatedAt string // 更新时间
|
||||
DeletedAt string // 删除时间
|
||||
}
|
||||
|
||||
var sysUserProjectRelevancyColumns = SysUserProjectRelevancyColumns{
|
||||
Id: "id",
|
||||
UserId: "user_id",
|
||||
ProjectId: "project_id",
|
||||
CreateBy: "create_by",
|
||||
UpdateBy: "update_by",
|
||||
CreatedAt: "created_at",
|
||||
UpdatedAt: "updated_at",
|
||||
DeletedAt: "deleted_at",
|
||||
}
|
||||
|
||||
// NewSysUserProjectRelevancyDao creates and returns a new DAO object for table data access.
|
||||
func NewSysUserProjectRelevancyDao() *SysUserProjectRelevancyDao {
|
||||
return &SysUserProjectRelevancyDao{
|
||||
group: "default",
|
||||
table: "sys_user_project_relevancy",
|
||||
columns: sysUserProjectRelevancyColumns,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
func (dao *SysUserProjectRelevancyDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
func (dao *SysUserProjectRelevancyDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
func (dao *SysUserProjectRelevancyDao) Columns() SysUserProjectRelevancyColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
func (dao *SysUserProjectRelevancyDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
func (dao *SysUserProjectRelevancyDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// as it is automatically handled by this function.
|
||||
func (dao *SysUserProjectRelevancyDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
}
|
||||
29
internal/app/wxApplet/dao/sys_project_team.go
Normal file
29
internal/app/wxApplet/dao/sys_project_team.go
Normal file
@ -0,0 +1,29 @@
|
||||
// ==========================================================================
|
||||
// GFast自动生成dao操作代码。
|
||||
// 生成日期:2023-08-15 09:34:52
|
||||
// 生成路径: internal/app/wxApplet/dao/sys_project_team.go
|
||||
// 生成人:gfast
|
||||
// desc:项目班组
|
||||
// company:云南奇讯科技有限公司
|
||||
// ==========================================================================
|
||||
|
||||
package dao
|
||||
|
||||
import (
|
||||
"github.com/tiger1103/gfast/v3/internal/app/wxApplet/dao/internal"
|
||||
)
|
||||
|
||||
// sysProjectTeamDao is the manager for logic model data accessing and custom defined data operations functions management.
|
||||
// You can define custom methods on it to extend its functionality as you wish.
|
||||
type sysProjectTeamDao struct {
|
||||
*internal.SysProjectTeamDao
|
||||
}
|
||||
|
||||
var (
|
||||
// SysProjectTeam is globally public accessible object for table tools_gen_table operations.
|
||||
SysProjectTeam = sysProjectTeamDao{
|
||||
internal.NewSysProjectTeamDao(),
|
||||
}
|
||||
)
|
||||
|
||||
// Fill with you ideas below.
|
||||
29
internal/app/wxApplet/dao/sys_project_team_member.go
Normal file
29
internal/app/wxApplet/dao/sys_project_team_member.go
Normal file
@ -0,0 +1,29 @@
|
||||
// ==========================================================================
|
||||
// GFast自动生成dao操作代码。
|
||||
// 生成日期:2023-08-15 09:34:52
|
||||
// 生成路径: internal/app/wxApplet/dao/sys_project_team_member.go
|
||||
// 生成人:gfast
|
||||
// desc:项目班组下的成员
|
||||
// company:云南奇讯科技有限公司
|
||||
// ==========================================================================
|
||||
|
||||
package dao
|
||||
|
||||
import (
|
||||
"github.com/tiger1103/gfast/v3/internal/app/wxApplet/dao/internal"
|
||||
)
|
||||
|
||||
// sysProjectTeamMemberDao is the manager for logic model data accessing and custom defined data operations functions management.
|
||||
// You can define custom methods on it to extend its functionality as you wish.
|
||||
type sysProjectTeamMemberDao struct {
|
||||
*internal.SysProjectTeamMemberDao
|
||||
}
|
||||
|
||||
var (
|
||||
// SysProjectTeamMember is globally public accessible object for table tools_gen_table operations.
|
||||
SysProjectTeamMember = sysProjectTeamMemberDao{
|
||||
internal.NewSysProjectTeamMemberDao(),
|
||||
}
|
||||
)
|
||||
|
||||
// Fill with you ideas below.
|
||||
29
internal/app/wxApplet/dao/sys_project_team_squad.go
Normal file
29
internal/app/wxApplet/dao/sys_project_team_squad.go
Normal file
@ -0,0 +1,29 @@
|
||||
// ==========================================================================
|
||||
// GFast自动生成dao操作代码。
|
||||
// 生成日期:2023-08-30 15:24:06
|
||||
// 生成路径: internal/app/wxApplet/dao/sys_project_team_squad.go
|
||||
// 生成人:gfast
|
||||
// desc:站班会
|
||||
// company:云南奇讯科技有限公司
|
||||
// ==========================================================================
|
||||
|
||||
package dao
|
||||
|
||||
import (
|
||||
"github.com/tiger1103/gfast/v3/internal/app/wxApplet/dao/internal"
|
||||
)
|
||||
|
||||
// sysProjectTeamSquadDao is the manager for logic model data accessing and custom defined data operations functions management.
|
||||
// You can define custom methods on it to extend its functionality as you wish.
|
||||
type sysProjectTeamSquadDao struct {
|
||||
*internal.SysProjectTeamSquadDao
|
||||
}
|
||||
|
||||
var (
|
||||
// SysProjectTeamSquad is globally public accessible object for table tools_gen_table operations.
|
||||
SysProjectTeamSquad = sysProjectTeamSquadDao{
|
||||
internal.NewSysProjectTeamSquadDao(),
|
||||
}
|
||||
)
|
||||
|
||||
// Fill with you ideas below.
|
||||
29
internal/app/wxApplet/dao/sys_user_project_relevancy.go
Normal file
29
internal/app/wxApplet/dao/sys_user_project_relevancy.go
Normal file
@ -0,0 +1,29 @@
|
||||
// ==========================================================================
|
||||
// GFast自动生成dao操作代码。
|
||||
// 生成日期:2023-08-21 09:19:14
|
||||
// 生成路径: internal/app/wxApplet/dao/sys_user_project_relevancy.go
|
||||
// 生成人:gfast
|
||||
// desc:系统用户与项目关联
|
||||
// company:云南奇讯科技有限公司
|
||||
// ==========================================================================
|
||||
|
||||
package dao
|
||||
|
||||
import (
|
||||
"github.com/tiger1103/gfast/v3/internal/app/wxApplet/dao/internal"
|
||||
)
|
||||
|
||||
// sysUserProjectRelevancyDao is the manager for logic model data accessing and custom defined data operations functions management.
|
||||
// You can define custom methods on it to extend its functionality as you wish.
|
||||
type sysUserProjectRelevancyDao struct {
|
||||
*internal.SysUserProjectRelevancyDao
|
||||
}
|
||||
|
||||
var (
|
||||
// SysUserProjectRelevancy is globally public accessible object for table tools_gen_table operations.
|
||||
SysUserProjectRelevancy = sysUserProjectRelevancyDao{
|
||||
internal.NewSysUserProjectRelevancyDao(),
|
||||
}
|
||||
)
|
||||
|
||||
// Fill with you ideas below.
|
||||
406
internal/app/wxApplet/logic/busAskforleave/bus_askforleave.go
Normal file
406
internal/app/wxApplet/logic/busAskforleave/bus_askforleave.go
Normal file
@ -0,0 +1,406 @@
|
||||
// ==========================================================================
|
||||
// GFast自动生成logic操作代码。
|
||||
// 生成日期:2025-03-27 14:14:25
|
||||
// 生成路径: internal/app/wxApplet/logic/bus_askforleave.go
|
||||
// 生成人:gfast
|
||||
// desc:请假
|
||||
// company:云南奇讯科技有限公司
|
||||
// ==========================================================================
|
||||
|
||||
package logic
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"github.com/gogf/gf/v2/database/gdb"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
"github.com/gogf/gf/v2/util/gconv"
|
||||
"github.com/tiger1103/gfast/v3/api/wxApplet/wxApplet"
|
||||
"github.com/tiger1103/gfast/v3/internal/app/system/consts"
|
||||
sysDao "github.com/tiger1103/gfast/v3/internal/app/system/dao"
|
||||
logic "github.com/tiger1103/gfast/v3/internal/app/system/logic/busReissueACard"
|
||||
ct "github.com/tiger1103/gfast/v3/internal/app/system/logic/context"
|
||||
"github.com/tiger1103/gfast/v3/internal/app/wxApplet/dao"
|
||||
"github.com/tiger1103/gfast/v3/internal/app/wxApplet/model"
|
||||
"github.com/tiger1103/gfast/v3/internal/app/wxApplet/model/do"
|
||||
"github.com/tiger1103/gfast/v3/internal/app/wxApplet/service"
|
||||
"github.com/tiger1103/gfast/v3/library/liberr"
|
||||
"github.com/tiger1103/gfast/v3/third/todo"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
func init() {
|
||||
service.RegisterBusAskforleave(New())
|
||||
}
|
||||
|
||||
func New() *sBusAskforleave {
|
||||
return &sBusAskforleave{}
|
||||
}
|
||||
|
||||
type sBusAskforleave struct{}
|
||||
|
||||
func (s *sBusAskforleave) AppBzzAskForLeaveUpdate(ctx context.Context, req *wxApplet.AppBzzAskForLeaveUpdateReq) (err error) {
|
||||
err = g.DB().Transaction(ctx, func(ctx context.Context, tx gdb.TX) error {
|
||||
err = g.Try(ctx, func(ctx context.Context) {
|
||||
// 获取当前数据的班组,然后根据班组获取到班组长的openid
|
||||
var aCard model.BusAskforleaveInfoRes
|
||||
err := dao.BusAskforleave.Ctx(ctx).WherePri(req.Id).Fields("id,openid,team_id,project_id").Scan(&aCard)
|
||||
liberr.ErrIsNil(ctx, err)
|
||||
fields, err := dao.SysProjectTeamMember.Ctx(ctx).
|
||||
Where("team_id", aCard.TeamId).
|
||||
Where("post_id", 10).
|
||||
Fields("openid").Value()
|
||||
liberr.ErrIsNil(ctx, err)
|
||||
if fields.String() == "" {
|
||||
err = errors.New("变更失败,申请人所在的班组未设置班组长")
|
||||
return
|
||||
}
|
||||
UpdateG2 := g.Map{"ganger": fields, "ganger_opinion": req.GangerOpinion, "ganger_explain": req.GangerExplain, "ganger_time": gtime.Now()}
|
||||
if req.GangerOpinion == "3" {
|
||||
UpdateG2["attendance_id"] = nil
|
||||
}
|
||||
// 变更班组长对补卡的状态,并且填写班组长的openid
|
||||
_, err = dao.BusAskforleave.Ctx(ctx).OmitEmpty().WherePri(req.Id).Update(UpdateG2)
|
||||
liberr.ErrIsNil(ctx, err, "变更班组长失败")
|
||||
// 标记特定的待办任务为已处理
|
||||
err = todo.MarkTaskAsProcessed(int(req.Id))
|
||||
// 然后将数据提交给管理员操作
|
||||
ids, err := logic.GetAdministrator(ctx, aCard.ProjectId)
|
||||
liberr.ErrIsNil(ctx, err)
|
||||
if len(ids) == 0 {
|
||||
liberr.ErrIsNil(ctx, errors.New("当前项目暂无后台管理人员可以进行审批,需要联系管理人员解决!"))
|
||||
return
|
||||
}
|
||||
var listReissueReminder []todo.ReissueReminder
|
||||
for i := range ids {
|
||||
listReissueReminder = append(listReissueReminder, todo.ReissueReminder{
|
||||
UserID: strconv.Itoa(int(ids[i])),
|
||||
Role: 0,
|
||||
ProjectID: int(aCard.ProjectId),
|
||||
CreatorID: aCard.Openid,
|
||||
TargetID: int(aCard.Id),
|
||||
})
|
||||
}
|
||||
err = todo.CreateAttendanceApprovalGroup(listReissueReminder, todo.ApprovalReminder)
|
||||
liberr.ErrIsNil(ctx, err)
|
||||
})
|
||||
return err
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
func (s *sBusAskforleave) AppAskForLeaveInfo(ctx context.Context, req *wxApplet.AppAskForLeaveInfoReq) (res *wxApplet.AppAskForLeaveInfoRes, err error) {
|
||||
err = g.Try(ctx, func(ctx context.Context) {
|
||||
err = dao.BusAskforleave.Ctx(ctx).WithAll().As("a").
|
||||
LeftJoin(dao.BusConstructionUser.Table(), "b", "b.openid = a.openid").
|
||||
Fields("a.*,b.user_name").
|
||||
Where("a."+dao.BusAskforleave.Columns().Id, req.Id).
|
||||
Scan(&res)
|
||||
// 获取班组长的名称和管理员名称
|
||||
if res.Ganger != "" {
|
||||
var busUser *model.BusConstructionUserInfoRes
|
||||
err = dao.BusConstructionUser.Ctx(ctx).Where(dao.BusConstructionUser.Columns().Openid, res.Ganger).Fields("user_name").Scan(&busUser)
|
||||
liberr.ErrIsNil(ctx, err)
|
||||
res.GangerName = busUser.UserName
|
||||
}
|
||||
if res.Manager != "" {
|
||||
var busUser *model.BusConstructionUserInfoRes
|
||||
err = sysDao.SysUser.Ctx(ctx).Where(sysDao.SysUser.Columns().Id, res.Manager).Fields("user_nickname").Scan(&busUser)
|
||||
liberr.ErrIsNil(ctx, err)
|
||||
res.ManagerName = busUser.UserName
|
||||
}
|
||||
liberr.ErrIsNil(ctx, err, "获取信息失败")
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
func (s *sBusAskforleave) AppAskForLeaveListPage(ctx context.Context, req *wxApplet.AppAskForLeaveListPageReq) (listRes *wxApplet.AppAskForLeaveListPageRes, err error) {
|
||||
listRes = new(wxApplet.AppAskForLeaveListPageRes)
|
||||
err = g.Try(ctx, func(ctx context.Context) {
|
||||
m := dao.BusAskforleave.Ctx(ctx).WithAll().As("a").
|
||||
LeftJoin(dao.BusConstructionUser.Table(), "b", "b.openid = a.openid")
|
||||
if req.Openid != "" {
|
||||
m = m.Where("a."+dao.BusAskforleave.Columns().Openid+" = ?", req.Openid)
|
||||
}
|
||||
if req.ProjectId != "" {
|
||||
m = m.Where("a."+dao.BusAskforleave.Columns().ProjectId+" = ?", gconv.Int64(req.ProjectId))
|
||||
}
|
||||
if req.TeamId != "" {
|
||||
m = m.Where("a."+dao.BusAskforleave.Columns().TeamId+" = ?", gconv.Int64(req.TeamId))
|
||||
}
|
||||
if len(req.DateRange) != 0 {
|
||||
m = m.Where("a."+dao.BusAskforleave.Columns().CreatedAt+" >=? AND "+"a."+dao.BusAskforleave.Columns().CreatedAt+" <=?", req.DateRange[0], req.DateRange[1])
|
||||
}
|
||||
listRes.Total, err = m.Count()
|
||||
liberr.ErrIsNil(ctx, err, "获取总行数失败")
|
||||
if req.PageNum == 0 {
|
||||
req.PageNum = 1
|
||||
}
|
||||
listRes.CurrentPage = req.PageNum
|
||||
if req.PageSize == 0 {
|
||||
req.PageSize = consts.PageSize
|
||||
}
|
||||
order := "id desc"
|
||||
if req.OrderBy != "" {
|
||||
order = req.OrderBy
|
||||
}
|
||||
var res []*model.BusAskforleaveListAppRes
|
||||
err = m.Fields("a.*,b.user_name").Page(req.PageNum, req.PageSize).Order(order).Scan(&res)
|
||||
liberr.ErrIsNil(ctx, err, "获取数据失败")
|
||||
listRes.List = res
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
func (s *sBusAskforleave) AppAskForLeaveAdd(ctx context.Context, req *wxApplet.AppAskForLeaveAddReq) (err error) {
|
||||
err = g.DB().Transaction(ctx, func(ctx context.Context, tx gdb.TX) error {
|
||||
err = g.Try(ctx, func(ctx context.Context) {
|
||||
// 1、根据openid获取到当前小程序用户所在班组的班组长
|
||||
var busUser *model.BusConstructionUserInfoRes
|
||||
err := dao.BusConstructionUser.Ctx(ctx).Where(dao.BusConstructionUser.Columns().Openid, req.Openid).Fields("project_id,team_id").Scan(&busUser)
|
||||
liberr.ErrIsNil(ctx, err, "添加失败")
|
||||
if busUser == nil || busUser.TeamId == 0 {
|
||||
liberr.ErrIsNil(ctx, err, "请先加入班组!")
|
||||
}
|
||||
//2、获取项目名称、班组名称
|
||||
columnsP := sysDao.SysProject.Columns()
|
||||
valueP, projectNameErr := sysDao.SysProject.Ctx(ctx).Where(columnsP.Id, busUser.ProjectId).Fields(columnsP.ProjectName).Value()
|
||||
liberr.ErrIsNil(ctx, projectNameErr, "获取项目失败")
|
||||
columnsT := dao.SysProjectTeam.Columns()
|
||||
valueT, teamNameErr := dao.SysProjectTeam.Ctx(ctx).Where(columnsT.Id, busUser.TeamId).Fields(columnsT.Name).Value()
|
||||
liberr.ErrIsNil(ctx, teamNameErr, "获取班组失败")
|
||||
// 判断当前请假的时间是否重复请假
|
||||
count, err := dao.BusAskforleave.Ctx(ctx).
|
||||
Where(dao.BusAskforleave.Columns().ProjectId, busUser.ProjectId).
|
||||
Where(dao.BusAskforleave.Columns().Openid, req.Openid).
|
||||
Where("("+
|
||||
"DATE_FORMAT(start_time,'%Y-%m-%d') BETWEEN DATE_FORMAT(?,'%Y-%m-%d') AND DATE_FORMAT(?,'%Y-%m-%d')"+
|
||||
" or "+
|
||||
"DATE_FORMAT(end_time,'%Y-%m-%d') BETWEEN DATE_FORMAT(?,'%Y-%m-%d') AND DATE_FORMAT(?,'%Y-%m-%d')"+
|
||||
")", req.StartTime, req.EndTime, req.StartTime, req.EndTime).Count()
|
||||
liberr.ErrIsNil(ctx, err)
|
||||
if count > 0 {
|
||||
liberr.ErrIsNil(ctx, errors.New("当前请假时间重复"))
|
||||
return
|
||||
}
|
||||
//3、插入请假数据
|
||||
info, err := dao.BusAskforleave.Ctx(ctx).Insert(do.BusAskforleave{
|
||||
ProjectId: busUser.ProjectId,
|
||||
ProjectName: valueP.String(),
|
||||
TeamId: busUser.TeamId,
|
||||
TeamName: valueT.String(),
|
||||
StartTime: req.StartTime,
|
||||
EndTime: req.EndTime,
|
||||
Argument: req.Argument,
|
||||
Openid: req.Openid,
|
||||
CreateBy: ct.New().GetLoginUser(ctx).Id,
|
||||
})
|
||||
liberr.ErrIsNil(ctx, err, "添加失败")
|
||||
//4、发送审批
|
||||
keyId, _ := info.LastInsertId()
|
||||
openidVal, err := dao.SysProjectTeamMember.Ctx(ctx).
|
||||
Where(dao.SysProjectTeamMember.Columns().TeamId, busUser.TeamId).
|
||||
Where(dao.SysProjectTeamMember.Columns().PostId, 10).
|
||||
Fields(dao.SysProjectTeamMember.Columns().Openid).Value()
|
||||
if openidVal.String() == "" || err != nil {
|
||||
liberr.ErrIsNil(ctx, errors.New("当前班组未发现班组长职位"))
|
||||
return
|
||||
}
|
||||
var listReissueReminder []todo.ReissueReminder
|
||||
|
||||
listReissueReminder = append(listReissueReminder, todo.ReissueReminder{
|
||||
UserID: openidVal.String(),
|
||||
Role: 1,
|
||||
ProjectID: int(busUser.ProjectId),
|
||||
CreatorID: req.Openid,
|
||||
TargetID: int(keyId),
|
||||
})
|
||||
err = todo.CreateAttendanceApprovalGroup(listReissueReminder, todo.ApprovalReminder)
|
||||
//err = todo.CreateAskForLeaveReminder(openidVal.String(), int(busUser.ProjectId), req.Openid, int(keyId))
|
||||
liberr.ErrIsNil(ctx, err)
|
||||
})
|
||||
return err
|
||||
})
|
||||
return err
|
||||
}
|
||||
|
||||
func (s *sBusAskforleave) List(ctx context.Context, req *wxApplet.BusAskforleaveSearchReq) (listRes *wxApplet.BusAskforleaveSearchRes, err error) {
|
||||
listRes = new(wxApplet.BusAskforleaveSearchRes)
|
||||
err = g.Try(ctx, func(ctx context.Context) {
|
||||
values, err2 := dao.BusConstructionUser.Ctx(ctx).Where("user_name like ?", "%"+req.Name+"%").Fields("openid").Array()
|
||||
liberr.ErrIsNil(ctx, err2)
|
||||
m := dao.BusAskforleave.Ctx(ctx).WithAll().As("a").
|
||||
LeftJoin("bus_construction_user", "b", "a.openid=b.openid").
|
||||
//LeftJoin("sys_project", "c", "c.id=b.project_id").
|
||||
//LeftJoin("sys_project_team", "d", "d.id=b.team_id").
|
||||
Fields("a.*,b.user_name")
|
||||
if req.Name != "" {
|
||||
m = m.Where("a."+dao.BusAskforleave.Columns().Openid+" in (?)", values)
|
||||
}
|
||||
if req.ProjectId > 0 {
|
||||
m = m.Where("a.project_id", req.ProjectId)
|
||||
}
|
||||
if req.TeamId > 0 {
|
||||
m = m.Where("a.team_id", req.TeamId)
|
||||
}
|
||||
if req.ManagerOpinion != "" {
|
||||
m = m.Where("a."+dao.BusAskforleave.Columns().ManagerOpinion+" = ?", req.ManagerOpinion)
|
||||
}
|
||||
if len(req.LeaveDateRange) != 0 {
|
||||
m = m.Where("date(a.start_time) <= ? AND date(a.end_time) >= ?", req.LeaveDateRange[0], req.LeaveDateRange[1])
|
||||
}
|
||||
if len(req.DateRange) != 0 {
|
||||
m = m.Where("a."+dao.BusAskforleave.Columns().CreatedAt+" >=? AND "+"a."+dao.BusAskforleave.Columns().CreatedAt+" <=?", req.DateRange[0], req.DateRange[1])
|
||||
}
|
||||
array, err := m.Array()
|
||||
liberr.ErrIsNil(ctx, err, "获取总行数失败")
|
||||
listRes.Total = len(array)
|
||||
if req.PageNum == 0 {
|
||||
req.PageNum = 1
|
||||
}
|
||||
listRes.CurrentPage = req.PageNum
|
||||
if req.PageSize == 0 {
|
||||
req.PageSize = consts.PageSize
|
||||
}
|
||||
order := "id desc"
|
||||
if req.OrderBy != "" {
|
||||
order = req.OrderBy
|
||||
}
|
||||
var res []*model.BusAskforleaveInfoRes
|
||||
err = m.Fields(wxApplet.BusAskforleaveSearchRes{}).Page(req.PageNum, req.PageSize).Order(order).Scan(&res)
|
||||
liberr.ErrIsNil(ctx, err, "获取数据失败")
|
||||
listRes.List = make([]*model.BusAskforleaveListRes, len(res))
|
||||
for k, v := range res {
|
||||
cardMode := ""
|
||||
cardNumber := ""
|
||||
if v.GangerOpinion == "1" && v.ManagerOpinion == "1" {
|
||||
cardMode = "待审核"
|
||||
cardNumber = "1"
|
||||
}
|
||||
if v.GangerOpinion == "2" || v.ManagerOpinion == "2" {
|
||||
cardMode = "审核中"
|
||||
cardNumber = "2"
|
||||
}
|
||||
if v.GangerOpinion == "3" || v.ManagerOpinion == "3" {
|
||||
cardMode = "已拒绝"
|
||||
cardNumber = "3"
|
||||
}
|
||||
if v.GangerOpinion == "2" && v.ManagerOpinion == "2" {
|
||||
cardMode = "已同意"
|
||||
cardNumber = "4"
|
||||
}
|
||||
|
||||
listRes.List[k] = &model.BusAskforleaveListRes{
|
||||
Id: v.Id,
|
||||
ProjectId: v.ProjectId,
|
||||
ProjectName: v.ProjectName,
|
||||
TeamId: v.TeamId,
|
||||
TeamName: v.TeamName,
|
||||
StartTime: v.StartTime,
|
||||
EndTime: v.EndTime,
|
||||
Argument: v.Argument,
|
||||
Ganger: v.Ganger,
|
||||
GangerOpinion: v.GangerOpinion,
|
||||
GangerExplain: v.GangerExplain,
|
||||
GangerTime: v.GangerTime,
|
||||
Manager: v.Manager,
|
||||
ManagerOpinion: v.ManagerOpinion,
|
||||
ManagerExplain: v.ManagerExplain,
|
||||
ManagerTime: v.ManagerTime,
|
||||
CreateBy: v.CreateBy,
|
||||
UpdateBy: v.UpdateBy,
|
||||
CreatedAt: v.CreatedAt,
|
||||
Remark: v.Remark,
|
||||
CardMode: cardMode,
|
||||
CardNumber: cardNumber,
|
||||
UserName: v.UserName,
|
||||
}
|
||||
}
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
func (s *sBusAskforleave) GetById(ctx context.Context, id int64) (res *model.BusAskforleaveInfoRes, err error) {
|
||||
err = g.Try(ctx, func(ctx context.Context) {
|
||||
err = dao.BusAskforleave.Ctx(ctx).WithAll().As("a").
|
||||
LeftJoin("bus_construction_user", "b", "a.openid=b.openid").
|
||||
Fields("a.*,b.user_name").
|
||||
Where("a."+dao.BusAskforleave.Columns().Id, id).Scan(&res)
|
||||
if res != nil {
|
||||
cardMode := ""
|
||||
cardNumber := ""
|
||||
if res.GangerOpinion == "1" && res.ManagerOpinion == "1" {
|
||||
cardMode = "待审核"
|
||||
cardNumber = "1"
|
||||
}
|
||||
if res.GangerOpinion == "2" || res.ManagerOpinion == "2" {
|
||||
cardMode = "审核中"
|
||||
cardNumber = "2"
|
||||
}
|
||||
if res.GangerOpinion == "3" || res.ManagerOpinion == "3" {
|
||||
cardMode = "已拒绝"
|
||||
cardNumber = "3"
|
||||
}
|
||||
if res.GangerOpinion == "2" && res.ManagerOpinion == "2" {
|
||||
cardMode = "已同意"
|
||||
cardNumber = "4"
|
||||
}
|
||||
res.CardMode = cardMode
|
||||
res.CardNumber = cardNumber
|
||||
}
|
||||
|
||||
liberr.ErrIsNil(ctx, err, "获取信息失败")
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
func (s *sBusAskforleave) Add(ctx context.Context, req *wxApplet.BusAskforleaveAddReq) (err error) {
|
||||
err = g.Try(ctx, func(ctx context.Context) {
|
||||
_, err = dao.BusAskforleave.Ctx(ctx).Insert(do.BusAskforleave{
|
||||
ProjectId: req.ProjectId,
|
||||
ProjectName: req.ProjectName,
|
||||
TeamId: req.TeamId,
|
||||
TeamName: req.TeamName,
|
||||
StartTime: req.StartTime,
|
||||
EndTime: req.EndTime,
|
||||
Argument: req.Argument,
|
||||
Ganger: req.Ganger,
|
||||
GangerOpinion: req.GangerOpinion,
|
||||
GangerExplain: req.GangerExplain,
|
||||
GangerTime: req.GangerTime,
|
||||
Manager: req.Manager,
|
||||
ManagerOpinion: req.ManagerOpinion,
|
||||
ManagerExplain: req.ManagerExplain,
|
||||
ManagerTime: req.ManagerTime,
|
||||
CreateBy: req.CreateBy,
|
||||
UpdateBy: req.UpdateBy,
|
||||
Remark: req.Remark,
|
||||
})
|
||||
liberr.ErrIsNil(ctx, err, "添加失败")
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
func (s *sBusAskforleave) Edit(ctx context.Context, req *wxApplet.BusAskforleaveEditReq) (err error) {
|
||||
err = g.Try(ctx, func(ctx context.Context) {
|
||||
_, err = dao.BusAskforleave.Ctx(ctx).WherePri(req.Id).Update(do.BusAskforleave{
|
||||
ManagerOpinion: req.ManagerOpinion,
|
||||
ManagerExplain: req.ManagerExplain,
|
||||
UpdateBy: ct.New().GetLoginUser(ctx).Id,
|
||||
})
|
||||
liberr.ErrIsNil(ctx, err, "修改失败")
|
||||
//批量同意
|
||||
err2 := todo.MarkTasksAsProcessedByUUID(req.Id)
|
||||
liberr.ErrIsNil(ctx, err2)
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
func (s *sBusAskforleave) Delete(ctx context.Context, ids []int64) (err error) {
|
||||
err = g.Try(ctx, func(ctx context.Context) {
|
||||
_, err = dao.BusAskforleave.Ctx(ctx).Delete(dao.BusAskforleave.Columns().Id+" in (?)", ids)
|
||||
liberr.ErrIsNil(ctx, err, "删除失败")
|
||||
})
|
||||
return
|
||||
}
|
||||
1560
internal/app/wxApplet/logic/busAttendance/bus_attendance.go
Normal file
1560
internal/app/wxApplet/logic/busAttendance/bus_attendance.go
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,112 @@
|
||||
// ==========================================================================
|
||||
// GFast自动生成logic操作代码。
|
||||
// 生成日期:2023-08-07 11:17:50
|
||||
// 生成路径: internal/app/wxApplet/logic/bus_construction_project.go
|
||||
// 生成人:gfast
|
||||
// desc:施工人员对应项目
|
||||
// company:云南奇讯科技有限公司
|
||||
// ==========================================================================
|
||||
|
||||
package logic
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/util/gconv"
|
||||
"github.com/tiger1103/gfast/v3/api/wxApplet/wxApplet"
|
||||
"github.com/tiger1103/gfast/v3/internal/app/system/consts"
|
||||
"github.com/tiger1103/gfast/v3/internal/app/wxApplet/dao"
|
||||
"github.com/tiger1103/gfast/v3/internal/app/wxApplet/model"
|
||||
"github.com/tiger1103/gfast/v3/internal/app/wxApplet/model/do"
|
||||
"github.com/tiger1103/gfast/v3/internal/app/wxApplet/service"
|
||||
"github.com/tiger1103/gfast/v3/library/liberr"
|
||||
)
|
||||
|
||||
func init() {
|
||||
service.RegisterBusConstructionProject(New())
|
||||
}
|
||||
|
||||
func New() *sBusConstructionProject {
|
||||
return &sBusConstructionProject{}
|
||||
}
|
||||
|
||||
type sBusConstructionProject struct{}
|
||||
|
||||
func (s *sBusConstructionProject) List(ctx context.Context, req *wxApplet.BusConstructionProjectSearchReq) (listRes *wxApplet.BusConstructionProjectSearchRes, err error) {
|
||||
listRes = new(wxApplet.BusConstructionProjectSearchRes)
|
||||
err = g.Try(ctx, func(ctx context.Context) {
|
||||
m := dao.BusConstructionProject.Ctx(ctx).WithAll()
|
||||
if req.Id != "" {
|
||||
m = m.Where(dao.BusConstructionProject.Columns().Id+" = ?", req.Id)
|
||||
}
|
||||
if req.ConstructionUserId != "" {
|
||||
m = m.Where(dao.BusConstructionProject.Columns().ConstructionUserId+" = ?", gconv.Int64(req.ConstructionUserId))
|
||||
}
|
||||
if req.ProjectId != "" {
|
||||
m = m.Where(dao.BusConstructionProject.Columns().ProjectId+" = ?", gconv.Int64(req.ProjectId))
|
||||
}
|
||||
listRes.Total, err = m.Count()
|
||||
liberr.ErrIsNil(ctx, err, "获取总行数失败")
|
||||
if req.PageNum == 0 {
|
||||
req.PageNum = 1
|
||||
}
|
||||
listRes.CurrentPage = req.PageNum
|
||||
if req.PageSize == 0 {
|
||||
req.PageSize = consts.PageSize
|
||||
}
|
||||
order := "id desc"
|
||||
if req.OrderBy != "" {
|
||||
order = req.OrderBy
|
||||
}
|
||||
var res []*model.BusConstructionProjectInfoRes
|
||||
err = m.Fields(wxApplet.BusConstructionProjectSearchRes{}).Page(req.PageNum, req.PageSize).Order(order).Scan(&res)
|
||||
liberr.ErrIsNil(ctx, err, "获取数据失败")
|
||||
listRes.List = make([]*model.BusConstructionProjectListRes, len(res))
|
||||
for k, v := range res {
|
||||
listRes.List[k] = &model.BusConstructionProjectListRes{
|
||||
Id: v.Id,
|
||||
ConstructionUserId: v.ConstructionUserId,
|
||||
ProjectId: v.ProjectId,
|
||||
}
|
||||
}
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
func (s *sBusConstructionProject) GetById(ctx context.Context, id uint64) (res *model.BusConstructionProjectInfoRes, err error) {
|
||||
err = g.Try(ctx, func(ctx context.Context) {
|
||||
err = dao.BusConstructionProject.Ctx(ctx).WithAll().Where(dao.BusConstructionProject.Columns().Id, id).Scan(&res)
|
||||
liberr.ErrIsNil(ctx, err, "获取信息失败")
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
func (s *sBusConstructionProject) Add(ctx context.Context, req *wxApplet.BusConstructionProjectAddReq) (err error) {
|
||||
err = g.Try(ctx, func(ctx context.Context) {
|
||||
_, err = dao.BusConstructionProject.Ctx(ctx).Insert(do.BusConstructionProject{
|
||||
ConstructionUserId: req.ConstructionUserId,
|
||||
ProjectId: req.ProjectId,
|
||||
})
|
||||
liberr.ErrIsNil(ctx, err, "添加失败")
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
func (s *sBusConstructionProject) Edit(ctx context.Context, req *wxApplet.BusConstructionProjectEditReq) (err error) {
|
||||
err = g.Try(ctx, func(ctx context.Context) {
|
||||
_, err = dao.BusConstructionProject.Ctx(ctx).WherePri(req.Id).Update(do.BusConstructionProject{
|
||||
ConstructionUserId: req.ConstructionUserId,
|
||||
ProjectId: req.ProjectId,
|
||||
})
|
||||
liberr.ErrIsNil(ctx, err, "修改失败")
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
func (s *sBusConstructionProject) Delete(ctx context.Context, ids []uint64) (err error) {
|
||||
err = g.Try(ctx, func(ctx context.Context) {
|
||||
_, err = dao.BusConstructionProject.Ctx(ctx).Delete(dao.BusConstructionProject.Columns().Id+" in (?)", ids)
|
||||
liberr.ErrIsNil(ctx, err, "删除失败")
|
||||
})
|
||||
return
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,124 @@
|
||||
// ==========================================================================
|
||||
// GFast自动生成logic操作代码。
|
||||
// 生成日期:2023-08-07 11:17:55
|
||||
// 生成路径: internal/app/wxApplet/logic/bus_construction_user_file.go
|
||||
// 生成人:gfast
|
||||
// desc:微信用户的文件存储
|
||||
// company:云南奇讯科技有限公司
|
||||
// ==========================================================================
|
||||
|
||||
package logic
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/util/gconv"
|
||||
"github.com/tiger1103/gfast/v3/api/wxApplet/wxApplet"
|
||||
"github.com/tiger1103/gfast/v3/internal/app/system/consts"
|
||||
"github.com/tiger1103/gfast/v3/internal/app/wxApplet/dao"
|
||||
"github.com/tiger1103/gfast/v3/internal/app/wxApplet/model"
|
||||
"github.com/tiger1103/gfast/v3/internal/app/wxApplet/model/do"
|
||||
"github.com/tiger1103/gfast/v3/internal/app/wxApplet/service"
|
||||
"github.com/tiger1103/gfast/v3/library/liberr"
|
||||
)
|
||||
|
||||
func init() {
|
||||
service.RegisterBusConstructionUserFile(New())
|
||||
}
|
||||
|
||||
func New() *sBusConstructionUserFile {
|
||||
return &sBusConstructionUserFile{}
|
||||
}
|
||||
|
||||
type sBusConstructionUserFile struct{}
|
||||
|
||||
func (s *sBusConstructionUserFile) List(ctx context.Context, req *wxApplet.BusConstructionUserFileSearchReq) (listRes *wxApplet.BusConstructionUserFileSearchRes, err error) {
|
||||
listRes = new(wxApplet.BusConstructionUserFileSearchRes)
|
||||
err = g.Try(ctx, func(ctx context.Context) {
|
||||
m := dao.BusConstructionUserFile.Ctx(ctx).WithAll()
|
||||
if req.Id != "" {
|
||||
m = m.Where(dao.BusConstructionUserFile.Columns().Id+" = ?", req.Id)
|
||||
}
|
||||
if req.UserId != "" {
|
||||
m = m.Where(dao.BusConstructionUserFile.Columns().UserId+" = ?", gconv.Int64(req.UserId))
|
||||
}
|
||||
if req.UserImgType != "" {
|
||||
m = m.Where(dao.BusConstructionUserFile.Columns().UserImgType+" = ?", req.UserImgType)
|
||||
}
|
||||
if req.Path != "" {
|
||||
m = m.Where(dao.BusConstructionUserFile.Columns().Path+" = ?", req.Path)
|
||||
}
|
||||
if len(req.DateRange) != 0 {
|
||||
m = m.Where(dao.BusConstructionUserFile.Columns().CreatedAt+" >=? AND "+dao.BusConstructionUserFile.Columns().CreatedAt+" <=?", req.DateRange[0], req.DateRange[1])
|
||||
}
|
||||
listRes.Total, err = m.Count()
|
||||
liberr.ErrIsNil(ctx, err, "获取总行数失败")
|
||||
if req.PageNum == 0 {
|
||||
req.PageNum = 1
|
||||
}
|
||||
listRes.CurrentPage = req.PageNum
|
||||
if req.PageSize == 0 {
|
||||
req.PageSize = consts.PageSize
|
||||
}
|
||||
order := "id desc"
|
||||
if req.OrderBy != "" {
|
||||
order = req.OrderBy
|
||||
}
|
||||
var res []*model.BusConstructionUserFileInfoRes
|
||||
err = m.Fields(wxApplet.BusConstructionUserFileSearchRes{}).Page(req.PageNum, req.PageSize).Order(order).Scan(&res)
|
||||
liberr.ErrIsNil(ctx, err, "获取数据失败")
|
||||
listRes.List = make([]*model.BusConstructionUserFileListRes, len(res))
|
||||
for k, v := range res {
|
||||
listRes.List[k] = &model.BusConstructionUserFileListRes{
|
||||
Id: v.Id,
|
||||
UserId: v.UserId,
|
||||
UserImgType: v.UserImgType,
|
||||
Path: v.Path,
|
||||
CreatedAt: v.CreatedAt,
|
||||
}
|
||||
}
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
func (s *sBusConstructionUserFile) GetById(ctx context.Context, id int64) (res *model.BusConstructionUserFileInfoRes, err error) {
|
||||
err = g.Try(ctx, func(ctx context.Context) {
|
||||
err = dao.BusConstructionUserFile.Ctx(ctx).WithAll().Where(dao.BusConstructionUserFile.Columns().Id, id).Scan(&res)
|
||||
liberr.ErrIsNil(ctx, err, "获取信息失败")
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
func (s *sBusConstructionUserFile) Add(ctx context.Context, req *wxApplet.BusConstructionUserFileAddReq) (err error) {
|
||||
err = g.Try(ctx, func(ctx context.Context) {
|
||||
_, err = dao.BusConstructionUserFile.Ctx(ctx).Insert(do.BusConstructionUserFile{
|
||||
UserId: req.UserId,
|
||||
UserImgType: req.UserImgType,
|
||||
Name: req.Name,
|
||||
Path: req.Path,
|
||||
})
|
||||
liberr.ErrIsNil(ctx, err, "添加失败")
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
func (s *sBusConstructionUserFile) Edit(ctx context.Context, req *wxApplet.BusConstructionUserFileEditReq) (err error) {
|
||||
err = g.Try(ctx, func(ctx context.Context) {
|
||||
_, err = dao.BusConstructionUserFile.Ctx(ctx).WherePri(req.Id).Update(do.BusConstructionUserFile{
|
||||
UserId: req.UserId,
|
||||
UserImgType: req.UserImgType,
|
||||
Name: req.Name,
|
||||
Path: req.Path,
|
||||
})
|
||||
liberr.ErrIsNil(ctx, err, "修改失败")
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
func (s *sBusConstructionUserFile) Delete(ctx context.Context, ids []int64) (err error) {
|
||||
err = g.Try(ctx, func(ctx context.Context) {
|
||||
_, err = dao.BusConstructionUserFile.Ctx(ctx).Delete(dao.BusConstructionUserFile.Columns().Id+" in (?)", ids)
|
||||
liberr.ErrIsNil(ctx, err, "删除失败")
|
||||
})
|
||||
return
|
||||
}
|
||||
@ -0,0 +1,112 @@
|
||||
// ==========================================================================
|
||||
// GFast自动生成logic操作代码。
|
||||
// 生成日期:2023-08-07 11:17:55
|
||||
// 生成路径: internal/app/wxApplet/logic/bus_construction_user_post.go
|
||||
// 生成人:gfast
|
||||
// desc:施工人员岗位
|
||||
// company:云南奇讯科技有限公司
|
||||
// ==========================================================================
|
||||
|
||||
package logic
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/util/gconv"
|
||||
"github.com/tiger1103/gfast/v3/api/wxApplet/wxApplet"
|
||||
"github.com/tiger1103/gfast/v3/internal/app/system/consts"
|
||||
"github.com/tiger1103/gfast/v3/internal/app/wxApplet/dao"
|
||||
"github.com/tiger1103/gfast/v3/internal/app/wxApplet/model"
|
||||
"github.com/tiger1103/gfast/v3/internal/app/wxApplet/model/do"
|
||||
"github.com/tiger1103/gfast/v3/internal/app/wxApplet/service"
|
||||
"github.com/tiger1103/gfast/v3/library/liberr"
|
||||
)
|
||||
|
||||
func init() {
|
||||
service.RegisterBusConstructionUserPost(New())
|
||||
}
|
||||
|
||||
func New() *sBusConstructionUserPost {
|
||||
return &sBusConstructionUserPost{}
|
||||
}
|
||||
|
||||
type sBusConstructionUserPost struct{}
|
||||
|
||||
func (s *sBusConstructionUserPost) List(ctx context.Context, req *wxApplet.BusConstructionUserPostSearchReq) (listRes *wxApplet.BusConstructionUserPostSearchRes, err error) {
|
||||
listRes = new(wxApplet.BusConstructionUserPostSearchRes)
|
||||
err = g.Try(ctx, func(ctx context.Context) {
|
||||
m := dao.BusConstructionUserPost.Ctx(ctx).WithAll()
|
||||
if req.Id != "" {
|
||||
m = m.Where(dao.BusConstructionUserPost.Columns().Id+" = ?", req.Id)
|
||||
}
|
||||
if req.ConstructionUserId != "" {
|
||||
m = m.Where(dao.BusConstructionUserPost.Columns().ConstructionUserId+" = ?", gconv.Int64(req.ConstructionUserId))
|
||||
}
|
||||
if req.PostId != "" {
|
||||
m = m.Where(dao.BusConstructionUserPost.Columns().PostId+" = ?", gconv.Int64(req.PostId))
|
||||
}
|
||||
listRes.Total, err = m.Count()
|
||||
liberr.ErrIsNil(ctx, err, "获取总行数失败")
|
||||
if req.PageNum == 0 {
|
||||
req.PageNum = 1
|
||||
}
|
||||
listRes.CurrentPage = req.PageNum
|
||||
if req.PageSize == 0 {
|
||||
req.PageSize = consts.PageSize
|
||||
}
|
||||
order := "id desc"
|
||||
if req.OrderBy != "" {
|
||||
order = req.OrderBy
|
||||
}
|
||||
var res []*model.BusConstructionUserPostInfoRes
|
||||
err = m.Fields(wxApplet.BusConstructionUserPostSearchRes{}).Page(req.PageNum, req.PageSize).Order(order).Scan(&res)
|
||||
liberr.ErrIsNil(ctx, err, "获取数据失败")
|
||||
listRes.List = make([]*model.BusConstructionUserPostListRes, len(res))
|
||||
for k, v := range res {
|
||||
listRes.List[k] = &model.BusConstructionUserPostListRes{
|
||||
Id: v.Id,
|
||||
ConstructionUserId: v.ConstructionUserId,
|
||||
PostId: v.PostId,
|
||||
}
|
||||
}
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
func (s *sBusConstructionUserPost) GetById(ctx context.Context, id uint64) (res *model.BusConstructionUserPostInfoRes, err error) {
|
||||
err = g.Try(ctx, func(ctx context.Context) {
|
||||
err = dao.BusConstructionUserPost.Ctx(ctx).WithAll().Where(dao.BusConstructionUserPost.Columns().Id, id).Scan(&res)
|
||||
liberr.ErrIsNil(ctx, err, "获取信息失败")
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
func (s *sBusConstructionUserPost) Add(ctx context.Context, req *wxApplet.BusConstructionUserPostAddReq) (err error) {
|
||||
err = g.Try(ctx, func(ctx context.Context) {
|
||||
_, err = dao.BusConstructionUserPost.Ctx(ctx).Insert(do.BusConstructionUserPost{
|
||||
ConstructionUserId: req.ConstructionUserId,
|
||||
PostId: req.PostId,
|
||||
})
|
||||
liberr.ErrIsNil(ctx, err, "添加失败")
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
func (s *sBusConstructionUserPost) Edit(ctx context.Context, req *wxApplet.BusConstructionUserPostEditReq) (err error) {
|
||||
err = g.Try(ctx, func(ctx context.Context) {
|
||||
_, err = dao.BusConstructionUserPost.Ctx(ctx).WherePri(req.Id).Update(do.BusConstructionUserPost{
|
||||
ConstructionUserId: req.ConstructionUserId,
|
||||
PostId: req.PostId,
|
||||
})
|
||||
liberr.ErrIsNil(ctx, err, "修改失败")
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
func (s *sBusConstructionUserPost) Delete(ctx context.Context, ids []uint64) (err error) {
|
||||
err = g.Try(ctx, func(ctx context.Context) {
|
||||
_, err = dao.BusConstructionUserPost.Ctx(ctx).Delete(dao.BusConstructionUserPost.Columns().Id+" in (?)", ids)
|
||||
liberr.ErrIsNil(ctx, err, "删除失败")
|
||||
})
|
||||
return
|
||||
}
|
||||
@ -0,0 +1,218 @@
|
||||
// ==========================================================================
|
||||
// GFast自动生成logic操作代码。
|
||||
// 生成日期:2023-08-14 11:24:31
|
||||
// 生成路径: internal/app/wxApplet/logic/bus_labourservice.go
|
||||
// 生成人:gfast
|
||||
// desc:劳务公司
|
||||
// company:云南奇讯科技有限公司
|
||||
// ==========================================================================
|
||||
|
||||
package logic
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/util/gconv"
|
||||
"github.com/tiger1103/gfast/v3/api/v1/common/coryCommon"
|
||||
"github.com/tiger1103/gfast/v3/api/wxApplet/wxApplet"
|
||||
"github.com/tiger1103/gfast/v3/internal/app/system/consts"
|
||||
ct "github.com/tiger1103/gfast/v3/internal/app/system/logic/context"
|
||||
"github.com/tiger1103/gfast/v3/internal/app/wxApplet/dao"
|
||||
"github.com/tiger1103/gfast/v3/internal/app/wxApplet/model"
|
||||
"github.com/tiger1103/gfast/v3/internal/app/wxApplet/model/do"
|
||||
"github.com/tiger1103/gfast/v3/internal/app/wxApplet/service"
|
||||
"github.com/tiger1103/gfast/v3/library/liberr"
|
||||
tool "github.com/tiger1103/gfast/v3/utility/coryUtils"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func init() {
|
||||
service.RegisterBusLabourservice(New())
|
||||
}
|
||||
|
||||
func New() *sBusLabourservice {
|
||||
return &sBusLabourservice{}
|
||||
}
|
||||
|
||||
type sBusLabourservice struct{}
|
||||
|
||||
func (s *sBusLabourservice) PcAdd(ctx context.Context, req *wxApplet.BusPcAddReq) (err error) {
|
||||
err = g.Try(ctx, func(ctx context.Context) {
|
||||
_, InsertErr := g.DB().Model("bus_labourservice_file").Data(&model.BusLabourserviceFileRes{
|
||||
Pid: req.Pid,
|
||||
Type: req.Type,
|
||||
Name: req.Name,
|
||||
Path: req.Path,
|
||||
}).Insert()
|
||||
liberr.ErrIsNil(ctx, InsertErr, "资料添加错误!")
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
func (s *sBusLabourservice) PcDel(ctx context.Context, req *wxApplet.BusPcDelReq) (err error) {
|
||||
err = g.Try(ctx, func(ctx context.Context) {
|
||||
m := g.DB().Model("bus_labourservice_file").Where("id", req.Id).Safe()
|
||||
//1、查询数据
|
||||
path, err := m.Fields("path").Value()
|
||||
liberr.ErrIsNil(ctx, err)
|
||||
//2、删除数据
|
||||
_, err = m.Delete()
|
||||
liberr.ErrIsNil(ctx, err)
|
||||
//3、删除文件
|
||||
coryCommon.BatchFile(strings.Split(path.String(), ","))
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
func (s *sBusLabourservice) PcFind(ctx context.Context, req *wxApplet.BusPcFindReq) (res *wxApplet.BusPcFindRes, err error) {
|
||||
res = new(wxApplet.BusPcFindRes)
|
||||
err = g.Try(ctx, func(ctx context.Context) {
|
||||
var fileRes []*model.BusLabourserviceFileRes
|
||||
err = g.DB().Model("bus_labourservice_file").Where("pid", req.Pid).Scan(&fileRes)
|
||||
res.List = fileRes
|
||||
liberr.ErrIsNil(ctx, err)
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
func (s *sBusLabourservice) AppListOfParticipatingUnitsFunc(ctx context.Context, req *wxApplet.AppListOfParticipatingUnitsReq) (listRes *wxApplet.AppListOfParticipatingUnitsRes, err error) {
|
||||
listRes = new(wxApplet.AppListOfParticipatingUnitsRes)
|
||||
err = g.Try(ctx, func(ctx context.Context) {
|
||||
m := dao.BusLabourservice.Ctx(ctx).WithAll()
|
||||
if req.FuzzyQuery != "" {
|
||||
m = m.Where(dao.BusLabourservice.Columns().Name+" like ?", "%"+req.FuzzyQuery+"%")
|
||||
}
|
||||
order := "name asc"
|
||||
var res []*model.BusLabourserviceInfoRes
|
||||
err = m.Fields(wxApplet.BusLabourserviceSearchRes{}).Order(order).Scan(&res)
|
||||
liberr.ErrIsNil(ctx, err, "获取数据失败")
|
||||
listRes.List = make([]*model.BusLabourserviceListRes, len(res))
|
||||
for k, v := range res {
|
||||
listRes.List[k] = &model.BusLabourserviceListRes{
|
||||
Id: v.Id,
|
||||
Name: v.Name,
|
||||
Principal: v.Principal,
|
||||
Phone: v.Phone,
|
||||
Custodian: v.Custodian,
|
||||
CustodianPhone: v.CustodianPhone,
|
||||
CreatedAt: v.CreatedAt,
|
||||
Remark: v.Remark,
|
||||
}
|
||||
}
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
func (s *sBusLabourservice) List(ctx context.Context, req *wxApplet.BusLabourserviceSearchReq) (listRes *wxApplet.BusLabourserviceSearchRes, err error) {
|
||||
listRes = new(wxApplet.BusLabourserviceSearchRes)
|
||||
err = g.Try(ctx, func(ctx context.Context) {
|
||||
m := dao.BusLabourservice.Ctx(ctx).WithAll()
|
||||
if req.Name != "" {
|
||||
m = m.Where(dao.BusLabourservice.Columns().Name+" like ?", "%"+req.Name+"%")
|
||||
}
|
||||
//创建时间模糊查询
|
||||
if req.CreatedAt != "" {
|
||||
date := tool.New().GetFormattedDate(gconv.Time(req.CreatedAt))
|
||||
m = m.Where(dao.BusLabourservice.Columns().CreatedAt+" like ?", "%"+date+"%")
|
||||
}
|
||||
if len(req.DateRange) != 0 {
|
||||
m = m.Where(dao.BusLabourservice.Columns().CreatedAt+" >=? AND "+dao.BusLabourservice.Columns().CreatedAt+" <=?", req.DateRange[0], req.DateRange[1])
|
||||
}
|
||||
listRes.Total, err = m.Count()
|
||||
liberr.ErrIsNil(ctx, err, "获取总行数失败")
|
||||
if req.PageNum == 0 {
|
||||
req.PageNum = 1
|
||||
}
|
||||
listRes.CurrentPage = req.PageNum
|
||||
if req.PageSize == 0 {
|
||||
req.PageSize = consts.PageSize
|
||||
}
|
||||
order := "id desc"
|
||||
if req.OrderBy != "" {
|
||||
order = req.OrderBy
|
||||
}
|
||||
var res []*model.BusLabourserviceInfoRes
|
||||
err = m.Fields(wxApplet.BusLabourserviceSearchRes{}).Page(req.PageNum, req.PageSize).Order(order).Scan(&res)
|
||||
liberr.ErrIsNil(ctx, err, "获取数据失败")
|
||||
listRes.List = make([]*model.BusLabourserviceListRes, len(res))
|
||||
for k, v := range res {
|
||||
listRes.List[k] = &model.BusLabourserviceListRes{
|
||||
Id: v.Id,
|
||||
Name: v.Name,
|
||||
Principal: v.Principal,
|
||||
Phone: v.Phone,
|
||||
Custodian: v.Custodian,
|
||||
CustodianPhone: v.CustodianPhone,
|
||||
CreatedAt: v.CreatedAt,
|
||||
Remark: v.Remark,
|
||||
}
|
||||
}
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
func (s *sBusLabourservice) GetById(ctx context.Context, id int64) (res *model.BusLabourserviceInfoRes, err error) {
|
||||
err = g.Try(ctx, func(ctx context.Context) {
|
||||
err = dao.BusLabourservice.Ctx(ctx).WithAll().Where(dao.BusLabourservice.Columns().Id, id).Scan(&res)
|
||||
liberr.ErrIsNil(ctx, err, "获取信息失败")
|
||||
//获取创建人 更新人
|
||||
by := coryCommon.New().CreateByOrUpdateBy(ctx, res)
|
||||
infoRes := by.(model.BusLabourserviceInfoRes)
|
||||
res = &infoRes
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
func (s *sBusLabourservice) Add(ctx context.Context, req *wxApplet.BusLabourserviceAddReq) (err error) {
|
||||
err = g.Try(ctx, func(ctx context.Context) {
|
||||
columns := dao.BusLabourservice.Columns()
|
||||
//1、判断劳务公司是否重复
|
||||
count, countErr := dao.BusLabourservice.Ctx(ctx).Where(columns.Name, req.Name).Count()
|
||||
liberr.ErrIsNil(ctx, countErr, "获取劳务信息失败!")
|
||||
if count > 0 {
|
||||
liberr.ErrIsNil(ctx, errors.New("该劳务公司已存在!"))
|
||||
return
|
||||
}
|
||||
//2、添加劳务公司
|
||||
name := ct.New().GetLoginUser(ctx).Id
|
||||
_, errInsertInfo := dao.BusLabourservice.Ctx(ctx).Insert(do.BusLabourservice{
|
||||
Name: req.Name,
|
||||
Principal: req.Principal,
|
||||
Phone: req.Phone,
|
||||
Custodian: req.Custodian,
|
||||
CustodianPhone: req.CustodianPhone,
|
||||
Remark: req.Remark,
|
||||
CreateBy: name,
|
||||
})
|
||||
liberr.ErrIsNil(ctx, errInsertInfo, "添加失败")
|
||||
|
||||
})
|
||||
return err
|
||||
}
|
||||
|
||||
func (s *sBusLabourservice) Edit(ctx context.Context, req *wxApplet.BusLabourserviceEditReq) (err error) {
|
||||
err = g.Try(ctx, func(ctx context.Context) {
|
||||
//1、修改资料
|
||||
name := ct.New().GetLoginUser(ctx).Id
|
||||
_, err = dao.BusLabourservice.Ctx(ctx).WherePri(req.Id).Update(do.BusLabourservice{
|
||||
Name: req.Name,
|
||||
Principal: req.Principal,
|
||||
Phone: req.Phone,
|
||||
Custodian: req.Custodian,
|
||||
CustodianPhone: req.CustodianPhone,
|
||||
Remark: req.Remark,
|
||||
UpdateBy: name,
|
||||
})
|
||||
liberr.ErrIsNil(ctx, err, "修改失败")
|
||||
})
|
||||
return err
|
||||
}
|
||||
|
||||
func (s *sBusLabourservice) Delete(ctx context.Context, ids []int64) (err error) {
|
||||
err = g.Try(ctx, func(ctx context.Context) {
|
||||
_, err = dao.BusLabourservice.Ctx(ctx).Delete(dao.BusLabourservice.Columns().Id+" in (?)", ids)
|
||||
liberr.ErrIsNil(ctx, err, "删除失败")
|
||||
})
|
||||
return
|
||||
}
|
||||
13
internal/app/wxApplet/logic/logic.go
Normal file
13
internal/app/wxApplet/logic/logic.go
Normal file
@ -0,0 +1,13 @@
|
||||
package logic
|
||||
|
||||
import _ "github.com/tiger1103/gfast/v3/internal/app/wxApplet/logic/busAskforleave"
|
||||
import _ "github.com/tiger1103/gfast/v3/internal/app/wxApplet/logic/busAttendance"
|
||||
import _ "github.com/tiger1103/gfast/v3/internal/app/wxApplet/logic/busConstructionProject"
|
||||
import _ "github.com/tiger1103/gfast/v3/internal/app/wxApplet/logic/busConstructionUser"
|
||||
import _ "github.com/tiger1103/gfast/v3/internal/app/wxApplet/logic/busConstructionUserFile"
|
||||
import _ "github.com/tiger1103/gfast/v3/internal/app/wxApplet/logic/busConstructionUserPost"
|
||||
import _ "github.com/tiger1103/gfast/v3/internal/app/wxApplet/logic/busLabourservice"
|
||||
import _ "github.com/tiger1103/gfast/v3/internal/app/wxApplet/logic/sysProjectTeam"
|
||||
import _ "github.com/tiger1103/gfast/v3/internal/app/wxApplet/logic/sysProjectTeamMember"
|
||||
import _ "github.com/tiger1103/gfast/v3/internal/app/wxApplet/logic/sysProjectTeamSquad"
|
||||
import _ "github.com/tiger1103/gfast/v3/internal/app/wxApplet/logic/sysUserProjectRelevancy"
|
||||
331
internal/app/wxApplet/logic/sysProjectTeam/sys_project_team.go
Normal file
331
internal/app/wxApplet/logic/sysProjectTeam/sys_project_team.go
Normal file
@ -0,0 +1,331 @@
|
||||
// ==========================================================================
|
||||
// GFast自动生成logic操作代码。
|
||||
// 生成日期:2023-08-15 09:34:52
|
||||
// 生成路径: internal/app/wxApplet/logic/sys_project_team.go
|
||||
// 生成人:gfast
|
||||
// desc:项目班组
|
||||
// company:云南奇讯科技有限公司
|
||||
// ==========================================================================
|
||||
|
||||
package logic
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"github.com/gogf/gf/v2/database/gdb"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/util/gconv"
|
||||
"github.com/tiger1103/gfast/v3/api/v1/common/coryCommon"
|
||||
"github.com/tiger1103/gfast/v3/api/wxApplet/wxApplet"
|
||||
"github.com/tiger1103/gfast/v3/internal/app/system/consts"
|
||||
ct "github.com/tiger1103/gfast/v3/internal/app/system/logic/context"
|
||||
"github.com/tiger1103/gfast/v3/internal/app/wxApplet/dao"
|
||||
"github.com/tiger1103/gfast/v3/internal/app/wxApplet/model"
|
||||
"github.com/tiger1103/gfast/v3/internal/app/wxApplet/model/do"
|
||||
"github.com/tiger1103/gfast/v3/internal/app/wxApplet/service"
|
||||
"github.com/tiger1103/gfast/v3/library/liberr"
|
||||
tool "github.com/tiger1103/gfast/v3/utility/coryUtils"
|
||||
)
|
||||
|
||||
func init() {
|
||||
service.RegisterSysProjectTeam(New())
|
||||
}
|
||||
|
||||
func New() *sSysProjectTeam {
|
||||
return &sSysProjectTeam{}
|
||||
}
|
||||
|
||||
type sSysProjectTeam struct{}
|
||||
|
||||
func (s *sSysProjectTeam) ListOfAttendancePersonnelFunc(ctx context.Context, req *wxApplet.ListOfAttendancePersonnelReq) (res *wxApplet.ListOfAttendancePersonnelRes, err error) {
|
||||
res = &wxApplet.ListOfAttendancePersonnelRes{}
|
||||
err = g.Try(ctx, func(ctx context.Context) {
|
||||
var ry []*wxApplet.ListOfAttendancePersonnelTwo
|
||||
switch req.Type {
|
||||
case "0":
|
||||
//1、获取到所有人员
|
||||
columns := dao.BusConstructionUser.Columns()
|
||||
err := dao.BusConstructionUser.Ctx(ctx).Where(columns.TeamId, req.TeamId).Fields(columns.Openid, columns.PacePhoto+" as userHead", columns.UserName, columns.Phone).Scan(&ry)
|
||||
liberr.ErrIsNil(ctx, err, "获取全部人员失败!")
|
||||
break
|
||||
case "1":
|
||||
//2、获取到打卡人员信息
|
||||
all, err := g.DB().GetAll(ctx, `SELECT
|
||||
DISTINCT
|
||||
a.openid,
|
||||
b.pace_photo as userHead,
|
||||
b.user_name as userName,
|
||||
b.phone,
|
||||
FROM
|
||||
bus_attendance AS a
|
||||
RIGHT JOIN bus_construction_user AS b ON ( b.team_id = ? AND b.openid = a.openid )
|
||||
WHERE
|
||||
a.is_pinch <> 4 and DATE_FORMAT(clock_on,"%Y-%m-%d") = ?`,
|
||||
g.Slice{req.TeamId, req.LocalDate})
|
||||
liberr.ErrIsNil(ctx, err, "获取打卡人员失败")
|
||||
err = all.Structs(&ry)
|
||||
liberr.ErrIsNil(ctx, err, "获取打卡人员转换失败")
|
||||
break
|
||||
case "2":
|
||||
all, err := g.DB().GetAll(ctx, `SELECT
|
||||
a.openid,
|
||||
a.pace_photo as userHead,
|
||||
a.user_name as userName,
|
||||
a.phone,
|
||||
c.ganger_opinion as gangerOpinion,
|
||||
c.manager_opinion as managerOpinion
|
||||
FROM
|
||||
bus_construction_user as a
|
||||
left join bus_askforleave as c on ( c.openid = a.openid and c.team_id = ? )
|
||||
WHERE
|
||||
a.openid in (
|
||||
SELECT
|
||||
openid
|
||||
FROM
|
||||
bus_askforleave
|
||||
WHERE
|
||||
team_id = ? and
|
||||
? BETWEEN DATE_FORMAT(start_time,'%Y-%m-%d') AND DATE_FORMAT(end_time,'%Y-%m-%d')
|
||||
) and ? BETWEEN DATE_FORMAT(c.start_time,'%Y-%m-%d') AND DATE_FORMAT(c.end_time,'%Y-%m-%d')`,
|
||||
g.Slice{req.TeamId, req.TeamId, req.LocalDate, req.LocalDate})
|
||||
liberr.ErrIsNil(ctx, err, "获取请假人员失败")
|
||||
err = all.Structs(&ry)
|
||||
liberr.ErrIsNil(ctx, err, "获取请假人员转换失败")
|
||||
for i := range ry {
|
||||
cardMode := ""
|
||||
cardNumber := ""
|
||||
if ry[i].GangerOpinion == "1" && ry[i].ManagerOpinion == "1" {
|
||||
cardMode = "待审核"
|
||||
cardNumber = "1"
|
||||
}
|
||||
if ry[i].GangerOpinion == "2" || ry[i].ManagerOpinion == "2" {
|
||||
cardMode = "审核中"
|
||||
cardNumber = "2"
|
||||
}
|
||||
if ry[i].GangerOpinion == "3" || ry[i].ManagerOpinion == "3" {
|
||||
cardMode = "已拒绝"
|
||||
cardNumber = "3"
|
||||
}
|
||||
if ry[i].GangerOpinion == "2" && ry[i].ManagerOpinion == "2" {
|
||||
cardMode = "已同意"
|
||||
cardNumber = "4"
|
||||
}
|
||||
ry[i].CardMode = cardMode
|
||||
ry[i].CardNumber = cardNumber
|
||||
}
|
||||
break
|
||||
case "3":
|
||||
all, err := g.DB().GetAll(ctx, `SELECT
|
||||
a.openid,
|
||||
a.pace_photo as userHead,
|
||||
a.user_name as userName,
|
||||
a.phone
|
||||
FROM
|
||||
bus_construction_user as a
|
||||
WHERE
|
||||
team_id = ? and deleted_at is null and
|
||||
openid not in (
|
||||
SELECT DISTINCT
|
||||
a.openid
|
||||
FROM
|
||||
bus_attendance AS a
|
||||
RIGHT JOIN bus_construction_user AS b ON ( b.team_id = ? AND b.openid = a.openid )
|
||||
WHERE
|
||||
a.is_pinch <> 4 AND
|
||||
DATE_FORMAT( a.clock_on, "%Y-%m-%d" ) = ?
|
||||
|
||||
UNION
|
||||
|
||||
SELECT DISTINCT
|
||||
openid
|
||||
FROM
|
||||
bus_askforleave
|
||||
WHERE
|
||||
team_id = ? AND
|
||||
? BETWEEN DATE_FORMAT( start_time, '%Y-%m-%d' ) AND DATE_FORMAT( end_time, '%Y-%m-%d' )
|
||||
)`, g.Slice{req.TeamId, req.TeamId, req.LocalDate, req.TeamId, req.LocalDate})
|
||||
liberr.ErrIsNil(ctx, err, "获取未出勤人员失败")
|
||||
err = all.Structs(&ry)
|
||||
liberr.ErrIsNil(ctx, err, "获取未出勤人员转换失败")
|
||||
break
|
||||
}
|
||||
res.List = ry
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
func (s *sSysProjectTeam) GetsTheAttendanceOfASpecifiedShiftGroupFunc(ctx context.Context, req *wxApplet.GetsTheAttendanceOfASpecifiedShiftGroupReq) (res *wxApplet.GetsTheAttendanceOfASpecifiedShiftGroupRes, err error) {
|
||||
res = new(wxApplet.GetsTheAttendanceOfASpecifiedShiftGroupRes)
|
||||
err = g.Try(ctx, func(ctx context.Context) {
|
||||
//1、根据班组id获取到班组总人数
|
||||
columns := dao.BusConstructionUser.Columns()
|
||||
array, err := dao.BusConstructionUser.Ctx(ctx).Where(columns.TeamId, req.TeamId).Fields(columns.Openid).Array()
|
||||
liberr.ErrIsNil(ctx, err, "获取当前班组总人数失败")
|
||||
res.All = len(array)
|
||||
//2、获取到打卡人数;根据班组获取到指定的人、在根据人去考勤里面查询数据
|
||||
count, err := g.DB().GetCount(ctx, `SELECT
|
||||
COUNT(DISTINCT a.openid)
|
||||
FROM
|
||||
bus_attendance AS a
|
||||
RIGHT JOIN bus_construction_user AS b ON ( b.team_id = ? AND b.openid = a.openid )
|
||||
WHERE
|
||||
a.is_pinch <> 4 and DATE_FORMAT(clock_on,"%Y-%m-%d") = ?`,
|
||||
g.Slice{req.TeamId, req.LocalDate})
|
||||
liberr.ErrIsNil(ctx, err, "获取打卡人数失败")
|
||||
res.ClockIn = count
|
||||
//3、获取到请假人数
|
||||
valOpenids, err := dao.BusAskforleave.Ctx(ctx).
|
||||
Where(dao.BusAskforleave.Columns().TeamId, req.TeamId).
|
||||
Where(gdb.Raw("current_date BETWEEN DATE_FORMAT(start_time,'%Y-%m-%d') AND DATE_FORMAT(end_time,'%Y-%m-%d')")).
|
||||
Fields(dao.BusAskforleave.Columns().Openid).
|
||||
Array()
|
||||
liberr.ErrIsNil(ctx, err, "获取请假人数失败")
|
||||
res.AskForLeave = len(valOpenids)
|
||||
//4、获取到未出勤人数 = 总人数-打卡人数-请假人数
|
||||
res.NotClockIn = res.All - res.ClockIn - res.AskForLeave
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
func (s *sSysProjectTeam) List(ctx context.Context, req *wxApplet.SysProjectTeamSearchReq) (listRes *wxApplet.SysProjectTeamSearchRes, err error) {
|
||||
listRes = new(wxApplet.SysProjectTeamSearchRes)
|
||||
err = g.Try(ctx, func(ctx context.Context) {
|
||||
m := dao.SysProjectTeam.Ctx(ctx).WithAll()
|
||||
if req.ProjectId != "" {
|
||||
m = m.Where(dao.SysProjectTeam.Columns().ProjectId+" = ?", req.ProjectId)
|
||||
}
|
||||
if req.Name != "" {
|
||||
m = m.Where(dao.SysProjectTeam.Columns().Name+" like ?", "%"+req.Name+"%")
|
||||
}
|
||||
//创建时间模糊查询
|
||||
if req.CreateTime != "" {
|
||||
date := tool.New().GetFormattedDate(gconv.Time(req.CreateTime))
|
||||
m = m.Where(dao.SysProjectTeam.Columns().CreateTime+" like ?", "%"+date+"%")
|
||||
}
|
||||
if req.CreateTime != "" {
|
||||
m = m.Where(dao.SysProjectTeam.Columns().CreateTime+" = ?", gconv.Time(req.CreateTime))
|
||||
}
|
||||
listRes.Total, err = m.Count()
|
||||
liberr.ErrIsNil(ctx, err, "获取总行数失败")
|
||||
if req.PageNum == 0 {
|
||||
req.PageNum = 1
|
||||
}
|
||||
listRes.CurrentPage = req.PageNum
|
||||
if req.PageSize == 0 {
|
||||
req.PageSize = consts.PageSize
|
||||
}
|
||||
order := "id desc"
|
||||
if req.OrderBy != "" {
|
||||
order = req.OrderBy
|
||||
}
|
||||
var res []*model.SysProjectTeamInfoRes
|
||||
err = m.Fields(wxApplet.SysProjectTeamSearchRes{}).Page(req.PageNum, req.PageSize).Order(order).Scan(&res)
|
||||
liberr.ErrIsNil(ctx, err, "获取数据失败")
|
||||
listRes.List = make([]*model.SysProjectTeamListRes, len(res))
|
||||
for k, v := range res {
|
||||
listRes.List[k] = &model.SysProjectTeamListRes{
|
||||
Id: v.Id,
|
||||
ProjectId: v.ProjectId,
|
||||
Name: v.Name,
|
||||
IsClockIn: v.IsClockIn,
|
||||
CreateTime: v.CreateTime,
|
||||
}
|
||||
}
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
func (s *sSysProjectTeam) GetById(ctx context.Context, id int64) (res *model.SysProjectTeamInfoRes, err error) {
|
||||
err = g.Try(ctx, func(ctx context.Context) {
|
||||
err = dao.SysProjectTeam.Ctx(ctx).WithAll().Where(dao.SysProjectTeam.Columns().Id, id).Scan(&res)
|
||||
liberr.ErrIsNil(ctx, err, "获取信息失败")
|
||||
//获取创建人 更新人
|
||||
by := coryCommon.New().CreateByOrUpdateBy(ctx, res)
|
||||
infoRes := by.(model.SysProjectTeamInfoRes)
|
||||
res = &infoRes
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
func (s *sSysProjectTeam) Add(ctx context.Context, req *wxApplet.SysProjectTeamAddReq) (err error) {
|
||||
err = g.Try(ctx, func(ctx context.Context) {
|
||||
//1、判断班组名称是否存在
|
||||
count, err := dao.SysProjectTeam.
|
||||
Ctx(ctx).Where(dao.SysProjectTeam.Columns().ProjectId, req.ProjectId).
|
||||
Ctx(ctx).Where(dao.SysProjectTeam.Columns().Name, req.Name).
|
||||
Count()
|
||||
liberr.ErrIsNil(ctx, err, "获取班组名称失败")
|
||||
if count > 0 {
|
||||
liberr.ErrIsNil(ctx, errors.New("班组名称已存在"))
|
||||
return
|
||||
}
|
||||
name := ct.New().GetLoginUser(ctx).Id
|
||||
_, err = dao.SysProjectTeam.Ctx(ctx).Insert(do.SysProjectTeam{
|
||||
ProjectId: req.ProjectId,
|
||||
Name: req.Name,
|
||||
IsClockIn: req.IsClockIn,
|
||||
CreateBy: name,
|
||||
})
|
||||
liberr.ErrIsNil(ctx, err, "添加失败")
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
func (s *sSysProjectTeam) Edit(ctx context.Context, req *wxApplet.SysProjectTeamEditReq) (err error) {
|
||||
err = g.Try(ctx, func(ctx context.Context) {
|
||||
name := ct.New().GetLoginUser(ctx).Id
|
||||
count, err := dao.SysProjectTeam.Ctx(ctx).
|
||||
Where(dao.SysProjectTeam.Columns().ProjectId, req.ProjectId).
|
||||
Where(dao.SysProjectTeam.Columns().Name, req.Name).
|
||||
Count()
|
||||
liberr.ErrIsNil(ctx, err, "获取班组名称失败")
|
||||
if count > 0 {
|
||||
liberr.ErrIsNil(ctx, errors.New("班组名称已存在"))
|
||||
return
|
||||
}
|
||||
_, err = dao.SysProjectTeam.Ctx(ctx).WherePri(req.Id).Update(do.SysProjectTeam{
|
||||
ProjectId: req.ProjectId,
|
||||
Name: req.Name,
|
||||
UpdateBy: name,
|
||||
IsClockIn: req.IsClockIn,
|
||||
})
|
||||
liberr.ErrIsNil(ctx, err, "修改失败")
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
func (s *sSysProjectTeam) Delete(ctx context.Context, ids []int64) (err error) {
|
||||
g.DB().Transaction(ctx, func(ctx context.Context, tx gdb.TX) error {
|
||||
err = g.Try(ctx, func(ctx context.Context) {
|
||||
//1、删除组成员
|
||||
_, err = dao.SysProjectTeamMember.Ctx(ctx).Delete(dao.SysProjectTeamMember.Columns().TeamId+" in (?)", ids)
|
||||
//2、清除施工人员中关联到这个项目的人
|
||||
_, err = dao.BusConstructionUser.Ctx(ctx).Where(dao.SysProjectTeamMember.Columns().TeamId+" in (?)", ids).Update(g.Map{"team_id": nil})
|
||||
//2、删除组
|
||||
_, err = dao.SysProjectTeam.Ctx(ctx).Delete(dao.SysProjectTeam.Columns().Id+" in (?)", ids)
|
||||
liberr.ErrIsNil(ctx, err, "删除失败")
|
||||
})
|
||||
return err
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
// TeamOrGroupFunc 根据项目ID获取当前项目下的所有班组信息
|
||||
func TeamOrGroupFunc(ctx context.Context, id int64) (teamEntity []*model.SysProjectTeamListRes, err error) {
|
||||
err = g.Try(ctx, func(ctx context.Context) {
|
||||
err = dao.SysProjectTeam.Ctx(ctx).
|
||||
Where(dao.SysProjectTeam.Columns().ProjectId, id).Scan(&teamEntity)
|
||||
liberr.ErrIsNil(ctx, err, "删除失败")
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
// TeamFunc 根据班组ID获取班组信息
|
||||
func TeamFunc(ctx context.Context, id int64) (teamEntity []*model.SysProjectTeamListRes, err error) {
|
||||
err = g.Try(ctx, func(ctx context.Context) {
|
||||
err = dao.SysProjectTeam.Ctx(ctx).
|
||||
Where(dao.SysProjectTeam.Columns().Id, id).Scan(&teamEntity)
|
||||
liberr.ErrIsNil(ctx, err, "删除失败")
|
||||
})
|
||||
return
|
||||
}
|
||||
@ -0,0 +1,340 @@
|
||||
// ==========================================================================
|
||||
// GFast自动生成logic操作代码。
|
||||
// 生成日期:2023-08-15 09:34:52
|
||||
// 生成路径: internal/app/wxApplet/logic/sys_project_team_member.go
|
||||
// 生成人:gfast
|
||||
// desc:项目班组下的成员
|
||||
// company:云南奇讯科技有限公司
|
||||
// ==========================================================================
|
||||
|
||||
package logic
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"time"
|
||||
|
||||
"github.com/gogf/gf/v2/database/gdb"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/util/gconv"
|
||||
"github.com/samber/lo"
|
||||
"github.com/tiger1103/gfast/v3/api/wxApplet/wxApplet"
|
||||
"github.com/tiger1103/gfast/v3/internal/app/system/consts"
|
||||
sdao "github.com/tiger1103/gfast/v3/internal/app/system/dao"
|
||||
logic2 "github.com/tiger1103/gfast/v3/internal/app/system/logic/busConstructionUser"
|
||||
"github.com/tiger1103/gfast/v3/internal/app/wxApplet/dao"
|
||||
"github.com/tiger1103/gfast/v3/internal/app/wxApplet/model"
|
||||
"github.com/tiger1103/gfast/v3/internal/app/wxApplet/model/do"
|
||||
"github.com/tiger1103/gfast/v3/internal/app/wxApplet/service"
|
||||
"github.com/tiger1103/gfast/v3/library/liberr"
|
||||
tool "github.com/tiger1103/gfast/v3/utility/coryUtils"
|
||||
)
|
||||
|
||||
func init() {
|
||||
service.RegisterSysProjectTeamMember(New())
|
||||
}
|
||||
|
||||
func New() *sSysProjectTeamMember {
|
||||
return &sSysProjectTeamMember{}
|
||||
}
|
||||
|
||||
type sSysProjectTeamMember struct{}
|
||||
|
||||
func (s *sSysProjectTeamMember) List(ctx context.Context, req *wxApplet.SysProjectTeamMemberSearchReq) (listRes *wxApplet.SysProjectTeamMemberSearchRes, err error) {
|
||||
listRes = new(wxApplet.SysProjectTeamMemberSearchRes)
|
||||
err = g.Try(ctx, func(ctx context.Context) {
|
||||
// 获取人员名称
|
||||
var openids []string
|
||||
if req.UserName != "" {
|
||||
values, err := dao.BusConstructionUser.Ctx(ctx).Where("user_name like ?", "%"+req.UserName+"%").Fields("openid").Array()
|
||||
liberr.ErrIsNil(ctx, err, "获取数据失败")
|
||||
if len(values) > 0 {
|
||||
for i := range values {
|
||||
openids = append(openids, values[i].String())
|
||||
}
|
||||
}
|
||||
}
|
||||
m := dao.SysProjectTeamMember.Ctx(ctx)
|
||||
m = m.As("a").
|
||||
RightJoin("bus_construction_user as b on a.openid = b.openid").
|
||||
LeftJoin("bus_type_of_wage as c on b.type_of_work = c.type_of_work").
|
||||
Fields("a.*," +
|
||||
"b.head_icon," +
|
||||
"b.nick_name,b.user_name," +
|
||||
"b.phone," +
|
||||
"c.standard as original,b.salary")
|
||||
if req.TeamId != "" {
|
||||
m = m.Where("a."+dao.SysProjectTeamMember.Columns().TeamId+" = ?", gconv.Int64(req.TeamId))
|
||||
}
|
||||
if req.Openid != "" {
|
||||
m = m.Where("a."+dao.SysProjectTeamMember.Columns().Openid+" = ?", req.Openid)
|
||||
}
|
||||
if req.PostId != "" {
|
||||
m = m.Where("a."+dao.SysProjectTeamMember.Columns().PostId+" = ?", gconv.Int64(req.PostId))
|
||||
}
|
||||
if req.IsPcSysUser != "" && (req.IsPcSysUser != "1" || req.IsPcSysUser != "2") {
|
||||
m = m.Where("b.wx_or_pc", req.IsPcSysUser)
|
||||
}
|
||||
if len(openids) > 0 {
|
||||
m = m.Where("a.openid in (?) ", openids)
|
||||
}
|
||||
// 创建时间模糊查询
|
||||
if req.CreateTime != "" {
|
||||
date := tool.New().GetFormattedDate(gconv.Time(req.CreateTime))
|
||||
m = m.Where("a."+dao.SysProjectTeam.Columns().CreateTime+" like ?", "%"+date+"%")
|
||||
}
|
||||
if req.CreateTime != "" {
|
||||
m = m.Where("a."+dao.SysProjectTeamMember.Columns().UpdateTime+" = ?", gconv.Time(req.CreateTime))
|
||||
}
|
||||
m = m.Where("`a`.`deleted_at` IS NULL")
|
||||
m = m.Where("`b`.`deleted_at` IS NULL")
|
||||
array, err := m.Array()
|
||||
listRes.Total = len(array)
|
||||
liberr.ErrIsNil(ctx, err, "获取总行数失败")
|
||||
if req.PageNum == 0 {
|
||||
req.PageNum = 1
|
||||
}
|
||||
listRes.CurrentPage = req.PageNum
|
||||
if req.PageSize == 0 {
|
||||
req.PageSize = consts.PageSize
|
||||
}
|
||||
order := "id desc"
|
||||
if req.OrderBy != "" {
|
||||
order = req.OrderBy
|
||||
}
|
||||
var res []*model.SysProjectTeamMemberInfoRes
|
||||
err = m.Page(req.PageNum, req.PageSize).Order(order).Scan(&res)
|
||||
liberr.ErrIsNil(ctx, err, "获取数据失败")
|
||||
listRes.List = make([]*model.SysProjectTeamMemberListRes, len(res))
|
||||
for k, v := range res {
|
||||
// var sj *model.BusConstructionUserInfoRes
|
||||
// dao.BusConstructionUser.Ctx(ctx).Where("openid", v.Openid).Fields("user_name,nick_name").Scan(&sj)
|
||||
listRes.List[k] = &model.SysProjectTeamMemberListRes{
|
||||
Id: v.Id,
|
||||
TeamId: v.TeamId,
|
||||
Openid: v.Openid,
|
||||
PostId: v.PostId,
|
||||
// HeadIcon: v.HeadIcon,
|
||||
Phone: v.Phone,
|
||||
UserName: v.UserName,
|
||||
NickName: v.NickName,
|
||||
Original: v.Original,
|
||||
Salary: v.Salary,
|
||||
}
|
||||
}
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
func (s *sSysProjectTeamMember) GetById(ctx context.Context, id int64) (res *model.SysProjectTeamMemberInfoRes, err error) {
|
||||
err = g.Try(ctx, func(ctx context.Context) {
|
||||
err = dao.SysProjectTeamMember.Ctx(ctx).WithAll().Where(dao.SysProjectTeamMember.Columns().Id, id).Scan(&res)
|
||||
liberr.ErrIsNil(ctx, err, "获取信息失败")
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
func (s *sSysProjectTeamMember) Add(ctx context.Context, req *wxApplet.SysProjectTeamMemberAddReq) (err error) {
|
||||
err = g.DB().Transaction(ctx, func(ctx context.Context, tx gdb.TX) error {
|
||||
err = g.Try(ctx, func(ctx context.Context) {
|
||||
// 1、当前成员已经被添加就不允许再次添加
|
||||
// count, err := dao.SysProjectTeamMember.Ctx(ctx).Where("team_id", req.TeamId).Where("openid", req.Openid).Count()
|
||||
count, err := dao.SysProjectTeamMember.Ctx(ctx).Where("openid", req.Openid).Count()
|
||||
if count > 0 {
|
||||
err = errors.New("当前成员已分配组!")
|
||||
liberr.ErrIsNil(ctx, err)
|
||||
return
|
||||
}
|
||||
// 2、获取当前项目的班组长openid
|
||||
value, err := dao.SysProjectTeamMember.Ctx(ctx).Where("team_id", req.TeamId).Where("post_id", "10").Fields("openid").Value()
|
||||
liberr.ErrIsNil(ctx, err)
|
||||
originalOpenid := value.String()
|
||||
if req.PostId == 10 {
|
||||
// 新增数据如果是组长,那么就将当前组的所有成员修改为组员
|
||||
_, err = dao.SysProjectTeamMember.Ctx(ctx).Where("team_id", req.TeamId).Update(g.Map{"post_id": 4})
|
||||
liberr.ErrIsNil(ctx, err, "新增班组长失败")
|
||||
}
|
||||
// 删除班组长这个角色,如果当前用户没得班组长也不影响,不管如何先删再说
|
||||
if originalOpenid != "" {
|
||||
err := OpenidByDelFunc(ctx, originalOpenid)
|
||||
liberr.ErrIsNil(ctx, err, "班组长交接失败")
|
||||
}
|
||||
// 新增数据
|
||||
value, err = dao.SysProjectTeam.Ctx(ctx).WherePri(req.TeamId).Fields("project_id").Value()
|
||||
_, err = dao.SysProjectTeamMember.Ctx(ctx).Insert(do.SysProjectTeamMember{
|
||||
TeamId: req.TeamId,
|
||||
Openid: req.Openid,
|
||||
PostId: req.PostId,
|
||||
ProjectId: value,
|
||||
})
|
||||
openidValue, err := dao.SysProjectTeamMember.Ctx(ctx).Where("team_id", req.TeamId).Where("post_id", "10").Fields("openid").Value()
|
||||
liberr.ErrIsNil(ctx, err)
|
||||
if openidValue.String() != "" {
|
||||
err := OpenidByAddFunc(ctx, openidValue.String())
|
||||
liberr.ErrIsNil(ctx, err)
|
||||
}
|
||||
////如果与元原来班组长的补卡申请未处理完毕,那么就由新的班组长接任处理
|
||||
//_, err = g.DB().Model("bus_reissue_a_card").
|
||||
// Where("ganger", originalOpenid).
|
||||
// Where("ganger_opinion", "1").
|
||||
// Update(g.Map{"ganger": req.Openid})
|
||||
//liberr.ErrIsNil(ctx, err, "新增失败")
|
||||
//新增完还得操作一下用户的team_id字段
|
||||
now := time.Now()
|
||||
date := tool.New().GetFormattedDateTime(now)
|
||||
g2 := g.Map{
|
||||
"team_id": req.TeamId,
|
||||
"project_id": value,
|
||||
//"type_of_work": req.TypeOfWork,
|
||||
//"native_place": req.NativePlace,
|
||||
"entry_date": date,
|
||||
"leave_date": "",
|
||||
}
|
||||
_, err = dao.BusConstructionUser.Ctx(ctx).Where("openid", req.Openid).Update(g2)
|
||||
liberr.ErrIsNil(ctx, err, "修改失败")
|
||||
|
||||
subQuery := g.Model("sys_user").As("su").LeftJoin("bus_construction_user bcu", "bcu.phone = su.mobile").Where("bcu.openid", req.Openid).Fields("su.id")
|
||||
//user_id := lo.Must(subQuery.Value()).Int()
|
||||
user_ids, err := subQuery.Value()
|
||||
liberr.ErrIsNil(ctx, err, "修改失败")
|
||||
|
||||
user_id := user_ids.Int()
|
||||
|
||||
if req.PostId == 4 { // 删除班组长角色菜单,添加施工人员角色菜单
|
||||
_, err = sdao.AppUserRoles.Ctx(ctx).Where("user_id = ?", user_id).Where("role_id", 1).Where("major_role", 1).Delete()
|
||||
liberr.ErrIsNil(ctx, err, "修改失败")
|
||||
sdao.AppUserRoles.Ctx(ctx).Where("user_id = ?", user_id).Data(g.Map{"role_id": 2, "major_role": 1, "user_id": user_id}).Insert()
|
||||
} else if req.PostId == 10 { // 添加班组长角色菜单
|
||||
// 添加班组长角色
|
||||
_, err = sdao.AppUserRoles.Ctx(ctx).Where("user_id = ?", user_id).Where("role_id", 1).Where("major_role", 1).Delete()
|
||||
_, err := sdao.AppUserRoles.Ctx(ctx).Where("user_id = ?", user_id).Data(g.Map{"role_id": 1, "major_role": 1, "user_id": user_id}).Insert()
|
||||
liberr.ErrIsNil(ctx, err, "修改失败")
|
||||
}
|
||||
|
||||
})
|
||||
return err
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
func (s *sSysProjectTeamMember) Edit(ctx context.Context, req *wxApplet.SysProjectTeamMemberEditReq) (err error) {
|
||||
err = g.DB().Transaction(ctx, func(ctx context.Context, tx gdb.TX) error {
|
||||
err = g.Try(ctx, func(ctx context.Context) {
|
||||
// 1、新增数据如果是组长,那么就将当前组的所有成员修改为组员
|
||||
value, err := dao.SysProjectTeamMember.Ctx(ctx).Where("team_id", req.TeamId).Where("post_id", "10").Fields("openid").Value()
|
||||
originalOpenid := value.String()
|
||||
if req.PostId == 10 {
|
||||
_, err = dao.SysProjectTeamMember.Ctx(ctx).Where("team_id", req.TeamId).Update(g.Map{"post_id": 4})
|
||||
liberr.ErrIsNil(ctx, err, "修改失败")
|
||||
}
|
||||
|
||||
subQuery := g.Model("sys_user").As("su").LeftJoin("bus_construction_user bcu", "bcu.phone = su.mobile").Where("bcu.openid", req.Openid).Fields("su.id")
|
||||
user_id := lo.Must(subQuery.Value()).Int()
|
||||
if req.PostId == 4 { // 删除班组长角色菜单,添加施工人员角色菜单
|
||||
_, err = sdao.AppUserRoles.Ctx(ctx).Where("user_id = ?", user_id).Where("role_id", 1).Where("major_role", 1).Delete()
|
||||
liberr.ErrIsNil(ctx, err, "修改失败")
|
||||
sdao.AppUserRoles.Ctx(ctx).Where("user_id = ?", user_id).Data(g.Map{"role_id": 2, "major_role": 1, "user_id": user_id}).Insert()
|
||||
} else if req.PostId == 10 { // 添加班组长角色菜单
|
||||
// 添加班组长角色
|
||||
_, err = sdao.AppUserRoles.Ctx(ctx).Where("user_id = ?", user_id).Where("role_id", 1).Where("major_role", 1).Delete()
|
||||
_, err := sdao.AppUserRoles.Ctx(ctx).Where("user_id = ?", user_id).Data(g.Map{"role_id": 1, "major_role": 1, "user_id": user_id}).Insert()
|
||||
liberr.ErrIsNil(ctx, err, "修改失败")
|
||||
}
|
||||
|
||||
// 2、删除班组长角色,不管如何先删再说
|
||||
if originalOpenid != "" {
|
||||
err := OpenidByDelFunc(ctx, originalOpenid)
|
||||
liberr.ErrIsNil(ctx, err, "班组长交接失败")
|
||||
}
|
||||
// 3、修改用户信息
|
||||
value, err = dao.SysProjectTeam.Ctx(ctx).WherePri(req.TeamId).Fields("project_id").Value()
|
||||
_, err = dao.SysProjectTeamMember.Ctx(ctx).WherePri(req.Id).Update(do.SysProjectTeamMember{
|
||||
TeamId: req.TeamId,
|
||||
ProjectId: value,
|
||||
Openid: req.Openid,
|
||||
PostId: req.PostId,
|
||||
})
|
||||
// 4、查询是否有班组长,有就增加班组长角色
|
||||
openidValue, err := dao.SysProjectTeamMember.Ctx(ctx).Where("team_id", req.TeamId).Where("post_id", "10").Fields("openid").Value()
|
||||
liberr.ErrIsNil(ctx, err)
|
||||
if openidValue.String() != "" {
|
||||
err := OpenidByAddFunc(ctx, openidValue.String())
|
||||
liberr.ErrIsNil(ctx, err)
|
||||
}
|
||||
// 5、如果与原来班组长的补卡申请未处理完毕,那么就由新的班组长接任处理
|
||||
_, err = g.DB().Model("bus_reissue_a_card").
|
||||
Where("ganger", originalOpenid).
|
||||
Where("ganger_opinion", "1").
|
||||
Update(g.Map{"ganger": req.Openid})
|
||||
liberr.ErrIsNil(ctx, err, "新增失败")
|
||||
////如果是离场就操作一下施工人员,并且删除成员
|
||||
//if req.SiteNum == "2" {
|
||||
// g2 := g.Map{
|
||||
// "leave_date": tool.New().GetFormattedDateTime(time.Now()),
|
||||
// "team_id": nil,
|
||||
// "project_id": nil,
|
||||
// "if_management": nil,
|
||||
// }
|
||||
// _, err = dao.BusConstructionUser.Ctx(ctx).Where("openid", req.Openid).Update(g2)
|
||||
// //1、查询数据
|
||||
// value, err := dao.SysProjectTeamMember.Ctx(ctx).WherePri(req.Id).Fields("openid").Value()
|
||||
// //2、更新数据
|
||||
// _, err = dao.BusConstructionUser.Ctx(ctx).Where("openid", value.String()).Update(g.Map{"team_id": nil, "if_management": ""})
|
||||
// liberr.ErrIsNil(ctx, err, "删除失败")
|
||||
// //3、删除成员
|
||||
// _, err = dao.SysProjectTeamMember.Ctx(ctx).Delete(dao.SysProjectTeamMember.Columns().Id+" = ", req.Id)
|
||||
// liberr.ErrIsNil(ctx, err, "删除失败")
|
||||
//}
|
||||
liberr.ErrIsNil(ctx, err, "修改失败")
|
||||
})
|
||||
return err
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
// OpenidByDelFunc 根据openid查询用户删除班组长角色
|
||||
func OpenidByDelFunc(ctx context.Context, openid string) error {
|
||||
v, err := dao.BusConstructionUser.Ctx(ctx).Where(dao.BusConstructionUser.Columns().Openid, openid).Fields("id").Value()
|
||||
_, err = g.DB().Model("sys_wechat_user_role").Ctx(ctx).
|
||||
Where("user_id", v).
|
||||
Where("role_id = 4").
|
||||
Delete("user_id", v)
|
||||
return err
|
||||
}
|
||||
|
||||
// OpenidByAddFunc 根据openid查询用户增加班组长角色
|
||||
func OpenidByAddFunc(ctx context.Context, openid string) error {
|
||||
// 根据openid去获取到微信用户的主键ID
|
||||
v, err := dao.BusConstructionUser.Ctx(ctx).Where(dao.BusConstructionUser.Columns().Openid, openid).Fields("id").Value()
|
||||
liberr.ErrIsNil(ctx, err)
|
||||
// 给当前用户追加班组长角色
|
||||
var roleIds []int64
|
||||
roleIds = append(roleIds, 4)
|
||||
err = logic2.InsertRoleModuleFunc(ctx, roleIds, v.Int64())
|
||||
return err
|
||||
}
|
||||
|
||||
// 删除先不用给干掉
|
||||
func (s *sSysProjectTeamMember) Delete(ctx context.Context, ids []int64) (err error) {
|
||||
//err = g.DB().Transaction(ctx, func(ctx context.Context, tx gdb.TX) error {
|
||||
// //err = g.Try(ctx, func(ctx context.Context) {
|
||||
// // for _, dataId := range ids {
|
||||
// // //1、查询数据
|
||||
// // value, err := dao.SysProjectTeamMember.Ctx(ctx).WherePri(dataId).Fields("openid").Value()
|
||||
// // //2、更新数据
|
||||
// // g2 := g.Map{
|
||||
// // "leave_date": tool.New().GetFormattedDateTime(time.Now()),
|
||||
// // "team_id": nil,
|
||||
// // "if_management": nil,
|
||||
// // }
|
||||
// // _, err = dao.BusConstructionUser.Ctx(ctx).Where("openid", value.String()).Update(g2)
|
||||
// // liberr.ErrIsNil(ctx, err, "删除失败")
|
||||
// // }
|
||||
// // //3、删除成员
|
||||
// // _, err = dao.SysProjectTeamMember.Ctx(ctx).Delete(dao.SysProjectTeamMember.Columns().Id+" in (?)", ids)
|
||||
// // liberr.ErrIsNil(ctx, err, "删除失败")
|
||||
// //})
|
||||
// //return err
|
||||
//})
|
||||
return err
|
||||
}
|
||||
@ -0,0 +1,322 @@
|
||||
// ==========================================================================
|
||||
// GFast自动生成logic操作代码。
|
||||
// 生成日期:2023-08-30 15:24:06
|
||||
// 生成路径: internal/app/wxApplet/logic/sys_project_team_squad.go
|
||||
// 生成人:gfast
|
||||
// desc:站班会
|
||||
// company:云南奇讯科技有限公司
|
||||
// ==========================================================================
|
||||
|
||||
package logic
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"github.com/gogf/gf/v2/database/gdb"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/tiger1103/gfast/v3/api/wxApplet/wxApplet"
|
||||
"github.com/tiger1103/gfast/v3/internal/app/system/consts"
|
||||
busFolderFile "github.com/tiger1103/gfast/v3/internal/app/system/logic/busFolderFile"
|
||||
"github.com/tiger1103/gfast/v3/internal/app/wxApplet/dao"
|
||||
"github.com/tiger1103/gfast/v3/internal/app/wxApplet/model"
|
||||
"github.com/tiger1103/gfast/v3/internal/app/wxApplet/model/do"
|
||||
"github.com/tiger1103/gfast/v3/internal/app/wxApplet/service"
|
||||
"github.com/tiger1103/gfast/v3/library/liberr"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func init() {
|
||||
service.RegisterSysProjectTeamSquad(New())
|
||||
}
|
||||
|
||||
func New() *sSysProjectTeamSquad {
|
||||
return &sSysProjectTeamSquad{}
|
||||
}
|
||||
|
||||
type sSysProjectTeamSquad struct{}
|
||||
|
||||
func (s *sSysProjectTeamSquad) SelectByOpenidTeamSquadSearch(ctx context.Context, req *wxApplet.SelectByOpenidTeamSquadSearchReq) (listRes *wxApplet.SelectByOpenidTeamSquadSearchRes, err error) {
|
||||
listRes = new(wxApplet.SelectByOpenidTeamSquadSearchRes)
|
||||
err = g.Try(ctx, func(ctx context.Context) {
|
||||
m := dao.SysProjectTeamSquad.Ctx(ctx).WithAll().As("a").
|
||||
LeftJoin("bus_construction_user as b on a.compere_id = b.openid").
|
||||
Fields(
|
||||
"DISTINCT a.id as s,a.*," +
|
||||
"CASE WHEN b.user_name IS NULL OR b.user_name = '' THEN b.nick_name ELSE b.user_name END AS compere_name")
|
||||
if req.Openid != "" {
|
||||
m = m.Where("a."+dao.SysProjectTeamSquad.Columns().CompereId, req.Openid)
|
||||
}
|
||||
//创建时间模糊查询
|
||||
if req.MeetingDate != "" {
|
||||
m = m.Where("a."+dao.SysProjectTeamSquad.Columns().MeetingDate+" like ?", "%"+req.MeetingDate+"%")
|
||||
}
|
||||
if len(req.DateRange) != 0 {
|
||||
m = m.Where("a."+dao.SysProjectTeamSquad.Columns().CreatedAt+" >=? AND "+"a."+dao.SysProjectTeamSquad.Columns().CreatedAt+" <=?", req.DateRange[0], req.DateRange[1])
|
||||
}
|
||||
array, err := m.Array()
|
||||
listRes.Total = len(array)
|
||||
liberr.ErrIsNil(ctx, err, "获取总行数失败")
|
||||
if req.PageNum == 0 {
|
||||
req.PageNum = 1
|
||||
}
|
||||
listRes.CurrentPage = req.PageNum
|
||||
if req.PageSize == 0 {
|
||||
req.PageSize = consts.PageSize
|
||||
}
|
||||
order := "id desc"
|
||||
if req.OrderBy != "" {
|
||||
order = req.OrderBy
|
||||
}
|
||||
var res []*model.SysProjectTeamSquadInfoRes
|
||||
err = m.Fields(wxApplet.SysProjectTeamSquadSearchRes{}).Page(req.PageNum, req.PageSize).Order(order).Scan(&res)
|
||||
liberr.ErrIsNil(ctx, err, "获取数据失败")
|
||||
listRes.List = make([]*model.SysProjectTeamSquadListRes, len(res))
|
||||
for k, v := range res {
|
||||
////单独获取参与人的名称
|
||||
//str := ""
|
||||
//split := strings.Split(v.ParticipantId, ",")
|
||||
//for i := range split {
|
||||
// str = str + "'" + split[i] + "',"
|
||||
// if i == len(split)-1 {
|
||||
// str = str + "'" + split[i] + "'"
|
||||
// } else {
|
||||
// str = str + "'" + split[i] + "',"
|
||||
// }
|
||||
//}
|
||||
//name, _ := dao.BusConstructionUser.Ctx(ctx).
|
||||
// Where("openid in (" + str + ")").
|
||||
// Fields("GROUP_CONCAT(CASE WHEN user_name IS NULL OR user_name = '' THEN nick_name ELSE user_name END) AS participant_name").Value()
|
||||
listRes.List[k] = &model.SysProjectTeamSquadListRes{
|
||||
Id: v.Id,
|
||||
TeamId: v.TeamId,
|
||||
MeetingDate: v.MeetingDate,
|
||||
CompereId: v.CompereId,
|
||||
ParticipantId: v.ParticipantId,
|
||||
Content: v.Content,
|
||||
Picture: v.Picture,
|
||||
CreatedAt: v.CreatedAt,
|
||||
TeamName: v.TeamName,
|
||||
LabourserviceName: v.LabourserviceName,
|
||||
CompereName: v.CompereName,
|
||||
//ParticipantName: name.String(),
|
||||
}
|
||||
}
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
func (s *sSysProjectTeamSquad) List(ctx context.Context, req *wxApplet.SysProjectTeamSquadSearchReq) (listRes *wxApplet.SysProjectTeamSquadSearchRes, err error) {
|
||||
listRes = new(wxApplet.SysProjectTeamSquadSearchRes)
|
||||
err = g.Try(ctx, func(ctx context.Context) {
|
||||
m := dao.SysProjectTeamSquad.Ctx(ctx).WithAll().As("a").
|
||||
LeftJoin("bus_construction_user as b on a.compere_id = b.openid").
|
||||
Fields(
|
||||
"DISTINCT a.id as s,a.*," +
|
||||
"CASE WHEN b.user_name IS NULL OR b.user_name = '' THEN b.nick_name ELSE b.user_name END AS compere_name")
|
||||
|
||||
if req.ProjectId != "" {
|
||||
m = m.Where("a."+dao.SysProjectTeamSquad.Columns().ProjectId, req.ProjectId)
|
||||
}
|
||||
//创建时间模糊查询
|
||||
if req.MeetingDate != "" {
|
||||
m = m.Where("a."+dao.SysProjectTeamSquad.Columns().MeetingDate+" like ?", "%"+req.MeetingDate+"%")
|
||||
}
|
||||
////创建时间模糊查询
|
||||
//if req.CreatedAt != "" {
|
||||
// date := tool.New().GetFormattedDate(gconv.Time(req.CreatedAt))
|
||||
// m = m.Where("a."+dao.SysProjectTeamSquad.Columns().CreatedAt+" like ?", "%"+date+"%")
|
||||
//}
|
||||
if len(req.DateRange) != 0 {
|
||||
m = m.Where("a."+dao.SysProjectTeamSquad.Columns().CreatedAt+" >=? AND "+"a."+dao.SysProjectTeamSquad.Columns().CreatedAt+" <=?", req.DateRange[0], req.DateRange[1])
|
||||
}
|
||||
array, err := m.Array()
|
||||
listRes.Total = len(array)
|
||||
liberr.ErrIsNil(ctx, err, "获取总行数失败")
|
||||
if req.PageNum == 0 {
|
||||
req.PageNum = 1
|
||||
}
|
||||
listRes.CurrentPage = req.PageNum
|
||||
if req.PageSize == 0 {
|
||||
req.PageSize = consts.PageSize
|
||||
}
|
||||
order := "id desc"
|
||||
if req.OrderBy != "" {
|
||||
order = req.OrderBy
|
||||
}
|
||||
var res []*model.SysProjectTeamSquadInfoRes
|
||||
err = m.Fields(wxApplet.SysProjectTeamSquadSearchRes{}).Page(req.PageNum, req.PageSize).Order(order).Scan(&res)
|
||||
liberr.ErrIsNil(ctx, err, "获取数据失败")
|
||||
listRes.List = make([]*model.SysProjectTeamSquadListRes, len(res))
|
||||
for k, v := range res {
|
||||
////单独获取参与人的名称
|
||||
//str := ""
|
||||
//split := strings.Split(v.ParticipantId, ",")
|
||||
//for i := range split {
|
||||
// str = str + "'" + split[i] + "',"
|
||||
// if i == len(split)-1 {
|
||||
// str = str + "'" + split[i] + "'"
|
||||
// } else {
|
||||
// str = str + "'" + split[i] + "',"
|
||||
// }
|
||||
//}
|
||||
//name, _ := dao.BusConstructionUser.Ctx(ctx).
|
||||
// Where("openid in (" + str + ")").
|
||||
// Fields("GROUP_CONCAT(CASE WHEN user_name IS NULL OR user_name = '' THEN nick_name ELSE user_name END) AS participant_name").Value()
|
||||
listRes.List[k] = &model.SysProjectTeamSquadListRes{
|
||||
Id: v.Id,
|
||||
TeamId: v.TeamId,
|
||||
MeetingDate: v.MeetingDate,
|
||||
CompereId: v.CompereId,
|
||||
ParticipantId: v.ParticipantId,
|
||||
Content: v.Content,
|
||||
Picture: v.Picture,
|
||||
CreatedAt: v.CreatedAt,
|
||||
TeamName: v.TeamName,
|
||||
LabourserviceName: v.LabourserviceName,
|
||||
CompereName: v.CompereName,
|
||||
//ParticipantName: name.String(),
|
||||
}
|
||||
}
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
func (s *sSysProjectTeamSquad) GetById(ctx context.Context, id int64) (res *model.SysProjectTeamSquadInfoRes, err error) {
|
||||
err = g.Try(ctx, func(ctx context.Context) {
|
||||
err = dao.SysProjectTeamSquad.Ctx(ctx).WithAll().As("a").
|
||||
LeftJoin("bus_construction_user as b on a.compere_id = b.openid").
|
||||
Fields(
|
||||
"a.*,"+
|
||||
"CASE WHEN b.user_name IS NULL OR b.user_name = '' THEN b.nick_name ELSE b.user_name END AS compere_name").
|
||||
Where("a."+dao.SysProjectTeamSquad.Columns().Id, id).Scan(&res)
|
||||
//单独获取参与人的名称
|
||||
str := ""
|
||||
split := strings.Split(res.ParticipantId, ",")
|
||||
for i := range split {
|
||||
str = str + "'" + split[i] + "',"
|
||||
if i == len(split)-1 {
|
||||
str = str + "'" + split[i] + "'"
|
||||
} else {
|
||||
str = str + "'" + split[i] + "',"
|
||||
}
|
||||
}
|
||||
name, _ := dao.BusConstructionUser.Ctx(ctx).
|
||||
Where("openid in (" + str + ")").
|
||||
Fields("GROUP_CONCAT(CASE WHEN user_name IS NULL OR user_name = '' THEN nick_name ELSE user_name END) AS participant_name").Value()
|
||||
res.ParticipantName = name.String()
|
||||
liberr.ErrIsNil(ctx, err, "获取信息失败")
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
func (s *sSysProjectTeamSquad) Add(ctx context.Context, req *wxApplet.SysProjectTeamSquadAddReq) (err error) {
|
||||
err = g.DB().Transaction(ctx, func(ctx context.Context, tx gdb.TX) error {
|
||||
//err = g.Try(ctx, func(ctx context.Context) {
|
||||
//1、校验当前人是否在此班组下
|
||||
count, err := dao.SysProjectTeamMember.Ctx(ctx).Where("team_id", req.TeamId).Where("openid", req.CompereId).Count()
|
||||
if count == 0 {
|
||||
err = errors.New("操作人与班组有误!")
|
||||
}
|
||||
splitStr := strings.Split(req.Picture, ",")
|
||||
req.Picture = ""
|
||||
for _, img := range splitStr {
|
||||
req.Picture = req.Picture + strings.ReplaceAll(img, "/file", "/wxfile") + ","
|
||||
}
|
||||
req.Picture = strings.TrimRight(req.Picture, ",")
|
||||
//2、数据组装
|
||||
value, err := dao.SysProjectTeam.Ctx(ctx).WherePri(req.TeamId).Fields("project_id").Value()
|
||||
squad := do.SysProjectTeamSquad{
|
||||
TeamId: req.TeamId,
|
||||
ProjectId: value,
|
||||
MeetingDate: req.MeetingDate,
|
||||
CompereId: req.CompereId,
|
||||
ParticipantId: req.ParticipantId,
|
||||
Content: req.Content,
|
||||
Picture: req.Picture,
|
||||
}
|
||||
//3、填充 班组名称、劳务公司名称
|
||||
var wxUserEntity *model.BusConstructionUserInfoRes
|
||||
dao.BusConstructionUser.Ctx(ctx).Where("openid", req.CompereId).Scan(&wxUserEntity)
|
||||
if wxUserEntity != nil {
|
||||
//获取班组名称
|
||||
var spt *model.SysProjectTeamInfoRes
|
||||
err := dao.SysProjectTeam.Ctx(ctx).WherePri(req.TeamId).Scan(&spt)
|
||||
if err != nil || spt == nil {
|
||||
err = errors.New("代码错误,请联系管理员!")
|
||||
//return
|
||||
}
|
||||
//bzName, _ := dao.SysProjectTeam.Ctx(ctx).WherePri(req.TeamId).Fields("name").Value()
|
||||
//获取劳务名称
|
||||
lwName, _ := dao.BusLabourservice.Ctx(ctx).WherePri(wxUserEntity.LabourserviceId).Fields("name").Value()
|
||||
squad.ProjectId = spt.ProjectId
|
||||
squad.TeamName = spt.Name
|
||||
squad.LabourserviceName = lwName.String()
|
||||
}
|
||||
//4、新增数据
|
||||
dataInfo, err := dao.SysProjectTeamSquad.Ctx(ctx).Insert(squad)
|
||||
id, err := dataInfo.LastInsertId()
|
||||
|
||||
////百度转高德
|
||||
//split := strings.Split(req.LongitudeAndLatitude, ",")
|
||||
//lon, err := strconv.ParseFloat(split[0], 64)
|
||||
//lat, err := strconv.ParseFloat(split[1], 64)
|
||||
//gcj021, gcj022 := coryCommon.BD09toGCJ02(lon, lat)
|
||||
//req.LongitudeAndLatitude = fmt.Sprintf("%.2f", gcj021) + "," + fmt.Sprintf("%.2f", gcj022)
|
||||
////逆编码
|
||||
//var res *coryCommon.InverseGeocodingRep
|
||||
//we := coryCommon.InverseGeocoding(req.LongitudeAndLatitude)
|
||||
//bodyData := []byte(we)
|
||||
//err = json.Unmarshal(bodyData, &res)
|
||||
//if err != nil {
|
||||
// fmt.Println("Failed to parse JSON data:", err)
|
||||
// return err
|
||||
//}
|
||||
////s2 := squad.TeamName.(string)
|
||||
//site := res.Regeocode.FormattedAddress
|
||||
//v, err := dao.BusConstructionUser.Ctx(ctx).Where("openid", req.CompereId).Fields("IFNULL(user_name,nick_name) as bzzName").Value()
|
||||
//meetingDate := req.MeetingDate.Format("Y-m-d")
|
||||
//给图片添加水印
|
||||
//go coryCommon.MultiPicture(req.Picture, v.String(), meetingDate, site, squad.TeamName.(string), squad.LabourserviceName.(string))
|
||||
//5、将图片信息添加到图库中
|
||||
pe := strings.Split(req.Picture, ",")
|
||||
err = busFolderFile.New().AllPicture(ctx,
|
||||
pe,
|
||||
2,
|
||||
dao.SysProjectTeamSquad.Table(),
|
||||
id,
|
||||
"2",
|
||||
req.CompereId,
|
||||
"",
|
||||
value.Int64(),
|
||||
)
|
||||
liberr.ErrIsNil(ctx, err, "添加失败")
|
||||
return err
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
func (s *sSysProjectTeamSquad) Edit(ctx context.Context, req *wxApplet.SysProjectTeamSquadEditReq) (err error) {
|
||||
err = g.Try(ctx, func(ctx context.Context) {
|
||||
_, err = dao.SysProjectTeamSquad.Ctx(ctx).WherePri(req.Id).Update(do.SysProjectTeamSquad{})
|
||||
liberr.ErrIsNil(ctx, err, "修改失败")
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
func (s *sSysProjectTeamSquad) Delete(ctx context.Context, ids []int64) (err error) {
|
||||
err = g.DB().Transaction(ctx, func(ctx context.Context, tx gdb.TX) error {
|
||||
err = g.Try(ctx, func(ctx context.Context) {
|
||||
//删除图库
|
||||
err = busFolderFile.New().AllDelete(
|
||||
ctx,
|
||||
dao.SysProjectTeamSquad.Table(),
|
||||
ids,
|
||||
)
|
||||
//删除站班会
|
||||
_, err = dao.SysProjectTeamSquad.Ctx(ctx).Delete(dao.SysProjectTeamSquad.Columns().Id+" in (?)", ids)
|
||||
liberr.ErrIsNil(ctx, err, "删除失败")
|
||||
})
|
||||
return err
|
||||
})
|
||||
return
|
||||
}
|
||||
@ -0,0 +1,143 @@
|
||||
// ==========================================================================
|
||||
// GFast自动生成logic操作代码。
|
||||
// 生成日期:2023-08-21 09:19:15
|
||||
// 生成路径: internal/app/wxApplet/logic/sys_user_project_relevancy.go
|
||||
// 生成人:gfast
|
||||
// desc:系统用户与项目关联
|
||||
// company:云南奇讯科技有限公司
|
||||
// ==========================================================================
|
||||
|
||||
package logic
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/util/gconv"
|
||||
"github.com/tiger1103/gfast/v3/api/v1/common/coryCommon"
|
||||
"github.com/tiger1103/gfast/v3/api/wxApplet/wxApplet"
|
||||
"github.com/tiger1103/gfast/v3/internal/app/system/consts"
|
||||
ct "github.com/tiger1103/gfast/v3/internal/app/system/logic/context"
|
||||
"github.com/tiger1103/gfast/v3/internal/app/wxApplet/dao"
|
||||
"github.com/tiger1103/gfast/v3/internal/app/wxApplet/model"
|
||||
"github.com/tiger1103/gfast/v3/internal/app/wxApplet/model/do"
|
||||
"github.com/tiger1103/gfast/v3/internal/app/wxApplet/service"
|
||||
"github.com/tiger1103/gfast/v3/library/liberr"
|
||||
tool "github.com/tiger1103/gfast/v3/utility/coryUtils"
|
||||
)
|
||||
|
||||
func init() {
|
||||
service.RegisterSysUserProjectRelevancy(New())
|
||||
}
|
||||
|
||||
func New() *sSysUserProjectRelevancy {
|
||||
return &sSysUserProjectRelevancy{}
|
||||
}
|
||||
|
||||
type sSysUserProjectRelevancy struct{}
|
||||
|
||||
func (s *sSysUserProjectRelevancy) List(ctx context.Context, req *wxApplet.SysUserProjectRelevancySearchReq) (listRes *wxApplet.SysUserProjectRelevancySearchRes, err error) {
|
||||
listRes = new(wxApplet.SysUserProjectRelevancySearchRes)
|
||||
err = g.Try(ctx, func(ctx context.Context) {
|
||||
m := dao.SysUserProjectRelevancy.Ctx(ctx).WithAll().As("a").
|
||||
LeftJoin("sys_project as b on a.project_id = b.id").
|
||||
Fields(`a.*,
|
||||
CASE WHEN (b.short_name IS NULL OR b.project_name = '') THEN b.project_name ELSE b.short_name END AS project_name,
|
||||
b.lng,b.lat,b.type,b.project_site`)
|
||||
if req.UserId != "" {
|
||||
m = m.Where("a."+dao.SysUserProjectRelevancy.Columns().UserId+" = ?", gconv.Int64(req.UserId))
|
||||
}
|
||||
if req.ProjectId != "" {
|
||||
m = m.Where("a."+dao.SysUserProjectRelevancy.Columns().ProjectId+" = ?", gconv.Int64(req.ProjectId))
|
||||
}
|
||||
if len(req.DateRange) != 0 {
|
||||
m = m.Where("a."+dao.SysUserProjectRelevancy.Columns().CreatedAt+" >=? AND "+dao.SysUserProjectRelevancy.Columns().CreatedAt+" <=?", req.DateRange[0], req.DateRange[1])
|
||||
}
|
||||
// 创建时间模糊查询
|
||||
if req.CreatedAt != "" {
|
||||
date := tool.New().GetFormattedDate(gconv.Time(req.CreatedAt))
|
||||
m = m.Where("a."+dao.SysUserProjectRelevancy.Columns().CreatedAt+" like ?", "%"+date+"%")
|
||||
}
|
||||
array, err := m.Array()
|
||||
listRes.Total = len(array)
|
||||
liberr.ErrIsNil(ctx, err, "获取总行数失败")
|
||||
if req.PageNum == 0 {
|
||||
req.PageNum = 1
|
||||
}
|
||||
listRes.CurrentPage = req.PageNum
|
||||
if req.PageSize == 0 {
|
||||
req.PageSize = consts.PageSize
|
||||
}
|
||||
order := "id desc"
|
||||
if req.OrderBy != "" {
|
||||
order = req.OrderBy
|
||||
}
|
||||
var res []*model.SysUserProjectRelevancyInfoRes
|
||||
err = m.Page(req.PageNum, req.PageSize).Order(order).Scan(&res)
|
||||
liberr.ErrIsNil(ctx, err, "获取数据失败")
|
||||
listRes.List = make([]*model.SysUserProjectRelevancyListRes, len(res))
|
||||
for k, v := range res {
|
||||
listRes.List[k] = &model.SysUserProjectRelevancyListRes{
|
||||
Id: v.Id,
|
||||
UserId: v.UserId,
|
||||
ProjectId: v.ProjectId,
|
||||
CreatedAt: v.CreatedAt,
|
||||
ProjectName: v.ProjectName,
|
||||
Lng: v.Lng,
|
||||
Lat: v.Lat,
|
||||
Type: v.Type,
|
||||
ProjectSite: v.ProjectSite,
|
||||
}
|
||||
}
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
func (s *sSysUserProjectRelevancy) GetById(ctx context.Context, id int64) (res *model.SysUserProjectRelevancyInfoRes, err error) {
|
||||
err = g.Try(ctx, func(ctx context.Context) {
|
||||
err = dao.SysUserProjectRelevancy.Ctx(ctx).WithAll().As("a").
|
||||
LeftJoin("sys_project as b on a.project_id = b.id").
|
||||
Fields("a.*,b.project_name,b.lng,b.lat").
|
||||
Where("a."+dao.SysUserProjectRelevancy.Columns().Id, id).Scan(&res)
|
||||
liberr.ErrIsNil(ctx, err, "获取信息失败")
|
||||
// 获取创建人 更新人
|
||||
by := coryCommon.New().CreateByOrUpdateBy(ctx, res)
|
||||
infoRes := by.(model.SysUserProjectRelevancyInfoRes)
|
||||
res = &infoRes
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
func (s *sSysUserProjectRelevancy) Add(ctx context.Context, req *wxApplet.SysUserProjectRelevancyAddReq) (err error) {
|
||||
err = g.Try(ctx, func(ctx context.Context) {
|
||||
name := ct.New().GetLoginUser(ctx).Id
|
||||
_, err = dao.SysUserProjectRelevancy.Ctx(ctx).Insert(do.SysUserProjectRelevancy{
|
||||
UserId: req.UserId,
|
||||
ProjectId: req.ProjectId,
|
||||
CreateBy: name,
|
||||
})
|
||||
liberr.ErrIsNil(ctx, err, "添加失败")
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
func (s *sSysUserProjectRelevancy) Edit(ctx context.Context, req *wxApplet.SysUserProjectRelevancyEditReq) (err error) {
|
||||
err = g.Try(ctx, func(ctx context.Context) {
|
||||
name := ct.New().GetLoginUser(ctx).Id
|
||||
_, err = dao.SysUserProjectRelevancy.Ctx(ctx).WherePri(req.Id).Update(do.SysUserProjectRelevancy{
|
||||
UserId: req.UserId,
|
||||
ProjectId: req.ProjectId,
|
||||
UpdateBy: name,
|
||||
})
|
||||
liberr.ErrIsNil(ctx, err, "修改失败")
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
func (s *sSysUserProjectRelevancy) Delete(ctx context.Context, ids []int64) (err error) {
|
||||
err = g.Try(ctx, func(ctx context.Context) {
|
||||
_, err = dao.SysUserProjectRelevancy.Ctx(ctx).Delete(dao.SysUserProjectRelevancy.Columns().Id+" in (?)", ids)
|
||||
liberr.ErrIsNil(ctx, err, "删除失败")
|
||||
})
|
||||
return
|
||||
}
|
||||
15
internal/app/wxApplet/model/app_port_do.go
Normal file
15
internal/app/wxApplet/model/app_port_do.go
Normal file
@ -0,0 +1,15 @@
|
||||
package model
|
||||
|
||||
type AppAllMembersOfTheCurrentGroupRes struct {
|
||||
Openid string `json:"openid" dc:"openid"`
|
||||
PacePhoto string `json:"pacePhoto" dc:"人脸"`
|
||||
UserName string `json:"userName" dc:"姓名"`
|
||||
}
|
||||
|
||||
type AppSelectThisUserByCardRecordReqRes struct {
|
||||
Openid string `json:"openid" dc:"openid"`
|
||||
PacePhoto string `json:"pacePhoto" dc:"人脸"`
|
||||
UserName string `json:"userName" dc:"姓名"`
|
||||
ClockingTime string `json:"clockingTime" dc:"打卡时间"`
|
||||
Commuter string `json:"commuter" dc:"上下班(1上班2下班)"`
|
||||
}
|
||||
99
internal/app/wxApplet/model/bus_askforleave.go
Normal file
99
internal/app/wxApplet/model/bus_askforleave.go
Normal file
@ -0,0 +1,99 @@
|
||||
// ==========================================================================
|
||||
// GFast自动生成model操作代码。
|
||||
// 生成日期:2025-03-27 14:14:25
|
||||
// 生成路径: internal/app/wxApplet/model/bus_askforleave.go
|
||||
// 生成人:gfast
|
||||
// desc:请假
|
||||
// company:云南奇讯科技有限公司
|
||||
// ==========================================================================
|
||||
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
"github.com/gogf/gf/v2/util/gmeta"
|
||||
)
|
||||
|
||||
// BusAskforleaveInfoRes is the golang structure for table bus_askforleave.
|
||||
type BusAskforleaveInfoRes struct {
|
||||
gmeta.Meta `orm:"table:bus_askforleave"`
|
||||
Id int64 `orm:"id,primary" json:"id"` // 主键ID
|
||||
ProjectId int64 `orm:"project_id" json:"projectId"` // 项目ID
|
||||
ProjectName string `orm:"project_name" json:"projectName"` // 项目名称
|
||||
TeamId int64 `orm:"team_id" json:"teamId"` // 班组ID
|
||||
TeamName string `orm:"team_name" json:"teamName"` // 班组名称
|
||||
StartTime *gtime.Time `orm:"start time" json:"startTime"` // 开始时间
|
||||
EndTime *gtime.Time `orm:"end_time" json:"endTime"` // 结束时间
|
||||
Argument string `orm:"argument" json:"argument"` // 请假理由
|
||||
Ganger string `orm:"ganger" json:"ganger"` // 班组长
|
||||
GangerOpinion string `orm:"ganger_opinion" json:"gangerOpinion"` // 班组长意见(1未读 2同意 3拒绝)
|
||||
GangerExplain string `orm:"ganger_explain" json:"gangerExplain"` // 拒绝理由
|
||||
GangerTime *gtime.Time `orm:"ganger_time" json:"gangerTime"` // 班组长操作时间
|
||||
Manager string `orm:"manager" json:"manager"` // 管理员
|
||||
ManagerOpinion string `orm:"manager_opinion" json:"managerOpinion"` // 管理员意见(1未读 2同意 3拒绝)
|
||||
ManagerExplain string `orm:"manager_explain" json:"managerExplain"` // 拒绝理由
|
||||
ManagerTime *gtime.Time `orm:"manager_time" json:"managerTime"` // 管理员操作时间
|
||||
CreateBy string `orm:"create_by" json:"createBy"` // 创建人
|
||||
UpdateBy string `orm:"update_by" json:"updateBy"` // 更新人
|
||||
CreatedAt *gtime.Time `orm:"created_at" json:"createdAt"` // 创建时间
|
||||
UpdatedAt *gtime.Time `orm:"updated_at" json:"updatedAt"` // 更新时间
|
||||
DeletedAt *gtime.Time `orm:"deleted_at" json:"deletedAt"` // 删除时间
|
||||
Remark string `orm:"remark" json:"remark"` // 备注
|
||||
Openid string `orm:"openid" json:"openid"` // openid
|
||||
|
||||
CardMode string `json:"cardMode" dc:"卡片状态(文字)"`
|
||||
CardNumber string `json:"cardNumber" dc:"卡片状态(数字:1待审核 2审核中 3已拒绝 4已同意)"`
|
||||
UserName string `json:"userName" dc:"真实姓名"`
|
||||
}
|
||||
|
||||
type BusAskforleaveListRes struct {
|
||||
Id int64 `json:"id"`
|
||||
ProjectId int64 `json:"projectId"`
|
||||
ProjectName string `json:"projectName"`
|
||||
TeamId int64 `json:"teamId"`
|
||||
TeamName string `json:"teamName"`
|
||||
StartTime *gtime.Time `json:"startTime"`
|
||||
EndTime *gtime.Time `json:"endTime"`
|
||||
Argument string `json:"argument"`
|
||||
Ganger string `json:"ganger"`
|
||||
GangerOpinion string `json:"gangerOpinion"`
|
||||
GangerExplain string `json:"gangerExplain"`
|
||||
GangerTime *gtime.Time `json:"gangerTime"`
|
||||
Manager string `json:"manager"`
|
||||
ManagerOpinion string `json:"managerOpinion"`
|
||||
ManagerExplain string `json:"managerExplain"`
|
||||
ManagerTime *gtime.Time `json:"managerTime"`
|
||||
CreateBy string `json:"createBy"`
|
||||
UpdateBy string `json:"updateBy"`
|
||||
CreatedAt *gtime.Time `json:"createdAt"`
|
||||
Remark string `json:"remark"`
|
||||
Openid string `json:"openid"`
|
||||
|
||||
CardMode string `json:"cardMode" dc:"卡片状态(文字)"`
|
||||
CardNumber string `json:"cardNumber" dc:"卡片状态(数字:1待审核 2审核中 3已拒绝 4已同意)"`
|
||||
UserName string `json:"userName" dc:"真实姓名"`
|
||||
}
|
||||
|
||||
type BusAskforleaveListAppRes struct {
|
||||
Id int64 `dc:"主键ID" json:"id"`
|
||||
ProjectId int64 `dc:"项目ID" json:"projectId"`
|
||||
ProjectName string `dc:"项目名称" json:"projectName"`
|
||||
TeamId int64 `dc:"班组ID" json:"teamId"`
|
||||
TeamName string `dc:"班组名称" json:"teamName"`
|
||||
StartTime *gtime.Time `dc:"开始时间" json:"startTime"`
|
||||
EndTime *gtime.Time `dc:"结束时间" json:"endTime"`
|
||||
Argument string `dc:"请假理由" json:"argument"`
|
||||
Ganger string `dc:"班组长" json:"ganger"`
|
||||
GangerName string `dc:"班组长名称" json:"gangerName"`
|
||||
GangerOpinion string `dc:"班组长意见(1未读 2同意 3拒绝)" json:"gangerOpinion"`
|
||||
GangerExplain string `dc:"拒绝理由" json:"gangerExplain"`
|
||||
GangerTime *gtime.Time `dc:"班组长操作时间" json:"gangerTime"`
|
||||
Manager string `dc:"管理员" json:"manager"`
|
||||
ManagerName string `dc:"管理员" json:"managerName"`
|
||||
ManagerOpinion string `dc:"管理员意见(1未读 2同意 3拒绝)" json:"managerOpinion"`
|
||||
ManagerExplain string `dc:"拒绝理由" json:"managerExplain"`
|
||||
ManagerTime *gtime.Time `dc:"管理员操作时间" json:"managerTime"`
|
||||
CreatedAt *gtime.Time `dc:"创建时间" json:"createdAt"`
|
||||
Openid string `dc:"申请人openid" json:"openid"`
|
||||
UserName string `dc:"申请人名称" json:"userName"`
|
||||
}
|
||||
108
internal/app/wxApplet/model/bus_attendance.go
Normal file
108
internal/app/wxApplet/model/bus_attendance.go
Normal file
@ -0,0 +1,108 @@
|
||||
// ==========================================================================
|
||||
// GFast自动生成model操作代码。
|
||||
// 生成日期:2023-08-07 16:29:52
|
||||
// 生成路径: internal/app/wxApplet/model/bus_attendance.go
|
||||
// 生成人:gfast
|
||||
// desc:考勤
|
||||
// company:云南奇讯科技有限公司
|
||||
// ==========================================================================
|
||||
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
"github.com/gogf/gf/v2/util/gmeta"
|
||||
)
|
||||
|
||||
// BusAttendanceInfoRes is the golang structure for table bus_attendance.
|
||||
type BusAttendanceInfoRes struct {
|
||||
gmeta.Meta `orm:"table:bus_attendance"`
|
||||
Id uint64 `orm:"id,primary" json:"id"` // 序号
|
||||
UserName string `orm:"user_name" json:"userName"` // 人员姓名
|
||||
PacePhoto string `orm:"pace_photo" json:"pacePhoto"` // 人脸照
|
||||
ProjectId int64 `orm:"project_id" json:"projectId"` // 项目id
|
||||
CreateBy string `orm:"create_by" json:"createBy"` // 创建者
|
||||
UpdateBy string `orm:"update_by" json:"updateBy"` // 更新者
|
||||
CreatedAt *gtime.Time `orm:"created_at" json:"createdAt"` // 创建时间
|
||||
UpdatedAt *gtime.Time `orm:"updated_at" json:"updatedAt"` // 更新时间
|
||||
DeletedAt *gtime.Time `orm:"deleted_at" json:"deletedAt"` // 删除时间
|
||||
ClockOn string `orm:"clock_on" json:"clockOn"` // 上午打卡
|
||||
ClockOff string `orm:"clock_off" json:"clockOff"` // 下午打卡
|
||||
PrintingDate string `orm:"printing_date" json:"printingDate"` // 年月日打卡时间
|
||||
IsPinch string `orm:"is_pinch" json:"isPinch"` // 打卡状态
|
||||
Openid string `orm:"openid" json:"openid"` // 微信id
|
||||
PinchOpenId string `orm:"pinch_openId" json:"pinchOpenId"` // 代打id
|
||||
ClockRecord string `orm:"clock_record" json:"clockRecord"` // 多次打卡时间记录
|
||||
PinchUserName string `orm:"pinch_user_name" json:"pinchUserName"` // 代打人姓名
|
||||
Commuter string `orm:"commuter" json:"commuter"` // 上下班(1上班2下班)
|
||||
PunchRange string `orm:"punch_range" json:"punchRange"` // 打卡范围
|
||||
DailyWage float64 `orm:"daily_wage" json:"dailyWage"` // 日薪
|
||||
Lng string `orm:"lng" json:"lng"` // 经度
|
||||
Lat string `orm:"lat" json:"lat"` // 纬度
|
||||
Location string `orm:"location" json:"location"` // 逆编码地址
|
||||
Missing *gtime.Time `orm:"missing" json:"missing"` // 逆编码地址
|
||||
}
|
||||
|
||||
type BusAttendanceListRes struct {
|
||||
Id uint64 `json:"id"`
|
||||
UserName string `json:"userName"`
|
||||
PacePhoto string `json:"pacePhoto"`
|
||||
ProjectId int64 `json:"projectId"`
|
||||
CreateBy string `json:"createBy"`
|
||||
UpdateBy string `json:"updateBy"`
|
||||
CreatedAt *gtime.Time `json:"createdAt"`
|
||||
ClockOn string `json:"clockOn"`
|
||||
ClockOff string `json:"clockOff"`
|
||||
PrintingDate string `json:"printingDate"`
|
||||
IsPinch string `json:"isPinch"`
|
||||
Openid string `json:"openid"`
|
||||
PinchOpenId string `json:"pinchOpenId"`
|
||||
ClockRecord string `json:"clockRecord"`
|
||||
PinchUserName string `json:"pinchUserName"`
|
||||
Commuter string `json:"commuter"`
|
||||
PunchRange string `json:"punchRange"`
|
||||
DailyWage float64 `json:"dailyWage"`
|
||||
Lng string `json:"lng"` // 经度
|
||||
Lat string `json:"lat"` // 纬度
|
||||
Location string `json:"location"` // 逆编码地址
|
||||
}
|
||||
type AppReissueACardListRes struct {
|
||||
Id uint64 `json:"id" dc:"主键ID"`
|
||||
IsPinch string `json:"isPinch" dc:"打卡状态(1正常 2迟到 3早退 4缺勤)"`
|
||||
PrintingDate string `json:"printingDate" dc:"日期"`
|
||||
Week string `json:"week" dc:"星期"`
|
||||
Commuter int64 `json:"commuter" dc:"上下班状态(1上班 2下班)"`
|
||||
}
|
||||
|
||||
type AppLocationAttendanceStatisticsOneRes struct {
|
||||
PrintingDate string `json:"printingDate" dc:"打卡日期"`
|
||||
Types []string `json:"types" dc:"考勤状态(1正常 2迟到 3早退 4缺卡 5提交过补卡申请)"`
|
||||
ClockInTimeRange string `json:"clockInTimeRange" dc:"上下班打卡时间范围"`
|
||||
Number int `json:"number" dc:"打卡次数"`
|
||||
WorkingHours float64 `json:"workingHours" dc:"工作时长(单位/小时)"`
|
||||
List []*AppLocationAttendanceStatisticsTwoRes `json:"list" dc:"上下班打卡明细"`
|
||||
}
|
||||
|
||||
type AppLocationAttendanceStatisticsTwoRes struct {
|
||||
Id uint64 `json:"id" dc:"主键ID"`
|
||||
Commuter string `json:"commuter" dc:"上下班状态(1上班 2下班)"`
|
||||
CommutingTime string `json:"commutingTime" dc:"上下班时间"`
|
||||
IsPinch string `json:"isPinch" dc:"打卡状态(1正常 2迟到 3早退 4缺勤)"`
|
||||
Location string `json:"location" dc:"打卡详细地址"`
|
||||
MinutesLate float64 `json:"minutesLate" dc:"迟到分钟数"`
|
||||
}
|
||||
|
||||
type AppResubmitTheExitAttachmentModelRes struct {
|
||||
gmeta.Meta `orm:"table:bus_attendance"`
|
||||
Id int64 `json:"id" dc:"考勤打卡的主键ID"`
|
||||
PrintingDate string `json:"printingDate" dc:"考勤打卡的主键ID"`
|
||||
Openid string `json:"openid" dc:"openid"`
|
||||
PacePhoto string `json:"pacePhoto" dc:"人脸照"`
|
||||
UserName string `json:"userName" dc:"用户名称"`
|
||||
BzName string `json:"bzName" dc:"班组名称"`
|
||||
TypeOfWorkName string `json:"typeOfWorkName" dc:"工种名称"`
|
||||
Status string `json:"status" dc:"1出勤 2半勤 3缺勤 0(请求参数Type是什么就是什么)"`
|
||||
Number int `json:"number" dc:"当天出勤次数"`
|
||||
LackOfCard int `json:"lackOfCard" dc:"当天缺卡次数"`
|
||||
List []*BusAttendanceInfoRes `json:"list"`
|
||||
}
|
||||
28
internal/app/wxApplet/model/bus_construction_project.go
Normal file
28
internal/app/wxApplet/model/bus_construction_project.go
Normal file
@ -0,0 +1,28 @@
|
||||
// ==========================================================================
|
||||
// GFast自动生成model操作代码。
|
||||
// 生成日期:2023-08-07 11:17:50
|
||||
// 生成路径: internal/app/wxApplet/model/bus_construction_project.go
|
||||
// 生成人:gfast
|
||||
// desc:施工人员对应项目
|
||||
// company:云南奇讯科技有限公司
|
||||
// ==========================================================================
|
||||
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/util/gmeta"
|
||||
)
|
||||
|
||||
// BusConstructionProjectInfoRes is the golang structure for table bus_construction_project.
|
||||
type BusConstructionProjectInfoRes struct {
|
||||
gmeta.Meta `orm:"table:bus_construction_project"`
|
||||
Id uint64 `orm:"id,primary" json:"id"` // 序号
|
||||
ConstructionUserId int64 `orm:"construction_user_id" json:"constructionUserId"` // 微信用户id
|
||||
ProjectId int64 `orm:"project_id" json:"projectId"` // 项目id
|
||||
}
|
||||
|
||||
type BusConstructionProjectListRes struct {
|
||||
Id uint64 `json:"id"`
|
||||
ConstructionUserId int64 `json:"constructionUserId"`
|
||||
ProjectId int64 `json:"projectId"`
|
||||
}
|
||||
171
internal/app/wxApplet/model/bus_construction_user.go
Normal file
171
internal/app/wxApplet/model/bus_construction_user.go
Normal file
@ -0,0 +1,171 @@
|
||||
// ==========================================================================
|
||||
// GFast自动生成model操作代码。
|
||||
// 生成日期:2023-08-07 11:17:50
|
||||
// 生成路径: internal/app/wxApplet/model/bus_construction_user.go
|
||||
// 生成人:gfast
|
||||
// desc:施工人员
|
||||
// company:云南奇讯科技有限公司
|
||||
// ==========================================================================
|
||||
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
"github.com/gogf/gf/v2/util/gmeta"
|
||||
)
|
||||
|
||||
// BusConstructionUserInfoRes is the golang structure for table bus_construction_user.
|
||||
type BusConstructionUserInfoRes struct {
|
||||
gmeta.Meta `orm:"table:bus_construction_user"`
|
||||
Id int64 `orm:"id,primary,omitempty" json:"id"` // 序号
|
||||
Openid string `orm:"openid,omitempty" json:"openid"` // 微信id
|
||||
NickName string `orm:"nick_name,omitempty" json:"nickName"` // 微信名称
|
||||
TeamId int64 `orm:"team_id,omitempty" json:"teamId"` // 班组id
|
||||
HeadIcon string `orm:"head_icon,omitempty" json:"headIcon"` // 登陆照片
|
||||
PacePhoto string `orm:"pace_photo,omitempty" json:"pacePhoto"` // 人脸照
|
||||
UserName string `orm:"user_name,omitempty" json:"userName"` // 人员姓名
|
||||
ProjectId int64 `orm:"project_id,omitempty" json:"projectId"` // 项目id
|
||||
Status string `orm:"status,omitempty" json:"status"` // 状态
|
||||
IsPinch string `orm:"is_pinch,omitempty" json:"isPinch"` // 是否代打
|
||||
IfManagement string `orm:"if_management,omitempty" json:"ifManagement"` // 是否班组管理
|
||||
CreateBy string `orm:"create_by,omitempty" json:"createBy"` // 创建者
|
||||
UpdateBy string `orm:"update_by,omitempty" json:"updateBy"` // 更新者
|
||||
CreatedAt *gtime.Time `orm:"created_at" json:"createdAt"` // 创建时间
|
||||
UpdatedAt *gtime.Time `orm:"updated_at" json:"updatedAt"` // 更新时间
|
||||
DeletedAt *gtime.Time `orm:"deleted_at" json:"deletedAt"` // 删除时间
|
||||
Phone string `orm:"phone,omitempty" json:"phone"` // 电话
|
||||
Sex string `orm:"sex,omitempty" json:"sex"` // 性别
|
||||
SfzNation string `orm:"sfz_nation,omitempty" json:"sfzNation"` // 身份证民族
|
||||
SfzNumber string `orm:"sfz_number,omitempty" json:"sfzNumber"` // 身份证号码
|
||||
SfzStart string `orm:"sfz_start,omitempty" json:"sfzStart"` // 身份证有效开始期
|
||||
SfzEnd string `orm:"sfz_end,omitempty" json:"sfzEnd"` // 身份证有效结束期
|
||||
SfzSite string `orm:"sfz_site,omitempty" json:"sfzSite"` // 身份证地址
|
||||
NativePlace string `orm:"native_place,omitempty" json:"nativePlace"` // 籍贯
|
||||
YhkNumber string `orm:"yhk_number,omitempty" json:"yhkNumber"` // 银行卡号
|
||||
YhkOpeningBank string `orm:"yhk_opening_bank,omitempty" json:"yhkOpeningBank"` // 开户行
|
||||
YhkCardholder string `orm:"yhk_cardholder,omitempty" json:"yhkCardholder"` // 持卡人
|
||||
TypeOfWork string `orm:"type_of_work,omitempty" json:"typeOfWork"` // 工种
|
||||
SfzBirth string `orm:"sfz_birth,omitempty" json:"sfzBirth"` // 出生日期
|
||||
Clock string `orm:"clock,omitempty" json:"clock"` // 1打卡 2禁止打卡
|
||||
LabourserviceId string `orm:"labourservice_id,omitempty" json:"labourserviceId"` // 劳务公司id
|
||||
BzName string `orm:"bz_name,omitempty" json:"bzName"` // 班组
|
||||
BzzName string `orm:"bzz_mame,omitempty" json:"bzzName"` // 班组长
|
||||
LwName string `orm:"lw_name,omitempty" json:"lwName"` // 劳务公司
|
||||
EntryDate *gtime.Time `orm:"entry_date" json:"entryDate"` // 入场时间
|
||||
LeaveDate *gtime.Time `orm:"leave_date,omitempty" json:"leaveDate"` // 离场时间
|
||||
Original string `orm:"original" json:"original"` // 离场时间
|
||||
Salary string `orm:"salary" json:"salary"` // 离场时间
|
||||
IfAdministrator string `orm:"if_administrator" json:"ifAdministrator"` // 是否是管理员
|
||||
ProjectRecord string `orm:"project_record" json:"projectRecord"` // 是否开启项目备案
|
||||
WxOrPc string `orm:"wx_or_pc" json:"wxOrPc"` //哪添加的(1表示pc 2表示小程序)
|
||||
Name string `orm:"name" json:"name"` //项目名称
|
||||
DevNum string `orm:"dev_num" json:"devNum"` //安全帽标识
|
||||
BlackOpenid string `orm:"blackOpenid" json:"blackOpenid"` //此字段前端判断是否加入黑名单
|
||||
RoleIds []int64 `orm:"roleIds" json:"roleIds"` //角色权限
|
||||
}
|
||||
|
||||
type BusConstructionUserListRes struct {
|
||||
Id int64 `json:"id"`
|
||||
Openid string `json:"openid"`
|
||||
NickName string `json:"nickName"`
|
||||
TeamId int64 `json:"teamId"`
|
||||
HeadIcon string `json:"headIcon"`
|
||||
PacePhoto string `json:"pacePhoto"`
|
||||
UserName string `json:"userName"`
|
||||
ProjectId int64 `json:"projectId"`
|
||||
Status string `json:"status"`
|
||||
IsPinch string `json:"isPinch"`
|
||||
IfManagement string `json:"ifManagement"`
|
||||
CreateBy string `json:"createBy"`
|
||||
UpdateBy string `json:"updateBy"`
|
||||
CreatedAt *gtime.Time `json:"createdAt"`
|
||||
Phone string `json:"phone"`
|
||||
Sex string `json:"sex"`
|
||||
SfzNation string `json:"sfzNation"`
|
||||
SfzNumber string `json:"sfzNumber"`
|
||||
SfzStart string `json:"sfzStart"`
|
||||
SfzEnd string `json:"sfzEnd"`
|
||||
SfzSite string `json:"sfzSite"`
|
||||
NativePlace string `json:"nativePlace"`
|
||||
YhkNumber string `json:"yhkNumber"`
|
||||
YhkOpeningBank string `json:"yhkOpeningBank"`
|
||||
YhkCardholder string `json:"yhkCardholder"`
|
||||
TypeOfWork string `json:"typeOfWork"`
|
||||
SfzBirth string `json:"sfzBirth"`
|
||||
Age string `json:"age"`
|
||||
Clock string `json:"clock"`
|
||||
LabourserviceId string `json:"labourserviceId"`
|
||||
BzName string `json:"bzName"`
|
||||
BzzName string `json:"bzzName"`
|
||||
LwName string `json:"lwName"`
|
||||
EntryDate *gtime.Time `json:"entryDate"`
|
||||
LeaveDate *gtime.Time `json:"leaveDate"`
|
||||
OriginalSalary string `json:"original"`
|
||||
Salary string `json:"salary"`
|
||||
ProjectRecord string `json:"projectRecord"`
|
||||
WxOrPc string `json:"wxOrPc"`
|
||||
//IsPass string `json:"isPass" dc:"成绩是否合格(1及格 2不及格 3暂无记录)"`
|
||||
PdfStr string `json:"pdfStr" dc:"上次考试的试卷(PDF格式)"`
|
||||
DevNum string `json:"devNum" dc:"安全帽标识"`
|
||||
BlackOpenid string `json:"blackOpenid" dc:"此字段前端判断是否加入黑名单"` //
|
||||
HistoricalRetreat bool `json:"historicalRetreat" dc:"布尔值:true代表有记录,反之无记录"`
|
||||
FileStatus string `json:"fileStatus" dc:"1未上传 2上传中 3已上传"`
|
||||
Signature string `json:"signature" dc:"签名(图片路径)"`
|
||||
}
|
||||
|
||||
type BusConstructiomUserSignatureRes struct {
|
||||
gmeta.Meta `orm:"table:bus_constructiom_user_signature"`
|
||||
Id int64 `orm:"id,primary" json:"id"` // 序号
|
||||
Openid string `orm:"openid" json:"openid"` // 微信id
|
||||
Signature string `orm:"signature" json:"signature" dc:"签名路径"` // 签名
|
||||
Change int64 `orm:"change" json:"change" dc:"是否更改签名(1不更改 2更改)"` // 是否更改签名(1不更改 2更改)
|
||||
}
|
||||
|
||||
type BusConstructionUserInfoTwoRes struct {
|
||||
BusConstructionUserInfoRes
|
||||
FileStatus string `json:"fileStatus" dc:"1未上传 2上传中 3已上传"`
|
||||
Signature string `json:"signature" dc:"签名(图片路径)"`
|
||||
UserFileList []*BusConstructionUserFileInfoRes `orm:"with:user_id=id, where:user_img_type in (4,5,6,7,8,10)" json:"userFileList"` //当前用户的文件资料
|
||||
}
|
||||
|
||||
type AppListOfConstructionPersonnelModelRes struct {
|
||||
Id int64 `dc:"施工人员主键ID" json:"id"`
|
||||
Clock string `dc:"打卡(1启用打卡 2禁止打卡)" json:"clock"`
|
||||
NickName string `dc:"微信名称" json:"nickName"`
|
||||
HeadIcon string `dc:"微信头像" json:"headIcon"`
|
||||
UserName string `dc:"人员姓名" json:"userName"`
|
||||
PacePhoto string `dc:"人脸照" json:"pacePhoto"`
|
||||
Sex string `dc:"性别(1男 2女 3保密)" json:"sex"`
|
||||
SexName string `dc:"性别(中文)" json:"sexName"`
|
||||
SfzBirth string `dc:"出生日期" json:"sfzBirth"`
|
||||
Age string `dc:"年龄" json:"age"`
|
||||
BzName string `dc:"班组" json:"bzName"`
|
||||
TypeOfWorkName string `dc:"工种" json:"typeOfWorkName"`
|
||||
LwName string `dc:"劳务公司" json:"lwName"`
|
||||
EntryDate *gtime.Time `dc:"入场时间" json:"entryDate"`
|
||||
LeaveDate *gtime.Time `dc:"离场时间" json:"leaveDate"`
|
||||
Openid string `dc:"openid" json:"openid"`
|
||||
IsAuthentication bool `dc:"isAuthentication" json:"isAuthentication"`
|
||||
}
|
||||
|
||||
type AppGetPersonnelDetailsModelRes struct {
|
||||
Id int64 `json:"id" dc:"主键ID"`
|
||||
Openid string `json:"openid" dc:"openid"`
|
||||
PacePhoto string `json:"pacePhoto" dc:"人脸"`
|
||||
UserName string `json:"userName" dc:"名称"`
|
||||
SexName string `json:"sexName" dc:"性别"`
|
||||
Phone string `json:"phone" dc:"电话"`
|
||||
SfzNumber string `json:"sfzNumber" dc:"身份证号码"`
|
||||
SfzNation string `json:"sfzNation" dc:"民族"`
|
||||
SfzBirth string `json:"sfzBirth" dc:"出生日期"`
|
||||
SfzSite string `json:"sfzSite" dc:"地址" `
|
||||
YhkOpeningBank string `json:"yhkOpeningBank" dc:"开户行(银行)"`
|
||||
YhkNumber string `json:"yhkNumber" dc:"银行卡号"`
|
||||
ProjectName string `json:"projectName" dc:"项目名称"`
|
||||
LwName string `json:"lwName" dc:"劳务名称(施工单位)"`
|
||||
BzName string `json:"bzName," dc:"班组名称"`
|
||||
TypeOfWorkName string `json:"typeOfWorkName" dc:"工种"`
|
||||
StatusStr string `json:"statusStr" dc:"状态"`
|
||||
EntryDate *gtime.Time `json:"entryDate" dc:"入场时间"`
|
||||
LeaveDate *gtime.Time `json:"leaveDate" dc:"退场时间"`
|
||||
}
|
||||
42
internal/app/wxApplet/model/bus_construction_user_file.go
Normal file
42
internal/app/wxApplet/model/bus_construction_user_file.go
Normal file
@ -0,0 +1,42 @@
|
||||
// ==========================================================================
|
||||
// GFast自动生成model操作代码。
|
||||
// 生成日期:2023-08-07 11:17:55
|
||||
// 生成路径: internal/app/wxApplet/model/bus_construction_user_file.go
|
||||
// 生成人:gfast
|
||||
// desc:微信用户的文件存储
|
||||
// company:云南奇讯科技有限公司
|
||||
// ==========================================================================
|
||||
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
"github.com/gogf/gf/v2/util/gmeta"
|
||||
)
|
||||
|
||||
// BusConstructionUserFileInfoRes is the golang structure for table bus_construction_user_file.
|
||||
type BusConstructionUserFileInfoRes struct {
|
||||
gmeta.Meta `orm:"table:bus_construction_user_file"`
|
||||
Id int64 `orm:"id,primary" json:"id"` // 主键ID
|
||||
UserId int64 `orm:"user_id" json:"userId"` // 用户id
|
||||
UserImgType string `orm:"user_img_type" json:"userImgType"` // 图片类型
|
||||
Name string `orm:"name" json:"name"` // 图片名字
|
||||
Path string `orm:"path" json:"path"` // 图片路径
|
||||
CreateBy string `orm:"create_by" json:"createBy"` // 创建者
|
||||
UpdateBy string `orm:"update_by" json:"updateBy"` // 更新者
|
||||
CreatedAt *gtime.Time `orm:"created_at" json:"createdAt"` // 创建时间
|
||||
UpdatedAt *gtime.Time `orm:"updated_at" json:"updatedAt"` // 更新时间
|
||||
DeletedAt *gtime.Time `orm:"deleted_at" json:"deletedAt"` // 删除时间
|
||||
Remark string `orm:"remark" json:"remark"` // 备注
|
||||
DictLabel string `orm:"dict_label" json:"dictLabel"` // 备注
|
||||
}
|
||||
|
||||
type BusConstructionUserFileListRes struct {
|
||||
Id int64 `json:"id"`
|
||||
UserId int64 `json:"userId"`
|
||||
UserImgType string `json:"userImgType"`
|
||||
Name string `json:"name"`
|
||||
Path string `json:"path"`
|
||||
CreatedAt *gtime.Time `json:"createdAt"`
|
||||
DictLabel string `json:"dictLabel"`
|
||||
}
|
||||
28
internal/app/wxApplet/model/bus_construction_user_post.go
Normal file
28
internal/app/wxApplet/model/bus_construction_user_post.go
Normal file
@ -0,0 +1,28 @@
|
||||
// ==========================================================================
|
||||
// GFast自动生成model操作代码。
|
||||
// 生成日期:2023-08-07 11:17:55
|
||||
// 生成路径: internal/app/wxApplet/model/bus_construction_user_post.go
|
||||
// 生成人:gfast
|
||||
// desc:施工人员岗位
|
||||
// company:云南奇讯科技有限公司
|
||||
// ==========================================================================
|
||||
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/util/gmeta"
|
||||
)
|
||||
|
||||
// BusConstructionUserPostInfoRes is the golang structure for table bus_construction_user_post.
|
||||
type BusConstructionUserPostInfoRes struct {
|
||||
gmeta.Meta `orm:"table:bus_construction_user_post"`
|
||||
Id uint64 `orm:"id,primary" json:"id"` // 序号
|
||||
ConstructionUserId int64 `orm:"construction_user_id" json:"constructionUserId"` // 施工人员id
|
||||
PostId int64 `orm:"post_id" json:"postId"` // 岗位id
|
||||
}
|
||||
|
||||
type BusConstructionUserPostListRes struct {
|
||||
Id uint64 `json:"id"`
|
||||
ConstructionUserId int64 `json:"constructionUserId"`
|
||||
PostId int64 `json:"postId"`
|
||||
}
|
||||
52
internal/app/wxApplet/model/bus_labourservice.go
Normal file
52
internal/app/wxApplet/model/bus_labourservice.go
Normal file
@ -0,0 +1,52 @@
|
||||
// ==========================================================================
|
||||
// GFast自动生成model操作代码。
|
||||
// 生成日期:2023-08-14 11:24:31
|
||||
// 生成路径: internal/app/wxApplet/model/bus_labourservice.go
|
||||
// 生成人:gfast
|
||||
// desc:劳务公司
|
||||
// company:云南奇讯科技有限公司
|
||||
// ==========================================================================
|
||||
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
"github.com/gogf/gf/v2/util/gmeta"
|
||||
)
|
||||
|
||||
// BusLabourserviceInfoRes is the golang structure for table bus_labourservice.
|
||||
type BusLabourserviceInfoRes struct {
|
||||
gmeta.Meta `orm:"table:bus_labourservice"`
|
||||
Id int64 `orm:"id,primary" json:"id"` // 主键ID
|
||||
Name string `orm:"name" json:"name"` // 劳务公司
|
||||
Principal string `orm:"principal" json:"principal"` // 负责人
|
||||
Phone string `orm:"phone" json:"phone"` // 联系电话
|
||||
Custodian string `orm:"custodian" json:"custodian"` // 管理人
|
||||
CustodianPhone string `orm:"custodian_phone" json:"custodianPhone"` // 管理人联系电话
|
||||
CreateBy string `orm:"create_by" json:"createBy"` // 创建人
|
||||
UpdateBy string `orm:"update_by" json:"updateBy"` // 更新人
|
||||
CreatedAt *gtime.Time `orm:"created_at" json:"createdAt"` // 创建时间
|
||||
UpdatedAt *gtime.Time `orm:"updated_at" json:"updatedAt"` // 更新时间
|
||||
DeletedAt *gtime.Time `orm:"deleted_at" json:"deletedAt"` // 删除时间
|
||||
Remark string `orm:"remark" json:"remark"` // 备注
|
||||
}
|
||||
|
||||
type BusLabourserviceListRes struct {
|
||||
Id int64 `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Principal string `json:"principal"`
|
||||
Phone string `json:"phone"`
|
||||
Custodian string `json:"custodian"`
|
||||
CustodianPhone string `json:"custodianPhone"`
|
||||
CreatedAt *gtime.Time `json:"createdAt"`
|
||||
Remark string `json:"remark"`
|
||||
}
|
||||
|
||||
type BusLabourserviceFileRes struct {
|
||||
gmeta.Meta `orm:"table:bus_labourservice_file"`
|
||||
Id int64 `orm:"id,primary" json:"id" dc:"资料ID"`
|
||||
Pid int64 `orm:"pid" json:"pid" dc:"劳务公司主键ID"`
|
||||
Type string `orm:"type" json:"type" dc:"资料类型"`
|
||||
Name string `orm:"name" json:"name" dc:"文件名称"`
|
||||
Path string `orm:"path" json:"path" dc:"路径"`
|
||||
}
|
||||
43
internal/app/wxApplet/model/do/bus_askforleave.go
Normal file
43
internal/app/wxApplet/model/do/bus_askforleave.go
Normal file
@ -0,0 +1,43 @@
|
||||
// ==========================================================================
|
||||
// GFast自动生成model entity操作代码。
|
||||
// 生成日期:2025-03-27 14:14:25
|
||||
// 生成路径: internal/app/wxApplet/model/entity/bus_askforleave.go
|
||||
// 生成人:gfast
|
||||
// desc:请假
|
||||
// company:云南奇讯科技有限公司
|
||||
// ==========================================================================
|
||||
|
||||
package do
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
"github.com/gogf/gf/v2/util/gmeta"
|
||||
)
|
||||
|
||||
// BusAskforleave is the golang structure for table bus_askforleave.
|
||||
type BusAskforleave struct {
|
||||
gmeta.Meta `orm:"table:bus_askforleave, do:true"`
|
||||
Id interface{} `orm:"id,primary" json:"id"` // 主键ID
|
||||
ProjectId interface{} `orm:"project_id" json:"projectId"` // 项目ID
|
||||
ProjectName interface{} `orm:"project_name" json:"projectName"` // 项目名称
|
||||
TeamId interface{} `orm:"team_id" json:"teamId"` // 班组ID
|
||||
TeamName interface{} `orm:"team_name" json:"teamName"` // 班组名称
|
||||
StartTime *gtime.Time `orm:"start time" json:"startTime"` // 开始时间
|
||||
EndTime *gtime.Time `orm:"end_time" json:"endTime"` // 结束时间
|
||||
Argument interface{} `orm:"argument" json:"argument"` // 请假理由
|
||||
Ganger interface{} `orm:"ganger" json:"ganger"` // 班组长
|
||||
GangerOpinion interface{} `orm:"ganger_opinion" json:"gangerOpinion"` // 班组长意见(1未读 2同意 3拒绝)
|
||||
GangerExplain interface{} `orm:"ganger_explain" json:"gangerExplain"` // 拒绝理由
|
||||
GangerTime *gtime.Time `orm:"ganger_time" json:"gangerTime"` // 班组长操作时间
|
||||
Manager interface{} `orm:"manager" json:"manager"` // 管理员
|
||||
ManagerOpinion interface{} `orm:"manager_opinion" json:"managerOpinion"` // 管理员意见(1未读 2同意 3拒绝)
|
||||
ManagerExplain interface{} `orm:"manager_explain" json:"managerExplain"` // 拒绝理由
|
||||
ManagerTime *gtime.Time `orm:"manager_time" json:"managerTime"` // 管理员操作时间
|
||||
CreateBy interface{} `orm:"create_by" json:"createBy"` // 创建人
|
||||
UpdateBy interface{} `orm:"update_by" json:"updateBy"` // 更新人
|
||||
CreatedAt *gtime.Time `orm:"created_at" json:"createdAt"` // 创建时间
|
||||
UpdatedAt *gtime.Time `orm:"updated_at" json:"updatedAt"` // 更新时间
|
||||
DeletedAt *gtime.Time `orm:"deleted_at" json:"deletedAt"` // 删除时间
|
||||
Remark interface{} `orm:"remark" json:"remark"` // 备注
|
||||
Openid interface{} `orm:"openid" json:"openid"` // openid
|
||||
}
|
||||
43
internal/app/wxApplet/model/do/bus_attendance.go
Normal file
43
internal/app/wxApplet/model/do/bus_attendance.go
Normal file
@ -0,0 +1,43 @@
|
||||
// ==========================================================================
|
||||
// GFast自动生成model entity操作代码。
|
||||
// 生成日期:2023-08-07 16:29:52
|
||||
// 生成路径: internal/app/wxApplet/model/entity/bus_attendance.go
|
||||
// 生成人:gfast
|
||||
// desc:考勤
|
||||
// company:云南奇讯科技有限公司
|
||||
// ==========================================================================
|
||||
|
||||
package do
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
"github.com/gogf/gf/v2/util/gmeta"
|
||||
)
|
||||
|
||||
// BusAttendance is the golang structure for table bus_attendance.
|
||||
type BusAttendance struct {
|
||||
gmeta.Meta `orm:"table:bus_attendance, do:true"`
|
||||
Id interface{} `orm:"id,primary" json:"id"` // 序号
|
||||
UserName interface{} `orm:"user_name" json:"userName"` // 人员姓名
|
||||
PacePhoto interface{} `orm:"pace_photo" json:"pacePhoto"` // 人脸照
|
||||
ProjectId interface{} `orm:"project_id" json:"projectId"` // 项目id
|
||||
CreateBy interface{} `orm:"create_by" json:"createBy"` // 创建者
|
||||
UpdateBy interface{} `orm:"update_by" json:"updateBy"` // 更新者
|
||||
CreatedAt *gtime.Time `orm:"created_at" json:"createdAt"` // 创建时间
|
||||
UpdatedAt *gtime.Time `orm:"updated_at" json:"updatedAt"` // 更新时间
|
||||
DeletedAt *gtime.Time `orm:"deleted_at" json:"deletedAt"` // 删除时间
|
||||
ClockOn interface{} `orm:"clock_on" json:"clockOn"` // 上午打卡
|
||||
ClockOff interface{} `orm:"clock_off" json:"clockOff"` // 下午打卡
|
||||
PrintingDate interface{} `orm:"printing_date" json:"printingDate"` // 年月日打卡时间
|
||||
IsPinch interface{} `orm:"is_pinch" json:"isPinch"` // 打卡状态
|
||||
Openid interface{} `orm:"openid" json:"openid"` // 微信id
|
||||
PinchOpenId interface{} `orm:"pinch_openId" json:"pinchOpenId"` // 代打id
|
||||
ClockRecord interface{} `orm:"clock_record" json:"clockRecord"` // 多次打卡时间记录
|
||||
PinchUserName interface{} `orm:"pinch_user_name" json:"pinchUserName"` // 代打人姓名
|
||||
Commuter interface{} `orm:"commuter" json:"commuter"` // 上下班
|
||||
PunchRange interface{} `orm:"punch_range" json:"punchRange"` // 打卡范围
|
||||
DailyWage interface{} `orm:"daily_wage" json:"dailyWage"` // 日薪
|
||||
Lng interface{} `orm:"lng" json:"lng"` // 经度
|
||||
Lat interface{} `orm:"lat" json:"lat"` // 纬度
|
||||
Location interface{} `orm:"location" json:"location"` // 逆编码地址
|
||||
}
|
||||
22
internal/app/wxApplet/model/do/bus_construction_project.go
Normal file
22
internal/app/wxApplet/model/do/bus_construction_project.go
Normal file
@ -0,0 +1,22 @@
|
||||
// ==========================================================================
|
||||
// GFast自动生成model entity操作代码。
|
||||
// 生成日期:2023-08-07 11:17:50
|
||||
// 生成路径: internal/app/wxApplet/model/entity/bus_construction_project.go
|
||||
// 生成人:gfast
|
||||
// desc:施工人员对应项目
|
||||
// company:云南奇讯科技有限公司
|
||||
// ==========================================================================
|
||||
|
||||
package do
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/util/gmeta"
|
||||
)
|
||||
|
||||
// BusConstructionProject is the golang structure for table bus_construction_project.
|
||||
type BusConstructionProject struct {
|
||||
gmeta.Meta `orm:"table:bus_construction_project, do:true"`
|
||||
Id interface{} `orm:"id,primary" json:"id"` // 序号
|
||||
ConstructionUserId interface{} `orm:"construction_user_id" json:"constructionUserId"` // 微信用户id
|
||||
ProjectId interface{} `orm:"project_id" json:"projectId"` // 项目id
|
||||
}
|
||||
57
internal/app/wxApplet/model/do/bus_construction_user.go
Normal file
57
internal/app/wxApplet/model/do/bus_construction_user.go
Normal file
@ -0,0 +1,57 @@
|
||||
// ==========================================================================
|
||||
// GFast自动生成model entity操作代码。
|
||||
// 生成日期:2023-08-07 11:17:50
|
||||
// 生成路径: internal/app/wxApplet/model/entity/bus_construction_user.go
|
||||
// 生成人:gfast
|
||||
// desc:施工人员
|
||||
// company:云南奇讯科技有限公司
|
||||
// ==========================================================================
|
||||
|
||||
package do
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
"github.com/gogf/gf/v2/util/gmeta"
|
||||
)
|
||||
|
||||
// BusConstructionUser is the golang structure for table bus_construction_user.
|
||||
type BusConstructionUser struct {
|
||||
gmeta.Meta `orm:"table:bus_construction_user, do:true"`
|
||||
Id interface{} `orm:"id,primary" json:"id"` // 序号
|
||||
Openid interface{} `orm:"openid,primary" json:"openid"` // 微信id
|
||||
NickName interface{} `orm:"nick_name" json:"nickName"` // 微信名称
|
||||
TeamId interface{} `orm:"team_id" json:"teamId"` // 班组id
|
||||
HeadIcon interface{} `orm:"head_icon" json:"headIcon"` // 登陆照片
|
||||
PacePhoto interface{} `orm:"pace_photo" json:"pacePhoto"` // 人脸照
|
||||
UserName interface{} `orm:"user_name" json:"userName"` // 人员姓名
|
||||
ProjectId interface{} `orm:"project_id" json:"projectId"` // 项目id
|
||||
Status interface{} `orm:"status,primary" json:"status"` // 状态
|
||||
IsPinch interface{} `orm:"is_pinch" json:"isPinch"` // 是否代打
|
||||
IfManagement interface{} `orm:"if_management" json:"ifManagement"` // 是否班组管理
|
||||
CreateBy interface{} `orm:"create_by" json:"createBy"` // 创建者
|
||||
UpdateBy interface{} `orm:"update_by" json:"updateBy"` // 更新者
|
||||
CreatedAt *gtime.Time `orm:"created_at" json:"createdAt"` // 创建时间
|
||||
UpdatedAt *gtime.Time `orm:"updated_at" json:"updatedAt"` // 更新时间
|
||||
DeletedAt *gtime.Time `orm:"deleted_at" json:"deletedAt"` // 删除时间
|
||||
Phone interface{} `orm:"phone" json:"phone"` // 电话
|
||||
Sex interface{} `orm:"sex" json:"sex"` // 性别
|
||||
SfzNation interface{} `orm:"sfz_nation" json:"sfzNation"` // 身份证民族
|
||||
SfzNumber interface{} `orm:"sfz_number" json:"sfzNumber"` // 身份证号码
|
||||
SfzStart interface{} `orm:"sfz_start" json:"sfzStart"` // 身份证有效开始期
|
||||
SfzEnd interface{} `orm:"sfz_end" json:"sfzEnd"` // 身份证有效结束期
|
||||
SfzSite interface{} `orm:"sfz_site" json:"sfzSite"` // 身份证地址
|
||||
NativePlace interface{} `orm:"native_place" json:"nativePlace"` // 籍贯
|
||||
YhkNumber interface{} `orm:"yhk_number" json:"yhkNumber"` // 银行卡号
|
||||
YhkOpeningBank interface{} `orm:"yhk_opening_bank" json:"yhkOpeningBank"` // 开户行
|
||||
YhkCardholder interface{} `orm:"yhk_cardholder" json:"yhkCardholder"` // 持卡人
|
||||
WxOrPc interface{} `orm:"wx_or_pc,primary" json:"wxOrPc"`
|
||||
SfzBirth interface{} `orm:"sfz_birth" json:"sfzBirth"`
|
||||
LabourserviceId interface{} `orm:"labourservice_id" json:"labourserviceId"`
|
||||
TypeOfWork interface{} `orm:"type_of_work" json:"typeOfWork"`
|
||||
Clock interface{} `orm:"clock" json:"clock"`
|
||||
EntryDate *gtime.Time `orm:"entry_date,primary" json:"entryDate"`
|
||||
LeaveDate *gtime.Time `orm:"leave_date,primary" json:"leaveDate"`
|
||||
Salary interface{} `orm:"salary" json:"salary"` // 薪水
|
||||
ProjectRecord interface{} `orm:"project_record,primary" json:"projectRecord"` // 是否开启项目备案
|
||||
DevNum interface{} `orm:"dev_num" json:"devNum"` // 安全帽标识
|
||||
}
|
||||
31
internal/app/wxApplet/model/do/bus_construction_user_file.go
Normal file
31
internal/app/wxApplet/model/do/bus_construction_user_file.go
Normal file
@ -0,0 +1,31 @@
|
||||
// ==========================================================================
|
||||
// GFast自动生成model entity操作代码。
|
||||
// 生成日期:2023-08-07 11:17:55
|
||||
// 生成路径: internal/app/wxApplet/model/entity/bus_construction_user_file.go
|
||||
// 生成人:gfast
|
||||
// desc:微信用户的文件存储
|
||||
// company:云南奇讯科技有限公司
|
||||
// ==========================================================================
|
||||
|
||||
package do
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
"github.com/gogf/gf/v2/util/gmeta"
|
||||
)
|
||||
|
||||
// BusConstructionUserFile is the golang structure for table bus_construction_user_file.
|
||||
type BusConstructionUserFile struct {
|
||||
gmeta.Meta `orm:"table:bus_construction_user_file, do:true"`
|
||||
Id interface{} `orm:"id,primary" json:"id"` // 主键ID
|
||||
UserId interface{} `orm:"user_id" json:"userId"` // 用户id
|
||||
UserImgType interface{} `orm:"user_img_type" json:"userImgType"` // 图片类型
|
||||
Name interface{} `orm:"name" json:"name"` // 名称
|
||||
Path interface{} `orm:"path" json:"path"` // 图片路径
|
||||
CreateBy interface{} `orm:"create_by" json:"createBy"` // 创建者
|
||||
UpdateBy interface{} `orm:"update_by" json:"updateBy"` // 更新者
|
||||
CreatedAt *gtime.Time `orm:"created_at" json:"createdAt"` // 创建时间
|
||||
UpdatedAt *gtime.Time `orm:"updated_at" json:"updatedAt"` // 更新时间
|
||||
DeletedAt *gtime.Time `orm:"deleted_at" json:"deletedAt"` // 删除时间
|
||||
Remark interface{} `orm:"remark" json:"remark"` // 备注
|
||||
}
|
||||
22
internal/app/wxApplet/model/do/bus_construction_user_post.go
Normal file
22
internal/app/wxApplet/model/do/bus_construction_user_post.go
Normal file
@ -0,0 +1,22 @@
|
||||
// ==========================================================================
|
||||
// GFast自动生成model entity操作代码。
|
||||
// 生成日期:2023-08-07 11:17:55
|
||||
// 生成路径: internal/app/wxApplet/model/entity/bus_construction_user_post.go
|
||||
// 生成人:gfast
|
||||
// desc:施工人员岗位
|
||||
// company:云南奇讯科技有限公司
|
||||
// ==========================================================================
|
||||
|
||||
package do
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/util/gmeta"
|
||||
)
|
||||
|
||||
// BusConstructionUserPost is the golang structure for table bus_construction_user_post.
|
||||
type BusConstructionUserPost struct {
|
||||
gmeta.Meta `orm:"table:bus_construction_user_post, do:true"`
|
||||
Id interface{} `orm:"id,primary" json:"id"` // 序号
|
||||
ConstructionUserId interface{} `orm:"construction_user_id" json:"constructionUserId"` // 施工人员id
|
||||
PostId interface{} `orm:"post_id" json:"postId"` // 岗位id
|
||||
}
|
||||
32
internal/app/wxApplet/model/do/bus_labourservice.go
Normal file
32
internal/app/wxApplet/model/do/bus_labourservice.go
Normal file
@ -0,0 +1,32 @@
|
||||
// ==========================================================================
|
||||
// GFast自动生成model entity操作代码。
|
||||
// 生成日期:2023-08-14 11:24:31
|
||||
// 生成路径: internal/app/wxApplet/model/entity/bus_labourservice.go
|
||||
// 生成人:gfast
|
||||
// desc:劳务公司
|
||||
// company:云南奇讯科技有限公司
|
||||
// ==========================================================================
|
||||
|
||||
package do
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
"github.com/gogf/gf/v2/util/gmeta"
|
||||
)
|
||||
|
||||
// BusLabourservice is the golang structure for table bus_labourservice.
|
||||
type BusLabourservice struct {
|
||||
gmeta.Meta `orm:"table:bus_labourservice, do:true"`
|
||||
Id interface{} `orm:"id,primary" json:"id"` // 主键ID
|
||||
Name interface{} `orm:"name" json:"name"` // 劳务公司
|
||||
Principal interface{} `orm:"principal" json:"principal"` // 负责人
|
||||
Phone interface{} `orm:"phone" json:"phone"` // 联系电话
|
||||
Custodian interface{} `orm:"custodian" json:"custodian"` // 管理人
|
||||
CustodianPhone interface{} `orm:"custodian_phone" json:"custodianPhone"` // 管理人联系电话
|
||||
CreateBy interface{} `orm:"create_by" json:"createBy"` // 创建人
|
||||
UpdateBy interface{} `orm:"update_by" json:"updateBy"` // 更新人
|
||||
CreatedAt *gtime.Time `orm:"created_at" json:"createdAt"` // 创建时间
|
||||
UpdatedAt *gtime.Time `orm:"updated_at" json:"updatedAt"` // 更新时间
|
||||
DeletedAt *gtime.Time `orm:"deleted_at" json:"deletedAt"` // 删除时间
|
||||
Remark interface{} `orm:"remark" json:"remark"` // 备注
|
||||
}
|
||||
29
internal/app/wxApplet/model/do/sys_project_team.go
Normal file
29
internal/app/wxApplet/model/do/sys_project_team.go
Normal file
@ -0,0 +1,29 @@
|
||||
// ==========================================================================
|
||||
// GFast自动生成model entity操作代码。
|
||||
// 生成日期:2023-08-15 09:34:52
|
||||
// 生成路径: internal/app/wxApplet/model/entity/sys_project_team.go
|
||||
// 生成人:gfast
|
||||
// desc:项目班组
|
||||
// company:云南奇讯科技有限公司
|
||||
// ==========================================================================
|
||||
|
||||
package do
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
"github.com/gogf/gf/v2/util/gmeta"
|
||||
)
|
||||
|
||||
// SysProjectTeam is the golang structure for table sys_project_team.
|
||||
type SysProjectTeam struct {
|
||||
gmeta.Meta `orm:"table:sys_project_team, do:true"`
|
||||
Id interface{} `orm:"id,primary" json:"id"` // 主键ID
|
||||
ProjectId interface{} `orm:"project_id" json:"projectId"` // 项目id
|
||||
Name interface{} `orm:"name" json:"name"` // 班组名称
|
||||
IsClockIn interface{} `orm:"is_clock_in" json:"isClockIn"` // 班组名称
|
||||
CreateBy interface{} `orm:"create_by" json:"createBy"` // 创建者
|
||||
UpdateBy interface{} `orm:"update_by" json:"updateBy"` // 更新者
|
||||
CreateTime *gtime.Time `orm:"create_time" json:"createTime"` // 创建时间
|
||||
UpdateTime *gtime.Time `orm:"update_time" json:"updateTime"` // 更新时间
|
||||
DeletedAt *gtime.Time `orm:"deleted_at" json:"deletedAt"` // 删除时间
|
||||
}
|
||||
28
internal/app/wxApplet/model/do/sys_project_team_member.go
Normal file
28
internal/app/wxApplet/model/do/sys_project_team_member.go
Normal file
@ -0,0 +1,28 @@
|
||||
// ==========================================================================
|
||||
// GFast自动生成model entity操作代码。
|
||||
// 生成日期:2023-08-15 09:34:52
|
||||
// 生成路径: internal/app/wxApplet/model/entity/sys_project_team_member.go
|
||||
// 生成人:gfast
|
||||
// desc:项目班组下的成员
|
||||
// company:云南奇讯科技有限公司
|
||||
// ==========================================================================
|
||||
|
||||
package do
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
"github.com/gogf/gf/v2/util/gmeta"
|
||||
)
|
||||
|
||||
// SysProjectTeamMember is the golang structure for table sys_project_team_member.
|
||||
type SysProjectTeamMember struct {
|
||||
gmeta.Meta `orm:"table:sys_project_team_member, do:true"`
|
||||
Id interface{} `orm:"id,primary" json:"id"` // 主键ID
|
||||
TeamId interface{} `orm:"team_id" json:"teamId"` // 班组id
|
||||
Openid interface{} `orm:"openid" json:"openid"` // 微信用户标识
|
||||
PostId interface{} `orm:"post_id" json:"postId"` // 岗位(默认为4普通员工,组长为10)
|
||||
ProjectId interface{} `orm:"project_id" json:"projectId"` // 项目ID
|
||||
CreateTime *gtime.Time `orm:"create_time" json:"createTime"` // 创建时间
|
||||
UpdateTime *gtime.Time `orm:"update_time" json:"updateTime"` // 更新时间
|
||||
DeletedAt *gtime.Time `orm:"deleted_at" json:"deletedAt"` // 删除时间
|
||||
}
|
||||
35
internal/app/wxApplet/model/do/sys_project_team_squad.go
Normal file
35
internal/app/wxApplet/model/do/sys_project_team_squad.go
Normal file
@ -0,0 +1,35 @@
|
||||
// ==========================================================================
|
||||
// GFast自动生成model entity操作代码。
|
||||
// 生成日期:2023-08-30 15:24:06
|
||||
// 生成路径: internal/app/wxApplet/model/entity/sys_project_team_squad.go
|
||||
// 生成人:gfast
|
||||
// desc:站班会
|
||||
// company:云南奇讯科技有限公司
|
||||
// ==========================================================================
|
||||
|
||||
package do
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
"github.com/gogf/gf/v2/util/gmeta"
|
||||
)
|
||||
|
||||
// SysProjectTeamSquad is the golang structure for table sys_project_team_squad.
|
||||
type SysProjectTeamSquad struct {
|
||||
gmeta.Meta `orm:"table:sys_project_team_squad, do:true"`
|
||||
Id interface{} `orm:"id,primary" json:"id"` // 主键ID
|
||||
ProjectId interface{} `orm:"project_id" json:"projectId"` // 项目ID
|
||||
TeamId interface{} `orm:"team_id" json:"teamId"` // 班组ID
|
||||
MeetingDate *gtime.Time `orm:"meeting_date" json:"meetingDate"` // 开会时间
|
||||
CompereId interface{} `orm:"compere_id" json:"compereId"` // 宣讲人
|
||||
ParticipantId interface{} `orm:"participant_id" json:"participantId"` // 参与人ID(多个用,号隔开)
|
||||
Content interface{} `orm:"content" json:"content"` // 班会内容
|
||||
Picture interface{} `orm:"picture,primary" json:"picture"` // 班会图片(多个用,号隔开)
|
||||
CreateBy interface{} `orm:"create_by,primary" json:"createBy"` // 创建人
|
||||
UpdateBy interface{} `orm:"update_by,primary" json:"updateBy"` // 更新人
|
||||
CreatedAt *gtime.Time `orm:"created_at" json:"createdAt"` // 创建时间
|
||||
UpdatedAt *gtime.Time `orm:"updated_at" json:"updatedAt"` // 更新时间
|
||||
DeletedAt *gtime.Time `orm:"deleted_at" json:"deletedAt"` // 删除时间
|
||||
TeamName interface{} `orm:"team_name" json:"teamName"` // 班组名称
|
||||
LabourserviceName interface{} `orm:"labourservice_name" json:"labourserviceName"` // 劳务公司名称
|
||||
}
|
||||
31
internal/app/wxApplet/model/do/sys_user_project_relevancy.go
Normal file
31
internal/app/wxApplet/model/do/sys_user_project_relevancy.go
Normal file
@ -0,0 +1,31 @@
|
||||
// ==========================================================================
|
||||
// GFast自动生成model entity操作代码。
|
||||
// 生成日期:2023-08-21 09:19:15
|
||||
// 生成路径: internal/app/wxApplet/model/entity/sys_user_project_relevancy.go
|
||||
// 生成人:gfast
|
||||
// desc:系统用户与项目关联
|
||||
// company:云南奇讯科技有限公司
|
||||
// ==========================================================================
|
||||
|
||||
package do
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
"github.com/gogf/gf/v2/util/gmeta"
|
||||
)
|
||||
|
||||
// SysUserProjectRelevancy is the golang structure for table sys_user_project_relevancy.
|
||||
type SysUserProjectRelevancy struct {
|
||||
gmeta.Meta `orm:"table:sys_user_project_relevancy, do:true"`
|
||||
Id interface{} `orm:"id,primary" json:"id"` // 主键ID
|
||||
UserId interface{} `orm:"user_id" json:"userId"` // 用户ID
|
||||
ProjectId interface{} `orm:"project_id" json:"projectId"` // 项目ID
|
||||
CreateBy interface{} `orm:"create_by" json:"createBy"` // 创建人
|
||||
UpdateBy interface{} `orm:"update_by" json:"updateBy"` // 更新人
|
||||
CreatedAt *gtime.Time `orm:"created_at" json:"createdAt"` // 创建时间
|
||||
UpdatedAt *gtime.Time `orm:"updated_at" json:"updatedAt"` // 更新时间
|
||||
DeletedAt *gtime.Time `orm:"deleted_at" json:"deletedAt"` // 删除时间
|
||||
|
||||
ProjectName interface{} `orm:"project_name" json:"projectName"` // 删除时间
|
||||
Source interface{} `orm:"source" json:"source"` // 来源 | 0 小程序 | 1 后台管理
|
||||
}
|
||||
43
internal/app/wxApplet/model/entity/bus_askforleave.go
Normal file
43
internal/app/wxApplet/model/entity/bus_askforleave.go
Normal file
@ -0,0 +1,43 @@
|
||||
// ==========================================================================
|
||||
// GFast自动生成model entity操作代码。
|
||||
// 生成日期:2025-03-27 14:14:25
|
||||
// 生成路径: internal/app/wxApplet/model/entity/bus_askforleave.go
|
||||
// 生成人:gfast
|
||||
// desc:请假
|
||||
// company:云南奇讯科技有限公司
|
||||
// ==========================================================================
|
||||
|
||||
package entity
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
"github.com/gogf/gf/v2/util/gmeta"
|
||||
)
|
||||
|
||||
// BusAskforleave is the golang structure for table bus_askforleave.
|
||||
type BusAskforleave struct {
|
||||
gmeta.Meta `orm:"table:bus_askforleave"`
|
||||
Id int64 `orm:"id,primary" json:"id"` // 主键ID
|
||||
ProjectId int64 `orm:"project_id" json:"projectId"` // 项目ID
|
||||
ProjectName string `orm:"project_name" json:"projectName"` // 项目名称
|
||||
TeamId int64 `orm:"team_id" json:"teamId"` // 班组ID
|
||||
TeamName string `orm:"team_name" json:"teamName"` // 班组名称
|
||||
StartTime *gtime.Time `orm:"start time" json:"startTime"` // 开始时间
|
||||
EndTime *gtime.Time `orm:"end_time" json:"endTime"` // 结束时间
|
||||
Argument string `orm:"argument" json:"argument"` // 请假理由
|
||||
Ganger string `orm:"ganger" json:"ganger"` // 班组长
|
||||
GangerOpinion string `orm:"ganger_opinion" json:"gangerOpinion"` // 班组长意见(1未读 2同意 3拒绝)
|
||||
GangerExplain string `orm:"ganger_explain" json:"gangerExplain"` // 拒绝理由
|
||||
GangerTime *gtime.Time `orm:"ganger_time" json:"gangerTime"` // 班组长操作时间
|
||||
Manager string `orm:"manager" json:"manager"` // 管理员
|
||||
ManagerOpinion string `orm:"manager_opinion" json:"managerOpinion"` // 管理员意见(1未读 2同意 3拒绝)
|
||||
ManagerExplain string `orm:"manager_explain" json:"managerExplain"` // 拒绝理由
|
||||
ManagerTime *gtime.Time `orm:"manager_time" json:"managerTime"` // 管理员操作时间
|
||||
CreateBy string `orm:"create_by" json:"createBy"` // 创建人
|
||||
UpdateBy string `orm:"update_by" json:"updateBy"` // 更新人
|
||||
CreatedAt *gtime.Time `orm:"created_at" json:"createdAt"` // 创建时间
|
||||
UpdatedAt *gtime.Time `orm:"updated_at" json:"updatedAt"` // 更新时间
|
||||
DeletedAt *gtime.Time `orm:"deleted_at" json:"deletedAt"` // 删除时间
|
||||
Remark string `orm:"remark" json:"remark"` // 备注
|
||||
Openid string `orm:"openid" json:"openid"` // openid
|
||||
}
|
||||
37
internal/app/wxApplet/model/entity/bus_attendance.go
Normal file
37
internal/app/wxApplet/model/entity/bus_attendance.go
Normal file
@ -0,0 +1,37 @@
|
||||
// ==========================================================================
|
||||
// GFast自动生成model entity操作代码。
|
||||
// 生成日期:2023-08-07 16:29:52
|
||||
// 生成路径: internal/app/wxApplet/model/entity/bus_attendance.go
|
||||
// 生成人:gfast
|
||||
// desc:考勤
|
||||
// company:云南奇讯科技有限公司
|
||||
// ==========================================================================
|
||||
|
||||
package entity
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
"github.com/gogf/gf/v2/util/gmeta"
|
||||
)
|
||||
|
||||
// BusAttendance is the golang structure for table bus_attendance.
|
||||
type BusAttendance struct {
|
||||
gmeta.Meta `orm:"table:bus_attendance"`
|
||||
Id uint64 `orm:"id,primary" json:"id"` // 序号
|
||||
UserName string `orm:"user_name" json:"userName"` // 人员姓名
|
||||
PacePhoto string `orm:"pace_photo" json:"pacePhoto"` // 人脸照
|
||||
ProjectId int64 `orm:"project_id" json:"projectId"` // 项目id
|
||||
CreateBy string `orm:"create_by" json:"createBy"` // 创建者
|
||||
UpdateBy string `orm:"update_by" json:"updateBy"` // 更新者
|
||||
CreatedAt *gtime.Time `orm:"created_at" json:"createdAt"` // 创建时间
|
||||
UpdatedAt *gtime.Time `orm:"updated_at" json:"updatedAt"` // 更新时间
|
||||
DeletedAt *gtime.Time `orm:"deleted_at" json:"deletedAt"` // 删除时间
|
||||
ClockOn string `orm:"clock_on" json:"clockOn"` // 上午打卡
|
||||
ClockOff string `orm:"clock_off" json:"clockOff"` // 下午打卡
|
||||
PrintingDate string `orm:"printing_date" json:"printingDate"` // 年月日打卡时间
|
||||
IsPinch string `orm:"is_pinch" json:"isPinch"` // 打卡状态
|
||||
Openid string `orm:"openid" json:"openid"` // 微信id
|
||||
PinchOpenId string `orm:"pinch_openId" json:"pinchOpenId"` // 代打id
|
||||
ClockRecord string `orm:"clock_record" json:"clockRecord"` // 多次打卡时间记录
|
||||
PinchUserName string `orm:"pinch_user_name" json:"pinchUserName"` // 代打人姓名
|
||||
}
|
||||
@ -0,0 +1,22 @@
|
||||
// ==========================================================================
|
||||
// GFast自动生成model entity操作代码。
|
||||
// 生成日期:2023-08-07 11:17:50
|
||||
// 生成路径: internal/app/wxApplet/model/entity/bus_construction_project.go
|
||||
// 生成人:gfast
|
||||
// desc:施工人员对应项目
|
||||
// company:云南奇讯科技有限公司
|
||||
// ==========================================================================
|
||||
|
||||
package entity
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/util/gmeta"
|
||||
)
|
||||
|
||||
// BusConstructionProject is the golang structure for table bus_construction_project.
|
||||
type BusConstructionProject struct {
|
||||
gmeta.Meta `orm:"table:bus_construction_project"`
|
||||
Id uint64 `orm:"id,primary" json:"id"` // 序号
|
||||
ConstructionUserId int64 `orm:"construction_user_id" json:"constructionUserId"` // 微信用户id
|
||||
ProjectId int64 `orm:"project_id" json:"projectId"` // 项目id
|
||||
}
|
||||
47
internal/app/wxApplet/model/entity/bus_construction_user.go
Normal file
47
internal/app/wxApplet/model/entity/bus_construction_user.go
Normal file
@ -0,0 +1,47 @@
|
||||
// ==========================================================================
|
||||
// GFast自动生成model entity操作代码。
|
||||
// 生成日期:2023-08-07 11:17:50
|
||||
// 生成路径: internal/app/wxApplet/model/entity/bus_construction_user.go
|
||||
// 生成人:gfast
|
||||
// desc:施工人员
|
||||
// company:云南奇讯科技有限公司
|
||||
// ==========================================================================
|
||||
|
||||
package entity
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
"github.com/gogf/gf/v2/util/gmeta"
|
||||
)
|
||||
|
||||
// BusConstructionUser is the golang structure for table bus_construction_user.
|
||||
type BusConstructionUser struct {
|
||||
gmeta.Meta `orm:"table:bus_construction_user"`
|
||||
Id int64 `orm:"id,primary" json:"id"` // 序号
|
||||
Openid string `orm:"openid" json:"openid"` // 微信id
|
||||
NickName string `orm:"nick_name" json:"nickName"` // 微信名称
|
||||
TeamId int64 `orm:"team_id" json:"teamId"` // 班组id
|
||||
HeadIcon string `orm:"head_icon" json:"headIcon"` // 登陆照片
|
||||
PacePhoto string `orm:"pace_photo" json:"pacePhoto"` // 人脸照
|
||||
UserName string `orm:"user_name" json:"userName"` // 人员姓名
|
||||
ProjectId int64 `orm:"project_id" json:"projectId"` // 项目id
|
||||
Status string `orm:"status" json:"status"` // 状态
|
||||
IsPinch string `orm:"is_pinch" json:"isPinch"` // 是否代打
|
||||
IfManagement string `orm:"if_management" json:"ifManagement"` // 是否班组管理
|
||||
CreateBy string `orm:"create_by" json:"createBy"` // 创建者
|
||||
UpdateBy string `orm:"update_by" json:"updateBy"` // 更新者
|
||||
CreatedAt *gtime.Time `orm:"created_at" json:"createdAt"` // 创建时间
|
||||
UpdatedAt *gtime.Time `orm:"updated_at" json:"updatedAt"` // 更新时间
|
||||
DeletedAt *gtime.Time `orm:"deleted_at" json:"deletedAt"` // 删除时间
|
||||
Phone string `orm:"phone" json:"phone"` // 电话
|
||||
Sex string `orm:"sex" json:"sex"` // 性别
|
||||
SfzNation string `orm:"sfz_nation" json:"sfzNation"` // 身份证民族
|
||||
SfzNumber string `orm:"sfz_number" json:"sfzNumber"` // 身份证号码
|
||||
SfzStart string `orm:"sfz_start" json:"sfzStart"` // 身份证有效开始期
|
||||
SfzEnd string `orm:"sfz_end" json:"sfzEnd"` // 身份证有效结束期
|
||||
SfzSite string `orm:"sfz_site" json:"sfzSite"` // 身份证地址
|
||||
NativePlace string `orm:"native_place" json:"nativePlace"` // 籍贯
|
||||
YhkNumber string `orm:"yhk_number" json:"yhkNumber"` // 银行卡号
|
||||
YhkOpeningBank string `orm:"yhk_opening_bank" json:"yhkOpeningBank"` // 开户行
|
||||
YhkCardholder string `orm:"yhk_cardholder" json:"yhkCardholder"` // 持卡人
|
||||
}
|
||||
@ -0,0 +1,30 @@
|
||||
// ==========================================================================
|
||||
// GFast自动生成model entity操作代码。
|
||||
// 生成日期:2023-08-07 11:17:55
|
||||
// 生成路径: internal/app/wxApplet/model/entity/bus_construction_user_file.go
|
||||
// 生成人:gfast
|
||||
// desc:微信用户的文件存储
|
||||
// company:云南奇讯科技有限公司
|
||||
// ==========================================================================
|
||||
|
||||
package entity
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
"github.com/gogf/gf/v2/util/gmeta"
|
||||
)
|
||||
|
||||
// BusConstructionUserFile is the golang structure for table bus_construction_user_file.
|
||||
type BusConstructionUserFile struct {
|
||||
gmeta.Meta `orm:"table:bus_construction_user_file"`
|
||||
Id int64 `orm:"id,primary" json:"id"` // 主键ID
|
||||
UserId int64 `orm:"user_id" json:"userId"` // 用户id
|
||||
UserImgType string `orm:"user_img_type" json:"userImgType"` // 图片类型
|
||||
Path string `orm:"path" json:"path"` // 图片路径
|
||||
CreateBy string `orm:"create_by" json:"createBy"` // 创建者
|
||||
UpdateBy string `orm:"update_by" json:"updateBy"` // 更新者
|
||||
CreatedAt *gtime.Time `orm:"created_at" json:"createdAt"` // 创建时间
|
||||
UpdatedAt *gtime.Time `orm:"updated_at" json:"updatedAt"` // 更新时间
|
||||
DeletedAt *gtime.Time `orm:"deleted_at" json:"deletedAt"` // 删除时间
|
||||
Remark string `orm:"remark" json:"remark"` // 备注
|
||||
}
|
||||
@ -0,0 +1,22 @@
|
||||
// ==========================================================================
|
||||
// GFast自动生成model entity操作代码。
|
||||
// 生成日期:2023-08-07 11:17:55
|
||||
// 生成路径: internal/app/wxApplet/model/entity/bus_construction_user_post.go
|
||||
// 生成人:gfast
|
||||
// desc:施工人员岗位
|
||||
// company:云南奇讯科技有限公司
|
||||
// ==========================================================================
|
||||
|
||||
package entity
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/util/gmeta"
|
||||
)
|
||||
|
||||
// BusConstructionUserPost is the golang structure for table bus_construction_user_post.
|
||||
type BusConstructionUserPost struct {
|
||||
gmeta.Meta `orm:"table:bus_construction_user_post"`
|
||||
Id uint64 `orm:"id,primary" json:"id"` // 序号
|
||||
ConstructionUserId int64 `orm:"construction_user_id" json:"constructionUserId"` // 施工人员id
|
||||
PostId int64 `orm:"post_id" json:"postId"` // 岗位id
|
||||
}
|
||||
30
internal/app/wxApplet/model/entity/bus_labourservice.go
Normal file
30
internal/app/wxApplet/model/entity/bus_labourservice.go
Normal file
@ -0,0 +1,30 @@
|
||||
// ==========================================================================
|
||||
// GFast自动生成model entity操作代码。
|
||||
// 生成日期:2023-08-14 11:24:31
|
||||
// 生成路径: internal/app/wxApplet/model/entity/bus_labourservice.go
|
||||
// 生成人:gfast
|
||||
// desc:劳务公司
|
||||
// company:云南奇讯科技有限公司
|
||||
// ==========================================================================
|
||||
|
||||
package entity
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
"github.com/gogf/gf/v2/util/gmeta"
|
||||
)
|
||||
|
||||
// BusLabourservice is the golang structure for table bus_labourservice.
|
||||
type BusLabourservice struct {
|
||||
gmeta.Meta `orm:"table:bus_labourservice"`
|
||||
Id int64 `orm:"id,primary" json:"id"` // 主键ID
|
||||
Name string `orm:"name" json:"name"` // 劳务公司
|
||||
Principal string `orm:"principal" json:"principal"` // 负责人
|
||||
Phone string `orm:"phone" json:"phone"` // 联系电话
|
||||
CreateBy string `orm:"create_by" json:"createBy"` // 创建人
|
||||
UpdateBy string `orm:"update_by" json:"updateBy"` // 更新人
|
||||
CreatedAt *gtime.Time `orm:"created_at" json:"createdAt"` // 创建时间
|
||||
UpdatedAt *gtime.Time `orm:"updated_at" json:"updatedAt"` // 更新时间
|
||||
DeletedAt *gtime.Time `orm:"deleted_at" json:"deletedAt"` // 删除时间
|
||||
Remark string `orm:"remark" json:"remark"` // 备注
|
||||
}
|
||||
28
internal/app/wxApplet/model/entity/sys_project_team.go
Normal file
28
internal/app/wxApplet/model/entity/sys_project_team.go
Normal file
@ -0,0 +1,28 @@
|
||||
// ==========================================================================
|
||||
// GFast自动生成model entity操作代码。
|
||||
// 生成日期:2023-08-15 09:34:52
|
||||
// 生成路径: internal/app/wxApplet/model/entity/sys_project_team.go
|
||||
// 生成人:gfast
|
||||
// desc:项目班组
|
||||
// company:云南奇讯科技有限公司
|
||||
// ==========================================================================
|
||||
|
||||
package entity
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
"github.com/gogf/gf/v2/util/gmeta"
|
||||
)
|
||||
|
||||
// SysProjectTeam is the golang structure for table sys_project_team.
|
||||
type SysProjectTeam struct {
|
||||
gmeta.Meta `orm:"table:sys_project_team"`
|
||||
Id int64 `orm:"id,primary" json:"id"` // 主键ID
|
||||
ProjectId string `orm:"project_id" json:"projectId"` // 项目id
|
||||
Name string `orm:"name" json:"name"` // 班组名称
|
||||
CreateBy string `orm:"create_by" json:"createBy"` // 创建者
|
||||
UpdateBy string `orm:"update_by" json:"updateBy"` // 更新者
|
||||
CreateTime *gtime.Time `orm:"create_time" json:"createTime"` // 创建时间
|
||||
UpdateTime *gtime.Time `orm:"update_time" json:"updateTime"` // 更新时间
|
||||
DeletedAt *gtime.Time `orm:"deleted_at" json:"deletedAt"` // 删除时间
|
||||
}
|
||||
@ -0,0 +1,27 @@
|
||||
// ==========================================================================
|
||||
// GFast自动生成model entity操作代码。
|
||||
// 生成日期:2023-08-15 09:34:52
|
||||
// 生成路径: internal/app/wxApplet/model/entity/sys_project_team_member.go
|
||||
// 生成人:gfast
|
||||
// desc:项目班组下的成员
|
||||
// company:云南奇讯科技有限公司
|
||||
// ==========================================================================
|
||||
|
||||
package entity
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
"github.com/gogf/gf/v2/util/gmeta"
|
||||
)
|
||||
|
||||
// SysProjectTeamMember is the golang structure for table sys_project_team_member.
|
||||
type SysProjectTeamMember struct {
|
||||
gmeta.Meta `orm:"table:sys_project_team_member"`
|
||||
Id int64 `orm:"id,primary" json:"id"` // 主键ID
|
||||
ProjectId int64 `orm:"project_id" json:"projectId"` // 项目id
|
||||
Openid string `orm:"openid" json:"openid"` // 微信用户标识
|
||||
PostId int64 `orm:"post_id" json:"postId"` // 岗位(默认为4普通员工,组长为10)
|
||||
CreateTime *gtime.Time `orm:"create_time" json:"createTime"` // 创建时间
|
||||
UpdateTime *gtime.Time `orm:"update_time" json:"updateTime"` // 更新时间
|
||||
DeletedAt *gtime.Time `orm:"deleted_at" json:"deletedAt"` // 删除时间
|
||||
}
|
||||
32
internal/app/wxApplet/model/entity/sys_project_team_squad.go
Normal file
32
internal/app/wxApplet/model/entity/sys_project_team_squad.go
Normal file
@ -0,0 +1,32 @@
|
||||
// ==========================================================================
|
||||
// GFast自动生成model entity操作代码。
|
||||
// 生成日期:2023-08-30 15:24:06
|
||||
// 生成路径: internal/app/wxApplet/model/entity/sys_project_team_squad.go
|
||||
// 生成人:gfast
|
||||
// desc:站班会
|
||||
// company:云南奇讯科技有限公司
|
||||
// ==========================================================================
|
||||
|
||||
package entity
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
"github.com/gogf/gf/v2/util/gmeta"
|
||||
)
|
||||
|
||||
// SysProjectTeamSquad is the golang structure for table sys_project_team_squad.
|
||||
type SysProjectTeamSquad struct {
|
||||
gmeta.Meta `orm:"table:sys_project_team_squad"`
|
||||
Id int64 `orm:"id,primary" json:"id"` // 主键ID
|
||||
TeamId int64 `orm:"team_id" json:"teamId"` // 班组ID
|
||||
MeetingDate *gtime.Time `orm:"meeting_date" json:"meetingDate"` // 开会时间
|
||||
CompereId int64 `orm:"compere_id" json:"compereId"` // 宣讲人
|
||||
ParticipantId string `orm:"participant_id" json:"participantId"` // 参与人ID(多个用,号隔开)
|
||||
Content string `orm:"content" json:"content"` // 班会内容
|
||||
Picture string `orm:"picture" json:"picture"` // 班会图片(多个用,号隔开)
|
||||
CreateBy string `orm:"create_by" json:"createBy"` // 创建人
|
||||
UpdateBy string `orm:"update_by" json:"updateBy"` // 更新人
|
||||
CreatedAt *gtime.Time `orm:"created_at" json:"createdAt"` // 创建时间
|
||||
UpdatedAt *gtime.Time `orm:"updated_at" json:"updatedAt"` // 更新时间
|
||||
DeletedAt *gtime.Time `orm:"deleted_at" json:"deletedAt"` // 删除时间
|
||||
}
|
||||
@ -0,0 +1,28 @@
|
||||
// ==========================================================================
|
||||
// GFast自动生成model entity操作代码。
|
||||
// 生成日期:2023-08-21 09:19:15
|
||||
// 生成路径: internal/app/wxApplet/model/entity/sys_user_project_relevancy.go
|
||||
// 生成人:gfast
|
||||
// desc:系统用户与项目关联
|
||||
// company:云南奇讯科技有限公司
|
||||
// ==========================================================================
|
||||
|
||||
package entity
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
"github.com/gogf/gf/v2/util/gmeta"
|
||||
)
|
||||
|
||||
// SysUserProjectRelevancy is the golang structure for table sys_user_project_relevancy.
|
||||
type SysUserProjectRelevancy struct {
|
||||
gmeta.Meta `orm:"table:sys_user_project_relevancy"`
|
||||
Id int64 `orm:"id,primary" json:"id"` // 主键ID
|
||||
UserId int64 `orm:"user_id" json:"userId"` // 用户ID
|
||||
ProjectId int64 `orm:"project_id" json:"projectId"` // 项目ID
|
||||
CreateBy string `orm:"create_by" json:"createBy"` // 创建人
|
||||
UpdateBy string `orm:"update_by" json:"updateBy"` // 更新人
|
||||
CreatedAt *gtime.Time `orm:"created_at" json:"createdAt"` // 创建时间
|
||||
UpdatedAt *gtime.Time `orm:"updated_at" json:"updatedAt"` // 更新时间
|
||||
DeletedAt *gtime.Time `orm:"deleted_at" json:"deletedAt"` // 删除时间
|
||||
}
|
||||
37
internal/app/wxApplet/model/sys_project_team.go
Normal file
37
internal/app/wxApplet/model/sys_project_team.go
Normal file
@ -0,0 +1,37 @@
|
||||
// ==========================================================================
|
||||
// GFast自动生成model操作代码。
|
||||
// 生成日期:2023-08-15 09:34:52
|
||||
// 生成路径: internal/app/wxApplet/model/sys_project_team.go
|
||||
// 生成人:gfast
|
||||
// desc:项目班组
|
||||
// company:云南奇讯科技有限公司
|
||||
// ==========================================================================
|
||||
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
"github.com/gogf/gf/v2/util/gmeta"
|
||||
)
|
||||
|
||||
// SysProjectTeamInfoRes is the golang structure for table sys_project_team.
|
||||
type SysProjectTeamInfoRes struct {
|
||||
gmeta.Meta `orm:"table:sys_project_team"`
|
||||
Id int64 `orm:"id,primary" json:"id"` // 主键ID
|
||||
ProjectId string `orm:"project_id" json:"projectId"` // 项目id
|
||||
Name string `orm:"name" json:"name"` // 班组名称
|
||||
IsClockIn string `orm:"is_clock_in" json:"isClockIn"` // 班组名称
|
||||
CreateBy string `orm:"create_by" json:"createBy"` // 创建者
|
||||
UpdateBy string `orm:"update_by" json:"updateBy"` // 更新者
|
||||
CreateTime *gtime.Time `orm:"create_time" json:"createTime"` // 创建时间
|
||||
UpdateTime *gtime.Time `orm:"update_time" json:"updateTime"` // 更新时间
|
||||
DeletedAt *gtime.Time `orm:"deleted_at" json:"deletedAt"` // 删除时间
|
||||
}
|
||||
|
||||
type SysProjectTeamListRes struct {
|
||||
Id int64 `json:"id" dc:"班组主键ID"`
|
||||
ProjectId string `json:"projectId" dc:"项目ID"`
|
||||
Name string `json:"name" dc:"班组名称"`
|
||||
IsClockIn string `json:"isClockIn" dc:"范围内打卡(1范围内打卡 2任何地点打卡)默认为2"`
|
||||
CreateTime *gtime.Time `json:"createTime" dc:"创建时间"`
|
||||
}
|
||||
49
internal/app/wxApplet/model/sys_project_team_member.go
Normal file
49
internal/app/wxApplet/model/sys_project_team_member.go
Normal file
@ -0,0 +1,49 @@
|
||||
// ==========================================================================
|
||||
// GFast自动生成model操作代码。
|
||||
// 生成日期:2023-08-15 09:34:52
|
||||
// 生成路径: internal/app/wxApplet/model/sys_project_team_member.go
|
||||
// 生成人:gfast
|
||||
// desc:项目班组下的成员
|
||||
// company:云南奇讯科技有限公司
|
||||
// ==========================================================================
|
||||
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
"github.com/gogf/gf/v2/util/gmeta"
|
||||
)
|
||||
|
||||
// SysProjectTeamMemberInfoRes is the golang structure for table sys_project_team_member.
|
||||
type SysProjectTeamMemberInfoRes struct {
|
||||
gmeta.Meta `orm:"table:sys_project_team_member"`
|
||||
Id int64 `orm:"id,primary" json:"id"` // 主键ID
|
||||
TeamId int64 `orm:"team_id" json:"teamId"` // 班组id
|
||||
Openid string `orm:"openid" json:"openid"` // 微信用户标识
|
||||
PostId int64 `orm:"post_id" json:"postId"` // 岗位(默认为4普通员工,组长为10)
|
||||
CreateTime *gtime.Time `orm:"create_time" json:"createTime"` // 创建时间
|
||||
UpdateTime *gtime.Time `orm:"update_time" json:"updateTime"` // 更新时间
|
||||
DeletedAt *gtime.Time `orm:"deleted_at" json:"deletedAt"` // 删除时间
|
||||
ProjectId int64 `orm:"projectId" json:"project_id"` // 项目ID
|
||||
|
||||
HeadIcon string `orm:"head_icon" json:"headIcon"`
|
||||
Phone string `orm:"phone" json:"phone"`
|
||||
UserName string `orm:"user_name" json:"userName"`
|
||||
NickName string `orm:"nick_name" json:"nickName"`
|
||||
Original string `orm:"original" json:"original"`
|
||||
Salary string `orm:"salary" json:"salary"`
|
||||
WoPdf string `orm:"wo_pdf" json:"WoPdf" dc:"是否有试卷(不为空表示有)"`
|
||||
}
|
||||
|
||||
type SysProjectTeamMemberListRes struct {
|
||||
Id int64 `json:"id"`
|
||||
TeamId int64 `json:"teamId"`
|
||||
Openid string `json:"openid"`
|
||||
PostId int64 `json:"postId"`
|
||||
HeadIcon string `json:"headIcon"`
|
||||
Phone string `json:"phone"`
|
||||
UserName string `json:"userName"`
|
||||
NickName string `json:"nickName"`
|
||||
Original string `json:"original"`
|
||||
Salary string `json:"salary"`
|
||||
}
|
||||
53
internal/app/wxApplet/model/sys_project_team_squad.go
Normal file
53
internal/app/wxApplet/model/sys_project_team_squad.go
Normal file
@ -0,0 +1,53 @@
|
||||
// ==========================================================================
|
||||
// GFast自动生成model操作代码。
|
||||
// 生成日期:2023-08-30 15:24:06
|
||||
// 生成路径: internal/app/wxApplet/model/sys_project_team_squad.go
|
||||
// 生成人:gfast
|
||||
// desc:站班会
|
||||
// company:云南奇讯科技有限公司
|
||||
// ==========================================================================
|
||||
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
"github.com/gogf/gf/v2/util/gmeta"
|
||||
)
|
||||
|
||||
// SysProjectTeamSquadInfoRes is the golang structure for table sys_project_team_squad.
|
||||
type SysProjectTeamSquadInfoRes struct {
|
||||
gmeta.Meta `orm:"table:sys_project_team_squad"`
|
||||
Id int64 `orm:"id,primary" json:"id"` // 主键ID
|
||||
TeamId int64 `orm:"team_id" json:"teamId"` // 班组ID
|
||||
MeetingDate *gtime.Time `orm:"meeting_date" json:"meetingDate"` // 开会时间
|
||||
CompereId string `orm:"compere_id" json:"compereId"` // 宣讲人
|
||||
ParticipantId string `orm:"participant_id" json:"participantId"` // 参与人ID(多个用,号隔开)
|
||||
Content string `orm:"content" json:"content"` // 班会内容
|
||||
Picture string `orm:"picture" json:"picture"` // 班会图片(多个用,号隔开)
|
||||
CreateBy string `orm:"create_by" json:"createBy"` // 创建人
|
||||
UpdateBy string `orm:"update_by" json:"updateBy"` // 更新人
|
||||
CreatedAt *gtime.Time `orm:"created_at" json:"createdAt"` // 创建时间
|
||||
UpdatedAt *gtime.Time `orm:"updated_at" json:"updatedAt"` // 更新时间
|
||||
DeletedAt *gtime.Time `orm:"deleted_at" json:"deletedAt"` // 删除时间
|
||||
TeamName string `orm:"team_name" json:"teamName"` // 班组名称
|
||||
LabourserviceName string `orm:"labourservice_name" json:"labourserviceName"` // 劳务公司名称
|
||||
CompereName string `orm:"compere_name" json:"compereName"` // 主持人名称
|
||||
ParticipantName string `orm:"participant_name" json:"participantName"` // 参与人名称
|
||||
}
|
||||
|
||||
type SysProjectTeamSquadListRes struct {
|
||||
Id int64 `json:"id"`
|
||||
TeamId int64 `json:"teamId"`
|
||||
MeetingDate *gtime.Time `json:"meetingDate"`
|
||||
CompereId string `json:"compereId"`
|
||||
ParticipantId string `json:"participantId"`
|
||||
Content string `json:"content"`
|
||||
Picture string `json:"picture"`
|
||||
CreatedAt *gtime.Time `json:"createdAt"`
|
||||
TeamName string `json:"teamName"`
|
||||
LabourserviceName string `json:"labourserviceName"`
|
||||
CompereName string `json:"compereName"`
|
||||
ParticipantName string `json:"participantName"`
|
||||
}
|
||||
type name struct {
|
||||
}
|
||||
47
internal/app/wxApplet/model/sys_user_project_relevancy.go
Normal file
47
internal/app/wxApplet/model/sys_user_project_relevancy.go
Normal file
@ -0,0 +1,47 @@
|
||||
// ==========================================================================
|
||||
// GFast自动生成model操作代码。
|
||||
// 生成日期:2023-08-21 09:19:15
|
||||
// 生成路径: internal/app/wxApplet/model/sys_user_project_relevancy.go
|
||||
// 生成人:gfast
|
||||
// desc:系统用户与项目关联
|
||||
// company:云南奇讯科技有限公司
|
||||
// ==========================================================================
|
||||
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
"github.com/gogf/gf/v2/util/gmeta"
|
||||
)
|
||||
|
||||
// SysUserProjectRelevancyInfoRes is the golang structure for table sys_user_project_relevancy.
|
||||
type SysUserProjectRelevancyInfoRes struct {
|
||||
gmeta.Meta `orm:"table:sys_user_project_relevancy"`
|
||||
Id int64 `orm:"id,primary" json:"id"` // 主键ID
|
||||
UserId int64 `orm:"user_id" json:"userId"` // 用户ID
|
||||
ProjectId int64 `orm:"project_id" json:"projectId"` // 项目ID
|
||||
CreateBy string `orm:"create_by" json:"createBy"` // 创建人
|
||||
UpdateBy string `orm:"update_by" json:"updateBy"` // 更新人
|
||||
CreatedAt *gtime.Time `orm:"created_at" json:"createdAt"` // 创建时间
|
||||
UpdatedAt *gtime.Time `orm:"updated_at" json:"updatedAt"` // 更新时间
|
||||
DeletedAt *gtime.Time `orm:"deleted_at" json:"deletedAt"` // 删除时间
|
||||
|
||||
ProjectName string `orm:"project_name" json:"projectName"` // 项目名称
|
||||
ProjectSite string `orm:"project_site"`
|
||||
Lng string `orm:"lng" json:"lng"` // 经度
|
||||
Lat string `orm:"lat" json:"lat"` // 纬度
|
||||
Type string `orm:"type" json:"type"` // 项目类型
|
||||
}
|
||||
|
||||
type SysUserProjectRelevancyListRes struct {
|
||||
Id int64 `json:"id"`
|
||||
UserId int64 `json:"userId"`
|
||||
ProjectId int64 `json:"projectId"`
|
||||
CreatedAt *gtime.Time `json:"createdAt"`
|
||||
|
||||
ProjectName string ` json:"projectName"` // 项目名称
|
||||
ProjectSite string ` json:"project_site" dc:"项目地址"`
|
||||
Lng string ` json:"lng"` // 经度
|
||||
Lat string ` json:"lat"` // 纬度
|
||||
Type string ` json:"type"` // 项目类型
|
||||
}
|
||||
15
internal/app/wxApplet/router/appPort.go
Normal file
15
internal/app/wxApplet/router/appPort.go
Normal file
@ -0,0 +1,15 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/net/ghttp"
|
||||
"github.com/tiger1103/gfast/v3/internal/app/wxApplet/controller"
|
||||
"golang.org/x/net/context"
|
||||
)
|
||||
|
||||
func (router *Router) BindAppPortController(ctx context.Context, group *ghttp.RouterGroup) {
|
||||
group.Group("/appPort", func(group *ghttp.RouterGroup) {
|
||||
group.Bind(
|
||||
controller.AppPortController,
|
||||
)
|
||||
})
|
||||
}
|
||||
24
internal/app/wxApplet/router/bus_attendance.go
Normal file
24
internal/app/wxApplet/router/bus_attendance.go
Normal file
@ -0,0 +1,24 @@
|
||||
// ==========================================================================
|
||||
// GFast自动生成router操作代码。
|
||||
// 生成日期:2023-08-07 16:29:52
|
||||
// 生成路径: internal/app/wxApplet/router/bus_attendance.go
|
||||
// 生成人:gfast
|
||||
// desc:考勤
|
||||
// company:云南奇讯科技有限公司
|
||||
// ==========================================================================
|
||||
|
||||
package router
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/net/ghttp"
|
||||
"github.com/tiger1103/gfast/v3/internal/app/wxApplet/controller"
|
||||
)
|
||||
|
||||
func (router *Router) BindBusAttendanceController(ctx context.Context, group *ghttp.RouterGroup) {
|
||||
group.Group("/busAttendance", func(group *ghttp.RouterGroup) {
|
||||
group.Bind(
|
||||
controller.BusAttendance,
|
||||
)
|
||||
})
|
||||
}
|
||||
24
internal/app/wxApplet/router/bus_construction_project.go
Normal file
24
internal/app/wxApplet/router/bus_construction_project.go
Normal file
@ -0,0 +1,24 @@
|
||||
// ==========================================================================
|
||||
// GFast自动生成router操作代码。
|
||||
// 生成日期:2023-08-07 11:17:50
|
||||
// 生成路径: internal/app/wxApplet/router/bus_construction_project.go
|
||||
// 生成人:gfast
|
||||
// desc:施工人员对应项目
|
||||
// company:云南奇讯科技有限公司
|
||||
// ==========================================================================
|
||||
|
||||
package router
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/net/ghttp"
|
||||
"github.com/tiger1103/gfast/v3/internal/app/wxApplet/controller"
|
||||
)
|
||||
|
||||
func (router *Router) BindBusConstructionProjectController(ctx context.Context, group *ghttp.RouterGroup) {
|
||||
group.Group("/busConstructionProject", func(group *ghttp.RouterGroup) {
|
||||
group.Bind(
|
||||
controller.BusConstructionProject,
|
||||
)
|
||||
})
|
||||
}
|
||||
24
internal/app/wxApplet/router/bus_construction_user.go
Normal file
24
internal/app/wxApplet/router/bus_construction_user.go
Normal file
@ -0,0 +1,24 @@
|
||||
// ==========================================================================
|
||||
// GFast自动生成router操作代码。
|
||||
// 生成日期:2023-08-07 11:17:50
|
||||
// 生成路径: internal/app/wxApplet/router/bus_construction_user.go
|
||||
// 生成人:gfast
|
||||
// desc:施工人员
|
||||
// company:云南奇讯科技有限公司
|
||||
// ==========================================================================
|
||||
|
||||
package router
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/net/ghttp"
|
||||
"github.com/tiger1103/gfast/v3/internal/app/wxApplet/controller"
|
||||
)
|
||||
|
||||
func (router *Router) BindBusConstructionUserController(ctx context.Context, group *ghttp.RouterGroup) {
|
||||
group.Group("/busConstructionUser", func(group *ghttp.RouterGroup) {
|
||||
group.Bind(
|
||||
controller.BusConstructionUser,
|
||||
)
|
||||
})
|
||||
}
|
||||
24
internal/app/wxApplet/router/bus_construction_user_file.go
Normal file
24
internal/app/wxApplet/router/bus_construction_user_file.go
Normal file
@ -0,0 +1,24 @@
|
||||
// ==========================================================================
|
||||
// GFast自动生成router操作代码。
|
||||
// 生成日期:2023-08-07 11:17:55
|
||||
// 生成路径: internal/app/wxApplet/router/bus_construction_user_file.go
|
||||
// 生成人:gfast
|
||||
// desc:微信用户的文件存储
|
||||
// company:云南奇讯科技有限公司
|
||||
// ==========================================================================
|
||||
|
||||
package router
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/net/ghttp"
|
||||
"github.com/tiger1103/gfast/v3/internal/app/wxApplet/controller"
|
||||
)
|
||||
|
||||
func (router *Router) BindBusConstructionUserFileController(ctx context.Context, group *ghttp.RouterGroup) {
|
||||
group.Group("/busConstructionUserFile", func(group *ghttp.RouterGroup) {
|
||||
group.Bind(
|
||||
controller.BusConstructionUserFile,
|
||||
)
|
||||
})
|
||||
}
|
||||
24
internal/app/wxApplet/router/bus_construction_user_post.go
Normal file
24
internal/app/wxApplet/router/bus_construction_user_post.go
Normal file
@ -0,0 +1,24 @@
|
||||
// ==========================================================================
|
||||
// GFast自动生成router操作代码。
|
||||
// 生成日期:2023-08-07 11:17:55
|
||||
// 生成路径: internal/app/wxApplet/router/bus_construction_user_post.go
|
||||
// 生成人:gfast
|
||||
// desc:施工人员岗位
|
||||
// company:云南奇讯科技有限公司
|
||||
// ==========================================================================
|
||||
|
||||
package router
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/net/ghttp"
|
||||
"github.com/tiger1103/gfast/v3/internal/app/wxApplet/controller"
|
||||
)
|
||||
|
||||
func (router *Router) BindBusConstructionUserPostController(ctx context.Context, group *ghttp.RouterGroup) {
|
||||
group.Group("/busConstructionUserPost", func(group *ghttp.RouterGroup) {
|
||||
group.Bind(
|
||||
controller.BusConstructionUserPost,
|
||||
)
|
||||
})
|
||||
}
|
||||
24
internal/app/wxApplet/router/bus_labourservice.go
Normal file
24
internal/app/wxApplet/router/bus_labourservice.go
Normal file
@ -0,0 +1,24 @@
|
||||
// ==========================================================================
|
||||
// GFast自动生成router操作代码。
|
||||
// 生成日期:2023-08-14 11:24:31
|
||||
// 生成路径: internal/app/wxApplet/router/bus_labourservice.go
|
||||
// 生成人:gfast
|
||||
// desc:劳务公司
|
||||
// company:云南奇讯科技有限公司
|
||||
// ==========================================================================
|
||||
|
||||
package router
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/net/ghttp"
|
||||
"github.com/tiger1103/gfast/v3/internal/app/wxApplet/controller"
|
||||
)
|
||||
|
||||
func (router *Router) BindBusLabourserviceController(ctx context.Context, group *ghttp.RouterGroup) {
|
||||
group.Group("/busLabourservice", func(group *ghttp.RouterGroup) {
|
||||
group.Bind(
|
||||
controller.BusLabourservice,
|
||||
)
|
||||
})
|
||||
}
|
||||
15
internal/app/wxApplet/router/process.go
Normal file
15
internal/app/wxApplet/router/process.go
Normal file
@ -0,0 +1,15 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/net/ghttp"
|
||||
"github.com/tiger1103/gfast/v3/api/app/process"
|
||||
)
|
||||
|
||||
func InitAppProcessAPI(group *ghttp.RouterGroup) {
|
||||
group.Middleware(ghttp.MiddlewareCORS)
|
||||
group.Group("/process", func(group *ghttp.RouterGroup) {
|
||||
group.Group("/api/v1", func(group *ghttp.RouterGroup) {
|
||||
group.Bind(new(process.ProcessApi))
|
||||
})
|
||||
})
|
||||
}
|
||||
15
internal/app/wxApplet/router/project.go
Normal file
15
internal/app/wxApplet/router/project.go
Normal file
@ -0,0 +1,15 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/net/ghttp"
|
||||
"github.com/tiger1103/gfast/v3/api/app/project"
|
||||
)
|
||||
|
||||
func InitAppProjectAPI(group *ghttp.RouterGroup) {
|
||||
group.Middleware(ghttp.MiddlewareCORS)
|
||||
group.Group("/project", func(group *ghttp.RouterGroup) {
|
||||
group.Group("/api/v1", func(group *ghttp.RouterGroup) {
|
||||
group.Bind(new(project.Project))
|
||||
})
|
||||
})
|
||||
}
|
||||
36
internal/app/wxApplet/router/router.go
Normal file
36
internal/app/wxApplet/router/router.go
Normal file
@ -0,0 +1,36 @@
|
||||
// ==========================================================================
|
||||
// GFast自动生成router操作代码。
|
||||
// 生成日期:2025-03-27 14:14:25
|
||||
// 生成路径: internal/app/wxApplet/router/bus_askforleave.go
|
||||
// 生成人:gfast
|
||||
// desc:请假
|
||||
// company:云南奇讯科技有限公司
|
||||
// ==========================================================================
|
||||
|
||||
package router
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/net/ghttp"
|
||||
"github.com/tiger1103/gfast/v3/internal/app/system/service"
|
||||
"github.com/tiger1103/gfast/v3/library/libRouter"
|
||||
)
|
||||
|
||||
var R = new(Router)
|
||||
|
||||
type Router struct{}
|
||||
|
||||
func (router *Router) BindController(ctx context.Context, group *ghttp.RouterGroup) {
|
||||
group.Group("/wxApplet", func(group *ghttp.RouterGroup) {
|
||||
//登录验证拦截
|
||||
service.GfToken().Middleware(group)
|
||||
//context拦截器
|
||||
group.Middleware(service.Middleware().Ctx, service.Middleware().Auth)
|
||||
//后台操作日志记录
|
||||
group.Hook("/*", ghttp.HookAfterOutput, service.OperateLog().OperationLog)
|
||||
//自动绑定定义的控制器
|
||||
if err := libRouter.RouterAutoBind(ctx, router, group); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
})
|
||||
}
|
||||
15
internal/app/wxApplet/router/stage.go
Normal file
15
internal/app/wxApplet/router/stage.go
Normal file
@ -0,0 +1,15 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/net/ghttp"
|
||||
"github.com/tiger1103/gfast/v3/api/app/stage"
|
||||
)
|
||||
|
||||
func InitAppStageAPI(group *ghttp.RouterGroup) {
|
||||
group.Middleware(ghttp.MiddlewareCORS)
|
||||
group.Group("/stage", func(group *ghttp.RouterGroup) {
|
||||
group.Group("/api/v1", func(group *ghttp.RouterGroup) {
|
||||
group.Bind(new(stage.StageApi))
|
||||
})
|
||||
})
|
||||
}
|
||||
24
internal/app/wxApplet/router/sys_project_team.go
Normal file
24
internal/app/wxApplet/router/sys_project_team.go
Normal file
@ -0,0 +1,24 @@
|
||||
// ==========================================================================
|
||||
// GFast自动生成router操作代码。
|
||||
// 生成日期:2023-08-15 09:34:52
|
||||
// 生成路径: internal/app/wxApplet/router/sys_project_team.go
|
||||
// 生成人:gfast
|
||||
// desc:项目班组
|
||||
// company:云南奇讯科技有限公司
|
||||
// ==========================================================================
|
||||
|
||||
package router
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/net/ghttp"
|
||||
"github.com/tiger1103/gfast/v3/internal/app/wxApplet/controller"
|
||||
)
|
||||
|
||||
func (router *Router) BindSysProjectTeamController(ctx context.Context, group *ghttp.RouterGroup) {
|
||||
group.Group("/sysProjectTeam", func(group *ghttp.RouterGroup) {
|
||||
group.Bind(
|
||||
controller.SysProjectTeam,
|
||||
)
|
||||
})
|
||||
}
|
||||
24
internal/app/wxApplet/router/sys_project_team_member.go
Normal file
24
internal/app/wxApplet/router/sys_project_team_member.go
Normal file
@ -0,0 +1,24 @@
|
||||
// ==========================================================================
|
||||
// GFast自动生成router操作代码。
|
||||
// 生成日期:2023-08-15 09:34:52
|
||||
// 生成路径: internal/app/wxApplet/router/sys_project_team_member.go
|
||||
// 生成人:gfast
|
||||
// desc:项目班组下的成员
|
||||
// company:云南奇讯科技有限公司
|
||||
// ==========================================================================
|
||||
|
||||
package router
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/net/ghttp"
|
||||
"github.com/tiger1103/gfast/v3/internal/app/wxApplet/controller"
|
||||
)
|
||||
|
||||
func (router *Router) BindSysProjectTeamMemberController(ctx context.Context, group *ghttp.RouterGroup) {
|
||||
group.Group("/sysProjectTeamMember", func(group *ghttp.RouterGroup) {
|
||||
group.Bind(
|
||||
controller.SysProjectTeamMember,
|
||||
)
|
||||
})
|
||||
}
|
||||
24
internal/app/wxApplet/router/sys_project_team_squad.go
Normal file
24
internal/app/wxApplet/router/sys_project_team_squad.go
Normal file
@ -0,0 +1,24 @@
|
||||
// ==========================================================================
|
||||
// GFast自动生成router操作代码。
|
||||
// 生成日期:2023-08-30 15:24:06
|
||||
// 生成路径: internal/app/wxApplet/router/sys_project_team_squad.go
|
||||
// 生成人:gfast
|
||||
// desc:站班会
|
||||
// company:云南奇讯科技有限公司
|
||||
// ==========================================================================
|
||||
|
||||
package router
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/net/ghttp"
|
||||
"github.com/tiger1103/gfast/v3/internal/app/wxApplet/controller"
|
||||
)
|
||||
|
||||
func (router *Router) BindSysProjectTeamSquadController(ctx context.Context, group *ghttp.RouterGroup) {
|
||||
group.Group("/sysProjectTeamSquad", func(group *ghttp.RouterGroup) {
|
||||
group.Bind(
|
||||
controller.SysProjectTeamSquad,
|
||||
)
|
||||
})
|
||||
}
|
||||
24
internal/app/wxApplet/router/sys_user_project_relevancy.go
Normal file
24
internal/app/wxApplet/router/sys_user_project_relevancy.go
Normal file
@ -0,0 +1,24 @@
|
||||
// ==========================================================================
|
||||
// GFast自动生成router操作代码。
|
||||
// 生成日期:2023-08-21 09:19:15
|
||||
// 生成路径: internal/app/wxApplet/router/sys_user_project_relevancy.go
|
||||
// 生成人:gfast
|
||||
// desc:系统用户与项目关联
|
||||
// company:云南奇讯科技有限公司
|
||||
// ==========================================================================
|
||||
|
||||
package router
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/net/ghttp"
|
||||
"github.com/tiger1103/gfast/v3/internal/app/wxApplet/controller"
|
||||
)
|
||||
|
||||
func (router *Router) BindSysUserProjectRelevancyController(ctx context.Context, group *ghttp.RouterGroup) {
|
||||
group.Group("/sysUserProjectRelevancy", func(group *ghttp.RouterGroup) {
|
||||
group.Bind(
|
||||
controller.SysUserProjectRelevancy,
|
||||
)
|
||||
})
|
||||
}
|
||||
16
internal/app/wxApplet/router/visual.go
Normal file
16
internal/app/wxApplet/router/visual.go
Normal file
@ -0,0 +1,16 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/net/ghttp"
|
||||
"github.com/tiger1103/gfast/v3/api/app/visual"
|
||||
)
|
||||
|
||||
// 形象进度API
|
||||
func InitAppProjectVisualAPI(group *ghttp.RouterGroup) {
|
||||
group.Middleware(ghttp.MiddlewareCORS)
|
||||
group.Group("/visual", func(group *ghttp.RouterGroup) {
|
||||
group.Group("/api/v1", func(group *ghttp.RouterGroup) {
|
||||
group.Bind(new(visual.Visual))
|
||||
})
|
||||
})
|
||||
}
|
||||
15
internal/app/wxApplet/router/visual_remark.go
Normal file
15
internal/app/wxApplet/router/visual_remark.go
Normal file
@ -0,0 +1,15 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/net/ghttp"
|
||||
"github.com/tiger1103/gfast/v3/api/app/visual_remark"
|
||||
)
|
||||
|
||||
func InitAppVisualRemarkAPI(group *ghttp.RouterGroup) {
|
||||
group.Middleware(ghttp.MiddlewareCORS)
|
||||
group.Group("/remark", func(group *ghttp.RouterGroup) {
|
||||
group.Group("/api/v1", func(group *ghttp.RouterGroup) {
|
||||
group.Bind(new(visual_remark.VisualRemark))
|
||||
})
|
||||
})
|
||||
}
|
||||
42
internal/app/wxApplet/service/bus_askforleave.go
Normal file
42
internal/app/wxApplet/service/bus_askforleave.go
Normal file
@ -0,0 +1,42 @@
|
||||
// ==========================================================================
|
||||
// GFast自动生成service操作代码。
|
||||
// 生成日期:2025-03-27 14:14:25
|
||||
// 生成路径: internal/app/wxApplet/service/bus_askforleave.go
|
||||
// 生成人:gfast
|
||||
// desc:请假
|
||||
// company:云南奇讯科技有限公司
|
||||
// ==========================================================================
|
||||
|
||||
package service
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/tiger1103/gfast/v3/api/wxApplet/wxApplet"
|
||||
"github.com/tiger1103/gfast/v3/internal/app/wxApplet/model"
|
||||
)
|
||||
|
||||
type IBusAskforleave interface {
|
||||
List(ctx context.Context, req *wxApplet.BusAskforleaveSearchReq) (res *wxApplet.BusAskforleaveSearchRes, err error)
|
||||
GetById(ctx context.Context, Id int64) (res *model.BusAskforleaveInfoRes, err error)
|
||||
Add(ctx context.Context, req *wxApplet.BusAskforleaveAddReq) (err error)
|
||||
Edit(ctx context.Context, req *wxApplet.BusAskforleaveEditReq) (err error)
|
||||
Delete(ctx context.Context, Id []int64) (err error)
|
||||
|
||||
AppAskForLeaveAdd(ctx context.Context, req *wxApplet.AppAskForLeaveAddReq) (err error)
|
||||
AppAskForLeaveListPage(ctx context.Context, req *wxApplet.AppAskForLeaveListPageReq) (res *wxApplet.AppAskForLeaveListPageRes, err error)
|
||||
AppAskForLeaveInfo(ctx context.Context, req *wxApplet.AppAskForLeaveInfoReq) (res *wxApplet.AppAskForLeaveInfoRes, err error)
|
||||
AppBzzAskForLeaveUpdate(ctx context.Context, req *wxApplet.AppBzzAskForLeaveUpdateReq) (err error)
|
||||
}
|
||||
|
||||
var localBusAskforleave IBusAskforleave
|
||||
|
||||
func BusAskforleave() IBusAskforleave {
|
||||
if localBusAskforleave == nil {
|
||||
panic("implement not found for interface IBusAskforleave, forgot register?")
|
||||
}
|
||||
return localBusAskforleave
|
||||
}
|
||||
|
||||
func RegisterBusAskforleave(i IBusAskforleave) {
|
||||
localBusAskforleave = i
|
||||
}
|
||||
53
internal/app/wxApplet/service/bus_attendance.go
Normal file
53
internal/app/wxApplet/service/bus_attendance.go
Normal file
@ -0,0 +1,53 @@
|
||||
// ==========================================================================
|
||||
// GFast自动生成service操作代码。
|
||||
// 生成日期:2023-08-07 16:29:52
|
||||
// 生成路径: internal/app/wxApplet/service/bus_attendance.go
|
||||
// 生成人:gfast
|
||||
// desc:考勤
|
||||
// company:云南奇讯科技有限公司
|
||||
// ==========================================================================
|
||||
|
||||
package service
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/tiger1103/gfast/v3/api/wxApplet/wxApplet"
|
||||
"github.com/tiger1103/gfast/v3/internal/app/wxApplet/model"
|
||||
)
|
||||
|
||||
type IBusAttendance interface {
|
||||
SalaryDetailsFunc(ctx context.Context, req *wxApplet.SalaryDetailsReq) (res *wxApplet.SalaryDetailsRes, err error)
|
||||
Export(ctx context.Context, req *wxApplet.PunchingCardRecordReq) (res *wxApplet.PunchingCardRecordRes, err error)
|
||||
List(ctx context.Context, req *wxApplet.BusAttendanceSearchReq) (res *wxApplet.BusAttendanceSearchRes, err error)
|
||||
GetById(ctx context.Context, Id uint64) (res *model.BusAttendanceInfoRes, err error)
|
||||
Add(ctx context.Context, req *wxApplet.BusAttendanceAddReq) (err error)
|
||||
Edit(ctx context.Context, req *wxApplet.BusAttendanceEditReq) (err error)
|
||||
Delete(ctx context.Context, Id []uint64) (err error)
|
||||
ByOpenidFunc(ctx context.Context, req *wxApplet.ByOpenIdFuncReq) (res *wxApplet.ByOpenIdFuncRes, err error)
|
||||
DailyAbsenteeismFunc(ctx context.Context)
|
||||
PCListFunc(ctx context.Context, req *wxApplet.PCListReq) (res *wxApplet.PCListRes, err error)
|
||||
AttendanceByOpenIdFunc(ctx context.Context, openid string) (res *wxApplet.AttendanceByOpenIdRes, err error)
|
||||
AppMyAttendanceFunc(ctx context.Context, req *wxApplet.AppMyAttendanceReq) (res *wxApplet.AppMyAttendanceRes, err error)
|
||||
AppProjectOverviewFunc(ctx context.Context, req *wxApplet.AppProjectOverviewReq) (res *wxApplet.AppProjectOverviewRes, err error)
|
||||
AppMyAttendanceDetailsFunc(ctx context.Context, req *wxApplet.AppMyAttendanceDetailsReq) (res *wxApplet.AppMyAttendanceDetailsRes, err error)
|
||||
AppWhetherToEnterTheClockRangeFunc(ctx context.Context, req *wxApplet.AppWhetherToEnterTheClockRangeReq) (res *wxApplet.AppWhetherToEnterTheClockRangeRes, err error)
|
||||
AppClockingStatusOfTheDayFunc(ctx context.Context, req *wxApplet.AppClockingStatusOfTheDayReq) (res *wxApplet.AppClockingStatusOfTheDayRes, err error)
|
||||
AppSelectThisUserByCardRecordFunc(ctx context.Context, req *wxApplet.AppSelectThisUserByCardRecordReq) (res *wxApplet.AppSelectThisUserByCardRecordRes, err error)
|
||||
AppReissueACardListFunc(ctx context.Context, req *wxApplet.AppReissueACardListReq) (res *wxApplet.AppReissueACardListRes, err error)
|
||||
AppReissueACardIdFunc(ctx context.Context, req *wxApplet.AppReissueACardIdReq) (res *wxApplet.AppReissueACardIdRes, err error)
|
||||
AppLocationAttendanceStatisticsFunc(ctx context.Context, req *wxApplet.AppLocationAttendanceStatisticsReq) (res *wxApplet.AppLocationAttendanceStatisticsRes, err error)
|
||||
AppTeamAttendanceFunc(ctx context.Context, req *wxApplet.AppTeamAttendanceReq) (res *wxApplet.AppTeamAttendanceRes, err error)
|
||||
}
|
||||
|
||||
var localBusAttendance IBusAttendance
|
||||
|
||||
func BusAttendance() IBusAttendance {
|
||||
if localBusAttendance == nil {
|
||||
panic("implement not found for interface IBusAttendance, forgot register?")
|
||||
}
|
||||
return localBusAttendance
|
||||
}
|
||||
|
||||
func RegisterBusAttendance(i IBusAttendance) {
|
||||
localBusAttendance = i
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user