From af7f5bcf332c4c8dfda9f89d717d2238d7a89908 Mon Sep 17 00:00:00 2001 From: "JinLu.Yin" <411641505@qq.com> Date: Tue, 26 Jul 2022 15:48:45 +0800 Subject: [PATCH] =?UTF-8?q?SOP=E5=90=8E=E5=8F=B0=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../md/controller/MdProdutSopController.java | 104 +++++++++ .../com/ktg/mes/md/domain/MdProdutSop.java | 206 ++++++++++++++++++ .../ktg/mes/md/mapper/MdProdutSopMapper.java | 61 ++++++ .../mes/md/service/IMdProdutSopService.java | 61 ++++++ .../service/impl/MdProdutSopServiceImpl.java | 96 ++++++++ .../resources/mapper/md/MdProdutSopMapper.xml | 127 +++++++++++ 6 files changed, 655 insertions(+) create mode 100644 ktg-mes/src/main/java/com/ktg/mes/md/controller/MdProdutSopController.java create mode 100644 ktg-mes/src/main/java/com/ktg/mes/md/domain/MdProdutSop.java create mode 100644 ktg-mes/src/main/java/com/ktg/mes/md/mapper/MdProdutSopMapper.java create mode 100644 ktg-mes/src/main/java/com/ktg/mes/md/service/IMdProdutSopService.java create mode 100644 ktg-mes/src/main/java/com/ktg/mes/md/service/impl/MdProdutSopServiceImpl.java create mode 100644 ktg-mes/src/main/resources/mapper/md/MdProdutSopMapper.xml diff --git a/ktg-mes/src/main/java/com/ktg/mes/md/controller/MdProdutSopController.java b/ktg-mes/src/main/java/com/ktg/mes/md/controller/MdProdutSopController.java new file mode 100644 index 0000000..93be3a2 --- /dev/null +++ b/ktg-mes/src/main/java/com/ktg/mes/md/controller/MdProdutSopController.java @@ -0,0 +1,104 @@ +package com.ktg.mes.md.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.md.domain.MdProdutSop; +import com.ktg.mes.md.service.IMdProdutSopService; +import com.ktg.common.utils.poi.ExcelUtil; +import com.ktg.common.core.page.TableDataInfo; + +/** + * 产品SOPController + * + * @author yinjinlu + * @date 2022-07-26 + */ +@RestController +@RequestMapping("/mes/md/sop") +public class MdProdutSopController extends BaseController +{ + @Autowired + private IMdProdutSopService mdProdutSopService; + + /** + * 查询产品SOP列表 + */ + @PreAuthorize("@ss.hasPermi('mes:md:sop:list')") + @GetMapping("/list") + public TableDataInfo list(MdProdutSop mdProdutSop) + { + startPage(); + List list = mdProdutSopService.selectMdProdutSopList(mdProdutSop); + return getDataTable(list); + } + + /** + * 导出产品SOP列表 + */ + @PreAuthorize("@ss.hasPermi('mes:md:sop:export')") + @Log(title = "产品SOP", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, MdProdutSop mdProdutSop) + { + List list = mdProdutSopService.selectMdProdutSopList(mdProdutSop); + ExcelUtil util = new ExcelUtil(MdProdutSop.class); + util.exportExcel(response, list, "产品SOP数据"); + } + + /** + * 获取产品SOP详细信息 + */ + @PreAuthorize("@ss.hasPermi('mes:md:sop:query')") + @GetMapping(value = "/{sopId}") + public AjaxResult getInfo(@PathVariable("sopId") Long sopId) + { + return AjaxResult.success(mdProdutSopService.selectMdProdutSopBySopId(sopId)); + } + + /** + * 新增产品SOP + */ + @PreAuthorize("@ss.hasPermi('mes:md:sop:add')") + @Log(title = "产品SOP", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody MdProdutSop mdProdutSop) + { + return toAjax(mdProdutSopService.insertMdProdutSop(mdProdutSop)); + } + + /** + * 修改产品SOP + */ + @PreAuthorize("@ss.hasPermi('mes:md:sop:edit')") + @Log(title = "产品SOP", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody MdProdutSop mdProdutSop) + { + return toAjax(mdProdutSopService.updateMdProdutSop(mdProdutSop)); + } + + /** + * 删除产品SOP + */ + @PreAuthorize("@ss.hasPermi('mes:md:sop:remove')") + @Log(title = "产品SOP", businessType = BusinessType.DELETE) + @DeleteMapping("/{sopIds}") + public AjaxResult remove(@PathVariable Long[] sopIds) + { + return toAjax(mdProdutSopService.deleteMdProdutSopBySopIds(sopIds)); + } +} diff --git a/ktg-mes/src/main/java/com/ktg/mes/md/domain/MdProdutSop.java b/ktg-mes/src/main/java/com/ktg/mes/md/domain/MdProdutSop.java new file mode 100644 index 0000000..0b26ff4 --- /dev/null +++ b/ktg-mes/src/main/java/com/ktg/mes/md/domain/MdProdutSop.java @@ -0,0 +1,206 @@ +package com.ktg.mes.md.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; + +/** + * 产品SOP对象 md_produt_sop + * + * @author yinjinlu + * @date 2022-07-26 + */ +public class MdProdutSop extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 记录ID */ + private Long sopId; + + /** 物料产品ID */ + @Excel(name = "物料产品ID") + private Long itemId; + + /** 排列顺序 */ + @Excel(name = "排列顺序") + private Integer orderNum; + + /** 对应的工序 */ + @Excel(name = "对应的工序") + private Long processId; + + /** 工序编号 */ + @Excel(name = "工序编号") + private String processCode; + + /** 工序名称 */ + @Excel(name = "工序名称") + private String processName; + + /** 标题 */ + @Excel(name = "标题") + private String sopTitle; + + /** 详细描述 */ + @Excel(name = "详细描述") + private String sopDescription; + + /** 图片地址 */ + @Excel(name = "图片地址") + private String sopUrl; + + /** 预留字段1 */ + private String attr1; + + /** 预留字段2 */ + private String attr2; + + /** 预留字段3 */ + private Long attr3; + + /** 预留字段4 */ + private Long attr4; + + public void setSopId(Long sopId) + { + this.sopId = sopId; + } + + public Long getSopId() + { + return sopId; + } + public void setItemId(Long itemId) + { + this.itemId = itemId; + } + + public Long getItemId() + { + return itemId; + } + public void setOrderNum(Integer orderNum) + { + this.orderNum = orderNum; + } + + public Integer getOrderNum() + { + return orderNum; + } + public void setProcessId(Long processId) + { + this.processId = processId; + } + + public Long getProcessId() + { + return processId; + } + public void setProcessCode(String processCode) + { + this.processCode = processCode; + } + + public String getProcessCode() + { + return processCode; + } + public void setProcessName(String processName) + { + this.processName = processName; + } + + public String getProcessName() + { + return processName; + } + public void setSopTitle(String sopTitle) + { + this.sopTitle = sopTitle; + } + + public String getSopTitle() + { + return sopTitle; + } + public void setSopDescription(String sopDescription) + { + this.sopDescription = sopDescription; + } + + public String getSopDescription() + { + return sopDescription; + } + public void setSopUrl(String sopUrl) + { + this.sopUrl = sopUrl; + } + + public String getSopUrl() + { + return sopUrl; + } + 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("sopId", getSopId()) + .append("itemId", getItemId()) + .append("orderNum", getOrderNum()) + .append("processId", getProcessId()) + .append("processCode", getProcessCode()) + .append("processName", getProcessName()) + .append("sopTitle", getSopTitle()) + .append("sopDescription", getSopDescription()) + .append("sopUrl", getSopUrl()) + .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/md/mapper/MdProdutSopMapper.java b/ktg-mes/src/main/java/com/ktg/mes/md/mapper/MdProdutSopMapper.java new file mode 100644 index 0000000..bcef8d7 --- /dev/null +++ b/ktg-mes/src/main/java/com/ktg/mes/md/mapper/MdProdutSopMapper.java @@ -0,0 +1,61 @@ +package com.ktg.mes.md.mapper; + +import java.util.List; +import com.ktg.mes.md.domain.MdProdutSop; + +/** + * 产品SOPMapper接口 + * + * @author yinjinlu + * @date 2022-07-26 + */ +public interface MdProdutSopMapper +{ + /** + * 查询产品SOP + * + * @param sopId 产品SOP主键 + * @return 产品SOP + */ + public MdProdutSop selectMdProdutSopBySopId(Long sopId); + + /** + * 查询产品SOP列表 + * + * @param mdProdutSop 产品SOP + * @return 产品SOP集合 + */ + public List selectMdProdutSopList(MdProdutSop mdProdutSop); + + /** + * 新增产品SOP + * + * @param mdProdutSop 产品SOP + * @return 结果 + */ + public int insertMdProdutSop(MdProdutSop mdProdutSop); + + /** + * 修改产品SOP + * + * @param mdProdutSop 产品SOP + * @return 结果 + */ + public int updateMdProdutSop(MdProdutSop mdProdutSop); + + /** + * 删除产品SOP + * + * @param sopId 产品SOP主键 + * @return 结果 + */ + public int deleteMdProdutSopBySopId(Long sopId); + + /** + * 批量删除产品SOP + * + * @param sopIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteMdProdutSopBySopIds(Long[] sopIds); +} diff --git a/ktg-mes/src/main/java/com/ktg/mes/md/service/IMdProdutSopService.java b/ktg-mes/src/main/java/com/ktg/mes/md/service/IMdProdutSopService.java new file mode 100644 index 0000000..ed0981b --- /dev/null +++ b/ktg-mes/src/main/java/com/ktg/mes/md/service/IMdProdutSopService.java @@ -0,0 +1,61 @@ +package com.ktg.mes.md.service; + +import java.util.List; +import com.ktg.mes.md.domain.MdProdutSop; + +/** + * 产品SOPService接口 + * + * @author yinjinlu + * @date 2022-07-26 + */ +public interface IMdProdutSopService +{ + /** + * 查询产品SOP + * + * @param sopId 产品SOP主键 + * @return 产品SOP + */ + public MdProdutSop selectMdProdutSopBySopId(Long sopId); + + /** + * 查询产品SOP列表 + * + * @param mdProdutSop 产品SOP + * @return 产品SOP集合 + */ + public List selectMdProdutSopList(MdProdutSop mdProdutSop); + + /** + * 新增产品SOP + * + * @param mdProdutSop 产品SOP + * @return 结果 + */ + public int insertMdProdutSop(MdProdutSop mdProdutSop); + + /** + * 修改产品SOP + * + * @param mdProdutSop 产品SOP + * @return 结果 + */ + public int updateMdProdutSop(MdProdutSop mdProdutSop); + + /** + * 批量删除产品SOP + * + * @param sopIds 需要删除的产品SOP主键集合 + * @return 结果 + */ + public int deleteMdProdutSopBySopIds(Long[] sopIds); + + /** + * 删除产品SOP信息 + * + * @param sopId 产品SOP主键 + * @return 结果 + */ + public int deleteMdProdutSopBySopId(Long sopId); +} diff --git a/ktg-mes/src/main/java/com/ktg/mes/md/service/impl/MdProdutSopServiceImpl.java b/ktg-mes/src/main/java/com/ktg/mes/md/service/impl/MdProdutSopServiceImpl.java new file mode 100644 index 0000000..3f2867e --- /dev/null +++ b/ktg-mes/src/main/java/com/ktg/mes/md/service/impl/MdProdutSopServiceImpl.java @@ -0,0 +1,96 @@ +package com.ktg.mes.md.service.impl; + +import java.util.List; +import com.ktg.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ktg.mes.md.mapper.MdProdutSopMapper; +import com.ktg.mes.md.domain.MdProdutSop; +import com.ktg.mes.md.service.IMdProdutSopService; + +/** + * 产品SOPService业务层处理 + * + * @author yinjinlu + * @date 2022-07-26 + */ +@Service +public class MdProdutSopServiceImpl implements IMdProdutSopService +{ + @Autowired + private MdProdutSopMapper mdProdutSopMapper; + + /** + * 查询产品SOP + * + * @param sopId 产品SOP主键 + * @return 产品SOP + */ + @Override + public MdProdutSop selectMdProdutSopBySopId(Long sopId) + { + return mdProdutSopMapper.selectMdProdutSopBySopId(sopId); + } + + /** + * 查询产品SOP列表 + * + * @param mdProdutSop 产品SOP + * @return 产品SOP + */ + @Override + public List selectMdProdutSopList(MdProdutSop mdProdutSop) + { + return mdProdutSopMapper.selectMdProdutSopList(mdProdutSop); + } + + /** + * 新增产品SOP + * + * @param mdProdutSop 产品SOP + * @return 结果 + */ + @Override + public int insertMdProdutSop(MdProdutSop mdProdutSop) + { + mdProdutSop.setCreateTime(DateUtils.getNowDate()); + return mdProdutSopMapper.insertMdProdutSop(mdProdutSop); + } + + /** + * 修改产品SOP + * + * @param mdProdutSop 产品SOP + * @return 结果 + */ + @Override + public int updateMdProdutSop(MdProdutSop mdProdutSop) + { + mdProdutSop.setUpdateTime(DateUtils.getNowDate()); + return mdProdutSopMapper.updateMdProdutSop(mdProdutSop); + } + + /** + * 批量删除产品SOP + * + * @param sopIds 需要删除的产品SOP主键 + * @return 结果 + */ + @Override + public int deleteMdProdutSopBySopIds(Long[] sopIds) + { + return mdProdutSopMapper.deleteMdProdutSopBySopIds(sopIds); + } + + /** + * 删除产品SOP信息 + * + * @param sopId 产品SOP主键 + * @return 结果 + */ + @Override + public int deleteMdProdutSopBySopId(Long sopId) + { + return mdProdutSopMapper.deleteMdProdutSopBySopId(sopId); + } +} diff --git a/ktg-mes/src/main/resources/mapper/md/MdProdutSopMapper.xml b/ktg-mes/src/main/resources/mapper/md/MdProdutSopMapper.xml new file mode 100644 index 0000000..aa0e5aa --- /dev/null +++ b/ktg-mes/src/main/resources/mapper/md/MdProdutSopMapper.xml @@ -0,0 +1,127 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + select sop_id, item_id, order_num, process_id, process_code, process_name, sop_title, sop_description, sop_url, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from md_produt_sop + + + + + + + + insert into md_produt_sop + + item_id, + order_num, + process_id, + process_code, + process_name, + sop_title, + sop_description, + sop_url, + remark, + attr1, + attr2, + attr3, + attr4, + create_by, + create_time, + update_by, + update_time, + + + #{itemId}, + #{orderNum}, + #{processId}, + #{processCode}, + #{processName}, + #{sopTitle}, + #{sopDescription}, + #{sopUrl}, + #{remark}, + #{attr1}, + #{attr2}, + #{attr3}, + #{attr4}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + + + + + update md_produt_sop + + item_id = #{itemId}, + order_num = #{orderNum}, + process_id = #{processId}, + process_code = #{processCode}, + process_name = #{processName}, + sop_title = #{sopTitle}, + sop_description = #{sopDescription}, + sop_url = #{sopUrl}, + remark = #{remark}, + attr1 = #{attr1}, + attr2 = #{attr2}, + attr3 = #{attr3}, + attr4 = #{attr4}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + + where sop_id = #{sopId} + + + + delete from md_produt_sop where sop_id = #{sopId} + + + + delete from md_produt_sop where sop_id in + + #{sopId} + + + \ No newline at end of file