no message

main
CHINAMI-V47SHQD\EDY 2025-07-21 16:14:54 +08:00
parent d9ece72127
commit 1a320152f3
9 changed files with 1061 additions and 11 deletions

View File

@ -0,0 +1,114 @@
/* 查询表单样式 - query-form.css */
/* 整体容器 */
.query-wrapper {
padding: 15px;
background-color: #ffffff;
border: 1px solid #e5e6eb;
border-radius: 4px;
width: 100%;
box-sizing: border-box;
}
/* 查询条件区域 */
.query-conditions {
padding: 12px;
background-color: #f7f8fa;
border-radius: 4px;
margin-bottom: 10px;
}
/* 条件行容器 */
.condition-row {
display: flex;
align-items: center;
flex-wrap: wrap;
margin-bottom: 10px;
}
/* 单个条件项 */
.condition-item {
display: flex;
align-items: center;
margin-right: 25px;
margin-bottom: 5px;
}
/* 条件标签 */
.condition-label {
display: inline-block;
width: 75px;
text-align: right;
padding-right: 8px;
font-size: 14px;
color: #333333;
font-weight: 500;
}
/* 输入框样式 */
.condition-input {
width: 220px;
font-size: 14px;
}
/* 普通选择器 */
.condition-select {
width: 220px;
font-size: 14px;
}
/* 短选择器 */
.condition-select-short {
width: 160px;
font-size: 14px;
}
/* 按钮组区域 */
.button-group {
display: flex;
align-items: center;
flex-wrap: wrap;
padding-top: 10px;
}
/* 按钮样式 */
.button-group .el-button {
margin-right: 10px;
font-size: 14px;
padding: 8px 16px;
}
/* 复选框样式 */
.button-group .el-checkbox {
margin-top: 2px;
font-size: 14px;
color: #333333;
}
/* 适配多行输入框 */
.condition-input.el-textarea .el-textarea__inner {
min-height: 32px;
resize: none;
font-size: 14px;
}
/* 响应式适配 */
@media (max-width: 768px) {
.condition-item {
width: 100%;
margin-right: 0;
margin-bottom: 8px;
}
.condition-input,
.condition-select,
.condition-select-short {
width: calc(100% - 83px);
}
.button-group .el-button {
margin-right: 0;
margin-bottom: 8px;
flex: 1;
}
}

View File

@ -0,0 +1,96 @@
<template>
<el-dialog title="呼叫设置" :visible.sync="dialogVisible" width="30%">
<el-form :model="form" label-width="100px">
<el-form-item label="工作站">
<el-select v-model="form.workstation" placeholder="请选择工作站" style="width: 100%">
<el-option
v-for="item in workstations"
:key="item.id"
:label="item.code"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="备注">
<el-input v-model="form.remark" type="textarea" :rows="2"></el-input>
</el-form-item>
<el-form-item label="是否加急">
<el-radio-group v-model="form.isUrgent">
<el-radio :label="true"></el-radio>
<el-radio :label="false"></el-radio>
</el-radio-group>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="submitCall"> </el-button>
</span>
</el-dialog>
</template>
<script>
export default {
props: {
selectedRows: {
type: Array,
required: true
}
},
data() {
return {
dialogVisible: false,
form: {
workstation: '',
remark: '',
isUrgent: false
},
workstations: []
};
},
methods: {
submitCall() {
const invIds = this.$parent.selectedRows.map(row => row.id).join(',');
const gzz_id = this.form.workstation;
const remarks = this.form.remark;
const be_urgent = String(this.form.isUrgent);
const payload = {
methodType: 'INVENTORYAGV',
invIds,
gzz_id,
remarks,
be_urgent
};
console.log('发送的参数:', payload); //
this.$axios.post('http://localhost:8080/zwwms/services/rest/rpcService/deductInventory', payload)
.then(response => {
this.$message.success('呼叫成功');
this.dialogVisible = false;
this.$emit('success');
})
.catch(error => {
this.$message.error('呼叫失败');
console.error('系统错误:', error);
});
},
fetchWorkstations() {
this.$axios.post(this.$httpUrl + '/Enumerate/Gzz')
.then(response => {
this.workstations = response.data.data;
})
.catch(error => {
console.error('获取工作站数据失败:', error);
this.$message.error('获取工作站失败');
});
}
},
mounted() {
this.fetchWorkstations();
}
};
</script>

View File

@ -0,0 +1,569 @@
<template>
<div class="div1">
<div class="query-wrapper">
<!-- 查询条件区域 -->
<div class="query-conditions">
<div class="condition-row">
<!-- 料号 -->
<label class="condition-label">料号:</label>
<el-select
v-model="param.itemCodeList"
multiple
filterable
clearable
remote
reserve-keyword
placeholder="请输入关键词"
:remote-method="remoteItemList"
:loading="loading">
<el-option
v-for="item in itemList"
:key="item.code"
:label="item.code"
:value="item.code">
</el-option>
</el-select>
<!-- 推荐库区 -->
<label class="condition-label">推荐库区:</label>
<el-select
v-model="param.tKq"
style="width: 130px;"
clearable
filterable
placeholder="请选择推荐库区"
class="condition-select"
>
<el-option
v-for="item in Ku"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
<label class="condition-label">默认库区:</label>
<el-select
v-model="param.mKq"
clearable
style="width: 130px;"
filterable
placeholder="默认库区"
class="condition-select"
>
<el-option
v-for="item in Ku"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
<!-- 是否有限期 -->
<label class="condition-label">是否有限期:</label>
<el-select
style="width: 100px;"
v-model="param.isBOM"
clearable
placeholder="请选择"
class="condition-select-short"
>
<el-option label="是" value="1"></el-option>
<el-option label="否" value="0"></el-option>
</el-select>
<label class="condition-label">包装:</label>
<el-input type="textarea" v-model="param.smallUnit" style="width: 200px;" rows="1"></el-input>
</div>
</div>
<!-- 按钮区域 -->
<div class="button-group">
<el-button type="success" @click="find"></el-button>
<el-button type="success" @click="down"></el-button>
<el-button type="success" @click="rest"></el-button>&nbsp;&nbsp;
</div>
</div>
<el-form ref="form" :model="param" label-width="80px">
</el-form>
<el-table
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.序号 }}</span>
</template>
</el-table-column>
<el-table-column label="料号" width="180">
<template slot-scope="scope">
<div slot="reference" class="name-wrapper">
<span>{{ scope.row.料号 }}</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.描述 }}</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.包装类型 }}</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.规格数量 }}</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.规格重量 }}</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.净重 }}</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. }}</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. }}</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. }}</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.体积 }}</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.单位 }}</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.推荐库区 }}</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.默认库区 }}</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.类型 }}</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.价值等级 }}</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.保质期 }}</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.预警天数 }}</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.批次号 }}</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.批次规则 }}</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.是否包装更新 }}</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.包装 }}</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.是否序列号 }}</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.是否有限期 }}</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.危险品 }}</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.是否由库存 }}</span>
</div>
</template>
</el-table-column>
<el-table-column label="是否SAP料号" width="180">
<template slot-scope="scope">
<div slot="reference" class="name-wrapper">
<span>{{ scope.row.是否SAP料号 }}</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.是否米数 }}</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.库存组 }}</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.热度值 }}</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.备注 }}</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.币种 }}</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.元值 }}</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>
import { downloadExcel } from '@/util/excelUtils';
export default {
data() {
return {
itemList:[],
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]);
}
}]
},
tableloding: false,
isShow:false,//
tableData: [],
pageSize: 50,
pageNum: 1,
total: 3,
param: {
//
itemCodeList: [],
//
tKq: null,
//
mKq: null,
//
smallUnit:null,
//
isBOM:null
},
Ku: [],
Gz: [],
loading: false,
checked: false,
}
},computed:{
MaxHeight(){
return window.innerHeight - 240 +"px";
}
},
mounted: function () {
this.queryUser();
this.KuS();
this.GzzS();
},
methods: {
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();
},
remoteItemList(query) {
if (query !== '') {
this.loading = true;
this.$axios.post(this.$httpUrl + '/Enumerate/Item', {
query
}).then(res => {
this.itemList = res.data.data;
},err=>{
this.tableloding=false;
})
this.loading = false;
} else {
this.options = [];
}
},
KuS(){
//
this.$axios.post(this.$httpUrl + '/Enumerate/Zone', {
}).then(res => res.data)
.then(res => {
if (res.code == 200) {
this.Ku = res.data;
} else {
this.$message.error('获取数据失败');
}
// eslint-disable-next-line no-unused-vars
},err=>{
this.tableloding=false;
})
},
GzzS(){
this.$axios.post(this.$httpUrl + '/Enumerate/Gzz ', {
}).then(res => res.data)
.then(res => {
if (res.code == 200) {
this.Gz = res.data;
} else {
this.$message.error('获取数据失败');
}
// eslint-disable-next-line no-unused-vars
},err=>{
this.tableloding=false;
})
},
queryUser() {
//
this.$axios.post(this.$httpUrl + '/item/queryList', {
pageSize: this.pageSize,
pageNum: this.pageNum,
param: this.param,
}).then(res => res.data)
.then(res => {
if (res.code == 200) {
console.log(res.data)
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.pageNum=1;
this.queryUser();
},
down(){
this.downExcel();
},
downExcel() {
this.tableloding = true;
downloadExcel('/item/download', '物料明细', this.total, this.param)
.then(() => {
this.tableloding = false;
})
.catch(error => {
console.error('系统错误:', error);
this.tableloding = false;
});
},
Allquesr(){
//
if(this.checked){
this.isShow=true;
}else {
this.isShow=false;
}
},
rest() {
//
this.checked=false;
this.isShow=false;
this.param={};
},
}
}
</script>
<style scoped>
/* 导入外部CSS文件 */
@import "@/assets/styles/query-form.css";
</style>

View File

@ -157,15 +157,21 @@
</el-col>
</el-row>
<el-button type="primary" @click="handleCall"></el-button>
<el-button type="success" @click="find"></el-button>
<el-button type="success" @click="down"></el-button>
<el-button type="success" @click="rest"></el-button>&nbsp;&nbsp;
<el-checkbox v-model="checked" @change="Allquesr"></el-checkbox>
</el-form>
</div>
<call-dialog
:selected-rows="selectedRows"
@success="queryUser"
ref="callDialog"
/>
<el-table
v-loading="this.tableloding"
@selection-change="handleSelectionChange"
:height="MaxHeight"
:header-cell-style="{background:'#000',color:'#fff'}"
:data="tableData"
@ -614,9 +620,14 @@
<script>
import { downloadExcel } from '@/util/excelUtils';
import CallDialog from '@/components/dialog/KucunhuizongCallDialog.vue';
export default {
components: {
CallDialog
},
data() {
return {
selectedRows: [],
//
pd: [
{
@ -737,7 +748,17 @@ export default {
this.ZtS();
},
methods: {
handleCall() {
if (this.selectedRows.length === 0) {
this.$message.warning('请选择至少一条记录');
return;
}
this.$refs.callDialog.dialogVisible = true; //
},
handleSelectionChange(selectedRows) {
this.selectedRows = selectedRows;
},
handleEdit(index, row) {
console.log(index, row);
},

View File

@ -24,6 +24,14 @@ const routes=[
},
component: () => import('../components/duochaxun/Pandianmingxi')
},
{
path:'/ItemIndex',
name:'ItemIndex',
meta:{
title:'物料信息'
},
component: () => import('@/components/duochaxun/ItemIndex.vue')
},
{
path:'/Zhengliqingdan',
name:'Zhengliqingdan',

View File

@ -1,10 +1,12 @@
package com.yc.wms.controller;
import cn.hutool.json.JSONObject;
import com.yc.wms.until.Result;
import com.yc.wms.utils.JdbcQueryExample;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@ -38,11 +40,39 @@ public class EnumerateController {
public Result Gzz() {
String sql = " SELECT "
+" ls.code, "
+" ls.name "
+" ls.name, "
+" ls.id "
+" FROM Location_Storage ls "
+" WHERE 1=1 "
+" and ls.name in ('201','202','203','204','205','206','207','208','209','210','211','212', "
+" '213','214','215','101','102','103','104','105','106','107','602','603','604','605') ";
+" and ls.type in ('拣货') ";
List<Map<String, Object>> mapList = jdbcQueryExample.sqlQuery(sql);
return Result.success(mapList);
}
/* 库区*/
@PostMapping("/Zone")
public Result Zone() {
String sql = " SELECT "
+" z.code, "
+" z.name, "
+" z.id "
+" FROM ZONE z "
+" WHERE 1=1 "
+" ";
List<Map<String, Object>> mapList = jdbcQueryExample.sqlQuery(sql);
return Result.success(mapList);
}
/* 库区*/
@PostMapping("/Item")
public Result Item(@RequestBody String query) {
JSONObject jsonObject=new JSONObject(query);
String itemCode=jsonObject.getStr("query");
String sql = " SELECT TOP 50 "
+" i.code, "
+" i.name, "
+" i.id "
+" FROM Item i "
+" WHERE 1=1 "
+" and i.code like '"+itemCode+"%' ";
List<Map<String, Object>> mapList = jdbcQueryExample.sqlQuery(sql);
return Result.success(mapList);
}

View File

@ -0,0 +1,208 @@
package com.yc.wms.controller;
import cn.hutool.core.date.DateUnit;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.yc.wms.bean.Xuliehao;
import com.yc.wms.service.Xuliehaoqingdan;
import com.yc.wms.until.QueryPageUtil;
import com.yc.wms.until.Result;
import com.yc.wms.utils.FileUtil;
import com.yc.wms.utils.QueryUtil;
import com.yc.wms.utils.StringUtils;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.persistence.*;
import javax.servlet.http.HttpServletResponse;
import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import java.util.stream.Collectors;
@RestController
@Slf4j
@RequestMapping("/item")
public class ItemController {
@PersistenceContext
private EntityManager entityManager;
@Autowired
private NamedParameterJdbcTemplate jdbcTemplate;
@Autowired
private Xuliehaoqingdan xuliehaoqingdan;
@Autowired
private QueryUtil queryUtil;
private static /* 基础sql数据查询*/
String querySql = "";
public static String buildSql() {
StringBuilder sql = new StringBuilder();
sql.append(" select "
+" item.id as id, "
+" item.id as 序号, "
+" item.code as 料号, "
+" item.name as 描述, "
+" item.CA_name as 包装类型, "
+" item.pack_Number as 规格数量, "
+" item.weight as 规格重量, "
+" item.suggest as 净重, "
+" item.length as 长, "
+" item.width as 宽, "
+" item.height as 高, "
+" item.volume as 体积 , "
+" item.unit as 单位, "
+" wa.name as 推荐库区, "
+" w.name as 默认库区, "
+" item.good_Type as 类型, "
+" item.ship_Rules as 价值等级, "
+" item.valid_Period as 保质期, "
+" item.ALERT_LEADING_DAYS as 预警天数, "
+" item.SINGLE_ITEM as 批次号, "
+" item.brand as 批次规则, "
+" item.be_Unpacking as 是否包装更新, "
+" item.smallUnit as 包装, "
+" item.be_Mark_Weight as 是否序列号, "
+" item.isBOM as 是否有限期, "
+" item.be_Weight as 危险品, "
+" item.be_Inv as 是否由库存, "
+" item.be_SAP_Item as 是否SAP料号, "
+" item.be_Whole_Line as 是否米数, "
+" P.name as 库存组, "
+" item.sale_Time as 热度值, "
+" item.str_Extend1 as 备注, "
+" item.str_Extend2 as 币种, "
+" item.str_Extend3 as 元值 "
+" from ITEM item "
+" left join ZONE wa on wa.id=item.warehouse_Area_ID "
+" left join ZONE w on w.id=item.default_Warehouse_Area_ID "
+" left join position p on p.id=item.POSITION_ID where 1=1");
sql.append(querySql); // 动态条件
return sql.toString();
}
@PostMapping("/queryList")
public Result queryList(@RequestBody String json) {
querySql="";
/* 返回data设置*/
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");
if (param.getJSONArray("itemCodeList")!=null&&param.getJSONArray("itemCodeList").size()>0){
querySql=querySql+" and item.code in ("+ StringUtils.strInSql(JSONUtil.toList(param.getJSONArray("itemCodeList"), String.class))+")";
}
//推荐库区
if (param.getStr("tKq")!=null&&param.getStr("tKq").length()>0){
querySql=querySql+" and wa.id = "+param.getStr("tKq");
}
//默认库区
if (param.getStr("mKq")!=null&&param.getStr("mKq").length()>0){
querySql=querySql+" and w.id = "+param.getStr("mKq");
}
if (param.getStr("isBOM")!=null&&param.getStr("isBOM").length()>0){
querySql=querySql+" and item.isBOM = "+param.getStr("isBOM");
}
if (param.getStr("smallUnit")!=null&&param.getStr("smallUnit").length()>0){
querySql=querySql+" and item.smallUnit like '%"+param.getStr("smallUnit")+"%'";
}
/* 当前页数据*/
int pageNum = query.getPageNum();//当前页
int pageSize = query.getPageSize();//查询条数
String sqlFa = "select * from( "
+ buildSql()
+ ") t where 1=1 "
;
/* 总条数*/
String sqlCount = "select count(t.序号 ) as nums from (" + sqlFa+") t";
List<Integer> counts = entityManager.createNativeQuery(sqlCount).getResultList();
/* 返回数据集合*/
List<Map<String,Object>> maps;
if (pageSize>100000){
maps = queryUtil.multiThreadedQuery(sqlFa, pageSize, pageNum);
}else {
String sqlFy= sqlFa+" ORDER BY 序号 "
+" OFFSET "+ (pageNum-1) * pageSize +" ROWS "
+" FETCH NEXT "+pageSize+" ROWS ONLY ";
maps = jdbcTemplate.queryForList(sqlFy, new HashMap<>());
}
for (int i = 0; i < maps.size(); i++) {
Map<String,Object> map=maps.get(i);
map.put("mergeData",new HashMap() {{
put("单据类型", new int[]{1, 1});
}});
}
// List<JhXl> jhXlList = entityManager.createNativeQuery(sqlFy, JhXl.class).getResultList();
Result result=Result.result(200,"操作成功",Long.parseLong(counts.get(0).toString()), maps);
return result;
}
@PostMapping("/inputPt")
public Result inputPt(@RequestBody String json) {
String sqlInput=" select 出库类型 as 'name' from ( "
+buildSql()
+" ) t "
+" WHERE 出库类型 is not null group by 出库类型 ";
List<String> ptList = entityManager.createNativeQuery(sqlInput).getResultList();
Result result=Result.result(200,"操作成功",1, ptList);
return result;
}
@PostMapping(value = "/download")
public synchronized void exportCompany(HttpServletResponse response, @RequestBody String json) throws Exception {
download( (List<Map<String,Object>>)queryList(json).getData(), response);
}
public void download(List<Map<String, Object>> all, HttpServletResponse response) throws Exception {
List<Map<String, Object>> list = new ArrayList<>();
for (Map<String, Object> item : all) {
Map<String, Object> map = new LinkedHashMap<>();
map.put("序号", item.get("序号"));
map.put("料号", item.get("料号"));
map.put("描述", item.get("描述"));
map.put("包装类型", item.get("包装类型"));
map.put("规格数量", item.get("规格数量"));
map.put("规格重量", item.get("规格重量"));
map.put("净重", item.get("净重"));
map.put("长", item.get("长"));
map.put("宽", item.get("宽"));
map.put("高", item.get("高"));
map.put("体积", item.get("体积"));
map.put("单位", item.get("单位"));
map.put("推荐库区", item.get("推荐库区"));
map.put("默认库区", item.get("默认库区"));
map.put("类型", item.get("类型"));
map.put("价值等级", item.get("价值等级"));
map.put("保质期", item.get("保质期"));
map.put("预警天数", item.get("预警天数"));
map.put("批次号", item.get("批次号"));
map.put("批次规则", item.get("批次规则"));
map.put("是否包装更新", item.get("是否包装更新"));
map.put("包装", item.get("包装"));
map.put("是否序列号", item.get("是否序列号"));
map.put("是否有限期", item.get("是否有限期"));
map.put("危险品", item.get("危险品"));
map.put("是否由库存", item.get("是否由库存"));
map.put("是否SAP料号", item.get("是否SAP料号"));
map.put("是否米数", item.get("是否米数"));
map.put("库存组", item.get("库存组"));
map.put("热度值", item.get("热度值"));
map.put("备注", item.get("备注"));
map.put("币种", item.get("币种"));
map.put("元值", item.get("元值"));
list.add(map);
}
FileUtil.downloadExcel(list, response);
}
}

View File

@ -34,7 +34,7 @@ public class UserController {
public Result login(@RequestBody String user) {
JSONArray array=new JSONArray();
JSONObject data=new JSONObject();
int menuCount=13;
int menuCount=14;
for (int i=1;i<=menuCount;i++){
JSONObject menu=new JSONObject();
menu.put("id",i);
@ -91,6 +91,10 @@ public class UserController {
menu.put("menuName", "容器流通");
menu.put("menuComponent","/RongQi");
menu.put("menuClick","RongQi");
}else if(i==14) {
menu.put("menuName", "物料信息");
menu.put("menuComponent","/ItemIndex");
menu.put("menuClick","ItemIndex");
}
menu.put("menuLevel",i);
menu.put("menuParentCode",i);

View File

@ -13,14 +13,14 @@ server:
spring:
datasource:
url: jdbc:sqlserver://10.1.96.105:1433;DatabaseName=LD_WMSDB
# url: jdbc:sqlserver://47.103.100.52:1433;DatabaseName=zwlgtest
# url: jdbc:sqlserver://10.1.96.105:1433;DatabaseName=LD_WMSDB
url: jdbc:sqlserver://192.168.56.133:1433;DatabaseName=LD_WMSDB
# url: jdbc:sqlserver://192.168.2.88:1433;DatabaseName=zwlgtest
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
username: wmsdb
password: AmecDDbb32A
# username: WMSDB
# password: WmsYc@5688
# username: wmsdb
# password: AmecDDbb32A
username: liu
password: 123456
# username: sa
# password: Amecadmin1!
hikari: