Browse Source

[fix]

工程管理 bom信息
修改bom页面导出弹窗的提示信息,拼接选中bom编号显示;
修改bom导出后端接口,将接收到的bom编号字符串列表转换成以逗号分隔的字符串,并将其设置为导出表名;
修改service接口,新增bom时拼接bom号为BOM+料号;
修改mapper,查询列表时添加排序条件;
dev
王晓迪 4 months ago
parent
commit
d53fcfa59d
  1. 6
      ruoyi-admin/src/main/java/com/ruoyi/erp/controller/ErpBomController.java
  2. 4
      ruoyi-admin/src/main/java/com/ruoyi/erp/service/impl/ErpBomServiceImpl.java
  3. 2
      ruoyi-admin/src/main/resources/mapper/erp/ErpBomMapper.xml
  4. 11
      ruoyi-admin/src/main/resources/templates/erp/bom/bom.html

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

@ -145,12 +145,10 @@ public class ErpBomController extends BaseController
@ResponseBody
public AjaxResult export(@RequestBody String[] bomNos)
{
// erpBom.setParentId(0L);
// List<ErpBom> list = erpBomService.getExportList(erpBom);
String bomNoString = String.join(",", bomNos); // 带分隔符
List<ErpBom> list = erpBomService.getExportListByNos(bomNos);
ExcelUtil<ErpBom> util = new ExcelUtil<ErpBom>(ErpBom.class);
return util.exportExcel(list, "bom数据");
return util.exportExcel(list, bomNoString);
}
/**
* 导出bom列表

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

@ -325,8 +325,8 @@ private ISysAttachService attachService;
//初始化Bom编号层级
erpBom.setLevel(0L);
//生成BOM编号,年月日规则
String billNo = redisCache.generateBillNo("BOM");
erpBom.setBomNo(billNo);
// String billNo = redisCache.generateBillNo("BOM");
erpBom.setBomNo("BOM"+erpBom.getMaterialNo());
int result = erpBomMapper.insertErpBom(erpBom);
//todo 使用useGeneratedKeys="true" keyProperty="id"关键子,插入后完成后需要获取新的id就需要重新getId()
Long id = erpBom.getId();

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

@ -150,7 +150,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</if>
and erp.bom_no != ''
</where>
order by erp.create_time desc
order by erp.audit_status asc, erp.create_time desc
</select>
<select id="selectErpBomList1" resultMap="ErpBomResult">
select bom_no, id, create_by, create_time, update_by, update_time, remark,

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

@ -799,11 +799,11 @@
});
});
}else {
$.modal.confirm("确定导出选中的所有" + table.options.modalName + "吗?", function () {
//·拼接单号
for(let i=0;i<selections.length;i++){
bomNoData.push(selections[i].bomNo);
}
//·拼接单号
for(let i=0;i<selections.length;i++){
bomNoData.push(selections[i].bomNo);
}
$.modal.confirm("确定导出" + bomNoData + "吗?", function () {
var bomNos = JSON.stringify(bomNoData);
// console.log(bomNos);
$.modal.loading("正在导出数据,请稍后...");
@ -814,6 +814,7 @@
contentType: "application/json;charset=utf-8",
data: bomNos,
success: function(result) {
console.log(result);
window.location.href = ctx + "common/download?fileName=" + encodeURI(result.msg) + "&delete=" + true;
$.modal.alertSuccess("导出成功!")
$.modal.closeLoading();

Loading…
Cancel
Save