优化
This commit is contained in:
@@ -1,7 +1,12 @@
|
||||
package top.wms.admin.materialProcess.service;
|
||||
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import top.continew.starter.extension.crud.model.resp.LabelValueResp;
|
||||
import top.continew.starter.extension.crud.service.BaseService;
|
||||
import top.wms.admin.material.model.req.MaterialInfoImportReq;
|
||||
import top.wms.admin.material.model.resp.MaterialImportParseResp;
|
||||
import top.wms.admin.material.model.resp.MaterialInfoImportResp;
|
||||
import top.wms.admin.materialProcess.model.query.MaterialProcessQuery;
|
||||
import top.wms.admin.materialProcess.model.req.MaterialProcessReq;
|
||||
import top.wms.admin.materialProcess.model.resp.MaterialProcessResp;
|
||||
@@ -16,5 +21,29 @@ import java.util.List;
|
||||
*/
|
||||
public interface MaterialProcessService extends BaseService<MaterialProcessResp, MaterialProcessResp, MaterialProcessQuery, MaterialProcessReq> {
|
||||
|
||||
/**
|
||||
* 获取流程下拉列表
|
||||
* @return 流程下拉列表
|
||||
*/
|
||||
List<LabelValueResp> getSelectList();
|
||||
|
||||
/**
|
||||
* 下载导入模板
|
||||
* @param response 响应对象
|
||||
*/
|
||||
void downloadImportTemplate(HttpServletResponse response) throws Exception;
|
||||
|
||||
/**
|
||||
* 解析导入文件
|
||||
* @param file 导入文件
|
||||
* @param file 导入文件
|
||||
*/
|
||||
MaterialImportParseResp parseImport(MultipartFile file);
|
||||
|
||||
/**
|
||||
* 导入物料信息
|
||||
* @param req 导入请求
|
||||
* @return 导入响应
|
||||
*/
|
||||
MaterialInfoImportResp importMaterial(MaterialInfoImportReq req);
|
||||
}
|
||||
@@ -1,10 +1,21 @@
|
||||
package top.wms.admin.materialProcess.service.impl;
|
||||
|
||||
import cn.hutool.core.io.resource.ResourceUtil;
|
||||
import cn.hutool.core.util.CharsetUtil;
|
||||
import cn.hutool.http.ContentType;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import net.dreamlu.mica.core.result.R;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import top.continew.starter.extension.crud.model.resp.LabelValueResp;
|
||||
import top.continew.starter.extension.crud.service.BaseServiceImpl;
|
||||
import top.continew.starter.web.util.FileUploadUtils;
|
||||
import top.wms.admin.material.model.req.MaterialInfoImportReq;
|
||||
import top.wms.admin.material.model.resp.MaterialImportParseResp;
|
||||
import top.wms.admin.material.model.resp.MaterialInfoImportResp;
|
||||
import top.wms.admin.materialProcess.mapper.MaterialProcessMapper;
|
||||
import top.wms.admin.materialProcess.mapstruct.MaterialProcessConvert;
|
||||
import top.wms.admin.materialProcess.model.entity.MaterialProcessDO;
|
||||
@@ -32,4 +43,27 @@ public class MaterialProcessServiceImpl extends BaseServiceImpl<MaterialProcessM
|
||||
List<MaterialProcessDO> materialProcessDOS = baseMapper.selectList(new QueryWrapper<>());
|
||||
return materialProcessConvert.labelValueList(materialProcessDOS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void downloadImportTemplate(HttpServletResponse response) throws Exception {
|
||||
try {
|
||||
FileUploadUtils.download(response, ResourceUtil
|
||||
.getStream("templates/import/materialProcess.xlsx"), "物料流程导入模板.xlsx");
|
||||
} catch (Exception e) {
|
||||
log.error("下载用户导入模板失败:", e);
|
||||
response.setCharacterEncoding(CharsetUtil.UTF_8);
|
||||
response.setContentType(ContentType.JSON.toString());
|
||||
response.getWriter().write(JSONUtil.toJsonStr(R.fail("下载用户导入模板失败")));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public MaterialImportParseResp parseImport(MultipartFile file) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MaterialInfoImportResp importMaterial(MaterialInfoImportReq req) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user