diff --git a/wms/hd/nladmin-system/src/main/java/org/nl/wms/st/ivt/rest/StructIvtController.java b/wms/hd/nladmin-system/src/main/java/org/nl/wms/st/ivt/rest/StructIvtController.java index d63aa1f..c23fad6 100644 --- a/wms/hd/nladmin-system/src/main/java/org/nl/wms/st/ivt/rest/StructIvtController.java +++ b/wms/hd/nladmin-system/src/main/java/org/nl/wms/st/ivt/rest/StructIvtController.java @@ -14,6 +14,7 @@ import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; +import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.util.Map; @@ -53,4 +54,10 @@ public class StructIvtController { return new ResponseEntity<>(structivtService.queryIvt(whereJson, page), HttpStatus.OK); } + @Log("导出数据") + @ApiOperation("导出数据") + @GetMapping(value = "/download") + public void download(@RequestParam Map map, HttpServletResponse response) throws IOException { + structivtService.download(map, response); + } } diff --git a/wms/hd/nladmin-system/src/main/java/org/nl/wms/st/ivt/service/StructIvtService.java b/wms/hd/nladmin-system/src/main/java/org/nl/wms/st/ivt/service/StructIvtService.java index 71d1350..25260c9 100644 --- a/wms/hd/nladmin-system/src/main/java/org/nl/wms/st/ivt/service/StructIvtService.java +++ b/wms/hd/nladmin-system/src/main/java/org/nl/wms/st/ivt/service/StructIvtService.java @@ -3,6 +3,8 @@ package org.nl.wms.st.ivt.service; import org.springframework.data.domain.Pageable; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; import java.util.Map; /** @@ -30,4 +32,5 @@ public interface StructIvtService { Map queryIvt(Map whereJson, Pageable page); + void download(Map map, HttpServletResponse response) throws IOException; } diff --git a/wms/hd/nladmin-system/src/main/java/org/nl/wms/st/ivt/service/impl/StructIvtServiceImpl.java b/wms/hd/nladmin-system/src/main/java/org/nl/wms/st/ivt/service/impl/StructIvtServiceImpl.java index b22fc9b..0f12396 100644 --- a/wms/hd/nladmin-system/src/main/java/org/nl/wms/st/ivt/service/impl/StructIvtServiceImpl.java +++ b/wms/hd/nladmin-system/src/main/java/org/nl/wms/st/ivt/service/impl/StructIvtServiceImpl.java @@ -2,18 +2,23 @@ package org.nl.wms.st.ivt.service.impl; +import cn.hutool.core.map.MapUtil; +import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSONArray; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import com.alibaba.fastjson.JSONObject; +import org.nl.utils.FileUtil; import org.nl.wms.st.ivt.service.StructIvtService; import org.nl.wql.WQL; import org.nl.wql.util.WqlUtil; import org.springframework.data.domain.Pageable; import org.springframework.stereotype.Service; -import java.util.HashMap; -import java.util.Map; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.*; /** * @author ldjun @@ -38,6 +43,9 @@ public class StructIvtServiceImpl implements StructIvtService { json.put("col_num", whereJson.get("col_num")); json.put("layer_num", whereJson.get("layer_num")); json.put("barcode", whereJson.get("barcode")); + json.put("pcsn", whereJson.get("pcsn")); + json.put("begin_time", whereJson.get("begin_time")); + json.put("end_time", whereJson.get("end_time")); JSONObject result = WQL.getWO("QST_structIvt_01").addParamMap(json).pageQuery(WqlUtil.getHttpContext(page), "ivt.barcode"); return result; } @@ -54,23 +62,62 @@ public class StructIvtServiceImpl implements StructIvtService { @Override public Map queryIvt(Map whereJson, Pageable page) { HashMap json = new HashMap<>(); - json.put("flag","2"); + json.put("flag", "2"); String search = (String) whereJson.get("search"); String sect_uuid = (String) whereJson.get("sect_uuid"); String store_uuid = (String) whereJson.get("store_uuid"); - if(!StrUtil.isEmpty(search)) { - json.put("search",search); + if (!StrUtil.isEmpty(search)) { + json.put("search", search); } - if(!StrUtil.isEmpty(sect_uuid)) { - json.put("sect_uuid",sect_uuid); + if (!StrUtil.isEmpty(sect_uuid)) { + json.put("sect_uuid", sect_uuid); } - if(!StrUtil.isEmpty(store_uuid)) { - json.put("store_uuid",store_uuid); + if (!StrUtil.isEmpty(store_uuid)) { + json.put("store_uuid", store_uuid); } JSONObject result = WQL.getWO("QST_structIvt_01").addParamMap(json).pageQuery(WqlUtil.getHttpContext(page), "mater.material_code desc"); return result; } + @Override + public void download(Map whereJson, HttpServletResponse response) throws IOException { + //QST_structIvt_01 + HashMap map = new HashMap<>(); + map.put("flag", "1"); + map.put("material_blury", whereJson.get("material_blury")); + map.put("struct_blury", whereJson.get("struct_blury")); + map.put("vehicle_code", whereJson.get("vehicle_code")); + map.put("sect_uuid", whereJson.get("sect_uuid")); + map.put("row_num", whereJson.get("row_num")); + map.put("col_num", whereJson.get("col_num")); + map.put("layer_num", whereJson.get("layer_num")); + map.put("barcode", whereJson.get("barcode")); + map.put("pcsn", whereJson.get("pcsn")); + map.put("begin_time", whereJson.get("begin_time")); + map.put("end_time", whereJson.get("end_time")); + JSONArray result = WQL.getWO("QST_structIvt_01").addParamMap(map).process().getResultJSONArray(0); + List> list = new ArrayList<>(); + for (int i = 0; i < result.size(); i++) { + JSONObject json = result.getJSONObject(i); + Map mp = new LinkedHashMap<>(); + + mp.put("物料编码", json.getString("material_code")); + mp.put("物料名称", json.getString("material_name")); + mp.put("物料规格", json.getString("material_spec")); + mp.put("批次", json.getString("pcsn")); + mp.put("仓位编码", json.getString("struct_code")); + mp.put("仓位名称", json.getString("struct_name")); + mp.put("载具号", json.getString("vehicle_code")); + mp.put("条形码", json.getString("barcode")); + mp.put("库区名称", json.getString("sect_name")); + mp.put("可用数量", json.getString("canuse_qty")); + mp.put("数量单位", json.getString("qty_unit_name")); + mp.put("质检状态", json.getString("quality_status")); + mp.put("入库时间", json.getString("instorage_time")); + list.add(mp); + } + FileUtil.downloadExcel(list, response); + } } diff --git a/wms/hd/nladmin-system/src/main/java/org/nl/wms/st/ivt/wql/QST_structIvt_01.wql b/wms/hd/nladmin-system/src/main/java/org/nl/wms/st/ivt/wql/QST_structIvt_01.wql index 825edaa..983ea96 100644 --- a/wms/hd/nladmin-system/src/main/java/org/nl/wms/st/ivt/wql/QST_structIvt_01.wql +++ b/wms/hd/nladmin-system/src/main/java/org/nl/wms/st/ivt/wql/QST_structIvt_01.wql @@ -24,6 +24,9 @@ 输入.sect_uuid TYPEAS s_string 输入.store_uuid TYPEAS s_string 输入.search TYPEAS s_string + 输入.pcsn TYPEAS s_string + 输入.begin_time TYPEAS s_string + 输入.end_time TYPEAS s_string 输入.barcode TYPEAS barcode [临时表] @@ -99,6 +102,15 @@ ENDOPTION OPTION 输入.barcode <> "" ivt.barcode like "%" 输入.barcode "%" + ENDOPTION + OPTION 输入.begin_time <> "" + ivt.instorage_time >= 输入.begin_time + ENDOPTION + OPTION 输入.end_time <> "" + ivt.instorage_time <= 输入.end_time + ENDOPTION + OPTION 输入.pcsn <> "" + ivt.pcsn like "%" 输入.pcsn "%" ENDOPTION ENDSELECT ENDPAGEQUERY diff --git a/wms/qd/src/views/wms/st/structIvt/index.vue b/wms/qd/src/views/wms/st/structIvt/index.vue index ec1cf76..5d51de1 100644 --- a/wms/qd/src/views/wms/st/structIvt/index.vue +++ b/wms/qd/src/views/wms/st/structIvt/index.vue @@ -57,6 +57,18 @@ @keyup.enter.native="crud.toQuery" /> + + + + + + - + + + 导出Excel + + { + debugger + downloadFile(result, '库存', 'xlsx') + crud.downloadLoading = false + }).catch(() => { + crud.downloadLoading = false + }) + } } } } diff --git a/wms/qd/src/views/wms/st/visable/index2.vue b/wms/qd/src/views/wms/st/visable/index2.vue index 788b310..68e88a3 100644 --- a/wms/qd/src/views/wms/st/visable/index2.vue +++ b/wms/qd/src/views/wms/st/visable/index2.vue @@ -77,7 +77,7 @@ style="border: 1px solid #d3dce6;display: inline-block;text-align: center; font-size: 10px;" :style="'background:'+arr['0102-0'+count+'-02']+';width: '+div_width+'px;height: '+div_height+'px;'" > - 2排
{{ count }}列
2层
{{arr3['0101-0'+count+'-02']}} + 2排
{{ count }}列
2层
{{arr3['0102-0'+count+'-02']}} @@ -243,7 +243,7 @@ style="border: 1px solid #d3dce6;display: inline-block;text-align: center; font-size: 10px;" :style="'background:'+arr['0104-'+((count+6) >= 10 ? (count+6) : '0'+(count+6)) +'-02']+';width: '+div_width+'px;height: '+div_height+'px;'" > - 4排
{{ (count + 6) }}列
2层
{{arr['0104-'+((count+6) >= 10 ? (count+6) : '0'+(count+6)) +'-02']}} + 4排
{{ (count + 6) }}列
2层
{{arr3['0104-'+((count+6) >= 10 ? (count+6) : '0'+(count+6)) +'-02']}} @@ -774,10 +774,10 @@ export default { return { arr: {}, arr2: {}, - arr3:{}, + arr3: {}, width: '2500', - div_width: '35', - div_height: '58', + div_width: '43', + div_height: '60', row_color: '#0d3fad' } }, diff --git a/wms/qd/src/views/wms/st/visable/index3.vue b/wms/qd/src/views/wms/st/visable/index3.vue index 6c5edc2..e79c453 100644 --- a/wms/qd/src/views/wms/st/visable/index3.vue +++ b/wms/qd/src/views/wms/st/visable/index3.vue @@ -21,10 +21,10 @@
- 1排
{{ count }}列
2层 + 1排
{{ count }}列
2层
{{arr3['0201-'+((count) >= 10 ? (count) : '0'+(count)) +'-02']}}
@@ -41,10 +41,10 @@
- 1排
{{ (count+4) }}列
2层 + 1排
{{ (count+4) }}列
2层
{{arr3['0201-'+((count+4) >= 10 ? (count+4) : '0'+(count+4)) +'-02']}}
@@ -63,10 +63,10 @@
- 1排
{{ count }}列
1层 + 1排
{{ count }}列
1层
{{arr3['0201-'+((count) >= 10 ? (count) : '0'+(count)) +'-01']}}
@@ -90,10 +90,10 @@
- 1排
{{ (count+4) }}列
1层 + 1排
{{ (count+4) }}列
1层
{{arr3['0201-'+((count+4) >= 10 ? (count+4) : '0'+(count+4)) +'-01']}}
@@ -114,10 +114,10 @@
- 2排
{{ count }}列
2层 + 2排
{{ count }}列
2层
{{arr3['0202-'+((count) >= 10 ? (count) : '0'+(count)) +'-02']}}
@@ -134,10 +134,10 @@
- 2排
{{ (count+6) }}列
2层 + 2排
{{ (count+6) }}列
2层
{{arr3['0202-'+((count+6) >= 10 ? (count+6) : '0'+(count+6)) +'-02']}}
@@ -156,10 +156,10 @@
- 2排
{{ count }}列
1层 + 2排
{{ count }}列
1层
{{arr3['0202-'+((count) >= 10 ? (count) : '0'+(count)) +'-01']}}
@@ -183,10 +183,10 @@
- 2排
{{ (count+6) }}列
1层 + 2排
{{ (count+6) }}列
1层
{{arr3['0202-'+((count+6) >= 10 ? (count+6) : '0'+(count+6)) +'-01']}}
@@ -206,10 +206,10 @@
- 3排
{{ count }}列
2层 + 3排
{{ count }}列
2层
{{arr3['0203-'+((count) >= 10 ? (count) : '0'+(count)) +'-02']}}
@@ -226,10 +226,10 @@
- 3排
{{ (count+6) }}列
2层 + 3排
{{ (count+6) }}列
2层
{{arr3['0203-'+((count+6) >= 10 ? (count+6) : '0'+(count+6)) +'-02']}}
@@ -248,10 +248,10 @@
- 3排
{{ count }}列
1层 + 3排
{{ count }}列
1层
{{arr3['0203-'+((count) >= 10 ? (count) : '0'+(count)) +'-01']}}
@@ -275,10 +275,10 @@
- 3排
{{ (count+6) }}列
1层 + 3排
{{ (count+6) }}列
1层
{{arr3['0203-'+((count+6) >= 10 ? (count+6) : '0'+(count+6)) +'-01']}}
@@ -298,10 +298,10 @@
- 4排
{{ count }}列
2层 + 4排
{{ count }}列
2层
{{arr3['0204-'+((count) >= 10 ? (count) : '0'+(count)) +'-02']}}
@@ -318,10 +318,10 @@
- 4排
{{ (count+12) }}列
2层 + 4排
{{ (count+12) }}列
2层
{{arr3['0204-'+((count+12) >= 10 ? (count+12) : '0'+(count+12)) +'-02']}}
@@ -340,10 +340,10 @@
- 4排
{{ count }}列
1层 + 4排
{{ count }}列
1层
{{arr3['0204-'+((count) >= 10 ? (count) : '0'+(count)) +'-01']}}
@@ -367,10 +367,10 @@
- 4排
{{ (count+12) }}列
1层 + 4排
{{ (count+12) }}列
1层
{{arr3['0204-'+((count+12) >= 10 ? (count+12) : '0'+(count+12)) +'-01']}}
@@ -390,10 +390,10 @@
- 5排
{{ count }}列
2层 + 5排
{{ count }}列
2层
{{arr3['0205-'+((count) >= 10 ? (count) : '0'+(count)) +'-02']}}
@@ -410,10 +410,10 @@
- 5排
{{ (count+12) }}列
2层 + 5排
{{ (count+12) }}列
2层
{{arr3['0205-'+((count+12) >= 10 ? (count+12) : '0'+(count+12)) +'-02']}}
@@ -432,10 +432,10 @@
- 5排
{{ count }}列
1层 + 5排
{{ count }}列
1层
{{arr3['0205-'+((count) >= 10 ? (count) : '0'+(count)) +'-01']}}
@@ -459,10 +459,10 @@
- 5排
{{ (count+12) }}列
1层 + 5排
{{ (count+12) }}列
1层
{{arr3['0205-'+((count+12) >= 10 ? (count+12) : '0'+(count+12)) +'-01']}}
@@ -482,10 +482,10 @@
- 6排
{{ count }}列
2层 + 6排
{{ count }}列
2层
{{arr3['0206-'+((count) >= 10 ? (count) : '0'+(count)) +'-02']}}
@@ -502,10 +502,10 @@
- 6排
{{ (count+12) }}列
2层 + 6排
{{ (count+12) }}列
2层
{{arr3['0206-'+((count+12) >= 10 ? (count+12) : '0'+(count+12)) +'-02']}}
@@ -524,10 +524,10 @@
- 6排
{{ count }}列
1层 + 6排
{{ count }}列
1层
{{arr3['0206-'+((count) >= 10 ? (count) : '0'+(count)) +'-01']}}
@@ -551,10 +551,10 @@
- 6排
{{ (count+12) }}列
1层 + 6排
{{ (count+12) }}列
1层
{{arr3['0206-'+((count+12) >= 10 ? (count+12) : '0'+(count+12)) +'-01']}}
@@ -574,10 +574,10 @@
- 7排
{{ count }}列
2层 + 7排
{{ count }}列
2层
{{arr3['0207-'+((count) >= 10 ? (count) : '0'+(count)) +'-02']}}
@@ -594,10 +594,10 @@
- 7排
{{ (count+12) }}列
2层 + 7排
{{ (count+12) }}列
2层
{{arr3['0207-'+((count+12) >= 10 ? (count+12) : '0'+(count+12)) +'-02']}}
@@ -616,10 +616,10 @@
- 7排
{{ count }}列
1层 + 7排
{{ count }}列
1层
{{arr3['0207-'+((count) >= 10 ? (count) : '0'+(count)) +'-01']}}
@@ -643,10 +643,10 @@
- 7排
{{ (count+12) }}列
1层 + 7排
{{ (count+12) }}列
1层
{{arr3['0207-'+((count+12) >= 10 ? (count+12) : '0'+(count+12)) +'-01']}}
@@ -666,10 +666,10 @@
- 8排
{{ count }}列
2层 + 8排
{{ count }}列
2层
{{arr3['0208-'+((count) >= 10 ? (count) : '0'+(count)) +'-02']}}
@@ -686,10 +686,10 @@
- 8排
{{ (count+12) }}列
2层 + 8排
{{ (count+12) }}列
2层
{{arr3['0208-'+((count+12) >= 10 ? (count+12) : '0'+(count+12)) +'-02']}}
@@ -708,10 +708,10 @@
- 8排
{{ count }}列
1层 + 8排
{{ count }}列
1层
{{arr3['0208-'+((count) >= 10 ? (count) : '0'+(count)) +'-01']}}
@@ -735,10 +735,10 @@
- 8排
{{ (count+12) }}列
1层 + 8排
{{ (count+12) }}列
1层
{{arr3['0208-'+((count+12) >= 10 ? (count+12) : '0'+(count+12)) +'-01']}}
@@ -758,10 +758,10 @@
- 9排
{{ (count) }}列
2层 + 9排
{{ (count) }}列
2层
{{arr3['0209-'+((count) >= 10 ? (count) : '0'+(count)) +'-02']}}
@@ -787,10 +787,10 @@
- 9排
{{ (count) }}列
1层 + 9排
{{ (count) }}列
1层
{{arr3['0209-'+((count) >= 10 ? (count) : '0'+(count)) +'-01']}}
@@ -810,10 +810,10 @@
- 10排
{{ (count+12) }}列
2层 + 10排
{{ (count+12) }}列
2层
{{arr3['0210-'+((count) >= 10 ? (count) : '0'+(count)) +'-02']}}
@@ -839,10 +839,10 @@
- 10排
{{ (count) }}列
1层 + 10排
{{ (count) }}列
1层
{{arr3['0210-'+((count) >= 10 ? (count) : '0'+(count)) +'-01']}}
@@ -862,10 +862,10 @@
- 11排
{{ (count) }}列
2层 + 11排
{{ (count) }}列
2层
{{arr3['0211-'+((count) >= 10 ? (count) : '0'+(count)) +'-02']}}
@@ -891,10 +891,10 @@
- 11排
{{ (count) }}列
1层 + 11排
{{ (count) }}列
1层
{{arr3['0211-'+((count) >= 10 ? (count) : '0'+(count)) +'-01']}}
@@ -927,6 +927,7 @@ export default { '0201-06-02': 'green' }, arr2: {}, + arr3: {}, width: '2500', div_width: '43', div_height: '60', @@ -943,6 +944,10 @@ export default { dis.queryInfoByCode().then(res => { this.arr2 = res }) + dis.queryMaterial().then(res => { + debugger + this.arr3 = res + }) }, 10000) // 销毁定时器 this.$once('hook:beforeDestroy', () => { @@ -954,12 +959,12 @@ export default { const params = this.arr2[data] let str = '' str = '货位:' + data + - '
载具:' + params['vehicle_code'] + + '
载具:' + params['vehicle_code'] + '
' + '物料名称:' + params['material_name'] + '
' + '物料编码:' + params['material_code'] + '
' + '物料规格:' + params['material_spec'] + '
' + '入库时间:' + params['instorage_time'] + - '
' + '批次:' + params['pcsn'] + '
' + '批次:' + params['pcsn'] return str } }