mirror of
https://gitee.com/ZhongBangKeJi/crmeb_java.git
synced 2026-04-23 03:58:35 +08:00
一号通平台功能优化
This commit is contained in:
@@ -23,7 +23,7 @@
|
|||||||
<div class="title">订单信息</div>
|
<div class="title">订单信息</div>
|
||||||
<div class="acea-row">
|
<div class="acea-row">
|
||||||
<div class="description-term">订单编号:{{orderDatalist.orderId}}</div>
|
<div class="description-term">订单编号:{{orderDatalist.orderId}}</div>
|
||||||
<div class="description-term" style="color: red">订单状态:{{orderDatalist.status | orderStatusFilter}}</div>
|
<div class="description-term" style="color: red">订单状态:{{orderDatalist.statusStr.value}}</div>
|
||||||
<div class="description-term">商品总数:{{orderDatalist.totalNum}}</div>
|
<div class="description-term">商品总数:{{orderDatalist.totalNum}}</div>
|
||||||
<div class="description-term">商品总价:{{orderDatalist.totalPrice}}</div>
|
<div class="description-term">商品总价:{{orderDatalist.totalPrice}}</div>
|
||||||
<div class="description-term">交付邮费:{{orderDatalist.payPostage}}</div>
|
<div class="description-term">交付邮费:{{orderDatalist.payPostage}}</div>
|
||||||
@@ -102,8 +102,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { orderDetailApi, getLogisticsInfoApi } from '@/api/order'
|
import { orderDetailApi, getLogisticsInfoApi } from '@/api/order'
|
||||||
export default {
|
export default {
|
||||||
name: 'OrderDetail',
|
name: 'OrderDetail',
|
||||||
props: {
|
props: {
|
||||||
orderId: {
|
orderId: {
|
||||||
@@ -131,7 +131,7 @@ export default {
|
|||||||
// 获取订单物流信息
|
// 获取订单物流信息
|
||||||
getOrderData () {
|
getOrderData () {
|
||||||
getLogisticsInfoApi({id:this.orderId}).then(async res => {
|
getLogisticsInfoApi({id:this.orderId}).then(async res => {
|
||||||
this.result = res.result;
|
this.result = res.list;
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getDetail(id) {
|
getDetail(id) {
|
||||||
@@ -145,7 +145,7 @@ export default {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
|||||||
@@ -40,7 +40,7 @@
|
|||||||
sortable
|
sortable
|
||||||
/>
|
/>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="状态"
|
label="是否显示"
|
||||||
min-width="100"
|
min-width="100"
|
||||||
>
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
@@ -61,11 +61,13 @@
|
|||||||
label="操作"
|
label="操作"
|
||||||
>
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button type="text" size="small" @click="bindEdit(scope.row)">编辑</el-button>
|
<el-button v-if="scope.row.net" type="text" size="small" @click="bindEdit(scope.row)">收件网点名称编辑</el-button>
|
||||||
|
<el-button v-else-if="scope.row.partnerId" type="text" size="small" @click="bindEdit(scope.row)">月结账号编辑</el-button>
|
||||||
|
<el-button v-else type="text" size="small" @click="bindEdit(scope.row)">编辑</el-button>
|
||||||
<!--<el-button type="text" size="small" @click="bindDelete(scope.row)">删除</el-button>-->
|
<!--<el-button type="text" size="small" @click="bindDelete(scope.row)">删除</el-button>-->
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>`
|
||||||
<div class="block-pagination">
|
<div class="block-pagination">
|
||||||
<el-pagination
|
<el-pagination
|
||||||
:page-sizes="[20, 40, 60, 80]"
|
:page-sizes="[20, 40, 60, 80]"
|
||||||
@@ -97,10 +99,10 @@
|
|||||||
<el-form-item label="排序" prop="sort">
|
<el-form-item label="排序" prop="sort">
|
||||||
<el-input-number v-model="formData.sort" :min="0" :max="9999" label="排序"></el-input-number>
|
<el-input-number v-model="formData.sort" :min="0" :max="9999" label="排序"></el-input-number>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="是否启用" prop="isShow">
|
<el-form-item label="是否启用" prop="status">
|
||||||
<el-radio-group v-model="formData.isShow">
|
<el-radio-group v-model="formData.status">
|
||||||
<el-radio :label="false">隐藏</el-radio>
|
<el-radio :label="false">关闭</el-radio>
|
||||||
<el-radio :label="true">启用</el-radio>
|
<el-radio :label="true">开启</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
@@ -113,16 +115,15 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import parser from '@/components/FormGenerator/components/parser/Parser'
|
import parser from '@/components/FormGenerator/components/parser/Parser'
|
||||||
import * as systemFormConfigApi from '@/api/systemFormConfig.js'
|
import * as systemFormConfigApi from '@/api/systemFormConfig.js'
|
||||||
import * as logistics from '@/api/logistics.js'
|
import * as logistics from '@/api/logistics.js'
|
||||||
import * as constants from '@/utils/constants.js'
|
export default {
|
||||||
export default {
|
|
||||||
name: 'CompanyList',
|
name: 'CompanyList',
|
||||||
components: { parser },
|
components: { parser },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
constants,
|
constants:this.$constants,
|
||||||
// 表单
|
// 表单
|
||||||
formConf: { fields: [] },
|
formConf: { fields: [] },
|
||||||
form: {
|
form: {
|
||||||
@@ -135,7 +136,7 @@ export default {
|
|||||||
dialogVisible: false,
|
dialogVisible: false,
|
||||||
fromType: 'add',
|
fromType: 'add',
|
||||||
formData: {
|
formData: {
|
||||||
isShow: false
|
status: false
|
||||||
},
|
},
|
||||||
isCreate: 0,
|
isCreate: 0,
|
||||||
formShow: false,
|
formShow: false,
|
||||||
@@ -250,7 +251,7 @@ export default {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|||||||
@@ -36,6 +36,5 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2;
|
|||||||
public class CrmebApplication{
|
public class CrmebApplication{
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
SpringApplication.run(CrmebApplication.class, args);
|
SpringApplication.run(CrmebApplication.class, args);
|
||||||
System.out.println("CRMEB Started!");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -114,8 +114,9 @@ public class ExpressController {
|
|||||||
*/
|
*/
|
||||||
@ApiOperation(value = "查询全部物流公司")
|
@ApiOperation(value = "查询全部物流公司")
|
||||||
@RequestMapping(value = "/all", method = RequestMethod.GET)
|
@RequestMapping(value = "/all", method = RequestMethod.GET)
|
||||||
public CommonResult<List<Express>> all() {
|
@ApiImplicitParam(name="type", value="类型:normal-普通,elec-电子面单")
|
||||||
return CommonResult.success(expressService.findAll());
|
public CommonResult<List<Express>> all(@RequestParam(value = "type") String type) {
|
||||||
|
return CommonResult.success(expressService.findAll(type));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -129,6 +130,3 @@ public class ExpressController {
|
|||||||
return CommonResult.success(expressService.template(com));
|
return CommonResult.success(expressService.template(com));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -11,8 +11,8 @@ import com.zbkj.crmeb.express.request.ExpressUpdateShowRequest;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ExpressService 接口
|
* ExpressService 接口
|
||||||
* +----------------------------------------------------------------------
|
* +----------------------------------------------------------------------
|
||||||
* | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
* | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||||
* +----------------------------------------------------------------------
|
* +----------------------------------------------------------------------
|
||||||
* | Copyright (c) 2016~2020 https://www.crmeb.com All rights reserved.
|
* | Copyright (c) 2016~2020 https://www.crmeb.com All rights reserved.
|
||||||
@@ -21,7 +21,7 @@ import java.util.List;
|
|||||||
* +----------------------------------------------------------------------
|
* +----------------------------------------------------------------------
|
||||||
* | Author: CRMEB Team <admin@crmeb.com>
|
* | Author: CRMEB Team <admin@crmeb.com>
|
||||||
* +----------------------------------------------------------------------
|
* +----------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
public interface ExpressService extends IService<Express> {
|
public interface ExpressService extends IService<Express> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -53,8 +53,9 @@ public interface ExpressService extends IService<Express> {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询全部快递公司
|
* 查询全部快递公司
|
||||||
|
* @param type 类型:normal-普通,elec-电子面单
|
||||||
*/
|
*/
|
||||||
List<Express> findAll();
|
List<Express> findAll(String type);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询快递公司面单模板
|
* 查询快递公司面单模板
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ import java.util.stream.Collectors;
|
|||||||
* +----------------------------------------------------------------------
|
* +----------------------------------------------------------------------
|
||||||
* | Author: CRMEB Team <admin@crmeb.com>
|
* | Author: CRMEB Team <admin@crmeb.com>
|
||||||
* +----------------------------------------------------------------------
|
* +----------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class ExpressServiceImpl extends ServiceImpl<ExpressDao, Express> implements ExpressService {
|
public class ExpressServiceImpl extends ServiceImpl<ExpressDao, Express> implements ExpressService {
|
||||||
|
|
||||||
@@ -148,12 +148,15 @@ public class ExpressServiceImpl extends ServiceImpl<ExpressDao, Express> impleme
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询全部物流公司
|
* 查询全部物流公司
|
||||||
|
* @param type 类型:normal-普通,elec-电子面单
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<Express> findAll() {
|
public List<Express> findAll(String type) {
|
||||||
LambdaQueryWrapper<Express> lqw = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<Express> lqw = new LambdaQueryWrapper<>();
|
||||||
lqw.eq(Express::getIsShow, true);
|
lqw.eq(Express::getIsShow, true);
|
||||||
|
if (type.equals("elec")) {
|
||||||
lqw.eq(Express::getStatus, true);
|
lqw.eq(Express::getStatus, true);
|
||||||
|
}
|
||||||
lqw.orderByDesc(Express::getSort, Express::getId);
|
lqw.orderByDesc(Express::getSort, Express::getId);
|
||||||
return dao.selectList(lqw);
|
return dao.selectList(lqw);
|
||||||
}
|
}
|
||||||
@@ -268,4 +271,3 @@ public class ExpressServiceImpl extends ServiceImpl<ExpressDao, Express> impleme
|
|||||||
public static String st = "mnc7Yay0RsvF70LWX7i6k";
|
public static String st = "mnc7Yay0RsvF70LWX7i6k";
|
||||||
public static String sk = "¥bugJEjOmF01hxGr~qj5";
|
public static String sk = "¥bugJEjOmF01hxGr~qj5";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -26,8 +26,8 @@ import java.util.concurrent.TimeUnit;
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ExpressServiceImpl 接口实现
|
* ExpressServiceImpl 接口实现
|
||||||
* +----------------------------------------------------------------------
|
* +----------------------------------------------------------------------
|
||||||
* | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
* | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||||
* +----------------------------------------------------------------------
|
* +----------------------------------------------------------------------
|
||||||
* | Copyright (c) 2016~2020 https://www.crmeb.com All rights reserved.
|
* | Copyright (c) 2016~2020 https://www.crmeb.com All rights reserved.
|
||||||
@@ -36,7 +36,7 @@ import java.util.concurrent.TimeUnit;
|
|||||||
* +----------------------------------------------------------------------
|
* +----------------------------------------------------------------------
|
||||||
* | Author: CRMEB Team <admin@crmeb.com>
|
* | Author: CRMEB Team <admin@crmeb.com>
|
||||||
* +----------------------------------------------------------------------
|
* +----------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Service
|
@Service
|
||||||
public class LogisticsServiceImpl implements LogisticService {
|
public class LogisticsServiceImpl implements LogisticService {
|
||||||
@@ -119,38 +119,14 @@ public class LogisticsServiceImpl implements LogisticService {
|
|||||||
resultVo.setNumber(queryVo.getNum());
|
resultVo.setNumber(queryVo.getNum());
|
||||||
resultVo.setExpName(queryVo.getCom());
|
resultVo.setExpName(queryVo.getCom());
|
||||||
resultVo.setIsSign(queryVo.getIscheck());
|
resultVo.setIsSign(queryVo.getIscheck());
|
||||||
switch (queryVo.getStatus()) {
|
|
||||||
case "0":// 在途
|
|
||||||
case "1":// 揽收
|
|
||||||
case "7":// 转单
|
|
||||||
resultVo.setDeliveryStatus("1");
|
|
||||||
break;
|
|
||||||
case "2":// 疑难
|
|
||||||
resultVo.setDeliveryStatus("5");
|
|
||||||
break;
|
|
||||||
case "3":// 签收
|
|
||||||
resultVo.setDeliveryStatus("3");
|
|
||||||
break;
|
|
||||||
case "4":// 退签
|
|
||||||
resultVo.setDeliveryStatus("6");
|
|
||||||
break;
|
|
||||||
case "5":// 派件
|
|
||||||
resultVo.setDeliveryStatus("2");
|
|
||||||
break;
|
|
||||||
case "6":// 退回
|
|
||||||
resultVo.setDeliveryStatus("6");
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
resultVo.setDeliveryStatus(queryVo.getStatus());
|
resultVo.setDeliveryStatus(queryVo.getStatus());
|
||||||
}
|
|
||||||
resultVo.setDeliveryStatus(queryVo.getNum());
|
|
||||||
|
|
||||||
if (CollUtil.isNotEmpty(queryVo.getContent())) {
|
if (CollUtil.isNotEmpty(queryVo.getContent())) {
|
||||||
List<LogisticsResultListVo> list = CollUtil.newArrayList();
|
List<LogisticsResultListVo> list = CollUtil.newArrayList();
|
||||||
queryVo.getContent().forEach(i -> {
|
queryVo.getContent().forEach(i -> {
|
||||||
LogisticsResultListVo listVo = new LogisticsResultListVo();
|
LogisticsResultListVo listVo = new LogisticsResultListVo();
|
||||||
listVo.setTime(i.getTime());
|
listVo.setTime(i.getTime());
|
||||||
listVo.setStatus(i.getContext());
|
listVo.setStatus(i.getStatus());
|
||||||
list.add(listVo);
|
list.add(listVo);
|
||||||
});
|
});
|
||||||
resultVo.setList(list);
|
resultVo.setList(list);
|
||||||
@@ -191,4 +167,3 @@ public class LogisticsServiceImpl implements LogisticService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,12 +3,8 @@ package com.zbkj.crmeb.front.controller;
|
|||||||
|
|
||||||
import com.common.CommonPage;
|
import com.common.CommonPage;
|
||||||
import com.common.CommonResult;
|
import com.common.CommonResult;
|
||||||
import com.common.PageParamRequest;
|
|
||||||
import com.constants.Constants;
|
|
||||||
import com.zbkj.crmeb.express.model.Express;
|
import com.zbkj.crmeb.express.model.Express;
|
||||||
import com.zbkj.crmeb.express.request.ExpressSearchRequest;
|
|
||||||
import com.zbkj.crmeb.express.service.ExpressService;
|
import com.zbkj.crmeb.express.service.ExpressService;
|
||||||
import com.zbkj.crmeb.system.service.SystemCityService;
|
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@@ -45,9 +41,8 @@ public class ExpressController {
|
|||||||
@ApiOperation(value = "列表")
|
@ApiOperation(value = "列表")
|
||||||
@RequestMapping(value = "/logistics", method = RequestMethod.GET)
|
@RequestMapping(value = "/logistics", method = RequestMethod.GET)
|
||||||
public CommonResult<CommonPage<Express>> register(){
|
public CommonResult<CommonPage<Express>> register(){
|
||||||
return CommonResult.success(CommonPage.restPage(expressService.findAll()));
|
return CommonResult.success(CommonPage.restPage(expressService.findAll("normal")));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ public class OnePassLogisticsQueryVo {
|
|||||||
@ApiModelProperty(value = "是否签收")
|
@ApiModelProperty(value = "是否签收")
|
||||||
private String ischeck;
|
private String ischeck;
|
||||||
|
|
||||||
@ApiModelProperty(value = "物流状态:0在途,1揽收,2疑难,3签收,4退签,5派件,6退回,7转单,10待清关,11清关中,12已清关,13清关异常,14收件人拒签")
|
@ApiModelProperty(value = "物流状态:0:快递收件(揽件)1.在途中 2.正在派件 3.已签收 4.派送失败 5.疑难件 6.退件签收 ")
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
@ApiModelProperty(value = "物流公司")
|
@ApiModelProperty(value = "物流公司")
|
||||||
|
|||||||
@@ -32,5 +32,5 @@ public class OnePassLogisticsTrackVo {
|
|||||||
private String ftime;
|
private String ftime;
|
||||||
|
|
||||||
@ApiModelProperty(value = "变动详情")
|
@ApiModelProperty(value = "变动详情")
|
||||||
private String context;
|
private String status;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
package com.zbkj.crmeb.store.model;
|
package com.zbkj.crmeb.store.model;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
@@ -40,9 +38,6 @@ public class StoreProductDescription implements Serializable {
|
|||||||
this.type = type;
|
this.type = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
@TableId(value = "id", type = IdType.AUTO)
|
|
||||||
private Integer id;
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "商品ID")
|
@ApiModelProperty(value = "商品ID")
|
||||||
private Integer productId;
|
private Integer productId;
|
||||||
|
|
||||||
|
|||||||
@@ -38,8 +38,8 @@ public class StoreOrderRefundRequest {
|
|||||||
@DecimalMin(value = "0.00", message = "退款金额不能少于0.00")
|
@DecimalMin(value = "0.00", message = "退款金额不能少于0.00")
|
||||||
private BigDecimal amount;
|
private BigDecimal amount;
|
||||||
|
|
||||||
// @ApiModelProperty(value = "status 1 = 直接退款, 2 = 退款后,返回原状态", allowableValues = "range[1,2]")
|
@ApiModelProperty(value = "status 1 = 直接退款, 2 = 退款后,返回原状态", allowableValues = "range[1,2]")
|
||||||
// @Range(min = 1, max = 2, message = "请选择退款状态 1 = 直接退款, 2 = 退款后,返回原状态")
|
@Range(min = 1, max = 2, message = "请选择退款状态 1 = 直接退款, 2 = 退款后,返回原状态")
|
||||||
// private int type;
|
private int type;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -760,19 +760,18 @@ public class StoreOrderServiceImpl extends ServiceImpl<StoreOrderDao, StoreOrder
|
|||||||
|
|
||||||
/** 退款
|
/** 退款
|
||||||
* @param request StoreOrderRefundRequest 退款参数
|
* @param request StoreOrderRefundRequest 退款参数
|
||||||
|
* @author Mr.Zhang
|
||||||
|
* @since 2020-06-10
|
||||||
* @return boolean
|
* @return boolean
|
||||||
* 这里只处理订单状态
|
|
||||||
* 余额支付需要把余额给用户加回去
|
|
||||||
* 其余处理放入redis中处理
|
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public boolean refund(StoreOrderRefundRequest request) {
|
public boolean refund(StoreOrderRefundRequest request) {
|
||||||
StoreOrder storeOrder = getById(request.getOrderId());
|
StoreOrder storeOrder = getById(request.getOrderId());
|
||||||
if(ObjectUtil.isNull(storeOrder)){throw new CrmebException("未查到订单");}
|
if(null == storeOrder){throw new CrmebException("未查到订单");}
|
||||||
if(!storeOrder.getPaid()){throw new CrmebException("未支付无法退款");}
|
if(!storeOrder.getPaid()){throw new CrmebException("未支付无法退款");}
|
||||||
if(storeOrder.getRefundPrice().add(request.getAmount()).compareTo(storeOrder.getPayPrice()) > 0) {
|
if(storeOrder.getRefundPrice().add(request.getAmount()).compareTo(storeOrder.getPayPrice()) > 0){throw new CrmebException("退款金额大于支付金额,请修改退款金额");}
|
||||||
throw new CrmebException("退款金额大于支付金额,请修改退款金额");
|
|
||||||
}
|
|
||||||
|
|
||||||
//用户
|
//用户
|
||||||
User user = userService.getById(storeOrder.getUid());
|
User user = userService.getById(storeOrder.getUid());
|
||||||
@@ -786,15 +785,7 @@ public class StoreOrderServiceImpl extends ServiceImpl<StoreOrderDao, StoreOrder
|
|||||||
throw new CrmebException("微信申请退款失败!");
|
throw new CrmebException("微信申请退款失败!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//修改订单退款状态
|
|
||||||
storeOrder.setRefundStatus(3);
|
|
||||||
storeOrder.setRefundPrice(request.getAmount());
|
|
||||||
|
|
||||||
Boolean execute = transactionTemplate.execute(e -> {
|
|
||||||
updateById(storeOrder);
|
|
||||||
if (storeOrder.getPayType().equals(Constants.PAY_TYPE_YUE)) {
|
if (storeOrder.getPayType().equals(Constants.PAY_TYPE_YUE)) {
|
||||||
// 更新用户金额 TODO 后期要调整
|
|
||||||
UserOperateFundsRequest userOperateFundsRequest = new UserOperateFundsRequest();
|
UserOperateFundsRequest userOperateFundsRequest = new UserOperateFundsRequest();
|
||||||
userOperateFundsRequest.setUid(storeOrder.getUid());
|
userOperateFundsRequest.setUid(storeOrder.getUid());
|
||||||
userOperateFundsRequest.setValue(request.getAmount());
|
userOperateFundsRequest.setValue(request.getAmount());
|
||||||
@@ -802,29 +793,53 @@ public class StoreOrderServiceImpl extends ServiceImpl<StoreOrderDao, StoreOrder
|
|||||||
userOperateFundsRequest.setFoundsType(Constants.ORDER_STATUS_REFUNDED);
|
userOperateFundsRequest.setFoundsType(Constants.ORDER_STATUS_REFUNDED);
|
||||||
userOperateFundsRequest.setType(1);
|
userOperateFundsRequest.setType(1);
|
||||||
userOperateFundsRequest.setTitle(Constants.ORDER_STATUS_STR_REFUNDED);
|
userOperateFundsRequest.setTitle(Constants.ORDER_STATUS_STR_REFUNDED);
|
||||||
userService.updateFounds(userOperateFundsRequest, false); //更新余额
|
boolean addMoney = userService.updateFounds(userOperateFundsRequest, false); //更新余额
|
||||||
|
if(!addMoney){throw new CrmebException("余额退款失败");}
|
||||||
|
|
||||||
//新增日志
|
//新增日志
|
||||||
userBillService.saveRefundBill(request, user);
|
boolean addBill = userBillService.saveRefundBill(request, user);
|
||||||
// 退款task
|
if(!addBill){throw new CrmebException("余额退款失败");}
|
||||||
redisUtil.lPush(Constants.ORDER_TASK_REDIS_KEY_AFTER_REFUND_BY_USER, storeOrder.getId());
|
|
||||||
}
|
}
|
||||||
return Boolean.TRUE;
|
|
||||||
});
|
//修改订单退款状态
|
||||||
if(!execute){
|
if(request.getType() == 1){
|
||||||
|
storeOrder.setRefundStatus(2);
|
||||||
|
}else if(request.getType() == 2){
|
||||||
|
storeOrder.setRefundStatus(0);
|
||||||
|
}else{
|
||||||
|
throw new CrmebException("选择退款状态错误");
|
||||||
|
}
|
||||||
|
storeOrder.setRefundPrice(request.getAmount());
|
||||||
|
boolean updateOrder = updateById(storeOrder);
|
||||||
|
if(!updateOrder){
|
||||||
storeOrderStatusService.saveRefund(request.getOrderId(), request.getAmount(), "失败");
|
storeOrderStatusService.saveRefund(request.getOrderId(), request.getAmount(), "失败");
|
||||||
throw new CrmebException("订单更新失败");
|
throw new CrmebException("订单更新失败");
|
||||||
}
|
}
|
||||||
// // 小程序订阅消息 退款成功
|
//退款成功
|
||||||
// String storeNameAndCarNumString = orderUtils.getStoreNameAndCarNumString(storeOrder.getId());
|
storeOrderStatusService.saveRefund(request.getOrderId(), request.getAmount(), null);
|
||||||
// WechatSendMessageForReFundEd forReFundEd = new WechatSendMessageForReFundEd(
|
|
||||||
// "退款成功",storeNameAndCarNumString,request.getAmount()+"",DateUtil.nowDateTimeStr(),"退款金额已到余额中",
|
|
||||||
// storeOrder.getOrderId(),storeOrder.getId()+"",storeOrder.getCreateTime()+"",storeOrder.getRefundPrice()+"",
|
|
||||||
// storeNameAndCarNumString,storeOrder.getRefundReason(),"CRMEB",storeOrder.getRefundReasonWapExplain(),
|
|
||||||
// "暂无"
|
|
||||||
// );
|
|
||||||
// wechatSendMessageForMinService.sendReFundEdMessage(forReFundEd, userService.getUserIdException());
|
|
||||||
|
|
||||||
return execute;
|
//佣金
|
||||||
|
subtractBill(request, Constants.USER_BILL_CATEGORY_MONEY,
|
||||||
|
Constants.USER_BILL_TYPE_BROKERAGE, Constants.USER_BILL_CATEGORY_BROKERAGE_PRICE);
|
||||||
|
|
||||||
|
//积分
|
||||||
|
subtractBill(request, Constants.USER_BILL_CATEGORY_INTEGRAL,
|
||||||
|
Constants.USER_BILL_TYPE_GAIN, Constants.USER_BILL_CATEGORY_INTEGRAL);
|
||||||
|
|
||||||
|
// 回滚库存 后续操作放入redis
|
||||||
|
redisUtil.lPush(Constants.ORDER_TASK_REDIS_KEY_AFTER_REFUND_BY_USER, storeOrder.getId());
|
||||||
|
|
||||||
|
// 小程序订阅消息 退款成功
|
||||||
|
String storeNameAndCarNumString = orderUtils.getStoreNameAndCarNumString(storeOrder.getId());
|
||||||
|
WechatSendMessageForReFundEd forReFundEd = new WechatSendMessageForReFundEd(
|
||||||
|
"退款成功",storeNameAndCarNumString,request.getAmount()+"",DateUtil.nowDateTimeStr(),"退款金额已到余额中",
|
||||||
|
storeOrder.getOrderId(),storeOrder.getId()+"",storeOrder.getCreateTime()+"",storeOrder.getRefundPrice()+"",
|
||||||
|
storeNameAndCarNumString,storeOrder.getRefundReason(),"CRMEB",storeOrder.getRefundReasonWapExplain(),
|
||||||
|
"暂无"
|
||||||
|
);
|
||||||
|
wechatSendMessageForMinService.sendReFundEdMessage(forReFundEd, userService.getUserIdException());
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 订单详情
|
/** 订单详情
|
||||||
@@ -1435,7 +1450,7 @@ public class StoreOrderServiceImpl extends ServiceImpl<StoreOrderDao, StoreOrder
|
|||||||
* 校验快递发货参数
|
* 校验快递发货参数
|
||||||
*/
|
*/
|
||||||
private void validateExpressSend(StoreOrderSendRequest request) {
|
private void validateExpressSend(StoreOrderSendRequest request) {
|
||||||
if (request.getExpressRecordType().equals(1)) {
|
if (request.getExpressRecordType().equals("1")) {
|
||||||
if (StrUtil.isBlank(request.getExpressNumber())) throw new CrmebException("请填写快递单号");
|
if (StrUtil.isBlank(request.getExpressNumber())) throw new CrmebException("请填写快递单号");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user