修复bug
This commit is contained in:
parent
ff4bac773b
commit
a7342e7be7
|
|
@ -0,0 +1,85 @@
|
||||||
|
package cn.qihangerp.api.dou.controller;
|
||||||
|
|
||||||
|
import cn.qihangerp.api.dou.DouApiCommon;
|
||||||
|
import cn.qihangerp.common.AjaxResult;
|
||||||
|
import cn.qihangerp.common.ResultVoEnum;
|
||||||
|
import cn.qihangerp.common.enums.EnumShopType;
|
||||||
|
import cn.qihangerp.common.enums.HttpStatus;
|
||||||
|
import cn.qihangerp.module.open.dou.domain.DouOrder;
|
||||||
|
import cn.qihangerp.module.open.dou.service.DouOrderService;
|
||||||
|
import cn.qihangerp.open.common.ApiResultVo;
|
||||||
|
import cn.qihangerp.open.dou.DouRequest;
|
||||||
|
import cn.qihangerp.sdk.dou.DouTokenApiHelper;
|
||||||
|
import cn.qihangerp.sdk.dou.DouWaybillAccountApiHelper;
|
||||||
|
import cn.qihangerp.sdk.dou.DouWaybillApiHelper;
|
||||||
|
import cn.qihangerp.sdk.dou.model.*;
|
||||||
|
import cn.qihangerp.sdk.dou.request.WaybillApplyRequest;
|
||||||
|
import cn.qihangerp.sdk.dou.request.WaybillCodeRequest;
|
||||||
|
import cn.qihangerp.security.common.BaseController;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.extern.java.Log;
|
||||||
|
import org.springframework.util.StringUtils;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
@Log
|
||||||
|
@AllArgsConstructor
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/dou/ewaybill")
|
||||||
|
public class DouWaybillController extends BaseController {
|
||||||
|
private final DouApiCommon apiCommon;
|
||||||
|
private final DouOrderService orderService;
|
||||||
|
|
||||||
|
@GetMapping(value = "/get_waybill_account_list")
|
||||||
|
public AjaxResult getWaybillAccountList(Long shopId) throws Exception {
|
||||||
|
return AjaxResult.error("开源版本不支持电子面单功能");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拉取电子面单账号
|
||||||
|
*
|
||||||
|
* @param params
|
||||||
|
* @return
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
@RequestMapping(value = "/pull_waybill_account", method = RequestMethod.POST)
|
||||||
|
public AjaxResult pullWaybillAccount(@RequestBody DouRequest params) throws Exception {
|
||||||
|
return AjaxResult.error("开源版本不支持电子面单功能");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/get_waybill_code")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult getWaybillCode() {
|
||||||
|
return AjaxResult.error("开源版本不支持电子面单功能");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/get_print_data")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult getPrintData() {
|
||||||
|
return AjaxResult.error("开源版本不支持电子面单功能");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/push_print_success")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult pushPrintSuccess() {
|
||||||
|
return AjaxResult.error("开源版本不支持电子面单功能");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发货
|
||||||
|
*
|
||||||
|
* @param
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/push_ship_send")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult pushShipSend() {
|
||||||
|
return AjaxResult.error("开源版本不支持电子面单功能");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,4 +1,16 @@
|
||||||
# 更新日志
|
# 更新日志
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#### v2.6.1
|
||||||
|
+ [ ] 备货清单新增出库功能-减少库存;
|
||||||
|
+ [ ] 供应商备货清单新增手动录入发货物流功能;
|
||||||
|
+ [ ] 新增供应商发货物流录入功能;
|
||||||
|
+ [ ] 新增发货处理订单功能(分配供应商发货、手动发货)
|
||||||
|
+ [ ] 优化电子面单打印功能(打印快递单、发货、面单补打)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### v2.5.4
|
### v2.5.4
|
||||||
**主要更新**
|
**主要更新**
|
||||||
+ 优化数据结构:新增部分字段、更新ID主键;
|
+ 优化数据结构:新增部分字段、更新ID主键;
|
||||||
|
|
@ -10,10 +22,6 @@
|
||||||
+ 优化备货清单功能(仓库发货备货清单、供应商发货备货清单)
|
+ 优化备货清单功能(仓库发货备货清单、供应商发货备货清单)
|
||||||
|
|
||||||
|
|
||||||
#### v2.5.4.25
|
|
||||||
+ [ ] 备货清单新增出库功能-减少库存;
|
|
||||||
+ [ ] 供应商备货清单新增手动录入发货物流功能;
|
|
||||||
+ [ ] 新增供应商发货物流录入功能;
|
|
||||||
|
|
||||||
|
|
||||||
#### v2.5.4.24
|
#### v2.5.4.24
|
||||||
|
|
|
||||||
|
|
@ -290,31 +290,7 @@ export default {
|
||||||
this.multiple = !selection.length
|
this.multiple = !selection.length
|
||||||
},
|
},
|
||||||
openWs() {
|
openWs() {
|
||||||
const ws = new WebSocket('ws://127.0.0.1:13888');
|
this.$modal.msgError("开源版本未实现电子面单相关功能!请自行对接发货");
|
||||||
ws.onopen = () => {
|
|
||||||
console.log('与打印组件建立连接成功: ');
|
|
||||||
// 或打印机
|
|
||||||
ws.send(JSON.stringify({
|
|
||||||
requestID: '1234554',
|
|
||||||
cmd: 'getPrinters',
|
|
||||||
"version": "1.0"
|
|
||||||
}))
|
|
||||||
};
|
|
||||||
let obj = this.$modal;
|
|
||||||
ws.onmessage = (e) => {
|
|
||||||
const resp = JSON.parse(e.data || '{}')
|
|
||||||
if (resp.cmd === 'getPrinters') {
|
|
||||||
this.printerList = resp.printers
|
|
||||||
obj.msgSuccess("打印组件连接成功!");
|
|
||||||
console.log('打印机列表: ', resp.printers);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
// 当发生错误时触发
|
|
||||||
ws.onerror = function (error) {
|
|
||||||
obj.msgError("打印组件连接失败!请安装并启动字节打印组件!");
|
|
||||||
console.error('WebSocket error:', error);
|
|
||||||
// alert('WebSocket error occurred. Check the console for more details.');
|
|
||||||
};
|
|
||||||
},
|
},
|
||||||
// 取号弹窗
|
// 取号弹窗
|
||||||
handleGetEwaybillCode() {
|
handleGetEwaybillCode() {
|
||||||
|
|
@ -341,16 +317,7 @@ export default {
|
||||||
const ids = this.ids;
|
const ids = this.ids;
|
||||||
console.log('=========3333========', ids)
|
console.log('=========3333========', ids)
|
||||||
if (ids) {
|
if (ids) {
|
||||||
console.log('===请求参数=====', {shopId: this.queryParams.shopId, ids: ids, accountId: this.form.accountId})
|
this.$modal.msgError("开源版本未实现电子面单相关功能!请自行对接发货");
|
||||||
getWaybillCode({
|
|
||||||
shopId: this.queryParams.shopId,
|
|
||||||
ids: ids,
|
|
||||||
accountId: this.form.accountId
|
|
||||||
}).then(response => {
|
|
||||||
this.$modal.msgSuccess("取号成功")
|
|
||||||
this.getList()
|
|
||||||
this.getCodeOpen = false
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
this.$modal.msgError("请选择订单")
|
this.$modal.msgError("请选择订单")
|
||||||
}
|
}
|
||||||
|
|
@ -358,91 +325,12 @@ export default {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
handlePrintEwaybill() {
|
handlePrintEwaybill() {
|
||||||
// if (!this.ws) {
|
this.$modal.msgError("开源版本未实现电子面单相关功能!请自行对接发货");
|
||||||
// this.$modal.msgError('打印组件连接失败!请安装并启动微信视频号小单打印组件!');
|
|
||||||
// this.openWs()
|
|
||||||
// }
|
|
||||||
// if(!this.printParams.deliver){
|
|
||||||
// this.$modal.msgError('请选择快递公司!');
|
|
||||||
// return
|
|
||||||
// }
|
|
||||||
if (!this.printParams.printer) {
|
|
||||||
this.$modal.msgError('请选择打印机!');
|
|
||||||
return
|
|
||||||
}
|
|
||||||
const ids = this.ids;
|
|
||||||
getWaybillPrintData({shopId: this.queryParams.shopId, ids: ids}).then(response => {
|
|
||||||
console.log("======打印======", response.data)
|
|
||||||
if (response.data) {
|
|
||||||
const ws = new WebSocket('ws://127.0.0.1:13888');
|
|
||||||
ws.onopen = () => {
|
|
||||||
let printData = []
|
|
||||||
response.data.forEach(x => printData.push(JSON.parse(x.printData)))
|
|
||||||
console.log('开始打印: 组合打印数据:', printData);
|
|
||||||
// 打印
|
|
||||||
ws.send(JSON.stringify({
|
|
||||||
"cmd": "print",
|
|
||||||
"requestID": this.getUUID(8, 16),
|
|
||||||
"version": "1.0",
|
|
||||||
"task": {
|
|
||||||
"taskID": this.getUUID(8,10),
|
|
||||||
"preview": false,
|
|
||||||
"printer": this.printParams.printer,
|
|
||||||
"previewType": "pdf",
|
|
||||||
"firstDocumentNumber": 10,
|
|
||||||
"totalDocumentCount": 100,
|
|
||||||
"documents": [{
|
|
||||||
"documentID": this.getUUID(8,10),
|
|
||||||
"contents": printData
|
|
||||||
}]
|
|
||||||
}
|
|
||||||
}))
|
|
||||||
};
|
|
||||||
let obj = this.$modal;
|
|
||||||
ws.onmessage = (e) => {
|
|
||||||
const resp = JSON.parse(e.data || '{}')
|
|
||||||
if (resp.cmd === 'print') {
|
|
||||||
console.log('打印结果: ', resp);
|
|
||||||
obj.msgSuccess("打印成功!" + JSON.stringify(resp));
|
|
||||||
// 请求回调
|
|
||||||
return pushWaybillPrintSuccess({shopId: this.queryParams.shopId, ids: ids})
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// 当发生错误时触发
|
|
||||||
ws.onerror = function (error) {
|
|
||||||
obj.msgError("打印失败!");
|
|
||||||
console.error('WebSocket error:', error);
|
|
||||||
// alert('WebSocket error occurred. Check the console for more details.');
|
|
||||||
};
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
handleShipSend(){
|
handleShipSend(){
|
||||||
this.$modal.msgError("开源版本未实现平台发货!请自行对接发货");
|
this.$modal.msgError("开源版本未实现平台发货!请自行对接发货");
|
||||||
},
|
},
|
||||||
getUUID(len, radix) {
|
|
||||||
var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('');
|
|
||||||
var uuid = [], i;
|
|
||||||
radix = radix || chars.length;
|
|
||||||
if (len) {
|
|
||||||
for (i = 0; i < len; i++) uuid[i] = chars[0 | Math.random() * radix];
|
|
||||||
} else {
|
|
||||||
var r;
|
|
||||||
uuid[8] = uuid[13] = uuid[18] = uuid[23] = '-';
|
|
||||||
uuid[14] = '4';
|
|
||||||
for (i = 0; i < 36; i++) {
|
|
||||||
if (!uuid[i]) {
|
|
||||||
r = 0 | Math.random() * 16;
|
|
||||||
uuid[i] = chars[(i == 19) ? (r & 0x3) | 0x8 : r];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return uuid.join('');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue