no message

main
WINDOWS-DN6K5JD\EDY 2024-03-29 15:33:25 +08:00
parent 5fa6b58a69
commit c62071abd0
9 changed files with 5925 additions and 7839 deletions

13057
wms-vue/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -26,6 +26,7 @@
"@vue/cli-service": "~5.0.0", "@vue/cli-service": "~5.0.0",
"eslint": "^7.32.0", "eslint": "^7.32.0",
"eslint-plugin-vue": "^8.0.3", "eslint-plugin-vue": "^8.0.3",
"less": "^4.2.0",
"vue-template-compiler": "^2.6.14" "vue-template-compiler": "^2.6.14"
}, },
"eslintConfig": { "eslintConfig": {

View File

@ -2,40 +2,144 @@
<div class="div1"> <div class="div1">
<div class="div2" style="padding-bottom: 10px"> <div class="div2" style="padding-bottom: 10px">
<div style="float: right">
<el-select v-model="xb" clearable filterable placeholder="请选择性别" style="width: 100px">
<el-option
v-for="item in xbs"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
<el-input v-model="name" <el-form ref="form" :model="param" label-width="80px">
placeholder="请输入姓名"
style="width: 200px;margin-left: 5px"
class="input-with-select" <el-row :gutter="24">
@keyup.enter.native="queryUser"> <el-col :span="4">
<el-form-item label="采购单号:">
<el-button class="el-input-group__prepend" slot="append" icon="el-icon-search" @click="queryUser"></el-button> <el-input type="textarea" v-model="param.sourceId" :rows="1"></el-input>
</el-input> </el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="收货凭证:" >
<el-input type="textarea" v-model="param.strBill7" :rows="1"></el-input>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="料号:">
<el-input type="textarea" v-model="param.code" :rows="1"></el-input>
</el-form-item>
</el-col>
<el-button type="success" icon="el-icon-refresh-left" style="margin-left: 5px;" @click="rest"></el-button> <el-col :span="4">
</div> <el-form-item label="工厂:">
<el-select v-model="param.PROP_C9" multiple filterable placeholder="请选择工厂" style="width: 100%;">
<el-option
v-for="item in PROP_C9S"
:key="item.label"
:label="item.value"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="LOC:">
<el-select v-model="param.PROP_C2" multiple placeholder="请选择LOC" style="width: 100%;">
<el-option
v-for="item in PROP_C2S"
:key="item.label"
:label="item.value"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="批次号:">
<el-input type="textarea" v-model="param.PROP_C2" :rows="1"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="24">
<el-col :span="8">
<el-form-item label="收货日期:">
<el-date-picker style="width: 325px"
v-model="ORDER_DATE"
type="daterange"
align="right"
unlink-panels
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
:picker-options="pickerOptions">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="整理日期:">
<el-date-picker style="width: 325px"
v-model="RECEIVE_DATE"
type="daterange"
align="right"
unlink-panels
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
:picker-options="pickerOptions">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="特殊标记:">
<el-input type="text" v-model="param.PROP_C3"></el-input>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="SAP接口:">
<el-input type="text" v-model="param.CODE"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="24">
<el-col :span="4">
<el-form-item label="加急标记">
<el-input type="text" v-model="param.strBill11"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-checkbox v-model="checked" @change="Allquesr"></el-checkbox>
</el-col>
</el-row>
<el-button type="success" @click="find"></el-button>
<el-button type="success" @click="rest"></el-button>
</el-form>
<!-- <el-input v-model="param.sourceId"-->
<!-- placeholder="请输入姓名"-->
<!-- style="width: 200px;margin-left: 5px"-->
<!-- class="input-with-select"-->
<!-- @keyup.enter.native="queryUser">-->
<!-- <el-button class="el-input-group__prepend" slot="append" icon="el-icon-search" @click="queryUser"></el-button>-->
<!-- </el-input>-->
<!-- <el-button type="success" icon="el-icon-refresh-left" style="margin-left: 5px;" @click="rest"></el-button>-->
<div class="div3" style="">
<el-button type="primary" icon="el-icon-plus" @click="add"></el-button> <!-- <div class="div3" style="">-->
<el-button type="success" icon="el-icon-edit" @click="mod"></el-button> <!-- <el-button type="primary" icon="el-icon-plus" @click="add"></el-button>-->
<el-button type="danger" icon="el-icon-delete" @click="del"></el-button> <!-- <el-button type="success" icon="el-icon-edit" @click="mod"></el-button>-->
<el-button type="warning" icon="el-icon-download" @click="exportExcel"></el-button> <!-- <el-button type="danger" icon="el-icon-delete" @click="del"></el-button>-->
</div> <!-- <el-button type="warning" icon="el-icon-download" @click="exportExcel"></el-button>-->
<!-- </div>-->
</div> </div>
<el-dialog :title="title" <el-dialog :title="title"
:visible.sync="centerDialogVisible" :visible.sync="centerDialogVisible"
width="30%" width="30%"
@ -46,25 +150,29 @@
:rules="rules" :rules="rules"
label-width="80px"> label-width="80px">
<el-form-item label="账号" prop="userNo"> <el-form-item label="id" prop="id">
<el-input v-model="form.userNo" style="width: 300px;"></el-input> <el-input v-model="form.id" style="width: 300px;"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="姓名" prop="userName"> <el-form-item label="sourceId" prop="sourceId">
<el-input v-model="form.userName" style="width: 300px;"></el-input> <el-input v-model="form.sourceId" style="width: 300px;"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="年龄" prop="age"> <el-form-item label="strBill7" prop="strBill7">
<el-input v-model.number="form.age" style="width: 300px;" autocomplete="off"></el-input> <el-input v-model.number="form.strBill7" style="width: 300px;" autocomplete="off"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="性别"> <el-form-item label="strBill8" prop="age">
<el-radio-group v-model="form.sex"> <el-input v-model.number="form.strBill8" style="width: 300px;" autocomplete="off"></el-input>
<el-radio label='1'></el-radio>
<el-radio label='0'></el-radio>
</el-radio-group>
</el-form-item> </el-form-item>
<!-- <el-form-item label="性别">-->
<!-- <el-radio-group v-model="form.sex">-->
<!-- <el-radio label='1'></el-radio>-->
<!-- <el-radio label='0'></el-radio>-->
<!-- </el-radio-group>-->
<!-- </el-form-item>-->
<el-form-item label="电话" prop="phone"> <el-form-item label="电话" prop="phone">
<el-input v-model="form.phone" style="width: 300px;"></el-input> <el-input v-model="form.phone" style="width: 300px;"></el-input>
</el-form-item> </el-form-item>
@ -99,94 +207,261 @@
<span style="margin-left: 10px">{{ scope.row.id }}</span> <span style="margin-left: 10px">{{ scope.row.id }}</span>
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column-->
<!-- fixed-->
<!-- label="账号"-->
<!-- width="180">-->
<!-- <template slot-scope="scope">-->
<!-- <el-popover trigger="hover" placement="top">-->
<!-- <p>账号: {{ scope.row.userNo }}</p>-->
<!-- <p>电话: {{ scope.row.phone }}</p>-->
<!-- <div slot="reference" class="name-wrapper">-->
<!-- <el-tag size="medium">{{ scope.row.userNo }}</el-tag>-->
<!-- </div>-->
<!-- </el-popover>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column <el-table-column
fixed label="ID"
label="账号"
width="180">
<template slot-scope="scope">
<el-popover trigger="hover" placement="top">
<p>账号: {{ scope.row.userNo }}</p>
<p>电话: {{ scope.row.phone }}</p>
<div slot="reference" class="name-wrapper">
<el-tag size="medium">{{ scope.row.userNo }}</el-tag>
</div>
</el-popover>
</template>
</el-table-column>
<el-table-column
label="姓名"
width="180"> width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<div slot="reference" class="name-wrapper"> <div slot="reference" class="name-wrapper">
<span>{{ scope.row.userName }}</span> <span>{{ scope.row.id}}</span>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="年龄" label="采购单号"
width="180"> width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<div slot="reference" class="name-wrapper"> <div slot="reference" class="name-wrapper">
<span>{{ scope.row.age }}</span> <span>{{ scope.row.sourceId }}</span>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="电话" label="凭证号"
width="180"> width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<div slot="reference" class="name-wrapper"> <div slot="reference" class="name-wrapper">
<span>{{ scope.row.phone }}</span> <span>{{ scope.row.strBill7 }}</span>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="性别" label="行号"
width="180"> width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<div slot="reference" class="name-wrapper"> <div slot="reference" class="name-wrapper">
<el-tag size="medium" :type="scope.row.sex ===0 ? 'primary' : 'success'"> <span>{{ scope.row.strBill8 }}</span>
{{ scope.row.sex === 0 ? '女' : '男' }}
</el-tag>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="角色" label="料号"
width="180"> width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<div slot="reference" class="name-wrapper"> <div slot="reference" class="name-wrapper">
<el-tag size="medium" <span>{{ scope.row.CODE }}</span>
:type="scope.row.roleId ===0 ? 'danger' : (scope.row.roleId ===1 ? 'primary':'success') "> </div>
{{ scope.row.roleId === 0 ? '超级管理员' : (scope.row.roleId === 1 ? '管理员' : '用户') }} </template>
</el-tag> </el-table-column>
<el-table-column
label="描述"
width="180">
<template slot-scope="scope">
<div slot="reference" class="name-wrapper">
<span>{{ scope.row.NAME }}</span>
</div>
</template>
</el-table-column>
<el-table-column
label="单位"
width="180">
<template slot-scope="scope">
<div slot="reference" class="name-wrapper">
<span>{{ scope.row.UNIT }}</span>
</div>
</template>
</el-table-column>
<el-table-column
label="收货日期"
width="180">
<template slot-scope="scope">
<div slot="reference" class="name-wrapper">
<span>{{ scope.row.ORDER_DATE }}</span>
</div>
</template>
</el-table-column>
<el-table-column
label="整理日期"
width="180">
<template slot-scope="scope">
<div slot="reference" class="name-wrapper">
<span>{{ scope.row.RECEIVE_DATE }}</span>
</div>
</template>
</el-table-column>
<el-table-column
label="OPERATOR"
width="180">
<template slot-scope="scope">
<div slot="reference" class="name-wrapper">
<span>{{ scope.row.OPERATOR }}</span>
</div>
</template>
</el-table-column>
<el-table-column
label="z_name"
width="180">
<template slot-scope="scope">
<div slot="reference" class="name-wrapper">
<span>{{ scope.row.z_name }}</span>
</div>
</template>
</el-table-column>
<el-table-column
label="LP"
width="180">
<template slot-scope="scope">
<div slot="reference" class="name-wrapper">
<span>{{ scope.row.LP }}</span>
</div>
</template>
</el-table-column>
<el-table-column
label="批次"
width="180">
<template slot-scope="scope">
<div slot="reference" class="name-wrapper">
<span>{{ scope.row.PROP_C1 }}</span>
</div>
</template>
</el-table-column>
<el-table-column
label="LOC"
width="180">
<template slot-scope="scope">
<div slot="reference" class="name-wrapper">
<span>{{ scope.row.PROP_C2 }}</span>
</div>
</template>
</el-table-column>
<el-table-column
label="特殊标记"
width="180">
<template slot-scope="scope">
<div slot="reference" class="name-wrapper">
<span>{{ scope.row.PROP_C3 }}</span>
</div>
</template>
</el-table-column>
<el-table-column
label="供应商编号"
width="180">
<template slot-scope="scope">
<div slot="reference" class="name-wrapper">
<span>{{ scope.row.PROP_C5 }}</span>
</div>
</template>
</el-table-column>
<el-table-column
label="区域"
width="180">
<template slot-scope="scope">
<div slot="reference" class="name-wrapper">
<span>{{ scope.row.PROP_C8 }}</span>
</div>
</template>
</el-table-column>
<el-table-column
label="工厂"
width="180">
<template slot-scope="scope">
<div slot="reference" class="name-wrapper">
<span>{{ scope.row.PROP_C9 }}</span>
</div>
</template>
</el-table-column>
<el-table-column
label="BAR_CODE"
width="180">
<template slot-scope="scope">
<div slot="reference" class="name-wrapper">
<span>{{ scope.row.BAR_CODE }}</span>
</div>
</template>
</el-table-column>
<el-table-column
label="BE_MOVED"
width="180">
<template slot-scope="scope">
<div slot="reference" class="name-wrapper">
<span>{{ scope.row.BE_MOVED }}</span>
</div>
</template>
</el-table-column>
<el-table-column
label="备注"
width="180">
<template slot-scope="scope">
<div slot="reference" class="name-wrapper">
<span>{{ scope.row.description }}</span>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column
fixed="right"
label="操作"
width="100">
<template slot-scope="scope">
<!-- <el-button
size="small"
@click="handleEdit(scope.$index, scope.row)">编辑
</el-button>
<el-button
size="small"
type="danger"
@click="handleDelete(scope.$index, scope.row)">删除
</el-button>-->
<el-button @click="handleClick(scope.row)" type="text" size="small">查看</el-button>
<el-button type="text" size="small" @click="editUser(scope.row)"></el-button>
</template>
</el-table-column>
<!-- <el-table-column-->
<!-- label="性别"-->
<!-- width="180">-->
<!-- <template slot-scope="scope">-->
<!-- <div slot="reference" class="name-wrapper">-->
<!-- <el-tag size="medium" :type="scope.row.sex ===0 ? 'primary' : 'success'">-->
<!-- {{ scope.row.sex === 0 ? '女' : '男' }}-->
<!-- </el-tag>-->
<!-- </div>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column-->
<!-- label="角色"-->
<!-- width="180">-->
<!-- <template slot-scope="scope">-->
<!-- <div slot="reference" class="name-wrapper">-->
<!-- <el-tag size="medium"-->
<!-- :type="scope.row.roleId ===0 ? 'danger' : (scope.row.roleId ===1 ? 'primary':'success') ">-->
<!-- {{ scope.row.roleId === 0 ? '超级管理员' : (scope.row.roleId === 1 ? '管理员' : '用户') }}-->
<!-- </el-tag>-->
<!-- </div>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column-->
<!-- fixed="right"-->
<!-- label="操作"-->
<!-- width="100">-->
<!-- <template slot-scope="scope">-->
<!-- &lt;!&ndash; <el-button-->
<!-- size="small"-->
<!-- @click="handleEdit(scope.$index, scope.row)">编辑-->
<!-- </el-button>-->
<!-- <el-button-->
<!-- size="small"-->
<!-- type="danger"-->
<!-- @click="handleDelete(scope.$index, scope.row)">删除-->
<!-- </el-button>&ndash;&gt;-->
<!-- <el-button @click="handleClick(scope.row)" type="text" size="small">查看</el-button>-->
<!-- <el-button type="text" size="small" @click="editUser(scope.row)"></el-button>-->
<!-- </template>-->
<!-- </el-table-column>-->
</el-table> </el-table>
<el-pagination <el-pagination
@size-change="handleSizeChange" @size-change="handleSizeChange"
@ -230,21 +505,75 @@ export default {
}; };
return { return {
pickerOptions: {
shortcuts: [{
text: '最近一周',
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
picker.$emit('pick', [start, end]);
}
}, {
text: '最近一个月',
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
picker.$emit('pick', [start, end]);
}
}, {
text: '最近三个月',
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
picker.$emit('pick', [start, end]);
}
}]
},
value1: '',
value2: '',
tableData: [], tableData: [],
pageSize: 10, pageSize: 10,
pageNum: 1, pageNum: 1,
total: 3, total: 3,
name: '', param: {
xb: '', sourceId: '',
strBill7: '',
code: '',
PROP_C1: '',
PROP_C3: '',
CODE: '',
PROP_C2: [],
PROP_C9: [],
},
//
RECEIVE_DATE: [],
//
ORDER_DATE: [],
checked: false,
zh:'', zh:'',
xbs: [
PROP_C2S: [
{ {
value: '1', label: '1',
label: '男' value: 'LOC1'
}, },
{ {
value: '0', label: '2',
label: '女' value: 'LOC2'
}
],
PROP_C9S: [
{
label: '1',
value: '马云'
},
{
label: '0',
value: '阿里'
} }
], ],
form: { form: {
@ -294,14 +623,19 @@ export default {
this.queryUser(); this.queryUser();
}, },
queryUser() { queryUser() {
console.log(this.RECEIVE_DATE[0]);
console.log(this.ORDER_DATE[0]);
// //
this.$axios.post(this.$httpUrl + '/user/queryUser', { this.$axios.post(this.$httpUrl + '/user/queryUser', {
pageSize: this.pageSize, pageSize: this.pageSize,
pageNum: this.pageNum, pageNum: this.pageNum,
param: { param: this.param,
name: this.name, PROP_C2: this.PROP_C2,
xb: this.xb PROP_C9: this.PROP_C9,
} RECEIVE_DATE: this.RECEIVE_DATE,
ORDER_DATE: this.ORDER_DATE
}).then(res => res.data) }).then(res => res.data)
.then(res => { .then(res => {
if (res.code == 200) { if (res.code == 200) {
@ -317,10 +651,22 @@ export default {
console.log(err); console.log(err);
}) })
}, },
find(){
if(this.checked){
this.checked=false;
}
this.queryUser();
},
Allquesr(){
//
if(this.checked){
this.rest();
this.queryUser();
}
},
rest() { rest() {
// //
this.name = '', this.param={};
this.xb = ''
}, },
add() { add() {
// //
@ -465,6 +811,7 @@ export default {
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
</style> </style>

View File

@ -8,7 +8,8 @@ import VueRouter from "vue-router";
import router from "@/router/router"; import router from "@/router/router";
import store from "@/store/store"; import store from "@/store/store";
Vue.prototype.$axios=axios; Vue.prototype.$axios=axios;
Vue.prototype.$httpUrl='http://192.168.56.147:8081'; // Vue.prototype.$httpUrl='http://192.168.56.147:8081';
Vue.prototype.$httpUrl='http://127.0.0.1:8081';
Vue.config.productionTip = false; Vue.config.productionTip = false;
Vue.use(VueRouter) Vue.use(VueRouter)
Vue.use(ElementUI,{size:'small'}); Vue.use(ElementUI,{size:'small'});

View File

@ -0,0 +1,13 @@
package com.yc.wms.bean;
public class DcxBean1 {
public String [] PROP_C9;
public String sourceId;
}

View File

@ -1,5 +1,7 @@
package com.yc.wms.controller; package com.yc.wms.controller;
import cn.hutool.json.JSONUtil;
import com.yc.wms.bean.DcxBean1;
import com.yc.wms.service.DcxService; import com.yc.wms.service.DcxService;
import com.yc.wms.until.QueryPageUtil; import com.yc.wms.until.QueryPageUtil;
import com.yc.wms.until.Result; import com.yc.wms.until.Result;
@ -32,6 +34,7 @@ public class UserController {
@Autowired @Autowired
private DcxService dcxService; private DcxService dcxService;
/** /**
* @return * @return
* *
@ -100,28 +103,27 @@ public class UserController {
* @param * @param
*/ */
@PostMapping("/queryUser") @PostMapping("/queryUser")
public Result queryUser(@RequestBody QueryPageUtil query) { public Result queryUser(@RequestBody String json) {
// HashMap map = query.getParam();
// String name = (String) map.get("name"); QueryPageUtil query =new QueryPageUtil();
// String sex = (String) map.get("xb");
// Page<User> page = new Page<User>(); System.out.println(json);
// page.setCurrent(query.getPageNum());
// page.setSize(query.getPageSize()); JSONObject jsonObject=JSONUtil.parseObj(json);
// System.out.println("当前页:" + query.getPageNum()); query.setPageSize((int)jsonObject.get("pageSize"));
// System.out.println("条数:" + query.getPageSize()); query.setPageNum((int)jsonObject.get("pageNum"));
// LambdaQueryWrapper<User> lambdaQueryWrapper = new LambdaQueryWrapper();
// if (name != null && name.length() > 0) { JSONObject param= (JSONObject)jsonObject.get("param");
// lambdaQueryWrapper.like(User::getUserName, name); DcxBean1 dcxBean1 = JSONUtil.toBean(param.toString(), DcxBean1.class);
// }
// if (sex != null && sex.length() > 0) {
// lambdaQueryWrapper.like(User::getSex, sex); for (String s:dcxBean1.PROP_C9) {
// } System.out.println("c9:"+s);
// IPage iPage = userService.QueryUser(page, lambdaQueryWrapper); }
//
// System.out.println(iPage.getTotal());
// System.out.println(iPage.getRecords());
// return Result.success(iPage.getTotal(), iPage.getRecords()); return dcxService.readJson(query,dcxBean1);
return dcxService.readJson(query);
} }

View File

@ -1,6 +1,7 @@
package com.yc.wms.service; package com.yc.wms.service;
import com.yc.wms.bean.DcxBean1;
import com.yc.wms.until.QueryPageUtil; import com.yc.wms.until.QueryPageUtil;
import com.yc.wms.until.Result; import com.yc.wms.until.Result;
@ -13,5 +14,11 @@ import com.yc.wms.until.Result;
* @since 2023-03-04 * @since 2023-03-04
*/ */
public interface DcxService { public interface DcxService {
Result readJson(QueryPageUtil query); Result readJson(QueryPageUtil query, DcxBean1 bean1);
} }

View File

@ -2,6 +2,7 @@ package com.yc.wms.service.impl;
import cn.hutool.json.JSONArray; import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONObject; import cn.hutool.json.JSONObject;
import com.yc.wms.bean.DcxBean1;
import com.yc.wms.service.DcxService; import com.yc.wms.service.DcxService;
import com.yc.wms.until.QueryPageUtil; import com.yc.wms.until.QueryPageUtil;
import com.yc.wms.until.Result; import com.yc.wms.until.Result;
@ -12,6 +13,8 @@ import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
import org.springframework.jdbc.object.SqlQuery; import org.springframework.jdbc.object.SqlQuery;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -26,51 +29,55 @@ public class DcxServiceImpl implements DcxService {
private NamedParameterJdbcTemplate jdbcTemplate; private NamedParameterJdbcTemplate jdbcTemplate;
@Override @Override
public Result readJson(QueryPageUtil query) { public Result readJson(QueryPageUtil query,DcxBean1 dcxBean1) {
HashMap map = query.getParam();
// String methodType = (String) map.get("methodType");
// if(methodType.equals("kchzcx")){//库存汇总查询
// return queryKchz(query);
// }
return queryKchz(query);
}
public Result queryKchz(QueryPageUtil query) {
HashMap map = query.getParam();
// String itemCode = (String) map.get("itemCode");
int pageNum = query.getPageNum();//当前页 int pageNum = query.getPageNum();//当前页
int pageSize = query.getPageSize();//条数 int pageSize = query.getPageSize();//条数
System.out.println("当前页:" + pageNum); //这里到时候记得自己加 判空
System.out.println("条数:" + pageSize); SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String sql = " from (SELECT ROW_NUMBER() OVER(ORDER BY it.id) AS RowNum, it.id ," //System.out.println(map);
+ "it.code,"
+ "it.name" // String startDate = simpleDateFormat.format(query.getStartDate());
+ " from Item it ";
sql += ") AS subquery "; String sql_bz = "SELECT ROW_NUMBER() OVER(ORDER BY rd.id) AS Row_Num,rd.id,ad.sourceId,ad.strBill7,ad.strBill8,\n" +
String sqlCount = "select count(id) as nums " + sql; "i.CODE,i.NAME,i.UNIT,a.ORDER_DATE,rd.RECEIVE_DATE,\n" +
sql = "select * " + sql + " WHERE RowNum BETWEEN " + (pageNum-1) * pageSize + " AND " + (pageNum) * pageSize; "rd.OPERATOR,z.NAME z_name,s.LP,ik.PROP_C1,ik.PROP_C2,\n" +
"ik.PROP_C3,ik.PROP_C5,ik.PROP_C8,ik.PROP_C9,\n" +
"rd.BAR_CODE,rd.BE_MOVED,ad.description\n" +
"FROM RECEIVED_RECORD rd \n" +
"LEFT JOIN ASN_DETAIL ad ON ad.id = rd.ASN_DETAIL_ID\n" +
"LEFT JOIN asn a ON a.ID = ad.ASN_ID\n" +
"LEFT JOIN ITEM_KEY ik ON ik.id = rd.ITEM_KEY_ID\n" +
"LEFT JOIN ITEM i ON i.id = ad.ITEM_ID\n" +
"LEFT JOIN stock s ON s.id = rd.SRC_LP\n" +
"LEFT JOIN WORKER w ON w.id = rd.WORKER_ID\n" +
"LEFT JOIN [ZONE] z ON z.id = rd.WAREHOUSE_AREA_ID " +
" where 1=1";
//查询条件
//采购订单
if(map.get("sourceId")!=null&&!map.get("sourceId").toString().equals("")){
sql_bz+=" and ad.sourceId ="+"'"+map.get("sourceId").toString()+"'";
}
//收货凭证
if(map.get("strBill7")!=null&&!map.get("strBill7").toString().equals("")){
sql_bz+=" and ad.strBill7 ="+"'"+map.get("strBill7").toString()+"'";
}
String sqlCount = "select count(t.id) as nums from(" + sql_bz+") t";
String sqlFy = "select t.* from(" + sql_bz+") t";
sqlFy+= " WHERE Row_Num BETWEEN " + (pageNum-1) * pageSize + " AND " + (pageNum) * pageSize;
//查询单数据 //查询单数据
Map<String,Object> listCount = jdbcTemplate.queryForMap(sqlCount, new HashMap<>()); Map<String,Object> listCount = jdbcTemplate.queryForMap(sqlCount, new HashMap<>());
//查询多条数据据 //查询多条数据据
List<Map<String,Object>> maps = jdbcTemplate.queryForList(sql, new HashMap<>()); List<Map<String,Object>> maps = jdbcTemplate.queryForList(sqlFy, new HashMap<>());
JSONArray data = new JSONArray(); System.out.println(maps);
for(Map<String,Object> m:maps){
int i=0; return Result.success(Long.parseLong(listCount.get("nums").toString()),maps);
JSONObject d = new JSONObject();
d.put("id",m.get("id"));
d.put("userNo",m.get("code"));
d.put("userName", m.get("name"));
d.put("passWord","123456");
d.put("age",19);
d.put("sex",1);
d.put("phone", "123");
d.put("roleId", 2);
d.put("isValid", false);
data.add(d);
}
return Result.success(Long.parseLong(listCount.get("nums").toString()),data);
} }
} }

View File

@ -1,6 +1,10 @@
package com.yc.wms.until; package com.yc.wms.until;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data; import lombok.Data;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
@Data @Data
@ -11,5 +15,6 @@ public class QueryPageUtil {
private int pageSize=PAGE_SIZE; private int pageSize=PAGE_SIZE;
private int pageNum=PAGE_NUM; private int pageNum=PAGE_NUM;
private HashMap param=new HashMap();
} }