diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/common/domain/entity/BaseDto.java b/mes/hd/nladmin-system/src/main/java/org/nl/common/domain/entity/BaseDto.java index e2484a5c..9a96533f 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/common/domain/entity/BaseDto.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/common/domain/entity/BaseDto.java @@ -22,7 +22,7 @@ public class BaseDto implements Serializable { private String update_name; - private String update_optid; + private String update_id; @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JSONField(format = "yyyy-MM-dd HH:mm:ss") diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/masterdata_manage/mdme.xls b/mes/hd/nladmin-system/src/main/java/org/nl/wms/masterdata_manage/mdme.xls index c66039cf..6eff23b4 100644 Binary files a/mes/hd/nladmin-system/src/main/java/org/nl/wms/masterdata_manage/mdme.xls and b/mes/hd/nladmin-system/src/main/java/org/nl/wms/masterdata_manage/mdme.xls differ diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/masterdata_manage/service/material/impl/MdMeMaterialbaseServiceImpl.java b/mes/hd/nladmin-system/src/main/java/org/nl/wms/masterdata_manage/service/material/impl/MdMeMaterialbaseServiceImpl.java index 65b4daa5..c8fe0aa7 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/wms/masterdata_manage/service/material/impl/MdMeMaterialbaseServiceImpl.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/wms/masterdata_manage/service/material/impl/MdMeMaterialbaseServiceImpl.java @@ -71,7 +71,7 @@ public class MdMeMaterialbaseServiceImpl extends ServiceImpl().eq("class_name", product_series).eq("is_delete", false)); +// if (ObjectUtil.isEmpty(class_jo)) { +// errorMap.put("第" + (i + 1) + "行:", "系列分类编码对应的分类不存在!"); +// continue; +// } +// material_jo.setProduct_series(class_jo.getClass_id()); +// } + String material_type = list.get(4).toString(); + if (StrUtil.isEmpty(material_type)&&!"1".equals(material_spec)) { errorMap.put("第" + (i + 1) + "行:", "物料分类编码为空!"); - }else { + }else{ //查询对应的系列名称 MdPbClassstandard class_jo = classstandardService.getOne(new QueryWrapper().eq("class_name", material_type).eq("is_delete", false)); if (ObjectUtil.isEmpty(class_jo)) { @@ -110,20 +114,12 @@ public class MdMeMaterialbaseServiceImpl extends ServiceImpl().eq("class_name", product_series).eq("is_delete", false)); - if (ObjectUtil.isEmpty(class_jo)) { - errorMap.put("第" + (i + 1) + "行:", "系列分类编码对应的分类不存在!"); - continue; - } - material_jo.setProduct_series(class_jo.getClass_id()); + String material_model = list.get(5).toString(); + if (StrUtil.isNotEmpty(material_model)&&!"1".equals(material_spec)) { + material_jo.setMaterial_model(material_model); } - - String unit_name = (String) list.get(6); - if (StrUtil.isEmpty(unit_name)) { + String unit_name = list.get(6).toString(); + if (StrUtil.isEmpty(unit_name)&&!"1".equals(material_spec)) { errorMap.put("第" + (i + 1) + "行:", "单位为空!"); }else { MdPbMeasureunit unit_jo = measureunitService.getOne(new QueryWrapper().eq("unit_name", unit_name)); @@ -134,8 +130,8 @@ public class MdMeMaterialbaseServiceImpl extends ServiceImpl().eq("workprocedure_code", workprocedure_code)); - if (ObjectUtil.isEmpty(workprocedure)) { - errorMap.put("第" + (i + 1) + "行:", "为查询到该工序编号对应的工序!"); - continue; - } - - String semi_material_code = (String) list.get(1); + String semi_material_code = (String) list.get(0); if (StrUtil.isEmpty(semi_material_code)){ errorMap.put("第" + (i + 1) + "行:", "半成品物料编码为空!"); continue; @@ -193,7 +182,7 @@ public class SemirealrawmaterialServiceImpl implements SemirealrawmaterialServic continue; } - String raw_material_code = String.valueOf(list.get(2)); + String raw_material_code = String.valueOf(list.get(1)); if (StrUtil.isEmpty(raw_material_code)){ errorMap.put("第" + (i + 1) + "行:", "原材料物料编码为空!"); continue; @@ -206,7 +195,7 @@ public class SemirealrawmaterialServiceImpl implements SemirealrawmaterialServic continue; } - String rate_qty = String.valueOf(list.get(3)); + String rate_qty = String.valueOf(list.get(2)); if (StrUtil.isEmpty(rate_qty)){ errorMap.put("第" + (i + 1) + "行:", "原材料消耗重量为空!"); continue; @@ -217,7 +206,6 @@ public class SemirealrawmaterialServiceImpl implements SemirealrawmaterialServic if (ObjectUtil.isNotEmpty(jo)){ jo.put("rate_qty",rate_qty); - jo.put("workprocedure_id",workprocedure.getWorkprocedure_id()); WQLObject.getWQLObject("md_me_semirealrawmaterial").update(jo); }else { jo = new JSONObject(); @@ -225,12 +213,12 @@ public class SemirealrawmaterialServiceImpl implements SemirealrawmaterialServic String nickName = SecurityUtils.getCurrentNickName(); jo.put("relation_id",IdUtil.getSnowflake(1, 1).nextId()); jo.put("semi_material_id",semi_jo.getMaterial_id()); - jo.put("raw_material_id",semi_jo.getMaterial_id()); + jo.put("raw_material_id",raw_jo.getMaterial_id()); + jo.put("raw_material_code",raw_jo.getMaterial_code()); jo.put("create_id",currentUserId); jo.put("create_name",nickName); jo.put("create_time",DateUtil.now()); jo.put("rate_qty",rate_qty); - jo.put("workprocedure_id",workprocedure.getWorkprocedure_id()); WQLObject wo = WQLObject.getWQLObject("md_me_semirealrawmaterial"); wo.insert(jo); } diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/mps_manage/saleorder/service/impl/MpsSaleOrderServiceImpl.java b/mes/hd/nladmin-system/src/main/java/org/nl/wms/mps_manage/saleorder/service/impl/MpsSaleOrderServiceImpl.java index 9376a8d4..056b9f5c 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/wms/mps_manage/saleorder/service/impl/MpsSaleOrderServiceImpl.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/wms/mps_manage/saleorder/service/impl/MpsSaleOrderServiceImpl.java @@ -144,7 +144,6 @@ public class MpsSaleOrderServiceImpl extends ServiceImpl meMaterialBases = materialbaseService.list(new QueryWrapper().like("material_spec", col)); if(CollectionUtils.isEmpty(meMaterialBases)) { errorMap.put("第" + i + "行" + col, "物料规格对应物料信息不存在"); - error_message = error_message + col + "物料规格对应物料信息不存在,"; } else{ Optional first = meMaterialBases.stream().findFirst(); diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/product_manage/service/processroute/dao/PdmBiProcessroute.java b/mes/hd/nladmin-system/src/main/java/org/nl/wms/product_manage/service/processroute/dao/PdmBiProcessroute.java index 7fc48650..4329b6a4 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/wms/product_manage/service/processroute/dao/PdmBiProcessroute.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/wms/product_manage/service/processroute/dao/PdmBiProcessroute.java @@ -72,12 +72,12 @@ public class PdmBiProcessroute implements Serializable { /** * 修改人 */ - private String update_optid; + private String update_id; /** * 修改人姓名 */ - private String update_optname; + private String update_name; /** * 修改时间 diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/product_manage/service/processroute/impl/PdmBiProcessrouteServiceImpl.java b/mes/hd/nladmin-system/src/main/java/org/nl/wms/product_manage/service/processroute/impl/PdmBiProcessrouteServiceImpl.java index baa39482..9fdcb26f 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/wms/product_manage/service/processroute/impl/PdmBiProcessrouteServiceImpl.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/wms/product_manage/service/processroute/impl/PdmBiProcessrouteServiceImpl.java @@ -114,9 +114,9 @@ public class PdmBiProcessrouteServiceImpl extends ServiceImpl dtlArr = pdmBiProcessroutedtlService.list(new QueryWrapper().eq("processroute_id", processroute_id)); @@ -154,8 +154,8 @@ public class PdmBiProcessrouteServiceImpl extends ServiceImpl() .set("is_delete","1") - .set("update_optid",SecurityUtils.getCurrentUserId()) - .set("update_optname",SecurityUtils.getCurrentNickName()) + .set("update_id",SecurityUtils.getCurrentUserId()) + .set("update_name",SecurityUtils.getCurrentNickName()) .set("update_time",DateUtil.now()) .in("processroute_id",ids)); } @@ -178,8 +178,8 @@ public class PdmBiProcessrouteServiceImpl extends ServiceImpl() .set("processroute_status","10") - .set("update_optid",SecurityUtils.getCurrentUserId()) - .set("update_optname",SecurityUtils.getCurrentNickName()) + .set("update_id",SecurityUtils.getCurrentUserId()) + .set("update_name",SecurityUtils.getCurrentNickName()) .set("update_time",DateUtil.now()) .set("audit_id"," ") .set("audit_name"," ") @@ -191,8 +191,8 @@ public class PdmBiProcessrouteServiceImpl extends ServiceImpl() .set("processroute_status","20") - .set("update_optid",SecurityUtils.getCurrentUserId()) - .set("update_optname",SecurityUtils.getCurrentNickName()) + .set("update_id",SecurityUtils.getCurrentUserId()) + .set("update_name",SecurityUtils.getCurrentNickName()) .set("update_time",DateUtil.now()) .set("audit_id",SecurityUtils.getCurrentUserId()) .set("audit_name",SecurityUtils.getCurrentNickName()) diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/product_manage/service/productProcessRoute/dao/PdmBiProductprocessroute.java b/mes/hd/nladmin-system/src/main/java/org/nl/wms/product_manage/service/productProcessRoute/dao/PdmBiProductprocessroute.java index 1a9a2091..d39e27ea 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/wms/product_manage/service/productProcessRoute/dao/PdmBiProductprocessroute.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/wms/product_manage/service/productProcessRoute/dao/PdmBiProductprocessroute.java @@ -69,12 +69,12 @@ public class PdmBiProductprocessroute implements Serializable { /** * 修改人 */ - private String update_optid; + private String update_id; /** * 修改人姓名 */ - private String update_optname; + private String update_name; /** * 修改时间 @@ -84,12 +84,12 @@ public class PdmBiProductprocessroute implements Serializable { /** * 审核人 */ - private String audit_optid; + private String audit_id; /** * 审核人姓名 */ - private String audit_optname; + private String audit_name; /** * 审核时间 diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/product_manage/service/productProcessRoute/impl/PdmBiProductprocessrouteServiceImpl.java b/mes/hd/nladmin-system/src/main/java/org/nl/wms/product_manage/service/productProcessRoute/impl/PdmBiProductprocessrouteServiceImpl.java index c4af9047..91b04f0e 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/wms/product_manage/service/productProcessRoute/impl/PdmBiProductprocessrouteServiceImpl.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/wms/product_manage/service/productProcessRoute/impl/PdmBiProductprocessrouteServiceImpl.java @@ -151,7 +151,7 @@ public class PdmBiProductprocessrouteServiceImpl extends ServiceImpl().set("remark", jo.getString("remark")).set("class_id", jo.getString("class_id")).set("detail_count", rows.size()).set("update_optid", SecurityUtils.getCurrentUserId()).set("update_optname", SecurityUtils.getCurrentNickName()).set("update_time", DateUtil.now()).eq("productprocess_id", jo.getString("productprocess_id"))); + this.update(new UpdateWrapper().set("remark", jo.getString("remark")).set("class_id", jo.getString("class_id")).set("detail_count", rows.size()).set("update_id", SecurityUtils.getCurrentUserId()).set("update_name", SecurityUtils.getCurrentNickName()).set("update_time", DateUtil.now()).eq("productprocess_id", jo.getString("productprocess_id"))); productprocessroutedtlService.remove(new QueryWrapper().eq("productprocess_id", jo.getString("productprocess_id"))); for (int i = 0; i < rows.size(); i++) { JSONObject row = rows.getJSONObject(i); @@ -164,7 +164,7 @@ public class PdmBiProductprocessrouteServiceImpl extends ServiceImpl().set("is_delete", "1").set("update_optid", SecurityUtils.getCurrentUserId()).set("update_optname", SecurityUtils.getCurrentNickName()).set("update_time", DateUtil.now()).in("productprocess_id", ids)); + this.update(new UpdateWrapper().set("is_delete", "1").set("update_id", SecurityUtils.getCurrentUserId()).set("update_name", SecurityUtils.getCurrentNickName()).set("update_time", DateUtil.now()).in("productprocess_id", ids)); } @Override @@ -185,12 +185,12 @@ public class PdmBiProductprocessrouteServiceImpl extends ServiceImpl().set("productprocess_status", "20").set("update_optid", SecurityUtils.getCurrentUserId()).set("update_optname", SecurityUtils.getCurrentNickName()).set("update_time", DateUtil.now()).set("audit_optid", SecurityUtils.getCurrentUserId()).set("audit_optname", SecurityUtils.getCurrentNickName()).set("audit_time", DateUtil.now()).eq("processroute_id", whereJson.getString("processroute_id"))); + this.update(new UpdateWrapper().set("productprocess_status", "20").set("update_id", SecurityUtils.getCurrentUserId()).set("update_name", SecurityUtils.getCurrentNickName()).set("update_time", DateUtil.now()).set("audit_id", SecurityUtils.getCurrentUserId()).set("audit_name", SecurityUtils.getCurrentNickName()).set("audit_time", DateUtil.now()).eq("processroute_id", whereJson.getString("processroute_id"))); } @Override public void unSubmit(JSONObject whereJson) { - this.update(new UpdateWrapper().set("productprocess_status", "10").set("update_optid", SecurityUtils.getCurrentUserId()).set("update_optname", SecurityUtils.getCurrentNickName()).set("update_time", DateUtil.now()).set("audit_optid", " ").set("audit_optname", " ").set("audit_time", " ").eq("processroute_id", whereJson.getString("processroute_id"))); + this.update(new UpdateWrapper().set("productprocess_status", "10").set("update_id", SecurityUtils.getCurrentUserId()).set("update_name", SecurityUtils.getCurrentNickName()).set("update_time", DateUtil.now()).set("audit_id", " ").set("audit_name", " ").set("audit_time", " ").eq("processroute_id", whereJson.getString("processroute_id"))); } @Override diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/product_manage/备份pdm/rest/BomController.java b/mes/hd/nladmin-system/src/main/java/org/nl/wms/product_manage/备份pdm/rest/BomController.java index 557d0f67..ffdefe46 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/wms/product_manage/备份pdm/rest/BomController.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/wms/product_manage/备份pdm/rest/BomController.java @@ -13,7 +13,9 @@ import org.springframework.data.domain.Pageable; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; +import javax.servlet.http.HttpServletRequest; import java.util.Map; /** @@ -106,4 +108,14 @@ public class BomController { return new ResponseEntity<>(HttpStatus.OK); } + /** + *导入bom数据 + */ + @Log("导入bom数据") + @PostMapping("/excelImport") + public ResponseEntity excelImport(@RequestParam("file") MultipartFile file, HttpServletRequest request) { + bomService.excelImport(file,request); + return new ResponseEntity<>(HttpStatus.OK); + } + } diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/product_manage/备份pdm/service/BomService.java b/mes/hd/nladmin-system/src/main/java/org/nl/wms/product_manage/备份pdm/service/BomService.java index b4c241fb..f58e932a 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/wms/product_manage/备份pdm/service/BomService.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/wms/product_manage/备份pdm/service/BomService.java @@ -5,7 +5,9 @@ import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import org.nl.wms.product_manage.备份pdm.service.dto.BomDto; import org.springframework.data.domain.Pageable; +import org.springframework.web.multipart.MultipartFile; +import javax.servlet.http.HttpServletRequest; import java.util.List; import java.util.Map; @@ -33,10 +35,10 @@ public interface BomService { /** * 根据ID查询 - * @param bom_uuid ID + * @param bom_id ID * @return Bom */ - BomDto findById(String bom_uuid); + BomDto findById(String bom_id); /** * 根据编码查询 @@ -73,4 +75,12 @@ public interface BomService { void submits(JSONObject param); void cancelSubmit(JSONObject param); + + + /** + * excel导入 + * @param file + * @param request + */ + void excelImport(MultipartFile file, HttpServletRequest request); } diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/product_manage/备份pdm/service/dto/BomDto.java b/mes/hd/nladmin-system/src/main/java/org/nl/wms/product_manage/备份pdm/service/dto/BomDto.java index aee66c63..205931c4 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/wms/product_manage/备份pdm/service/dto/BomDto.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/wms/product_manage/备份pdm/service/dto/BomDto.java @@ -15,7 +15,7 @@ import java.math.BigDecimal; public class BomDto implements Serializable { /** BOM单标识 */ - private String bom_uuid; + private String bom_id; /** BOM单编码 */ private String bom_code; @@ -24,10 +24,10 @@ public class BomDto implements Serializable { private String bom_name; /** 物料标识 */ - private String material_uuid; + private String material_id; /** 产品工艺路线标识 */ - private String processroute_uuid; + private String processroute_id; /** 成材率百分比 */ private BigDecimal yield_rate; diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/product_manage/备份pdm/service/dto/ProcessrouteDto.java b/mes/hd/nladmin-system/src/main/java/org/nl/wms/product_manage/备份pdm/service/dto/ProcessrouteDto.java index b1da83f4..84932d5e 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/wms/product_manage/备份pdm/service/dto/ProcessrouteDto.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/wms/product_manage/备份pdm/service/dto/ProcessrouteDto.java @@ -55,10 +55,10 @@ public class ProcessrouteDto implements Serializable { private String update_time; /** 审核人 */ - private Long audit_optid; + private Long audit_id; /** 审核人姓名 */ - private String audit_optname; + private String audit_name; /** 审核时间 */ private String audit_time; diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/product_manage/备份pdm/service/dto/ProductprocessrouteDto.java b/mes/hd/nladmin-system/src/main/java/org/nl/wms/product_manage/备份pdm/service/dto/ProductprocessrouteDto.java index e3cd2c2f..b5bbd4d5 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/wms/product_manage/备份pdm/service/dto/ProductprocessrouteDto.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/wms/product_manage/备份pdm/service/dto/ProductprocessrouteDto.java @@ -57,10 +57,10 @@ public class ProductprocessrouteDto implements Serializable { private String update_time; /** 审核人 */ - private Long audit_optid; + private Long audit_id; /** 审核人姓名 */ - private String audit_optname; + private String audit_name; /** 审核时间 */ private String audit_time; diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/product_manage/备份pdm/service/impl/BomServiceImpl.java b/mes/hd/nladmin-system/src/main/java/org/nl/wms/product_manage/备份pdm/service/impl/BomServiceImpl.java index 8cd30c24..edea866a 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/wms/product_manage/备份pdm/service/impl/BomServiceImpl.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/wms/product_manage/备份pdm/service/impl/BomServiceImpl.java @@ -7,24 +7,34 @@ import cn.hutool.core.map.MapUtil; import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; +import cn.hutool.poi.excel.ExcelReader; +import cn.hutool.poi.excel.ExcelUtil; +import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; - import lombok.RequiredArgsConstructor; +import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; import org.nl.modules.common.exception.BadRequestException; import org.nl.common.utils.SecurityUtils; +import org.nl.modules.system.util.CodeUtil; import org.nl.modules.wql.WQL; import org.nl.modules.wql.core.bean.WQLObject; import org.nl.modules.wql.util.WqlUtil; import org.nl.wms.product_manage.备份pdm.service.BomService; import org.nl.wms.product_manage.备份pdm.service.dto.BomDto; - +import org.nl.wms.system_manage.service.user.ISysUserService; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Pageable; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; +import org.springframework.web.multipart.MultipartFile; -import java.util.List; -import java.util.Map; +import javax.servlet.http.HttpServletRequest; +import java.io.InputStream; +import java.math.BigDecimal; +import java.util.*; /** * @description 服务实现 @@ -36,14 +46,18 @@ import java.util.Map; @Slf4j public class BomServiceImpl implements BomService { + @Autowired + ISysUserService userService; + @Override public Map queryAll(Map whereJson, Pageable page){ String material = MapUtil.getStr(whereJson, "material"); String bom = MapUtil.getStr(whereJson, "bom"); JSONObject map = new JSONObject(); map.put("flag", "1"); - if (StrUtil.isNotEmpty(material)) map.put("material", "%" + material + "%"); - if (StrUtil.isNotEmpty(bom)) map.put("bom", "%" + bom + "%"); + if (StrUtil.isNotEmpty(material)) + {map.put("material", "%" + material + "%");} + if (StrUtil.isNotEmpty(bom)) {map.put("bom", "%" + bom + "%");} JSONObject json = WQL.getWO("PDM_BI_BOM01").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "bom.update_time desc"); return json; } @@ -52,14 +66,14 @@ public class BomServiceImpl implements BomService { public List queryAll(Map whereJson){ WQLObject wo = WQLObject.getWQLObject("pdm_bi_bom"); JSONArray arr = wo.query().getResultJSONArray(0); - if (ObjectUtil.isNotEmpty(arr)) return arr.toJavaList(BomDto.class); + if (ObjectUtil.isNotEmpty(arr)) {return arr.toJavaList(BomDto.class);} return null; } @Override - public BomDto findById(String bom_uuid) { + public BomDto findById(String bom_id) { WQLObject wo = WQLObject.getWQLObject("pdm_bi_bom"); - JSONObject json = wo.query("bom_uuid = '" + bom_uuid + "'").uniqueResult(0); + JSONObject json = wo.query("bom_id = '" + bom_id + "'").uniqueResult(0); if (ObjectUtil.isNotEmpty(json)){ return json.toJavaObject( BomDto.class); } @@ -82,33 +96,33 @@ public class BomServiceImpl implements BomService { WQLObject wo_bom = WQLObject.getWQLObject("pdm_bi_bom"); WQLObject wo_bomdtl = WQLObject.getWQLObject("PDM_BI_BOMDtl"); final JSONArray jsonArray = param.getJSONArray("tableData"); - final String material_uuid = param.getString("material_uuid"); - final JSONObject jsonObject1 = wo_bom.query("material_uuid = '" + material_uuid + "'").uniqueResult(0); + final String material_id = param.getString("material_id"); + final JSONObject jsonObject1 = wo_bom.query("material_id = '" + material_id + "'").uniqueResult(0); if (ObjectUtil.isNotEmpty(jsonObject1)){ throw new BadRequestException("物料已经存在,请重新选择"); } String currentUserId = SecurityUtils.getCurrentUserId(); String nickName = SecurityUtils.getCurrentNickName(); - String bom_uuid = IdUtil.getSnowflake(1, 1).nextId() + ""; - param.put("bom_uuid",bom_uuid); + String bom_id = IdUtil.getSnowflake(1, 1).nextId() + ""; + param.put("bom_id",bom_id); param.put("bom_status","01"); param.put("detail_count",jsonArray.size()); param.put("create_id",currentUserId); param.put("create_name",nickName); param.put("create_time",DateUtil.now()); - param.put("update_optid",currentUserId); - param.put("update_optname",nickName); + param.put("update_id",currentUserId); + param.put("update_name",nickName); param.put("update_time",DateUtil.now()); wo_bom.insert(param); if (jsonArray.size() > 0) { for (int i = 0; i < jsonArray.size(); i++) { JSONObject map = new JSONObject(); final JSONObject jsonObject = jsonArray.getJSONObject(i); - map.put("bomdtl_uuid",IdUtil.getSnowflake(1, 1).nextId() + ""); - map.put("bom_uuid",bom_uuid); - map.put("workprocedure_uuid",jsonObject.getString("workprocedure_uuid")); - map.put("material_uuid",jsonObject.getString("material_uuid")); + map.put("bomdtl_id",IdUtil.getSnowflake(1, 1).nextId() + ""); + map.put("bom_id",bom_id); + map.put("workprocedure_id",jsonObject.getString("workprocedure_id")); + map.put("material_id",jsonObject.getString("material_id")); map.put("yield_rate",jsonObject.getString("yield_rate")); map.put("endproduct_rate",jsonObject.getString("endproduct_rate")); map.put("piece_weight",jsonObject.getString("piece_weight")); @@ -129,15 +143,15 @@ public class BomServiceImpl implements BomService { String nickName = SecurityUtils.getCurrentNickName(); param.put("detail_count",jsonArray.size()); - param.put("update_optid",currentUserId); - param.put("update_optname",nickName); + param.put("update_id",currentUserId); + param.put("update_name",nickName); param.put("update_time",DateUtil.now()); wo_bom.update(param); if (jsonArray.size() > 0) { for (int i = 0; i < jsonArray.size(); i++) { JSONObject map = new JSONObject(); final JSONObject jsonObject = jsonArray.getJSONObject(i); - map.put("bomdtl_uuid",jsonObject.getString("bomdtl_uuid")); + map.put("bomdtl_id",jsonObject.getString("bomdtl_id")); map.put("yield_rate",jsonObject.getString("yield_rate")); map.put("endproduct_rate",jsonObject.getString("endproduct_rate")); map.put("piece_weight",jsonObject.getString("piece_weight")); @@ -151,30 +165,30 @@ public class BomServiceImpl implements BomService { public void deleteAll(String[] ids) { WQLObject wo = WQLObject.getWQLObject("pdm_bi_bom"); WQLObject wo_dtl = WQLObject.getWQLObject("PDM_BI_BOMDtl"); - for (String bom_uuid: ids) { - wo.delete("bom_uuid = '"+bom_uuid+"'"); - wo_dtl.delete("bom_uuid = '"+bom_uuid+"'"); + for (String bom_id: ids) { + wo.delete("bom_id = '"+bom_id+"'"); + wo_dtl.delete("bom_id = '"+bom_id+"'"); } } @Override public JSONObject getProduceProcessRouteByMaterialId(JSONObject param) { WQLObject wo = WQLObject.getWQLObject("PDM_BI_ProductProcessRoute"); - final JSONObject jsonObject = wo.query("is_delete = '0' and productprocess_status = '20' and material_id = '" + param.getString("material_uuid") + "'").uniqueResult(0); + final JSONObject jsonObject = wo.query("is_delete = '0' and productprocess_status = '20' and material_id = '" + param.getString("material_id") + "'").uniqueResult(0); return jsonObject; } @Override public JSONObject getworkprocedureListByProduceProcessRouteId(JSONObject param) { JSONObject json = new JSONObject(); - final String material_uuid = param.getString("material_uuid"); + final String material_id = param.getString("material_id"); WQLObject wo_endrealsemimaterial = WQLObject.getWQLObject("md_me_endrealsemimaterial"); WQLObject wo_material = WQLObject.getWQLObject("md_me_materialbase"); - final JSONObject jsonEndrealsemimaterial = wo_endrealsemimaterial.query("end_material_id = '" + material_uuid + "'").uniqueResult(0); + final JSONObject jsonEndrealsemimaterial = wo_endrealsemimaterial.query("end_material_id = '" + material_id + "'").uniqueResult(0); final JSONObject semi_material = wo_material.query("is_delete = '0' and material_id = '" + jsonEndrealsemimaterial.getString("semi_material_id") + "'").uniqueResult(0); WQLObject wo = WQLObject.getWQLObject("PDM_BI_ProductProcessRouteDtl"); WQLObject wo_workprocedure = WQLObject.getWQLObject("pdm_bi_workprocedure"); - final JSONArray resultJSONArray = wo.query("productprocess_id = '" + param.getString("processroute_uuid") + "'","workprocedure_no").getResultJSONArray(0); + final JSONArray resultJSONArray = wo.query("productprocess_id = '" + param.getString("processroute_id") + "'","workprocedure_no").getResultJSONArray(0); JSONArray newJ = new JSONArray(); for (int i = 0; i < resultJSONArray.size(); i++) { JSONObject jsonObject = resultJSONArray.getJSONObject(i); @@ -190,10 +204,10 @@ public class BomServiceImpl implements BomService { @Override public JSONArray getDtl(JSONObject param) { - final String bom_uuid = param.getString("bom_uuid"); + final String bom_id = param.getString("bom_id"); JSONObject map = new JSONObject(); map.put("flag","2"); - map.put("bom_uuid",bom_uuid); + map.put("bom_id",bom_id); JSONArray json = WQL.getWO("PDM_BI_BOM01").addParamMap(map).process().getResultJSONArray(0); return json; } @@ -205,12 +219,12 @@ public class BomServiceImpl implements BomService { String currentUserId = SecurityUtils.getCurrentUserId(); String nickName = SecurityUtils.getCurrentNickName(); - final String bom_uuid = param.getString("bom_uuid"); + final String bom_id = param.getString("bom_id"); JSONObject map = new JSONObject(); - map.put("bom_uuid",bom_uuid); + map.put("bom_id",bom_id); map.put("bom_status","02"); - map.put("update_optid",currentUserId); - map.put("update_optname",nickName); + map.put("update_id",currentUserId); + map.put("update_name",nickName); map.put("update_time",DateUtil.now()); wo_bom.update(map); } @@ -222,14 +236,253 @@ public class BomServiceImpl implements BomService { String currentUserId = SecurityUtils.getCurrentUserId(); String nickName = SecurityUtils.getCurrentNickName(); - final String bom_uuid = param.getString("bom_uuid"); + final String bom_id = param.getString("bom_id"); JSONObject map = new JSONObject(); - map.put("bom_uuid",bom_uuid); + map.put("bom_id",bom_id); map.put("bom_status","01"); - map.put("update_optid",currentUserId); - map.put("update_optname",nickName); + map.put("update_id",currentUserId); + map.put("update_name",nickName); map.put("update_time",DateUtil.now()); wo_bom.update(map); } + @Override + @Transactional(rollbackFor = Exception.class) + public void excelImport(MultipartFile file, HttpServletRequest request) { + if(file.isEmpty()) { + throw new BadRequestException("文件为空,请添加数据后重新导入"); + } + try(InputStream inputStream = file.getInputStream()) { + String currentUserId = SecurityUtils.getCurrentUserId(); + String nickName = SecurityUtils.getCurrentNickName(); + //Bom主表 + WQLObject wo_pdm_bi_bom = WQLObject.getWQLObject("pdm_bi_bom"); + //Bom明细表 + WQLObject wo_pdm_bomdtl_aps = WQLObject.getWQLObject("pdm_bi_bomdtl_aps"); + //物料表 + WQLObject wo_material = WQLObject.getWQLObject("md_me_materialbase"); + //原材料对应半成品 + WQLObject wo_semirealrawmaterial = WQLObject.getWQLObject("md_me_semirealrawmaterial"); + //设备表 + WQLObject wo_device = WQLObject.getWQLObject("pdm_bi_device"); + //工序表 + WQLObject wo_workprocedure = WQLObject.getWQLObject("pdm_bi_workprocedure"); + //工艺路线 + WQLObject wo_processroute = WQLObject.getWQLObject("pdm_bi_processroute"); + ExcelReader excelReader = ExcelUtil.getReader(inputStream, 0); + List> read = excelReader.read(0, excelReader.getRowCount()); + Map errorMap = new HashMap(); + boolean isCreateBom = true; + // 循环获取的数据 + row: + for(int i = 1; i < read.size(); i++) { + List list = read.get(i); + if(ObjectUtil.isEmpty(list)) { + continue; + } + JSONObject param = new JSONObject(); + //循环每一行 + col: + for(int j = 0; j < list.size(); j++) { + String col = null == list.get(j) ? "" : String.valueOf(list.get(j)); + if(j == 0) { + if(StringUtils.isBlank(col)) { + throw new BadRequestException("物料编号不能为空!"); + } + JSONObject jsonMaterial = wo_material.query("is_delete = '0' and material_code = '" + col + "'").uniqueResult(0); + if(ObjectUtil.isEmpty(jsonMaterial)) { + errorMap.put("第" + i + "行" + col, "物料规格对应物料信息不存在"); + } + else{ + JSONObject jsonBom = wo_pdm_bi_bom.query("material_id = '" + jsonMaterial.getString("material_id") + "'").uniqueResult(0); + if(!ObjectUtil.isEmpty(jsonBom)) { + param.put("bom_id", jsonBom.getString("bom_id")); + isCreateBom = false; + } + else{ + param.put("bom_id", IdUtil.getSnowflake(1, 1).nextId()); + param.put("bom_code", "BOM" + jsonMaterial.getString("material_spec")); + isCreateBom = true; + } + param.put("material_code", col); + param.put("material_id", jsonMaterial.getString("material_id")); + param.put("material_spec", jsonMaterial.getString("material_spec")); + param.put("bom_name", jsonMaterial.getString("material_spec")); + } + } + if(j == 3) { + //数量计量单位名称 + param.put("qty_unit_name", col); + } + if(j == 4) { + //工艺路线代码 + if(StringUtils.isBlank(col)) { + throw new BadRequestException("工艺路线代码不能为空"); + } + JSONObject jsonProcessroute = wo_processroute.query("is_delete = '0' and processroute_code = '" + col + "'").uniqueResult(0); + if(ObjectUtil.isEmpty(jsonProcessroute)) { + errorMap.put("第" + i + "行" + col, "工艺路线信息不存在"); + } + else{ + param.put("processroute_id", jsonProcessroute.getString("processroute_id")); + param.put("processroute_name", jsonProcessroute.getString("processroute_name")); + } + param.put("processroute_code", col); + } + // if(j == 6) { + // //成材率 + // if(StringUtils.isBlank(col)) { + // throw new BadRequestException("成材率不能为空"); + // } + // param.put("yield_rate", col); + // } + // if(j == 7) { + // //合格率 + // if(StringUtils.isBlank(col)) { + // throw new BadRequestException("合格率不能为空"); + // } + // param.put("endproduct_rate", col); + // } + if(j == 8) { + //产能 + if(StringUtils.isBlank(col)) { + param.put("manufacture", "0"); + } + else{ + param.put("manufacture", col + "ph"); + } + } + if(j == 9) { + //产品单重 + param.put("piece_weight", col); + } + if(j == 10) { + //工序编号 + if(StringUtils.isBlank(col)) { + throw new BadRequestException("工序编号不能为空"); + } + //绕过仓储工序 + if(col.contains("A1_CC")) { + break; + } + //判断是否前段工序 + if(col.contains("A1_SKQX") || col.contains("A1_KZ") || col.contains("A1_BZ") || col.contains("A1_MP")) { + param.put("is_front", "0"); + } + else{ + param.put("is_front", "1"); + } + JSONObject jsonWorkprocedure = wo_workprocedure.query("is_used = '1' and workprocedure_code = '" + col + "'").uniqueResult(0); + if(ObjectUtil.isEmpty(jsonWorkprocedure)) { + errorMap.put("请检查第" + i + "行" + col , "所匹配的工序信息不存在!"); + } + else{ + param.put("workprocedure_id", jsonWorkprocedure.getString("workprocedure_id")); + param.put("workprocedure_name", jsonWorkprocedure.getString("workprocedure_name")); + } + } + if(j == 12) { + if(!StringUtils.isBlank(col)) { + //工序顺序号 + param.put("workprocedure_no", col); + JSONObject bomDtlParam = new JSONObject(); + param.put("yield_rate", "0"); + param.put("endproduct_rate", "1"); + bomDtlParam.put("bomdtl_id", IdUtil.getSnowflake(1, 1).nextId()); + bomDtlParam.put("bom_id", param.getString("bom_id")); + bomDtlParam.put("material_id", param.getString("material_id")); + bomDtlParam.put("material_code", param.getString("material_code")); + bomDtlParam.put("material_spec", param.getString("material_spec")); + bomDtlParam.put("piece_weight", param.getString("piece_weight")); + bomDtlParam.put("qty_unit_name", param.getString("qty_unit_name")); + bomDtlParam.put("processroute_id", param.getString("processroute_id")); + bomDtlParam.put("workprocedure_id", param.getString("workprocedure_id")); + bomDtlParam.put("workprocedure_no", param.getString("workprocedure_no")); + bomDtlParam.put("workprocedure_name", param.getString("workprocedure_name")); + bomDtlParam.put("connection_method", "ES"); + bomDtlParam.put("is_front", param.getString("is_front")); + bomDtlParam.put("bom_status", "01"); + bomDtlParam.put("create_id", currentUserId); + bomDtlParam.put("create_name", nickName); + bomDtlParam.put("create_time", DateUtil.now()); + bomDtlParam.put("manufacture", param.getString("manufacture")); + bomDtlParam.put("instruction_type", "I"); + bomDtlParam.put("instruction_code", "In0"); + bomDtlParam.put("yield_rate", param.getString("yield_rate")); + bomDtlParam.put("endproduct_rate", param.getString("endproduct_rate")); + if("10".equals(col)) { + bomDtlParam.put("instruction_code", "In"); + JSONObject rawmaterialJson = wo_semirealrawmaterial.query("semi_material_id = '" + param.getString("material_id") + "'").uniqueResult(0); + if(!ObjectUtil.isEmpty(rawmaterialJson)) { + bomDtlParam.put("resources", rawmaterialJson.getString("raw_material_code")); + bomDtlParam.put("manufacture", rawmaterialJson.getString("rate_qty")); + } + else{ + bomDtlParam.put("resources", "0"); + bomDtlParam.put("manufacture", "0"); + } + } + else{ + //后段暂无产能 + int no = Integer.parseInt(col) - 10; + bomDtlParam.put("resources", param.getString("material_code") + "-" + no); + bomDtlParam.put("manufacture", ""); + } + //插入原材料明细 + wo_pdm_bomdtl_aps.insert(bomDtlParam); + } + } + if(j == 13) { + //插入设备明细 + JSONArray deviceList = wo_device.query("is_delete = '0' and product_area = 'A1' and workprocedure_id = '" + param.getString("workprocedure_id") + "'").getResultJSONArray(0); + JSONObject bomDtlParam = new JSONObject(); + for(int d = 0; d < deviceList.size(); d++) { + JSONObject device = deviceList.getJSONObject(d); + bomDtlParam.put("resources", device.getString("device_code")); + bomDtlParam.put("bomdtl_id", IdUtil.getSnowflake(1, 1).nextId()); + bomDtlParam.put("bom_id", param.getString("bom_id")); + bomDtlParam.put("material_id", param.getString("material_id")); + bomDtlParam.put("material_code", param.getString("material_code")); + bomDtlParam.put("material_spec", param.getString("material_spec")); + bomDtlParam.put("qty_unit_name", param.getString("qty_unit_name")); + bomDtlParam.put("processroute_id", param.getString("processroute_id")); + bomDtlParam.put("workprocedure_id", param.getString("workprocedure_id")); + bomDtlParam.put("workprocedure_no", param.getString("workprocedure_no")); + bomDtlParam.put("workprocedure_name", param.getString("workprocedure_name")); + bomDtlParam.put("is_front", param.getString("is_front")); + bomDtlParam.put("piece_weight", param.getString("piece_weight")); + bomDtlParam.put("connection_method", "ES"); + bomDtlParam.put("bom_status", "01"); + bomDtlParam.put("create_id", currentUserId); + bomDtlParam.put("create_name", nickName); + bomDtlParam.put("create_time", DateUtil.now()); + bomDtlParam.put("manufacture", param.getString("manufacture")); + bomDtlParam.put("instruction_type", "U"); + bomDtlParam.put("instruction_code", "M"); + //插入明细表 + wo_pdm_bomdtl_aps.insert(bomDtlParam); + } + } + } + param.put("bom_status", "01"); + param.put("create_mode", "03"); + param.put("create_id", currentUserId); + param.put("create_name", nickName); + param.put("create_time", DateUtil.now()); + if(isCreateBom) { + //插入主表 + wo_pdm_bi_bom.insert(param); + } + if(!CollectionUtils.isEmpty(errorMap)) { + throw new BadRequestException(JSON.toJSONString(errorMap)); + } + } + } + catch(Exception e) { + e.printStackTrace(); + throw new BadRequestException(e.getMessage()); + } + } + + } diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/product_manage/备份pdm/service/impl/FactoryCalendarServiceImpl.java b/mes/hd/nladmin-system/src/main/java/org/nl/wms/product_manage/备份pdm/service/impl/FactoryCalendarServiceImpl.java index 7f0ae7ee..bf878e81 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/wms/product_manage/备份pdm/service/impl/FactoryCalendarServiceImpl.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/wms/product_manage/备份pdm/service/impl/FactoryCalendarServiceImpl.java @@ -224,8 +224,8 @@ public class FactoryCalendarServiceImpl implements FactoryCalendarService{ JSONObject param = new JSONObject(); param.put("factorycalendar_id", String.valueOf(factorycalendar_id)); param.put("is_delete", "1"); - param.put("update_optid", currentUserId); - param.put("update_optname", nickName); + param.put("update_id", currentUserId); + param.put("update_name", nickName); param.put("update_time", DateUtil.now()); wo.update(param); } diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/product_manage/备份pdm/wql/PDM_BI_BOM01.wql b/mes/hd/nladmin-system/src/main/java/org/nl/wms/product_manage/备份pdm/wql/PDM_BI_BOM01.wql index 72b56cfb..a80256a1 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/wms/product_manage/备份pdm/wql/PDM_BI_BOM01.wql +++ b/mes/hd/nladmin-system/src/main/java/org/nl/wms/product_manage/备份pdm/wql/PDM_BI_BOM01.wql @@ -16,7 +16,7 @@ 输入.flag TYPEAS s_string 输入.bom TYPEAS s_string 输入.material TYPEAS s_string - 输入.bom_uuid TYPEAS s_string + 输入.bom_id TYPEAS s_string [临时表] @@ -50,8 +50,8 @@ material.material_spec FROM PDM_BI_BOM bom - left join md_me_materialbase material on bom.material_uuid = material.material_id - left join PDM_BI_ProductProcessRoute productProcessRoute on bom.processroute_uuid = productProcessRoute.productprocess_id + left join md_me_materialbase material on bom.material_id = material.material_id + left join PDM_BI_ProductProcessRoute productProcessRoute on bom.processroute_id = productProcessRoute.productprocess_id WHERE 1 = 1 OPTION 输入.material <> "" @@ -77,10 +77,10 @@ material.material_name FROM PDM_BI_BOMDtl dtl - LEFT JOIN pdm_bi_workprocedure workprocedure ON dtl.workprocedure_uuid = workprocedure.workprocedure_id - LEFT JOIN md_me_materialbase material ON dtl.material_uuid = material.material_id + LEFT JOIN pdm_bi_workprocedure workprocedure ON dtl.workprocedure_id = workprocedure.workprocedure_id + LEFT JOIN md_me_materialbase material ON dtl.material_id = material.material_id where - dtl.bom_uuid = 输入.bom_uuid + dtl.bom_id = 输入.bom_id order by dtl.seq_no ENDSELECT diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/product_manage/备份pdm/wql/pdm.xls b/mes/hd/nladmin-system/src/main/java/org/nl/wms/product_manage/备份pdm/wql/pdm.xls index d00588e9..66f68e16 100644 Binary files a/mes/hd/nladmin-system/src/main/java/org/nl/wms/product_manage/备份pdm/wql/pdm.xls and b/mes/hd/nladmin-system/src/main/java/org/nl/wms/product_manage/备份pdm/wql/pdm.xls differ diff --git a/mes/qd/src/api/wms/pdm/bom.js b/mes/qd/src/api/wms/pdm/bom.js index d1b6c425..bb8c6c0d 100644 --- a/mes/qd/src/api/wms/pdm/bom.js +++ b/mes/qd/src/api/wms/pdm/bom.js @@ -64,4 +64,12 @@ export function cancelSubmit(data) { }) } -export default { add, edit, del, cancelSubmit, submits, getDtl, getProduceProcessRouteByMaterialId, getworkprocedureListByProduceProcessRouteId } +export function excelImport(data) { + return request({ + url: 'api/bom/excelImport', + method: 'post', + data + }) +} + +export default { add, edit, del, cancelSubmit, submits, getDtl, getProduceProcessRouteByMaterialId, getworkprocedureListByProduceProcessRouteId, excelImport } diff --git a/mes/qd/src/views/wms/masterdata_manage/master/semirealrawmaterial/index.vue b/mes/qd/src/views/wms/masterdata_manage/master/semirealrawmaterial/index.vue index c3938cff..c1b19b1d 100644 --- a/mes/qd/src/views/wms/masterdata_manage/master/semirealrawmaterial/index.vue +++ b/mes/qd/src/views/wms/masterdata_manage/master/semirealrawmaterial/index.vue @@ -5,9 +5,16 @@
- - + +
- + @@ -80,16 +87,16 @@ :header-cell-style="{'text-align':'center'}" @selection-change="crud.selectionChangeHandler" > - - - - - - - - - - + + + + + + + + + + + diff --git a/mes/qd/src/views/wms/pdm/base/bom/index.vue b/mes/qd/src/views/wms/pdm/base/bom/index.vue index 9776b6d2..e28c3726 100644 --- a/mes/qd/src/views/wms/pdm/base/bom/index.vue +++ b/mes/qd/src/views/wms/pdm/base/bom/index.vue @@ -12,6 +12,16 @@ + + 导入 + {{ scope.row.bom_code }} - - - - - - - - + + + + + + + + - + - + @@ -87,12 +102,13 @@ import crudOperation from '@crud/CRUD.operation' import udOperation from '@crud/UD.operation' import pagination from '@crud/Pagination' import AddDialog from '@/views/wms/pdm/base/bom/AddDialog' +import UploadDialog from '@/views/wms/pdm/base/bom/UploadDialog' const defaultForm = { bom_uuid: null, bom_code: null, bom_name: null, material_uuid: null, processroute_uuid: null, yield_rate: null, endproduct_rate: null, bom_status: null, detail_count: null, remark: null, create_id: null, create_name: null, create_time: null, update_optid: null, update_optname: null, update_time: null } export default { name: 'Bom', dicts: ['BOM_STATUS'], - components: { pagination, crudOperation, rrOperation, udOperation, AddDialog }, + components: { pagination, crudOperation, rrOperation, udOperation, AddDialog, UploadDialog }, mixins: [presenter(), header(), form(defaultForm), crud()], cruds() { return CRUD({ title: 'BOM单管理', url: 'api/bom', idField: 'bom_uuid', sort: 'bom_uuid,desc', @@ -107,6 +123,7 @@ export default { }, data() { return { + uploadShow: false, permission: { }, rules: { @@ -149,6 +166,9 @@ export default { return true } }, + tableChanged3() { + this.crud.toQuery() + }, // 取消提交 cancelSubmit(row) { crudBom.cancelSubmit({ bom_uuid: row.bom_uuid }).then(res => {