Merge branch '0.8.X' of https://gitee.com/hdka/klp-oa into 0.8.X
This commit is contained in:
@@ -20,7 +20,7 @@ spring.boot.admin.client:
|
||||
--- # xxl-job 配置
|
||||
xxl.job:
|
||||
# 执行器开关
|
||||
enabled: true
|
||||
enabled: false
|
||||
# 调度中心地址:如调度中心集群部署存在多个地址则用逗号分隔。
|
||||
admin-addresses: http://localhost:9100/xxl-job-admin
|
||||
# 执行器通讯TOKEN:非空时启用
|
||||
|
||||
51
klp-ui/src/api/wms/express.js
Normal file
51
klp-ui/src/api/wms/express.js
Normal file
@@ -0,0 +1,51 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询物流预览列表
|
||||
export function listExpress(query) {
|
||||
return request({
|
||||
url: '/wms/express/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询物流预览详细
|
||||
export function getExpress(expressId) {
|
||||
return request({
|
||||
url: '/wms/express/' + expressId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
// 查询物流预览详细
|
||||
export function refreshExpress(expressId) {
|
||||
return request({
|
||||
url: '/wms/express/refresh/' + expressId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增物流预览
|
||||
export function addExpress(data) {
|
||||
return request({
|
||||
url: '/wms/express',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改物流预览
|
||||
export function updateExpress(data) {
|
||||
return request({
|
||||
url: '/wms/express',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除物流预览
|
||||
export function delExpress(expressId) {
|
||||
return request({
|
||||
url: '/wms/express/' + expressId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
44
klp-ui/src/api/wms/expressQuestion.js
Normal file
44
klp-ui/src/api/wms/expressQuestion.js
Normal file
@@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询快递问题列表
|
||||
export function listExpressQuestion(query) {
|
||||
return request({
|
||||
url: '/wms/expressQuestion/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询快递问题详细
|
||||
export function getExpressQuestion(questionId) {
|
||||
return request({
|
||||
url: '/wms/expressQuestion/' + questionId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增快递问题
|
||||
export function addExpressQuestion(data) {
|
||||
return request({
|
||||
url: '/wms/expressQuestion',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改快递问题
|
||||
export function updateExpressQuestion(data) {
|
||||
return request({
|
||||
url: '/wms/expressQuestion',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除快递问题
|
||||
export function delExpressQuestion(questionId) {
|
||||
return request({
|
||||
url: '/wms/expressQuestion/' + questionId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
52
klp-ui/src/api/wms/reportDetail.js
Normal file
52
klp-ui/src/api/wms/reportDetail.js
Normal file
@@ -0,0 +1,52 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询设计项目汇报详情列表
|
||||
export async function listReportDetail(query) {
|
||||
return request({
|
||||
url: '/wms/reportDetail/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询设计项目汇报详情详细
|
||||
export function getReportDetail(id) {
|
||||
return request({
|
||||
url: '/wms/reportDetail/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增设计项目汇报详情
|
||||
export function addReportDetail(data) {
|
||||
return request({
|
||||
url: '/wms/reportDetail',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改设计项目汇报详情
|
||||
export function updateReportDetail(data) {
|
||||
return request({
|
||||
url: '/wms/reportDetail',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除设计项目汇报详情
|
||||
export function delReportDetail(id) {
|
||||
return request({
|
||||
url: '/wms/reportDetail/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
export function listReportDetailByProjectId(projectId) {
|
||||
return request({
|
||||
url: '/wms/reportDetail/project/' + projectId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
44
klp-ui/src/api/wms/reportSummary.js
Normal file
44
klp-ui/src/api/wms/reportSummary.js
Normal file
@@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询设计项目汇报概述列表
|
||||
export async function listReportSummary(query) {
|
||||
return request({
|
||||
url: '/wms/reportSummary/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询设计项目汇报概述详细
|
||||
export function getReportSummary(id) {
|
||||
return request({
|
||||
url: '/wms/reportSummary/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增设计项目汇报概述
|
||||
export function addReportSummary(data) {
|
||||
return request({
|
||||
url: '/wms/reportSummary',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改设计项目汇报概述
|
||||
export function updateReportSummary(data) {
|
||||
return request({
|
||||
url: '/wms/reportSummary',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除设计项目汇报概述
|
||||
export function delReportSummary(id) {
|
||||
return request({
|
||||
url: '/wms/reportSummary/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
@@ -28,3 +28,10 @@ export const ITEM_TYPE = {
|
||||
RAW_MATERIAL: 'raw_material', // 原材料
|
||||
PRODUCT: 'product' // 产品
|
||||
};
|
||||
|
||||
export const EExpressType = {
|
||||
SF: "SF",
|
||||
ZTO: "ZTO",
|
||||
BEST: "Best",
|
||||
STO: "STO",
|
||||
}
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
<template>
|
||||
<span>
|
||||
<el-tag v-if="status === 2" type="success">已完成</el-tag>
|
||||
<el-tag v-else-if="status === 3" type="danger">异常</el-tag>
|
||||
<template v-else>
|
||||
<el-tag v-if="isTimeout" type="danger">超时</el-tag>
|
||||
<el-tag v-else type="info">剩余{{ remainDays }}天</el-tag>
|
||||
</template>
|
||||
</span>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'ExpressRemainTime',
|
||||
props: {
|
||||
planDate: {
|
||||
type: [String, Date],
|
||||
required: false
|
||||
},
|
||||
status: {
|
||||
type: Number,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
remainDays() {
|
||||
if (!this.planDate) return '-';
|
||||
const now = new Date();
|
||||
const plan = new Date(this.planDate);
|
||||
const diff = plan.getTime() - now.getTime();
|
||||
return Math.ceil(diff / (1000 * 60 * 60 * 24));
|
||||
},
|
||||
isTimeout() {
|
||||
if (!this.planDate) return false;
|
||||
const now = new Date();
|
||||
const plan = new Date(this.planDate);
|
||||
return now.getTime() > plan.getTime();
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,95 @@
|
||||
<template>
|
||||
<div>
|
||||
<span v-if="!isCustomExpress" style="color: #606266;">
|
||||
<span>{{ lastUpdateTime || '-' }}</span>
|
||||
<el-tooltip v-if="lastStatus" :content="lastStatus" placement="top">
|
||||
<span class="ellipsis" style="max-width: 200px; display: inline-block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; font-size: 13px;">
|
||||
{{ lastStatus }}
|
||||
</span>
|
||||
</el-tooltip>
|
||||
<span v-else style="font-size: 13px;">未发货或无法获取</span>
|
||||
</span>
|
||||
<span v-else>
|
||||
<span @click="openDialog" style="cursor:pointer;color:#409EFF;text-decoration:underline;">
|
||||
{{ lastUpdateTime || '点击填写' }}
|
||||
</span>
|
||||
<span @click="openDialog" style="cursor:pointer;color:#409EFF;text-decoration:underline;">
|
||||
{{ lastStatus || '点击填写' }}
|
||||
</span>
|
||||
</span>
|
||||
<el-dialog title="手动填写物流状态" :visible.sync="dialogVisible" width="400px" append-to-body>
|
||||
<el-form :model="form" label-width="100px">
|
||||
<el-form-item label="物流状态">
|
||||
<el-input v-model="form.lastStatus" placeholder="请输入物流状态" />
|
||||
</el-form-item>
|
||||
<el-form-item label="更新时间">
|
||||
<el-date-picker v-model="form.lastUpdateTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss" placeholder="请选择更新时间" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="handleSave">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { EExpressType } from '@/utils/enums';
|
||||
export default {
|
||||
name: 'ExpressStatusEditor',
|
||||
props: {
|
||||
lastStatus: String,
|
||||
lastUpdateTime: String,
|
||||
expressType: String
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
form: {
|
||||
lastStatus: '',
|
||||
lastUpdateTime: ''
|
||||
},
|
||||
EExpressType
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
isCustomExpress() {
|
||||
console.log(this.EExpressType);
|
||||
if (!this.EExpressType || typeof this.EExpressType !== 'object') {
|
||||
return true;
|
||||
}
|
||||
const expressTypeList = Object.values(this.EExpressType);
|
||||
return !expressTypeList.includes(this.expressType);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
openDialog() {
|
||||
this.form.lastStatus = this.lastStatus || '';
|
||||
this.form.lastUpdateTime = this.lastUpdateTime || '';
|
||||
this.dialogVisible = true;
|
||||
},
|
||||
handleSave() {
|
||||
if (!this.form.lastStatus || !this.form.lastUpdateTime) {
|
||||
this.$message.error('请填写完整物流状态和更新时间');
|
||||
return;
|
||||
}
|
||||
this.$emit('update:lastStatus', this.form.lastStatus);
|
||||
this.$emit('update:lastUpdateTime', this.form.lastUpdateTime);
|
||||
this.$emit('save', {
|
||||
lastStatus: this.form.lastStatus,
|
||||
lastUpdateTime: this.form.lastUpdateTime
|
||||
});
|
||||
this.dialogVisible = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.ellipsis {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
</style>
|
||||
770
klp-ui/src/views/wms/express/index.vue
Normal file
770
klp-ui/src/views/wms/express/index.vue
Normal file
@@ -0,0 +1,770 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="96px">
|
||||
<el-form-item label="物流编号" prop="expressCode">
|
||||
<el-input
|
||||
v-model="queryParams.expressCode"
|
||||
placeholder="请输入物流编号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="对方姓名" prop="supplyName">
|
||||
<el-input
|
||||
v-model="queryParams.supplyName"
|
||||
placeholder="请输入对方姓名"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="对方手机" prop="supplyPhone">
|
||||
<el-input
|
||||
v-model="queryParams.supplyPhone"
|
||||
placeholder="请输入对方联系方式"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="负责人手机号" prop="ownerPhone">
|
||||
<el-input
|
||||
v-model="queryParams.ownerPhone"
|
||||
placeholder="请输入负责人手机号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="计划到货时间" prop="planDate">
|
||||
<el-date-picker clearable
|
||||
v-model="queryParams.planDate"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="请选择计划到货时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="项目" prop="projectId">
|
||||
<!-- <el-select v-model="queryParams.projectId" placeholder="请选择项目" filterable>
|
||||
<el-option
|
||||
v-for="item in allProject"
|
||||
:key="item.projectId"
|
||||
:label="item.projectName"
|
||||
:value="item.projectId"
|
||||
></el-option>
|
||||
</el-select>-->
|
||||
|
||||
</el-form-item>
|
||||
<el-form-item label="物流公司" prop="expressType">
|
||||
<el-select v-model="queryParams.expressType" placeholder="请选择物流公司标识" clearable>
|
||||
<el-option
|
||||
v-for="dict in dict.type.oa_express_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
|
||||
<el-button
|
||||
type="waning"
|
||||
plain
|
||||
size="mini"
|
||||
icon="el-icon-refresh"
|
||||
@click="handleRefresh"
|
||||
>批量更新状态
|
||||
</el-button>
|
||||
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
>新增
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
>修改
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
>删除
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
>导出
|
||||
</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="expressList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center"/>
|
||||
<el-table-column label="物流编号" align="center" prop="expressCode"/>
|
||||
<el-table-column label="数据状态" align="center" prop="status">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="scope.row.status===0" type="warning">未确认</el-tag>
|
||||
<el-tag v-if="scope.row.status===1" type="primary">进行中</el-tag>
|
||||
<el-tag v-if="scope.row.status===2" type="success">已完成</el-tag>
|
||||
<el-tag v-if="scope.row.status===3" type="danger">异常</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="物流状态" align="center" prop="status" width="200">
|
||||
<template slot-scope="scope">
|
||||
<ExpressStatusEditor
|
||||
:lastStatus.sync="scope.row.lastStatus"
|
||||
:lastUpdateTime.sync="scope.row.lastUpdateTime"
|
||||
:expressType="scope.row.expressType"
|
||||
@save="val => handleStatusSave(scope.row, val)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="剩余时间" align="center" width="120">
|
||||
<template slot-scope="scope">
|
||||
<ExpressRemainTime :planDate="scope.row.planDate" :status="scope.row.status" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="对方姓名" align="center" prop="supplyName"/>
|
||||
<el-table-column label="负责人" align="center" prop="ownerName"/>
|
||||
<el-table-column label="负责人手机" align="center" prop="ownerPhone"/>
|
||||
<el-table-column label="计划到货时间" align="center" prop="planDate" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{parseTime(scope.row.planDate,'{y}-{m}-{d}')}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="更新时间" align="center" prop="planDate" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{scope.row.updateTime}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="物流公司标识" align="center" prop="expressType">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.oa_express_type" :value="scope.row.expressType"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remark"/>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-check"
|
||||
v-if="scope.row.status===0"
|
||||
@click="handleUpdateStatus(scope.row,1)"
|
||||
>确认
|
||||
</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-check"
|
||||
v-if="scope.row.status===1"
|
||||
@click="handleUpdateStatus(scope.row,2)"
|
||||
>完成
|
||||
</el-button>
|
||||
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-refresh"
|
||||
v-if="scope.row.status===1"
|
||||
@click="handleRefresh(scope.row)"
|
||||
>同步物流状态
|
||||
</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-close"
|
||||
v-if="scope.row.status!==2 && scope.row.status!==3"
|
||||
@click="handleUpdateStatus(scope.row,3)"
|
||||
>异常
|
||||
</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleDetail(scope.row)"
|
||||
>详情
|
||||
</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
v-if="scope.row.status!==2"
|
||||
@click="handleUpdate(scope.row)"
|
||||
>修改
|
||||
</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
>删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改物流预览对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
||||
<el-form-item label="物流编号" prop="expressCode">
|
||||
<el-input v-model="form.expressCode" placeholder="请输入物流编号"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="对方姓名" prop="supplyName">
|
||||
<el-input v-model="form.supplyName" placeholder="请输入发货方姓名"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="对方联系方式" prop="supplyPhone">
|
||||
<el-input v-model="form.supplyPhone" placeholder="请输入发货方联系方式"/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="负责人" prop="ownerId">
|
||||
<user-select v-model="form.ownerId"></user-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="负责人手机号" prop="ownerPhone">
|
||||
<el-input v-model="form.ownerPhone" placeholder="请输入负责人手机号"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="计划到货时间" prop="planDate">
|
||||
<el-date-picker clearable
|
||||
v-model="form.planDate"
|
||||
type="datetime"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
placeholder="请选择计划到货时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="物流公司标识" prop="expressType">
|
||||
<el-select v-model="form.expressType" placeholder="请选择物流公司标识">
|
||||
<el-option
|
||||
v-for="dict in dict.type.oa_express_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<!-- <el-form-item label="关联项目" prop="projectId">
|
||||
<el-select v-model="form.projectId" filterable placeholder="请选择项目" @change="getReportSummary">
|
||||
<el-option
|
||||
v-for="item in allProject"
|
||||
:key="item.projectId"
|
||||
:label="item.projectName"
|
||||
:value="item.projectId"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>-->
|
||||
|
||||
<el-form-item label="发货记录" prop="detailId">
|
||||
<el-select v-model="form.detailId" placeholder="请选择发货记录">
|
||||
<el-option
|
||||
v-for="item in reportDetailList"
|
||||
:key="item.detailId"
|
||||
:label="item.reportDetail"
|
||||
:value="item.detailId"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 物流详情弹窗 -->
|
||||
<el-dialog
|
||||
title="物流详情"
|
||||
:visible.sync="detailOpen"
|
||||
width="600px"
|
||||
append-to-body
|
||||
>
|
||||
<el-descriptions :column="2" border>
|
||||
<el-descriptions-item label="物流编号">{{ expressDetail.expressCode || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="数据状态">
|
||||
<el-tag v-if="expressDetail.status===0" type="warning">未确认</el-tag>
|
||||
<el-tag v-else-if="expressDetail.status===1" type="primary">进行中</el-tag>
|
||||
<el-tag v-else-if="expressDetail.status===2" type="success">已完成</el-tag>
|
||||
<el-tag v-else-if="expressDetail.status===3" type="error">异常</el-tag>
|
||||
<span v-else>-</span>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="对方姓名">{{ expressDetail.supplyName || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="对方手机号">{{ expressDetail.supplyPhone || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="负责人">{{ expressDetail.ownerName || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="负责人手机">{{ expressDetail.ownerPhone || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="项目名">{{ expressDetail.projectName || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="细节描述">{{ expressDetail.detailName || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="当前物流状态">{{ expressDetail.lastStatus || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="物流更新时间">{{ expressDetail.lastUpdateTime || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="计划到货时间">{{ expressDetail.planDate || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="更新时间">{{ expressDetail.updateTime || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="物流公司">
|
||||
<dict-tag :options="dict.type.oa_express_type" :value="expressDetail.expressType"/>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="备注" :span="2">{{ expressDetail.remark || '-' }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="detailOpen = false">关 闭</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 异常登记弹窗表单 -->
|
||||
<el-dialog
|
||||
title="异常问题登记"
|
||||
:visible.sync="questionDialogVisible"
|
||||
width="500px"
|
||||
append-to-body
|
||||
>
|
||||
<el-form :model="questionForm" :rules="questionFormRules" ref="questionForm" label-width="100px">
|
||||
<el-form-item label="问题描述" prop="description">
|
||||
<el-input v-model="questionForm.description" type="textarea" placeholder="请输入问题描述"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="汇报时间" prop="reportTime">
|
||||
<el-date-picker v-model="questionForm.reportTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss" placeholder="请选择汇报时间"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="questionForm.remark" type="textarea" placeholder="请输入备注"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="questionDialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="submitQuestionForm">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 手动填写物流状态弹窗 -->
|
||||
<el-dialog title="手动填写物流状态" :visible.sync="customStatusDialogVisible" width="400px" append-to-body>
|
||||
<el-form :model="customStatusForm" label-width="100px">
|
||||
<el-form-item label="物流状态">
|
||||
<el-input v-model="customStatusForm.lastStatus" placeholder="请输入物流状态" />
|
||||
</el-form-item>
|
||||
<el-form-item label="更新时间">
|
||||
<el-date-picker v-model="customStatusForm.lastUpdateTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss" placeholder="请选择更新时间" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="customStatusDialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="submitCustomStatus">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { addExpress, delExpress, getExpress, listExpress, refreshExpress, updateExpress } from "@/api/wms/express";
|
||||
import { addExpressQuestion } from "@/api/wms/expressQuestion";
|
||||
// import { listProject } from "@/api/wms/project";
|
||||
// import { listReportDetailByProjectId } from "@/api/wms/reportDetail";
|
||||
import UserSelect from "@/components/KLPService/UserSelect/index.vue";
|
||||
import { EExpressType } from '@/utils/enums';
|
||||
import ExpressRemainTime from './components/ExpressRemainTime.vue';
|
||||
import ExpressStatusEditor from './components/ExpressStatusEditor.vue';
|
||||
|
||||
export default {
|
||||
name: "Express",
|
||||
components: {UserSelect, ExpressStatusEditor, ExpressRemainTime},
|
||||
dicts: ['oa_express_type'],
|
||||
data() {
|
||||
return {
|
||||
// 按钮loading
|
||||
buttonLoading: false,
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
expressDetail:{},
|
||||
detailOpen:false,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 物流预览表格数据
|
||||
expressList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
expressCode: undefined,
|
||||
status: undefined,
|
||||
supplyName: undefined,
|
||||
supplyPhone: undefined,
|
||||
ownerId: undefined,
|
||||
ownerPhone: undefined,
|
||||
planDate: undefined,
|
||||
expressType: undefined,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
expressId: [
|
||||
{required: true, message: "主键id不能为空", trigger: "blur"}
|
||||
],
|
||||
expressCode: [
|
||||
{required: true, message: "物流编号不能为空", trigger: "blur"}
|
||||
],
|
||||
status: [
|
||||
{required: true, message: "数据状态0未确认1进行中2已完成不能为空", trigger: "change"}
|
||||
],
|
||||
supplyName: [
|
||||
{required: true, message: "供应商姓名不能为空", trigger: "blur"}
|
||||
],
|
||||
supplyPhone: [
|
||||
{required: true, message: "供应商联系方式不能为空", trigger: "blur"}
|
||||
],
|
||||
ownerId: [
|
||||
{required: true, message: "负责人id不能为空", trigger: "blur"}
|
||||
],
|
||||
ownerPhone: [
|
||||
{required: true, message: "负责人手机号不能为空", trigger: "blur"}
|
||||
],
|
||||
planDate: [
|
||||
{required: true, message: "计划到货时间不能为空", trigger: "blur"}
|
||||
],
|
||||
expressType: [
|
||||
{required: true, message: "物流公司标识不能为空", trigger: "change"}
|
||||
],
|
||||
remark: [
|
||||
{required: true, message: "备注不能为空", trigger: "blur"}
|
||||
]
|
||||
},
|
||||
allProject:[],
|
||||
reportDetailList:[],
|
||||
// 异常登记弹窗
|
||||
questionDialogVisible: false,
|
||||
// 异常登记表单
|
||||
questionForm: {
|
||||
expressId: null,
|
||||
description: '',
|
||||
reportTime: '',
|
||||
status: 0,
|
||||
remark: ''
|
||||
},
|
||||
// 异常登记表单校验
|
||||
questionFormRules: {
|
||||
description: [{ required: true, message: '问题描述不能为空', trigger: 'blur' }],
|
||||
reportTime: [{ required: true, message: '汇报时间不能为空', trigger: 'blur' }]
|
||||
},
|
||||
currentExceptionRow: null,
|
||||
customStatusDialogVisible: false,
|
||||
customStatusForm: {
|
||||
expressId: null,
|
||||
lastStatus: '',
|
||||
lastUpdateTime: ''
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
// this.getAllProject()
|
||||
},
|
||||
methods: {
|
||||
/** 查询物流预览列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listExpress(this.queryParams).then(response => {
|
||||
this.expressList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
|
||||
|
||||
},
|
||||
/*getAllProject() {
|
||||
listProject({pageNum: 1, pageSize: 999999999}).then(response => {
|
||||
this.allProject = response.rows;
|
||||
});
|
||||
},*/
|
||||
|
||||
/*getReportSummary() {
|
||||
listReportDetailByProjectId(this.form.projectId).then(response => {
|
||||
this.reportDetailList = response.data;
|
||||
});
|
||||
},*/
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
|
||||
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
expressId: undefined,
|
||||
expressCode: undefined,
|
||||
status: undefined,
|
||||
supplyName: undefined,
|
||||
supplyPhone: undefined,
|
||||
ownerId: undefined,
|
||||
ownerPhone: undefined,
|
||||
planDate: undefined,
|
||||
expressType: undefined,
|
||||
createBy: undefined,
|
||||
createTime: undefined,
|
||||
updateBy: undefined,
|
||||
updateTime: undefined,
|
||||
delFlag: undefined,
|
||||
remark: undefined
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.expressId)
|
||||
this.single = selection.length !== 1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加物流预览";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.loading = true;
|
||||
this.reset();
|
||||
const expressId = row.expressId || this.ids
|
||||
getExpress(expressId).then(response => {
|
||||
this.loading = false;
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改物流预览";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
this.buttonLoading = true;
|
||||
if (this.form.expressId != null) {
|
||||
updateExpress(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}).finally(() => {
|
||||
this.buttonLoading = false;
|
||||
});
|
||||
} else {
|
||||
addExpress(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}).finally(() => {
|
||||
this.buttonLoading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
handleDetail(row){
|
||||
getExpress(row.expressId).then(response => {
|
||||
this.loading = false;
|
||||
this.expressDetail = response.data;
|
||||
this.detailOpen = true;
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
// 更新状态
|
||||
handleUpdateStatus(row, status) {
|
||||
let str = ""
|
||||
if (status === 1) {
|
||||
str = "是否确认操作,此数据将变化为确认状态"
|
||||
} else if (status === 2) {
|
||||
str = "确认状态已完成?"
|
||||
} else {
|
||||
str = "此物流单是否确认发生异常?操作后数据无法恢复"
|
||||
}
|
||||
if (status === 3) {
|
||||
// 弹出异常登记表单
|
||||
this.questionForm = {
|
||||
expressId: row.expressId,
|
||||
description: '',
|
||||
reportTime: this.parseTime(new Date(), '{y}-{m}-{d} {h}:{i}:{s}'),
|
||||
status: 0,
|
||||
remark: ''
|
||||
};
|
||||
this.currentExceptionRow = row;
|
||||
this.questionDialogVisible = true;
|
||||
return;
|
||||
}
|
||||
this.$modal.confirm(str).then(() => {
|
||||
row.status = status
|
||||
this.loading = true;
|
||||
return updateExpress(row);
|
||||
}).then(() => {
|
||||
this.loading = false;
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("操作成功");
|
||||
}).catch(() => {
|
||||
}).finally(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
submitQuestionForm() {
|
||||
this.$refs.questionForm.validate(valid => {
|
||||
if (!valid) return;
|
||||
// 新增 expressQuestion
|
||||
addExpressQuestion(this.questionForm).then(() => {
|
||||
// 新增成功后,更新物流单状态为异常
|
||||
const row = this.currentExceptionRow;
|
||||
row.status = 3;
|
||||
this.loading = true;
|
||||
updateExpress(row).then(() => {
|
||||
this.loading = false;
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("异常登记成功,物流单已标记为异常");
|
||||
}).finally(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
this.questionDialogVisible = false;
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
// 同步物流状态
|
||||
handleRefresh(row){
|
||||
const expressIds = row.expressId || this.ids;
|
||||
if (expressIds.length < 1) {
|
||||
this.$modal.msgError("请选择要同步的物流单");
|
||||
return;
|
||||
}
|
||||
refreshExpress(expressIds).then(response => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("同步完成");
|
||||
})
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const expressIds = row.expressId || this.ids;
|
||||
this.$modal.confirm('是否确认删除物流预览编号为"' + expressIds + '"的数据项?').then(() => {
|
||||
this.loading = true;
|
||||
return delExpress(expressIds);
|
||||
}).then(() => {
|
||||
this.loading = false;
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {
|
||||
}).finally(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('oa/express/export', {
|
||||
...this.queryParams
|
||||
}, `express_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
// 计算剩余天数
|
||||
getRemainDays(planDate) {
|
||||
if (!planDate) return '-';
|
||||
const now = new Date();
|
||||
const plan = new Date(planDate);
|
||||
const diff = plan.getTime() - now.getTime();
|
||||
return Math.ceil(diff / (1000 * 60 * 60 * 24));
|
||||
},
|
||||
// 判断是否超时
|
||||
isTimeout(planDate) {
|
||||
if (!planDate) return false;
|
||||
const now = new Date();
|
||||
const plan = new Date(planDate);
|
||||
return now.getTime() > plan.getTime();
|
||||
},
|
||||
isCustomExpress(expressType) {
|
||||
const expressTypeList = Object.values(EExpressType);
|
||||
return !expressTypeList.includes(expressType);
|
||||
},
|
||||
openCustomStatusDialog(row) {
|
||||
this.customStatusForm = {
|
||||
expressId: row.expressId,
|
||||
lastStatus: row.lastStatus || '',
|
||||
lastUpdateTime: row.lastUpdateTime || ''
|
||||
};
|
||||
this.customStatusDialogVisible = true;
|
||||
},
|
||||
submitCustomStatus() {
|
||||
if (!this.customStatusForm.lastStatus || !this.customStatusForm.lastUpdateTime) {
|
||||
this.$modal.msgError('请填写完整物流状态和更新时间');
|
||||
return;
|
||||
}
|
||||
// 更新expressList中对应项
|
||||
const row = this.expressList.find(item => item.expressId === this.customStatusForm.expressId);
|
||||
if (row) {
|
||||
row.lastStatus = this.customStatusForm.lastStatus;
|
||||
row.lastUpdateTime = this.customStatusForm.lastUpdateTime;
|
||||
// 可选:直接调用后端接口保存
|
||||
updateExpress(row).then(() => {
|
||||
this.$modal.msgSuccess('保存成功');
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
this.customStatusDialogVisible = false;
|
||||
},
|
||||
handleStatusSave(row, val) {
|
||||
row.lastStatus = val.lastStatus;
|
||||
row.lastUpdateTime = val.lastUpdateTime;
|
||||
updateExpress(row).then(() => {
|
||||
this.$modal.msgSuccess('保存成功');
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
353
klp-ui/src/views/wms/expressQuestion/index.vue
Normal file
353
klp-ui/src/views/wms/expressQuestion/index.vue
Normal file
@@ -0,0 +1,353 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="关联快递" prop="expressId">
|
||||
<el-input
|
||||
v-model="queryParams.expressId"
|
||||
placeholder="请输入关联快递"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="问题描述" prop="description">
|
||||
<el-input
|
||||
v-model="queryParams.description"
|
||||
placeholder="请输入问题描述"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="汇报时间" prop="reportTime">
|
||||
<el-date-picker clearable
|
||||
v-model="queryParams.reportTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="请选择汇报时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="汇报人" prop="reportBy">
|
||||
<el-input
|
||||
v-model="queryParams.reportBy"
|
||||
placeholder="请输入汇报人"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-check"
|
||||
size="mini"
|
||||
@click="handleUpdateStatus"
|
||||
>修复</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="expressQuestionList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="问题编号" align="center" prop="questionId" v-if="true"/>
|
||||
<el-table-column label="快递单号" align="center" prop="expressCode" />
|
||||
<el-table-column label="问题描述" align="center" prop="description" />
|
||||
<el-table-column label="汇报时间" align="center" prop="reportTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.reportTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="汇报人" align="center" prop="reportBy" />
|
||||
<el-table-column label="是否解决" align="center" prop="status">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="scope.row.status===0" type="danger">未解决</el-tag>
|
||||
<el-tag v-if="scope.row.status===1" type="success">完成</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdateStatus(scope.row,1)"
|
||||
>问题解决</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改快递问题对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="问题描述" prop="description">
|
||||
<el-input v-model="form.description" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
<el-form-item label="汇报时间" prop="reportTime">
|
||||
<el-date-picker clearable
|
||||
v-model="form.reportTime"
|
||||
type="datetime"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
placeholder="请选择汇报时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="汇报人" prop="reportBy">
|
||||
<el-input v-model="form.reportBy" placeholder="请输入汇报人" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { updateExpress } from "@/api/wms/express";
|
||||
import { addExpressQuestion, delExpressQuestion, getExpressQuestion, listExpressQuestion, updateExpressQuestion } from "@/api/wms/expressQuestion";
|
||||
|
||||
export default {
|
||||
name: "ExpressQuestion",
|
||||
data() {
|
||||
return {
|
||||
// 按钮loading
|
||||
buttonLoading: false,
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 快递问题表格数据
|
||||
expressQuestionList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
expressId: undefined,
|
||||
description: undefined,
|
||||
reportTime: undefined,
|
||||
reportBy: undefined,
|
||||
status: undefined,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
questionId: [
|
||||
{ required: true, message: "主键id不能为空", trigger: "blur" }
|
||||
],
|
||||
expressId: [
|
||||
{ required: true, message: "关联快递不能为空", trigger: "blur" }
|
||||
],
|
||||
description: [
|
||||
{ required: true, message: "问题描述不能为空", trigger: "blur" }
|
||||
],
|
||||
reportTime: [
|
||||
{ required: true, message: "汇报时间不能为空", trigger: "blur" }
|
||||
],
|
||||
reportBy: [
|
||||
{ required: true, message: "汇报人不能为空", trigger: "blur" }
|
||||
],
|
||||
status: [
|
||||
{ required: true, message: "0未解决1已解决不能为空", trigger: "change" }
|
||||
],
|
||||
remark: [
|
||||
{ required: true, message: "备注不能为空", trigger: "blur" }
|
||||
]
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询快递问题列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listExpressQuestion(this.queryParams).then(response => {
|
||||
this.expressQuestionList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
questionId: undefined,
|
||||
expressId: undefined,
|
||||
description: undefined,
|
||||
reportTime: undefined,
|
||||
reportBy: undefined,
|
||||
status: undefined,
|
||||
createTime: undefined,
|
||||
createBy: undefined,
|
||||
updateTime: undefined,
|
||||
updateBy: undefined,
|
||||
delFlag: undefined,
|
||||
remark: undefined
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.questionId)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加快递问题";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.loading = true;
|
||||
this.reset();
|
||||
const questionId = row.questionId || this.ids
|
||||
getExpressQuestion(questionId).then(response => {
|
||||
this.loading = false;
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改快递问题";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
this.buttonLoading = true;
|
||||
if (this.form.questionId != null) {
|
||||
updateExpressQuestion(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}).finally(() => {
|
||||
this.buttonLoading = false;
|
||||
});
|
||||
} else {
|
||||
addExpressQuestion(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}).finally(() => {
|
||||
this.buttonLoading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
handleUpdateStatus(row){
|
||||
row.status = 1
|
||||
updateExpressQuestion(row).then(()=>{
|
||||
this.$modal.msgSuccess("操作成功");
|
||||
})
|
||||
let data = {
|
||||
expressId:row.expressId,
|
||||
status:1
|
||||
}
|
||||
updateExpress(data)
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const questionIds = row.questionId || this.ids;
|
||||
this.$modal.confirm('是否确认删除快递问题编号为"' + questionIds + '"的数据项?').then(() => {
|
||||
this.loading = true;
|
||||
return delExpressQuestion(questionIds);
|
||||
}).then(() => {
|
||||
this.loading = false;
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {
|
||||
}).finally(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('oa/expressQuestion/export', {
|
||||
...this.queryParams
|
||||
}, `expressQuestion_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
595
klp-ui/src/views/wms/rxgood/detail.vue
Normal file
595
klp-ui/src/views/wms/rxgood/detail.vue
Normal file
@@ -0,0 +1,595 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="120px">
|
||||
<!-- <el-form-item label="关联汇报概述ID" prop="summaryId">
|
||||
<el-input
|
||||
v-model="queryParams.summaryId"
|
||||
placeholder="请输入关联汇报概述ID"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="货物编号" prop="deviceCode">
|
||||
<el-input
|
||||
v-model="queryParams.deviceCode"
|
||||
placeholder="请输入货物编号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="货物类别" prop="category">
|
||||
<el-autocomplete
|
||||
v-model="queryParams.category"
|
||||
:fetch-suggestions="categoryQuerySearch"
|
||||
placeholder="请输入货物类别"
|
||||
@select="handleCategorySelect"
|
||||
clearable
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="货物说明" prop="deviceDescription">
|
||||
<el-input
|
||||
v-model="queryParams.deviceDescription"
|
||||
placeholder="请输入货物说明"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="收发货详情" prop="reportDetail">
|
||||
<el-input
|
||||
v-model="queryParams.reportDetail"
|
||||
placeholder="请输入收发货详情"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="reportDetailList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="序号" align="center" type="index" v-if="true"/>
|
||||
<!-- <el-table-column label="关联汇报概述ID" align="center" prop="summaryId" /> -->
|
||||
<el-table-column label="货物编号" align="center" prop="deviceCode" />
|
||||
<el-table-column label="货物类别" align="center" prop="category" />
|
||||
<el-table-column label="货物说明" align="center" prop="deviceDescription" />
|
||||
<el-table-column label="收发货详情" align="center" prop="reportDetail" />
|
||||
<el-table-column label="图片概况" align="center" prop="ossIds" width="100">
|
||||
<template slot-scope="scope">
|
||||
<image-preview :src="scope.row.ossIds" :width="50" :height="50"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-view"
|
||||
@click="handleImageDetail(scope.row)"
|
||||
>图片详情</el-button>
|
||||
|
||||
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
>修改</el-button>
|
||||
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleAddExpress(scope.row)"
|
||||
>发货</el-button>
|
||||
|
||||
|
||||
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改设计项目汇报详情对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="50%" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
||||
<el-form-item label="货物编号" prop="deviceCode">
|
||||
<el-input v-model="form.deviceCode" placeholder="请输入货物编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="货物类别" prop="category">
|
||||
<el-autocomplete
|
||||
v-model="form.category"
|
||||
:fetch-suggestions="categoryQuerySearch"
|
||||
placeholder="请输入货物类别"
|
||||
@select="handleCategorySelectForm"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="货物说明" prop="deviceDescription">
|
||||
<el-input v-model="form.deviceDescription" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
<el-form-item label="收发货详情" prop="reportDetail">
|
||||
<el-input v-model="form.reportDetail" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
<el-form-item label="图像" prop="ossIds">
|
||||
<image-upload v-model="form.ossIds"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog :title="title" :visible.sync="expressOpen" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="expressForm" :rules="rules" label-width="120px">
|
||||
<el-form-item label="物流编号" prop="expressCode">
|
||||
<el-input v-model="expressForm.expressCode" placeholder="请输入物流编号"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="对方姓名" prop="supplyName">
|
||||
<el-input v-model="expressForm.supplyName" placeholder="请输入发货方姓名"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="对方联系方式" prop="supplyPhone">
|
||||
<el-input v-model="expressForm.supplyPhone" placeholder="请输入发货方联系方式"/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="负责人" prop="ownerId">
|
||||
<user-select v-model="expressForm.ownerId"></user-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="负责人手机号" prop="ownerPhone">
|
||||
<el-input v-model="expressForm.ownerPhone" placeholder="请输入负责人手机号"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="计划到货时间" prop="planDate">
|
||||
<el-date-picker clearable
|
||||
v-model="expressForm.planDate"
|
||||
type="datetime"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
placeholder="请选择计划到货时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="物流公司标识" prop="expressType">
|
||||
<el-select v-model="expressForm.expressType" placeholder="请选择物流公司标识">
|
||||
<el-option
|
||||
v-for="dict in dict.type.oa_express_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="expressForm.remark" type="textarea" placeholder="请输入内容"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button :loading="buttonLoading" type="primary" @click="submitExpress">确 定</el-button>
|
||||
<el-button @click="cancelExpress">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
|
||||
<el-drawer
|
||||
title="图片列表"
|
||||
:visible.sync="imageDrawer"
|
||||
direction="rtl"
|
||||
>
|
||||
<image-preview v-for="img in srcList" :src="img" :width="150" :height="150" />
|
||||
</el-drawer>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { addExpress, updateExpress } from "@/api/wms/express";
|
||||
import { addReportDetail, delReportDetail, getReportDetail, listReportDetail, updateReportDetail } from "@/api/wms/reportDetail";
|
||||
import UserSelect from "@/components/KLPService/UserSelect/index.vue";
|
||||
|
||||
export default {
|
||||
name: "ReportDetail",
|
||||
dicts:['expressType'],
|
||||
components: {UserSelect},
|
||||
data() {
|
||||
return {
|
||||
// 按钮loading
|
||||
buttonLoading: false,
|
||||
expressOpen:false,
|
||||
imageDrawer:false,
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 设计项目汇报详情表格数据
|
||||
reportDetailList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
summaryId: undefined,
|
||||
deviceCode: undefined,
|
||||
category: undefined,
|
||||
deviceDescription: undefined,
|
||||
reportDetail: undefined,
|
||||
},
|
||||
// 表单参数
|
||||
form: {
|
||||
detailId: undefined,
|
||||
summaryId: this.$route.params && this.$route.params.summaryId,
|
||||
deviceCode: undefined,
|
||||
category: undefined,
|
||||
deviceDescription: "发货",
|
||||
reportDetail: undefined,
|
||||
ossIds: undefined,
|
||||
images: '',
|
||||
createBy: undefined,
|
||||
createTime: undefined,
|
||||
updateBy: undefined,
|
||||
updateTime: undefined,
|
||||
delFlag: undefined,
|
||||
remark: undefined,
|
||||
},
|
||||
expressForm:{},
|
||||
// 表单校验
|
||||
rules: {
|
||||
detailId: [
|
||||
{ required: true, message: "主键ID不能为空", trigger: "blur" }
|
||||
],
|
||||
summaryId: [
|
||||
{ required: true, message: "关联汇报概述ID不能为空", trigger: "blur" }
|
||||
],
|
||||
deviceCode: [
|
||||
{ required: true, message: "货物编号不能为空", trigger: "blur" }
|
||||
],
|
||||
category: [
|
||||
{ required: true, message: "货物类别不能为空", trigger: "blur" }
|
||||
],
|
||||
deviceDescription: [
|
||||
{ required: true, message: "货物说明不能为空", trigger: "blur" }
|
||||
],
|
||||
reportDetail: [
|
||||
{ required: true, message: "收发货详情不能为空", trigger: "blur" }
|
||||
],
|
||||
ossIds: [
|
||||
{ required: true, message: "关联图像 OSS ID 列表不能为空", trigger: "blur" }
|
||||
],
|
||||
expressId: [
|
||||
{required: true, message: "主键id不能为空", trigger: "blur"}
|
||||
],
|
||||
expressCode: [
|
||||
{required: true, message: "物流编号不能为空", trigger: "blur"}
|
||||
],
|
||||
status: [
|
||||
{required: true, message: "数据状态0未确认1进行中2已完成不能为空", trigger: "change"}
|
||||
],
|
||||
supplyName: [
|
||||
{required: true, message: "供应商姓名不能为空", trigger: "blur"}
|
||||
],
|
||||
supplyPhone: [
|
||||
{required: true, message: "供应商联系方式不能为空", trigger: "blur"}
|
||||
],
|
||||
ownerId: [
|
||||
{required: true, message: "负责人id不能为空", trigger: "blur"}
|
||||
],
|
||||
ownerPhone: [
|
||||
{required: true, message: "负责人手机号不能为空", trigger: "blur"}
|
||||
],
|
||||
planDate: [
|
||||
{required: true, message: "计划到货时间不能为空", trigger: "blur"}
|
||||
],
|
||||
expressType: [
|
||||
{required: true, message: "物流公司标识不能为空", trigger: "change"}
|
||||
],
|
||||
},
|
||||
categoryList: [], // 货物类别本地缓存
|
||||
imageList:'',
|
||||
srcList:[],
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.queryParams.summaryId = this.$route.params && this.$route.params.summaryId;
|
||||
this.form.summaryId = this.$route.params && this.$route.params.summaryId;
|
||||
this.getList();
|
||||
this.initCategoryList();
|
||||
},
|
||||
|
||||
methods: {
|
||||
/** 查询设计项目汇报详情列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listReportDetail(this.queryParams).then(response => {
|
||||
this.reportDetailList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
// 更新本地类别缓存
|
||||
this.updateCategoryList(response.rows);
|
||||
});
|
||||
},
|
||||
// 初始化货物类别缓存
|
||||
initCategoryList() {
|
||||
listReportDetail({pageSize: 9999}).then(response => {
|
||||
this.updateCategoryList(response.rows);
|
||||
});
|
||||
},
|
||||
|
||||
// 从rows中提取所有category并去重
|
||||
updateCategoryList(rows) {
|
||||
const set = new Set(this.categoryList);
|
||||
rows.forEach(item => {
|
||||
if (item.category) set.add(item.category);
|
||||
});
|
||||
this.categoryList = Array.from(set);
|
||||
},
|
||||
// 自动补全方法
|
||||
categoryQuerySearch(queryString, cb) {
|
||||
const results = queryString
|
||||
? this.categoryList
|
||||
.filter(cat => cat && cat.toLowerCase().includes(queryString.toLowerCase()))
|
||||
.map(cat => ({value: cat}))
|
||||
: this.categoryList.map(cat => ({value: cat}));
|
||||
cb(results);
|
||||
},
|
||||
// 搜索表单选择
|
||||
handleCategorySelect(item) {
|
||||
this.queryParams.category = item.value;
|
||||
},
|
||||
// 弹窗表单选择
|
||||
handleCategorySelectForm(item) {
|
||||
this.form.category = item.value;
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
this.resetExpress()
|
||||
},
|
||||
|
||||
cancelExpress(){
|
||||
this.expressOpen = false;
|
||||
this.reset();
|
||||
this.resetExpress()
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
detailId: undefined,
|
||||
summaryId: this.$route.params && this.$route.params.summaryId,
|
||||
deviceCode: undefined,
|
||||
category: undefined,
|
||||
deviceDescription: "发货",
|
||||
reportDetail: undefined,
|
||||
ossIds: undefined,
|
||||
images: '',
|
||||
createBy: undefined,
|
||||
createTime: undefined,
|
||||
updateBy: undefined,
|
||||
updateTime: undefined,
|
||||
delFlag: undefined,
|
||||
remark: undefined,
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
|
||||
// 表单重置
|
||||
resetExpress() {
|
||||
this.form = {
|
||||
expressId: undefined,
|
||||
expressCode: undefined,
|
||||
status: undefined,
|
||||
supplyName: undefined,
|
||||
supplyPhone: undefined,
|
||||
ownerId: undefined,
|
||||
ownerPhone: undefined,
|
||||
planDate: undefined,
|
||||
expressType: undefined,
|
||||
createBy: undefined,
|
||||
createTime: undefined,
|
||||
updateBy: undefined,
|
||||
updateTime: undefined,
|
||||
delFlag: undefined,
|
||||
remark: undefined
|
||||
};
|
||||
this.resetForm("expressForm");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.detailId)
|
||||
this.single = selection.length !== 1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加设计项目汇报详情";
|
||||
},
|
||||
|
||||
/** 新增按钮操作 */
|
||||
handleAddExpress(row) {
|
||||
this.resetExpress();
|
||||
this.expressOpen = true;
|
||||
this.expressForm = row.detailId;
|
||||
this.title = "新增发货记录";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.loading = true;
|
||||
this.reset();
|
||||
const detailId = row.detailId || this.ids
|
||||
getReportDetail(detailId).then(response => {
|
||||
this.loading = false;
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改设计项目汇报详情";
|
||||
});
|
||||
},
|
||||
submitExpress(){
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
this.buttonLoading = true;
|
||||
if (this.expressForm.expressId != null) {
|
||||
updateExpress(this.expressForm).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}).finally(() => {
|
||||
this.buttonLoading = false;
|
||||
});
|
||||
} else {
|
||||
addExpress(this.expressForm).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}).finally(() => {
|
||||
this.buttonLoading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
this.buttonLoading = true;
|
||||
if (this.form.detailId != null) {
|
||||
updateReportDetail(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}).finally(() => {
|
||||
this.buttonLoading = false;
|
||||
});
|
||||
} else {
|
||||
addReportDetail(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}).finally(() => {
|
||||
this.buttonLoading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.detailId || this.ids;
|
||||
this.$modal.confirm('是否确认删除编号为"' + ids + '"的数据项?').then(() => {
|
||||
this.loading = true;
|
||||
return delReportDetail(ids);
|
||||
}).then(() => {
|
||||
this.loading = false;
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {
|
||||
}).finally(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('system/reportDetail/export', {
|
||||
...this.queryParams
|
||||
}, `reportDetail_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
/** 查看图片详情 */
|
||||
handleImageDetail(row) {
|
||||
this.imageList = row.ossIds;
|
||||
this.imageDrawer = true;
|
||||
this.getImageList()
|
||||
},
|
||||
getImageList() {
|
||||
let real_src_list = this.imageList.split(",");
|
||||
let srcList = [];
|
||||
real_src_list.forEach(item => {
|
||||
return srcList.push(item);
|
||||
});
|
||||
this.srcList = srcList;
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
378
klp-ui/src/views/wms/rxgood/index.vue
Normal file
378
klp-ui/src/views/wms/rxgood/index.vue
Normal file
@@ -0,0 +1,378 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
|
||||
<el-form-item label="收发货标题" prop="reportTitle">
|
||||
<el-input
|
||||
v-model="queryParams.reportTitle"
|
||||
placeholder="请输入收发货标题"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="收发货日期" prop="reportDate">
|
||||
<el-date-picker clearable
|
||||
v-model="queryParams.reportDate"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="请选择收发货日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="经办人" prop="reporter">
|
||||
<el-input
|
||||
v-model="queryParams.reporter"
|
||||
placeholder="请输入经办人"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="涉及项目" prop="projectId">
|
||||
<el-select style="width: 100%;" v-model="form.projectId" placeholder="请输入涉及项目">
|
||||
<el-option
|
||||
v-for="item in projectList"
|
||||
:key="item.projectId"
|
||||
:label="item.projectName"
|
||||
:value="item.projectId"
|
||||
>
|
||||
{{ item.projectName }}
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>-->
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="reportSummaryList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="序号" align="center" type="index" v-if="true"/>
|
||||
<el-table-column label="收发货标题" align="center" prop="reportTitle">
|
||||
<template slot-scope="scope">
|
||||
<router-link class="link-type" :to="'/exp/rx/detail/' + scope.row.summaryId">{{ scope.row.reportTitle }}</router-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="最近汇报时间" align="center" prop="lastUpdateTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.lastUpdateTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="收发货日期" align="center" prop="reportDate" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.reportDate, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="经办人" align="center" prop="reporter" />
|
||||
<el-table-column label="涉及项目" align="center" prop="projectName" />
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改涉及项目汇报概述对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="50%" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
||||
<el-form-item label="收发货标题" prop="reportTitle">
|
||||
<el-input v-model="form.reportTitle" placeholder="请输入收发货标题" />
|
||||
</el-form-item>
|
||||
<el-form-item label="收发货日期" prop="reportDate">
|
||||
<el-date-picker clearable
|
||||
v-model="form.reportDate"
|
||||
type="datetime"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
placeholder="请选择收发货日期"
|
||||
style="width: 100%;">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="经办人" prop="reporter">
|
||||
<el-input v-model="form.reporter" placeholder="请输入经办人" />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="涉及项目" prop="projectId">
|
||||
<el-select style="width: 100%;" v-model="form.projectId" placeholder="请输入涉及项目">
|
||||
<el-option
|
||||
v-for="item in projectList"
|
||||
:key="item.projectId"
|
||||
:label="item.projectName"
|
||||
:value="item.projectId"
|
||||
>
|
||||
{{ item.projectName }}
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>-->
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// import { listProject } from "@/api/wms/project";
|
||||
import { addReportSummary, delReportSummary, getReportSummary, listReportSummary, updateReportSummary } from "@/api/wms/reportSummary";
|
||||
|
||||
export default {
|
||||
name: "ReportSummary",
|
||||
data() {
|
||||
return {
|
||||
// projectList: [],
|
||||
// 按钮loading
|
||||
buttonLoading: false,
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 涉及项目汇报概述表格数据
|
||||
reportSummaryList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
reportTitle: undefined,
|
||||
reportDate: undefined,
|
||||
reporter: undefined,
|
||||
projectId: undefined,
|
||||
type: 2
|
||||
},
|
||||
// 表单参数
|
||||
form: {
|
||||
summaryId: undefined,
|
||||
reportTitle: undefined,
|
||||
reportDate: undefined,
|
||||
reporter: undefined,
|
||||
projectId: undefined,
|
||||
createBy: undefined,
|
||||
createTime: undefined,
|
||||
updateBy: undefined,
|
||||
updateTime: undefined,
|
||||
delFlag: undefined,
|
||||
remark: undefined,
|
||||
type: 2
|
||||
},
|
||||
// 表单校验
|
||||
rules: {
|
||||
summaryId: [
|
||||
{ required: true, message: "主键ID不能为空", trigger: "blur" }
|
||||
],
|
||||
reportTitle: [
|
||||
{ required: true, message: "收发货标题不能为空", trigger: "blur" }
|
||||
],
|
||||
reportDate: [
|
||||
{ required: true, message: "收发货日期不能为空", trigger: "blur" }
|
||||
],
|
||||
reporter: [
|
||||
{ required: true, message: "经办人不能为空", trigger: "blur" }
|
||||
],
|
||||
projectId: [
|
||||
{ required: true, message: "涉及项目不能为空", trigger: "blur" }
|
||||
],
|
||||
remark: [
|
||||
{ required: true, message: "备注不能为空", trigger: "blur" }
|
||||
]
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
// this.getProjectList()
|
||||
},
|
||||
methods: {
|
||||
/** 查询涉及项目汇报概述列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listReportSummary(this.queryParams).then(response => {
|
||||
this.reportSummaryList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
/*getProjectList() {
|
||||
listProject({ pageSize: 999 }).then(({ rows }) => {
|
||||
this.projectList = rows;
|
||||
})
|
||||
},*/
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
summaryId: undefined,
|
||||
reportTitle: undefined,
|
||||
reportDate: undefined,
|
||||
reporter: undefined,
|
||||
projectId: undefined,
|
||||
createBy: undefined,
|
||||
createTime: undefined,
|
||||
updateBy: undefined,
|
||||
updateTime: undefined,
|
||||
delFlag: undefined,
|
||||
remark: undefined,
|
||||
type: 2
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.summaryId)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加涉及项目汇报概述";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.loading = true;
|
||||
this.reset();
|
||||
const summaryId = row.summaryId || this.ids
|
||||
getReportSummary(summaryId).then(response => {
|
||||
this.loading = false;
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改涉及项目汇报概述";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
this.buttonLoading = true;
|
||||
if (this.form.summaryId != null) {
|
||||
updateReportSummary(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}).finally(() => {
|
||||
this.buttonLoading = false;
|
||||
});
|
||||
} else {
|
||||
addReportSummary(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}).finally(() => {
|
||||
this.buttonLoading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.summaryId || this.ids;
|
||||
this.$modal.confirm('是否确认删除涉及项目汇报概述编号为"' + ids + '"的数据项?').then(() => {
|
||||
this.loading = true;
|
||||
return delReportSummary(ids);
|
||||
}).then(() => {
|
||||
this.loading = false;
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {
|
||||
}).finally(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('system/reportSummary/export', {
|
||||
...this.queryParams
|
||||
}, `reportSummary_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@@ -40,6 +40,21 @@
|
||||
<artifactId>fastjson</artifactId>
|
||||
<version>1.2.83</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 阿里JSON解析器 -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.fastjson2</groupId>
|
||||
<artifactId>fastjson2</artifactId>
|
||||
<version>2.0.35</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.zto.zop</groupId>
|
||||
<artifactId>zopsdk</artifactId>
|
||||
<version>0.11</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.yundasys</groupId>
|
||||
<artifactId>kfpt-sdk</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
||||
@@ -0,0 +1,107 @@
|
||||
package com.klp.controller;
|
||||
|
||||
import com.klp.common.annotation.Log;
|
||||
import com.klp.common.annotation.RepeatSubmit;
|
||||
import com.klp.common.core.controller.BaseController;
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
import com.klp.common.core.domain.R;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
import com.klp.common.core.validate.AddGroup;
|
||||
import com.klp.common.core.validate.EditGroup;
|
||||
import com.klp.common.enums.BusinessType;
|
||||
import com.klp.common.utils.poi.ExcelUtil;
|
||||
import com.klp.domain.bo.WmsExpressBo;
|
||||
import com.klp.domain.vo.WmsExpressVo;
|
||||
import com.klp.service.IWmsExpressService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 物流预览
|
||||
*
|
||||
* @author hdka
|
||||
* @date 2025-07-20
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/oa/express")
|
||||
public class WmsExpressController extends BaseController {
|
||||
|
||||
private final IWmsExpressService iWmsExpressService;
|
||||
|
||||
/**
|
||||
* 查询物流预览列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<WmsExpressVo> list(WmsExpressBo bo, PageQuery pageQuery) {
|
||||
return iWmsExpressService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出物流预览列表
|
||||
*/
|
||||
@Log(title = "物流预览", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(WmsExpressBo bo, HttpServletResponse response) {
|
||||
List<WmsExpressVo> list = iWmsExpressService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "物流预览", WmsExpressVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取物流预览详细信息
|
||||
*
|
||||
* @param expressId 主键
|
||||
*/
|
||||
@GetMapping("/{expressId}")
|
||||
public R<WmsExpressVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long expressId) {
|
||||
return R.ok(iWmsExpressService.queryById(expressId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增物流预览
|
||||
*/
|
||||
@Log(title = "物流预览", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody WmsExpressBo bo) {
|
||||
return toAjax(iWmsExpressService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改物流预览
|
||||
*/
|
||||
@Log(title = "物流预览", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody WmsExpressBo bo) {
|
||||
return toAjax(iWmsExpressService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除物流预览
|
||||
*
|
||||
* @param expressIds 主键串
|
||||
*/
|
||||
@Log(title = "物流预览", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{expressIds}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] expressIds) {
|
||||
return toAjax(iWmsExpressService.deleteWithValidByIds(Arrays.asList(expressIds), true));
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/refresh/{expressIds}")
|
||||
public R<Void> getRefreshExpress(@PathVariable Long[] expressIds) throws IOException {
|
||||
return toAjax(iWmsExpressService.getRefreshExpress(Arrays.asList(expressIds)));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
package com.klp.controller;
|
||||
|
||||
import com.klp.common.annotation.Log;
|
||||
import com.klp.common.annotation.RepeatSubmit;
|
||||
import com.klp.common.core.controller.BaseController;
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
import com.klp.common.core.domain.R;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
import com.klp.common.core.validate.AddGroup;
|
||||
import com.klp.common.core.validate.EditGroup;
|
||||
import com.klp.common.enums.BusinessType;
|
||||
import com.klp.common.utils.poi.ExcelUtil;
|
||||
import com.klp.domain.bo.WmsExpressQuestionBo;
|
||||
import com.klp.domain.vo.WmsExpressQuestionVo;
|
||||
import com.klp.service.IWmsExpressQuestionService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 快递问题
|
||||
*
|
||||
* @author hdka
|
||||
* @date 2025-07-21
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/oa/expressQuestion")
|
||||
public class WmsExpressQuestionController extends BaseController {
|
||||
|
||||
private final IWmsExpressQuestionService IWmsExpressQuestionService;
|
||||
|
||||
/**
|
||||
* 查询快递问题列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<WmsExpressQuestionVo> list(WmsExpressQuestionBo bo, PageQuery pageQuery) {
|
||||
return IWmsExpressQuestionService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出快递问题列表
|
||||
*/
|
||||
@Log(title = "快递问题", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(WmsExpressQuestionBo bo, HttpServletResponse response) {
|
||||
List<WmsExpressQuestionVo> list = IWmsExpressQuestionService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "快递问题", WmsExpressQuestionVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取快递问题详细信息
|
||||
*
|
||||
* @param questionId 主键
|
||||
*/
|
||||
@GetMapping("/{questionId}")
|
||||
public R<WmsExpressQuestionVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long questionId) {
|
||||
return R.ok(IWmsExpressQuestionService.queryById(questionId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增快递问题
|
||||
*/
|
||||
@Log(title = "快递问题", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody WmsExpressQuestionBo bo) {
|
||||
return toAjax(IWmsExpressQuestionService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改快递问题
|
||||
*/
|
||||
@Log(title = "快递问题", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody WmsExpressQuestionBo bo) {
|
||||
return toAjax(IWmsExpressQuestionService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除快递问题
|
||||
*
|
||||
* @param questionIds 主键串
|
||||
*/
|
||||
@Log(title = "快递问题", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{questionIds}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] questionIds) {
|
||||
return toAjax(IWmsExpressQuestionService.deleteWithValidByIds(Arrays.asList(questionIds), true));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
package com.klp.controller;
|
||||
|
||||
import com.klp.common.annotation.Log;
|
||||
import com.klp.common.annotation.RepeatSubmit;
|
||||
import com.klp.common.core.controller.BaseController;
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
import com.klp.common.core.domain.R;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
import com.klp.common.core.validate.AddGroup;
|
||||
import com.klp.common.core.validate.EditGroup;
|
||||
import com.klp.common.enums.BusinessType;
|
||||
import com.klp.common.utils.poi.ExcelUtil;
|
||||
import com.klp.domain.bo.WmsReportDetailBo;
|
||||
import com.klp.domain.vo.WmsReportDetailVo;
|
||||
import com.klp.service.IWmsReportDetailService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设计项目汇报详情
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-05-13
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/system/reportDetail")
|
||||
public class WmsReportDetailController extends BaseController {
|
||||
|
||||
private final IWmsReportDetailService IWmsReportDetailService;
|
||||
|
||||
/**
|
||||
* 查询设计项目汇报详情列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<WmsReportDetailVo> list(WmsReportDetailBo bo, PageQuery pageQuery) {
|
||||
return IWmsReportDetailService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出设计项目汇报详情列表
|
||||
*/
|
||||
@Log(title = "设计项目汇报详情", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(WmsReportDetailBo bo, HttpServletResponse response) {
|
||||
List<WmsReportDetailVo> list = IWmsReportDetailService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "设计项目汇报详情", WmsReportDetailVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取设计项目汇报详情详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@GetMapping("/{id}")
|
||||
public R<WmsReportDetailVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(IWmsReportDetailService.queryById(id));
|
||||
}
|
||||
// /**
|
||||
// * 获取设计项目汇报详情详细信息
|
||||
// *
|
||||
// * @param projectId 主键
|
||||
// */
|
||||
// @GetMapping("/project/{projectId}")
|
||||
// public R<List<WmsReportDetailVo>> listReportDetailByProjectId(@NotNull(message = "主键不能为空")
|
||||
// @PathVariable Long projectId) {
|
||||
// return R.ok(IWmsReportDetailService.queryByProjectId(projectId));
|
||||
// }
|
||||
|
||||
/**
|
||||
* 新增设计项目汇报详情
|
||||
*/
|
||||
@Log(title = "设计项目汇报详情", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody WmsReportDetailBo bo) {
|
||||
return toAjax(IWmsReportDetailService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改设计项目汇报详情
|
||||
*/
|
||||
@Log(title = "设计项目汇报详情", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody WmsReportDetailBo bo) {
|
||||
return toAjax(IWmsReportDetailService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除设计项目汇报详情
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(IWmsReportDetailService.deleteWithValidByIds(Arrays.asList(ids), true));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
package com.klp.controller;
|
||||
|
||||
import com.klp.common.annotation.Log;
|
||||
import com.klp.common.annotation.RepeatSubmit;
|
||||
import com.klp.common.core.controller.BaseController;
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
import com.klp.common.core.domain.R;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
import com.klp.common.core.validate.AddGroup;
|
||||
import com.klp.common.core.validate.EditGroup;
|
||||
import com.klp.common.enums.BusinessType;
|
||||
import com.klp.common.utils.poi.ExcelUtil;
|
||||
import com.klp.domain.bo.WmsReportSummaryBo;
|
||||
import com.klp.domain.vo.WmsReportSummaryVo;
|
||||
import com.klp.service.IWmsReportSummaryService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设计项目汇报概述
|
||||
*
|
||||
* @author cpy
|
||||
* @date 2025-05-13
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/system/reportSummary")
|
||||
public class WmsReportSummaryController extends BaseController {
|
||||
|
||||
private final IWmsReportSummaryService IWmsReportSummaryService;
|
||||
|
||||
/**
|
||||
* 查询设计项目汇报概述列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<WmsReportSummaryVo> list(WmsReportSummaryBo bo, PageQuery pageQuery) {
|
||||
return IWmsReportSummaryService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出设计项目汇报概述列表
|
||||
*/
|
||||
@Log(title = "设计项目汇报概述", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(WmsReportSummaryBo bo, HttpServletResponse response) {
|
||||
List<WmsReportSummaryVo> list = IWmsReportSummaryService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "设计项目汇报概述", WmsReportSummaryVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取设计项目汇报概述详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@GetMapping("/{id}")
|
||||
public R<WmsReportSummaryVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(IWmsReportSummaryService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增设计项目汇报概述
|
||||
*/
|
||||
@Log(title = "设计项目汇报概述", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody WmsReportSummaryBo bo) {
|
||||
return toAjax(IWmsReportSummaryService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改设计项目汇报概述
|
||||
*/
|
||||
@Log(title = "设计项目汇报概述", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody WmsReportSummaryBo bo) {
|
||||
return toAjax(IWmsReportSummaryService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除设计项目汇报概述
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@Log(title = "设计项目汇报概述", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(IWmsReportSummaryService.deleteWithValidByIds(Arrays.asList(ids), true));
|
||||
}
|
||||
}
|
||||
86
klp-wms/src/main/java/com/klp/domain/WmsExpress.java
Normal file
86
klp-wms/src/main/java/com/klp/domain/WmsExpress.java
Normal file
@@ -0,0 +1,86 @@
|
||||
package com.klp.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.klp.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 物流预览对象 oa_express
|
||||
*
|
||||
* @author hdka
|
||||
* @date 2025-07-20
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("oa_express")
|
||||
public class WmsExpress extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@TableId(value = "express_id")
|
||||
private Long expressId;
|
||||
|
||||
/**
|
||||
* 物流编号
|
||||
*/
|
||||
private String expressCode;
|
||||
/**
|
||||
* 数据状态0未确认1进行中2已完成
|
||||
*/
|
||||
private Long status;
|
||||
/**
|
||||
* 供应商姓名
|
||||
*/
|
||||
private String supplyName;
|
||||
/**
|
||||
* 供应商联系方式
|
||||
*/
|
||||
private String supplyPhone;
|
||||
/**
|
||||
* 负责人id
|
||||
*/
|
||||
private Long ownerId;
|
||||
/**
|
||||
* 负责人手机号(快递手机号)
|
||||
*/
|
||||
private String ownerPhone;
|
||||
/**
|
||||
* 计划到货时间
|
||||
*/
|
||||
private Date planDate;
|
||||
/**
|
||||
* 物流公司标识
|
||||
*/
|
||||
private String expressType;
|
||||
/**
|
||||
* 删除标志
|
||||
*/
|
||||
@TableLogic
|
||||
private Long delFlag;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
/**
|
||||
* 节点变化时间
|
||||
*/
|
||||
private Date lastUpdateTime;
|
||||
|
||||
/**
|
||||
* 当前节点
|
||||
*/
|
||||
private String lastStatus;
|
||||
|
||||
|
||||
|
||||
}
|
||||
60
klp-wms/src/main/java/com/klp/domain/WmsExpressQuestion.java
Normal file
60
klp-wms/src/main/java/com/klp/domain/WmsExpressQuestion.java
Normal file
@@ -0,0 +1,60 @@
|
||||
package com.klp.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.klp.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 快递问题对象 oa_express_question
|
||||
*
|
||||
* @author hdka
|
||||
* @date 2025-07-21
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("oa_express_question")
|
||||
public class WmsExpressQuestion extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@TableId(value = "question_id")
|
||||
private Long questionId;
|
||||
/**
|
||||
* 关联快递
|
||||
*/
|
||||
private Long expressId;
|
||||
/**
|
||||
* 问题描述
|
||||
*/
|
||||
private String description;
|
||||
/**
|
||||
* 汇报时间
|
||||
*/
|
||||
private Date reportTime;
|
||||
/**
|
||||
* 汇报人
|
||||
*/
|
||||
private String reportBy;
|
||||
/**
|
||||
* 0未解决1已解决
|
||||
*/
|
||||
private Long status;
|
||||
/**
|
||||
* 删除标志
|
||||
*/
|
||||
@TableLogic
|
||||
private Long delFlag;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
}
|
||||
62
klp-wms/src/main/java/com/klp/domain/WmsReportDetail.java
Normal file
62
klp-wms/src/main/java/com/klp/domain/WmsReportDetail.java
Normal file
@@ -0,0 +1,62 @@
|
||||
package com.klp.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.klp.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 设计项目汇报详情对象 oa_report_detail
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-05-13
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("oa_report_detail")
|
||||
public class WmsReportDetail extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(value = "detail_id")
|
||||
private Long detailId;
|
||||
/**
|
||||
* 关联汇报概述ID(oa_report_summary.id)
|
||||
*/
|
||||
private Long summaryId;
|
||||
/**
|
||||
* 设备唯一编号
|
||||
*/
|
||||
private String deviceCode;
|
||||
/**
|
||||
* 设备类别
|
||||
*/
|
||||
private String category;
|
||||
/**
|
||||
* 设备生产说明
|
||||
*/
|
||||
private String deviceDescription;
|
||||
/**
|
||||
* 汇报详情内容(含文字、图像说明等)
|
||||
*/
|
||||
private String reportDetail;
|
||||
/**
|
||||
* 关联图像 OSS ID 列表(逗号分隔)
|
||||
*/
|
||||
private String ossIds;
|
||||
/**
|
||||
* 删除标志(0 正常,1 删除)
|
||||
*/
|
||||
@TableLogic
|
||||
private Long delFlag;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
}
|
||||
54
klp-wms/src/main/java/com/klp/domain/WmsReportSummary.java
Normal file
54
klp-wms/src/main/java/com/klp/domain/WmsReportSummary.java
Normal file
@@ -0,0 +1,54 @@
|
||||
package com.klp.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.klp.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 设计项目汇报概述对象 oa_report_summary
|
||||
*
|
||||
* @author cpy
|
||||
* @date 2025-05-13
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("oa_report_summary")
|
||||
public class WmsReportSummary extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(value = "summary_id")
|
||||
private Long summaryId;
|
||||
/**
|
||||
* 汇报标题
|
||||
*/
|
||||
private String reportTitle;
|
||||
/**
|
||||
* 汇报日期
|
||||
*/
|
||||
private Date reportDate;
|
||||
/**
|
||||
* 汇报人
|
||||
*/
|
||||
private String reporter;
|
||||
/**
|
||||
* 删除标志(0 正常,1 删除)
|
||||
*/
|
||||
@TableLogic
|
||||
private Long delFlag;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
private Long type;
|
||||
|
||||
}
|
||||
81
klp-wms/src/main/java/com/klp/domain/bo/WmsExpressBo.java
Normal file
81
klp-wms/src/main/java/com/klp/domain/bo/WmsExpressBo.java
Normal file
@@ -0,0 +1,81 @@
|
||||
package com.klp.domain.bo;
|
||||
|
||||
import com.klp.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 物流预览业务对象 oa_express
|
||||
*
|
||||
* @author hdka
|
||||
* @date 2025-07-20
|
||||
*/
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class WmsExpressBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
private Long expressId;
|
||||
|
||||
/**
|
||||
* 物流编号
|
||||
*/
|
||||
private String expressCode;
|
||||
|
||||
/**
|
||||
* 数据状态0未确认1进行中2已完成
|
||||
*/
|
||||
private Long status;
|
||||
|
||||
/**
|
||||
* 供应商姓名
|
||||
*/
|
||||
private String supplyName;
|
||||
|
||||
/**
|
||||
* 供应商联系方式
|
||||
*/
|
||||
private String supplyPhone;
|
||||
|
||||
/**
|
||||
* 负责人id
|
||||
*/
|
||||
private Long ownerId;
|
||||
|
||||
/**
|
||||
* 负责人手机号(快递手机号)
|
||||
*/
|
||||
private String ownerPhone;
|
||||
|
||||
/**
|
||||
* 计划到货时间
|
||||
*/
|
||||
private Date planDate;
|
||||
|
||||
/**
|
||||
* 物流公司标识
|
||||
*/
|
||||
private String expressType;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
/**
|
||||
* 节点变化时间
|
||||
*/
|
||||
private Date lastUpdateTime;
|
||||
|
||||
/**
|
||||
* 当前节点
|
||||
*/
|
||||
private String lastStatus;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.klp.domain.bo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.klp.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 快递问题业务对象 oa_express_question
|
||||
*
|
||||
* @author hdka
|
||||
* @date 2025-07-21
|
||||
*/
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class WmsExpressQuestionBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
private Long questionId;
|
||||
|
||||
/**
|
||||
* 关联快递
|
||||
*/
|
||||
private Long expressId;
|
||||
|
||||
/**
|
||||
* 问题描述
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 汇报时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date reportTime;
|
||||
|
||||
/**
|
||||
* 汇报人
|
||||
*/
|
||||
private String reportBy;
|
||||
|
||||
/**
|
||||
* 0未解决1已解决
|
||||
*/
|
||||
private Long status;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package com.klp.domain.bo;
|
||||
|
||||
import com.klp.common.core.domain.BaseEntity;
|
||||
import com.klp.common.core.validate.EditGroup;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* 设计项目汇报详情业务对象 oa_report_detail
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-05-13
|
||||
*/
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class WmsReportDetailBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@NotNull(message = "主键ID不能为空", groups = { EditGroup.class })
|
||||
private Long detailId;
|
||||
|
||||
/**
|
||||
* 关联汇报概述ID(oa_report_summary.id)
|
||||
*/
|
||||
private Long summaryId;
|
||||
|
||||
/**
|
||||
* 设备唯一编号
|
||||
*/
|
||||
private String deviceCode;
|
||||
|
||||
/**
|
||||
* 设备类别
|
||||
*/
|
||||
private String category;
|
||||
|
||||
/**
|
||||
* 设备生产说明
|
||||
*/
|
||||
private String deviceDescription;
|
||||
|
||||
/**
|
||||
* 汇报详情内容(含文字、图像说明等)
|
||||
*/
|
||||
private String reportDetail;
|
||||
|
||||
/**
|
||||
* 关联图像 OSS ID 列表(逗号分隔)
|
||||
*/
|
||||
private String ossIds;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package com.klp.domain.bo;
|
||||
|
||||
import com.klp.common.core.domain.BaseEntity;
|
||||
import com.klp.common.core.validate.AddGroup;
|
||||
import com.klp.common.core.validate.EditGroup;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 设计项目汇报概述业务对象 oa_report_summary
|
||||
*
|
||||
* @author cpy
|
||||
* @date 2025-05-13
|
||||
*/
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class WmsReportSummaryBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@NotNull(message = "主键ID不能为空", groups = { EditGroup.class })
|
||||
private Long summaryId;
|
||||
|
||||
/**
|
||||
* 汇报标题
|
||||
*/
|
||||
@NotBlank(message = "汇报标题不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String reportTitle;
|
||||
|
||||
/**
|
||||
* 汇报日期
|
||||
*/
|
||||
@NotNull(message = "汇报日期不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Date reportDate;
|
||||
|
||||
/**
|
||||
* 汇报人
|
||||
*/
|
||||
@NotBlank(message = "汇报人不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String reporter;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
private Long type;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
package com.klp.domain.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
/**
|
||||
* 快递问题视图对象 oa_express_question
|
||||
*
|
||||
* @author hdka
|
||||
* @date 2025-07-21
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class WmsExpressQuestionVo {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@ExcelProperty(value = "主键id")
|
||||
private Long questionId;
|
||||
|
||||
/**
|
||||
* 关联快递
|
||||
*/
|
||||
@ExcelProperty(value = "关联快递")
|
||||
private Long expressId;
|
||||
|
||||
/**
|
||||
* 问题描述
|
||||
*/
|
||||
@ExcelProperty(value = "问题描述")
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 汇报时间
|
||||
*/
|
||||
@ExcelProperty(value = "汇报时间")
|
||||
private Date reportTime;
|
||||
|
||||
/**
|
||||
* 汇报人
|
||||
*/
|
||||
@ExcelProperty(value = "汇报人")
|
||||
private String reportBy;
|
||||
|
||||
/**
|
||||
* 0未解决1已解决
|
||||
*/
|
||||
@ExcelProperty(value = "状态")
|
||||
private Long status;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 快递单号
|
||||
*/
|
||||
private String expressCode;
|
||||
|
||||
|
||||
}
|
||||
116
klp-wms/src/main/java/com/klp/domain/vo/WmsExpressVo.java
Normal file
116
klp-wms/src/main/java/com/klp/domain/vo/WmsExpressVo.java
Normal file
@@ -0,0 +1,116 @@
|
||||
package com.klp.domain.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.klp.common.annotation.ExcelDictFormat;
|
||||
import com.klp.common.convert.ExcelDictConvert;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
/**
|
||||
* 物流预览视图对象 oa_express
|
||||
*
|
||||
* @author hdka
|
||||
* @date 2025-07-20
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class WmsExpressVo {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@ExcelProperty(value = "主键id")
|
||||
private Long expressId;
|
||||
|
||||
/**
|
||||
* 物流编号
|
||||
*/
|
||||
@ExcelProperty(value = "物流编号")
|
||||
private String expressCode;
|
||||
|
||||
/**
|
||||
* 数据状态0未确认1进行中2已完成
|
||||
*/
|
||||
@ExcelProperty(value = "数据状态0未确认1进行中2已完成")
|
||||
private Long status;
|
||||
|
||||
/**
|
||||
* 供应商姓名
|
||||
*/
|
||||
@ExcelProperty(value = "供应商姓名")
|
||||
private String supplyName;
|
||||
|
||||
/**
|
||||
* 供应商联系方式
|
||||
*/
|
||||
@ExcelProperty(value = "供应商联系方式")
|
||||
private String supplyPhone;
|
||||
|
||||
/**
|
||||
* 负责人id
|
||||
*/
|
||||
private Long ownerId;
|
||||
|
||||
|
||||
/**
|
||||
* 负责人id
|
||||
*/
|
||||
@ExcelProperty(value = "负责人")
|
||||
private String ownerName;
|
||||
|
||||
/**
|
||||
* 负责人手机号(快递手机号)
|
||||
*/
|
||||
@ExcelProperty(value = "负责人手机号", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "快=递手机号")
|
||||
private String ownerPhone;
|
||||
|
||||
/**
|
||||
* 计划到货时间
|
||||
*/
|
||||
@ExcelProperty(value = "计划到货时间")
|
||||
private Date planDate;
|
||||
|
||||
/**
|
||||
* 物流公司标识
|
||||
*/
|
||||
@ExcelProperty(value = "物流公司标识", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(dictType = "oa_express_type")
|
||||
private String expressType;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 接收时间
|
||||
*/
|
||||
private Date acceptTime;
|
||||
|
||||
/**
|
||||
* 物流状态
|
||||
*/
|
||||
private String firstStatusName;
|
||||
|
||||
/**
|
||||
* 节点变化时间
|
||||
*/
|
||||
private Date lastUpdateTime;
|
||||
|
||||
/**
|
||||
* 当前节点
|
||||
*/
|
||||
private String lastStatus;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
package com.klp.domain.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.klp.common.annotation.ExcelDictFormat;
|
||||
import com.klp.common.convert.ExcelDictConvert;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
/**
|
||||
* 设计项目汇报详情视图对象 oa_report_detail
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-05-13
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class WmsReportDetailVo {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@ExcelProperty(value = "主键ID")
|
||||
private Long detailId;
|
||||
|
||||
/**
|
||||
* 关联汇报概述ID(oa_report_summary.id)
|
||||
*/
|
||||
@ExcelProperty(value = "关联汇报概述ID", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "o=a_report_summary.id")
|
||||
private Long summaryId;
|
||||
|
||||
/**
|
||||
* 设备唯一编号
|
||||
*/
|
||||
@ExcelProperty(value = "设备唯一编号")
|
||||
private String deviceCode;
|
||||
|
||||
/**
|
||||
* 设备类别
|
||||
*/
|
||||
@ExcelProperty(value = "设备类别")
|
||||
private String category;
|
||||
|
||||
/**
|
||||
* 设备生产说明
|
||||
*/
|
||||
@ExcelProperty(value = "设备生产说明")
|
||||
private String deviceDescription;
|
||||
|
||||
/**
|
||||
* 汇报详情内容(含文字、图像说明等)
|
||||
*/
|
||||
@ExcelProperty(value = "汇报详情内容", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "含=文字、图像说明等")
|
||||
private String reportDetail;
|
||||
|
||||
/**
|
||||
* 关联图像 OSS ID 列表(逗号分隔)
|
||||
*/
|
||||
@ExcelProperty(value = "关联图像 OSS ID 列表", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "逗=号分隔")
|
||||
private String ossIds;
|
||||
|
||||
/**
|
||||
* 关联图像 OSS URL 列表
|
||||
*/
|
||||
@ExcelProperty(value = "关联图像 OSS URL 列表", converter = ExcelDictConvert.class)
|
||||
private String images;
|
||||
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package com.klp.domain.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
/**
|
||||
* 设计项目汇报概述视图对象 oa_report_summary
|
||||
*
|
||||
* @author cpy
|
||||
* @date 2025-05-13
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class WmsReportSummaryVo {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@ExcelProperty(value = "主键ID")
|
||||
private Long summaryId;
|
||||
|
||||
/**
|
||||
* 汇报标题
|
||||
*/
|
||||
@ExcelProperty(value = "汇报标题")
|
||||
private String reportTitle;
|
||||
|
||||
/**
|
||||
* 汇报日期
|
||||
*/
|
||||
@ExcelProperty(value = "汇报日期")
|
||||
private Date reportDate;
|
||||
|
||||
/**
|
||||
* 汇报人
|
||||
*/
|
||||
@ExcelProperty(value = "汇报人")
|
||||
private String reporter;
|
||||
|
||||
/**
|
||||
* 项目名称
|
||||
*/
|
||||
@ExcelProperty(value = "项目名称")
|
||||
private String projectName;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
private Long type;
|
||||
|
||||
@ExcelProperty(value = "最近更新时间")
|
||||
private Date lastUpdateTime;
|
||||
|
||||
}
|
||||
23
klp-wms/src/main/java/com/klp/mapper/WmsExpressMapper.java
Normal file
23
klp-wms/src/main/java/com/klp/mapper/WmsExpressMapper.java
Normal file
@@ -0,0 +1,23 @@
|
||||
package com.klp.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.klp.common.core.mapper.BaseMapperPlus;
|
||||
import com.klp.domain.WmsExpress;
|
||||
import com.klp.domain.vo.WmsExpressVo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 物流预览Mapper接口
|
||||
*
|
||||
* @author hdka
|
||||
* @date 2025-07-20
|
||||
*/
|
||||
public interface WmsExpressMapper extends BaseMapperPlus<WmsExpressMapper, WmsExpress, WmsExpressVo> {
|
||||
|
||||
Page<WmsExpressVo> selectVoPagePlus(@Param("build") Page<Object> build, @Param(Constants.WRAPPER) QueryWrapper<WmsExpress> lqw);
|
||||
|
||||
WmsExpressVo selectVoByIdPlus(@Param("expressId") Long expressId);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.klp.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.klp.common.core.mapper.BaseMapperPlus;
|
||||
import com.klp.domain.WmsExpressQuestion;
|
||||
import com.klp.domain.vo.WmsExpressQuestionVo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 快递问题Mapper接口
|
||||
*
|
||||
* @author hdka
|
||||
* @date 2025-07-21
|
||||
*/
|
||||
public interface WmsExpressQuestionMapper extends BaseMapperPlus<WmsExpressQuestionMapper, WmsExpressQuestion, WmsExpressQuestionVo> {
|
||||
|
||||
Page<WmsExpressQuestionVo> selectVoPagePlus(@Param("build") Page<Object> build, @Param(Constants.WRAPPER) QueryWrapper<WmsExpressQuestion> lqw);
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.klp.mapper;
|
||||
|
||||
import com.klp.common.core.mapper.BaseMapperPlus;
|
||||
import com.klp.domain.WmsReportDetail;
|
||||
import com.klp.domain.vo.WmsReportDetailVo;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设计项目汇报详情Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-05-13
|
||||
*/
|
||||
public interface WmsReportDetailMapper extends BaseMapperPlus<WmsReportDetailMapper, WmsReportDetail, WmsReportDetailVo> {
|
||||
@Select("SELECT url FROM sys_oss WHERE oss_id = #{ossId}")
|
||||
String selectImageUrlByOssId(String ossId);
|
||||
|
||||
|
||||
WmsReportDetailVo selectVoByIdPlus(Long id);
|
||||
|
||||
List<WmsReportDetailVo> queryByProjectId(Long projectId);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.klp.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.klp.common.core.mapper.BaseMapperPlus;
|
||||
import com.klp.domain.WmsReportSummary;
|
||||
import com.klp.domain.bo.WmsReportSummaryBo;
|
||||
import com.klp.domain.vo.WmsReportSummaryVo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 设计项目汇报概述Mapper接口
|
||||
*
|
||||
* @author cpy
|
||||
* @date 2025-05-13
|
||||
*/
|
||||
public interface WmsReportSummaryMapper extends BaseMapperPlus<WmsReportSummaryMapper, WmsReportSummary, WmsReportSummaryVo> {
|
||||
Page<WmsReportSummaryVo> selectVoPageWithProject(@Param("page") Page<?> page,
|
||||
@Param("bo") WmsReportSummaryBo bo);
|
||||
|
||||
}
|
||||
@@ -1,9 +1,7 @@
|
||||
package com.klp.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.klp.domain.WmsStock;
|
||||
import com.klp.domain.WmsStockLog;
|
||||
import com.klp.domain.vo.WmsStockLogVo;
|
||||
import com.klp.common.core.mapper.BaseMapperPlus;
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.klp.service;
|
||||
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
import com.klp.domain.bo.WmsExpressQuestionBo;
|
||||
import com.klp.domain.vo.WmsExpressQuestionVo;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 快递问题Service接口
|
||||
*
|
||||
* @author hdka
|
||||
* @date 2025-07-21
|
||||
*/
|
||||
public interface IWmsExpressQuestionService {
|
||||
|
||||
/**
|
||||
* 查询快递问题
|
||||
*/
|
||||
WmsExpressQuestionVo queryById(Long questionId);
|
||||
|
||||
/**
|
||||
* 查询快递问题列表
|
||||
*/
|
||||
TableDataInfo<WmsExpressQuestionVo> queryPageList(WmsExpressQuestionBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询快递问题列表
|
||||
*/
|
||||
List<WmsExpressQuestionVo> queryList(WmsExpressQuestionBo bo);
|
||||
|
||||
/**
|
||||
* 新增快递问题
|
||||
*/
|
||||
Boolean insertByBo(WmsExpressQuestionBo bo);
|
||||
|
||||
/**
|
||||
* 修改快递问题
|
||||
*/
|
||||
Boolean updateByBo(WmsExpressQuestionBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除快递问题信息
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.klp.service;
|
||||
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
import com.klp.domain.bo.WmsExpressBo;
|
||||
import com.klp.domain.vo.WmsExpressVo;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 物流预览Service接口
|
||||
*
|
||||
* @author hdka
|
||||
* @date 2025-07-20
|
||||
*/
|
||||
public interface IWmsExpressService {
|
||||
|
||||
/**
|
||||
* 查询物流预览
|
||||
*/
|
||||
WmsExpressVo queryById(Long expressId);
|
||||
|
||||
/**
|
||||
* 查询物流预览列表
|
||||
*/
|
||||
TableDataInfo<WmsExpressVo> queryPageList(WmsExpressBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询物流预览列表
|
||||
*/
|
||||
List<WmsExpressVo> queryList(WmsExpressBo bo);
|
||||
|
||||
/**
|
||||
* 新增物流预览
|
||||
*/
|
||||
Boolean insertByBo(WmsExpressBo bo);
|
||||
|
||||
/**
|
||||
* 修改物流预览
|
||||
*/
|
||||
Boolean updateByBo(WmsExpressBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除物流预览信息
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
|
||||
/**
|
||||
* 及时更新选中的状态
|
||||
* @param list
|
||||
* @return
|
||||
*/
|
||||
Boolean getRefreshExpress(List<Long> list) throws IOException;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.klp.service;
|
||||
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
import com.klp.domain.bo.WmsReportDetailBo;
|
||||
import com.klp.domain.vo.WmsReportDetailVo;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设计项目汇报详情Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-05-13
|
||||
*/
|
||||
public interface IWmsReportDetailService {
|
||||
|
||||
/**
|
||||
* 查询设计项目汇报详情
|
||||
*/
|
||||
WmsReportDetailVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 查询设计项目汇报详情列表
|
||||
*/
|
||||
TableDataInfo<WmsReportDetailVo> queryPageList(WmsReportDetailBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询设计项目汇报详情列表
|
||||
*/
|
||||
List<WmsReportDetailVo> queryList(WmsReportDetailBo bo);
|
||||
|
||||
/**
|
||||
* 新增设计项目汇报详情
|
||||
*/
|
||||
Boolean insertByBo(WmsReportDetailBo bo);
|
||||
|
||||
/**
|
||||
* 修改设计项目汇报详情
|
||||
*/
|
||||
Boolean updateByBo(WmsReportDetailBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除设计项目汇报详情信息
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
|
||||
/**
|
||||
* 根据项目查询细节
|
||||
* @param projectId
|
||||
* @return
|
||||
*/
|
||||
List<WmsReportDetailVo> queryByProjectId(@NotNull(message = "主键不能为空") Long projectId);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.klp.service;
|
||||
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
import com.klp.domain.bo.WmsReportSummaryBo;
|
||||
import com.klp.domain.vo.WmsReportSummaryVo;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设计项目汇报概述Service接口
|
||||
*
|
||||
* @author cpy
|
||||
* @date 2025-05-13
|
||||
*/
|
||||
public interface IWmsReportSummaryService {
|
||||
|
||||
/**
|
||||
* 查询设计项目汇报概述
|
||||
*/
|
||||
WmsReportSummaryVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 查询设计项目汇报概述列表
|
||||
*/
|
||||
TableDataInfo<WmsReportSummaryVo> queryPageList(WmsReportSummaryBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询设计项目汇报概述列表
|
||||
*/
|
||||
List<WmsReportSummaryVo> queryList(WmsReportSummaryBo bo);
|
||||
|
||||
/**
|
||||
* 新增设计项目汇报概述
|
||||
*/
|
||||
Boolean insertByBo(WmsReportSummaryBo bo);
|
||||
|
||||
/**
|
||||
* 修改设计项目汇报概述
|
||||
*/
|
||||
Boolean updateByBo(WmsReportSummaryBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除设计项目汇报概述信息
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
@@ -0,0 +1,150 @@
|
||||
package com.klp.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
import com.klp.common.helper.LoginHelper;
|
||||
import com.klp.common.utils.StringUtils;
|
||||
import com.klp.domain.WmsExpressQuestion;
|
||||
import com.klp.domain.bo.WmsExpressQuestionBo;
|
||||
import com.klp.domain.vo.WmsExpressQuestionVo;
|
||||
import com.klp.mapper.WmsExpressQuestionMapper;
|
||||
import com.klp.service.IWmsExpressQuestionService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 快递问题Service业务层处理
|
||||
*
|
||||
* @author hdka
|
||||
* @date 2025-07-21
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class WmsExpressQuestionServiceImpl implements IWmsExpressQuestionService {
|
||||
|
||||
private final WmsExpressQuestionMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询快递问题
|
||||
*/
|
||||
@Override
|
||||
public WmsExpressQuestionVo queryById(Long questionId){
|
||||
return baseMapper.selectVoById(questionId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询快递问题列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<WmsExpressQuestionVo> queryPageList(WmsExpressQuestionBo bo, PageQuery pageQuery) {
|
||||
QueryWrapper<WmsExpressQuestion> lqw = buildQueryWrapperPlus(bo);
|
||||
Page<WmsExpressQuestionVo> result = baseMapper.selectVoPagePlus(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询快递问题列表
|
||||
*/
|
||||
@Override
|
||||
public List<WmsExpressQuestionVo> queryList(WmsExpressQuestionBo bo) {
|
||||
LambdaQueryWrapper<WmsExpressQuestion> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
private LambdaQueryWrapper<WmsExpressQuestion> buildQueryWrapper(WmsExpressQuestionBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<WmsExpressQuestion> lqw = new LambdaQueryWrapper<>();
|
||||
|
||||
if (bo.getExpressId() != null) {
|
||||
lqw.eq(WmsExpressQuestion::getExpressId, bo.getExpressId());
|
||||
}
|
||||
if (StringUtils.isNotBlank(bo.getDescription())) {
|
||||
lqw.eq(WmsExpressQuestion::getDescription, bo.getDescription());
|
||||
}
|
||||
if (bo.getReportTime() != null) {
|
||||
lqw.eq(WmsExpressQuestion::getReportTime, bo.getReportTime());
|
||||
}
|
||||
if (StringUtils.isNotBlank(bo.getReportBy())) {
|
||||
lqw.eq(WmsExpressQuestion::getReportBy, bo.getReportBy());
|
||||
}
|
||||
if (bo.getStatus() != null) {
|
||||
lqw.eq(WmsExpressQuestion::getStatus, bo.getStatus());
|
||||
}
|
||||
return lqw;
|
||||
}
|
||||
|
||||
private QueryWrapper<WmsExpressQuestion> buildQueryWrapperPlus(WmsExpressQuestionBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
QueryWrapper<WmsExpressQuestion> qw = new QueryWrapper<>();
|
||||
// 设置表别名
|
||||
if (bo.getExpressId() != null) {
|
||||
qw.eq("oeq.express_id", bo.getExpressId());
|
||||
}
|
||||
if (StringUtils.isNotBlank(bo.getDescription())) {
|
||||
qw.eq("oeq.description", bo.getDescription());
|
||||
}
|
||||
if (bo.getReportTime() != null) {
|
||||
qw.eq("oeq.report_time", bo.getReportTime());
|
||||
}
|
||||
if (StringUtils.isNotBlank(bo.getReportBy())) {
|
||||
qw.eq("oeq.report_by", bo.getReportBy());
|
||||
}
|
||||
if (bo.getStatus() != null) {
|
||||
qw.eq("oeq.status", bo.getStatus());
|
||||
}
|
||||
// 逻辑删除
|
||||
qw.eq("oeq.del_flag", 0);
|
||||
|
||||
return qw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增快递问题
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(WmsExpressQuestionBo bo) {
|
||||
WmsExpressQuestion add = BeanUtil.toBean(bo, WmsExpressQuestion.class);
|
||||
validEntityBeforeSave(add);
|
||||
add.setReportBy(LoginHelper.getNickName());
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setQuestionId(add.getQuestionId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改快递问题
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(WmsExpressQuestionBo bo) {
|
||||
WmsExpressQuestion update = BeanUtil.toBean(bo, WmsExpressQuestion.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(WmsExpressQuestion entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除快递问题
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteBatchIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,246 @@
|
||||
package com.klp.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
import com.klp.common.utils.StringUtils;
|
||||
import com.klp.domain.WmsExpress;
|
||||
import com.klp.domain.bo.WmsExpressBo;
|
||||
import com.klp.domain.vo.WmsExpressVo;
|
||||
import com.klp.mapper.WmsExpressMapper;
|
||||
import com.klp.service.IWmsExpressService;
|
||||
import com.klp.utils.*;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 物流预览Service业务层处理
|
||||
*
|
||||
* @author hdka
|
||||
* @date 2025-07-20
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class WmsExpressServiceImpl implements IWmsExpressService {
|
||||
|
||||
private final WmsExpressMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询物流预览
|
||||
*/
|
||||
@Override
|
||||
public WmsExpressVo queryById(Long expressId){
|
||||
return baseMapper.selectVoByIdPlus(expressId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询物流预览列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<WmsExpressVo> queryPageList(WmsExpressBo bo, PageQuery pageQuery) {
|
||||
QueryWrapper<WmsExpress> lqw = buildQueryWrapperPlus(bo);
|
||||
Page<WmsExpressVo> result = baseMapper.selectVoPagePlus(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询物流预览列表
|
||||
*/
|
||||
@Override
|
||||
public List<WmsExpressVo> queryList(WmsExpressBo bo) {
|
||||
LambdaQueryWrapper<WmsExpress> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
private LambdaQueryWrapper<WmsExpress> buildQueryWrapper(WmsExpressBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<WmsExpress> lqw = new LambdaQueryWrapper<>();
|
||||
if (StringUtils.isNotBlank(bo.getExpressCode())) {
|
||||
lqw.like(WmsExpress::getExpressCode, bo.getExpressCode());
|
||||
}
|
||||
if (bo.getStatus() != null) {
|
||||
lqw.eq(WmsExpress::getStatus, bo.getStatus());
|
||||
}
|
||||
if (StringUtils.isNotBlank(bo.getSupplyName())) {
|
||||
lqw.like(WmsExpress::getSupplyName, bo.getSupplyName());
|
||||
}
|
||||
if (StringUtils.isNotBlank(bo.getSupplyPhone())) {
|
||||
lqw.eq(WmsExpress::getSupplyPhone, bo.getSupplyPhone());
|
||||
}
|
||||
if (bo.getOwnerId() != null) {
|
||||
lqw.eq(WmsExpress::getOwnerId, bo.getOwnerId());
|
||||
}
|
||||
if (StringUtils.isNotBlank(bo.getOwnerPhone())) {
|
||||
lqw.eq(WmsExpress::getOwnerPhone, bo.getOwnerPhone());
|
||||
}
|
||||
if (bo.getPlanDate() != null) {
|
||||
lqw.eq(WmsExpress::getPlanDate, bo.getPlanDate());
|
||||
}
|
||||
if (StringUtils.isNotBlank(bo.getExpressType())) {
|
||||
lqw.eq(WmsExpress::getExpressType, bo.getExpressType());
|
||||
}
|
||||
return lqw;
|
||||
}
|
||||
|
||||
private QueryWrapper<WmsExpress> buildQueryWrapperPlus(WmsExpressBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
QueryWrapper<WmsExpress> qw = new QueryWrapper<>();
|
||||
// 设置表别名
|
||||
if (StringUtils.isNotBlank(bo.getExpressCode())) {
|
||||
qw.like("oe.express_code", bo.getExpressCode());
|
||||
}
|
||||
if (bo.getStatus() != null) {
|
||||
qw.eq("oe.status", bo.getStatus());
|
||||
}
|
||||
if (StringUtils.isNotBlank(bo.getSupplyName())) {
|
||||
qw.like("oe.supply_name", bo.getSupplyName());
|
||||
}
|
||||
if (StringUtils.isNotBlank(bo.getSupplyPhone())) {
|
||||
qw.eq("oe.supply_phone", bo.getSupplyPhone());
|
||||
}
|
||||
if (bo.getOwnerId() != null) {
|
||||
qw.eq("oe.owner_id", bo.getOwnerId());
|
||||
}
|
||||
if (StringUtils.isNotBlank(bo.getOwnerPhone())) {
|
||||
qw.eq("oe.owner_phone", bo.getOwnerPhone());
|
||||
}
|
||||
if (bo.getPlanDate() != null) {
|
||||
qw.eq("oe.plan_date", bo.getPlanDate());
|
||||
}
|
||||
if (StringUtils.isNotBlank(bo.getExpressType())) {
|
||||
qw.eq("oe.express_type", bo.getExpressType());
|
||||
}
|
||||
// 添加逻辑删除条件
|
||||
qw.eq("oe.del_flag", 0);
|
||||
|
||||
return qw;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增物流预览
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(WmsExpressBo bo) {
|
||||
WmsExpress add = BeanUtil.toBean(bo, WmsExpress.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setExpressId(add.getExpressId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改物流预览
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(WmsExpressBo bo) {
|
||||
WmsExpress update = BeanUtil.toBean(bo, WmsExpress.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(WmsExpress entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除物流预览
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteBatchIds(ids) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取所有需要刷新的快递ID(示例:所有类型为SF且状态为1的快递单)
|
||||
*/
|
||||
public List<Long> getAllSfExpressIdsToRefresh() {
|
||||
LambdaQueryWrapper<WmsExpress> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(WmsExpress::getExpressType, "SF");
|
||||
lqw.eq(WmsExpress::getStatus, 1L);
|
||||
List<WmsExpress> list = baseMapper.selectList(lqw);
|
||||
return list.stream().map(WmsExpress::getExpressId).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean getRefreshExpress(List<Long> expressIds) throws IOException {
|
||||
for (Long expressId : expressIds) {
|
||||
WmsExpressVo WmsExpressVo = baseMapper.selectVoById(expressId);
|
||||
String expressType = WmsExpressVo.getExpressType();
|
||||
if (expressType.equals("SF") && WmsExpressVo.getStatus() ==1L) {
|
||||
// 校验为顺丰则进入此位置更新状态
|
||||
String result = SfRouteQueryUtil.queryRoute(WmsExpressVo.getExpressCode(), WmsExpressVo.getOwnerPhone() != null ? WmsExpressVo.getOwnerPhone() : WmsExpressVo.getSupplyPhone());
|
||||
WmsExpressVo WmsExpressVo1 = SfRouteQueryUtil.parseData(result);
|
||||
if (WmsExpressVo1 != null) {
|
||||
WmsExpressVo.setLastUpdateTime(WmsExpressVo1.getAcceptTime());
|
||||
WmsExpressVo.setLastStatus(WmsExpressVo1.getFirstStatusName());
|
||||
}
|
||||
}
|
||||
if (expressType.equals("ZTO") && WmsExpressVo.getStatus() ==1L) {
|
||||
// 校验为顺丰则进入此位置更新状态
|
||||
WmsExpressVo WmsExpressVo1 = ZtoTrackQueryUtil.queryTrack(WmsExpressVo.getExpressCode(), WmsExpressVo.getOwnerPhone() != null ? WmsExpressVo.getOwnerPhone() : WmsExpressVo.getSupplyPhone());
|
||||
if (WmsExpressVo1 != null) {
|
||||
WmsExpressVo.setLastUpdateTime(WmsExpressVo1.getAcceptTime());
|
||||
WmsExpressVo.setLastStatus(WmsExpressVo1.getFirstStatusName());
|
||||
}
|
||||
}
|
||||
if (expressType.equals("Best") && WmsExpressVo.getStatus() ==1L) {
|
||||
// 校验为顺丰则进入此位置更新状态
|
||||
WmsExpressVo WmsExpressVo1 = BestRouteQueryUtil.queryRoute(WmsExpressVo.getExpressCode());
|
||||
|
||||
if (WmsExpressVo1 != null) {
|
||||
WmsExpressVo.setLastUpdateTime(WmsExpressVo1.getAcceptTime());
|
||||
WmsExpressVo.setLastStatus(WmsExpressVo1.getFirstStatusName());
|
||||
}
|
||||
}
|
||||
if (expressType.equals("YD") && WmsExpressVo.getStatus() == 1L) {
|
||||
// 韵达快递轨迹查询
|
||||
String result = com.klp.utils.YdRouteQueryUtil.queryRoute(WmsExpressVo.getExpressCode());
|
||||
WmsExpressVo ydVo = YdRouteQueryUtil.parseData(result);
|
||||
if (ydVo != null) {
|
||||
WmsExpressVo.setLastUpdateTime(ydVo.getLastUpdateTime());
|
||||
WmsExpressVo.setLastStatus(ydVo.getLastStatus());
|
||||
}
|
||||
}
|
||||
if (expressType.equals("YT") && WmsExpressVo.getStatus() == 1L) {
|
||||
// 圆通快递轨迹查询
|
||||
String result = com.klp.utils.YtRouteQueryUtil.queryRoute(WmsExpressVo.getExpressCode());
|
||||
WmsExpressVo ytVo = YtRouteQueryUtil.parseData(result);
|
||||
if (ytVo != null) {
|
||||
WmsExpressVo.setLastUpdateTime(ytVo.getLastUpdateTime());
|
||||
WmsExpressVo.setLastStatus(ytVo.getLastStatus());
|
||||
}
|
||||
}
|
||||
if (expressType.equals("STO") && WmsExpressVo.getStatus() == 1L) {
|
||||
// 申通快递轨迹查询
|
||||
String result = StoRouteQueryUtil.queryRoute(Collections.singletonList(WmsExpressVo.getExpressCode()));
|
||||
WmsExpressVo stoVo = StoRouteQueryUtil.parseData(result);
|
||||
if (stoVo != null) {
|
||||
WmsExpressVo.setLastUpdateTime(stoVo.getAcceptTime());
|
||||
WmsExpressVo.setLastStatus(stoVo.getFirstStatusName());
|
||||
}
|
||||
}
|
||||
WmsExpress add = BeanUtil.toBean(WmsExpressVo, WmsExpress.class);
|
||||
baseMapper.updateById(add);;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,159 @@
|
||||
package com.klp.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
import com.klp.common.utils.StringUtils;
|
||||
import com.klp.domain.WmsReportDetail;
|
||||
import com.klp.domain.bo.WmsReportDetailBo;
|
||||
import com.klp.domain.vo.WmsReportDetailVo;
|
||||
import com.klp.mapper.WmsReportDetailMapper;
|
||||
import com.klp.service.IWmsReportDetailService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 设计项目汇报详情Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-05-13
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class WmsReportDetailServiceImpl implements IWmsReportDetailService {
|
||||
|
||||
private final WmsReportDetailMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询设计项目汇报详情
|
||||
*/
|
||||
@Override
|
||||
public WmsReportDetailVo queryById(Long id){
|
||||
|
||||
return baseMapper.selectVoByIdPlus(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询设计项目汇报详情列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<WmsReportDetailVo> queryPageList(WmsReportDetailBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<WmsReportDetail> lqw = buildQueryWrapper(bo);
|
||||
Page<WmsReportDetailVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
|
||||
for(WmsReportDetailVo item : result.getRecords()) {
|
||||
String ossIds = item.getOssIds();
|
||||
// 分离拿出ossIds
|
||||
String[] ossIdArray = new String[0];
|
||||
if (StringUtils.isNotBlank(ossIds)) {
|
||||
ossIdArray = ossIds.split(",");
|
||||
}
|
||||
// 准备images数组
|
||||
List<String> images = new ArrayList<>();
|
||||
// 遍历ossIdArray,添加到images中
|
||||
for (String ossId : ossIdArray) {
|
||||
// 查出图片地址
|
||||
String url = baseMapper.selectImageUrlByOssId(ossId);
|
||||
images.add(url);
|
||||
}
|
||||
// 设置images属性,将images打成,分割的字符串
|
||||
item.setImages(String.join(",", images));
|
||||
}
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询设计项目汇报详情列表
|
||||
*/
|
||||
@Override
|
||||
public List<WmsReportDetailVo> queryList(WmsReportDetailBo bo) {
|
||||
LambdaQueryWrapper<WmsReportDetail> lqw = buildQueryWrapper(bo);
|
||||
List<WmsReportDetailVo> result = baseMapper.selectVoList(lqw);
|
||||
for(WmsReportDetailVo item : result) {
|
||||
String ossIds = item.getOssIds();
|
||||
// 分离拿出ossIds
|
||||
String[] ossIdArray = new String[0];
|
||||
if (StringUtils.isNotBlank(ossIds)) {
|
||||
ossIdArray = ossIds.split(",");
|
||||
}
|
||||
// 准备images数组
|
||||
List<String> images = new ArrayList<>();
|
||||
// 遍历ossIdArray,添加到images中
|
||||
for (String ossId : ossIdArray) {
|
||||
// 查出图片地址
|
||||
String url = baseMapper.selectImageUrlByOssId(ossId);
|
||||
images.add(url);
|
||||
}
|
||||
// 设置images属性,将images打成,分割的字符串
|
||||
item.setImages(String.join(",", images));
|
||||
}
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<WmsReportDetail> buildQueryWrapper(WmsReportDetailBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<WmsReportDetail> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(bo.getSummaryId() != null, WmsReportDetail::getSummaryId, bo.getSummaryId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getDeviceCode()), WmsReportDetail::getDeviceCode, bo.getDeviceCode());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getCategory()), WmsReportDetail::getCategory, bo.getCategory());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getDeviceDescription()), WmsReportDetail::getDeviceDescription, bo.getDeviceDescription());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getReportDetail()), WmsReportDetail::getReportDetail, bo.getReportDetail());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getOssIds()), WmsReportDetail::getOssIds, bo.getOssIds());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增设计项目汇报详情
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(WmsReportDetailBo bo) {
|
||||
WmsReportDetail add = BeanUtil.toBean(bo, WmsReportDetail.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setDetailId(add.getDetailId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改设计项目汇报详情
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(WmsReportDetailBo bo) {
|
||||
WmsReportDetail update = BeanUtil.toBean(bo, WmsReportDetail.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(WmsReportDetail entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除设计项目汇报详情
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteBatchIds(ids) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WmsReportDetailVo> queryByProjectId(Long projectId) {
|
||||
return baseMapper.queryByProjectId(projectId);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
package com.klp.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
import com.klp.common.utils.StringUtils;
|
||||
import com.klp.domain.WmsReportSummary;
|
||||
import com.klp.domain.bo.WmsReportSummaryBo;
|
||||
import com.klp.domain.vo.WmsReportSummaryVo;
|
||||
import com.klp.mapper.WmsReportSummaryMapper;
|
||||
import com.klp.service.IWmsReportSummaryService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 设计项目汇报概述Service业务层处理
|
||||
*
|
||||
* @author cpy
|
||||
* @date 2025-05-13
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class WmsReportSummaryServiceImpl implements IWmsReportSummaryService {
|
||||
|
||||
private final WmsReportSummaryMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询设计项目汇报概述
|
||||
*/
|
||||
@Override
|
||||
public WmsReportSummaryVo queryById(Long id){
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询设计项目汇报概述列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<WmsReportSummaryVo> queryPageList(WmsReportSummaryBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<WmsReportSummary> lqw = buildQueryWrapper(bo);
|
||||
// Page<WmsReportSummaryVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
Page<WmsReportSummaryVo> result = baseMapper.selectVoPageWithProject(pageQuery.build(), bo);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询设计项目汇报概述列表
|
||||
*/
|
||||
@Override
|
||||
public List<WmsReportSummaryVo> queryList(WmsReportSummaryBo bo) {
|
||||
LambdaQueryWrapper<WmsReportSummary> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<WmsReportSummary> buildQueryWrapper(WmsReportSummaryBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<WmsReportSummary> lqw = Wrappers.lambdaQuery();
|
||||
lqw.like(StringUtils.isNotBlank(bo.getReportTitle()), WmsReportSummary::getReportTitle, bo.getReportTitle());
|
||||
lqw.eq(bo.getReportDate() != null, WmsReportSummary::getReportDate, bo.getReportDate());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getReporter()), WmsReportSummary::getReporter, bo.getReporter());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增设计项目汇报概述
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(WmsReportSummaryBo bo) {
|
||||
WmsReportSummary add = BeanUtil.toBean(bo, WmsReportSummary.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setSummaryId(add.getSummaryId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改设计项目汇报概述
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(WmsReportSummaryBo bo) {
|
||||
WmsReportSummary update = BeanUtil.toBean(bo, WmsReportSummary.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(WmsReportSummary entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除设计项目汇报概述
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteBatchIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.klp.common.utils.StringUtils;
|
||||
import com.klp.domain.WmsWarehouse;
|
||||
import com.klp.mapper.WmsWarehouseMapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.klp.domain.bo.WmsStockLogBo;
|
||||
@@ -16,6 +18,8 @@ import com.klp.domain.WmsStockLog;
|
||||
import com.klp.mapper.WmsStockLogMapper;
|
||||
import com.klp.service.IWmsStockLogService;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
@@ -31,6 +35,8 @@ import java.util.Collection;
|
||||
public class WmsStockLogServiceImpl implements IWmsStockLogService {
|
||||
|
||||
private final WmsStockLogMapper baseMapper;
|
||||
@Resource
|
||||
private WmsWarehouseMapper warehouseMapper;
|
||||
|
||||
/**
|
||||
* 查询库存流水
|
||||
@@ -62,7 +68,15 @@ public class WmsStockLogServiceImpl implements IWmsStockLogService {
|
||||
private QueryWrapper<WmsStockLog> buildQueryWrapperPlus(WmsStockLogBo bo) {
|
||||
QueryWrapper<WmsStockLog> lqw = Wrappers.query();
|
||||
lqw.eq("sl.del_flag", 0);
|
||||
lqw.eq(bo.getWarehouseId() != null, "sl.warehouse_id", bo.getWarehouseId());
|
||||
// 处理仓库ID查询,支持递归查询子节点
|
||||
if (bo.getWarehouseId() != null) {
|
||||
List<Long> warehouseIds = getWarehouseIdsWithChildren(bo.getWarehouseId());
|
||||
if (warehouseIds.size() == 1) {
|
||||
lqw.eq("sl.warehouse_id", warehouseIds.get(0));
|
||||
} else {
|
||||
lqw.in("sl.warehouse_id", warehouseIds);
|
||||
}
|
||||
}
|
||||
lqw.eq(bo.getItemId() != null, "sl.item_id", bo.getItemId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getItemType()), "sl.item_type", bo.getItemType());
|
||||
lqw.eq(bo.getChangeQty() != null, "sl.change_qty", bo.getChangeQty());
|
||||
@@ -83,8 +97,6 @@ public class WmsStockLogServiceImpl implements IWmsStockLogService {
|
||||
lqw.eq(bo.getChangeQty() != null, WmsStockLog::getChangeQty, bo.getChangeQty());
|
||||
lqw.eq(bo.getAfterQty() != null, WmsStockLog::getAfterQty, bo.getAfterQty());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getChangeType()), WmsStockLog::getChangeType, bo.getChangeType());
|
||||
// lqw.eq(bo.getChangeTime() != null, WmsStockLog::getChangeTime, bo.getChangeTime());
|
||||
|
||||
// 根据时间区间查询
|
||||
lqw.ge(bo.getStartTime() != null, WmsStockLog::getChangeTime, bo.getStartTime());
|
||||
lqw.le(bo.getEndTime() != null, WmsStockLog::getChangeTime, bo.getEndTime());
|
||||
@@ -132,4 +144,38 @@ public class WmsStockLogServiceImpl implements IWmsStockLogService {
|
||||
}
|
||||
return baseMapper.deleteBatchIds(ids) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取指定仓库ID及其所有子仓库ID
|
||||
* @param warehouseId 仓库ID
|
||||
* @return 包含当前仓库ID和所有子仓库ID的列表
|
||||
*/
|
||||
private List<Long> getWarehouseIdsWithChildren(Long warehouseId) {
|
||||
List<Long> warehouseIds = new ArrayList<>();
|
||||
warehouseIds.add(warehouseId); // 添加当前仓库ID
|
||||
|
||||
// 递归获取所有子仓库ID
|
||||
getChildWarehouseIds(warehouseId, warehouseIds);
|
||||
|
||||
return warehouseIds;
|
||||
}
|
||||
|
||||
/**
|
||||
* 递归获取子仓库ID
|
||||
* @param parentId 父仓库ID
|
||||
* @param warehouseIds 仓库ID列表(用于收集结果)
|
||||
*/
|
||||
private void getChildWarehouseIds(Long parentId, List<Long> warehouseIds) {
|
||||
// 查询直接子仓库
|
||||
List<WmsWarehouse> children = warehouseMapper.selectList(
|
||||
Wrappers.<WmsWarehouse>lambdaQuery()
|
||||
.eq(WmsWarehouse::getParentId, parentId)
|
||||
.eq(WmsWarehouse::getDelFlag, 0)
|
||||
);
|
||||
// 递归处理每个子仓库
|
||||
for (WmsWarehouse child : children) {
|
||||
warehouseIds.add(child.getWarehouseId());
|
||||
getChildWarehouseIds(child.getWarehouseId(), warehouseIds);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
156
klp-wms/src/main/java/com/klp/utils/BestRouteQueryUtil.java
Normal file
156
klp-wms/src/main/java/com/klp/utils/BestRouteQueryUtil.java
Normal file
@@ -0,0 +1,156 @@
|
||||
package com.klp.utils;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.klp.domain.vo.WmsExpressVo;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.OutputStream;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.security.MessageDigest;
|
||||
import java.util.Arrays;
|
||||
|
||||
public class BestRouteQueryUtil {
|
||||
// 百世开放平台 partnerID
|
||||
private static final String PARTNER_ID = "7285";
|
||||
// 百世开放平台接口地址(请替换为实际地址)
|
||||
private static final String API_URL = "http://openapi.800best.com/api-server/ky/api/process";
|
||||
// 百世开放平台 partnerKey
|
||||
private static final String PARTNER_KEY = "NMGA0BQI";
|
||||
// 固定参数
|
||||
private static final String SERVICE_TYPE = "KY_TRACE_QUERY";
|
||||
|
||||
/**
|
||||
* 查询百世快递路由
|
||||
* @param mailNo 运单号
|
||||
* @return 查询结果WmsExpressVo
|
||||
*/
|
||||
public static WmsExpressVo queryRoute(String mailNo) {
|
||||
try {
|
||||
// 1. 构造业务数据bizData
|
||||
JSONObject bizData = new JSONObject();
|
||||
bizData.put("logisticCompanyID", "BESTQJT");
|
||||
bizData.put("codes", Arrays.asList(mailNo));
|
||||
String bizDataStr = bizData.toJSONString();
|
||||
|
||||
// 2. 生成签名(签名前不做URLEncode)
|
||||
String sign = genSign(bizDataStr, PARTNER_KEY);
|
||||
|
||||
// 3. 拼接表单参数(此处做URLEncode)
|
||||
StringBuilder formParams = new StringBuilder();
|
||||
formParams.append("partnerID=").append(URLEncoder.encode(PARTNER_ID, "UTF-8"));
|
||||
formParams.append("&serviceType=").append(URLEncoder.encode(SERVICE_TYPE, "UTF-8"));
|
||||
formParams.append("&sign=").append(URLEncoder.encode(sign, "UTF-8"));
|
||||
formParams.append("&bizData=").append(URLEncoder.encode(bizDataStr, "UTF-8"));
|
||||
String formBody = formParams.toString();
|
||||
|
||||
// 4. 发送POST请求(表单格式,UTF-8编码)
|
||||
return doPost(API_URL, formBody);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 百世签名生成方式:MD5(bizData + partnerKey),再转大写
|
||||
*/
|
||||
private static String genSign(String bizData, String partnerKey) throws Exception {
|
||||
String toSign = bizData + partnerKey;
|
||||
MessageDigest md5 = MessageDigest.getInstance("MD5");
|
||||
md5.update(toSign.getBytes("UTF-8"));
|
||||
byte[] digest = md5.digest();
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (byte b : digest) {
|
||||
sb.append(String.format("%02x", b));
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送POST请求(表单格式,UTF-8编码)
|
||||
*/
|
||||
private static WmsExpressVo doPost(String urlStr, String formBody) throws Exception {
|
||||
URL url = new URL(urlStr);
|
||||
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
|
||||
conn.setRequestMethod("POST");
|
||||
conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded;charset=UTF-8");
|
||||
conn.setDoOutput(true);
|
||||
try (OutputStream os = conn.getOutputStream()) {
|
||||
os.write(formBody.getBytes(StandardCharsets.UTF_8));
|
||||
}
|
||||
int code = conn.getResponseCode();
|
||||
if (code == 200) {
|
||||
try (BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream(), StandardCharsets.UTF_8))) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
String line;
|
||||
while ((line = br.readLine()) != null) {
|
||||
sb.append(line);
|
||||
}
|
||||
return parseData(sb.toString());
|
||||
}
|
||||
} else {
|
||||
throw new RuntimeException("HTTP请求失败,状态码:" + code);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 解析百世快递返回数据,只取第一个轨迹的acceptTime和remark
|
||||
*/
|
||||
public static WmsExpressVo parseData(String result) {
|
||||
if (StringUtils.isBlank(result)) {
|
||||
System.out.println("返回结果为空");
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
JSONObject json = JSON.parseObject(result);
|
||||
Boolean success = json.getBoolean("result");
|
||||
if (success == null || !success) {
|
||||
System.out.println("查询失败:" + json.getString("resultInfo"));
|
||||
return null;
|
||||
}
|
||||
JSONArray orderTraceList = json.getJSONArray("orderTraceList");
|
||||
if (orderTraceList == null || orderTraceList.isEmpty()) {
|
||||
System.out.println("无轨迹信息");
|
||||
return null;
|
||||
}
|
||||
// 只取第一个轨迹的最后一个步骤
|
||||
JSONObject orderTrace = orderTraceList.getJSONObject(0);
|
||||
JSONArray steps = orderTrace.getJSONArray("steps");
|
||||
if (steps == null || steps.isEmpty()) {
|
||||
System.out.println("无轨迹步骤信息");
|
||||
return null;
|
||||
}
|
||||
JSONObject step = steps.getJSONObject(steps.size() - 1);
|
||||
WmsExpressVo vo = new WmsExpressVo();
|
||||
vo.setExpressCode(orderTrace.getString("code"));
|
||||
vo.setFirstStatusName(step.getString("remark"));
|
||||
String acceptTimeStr = step.getString("acceptTime");
|
||||
if (acceptTimeStr != null) {
|
||||
// 假设格式为 yyyy-MM-dd HH:mm:ss
|
||||
try {
|
||||
vo.setAcceptTime(java.sql.Timestamp.valueOf(acceptTimeStr));
|
||||
} catch (Exception e) {
|
||||
vo.setAcceptTime(null);
|
||||
}
|
||||
}
|
||||
return vo;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// main方法测试
|
||||
public static void main(String[] args) {
|
||||
String mailNo = "80004559434";
|
||||
WmsExpressVo vo = queryRoute(mailNo);
|
||||
System.out.println(vo);
|
||||
}
|
||||
}
|
||||
216
klp-wms/src/main/java/com/klp/utils/SfRouteQueryUtil.java
Normal file
216
klp-wms/src/main/java/com/klp/utils/SfRouteQueryUtil.java
Normal file
@@ -0,0 +1,216 @@
|
||||
package com.klp.utils;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.klp.common.utils.DateUtils;
|
||||
import com.klp.domain.vo.WmsExpressVo;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.OutputStream;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.security.MessageDigest;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 顺丰路由地址查询工具
|
||||
*/
|
||||
public class SfRouteQueryUtil {
|
||||
// 顺丰开放平台 partnerID
|
||||
private static final String PARTNER_ID = "YIX65G10";
|
||||
// 顺丰开放平台接口地址
|
||||
private static final String API_URL = "https://bspgw.sf-express.com/std/service";
|
||||
|
||||
// 顺丰开放平台 checkWord
|
||||
private static final String CHECK_WORD = "PkJL4cpEQIUuV1goWvhIznqthletmddX";
|
||||
|
||||
// 顺丰OAuth认证
|
||||
private static final String OAUTH_URL = "https://sfapi.sf-express.com/oauth2/accessToken";
|
||||
|
||||
private static final String GRANT_TYPE = "password";
|
||||
/**
|
||||
* 查询顺丰路由
|
||||
* @param mailNo 顺丰运单号
|
||||
* @return 查询结果JSON
|
||||
*/
|
||||
public static String queryRoute(String mailNo,String phoneNumber) {
|
||||
List<String> mailNos = Arrays.asList(mailNo);
|
||||
try {
|
||||
// 1. 构造业务数据msgData
|
||||
JSONObject msgData = new JSONObject();
|
||||
msgData.put("language", "zh-CN");
|
||||
msgData.put("trackingType", "1"); // 1:运单号 2:订单号
|
||||
msgData.put("methodType", "1"); // 1:标准路由
|
||||
msgData.put("trackingNumber", mailNos);
|
||||
msgData.put("checkPhoneNo", StringUtils.right(phoneNumber, 4));
|
||||
String msgDataStr = msgData.toJSONString();
|
||||
System.out.println(msgDataStr);
|
||||
|
||||
// 2. 公共参数
|
||||
String requestID = UUID.randomUUID().toString().replaceAll("-", "");
|
||||
String serviceCode = "EXP_RECE_SEARCH_ROUTES";
|
||||
String timestamp = String.valueOf(System.currentTimeMillis());
|
||||
// String msgDigest = genSign(msgDataStr, timestamp, CHECK_WORD);
|
||||
// System.out.println(msgDigest);
|
||||
String accessToken = oAuth();
|
||||
System.out.println(accessToken);
|
||||
// 3. 拼接表单参数
|
||||
StringBuilder formParams = new StringBuilder();
|
||||
formParams.append("partnerID=").append(URLEncoder.encode(PARTNER_ID, "UTF-8"));
|
||||
formParams.append("&requestID=").append(URLEncoder.encode(requestID, "UTF-8"));
|
||||
formParams.append("&serviceCode=").append(URLEncoder.encode(serviceCode, "UTF-8"));
|
||||
formParams.append("×tamp=").append(URLEncoder.encode(timestamp, "UTF-8"));
|
||||
formParams.append("&accessToken=").append(URLEncoder.encode(accessToken, "UTF-8"));
|
||||
formParams.append("&msgData=").append(URLEncoder.encode(msgDataStr, "UTF-8"));
|
||||
String formBody = formParams.toString();
|
||||
System.out.println(formBody);
|
||||
|
||||
// 4. 发送POST请求
|
||||
return doPost(API_URL, formBody);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 顺丰msgDigest生成方式:Base64(MD5(URLEncode(msgData+timestamp+partnerId+checkWord)))
|
||||
*/
|
||||
private static String genSign(String msgData, String timestamp, String checkWord) throws Exception {
|
||||
String toVerifyText = msgData + timestamp + checkWord;
|
||||
MessageDigest md5 = MessageDigest.getInstance("MD5");
|
||||
md5.update(toVerifyText.getBytes("UTF-8"));
|
||||
byte[] digest = md5.digest();
|
||||
return Base64.getEncoder().encodeToString(digest);
|
||||
}
|
||||
|
||||
/**
|
||||
* 顺丰OAUTH2
|
||||
*/
|
||||
private static String oAuth() throws Exception {
|
||||
StringBuilder formParams = new StringBuilder();
|
||||
formParams.append("partnerID=").append(URLEncoder.encode(PARTNER_ID, "UTF-8"));
|
||||
formParams.append("&secret=").append(URLEncoder.encode(CHECK_WORD, "UTF-8"));
|
||||
formParams.append("&grantType=").append(URLEncoder.encode(GRANT_TYPE, "UTF-8"));
|
||||
String oauthResponse = doPost(OAUTH_URL, formParams.toString());
|
||||
JSONObject jsonObject = JSON.parseObject(oauthResponse);
|
||||
return jsonObject.getString("accessToken");
|
||||
}
|
||||
/**
|
||||
* 发送POST请求(表单格式)
|
||||
*/
|
||||
private static String doPost(String urlStr, String formBody) throws Exception {
|
||||
URL url = new URL(urlStr);
|
||||
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
|
||||
conn.setRequestMethod("POST");
|
||||
conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded;charset=UTF-8");
|
||||
conn.setDoOutput(true);
|
||||
try (OutputStream os = conn.getOutputStream()) {
|
||||
os.write(formBody.getBytes(StandardCharsets.UTF_8));
|
||||
}
|
||||
int code = conn.getResponseCode();
|
||||
if (code == 200) {
|
||||
try (BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream(), StandardCharsets.UTF_8))) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
String line;
|
||||
while ((line = br.readLine()) != null) {
|
||||
sb.append(line);
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
} else {
|
||||
throw new RuntimeException("HTTP请求失败,状态码:" + code);
|
||||
}
|
||||
}
|
||||
|
||||
public static WmsExpressVo parseData(String result) {
|
||||
if (StringUtils.isBlank(result)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
try {
|
||||
// 1. 解析最外层的JSON
|
||||
JSONObject outerJson = JSON.parseObject(result);
|
||||
if (outerJson == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// 2. 获取apiResultData字符串并再次解析
|
||||
String apiResultDataStr = outerJson.getString("apiResultData");
|
||||
if (StringUtils.isBlank(apiResultDataStr)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
JSONObject innerJson = JSON.parseObject(apiResultDataStr);
|
||||
if (innerJson == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// 3. 提取所需数据
|
||||
JSONObject msgData = innerJson.getJSONObject("msgData");
|
||||
if (msgData == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
JSONArray routeResps = msgData.getJSONArray("routeResps");
|
||||
if (routeResps == null || routeResps.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
JSONObject firstRouteResp = routeResps.getJSONObject(0);
|
||||
if (firstRouteResp == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
JSONArray routes = firstRouteResp.getJSONArray("routes");
|
||||
if (routes == null || routes.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
JSONObject lastRoute = routes.getJSONObject(routes.size() - 1);
|
||||
if (lastRoute == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
String acceptTime = lastRoute.getString("acceptTime");
|
||||
String firstStatusName = lastRoute.getString("firstStatusName");
|
||||
|
||||
WmsExpressVo WmsExpressVo = new WmsExpressVo();
|
||||
// 转换日期并设置,如果日期格式不正确则设置为null
|
||||
if (StringUtils.isNotBlank(acceptTime)) {
|
||||
try {
|
||||
Date date = DateUtils.parseDate(acceptTime);
|
||||
WmsExpressVo.setAcceptTime(date);
|
||||
} catch (Exception e) {
|
||||
WmsExpressVo.setAcceptTime(null);
|
||||
}
|
||||
}
|
||||
WmsExpressVo.setFirstStatusName(firstStatusName);
|
||||
System.out.println(acceptTime);
|
||||
System.out.println(firstStatusName);
|
||||
return WmsExpressVo;
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* main方法测试
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
|
||||
|
||||
String mailNo = "SF3191365477469";
|
||||
String result = queryRoute(mailNo,"15075462410");
|
||||
System.out.println(result);
|
||||
WmsExpressVo WmsExpress = parseData(result);
|
||||
}
|
||||
}
|
||||
147
klp-wms/src/main/java/com/klp/utils/StoRouteQueryUtil.java
Normal file
147
klp-wms/src/main/java/com/klp/utils/StoRouteQueryUtil.java
Normal file
@@ -0,0 +1,147 @@
|
||||
package com.klp.utils;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.klp.domain.vo.WmsExpressVo;
|
||||
import org.apache.commons.codec.binary.Base64;
|
||||
import org.apache.commons.codec.digest.DigestUtils;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.OutputStream;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class StoRouteQueryUtil {
|
||||
// 请填写你自己的key/secret
|
||||
private static final String APP_KEY = "CAKDSqybdwbzlUC";
|
||||
private static final String APP_SECRET = "wGRMVXwIf8sp4m4W6tWJcOaDfY7EPblQ";
|
||||
private static final String FROM_CODE = "CAKDSqybdwbzlUC"; // 你的from_code
|
||||
private static final String API_URL = "https://cloudinter-linkgateway.sto.cn/gateway/link.do";
|
||||
|
||||
// 申通签名算法 body+appSecret,MD5后Base64
|
||||
public static String sign(String body, String secret) {
|
||||
String text = body + secret;
|
||||
byte[] md5 = DigestUtils.md5(text);
|
||||
return Base64.encodeBase64String(md5);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询申通轨迹,支持批量单号
|
||||
* @param waybillNos 运单号集合
|
||||
* @return 查询结果JSON
|
||||
*/
|
||||
public static String queryRoute(List<String> waybillNos) {
|
||||
try {
|
||||
// 构造content参数
|
||||
JSONObject content = new JSONObject();
|
||||
content.put("order", "asc");
|
||||
JSONArray waybillNoList = new JSONArray();
|
||||
for (String no : waybillNos) waybillNoList.add(no);
|
||||
content.put("waybillNoList", waybillNoList);
|
||||
String contentStr = content.toJSONString();
|
||||
|
||||
// 构造表单参数字符串
|
||||
StringBuilder form = new StringBuilder();
|
||||
form.append("api_name=STO_TRACE_QUERY_COMMON");
|
||||
form.append("&content=").append(URLEncoder.encode(contentStr, "UTF-8"));
|
||||
form.append("&from_appkey=").append(APP_KEY);
|
||||
form.append("&from_code=").append(APP_KEY);
|
||||
form.append("&to_appkey=sto_trace_query");
|
||||
form.append("&to_code=sto_trace_query");
|
||||
form.append("&data_digest=").append(URLEncoder.encode(sign(contentStr, APP_SECRET), "UTF-8"));
|
||||
|
||||
System.out.println("申通表单请求体:" + form);
|
||||
|
||||
URL url = new URL(API_URL);
|
||||
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
|
||||
conn.setDoOutput(true);
|
||||
conn.setDoInput(true);
|
||||
conn.setUseCaches(false);
|
||||
conn.setRequestMethod("POST");
|
||||
conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded;charset=UTF-8");
|
||||
OutputStream out = conn.getOutputStream();
|
||||
out.write(form.toString().getBytes(StandardCharsets.UTF_8));
|
||||
out.flush();
|
||||
out.close();
|
||||
StringBuilder sbResult = new StringBuilder();
|
||||
if (200 == conn.getResponseCode()) {
|
||||
BufferedReader responseReader = new BufferedReader(new InputStreamReader(conn.getInputStream(), "UTF-8"));
|
||||
String readLine;
|
||||
while ((readLine = responseReader.readLine()) != null) {
|
||||
sbResult.append(readLine).append("\n");
|
||||
}
|
||||
responseReader.close();
|
||||
}
|
||||
return sbResult.toString();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 解析申通返回数据,转为WmsExpressVo列表
|
||||
*/
|
||||
public static WmsExpressVo parseData(String result) {
|
||||
if (result == null || result.trim().isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
// 新增:如果返回是XML,直接打印并返回null
|
||||
if (result.trim().startsWith("<")) {
|
||||
System.err.println("申通返回XML错误:" + result);
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
JSONObject json = JSON.parseObject(result);
|
||||
JSONObject data = json.getJSONObject("data");
|
||||
if (data == null) return null;
|
||||
for (String waybillNo : data.keySet()) {
|
||||
JSONArray arr = data.getJSONArray(waybillNo);
|
||||
if (arr == null || arr.isEmpty()) continue;
|
||||
JSONObject last = arr.getJSONObject(arr.size() - 1);
|
||||
WmsExpressVo vo = new WmsExpressVo();
|
||||
vo.setExpressCode(last.getString("waybillNo"));
|
||||
// 设置时间
|
||||
String opTime = last.getString("opTime");
|
||||
if (opTime != null) {
|
||||
try {
|
||||
// 解析时间格式 "2025-07-27 13:01:00"
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
vo.setAcceptTime(sdf.parse(opTime));
|
||||
} catch (Exception e) {
|
||||
vo.setAcceptTime(null);
|
||||
}
|
||||
}
|
||||
// 设置状态 - 使用scanType作为状态
|
||||
vo.setFirstStatusName(last.getString("memo"));
|
||||
// 设置备注 - 使用memo作为备注
|
||||
vo.setRemark(last.getString("scanType"));
|
||||
return vo;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
// main方法测试
|
||||
public static void main(String[] args) {
|
||||
List<String> waybillNos = new ArrayList<>();
|
||||
waybillNos.add("777329412312954"); // 测试单号
|
||||
String result = queryRoute(waybillNos);
|
||||
System.out.println("申通原始返回:" + result);
|
||||
WmsExpressVo vo = parseData(result);
|
||||
if (vo != null) {
|
||||
System.out.println("解析后:" + vo);
|
||||
} else {
|
||||
System.out.println("未解析到数据");
|
||||
}
|
||||
}
|
||||
}
|
||||
75
klp-wms/src/main/java/com/klp/utils/YdRouteQueryUtil.java
Normal file
75
klp-wms/src/main/java/com/klp/utils/YdRouteQueryUtil.java
Normal file
@@ -0,0 +1,75 @@
|
||||
package com.klp.utils;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.klp.domain.vo.WmsExpressVo;
|
||||
import com.yundasys.OpenApiHttpUtils;
|
||||
|
||||
import java.security.MessageDigest;
|
||||
|
||||
public class YdRouteQueryUtil {
|
||||
// 请根据实际环境切换key/secret
|
||||
private static final String APP_KEY = "004160"; // 生产环境
|
||||
private static final String APP_SECRET = "ac9ee46d749e44b98e7a9e38f3c8f8f3"; // 生产环境
|
||||
private static final String API_URL = "https://openapi.yundaex.com/openapi/outer/logictis/query";
|
||||
|
||||
/**
|
||||
* 查询韵达轨迹
|
||||
* @param mailNo 运单号
|
||||
* @return 查询结果JSON
|
||||
*/
|
||||
public static String queryRoute(String mailNo) {
|
||||
String jsonParams = "{\"mailno\":\"" + mailNo + "\"}";
|
||||
return OpenApiHttpUtils.doPostJson(API_URL, jsonParams, APP_KEY, APP_SECRET);
|
||||
}
|
||||
|
||||
/**
|
||||
* 解析韵达返回数据,转为WmsExpressVo
|
||||
*/
|
||||
public static WmsExpressVo parseData(String result) {
|
||||
if (result == null || result.trim().isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
JSONObject json = JSON.parseObject(result);
|
||||
JSONObject data = json.getJSONObject("data");
|
||||
if (data == null) return null;
|
||||
JSONArray steps = data.getJSONArray("steps");
|
||||
if (steps == null || steps.isEmpty()) return null;
|
||||
JSONObject last = steps.getJSONObject(steps.size() - 1);
|
||||
WmsExpressVo vo = new WmsExpressVo();
|
||||
vo.setExpressCode(data.getString("mailno"));
|
||||
vo.setLastUpdateTime(last.getDate("time"));
|
||||
vo.setLastStatus(last.getString("action"));
|
||||
vo.setRemark(last.getString("description"));
|
||||
return vo;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
// MD5签名算法(如需自定义签名,可用此方法)
|
||||
public static String md5(String str, String charset) throws Exception {
|
||||
MessageDigest md = MessageDigest.getInstance("MD5");
|
||||
md.update(str.getBytes(charset));
|
||||
byte[] result = md.digest();
|
||||
StringBuilder sb = new StringBuilder(32);
|
||||
for (byte b : result) {
|
||||
int val = b & 0xff;
|
||||
if (val <= 0xf) sb.append("0");
|
||||
sb.append(Integer.toHexString(val));
|
||||
}
|
||||
return sb.toString().toLowerCase();
|
||||
}
|
||||
|
||||
// main方法测试
|
||||
public static void main(String[] args) {
|
||||
String mailNo = "464569453467736";
|
||||
String result = queryRoute(mailNo);
|
||||
System.out.println("韵达原始返回:" + result);
|
||||
WmsExpressVo vo = parseData(result);
|
||||
System.out.println("解析后:" + vo);
|
||||
}
|
||||
}
|
||||
118
klp-wms/src/main/java/com/klp/utils/YtRouteQueryUtil.java
Normal file
118
klp-wms/src/main/java/com/klp/utils/YtRouteQueryUtil.java
Normal file
@@ -0,0 +1,118 @@
|
||||
package com.klp.utils;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.klp.domain.vo.WmsExpressVo;
|
||||
import org.apache.commons.codec.binary.Base64;
|
||||
import org.apache.commons.codec.digest.DigestUtils;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.OutputStream;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
public class YtRouteQueryUtil {
|
||||
// 请填写你自己的密钥、method、v
|
||||
private static final String SECRET = "TEST";
|
||||
private static final String METHOD = "123456"; // 示例
|
||||
private static final String VERSION = "v1"; // 示例
|
||||
private static final String API_URL = " https://openuat.yto56test.com:6443/open/track_query_adapter/v1/hpLkUl/TEST";
|
||||
|
||||
// 圆通签名算法 param+method+v+secret,MD5后Base64
|
||||
public static String sign(String param, String method, String v, String secret) {
|
||||
String data = param + method + v;
|
||||
byte[] md5 = DigestUtils.md5(data + secret);
|
||||
return Base64.encodeBase64String(md5);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询圆通轨迹
|
||||
* @param number 运单号
|
||||
* @return 查询结果JSON
|
||||
*/
|
||||
public static String queryRoute(String number) {
|
||||
try {
|
||||
String timestamp = String.valueOf(System.currentTimeMillis());
|
||||
JSONObject paramObj = new JSONObject();
|
||||
paramObj.put("NUMBER", number);
|
||||
String param = paramObj.toJSONString();
|
||||
String sign = sign(param, METHOD, VERSION, SECRET);
|
||||
JSONObject req = new JSONObject();
|
||||
req.put("timestamp", timestamp);
|
||||
req.put("param", param);
|
||||
req.put("sign", sign);
|
||||
req.put("format", "JSON");
|
||||
req.put("method", METHOD);
|
||||
req.put("v", VERSION);
|
||||
String jsonParams = req.toJSONString();
|
||||
URL url = new URL(API_URL);
|
||||
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
|
||||
conn.setDoOutput(true);
|
||||
conn.setDoInput(true);
|
||||
conn.setUseCaches(false);
|
||||
conn.setRequestMethod("POST");
|
||||
conn.setRequestProperty("Content-Type", "application/json;charset=UTF-8");
|
||||
OutputStream out = conn.getOutputStream();
|
||||
out.write(jsonParams.getBytes(StandardCharsets.UTF_8));
|
||||
out.flush();
|
||||
out.close();
|
||||
StringBuilder sbResult = new StringBuilder();
|
||||
if (200 == conn.getResponseCode()) {
|
||||
BufferedReader responseReader = new BufferedReader(new InputStreamReader(conn.getInputStream(), "UTF-8"));
|
||||
String readLine;
|
||||
while ((readLine = responseReader.readLine()) != null) {
|
||||
sbResult.append(readLine).append("\n");
|
||||
}
|
||||
responseReader.close();
|
||||
}
|
||||
return sbResult.toString();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 解析圆通返回数据,转为WmsExpressVo列表
|
||||
*/
|
||||
public static WmsExpressVo parseData(String result) {
|
||||
if (result == null || result.trim().isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
if (result.trim().startsWith("{")) {
|
||||
JSONObject json = JSON.parseObject(result);
|
||||
if (json.containsKey("map")) return null; // 查询为空
|
||||
} else if (result.trim().startsWith("[")) {
|
||||
JSONArray arr = JSON.parseArray(result);
|
||||
if (arr.isEmpty()) return null;
|
||||
JSONObject last = arr.getJSONObject(arr.size() - 1);
|
||||
WmsExpressVo vo = new WmsExpressVo();
|
||||
vo.setExpressCode(last.getString("waybill_No"));
|
||||
vo.setLastUpdateTime(last.getDate("upload_Time"));
|
||||
vo.setLastStatus(last.getString("infoContent"));
|
||||
vo.setRemark(last.getString("processInfo"));
|
||||
return vo;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
// main方法测试
|
||||
public static void main(String[] args) {
|
||||
String number = "YT2600227881409"; // 测试单号
|
||||
String result = queryRoute(number);
|
||||
System.out.println("圆通原始返回:" + result);
|
||||
WmsExpressVo vo = parseData(result);
|
||||
if (vo != null) {
|
||||
System.out.println("解析后:" + vo);
|
||||
} else {
|
||||
System.out.println("解析后无数据");
|
||||
}
|
||||
}
|
||||
}
|
||||
117
klp-wms/src/main/java/com/klp/utils/ZtoTrackQueryUtil.java
Normal file
117
klp-wms/src/main/java/com/klp/utils/ZtoTrackQueryUtil.java
Normal file
@@ -0,0 +1,117 @@
|
||||
package com.klp.utils;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.klp.domain.vo.WmsExpressVo;
|
||||
import com.zto.zop.ZopClient;
|
||||
import com.zto.zop.ZopPublicRequest;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.net.URL;
|
||||
|
||||
import static com.zto.zop.EncryptionType.MD5;
|
||||
|
||||
public class ZtoTrackQueryUtil {
|
||||
// 替换为你的appKey和appSecret
|
||||
private static final String APP_KEY = "1ebf01ae01cc81d78ba9a";
|
||||
private static final String APP_SECRET = "4bded7f302da7f7913b01810e3421b80";
|
||||
// 测试环境
|
||||
// private static final String API_URL = "https://japi-test.zto.com/zto.merchant.waybill.track.query";
|
||||
// 正式环境
|
||||
private static final String API_URL = "https://japi.zto.com/zto.merchant.waybill.track.query";
|
||||
|
||||
/**
|
||||
* 查询中通物流轨迹
|
||||
*
|
||||
* @param billCode 运单号
|
||||
* @return 查询结果JSON
|
||||
*/
|
||||
public static WmsExpressVo queryTrack(String billCode,String phoneNumber) throws IOException {
|
||||
|
||||
ZopClient client = new ZopClient(APP_KEY, APP_SECRET);
|
||||
ZopPublicRequest request = new ZopPublicRequest();
|
||||
request.setBody("{\"billCode\":\""+billCode+"\",\"mobilePhone\":\""+ StringUtils.right(phoneNumber, 4)+"\"}");
|
||||
request.setUrl(API_URL);
|
||||
request.setBase64(true);
|
||||
request.setEncryptionType(MD5);
|
||||
request.setTimestamp(null);
|
||||
String execute = client.execute(request);
|
||||
System.out.println(execute);
|
||||
return parseData(execute);
|
||||
}
|
||||
|
||||
/**
|
||||
* 解析中通返回数据,封装为WmsExpressVo
|
||||
*/
|
||||
public static WmsExpressVo parseData(String result) {
|
||||
if (StringUtils.isBlank(result)) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
JSONObject json = JSON.parseObject(result);
|
||||
if (json == null || !"true".equalsIgnoreCase(String.valueOf(json.get("status")))) {
|
||||
return null;
|
||||
}
|
||||
// 取result数组
|
||||
if (!json.containsKey("result")) {
|
||||
return null;
|
||||
}
|
||||
// 只取第一个轨迹(如有多条)
|
||||
Object resultArr = json.get("result");
|
||||
if (!(resultArr instanceof java.util.List)) {
|
||||
return null;
|
||||
}
|
||||
JSONArray arr = json.getJSONArray("result");
|
||||
if (arr == null || arr.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
JSONObject first = arr.getJSONObject(arr.size() - 1); // 取最后一条为最新
|
||||
if (first == null) {
|
||||
return null;
|
||||
}
|
||||
String scanDate = first.getString("scanDate");
|
||||
String desc = first.getString("desc");
|
||||
WmsExpressVo vo = new WmsExpressVo();
|
||||
// scanDate为时间戳字符串
|
||||
if (StringUtils.isNotBlank(scanDate)) {
|
||||
try {
|
||||
long time = Long.parseLong(scanDate);
|
||||
vo.setAcceptTime(new java.util.Date(time));
|
||||
} catch (Exception e) {
|
||||
vo.setAcceptTime(null);
|
||||
}
|
||||
}
|
||||
vo.setFirstStatusName(desc);
|
||||
return vo;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static String getPublicIp() {
|
||||
String ip = "";
|
||||
try {
|
||||
URL url = new URL("http://ifconfig.me/ip");
|
||||
BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));
|
||||
ip = in.readLine();
|
||||
in.close();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return ip;
|
||||
}
|
||||
|
||||
// main方法测试
|
||||
public static void main(String[] args) throws IOException {
|
||||
System.out.println("本机公网IP为: " + getPublicIp());
|
||||
String billCode = "78925013374727";
|
||||
WmsExpressVo result = queryTrack(billCode,"2410");
|
||||
|
||||
System.out.println(result);
|
||||
}
|
||||
}
|
||||
74
klp-wms/src/main/resources/mapper/klp/WmsExpressMapper.xml
Normal file
74
klp-wms/src/main/resources/mapper/klp/WmsExpressMapper.xml
Normal file
@@ -0,0 +1,74 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.klp.mapper.WmsExpressMapper">
|
||||
|
||||
<resultMap type="com.klp.domain.WmsExpress" id="WmsExpressResult">
|
||||
<result property="expressId" column="express_id"/>
|
||||
<result property="expressCode" column="express_code"/>
|
||||
<result property="status" column="status"/>
|
||||
<result property="supplyName" column="supply_name"/>
|
||||
<result property="supplyPhone" column="supply_phone"/>
|
||||
<result property="ownerId" column="owner_id"/>
|
||||
<result property="ownerPhone" column="owner_phone"/>
|
||||
<result property="planDate" column="plan_date"/>
|
||||
<result property="expressType" column="express_type"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="remark" column="remark"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
<select id="selectVoPagePlus" resultType="com.klp.domain.vo.WmsExpressVo">
|
||||
select oe.express_id,
|
||||
oe.express_code,
|
||||
oe.status,
|
||||
oe.supply_name,
|
||||
oe.supply_phone,
|
||||
oe.owner_id,
|
||||
oe.owner_phone,
|
||||
oe.plan_date,
|
||||
oe.express_type,
|
||||
oe.create_by,
|
||||
oe.create_time,
|
||||
oe.update_by,
|
||||
oe.update_time,
|
||||
oe.last_status,
|
||||
oe.last_update_time,
|
||||
oe.del_flag,
|
||||
oe.remark,
|
||||
su.nick_name as ownerName
|
||||
from wms_express oe
|
||||
left join sys_user su on su.user_id = oe.owner_id
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
<select id="selectVoByIdPlus" resultType="com.klp.domain.vo.WmsExpressVo">
|
||||
select oe.express_id,
|
||||
oe.express_code,
|
||||
oe.status,
|
||||
oe.supply_name,
|
||||
oe.supply_phone,
|
||||
oe.owner_id,
|
||||
oe.owner_phone,
|
||||
oe.plan_date,
|
||||
oe.express_type,
|
||||
oe.create_by,
|
||||
oe.create_time,
|
||||
oe.update_by,
|
||||
oe.update_time,
|
||||
oe.last_status,
|
||||
oe.last_update_time,
|
||||
oe.del_flag,
|
||||
oe.remark,
|
||||
su.nick_name as ownerName
|
||||
from wms_express oe
|
||||
left join sys_user su on su.user_id = oe.owner_id
|
||||
where express_id = #{expressId}
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.klp.mapper.WmsExpressQuestionMapper">
|
||||
|
||||
<resultMap type="com.klp.domain.WmsExpressQuestion" id="WmsExpressQuestionResult">
|
||||
<result property="questionId" column="question_id"/>
|
||||
<result property="expressId" column="express_id"/>
|
||||
<result property="description" column="description"/>
|
||||
<result property="reportTime" column="report_time"/>
|
||||
<result property="reportBy" column="report_by"/>
|
||||
<result property="status" column="status"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="remark" column="remark"/>
|
||||
</resultMap>
|
||||
<select id="selectVoPagePlus" resultType="com.klp.domain.vo.WmsExpressQuestionVo">
|
||||
select oeq.question_id,
|
||||
oeq.express_id,
|
||||
oeq.description,
|
||||
oeq.report_time,
|
||||
oeq.report_by,
|
||||
oeq.status,
|
||||
oeq.create_time,
|
||||
oeq.create_by,
|
||||
oeq.update_time,
|
||||
oeq.update_by,
|
||||
oeq.del_flag,
|
||||
oeq.remark,
|
||||
oe.express_code
|
||||
from wms_express_question oeq
|
||||
left join wms_express oe on oe.express_id = oeq.express_id
|
||||
${ew.getCustomSqlSegment}
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,67 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.klp.mapper.WmsReportDetailMapper">
|
||||
|
||||
<resultMap type="com.klp.domain.WmsReportDetail" id="WmsReportDetailResult">
|
||||
<result property="detailId" column="detail_id"/>
|
||||
<result property="summaryId" column="summary_id"/>
|
||||
<result property="deviceCode" column="device_code"/>
|
||||
<result property="category" column="category"/>
|
||||
<result property="deviceDescription" column="device_description"/>
|
||||
<result property="reportDetail" column="report_detail"/>
|
||||
<result property="ossIds" column="oss_ids"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="remark" column="remark"/>
|
||||
</resultMap>
|
||||
<select id="selectVoByIdPlus" parameterType="Long" resultType="com.klp.domain.vo.WmsReportDetailVo">
|
||||
select ord.detail_id,
|
||||
summary_id,
|
||||
device_code,
|
||||
category,
|
||||
device_description,
|
||||
report_detail,
|
||||
oss_ids,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
update_time,
|
||||
del_flag,
|
||||
remark,
|
||||
(
|
||||
SELECT GROUP_CONCAT(so.url SEPARATOR ',')
|
||||
FROM sys_oss so
|
||||
WHERE FIND_IN_SET(so.oss_id, ord.oss_ids) > 0
|
||||
) AS images
|
||||
from wms_report_detail ord
|
||||
where ord.detail_id = #{id}
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
<select id="queryByProjectId" resultType="com.klp.domain.vo.WmsReportDetailVo">
|
||||
select ord.detail_id,
|
||||
ord.summary_id,
|
||||
ord.device_code,
|
||||
ord.category,
|
||||
ord.device_description,
|
||||
ord.report_detail,
|
||||
ord.oss_ids,
|
||||
ord.create_by,
|
||||
ord.create_time,
|
||||
ord.update_by,
|
||||
ord.update_time,
|
||||
ord.del_flag,
|
||||
ord.remark
|
||||
from wms_report_detail ord
|
||||
left join wms_report_summary ors on ors.summary_id = ord.summary_id
|
||||
where project_id = #{projectId}
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,62 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.klp.mapper.WmsReportSummaryMapper">
|
||||
|
||||
<resultMap type="com.klp.domain.WmsReportSummary" id="OaReportSummaryResult">
|
||||
<result property="summaryId" column="summary_id"/>
|
||||
<result property="reportTitle" column="report_title"/>
|
||||
<result property="reportDate" column="report_date"/>
|
||||
<result property="reporter" column="reporter"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="type" column="type"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="selectVoPageWithProject" resultType="com.klp.domain.vo.WmsReportSummaryVo">
|
||||
SELECT
|
||||
s.summary_id as summaryId,
|
||||
s.report_title AS reportTitle,
|
||||
s.report_date AS reportDate,
|
||||
s.reporter,
|
||||
s.remark,
|
||||
s.type,
|
||||
d.latest_create_time AS lastUpdateTime
|
||||
FROM wms_report_summary s
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
summary_id,
|
||||
create_time AS latest_create_time,
|
||||
ROW_NUMBER() OVER (PARTITION BY summary_id ORDER BY create_time DESC) AS rn
|
||||
FROM wms_report_detail
|
||||
) d ON s.summary_id = d.summary_id AND d.rn = 1
|
||||
<where>
|
||||
<if test="bo.reportTitle != null and bo.reportTitle != ''">
|
||||
AND s.report_title LIKE CONCAT('%', #{bo.reportTitle}, '%')
|
||||
</if>
|
||||
<if test="bo.reportDate != null">
|
||||
AND s.report_date = #{bo.reportDate}
|
||||
</if>
|
||||
<if test="bo.reporter != null and bo.reporter != ''">
|
||||
AND s.reporter LIKE CONCAT('%', #{bo.reporter}, '%')
|
||||
</if>
|
||||
<if test="bo.projectId != null">
|
||||
AND s.project_id = #{bo.projectId}
|
||||
</if>
|
||||
<if test="bo.type != null">
|
||||
AND s.type = #{bo.type}
|
||||
</if>
|
||||
AND s.del_flag = 0
|
||||
</where>
|
||||
ORDER BY
|
||||
COALESCE(d.latest_create_time, s.report_date) DESC,
|
||||
s.report_date DESC
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user