From bcd835b3f7fd71982956b030de5dc7f9920598df Mon Sep 17 00:00:00 2001 From: liuxiaoxu <1793812695@qq.com> Date: Mon, 15 Jul 2024 15:27:46 +0800 Subject: [PATCH] =?UTF-8?q?[feat]=20=E5=A7=94=E5=A4=96=E5=8A=A0=E5=B7=A5?= =?UTF-8?q?=20=E6=95=B4=E5=90=88=E6=96=B0=E5=A2=9E=E5=A7=94=E5=A4=96?= =?UTF-8?q?=E9=A2=86=E6=96=99=20controller=20=E6=95=B4=E5=90=88=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E5=A7=94=E5=A4=96=E9=A2=86=E6=96=99=20=20Service=20?= =?UTF-8?q?=E6=95=B4=E5=90=88=E6=96=B0=E5=A2=9E=E5=A7=94=E5=A4=96=E9=A2=86?= =?UTF-8?q?=E6=96=99=20=20ServiceImpl=20=E6=95=B4=E5=90=88=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E5=A7=94=E5=A4=96=E9=A2=86=E6=96=99=20=20Mapper=20?= =?UTF-8?q?=E6=95=B4=E5=90=88=E6=96=B0=E5=A2=9E=E5=A7=94=E5=A4=96=E9=A2=86?= =?UTF-8?q?=E6=96=99=20=20Mapper.xml=20=E6=95=B4=E5=90=88=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E5=A7=94=E5=A4=96=E9=A2=86=E6=96=99=20=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E5=89=8D=E7=AB=AF=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../OutsourceRequisitionController.java | 128 +++++++++++++++ .../system/domain/OutsourceRequisition.java | 144 +++++++++++++++++ .../domain/OutsourceRequisitionDetail.java | 93 +++++++++++ .../mapper/OutsourceRequisitionMapper.java | 89 +++++++++++ .../service/IOutsourceRequisitionService.java | 63 ++++++++ .../impl/OutsourceRequisitionServiceImpl.java | 140 ++++++++++++++++ .../system/OutsourceRequisitionMapper.xml | 137 ++++++++++++++++ .../system/outsource_requisition/add.html | 146 +++++++++++++++++ .../system/outsource_requisition/edit.html | 151 ++++++++++++++++++ .../outsource_requisition.html | 134 ++++++++++++++++ 10 files changed, 1225 insertions(+) create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/system/controller/OutsourceRequisitionController.java create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/system/domain/OutsourceRequisition.java create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/system/domain/OutsourceRequisitionDetail.java create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/system/mapper/OutsourceRequisitionMapper.java create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/system/service/IOutsourceRequisitionService.java create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/OutsourceRequisitionServiceImpl.java create mode 100644 ruoyi-admin/src/main/resources/mapper/system/OutsourceRequisitionMapper.xml create mode 100644 ruoyi-admin/src/main/resources/templates/system/outsource_requisition/add.html create mode 100644 ruoyi-admin/src/main/resources/templates/system/outsource_requisition/edit.html create mode 100644 ruoyi-admin/src/main/resources/templates/system/outsource_requisition/outsource_requisition.html diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/controller/OutsourceRequisitionController.java b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/OutsourceRequisitionController.java new file mode 100644 index 00000000..ed34d8bb --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/OutsourceRequisitionController.java @@ -0,0 +1,128 @@ +package com.ruoyi.system.controller; + +import java.util.List; + +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.system.domain.OutsourceRequisition; +import com.ruoyi.system.service.IOutsourceRequisitionService; +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 com.ruoyi.common.annotation.Log; +import com.ruoyi.common.enums.BusinessType; + +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; + +import com.ruoyi.common.core.page.TableDataInfo; + +/** + * 委外领料Controller + * + * @author ruoyi + * @date 2024-07-06 + */ +@Controller +@RequestMapping("/system/outsource_requisition") +public class OutsourceRequisitionController extends BaseController +{ + private String prefix = "system/outsource_requisition"; + + @Autowired + private IOutsourceRequisitionService outsourceRequisitionService; + + @RequiresPermissions("system:outsource_requisition:view") + @GetMapping() + public String outsource_requisition() + { + return prefix + "/outsource_requisition"; + } + + /** + * 查询委外领料列表 + */ + @RequiresPermissions("system:outsource_requisition:list") + @PostMapping("/list") + @ResponseBody + public TableDataInfo list(OutsourceRequisition outsourceRequisition) + { + startPage(); + List list = outsourceRequisitionService.selectOutsourceRequisitionList(outsourceRequisition); + return getDataTable(list); + } + + /** + * 导出委外领料列表 + */ + @RequiresPermissions("system:outsource_requisition:export") + @Log(title = "委外领料", businessType = BusinessType.EXPORT) + @PostMapping("/export") + @ResponseBody + public AjaxResult export(OutsourceRequisition outsourceRequisition) + { + List list = outsourceRequisitionService.selectOutsourceRequisitionList(outsourceRequisition); + ExcelUtil util = new ExcelUtil(OutsourceRequisition.class); + return util.exportExcel(list, "委外领料数据"); + } + + /** + * 新增委外领料 + */ + @GetMapping("/add") + public String add() + { + return prefix + "/add"; + } + + /** + * 新增保存委外领料 + */ + @RequiresPermissions("system:outsource_requisition:add") + @Log(title = "委外领料", businessType = BusinessType.INSERT) + @PostMapping("/addRequisition") + @ResponseBody + public AjaxResult addSave(@RequestBody OutsourceRequisition outsourceRequisition) + { + System.out.println(outsourceRequisition); + return toAjax(outsourceRequisitionService.insertOutsourceRequisition(outsourceRequisition)); + } + + + /** + * 修改委外领料 + */ + @RequiresPermissions("system:outsource_requisition:edit") + @GetMapping("/edit/{outsourceRequisitionId}") + public String edit(@PathVariable("outsourceRequisitionId") Long outsourceRequisitionId, ModelMap mmap) + { + OutsourceRequisition outsourceRequisition = outsourceRequisitionService.selectOutsourceRequisitionByOutsourceRequisitionId(outsourceRequisitionId); + mmap.put("outsourceRequisition", outsourceRequisition); + return prefix + "/edit"; + } + + /** + * 修改保存委外领料 + */ + @RequiresPermissions("system:outsource_requisition:edit") + @Log(title = "委外领料", businessType = BusinessType.UPDATE) + @PostMapping("/edit") + @ResponseBody + public AjaxResult editSave(OutsourceRequisition outsourceRequisition) + { + return toAjax(outsourceRequisitionService.updateOutsourceRequisition(outsourceRequisition)); + } + + /** + * 删除委外领料 + */ + @RequiresPermissions("system:outsource_requisition:remove") + @Log(title = "委外领料", businessType = BusinessType.DELETE) + @PostMapping( "/remove") + @ResponseBody + public AjaxResult remove(String ids) + { + return toAjax(outsourceRequisitionService.deleteOutsourceRequisitionByOutsourceRequisitionIds(ids)); + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/domain/OutsourceRequisition.java b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/OutsourceRequisition.java new file mode 100644 index 00000000..ab5dd74e --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/OutsourceRequisition.java @@ -0,0 +1,144 @@ +package com.ruoyi.system.domain; + +import java.util.List; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 委外领料对象 outsource_requisition + * + * @author ruoyi + * @date 2024-07-06 + */ +public class OutsourceRequisition extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 委外领料id */ + private Long outsourceRequisitionId; + + /** 委外领料编号 */ + @Excel(name = "委外领料编号") + private String outsourceRequisitionNo; + + /** 委外订单编号 */ + @Excel(name = "委外订单编号") + private String outsourceOrderNo; + + /** 领料员 */ + @Excel(name = "领料员") + private String requisitionPerson; + + /** 物料合计 */ + @Excel(name = "物料合计") + private Long materialAmount; + + /** 数量总计 */ + @Excel(name = "数量总计") + private Long totalAmount; + + /** 审核状态 */ + @Excel(name = "审核状态") + private String auditStatus; + + /** 领料状态 */ + @Excel(name = "领料状态") + private String requisitionStatus; + + public String getRequisitionStatus() { + return requisitionStatus; + } + + public void setRequisitionStatus(String requisitionStatus) { + this.requisitionStatus = requisitionStatus; + } + + /** 委外领料详情信息 */ + private List outsourceRequisitionDetailList; + + public Long getOutsourceRequisitionId() { + return outsourceRequisitionId; + } + + public void setOutsourceRequisitionId(Long outsourceRequisitionId) { + this.outsourceRequisitionId = outsourceRequisitionId; + } + + public String getOutsourceRequisitionNo() { + return outsourceRequisitionNo; + } + + public void setOutsourceRequisitionNo(String outsourceRequisitionNo) { + this.outsourceRequisitionNo = outsourceRequisitionNo; + } + + public String getOutsourceOrderNo() { + return outsourceOrderNo; + } + + public void setOutsourceOrderNo(String outsourceOrderNo) { + this.outsourceOrderNo = outsourceOrderNo; + } + + public String getRequisitionPerson() { + return requisitionPerson; + } + + public void setRequisitionPerson(String requisitionPerson) { + this.requisitionPerson = requisitionPerson; + } + + public Long getMaterialAmount() { + return materialAmount; + } + + public void setMaterialAmount(Long materialAmount) { + this.materialAmount = materialAmount; + } + + public Long getTotalAmount() { + return totalAmount; + } + + public void setTotalAmount(Long totalAmount) { + this.totalAmount = totalAmount; + } + + public String getAuditStatus() { + return auditStatus; + } + + public void setAuditStatus(String auditStatus) { + this.auditStatus = auditStatus; + } + + public List getOutsourceRequisitionDetailList() { + return outsourceRequisitionDetailList; + } + + public void setOutsourceRequisitionDetailList(List outsourceRequisitionDetailList) + { + this.outsourceRequisitionDetailList = outsourceRequisitionDetailList; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("outsourceRequisitionId", getOutsourceRequisitionId()) + .append("outsourceRequisitionNo", getOutsourceRequisitionNo()) + .append("outsourceOrderNo", getOutsourceOrderNo()) + .append("requisitionPerson", getRequisitionPerson()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("materialAmount", getMaterialAmount()) + .append("totalAmount", getTotalAmount()) + .append("auditStatus", getAuditStatus()) + .append("requisitionStatus", getRequisitionStatus()) + .append("outsourceRequisitionDetailList", getOutsourceRequisitionDetailList()) + .toString(); + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/domain/OutsourceRequisitionDetail.java b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/OutsourceRequisitionDetail.java new file mode 100644 index 00000000..f8b56920 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/OutsourceRequisitionDetail.java @@ -0,0 +1,93 @@ +package com.ruoyi.system.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 委外领料详情对象 outsource_requisition_detail + * + * @author ruoyi + * @date 2024-07-06 + */ +public class OutsourceRequisitionDetail extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 委外领料详情id */ + private Long outsourceRequisitionDetailId; + + /** 委外领料编号 */ + @Excel(name = "委外领料编号") + private String outsourceRequisitionNo; + + /** 料号 */ + @Excel(name = "料号") + private String materialNo; + + /** 已委外领料数 */ + @Excel(name = "已委外领料数") + private Long takenMaterial; + + /** 本次委外领料数 */ + @Excel(name = "本次委外领料数") + private Long takingMaterial; + + public void setOutsourceRequisitionDetailId(Long outsourceRequisitionDetailId) + { + this.outsourceRequisitionDetailId = outsourceRequisitionDetailId; + } + + public Long getOutsourceRequisitionDetailId() + { + return outsourceRequisitionDetailId; + } + public void setOutsourceRequisitionNo(String outsourceRequisitionNo) + { + this.outsourceRequisitionNo = outsourceRequisitionNo; + } + + public String getOutsourceRequisitionNo() + { + return outsourceRequisitionNo; + } + public void setMaterialNo(String materialNo) + { + this.materialNo = materialNo; + } + + public String getMaterialNo() + { + return materialNo; + } + public void setTakenMaterial(Long takenMaterial) + { + this.takenMaterial = takenMaterial; + } + + public Long getTakenMaterial() + { + return takenMaterial; + } + public void setTakingMaterial(Long takingMaterial) + { + this.takingMaterial = takingMaterial; + } + + public Long getTakingMaterial() + { + return takingMaterial; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("outsourceRequisitionDetailId", getOutsourceRequisitionDetailId()) + .append("outsourceRequisitionNo", getOutsourceRequisitionNo()) + .append("materialNo", getMaterialNo()) + .append("takenMaterial", getTakenMaterial()) + .append("takingMaterial", getTakingMaterial()) + .toString(); + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/OutsourceRequisitionMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/OutsourceRequisitionMapper.java new file mode 100644 index 00000000..bb906786 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/OutsourceRequisitionMapper.java @@ -0,0 +1,89 @@ +package com.ruoyi.system.mapper; + +import com.ruoyi.system.domain.OutsourceRequisition; +import com.ruoyi.system.domain.OutsourceRequisitionDetail; + +import java.util.List; + + +/** + * 委外领料Mapper接口 + * + * @author ruoyi + * @date 2024-07-06 + */ +public interface OutsourceRequisitionMapper +{ + /** + * 查询委外领料 + * + * @param outsourceRequisitionId 委外领料主键 + * @return 委外领料 + */ + public OutsourceRequisition selectOutsourceRequisitionByOutsourceRequisitionId(Long outsourceRequisitionId); + + /** + * 查询委外领料列表 + * + * @param outsourceRequisition 委外领料 + * @return 委外领料集合 + */ + public List selectOutsourceRequisitionList(OutsourceRequisition outsourceRequisition); + + /** + * 新增委外领料 + * + * @param outsourceRequisition 委外领料 + * @return 结果 + */ + public int insertOutsourceRequisition(OutsourceRequisition outsourceRequisition); + + /** + * 修改委外领料 + * + * @param outsourceRequisition 委外领料 + * @return 结果 + */ + public int updateOutsourceRequisition(OutsourceRequisition outsourceRequisition); + + /** + * 删除委外领料 + * + * @param outsourceRequisitionId 委外领料主键 + * @return 结果 + */ + public int deleteOutsourceRequisitionByOutsourceRequisitionId(Long outsourceRequisitionId); + + /** + * 批量删除委外领料 + * + * @param outsourceRequisitionIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteOutsourceRequisitionByOutsourceRequisitionIds(String[] outsourceRequisitionIds); + + /** + * 批量删除委外领料详情 + * + * @param outsourceRequisitionIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteOutsourceRequisitionDetailByOutsourceRequisitionNos(String[] outsourceRequisitionIds); + + /** + * 批量新增委外领料详情 + * + * @param outsourceRequisitionDetailList 委外领料详情列表 + * @return 结果 + */ + public int batchOutsourceRequisitionDetail(List outsourceRequisitionDetailList); + + + /** + * 通过委外领料主键删除委外领料详情信息 + * + * @param outsourceRequisitionId 委外领料ID + * @return 结果 + */ + public int deleteOutsourceRequisitionDetailByOutsourceRequisitionNo(Long outsourceRequisitionId); +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/IOutsourceRequisitionService.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/IOutsourceRequisitionService.java new file mode 100644 index 00000000..036249e5 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/service/IOutsourceRequisitionService.java @@ -0,0 +1,63 @@ +package com.ruoyi.system.service; + +import com.ruoyi.system.domain.OutsourceRequisition; + +import java.util.List; + + +/** + * 委外领料Service接口 + * + * @author ruoyi + * @date 2024-07-06 + */ +public interface IOutsourceRequisitionService +{ + /** + * 查询委外领料 + * + * @param outsourceRequisitionId 委外领料主键 + * @return 委外领料 + */ + public OutsourceRequisition selectOutsourceRequisitionByOutsourceRequisitionId(Long outsourceRequisitionId); + + /** + * 查询委外领料列表 + * + * @param outsourceRequisition 委外领料 + * @return 委外领料集合 + */ + public List selectOutsourceRequisitionList(OutsourceRequisition outsourceRequisition); + + /** + * 新增委外领料 + * + * @param outsourceRequisition 委外领料 + * @return 结果 + */ + public int insertOutsourceRequisition(OutsourceRequisition outsourceRequisition); + + /** + * 修改委外领料 + * + * @param outsourceRequisition 委外领料 + * @return 结果 + */ + public int updateOutsourceRequisition(OutsourceRequisition outsourceRequisition); + + /** + * 批量删除委外领料 + * + * @param outsourceRequisitionIds 需要删除的委外领料主键集合 + * @return 结果 + */ + public int deleteOutsourceRequisitionByOutsourceRequisitionIds(String outsourceRequisitionIds); + + /** + * 删除委外领料信息 + * + * @param outsourceRequisitionId 委外领料主键 + * @return 结果 + */ + public int deleteOutsourceRequisitionByOutsourceRequisitionId(Long outsourceRequisitionId); +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/OutsourceRequisitionServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/OutsourceRequisitionServiceImpl.java new file mode 100644 index 00000000..acd04a8c --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/OutsourceRequisitionServiceImpl.java @@ -0,0 +1,140 @@ +package com.ruoyi.system.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.system.domain.OutsourceRequisition; +import com.ruoyi.system.domain.OutsourceRequisitionDetail; +import com.ruoyi.system.mapper.OutsourceRequisitionMapper; +import com.ruoyi.system.service.IOutsourceRequisitionService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import java.util.ArrayList; +import com.ruoyi.common.utils.StringUtils; +import org.springframework.transaction.annotation.Transactional; + +import com.ruoyi.common.core.text.Convert; + +/** + * 委外领料Service业务层处理 + * + * @author ruoyi + * @date 2024-07-06 + */ +@Service +public class OutsourceRequisitionServiceImpl implements IOutsourceRequisitionService +{ + @Autowired + private OutsourceRequisitionMapper outsourceRequisitionMapper; + + /** + * 查询委外领料 + * + * @param outsourceRequisitionId 委外领料主键 + * @return 委外领料 + */ + @Override + public OutsourceRequisition selectOutsourceRequisitionByOutsourceRequisitionId(Long outsourceRequisitionId) + { + return outsourceRequisitionMapper.selectOutsourceRequisitionByOutsourceRequisitionId(outsourceRequisitionId); + } + + /** + * 查询委外领料列表 + * + * @param outsourceRequisition 委外领料 + * @return 委外领料 + */ + @Override + public List selectOutsourceRequisitionList(OutsourceRequisition outsourceRequisition) + { + return outsourceRequisitionMapper.selectOutsourceRequisitionList(outsourceRequisition); + } + + /** + * 新增委外领料 + * + * @param outsourceRequisition 委外领料 + * @return 结果 + */ + @Transactional + @Override + public int insertOutsourceRequisition(OutsourceRequisition outsourceRequisition) + { + outsourceRequisition.setCreateTime(DateUtils.getNowDate()); + outsourceRequisition.setAuditStatus("0"); + outsourceRequisition.setRequisitionStatus("0"); + outsourceRequisition.setOutsourceRequisitionNo("WWLL20231103003"); + outsourceRequisition.setRequisitionPerson("张三"); + int rows = outsourceRequisitionMapper.insertOutsourceRequisition(outsourceRequisition); + insertOutsourceRequisitionDetail(outsourceRequisition); + return rows; + } + + /** + * 修改委外领料 + * + * @param outsourceRequisition 委外领料 + * @return 结果 + */ + @Transactional + @Override + public int updateOutsourceRequisition(OutsourceRequisition outsourceRequisition) + { + outsourceRequisition.setUpdateTime(DateUtils.getNowDate()); + outsourceRequisitionMapper.deleteOutsourceRequisitionDetailByOutsourceRequisitionNo(outsourceRequisition.getOutsourceRequisitionId()); + insertOutsourceRequisitionDetail(outsourceRequisition); + return outsourceRequisitionMapper.updateOutsourceRequisition(outsourceRequisition); + } + + /** + * 批量删除委外领料 + * + * @param outsourceRequisitionIds 需要删除的委外领料主键 + * @return 结果 + */ + @Transactional + @Override + public int deleteOutsourceRequisitionByOutsourceRequisitionIds(String outsourceRequisitionIds) + { + outsourceRequisitionMapper.deleteOutsourceRequisitionDetailByOutsourceRequisitionNos(Convert.toStrArray(outsourceRequisitionIds)); + return outsourceRequisitionMapper.deleteOutsourceRequisitionByOutsourceRequisitionIds(Convert.toStrArray(outsourceRequisitionIds)); + } + + /** + * 删除委外领料信息 + * + * @param outsourceRequisitionId 委外领料主键 + * @return 结果 + */ + @Transactional + @Override + public int deleteOutsourceRequisitionByOutsourceRequisitionId(Long outsourceRequisitionId) + { + outsourceRequisitionMapper.deleteOutsourceRequisitionDetailByOutsourceRequisitionNo(outsourceRequisitionId); + return outsourceRequisitionMapper.deleteOutsourceRequisitionByOutsourceRequisitionId(outsourceRequisitionId); + } + + /** + * 新增委外领料详情信息 + * + * @param outsourceRequisition 委外领料对象 + */ + public void insertOutsourceRequisitionDetail(OutsourceRequisition outsourceRequisition) + { + List outsourceRequisitionDetailList = outsourceRequisition.getOutsourceRequisitionDetailList(); + String outsourceRequisitionNo = outsourceRequisition.getOutsourceRequisitionNo(); + if (StringUtils.isNotNull(outsourceRequisitionDetailList)) + { + List list = new ArrayList(); + for (OutsourceRequisitionDetail outsourceRequisitionDetail : outsourceRequisitionDetailList) + { + outsourceRequisitionDetail.setOutsourceRequisitionNo(outsourceRequisitionNo); + list.add(outsourceRequisitionDetail); + } + if (list.size() > 0) + { + outsourceRequisitionMapper.batchOutsourceRequisitionDetail(list); + } + } + } +} diff --git a/ruoyi-admin/src/main/resources/mapper/system/OutsourceRequisitionMapper.xml b/ruoyi-admin/src/main/resources/mapper/system/OutsourceRequisitionMapper.xml new file mode 100644 index 00000000..e6c17f67 --- /dev/null +++ b/ruoyi-admin/src/main/resources/mapper/system/OutsourceRequisitionMapper.xml @@ -0,0 +1,137 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select outsource_requisition_id, outsource_requisition_no, outsource_order_no, requisition_person, create_by, create_time, update_by, update_time, material_amount, total_amount, audit_status,requisition_status from outsource_requisition + + + + + + + + + + insert into outsource_requisition + + outsource_requisition_no, + outsource_order_no, + requisition_person, + create_by, + create_time, + update_by, + update_time, + material_amount, + total_amount, + audit_status, + requisition_status, + + + #{outsourceRequisitionNo}, + #{outsourceOrderNo}, + #{requisitionPerson}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{materialAmount}, + #{totalAmount}, + #{auditStatus}, + #{requisitionStatus}, + + + + + update outsource_requisition + + outsource_requisition_no = #{outsourceRequisitionNo}, + outsource_order_no = #{outsourceOrderNo}, + requisition_person = #{requisitionPerson}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + material_amount = #{materialAmount}, + total_amount = #{totalAmount}, + audit_status = #{auditStatus}, + requsition_status = #{requisitionStatus}, + + where outsource_requisition_id = #{outsourceRequisitionId} + + + + delete from outsource_requisition where outsource_requisition_id = #{outsourceRequisitionId} + + + + delete from outsource_requisition where outsource_requisition_id in + + #{outsourceRequisitionId} + + + + + delete from outsource_requisition_detail where outsource_requisition_no in + + #{outsourceRequisitionNo} + + + + + delete from outsource_requisition_detail where outsource_requisition_no = #{outsourceRequisitionNo} + + + + insert into outsource_requisition_detail( outsource_requisition_detail_id, outsource_requisition_no, material_no, taken_material, taking_material) values + + ( #{item.outsourceRequisitionDetailId}, #{item.outsourceRequisitionNo}, #{item.materialNo}, #{item.takenMaterial}, #{item.takingMaterial}) + + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/system/outsource_requisition/add.html b/ruoyi-admin/src/main/resources/templates/system/outsource_requisition/add.html new file mode 100644 index 00000000..6c389eb3 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/system/outsource_requisition/add.html @@ -0,0 +1,146 @@ + + + + + + +
+
+

委外领料信息

+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+

委外领料详情信息

+
+
+ + +
+
+
+
+
+
+
+ + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/system/outsource_requisition/edit.html b/ruoyi-admin/src/main/resources/templates/system/outsource_requisition/edit.html new file mode 100644 index 00000000..1e805c44 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/system/outsource_requisition/edit.html @@ -0,0 +1,151 @@ + + + + + + +
+
+

委外领料信息

+ +
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+

委外领料详情信息

+
+
+ + +
+
+
+
+
+
+
+ + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/system/outsource_requisition/outsource_requisition.html b/ruoyi-admin/src/main/resources/templates/system/outsource_requisition/outsource_requisition.html new file mode 100644 index 00000000..ff193dee --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/system/outsource_requisition/outsource_requisition.html @@ -0,0 +1,134 @@ + + + + + + +
+
+
+
+
+
    +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • +  搜索 +  重置 +
  • +
+
+
+
+ + +
+
+
+
+
+ + + + \ No newline at end of file