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 { @@ -7,6 +7,10 @@ public interface StoredSellerMapper {
7 //获取生效的信息 7 //获取生效的信息
8 StoredSeller selectValidByUid(int uid); 8 StoredSeller selectValidByUid(int uid);
9 9
  10 + //获取退驻的信息
  11 + StoredSeller selectQuitByUid(int uid);
  12 +
  13 +
10 int insert(StoredSeller storedSeller); 14 int insert(StoredSeller storedSeller);
11 15
12 int updateStatusByUid(@Param("uid") int uid, @Param("validStatus") int validStatus, @Param("expectStatus") int expectStatus, @Param("updateTime") long updateTime); 16 int updateStatusByUid(@Param("uid") int uid, @Param("validStatus") int validStatus, @Param("expectStatus") int expectStatus, @Param("updateTime") long updateTime);
@@ -28,6 +28,14 @@ @@ -28,6 +28,14 @@
28 order by id desc limit 1 28 order by id desc limit 1
29 </select> 29 </select>
30 30
  31 + <select id="selectQuitByUid" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  32 + select
  33 + <include refid="Base_Column_List" />
  34 + from stored_seller
  35 + where uid = #{uid} and valid_status = 9
  36 + order by id desc limit 1
  37 + </select>
  38 +
31 <insert id="insert" parameterType="com.yohoufo.dal.order.model.StoredSeller" > 39 <insert id="insert" parameterType="com.yohoufo.dal.order.model.StoredSeller" >
32 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) 40 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)
33 values (#{uid},#{validStatus}, 41 values (#{uid},#{validStatus},
@@ -6,6 +6,8 @@ import lombok.Data; @@ -6,6 +6,8 @@ import lombok.Data;
6 import lombok.NoArgsConstructor; 6 import lombok.NoArgsConstructor;
7 import lombok.experimental.Builder; 7 import lombok.experimental.Builder;
8 8
  9 +import java.util.List;
  10 +
9 /** 11 /**
10 * Created by jiexiang.wu on 2018/11/19. 12 * Created by jiexiang.wu on 2018/11/19.
11 */ 13 */
@@ -41,4 +43,7 @@ public class ShoppingCoupon { @@ -41,4 +43,7 @@ public class ShoppingCoupon {
41 //是否支持可选 43 //是否支持可选
42 @JSONField(name = "is_selected_support") 44 @JSONField(name = "is_selected_support")
43 private String isSelectedSupport; 45 private String isSelectedSupport;
  46 +
  47 + //使用说明
  48 + private List<String> notes;
44 } 49 }
@@ -9,7 +9,6 @@ import com.yohobuy.ufo.model.order.bo.MerchantOrderAttachInfo; @@ -9,7 +9,6 @@ import com.yohobuy.ufo.model.order.bo.MerchantOrderAttachInfo;
9 import com.yohobuy.ufo.model.order.bo.OrderInfo; 9 import com.yohobuy.ufo.model.order.bo.OrderInfo;
10 import com.yohobuy.ufo.model.order.common.OrderCodeType; 10 import com.yohobuy.ufo.model.order.common.OrderCodeType;
11 import com.yohobuy.ufo.model.order.common.OrderStatus; 11 import com.yohobuy.ufo.model.order.common.OrderStatus;
12 -import com.yohobuy.ufo.model.order.common.TabType;  
13 import com.yohobuy.ufo.model.order.resp.PageResp; 12 import com.yohobuy.ufo.model.order.resp.PageResp;
14 import com.yohoufo.common.alarm.CommonAlarmEventPublisher; 13 import com.yohoufo.common.alarm.CommonAlarmEventPublisher;
15 import com.yohoufo.common.caller.UfoServiceCaller; 14 import com.yohoufo.common.caller.UfoServiceCaller;
@@ -20,7 +19,6 @@ import com.yohoufo.order.common.Payment; @@ -20,7 +19,6 @@ import com.yohoufo.order.common.Payment;
20 import com.yohoufo.order.model.request.PaymentRequest; 19 import com.yohoufo.order.model.request.PaymentRequest;
21 import com.yohoufo.order.model.response.PrepayResponse; 20 import com.yohoufo.order.model.response.PrepayResponse;
22 import com.yohoufo.order.service.cache.CacheCleaner; 21 import com.yohoufo.order.service.cache.CacheCleaner;
23 -import com.yohoufo.order.service.cache.CacheKeyBuilder;  
24 import com.yohoufo.order.service.impl.PaymentServiceImpl; 22 import com.yohoufo.order.service.impl.PaymentServiceImpl;
25 import org.slf4j.Logger; 23 import org.slf4j.Logger;
26 import org.slf4j.LoggerFactory; 24 import org.slf4j.LoggerFactory;
@@ -326,10 +324,14 @@ public class MerchantOrderPaymentService extends AbstractOrderPaymentService { @@ -326,10 +324,14 @@ public class MerchantOrderPaymentService extends AbstractOrderPaymentService {
326 if (sw.getStatus() == null || sw.getStatus() == 0) { 324 if (sw.getStatus() == null || sw.getStatus() == 0) {
327 return new com.yohoufo.common.ApiResponse(400, "钱包不可用", null); 325 return new com.yohoufo.common.ApiResponse(400, "钱包不可用", null);
328 } 326 }
  327 +
  328 + StoredSeller storedSeller =storedSellerService.getValidStoredSeller(uid);
  329 + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
329 JSONObject result = new JSONObject(); 330 JSONObject result = new JSONObject();
330 result.put("all", sw.getAmount().add(sw.getLockAmount()).setScale(2).toString()); 331 result.put("all", sw.getAmount().add(sw.getLockAmount()).setScale(2).toString());
331 result.put("locked", sw.getLockAmount().setScale(2).toString()); 332 result.put("locked", sw.getLockAmount().setScale(2).toString());
332 result.put("avail", sw.getAmount().setScale(2).toString()); 333 result.put("avail", sw.getAmount().setScale(2).toString());
  334 + result.put("entryTime",(storedSeller==null&&storedSeller.getEnterTime()>0)?"":sdf.format(1000L*storedSeller.getEnterTime()));
333 return new com.yohoufo.common.ApiResponse(200, "查询成功", result); 335 return new com.yohoufo.common.ApiResponse(200, "查询成功", result);
334 } 336 }
335 337
@@ -70,6 +70,10 @@ public class StoreSellerServiceImpl implements IStoredSellerService { @@ -70,6 +70,10 @@ public class StoreSellerServiceImpl implements IStoredSellerService {
70 isZhiMaCert = true; 70 isZhiMaCert = true;
71 } 71 }
72 72
  73 +
  74 + //storedBefore 是否曾经入驻过 true or false ,入驻商户肯定入驻过,不是入驻商户,则判断是否有退驻信息
  75 + Boolean storedBefore = false;
  76 +
73 //只有芝麻认证通过了,才去判断是否入驻商户 77 //只有芝麻认证通过了,才去判断是否入驻商户
74 Boolean isStoredSeller = this.isStoredSeller(uid); 78 Boolean isStoredSeller = this.isStoredSeller(uid);
75 if(!isZhiMaCert && isStoredSeller){ 79 if(!isZhiMaCert && isStoredSeller){
@@ -77,9 +81,20 @@ public class StoreSellerServiceImpl implements IStoredSellerService { @@ -77,9 +81,20 @@ public class StoreSellerServiceImpl implements IStoredSellerService {
77 logger.error("StoredSellerServiceImpl entryStatus not correct status isZhiMaCert = false ,but isStoredSeller = true ,uid is {} ",uid); 81 logger.error("StoredSellerServiceImpl entryStatus not correct status isZhiMaCert = false ,but isStoredSeller = true ,uid is {} ",uid);
78 } 82 }
79 83
  84 + if(isStoredSeller){
  85 + storedBefore = true;
  86 + }else{
  87 + //查已退驻记录
  88 + StoredSeller quitStoredSeller =storedSellerMapper.selectQuitByUid(uid);
  89 + if(quitStoredSeller!=null){
  90 + storedBefore=true;
  91 + }
  92 + }
  93 +
80 Map<String,Boolean> map=new HashMap<>(); 94 Map<String,Boolean> map=new HashMap<>();
81 map.put("isZhiMaCert",isZhiMaCert); 95 map.put("isZhiMaCert",isZhiMaCert);
82 map.put("isStoredSeller",isStoredSeller); 96 map.put("isStoredSeller",isStoredSeller);
  97 + map.put("storedBefore",storedBefore);
83 return map; 98 return map;
84 } 99 }
85 100
@@ -43,7 +43,7 @@ public class CouponProxyService implements Compensator { @@ -43,7 +43,7 @@ public class CouponProxyService implements Compensator {
43 public List<UserCouponsBo> getUserAvailableCoupons(int uid) { 43 public List<UserCouponsBo> getUserAvailableCoupons(int uid) {
44 logger.info("[{}] getUserAvailableCoupons", uid); 44 logger.info("[{}] getUserAvailableCoupons", uid);
45 //未使用的优惠券,包括还未生效的券 45 //未使用的优惠券,包括还未生效的券
46 - ApiResponse resp = serviceCaller.call("app.coupons.listNoUsed", uid); 46 + ApiResponse resp = serviceCaller.call("ufo.coupons.listNoUsed", uid);
47 UserCouponsListBo result = getResultFromApiResponse(resp); 47 UserCouponsListBo result = getResultFromApiResponse(resp);
48 if (Objects.isNull(result) || CollectionUtils.isEmpty(result.getCoupons())) { 48 if (Objects.isNull(result) || CollectionUtils.isEmpty(result.getCoupons())) {
49 return Lists.newArrayList(); 49 return Lists.newArrayList();
@@ -56,7 +56,7 @@ public class CouponProxyService implements Compensator { @@ -56,7 +56,7 @@ public class CouponProxyService implements Compensator {
56 public List<UserCouponsBo> checkAndGetCoupons(int uid, List<String> couponCodes) { 56 public List<UserCouponsBo> checkAndGetCoupons(int uid, List<String> couponCodes) {
57 logger.info("[{}] checkAndGetCoupons:{}", uid, couponCodes); 57 logger.info("[{}] checkAndGetCoupons:{}", uid, couponCodes);
58 //未使用的优惠券,包括还未生效的券 58 //未使用的优惠券,包括还未生效的券
59 - ApiResponse resp = serviceCaller.call("app.coupons.checkAndGet", uid, couponCodes); 59 + ApiResponse resp = serviceCaller.call("ufo.coupons.checkAndGet", uid, couponCodes);
60 UserCouponsListBo result = getResultFromApiResponse(resp); 60 UserCouponsListBo result = getResultFromApiResponse(resp);
61 if (Objects.isNull(result) || CollectionUtils.isEmpty(result.getCoupons())) { 61 if (Objects.isNull(result) || CollectionUtils.isEmpty(result.getCoupons())) {
62 return Lists.newArrayList(); 62 return Lists.newArrayList();
@@ -76,7 +76,7 @@ public class CouponProxyService implements Compensator { @@ -76,7 +76,7 @@ public class CouponProxyService implements Compensator {
76 public void orderUseCoupon(@TxCompensateArgs("uid") int uid, @TxCompensateArgs("orderCode") long orderCode, 76 public void orderUseCoupon(@TxCompensateArgs("uid") int uid, @TxCompensateArgs("orderCode") long orderCode,
77 @TxCompensateArgs("couponBo") CouponBo coupon) { 77 @TxCompensateArgs("couponBo") CouponBo coupon) {
78 logger.info("[{}] request to use coupon,couponBo is {}", orderCode, coupon); 78 logger.info("[{}] request to use coupon,couponBo is {}", orderCode, coupon);
79 - ApiResponse resp = serviceCaller.call("app.coupons.use", uid, orderCode, Lists.newArrayList(coupon.getCouponCode())); 79 + ApiResponse resp = serviceCaller.call("ufo.coupons.use", uid, orderCode, Lists.newArrayList(coupon.getCouponCode()));
80 Boolean result = getResultFromApiResponse(resp); 80 Boolean result = getResultFromApiResponse(resp);
81 if (result == null || result.booleanValue() == false) { 81 if (result == null || result.booleanValue() == false) {
82 logger.warn("[{}] use couponBo fail,coupons is {}", orderCode, coupon); 82 logger.warn("[{}] use couponBo fail,coupons is {}", orderCode, coupon);
@@ -95,7 +95,7 @@ public class CouponProxyService implements Compensator { @@ -95,7 +95,7 @@ public class CouponProxyService implements Compensator {
95 */ 95 */
96 public void orderCancelCoupon(int uid, long orderCode, CouponBo coupon) { 96 public void orderCancelCoupon(int uid, long orderCode, CouponBo coupon) {
97 logger.info("[{}] request to cancel coupon,couponBo is {}", orderCode, coupon); 97 logger.info("[{}] request to cancel coupon,couponBo is {}", orderCode, coupon);
98 - ApiResponse resp = serviceCaller.call("app.coupons.cancel", uid, orderCode, Lists.newArrayList(coupon.getCouponCode())); 98 + ApiResponse resp = serviceCaller.call("ufo.coupons.cancel", uid, orderCode, Lists.newArrayList(coupon.getCouponCode()));
99 Boolean result = getResultFromApiResponse(resp); 99 Boolean result = getResultFromApiResponse(resp);
100 if (result == null || result.booleanValue() == false) { 100 if (result == null || result.booleanValue() == false) {
101 logger.warn("[{}] cancel coupon fail,couponBo is {}", orderCode, coupon); 101 logger.warn("[{}] cancel coupon fail,couponBo is {}", orderCode, coupon);
@@ -46,6 +46,8 @@ public class CouponSupport { @@ -46,6 +46,8 @@ public class CouponSupport {
46 shoppingCoupon.setSelected(OrderConstant.N_STR); 46 shoppingCoupon.setSelected(OrderConstant.N_STR);
47 shoppingCoupon.setIsSelectedSupport(OrderConstant.Y_STR); 47 shoppingCoupon.setIsSelectedSupport(OrderConstant.Y_STR);
48 48
  49 + shoppingCoupon.setNotes(userCouponsBo.getNotes());
  50 +
49 result.add(shoppingCoupon); 51 result.add(shoppingCoupon);
50 }); 52 });
51 53
@@ -37,4 +37,6 @@ public class StorageDataResp { @@ -37,4 +37,6 @@ public class StorageDataResp {
37 37
38 @JSONField(name = "suggest_high_price") 38 @JSONField(name = "suggest_high_price")
39 private BigDecimal suggestHighPrice; 39 private BigDecimal suggestHighPrice;
  40 +
  41 + private BigDecimal leastPrice;
40 } 42 }
@@ -184,9 +184,11 @@ public class ProductServiceImpl implements ProductService{ @@ -184,9 +184,11 @@ public class ProductServiceImpl implements ProductService{
184 resp.setStatus(product.getShelveStatus()); 184 resp.setStatus(product.getShelveStatus());
185 } 185 }
186 } 186 }
187 - 187 +
  188 + StoragePrice storagePrice = storagePriceMapper.selectLeastPrice(storageId);
188 resp.setSuggestLowPrice(storage.getSuggestLowPrice()); 189 resp.setSuggestLowPrice(storage.getSuggestLowPrice());
189 resp.setSuggestHighPrice(storage.getSuggestHighPrice()); 190 resp.setSuggestHighPrice(storage.getSuggestHighPrice());
  191 + resp.setLeastPrice(null == storagePrice ? null : storagePrice.getPrice());
190 return resp; 192 return resp;
191 } 193 }
192 194
@@ -27,7 +27,7 @@ public class CouponController { @@ -27,7 +27,7 @@ public class CouponController {
27 * @param uid 27 * @param uid
28 * @return 28 * @return
29 */ 29 */
30 - @RequestMapping(params = "method=app.coupons.get") 30 + @RequestMapping(params = "method=ufo.coupons.get")
31 @ResponseBody 31 @ResponseBody
32 public ApiResponse queryCouponList(@RequestParam(value = "uid") Integer uid) { 32 public ApiResponse queryCouponList(@RequestParam(value = "uid") Integer uid) {
33 33
@@ -43,7 +43,7 @@ public class CouponController { @@ -43,7 +43,7 @@ public class CouponController {
43 * @param uid 43 * @param uid
44 * @return 44 * @return
45 */ 45 */
46 - @RequestMapping(params = "method=app.coupons.cnt") 46 + @RequestMapping(params = "method=ufo.coupons.cnt")
47 @ResponseBody 47 @ResponseBody
48 public ApiResponse queryCouponCnt(@RequestParam(value = "uid") Integer uid) { 48 public ApiResponse queryCouponCnt(@RequestParam(value = "uid") Integer uid) {
49 49
@@ -59,7 +59,7 @@ public class CouponController { @@ -59,7 +59,7 @@ public class CouponController {
59 * @param uid 59 * @param uid
60 * @return 60 * @return
61 */ 61 */
62 - @RequestMapping(params = "method=app.coupons.send") 62 + @RequestMapping(params = "method=ufo.coupons.send")
63 @ResponseBody 63 @ResponseBody
64 public ApiResponse sendCoupon(@RequestParam(value = "uid") Integer uid, 64 public ApiResponse sendCoupon(@RequestParam(value = "uid") Integer uid,
65 @RequestParam(value = "coupon_tokens") String couponTokens) { 65 @RequestParam(value = "coupon_tokens") String couponTokens) {
@@ -37,7 +37,7 @@ public class OrderCouponController { @@ -37,7 +37,7 @@ public class OrderCouponController {
37 * @param orderCode 37 * @param orderCode
38 * @return 38 * @return
39 */ 39 */
40 - @RequestMapping(params = "method=app.coupons.use") 40 + @RequestMapping(params = "method=ufo.coupons.use")
41 @ResponseBody 41 @ResponseBody
42 public ApiResponse useCoupon(@RequestParam(value = "uid") Integer uid, 42 public ApiResponse useCoupon(@RequestParam(value = "uid") Integer uid,
43 @RequestParam(value = "orderCode") long orderCode, 43 @RequestParam(value = "orderCode") long orderCode,
@@ -57,7 +57,7 @@ public class OrderCouponController { @@ -57,7 +57,7 @@ public class OrderCouponController {
57 * @param orderCode 57 * @param orderCode
58 * @return 58 * @return
59 */ 59 */
60 - @RequestMapping(params = "method=app.coupons.cancel") 60 + @RequestMapping(params = "method=ufo.coupons.cancel")
61 @ResponseBody 61 @ResponseBody
62 public ApiResponse cancelCoupon(@RequestParam(value = "uid") Integer uid, 62 public ApiResponse cancelCoupon(@RequestParam(value = "uid") Integer uid,
63 @RequestParam(value = "orderCode") long orderCode, 63 @RequestParam(value = "orderCode") long orderCode,
@@ -75,7 +75,7 @@ public class OrderCouponController { @@ -75,7 +75,7 @@ public class OrderCouponController {
75 * @param uid 75 * @param uid
76 * @return 76 * @return
77 */ 77 */
78 - @RequestMapping(params = "method=app.coupons.listNoUsed") 78 + @RequestMapping(params = "method=ufo.coupons.listNoUsed")
79 @ResponseBody 79 @ResponseBody
80 public ApiResponse queryUserNoUsedCoupons(@RequestParam(value = "uid") Integer uid) { 80 public ApiResponse queryUserNoUsedCoupons(@RequestParam(value = "uid") Integer uid) {
81 81
@@ -92,7 +92,7 @@ public class OrderCouponController { @@ -92,7 +92,7 @@ public class OrderCouponController {
92 * @param uid 92 * @param uid
93 * @return 93 * @return
94 */ 94 */
95 - @RequestMapping(params = "method=app.coupons.checkAndGet") 95 + @RequestMapping(params = "method=ufo.coupons.checkAndGet")
96 @ResponseBody 96 @ResponseBody
97 public ApiResponse checkAndGetCoupons(@RequestParam(value = "uid") int uid, 97 public ApiResponse checkAndGetCoupons(@RequestParam(value = "uid") int uid,
98 @RequestParam(value = "couponCodes") List<String> couponCodes) { 98 @RequestParam(value = "couponCodes") List<String> couponCodes) {
1 package com.yohoufo.promotion.convert; 1 package com.yohoufo.promotion.convert;
2 2
  3 +import com.google.common.collect.Lists;
3 import com.yohobuy.ufo.model.promotion.UserCouponsBo; 4 import com.yohobuy.ufo.model.promotion.UserCouponsBo;
4 import com.yohobuy.ufo.model.promotion.constant.CouponProductLimitTypeEnum; 5 import com.yohobuy.ufo.model.promotion.constant.CouponProductLimitTypeEnum;
5 import com.yohobuy.ufo.model.promotion.constant.CouponUseLimitTypeEnum; 6 import com.yohobuy.ufo.model.promotion.constant.CouponUseLimitTypeEnum;
@@ -7,6 +8,8 @@ import com.yohobuy.ufo.model.promotion.constant.UserCouponsStatusEnum; @@ -7,6 +8,8 @@ import com.yohobuy.ufo.model.promotion.constant.UserCouponsStatusEnum;
7 import com.yohobuy.ufo.model.promotion.response.CouponInfo; 8 import com.yohobuy.ufo.model.promotion.response.CouponInfo;
8 import com.yohoufo.common.utils.DateUtil; 9 import com.yohoufo.common.utils.DateUtil;
9 import com.yohoufo.dal.promotion.model.*; 10 import com.yohoufo.dal.promotion.model.*;
  11 +import org.apache.commons.lang3.StringUtils;
  12 +
10 import java.text.MessageFormat; 13 import java.text.MessageFormat;
11 import java.util.Arrays; 14 import java.util.Arrays;
12 15
@@ -34,6 +37,9 @@ public class CouponConvert { @@ -34,6 +37,9 @@ public class CouponConvert {
34 couponBo.setUseRule(MessageFormat.format(CouponUseLimitTypeEnum.AMOUNT_LIMIT.getText(),coupon.getUseLimitValue().intValue())); 37 couponBo.setUseRule(MessageFormat.format(CouponUseLimitTypeEnum.AMOUNT_LIMIT.getText(),coupon.getUseLimitValue().intValue()));
35 } 38 }
36 39
  40 + //优惠券说明
  41 + couponBo.setNotes(Lists.newArrayList(coupon.getRemark()));
  42 +
37 return couponBo; 43 return couponBo;
38 } 44 }
39 45
@@ -69,6 +75,9 @@ public class CouponConvert { @@ -69,6 +75,9 @@ public class CouponConvert {
69 couponInfo.setUse_rule(MessageFormat.format(CouponUseLimitTypeEnum.AMOUNT_LIMIT.getText(),coupon.getUseLimitValue().intValue())); 75 couponInfo.setUse_rule(MessageFormat.format(CouponUseLimitTypeEnum.AMOUNT_LIMIT.getText(),coupon.getUseLimitValue().intValue()));
70 } 76 }
71 77
  78 + if (StringUtils.isNotEmpty(coupon.getRemark())){
  79 + couponInfo.setNotes(Arrays.asList(coupon.getRemark()));
  80 + }else
72 // product_limit_type product_limit_value 特定商品 81 // product_limit_type product_limit_value 特定商品
73 if (coupon.getProductLimitType()!=null && CouponProductLimitTypeEnum.SPECIFIC_PRODUCT.getLimitType().equals(String.valueOf(coupon.getProductLimitType()))){ 82 if (coupon.getProductLimitType()!=null && CouponProductLimitTypeEnum.SPECIFIC_PRODUCT.getLimitType().equals(String.valueOf(coupon.getProductLimitType()))){
74 couponInfo.setNotes(Arrays.asList(CouponProductLimitTypeEnum.SPECIFIC_PRODUCT.getText())); 83 couponInfo.setNotes(Arrays.asList(CouponProductLimitTypeEnum.SPECIFIC_PRODUCT.getText()));