Browse Source

[fix]工程管理

修改bom的Controller层的getCateMaterialSelList方法,改调用mpper层的方法为调用service层的方法;
修改bom的mapper.xml层的selectCateErpMaterialList和searchMaterialsByPrefix方法,去掉限制物料类型的关联查询
bom的service层新增searchMaterialsByPrefix和selectCateErpMaterialList接口,处理bom只能添加5、6、7、8、9开头的物料
dev
liuxiaoxu 4 weeks ago
parent
commit
30a99da694
  1. 4
      ruoyi-admin/src/main/java/com/ruoyi/erp/controller/ErpMaterialController.java
  2. 16
      ruoyi-admin/src/main/java/com/ruoyi/erp/service/IErpMaterialService.java
  3. 40
      ruoyi-admin/src/main/java/com/ruoyi/erp/service/impl/ErpMaterialServiceImpl.java
  4. 22
      ruoyi-admin/src/main/resources/mapper/erp/ErpMaterialMapper.xml
  5. 2
      ruoyi-admin/src/main/resources/templates/erp/bom/add.html

4
ruoyi-admin/src/main/java/com/ruoyi/erp/controller/ErpMaterialController.java

@ -502,9 +502,9 @@ public class ErpMaterialController extends BaseController
@ResponseBody @ResponseBody
public AjaxResult getCateMaterialSelList(@RequestParam(value = "q",defaultValue = "") String prefix){ public AjaxResult getCateMaterialSelList(@RequestParam(value = "q",defaultValue = "") String prefix){
if (prefix == null || prefix.isEmpty()){ if (prefix == null || prefix.isEmpty()){
return success(erpMaterialMapper.selectCateErpMaterialList()); return success(erpMaterialService.selectCateErpMaterialList());
} }
return success(erpMaterialMapper.searchMaterialsByPrefix(prefix)); return success(erpMaterialService.searchMaterialsByPrefix(prefix));
} }
@GetMapping ("/getEngineerList") @GetMapping ("/getEngineerList")

16
ruoyi-admin/src/main/java/com/ruoyi/erp/service/IErpMaterialService.java

@ -49,6 +49,22 @@ public interface IErpMaterialService
*/ */
public List<ErpMaterialVo> selectAllErpMaterialListWithBom(ErpMaterial erpMaterial); public List<ErpMaterialVo> selectAllErpMaterialListWithBom(ErpMaterial erpMaterial);
/**
* 查询所有通过审核的半成品和成品物料的信息
*
* @return 物料信息集合
*/
public List<ErpMaterialVo> selectCateErpMaterialList();
/**
* 根据料号前缀查询匹配物料
*
* @return 物料信息集合
*/
public List<ErpMaterialVo> searchMaterialsByPrefix(String prefix);
/** /**
* 新增物料信息 * 新增物料信息
* *

40
ruoyi-admin/src/main/java/com/ruoyi/erp/service/impl/ErpMaterialServiceImpl.java

@ -50,6 +50,7 @@ import org.springframework.util.CollectionUtils;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
/** /**
* 物料信息Service业务层处理 * 物料信息Service业务层处理
@ -253,6 +254,45 @@ public class ErpMaterialServiceImpl implements IErpMaterialService
/**
* 查询所有通过审核的半成品和成品物料的信息
*
* @return 物料信息集合
*/
@Override
public List<ErpMaterialVo> selectCateErpMaterialList(){
List<ErpMaterialVo> erpMaterialVos = erpMaterialMapper.selectCateErpMaterialList();
List<ErpMaterialVo> collect = erpMaterialVos.stream().filter(
material -> material.getMaterialNo().startsWith("5") ||
material.getMaterialNo().startsWith("6") ||
material.getMaterialNo().startsWith("7") ||
material.getMaterialNo().startsWith("8") ||
material.getMaterialNo().startsWith("9")
).collect(Collectors.toList());
return collect;
};
/**
* 根据料号前缀查询匹配物料
*
* @return 物料信息集合
*/
@Override
public List<ErpMaterialVo> searchMaterialsByPrefix(String prefix){
List<ErpMaterialVo> erpMaterialVos = erpMaterialMapper.searchMaterialsByPrefix(prefix);
List<ErpMaterialVo> collect = erpMaterialVos.stream().filter(
material -> material.getMaterialNo().startsWith("5") ||
material.getMaterialNo().startsWith("6") ||
material.getMaterialNo().startsWith("7") ||
material.getMaterialNo().startsWith("8") ||
material.getMaterialNo().startsWith("9")
).collect(Collectors.toList());
return collect;
};
/** /**
* 新增物料信息 * 新增物料信息
* *

22
ruoyi-admin/src/main/resources/mapper/erp/ErpMaterialMapper.xml

@ -177,16 +177,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select erp.id, erp.del_flag, erp.create_by, erp.remark,erp.bomNo, erp.material_no, select erp.id, erp.del_flag, erp.create_by, erp.remark,erp.bomNo, erp.material_no,
erp.material_name, erp.audit_status, erp.use_status, erp.hava_product_tem, erp.material_name, erp.audit_status, erp.use_status, erp.hava_product_tem,
erp.material_type, erp.process_method, erp.unit,erp.material_model, erp.brand, erp.`describe`, erp.material_type, erp.process_method, erp.unit,erp.material_model, erp.brand, erp.`describe`,
erp.warehouse_dept,erp.business_members,cate.parent_id,cate.name as material_type_name erp.warehouse_dept,erp.business_members
from erp_material erp from erp_material erp
left join ( where erp.audit_status = '1' and erp.use_status = '1'
select code,name,parent_id from sys_category
where parent_id in(
select id from sys_category
where parent_id = (select id from sys_category where code = 'materialType') )
)cate on erp.material_type = cate.code
where cate.parent_id in (select id from sys_category where code in ('cp','bcp'))
and erp.audit_status = '1' and erp.use_status = '1'
</select> </select>
<select id="selectAllErpMaterialListByMaterialVo" parameterType="ErpMaterial" resultMap="ErpMaterialResult"> <select id="selectAllErpMaterialListByMaterialVo" parameterType="ErpMaterial" resultMap="ErpMaterialResult">
@ -350,16 +343,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select erp.id, erp.del_flag, erp.create_by, erp.remark,erp.bomNo, erp.material_no, select erp.id, erp.del_flag, erp.create_by, erp.remark,erp.bomNo, erp.material_no,
erp.material_name, erp.audit_status, erp.use_status, erp.hava_product_tem, erp.material_name, erp.audit_status, erp.use_status, erp.hava_product_tem,
erp.material_type, erp.process_method, erp.unit, erp.material_model, erp.brand, erp.`describe`, erp.material_type, erp.process_method, erp.unit, erp.material_model, erp.brand, erp.`describe`,
erp.warehouse_dept,erp.business_members,cate.parent_id,cate.name as material_type_name erp.warehouse_dept,erp.business_members
from erp_material erp from erp_material erp
left join ( where erp.audit_status = '1' and erp.use_status = '1'
select code,name,parent_id from sys_category
where parent_id in(
select id from sys_category
where parent_id = (select id from sys_category where code = 'materialType') )
)cate on erp.material_type = cate.code
where cate.parent_id in (select id from sys_category where code in ('cp','bcp'))
and erp.audit_status = '1' and erp.use_status = '1'
and material_no like concat(#{prefix}, '%') escape '\\' and material_no like concat(#{prefix}, '%') escape '\\'
</select> </select>

2
ruoyi-admin/src/main/resources/templates/erp/bom/add.html

@ -289,6 +289,8 @@
align: 'center', align: 'center',
title: '描述' title: '描述'
}, },
{title: '型号',field: 'materialModel',align: 'center',
},
{ {
field: 'brand', field: 'brand',
align: 'center', align: 'center',

Loading…
Cancel
Save