Browse Source

[fix]工程管理:

更改 条件搜索框缺少“供应商下拉框” 的bug
修改前端代码,给数据库新增字段。修改后端代码,新增后端方法
物料信息的详情不合理修改一下
更改 列表字段“是否有生产团队”修改为“是否有技术团队” 的bug
dev
liuxiaoxu 7 months ago
parent
commit
a99c837b22
  1. 2
      ruoyi-admin/src/main/java/com/ruoyi/erp/controller/ErpBomController.java
  2. 7
      ruoyi-admin/src/main/java/com/ruoyi/erp/controller/ErpMaterialController.java
  3. 2
      ruoyi-admin/src/main/java/com/ruoyi/erp/domain/ErpBom.java
  4. 24
      ruoyi-admin/src/main/java/com/ruoyi/erp/domain/ErpMaterial.java
  5. 2
      ruoyi-admin/src/main/java/com/ruoyi/erp/service/IErpBomService.java
  6. 6
      ruoyi-admin/src/main/java/com/ruoyi/erp/service/impl/ErpBomServiceImpl.java
  7. 5
      ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysSupplierMapper.java
  8. 5
      ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysSupplierService.java
  9. 11
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSupplierServiceImpl.java
  10. 16
      ruoyi-admin/src/main/resources/mapper/erp/ErpMaterialMapper.xml
  11. 5
      ruoyi-admin/src/main/resources/mapper/system/SysSupplierMapper.xml
  12. 26
      ruoyi-admin/src/main/resources/templates/erp/material/add.html
  13. 2
      ruoyi-admin/src/main/resources/templates/erp/material/detail.html
  14. 9
      ruoyi-admin/src/main/resources/templates/erp/material/edit.html
  15. 34
      ruoyi-admin/src/main/resources/templates/erp/material/material.html

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

@ -121,7 +121,7 @@ public class ErpBomController extends BaseController
@Log(title = "ErpBom", businessType = BusinessType.EXPORT) @Log(title = "ErpBom", businessType = BusinessType.EXPORT)
@PostMapping("/export") @PostMapping("/export")
@ResponseBody @ResponseBody
public AjaxResult export(ErpBom erpBom) public AjaxResult export(ErpBomVo erpBom)
{ {
erpBom.setParentId(0L); erpBom.setParentId(0L);
List<ErpBom> list = erpBomService.getExportList(erpBom); List<ErpBom> list = erpBomService.getExportList(erpBom);

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

@ -8,6 +8,7 @@ import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.ShiroUtils; import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.erp.domain.ErpBom;
import com.ruoyi.erp.domain.ErpMaterial; import com.ruoyi.erp.domain.ErpMaterial;
import com.ruoyi.erp.domain.ErpMaterialVo; import com.ruoyi.erp.domain.ErpMaterialVo;
import com.ruoyi.erp.mapper.ErpMaterialMapper; import com.ruoyi.erp.mapper.ErpMaterialMapper;
@ -221,6 +222,12 @@ public class ErpMaterialController extends BaseController
mmap.put("erpMaterial", erpMaterial); mmap.put("erpMaterial", erpMaterial);
return prefix + "/edit"; return prefix + "/edit";
} }
@GetMapping("/detail/{id}")
public String detail(@PathVariable("id") Long id, ModelMap mmap)
{ ErpMaterial erpMaterial = erpMaterialService.selectErpMaterialById(id);
mmap.put("erpMaterial", erpMaterial);
return prefix + "/detail";
}
/** /**
* 修改保存物料信息 * 修改保存物料信息

2
ruoyi-admin/src/main/java/com/ruoyi/erp/domain/ErpBom.java

@ -38,6 +38,7 @@ public class ErpBom extends BaseEntity
private String materialName; private String materialName;
/** 物料类型 */ /** 物料类型 */
@Excel(name="物料类型")
private String materialType; private String materialType;
/** 加工方式 */ /** 加工方式 */
@ -349,7 +350,6 @@ public class ErpBom extends BaseEntity
this.applyTime = applyTime; this.applyTime = applyTime;
} }
public Long getPhotoAttachId() { public Long getPhotoAttachId() {
return photoAttachId; return photoAttachId;
} }

24
ruoyi-admin/src/main/java/com/ruoyi/erp/domain/ErpMaterial.java

@ -108,6 +108,12 @@ public class ErpMaterial extends BaseEntity
private String removeFileIdStr; private String removeFileIdStr;
/** 供应商id*/
private Long supplierId;
/** 供应商名称*/
private String supplierName;
private List<SysProductItem> sysProductItems; private List<SysProductItem> sysProductItems;
public void setId(Long id) public void setId(Long id)
{ {
@ -364,6 +370,22 @@ public class ErpMaterial extends BaseEntity
this.applyTime = applyTime; this.applyTime = applyTime;
} }
public Long getSupplierId() {
return supplierId;
}
public void setSupplierId(Long supplierId) {
this.supplierId = supplierId;
}
public String getSupplierName() {
return supplierName;
}
public void setSupplierName(String supplierName) {
this.supplierName = supplierName;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this) return new ToStringBuilder(this)
@ -395,6 +417,8 @@ public class ErpMaterial extends BaseEntity
.append("removeFileIdStr", getRemoveFileIdStr()) .append("removeFileIdStr", getRemoveFileIdStr())
.append("sysProductItems", getSysProductItems()) .append("sysProductItems", getSysProductItems())
.append("itemName", getItemName()) .append("itemName", getItemName())
.append("supplierId",getSupplierId())
.append("supplierName",getSupplierName())
.toString(); .toString();
} }
} }

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

@ -96,7 +96,7 @@ public interface IErpBomService
String checkMaterialNoUnique(String materialNo); String checkMaterialNoUnique(String materialNo);
List<ErpBom> getExportList(ErpBom erpBom); List<ErpBom> getExportList(ErpBomVo erpBom);
String importData(List<ErpBomImportVo> bomImportVos,boolean updateSupport); String importData(List<ErpBomImportVo> bomImportVos,boolean updateSupport);

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

@ -345,11 +345,11 @@ private ISysAttachService attachService;
} }
@Override @Override
public List<ErpBom> getExportList(ErpBom erpBom) { public List<ErpBom> getExportList(ErpBomVo erpBom) {
List<ErpBom> resultList = new ArrayList<>(); List<ErpBom> resultList = new ArrayList<>();
List<ErpBom> zeroLevelList = erpBomMapper.selectErpBomList(erpBom); List<ErpBomVo> zeroLevelList = erpBomMapper.selectErpBomList(erpBom);
if(CollectionUtils.isNotEmpty(zeroLevelList)){ if(CollectionUtils.isNotEmpty(zeroLevelList)){
for (ErpBom bom:zeroLevelList) { for (ErpBomVo bom:zeroLevelList) {
resultList.add(bom); resultList.add(bom);
ErpBom bom1 = new ErpBom(); ErpBom bom1 = new ErpBom();
bom1.setParentId(bom.getId()); bom1.setParentId(bom.getId());

5
ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysSupplierMapper.java

@ -61,4 +61,9 @@ public interface SysSupplierMapper
public int deleteSysSupplierByIds(String[] supplierIds); public int deleteSysSupplierByIds(String[] supplierIds);
public List selectSysSupplierBycode(); public List selectSysSupplierBycode();
/**
* 新增物料信息的时候查关联应商信息
*/
public List<SysSupplier> selectSysSupplierWithMaterial();
} }

5
ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysSupplierService.java

@ -61,4 +61,9 @@ public interface ISysSupplierService
public int deleteSysSupplierById(Long supplierId); public int deleteSysSupplierById(Long supplierId);
public List selectSysSupplierBycode(); public List selectSysSupplierBycode();
/**
* 新增物料信息的时候查关联应商信息
*/
public List<SysSupplier> selectSysSupperWithMaterial();
} }

11
ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSupplierServiceImpl.java

@ -15,7 +15,7 @@ import java.util.List;
* @author ruoyi * @author ruoyi
* @date 2022-11-02 * @date 2022-11-02
*/ */
@Service @Service("supplierItems")
public class SysSupplierServiceImpl implements ISysSupplierService public class SysSupplierServiceImpl implements ISysSupplierService
{ {
@Autowired @Autowired
@ -97,4 +97,13 @@ public class SysSupplierServiceImpl implements ISysSupplierService
public List selectSysSupplierBycode() { public List selectSysSupplierBycode() {
return sysSupplierMapper.selectSysSupplierBycode(); return sysSupplierMapper.selectSysSupplierBycode();
} }
/**
* 新增物料信息的时候查关联应商信息
*/
@Override
public List<SysSupplier> selectSysSupperWithMaterial() {
List<SysSupplier> sysSuppliers = sysSupplierMapper.selectSysSupplierWithMaterial();
return sysSuppliers;
}
} }

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

@ -37,10 +37,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="applyTitle" column="apply_title" /> <result property="applyTitle" column="apply_title" />
<result property="applyUser" column="apply_user" /> <result property="applyUser" column="apply_user" />
<result property="applyTime" column="apply_time" /> <result property="applyTime" column="apply_time" />
<result property="supplierId" column="supplier_id" />
<result property="supplierName" column="supplier_name" />
</resultMap> </resultMap>
<sql id="selectErpMaterialVo"> <sql id="selectErpMaterialVo">
select id, del_flag, create_by, create_time, update_by, update_time, remark,bomNo, material_no, material_name, audit_status, use_status, hava_product_tem,product_item,itemName, material_type, process_method, unit, brand, `describe`, warehouse_dept,instance_id,instance_type,submit_instance_id,cancel_instance_id,restore_instance_id,apply_title,apply_user,apply_time from erp_material select id, del_flag, create_by, create_time, update_by, update_time, remark,
bomNo, material_no, material_name, audit_status, use_status,
hava_product_tem,product_item,itemName, material_type, process_method,
unit, brand, `describe`, warehouse_dept,instance_id,instance_type,submit_instance_id,
cancel_instance_id,restore_instance_id,apply_title,apply_user,apply_time from erp_material
</sql> </sql>
<select id="selectErpMaterialList" parameterType="ErpMaterialVo" resultMap="ErpMaterialResult"> <select id="selectErpMaterialList" parameterType="ErpMaterialVo" resultMap="ErpMaterialResult">
@ -48,7 +54,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
, erp.material_name, erp.audit_status, erp.use_status, erp.hava_product_tem, erp.product_item,erp.`itemName`, erp.material_type, erp.process_method , erp.material_name, erp.audit_status, erp.use_status, erp.hava_product_tem, erp.product_item,erp.`itemName`, erp.material_type, erp.process_method
, erp.unit, erp.brand, erp.`describe`, erp.warehouse_dept , erp.unit, erp.brand, erp.`describe`, erp.warehouse_dept
,erp.instance_id,erp.instance_type,process_type_dict.dict_label as instance_type_name, ,erp.instance_id,erp.instance_type,process_type_dict.dict_label as instance_type_name,
erp.submit_instance_id,erp.cancel_instance_id,erp.restore_instance_id,erp.apply_title,erp.apply_user,erp.apply_time erp.submit_instance_id,erp.cancel_instance_id,erp.restore_instance_id,erp.apply_title,erp.apply_user,erp.apply_time,
ss.supplier_name
,file.url as photo_url,cate.name as material_type_name ,file.url as photo_url,cate.name as material_type_name
from erp_material erp from erp_material erp
left join( left join(
@ -75,6 +82,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
group by att.rel_id group by att.rel_id
)file )file
on erp.id = file.rel_id on erp.id = file.rel_id
left join sys_supplier ss on ss.supplier_id = erp.supplier_id
<where> <where>
<if test="createBy != null and createBy != ''"> and erp.create_by = #{createBy}</if> <if test="createBy != null and createBy != ''"> and erp.create_by = #{createBy}</if>
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''"> and erp.create_time between #{params.beginCreateTime} and #{params.endCreateTime}</if> <if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''"> and erp.create_time between #{params.beginCreateTime} and #{params.endCreateTime}</if>
@ -102,6 +110,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="applyUser != null and applyUser != ''"> and erp.apply_user = #{applyUser}</if> <if test="applyUser != null and applyUser != ''"> and erp.apply_user = #{applyUser}</if>
<if test="applyTime != null "> and erp.apply_time = #{applyTime}</if> <if test="applyTime != null "> and erp.apply_time = #{applyTime}</if>
<if test="keyword != null and keyword != ''"> and (erp.material_no like concat('%',#{keyword},'%') or erp.material_name like concat('%',#{keyword},'%'))</if> <if test="keyword != null and keyword != ''"> and (erp.material_no like concat('%',#{keyword},'%') or erp.material_name like concat('%',#{keyword},'%'))</if>
<if test="supplierId != null and supplierId != ''"> and erp.supplier_id = #{supplierId}</if>
</where> </where>
order by erp.update_time desc order by erp.update_time desc
</select> </select>
@ -161,6 +170,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="applyTitle != null">apply_title,</if> <if test="applyTitle != null">apply_title,</if>
<if test="applyUser != null">apply_user,</if> <if test="applyUser != null">apply_user,</if>
<if test="applyTime != null">apply_time,</if> <if test="applyTime != null">apply_time,</if>
<if test="supplierId != null">supplier_id,</if>
del_flag, del_flag,
create_time, create_time,
update_time, update_time,
@ -191,6 +201,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="applyTitle != null">#{applyTitle},</if> <if test="applyTitle != null">#{applyTitle},</if>
<if test="applyUser != null">#{applyUser},</if> <if test="applyUser != null">#{applyUser},</if>
<if test="applyTime != null">#{applyTime},</if> <if test="applyTime != null">#{applyTime},</if>
<if test="supplierId != null">#{supplierId},</if>
0, 0,
now(), now(),
now(), now(),
@ -227,6 +238,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="applyTitle != null">apply_title = #{applyTitle},</if> <if test="applyTitle != null">apply_title = #{applyTitle},</if>
<if test="applyUser != null">apply_user = #{applyUser},</if> <if test="applyUser != null">apply_user = #{applyUser},</if>
<if test="applyTime != null">apply_time = #{applyTime},</if> <if test="applyTime != null">apply_time = #{applyTime},</if>
<if test="supplierId != null">supplier_id = #{supplierId},</if>
update_time = now() update_time = now()
</trim> </trim>
where id = #{id} where id = #{id}

5
ruoyi-admin/src/main/resources/mapper/system/SysSupplierMapper.xml

@ -64,6 +64,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectSysSupplierBycode" resultMap="SysSupplierResult"> <select id="selectSysSupplierBycode" resultMap="SysSupplierResult">
select supplier_code,supplier_name from sys_supplier select supplier_code,supplier_name from sys_supplier
</select> </select>
<select id="selectSysSupplierWithMaterial" resultMap="SysSupplierResult">
<include refid="selectSysSupplierVo"/>
</select>
<insert id="insertSysSupplier" parameterType="SysSupplier" useGeneratedKeys="true" keyProperty="supplierId"> <insert id="insertSysSupplier" parameterType="SysSupplier" useGeneratedKeys="true" keyProperty="supplierId">
insert into sys_supplier insert into sys_supplier
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">

26
ruoyi-admin/src/main/resources/templates/erp/material/add.html

@ -66,6 +66,15 @@
</div> </div>
</div> </div>
</div> </div>
<div class="form-group">
<label class="col-sm-3 control-label">供应商:</label>
<div class="col-sm-8">
<select name="supplierItem" class="form-control m-b" th:with="supplierList=${@supplierItems.selectSysSupperWithMaterial()}">
<option value="">请选择</option>
<option th:each="supplier:${supplierList}" th:value="${supplier.supplierId}" th:text="${supplier.supplierName}"></option>
</select>
</div>
</div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">单位:</label> <label class="col-sm-3 control-label">单位:</label>
<div class="col-sm-8"> <div class="col-sm-8">
@ -197,6 +206,18 @@
} }
} }
}, },
// 校验供应商
supplierItem:{
remote:function (){
var havepa = $("select[name='havesupplierTem']").val();
var supplierItem = $("select[name='supplierItem']").val();
if (havepa!='' && havepa!=null && havepa!=0){
if(supplierItem == null || supplierItem == ''){
return $.common.trim($("#supplierItem").val());
}
}
}
},
productItem:{ productItem:{
remote:function (){ remote:function (){
var havepa = $("select[name='haveProductTem']").val(); var havepa = $("select[name='haveProductTem']").val();
@ -217,7 +238,10 @@
}, },
"productItem":{ "productItem":{
remote :'有生产团队时,请选择生产团队名称' remote :'有生产团队时,请选择生产团队名称'
} },
"supplierItem":{
remote :'有供应商时,请选择供应商名称'
},
}, },
focusCleanup: true focusCleanup: true
}); });

2
ruoyi-admin/src/main/resources/templates/erp/material/detail.html

@ -18,7 +18,7 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">物料名称:</label> <label class="col-sm-3 control-label">物料名称:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="materialName" th:field="*{materialName}" class="form-control" type="text" readonly> <input name="materialName" th:field="*{materialName}" class="form-control" type="text" disabled />
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">

9
ruoyi-admin/src/main/resources/templates/erp/material/edit.html

@ -93,6 +93,15 @@
</select> </select>
</div> </div>
</div> </div>
<div class="form-group">
<label class="col-sm-3 control-label">供应商:</label>
<div class="col-sm-8">
<select name="supplierItem" class="form-control m-b" th:with="supplierList=${@supplierItems.selectSysSupperWithMaterial()}">
<option value="">请选择</option>
<option th:each="supplier:${supplierList}" th:value="${supplier.supplierId}" th:text="${supplier.supplierName}"></option>
</select>
</div>
</div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">单位:</label> <label class="col-sm-3 control-label">单位:</label>
<div class="col-sm-8"> <div class="col-sm-8">

34
ruoyi-admin/src/main/resources/templates/erp/material/material.html

@ -57,12 +57,20 @@
</optgroup> </optgroup>
</select> </select>
</li> </li>
<li>
<label>供应商:</label>
<select name="supplierId" class="form-control m-b" th:with="supplierList=${@supplierItems.selectSysSupperWithMaterial()}">
<option value="">所有</option>
<option th:each="supplier:${supplierList}" th:value="${supplier.supplierId}" th:text="${supplier.supplierName}"></option>
</select>
</li>
<li class="select-time"> <li class="select-time">
<label>录入时间:</label> <label>录入时间:</label>
<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginCreateTime]"/> <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginCreateTime]"/>
<span>-</span> <span>-</span>
<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endCreateTime]"/> <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endCreateTime]"/>
</li> </li>
<!-- <li> <!-- <li>
<label>加工方式:</label> <label>加工方式:</label>
<select name="processMethod" th:with="type=${@dict.getType('processMethod')}"> <select name="processMethod" th:with="type=${@dict.getType('processMethod')}">
@ -268,11 +276,25 @@
</div> </div>
<div class="modal-body" style="height: 180px"> <div class="modal-body" style="height: 180px">
<form id="form-product-material"> <form id="form-product-material">
<div class="form-group">
<label class="col-sm-3 control-label">料号:</label>
<div class="col-sm-8">
<input name="materialNo" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">物料名称:</label>
<div class="col-sm-8">
<input name="materialName" class="form-control" type="text" readonly>
</div>
</div>
<input name="itemId" type="hidden"> <input name="itemId" type="hidden">
<div class="form-group" hidden="hidden"> <div class="form-group">
<label class="col-sm-3 control-label">生产团队id:</label> <label class="col-sm-3 control-label">生产团队id:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="id" class="form-control" type="text" readonly> <select name="id" class="form-control-sm" required>
<option></option>
</select>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
@ -477,7 +499,7 @@
cancelUrl: prefix + "/cancel/{id}", cancelUrl: prefix + "/cancel/{id}",
restoreUrl: prefix + "/restore/{id}", restoreUrl: prefix + "/restore/{id}",
exportUrl: prefix + "/export", exportUrl: prefix + "/export",
detailUrl: prefix + "/edit/{id}", detailUrl: prefix + "/detail/{id}",
modalName: "物料信息", modalName: "物料信息",
fixedColumns: true, // 启用冻结列 fixedColumns: true, // 启用冻结列
fixedRightNumber: 1, // 冻结右列个数 fixedRightNumber: 1, // 冻结右列个数
@ -614,7 +636,7 @@
}, },
{ {
field: 'havaProductTem', field: 'havaProductTem',
title: '是否有生产团队', title: '是否有技术团队',
formatter:function (value, row, index){ formatter:function (value, row, index){
return $.table.selectDictLabel(haveProductTem,value); return $.table.selectDictLabel(haveProductTem,value);
} }
@ -627,6 +649,10 @@
field: 'itemName', field: 'itemName',
title: '技术团队名称', title: '技术团队名称',
}, },
{
field: 'supplierName',
title: '供应商'
},
{ {
field: 'createTime', field: 'createTime',
title: '录入时间' title: '录入时间'

Loading…
Cancel
Save