Authored by wangshusheng

修改

... ... @@ -13,7 +13,7 @@ public interface CutDownPriceUserHelpMapper {
List<CutDownPriceProductHelpUser> selectHelpInfoByUidAndCode(@Param("list") List<Integer> uidList, @Param("activityId") Integer activityId, @Param("productSkn") Integer productSkn);
Integer selectExistHelpInfo(@Param("helpUserId") Integer helpUserId, @Param("activityId") Integer activityId, @Param("productSkn") Integer productSkn);
Integer selectExistHelpInfo(@Param("helpUserId") Integer helpUserId, @Param("activityId") Integer activityId, @Param("productSkn") Integer productSkn, @Param("cutRecordId") Integer cutRecordId);
List<CutDownPriceProductHelpUser> selectHelpInfoList(@Param("list") List<CutPriceHelpUserRequestBO> requestList);
... ...
... ... @@ -37,6 +37,7 @@
where help_user_id = #{helpUserId,jdbcType=INTEGER}
AND activity_id = #{activityId,jdbcType=INTEGER}
AND product_skn = #{productSkn,jdbcType=INTEGER}
AND cut_record_id = #{cutRecordId,jdbcType=INTEGER}
</select>
<select id="selectHelpInfoList" resultMap="BaseResultMap" parameterType="java.util.List">
... ...
... ... @@ -348,12 +348,6 @@ public class CutDownPriceServiceImpl implements ICutDownPriceService {
CutDownPriceActivityBo activityBo = cutDownActivityService.queryActivityInfo(activityId);
checkValidActivity(activityBo, activityId);
//判断用户是否已经针对该skn帮助砍价
Integer count = cutPriceUserHelpMapper.selectExistHelpInfo(helpUserId, activityId, productSkn);
if (count>0){
logger.warn(" you have help only one time, activityId is {}, productSkn is {}, helpUserId is {}", activityId, productSkn, helpUserId);
throw new ServiceException(ServiceError.ACTIVITY_CUTDOWNPRICE_YOU_HAS_HELPED_ERROR);
}
// 查询skn的配置信息
CutDownPriceProductBo cutDownPriceProductBo = cutDownPriceProductService.queryCutDownPriceProductBo(activityId, productSkn);
if(cutDownPriceProductBo==null){
... ... @@ -371,6 +365,16 @@ public class CutDownPriceServiceImpl implements ICutDownPriceService {
logger.warn(" this activity have help full, activityId is {}, productSkn is {}", activityId, productSkn);
throw new ServiceException(ServiceError.ACTIVITY_CUTDOWNPRICE_HAS_HELPED_FULL_ERROR);
}
//判断用户是否已经针对该skn帮助砍价
if(!SYSTEM_HELP_ID.equals(helpUserId)){
Integer count = cutPriceUserHelpMapper.selectExistHelpInfo(helpUserId, activityId, productSkn, recordDb.getId());
if (count>0){
logger.warn(" you have help only one time, activityId is {}, productSkn is {}, helpUserId is {}", activityId, productSkn, helpUserId);
throw new ServiceException(ServiceError.ACTIVITY_CUTDOWNPRICE_YOU_HAS_HELPED_ERROR);
}
}
// 查询已砍的价格
List<CutDownPriceProductHelpUser> helpUsers = cutPriceUserHelpMapper.selectHelpInfo(userId, activityId, productSkn, recordDb.getId());
... ...