rev:修改
This commit is contained in:
@@ -15,6 +15,8 @@ import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@@ -40,4 +42,10 @@ public class StructIvtController {
|
||||
public ResponseEntity<Object> query(@RequestParam Map whereJson, PageQuery page) {
|
||||
return new ResponseEntity<>(TableDataInfo.build(iMdPbStoragevehicleextService.queryAll(whereJson, page)), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Log("导出数据")
|
||||
@GetMapping(value = "/download")
|
||||
public void download(@RequestParam Map map, HttpServletResponse response, String[] product_area) throws IOException {
|
||||
iMdPbStoragevehicleextService.download(map, response, product_area);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,8 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.wms.basedata_manage.service.dao.MdPbStoragevehicleext;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -43,4 +45,7 @@ public interface IMdPbStoragevehicleextService extends IService<MdPbStoragevehic
|
||||
* }
|
||||
*/
|
||||
void updateIvt(List<JSONObject> updateIvtList);
|
||||
|
||||
void download(Map map, HttpServletResponse response, String[] product_area) throws IOException;
|
||||
|
||||
}
|
||||
|
||||
@@ -54,6 +54,13 @@ public interface MdPbStoragevehicleextMapper extends BaseMapper<MdPbStoragevehic
|
||||
*/
|
||||
IPage<JSONObject> queryAllByPage(Page<JSONObject> page, @Param("param") Map whereJson);
|
||||
|
||||
/**
|
||||
* 导出查询
|
||||
* @param whereJson 查询条件
|
||||
* @return IPage<StIvtMoveinv>
|
||||
*/
|
||||
List<JSONObject> queryAllByPageDownload(@Param("param") Map whereJson);
|
||||
|
||||
/**
|
||||
* erp查询库存
|
||||
* @param whereJson {
|
||||
|
||||
@@ -167,6 +167,64 @@
|
||||
ORDER BY ext.insert_time Desc
|
||||
</select>
|
||||
|
||||
<select id="queryAllByPageDownload" resultType="com.alibaba.fastjson.JSONObject">
|
||||
SELECT
|
||||
ext.storagevehicleext_id,
|
||||
ext.storagevehicle_code,
|
||||
ext.pcsn,
|
||||
ext.qty_unit_name,
|
||||
ext.canuse_qty,
|
||||
ext.frozen_qty,
|
||||
ext.remark,
|
||||
ext.insert_time,
|
||||
attr.struct_code,
|
||||
attr.struct_name,
|
||||
attr.stor_name,
|
||||
attr.sect_name,
|
||||
attr.lock_type,
|
||||
attr.block_num,
|
||||
mater.material_id,
|
||||
mater.material_code,
|
||||
mater.material_name,
|
||||
mater.material_spec,
|
||||
class.class_name
|
||||
FROM
|
||||
md_pb_storagevehicleext ext
|
||||
INNER JOIN st_ivt_structattr attr ON ext.storagevehicle_code = attr.storagevehicle_code
|
||||
INNER JOIN md_me_materialbase mater ON mater.material_id = ext.material_id
|
||||
LEFT JOIN md_pb_classstandard class ON mater.material_type_id = class.class_id
|
||||
<where>
|
||||
1 = 1
|
||||
<if test="param.stor_id != null and param.stor_id != ''">
|
||||
AND
|
||||
attr.stor_id = #{param.stor_id}
|
||||
</if>
|
||||
|
||||
<if test="param.sect_id != null and param.sect_id != ''">
|
||||
AND
|
||||
attr.sect_id = #{param.sect_id}
|
||||
</if>
|
||||
|
||||
<if test="param.struct_code != null and param.struct_code != ''">
|
||||
AND
|
||||
(attr.struct_code LIKE #{param.struct_code} or
|
||||
attr.struct_name LIKE #{param.struct_code} )
|
||||
</if>
|
||||
|
||||
<if test="param.material_code != null and param.material_code != ''">
|
||||
AND
|
||||
(mater.material_code LIKE #{param.material_code} or
|
||||
mater.material_name LIKE #{param.material_code} )
|
||||
</if>
|
||||
|
||||
<if test="param.pcsn != null and param.pcsn != ''">
|
||||
AND
|
||||
ext.pcsn LIKE #{param.pcsn}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY ext.insert_time Desc
|
||||
</select>
|
||||
|
||||
<select id="queryCanuseSum" resultType="java.math.BigDecimal">
|
||||
SELECT
|
||||
SUM(canuse_qty)
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.utils.FileUtil;
|
||||
import org.nl.wms.basedata_manage.service.IMdPbStoragevehicleextService;
|
||||
import org.nl.wms.basedata_manage.service.dao.MdPbStoragevehicleext;
|
||||
import org.nl.wms.basedata_manage.service.dao.mapper.MdPbStoragevehicleextMapper;
|
||||
@@ -12,6 +13,10 @@ import org.nl.wms.warehouse_management.service.util.UpdateIvtUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -44,4 +49,30 @@ public class MdPbStoragevehicleextServiceImpl extends ServiceImpl<MdPbStorageveh
|
||||
updateIvtUtils.updateIvt(json);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void download(Map map, HttpServletResponse response, String[] product_area) throws IOException {
|
||||
List<JSONObject> dataList = this.baseMapper.queryAllByPageDownload(map);
|
||||
List<Map<String, Object>> list = new ArrayList<>();
|
||||
|
||||
for (int i = 0; i < dataList.size(); i++) {
|
||||
JSONObject jsonObject = dataList.get(i);
|
||||
Map<String, Object> mp = new LinkedHashMap<>();
|
||||
mp.put("仓位编码", jsonObject.getString("struct_code"));
|
||||
mp.put("仓位名称", jsonObject.getString("struct_name"));
|
||||
mp.put("仓库", jsonObject.getString("stor_name"));
|
||||
mp.put("库区", jsonObject.getString("sect_name"));
|
||||
mp.put("物料编码", jsonObject.getString("material_code"));
|
||||
mp.put("物料名称", jsonObject.getString("material_name"));
|
||||
mp.put("物料类别", jsonObject.getString("class_name"));
|
||||
mp.put("批次号", jsonObject.getString("pcsn"));
|
||||
mp.put("载具号", jsonObject.getString("storagevehicle_code"));
|
||||
mp.put("可用数", jsonObject.getString("canuse_qty"));
|
||||
mp.put("冻结数", jsonObject.getString("frozen_qty"));
|
||||
mp.put("计量单位", jsonObject.getString("qty_unit_name"));
|
||||
mp.put("入库时间", jsonObject.getString("insert_time"));
|
||||
list.add(mp);
|
||||
}
|
||||
FileUtil.downloadExcel(list, response);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,8 +78,7 @@ public class NotCarToWmsServiceImpl implements NotCarToWmsService {
|
||||
boolean tryLock = lock.tryLock(0, TimeUnit.SECONDS);
|
||||
try {
|
||||
if (tryLock) {
|
||||
JSONObject request = whereJson.getJSONObject("request");
|
||||
JSONObject data = request.getJSONObject("data");
|
||||
JSONObject data = whereJson.getJSONObject("data");
|
||||
String statusType = data.getString("statusType");
|
||||
if (statusType.equals(IOSConstant.ZERO)) {
|
||||
// 判断任务号是否一致
|
||||
|
||||
@@ -86,7 +86,7 @@ public class CenterInTask extends AbstractTask {
|
||||
acsTaskDto.setExt_task_id(taskDao.getTask_id());
|
||||
acsTaskDto.setTask_code(taskDao.getTask_code());
|
||||
// 对应关系CZJT01 : CZJT03,CZJT02 : CZJT04
|
||||
acsTaskDto.setStart_device_code(IOSEnum.CZW_SHIP.code(taskDao.getPoint_code1()));
|
||||
acsTaskDto.setStart_device_code(taskDao.getPoint_code1());
|
||||
acsTaskDto.setNext_device_code(taskDao.getPoint_code2());
|
||||
acsTaskDto.setVehicle_code(taskDao.getVehicle_code());
|
||||
|
||||
|
||||
@@ -136,7 +136,7 @@ public class IntermediateOutTask extends AbstractTask {
|
||||
acsTaskDto.setTask_code(taskDao.getTask_code());
|
||||
acsTaskDto.setStart_device_code(taskDao.getPoint_code1());
|
||||
// 对应关系CZJT01 : CZJT03,CZJT02 : CZJT04
|
||||
acsTaskDto.setNext_device_code(IOSEnum.CZW_SHIP.code(taskDao.getPoint_code2()));
|
||||
acsTaskDto.setNext_device_code(taskDao.getPoint_code2());
|
||||
acsTaskDto.setPriority(taskDao.getPriority());
|
||||
acsTaskDto.setVehicle_code(taskDao.getVehicle_code());
|
||||
|
||||
|
||||
@@ -15,6 +15,8 @@ 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;
|
||||
import java.util.Set;
|
||||
|
||||
@@ -75,4 +77,10 @@ public class MoreOrlessController {
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Log("导出数据")
|
||||
@GetMapping(value = "/download")
|
||||
public void download(@RequestParam Map map, HttpServletResponse response, String[] product_area) throws IOException {
|
||||
iStIvtMoreorlessmstService.download(map, response, product_area);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -7,6 +7,8 @@ import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.wms.warehouse_management.service.dao.StIvtMoreorlessmst;
|
||||
import org.nl.wms.warehouse_management.service.dto.MoreOrLessInsertDto;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
@@ -61,4 +63,7 @@ public interface IStIvtMoreorlessmstService extends IService<StIvtMoreorlessmst>
|
||||
* @param dao 主表实体类
|
||||
*/
|
||||
void confirm(StIvtMoreorlessmst dao);
|
||||
|
||||
void download(Map map, HttpServletResponse response, String[] product_area) throws IOException;
|
||||
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.nl.wms.warehouse_management.service.dao.StIvtMoreorlessmst;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
@@ -26,4 +27,11 @@ public interface StIvtMoreorlessmstMapper extends BaseMapper<StIvtMoreorlessmst>
|
||||
* @return IPage<JSONObject>
|
||||
*/
|
||||
IPage<JSONObject> queryAllByPage(Page<JSONObject> page,@Param("param") Map whereJson);
|
||||
|
||||
/**
|
||||
* 导出查询
|
||||
* @param whereJson 查询条件
|
||||
* @return IPage<JSONObject>
|
||||
*/
|
||||
List<JSONObject> queryAllByPageDownload(@Param("param") Map whereJson);
|
||||
}
|
||||
|
||||
@@ -52,4 +52,54 @@
|
||||
ORDER BY ios.input_time Desc
|
||||
</select>
|
||||
|
||||
<select id="queryAllByPageDownload" resultType="com.alibaba.fastjson.JSONObject">
|
||||
SELECT
|
||||
ios.*
|
||||
FROM
|
||||
st_ivt_moreorlessmst ios
|
||||
LEFT JOIN st_ivt_moreorlessdtl dtl ON ios.mol_id = dtl.mol_id
|
||||
<where>
|
||||
ios.is_delete = '0'
|
||||
<if test="param.mol_code != null and param.mol_code != ''">
|
||||
AND
|
||||
ios.mol_code LIKE #{param.mol_code}
|
||||
</if>
|
||||
|
||||
<if test="param.stor_id != null and param.stor_id != ''">
|
||||
AND
|
||||
ios.stor_id = #{param.stor_id}
|
||||
</if>
|
||||
|
||||
<if test="param.struct_code != null and param.struct_code != ''">
|
||||
AND
|
||||
dtl.struct_code LIKE #{param.struct_code}
|
||||
</if>
|
||||
|
||||
<if test="param.mol_type != null and param.mol_type != ''">
|
||||
AND
|
||||
ios.mol_type = #{param.mol_type}
|
||||
</if>
|
||||
|
||||
<if test="param.mol_inv_type != null and param.mol_inv_type != ''">
|
||||
AND
|
||||
ios.mol_inv_type = #{param.mol_inv_type}
|
||||
</if>
|
||||
|
||||
<if test="param.status != null and param.status != ''">
|
||||
AND
|
||||
ios.status = #{param.status}
|
||||
</if>
|
||||
|
||||
<if test="param.begin_time != null and param.begin_time != ''">
|
||||
AND
|
||||
ios.input_time >= #{param.begin_time}
|
||||
</if>
|
||||
<if test="param.end_time != null and param.end_time != ''">
|
||||
AND
|
||||
#{param.end_time} >= ios.input_time
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY ios.input_time Desc
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.utils.CodeUtil;
|
||||
import org.nl.common.utils.FileUtil;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.wms.warehouse_management.enums.IOSConstant;
|
||||
@@ -24,9 +25,9 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -155,4 +156,39 @@ public class StIvtMoreorlessmstServiceImpl extends ServiceImpl<StIvtMoreorlessms
|
||||
.set(StIvtMoreorlessdtl::getStatus, IOSEnum.MORE_MST_STATUS.code("完成"))
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void download(Map map, HttpServletResponse response, String[] product_area) throws IOException {
|
||||
List<JSONObject> dataList = this.baseMapper.queryAllByPageDownload(map);
|
||||
List<Map<String, Object>> list = new ArrayList<>();
|
||||
|
||||
for (int i = 0; i < dataList.size(); i++) {
|
||||
JSONObject jsonObject = dataList.get(i);
|
||||
Map<String, Object> mp = new LinkedHashMap<>();
|
||||
mp.put("损溢单号", jsonObject.getString("mol_code"));
|
||||
String mol_inv_type = jsonObject.getString("mol_inv_type");
|
||||
if (mol_inv_type.equals("1001")) {
|
||||
mp.put("单据类型", "手工损溢");
|
||||
}
|
||||
if (mol_inv_type.equals("1002")) {
|
||||
mp.put("单据类型", "盘点损溢");
|
||||
}
|
||||
String mol_type = jsonObject.getString("mol_type");
|
||||
if (mol_type.equals(IOSConstant.ONE)) {
|
||||
mp.put("损益类型", "损");
|
||||
}
|
||||
if (mol_type.equals(IOSConstant.TWO)) {
|
||||
mp.put("损益类型", "溢");
|
||||
}
|
||||
|
||||
mp.put("明细数", jsonObject.getString("dtl_num"));
|
||||
mp.put("损益重量", jsonObject.getString("total_qty"));
|
||||
mp.put("制单人", jsonObject.getString("input_optname"));
|
||||
mp.put("制单时间", jsonObject.getString("input_time"));
|
||||
mp.put("确认人", jsonObject.getString("confirm_optname"));
|
||||
mp.put("确认时间", jsonObject.getString("confirm_time"));
|
||||
list.add(mp);
|
||||
}
|
||||
FileUtil.downloadExcel(list, response);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -128,6 +128,17 @@
|
||||
>
|
||||
强制确认
|
||||
</el-button>
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="success"
|
||||
icon="el-icon-thumb"
|
||||
size="mini"
|
||||
:loading="showDtlLoading"
|
||||
@click="down"
|
||||
>
|
||||
导出
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
@@ -198,6 +209,8 @@ import DateRangePicker from '@/components/DateRangePicker/index'
|
||||
import AddDialog from '@/views/wms/st/moreorlessbill/AddDialog'
|
||||
import { mapGetters } from 'vuex'
|
||||
import crudStorattr from '@/views/wms/basedata/bsrealstorattr/bsrealstorattr'
|
||||
import {download} from "@/api/data";
|
||||
import {downloadFile} from "@/utils";
|
||||
|
||||
export default {
|
||||
name: 'MoreOrLess',
|
||||
@@ -227,6 +240,7 @@ export default {
|
||||
del: ['admin', 'user:del']
|
||||
},
|
||||
confirm_flag: true,
|
||||
showDtlLoading: false,
|
||||
currentRow: null,
|
||||
storlist: [],
|
||||
statuslist: []
|
||||
@@ -316,6 +330,22 @@ export default {
|
||||
this.crud.notify('单据确认成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.refresh()
|
||||
})
|
||||
},
|
||||
down() {
|
||||
if (this.currentRow !== null) {
|
||||
const data = this.crud.query
|
||||
if (this.crud.query.createTime !== undefined) {
|
||||
data.begin_time = this.crud.query.createTime[0]
|
||||
data.end_time = this.crud.query.createTime[1]
|
||||
}
|
||||
this.showDtlLoading = true
|
||||
download('/api/moreorLess/download', data).then(result => {
|
||||
downloadFile(result, '损益数据', 'xlsx')
|
||||
this.showDtlLoading = false
|
||||
}).catch(() => {
|
||||
this.showDtlLoading = false
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission">
|
||||
<!-- <el-button
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="success"
|
||||
@@ -67,7 +67,7 @@
|
||||
@click="downdtl"
|
||||
>
|
||||
导出Excel
|
||||
</el-button>-->
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
@@ -137,6 +137,7 @@ export default {
|
||||
openParam: null,
|
||||
bagDialog: false,
|
||||
showModal: false,
|
||||
showDtlLoading: false,
|
||||
imageUrl: '',
|
||||
permission: {},
|
||||
rules: {}
|
||||
@@ -189,7 +190,7 @@ export default {
|
||||
if (this.currentRow !== null) {
|
||||
this.showDtlLoading = true
|
||||
download('/api/structivt/download', this.crud.query).then(result => {
|
||||
downloadFile(result, '成品库存', 'xlsx')
|
||||
downloadFile(result, '库存信息', 'xlsx')
|
||||
this.showDtlLoading = false
|
||||
}).catch(() => {
|
||||
this.showDtlLoading = false
|
||||
|
||||
Reference in New Issue
Block a user