zk 2 سال پیش
والد
کامیت
08e792fa96
46فایلهای تغییر یافته به همراه2131 افزوده شده و 478 حذف شده
  1. 2 0
      server/api/v1/autocode/enter.go
  2. 4 0
      server/api/v1/autocode/place.go
  3. 56 11
      server/api/v1/autocode/problem_info.go
  4. 1 11
      server/api/v1/autocode/unit.go
  5. 175 0
      server/api/v1/autocode/unit_place.go
  6. 159 0
      server/api/v1/autocode/unit_user.go
  7. 1 1
      server/api/v1/system/sys_user.go
  8. 2 0
      server/initialize/gorm.go
  9. 2 0
      server/initialize/router.go
  10. 8 6
      server/model/autocode/place.go
  11. 24 19
      server/model/autocode/problem_info.go
  12. 6 7
      server/model/autocode/problem_type.go
  13. 11 0
      server/model/autocode/request/unit_place.go
  14. 11 0
      server/model/autocode/request/unit_user.go
  15. 1 0
      server/model/autocode/unit.go
  16. 1 0
      server/model/autocode/unit_history.go
  17. 24 0
      server/model/autocode/unit_place.go
  18. 41 0
      server/model/autocode/unit_user.go
  19. 2 0
      server/router/autocode/enter.go
  20. 1 0
      server/router/autocode/problem_info.go
  21. 24 0
      server/router/autocode/unit_place.go
  22. 24 0
      server/router/autocode/unit_user.go
  23. 2 0
      server/service/autocode/enter.go
  24. 5 0
      server/service/autocode/place.go
  25. 14 3
      server/service/autocode/unit.go
  26. 70 0
      server/service/autocode/unit_place.go
  27. 65 0
      server/service/autocode/unit_user.go
  28. 2 2
      server/service/system/sys_user.go
  29. 10 3
      web/src/api/problemInfo.js
  30. 97 0
      web/src/api/unitPlace.js
  31. 97 0
      web/src/api/unitUser.js
  32. 4 0
      web/src/style/main.scss
  33. 117 120
      web/src/view/organization/organization.vue
  34. 179 181
      web/src/view/place/place.vue
  35. 1 1
      web/src/view/problemInfo/proInfo.vue
  36. 70 36
      web/src/view/problemInfo/problemInfo.vue
  37. 38 3
      web/src/view/problemType/problemType.vue
  38. 45 45
      web/src/view/superAdmin/dictionary/department.vue
  39. 159 19
      web/src/view/unit/unit.vue
  40. 1 1
      web/src/view/unit/unitForm.vue
  41. 7 7
      web/src/view/unitHistory/unitHistory.vue
  42. 2 2
      web/src/view/unitHistory/unitHistoryForm.vue
  43. 205 0
      web/src/view/unitPlace/unitPlace.vue
  44. 78 0
      web/src/view/unitPlace/unitPlaceForm.vue
  45. 205 0
      web/src/view/unitUser/unitUser.vue
  46. 78 0
      web/src/view/unitUser/unitUserForm.vue

+ 2 - 0
server/api/v1/autocode/enter.go

@@ -13,5 +13,7 @@ type ApiGroup struct {
 	ProblemReplyApi
 	OrganizationApi
 	PlaceProApi
+	UnitUserApi
+	UnitPlaceApi
 	// Code generated by github.com/flipped-aurora/gin-vue-admin/server End; DO NOT EDIT.
 }

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

@@ -28,6 +28,8 @@ var placeService = service.ServiceGroupApp.AutoCodeServiceGroup.PlaceService
 func (placeApi *PlaceApi) CreatePlace(c *gin.Context) {
 	var place autocode.Place
 	_ = c.ShouldBindJSON(&place)
+	temp := *place.UnitMaxIntegral * 100
+	place.UnitMaxIntegral = &temp
 	if err := placeService.CreatePlace(place); err != nil {
 		global.GVA_LOG.Error("创建失败!", zap.Any("err", err))
 		response.FailWithMessage("创建失败", c)
@@ -88,6 +90,8 @@ func (placeApi *PlaceApi) DeletePlaceByIds(c *gin.Context) {
 func (placeApi *PlaceApi) UpdatePlace(c *gin.Context) {
 	var place autocode.Place
 	_ = c.ShouldBindJSON(&place)
+	temp := *place.UnitMaxIntegral * 100
+	place.UnitMaxIntegral = &temp
 	if err := placeService.UpdatePlace(place); err != nil {
 		global.GVA_LOG.Error("更新失败!", zap.Any("err", err))
 		response.FailWithMessage("更新失败", c)

+ 56 - 11
server/api/v1/autocode/problem_info.go

@@ -6,6 +6,7 @@ import (
 	autocodeReq "github.com/flipped-aurora/gin-vue-admin/server/model/autocode/request"
 	"github.com/flipped-aurora/gin-vue-admin/server/model/common/request"
 	"github.com/flipped-aurora/gin-vue-admin/server/model/common/response"
+	"github.com/flipped-aurora/gin-vue-admin/server/model/system"
 	"github.com/flipped-aurora/gin-vue-admin/server/service"
 	"github.com/flipped-aurora/gin-vue-admin/server/utils"
 	"github.com/gin-gonic/gin"
@@ -55,13 +56,16 @@ func (problemInfoApi *ProblemInfoApi) CreateProblemInfo(c *gin.Context) {
 				integral = integral + inter
 			}
 			problemInfo.Integral = &integral
-
-			_, unit := unitService.GetUnit(uint(*problemInfo.UnitId))
-			oldIntegral := *unit.UnitIntegral
-			nowIntegral := oldIntegral - integral
-			unit.UnitIntegral = &nowIntegral
-			unitService.UpdateUnitA(unit)
 		}
+		// 发送问题到负责人
+		if err, unituser := unitUserService.GetUnitUsers(problemInfo.UnitId); err != nil {
+			source := make([]string, 0)
+			for _, item := range unituser {
+				source = append(source, item.UUID)
+			}
+			SendMsg(autocodeReq.SendUser{ProblemID: problemInfo.ID, ID: source}, true)
+		}
+
 	}
 	if err := problemInfoService.CreateProblemInfo(problemInfo); err != nil {
 		global.GVA_LOG.Error("创建失败!", zap.Any("err", err))
@@ -95,12 +99,22 @@ func (problemInfoApi *ProblemInfoApi) ExportExcel(c *gin.Context) {
 func (problemInfoApi *ProblemInfoApi) SendUser(c *gin.Context) {
 	var sendUser autocodeReq.SendUser
 	_ = c.ShouldBindJSON(&sendUser)
+	SendMsg(sendUser, false)
+	response.OkWithMessage("发送成功", c)
+}
+
+func SendMsg(sendUser autocodeReq.SendUser, isUuid bool) {
 	_, problem := problemInfoService.GetProblemInfo(sendUser.ProblemID)
-	_, oper := service.ServiceGroupApp.SystemServiceGroup.FindUserById(int(problem.Oper))
+	_, opera := service.ServiceGroupApp.SystemServiceGroup.FindUserById(int(problem.Oper))
 	appid := global.GVA_CONFIG.Wxxcx.Appid
 	for _, id := range sendUser.ID {
-		userId, _ := strconv.Atoi(id)
-		_, user := service.ServiceGroupApp.SystemServiceGroup.FindUserById(userId)
+		var user *system.SysUser
+		if isUuid {
+			_, user = service.ServiceGroupApp.SystemServiceGroup.FindUserByUuid(id)
+		} else {
+			userId, _ := strconv.Atoi(id)
+			_, user = service.ServiceGroupApp.SystemServiceGroup.FindUserById(userId)
+		}
 		if user.WechatId == "" {
 			continue
 		}
@@ -109,7 +123,7 @@ func (problemInfoApi *ProblemInfoApi) SendUser(c *gin.Context) {
 			TemplateID: global.GVA_CONFIG.Wxxcx.Msgid,
 			Data: map[string]*message.TemplateDataItem{
 				"first":    {Value: "有新的站点问题"},
-				"keyword1": {Value: oper.Username},
+				"keyword1": {Value: opera.Username},
 				"keyword2": {Value: problem.SiteName},
 				"keyword3": {Value: problem.Department},
 				"keyword4": {Value: problem.CreatedAt.Format("2006-01-02 15:04:05")},
@@ -124,7 +138,6 @@ func (problemInfoApi *ProblemInfoApi) SendUser(c *gin.Context) {
 			global.GVA_LOG.Error("微信模板通知失败!", zap.Any("err", err))
 		}
 	}
-	response.OkWithMessage("发送成功", c)
 }
 
 // DeleteProblemInfo 删除ProblemInfo
@@ -192,6 +205,38 @@ func (problemInfoApi *ProblemInfoApi) UpdateProblemInfo(c *gin.Context) {
 	}
 }
 
+func (problemInfoApi *ProblemInfoApi) UpdateProblemInfoStatus(c *gin.Context) {
+	var problemInfo autocode.ProblemInfo
+	_ = c.ShouldBindJSON(&problemInfo)
+	_, problemInfoNow := problemInfoService.GetProblemInfo(problemInfo.ID)
+	problemInfoNow.Status = problemInfo.Status
+	problemInfoNow.Audit = problemInfo.Audit
+	if problemInfo.Status == "Success" {
+		if time.Now().Before(problemInfoNow.HandAt) {
+			//超时扣分
+			//todo 扣站点分数
+
+			//todo 扣单位分数
+			_, unit := unitService.GetUnit(uint(*problemInfo.UnitId))
+			oldIntegral := *unit.UnitIntegral
+			nowIntegral := oldIntegral - *problemInfoNow.Integral
+			unit.UnitIntegral = &nowIntegral
+			unitService.UpdateUnitA(unit)
+		} else {
+			temp := 0
+			problemInfo.Integral = &temp
+			// 未超时,不处理
+		}
+	}
+
+	if err := problemInfoService.UpdateProblemInfo(problemInfoNow); err != nil {
+		global.GVA_LOG.Error("更新失败!", zap.Any("err", err))
+		response.FailWithMessage("更新失败", c)
+	} else {
+		response.OkWithMessage("更新成功", c)
+	}
+}
+
 // FindProblemInfo 用id查询ProblemInfo
 // @Tags ProblemInfo
 // @Summary 用id查询ProblemInfo

+ 1 - 11
server/api/v1/autocode/unit.go

@@ -102,17 +102,7 @@ func (unitApi *UnitApi) DeleteUnitByIds(c *gin.Context) {
 func (unitApi *UnitApi) UpdateUnit(c *gin.Context) {
 	var unit autocode.Unit
 	_ = c.ShouldBindJSON(&unit)
-	//记录历史,更新所有
-	if err, units := unitService.GetUnitInfoListAll(); err != nil {
-		response.FailWithMessage("更新失败", c)
-		return
-	} else {
-		for _, temp := range units {
-			unitHistoryService.CreateUnitHistory(autocode.UnitHistory{UnitId: &temp.ID, UnitName: temp.UnitName, UnitIntegral: temp.UnitIntegral, UnitMaxIntegral: temp.UnitMaxIntegral, Period: temp.Period})
-		}
-	}
-
-	if err := unitService.UpdateUnitNext(unit); err != nil {
+	if err := unitService.UpdateUnit(unit); err != nil {
 		global.GVA_LOG.Error("更新失败!", zap.Any("err", err))
 		response.FailWithMessage("更新失败", c)
 	} else {

+ 175 - 0
server/api/v1/autocode/unit_place.go

@@ -0,0 +1,175 @@
+package autocode
+
+import (
+	"github.com/flipped-aurora/gin-vue-admin/server/global"
+	"github.com/flipped-aurora/gin-vue-admin/server/model/autocode"
+	autocodeReq "github.com/flipped-aurora/gin-vue-admin/server/model/autocode/request"
+	"github.com/flipped-aurora/gin-vue-admin/server/model/common/request"
+	"github.com/flipped-aurora/gin-vue-admin/server/model/common/response"
+	"github.com/flipped-aurora/gin-vue-admin/server/service"
+	"github.com/gin-gonic/gin"
+	"go.uber.org/zap"
+)
+
+type UnitPlaceApi struct {
+}
+
+var unitPlaceService = service.ServiceGroupApp.AutoCodeServiceGroup.UnitPlaceService
+
+// CreateUnitPlace 创建UnitPlace
+// @Tags UnitPlace
+// @Summary 创建UnitPlace
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data body autocode.UnitPlace true "创建UnitPlace"
+// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
+// @Router /unitPlace/createUnitPlace [post]
+func (unitPlaceApi *UnitPlaceApi) CreateUnitPlace(c *gin.Context) {
+	var unitPlace autocode.UnitPlace
+	_ = c.ShouldBindJSON(&unitPlace)
+	if err := unitPlaceService.CreateUnitPlace(unitPlace); err != nil {
+		global.GVA_LOG.Error("创建失败!", zap.Any("err", err))
+		response.FailWithMessage("创建失败", c)
+	} else {
+		response.OkWithMessage("创建成功", c)
+	}
+}
+
+// DeleteUnitPlace 删除UnitPlace
+// @Tags UnitPlace
+// @Summary 删除UnitPlace
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data body autocode.UnitPlace true "删除UnitPlace"
+// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
+// @Router /unitPlace/deleteUnitPlace [delete]
+func (unitPlaceApi *UnitPlaceApi) DeleteUnitPlace(c *gin.Context) {
+	var unitPlace autocode.UnitPlace
+	_ = c.ShouldBindJSON(&unitPlace)
+	if err := unitPlaceService.DeleteUnitPlace(unitPlace); err != nil {
+		global.GVA_LOG.Error("删除失败!", zap.Any("err", err))
+		response.FailWithMessage("删除失败", c)
+	} else {
+		response.OkWithMessage("删除成功", c)
+	}
+}
+
+// DeleteUnitPlaceByIds 批量删除UnitPlace
+// @Tags UnitPlace
+// @Summary 批量删除UnitPlace
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data body request.IdsReq true "批量删除UnitPlace"
+// @Success 200 {string} string "{"success":true,"data":{},"msg":"批量删除成功"}"
+// @Router /unitPlace/deleteUnitPlaceByIds [delete]
+func (unitPlaceApi *UnitPlaceApi) DeleteUnitPlaceByIds(c *gin.Context) {
+	var IDS request.IdsReq
+	_ = c.ShouldBindJSON(&IDS)
+	if err := unitPlaceService.DeleteUnitPlaceByIds(IDS); err != nil {
+		global.GVA_LOG.Error("批量删除失败!", zap.Any("err", err))
+		response.FailWithMessage("批量删除失败", c)
+	} else {
+		response.OkWithMessage("批量删除成功", c)
+	}
+}
+
+// UpdateUnitPlace 更新UnitPlace
+// @Tags UnitPlace
+// @Summary 更新UnitPlace
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data body autocode.UnitPlace true "更新UnitPlace"
+// @Success 200 {string} string "{"success":true,"data":{},"msg":"更新成功"}"
+// @Router /unitPlace/updateUnitPlace [put]
+func (unitPlaceApi *UnitPlaceApi) UpdateUnitPlace(c *gin.Context) {
+	var unitPlace autocode.UnitPlaceVo
+	_ = c.ShouldBindJSON(&unitPlace)
+	_, unitPlaces := unitPlaceService.GetUnitPlaces(unitPlace.UnitId)
+	newUser := make(map[string]struct{}, len(unitPlace.PlaceIds))
+	for _, item := range unitPlace.PlaceIds {
+		newUser[item] = struct{}{}
+	}
+	// 反未包含删除
+	for _, unitTemp := range unitPlaces {
+		if _, ok := newUser[unitTemp.PlaceId]; ok {
+			continue
+		} else {
+			unitPlaceService.DeleteUnitPlace(unitTemp)
+		}
+	}
+
+	//原有的map
+	source := make(map[string]struct{}, len(unitPlaces))
+	for _, item := range unitPlaces {
+		source[item.PlaceId] = struct{}{}
+	}
+	for _, place := range unitPlace.PlaceIds {
+		if _, ok := source[place]; ok {
+			continue
+		} else {
+			// 未包含的添加
+			unitPlaceService.CreateUnitPlace(autocode.UnitPlace{UnitId: unitPlace.UnitId, PlaceId: place})
+		}
+	}
+
+	//计算总分满分
+	_, unitPlacesNow := unitPlaceService.GetUnitPlaces(unitPlace.UnitId)
+	placeIds := make([]string, 0)
+	for _, places := range unitPlacesNow {
+		placeIds = append(placeIds, places.PlaceId)
+	}
+	sum := placeService.FindPlaceSum(placeIds)
+
+	unitService.UpdateUnitMaxIntegral(unitPlace.UnitId, sum)
+
+	response.OkWithMessage("更新成功", c)
+}
+
+// FindUnitPlace 用id查询UnitPlace
+// @Tags UnitPlace
+// @Summary 用id查询UnitPlace
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data query autocode.UnitPlace true "用id查询UnitPlace"
+// @Success 200 {string} string "{"success":true,"data":{},"msg":"查询成功"}"
+// @Router /unitPlace/findUnitPlace [get]
+func (unitPlaceApi *UnitPlaceApi) FindUnitPlace(c *gin.Context) {
+	var unitPlace autocode.UnitPlace
+	_ = c.ShouldBindQuery(&unitPlace)
+	if err, reunitPlace := unitPlaceService.GetUnitPlace(unitPlace.ID); err != nil {
+		global.GVA_LOG.Error("查询失败!", zap.Any("err", err))
+		response.FailWithMessage("查询失败", c)
+	} else {
+		response.OkWithData(gin.H{"reunitPlace": reunitPlace}, c)
+	}
+}
+
+// GetUnitPlaceList 分页获取UnitPlace列表
+// @Tags UnitPlace
+// @Summary 分页获取UnitPlace列表
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data query autocodeReq.UnitPlaceSearch true "分页获取UnitPlace列表"
+// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
+// @Router /unitPlace/getUnitPlaceList [get]
+func (unitPlaceApi *UnitPlaceApi) GetUnitPlaceList(c *gin.Context) {
+	var pageInfo autocodeReq.UnitPlaceSearch
+	_ = c.ShouldBindQuery(&pageInfo)
+	if err, list, total := unitPlaceService.GetUnitPlaceInfoList(pageInfo); err != nil {
+		global.GVA_LOG.Error("获取失败!", zap.Any("err", err))
+		response.FailWithMessage("获取失败", c)
+	} else {
+		response.OkWithDetailed(response.PageResult{
+			List:     list,
+			Total:    total,
+			Page:     pageInfo.Page,
+			PageSize: pageInfo.PageSize,
+		}, "获取成功", c)
+	}
+}

+ 159 - 0
server/api/v1/autocode/unit_user.go

@@ -0,0 +1,159 @@
+package autocode
+
+import (
+	"github.com/flipped-aurora/gin-vue-admin/server/global"
+	"github.com/flipped-aurora/gin-vue-admin/server/model/autocode"
+	autocodeReq "github.com/flipped-aurora/gin-vue-admin/server/model/autocode/request"
+	"github.com/flipped-aurora/gin-vue-admin/server/model/common/request"
+	"github.com/flipped-aurora/gin-vue-admin/server/model/common/response"
+	"github.com/flipped-aurora/gin-vue-admin/server/service"
+	"github.com/gin-gonic/gin"
+	"go.uber.org/zap"
+)
+
+type UnitUserApi struct {
+}
+
+var unitUserService = service.ServiceGroupApp.AutoCodeServiceGroup.UnitUserService
+
+// CreateUnitUser 创建UnitUser
+// @Tags UnitUser
+// @Summary 创建UnitUser
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data body autocode.UnitUser true "创建UnitUser"
+// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
+// @Router /unitUser/createUnitUser [post]
+func (unitUserApi *UnitUserApi) CreateUnitUser(c *gin.Context) {
+	var unitUser autocode.UnitUser
+	_ = c.ShouldBindJSON(&unitUser)
+	if err := unitUserService.CreateUnitUser(unitUser); err != nil {
+		global.GVA_LOG.Error("创建失败!", zap.Any("err", err))
+		response.FailWithMessage("创建失败", c)
+	} else {
+		response.OkWithMessage("创建成功", c)
+	}
+}
+
+// DeleteUnitUser 删除UnitUser
+// @Tags UnitUser
+// @Summary 删除UnitUser
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data body autocode.UnitUser true "删除UnitUser"
+// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
+// @Router /unitUser/deleteUnitUser [delete]
+func (unitUserApi *UnitUserApi) DeleteUnitUser(c *gin.Context) {
+	var unitUser autocode.UnitUser
+	_ = c.ShouldBindJSON(&unitUser)
+	if err := unitUserService.DeleteUnitUser(unitUser); err != nil {
+		global.GVA_LOG.Error("删除失败!", zap.Any("err", err))
+		response.FailWithMessage("删除失败", c)
+	} else {
+		response.OkWithMessage("删除成功", c)
+	}
+}
+
+// DeleteUnitUserByIds 批量删除UnitUser
+// @Tags UnitUser
+// @Summary 批量删除UnitUser
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data body request.IdsReq true "批量删除UnitUser"
+// @Success 200 {string} string "{"success":true,"data":{},"msg":"批量删除成功"}"
+// @Router /unitUser/deleteUnitUserByIds [delete]
+func (unitUserApi *UnitUserApi) DeleteUnitUserByIds(c *gin.Context) {
+	var IDS request.IdsReq
+	_ = c.ShouldBindJSON(&IDS)
+	if err := unitUserService.DeleteUnitUserByIds(IDS); err != nil {
+		global.GVA_LOG.Error("批量删除失败!", zap.Any("err", err))
+		response.FailWithMessage("批量删除失败", c)
+	} else {
+		response.OkWithMessage("批量删除成功", c)
+	}
+}
+
+// UpdateUnitUser 更新UnitUser
+// @Tags UnitUser
+// @Summary 更新UnitUser
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data body autocode.UnitUser true "更新UnitUser"
+// @Success 200 {string} string "{"success":true,"data":{},"msg":"更新成功"}"
+// @Router /unitUser/updateUnitUser [put]
+func (unitUserApi *UnitUserApi) UpdateUnitUser(c *gin.Context) {
+	var unitUser autocode.UnitUserVo
+	_ = c.ShouldBindJSON(&unitUser)
+	_, unitUsers := unitUserService.GetUnitUsers(unitUser.UnitId)
+	newUser := make(map[string]struct{}, len(unitUser.UUID))
+	for _, item := range unitUser.UUID {
+		newUser[item] = struct{}{}
+	}
+	// 反未包含删除
+	for _, unitTemp := range unitUsers {
+		if _, ok := newUser[unitTemp.UUID]; ok {
+			continue
+		} else {
+			unitUserService.DeleteUnitUser(unitTemp)
+		}
+	}
+
+	//原有的map
+	source := make(map[string]struct{}, len(unitUsers))
+	for _, item := range unitUsers {
+		source[item.UUID] = struct{}{}
+	}
+	for _, uuid := range unitUser.UUID {
+		if _, ok := source[uuid]; ok {
+			continue
+		} else {
+			// 未包含的添加
+			unitUserService.CreateUnitUser(autocode.UnitUser{UnitId: unitUser.UnitId, UUID: uuid})
+		}
+	}
+	response.OkWithMessage("更新成功", c)
+}
+
+// FindUnitUser 用id查询UnitUser
+// @Tags UnitUser
+// @Summary 用id查询UnitUser
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data query autocode.UnitUser true "用id查询UnitUser"
+// @Success 200 {string} string "{"success":true,"data":{},"msg":"查询成功"}"
+// @Router /unitUser/findUnitUser [get]
+func (unitUserApi *UnitUserApi) FindUnitUser(c *gin.Context) {
+	var unitUser autocode.UnitUser
+	_ = c.ShouldBindQuery(&unitUser)
+	if err, reunitUser := unitUserService.GetUnitUser(unitUser.ID); err != nil {
+		global.GVA_LOG.Error("查询失败!", zap.Any("err", err))
+		response.FailWithMessage("查询失败", c)
+	} else {
+		response.OkWithData(gin.H{"reunitUser": reunitUser}, c)
+	}
+}
+
+// GetUnitUserList 分页获取UnitUser列表
+// @Tags UnitUser
+// @Summary 分页获取UnitUser列表
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data query autocodeReq.UnitUserSearch true "分页获取UnitUser列表"
+// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
+// @Router /unitUser/getUnitUserList [get]
+func (unitUserApi *UnitUserApi) GetUnitUserList(c *gin.Context) {
+	var pageInfo autocodeReq.UnitUserSearch
+	_ = c.ShouldBindQuery(&pageInfo)
+	_, list := unitUserService.GetUnitUsers(pageInfo.UnitId)
+	temp := make([]string, 0)
+	for _, item := range list {
+		temp = append(temp, item.UUID)
+	}
+	response.OkWithData(temp, c)
+}

+ 1 - 1
server/api/v1/system/sys_user.go

@@ -404,7 +404,7 @@ func (b *BaseApi) SetUserName(c *gin.Context) {
 	}
 	_, userNow := userService.FindUserById(int(user.ID))
 	userNow.Username = user.Username
-	if err, ReqUser := userService.SetUserName(userNow); err != nil {
+	if err, ReqUser := userService.SetUserName(*userNow); err != nil {
 		global.GVA_LOG.Error("设置失败!", zap.Any("err", err))
 		response.FailWithMessage("设置失败", c)
 	} else {

+ 2 - 0
server/initialize/gorm.go

@@ -59,6 +59,8 @@ func MysqlTables(db *gorm.DB) {
 		autocode.ProblemReply{},
 		autocode.Organization{},
 		autocode.PlacePro{},
+		autocode.UnitUser{},
+		autocode.UnitPlace{},
 		// Code generated by github.com/flipped-aurora/gin-vue-admin/server End; DO NOT EDIT.
 	)
 	if err != nil {

+ 2 - 0
server/initialize/router.go

@@ -80,6 +80,8 @@ func Routers() *gin.Engine {
 		autocodeRouter.InitProblemReplyRouter(PrivateGroup)
 		autocodeRouter.InitOrganizationRouter(PrivateGroup)
 		autocodeRouter.InitPlaceProRouter(PrivateGroup)
+		autocodeRouter.InitUnitUserRouter(PrivateGroup)
+		autocodeRouter.InitUnitPlaceRouter(PrivateGroup)
 		// Code generated by github.com/flipped-aurora/gin-vue-admin/server End; DO NOT EDIT.
 	}
 

+ 8 - 6
server/model/autocode/place.go

@@ -9,12 +9,14 @@ import (
 // 如果含有time.Time 请自行import time包
 type Place struct {
 	global.GVA_MODEL
-	Name      string     `json:"name" form:"name" gorm:"column:name;comment:点位名称;type:varchar(255);"`
-	Position  string     `json:"position" form:"position" gorm:"column:position;comment:点位定位;type:varchar(255);"`
-	Type      *int       `json:"type" form:"type" gorm:"column:type;comment:点位类型;type:int;"`
-	Region    string     `json:"region" form:"region" gorm:"column:region;comment:区域;type:varchar(255);"`
-	OrganCode string     `json:"organCode" form:"organCode" gorm:"column:organ_code;comment:区域归属;type:varchar(255);"`
-	ProList   []PlacePro `json:"proList" gorm:"-"`
+	Name            string     `json:"name" form:"name" gorm:"column:name;comment:点位名称;type:varchar(255);"`
+	Position        string     `json:"position" form:"position" gorm:"column:position;comment:点位定位;type:varchar(255);"`
+	Type            *int       `json:"type" form:"type" gorm:"column:type;comment:点位类型;type:int;"`
+	Region          string     `json:"region" form:"region" gorm:"column:region;comment:区域;type:varchar(255);"`
+	OrganCode       string     `json:"organCode" form:"organCode" gorm:"column:organ_code;comment:区域归属;type:varchar(255);"`
+	UnitIntegral    *int       `json:"unitIntegral" form:"unitIntegral" gorm:"column:unit_integral;comment:现有积分;type:int"`
+	UnitMaxIntegral *int       `json:"unitMaxIntegral" form:"unitMaxIntegral" gorm:"column:unit_max_integral;comment:满分;type:int"`
+	ProList         []PlacePro `json:"proList" gorm:"-"`
 }
 
 // TableName Place 表名

+ 24 - 19
server/model/autocode/problem_info.go

@@ -3,12 +3,14 @@ package autocode
 
 import (
 	"github.com/flipped-aurora/gin-vue-admin/server/global"
+	"time"
 )
 
 // ProblemInfo 结构体
 // 如果含有time.Time 请自行import time包
 type ProblemInfo struct {
 	global.GVA_MODEL
+	HandAt     time.Time   // 处理时间
 	Oper       uint        `json:"oper" form:"oper" gorm:"column:oper;comment:发布人;type:bigint"`
 	Handler    *int        `json:"handler" form:"handler" gorm:"column:handler;comment:处理人;type:bigint"`
 	Imgs       string      `json:"imgs" form:"imgs" gorm:"column:imgs;comment:关联图片;type:varchar(2000);"`
@@ -24,6 +26,7 @@ type ProblemInfo struct {
 	HandText   string      `json:"handText" form:"handText" gorm:"column:hand_text;comment:处理内容;type:varchar(255);"`
 	Department string      `json:"department" form:"department" gorm:"column:department;comment:责任部门;type:varchar(255);"`
 	Remark     string      `json:"remark" form:"remark" gorm:"column:remark;comment:问题备注;type:varchar(600);"`
+	Audit      string      `json:"remark1" form:"remark1" gorm:"column:remark1;comment:审核备注;type:varchar(600);"`
 	Count      *int        `json:"count" form:"count" gorm:"default:0;column:count;comment:阅读次数;type:int);"`
 	Integral   *int        `json:"integral" form:"integral" gorm:"default:0;column:integral;comment:积分;type:int);"`
 	UnitName   string      `json:"unitName" form:"unitName" gorm:"column:unit_name;comment:单位名称;type:varchar(255));"`
@@ -33,25 +36,27 @@ type ProblemInfo struct {
 
 type ProblemInfo1 struct {
 	global.GVA_MODEL
-	Oper       uint   `json:"oper" form:"oper" gorm:"column:oper;comment:发布人;type:bigint"`
-	Handler    *int   `json:"handler" form:"handler" gorm:"column:handler;comment:处理人;type:bigint"`
-	Imgs       string `json:"imgs" form:"imgs" gorm:"column:imgs;comment:关联图片;type:varchar(2000);"`
-	Video      string `json:"video" form:"video" gorm:"column:video;comment:关联视频;type:varchar(255);"`
-	SiteId     uint   `json:"siteId" form:"siteId" gorm:"column:site_id;comment:站点id;type:bigint"`
-	SiteName   string `json:"siteName" form:"siteName" gorm:"column:site_name;comment:站点id;type:bigint"`
-	Position   string `json:"position" form:"position" gorm:"column:position;comment:经纬度;type:varchar(255);"`
-	Matter     string `json:"matter" form:"matter" gorm:"column:matter;comment:问题列表;type:varchar(255);"`
-	SiteType   string `json:"siteType" form:"siteType" gorm:"column:site_type;comment:站点类型;type:varchar(255);"`
-	Status     string `json:"status" form:"status" gorm:"column:status;comment:处理状态;type:varchar(255);"`
-	Region     string `json:"region" form:"region" gorm:"column:region;comment:区域;type:varchar(255);"`
-	HandImgs   string `json:"handImgs" form:"handImgs" gorm:"column:hand_imgs;comment:处理图片;type:varchar(255);"`
-	HandText   string `json:"handText" form:"handText" gorm:"column:hand_text;comment:处理内容;type:varchar(255);"`
-	Department string `json:"department" form:"department" gorm:"column:department;comment:责任部门;type:varchar(255);"`
-	Remark     string `json:"remark" form:"remark" gorm:"column:remark;comment:问题备注;type:varchar(600);"`
-	Count      *int   `json:"count" form:"count" gorm:"default:0;column:count;comment:阅读次数;type:int);"`
-	Integral   *int   `json:"integral" form:"integral" gorm:"default:0;column:integral;comment:积分;type:int);"`
-	UnitName   string `json:"unitName" form:"unitName" gorm:"column:unit_name;comment:单位名称;type:varchar(255));"`
-	UnitId     *int   `json:"unitId" form:"unitId" gorm:"default:0;column:unit_id;comment:单位id;type:int);"`
+	HandAt     time.Time // 处理时间
+	Oper       uint      `json:"oper" form:"oper" gorm:"column:oper;comment:发布人;type:bigint"`
+	Handler    *int      `json:"handler" form:"handler" gorm:"column:handler;comment:处理人;type:bigint"`
+	Imgs       string    `json:"imgs" form:"imgs" gorm:"column:imgs;comment:关联图片;type:varchar(2000);"`
+	Video      string    `json:"video" form:"video" gorm:"column:video;comment:关联视频;type:varchar(255);"`
+	SiteId     uint      `json:"siteId" form:"siteId" gorm:"column:site_id;comment:站点id;type:bigint"`
+	SiteName   string    `json:"siteName" form:"siteName" gorm:"column:site_name;comment:站点id;type:bigint"`
+	Position   string    `json:"position" form:"position" gorm:"column:position;comment:经纬度;type:varchar(255);"`
+	Matter     string    `json:"matter" form:"matter" gorm:"column:matter;comment:问题列表;type:varchar(255);"`
+	SiteType   string    `json:"siteType" form:"siteType" gorm:"column:site_type;comment:站点类型;type:varchar(255);"`
+	Status     string    `json:"status" form:"status" gorm:"column:status;comment:处理状态;type:varchar(255);"`
+	Region     string    `json:"region" form:"region" gorm:"column:region;comment:区域;type:varchar(255);"`
+	HandImgs   string    `json:"handImgs" form:"handImgs" gorm:"column:hand_imgs;comment:处理图片;type:varchar(255);"`
+	HandText   string    `json:"handText" form:"handText" gorm:"column:hand_text;comment:处理内容;type:varchar(255);"`
+	Department string    `json:"department" form:"department" gorm:"column:department;comment:责任部门;type:varchar(255);"`
+	Remark     string    `json:"remark" form:"remark" gorm:"column:remark;comment:问题备注;type:varchar(600);"`
+	Audit      string    `json:"remark1" form:"remark1" gorm:"column:remark1;comment:审核备注;type:varchar(600);"`
+	Count      *int      `json:"count" form:"count" gorm:"default:0;column:count;comment:阅读次数;type:int);"`
+	Integral   *int      `json:"integral" form:"integral" gorm:"default:0;column:integral;comment:积分;type:int);"`
+	UnitName   string    `json:"unitName" form:"unitName" gorm:"column:unit_name;comment:单位名称;type:varchar(255));"`
+	UnitId     *int      `json:"unitId" form:"unitId" gorm:"default:0;column:unit_id;comment:单位id;type:int);"`
 }
 
 // TableName ProblemInfo 表名

+ 6 - 7
server/model/autocode/problem_type.go

@@ -8,15 +8,14 @@ import (
 // ProblemType 结构体
 // 如果含有time.Time 请自行import time包
 type ProblemType struct {
-      global.GVA_MODEL
-      SiteType  *int `json:"siteType" form:"siteType" gorm:"column:site_type;comment:站点类型;type:int"`
-      Problem  string `json:"problem" form:"problem" gorm:"column:problem;comment:问题;type:varchar(255);"`
-      Integral  *int `json:"integral" form:"integral" gorm:"column:integral;comment:分数;type:int"`
+	global.GVA_MODEL
+	SiteType *int   `json:"siteType" form:"siteType" gorm:"column:site_type;comment:站点类型;type:int"`
+	Problem  string `json:"problem" form:"problem" gorm:"column:problem;comment:问题;type:varchar(255);"`
+	Integral *int   `json:"integral" form:"integral" gorm:"column:integral;comment:分数;type:int"`
+	UnitIds  string `json:"unitIds" form:"unitIds" gorm:"column:unit_ids;comment:责任单位id;type:varchar(255);"`
 }
 
-
 // TableName ProblemType 表名
 func (ProblemType) TableName() string {
-  return "problem_type"
+	return "problem_type"
 }
-

+ 11 - 0
server/model/autocode/request/unit_place.go

@@ -0,0 +1,11 @@
+package request
+
+import (
+	"github.com/flipped-aurora/gin-vue-admin/server/model/autocode"
+	"github.com/flipped-aurora/gin-vue-admin/server/model/common/request"
+)
+
+type UnitPlaceSearch struct{
+    autocode.UnitPlace
+    request.PageInfo
+}

+ 11 - 0
server/model/autocode/request/unit_user.go

@@ -0,0 +1,11 @@
+package request
+
+import (
+	"github.com/flipped-aurora/gin-vue-admin/server/model/autocode"
+	"github.com/flipped-aurora/gin-vue-admin/server/model/common/request"
+)
+
+type UnitUserSearch struct{
+    autocode.UnitUser
+    request.PageInfo
+}

+ 1 - 0
server/model/autocode/unit.go

@@ -13,6 +13,7 @@ type Unit struct {
 	Period          string `json:"period" form:"period" gorm:"column:period;comment:期编号;type:varchar(40);"`
 	UnitIntegral    *int   `json:"unitIntegral" form:"unitIntegral" gorm:"column:unit_integral;comment:现有积分;type:int"`
 	UnitMaxIntegral *int   `json:"unitMaxIntegral" form:"unitMaxIntegral" gorm:"column:unit_max_integral;comment:满分;type:int"`
+	Remark          string `json:"remark" form:"remark" gorm:"column:remark;comment:单位类型;type:varchar(600);"`
 }
 
 // TableName Unit 表名

+ 1 - 0
server/model/autocode/unit_history.go

@@ -15,6 +15,7 @@ type UnitHistory struct {
 	Period          string `json:"period" form:"period" gorm:"column:period;comment:期编号;type:varchar(40);"`
 	UnitId          *uint  `json:"unitId" form:"unitId" gorm:"column:unit_id;comment:单位id;type:bigint"`
 	ProblemIds      string `json:"problemIds" form:"problemIds" gorm:"column:problem_ids;comment:关联问题id;type:varchar(10000);"`
+	Remark          string `json:"remark" form:"remark" gorm:"column:remark;comment:单位类型;type:varchar(600);"`
 }
 
 // TableName UnitHistory 表名

+ 24 - 0
server/model/autocode/unit_place.go

@@ -0,0 +1,24 @@
+// 自动生成模板UnitPlace
+package autocode
+
+import (
+	"github.com/flipped-aurora/gin-vue-admin/server/global"
+)
+
+// UnitPlace 结构体
+// 如果含有time.Time 请自行import time包
+type UnitPlace struct {
+	global.GVA_MODEL
+	UnitId  *int   `json:"unitId" form:"unitId" gorm:"column:unit_id;comment:单位id;type:int"`
+	PlaceId string `json:"placeId" form:"placeId" gorm:"column:place_id;comment:点位id;type:int"`
+}
+
+type UnitPlaceVo struct {
+	UnitId   *int     `json:"unitId" form:"unitId"`
+	PlaceIds []string `json:"placeIds" form:"placeIds"` // 点位id
+}
+
+// TableName UnitPlace 表名
+func (UnitPlace) TableName() string {
+	return "unit_place"
+}

+ 41 - 0
server/model/autocode/unit_user.go

@@ -0,0 +1,41 @@
+// 自动生成模板UnitUser
+package autocode
+
+import (
+	"github.com/flipped-aurora/gin-vue-admin/server/global"
+)
+
+// UnitUser 结构体
+// 如果含有time.Time 请自行import time包
+type UnitUser struct {
+	global.GVA_MODEL
+	UnitId *int   `json:"unitId" form:"unitId" gorm:"column:unit_id;comment:;type:bigint"`
+	UUID   string `json:"uuid" form:"uuid" gorm:"comment:用户UUID"` // 用户UUID
+
+	//Username    string `json:"userName" gorm:"comment:用户登录名"`                                                 // 用户登录名
+	//NickName    string `json:"nickName" gorm:"default:系统用户;comment:用户昵称"`                                     // 用户昵称
+	//SideMode    string `json:"sideMode" gorm:"default:dark;comment:用户侧边主题"`                                   // 用户侧边主题
+	//HeaderImg   string `json:"headerImg" gorm:"default:http://qmplusimg.henrongyi.top/head.png;comment:用户头像"` // 用户头像
+	//BaseColor   string `json:"baseColor" gorm:"default:#fff;comment:基础颜色"`                                    // 基础颜色
+	//ActiveColor string `json:"activeColor" gorm:"default:#1890ff;comment:活跃颜色"`                               // 活跃颜色
+	//AuthorityId string `json:"authorityId" gorm:"default:888;comment:用户角色ID"`                                 // 用户角色ID
+	//OpenId      string `json:"openId" gorm:"comment:openid"`                                                  // 小程序用户id
+	//WechatId    string `json:"wechatId" gorm:"comment:wechatid"`                                              // 微信公众号用户id
+	//UnionId     string `json:"unionId" gorm:"comment:unionid"`                                                // 组合id
+	//
+	//UnitName        string `json:"unitName" form:"unitName" gorm:"column:unit_name;comment:单位名称;type:varchar(200);"`
+	//Period          string `json:"period" form:"period" gorm:"column:period;comment:期编号;type:varchar(40);"`
+	//UnitIntegral    *int   `json:"unitIntegral" form:"unitIntegral" gorm:"column:unit_integral;comment:现有积分;type:int"`
+	//UnitMaxIntegral *int   `json:"unitMaxIntegral" form:"unitMaxIntegral" gorm:"column:unit_max_integral;comment:满分;type:int"`
+	//Remark          string `json:"remark" form:"remark" gorm:"column:remark;comment:单位类型;type:varchar(600);"`
+}
+
+type UnitUserVo struct {
+	UnitId *int     `json:"unitId" form:"unitId"`
+	UUID   []string `json:"uuid" form:"uuid"` // 用户UUID
+}
+
+// TableName UnitUser 表名
+func (UnitUser) TableName() string {
+	return "unit_user"
+}

+ 2 - 0
server/router/autocode/enter.go

@@ -13,5 +13,7 @@ type RouterGroup struct {
 	ProblemReplyRouter
 	OrganizationRouter
 	PlaceProRouter
+	UnitUserRouter
+	UnitPlaceRouter
 	// Code generated by github.com/flipped-aurora/gin-vue-admin/server End; DO NOT EDIT.
 }

+ 1 - 0
server/router/autocode/problem_info.go

@@ -20,6 +20,7 @@ func (s *ProblemInfoRouter) InitProblemInfoRouter(Router *gin.RouterGroup) {
 		problemInfoRouter.DELETE("deleteProblemInfo", problemInfoApi.DeleteProblemInfo)           // 删除ProblemInfo
 		problemInfoRouter.DELETE("deleteProblemInfoByIds", problemInfoApi.DeleteProblemInfoByIds) // 批量删除ProblemInfo
 		problemInfoRouter.PUT("updateProblemInfo", problemInfoApi.UpdateProblemInfo)              // 更新ProblemInfo
+		problemInfoRouter.PUT("updateProblemInfoAudit", problemInfoApi.UpdateProblemInfoStatus)   // 更新审核信息
 		problemInfoRouter.GET("getProblemInfoList", problemInfoApi.GetProblemInfoList)            // 获取ProblemInfo列表
 		problemInfoRouter.GET("findProblemPInfo", problemInfoApi.FindProblemPInfo)                // 根据ID获取ProblemInfo
 	}

+ 24 - 0
server/router/autocode/unit_place.go

@@ -0,0 +1,24 @@
+package autocode
+
+import (
+	"github.com/flipped-aurora/gin-vue-admin/server/api/v1"
+	"github.com/flipped-aurora/gin-vue-admin/server/middleware"
+	"github.com/gin-gonic/gin"
+)
+
+type UnitPlaceRouter struct {
+}
+
+// InitUnitPlaceRouter 初始化 UnitPlace 路由信息
+func (s *UnitPlaceRouter) InitUnitPlaceRouter(Router *gin.RouterGroup) {
+	unitPlaceRouter := Router.Group("unitPlace").Use(middleware.OperationRecord())
+	var unitPlaceApi = v1.ApiGroupApp.AutoCodeApiGroup.UnitPlaceApi
+	{
+		unitPlaceRouter.POST("createUnitPlace", unitPlaceApi.CreateUnitPlace)   // 新建UnitPlace
+		unitPlaceRouter.DELETE("deleteUnitPlace", unitPlaceApi.DeleteUnitPlace) // 删除UnitPlace
+		unitPlaceRouter.DELETE("deleteUnitPlaceByIds", unitPlaceApi.DeleteUnitPlaceByIds) // 批量删除UnitPlace
+		unitPlaceRouter.PUT("updateUnitPlace", unitPlaceApi.UpdateUnitPlace)    // 更新UnitPlace
+		unitPlaceRouter.GET("findUnitPlace", unitPlaceApi.FindUnitPlace)        // 根据ID获取UnitPlace
+		unitPlaceRouter.GET("getUnitPlaceList", unitPlaceApi.GetUnitPlaceList)  // 获取UnitPlace列表
+	}
+}

+ 24 - 0
server/router/autocode/unit_user.go

@@ -0,0 +1,24 @@
+package autocode
+
+import (
+	"github.com/flipped-aurora/gin-vue-admin/server/api/v1"
+	"github.com/flipped-aurora/gin-vue-admin/server/middleware"
+	"github.com/gin-gonic/gin"
+)
+
+type UnitUserRouter struct {
+}
+
+// InitUnitUserRouter 初始化 UnitUser 路由信息
+func (s *UnitUserRouter) InitUnitUserRouter(Router *gin.RouterGroup) {
+	unitUserRouter := Router.Group("unitUser").Use(middleware.OperationRecord())
+	var unitUserApi = v1.ApiGroupApp.AutoCodeApiGroup.UnitUserApi
+	{
+		unitUserRouter.POST("createUnitUser", unitUserApi.CreateUnitUser)   // 新建UnitUser
+		unitUserRouter.DELETE("deleteUnitUser", unitUserApi.DeleteUnitUser) // 删除UnitUser
+		unitUserRouter.DELETE("deleteUnitUserByIds", unitUserApi.DeleteUnitUserByIds) // 批量删除UnitUser
+		unitUserRouter.PUT("updateUnitUser", unitUserApi.UpdateUnitUser)    // 更新UnitUser
+		unitUserRouter.GET("findUnitUser", unitUserApi.FindUnitUser)        // 根据ID获取UnitUser
+		unitUserRouter.GET("getUnitUserList", unitUserApi.GetUnitUserList)  // 获取UnitUser列表
+	}
+}

+ 2 - 0
server/service/autocode/enter.go

@@ -13,5 +13,7 @@ type ServiceGroup struct {
 	ProblemReplyService
 	OrganizationService
 	PlaceProService
+	UnitUserService
+	UnitPlaceService
 	// Code generated by github.com/flipped-aurora/gin-vue-admin/server End; DO NOT EDIT.
 }

+ 5 - 0
server/service/autocode/place.go

@@ -38,6 +38,11 @@ func (placeService *PlaceService) UpdatePlace(place autocode.Place) (err error)
 	return err
 }
 
+func (placeService *PlaceService) FindPlaceSum(placeIds []string) (total int) {
+	global.GVA_DB.Model(&autocode.Place{}).Select("SUM(unit_max_integral) as total").Where("id in ?", placeIds).Pluck("total", &total)
+	return
+}
+
 // GetPlace 根据id获取Place记录
 // Author [piexlmax](https://github.com/piexlmax)
 func (placeService *PlaceService) GetPlace(id uint) (err error, place autocode.Place) {

+ 14 - 3
server/service/autocode/unit.go

@@ -36,13 +36,24 @@ func (unitService *UnitService) DeleteUnitByIds(ids request.IdsReq) (err error)
 // UpdateUnit 更新Unit记录
 // Author [piexlmax](https://github.com/piexlmax)
 func (unitService *UnitService) UpdateUnit(unit autocode.Unit) (err error) {
-	now := *unit.UnitIntegral
-	now = now * 10
-	unit.UnitIntegral = &now
+	//if unit {
+	//
+	//}
+	//now := *unit.UnitIntegral
+	//now = now * 100
+	//unit.UnitIntegral = &now
 	err = global.GVA_DB.Save(&unit).Error
 	return err
 }
 
+func (unitService *UnitService) UpdateUnitMaxIntegral(id *int, maxIntergral int) (err error) {
+	var unit autocode.Unit
+	global.GVA_DB.Where("id = ?", id).First(&unit)
+	unit.UnitMaxIntegral = &maxIntergral
+	err = global.GVA_DB.Save(unit).Error
+	return err
+}
+
 // UpdateUnit 开始下期
 // Author [piexlmax](https://github.com/piexlmax)
 func (unitService *UnitService) UpdateUnitNext(unit autocode.Unit) (err error) {

+ 70 - 0
server/service/autocode/unit_place.go

@@ -0,0 +1,70 @@
+package autocode
+
+import (
+	"github.com/flipped-aurora/gin-vue-admin/server/global"
+	"github.com/flipped-aurora/gin-vue-admin/server/model/autocode"
+	autoCodeReq "github.com/flipped-aurora/gin-vue-admin/server/model/autocode/request"
+	"github.com/flipped-aurora/gin-vue-admin/server/model/common/request"
+)
+
+type UnitPlaceService struct {
+}
+
+// CreateUnitPlace 创建UnitPlace记录
+// Author [piexlmax](https://github.com/piexlmax)
+func (unitPlaceService *UnitPlaceService) CreateUnitPlace(unitPlace autocode.UnitPlace) (err error) {
+	err = global.GVA_DB.Create(&unitPlace).Error
+	return err
+}
+
+// DeleteUnitPlace 删除UnitPlace记录
+// Author [piexlmax](https://github.com/piexlmax)
+func (unitPlaceService *UnitPlaceService) DeleteUnitPlace(unitPlace autocode.UnitPlace) (err error) {
+	err = global.GVA_DB.Delete(&unitPlace).Error
+	return err
+}
+
+// DeleteUnitPlaceByIds 批量删除UnitPlace记录
+// Author [piexlmax](https://github.com/piexlmax)
+func (unitPlaceService *UnitPlaceService) DeleteUnitPlaceByIds(ids request.IdsReq) (err error) {
+	err = global.GVA_DB.Delete(&[]autocode.UnitPlace{}, "id in ?", ids.Ids).Error
+	return err
+}
+
+// UpdateUnitPlace 更新UnitPlace记录
+// Author [piexlmax](https://github.com/piexlmax)
+func (unitPlaceService *UnitPlaceService) UpdateUnitPlace(unitPlace autocode.UnitPlace) (err error) {
+
+	err = global.GVA_DB.Save(&unitPlace).Error
+	return err
+}
+
+// GetUnitPlace 根据id获取UnitPlace记录
+// Author [piexlmax](https://github.com/piexlmax)
+func (unitPlaceService *UnitPlaceService) GetUnitPlace(id uint) (err error, unitPlace autocode.UnitPlace) {
+	err = global.GVA_DB.Where("id = ?", id).First(&unitPlace).Error
+	return
+}
+
+func (unitPlaceService *UnitPlaceService) GetUnitPlaces(id *int) (err error, unitPlaces []autocode.UnitPlace) {
+	err = global.GVA_DB.Where("unit_id = ?", id).Find(&unitPlaces).Error
+	return
+}
+
+// GetUnitPlaceInfoList 分页获取UnitPlace记录
+// Author [piexlmax](https://github.com/piexlmax)
+func (unitPlaceService *UnitPlaceService) GetUnitPlaceInfoList(info autoCodeReq.UnitPlaceSearch) (err error, list interface{}, total int64) {
+	limit := info.PageSize
+	offset := info.PageSize * (info.Page - 1)
+	// 创建db
+	db := global.GVA_DB.Model(&autocode.UnitPlace{})
+	if info.UnitId != nil && *info.UnitId != 0 {
+		db.Where("unit_id = ?", info.UnitId)
+	}
+
+	var unitPlaces []autocode.UnitPlace
+	// 如果有条件搜索 下方会自动创建搜索语句
+	err = db.Count(&total).Error
+	err = db.Limit(limit).Offset(offset).Find(&unitPlaces).Error
+	return err, unitPlaces, total
+}

+ 65 - 0
server/service/autocode/unit_user.go

@@ -0,0 +1,65 @@
+package autocode
+
+import (
+	"github.com/flipped-aurora/gin-vue-admin/server/global"
+	"github.com/flipped-aurora/gin-vue-admin/server/model/autocode"
+	autoCodeReq "github.com/flipped-aurora/gin-vue-admin/server/model/autocode/request"
+	"github.com/flipped-aurora/gin-vue-admin/server/model/common/request"
+)
+
+type UnitUserService struct {
+}
+
+// CreateUnitUser 创建UnitUser记录
+// Author [piexlmax](https://github.com/piexlmax)
+func (unitUserService *UnitUserService) CreateUnitUser(unitUser autocode.UnitUser) (err error) {
+	err = global.GVA_DB.Create(&unitUser).Error
+	return err
+}
+
+// DeleteUnitUser 删除UnitUser记录
+// Author [piexlmax](https://github.com/piexlmax)
+func (unitUserService *UnitUserService) DeleteUnitUser(unitUser autocode.UnitUser) (err error) {
+	err = global.GVA_DB.Delete(&unitUser).Error
+	return err
+}
+
+// DeleteUnitUserByIds 批量删除UnitUser记录
+// Author [piexlmax](https://github.com/piexlmax)
+func (unitUserService *UnitUserService) DeleteUnitUserByIds(ids request.IdsReq) (err error) {
+	err = global.GVA_DB.Delete(&[]autocode.UnitUser{}, "id in ?", ids.Ids).Error
+	return err
+}
+
+// UpdateUnitUser 更新UnitUser记录
+// Author [piexlmax](https://github.com/piexlmax)
+func (unitUserService *UnitUserService) UpdateUnitUser(unitUser autocode.UnitUser) (err error) {
+	err = global.GVA_DB.Save(&unitUser).Error
+	return err
+}
+
+// GetUnitUser 根据id获取UnitUser记录
+// Author [piexlmax](https://github.com/piexlmax)
+func (unitUserService *UnitUserService) GetUnitUser(id uint) (err error, unitUser autocode.UnitUser) {
+	err = global.GVA_DB.Where("id = ?", id).First(&unitUser).Error
+	return
+}
+
+func (unitUserService *UnitUserService) GetUnitUsers(id *int) (err error, unitUser []autocode.UnitUser) {
+	err = global.GVA_DB.Where("unit_id = ?", id).Find(&unitUser).Error
+	return
+}
+
+// GetUnitUserInfoList 分页获取UnitUser记录
+// Author [piexlmax](https://github.com/piexlmax)
+func (unitUserService *UnitUserService) GetUnitUserInfoList(info autoCodeReq.UnitUserSearch) (err error, list interface{}, total int64) {
+	limit := info.PageSize
+	offset := info.PageSize * (info.Page - 1)
+	// 创建db
+	db := global.GVA_DB.Model(&autocode.UnitUser{})
+	var unitUsers []autocode.UnitUser
+	// 如果有条件搜索 下方会自动创建搜索语句
+	err = db.Count(&total).Error
+	err = db.Limit(limit).Offset(offset).Find(&unitUsers).Error
+	return err, unitUsers, total
+}

+ 2 - 2
server/service/system/sys_user.go

@@ -203,10 +203,10 @@ func (userService *UserService) GetUserInfoByUnionId(unionId string) (err error,
 //@param: id int
 //@return: err error, user *model.SysUser
 
-func (userService *UserService) FindUserById(id int) (err error, user system.SysUser) {
+func (userService *UserService) FindUserById(id int) (err error, user *system.SysUser) {
 	var u system.SysUser
 	err = global.GVA_DB.Where("`id` = ?", id).First(&u).Error
-	return err, u
+	return err, &u
 }
 
 //@author: [SliverHorn](https://github.com/SliverHorn)

+ 10 - 3
web/src/api/problemInfo.js

@@ -1,5 +1,5 @@
 import service from '@/utils/request'
-import {ElMessage} from "element-plus";
+import { ElMessage } from 'element-plus'
 
 // @Tags ProblemInfo
 // @Summary 创建ProblemInfo
@@ -33,7 +33,6 @@ export const getReadCountList = (params) => {
   })
 }
 
-
 export const exportExcel = (data) => {
   service({
     url: '/problemInfo/exportExcel',
@@ -64,7 +63,7 @@ const handleFileError = (res) => {
     var a = document.createElement('a')
     a.style.display = 'none'
     a.href = downloadUrl
-    a.download = new Date().Format("yyyy-MM-dd hh:mm:ss") + '.xlsx'
+    a.download = new Date().Format('yyyy-MM-dd hh:mm:ss') + '.xlsx'
     var event = new MouseEvent('click')
     a.dispatchEvent(event)
   }
@@ -118,6 +117,14 @@ export const updateProblemInfo = (data) => {
   })
 }
 
+export const updateProblemInfoAudit = (data) => {
+  return service({
+    url: '/problemInfo/updateProblemInfoAudit',
+    method: 'put',
+    data
+  })
+}
+
 // @Tags ProblemInfo
 // @Summary 用id查询ProblemInfo
 // @Security ApiKeyAuth

+ 97 - 0
web/src/api/unitPlace.js

@@ -0,0 +1,97 @@
+import service from '@/utils/request'
+
+// @Tags UnitPlace
+// @Summary 创建UnitPlace
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data body model.UnitPlace true "创建UnitPlace"
+// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
+// @Router /unitPlace/createUnitPlace [post]
+export const createUnitPlace = (data) => {
+  return service({
+    url: '/unitPlace/createUnitPlace',
+    method: 'post',
+    data
+  })
+}
+
+// @Tags UnitPlace
+// @Summary 删除UnitPlace
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data body model.UnitPlace true "删除UnitPlace"
+// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
+// @Router /unitPlace/deleteUnitPlace [delete]
+export const deleteUnitPlace = (data) => {
+  return service({
+    url: '/unitPlace/deleteUnitPlace',
+    method: 'delete',
+    data
+  })
+}
+
+// @Tags UnitPlace
+// @Summary 删除UnitPlace
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data body request.IdsReq true "批量删除UnitPlace"
+// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
+// @Router /unitPlace/deleteUnitPlace [delete]
+export const deleteUnitPlaceByIds = (data) => {
+  return service({
+    url: '/unitPlace/deleteUnitPlaceByIds',
+    method: 'delete',
+    data
+  })
+}
+
+// @Tags UnitPlace
+// @Summary 更新UnitPlace
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data body model.UnitPlace true "更新UnitPlace"
+// @Success 200 {string} string "{"success":true,"data":{},"msg":"更新成功"}"
+// @Router /unitPlace/updateUnitPlace [put]
+export const updateUnitPlace = (data) => {
+  return service({
+    url: '/unitPlace/updateUnitPlace',
+    method: 'put',
+    data
+  })
+}
+
+// @Tags UnitPlace
+// @Summary 用id查询UnitPlace
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data query model.UnitPlace true "用id查询UnitPlace"
+// @Success 200 {string} string "{"success":true,"data":{},"msg":"查询成功"}"
+// @Router /unitPlace/findUnitPlace [get]
+export const findUnitPlace = (params) => {
+  return service({
+    url: '/unitPlace/findUnitPlace',
+    method: 'get',
+    params
+  })
+}
+
+// @Tags UnitPlace
+// @Summary 分页获取UnitPlace列表
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data query request.PageInfo true "分页获取UnitPlace列表"
+// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
+// @Router /unitPlace/getUnitPlaceList [get]
+export const getUnitPlaceList = (params) => {
+  return service({
+    url: '/unitPlace/getUnitPlaceList',
+    method: 'get',
+    params
+  })
+}

+ 97 - 0
web/src/api/unitUser.js

@@ -0,0 +1,97 @@
+import service from '@/utils/request'
+
+// @Tags UnitUser
+// @Summary 创建UnitUser
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data body model.UnitUser true "创建UnitUser"
+// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
+// @Router /unitUser/createUnitUser [post]
+export const createUnitUser = (data) => {
+  return service({
+    url: '/unitUser/createUnitUser',
+    method: 'post',
+    data
+  })
+}
+
+// @Tags UnitUser
+// @Summary 删除UnitUser
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data body model.UnitUser true "删除UnitUser"
+// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
+// @Router /unitUser/deleteUnitUser [delete]
+export const deleteUnitUser = (data) => {
+  return service({
+    url: '/unitUser/deleteUnitUser',
+    method: 'delete',
+    data
+  })
+}
+
+// @Tags UnitUser
+// @Summary 删除UnitUser
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data body request.IdsReq true "批量删除UnitUser"
+// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
+// @Router /unitUser/deleteUnitUser [delete]
+export const deleteUnitUserByIds = (data) => {
+  return service({
+    url: '/unitUser/deleteUnitUserByIds',
+    method: 'delete',
+    data
+  })
+}
+
+// @Tags UnitUser
+// @Summary 更新UnitUser
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data body model.UnitUser true "更新UnitUser"
+// @Success 200 {string} string "{"success":true,"data":{},"msg":"更新成功"}"
+// @Router /unitUser/updateUnitUser [put]
+export const updateUnitUser = (data) => {
+  return service({
+    url: '/unitUser/updateUnitUser',
+    method: 'put',
+    data
+  })
+}
+
+// @Tags UnitUser
+// @Summary 用id查询UnitUser
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data query model.UnitUser true "用id查询UnitUser"
+// @Success 200 {string} string "{"success":true,"data":{},"msg":"查询成功"}"
+// @Router /unitUser/findUnitUser [get]
+export const findUnitUser = (params) => {
+  return service({
+    url: '/unitUser/findUnitUser',
+    method: 'get',
+    params
+  })
+}
+
+// @Tags UnitUser
+// @Summary 分页获取UnitUser列表
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data query request.PageInfo true "分页获取UnitUser列表"
+// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
+// @Router /unitUser/getUnitUserList [get]
+export const getUnitUserList = (params) => {
+  return service({
+    url: '/unitUser/getUnitUserList',
+    method: 'get',
+    params
+  })
+}

+ 4 - 0
web/src/style/main.scss

@@ -911,6 +911,10 @@ li {
     }
 }
 
+.audit{
+    display: flex;
+}
+
 // .el-menu .el-menu--inline {
 //     background: #2c3b41;
 // }

+ 117 - 120
web/src/view/organization/organization.vue

@@ -3,21 +3,19 @@
     <div class="search-term">
       <el-form :inline="true" :model="searchInfo" class="demo-form-inline">
         <el-form-item class="disFlex">
-          <el-input v-model="searchID" class="lh30 mr10"></el-input>
+          <el-input v-model="searchInfo.code" class="lh30 mr10" />
           <el-button
             size="mini"
             type="primary"
             icon="el-icon-search"
             @click="onSubmit"
-            >查询</el-button
-          >
+          >查询</el-button>
           <el-button
             size="mini"
             type="primary"
             icon="el-icon-plus"
             @click="openDialog"
-            >新增</el-button
-          >
+          >新增</el-button>
           <el-popover
             v-model:visible="deleteVisible"
             placement="top"
@@ -25,12 +23,16 @@
           >
             <p>确定要删除吗?</p>
             <div style="text-align: right; margin: 0">
-              <el-button size="mini" type="text" @click="deleteVisible = false"
-                >取消</el-button
-              >
-              <el-button size="mini" type="primary" @click="onDelete"
-                >确定</el-button
-              >
+              <el-button
+                size="mini"
+                type="text"
+                @click="deleteVisible = false"
+              >取消</el-button>
+              <el-button
+                size="mini"
+                type="primary"
+                @click="onDelete"
+              >确定</el-button>
             </div>
             <template #reference>
               <el-button
@@ -38,8 +40,7 @@
                 size="mini"
                 type="danger"
                 style="margin-left: 10px"
-                >批量删除</el-button
-              >
+              >批量删除</el-button>
             </template>
           </el-popover>
         </el-form-item>
@@ -68,15 +69,13 @@
             icon="el-icon-edit"
             class="table-button"
             @click="updateOrganization(scope.row)"
-            >变更</el-button
-          >
+          >变更</el-button>
           <el-button
             type="danger"
             icon="el-icon-delete"
             size="mini"
             @click="deleteRow(scope.row)"
-            >删除</el-button
-          >
+          >删除</el-button>
         </template>
       </el-table-column>
     </el-table>
@@ -120,9 +119,11 @@
         </el-form-item> -->
         <el-form-item label="中心点:" prop="postition">
           <!-- <el-input @click="choosePoint" v-model="formData.postition" disabled placeholder="选择中心点坐标"  /> -->
-          <el-button type="primary" size="mini" @click="choosePoint"
-            >去地图选择</el-button
-          >
+          <el-button
+            type="primary"
+            size="mini"
+            @click="choosePoint"
+          >去地图选择</el-button>
           <span class="ml10" prop="postition">{{ formData.postition }}</span>
         </el-form-item>
       </el-form>
@@ -137,12 +138,11 @@
     <!-- 地图弹框开始 -->
     <el-dialog v-model="dialogMap" title="弹窗操作" width="70%" top="2vh">
       <iframe
-        class="map"
         id="mapPage"
+        class="map"
         frameborder="0"
         src="https://apis.map.qq.com/tools/locpicker?search=1&type=1&key=DRGBZ-DMJE3-6SA3I-3ILVP-GMXPT-J3FLR&referer=文明城市创业管理系统"
-      >
-      </iframe>
+      />
     </el-dialog>
 
     <!-- 地图弹框结束 -->
@@ -157,214 +157,211 @@ import {
   updateOrganization,
   findOrganization,
   getOrganizationList,
-} from "@/api/organization"; //  此处请自行替换地址
-import infoList from "@/mixins/infoList";
+} from '@/api/organization' //  此处请自行替换地址
+import infoList from '@/mixins/infoList'
 
 export default {
-  name: "Organization",
+  name: 'Organization',
   mixins: [infoList],
 
   data() {
     return {
       // 地图弹框
       dialogMap: false,
-      searchID: "",
-
+      searchID: '1307',
+      searchInfo: { parentcode: '1307' },
       listApi: getOrganizationList,
       dialogFormVisible: false,
-      type: "",
+      type: '',
       deleteVisible: false,
       multipleSelection: [],
       formData: {
         code: '',
-        name: "",
-        parentcode: "1307",
+        name: '',
+        parentcode: '1307',
         optimistic: 0,
 
-        postition: "", //中心点
+        postition: '', // 中心点
       },
 
       rules: {
         code: [
           {
             required: true,
-            message: "区域编码不能为空",
-            trigger: "blur",
+            message: '区域编码不能为空',
+            trigger: 'blur',
           },
         ],
         name: [
           {
             required: true,
-            message: "区域名称不能为空",
-            trigger: "blur",
+            message: '区域名称不能为空',
+            trigger: 'blur',
           },
         ],
         parentcode: [
           {
             required: true,
-            message: "上级编码不能为空",
-            trigger: "blur",
+            message: '上级编码不能为空',
+            trigger: 'blur',
           },
         ],
         postition: [
           {
             required: true,
-            message: "中心点不能为空",
-            trigger: "change",
+            message: '中心点不能为空',
+            trigger: 'change',
           },
         ],
       },
-    };
+    }
   },
   computed: {
     'formData.code': {
       set: {
-        
+
       }
     }
-  },  
+  },
   async created() {
-    await this.getTableData();
-    let that = this;
+    await this.getTableData()
+    const that = this
     window.addEventListener(
-      "message",
-      function (event) {
+      'message',
+      function(event) {
         // 接收位置信息,用户选择确认位置点后选点组件会触发该事件,回传用户的位置信息
-        var loc = event.data;
-        if (loc && loc.module == "locationPicker") {
-          //防止其他应用也会向该页面post信息,需判断module是否为'locationPicker'
+        var loc = event.data
+        if (loc && loc.module == 'locationPicker') {
+          // 防止其他应用也会向该页面post信息,需判断module是否为'locationPicker'
           // console.log('location', loc);
           // console.log(loc.latlng.lat + ',' + loc.latlng.lng)
-          that.formData.postition = loc.latlng.lat + "," + loc.latlng.lng;
+          that.formData.postition = loc.latlng.lat + ',' + loc.latlng.lng
         }
       },
       false
-    );
+    )
   },
 
   methods: {
     // 地图选点
     choosePoint() {
-      this.dialogMap = true;
+      this.dialogMap = true
     },
     // 条件搜索前端看此方法
     onSubmit() {
-      this.page = 1;
-      this.pageSize = 10;
+      this.page = 1
+      this.pageSize = 10
       this.searchInfo = {
         parentcode: this.searchID
       }
-      this.getTableData();
+      this.getTableData()
     },
     handleSelectionChange(val) {
-      this.multipleSelection = val;
+      this.multipleSelection = val
     },
     deleteRow(row) {
-      this.$confirm("确定要删除吗?", "提示", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
+      this.$confirm('确定要删除吗?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning',
       }).then(() => {
-        this.deleteOrganization(row);
-      });
+        this.deleteOrganization(row)
+      })
     },
     async onDelete() {
-      const ids = [];
+      const ids = []
       if (this.multipleSelection.length === 0) {
         this.$message({
-          type: "warning",
-          message: "请选择要删除的数据",
-        });
-        return;
+          type: 'warning',
+          message: '请选择要删除的数据',
+        })
+        return
       }
       this.multipleSelection &&
         this.multipleSelection.map((item) => {
-          ids.push(item.ID);
-        });
-      const res = await deleteOrganizationByIds({ ids });
+          ids.push(item.ID)
+        })
+      const res = await deleteOrganizationByIds({ ids })
       if (res.code === 0) {
         this.$message({
-          type: "success",
-          message: "删除成功",
-        });
+          type: 'success',
+          message: '删除成功',
+        })
         if (this.tableData.length === ids.length && this.page > 1) {
-          this.page--;
+          this.page--
         }
-        this.deleteVisible = false;
-        this.getTableData();
+        this.deleteVisible = false
+        this.getTableData()
       }
     },
     async updateOrganization(row) {
-      const res = await findOrganization({ code: row.code });
-      this.type = "update";
+      const res = await findOrganization({ code: row.code })
+      this.type = 'update'
       if (res.code === 0) {
-        this.formData = res.data.reorganization;
-        this.dialogFormVisible = true;
+        this.formData = res.data.reorganization
+        this.dialogFormVisible = true
       }
     },
     closeDialog() {
-      this.dialogFormVisible = false;
+      this.dialogFormVisible = false
       this.formData = {
-        code: "",
-        name: "",
-        parentcode: "",
-        postition: "",
+        code: '',
+        name: '',
+        parentcode: '',
+        postition: '',
         optimistic: 0,
-      };
+      }
     },
     async deleteOrganization(row) {
-      const res = await deleteOrganization({ code: row.code });
+      const res = await deleteOrganization({ code: row.code })
       if (res.code === 0) {
         this.$message({
-          type: "success",
-          message: "删除成功",
-        });
+          type: 'success',
+          message: '删除成功',
+        })
         if (this.tableData.length === 1 && this.page > 1) {
-          this.page--;
+          this.page--
         }
-        this.getTableData();
+        this.getTableData()
       }
     },
     async enterDialog() {
-      this.$refs["ruleFormRef"].validate((valid) => {
+      this.$refs['ruleFormRef'].validate((valid) => {
         if (valid) {
           // console.log(this.formData)
-          
+
           switch (this.type) {
-            case "create":
+            case 'create':
+
+              createOrganization(this.formData)
+              break
+            case 'update':
 
-              createOrganization(this.formData);
-              break;
-            case "update":
-     
-              updateOrganization(this.formData);
-              break;
+              updateOrganization(this.formData)
+              break
             default:
-   
-              createOrganization(this.formData);
-              break;
+
+              createOrganization(this.formData)
+              break
           }
-         
+
           this.$message({
-            type: "success",
-            message: this.type == "create" ? "创建成功" : "修改成功",
-          });
-          setTimeout( () => {
-            this.getTableData();
-            this.closeDialog();
-          },200)
-          
-           
-     
+            type: 'success',
+            message: this.type == 'create' ? '创建成功' : '修改成功',
+          })
+          setTimeout(() => {
+            this.getTableData()
+            this.closeDialog()
+          }, 200)
         }
-      });
+      })
     },
     openDialog() {
-      this.type = "create";
-      this.dialogFormVisible = true;
+      this.type = 'create'
+      this.dialogFormVisible = true
     },
   },
-};
+}
 </script>
 
 <style>

+ 179 - 181
web/src/view/place/place.vue

@@ -18,8 +18,7 @@
             type="primary"
             icon="el-icon-search"
             @click="onSubmit"
-            >查询</el-button
-          >
+          >查询</el-button>
           <!--          <el-button size="mini" type="primary" icon="el-icon-plus" @click="openDialog">新增</el-button>-->
           <el-popover
             v-model:visible="deleteVisible"
@@ -28,12 +27,16 @@
           >
             <p>确定要删除吗?</p>
             <div style="text-align: right; margin: 0">
-              <el-button size="mini" type="text" @click="deleteVisible = false"
-                >取消</el-button
-              >
-              <el-button size="mini" type="primary" @click="onDelete"
-                >确定</el-button
-              >
+              <el-button
+                size="mini"
+                type="text"
+                @click="deleteVisible = false"
+              >取消</el-button>
+              <el-button
+                size="mini"
+                type="primary"
+                @click="onDelete"
+              >确定</el-button>
             </div>
           </el-popover>
         </el-form-item>
@@ -55,6 +58,12 @@
         }}</template>
       </el-table-column>
       <el-table-column label="站点名称" prop="name" />
+      <el-table-column label="站点满分值" prop="unitMaxIntegral">
+        <template #default="scope">{{ scope.row.unitMaxIntegral/100 }}</template>
+      </el-table-column>
+      <el-table-column label="站点扣分" prop="unitIntegral">
+        <template #default="scope">{{ scope.row.unitIntegral/100 }}</template>
+      </el-table-column>
       <el-table-column label="站点定位" prop="position" width="150">
         <template #default="scope">
           <el-link
@@ -92,30 +101,27 @@
             icon="el-icon-edit"
             class="table-button"
             @click="updatePlace(scope.row)"
-            >变更
+          >变更
           </el-button>
           <el-button
             type="danger"
             icon="el-icon-delete"
             size="mini"
             @click="deleteRow(scope.row)"
-            >删除</el-button
-          >
+          >删除</el-button>
           <el-button
             type="info"
             class="mt10 ml0"
             icon="el-icon-circle-plus-outline"
             size="mini"
             @click="addProblem(scope.row)"
-            >添加问题</el-button
-          >
+          >添加问题</el-button>
           <el-button
             type="success"
             icon="el-icon-tickets"
             size="mini"
             @click="ProblemList(scope.row)"
-            >问题管理</el-button
-          >
+          >问题管理</el-button>
         </template>
       </el-table-column>
     </el-table>
@@ -151,18 +157,21 @@
             />
           </el-select>
         </el-form-item>
+        <el-form-item label="满分值:">
+          <el-input v-model="formData.unitMaxIntegral" />
+        </el-form-item>
         <el-form-item label="地址:">
           <el-input v-model="formData.region" clearable placeholder="请输入" />
         </el-form-item>
         <el-form-item label="区域:">
-          <el-cascader 
-            :options="optionsArea" 
-            v-model="formData.organCode" 
+          <el-cascader
+            v-model="formData.organCode"
+            :options="optionsArea"
             :show-all-levels="false"
-            :props="{ expandTrigger: 'hover', value: 'code', label: 'name'  }"
+            :props="{ expandTrigger: 'hover', value: 'code', label: 'name' }"
 
             @change="changeArea"
-          ></el-cascader>
+          />
         </el-form-item>
       </el-form>
       <template #footer>
@@ -176,8 +185,7 @@
     <!-- 问题管理开始 -->
     <el-dialog v-model="dialogProblemVisible" title="弹窗操作">
       <el-table :data="problemData" border>
-        <el-table-column prop="placeProText" label="问题名称">
-        </el-table-column>
+        <el-table-column prop="placeProText" label="问题名称" />
         <el-table-column label="操作" width="160">
           <template #default="scope">
             <el-button
@@ -186,15 +194,14 @@
               icon="el-icon-edit"
               class="table-button"
               @click="updateProblem(scope.row)"
-              >变更
+            >变更
             </el-button>
             <el-button
               type="danger"
               icon="el-icon-delete"
               size="mini"
               @click="deleteProblem(scope.row)"
-              >删除</el-button
-            >
+            >删除</el-button>
           </template>
         </el-table-column>
       </el-table>
@@ -212,288 +219,279 @@ import {
   updatePlace,
   findPlace,
   getPlaceList,
-} from "@/api/place"; //  此处请自行替换地址
+} from '@/api/place' //  此处请自行替换地址
 import {
   createPlacePro,
   deletePlacePro,
-  deletePlaceProByIds,
-  updatePlacePro,
-  findPlacePro,
-  getPlaceProList,
-} from "@/api/placePro"; //  此处请自行替换地址
+  updatePlacePro
+} from '@/api/placePro' //  此处请自行替换地址
 
-import { areaList, getOrganizationList } from "@/api/organization"
-import infoList from "@/mixins/infoList";
-import { getDict } from "@/utils/dictionary";
+import { areaList } from '@/api/organization'
+import infoList from '@/mixins/infoList'
+import { getDict } from '@/utils/dictionary'
 
 export default {
-  name: "Place",
-  dicts: ["site_type"],
+  name: 'Place',
+  dicts: ['site_type'],
   mixins: [infoList],
   data() {
     return {
-      currentID: 0, //当前问题ID
+      currentID: 0, // 当前问题ID
 
       listApi: getPlaceList,
       dialogFormVisible: false,
       dialogProblemVisible: false,
-      problemData: [], //问题列表
-      type: "",
+      problemData: [], // 问题列表
+      type: '',
       siteType: [],
       deleteVisible: false,
       multipleSelection: [],
       formData: {
-        name: "",
-        position: "",
-        type: "",
-        region: "",
-        organCode: ""
+        name: '',
+        position: '',
+        type: '',
+        region: '',
+        organCode: ''
       },
       formDataProblem: {
         placeId: 0,
-        placeProText: "",
+        placeProText: '',
       },
       optionsArea: []
-    };
+    }
   },
   async created() {
-    this.siteType = await getDict("site_type");
-    // await this.getTableData();
-    
-    await this.getTableData();
-
+    this.siteType = await getDict('site_type')
+    await this.getTableData()
   },
   methods: {
     openMapHandle(position, name, region) {
       window.open(
-        "https://apis.map.qq.com/uri/v1/marker?marker=coord:" +
+        'https://apis.map.qq.com/uri/v1/marker?marker=coord:' +
           position +
-          ";title:" +
+          ';title:' +
           name +
-          ";addr:" +
+          ';addr:' +
           region
-      );
+      )
     },
     // 条件搜索前端看此方法
     onSubmit() {
-      this.page = 1;
-      this.pageSize = 10;
-      this.getTableData();
+      this.page = 1
+      this.pageSize = 10
+      this.getTableData()
     },
     handleSelectionChange(val) {
-      this.multipleSelection = val;
+      this.multipleSelection = val
     },
     deleteRow(row) {
-      this.$confirm("确定要删除吗?", "提示", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
+      this.$confirm('确定要删除吗?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning',
       }).then(() => {
-        this.deletePlace(row);
-      });
+        this.deletePlace(row)
+      })
     },
     async onDelete() {
-      const ids = [];
+      const ids = []
       if (this.multipleSelection.length === 0) {
         this.$message({
-          type: "warning",
-          message: "请选择要删除的数据",
-        });
-        return;
+          type: 'warning',
+          message: '请选择要删除的数据',
+        })
+        return
       }
       this.multipleSelection &&
         this.multipleSelection.map((item) => {
-          ids.push(item.ID);
-        });
-      const res = await deletePlaceByIds({ ids });
+          ids.push(item.ID)
+        })
+      const res = await deletePlaceByIds({ ids })
       if (res.code === 0) {
         this.$message({
-          type: "success",
-          message: "删除成功",
-        });
+          type: 'success',
+          message: '删除成功',
+        })
         if (this.tableData.length === ids.length && this.page > 1) {
-          this.page--;
+          this.page--
         }
-        this.deleteVisible = false;
-        this.getTableData();
+        this.deleteVisible = false
+        this.getTableData()
       }
     },
     async updatePlace(row) {
-      const res = await findPlace({ ID: row.ID });
-      this.type = "update";
+      const res = await findPlace({ ID: row.ID })
+      this.type = 'update'
       if (res.code === 0) {
-        this.formData = res.data.replace;
-        this.dialogFormVisible = true;
+        this.formData = res.data.replace
+        this.formData.unitMaxIntegral = this.formData.unitMaxIntegral / 100
+        this.dialogFormVisible = true
       }
-      
-      let list = await areaList({code: '1307'})
-      console.log(list)
-      if(list.code == 0) {
-        this.optionsArea = list.data.treeMap     
 
+      const list = await areaList({ code: '1307' })
+      console.log(list)
+      if (list.code == 0) {
+        this.optionsArea = list.data.treeMap
       }
       // console.log(this.optionsArea)
     },
     closeDialog() {
-      this.dialogFormVisible = false;
+      this.dialogFormVisible = false
       this.formData = {
-        name: "",
-        position: "",
-        type: "",
-        region: "",
-      };
+        name: '',
+        position: '',
+        type: '',
+        region: '',
+      }
     },
     async deletePlace(row) {
-      const res = await deletePlace({ ID: row.ID });
+      const res = await deletePlace({ ID: row.ID })
       if (res.code === 0) {
         this.$message({
-          type: "success",
-          message: "删除成功",
-        });
+          type: 'success',
+          message: '删除成功',
+        })
         if (this.tableData.length === 1 && this.page > 1) {
-          this.page--;
+          this.page--
         }
-        this.getTableData();
+        this.getTableData()
       }
     },
     async enterDialog() {
-      let res;
+      let res
       switch (this.type) {
-        case "create":
-          res = await createPlace(this.formData);
-          break;
-        case "update":
-          res = await updatePlace(this.formData);
-          break;
+        case 'create':
+          res = await createPlace(this.formData)
+          break
+        case 'update':
+          res = await updatePlace(this.formData)
+          break
         default:
-          res = await createPlace(this.formData);
-          break;
+          res = await createPlace(this.formData)
+          break
       }
       if (res.code === 0) {
         this.$message({
-          type: "success",
-          message: "创建/更改成功",
-        });
-        this.closeDialog();
-        this.getTableData();
+          type: 'success',
+          message: '创建/更改成功',
+        })
+        this.closeDialog()
+        this.getTableData()
       }
     },
     openDialog() {
-      this.type = "create";
-      this.dialogFormVisible = true;
+      this.type = 'create'
+      this.dialogFormVisible = true
     },
     // 添加问题
     addProblem(row) {
-      this.$prompt("请输入站点问题", "提示", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        
+      this.$prompt('请输入站点问题', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+
       })
         .then(({ value }) => {
-          if (value == "" || value == null) {
+          if (value == '' || value == null) {
             this.$message({
-              type: "error",
-              message: "你的问题不能为空",
-            });
+              type: 'error',
+              message: '你的问题不能为空',
+            })
           } else {
-            this.formDataProblem.placeId = row.ID;
-            this.formDataProblem.placeProText = value;
+            this.formDataProblem.placeId = row.ID
+            this.formDataProblem.placeProText = value
             // console.log(this.formDataProblem)
             createPlacePro(this.formDataProblem).then((res) => {
               this.$message({
-                type: "success",
+                type: 'success',
                 message: res.msg,
-              });
-            });
+              })
+            })
           }
         })
         .catch(() => {
           this.$message({
-            type: "info",
-            message: "取消输入",
-          });
-        });
+            type: 'info',
+            message: '取消输入',
+          })
+        })
     },
 
     // 问题管理
     async ProblemList(row) {
       // console.log(row)
-      this.dialogProblemVisible = true;
+      this.dialogProblemVisible = true
       this.currentID = this.currentID == 0 ? row.ID : this.currentID
-      let res = await findPlace({ ID: this.currentID });
+      const res = await findPlace({ ID: this.currentID })
       if (res.code == 0) {
-        this.problemData = res.data.replace.proList;
+        this.problemData = res.data.replace.proList
       }
     },
 
     // 修改更新问题
     async updateProblem(row) {
       console.log(row)
-      this.$prompt("请修改站点问题", "提示", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
+      this.$prompt('请修改站点问题', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
         inputValue: row.placeProText
-      }).then( async(value) => {
+      }).then(async(value) => {
         console.log(value)
-        if (value == "" || value == null) {
+        if (value == '' || value == null) {
+          this.$message({
+            type: 'error',
+            message: '你的问题不能为空',
+          })
+        } else {
+          this.formDataProblem.ID = row.ID
+          this.formDataProblem.placeId = row.placeId
+          this.formDataProblem.placeProText = value.value
+          // console.log(this.formDataProblem)
+
+          // console.log(this.formDataProblem)
+          const res = await updatePlacePro(this.formDataProblem)
+          if (res.code == 0) {
             this.$message({
-              type: "error",
-              message: "你的问题不能为空",
-            });
-          } else {
-            this.formDataProblem.ID = row.ID
-            this.formDataProblem.placeId = row.placeId;
-            this.formDataProblem.placeProText = value.value;
-            // console.log(this.formDataProblem)
-            
-            // console.log(this.formDataProblem)
-            let res = await updatePlacePro(this.formDataProblem)
-            if( res.code == 0 ) {
-              this.$message({
-                type: "success",
-                message: res.msg,
-              });  
-              this.ProblemList()
-            }
-              
-         
+              type: 'success',
+              message: res.msg,
+            })
+            this.ProblemList()
           }
-        })
+        }
+      })
         .catch(() => {
           this.$message({
-            type: "info",
-            message: "取消输入",
-          });
-      })
+            type: 'info',
+            message: '取消输入',
+          })
+        })
     },
 
     // 删除问题
     async deleteProblem(row) {
-      this.$confirm("确定要删除吗?", "提示", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-      }).then(async () => {
-        let res = await deletePlacePro({ ID: row.ID });
-        
+      this.$confirm('确定要删除吗?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning',
+      }).then(async() => {
+        const res = await deletePlacePro({ ID: row.ID })
+
         if (res.code === 0) {
           this.$message({
-            type: "success",
-            message: "删除成功",
-          });
-        this.ProblemList()  
-          
+            type: 'success',
+            message: '删除成功',
+          })
+          this.ProblemList()
         }
-      });
+      })
     },
 
-    //区域更改
+    // 区域更改
     changeArea(value) {
       console.log(value[0])
       this.formData.organCode = value[0]
     }
   },
-};
+}
 </script>
 
 <style>

+ 1 - 1
web/src/view/problemInfo/proInfo.vue

@@ -15,7 +15,7 @@
             <el-tag v-show="formData.status == 'Processed'" type="success">已处理</el-tag>
           </el-descriptions-item>
           <el-descriptions-item label="责任部门">{{ formData.department }}</el-descriptions-item>
-          <el-descriptions-item label="一类单位">{{ formData.unitName }}</el-descriptions-item>
+          <el-descriptions-item label="一类部门">{{ formData.unitName }}</el-descriptions-item>
           <el-descriptions-item label="扣评分">{{ formData.integral/10 }}</el-descriptions-item>
           <el-descriptions-item span="2" label="问题备注">{{ formData.remark }}</el-descriptions-item>
         </el-descriptions>

+ 70 - 36
web/src/view/problemInfo/problemInfo.vue

@@ -53,14 +53,16 @@
         </template>
       </el-table-column>
       <el-table-column label="已登录查阅次数" prop="count" />
-      <el-table-column label="一类单位" prop="unitName" />
+      <el-table-column label="一类部门" prop="unitName" />
       <el-table-column label="扣评分" prop="integral">
         <template #default="scope">{{ scope.row.integral/10 }}</template>
       </el-table-column>
       <el-table-column label="处理状态" prop="status">
         <template #default="scope">
           <el-tag v-show="scope.row.status == 'Untreated'" type="warning">未处理</el-tag>
-          <el-tag v-show="scope.row.status == 'Processed'" type="success">已处理</el-tag>
+          <el-tag v-show="scope.row.status == 'Processed'" type="warning" effect="dark">已处理待审核</el-tag>
+          <el-tag v-show="scope.row.status == 'Success'" type="success" effect="dark">审核通过</el-tag>
+          <el-tag v-show="scope.row.status == 'Error'" type="error" effect="dark">已审核未通过</el-tag>
         </template>
       </el-table-column>
       <el-table-column label="责任部门" prop="department" />
@@ -70,13 +72,14 @@
             size="small"
             type="primary"
             class="table-button"
-            @click="updateProblemInfo(scope.row)"
+            @click="updateProblemInfo(scope.row,false)"
           >查看详情
           </el-button>
           <el-button type="danger" icon="el-icon-delete" size="mini" @click="deleteRow(scope.row)">删除</el-button>
           <el-button type="small" icon="el-icon-download" size="mini" @click="handlePdf(scope.row)">导出为pdf</el-button>
           <el-button type="small" icon="el-icon-s-comment" size="mini" @click="openUser(scope.row)">发送公众号通知</el-button>
           <el-button type="small" icon="el-icon-user" size="mini" @click="showReadInfo(scope.row)">已查阅详情</el-button>
+          <el-button v-if="scope.row.status=='Processed'" type="warning" size="mini" @click="updateProblemInfo(scope.row,true)">待审核</el-button>
         </template>
       </el-table-column>
     </el-table>
@@ -131,7 +134,7 @@
         <el-button type="primary" @click="closeRead">确 定</el-button>
       </div>
     </el-dialog>
-    <el-dialog id="problemInfo" ref="problemInfo" v-model="dialogFormVisible" :before-close="closeDialog" title="问题详情">
+    <el-dialog id="problemInfo" ref="problemInfo" v-model="dialogFormVisible" :before-close="closeDialog" :title="isAudit?'审核':'问题详情'">
       <el-form :model="formData" label-position="right" label-width="80px">
         <el-card class="box-card">
           <el-descriptions title="基本信息" border :column="2">
@@ -141,35 +144,40 @@
             <el-descriptions-item label="站点类型"><dict-tag :options="dict.type.site_type" :value="formData.siteType " /></el-descriptions-item>
             <el-descriptions-item label="处理状态">
               <el-tag v-show="formData.status == 'Untreated'" type="warning">未处理</el-tag>
-              <el-tag v-show="formData.status == 'Processed'" type="success">已处理</el-tag>
+              <el-tag v-show="formData.status == 'Processed'" type="warning" effect="dark">已处理待审核</el-tag>
+              <el-tag v-show="formData.status == 'Success'" type="success" effect="dark">审核通过</el-tag>
+              <el-tag v-show="formData.status == 'Error'" type="error" effect="dark">已审核未通过</el-tag>
             </el-descriptions-item>
             <el-descriptions-item label="责任部门">{{ formData.department }}</el-descriptions-item>
-            <el-descriptions-item label="一类单位">{{ formData.unitName }}</el-descriptions-item>
+            <el-descriptions-item label="处理时限" prop="HandAt">
+              <template #default="scope">{{ formatDate(formData.HandAt) }}</template>
+            </el-descriptions-item>
+            <el-descriptions-item label="一类部门">{{ formData.unitName }}</el-descriptions-item>
             <el-descriptions-item label="扣评分">{{ formData.integral/10 }}</el-descriptions-item>
             <el-descriptions-item span="2" label="问题备注">{{ formData.remark }}</el-descriptions-item>
           </el-descriptions>
         </el-card>
-        <el-card class="box-card" v-show="replyList.length>0">
+        <el-card v-show="replyList.length>0" class="box-card">
           <div class="el-descriptions__header el-descriptions__title">问题批示</div>
-            <el-table border stripe :data="replyList" style="width: 100%">
-              <el-table-column label="头像" prop="headerImg" >
-                <template #default="scope">
-                  <div :style="{'textAlign':'center'}">
-                    <CustomPic :pic-src="scope.row.headerImg" />
-                  </div>
-                </template>
-              </el-table-column>
-              <el-table-column label="昵称" prop="nickName" />
-              <el-table-column label="批示内容" prop="replyMsg" />
-              <el-table-column label="批示时间" prop="CreatedAt" >
-                <template #default="scope">{{ formatDate(scope.row.CreatedAt) }}</template>
-              </el-table-column>
-              <el-table-column>
-                <template #default="scope">
-                  <el-button type="danger" icon="el-icon-delete" size="mini" @click="deleteReplyRow(scope.row)">删除</el-button>
-                </template>
-              </el-table-column>
-            </el-table>
+          <el-table border stripe :data="replyList" style="width: 100%">
+            <el-table-column label="头像" prop="headerImg">
+              <template #default="scope">
+                <div :style="{'textAlign':'center'}">
+                  <CustomPic :pic-src="scope.row.headerImg" />
+                </div>
+              </template>
+            </el-table-column>
+            <el-table-column label="昵称" prop="nickName" />
+            <el-table-column label="批示内容" prop="replyMsg" />
+            <el-table-column label="批示时间" prop="CreatedAt">
+              <template #default="scope">{{ formatDate(scope.row.CreatedAt) }}</template>
+            </el-table-column>
+            <el-table-column>
+              <template #default="scope">
+                <el-button type="danger" icon="el-icon-delete" size="mini" @click="deleteReplyRow(scope.row)">删除</el-button>
+              </template>
+            </el-table-column>
+          </el-table>
         </el-card>
         <el-card class="box-card">
           <el-descriptions title="问题列表" :column="1" direction="vertical">
@@ -206,7 +214,7 @@
           <el-descriptions title="处理结果" :column="1" border direction="vertical">
             <el-descriptions-item label="处理人">{{ formData.handler }}</el-descriptions-item>
             <el-descriptions-item label="处理内容">{{ formData.handText }}</el-descriptions-item>
-            <el-descriptions-item label="处理图片(点击图片查看更多)">
+            <el-descriptions-item label="处理图片(点击图片查看更多)" content-class-name="audit">
               <el-image
                 style="width: 260px; height: 240px"
                 :src="(formData.handImgList.length>0?formData.handImgList[0]:'')"
@@ -215,6 +223,21 @@
             </el-descriptions-item>
           </el-descriptions>
         </el-card>
+        <el-card v-show="formData.remark1||isAudit" class="box-card">
+          <el-descriptions title="审核" border column="1">
+            <el-descriptions-item v-if="isAudit">
+              <el-button type="success" @click="auditUpdate(true)">审核通过</el-button>
+              <el-button type="danger" :disabled="!(formData.remark1!=null&&formData.remark1.length>0)" @click="auditUpdate(false)">审核不通过</el-button>
+            </el-descriptions-item>
+            <el-descriptions-item label="审核不通过原因"><el-input
+              v-model="formData.remark1"
+              :readonly="!isAudit"
+              type="textarea"
+              :autosize="{ minRows: 3, maxRows: 5}"
+              placeholder="请输入审核不通过理由"
+            /></el-descriptions-item>
+          </el-descriptions>
+        </el-card>
       </el-form>
     </el-dialog>
   </div>
@@ -228,7 +251,7 @@ import {
   updateProblemInfo,
   findProblemInfo,
   getProblemInfoList,
-  exportExcel, sendUserProblemInfo, getReadCountList
+  exportExcel, sendUserProblemInfo, getReadCountList, updateProblemInfoAudit
 } from '@/api/problemInfo' //  此处请自行替换地址
 import {
   deleteProblemReply,
@@ -241,8 +264,8 @@ import { getUserPList } from '@/api/user'
 
 export default {
   name: 'ProblemInfo',
-  mixins: [infoList],
   components: { CustomPic },
+  mixins: [infoList],
   dicts: ['site_type'],
   data() {
     return {
@@ -257,6 +280,7 @@ export default {
       noticeUser: {
         userList: []
       },
+      isAudit: false,
       sendId: 0,
       deleteVisible: false,
       multipleSelection: [],
@@ -268,11 +292,13 @@ export default {
         imgs: '',
         imgList: [],
         handImgList: [],
+        HandAt: '',
         video: '',
         siteId: 0,
         position: '',
         matter: '',
         siteType: '',
+        remark1: '',
         remark: '',
         status: '',
         handImgs: '',
@@ -307,15 +333,15 @@ export default {
         this.deleteProblemInfo(row)
       })
     },
-    deleteReplyRow(row){
+    deleteReplyRow(row) {
       this.$confirm('确定要删除吗?', '提示', {
         confirmButtonText: '确定',
         cancelButtonText: '取消',
         type: 'warning'
       }).then(() => {
-        deleteProblemReply({ID:row.ID}).then(res=>{
+        deleteProblemReply({ ID: row.ID }).then(res => {
           this.closeDialog()
-          this.updateProblemInfo({ID:row.problemId})
+          this.updateProblemInfo({ ID: row.problemId })
         })
       })
     },
@@ -384,13 +410,21 @@ export default {
         this.getTableData()
       }
     },
-    async updateProblemInfo(row) {
+    auditUpdate(isAudit) {
+      updateProblemInfoAudit({ ID: this.formData.ID, status: (isAudit ? 'Success' : 'Error'), remark1: this.formData.remark1 }).then(res => {
+        console.log(res)
+        this.isAudit = false
+        this.closeDialog()
+        this.getTableData()
+      })
+    },
+    async updateProblemInfo(row, isAudit) {
       const res = await findProblemInfo({ ID: row.ID })
       this.type = 'update'
+      this.isAudit = isAudit
       if (res.code === 0) {
-        await getProblemReplyList({page: 1, pageSize: 9999, problemId: row.ID }).then(res=>{
-          this.replyList=res.data.list
-          console.log(this.replyList)
+        await getProblemReplyList({ page: 1, pageSize: 9999, problemId: row.ID }).then(res => {
+          this.replyList = res.data.list
         })
         this.formData = res.data.reproblemInfo
         if (this.formData.imgs.length > 0) {

+ 38 - 3
web/src/view/problemType/problemType.vue

@@ -49,12 +49,12 @@
       <el-table-column label="问题" prop="problem" />
       <el-table-column label="分数" prop="integral">
         <template #default="scope">
-          {{ scope.row.integral/10 }}
+          {{ scope.row.integral/100 }}
         </template>
       </el-table-column>
       <el-table-column label="按钮组">
         <template #default="scope">
-          <!--          <el-button size="small" type="primary" icon="el-icon-edit" class="table-button" @click="updateProblemType(scope.row)">变更</el-button>-->
+          <el-button size="small" type="primary" icon="el-icon-edit" class="table-button" @click="updateProblemType(scope.row)">变更</el-button>
           <el-button type="danger" icon="el-icon-delete" size="mini" @click="deleteRow(scope.row)">删除</el-button>
         </template>
       </el-table-column>
@@ -91,7 +91,24 @@
           <el-input v-model="formData.problem" clearable placeholder="请输入" />
         </el-form-item>
         <el-form-item label="分数:">
-          <el-input v-model.number="formData.integral" clearable placeholder="请输入" />
+          <el-input v-model="formData.integral" clearable placeholder="请输入" />
+        </el-form-item>
+        <el-form-item label="责任部门">
+          <el-select
+            v-model="formData.unitId"
+            filterable
+            clearable
+            multiple
+            size="small"
+            style="width: 240px"
+          >
+            <el-option
+              v-for="id in Object.keys(units)"
+              :key="id"
+              :label="units[id]"
+              :value="id"
+            />
+          </el-select>
         </el-form-item>
       </el-form>
       <template #footer>
@@ -114,6 +131,7 @@ import {
   getProblemTypeList
 } from '@/api/problemType' //  此处请自行替换地址
 import infoList from '@/mixins/infoList'
+import { getUnitList } from '@/api/unit'
 export default {
   name: 'ProblemType',
   dicts: ['site_type'],
@@ -123,10 +141,13 @@ export default {
       listApi: getProblemTypeList,
       dialogFormVisible: false,
       type: '',
+      units: {},
       deleteVisible: false,
       multipleSelection: [],
       formData: {
         siteType: null,
+        unitIds: '',
+        unitId: [],
         problem: '',
         integral: 0,
       }
@@ -134,6 +155,7 @@ export default {
   },
   async created() {
     await this.getTableData()
+    this.unitLists()
   },
   methods: {
   // 条件搜索前端看此方法
@@ -145,6 +167,13 @@ export default {
     handleSelectionChange(val) {
       this.multipleSelection = val
     },
+    unitLists() {
+      getUnitList({ page: 1, pageSize: 9999 }).then(res => {
+        for (const unit in res.data.list) {
+          this.units[res.data.list[unit].ID] = res.data.list[unit].unitName
+        }
+      })
+    },
     deleteRow(row) {
       this.$confirm('确定要删除吗?', '提示', {
         confirmButtonText: '确定',
@@ -185,6 +214,10 @@ export default {
       this.type = 'update'
       if (res.code === 0) {
         this.formData = res.data.reproblemType
+        if (this.formData.unitIds) {
+          this.formData.unitId = this.formData.unitIds.split('|')
+        }
+        this.formData.integral = this.formData.integral / 100
         this.dialogFormVisible = true
       }
     },
@@ -211,6 +244,8 @@ export default {
     },
     async enterDialog() {
       let res
+      this.formData.integral = this.formData.integral * 100
+      this.formData.unitIds = this.formData.unitId.join('|')
       switch (this.type) {
         case 'create':
           res = await createProblemType(this.formData)

+ 45 - 45
web/src/view/superAdmin/dictionary/department.vue

@@ -2,48 +2,48 @@
   <div>
     <div class="search-term">
       <el-form :inline="true" :model="searchInfo" class="demo-form-inline">
-        <el-form-item label="部门名称">
-          <el-input v-model="searchInfo.label" placeholder="搜索条件"/>
+        <el-form-item label="部门类型">
+          <el-input v-model="searchInfo.label" placeholder="搜索条件" />
         </el-form-item>
-        <el-form-item label="部门编号">
-          <el-input v-model="searchInfo.value" placeholder="搜索条件"/>
+        <el-form-item label="部门类型编号">
+          <el-input v-model="searchInfo.value" placeholder="搜索条件" />
         </el-form-item>
         <el-form-item label="启用状态" prop="status">
           <el-select v-model="searchInfo.status" placeholder="请选择">
-            <el-option key="true" label="是" value="true"/>
-            <el-option key="false" label="否" value="false"/>
+            <el-option key="true" label="是" value="true" />
+            <el-option key="false" label="否" value="false" />
           </el-select>
         </el-form-item>
         <el-form-item>
           <el-button size="mini" type="primary" icon="el-icon-search" @click="onSubmit">查询</el-button>
         </el-form-item>
         <el-form-item>
-          <el-button size="mini" type="primary" icon="el-icon-plus" @click="openDialog">新增部门</el-button>
+          <el-button size="mini" type="primary" icon="el-icon-plus" @click="openDialog">新增部门类型</el-button>
         </el-form-item>
       </el-form>
     </div>
     <el-table
-        ref="multipleTable"
-        :data="tableData"
-        border
-        stripe
-        style="width: 100%"
-        tooltip-effect="dark"
+      ref="multipleTable"
+      :data="tableData"
+      border
+      stripe
+      style="width: 100%"
+      tooltip-effect="dark"
     >
-      <el-table-column type="selection" width="55"/>
+      <el-table-column type="selection" width="55" />
       <el-table-column label="日期" width="180">
         <template #default="scope">{{ formatDate(scope.row.CreatedAt) }}</template>
       </el-table-column>
 
-      <el-table-column label="部门名称" prop="label" width="120"/>
+      <el-table-column label="部门类型" prop="label" width="120" />
 
-      <el-table-column label="部门编号" prop="value" width="120"/>
+      <el-table-column label="部门类型编号" prop="value" width="120" />
 
       <el-table-column label="启用状态" prop="status" width="120">
         <template #default="scope">{{ formatBoolean(scope.row.status) }}</template>
       </el-table-column>
 
-      <el-table-column label="排序标记" prop="sort" width="120"/>
+      <el-table-column label="排序标记" prop="sort" width="120" />
 
       <el-table-column label="操作">
         <template #default="scope">
@@ -63,41 +63,41 @@
     </el-table>
 
     <el-pagination
-        :current-page="page"
-        :page-size="pageSize"
-        :page-sizes="[10, 30, 50, 100]"
-        :style="{float:'right',padding:'20px'}"
-        :total="total"
-        layout="total, sizes, prev, pager, next, jumper"
-        @current-change="handleCurrentChange"
-        @size-change="handleSizeChange"
+      :current-page="page"
+      :page-size="pageSize"
+      :page-sizes="[10, 30, 50, 100]"
+      :style="{float:'right',padding:'20px'}"
+      :total="total"
+      layout="total, sizes, prev, pager, next, jumper"
+      @current-change="handleCurrentChange"
+      @size-change="handleSizeChange"
     />
 
     <el-dialog v-model="dialogFormVisible" :before-close="closeDialog" title="弹窗操作">
       <el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="110px">
-        <el-form-item label="部门名称" prop="label">
+        <el-form-item label="部门类型" prop="label">
           <el-input
-              v-model="formData.label"
-              placeholder="请输入部门名称"
-              clearable
-              :style="{width: '100%'}"
+            v-model="formData.label"
+            placeholder="请输入部门类型"
+            clearable
+            :style="{width: '100%'}"
           />
         </el-form-item>
-        <el-form-item label="部门编号" prop="value">
+        <el-form-item label="部门类型编号" prop="value">
           <el-input-number
-              v-model.number="formData.value"
-              step-strictly
-              :step="1"
-              placeholder="请输入部门编号"
-              clearable
-              :style="{width: '100%'}"
+            v-model.number="formData.value"
+            step-strictly
+            :step="1"
+            placeholder="请输入部门类型编号"
+            clearable
+            :style="{width: '100%'}"
           />
         </el-form-item>
         <el-form-item label="启用状态" prop="status" required>
-          <el-switch v-model="formData.status" active-text="开启" inactive-text="停用"/>
+          <el-switch v-model="formData.status" active-text="开启" inactive-text="停用" />
         </el-form-item>
         <el-form-item label="部门排序" prop="sort">
-          <el-input-number v-model.number="formData.sort" placeholder="排序标记"/>
+          <el-input-number v-model.number="formData.sort" placeholder="排序标记" />
         </el-form-item>
       </el-form>
       <template #footer>
@@ -133,7 +133,7 @@ export default {
         value: null,
         status: true,
         sort: null,
-        sysDictionaryID: 7
+        sysDictionaryID: 38
       },
       rules: {
         label: [
@@ -161,7 +161,7 @@ export default {
     }
   },
   created() {
-    this.searchInfo.sysDictionaryID = 7 // Number(this.$route.params.id)
+    this.searchInfo.sysDictionaryID = 38 // Number(this.$route.params.id)
     this.getTableData()
   },
   methods: {
@@ -175,7 +175,7 @@ export default {
       this.getTableData()
     },
     async updateSysDictionaryDetail(row) {
-      const res = await findSysDictionaryDetail({ID: row.ID})
+      const res = await findSysDictionaryDetail({ ID: row.ID })
       this.type = 'update'
       if (res.code === 0) {
         this.formData = res.data.resysDictionaryDetail
@@ -189,12 +189,12 @@ export default {
         value: null,
         status: true,
         sort: null,
-        sysDictionaryID: 7
+        sysDictionaryID: 38
       }
     },
     async deleteSysDictionaryDetail(row) {
       row.visible = false
-      const res = await deleteSysDictionaryDetail({ID: row.ID})
+      const res = await deleteSysDictionaryDetail({ ID: row.ID })
       if (res.code === 0) {
         this.$message({
           type: 'success',
@@ -207,7 +207,7 @@ export default {
       }
     },
     async enterDialog() {
-      this.formData.sysDictionaryID = 7
+      this.formData.sysDictionaryID = 38
       this.$refs['elForm'].validate(async valid => {
         if (!valid) return
         let res

+ 159 - 19
web/src/view/unit/unit.vue

@@ -2,13 +2,23 @@
   <div>
     <div class="search-term">
       <el-form :inline="true" :model="searchInfo" class="demo-form-inline">
-        <el-form-item label="单位名称">
-          <el-input v-model="searchInfo.unitName" clearable placeholder="请输入单位名称" />
+        <el-form-item label="部门名称">
+          <el-input v-model="searchInfo.unitName" clearable placeholder="请输入部门名称" />
+        </el-form-item>
+        <el-form-item label="部门类型">
+          <el-select v-model="searchInfo.remark" clearable placeholder="请选择">
+            <el-option
+              v-for="dict in dict.type.department_type"
+              :key="dict.value"
+              :label="dict.label"
+              :value="dict.label"
+            />
+          </el-select>
         </el-form-item>
         <el-form-item>
           <el-button size="mini" type="primary" icon="el-icon-search" @click="onSubmit">查询</el-button>
-          <el-button size="mini" type="primary" icon="el-icon-plus" @click="openDialog">新增一类单位</el-button>
-          <el-button size="mini" type="primary" icon="el-icon-plus" @click="updateUnit">重新开始下期</el-button>
+          <el-button size="mini" type="primary" icon="el-icon-plus" @click="openDialog">新增部门</el-button>
+          <!--          <el-button size="mini" type="primary" icon="el-icon-plus" @click="updateUnit">重新开始下期</el-button>-->
           <el-popover v-model:visible="deleteVisible" placement="top" width="160">
             <p>确定要删除吗?</p>
             <div style="text-align: right; margin: 0">
@@ -35,20 +45,26 @@
       <!--      <el-table-column label="日期" width="180">-->
       <!--        <template #default="scope">{{ formatDate(scope.row.CreatedAt) }}</template>-->
       <!--      </el-table-column>-->
-      <el-table-column label="单位名称" prop="unitName" />
-      <el-table-column label="满分" prop="unitIntegral">
-        <template #default="scope">{{ scope.row.unitMaxIntegral/10 }}</template>
+      <el-table-column label="部门名称" prop="unitName" />
+      <el-table-column label="部门类型" prop="remark" />
+      <el-table-column label="满分">
+        <template #default="scope">{{ scope.row.unitMaxIntegral/100 }}</template>
+      </el-table-column>
+      <el-table-column label="扣分">
+        <template #default="scope">{{ scope.row.unitIntegral/100 }}</template>
       </el-table-column>
-      <el-table-column label="扣分" prop="unitIntegral">
-        <template #default="scope">{{ (scope.row.unitMaxIntegral-scope.row.unitIntegral)/10 }}</template>
+      <el-table-column label="得分">
+        <template #default="scope">{{ (scope.row.unitMaxIntegral-scope.row.unitIntegral)/100 }}</template>
       </el-table-column>
-      <el-table-column label="得分" prop="unitIntegral">
-        <template #default="scope">{{ scope.row.unitIntegral/10 }}</template>
+      <el-table-column label="得分">
+        <template #default="scope">{{ ((scope.row.unitMaxIntegral-scope.row.unitIntegral)/scope.row.unitMaxIntegral).toFixed(4)*100 }} %</template>
       </el-table-column>
       <el-table-column label="按钮组">
         <template #default="scope">
-          <el-button size="small" type="primary" icon="el-icon-edit" @click="openProDialog(scope.row)">详情</el-button>
+          <el-button size="small" type="primary" icon="el-icon-edit" class="table-button" @click="updateUnit(scope.row)">变更</el-button>
           <el-button type="danger" icon="el-icon-delete" size="mini" @click="deleteRow(scope.row)">删除</el-button>
+          <el-button size="small" type="primary" icon="el-icon-edit" @click="selecrUser(scope.row)">负责人管理</el-button>
+          <el-button size="small" type="primary" icon="el-icon-edit" @click="selectPlace(scope.row)">添加考察点位</el-button>
         </template>
       </el-table-column>
     </el-table>
@@ -63,13 +79,50 @@
       @size-change="handleSizeChange"
     />
 
+    <el-dialog v-model="noticeList" title="选择负责人" width="500px" append-to-body>
+      <el-form v-model="bindUser" label-width="120px">
+        <el-row>
+          <el-col :span="24">
+            <el-form-item label="部门负责人" :rules="{required: true, message: '请选择部门负责人'}">
+              <el-select
+                v-model="bindUser.userList"
+                filterable
+                clearable
+                multiple
+                size="small"
+                style="width: 240px"
+              >
+                <el-option
+                  v-for="id in Object.keys(userIds)"
+                  :key="id"
+                  :label="userIds[id]"
+                  :value="id"
+                />
+              </el-select>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="saveUser">确 定</el-button>
+        <el-button @click="closeSend">取 消</el-button>
+      </div>
+    </el-dialog>
+
     <el-dialog v-model="dialogFormVisible" :before-close="closeDialog" title="弹窗操作">
       <el-form :model="formData" label-position="right" label-width="80px">
-        <el-form-item v-show="type=='create'" label="单位名称:">
+        <el-form-item label="部门名称:">
           <el-input v-model="formData.unitName" clearable placeholder="请输入" />
         </el-form-item>
-        <el-form-item v-show="type=='update'" label="开始积分:">
-          <el-input v-model.number="formData.unitIntegral" clearable placeholder="请输入开始积分" />
+        <el-form-item label="部门类型:">
+          <el-select v-model="formData.remark" clearable placeholder="请选择">
+            <el-option
+              v-for="dict in dict.type.department_type"
+              :key="dict.label"
+              :label="dict.label"
+              :value="dict.label"
+            />
+          </el-select>
         </el-form-item>
       </el-form>
       <template #footer>
@@ -79,6 +132,32 @@
         </div>
       </template>
     </el-dialog>
+    <el-dialog v-model="placesVisible" :before-close="closePlace" title="管理部门点位">
+      <el-form :model="placesForm" label-position="right" label-width="80px">
+        <el-form-item label="评分站点:">
+          <el-select
+            v-model="placesForm.placesId"
+            filterable
+            clearable
+            multiple
+            placeholder="请选择"
+          >
+            <el-option
+              v-for="id in Object.keys(places)"
+              :key="id"
+              :label="places[id]"
+              :value="id"
+            />
+          </el-select>
+        </el-form-item>
+      </el-form>
+      <template #footer>
+        <div class="dialog-footer">
+          <el-button @click="closePlace">取 消</el-button>
+          <el-button type="primary" @click="enterDialogPlace">确 定</el-button>
+        </div>
+      </template>
+    </el-dialog>
 
     <el-dialog v-model="dialogFormVisiblePro" :before-close="closeDialogPro" title="扣分详情">
       <div>
@@ -111,7 +190,7 @@
             </template>
           </el-table-column>
           <el-table-column label="已登录查阅次数" prop="count" />
-          <el-table-column label="一类单位" prop="unitName" />
+          <el-table-column label="一类部门" prop="unitName" />
           <el-table-column label="扣评分" prop="integral">
             <template #default="scope">{{ scope.row.integral/10 }}</template>
           </el-table-column>
@@ -134,19 +213,31 @@ import {
   deleteUnit,
   deleteUnitByIds,
   updateUnit,
-  getUnitList
+  getUnitList, findUnit
 } from '@/api/unit' //  此处请自行替换地址
 import infoList from '@/mixins/infoList'
 import { getProblemInfoList } from '@/api/problemInfo'
+import { getUserPList } from '@/api/user'
+import { updateUnitUser, getUnitUserList } from '@/api/unitUser'
+import { getPlaceList } from '@/api/place'
+import { getUnitPlaceList, updateUnitPlace } from '@/api/unitPlace'
 export default {
   name: 'Unit',
-  dicts: ['site_type'],
+  dicts: ['department_type'],
   mixins: [infoList],
   data() {
     return {
       listApi: getUnitList,
       listProApi: getProblemInfoList,
       dialogFormVisible: false,
+      noticeList: false,
+      userIds: {},
+      placesVisible: false,
+      places: {},
+      placesForm: {
+        placesId: [],
+        unitId: '',
+      },
       type: '',
       deleteVisible: false,
       multipleSelection: [],
@@ -155,6 +246,8 @@ export default {
       pagePro: 1,
       totalPro: 10,
       pageSizePro: 10,
+      bindUser: {
+      },
       searchInfoPro: {
         CreatedAtStart: new Date(),
         CreatedAtEnd: new Date()
@@ -167,6 +260,11 @@ export default {
   },
   async created() {
     await this.getTableData()
+    getPlaceList({ page: 1, pageSize: 9999 }).then(res => {
+      for (const place in res.data.list) {
+        this.places[res.data.list[place].ID] = res.data.list[place].name
+      }
+    })
   },
   methods: {
   // 条件搜索前端看此方法
@@ -213,8 +311,50 @@ export default {
         this.getTableData()
       }
     },
+    selectPlace(row) {
+      this.unitId = row.ID
+      getUnitPlaceList({ unitId: this.unitId }).then(res => {
+        this.placesForm.placesId = res.data.list.map(item => item.placeId)
+        this.placesVisible = true
+      })
+    },
+    enterDialogPlace() {
+      updateUnitPlace({ unitId: this.unitId, placeIds: this.placesForm.placesId }).then(res => {
+        this.closePlace()
+      })
+    },
+    closePlace() {
+      this.placesForm = { placesId: [],
+        unitId: '' }
+      this.unitId = ''
+      this.placesVisible = false
+    },
+    async selecrUser(row) {
+      this.unitId = row.ID
+      this.noticeList = true
+      getUnitUserList({ unitId: this.unitId }).then(res => {
+        this.bindUser.userList = res.data
+      })
+      getUserPList({ page: 1, pageSize: 9999 }).then(res => {
+        for (const user in res.data.list) {
+          this.userIds[res.data.list[user].uuid] = res.data.list[user].userName
+        }
+      })
+    },
+    closeSend() {
+      this.noticeList = false
+      this.userIds = {}
+      this.bindUser.userList = []
+      this.unitId = ''
+    },
+    saveUser() {
+      updateUnitUser({ unitId: this.unitId, uuid: this.bindUser.userList }).then(res => {
+        this.closeSend()
+      })
+    },
     async updateUnit(row) {
-      // const res = await findUnit({ ID: row.ID })
+      const res = await findUnit({ ID: row.ID })
+      this.formData = res.data.reunit
       this.type = 'update'
       this.dialogFormVisible = true
     },

+ 1 - 1
web/src/view/unit/unitForm.vue

@@ -1,7 +1,7 @@
 <template>
   <div>
     <el-form :model="formData" label-position="right" label-width="80px">
-      <el-form-item label="单位名称:">
+      <el-form-item label="部门名称:">
         <el-input v-model="formData.unitName" clearable placeholder="请输入" />
       </el-form-item>
       <el-form-item label="现有积分:">

+ 7 - 7
web/src/view/unitHistory/unitHistory.vue

@@ -2,8 +2,8 @@
   <div>
     <div class="search-term">
       <el-form :inline="true" :model="searchInfo" class="demo-form-inline">
-        <el-form-item label="单位名称">
-          <el-input v-model="searchInfo.unitName" clearable placeholder="请输入单位名称" />
+        <el-form-item label="部门名称">
+          <el-input v-model="searchInfo.unitName" clearable placeholder="请输入部门名称" />
         </el-form-item>
         <el-form-item label="期编号">
           <el-input v-model="searchInfo.period" clearable placeholder="请输入期编号" />
@@ -37,8 +37,8 @@
         <template #default="scope">{{ formatDate(scope.row.CreatedAt) }}</template>
       </el-table-column>
       <el-table-column label="期编号" prop="period" />
-      <!--      <el-table-column label="单位id" prop="unitId" />-->
-      <el-table-column label="单位名称" prop="unitName" />
+      <!--      <el-table-column label="部门id" prop="unitId" />-->
+      <el-table-column label="部门名称" prop="unitName" />
       <el-table-column label="满分" prop="unitIntegral">
         <template #default="scope">{{ scope.row.unitMaxIntegral/10 }}</template>
       </el-table-column>
@@ -68,7 +68,7 @@
     />
     <el-dialog v-model="dialogFormVisible" :before-close="closeDialog" title="弹窗操作">
       <el-form :model="formData" label-position="right" label-width="80px">
-        <el-form-item label="单位名称:">
+        <el-form-item label="部门名称:">
           <el-input v-model="formData.unitName" clearable placeholder="请输入" />
         </el-form-item>
         <el-form-item label="现有积分:">
@@ -80,7 +80,7 @@
         <el-form-item label="期编号:">
           <el-input v-model="formData.period" clearable placeholder="请输入" />
         </el-form-item>
-        <el-form-item label="单位id:">
+        <el-form-item label="部门id:">
           <el-input v-model.number="formData.unitId" clearable placeholder="请输入" />
         </el-form-item>
         <el-form-item label="关联问题id:">
@@ -126,7 +126,7 @@
             </template>
           </el-table-column>
           <el-table-column label="已登录查阅次数" prop="count" />
-          <el-table-column label="一类单位" prop="unitName" />
+          <el-table-column label="一类部门" prop="unitName" />
           <el-table-column label="扣评分" prop="integral">
             <template #default="scope">{{ scope.row.integral/10 }}</template>
           </el-table-column>

+ 2 - 2
web/src/view/unitHistory/unitHistoryForm.vue

@@ -1,7 +1,7 @@
 <template>
   <div>
     <el-form :model="formData" label-position="right" label-width="80px">
-      <el-form-item label="单位名称:">
+      <el-form-item label="部门名称:">
         <el-input v-model="formData.unitName" clearable placeholder="请输入" />
       </el-form-item>
       <el-form-item label="现有积分:">
@@ -13,7 +13,7 @@
       <el-form-item label="期编号:">
         <el-input v-model="formData.period" clearable placeholder="请输入" />
       </el-form-item>
-      <el-form-item label="单位id:">
+      <el-form-item label="部门id:">
         <el-input v-model.number="formData.unitId" clearable placeholder="请输入" />
       </el-form-item>
       <el-form-item label="关联问题id:">

+ 205 - 0
web/src/view/unitPlace/unitPlace.vue

@@ -0,0 +1,205 @@
+<template>
+  <div>
+    <div class="search-term">
+      <el-form :inline="true" :model="searchInfo" class="demo-form-inline">
+        <el-form-item>
+          <el-button size="mini" type="primary" icon="el-icon-search" @click="onSubmit">查询</el-button>
+          <el-button size="mini" type="primary" icon="el-icon-plus" @click="openDialog">新增</el-button>
+          <el-popover v-model:visible="deleteVisible" placement="top" width="160">
+            <p>确定要删除吗?</p>
+            <div style="text-align: right; margin: 0">
+              <el-button size="mini" type="text" @click="deleteVisible = false">取消</el-button>
+              <el-button size="mini" type="primary" @click="onDelete">确定</el-button>
+            </div>
+            <template #reference>
+              <el-button icon="el-icon-delete" size="mini" type="danger" style="margin-left: 10px;">批量删除</el-button>
+            </template>
+          </el-popover>
+        </el-form-item>
+      </el-form>
+    </div>
+    <el-table
+      ref="multipleTable"
+      border
+      stripe
+      style="width: 100%"
+      tooltip-effect="dark"
+      :data="tableData"
+      @selection-change="handleSelectionChange"
+    >
+      <el-table-column type="selection" width="55" />
+      <el-table-column label="日期" width="180">
+        <template #default="scope">{{ formatDate(scope.row.CreatedAt) }}</template>
+      </el-table-column>
+      <el-table-column label="部门id" prop="unitId" />
+      <el-table-column label="点位id" prop="placeId" />
+      <el-table-column label="按钮组">
+        <template #default="scope">
+          <el-button size="small" type="primary" icon="el-icon-edit" class="table-button" @click="updateUnitPlace(scope.row)">变更</el-button>
+          <el-button type="danger" icon="el-icon-delete" size="mini" @click="deleteRow(scope.row)">删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+    <el-pagination
+      layout="total, sizes, prev, pager, next, jumper"
+      :current-page="page"
+      :page-size="pageSize"
+      :page-sizes="[10, 30, 50, 100]"
+      :style="{float:'right',padding:'20px'}"
+      :total="total"
+      @current-change="handleCurrentChange"
+      @size-change="handleSizeChange"
+    />
+    <el-dialog v-model="dialogFormVisible" :before-close="closeDialog" title="弹窗操作">
+      <el-form :model="formData" label-position="right" label-width="80px">
+        <el-form-item label="部门id:">
+          <el-input v-model.number="formData.unitId" clearable placeholder="请输入" />
+        </el-form-item>
+        <el-form-item label="点位id:">
+          <el-input v-model.number="formData.placeId" clearable placeholder="请输入" />
+        </el-form-item>
+      </el-form>
+      <template #footer>
+        <div class="dialog-footer">
+          <el-button @click="closeDialog">取 消</el-button>
+          <el-button type="primary" @click="enterDialog">确 定</el-button>
+        </div>
+      </template>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import {
+  createUnitPlace,
+  deleteUnitPlace,
+  deleteUnitPlaceByIds,
+  updateUnitPlace,
+  findUnitPlace,
+  getUnitPlaceList
+} from '@/api/unitPlace' //  此处请自行替换地址
+import infoList from '@/mixins/infoList'
+export default {
+  name: 'UnitPlace',
+  mixins: [infoList],
+  data() {
+    return {
+      listApi: getUnitPlaceList,
+      dialogFormVisible: false,
+      type: '',
+      deleteVisible: false,
+      multipleSelection: [],
+      formData: {
+        unitId: 0,
+        placeId: 0,
+      }
+    }
+  },
+  async created() {
+    await this.getTableData()
+  },
+  methods: {
+  // 条件搜索前端看此方法
+    onSubmit() {
+      this.page = 1
+      this.pageSize = 10
+      this.getTableData()
+    },
+    handleSelectionChange(val) {
+      this.multipleSelection = val
+    },
+    deleteRow(row) {
+      this.$confirm('确定要删除吗?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        this.deleteUnitPlace(row)
+      })
+    },
+    async onDelete() {
+      const ids = []
+      if (this.multipleSelection.length === 0) {
+        this.$message({
+          type: 'warning',
+          message: '请选择要删除的数据'
+        })
+        return
+      }
+      this.multipleSelection &&
+        this.multipleSelection.map(item => {
+          ids.push(item.ID)
+        })
+      const res = await deleteUnitPlaceByIds({ ids })
+      if (res.code === 0) {
+        this.$message({
+          type: 'success',
+          message: '删除成功'
+        })
+        if (this.tableData.length === ids.length && this.page > 1) {
+          this.page--
+        }
+        this.deleteVisible = false
+        this.getTableData()
+      }
+    },
+    async updateUnitPlace(row) {
+      const res = await findUnitPlace({ ID: row.ID })
+      this.type = 'update'
+      if (res.code === 0) {
+        this.formData = res.data.reunitPlace
+        this.dialogFormVisible = true
+      }
+    },
+    closeDialog() {
+      this.dialogFormVisible = false
+      this.formData = {
+        unitId: 0,
+        placeId: 0,
+      }
+    },
+    async deleteUnitPlace(row) {
+      const res = await deleteUnitPlace({ ID: row.ID })
+      if (res.code === 0) {
+        this.$message({
+          type: 'success',
+          message: '删除成功'
+        })
+        if (this.tableData.length === 1 && this.page > 1) {
+          this.page--
+        }
+        this.getTableData()
+      }
+    },
+    async enterDialog() {
+      let res
+      switch (this.type) {
+        case 'create':
+          res = await createUnitPlace(this.formData)
+          break
+        case 'update':
+          res = await updateUnitPlace(this.formData)
+          break
+        default:
+          res = await createUnitPlace(this.formData)
+          break
+      }
+      if (res.code === 0) {
+        this.$message({
+          type: 'success',
+          message: '创建/更改成功'
+        })
+        this.closeDialog()
+        this.getTableData()
+      }
+    },
+    openDialog() {
+      this.type = 'create'
+      this.dialogFormVisible = true
+    }
+  },
+}
+</script>
+
+<style>
+</style>

+ 78 - 0
web/src/view/unitPlace/unitPlaceForm.vue

@@ -0,0 +1,78 @@
+<template>
+  <div>
+    <el-form :model="formData" label-position="right" label-width="80px">
+      <el-form-item label="部门id:">
+        <el-input v-model.number="formData.unitId" clearable placeholder="请输入" />
+      </el-form-item>
+      <el-form-item label="点位id:">
+        <el-input v-model.number="formData.placeId" clearable placeholder="请输入" />
+      </el-form-item>
+      <el-form-item>
+        <el-button size="mini" type="primary" @click="save">保存</el-button>
+        <el-button size="mini" type="primary" @click="back">返回</el-button>
+      </el-form-item>
+    </el-form>
+  </div>
+</template>
+
+<script>
+import {
+  createUnitPlace,
+  updateUnitPlace,
+  findUnitPlace
+} from '@/api/unitPlace' //  此处请自行替换地址
+import infoList from '@/mixins/infoList'
+export default {
+  name: 'UnitPlace',
+  mixins: [infoList],
+  data() {
+    return {
+      type: '',
+      formData: {
+        unitId: 0,
+        placeId: 0,
+      }
+    }
+  },
+  async created() {
+    // 建议通过url传参获取目标数据ID 调用 find方法进行查询数据操作 从而决定本页面是create还是update 以下为id作为url参数示例
+    if (this.$route.query.id) {
+      const res = await findUnitPlace({ ID: this.$route.query.id })
+      if (res.code === 0) {
+        this.formData = res.data.reunitPlace
+        this.type = 'update'
+      }
+    } else {
+      this.type = 'create'
+    }
+  },
+  methods: {
+    async save() {
+      let res
+      switch (this.type) {
+        case 'create':
+          res = await createUnitPlace(this.formData)
+          break
+        case 'update':
+          res = await updateUnitPlace(this.formData)
+          break
+        default:
+          res = await createUnitPlace(this.formData)
+          break
+      }
+      if (res.code === 0) {
+        this.$message({
+          type: 'success',
+          message: '创建/更改成功'
+        })
+      }
+    },
+    back() {
+      this.$router.go(-1)
+    }
+  }
+}
+</script>
+
+<style>
+</style>

+ 205 - 0
web/src/view/unitUser/unitUser.vue

@@ -0,0 +1,205 @@
+<template>
+  <div>
+    <div class="search-term">
+      <el-form :inline="true" :model="searchInfo" class="demo-form-inline">
+        <el-form-item>
+          <el-button size="mini" type="primary" icon="el-icon-search" @click="onSubmit">查询</el-button>
+          <el-button size="mini" type="primary" icon="el-icon-plus" @click="openDialog">新增</el-button>
+          <el-popover v-model:visible="deleteVisible" placement="top" width="160">
+            <p>确定要删除吗?</p>
+            <div style="text-align: right; margin: 0">
+              <el-button size="mini" type="text" @click="deleteVisible = false">取消</el-button>
+              <el-button size="mini" type="primary" @click="onDelete">确定</el-button>
+            </div>
+            <template #reference>
+              <el-button icon="el-icon-delete" size="mini" type="danger" style="margin-left: 10px;">批量删除</el-button>
+            </template>
+          </el-popover>
+        </el-form-item>
+      </el-form>
+    </div>
+    <el-table
+      ref="multipleTable"
+      border
+      stripe
+      style="width: 100%"
+      tooltip-effect="dark"
+      :data="tableData"
+      @selection-change="handleSelectionChange"
+    >
+      <el-table-column type="selection" width="55" />
+      <el-table-column label="日期" width="180">
+        <template #default="scope">{{ formatDate(scope.row.CreatedAt) }}</template>
+      </el-table-column>
+      <el-table-column label="unitId字段" prop="unitId" />
+      <el-table-column label="用户id" prop="uuid" />
+      <el-table-column label="按钮组">
+        <template #default="scope">
+          <el-button size="small" type="primary" icon="el-icon-edit" class="table-button" @click="updateUnitUser(scope.row)">变更</el-button>
+          <el-button type="danger" icon="el-icon-delete" size="mini" @click="deleteRow(scope.row)">删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+    <el-pagination
+      layout="total, sizes, prev, pager, next, jumper"
+      :current-page="page"
+      :page-size="pageSize"
+      :page-sizes="[10, 30, 50, 100]"
+      :style="{float:'right',padding:'20px'}"
+      :total="total"
+      @current-change="handleCurrentChange"
+      @size-change="handleSizeChange"
+    />
+    <el-dialog v-model="dialogFormVisible" :before-close="closeDialog" title="弹窗操作">
+      <el-form :model="formData" label-position="right" label-width="80px">
+        <el-form-item label="unitId字段:">
+          <el-input v-model.number="formData.unitId" clearable placeholder="请输入" />
+        </el-form-item>
+        <el-form-item label="用户id:">
+          <el-input v-model="formData.uuid" clearable placeholder="请输入" />
+        </el-form-item>
+      </el-form>
+      <template #footer>
+        <div class="dialog-footer">
+          <el-button @click="closeDialog">取 消</el-button>
+          <el-button type="primary" @click="enterDialog">确 定</el-button>
+        </div>
+      </template>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import {
+  createUnitUser,
+  deleteUnitUser,
+  deleteUnitUserByIds,
+  updateUnitUser,
+  findUnitUser,
+  getUnitUserList
+} from '@/api/unitUser' //  此处请自行替换地址
+import infoList from '@/mixins/infoList'
+export default {
+  name: 'UnitUser',
+  mixins: [infoList],
+  data() {
+    return {
+      listApi: getUnitUserList,
+      dialogFormVisible: false,
+      type: '',
+      deleteVisible: false,
+      multipleSelection: [],
+      formData: {
+        unitId: 0,
+        uuid: '',
+      }
+    }
+  },
+  async created() {
+    await this.getTableData()
+  },
+  methods: {
+  // 条件搜索前端看此方法
+    onSubmit() {
+      this.page = 1
+      this.pageSize = 10
+      this.getTableData()
+    },
+    handleSelectionChange(val) {
+      this.multipleSelection = val
+    },
+    deleteRow(row) {
+      this.$confirm('确定要删除吗?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        this.deleteUnitUser(row)
+      })
+    },
+    async onDelete() {
+      const ids = []
+      if (this.multipleSelection.length === 0) {
+        this.$message({
+          type: 'warning',
+          message: '请选择要删除的数据'
+        })
+        return
+      }
+      this.multipleSelection &&
+        this.multipleSelection.map(item => {
+          ids.push(item.ID)
+        })
+      const res = await deleteUnitUserByIds({ ids })
+      if (res.code === 0) {
+        this.$message({
+          type: 'success',
+          message: '删除成功'
+        })
+        if (this.tableData.length === ids.length && this.page > 1) {
+          this.page--
+        }
+        this.deleteVisible = false
+        this.getTableData()
+      }
+    },
+    async updateUnitUser(row) {
+      const res = await findUnitUser({ ID: row.ID })
+      this.type = 'update'
+      if (res.code === 0) {
+        this.formData = res.data.reunitUser
+        this.dialogFormVisible = true
+      }
+    },
+    closeDialog() {
+      this.dialogFormVisible = false
+      this.formData = {
+        unitId: 0,
+        uuid: '',
+      }
+    },
+    async deleteUnitUser(row) {
+      const res = await deleteUnitUser({ ID: row.ID })
+      if (res.code === 0) {
+        this.$message({
+          type: 'success',
+          message: '删除成功'
+        })
+        if (this.tableData.length === 1 && this.page > 1) {
+          this.page--
+        }
+        this.getTableData()
+      }
+    },
+    async enterDialog() {
+      let res
+      switch (this.type) {
+        case 'create':
+          res = await createUnitUser(this.formData)
+          break
+        case 'update':
+          res = await updateUnitUser(this.formData)
+          break
+        default:
+          res = await createUnitUser(this.formData)
+          break
+      }
+      if (res.code === 0) {
+        this.$message({
+          type: 'success',
+          message: '创建/更改成功'
+        })
+        this.closeDialog()
+        this.getTableData()
+      }
+    },
+    openDialog() {
+      this.type = 'create'
+      this.dialogFormVisible = true
+    }
+  },
+}
+</script>
+
+<style>
+</style>

+ 78 - 0
web/src/view/unitUser/unitUserForm.vue

@@ -0,0 +1,78 @@
+<template>
+  <div>
+    <el-form :model="formData" label-position="right" label-width="80px">
+      <el-form-item label="unitId字段:">
+        <el-input v-model.number="formData.unitId" clearable placeholder="请输入" />
+      </el-form-item>
+      <el-form-item label="用户id:">
+        <el-input v-model="formData.uuid" clearable placeholder="请输入" />
+      </el-form-item>
+      <el-form-item>
+        <el-button size="mini" type="primary" @click="save">保存</el-button>
+        <el-button size="mini" type="primary" @click="back">返回</el-button>
+      </el-form-item>
+    </el-form>
+  </div>
+</template>
+
+<script>
+import {
+  createUnitUser,
+  updateUnitUser,
+  findUnitUser
+} from '@/api/unitUser' //  此处请自行替换地址
+import infoList from '@/mixins/infoList'
+export default {
+  name: 'UnitUser',
+  mixins: [infoList],
+  data() {
+    return {
+      type: '',
+      formData: {
+        unitId: 0,
+        uuid: '',
+      }
+    }
+  },
+  async created() {
+    // 建议通过url传参获取目标数据ID 调用 find方法进行查询数据操作 从而决定本页面是create还是update 以下为id作为url参数示例
+    if (this.$route.query.id) {
+      const res = await findUnitUser({ ID: this.$route.query.id })
+      if (res.code === 0) {
+        this.formData = res.data.reunitUser
+        this.type = 'update'
+      }
+    } else {
+      this.type = 'create'
+    }
+  },
+  methods: {
+    async save() {
+      let res
+      switch (this.type) {
+        case 'create':
+          res = await createUnitUser(this.formData)
+          break
+        case 'update':
+          res = await updateUnitUser(this.formData)
+          break
+        default:
+          res = await createUnitUser(this.formData)
+          break
+      }
+      if (res.code === 0) {
+        this.$message({
+          type: 'success',
+          message: '创建/更改成功'
+        })
+      }
+    },
+    back() {
+      this.$router.go(-1)
+    }
+  }
+}
+</script>
+
+<style>
+</style>