opt:优化成品库存查询导出

This commit is contained in:
DESKTOP-5DIJMF9\admin
2025-02-20 15:01:30 +08:00
parent c017bcdad6
commit 13db4aad79
3 changed files with 81 additions and 41 deletions

View File

@@ -5,6 +5,7 @@ import cn.hutool.core.date.DateUtil;
import cn.hutool.core.map.MapUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
@@ -94,9 +95,17 @@ public class SubpackagerelationServiceImpl implements SubpackagerelationService
if (ObjectUtil.isNotEmpty(sap_pcsn)) {
map.put("sap_pcsn", "%" + sap_pcsn + "%");
}
String begin_time = (String) whereJson.get("begin_time");
if (!StrUtil.isEmpty(begin_time)) {
map.put("begin_time", begin_time);
}
String end_time = (String) whereJson.get("end_time");
if (!StrUtil.isEmpty(end_time)) {
map.put("end_time", end_time);
}
map.put("is_un_plan_production", is_un_plan_production);
map.put("date_of_production", date_of_production);
map.put("date_of_FG_inbound", date_of_FG_inbound);
map.put("status", status);
JSONObject json = WQL.getWO("PDM_BI_SUBPACKAGER01").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page),"workorder_id desc");
JSONArray content = json.getJSONArray("content");
@@ -228,7 +237,15 @@ public class SubpackagerelationServiceImpl implements SubpackagerelationService
}
map.put("is_un_plan_production", is_un_plan_production);
map.put("date_of_production", date_of_production);
map.put("date_of_FG_inbound", date_of_FG_inbound);
String begin_time = (String) whereJson.get("begin_time");
if (!StrUtil.isEmpty(begin_time)) {
map.put("begin_time", begin_time);
}
String end_time = (String) whereJson.get("end_time");
if (!StrUtil.isEmpty(end_time)) {
map.put("end_time", end_time);
}
map.put("status", status);
map.put("limits", "10000");
JSONArray resultJSONArray = WQL.getWO("PDM_BI_SUBPACKAGER01").addParamMap(map).process().getResultJSONArray(0);

View File

@@ -26,6 +26,8 @@
输入.sap_pcsn TYPEAS s_string
输入.date_of_production TYPEAS s_string
输入.date_of_FG_inbound TYPEAS s_string
输入.begin_time TYPEAS s_string
输入.end_time TYPEAS s_string
输入.status TYPEAS s_string
@@ -99,14 +101,16 @@
date_of_production = 输入.date_of_production
ENDOPTION
OPTION 输入.date_of_FG_inbound <> ""
date_of_FG_inbound = 输入.date_of_FG_inbound
OPTION 输入.begin_time <> ""
date_of_FG_inbound>= 输入.begin_time
ENDOPTION
OPTION 输入.end_time <> ""
date_of_FG_inbound <= 输入.end_time
ENDOPTION
OPTION 输入.status <> ""
status = 输入.status
ENDOPTION
ENDSELECT
ENDPAGEQUERY
ENDIF
@@ -167,7 +171,6 @@
OPTION 输入.status <> ""
sub.status = 输入.status
ENDOPTION
ENDSELECT
ENDPAGEQUERY
ENDIF
@@ -228,7 +231,6 @@
OPTION 输入.status <> ""
sub.status = 输入.status
ENDOPTION
ENDSELECT
ENDPAGEQUERY
ENDIF
@@ -280,15 +282,19 @@
date_of_production = 输入.date_of_production
ENDOPTION
OPTION 输入.date_of_FG_inbound <> ""
date_of_FG_inbound = 输入.date_of_FG_inbound
ENDOPTION
OPTION 输入.begin_time <> ""
date_of_FG_inbound>= 输入.begin_time
ENDOPTION
OPTION 输入.end_time <> ""
date_of_FG_inbound <= 输入.end_time
ENDOPTION
OPTION 输入.status <> ""
status = 输入.status
ENDOPTION
OPTION 输入.limits <> ""
1=1 order by workorder_id desc limit 0,10000
1=1 order by date_of_FG_inbound desc limit 0,10000
ENDOPTION
ENDSELECT
ENDQUERY

View File

@@ -87,16 +87,6 @@
@change="hand"
/>
</el-form-item>
<el-form-item label="业务日期">
<el-date-picker
v-model="query.date_of_FG_inbound"
type="date"
placeholder="选择日期时间"
style="width: 185px"
value-format="yyyy-MM-dd"
@change="hand"
/>
</el-form-item>
<el-form-item label="状态">
<el-select
v-model="query.status"
@@ -159,23 +149,17 @@
/>
</el-select>
</el-form-item>
<!-- <el-form-item label="满轴位状态">
<el-select
v-model="query.full_point_status"
clearable
filterable
size="mini"
class="filter-item"
style="width: 185px;"
@change="hand"
>
<el-option
v-for="item in dict.sch_full_point_status"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>-->
<el-form-item label="业务日期" prop="createTime">
<el-date-picker
v-model="query.createTime"
type="daterange"
value-format="yyyy-MM-dd HH:mm:ss"
start-placeholder="开始日期"
end-placeholder="结束日期"
:default-time="['00:00:00', '23:59:59']"
@change="crud.toQuery"
/>
</el-form-item>
<rrOperation :crud="crud" />
</el-form>
</div>
@@ -187,6 +171,7 @@
type="success"
icon="el-icon-check"
size="mini"
:loading="showDtlLoading"
@click="downdtl"
>
导出Excel
@@ -610,6 +595,7 @@ import udOperation from '@crud/UD.operation'
import pagination from '@crud/Pagination'
import { download } from '@/api/data'
import { downloadFile } from '@/utils'
import crudUserStor from "@/views/wms/basedata/st/userStor/userStor";
const defaultForm = {
workorder_id: null,
@@ -669,6 +655,7 @@ export default {
edit: ['admin', 'sub:edit'],
del: ['admin', 'sub:del']
},
showDtlLoading: false,
isPlanProducList: [
{ 'label': '是', 'value': '1' },
{ 'label': '否', 'value': '0' }
@@ -744,23 +731,53 @@ export default {
}
}
},
created() {
this.initQuery()
},
methods: {
// 钩子在获取表格数据之前执行false 则代表不获取数据
[CRUD.HOOK.beforeRefresh]() {
return true
},
initQuery() {
const end = new Date()
const start = new Date()
const endYear = end.getFullYear()
var endMonth = end.getMonth() + 1
if (end.getMonth() + 1 < 10) {
endMonth = '0' + endMonth.toString()
}
var endDay = end.getDate()
if (end.getDate() < 10) {
endDay = '0' + endDay.toString()
}
const endDate = endYear + '-' + endMonth + '-' + endDay + ' 23:59:59'
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
const startYear = start.getFullYear()
var startMonth = start.getMonth() + 1
if (start.getMonth() + 1 < 10) {
startMonth = '0' + startMonth.toString()
}
var startDay = start.getDate()
if (start.getDate() < 10) {
startDay = '0' + startDay.toString()
}
const startDate = startYear + '-' + startMonth + '-' + startDay + ' 00:00:00'
this.$set(this.query, 'createTime', [startDate, endDate])
this.crud.toQuery()
},
hand(value) {
this.crud.toQuery()
},
downdtl() {
if (this.currentRow !== null) {
crud.downloadLoading = true
this.showDtlLoading = true
download('/api/subpackagerelation/download', this.crud.query).then(result => {
debugger
downloadFile(result, '子卷包装', 'xlsx')
crud.downloadLoading = false
this.showDtlLoading = false
}).catch(() => {
crud.downloadLoading = false
this.showDtlLoading = false
})
}
}