新增dou订单确认发货;
This commit is contained in:
parent
00b2ab5e1d
commit
41b46753c9
|
|
@ -1,6 +1,7 @@
|
|||
package cn.qihangerp.api.dou.controller;
|
||||
|
||||
|
||||
import cn.qihangerp.module.open.dou.bo.DouOrderConfirmBo;
|
||||
import cn.qihangerp.common.AjaxResult;
|
||||
import cn.qihangerp.common.PageQuery;
|
||||
import cn.qihangerp.common.PageResult;
|
||||
|
|
@ -14,9 +15,12 @@ import cn.qihangerp.model.bo.DouOrderBo;
|
|||
import cn.qihangerp.model.bo.DouOrderPushBo;
|
||||
import cn.qihangerp.module.open.dou.service.DouOrderService;
|
||||
import cn.qihangerp.security.common.BaseController;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@Slf4j
|
||||
@AllArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/dou/order")
|
||||
|
|
@ -52,4 +56,23 @@ public class DouOrderContoller extends BaseController {
|
|||
}
|
||||
return success();
|
||||
}
|
||||
|
||||
@PostMapping("/confirmOrder")
|
||||
public AjaxResult confirmOrder(@RequestBody DouOrderConfirmBo bo) {
|
||||
log.info("=========确认订单======={}", JSONObject.toJSONString(bo));
|
||||
// bo.setUpdateBy(getUsername());
|
||||
var result = orderService.confirmOrder(bo);
|
||||
if(result.getCode()==0) return success();
|
||||
else return AjaxResult.error(result.getMsg());
|
||||
// if(result == -1) return new AjaxResult(501,"已确认过了!请勿重复确认!");
|
||||
// else if(result == -2) return new AjaxResult(502,"订单已存在!请勿重复确认!");
|
||||
// else if(result == -3) return new AjaxResult(503,"请指定发货方式!");
|
||||
// else if(result == -4) return new AjaxResult(504,"发货方式不支持!");
|
||||
// else if(result == -11) return new AjaxResult(511,"商品SKU编码不存在!");
|
||||
// else if(result == -12) return new AjaxResult(512,"商品信息不存在!");
|
||||
//
|
||||
//
|
||||
// return toAjax(result);
|
||||
// return AjaxResult.error("未实现");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,31 @@
|
|||
package cn.qihangerp.module.open.dou.bo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class DouOrderConfirmBo {
|
||||
private Long orderId;
|
||||
/**
|
||||
* 收货人的姓名
|
||||
*/
|
||||
private String receiver;
|
||||
|
||||
/**
|
||||
* 收货人的手机号码
|
||||
*/
|
||||
private String mobile;
|
||||
|
||||
private String province;
|
||||
private String city;
|
||||
private String town;
|
||||
/**
|
||||
* 收货人的详细地址
|
||||
*/
|
||||
private String address;
|
||||
|
||||
/**
|
||||
* 发货类型 0仓库发货1供应商代发
|
||||
*/
|
||||
private Integer shipType;
|
||||
|
||||
}
|
||||
|
|
@ -5,6 +5,7 @@ import cn.qihangerp.common.PageResult;
|
|||
import cn.qihangerp.common.ResultVo;
|
||||
import cn.qihangerp.model.entity.DouOrder;
|
||||
import cn.qihangerp.model.bo.DouOrderBo;
|
||||
import cn.qihangerp.module.open.dou.bo.DouOrderConfirmBo;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
|
||||
|
|
@ -25,4 +26,6 @@ public interface DouOrderService extends IService<DouOrder> {
|
|||
* @return
|
||||
*/
|
||||
ResultVo<Integer> saveOrder(Long shopId, DouOrder order);
|
||||
|
||||
ResultVo<Long> confirmOrder(DouOrderConfirmBo taoOrder);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import cn.qihangerp.model.entity.DouGoodsSku;
|
|||
import cn.qihangerp.model.entity.DouOrder;
|
||||
import cn.qihangerp.model.entity.DouOrderItem;
|
||||
import cn.qihangerp.model.bo.DouOrderBo;
|
||||
import cn.qihangerp.module.open.dou.bo.DouOrderConfirmBo;
|
||||
import cn.qihangerp.module.open.dou.mapper.DouGoodsSkuMapper;
|
||||
import cn.qihangerp.module.open.dou.mapper.DouOrderItemMapper;
|
||||
import cn.qihangerp.module.open.dou.mapper.DouOrderMapper;
|
||||
|
|
@ -176,6 +177,11 @@ public class DouOrderServiceImpl extends ServiceImpl<DouOrderMapper, DouOrder>
|
|||
return ResultVo.error(ResultVoEnum.SystemException, "系统异常:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultVo<Long> confirmOrder(DouOrderConfirmBo taoOrder) {
|
||||
return ResultVo.error("未实现");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -51,3 +51,11 @@ export function pushOms(data) {
|
|||
data: data
|
||||
})
|
||||
}
|
||||
// 确认抖店订单
|
||||
export function confirmOrder(data) {
|
||||
return request({
|
||||
url: '/api/open-api/dou/order/confirmOrder',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -175,7 +175,16 @@
|
|||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button style="padding-right: 6px;padding-left: 6px"
|
||||
:loading="pullLoading"
|
||||
v-if="scope.row.auditStatus === 0"
|
||||
size="mini"
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-success"
|
||||
@click="handleConfirm(scope.row)"
|
||||
v-hasPermi="['dou:order:edit']"
|
||||
>确认订单</el-button>
|
||||
<el-button style="padding-right: 6px;padding-left: 6px"
|
||||
:loading="pullLoading" plain
|
||||
size="mini"
|
||||
icon="el-icon-refresh"
|
||||
@click="handlePullUpdate(scope.row)"
|
||||
|
|
@ -192,22 +201,136 @@
|
|||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 订单审核、订单详情对话框 -->
|
||||
<el-dialog :title="detailTitle" :visible.sync="detailOpen" width="1000px" append-to-body >
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="100px" inline>
|
||||
<el-descriptions title="订单信息">
|
||||
<el-descriptions-item label="ID">{{form.id}}</el-descriptions-item>
|
||||
<el-descriptions-item label="订单号">{{form.orderId}}</el-descriptions-item>
|
||||
<el-descriptions-item label="店铺">
|
||||
{{ shopList.find(x=>x.id === form.shopId)?shopList.find(x=>x.id === form.shopId).name:'' }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="订单来源">
|
||||
<el-tag size="small" >{{form.btypeDesc}}</el-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="订单状态">
|
||||
<el-tag size="small" >{{ form.orderStatusDesc }}</el-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="主状态">
|
||||
<el-tag size="small" >{{ form.mainStatusDesc }}</el-tag>
|
||||
</el-descriptions-item>
|
||||
<!-- <el-descriptions-item label="成团状态">-->
|
||||
<!-- <el-tag size="small" v-if="form.groupStatus ===0 ">拼团中</el-tag>-->
|
||||
<!-- <el-tag size="small" v-if="form.groupStatus ===1 ">已成团</el-tag>-->
|
||||
<!-- <el-tag size="small" v-if="form.groupStatus ===2 ">团失败</el-tag>-->
|
||||
<!-- </el-descriptions-item>-->
|
||||
|
||||
|
||||
<el-descriptions-item label="买家备注">
|
||||
{{form.buyerWords}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="卖家备注">
|
||||
{{form.sellerWords}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="取消原因">
|
||||
{{form.cancelReason}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="创建时间">
|
||||
{{ parseTime(form.createTime*1000) }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="支付时间"> {{ parseTime(form.payTime*1000) }}</el-descriptions-item>
|
||||
<el-descriptions-item label="更新时间"> {{ parseTime(form.updateTime*1000) }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<el-descriptions title="付款信息">
|
||||
<!-- <el-descriptions-item label="商品总额">{{form.goodsAmount}}</el-descriptions-item>-->
|
||||
<!-- <el-descriptions-item label="团长免单金额">{{form.capitalFreeDiscount}}</el-descriptions-item>-->
|
||||
<el-descriptions-item label="商家优惠金额">{{form.promotionShopAmount}}</el-descriptions-item>
|
||||
<el-descriptions-item label="平台优惠金额">{{form.promotionTalentAmount}}</el-descriptions-item>
|
||||
<el-descriptions-item label="运费">{{form.postAmount}}</el-descriptions-item>
|
||||
<el-descriptions-item label="实际支付金额">{{form.orderAmount}}</el-descriptions-item>
|
||||
<el-descriptions-item label="支付方式"> {{ form.payAmount }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
|
||||
|
||||
<el-descriptions title="收货信息">
|
||||
<el-descriptions-item label="收件人姓名">{{form.maskPostReceiver}}</el-descriptions-item>
|
||||
<el-descriptions-item label="收件人手机号">{{form.maskPostTel}}</el-descriptions-item>
|
||||
<el-descriptions-item label="省市区">{{form.provinceName}}{{form.cityName}}{{form.townName}}</el-descriptions-item>
|
||||
<el-descriptions-item label="详细地址">{{form.maskPostAddress}}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<!-- <el-descriptions title="发货信息">-->
|
||||
<!-- <!– <el-descriptions-item label="发货方式">-->
|
||||
<!-- <el-tag v-if="form.shipType === 1" type="danger">供应商代发</el-tag>-->
|
||||
<!-- <el-tag v-if="form.shipType === 0" type="danger">仓库发货</el-tag>-->
|
||||
<!-- </el-descriptions-item> –>-->
|
||||
<!-- <el-descriptions-item label="物流公司">{{form.logisticsCompany}}</el-descriptions-item>-->
|
||||
<!-- <el-descriptions-item label="物流单号">{{form.logisticsCode}}</el-descriptions-item>-->
|
||||
<!-- <el-descriptions-item label="发货时间">{{form.logisticsTime}}</el-descriptions-item>-->
|
||||
<!-- </el-descriptions>-->
|
||||
<el-divider content-position="center">订单商品</el-divider>
|
||||
<el-table :data="form.items" style="margin-bottom: 10px;">
|
||||
<el-table-column label="序号" align="center" type="index" width="50"/>
|
||||
|
||||
<el-table-column label="商品图片" width="80">
|
||||
<template slot-scope="scope">
|
||||
<el-image style="width: 70px; height: 70px" :src="scope.row.productPic"></el-image>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="商品标题" prop="productName" ></el-table-column>
|
||||
<el-table-column label="SKU" prop="goodsSpec" width="150"></el-table-column>
|
||||
<el-table-column label="sku编码" prop="specNum"></el-table-column>
|
||||
<el-table-column label="单价" prop="goodsPrice"></el-table-column>
|
||||
<el-table-column label="数量" prop="comboNum"></el-table-column>
|
||||
<el-table-column label="商品金额" prop="totalAmount"></el-table-column>
|
||||
</el-table>
|
||||
|
||||
<el-divider content-position="center" v-if="isAudit" >收件人</el-divider>
|
||||
|
||||
<el-form-item label="收件人姓名" prop="maskPostReceiver" v-if="isAudit">
|
||||
<el-input v-model="form.maskPostReceiver" placeholder="请输入收件人姓名" style="width:350px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="收件人电话" prop="maskPostTel" v-if="isAudit">
|
||||
<el-input v-model="form.maskPostTel" placeholder="请输入收件人电话" style="width:350px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="省市区" prop="provinces" v-if="isAudit">
|
||||
<el-cascader style="width:350px"
|
||||
size="large"
|
||||
:options="pcaTextArr"
|
||||
v-model="form.provinces">
|
||||
</el-cascader>
|
||||
</el-form-item>
|
||||
<el-form-item label="详细地址" prop="maskPostAddress" v-if="isAudit">
|
||||
<el-input v-model="form.maskPostAddress" placeholder="请输入收件地址" style="width:350px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="发货方式" prop="shipType" v-if="isAudit">
|
||||
<el-select v-model="form.shipType" placeholder="发货类型" style="width:350px">
|
||||
<el-option label="供应商代发" value="1"></el-option>
|
||||
<el-option label="仓库发货" value="0"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer" v-if="isAudit">
|
||||
<el-button type="primary" @click="submitConfirmForm">确认发货</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {listOrder, pullOrder, getOrder, pushOms, pullOrderDetail} from "@/api/dou/order";
|
||||
import {listOrder, pullOrder, getOrder, pushOms, pullOrderDetail,confirmOrder} from "@/api/dou/order";
|
||||
import { listShop } from "@/api/shop/shop";
|
||||
import { searchSku } from "@/api/goods/goods";
|
||||
import {MessageBox} from "element-ui";
|
||||
import {isRelogin} from "../../../utils/request";
|
||||
import Clipboard from "clipboard";
|
||||
import {pcaTextArr} from "element-china-area-data";
|
||||
|
||||
export default {
|
||||
name: "OrderDou",
|
||||
data() {
|
||||
return {
|
||||
pcaTextArr,
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 显示搜索条件
|
||||
|
|
@ -218,7 +341,9 @@ export default {
|
|||
// 非单个禁用
|
||||
single: true,
|
||||
detailOpen: false,
|
||||
isAudit: false,
|
||||
multiple: true,
|
||||
detailTitle:'',
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 淘宝订单表格数据
|
||||
|
|
@ -239,6 +364,11 @@ export default {
|
|||
form: {
|
||||
},
|
||||
rules: {
|
||||
maskPostReceiver: [{ required: true, message: '不能为空' }],
|
||||
maskPostTel: [{ required: true, message: '不能为空' }],
|
||||
provinces: [{ required: true, message: '不能为空' }],
|
||||
maskPostAddress: [{ required: true, message: '不能为空' }],
|
||||
shipType: [{ required: true, message: '不能为空' }],
|
||||
}
|
||||
};
|
||||
},
|
||||
|
|
@ -320,18 +450,6 @@ export default {
|
|||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
handlePullDetailByTid(){
|
||||
if(this.queryParams.shopId && this.queryParams.orderId) {
|
||||
this.pullLoading = true
|
||||
pullOrderDetail({shopId:this.queryParams.shopId,orderId:this.queryParams.orderId}).then(response => {
|
||||
console.log('拉取淘宝订单接口返回=====',response)
|
||||
this.$modal.msgSuccess(JSON.stringify(response));
|
||||
this.pullLoading = false
|
||||
})
|
||||
}else{
|
||||
this.$modal.msgSuccess("请先输入订单号并且选择店铺");
|
||||
}
|
||||
},
|
||||
handlePull() {
|
||||
if(this.queryParams.shopId){
|
||||
this.pullLoading = true
|
||||
|
|
@ -377,7 +495,7 @@ export default {
|
|||
const id = row.id || this.ids
|
||||
getOrder(id).then(response => {
|
||||
this.form = response.data;
|
||||
this.goodsList = response.data.taoOrderItemList;
|
||||
console.log('=======详情=====',response.data)
|
||||
this.detailOpen = true;
|
||||
this.detailTitle = "订单详情";
|
||||
});
|
||||
|
|
@ -400,6 +518,43 @@ export default {
|
|||
this.$modal.msgSuccess("推送成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
handleConfirm(row) {
|
||||
this.reset();
|
||||
const id = row.id || this.ids
|
||||
getOrder(id).then(response => {
|
||||
this.form = response.data;
|
||||
this.form.provinces = []
|
||||
this.form.provinces.push(response.data.provinceName)
|
||||
this.form.provinces.push(response.data.cityName)
|
||||
this.form.provinces.push(response.data.townName)
|
||||
this.detailOpen = true;
|
||||
this.detailTitle = "确认订单";
|
||||
this.isAudit = true
|
||||
});
|
||||
},
|
||||
submitConfirmForm(){
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
const form = {
|
||||
orderId:this.form.id,
|
||||
province:this.form.provinces[0],
|
||||
city:this.form.provinces[1],
|
||||
town:this.form.provinces[2],
|
||||
address:this.form.maskPostAddress,
|
||||
receiver:this.form.maskPostReceiver,
|
||||
mobile:this.form.maskPostTel
|
||||
}
|
||||
|
||||
confirmOrder(form).then(response => {
|
||||
this.$modal.msgSuccess("订单确认成功");
|
||||
this.detailOpen = false;
|
||||
this.isAudit = false
|
||||
this.getList();
|
||||
});
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Reference in New Issue