一号通平台功能优化
This commit is contained in:
@@ -23,7 +23,7 @@
|
||||
<div class="title">订单信息</div>
|
||||
<div class="acea-row">
|
||||
<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.totalPrice}}</div>
|
||||
<div class="description-term">交付邮费:{{orderDatalist.payPostage}}</div>
|
||||
@@ -102,50 +102,50 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { orderDetailApi, getLogisticsInfoApi } from '@/api/order'
|
||||
export default {
|
||||
name: 'OrderDetail',
|
||||
props: {
|
||||
orderId: {
|
||||
type: Number,
|
||||
default: 0
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
reverse: true,
|
||||
dialogVisible: false,
|
||||
orderDatalist: null,
|
||||
loading: false,
|
||||
modal2: false,
|
||||
result: []
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
openLogistics () {
|
||||
this.getOrderData()
|
||||
this.modal2 = true;
|
||||
import { orderDetailApi, getLogisticsInfoApi } from '@/api/order'
|
||||
export default {
|
||||
name: 'OrderDetail',
|
||||
props: {
|
||||
orderId: {
|
||||
type: Number,
|
||||
default: 0
|
||||
}
|
||||
},
|
||||
// 获取订单物流信息
|
||||
getOrderData () {
|
||||
getLogisticsInfoApi({id:this.orderId}).then(async res => {
|
||||
this.result = res.result;
|
||||
})
|
||||
data() {
|
||||
return {
|
||||
reverse: true,
|
||||
dialogVisible: false,
|
||||
orderDatalist: null,
|
||||
loading: false,
|
||||
modal2: false,
|
||||
result: []
|
||||
}
|
||||
},
|
||||
getDetail(id) {
|
||||
this.loading = true
|
||||
orderDetailApi({id: id}).then(res => {
|
||||
this.orderDatalist = res
|
||||
this.loading = false
|
||||
}).catch(() => {
|
||||
this.orderDatalist = null
|
||||
this.loading = false
|
||||
})
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
openLogistics () {
|
||||
this.getOrderData()
|
||||
this.modal2 = true;
|
||||
},
|
||||
// 获取订单物流信息
|
||||
getOrderData () {
|
||||
getLogisticsInfoApi({id:this.orderId}).then(async res => {
|
||||
this.result = res.list;
|
||||
})
|
||||
},
|
||||
getDetail(id) {
|
||||
this.loading = true
|
||||
orderDetailApi({id: id}).then(res => {
|
||||
this.orderDatalist = res
|
||||
this.loading = false
|
||||
}).catch(() => {
|
||||
this.orderDatalist = null
|
||||
this.loading = false
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
sortable
|
||||
/>
|
||||
<el-table-column
|
||||
label="状态"
|
||||
label="是否显示"
|
||||
min-width="100"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
@@ -61,11 +61,13 @@
|
||||
label="操作"
|
||||
>
|
||||
<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>-->
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-table>`
|
||||
<div class="block-pagination">
|
||||
<el-pagination
|
||||
:page-sizes="[20, 40, 60, 80]"
|
||||
@@ -97,10 +99,10 @@
|
||||
<el-form-item label="排序" prop="sort">
|
||||
<el-input-number v-model="formData.sort" :min="0" :max="9999" label="排序"></el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否启用" prop="isShow">
|
||||
<el-radio-group v-model="formData.isShow">
|
||||
<el-radio :label="false">隐藏</el-radio>
|
||||
<el-radio :label="true">启用</el-radio>
|
||||
<el-form-item label="是否启用" prop="status">
|
||||
<el-radio-group v-model="formData.status">
|
||||
<el-radio :label="false">关闭</el-radio>
|
||||
<el-radio :label="true">开启</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
@@ -113,144 +115,143 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import parser from '@/components/FormGenerator/components/parser/Parser'
|
||||
import * as systemFormConfigApi from '@/api/systemFormConfig.js'
|
||||
import * as logistics from '@/api/logistics.js'
|
||||
import * as constants from '@/utils/constants.js'
|
||||
export default {
|
||||
name: 'CompanyList',
|
||||
components: { parser },
|
||||
data() {
|
||||
return {
|
||||
constants,
|
||||
// 表单
|
||||
formConf: { fields: [] },
|
||||
form: {
|
||||
keywords: ''
|
||||
},
|
||||
tableData: {},
|
||||
page: 1,
|
||||
limit: 20,
|
||||
loading: false,
|
||||
dialogVisible: false,
|
||||
fromType: 'add',
|
||||
formData: {
|
||||
isShow: false
|
||||
},
|
||||
isCreate: 0,
|
||||
formShow: false,
|
||||
editId: 0,
|
||||
rules: {
|
||||
sort: [
|
||||
{ required: true, message: '请输入排序', trigger: 'blur' },
|
||||
],
|
||||
account: [
|
||||
{ required: true, message: '请输入月结账号', trigger: 'blur' },
|
||||
],
|
||||
password: [
|
||||
{ required: true, message: '请输入月结密码', trigger: 'blur' },
|
||||
],
|
||||
netName: [
|
||||
{ required: true, message: '请输入网点名称', trigger: 'blur' },
|
||||
]
|
||||
import parser from '@/components/FormGenerator/components/parser/Parser'
|
||||
import * as systemFormConfigApi from '@/api/systemFormConfig.js'
|
||||
import * as logistics from '@/api/logistics.js'
|
||||
export default {
|
||||
name: 'CompanyList',
|
||||
components: { parser },
|
||||
data() {
|
||||
return {
|
||||
constants:this.$constants,
|
||||
// 表单
|
||||
formConf: { fields: [] },
|
||||
form: {
|
||||
keywords: ''
|
||||
},
|
||||
tableData: {},
|
||||
page: 1,
|
||||
limit: 20,
|
||||
loading: false,
|
||||
dialogVisible: false,
|
||||
fromType: 'add',
|
||||
formData: {
|
||||
status: false
|
||||
},
|
||||
isCreate: 0,
|
||||
formShow: false,
|
||||
editId: 0,
|
||||
rules: {
|
||||
sort: [
|
||||
{ required: true, message: '请输入排序', trigger: 'blur' },
|
||||
],
|
||||
account: [
|
||||
{ required: true, message: '请输入月结账号', trigger: 'blur' },
|
||||
],
|
||||
password: [
|
||||
{ required: true, message: '请输入月结密码', trigger: 'blur' },
|
||||
],
|
||||
netName: [
|
||||
{ required: true, message: '请输入网点名称', trigger: 'blur' },
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getExpressList()
|
||||
},
|
||||
methods: {
|
||||
handlerSearch() {
|
||||
this.page = 1
|
||||
},
|
||||
created() {
|
||||
this.getExpressList()
|
||||
},
|
||||
// 获取物流公司列表
|
||||
getExpressList() {
|
||||
this.loading = true
|
||||
logistics.expressList({
|
||||
page: this.page,
|
||||
limit: this.limit,
|
||||
keywords: this.form.keywords
|
||||
}).then(res => {
|
||||
this.loading = false
|
||||
this.tableData = res
|
||||
}).catch(()=>{
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
// 物流开关
|
||||
bindStatus(item) {
|
||||
logistics.expressUpdateShow({
|
||||
account: item.account,
|
||||
code: item.code,
|
||||
id: item.id,
|
||||
isShow: item.isShow,
|
||||
name: item.name,
|
||||
sort: item.sort
|
||||
}).then(res => {
|
||||
this.$message.success('操作成功')
|
||||
this.getExpressList()
|
||||
}).catch(() => {
|
||||
item.isShow = !item.isShow
|
||||
})
|
||||
},
|
||||
// 分页
|
||||
pageChange(e) {
|
||||
this.page = e
|
||||
this.getExpressList()
|
||||
},
|
||||
handleSizeChange(e) {
|
||||
this.limit = e
|
||||
this.getExpressList()
|
||||
},
|
||||
// 添加物流公司
|
||||
addExpress() {
|
||||
logistics.expressSyncApi().then(data => {
|
||||
methods: {
|
||||
handlerSearch() {
|
||||
this.page = 1
|
||||
this.getExpressList()
|
||||
})
|
||||
},
|
||||
// 删除物流公司
|
||||
bindDelete(item) {
|
||||
this.$modalSure().then(() => {
|
||||
logistics.expressDelete({ id: item.id }).then(res => {
|
||||
this.$message.success('删除成功')
|
||||
},
|
||||
// 获取物流公司列表
|
||||
getExpressList() {
|
||||
this.loading = true
|
||||
logistics.expressList({
|
||||
page: this.page,
|
||||
limit: this.limit,
|
||||
keywords: this.form.keywords
|
||||
}).then(res => {
|
||||
this.loading = false
|
||||
this.tableData = res
|
||||
}).catch(()=>{
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
// 物流开关
|
||||
bindStatus(item) {
|
||||
logistics.expressUpdateShow({
|
||||
account: item.account,
|
||||
code: item.code,
|
||||
id: item.id,
|
||||
isShow: item.isShow,
|
||||
name: item.name,
|
||||
sort: item.sort
|
||||
}).then(res => {
|
||||
this.$message.success('操作成功')
|
||||
this.getExpressList()
|
||||
}).catch(() => {
|
||||
item.isShow = !item.isShow
|
||||
})
|
||||
},
|
||||
// 分页
|
||||
pageChange(e) {
|
||||
this.page = e
|
||||
this.getExpressList()
|
||||
},
|
||||
handleSizeChange(e) {
|
||||
this.limit = e
|
||||
this.getExpressList()
|
||||
},
|
||||
// 添加物流公司
|
||||
addExpress() {
|
||||
logistics.expressSyncApi().then(data => {
|
||||
this.page = 1
|
||||
this.getExpressList()
|
||||
})
|
||||
})
|
||||
},
|
||||
// 表单提交
|
||||
submit(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
logistics.expressUpdate(this.formData).then(res => {
|
||||
this.$message.success('操作成功')
|
||||
this.handleClose()
|
||||
},
|
||||
// 删除物流公司
|
||||
bindDelete(item) {
|
||||
this.$modalSure().then(() => {
|
||||
logistics.expressDelete({ id: item.id }).then(res => {
|
||||
this.$message.success('删除成功')
|
||||
this.getExpressList()
|
||||
})
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
// 关闭模态框
|
||||
handleClose(done) {
|
||||
this.formShow = false
|
||||
// this.formData = {}
|
||||
this.formConf.fields = []
|
||||
this.dialogVisible = false
|
||||
this.isCreate = 0
|
||||
},
|
||||
// 编辑
|
||||
bindEdit(item) {
|
||||
this.dialogVisible = true
|
||||
this.editId = item.id
|
||||
logistics.expressInfo({ id: item.id }).then(res => {
|
||||
this.formData = res
|
||||
})
|
||||
})
|
||||
},
|
||||
// 表单提交
|
||||
submit(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
logistics.expressUpdate(this.formData).then(res => {
|
||||
this.$message.success('操作成功')
|
||||
this.handleClose()
|
||||
this.getExpressList()
|
||||
})
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
// 关闭模态框
|
||||
handleClose(done) {
|
||||
this.formShow = false
|
||||
// this.formData = {}
|
||||
this.formConf.fields = []
|
||||
this.dialogVisible = false
|
||||
this.isCreate = 0
|
||||
},
|
||||
// 编辑
|
||||
bindEdit(item) {
|
||||
this.dialogVisible = true
|
||||
this.editId = item.id
|
||||
logistics.expressInfo({ id: item.id }).then(res => {
|
||||
this.formData = res
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
@@ -36,6 +36,5 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2;
|
||||
public class CrmebApplication{
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(CrmebApplication.class, args);
|
||||
System.out.println("CRMEB Started!");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -107,15 +107,16 @@ public class ExpressController {
|
||||
public CommonResult<Express> info(@RequestParam(value = "id") Integer id){
|
||||
Express express = expressService.getById(id);
|
||||
return CommonResult.success(express);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询全部物流公司
|
||||
*/
|
||||
@ApiOperation(value = "查询全部物流公司")
|
||||
@RequestMapping(value = "/all", method = RequestMethod.GET)
|
||||
public CommonResult<List<Express>> all() {
|
||||
return CommonResult.success(expressService.findAll());
|
||||
@ApiImplicitParam(name="type", value="类型:normal-普通,elec-电子面单")
|
||||
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));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -11,8 +11,8 @@ import com.zbkj.crmeb.express.request.ExpressUpdateShowRequest;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* ExpressService 接口
|
||||
* +----------------------------------------------------------------------
|
||||
* ExpressService 接口
|
||||
* +----------------------------------------------------------------------
|
||||
* | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
* +----------------------------------------------------------------------
|
||||
* | Copyright (c) 2016~2020 https://www.crmeb.com All rights reserved.
|
||||
@@ -21,17 +21,17 @@ import java.util.List;
|
||||
* +----------------------------------------------------------------------
|
||||
* | Author: CRMEB Team <admin@crmeb.com>
|
||||
* +----------------------------------------------------------------------
|
||||
*/
|
||||
*/
|
||||
public interface ExpressService extends IService<Express> {
|
||||
|
||||
/**
|
||||
* 列表
|
||||
* @param request 搜索条件
|
||||
* @param pageParamRequest 分页类参数
|
||||
* @author Mr.Zhang
|
||||
* @since 2020-04-17
|
||||
* @return List<Express>
|
||||
*/
|
||||
* 列表
|
||||
* @param request 搜索条件
|
||||
* @param pageParamRequest 分页类参数
|
||||
* @author Mr.Zhang
|
||||
* @since 2020-04-17
|
||||
* @return List<Express>
|
||||
*/
|
||||
List<Express> getList(ExpressSearchRequest request, PageParamRequest pageParamRequest);
|
||||
|
||||
Express info(Integer id);
|
||||
@@ -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>
|
||||
* +----------------------------------------------------------------------
|
||||
*/
|
||||
*/
|
||||
@Service
|
||||
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
|
||||
public List<Express> findAll() {
|
||||
public List<Express> findAll(String type) {
|
||||
LambdaQueryWrapper<Express> lqw = new LambdaQueryWrapper<>();
|
||||
lqw.eq(Express::getIsShow, true);
|
||||
lqw.eq(Express::getStatus, true);
|
||||
if (type.equals("elec")) {
|
||||
lqw.eq(Express::getStatus, true);
|
||||
}
|
||||
lqw.orderByDesc(Express::getSort, Express::getId);
|
||||
return dao.selectList(lqw);
|
||||
}
|
||||
@@ -268,4 +271,3 @@ public class ExpressServiceImpl extends ServiceImpl<ExpressDao, Express> impleme
|
||||
public static String st = "mnc7Yay0RsvF70LWX7i6k";
|
||||
public static String sk = "¥bugJEjOmF01hxGr~qj5";
|
||||
}
|
||||
|
||||
|
||||
@@ -26,8 +26,8 @@ import java.util.concurrent.TimeUnit;
|
||||
|
||||
|
||||
/**
|
||||
* ExpressServiceImpl 接口实现
|
||||
* +----------------------------------------------------------------------
|
||||
* ExpressServiceImpl 接口实现
|
||||
* +----------------------------------------------------------------------
|
||||
* | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
* +----------------------------------------------------------------------
|
||||
* | 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>
|
||||
* +----------------------------------------------------------------------
|
||||
*/
|
||||
*/
|
||||
@Data
|
||||
@Service
|
||||
public class LogisticsServiceImpl implements LogisticService {
|
||||
@@ -119,38 +119,14 @@ public class LogisticsServiceImpl implements LogisticService {
|
||||
resultVo.setNumber(queryVo.getNum());
|
||||
resultVo.setExpName(queryVo.getCom());
|
||||
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.getNum());
|
||||
resultVo.setDeliveryStatus(queryVo.getStatus());
|
||||
|
||||
if (CollUtil.isNotEmpty(queryVo.getContent())) {
|
||||
List<LogisticsResultListVo> list = CollUtil.newArrayList();
|
||||
queryVo.getContent().forEach(i -> {
|
||||
LogisticsResultListVo listVo = new LogisticsResultListVo();
|
||||
listVo.setTime(i.getTime());
|
||||
listVo.setStatus(i.getContext());
|
||||
listVo.setStatus(i.getStatus());
|
||||
list.add(listVo);
|
||||
});
|
||||
resultVo.setList(list);
|
||||
@@ -166,7 +142,7 @@ public class LogisticsServiceImpl implements LogisticService {
|
||||
private JSONObject getCache() {
|
||||
Object data = redisUtil.get(getRedisKey() + getExpressNo());
|
||||
if(null != data){
|
||||
return JSONObject.parseObject(data.toString());
|
||||
return JSONObject.parseObject(data.toString());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -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.CommonResult;
|
||||
import com.common.PageParamRequest;
|
||||
import com.constants.Constants;
|
||||
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.system.service.SystemCityService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -45,9 +41,8 @@ public class ExpressController {
|
||||
@ApiOperation(value = "列表")
|
||||
@RequestMapping(value = "/logistics", method = RequestMethod.GET)
|
||||
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 = "是否签收")
|
||||
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;
|
||||
|
||||
@ApiModelProperty(value = "物流公司")
|
||||
|
||||
@@ -32,5 +32,5 @@ public class OnePassLogisticsTrackVo {
|
||||
private String ftime;
|
||||
|
||||
@ApiModelProperty(value = "变动详情")
|
||||
private String context;
|
||||
private String status;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
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 java.io.Serializable;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
@@ -40,9 +38,6 @@ public class StoreProductDescription implements Serializable {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "商品ID")
|
||||
private Integer productId;
|
||||
|
||||
|
||||
@@ -38,8 +38,8 @@ public class StoreOrderRefundRequest {
|
||||
@DecimalMin(value = "0.00", message = "退款金额不能少于0.00")
|
||||
private BigDecimal amount;
|
||||
|
||||
// @ApiModelProperty(value = "status 1 = 直接退款, 2 = 退款后,返回原状态", allowableValues = "range[1,2]")
|
||||
// @Range(min = 1, max = 2, message = "请选择退款状态 1 = 直接退款, 2 = 退款后,返回原状态")
|
||||
// private int type;
|
||||
@ApiModelProperty(value = "status 1 = 直接退款, 2 = 退款后,返回原状态", allowableValues = "range[1,2]")
|
||||
@Range(min = 1, max = 2, message = "请选择退款状态 1 = 直接退款, 2 = 退款后,返回原状态")
|
||||
private int type;
|
||||
|
||||
}
|
||||
|
||||
@@ -760,19 +760,18 @@ public class StoreOrderServiceImpl extends ServiceImpl<StoreOrderDao, StoreOrder
|
||||
|
||||
/** 退款
|
||||
* @param request StoreOrderRefundRequest 退款参数
|
||||
* @author Mr.Zhang
|
||||
* @since 2020-06-10
|
||||
* @return boolean
|
||||
* 这里只处理订单状态
|
||||
* 余额支付需要把余额给用户加回去
|
||||
* 其余处理放入redis中处理
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean refund(StoreOrderRefundRequest request) {
|
||||
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.getRefundPrice().add(request.getAmount()).compareTo(storeOrder.getPayPrice()) > 0) {
|
||||
throw new CrmebException("退款金额大于支付金额,请修改退款金额");
|
||||
}
|
||||
if(storeOrder.getRefundPrice().add(request.getAmount()).compareTo(storeOrder.getPayPrice()) > 0){throw new CrmebException("退款金额大于支付金额,请修改退款金额");}
|
||||
|
||||
|
||||
//用户
|
||||
User user = userService.getById(storeOrder.getUid());
|
||||
@@ -786,45 +785,61 @@ public class StoreOrderServiceImpl extends ServiceImpl<StoreOrderDao, StoreOrder
|
||||
throw new CrmebException("微信申请退款失败!");
|
||||
}
|
||||
}
|
||||
if (storeOrder.getPayType().equals(Constants.PAY_TYPE_YUE)) {
|
||||
UserOperateFundsRequest userOperateFundsRequest = new UserOperateFundsRequest();
|
||||
userOperateFundsRequest.setUid(storeOrder.getUid());
|
||||
userOperateFundsRequest.setValue(request.getAmount());
|
||||
userOperateFundsRequest.setFoundsCategory(Constants.USER_BILL_CATEGORY_MONEY);
|
||||
userOperateFundsRequest.setFoundsType(Constants.ORDER_STATUS_REFUNDED);
|
||||
userOperateFundsRequest.setType(1);
|
||||
userOperateFundsRequest.setTitle(Constants.ORDER_STATUS_STR_REFUNDED);
|
||||
boolean addMoney = userService.updateFounds(userOperateFundsRequest, false); //更新余额
|
||||
if(!addMoney){throw new CrmebException("余额退款失败");}
|
||||
|
||||
//新增日志
|
||||
boolean addBill = userBillService.saveRefundBill(request, user);
|
||||
if(!addBill){throw new CrmebException("余额退款失败");}
|
||||
}
|
||||
|
||||
//修改订单退款状态
|
||||
storeOrder.setRefundStatus(3);
|
||||
if(request.getType() == 1){
|
||||
storeOrder.setRefundStatus(2);
|
||||
}else if(request.getType() == 2){
|
||||
storeOrder.setRefundStatus(0);
|
||||
}else{
|
||||
throw new CrmebException("选择退款状态错误");
|
||||
}
|
||||
storeOrder.setRefundPrice(request.getAmount());
|
||||
|
||||
Boolean execute = transactionTemplate.execute(e -> {
|
||||
updateById(storeOrder);
|
||||
if (storeOrder.getPayType().equals(Constants.PAY_TYPE_YUE)) {
|
||||
// 更新用户金额 TODO 后期要调整
|
||||
UserOperateFundsRequest userOperateFundsRequest = new UserOperateFundsRequest();
|
||||
userOperateFundsRequest.setUid(storeOrder.getUid());
|
||||
userOperateFundsRequest.setValue(request.getAmount());
|
||||
userOperateFundsRequest.setFoundsCategory(Constants.USER_BILL_CATEGORY_MONEY);
|
||||
userOperateFundsRequest.setFoundsType(Constants.ORDER_STATUS_REFUNDED);
|
||||
userOperateFundsRequest.setType(1);
|
||||
userOperateFundsRequest.setTitle(Constants.ORDER_STATUS_STR_REFUNDED);
|
||||
userService.updateFounds(userOperateFundsRequest, false); //更新余额
|
||||
//新增日志
|
||||
userBillService.saveRefundBill(request, user);
|
||||
// 退款task
|
||||
redisUtil.lPush(Constants.ORDER_TASK_REDIS_KEY_AFTER_REFUND_BY_USER, storeOrder.getId());
|
||||
}
|
||||
return Boolean.TRUE;
|
||||
});
|
||||
if(!execute){
|
||||
boolean updateOrder = updateById(storeOrder);
|
||||
if(!updateOrder){
|
||||
storeOrderStatusService.saveRefund(request.getOrderId(), request.getAmount(), "失败");
|
||||
throw new CrmebException("订单更新失败");
|
||||
}
|
||||
// // 小程序订阅消息 退款成功
|
||||
// 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());
|
||||
//退款成功
|
||||
storeOrderStatusService.saveRefund(request.getOrderId(), request.getAmount(), null);
|
||||
|
||||
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) {
|
||||
if (request.getExpressRecordType().equals(1)) {
|
||||
if (request.getExpressRecordType().equals("1")) {
|
||||
if (StrUtil.isBlank(request.getExpressNumber())) throw new CrmebException("请填写快递单号");
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user