Browse Source

[delete]

删除旧版无用的领料单对象 领料单对象 material_requisition_info和系统中对应的前端所有代码和后端所有代码 和对应的系统菜单数据
dev
liuxiaoxu 1 month ago
parent
commit
f696cc81aa
  1. 769
      ruoyi-admin/src/main/java/com/ruoyi/manufacture/controller/MaterialRequisitionInfoController.java
  2. 369
      ruoyi-admin/src/main/java/com/ruoyi/manufacture/domain/MaterialRequisitionInfo.java
  3. 91
      ruoyi-admin/src/main/java/com/ruoyi/manufacture/mapper/MaterialRequisitionInfoMapper.java
  4. 123
      ruoyi-admin/src/main/java/com/ruoyi/manufacture/service/IMaterialRequisitionInfoService.java
  5. 142
      ruoyi-admin/src/main/java/com/ruoyi/manufacture/service/impl/MaterialRequisitionInfoServiceImpl.java
  6. 212
      ruoyi-admin/src/main/resources/mapper/manufacture/MaterialRequisitionInfoMapper.xml
  7. 1594
      ruoyi-admin/src/main/resources/templates/manufacture/materialRequisitionInfo/add.html
  8. 1555
      ruoyi-admin/src/main/resources/templates/manufacture/materialRequisitionInfo/edit.html
  9. 330
      ruoyi-admin/src/main/resources/templates/manufacture/materialRequisitionInfo/materialRequisitionInfo.html

769
ruoyi-admin/src/main/java/com/ruoyi/manufacture/controller/MaterialRequisitionInfoController.java

@ -1,769 +0,0 @@
//package com.ruoyi.manufacture.controller;
//
//import com.alibaba.excel.EasyExcel;
//import com.alibaba.excel.ExcelWriter;
//import com.alibaba.excel.util.MapUtils;
//import com.alibaba.excel.write.metadata.WriteSheet;
//import com.alibaba.excel.write.metadata.fill.FillConfig;
//import com.alibaba.excel.write.metadata.fill.FillWrapper;
//import com.alibaba.excel.write.metadata.style.WriteCellStyle;
//import com.alibaba.excel.write.style.HorizontalCellStyleStrategy;
//import com.ruoyi.ck.utils.Result;
//import com.ruoyi.common.annotation.Log;
//import com.ruoyi.common.core.controller.BaseController;
//import com.ruoyi.common.core.domain.AjaxResult;
//import com.ruoyi.common.core.page.TableDataInfo;
//import com.ruoyi.common.enums.BusinessType;
//import com.ruoyi.common.utils.poi.ExcelUtil;
//import com.ruoyi.manufacture.domain.MaterialRequisitionDetail;
//import com.ruoyi.manufacture.domain.MaterialRequisitionInfo;
//import com.ruoyi.manufacture.domain.WorkOrderInfo;
//import com.ruoyi.manufacture.domain.exportDto.MaterialRequisitionDetailDto;
//import com.ruoyi.manufacture.domain.exportDto.MaterialRequisitionInfoDto;
//import com.ruoyi.manufacture.domain.exportDto.WorkOrderInfoDto;
//import com.ruoyi.manufacture.service.IMaterialRequisitionDetailService;
//import com.ruoyi.manufacture.service.IMaterialRequisitionInfoService;
//import com.ruoyi.manufacture.service.IWorkOrderInfoService;
//import com.ruoyi.system.domain.*;
//import com.ruoyi.system.service.*;
//import com.ruoyi.system.utils.ExcelFillCellMergePrevColUtils;
//import org.apache.poi.ss.usermodel.HorizontalAlignment;
//import org.apache.poi.ss.usermodel.VerticalAlignment;
//import org.apache.poi.xssf.usermodel.XSSFWorkbook;
//import org.apache.shiro.authz.annotation.RequiresPermissions;
//import org.springframework.beans.BeanUtils;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Controller;
//import org.springframework.ui.ModelMap;
//import org.springframework.web.bind.annotation.*;
//
//import javax.servlet.http.HttpServletResponse;
//import java.io.*;
//import java.net.URLEncoder;
//import java.text.SimpleDateFormat;
//import java.util.*;
//
//import static com.ruoyi.common.config.datasource.DynamicDataSourceContextHolder.log;
//
///**
// * 领料单Controller
// *
// * @author ruoyi
// * @date 2023-04-06
// */
//@Controller
//@RequestMapping("/manufacture/materialRequisitionInfo")
//public class MaterialRequisitionInfoController extends BaseController
//{
// private String prefix = "manufacture/materialRequisitionInfo";
// private String prefixRaw = "manufacture/materialRequisitionYL";
// private String prefixSubsidiary = "manufacture/materialRequisitionFL";
// private String prefixBcp = "manufacture/materialRequisitionBCP";
// private String prefixOutsource = "outsource/materialRequisitionOutsource";
//
// //excel数据量
// private Integer excelSize = 28;
//
// @Autowired
// private IMaterialRequisitionInfoService materialRequisitionInfoService;
// @Autowired
// private IMaterialRequisitionDetailService materialRequisitionDetailService;
// @Autowired
// private ISysDictTypeService sysDictTypeService;
// @Autowired
// private ISysBomService sysBomService;
// @Autowired
// private ISysBomBcpService sysBomBcpService;
// @Autowired
// private ISysBomRawMaterialService sysBomRawMaterialService;
// @Autowired
// private ISysBomSubsidiaryMaterialService sysBomSubsidiaryMaterialService;
// @Autowired
// private IWorkOrderInfoService workOrderInfoService;
// @Autowired
// private IOutsourceOrderMaterialService outsourceOrderMaterialService;
// @Autowired
// private ISysFinishProductService sysFinishProductService;
//
//
//// @RequiresPermissions("manufacture:materialRequisitionInfo:view")
//// @GetMapping()
//// public String materialRequisitionInfo()
//// {
//// return prefix + "/materialRequisitionInfo";
//// }
//
// @RequiresPermissions("manufacture:materialRequisitionInfo:viewRaw")
// @GetMapping("/viewRaw")
// public String materialRequisitionRaw()
// {
// return prefixRaw + "/materialRequisitionYL";
// }
//
// @RequiresPermissions("manufacture:materialRequisitionInfo:viewSubsidiary")
// @GetMapping("/viewSubsidiary")
// public String materialRequisitionSubsidiary()
// {
// return prefixSubsidiary + "/materialRequisitionFL";
// }
//
// @RequiresPermissions("manufacture:materialRequisitionInfo:viewBcp")
// @GetMapping("/viewBcp")
// public String materialRequisitionBcp()
// {
// return prefixBcp + "/materialRequisitionBCP";
// }
//
// @RequiresPermissions("manufacture:materialRequisitionInfo:viewOutsource")
// @GetMapping("/viewOutsource")
// public String materialRequisitionOutsource()
// {
// return prefixOutsource + "/materialRequisitionOutsource";
// }
//
// /**
// * 查询领料单列表
// */
//// @RequiresPermissions("manufacture:materialRequisitionInfo:list")
//// @PostMapping("/list")
//// @ResponseBody
//// public TableDataInfo list(MaterialRequisitionInfo materialRequisitionInfo)
//// {
//// startPage();
//// List<MaterialRequisitionInfo> list = materialRequisitionInfoService.selectMaterialRequisitionInfoList(materialRequisitionInfo);
//// return getDataTable(list);
//// }
//
// @RequiresPermissions("manufacture:materialRequisitionInfo:listRaw")
// @PostMapping("/listRaw")
// @ResponseBody
// public TableDataInfo listRaw(MaterialRequisitionInfo materialRequisitionInfo)
// {
// startPage();
// List<MaterialRequisitionInfo> list = materialRequisitionInfoService.selectMaterialRequisitionInfoListRaw(materialRequisitionInfo);
// return getDataTable(list);
// }
// @RequiresPermissions("manufacture:materialRequisitionInfo:listSubsidiary")
// @PostMapping("/listSubsidiary")
// @ResponseBody
// public TableDataInfo listSubsidiary(MaterialRequisitionInfo materialRequisitionInfo)
// {
// startPage();
// List<MaterialRequisitionInfo> list = materialRequisitionInfoService.selectMaterialRequisitionInfoListSubsidiary(materialRequisitionInfo);
// return getDataTable(list);
// }
// @RequiresPermissions("manufacture:materialRequisitionInfo:listBcp")
// @PostMapping("/listBcp")
// @ResponseBody
// public TableDataInfo listBcp(MaterialRequisitionInfo materialRequisitionInfo)
// {
// startPage();
// List<MaterialRequisitionInfo> list = materialRequisitionInfoService.selectMaterialRequisitionInfoListBcp(materialRequisitionInfo);
// return getDataTable(list);
// }
// @RequiresPermissions("manufacture:materialRequisitionInfo:listOutsource")
// @PostMapping("/listOutsource")
// @ResponseBody
// public TableDataInfo listOutsource(MaterialRequisitionInfo materialRequisitionInfo)
// {
// startPage();
// List<MaterialRequisitionInfo> list = materialRequisitionInfoService.selectMaterialRequisitionInfoListOutsource(materialRequisitionInfo);
// return getDataTable(list);
// }
//
// /**
// * 导出领料单列表
// */
// @RequiresPermissions("manufacture:materialRequisitionInfo:export")
// @Log(title = "领料单", businessType = BusinessType.EXPORT)
// @PostMapping("/export")
// @ResponseBody
// public AjaxResult export(MaterialRequisitionInfo materialRequisitionInfo)
// {
// List<MaterialRequisitionInfo> list = materialRequisitionInfoService.selectMaterialRequisitionInfoList(materialRequisitionInfo);
// ExcelUtil<MaterialRequisitionInfo> util = new ExcelUtil<MaterialRequisitionInfo>(MaterialRequisitionInfo.class);
// return util.exportExcel(list, "领料单数据");
// }
//
// /**
// * 新增领料单
// */
// @GetMapping("/add")
// public String add()
// {
// return prefix + "/add";
// }
//
// @GetMapping("/addRaw")
// public String addRaw()
// {
// return prefixRaw + "/add";
// }
//
// @GetMapping("/addSubsidiary")
// public String addSubsidiary()
// {
// return prefixSubsidiary + "/add";
// }
//
// @GetMapping("/addBcp")
// public String addBcp()
// {
// return prefixBcp + "/add";
// }
// @GetMapping("/addOutsource")
// public String addOutsource()
// {
// return prefixOutsource + "/add";
// }
//
// /**
// * 新增保存领料单
// */
// @RequiresPermissions("manufacture:materialRequisitionInfo:add")
// @Log(title = "领料单", businessType = BusinessType.INSERT)
// @PostMapping("/add")
// @ResponseBody
// public AjaxResult addSave(MaterialRequisitionInfo materialRequisitionInfo)
// {
// return toAjax(materialRequisitionInfoService.insertMaterialRequisitionInfo(materialRequisitionInfo));
// }
//
// /**
// * 修改领料单
// */
//// @GetMapping("/edit/{materialRequisitionId}")
//// public String edit(@PathVariable("materialRequisitionId") Long materialRequisitionId, ModelMap mmap)
//// {
//// MaterialRequisitionInfo materialRequisitionInfo = materialRequisitionInfoService.selectMaterialRequisitionInfoById(materialRequisitionId);
//// mmap.put("materialRequisitionInfo", materialRequisitionInfo);
//// return prefix + "/edit";
//// }
//
// @GetMapping("/editRaw/{materialRequisitionId}")
// public String editRaw(@PathVariable("materialRequisitionId") Long materialRequisitionId, ModelMap mmap)
// {
// MaterialRequisitionInfo materialRequisitionInfo = materialRequisitionInfoService.selectMaterialRequisitionInfoById(materialRequisitionId);
// mmap.put("materialRequisitionInfo", materialRequisitionInfo);
// return prefixRaw + "/edit";
// }
// @GetMapping("/editSubsidiary/{materialRequisitionId}")
// public String editSubsidiary(@PathVariable("materialRequisitionId") Long materialRequisitionId, ModelMap mmap)
// {
// MaterialRequisitionInfo materialRequisitionInfo = materialRequisitionInfoService.selectMaterialRequisitionInfoById(materialRequisitionId);
// mmap.put("materialRequisitionInfo", materialRequisitionInfo);
// return prefixSubsidiary + "/edit";
// }
// @GetMapping("/editBcp/{materialRequisitionId}")
// public String editBcp(@PathVariable("materialRequisitionId") Long materialRequisitionId, ModelMap mmap)
// {
// MaterialRequisitionInfo materialRequisitionInfo = materialRequisitionInfoService.selectMaterialRequisitionInfoById(materialRequisitionId);
// mmap.put("materialRequisitionInfo", materialRequisitionInfo);
// return prefixBcp + "/edit";
// }
// @GetMapping("/editOutsource/{materialRequisitionId}")
// public String editOutsource(@PathVariable("materialRequisitionId") Long materialRequisitionId, ModelMap mmap)
// {
// MaterialRequisitionInfo materialRequisitionInfo = materialRequisitionInfoService.selectMaterialRequisitionInfoById(materialRequisitionId);
// mmap.put("materialRequisitionInfo", materialRequisitionInfo);
// return prefixOutsource + "/edit";
// }
// /**
// * 修改保存领料单
// */
// @RequiresPermissions("manufacture:materialRequisitionInfo:edit")
// @Log(title = "领料单", businessType = BusinessType.UPDATE)
// @PostMapping("/edit")
// @ResponseBody
// public AjaxResult editSave(MaterialRequisitionInfo materialRequisitionInfo)
// {
// return toAjax(materialRequisitionInfoService.updateMaterialRequisitionInfo(materialRequisitionInfo));
// }
//
// /**
// * 删除领料单
// */
// @RequiresPermissions("manufacture:materialRequisitionInfo:remove")
// @Log(title = "领料单", businessType = BusinessType.DELETE)
// @PostMapping( "/remove")
// @ResponseBody
// public AjaxResult remove(@RequestParam(value = "ids") String ids)
// {
// return toAjax(materialRequisitionInfoService.deleteMaterialRequisitionInfoByIds(ids));
// }
//
// @RequiresPermissions("manufacture:materialRequisitionInfo:remove")
// @Log(title = "领料单", businessType = BusinessType.DELETE)
// @RequestMapping( "/removeSelected")
// @ResponseBody
// public String removeSelected(@RequestParam(value = "ids") String ids) {
// System.out.println(ids);
// String[] idsStr = ids.split(",");
// for (int i = 0; i< idsStr.length; i++) {
// MaterialRequisitionInfo materialRequisitionInfo = materialRequisitionInfoService.selectMaterialRequisitionInfoById(Long.valueOf(idsStr[i]));
// MaterialRequisitionDetail materialRequisitionDetail = new MaterialRequisitionDetail();
// materialRequisitionDetail.setMaterialRequisitionNumber(materialRequisitionInfo.getMaterialRequisitionNumber());
// List<MaterialRequisitionDetail> list = materialRequisitionDetailService.selectMaterialRequisitionDetailList(materialRequisitionDetail);
// if (list.size()>0) {
// for (int j=0;j<list.size();j++) {
// materialRequisitionDetailService.deleteMaterialRequisitionDetailById(list.get(j).getMaterialRequisitionDetailId());
// }
// }
// }
// materialRequisitionInfoService.deleteMaterialRequisitionInfoByIds(ids);
// return "操作成功!";
// }
//
//
// @PostMapping("/id")
// @ResponseBody
// public Result getId() throws Exception {
// return Result.getSuccessResult(materialRequisitionInfoService.getId());
// }
//
// /**
// * 获取订单id
// * @return
// * @throws Exception
// */
// @PostMapping("/getRawId")
// @ResponseBody
// public Result getRawId() throws Exception {
// return Result.getSuccessResult(materialRequisitionInfoService.getRawId());
// }
// @PostMapping("/getSubsidiaryId")
// @ResponseBody
// public Result getSubsidiaryId() throws Exception {
// return Result.getSuccessResult(materialRequisitionInfoService.getSubsidiaryId());
// }
// @PostMapping("/getBcpId")
// @ResponseBody
// public Result getBcpId() throws Exception {
// return Result.getSuccessResult(materialRequisitionInfoService.getBcpId());
// }
//
// @PostMapping("/getOutsourceId")
// @ResponseBody
// public Result getOutsourceId() throws Exception {
// return Result.getSuccessResult(materialRequisitionInfoService.getOutsourceId());
// }
//
//
// /**
// * 导出领料单列表
// */
// @RequiresPermissions("manufacture:materialRequisitionInfo:export")
// @Log(title = "领料单", businessType = BusinessType.EXPORT)
// @PostMapping("/exportSelected/{materialRequisitionId}")
// @ResponseBody
// public void exportSelected(@PathVariable("materialRequisitionId") Long materialRequisitionId, HttpServletResponse response) throws IOException {
////
//
// System.out.println(materialRequisitionId);
// //领料单基础信息
// MaterialRequisitionInfo materialRequisitionInfo = materialRequisitionInfoService.selectMaterialRequisitionInfoById(materialRequisitionId);
// MaterialRequisitionInfoDto materialRequisitionInfoDto = new MaterialRequisitionInfoDto();
// BeanUtils.copyProperties(materialRequisitionInfo,materialRequisitionInfoDto);
//
// //查询制工单信息
// WorkOrderInfo workOrderInfo = new WorkOrderInfo();
// workOrderInfo.setWorkOrderNumber(materialRequisitionInfo.getWorkOrderNumber());
// List<WorkOrderInfo> workOrderInfoList = workOrderInfoService.selectWorkOrderInfoList(workOrderInfo);
// WorkOrderInfoDto workOrderInfoDto = new WorkOrderInfoDto();
// String specificationModel = "";
// String versionNumber = "";
// if (workOrderInfoList.size() == 1) {
// BeanUtils.copyProperties(workOrderInfoList.get(0),workOrderInfoDto);
// specificationModel = workOrderInfoDto.getSpecificationModel();
// versionNumber = workOrderInfoDto.getVersionNumber();
// }
//
// //查询物料信息
// MaterialRequisitionDetail materialRequisitionDetail = new MaterialRequisitionDetail();
// materialRequisitionDetail.setMaterialRequisitionNumber(materialRequisitionInfo.getMaterialRequisitionNumber());
//
// // 创建列合并工具类对象
// ExcelFillCellMergePrevColUtils mergePrevColUtils = new ExcelFillCellMergePrevColUtils();
//
// //领料单包含的物料
// List<MaterialRequisitionDetail> materialRequisitionDetailList = materialRequisitionDetailService.selectMaterialRequisitionDetailList(materialRequisitionDetail);
// List<MaterialRequisitionDetailDto> materialRequisitionDetailDtoList = new ArrayList<>();
//
// try {
// int number = 0;
// Iterator values= materialRequisitionDetailList.iterator();
// while(values.hasNext()) {
// Object source = values.next();
// MaterialRequisitionDetailDto target = MaterialRequisitionDetailDto.class.newInstance();
// BeanUtils.copyProperties(source, target);
// target.setNumber(++number);
// materialRequisitionDetailDtoList.add(target);
//// getBomDetail(number, target.getMaterialCode(), materialRequisitionDetailDtoList);
// }
// int size = materialRequisitionDetailDtoList.size();
// if (materialRequisitionDetailDtoList.size()<excelSize) {
// int excelMinus = excelSize-size;
// for (int i =0;i<excelMinus;i++) {
// MaterialRequisitionDetailDto materialRequisitionDetailDto = new MaterialRequisitionDetailDto();
// materialRequisitionDetailDto.setNumber(++number);
// materialRequisitionDetailDto.setMaterialCode("");
// materialRequisitionDetailDto.setMaterialName("");
// materialRequisitionDetailDto.setSpecificationModel("");
// materialRequisitionDetailDto.setItemNumber("");
// materialRequisitionDetailDto.setInventoryUnit("");
// materialRequisitionDetailDto.setPlanQuantity("");
// materialRequisitionDetailDto.setUnitUsage("");
// materialRequisitionDetailDto.setStorageLocation("");
// materialRequisitionDetailDto.setActualQuantity("");
// materialRequisitionDetailDtoList.add(materialRequisitionDetailDto);
// }
// }
// }catch (Exception e) {
// log.error(">>>>>>异常<<<<<<", e);
// }
// System.out.println(materialRequisitionDetailDtoList);
//
// response.setCharacterEncoding("utf-8");
// String fileName = URLEncoder.encode("领料单", "UTF-8").replaceAll("\\+", "%20");
// response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx");
// String templateFileName = "C:\\exportTemplates\\exportMaterialRequisition.xlsx";
// try (ExcelWriter excelWriter = EasyExcel
// .write(response.getOutputStream(), MaterialRequisitionDetailDto.class)
// .withTemplate(templateFileName)
//// .registerWriteHandler(mergePrevColUtils)
// //样式注册
// .registerWriteHandler(horizontalCellStyleStrategyBuilder())
// .build()) {
// WriteSheet writeSheet = EasyExcel.writerSheet().build();
// FillConfig fillConfig = FillConfig.builder().forceNewRow(Boolean.TRUE).build();
// excelWriter.fill(materialRequisitionDetailDtoList, fillConfig, writeSheet);
// Map<String, Object> map = MapUtils.newHashMap();
//// map.put("date", DateTimeFormatter.ofPattern("yyyy/MM/dd").format(LocalDateTime.now()));
// map.put("materialRequisitionNumber", materialRequisitionInfoDto.getMaterialRequisitionNumber());
// map.put("salesOrderNumber", materialRequisitionInfoDto.getSalesOrderNumber());
// map.put("workOrderNumber", materialRequisitionInfoDto.getWorkOrderNumber());
// map.put("firstAddTime", materialRequisitionInfoDto.getFirstAddTime());
// map.put("outputDate", materialRequisitionInfoDto.getOutputDate());
//// List<SysDictData> deptData = sysDictTypeService.selectDictDataByType("sys_dept_type");
//// for (int i = 0;i<deptData.size();i++) {
//// if (materialRequisitionInfoDto.getDeptName().equals(deptData.get(i).getDictValue())) {
//// map.put("deptName", deptData.get(i).getDictLabel());
//// }
//// }
//// map.put("deptName", materialRequisitionInfoDto.getDeptName());
//
// map.put("deptName", materialRequisitionInfoDto.getDeptName());
// map.put("finishProductCode", materialRequisitionInfoDto.getFinishProductCode());
// map.put("workOrderQuantity", materialRequisitionInfoDto.getWorkOrderQuantity());
// map.put("typeMachine", materialRequisitionInfoDto.getTypeMachine());
// map.put("specificationModel", specificationModel);
// map.put("versionNumber", versionNumber);
// excelWriter.fill(map, writeSheet);
// }
// }
//
// public void getBomDetail(Integer number, String materialCode, List<MaterialRequisitionDetailDto> materialRequisitionDetailDtoList) {
// //获取bom信息
// //判断是否有bom
// SysBom sysBom = new SysBom();
// sysBom.setFinishProductCode(materialCode);
// List<SysBom> sysBomList = sysBomService.selectSysBomList(sysBom);
// //如果是半成品,则继续查询
// if (sysBomList.size() != 0) {
// //先查询原料
// SysBomRawMaterial sysBomRawMaterial = new SysBomRawMaterial();
// sysBomRawMaterial.setFinishProductCode(sysBomList.get(0).getFinishProductCode());
// List<SysBomRawMaterial> sysBomRawMaterialList = sysBomRawMaterialService.selectSysBomRawMaterialList(sysBomRawMaterial);
// try {
//// Iterator values1= sysBomRawMaterialList.iterator();
// for (int i = 0; i < sysBomRawMaterialList.size(); i++){
// MaterialRequisitionDetailDto target1 = MaterialRequisitionDetailDto.class.newInstance();
//// BeanUtils.copyProperties(source1, target1);
// target1.setNumber(++number);
// target1.setMaterialCode(sysBomRawMaterialList.get(i).getRawMaterialCode());
// target1.setMaterialName(sysBomRawMaterialList.get(i).getRawMaterialName());
// target1.setSpecificationModel(sysBomRawMaterialList.get(i).getSpecificationModel());
// target1.setItemNumber(sysBomRawMaterialList.get(i).getSupplierNumber());
// target1.setInventoryUnit(sysBomRawMaterialList.get(i).getInventoryUnit());
// target1.setUnitUsage(sysBomRawMaterialList.get(i).getRawMaterialConsumption());
// materialRequisitionDetailDtoList.add(target1);
// getBomDetail(number,sysBomRawMaterialList.get(i).getRawMaterialCode(),materialRequisitionDetailDtoList);
// }
// } catch (Exception e) {
// log.error(">>>>>>异常<<<<<<", e);
// }
// }
// }
//
//
// /**
// * 导出领料单列表
// */
// @RequiresPermissions("manufacture:materialRequisitionInfo:export")
// @Log(title = "领料单", businessType = BusinessType.EXPORT)
// @PostMapping("/exportSelectedOutSource/{materialRequisitionId}")
// @ResponseBody
// public void exportSelectedOutSource(@PathVariable("materialRequisitionId") Long materialRequisitionId, HttpServletResponse response) throws IOException {
////
//
// System.out.println(materialRequisitionId);
// MaterialRequisitionInfo materialRequisitionInfo = materialRequisitionInfoService.selectMaterialRequisitionInfoById(materialRequisitionId);
// MaterialRequisitionInfoDto materialRequisitionInfoDto = new MaterialRequisitionInfoDto();
// BeanUtils.copyProperties(materialRequisitionInfo,materialRequisitionInfoDto);
//
// MaterialRequisitionDetail materialRequisitionDetail = new MaterialRequisitionDetail();
// materialRequisitionDetail.setMaterialRequisitionNumber(materialRequisitionInfo.getMaterialRequisitionNumber());
//
// // 创建列合并工具类对象
// ExcelFillCellMergePrevColUtils mergePrevColUtils = new ExcelFillCellMergePrevColUtils();
//
// List<MaterialRequisitionDetail> materialRequisitionDetailList = materialRequisitionDetailService.selectMaterialRequisitionDetailList(materialRequisitionDetail);
// List<MaterialRequisitionDetailDto> materialRequisitionDetailDtoList = new ArrayList<>();
//
// try {
// int number = 0;
// Iterator values= materialRequisitionDetailList.iterator();
// while(values.hasNext()) {
// Object source = values.next();
// MaterialRequisitionDetailDto target = MaterialRequisitionDetailDto.class.newInstance();
// BeanUtils.copyProperties(source, target);
// mergePrevColUtils.add(number+5,1,1);
// mergePrevColUtils.add(number+5,4,1);
// target.setNumber(++number);
// materialRequisitionDetailDtoList.add(target);
// }
// }catch (Exception e) {
// log.error(">>>>>>异常<<<<<<", e);
// }
// System.out.println(materialRequisitionDetailDtoList);
//
// response.setCharacterEncoding("utf-8");
// String fileName = URLEncoder.encode("委外领料单", "UTF-8").replaceAll("\\+", "%20");
// response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx");
// String templateFileName = "C:\\exportTemplates\\exportMaterialRequisitionOutsource.xlsx";
// try (ExcelWriter excelWriter = EasyExcel
// .write(response.getOutputStream(), MaterialRequisitionDetailDto.class)
// .withTemplate(templateFileName)
// .registerWriteHandler(mergePrevColUtils)
// //样式注册
// .registerWriteHandler(horizontalCellStyleStrategyBuilder())
// .build()) {
// WriteSheet writeSheet = EasyExcel.writerSheet().build();
// FillConfig fillConfig = FillConfig.builder().forceNewRow(Boolean.TRUE).build();
// excelWriter.fill(materialRequisitionDetailDtoList, fillConfig, writeSheet);
// Map<String, Object> map = MapUtils.newHashMap();
//// map.put("date", DateTimeFormatter.ofPattern("yyyy/MM/dd").format(LocalDateTime.now()));
// map.put("materialRequisitionNumber", materialRequisitionInfoDto.getMaterialRequisitionNumber());
// map.put("outsourceOrderNumber", materialRequisitionInfoDto.getOutsourceOrderNumber());
// map.put("supplierCode", materialRequisitionInfoDto.getWorkOrderNumber());
// map.put("supplierName", materialRequisitionInfoDto.getFirstAddTime());
// map.put("outputDate", materialRequisitionInfoDto.getOutputDate());
// map.put("materialRequisitionPerson", materialRequisitionInfoDto.getMaterialRequisitionPerson());
// excelWriter.fill(map, writeSheet);
// }
// }
//
//
// public HorizontalCellStyleStrategy horizontalCellStyleStrategyBuilder() {
// WriteCellStyle headWriteCellStyle = new WriteCellStyle();
// //设置头字体
//// WriteFont headWriteFont = new WriteFont();
//// headWriteFont.setFontHeightInPoints((short) 13);
//// headWriteFont.setBold(true);
//// headWriteCellStyle.setWriteFont(headWriteFont);
// //设置头居中
// headWriteCellStyle.setHorizontalAlignment(HorizontalAlignment.CENTER);
//
// //内容策略
// WriteCellStyle contentWriteCellStyle = new WriteCellStyle();
// //设置 水平居中
// contentWriteCellStyle.setHorizontalAlignment(HorizontalAlignment.CENTER);
// //垂直居中
// contentWriteCellStyle.setVerticalAlignment(VerticalAlignment.CENTER);
// //单元格边框
//// contentWriteCellStyle.setBorderTop(BorderStyle.THIN);
//// contentWriteCellStyle.setBorderLeft(BorderStyle.THIN);
//// contentWriteCellStyle.setBorderRight(BorderStyle.THIN);
//// contentWriteCellStyle.setBorderBottom(BorderStyle.THIN);
//
// return new HorizontalCellStyleStrategy(headWriteCellStyle, contentWriteCellStyle);
// }
//
// /**
// * 查询委外领料单物料明细List
// */
//// @RequiresPermissions("manufacture:materialRequisitionInfo:listOutsource")
// @PostMapping("/selectOutsourceDetail/{outsourceOrderNumber}")
// @ResponseBody
// public TableDataInfo selectOutsourceDetail(@PathVariable("outsourceOrderNumber")String outsourceOrderNumber){
// startPage();
// //委外订单
// List<OutsourceOrderMaterial> orderMaterialList = outsourceOrderMaterialService.selectOutsourceOrderMaterialList(new OutsourceOrderMaterial(outsourceOrderNumber));
// //委外明细
// List<MaterialRequisitionDetail> materialRequisitionDetailList = new ArrayList<>();
// //bom阶
// int bomRank = 1;
// for (OutsourceOrderMaterial outsourceOrderMaterial : orderMaterialList) {
// List<MaterialRequisitionDetail> list = sysBomBcpAllList(bomRank,Double.valueOf(outsourceOrderMaterial.getQuantity()),new SysBomBcp(outsourceOrderMaterial.getMaterialCode()));
// if (list.size()>0){
// materialRequisitionDetailList.addAll(list);
// }
// }
// return getDataTable(materialRequisitionDetailList);
// }
//
// @RequiresPermissions("manufacture:materialRequisitionInfo:export")
// @Log(title = "领料单", businessType = BusinessType.EXPORT)
// @PostMapping("/exportOutsource/{materialRequisitionId}")
// @ResponseBody
// public void exportOutsource(@PathVariable("materialRequisitionId") Long materialRequisitionId, HttpServletResponse response) throws IOException {
// //委外领料
// MaterialRequisitionInfo materialRequisitionInfo = materialRequisitionInfoService.selectMaterialRequisitionInfoById(materialRequisitionId);
// //委外订单
// List<OutsourceOrderMaterial> orderMaterialList = outsourceOrderMaterialService.selectOutsourceOrderMaterialList(new OutsourceOrderMaterial(materialRequisitionInfo.getOutsourceOrderNumber()));
//
// response.setCharacterEncoding("utf-8");
// String fileName = URLEncoder.encode("委外领料单", "UTF-8").replaceAll("\\+", "%20");
// response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx");
// String templateFileName = "C:\\exportTemplates\\exportMaterialRequisitionOutsource.xlsx";
//
// ExcelFillCellMergePrevColUtils mergePrevColUtils = new ExcelFillCellMergePrevColUtils();
// Map<OutsourceOrderMaterial,List<MaterialRequisitionDetailDto>> map = new HashMap<>();
// for (OutsourceOrderMaterial orderMaterial : orderMaterialList) {
// List<MaterialRequisitionDetail> materialRequisitionDetailList = exportOutsourceList(materialRequisitionInfo.getMaterialRequisitionNumber(), orderMaterial.getMaterialCode());
// List<MaterialRequisitionDetailDto> materialRequisitionDetailDtoList = new ArrayList<>();
// try {
// int number = 0;
// Iterator materialRequisitionDetailValues = materialRequisitionDetailList.iterator();
// while (materialRequisitionDetailValues.hasNext()) {
// Object detailValues = materialRequisitionDetailValues.next();
// MaterialRequisitionDetailDto detailDto = new MaterialRequisitionDetailDto();
// BeanUtils.copyProperties(detailValues, detailDto);
// detailDto.setNumber(++number);
// materialRequisitionDetailDtoList.add(detailDto);
// }
// } catch (Exception e) {
// log.error(">>>>>>异常OutboundDetailDto<<<<<<", e);
// }
// map.put(orderMaterial,materialRequisitionDetailDtoList);
// }
//
// File file = new File(templateFileName);
// try(FileInputStream fileInputStream = new FileInputStream(file); ByteArrayOutputStream bos = new ByteArrayOutputStream()){
// int sheetCount = map.size();
// XSSFWorkbook workbook = new XSSFWorkbook(fileInputStream);
// for (int i = 1; i < sheetCount; i++) {
// workbook.cloneSheet(0,"sheet"+(i+1));
// }
// workbook.write(bos);
// byte[] bArray = bos.toByteArray();
// InputStream is = new ByteArrayInputStream(bArray);
// ExcelWriter excelWriter = EasyExcel.write(response.getOutputStream(), MaterialRequisitionDetailDto.class).withTemplate(is).registerWriteHandler(mergePrevColUtils).build();
// int i = 0;
// for (OutsourceOrderMaterial orderMaterial : map.keySet()) {
// List<SysFinishProduct> finishProductList = sysFinishProductService.selectSysFinishProductList(new SysFinishProduct(orderMaterial.getMaterialCode()));
// List<SysFinishProduct> list=new ArrayList<>();
// for (MaterialRequisitionDetailDto materialRequisitionDetailDto : map.get(orderMaterial)) {
// list.add(finishProductList.get(0));
// }
// WriteSheet writeSheet = EasyExcel.writerSheet(i++).build();
// FillConfig fillConfig = FillConfig.builder().forceNewRow(Boolean.TRUE).build();
// excelWriter.fill(new FillWrapper("material",map.get(orderMaterial)), fillConfig, writeSheet);
// excelWriter.fill(new FillWrapper("finish",list), writeSheet);
// Map<String, Object> excelMap = MapUtils.newHashMap();
// SimpleDateFormat format = new SimpleDateFormat("yyyy年MM月dd日");
// excelMap.put("materialRequisitionNumber", materialRequisitionInfo.getMaterialRequisitionNumber());
// excelMap.put("salesOrderNumber", materialRequisitionInfo.getOutsourceOrderNumber());
// //暂时存在问题
// excelMap.put("typeMachine",finishProductList.get(0).getTypeMachine());
// excelMap.put("firstAddTime",format.format( new SimpleDateFormat("yyyy-MM-dd").parse(materialRequisitionInfo.getFirstAddTime())));
// excelMap.put("quantity",orderMaterial.getQuantity());
// excelMap.put("finishCode",orderMaterial.getMaterialCode());
// excelMap.put("nowDate",format.format(new Date()));
// excelMap.put("deliveryDate",format.format(new SimpleDateFormat("yyyy-MM-dd").parse(orderMaterial.getDeliveryDate())));
// excelMap.put("finishName",orderMaterial.getMaterialName());
// excelWriter.fill(excelMap,writeSheet);
// }
// excelWriter.finish();
// }catch (Exception e){
// e.printStackTrace();
// }
// }
//
// private List<MaterialRequisitionDetail> exportOutsourceList(String materialRequisitionNumber,String materialCode) {
// List<MaterialRequisitionDetail> result = new ArrayList<>();
// List<MaterialRequisitionDetail> materialRequisitionDetailList = materialRequisitionDetailService.selectMaterialRequisitionDetailList(new MaterialRequisitionDetail(materialRequisitionNumber,materialCode));
// if (materialRequisitionDetailList.size()>0){
// result.addAll(materialRequisitionDetailList);
// for (MaterialRequisitionDetail materialRequisitionDetail : materialRequisitionDetailList) {
// result.addAll(exportOutsourceList(materialRequisitionNumber,materialRequisitionDetail.getMaterialCode()));
// }
// }
// return result;
// }
//
// private List<MaterialRequisitionDetail> sysBomBcpAllList(int bomRank,Double quantity,SysBomBcp sysBomBcp) {
// List<MaterialRequisitionDetail> materialRequisitionDetailList = new ArrayList<>();
// List<SysBomBcp> bomBcpList =sysBomBcpService.selectSysBomBcpList(sysBomBcp);
// List<SysBomRawMaterial> rawMaterialList = sysBomRawMaterialService.selectSysBomRawMaterialList(new SysBomRawMaterial(sysBomBcp.getFinishProductCode()));
// List<SysBomSubsidiaryMaterial> subsidiaryMaterialList = sysBomSubsidiaryMaterialService.selectSysBomSubsidiaryMaterialList(new SysBomSubsidiaryMaterial(sysBomBcp.getFinishProductCode()));
// if(rawMaterialList.size()>0){
// for (SysBomRawMaterial rawMaterial : rawMaterialList) {
// MaterialRequisitionDetail materialRequisitionDetail = new MaterialRequisitionDetail();
// materialRequisitionDetail.setMaterialCode(rawMaterial.getRawMaterialCode()); //物料代码
// materialRequisitionDetail.setMaterialName(rawMaterial.getRawMaterialName()); //物料名称
// materialRequisitionDetail.setSpecificationModel(rawMaterial.getSpecificationModel()); //规格型号
// materialRequisitionDetail.setItemNumber(rawMaterial.getSupplierNumber()); //料号
// materialRequisitionDetail.setInventoryUnit(rawMaterial.getInventoryUnit()); //单位
// materialRequisitionDetail.setUnitUsage(rawMaterial.getRawMaterialConsumption()); //单位用量
// materialRequisitionDetail.setUpFinishProductCode(rawMaterial.getFinishProductCode()); //上级半成品代码
//
// materialRequisitionDetail.setPlanQuantity(String.valueOf(Double.valueOf(rawMaterial.getRawMaterialConsumption()) * quantity)); //计划数量
// materialRequisitionDetail.setMaterialType("原料"); //物料类别
// materialRequisitionDetail.setBomRank(String.valueOf(bomRank)); //bom阶
// materialRequisitionDetailList.add(materialRequisitionDetail);
// }
// }
// if (subsidiaryMaterialList.size()>0){
// for (SysBomSubsidiaryMaterial subsidiaryMaterial : subsidiaryMaterialList) {
// MaterialRequisitionDetail materialRequisitionDetail = new MaterialRequisitionDetail();
// materialRequisitionDetail.setMaterialCode(subsidiaryMaterial.getSubsidiaryMaterialCode()); //物料代码
// materialRequisitionDetail.setMaterialName(subsidiaryMaterial.getSubsidiaryMaterialName()); //物料名称
// materialRequisitionDetail.setSpecificationModel(subsidiaryMaterial.getSpecificationModel()); //规格型号
// materialRequisitionDetail.setItemNumber(subsidiaryMaterial.getSupplierNumber()); //料号
// materialRequisitionDetail.setInventoryUnit(subsidiaryMaterial.getInventoryUnit()); //单位
// materialRequisitionDetail.setUnitUsage(subsidiaryMaterial.getSubsidiaryMaterialConsumption()); //单位用量
// materialRequisitionDetail.setUpFinishProductCode(subsidiaryMaterial.getFinishProductCode()); //上级半成品代码
//
// materialRequisitionDetail.setPlanQuantity(String.valueOf(Double.valueOf(subsidiaryMaterial.getSubsidiaryMaterialConsumption())*quantity)); //计划数量
// materialRequisitionDetail.setMaterialType("辅料"); //物料类别
// materialRequisitionDetail.setBomRank(String.valueOf(bomRank)); //bom阶
// materialRequisitionDetailList.add(materialRequisitionDetail);
// }
// }
//
// if(bomBcpList.size()>0){
// for (SysBomBcp bomBcp : bomBcpList) {
// quantity = Double.valueOf(bomBcp.getBcpMaterialConsumption())*quantity;
//
// MaterialRequisitionDetail materialRequisitionDetail = new MaterialRequisitionDetail();
// materialRequisitionDetail.setMaterialCode(bomBcp.getBcpCode()); //物料代码
// materialRequisitionDetail.setMaterialName(bomBcp.getBcpName()); //物料名称
// materialRequisitionDetail.setSpecificationModel(bomBcp.getSpecificationModel()); //规格型号
// materialRequisitionDetail.setItemNumber(bomBcp.getCustomerNumber()); //料号
// materialRequisitionDetail.setInventoryUnit(bomBcp.getInventoryUnit()); //单位
// materialRequisitionDetail.setUnitUsage(bomBcp.getBcpMaterialConsumption()); //单位用量
// materialRequisitionDetail.setUpFinishProductCode(bomBcp.getFinishProductCode()); //上级半成品代码
//
// materialRequisitionDetail.setPlanQuantity(String.valueOf(quantity)); //计划数量
// materialRequisitionDetail.setMaterialType("半成品"); //物料类别
// materialRequisitionDetail.setBomRank(String.valueOf(bomRank)); //bom阶
// materialRequisitionDetailList.add(materialRequisitionDetail);
//
// List<MaterialRequisitionDetail> list = sysBomBcpAllList(bomRank+1,quantity,new SysBomBcp(bomBcp.getBomBcpId(),bomBcp.getBcpCode()));
// materialRequisitionDetailList.addAll(list);
// }
// }
// return materialRequisitionDetailList;
// }
//}

369
ruoyi-admin/src/main/java/com/ruoyi/manufacture/domain/MaterialRequisitionInfo.java

@ -1,369 +0,0 @@
package com.ruoyi.manufacture.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* 领料单对象 material_requisition_info
*
* @author ruoyi
* @date 2023-04-06
*/
public class MaterialRequisitionInfo extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 领料单id */
private Long materialRequisitionId;
/** 领料单号 */
@Excel(name = "领料单号")
private String materialRequisitionNumber;
/** 订单号码 */
@Excel(name = "订单号码")
private String salesOrderNumber;
/** 制工单号 */
@Excel(name = "制工单号")
private String workOrderNumber;
/** 领料部门 */
@Excel(name = "领料部门")
private String deptName;
/** 领料人 */
@Excel(name = "领料人")
private String materialRequisitionPerson;
/** 部门编号 */
@Excel(name = "部门编号")
private String deptNumber;
/** 仓库编号 */
@Excel(name = "仓库编号")
private String stockNumber;
/** 仓库名称 */
@Excel(name = "仓库名称")
private String stockName;
/** 仓库管理员 */
@Excel(name = "仓库管理员")
private String stockManager;
/** 出库类型 */
@Excel(name = "出库类型")
private String outputClass;
/** 出库日期 */
@Excel(name = "出库日期")
private String outputDate;
/** 成品代码 */
@Excel(name = "成品代码")
private String finishProductCode;
/** 机种 */
@Excel(name = "机种")
private String typeMachine;
/** 工单数量 */
@Excel(name = "工单数量")
private String workOrderQuantity;
/** 备注内容 */
@Excel(name = "备注内容")
private String remarkContent;
/** 领料否 */
@Excel(name = "领料否")
private String getMaterialFlag;
/** 录入时间 */
@Excel(name = "录入时间")
private String firstAddTime;
/** 修改时间 */
@Excel(name = "修改时间")
private String updateInfoTime;
/** 备用一 */
private String standbyOne;
/** 备用二 */
private String standbyTwo;
/** 委外单号 */
@Excel(name = "委外单号")
private String outsourceOrderNumber;
/** 生产批号 */
@Excel(name = "生产批号")
private String batchNumber;
/** 厂商编号 */
@Excel(name = "厂商编号")
private String supplierCode;
/** 厂商名称 */
@Excel(name = "厂商名称")
private String supplierName;
public void setMaterialRequisitionId(Long materialRequisitionId)
{
this.materialRequisitionId = materialRequisitionId;
}
public Long getMaterialRequisitionId()
{
return materialRequisitionId;
}
public void setMaterialRequisitionNumber(String materialRequisitionNumber)
{
this.materialRequisitionNumber = materialRequisitionNumber;
}
public String getMaterialRequisitionNumber()
{
return materialRequisitionNumber;
}
public void setSalesOrderNumber(String salesOrderNumber)
{
this.salesOrderNumber = salesOrderNumber;
}
public String getSalesOrderNumber()
{
return salesOrderNumber;
}
public void setWorkOrderNumber(String workOrderNumber)
{
this.workOrderNumber = workOrderNumber;
}
public String getWorkOrderNumber()
{
return workOrderNumber;
}
public void setDeptName(String deptName)
{
this.deptName = deptName;
}
public String getDeptName()
{
return deptName;
}
public void setMaterialRequisitionPerson(String materialRequisitionPerson)
{
this.materialRequisitionPerson = materialRequisitionPerson;
}
public String getMaterialRequisitionPerson()
{
return materialRequisitionPerson;
}
public void setDeptNumber(String deptNumber)
{
this.deptNumber = deptNumber;
}
public String getDeptNumber()
{
return deptNumber;
}
public void setStockNumber(String stockNumber)
{
this.stockNumber = stockNumber;
}
public String getStockNumber()
{
return stockNumber;
}
public void setStockName(String stockName)
{
this.stockName = stockName;
}
public String getStockName()
{
return stockName;
}
public void setStockManager(String stockManager)
{
this.stockManager = stockManager;
}
public String getStockManager()
{
return stockManager;
}
public void setOutputClass(String outputClass)
{
this.outputClass = outputClass;
}
public String getOutputClass()
{
return outputClass;
}
public void setOutputDate(String outputDate)
{
this.outputDate = outputDate;
}
public String getOutputDate()
{
return outputDate;
}
public void setFinishProductCode(String finishProductCode)
{
this.finishProductCode = finishProductCode;
}
public String getFinishProductCode()
{
return finishProductCode;
}
public void setTypeMachine(String typeMachine)
{
this.typeMachine = typeMachine;
}
public String getTypeMachine()
{
return typeMachine;
}
public void setWorkOrderQuantity(String workOrderQuantity)
{
this.workOrderQuantity = workOrderQuantity;
}
public String getWorkOrderQuantity()
{
return workOrderQuantity;
}
public void setRemarkContent(String remarkContent)
{
this.remarkContent = remarkContent;
}
public String getRemarkContent()
{
return remarkContent;
}
public void setGetMaterialFlag(String getMaterialFlag)
{
this.getMaterialFlag = getMaterialFlag;
}
public String getGetMaterialFlag()
{
return getMaterialFlag;
}
public void setFirstAddTime(String firstAddTime)
{
this.firstAddTime = firstAddTime;
}
public String getFirstAddTime()
{
return firstAddTime;
}
public void setUpdateInfoTime(String updateInfoTime)
{
this.updateInfoTime = updateInfoTime;
}
public String getUpdateInfoTime()
{
return updateInfoTime;
}
public void setStandbyOne(String standbyOne)
{
this.standbyOne = standbyOne;
}
public String getStandbyOne()
{
return standbyOne;
}
public void setStandbyTwo(String standbyTwo)
{
this.standbyTwo = standbyTwo;
}
public String getStandbyTwo()
{
return standbyTwo;
}
public String getOutsourceOrderNumber() {
return outsourceOrderNumber;
}
public void setOutsourceOrderNumber(String outsourceOrderNumber) {
this.outsourceOrderNumber = outsourceOrderNumber;
}
public String getBatchNumber() {
return batchNumber;
}
public void setBatchNumber(String batchNumber) {
this.batchNumber = batchNumber;
}
public String getSupplierCode() {
return supplierCode;
}
public void setSupplierCode(String supplierCode) {
this.supplierCode = supplierCode;
}
public String getSupplierName() {
return supplierName;
}
public void setSupplierName(String supplierName) {
this.supplierName = supplierName;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("materialRequisitionId", getMaterialRequisitionId())
.append("materialRequisitionNumber", getMaterialRequisitionNumber())
.append("salesOrderNumber", getSalesOrderNumber())
.append("workOrderNumber", getWorkOrderNumber())
.append("deptName", getDeptName())
.append("materialRequisitionPerson", getMaterialRequisitionPerson())
.append("deptNumber", getDeptNumber())
.append("stockNumber", getStockNumber())
.append("stockName", getStockName())
.append("stockManager", getStockManager())
.append("outputClass", getOutputClass())
.append("outputDate", getOutputDate())
.append("finishProductCode", getFinishProductCode())
.append("typeMachine", getTypeMachine())
.append("workOrderQuantity", getWorkOrderQuantity())
.append("remarkContent", getRemarkContent())
.append("getMaterialFlag", getGetMaterialFlag())
.append("firstAddTime", getFirstAddTime())
.append("updateInfoTime", getUpdateInfoTime())
.append("standbyOne", getStandbyOne())
.append("standbyTwo", getStandbyTwo())
.append("outsourceOrderNumber", getOutsourceOrderNumber())
.append("batchNumber", getBatchNumber())
.append("supplierCode", getSupplierCode())
.append("supplierName", getSupplierName())
.toString();
}
}

91
ruoyi-admin/src/main/java/com/ruoyi/manufacture/mapper/MaterialRequisitionInfoMapper.java

@ -1,91 +0,0 @@
package com.ruoyi.manufacture.mapper;
import com.ruoyi.manufacture.domain.MaterialRequisitionInfo;
import java.util.List;
/**
* 领料单Mapper接口
*
* @author ruoyi
* @date 2023-04-06
*/
public interface MaterialRequisitionInfoMapper
{
/**
* 查询领料单
*
* @param materialRequisitionId 领料单ID
* @return 领料单
*/
public MaterialRequisitionInfo selectMaterialRequisitionInfoById(Long materialRequisitionId);
/**
* 查询领料单列表
*
* @param materialRequisitionInfo 领料单
* @return 领料单集合
*/
public List<MaterialRequisitionInfo> selectMaterialRequisitionInfoList(MaterialRequisitionInfo materialRequisitionInfo);
/**
* 查询领料单列表
*
* @param materialRequisitionInfo 领料单
* @return 领料单集合
*/
public List<MaterialRequisitionInfo> selectMaterialRequisitionInfoListRaw(MaterialRequisitionInfo materialRequisitionInfo);
/**
* 查询领料单列表
*
* @param materialRequisitionInfo 领料单
* @return 领料单集合
*/
public List<MaterialRequisitionInfo> selectMaterialRequisitionInfoListSubsidiary(MaterialRequisitionInfo materialRequisitionInfo);
/**
* 查询领料单列表
*
* @param materialRequisitionInfo 领料单
* @return 领料单集合
*/
public List<MaterialRequisitionInfo> selectMaterialRequisitionInfoListBcp(MaterialRequisitionInfo materialRequisitionInfo);
/**
* 查询领料单列表
*
* @param materialRequisitionInfo 领料单
* @return 领料单集合
*/
public List<MaterialRequisitionInfo> selectMaterialRequisitionInfoListOutsource(MaterialRequisitionInfo materialRequisitionInfo);
/**
* 新增领料单
*
* @param materialRequisitionInfo 领料单
* @return 结果
*/
public int insertMaterialRequisitionInfo(MaterialRequisitionInfo materialRequisitionInfo);
/**
* 修改领料单
*
* @param materialRequisitionInfo 领料单
* @return 结果
*/
public int updateMaterialRequisitionInfo(MaterialRequisitionInfo materialRequisitionInfo);
/**
* 删除领料单
*
* @param materialRequisitionId 领料单ID
* @return 结果
*/
public int deleteMaterialRequisitionInfoById(Long materialRequisitionId);
/**
* 批量删除领料单
*
* @param materialRequisitionIds 需要删除的数据ID
* @return 结果
*/
public int deleteMaterialRequisitionInfoByIds(String[] materialRequisitionIds);
}

123
ruoyi-admin/src/main/java/com/ruoyi/manufacture/service/IMaterialRequisitionInfoService.java

@ -1,123 +0,0 @@
package com.ruoyi.manufacture.service;
import com.ruoyi.manufacture.domain.MaterialRequisitionInfo;
import java.util.List;
/**
* 领料单Service接口
*
* @author ruoyi
* @date 2023-04-06
*/
public interface IMaterialRequisitionInfoService
{
/**
* 查询领料单
*
* @param materialRequisitionId 领料单ID
* @return 领料单
*/
public MaterialRequisitionInfo selectMaterialRequisitionInfoById(Long materialRequisitionId);
/**
* 查询领料单列表
*
* @param materialRequisitionInfo 领料单
* @return 领料单集合
*/
public List<MaterialRequisitionInfo> selectMaterialRequisitionInfoList(MaterialRequisitionInfo materialRequisitionInfo);
/**
* 查询原料领料单列表
*
* @param materialRequisitionInfo 原料领料单
* @return 原料领料单集合
*/
public List<MaterialRequisitionInfo> selectMaterialRequisitionInfoListRaw(MaterialRequisitionInfo materialRequisitionInfo);
/**
* 查询辅料领料单列表
*
* @param materialRequisitionInfo 辅料领料单
* @return 辅料领料单集合
*/
public List<MaterialRequisitionInfo> selectMaterialRequisitionInfoListSubsidiary(MaterialRequisitionInfo materialRequisitionInfo);
/**
* 查询半成品领料单列表
*
* @param materialRequisitionInfo 半成品领料单
* @return 半成品领料单集合
*/
public List<MaterialRequisitionInfo> selectMaterialRequisitionInfoListBcp(MaterialRequisitionInfo materialRequisitionInfo);
/**
* 查询半成品领料单列表
*
* @param materialRequisitionInfo 半成品领料单
* @return 半成品领料单集合
*/
public List<MaterialRequisitionInfo> selectMaterialRequisitionInfoListOutsource(MaterialRequisitionInfo materialRequisitionInfo);
/**
* 新增领料单
*
* @param materialRequisitionInfo 领料单
* @return 结果
*/
public int insertMaterialRequisitionInfo(MaterialRequisitionInfo materialRequisitionInfo);
/**
* 修改领料单
*
* @param materialRequisitionInfo 领料单
* @return 结果
*/
public int updateMaterialRequisitionInfo(MaterialRequisitionInfo materialRequisitionInfo);
/**
* 批量删除领料单
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteMaterialRequisitionInfoByIds(String ids);
/**
* 删除领料单信息
*
* @param materialRequisitionId 领料单ID
* @return 结果
*/
public int deleteMaterialRequisitionInfoById(Long materialRequisitionId);
/**
* 获取领料单号
* @return
*/
public String getId();
/**
* 获取原料领料单号
* @return
*/
public String getRawId();
/**
* 获取辅料领料单号
* @return
*/
public String getSubsidiaryId();
/**
* 获取半成品领料单号
* @return
*/
public String getBcpId();
/**
* 获取委外领料单号
* @return
*/
public String getOutsourceId();
}

142
ruoyi-admin/src/main/java/com/ruoyi/manufacture/service/impl/MaterialRequisitionInfoServiceImpl.java

@ -1,142 +0,0 @@
package com.ruoyi.manufacture.service.impl;
import com.ruoyi.common.core.text.Convert;
import com.ruoyi.manufacture.domain.MaterialRequisitionInfo;
import com.ruoyi.manufacture.mapper.MaterialRequisitionInfoMapper;
import com.ruoyi.manufacture.service.IMaterialRequisitionInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.text.SimpleDateFormat;
import java.util.List;
/**
* 领料单Service业务层处理
*
* @author ruoyi
* @date 2023-04-06
*/
@Service
public class MaterialRequisitionInfoServiceImpl implements IMaterialRequisitionInfoService
{
@Autowired
private MaterialRequisitionInfoMapper materialRequisitionInfoMapper;
/**
* 查询领料单
*
* @param materialRequisitionId 领料单ID
* @return 领料单
*/
@Override
public MaterialRequisitionInfo selectMaterialRequisitionInfoById(Long materialRequisitionId)
{
return materialRequisitionInfoMapper.selectMaterialRequisitionInfoById(materialRequisitionId);
}
/**
* 查询领料单列表
*
* @param materialRequisitionInfo 领料单
* @return 领料单
*/
@Override
public List<MaterialRequisitionInfo> selectMaterialRequisitionInfoList(MaterialRequisitionInfo materialRequisitionInfo)
{
return materialRequisitionInfoMapper.selectMaterialRequisitionInfoList(materialRequisitionInfo);
}
@Override
public List<MaterialRequisitionInfo> selectMaterialRequisitionInfoListRaw(MaterialRequisitionInfo materialRequisitionInfo)
{
return materialRequisitionInfoMapper.selectMaterialRequisitionInfoListRaw(materialRequisitionInfo);
}
@Override
public List<MaterialRequisitionInfo> selectMaterialRequisitionInfoListSubsidiary(MaterialRequisitionInfo materialRequisitionInfo)
{
return materialRequisitionInfoMapper.selectMaterialRequisitionInfoListSubsidiary(materialRequisitionInfo);
}
@Override
public List<MaterialRequisitionInfo> selectMaterialRequisitionInfoListBcp(MaterialRequisitionInfo materialRequisitionInfo)
{
return materialRequisitionInfoMapper.selectMaterialRequisitionInfoListBcp(materialRequisitionInfo);
}
@Override
public List<MaterialRequisitionInfo> selectMaterialRequisitionInfoListOutsource(MaterialRequisitionInfo materialRequisitionInfo)
{
return materialRequisitionInfoMapper.selectMaterialRequisitionInfoListOutsource(materialRequisitionInfo);
}
/**
* 新增领料单
*
* @param materialRequisitionInfo 领料单
* @return 结果
*/
@Override
public int insertMaterialRequisitionInfo(MaterialRequisitionInfo materialRequisitionInfo)
{
return materialRequisitionInfoMapper.insertMaterialRequisitionInfo(materialRequisitionInfo);
}
/**
* 修改领料单
*
* @param materialRequisitionInfo 领料单
* @return 结果
*/
@Override
public int updateMaterialRequisitionInfo(MaterialRequisitionInfo materialRequisitionInfo)
{
return materialRequisitionInfoMapper.updateMaterialRequisitionInfo(materialRequisitionInfo);
}
/**
* 删除领料单对象
*
* @param ids 需要删除的数据ID
* @return 结果
*/
@Override
public int deleteMaterialRequisitionInfoByIds(String ids)
{
return materialRequisitionInfoMapper.deleteMaterialRequisitionInfoByIds(Convert.toStrArray(ids));
}
/**
* 删除领料单信息
*
* @param materialRequisitionId 领料单ID
* @return 结果
*/
@Override
public int deleteMaterialRequisitionInfoById(Long materialRequisitionId)
{
return materialRequisitionInfoMapper.deleteMaterialRequisitionInfoById(materialRequisitionId);
}
@Override
public String getId() {
String time = new SimpleDateFormat("yyyyMMddHHmmssSSS").format(System.currentTimeMillis());
return "WLLL" + time.substring(2);
}
@Override
public String getRawId() {
String time = new SimpleDateFormat("yyyyMMddHHmmssSSS").format(System.currentTimeMillis());
return "YLLL" + time.substring(2);
}
@Override
public String getSubsidiaryId() {
String time = new SimpleDateFormat("yyyyMMddHHmmssSSS").format(System.currentTimeMillis());
return "FLLL" + time.substring(2);
}
@Override
public String getBcpId() {
String time = new SimpleDateFormat("yyyyMMddHHmmssSSS").format(System.currentTimeMillis());
return "CPLL" + time.substring(2);
}
@Override
public String getOutsourceId() {
String time = new SimpleDateFormat("yyyyMMddHHmmssSSS").format(System.currentTimeMillis());
return "OWLL" + time.substring(2);
}
}

212
ruoyi-admin/src/main/resources/mapper/manufacture/MaterialRequisitionInfoMapper.xml

@ -1,212 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.manufacture.mapper.MaterialRequisitionInfoMapper">
<resultMap type="MaterialRequisitionInfo" id="MaterialRequisitionInfoResult">
<result property="materialRequisitionId" column="material_requisition_id" />
<result property="materialRequisitionNumber" column="material_requisition_number" />
<result property="salesOrderNumber" column="sales_order_number" />
<result property="workOrderNumber" column="work_order_number" />
<result property="deptName" column="dept_name" />
<result property="materialRequisitionPerson" column="material_requisition_person" />
<result property="deptNumber" column="dept_number" />
<result property="stockNumber" column="stock_number" />
<result property="stockName" column="stock_name" />
<result property="stockManager" column="stock_manager" />
<result property="outputClass" column="output_class" />
<result property="outputDate" column="output_date" />
<result property="finishProductCode" column="finish_product_code" />
<result property="typeMachine" column="type_machine" />
<result property="workOrderQuantity" column="work_order_quantity" />
<result property="remarkContent" column="remark_content" />
<result property="getMaterialFlag" column="get_material_flag" />
<result property="firstAddTime" column="first_add_time" />
<result property="updateInfoTime" column="update_info_time" />
<result property="standbyOne" column="standby_one" />
<result property="standbyTwo" column="standby_two" />
<result property="outsourceOrderNumber" column="outsource_order_number" />
<result property="batchNumber" column="batch_number" />
<result property="supplierCode" column="supplier_code" />
<result property="supplierName" column="supplier_name" />
</resultMap>
<sql id="selectMaterialRequisitionInfoVo">
select material_requisition_id, material_requisition_number, sales_order_number, work_order_number, dept_name, material_requisition_person, dept_number, stock_number, stock_name, stock_manager, output_class, output_date, finish_product_code, type_machine, work_order_quantity, remark_content, get_material_flag, first_add_time, update_info_time, standby_one, standby_two, outsource_order_number, batch_number, supplier_code, supplier_name from material_requisition_info
</sql>
<select id="selectMaterialRequisitionInfoList" parameterType="MaterialRequisitionInfo" resultMap="MaterialRequisitionInfoResult">
<include refid="selectMaterialRequisitionInfoVo"/>
<where>
<if test="materialRequisitionNumber != null and materialRequisitionNumber != ''"> and material_requisition_number like concat('%', #{materialRequisitionNumber}, '%')</if>
<if test="salesOrderNumber != null and salesOrderNumber != ''"> and sales_order_number like concat('%', #{salesOrderNumber}, '%')</if>
<if test="workOrderNumber != null and workOrderNumber != ''"> and work_order_number like concat('%', #{workOrderNumber}, '%')</if>
<if test="deptName != null and deptName != ''"> and dept_name = #{deptName}</if>
<if test="stockName != null and stockName != ''"> and stock_name like concat('%', #{stockName}, '%')</if>
<if test="outputClass != null and outputClass != ''"> and output_class = #{outputClass}</if>
<if test="params.beginOutputDate != null and params.beginOutputDate != '' and params.endOutputDate != null and params.endOutputDate != ''"> and output_date between #{params.beginOutputDate} and #{params.endOutputDate}</if>
<if test="getMaterialFlag != null and getMaterialFlag != ''"> and get_material_flag = #{getMaterialFlag}</if>
</where>
</select>
<select id="selectMaterialRequisitionInfoListRaw" parameterType="MaterialRequisitionInfo" resultMap="MaterialRequisitionInfoResult">
<include refid="selectMaterialRequisitionInfoVo"/>
<where>
material_requisition_number like '%YLLL%'
<if test="materialRequisitionNumber != null and materialRequisitionNumber != ''"> and material_requisition_number like concat('%', #{materialRequisitionNumber}, '%')</if>
<if test="salesOrderNumber != null and salesOrderNumber != ''"> and sales_order_number like concat('%', #{salesOrderNumber}, '%')</if>
<if test="workOrderNumber != null and workOrderNumber != ''"> and work_order_number like concat('%', #{workOrderNumber}, '%')</if>
<if test="deptName != null and deptName != ''"> and dept_name = #{deptName}</if>
<if test="stockName != null and stockName != ''"> and stock_name like concat('%', #{stockName}, '%')</if>
<if test="outputClass != null and outputClass != ''"> and output_class = #{outputClass}</if>
<if test="params.beginOutputDate != null and params.beginOutputDate != '' and params.endOutputDate != null and params.endOutputDate != ''"> and output_date between #{params.beginOutputDate} and #{params.endOutputDate}</if>
<if test="getMaterialFlag != null and getMaterialFlag != ''"> and get_material_flag = #{getMaterialFlag}</if>
</where>
</select>
<select id="selectMaterialRequisitionInfoListSubsidiary" parameterType="MaterialRequisitionInfo" resultMap="MaterialRequisitionInfoResult">
<include refid="selectMaterialRequisitionInfoVo"/>
<where>
material_requisition_number like '%FLLL%'
<if test="materialRequisitionNumber != null and materialRequisitionNumber != ''"> and material_requisition_number like concat('%', #{materialRequisitionNumber}, '%')</if>
<if test="salesOrderNumber != null and salesOrderNumber != ''"> and sales_order_number like concat('%', #{salesOrderNumber}, '%')</if>
<if test="workOrderNumber != null and workOrderNumber != ''"> and work_order_number like concat('%', #{workOrderNumber}, '%')</if>
<if test="deptName != null and deptName != ''"> and dept_name = #{deptName}</if>
<if test="stockName != null and stockName != ''"> and stock_name like concat('%', #{stockName}, '%')</if>
<if test="outputClass != null and outputClass != ''"> and output_class = #{outputClass}</if>
<if test="params.beginOutputDate != null and params.beginOutputDate != '' and params.endOutputDate != null and params.endOutputDate != ''"> and output_date between #{params.beginOutputDate} and #{params.endOutputDate}</if>
<if test="getMaterialFlag != null and getMaterialFlag != ''"> and get_material_flag = #{getMaterialFlag}</if>
</where>
</select>
<select id="selectMaterialRequisitionInfoListBcp" parameterType="MaterialRequisitionInfo" resultMap="MaterialRequisitionInfoResult">
<include refid="selectMaterialRequisitionInfoVo"/>
<where>
material_requisition_number like '%CPLL%'
<if test="materialRequisitionNumber != null and materialRequisitionNumber != ''"> and material_requisition_number like concat('%', #{materialRequisitionNumber}, '%')</if>
<if test="salesOrderNumber != null and salesOrderNumber != ''"> and sales_order_number like concat('%', #{salesOrderNumber}, '%')</if>
<if test="workOrderNumber != null and workOrderNumber != ''"> and work_order_number like concat('%', #{workOrderNumber}, '%')</if>
<if test="deptName != null and deptName != ''"> and dept_name = #{deptName}</if>
<if test="stockName != null and stockName != ''"> and stock_name like concat('%', #{stockName}, '%')</if>
<if test="outputClass != null and outputClass != ''"> and output_class = #{outputClass}</if>
<if test="params.beginOutputDate != null and params.beginOutputDate != '' and params.endOutputDate != null and params.endOutputDate != ''"> and output_date between #{params.beginOutputDate} and #{params.endOutputDate}</if>
<if test="getMaterialFlag != null and getMaterialFlag != ''"> and get_material_flag = #{getMaterialFlag}</if>
</where>
</select>
<select id="selectMaterialRequisitionInfoListOutsource" parameterType="MaterialRequisitionInfo" resultMap="MaterialRequisitionInfoResult">
<include refid="selectMaterialRequisitionInfoVo"/>
<where>
material_requisition_number like '%OWLL%'
<if test="materialRequisitionNumber != null and materialRequisitionNumber != ''"> and material_requisition_number like concat('%', #{materialRequisitionNumber}, '%')</if>
<if test="salesOrderNumber != null and salesOrderNumber != ''"> and sales_order_number like concat('%', #{salesOrderNumber}, '%')</if>
<if test="workOrderNumber != null and workOrderNumber != ''"> and work_order_number like concat('%', #{workOrderNumber}, '%')</if>
<if test="deptName != null and deptName != ''"> and dept_name = #{deptName}</if>
<if test="stockName != null and stockName != ''"> and stock_name like concat('%', #{stockName}, '%')</if>
<if test="outputClass != null and outputClass != ''"> and output_class = #{outputClass}</if>
<if test="params.beginOutputDate != null and params.beginOutputDate != '' and params.endOutputDate != null and params.endOutputDate != ''"> and output_date between #{params.beginOutputDate} and #{params.endOutputDate}</if>
<if test="getMaterialFlag != null and getMaterialFlag != ''"> and get_material_flag = #{getMaterialFlag}</if>
<if test="outsourceOrderNumber != null and outsourceOrderNumber != ''"> and outsource_order_number like concat('%', #{outsourceOrderNumber}, '%')</if>
<if test="supplierCode != null and supplierCode != ''"> and supplier_code like concat('%', #{supplierCode}, '%')</if>
<if test="supplierName != null and supplierName != ''"> and supplier_name like concat('%', #{supplierName}, '%')</if>
</where>
</select>
<select id="selectMaterialRequisitionInfoById" parameterType="Long" resultMap="MaterialRequisitionInfoResult">
<include refid="selectMaterialRequisitionInfoVo"/>
where material_requisition_id = #{materialRequisitionId}
</select>
<insert id="insertMaterialRequisitionInfo" parameterType="MaterialRequisitionInfo" useGeneratedKeys="true" keyProperty="materialRequisitionId">
insert into material_requisition_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="materialRequisitionNumber != null and materialRequisitionNumber != ''">material_requisition_number,</if>
<if test="salesOrderNumber != null">sales_order_number,</if>
<if test="workOrderNumber != null">work_order_number,</if>
<if test="deptName != null">dept_name,</if>
<if test="materialRequisitionPerson != null">material_requisition_person,</if>
<if test="deptNumber != null">dept_number,</if>
<if test="stockNumber != null">stock_number,</if>
<if test="stockName != null">stock_name,</if>
<if test="stockManager != null">stock_manager,</if>
<if test="outputClass != null">output_class,</if>
<if test="outputDate != null">output_date,</if>
<if test="finishProductCode != null">finish_product_code,</if>
<if test="typeMachine != null">type_machine,</if>
<if test="workOrderQuantity != null">work_order_quantity,</if>
<if test="remarkContent != null">remark_content,</if>
<if test="getMaterialFlag != null">get_material_flag,</if>
<if test="standbyOne != null">standby_one,</if>
<if test="standbyTwo != null">standby_two,</if>
<if test="outsourceOrderNumber != null">outsource_order_number,</if>
<if test="batchNumber != null">batch_number,</if>
<if test="supplierCode != null">supplier_code,</if>
<if test="supplierName != null">supplier_name,</if>
first_add_time,
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="materialRequisitionNumber != null and materialRequisitionNumber != ''">#{materialRequisitionNumber},</if>
<if test="salesOrderNumber != null">#{salesOrderNumber},</if>
<if test="workOrderNumber != null">#{workOrderNumber},</if>
<if test="deptName != null">#{deptName},</if>
<if test="materialRequisitionPerson != null">#{materialRequisitionPerson},</if>
<if test="deptNumber != null">#{deptNumber},</if>
<if test="stockNumber != null">#{stockNumber},</if>
<if test="stockName != null">#{stockName},</if>
<if test="stockManager != null">#{stockManager},</if>
<if test="outputClass != null">#{outputClass},</if>
<if test="outputDate != null">#{outputDate},</if>
<if test="finishProductCode != null">#{finishProductCode},</if>
<if test="typeMachine != null">#{typeMachine},</if>
<if test="workOrderQuantity != null">#{workOrderQuantity},</if>
<if test="remarkContent != null">#{remarkContent},</if>
<if test="getMaterialFlag != null">#{getMaterialFlag},</if>
<if test="standbyOne != null">#{standbyOne},</if>
<if test="standbyTwo != null">#{standbyTwo},</if>
<if test="outsourceOrderNumber != null">#{outsourceOrderNumber},</if>
<if test="batchNumber != null">#{batchNumber},</if>
<if test="supplierCode != null">#{supplierCode},</if>
<if test="supplierName != null">#{supplierName},</if>
now(),
</trim>
</insert>
<update id="updateMaterialRequisitionInfo" parameterType="MaterialRequisitionInfo">
update material_requisition_info
<trim prefix="SET" suffixOverrides=",">
<if test="materialRequisitionNumber != null and materialRequisitionNumber != ''">material_requisition_number = #{materialRequisitionNumber},</if>
<if test="salesOrderNumber != null">sales_order_number = #{salesOrderNumber},</if>
<if test="workOrderNumber != null">work_order_number = #{workOrderNumber},</if>
<if test="deptName != null">dept_name = #{deptName},</if>
<if test="materialRequisitionPerson != null">material_requisition_person = #{materialRequisitionPerson},</if>
<if test="deptNumber != null">dept_number = #{deptNumber},</if>
<if test="stockNumber != null">stock_number = #{stockNumber},</if>
<if test="stockName != null">stock_name = #{stockName},</if>
<if test="stockManager != null">stock_manager = #{stockManager},</if>
<if test="outputClass != null">output_class = #{outputClass},</if>
<if test="outputDate != null">output_date = #{outputDate},</if>
<if test="finishProductCode != null">finish_product_code = #{finishProductCode},</if>
<if test="typeMachine != null">type_machine = #{typeMachine},</if>
<if test="workOrderQuantity != null">work_order_quantity = #{workOrderQuantity},</if>
<if test="remarkContent != null">remark_content = #{remarkContent},</if>
<if test="getMaterialFlag != null">get_material_flag = #{getMaterialFlag},</if>
<if test="standbyOne != null">standby_one = #{standbyOne},</if>
<if test="standbyTwo != null">standby_two = #{standbyTwo},</if>
<if test="outsourceOrderNumber != null">outsource_order_number = #{outsourceOrderNumber},</if>
<if test="batchNumber != null">batch_number = #{batchNumber},</if>
<if test="supplierCode != null">supplier_code = #{supplierCode},</if>
<if test="supplierName != null">supplier_name = #{supplierName},</if>
update_info_time = CONCAT_WS(',',NOW(),update_info_time),
</trim>
where material_requisition_id = #{materialRequisitionId}
</update>
<delete id="deleteMaterialRequisitionInfoById" parameterType="Long">
delete from material_requisition_info where material_requisition_id = #{materialRequisitionId}
</delete>
<delete id="deleteMaterialRequisitionInfoByIds" parameterType="String">
delete from material_requisition_info where material_requisition_id in
<foreach item="materialRequisitionId" collection="array" open="(" separator="," close=")">
#{materialRequisitionId}
</foreach>
</delete>
</mapper>

1594
ruoyi-admin/src/main/resources/templates/manufacture/materialRequisitionInfo/add.html

File diff suppressed because it is too large

1555
ruoyi-admin/src/main/resources/templates/manufacture/materialRequisitionInfo/edit.html

File diff suppressed because it is too large

330
ruoyi-admin/src/main/resources/templates/manufacture/materialRequisitionInfo/materialRequisitionInfo.html

@ -1,330 +0,0 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<th:block th:include="include :: header('领料单列表')" />
<th:block th:include="include :: datetimepicker-css"/>
<script type="text/javascript" th:src="@{/js/axios.min.js}"></script>
</head>
<body class="gray-bg">
<div class="container-div">
<div class="row">
<div class="col-sm-12 search-collapse">
<form id="formId">
<div class="select-list">
<ul>
<li>
<label>领料单号:</label>
<input type="text" name="materialRequisitionNumber"/>
</li>
<li>
<label>订单号码:</label>
<input type="text" name="salesOrderNumber"/>
</li>
<li>
<label>制工单号:</label>
<input type="text" name="workOrderNumber"/>
</li>
<li>
<label>领料部门:</label>
<select name="deptName" th:with="type=${@dict.getType('sys_dept_type')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</li>
<li>
<label>仓库名称:</label>
<select name="stockName">
<option value="">所有</option>
<option value="-1">代码生成请选择字典属性</option>
</select>
</li>
<li>
<label>出库类型:</label>
<select name="outputClass" th:with="type=${@dict.getType('sys_out_type')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</li>
<li class="select-time">
<label>出库日期:</label>
<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginOutputDate]"/>
<span>-</span>
<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endOutputDate]"/>
</li>
<li>
<label>领料否:</label>
<select name="getMaterialFlag" th:with="type=${@dict.getType('sys_whether')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
</li>
</ul>
</div>
</form>
</div>
<div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="manufacture:materialRequisitionInfo:add">
<i class="fa fa-plus"></i> 添加
</a>
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="manufacture:materialRequisitionInfo:edit">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-danger single disabled" onclick="removeSelectedOrder()" shiro:hasPermission="manufacture:materialRequisitionInfo:remove">
<i class="fa fa-remove"></i> 删除
</a>
<a class="btn btn-warning" onclick="exportRequisitionOrder()" shiro:hasPermission="manufacture:materialRequisitionInfo:export">
<i class="fa fa-download"></i> 导出
</a>
</div>
<div class="col-sm-12 select-table table-striped" style="white-space: nowrap">
<table id="bootstrap-table"></table>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js"/>
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('manufacture:materialRequisitionInfo:edit')}]];
var removeFlag = [[${@permission.hasPermi('manufacture:materialRequisitionInfo:remove')}]];
var deptNameDatas = [[${@dict.getType('sys_dept_type')}]];
var outputClassDatas = [[${@dict.getType('sys_out_type')}]];
var getMaterialFlagDatas = [[${@dict.getType('sys_whether')}]];
var prefix = ctx + "manufacture/materialRequisitionInfo";
var prefixMaterialRequisitionDetail = ctx + "manufacture/materialRequisitionDetail";
$(function() {
var options = {
url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
clickToSelect: true,
modalName: "领料单",
columns: [{
checkbox: true
},
{
field: 'materialRequisitionId',
title: '领料单id',
visible: false
},
{
field: 'materialRequisitionNumber',
title: '领料单号'
},
{
field: 'salesOrderNumber',
title: '订单号码'
},
{
field: 'workOrderNumber',
title: '制工单号'
},
{
field: 'deptName',
title: '领料部门',
formatter: function(value, row, index) {
return $.table.selectDictLabel(deptNameDatas, value);
}
},
{
field: 'materialRequisitionPerson',
title: '领料人'
},
{
field: 'deptNumber',
title: '部门编号'
},
{
field: 'stockNumber',
title: '仓库编号'
},
{
field: 'stockName',
title: '仓库名称'
},
{
field: 'stockManager',
title: '仓库管理员'
},
{
field: 'outputClass',
title: '出库类型',
formatter: function(value, row, index) {
return $.table.selectDictLabel(outputClassDatas, value);
}
},
{
field: 'outputDate',
title: '出库日期'
},
{
field: 'finishProductCode',
title: '成品代码'
},
{
field: 'typeMachine',
title: '机种'
},
{
field: 'workOrderQuantity',
title: '工单数量'
},
{
field: 'remarkContent',
title: '备注内容'
},
{
field: 'getMaterialFlag',
title: '领料否',
formatter: function(value, row, index) {
return $.table.selectDictLabel(getMaterialFlagDatas, value);
}
},
{
field: 'firstAddTime',
title: '录入时间',
formatter: function (value, row, index) {
if (value == null) {
return " ";
} else {
return value;
}
}
},
{
field: 'updateInfoTime',
title: '上次修改时间',
formatter: function (value, row, index) {
if (value == null) {
return " ";
} else {
var vArr = value.split(',')
return vArr[0];
}
}
}]
// {
// title: '操作',
// align: 'center',
// formatter: function(value, row, index) {
// var actions = [];
// actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.materialRequisitionId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
// actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.materialRequisitionId + '\')"><i class="fa fa-remove"></i>删除</a>');
// return actions.join('');
// }
// }
};
$.table.init(options);
});
//删除
function removeSelectedOrder() {
var orderData = $("#bootstrap-table").bootstrapTable("getSelections");
if (orderData.length === 1) {
// console.log(orderData)
$.ajax({
url: prefixMaterialRequisitionDetail + '/list',
type: 'post',
data: {
materialRequisitionNumber: orderData[0].materialRequisitionNumber
},
success: function (res) {
console.log(res)
if (res.rows.length > 0) {
$.modal.confirm("该订单内含有"+ res.rows.length+ "条物料数据将一并删除,是否删除?", function () {
$.ajax({
url: prefix + '/removeSelectedOrder',
type: 'post',
data: {
orderData : JSON.stringify(orderData)
},
success: function (res) {
// console.log(res)
$("#bootstrap-table").bootstrapTable("refresh");
$.modal.msgSuccess("删除成功!")
},
error: function (res) {
$.modal.msgError(res.error())
}
})
})
} else if (res.rows.length == 0) {
$.modal.confirm("确认删除该订单吗?", function () {
$.ajax({
url: prefix + '/remove',
type: 'post',
data: {
ids : orderData[0].materialRequisitionId
},
success: function (res) {
// console.log(res)
$("#bootstrap-table").bootstrapTable("refresh");
$.modal.msgSuccess("删除成功!")
},
error: function (res) {
$.modal.msgError(res.error())
}
})
})
}
}
})
} else {
$.modal.msgWarning("请选择一条数据")
}
}
//导出
function exportRequisitionOrder() {
var rows = $.common.isEmpty(table.options.uniqueId) ? $.table.selectFirstColumns() : $.table.selectColumns(table.options.uniqueId);
var data = $("#bootstrap-table").bootstrapTable("getSelections")
if (rows.length !== 1) {
$.modal.alert("请选择一条记录");
return;
} else {
// rows为选中行的id
// console.log(rows);
// console.log(data);
// console.log(data[0].orderNumber)
$.modal.confirm("是否确认要导出本条领料单?", function (){
axios({
url: prefix + '/exportSelected/'+data[0].materialRequisitionId,
method: 'POST',
responseType: 'blob'
}).then(response => {
// console.log(response)
const URL = window.URL.createObjectURL(response.data)
// 创建隐藏<a>标签进行下载
const tempLink = document.createElement('a')
tempLink.style.display = 'none'
tempLink.href = URL
let time = new Date().toLocaleString()
tempLink.setAttribute('download', time + "领料单.xlsx")
if (typeof tempLink.download === 'undefined') {
tempLink.setAttribute('target', '_blank')
}
document.body.appendChild(tempLink)
tempLink.click()
document.body.removeChild(tempLink)// 移除dom元素
window.URL.revokeObjectURL(URL)//释放内存
})
});
}
}
</script>
</body>
</html>
Loading…
Cancel
Save