Merge branch 'master' of http://121.40.234.130:7788/lyd/zhuzhouzhongwu
This commit is contained in:
@@ -17,6 +17,7 @@ package org.nl.common.utils;
|
||||
|
||||
import cn.hutool.core.io.IoUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.URLUtil;
|
||||
import cn.hutool.poi.excel.BigExcelWriter;
|
||||
import cn.hutool.poi.excel.ExcelUtil;
|
||||
import org.apache.poi.util.IOUtils;
|
||||
@@ -25,6 +26,7 @@ import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.config.language.LangProcess;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.core.io.ClassPathResource;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.ServletOutputStream;
|
||||
@@ -344,4 +346,20 @@ public class FileUtil extends cn.hutool.core.io.FileUtil {
|
||||
return getMd5(getByte(file));
|
||||
}
|
||||
|
||||
public static byte[] getByteByTemplate(String templateName) throws IOException {
|
||||
// 使用 ClassPathResource 获取资源
|
||||
ClassPathResource resource = new ClassPathResource(templateName);
|
||||
InputStream inputStream = resource.getInputStream();
|
||||
return IoUtil.readBytes(inputStream);
|
||||
}
|
||||
|
||||
public static void download(String fileName, byte[] fileBytes, HttpServletResponse response) throws IOException {
|
||||
response.setHeader("Content-Disposition", "attachment;filename=" + URLUtil.encode(fileName));
|
||||
response.addHeader("Content-Length", "" + fileBytes.length);
|
||||
response.setHeader("Access-Control-Allow-Origin", "*");
|
||||
response.setHeader("Access-Control-Expose-Headers", "Content-Disposition");
|
||||
response.setContentType("application/octet-stream;charset=UTF-8");
|
||||
IoUtil.write(response.getOutputStream(), true, fileBytes);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/*
|
||||
/**
|
||||
* @author ZZQ
|
||||
* @Date 2024/5/29 16:26
|
||||
*/
|
||||
@@ -17,6 +17,7 @@ public class InteracteDto<T> {
|
||||
|
||||
private String service;
|
||||
private String type;
|
||||
private String system;
|
||||
private String ip;
|
||||
private String request_time;
|
||||
private String trace_id;
|
||||
|
||||
@@ -1,20 +1,12 @@
|
||||
package org.nl.gateway.service;
|
||||
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.RedissonUtils;
|
||||
import org.nl.gateway.dto.InteracteDto;
|
||||
import org.nl.gateway.service.impl.GateWayServiceImpl;
|
||||
import org.nl.wms.sch_manage.service.ISchBasePointService;
|
||||
import org.nl.wms.sch_manage.service.ISchBaseTaskService;
|
||||
import org.nl.wms.sch_manage.service.dao.SchBasePoint;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
|
||||
/**
|
||||
* 网关执行接口层
|
||||
@@ -24,11 +16,6 @@ import java.util.concurrent.atomic.AtomicReference;
|
||||
*/
|
||||
@Service
|
||||
public class GateWayService {
|
||||
|
||||
@Autowired
|
||||
private GateWayServiceImpl gateWayServiceImpl;
|
||||
@Autowired
|
||||
private ISchBasePointService iSchBasePointService;
|
||||
@Autowired
|
||||
private ISchBaseTaskService iSchBaseTaskService;
|
||||
|
||||
@@ -38,42 +25,11 @@ public class GateWayService {
|
||||
//处理日志相关
|
||||
JSONObject result = new JSONObject();
|
||||
String service = param.getService();
|
||||
String type = param.getType();
|
||||
//根据服务拆分不同的业务
|
||||
if ("InStorage".equals(service)) {
|
||||
RedissonUtils.lock(() -> {
|
||||
String taskCode = gateWayServiceImpl.applyTask(param.getService(), type, jsonObject, param);
|
||||
result.put("taskCode", taskCode);
|
||||
}, param.getService() + param.getType(), null);
|
||||
}
|
||||
if ("Task".equals(service)) {
|
||||
iSchBaseTaskService.operation(jsonObject);
|
||||
}
|
||||
if ("DeviceInfo".equals(service)) {
|
||||
|
||||
}
|
||||
if ("Device".equals(service)) {
|
||||
Assert.noNullElements(new Object[]{jsonObject.getString("devicePoint"), jsonObject.getString("status")}, "请求参数不能为空");
|
||||
if (!"1207".equals(jsonObject.getString("devicePoint")) && !"1210".equals(jsonObject.getString("devicePoint"))) {
|
||||
throw new BadRequestException("您输入的拣选位不存在,请输入1207或1210拣选位!");
|
||||
}
|
||||
RedissonUtils.lock(() -> {
|
||||
LambdaUpdateWrapper<SchBasePoint> updateWrapper = new LambdaUpdateWrapper<>();
|
||||
updateWrapper.set(SchBasePoint::getIs_used, "0".equals(jsonObject.getString("status")) ? 0 : 1);
|
||||
iSchBasePointService.update(updateWrapper);
|
||||
}, param.getService() + param.getType(), null);
|
||||
}
|
||||
if ("ErrorInfo".equals(service)) {
|
||||
Assert.noNullElements(new Object[]{type, jsonObject.getString("msg")}, "请求参数不能为空");
|
||||
String msg = jsonObject.getString("msg").trim();
|
||||
//iSchBasePointService.sendErrorMsg(type,null, msg);
|
||||
}
|
||||
if ("ErrorTask".equals(service)) {
|
||||
AtomicReference<JSONObject> reference = new AtomicReference<>(new JSONObject());
|
||||
RedissonUtils.lock(() -> {
|
||||
// reference.set(iSchBaseTaskService.errorTask(jsonObject, param.getType()));
|
||||
}, param.getService() + param.getType(), null);
|
||||
return reference.get();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -11,10 +11,14 @@ import org.nl.wms.basedata_manage.service.IMdMeMaterialbaseService;
|
||||
import org.nl.wms.basedata_manage.service.dao.MdMeMaterialbase;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
@@ -69,5 +73,18 @@ public class MaterialbaseController {
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@PostMapping("/importExcel")
|
||||
@Log("导入物料")
|
||||
public ResponseEntity<Object> importExcel(@RequestPart("file") MultipartFile file) {
|
||||
iMdMeMaterialbaseService.importExcel(file);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@Log("下载导入模板")
|
||||
@GetMapping(value = "/downloadImportMaterialTemplate", produces = MediaType.APPLICATION_OCTET_STREAM_VALUE)
|
||||
public void downloadImportUserTemplate(HttpServletResponse response) {
|
||||
iMdMeMaterialbaseService.downloadImportMaterialTemplate(response);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -10,10 +10,13 @@ import org.nl.wms.basedata_manage.service.IMdPbMeasureunitService;
|
||||
import org.nl.wms.basedata_manage.service.dao.MdPbMeasureunit;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
@@ -61,4 +64,17 @@ public class MeasureUnitController {
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/importExcel")
|
||||
@Log("导入单位")
|
||||
public ResponseEntity<Object> importExcel(@RequestPart("file") MultipartFile file) {
|
||||
iMdPbMeasureunitService.importExcel(file);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@Log("下载导入模板")
|
||||
@GetMapping(value = "/downloadImportUnitTemplate", produces = MediaType.APPLICATION_OCTET_STREAM_VALUE)
|
||||
public void downloadImportUnitTemplate(HttpServletResponse response) {
|
||||
iMdPbMeasureunitService.downloadImportUnitTemplate(response);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -5,7 +5,9 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.wms.basedata_manage.service.dao.MdMeMaterialbase;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
@@ -55,7 +57,12 @@ public interface IMdMeMaterialbaseService extends IService<MdMeMaterialbase> {
|
||||
/**
|
||||
* 根据编码获取物料
|
||||
* @param material_code 物料编码
|
||||
* @param flag 为空是否抛出异常
|
||||
* @return 返回结果
|
||||
*/
|
||||
MdMeMaterialbase getByCode(String material_code);
|
||||
MdMeMaterialbase getByCode(String material_code, Boolean flag);
|
||||
|
||||
void importExcel(MultipartFile file);
|
||||
|
||||
void downloadImportMaterialTemplate(HttpServletResponse response);
|
||||
}
|
||||
|
||||
@@ -4,7 +4,9 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.wms.basedata_manage.service.dao.MdPbMeasureunit;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
@@ -49,6 +51,9 @@ public interface IMdPbMeasureunitService extends IService<MdPbMeasureunit> {
|
||||
* @param unit_code 编码
|
||||
* @return 实体类
|
||||
*/
|
||||
MdPbMeasureunit getByCode(String unit_code);
|
||||
MdPbMeasureunit getByCode(String unit_code, Boolean flag);
|
||||
|
||||
void importExcel(MultipartFile file);
|
||||
|
||||
void downloadImportUnitTemplate(HttpServletResponse response);
|
||||
}
|
||||
|
||||
@@ -1,16 +1,20 @@
|
||||
package org.nl.wms.basedata_manage.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.io.IoUtil;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.URLUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
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.apache.poi.ss.usermodel.*;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.FileUtil;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.wms.basedata_manage.service.IMdMeMaterialbaseService;
|
||||
@@ -18,9 +22,14 @@ import org.nl.wms.basedata_manage.service.dao.MdMeMaterialbase;
|
||||
import org.nl.wms.basedata_manage.service.dao.mapper.MdMeMaterialbaseMapper;
|
||||
import org.nl.wms.ext_manage.service.WmsToErpService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.core.io.ClassPathResource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -43,6 +52,8 @@ public class MdMeMaterialbaseServiceImpl extends ServiceImpl<MdMeMaterialbaseMap
|
||||
*/
|
||||
@Autowired
|
||||
private WmsToErpService wmsToErpService;
|
||||
@Autowired
|
||||
private IMdMeMaterialbaseService materialbaseService;
|
||||
|
||||
@Override
|
||||
public IPage<MdMeMaterialbase> queryAll(Map whereJson, PageQuery page) {
|
||||
@@ -62,7 +73,7 @@ public class MdMeMaterialbaseServiceImpl extends ServiceImpl<MdMeMaterialbaseMap
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void create(MdMeMaterialbase dto) {
|
||||
// 根据物料编码查询是否有相同物料编码的物料
|
||||
MdMeMaterialbase mdMeMaterialbase = this.baseMapper.selectOne(
|
||||
@@ -70,7 +81,7 @@ public class MdMeMaterialbaseServiceImpl extends ServiceImpl<MdMeMaterialbaseMap
|
||||
.eq(MdMeMaterialbase::getMaterial_code, dto.getMaterial_code())
|
||||
);
|
||||
if (ObjectUtil.isNotEmpty(mdMeMaterialbase)) {
|
||||
throw new BadRequestException("当前物料编码已存在【"+dto.getMaterial_code()+"】");
|
||||
throw new BadRequestException("当前物料编码已存在【" + dto.getMaterial_code() + "】");
|
||||
}
|
||||
|
||||
// 新增
|
||||
@@ -85,7 +96,7 @@ public class MdMeMaterialbaseServiceImpl extends ServiceImpl<MdMeMaterialbaseMap
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(MdMeMaterialbase dto) {
|
||||
MdMeMaterialbase mdMeMaterialbase = this.baseMapper.selectById(dto.getMaterial_id());
|
||||
if (ObjectUtil.isEmpty(mdMeMaterialbase)) {
|
||||
@@ -100,13 +111,13 @@ public class MdMeMaterialbaseServiceImpl extends ServiceImpl<MdMeMaterialbaseMap
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void delete(Set<String> ids) {
|
||||
this.baseMapper.deleteBatchIds(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void materialSync(JSONObject whereJson) {
|
||||
JSONObject resultJson = wmsToErpService.materialSync(whereJson);
|
||||
List<JSONObject> dataList = resultJson.getJSONArray("data").toJavaList(JSONObject.class);
|
||||
@@ -145,16 +156,76 @@ public class MdMeMaterialbaseServiceImpl extends ServiceImpl<MdMeMaterialbaseMap
|
||||
}
|
||||
|
||||
@Override
|
||||
public MdMeMaterialbase getByCode(String materialCode) {
|
||||
public MdMeMaterialbase getByCode(String materialCode, Boolean flag) {
|
||||
MdMeMaterialbase one = this.getOne(
|
||||
new QueryWrapper<MdMeMaterialbase>().lambda().nested(r -> {
|
||||
r.eq(MdMeMaterialbase::getMaterial_id, materialCode)
|
||||
.or()
|
||||
.eq(MdMeMaterialbase::getMaterial_code, materialCode);
|
||||
}));
|
||||
if (ObjectUtil.isEmpty(one)) {
|
||||
if (ObjectUtil.isEmpty(one) && flag) {
|
||||
throw new BadRequestException("物料信息为【" + materialCode + "】不存在!");
|
||||
}
|
||||
return one;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void importExcel(MultipartFile file) {
|
||||
// 1. 校验文件
|
||||
if (file.isEmpty()) {
|
||||
throw new IllegalArgumentException("上传文件不能为空");
|
||||
}
|
||||
|
||||
try (InputStream inputStream = file.getInputStream();
|
||||
Workbook workbook = WorkbookFactory.create(inputStream)) {
|
||||
|
||||
// 2. 获取第一个Sheet
|
||||
Sheet sheet = workbook.getSheetAt(0);
|
||||
|
||||
// 3. 从第二行开始遍历 (索引1)
|
||||
List<MdMeMaterialbase> dataList = new ArrayList<>();
|
||||
for (int rowIndex = 1; rowIndex <= sheet.getLastRowNum(); rowIndex++) {
|
||||
Row row = sheet.getRow(rowIndex);
|
||||
if (row == null) continue; // 跳过空行
|
||||
Cell materialCodeCell = row.getCell(0);
|
||||
MdMeMaterialbase byCode = materialbaseService.getByCode(String.valueOf(materialCodeCell), false);
|
||||
if (ObjectUtil.isNotEmpty(byCode)) {
|
||||
throw new BadRequestException("物料[" + materialCodeCell + "]已存在!");
|
||||
}
|
||||
|
||||
// 4. 读取6个字段
|
||||
MdMeMaterialbase entity = new MdMeMaterialbase();
|
||||
entity.setMaterial_id(IdUtil.getStringId());
|
||||
entity.setMaterial_code(String.valueOf(materialCodeCell));
|
||||
entity.setMaterial_name(String.valueOf(row.getCell(1)));
|
||||
entity.setMaterial_spec(String.valueOf(row.getCell(2)));
|
||||
entity.setMaterial_model(String.valueOf(row.getCell(3)));
|
||||
entity.setBase_unit_id(String.valueOf(row.getCell(4)));
|
||||
entity.setAss_unit_id(String.valueOf(row.getCell(5)));
|
||||
entity.setCreate_id(SecurityUtils.getCurrentUserId());
|
||||
entity.setCreate_name(SecurityUtils.getCurrentNickName());
|
||||
entity.setCreate_time(DateUtil.now());
|
||||
dataList.add(entity);
|
||||
}
|
||||
|
||||
// 6. 批量保存(根据实际持久层实现)
|
||||
materialbaseService.saveBatch(dataList);
|
||||
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException("文件读取失败: " + e.getMessage());
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("导入失败: " + e.getMessage());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void downloadImportMaterialTemplate(HttpServletResponse response) {
|
||||
try {
|
||||
byte[] byteByTemplate = FileUtil.getByteByTemplate("excel/material_template.xlsx");
|
||||
FileUtil.download("物料导入模板.xlsx", byteByTemplate, response);
|
||||
} catch (Exception e) {
|
||||
log.error(">>> 下载导入模板失败:", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,17 +8,27 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
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.apache.poi.ss.usermodel.*;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.FileUtil;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.wms.basedata_manage.enums.BaseDataEnum;
|
||||
import org.nl.wms.basedata_manage.service.IMdPbMeasureunitService;
|
||||
import org.nl.wms.basedata_manage.service.dao.MdMeMaterialbase;
|
||||
import org.nl.wms.basedata_manage.service.dao.MdPbMeasureunit;
|
||||
import org.nl.wms.basedata_manage.service.dao.mapper.MdPbMeasureunitMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
@@ -95,14 +105,72 @@ public class MdPbMeasureunitServiceImpl extends ServiceImpl<MdPbMeasureunitMappe
|
||||
}
|
||||
|
||||
@Override
|
||||
public MdPbMeasureunit getByCode(String unit_code) {
|
||||
public MdPbMeasureunit getByCode(String unit_code, Boolean flag) {
|
||||
MdPbMeasureunit one = this.getOne(
|
||||
new QueryWrapper<MdPbMeasureunit>().lambda()
|
||||
.eq(MdPbMeasureunit::getUnit_code, unit_code)
|
||||
);
|
||||
if (ObjectUtil.isEmpty(one)) {
|
||||
if (ObjectUtil.isEmpty(one) && flag) {
|
||||
throw new BadRequestException("计量单位编码为【"+unit_code+"】不存在!");
|
||||
}
|
||||
return one;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void importExcel(MultipartFile file) {
|
||||
// 1. 校验文件
|
||||
if (file.isEmpty()) {
|
||||
throw new IllegalArgumentException("上传文件不能为空");
|
||||
}
|
||||
|
||||
try (InputStream inputStream = file.getInputStream();
|
||||
Workbook workbook = WorkbookFactory.create(inputStream)) {
|
||||
|
||||
// 2. 获取第一个Sheet
|
||||
Sheet sheet = workbook.getSheetAt(0);
|
||||
|
||||
// 3. 从第二行开始遍历 (索引1)
|
||||
List<MdPbMeasureunit> dataList = new ArrayList<>();
|
||||
for (int rowIndex = 1; rowIndex <= sheet.getLastRowNum(); rowIndex++) {
|
||||
Row row = sheet.getRow(rowIndex);
|
||||
if (row == null) {
|
||||
continue; // 跳过空行
|
||||
}
|
||||
Cell cell1 = row.getCell(0);
|
||||
MdPbMeasureunit byCode = this.getByCode(String.valueOf(cell1), false);
|
||||
if (ObjectUtil.isNotEmpty(byCode)) {
|
||||
throw new BadRequestException("物料[" + cell1 + "]已存在!");
|
||||
}
|
||||
|
||||
// 4. 读取6个字段
|
||||
MdPbMeasureunit entity = new MdPbMeasureunit();
|
||||
entity.setMeasure_unit_id(IdUtil.getStringId());
|
||||
entity.setUnit_code(String.valueOf(cell1));
|
||||
entity.setUnit_name(String.valueOf(row.getCell(1)));
|
||||
entity.setQty_precision(new BigDecimal(String.valueOf(row.getCell(2))));
|
||||
entity.setCreate_id(SecurityUtils.getCurrentUserId());
|
||||
entity.setCreate_name(SecurityUtils.getCurrentNickName());
|
||||
entity.setCreate_time(DateUtil.now());
|
||||
dataList.add(entity);
|
||||
}
|
||||
|
||||
// 6. 批量保存
|
||||
this.saveBatch(dataList);
|
||||
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException("文件读取失败: " + e.getMessage());
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("导入失败: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void downloadImportUnitTemplate(HttpServletResponse response) {
|
||||
try {
|
||||
byte[] byteByTemplate = FileUtil.getByteByTemplate("excel/unit_template.xlsx");
|
||||
FileUtil.download("单位导入模板.xlsx", byteByTemplate, response);
|
||||
} catch (Exception e) {
|
||||
log.error(">>> 下载导入模板失败:", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@ public class StructattrServiceImpl extends ServiceImpl<StructattrMapper, Structa
|
||||
.like(StrUtil.isNotEmpty(search), Structattr::getStruct_code, search)
|
||||
.like(StrUtil.isNotEmpty(search), Structattr::getStruct_name, search)
|
||||
.eq(StrUtil.isNotEmpty(stor_id), Structattr::getStor_id, stor_id)
|
||||
.eq(StrUtil.isNotEmpty(sect_id), Structattr::getSect_id, sect_id)
|
||||
.eq(StrUtil.isNotEmpty(sect_id), Structattr::getSect_code, sect_id)
|
||||
.eq(StrUtil.isNotEmpty(lock_type), Structattr::getLock_type, lock_type)
|
||||
.eq(StrUtil.isNotEmpty(layer_num), Structattr::getLayer_num, layer_num)
|
||||
.eq(StrUtil.isNotEmpty(is_used), Structattr::getIs_used, is_used)
|
||||
@@ -197,8 +197,9 @@ public class StructattrServiceImpl extends ServiceImpl<StructattrMapper, Structa
|
||||
dto.setUpdate_time(now);
|
||||
dto.setUpdate_id(currentUserId);
|
||||
dto.setUpdate_name(nickName);
|
||||
Sectattr sectattr = iSectattrService.findByCode(dto.getSect_id());
|
||||
Sectattr sectattr = iSectattrService.findByCode(dto.getSect_code());
|
||||
BsrealStorattr bsrealStorattr = iBsrealStorattrService.findById(sectattr.getStor_id());
|
||||
dto.setSect_id(sectattr.getSect_id());
|
||||
dto.setSect_code(sectattr.getSect_code());
|
||||
dto.setSect_name(sectattr.getSect_name());
|
||||
dto.setStor_id(bsrealStorattr.getStor_id());
|
||||
|
||||
@@ -79,107 +79,4 @@ public class AlleyAveRuleHandler extends Decisioner<Structattr, JSONObject> {
|
||||
return subList;
|
||||
}
|
||||
|
||||
// public static void main(String[] args) {
|
||||
// List<Structattr> list = new ArrayList<>();
|
||||
// for (int i =0;i<10;i++){
|
||||
// Structattr structattr = new Structattr();
|
||||
// structattr.setRow_num(new Random().nextInt(2)+1);
|
||||
// structattr.setCol_num(new Random().nextInt(10)+1);
|
||||
// structattr.setLayer_num(new Random().nextInt(2)+1);
|
||||
// list.add(structattr);
|
||||
// }
|
||||
// System.out.println(list);
|
||||
// ArrayList<String> of = ListOf.of("x", "z","y");
|
||||
// list.sort((o1, o2) -> {
|
||||
// Integer rowNum1 = o1.getRow_num();
|
||||
// Integer colNum1 = o1.getCol_num();
|
||||
// Integer layerNum1 = o1.getLayer_num();
|
||||
// Integer rowNum2 = o2.getRow_num();
|
||||
// Integer colNum2 = o2.getCol_num();
|
||||
// Integer layerNum2 = o2.getLayer_num();
|
||||
// HashMap<String,Integer> of1 = MapOf.of("x", rowNum1, "y", colNum1, "z", layerNum1);
|
||||
// HashMap<String,Integer> of2 = MapOf.of("x", rowNum2, "y", colNum2, "z", layerNum2);
|
||||
// for (String sort : of) {
|
||||
// Integer in1 = of1.get(sort);
|
||||
// Integer in2 = of2.get(sort);
|
||||
// if (in1 > in2){
|
||||
// return 1;
|
||||
// }
|
||||
// if (in1 < in2){
|
||||
// return -1;
|
||||
// }
|
||||
// }
|
||||
// return 0;
|
||||
// });
|
||||
// System.out.println(list.toString());
|
||||
// }
|
||||
|
||||
/**
|
||||
* 入库策略
|
||||
*
|
||||
* @param attrList :仓位集合
|
||||
* @param jsonParam:materialId :物料标识(此方法只根据物料进行匹配)
|
||||
* @return List<Structattr> :仓位集合
|
||||
*/
|
||||
// private List<Structattr> inHandler(List<Structattr> attrList, PmFormData jsonParam) {
|
||||
// // in查询条件处理
|
||||
// List<Integer> blockNumIn = attrList.stream()
|
||||
// .map(Structattr::getBlock_num)
|
||||
// .distinct()
|
||||
// .collect(Collectors.toList());
|
||||
// // 查询相同巷道货位相同物料
|
||||
// List<Structattr> blockAttrList = null;
|
||||
// iStructattrService.getByQuery(new StructattrQuery());
|
||||
// // 如果为空说明这些巷道都没有相同物料的巷道,则返回所有仓位
|
||||
// if (ObjectUtil.isEmpty(blockAttrList)) {
|
||||
// return attrList;
|
||||
// }
|
||||
// // 计算每个巷道的相同物料
|
||||
// Map<Integer, List<Structattr>> collectMap = blockAttrList.stream()
|
||||
// .collect(Collectors.groupingBy(Structattr::getBlock_num));
|
||||
// // 巷道
|
||||
// int blockNum = blockAttrList.get(0).getBlock_num().intValue();
|
||||
// // 集合数量
|
||||
// int size = blockAttrList.size();
|
||||
// for (Integer num : collectMap.keySet()) {
|
||||
// int min = Math.min(size, collectMap.get(num).size());
|
||||
// if (size > min) {
|
||||
// // 返回最小的巷道
|
||||
// blockNum = num.intValue();
|
||||
// size = min;
|
||||
// }
|
||||
// }
|
||||
// // 匹配相同巷道的集合并返回
|
||||
// int finalBlockNum = blockNum;
|
||||
// return attrList.stream()
|
||||
// .filter(row -> row.getBlock_num().intValue() == finalBlockNum)
|
||||
// .collect(Collectors.toList());
|
||||
// }
|
||||
|
||||
/**
|
||||
* 出库策略 - 查询物料最多的巷道
|
||||
*
|
||||
* @param attrList: 仓位物料
|
||||
* @return 巷道
|
||||
*/
|
||||
// private int getMaxMaterial(List<Structattr> attrList) {
|
||||
// // 根据巷道分组
|
||||
// Map<Integer, List<Structattr>> collectMap = attrList.stream()
|
||||
// .collect(Collectors.groupingBy(Structattr::getBlock_num));
|
||||
// // 找最大物料巷道
|
||||
// // 巷道
|
||||
// int blockNum = attrList.get(0).getBlock_num().intValue();
|
||||
// // 集合数量
|
||||
// int size = 0;
|
||||
// for (Integer num : collectMap.keySet()) {
|
||||
// int max = Math.max(size, collectMap.get(num).size());
|
||||
// if (size < max) {
|
||||
// // 返回最大的巷道
|
||||
// blockNum = num.intValue();
|
||||
// size = max;
|
||||
// }
|
||||
// }
|
||||
// return blockNum;
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
@@ -190,7 +190,7 @@ public class PdaIosInServiceImpl implements PdaIosInService {
|
||||
// 数量
|
||||
String qty = whereJson.getString("qty");
|
||||
MdPbStoragevehicleinfo vehicleDao = iMdPbStoragevehicleinfoService.getByCode(whereJson.getString("vehicle_code"));
|
||||
MdMeMaterialbase materDao = iMdMeMaterialbaseService.getByCode(materialId);
|
||||
MdMeMaterialbase materDao = iMdMeMaterialbaseService.getByCode(materialId, true);
|
||||
MdPbMeasureunit unitDao = iMdPbMeasureunitService.getById(materDao.getBase_unit_id());
|
||||
// 校验
|
||||
if (ObjectUtil.isEmpty(vehicleDao) || ObjectUtil.isEmpty(materDao) || ObjectUtil.isEmpty(materDao)) {
|
||||
@@ -778,7 +778,7 @@ public class PdaIosInServiceImpl implements PdaIosInService {
|
||||
ArrayList<HashMap> tableData = new ArrayList<>();
|
||||
HashMap<String, String> dtl = new HashMap<>();
|
||||
GroupPlate plateDao = plateDaoList.get(0);
|
||||
MdMeMaterialbase materDao = iMdMeMaterialbaseService.getByCode(plateDao.getMaterial_id());
|
||||
MdMeMaterialbase materDao = iMdMeMaterialbaseService.getByCode(plateDao.getMaterial_id(), true);
|
||||
dtl.put("storagevehicle_code", plateDao.getStoragevehicle_code());
|
||||
dtl.put("material_id", materDao.getMaterial_id());
|
||||
dtl.put("material_code", materDao.getMaterial_code());
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -28,7 +28,10 @@
|
||||
将文件拖到此处,或
|
||||
<em>点击上传</em>
|
||||
</div>
|
||||
<div slot="tip" class="el-upload__tip">只能上传Excel文件,且不超过10MB</div>
|
||||
<div slot="tip" class="el-upload__tip">
|
||||
只能上传Excel文件,且不超过10MB
|
||||
<el-button type="text" @click="downloadImportTemplate">下载模板</el-button>
|
||||
</div>
|
||||
</el-upload>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
@@ -96,6 +99,35 @@ export default {
|
||||
uploadByJsqd(file) {
|
||||
this.file1 = file
|
||||
},
|
||||
downloadImportTemplate() {
|
||||
crudMaterial.downloadImportMaterialTemplate().then(res => {
|
||||
// 1. 创建Blob对象
|
||||
const blob = new Blob([res], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' });
|
||||
|
||||
// 2. 创建临时下载链接
|
||||
const downloadUrl = window.URL.createObjectURL(blob);
|
||||
|
||||
// 3. 创建隐藏的<a>标签
|
||||
const link = document.createElement('a');
|
||||
link.href = downloadUrl;
|
||||
|
||||
// 设置下载文件名(根据后端返回或固定名称)
|
||||
link.download = '物料导入模板.xlsx';
|
||||
|
||||
// 4. 添加到DOM并触发点击
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
|
||||
// 5. 清理资源
|
||||
document.body.removeChild(link);
|
||||
window.URL.revokeObjectURL(downloadUrl);
|
||||
|
||||
}).catch(error => {
|
||||
console.error('下载失败:', error);
|
||||
// 这里可以添加错误提示,如ElementUI的Message
|
||||
this.$message.error('模板下载失败,请重试');
|
||||
})
|
||||
},
|
||||
submit() {
|
||||
if (this.beforeAvatarUpload(this.file1)) {
|
||||
this.fileList.name = this.file1.name
|
||||
|
||||
@@ -62,4 +62,12 @@ export function excelImport(data) {
|
||||
data
|
||||
})
|
||||
}
|
||||
export default { add, edit, del, excelImport, getMaterOptType, isAlongMaterType, getProductSeries, materialSync }
|
||||
|
||||
export function downloadImportMaterialTemplate(data) {
|
||||
return request({
|
||||
url: 'api/Materia/downloadImportMaterialTemplate',
|
||||
method: 'get',
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
export default { add, edit, del, excelImport, getMaterOptType, isAlongMaterType, getProductSeries, materialSync, downloadImportMaterialTemplate }
|
||||
|
||||
157
lms/nladmin-ui/src/views/wms/basedata/measure/UploadDialog.vue
Normal file
157
lms/nladmin-ui/src/views/wms/basedata/measure/UploadDialog.vue
Normal file
@@ -0,0 +1,157 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
title="导入Excel文件"
|
||||
append-to-body
|
||||
:visible.sync="dialogVisible"
|
||||
destroy-on-close
|
||||
width="400px"
|
||||
:show-close="true"
|
||||
@close="close"
|
||||
@open="open"
|
||||
>
|
||||
<el-upload
|
||||
ref="upload"
|
||||
class="upload-demo"
|
||||
action=""
|
||||
drag
|
||||
:on-exceed="is_one"
|
||||
:limit="1"
|
||||
:auto-upload="false"
|
||||
:multiple="false"
|
||||
:show-file-list="true"
|
||||
:on-change="uploadByJsqd"
|
||||
:file-list="fileList"
|
||||
accept=".xlsx,.xls"
|
||||
>
|
||||
<i class="el-icon-upload" />
|
||||
<div class="el-upload__text">
|
||||
将文件拖到此处,或
|
||||
<em>点击上传</em>
|
||||
</div>
|
||||
<div slot="tip" class="el-upload__tip">
|
||||
只能上传Excel文件,且不超过10MB
|
||||
<el-button type="text" @click="downloadImportTemplate">下载模板</el-button>
|
||||
</div>
|
||||
</el-upload>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="submit">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudmeasure from './mdPbMeasureunit'
|
||||
import CRUD, { crud } from '@crud/crud'
|
||||
import { download2 } from '@/api/data'
|
||||
import { downloadFile } from '@/utils'
|
||||
|
||||
export default {
|
||||
name: 'UploadDialog',
|
||||
mixins: [crud()],
|
||||
components: {},
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
openParam: {
|
||||
type: String
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
fileList: [],
|
||||
file1: ''
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue, oldValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
},
|
||||
openParam: {
|
||||
handler(newValue, oldValue) {
|
||||
this.opendtlParam = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
},
|
||||
close() {
|
||||
this.$emit('update:dialogShow', false)
|
||||
},
|
||||
is_one() {
|
||||
this.crud.notify('只能上传一个excel文件!', CRUD.NOTIFICATION_TYPE.WARNING)
|
||||
},
|
||||
// 文件校验方法
|
||||
beforeAvatarUpload(file) {
|
||||
// 不能导入大小超过2Mb的文件
|
||||
if (file.size > 10 * 1024 * 1024) {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
},
|
||||
// 文件发生改变就会触发的事件
|
||||
uploadByJsqd(file) {
|
||||
this.file1 = file
|
||||
},
|
||||
downloadImportTemplate() {
|
||||
crudmeasure.downloadImportUnitTemplate().then(res => {
|
||||
// 1. 创建Blob对象
|
||||
const blob = new Blob([res], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' });
|
||||
|
||||
// 2. 创建临时下载链接
|
||||
const downloadUrl = window.URL.createObjectURL(blob);
|
||||
|
||||
// 3. 创建隐藏的<a>标签
|
||||
const link = document.createElement('a');
|
||||
link.href = downloadUrl;
|
||||
|
||||
// 设置下载文件名(根据后端返回或固定名称)
|
||||
link.download = '单位导入模板.xlsx';
|
||||
|
||||
// 4. 添加到DOM并触发点击
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
|
||||
// 5. 清理资源
|
||||
document.body.removeChild(link);
|
||||
window.URL.revokeObjectURL(downloadUrl);
|
||||
|
||||
}).catch(error => {
|
||||
console.error('下载失败:', error);
|
||||
// 这里可以添加错误提示,如ElementUI的Message
|
||||
this.$message.error('模板下载失败,请重试');
|
||||
})
|
||||
},
|
||||
submit() {
|
||||
if (this.beforeAvatarUpload(this.file1)) {
|
||||
this.fileList.name = this.file1.name
|
||||
this.fileList.url = ''
|
||||
var formdata = new FormData()
|
||||
formdata.append('file', this.file1.raw)
|
||||
// excelImport:请求接口 formdata:传递参数
|
||||
crudmeasure.excelImport(formdata).then((res) => {
|
||||
this.crud.notify('导入成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.$emit('tableChanged3', '')
|
||||
this.$emit('update:dialogShow', false)
|
||||
}).catch(err => {
|
||||
|
||||
const list = err.response.data.message
|
||||
download2('/api/produceWorkorder/download', list).then(result => {
|
||||
downloadFile(result, '错误信息汇总', 'xlsx')
|
||||
crud.downloadLoading = false
|
||||
})
|
||||
})
|
||||
} else {
|
||||
this.crud.notify('文件过大,请上传小于10MB的文件〜', CRUD.NOTIFICATION_TYPE.WARNING)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -13,7 +13,18 @@
|
||||
/>
|
||||
<rrOperation />
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission" />
|
||||
<crudOperation :permission="permission">
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="warning"
|
||||
icon="el-icon-upload2"
|
||||
size="mini"
|
||||
@click="uploadShow = true"
|
||||
>
|
||||
导入
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<!--表单组件-->
|
||||
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="500px">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="80px">
|
||||
@@ -70,6 +81,7 @@
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
<upload-dialog :dialog-show.sync="uploadShow"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -80,11 +92,12 @@ import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import UploadDialog from './UploadDialog.vue'
|
||||
const defaultForm = { measure_unit_id: null, unit_code: null, unit_name: null, qty_precision: null, is_used: '1', create_id: null, create_name: null, create_time: null, update_optid: null, update_optname: null, update_time: null, is_delete: null, ext_id: null }
|
||||
export default {
|
||||
dicts: ['is_used'],
|
||||
name: 'MdPbMeasureunit',
|
||||
components: { pagination, crudOperation, rrOperation, udOperation },
|
||||
components: { UploadDialog, pagination, crudOperation, rrOperation, udOperation },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({ title: '计量单位',
|
||||
@@ -101,6 +114,7 @@ export default {
|
||||
return {
|
||||
permission: {
|
||||
},
|
||||
uploadShow: false,
|
||||
rules: {
|
||||
measure_unit_id: [
|
||||
{ required: true, message: '不能为空', trigger: 'blur' }
|
||||
|
||||
@@ -32,4 +32,20 @@ export function getUnit(params) {
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, getUnit }
|
||||
export function excelImport(data) {
|
||||
return request({
|
||||
url: 'api/mdPbMeasureunit/importExcel',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function downloadImportUnitTemplate(data) {
|
||||
return request({
|
||||
url: 'api/mdPbMeasureunit/downloadImportUnitTemplate',
|
||||
method: 'get',
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, getUnit, excelImport, downloadImportUnitTemplate }
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="立库层数">
|
||||
<el-form-item label="货架层数">
|
||||
<el-select
|
||||
v-model="query.layer_num"
|
||||
clearable
|
||||
@@ -276,6 +276,11 @@
|
||||
<el-table-column prop="simple_name" label="仓位简称" :min-width="flexWidth('simple_name',crud.data,'仓位简称')" />
|
||||
<el-table-column prop="sect_name" label="所属库区" width="150" />
|
||||
<el-table-column prop="stor_name" label="所属仓库" width="150" />
|
||||
<el-table-column prop="occupancy_state" label="仓位状态" min-width="120" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
<span>{{ dict.label.occupancy_state[scope.row.occupancy_state] }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="storagevehicle_code" label="载具号" :min-width="flexWidth('storagevehicle_code',crud.data,'载具号')" />
|
||||
<el-table-column prop="lock_type" label="锁定类型" min-width="120" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
@@ -298,7 +303,7 @@
|
||||
<!-- />-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
<el-table-column prop="taskdtl_type" label="锁定任务类型" width="150" :formatter="taskdtl_typeFormat" />
|
||||
<!-- <el-table-column prop="taskdtl_type" label="锁定任务类型" width="150" :formatter="taskdtl_typeFormat" />-->
|
||||
<el-table-column prop="task_code" label="锁定任务编码" width="150" />
|
||||
<el-table-column prop="inv_code" label="锁定单据编码" width="150" />
|
||||
<el-table-column prop="inv_type" label="锁定单据类型" width="150" :formatter="invtypeFormat" />
|
||||
@@ -486,14 +491,14 @@ export default {
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
},
|
||||
[CRUD.HOOK.afterToEdit](crud, form) {
|
||||
[CRUD.HOOK.beforeToEdit](crud, form) {
|
||||
const val = []
|
||||
val[0] = form.stor_id
|
||||
val[1] = form.sect_id
|
||||
val[1] = form.sect_code
|
||||
form.cascader = val
|
||||
},
|
||||
sectChange(val) {
|
||||
this.form.sect_id = val[1]
|
||||
this.form.sect_code = val[1]
|
||||
},
|
||||
openOneCreate() {
|
||||
this.openOneCreateDialog = true
|
||||
|
||||
Reference in New Issue
Block a user