Browse Source

引用物料部分,采购计划单,采购订单,新增入库部门、单位

dev
zhangsiqi 5 months ago
parent
commit
a9c9a88af7
  1. 11
      ruoyi-admin/src/main/java/com/ruoyi/purchase/domain/PurchaseOrderChild.java
  2. 11
      ruoyi-admin/src/main/java/com/ruoyi/purchase/domain/PurchasePlanChild.java
  3. 12
      ruoyi-admin/src/main/resources/mapper/purchase/PurchaseOrderChildMapper.xml
  4. 15
      ruoyi-admin/src/main/resources/mapper/purchase/PurchasePlanChildMapper.xml
  5. 19
      ruoyi-admin/src/main/resources/templates/purchase/purchasePlan/addPurchaseOrder.html
  6. 15
      ruoyi-admin/src/main/resources/templates/purchase/purchasePlan/purchasePlan.html

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

@ -64,6 +64,9 @@ public class PurchaseOrderChild extends BaseEntity
@Excel(name = "物料加工方法") @Excel(name = "物料加工方法")
private String materialProcessMethod; private String materialProcessMethod;
@Excel(name = "入库部门")
private String warehouseDept;
/** 物料不含税单价 */ /** 物料不含税单价 */
@Excel(name = "物料不含税单价") @Excel(name = "物料不含税单价")
private BigDecimal materialNoRmb; private BigDecimal materialNoRmb;
@ -165,6 +168,14 @@ public class PurchaseOrderChild extends BaseEntity
this.purchaseQuoteChildList = purchaseQuoteChildList; this.purchaseQuoteChildList = purchaseQuoteChildList;
} }
public String getWarehouseDept() {
return warehouseDept;
}
public void setWarehouseDept(String warehouseDept) {
this.warehouseDept = warehouseDept;
}
public void setPurchaseOrderChildId(Long purchaseOrderChildId) public void setPurchaseOrderChildId(Long purchaseOrderChildId)
{ {
this.purchaseOrderChildId = purchaseOrderChildId; this.purchaseOrderChildId = purchaseOrderChildId;

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

@ -60,6 +60,8 @@ public class PurchasePlanChild extends BaseEntity
@Excel(name = "物料的描述") @Excel(name = "物料的描述")
private String describe; private String describe;
@Excel(name = "物料单位")
private String unit;
@Excel(name = "物料入库部门") @Excel(name = "物料入库部门")
private String warehouseDept; private String warehouseDept;
@ -203,6 +205,15 @@ public class PurchasePlanChild extends BaseEntity
{ {
return describe; return describe;
} }
public String getUnit() {
return unit;
}
public void setUnit(String unit) {
this.unit = unit;
}
public void setMaterialNum(Long materialNum) public void setMaterialNum(Long materialNum)
{ {
this.materialNum = materialNum; this.materialNum = materialNum;

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

@ -17,6 +17,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="materialBrand" column="material_brand" /> <result property="materialBrand" column="material_brand" />
<result property="materialDescribe" column="material_describe" /> <result property="materialDescribe" column="material_describe" />
<result property="materialPhotourl" column="material_photoUrl" /> <result property="materialPhotourl" column="material_photoUrl" />
<result property="warehouseDept" column="warehouseDept" />
<result property="materialProcessMethod" column="material_process_method" /> <result property="materialProcessMethod" column="material_process_method" />
<result property="materialUnit" column="material_unit" /> <result property="materialUnit" column="material_unit" />
<result property="hasStorageNum" column="has_storage_num" /> <result property="hasStorageNum" column="has_storage_num" />
@ -50,7 +51,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select purchase_order_child_id, purchase_order_code, purchase_plan_code,purchase_plan_correlation_code, select purchase_order_child_id, purchase_order_code, purchase_plan_code,purchase_plan_correlation_code,
supplier_code, supplier_name, supplier_code, supplier_name,
material_code, material_name,material_type, material_describe,material_brand, material_code, material_name,material_type, material_describe,material_brand,
material_photoUrl, material_process_method,material_unit, material_photoUrl, material_process_method,material_unit,warehouseDept,
material_no_rmb, material_rmb, material_num, material_no_rmb, material_rmb, material_num,
material_amount, material_sum, material_no_rmb_sum, material_rmb_sum, material_amount, material_sum, material_no_rmb_sum, material_rmb_sum,
material_real_num, material_real_no_rmb, material_real_rmb, material_real_no_rmb_sum, material_real_num, material_real_no_rmb, material_real_rmb, material_real_no_rmb_sum,
@ -95,6 +96,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="materialPhotourl != null">material_photo_url,</if> <if test="materialPhotourl != null">material_photo_url,</if>
<if test="materialProcessMethod != null">material_process_method,</if> <if test="materialProcessMethod != null">material_process_method,</if>
<if test="materialUnit != null">material_unit,</if> <if test="materialUnit != null">material_unit,</if>
<if test="warehouseDept != null">warehouseDept,</if>
<if test="materialNoRmb != null">material_no_rmb,</if> <if test="materialNoRmb != null">material_no_rmb,</if>
<if test="materialRmb != null">material_rmb,</if> <if test="materialRmb != null">material_rmb,</if>
<if test="materialNum != null">material_num,</if> <if test="materialNum != null">material_num,</if>
@ -131,6 +133,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="materialPhotourl != null">#{materialPhotourl},</if> <if test="materialPhotourl != null">#{materialPhotourl},</if>
<if test="materialProcessMethod != null">#{materialProcessMethod},</if> <if test="materialProcessMethod != null">#{materialProcessMethod},</if>
<if test="materialUnit != null">#{materialUnit},</if> <if test="materialUnit != null">#{materialUnit},</if>
<if test="warehouseDept != null">#{warehouseDept},</if>
<if test="materialNoRmb != null">#{materialNoRmb},</if> <if test="materialNoRmb != null">#{materialNoRmb},</if>
<if test="materialRmb != null">#{materialRmb},</if> <if test="materialRmb != null">#{materialRmb},</if>
<if test="materialNum != null">#{materialNum},</if> <if test="materialNum != null">#{materialNum},</if>
@ -170,6 +173,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="materialPhotourl != null">material_photo_url = #{materialPhotourl}</if> <if test="materialPhotourl != null">material_photo_url = #{materialPhotourl}</if>
<if test="materialProcessMethod != null">material_process_method = #{materialProcessMethod},</if> <if test="materialProcessMethod != null">material_process_method = #{materialProcessMethod},</if>
<if test="materialUnit != null">material_unit = #{materialUnit},</if> <if test="materialUnit != null">material_unit = #{materialUnit},</if>
<if test="warehouseDept != null">warehouse_dept = #{warehouseDept},</if>
<if test="materialNoRmb != null">material_no_rmb = #{materialNoRmb},</if> <if test="materialNoRmb != null">material_no_rmb = #{materialNoRmb},</if>
<if test="materialRmb != null">material_rmb = #{materialRmb},</if> <if test="materialRmb != null">material_rmb = #{materialRmb},</if>
<if test="materialNum != null">material_num = #{materialNum},</if> <if test="materialNum != null">material_num = #{materialNum},</if>
@ -237,12 +241,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectPurhcaseOrderStorageByPurchaseOrderCode" parameterType="String" resultMap="PurchaseOrderChildResult"> <select id="selectPurhcaseOrderStorageByPurchaseOrderCode" parameterType="String" resultMap="PurchaseOrderChildResult">
select p.purchase_order_child_id,p.purchase_order_code,p.purchase_plan_code,p.purchase_plan_correlation_code, select p.purchase_order_child_id,p.purchase_order_code,p.purchase_plan_code,p.purchase_plan_correlation_code,
p.supplier_code,p.supplier_name,p.material_code,p.material_name,p.material_type,p.material_describe, p.supplier_code,p.supplier_name,p.material_code,p.material_name,p.material_type,p.material_describe,
p.material_brand,p.material_photo_url,p.material_process_method,p.material_unit,p.material_no_rmb, p.material_brand,p.material_photo_url,p.material_process_method,p.material_unit,p.warehouse_dept,p.material_no_rmb,
p.material_rmb,p.material_num,p.material_amount,p.material_sum,p.material_no_rmb_sum,p.material_rmb_sum, p.material_rmb,p.material_num,p.material_amount,p.material_sum,p.material_no_rmb_sum,p.material_rmb_sum,
p.material_real_num,p.material_real_no_rmb,p.material_real_rmb,p.material_real_no_rmb_sum,p.material_real_rmb_sum, p.material_real_num,p.material_real_no_rmb,p.material_real_rmb,p.material_real_no_rmb_sum,p.material_real_rmb_sum,
p.delivery_time,p.eceipt_status,p.payment_status,p.tax_rate,p.create_by,p.create_time,p.update_by,p.update_time,p.del_flag, p.delivery_time,p.eceipt_status,p.payment_status,p.tax_rate,p.create_by,p.create_time,p.update_by,p.update_time,p.del_flag,
(select w.has_storage_num from warehouse_storage_order_detail as w where w.material_no = p.material_code and w.related_order_code = p.purchase_order_code and w.supplier_code = p.supplier_code) as has_storage_num, (select sum(w.has_storage_num) from warehouse_storage_order_detail as w where w.material_no = p.material_code and w.related_order_code = p.purchase_order_code and w.supplier_code = p.supplier_code) as has_storage_num,
(select w.notify_has_arrived_num from warehouse_storage_order_detail as w where w.material_no = p.material_code and w.related_order_code = p.purchase_order_code and w.supplier_code = p.supplier_code) as notify_has_arrived_num (select sum(w.notify_has_arrived_num) from warehouse_storage_order_detail as w where w.material_no = p.material_code and w.related_order_code = p.purchase_order_code and w.supplier_code = p.supplier_code) as notify_has_arrived_num
from purchase_order_child as p where p.purchase_order_code = #{purchaseOrderCode}; from purchase_order_child as p where p.purchase_order_code = #{purchaseOrderCode};
</select> </select>
</mapper> </mapper>

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

@ -11,9 +11,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="materialName" column="material_name" /> <result property="materialName" column="material_name" />
<result property="materialType" column="material_type" /> <result property="materialType" column="material_type" />
<result property="processMethod" column="process_method" /> <result property="processMethod" column="process_method" />
<result property="unit" column="unit" />
<result property="brand" column="brand" /> <result property="brand" column="brand" />
<result property="photoUrl" column="photoUrl" /> <result property="photoUrl" column="photoUrl" />
<result property="describe" column="describe" /> <result property="describe" column="describe" />
<result property="warehouseDept" column="warehouseDept" />
<result property="materialNum" column="material_num" /> <result property="materialNum" column="material_num" />
<result property="materialSole" column="material_sole" /> <result property="materialSole" column="material_sole" />
<result property="materialRmb" column="material_rmb" /> <result property="materialRmb" column="material_rmb" />
@ -35,8 +37,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<sql id="selectPurchasePlanChildVo"> <sql id="selectPurchasePlanChildVo">
select purchase_plan_child_id, purchase_plan_code, material_id, select purchase_plan_child_id, purchase_plan_code, material_id,
material_code, material_name, material_type, process_method, brand, material_code, material_name, material_type, process_method, brand,unit,
photoUrl, `describe`, material_num, material_sole, material_rmb,supplier_code,supplier_name, photoUrl, `describe`, warehouseDept,material_num, material_sole, material_rmb,supplier_code,supplier_name,
material_noRmb, create_by, create_time, update_by, update_time, remark, material_noRmb, create_by, create_time, update_by, update_time, remark,
use_status, audit_status, del_flag from purchase_plan_child use_status, audit_status, del_flag from purchase_plan_child
</sql> </sql>
@ -52,6 +54,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="materialType != null and materialType != ''"> and material_type = #{materialType}</if> <if test="materialType != null and materialType != ''"> and material_type = #{materialType}</if>
<if test="processMethod != null and processMethod != ''"> and process_method = #{processMethod}</if> <if test="processMethod != null and processMethod != ''"> and process_method = #{processMethod}</if>
<if test="brand != null and brand != ''"> and brand = #{brand}</if> <if test="brand != null and brand != ''"> and brand = #{brand}</if>
<if test="warehouseDept != null and warehouseDept != ''">and warehouseDept = #{warehouseDept}</if>
<if test="useStatus != null and useStatus != ''"> and use_status = #{useStatus}</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="auditStatus != null and auditStatus != ''"> and audit_status = #{auditStatus}</if>
</where> </where>
@ -82,6 +85,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="brand != null">brand,</if> <if test="brand != null">brand,</if>
<if test="photoUrl != null">photoUrl,</if> <if test="photoUrl != null">photoUrl,</if>
<if test="describe != null">`describe`,</if> <if test="describe != null">`describe`,</if>
<if test="unit != null">unit,</if>
<if test="warehouseDept != null">warehouse_dept,</if>
<if test="materialNum != null">material_num,</if> <if test="materialNum != null">material_num,</if>
<if test="materialSole != null">material_sole,</if> <if test="materialSole != null">material_sole,</if>
<if test="materialRmb != null">material_rmb,</if> <if test="materialRmb != null">material_rmb,</if>
@ -105,6 +110,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="brand != null">#{brand},</if> <if test="brand != null">#{brand},</if>
<if test="photoUrl != null">#{photoUrl},</if> <if test="photoUrl != null">#{photoUrl},</if>
<if test="describe != null">#{describe},</if> <if test="describe != null">#{describe},</if>
<if test="unit != null">#{unit},</if>
<if test="warehouseDept != null">#{warehouseDept},</if>
<if test="materialNum != null">#{materialNum},</if> <if test="materialNum != null">#{materialNum},</if>
<if test="materialSole != null">#{materialSole},</if> <if test="materialSole != null">#{materialSole},</if>
<if test="materialRmb != null">#{materialRmb},</if> <if test="materialRmb != null">#{materialRmb},</if>
@ -132,6 +139,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="brand != null">brand = #{brand},</if> <if test="brand != null">brand = #{brand},</if>
<if test="photoUrl != null">photoUrl = #{photoUrl},</if> <if test="photoUrl != null">photoUrl = #{photoUrl},</if>
<if test="describe != null">`describe` = #{describe},</if> <if test="describe != null">`describe` = #{describe},</if>
<if test="unit != null">unit = #{unit},</if>
<if test="warehouseDept != null">warehouse_dept = #{warehouseDept},</if>
<if test="materialNum != null">material_num = #{materialNum},</if> <if test="materialNum != null">material_num = #{materialNum},</if>
<if test="materialSole != null">material_sole = #{materialSole},</if> <if test="materialSole != null">material_sole = #{materialSole},</if>
<if test="materialRmb != null">material_rmb = #{materialRmb},</if> <if test="materialRmb != null">material_rmb = #{materialRmb},</if>
@ -212,6 +221,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
planChild.process_method, planChild.process_method,
planChild.brand, planChild.brand,
planChild.photoUrl, planChild.photoUrl,
planChild.unit,
planChild.warehouseDept,
sum(planChild.material_num) as material_num, sum(planChild.material_num) as material_num,
GROUP_CONCAT(DISTINCT plan.correlation_code ORDER BY plan.correlation_code) AS correlation_codes, GROUP_CONCAT(DISTINCT plan.correlation_code ORDER BY plan.correlation_code) AS correlation_codes,
GROUP_CONCAT(DISTINCT plan.purchase_plan_code ORDER BY plan.purchase_plan_code) AS purchase_plan_codes GROUP_CONCAT(DISTINCT plan.purchase_plan_code ORDER BY plan.purchase_plan_code) AS purchase_plan_codes

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

@ -85,6 +85,7 @@
var auditStatusDatas = [[${@dict.getType('auditStatus')}]]; var auditStatusDatas = [[${@dict.getType('auditStatus')}]];
var sysUnitClassDatas = [[${@dict.getType('sys_unit_class')}]]; var sysUnitClassDatas = [[${@dict.getType('sys_unit_class')}]];
var processMethodDatas = [[${@dict.getType('processMethod')}]]; var processMethodDatas = [[${@dict.getType('processMethod')}]];
var warehouseDeptDatas = [[${@dict.getType('warehouseDept')}]];
var loginName = [[${@permission.getPrincipalProperty('loginName')}]]; var loginName = [[${@permission.getPrincipalProperty('loginName')}]];
$("#form-plan-purchaseOrder-add").validate({focusCleanup: true}); $("#form-plan-purchaseOrder-add").validate({focusCleanup: true});
var purchasePlanChildList = [[${purchasePlanChildList}]]; var purchasePlanChildList = [[${purchasePlanChildList}]];
@ -136,6 +137,7 @@
brand: material.brand, brand: material.brand,
processMethod: material.processMethod, processMethod: material.processMethod,
unit: material.unit, unit: material.unit,
warehouseDept:material.warehouseDept,
materialNum: material.materialNum, materialNum: material.materialNum,
}; };
var materialData = [materialObj]; // Bootstrap Table需要一个数组作为数据源 var materialData = [materialObj]; // Bootstrap Table需要一个数组作为数据源
@ -311,29 +313,28 @@
columns: [ columns: [
{checkbox: false}, {checkbox: false},
{title: '料号', field: 'materialCode'}, {title: '料号', field: 'materialCode'},
{ {title: '图片', field: 'photoUrl', formatter: function (value, row, index) {
title: '图片', field: 'photoUrl', formatter: function (value, row, index) {
return $.table.imageView(value); return $.table.imageView(value);
} }
}, },
{title: '物料名称', field: 'materialName'}, {title: '物料名称', field: 'materialName'},
{ {title: '物料类型', field: 'materialType', align: 'center', formatter: function (value, row, index) {
title: '物料类型', field: 'materialType', align: 'center', formatter: function (value, row, index) {
return $.table.selectCategoryLabel(materialTypeDatas, value); return $.table.selectCategoryLabel(materialTypeDatas, value);
} }
}, },
{title: '物料描述', field: 'describe'}, {title: '物料描述', field: 'describe'},
{title: '品牌', field: 'brand'}, {title: '品牌', field: 'brand'},
{ {title: '加工类型', field: 'processMethod', align: 'center', formatter: function (value, row, index) {
title: '加工类型', field: 'processMethod', align: 'center', formatter: function (value, row, index) {
return $.table.selectDictLabel(processMethodDatas, value); return $.table.selectDictLabel(processMethodDatas, value);
} }
}, },
{ {title: '单位', field: 'unit', align: 'center', formatter: function (value, row, index) {
title: '单位', field: 'unit', align: 'center', formatter: function (value, row, index) {
return $.table.selectDictLabel(sysUnitClassDatas, value); return $.table.selectDictLabel(sysUnitClassDatas, value);
} }
}, },
{title: '入库部门', field: 'warehouseDept', align: 'center', formatter: function (value, row, index) {
return $.table.selectDictLabel(warehouseDeptDatas, value);
}},
{title: '计划采购数', field: 'materialNum'}, {title: '计划采购数', field: 'materialNum'},
], ],
}); });
@ -372,6 +373,8 @@
materialDescribe: materialObj.describe, materialDescribe: materialObj.describe,
materialProcessMethod:materialObj.processMethod, materialProcessMethod:materialObj.processMethod,
materialUnit:materialObj.unit, materialUnit:materialObj.unit,
materialPhotoUrl: materialObj.photoUrl,
warehouseDept: materialObj.warehouseDept,
materialNum: materialObj.materialNum, materialNum: materialObj.materialNum,
supplierCode: supplierCode, supplierCode: supplierCode,
supplierName: supplierName, supplierName: supplierName,

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

@ -131,9 +131,7 @@
method: 'post', method: 'post',
sidePagination: "server", sidePagination: "server",
contentType: "application/x-www-form-urlencoded", contentType: "application/x-www-form-urlencoded",
queryParams : { queryParams : {purchasePlanCode: row.purchasePlanCode},
purchasePlanCode: row.purchasePlanCode
},
columns: [ columns: [
{field: 'purchasePlanId',title: '主键id',visible: false}, {field: 'purchasePlanId',title: '主键id',visible: false},
{field: 'materialCode',title: '料号',}, {field: 'materialCode',title: '料号',},
@ -152,24 +150,23 @@
{field: 'unit',title: '单位', {field: 'unit',title: '单位',
formatter: function(value, row, index) {return $.table.selectDictLabel(sysUnitClassDatas, value);} formatter: function(value, row, index) {return $.table.selectDictLabel(sysUnitClassDatas, value);}
}, },
{field: 'planNum',title: '计划采购数', {field: 'warehouseDept',title: '入库部门',visible: false},
formatter: function(value, row, index) {return $.table.selectDictLabel(sysUnitClassDatas, value);} {field: 'materialNum',title: '计划采购数',},
},
] ]
}); });
}; };
var purchasePlanCodes = ""; var purchasePlanCodes = "";
function addPurchaseOrder(){ function addPurchaseOrder(){
var selections = $("#bootstrap-table").bootstrapTable("getSelections"); var selections = $("#bootstrap-table").bootstrapTable("getSelections");
if(selections.length == 0){ if(selections.length === 0){
$.modal.alertWarning("请选择采购计划单"); $.modal.alertWarning("请选择采购计划单");
return; return;
}else{ }else{
if(selections.length > 1 ){ if(selections.length > 1 ){
//·拼接采购计划单号 //·拼接采购计划单号
for(var i=0;i<selections.length;i++){ for(let i=0;i<selections.length;i++){
purchasePlanCodes += selections[i].purchasePlanCode + ","; purchasePlanCodes += selections[i].purchasePlanCode + ",";
if(i == selections.length - 1){ if(i === selections.length - 1){
purchasePlanCodes += selections[i].purchasePlanCode ; purchasePlanCodes += selections[i].purchasePlanCode ;
} }
} }

Loading…
Cancel
Save