From 755a54d95d7e327f591d61ecca8f4065a2b475b7 Mon Sep 17 00:00:00 2001 From: "JinLu.Yin" <411641505@qq.com> Date: Sun, 5 Jun 2022 21:45:57 +0800 Subject: [PATCH] =?UTF-8?q?=E7=8F=AD=E7=BB=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mes/cal/controller/CalTeamController.java | 104 +++++++++++++++ .../java/com/ktg/mes/cal/domain/CalTeam.java | 122 ++++++++++++++++++ .../com/ktg/mes/cal/mapper/CalTeamMapper.java | 61 +++++++++ .../ktg/mes/cal/service/ICalTeamService.java | 61 +++++++++ .../resources/mapper/cal/CalTeamMapper.xml | 97 ++++++++++++++ 5 files changed, 445 insertions(+) create mode 100644 ktg-mes/src/main/java/com/ktg/mes/cal/controller/CalTeamController.java create mode 100644 ktg-mes/src/main/java/com/ktg/mes/cal/domain/CalTeam.java create mode 100644 ktg-mes/src/main/java/com/ktg/mes/cal/mapper/CalTeamMapper.java create mode 100644 ktg-mes/src/main/java/com/ktg/mes/cal/service/ICalTeamService.java create mode 100644 ktg-mes/src/main/resources/mapper/cal/CalTeamMapper.xml diff --git a/ktg-mes/src/main/java/com/ktg/mes/cal/controller/CalTeamController.java b/ktg-mes/src/main/java/com/ktg/mes/cal/controller/CalTeamController.java new file mode 100644 index 0000000..e8d69f2 --- /dev/null +++ b/ktg-mes/src/main/java/com/ktg/mes/cal/controller/CalTeamController.java @@ -0,0 +1,104 @@ +package com.ktg.mes.cal.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; +import org.springframework.security.access.prepost.PreAuthorize; +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.ktg.common.annotation.Log; +import com.ktg.common.core.controller.BaseController; +import com.ktg.common.core.domain.AjaxResult; +import com.ktg.common.enums.BusinessType; +import com.ktg.mes.cal.domain.CalTeam; +import com.ktg.mes.cal.service.ICalTeamService; +import com.ktg.common.utils.poi.ExcelUtil; +import com.ktg.common.core.page.TableDataInfo; + +/** + * 班组Controller + * + * @author yinjinlu + * @date 2022-06-05 + */ +@RestController +@RequestMapping("/cal/team") +public class CalTeamController extends BaseController +{ + @Autowired + private ICalTeamService calTeamService; + + /** + * 查询班组列表 + */ + @PreAuthorize("@ss.hasPermi('cal:team:list')") + @GetMapping("/list") + public TableDataInfo list(CalTeam calTeam) + { + startPage(); + List list = calTeamService.selectCalTeamList(calTeam); + return getDataTable(list); + } + + /** + * 导出班组列表 + */ + @PreAuthorize("@ss.hasPermi('cal:team:export')") + @Log(title = "班组", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, CalTeam calTeam) + { + List list = calTeamService.selectCalTeamList(calTeam); + ExcelUtil util = new ExcelUtil(CalTeam.class); + util.exportExcel(response, list, "班组数据"); + } + + /** + * 获取班组详细信息 + */ + @PreAuthorize("@ss.hasPermi('cal:team:query')") + @GetMapping(value = "/{teamId}") + public AjaxResult getInfo(@PathVariable("teamId") Long teamId) + { + return AjaxResult.success(calTeamService.selectCalTeamByTeamId(teamId)); + } + + /** + * 新增班组 + */ + @PreAuthorize("@ss.hasPermi('cal:team:add')") + @Log(title = "班组", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody CalTeam calTeam) + { + return toAjax(calTeamService.insertCalTeam(calTeam)); + } + + /** + * 修改班组 + */ + @PreAuthorize("@ss.hasPermi('cal:team:edit')") + @Log(title = "班组", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody CalTeam calTeam) + { + return toAjax(calTeamService.updateCalTeam(calTeam)); + } + + /** + * 删除班组 + */ + @PreAuthorize("@ss.hasPermi('cal:team:remove')") + @Log(title = "班组", businessType = BusinessType.DELETE) + @DeleteMapping("/{teamIds}") + public AjaxResult remove(@PathVariable Long[] teamIds) + { + return toAjax(calTeamService.deleteCalTeamByTeamIds(teamIds)); + } +} diff --git a/ktg-mes/src/main/java/com/ktg/mes/cal/domain/CalTeam.java b/ktg-mes/src/main/java/com/ktg/mes/cal/domain/CalTeam.java new file mode 100644 index 0000000..68258ef --- /dev/null +++ b/ktg-mes/src/main/java/com/ktg/mes/cal/domain/CalTeam.java @@ -0,0 +1,122 @@ +package com.ktg.mes.cal.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ktg.common.annotation.Excel; +import com.ktg.common.core.domain.BaseEntity; + +/** + * 班组对象 cal_team + * + * @author yinjinlu + * @date 2022-06-05 + */ +public class CalTeam extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 班组ID */ + private Long teamId; + + /** 班组编号 */ + @Excel(name = "班组编号") + private String teamCode; + + /** 班组名称 */ + @Excel(name = "班组名称") + private String teamName; + + /** 预留字段1 */ + private String attr1; + + /** 预留字段2 */ + private String attr2; + + /** 预留字段3 */ + private Long attr3; + + /** 预留字段4 */ + private Long attr4; + + public void setTeamId(Long teamId) + { + this.teamId = teamId; + } + + public Long getTeamId() + { + return teamId; + } + public void setTeamCode(String teamCode) + { + this.teamCode = teamCode; + } + + public String getTeamCode() + { + return teamCode; + } + public void setTeamName(String teamName) + { + this.teamName = teamName; + } + + public String getTeamName() + { + return teamName; + } + public void setAttr1(String attr1) + { + this.attr1 = attr1; + } + + public String getAttr1() + { + return attr1; + } + public void setAttr2(String attr2) + { + this.attr2 = attr2; + } + + public String getAttr2() + { + return attr2; + } + public void setAttr3(Long attr3) + { + this.attr3 = attr3; + } + + public Long getAttr3() + { + return attr3; + } + public void setAttr4(Long attr4) + { + this.attr4 = attr4; + } + + public Long getAttr4() + { + return attr4; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("teamId", getTeamId()) + .append("teamCode", getTeamCode()) + .append("teamName", getTeamName()) + .append("remark", getRemark()) + .append("attr1", getAttr1()) + .append("attr2", getAttr2()) + .append("attr3", getAttr3()) + .append("attr4", getAttr4()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .toString(); + } +} diff --git a/ktg-mes/src/main/java/com/ktg/mes/cal/mapper/CalTeamMapper.java b/ktg-mes/src/main/java/com/ktg/mes/cal/mapper/CalTeamMapper.java new file mode 100644 index 0000000..61463b3 --- /dev/null +++ b/ktg-mes/src/main/java/com/ktg/mes/cal/mapper/CalTeamMapper.java @@ -0,0 +1,61 @@ +package com.ktg.mes.cal.mapper; + +import java.util.List; +import com.ktg.mes.cal.domain.CalTeam; + +/** + * 班组Mapper接口 + * + * @author yinjinlu + * @date 2022-06-05 + */ +public interface CalTeamMapper +{ + /** + * 查询班组 + * + * @param teamId 班组主键 + * @return 班组 + */ + public CalTeam selectCalTeamByTeamId(Long teamId); + + /** + * 查询班组列表 + * + * @param calTeam 班组 + * @return 班组集合 + */ + public List selectCalTeamList(CalTeam calTeam); + + /** + * 新增班组 + * + * @param calTeam 班组 + * @return 结果 + */ + public int insertCalTeam(CalTeam calTeam); + + /** + * 修改班组 + * + * @param calTeam 班组 + * @return 结果 + */ + public int updateCalTeam(CalTeam calTeam); + + /** + * 删除班组 + * + * @param teamId 班组主键 + * @return 结果 + */ + public int deleteCalTeamByTeamId(Long teamId); + + /** + * 批量删除班组 + * + * @param teamIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteCalTeamByTeamIds(Long[] teamIds); +} diff --git a/ktg-mes/src/main/java/com/ktg/mes/cal/service/ICalTeamService.java b/ktg-mes/src/main/java/com/ktg/mes/cal/service/ICalTeamService.java new file mode 100644 index 0000000..82d2ca3 --- /dev/null +++ b/ktg-mes/src/main/java/com/ktg/mes/cal/service/ICalTeamService.java @@ -0,0 +1,61 @@ +package com.ktg.mes.cal.service; + +import java.util.List; +import com.ktg.mes.cal.domain.CalTeam; + +/** + * 班组Service接口 + * + * @author yinjinlu + * @date 2022-06-05 + */ +public interface ICalTeamService +{ + /** + * 查询班组 + * + * @param teamId 班组主键 + * @return 班组 + */ + public CalTeam selectCalTeamByTeamId(Long teamId); + + /** + * 查询班组列表 + * + * @param calTeam 班组 + * @return 班组集合 + */ + public List selectCalTeamList(CalTeam calTeam); + + /** + * 新增班组 + * + * @param calTeam 班组 + * @return 结果 + */ + public int insertCalTeam(CalTeam calTeam); + + /** + * 修改班组 + * + * @param calTeam 班组 + * @return 结果 + */ + public int updateCalTeam(CalTeam calTeam); + + /** + * 批量删除班组 + * + * @param teamIds 需要删除的班组主键集合 + * @return 结果 + */ + public int deleteCalTeamByTeamIds(Long[] teamIds); + + /** + * 删除班组信息 + * + * @param teamId 班组主键 + * @return 结果 + */ + public int deleteCalTeamByTeamId(Long teamId); +} diff --git a/ktg-mes/src/main/resources/mapper/cal/CalTeamMapper.xml b/ktg-mes/src/main/resources/mapper/cal/CalTeamMapper.xml new file mode 100644 index 0000000..aec4247 --- /dev/null +++ b/ktg-mes/src/main/resources/mapper/cal/CalTeamMapper.xml @@ -0,0 +1,97 @@ + + + + + + + + + + + + + + + + + + + + + select team_id, team_code, team_name, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from cal_team + + + + + + + + insert into cal_team + + team_code, + team_name, + remark, + attr1, + attr2, + attr3, + attr4, + create_by, + create_time, + update_by, + update_time, + + + #{teamCode}, + #{teamName}, + #{remark}, + #{attr1}, + #{attr2}, + #{attr3}, + #{attr4}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + + + + + update cal_team + + team_code = #{teamCode}, + team_name = #{teamName}, + remark = #{remark}, + attr1 = #{attr1}, + attr2 = #{attr2}, + attr3 = #{attr3}, + attr4 = #{attr4}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + + where team_id = #{teamId} + + + + delete from cal_team where team_id = #{teamId} + + + + delete from cal_team where team_id in + + #{teamId} + + + \ No newline at end of file