diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesMaterialBomController.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesMaterialBomController.java new file mode 100644 index 00000000..1418d6a1 --- /dev/null +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesMaterialBomController.java @@ -0,0 +1,102 @@ +package com.hw.mes.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.hw.common.log.annotation.Log; +import com.hw.common.log.enums.BusinessType; +import com.hw.common.security.annotation.RequiresPermissions; +import com.hw.mes.domain.MesMaterialBom; +import com.hw.mes.service.IMesMaterialBomService; +import com.hw.common.core.web.controller.BaseController; +import com.hw.common.core.web.domain.AjaxResult; +import com.hw.common.core.utils.poi.ExcelUtil; + +/** + * 物料BOM信息Controller + * + * @author Yinq + * @date 2024-01-30 + */ +@RestController +@RequestMapping("/materialBom") +public class MesMaterialBomController extends BaseController +{ + @Autowired + private IMesMaterialBomService mesMaterialBomService; + + /** + * 查询物料BOM信息列表 + */ + @RequiresPermissions("mes:materialBom:list") + @GetMapping("/list") + public AjaxResult list(MesMaterialBom mesMaterialBom) + { + List list = mesMaterialBomService.selectMesMaterialBomList(mesMaterialBom); + return success(list); + } + + /** + * 导出物料BOM信息列表 + */ + @RequiresPermissions("mes:materialBom:export") + @Log(title = "物料BOM信息", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, MesMaterialBom mesMaterialBom) + { + List list = mesMaterialBomService.selectMesMaterialBomList(mesMaterialBom); + ExcelUtil util = new ExcelUtil(MesMaterialBom.class); + util.exportExcel(response, list, "物料BOM信息数据"); + } + + /** + * 获取物料BOM信息详细信息 + */ + @RequiresPermissions("mes:materialBom:query") + @GetMapping(value = "/{materialBomId}") + public AjaxResult getInfo(@PathVariable("materialBomId") Long materialBomId) + { + return success(mesMaterialBomService.selectMesMaterialBomByMaterialBomId(materialBomId)); + } + + /** + * 新增物料BOM信息 + */ + @RequiresPermissions("mes:materialBom:add") + @Log(title = "物料BOM信息", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody MesMaterialBom mesMaterialBom) + { + return toAjax(mesMaterialBomService.insertMesMaterialBom(mesMaterialBom)); + } + + /** + * 修改物料BOM信息 + */ + @RequiresPermissions("mes:materialBom:edit") + @Log(title = "物料BOM信息", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody MesMaterialBom mesMaterialBom) + { + return toAjax(mesMaterialBomService.updateMesMaterialBom(mesMaterialBom)); + } + + /** + * 删除物料BOM信息 + */ + @RequiresPermissions("mes:materialBom:remove") + @Log(title = "物料BOM信息", businessType = BusinessType.DELETE) + @DeleteMapping("/{materialBomIds}") + public AjaxResult remove(@PathVariable Long[] materialBomIds) + { + return toAjax(mesMaterialBomService.deleteMesMaterialBomByMaterialBomIds(materialBomIds)); + } +} diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesMaterialBom.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesMaterialBom.java new file mode 100644 index 00000000..177555a3 --- /dev/null +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesMaterialBom.java @@ -0,0 +1,150 @@ +package com.hw.mes.domain; + +import java.math.BigDecimal; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.hw.common.core.annotation.Excel; +import com.hw.common.core.web.domain.TreeEntity; + +/** + * 物料BOM信息对象 mes_material_bom + * + * @author Yinq + * @date 2024-01-30 + */ +public class MesMaterialBom extends TreeEntity { + private static final long serialVersionUID = 1L; + + /** + * 主键标识 + */ + private Long materialBomId; + + /** + * 物料ID + */ + @Excel(name = "物料ID") + private Long materialId; + + /** + * 物料名称 + */ + @Excel(name = "物料名称") + private String materialName; + + /** + * 标准数量 + */ + @Excel(name = "标准数量") + private BigDecimal standardAmount; + + /** + * 顶级标识 + */ + @Excel(name = "顶级标识") + private Long topFlag; + + /** + * 校验类型 + */ + @Excel(name = "校验类型") + private String checkType; + + /** + * 项目ID + */ + @Excel(name = "项目ID") + private Long projectId; + + /** + * 激活标识 + */ + @Excel(name = "激活标识") + private String activeFlag; + + public void setMaterialBomId(Long materialBomId) { + this.materialBomId = materialBomId; + } + + public Long getMaterialBomId() { + return materialBomId; + } + + public void setMaterialId(Long materialId) { + this.materialId = materialId; + } + + public Long getMaterialId() { + return materialId; + } + + public void setMaterialName(String materialName) { + this.materialName = materialName; + } + + public String getMaterialName() { + return materialName; + } + + public void setStandardAmount(BigDecimal standardAmount) { + this.standardAmount = standardAmount; + } + + public BigDecimal getStandardAmount() { + return standardAmount; + } + + public void setTopFlag(Long topFlag) { + this.topFlag = topFlag; + } + + public Long getTopFlag() { + return topFlag; + } + + public void setCheckType(String checkType) { + this.checkType = checkType; + } + + public String getCheckType() { + return checkType; + } + + public void setProjectId(Long projectId) { + this.projectId = projectId; + } + + public Long getProjectId() { + return projectId; + } + + public void setActiveFlag(String activeFlag) { + this.activeFlag = activeFlag; + } + + public String getActiveFlag() { + return activeFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("materialBomId", getMaterialBomId()) + .append("parentId", getParentId()) + .append("ancestors", getAncestors()) + .append("materialId", getMaterialId()) + .append("materialName", getMaterialName()) + .append("standardAmount", getStandardAmount()) + .append("topFlag", getTopFlag()) + .append("checkType", getCheckType()) + .append("projectId", getProjectId()) + .append("activeFlag", getActiveFlag()) + .append("remark", getRemark()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .toString(); + } +} diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesMaterialBomMapper.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesMaterialBomMapper.java new file mode 100644 index 00000000..77fcfc9e --- /dev/null +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesMaterialBomMapper.java @@ -0,0 +1,61 @@ +package com.hw.mes.mapper; + +import java.util.List; +import com.hw.mes.domain.MesMaterialBom; + +/** + * 物料BOM信息Mapper接口 + * + * @author Yinq + * @date 2024-01-30 + */ +public interface MesMaterialBomMapper +{ + /** + * 查询物料BOM信息 + * + * @param materialBomId 物料BOM信息主键 + * @return 物料BOM信息 + */ + public MesMaterialBom selectMesMaterialBomByMaterialBomId(Long materialBomId); + + /** + * 查询物料BOM信息列表 + * + * @param mesMaterialBom 物料BOM信息 + * @return 物料BOM信息集合 + */ + public List selectMesMaterialBomList(MesMaterialBom mesMaterialBom); + + /** + * 新增物料BOM信息 + * + * @param mesMaterialBom 物料BOM信息 + * @return 结果 + */ + public int insertMesMaterialBom(MesMaterialBom mesMaterialBom); + + /** + * 修改物料BOM信息 + * + * @param mesMaterialBom 物料BOM信息 + * @return 结果 + */ + public int updateMesMaterialBom(MesMaterialBom mesMaterialBom); + + /** + * 删除物料BOM信息 + * + * @param materialBomId 物料BOM信息主键 + * @return 结果 + */ + public int deleteMesMaterialBomByMaterialBomId(Long materialBomId); + + /** + * 批量删除物料BOM信息 + * + * @param materialBomIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteMesMaterialBomByMaterialBomIds(Long[] materialBomIds); +} diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesMaterialBomService.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesMaterialBomService.java new file mode 100644 index 00000000..28280146 --- /dev/null +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesMaterialBomService.java @@ -0,0 +1,61 @@ +package com.hw.mes.service; + +import java.util.List; +import com.hw.mes.domain.MesMaterialBom; + +/** + * 物料BOM信息Service接口 + * + * @author Yinq + * @date 2024-01-30 + */ +public interface IMesMaterialBomService +{ + /** + * 查询物料BOM信息 + * + * @param materialBomId 物料BOM信息主键 + * @return 物料BOM信息 + */ + public MesMaterialBom selectMesMaterialBomByMaterialBomId(Long materialBomId); + + /** + * 查询物料BOM信息列表 + * + * @param mesMaterialBom 物料BOM信息 + * @return 物料BOM信息集合 + */ + public List selectMesMaterialBomList(MesMaterialBom mesMaterialBom); + + /** + * 新增物料BOM信息 + * + * @param mesMaterialBom 物料BOM信息 + * @return 结果 + */ + public int insertMesMaterialBom(MesMaterialBom mesMaterialBom); + + /** + * 修改物料BOM信息 + * + * @param mesMaterialBom 物料BOM信息 + * @return 结果 + */ + public int updateMesMaterialBom(MesMaterialBom mesMaterialBom); + + /** + * 批量删除物料BOM信息 + * + * @param materialBomIds 需要删除的物料BOM信息主键集合 + * @return 结果 + */ + public int deleteMesMaterialBomByMaterialBomIds(Long[] materialBomIds); + + /** + * 删除物料BOM信息信息 + * + * @param materialBomId 物料BOM信息主键 + * @return 结果 + */ + public int deleteMesMaterialBomByMaterialBomId(Long materialBomId); +} diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesMaterialBomServiceImpl.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesMaterialBomServiceImpl.java new file mode 100644 index 00000000..a2a81721 --- /dev/null +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesMaterialBomServiceImpl.java @@ -0,0 +1,96 @@ +package com.hw.mes.service.impl; + +import java.util.List; +import com.hw.common.core.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.hw.mes.mapper.MesMaterialBomMapper; +import com.hw.mes.domain.MesMaterialBom; +import com.hw.mes.service.IMesMaterialBomService; + +/** + * 物料BOM信息Service业务层处理 + * + * @author Yinq + * @date 2024-01-30 + */ +@Service +public class MesMaterialBomServiceImpl implements IMesMaterialBomService +{ + @Autowired + private MesMaterialBomMapper mesMaterialBomMapper; + + /** + * 查询物料BOM信息 + * + * @param materialBomId 物料BOM信息主键 + * @return 物料BOM信息 + */ + @Override + public MesMaterialBom selectMesMaterialBomByMaterialBomId(Long materialBomId) + { + return mesMaterialBomMapper.selectMesMaterialBomByMaterialBomId(materialBomId); + } + + /** + * 查询物料BOM信息列表 + * + * @param mesMaterialBom 物料BOM信息 + * @return 物料BOM信息 + */ + @Override + public List selectMesMaterialBomList(MesMaterialBom mesMaterialBom) + { + return mesMaterialBomMapper.selectMesMaterialBomList(mesMaterialBom); + } + + /** + * 新增物料BOM信息 + * + * @param mesMaterialBom 物料BOM信息 + * @return 结果 + */ + @Override + public int insertMesMaterialBom(MesMaterialBom mesMaterialBom) + { + mesMaterialBom.setCreateTime(DateUtils.getNowDate()); + return mesMaterialBomMapper.insertMesMaterialBom(mesMaterialBom); + } + + /** + * 修改物料BOM信息 + * + * @param mesMaterialBom 物料BOM信息 + * @return 结果 + */ + @Override + public int updateMesMaterialBom(MesMaterialBom mesMaterialBom) + { + mesMaterialBom.setUpdateTime(DateUtils.getNowDate()); + return mesMaterialBomMapper.updateMesMaterialBom(mesMaterialBom); + } + + /** + * 批量删除物料BOM信息 + * + * @param materialBomIds 需要删除的物料BOM信息主键 + * @return 结果 + */ + @Override + public int deleteMesMaterialBomByMaterialBomIds(Long[] materialBomIds) + { + return mesMaterialBomMapper.deleteMesMaterialBomByMaterialBomIds(materialBomIds); + } + + /** + * 删除物料BOM信息信息 + * + * @param materialBomId 物料BOM信息主键 + * @return 结果 + */ + @Override + public int deleteMesMaterialBomByMaterialBomId(Long materialBomId) + { + return mesMaterialBomMapper.deleteMesMaterialBomByMaterialBomId(materialBomId); + } +} diff --git a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesMaterialBomMapper.xml b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesMaterialBomMapper.xml new file mode 100644 index 00000000..022a77b1 --- /dev/null +++ b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesMaterialBomMapper.xml @@ -0,0 +1,116 @@ + + + + + + + + + + + + + + + + + + + + + + + + select material_bom_id, parent_id, ancestors, material_id, material_name, standard_amount, top_flag, check_type, project_id, active_flag, remark, create_by, create_time, update_by, update_time from mes_material_bom + + + + + + + + insert into mes_material_bom + + parent_id, + ancestors, + material_id, + material_name, + standard_amount, + top_flag, + check_type, + project_id, + active_flag, + remark, + create_by, + create_time, + update_by, + update_time, + + + #{parentId}, + #{ancestors}, + #{materialId}, + #{materialName}, + #{standardAmount}, + #{topFlag}, + #{checkType}, + #{projectId}, + #{activeFlag}, + #{remark}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + + + + + update mes_material_bom + + parent_id = #{parentId}, + ancestors = #{ancestors}, + material_id = #{materialId}, + material_name = #{materialName}, + standard_amount = #{standardAmount}, + top_flag = #{topFlag}, + check_type = #{checkType}, + project_id = #{projectId}, + active_flag = #{activeFlag}, + remark = #{remark}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + + where material_bom_id = #{materialBomId} + + + + delete from mes_material_bom where material_bom_id = #{materialBomId} + + + + delete from mes_material_bom where material_bom_id in + + #{materialBomId} + + + \ No newline at end of file diff --git a/hw-ui/src/api/mes/materialBom.js b/hw-ui/src/api/mes/materialBom.js new file mode 100644 index 00000000..f411a46e --- /dev/null +++ b/hw-ui/src/api/mes/materialBom.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询物料BOM信息列表 +export function listMaterialBom(query) { + return request({ + url: '/mes/materialBom/list', + method: 'get', + params: query + }) +} + +// 查询物料BOM信息详细 +export function getMaterialBom(materialBomId) { + return request({ + url: '/mes/materialBom/' + materialBomId, + method: 'get' + }) +} + +// 新增物料BOM信息 +export function addMaterialBom(data) { + return request({ + url: '/mes/materialBom', + method: 'post', + data: data + }) +} + +// 修改物料BOM信息 +export function updateMaterialBom(data) { + return request({ + url: '/mes/materialBom', + method: 'put', + data: data + }) +} + +// 删除物料BOM信息 +export function delMaterialBom(materialBomId) { + return request({ + url: '/mes/materialBom/' + materialBomId, + method: 'delete' + }) +} diff --git a/hw-ui/src/views/mes/materialBom/index.vue b/hw-ui/src/views/mes/materialBom/index.vue new file mode 100644 index 00000000..6080e5ac --- /dev/null +++ b/hw-ui/src/views/mes/materialBom/index.vue @@ -0,0 +1,406 @@ + + +