feat:完善项目
This commit is contained in:
@ -685,6 +685,35 @@ func (*Manage) MaterialSupplierDelete(c *gin.Context) {
|
||||
APIResponse(err)(c)
|
||||
}
|
||||
|
||||
/**
|
||||
* @api {post} /api/v1/manage/notice 公告信息
|
||||
* @apiVersion 1.0.0
|
||||
* @apiName ManageNotice
|
||||
* @apiGroup Manage
|
||||
*
|
||||
* @apiHeader {string} x-token token
|
||||
*
|
||||
* @apiSuccess (200) {Object} data 数据信息
|
||||
* @apiSuccess (200) {String} data.id ID
|
||||
* @apiSuccess (200) {String} data.title 标题
|
||||
* @apiSuccess (200) {Time} data.created_at 创建时间
|
||||
* @apiSuccess (200) {Number} code 成功响应状态码!
|
||||
* @apiSuccess (200) {String} msg 成功提示
|
||||
*
|
||||
* @apiSuccessExample {json} Success response:
|
||||
* HTTPS 200 OK
|
||||
* {
|
||||
* "code": 200
|
||||
* "msg": "ok"
|
||||
* "data": [
|
||||
* {
|
||||
* "id": "EgmJ4Ga7LQ",
|
||||
* "title": "装甲车-11",
|
||||
* "created_at": "",
|
||||
* }
|
||||
* ]
|
||||
* }
|
||||
*/
|
||||
func (*Manage) Notice(c *gin.Context) {
|
||||
form := &struct {
|
||||
PageForm
|
||||
@ -697,6 +726,39 @@ func (*Manage) Notice(c *gin.Context) {
|
||||
APIResponse(err, data)(c)
|
||||
}
|
||||
|
||||
/**
|
||||
* @api {post} /api/v1/manage/notice/detail 公告详细信息
|
||||
* @apiVersion 1.0.0
|
||||
* @apiName ManageNoticeDetail
|
||||
* @apiGroup Manage
|
||||
*
|
||||
* @apiHeader {string} x-token token
|
||||
*
|
||||
* @apiParam {String} id ID
|
||||
*
|
||||
* @apiSuccess (200) {Object} data 数据信息
|
||||
* @apiSuccess (200) {String} data.id ID
|
||||
* @apiSuccess (200) {String} data.title 标题
|
||||
* @apiSuccess (200) {String} data.content 内容
|
||||
* @apiSuccess (200) {Time} data.created_at 创建时间
|
||||
* @apiSuccess (200) {Number} code 成功响应状态码!
|
||||
* @apiSuccess (200) {String} msg 成功提示
|
||||
*
|
||||
* @apiSuccessExample {json} Success response:
|
||||
* HTTPS 200 OK
|
||||
* {
|
||||
* "code": 200
|
||||
* "msg": "ok"
|
||||
* "data": [
|
||||
* {
|
||||
* "id": "EgmJ4Ga7LQ",
|
||||
* "title": "装甲车-11",
|
||||
* "content": "内容",
|
||||
* "created_at": "",
|
||||
* }
|
||||
* ]
|
||||
* }
|
||||
*/
|
||||
func (*Manage) NoticeDetail(c *gin.Context) {
|
||||
form := new(IDStringForm)
|
||||
|
||||
|
@ -5,11 +5,11 @@ import "strings"
|
||||
// WorkSchedule 工单流程数据模型
|
||||
type WorkSchedule struct {
|
||||
Model
|
||||
Kind WorkScheduleKind `gorm:"column:kind;type:tinyint(1);default:1;comment:工单类型" json:"-"`
|
||||
Kind WorkScheduleKind `gorm:"column:kind;type:tinyint(1);default:1;comment:工单类型(1:维修工单)" json:"-"`
|
||||
Title string `gorm:"column:title;type:varchar(30);default:null;comment:标题" json:"title"`
|
||||
Stage int `gorm:"column:stage;type:tinyint(1);default:1;comment:阶段" json:"stage"`
|
||||
Step int `gorm:"column:step;type:tinyint(1);default:1;comment:步骤(1:阶段-1:步骤)" json:"step"`
|
||||
Target WorkScheduleTarget `gorm:"column:target;type:tinyint(1);default:1;comment:对象类型" json:"target"`
|
||||
Target WorkScheduleTarget `gorm:"column:target;type:tinyint(1);default:1;comment:对象类型(1:个人,2:角色)" json:"target"`
|
||||
TargetValue string `gorm:"column:target_value;type:tinyint(1);default:1;comment:对象信息" json:"target_value"`
|
||||
IsCountersign WorkScheduleCountersign `gorm:"column:is_countersign;type:tinyint(1);default:0;comment:是否会签" json:"is_countersign"`
|
||||
ModelDeleted
|
||||
|
@ -68,8 +68,8 @@ func (c *Instance) Login(account, password, captchaKey, captchaValue, ip string)
|
||||
service.Publish(config.EventForAccountLoginProduce, session.TenantID, session.UID, ip)
|
||||
|
||||
return &InstanceLoginResponse{Token: session.Token, EffectTime: config.SettingInfo.TokenEffectTime,
|
||||
//WsUrl: config.SystemConfig[config.WsDomain].(string)}, nil
|
||||
WsUrl: ""}, nil
|
||||
WsUrl: config.SystemConfig[config.WsDomain].(string)}, nil
|
||||
//WsUrl: ""}, nil
|
||||
}
|
||||
|
||||
// Logout 退出请求
|
||||
|
@ -66,7 +66,7 @@ func TreeIdentity(iModel model2.IModel, src []*model.SysMenuScene, parentID uint
|
||||
out := make([]*InstanceIdentityInfo, 0)
|
||||
|
||||
for _, v := range src {
|
||||
if v.ParentID == parentID {
|
||||
if v.ParentID == parentID && v.ID > 0 {
|
||||
iModel.SetID(v.ID)
|
||||
id := iModel.GetEncodeID()
|
||||
|
||||
|
@ -160,7 +160,16 @@ func (c *Instance) Workbench(materialID uint64, kind, page, pageSize int) (*basi
|
||||
}, page, pageSize, &count, where...); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &basic.PageDataResponse{Data: out, Count: count}, nil
|
||||
list := make([]*InstanceInfo, 0)
|
||||
|
||||
for _, v := range out {
|
||||
mWorkInstance.ID = v.ID
|
||||
|
||||
list = append(list, &InstanceInfo{
|
||||
CommonIDString: basic.CommonIDString{ID: mWorkInstance.GetEncodeID()}, WorkInstanceInfo: v,
|
||||
})
|
||||
}
|
||||
return &basic.PageDataResponse{Data: list, Count: count}, nil
|
||||
}
|
||||
|
||||
// Detail 详细信息
|
||||
|
@ -52,7 +52,7 @@ func (m *SysMenu) UserMenu(uid uint64) ([]*SysMenuScene, error) {
|
||||
|
||||
db := orm.GetDB().Table(mSysUserRole.TableName()+" AS u_r").
|
||||
Select("m.id, m.parent_id, m.name, m.kind, m.link, m.component, m.icon, 1 AS scene_id").
|
||||
Joins(fmt.Sprintf("LEFT JOIN %s AS r_m ON u_r.role_id = r_m.id AND r_m.is_deletd = %d",
|
||||
Joins(fmt.Sprintf("LEFT JOIN %s AS r_m ON u_r.role_id = r_m.id AND r_m.is_deleted = %d",
|
||||
mSysRoleMenu.TableName(), model.DeleteStatusForNot)).
|
||||
Joins(fmt.Sprintf("LEFT JOIN %s AS m ON r_m.menu_id = m.id AND m.status = %d AND m.is_deleted = %d",
|
||||
m.TableName(), model.SysMenuStatusForNormal, model.DeleteStatusForNot)).
|
||||
|
@ -97,7 +97,6 @@ func (m *WorkInstance) Instances(page, pageSize int, count *int64, where ...*mod
|
||||
|
||||
// Persons 个人信息
|
||||
func (m *WorkInstance) Persons(uid uint64, page, pageSize int, count *int64, where ...*model.ModelWhere) ([]*WorkInstanceInfo, error) {
|
||||
|
||||
db := orm.GetDB().Table(m.TableName()+" AS w").
|
||||
Select("w.id", "w.title", "e.code AS equipment_code", "e.title AS equipment_title", "w.priority",
|
||||
"(SELECT GROUP_CONCAT(s_b.title) FROM ( SELECT id, title FROM sys_breakdown) AS s_b WHERE FIND_IN_SET( s_b.id, w.breakdown )) AS breakdown_title",
|
||||
@ -131,7 +130,7 @@ WHEN %d THEN
|
||||
(SELECT GROUP_CONCAT(a.id) FROM (SELECT id FROM %s WHERE target = %d AND target_value IN (%s)) AS a)
|
||||
WHEN %d THEN
|
||||
(SELECT GROUP_CONCAT(a.id) FROM (SELECT id FROM %s WHERE target = %d AND target_value IN (%s)) AS a)
|
||||
ELSE "" END`, "s.target",
|
||||
ELSE "" END`, "s.target",
|
||||
model.WorkScheduleTargetForPerson,
|
||||
mWorkSchedule.TableName(), model.WorkScheduleTargetForPerson, condition.UID,
|
||||
model.WorkScheduleTargetForRole,
|
||||
@ -160,6 +159,7 @@ ELSE "" END`, "s.target",
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// Workbenchs 待办信息
|
||||
func (m *WorkInstance) Workbenchs(condition *WorkbenchCondition, page, pageSize int, count *int64, where ...*model.ModelWhere) ([]*WorkInstanceInfo, error) {
|
||||
mWorkSchedule := model.NewWorkSchedule()
|
||||
|
||||
@ -168,7 +168,7 @@ WHEN %d THEN
|
||||
(SELECT GROUP_CONCAT(a.id) FROM (SELECT id FROM %s WHERE target = %d AND target_value IN (%s)) AS a)
|
||||
WHEN %d THEN
|
||||
(SELECT GROUP_CONCAT(a.id) FROM (SELECT id FROM %s WHERE target = %d AND target_value IN (%s)) AS a)
|
||||
ELSE "" END`, "s.target",
|
||||
ELSE "" END`, "s.target",
|
||||
model.WorkScheduleTargetForPerson,
|
||||
mWorkSchedule.TableName(), model.WorkScheduleTargetForPerson, condition.UID,
|
||||
model.WorkScheduleTargetForRole,
|
||||
|
@ -4,6 +4,6 @@ import "testing"
|
||||
|
||||
func TestSha256String(t *testing.T) {
|
||||
//t.Log(Md5String("9f735e0df9a1ddc702bf0a1a7b83033f9f7153a00c29de82cedadc9957289b05"))
|
||||
t.Log(HASHIDEncode(123))
|
||||
t.Log(HASHIDDecode("lV5OBJ"))
|
||||
t.Log(HASHIDEncode(1))
|
||||
t.Log(HASHIDDecode("A9GVg5JZdr"))
|
||||
}
|
||||
|
Reference in New Issue
Block a user