From ecc32ed11615585cefa11300f5fd9f85a6a01381 Mon Sep 17 00:00:00 2001 From: liuxiaoxu <1793812695@qq.com> Date: Mon, 15 Jul 2024 10:22:28 +0800 Subject: [PATCH] =?UTF-8?q?[feat]=20=E5=A7=94=E5=A4=96=E5=8A=A0=E5=B7=A5?= =?UTF-8?q?=20=E5=88=A0=E9=99=A4=E9=A1=B9=E7=9B=AE=E7=9A=84=E8=80=81?= =?UTF-8?q?=E7=9A=84=E5=A7=94=E5=A4=96=E6=A8=A1=E5=9D=97=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=20=E6=9B=B4=E6=96=B0=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E8=81=94=E7=9A=84=E6=A8=A1=E5=9D=97=E8=B0=83=E7=94=A8=E8=80=81?= =?UTF-8?q?=E5=A7=94=E5=A4=96=E7=9A=84=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MaterialRequisitionInfoController.java | 1516 ++++++++--------- .../OutsourceInspectionNoticeController.java | 292 ---- .../OutsourceOrderInfoController.java | 285 ---- .../OutsourceOrderMaterialController.java | 166 -- .../domain/OutsourceInspectionNotice.java | 405 ----- .../outsource/domain/OutsourceOrderInfo.java | 425 ----- .../domain/OutsourceOrderMaterial.java | 237 --- .../OutsourceInspectionNoticeMapper.java | 62 - .../mapper/OutsourceOrderInfoMapper.java | 64 - .../mapper/OutsourceOrderMaterialMapper.java | 61 - .../mapper/OutsourceProcessMapper.java | 77 - .../IOutsourceInspectionNoticeService.java | 64 - .../service/IOutsourceOrderInfoService.java | 64 - .../IOutsourceOrderMaterialService.java | 61 - .../service/IOutsourceProcessService.java | 77 - .../OutsourceInspectionNoticeServiceImpl.java | 102 -- .../impl/OutsourceOrderInfoServiceImpl.java | 102 -- .../OutsourceOrderMaterialServiceImpl.java | 94 - .../impl/OutsourceProcessServiceImpl.java | 141 -- .../OutsourceInspectionNoticeMapper.xml | 165 -- .../outsource/OutsourceOrderInfoMapper.xml | 169 -- .../OutsourceOrderMaterialMapper.xml | 113 -- .../outsource/OutsourceProcessMapper.xml | 95 -- 23 files changed, 757 insertions(+), 4080 deletions(-) delete mode 100644 ruoyi-admin/src/main/java/com/ruoyi/outsource/controller/OutsourceInspectionNoticeController.java delete mode 100644 ruoyi-admin/src/main/java/com/ruoyi/outsource/controller/OutsourceOrderInfoController.java delete mode 100644 ruoyi-admin/src/main/java/com/ruoyi/outsource/controller/OutsourceOrderMaterialController.java delete mode 100644 ruoyi-admin/src/main/java/com/ruoyi/outsource/domain/OutsourceInspectionNotice.java delete mode 100644 ruoyi-admin/src/main/java/com/ruoyi/outsource/domain/OutsourceOrderInfo.java delete mode 100644 ruoyi-admin/src/main/java/com/ruoyi/outsource/domain/OutsourceOrderMaterial.java delete mode 100644 ruoyi-admin/src/main/java/com/ruoyi/outsource/mapper/OutsourceInspectionNoticeMapper.java delete mode 100644 ruoyi-admin/src/main/java/com/ruoyi/outsource/mapper/OutsourceOrderInfoMapper.java delete mode 100644 ruoyi-admin/src/main/java/com/ruoyi/outsource/mapper/OutsourceOrderMaterialMapper.java delete mode 100644 ruoyi-admin/src/main/java/com/ruoyi/outsource/mapper/OutsourceProcessMapper.java delete mode 100644 ruoyi-admin/src/main/java/com/ruoyi/outsource/service/IOutsourceInspectionNoticeService.java delete mode 100644 ruoyi-admin/src/main/java/com/ruoyi/outsource/service/IOutsourceOrderInfoService.java delete mode 100644 ruoyi-admin/src/main/java/com/ruoyi/outsource/service/IOutsourceOrderMaterialService.java delete mode 100644 ruoyi-admin/src/main/java/com/ruoyi/outsource/service/IOutsourceProcessService.java delete mode 100644 ruoyi-admin/src/main/java/com/ruoyi/outsource/service/impl/OutsourceInspectionNoticeServiceImpl.java delete mode 100644 ruoyi-admin/src/main/java/com/ruoyi/outsource/service/impl/OutsourceOrderInfoServiceImpl.java delete mode 100644 ruoyi-admin/src/main/java/com/ruoyi/outsource/service/impl/OutsourceOrderMaterialServiceImpl.java delete mode 100644 ruoyi-admin/src/main/java/com/ruoyi/outsource/service/impl/OutsourceProcessServiceImpl.java delete mode 100644 ruoyi-admin/src/main/resources/mapper/outsource/OutsourceInspectionNoticeMapper.xml delete mode 100644 ruoyi-admin/src/main/resources/mapper/outsource/OutsourceOrderInfoMapper.xml delete mode 100644 ruoyi-admin/src/main/resources/mapper/outsource/OutsourceOrderMaterialMapper.xml delete mode 100644 ruoyi-admin/src/main/resources/mapper/outsource/OutsourceProcessMapper.xml diff --git a/ruoyi-admin/src/main/java/com/ruoyi/manufacture/controller/MaterialRequisitionInfoController.java b/ruoyi-admin/src/main/java/com/ruoyi/manufacture/controller/MaterialRequisitionInfoController.java index beda97a1..cc7d8549 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/manufacture/controller/MaterialRequisitionInfoController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/manufacture/controller/MaterialRequisitionInfoController.java @@ -1,771 +1,769 @@ -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.outsource.domain.OutsourceOrderMaterial; -import com.ruoyi.outsource.service.IOutsourceOrderMaterialService; -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() +//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 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") +// 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 list = materialRequisitionInfoService.selectMaterialRequisitionInfoList(materialRequisitionInfo); +//// return getDataTable(list); +//// } +// +// @RequiresPermissions("manufacture:materialRequisitionInfo:listRaw") +// @PostMapping("/listRaw") // @ResponseBody -// public TableDataInfo list(MaterialRequisitionInfo materialRequisitionInfo) +// public TableDataInfo listRaw(MaterialRequisitionInfo materialRequisitionInfo) // { // startPage(); -// List list = materialRequisitionInfoService.selectMaterialRequisitionInfoList(materialRequisitionInfo); +// List list = materialRequisitionInfoService.selectMaterialRequisitionInfoListRaw(materialRequisitionInfo); // return getDataTable(list); // } - - @RequiresPermissions("manufacture:materialRequisitionInfo:listRaw") - @PostMapping("/listRaw") - @ResponseBody - public TableDataInfo listRaw(MaterialRequisitionInfo materialRequisitionInfo) - { - startPage(); - List list = materialRequisitionInfoService.selectMaterialRequisitionInfoListRaw(materialRequisitionInfo); - return getDataTable(list); - } - @RequiresPermissions("manufacture:materialRequisitionInfo:listSubsidiary") - @PostMapping("/listSubsidiary") - @ResponseBody - public TableDataInfo listSubsidiary(MaterialRequisitionInfo materialRequisitionInfo) - { - startPage(); - List list = materialRequisitionInfoService.selectMaterialRequisitionInfoListSubsidiary(materialRequisitionInfo); - return getDataTable(list); - } - @RequiresPermissions("manufacture:materialRequisitionInfo:listBcp") - @PostMapping("/listBcp") - @ResponseBody - public TableDataInfo listBcp(MaterialRequisitionInfo materialRequisitionInfo) - { - startPage(); - List list = materialRequisitionInfoService.selectMaterialRequisitionInfoListBcp(materialRequisitionInfo); - return getDataTable(list); - } - @RequiresPermissions("manufacture:materialRequisitionInfo:listOutsource") - @PostMapping("/listOutsource") - @ResponseBody - public TableDataInfo listOutsource(MaterialRequisitionInfo materialRequisitionInfo) - { - startPage(); - List 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 list = materialRequisitionInfoService.selectMaterialRequisitionInfoList(materialRequisitionInfo); - ExcelUtil util = new ExcelUtil(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) +// @RequiresPermissions("manufacture:materialRequisitionInfo:listSubsidiary") +// @PostMapping("/listSubsidiary") +// @ResponseBody +// public TableDataInfo listSubsidiary(MaterialRequisitionInfo materialRequisitionInfo) +// { +// startPage(); +// List list = materialRequisitionInfoService.selectMaterialRequisitionInfoListSubsidiary(materialRequisitionInfo); +// return getDataTable(list); +// } +// @RequiresPermissions("manufacture:materialRequisitionInfo:listBcp") +// @PostMapping("/listBcp") +// @ResponseBody +// public TableDataInfo listBcp(MaterialRequisitionInfo materialRequisitionInfo) +// { +// startPage(); +// List list = materialRequisitionInfoService.selectMaterialRequisitionInfoListBcp(materialRequisitionInfo); +// return getDataTable(list); +// } +// @RequiresPermissions("manufacture:materialRequisitionInfo:listOutsource") +// @PostMapping("/listOutsource") +// @ResponseBody +// public TableDataInfo listOutsource(MaterialRequisitionInfo materialRequisitionInfo) +// { +// startPage(); +// List 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 list = materialRequisitionInfoService.selectMaterialRequisitionInfoList(materialRequisitionInfo); +// ExcelUtil util = new ExcelUtil(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 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 list = materialRequisitionDetailService.selectMaterialRequisitionDetailList(materialRequisitionDetail); - if (list.size()>0) { - for (int j=0;j 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 materialRequisitionDetailList = materialRequisitionDetailService.selectMaterialRequisitionDetailList(materialRequisitionDetail); - List 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()>>>>>异常<<<<<<", 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 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 deptData = sysDictTypeService.selectDictDataByType("sys_dept_type"); -// for (int i = 0;i list = materialRequisitionDetailService.selectMaterialRequisitionDetailList(materialRequisitionDetail); +// if (list.size()>0) { +// for (int j=0;j 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 materialRequisitionDetailList = materialRequisitionDetailService.selectMaterialRequisitionDetailList(materialRequisitionDetail); +// List 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()>>>>>异常<<<<<<", 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 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 deptData = sysDictTypeService.selectDictDataByType("sys_dept_type"); +//// for (int i = 0;i materialRequisitionDetailDtoList) { - //获取bom信息 - //判断是否有bom - SysBom sysBom = new SysBom(); - sysBom.setFinishProductCode(materialCode); - List sysBomList = sysBomService.selectSysBomList(sysBom); - //如果是半成品,则继续查询 - if (sysBomList.size() != 0) { - //先查询原料 - SysBomRawMaterial sysBomRawMaterial = new SysBomRawMaterial(); - sysBomRawMaterial.setFinishProductCode(sysBomList.get(0).getFinishProductCode()); - List 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 materialRequisitionDetailList = materialRequisitionDetailService.selectMaterialRequisitionDetailList(materialRequisitionDetail); - List 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 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 orderMaterialList = outsourceOrderMaterialService.selectOutsourceOrderMaterialList(new OutsourceOrderMaterial(outsourceOrderNumber)); - //委外明细 - List materialRequisitionDetailList = new ArrayList<>(); - //bom阶 - int bomRank = 1; - for (OutsourceOrderMaterial outsourceOrderMaterial : orderMaterialList) { - List 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 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> map = new HashMap<>(); - for (OutsourceOrderMaterial orderMaterial : orderMaterialList) { - List materialRequisitionDetailList = exportOutsourceList(materialRequisitionInfo.getMaterialRequisitionNumber(), orderMaterial.getMaterialCode()); - List 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 finishProductList = sysFinishProductService.selectSysFinishProductList(new SysFinishProduct(orderMaterial.getMaterialCode())); - List 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 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 exportOutsourceList(String materialRequisitionNumber,String materialCode) { - List result = new ArrayList<>(); - List 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 sysBomBcpAllList(int bomRank,Double quantity,SysBomBcp sysBomBcp) { - List materialRequisitionDetailList = new ArrayList<>(); - List bomBcpList =sysBomBcpService.selectSysBomBcpList(sysBomBcp); - List rawMaterialList = sysBomRawMaterialService.selectSysBomRawMaterialList(new SysBomRawMaterial(sysBomBcp.getFinishProductCode())); - List 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 list = sysBomBcpAllList(bomRank+1,quantity,new SysBomBcp(bomBcp.getBomBcpId(),bomBcp.getBcpCode())); - materialRequisitionDetailList.addAll(list); - } - } - return materialRequisitionDetailList; - } -} +// 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 materialRequisitionDetailDtoList) { +// //获取bom信息 +// //判断是否有bom +// SysBom sysBom = new SysBom(); +// sysBom.setFinishProductCode(materialCode); +// List sysBomList = sysBomService.selectSysBomList(sysBom); +// //如果是半成品,则继续查询 +// if (sysBomList.size() != 0) { +// //先查询原料 +// SysBomRawMaterial sysBomRawMaterial = new SysBomRawMaterial(); +// sysBomRawMaterial.setFinishProductCode(sysBomList.get(0).getFinishProductCode()); +// List 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 materialRequisitionDetailList = materialRequisitionDetailService.selectMaterialRequisitionDetailList(materialRequisitionDetail); +// List 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 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 orderMaterialList = outsourceOrderMaterialService.selectOutsourceOrderMaterialList(new OutsourceOrderMaterial(outsourceOrderNumber)); +// //委外明细 +// List materialRequisitionDetailList = new ArrayList<>(); +// //bom阶 +// int bomRank = 1; +// for (OutsourceOrderMaterial outsourceOrderMaterial : orderMaterialList) { +// List 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 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> map = new HashMap<>(); +// for (OutsourceOrderMaterial orderMaterial : orderMaterialList) { +// List materialRequisitionDetailList = exportOutsourceList(materialRequisitionInfo.getMaterialRequisitionNumber(), orderMaterial.getMaterialCode()); +// List 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 finishProductList = sysFinishProductService.selectSysFinishProductList(new SysFinishProduct(orderMaterial.getMaterialCode())); +// List 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 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 exportOutsourceList(String materialRequisitionNumber,String materialCode) { +// List result = new ArrayList<>(); +// List 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 sysBomBcpAllList(int bomRank,Double quantity,SysBomBcp sysBomBcp) { +// List materialRequisitionDetailList = new ArrayList<>(); +// List bomBcpList =sysBomBcpService.selectSysBomBcpList(sysBomBcp); +// List rawMaterialList = sysBomRawMaterialService.selectSysBomRawMaterialList(new SysBomRawMaterial(sysBomBcp.getFinishProductCode())); +// List 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 list = sysBomBcpAllList(bomRank+1,quantity,new SysBomBcp(bomBcp.getBomBcpId(),bomBcp.getBcpCode())); +// materialRequisitionDetailList.addAll(list); +// } +// } +// return materialRequisitionDetailList; +// } +//} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/outsource/controller/OutsourceInspectionNoticeController.java b/ruoyi-admin/src/main/java/com/ruoyi/outsource/controller/OutsourceInspectionNoticeController.java deleted file mode 100644 index 5d849241..00000000 --- a/ruoyi-admin/src/main/java/com/ruoyi/outsource/controller/OutsourceInspectionNoticeController.java +++ /dev/null @@ -1,292 +0,0 @@ -package com.ruoyi.outsource.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.style.WriteCellStyle; -import com.alibaba.excel.write.metadata.style.WriteFont; -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.outsource.domain.OutsourceInspectionNotice; -import com.ruoyi.outsource.domain.exportDto.OutsourceInspectionNoticeDto; -import com.ruoyi.outsource.service.IOutsourceInspectionNoticeService; -import com.ruoyi.purchase.domain.exportDto.PurchaseMaterialDto; -import com.ruoyi.storehouse.domain.WarehousingInspectionDetail; -import com.ruoyi.storehouse.domain.exportDto.WarehousingInspectionDetailDto; -import com.ruoyi.storehouse.service.IWarehousingInspectionDetailService; -import com.ruoyi.system.utils.CellStyleStrategy; -import com.ruoyi.system.utils.ExcelFillCellMergePrevColUtils; -import org.apache.poi.ss.usermodel.BorderStyle; -import org.apache.poi.ss.usermodel.HorizontalAlignment; -import org.apache.poi.ss.usermodel.VerticalAlignment; -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.IOException; -import java.net.URLEncoder; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -import static com.ruoyi.common.config.datasource.DynamicDataSourceContextHolder.log; - -/** - * 委外加工入库检验通知Controller - * - * @author ruoyi - * @date 2023-05-09 - */ -@Controller -@RequestMapping("/outsource/outsourceInspectionNotice") -public class OutsourceInspectionNoticeController extends BaseController -{ - private String prefix = "outsource/outsourceInspectionNotice"; - - /** - * excel数据量 - */ - private Integer excelSize = 8; - - @Autowired - private IOutsourceInspectionNoticeService outsourceInspectionNoticeService; - @Autowired - private IWarehousingInspectionDetailService warehousingInspectionDetailService; - - @RequiresPermissions("outsource:outsourceInspectionNotice:view") - @GetMapping() - public String outsourceInspectionNotice() - { - return prefix + "/outsourceInspectionNotice"; - } - - /** - * 查询委外加工入库检验通知列表 - */ - @RequiresPermissions("outsource:outsourceInspectionNotice:list") - @PostMapping("/list") - @ResponseBody - public TableDataInfo list(OutsourceInspectionNotice outsourceInspectionNotice) - { - startPage(); - List list = outsourceInspectionNoticeService.selectOutsourceInspectionNoticeList(outsourceInspectionNotice); - return getDataTable(list); - } - - /** - * 导出委外加工入库检验通知列表 - */ - @RequiresPermissions("outsource:outsourceInspectionNotice:export") - @Log(title = "委外加工入库检验通知", businessType = BusinessType.EXPORT) - @PostMapping("/export") - @ResponseBody - public AjaxResult export(OutsourceInspectionNotice outsourceInspectionNotice) - { - List list = outsourceInspectionNoticeService.selectOutsourceInspectionNoticeList(outsourceInspectionNotice); - ExcelUtil util = new ExcelUtil(OutsourceInspectionNotice.class); - return util.exportExcel(list, "委外加工入库检验通知数据"); - } - - /** - * 新增委外加工入库检验通知 - */ - @GetMapping("/add") - public String add() - { - return prefix + "/add"; - } - - /** - * 新增保存委外加工入库检验通知 - */ - @RequiresPermissions("outsource:outsourceInspectionNotice:add") - @Log(title = "委外加工入库检验通知", businessType = BusinessType.INSERT) - @PostMapping("/add") - @ResponseBody - public AjaxResult addSave(OutsourceInspectionNotice outsourceInspectionNotice) - { - return toAjax(outsourceInspectionNoticeService.insertOutsourceInspectionNotice(outsourceInspectionNotice)); - } - - /** - * 修改委外加工入库检验通知 - */ - @GetMapping("/edit/{warehousingInspectionNoticeId}") - public String edit(@PathVariable("warehousingInspectionNoticeId") Long warehousingInspectionNoticeId, ModelMap mmap) - { - OutsourceInspectionNotice outsourceInspectionNotice = outsourceInspectionNoticeService.selectOutsourceInspectionNoticeById(warehousingInspectionNoticeId); - mmap.put("outsourceInspectionNotice", outsourceInspectionNotice); - return prefix + "/edit"; - } - - /** - * 修改保存委外加工入库检验通知 - */ - @RequiresPermissions("outsource:outsourceInspectionNotice:edit") - @Log(title = "委外加工入库检验通知", businessType = BusinessType.UPDATE) - @PostMapping("/edit") - @ResponseBody - public AjaxResult editSave(OutsourceInspectionNotice outsourceInspectionNotice) - { - return toAjax(outsourceInspectionNoticeService.updateOutsourceInspectionNotice(outsourceInspectionNotice)); - } - - /** - * 删除委外加工入库检验通知 - */ - @RequiresPermissions("outsource:outsourceInspectionNotice:remove") - @Log(title = "委外加工入库检验通知", businessType = BusinessType.DELETE) - @PostMapping( "/remove") - @ResponseBody - public AjaxResult remove(String ids) - { - return toAjax(outsourceInspectionNoticeService.deleteOutsourceInspectionNoticeByIds(ids)); - } - - /** - * 获取订单id - */ - @PostMapping("/getId") - @ResponseBody - public Result getId() throws Exception { - return Result.getSuccessResult(outsourceInspectionNoticeService.getId()); - } - - @RequiresPermissions("outsource:outsourceInspectionNotice: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++) { - OutsourceInspectionNotice outsourceInspectionNotice = outsourceInspectionNoticeService.selectOutsourceInspectionNoticeById(Long.valueOf(idsStr[i])); - WarehousingInspectionDetail warehousingInDetail = new WarehousingInspectionDetail(); - warehousingInDetail.setInNoticeNumber(outsourceInspectionNotice.getInNoticeNumber()); - List list = warehousingInspectionDetailService.selectWarehousingInspectionDetailList(warehousingInDetail); - if (list.size()>0) { - for (int j=0;j detailList = warehousingInspectionDetailService.selectWarehousingInspectionDetailList(warehousingInspectionDetail); - List detailDtoList = new ArrayList<>(); - try { - int number = 0; - Iterator values= detailList.iterator(); - while(values.hasNext()) { - Object source = values.next(); - WarehousingInspectionDetailDto target = WarehousingInspectionDetailDto.class.newInstance(); - BeanUtils.copyProperties(source, target); -// mergePrevColUtils.add(number+6,1,1); - target.setNumber(++number); - target.setProcedureName(outsourceInspectionNoticeDto.getProcedureName()); - detailDtoList.add(target); - } - int size = detailDtoList.size(); - if (detailDtoList.size()>>>>>异常<<<<<<", e); - } - System.out.println(detailDtoList); - - 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\\exportOutsourceInspectionNotice.xlsx"; - try (ExcelWriter excelWriter = EasyExcel - .write(response.getOutputStream(), PurchaseMaterialDto.class) - .withTemplate(templateFileName) -// .registerWriteHandler(mergePrevColUtils) - //样式注册 - .registerWriteHandler(horizontalCellStyleStrategyBuilder()) - .build()) { - WriteSheet writeSheet = EasyExcel.writerSheet().build(); - FillConfig fillConfig = FillConfig.builder().forceNewRow(Boolean.TRUE).build(); - excelWriter.fill(detailDtoList, fillConfig, writeSheet); - Map map = MapUtils.newHashMap(); -// map.put("date", DateTimeFormatter.ofPattern("yyyy/MM/dd").format(LocalDateTime.now())); - map.put("supplierName", outsourceInspectionNoticeDto.getSupplierName()); - map.put("inspectionDate", outsourceInspectionNoticeDto.getInspectionDate().substring(0,10)); - excelWriter.fill(map, writeSheet); - } - } - - public CellStyleStrategy 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 CellStyleStrategy(headWriteCellStyle, contentWriteCellStyle); - } -} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/outsource/controller/OutsourceOrderInfoController.java b/ruoyi-admin/src/main/java/com/ruoyi/outsource/controller/OutsourceOrderInfoController.java deleted file mode 100644 index 8da87585..00000000 --- a/ruoyi-admin/src/main/java/com/ruoyi/outsource/controller/OutsourceOrderInfoController.java +++ /dev/null @@ -1,285 +0,0 @@ -package com.ruoyi.outsource.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.style.WriteCellStyle; -import com.alibaba.excel.write.metadata.style.WriteFont; -import com.alibaba.excel.write.style.HorizontalCellStyleStrategy; -import com.alibaba.fastjson.JSONObject; -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.outsource.domain.OutsourceOrderInfo; -import com.ruoyi.outsource.domain.OutsourceOrderMaterial; -import com.ruoyi.outsource.domain.exportDto.OutsourceOrderInfoDto; -import com.ruoyi.outsource.domain.exportDto.OutsourceOrderMaterialDto; -import com.ruoyi.outsource.service.IOutsourceOrderInfoService; -import com.ruoyi.outsource.service.IOutsourceOrderMaterialService; -import com.ruoyi.system.utils.ExcelFillCellMergePrevColUtils; -import org.apache.poi.ss.usermodel.BorderStyle; -import org.apache.poi.ss.usermodel.HorizontalAlignment; -import org.apache.poi.ss.usermodel.VerticalAlignment; -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.IOException; -import java.net.URLEncoder; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -import static com.ruoyi.common.config.datasource.DynamicDataSourceContextHolder.log; - -/** - * 委外加工订单Controller - * - * @author ruoyi - * @date 2023-04-17 - */ -@Controller -@RequestMapping("/outsource/outsourceOrderInfo") -public class OutsourceOrderInfoController extends BaseController -{ - private String prefix = "outsource/outsourceOrderInfo"; - - @Autowired - private IOutsourceOrderInfoService outsourceOrderInfoService; - @Autowired - private IOutsourceOrderMaterialService outsourceOrderMaterialService; - - @RequiresPermissions("outsource:outsourceOrderInfo:view") - @GetMapping() - public String outsourceOrderInfo() - { - return prefix + "/outsourceOrderInfo"; - } - - /** - * 查询委外加工订单列表 - */ - @RequiresPermissions("outsource:outsourceOrderInfo:list") - @PostMapping("/list") - @ResponseBody - public TableDataInfo list(OutsourceOrderInfo outsourceOrderInfo) - { - startPage(); - List list = outsourceOrderInfoService.selectOutsourceOrderInfoList(outsourceOrderInfo); - return getDataTable(list); - } - - /** - * 导出委外加工订单列表 - */ - @RequiresPermissions("outsource:outsourceOrderInfo:export") - @Log(title = "委外加工订单", businessType = BusinessType.EXPORT) - @PostMapping("/export") - @ResponseBody - public AjaxResult export(OutsourceOrderInfo outsourceOrderInfo) - { - List list = outsourceOrderInfoService.selectOutsourceOrderInfoList(outsourceOrderInfo); - ExcelUtil util = new ExcelUtil(OutsourceOrderInfo.class); - return util.exportExcel(list, "委外加工订单数据"); - } - - /** - * 新增委外加工订单 - */ - @GetMapping("/add") - public String add() - { - return prefix + "/add"; - } - - /** - * 新增保存委外加工订单 - */ - @RequiresPermissions("outsource:outsourceOrderInfo:add") - @Log(title = "委外加工订单", businessType = BusinessType.INSERT) - @PostMapping("/add") - @ResponseBody - public AjaxResult addSave(OutsourceOrderInfo outsourceOrderInfo) - { - return toAjax(outsourceOrderInfoService.insertOutsourceOrderInfo(outsourceOrderInfo)); - } - - /** - * 修改委外加工订单 - */ - @GetMapping("/edit/{outsourceOrderId}") - public String edit(@PathVariable("outsourceOrderId") Long outsourceOrderId, ModelMap mmap) - { - OutsourceOrderInfo outsourceOrderInfo = outsourceOrderInfoService.selectOutsourceOrderInfoById(outsourceOrderId); - mmap.put("outsourceOrderInfo", outsourceOrderInfo); - return prefix + "/edit"; - } - - /** - * 修改保存委外加工订单 - */ - @RequiresPermissions("outsource:outsourceOrderInfo:edit") - @Log(title = "委外加工订单", businessType = BusinessType.UPDATE) - @PostMapping("/edit") - @ResponseBody - public AjaxResult editSave(OutsourceOrderInfo outsourceOrderInfo) - { - return toAjax(outsourceOrderInfoService.updateOutsourceOrderInfo(outsourceOrderInfo)); - } - - /** - * 删除委外加工订单 - */ - @RequiresPermissions("outsource:outsourceOrderInfo:remove") - @Log(title = "委外加工订单", businessType = BusinessType.DELETE) - @PostMapping( "/remove") - @ResponseBody - public AjaxResult remove(String ids) - { - return toAjax(outsourceOrderInfoService.deleteOutsourceOrderInfoByIds(ids)); - } - - - @RequiresPermissions("outsource:outsourceOrderInfo:remove") - @Log(title = "委外加工订单", businessType = BusinessType.DELETE) - @RequestMapping( "/removeSelectedOrder") - @ResponseBody - public String removeSelectedOrder(@RequestParam(value = "orderData") String orderData) { -// System.out.println(orderData); - List outsourceOrderInfoList = JSONObject.parseArray(orderData, OutsourceOrderInfo.class); - - OutsourceOrderInfo outsourceOrderInfo = outsourceOrderInfoService.selectOutsourceOrderInfoById(outsourceOrderInfoList.get(0).getOutsourceOrderId()); - System.out.println(outsourceOrderInfo); - OutsourceOrderMaterial outsourceOrderMaterial = new OutsourceOrderMaterial(); - outsourceOrderMaterial.setOutsourceOrderNumber(outsourceOrderInfo.getOutsourceOrderNumber()); - List outsourceOrderMaterialList = outsourceOrderMaterialService.selectOutsourceOrderMaterialList(outsourceOrderMaterial); - if (outsourceOrderMaterialList.size()>0) { - for (int i=0;i outsourceOrderMaterialList = outsourceOrderMaterialService.selectOutsourceOrderMaterialList(outsourceOrderMaterial); - List outsourceOrderMaterialDtoList = new ArrayList<>(); - double total = 0.00; - try { - int number = 0; - Iterator values= outsourceOrderMaterialList.iterator(); - while(values.hasNext()) { - Object source = values.next(); - OutsourceOrderMaterialDto target = OutsourceOrderMaterialDto.class.newInstance(); - BeanUtils.copyProperties(source, target); - mergePrevColUtils.add(number+12,1,1); - mergePrevColUtils.add(number+12,7,1); - target.setNumber(++number); - outsourceOrderMaterialDtoList.add(target); - total = total + Double.parseDouble(target.getProcessFee()); - } - }catch (Exception e) { - log.error(">>>>>>异常<<<<<<", e); - } - System.out.println(outsourceOrderMaterialDtoList); - - 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\\exportOutsourceOrder.xlsx"; - try (ExcelWriter excelWriter = EasyExcel - .write(response.getOutputStream(), OutsourceOrderMaterialDto.class) - .withTemplate(templateFileName) - .registerWriteHandler(mergePrevColUtils) - //样式注册 - .registerWriteHandler(horizontalCellStyleStrategyBuilder()) - .build()) { - WriteSheet writeSheet = EasyExcel.writerSheet().build(); - FillConfig fillConfig = FillConfig.builder().forceNewRow(Boolean.TRUE).build(); - excelWriter.fill(outsourceOrderMaterialDtoList, fillConfig, writeSheet); - Map map = MapUtils.newHashMap(); -// map.put("date", DateTimeFormatter.ofPattern("yyyy/MM/dd").format(LocalDateTime.now())); - map.put("outsourceOrderNumber", outsourceOrderInfoDto.getOutsourceOrderNumber()); - map.put("billingTime", outsourceOrderInfoDto.getBillingTime()); - map.put("supplierName", outsourceOrderInfoDto.getSupplierName()); - map.put("supplierCode", outsourceOrderInfoDto.getSupplierCode()); - map.put("contactNumber", outsourceOrderInfoDto.getContactNumber()); - map.put("customerFax", outsourceOrderInfoDto.getCustomerFax()); - map.put("customerContact", outsourceOrderInfoDto.getCustomerContact()); - map.put("total", total); - 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.DASHED); - contentWriteCellStyle.setBorderLeft(BorderStyle.DASHED); - contentWriteCellStyle.setBorderRight(BorderStyle.DASHED); - contentWriteCellStyle.setBorderBottom(BorderStyle.DASHED); - - return new HorizontalCellStyleStrategy(headWriteCellStyle, contentWriteCellStyle); - } - - /** - * 获取报价编号 - */ - @PostMapping("/getId") - @ResponseBody - public Result getId() throws Exception { - return Result.getSuccessResult(outsourceOrderInfoService.getId()); - } -} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/outsource/controller/OutsourceOrderMaterialController.java b/ruoyi-admin/src/main/java/com/ruoyi/outsource/controller/OutsourceOrderMaterialController.java deleted file mode 100644 index e0435971..00000000 --- a/ruoyi-admin/src/main/java/com/ruoyi/outsource/controller/OutsourceOrderMaterialController.java +++ /dev/null @@ -1,166 +0,0 @@ -package com.ruoyi.outsource.controller; - -import com.alibaba.fastjson.JSONObject; -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.outsource.domain.OutsourceOrderMaterial; -import com.ruoyi.outsource.service.IOutsourceOrderMaterialService; -import org.apache.shiro.authz.annotation.RequiresPermissions; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Controller; -import org.springframework.ui.ModelMap; -import org.springframework.web.bind.annotation.*; - -import java.util.Arrays; -import java.util.List; -import java.util.Objects; - -import static com.ruoyi.common.core.domain.AjaxResult.Type.SUCCESS; - -/** - * 委外加工订单物料Controller - * - * @author ruoyi - * @date 2023-04-18 - */ -@Controller -@RequestMapping("/outsource/outsourceOrderMaterial") -public class OutsourceOrderMaterialController extends BaseController -{ - private String prefix = "outsource/outsourceOrderMaterial"; - - @Autowired - private IOutsourceOrderMaterialService outsourceOrderMaterialService; - - @RequiresPermissions("outsource:outsourceOrderMaterial:view") - @GetMapping() - public String outsourceOrderMaterial() - { - return prefix + "/outsourceOrderMaterial"; - } - - /** - * 查询委外加工订单物料列表 - */ - @RequiresPermissions("outsource:outsourceOrderMaterial:list") - @PostMapping("/list") - @ResponseBody - public TableDataInfo list(OutsourceOrderMaterial outsourceOrderMaterial) - { - startPage(); - List list = outsourceOrderMaterialService.selectOutsourceOrderMaterialList(outsourceOrderMaterial); - return getDataTable(list); - } - - /** - * 导出委外加工订单物料列表 - */ - @RequiresPermissions("outsource:outsourceOrderMaterial:export") - @Log(title = "委外加工订单物料", businessType = BusinessType.EXPORT) - @PostMapping("/export") - @ResponseBody - public AjaxResult export(OutsourceOrderMaterial outsourceOrderMaterial) - { - List list = outsourceOrderMaterialService.selectOutsourceOrderMaterialList(outsourceOrderMaterial); - ExcelUtil util = new ExcelUtil(OutsourceOrderMaterial.class); - return util.exportExcel(list, "委外加工订单物料数据"); - } - - /** - * 新增委外加工订单物料 - */ - @GetMapping("/add") - public String add() - { - return prefix + "/add"; - } - - /** - * 新增保存委外加工订单物料 - */ - @RequiresPermissions("outsource:outsourceOrderMaterial:add") - @Log(title = "委外加工订单物料", businessType = BusinessType.INSERT) - @PostMapping("/add") - @ResponseBody - public AjaxResult addSave(OutsourceOrderMaterial outsourceOrderMaterial) - { - return toAjax(outsourceOrderMaterialService.insertOutsourceOrderMaterial(outsourceOrderMaterial)); - } - - /** - * 修改委外加工订单物料 - */ - @GetMapping("/edit/{outsourceOrderMaterialId}") - public String edit(@PathVariable("outsourceOrderMaterialId") Long outsourceOrderMaterialId, ModelMap mmap) - { - OutsourceOrderMaterial outsourceOrderMaterial = outsourceOrderMaterialService.selectOutsourceOrderMaterialById(outsourceOrderMaterialId); - mmap.put("outsourceOrderMaterial", outsourceOrderMaterial); - return prefix + "/edit"; - } - - /** - * 修改保存委外加工订单物料 - */ - @RequiresPermissions("outsource:outsourceOrderMaterial:edit") - @Log(title = "委外加工订单物料", businessType = BusinessType.UPDATE) - @PostMapping("/edit") - @ResponseBody - public AjaxResult editSave(OutsourceOrderMaterial outsourceOrderMaterial) - { - return toAjax(outsourceOrderMaterialService.updateOutsourceOrderMaterial(outsourceOrderMaterial)); - } - - /** - * 删除委外加工订单物料 - */ - @RequiresPermissions("outsource:outsourceOrderMaterial:remove") - @Log(title = "委外加工订单物料", businessType = BusinessType.DELETE) - @PostMapping( "/remove") - @ResponseBody - public AjaxResult remove(String ids) - { - return toAjax(outsourceOrderMaterialService.deleteOutsourceOrderMaterialByIds(ids)); - } - - @PostMapping("/addEditSave") - @ResponseBody - public AjaxResult addEditSave(@RequestParam(value = "data") String data) - { - - // 反序列化 - List outsourceOrderMaterialList = JSONObject.parseArray(data, OutsourceOrderMaterial.class); - - - for (int i=0;i idList = Arrays.asList(ids.split(",")); - for (int i=0;i selectOutsourceInspectionNoticeList(OutsourceInspectionNotice outsourceInspectionNotice); - - /** - * 新增委外加工入库检验通知 - * - * @param outsourceInspectionNotice 委外加工入库检验通知 - * @return 结果 - */ - public int insertOutsourceInspectionNotice(OutsourceInspectionNotice outsourceInspectionNotice); - - /** - * 修改委外加工入库检验通知 - * - * @param outsourceInspectionNotice 委外加工入库检验通知 - * @return 结果 - */ - public int updateOutsourceInspectionNotice(OutsourceInspectionNotice outsourceInspectionNotice); - - /** - * 删除委外加工入库检验通知 - * - * @param warehousingInspectionNoticeId 委外加工入库检验通知ID - * @return 结果 - */ - public int deleteOutsourceInspectionNoticeById(Long warehousingInspectionNoticeId); - - /** - * 批量删除委外加工入库检验通知 - * - * @param warehousingInspectionNoticeIds 需要删除的数据ID - * @return 结果 - */ - public int deleteOutsourceInspectionNoticeByIds(String[] warehousingInspectionNoticeIds); -} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/outsource/mapper/OutsourceOrderInfoMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/outsource/mapper/OutsourceOrderInfoMapper.java deleted file mode 100644 index 39b8200d..00000000 --- a/ruoyi-admin/src/main/java/com/ruoyi/outsource/mapper/OutsourceOrderInfoMapper.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.ruoyi.outsource.mapper; - -import com.ruoyi.outsource.domain.OutsourceOrderInfo; - -import java.util.List; - -/** - * 委外加工订单Mapper接口 - * - * @author ruoyi - * @date 2023-04-17 - */ -public interface OutsourceOrderInfoMapper -{ - /** - * 查询委外加工订单 - * - * @param outsourceOrderId 委外加工订单ID - * @return 委外加工订单 - */ - public OutsourceOrderInfo selectOutsourceOrderInfoById(Long outsourceOrderId); - - /** - * 查询委外加工订单列表 - * - * @param outsourceOrderInfo 委外加工订单 - * @return 委外加工订单集合 - */ - public List selectOutsourceOrderInfoList(OutsourceOrderInfo outsourceOrderInfo); - - /** - * 新增委外加工订单 - * - * @param outsourceOrderInfo 委外加工订单 - * @return 结果 - */ - public int insertOutsourceOrderInfo(OutsourceOrderInfo outsourceOrderInfo); - - /** - * 修改委外加工订单 - * - * @param outsourceOrderInfo 委外加工订单 - * @return 结果 - */ - public int updateOutsourceOrderInfo(OutsourceOrderInfo outsourceOrderInfo); - - /** - * 删除委外加工订单 - * - * @param outsourceOrderId 委外加工订单ID - * @return 结果 - */ - public int deleteOutsourceOrderInfoById(Long outsourceOrderId); - - /** - * 批量删除委外加工订单 - * - * @param outsourceOrderIds 需要删除的数据ID - * @return 结果 - */ - public int deleteOutsourceOrderInfoByIds(String[] outsourceOrderIds); - - public List selectByIdDesc(); -} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/outsource/mapper/OutsourceOrderMaterialMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/outsource/mapper/OutsourceOrderMaterialMapper.java deleted file mode 100644 index 5f3b27ad..00000000 --- a/ruoyi-admin/src/main/java/com/ruoyi/outsource/mapper/OutsourceOrderMaterialMapper.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.ruoyi.outsource.mapper; - -import java.util.List; -import com.ruoyi.outsource.domain.OutsourceOrderMaterial; - -/** - * 委外加工订单物料Mapper接口 - * - * @author ruoyi - * @date 2023-04-18 - */ -public interface OutsourceOrderMaterialMapper -{ - /** - * 查询委外加工订单物料 - * - * @param outsourceOrderMaterialId 委外加工订单物料ID - * @return 委外加工订单物料 - */ - public OutsourceOrderMaterial selectOutsourceOrderMaterialById(Long outsourceOrderMaterialId); - - /** - * 查询委外加工订单物料列表 - * - * @param outsourceOrderMaterial 委外加工订单物料 - * @return 委外加工订单物料集合 - */ - public List selectOutsourceOrderMaterialList(OutsourceOrderMaterial outsourceOrderMaterial); - - /** - * 新增委外加工订单物料 - * - * @param outsourceOrderMaterial 委外加工订单物料 - * @return 结果 - */ - public int insertOutsourceOrderMaterial(OutsourceOrderMaterial outsourceOrderMaterial); - - /** - * 修改委外加工订单物料 - * - * @param outsourceOrderMaterial 委外加工订单物料 - * @return 结果 - */ - public int updateOutsourceOrderMaterial(OutsourceOrderMaterial outsourceOrderMaterial); - - /** - * 删除委外加工订单物料 - * - * @param outsourceOrderMaterialId 委外加工订单物料ID - * @return 结果 - */ - public int deleteOutsourceOrderMaterialById(Long outsourceOrderMaterialId); - - /** - * 批量删除委外加工订单物料 - * - * @param outsourceOrderMaterialIds 需要删除的数据ID - * @return 结果 - */ - public int deleteOutsourceOrderMaterialByIds(String[] outsourceOrderMaterialIds); -} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/outsource/mapper/OutsourceProcessMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/outsource/mapper/OutsourceProcessMapper.java deleted file mode 100644 index 8de5ac98..00000000 --- a/ruoyi-admin/src/main/java/com/ruoyi/outsource/mapper/OutsourceProcessMapper.java +++ /dev/null @@ -1,77 +0,0 @@ -package com.ruoyi.outsource.mapper; - -import java.util.List; -import com.ruoyi.outsource.domain.OutsourceProcess; - -/** - * 委外工序列表Mapper接口 - * - * @author zhang - * @date 2024-03-08 - */ -public interface OutsourceProcessMapper -{ - /** - * 查询委外工序列表 - * - * @param outsourceProcessId 委外工序列表ID - * @return 委外工序列表 - */ - public OutsourceProcess selectOutsourceProcessById(String outsourceProcessId); - - /** - * 查询委外工序列表列表 - * - * @param outsourceProcess 委外工序列表 - * @return 委外工序列表集合 - */ - public List selectOutsourceProcessList(OutsourceProcess outsourceProcess); - - /** - * 新增委外工序列表 - * - * @param outsourceProcess 委外工序列表 - * @return 结果 - */ - public int insertOutsourceProcess(OutsourceProcess outsourceProcess); - - /** - * 修改委外工序列表 - * - * @param outsourceProcess 委外工序列表 - * @return 结果 - */ - public int updateOutsourceProcess(OutsourceProcess outsourceProcess); - - /** - * 删除委外工序列表 - * - * @param outsourceProcessId 委外工序列表ID - * @return 结果 - */ - public int deleteOutsourceProcessById(String outsourceProcessId); - - /** - * 批量删除委外工序列表 - * - * @param outsourceProcessIds 需要删除的数据ID - * @return 结果 - */ - public int deleteOutsourceProcessByIds(String[] outsourceProcessIds); - - /** - * 作废委外工序列表 - * - * @param outsourceProcessId 委外工序列表ID - * @return 结果 - */ - public int cancelOutsourceProcessById(String outsourceProcessId); - - /** - * 恢复委外工序列表 - * - * @param outsourceProcessId 委外工序列表ID - * @return 结果 - */ - public int restoreOutsourceProcessById(String outsourceProcessId); -} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/outsource/service/IOutsourceInspectionNoticeService.java b/ruoyi-admin/src/main/java/com/ruoyi/outsource/service/IOutsourceInspectionNoticeService.java deleted file mode 100644 index d43f5208..00000000 --- a/ruoyi-admin/src/main/java/com/ruoyi/outsource/service/IOutsourceInspectionNoticeService.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.ruoyi.outsource.service; - -import com.ruoyi.outsource.domain.OutsourceInspectionNotice; - -import java.util.List; - -/** - * 委外加工入库检验通知Service接口 - * - * @author ruoyi - * @date 2023-05-09 - */ -public interface IOutsourceInspectionNoticeService -{ - /** - * 查询委外加工入库检验通知 - * - * @param warehousingInspectionNoticeId 委外加工入库检验通知ID - * @return 委外加工入库检验通知 - */ - public OutsourceInspectionNotice selectOutsourceInspectionNoticeById(Long warehousingInspectionNoticeId); - - /** - * 查询委外加工入库检验通知列表 - * - * @param outsourceInspectionNotice 委外加工入库检验通知 - * @return 委外加工入库检验通知集合 - */ - public List selectOutsourceInspectionNoticeList(OutsourceInspectionNotice outsourceInspectionNotice); - - /** - * 新增委外加工入库检验通知 - * - * @param outsourceInspectionNotice 委外加工入库检验通知 - * @return 结果 - */ - public int insertOutsourceInspectionNotice(OutsourceInspectionNotice outsourceInspectionNotice); - - /** - * 修改委外加工入库检验通知 - * - * @param outsourceInspectionNotice 委外加工入库检验通知 - * @return 结果 - */ - public int updateOutsourceInspectionNotice(OutsourceInspectionNotice outsourceInspectionNotice); - - /** - * 批量删除委外加工入库检验通知 - * - * @param ids 需要删除的数据ID - * @return 结果 - */ - public int deleteOutsourceInspectionNoticeByIds(String ids); - - /** - * 删除委外加工入库检验通知信息 - * - * @param warehousingInspectionNoticeId 委外加工入库检验通知ID - * @return 结果 - */ - public int deleteOutsourceInspectionNoticeById(Long warehousingInspectionNoticeId); - - public String getId(); -} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/outsource/service/IOutsourceOrderInfoService.java b/ruoyi-admin/src/main/java/com/ruoyi/outsource/service/IOutsourceOrderInfoService.java deleted file mode 100644 index 62cdc99c..00000000 --- a/ruoyi-admin/src/main/java/com/ruoyi/outsource/service/IOutsourceOrderInfoService.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.ruoyi.outsource.service; - -import com.ruoyi.outsource.domain.OutsourceOrderInfo; - -import java.util.List; - -/** - * 委外加工订单Service接口 - * - * @author ruoyi - * @date 2023-04-17 - */ -public interface IOutsourceOrderInfoService -{ - /** - * 查询委外加工订单 - * - * @param outsourceOrderId 委外加工订单ID - * @return 委外加工订单 - */ - public OutsourceOrderInfo selectOutsourceOrderInfoById(Long outsourceOrderId); - - /** - * 查询委外加工订单列表 - * - * @param outsourceOrderInfo 委外加工订单 - * @return 委外加工订单集合 - */ - public List selectOutsourceOrderInfoList(OutsourceOrderInfo outsourceOrderInfo); - - /** - * 新增委外加工订单 - * - * @param outsourceOrderInfo 委外加工订单 - * @return 结果 - */ - public int insertOutsourceOrderInfo(OutsourceOrderInfo outsourceOrderInfo); - - /** - * 修改委外加工订单 - * - * @param outsourceOrderInfo 委外加工订单 - * @return 结果 - */ - public int updateOutsourceOrderInfo(OutsourceOrderInfo outsourceOrderInfo); - - /** - * 批量删除委外加工订单 - * - * @param ids 需要删除的数据ID - * @return 结果 - */ - public int deleteOutsourceOrderInfoByIds(String ids); - - /** - * 删除委外加工订单信息 - * - * @param outsourceOrderId 委外加工订单ID - * @return 结果 - */ - public int deleteOutsourceOrderInfoById(Long outsourceOrderId); - - public String getId(); -} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/outsource/service/IOutsourceOrderMaterialService.java b/ruoyi-admin/src/main/java/com/ruoyi/outsource/service/IOutsourceOrderMaterialService.java deleted file mode 100644 index 0b3a19a5..00000000 --- a/ruoyi-admin/src/main/java/com/ruoyi/outsource/service/IOutsourceOrderMaterialService.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.ruoyi.outsource.service; - -import java.util.List; -import com.ruoyi.outsource.domain.OutsourceOrderMaterial; - -/** - * 委外加工订单物料Service接口 - * - * @author ruoyi - * @date 2023-04-18 - */ -public interface IOutsourceOrderMaterialService -{ - /** - * 查询委外加工订单物料 - * - * @param outsourceOrderMaterialId 委外加工订单物料ID - * @return 委外加工订单物料 - */ - public OutsourceOrderMaterial selectOutsourceOrderMaterialById(Long outsourceOrderMaterialId); - - /** - * 查询委外加工订单物料列表 - * - * @param outsourceOrderMaterial 委外加工订单物料 - * @return 委外加工订单物料集合 - */ - public List selectOutsourceOrderMaterialList(OutsourceOrderMaterial outsourceOrderMaterial); - - /** - * 新增委外加工订单物料 - * - * @param outsourceOrderMaterial 委外加工订单物料 - * @return 结果 - */ - public int insertOutsourceOrderMaterial(OutsourceOrderMaterial outsourceOrderMaterial); - - /** - * 修改委外加工订单物料 - * - * @param outsourceOrderMaterial 委外加工订单物料 - * @return 结果 - */ - public int updateOutsourceOrderMaterial(OutsourceOrderMaterial outsourceOrderMaterial); - - /** - * 批量删除委外加工订单物料 - * - * @param ids 需要删除的数据ID - * @return 结果 - */ - public int deleteOutsourceOrderMaterialByIds(String ids); - - /** - * 删除委外加工订单物料信息 - * - * @param outsourceOrderMaterialId 委外加工订单物料ID - * @return 结果 - */ - public int deleteOutsourceOrderMaterialById(Long outsourceOrderMaterialId); -} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/outsource/service/IOutsourceProcessService.java b/ruoyi-admin/src/main/java/com/ruoyi/outsource/service/IOutsourceProcessService.java deleted file mode 100644 index 7052f9f1..00000000 --- a/ruoyi-admin/src/main/java/com/ruoyi/outsource/service/IOutsourceProcessService.java +++ /dev/null @@ -1,77 +0,0 @@ -package com.ruoyi.outsource.service; - -import java.util.List; -import com.ruoyi.outsource.domain.OutsourceProcess; - -/** - * 委外工序列表Service接口 - * - * @author zhang - * @date 2024-03-08 - */ -public interface IOutsourceProcessService -{ - /** - * 查询委外工序列表 - * - * @param outsourceProcessId 委外工序列表ID - * @return 委外工序列表 - */ - public OutsourceProcess selectOutsourceProcessById(String outsourceProcessId); - - /** - * 查询委外工序列表列表 - * - * @param outsourceProcess 委外工序列表 - * @return 委外工序列表集合 - */ - public List selectOutsourceProcessList(OutsourceProcess outsourceProcess); - - /** - * 新增委外工序列表 - * - * @param outsourceProcess 委外工序列表 - * @return 结果 - */ - public int insertOutsourceProcess(OutsourceProcess outsourceProcess); - - /** - * 修改委外工序列表 - * - * @param outsourceProcess 委外工序列表 - * @return 结果 - */ - public int updateOutsourceProcess(OutsourceProcess outsourceProcess); - - /** - * 批量删除委外工序列表 - * - * @param ids 需要删除的数据ID - * @return 结果 - */ - public int deleteOutsourceProcessByIds(String ids); - - /** - * 删除委外工序列表信息 - * - * @param outsourceProcessId 委外工序列表ID - * @return 结果 - */ - public int deleteOutsourceProcessById(String outsourceProcessId); - - /** - * 作废委外工序列表 - * @param outsourceProcessId 委外工序列表ID - * @return - */ - int cancelOutsourceProcessById(String outsourceProcessId); - - /** - * 恢复委外工序列表 - * @param outsourceProcessId 委外工序列表ID - * @return - */ - int restoreOutsourceProcessById(String outsourceProcessId); - - Object getId(); -} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/outsource/service/impl/OutsourceInspectionNoticeServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/outsource/service/impl/OutsourceInspectionNoticeServiceImpl.java deleted file mode 100644 index d4b1629d..00000000 --- a/ruoyi-admin/src/main/java/com/ruoyi/outsource/service/impl/OutsourceInspectionNoticeServiceImpl.java +++ /dev/null @@ -1,102 +0,0 @@ -package com.ruoyi.outsource.service.impl; - -import com.ruoyi.common.core.text.Convert; -import com.ruoyi.outsource.domain.OutsourceInspectionNotice; -import com.ruoyi.outsource.mapper.OutsourceInspectionNoticeMapper; -import com.ruoyi.outsource.service.IOutsourceInspectionNoticeService; -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-05-09 - */ -@Service -public class OutsourceInspectionNoticeServiceImpl implements IOutsourceInspectionNoticeService -{ - @Autowired - private OutsourceInspectionNoticeMapper outsourceInspectionNoticeMapper; - - /** - * 查询委外加工入库检验通知 - * - * @param warehousingInspectionNoticeId 委外加工入库检验通知ID - * @return 委外加工入库检验通知 - */ - @Override - public OutsourceInspectionNotice selectOutsourceInspectionNoticeById(Long warehousingInspectionNoticeId) - { - return outsourceInspectionNoticeMapper.selectOutsourceInspectionNoticeById(warehousingInspectionNoticeId); - } - - /** - * 查询委外加工入库检验通知列表 - * - * @param outsourceInspectionNotice 委外加工入库检验通知 - * @return 委外加工入库检验通知 - */ - @Override - public List selectOutsourceInspectionNoticeList(OutsourceInspectionNotice outsourceInspectionNotice) - { - return outsourceInspectionNoticeMapper.selectOutsourceInspectionNoticeList(outsourceInspectionNotice); - } - - /** - * 新增委外加工入库检验通知 - * - * @param outsourceInspectionNotice 委外加工入库检验通知 - * @return 结果 - */ - @Override - public int insertOutsourceInspectionNotice(OutsourceInspectionNotice outsourceInspectionNotice) - { - return outsourceInspectionNoticeMapper.insertOutsourceInspectionNotice(outsourceInspectionNotice); - } - - /** - * 修改委外加工入库检验通知 - * - * @param outsourceInspectionNotice 委外加工入库检验通知 - * @return 结果 - */ - @Override - public int updateOutsourceInspectionNotice(OutsourceInspectionNotice outsourceInspectionNotice) - { - return outsourceInspectionNoticeMapper.updateOutsourceInspectionNotice(outsourceInspectionNotice); - } - - /** - * 删除委外加工入库检验通知对象 - * - * @param ids 需要删除的数据ID - * @return 结果 - */ - @Override - public int deleteOutsourceInspectionNoticeByIds(String ids) - { - return outsourceInspectionNoticeMapper.deleteOutsourceInspectionNoticeByIds(Convert.toStrArray(ids)); - } - - /** - * 删除委外加工入库检验通知信息 - * - * @param warehousingInspectionNoticeId 委外加工入库检验通知ID - * @return 结果 - */ - @Override - public int deleteOutsourceInspectionNoticeById(Long warehousingInspectionNoticeId) - { - return outsourceInspectionNoticeMapper.deleteOutsourceInspectionNoticeById(warehousingInspectionNoticeId); - } - - @Override - public String getId() { - String time = new SimpleDateFormat("yyyyMMddHHmmssSSS").format(System.currentTimeMillis()); - return "QCWOI" + time.substring(2); - } -} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/outsource/service/impl/OutsourceOrderInfoServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/outsource/service/impl/OutsourceOrderInfoServiceImpl.java deleted file mode 100644 index 38348a66..00000000 --- a/ruoyi-admin/src/main/java/com/ruoyi/outsource/service/impl/OutsourceOrderInfoServiceImpl.java +++ /dev/null @@ -1,102 +0,0 @@ -package com.ruoyi.outsource.service.impl; - -import com.ruoyi.common.core.text.Convert; -import com.ruoyi.outsource.domain.OutsourceOrderInfo; -import com.ruoyi.outsource.mapper.OutsourceOrderInfoMapper; -import com.ruoyi.outsource.service.IOutsourceOrderInfoService; -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-17 - */ -@Service -public class OutsourceOrderInfoServiceImpl implements IOutsourceOrderInfoService -{ - @Autowired - private OutsourceOrderInfoMapper outsourceOrderInfoMapper; - - /** - * 查询委外加工订单 - * - * @param outsourceOrderId 委外加工订单ID - * @return 委外加工订单 - */ - @Override - public OutsourceOrderInfo selectOutsourceOrderInfoById(Long outsourceOrderId) - { - return outsourceOrderInfoMapper.selectOutsourceOrderInfoById(outsourceOrderId); - } - - /** - * 查询委外加工订单列表 - * - * @param outsourceOrderInfo 委外加工订单 - * @return 委外加工订单 - */ - @Override - public List selectOutsourceOrderInfoList(OutsourceOrderInfo outsourceOrderInfo) - { - return outsourceOrderInfoMapper.selectOutsourceOrderInfoList(outsourceOrderInfo); - } - - /** - * 新增委外加工订单 - * - * @param outsourceOrderInfo 委外加工订单 - * @return 结果 - */ - @Override - public int insertOutsourceOrderInfo(OutsourceOrderInfo outsourceOrderInfo) - { - return outsourceOrderInfoMapper.insertOutsourceOrderInfo(outsourceOrderInfo); - } - - /** - * 修改委外加工订单 - * - * @param outsourceOrderInfo 委外加工订单 - * @return 结果 - */ - @Override - public int updateOutsourceOrderInfo(OutsourceOrderInfo outsourceOrderInfo) - { - return outsourceOrderInfoMapper.updateOutsourceOrderInfo(outsourceOrderInfo); - } - - /** - * 删除委外加工订单对象 - * - * @param ids 需要删除的数据ID - * @return 结果 - */ - @Override - public int deleteOutsourceOrderInfoByIds(String ids) - { - return outsourceOrderInfoMapper.deleteOutsourceOrderInfoByIds(Convert.toStrArray(ids)); - } - - /** - * 删除委外加工订单信息 - * - * @param outsourceOrderId 委外加工订单ID - * @return 结果 - */ - @Override - public int deleteOutsourceOrderInfoById(Long outsourceOrderId) - { - return outsourceOrderInfoMapper.deleteOutsourceOrderInfoById(outsourceOrderId); - } - - @Override - public String getId() { - String time = new SimpleDateFormat("yyyyMMddHHmmssSSS").format(System.currentTimeMillis()); - return "OP" + time.substring(2); - } -} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/outsource/service/impl/OutsourceOrderMaterialServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/outsource/service/impl/OutsourceOrderMaterialServiceImpl.java deleted file mode 100644 index 962f8105..00000000 --- a/ruoyi-admin/src/main/java/com/ruoyi/outsource/service/impl/OutsourceOrderMaterialServiceImpl.java +++ /dev/null @@ -1,94 +0,0 @@ -package com.ruoyi.outsource.service.impl; - -import java.util.List; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import com.ruoyi.outsource.mapper.OutsourceOrderMaterialMapper; -import com.ruoyi.outsource.domain.OutsourceOrderMaterial; -import com.ruoyi.outsource.service.IOutsourceOrderMaterialService; -import com.ruoyi.common.core.text.Convert; - -/** - * 委外加工订单物料Service业务层处理 - * - * @author ruoyi - * @date 2023-04-18 - */ -@Service -public class OutsourceOrderMaterialServiceImpl implements IOutsourceOrderMaterialService -{ - @Autowired - private OutsourceOrderMaterialMapper outsourceOrderMaterialMapper; - - /** - * 查询委外加工订单物料 - * - * @param outsourceOrderMaterialId 委外加工订单物料ID - * @return 委外加工订单物料 - */ - @Override - public OutsourceOrderMaterial selectOutsourceOrderMaterialById(Long outsourceOrderMaterialId) - { - return outsourceOrderMaterialMapper.selectOutsourceOrderMaterialById(outsourceOrderMaterialId); - } - - /** - * 查询委外加工订单物料列表 - * - * @param outsourceOrderMaterial 委外加工订单物料 - * @return 委外加工订单物料 - */ - @Override - public List selectOutsourceOrderMaterialList(OutsourceOrderMaterial outsourceOrderMaterial) - { - return outsourceOrderMaterialMapper.selectOutsourceOrderMaterialList(outsourceOrderMaterial); - } - - /** - * 新增委外加工订单物料 - * - * @param outsourceOrderMaterial 委外加工订单物料 - * @return 结果 - */ - @Override - public int insertOutsourceOrderMaterial(OutsourceOrderMaterial outsourceOrderMaterial) - { - return outsourceOrderMaterialMapper.insertOutsourceOrderMaterial(outsourceOrderMaterial); - } - - /** - * 修改委外加工订单物料 - * - * @param outsourceOrderMaterial 委外加工订单物料 - * @return 结果 - */ - @Override - public int updateOutsourceOrderMaterial(OutsourceOrderMaterial outsourceOrderMaterial) - { - return outsourceOrderMaterialMapper.updateOutsourceOrderMaterial(outsourceOrderMaterial); - } - - /** - * 删除委外加工订单物料对象 - * - * @param ids 需要删除的数据ID - * @return 结果 - */ - @Override - public int deleteOutsourceOrderMaterialByIds(String ids) - { - return outsourceOrderMaterialMapper.deleteOutsourceOrderMaterialByIds(Convert.toStrArray(ids)); - } - - /** - * 删除委外加工订单物料信息 - * - * @param outsourceOrderMaterialId 委外加工订单物料ID - * @return 结果 - */ - @Override - public int deleteOutsourceOrderMaterialById(Long outsourceOrderMaterialId) - { - return outsourceOrderMaterialMapper.deleteOutsourceOrderMaterialById(outsourceOrderMaterialId); - } -} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/outsource/service/impl/OutsourceProcessServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/outsource/service/impl/OutsourceProcessServiceImpl.java deleted file mode 100644 index b632e330..00000000 --- a/ruoyi-admin/src/main/java/com/ruoyi/outsource/service/impl/OutsourceProcessServiceImpl.java +++ /dev/null @@ -1,141 +0,0 @@ -package com.ruoyi.outsource.service.impl; - -import java.text.SimpleDateFormat; -import java.util.List; - -import com.ruoyi.common.core.redis.RedisCache; -import com.ruoyi.common.utils.DateUtils; -import com.ruoyi.common.utils.ShiroUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import com.ruoyi.outsource.mapper.OutsourceProcessMapper; -import com.ruoyi.outsource.domain.OutsourceProcess; -import com.ruoyi.outsource.service.IOutsourceProcessService; -import com.ruoyi.common.core.text.Convert; - -/** - * 委外工序列表Service业务层处理 - * - * @author zhang - * @date 2024-03-08 - */ -@Service -public class OutsourceProcessServiceImpl implements IOutsourceProcessService -{ - @Autowired - private OutsourceProcessMapper outsourceProcessMapper; - - @Autowired - private RedisCache redisCache; - - /** - * 查询委外工序列表 - * - * @param outsourceProcessId 委外工序列表ID - * @return 委外工序列表 - */ - @Override - public OutsourceProcess selectOutsourceProcessById(String outsourceProcessId) - { - return outsourceProcessMapper.selectOutsourceProcessById(outsourceProcessId); - } - - /** - * 查询委外工序列表列表 - * - * @param outsourceProcess 委外工序列表 - * @return 委外工序列表 - */ - @Override - public List selectOutsourceProcessList(OutsourceProcess outsourceProcess) - { - return outsourceProcessMapper.selectOutsourceProcessList(outsourceProcess); - } - - /** - * 新增委外工序列表 - * - * @param outsourceProcess 委外工序列表 - * @return 结果 - */ - @Override - public int insertOutsourceProcess(OutsourceProcess outsourceProcess) - { - String loginName = ShiroUtils.getLoginName(); - outsourceProcess.setCreateBy(loginName); - outsourceProcess.setCreateTime(DateUtils.getNowDate()); - return outsourceProcessMapper.insertOutsourceProcess(outsourceProcess); - } - - /** - * 修改委外工序列表 - * - * @param outsourceProcess 委外工序列表 - * @return 结果 - */ - @Override - public int updateOutsourceProcess(OutsourceProcess outsourceProcess) - { - String loginName = ShiroUtils.getLoginName(); - outsourceProcess.setUpdateBy(loginName); - outsourceProcess.setUpdateTime(DateUtils.getNowDate()); - return outsourceProcessMapper.updateOutsourceProcess(outsourceProcess); - } - - /** - * 删除委外工序列表对象 - * - * @param ids 需要删除的数据ID - * @return 结果 - */ - @Override - public int deleteOutsourceProcessByIds(String ids) - { - return outsourceProcessMapper.deleteOutsourceProcessByIds(Convert.toStrArray(ids)); - } - - /** - * 删除委外工序列表信息 - * - * @param outsourceProcessId 委外工序列表ID - * @return 结果 - */ - @Override - public int deleteOutsourceProcessById(String outsourceProcessId) - { - return outsourceProcessMapper.deleteOutsourceProcessById(outsourceProcessId); - } - - /** - * 作废委外工序列表 - * - * @param outsourceProcessId 委外工序列表ID - * @return 结果 - */ - @Override - public int cancelOutsourceProcessById(String outsourceProcessId) - { - return outsourceProcessMapper.cancelOutsourceProcessById(outsourceProcessId); - } - - /** - * 恢复委外工序列表信息 - * - * @param outsourceProcessId 委外工序列表ID - * @return 结果 - */ - @Override - public int restoreOutsourceProcessById(String outsourceProcessId) - { - return outsourceProcessMapper.restoreOutsourceProcessById(outsourceProcessId); - } - - /** - * 获取生成委外工序ID - * @return - */ - @Override - public Object getId() { - return redisCache.generateNo("WWGX"); - } -} diff --git a/ruoyi-admin/src/main/resources/mapper/outsource/OutsourceInspectionNoticeMapper.xml b/ruoyi-admin/src/main/resources/mapper/outsource/OutsourceInspectionNoticeMapper.xml deleted file mode 100644 index 4bf4e0e4..00000000 --- a/ruoyi-admin/src/main/resources/mapper/outsource/OutsourceInspectionNoticeMapper.xml +++ /dev/null @@ -1,165 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - select warehousing_inspection_notice_id, in_notice_number, purchase_order_number, outsource_order_number, supplier_code, supplier_name, customer_contact, stock_number, stock_name, stock_manager, export_sales, warehousing_category, inspection_date, warehousing_date, remarks, inspection_report, first_add_time, update_info_time, procedure_code, procedure_name, standby_one, standby_two, receiving_personnel, entry_personnel, processing_type, confirm_flag, confirm_person, confirm_time from warehousing_inspection_notice - where in_notice_number like '%QCWOI%' - - - - - - - - insert into warehousing_inspection_notice - - in_notice_number, - purchase_order_number, - outsource_order_number, - supplier_code, - supplier_name, - customer_contact, - stock_number, - stock_name, - stock_manager, - export_sales, - warehousing_category, - inspection_date, - warehousing_date, - remarks, - inspection_report, - procedure_code, - procedure_name, - standby_one, - standby_two, - receiving_personnel, - entry_personnel, - processing_type, - confirm_flag, - confirm_person, - confirm_time, - first_add_time, - - - #{inNoticeNumber}, - #{purchaseOrderNumber}, - #{outsourceOrderNumber}, - #{supplierCode}, - #{supplierName}, - #{customerContact}, - #{stockNumber}, - #{stockName}, - #{stockManager}, - #{exportSales}, - #{warehousingCategory}, - #{inspectionDate}, - #{warehousingDate}, - #{remarks}, - #{inspectionReport}, - #{procedureCode}, - #{procedureName}, - #{standbyOne}, - #{standbyTwo}, - #{receivingPersonnel}, - #{entryPersonnel}, - #{processingType}, - #{confirmFlag}, - #{confirmPerson}, - #{confirmTime}, - now(), - - - - - update warehousing_inspection_notice - - in_notice_number = #{inNoticeNumber}, - purchase_order_number = #{purchaseOrderNumber}, - outsource_order_number = #{outsourceOrderNumber}, - supplier_code = #{supplierCode}, - supplier_name = #{supplierName}, - customer_contact = #{customerContact}, - stock_number = #{stockNumber}, - stock_name = #{stockName}, - stock_manager = #{stockManager}, - export_sales = #{exportSales}, - warehousing_category = #{warehousingCategory}, - inspection_date = #{inspectionDate}, - warehousing_date = #{warehousingDate}, - remarks = #{remarks}, - inspection_report = #{inspectionReport}, - procedure_code = #{procedureCode}, - procedure_name = #{procedureName}, - standby_one = #{standbyOne}, - standby_two = #{standbyTwo}, - receiving_personnel = #{receivingPersonnel}, - entry_personnel = #{entryPersonnel}, - processing_type = #{processingType}, - confirm_flag = #{confirmFlag}, - confirm_person = #{confirmPerson}, - confirm_time = #{confirmTime}, - update_info_time = CONCAT_WS(',',NOW(),update_info_time), - - where warehousing_inspection_notice_id = #{warehousingInspectionNoticeId} - - - - delete from warehousing_inspection_notice where warehousing_inspection_notice_id = #{warehousingInspectionNoticeId} - - - - delete from warehousing_inspection_notice where warehousing_inspection_notice_id in - - #{warehousingInspectionNoticeId} - - - - \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/mapper/outsource/OutsourceOrderInfoMapper.xml b/ruoyi-admin/src/main/resources/mapper/outsource/OutsourceOrderInfoMapper.xml deleted file mode 100644 index 8fea2505..00000000 --- a/ruoyi-admin/src/main/resources/mapper/outsource/OutsourceOrderInfoMapper.xml +++ /dev/null @@ -1,169 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - select outsource_order_id, outsource_order_number, outsource_batch_number, supplier_code, supplier_name, customer_contact, contact_number, customer_fax, customer_address, delivery_time, procedure_code, procedure_name, issue_stock_number, issue_stock_name, delivery_stock_number, delivery_stock_name, billing_time, remarks, carrier_company, confirm_flag, confirm_person, confirm_time, close_case_flag, close_case_person, close_case_time, first_add_time, update_info_time, standby_one, standby_two from outsource_order_info - - - - - - - - insert into outsource_order_info - - outsource_order_number, - outsource_batch_number, - supplier_code, - supplier_name, - customer_contact, - contact_number, - customer_fax, - customer_address, - delivery_time, - procedure_code, - procedure_name, - issue_stock_number, - issue_stock_name, - delivery_stock_number, - delivery_stock_name, - billing_time, - remarks, - carrier_company, - confirm_flag, - confirm_person, - confirm_time, - close_case_flag, - close_case_person, - close_case_time, - standby_one, - standby_two, - first_add_time, - - - #{outsourceOrderNumber}, - #{outsourceBatchNumber}, - #{supplierCode}, - #{supplierName}, - #{customerContact}, - #{contactNumber}, - #{customerFax}, - #{customerAddress}, - #{deliveryTime}, - #{procedureCode}, - #{procedureName}, - #{issueStockNumber}, - #{issueStockName}, - #{deliveryStockNumber}, - #{deliveryStockName}, - #{billingTime}, - #{remarks}, - #{carrierCompany}, - #{confirmFlag}, - #{confirmPerson}, - #{confirmTime}, - #{closeCaseFlag}, - #{closeCasePerson}, - #{closeCaseTime}, - #{standbyOne}, - #{standbyTwo}, - now(), - - - - - update outsource_order_info - - outsource_order_number = #{outsourceOrderNumber}, - outsource_batch_number = #{outsourceBatchNumber}, - supplier_code = #{supplierCode}, - supplier_name = #{supplierName}, - customer_contact = #{customerContact}, - contact_number = #{contactNumber}, - customer_fax = #{customerFax}, - customer_address = #{customerAddress}, - delivery_time = #{deliveryTime}, - procedure_code = #{procedureCode}, - procedure_name = #{procedureName}, - issue_stock_number = #{issueStockNumber}, - issue_stock_name = #{issueStockName}, - delivery_stock_number = #{deliveryStockNumber}, - delivery_stock_name = #{deliveryStockName}, - billing_time = #{billingTime}, - remarks = #{remarks}, - carrier_company = #{carrierCompany}, - confirm_flag = #{confirmFlag}, - confirm_person = #{confirmPerson}, - confirm_time = #{confirmTime}, - close_case_flag = #{closeCaseFlag}, - close_case_person = #{closeCasePerson}, - close_case_time = #{closeCaseTime}, - standby_one = #{standbyOne}, - standby_two = #{standbyTwo}, - update_info_time = CONCAT_WS(',',NOW(),update_info_time), - - where outsource_order_id = #{outsourceOrderId} - - - - delete from outsource_order_info where outsource_order_id = #{outsourceOrderId} - - - - delete from outsource_order_info where outsource_order_id in - - #{outsourceOrderId} - - - - \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/mapper/outsource/OutsourceOrderMaterialMapper.xml b/ruoyi-admin/src/main/resources/mapper/outsource/OutsourceOrderMaterialMapper.xml deleted file mode 100644 index fbfec3ab..00000000 --- a/ruoyi-admin/src/main/resources/mapper/outsource/OutsourceOrderMaterialMapper.xml +++ /dev/null @@ -1,113 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - select outsource_order_material_id, outsource_order_number, outsource_work_number, material_code, material_name, specification_model, material_type, inventory_unit, quantity, process_price, process_fee, delivery_date, description, standby_one, standby_two from outsource_order_material - - - - - - - - insert into outsource_order_material - - outsource_order_number, - outsource_work_number, - material_code, - material_name, - specification_model, - material_type, - inventory_unit, - quantity, - process_price, - process_fee, - delivery_date, - description, - standby_one, - standby_two, - - - #{outsourceOrderNumber}, - #{outsourceWorkNumber}, - #{materialCode}, - #{materialName}, - #{specificationModel}, - #{materialType}, - #{inventoryUnit}, - #{quantity}, - #{processPrice}, - #{processFee}, - #{deliveryDate}, - #{description}, - #{standbyOne}, - #{standbyTwo}, - - - - - update outsource_order_material - - outsource_order_number = #{outsourceOrderNumber}, - outsource_work_number = #{outsourceWorkNumber}, - material_code = #{materialCode}, - material_name = #{materialName}, - specification_model = #{specificationModel}, - material_type = #{materialType}, - inventory_unit = #{inventoryUnit}, - quantity = #{quantity}, - process_price = #{processPrice}, - process_fee = #{processFee}, - delivery_date = #{deliveryDate}, - description = #{description}, - standby_one = #{standbyOne}, - standby_two = #{standbyTwo}, - - where outsource_order_material_id = #{outsourceOrderMaterialId} - - - - delete from outsource_order_material where outsource_order_material_id = #{outsourceOrderMaterialId} - - - - delete from outsource_order_material where outsource_order_material_id in - - #{outsourceOrderMaterialId} - - - - \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/mapper/outsource/OutsourceProcessMapper.xml b/ruoyi-admin/src/main/resources/mapper/outsource/OutsourceProcessMapper.xml deleted file mode 100644 index 19ea0d23..00000000 --- a/ruoyi-admin/src/main/resources/mapper/outsource/OutsourceProcessMapper.xml +++ /dev/null @@ -1,95 +0,0 @@ - - - - - - - - - - - - - - - - - select outsource_process_Id, outsource_process_code, outsource_process_name, remark, create_by, create_time, update_by, update_time from outsource_process - - - - - - - - insert into outsource_process - - outsource_process_Id, - outsource_process_code, - outsource_process_name, - remark, - create_by, - create_time, - update_by, - update_time, - - - #{outsourceProcessId}, - #{outsourceProcessCode}, - #{outsourceProcessName}, - #{remark}, - #{createBy}, - #{createTime}, - #{updateBy}, - #{updateTime}, - - - - - update outsource_process - - outsource_process_code = #{outsourceProcessCode}, - outsource_process_name = #{outsourceProcessName}, - remark = #{remark}, - create_by = #{createBy}, - create_time = #{createTime}, - update_by = #{updateBy}, - update_time = #{updateTime}, - - where outsource_process_Id = #{outsourceProcessId} - - - - delete from outsource_process where outsource_process_Id = #{outsourceProcessId} - - - - delete from outsource_process where outsource_process_Id in - - #{outsourceProcessId} - - - - - update outsource_process set del_flag = '1' where outsource_process_Id = #{outsourceProcessId} - - - - update outsource_process set del_flag = '0' where outsource_process_Id = #{outsourceProcessId} - - - \ No newline at end of file