weiximei 6 年 前
コミット
c553b188e0

+ 19
- 16
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/TpAnnouncementServiceImpl.java ファイルの表示

@@ -74,9 +74,9 @@ private  TpAnnouncementMapper tpAnnouncementMapper;
74 74
             AnnouncementTable announcementTable = new AnnouncementTable();
75 75
             BeanUtils.copyProperties(e, announcementTable);
76 76
             //创建人
77
-            String createUserName = userMapper.selectByIdUserName(e.getUpdateUser());
77
+            String  updateDateName= userMapper.selectByIdUserName(e.getUpdateUser());
78 78
             //修改人
79
-            String updateDateName = userMapper.selectByIdUserName(e.getCreateUser());
79
+            String  createUserName= userMapper.selectByIdUserName(e.getCreateUser());
80 80
             announcementTable.setCreateUserName(createUserName);
81 81
             announcementTable.setUpdateDateName(updateDateName);
82 82
             return announcementTable;
@@ -150,6 +150,8 @@ private  TpAnnouncementMapper tpAnnouncementMapper;
150 150
     public ResponseBean updateAnnouncement(String paramets,Integer communityId,Integer userId) {
151 151
                   ResponseBean response= new ResponseBean();
152 152
          TpAnnouncement tpAnnouncement = JSONObject.parseObject(paramets, TpAnnouncement.class);
153
+         int Status= Integer.parseInt(tpAnnouncement.getStatus());
154
+         if (0!=Status){
153 155
 //                        String announcementimg=tpAnnouncement.getAnnouncementCarouselImg();
154 156
 //                        tpAnnouncement.setAnnouncementCarouselImg( "".equals(announcementimg)?null:announcementimg);
155 157
                         tpAnnouncement.setCommunityId(communityId);
@@ -164,22 +166,23 @@ private  TpAnnouncementMapper tpAnnouncementMapper;
164 166
         Integer tdImagesUuid = parseObject.getInteger("id");
165 167
         String[] contentImgArray = contentImg.toArray(new String[]{});
166 168
         //修改图片时删除原来图片
167
-        if (contentImg.size()!=0){
168
-        QueryWrapper<TdImages> queryWrapper = new QueryWrapper<>();
169
-        queryWrapper.lambda().eq(TdImages::getUuid,tdImagesUuid);
170
-        queryWrapper.lambda().eq(TdImages::getType,"announcement");
171
-        imagesMapper.delete(queryWrapper);
172
-
173
-        for (String img:contentImgArray){
174
-            TdImages tdImages = new TdImages();
175
-            tdImages.setImageUrl(img);
176
-            tdImages.setType("announcement");
177
-            tdImages.setUuid(tpAnnouncement.getId());
178
-            tdImages.setCreateTime(LocalDateTime.now());
179
-            tdImages.setCreateUser(userId);
180
-            imagesMapper.insert(tdImages);
169
+        if (contentImg.size()!=0) {
170
+            QueryWrapper<TdImages> queryWrapper = new QueryWrapper<>();
171
+            queryWrapper.lambda().eq(TdImages::getUuid, tdImagesUuid);
172
+            queryWrapper.lambda().eq(TdImages::getType, "announcement");
173
+            imagesMapper.delete(queryWrapper);
174
+
175
+            for (String img : contentImgArray) {
176
+                TdImages tdImages = new TdImages();
177
+                tdImages.setImageUrl(img);
178
+                tdImages.setType("announcement");
179
+                tdImages.setUuid(tpAnnouncement.getId());
180
+                tdImages.setCreateTime(LocalDateTime.now());
181
+                tdImages.setCreateUser(userId);
182
+                imagesMapper.insert(tdImages);
181 183
             }
182 184
         }
185
+        }
183 186
         return response;
184 187
     }
185 188
 

+ 1
- 1
CODE/smart-community/property-api/src/main/resources/mapper/TpAnnouncementMapper.xml ファイルの表示

@@ -15,7 +15,7 @@
15 15
       tp_announcement
16 16
       <where>
17 17
         <if test="record.id != null and record.id != ''" >
18
-          AND id =  #{record.id,jdbcType=INTEGER}
18
+          AND id like concat('%',#{record.id,jdbcType=INTEGER},'%')
19 19
         </if>
20 20
         <if test="record.announcementTitle != null and record.announcementTitle != ''" >
21 21
           AND announcement_title like concat('%',#{record.announcementTitle,jdbcType=VARCHAR},'%')

+ 5
- 0
VUECODE/smart-property-manage/src/views/social/activity/add/index.vue ファイルの表示

@@ -167,6 +167,11 @@ export default {
167 167
         spinner: 'el-icon-loading',
168 168
         background: 'rgba(0, 0, 0, 0.7)'
169 169
       })
170
+      if(this.ruleForm.activityCarouselImg<=0){
171
+            this.$message.error('轮播图未上传')
172
+            loading.close()
173
+            return    
174
+          }
170 175
       if (this.ruleForm.activityContent.length <= 0 && this.ruleForm.contentImg.length <= 0) {
171 176
         this.$message.error('活动内容描述 和 活动配图至少要存在一个!')
172 177
         loading.close()

+ 4
- 0
VUECODE/smart-property-manage/src/views/social/announcement/add.vue ファイルの表示

@@ -86,6 +86,10 @@ export default {
86 86
       })
87 87
       this.$refs[formName].validate((valid) => {
88 88
         if (valid) {
89
+          if(this.ruleForm.announcementCarouselImg<=0){
90
+            this.$message.error('轮播图未上传')
91
+            return    
92
+          }
89 93
           if (this.ruleForm.announcementContent.length <= 0 && this.ruleForm.contentImg.length <= 0) {
90 94
             this.$message.error('公告内容描述 和 公告配图至少要存在一个!')
91 95
             return

+ 0
- 1
VUECODE/smart-property-manage/src/views/social/announcement/details.vue ファイルの表示

@@ -52,7 +52,6 @@ export default {
52 52
         for (let i = 0; i < imgList.length; i++) {
53 53
           this.ruleForm.contentImg.push({ url: imgList[i].imageUrl })
54 54
         }
55
-        console.log('详情', resData)
56 55
         if (this.ruleForm.status === '0') {
57 56
           this.isEdi = false
58 57
         }

+ 1
- 3
VUECODE/smart-property-manage/src/views/social/announcement/edit.vue ファイルの表示

@@ -81,7 +81,6 @@ export default {
81 81
   },
82 82
   methods: {
83 83
     submitForm(formName,status) {
84
-      console.log(status)
85 84
       // 加载框
86 85
       const loading = this.$loading({
87 86
         lock: true,
@@ -156,9 +155,8 @@ export default {
156 155
     },
157 156
     sortHandleChange(value) { // 权重值
158 157
       this.ruleForm.sort = value
159
-      console.log(value)
160 158
     },
161
-    getById(id) { // 页面初始化后调用此方法根据ID获取活动信息
159
+    getById(id) { // 页面初始化后调用此方法根据ID获取公告信息
162 160
       this.ruleForm.id=this.$route.params.id
163 161
       this.$store.dispatch('AnnouncementById', this.ruleForm).then((res) => {
164 162
       const resData = res.data

+ 14
- 1
VUECODE/smart-property-manage/src/views/social/announcement/index.vue ファイルの表示

@@ -179,7 +179,20 @@ export default {
179 179
         this.$message.error('请选择一行数据进行修改!')
180 180
         return
181 181
       }
182
-      this.$router.push({ name: 'announcement-edit', params: { id: ids[0] }})
182
+       let ide= this.deleteIds[0]
183
+       this.listQuery.id = ide 
184
+      this.$store.dispatch('AnnouncementById', this.listQuery).then((res) => {
185
+        const resData = res.data
186
+        const announcement = resData.tpAnnouncement
187
+        const imgList = resData.studentList
188
+        this.listQuery = announcement
189
+        console.log("1",this.listQuery.status)
190
+        if(this.listQuery.status == 0){
191
+          this.$message.error('已作废不可以修改')
192
+          return
193
+        }
194
+          this.$router.push({ name: 'announcement-edit', params: { id: ids[0] }})
195
+      })
183 196
       },
184 197
     deleteAnnouncement(){
185 198
       const ids = this.deleteIds