diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/BaseFactoryInfoController.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/BaseFactoryInfoController.java new file mode 100644 index 0000000..1a16f6e --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/BaseFactoryInfoController.java @@ -0,0 +1,105 @@ +package com.ruoyi.system.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.ruoyi.common.log.annotation.Log; +import com.ruoyi.common.log.enums.BusinessType; +import com.ruoyi.common.security.annotation.RequiresPermissions; +import com.ruoyi.system.domain.BaseFactoryInfo; +import com.ruoyi.system.service.IBaseFactoryInfoService; +import com.ruoyi.common.core.web.controller.BaseController; +import com.ruoyi.common.core.web.domain.AjaxResult; +import com.ruoyi.common.core.utils.poi.ExcelUtil; +import com.ruoyi.common.core.web.page.TableDataInfo; + +/** + * 工厂信息Controller + * + * @author ruoyi + * @date 2024-07-01 + */ +@RestController +@RequestMapping("/info") +public class BaseFactoryInfoController extends BaseController +{ + @Autowired + private IBaseFactoryInfoService baseFactoryInfoService; + + /** + * 查询工厂信息列表 + */ + @RequiresPermissions("system:info:list") + @GetMapping("/list") + public TableDataInfo list(BaseFactoryInfo baseFactoryInfo) + { + startPage(); + List list = baseFactoryInfoService.selectBaseFactoryInfoList(baseFactoryInfo); + return getDataTable(list); + } + + /** + * 导出工厂信息列表 + */ + @RequiresPermissions("system:info:export") + @Log(title = "工厂信息", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, BaseFactoryInfo baseFactoryInfo) + { + List list = baseFactoryInfoService.selectBaseFactoryInfoList(baseFactoryInfo); + ExcelUtil util = new ExcelUtil(BaseFactoryInfo.class); + util.exportExcel(response, list, "工厂信息数据"); + } + + /** + * 获取工厂信息详细信息 + */ + @RequiresPermissions("system:info:query") + @GetMapping(value = "/{objId}") + public AjaxResult getInfo(@PathVariable("objId") Long objId) + { + return success(baseFactoryInfoService.selectBaseFactoryInfoByObjId(objId)); + } + + /** + * 新增工厂信息 + */ + @RequiresPermissions("system:info:add") + @Log(title = "工厂信息", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody BaseFactoryInfo baseFactoryInfo) + { + return toAjax(baseFactoryInfoService.insertBaseFactoryInfo(baseFactoryInfo)); + } + + /** + * 修改工厂信息 + */ + @RequiresPermissions("system:info:edit") + @Log(title = "工厂信息", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody BaseFactoryInfo baseFactoryInfo) + { + return toAjax(baseFactoryInfoService.updateBaseFactoryInfo(baseFactoryInfo)); + } + + /** + * 删除工厂信息 + */ + @RequiresPermissions("system:info:remove") + @Log(title = "工厂信息", businessType = BusinessType.DELETE) + @DeleteMapping("/{objIds}") + public AjaxResult remove(@PathVariable Long[] objIds) + { + return toAjax(baseFactoryInfoService.deleteBaseFactoryInfoByObjIds(objIds)); + } +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/BaseFactoryInfo.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/BaseFactoryInfo.java new file mode 100644 index 0000000..1e715fc --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/BaseFactoryInfo.java @@ -0,0 +1,168 @@ +package com.ruoyi.system.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.core.annotation.Excel; +import com.ruoyi.common.core.web.domain.BaseEntity; + +/** + * 工厂信息对象 base_factory_info + * + * @author ruoyi + * @date 2024-07-01 + */ +public class BaseFactoryInfo extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 标识 */ + private Long objId; + + /** 公司名称 */ + @Excel(name = "公司名称") + private String companyCode; + + /** 工厂编号 */ + @Excel(name = "工厂编号") + private String factoryCode; + + /** 工厂名称 */ + @Excel(name = "工厂名称") + private String factoryName; + + /** 工厂状态 */ + @Excel(name = "工厂状态") + private Long factoryStatus; + + /** 是否标识:1-是;0-否 */ + @Excel(name = "是否标识:1-是;0-否") + private Long isFlag; + + /** 创建人 */ + @Excel(name = "创建人") + private String createdBy; + + /** 创建时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date createdTime; + + /** 更新人 */ + @Excel(name = "更新人") + private String updatedBy; + + /** 更新时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date updatedTime; + + public void setObjId(Long objId) + { + this.objId = objId; + } + + public Long getObjId() + { + return objId; + } + public void setCompanyCode(String companyCode) + { + this.companyCode = companyCode; + } + + public String getCompanyCode() + { + return companyCode; + } + 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(Long factoryStatus) + { + this.factoryStatus = factoryStatus; + } + + public Long getFactoryStatus() + { + return factoryStatus; + } + public void setIsFlag(Long isFlag) + { + this.isFlag = isFlag; + } + + public Long getIsFlag() + { + return isFlag; + } + public void setCreatedBy(String createdBy) + { + this.createdBy = createdBy; + } + + public String getCreatedBy() + { + return createdBy; + } + public void setCreatedTime(Date createdTime) + { + this.createdTime = createdTime; + } + + public Date getCreatedTime() + { + return createdTime; + } + public void setUpdatedBy(String updatedBy) + { + this.updatedBy = updatedBy; + } + + public String getUpdatedBy() + { + return updatedBy; + } + public void setUpdatedTime(Date updatedTime) + { + this.updatedTime = updatedTime; + } + + public Date getUpdatedTime() + { + return updatedTime; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("objId", getObjId()) + .append("companyCode", getCompanyCode()) + .append("factoryCode", getFactoryCode()) + .append("factoryName", getFactoryName()) + .append("factoryStatus", getFactoryStatus()) + .append("isFlag", getIsFlag()) + .append("remark", getRemark()) + .append("createdBy", getCreatedBy()) + .append("createdTime", getCreatedTime()) + .append("updatedBy", getUpdatedBy()) + .append("updatedTime", getUpdatedTime()) + .toString(); + } +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/BaseFactoryInfoMapper.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/BaseFactoryInfoMapper.java new file mode 100644 index 0000000..6a89b4f --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/BaseFactoryInfoMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.system.mapper; + +import java.util.List; +import com.ruoyi.system.domain.BaseFactoryInfo; + +/** + * 工厂信息Mapper接口 + * + * @author ruoyi + * @date 2024-07-01 + */ +public interface BaseFactoryInfoMapper +{ + /** + * 查询工厂信息 + * + * @param objId 工厂信息主键 + * @return 工厂信息 + */ + public BaseFactoryInfo selectBaseFactoryInfoByObjId(Long objId); + + /** + * 查询工厂信息列表 + * + * @param baseFactoryInfo 工厂信息 + * @return 工厂信息集合 + */ + public List selectBaseFactoryInfoList(BaseFactoryInfo baseFactoryInfo); + + /** + * 新增工厂信息 + * + * @param baseFactoryInfo 工厂信息 + * @return 结果 + */ + public int insertBaseFactoryInfo(BaseFactoryInfo baseFactoryInfo); + + /** + * 修改工厂信息 + * + * @param baseFactoryInfo 工厂信息 + * @return 结果 + */ + public int updateBaseFactoryInfo(BaseFactoryInfo baseFactoryInfo); + + /** + * 删除工厂信息 + * + * @param objId 工厂信息主键 + * @return 结果 + */ + public int deleteBaseFactoryInfoByObjId(Long objId); + + /** + * 批量删除工厂信息 + * + * @param objIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteBaseFactoryInfoByObjIds(Long[] objIds); +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/IBaseFactoryInfoService.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/IBaseFactoryInfoService.java new file mode 100644 index 0000000..a53d12f --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/IBaseFactoryInfoService.java @@ -0,0 +1,61 @@ +package com.ruoyi.system.service; + +import java.util.List; +import com.ruoyi.system.domain.BaseFactoryInfo; + +/** + * 工厂信息Service接口 + * + * @author ruoyi + * @date 2024-07-01 + */ +public interface IBaseFactoryInfoService +{ + /** + * 查询工厂信息 + * + * @param objId 工厂信息主键 + * @return 工厂信息 + */ + public BaseFactoryInfo selectBaseFactoryInfoByObjId(Long objId); + + /** + * 查询工厂信息列表 + * + * @param baseFactoryInfo 工厂信息 + * @return 工厂信息集合 + */ + public List selectBaseFactoryInfoList(BaseFactoryInfo baseFactoryInfo); + + /** + * 新增工厂信息 + * + * @param baseFactoryInfo 工厂信息 + * @return 结果 + */ + public int insertBaseFactoryInfo(BaseFactoryInfo baseFactoryInfo); + + /** + * 修改工厂信息 + * + * @param baseFactoryInfo 工厂信息 + * @return 结果 + */ + public int updateBaseFactoryInfo(BaseFactoryInfo baseFactoryInfo); + + /** + * 批量删除工厂信息 + * + * @param objIds 需要删除的工厂信息主键集合 + * @return 结果 + */ + public int deleteBaseFactoryInfoByObjIds(Long[] objIds); + + /** + * 删除工厂信息信息 + * + * @param objId 工厂信息主键 + * @return 结果 + */ + public int deleteBaseFactoryInfoByObjId(Long objId); +} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/BaseFactoryInfoServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/BaseFactoryInfoServiceImpl.java new file mode 100644 index 0000000..06b222a --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/BaseFactoryInfoServiceImpl.java @@ -0,0 +1,101 @@ +package com.ruoyi.system.service.impl; + +import java.util.List; + +import com.baomidou.dynamic.datasource.annotation.DS; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.system.mapper.BaseFactoryInfoMapper; +import com.ruoyi.system.domain.BaseFactoryInfo; +import com.ruoyi.system.service.IBaseFactoryInfoService; + +/** + * 工厂信息Service业务层处理 + * + * @author ruoyi + * @date 2024-07-01 + */ +@Service +public class BaseFactoryInfoServiceImpl implements IBaseFactoryInfoService +{ + @Autowired + private BaseFactoryInfoMapper baseFactoryInfoMapper; + + /** + * 查询工厂信息 + * + * @param objId 工厂信息主键 + * @return 工厂信息 + */ + @Override + @DS("#header.poolName") + public BaseFactoryInfo selectBaseFactoryInfoByObjId(Long objId) + { + return baseFactoryInfoMapper.selectBaseFactoryInfoByObjId(objId); + } + + /** + * 查询工厂信息列表 + * + * @param baseFactoryInfo 工厂信息 + * @return 工厂信息 + */ + @Override + @DS("#header.poolName") + public List selectBaseFactoryInfoList(BaseFactoryInfo baseFactoryInfo) + { + return baseFactoryInfoMapper.selectBaseFactoryInfoList(baseFactoryInfo); + } + + /** + * 新增工厂信息 + * + * @param baseFactoryInfo 工厂信息 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int insertBaseFactoryInfo(BaseFactoryInfo baseFactoryInfo) + { + return baseFactoryInfoMapper.insertBaseFactoryInfo(baseFactoryInfo); + } + + /** + * 修改工厂信息 + * + * @param baseFactoryInfo 工厂信息 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int updateBaseFactoryInfo(BaseFactoryInfo baseFactoryInfo) + { + return baseFactoryInfoMapper.updateBaseFactoryInfo(baseFactoryInfo); + } + + /** + * 批量删除工厂信息 + * + * @param objIds 需要删除的工厂信息主键 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int deleteBaseFactoryInfoByObjIds(Long[] objIds) + { + return baseFactoryInfoMapper.deleteBaseFactoryInfoByObjIds(objIds); + } + + /** + * 删除工厂信息信息 + * + * @param objId 工厂信息主键 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int deleteBaseFactoryInfoByObjId(Long objId) + { + return baseFactoryInfoMapper.deleteBaseFactoryInfoByObjId(objId); + } +} diff --git a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/BaseFactoryInfoMapper.xml b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/BaseFactoryInfoMapper.xml new file mode 100644 index 0000000..52a2379 --- /dev/null +++ b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/BaseFactoryInfoMapper.xml @@ -0,0 +1,100 @@ + + + + + + + + + + + + + + + + + + + + select obj_id, company_code, factory_code, factory_name, factory_status, is_flag, remark, created_by, created_time, updated_by, updated_time from base_factory_info + + + + + + + + insert into base_factory_info + + company_code, + factory_code, + factory_name, + factory_status, + is_flag, + remark, + created_by, + created_time, + updated_by, + updated_time, + + + #{companyCode}, + #{factoryCode}, + #{factoryName}, + #{factoryStatus}, + #{isFlag}, + #{remark}, + #{createdBy}, + #{createdTime}, + #{updatedBy}, + #{updatedTime}, + + + + + update base_factory_info + + company_code = #{companyCode}, + factory_code = #{factoryCode}, + factory_name = #{factoryName}, + factory_status = #{factoryStatus}, + is_flag = #{isFlag}, + remark = #{remark}, + created_by = #{createdBy}, + created_time = #{createdTime}, + updated_by = #{updatedBy}, + updated_time = #{updatedTime}, + + where obj_id = #{objId} + + + + delete from base_factory_info where obj_id = #{objId} + + + + delete from base_factory_info where obj_id in + + #{objId} + + + \ No newline at end of file diff --git a/ruoyi-ui/src/api/system/info.js b/ruoyi-ui/src/api/system/info.js new file mode 100644 index 0000000..3f2475d --- /dev/null +++ b/ruoyi-ui/src/api/system/info.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询工厂信息列表 +export function listInfo(query) { + return request({ + url: '/system/info/list', + method: 'get', + params: query + }) +} + +// 查询工厂信息详细 +export function getInfo(objId) { + return request({ + url: '/system/info/' + objId, + method: 'get' + }) +} + +// 新增工厂信息 +export function addInfo(data) { + return request({ + url: '/system/info', + method: 'post', + data: data + }) +} + +// 修改工厂信息 +export function updateInfo(data) { + return request({ + url: '/system/info', + method: 'put', + data: data + }) +} + +// 删除工厂信息 +export function delInfo(objId) { + return request({ + url: '/system/info/' + objId, + method: 'delete' + }) +} diff --git a/ruoyi-ui/src/views/system/info/index.vue b/ruoyi-ui/src/views/system/info/index.vue new file mode 100644 index 0000000..eb2ce1d --- /dev/null +++ b/ruoyi-ui/src/views/system/info/index.vue @@ -0,0 +1,369 @@ + + +