|
@@ -106,7 +106,7 @@ public class CutDownPriceServiceImpl implements ICutDownPriceService { |
|
@@ -106,7 +106,7 @@ public class CutDownPriceServiceImpl implements ICutDownPriceService { |
106
|
}
|
106
|
}
|
107
|
CutDownPriceUserRecord record = null;
|
107
|
CutDownPriceUserRecord record = null;
|
108
|
if(cutRecordId!=null){
|
108
|
if(cutRecordId!=null){
|
109
|
- record = cutDownPriceUserRecordMapper.selectCutDownPriceUserRecordById(userId, activityId, productSkn, cutRecordId);
|
109
|
+ record = cutDownPriceUserRecordMapper.selectCutDownPriceUserRecordById(cutRecordId);
|
110
|
}else{
|
110
|
}else{
|
111
|
record = cutDownPriceUserRecordMapper.selectCutDownPriceUserRecord(userId, activityId, productSkn);
|
111
|
record = cutDownPriceUserRecordMapper.selectCutDownPriceUserRecord(userId, activityId, productSkn);
|
112
|
}
|
112
|
}
|
|
@@ -166,7 +166,7 @@ public class CutDownPriceServiceImpl implements ICutDownPriceService { |
|
@@ -166,7 +166,7 @@ public class CutDownPriceServiceImpl implements ICutDownPriceService { |
166
|
}
|
166
|
}
|
167
|
CutDownPriceUserRecord record = null;
|
167
|
CutDownPriceUserRecord record = null;
|
168
|
if(cutRecordId!=null){
|
168
|
if(cutRecordId!=null){
|
169
|
- record = cutDownPriceUserRecordMapper.selectCutDownPriceUserRecordById(userId, activityId, productSkn, cutRecordId);
|
169
|
+ record = cutDownPriceUserRecordMapper.selectCutDownPriceUserRecordById(cutRecordId);
|
170
|
}else{
|
170
|
}else{
|
171
|
record = cutDownPriceUserRecordMapper.selectCutDownPriceUserRecord(userId, activityId, productSkn);
|
171
|
record = cutDownPriceUserRecordMapper.selectCutDownPriceUserRecord(userId, activityId, productSkn);
|
172
|
}
|
172
|
}
|
|
@@ -346,6 +346,10 @@ public class CutDownPriceServiceImpl implements ICutDownPriceService { |
|
@@ -346,6 +346,10 @@ public class CutDownPriceServiceImpl implements ICutDownPriceService { |
346
|
Integer productSkn = cutPriceHelpUserRequestBO.getProductSkn();
|
346
|
Integer productSkn = cutPriceHelpUserRequestBO.getProductSkn();
|
347
|
Integer userId = cutPriceHelpUserRequestBO.getUserId();
|
347
|
Integer userId = cutPriceHelpUserRequestBO.getUserId();
|
348
|
Integer helpUserId = cutPriceHelpUserRequestBO.getHelpUserId();
|
348
|
Integer helpUserId = cutPriceHelpUserRequestBO.getHelpUserId();
|
|
|
349
|
+ String userName = cutPriceHelpUserRequestBO.getUserName();
|
|
|
350
|
+ String userImgUrl = cutPriceHelpUserRequestBO.getUserImgUrl();
|
|
|
351
|
+ String helpUserName = cutPriceHelpUserRequestBO.getHelpUserName();
|
|
|
352
|
+ String helpUserImgUrl = cutPriceHelpUserRequestBO.getHelpUserImgUrl();
|
349
|
|
353
|
|
350
|
// 每位用户每天最多可以帮好友砍3次价
|
354
|
// 每位用户每天最多可以帮好友砍3次价
|
351
|
if(!SYSTEM_HELP_ID.equals(helpUserId)){
|
355
|
if(!SYSTEM_HELP_ID.equals(helpUserId)){
|
|
@@ -399,21 +403,14 @@ public class CutDownPriceServiceImpl implements ICutDownPriceService { |
|
@@ -399,21 +403,14 @@ public class CutDownPriceServiceImpl implements ICutDownPriceService { |
399
|
helpUser.setCutPrice(cutPrice);
|
403
|
helpUser.setCutPrice(cutPrice);
|
400
|
helpUser.setCreateTime(DateUtils.getCurrentTimeSecond());
|
404
|
helpUser.setCreateTime(DateUtils.getCurrentTimeSecond());
|
401
|
helpUser.setCutRecordId(recordDb.getId());
|
405
|
helpUser.setCutRecordId(recordDb.getId());
|
|
|
406
|
+ helpUser.setHelpUserImgUrl(helpUserImgUrl);
|
|
|
407
|
+ helpUser.setHelpUserName(helpUserName);
|
|
|
408
|
+ helpUser.setUserName(userName);
|
|
|
409
|
+ helpUser.setUserImgUrl(userImgUrl);
|
402
|
// 插入好友帮砍记录表
|
410
|
// 插入好友帮砍记录表
|
403
|
cutPriceUserHelpMapper.addHelpUserInfo(helpUser);
|
411
|
cutPriceUserHelpMapper.addHelpUserInfo(helpUser);
|
404
|
// 修改用户发起砍价记录表中的帮砍次数
|
412
|
// 修改用户发起砍价记录表中的帮砍次数
|
405
|
cutDownPriceUserRecordMapper.updateCutDownHelpCount(userId, activityId, productSkn, recordDb.getId());
|
413
|
cutDownPriceUserRecordMapper.updateCutDownHelpCount(userId, activityId, productSkn, recordDb.getId());
|
406
|
- String userImageUrl = null;
|
|
|
407
|
- String helpUserImageUrl = null;
|
|
|
408
|
- try{
|
|
|
409
|
- // 调uid查询用户头像
|
|
|
410
|
- String userIdStr = userId.toString()+","+helpUserId.toString();
|
|
|
411
|
- UserInfoRspBO[] userInfoBoArray = invokeUicGetUserInfo(userIdStr);
|
|
|
412
|
- userImageUrl = buildUserImage(userId, userInfoBoArray);
|
|
|
413
|
- helpUserImageUrl = buildUserImage(helpUserId, userInfoBoArray);
|
|
|
414
|
- }catch(Exception e){
|
|
|
415
|
-
|
|
|
416
|
- }
|
|
|
417
|
|
414
|
|
418
|
CutDownPriceProductHelpUserBo systemCreateBo = null;
|
415
|
CutDownPriceProductHelpUserBo systemCreateBo = null;
|
419
|
// 用户帮忙砍价后,自动发起砍价活动,系统帮助砍价除外
|
416
|
// 用户帮忙砍价后,自动发起砍价活动,系统帮助砍价除外
|
|
@@ -439,9 +436,9 @@ public class CutDownPriceServiceImpl implements ICutDownPriceService { |
|
@@ -439,9 +436,9 @@ public class CutDownPriceServiceImpl implements ICutDownPriceService { |
439
|
|
436
|
|
440
|
// 构建返回对象,app弹窗展示
|
437
|
// 构建返回对象,app弹窗展示
|
441
|
CutDownPriceProductHelpUserBo bo = new CutDownPriceProductHelpUserBo();
|
438
|
CutDownPriceProductHelpUserBo bo = new CutDownPriceProductHelpUserBo();
|
442
|
- bo.setUserImgUrl(userImageUrl);
|
439
|
+ bo.setUserImgUrl(userImgUrl);
|
443
|
bo.setCutPrice(cutPrice);
|
440
|
bo.setCutPrice(cutPrice);
|
444
|
- bo.setHelpUserImgUrl(helpUserImageUrl);
|
441
|
+ bo.setHelpUserImgUrl(helpUserImgUrl);
|
445
|
if(systemCreateBo!=null){
|
442
|
if(systemCreateBo!=null){
|
446
|
bo.setSystemCutPrice(systemCreateBo.getCutPrice());
|
443
|
bo.setSystemCutPrice(systemCreateBo.getCutPrice());
|
447
|
}
|
444
|
}
|
|
@@ -462,24 +459,17 @@ public class CutDownPriceServiceImpl implements ICutDownPriceService { |
|
@@ -462,24 +459,17 @@ public class CutDownPriceServiceImpl implements ICutDownPriceService { |
462
|
helpUser.setCutPrice(cutPrice);
|
459
|
helpUser.setCutPrice(cutPrice);
|
463
|
helpUser.setCreateTime(DateUtils.getCurrentTimeSecond());
|
460
|
helpUser.setCreateTime(DateUtils.getCurrentTimeSecond());
|
464
|
helpUser.setCutRecordId(record.getId());
|
461
|
helpUser.setCutRecordId(record.getId());
|
|
|
462
|
+ helpUser.setHelpUserImgUrl(SYSTEM_HELP_IMAGE);
|
|
|
463
|
+ helpUser.setHelpUserName(SYSTEM_HELP_NAME);
|
465
|
// 插入好友帮砍记录表
|
464
|
// 插入好友帮砍记录表
|
466
|
cutPriceUserHelpMapper.addHelpUserInfo(helpUser);
|
465
|
cutPriceUserHelpMapper.addHelpUserInfo(helpUser);
|
467
|
// 修改用户发起砍价记录表中的帮砍次数
|
466
|
// 修改用户发起砍价记录表中的帮砍次数
|
468
|
cutDownPriceUserRecordMapper.updateCutDownHelpCount(userId, activityId, productSkn, record.getId());
|
467
|
cutDownPriceUserRecordMapper.updateCutDownHelpCount(userId, activityId, productSkn, record.getId());
|
469
|
- String userImageUrl = null;
|
|
|
470
|
- try{
|
|
|
471
|
- // 调uid查询用户头像
|
|
|
472
|
- UserInfoRspBO[] userInfoBoArray = invokeUicGetUserInfo(userId.toString());
|
|
|
473
|
- userImageUrl = buildUserImage(userId, userInfoBoArray);
|
|
|
474
|
- }catch(Exception e){
|
|
|
475
|
-
|
|
|
476
|
- }
|
|
|
477
|
|
468
|
|
478
|
// 清理缓存,用户帮砍记录列表、商品详情页
|
469
|
// 清理缓存,用户帮砍记录列表、商品详情页
|
479
|
clearCache(activityId, productSkn, userId, record.getId());
|
470
|
clearCache(activityId, productSkn, userId, record.getId());
|
480
|
|
471
|
|
481
|
CutDownPriceProductHelpUserBo bo = new CutDownPriceProductHelpUserBo();
|
472
|
CutDownPriceProductHelpUserBo bo = new CutDownPriceProductHelpUserBo();
|
482
|
- bo.setUserImgUrl(userImageUrl);
|
|
|
483
|
bo.setCutPrice(cutPrice);
|
473
|
bo.setCutPrice(cutPrice);
|
484
|
return bo;
|
474
|
return bo;
|
485
|
}
|
475
|
}
|
|
@@ -513,18 +503,15 @@ public class CutDownPriceServiceImpl implements ICutDownPriceService { |
|
@@ -513,18 +503,15 @@ public class CutDownPriceServiceImpl implements ICutDownPriceService { |
513
|
int num = cutDownPriceUserRecordMapper.addCutDownUserRecord(record);
|
503
|
int num = cutDownPriceUserRecordMapper.addCutDownUserRecord(record);
|
514
|
// 系统帮助砍第一次价
|
504
|
// 系统帮助砍第一次价
|
515
|
BigDecimal cutPrice = new BigDecimal(0);
|
505
|
BigDecimal cutPrice = new BigDecimal(0);
|
516
|
- String userImageUrl = null;
|
|
|
517
|
try{
|
506
|
try{
|
518
|
logger.info(" system start addHelpUserInfo, userId is {}, activityId is {}, productSkn is {}", userId, activityId, productSkn);
|
507
|
logger.info(" system start addHelpUserInfo, userId is {}, activityId is {}, productSkn is {}", userId, activityId, productSkn);
|
519
|
CutDownPriceProductHelpUserBo help = addSystemHelpUserInfo(convertCutDownPriceProductSystemHelpUser(cutPriceHelpUserRequestBO), activityBo, cutDownPriceProductBo, record);
|
508
|
CutDownPriceProductHelpUserBo help = addSystemHelpUserInfo(convertCutDownPriceProductSystemHelpUser(cutPriceHelpUserRequestBO), activityBo, cutDownPriceProductBo, record);
|
520
|
cutPrice = help.getCutPrice();
|
509
|
cutPrice = help.getCutPrice();
|
521
|
- userImageUrl = help.getUserImgUrl();
|
|
|
522
|
}catch(Exception e){
|
510
|
}catch(Exception e){
|
523
|
logger.warn(" system addHelpUserInfo failed, userId is {}, activityId is {}, productSkn is {}, exception is {}", userId, activityId, productSkn, e);
|
511
|
logger.warn(" system addHelpUserInfo failed, userId is {}, activityId is {}, productSkn is {}, exception is {}", userId, activityId, productSkn, e);
|
524
|
}
|
512
|
}
|
525
|
|
513
|
|
526
|
CutDownPriceProductHelpUserBo bo = new CutDownPriceProductHelpUserBo();
|
514
|
CutDownPriceProductHelpUserBo bo = new CutDownPriceProductHelpUserBo();
|
527
|
- bo.setUserImgUrl(userImageUrl);
|
|
|
528
|
bo.setCutPrice(cutPrice);
|
515
|
bo.setCutPrice(cutPrice);
|
529
|
return bo;
|
516
|
return bo;
|
530
|
}
|
517
|
}
|
|
@@ -610,20 +597,20 @@ public class CutDownPriceServiceImpl implements ICutDownPriceService { |
|
@@ -610,20 +597,20 @@ public class CutDownPriceServiceImpl implements ICutDownPriceService { |
610
|
uids = sb.toString().substring(0, sb.toString().length()-1);
|
597
|
uids = sb.toString().substring(0, sb.toString().length()-1);
|
611
|
}
|
598
|
}
|
612
|
|
599
|
|
613
|
- UserInfoRspBO[] userInfoBoArray = invokeUicGetUserInfo(uids);
|
600
|
+// UserInfoRspBO[] userInfoBoArray = invokeUicGetUserInfo(uids);
|
614
|
for (CutDownPriceProductHelpUserBo helpUserBo : helpUserBos){
|
601
|
for (CutDownPriceProductHelpUserBo helpUserBo : helpUserBos){
|
615
|
if(helpUserBo.getHelpUserId().equals(SYSTEM_HELP_ID)) {
|
602
|
if(helpUserBo.getHelpUserId().equals(SYSTEM_HELP_ID)) {
|
616
|
helpUserBo.setHelpUserImgUrl(SYSTEM_HELP_IMAGE);
|
603
|
helpUserBo.setHelpUserImgUrl(SYSTEM_HELP_IMAGE);
|
617
|
helpUserBo.setHelpUserName(SYSTEM_HELP_NAME);
|
604
|
helpUserBo.setHelpUserName(SYSTEM_HELP_NAME);
|
618
|
continue;
|
605
|
continue;
|
619
|
}
|
606
|
}
|
620
|
- for (UserInfoRspBO userInfoRspBO : userInfoBoArray){
|
|
|
621
|
- if (helpUserBo.getHelpUserId().equals(userInfoRspBO.getUid())){
|
|
|
622
|
- helpUserBo.setHelpUserImgUrl(userInfoRspBO.getHeadIco());
|
|
|
623
|
- helpUserBo.setHelpUserName(userInfoRspBO.getNickName());
|
|
|
624
|
- break;
|
|
|
625
|
- }
|
|
|
626
|
- }
|
607
|
+// for (UserInfoRspBO userInfoRspBO : userInfoBoArray){
|
|
|
608
|
+// if (helpUserBo.getHelpUserId().equals(userInfoRspBO.getUid())){
|
|
|
609
|
+// helpUserBo.setHelpUserImgUrl(userInfoRspBO.getHeadIco());
|
|
|
610
|
+// helpUserBo.setHelpUserName(userInfoRspBO.getNickName());
|
|
|
611
|
+// break;
|
|
|
612
|
+// }
|
|
|
613
|
+// }
|
627
|
}
|
614
|
}
|
628
|
}
|
615
|
}
|
629
|
|
616
|
|