记得上下班打卡 | git大法好,push需谨慎

Commit b7bb25f3 authored by 胡佳晨's avatar 胡佳晨

Merge branch 'dev' into test

parents 045d45a3 7caec1b0
......@@ -34,9 +34,9 @@
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label layui-required is-required">备注:</label>
<div class="col-sm-10">
<textarea name="reason" maxlength="500" class="form-control layui-required" rows="3"></textarea>
<label class="col-sm-2 control-label layui-required is-required">备注:</label>
<div class="col-sm-10">
<textarea name="reason" maxlength="500" class="form-control layui-required" rows="3"></textarea>
</div>
</div>
</form>
......@@ -148,8 +148,9 @@
field: '',
title: '退款金额',
formatter: function (value, row, index) {
var price = result.orderTicketVo.price;
var html = '<input class="form-control entitiesPrice" type="number" min="0.01" max="'+price+'" name="entitiesPrice" value="'+price+'">';
var canRefundedPrice = row.canRefundedPrice;
var orderTicketEntitiesId = row.orderTicketEntitiesId;
var html = '<input id="' + orderTicketEntitiesId + '" class="form-control" type="number" min="0.01" max="' + canRefundedPrice + '" value="' + canRefundedPrice + '">';
return html;
}
},
......@@ -171,19 +172,25 @@
var reason = $('#form-post-add').find("[name='reason']").val();
var orderTicketsId = $('#form-post-add').find("[name='orderTicketsId']").val();
var rows = $.common.isEmpty(table.options.uniqueId) ? $.table.selectFirstColumns() : $.table.selectColumns(table.options.uniqueId);
if (!orderTicketsId || !reason || rows.length <= 0) {
layer.msg("请完善数据");
return false;
}
if (!orderTicketsId || !reason || rows.length <= 0) {
layer.msg("请完善数据");
return false;
}
if ($.validate.form()) {
var data = $('#form-post-add').serializeArray();
data.push({"name":"ticketEntityIds","value":rows});
var entitiesPrice = $.table.selectColumns("price");
data.push({"name":"entitiesPrice","value":entitiesPrice});
console.log(data)
data.push({"name": "ticketEntityIds", "value": rows});
var entitiesPriceArray = [];
for (i in rows) {
var idname = rows[i];
var entitiesPrice = $("#"+idname).val();
entitiesPriceArray.push(entitiesPrice);
}
data.push({"name": "entitiesPrice", "value": entitiesPriceArray});
$.operate.save(prefix + "/apply", data);
}
}
</script>
</body>
</html>
......@@ -103,10 +103,13 @@ public class KylinOrderRefundsServiceImpl extends ServiceImpl<KylinOrderRefundsM
}
// TODO: 2021/6/16 是否能单独退快递飞 批量退款是否退快递费 现在做的是自动退剩余快递费
// 传的快递费不能大于实际的快递费=(支付的快递费-已退的快递费)
double refundPriceExpressSum = kylinOrderRefundsMapper.RefundPriceExpressSum(// 已退快递费
Double refundPriceExpressSum = kylinOrderRefundsMapper.RefundPriceExpressSum(// 已退快递费
orderTicketsId,
KylinTableStatusConst.ORDER_REFUND_STATUS_CANCEL
);
if (null == refundPriceExpressSum) {
refundPriceExpressSum = 0.0;
}
if (null == refundApplyParam.getOrderRefundBatchesId() || refundApplyParam.getOrderRefundBatchesId().isEmpty()) { // 不是批量退款
if (RefundPriceExpress > (priceExpress - refundPriceExpressSum)) {
return ResponseDto.failure("快递费不能大于实际减去已退的快递费");
......@@ -145,7 +148,7 @@ public class KylinOrderRefundsServiceImpl extends ServiceImpl<KylinOrderRefundsM
double onePrice = (priceActual - priceExpress) / allEntitiesCount;//单价
List<Double> realRefundPriceList = new ArrayList<>();
if (null == refundApplyParam.getOrderRefundBatchesId() || refundApplyParam.getOrderRefundBatchesId().isEmpty()) { // 不是批量退款
for (int i = 0; i <= ticketEntityIds.size(); i++) {
for (int i = 0; i <= ticketEntityIds.size() -1; i++) {
Double price = entitiesPrice.get(i);
if (price < 0) {
return ResponseDto.failure("退款金额不能为0");
......@@ -155,6 +158,9 @@ public class KylinOrderRefundsServiceImpl extends ServiceImpl<KylinOrderRefundsM
KylinTableStatusConst.ORDER_REFUND_STATUS_CANCEL,
ticketEntityIds.get(i)
);
if (null == refundedPrice) {
refundedPrice = 0.0;
}
if (price > (onePrice - refundedPrice)) {
return ResponseDto.failure("超过可退款金额");
}
......@@ -162,12 +168,15 @@ public class KylinOrderRefundsServiceImpl extends ServiceImpl<KylinOrderRefundsM
}
realRefundPriceList = entitiesPrice;
} else { // 批量 计算入场人订单可退金额
for (int i = 0; i <= ticketEntityIds.size(); i++) {
for (int i = 0; i <= ticketEntityIds.size() - 1; i++) {
Double refundedPrice = kylinOrderTicketEntitiesMapper.getRefundEntitiesPrice(//已退 包含退款中
orderTicketsId,
KylinTableStatusConst.ORDER_REFUND_STATUS_CANCEL,
ticketEntityIds.get(i)
);
if (null == refundedPrice) {
refundedPrice = 0.0;
}
Double price = onePrice - refundedPrice; // 计算可退金额
realRefundPriceList.add(price);
}
......@@ -378,12 +387,17 @@ public class KylinOrderRefundsServiceImpl extends ServiceImpl<KylinOrderRefundsM
);
double onePrice = (priceActual - priceExpress) / allEntitiesCount;//单价
for (KylinOrderTicketEntitiesDao entities : entitiesList) {
double refundedPrice = kylinOrderTicketEntitiesMapper.getRefundEntitiesPrice(//已退 包含退款中
Double refundedPrice = kylinOrderTicketEntitiesMapper.getRefundEntitiesPrice(//已退 包含退款中
kylinOrderTickets.getOrderTicketsId(),
KylinTableStatusConst.ORDER_REFUND_STATUS_CANCEL,
entities.getOrderTicketEntitiesId()
);
double canRefundedPrice = onePrice - refundedPrice;
double canRefundedPrice;
if (null != refundedPrice) {
canRefundedPrice = onePrice - refundedPrice;
} else {
canRefundedPrice = onePrice;
}
entities.setCanRefundedPrice(BigDecimal.valueOf(canRefundedPrice));
}
}
......
......@@ -168,7 +168,7 @@ public class KylinRefundsStatusServiceImpl {
// 退款入场人表
KylinOrderRefundEntities kylinOrderRefundEntities = new KylinOrderRefundEntities();
for (int i = 0; i <= ticketEntityIds.size(); i++) {
for (int i = 0; i <= ticketEntityIds.size() - 1; i++) {
String orderRefundsEntitiesId = IDGenerator.nextSnowId().toString();
kylinOrderRefundEntities.setOrderRefundsEntitiesId(orderRefundsEntitiesId);
kylinOrderRefundEntities.setOrderRefundsId(orderRefundsId);
......@@ -379,6 +379,9 @@ public class KylinRefundsStatusServiceImpl {
KylinTableStatusConst.ORDER_REFUND_STATUS_REFUNDED,
entitiesId
);
if (null == refundedPrice) {
refundedPrice = 0.0;
}
KylinOrderRefundEntities refundEntitiesInfo = kylinOrderRefundsEntitiesMapper.selectOne(
new QueryWrapper<KylinOrderRefundEntities>()
.eq("order_refunds_id", refundInfo.getOrderRefundsId())
......
package com.liquidnet.common.web.config;
import com.liquidnet.common.web.filter.GlobalAuthorityInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
@Configuration
public class WebMvcConfig extends WebMvcConfigurationSupport {
@Autowired
GlobalAuthorityInterceptor globalAuthorityInterceptor;
// @Autowired
// GlobalAuthorityInterceptor globalAuthorityInterceptor;
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
......@@ -29,12 +26,11 @@ public class WebMvcConfig extends WebMvcConfigurationSupport {
super.addResourceHandlers(registry);
}
@Override
protected void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(globalAuthorityInterceptor).addPathPatterns("/**");
// .excludePathPatterns("/*/v2/api-docs*", "/*/swagger-resources/**", "/*/webjars/**", "/*/doc.html");
super.addInterceptors(registry);
}
// @Override
// protected void addInterceptors(InterceptorRegistry registry) {
// registry.addInterceptor(globalAuthorityInterceptor).addPathPatterns("/**");
// super.addInterceptors(registry);
// }
// @Bean
// public FilterRegistrationBean domainCrossFilterBean(){
......
......@@ -35,7 +35,7 @@ public interface KylinOrderRefundsMapper extends BaseMapper<KylinOrderRefunds> {
@Param("ticketEntityIds") List<String> ticketEntityIds
);
double RefundPriceExpressSum(
Double RefundPriceExpressSum(
@Param("orderTicketsId") String orderTicketsId,
@Param("orderRefundStatusCancel") Integer orderRefundStatusCancel
);
......
package com.liquidnet.service.adam.config;
import com.liquidnet.common.web.config.WebMvcConfig;
import com.liquidnet.common.web.filter.GlobalAuthorityInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
@Configuration
public class AdamWebMvcConfig extends WebMvcConfig {
@Autowired
GlobalAuthorityInterceptor globalAuthorityInterceptor;
@Override
protected void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(globalAuthorityInterceptor).addPathPatterns("/**");
super.addInterceptors(registry);
}
}
......@@ -15,17 +15,15 @@
</modules>
<dependencies>
<dependency>
<groupId>com.liquidnet</groupId>
<artifactId>liquidnet-common-service-base</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.xuxueli</groupId>
<artifactId>xxl-job-core</artifactId>
<version>2.3.0</version>
</dependency>
<dependency>
<groupId>com.liquidnet</groupId>
<artifactId>liquidnet-common-web</artifactId>
</dependency>
</dependencies>
......
package com.liquidnet.service.kylin.config;
import com.liquidnet.common.web.config.WebMvcConfig;
import com.liquidnet.common.web.filter.GlobalAuthorityInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
@Configuration
public class KylinWebMvcConfig extends WebMvcConfig {
@Autowired
GlobalAuthorityInterceptor globalAuthorityInterceptor;
@Override
protected void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(globalAuthorityInterceptor).addPathPatterns("/**");
super.addInterceptors(registry);
}
}
......@@ -116,6 +116,9 @@ public class KylinRefundsStatusServiceImpl {
KylinTableStatusConst.ORDER_REFUND_STATUS_REFUNDED,
entitiesId
);
if (null == refundedPrice) {
refundedPrice = 0.0;
}
KylinOrderRefundEntities refundEntitiesInfo = kylinOrderRefundsEntitiesMapper.selectOne(
new QueryWrapper<KylinOrderRefundEntities>()
.eq("order_refunds_id", refundInfo.getOrderRefundsId())
......@@ -293,7 +296,7 @@ public class KylinRefundsStatusServiceImpl {
// 退款入场人表
KylinOrderRefundEntities kylinOrderRefundEntities = new KylinOrderRefundEntities();
for (int i = 0; i <= ticketEntityIds.size(); i++) {
for (int i = 0; i <= ticketEntityIds.size() - 1; i++) {
String orderRefundsEntitiesId = IDGenerator.nextSnowId().toString();
kylinOrderRefundEntities.setOrderRefundsEntitiesId(orderRefundsEntitiesId);
kylinOrderRefundEntities.setOrderRefundsId(orderRefundsId);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment