diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/controller/BaseRequisitioningOrderController.java b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/BaseRequisitioningOrderController.java new file mode 100644 index 00000000..d6a59c19 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/BaseRequisitioningOrderController.java @@ -0,0 +1,151 @@ +package com.ruoyi.system.controller; + +import java.util.List; +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.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.system.domain.BaseRequisitioningOrder; +import com.ruoyi.system.service.IBaseRequisitioningOrderService; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.core.page.TableDataInfo; + +/** + * 请购单Controller + * + * @author zhang + * @date 2024-05-13 + */ +@Controller +@RequestMapping("/system/requisitioning") +public class BaseRequisitioningOrderController extends BaseController +{ + private String prefix = "system/requisitioning"; + + @Autowired + private IBaseRequisitioningOrderService baseRequisitioningOrderService; + + @RequiresPermissions("system:requisitioning:view") + @GetMapping() + public String requisitioning() + { + return prefix + "/requisitioning"; + } + + /** + * 查询请购单列表 + */ + @RequiresPermissions("system:requisitioning:list") + @PostMapping("/list") + @ResponseBody + public TableDataInfo list(BaseRequisitioningOrder baseRequisitioningOrder) + { + startPage(); + List list = baseRequisitioningOrderService.selectBaseRequisitioningOrderList(baseRequisitioningOrder); + return getDataTable(list); + } + + /** + * 导出请购单列表 + */ + @RequiresPermissions("system:requisitioning:export") + @Log(title = "请购单", businessType = BusinessType.EXPORT) + @PostMapping("/export") + @ResponseBody + public AjaxResult export(BaseRequisitioningOrder baseRequisitioningOrder) + { + List list = baseRequisitioningOrderService.selectBaseRequisitioningOrderList(baseRequisitioningOrder); + ExcelUtil util = new ExcelUtil(BaseRequisitioningOrder.class); + return util.exportExcel(list, "请购单数据"); + } + + /** + * 新增请购单 + */ + @GetMapping("/add") + public String add() + { + return prefix + "/add"; + } + + /** + * 新增保存请购单 + */ + @RequiresPermissions("system:requisitioning:add") + @Log(title = "请购单", businessType = BusinessType.INSERT) + @PostMapping("/add") + @ResponseBody + public AjaxResult addSave(BaseRequisitioningOrder baseRequisitioningOrder) + { + return toAjax(baseRequisitioningOrderService.insertBaseRequisitioningOrder(baseRequisitioningOrder)); + } + + /** + * 修改请购单 + */ + @GetMapping("/edit/{requisitioningId}") + public String edit(@PathVariable("requisitioningId") Long requisitioningId, ModelMap mmap) + { + BaseRequisitioningOrder baseRequisitioningOrder = baseRequisitioningOrderService.selectBaseRequisitioningOrderById(requisitioningId); + mmap.put("baseRequisitioningOrder", baseRequisitioningOrder); + return prefix + "/edit"; + } + + /** + * 修改保存请购单 + */ + @RequiresPermissions("system:requisitioning:edit") + @Log(title = "请购单", businessType = BusinessType.UPDATE) + @PostMapping("/edit") + @ResponseBody + public AjaxResult editSave(BaseRequisitioningOrder baseRequisitioningOrder) + { + return toAjax(baseRequisitioningOrderService.updateBaseRequisitioningOrder(baseRequisitioningOrder)); + } + + /** + * 删除请购单 + */ + @RequiresPermissions("system:requisitioning:remove") + @Log(title = "请购单", businessType = BusinessType.DELETE) + @PostMapping( "/remove") + @ResponseBody + public AjaxResult remove(String ids) + { + return toAjax(baseRequisitioningOrderService.deleteBaseRequisitioningOrderByIds(ids)); + } + + /** + * 作废请购单 + */ + @RequiresPermissions("system:requisitioning:cancel") + @Log(title = "请购单", businessType = BusinessType.CANCEL) + @GetMapping( "/cancel/{id}") + @ResponseBody + public AjaxResult cancel(@PathVariable("id") Long id){ + return toAjax(baseRequisitioningOrderService.cancelBaseRequisitioningOrderById(id)); + } + + /** + * 恢复请购单 + */ + @RequiresPermissions("system:requisitioning:restore") + @Log(title = "请购单", businessType = BusinessType.RESTORE) + @GetMapping( "/restore/{id}") + @ResponseBody + public AjaxResult restore(@PathVariable("id")Long id) + { + return toAjax(baseRequisitioningOrderService.restoreBaseRequisitioningOrderById(id)); + } + + +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/domain/BaseRequisitioningOrder.java b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/BaseRequisitioningOrder.java new file mode 100644 index 00000000..6def6612 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/BaseRequisitioningOrder.java @@ -0,0 +1,184 @@ +package com.ruoyi.system.domain; + +import java.math.BigDecimal; +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; + +/** + * 请购单对象 base_requisitioning_order + * + * @author zhang + * @date 2024-05-13 + */ +public class BaseRequisitioningOrder extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 请购单索引id */ + @Excel(name = "请购单索引id") + private Long requisitioningId; + + /** 审核状态 */ + @Excel(name = "审核状态") + private String auditStatus; + + /** 请购状态 */ + @Excel(name = "请购状态") + private String requisitioningStatus; + + /** 请购单编号 */ + @Excel(name = "请购单编号") + private String requisitioningCode; + + /** 关联单号 */ + @Excel(name = "关联单号") + private String correlationCode; + + /** 物料合计 */ + @Excel(name = "物料合计") + private Long materialAmount; + + /** 数量总计 */ + @Excel(name = "数量总计") + private Long materialSum; + + /** 不含税总价(RMB) */ + @Excel(name = "不含税总价(RMB)") + private BigDecimal noRmbSum; + + /** 含税总价合计(RMB) */ + @Excel(name = "含税总价合计(RMB)") + private BigDecimal rmbSum; + + /** 申请人 */ + @Excel(name = "申请人") + private String applyUser; + + /** 使用状态 */ + private String useStatus; + + public void setRequisitioningId(Long requisitioningId) + { + this.requisitioningId = requisitioningId; + } + + public Long getRequisitioningId() + { + return requisitioningId; + } + public void setAuditStatus(String auditStatus) + { + this.auditStatus = auditStatus; + } + + public String getAuditStatus() + { + return auditStatus; + } + public void setRequisitioningStatus(String requisitioningStatus) + { + this.requisitioningStatus = requisitioningStatus; + } + + public String getRequisitioningStatus() + { + return requisitioningStatus; + } + public void setRequisitioningCode(String requisitioningCode) + { + this.requisitioningCode = requisitioningCode; + } + + public String getRequisitioningCode() + { + return requisitioningCode; + } + public void setCorrelationCode(String correlationCode) + { + this.correlationCode = correlationCode; + } + + public String getCorrelationCode() + { + return correlationCode; + } + public void setMaterialAmount(Long materialAmount) + { + this.materialAmount = materialAmount; + } + + public Long getMaterialAmount() + { + return materialAmount; + } + public void setMaterialSum(Long materialSum) + { + this.materialSum = materialSum; + } + + public Long getMaterialSum() + { + return materialSum; + } + public void setNoRmbSum(BigDecimal noRmbSum) + { + this.noRmbSum = noRmbSum; + } + + public BigDecimal getNoRmbSum() + { + return noRmbSum; + } + public void setRmbSum(BigDecimal rmbSum) + { + this.rmbSum = rmbSum; + } + + public BigDecimal getRmbSum() + { + return rmbSum; + } + public void setApplyUser(String applyUser) + { + this.applyUser = applyUser; + } + + public String getApplyUser() + { + return applyUser; + } + public void setUseStatus(String useStatus) + { + this.useStatus = useStatus; + } + + public String getUseStatus() + { + return useStatus; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("requisitioningId", getRequisitioningId()) + .append("auditStatus", getAuditStatus()) + .append("requisitioningStatus", getRequisitioningStatus()) + .append("requisitioningCode", getRequisitioningCode()) + .append("correlationCode", getCorrelationCode()) + .append("materialAmount", getMaterialAmount()) + .append("materialSum", getMaterialSum()) + .append("noRmbSum", getNoRmbSum()) + .append("rmbSum", getRmbSum()) + .append("applyUser", getApplyUser()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("remark", getRemark()) + .append("useStatus", getUseStatus()) + .toString(); + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/BaseRequisitioningOrderMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/BaseRequisitioningOrderMapper.java new file mode 100644 index 00000000..4b4f67cb --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/BaseRequisitioningOrderMapper.java @@ -0,0 +1,77 @@ +package com.ruoyi.system.mapper; + +import java.util.List; +import com.ruoyi.system.domain.BaseRequisitioningOrder; + +/** + * 请购单Mapper接口 + * + * @author zhang + * @date 2024-05-13 + */ +public interface BaseRequisitioningOrderMapper +{ + /** + * 查询请购单 + * + * @param requisitioningId 请购单ID + * @return 请购单 + */ + public BaseRequisitioningOrder selectBaseRequisitioningOrderById(Long requisitioningId); + + /** + * 查询请购单列表 + * + * @param baseRequisitioningOrder 请购单 + * @return 请购单集合 + */ + public List selectBaseRequisitioningOrderList(BaseRequisitioningOrder baseRequisitioningOrder); + + /** + * 新增请购单 + * + * @param baseRequisitioningOrder 请购单 + * @return 结果 + */ + public int insertBaseRequisitioningOrder(BaseRequisitioningOrder baseRequisitioningOrder); + + /** + * 修改请购单 + * + * @param baseRequisitioningOrder 请购单 + * @return 结果 + */ + public int updateBaseRequisitioningOrder(BaseRequisitioningOrder baseRequisitioningOrder); + + /** + * 删除请购单 + * + * @param requisitioningId 请购单ID + * @return 结果 + */ + public int deleteBaseRequisitioningOrderById(Long requisitioningId); + + /** + * 批量删除请购单 + * + * @param requisitioningIds 需要删除的数据ID + * @return 结果 + */ + public int deleteBaseRequisitioningOrderByIds(String[] requisitioningIds); + + /** + * 作废请购单 + * + * @param requisitioningId 请购单ID + * @return 结果 + */ + public int cancelBaseRequisitioningOrderById(Long requisitioningId); + + /** + * 恢复请购单 + * + * @param requisitioningId 请购单ID + * @return 结果 + */ + public int restoreBaseRequisitioningOrderById(Long requisitioningId); +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/IBaseRequisitioningOrderService.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/IBaseRequisitioningOrderService.java new file mode 100644 index 00000000..de5ed817 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/service/IBaseRequisitioningOrderService.java @@ -0,0 +1,75 @@ +package com.ruoyi.system.service; + +import java.util.List; +import com.ruoyi.system.domain.BaseRequisitioningOrder; + +/** + * 请购单Service接口 + * + * @author zhang + * @date 2024-05-13 + */ +public interface IBaseRequisitioningOrderService +{ + /** + * 查询请购单 + * + * @param requisitioningId 请购单ID + * @return 请购单 + */ + public BaseRequisitioningOrder selectBaseRequisitioningOrderById(Long requisitioningId); + + /** + * 查询请购单列表 + * + * @param baseRequisitioningOrder 请购单 + * @return 请购单集合 + */ + public List selectBaseRequisitioningOrderList(BaseRequisitioningOrder baseRequisitioningOrder); + + /** + * 新增请购单 + * + * @param baseRequisitioningOrder 请购单 + * @return 结果 + */ + public int insertBaseRequisitioningOrder(BaseRequisitioningOrder baseRequisitioningOrder); + + /** + * 修改请购单 + * + * @param baseRequisitioningOrder 请购单 + * @return 结果 + */ + public int updateBaseRequisitioningOrder(BaseRequisitioningOrder baseRequisitioningOrder); + + /** + * 批量删除请购单 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteBaseRequisitioningOrderByIds(String ids); + + /** + * 删除请购单信息 + * + * @param requisitioningId 请购单ID + * @return 结果 + */ + public int deleteBaseRequisitioningOrderById(Long requisitioningId); + + /** + * 作废请购单 + * @param requisitioningId 请购单ID + * @return + */ + int cancelBaseRequisitioningOrderById(Long requisitioningId); + + /** + * 恢复请购单 + * @param requisitioningId 请购单ID + * @return + */ + int restoreBaseRequisitioningOrderById(Long requisitioningId); +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/BaseRequisitioningOrderServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/BaseRequisitioningOrderServiceImpl.java new file mode 100644 index 00000000..b3a4bf95 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/BaseRequisitioningOrderServiceImpl.java @@ -0,0 +1,126 @@ +package com.ruoyi.system.service.impl; + +import java.util.List; +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.system.mapper.BaseRequisitioningOrderMapper; +import com.ruoyi.system.domain.BaseRequisitioningOrder; +import com.ruoyi.system.service.IBaseRequisitioningOrderService; +import com.ruoyi.common.core.text.Convert; + +/** + * 请购单Service业务层处理 + * + * @author zhang + * @date 2024-05-13 + */ +@Service +public class BaseRequisitioningOrderServiceImpl implements IBaseRequisitioningOrderService +{ + @Autowired + private BaseRequisitioningOrderMapper baseRequisitioningOrderMapper; + + /** + * 查询请购单 + * + * @param requisitioningId 请购单ID + * @return 请购单 + */ + @Override + public BaseRequisitioningOrder selectBaseRequisitioningOrderById(Long requisitioningId) + { + return baseRequisitioningOrderMapper.selectBaseRequisitioningOrderById(requisitioningId); + } + + /** + * 查询请购单列表 + * + * @param baseRequisitioningOrder 请购单 + * @return 请购单 + */ + @Override + public List selectBaseRequisitioningOrderList(BaseRequisitioningOrder baseRequisitioningOrder) + { + return baseRequisitioningOrderMapper.selectBaseRequisitioningOrderList(baseRequisitioningOrder); + } + + /** + * 新增请购单 + * + * @param baseRequisitioningOrder 请购单 + * @return 结果 + */ + @Override + public int insertBaseRequisitioningOrder(BaseRequisitioningOrder baseRequisitioningOrder) + { + String loginName = ShiroUtils.getLoginName(); + baseRequisitioningOrder.setCreateBy(loginName); + baseRequisitioningOrder.setCreateTime(DateUtils.getNowDate()); + return baseRequisitioningOrderMapper.insertBaseRequisitioningOrder(baseRequisitioningOrder); + } + + /** + * 修改请购单 + * + * @param baseRequisitioningOrder 请购单 + * @return 结果 + */ + @Override + public int updateBaseRequisitioningOrder(BaseRequisitioningOrder baseRequisitioningOrder) + { + String loginName = ShiroUtils.getLoginName(); + baseRequisitioningOrder.setUpdateBy(loginName); + baseRequisitioningOrder.setUpdateTime(DateUtils.getNowDate()); + return baseRequisitioningOrderMapper.updateBaseRequisitioningOrder(baseRequisitioningOrder); + } + + /** + * 删除请购单对象 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + @Override + public int deleteBaseRequisitioningOrderByIds(String ids) + { + return baseRequisitioningOrderMapper.deleteBaseRequisitioningOrderByIds(Convert.toStrArray(ids)); + } + + /** + * 删除请购单信息 + * + * @param requisitioningId 请购单ID + * @return 结果 + */ + @Override + public int deleteBaseRequisitioningOrderById(Long requisitioningId) + { + return baseRequisitioningOrderMapper.deleteBaseRequisitioningOrderById(requisitioningId); + } + + /** + * 作废请购单 + * + * @param requisitioningId 请购单ID + * @return 结果 + */ + @Override + public int cancelBaseRequisitioningOrderById(Long requisitioningId) + { + return baseRequisitioningOrderMapper.cancelBaseRequisitioningOrderById(requisitioningId); + } + + /** + * 恢复请购单信息 + * + * @param requisitioningId 请购单ID + * @return 结果 + */ + @Override + public int restoreBaseRequisitioningOrderById(Long requisitioningId) + { + return baseRequisitioningOrderMapper.restoreBaseRequisitioningOrderById(requisitioningId); + } +} diff --git a/ruoyi-admin/src/main/resources/mapper/system/BaseRequisitioningOrderMapper.xml b/ruoyi-admin/src/main/resources/mapper/system/BaseRequisitioningOrderMapper.xml new file mode 100644 index 00000000..a2101985 --- /dev/null +++ b/ruoyi-admin/src/main/resources/mapper/system/BaseRequisitioningOrderMapper.xml @@ -0,0 +1,143 @@ + + + + + + + + + + + + + + + + + + + + + + + + + select requisitioning_id, audit_status, requisitioning_status, requisitioning_code, + correlation_code, material_amount, materialSum, noRmbSum, rmbSum, apply_user, + create_by, create_time, update_by, update_time, remark, use_status + from base_requisitioning_order + + + + + + + + insert into base_requisitioning_order + + audit_status, + requisitioning_status, + requisitioning_code, + correlation_code, + material_amount, + materialSum, + noRmbSum, + rmbSum, + apply_user, + create_by, + create_time, + update_by, + update_time, + remark, + use_status, + + + #{auditStatus}, + #{requisitioningStatus}, + #{requisitioningCode}, + #{correlationCode}, + #{materialAmount}, + #{materialSum}, + #{noRmbSum}, + #{rmbSum}, + #{applyUser}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{remark}, + #{useStatus}, + + + + + update base_requisitioning_order + + audit_status = #{auditStatus}, + requisitioning_status = #{requisitioningStatus}, + requisitioning_code = #{requisitioningCode}, + correlation_code = #{correlationCode}, + material_amount = #{materialAmount}, + materialSum = #{materialSum}, + noRmbSum = #{noRmbSum}, + rmbSum = #{rmbSum}, + apply_user = #{applyUser}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + remark = #{remark}, + use_status = #{useStatus}, + + where requisitioning_id = #{requisitioningId} + + + + delete from base_requisitioning_order where requisitioning_id = #{requisitioningId} + + + + delete from base_requisitioning_order where requisitioning_id in + + #{requisitioningId} + + + + + update base_requisitioning_order set del_flag = '1' where requisitioning_id = #{requisitioningId} + + + + update base_requisitioning_order set del_flag = '0' where requisitioning_id = #{requisitioningId} + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/system/requisitioning/add.html b/ruoyi-admin/src/main/resources/templates/system/requisitioning/add.html new file mode 100644 index 00000000..29b89fd7 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/system/requisitioning/add.html @@ -0,0 +1,176 @@ + + + + + + +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+
+ 选择报价信息 + + 添加物料 + +
+
+
+
+
+
+
+
+
+ + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/system/requisitioning/edit.html b/ruoyi-admin/src/main/resources/templates/system/requisitioning/edit.html new file mode 100644 index 00000000..75eabdcb --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/system/requisitioning/edit.html @@ -0,0 +1,178 @@ + + + + + + +
+
+ + +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+
+ 选择报价信息 + + 添加物料 + +
+
+
+
+
+
+
+
+
+ + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/system/requisitioning/requisitioning.html b/ruoyi-admin/src/main/resources/templates/system/requisitioning/requisitioning.html new file mode 100644 index 00000000..d51b71af --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/system/requisitioning/requisitioning.html @@ -0,0 +1,125 @@ + + + + + + +
+
+
+
+
+
    +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • + + + - + +
  • +
  • +  搜索 +  重置 +
  • +
+
+
+
+ + +
+
+
+
+
+ + + + \ No newline at end of file