caipin пре 4 година
родитељ
комит
80b99f5dea
3 измењених фајлова са 44 додато и 36 уклоњено
  1. 1 1
      deployment/cm.sh
  2. 8 0
      services/contract_section_tree_service.go
  3. 35 35
      web/backstage/project_account_bs.go

+ 1 - 1
deployment/cm.sh

@@ -20,4 +20,4 @@ docker rmi registry.cn-shenzhen.aliyuncs.com/construction_management/constructio
 docker pull registry.cn-shenzhen.aliyuncs.com/construction_management/construction_management:latest
 
 
-docker run  --name construction_management  -p 2020:6060 -d registry.cn-shenzhen.aliyuncs.com/construction_management/construction_management:latest
+docker run  --name construction_management  -p 2020:6060 -d --restart always registry.cn-shenzhen.aliyuncs.com/construction_management/construction_management:latest

+ 8 - 0
services/contract_section_tree_service.go

@@ -231,6 +231,10 @@ func (s *contractService) SectionSave(sectionData *viewmodels.TreeSectionContrac
 		return errors.New("未找到合同项目节")
 	}
 
+	if section.Name == sectionData.Name {
+		return nil
+	}
+
 	// 1-1 深度为>=2才能新增项目节
 	// if section.Depth < 2 {
 	// 	return errors.New("请在项目节第三层开始编辑")
@@ -260,6 +264,10 @@ func (s *contractService) UpdateSerial(sectionData *viewmodels.TreeSectionContra
 		return errors.New("未找到合同项目节")
 	}
 
+	if section.Serial == sectionData.Serial {
+		return nil
+	}
+
 	// 1-1 深度为>=2才能新增项目节
 	// if section.Depth < 2 {
 	// 	return errors.New("请在项目节第三层开始编辑")

+ 35 - 35
web/backstage/project_account_bs.go

@@ -262,42 +262,42 @@ func (c *ProjectAccountBs) PostEnable() {
 // @Param   projectId     body    string     true        "项目ID"
 // @Success 200 {string} string "{code:0成功,-1参数类错误,data:viewmodels.ProjectAccount,msg:错误信息}"
 // @Router /backstage/account/delete [post]
-func (c *ProjectAccountBs) PostDelete() {
-
-	// TODO
-	// 验证内容
-	// accountData, err := c.ServiceBackstage.ValidRuleAccountEnable(c.Ctx)
-	// if err != nil {
-	// 	c.Ctx.JSON(iris.Map{"code": -1, "msg": fmt.Sprintf("%s", err)})
-	// 	return
-	// }
-
-	accountVaild := viewmodels.ProjectAccount{}
-	err := c.Ctx.ReadJSON(&accountVaild)
-	if err != nil {
-		c.Ctx.JSON(iris.Map{"code": -1, "msg": "参数错误"})
-		return
-	}
-	// 账号ID校验
-	id, err := utils.GetDecryptId(accountVaild.Id)
-	if err != nil {
-		c.Ctx.JSON(iris.Map{"code": -1, "msg": "账号异常"})
-		return
-	}
-	// 项目ID
-	projectId, err := utils.GetProjectId(c.Ctx)
-	if err != nil {
-		c.Ctx.JSON(iris.Map{"code": -1, "msg": "账号异常"})
-		return
-	}
+// func (c *ProjectAccountBs) PostDelete() {
+
+// 	// TODO
+// 	// 验证内容
+// 	// accountData, err := c.ServiceBackstage.ValidRuleAccountEnable(c.Ctx)
+// 	// if err != nil {
+// 	// 	c.Ctx.JSON(iris.Map{"code": -1, "msg": fmt.Sprintf("%s", err)})
+// 	// 	return
+// 	// }
+
+// 	accountVaild := viewmodels.ProjectAccount{}
+// 	err := c.Ctx.ReadJSON(&accountVaild)
+// 	if err != nil {
+// 		c.Ctx.JSON(iris.Map{"code": -1, "msg": "参数错误"})
+// 		return
+// 	}
+// 	// 账号ID校验
+// 	id, err := utils.GetDecryptId(accountVaild.Id)
+// 	if err != nil {
+// 		c.Ctx.JSON(iris.Map{"code": -1, "msg": "账号异常"})
+// 		return
+// 	}
+// 	// 项目ID
+// 	projectId, err := utils.GetProjectId(c.Ctx)
+// 	if err != nil {
+// 		c.Ctx.JSON(iris.Map{"code": -1, "msg": "账号异常"})
+// 		return
+// 	}
 
-	err = c.ServiceProjectAccount.Delete(id, projectId)
-	if err != nil {
-		c.Ctx.JSON(iris.Map{"code": -1, "msg": err})
-		return
-	}
-	c.Ctx.JSON(iris.Map{"code": 0, "msg": "操作成功"})
-}
+// 	err = c.ServiceProjectAccount.Delete(id, projectId)
+// 	if err != nil {
+// 		c.Ctx.JSON(iris.Map{"code": -1, "msg": err})
+// 		return
+// 	}
+// 	c.Ctx.JSON(iris.Map{"code": 0, "msg": "操作成功"})
+// }
 
 // @Summary 设置账号密码
 // @Tags 项目设置-管理员