Authored by LUOXC

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

@@ -378,7 +378,7 @@ @@ -378,7 +378,7 @@
378 378
379 <update id="updateDepositEndTime"> 379 <update id="updateDepositEndTime">
380 update storage_deposit 380 update storage_deposit
381 - set deposit_end_time = deposit_end_time + #{depositEndTime,jdbcType=INTEGER} ,update_time = #{updateTime,jdbcType=INTEGER} 381 + set deposit_end_time = unix_timestamp(now()) + #{depositEndTime,jdbcType=INTEGER} ,update_time = #{updateTime,jdbcType=INTEGER}
382 where id = #{depositId,jdbcType=INTEGER} AND del_status = 0 AND owner_uid = #{uid,jdbcType=INTEGER} 382 where id = #{depositId,jdbcType=INTEGER} AND del_status = 0 AND owner_uid = #{uid,jdbcType=INTEGER}
383 </update> 383 </update>
384 384
@@ -296,7 +296,7 @@ public class AppraiseService { @@ -296,7 +296,7 @@ public class AppraiseService {
296 296
297 //发mq,延迟7天设置状态为已完成 297 //发mq,延迟7天设置状态为已完成
298 LOGGER.info("start send storageDeposit mq,topic is {}, depositCode is {}", TopicConstants.DEPOSIT_FINISH_DELIVERY, deposit.getDepositCode()); 298 LOGGER.info("start send storageDeposit mq,topic is {}, depositCode is {}", TopicConstants.DEPOSIT_FINISH_DELIVERY, deposit.getDepositCode());
299 - yhProducer.send(TopicConstants.DEPOSIT_FINISH_DELIVERY, deposit, null, 7 * 24 * 60); 299 + yhProducer.send(TopicConstants.DEPOSIT_FINISH_DELIVERY, deposit, null, 10);
300 } 300 }
301 } 301 }
302 302
@@ -52,8 +52,12 @@ public class DepositHelpService { @@ -52,8 +52,12 @@ public class DepositHelpService {
52 */ 52 */
53 public int getRemainDay(Integer endTime) { 53 public int getRemainDay(Integer endTime) {
54 int second = endTime - (int) (System.currentTimeMillis() / 1000); 54 int second = endTime - (int) (System.currentTimeMillis() / 1000);
55 - int day = (int) Math.ceil(second * 1.0 / (24 * 3600));  
56 - return day; 55 +
  56 + if (second < 0) {
  57 + return (int) Math.floor(second * 1.0 / (24 * 3600));
  58 + } else {
  59 + return (int) Math.ceil(second * 1.0 / (24 * 3600));
  60 + }
57 } 61 }
58 62
59 public Integer getOverduePeriod(Integer endTime) { 63 public Integer getOverduePeriod(Integer endTime) {
@@ -88,6 +88,49 @@ public class ShoppingSupport { @@ -88,6 +88,49 @@ public class ShoppingSupport {
88 } 88 }
89 89
90 /** 90 /**
  91 + * build express formula
  92 + * @param chargeResult
  93 + * @return
  94 + */
  95 + private PromotionFormula buildExpressFormula(ChargeResult chargeResult){
  96 + PromotionFormula expressFormula = null;
  97 +
  98 + String shipFee = null;
  99 + double finalShipFee;
  100 + //香港直邮订单 运费数据存在shipFeeDetail
  101 + boolean showShipFee = false;
  102 + SingleFeeDetail shipFeeDetail;
  103 + if (Objects.nonNull(shipFeeDetail = chargeResult.getShipFeeDetail())){
  104 + expressFormula = new PromotionFormula();
  105 + if (shipFeeDetail.getCutAmount()>0D){
  106 + String normalShipFee = OrderConstant.PLUS_SIGN + MathUtils.formatCurrencyStr(shipFeeDetail.getAmount());
  107 + expressFormula.setNormalAmount(normalShipFee);
  108 + }
  109 + finalShipFee = shipFeeDetail.getFinalAmount();
  110 + if (finalShipFee == 0D){
  111 + expressFormula.setPromotionAside(OrderConstant.DELIVERY_DESC_ASIDE);
  112 + }
  113 + //0元也得展示
  114 + shipFee = OrderConstant.PLUS_SIGN + MathUtils.formatCurrencyStr(finalShipFee);
  115 + showShipFee = true;
  116 + }else{
  117 + //非香港直邮订单 直接从chargeResult取值
  118 + finalShipFee = chargeResult.getShippingAmount();
  119 + //0元 不展示
  120 + if (finalShipFee > 0D){
  121 + expressFormula = new PromotionFormula();
  122 + shipFee = OrderConstant.PLUS_SIGN + MathUtils.formatCurrencyStr(finalShipFee);
  123 + showShipFee = true;
  124 + }
  125 + }
  126 +
  127 + if (showShipFee){
  128 + expressFormula.setPromotion(OrderConstant.DELIVERY_DESC);
  129 + expressFormula.setPromotionAmount(shipFee);
  130 + }
  131 + return expressFormula;
  132 + }
  133 + /**
91 * 付款信息 134 * 付款信息
92 * @param chargeResult 135 * @param chargeResult
93 * @return 136 * @return
@@ -122,33 +165,11 @@ public class ShoppingSupport { @@ -122,33 +165,11 @@ public class ShoppingSupport {
122 } 165 }
123 166
124 //运费 167 //运费
125 - PromotionFormula expressFormula = new PromotionFormula();  
126 - expressFormula.setPromotion(OrderConstant.DELIVERY_DESC);  
127 - String shipFee = null;  
128 - double finalShipFee;  
129 - //香港直邮订单 运费数据存在shipFeeDetail  
130 - SingleFeeDetail shipFeeDetail;  
131 - if (Objects.nonNull(shipFeeDetail = chargeResult.getShipFeeDetail())){  
132 - if (shipFeeDetail.getCutAmount()>0D){  
133 - String normalShipFee = OrderConstant.PLUS_SIGN + MathUtils.formatCurrencyStr(shipFeeDetail.getAmount());  
134 - expressFormula.setNormalAmount(normalShipFee);  
135 - }  
136 - finalShipFee = shipFeeDetail.getFinalAmount();  
137 - if (finalShipFee == 0D){  
138 - expressFormula.setPromotionAside(OrderConstant.DELIVERY_DESC_ASIDE);  
139 - }  
140 - //0元也得展示  
141 - shipFee = OrderConstant.PLUS_SIGN + MathUtils.formatCurrencyStr(finalShipFee);  
142 - }else{  
143 - //非香港直邮订单 直接从chargeResult取值  
144 - finalShipFee = chargeResult.getShippingAmount();  
145 - //0元 不展示  
146 - if (finalShipFee > 0D){  
147 - shipFee = OrderConstant.PLUS_SIGN + MathUtils.formatCurrencyStr(finalShipFee);  
148 - }  
149 - }  
150 - expressFormula.setPromotionAmount(shipFee); 168 + PromotionFormula expressFormula = buildExpressFormula(chargeResult);
  169 + if (Objects.nonNull(expressFormula)){
151 formulas.add(expressFormula); 170 formulas.add(expressFormula);
  171 + }
  172 +
152 //税费 173 //税费
153 SingleFeeDetail tariffFee; 174 SingleFeeDetail tariffFee;
154 if ((tariffFee = chargeResult.getTariffFee()) != null){ 175 if ((tariffFee = chargeResult.getTariffFee()) != null){
@@ -124,7 +124,7 @@ public class AlipayCertHelper { @@ -124,7 +124,7 @@ public class AlipayCertHelper {
124 JSONObject bizContentObj = new JSONObject(); 124 JSONObject bizContentObj = new JSONObject();
125 bizContentObj.put("certify_id", certify_id); 125 bizContentObj.put("certify_id", certify_id);
126 request.setBizContent(bizContentObj.toString()); 126 request.setBizContent(bizContentObj.toString());
127 - 127 + request.setReturnUrl("yohobuyufo://www.yohobuy.com/ufo?pagename=NameAuth&certify_id=" + certify_id + "&");
128 //生成请求链接,这里一定要使用GET模式 128 //生成请求链接,这里一定要使用GET模式
129 try { 129 try {
130 AlipayUserCertifyOpenCertifyResponse response = alipayClient.pageExecute(request, "GET"); 130 AlipayUserCertifyOpenCertifyResponse response = alipayClient.pageExecute(request, "GET");
@@ -81,7 +81,7 @@ consumer: @@ -81,7 +81,7 @@ consumer:
81 - class: com.yohoufo.order.mq.consumer.DepositFinishDeliveryDelayMsgConsumer 81 - class: com.yohoufo.order.mq.consumer.DepositFinishDeliveryDelayMsgConsumer
82 topic: deposit.finishDelivery 82 topic: deposit.finishDelivery
83 delay: 83 delay:
84 - interval: 10080 84 + interval: 10
85 85
86 - address: ${rabbit_ufo} 86 - address: ${rabbit_ufo}
87 username: ${rabbit_ufo_user} 87 username: ${rabbit_ufo_user}