dingxin před 6 roky
rodič
revize
30ed6d05e0

+ 26
- 2
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/TpActivityServiceImpl.java Zobrazit soubor

@@ -20,6 +20,7 @@ import com.community.huiju.service.ITpActivityService;
20 20
 import com.community.huiju.service.IUserService;
21 21
 import com.community.huiju.vo.ActivityVO;
22 22
 import com.google.common.collect.Maps;
23
+import org.apache.commons.lang3.StringUtils;
23 24
 import org.springframework.beans.BeanUtils;
24 25
 import org.springframework.beans.factory.annotation.Autowired;
25 26
 import org.springframework.stereotype.Service;
@@ -81,9 +82,11 @@ public class TpActivityServiceImpl extends ServiceImpl<TpActivityMapper, TpActiv
81 82
             ActivityVO activityVO = new ActivityVO();
82 83
             BeanUtils.copyProperties(activity, activityVO);
83 84
             User createUser = iUserService.getById(activity.getCreateUser());
84
-            User updateUser = iUserService.getById(activity.getUpdateUser());
85 85
             activityVO.setCrateUserName(createUser.getUserName());
86
-            activityVO.setUpdateUserName(updateUser.getUserName());
86
+            if (activity.getUpdateUser() != null) {
87
+                User updateUser = iUserService.getById(activity.getUpdateUser());
88
+                activityVO.setUpdateUserName(updateUser.getUserName());
89
+            }
87 90
             return activityVO;
88 91
         }).collect(Collectors.toList());
89 92
 
@@ -109,11 +112,32 @@ public class TpActivityServiceImpl extends ServiceImpl<TpActivityMapper, TpActiv
109 112
         String [] contentImgArray = jsonArray.toArray(new String[]{});
110 113
         TpActivity tpActivity = jsonObject.toJavaObject(TpActivity.class);
111 114
 
115
+        if (StringUtils.isBlank(tpActivity.getActivityTitle())) {
116
+            responseBean.addError("活动标题不能为空!");
117
+            return responseBean;
118
+        }
119
+
120
+        if (tpActivity.getSignUpMax() == null) {
121
+            responseBean.addError("活动报名人数上限不能为空!");
122
+            return responseBean;
123
+        }
124
+
125
+        if (tpActivity.getRegistrationEndTime() == null) {
126
+            responseBean.addError("活动报名截止时间不能为空!");
127
+            return responseBean;
128
+        }
129
+
130
+        if (tpActivity.getSort() == null) {
131
+            responseBean.addError("活动权重值不能为空!");
132
+            return responseBean;
133
+        }
134
+
112 135
         if (contentImgArray.length <= 0 && (null == tpActivity.getActivityContent() || "".equals(tpActivity.getActivityContent()))){
113 136
             responseBean.addError("活动内容描述 和 活动配图至少要存在一个!");
114 137
             return responseBean;
115 138
         }
116 139
 
140
+
117 141
         // 活动报名人数默认为 0
118 142
         tpActivity.setSignUpCount(0);
119 143
         tpActivity.setViewCount(0);

+ 1
- 1
VUECODE/smart-property-manage/src/views/social/signUp/index.vue Zobrazit soubor

@@ -60,7 +60,7 @@
60 60
         <template slot-scope="scope">
61 61
           <el-popover trigger="hover" placement="top">
62 62
             <div style="max-width: 300px; word-wrap: break-word;">{{ scope.row.remark }}</div>
63
-            <div slot="reference" class="text-remark">
63
+            <div slot="reference" class="text-remark" style="color: #409EFF;">
64 64
               {{ scope.row.remark }}
65 65
             </div>
66 66
           </el-popover>