Authored by Lixiaodi

Merge branch 'test6.8.2' of http://git.yoho.cn/ufo/yohoufo-fore into test6.8.2

... ... @@ -7,6 +7,10 @@ public interface StoredSellerMapper {
//获取生效的信息
StoredSeller selectValidByUid(int uid);
//获取退驻的信息
StoredSeller selectQuitByUid(int uid);
int insert(StoredSeller storedSeller);
int updateStatusByUid(@Param("uid") int uid, @Param("validStatus") int validStatus, @Param("expectStatus") int expectStatus, @Param("updateTime") long updateTime);
... ...
... ... @@ -28,6 +28,14 @@
order by id desc limit 1
</select>
<select id="selectQuitByUid" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
select
<include refid="Base_Column_List" />
from stored_seller
where uid = #{uid} and valid_status = 9
order by id desc limit 1
</select>
<insert id="insert" parameterType="com.yohoufo.dal.order.model.StoredSeller" >
insert into stored_seller (uid, valid_status,cert_no,cert_name,operator_uid,operator_name,enter_time,quit_time, create_time, update_time,break_zhi_ma_cert)
values (#{uid},#{validStatus},
... ...
... ... @@ -6,6 +6,8 @@ import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Builder;
import java.util.List;
/**
* Created by jiexiang.wu on 2018/11/19.
*/
... ... @@ -41,4 +43,7 @@ public class ShoppingCoupon {
//是否支持可选
@JSONField(name = "is_selected_support")
private String isSelectedSupport;
//使用说明
private List<String> notes;
}
... ...
... ... @@ -9,7 +9,6 @@ import com.yohobuy.ufo.model.order.bo.MerchantOrderAttachInfo;
import com.yohobuy.ufo.model.order.bo.OrderInfo;
import com.yohobuy.ufo.model.order.common.OrderCodeType;
import com.yohobuy.ufo.model.order.common.OrderStatus;
import com.yohobuy.ufo.model.order.common.TabType;
import com.yohobuy.ufo.model.order.resp.PageResp;
import com.yohoufo.common.alarm.CommonAlarmEventPublisher;
import com.yohoufo.common.caller.UfoServiceCaller;
... ... @@ -20,7 +19,6 @@ import com.yohoufo.order.common.Payment;
import com.yohoufo.order.model.request.PaymentRequest;
import com.yohoufo.order.model.response.PrepayResponse;
import com.yohoufo.order.service.cache.CacheCleaner;
import com.yohoufo.order.service.cache.CacheKeyBuilder;
import com.yohoufo.order.service.impl.PaymentServiceImpl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
... ... @@ -326,10 +324,14 @@ public class MerchantOrderPaymentService extends AbstractOrderPaymentService {
if (sw.getStatus() == null || sw.getStatus() == 0) {
return new com.yohoufo.common.ApiResponse(400, "钱包不可用", null);
}
StoredSeller storedSeller =storedSellerService.getValidStoredSeller(uid);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
JSONObject result = new JSONObject();
result.put("all", sw.getAmount().add(sw.getLockAmount()).setScale(2).toString());
result.put("locked", sw.getLockAmount().setScale(2).toString());
result.put("avail", sw.getAmount().setScale(2).toString());
result.put("entryTime",(storedSeller==null&&storedSeller.getEnterTime()>0)?"":sdf.format(1000L*storedSeller.getEnterTime()));
return new com.yohoufo.common.ApiResponse(200, "查询成功", result);
}
... ...
... ... @@ -70,6 +70,10 @@ public class StoreSellerServiceImpl implements IStoredSellerService {
isZhiMaCert = true;
}
//storedBefore 是否曾经入驻过 true or false ,入驻商户肯定入驻过,不是入驻商户,则判断是否有退驻信息
Boolean storedBefore = false;
//只有芝麻认证通过了,才去判断是否入驻商户
Boolean isStoredSeller = this.isStoredSeller(uid);
if(!isZhiMaCert && isStoredSeller){
... ... @@ -77,9 +81,20 @@ public class StoreSellerServiceImpl implements IStoredSellerService {
logger.error("StoredSellerServiceImpl entryStatus not correct status isZhiMaCert = false ,but isStoredSeller = true ,uid is {} ",uid);
}
if(isStoredSeller){
storedBefore = true;
}else{
//查已退驻记录
StoredSeller quitStoredSeller =storedSellerMapper.selectQuitByUid(uid);
if(quitStoredSeller!=null){
storedBefore=true;
}
}
Map<String,Boolean> map=new HashMap<>();
map.put("isZhiMaCert",isZhiMaCert);
map.put("isStoredSeller",isStoredSeller);
map.put("storedBefore",storedBefore);
return map;
}
... ...
... ... @@ -43,7 +43,7 @@ public class CouponProxyService implements Compensator {
public List<UserCouponsBo> getUserAvailableCoupons(int uid) {
logger.info("[{}] getUserAvailableCoupons", uid);
//未使用的优惠券,包括还未生效的券
ApiResponse resp = serviceCaller.call("app.coupons.listNoUsed", uid);
ApiResponse resp = serviceCaller.call("ufo.coupons.listNoUsed", uid);
UserCouponsListBo result = getResultFromApiResponse(resp);
if (Objects.isNull(result) || CollectionUtils.isEmpty(result.getCoupons())) {
return Lists.newArrayList();
... ... @@ -56,7 +56,7 @@ public class CouponProxyService implements Compensator {
public List<UserCouponsBo> checkAndGetCoupons(int uid, List<String> couponCodes) {
logger.info("[{}] checkAndGetCoupons:{}", uid, couponCodes);
//未使用的优惠券,包括还未生效的券
ApiResponse resp = serviceCaller.call("app.coupons.checkAndGet", uid, couponCodes);
ApiResponse resp = serviceCaller.call("ufo.coupons.checkAndGet", uid, couponCodes);
UserCouponsListBo result = getResultFromApiResponse(resp);
if (Objects.isNull(result) || CollectionUtils.isEmpty(result.getCoupons())) {
return Lists.newArrayList();
... ... @@ -76,7 +76,7 @@ public class CouponProxyService implements Compensator {
public void orderUseCoupon(@TxCompensateArgs("uid") int uid, @TxCompensateArgs("orderCode") long orderCode,
@TxCompensateArgs("couponBo") CouponBo coupon) {
logger.info("[{}] request to use coupon,couponBo is {}", orderCode, coupon);
ApiResponse resp = serviceCaller.call("app.coupons.use", uid, orderCode, Lists.newArrayList(coupon.getCouponCode()));
ApiResponse resp = serviceCaller.call("ufo.coupons.use", uid, orderCode, Lists.newArrayList(coupon.getCouponCode()));
Boolean result = getResultFromApiResponse(resp);
if (result == null || result.booleanValue() == false) {
logger.warn("[{}] use couponBo fail,coupons is {}", orderCode, coupon);
... ... @@ -95,7 +95,7 @@ public class CouponProxyService implements Compensator {
*/
public void orderCancelCoupon(int uid, long orderCode, CouponBo coupon) {
logger.info("[{}] request to cancel coupon,couponBo is {}", orderCode, coupon);
ApiResponse resp = serviceCaller.call("app.coupons.cancel", uid, orderCode, Lists.newArrayList(coupon.getCouponCode()));
ApiResponse resp = serviceCaller.call("ufo.coupons.cancel", uid, orderCode, Lists.newArrayList(coupon.getCouponCode()));
Boolean result = getResultFromApiResponse(resp);
if (result == null || result.booleanValue() == false) {
logger.warn("[{}] cancel coupon fail,couponBo is {}", orderCode, coupon);
... ...
... ... @@ -46,6 +46,8 @@ public class CouponSupport {
shoppingCoupon.setSelected(OrderConstant.N_STR);
shoppingCoupon.setIsSelectedSupport(OrderConstant.Y_STR);
shoppingCoupon.setNotes(userCouponsBo.getNotes());
result.add(shoppingCoupon);
});
... ...
... ... @@ -37,4 +37,6 @@ public class StorageDataResp {
@JSONField(name = "suggest_high_price")
private BigDecimal suggestHighPrice;
private BigDecimal leastPrice;
}
... ...
... ... @@ -185,8 +185,10 @@ public class ProductServiceImpl implements ProductService{
}
}
StoragePrice storagePrice = storagePriceMapper.selectLeastPrice(storageId);
resp.setSuggestLowPrice(storage.getSuggestLowPrice());
resp.setSuggestHighPrice(storage.getSuggestHighPrice());
resp.setLeastPrice(null == storagePrice ? null : storagePrice.getPrice());
return resp;
}
... ...
... ... @@ -27,7 +27,7 @@ public class CouponController {
* @param uid
* @return
*/
@RequestMapping(params = "method=app.coupons.get")
@RequestMapping(params = "method=ufo.coupons.get")
@ResponseBody
public ApiResponse queryCouponList(@RequestParam(value = "uid") Integer uid) {
... ... @@ -43,7 +43,7 @@ public class CouponController {
* @param uid
* @return
*/
@RequestMapping(params = "method=app.coupons.cnt")
@RequestMapping(params = "method=ufo.coupons.cnt")
@ResponseBody
public ApiResponse queryCouponCnt(@RequestParam(value = "uid") Integer uid) {
... ... @@ -59,7 +59,7 @@ public class CouponController {
* @param uid
* @return
*/
@RequestMapping(params = "method=app.coupons.send")
@RequestMapping(params = "method=ufo.coupons.send")
@ResponseBody
public ApiResponse sendCoupon(@RequestParam(value = "uid") Integer uid,
@RequestParam(value = "coupon_tokens") String couponTokens) {
... ...
... ... @@ -37,7 +37,7 @@ public class OrderCouponController {
* @param orderCode
* @return
*/
@RequestMapping(params = "method=app.coupons.use")
@RequestMapping(params = "method=ufo.coupons.use")
@ResponseBody
public ApiResponse useCoupon(@RequestParam(value = "uid") Integer uid,
@RequestParam(value = "orderCode") long orderCode,
... ... @@ -57,7 +57,7 @@ public class OrderCouponController {
* @param orderCode
* @return
*/
@RequestMapping(params = "method=app.coupons.cancel")
@RequestMapping(params = "method=ufo.coupons.cancel")
@ResponseBody
public ApiResponse cancelCoupon(@RequestParam(value = "uid") Integer uid,
@RequestParam(value = "orderCode") long orderCode,
... ... @@ -75,7 +75,7 @@ public class OrderCouponController {
* @param uid
* @return
*/
@RequestMapping(params = "method=app.coupons.listNoUsed")
@RequestMapping(params = "method=ufo.coupons.listNoUsed")
@ResponseBody
public ApiResponse queryUserNoUsedCoupons(@RequestParam(value = "uid") Integer uid) {
... ... @@ -92,7 +92,7 @@ public class OrderCouponController {
* @param uid
* @return
*/
@RequestMapping(params = "method=app.coupons.checkAndGet")
@RequestMapping(params = "method=ufo.coupons.checkAndGet")
@ResponseBody
public ApiResponse checkAndGetCoupons(@RequestParam(value = "uid") int uid,
@RequestParam(value = "couponCodes") List<String> couponCodes) {
... ...
package com.yohoufo.promotion.convert;
import com.google.common.collect.Lists;
import com.yohobuy.ufo.model.promotion.UserCouponsBo;
import com.yohobuy.ufo.model.promotion.constant.CouponProductLimitTypeEnum;
import com.yohobuy.ufo.model.promotion.constant.CouponUseLimitTypeEnum;
... ... @@ -7,6 +8,8 @@ import com.yohobuy.ufo.model.promotion.constant.UserCouponsStatusEnum;
import com.yohobuy.ufo.model.promotion.response.CouponInfo;
import com.yohoufo.common.utils.DateUtil;
import com.yohoufo.dal.promotion.model.*;
import org.apache.commons.lang3.StringUtils;
import java.text.MessageFormat;
import java.util.Arrays;
... ... @@ -34,6 +37,9 @@ public class CouponConvert {
couponBo.setUseRule(MessageFormat.format(CouponUseLimitTypeEnum.AMOUNT_LIMIT.getText(),coupon.getUseLimitValue().intValue()));
}
//优惠券说明
couponBo.setNotes(Lists.newArrayList(coupon.getRemark()));
return couponBo;
}
... ... @@ -69,6 +75,9 @@ public class CouponConvert {
couponInfo.setUse_rule(MessageFormat.format(CouponUseLimitTypeEnum.AMOUNT_LIMIT.getText(),coupon.getUseLimitValue().intValue()));
}
if (StringUtils.isNotEmpty(coupon.getRemark())){
couponInfo.setNotes(Arrays.asList(coupon.getRemark()));
}else
// product_limit_type product_limit_value 特定商品
if (coupon.getProductLimitType()!=null && CouponProductLimitTypeEnum.SPECIFIC_PRODUCT.getLimitType().equals(String.valueOf(coupon.getProductLimitType()))){
couponInfo.setNotes(Arrays.asList(CouponProductLimitTypeEnum.SPECIFIC_PRODUCT.getText()));
... ...