Authored by LUOXC

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

... ... @@ -378,7 +378,7 @@
<update id="updateDepositEndTime">
update storage_deposit
set deposit_end_time = deposit_end_time + #{depositEndTime,jdbcType=INTEGER} ,update_time = #{updateTime,jdbcType=INTEGER}
set deposit_end_time = unix_timestamp(now()) + #{depositEndTime,jdbcType=INTEGER} ,update_time = #{updateTime,jdbcType=INTEGER}
where id = #{depositId,jdbcType=INTEGER} AND del_status = 0 AND owner_uid = #{uid,jdbcType=INTEGER}
</update>
... ...
... ... @@ -296,7 +296,7 @@ public class AppraiseService {
//发mq,延迟7天设置状态为已完成
LOGGER.info("start send storageDeposit mq,topic is {}, depositCode is {}", TopicConstants.DEPOSIT_FINISH_DELIVERY, deposit.getDepositCode());
yhProducer.send(TopicConstants.DEPOSIT_FINISH_DELIVERY, deposit, null, 7 * 24 * 60);
yhProducer.send(TopicConstants.DEPOSIT_FINISH_DELIVERY, deposit, null, 10);
}
}
... ...
... ... @@ -52,8 +52,12 @@ public class DepositHelpService {
*/
public int getRemainDay(Integer endTime) {
int second = endTime - (int) (System.currentTimeMillis() / 1000);
int day = (int) Math.ceil(second * 1.0 / (24 * 3600));
return day;
if (second < 0) {
return (int) Math.floor(second * 1.0 / (24 * 3600));
} else {
return (int) Math.ceil(second * 1.0 / (24 * 3600));
}
}
public Integer getOverduePeriod(Integer endTime) {
... ...
... ... @@ -88,6 +88,49 @@ public class ShoppingSupport {
}
/**
* build express formula
* @param chargeResult
* @return
*/
private PromotionFormula buildExpressFormula(ChargeResult chargeResult){
PromotionFormula expressFormula = null;
String shipFee = null;
double finalShipFee;
//香港直邮订单 运费数据存在shipFeeDetail
boolean showShipFee = false;
SingleFeeDetail shipFeeDetail;
if (Objects.nonNull(shipFeeDetail = chargeResult.getShipFeeDetail())){
expressFormula = new PromotionFormula();
if (shipFeeDetail.getCutAmount()>0D){
String normalShipFee = OrderConstant.PLUS_SIGN + MathUtils.formatCurrencyStr(shipFeeDetail.getAmount());
expressFormula.setNormalAmount(normalShipFee);
}
finalShipFee = shipFeeDetail.getFinalAmount();
if (finalShipFee == 0D){
expressFormula.setPromotionAside(OrderConstant.DELIVERY_DESC_ASIDE);
}
//0元也得展示
shipFee = OrderConstant.PLUS_SIGN + MathUtils.formatCurrencyStr(finalShipFee);
showShipFee = true;
}else{
//非香港直邮订单 直接从chargeResult取值
finalShipFee = chargeResult.getShippingAmount();
//0元 不展示
if (finalShipFee > 0D){
expressFormula = new PromotionFormula();
shipFee = OrderConstant.PLUS_SIGN + MathUtils.formatCurrencyStr(finalShipFee);
showShipFee = true;
}
}
if (showShipFee){
expressFormula.setPromotion(OrderConstant.DELIVERY_DESC);
expressFormula.setPromotionAmount(shipFee);
}
return expressFormula;
}
/**
* 付款信息
* @param chargeResult
* @return
... ... @@ -122,33 +165,11 @@ public class ShoppingSupport {
}
//运费
PromotionFormula expressFormula = new PromotionFormula();
expressFormula.setPromotion(OrderConstant.DELIVERY_DESC);
String shipFee = null;
double finalShipFee;
//香港直邮订单 运费数据存在shipFeeDetail
SingleFeeDetail shipFeeDetail;
if (Objects.nonNull(shipFeeDetail = chargeResult.getShipFeeDetail())){
if (shipFeeDetail.getCutAmount()>0D){
String normalShipFee = OrderConstant.PLUS_SIGN + MathUtils.formatCurrencyStr(shipFeeDetail.getAmount());
expressFormula.setNormalAmount(normalShipFee);
}
finalShipFee = shipFeeDetail.getFinalAmount();
if (finalShipFee == 0D){
expressFormula.setPromotionAside(OrderConstant.DELIVERY_DESC_ASIDE);
}
//0元也得展示
shipFee = OrderConstant.PLUS_SIGN + MathUtils.formatCurrencyStr(finalShipFee);
}else{
//非香港直邮订单 直接从chargeResult取值
finalShipFee = chargeResult.getShippingAmount();
//0元 不展示
if (finalShipFee > 0D){
shipFee = OrderConstant.PLUS_SIGN + MathUtils.formatCurrencyStr(finalShipFee);
}
}
expressFormula.setPromotionAmount(shipFee);
PromotionFormula expressFormula = buildExpressFormula(chargeResult);
if (Objects.nonNull(expressFormula)){
formulas.add(expressFormula);
}
//税费
SingleFeeDetail tariffFee;
if ((tariffFee = chargeResult.getTariffFee()) != null){
... ...
... ... @@ -124,7 +124,7 @@ public class AlipayCertHelper {
JSONObject bizContentObj = new JSONObject();
bizContentObj.put("certify_id", certify_id);
request.setBizContent(bizContentObj.toString());
request.setReturnUrl("yohobuyufo://www.yohobuy.com/ufo?pagename=NameAuth&certify_id=" + certify_id + "&");
//生成请求链接,这里一定要使用GET模式
try {
AlipayUserCertifyOpenCertifyResponse response = alipayClient.pageExecute(request, "GET");
... ...
... ... @@ -81,7 +81,7 @@ consumer:
- class: com.yohoufo.order.mq.consumer.DepositFinishDeliveryDelayMsgConsumer
topic: deposit.finishDelivery
delay:
interval: 10080
interval: 10
- address: ${rabbit_ufo}
username: ${rabbit_ufo_user}
... ...