...
|
...
|
@@ -106,7 +106,7 @@ public class CutDownPriceServiceImpl implements ICutDownPriceService { |
|
|
}
|
|
|
CutDownPriceUserRecord record = null;
|
|
|
if(cutRecordId!=null){
|
|
|
record = cutDownPriceUserRecordMapper.selectCutDownPriceUserRecordById(userId, activityId, productSkn, cutRecordId);
|
|
|
record = cutDownPriceUserRecordMapper.selectCutDownPriceUserRecordById(cutRecordId);
|
|
|
}else{
|
|
|
record = cutDownPriceUserRecordMapper.selectCutDownPriceUserRecord(userId, activityId, productSkn);
|
|
|
}
|
...
|
...
|
@@ -166,7 +166,7 @@ public class CutDownPriceServiceImpl implements ICutDownPriceService { |
|
|
}
|
|
|
CutDownPriceUserRecord record = null;
|
|
|
if(cutRecordId!=null){
|
|
|
record = cutDownPriceUserRecordMapper.selectCutDownPriceUserRecordById(userId, activityId, productSkn, cutRecordId);
|
|
|
record = cutDownPriceUserRecordMapper.selectCutDownPriceUserRecordById(cutRecordId);
|
|
|
}else{
|
|
|
record = cutDownPriceUserRecordMapper.selectCutDownPriceUserRecord(userId, activityId, productSkn);
|
|
|
}
|
...
|
...
|
@@ -346,6 +346,10 @@ public class CutDownPriceServiceImpl implements ICutDownPriceService { |
|
|
Integer productSkn = cutPriceHelpUserRequestBO.getProductSkn();
|
|
|
Integer userId = cutPriceHelpUserRequestBO.getUserId();
|
|
|
Integer helpUserId = cutPriceHelpUserRequestBO.getHelpUserId();
|
|
|
String userName = cutPriceHelpUserRequestBO.getUserName();
|
|
|
String userImgUrl = cutPriceHelpUserRequestBO.getUserImgUrl();
|
|
|
String helpUserName = cutPriceHelpUserRequestBO.getHelpUserName();
|
|
|
String helpUserImgUrl = cutPriceHelpUserRequestBO.getHelpUserImgUrl();
|
|
|
|
|
|
// 每位用户每天最多可以帮好友砍3次价
|
|
|
if(!SYSTEM_HELP_ID.equals(helpUserId)){
|
...
|
...
|
@@ -399,21 +403,14 @@ public class CutDownPriceServiceImpl implements ICutDownPriceService { |
|
|
helpUser.setCutPrice(cutPrice);
|
|
|
helpUser.setCreateTime(DateUtils.getCurrentTimeSecond());
|
|
|
helpUser.setCutRecordId(recordDb.getId());
|
|
|
helpUser.setHelpUserImgUrl(helpUserImgUrl);
|
|
|
helpUser.setHelpUserName(helpUserName);
|
|
|
helpUser.setUserName(userName);
|
|
|
helpUser.setUserImgUrl(userImgUrl);
|
|
|
// 插入好友帮砍记录表
|
|
|
cutPriceUserHelpMapper.addHelpUserInfo(helpUser);
|
|
|
// 修改用户发起砍价记录表中的帮砍次数
|
|
|
cutDownPriceUserRecordMapper.updateCutDownHelpCount(userId, activityId, productSkn, recordDb.getId());
|
|
|
String userImageUrl = null;
|
|
|
String helpUserImageUrl = null;
|
|
|
try{
|
|
|
// 调uid查询用户头像
|
|
|
String userIdStr = userId.toString()+","+helpUserId.toString();
|
|
|
UserInfoRspBO[] userInfoBoArray = invokeUicGetUserInfo(userIdStr);
|
|
|
userImageUrl = buildUserImage(userId, userInfoBoArray);
|
|
|
helpUserImageUrl = buildUserImage(helpUserId, userInfoBoArray);
|
|
|
}catch(Exception e){
|
|
|
|
|
|
}
|
|
|
|
|
|
CutDownPriceProductHelpUserBo systemCreateBo = null;
|
|
|
// 用户帮忙砍价后,自动发起砍价活动,系统帮助砍价除外
|
...
|
...
|
@@ -439,9 +436,9 @@ public class CutDownPriceServiceImpl implements ICutDownPriceService { |
|
|
|
|
|
// 构建返回对象,app弹窗展示
|
|
|
CutDownPriceProductHelpUserBo bo = new CutDownPriceProductHelpUserBo();
|
|
|
bo.setUserImgUrl(userImageUrl);
|
|
|
bo.setUserImgUrl(userImgUrl);
|
|
|
bo.setCutPrice(cutPrice);
|
|
|
bo.setHelpUserImgUrl(helpUserImageUrl);
|
|
|
bo.setHelpUserImgUrl(helpUserImgUrl);
|
|
|
if(systemCreateBo!=null){
|
|
|
bo.setSystemCutPrice(systemCreateBo.getCutPrice());
|
|
|
}
|
...
|
...
|
@@ -462,24 +459,17 @@ public class CutDownPriceServiceImpl implements ICutDownPriceService { |
|
|
helpUser.setCutPrice(cutPrice);
|
|
|
helpUser.setCreateTime(DateUtils.getCurrentTimeSecond());
|
|
|
helpUser.setCutRecordId(record.getId());
|
|
|
helpUser.setHelpUserImgUrl(SYSTEM_HELP_IMAGE);
|
|
|
helpUser.setHelpUserName(SYSTEM_HELP_NAME);
|
|
|
// 插入好友帮砍记录表
|
|
|
cutPriceUserHelpMapper.addHelpUserInfo(helpUser);
|
|
|
// 修改用户发起砍价记录表中的帮砍次数
|
|
|
cutDownPriceUserRecordMapper.updateCutDownHelpCount(userId, activityId, productSkn, record.getId());
|
|
|
String userImageUrl = null;
|
|
|
try{
|
|
|
// 调uid查询用户头像
|
|
|
UserInfoRspBO[] userInfoBoArray = invokeUicGetUserInfo(userId.toString());
|
|
|
userImageUrl = buildUserImage(userId, userInfoBoArray);
|
|
|
}catch(Exception e){
|
|
|
|
|
|
}
|
|
|
|
|
|
// 清理缓存,用户帮砍记录列表、商品详情页
|
|
|
clearCache(activityId, productSkn, userId, record.getId());
|
|
|
|
|
|
CutDownPriceProductHelpUserBo bo = new CutDownPriceProductHelpUserBo();
|
|
|
bo.setUserImgUrl(userImageUrl);
|
|
|
bo.setCutPrice(cutPrice);
|
|
|
return bo;
|
|
|
}
|
...
|
...
|
@@ -513,18 +503,15 @@ public class CutDownPriceServiceImpl implements ICutDownPriceService { |
|
|
int num = cutDownPriceUserRecordMapper.addCutDownUserRecord(record);
|
|
|
// 系统帮助砍第一次价
|
|
|
BigDecimal cutPrice = new BigDecimal(0);
|
|
|
String userImageUrl = null;
|
|
|
try{
|
|
|
logger.info(" system start addHelpUserInfo, userId is {}, activityId is {}, productSkn is {}", userId, activityId, productSkn);
|
|
|
CutDownPriceProductHelpUserBo help = addSystemHelpUserInfo(convertCutDownPriceProductSystemHelpUser(cutPriceHelpUserRequestBO), activityBo, cutDownPriceProductBo, record);
|
|
|
cutPrice = help.getCutPrice();
|
|
|
userImageUrl = help.getUserImgUrl();
|
|
|
}catch(Exception e){
|
|
|
logger.warn(" system addHelpUserInfo failed, userId is {}, activityId is {}, productSkn is {}, exception is {}", userId, activityId, productSkn, e);
|
|
|
}
|
|
|
|
|
|
CutDownPriceProductHelpUserBo bo = new CutDownPriceProductHelpUserBo();
|
|
|
bo.setUserImgUrl(userImageUrl);
|
|
|
bo.setCutPrice(cutPrice);
|
|
|
return bo;
|
|
|
}
|
...
|
...
|
@@ -610,20 +597,20 @@ public class CutDownPriceServiceImpl implements ICutDownPriceService { |
|
|
uids = sb.toString().substring(0, sb.toString().length()-1);
|
|
|
}
|
|
|
|
|
|
UserInfoRspBO[] userInfoBoArray = invokeUicGetUserInfo(uids);
|
|
|
// UserInfoRspBO[] userInfoBoArray = invokeUicGetUserInfo(uids);
|
|
|
for (CutDownPriceProductHelpUserBo helpUserBo : helpUserBos){
|
|
|
if(helpUserBo.getHelpUserId().equals(SYSTEM_HELP_ID)) {
|
|
|
helpUserBo.setHelpUserImgUrl(SYSTEM_HELP_IMAGE);
|
|
|
helpUserBo.setHelpUserName(SYSTEM_HELP_NAME);
|
|
|
continue;
|
|
|
}
|
|
|
for (UserInfoRspBO userInfoRspBO : userInfoBoArray){
|
|
|
if (helpUserBo.getHelpUserId().equals(userInfoRspBO.getUid())){
|
|
|
helpUserBo.setHelpUserImgUrl(userInfoRspBO.getHeadIco());
|
|
|
helpUserBo.setHelpUserName(userInfoRspBO.getNickName());
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
// for (UserInfoRspBO userInfoRspBO : userInfoBoArray){
|
|
|
// if (helpUserBo.getHelpUserId().equals(userInfoRspBO.getUid())){
|
|
|
// helpUserBo.setHelpUserImgUrl(userInfoRspBO.getHeadIco());
|
|
|
// helpUserBo.setHelpUserName(userInfoRspBO.getNickName());
|
|
|
// break;
|
|
|
// }
|
|
|
// }
|
|
|
}
|
|
|
}
|
|
|
|
...
|
...
|
|