zk преди 2 години
родител
ревизия
e5e27d2971
променени са 6 файла, в които са добавени 27 реда и са изтрити 14 реда
  1. 1 1
      server/api/v1/autocode/problem_info.go
  2. 4 0
      server/api/v1/autocode/unit.go
  3. 6 6
      server/config.yaml
  4. 1 1
      server/main_test.go
  5. 7 6
      server/router/autocode/unit.go
  6. 8 0
      server/service/autocode/unit.go

+ 1 - 1
server/api/v1/autocode/problem_info.go

@@ -154,7 +154,7 @@ func SendMsg(sendUser autocodeReq.SendUser, isUuid bool) {
 				"first":    {Value: "有新的站点问题"},
 				"keyword1": {Value: opera.Username},
 				"keyword2": {Value: problem.SiteName},
-				"keyword3": {Value: problem.Department},
+				"keyword3": {Value: "创城办"},
 				"keyword4": {Value: problem.CreatedAt.Format("2006-01-02 15:04:05")},
 				"remark":   {Value: "点击查看问题"},
 			},

+ 4 - 0
server/api/v1/autocode/unit.go

@@ -108,6 +108,10 @@ func (unitApi *UnitApi) UpdateUnit(c *gin.Context) {
 		response.OkWithMessage("更新成功", c)
 	}
 }
+func (unitApi *UnitApi) UpdateUnitIntergral(c *gin.Context) {
+	unitService.UpdateUnitIntergral()
+	response.OkWithMessage("更新成功", c)
+}
 
 // FindUnit 用id查询Unit
 // @Tags Unit

+ 6 - 6
server/config.yaml

@@ -85,12 +85,12 @@ timer:
       compareField: created_at
       interval: 2160h
 wxxcx:
-  appid: wxa675b666f6f9fddb
-  secret: fac99b13b6080d767427064e2f4044ca
-  wxid: wx668a99d5aa4533ce
-  wxkey: 4d9dabc24409c9e53d31d8b51a5be1ba
-  msgid: ADfLDnZFI4g39m1RZyDO8CKNue3Dx4LblozriSpn7jw
-  name: 崇礼
+  appid: wxdb8b69fb412c6bb1
+  secret: 7cf74820a22489a97cadb4c7e0f2179f
+  wxid: wxa014c6afae283a95
+  wxkey: c32b44cb56175740cefeb9be8fffbeb2
+  msgid: -m8G_jvtjoEnnnBYwlbyWAW61MpRvWHipeeHSWLYIsk
+  name: 桥东
   authUrl: https://work.zk1006.com/api
 zap:
   level: info

+ 1 - 1
server/main_test.go

@@ -25,7 +25,7 @@ func TestName(t *testing.T) {
 	//_, resysDictionaryDetail := dictionaryDetailService.GetSysDictionaryDetail(8)
 	//fmt.Printf("\t%v", resysDictionaryDetail)
 	var menuAA []*menu.Button
-	menuAA = append(menuAA, &menu.Button{Type: "miniprogram", Name: "崇礼创城小程序", URL: "http://zk1006.cn", AppID: "wxa675b666f6f9fddb", PagePath: "/pages/checking"})
+	menuAA = append(menuAA, &menu.Button{Type: "miniprogram", Name: "桥东创城小程序", URL: "http://zk1006.cn", AppID: "wxdb8b69fb412c6bb1", PagePath: "/pages/checking"})
 	//menuAA = append(menuAA, &menu.Button{Type: "view", Name: "小程序授权登录", URL: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx66e0fbb5a735bcc4&redirect_uri=https://cc.zjkduoduo.com/api/wechat/auth&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect"})
 	err := global.GVA_WECHAT.GetMenu().SetMenu(menuAA)
 	global.GVA_LOG.Info("错误", zap.Any("err", err))

+ 7 - 6
server/router/autocode/unit.go

@@ -14,11 +14,12 @@ func (s *UnitRouter) InitUnitRouter(Router *gin.RouterGroup) {
 	unitRouter := Router.Group("unit").Use(middleware.OperationRecord())
 	var unitApi = v1.ApiGroupApp.AutoCodeApiGroup.UnitApi
 	{
-		unitRouter.POST("createUnit", unitApi.CreateUnit)   // 新建Unit
-		unitRouter.DELETE("deleteUnit", unitApi.DeleteUnit) // 删除Unit
-		unitRouter.DELETE("deleteUnitByIds", unitApi.DeleteUnitByIds) // 批量删除Unit
-		unitRouter.PUT("updateUnit", unitApi.UpdateUnit)    // 更新Unit
-		unitRouter.GET("findUnit", unitApi.FindUnit)        // 根据ID获取Unit
-		unitRouter.GET("getUnitList", unitApi.GetUnitList)  // 获取Unit列表
+		unitRouter.POST("createUnit", unitApi.CreateUnit)                  // 新建Unit
+		unitRouter.DELETE("deleteUnit", unitApi.DeleteUnit)                // 删除Unit
+		unitRouter.DELETE("deleteUnitByIds", unitApi.DeleteUnitByIds)      // 批量删除Unit
+		unitRouter.PUT("updateUnit", unitApi.UpdateUnit)                   // 更新Unit
+		unitRouter.GET("findUnit", unitApi.FindUnit)                       // 根据ID获取Unit
+		unitRouter.GET("updateUnitIntergral", unitApi.UpdateUnitIntergral) // jifen
+		unitRouter.GET("getUnitList", unitApi.GetUnitList)                 // 获取Unit列表
 	}
 }

+ 8 - 0
server/service/autocode/unit.go

@@ -54,6 +54,14 @@ func (unitService *UnitService) UpdateUnitMaxIntegral(id *int, maxIntergral int)
 	return err
 }
 
+func (unitService *UnitService) UpdateUnitIntergral() {
+	var integral = 0
+	global.GVA_DB.Session(&gorm.Session{
+		AllowGlobalUpdate: true,
+	}).Model(&autocode.Unit{}).Updates(&autocode.Unit{UnitIntegral: &integral})
+
+}
+
 // UpdateUnit 开始下期
 // Author [piexlmax](https://github.com/piexlmax)
 func (unitService *UnitService) UpdateUnitNext(unit autocode.Unit) (err error) {