修改收货入库相关代码
main
zxf 1 week ago
parent 04c4bc9819
commit e9e58efd52

@ -0,0 +1,70 @@
import request from '@/utils/request'
/**
* 新增ckbillnumber
* @param pram
*/
export function ckbillnumberCreateApi(data) {
return request({
url: `autogencode/ckbillnumber/save`,
method: 'POST',
data
})
}
/**
* ckbillnumber更新
* @param pram
*/
export function ckbillnumberUpdateApi(data) {
return request({
url: `autogencode/ckbillnumber/update`,
method: 'POST',
data
})
}
/**
* ckbillnumber详情
* @param pram
*/
export function ckbillnumberDetailApi(id) {
return request({
url: `autogencode/ckbillnumber/info/${id}`,
method: 'GET'
})
}
export function getBillNumber(billPrefix) {
return request({
url: 'autogencode/ckbillnumber/getBillNo/' + billPrefix,
method: 'get'
})
}
/**
* ckbillnumber批量删除
* @param ids
*/
export function ckbillnumberDeleteApi(ids) {
return request({
url: `autogencode/ckbillnumber/delete`,
method: 'POST',
data: ids
})
}
/**
* ckbillnumber列表
* @param pram
*/
export function ckbillnumberListApi(params) {
return request({
url: `autogencode/ckbillnumber/list`,
method: 'GET',
params
})
}

@ -74,3 +74,16 @@ export function cmcustListApi(params) {
}) })
} }
/**
* cmcust列表
* @param pram
*/
export function cmcustListByAll(params) {
return request({
url: `autogencode/cmcust/listByAll`,
method: 'GET',
params
})
}

@ -62,6 +62,18 @@ export function cmcustproductListApi(params) {
}) })
} }
/**
* cmcustproduct列表
* @param pram
*/
export function cmcustproductListByAll(params) {
return request({
url: `autogencode/cmcustproduct/listByAll`,
method: 'GET',
params
})
}
/** /**
* cmcustproduct批量上架 * cmcustproduct批量上架
* @param ids * @param ids

@ -61,3 +61,15 @@ export function cmshelfListApi(params) {
}) })
} }
/**
* cmshelf列表
* @param pram
*/
export function cmshelfListByAll(params) {
return request({
url: `autogencode/cmshelf/listByAll`,
method: 'GET',
params
})
}

@ -61,3 +61,14 @@ export function cmstoragelocationListApi(params) {
}) })
} }
/**
* cmstoragelocation列表
* @param pram
*/
export function cmstoragelocationListByAll(params) {
return request({
url: `autogencode/cmstoragelocation/listByAll`,
method: 'GET',
params
})
}

@ -7,7 +7,7 @@
</template> </template>
<script> <script>
import { getBillNumber } from "@/api/ckbill"; import { getBillNumber } from "@/api/ckbillnumber";
export default { export default {
name: 'BillNumberInput', name: 'BillNumberInput',
props: { props: {
@ -46,9 +46,9 @@ export default {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
getBillNumber(type || this.type).then(res => { getBillNumber(type || this.type).then(res => {
this.loading = false; this.loading = false;
if (res.data) { if (res) {
this.$emit('input', res.data); this.$emit('input', res);
resolve(res.data); resolve(res);
} else { } else {
reject(); reject();
} }

@ -16,15 +16,15 @@
<el-form-item v-else prop="cargoId" class="margin-none"> <el-form-item v-else prop="cargoId" class="margin-none">
<el-select v-model="scope.row.cargoId" filterable placeholder="请输入货物名称或商品序号" style="width: 100%" clearable <el-select v-model="scope.row.cargoId" filterable placeholder="请输入货物名称或商品序号" style="width: 100%" clearable
@change="setCargoDetail($event, scope.row)"> @change="setCargoDetail($event, scope.row)">
<el-option v-for="item in cargoList" :key="item.gdsSeqno" :label="item.cargoName + ' (' + item.gdsSeqno + ')'" :value="item.id" > <el-option v-for="item in cargoList" :key="item.gdsSeqno" :label="item.goodsName + ' (' + item.goodsCode + ')'" :value="item.id" >
<span>{{ item.cargoName }} ({{ item.gdsSeqno }})</span> <span>{{ item.goodsName }} ({{ item.goodsCode }})</span>
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item> <el-descriptions-item>
<template slot="label">HS编号</template> <template slot="label">HS编号</template>
<div class="nomal-text">{{ scope.row.hsCode }}</div> <div class="nomal-text">{{ scope.row.goodsCode }}</div>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item> <el-descriptions-item>
<template slot="label">仓库名称<rq></rq></template> <template slot="label">仓库名称<rq></rq></template>
@ -52,7 +52,7 @@
<el-form-item v-else prop="locationId" class="margin-none"> <el-form-item v-else prop="locationId" class="margin-none">
<el-select v-model="scope.row.locationId" filterable placeholder="请选择货位" style="width: 100%" clearable <el-select v-model="scope.row.locationId" filterable placeholder="请选择货位" style="width: 100%" clearable
@change="onLocationChange($event, scope.row)"> @change="onLocationChange($event, scope.row)">
<el-option v-for="item in locationList" :key="item.id" :label="item.locationName" :value="item.id" /> <el-option v-for="item in locationList" :key="item.id" :label="item.storageLocationName" :value="item.id" />
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-descriptions-item> </el-descriptions-item>
@ -82,7 +82,7 @@
</el-form-item> </el-form-item>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item> <el-descriptions-item>
<template slot="label">第一计量单位<rq/></template> <template slot="label">第一计量单位</template>
<div v-if="tableReadonly" class="nomal-text"> <div v-if="tableReadonly" class="nomal-text">
<dict-tag :options="dict.type.bm_measuring_unit" :value="scope.row.firstUnit"></dict-tag> <dict-tag :options="dict.type.bm_measuring_unit" :value="scope.row.firstUnit"></dict-tag>
</div> </div>
@ -95,35 +95,35 @@
</el-form-item> </el-form-item>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item> <el-descriptions-item>
<template slot="label">货物自然序号<rq></rq></template> <template slot="label">货物自然序号</template>
<div v-if="tableReadonly" class="nomal-text">{{ scope.row.cargoNumber }}</div> <div v-if="tableReadonly" class="nomal-text">{{ scope.row.cargoNumber }}</div>
<el-form-item v-else prop="cargoNumber" class="margin-none"> <el-form-item v-else prop="cargoNumber" class="margin-none">
<el-input v-model="scope.row.cargoNumber" placeholder="请输入货物自然序号" /> <el-input v-model="scope.row.cargoNumber" placeholder="请输入货物自然序号" />
</el-form-item> </el-form-item>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item> <el-descriptions-item>
<template slot="label">商品料号<rq></rq></template> <template slot="label">商品料号</template>
<div v-if="tableReadonly" class="nomal-text">{{ scope.row.itemNumber }}</div> <div v-if="tableReadonly" class="nomal-text">{{ scope.row.itemNumber }}</div>
<el-form-item v-else prop="itemNumber" class="margin-none"> <el-form-item v-else prop="itemNumber" class="margin-none">
<el-input v-model="scope.row.itemNumber" placeholder="请输入商品料号" /> <el-input v-model="scope.row.itemNumber" placeholder="请输入商品料号" />
</el-form-item> </el-form-item>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item> <el-descriptions-item>
<template slot="label">电子账册项号<rq></rq></template> <template slot="label">电子账册项号</template>
<div v-if="tableReadonly" class="nomal-text">{{ scope.row.bookNumber }}</div> <div v-if="tableReadonly" class="nomal-text">{{ scope.row.bookNumber }}</div>
<el-form-item v-else prop="bookNumber" class="margin-none"> <el-form-item v-else prop="bookNumber" class="margin-none">
<el-input v-model="scope.row.bookNumber" placeholder="请输入电子账册项号" /> <el-input v-model="scope.row.bookNumber" placeholder="请输入电子账册项号" />
</el-form-item> </el-form-item>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item> <el-descriptions-item>
<template slot="label">报关单号<rq></rq></template> <template slot="label">报关单号</template>
<div v-if="tableReadonly" class="nomal-text">{{ scope.row.customsNo }}</div> <div v-if="tableReadonly" class="nomal-text">{{ scope.row.customsNo }}</div>
<el-form-item v-else prop="customsNo" class="margin-none"> <el-form-item v-else prop="customsNo" class="margin-none">
<el-input v-model="scope.row.customsNo" placeholder="请输入报关单号" /> <el-input v-model="scope.row.customsNo" placeholder="请输入报关单号" />
</el-form-item> </el-form-item>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item> <el-descriptions-item>
<template slot="label">核注清单号<rq></rq></template> <template slot="label">核注清单号</template>
<div v-if="tableReadonly" class="nomal-text">{{ scope.row.listNumber }}</div> <div v-if="tableReadonly" class="nomal-text">{{ scope.row.listNumber }}</div>
<el-form-item v-else prop="listNumber" class="margin-none"> <el-form-item v-else prop="listNumber" class="margin-none">
<el-input v-model="scope.row.listNumber" placeholder="请输入核注清单号" /> <el-input v-model="scope.row.listNumber" placeholder="请输入核注清单号" />
@ -185,8 +185,8 @@
<template slot="label">有效期至<rq></rq></template> <template slot="label">有效期至<rq></rq></template>
<div v-if="tableReadonly" class="nomal-text">{{ scope.row.expiryDate }}</div> <div v-if="tableReadonly" class="nomal-text">{{ scope.row.expiryDate }}</div>
<el-form-item v-else prop="expiryDate" class="margin-none"> <el-form-item v-else prop="expiryDate" class="margin-none">
<el-date-picker clearable v-model="scope.row.expiryDate" style="width: 100%" type="date" <el-date-picker clearable v-model="scope.row.expiryDate" style="width: 100%" type="datetime"
value-format="yyyy-MM-dd" placeholder="请选择有效期至"> value-format="yyyy-MM-dd HH:mm:ss" placeholder="请选择有效期至">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
</el-descriptions-item> </el-descriptions-item>
@ -271,11 +271,11 @@
</template> </template>
<script> <script>
import { cmcustproductListApi as listCargo } from '@/api/cmcustproduct.js' import { cmcustproductListByAll as listCargo } from '@/api/cmcustproduct.js'
import { cmcustListApi as listCust } from "@/api/cmcust"; import { cmcustListByAll as listCust } from "@/api/cmcust";
import { listWarehouse } from "@/api/cmwarehouse"; import { listWarehouse } from "@/api/cmwarehouse";
import { cmshelfListApi as listShelf } from "@/api/cmshelf"; import { cmshelfListByAll as listShelf } from "@/api/cmshelf";
import { cmlocationListApi as listLocation } from "@/api/cmstoragelocation"; import { cmstoragelocationListByAll as listLocation } from "@/api/cmstoragelocation";
import { ckbillDetailApi as getCkbillInfo, putBill } from '@/api/ckbill'; import { ckbillDetailApi as getCkbillInfo, putBill } from '@/api/ckbill';
import { ckbillcargoDeleteApi as delCkcargo, recallPutBill } from '@/api/ckbillcargo'; import { ckbillcargoDeleteApi as delCkcargo, recallPutBill } from '@/api/ckbillcargo';
// import { listVessel } from "@/api/jxc/vessel"; // import { listVessel } from "@/api/jxc/vessel";
@ -303,18 +303,18 @@ export default {
cargoValue: [ cargoValue: [
{ required: true, message: "货物价值不能为空", trigger: "blur" } { required: true, message: "货物价值不能为空", trigger: "blur" }
], ],
cargoNumber: [ // cargoNumber: [
{ required: true, message: "货物自然序号不能为空", trigger: "blur" } // { required: true, message: "", trigger: "blur" }
], // ],
expiryDate: [ // expiryDate: [
{ required: true, message: "货物过期时间不能为空", trigger: "blur" } // { required: true, message: "", trigger: "blur" }
], // ],
itemNumber: [ // itemNumber: [
{ required: true, message: "商品料号不能为空", trigger: "blur" } // { required: true, message: "", trigger: "blur" }
], // ],
bookNumber: [ // bookNumber: [
{ required: true, message: "电子账册项号不能为空", trigger: "blur" } // { required: true, message: "", trigger: "blur" }
], // ],
// customsNo: [ // customsNo: [
// { required: true, message: "", trigger: "blur" } // { required: true, message: "", trigger: "blur" }
// ], // ],
@ -339,15 +339,15 @@ export default {
cargoId: [ cargoId: [
{ required: true, message: "货物不能为空", trigger: "change" } { required: true, message: "货物不能为空", trigger: "change" }
], ],
cargoWt: [ // cargoWt: [
{ required: true, message: '货物重量不能为空', trigger: 'blur' } // { required: true, message: '', trigger: 'blur' }
], // ],
cargoNum: [ // cargoNum: [
{ required: true, message: '货物件数不能为空', trigger: 'blur' } // { required: true, message: '', trigger: 'blur' }
], // ],
cargoVol: [ // cargoVol: [
{ required: true, message: '货物体积不能为空', trigger: 'blur' } // { required: true, message: '', trigger: 'blur' }
], // ],
// cargoWt: [ // cargoWt: [
// { validator: valueValid, trigger: "change" } // { validator: valueValid, trigger: "change" }
// ], // ],
@ -558,6 +558,7 @@ export default {
val.custId = this.form.custId; val.custId = this.form.custId;
val.custName = this.form.custName; val.custName = this.form.custName;
val.custCode = this.form.custCode; val.custCode = this.form.custCode;
val.inStockId = val.stockId; // inStockIdstockIdCmWarehouseid
}); });
const params = { ...this.form }; const params = { ...this.form };
// 1 2 // 1 2
@ -672,7 +673,7 @@ export default {
// //
getCargoList() { getCargoList() {
listCargo({}).then(response => { listCargo({}).then(response => {
this.cargoList = response.data; this.cargoList = response;
}).catch(e => { }).catch(e => {
}); });
}, },
@ -681,7 +682,7 @@ export default {
this.cargoList.forEach(ele => { this.cargoList.forEach(ele => {
if (ele.id == cargoId) { if (ele.id == cargoId) {
form.cargoName = ele.cargoName; form.cargoName = ele.cargoName;
form.hsCode = ele.hsCode; form.goodsCode = ele.goodsCode;
form.cargoSpec = ele.cargoSpec; form.cargoSpec = ele.cargoSpec;
form.originCountry = ele.originCountry; form.originCountry = ele.originCountry;
} }
@ -698,15 +699,16 @@ export default {
}, },
// //
getCustList() { getCustList() {
listCust({custBelong:1}).then(response => { // {custBelong:1}
this.custList = response.data; listCust().then(response => {
this.custList = response;
}).catch(e => { }).catch(e => {
}); });
}, },
// //
getWarehouseList() { getWarehouseList() {
listWarehouse({}).then(response => { listWarehouse({}).then(response => {
this.warehouseList = response.data || []; this.warehouseList = response || [];
}).catch(e => { }).catch(e => {
console.error('获取仓库列表失败:', e); console.error('获取仓库列表失败:', e);
this.warehouseList = []; this.warehouseList = [];
@ -715,7 +717,7 @@ export default {
// //
getShelfList(warehouseId) { getShelfList(warehouseId) {
listShelf({ warehouseId }).then(response => { listShelf({ warehouseId }).then(response => {
this.shelfList = response.data || []; this.shelfList = response || [];
}).catch(e => { }).catch(e => {
console.error('获取货架列表失败:', e); console.error('获取货架列表失败:', e);
this.shelfList = []; this.shelfList = [];
@ -724,7 +726,7 @@ export default {
// //
getLocationList(shelfId) { getLocationList(shelfId) {
listLocation({ shelfId }).then(response => { listLocation({ shelfId }).then(response => {
this.locationList = response.data || []; this.locationList = response || [];
}).catch(e => { }).catch(e => {
console.error('获取货位列表失败:', e); console.error('获取货位列表失败:', e);
this.locationList = []; this.locationList = [];
@ -742,8 +744,10 @@ export default {
const warehouse = this.warehouseList.find(item => item.stockCode === stockCode); const warehouse = this.warehouseList.find(item => item.stockCode === stockCode);
if (warehouse) { if (warehouse) {
row.stockName = warehouse.stockName; row.stockName = warehouse.stockName;
row.stockId = warehouse.id; // ID
this.getShelfList(warehouse.id); this.getShelfList(warehouse.id);
} else { } else {
row.stockId = ''; // ID
this.shelfList = []; this.shelfList = [];
this.locationList = []; this.locationList = [];
} }
@ -771,7 +775,7 @@ export default {
// //
const location = this.locationList.find(item => item.id === locationId); const location = this.locationList.find(item => item.id === locationId);
if (location) { if (location) {
row.locationName = location.locationName; row.locationName = location.storageLocationName;
} }
} else { } else {
row.locationName = ''; row.locationName = '';

@ -30,7 +30,7 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-pagination class="margin-top10" style="float: right;" layout="prev, pager, next, jumper" :total="total" small <el-pagination class="margin-top10" style="float: right;" layout="prev, pager, next, jumper" :total="total" small
hide-on-single-page :current-page.sync="queryParams.pageNum" :page-size.sync="queryParams.pageSize" :current-page.sync="queryParams.pageNum" :page-size.sync="queryParams.pageSize"
@current-change="getList" /> @current-change="getList" />
</div> </div>
</template> </template>
@ -90,7 +90,8 @@ export default {
...this.queryParams, ...this.queryParams,
...this.params ...this.params
}).then(response => { }).then(response => {
this.list = response.rows || [];
this.list = response.list || [];
this.total = response.total; this.total = response.total;
this.loading = false; this.loading = false;

@ -132,7 +132,7 @@ import {
import BillList from '@/views/ck/ckwarehouse/components/BillList'; import BillList from '@/views/ck/ckwarehouse/components/BillList';
import BillEdit from '@/views/ck/ckwarehouse/components/BillEdit'; import BillEdit from '@/views/ck/ckwarehouse/components/BillEdit';
import { listWarehouse } from "@/api/cmwarehouse"; import { listWarehouse } from "@/api/cmwarehouse";
import { ckbillListApi as delCkbill} from "@/api/ckbill"; import { ckbillDeleteApi as delCkbill} from "@/api/ckbill";
// import { listVessel } from "@/api/jxc/vessel"; // import { listVessel } from "@/api/jxc/vessel";
export default { export default {
@ -318,7 +318,7 @@ export default {
getList() { getList() {
this.loading = true; this.loading = true;
pageListCkcargo(this.queryParams).then(response => { pageListCkcargo(this.queryParams).then(response => {
this.ckcargoList = response.rows; this.ckcargoList = response.list;
this.total = response.total; this.total = response.total;
this.loading = false; this.loading = false;
}).catch(e => { }).catch(e => {
@ -371,7 +371,8 @@ export default {
}, },
handleDel() { handleDel() {
if (this.selectedBill.billStatus == '0') { if (this.selectedBill.billStatus == '0') {
const ids = this.selectedBill.id || this.ids; // ids
const ids = this.selectedBill.id ? [this.selectedBill.id] : this.ids;
this.$modal.confirm('是否确认删除"' + this.selectedBill.billNumber+ '"的入库单据?').then(function() { this.$modal.confirm('是否确认删除"' + this.selectedBill.billNumber+ '"的入库单据?').then(function() {
return delCkbill(ids); return delCkbill(ids);
}).then(() => { }).then(() => {
@ -387,7 +388,11 @@ export default {
if (type === 'bill') { if (type === 'bill') {
this.open = true; this.open = true;
this.$nextTick(() => { this.$nextTick(() => {
if (this.$refs.billEdit) {
this.$refs.billEdit.open({ type: 1 }); this.$refs.billEdit.open({ type: 1 });
} else {
console.error('BillEdit component not found');
}
}) })
return; return;
} }
@ -399,14 +404,22 @@ export default {
}).then(() => { }).then(() => {
this.open = true; this.open = true;
this.$nextTick(() => { this.$nextTick(() => {
if (this.$refs.billEdit) {
this.$refs.billEdit.open({ type: 1 }); this.$refs.billEdit.open({ type: 1 });
} else {
console.error('BillEdit component not found');
}
}) })
}); });
return; return;
} }
this.open = true; this.open = true;
this.$nextTick(() => { this.$nextTick(() => {
if (this.$refs.billEdit) {
this.$refs.billEdit.open({ type: 1, data: this.selectedBill }); this.$refs.billEdit.open({ type: 1, data: this.selectedBill });
} else {
console.error('BillEdit component not found');
}
}) })
}, },
backBill() { backBill() {
@ -456,7 +469,11 @@ export default {
this.title = "修改"; this.title = "修改";
this.open = true; this.open = true;
this.$nextTick(() => { this.$nextTick(() => {
if (this.$refs.billEdit) {
this.$refs.billEdit.open({ type: 0, data: row }); this.$refs.billEdit.open({ type: 0, data: row });
} else {
console.error('BillEdit component not found');
}
}) })
}, },
showDetail(row) { showDetail(row) {
@ -464,7 +481,15 @@ export default {
this.title = "查看"; this.title = "查看";
this.open = true; this.open = true;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.billEdit.open({ type: 2, data: row.id ? row : this.modifyData }); console.log(row.id)
if (this.$refs.billEdit) {
// rowbillId
const data = row.id ? row : this.modifyData;
console.log(data)
this.$refs.billEdit.open({ type: 2, data: data });
} else {
console.error('BillEdit component not found');
}
}) })
}, },

@ -45,12 +45,30 @@
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="12">
<el-form-item label="座位布局类型" prop="seatLayout"> <el-form-item label="座位布局类型" prop="seatLayout">
<el-input v-model="dataForm.seatLayout" placeholder="座位布局类型"></el-input> <el-select v-model="dataForm.seatLayout" placeholder="请选择座位布局类型" :style="{ width: '100%' }">
<el-option v-if="!dict.type.seat_layout" label="无数据" value="" disabled/>
<el-option
v-else
v-for="dict in dict.type.seat_layout"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="配套设备" prop="equipmentConfig"> <el-form-item label="配套设备" prop="equipmentConfig">
<el-input v-model="dataForm.equipmentConfig" placeholder="配套设备"></el-input> <el-select v-model="dataForm.equipmentConfig" placeholder="请选择配套设备" :style="{ width: '100%' }" multiple>
<el-option v-if="!dict.type.equipment_config" label="无数据" value="" disabled/>
<el-option
v-else
v-for="dict in dict.type.equipment_config"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -62,25 +80,46 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="可预约时间段" prop="reserveTimeRange"> <el-form-item label="可预约时间段" prop="reserveTimeRange">
<el-input v-model="dataForm.reserveTimeRange" placeholder="可预约时间段"></el-input> <el-time-picker
v-model="dataForm.reserveTimeRange"
is-range
range-separator="-"
start-placeholder="开始时间"
end-placeholder="结束时间"
value-format="HH:mm"
format="HH:mm"
style="width: 100%">
</el-time-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="12">
<el-form-item label="会议室状态" prop="roomStatus"> <el-form-item label="会议室状态" prop="roomStatus">
<el-input v-model="dataForm.roomStatus" placeholder="会议室状态"></el-input> <el-select v-model="dataForm.roomStatus" placeholder="请选择会议室状态" :style="{ width: '100%' }">
<el-option v-if="!dict.type.room_status" label="无数据" value="" disabled/>
<el-option
v-else
v-for="dict in dict.type.room_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-form-item label="文件id" prop="fileId"> <el-form-item label="会议室照片" prop="fileId">
<el-input v-model="dataForm.fileId" placeholder="文件id"></el-input> <FileUploadVO
:value="roomFiles"
@input="updateRoomFiles"
></FileUploadVO>
</el-form-item> </el-form-item>
<el-form-item label="会议室描述" prop="description"> <el-form-item label="会议室描述" prop="description">
<el-input v-model="dataForm.description" placeholder="会议室描述"></el-input> <el-input v-model="dataForm.description" placeholder="会议室描述" type="textarea" :rows="3"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="备注" prop="remark"> <el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.remark" placeholder="备注"></el-input> <el-input v-model="dataForm.remark" placeholder="备注" type="textarea" :rows="3"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
@ -92,11 +131,16 @@
<script> <script>
import * as api from '@/api/cmmeetingroom.js' import * as api from '@/api/cmmeetingroom.js'
import FileUploadVO from '@/components/FileUploadVO/index.vue'
export default { export default {
dicts: ['room_status','seat_layout'], components: {
FileUploadVO
},
dicts: ['room_status','seat_layout','equipment_config'],
data () { data () {
return { return {
visible: false, visible: false,
roomFiles: [], //
dataForm: { dataForm: {
id: 0, id: 0,
roomName: '' , roomName: '' ,
@ -106,13 +150,14 @@
fixedSeats: '' , fixedSeats: '' ,
movableSeats: '' , movableSeats: '' ,
seatLayout: '' , seatLayout: '' ,
equipmentConfig: '' , equipmentConfig: [] ,
chargeStandard: '' , chargeStandard: '' ,
reserveTimeRange: '' , reserveTimeRange: null ,
fileId: '' , fileId: '' ,
roomStatus: '' , roomStatus: '' ,
description: '' , description: '' ,
remark: '' , remark: '' ,
files: []
}, },
dataRule: { dataRule: {
roomName: [ roomName: [
@ -161,6 +206,46 @@
} }
}, },
methods: { methods: {
//
updateRoomFiles(files) {
this.roomFiles = files
if (files && files.length > 0) {
this.dataForm.files = files.map(file => {
let attDir = file.attDir || file.attachFileUrl || ''
if (attDir.startsWith('/file/public/')) {
attDir = attDir.replace('/file/public/', '')
} else if (attDir.startsWith('/file/')) {
attDir = attDir.replace('/file/', '')
}
return {
attId: file.id || file.attId || '',
name: file.name || file.oldName || '',
attDir: attDir,
attSize: file.attSize || '',
attType: file.attType || '',
fileName: file.name || file.oldName || '',
filePath: attDir,
url: attDir,
createTime: null,
createdBy: null,
createTimeStr: null,
delFlag: '0',
updateBy: null,
updateTime: null,
i18nCode: '',
i18nLanguage: '',
originalFileName: file.name || file.oldName || '',
position: 0,
remark: file.remark || '',
sort: 0,
status: ''
}
})
} else {
this.dataForm.files = []
}
},
init (id) { // init (id) { //
this.dataForm.id = id || 0 this.dataForm.id = id || 0
this.visible = true this.visible = true
@ -169,7 +254,33 @@
if (this.dataForm.id) { if (this.dataForm.id) {
api.cmmeetingroomDetailApi(id).then(function(res) { api.cmmeetingroomDetailApi(id).then(function(res) {
this.dataForm = res; this.dataForm = res;
if (this.dataForm.reserveTimeRange && typeof this.dataForm.reserveTimeRange === 'string') {
this.dataForm.reserveTimeRange = this.dataForm.reserveTimeRange.split('-')
}
// equipmentConfig
if (this.dataForm.equipmentConfig && typeof this.dataForm.equipmentConfig === 'string') {
this.dataForm.equipmentConfig = this.dataForm.equipmentConfig.split('、')
}
// roomStatus 便
if (this.dataForm.roomStatus !== null && this.dataForm.roomStatus !== undefined) {
this.dataForm.roomStatus = this.dataForm.roomStatus.toString()
}
if (this.dataForm.files && this.dataForm.files.length > 0) {
this.roomFiles = this.dataForm.files.map((file, index) => ({
attachFileUrl: file.attDir || file.filePath || file.url || '',
attDir: file.attDir || file.filePath || file.url || '',
name: file.name || file.fileName || '',
oldName: file.name || file.fileName || '',
attId: file.attId || '',
uid: file.id || file.fileId || index + new Date().getTime()
}))
} else {
this.roomFiles = []
}
}.bind(this)) }.bind(this))
} else {
this.roomFiles = []
this.dataForm.files = []
} }
}.bind(this)) }.bind(this))
}, },
@ -177,14 +288,26 @@
dataSubmit () { dataSubmit () {
this.$refs['dataForm'].validate((valid) => { this.$refs['dataForm'].validate((valid) => {
if (valid) { if (valid) {
const submitData = { ...this.dataForm }
if (Array.isArray(submitData.reserveTimeRange) && submitData.reserveTimeRange.length === 2) {
submitData.reserveTimeRange = submitData.reserveTimeRange.join('-')
}
// equipmentConfig
if (Array.isArray(submitData.equipmentConfig)) {
submitData.equipmentConfig = submitData.equipmentConfig.join('、')
}
// roomStatus
if (submitData.roomStatus !== '') {
submitData.roomStatus = parseInt(submitData.roomStatus)
}
if (this.dataForm.id) { if (this.dataForm.id) {
api.cmmeetingroomUpdateApi(this.dataForm).then(function(res) { api.cmmeetingroomUpdateApi(submitData).then(function(res) {
this.$message.success('保存成功') this.$message.success('保存成功')
this.visible = false this.visible = false
this.$emit('refreshDataList') this.$emit('refreshDataList')
}.bind(this)); }.bind(this));
} else { } else {
api.cmmeetingroomCreateApi(this.dataForm).then(function(res) { api.cmmeetingroomCreateApi(submitData).then(function(res) {
this.$message.success('新增成功') this.$message.success('新增成功')
this.visible = false this.visible = false
this.$emit('refreshDataList') this.$emit('refreshDataList')

@ -8,15 +8,33 @@
<el-input v-model="dataForm.roomLocation" placeholder="请输入会议室位置" clearable></el-input> <el-input v-model="dataForm.roomLocation" placeholder="请输入会议室位置" clearable></el-input>
</el-form-item> </el-form-item>
<el-form-item label="座位布局类型"> <el-form-item label="座位布局类型">
<el-input v-model="dataForm.seatLayout" placeholder="请输入座位布局类型" clearable></el-input> <el-select v-model="dataForm.seatLayout" placeholder="请选择座位布局类型" clearable>
<el-option v-if="!dict.type.seat_layout" label="无数据" value="" disabled/>
<el-option
v-else
v-for="dict in dict.type.seat_layout"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="会议室状态"> <el-form-item label="会议室状态">
<el-input v-model="dataForm.roomStatus" placeholder="请输入会议室状态" clearable></el-input> <el-select v-model="dataForm.roomStatus" placeholder="请选择会议室状态" clearable>
<el-option v-if="!dict.type.room_status" label="无数据" value="" disabled/>
<el-option
v-else
v-for="dict in dict.type.room_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button @click="getDataList()"></el-button> <el-button @click="getDataList()"></el-button>
<el-button @click="resetForm()"></el-button> <el-button @click="resetForm()"></el-button>
<el-button v-hasPermi="['autogencode:cmmeetingroom:save']" type="primary" @click="addOrUpdateHandle()"></el-button> <el-button v-hasPermi="['autogencode:cmmeetingroom:save']" type="primary" @click="addOrUpdateHandle()"></el-button>
<el-button v-hasPermi="['autogencode:cmmeetingroom:delete']" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0"></el-button> <el-button v-hasPermi="['autogencode:cmmeetingroom:delete']" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0"></el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -73,12 +91,19 @@
header-align="center" header-align="center"
align="center" align="center"
label="座位布局类型"> label="座位布局类型">
<template slot-scope="scope">
<dict-tag v-if="dict.type.seat_layout && dict.type.seat_layout.length > 0" :options="dict.type.seat_layout" :value="scope.row.seatLayout"/>
<span v-else>{{ scope.row.seatLayout }}</span>
</template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="equipmentConfig" prop="equipmentConfig"
header-align="center" header-align="center"
align="center" align="center"
label="配套设备"> label="配套设备">
<template slot-scope="scope">
{{ formatEquipmentConfig(scope.row.equipmentConfig) }}
</template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="chargeStandard" prop="chargeStandard"
@ -97,17 +122,23 @@
header-align="center" header-align="center"
align="center" align="center"
label="会议室状态"> label="会议室状态">
<template slot-scope="scope">
<dict-tag v-if="dict.type.room_status && dict.type.room_status.length > 0" :options="dict.type.room_status" :value="scope.row.roomStatus ? scope.row.roomStatus.toString() : ''"/>
<span v-else>{{ scope.row.roomStatus }}</span>
</template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="description" prop="description"
header-align="center" header-align="center"
align="center" align="center"
show-overflow-tooltip
label="会议室描述"> label="会议室描述">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="remark" prop="remark"
header-align="center" header-align="center"
align="center" align="center"
show-overflow-tooltip
label="备注"> label="备注">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
@ -140,7 +171,7 @@
import AddOrUpdate from './cmmeetingroom-add-and-update' import AddOrUpdate from './cmmeetingroom-add-and-update'
import * as api from '@/api/cmmeetingroom.js' import * as api from '@/api/cmmeetingroom.js'
export default { export default {
dicts: ['room_status','seat_layout'], dicts: ['room_status','seat_layout','equipment_config'],
data () { data () {
return { return {
dataForm: { dataForm: {
@ -180,6 +211,14 @@
this.getDataList() this.getDataList()
}, },
methods: { methods: {
formatEquipmentConfig(config) {
if (!config) return '-';
const arr = config.split('、').filter(i => i);
return arr.map(item => {
const dictItem = (this.dict.type.equipment_config || []).find(d => d.value === item);
return dictItem ? dictItem.label : item;
}).join('、');
},
// //
resetForm() { resetForm() {
this.dataForm = { this.dataForm = {

@ -22,7 +22,16 @@
<el-input v-model="dataForm.userId" placeholder="催缴人"></el-input> <el-input v-model="dataForm.userId" placeholder="催缴人"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="是否已读" prop="isRead"> <el-form-item label="是否已读" prop="isRead">
<el-input v-model="dataForm.isRead" placeholder="是否已读"></el-input> <el-select v-model="dataForm.isRead" placeholder="请选择是否已读" :style="{ width: '100%' }">
<el-option v-if="!dict.type.is_read" label="无数据" value="" disabled/>
<el-option
v-else
v-for="dict in dict.type.is_read"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="备注" prop="remark"> <el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.remark" placeholder="备注"></el-input> <el-input v-model="dataForm.remark" placeholder="备注"></el-input>
@ -38,6 +47,7 @@
<script> <script>
import * as api from '@/api/fmdunningrecord.js' import * as api from '@/api/fmdunningrecord.js'
export default { export default {
dicts: ['is_read'],
data () { data () {
return { return {
visible: false, visible: false,
@ -52,27 +62,27 @@
remark: '' , remark: '' ,
}, },
dataRule: { dataRule: {
chargeId: [ // chargeId: [
{ required: true, message: '费用id 为必填项', trigger: 'blur' } // { required: true, message: 'id ', trigger: 'blur' }
], // ],
dunningMethod: [ // dunningMethod: [
{ required: true, message: '催缴方式 为必填项', trigger: 'blur' } // { required: true, message: ' ', trigger: 'blur' }
], // ],
dunningContent: [ // dunningContent: [
{ required: true, message: '催缴内容 为必填项', trigger: 'blur' } // { required: true, message: ' ', trigger: 'blur' }
], // ],
dunningTime: [ // dunningTime: [
{ required: true, message: '催缴时间 为必填项', trigger: 'blur' } // { required: true, message: ' ', trigger: 'blur' }
], // ],
userId: [ userId: [
{ required: true, message: '催缴人 为必填项', trigger: 'blur' } { required: true, message: '催缴人 为必填项', trigger: 'blur' }
], ],
isRead: [ // isRead: [
{ required: true, message: '是否已读 为必填项', trigger: 'blur' } // { required: true, message: ' ', trigger: 'blur' }
], // ],
remark: [ // remark: [
{ required: true, message: '备注 为必填项', trigger: 'blur' } // { required: true, message: ' ', trigger: 'blur' }
], // ],
} }
} }
}, },

@ -1,31 +1,28 @@
<template> <template>
<div class="divBox"> <div class="divBox">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()"> <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item label="费用id">
<el-input v-model="dataForm.chargeId" placeholder="请输入费用id" clearable></el-input>
</el-form-item>
<el-form-item label="催缴方式"> <el-form-item label="催缴方式">
<el-input v-model="dataForm.dunningMethod" placeholder="请输入催缴方式" clearable></el-input> <el-input v-model="dataForm.dunningMethod" placeholder="请输入催缴方式" clearable></el-input>
</el-form-item> </el-form-item>
<el-form-item label="催缴内容">
<el-input v-model="dataForm.dunningContent" placeholder="请输入催缴内容" clearable></el-input>
</el-form-item>
<el-form-item label="催缴时间">
<el-input v-model="dataForm.dunningTime" placeholder="请输入催缴时间" clearable></el-input>
</el-form-item>
<el-form-item label="催缴人"> <el-form-item label="催缴人">
<el-input v-model="dataForm.userId" placeholder="请输入催缴人" clearable></el-input> <el-input v-model="dataForm.userId" placeholder="请输入催缴人" clearable></el-input>
</el-form-item> </el-form-item>
<el-form-item label="是否已读"> <el-form-item label="是否已读">
<el-input v-model="dataForm.isRead" placeholder="请输入是否已读" clearable></el-input> <el-select v-model="dataForm.isRead" placeholder="请选择是否已读" style="width: 100%" clearable>
</el-form-item> <el-option v-if="!dict.type.is_read" label="无数据" value="" disabled/>
<el-form-item label="备注"> <el-option
<el-input v-model="dataForm.remark" placeholder="请输入备注" clearable></el-input> v-else
v-for="dict in dict.type.is_read"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button @click="getDataList()"></el-button> <el-button @click="getDataList()"></el-button>
<el-button @click="resetForm()"></el-button> <el-button @click="resetForm()"></el-button>
<el-button v-hasPermi="['autogencode:fmdunningrecord:save']" type="primary" @click="addOrUpdateHandle()"></el-button> <el-button v-hasPermi="['autogencode:fmdunningrecord:save']" type="primary" @click="addOrUpdateHandle()"></el-button>
<el-button v-hasPermi="['autogencode:fmdunningrecord:delete']" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0"></el-button> <el-button v-hasPermi="['autogencode:fmdunningrecord:delete']" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0"></el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -41,12 +38,6 @@
align="center" align="center"
width="50"> width="50">
</el-table-column> </el-table-column>
<el-table-column
prop="chargeId"
header-align="center"
align="center"
label="费用id">
</el-table-column>
<el-table-column <el-table-column
prop="dunningMethod" prop="dunningMethod"
header-align="center" header-align="center"
@ -76,6 +67,10 @@
header-align="center" header-align="center"
align="center" align="center"
label="是否已读"> label="是否已读">
<template slot-scope="scope">
<dict-tag v-if="dict.type.is_read && dict.type.is_read.length > 0" :options="dict.type.is_read" :value="scope.row.isRead"/>
<span v-else>{{ scope.row.isRead }}</span>
</template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="remark" prop="remark"
@ -113,6 +108,7 @@
import AddOrUpdate from './fmdunningrecord-add-and-update' import AddOrUpdate from './fmdunningrecord-add-and-update'
import * as api from '@/api/fmdunningrecord.js' import * as api from '@/api/fmdunningrecord.js'
export default { export default {
dicts: ['is_read'],
data () { data () {
return { return {
dataForm: { dataForm: {

@ -1,15 +1,23 @@
package com.zbkj.modules.autogencode.controller; package com.zbkj.modules.autogencode.controller;
import java.util.Arrays; import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map; import java.util.Map;
import cn.hutool.core.lang.Validator;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.zbkj.modules.autogencode.entity.*;
import org.apache.commons.lang3.StringUtils;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.zbkj.common.request.PageParamRequest; import com.zbkj.common.request.PageParamRequest;
import com.zbkj.common.response.CommonResult; import com.zbkj.common.response.CommonResult;
import com.zbkj.common.page.CommonPage; import com.zbkj.common.page.CommonPage;
import com.zbkj.modules.autogencode.entity.CkBill;
import com.zbkj.modules.autogencode.service.CkBillService; import com.zbkj.modules.autogencode.service.CkBillService;
import com.zbkj.modules.autogencode.service.CkBillCargoService;
import com.zbkj.modules.autogencode.service.CkBillStockService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -19,13 +27,6 @@ import org.springframework.security.access.prepost.PreAuthorize;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.zbkj.modules.autogencode.entity.CkBillCargo;
import com.zbkj.modules.autogencode.service.CkBillCargoService;
/** /**
* *
*/ */
@ -38,6 +39,9 @@ public class CkBillCargoController {
@Autowired @Autowired
private CkBillService ckBillService; private CkBillService ckBillService;
@Autowired
private CkBillStockService ckBillStockService;
/** /**
* *
* *
@ -293,12 +297,83 @@ public class CkBillCargoController {
LambdaQueryWrapper<CkBillCargo> queryWrapper = new LambdaQueryWrapper(); LambdaQueryWrapper<CkBillCargo> queryWrapper = new LambdaQueryWrapper();
// 应用搜索条件 // 应用搜索条件
condition(queryWrapper, request); buildQueryWrapper(queryWrapper, request);
CommonPage<CkBillCargo> page = CommonPage.restPage(ckBillCargoService.pageList(queryWrapper, pageParamRequest)); CommonPage<CkBillCargo> page = CommonPage.restPage(ckBillCargoService.pageList(queryWrapper, pageParamRequest));
// 查询所有的CkBillStock信息
List<CkBillStock> ckBillStockList = ckBillStockService.list();
// 构建映射key为billCargoIdvalue为对应的CkBillStock
Map<Long, CkBillStock> ckBillStockMap = new HashMap<>();
for (CkBillStock ckBillStock : ckBillStockList) {
ckBillStockMap.put(ckBillStock.getBillCargoId(), ckBillStock);
}
// 为返回的数据添加仓库名称、货架名称和货位名称
for (CkBillCargo cargo : page.getList()) {
CkBillStock ckBillStock = ckBillStockMap.get(cargo.getId());
if (ckBillStock != null) {
cargo.setStockName(ckBillStock.getStockName());
cargo.setShelfName(ckBillStock.getShelfName());
cargo.setLocationName(ckBillStock.getLocationName());
}
}
return CommonResult.success(page); return CommonResult.success(page);
} }
/**
*
*/
private void buildQueryWrapper(LambdaQueryWrapper<CkBillCargo> queryWrapper, CkBillCargo request) {
if (request == null) {
return;
}
if (Validator.isNotEmpty(request.getInoutType())) {
if ("3".equals(request.getInoutType())) {
// 查询转场数据
queryWrapper.inSql(CkBillCargo::getBillId, "select id from ck_bill where bill_type = '3'");
} else if ("4".equals(request.getInoutType())) {
// 查询混配数据
queryWrapper.inSql(CkBillCargo::getBillId, "select id from ck_bill where bill_type = '4'");
} else {
queryWrapper.eq(CkBillCargo::getInoutType, request.getInoutType());
}
}
// 应用基础搜索条件
condition(queryWrapper, request);
// 日期范围查询
if (request.getBeginDate() != null) {
queryWrapper.between(CkBillCargo::getBillDate, request.getBeginDate(), adjustEndDate(request.getEndDate()));
}
if (request.getBeginDateTwo() != null) {
queryWrapper.between(CkBillCargo::getExpiryDate, request.getBeginDateTwo(), adjustEndDate(request.getEndDateTwo()));
}
// 排序
queryWrapper.orderByDesc(CkBillCargo::getBillDate);
}
/**
*
*/
private Date adjustEndDate(Date endDate) {
if (endDate != null) {
Calendar calendar = Calendar.getInstance();
calendar.setTime(endDate);
calendar.set(Calendar.HOUR_OF_DAY, 23);
calendar.set(Calendar.MINUTE, 59);
calendar.set(Calendar.SECOND, 59);
calendar.set(Calendar.MILLISECOND, 0);
return calendar.getTime();
}
return null;
}
/** /**
* *
*/ */

@ -0,0 +1,176 @@
package com.zbkj.modules.autogencode.controller;
import java.util.Arrays;
import java.util.Map;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.zbkj.common.request.PageParamRequest;
import com.zbkj.common.response.CommonResult;
import com.zbkj.common.page.CommonPage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.zbkj.modules.autogencode.entity.CkBillNumber;
import com.zbkj.modules.autogencode.service.CkBillNumberService;
/**
*
*/
@RestController
@RequestMapping("api/autogencode/ckbillnumber")
public class CkBillNumberController {
@Autowired
private CkBillNumberService ckBillNumberService;
/**
*
*
*/
private void condition(LambdaQueryWrapper<CkBillNumber> queryWrapper, CkBillNumber request) {
if (request == null) {
return;
}
// 根据实体类字段自动生成查询条件
// ID
if (request.getId() != null) {
queryWrapper.eq(CkBillNumber::getId, request.getId());
}
// 单据前缀
if (StrUtil.isNotBlank(request.getBillPrefix())) {
queryWrapper.eq(CkBillNumber::getBillPrefix, request.getBillPrefix());
}
// 单据日期
if (StrUtil.isNotBlank(request.getBillDate())) {
queryWrapper.eq(CkBillNumber::getBillDate, request.getBillDate());
}
// 单据流水号
if (request.getBillNumber() != null) {
queryWrapper.eq(CkBillNumber::getBillNumber, request.getBillNumber());
}
// 删除标志0代表存在 2代表删除
if (StrUtil.isNotBlank(request.getDelFlag())) {
queryWrapper.eq(CkBillNumber::getDelFlag, request.getDelFlag());
}
// 创建部门
if (request.getCreateDept() != null) {
queryWrapper.eq(CkBillNumber::getCreateDept, request.getCreateDept());
}
// 创建人
if (request.getCreateBy() != null) {
queryWrapper.eq(CkBillNumber::getCreateBy, request.getCreateBy());
}
// 创建时间
if (request.getCreateTime() != null) {
queryWrapper.eq(CkBillNumber::getCreateTime, request.getCreateTime());
}
// 修改人
if (request.getUpdateBy() != null) {
queryWrapper.eq(CkBillNumber::getUpdateBy, request.getUpdateBy());
}
// 修改时间
if (request.getUpdateTime() != null) {
queryWrapper.eq(CkBillNumber::getUpdateTime, request.getUpdateTime());
}
//
if (StrUtil.isNotBlank(request.getTenantId())) {
queryWrapper.eq(CkBillNumber::getTenantId, request.getTenantId());
}
}
/**
*
* @param request
* @param pageParamRequest
*/
@ApiOperation(value = "分页列表")
@RequestMapping(value = "/list", method = RequestMethod.GET)
public CommonResult<CommonPage<CkBillNumber>> getList(@Validated CkBillNumber request, @Validated PageParamRequest pageParamRequest) {
LambdaQueryWrapper<CkBillNumber> queryWrapper = new LambdaQueryWrapper();
// 应用搜索条件
condition(queryWrapper, request);
CommonPage<CkBillNumber> page = CommonPage.restPage(ckBillNumberService.pageList(queryWrapper, pageParamRequest));
return CommonResult.success(page);
}
@ApiOperation("获取单据编号")
@GetMapping("/getBillNo/{billPrefix}")
public CommonResult<String> getBillNo(@PathVariable("billPrefix") String billPrefix) {
String billNumber = ckBillNumberService.getBillNumber(billPrefix);
return CommonResult.success(billNumber, "获取成功");
}
/**
*
*/
@RequestMapping(value = "/info/{id}", method = RequestMethod.GET)
public CommonResult<CkBillNumber> info(@PathVariable("id") Long id){
CkBillNumber ckBillNumber = ckBillNumberService.getById(id);
return CommonResult.success(ckBillNumber);
}
/**
*
*/
@RequestMapping(value = "/save", method = RequestMethod.POST)
public CommonResult<String> save(@RequestBody CkBillNumber ckBillNumber){
if (ckBillNumberService.save(ckBillNumber)) {
return CommonResult.success();
}
return CommonResult.failed();
}
/**
*
*/
@RequestMapping(value = "/update", method = RequestMethod.POST)
public CommonResult<String> update(@RequestBody CkBillNumber ckBillNumber){
if (ckBillNumberService.updateById(ckBillNumber)) {
return CommonResult.success();
}
return CommonResult.failed();
}
/**
* :id
*/
@RequestMapping(value = "/delete", method = RequestMethod.POST)
public CommonResult<String> delete(@RequestBody Long[] ids){
if (ckBillNumberService.removeByIds(Arrays.asList(ids))) {
return CommonResult.success();
}
return CommonResult.failed();
}
}

@ -8,9 +8,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.zbkj.common.request.PageParamRequest; import com.zbkj.common.request.PageParamRequest;
import com.zbkj.common.response.CommonResult; import com.zbkj.common.response.CommonResult;
import com.zbkj.common.page.CommonPage; import com.zbkj.common.page.CommonPage;
import com.zbkj.modules.autogencode.entity.CmCustItem; import com.zbkj.modules.autogencode.entity.*;
import com.zbkj.modules.autogencode.entity.CmCustQualify;
import com.zbkj.modules.autogencode.entity.CmCustQualifyFile;
import com.zbkj.modules.autogencode.service.CmCustItemService; import com.zbkj.modules.autogencode.service.CmCustItemService;
import com.zbkj.modules.autogencode.service.CmCustQualifyService; import com.zbkj.modules.autogencode.service.CmCustQualifyService;
import com.zbkj.modules.autogencode.service.CmCustQualifyFileService; import com.zbkj.modules.autogencode.service.CmCustQualifyFileService;
@ -22,7 +20,6 @@ import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import com.zbkj.modules.autogencode.entity.CmCust;
import com.zbkj.modules.autogencode.service.CmCustService; import com.zbkj.modules.autogencode.service.CmCustService;
import com.zbkj.common.model.system.SystemAttachment; import com.zbkj.common.model.system.SystemAttachment;
@ -195,6 +192,20 @@ public class CmCustController {
} }
/**
*
* @param request
*/
@ApiOperation(value = "获取所有客户")
@RequestMapping(value = "/listByAll", method = RequestMethod.GET)
public CommonResult<List<CmCust>> listByAll(CmCust request) {
LambdaQueryWrapper<CmCust> queryWrapper = new LambdaQueryWrapper();
// 应用搜索条件
condition(queryWrapper, request);
List<CmCust> cmCustList = cmCustService.list(queryWrapper);
return CommonResult.success(cmCustList);
}
/** /**
* *
*/ */

@ -14,6 +14,7 @@ import com.zbkj.common.request.StoreProductAttrAddRequest;
import com.zbkj.common.request.StoreProductAttrValueAddRequest; import com.zbkj.common.request.StoreProductAttrValueAddRequest;
import com.zbkj.common.response.CommonResult; import com.zbkj.common.response.CommonResult;
import com.zbkj.common.page.CommonPage; import com.zbkj.common.page.CommonPage;
import com.zbkj.modules.autogencode.entity.CmCust;
import com.zbkj.service.dao.StoreProductDao; import com.zbkj.service.dao.StoreProductDao;
import com.zbkj.service.service.StoreProductService; import com.zbkj.service.service.StoreProductService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -254,6 +255,20 @@ public class CmCustProductController {
return CommonResult.success(page); return CommonResult.success(page);
} }
/**
*
* @param request
*/
@ApiOperation(value = "获取所有商品")
@RequestMapping(value = "/listByAll", method = RequestMethod.GET)
public CommonResult<List<CmCustProduct>> listByAll(CmCustProduct request) {
LambdaQueryWrapper<CmCustProduct> queryWrapper = new LambdaQueryWrapper();
// 应用搜索条件
condition(queryWrapper, request);
List<CmCustProduct> cmCustProductList = cmCustProductService.list(queryWrapper);
return CommonResult.success(cmCustProductList);
}
/** /**
* *
@ -387,4 +402,3 @@ public class CmCustProductController {
} }
} }

@ -1,7 +1,9 @@
package com.zbkj.modules.autogencode.controller; package com.zbkj.modules.autogencode.controller;
import java.util.Arrays; import java.util.Arrays;
import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Random;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@ -20,6 +22,8 @@ import org.springframework.security.access.prepost.PreAuthorize;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.zbkj.modules.autogencode.entity.CmMeetingRoom; import com.zbkj.modules.autogencode.entity.CmMeetingRoom;
import com.zbkj.modules.autogencode.service.CmMeetingRoomService; import com.zbkj.modules.autogencode.service.CmMeetingRoomService;
import com.zbkj.common.model.system.SystemAttachment;
import com.zbkj.service.service.SystemAttachmentService;
@ -33,6 +37,9 @@ public class CmMeetingRoomController {
@Autowired @Autowired
private CmMeetingRoomService cmMeetingRoomService; private CmMeetingRoomService cmMeetingRoomService;
@Autowired
private SystemAttachmentService systemAttachmentService;
/** /**
@ -53,7 +60,7 @@ public class CmMeetingRoomController {
// 会议室名称 // 会议室名称
if (StrUtil.isNotBlank(request.getRoomName())) { if (StrUtil.isNotBlank(request.getRoomName())) {
queryWrapper.eq(CmMeetingRoom::getRoomName, request.getRoomName()); queryWrapper.like(CmMeetingRoom::getRoomName, request.getRoomName());
} }
// 会议室位置 // 会议室位置
@ -184,14 +191,33 @@ public class CmMeetingRoomController {
public CommonResult<CmMeetingRoom> info(@PathVariable("id") Long id){ public CommonResult<CmMeetingRoom> info(@PathVariable("id") Long id){
CmMeetingRoom cmMeetingRoom = cmMeetingRoomService.getById(id); CmMeetingRoom cmMeetingRoom = cmMeetingRoomService.getById(id);
// 设置文件信息
if (cmMeetingRoom != null) {
setFile(cmMeetingRoom);
}
return CommonResult.success(cmMeetingRoom); return CommonResult.success(cmMeetingRoom);
} }
private void setFile(CmMeetingRoom cmMeetingRoom) {
Long fileId = cmMeetingRoom.getFileId();
if (fileId != null) {
List<SystemAttachment> list = systemAttachmentService.list(new LambdaQueryWrapper<SystemAttachment>()
.eq(SystemAttachment::getFileId, String.valueOf(fileId)));
cmMeetingRoom.setFiles(list);
}
}
/** /**
* *
*/ */
@RequestMapping(value = "/save", method = RequestMethod.POST) @RequestMapping(value = "/save", method = RequestMethod.POST)
public CommonResult<String> save(@RequestBody CmMeetingRoom cmMeetingRoom){ public CommonResult<String> save(@RequestBody CmMeetingRoom cmMeetingRoom){
// 处理文件保存
if (cmMeetingRoom.getFiles() != null) {
updateFile(cmMeetingRoom);
}
if (cmMeetingRoomService.save(cmMeetingRoom)) { if (cmMeetingRoomService.save(cmMeetingRoom)) {
return CommonResult.success(); return CommonResult.success();
} }
@ -203,12 +229,29 @@ public class CmMeetingRoomController {
*/ */
@RequestMapping(value = "/update", method = RequestMethod.POST) @RequestMapping(value = "/update", method = RequestMethod.POST)
public CommonResult<String> update(@RequestBody CmMeetingRoom cmMeetingRoom){ public CommonResult<String> update(@RequestBody CmMeetingRoom cmMeetingRoom){
// 处理文件更新
if (cmMeetingRoom.getFiles() != null) {
updateFile(cmMeetingRoom);
}
if (cmMeetingRoomService.updateById(cmMeetingRoom)) { if (cmMeetingRoomService.updateById(cmMeetingRoom)) {
return CommonResult.success(); return CommonResult.success();
} }
return CommonResult.failed(); return CommonResult.failed();
} }
private void updateFile(CmMeetingRoom cmMeetingRoom) {
Long newId = System.currentTimeMillis() + new Random().nextInt(1000);
List<SystemAttachment> files = cmMeetingRoom.getFiles();
if (files != null) {
for (SystemAttachment attachment : files) {
attachment.setFileId(String.valueOf(newId));
}
systemAttachmentService.updateBatchById(files);
cmMeetingRoom.setFileId(newId);
}
}
/** /**
* :id * :id
*/ */

@ -1,6 +1,7 @@
package com.zbkj.modules.autogencode.controller; package com.zbkj.modules.autogencode.controller;
import java.util.Arrays; import java.util.Arrays;
import java.util.List;
import java.util.Map; import java.util.Map;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
@ -8,6 +9,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.zbkj.common.request.PageParamRequest; import com.zbkj.common.request.PageParamRequest;
import com.zbkj.common.response.CommonResult; import com.zbkj.common.response.CommonResult;
import com.zbkj.common.page.CommonPage; import com.zbkj.common.page.CommonPage;
import com.zbkj.modules.autogencode.entity.CmWarehouse;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -131,6 +133,20 @@ public class CmShelfController {
return CommonResult.success(page); return CommonResult.success(page);
} }
/**
*
* @param request
*/
@ApiOperation(value = "获取所有货架")
@RequestMapping(value = "/listByAll", method = RequestMethod.GET)
public CommonResult<List<CmShelf>> listByAll(CmShelf request) {
LambdaQueryWrapper<CmShelf> queryWrapper = new LambdaQueryWrapper();
// 应用搜索条件
condition(queryWrapper, request);
List<CmShelf> cmShelfList = cmShelfService.list(queryWrapper);
return CommonResult.success(cmShelfList);
}
/** /**
* *

@ -1,6 +1,7 @@
package com.zbkj.modules.autogencode.controller; package com.zbkj.modules.autogencode.controller;
import java.util.Arrays; import java.util.Arrays;
import java.util.List;
import java.util.Map; import java.util.Map;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
@ -8,6 +9,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.zbkj.common.request.PageParamRequest; import com.zbkj.common.request.PageParamRequest;
import com.zbkj.common.response.CommonResult; import com.zbkj.common.response.CommonResult;
import com.zbkj.common.page.CommonPage; import com.zbkj.common.page.CommonPage;
import com.zbkj.modules.autogencode.entity.CmShelf;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -126,6 +128,21 @@ public class CmStorageLocationController {
return CommonResult.success(page); return CommonResult.success(page);
} }
/**
*
* @param request
*/
@ApiOperation(value = "获取所有货位")
@RequestMapping(value = "/listByAll", method = RequestMethod.GET)
public CommonResult<List<CmStorageLocation>> listByAll(CmStorageLocation request) {
LambdaQueryWrapper<CmStorageLocation> queryWrapper = new LambdaQueryWrapper();
// 应用搜索条件
condition(queryWrapper, request);
List<CmStorageLocation> cmStorageLocationList = cmStorageLocationService.list(queryWrapper);
return CommonResult.success(cmStorageLocationList);
}
/** /**
* *

@ -0,0 +1,13 @@
package com.zbkj.modules.autogencode.dao;
import com.zbkj.modules.autogencode.entity.CkBillNumber;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
* DAO
*/
@Mapper
public interface CkBillNumberDao extends BaseMapper<CkBillNumber> {
}

@ -277,6 +277,21 @@ public class CkBillCargo implements Serializable {
@ApiModelProperty(value = "入库库场代码") @ApiModelProperty(value = "入库库场代码")
@TableField(exist = false) @TableField(exist = false)
private String stockCode; private String stockCode;
/**
* ID
*/
@ApiModelProperty(value = "货架ID")
@TableField(exist = false)
private Long shelfId;
/**
* ID
*/
@ApiModelProperty(value = "货位ID")
@TableField(exist = false)
private Long locationId;
/** 库场name */ /** 库场name */
@TableField(exist = false) @TableField(exist = false)
@ -292,6 +307,16 @@ public class CkBillCargo implements Serializable {
@ApiModelProperty(value = "库场name") @ApiModelProperty(value = "库场name")
@TableField(exist = false) @TableField(exist = false)
private String stockName; private String stockName;
/** 货架名称 */
@ApiModelProperty(value = "货架名称")
@TableField(exist = false)
private String shelfName;
/** 货位名称 */
@ApiModelProperty(value = "货位名称")
@TableField(exist = false)
private String locationName;
/** 出库库场ID */ /** 出库库场ID */
@ApiModelProperty(value = "出库库场ID") @ApiModelProperty(value = "出库库场ID")
@TableField(exist = false) @TableField(exist = false)

@ -0,0 +1,74 @@
package com.zbkj.modules.autogencode.entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
@Data
@TableName("ck_bill_number")
public class CkBillNumber implements Serializable {
private static final long serialVersionUID = 1L;
/**
* ID
*/
@ApiModelProperty(value = "ID")
@TableId
private Long id;
/**
*
*/
@ApiModelProperty(value = "单据前缀")
private String billPrefix;
/**
*
*/
@ApiModelProperty(value = "单据日期")
private String billDate;
/**
*
*/
@ApiModelProperty(value = "单据流水号")
private Long billNumber;
/**
* 0 2
*/
@ApiModelProperty(value = "删除标志0代表存在 2代表删除")
private String delFlag;
/**
*
*/
@ApiModelProperty(value = "创建部门")
private Long createDept;
/**
*
*/
@ApiModelProperty(value = "创建人")
private Long createBy;
/**
*
*/
@ApiModelProperty(value = "创建时间")
private Date createTime;
/**
*
*/
@ApiModelProperty(value = "修改人")
private Long updateBy;
/**
*
*/
@ApiModelProperty(value = "修改时间")
private Date updateTime;
/**
*
*/
@ApiModelProperty(value = "")
private String tenantId;
}

@ -1,11 +1,14 @@
package com.zbkj.modules.autogencode.entity; package com.zbkj.modules.autogencode.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.zbkj.common.model.system.SystemAttachment;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
import java.util.List;
import lombok.Data; import lombok.Data;
@ -125,5 +128,11 @@ public class CmMeetingRoom implements Serializable {
*/ */
@ApiModelProperty(value = "租户ID") @ApiModelProperty(value = "租户ID")
private String tenantId; private String tenantId;
/**
*
*/
@ApiModelProperty(value = "文件列表")
@TableField(exist = false)
private List<SystemAttachment> files;
} }

@ -0,0 +1,27 @@
package com.zbkj.modules.autogencode.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zbkj.modules.autogencode.entity.CkBillNumber;
import com.zbkj.common.request.PageParamRequest;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import java.util.List;
import java.util.Map;
/**
*
* +----------------------------------------------------------------------
*/
public interface CkBillNumberService extends IService<CkBillNumber> {
/**
* CkBillNumber
* @param pageParamRequest
* @return
*/
List<CkBillNumber> pageList(LambdaQueryWrapper<CkBillNumber> queryWrapper, PageParamRequest pageParamRequest);
String getBillNumber(String billPrefix);
}

@ -36,5 +36,6 @@ public interface CkBillService extends IService<CkBill> {
* @return * @return
*/ */
public CommonResult<String> putCargo(CkBill ckBill); public CommonResult<String> putCargo(CkBill ckBill);
} }

@ -0,0 +1,70 @@
package com.zbkj.modules.autogencode.service.impl;
import com.github.pagehelper.PageHelper;
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.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zbkj.common.utils.DateUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import com.zbkj.modules.autogencode.dao.CkBillNumberDao;
import com.zbkj.modules.autogencode.entity.CkBillNumber;
import com.zbkj.modules.autogencode.service.CkBillNumberService;
import com.zbkj.common.page.CommonPage;
import com.zbkj.common.request.PageParamRequest;
import javax.annotation.Resource;
import java.util.Map;
import java.util.Arrays;
import java.util.List;
@Service("ckBillNumberService")
public class CkBillNumberServiceImpl extends ServiceImpl<CkBillNumberDao, CkBillNumber> implements CkBillNumberService {
@Resource
private CkBillNumberDao dao;
@Resource
private CkBillNumberService ckBillNumberService;
/**
*
*/
@Override
public List<CkBillNumber> pageList(LambdaQueryWrapper<CkBillNumber> queryWrapper, PageParamRequest pageParamRequest) {
PageHelper.startPage(pageParamRequest.getPage(), pageParamRequest.getLimit());
return dao.selectList(queryWrapper);
}
@Override
public String getBillNumber(String billPrefix) {
String billNo = "";
if (StringUtils.isBlank(billPrefix)) {
billPrefix = "DD";
}
LambdaQueryWrapper<CkBillNumber> query = new LambdaQueryWrapper<>();
query.eq(CkBillNumber::getBillPrefix, billPrefix);
String billDate = DateUtils.dateTimeNow("yyyyMMdd");
query.eq(CkBillNumber::getBillDate, billDate);
List<CkBillNumber> lsBill = ckBillNumberService.list(query);
CkBillNumber billNumber = new CkBillNumber();
if (lsBill != null && lsBill.size() > 0) {
billNumber = lsBill.get(0);
billNumber.setBillNumber(billNumber.getBillNumber() + 1);
} else {
billNumber.setBillDate(billDate);
billNumber.setBillPrefix(billPrefix);
billNumber.setBillNumber(1L);
}
ckBillNumberService.saveOrUpdate(billNumber);
billNo = billPrefix + billDate + String.format("%04d", billNumber.getBillNumber());
return billNo;
}
}

@ -9,6 +9,8 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zbkj.common.response.CommonResult; import com.zbkj.common.response.CommonResult;
import com.zbkj.modules.autogencode.entity.*; import com.zbkj.modules.autogencode.entity.*;
import com.zbkj.modules.autogencode.service.*; import com.zbkj.modules.autogencode.service.*;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -50,6 +52,15 @@ public class CkBillServiceImpl extends ServiceImpl<CkBillDao, CkBill> implements
@Resource @Resource
private CmCustService cmCustService; private CmCustService cmCustService;
@Resource
private CmWarehouseService cmWarehouseService;
@Resource
private CmShelfService cmShelfService;
@Resource
private CmStorageLocationService cmStorageLocationService;
/** /**
* *
*/ */
@ -179,10 +190,10 @@ public class CkBillServiceImpl extends ServiceImpl<CkBillDao, CkBill> implements
CkCargoStock inCargoStock = new CkCargoStock(); CkCargoStock inCargoStock = new CkCargoStock();
BeanUtils.copyProperties(ckBillCargo,inCargoStock,"id"); BeanUtils.copyProperties(ckBillCargo,inCargoStock,"id");
inCargoStock.setStockDate(ckBillCargo.getBillDate()); inCargoStock.setStockDate(ckBillCargo.getBillDate());
CmStock cmStock = cmStockService.getById(ckBillStock.getStockId()); CmWarehouse cmWarehouse = cmWarehouseService.getById(ckBillStock.getStockId());
inCargoStock.setStockId(cmStock.getId()); inCargoStock.setStockId(cmWarehouse.getId());
inCargoStock.setStockCode(cmStock.getStockCode()); inCargoStock.setStockCode(cmWarehouse.getStockCode());
inCargoStock.setStockName(cmStock.getStockName()); inCargoStock.setStockName(cmWarehouse.getStockName());
inCargoStock.setCargoNum(ckBillStock.getCargoNum()); inCargoStock.setCargoNum(ckBillStock.getCargoNum());
inCargoStock.setCargoWt(ckBillStock.getCargoWt()); inCargoStock.setCargoWt(ckBillStock.getCargoWt());
inCargoStock.setCargoVol(ckBillStock.getCargoVol()); inCargoStock.setCargoVol(ckBillStock.getCargoVol());
@ -268,7 +279,14 @@ public class CkBillServiceImpl extends ServiceImpl<CkBillDao, CkBill> implements
ckBillCargo.setVesselId(ckBill.getVesselId()); ckBillCargo.setVesselId(ckBill.getVesselId());
ckBillCargo.setVesselName(ckBill.getVesselName()); ckBillCargo.setVesselName(ckBill.getVesselName());
ckBillCargo.setVoyageNo(ckBill.getVoyageNo()); ckBillCargo.setVoyageNo(ckBill.getVoyageNo());
CmStock cmStock = cmStockService.getById(ckBillCargo.getInStockId());
CmWarehouse cmWarehouse = cmWarehouseService.getById(ckBillCargo.getInStockId());
CmShelf cmShelf = cmShelfService.getById(ckBillCargo.getShelfId());
CmStorageLocation cmStorageLocation = cmStorageLocationService.getById(ckBillCargo.getLocationId());
CkBillStock ckBillStock; CkBillStock ckBillStock;
if(ckBillCargo.getId()!=null){ if(ckBillCargo.getId()!=null){
ckBillStock = ckBillStockService.getOne(new LambdaQueryWrapper<CkBillStock>().eq(CkBillStock::getBillCargoId,ckBillCargo.getId())); ckBillStock = ckBillStockService.getOne(new LambdaQueryWrapper<CkBillStock>().eq(CkBillStock::getBillCargoId,ckBillCargo.getId()));
@ -277,9 +295,21 @@ public class CkBillServiceImpl extends ServiceImpl<CkBillDao, CkBill> implements
} }
ckBillCargoService.saveOrUpdate(ckBillCargo); ckBillCargoService.saveOrUpdate(ckBillCargo);
ckBillStock.setInoutType("1"); ckBillStock.setInoutType("1");
ckBillStock.setStockId(cmStock.getId()); ckBillStock.setStockId(cmWarehouse.getId());
ckBillStock.setStockName(cmStock.getStockName()); ckBillStock.setStockName(cmWarehouse.getStockName());
ckBillStock.setStockCode(cmStock.getStockCode()); ckBillStock.setStockCode(cmWarehouse.getStockCode());
// 设置货架信息
if(cmShelf != null){
ckBillStock.setShelfId(cmShelf.getId());
ckBillStock.setShelfName(cmShelf.getShelfName());
}
// 设置货位信息
if(cmStorageLocation != null){
ckBillStock.setLocationId(cmStorageLocation.getId());
ckBillStock.setLocationName(cmStorageLocation.getStorageLocationName());
}
ckBillStock.setBillNumber(ckBillCargo.getBillNumber()); ckBillStock.setBillNumber(ckBillCargo.getBillNumber());
ckBillStock.setCargoNum(ckBillCargo.getCargoNum()); ckBillStock.setCargoNum(ckBillCargo.getCargoNum());
ckBillStock.setCargoWt(ckBillCargo.getCargoWt()); ckBillStock.setCargoWt(ckBillCargo.getCargoWt());
@ -323,9 +353,9 @@ public class CkBillServiceImpl extends ServiceImpl<CkBillDao, CkBill> implements
CkStockChange ckStockChange = new CkStockChange(); CkStockChange ckStockChange = new CkStockChange();
BeanUtils.copyProperties(ckBillCargo,ckStockChange,"id"); BeanUtils.copyProperties(ckBillCargo,ckStockChange,"id");
ckStockChange.setChangeType(ckBillCargo.getInoutType()); ckStockChange.setChangeType(ckBillCargo.getInoutType());
CmStock cmStock = cmStockService.getById(ckBillStock.getStockId()); CmWarehouse cmWarehouse = cmWarehouseService.getById(ckBillStock.getStockId());
ckStockChange.setStockId(cmStock.getId()); ckStockChange.setStockId(cmWarehouse.getId());
ckStockChange.setStockName(cmStock.getStockName()); ckStockChange.setStockName(cmWarehouse.getStockName());
ckStockChange.setBeforeNum(countStock.getCargoNum()); ckStockChange.setBeforeNum(countStock.getCargoNum());
ckStockChange.setBeforeWt(countStock.getCargoWt()); ckStockChange.setBeforeWt(countStock.getCargoWt());
ckStockChange.setBeforeVol(countStock.getCargoVol()); ckStockChange.setBeforeVol(countStock.getCargoVol());

@ -0,0 +1,22 @@
<?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.zbkj.modules.autogencode.dao.CkBillNumberDao">
<!-- 根据包名 模块名 以及类名 生成Mapper XML 配置文件 -->
<resultMap type="com.zbkj.modules.autogencode.entity.CkBillNumber" id="ckBillNumberMap">
<result property="id" column="id"/>
<result property="billPrefix" column="bill_prefix"/>
<result property="billDate" column="bill_date"/>
<result property="billNumber" column="bill_number"/>
<result property="delFlag" column="del_flag"/>
<result property="createDept" column="create_dept"/>
<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="tenantId" column="tenant_id"/>
</resultMap>
</mapper>

@ -0,0 +1,204 @@
package com.zbkj.common.utils;
import org.apache.commons.lang3.time.DateFormatUtils;
import java.lang.management.ManagementFactory;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.*;
import java.util.Date;
/**
*
*
* @author bs
*/
public class DateUtils extends org.apache.commons.lang3.time.DateUtils
{
public static String YYYY = "yyyy";
public static String YYYY_MM = "yyyy-MM";
public static String YYYY_MM_DD = "yyyy-MM-dd";
public static String YYYYMMDDHHMMSS = "yyyyMMddHHmmss";
public static String YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss";
private static String[] parsePatterns = {
"yyyy-MM-dd", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm", "yyyy-MM",
"yyyy/MM/dd", "yyyy/MM/dd HH:mm:ss", "yyyy/MM/dd HH:mm", "yyyy/MM",
"yyyy.MM.dd", "yyyy.MM.dd HH:mm:ss", "yyyy.MM.dd HH:mm", "yyyy.MM"};
/**
* Date
*
* @return Date()
*/
public static Date getNowDate()
{
return new Date();
}
/**
* , yyyy-MM-dd
*
* @return String
*/
public static String getDate()
{
return dateTimeNow(YYYY_MM_DD);
}
public static final String getTime()
{
return dateTimeNow(YYYY_MM_DD_HH_MM_SS);
}
public static final String dateTimeNow()
{
return dateTimeNow(YYYYMMDDHHMMSS);
}
public static final String dateTimeNow(final String format)
{
return parseDateToStr(format, new Date());
}
public static final String dateTime(final Date date)
{
return parseDateToStr(YYYY_MM_DD, date);
}
public static final String parseDateToStr(final String format, final Date date)
{
return new SimpleDateFormat(format).format(date);
}
public static final Date dateTime(final String format, final String ts)
{
try
{
return new SimpleDateFormat(format).parse(ts);
}
catch (ParseException e)
{
throw new RuntimeException(e);
}
}
/**
* // 2018/08/08
*/
public static final String datePath()
{
Date now = new Date();
return DateFormatUtils.format(now, "yyyy/MM/dd");
}
/**
* // 20180808
*/
public static final String dateTime()
{
Date now = new Date();
return DateFormatUtils.format(now, "yyyyMMdd");
}
/**
*
*/
public static Date parseDate(Object str)
{
if (str == null)
{
return null;
}
try
{
return parseDate(str.toString(), parsePatterns);
}
catch (ParseException e)
{
return null;
}
}
/**
*
*/
public static Date getServerStartDate()
{
long time = ManagementFactory.getRuntimeMXBean().getStartTime();
return new Date(time);
}
/**
*
*/
public static int differentDaysByMillisecond(Date date1, Date date2)
{
return Math.abs((int) ((date2.getTime() - date1.getTime()) / (1000 * 3600 * 24)));
}
/**
*
*
* @param endDate
* @param startTime
* @return //
*/
public static String timeDistance(Date endDate, Date startTime)
{
long nd = 1000 * 24 * 60 * 60;
long nh = 1000 * 60 * 60;
long nm = 1000 * 60;
// long ns = 1000;
// 获得两个时间的毫秒时间差异
long diff = endDate.getTime() - startTime.getTime();
// 计算差多少天
long day = diff / nd;
// 计算差多少小时
long hour = diff % nd / nh;
// 计算差多少分钟
long min = diff % nd % nh / nm;
// 计算差多少秒//输出结果
// long sec = diff % nd % nh % nm / ns;
return day + "天" + hour + "小时" + min + "分钟";
}
public static String getTimeDesc(long time) {
//long nd = 1000 * 24 * 60 * 60;
long nh = 1000 * 60 * 60;
long nm = 1000 * 60;
long ns = 1000;
//long day = time / nd;
// 计算差多少小时
long hour = time / nh;
// 计算差多少分钟
long min = time % nh / nm;
// 计算差多少秒//输出结果
long sec = time % nh % nm / ns;
return hour + ":" + min + ":" + sec;
}
/**
* LocalDateTime ==> Date
*/
public static Date toDate(LocalDateTime temporalAccessor)
{
ZonedDateTime zdt = temporalAccessor.atZone(ZoneId.systemDefault());
return Date.from(zdt.toInstant());
}
/**
* LocalDate ==> Date
*/
public static Date toDate(LocalDate temporalAccessor)
{
LocalDateTime localDateTime = LocalDateTime.of(temporalAccessor, LocalTime.of(0, 0, 0));
ZonedDateTime zdt = localDateTime.atZone(ZoneId.systemDefault());
return Date.from(zdt.toInstant());
}
}
Loading…
Cancel
Save