add:新增导出功能
This commit is contained in:
@@ -231,7 +231,7 @@
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>easyexcel</artifactId>
|
||||
<version>2.1.6</version>
|
||||
<version>2.2.6</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.poi</groupId>
|
||||
|
||||
@@ -22,4 +22,9 @@ public class SysParamConstant {
|
||||
*/
|
||||
public final static String ERP_URL = "erp_url";
|
||||
|
||||
/**
|
||||
* 销售单、入库单打印模板
|
||||
*/
|
||||
public final static String EXCEL_TEMPLATE = "excel_template";
|
||||
|
||||
}
|
||||
|
||||
@@ -177,5 +177,10 @@ public class MdMeMaterialbase implements Serializable {
|
||||
*/
|
||||
private String ext_id;
|
||||
|
||||
/**
|
||||
* 物料单价
|
||||
*/
|
||||
private BigDecimal material_price;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -141,17 +141,32 @@
|
||||
</select>
|
||||
|
||||
<select id="queryOutAllocation" resultType="org.nl.wms.basedata_manage.service.dto.MdPbStoragevehicleextDto">
|
||||
SELECT ex.*,st.sect_id,st.sect_code,st.sect_name,st.struct_id,st.struct_code,st.struct_name
|
||||
FROM md_pb_storagevehicleext ex LEFT JOIN st_ivt_structattr st on ex.storagevehicle_code = st.storagevehicle_code
|
||||
SELECT
|
||||
ex.*,
|
||||
st.sect_id,
|
||||
st.sect_code,
|
||||
st.sect_name,
|
||||
st.struct_id,
|
||||
st.struct_code,
|
||||
st.struct_name,
|
||||
late.cust_code,
|
||||
late.contract_code
|
||||
FROM
|
||||
md_pb_storagevehicleext ex
|
||||
INNER JOIN st_ivt_structattr st on ex.storagevehicle_code = st.storagevehicle_code
|
||||
INNER JOIN md_pb_groupplate late on late.storagevehicle_code = ex.storagevehicle_code
|
||||
AND late.pcsn = ex.pcsn AND late.material_id = ex.material_id
|
||||
<where>
|
||||
material_id = #{material_id}
|
||||
ex.material_id = #{material_id}
|
||||
AND
|
||||
ex.canuse_qty > 0
|
||||
AND
|
||||
st.lock_type = 0
|
||||
AND
|
||||
late.status = '02'
|
||||
<if test="pcsn!= null and pcsn!= ''">
|
||||
AND
|
||||
pcsn = #{pcsn}
|
||||
ex.pcsn = #{pcsn}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY ex.insert_time,ex.canuse_qty
|
||||
|
||||
@@ -45,4 +45,14 @@ public class MdPbStoragevehicleextDto extends MdPbStoragevehicleext{
|
||||
*/
|
||||
private String material_name;
|
||||
|
||||
/**
|
||||
* 客户编码
|
||||
*/
|
||||
private String cust_code;
|
||||
|
||||
/**
|
||||
* 合同编码
|
||||
*/
|
||||
private String contract_code;
|
||||
|
||||
}
|
||||
|
||||
@@ -95,4 +95,11 @@ public class PdaIosInController {
|
||||
return new ResponseEntity<>(pdaIosInService.groupPlateTwo(whereJson),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/getCust")
|
||||
@Log("获取客户下拉框")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> getCust() {
|
||||
return new ResponseEntity<>(pdaIosInService.getCust(),HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -91,6 +91,8 @@ public interface PdaIosInService {
|
||||
* pcsn: 批次
|
||||
* qty: 数量
|
||||
* prison_area: 监区
|
||||
* cust_code:客户编码
|
||||
* contract_code:合同编码
|
||||
* }
|
||||
* @return PdaResponse
|
||||
*/
|
||||
@@ -105,4 +107,10 @@ public interface PdaIosInService {
|
||||
* @return PdaResponse
|
||||
*/
|
||||
PdaResponse handIn(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 获取客户
|
||||
* @return PdaResponse
|
||||
*/
|
||||
PdaResponse getCust();
|
||||
}
|
||||
|
||||
@@ -100,6 +100,12 @@ public class PdaIosInServiceImpl implements PdaIosInService {
|
||||
@Autowired
|
||||
private IStructattrService iStructattrService;
|
||||
|
||||
/**
|
||||
* 客户服务
|
||||
*/
|
||||
@Autowired
|
||||
private IMdCsCustomerbaseService iMdCsCustomerbaseService;
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public PdaResponse sweepCode(JSONObject whereJson) {
|
||||
@@ -312,6 +318,8 @@ public class PdaIosInServiceImpl implements PdaIosInService {
|
||||
groupDao.setCreate_time(DateUtil.now());
|
||||
groupDao.setExt_type(whereJson.getString("ext_type"));
|
||||
groupDao.setExt_code(whereJson.getString("ext_code"));
|
||||
groupDao.setCust_code(whereJson.getString("cust_code"));
|
||||
groupDao.setContract_code(whereJson.getString("contract_code"));
|
||||
groupDao.setPrison_area(whereJson.getString("prison_area"));
|
||||
iMdPbGroupplateService.save(groupDao);
|
||||
return PdaResponse.requestOk();
|
||||
@@ -368,6 +376,16 @@ public class PdaIosInServiceImpl implements PdaIosInService {
|
||||
return PdaResponse.requestOk();
|
||||
}
|
||||
|
||||
@Override
|
||||
public PdaResponse getCust() {
|
||||
List<MdCsCustomerbase> list = iMdCsCustomerbaseService.list(
|
||||
new QueryWrapper<MdCsCustomerbase>().lambda()
|
||||
.eq(MdCsCustomerbase::getIs_delete, IOSConstant.IS_DELETE_NO)
|
||||
.eq(MdCsCustomerbase::getIs_used, IOSConstant.IS_DELETE_YES)
|
||||
);
|
||||
return PdaResponse.requestParamOk(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 组织入库插入数据
|
||||
*
|
||||
@@ -413,6 +431,8 @@ public class PdaIosInServiceImpl implements PdaIosInService {
|
||||
dtl.put("storagevehicle_code", plateDao.getStoragevehicle_code());
|
||||
dtl.put("material_id", plateDao.getMaterial_id());
|
||||
dtl.put("pcsn", plateDao.getPcsn());
|
||||
dtl.put("contract_code", plateDao.getContract_code());
|
||||
dtl.put("cust_code", plateDao.getCust_code());
|
||||
dtl.put("qty_unit_id", plateDao.getQty_unit_id());
|
||||
dtl.put("qty_unit_name", plateDao.getQty_unit_name());
|
||||
dtl.put("qty", String.valueOf(total_qty));
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package org.nl.wms.warehouse_management.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -8,7 +7,6 @@ import org.nl.common.base.TableDataInfo;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.logging.annotation.Log;
|
||||
import org.nl.wms.warehouse_management.service.IRawAssistIStorService;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -91,4 +91,14 @@ public class GroupPlate implements Serializable {
|
||||
* 监区(A1/A2/A3/A4/A5/A6/A7/A9/A10/A11/A12/A14)
|
||||
*/
|
||||
private String prison_area;
|
||||
|
||||
/**
|
||||
* 客户编码
|
||||
*/
|
||||
private String cust_code;
|
||||
|
||||
/**
|
||||
* 合同编码
|
||||
*/
|
||||
private String contract_code;
|
||||
}
|
||||
|
||||
@@ -122,4 +122,14 @@ public class IOStorInvDis implements Serializable {
|
||||
*/
|
||||
private String point_code;
|
||||
|
||||
/**
|
||||
* 客户编码
|
||||
*/
|
||||
private String cust_code;
|
||||
|
||||
/**
|
||||
* 合同编码
|
||||
*/
|
||||
private String contract_code;
|
||||
|
||||
}
|
||||
|
||||
@@ -408,6 +408,8 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
|
||||
ioStorInvDis.setIs_issued(BaseDataEnum.IS_YES_NOT.code("否"));
|
||||
ioStorInvDis.setQty_unit_id(outAllocation.getQty_unit_id());
|
||||
ioStorInvDis.setQty_unit_name(outAllocation.getQty_unit_name());
|
||||
ioStorInvDis.setCust_code(outAllocation.getCust_code());
|
||||
ioStorInvDis.setContract_code(outAllocation.getContract_code());
|
||||
ioStorInvDis.setWork_status(IOSEnum.INBILL_DIS_STATUS.code("未生成"));
|
||||
|
||||
// 未分配数量 - 该库位上的可用数量 < 0 目前做整出
|
||||
@@ -623,6 +625,8 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
|
||||
ioStorInvDis.setIs_issued(BaseDataEnum.IS_YES_NOT.code("否"));
|
||||
ioStorInvDis.setQty_unit_id(outAllocation.getQty_unit_id());
|
||||
ioStorInvDis.setQty_unit_name(outAllocation.getQty_unit_name());
|
||||
ioStorInvDis.setCust_code(outAllocation.getCust_code());
|
||||
ioStorInvDis.setContract_code(outAllocation.getContract_code());
|
||||
ioStorInvDis.setWork_status(IOSEnum.INBILL_DIS_STATUS.code("未生成"));
|
||||
|
||||
// 未分配数量 - 该库位上的可用数量 < 0 目前做整出
|
||||
|
||||
@@ -2,10 +2,14 @@ package org.nl.wms.warehouse_management.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
import com.alibaba.excel.ExcelWriter;
|
||||
import com.alibaba.excel.write.metadata.WriteSheet;
|
||||
import com.alibaba.excel.write.metadata.fill.FillWrapper;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
@@ -16,28 +20,26 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
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.config.SpringContextHolder;
|
||||
import org.nl.system.enums.SysParamConstant;
|
||||
import org.nl.system.service.param.dao.Param;
|
||||
import org.nl.system.service.param.impl.SysParamServiceImpl;
|
||||
import org.nl.wms.basedata_manage.enums.BaseDataEnum;
|
||||
import org.nl.wms.basedata_manage.service.IBsrealStorattrService;
|
||||
import org.nl.wms.basedata_manage.service.IMdPbStoragevehicleextService;
|
||||
import org.nl.wms.basedata_manage.service.IStructattrService;
|
||||
import org.nl.wms.basedata_manage.service.dao.BsrealStorattr;
|
||||
import org.nl.wms.basedata_manage.service.dao.MdPbStoragevehicleinfo;
|
||||
import org.nl.wms.basedata_manage.service.dao.Structattr;
|
||||
import org.nl.wms.basedata_manage.service.*;
|
||||
import org.nl.wms.basedata_manage.service.dao.*;
|
||||
import org.nl.wms.basedata_manage.service.dao.mapper.MdPbStoragevehicleinfoMapper;
|
||||
import org.nl.wms.sch_manage.service.dao.SchBasePoint;
|
||||
import org.nl.wms.sch_manage.service.dao.SchBaseTask;
|
||||
import org.nl.wms.sch_manage.service.dao.mapper.SchBasePointMapper;
|
||||
import org.nl.wms.sch_manage.service.util.AbstractTask;
|
||||
import org.nl.wms.sch_manage.service.util.tasks.StInTask;
|
||||
import org.nl.wms.warehouse_management.enums.IOSConstant;
|
||||
import org.nl.wms.warehouse_management.enums.IOSEnum;
|
||||
import org.nl.wms.warehouse_management.service.IRawAssistIStorService;
|
||||
import org.nl.wms.warehouse_management.service.dao.*;
|
||||
import org.nl.wms.warehouse_management.service.dao.GroupPlate;
|
||||
import org.nl.wms.warehouse_management.service.dao.IOStorInv;
|
||||
import org.nl.wms.warehouse_management.service.dao.IOStorInvDis;
|
||||
import org.nl.wms.warehouse_management.service.dao.IOStorInvDtl;
|
||||
import org.nl.wms.warehouse_management.service.dao.mapper.GroupPlateMapper;
|
||||
import org.nl.wms.warehouse_management.service.dao.mapper.IOStorInvDisMapper;
|
||||
import org.nl.wms.warehouse_management.service.dao.mapper.IOStorInvDtlMapper;
|
||||
@@ -45,11 +47,11 @@ import org.nl.wms.warehouse_management.service.dao.mapper.IOStorInvMapper;
|
||||
import org.nl.wms.warehouse_management.service.dto.GroupPlateDto;
|
||||
import org.nl.wms.warehouse_management.service.dto.IOStorInvDisDto;
|
||||
import org.nl.wms.warehouse_management.service.dto.IOStorInvDtlDto;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.ServletOutputStream;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.math.BigDecimal;
|
||||
@@ -90,6 +92,12 @@ public class RawAssistIStorServiceImpl extends ServiceImpl<IOStorInvMapper, IOSt
|
||||
@Resource
|
||||
private GroupPlateMapper groupPlateMapper;
|
||||
|
||||
@Resource
|
||||
private IMdMeMaterialbaseService iMdMeMaterialbaseService;
|
||||
|
||||
@Resource
|
||||
private IMdCsCustomerbaseService iMdCsCustomerbaseService;
|
||||
|
||||
@Override
|
||||
public IPage<IOStorInv> pageQuery(Map whereJson, PageQuery page) {
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
@@ -218,6 +226,8 @@ public class RawAssistIStorServiceImpl extends ServiceImpl<IOStorInvMapper, IOSt
|
||||
dis.put("qty_unit_id", row.get("qty_unit_id"));
|
||||
dis.put("qty_unit_name", row.get("qty_unit_name"));
|
||||
dis.put("plan_qty", row.get("plan_qty"));
|
||||
dis.put("cust_code", row.get("cust_code"));
|
||||
dis.put("contract_code", row.get("contract_code"));
|
||||
|
||||
ioStorInvDisMapper.insert(dis.toJavaObject(IOStorInvDis.class));
|
||||
}
|
||||
@@ -778,65 +788,105 @@ public class RawAssistIStorServiceImpl extends ServiceImpl<IOStorInvMapper, IOSt
|
||||
@Override
|
||||
@Transactional
|
||||
public void download(Map whereJson, HttpServletResponse response) throws IOException {
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
map.put("buss_type", (String) whereJson.get("buss_type"));
|
||||
map.put("stor_id", (String) whereJson.get("stor_id"));
|
||||
map.put("bill_type", (String) whereJson.get("bill_type"));
|
||||
map.put("create_mode", (String) whereJson.get("create_mode"));
|
||||
map.put("bill_status", (String) whereJson.get("bill_status"));
|
||||
|
||||
String bill_code = MapUtil.getStr(whereJson, "bill_code");
|
||||
String pcsn = MapUtil.getStr(whereJson, "pcsn");
|
||||
|
||||
if (!ObjectUtil.isEmpty(bill_code)) {
|
||||
map.put("bill_code", "%" + bill_code + "%");
|
||||
// --------------组织数据--------------
|
||||
IOStorInv mstDao = this.ioStorInvMapper.selectById(whereJson.get("iostorinv_id").toString());
|
||||
if (!mstDao.getBill_status().equals(IOSEnum.BILL_STATUS.code("完成"))) {
|
||||
throw new BadRequestException("单据未完成!");
|
||||
}
|
||||
|
||||
// 空格查询
|
||||
if (StrUtil.isNotEmpty(pcsn)) {
|
||||
// 判断是否有空格
|
||||
boolean matches = pcsn.matches(".*\\s.*");
|
||||
|
||||
if (matches) {
|
||||
String[] s = pcsn.split(" ");
|
||||
String pcsn_in = String.join("','", Arrays.asList(s));
|
||||
|
||||
map.put("pcsn_in", "('"+pcsn_in+"')");
|
||||
} else {
|
||||
map.put("pcsn", "%" + pcsn + "%");
|
||||
}
|
||||
// 查询明细
|
||||
List<IOStorInvDtl> dtlList = ioStorInvDtlMapper.selectList(
|
||||
new QueryWrapper<IOStorInvDtl>().lambda()
|
||||
.eq(IOStorInvDtl::getIostorinv_id, mstDao.getIostorinv_id())
|
||||
);
|
||||
// 查询分配明细
|
||||
List<IOStorInvDis> disDaoList = ioStorInvDisMapper.selectList(
|
||||
new QueryWrapper<IOStorInvDis>().lambda()
|
||||
.eq(IOStorInvDis::getIostorinv_id, mstDao.getIostorinv_id())
|
||||
);
|
||||
// 查询物料
|
||||
List<MdMeMaterialbase> materList = iMdMeMaterialbaseService.list(
|
||||
new QueryWrapper<MdMeMaterialbase>().lambda()
|
||||
.in(MdMeMaterialbase::getMaterial_id, disDaoList.stream()
|
||||
.map(IOStorInvDis::getMaterial_id)
|
||||
.distinct()
|
||||
.collect(Collectors.toList()))
|
||||
);
|
||||
if (ObjectUtil.isEmpty(materList)) {
|
||||
throw new BadRequestException("未查询到相关物料信息!");
|
||||
}
|
||||
|
||||
String begin_time = (String) whereJson.get("begin_time");
|
||||
// 查询客户
|
||||
List<MdCsCustomerbase> custList = iMdCsCustomerbaseService.list(
|
||||
new QueryWrapper<MdCsCustomerbase>().lambda()
|
||||
.in(MdCsCustomerbase::getCust_code, disDaoList.stream()
|
||||
.map(IOStorInvDis::getCust_code)
|
||||
.distinct()
|
||||
.collect(Collectors.toList())));
|
||||
if (ObjectUtil.isEmpty(custList)) {
|
||||
throw new BadRequestException("未查询到相关客户信息!");
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
List<JSONObject> disList = ioStorInvMapper.queryAlldownload(map);
|
||||
// excel多组填充
|
||||
ArrayList<HashMap<String, Object>> flData = new ArrayList<>();
|
||||
double sum_qty = 0.00;
|
||||
for (IOStorInvDtl dtlDao : dtlList) {
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
// 查询一条分配明细
|
||||
IOStorInvDis disDao = disDaoList.stream()
|
||||
.filter(row -> row.getIostorinvdtl_id().equals(dtlDao.getIostorinvdtl_id()))
|
||||
.findFirst().orElse(null);
|
||||
|
||||
// 客户
|
||||
MdCsCustomerbase custDao = custList.stream()
|
||||
.filter(row -> row.getCust_code().equals(disDao.getCust_code()))
|
||||
.findFirst().orElse(null);
|
||||
if (ObjectUtil.isEmpty(custDao)) {
|
||||
throw new BadRequestException("没有此编码【" + disDao.getCust_code() + "】客户");
|
||||
}
|
||||
map.put("cust_name", custDao.getCust_name());
|
||||
// 物料信息
|
||||
MdMeMaterialbase materDao = materList.stream()
|
||||
.filter(row -> row.getMaterial_id().equals(dtlDao.getMaterial_id()))
|
||||
.findFirst().orElse(null);
|
||||
if (ObjectUtil.isEmpty(materDao)) {
|
||||
throw new BadRequestException("没有此ID【" + dtlDao.getMaterial_id() + "】物料");
|
||||
}
|
||||
map.put("material_name", materDao.getMaterial_name());
|
||||
map.put("material_model", materDao.getMaterial_model());
|
||||
// 数量
|
||||
map.put("qty", dtlDao.getPlan_qty());
|
||||
// 单价
|
||||
map.put("price", NumberUtil.round(materDao.getMaterial_price(), 2));
|
||||
// 金额 = 单价 * 数量
|
||||
BigDecimal amount = NumberUtil.mul(materDao.getMaterial_price(), dtlDao.getPlan_qty());
|
||||
map.put("amount", NumberUtil.round(amount, 2));
|
||||
// 合同编号
|
||||
map.put("contract", disDao.getContract_code());
|
||||
sum_qty = NumberUtil.add(sum_qty, amount).doubleValue();
|
||||
flData.add(map);
|
||||
}
|
||||
|
||||
List<Map<String, Object>> list = new ArrayList<>();
|
||||
for (JSONObject json : disList) {
|
||||
Map<String, Object> mp = new LinkedHashMap<>();
|
||||
mp.put("入库单编码", json.getString("bill_code"));
|
||||
mp.put("物料编码", json.getString("material_code"));
|
||||
mp.put("物料名称", json.getString("material_name"));
|
||||
mp.put("入库批次", json.getString("pcsn"));
|
||||
mp.put("入库载具", json.getString("storagevehicle_code"));
|
||||
mp.put("入库仓位", json.getString("struct_code"));
|
||||
mp.put("入库数量", json.getString("plan_qty"));
|
||||
mp.put("单位", json.getString("qty_unit_name"));
|
||||
mp.put("单据状态", json.getString("bill_status"));
|
||||
mp.put("创建人", json.getString("input_optname"));
|
||||
mp.put("创建时间", json.getString("input_time"));
|
||||
mp.put("完成人", json.getString("confirm_optname"));
|
||||
mp.put("完成时间", json.getString("confirm_time"));
|
||||
list.add(mp);
|
||||
// 获取输出流
|
||||
ServletOutputStream outputStream = response.getOutputStream();
|
||||
// 获取模板地址
|
||||
SysParamServiceImpl sysParamService = SpringContextHolder.getBean(SysParamServiceImpl.class);
|
||||
Param excelParam = sysParamService.findByCode(SysParamConstant.EXCEL_TEMPLATE);
|
||||
ExcelWriter workBook = EasyExcel.write(outputStream, null).withTemplate(excelParam.getValue()).build();
|
||||
// 根据出入库类型获取sheet
|
||||
int sheetInt = 0;
|
||||
if (mstDao.getIo_type().equals(IOSEnum.IO_TYPE.code("出库"))) {
|
||||
sheetInt = 1;
|
||||
}
|
||||
FileUtil.downloadExcel(list, response);
|
||||
WriteSheet sheet = EasyExcel.writerSheet(sheetInt).build();
|
||||
// 单组填充
|
||||
HashMap<String, Object> oneMap = new HashMap<>();
|
||||
oneMap.put("sum_qty", sum_qty);
|
||||
workBook.fill(oneMap, sheet);
|
||||
|
||||
// 多组填充
|
||||
workBook.fill(new FillWrapper("data", flData), sheet);
|
||||
workBook.finish();
|
||||
outputStream.close();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -139,17 +139,6 @@
|
||||
>
|
||||
强制确认
|
||||
</el-button>
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="success"
|
||||
icon="el-icon-check"
|
||||
size="mini"
|
||||
:loading="showDtlLoading"
|
||||
@click="downdtl"
|
||||
>
|
||||
导出Excel
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
@@ -168,17 +157,25 @@
|
||||
<el-table-column
|
||||
v-permission="['admin','inbill:del','inbill:edit']"
|
||||
label="操作"
|
||||
width="115"
|
||||
width="200"
|
||||
align="center"
|
||||
fixed="right"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
style="display: inline"
|
||||
:permission="permission"
|
||||
:disabled-edit="canUd(scope.row)"
|
||||
:disabled-dle="canUd(scope.row)"
|
||||
/>
|
||||
<el-button
|
||||
type="text"
|
||||
icon="el-icon-printer"
|
||||
@click="printExcel(scope.row)"
|
||||
>
|
||||
导出单据
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column show-overflow-tooltip prop="bill_code" width="130" label="单据号">
|
||||
@@ -402,13 +399,8 @@ export default {
|
||||
this.onSelectAll()
|
||||
this.crud.toQuery()
|
||||
},
|
||||
downdtl() {
|
||||
this.showDtlLoading = true
|
||||
if (this.crud.query.createTime !== undefined) {
|
||||
this.query.begin_time = this.crud.query.createTime[0]
|
||||
this.query.end_time = this.crud.query.createTime[1]
|
||||
}
|
||||
download('/api/in/rawAssist/download', this.crud.query).then(result => {
|
||||
printExcel(jo) {
|
||||
download('/api/in/rawAssist/download', { 'iostorinv_id': jo.iostorinv_id }).then(result => {
|
||||
downloadFile(result, '入库单', 'xlsx')
|
||||
this.showDtlLoading = false
|
||||
}).catch(() => {
|
||||
|
||||
@@ -159,7 +159,7 @@
|
||||
<el-table-column
|
||||
v-permission="['admin','checkoutbill:del','checkoutbill:edit']"
|
||||
label="操作"
|
||||
width="250"
|
||||
width="200"
|
||||
align="center"
|
||||
fixed="right"
|
||||
>
|
||||
@@ -171,6 +171,13 @@
|
||||
:disabled-edit="canUd(scope.row)"
|
||||
:disabled-dle="canUd(scope.row)"
|
||||
/>
|
||||
<el-button
|
||||
type="text"
|
||||
icon="el-icon-printer"
|
||||
@click="printExcel(scope.row)"
|
||||
>
|
||||
导出单据
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :selectable="checkboxT" type="selection" width="55" />
|
||||
@@ -218,6 +225,8 @@ import AddDialog from '@/views/wms/st/outbill/AddDialog'
|
||||
import DivDialog from '@/views/wms/st/outbill/DivDialog'
|
||||
import ViewDialog from '@/views/wms/st/outbill/ViewDialog'
|
||||
import crudBsrealstorattr from '@/views/wms/basedata/bsrealstorattr/bsrealstorattr'
|
||||
import {download} from "@/api/data";
|
||||
import {downloadFile} from "@/utils";
|
||||
|
||||
const start = new Date()
|
||||
|
||||
@@ -418,6 +427,14 @@ export default {
|
||||
},
|
||||
tableChanged() {
|
||||
this.crud.toQuery()
|
||||
},
|
||||
printExcel(jo) {
|
||||
download('/api/in/rawAssist/download', { 'iostorinv_id': jo.iostorinv_id }).then(result => {
|
||||
downloadFile(result, '销售单', 'xlsx')
|
||||
this.showDtlLoading = false
|
||||
}).catch(() => {
|
||||
this.showDtlLoading = false
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user