Browse Source

Merge remote-tracking branch 'origin/dev' into dev

dev
liuxiaoxu 5 months ago
parent
commit
b546b604d8
  1. 151
      ruoyi-admin/src/main/java/com/ruoyi/purchase/controller/PurchaseOrderChildController.java
  2. 43
      ruoyi-admin/src/main/java/com/ruoyi/purchase/controller/PurchaseOrderController.java
  3. 17
      ruoyi-admin/src/main/java/com/ruoyi/purchase/controller/PurchasePlanController.java
  4. 12
      ruoyi-admin/src/main/java/com/ruoyi/purchase/domain/PurchaseOrder.java
  5. 321
      ruoyi-admin/src/main/java/com/ruoyi/purchase/domain/PurchaseOrderChild.java
  6. 58
      ruoyi-admin/src/main/java/com/ruoyi/purchase/domain/PurchasePlanChild.java
  7. 77
      ruoyi-admin/src/main/java/com/ruoyi/purchase/mapper/PurchaseOrderChildMapper.java
  8. 75
      ruoyi-admin/src/main/java/com/ruoyi/purchase/service/IPurchaseOrderChildService.java
  9. 126
      ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseOrderChildServiceImpl.java
  10. 2
      ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseOrderServiceImpl.java
  11. 4
      ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseQuoteServiceImpl.java
  12. 161
      ruoyi-admin/src/main/resources/mapper/purchase/PurchaseOrderChildMapper.xml
  13. 39
      ruoyi-admin/src/main/resources/mapper/purchase/PurchasePlanChildMapper.xml
  14. 1
      ruoyi-admin/src/main/resources/mapper/purchase/PurchaseQuoteChildMapper.xml
  15. 160
      ruoyi-admin/src/main/resources/templates/purchase/purchaseOrderChild/add.html
  16. 153
      ruoyi-admin/src/main/resources/templates/purchase/purchaseOrderChild/edit.html
  17. 202
      ruoyi-admin/src/main/resources/templates/purchase/purchaseOrderChild/purchaseOrderChild.html
  18. 16
      ruoyi-admin/src/main/resources/templates/purchase/purchasePlan/addPurchaseOrder.html
  19. 3
      ruoyi-admin/src/main/resources/templates/purchase/purchasePlan/purchasePlan.html
  20. 1
      ruoyi-admin/src/main/resources/templates/purchase/purchaseQuote/edit.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));
}
}

43
ruoyi-admin/src/main/java/com/ruoyi/purchase/controller/PurchaseOrderController.java

@ -13,10 +13,13 @@ import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.purchase.domain.PurchaseMaterial;
import com.ruoyi.purchase.domain.PurchaseOrder;
import com.ruoyi.purchase.domain.PurchaseOrderChild;
import com.ruoyi.purchase.domain.PurchaseQuoteChild;
import com.ruoyi.purchase.domain.exportDto.PurchaseMaterialDto;
import com.ruoyi.purchase.domain.exportDto.PurchaseOrderDto;
import com.ruoyi.purchase.service.IPurchaseMaterialService;
@ -32,6 +35,7 @@ import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.math.BigDecimal;
import java.util.*;
import static com.ruoyi.common.config.datasource.DynamicDataSourceContextHolder.log;
@ -53,6 +57,9 @@ public class PurchaseOrderController extends BaseController
@Autowired
private IPurchaseMaterialService purchaseMaterialService;
@Autowired
private RedisCache redisCache;
@RequiresPermissions("purchase:purchaseOrder:view")
@GetMapping()
public String purchaseOrder()
@ -103,8 +110,40 @@ public class PurchaseOrderController extends BaseController
@Log(title = "采购订单", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(PurchaseOrder purchaseOrder)
{
public AjaxResult addSave(@RequestBody PurchaseOrder purchaseOrder) throws Exception{
//获取采购订单子表中的供应商,核算供应商数量和采购物料合计以及采购数量合计,采购不含税报价合计,采购含税报价合计
List<PurchaseOrderChild> purchaseMaterials = purchaseOrder.getPurchaseOrderChildList();
purchaseOrder.setPurchaseOrderCode(redisCache.generateBillNo("CG"));
BigDecimal materialNoRmb = BigDecimal.valueOf(0.0);
BigDecimal materialRmb = BigDecimal.valueOf(0.0);
BigDecimal materialNoRmbSum = BigDecimal.valueOf(0.0);
BigDecimal materialRmbSum = BigDecimal.valueOf(0.0);
BigDecimal materialSum = BigDecimal.valueOf(0.0);
Long materialNum = 0L;
Long supplierNum = 0L;
for (PurchaseOrderChild purchaseOrderChild : purchaseMaterials) {
purchaseOrderChild.setPurchaseOrderCode(purchaseOrder.getPurchaseOrderCode());
for (PurchaseQuoteChild purchaseSupplierQuote : purchaseOrderChild.getPurchaseQuoteChildList()){
BigDecimal suplierMaterialNoRmb = purchaseSupplierQuote.getMaterialNoRmb();
BigDecimal suplierMaterialRmb = purchaseSupplierQuote.getMaterialRmb();
Long suplierMaterialNum = purchaseSupplierQuote.getMaterialNum();
BigDecimal suplierMaterialNoRmbSum = suplierMaterialNoRmb.multiply(BigDecimal.valueOf(suplierMaterialNum));
BigDecimal suplierMaterialRmbSum = suplierMaterialRmb.multiply(BigDecimal.valueOf(suplierMaterialNum));
materialNum = materialNum + suplierMaterialNum;
materialNoRmb = materialNoRmb.add(purchaseSupplierQuote.getMaterialNoRmb());
materialRmb = materialRmb.add(purchaseSupplierQuote.getMaterialRmb());
materialRmbSum = materialRmbSum.add(suplierMaterialRmbSum);
materialNoRmbSum = materialNoRmbSum.add(suplierMaterialNoRmbSum);
purchaseSupplierQuote.setPurchaseQuoteCode(purchaseOrder.getPurchaseOrderCode());
if (purchaseSupplierQuote.getSupplierCode() != null){
supplierNum ++;
}
}
purchaseOrderChild.setMaterialNormb(materialNoRmb);
purchaseOrderChild.setMaterialRmb(materialRmb);
purchaseOrderChild.setMaterialNum(materialNum);
}
purchaseOrder.setSupplierNum(Math.toIntExact(supplierNum));
return toAjax(purchaseOrderService.insertPurchaseOrder(purchaseOrder));
}

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

@ -2,6 +2,7 @@ package com.ruoyi.purchase.controller;
import java.util.Arrays;
import java.util.List;
import java.util.Set;
import com.ruoyi.common.core.text.Convert;
import com.ruoyi.purchase.domain.PurchasePlan;
@ -114,19 +115,21 @@ public class PurchasePlanController extends BaseController
@GetMapping("/addPurchaseOrder/{purchasePlanCodes}")
public String purChaseOrder(@PathVariable("purchasePlanCodes") String purchasePlanCodes,ModelMap mmap){
//purchasePlanCodes去除重复数据,purchasePlanCodeArray作为数组类型去除
String purchasePlanCode = purchasePlanCodes;
// 直接使用String的split方法分割字符串,然后转为Stream去重,最后再拼接回字符串
String[] purchasePlanCodeArray = purchasePlanCodes.split(",");
purchasePlanCodes = Arrays.toString(Arrays.stream(purchasePlanCodeArray).distinct().toArray());
String uniquePurchasePlanCodes = String.join(",", Arrays.stream(purchasePlanCodeArray).distinct().toArray(String[]::new));
//查询相关采购计划数据
List<PurchasePlan> purchasePlanList = purchasePlanService.selectPurchasePlanByPlanCode(purchasePlanCode);
List<PurchasePlan> purchasePlanList = purchasePlanService.selectPurchasePlanByPlanCode(uniquePurchasePlanCodes);
//根据采购计划编号查询对应的采购报价数据
List<PurchasePlanChild> purchasePlanChildList = purchasePlanChildService.getPurchasePlanChildByPlanCodes(purchasePlanCode);
List<PurchasePlanChild> purchasePlanChildList = purchasePlanChildService.getPurchasePlanChildByPlanCodes(uniquePurchasePlanCodes);
//再根据采购计划编号分组查询对应的采购报价数据分组
purchasePlanCodes = purchasePlanCodes.replace("[","").replace("]","");
for(PurchasePlanChild purchasePlanChild : purchasePlanChildList){
purchasePlanChild.setPurchaseSupplierList(purchasePlanChild.parseSupplierMaterialCombinations(purchasePlanChild.getSupplierCodes()));
}
//查询物料报价中供应商
mmap.put("purchasePlanList", purchasePlanList);
mmap.put("purchasePlanCodes", purchasePlanCodes);
mmap.put("purchasePlanCodes", uniquePurchasePlanCodes);
mmap.put("purchasePlanChildList", purchasePlanChildList);
return prefix + "/addPurchaseOrder";
}

12
ruoyi-admin/src/main/java/com/ruoyi/purchase/domain/PurchaseOrder.java

@ -5,6 +5,8 @@ import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import java.util.List;
/**
* 采购订单对象 purchase_order
*
@ -177,6 +179,16 @@ public class PurchaseOrder extends BaseEntity
/** 备用二 */
private String standbyTwo;
private List<PurchaseOrderChild> purchaseOrderChildList;
public List<PurchaseOrderChild> getPurchaseOrderChildList() {
return purchaseOrderChildList;
}
public void setPurchaseOrderChildList(List<PurchaseOrderChild> purchaseOrderChildList) {
this.purchaseOrderChildList = purchaseOrderChildList;
}
public Long getPurchaseOrderId() {
return purchaseOrderId;
}

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

58
ruoyi-admin/src/main/java/com/ruoyi/purchase/domain/PurchasePlanChild.java

@ -1,6 +1,8 @@
package com.ruoyi.purchase.domain;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.apache.commons.lang3.builder.ToStringBuilder;
@ -17,6 +19,7 @@ import com.ruoyi.common.core.domain.BaseEntity;
public class PurchasePlanChild extends BaseEntity
{
private static final long serialVersionUID = 1L;
public List<PurchaseQuoteChild> parseSupplierMaterialCombinations;
/** 采购计划物料清单索引 */
private Long purchasePlanChildId;
@ -83,8 +86,28 @@ public class PurchasePlanChild extends BaseEntity
/** 删除标志 */
private String delFlag;
/** 关联供应商编号 */
private String supplierCodes;
/** 关联采购报价单编号 */
private String correlationCodes;
private List<PurchaseQuoteChild> purchaseQuoteChildList;
private List<PurchaseQuoteChild> purchaseSupplierList;
public String getSupplierCodes() {
return supplierCodes;
}
public void setSupplierCodes(String supplierCodes) {
this.supplierCodes = supplierCodes;
}
public String getCorrelationCodes() {
return correlationCodes;
}
public void setCorrelationCodes(String correlationCodes) {
this.correlationCodes = correlationCodes;
}
public void setPurchasePlanChildId(Long purchasePlanChildId)
{
@ -233,12 +256,12 @@ public class PurchasePlanChild extends BaseEntity
this.supplierName = supplierName;
}
public List<PurchaseQuoteChild> getPurchaseQuoteChildList() {
return purchaseQuoteChildList;
public List<PurchaseQuoteChild> getPurchaseSupplierList() {
return purchaseSupplierList;
}
public void setPurchaseQuoteChildList(List<PurchaseQuoteChild> purchaseQuoteChildList) {
this.purchaseQuoteChildList = purchaseQuoteChildList;
public void setPurchaseSupplierList(List<PurchaseQuoteChild> purchaseSupplierList) {
this.purchaseSupplierList = purchaseSupplierList;
}
public String getUseStatus()
@ -264,6 +287,31 @@ public class PurchasePlanChild extends BaseEntity
return delFlag;
}
public List<PurchaseQuoteChild> parseSupplierMaterialCombinations(String combinations) {
if (combinations == null || combinations.isEmpty()) {
return Collections.emptyList();
}
//materialCode|purchaseQuoteCode|supplierCode|supplierName|materialName|materialNoRmb|materialRmb
/* 1. 料号 | 2. 供应商报价编号 | 3. 供应商编号 | 4.供应商名称 | 5. 物料名称 | 6. 物料含税单价(RMB) | 7. 物料不含税单价(RMB) */
List<PurchaseQuoteChild> purchaseSupplierList = new ArrayList<>();
String[] split = combinations.split(",");
for (int i = 0; i < split.length; i++) {
String[] split1 = split[i].split("\\|");
if (split1.length != 7) {
continue;
}
PurchaseQuoteChild purchaseQuoteChild = new PurchaseQuoteChild();
purchaseQuoteChild.setMaterialCode(split1[0]);
purchaseQuoteChild.setPurchaseQuoteCode(split1[1]);
purchaseQuoteChild.setSupplierCode(split1[2]);
purchaseQuoteChild.setSupplierName(split1[3]);
purchaseQuoteChild.setMaterialName(split1[4]);
purchaseQuoteChild.setMaterialNoRmb(BigDecimal.valueOf(Float.parseFloat(split1[5])));
purchaseQuoteChild.setMaterialRmb(BigDecimal.valueOf(Float.parseFloat(split1[6])));
purchaseSupplierList.add(purchaseQuoteChild);
}
return purchaseSupplierList;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

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

2
ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseOrderServiceImpl.java

@ -59,6 +59,8 @@ public class PurchaseOrderServiceImpl implements IPurchaseOrderService
@Override
public int insertPurchaseOrder(PurchaseOrder purchaseOrder)
{
//根据上传的物料信息做采购订单子项
//
return purchaseOrderMapper.insertPurchaseOrder(purchaseOrder);
}

4
ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseQuoteServiceImpl.java

@ -125,7 +125,7 @@ public class PurchaseQuoteServiceImpl implements IPurchaseQuoteService
for(PurchaseQuoteChild child : purchaseQuote.getPurchaseQuoteChildList()){
child.setPurchaseQuoteCode(purchaseQuote.getPurchaseQuoteCode());
child.setCreateBy(loginName);
child.setSupplierCode(purchaseQuote.getPurchaseQuoteCode());
child.setSupplierCode(purchaseQuote.getSupplierQuoteCode());
child.setSupplierName(purchaseQuote.getSupplierName());
child.setCreateTime(DateUtils.getNowDate());
child.setTaxRate(purchaseQuote.getTaxRate());
@ -177,7 +177,7 @@ public class PurchaseQuoteServiceImpl implements IPurchaseQuoteService
if(childResult > 0){
for(PurchaseQuoteChild child : purchaseQuote.getPurchaseQuoteChildList()){
child.setPurchaseQuoteCode(purchaseQuote.getPurchaseQuoteCode());
child.setSupplierCode(purchaseQuote.getPurchaseQuoteCode());
child.setSupplierCode(purchaseQuote.getSupplierQuoteCode());
child.setSupplierName(purchaseQuote.getSupplierName());
child.setCreateBy(loginName);
child.setCreateTime(DateUtils.getNowDate());

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>

39
ruoyi-admin/src/main/resources/mapper/purchase/PurchasePlanChildMapper.xml

@ -19,6 +19,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="materialRmb" column="material_rmb" />
<result property="materialNoRmb" column="material_noRmb" />
<result property="supplierCode" column="supplier_code" />
<result property="supplierCodes" column="supplier_codes" />
<result property="correlationCodes" column="correlation_codes" />
<result property="supplierName" column="supplier_name" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
@ -29,16 +31,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="auditStatus" column="audit_status" />
<result property="delFlag" column="del_flag" />
</resultMap>
<resultMap id="supplier" type="PurchaseQuoteChild">
<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="materialNum" column="material_num"/>
<result property="materialSole" column="material_sole"/>
<result property="materialRmb" column="material_rmb"/>
<result property="materialNoRmb" column="material_noRmb"/>
</resultMap>
<sql id="selectPurchasePlanChildVo">
select purchase_plan_child_id, purchase_plan_code, material_id,
material_code, material_name, material_type, process_method, brand,
@ -174,34 +166,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</update>
<select id="getPurchasePlanChildByPlanCodes" parameterType="String" resultMap="PurchasePlanChildResult">
SELECT
plan.material_code,
GROUP_CONCAT(DISTINCT planOrder.correlation_code ORDER BY planOrder.correlation_code) AS combined_correlation_codes,
GROUP_CONCAT(DISTINCT quote.supplier_code ORDER BY quote.supplier_code) AS combined_supplier_codes,
GROUP_CONCAT(DISTINCT planOrder.correlation_code ORDER BY planOrder.correlation_code) AS correlation_codes,
GROUP_CONCAT(DISTINCT CONCAT(quote.material_code,'|',quote.purchase_quote_code , '|' ,quote.supplier_code,'|',
quote.supplier_name,'|',quote.material_name,'|',quote.material_noRmb,'|',quote.material_rmb)
ORDER BY quote.supplier_code) AS supplier_codes,
plan.material_code,
plan.material_name,
plan.material_type,
plan.process_method,
plan.brand,
plan.photoUrl,
plan.material_num,
quote.material_noRmb,
quote.material_rmb,
quote.supplier_code,
quote.supplier_name
plan.material_num
FROM
purchase_plan_child AS plan
LEFT JOIN purchase_plan AS planOrder
ON plan.purchase_plan_code = planOrder.purchase_plan_code
AND planOrder.del_flag = '0'
LEFT JOIN purchase_quote_child AS quote
ON plan.material_code = quote.material_code
AND quote.del_flag = '0'
LEFT JOIN purchase_plan AS planOrder ON plan.purchase_plan_code = planOrder.purchase_plan_code AND planOrder.del_flag = '0'
LEFT JOIN purchase_quote_child AS quote ON plan.material_code = quote.material_code AND quote.del_flag = '0'
WHERE
plan.purchase_plan_code IN
<foreach item="purchasePlanCode" collection="array" open="(" separator="," close=")">
#{purchasePlanCode}
</foreach>
AND plan.del_flag = '0'
plan.purchase_plan_code IN ('CGJH20240415001', 'CGJH20240415002') AND plan.del_flag = '0'
GROUP BY
plan.material_code;
</select>

1
ruoyi-admin/src/main/resources/mapper/purchase/PurchaseQuoteChildMapper.xml

@ -60,6 +60,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="materialSole != null "> and material_sole = #{materialSole}</if>
<if test="useStatus != null and useStatus != ''"> and use_status = #{useStatus}</if>
<if test="auditStatus != null and auditStatus != ''"> and audit_status = #{auditStatus}</if>
<if test="delFlag != null "> and del_flag = #{delFlag}</if>
</where>
</select>

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>

16
ruoyi-admin/src/main/resources/templates/purchase/purchasePlan/addPurchaseOrder.html

@ -93,8 +93,22 @@
'</div>'+
'</div>'
);
foreach(material.supplierList, function(supplier, index) {
var $supplier = $('<div class="form-group"></div>');
$supplier.append('<label class="col-sm-4 col-form-label is-required">供应商:' + index + ':</label>');
var headerContent =
'<label class="col-sm-4 col-form-label">' + supplier.supplierCode + ': ' + supplier.supplierName +
' - 最新不含税采购价:' + supplier.materialNoRmb + ' RMB' +
' 最新含税采购价:' + supplier.materialRmb + ' RMB ' +
'</label>'
var $header = $('<div class="card-header">' + headerContent + '</div>');
var $inputsWrapper = $('<div class="card-body"></div>'); // 用于存放输入框等表单元素
$('#supplierCode' + tableId).append($inputsWrapper.append($header));
})
var $supplier = $('<div class="form-group"></div>');
$tableWrapper.append($table);
var $formGroup = $('<div class="form-group"></div>');
var supplierName =
var supplierSum =
'<div class="form-row">' +
'<label class="col-sm-4 col-form-label is-required">实际采购数:</label>' +
'<div class="col-sm-4">' +

3
ruoyi-admin/src/main/resources/templates/purchase/purchasePlan/purchasePlan.html

@ -175,10 +175,9 @@
purchasePlanCodes += selections[i].purchasePlanCode ;
}
}
}else{
}else if(selections.length === 1){
purchasePlanCodes = selections[0].purchasePlanCode;
}
}
$.modal.open("新增采购订单", prefix + "/addPurchaseOrder/" + purchasePlanCodes);
}

1
ruoyi-admin/src/main/resources/templates/purchase/purchaseQuote/edit.html

@ -176,6 +176,7 @@
sortName: params.sort,
sortOrder: params.order,
purchaseQuoteCode: purchaseQuote.purchaseQuoteCode,
delFlag: 0
}
return temp;
},

Loading…
Cancel
Save