diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/baseinfo/BaseBomInfoController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/baseinfo/BaseBomInfoController.java new file mode 100644 index 0000000..c89aac5 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/baseinfo/BaseBomInfoController.java @@ -0,0 +1,169 @@ +package com.ruoyi.web.controller.baseinfo; + +import java.util.List; + +import com.ruoyi.baseinfo.domain.BaseMaterialInfo; +import com.ruoyi.baseinfo.service.IBaseMaterialInfoService; +import com.ruoyi.baseinfo.service.IBaseMaterialtypeInfoService; +import com.ruoyi.system.domain.SysDept; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.baseinfo.domain.BaseBomInfo; +import com.ruoyi.baseinfo.service.IBaseBomInfoService; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.core.page.TableDataInfo; + +/** + * BOM基础信息Controller + * + * @author CaesarBao + * @date 2020-11-04 + */ +@Controller +@RequestMapping("/baseinfo/bominfo") +public class BaseBomInfoController extends BaseController +{ + private String prefix = "baseinfo/bominfo"; + + @Autowired + private IBaseBomInfoService baseBomInfoService; + @Autowired + private IBaseMaterialtypeInfoService baseMaterialtypeInfoService; + @Autowired + private IBaseMaterialInfoService baseMaterialInfoService; + + @RequiresPermissions("baseinfo:bominfo:view") + @GetMapping() + public String bominfo() + { + return prefix + "/bominfo"; + } + + /** + * 查询BOM基础信息列表 + */ +// @RequiresPermissions("baseinfo:bominfo:list") +// @PostMapping("/list") +// @ResponseBody +// public TableDataInfo list1(BaseBomInfo baseBomInfo) +// { +// startPage(); +// List list = baseBomInfoService.selectBaseBomInfoList(baseBomInfo); +// return getDataTable(list); +// } + + @RequiresPermissions("baseinfo:bominfo:list") + @PostMapping("/list") + @ResponseBody + public List list(BaseBomInfo baseBomInfo) + { + List list = baseBomInfoService.selectBaseBomInfoList(baseBomInfo); + return list; + } + /** + * 导出BOM基础信息列表 + */ + @RequiresPermissions("baseinfo:bominfo:export") + @Log(title = "BOM基础信息", businessType = BusinessType.EXPORT) + @PostMapping("/export") + @ResponseBody + public AjaxResult export(BaseBomInfo baseBomInfo) + { + List list = baseBomInfoService.selectBaseBomInfoList(baseBomInfo); + ExcelUtil util = new ExcelUtil(BaseBomInfo.class); + return util.exportExcel(list, "bominfo"); + } + + /** + * 新增BOM基础信息 + */ + @GetMapping("/add") + public String add(ModelMap mmap) + { + BaseMaterialInfo BaseMaterialInfo = new BaseMaterialInfo(); + mmap.put("cbmaterialtypeInfo",baseMaterialtypeInfoService.selectAddBaseMaterialtypeInfoList()); + mmap.put("cbmaterialInfo",baseMaterialInfoService.selectBaseMaterialInfoList(BaseMaterialInfo)); + return prefix + "/addproduct"; + } + /** + * 新增保存BOM基础信息 + */ + @RequiresPermissions("baseinfo:bominfo:addproduct") + @Log(title = "BOM基础信息", businessType = BusinessType.INSERT) + @PostMapping("/addproduct") + @ResponseBody + public AjaxResult addSaveproduct(BaseBomInfo baseBomInfo) + { + baseBomInfo.setpId(0L); + return toAjax(baseBomInfoService.insertBaseBomInfo(baseBomInfo)); + } + /** + * 新增BOM物料信息 + */ + @GetMapping("/add/{parentId}") + public String add(@PathVariable("parentId") Long parentId, ModelMap mmap) + { + BaseMaterialInfo BaseMaterialInfo = new BaseMaterialInfo(); + mmap.put("parent", baseBomInfoService.selectBaseBomInfoById(parentId)); + mmap.put("cbmaterialtypeInfo",baseMaterialtypeInfoService.selectAddBaseMaterialtypeInfoList()); + mmap.put("cbmaterialInfo",baseMaterialInfoService.selectBaseMaterialInfoList(BaseMaterialInfo)); + return prefix + "/add"; + } + /** + * 新增保存BOM基础信息 + */ + @RequiresPermissions("baseinfo:bominfo:add") + @Log(title = "BOM基础信息", businessType = BusinessType.INSERT) + @PostMapping("/add") + @ResponseBody + public AjaxResult addSave(BaseBomInfo baseBomInfo) + { + return toAjax(baseBomInfoService.insertBaseBomInfo(baseBomInfo)); + } + + /** + * 修改BOM基础信息 + */ + @GetMapping("/edit/{objid}") + public String edit(@PathVariable("objid") Long objid, ModelMap mmap) + { + BaseBomInfo baseBomInfo = baseBomInfoService.selectBaseBomInfoById(objid); + mmap.put("baseBomInfo", baseBomInfo); + return prefix + "/edit"; + } + + /** + * 修改保存BOM基础信息 + */ + @RequiresPermissions("baseinfo:bominfo:edit") + @Log(title = "BOM基础信息", businessType = BusinessType.UPDATE) + @PostMapping("/edit") + @ResponseBody + public AjaxResult editSave(BaseBomInfo baseBomInfo) + { + return toAjax(baseBomInfoService.updateBaseBomInfo(baseBomInfo)); + } + + /** + * 删除BOM基础信息 + */ + @RequiresPermissions("baseinfo:bominfo:remove") + @Log(title = "BOM基础信息", businessType = BusinessType.DELETE) + @PostMapping( "/remove") + @ResponseBody + public AjaxResult remove(String ids) + { + return toAjax(baseBomInfoService.deleteBaseBomInfoByIds(ids)); + } +} diff --git a/ruoyi-admin/src/main/resources/templates/baseinfo/bominfo/add.html b/ruoyi-admin/src/main/resources/templates/baseinfo/bominfo/add.html new file mode 100644 index 0000000..296b5cb --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/baseinfo/bominfo/add.html @@ -0,0 +1,67 @@ + + + + + + + + +
+
+ + + + + + +
+ +
+
+ +
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/baseinfo/bominfo/addproduct.html b/ruoyi-admin/src/main/resources/templates/baseinfo/bominfo/addproduct.html new file mode 100644 index 0000000..4161fe1 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/baseinfo/bominfo/addproduct.html @@ -0,0 +1,67 @@ + + + + + + + + +
+
+ + + + + + + + + + + + + + +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/baseinfo/bominfo/bominfo.html b/ruoyi-admin/src/main/resources/templates/baseinfo/bominfo/bominfo.html new file mode 100644 index 0000000..db05f91 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/baseinfo/bominfo/bominfo.html @@ -0,0 +1,130 @@ + + + + + + +
+
+
+
+
+
    +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • +  搜索 +  重置 +
  • +
+
+
+
+ + +
+
+
+
+
+ + + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/baseinfo/bominfo/edit.html b/ruoyi-admin/src/main/resources/templates/baseinfo/bominfo/edit.html new file mode 100644 index 0000000..0ab5ee6 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/baseinfo/bominfo/edit.html @@ -0,0 +1,57 @@ + + + + + + +
+
+ + + + + + + +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+
+ + +
+
+
+
+
+ + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/baseinfo/deviceinfo/add.html b/ruoyi-admin/src/main/resources/templates/baseinfo/deviceinfo/add.html index 2f9d630..d796646 100644 --- a/ruoyi-admin/src/main/resources/templates/baseinfo/deviceinfo/add.html +++ b/ruoyi-admin/src/main/resources/templates/baseinfo/deviceinfo/add.html @@ -1,63 +1,67 @@ - - - - - - -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
-
- - - + + + + + + + + +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + + + + \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/baseinfo/domain/BaseBomInfo.java b/ruoyi-system/src/main/java/com/ruoyi/baseinfo/domain/BaseBomInfo.java new file mode 100644 index 0000000..8216171 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/baseinfo/domain/BaseBomInfo.java @@ -0,0 +1,119 @@ +package com.ruoyi.baseinfo.domain; + +import lombok.Data; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * BOM基础信息对象 base_bom_info + * + * @author CaesarBao + * @date 2020-11-04 + */ +@Data +public class BaseBomInfo extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键ID */ + private Long bomId; + + /** 父节点ID */ + @Excel(name = "父节点ID") + private Long pId; + + + /** 物料类型ID */ + @Excel(name = "物料类型ID") + private String materialTypeId; + + /** 物料ID */ + @Excel(name = "物料ID") + private String materialId; + + /** 状态标志(0代表可用 1代表停用) */ + @Excel(name = "状态标志", readConverterExp = "0=代表可用,1=代表停用") + private String status; + + /** 删除标志(0代表存在 1代表删除) */ + private String delFlag; + + private String materialTypeName; + + private String materialName; + + public void setBomId(Long objid) + { + this.bomId = objid; + } + + public Long getBomId() + { + return bomId; + } + public void setpId(Long pId) + { + this.pId = pId; + } + + public Long getpId() + { + return pId; + } + + public void setMaterialTypeId(String materialTypeId) + { + this.materialTypeId = materialTypeId; + } + + public String getMaterialTypeId() + { + return materialTypeId; + } + public void setMaterialId(String materialId) + { + this.materialId = materialId; + } + + public String getMaterialId() + { + return materialId; + } + public void setStatus(String status) + { + this.status = status; + } + + public String getStatus() + { + return status; + } + public void setDelFlag(String delFlag) + { + this.delFlag = delFlag; + } + + public String getDelFlag() + { + return delFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("bomId", getBomId()) + .append("pId", getpId()) + .append("materialTypeId", getMaterialTypeId()) + .append("materialId", getMaterialId()) + .append("status", getStatus()) + .append("remark", getRemark()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("delFlag", getDelFlag()) + .toString(); + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/baseinfo/mapper/BaseBomInfoMapper.java b/ruoyi-system/src/main/java/com/ruoyi/baseinfo/mapper/BaseBomInfoMapper.java new file mode 100644 index 0000000..3554dfe --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/baseinfo/mapper/BaseBomInfoMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.baseinfo.mapper; + +import java.util.List; +import com.ruoyi.baseinfo.domain.BaseBomInfo; + +/** + * BOM基础信息Mapper接口 + * + * @author CaesarBao + * @date 2020-11-04 + */ +public interface BaseBomInfoMapper +{ + /** + * 查询BOM基础信息 + * + * @param objid BOM基础信息ID + * @return BOM基础信息 + */ + public BaseBomInfo selectBaseBomInfoById(Long objid); + + /** + * 查询BOM基础信息列表 + * + * @param baseBomInfo BOM基础信息 + * @return BOM基础信息集合 + */ + public List selectBaseBomInfoList(BaseBomInfo baseBomInfo); + + /** + * 新增BOM基础信息 + * + * @param baseBomInfo BOM基础信息 + * @return 结果 + */ + public int insertBaseBomInfo(BaseBomInfo baseBomInfo); + + /** + * 修改BOM基础信息 + * + * @param baseBomInfo BOM基础信息 + * @return 结果 + */ + public int updateBaseBomInfo(BaseBomInfo baseBomInfo); + + /** + * 删除BOM基础信息 + * + * @param objid BOM基础信息ID + * @return 结果 + */ + public int deleteBaseBomInfoById(Long objid); + + /** + * 批量删除BOM基础信息 + * + * @param objids 需要删除的数据ID + * @return 结果 + */ + public int deleteBaseBomInfoByIds(String[] objids); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/baseinfo/service/IBaseBomInfoService.java b/ruoyi-system/src/main/java/com/ruoyi/baseinfo/service/IBaseBomInfoService.java new file mode 100644 index 0000000..2a9dd62 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/baseinfo/service/IBaseBomInfoService.java @@ -0,0 +1,61 @@ +package com.ruoyi.baseinfo.service; + +import java.util.List; +import com.ruoyi.baseinfo.domain.BaseBomInfo; + +/** + * BOM基础信息Service接口 + * + * @author CaesarBao + * @date 2020-11-04 + */ +public interface IBaseBomInfoService +{ + /** + * 查询BOM基础信息 + * + * @param objid BOM基础信息ID + * @return BOM基础信息 + */ + public BaseBomInfo selectBaseBomInfoById(Long objid); + + /** + * 查询BOM基础信息列表 + * + * @param baseBomInfo BOM基础信息 + * @return BOM基础信息集合 + */ + public List selectBaseBomInfoList(BaseBomInfo baseBomInfo); + + /** + * 新增BOM基础信息 + * + * @param baseBomInfo BOM基础信息 + * @return 结果 + */ + public int insertBaseBomInfo(BaseBomInfo baseBomInfo); + + /** + * 修改BOM基础信息 + * + * @param baseBomInfo BOM基础信息 + * @return 结果 + */ + public int updateBaseBomInfo(BaseBomInfo baseBomInfo); + + /** + * 批量删除BOM基础信息 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteBaseBomInfoByIds(String ids); + + /** + * 删除BOM基础信息信息 + * + * @param objid BOM基础信息ID + * @return 结果 + */ + public int deleteBaseBomInfoById(Long objid); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/baseinfo/service/impl/BaseBomInfoServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/baseinfo/service/impl/BaseBomInfoServiceImpl.java new file mode 100644 index 0000000..52d2f72 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/baseinfo/service/impl/BaseBomInfoServiceImpl.java @@ -0,0 +1,97 @@ +package com.ruoyi.baseinfo.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.baseinfo.mapper.BaseBomInfoMapper; +import com.ruoyi.baseinfo.domain.BaseBomInfo; +import com.ruoyi.baseinfo.service.IBaseBomInfoService; +import com.ruoyi.common.core.text.Convert; + +/** + * BOM基础信息Service业务层处理 + * + * @author CaesarBao + * @date 2020-11-04 + */ +@Service +public class BaseBomInfoServiceImpl implements IBaseBomInfoService +{ + @Autowired + private BaseBomInfoMapper baseBomInfoMapper; + + /** + * 查询BOM基础信息 + * + * @param objid BOM基础信息ID + * @return BOM基础信息 + */ + @Override + public BaseBomInfo selectBaseBomInfoById(Long objid) + { + return baseBomInfoMapper.selectBaseBomInfoById(objid); + } + + /** + * 查询BOM基础信息列表 + * + * @param baseBomInfo BOM基础信息 + * @return BOM基础信息 + */ + @Override + public List selectBaseBomInfoList(BaseBomInfo baseBomInfo) + { + return baseBomInfoMapper.selectBaseBomInfoList(baseBomInfo); + } + + /** + * 新增BOM基础信息 + * + * @param baseBomInfo BOM基础信息 + * @return 结果 + */ + @Override + public int insertBaseBomInfo(BaseBomInfo baseBomInfo) + { + baseBomInfo.setCreateTime(DateUtils.getNowDate()); + return baseBomInfoMapper.insertBaseBomInfo(baseBomInfo); + } + + /** + * 修改BOM基础信息 + * + * @param baseBomInfo BOM基础信息 + * @return 结果 + */ + @Override + public int updateBaseBomInfo(BaseBomInfo baseBomInfo) + { + baseBomInfo.setUpdateTime(DateUtils.getNowDate()); + return baseBomInfoMapper.updateBaseBomInfo(baseBomInfo); + } + + /** + * 删除BOM基础信息对象 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + @Override + public int deleteBaseBomInfoByIds(String ids) + { + return baseBomInfoMapper.deleteBaseBomInfoByIds(Convert.toStrArray(ids)); + } + + /** + * 删除BOM基础信息信息 + * + * @param objid BOM基础信息ID + * @return 结果 + */ + @Override + public int deleteBaseBomInfoById(Long objid) + { + return baseBomInfoMapper.deleteBaseBomInfoById(objid); + } +} diff --git a/ruoyi-system/src/main/resources/mapper/baseinfo/BaseBomInfoMapper.xml b/ruoyi-system/src/main/resources/mapper/baseinfo/BaseBomInfoMapper.xml new file mode 100644 index 0000000..7e6c0e9 --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/baseinfo/BaseBomInfoMapper.xml @@ -0,0 +1,105 @@ + + + + + + + + + + + + + + + + + + + + + + select bom_id, p_id, material_type_id, material_id, status, remark, create_by, create_time, update_by, update_time, del_flag from base_bom_info + + + + + + + + insert into base_bom_info + + bom_id, + p_id, + material_type_id, + material_id, + status, + remark, + create_by, + create_time, + update_by, + update_time, + del_flag, + + + #{bom_id}, + #{pId}, + #{materialTypeId}, + #{materialId}, + #{status}, + #{remark}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{delFlag}, + + + + + update base_bom_info + + p_id = #{pId}, + material_type_id = #{materialTypeId}, + material_id = #{materialId}, + status = #{status}, + remark = #{remark}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + del_flag = #{delFlag}, + + where bom_id = #{bomId} + + + + delete from base_bom_info where bom_id = #{bomId} + + + + delete from base_bom_info where bom_id in + + #{bomId} + + + + + diff --git a/sql/生产管理系统数据库备份 b/sql/生产管理系统数据库备份 index 9b2be46..7b152b9 100644 Binary files a/sql/生产管理系统数据库备份 and b/sql/生产管理系统数据库备份 differ