no message

main
liyang 2024-04-12 11:52:09 +08:00
parent ce8834e9ae
commit 4bb01d4a9c
9 changed files with 406 additions and 4 deletions

View File

@ -0,0 +1,246 @@
<template>
<div class="div1">
<div class="div2" style="padding-bottom: 10px">
<el-form ref="form" :model="param" label-width="80px">
<el-row :gutter="24">
<el-col :span="4">
<el-form-item label="类型:">
<el-select v-model="param.ct_code" multiple filterable placeholder="请选择类型" style="width: 100%;">
<el-option
v-for="item in typess"
:key="item.index"
:label="item.code"
:value="item.code"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="是否在库:" >
<el-select v-model="param.agvFlag" placeholder="请选择是否在库" >
<el-option
v-for="item in agvFlag"
:key="item.label"
:label="item.values"
:value="item.label"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-button type="success" @click="find"></el-button>
<el-button type="success" @click="rest"></el-button>&nbsp;&nbsp;
</el-form>
</div>
<el-table
show-summary
:summary-method="getSummaries"
v-loading="this.tableloding"
:height="MaxHeight"
:header-cell-style="{background:'#000',color:'#fff'}"
:data="tableData"
id="educe-table"
ref="tableData"
style="width: 100%;">
<el-table-column
type="selection"
width="55">
</el-table-column>
<el-table-column
fixed
label="序号"
v-if="false"
width="180">
<template slot-scope="scope">
<span style="margin-left: 10px">{{ scope.row.code }}</span>
</template>
</el-table-column>
<el-table-column
label="类型"
>
<template slot-scope="scope">
<div slot="reference" class="name-wrapper">
<span>{{ scope.row.code}}</span>
</div>
</template>
</el-table-column>
<el-table-column
label="状态"
>
<template slot-scope="scope">
<div slot="reference" class="name-wrapper">
<span>{{ scope.row.STATUS}}</span>
</div>
</template>
</el-table-column>
<el-table-column
label="是否在AGV库"
>
<template slot-scope="scope">
<div slot="reference" class="name-wrapper">
<span>{{ scope.row.agvFlag==1?'是':'否'}}</span>
</div>
</template>
</el-table-column>
<el-table-column
label="箱子数"
>
<template slot-scope="scope">
<div slot="reference" class="name-wrapper">
<span>{{ scope.row.shu}}</span>
</div>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="pageNum"
:page-sizes="[ 50, 100, 200,500]"
:page-size="pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="total">
</el-pagination>
</div>
</template>
<script>
export default {
data() {
return {
tableloding: false,
isShow:false,//
tableData: [],
pageSize: 50,
pageNum: 1,
total: 3,
param: {
ct_code: [],
agvFlag: '',
},
//
typess: [],
//
agvFlag: [{
values: '是',
label: 1,
},{
values: '否',
label: 0,
}
],
}
},computed:{
MaxHeight(){
return window.innerHeight - 240 +"px";
}
},
mounted: function () {
this.queryUser();
this.Typess();
},
methods: {
//
getSummaries(param) {
const { columns, data } = param
const sums = []
columns.forEach((column, index) => {
if (index === 4) {
sums[index] = '汇总:' + 10;
}
})
return sums
},
handleEdit(index, row) {
console.log(index, row);
},
handleDelete(index, row) {
console.log(index, row);
},
handleSizeChange(val) {
console.log(`每页 ${val}`);
this.pageNum = 1;
this.pageSize = val;
this.queryUser();
},
handleCurrentChange(val) {
console.log(`当前页: ${val}`);
this.pageNum = val;
this.queryUser();
},
Typess(){
this.$axios.post(this.$httpUrl + '/dcx/type', {
}).then(res => res.data)
.then(res => {
if (res.code == 200) {
this.typess = res.data;
} else {
this.$message.error('获取数据失败');
}
// eslint-disable-next-line no-unused-vars
},err=>{
this.tableloding=false;
})
},
queryUser() {
//
this.$axios.post(this.$httpUrl + '/dcx/querydcx', {
pageSize: this.pageSize,
pageNum: this.pageNum,
param: this.param,
}).then(res => res.data)
.then(res => {
if (res.code == 200) {
this.tableData = res.data
this.total = res.total
} else {
this.$message.error('获取数据失败');
}
// eslint-disable-next-line no-unused-vars
},err=>{
this.tableloding=false;
})
},
find(){
this.queryUser();
},
Allquesr(){
//
if(this.checked){
this.isShow=true;
}else {
this.isShow=false;
}
},
rest() {
//
this.checked=false;
this.isShow=false;
this.param={};
},
}
}
</script>
<style scoped>
</style>

View File

@ -22,7 +22,7 @@ const routes=[
meta:{
title:'首页'
},
component: () => import('../components/duochaxun/Kucunrizhi')
component: () => import('../components/duochaxun/dcx')
},
{
path:'/Zhengliqingdan',
@ -64,6 +64,14 @@ const routes=[
},
component: () => import('@/components/duochaxun/Kucunrizhi.vue')
},
{
path:'/dcx',
name:'dcx',
meta:{
title:'多查询'
},
component: () => import('@/components/duochaxun/dcx.vue')
},
]
}

View File

@ -0,0 +1,10 @@
package com.yc.wms.bean;
public class Modeldcx {
//类型
public String[] ct_code;
//是否
public String agvFlag;
}

View File

@ -36,6 +36,7 @@ public class KucunrizhiController {
@PostMapping("/log")
public Result Log() {
return kucunrizhi.Log();
}
}
}

View File

@ -48,7 +48,7 @@ public class UserController {
// return result;
JSONArray array=new JSONArray();
JSONObject data=new JSONObject();
int menuCount=5;
int menuCount=6;
for (int i=1;i<=menuCount;i++){
JSONObject menu=new JSONObject();
menu.put("id",i);
@ -73,6 +73,10 @@ public class UserController {
menu.put("menuName", "库存操作日志");
menu.put("menuComponent","/Kucunrizhi");
menu.put("menuClick","Kucunrizhi");
}else if(i==6) {
menu.put("menuName", "666");
menu.put("menuComponent","/dcx");
menu.put("menuClick","dcx");
}
menu.put("menuLevel",i);
menu.put("menuParentCode",i);

View File

@ -0,0 +1,42 @@
package com.yc.wms.controller;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.yc.wms.bean.Modeldcx;
import com.yc.wms.service.Zwdcx;
import com.yc.wms.until.QueryPageUtil;
import com.yc.wms.until.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@RestController
@Slf4j
@RequestMapping("/dcx")
public class dcxController {
@Autowired
private Zwdcx dcx;
@PostMapping("/querydcx")
public Result queryUser(@RequestBody String json) {
QueryPageUtil query =new QueryPageUtil();
JSONObject jsonObject= JSONUtil.parseObj(json);
query.setPageSize((int)jsonObject.get("pageSize"));
query.setPageNum((int)jsonObject.get("pageNum"));
JSONObject param= (JSONObject)jsonObject.get("param");
Modeldcx d = JSONUtil.toBean(param.toString(), Modeldcx.class);
return dcx.QueryJson(query,d);
}
@PostMapping ("/type")
public Result Type() {
return dcx.Type();
}
}

View File

@ -0,0 +1,14 @@
package com.yc.wms.service;
import com.yc.wms.bean.Modeldcx;
import com.yc.wms.until.QueryPageUtil;
import com.yc.wms.until.Result;
public interface Zwdcx {
// 条件查询加分页
Result QueryJson(QueryPageUtil query, Modeldcx dcx);
//下拉
Result Type();
}

View File

@ -52,7 +52,7 @@ public class JianhuojiemianImpl implements Jianhuojiemian {
" left join WORKER w1 on w1.id=t.WORKER1_ID\n" +
" left join WORKER w4 on w4.id=t.WORKER4_ID\n" +
" left join stock st on st.id=t.DST_LP\n" +
"where 1=1";
"where 1=1 and t.TYPE='MV_PICKTICKET' and t.PLAN_QUANTITY>0";
//子任务号
if(jianhuojiemian.BILLCODE!=null){

View File

@ -0,0 +1,77 @@
package com.yc.wms.service.impl;
import com.yc.wms.bean.Modeldcx;
import com.yc.wms.service.Zwdcx;
import com.yc.wms.until.QueryPageUtil;
import com.yc.wms.until.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
import org.springframework.stereotype.Service;
import java.text.SimpleDateFormat;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Slf4j
@Service
public class dcxImpl implements Zwdcx {
@Autowired
private NamedParameterJdbcTemplate jdbcTemplate;
@Override
public Result QueryJson(QueryPageUtil query, Modeldcx dcx) {
int pageNum = query.getPageNum();//当前页
int pageSize = query.getPageSize();//条数
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String sql="select Row_number() OVER(ORDER BY ct.code) as Row_Num,ct.code,s.STATUS,s.agvFlag,count(s.LP) shu\n" +
"from stock s\n" +
"left join containerType ct on ct.id= s.containerType\n" +
"where 1=1 and s.LP like 'X%'";
//类型
if(dcx.ct_code!=null&& dcx.ct_code.length>0){
StringBuffer sb = new StringBuffer();
for (int i = 0; i< dcx.ct_code.length; i++){
if(dcx.ct_code.length-1==i){
sb.append("'"+ dcx.ct_code[i]+"'");
}else {
sb.append("'"+ dcx.ct_code[i]+"'"+",");
}
}
sql+=" and ct.code in ("+sb.toString()+")";;
}
//是否
if(dcx.agvFlag!=null&& !dcx.agvFlag.equals("")){
sql+=" and s.agvFlag ="+"'"+dcx.agvFlag+"'";
}
String sqlCount = "select count(t.code) as nums from(" + sql+"\n GROUP BY ct.code,s.STATUS,s.agvFlag \n"+
") t";
String sqlFy = "select t.* from(" + sql+"GROUP BY ct.code,s.STATUS,s.agvFlag \n" +
") t";
sqlFy+= " WHERE Row_Num BETWEEN " + (pageNum-1) * pageSize + " AND " + (pageNum) * pageSize;
//查询单数据
Map<String,Object> listCount = jdbcTemplate.queryForMap(sqlCount, new HashMap<>());
//查询多条数据据
List<Map<String,Object>> maps = jdbcTemplate.queryForList(sqlFy, new HashMap<>());
return Result.success(Long.parseLong(listCount.get("nums").toString()),maps);
}
@Override
public Result Type() {
String sql="select distinct code from containerType";
List<Map<String,Object>> list=jdbcTemplate.queryForList(sql,new HashMap<>());
return Result.success(list);
}
}