diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesBaseFactoryInfoController.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesBaseFactoryInfoController.java new file mode 100644 index 0000000..7ec41fe --- /dev/null +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesBaseFactoryInfoController.java @@ -0,0 +1,109 @@ +package com.hw.mes.controller; + +import java.util.List; +import java.io.IOException; +import javax.servlet.http.HttpServletResponse; + +import com.hw.common.security.utils.SecurityUtils; +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.MesBaseFactoryInfo; +import com.hw.mes.service.IMesBaseFactoryInfoService; +import com.hw.common.core.web.controller.BaseController; +import com.hw.common.core.web.domain.AjaxResult; +import com.hw.common.core.utils.poi.ExcelUtil; +import com.hw.common.core.web.page.TableDataInfo; + +/** + * 工厂信息Controller + * + * @author Yinq + * @date 2024-01-23 + */ +@RestController +@RequestMapping("/baseFactoryInfo") +public class MesBaseFactoryInfoController extends BaseController +{ + @Autowired + private IMesBaseFactoryInfoService mesBaseFactoryInfoService; + + /** + * 查询工厂信息列表 + */ + @RequiresPermissions("mes:baseFactoryInfo:list") + @GetMapping("/list") + public TableDataInfo list(MesBaseFactoryInfo mesBaseFactoryInfo) + { + startPage(); + List list = mesBaseFactoryInfoService.selectMesBaseFactoryInfoList(mesBaseFactoryInfo); + return getDataTable(list); + } + + /** + * 导出工厂信息列表 + */ + @RequiresPermissions("mes:baseFactoryInfo:export") + @Log(title = "工厂信息", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, MesBaseFactoryInfo mesBaseFactoryInfo) + { + List list = mesBaseFactoryInfoService.selectMesBaseFactoryInfoList(mesBaseFactoryInfo); + ExcelUtil util = new ExcelUtil(MesBaseFactoryInfo.class); + util.exportExcel(response, list, "工厂信息数据"); + } + + /** + * 获取工厂信息详细信息 + */ + @RequiresPermissions("mes:baseFactoryInfo:query") + @GetMapping(value = "/{factoryId}") + public AjaxResult getInfo(@PathVariable("factoryId") Long factoryId) + { + return success(mesBaseFactoryInfoService.selectMesBaseFactoryInfoByFactoryId(factoryId)); + } + + /** + * 新增工厂信息 + */ + @RequiresPermissions("mes:baseFactoryInfo:add") + @Log(title = "工厂信息", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody MesBaseFactoryInfo mesBaseFactoryInfo) + { + mesBaseFactoryInfo.setCreateBy(SecurityUtils.getLoginUser().getUsername()); + return toAjax(mesBaseFactoryInfoService.insertMesBaseFactoryInfo(mesBaseFactoryInfo)); + } + + /** + * 修改工厂信息 + */ + @RequiresPermissions("mes:baseFactoryInfo:edit") + @Log(title = "工厂信息", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody MesBaseFactoryInfo mesBaseFactoryInfo) + { + mesBaseFactoryInfo.setUpdateBy(SecurityUtils.getLoginUser().getUsername()); + return toAjax(mesBaseFactoryInfoService.updateMesBaseFactoryInfo(mesBaseFactoryInfo)); + } + + /** + * 删除工厂信息 + */ + @RequiresPermissions("mes:baseFactoryInfo:remove") + @Log(title = "工厂信息", businessType = BusinessType.DELETE) + @DeleteMapping("/{factoryIds}") + public AjaxResult remove(@PathVariable Long[] factoryIds) + { + return toAjax(mesBaseFactoryInfoService.deleteMesBaseFactoryInfoByFactoryIds(factoryIds)); + } +} diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesBaseFactoryInfo.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesBaseFactoryInfo.java new file mode 100644 index 0000000..55fee95 --- /dev/null +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesBaseFactoryInfo.java @@ -0,0 +1,98 @@ +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.BaseEntity; + +/** + * 工厂信息对象 mes_base_factory_info + * + * @author Yinq + * @date 2024-01-23 + */ +public class MesBaseFactoryInfo extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键标识 */ + private Long factoryId; + + /** 公司名称 */ + @Excel(name = "公司名称") + private String companyName; + + /** 工厂编号 */ + @Excel(name = "工厂编号") + private String factoryCode; + + /** 工厂名称 */ + @Excel(name = "工厂名称") + private String factoryName; + + /** 工厂状态:1-启用;0-停用 */ + @Excel(name = "工厂状态:1-启用;0-停用") + private String factoryStatus; + + public void setFactoryId(Long factoryId) + { + this.factoryId = factoryId; + } + + public Long getFactoryId() + { + return factoryId; + } + public void setCompanyName(String companyName) + { + this.companyName = companyName; + } + + public String getCompanyName() + { + return companyName; + } + public void setFactoryCode(String factoryCode) + { + this.factoryCode = factoryCode; + } + + public String getFactoryCode() + { + return factoryCode; + } + public void setFactoryName(String factoryName) + { + this.factoryName = factoryName; + } + + public String getFactoryName() + { + return factoryName; + } + public void setFactoryStatus(String factoryStatus) + { + this.factoryStatus = factoryStatus; + } + + public String getFactoryStatus() + { + return factoryStatus; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("factoryId", getFactoryId()) + .append("companyName", getCompanyName()) + .append("factoryCode", getFactoryCode()) + .append("factoryName", getFactoryName()) + .append("factoryStatus", getFactoryStatus()) + .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/MesBaseFactoryInfoMapper.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesBaseFactoryInfoMapper.java new file mode 100644 index 0000000..44fb414 --- /dev/null +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesBaseFactoryInfoMapper.java @@ -0,0 +1,61 @@ +package com.hw.mes.mapper; + +import java.util.List; +import com.hw.mes.domain.MesBaseFactoryInfo; + +/** + * 工厂信息Mapper接口 + * + * @author Yinq + * @date 2024-01-23 + */ +public interface MesBaseFactoryInfoMapper +{ + /** + * 查询工厂信息 + * + * @param factoryId 工厂信息主键 + * @return 工厂信息 + */ + public MesBaseFactoryInfo selectMesBaseFactoryInfoByFactoryId(Long factoryId); + + /** + * 查询工厂信息列表 + * + * @param mesBaseFactoryInfo 工厂信息 + * @return 工厂信息集合 + */ + public List selectMesBaseFactoryInfoList(MesBaseFactoryInfo mesBaseFactoryInfo); + + /** + * 新增工厂信息 + * + * @param mesBaseFactoryInfo 工厂信息 + * @return 结果 + */ + public int insertMesBaseFactoryInfo(MesBaseFactoryInfo mesBaseFactoryInfo); + + /** + * 修改工厂信息 + * + * @param mesBaseFactoryInfo 工厂信息 + * @return 结果 + */ + public int updateMesBaseFactoryInfo(MesBaseFactoryInfo mesBaseFactoryInfo); + + /** + * 删除工厂信息 + * + * @param factoryId 工厂信息主键 + * @return 结果 + */ + public int deleteMesBaseFactoryInfoByFactoryId(Long factoryId); + + /** + * 批量删除工厂信息 + * + * @param factoryIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteMesBaseFactoryInfoByFactoryIds(Long[] factoryIds); +} diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesBaseFactoryInfoService.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesBaseFactoryInfoService.java new file mode 100644 index 0000000..a87d867 --- /dev/null +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesBaseFactoryInfoService.java @@ -0,0 +1,61 @@ +package com.hw.mes.service; + +import java.util.List; +import com.hw.mes.domain.MesBaseFactoryInfo; + +/** + * 工厂信息Service接口 + * + * @author Yinq + * @date 2024-01-23 + */ +public interface IMesBaseFactoryInfoService +{ + /** + * 查询工厂信息 + * + * @param factoryId 工厂信息主键 + * @return 工厂信息 + */ + public MesBaseFactoryInfo selectMesBaseFactoryInfoByFactoryId(Long factoryId); + + /** + * 查询工厂信息列表 + * + * @param mesBaseFactoryInfo 工厂信息 + * @return 工厂信息集合 + */ + public List selectMesBaseFactoryInfoList(MesBaseFactoryInfo mesBaseFactoryInfo); + + /** + * 新增工厂信息 + * + * @param mesBaseFactoryInfo 工厂信息 + * @return 结果 + */ + public int insertMesBaseFactoryInfo(MesBaseFactoryInfo mesBaseFactoryInfo); + + /** + * 修改工厂信息 + * + * @param mesBaseFactoryInfo 工厂信息 + * @return 结果 + */ + public int updateMesBaseFactoryInfo(MesBaseFactoryInfo mesBaseFactoryInfo); + + /** + * 批量删除工厂信息 + * + * @param factoryIds 需要删除的工厂信息主键集合 + * @return 结果 + */ + public int deleteMesBaseFactoryInfoByFactoryIds(Long[] factoryIds); + + /** + * 删除工厂信息信息 + * + * @param factoryId 工厂信息主键 + * @return 结果 + */ + public int deleteMesBaseFactoryInfoByFactoryId(Long factoryId); +} diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesBaseFactoryInfoServiceImpl.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesBaseFactoryInfoServiceImpl.java new file mode 100644 index 0000000..15327a1 --- /dev/null +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesBaseFactoryInfoServiceImpl.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.MesBaseFactoryInfoMapper; +import com.hw.mes.domain.MesBaseFactoryInfo; +import com.hw.mes.service.IMesBaseFactoryInfoService; + +/** + * 工厂信息Service业务层处理 + * + * @author Yinq + * @date 2024-01-23 + */ +@Service +public class MesBaseFactoryInfoServiceImpl implements IMesBaseFactoryInfoService +{ + @Autowired + private MesBaseFactoryInfoMapper mesBaseFactoryInfoMapper; + + /** + * 查询工厂信息 + * + * @param factoryId 工厂信息主键 + * @return 工厂信息 + */ + @Override + public MesBaseFactoryInfo selectMesBaseFactoryInfoByFactoryId(Long factoryId) + { + return mesBaseFactoryInfoMapper.selectMesBaseFactoryInfoByFactoryId(factoryId); + } + + /** + * 查询工厂信息列表 + * + * @param mesBaseFactoryInfo 工厂信息 + * @return 工厂信息 + */ + @Override + public List selectMesBaseFactoryInfoList(MesBaseFactoryInfo mesBaseFactoryInfo) + { + return mesBaseFactoryInfoMapper.selectMesBaseFactoryInfoList(mesBaseFactoryInfo); + } + + /** + * 新增工厂信息 + * + * @param mesBaseFactoryInfo 工厂信息 + * @return 结果 + */ + @Override + public int insertMesBaseFactoryInfo(MesBaseFactoryInfo mesBaseFactoryInfo) + { + mesBaseFactoryInfo.setCreateTime(DateUtils.getNowDate()); + return mesBaseFactoryInfoMapper.insertMesBaseFactoryInfo(mesBaseFactoryInfo); + } + + /** + * 修改工厂信息 + * + * @param mesBaseFactoryInfo 工厂信息 + * @return 结果 + */ + @Override + public int updateMesBaseFactoryInfo(MesBaseFactoryInfo mesBaseFactoryInfo) + { + mesBaseFactoryInfo.setUpdateTime(DateUtils.getNowDate()); + return mesBaseFactoryInfoMapper.updateMesBaseFactoryInfo(mesBaseFactoryInfo); + } + + /** + * 批量删除工厂信息 + * + * @param factoryIds 需要删除的工厂信息主键 + * @return 结果 + */ + @Override + public int deleteMesBaseFactoryInfoByFactoryIds(Long[] factoryIds) + { + return mesBaseFactoryInfoMapper.deleteMesBaseFactoryInfoByFactoryIds(factoryIds); + } + + /** + * 删除工厂信息信息 + * + * @param factoryId 工厂信息主键 + * @return 结果 + */ + @Override + public int deleteMesBaseFactoryInfoByFactoryId(Long factoryId) + { + return mesBaseFactoryInfoMapper.deleteMesBaseFactoryInfoByFactoryId(factoryId); + } +} diff --git a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesBaseFactoryInfoMapper.xml b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesBaseFactoryInfoMapper.xml new file mode 100644 index 0000000..a921061 --- /dev/null +++ b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesBaseFactoryInfoMapper.xml @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + select factory_id, company_name, factory_code, factory_name, factory_status, remark, create_by, create_time, update_by, update_time from mes_base_factory_info + + + + + + + + insert into mes_base_factory_info + + company_name, + factory_code, + factory_name, + factory_status, + remark, + create_by, + create_time, + update_by, + update_time, + + + #{companyName}, + #{factoryCode}, + #{factoryName}, + #{factoryStatus}, + #{remark}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + + + + + update mes_base_factory_info + + company_name = #{companyName}, + factory_code = #{factoryCode}, + factory_name = #{factoryName}, + factory_status = #{factoryStatus}, + remark = #{remark}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + + where factory_id = #{factoryId} + + + + delete from mes_base_factory_info where factory_id = #{factoryId} + + + + delete from mes_base_factory_info where factory_id in + + #{factoryId} + + + \ No newline at end of file diff --git a/hw-ui/src/api/mes/baseFactoryInfo.js b/hw-ui/src/api/mes/baseFactoryInfo.js new file mode 100644 index 0000000..45e79ae --- /dev/null +++ b/hw-ui/src/api/mes/baseFactoryInfo.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询工厂信息列表 +export function listBaseFactoryInfo(query) { + return request({ + url: '/mes/baseFactoryInfo/list', + method: 'get', + params: query + }) +} + +// 查询工厂信息详细 +export function getBaseFactoryInfo(factoryId) { + return request({ + url: '/mes/baseFactoryInfo/' + factoryId, + method: 'get' + }) +} + +// 新增工厂信息 +export function addBaseFactoryInfo(data) { + return request({ + url: '/mes/baseFactoryInfo', + method: 'post', + data: data + }) +} + +// 修改工厂信息 +export function updateBaseFactoryInfo(data) { + return request({ + url: '/mes/baseFactoryInfo', + method: 'put', + data: data + }) +} + +// 删除工厂信息 +export function delBaseFactoryInfo(factoryId) { + return request({ + url: '/mes/baseFactoryInfo/' + factoryId, + method: 'delete' + }) +} diff --git a/hw-ui/src/views/mes/baseFactoryInfo/index.vue b/hw-ui/src/views/mes/baseFactoryInfo/index.vue new file mode 100644 index 0000000..b22a21d --- /dev/null +++ b/hw-ui/src/views/mes/baseFactoryInfo/index.vue @@ -0,0 +1,334 @@ + + +