diff --git a/ruoyi-admin/src/main/java/com/ruoyi/purchase/controller/PurchaseOrderChildController.java b/ruoyi-admin/src/main/java/com/ruoyi/purchase/controller/PurchaseOrderChildController.java index 29acbbdc..9917bd18 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/purchase/controller/PurchaseOrderChildController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/purchase/controller/PurchaseOrderChildController.java @@ -9,11 +9,7 @@ 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 org.springframework.web.bind.annotation.*; import com.ruoyi.common.annotation.Log; import com.ruoyi.common.enums.BusinessType; import com.ruoyi.purchase.domain.PurchaseOrderChild; diff --git a/ruoyi-admin/src/main/java/com/ruoyi/purchase/controller/PurchaseOrderController.java b/ruoyi-admin/src/main/java/com/ruoyi/purchase/controller/PurchaseOrderController.java index 461e01df..9104afcd 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/purchase/controller/PurchaseOrderController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/purchase/controller/PurchaseOrderController.java @@ -15,16 +15,17 @@ 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.DateUtils; +import com.ruoyi.common.utils.ShiroUtils; 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.*; import com.ruoyi.purchase.domain.exportDto.PurchaseMaterialDto; import com.ruoyi.purchase.domain.exportDto.PurchaseOrderDto; import com.ruoyi.purchase.mapper.PurchaseOrderChildMapper; import com.ruoyi.purchase.service.IPurchaseMaterialService; +import com.ruoyi.purchase.service.IPurchaseOrderChildService; import com.ruoyi.purchase.service.IPurchaseOrderService; +import com.ruoyi.purchase.service.IPurchasePlanService; import com.ruoyi.quality.domain.QualityOrderDetail; import com.ruoyi.storehouse.utils.CustomRowWriteCellHandler; import org.apache.poi.ss.usermodel.HorizontalAlignment; @@ -62,7 +63,10 @@ public class PurchaseOrderController extends BaseController @Autowired private IPurchaseMaterialService purchaseMaterialService; @Autowired - private PurchaseOrderChildMapper purchaseOrderChildService;; + private IPurchaseOrderChildService purchaseOrderChildService;; + + @Autowired + private IPurchasePlanService purchasePlanService; @Autowired private RedisCache redisCache; @@ -116,9 +120,18 @@ public class PurchaseOrderController extends BaseController @Log(title = "采购订单", businessType = BusinessType.INSERT) @PostMapping("/add") @ResponseBody - public AjaxResult addSave(@Valid @RequestBody PurchaseOrder purchaseOrder) { + public AjaxResult addSave( @RequestBody PurchaseOrder purchaseOrder) { + // 数据校验,确保前端传入数据格式正确 + // 生成采购订单编号 + // 执行主表插入操作 + return toAjax(purchaseOrderService.insertPurchaseOrder(purchaseOrder)); // 假设toAjax方法处理成功逻辑 + } + @RequiresPermissions("purchase:purchaseOrder:add") + @Log(title = "采购订单", businessType = BusinessType.INSERT) + @PostMapping("/addPurchaseOrder") + @ResponseBody + public AjaxResult addPurchasePlantoPuserchaseOrder(@RequestBody PurchaseOrder purchaseOrder) { // 数据校验,确保前端传入数据格式正确 - validatePurchaseOrder(purchaseOrder); // 生成采购订单编号 purchaseOrder.setPurchaseOrderCode(redisCache.generateBillNo("CG")); // 初始化累加变量 @@ -128,73 +141,82 @@ public class PurchaseOrderController extends BaseController BigDecimal materialRmbSum = BigDecimal.ZERO; Long materialNum = 0L; int supplierNum = 0; - // 遍历处理采购订单子表 - for (PurchaseOrderChild child : purchaseOrder.getPurchaseOrderChildList()) { - child.setPurchaseOrderCode(purchaseOrder.getPurchaseOrderCode()); - // 累加物料数量和金额 - for (PurchaseQuoteChild quote : child.getPurchaseQuoteChildList()) { - //获取物料供应商采购价格 - BigDecimal suplierMaterialNoRmb = quote.getMaterialNoRmb(); - // 获取物料供应商采购价格 - BigDecimal suplierMaterialRmb = quote.getMaterialRmb(); - // 获取物料数量 - Long suplierMaterialNum = quote.getMaterialNum(); - // 累加物料数量 - materialNum += suplierMaterialNum; - // 累加不含税物料价格 - materialNoRmb = materialNoRmb.add(suplierMaterialNoRmb); - // 累加含税物料价格 - materialRmb = materialRmb.add(suplierMaterialRmb); - - child.setPurchasePlanCode(quote.getPurchasePlanCode()); - // 计算不含税物料总价 - BigDecimal suplierMaterialNoRmbSumLocal = suplierMaterialNoRmb.multiply(BigDecimal.valueOf(suplierMaterialNum)); - // 计算物料含税总价 - BigDecimal suplierMaterialRmbSumLocal = suplierMaterialRmb.multiply(BigDecimal.valueOf(suplierMaterialNum)); - // 累加物料总价 - materialNoRmbSum = materialNoRmbSum.add(suplierMaterialNoRmbSumLocal); - // 累加物料含税总价 - materialRmbSum = materialRmbSum.add(suplierMaterialRmbSumLocal); - - // 设置采购报价单编号和供应商信息到QuoteChild - quote.setPurchaseQuoteCode(purchaseOrder.getPurchaseOrderCode()); - child.setSupplierCode(quote.getSupplierCode()); - child.setSupplierName(quote.getSupplierName()); - + if (!CollectionUtils.isEmpty(purchaseOrder.getPurchaseOrderChildList())) { + supplierNum = purchaseOrder.getPurchaseOrderChildList().size(); + } + if (purchaseOrder.getPurchaseOrderChildList() != null) { + for (PurchaseOrderChild child : purchaseOrder.getPurchaseOrderChildList()) { + if (child.getCorrelationCode().contains(",")) { + String[] correlationCodes = child.getCorrelationCode().split(","); + for (int i = 0; i < correlationCodes.length; i++) { + String correlationCode = correlationCodes[i]; + String planCode = child.getPurchasePlanCode().split(",")[i]; + if (correlationCode != null) { + PurchaseOrderChild material = new PurchaseOrderChild(); + child.setPurchaseOrderCode(purchaseOrder.getPurchaseOrderCode()); + // 累加物料数量和金额 + //获取物料供应商采购价格 + BigDecimal suplierMaterialNoRmb = child.getMaterialNoRmb(); + // 获取物料供应商采购价格 + BigDecimal suplierMaterialRmb = child.getMaterialRmb(); + // 获取物料数量 + Long suplierMaterialNum = child.getMaterialNum(); + // 累加物料数量 + materialNum += suplierMaterialNum; + // 累加不含税物料价格 + materialNoRmb = materialNoRmb.add(suplierMaterialNoRmb); + // 累加含税物料价格 + materialRmb = materialRmb.add(suplierMaterialRmb); + // 计算不含税物料总价 + BigDecimal suplierMaterialNoRmbSumLocal = suplierMaterialNoRmb.multiply(BigDecimal.valueOf(suplierMaterialNum)); + // 计算物料含税总价 + BigDecimal suplierMaterialRmbSumLocal = suplierMaterialRmb.multiply(BigDecimal.valueOf(suplierMaterialNum)); + // 累加物料总价 + materialNoRmbSum = materialNoRmbSum.add(suplierMaterialNoRmbSumLocal); + // 累加物料含税总价 + materialRmbSum = materialRmbSum.add(suplierMaterialRmbSumLocal); + // 设置采购报价单编号和供应商信息到QuoteChild + material.setPurchaseQuoteCode(purchaseOrder.getPurchaseOrderCode()); + material.setSupplierCode(child.getSupplierCode()); + material.setSupplierName(child.getSupplierName()); + material.setMaterialNoRmb(child.getMaterialNoRmb()); + material.setMaterialRmb(child.getMaterialRmb()); + material.setMaterialNum(child.getMaterialNum()); + material.setMaterialName(child.getMaterialName()); + material.setMaterialNoRmbSum(child.getMaterialNoRmbSum()); + material.setMaterialRmbSum(child.getMaterialRmbSum()); + material.setMaterialNoRmbSum(child.getMaterialNoRmbSum()); + material.setCorrelationCode(correlationCode); + material.setPurchasePlanCode(planCode); + material.setPurchaseOrderCode(purchaseOrder.getPurchaseOrderCode()); + // 执行子表插入操作 + purchaseOrderChildService.insertPurchaseOrderChild(child); + PurchasePlan plan = new PurchasePlan(); + plan.setPurchasePlanCode(child.getPurchasePlanCode()); + plan.setPurchasePlanStatus("1"); + int result = purchasePlanService.updatePurchasePlan(plan); + } + } + child.setMaterialNoRmb(BigDecimal.ZERO); + } // 确保供应商数量统计准确 - if (quote.getSupplierCode() != null) { + if (child.getSupplierCode() != null) { supplierNum++; } - } - - // 设置累加的物料信息到子表 - child.setMaterialNoRmb(materialNoRmb); - child.setMaterialRmb(materialRmb); - child.setMaterialNum(materialNum); - // 执行子表插入操作 - purchaseOrderChildService.insertPurchaseOrderChild(child); + } } - + // 遍历处理采购订单子表 + // 设置累加的物料信息到子表 + purchaseOrder.setMaterialSum(Math.toIntExact(materialNum)); + purchaseOrder.setNoRmbSum(materialNoRmbSum); + purchaseOrder.setRmbSum(materialRmbSum); // 设置主表的供应商数量 purchaseOrder.setSupplierNum(supplierNum); - // 执行主表插入操作 return toAjax(purchaseOrderService.insertPurchaseOrder(purchaseOrder)); // 假设toAjax方法处理成功逻辑 } - // 数据校验逻辑 - private void validatePurchaseOrder(PurchaseOrder purchaseOrder) { - if (CollectionUtils.isEmpty(purchaseOrder.getPurchaseOrderChildList())) { - try { - throw new Exception("采购订单子项不能为空"); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - // 可以添加更多校验逻辑 - } - /** * 修改采购订单 */ @@ -213,6 +235,18 @@ public class PurchaseOrderController extends BaseController mmap.put("purchaseOrderChild", purchaseOrderChild); return prefix + "/detail"; } + @GetMapping("/addPurchaseOrderStorage/{purchaseOrderCode}") + public String addPurchaseOrderStorage(@PathVariable("purchaseOrderCode") String purchaseOrderCode,ModelMap mmap){ + //purchasePlanCodes去除重复数据,purchasePlanCodeArray作为数组类型去除 + //查询相关采购计划数据 + PurchaseOrder purchaseOrderList = purchaseOrderService.selectPurchaseOrderByOrderCode(purchaseOrderCode); + //根据采购计划编号查询对应的采购报价数据 + List purchaseOrderChildList = purchaseOrderChildService.selectPurchaseOrderChildByOrderCode(purchaseOrderCode); + //再根据采购计划编号分组查询对应的采购报价数据分组 + mmap.put("purchaseOrderList", purchaseOrderList); + mmap.put("purchaseOrderChildList", purchaseOrderChildList); + return prefix + "/addPurchaseOrderStorage"; + } @ResponseBody @RequestMapping("/detailListGroupedBySupplier") public Map> detailListGroupedBySupplier(String qualityOrderCode) { @@ -288,7 +322,6 @@ public class PurchaseOrderController extends BaseController // 创建列合并工具类对象 // ExcelFillCellMergePrevColUtils mergePrevColUtils = new ExcelFillCellMergePrevColUtils(); - List purchaseMaterialList = purchaseMaterialService.selectPurchaseMaterialList(purchaseMaterial); List purchaseMaterialDtoList = new ArrayList<>(); double total = 0.00; diff --git a/ruoyi-admin/src/main/java/com/ruoyi/purchase/domain/PurchaseOrder.java b/ruoyi-admin/src/main/java/com/ruoyi/purchase/domain/PurchaseOrder.java index 1ec203d4..a8048a4b 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/purchase/domain/PurchaseOrder.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/purchase/domain/PurchaseOrder.java @@ -5,6 +5,7 @@ import org.apache.commons.lang3.builder.ToStringStyle; import com.ruoyi.common.annotation.Excel; import com.ruoyi.common.core.domain.BaseEntity; +import java.math.BigDecimal; import java.util.List; /** @@ -41,9 +42,9 @@ public class PurchaseOrder extends BaseEntity @Excel(name="数量合计") private Integer materialSum; @Excel(name="不含税总价(RMB)") - private Double noRmbSum; + private BigDecimal noRmbSum; @Excel(name="含税总价") - private Double rmbSum; + private BigDecimal rmbSum; /** 供应商代码 */ @Excel(name = "供应商代码") private String supplierCode; @@ -173,14 +174,76 @@ public class PurchaseOrder extends BaseEntity @Excel(name = "修改时间") private String updateInfoTime; + /** 删除标志(0代表存在 2代表删除) */ + private String delFlag; + /*仓库ID*/ + private String stockNo; + + /*仓库名称*/ + private String stockName; + + /*仓库收货地址*/ + private String stockAddress; + /*仓库收货电话*/ + private String stockPhone; + /*仓库收货人*/ + private String stockContact; + /** 备用一 */ private String standbyOne; /** 备用二 */ private String standbyTwo; - private List purchaseOrderChildList; + public String getDelFlag() { + return delFlag; + } + + public void setDelFlag(String delFlag) { + this.delFlag = delFlag; + } + + public String getStockNo() { + return stockNo; + } + + public void setStockNo(String stockNo) { + this.stockNo = stockNo; + } + + public String getStockName() { + return stockName; + } + + public void setStockName(String stockName) { + this.stockName = stockName; + } + + public String getStockAddress() { + return stockAddress; + } + + public void setStockAddress(String stockAddress) { + this.stockAddress = stockAddress; + } + + public String getStockPhone() { + return stockPhone; + } + + public void setStockPhone(String stockPhone) { + this.stockPhone = stockPhone; + } + + public String getStockContact() { + return stockContact; + } + + public void setStockContact(String stockContact) { + this.stockContact = stockContact; + } + public List getPurchaseOrderChildList() { return purchaseOrderChildList; } @@ -269,19 +332,19 @@ public class PurchaseOrder extends BaseEntity this.materialSum = materialSum; } - public Double getNoRmbSum() { + public BigDecimal getNoRmbSum() { return noRmbSum; } - public void setNoRmbSum(Double noRmbSum) { + public void setNoRmbSum(BigDecimal noRmbSum) { this.noRmbSum = noRmbSum; } - public Double getRmbSum() { + public BigDecimal getRmbSum() { return rmbSum; } - public void setRmbSum(Double rmbSum) { + public void setRmbSum(BigDecimal rmbSum) { this.rmbSum = rmbSum; } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/purchase/domain/PurchaseOrderChild.java b/ruoyi-admin/src/main/java/com/ruoyi/purchase/domain/PurchaseOrderChild.java index d1814ee2..8ca9b425 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/purchase/domain/PurchaseOrderChild.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/purchase/domain/PurchaseOrderChild.java @@ -25,9 +25,14 @@ public class PurchaseOrderChild extends BaseEntity /** 关联采购订单号 */ @Excel(name = "关联采购订单号") private String purchaseOrderCode; - + /*关联计划单号*/ private String purchasePlanCode; + /*采购计划关联单号*/ + private String correlationCode;; + + @Excel(name = "关联报价编号字段") + private String purchaseQuoteCode; /** 供应商代码 */ @Excel(name = "供应商代码") private String supplierCode; @@ -297,6 +302,22 @@ public class PurchaseOrderChild extends BaseEntity return standbyTwo; } + public String getCorrelationCode() { + return correlationCode; + } + + public void setCorrelationCode(String correlationCode) { + this.correlationCode = correlationCode; + } + + public String getPurchaseQuoteCode() { + return purchaseQuoteCode; + } + + public void setPurchaseQuoteCode(String purchaseQuoteCode) { + this.purchaseQuoteCode = purchaseQuoteCode; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/purchase/mapper/PurchaseOrderChildMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/purchase/mapper/PurchaseOrderChildMapper.java index f6181b61..ca2deebd 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/purchase/mapper/PurchaseOrderChildMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/purchase/mapper/PurchaseOrderChildMapper.java @@ -74,4 +74,6 @@ public interface PurchaseOrderChildMapper * @return 结果 */ public int restorePurchaseOrderChildById(Long purchaseOrderChildId); + + List selectPurchaseOrderChildByOrderCode(String purchaseOrderCode); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/purchase/mapper/PurchaseOrderMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/purchase/mapper/PurchaseOrderMapper.java index ddcde5d9..3efcbfa0 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/purchase/mapper/PurchaseOrderMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/purchase/mapper/PurchaseOrderMapper.java @@ -61,4 +61,6 @@ public interface PurchaseOrderMapper public int deletePurchaseOrderByIds(String[] purchaseOrderIds); public List selectOrderByIdDesc(); + + PurchaseOrder selectPurchaseOrderByOrderCode(String purchaseOrderCode); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/IPurchaseOrderChildService.java b/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/IPurchaseOrderChildService.java index 9972df39..69dcab9f 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/IPurchaseOrderChildService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/IPurchaseOrderChildService.java @@ -72,4 +72,6 @@ public interface IPurchaseOrderChildService * @return */ int restorePurchaseOrderChildById(Long purchaseOrderChildId); + + List selectPurchaseOrderChildByOrderCode(String purchaseOrderCode); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/IPurchaseOrderService.java b/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/IPurchaseOrderService.java index 5b9a30f2..254dc3bb 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/IPurchaseOrderService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/IPurchaseOrderService.java @@ -61,4 +61,6 @@ public interface IPurchaseOrderService public int deletePurchaseOrderById(Long purchaseOrderId); public String getId(); + + PurchaseOrder selectPurchaseOrderByOrderCode(String purchaseOrderCode); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseOrderChildServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseOrderChildServiceImpl.java index b4b9d8e8..a5301fcd 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseOrderChildServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseOrderChildServiceImpl.java @@ -9,6 +9,7 @@ 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; +import org.springframework.transaction.annotation.Transactional; /** * 采购订单子表Service业务层处理 @@ -53,6 +54,7 @@ public class PurchaseOrderChildServiceImpl implements IPurchaseOrderChildService * @return 结果 */ @Override + @Transactional(rollbackFor = Exception.class) public int insertPurchaseOrderChild(PurchaseOrderChild purchaseOrderChild) { String loginName = ShiroUtils.getLoginName(); @@ -123,4 +125,9 @@ public class PurchaseOrderChildServiceImpl implements IPurchaseOrderChildService { return purchaseOrderChildMapper.restorePurchaseOrderChildById(purchaseOrderChildId); } + + @Override + public List selectPurchaseOrderChildByOrderCode(String purchaseOrderCode){ + return purchaseOrderChildMapper.selectPurchaseOrderChildByOrderCode(purchaseOrderCode); + } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseOrderServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseOrderServiceImpl.java index dbdf08e3..d00b06b9 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseOrderServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseOrderServiceImpl.java @@ -2,11 +2,14 @@ package com.ruoyi.purchase.service.impl; import com.ruoyi.common.core.redis.RedisCache; import com.ruoyi.common.core.text.Convert; +import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.common.utils.ShiroUtils; import com.ruoyi.purchase.domain.PurchaseOrder; import com.ruoyi.purchase.mapper.PurchaseOrderMapper; import com.ruoyi.purchase.service.IPurchaseOrderService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import java.text.SimpleDateFormat; import java.util.List; @@ -57,9 +60,12 @@ public class PurchaseOrderServiceImpl implements IPurchaseOrderService * @return 结果 */ @Override + @Transactional(rollbackFor = Exception.class) public int insertPurchaseOrder(PurchaseOrder purchaseOrder) { //根据上传的物料信息做采购订单子项 + purchaseOrder.setCreateTime(DateUtils.getNowDate()); + purchaseOrder.setCreateBy(ShiroUtils.getLoginName()); // return purchaseOrderMapper.insertPurchaseOrder(purchaseOrder); } @@ -73,6 +79,8 @@ public class PurchaseOrderServiceImpl implements IPurchaseOrderService @Override public int updatePurchaseOrder(PurchaseOrder purchaseOrder) { + purchaseOrder.setCreateTime(DateUtils.getNowDate()); + purchaseOrder.setCreateBy(ShiroUtils.getLoginName()); return purchaseOrderMapper.updatePurchaseOrder(purchaseOrder); } @@ -104,4 +112,8 @@ public class PurchaseOrderServiceImpl implements IPurchaseOrderService public String getId() { return redisCache.generateBillNo("CG"); } + @Override + public PurchaseOrder selectPurchaseOrderByOrderCode(String purchaseOrderCode){ + return purchaseOrderMapper.selectPurchaseOrderByOrderCode(purchaseOrderCode); + } } diff --git a/ruoyi-admin/src/main/resources/mapper/purchase/PurchaseOrderChildMapper.xml b/ruoyi-admin/src/main/resources/mapper/purchase/PurchaseOrderChildMapper.xml index 09f82bc3..d51356c3 100644 --- a/ruoyi-admin/src/main/resources/mapper/purchase/PurchaseOrderChildMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/purchase/PurchaseOrderChildMapper.xml @@ -59,7 +59,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where purchase_order_child_id = #{purchaseOrderChildId} - + insert into purchase_order_child @@ -68,7 +68,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" supplier_name, material_code, material_name, - material_no_rmb, + material_no_rmb, material_rmb, material_num, material_amount, @@ -93,7 +93,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{supplierName}, #{materialCode}, #{materialName}, - #{materialNormb}, + #{materialNoRmb}, #{materialRmb}, #{materialNum}, #{materialAmount}, @@ -163,4 +163,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" update purchase_order_child set del_flag = '0' where purchase_order_child_id = #{purchaseOrderChildId} + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/mapper/purchase/PurchaseOrderMapper.xml b/ruoyi-admin/src/main/resources/mapper/purchase/PurchaseOrderMapper.xml index fef15c44..c8890185 100644 --- a/ruoyi-admin/src/main/resources/mapper/purchase/PurchaseOrderMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/purchase/PurchaseOrderMapper.xml @@ -49,6 +49,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + + + + + @@ -58,6 +64,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" purchase_category, purchase_commander, customer_order_number, remark_content, close_case_no, close_case_name, close_case_time, confirm_no, confirm_name, confirm_time, audit_no, audit_name, audit_time, approve_no, approve_name, + del_flag, stock_no, stock_name, stock_address, stock_contact, stock_phone, approve_time, standby_one, standby_two from purchase_order @@ -69,6 +76,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and supplier_name like concat('%', #{supplierName}, '%') and billing_date between #{params.beginBillingDate} and #{params.endBillingDate} + order by create_time desc + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/purchase/purchaseOrder/purchaseOrder.html b/ruoyi-admin/src/main/resources/templates/purchase/purchaseOrder/purchaseOrder.html index 8e3c8484..e7d090f3 100644 --- a/ruoyi-admin/src/main/resources/templates/purchase/purchaseOrder/purchaseOrder.html +++ b/ruoyi-admin/src/main/resources/templates/purchase/purchaseOrder/purchaseOrder.html @@ -75,10 +75,10 @@