Browse Source

[update]基础资料模块:添加请购单,请购购单添加功能页面,添加修改单功能页面

dev
zhangsiqi 6 months ago
parent
commit
3237c8c65b
  1. 151
      ruoyi-admin/src/main/java/com/ruoyi/system/controller/BaseRequisitioningOrderController.java
  2. 184
      ruoyi-admin/src/main/java/com/ruoyi/system/domain/BaseRequisitioningOrder.java
  3. 77
      ruoyi-admin/src/main/java/com/ruoyi/system/mapper/BaseRequisitioningOrderMapper.java
  4. 75
      ruoyi-admin/src/main/java/com/ruoyi/system/service/IBaseRequisitioningOrderService.java
  5. 126
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/BaseRequisitioningOrderServiceImpl.java
  6. 143
      ruoyi-admin/src/main/resources/mapper/system/BaseRequisitioningOrderMapper.xml
  7. 176
      ruoyi-admin/src/main/resources/templates/system/requisitioning/add.html
  8. 178
      ruoyi-admin/src/main/resources/templates/system/requisitioning/edit.html
  9. 125
      ruoyi-admin/src/main/resources/templates/system/requisitioning/requisitioning.html

151
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<BaseRequisitioningOrder> 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<BaseRequisitioningOrder> list = baseRequisitioningOrderService.selectBaseRequisitioningOrderList(baseRequisitioningOrder);
ExcelUtil<BaseRequisitioningOrder> util = new ExcelUtil<BaseRequisitioningOrder>(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));
}
}

184
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();
}
}

77
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<BaseRequisitioningOrder> 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);
}

75
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<BaseRequisitioningOrder> 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);
}

126
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<BaseRequisitioningOrder> 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);
}
}

143
ruoyi-admin/src/main/resources/mapper/system/BaseRequisitioningOrderMapper.xml

@ -0,0 +1,143 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.system.mapper.BaseRequisitioningOrderMapper">
<resultMap type="BaseRequisitioningOrder" id="BaseRequisitioningOrderResult">
<result property="requisitioningId" column="requisitioning_id" />
<result property="auditStatus" column="audit_status" />
<result property="requisitioningStatus" column="requisitioning_status" />
<result property="requisitioningCode" column="requisitioning_code" />
<result property="correlationCode" column="correlation_code" />
<result property="materialAmount" column="material_amount" />
<result property="materialSum" column="materialSum" />
<result property="noRmbSum" column="noRmbSum" />
<result property="rmbSum" column="rmbSum" />
<result property="applyUser" column="apply_user" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
<result property="useStatus" column="use_status" />
</resultMap>
<sql id="selectBaseRequisitioningOrderVo">
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
</sql>
<select id="selectBaseRequisitioningOrderList" parameterType="BaseRequisitioningOrder" resultMap="BaseRequisitioningOrderResult">
<include refid="selectBaseRequisitioningOrderVo"/>
<where>
<if test="auditStatus != null and auditStatus != ''"> and audit_status = #{auditStatus}</if>
<if test="requisitioningStatus != null and requisitioningStatus != ''"> and requisitioning_status = #{requisitioningStatus}</if>
<if test="requisitioningCode != null and requisitioningCode != ''"> and requisitioning_code = #{requisitioningCode}</if>
<if test="createBy != null and createBy != ''"> and create_by = #{createBy}</if>
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''">
and create_time between #{params.beginCreateTime} and #{params.endCreateTime}
</if>
<if test="params.materialCode != null and params.materialCode != '' or params.materialName !=null and params.materialName != ''">
and requisitioning_code in (
select quote_id from base_requisitioning_order_child
<where>
<if test="params.materialCode != null and params.materialCode != ''">
and material_code = #{params,materialCode}
</if>
<if test="params.materialName != null and params.materialName != ''">
and material_name = #{params.materialName}
</if>
</where>
)
</if>
</where>
</select>
<select id="selectBaseRequisitioningOrderById" parameterType="Long" resultMap="BaseRequisitioningOrderResult">
<include refid="selectBaseRequisitioningOrderVo"/>
where requisitioning_id = #{requisitioningId}
</select>
<insert id="insertBaseRequisitioningOrder" parameterType="BaseRequisitioningOrder" useGeneratedKeys="true" keyProperty="requisitioningId">
insert into base_requisitioning_order
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="auditStatus != null">audit_status,</if>
<if test="requisitioningStatus != null">requisitioning_status,</if>
<if test="requisitioningCode != null">requisitioning_code,</if>
<if test="correlationCode != null">correlation_code,</if>
<if test="materialAmount != null">material_amount,</if>
<if test="materialSum != null">materialSum,</if>
<if test="noRmbSum != null">noRmbSum,</if>
<if test="rmbSum != null">rmbSum,</if>
<if test="applyUser != null">apply_user,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
<if test="useStatus != null">use_status,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="auditStatus != null">#{auditStatus},</if>
<if test="requisitioningStatus != null">#{requisitioningStatus},</if>
<if test="requisitioningCode != null">#{requisitioningCode},</if>
<if test="correlationCode != null">#{correlationCode},</if>
<if test="materialAmount != null">#{materialAmount},</if>
<if test="materialSum != null">#{materialSum},</if>
<if test="noRmbSum != null">#{noRmbSum},</if>
<if test="rmbSum != null">#{rmbSum},</if>
<if test="applyUser != null">#{applyUser},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
<if test="useStatus != null">#{useStatus},</if>
</trim>
</insert>
<update id="updateBaseRequisitioningOrder" parameterType="BaseRequisitioningOrder">
update base_requisitioning_order
<trim prefix="SET" suffixOverrides=",">
<if test="auditStatus != null">audit_status = #{auditStatus},</if>
<if test="requisitioningStatus != null">requisitioning_status = #{requisitioningStatus},</if>
<if test="requisitioningCode != null">requisitioning_code = #{requisitioningCode},</if>
<if test="correlationCode != null">correlation_code = #{correlationCode},</if>
<if test="materialAmount != null">material_amount = #{materialAmount},</if>
<if test="materialSum != null">materialSum = #{materialSum},</if>
<if test="noRmbSum != null">noRmbSum = #{noRmbSum},</if>
<if test="rmbSum != null">rmbSum = #{rmbSum},</if>
<if test="applyUser != null">apply_user = #{applyUser},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="useStatus != null">use_status = #{useStatus},</if>
</trim>
where requisitioning_id = #{requisitioningId}
</update>
<delete id="deleteBaseRequisitioningOrderById" parameterType="Long">
delete from base_requisitioning_order where requisitioning_id = #{requisitioningId}
</delete>
<delete id="deleteBaseRequisitioningOrderByIds" parameterType="String">
delete from base_requisitioning_order where requisitioning_id in
<foreach item="requisitioningId" collection="array" open="(" separator="," close=")">
#{requisitioningId}
</foreach>
</delete>
<update id="cancelBaseRequisitioningOrderById" parameterType="Long">
update base_requisitioning_order set del_flag = '1' where requisitioning_id = #{requisitioningId}
</update>
<update id="restoreBaseRequisitioningOrderById" parameterType="Long">
update base_requisitioning_order set del_flag = '0' where requisitioning_id = #{requisitioningId}
</update>
</mapper>

176
ruoyi-admin/src/main/resources/templates/system/requisitioning/add.html

@ -0,0 +1,176 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('新增请购单')" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-requisitioning-add">
<div class="form-group">
<label class="col-sm-3 control-label">部门:</label>
<div class="col-sm-8">
<select name="dept" class="form-control"></select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">岗位:</label>
<div class="col-sm-8">
<select name="" class="form-control"></select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">姓名:</label>
<div class="col-sm-8">
<select name="post" class="form-control"></select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">关联单号:</label>
<div class="col-sm-8">
<input name="correlationCode" class="form-control" type="text">
</div>
</div>
</form>
<div class="container">
<div class="form-row">
<div class="btn-group-sm" id="toolbar" role="group">
<span>选择报价信息</span>
<a class="btn btn-success" onclick="insertRow()">
<i class="fa fa-plus"></i> 添加物料
</a>
</div>
</div>
<div class="row">
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-sub-table-requisitionChild"></table>
</div>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var materialTypeDatas = [[${@category.getChildByCode('materialType')}]];
var auditStatusDatas = [[${@dict.getType('auditStatus')}]];
var sysUnitClassDatas = [[${@dict.getType('sys_unit_class')}]];
var processMethodDatas = [[${@dict.getType('processMethod')}]];
var prefix = ctx + "system/requisitioning";
$("#form-requisitioning-add").validate({focusCleanup: true});
//获取子表信息
$(function() {
var options = {
id:'bootstrap-sub-table-requisitionChild',
// url: ctx + "system/quoteChild/list",
pagination: false,
sidePagination: "client",
model: "物料报价信息",
columns: [
{checkbox: true},
{field: 'index',align: 'center', title: "序号",
formatter: function (value, row, index) {
var columnIndex = $.common.sprintf("<input type='hidden' name='index' value='%s'>", $.table.serialNumber(index));
return columnIndex + $.table.serialNumber(index);
}
},
{title: '物料索引id',field: 'materialId',align: 'center',visible: false},
{title: '料号',field: 'materialCode',align: 'center'},
{title: '物料名称',field: 'materialName',align: 'center'},
{title: '图片',field: 'photoUrl',
formatter: function(value, row, index) {
return $.table.imageView(value);
}
},
{title: '物料类型',field: 'materialType',align: 'center',
formatter: function(value, row, index) {
return $.table.selectCategoryLabel(materialTypeDatas, value);
}
},
{ title: '描述',field: 'describe',align: 'center'},
{title: '品牌',field: 'brand',align: 'center'},
{ title: '单位',field: 'unit',align: 'center',
formatter: function(value, row, index) {
return $.table.selectDictLabel(sysUnitClassDatas, value);
}
},
{title: '加工方式',field: 'processMethod',align: 'center',
formatter: function(value, row, index) {
return $.table.selectDictLabel(processMethodDatas, value);
}
},
{title: '物料的数量', field: 'materialNum',align: 'center',editable: true,},
{title: '物料的不含税单价(RMB)',field: 'materialNoRmb',align: 'center',},
{title: '物料的含税单价(RMB)',field: 'materialRmb',align: 'center',},
{title: '物料的含税总价(RMB)',field: 'materialNoRmbSum',align: 'center',},
{title: '物料的不含税总价(RMB)',field: 'materialRmbSum',align: 'center',},
{title: '录入人',field: 'createBy',align: 'center',visible: false},
{title: '录入时间',field: 'createTime',align: 'center',visible: false },
{title: '更新人',field: 'updateBy',align: 'center',visible: false},
{title: '上次更新时间',field: 'updateTime',align: 'center',visible: false},
{title: '备注',field: 'remark',align: 'center',editable: true},
{title: '操作', align: 'center',
formatter: function (value, row, index) {
var actions = [];
actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="removeRow(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a> ');
return actions.join('');
}
}
],
onEditableSave:function(field, row, oldValue, $el){
row.materialNoRmb = Number(row.materialNoRmb).toFixed(2);
row.materialRmb = Number(row.materialNoRmb * Number(1));
row.materialNoRmbSum = Number(row.materialNum * Number(row.materialNoRmb)).toFixed(2);
row.materialRmbSum = Number(row.materialRmb * row.materialNum).toFixed(2);
},
};
$.table.init(options);
});
function doSubmit(index, layero,uniqueId){
console.log(uniqueId);
var iframeWin = window[layero.find('iframe')[0]['name']];
var rowData = iframeWin.$('#bootstrap-select-table').bootstrapTable('getSelections')[0];
console.log("rowData: "+rowData);
$("#bootstrap-sub-table-requisitionChild").bootstrapTable('insertRow', {
index:1,
row: {
materialId:rowData.id,
materialCode: rowData.materialNo,
materialName: rowData.materialName,
materialType: rowData.materialType,
describe: rowData.describe,
brand: rowData.brand,
unit: rowData.unit,
processMethod: rowData.processMethod,
photoUrl: rowData.photoUrl,
materialNum: "",
materialRmb: "",
materialNoRmb: "",
materialNoRmbSum: "",
materialRmbSum: "",
remark: ""
}
})
layer.close(index);
}
function insertRow() {
var url = ctx + "erp/material/select";
var options = {
title: '选择料号',
url: url,
callBack: doSubmit
};
$.modal.openOptions(options);
}
/* 删除指定表格行 */
function removeRow(id){
$("#bootstrap-sub-table-requisitionChild").bootstrapTable('remove', {
field: 'id',
values: id
})
}
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/add", $('#form-requisitioning-add').serialize());
}
}
</script>
</body>
</html>

178
ruoyi-admin/src/main/resources/templates/system/requisitioning/edit.html

@ -0,0 +1,178 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('修改请购单')" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-requisitioning-edit" th:object="${baseRequisitioningOrder}">
<input name="requisitioningId" th:field="*{requisitioningId}" type="hidden">
<div class="form-group" hidden="hidden">
<label class="col-sm-3 control-label">请购单号:</label>
<div class="col-sm-8">
<input name="code" th:field="*{requisitioningCode}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">部门:</label>
<div class="col-sm-8">
<select name="dept" class="form-control"></select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">岗位:</label>
<div class="col-sm-8">
<select name="" class="form-control"></select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">姓名:</label>
<div class="col-sm-8">
<select name="post" class="form-control"></select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">关联单号:</label>
<div class="col-sm-8">
<input name="correlationCode" class="form-control" type="text">
</div>
</div>
</form>
<div class="container">
<div class="form-row">
<div class="btn-group-sm" id="toolbar" role="group">
<span>选择报价信息</span>
<a class="btn btn-success" onclick="insertRow()">
<i class="fa fa-plus"></i> 添加物料
</a>
</div>
</div>
<div class="row">
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-sub-table-requisitionChild"></table>
</div>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var prefix = ctx + "system/requisitioning";
$("#form-requisitioning-edit").validate({focusCleanup: true});
$(function() {
var options = {
id:'bootstrap-sub-table-requisitionChild',
// url: ctx + "system/quoteChild/list",
pagination: false,
sidePagination: "client",
model: "物料报价信息",
columns: [
{checkbox: true},
{field: 'index',align: 'center', title: "序号",
formatter: function (value, row, index) {
var columnIndex = $.common.sprintf("<input type='hidden' name='index' value='%s'>", $.table.serialNumber(index));
return columnIndex + $.table.serialNumber(index);
}
},
{title: '物料索引id',field: 'materialId',align: 'center',visible: false},
{title: '料号',field: 'materialCode',align: 'center'},
{title: '物料名称',field: 'materialName',align: 'center'},
{title: '图片',field: 'photoUrl',
formatter: function(value, row, index) {
return $.table.imageView(value);
}
},
{title: '物料类型',field: 'materialType',align: 'center',
formatter: function(value, row, index) {
return $.table.selectCategoryLabel(materialTypeDatas, value);
}
},
{ title: '描述',field: 'describe',align: 'center'},
{title: '品牌',field: 'brand',align: 'center'},
{ title: '单位',field: 'unit',align: 'center',
formatter: function(value, row, index) {
return $.table.selectDictLabel(sysUnitClassDatas, value);
}
},
{title: '加工方式',field: 'processMethod',align: 'center',
formatter: function(value, row, index) {
return $.table.selectDictLabel(processMethodDatas, value);
}
},
{title: '物料的数量', field: 'materialNum',align: 'center',editable: true,},
{title: '物料的不含税单价(RMB)',field: 'materialNoRmb',align: 'center',},
{title: '物料的含税单价(RMB)',field: 'materialRmb',align: 'center',},
{title: '物料的含税总价(RMB)',field: 'materialNoRmbSum',align: 'center',},
{title: '物料的不含税总价(RMB)',field: 'materialRmbSum',align: 'center',},
{title: '录入人',field: 'createBy',align: 'center',visible: false},
{title: '录入时间',field: 'createTime',align: 'center',visible: false },
{title: '更新人',field: 'updateBy',align: 'center',visible: false},
{title: '上次更新时间',field: 'updateTime',align: 'center',visible: false},
{title: '备注',field: 'remark',align: 'center'},
{title: '操作', align: 'center',
formatter: function (value, row, index) {
var actions = [];
actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="removeRow(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a> ');
return actions.join('');
}
}
],
onEditableSave:function(field, row, oldValue, $el){
row.materialNoRmb = Number(row.materialNoRmb).toFixed(2);
row.materialRmb = Number(row.materialNoRmb * Number(1));
row.materialNoRmbSum = Number(row.materialNum * Number(row.materialNoRmb)).toFixed(2);
row.materialRmbSum = Number(row.materialRmb * row.materialNum).toFixed(2);
},
};
$.table.init(options);
});
function doSubmit(index, layero,uniqueId){
console.log(uniqueId);
var iframeWin = window[layero.find('iframe')[0]['name']];
var rowData = iframeWin.$('#bootstrap-select-table').bootstrapTable('getSelections')[0];
console.log("rowData: "+rowData);
$("#bootstrap-sub-table-requisitionChild").bootstrapTable('insertRow', {
index:1,
row: {
materialId:rowData.id,
materialCode: rowData.materialNo,
materialName: rowData.materialName,
materialType: rowData.materialType,
describe: rowData.describe,
brand: rowData.brand,
unit: rowData.unit,
processMethod: rowData.processMethod,
photoUrl: rowData.photoUrl,
materialNum: "",
materialRmb: "",
materialNoRmb: "",
materialNoRmbSum: "",
materialRmbSum: "",
remark: ""
}
})
layer.close(index);
}
function insertRow() {
var url = ctx + "erp/material/select";
var options = {
title: '选择料号',
url: url,
callBack: doSubmit
};
$.modal.openOptions(options);
}
/* 删除指定表格行 */
function removeRow(id){
$("#bootstrap-sub-table-requisitionChild").bootstrapTable('remove', {
field: 'id',
values: id
})
}
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-requisitioning-edit').serialize());
}
}
</script>
</body>
</html>

125
ruoyi-admin/src/main/resources/templates/system/requisitioning/requisitioning.html

@ -0,0 +1,125 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<th:block th:include="include :: header('请购单列表')" />
</head>
<body class="gray-bg">
<div class="container-div">
<div class="row">
<div class="col-sm-12 search-collapse">
<form id="formId">
<div class="select-list">
<ul>
<li>
<label>请购单ID:</label>
<input type="text" name="requisitioningCode"/>
</li>
<li>
<label>料号:</label>
<input type="text" name="params[materialCode]"/>
</li>
<li>
<label>物料名称:</label>
<input type="text" name="params[materialName]"/>
</li>
<li>
<label>审核状态:</label>
<select name="auditStatus" th:with="type=${@dict.getType('auditStatus')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</li>
<li>
<label>请购状态:</label>
<select name="requisitioningStatus" th:with="type=${@dict.getType('sys_requisitioning_status')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</li>
<li>
<label>请购人:</label>
<input type="text" name="createBy"/>
</li>
<li class="select-time">
<label>录入时间: </label>
<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginTime]"/>
<span>-</span>
<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endTime]"/>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
</li>
</ul>
</div>
</form>
</div>
<div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:requisitioning:add">
<i class="fa fa-plus"></i> 添加
</a>
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table"></table>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('system:requisitioning:edit')}]];
var removeFlag = [[${@permission.hasPermi('system:requisitioning:remove')}]];
var cancelFlag = [[${@permission.hasPermi('system:requisitioning:cancel')}]];
var restoreFlag = [[${@permission.hasPermi('system:requisitioning:restore')}]];
var auditStatusDatas = [[${@dict.getType('auditStatus')}]];
var requisitioningStatusDatas = [[${@dict.getType('sys_requisitioning_status')}]];
var prefix = ctx + "system/requisitioning";
$(function() {
var options = {
url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
cancelUrl: prefix + "/cancel/{id}",
restoreUrl: prefix + "/restore/{id}",
exportUrl: prefix + "/export",
modalName: "请购单",
columns: [
{checkbox: true},
{title: '请购单索引id',field: 'requisitioningId',visible: false},
{title: '审核状态',field: 'auditStatus',
formatter: function(value, row, index) {
return $.table.selectDictLabel(auditStatusDatas, value);
}
},
{title: '请购状态',field: 'requisitioningStatus',
formatter: function(value, row, index) {
return $.table.selectDictLabel(requisitioningStatusDatas, value);
}
},
{title: '请购单编号',field: 'requisitioningCode',},
{title: '关联单号',field: 'correlationCode',},
{title: '物料合计',field: 'materialAmount',},
{title: '数量总计',field: 'materialSum',},
{title: '不含税总价(RMB)',field: 'noRmbSum',},
{title: '含税总价合计(RMB)',field: 'rmbSum',},
{title: '请购人',field: 'createBy',},
{title: '备注',field: 'remark',},
{title: '操作',align: 'center',
formatter: function(value, row, index) {
var actions = [];
// 编辑
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.requisitioningId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
// 详情
actions.push('<a class="btn btn-primary btn-xs" href="javascript:void(0)" onclick="$.operate.detail(\'' + row.requisitioningId + '\')"><i class="fa fa-eye"></i> 详情</a> ');
return actions.join('');
}
}
]
};
$.table.init(options);
});
</script>
</body>
</html>
Loading…
Cancel
Save