浏览代码

项目返回参与者id与name4

Reiskuchen 5 年之前
父节点
当前提交
e7db79c4f5

+ 7 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/Department.java

@@ -17,7 +17,7 @@ import java.io.Serializable;
  * </p>
  * </p>
  *
  *
  * @author 吴涛涛
  * @author 吴涛涛
- * @since 2020-02-11
+ * @since 2020-02-13
  */
  */
 @Data
 @Data
 @EqualsAndHashCode(callSuper = false)
 @EqualsAndHashCode(callSuper = false)
@@ -44,6 +44,12 @@ public class Department extends Model<Department> {
     @TableField(value = "superior_id", updateStrategy = FieldStrategy.IGNORED)
     @TableField(value = "superior_id", updateStrategy = FieldStrategy.IGNORED)
     private Integer superiorId;
     private Integer superiorId;
 
 
+    /**
+     * 顶级部门id
+     */
+    @TableField("master_id")
+    private Integer masterId;
+
     /**
     /**
      * 所属公司id
      * 所属公司id
      */
      */

+ 3 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ProjectServiceImpl.java

@@ -101,9 +101,11 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                 if (name == null) {
                 if (name == null) {
                     httpRespMsg.setError("请填写项目名称");
                     httpRespMsg.setError("请填写项目名称");
                 } else {
                 } else {
-                    if (projectMapper.insert(new Project().setProjectName(name).setCompanyId(companyId)) == 0) {
+                    Project project = new Project().setProjectName(name).setCompanyId(companyId);
+                    if (projectMapper.insert(project) == 0) {
                         httpRespMsg.setError("操作失败");
                         httpRespMsg.setError("操作失败");
                     }
                     }
+                    id = project.getId();
                 }
                 }
             } else {
             } else {
                 //修改项目
                 //修改项目

+ 1 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/util/CodeGenerator.java

@@ -204,7 +204,7 @@ public class CodeGenerator {
         //若想要生成的实体类继承某个Controller,则可打开下面注释。写上需要继承的Controller的位置即可
         //若想要生成的实体类继承某个Controller,则可打开下面注释。写上需要继承的Controller的位置即可
 //        strategy.setSuperControllerClass("com.baomidou.ant.common.BaseController");
 //        strategy.setSuperControllerClass("com.baomidou.ant.common.BaseController");
         //此处user是表名,多个英文逗号分割
         //此处user是表名,多个英文逗号分割
-        strategy.setInclude("user");
+        strategy.setInclude("department");
 //        strategy.setExclude();//数据库表全生成
 //        strategy.setExclude();//数据库表全生成
 //        strategy.setInclude(scanner("user").split(","));//表名,多个英文逗号分割
 //        strategy.setInclude(scanner("user").split(","));//表名,多个英文逗号分割
         strategy.setControllerMappingHyphenStyle(true);
         strategy.setControllerMappingHyphenStyle(true);

+ 2 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/DepartmentMapper.xml

@@ -7,12 +7,13 @@
         <id column="department_id" property="departmentId" />
         <id column="department_id" property="departmentId" />
         <result column="department_name" property="departmentName" />
         <result column="department_name" property="departmentName" />
         <result column="superior_id" property="superiorId" />
         <result column="superior_id" property="superiorId" />
+        <result column="master_id" property="masterId" />
         <result column="company_id" property="companyId" />
         <result column="company_id" property="companyId" />
     </resultMap>
     </resultMap>
 
 
     <!-- 通用查询结果列 -->
     <!-- 通用查询结果列 -->
     <sql id="Base_Column_List">
     <sql id="Base_Column_List">
-        department_id, department_name, superior_id, company_id
+        department_id, department_name, superior_id, master_id, company_id
     </sql>
     </sql>
 
 
 </mapper>
 </mapper>