weiximei 6 yıl önce
ebeveyn
işleme
f3515de4f9

+ 13
- 4
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/SocialServiceImpl.java Dosyayı Görüntüle

@@ -75,7 +75,8 @@ public class SocialServiceImpl implements SocialServiceI {
75 75
         if (null != allViewNum){
76 76
             tpAnnouncementMapper.updateByPrimaryKeySelective(id, allViewNum);
77 77
         }
78
-        return tpAnnouncementMapper.selectByPrimaryKey(id, communityId);
78
+        TpAnnouncement tpAnnouncement = tpAnnouncementMapper.selectByPrimaryKey(id, communityId);
79
+        return tpAnnouncement;
79 80
     }
80 81
 
81 82
     /**
@@ -289,7 +290,7 @@ public class SocialServiceImpl implements SocialServiceI {
289 290
 
290 291
         if (Constant.EFFECTIVE.equals(taUser.getStatus()) && (Constant.RELATION.equals(sysRole.getRoleName()) || Constant.TENANT.equals(sysRole.getRoleName()) || Constant.OWNER.equals(sysRole.getRoleName()))){
291 292
             tpTransactionMapper.insertSelective(tpTransaction);
292
-            insertTdImage(tpTransaction, imageUrl, userId);
293
+            insertTdImage(tpTransaction, imageUrl, userId,Constant.TRANSACTION);
293 294
             TpTransaction tpTransaction1=tpTransactionMapper.getById(tpTransaction.getId());
294 295
             response.addSuccess(tpTransaction1);
295 296
             return response;
@@ -298,11 +299,19 @@ public class SocialServiceImpl implements SocialServiceI {
298 299
         return response;
299 300
     }
300 301
 
301
-    private void insertTdImage(TpTransaction tpTransaction, String imageUrl, Integer userId) throws IOException {
302
+    /**
303
+     * 图片入库
304
+     * @param tpTransaction
305
+     * @param imageUrl
306
+     * @param userId
307
+     * @param type 服务:service, 公告:announcement , 活动:activity  租赁 : transaction
308
+     * @throws IOException
309
+     */
310
+    private void insertTdImage(TpTransaction tpTransaction, String imageUrl, Integer userId,String type) throws IOException {
302 311
         TdImages tdImages = new TdImages();
303 312
         Integer uuId = tpTransaction.getId();
304 313
         tdImages.setImageUrl(imageUrl);
305
-        tdImages.setType(Constant.SOCIAL);
314
+        tdImages.setType(type);
306 315
         tdImages.setUuid(uuId);
307 316
         tdImages.setCreateUser(userId);
308 317
         tdImages.setCreateTime(new Date());

+ 5
- 2
CODE/smart-community/community-common/src/main/java/com/community/commom/constant/Constant.java Dosyayı Görüntüle

@@ -51,12 +51,15 @@ public class Constant {
51 51
     /** 住户APP端待办 **/
52 52
     public static final Integer MODEL_TYPE_UPCOMING = 2;
53 53
 
54
-    /** 社交公告类型**/
54
+    /** 社交/图片 公告类型**/
55 55
     public static final String ANNOUNCEMENT = "announcement";
56 56
 
57
-    /** 社交活动类型**/
57
+    /** 社交/图片 活动类型**/
58 58
     public static final String ACTIVITY = "activity";
59 59
 
60
+    /** 社交/图片 租贷类型**/
61
+    public static final String TRANSACTION = "transaction";
62
+
60 63
     /** 社交二手租赁类型**/
61 64
     public static final String LEASE = "lease";
62 65