diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesBaseMaterialTypeController.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesBaseMaterialTypeController.java new file mode 100644 index 0000000..ab0ea7b --- /dev/null +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesBaseMaterialTypeController.java @@ -0,0 +1,103 @@ +package com.hw.mes.controller; + +import java.util.List; +import java.io.IOException; +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.MesBaseMaterialType; +import com.hw.mes.service.IMesBaseMaterialTypeService; +import com.hw.common.core.web.controller.BaseController; +import com.hw.common.core.web.domain.AjaxResult; +import com.hw.common.core.utils.poi.ExcelUtil; + +/** + * 物料类型信息Controller + * + * @author Yinq + * @date 2024-01-23 + */ +@RestController +@RequestMapping("/baseMaterialType") +public class MesBaseMaterialTypeController extends BaseController +{ + @Autowired + private IMesBaseMaterialTypeService mesBaseMaterialTypeService; + + /** + * 查询物料类型信息列表 + */ + @RequiresPermissions("mes:baseMaterialType:list") + @GetMapping("/list") + public AjaxResult list(MesBaseMaterialType mesBaseMaterialType) + { + List list = mesBaseMaterialTypeService.selectMesBaseMaterialTypeList(mesBaseMaterialType); + return success(list); + } + + /** + * 导出物料类型信息列表 + */ + @RequiresPermissions("mes:baseMaterialType:export") + @Log(title = "物料类型信息", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, MesBaseMaterialType mesBaseMaterialType) + { + List list = mesBaseMaterialTypeService.selectMesBaseMaterialTypeList(mesBaseMaterialType); + ExcelUtil util = new ExcelUtil(MesBaseMaterialType.class); + util.exportExcel(response, list, "物料类型信息数据"); + } + + /** + * 获取物料类型信息详细信息 + */ + @RequiresPermissions("mes:baseMaterialType:query") + @GetMapping(value = "/{matrialTypeId}") + public AjaxResult getInfo(@PathVariable("matrialTypeId") Long matrialTypeId) + { + return success(mesBaseMaterialTypeService.selectMesBaseMaterialTypeByMatrialTypeId(matrialTypeId)); + } + + /** + * 新增物料类型信息 + */ + @RequiresPermissions("mes:baseMaterialType:add") + @Log(title = "物料类型信息", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody MesBaseMaterialType mesBaseMaterialType) + { + return toAjax(mesBaseMaterialTypeService.insertMesBaseMaterialType(mesBaseMaterialType)); + } + + /** + * 修改物料类型信息 + */ + @RequiresPermissions("mes:baseMaterialType:edit") + @Log(title = "物料类型信息", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody MesBaseMaterialType mesBaseMaterialType) + { + return toAjax(mesBaseMaterialTypeService.updateMesBaseMaterialType(mesBaseMaterialType)); + } + + /** + * 删除物料类型信息 + */ + @RequiresPermissions("mes:baseMaterialType:remove") + @Log(title = "物料类型信息", businessType = BusinessType.DELETE) + @DeleteMapping("/{matrialTypeIds}") + public AjaxResult remove(@PathVariable Long[] matrialTypeIds) + { + return toAjax(mesBaseMaterialTypeService.deleteMesBaseMaterialTypeByMatrialTypeIds(matrialTypeIds)); + } +} diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesBaseMaterialType.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesBaseMaterialType.java new file mode 100644 index 0000000..7fbcb3e --- /dev/null +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesBaseMaterialType.java @@ -0,0 +1,88 @@ +package com.hw.mes.domain; + +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; + +/** + * 物料类型信息对象 mes_base_material_type + * + * @author Yinq + * @date 2024-01-23 + */ +public class MesBaseMaterialType extends TreeEntity { + private static final long serialVersionUID = 1L; + + /** + * 主键标识 + */ + private Long matrialTypeId; + + /** + * 类型编号 + */ + @Excel(name = "类型编号") + private String typeCode; + + /** + * 类型名称 + */ + @Excel(name = "类型名称") + private String typeName; + + /** + * 激活标识 + */ + @Excel(name = "激活标识") + private String activeFlag; + + public void setMatrialTypeId(Long matrialTypeId) { + this.matrialTypeId = matrialTypeId; + } + + public Long getMatrialTypeId() { + return matrialTypeId; + } + + public void setTypeCode(String typeCode) { + this.typeCode = typeCode; + } + + public String getTypeCode() { + return typeCode; + } + + public void setTypeName(String typeName) { + this.typeName = typeName; + } + + public String getTypeName() { + return typeName; + } + + 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("matrialTypeId", getMatrialTypeId()) + .append("parentId", getParentId()) + .append("typeCode", getTypeCode()) + .append("typeName", getTypeName()) + .append("activeFlag", getActiveFlag()) + .append("ancestors", getAncestors()) + .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/MesBaseMaterialTypeMapper.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesBaseMaterialTypeMapper.java new file mode 100644 index 0000000..48e31a9 --- /dev/null +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesBaseMaterialTypeMapper.java @@ -0,0 +1,61 @@ +package com.hw.mes.mapper; + +import java.util.List; +import com.hw.mes.domain.MesBaseMaterialType; + +/** + * 物料类型信息Mapper接口 + * + * @author Yinq + * @date 2024-01-23 + */ +public interface MesBaseMaterialTypeMapper +{ + /** + * 查询物料类型信息 + * + * @param matrialTypeId 物料类型信息主键 + * @return 物料类型信息 + */ + public MesBaseMaterialType selectMesBaseMaterialTypeByMatrialTypeId(Long matrialTypeId); + + /** + * 查询物料类型信息列表 + * + * @param mesBaseMaterialType 物料类型信息 + * @return 物料类型信息集合 + */ + public List selectMesBaseMaterialTypeList(MesBaseMaterialType mesBaseMaterialType); + + /** + * 新增物料类型信息 + * + * @param mesBaseMaterialType 物料类型信息 + * @return 结果 + */ + public int insertMesBaseMaterialType(MesBaseMaterialType mesBaseMaterialType); + + /** + * 修改物料类型信息 + * + * @param mesBaseMaterialType 物料类型信息 + * @return 结果 + */ + public int updateMesBaseMaterialType(MesBaseMaterialType mesBaseMaterialType); + + /** + * 删除物料类型信息 + * + * @param matrialTypeId 物料类型信息主键 + * @return 结果 + */ + public int deleteMesBaseMaterialTypeByMatrialTypeId(Long matrialTypeId); + + /** + * 批量删除物料类型信息 + * + * @param matrialTypeIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteMesBaseMaterialTypeByMatrialTypeIds(Long[] matrialTypeIds); +} diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesBaseMaterialTypeService.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesBaseMaterialTypeService.java new file mode 100644 index 0000000..77fe0ce --- /dev/null +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesBaseMaterialTypeService.java @@ -0,0 +1,61 @@ +package com.hw.mes.service; + +import java.util.List; +import com.hw.mes.domain.MesBaseMaterialType; + +/** + * 物料类型信息Service接口 + * + * @author Yinq + * @date 2024-01-23 + */ +public interface IMesBaseMaterialTypeService +{ + /** + * 查询物料类型信息 + * + * @param matrialTypeId 物料类型信息主键 + * @return 物料类型信息 + */ + public MesBaseMaterialType selectMesBaseMaterialTypeByMatrialTypeId(Long matrialTypeId); + + /** + * 查询物料类型信息列表 + * + * @param mesBaseMaterialType 物料类型信息 + * @return 物料类型信息集合 + */ + public List selectMesBaseMaterialTypeList(MesBaseMaterialType mesBaseMaterialType); + + /** + * 新增物料类型信息 + * + * @param mesBaseMaterialType 物料类型信息 + * @return 结果 + */ + public int insertMesBaseMaterialType(MesBaseMaterialType mesBaseMaterialType); + + /** + * 修改物料类型信息 + * + * @param mesBaseMaterialType 物料类型信息 + * @return 结果 + */ + public int updateMesBaseMaterialType(MesBaseMaterialType mesBaseMaterialType); + + /** + * 批量删除物料类型信息 + * + * @param matrialTypeIds 需要删除的物料类型信息主键集合 + * @return 结果 + */ + public int deleteMesBaseMaterialTypeByMatrialTypeIds(Long[] matrialTypeIds); + + /** + * 删除物料类型信息信息 + * + * @param matrialTypeId 物料类型信息主键 + * @return 结果 + */ + public int deleteMesBaseMaterialTypeByMatrialTypeId(Long matrialTypeId); +} diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesBaseMaterialTypeServiceImpl.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesBaseMaterialTypeServiceImpl.java new file mode 100644 index 0000000..7887d79 --- /dev/null +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesBaseMaterialTypeServiceImpl.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.MesBaseMaterialTypeMapper; +import com.hw.mes.domain.MesBaseMaterialType; +import com.hw.mes.service.IMesBaseMaterialTypeService; + +/** + * 物料类型信息Service业务层处理 + * + * @author Yinq + * @date 2024-01-23 + */ +@Service +public class MesBaseMaterialTypeServiceImpl implements IMesBaseMaterialTypeService +{ + @Autowired + private MesBaseMaterialTypeMapper mesBaseMaterialTypeMapper; + + /** + * 查询物料类型信息 + * + * @param matrialTypeId 物料类型信息主键 + * @return 物料类型信息 + */ + @Override + public MesBaseMaterialType selectMesBaseMaterialTypeByMatrialTypeId(Long matrialTypeId) + { + return mesBaseMaterialTypeMapper.selectMesBaseMaterialTypeByMatrialTypeId(matrialTypeId); + } + + /** + * 查询物料类型信息列表 + * + * @param mesBaseMaterialType 物料类型信息 + * @return 物料类型信息 + */ + @Override + public List selectMesBaseMaterialTypeList(MesBaseMaterialType mesBaseMaterialType) + { + return mesBaseMaterialTypeMapper.selectMesBaseMaterialTypeList(mesBaseMaterialType); + } + + /** + * 新增物料类型信息 + * + * @param mesBaseMaterialType 物料类型信息 + * @return 结果 + */ + @Override + public int insertMesBaseMaterialType(MesBaseMaterialType mesBaseMaterialType) + { + mesBaseMaterialType.setCreateTime(DateUtils.getNowDate()); + return mesBaseMaterialTypeMapper.insertMesBaseMaterialType(mesBaseMaterialType); + } + + /** + * 修改物料类型信息 + * + * @param mesBaseMaterialType 物料类型信息 + * @return 结果 + */ + @Override + public int updateMesBaseMaterialType(MesBaseMaterialType mesBaseMaterialType) + { + mesBaseMaterialType.setUpdateTime(DateUtils.getNowDate()); + return mesBaseMaterialTypeMapper.updateMesBaseMaterialType(mesBaseMaterialType); + } + + /** + * 批量删除物料类型信息 + * + * @param matrialTypeIds 需要删除的物料类型信息主键 + * @return 结果 + */ + @Override + public int deleteMesBaseMaterialTypeByMatrialTypeIds(Long[] matrialTypeIds) + { + return mesBaseMaterialTypeMapper.deleteMesBaseMaterialTypeByMatrialTypeIds(matrialTypeIds); + } + + /** + * 删除物料类型信息信息 + * + * @param matrialTypeId 物料类型信息主键 + * @return 结果 + */ + @Override + public int deleteMesBaseMaterialTypeByMatrialTypeId(Long matrialTypeId) + { + return mesBaseMaterialTypeMapper.deleteMesBaseMaterialTypeByMatrialTypeId(matrialTypeId); + } +} diff --git a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesBaseMaterialTypeMapper.xml b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesBaseMaterialTypeMapper.xml new file mode 100644 index 0000000..5ad7390 --- /dev/null +++ b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesBaseMaterialTypeMapper.xml @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + select matrial_type_id, parent_id, type_code, type_name, active_flag, ancestors, remark, create_by, create_time, update_by, update_time from mes_base_material_type + + + + + + + + insert into mes_base_material_type + + parent_id, + type_code, + type_name, + active_flag, + ancestors, + remark, + create_by, + create_time, + update_by, + update_time, + + + #{parentId}, + #{typeCode}, + #{typeName}, + #{activeFlag}, + #{ancestors}, + #{remark}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + + + + + update mes_base_material_type + + parent_id = #{parentId}, + type_code = #{typeCode}, + type_name = #{typeName}, + active_flag = #{activeFlag}, + ancestors = #{ancestors}, + remark = #{remark}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + + where matrial_type_id = #{matrialTypeId} + + + + delete from mes_base_material_type where matrial_type_id = #{matrialTypeId} + + + + delete from mes_base_material_type where matrial_type_id in + + #{matrialTypeId} + + + \ No newline at end of file diff --git a/hw-ui/src/api/mes/baseMaterialType.js b/hw-ui/src/api/mes/baseMaterialType.js new file mode 100644 index 0000000..49007f3 --- /dev/null +++ b/hw-ui/src/api/mes/baseMaterialType.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询物料类型信息列表 +export function listBaseMaterialType(query) { + return request({ + url: '/mes/baseMaterialType/list', + method: 'get', + params: query + }) +} + +// 查询物料类型信息详细 +export function getBaseMaterialType(matrialTypeId) { + return request({ + url: '/mes/baseMaterialType/' + matrialTypeId, + method: 'get' + }) +} + +// 新增物料类型信息 +export function addBaseMaterialType(data) { + return request({ + url: '/mes/baseMaterialType', + method: 'post', + data: data + }) +} + +// 修改物料类型信息 +export function updateBaseMaterialType(data) { + return request({ + url: '/mes/baseMaterialType', + method: 'put', + data: data + }) +} + +// 删除物料类型信息 +export function delBaseMaterialType(matrialTypeId) { + return request({ + url: '/mes/baseMaterialType/' + matrialTypeId, + method: 'delete' + }) +} diff --git a/hw-ui/src/views/mes/baseMaterialType/index.vue b/hw-ui/src/views/mes/baseMaterialType/index.vue new file mode 100644 index 0000000..53cc96a --- /dev/null +++ b/hw-ui/src/views/mes/baseMaterialType/index.vue @@ -0,0 +1,357 @@ + + +