Browse Source

[feat] 采购管理:新增采购单,采购子表信息采购子表添加采购报价集合作为采购单中供应商报价。

dev
zhangsiqi 5 months ago
parent
commit
784b1fdf41
  1. 151
      ruoyi-admin/src/main/java/com/ruoyi/purchase/controller/PurchaseOrderChildController.java
  2. 321
      ruoyi-admin/src/main/java/com/ruoyi/purchase/domain/PurchaseOrderChild.java
  3. 77
      ruoyi-admin/src/main/java/com/ruoyi/purchase/mapper/PurchaseOrderChildMapper.java
  4. 75
      ruoyi-admin/src/main/java/com/ruoyi/purchase/service/IPurchaseOrderChildService.java
  5. 126
      ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseOrderChildServiceImpl.java
  6. 161
      ruoyi-admin/src/main/resources/mapper/purchase/PurchaseOrderChildMapper.xml
  7. 160
      ruoyi-admin/src/main/resources/templates/purchase/purchaseOrderChild/add.html
  8. 153
      ruoyi-admin/src/main/resources/templates/purchase/purchaseOrderChild/edit.html
  9. 202
      ruoyi-admin/src/main/resources/templates/purchase/purchaseOrderChild/purchaseOrderChild.html

151
ruoyi-admin/src/main/java/com/ruoyi/purchase/controller/PurchaseOrderChildController.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.PurchaseOrderChild;
import com.ruoyi.purchase.service.IPurchaseOrderChildService;
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-06-19
*/
@Controller
@RequestMapping("/purchase/purchaseOrderChild")
public class PurchaseOrderChildController extends BaseController
{
private String prefix = "purchase/purchaseOrderChild";
@Autowired
private IPurchaseOrderChildService purchaseOrderChildService;
// @RequiresPermissions("purchase:purchaseOrderChild:view")
@GetMapping()
public String purchaseOrderChild()
{
return prefix + "/purchaseOrderChild";
}
/**
* 查询采购订单子表列表
*/
// @RequiresPermissions("purchase:purchaseOrderChild:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(PurchaseOrderChild purchaseOrderChild)
{
startPage();
List<PurchaseOrderChild> list = purchaseOrderChildService.selectPurchaseOrderChildList(purchaseOrderChild);
return getDataTable(list);
}
/**
* 导出采购订单子表列表
*/
// @RequiresPermissions("purchase:purchaseOrderChild:export")
@Log(title = "采购订单子表", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ResponseBody
public AjaxResult export(PurchaseOrderChild purchaseOrderChild)
{
List<PurchaseOrderChild> list = purchaseOrderChildService.selectPurchaseOrderChildList(purchaseOrderChild);
ExcelUtil<PurchaseOrderChild> util = new ExcelUtil<PurchaseOrderChild>(PurchaseOrderChild.class);
return util.exportExcel(list, "采购订单子表数据");
}
/**
* 新增采购订单子表
*/
@GetMapping("/add")
public String add()
{
return prefix + "/add";
}
/**
* 新增保存采购订单子表
*/
// @RequiresPermissions("purchase:purchaseOrderChild:add")
@Log(title = "采购订单子表", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(PurchaseOrderChild purchaseOrderChild)
{
return toAjax(purchaseOrderChildService.insertPurchaseOrderChild(purchaseOrderChild));
}
/**
* 修改采购订单子表
*/
@GetMapping("/edit/{purchaseOrderChildId}")
public String edit(@PathVariable("purchaseOrderChildId") Long purchaseOrderChildId, ModelMap mmap)
{
PurchaseOrderChild purchaseOrderChild = purchaseOrderChildService.selectPurchaseOrderChildById(purchaseOrderChildId);
mmap.put("purchaseOrderChild", purchaseOrderChild);
return prefix + "/edit";
}
/**
* 修改保存采购订单子表
*/
// @RequiresPermissions("purchase:purchaseOrderChild:edit")
@Log(title = "采购订单子表", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(PurchaseOrderChild purchaseOrderChild)
{
return toAjax(purchaseOrderChildService.updatePurchaseOrderChild(purchaseOrderChild));
}
/**
* 删除采购订单子表
*/
// @RequiresPermissions("purchase:purchaseOrderChild:remove")
@Log(title = "采购订单子表", businessType = BusinessType.DELETE)
@PostMapping( "/remove")
@ResponseBody
public AjaxResult remove(String ids)
{
return toAjax(purchaseOrderChildService.deletePurchaseOrderChildByIds(ids));
}
/**
* 作废采购订单子表
*/
// @RequiresPermissions("purchase:purchaseOrderChild:cancel")
@Log(title = "采购订单子表", businessType = BusinessType.CANCEL)
@GetMapping( "/cancel/{id}")
@ResponseBody
public AjaxResult cancel(@PathVariable("id") Long id){
return toAjax(purchaseOrderChildService.cancelPurchaseOrderChildById(id));
}
/**
* 恢复采购订单子表
*/
// @RequiresPermissions("purchase:purchaseOrderChild:restore")
@Log(title = "采购订单子表", businessType = BusinessType.RESTORE)
@GetMapping( "/restore/{id}")
@ResponseBody
public AjaxResult restore(@PathVariable("id")Long id)
{
return toAjax(purchaseOrderChildService.restorePurchaseOrderChildById(id));
}
}

321
ruoyi-admin/src/main/java/com/ruoyi/purchase/domain/PurchaseOrderChild.java

@ -0,0 +1,321 @@
package com.ruoyi.purchase.domain;
import java.math.BigDecimal;
import java.util.List;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
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_order_child
*
* @author zhang
* @date 2024-06-19
*/
public class PurchaseOrderChild extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 采购订单子表id */
private Long purchaseOrderChildId;
/** 关联采购订单号 */
@Excel(name = "关联采购订单号")
private String purchaseOrderCode;
/** 供应商代码 */
@Excel(name = "供应商代码")
private String supplierCode;
/** 供应商名称 */
@Excel(name = "供应商名称")
private String supplierName;
/** 物料料号 */
@Excel(name = "物料料号")
private String materialCode;
/** 物料名称 */
@Excel(name = "物料名称")
private String materialName;
/** 物料不含税单价 */
@Excel(name = "物料不含税单价")
private BigDecimal materialNormb;
/** 物料含税单价 */
@Excel(name = "物料含税单价")
private BigDecimal materialRmb;
/** 采购物料数量 */
@Excel(name = "采购物料数量")
private Long materialNum;
/** 物料合计 */
@Excel(name = "物料合计")
private Long materialAmount;
/** 数量合计 */
@Excel(name = "数量合计")
private Long materialSum;
/** 不含税总价(RMB) */
@Excel(name = "不含税总价(RMB)")
private BigDecimal materialNormbsum;
/** 含税总价(RMB) */
@Excel(name = "含税总价(RMB)")
private BigDecimal materialRmbsum;
/** 交货时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "交货时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date deliveryTime;
/** 收货状态 */
@Excel(name = "收货状态")
private String eceiptStatus;
/** 打款结案状态 */
@Excel(name = "打款结案状态")
private String paymentStatus;
/** 税率 */
@Excel(name = "税率")
private String taxRate;
/** 删除标志 */
private String delFlag;
/** 备用一 */
@Excel(name = "备用一")
private String standbyOne;
/** 备用二 */
@Excel(name = "备用二")
private String standbyTwo;
private List<PurchaseQuoteChild> purchaseQuoteChildList;
public List<PurchaseQuoteChild> getPurchaseQuoteChildList() {
return purchaseQuoteChildList;
}
public void setPurchaseQuoteChildList(List<PurchaseQuoteChild> purchaseQuoteChildList) {
this.purchaseQuoteChildList = purchaseQuoteChildList;
}
public void setPurchaseOrderChildId(Long purchaseOrderChildId)
{
this.purchaseOrderChildId = purchaseOrderChildId;
}
public Long getPurchaseOrderChildId()
{
return purchaseOrderChildId;
}
public void setPurchaseOrderCode(String purchaseOrderCode)
{
this.purchaseOrderCode = purchaseOrderCode;
}
public String getPurchaseOrderCode()
{
return purchaseOrderCode;
}
public void setSupplierCode(String supplierCode)
{
this.supplierCode = supplierCode;
}
public String getSupplierCode()
{
return supplierCode;
}
public void setSupplierName(String supplierName)
{
this.supplierName = supplierName;
}
public String getSupplierName()
{
return supplierName;
}
public void setMaterialCode(String materialCode)
{
this.materialCode = materialCode;
}
public String getMaterialCode()
{
return materialCode;
}
public void setMaterialName(String materialName)
{
this.materialName = materialName;
}
public String getMaterialName()
{
return materialName;
}
public void setMaterialNormb(BigDecimal materialNormb)
{
this.materialNormb = materialNormb;
}
public BigDecimal getMaterialNormb()
{
return materialNormb;
}
public void setMaterialRmb(BigDecimal materialRmb)
{
this.materialRmb = materialRmb;
}
public BigDecimal getMaterialRmb()
{
return materialRmb;
}
public void setMaterialNum(Long materialNum)
{
this.materialNum = materialNum;
}
public Long getMaterialNum()
{
return materialNum;
}
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 setMaterialNormbsum(BigDecimal materialNormbsum)
{
this.materialNormbsum = materialNormbsum;
}
public BigDecimal getMaterialNormbsum()
{
return materialNormbsum;
}
public void setMaterialRmbsum(BigDecimal materialRmbsum)
{
this.materialRmbsum = materialRmbsum;
}
public BigDecimal getMaterialRmbsum()
{
return materialRmbsum;
}
public void setDeliveryTime(Date deliveryTime)
{
this.deliveryTime = deliveryTime;
}
public Date getDeliveryTime()
{
return deliveryTime;
}
public void setEceiptStatus(String eceiptStatus)
{
this.eceiptStatus = eceiptStatus;
}
public String getEceiptStatus()
{
return eceiptStatus;
}
public void setPaymentStatus(String paymentStatus)
{
this.paymentStatus = paymentStatus;
}
public String getPaymentStatus()
{
return paymentStatus;
}
public void setTaxRate(String taxRate)
{
this.taxRate = taxRate;
}
public String getTaxRate()
{
return taxRate;
}
public void setDelFlag(String delFlag)
{
this.delFlag = delFlag;
}
public String getDelFlag()
{
return delFlag;
}
public void setStandbyOne(String standbyOne)
{
this.standbyOne = standbyOne;
}
public String getStandbyOne()
{
return standbyOne;
}
public void setStandbyTwo(String standbyTwo)
{
this.standbyTwo = standbyTwo;
}
public String getStandbyTwo()
{
return standbyTwo;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("purchaseOrderChildId", getPurchaseOrderChildId())
.append("purchaseOrderCode", getPurchaseOrderCode())
.append("supplierCode", getSupplierCode())
.append("supplierName", getSupplierName())
.append("materialCode", getMaterialCode())
.append("materialName", getMaterialName())
.append("materialNormb", getMaterialNormb())
.append("materialRmb", getMaterialRmb())
.append("materialNum", getMaterialNum())
.append("materialAmount", getMaterialAmount())
.append("materialSum", getMaterialSum())
.append("materialNormbsum", getMaterialNormbsum())
.append("materialRmbsum", getMaterialRmbsum())
.append("deliveryTime", getDeliveryTime())
.append("eceiptStatus", getEceiptStatus())
.append("paymentStatus", getPaymentStatus())
.append("taxRate", getTaxRate())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("delFlag", getDelFlag())
.append("standbyOne", getStandbyOne())
.append("standbyTwo", getStandbyTwo())
.toString();
}
}

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

@ -0,0 +1,77 @@
package com.ruoyi.purchase.mapper;
import java.util.List;
import com.ruoyi.purchase.domain.PurchaseOrderChild;
/**
* 采购订单子表Mapper接口
*
* @author zhang
* @date 2024-06-19
*/
public interface PurchaseOrderChildMapper
{
/**
* 查询采购订单子表
*
* @param purchaseOrderChildId 采购订单子表ID
* @return 采购订单子表
*/
public PurchaseOrderChild selectPurchaseOrderChildById(Long purchaseOrderChildId);
/**
* 查询采购订单子表列表
*
* @param purchaseOrderChild 采购订单子表
* @return 采购订单子表集合
*/
public List<PurchaseOrderChild> selectPurchaseOrderChildList(PurchaseOrderChild purchaseOrderChild);
/**
* 新增采购订单子表
*
* @param purchaseOrderChild 采购订单子表
* @return 结果
*/
public int insertPurchaseOrderChild(PurchaseOrderChild purchaseOrderChild);
/**
* 修改采购订单子表
*
* @param purchaseOrderChild 采购订单子表
* @return 结果
*/
public int updatePurchaseOrderChild(PurchaseOrderChild purchaseOrderChild);
/**
* 删除采购订单子表
*
* @param purchaseOrderChildId 采购订单子表ID
* @return 结果
*/
public int deletePurchaseOrderChildById(Long purchaseOrderChildId);
/**
* 批量删除采购订单子表
*
* @param purchaseOrderChildIds 需要删除的数据ID
* @return 结果
*/
public int deletePurchaseOrderChildByIds(String[] purchaseOrderChildIds);
/**
* 作废采购订单子表
*
* @param purchaseOrderChildId 采购订单子表ID
* @return 结果
*/
public int cancelPurchaseOrderChildById(Long purchaseOrderChildId);
/**
* 恢复采购订单子表
*
* @param purchaseOrderChildId 采购订单子表ID
* @return 结果
*/
public int restorePurchaseOrderChildById(Long purchaseOrderChildId);
}

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

@ -0,0 +1,75 @@
package com.ruoyi.purchase.service;
import java.util.List;
import com.ruoyi.purchase.domain.PurchaseOrderChild;
/**
* 采购订单子表Service接口
*
* @author zhang
* @date 2024-06-19
*/
public interface IPurchaseOrderChildService
{
/**
* 查询采购订单子表
*
* @param purchaseOrderChildId 采购订单子表ID
* @return 采购订单子表
*/
public PurchaseOrderChild selectPurchaseOrderChildById(Long purchaseOrderChildId);
/**
* 查询采购订单子表列表
*
* @param purchaseOrderChild 采购订单子表
* @return 采购订单子表集合
*/
public List<PurchaseOrderChild> selectPurchaseOrderChildList(PurchaseOrderChild purchaseOrderChild);
/**
* 新增采购订单子表
*
* @param purchaseOrderChild 采购订单子表
* @return 结果
*/
public int insertPurchaseOrderChild(PurchaseOrderChild purchaseOrderChild);
/**
* 修改采购订单子表
*
* @param purchaseOrderChild 采购订单子表
* @return 结果
*/
public int updatePurchaseOrderChild(PurchaseOrderChild purchaseOrderChild);
/**
* 批量删除采购订单子表
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deletePurchaseOrderChildByIds(String ids);
/**
* 删除采购订单子表信息
*
* @param purchaseOrderChildId 采购订单子表ID
* @return 结果
*/
public int deletePurchaseOrderChildById(Long purchaseOrderChildId);
/**
* 作废采购订单子表
* @param purchaseOrderChildId 采购订单子表ID
* @return
*/
int cancelPurchaseOrderChildById(Long purchaseOrderChildId);
/**
* 恢复采购订单子表
* @param purchaseOrderChildId 采购订单子表ID
* @return
*/
int restorePurchaseOrderChildById(Long purchaseOrderChildId);
}

126
ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseOrderChildServiceImpl.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.PurchaseOrderChildMapper;
import com.ruoyi.purchase.domain.PurchaseOrderChild;
import com.ruoyi.purchase.service.IPurchaseOrderChildService;
import com.ruoyi.common.core.text.Convert;
/**
* 采购订单子表Service业务层处理
*
* @author zhang
* @date 2024-06-19
*/
@Service
public class PurchaseOrderChildServiceImpl implements IPurchaseOrderChildService
{
@Autowired
private PurchaseOrderChildMapper purchaseOrderChildMapper;
/**
* 查询采购订单子表
*
* @param purchaseOrderChildId 采购订单子表ID
* @return 采购订单子表
*/
@Override
public PurchaseOrderChild selectPurchaseOrderChildById(Long purchaseOrderChildId)
{
return purchaseOrderChildMapper.selectPurchaseOrderChildById(purchaseOrderChildId);
}
/**
* 查询采购订单子表列表
*
* @param purchaseOrderChild 采购订单子表
* @return 采购订单子表
*/
@Override
public List<PurchaseOrderChild> selectPurchaseOrderChildList(PurchaseOrderChild purchaseOrderChild)
{
return purchaseOrderChildMapper.selectPurchaseOrderChildList(purchaseOrderChild);
}
/**
* 新增采购订单子表
*
* @param purchaseOrderChild 采购订单子表
* @return 结果
*/
@Override
public int insertPurchaseOrderChild(PurchaseOrderChild purchaseOrderChild)
{
String loginName = ShiroUtils.getLoginName();
purchaseOrderChild.setCreateBy(loginName);
purchaseOrderChild.setCreateTime(DateUtils.getNowDate());
return purchaseOrderChildMapper.insertPurchaseOrderChild(purchaseOrderChild);
}
/**
* 修改采购订单子表
*
* @param purchaseOrderChild 采购订单子表
* @return 结果
*/
@Override
public int updatePurchaseOrderChild(PurchaseOrderChild purchaseOrderChild)
{
String loginName = ShiroUtils.getLoginName();
purchaseOrderChild.setUpdateBy(loginName);
purchaseOrderChild.setUpdateTime(DateUtils.getNowDate());
return purchaseOrderChildMapper.updatePurchaseOrderChild(purchaseOrderChild);
}
/**
* 删除采购订单子表对象
*
* @param ids 需要删除的数据ID
* @return 结果
*/
@Override
public int deletePurchaseOrderChildByIds(String ids)
{
return purchaseOrderChildMapper.deletePurchaseOrderChildByIds(Convert.toStrArray(ids));
}
/**
* 删除采购订单子表信息
*
* @param purchaseOrderChildId 采购订单子表ID
* @return 结果
*/
@Override
public int deletePurchaseOrderChildById(Long purchaseOrderChildId)
{
return purchaseOrderChildMapper.deletePurchaseOrderChildById(purchaseOrderChildId);
}
/**
* 作废采购订单子表
*
* @param purchaseOrderChildId 采购订单子表ID
* @return 结果
*/
@Override
public int cancelPurchaseOrderChildById(Long purchaseOrderChildId)
{
return purchaseOrderChildMapper.cancelPurchaseOrderChildById(purchaseOrderChildId);
}
/**
* 恢复采购订单子表信息
*
* @param purchaseOrderChildId 采购订单子表ID
* @return 结果
*/
@Override
public int restorePurchaseOrderChildById(Long purchaseOrderChildId)
{
return purchaseOrderChildMapper.restorePurchaseOrderChildById(purchaseOrderChildId);
}
}

161
ruoyi-admin/src/main/resources/mapper/purchase/PurchaseOrderChildMapper.xml

@ -0,0 +1,161 @@
<?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.PurchaseOrderChildMapper">
<resultMap type="PurchaseOrderChild" id="PurchaseOrderChildResult">
<result property="purchaseOrderChildId" column="purchase_order_child_id" />
<result property="purchaseOrderCode" column="purchase_order_code" />
<result property="supplierCode" column="supplier_code" />
<result property="supplierName" column="supplier_name" />
<result property="materialCode" column="material_code" />
<result property="materialName" column="material_name" />
<result property="materialNormb" column="material_noRmb" />
<result property="materialRmb" column="material_rmb" />
<result property="materialNum" column="material_num" />
<result property="materialAmount" column="material_amount" />
<result property="materialSum" column="material_sum" />
<result property="materialNormbsum" column="material_noRmbSum" />
<result property="materialRmbsum" column="material_rmbSum" />
<result property="deliveryTime" column="delivery_time" />
<result property="eceiptStatus" column="eceipt_status" />
<result property="paymentStatus" column="payment_status" />
<result property="taxRate" column="tax_rate" />
<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="delFlag" column="del_flag" />
<result property="standbyOne" column="standby_one" />
<result property="standbyTwo" column="standby_two" />
</resultMap>
<sql id="selectPurchaseOrderChildVo">
select purchase_order_child_id, purchase_order_code, supplier_code, supplier_name, material_code, material_name, material_noRmb, material_rmb, material_num, material_amount, material_sum, material_noRmbSum, material_rmbSum, delivery_time, eceipt_status, payment_status, tax_rate, create_by, create_time, update_by, update_time, del_flag, standby_one, standby_two from purchase_order_child
</sql>
<select id="selectPurchaseOrderChildList" parameterType="PurchaseOrderChild" resultMap="PurchaseOrderChildResult">
<include refid="selectPurchaseOrderChildVo"/>
<where>
<if test="purchaseOrderCode != null and purchaseOrderCode != ''"> and purchase_order_code = #{purchaseOrderCode}</if>
<if test="supplierCode != null and supplierCode != ''"> and supplier_code = #{supplierCode}</if>
<if test="supplierName != null and supplierName != ''"> and supplier_name like concat('%', #{supplierName}, '%')</if>
<if test="materialCode != null and materialCode != ''"> and material_code = #{materialCode}</if>
<if test="materialName != null and materialName != ''"> and material_name like concat('%', #{materialName}, '%')</if>
<if test="deliveryTime != null "> and delivery_time = #{deliveryTime}</if>
<if test="eceiptStatus != null and eceiptStatus != ''"> and eceipt_status = #{eceiptStatus}</if>
<if test="paymentStatus != null and paymentStatus != ''"> and payment_status = #{paymentStatus}</if>
<if test="createBy != null and createBy != ''"> and create_by = #{createBy}</if>
</where>
</select>
<select id="selectPurchaseOrderChildById" parameterType="Long" resultMap="PurchaseOrderChildResult">
<include refid="selectPurchaseOrderChildVo"/>
where purchase_order_child_id = #{purchaseOrderChildId}
</select>
<insert id="insertPurchaseOrderChild" parameterType="PurchaseOrderChild" useGeneratedKeys="true" keyProperty="purchaseOrderChildId">
insert into purchase_order_child
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="purchaseOrderCode != null">purchase_order_code,</if>
<if test="supplierCode != null">supplier_code,</if>
<if test="supplierName != null">supplier_name,</if>
<if test="materialCode != null">material_code,</if>
<if test="materialName != null">material_name,</if>
<if test="materialNormb != null">material_noRmb,</if>
<if test="materialRmb != null">material_rmb,</if>
<if test="materialNum != null">material_num,</if>
<if test="materialAmount != null">material_amount,</if>
<if test="materialSum != null">material_sum,</if>
<if test="materialNormbsum != null">material_noRmbSum,</if>
<if test="materialRmbsum != null">material_rmbSum,</if>
<if test="deliveryTime != null">delivery_time,</if>
<if test="eceiptStatus != null">eceipt_status,</if>
<if test="paymentStatus != null">payment_status,</if>
<if test="taxRate != null">tax_rate,</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="delFlag != null">del_flag,</if>
<if test="standbyOne != null">standby_one,</if>
<if test="standbyTwo != null">standby_two,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="purchaseOrderCode != null">#{purchaseOrderCode},</if>
<if test="supplierCode != null">#{supplierCode},</if>
<if test="supplierName != null">#{supplierName},</if>
<if test="materialCode != null">#{materialCode},</if>
<if test="materialName != null">#{materialName},</if>
<if test="materialNormb != null">#{materialNormb},</if>
<if test="materialRmb != null">#{materialRmb},</if>
<if test="materialNum != null">#{materialNum},</if>
<if test="materialAmount != null">#{materialAmount},</if>
<if test="materialSum != null">#{materialSum},</if>
<if test="materialNormbsum != null">#{materialNormbsum},</if>
<if test="materialRmbsum != null">#{materialRmbsum},</if>
<if test="deliveryTime != null">#{deliveryTime},</if>
<if test="eceiptStatus != null">#{eceiptStatus},</if>
<if test="paymentStatus != null">#{paymentStatus},</if>
<if test="taxRate != null">#{taxRate},</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="delFlag != null">#{delFlag},</if>
<if test="standbyOne != null">#{standbyOne},</if>
<if test="standbyTwo != null">#{standbyTwo},</if>
</trim>
</insert>
<update id="updatePurchaseOrderChild" parameterType="PurchaseOrderChild">
update purchase_order_child
<trim prefix="SET" suffixOverrides=",">
<if test="purchaseOrderCode != null">purchase_order_code = #{purchaseOrderCode},</if>
<if test="supplierCode != null">supplier_code = #{supplierCode},</if>
<if test="supplierName != null">supplier_name = #{supplierName},</if>
<if test="materialCode != null">material_code = #{materialCode},</if>
<if test="materialName != null">material_name = #{materialName},</if>
<if test="materialNormb != null">material_noRmb = #{materialNormb},</if>
<if test="materialRmb != null">material_rmb = #{materialRmb},</if>
<if test="materialNum != null">material_num = #{materialNum},</if>
<if test="materialAmount != null">material_amount = #{materialAmount},</if>
<if test="materialSum != null">material_sum = #{materialSum},</if>
<if test="materialNormbsum != null">material_noRmbSum = #{materialNormbsum},</if>
<if test="materialRmbsum != null">material_rmbSum = #{materialRmbsum},</if>
<if test="deliveryTime != null">delivery_time = #{deliveryTime},</if>
<if test="eceiptStatus != null">eceipt_status = #{eceiptStatus},</if>
<if test="paymentStatus != null">payment_status = #{paymentStatus},</if>
<if test="taxRate != null">tax_rate = #{taxRate},</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="delFlag != null">del_flag = #{delFlag},</if>
<if test="standbyOne != null">standby_one = #{standbyOne},</if>
<if test="standbyTwo != null">standby_two = #{standbyTwo},</if>
</trim>
where purchase_order_child_id = #{purchaseOrderChildId}
</update>
<delete id="deletePurchaseOrderChildById" parameterType="Long">
delete from purchase_order_child where purchase_order_child_id = #{purchaseOrderChildId}
</delete>
<delete id="deletePurchaseOrderChildByIds" parameterType="String">
delete from purchase_order_child where purchase_order_child_id in
<foreach item="purchaseOrderChildId" collection="array" open="(" separator="," close=")">
#{purchaseOrderChildId}
</foreach>
</delete>
<update id="cancelPurchaseOrderChildById" parameterType="Long">
update purchase_order_child set del_flag = '1' where purchase_order_child_id = #{purchaseOrderChildId}
</update>
<update id="restorePurchaseOrderChildById" parameterType="Long">
update purchase_order_child set del_flag = '0' where purchase_order_child_id = #{purchaseOrderChildId}
</update>
</mapper>

160
ruoyi-admin/src/main/resources/templates/purchase/purchaseOrderChild/add.html

@ -0,0 +1,160 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('新增采购订单子表')" />
<th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-purchaseOrderChild-add">
<div class="form-group">
<label class="col-sm-3 control-label">关联采购订单号:</label>
<div class="col-sm-8">
<input name="purchaseOrderCode" 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="supplierCode" 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="supplierName" 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="materialCode" 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="materialName" 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="materialNormb" 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="materialRmb" 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="materialNum" 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="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="materialNormbsum" 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="materialRmbsum" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">交货时间:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="deliveryTime" class="form-control" placeholder="yyyy-MM-dd" type="text">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">收货状态:</label>
<div class="col-sm-8">
<div class="radio-box">
<input type="radio" name="eceiptStatus" value="">
<label th:for="eceiptStatus" th:text="未知"></label>
</div>
<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">
<div class="radio-box">
<input type="radio" name="paymentStatus" value="">
<label th:for="paymentStatus" th:text="未知"></label>
</div>
<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="taxRate" 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="delFlag" class="form-control m-b" th:with="type=${@dict.getType('sys_whether')}">
<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="standbyOne" 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="standbyTwo" class="form-control" type="text">
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<script th:inline="javascript">
var prefix = ctx + "purchase/purchaseOrderChild"
$("#form-purchaseOrderChild-add").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/add", $('#form-purchaseOrderChild-add').serialize());
}
}
$("input[name='deliveryTime']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
</script>
</body>
</html>

153
ruoyi-admin/src/main/resources/templates/purchase/purchaseOrderChild/edit.html

@ -0,0 +1,153 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('修改采购订单子表')" />
<th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-purchaseOrderChild-edit" th:object="${purchaseOrderChild}">
<input name="purchaseOrderChildId" th:field="*{purchaseOrderChildId}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">关联采购订单号:</label>
<div class="col-sm-8">
<input name="purchaseOrderCode" th:field="*{purchaseOrderCode}" 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="supplierCode" th:field="*{supplierCode}" 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="supplierName" th:field="*{supplierName}" 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="materialCode" th:field="*{materialCode}" 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="materialName" th:field="*{materialName}" 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="materialNormb" th:field="*{materialNormb}" 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="materialRmb" th:field="*{materialRmb}" 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="materialNum" th:field="*{materialNum}" 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="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="materialNormbsum" th:field="*{materialNormbsum}" 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="materialRmbsum" th:field="*{materialRmbsum}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">交货时间:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="deliveryTime" th:value="${#dates.format(purchaseOrderChild.deliveryTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">收货状态:</label>
<div class="col-sm-8">
<div class="radio-box">
<input type="radio" name="eceiptStatus" value="">
<label th:for="eceiptStatus" th:text="未知"></label>
</div>
<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">
<div class="radio-box">
<input type="radio" name="paymentStatus" value="">
<label th:for="paymentStatus" th:text="未知"></label>
</div>
<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="taxRate" th:field="*{taxRate}" 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="standbyOne" th:field="*{standbyOne}" 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="standbyTwo" th:field="*{standbyTwo}" class="form-control" type="text">
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<script th:inline="javascript">
var prefix = ctx + "purchase/purchaseOrderChild";
$("#form-purchaseOrderChild-edit").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-purchaseOrderChild-edit').serialize());
}
}
$("input[name='deliveryTime']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
</script>
</body>
</html>

202
ruoyi-admin/src/main/resources/templates/purchase/purchaseOrderChild/purchaseOrderChild.html

@ -0,0 +1,202 @@
<!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="purchaseOrderCode"/>
</li>
<li>
<label>供应商代码:</label>
<input type="text" name="supplierCode"/>
</li>
<li>
<label>供应商名称:</label>
<input type="text" name="supplierName"/>
</li>
<li>
<label>物料料号:</label>
<input type="text" name="materialCode"/>
</li>
<li>
<label>物料名称:</label>
<input type="text" name="materialName"/>
</li>
<li>
<label>交货时间:</label>
<input type="text" class="time-input" placeholder="请选择交货时间" name="deliveryTime"/>
</li>
<li>
<label>收货状态:</label>
<select name="eceiptStatus">
<option value="">所有</option>
<option value="-1">代码生成请选择字典属性</option>
</select>
</li>
<li>
<label>打款结案状态:</label>
<select name="paymentStatus">
<option value="">所有</option>
<option value="-1">代码生成请选择字典属性</option>
</select>
</li>
<li>
<label>录入人:</label>
<input type="text" name="createBy"/>
</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:purchaseOrderChild:add">
<i class="fa fa-plus"></i> 添加
</a>
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="purchase:purchaseOrderChild:edit">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="purchase:purchaseOrderChild:remove">
<i class="fa fa-remove"></i> 删除
</a>
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="purchase:purchaseOrderChild: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:purchaseOrderChild:edit')}]];
var removeFlag = [[${@permission.hasPermi('purchase:purchaseOrderChild:remove')}]];
var cancelFlag = [[${@permission.hasPermi('purchase:purchaseOrderChild:cancel')}]];
var restoreFlag = [[${@permission.hasPermi('purchase:purchaseOrderChild:restore')}]];
var delFlagDatas = [[${@dict.getType('sys_whether')}]];
var prefix = ctx + "purchase/purchaseOrderChild";
$(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: 'purchaseOrderChildId',
visible: false
},
{
title: '关联采购订单号',
field: 'purchaseOrderCode',
},
{
title: '供应商代码',
field: 'supplierCode',
},
{
title: '供应商名称',
field: 'supplierName',
},
{
title: '物料料号',
field: 'materialCode',
},
{
title: '物料名称',
field: 'materialName',
},
{
title: '物料不含税单价',
field: 'materialNormb',
},
{
title: '物料含税单价',
field: 'materialRmb',
},
{
title: '采购物料数量',
field: 'materialNum',
},
{
title: '物料合计',
field: 'materialAmount',
},
{
title: '数量合计',
field: 'materialSum',
},
{
title: '不含税总价(RMB)',
field: 'materialNormbsum',
},
{
title: '含税总价(RMB)',
field: 'materialRmbsum',
},
{
title: '交货时间',
field: 'deliveryTime',
},
{
title: '收货状态',
field: 'eceiptStatus',
},
{
title: '打款结案状态',
field: 'paymentStatus',
},
{
title: '税率',
field: 'taxRate',
},
{
title: '备用一',
field: 'standbyOne',
},
{
title: '备用二',
field: 'standbyTwo',
},
{
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.purchaseOrderChildId + '\')"><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.purchaseOrderChildId + '\')"><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