Browse Source

修改项目人员列表

wanghaicheng 5 years ago
parent
commit
c97ed927c1

+ 7 - 0
lift-business-service/src/main/java/cn/com/ty/lift/business/project/service/ProjectService.java

@@ -16,6 +16,7 @@ import cn.com.ty.lift.business.project.dao.entity.model.response.ProjectResponse
 import cn.com.ty.lift.business.project.dao.mapper.ProjectHistoryMapper;
 import cn.com.ty.lift.business.project.dao.mapper.ProjectMapper;
 import cn.com.ty.lift.common.base.ExportRequest;
+import cn.com.ty.lift.common.constants.ApiConstants;
 import cn.com.ty.lift.common.export.ExportUtils;
 import cn.com.ty.lift.common.utils.DateUtils;
 import cn.com.xwy.boot.web.dto.RestResponse;
@@ -33,6 +34,7 @@ import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.interceptor.TransactionAspectSupport;
 
 import javax.annotation.Resource;
+import java.time.LocalDate;
 import java.time.LocalDateTime;
 import java.util.ArrayList;
 import java.util.HashMap;
@@ -178,6 +180,11 @@ public class ProjectService extends ServiceImpl<ProjectMapper,Project> {
     @Transactional(rollbackFor = Exception.class)
     public RestResponse add(ProjectExtensionRequest request) {
         Project project = request.getProject();
+        if(project.getStartDate().isAfter(LocalDate.now())){
+            project.setProjectStatus("1");
+        }else{
+            project.setProjectStatus("2");
+        }
         boolean ret = saveProject(project);
         if (!ret) {
             TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();

+ 0 - 2
lift-enterprise-service/src/main/java/cn/com/ty/lift/enterprise/custom/dao/entity/model/PropertyCompanyReq.java

@@ -28,6 +28,4 @@ public class PropertyCompanyReq extends PropertyCompany implements Serializable
     private Long propertyCompanyId;
     private Long propertyContactId;
 
-    private Long mtCompanyId;
-
 }

+ 2 - 2
lift-enterprise-service/src/main/java/cn/com/ty/lift/enterprise/option/controller/MaintenanceOptionController.java

@@ -131,8 +131,8 @@ public class MaintenanceOptionController {
     }
 
     /**
-     * 维保项type 1半月 2季度保 3半年保 4全年保(仅仅只有自己的,比如
-     * type=2时,并没有1的维保项,所以要处理一下,把1包含进去
+     * 维保项type 1半月 2季度保 3半年保 4全年保(仅仅只有自己的,
+     * 比如type=2时,并没有1的维保项,所以要处理一下,把1包含进去
      *
      * @param req
      * @return type列表

+ 1 - 1
lift-enterprise-service/src/main/java/cn/com/ty/lift/enterprise/organization/dao/mapper/OrganizationMapper.java

@@ -18,6 +18,6 @@ import java.util.List;
  */
 public interface OrganizationMapper extends BaseMapper<Project> {
 
-    @Select("select p.user_id userId,u.avatar_url avatar,u.name name, p.user_role role,u.mobile mobile,p.is_monitor monitor from project_user p left join user_info u on p.user_id = u.user_id where p.project_id = #{projectId} and p.user_role in (13, 14, 15, 16)")
+    @Select("select p.user_id userId,u.avatar_url avatar,u.name name, p.user_role role,u.mobile mobile,p.is_monitor monitor from project_user p left join user_info u on p.user_id = u.user_id where p.project_id = #{projectId} and p.user_role in ('ROLEMTWORK', 'CLERK', 'REGION_DIRECTOR', 'HIGH_DIRECTOR')")
     List<HashMap<String, Object>> users(@Param("projectId") Long projectId);
 }

+ 7 - 7
lift-enterprise-service/src/main/java/cn/com/ty/lift/enterprise/organization/service/OrganizationService.java

@@ -32,17 +32,17 @@ public class OrganizationService {
             Object role = projectUser.get("role");
             if (role != null) {
                 switch (role.toString()) {
-                    case "13":
+                    case "ROLEMTWORK":
                         projectUser.replace("role", "维保工");
                         break;
-                    case "14":
-                        projectUser.replace("role", "省级经理");
+                    case "CLERK":
+                        projectUser.replace("role", "文员");
                         break;
-                    case "15":
-                        projectUser.replace("role", "市级经理");
+                    case "REGION_DIRECTOR":
+                        projectUser.replace("role", "区域主管");
                         break;
-                    case "16":
-                        projectUser.replace("role", "文员");
+                    case "HIGH_DIRECTOR":
+                        projectUser.replace("role", "高级主管");
                         break;
                 }
             }

+ 2 - 1
lift-enterprise-service/src/main/java/cn/com/ty/lift/enterprise/region/service/impl/RegionServiceImpl.java

@@ -139,7 +139,8 @@ public class RegionServiceImpl extends ServiceImpl<RegionMapper, Region> impleme
             if (regionUser.isEmpty()) {
                 result.put("regionUser", null);
             } else {
-                result.put("regionUser", regionUser.get(0).get("name"));
+                //区域下,只会有一个区域主管,所以查出来列表,只需要第一个
+                result.put("regionUser",regionUser.get(0));
             }
         }
         if (null != region.getClerk() && !region.getClerk().equals("-1")) {

+ 0 - 8
lift-quan-service/src/main/java/cn/com/ty/lift/quan/news/service/impl/QuanNewsServiceImpl.java

@@ -1,6 +1,5 @@
 package cn.com.ty.lift.quan.news.service.impl;
 
-import cn.com.ty.lift.common.utils.AliyunOSS;
 import cn.com.ty.lift.quan.news.dao.entity.QuanNews;
 import cn.com.ty.lift.quan.news.dao.entity.model.QuanNewsReq;
 import cn.com.ty.lift.quan.news.dao.mapper.QuanNewsMapper;
@@ -215,10 +214,6 @@ public class QuanNewsServiceImpl extends ServiceImpl<QuanNewsMapper, QuanNews> i
      * @date 2019/12/4 13:34
      */
     public RestResponse updateNews(QuanNews quanNews) {
-        QuanNews byId = this.getById(quanNews);
-        if (byId.getVideoName() != null) {
-            AliyunOSS.me().deleteObject(byId.getVideoName());
-        }
         if (this.updateById(quanNews)) {
             return RestResponse.success(null, "成功");
         } else {
@@ -240,9 +235,6 @@ public class QuanNewsServiceImpl extends ServiceImpl<QuanNewsMapper, QuanNews> i
             //取消新闻置顶
             this.top(id, 0);
         }
-        if (byId.getVideoName() != null) {
-            AliyunOSS.me().deleteObject(byId.getVideoName());
-        }
         if (this.removeById(id)) {
             return RestResponse.success(null, "成功");
         } else {