Browse Source

[feat] 采购管理:采购计划添加采购的划分根据关联单号查询报价编号,分组物料信息和分组物料供应商详情,添价供应商页面循环递归,添加采购报价子表供应商字段,供应商编号,编写查询采购计划添加采购的划分根据关联单号查询报价编号SQL语句。

dev
zhangsiqi 5 months ago
parent
commit
78eaddb4c6
  1. 3
      ruoyi-admin/src/main/java/com/ruoyi/purchase/controller/PurchasePlanController.java
  2. 4
      ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseQuoteServiceImpl.java
  3. 22
      ruoyi-admin/src/main/resources/mapper/purchase/PurchasePlanChildMapper.xml
  4. 1
      ruoyi-admin/src/main/resources/mapper/purchase/PurchaseQuoteChildMapper.xml
  5. 16
      ruoyi-admin/src/main/resources/templates/purchase/purchasePlan/addPurchaseOrder.html
  6. 1
      ruoyi-admin/src/main/resources/templates/purchase/purchaseQuote/edit.html

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

@ -121,6 +121,9 @@ public class PurchasePlanController extends BaseController
List<PurchasePlan> purchasePlanList = purchasePlanService.selectPurchasePlanByPlanCode(purchasePlanCode);
//根据采购计划编号查询对应的采购报价数据
List<PurchasePlanChild> purchasePlanChildList = purchasePlanChildService.getPurchasePlanChildByPlanCodes(purchasePlanCode);
for(PurchasePlanChild purchasePlanChild : purchasePlanChildList){
List<PurchaseQuoteChild> purchaseQuoteChildList = purchasePlanChild.getPurchaseQuoteChildList();
}
//再根据采购计划编号分组查询对应的采购报价数据分组
purchasePlanCodes = purchasePlanCodes.replace("[","").replace("]","");

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

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

@ -29,16 +29,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,20 +164,16 @@ 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,
quote.supplier_code,
GROUP_CONCAT(DISTINCT quote.supplier_code ORDER BY quote.supplier_code) AS supplier_code,
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

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>

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">' +

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