Browse Source

[add]采购管理:

新增采购计划
完成数据填充,页面展示,条件查询操作
dev
liuxiaoxu 7 months ago
parent
commit
f548b52d3f
  1. 151
      ruoyi-admin/src/main/java/com/ruoyi/purchase/controller/PurchasePlanController.java
  2. 222
      ruoyi-admin/src/main/java/com/ruoyi/purchase/domain/PurchasePlan.java
  3. 77
      ruoyi-admin/src/main/java/com/ruoyi/purchase/mapper/PurchasePlanMapper.java
  4. 75
      ruoyi-admin/src/main/java/com/ruoyi/purchase/service/IPurchasePlanService.java
  5. 126
      ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchasePlanServiceImpl.java
  6. 139
      ruoyi-admin/src/main/resources/mapper/purchase/PurchasePlanMapper.xml
  7. 118
      ruoyi-admin/src/main/resources/templates/purchase/plan/add.html
  8. 119
      ruoyi-admin/src/main/resources/templates/purchase/plan/edit.html
  9. 182
      ruoyi-admin/src/main/resources/templates/purchase/plan/plan.html

151
ruoyi-admin/src/main/java/com/ruoyi/purchase/controller/PurchasePlanController.java

@ -0,0 +1,151 @@
package com.ruoyi.purchase.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.purchase.domain.PurchasePlan;
import com.ruoyi.purchase.service.IPurchasePlanService;
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 刘晓旭
* @date 2024-04-15
*/
@Controller
@RequestMapping("/purchase/plan")
public class PurchasePlanController extends BaseController
{
private String prefix = "purchase/plan";
@Autowired
private IPurchasePlanService purchasePlanService;
@RequiresPermissions("purchase:plan:view")
@GetMapping()
public String plan()
{
return prefix + "/plan";
}
/**
* 查询采购计划单列表
*/
@RequiresPermissions("purchase:plan:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(PurchasePlan purchasePlan)
{
startPage();
List<PurchasePlan> list = purchasePlanService.selectPurchasePlanList(purchasePlan);
return getDataTable(list);
}
/**
* 导出采购计划单列表
*/
@RequiresPermissions("purchase:plan:export")
@Log(title = "采购计划单", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ResponseBody
public AjaxResult export(PurchasePlan purchasePlan)
{
List<PurchasePlan> list = purchasePlanService.selectPurchasePlanList(purchasePlan);
ExcelUtil<PurchasePlan> util = new ExcelUtil<PurchasePlan>(PurchasePlan.class);
return util.exportExcel(list, "采购计划单数据");
}
/**
* 新增采购计划单
*/
@GetMapping("/add")
public String add()
{
return prefix + "/add";
}
/**
* 新增保存采购计划单
*/
@RequiresPermissions("purchase:plan:add")
@Log(title = "采购计划单", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(PurchasePlan purchasePlan)
{
return toAjax(purchasePlanService.insertPurchasePlan(purchasePlan));
}
/**
* 修改采购计划单
*/
@GetMapping("/edit/{purchasePlanId}")
public String edit(@PathVariable("purchasePlanId") Long purchasePlanId, ModelMap mmap)
{
PurchasePlan purchasePlan = purchasePlanService.selectPurchasePlanById(purchasePlanId);
mmap.put("purchasePlan", purchasePlan);
return prefix + "/edit";
}
/**
* 修改保存采购计划单
*/
@RequiresPermissions("purchase:plan:edit")
@Log(title = "采购计划单", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(PurchasePlan purchasePlan)
{
return toAjax(purchasePlanService.updatePurchasePlan(purchasePlan));
}
/**
* 删除采购计划单
*/
@RequiresPermissions("purchase:plan:remove")
@Log(title = "采购计划单", businessType = BusinessType.DELETE)
@PostMapping( "/remove")
@ResponseBody
public AjaxResult remove(String ids)
{
return toAjax(purchasePlanService.deletePurchasePlanByIds(ids));
}
/**
* 作废采购计划单
*/
@RequiresPermissions("purchase:plan:cancel")
@Log(title = "采购计划单", businessType = BusinessType.CANCEL)
@GetMapping( "/cancel/{id}")
@ResponseBody
public AjaxResult cancel(@PathVariable("id") Long id){
return toAjax(purchasePlanService.cancelPurchasePlanById(id));
}
/**
* 恢复采购计划单
*/
@RequiresPermissions("purchase:plan:restore")
@Log(title = "采购计划单", businessType = BusinessType.RESTORE)
@GetMapping( "/restore/{id}")
@ResponseBody
public AjaxResult restore(@PathVariable("id")Long id)
{
return toAjax(purchasePlanService.restorePurchasePlanById(id));
}
}

222
ruoyi-admin/src/main/java/com/ruoyi/purchase/domain/PurchasePlan.java

@ -0,0 +1,222 @@
package com.ruoyi.purchase.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;
/**
* 采购计划单对象 purchase_plan
*
* @author 刘晓旭
* @date 2024-04-15
*/
public class PurchasePlan extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 采购计划索引id */
private Long purchasePlanId;
/** 采购计划单号 */
@Excel(name = "采购计划单号")
private String purchasePlanCode;
/** 采购计划状态 */
@Excel(name = "采购计划状态")
private String purchasePlanStatus;
/** 关联单号 */
@Excel(name = "关联单号")
private String correlationCode;
/** 采购来源 */
@Excel(name = "采购来源")
private String purchasePlanType;
/** 物料合计 */
@Excel(name = "物料合计")
private Long materialAmount;
/** 数量总计 */
@Excel(name = "数量总计")
private Long materialSum;
/** 不含税总价(RMB) */
@Excel(name = "不含税总价(RMB)")
private Long noRmbSum;
/** 含税总价(RMB) */
@Excel(name = "含税总价(RMB)")
private Long rmbSum;
/** 申请人 */
@Excel(name = "申请人")
private String applyUser;
/** 录入时间 */
@Excel(name = "录入时间")
private String firstAddTime;
/** 修改时间 */
@Excel(name = "修改时间")
private String updateInfoTime;
/** 审核状态 */
private String auditStatus;
/** 使用状态 */
private String useStatus;
public void setPurchasePlanId(Long purchasePlanId)
{
this.purchasePlanId = purchasePlanId;
}
public Long getPurchasePlanId()
{
return purchasePlanId;
}
public void setPurchasePlanCode(String purchasePlanCode)
{
this.purchasePlanCode = purchasePlanCode;
}
public String getPurchasePlanCode()
{
return purchasePlanCode;
}
public void setPurchasePlanStatus(String purchasePlanStatus)
{
this.purchasePlanStatus = purchasePlanStatus;
}
public String getPurchasePlanStatus()
{
return purchasePlanStatus;
}
public void setCorrelationCode(String correlationCode)
{
this.correlationCode = correlationCode;
}
public String getCorrelationCode()
{
return correlationCode;
}
public void setPurchasePlanType(String purchasePlanType)
{
this.purchasePlanType = purchasePlanType;
}
public String getPurchasePlanType()
{
return purchasePlanType;
}
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(Long noRmbSum)
{
this.noRmbSum = noRmbSum;
}
public Long getNoRmbSum()
{
return noRmbSum;
}
public void setRmbSum(Long rmbSum)
{
this.rmbSum = rmbSum;
}
public Long getRmbSum()
{
return rmbSum;
}
public void setApplyUser(String applyUser)
{
this.applyUser = applyUser;
}
public String getApplyUser()
{
return applyUser;
}
public void setFirstAddTime(String firstAddTime)
{
this.firstAddTime = firstAddTime;
}
public String getFirstAddTime()
{
return firstAddTime;
}
public void setUpdateInfoTime(String updateInfoTime)
{
this.updateInfoTime = updateInfoTime;
}
public String getUpdateInfoTime()
{
return updateInfoTime;
}
public void setAuditStatus(String auditStatus)
{
this.auditStatus = auditStatus;
}
public String getAuditStatus()
{
return auditStatus;
}
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("purchasePlanId", getPurchasePlanId())
.append("purchasePlanCode", getPurchasePlanCode())
.append("purchasePlanStatus", getPurchasePlanStatus())
.append("correlationCode", getCorrelationCode())
.append("purchasePlanType", getPurchasePlanType())
.append("materialAmount", getMaterialAmount())
.append("materialSum", getMaterialSum())
.append("noRmbSum", getNoRmbSum())
.append("rmbSum", getRmbSum())
.append("applyUser", getApplyUser())
.append("firstAddTime", getFirstAddTime())
.append("updateInfoTime", getUpdateInfoTime())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("auditStatus", getAuditStatus())
.append("useStatus", getUseStatus())
.append("remark", getRemark())
.toString();
}
}

77
ruoyi-admin/src/main/java/com/ruoyi/purchase/mapper/PurchasePlanMapper.java

@ -0,0 +1,77 @@
package com.ruoyi.purchase.mapper;
import java.util.List;
import com.ruoyi.purchase.domain.PurchasePlan;
/**
* 采购计划单Mapper接口
*
* @author 刘晓旭
* @date 2024-04-15
*/
public interface PurchasePlanMapper
{
/**
* 查询采购计划单
*
* @param purchasePlanId 采购计划单ID
* @return 采购计划单
*/
public PurchasePlan selectPurchasePlanById(Long purchasePlanId);
/**
* 查询采购计划单列表
*
* @param purchasePlan 采购计划单
* @return 采购计划单集合
*/
public List<PurchasePlan> selectPurchasePlanList(PurchasePlan purchasePlan);
/**
* 新增采购计划单
*
* @param purchasePlan 采购计划单
* @return 结果
*/
public int insertPurchasePlan(PurchasePlan purchasePlan);
/**
* 修改采购计划单
*
* @param purchasePlan 采购计划单
* @return 结果
*/
public int updatePurchasePlan(PurchasePlan purchasePlan);
/**
* 删除采购计划单
*
* @param purchasePlanId 采购计划单ID
* @return 结果
*/
public int deletePurchasePlanById(Long purchasePlanId);
/**
* 批量删除采购计划单
*
* @param purchasePlanIds 需要删除的数据ID
* @return 结果
*/
public int deletePurchasePlanByIds(String[] purchasePlanIds);
/**
* 作废采购计划单
*
* @param purchasePlanId 采购计划单ID
* @return 结果
*/
public int cancelPurchasePlanById(Long purchasePlanId);
/**
* 恢复采购计划单
*
* @param purchasePlanId 采购计划单ID
* @return 结果
*/
public int restorePurchasePlanById(Long purchasePlanId);
}

75
ruoyi-admin/src/main/java/com/ruoyi/purchase/service/IPurchasePlanService.java

@ -0,0 +1,75 @@
package com.ruoyi.purchase.service;
import java.util.List;
import com.ruoyi.purchase.domain.PurchasePlan;
/**
* 采购计划单Service接口
*
* @author 刘晓旭
* @date 2024-04-15
*/
public interface IPurchasePlanService
{
/**
* 查询采购计划单
*
* @param purchasePlanId 采购计划单ID
* @return 采购计划单
*/
public PurchasePlan selectPurchasePlanById(Long purchasePlanId);
/**
* 查询采购计划单列表
*
* @param purchasePlan 采购计划单
* @return 采购计划单集合
*/
public List<PurchasePlan> selectPurchasePlanList(PurchasePlan purchasePlan);
/**
* 新增采购计划单
*
* @param purchasePlan 采购计划单
* @return 结果
*/
public int insertPurchasePlan(PurchasePlan purchasePlan);
/**
* 修改采购计划单
*
* @param purchasePlan 采购计划单
* @return 结果
*/
public int updatePurchasePlan(PurchasePlan purchasePlan);
/**
* 批量删除采购计划单
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deletePurchasePlanByIds(String ids);
/**
* 删除采购计划单信息
*
* @param purchasePlanId 采购计划单ID
* @return 结果
*/
public int deletePurchasePlanById(Long purchasePlanId);
/**
* 作废采购计划单
* @param purchasePlanId 采购计划单ID
* @return
*/
int cancelPurchasePlanById(Long purchasePlanId);
/**
* 恢复采购计划单
* @param purchasePlanId 采购计划单ID
* @return
*/
int restorePurchasePlanById(Long purchasePlanId);
}

126
ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchasePlanServiceImpl.java

@ -0,0 +1,126 @@
package com.ruoyi.purchase.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.purchase.mapper.PurchasePlanMapper;
import com.ruoyi.purchase.domain.PurchasePlan;
import com.ruoyi.purchase.service.IPurchasePlanService;
import com.ruoyi.common.core.text.Convert;
/**
* 采购计划单Service业务层处理
*
* @author 刘晓旭
* @date 2024-04-15
*/
@Service
public class PurchasePlanServiceImpl implements IPurchasePlanService
{
@Autowired
private PurchasePlanMapper purchasePlanMapper;
/**
* 查询采购计划单
*
* @param purchasePlanId 采购计划单ID
* @return 采购计划单
*/
@Override
public PurchasePlan selectPurchasePlanById(Long purchasePlanId)
{
return purchasePlanMapper.selectPurchasePlanById(purchasePlanId);
}
/**
* 查询采购计划单列表
*
* @param purchasePlan 采购计划单
* @return 采购计划单
*/
@Override
public List<PurchasePlan> selectPurchasePlanList(PurchasePlan purchasePlan)
{
return purchasePlanMapper.selectPurchasePlanList(purchasePlan);
}
/**
* 新增采购计划单
*
* @param purchasePlan 采购计划单
* @return 结果
*/
@Override
public int insertPurchasePlan(PurchasePlan purchasePlan)
{
String loginName = ShiroUtils.getLoginName();
purchasePlan.setCreateBy(loginName);
purchasePlan.setCreateTime(DateUtils.getNowDate());
return purchasePlanMapper.insertPurchasePlan(purchasePlan);
}
/**
* 修改采购计划单
*
* @param purchasePlan 采购计划单
* @return 结果
*/
@Override
public int updatePurchasePlan(PurchasePlan purchasePlan)
{
String loginName = ShiroUtils.getLoginName();
purchasePlan.setUpdateBy(loginName);
purchasePlan.setUpdateTime(DateUtils.getNowDate());
return purchasePlanMapper.updatePurchasePlan(purchasePlan);
}
/**
* 删除采购计划单对象
*
* @param ids 需要删除的数据ID
* @return 结果
*/
@Override
public int deletePurchasePlanByIds(String ids)
{
return purchasePlanMapper.deletePurchasePlanByIds(Convert.toStrArray(ids));
}
/**
* 删除采购计划单信息
*
* @param purchasePlanId 采购计划单ID
* @return 结果
*/
@Override
public int deletePurchasePlanById(Long purchasePlanId)
{
return purchasePlanMapper.deletePurchasePlanById(purchasePlanId);
}
/**
* 作废采购计划单
*
* @param purchasePlanId 采购计划单ID
* @return 结果
*/
@Override
public int cancelPurchasePlanById(Long purchasePlanId)
{
return purchasePlanMapper.cancelPurchasePlanById(purchasePlanId);
}
/**
* 恢复采购计划单信息
*
* @param purchasePlanId 采购计划单ID
* @return 结果
*/
@Override
public int restorePurchasePlanById(Long purchasePlanId)
{
return purchasePlanMapper.restorePurchasePlanById(purchasePlanId);
}
}

139
ruoyi-admin/src/main/resources/mapper/purchase/PurchasePlanMapper.xml

@ -0,0 +1,139 @@
<?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.purchase.mapper.PurchasePlanMapper">
<resultMap type="PurchasePlan" id="PurchasePlanResult">
<result property="purchasePlanId" column="purchase_plan_id" />
<result property="purchasePlanCode" column="purchase_plan_code" />
<result property="purchasePlanStatus" column="purchase_plan_status" />
<result property="correlationCode" column="correlation_code" />
<result property="purchasePlanType" column="purchase_plan_type" />
<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="firstAddTime" column="first_add_time" />
<result property="updateInfoTime" column="update_info_time" />
<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="auditStatus" column="audit_status" />
<result property="useStatus" column="use_status" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectPurchasePlanVo">
select purchase_plan_id, purchase_plan_code, purchase_plan_status, correlation_code, purchase_plan_type, material_amount, materialSum, noRmbSum, rmbSum, apply_user, first_add_time, update_info_time, create_by, create_time, update_by, update_time, audit_status, use_status, remark from purchase_plan
</sql>
<select id="selectPurchasePlanList" parameterType="PurchasePlan" resultMap="PurchasePlanResult">
<include refid="selectPurchasePlanVo"/>
<where>
<if test="purchasePlanCode != null and purchasePlanCode != ''"> and purchase_plan_code = #{purchasePlanCode}</if>
<if test="purchasePlanStatus != null and purchasePlanStatus != ''"> and purchase_plan_status = #{purchasePlanStatus}</if>
<if test="correlationCode != null and correlationCode != ''"> and correlation_code = #{correlationCode}</if>
<if test="applyUser != null and applyUser != ''"> and apply_user like concat('%', #{applyUser}, '%')</if>
<if test="firstAddTime != null and firstAddTime != ''"> and first_add_time = #{firstAddTime}</if>
<if test="updateInfoTime != null and updateInfoTime != ''"> and update_info_time = #{updateInfoTime}</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>
</where>
</select>
<select id="selectPurchasePlanById" parameterType="Long" resultMap="PurchasePlanResult">
<include refid="selectPurchasePlanVo"/>
where purchase_plan_id = #{purchasePlanId}
</select>
<insert id="insertPurchasePlan" parameterType="PurchasePlan" useGeneratedKeys="true" keyProperty="purchasePlanId">
insert into purchase_plan
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="purchasePlanCode != null">purchase_plan_code,</if>
<if test="purchasePlanStatus != null">purchase_plan_status,</if>
<if test="correlationCode != null">correlation_code,</if>
<if test="purchasePlanType != null">purchase_plan_type,</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="firstAddTime != null">first_add_time,</if>
<if test="updateInfoTime != null">update_info_time,</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="auditStatus != null">audit_status,</if>
<if test="useStatus != null">use_status,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="purchasePlanCode != null">#{purchasePlanCode},</if>
<if test="purchasePlanStatus != null">#{purchasePlanStatus},</if>
<if test="correlationCode != null">#{correlationCode},</if>
<if test="purchasePlanType != null">#{purchasePlanType},</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="firstAddTime != null">#{firstAddTime},</if>
<if test="updateInfoTime != null">#{updateInfoTime},</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="auditStatus != null">#{auditStatus},</if>
<if test="useStatus != null">#{useStatus},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updatePurchasePlan" parameterType="PurchasePlan">
update purchase_plan
<trim prefix="SET" suffixOverrides=",">
<if test="purchasePlanCode != null">purchase_plan_code = #{purchasePlanCode},</if>
<if test="purchasePlanStatus != null">purchase_plan_status = #{purchasePlanStatus},</if>
<if test="correlationCode != null">correlation_code = #{correlationCode},</if>
<if test="purchasePlanType != null">purchase_plan_type = #{purchasePlanType},</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="firstAddTime != null">first_add_time = #{firstAddTime},</if>
<if test="updateInfoTime != null">update_info_time = #{updateInfoTime},</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="auditStatus != null">audit_status = #{auditStatus},</if>
<if test="useStatus != null">use_status = #{useStatus},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where purchase_plan_id = #{purchasePlanId}
</update>
<delete id="deletePurchasePlanById" parameterType="Long">
delete from purchase_plan where purchase_plan_id = #{purchasePlanId}
</delete>
<delete id="deletePurchasePlanByIds" parameterType="String">
delete from purchase_plan where purchase_plan_id in
<foreach item="purchasePlanId" collection="array" open="(" separator="," close=")">
#{purchasePlanId}
</foreach>
</delete>
<update id="cancelPurchasePlanById" parameterType="Long">
update purchase_plan set del_flag = '1' where purchase_plan_id = #{purchasePlanId}
</update>
<update id="restorePurchasePlanById" parameterType="Long">
update purchase_plan set del_flag = '0' where purchase_plan_id = #{purchasePlanId}
</update>
</mapper>

118
ruoyi-admin/src/main/resources/templates/purchase/plan/add.html

@ -0,0 +1,118 @@
<!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-plan-add">
<div class="form-group">
<label class="col-sm-3 control-label">采购计划单号:</label>
<div class="col-sm-8">
<input name="purchasePlanCode" 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="purchasePlanStatus" class="form-control m-b" th:with="type=${@dict.getType('purchase_plan_status')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</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>
<div class="form-group">
<label class="col-sm-3 control-label">采购来源:</label>
<div class="col-sm-8">
<select name="purchasePlanType" class="form-control m-b">
<option value="">所有</option>
</select>
<span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">物料合计:</label>
<div class="col-sm-8">
<input name="materialAmount" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">数量总计:</label>
<div class="col-sm-8">
<input name="materialSum" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">不含税总价(RMB):</label>
<div class="col-sm-8">
<input name="noRmbSum" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">含税总价(RMB):</label>
<div class="col-sm-8">
<input name="rmbSum" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">申请人:</label>
<div class="col-sm-8">
<input name="applyUser" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">录入时间:</label>
<div class="col-sm-8">
<input name="firstAddTime" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">修改时间:</label>
<div class="col-sm-8">
<input name="updateInfoTime" 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="auditStatus" class="form-control m-b" th:with="type=${@dict.getType('auditStatus')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">使用状态:</label>
<div class="col-sm-8">
<select name="useStatus" class="form-control m-b" th:with="type=${@dict.getType('useStatus')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">备注:</label>
<div class="col-sm-8">
<input name="remark" class="form-control" type="text">
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var prefix = ctx + "purchase/plan"
$("#form-plan-add").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/add", $('#form-plan-add').serialize());
}
}
</script>
</body>
</html>

119
ruoyi-admin/src/main/resources/templates/purchase/plan/edit.html

@ -0,0 +1,119 @@
<!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-plan-edit" th:object="${purchasePlan}">
<input name="purchasePlanId" th:field="*{purchasePlanId}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">采购计划单号:</label>
<div class="col-sm-8">
<input name="purchasePlanCode" th:field="*{purchasePlanCode}" 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="purchasePlanStatus" class="form-control m-b" th:with="type=${@dict.getType('purchase_plan_status')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{purchasePlanStatus}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">关联单号:</label>
<div class="col-sm-8">
<input name="correlationCode" th:field="*{correlationCode}" 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="purchasePlanType" class="form-control m-b">
<option value="">所有</option>
</select>
<span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">物料合计:</label>
<div class="col-sm-8">
<input name="materialAmount" th:field="*{materialAmount}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">数量总计:</label>
<div class="col-sm-8">
<input name="materialSum" th:field="*{materialSum}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">不含税总价(RMB):</label>
<div class="col-sm-8">
<input name="noRmbSum" th:field="*{noRmbSum}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">含税总价(RMB):</label>
<div class="col-sm-8">
<input name="rmbSum" th:field="*{rmbSum}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">申请人:</label>
<div class="col-sm-8">
<input name="applyUser" th:field="*{applyUser}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">录入时间:</label>
<div class="col-sm-8">
<input name="firstAddTime" th:field="*{firstAddTime}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">修改时间:</label>
<div class="col-sm-8">
<input name="updateInfoTime" th:field="*{updateInfoTime}" 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="auditStatus" class="form-control m-b" th:with="type=${@dict.getType('auditStatus')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{auditStatus}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">使用状态:</label>
<div class="col-sm-8">
<select name="useStatus" class="form-control m-b" th:with="type=${@dict.getType('useStatus')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{useStatus}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">备注:</label>
<div class="col-sm-8">
<input name="remark" th:field="*{remark}" class="form-control" type="text">
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var prefix = ctx + "purchase/plan";
$("#form-plan-edit").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-plan-edit').serialize());
}
}
</script>
</body>
</html>

182
ruoyi-admin/src/main/resources/templates/purchase/plan/plan.html

@ -0,0 +1,182 @@
<!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>采购计划单号:</label>
<input type="text" name="purchasePlanCode"/>
</li>
<li>
<label>采购计划状态:</label>
<select name="purchasePlanStatus" th:with="type=${@dict.getType('purchase_plan_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="correlationCode"/>
</li>
<li>
<label>申请人:</label>
<input type="text" name="applyUser"/>
</li>
<li>
<label>录入时间:</label>
<input type="text" name="firstAddTime"/>
</li>
<li>
<label>修改时间:</label>
<input type="text" name="updateInfoTime"/>
</li>
<li class="select-time">
<label>录入时间:</label>
<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginCreateTime]"/>
<span>-</span>
<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endCreateTime]"/>
</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="purchase:plan:add">
<i class="fa fa-plus"></i> 添加
</a>
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="purchase:plan:edit">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="purchase:plan:remove">
<i class="fa fa-remove"></i> 删除
</a>
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="purchase:plan:export">
<i class="fa fa-download"></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('purchase:plan:edit')}]];
var removeFlag = [[${@permission.hasPermi('purchase:plan:remove')}]];
var cancelFlag = [[${@permission.hasPermi('purchase:plan:cancel')}]];
var restoreFlag = [[${@permission.hasPermi('purchase:plan:restore')}]];
var purchasePlanStatusDatas = [[${@dict.getType('purchase_plan_status')}]];
var auditStatusDatas = [[${@dict.getType('auditStatus')}]];
var useStatusDatas = [[${@dict.getType('useStatus')}]];
var prefix = ctx + "purchase/plan";
$(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: 'purchasePlanId',
visible: false
},
{
title: '采购计划单号',
field: 'purchasePlanCode',
},
{
title: '采购计划状态',
field: 'purchasePlanStatus',
formatter: function(value, row, index) {
return $.table.selectDictLabel(purchasePlanStatusDatas, value);
}
},
{
title: '关联单号',
field: 'correlationCode',
},
{
title: '采购来源',
field: 'purchasePlanType',
},
{
title: '物料合计',
field: 'materialAmount',
},
{
title: '数量总计',
field: 'materialSum',
},
{
title: '不含税总价(RMB)',
field: 'noRmbSum',
},
{
title: '含税总价(RMB)',
field: 'rmbSum',
},
{
title: '申请人',
field: 'applyUser',
},
{
title: '录入时间',
field: 'firstAddTime',
},
{
title: '修改时间',
field: 'updateInfoTime',
},
{
title: '录入时间',
field: 'createTime',
},
{
title: '更新人',
field: 'updateBy',
},
{
title: '上次更新时间',
field: 'updateTime',
},
{
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.purchasePlanId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.purchasePlanId + '\')"><i class="fa fa-remove"></i>删除</a> ');
if(row.delFlag == '0'){
actions.push('<a class="btn btn-danger btn-xs ' + cancelFlag + '" href="javascript:void(0)" onclick="$.operate.cancel(\'' + row.id + '\')"><i class="fa fa-remove"></i>作废</a> ');
}else{
actions.push('<a class="btn btn-success btn-xs ' + restoreFlag + '" href="javascript:void(0)" onclick="$.operate.restore(\'' + row.id + '\')"><i class="fa fa-window-restore"></i>恢复</a> ');
}
return actions.join('');
}
}]
};
$.table.init(options);
});
</script>
</body>
</html>
Loading…
Cancel
Save