Browse Source

[fix]工程管理

去掉生产订单部门评审的bom信息展示
新增查询bom所有阶列表 其他订单关联bom信息列表后端接口
工程审核页面bom信息列表新增使用状态和审核状态字段;修改bom的查询接口并且新增 使用状态和审核状态作为判断
修改生产订单部门评审后端接口修改查询一阶物料信息和对bom信息不完整的进行提示补全;
修改销售订单子表关联bom表的后端查询接口:新增查询bom表的使用状态和审核状态字段
dev
liuxiaoxu 1 month ago
parent
commit
af5b92e5ac
  1. 15
      ruoyi-admin/src/main/java/com/ruoyi/erp/controller/ErpBomController.java
  2. 6
      ruoyi-admin/src/main/java/com/ruoyi/erp/mapper/ErpBomMapper.java
  3. 7
      ruoyi-admin/src/main/java/com/ruoyi/erp/service/IErpBomService.java
  4. 38
      ruoyi-admin/src/main/java/com/ruoyi/erp/service/impl/ErpBomServiceImpl.java
  5. 18
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysMakeOrderServiceImpl.java
  6. 6
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesOrderChildServiceImpl.java
  7. 34
      ruoyi-admin/src/main/resources/mapper/erp/ErpBomMapper.xml
  8. 4
      ruoyi-admin/src/main/resources/mapper/system/SysSalesOrderChildMapper.xml
  9. 304
      ruoyi-admin/src/main/resources/templates/system/makeorder/bmzgqr.html
  10. 19
      ruoyi-admin/src/main/resources/templates/system/makeorder/gcsh.html

15
ruoyi-admin/src/main/java/com/ruoyi/erp/controller/ErpBomController.java

@ -136,6 +136,21 @@ public class ErpBomController extends BaseController
return getDataTable(list);
}
/**
* 查询bom所有阶列表 其他订单关联bom信息列表
*/
@PostMapping("/otherOrderAllLevelList")
@ResponseBody
public TableDataInfo otherOrderAllLevelList(ErpBom erpBom)
{
startPage();
List<ErpBom> list = erpBomService.selectOtherOrderErpBomAllLevelList(erpBom);
return getDataTable(list);
}
/**
* 导出bom列表
*/

6
ruoyi-admin/src/main/java/com/ruoyi/erp/mapper/ErpBomMapper.java

@ -38,6 +38,12 @@ public interface ErpBomMapper
List<ErpBom> selectErpBomSubList(ErpBom erpBom);
/**
* 查询一阶集合 其他订单引用bom
* */
List<ErpBom> selectOtherOrderErpBomSubList(ErpBom erpBom);
/**
* 新增bom
*

7
ruoyi-admin/src/main/java/com/ruoyi/erp/service/IErpBomService.java

@ -37,6 +37,13 @@ public interface IErpBomService
List<ErpBom> selectErpBomAllLevelList(ErpBom erpBom);
/**
* 其他订单关联bom信息列表
* */
List<ErpBom> selectOtherOrderErpBomAllLevelList(ErpBom erpBom);
void recursionSubBom(List<ErpBom> resultList, String materialNo, Long level);
List<Long> getAllParentIds(List<ErpBomVo> startIds);

38
ruoyi-admin/src/main/java/com/ruoyi/erp/service/impl/ErpBomServiceImpl.java

@ -34,6 +34,7 @@ import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.util.*;
import java.util.stream.Collectors;
/**
* bomService业务层处理
@ -189,6 +190,43 @@ private ISysAttachService attachService;
return resultList;
}
/**
* 其他订单关联bom信息列表
* */
@Override
public List<ErpBom> selectOtherOrderErpBomAllLevelList(ErpBom erpBom) {
List<ErpBom> resultList = new ArrayList<>();
//先判断当前父亲节点的bom是否审核通过
Long parentId = erpBom.getParentId();
//父节点的id
Long id = parentId;
ErpBomVo erpBomVo = erpBomMapper.selectErpBomById(id);
if (!"1".equals(erpBomVo.getAuditStatus()) && !"1".equals(erpBomVo.getUseStatus())){
return resultList;
}
//List<ErpBom> filterOneLevelList = oneLevelList.stream().filter(bom -> "1".equals(bom.getUseStatus()) && "1".equals(bom.getAuditStatus())).collect(Collectors.toList());
// 一阶集合
List<ErpBom> oneLevelList = erpBomMapper.selectOtherOrderErpBomSubList(erpBom);
if(CollectionUtils.isNotEmpty(oneLevelList)){
for (ErpBom bom: oneLevelList) {
resultList.add(bom);
String materialNo = bom.getMaterialNo();
Long level = bom.getLevel();
recursionSubBom(resultList, materialNo, level);
}
}
return resultList;
}
@Override
public void recursionSubBom(List<ErpBom> resultList, String materialNo, Long level) {
ErpBom subBom = erpBomMapper.selectErpBomByOneMaterialNo(materialNo);

18
ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysMakeOrderServiceImpl.java

@ -282,7 +282,7 @@ public class SysMakeOrderServiceImpl implements ISysMakeOrderService
// 查询1阶及以下
ErpBom oneLevelBom = new ErpBom();
oneLevelBom.setParentId(id);
List<ErpBom> subBomList = erpBomService.selectErpBomAllLevelList(oneLevelBom);
List<ErpBom> subBomList = erpBomService.selectOtherOrderErpBomAllLevelList(oneLevelBom);
for (int j = 0; j < subBomList.size(); j++) {
ErpBom subBom = subBomList.get(j);
SysMakeorderBom orderBom = new SysMakeorderBom();
@ -299,21 +299,7 @@ public class SysMakeOrderServiceImpl implements ISysMakeOrderService
insertedSysMakeorderBoms.add(orderBom);
}
}else {
ErpBom oneLevelBom = new ErpBom();
List<ErpBom> subBomList = erpBomService.selectErpBomAllLevelList(oneLevelBom);
for (int j = 0; j < subBomList.size(); j++) {
ErpBom subBom = subBomList.get(j);
SysMakeorderBom orderBom = new SysMakeorderBom();
BeanUtils.copyProperties(subBom,orderBom, "id","delFlag","createBy","createTime","updateBy","updateTime","remark");
orderBom.setMakeNo(makeNo);
orderBom.setSalesOrderCode(saleNo);
orderBom.setSalesOrderMaterialNo(materialCode);
orderBom.setLossRate(subBom.getLossRate());
sortNo++;
orderBom.setSortNo(sortNo);
makeorderBomService.insertSysMakeorderBom(orderBom);
insertedSysMakeorderBoms.add(orderBom);
}
throw new BusinessException("料号为"+materialCode+"的Bom信息不全,请补充!");
}
}

6
ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesOrderChildServiceImpl.java

@ -5,8 +5,10 @@ import com.ruoyi.system.mapper.SysSalesOrderChildMapper;
import com.ruoyi.system.service.ISysSalesOrderChildService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.List;
import java.util.stream.Collectors;
@Service
public class SysSalesOrderChildServiceImpl implements ISysSalesOrderChildService {
@ -14,7 +16,9 @@ public class SysSalesOrderChildServiceImpl implements ISysSalesOrderChildService
private SysSalesOrderChildMapper sysCustomerQuoteChildMapper;
@Override
public List<SysSalesOrderChild> selectSysSalesOrderChildList (SysSalesOrderChild sysCustomerQuoteChild) {
return sysCustomerQuoteChildMapper.selectSysSalesOrderChildList(sysCustomerQuoteChild);
List<SysSalesOrderChild> sysSalesOrderChildren = sysCustomerQuoteChildMapper.selectSysSalesOrderChildList(sysCustomerQuoteChild);
return sysSalesOrderChildren;
}
@Override
public List<SysSalesOrderChild> selectSysSalesOrderChildListAll (SysSalesOrderChild sysCustomerQuoteChild) {

34
ruoyi-admin/src/main/resources/mapper/erp/ErpBomMapper.xml

@ -210,6 +210,40 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
order by sort_no asc
</select>
<select id="selectOtherOrderErpBomSubList" parameterType="ErpBom" resultMap="ErpBomResult">
<include refid="selectErpBomVo"/>
<where>
<if test="id != null "> and id = #{id}</if>
<if test="delFlag != null and delFlag != ''"> and del_flag = #{delFlag}</if>
<if test="createBy != null and createBy != ''"> and create_by = #{createBy}</if>
<if test="createTime != null "> and create_time = #{createTime}</if>
<if test="updateBy != null and updateBy != ''"> and update_by = #{updateBy}</if>
<if test="updateTime != null "> and update_time = #{updateTime}</if>
<if test="remark != null and remark != ''"> and remark = #{remark}</if>
<if test="bomNo != null and bomNo != ''"> and bom_no = #{bomNo}</if>
<if test="materialNo != null and materialNo != ''"> and material_no = #{materialNo}</if>
<if test="materialName != null and materialName != ''"> and material_name like concat('%', #{materialName}, '%')</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="unit != null and unit != ''"> and unit = #{unit}</if>
<if test="brand != null and brand != ''"> and brand = #{brand}</if>
<if test="describe != null and describe != ''"> and `describe` = #{describe}</if>
<if test="warehouseDept != null and warehouseDept != ''"> and warehouseDept = #{warehouseDept}</if>
<if test="engineer != null and engineer != ''"> and engineer = #{engineer}</if>
<if test="useNum != null "> and use_num = #{useNum}</if>
<if test="lossRate != null "> and loss_rate = #{lossRate}</if>
<if test="parentId != null "> and parent_id = #{parentId}</if>
<if test="level != null "> and level = #{level}</if>
<if test="sortNo != null "> and sort_no = #{sortNo}</if>
</where>
order by sort_no asc
</select>
<insert id="insertErpBom" parameterType="ErpBom" useGeneratedKeys="true" keyProperty="id">
insert into erp_bom
<trim prefix="(" suffix=")" suffixOverrides=",">

4
ruoyi-admin/src/main/resources/mapper/system/SysSalesOrderChildMapper.xml

@ -52,8 +52,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
a.warehouseDept,a.countTax, a.usdTax, a.materialNum,a.materialSole, a.materialRmb, a.materialNoRmb, a.materialNoUsd, a.materialUsd, a.materialUsdSum,
a.materialNoUsdSum, a.materialNoRmbSum, a.materialRmbSum,a.delivery_time, a.expiry_day,
a.out_bound_quantity, a.un_bound_quantity, a.create_by, a.create_time, a.update_by,
a.update_time, a.remark, a.use_status,a.audit_status
,b.id as bom_id
a.update_time, a.remark
,b.id as bom_id,b.use_status, b.audit_status
from sys_sales_order_child a
left join erp_bom b
on a.materialCode = b.material_no

304
ruoyi-admin/src/main/resources/templates/system/makeorder/bmzgqr.html

@ -167,158 +167,158 @@
// $detail.html('<form id="'+childTableFormId+'"><table id="'+childTableId+'"></table><table id="'+childFormTableId+'"></table></form>');
$detail.html('<table id="'+childTableId+'"></table><table id="'+childFormTableId+'"></table>');
// BOM展示
$('#'+childTableId).bootstrapTable({
url: ctx + "erp/bom/allLevelList",
method: 'post',
sidePagination: "server",
contentType: "application/x-www-form-urlencoded",
queryParams : {
parentId: parentRow.bomId
},
columns: [{
field: 'id',
title: '主键id',
visible: false
},
{
field: 'level',
title: '阶层',
formatter: function(value, row, index) {
return $.table.selectDictLabel(levelDatas, value);
}
},
{
field: 'bomNo',
title: 'BOM号',
formatter:function (value,row,index){
if (value == null || value == ''){
return '/';
}else{
return value
}
}
},
{
field: 'materialNo',
title: '料号',
formatter: function (value,row,index){
if (value == null || value == ''){
return '/';
}else{
return value
}
}
},
{
field: 'photoUrl',
title: '图片',
formatter: function(value, row, index) {
return $.table.imageView(value);
}
},
{
field: 'materialName',
title: '物料名称',
formatter: function (value,row,index){
if (value == null || value == ''){
return '/';
}else{
return value
}
}
},
{
field: 'materialType',
title: '物料类型',
formatter: function(value, row, index) {
return $.table.selectCategoryLabel(materialTypeDatas, value);
}
},
{
field: 'describe',
title: '描述',
formatter: function (value,row,index){
if (value == null || value == ''){
return '/';
}else{
return value
}
}
},
{
field: 'brand',
title: '品牌',
formatter: function (value,row,index){
if (value == null || value == ''){
return '/';
}else{
return value
}
}
},
{
field: 'unit',
title: '单位',
formatter: function (value,row,index){
if (value == null || value == ''){
return '/';
}else{
return value
}
}
},
{
field: 'processMethod',
title: '半成品类型',
formatter: function(value, row, index) {
return $.table.selectDictLabel(processMethodDatas, value);
}
},
{
field: 'useNum',
title: '用量',
formatter: function (value,row,index){
if (value == null || value == ''){
return '/';
}else{
return value
}
}
},
{
field: 'lossRate',
title: '损耗率',
// formatter: function (value,row,index){
// if (value == null || value == ''){
// return '/';
// }else{
// return value + "%";
// }
// }
},
{
field: 'materialNum',
title: '订单用量',
formatter: function (value,row,index){
return parentRow.materialNum * row.useNum;
}
},
{
field: 'parentId',
title: '父级id',
visible: false,
},
{
field: 'sortNo',
title: '排序',
visible: false
}],
// 当所有数据被加载时触发
onLoadSuccess: function(data) {
},
});
// $('#'+childTableId).bootstrapTable({
// url: ctx + "erp/bom/allLevelList",
// method: 'post',
// sidePagination: "server",
// contentType: "application/x-www-form-urlencoded",
// queryParams : {
// parentId: parentRow.bomId
// },
// columns: [{
// field: 'id',
// title: '主键id',
// visible: false
// },
// {
// field: 'level',
// title: '阶层',
// formatter: function(value, row, index) {
// return $.table.selectDictLabel(levelDatas, value);
// }
// },
// {
// field: 'bomNo',
// title: 'BOM号',
// formatter:function (value,row,index){
// if (value == null || value == ''){
// return '/';
// }else{
// return value
// }
// }
// },
// {
// field: 'materialNo',
// title: '料号',
// formatter: function (value,row,index){
// if (value == null || value == ''){
// return '/';
// }else{
// return value
// }
// }
// },
// {
// field: 'photoUrl',
// title: '图片',
// formatter: function(value, row, index) {
// return $.table.imageView(value);
// }
// },
// {
// field: 'materialName',
// title: '物料名称',
// formatter: function (value,row,index){
// if (value == null || value == ''){
// return '/';
// }else{
// return value
// }
// }
// },
// {
// field: 'materialType',
// title: '物料类型',
// formatter: function(value, row, index) {
// return $.table.selectCategoryLabel(materialTypeDatas, value);
// }
// },
// {
// field: 'describe',
// title: '描述',
// formatter: function (value,row,index){
// if (value == null || value == ''){
// return '/';
// }else{
// return value
// }
// }
// },
// {
// field: 'brand',
// title: '品牌',
// formatter: function (value,row,index){
// if (value == null || value == ''){
// return '/';
// }else{
// return value
// }
// }
// },
// {
// field: 'unit',
// title: '单位',
// formatter: function (value,row,index){
// if (value == null || value == ''){
// return '/';
// }else{
// return value
// }
// }
// },
//
// {
// field: 'processMethod',
// title: '半成品类型',
// formatter: function(value, row, index) {
// return $.table.selectDictLabel(processMethodDatas, value);
// }
// },
// {
// field: 'useNum',
// title: '用量',
// formatter: function (value,row,index){
// if (value == null || value == ''){
// return '/';
// }else{
// return value
// }
// }
// },
// {
// field: 'lossRate',
// title: '损耗率',
// // formatter: function (value,row,index){
// // if (value == null || value == ''){
// // return '/';
// // }else{
// // return value + "%";
// // }
// // }
// },
// {
// field: 'materialNum',
// title: '订单用量',
// formatter: function (value,row,index){
// return parentRow.materialNum * row.useNum;
// }
// },
// {
// field: 'parentId',
// title: '父级id',
// visible: false,
// },
// {
// field: 'sortNo',
// title: '排序',
// visible: false
// }],
// // 当所有数据被加载时触发
// onLoadSuccess: function(data) {
//
// },
// });
// 预审部门展示
$('#'+childFormTableId).bootstrapTable({
url: ctx + "system/makeorderdept/list",

19
ruoyi-admin/src/main/resources/templates/system/makeorder/gcsh.html

@ -152,6 +152,18 @@
field: 'materialNum',
align: 'center',
title: '订单数量'
},
{
field: 'useStatus',
align: 'center',
title: '使用状态',
visible: false
},
{
field: 'auditStatus',
align: 'center',
title: '审核状态',
visible: false
}
]
};
@ -168,12 +180,15 @@
$detail.html('<table id="'+childTableId+'"></table><table id="'+childFormTableId+'"></table>');
// BOM展示
$('#'+childTableId).bootstrapTable({
url: ctx + "erp/bom/allLevelList",
url: ctx + "erp/bom/otherOrderAllLevelList",
method: 'post',
sidePagination: "server",
contentType: "application/x-www-form-urlencoded",
queryParams : {
parentId: parentRow.bomId
parentId: parentRow.bomId,
useStatus:parentRow.useStatus,
auditStatus:parentRow.auditStatus,
// materialNo: parentRow.materialCode
},
columns: [{
field: 'id',

Loading…
Cancel
Save