Authored by wangshusheng

修改

@@ -16,7 +16,7 @@ public interface CutDownPriceUserRecordMapper { @@ -16,7 +16,7 @@ public interface CutDownPriceUserRecordMapper {
16 16
17 CutDownPriceUserRecord selectCutDownPriceUserRecord(@Param("userId") Integer userId, @Param("activityId") Integer activityId, @Param("productSkn") Integer productSkn); 17 CutDownPriceUserRecord selectCutDownPriceUserRecord(@Param("userId") Integer userId, @Param("activityId") Integer activityId, @Param("productSkn") Integer productSkn);
18 18
19 - CutDownPriceUserRecord selectCutDownPriceUserRecordById(@Param("userId") Integer userId, @Param("activityId") Integer activityId, @Param("productSkn") Integer productSkn, @Param("cutRecordId") Integer cutRecordId); 19 + CutDownPriceUserRecord selectCutDownPriceUserRecordById(@Param("cutRecordId") Integer cutRecordId);
20 20
21 List<CutDownPriceUserRecord> selectCutDownPriceUserRecordList(@Param("userId") Integer userId, @Param("activityId") Integer activityId, @Param("productSkn") Integer productSkn); 21 List<CutDownPriceUserRecord> selectCutDownPriceUserRecordList(@Param("userId") Integer userId, @Param("activityId") Integer activityId, @Param("productSkn") Integer productSkn);
22 22
@@ -11,6 +11,10 @@ public class CutDownPriceProductHelpUser { @@ -11,6 +11,10 @@ public class CutDownPriceProductHelpUser {
11 private Integer productSkn; 11 private Integer productSkn;
12 private Integer cutRecordId; 12 private Integer cutRecordId;
13 private BigDecimal cutPrice; 13 private BigDecimal cutPrice;
  14 + private String userName;
  15 + private String userImgUrl;
  16 + private String helpUserName;
  17 + private String helpUserImgUrl;
14 18
15 public Integer getId() { 19 public Integer getId() {
16 return id; 20 return id;
@@ -75,4 +79,36 @@ public class CutDownPriceProductHelpUser { @@ -75,4 +79,36 @@ public class CutDownPriceProductHelpUser {
75 public void setCutRecordId(Integer cutRecordId) { 79 public void setCutRecordId(Integer cutRecordId) {
76 this.cutRecordId = cutRecordId; 80 this.cutRecordId = cutRecordId;
77 } 81 }
  82 +
  83 + public String getUserName() {
  84 + return userName;
  85 + }
  86 +
  87 + public void setUserName(String userName) {
  88 + this.userName = userName;
  89 + }
  90 +
  91 + public String getUserImgUrl() {
  92 + return userImgUrl;
  93 + }
  94 +
  95 + public void setUserImgUrl(String userImgUrl) {
  96 + this.userImgUrl = userImgUrl;
  97 + }
  98 +
  99 + public String getHelpUserName() {
  100 + return helpUserName;
  101 + }
  102 +
  103 + public void setHelpUserName(String helpUserName) {
  104 + this.helpUserName = helpUserName;
  105 + }
  106 +
  107 + public String getHelpUserImgUrl() {
  108 + return helpUserImgUrl;
  109 + }
  110 +
  111 + public void setHelpUserImgUrl(String helpUserImgUrl) {
  112 + this.helpUserImgUrl = helpUserImgUrl;
  113 + }
78 } 114 }
@@ -10,9 +10,13 @@ @@ -10,9 +10,13 @@
10 <result column="cut_record_id" property="cutRecordId" jdbcType="INTEGER" /> 10 <result column="cut_record_id" property="cutRecordId" jdbcType="INTEGER" />
11 <result column="cut_price" property="cutPrice" jdbcType="DECIMAL" /> 11 <result column="cut_price" property="cutPrice" jdbcType="DECIMAL" />
12 <result column="create_time" property="createTime" jdbcType="INTEGER" /> 12 <result column="create_time" property="createTime" jdbcType="INTEGER" />
  13 + <result column="userName" property="userName" jdbcType="VARCHAR" />
  14 + <result column="userImgUrl" property="userImgUrl" jdbcType="VARCHAR" />
  15 + <result column="helpUserName" property="helpUserName" jdbcType="VARCHAR" />
  16 + <result column="helpUserImgUrl" property="helpUserImgUrl" jdbcType="VARCHAR" />
13 </resultMap> 17 </resultMap>
14 <sql id="Base_Column_List" > 18 <sql id="Base_Column_List" >
15 - id, user_id, help_user_id,activity_id,product_skn,cut_record_id,cut_price,create_time 19 + id, user_id, help_user_id,activity_id,product_skn,cut_record_id,cut_price,create_time, userName, userImgUrl, helpUserName, helpUserImgUrl
16 </sql> 20 </sql>
17 21
18 <select id="selectHelpInfo" resultMap="BaseResultMap"> 22 <select id="selectHelpInfo" resultMap="BaseResultMap">
@@ -26,9 +30,9 @@ @@ -26,9 +30,9 @@
26 </select> 30 </select>
27 31
28 <insert id="addHelpUserInfo" parameterType="com.yoho.activity.dal.model.CutDownPriceProductHelpUser"> 32 <insert id="addHelpUserInfo" parameterType="com.yoho.activity.dal.model.CutDownPriceProductHelpUser">
29 - insert into cutdown_price_help_user (user_id, help_user_id,activity_id,product_skn,cut_record_id,cut_price,create_time) 33 + insert into cutdown_price_help_user (user_id, help_user_id,activity_id,product_skn,cut_record_id,cut_price,create_time, userName, userImgUrl, helpUserName, helpUserImgUrl)
30 values (#{userId,jdbcType=INTEGER}, #{helpUserId,jdbcType=INTEGER}, #{activityId,jdbcType=INTEGER}, #{productSkn,jdbcType=INTEGER}, 34 values (#{userId,jdbcType=INTEGER}, #{helpUserId,jdbcType=INTEGER}, #{activityId,jdbcType=INTEGER}, #{productSkn,jdbcType=INTEGER},
31 - #{cutRecordId,jdbcType=INTEGER}, #{cutPrice,jdbcType=DECIMAL}, #{createTime,jdbcType=INTEGER} 35 + #{cutRecordId,jdbcType=INTEGER}, #{cutPrice,jdbcType=DECIMAL}, #{createTime,jdbcType=INTEGER}, #{userName,jdbcType=VARCHAR}, #{userImgUrl,jdbcType=VARCHAR}, #{helpUserName,jdbcType=VARCHAR}, #{helpUserImgUrl,jdbcType=VARCHAR}
32 ) 36 )
33 </insert> 37 </insert>
34 38
@@ -55,10 +55,7 @@ @@ -55,10 +55,7 @@
55 select 55 select
56 <include refid="Base_Column_List" /> 56 <include refid="Base_Column_List" />
57 from cutdown_price_user_record 57 from cutdown_price_user_record
58 - where activity_id = #{activityId,jdbcType=INTEGER}  
59 - and user_id = #{userId,jdbcType=INTEGER}  
60 - and product_skn = #{productSkn,jdbcType=INTEGER}  
61 - and id = #{cutRecordId,jdbcType=INTEGER} 58 + where id = #{cutRecordId,jdbcType=INTEGER}
62 </select> 59 </select>
63 60
64 <select id="selectCutDownPriceUserRecordList" resultMap="BaseResultMap"> 61 <select id="selectCutDownPriceUserRecordList" resultMap="BaseResultMap">
@@ -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