diff --git a/op-modules/op-mes/src/main/java/com/op/mes/controller/MesBoxController.java b/op-modules/op-mes/src/main/java/com/op/mes/controller/MesBoxController.java new file mode 100644 index 00000000..6a17bb58 --- /dev/null +++ b/op-modules/op-mes/src/main/java/com/op/mes/controller/MesBoxController.java @@ -0,0 +1,110 @@ +package com.op.mes.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.op.system.api.domain.SysDictType; +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.op.common.log.annotation.Log; +import com.op.common.log.enums.BusinessType; +import com.op.common.security.annotation.RequiresPermissions; +import com.op.mes.domain.MesBox; +import com.op.mes.service.IMesBoxService; +import com.op.common.core.web.controller.BaseController; +import com.op.common.core.web.domain.AjaxResult; +import com.op.common.core.utils.poi.ExcelUtil; +import com.op.common.core.web.page.TableDataInfo; + +/** + * 箱体类型Controller + * + * @author Open Platform + * @date 2024-08-20 + */ +@RestController +@RequestMapping("/mesBox") +public class MesBoxController extends BaseController { + @Autowired + private IMesBoxService mesBoxService; + +/** + * 查询箱体类型列表 + */ +@RequiresPermissions("mes:mesBox:list") +@GetMapping("/list") + public TableDataInfo list(MesBox mesBox) { + startPage(); + List list = mesBoxService.selectMesBoxList(mesBox); + return getDataTable(list); + } + + /** + * 导出箱体类型列表 + */ + @RequiresPermissions("mes:mesBox:export") + @Log(title = "箱体类型", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, MesBox mesBox) { + List list = mesBoxService.selectMesBoxList(mesBox); + ExcelUtil util = new ExcelUtil(MesBox. class); + util.exportExcel(response, list, "箱体类型数据"); + } + + /** + * 获取箱体类型详细信息 + */ + @RequiresPermissions("mes:mesBox:query") + @GetMapping(value = "/{boxId}") + public AjaxResult getInfo(@PathVariable("boxId") Long boxId) { + return success(mesBoxService.selectMesBoxByBoxId(boxId)); + } + + /** + * 新增箱体类型 + */ + @RequiresPermissions("mes:mesBox:add") + @Log(title = "箱体类型", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody MesBox mesBox) { + return toAjax(mesBoxService.insertMesBox(mesBox)); + } + + /** + * 修改箱体类型 + */ + @RequiresPermissions("mes:mesBox:edit") + @Log(title = "箱体类型", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody MesBox mesBox) { + return toAjax(mesBoxService.updateMesBox(mesBox)); + } + + /** + * 删除箱体类型 + */ + @RequiresPermissions("mes:mesBox:remove") + @Log(title = "箱体类型", businessType = BusinessType.DELETE) + @DeleteMapping("/{boxIds}") + public AjaxResult remove(@PathVariable Long[] boxIds) { + return toAjax(mesBoxService.deleteMesBoxByBoxIds(boxIds)); + } + + /** + * 获取字典选择框列表 + */ + @GetMapping("/optionSelect") + @DS("#header.poolName") + public AjaxResult optionSelect() { + List boxTypes = mesBoxService.selectDictTypeAll(); + return success(boxTypes); + } +} diff --git a/op-modules/op-mes/src/main/java/com/op/mes/controller/MesBoxDetailController.java b/op-modules/op-mes/src/main/java/com/op/mes/controller/MesBoxDetailController.java new file mode 100644 index 00000000..8e532477 --- /dev/null +++ b/op-modules/op-mes/src/main/java/com/op/mes/controller/MesBoxDetailController.java @@ -0,0 +1,115 @@ +package com.op.mes.controller; + +import java.util.ArrayList; +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.op.common.core.utils.StringUtils; +import com.op.system.api.domain.SysDictData; +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.op.common.log.annotation.Log; +import com.op.common.log.enums.BusinessType; +import com.op.common.security.annotation.RequiresPermissions; +import com.op.mes.domain.MesBoxDetail; +import com.op.mes.service.IMesBoxDetailService; +import com.op.common.core.web.controller.BaseController; +import com.op.common.core.web.domain.AjaxResult; +import com.op.common.core.utils.poi.ExcelUtil; +import com.op.common.core.web.page.TableDataInfo; + +/** + * 箱体数据Controller + * + * @author Open Platform + * @date 2024-08-20 + */ +@RestController +@RequestMapping("/mesBoxDetail") +public class MesBoxDetailController extends BaseController { + @Autowired + private IMesBoxDetailService mesBoxDetailService; + +/** + * 查询箱体数据列表 + */ +@RequiresPermissions("mes:mesBoxDetail:list") +@GetMapping("/list") + public TableDataInfo list(MesBoxDetail mesBoxDetail) { + startPage(); + List list = mesBoxDetailService.selectMesBoxDetailList(mesBoxDetail); + return getDataTable(list); + } + + /** + * 导出箱体数据列表 + */ + @RequiresPermissions("mes:mesBoxDetail:export") + @Log(title = "箱体数据", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, MesBoxDetail mesBoxDetail) { + List list = mesBoxDetailService.selectMesBoxDetailList(mesBoxDetail); + ExcelUtil util = new ExcelUtil(MesBoxDetail. class); + util.exportExcel(response, list, "箱体数据数据"); + } + + /** + * 获取箱体数据详细信息 + */ + @RequiresPermissions("mes:mesBoxDetail:query") + @GetMapping(value = "/{boxCode}") + public AjaxResult getInfo(@PathVariable("boxCode") Long boxCode) { + return success(mesBoxDetailService.selectMesBoxDetailByBoxCode(boxCode)); + } + + /** + * 根据箱体类型查询箱体数据信息 + */ + @GetMapping(value = "/type/{boxType}") + @DS("#header.poolName") + public AjaxResult dictType(@PathVariable String boxType) { + List data = mesBoxDetailService.selectBoxDataByType(boxType); + if (StringUtils.isNull(data)) { + data = new ArrayList(); + } + return success(data); + } + + /** + * 新增箱体数据 + */ + @RequiresPermissions("mes:mesBoxDetail:add") + @Log(title = "箱体数据", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody MesBoxDetail mesBoxDetail) { + return toAjax(mesBoxDetailService.insertMesBoxDetail(mesBoxDetail)); + } + + /** + * 修改箱体数据 + */ + @RequiresPermissions("mes:mesBoxDetail:edit") + @Log(title = "箱体数据", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody MesBoxDetail mesBoxDetail) { + return toAjax(mesBoxDetailService.updateMesBoxDetail(mesBoxDetail)); + } + + /** + * 删除箱体数据 + */ + @RequiresPermissions("mes:mesBoxDetail:remove") + @Log(title = "箱体数据", businessType = BusinessType.DELETE) + @DeleteMapping("/{boxCodes}") + public AjaxResult remove(@PathVariable Long[] boxCodes) { + return toAjax(mesBoxDetailService.deleteMesBoxDetailByBoxCodes(boxCodes)); + } +} diff --git a/op-modules/op-mes/src/main/java/com/op/mes/domain/MesBox.java b/op-modules/op-mes/src/main/java/com/op/mes/domain/MesBox.java new file mode 100644 index 00000000..5fa0f862 --- /dev/null +++ b/op-modules/op-mes/src/main/java/com/op/mes/domain/MesBox.java @@ -0,0 +1,75 @@ +package com.op.mes.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.op.common.core.annotation.Excel; +import com.op.common.core.web.domain.BaseEntity; + +/** + * 箱体类型对象 mes_box + * + * @author Open Platform + * @date 2024-08-20 + */ +public class MesBox extends BaseEntity { +private static final long serialVersionUID=1L; + + /** 字典主键 */ + private Long boxId; + + /** 字典名称 */ + @Excel(name = "字典名称") + private String boxName; + + /** 字典类型 */ + @Excel(name = "字典类型") + private String boxType; + + /** 状态(0正常 */ + @Excel(name = "状态", readConverterExp = "状态(0正常") + private String status; + + public void setBoxId(Long boxId){ + this.boxId = boxId; + } + + public Long getBoxId(){ + return boxId; + } + public void setBoxName(String boxName){ + this.boxName = boxName; + } + + public String getBoxName(){ + return boxName; + } + public void setBoxType(String boxType){ + this.boxType = boxType; + } + + public String getBoxType(){ + return boxType; + } + public void setStatus(String status){ + this.status = status; + } + + public String getStatus(){ + return status; + } + +@Override +public String toString(){ + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("boxId",getBoxId()) + .append("boxName",getBoxName()) + .append("boxType",getBoxType()) + .append("status",getStatus()) + .append("createBy",getCreateBy()) + .append("createTime",getCreateTime()) + .append("updateBy",getUpdateBy()) + .append("updateTime",getUpdateTime()) + .append("remark",getRemark()) + .toString(); + } + } diff --git a/op-modules/op-mes/src/main/java/com/op/mes/domain/MesBoxDetail.java b/op-modules/op-mes/src/main/java/com/op/mes/domain/MesBoxDetail.java new file mode 100644 index 00000000..06f2040c --- /dev/null +++ b/op-modules/op-mes/src/main/java/com/op/mes/domain/MesBoxDetail.java @@ -0,0 +1,176 @@ +package com.op.mes.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.op.common.core.annotation.Excel; +import com.op.common.core.web.domain.BaseEntity; + +/** + * 字典数据对象 mes_box_detail + * + * @author Open Platform + * @date 2024-08-20 + */ +public class MesBoxDetail extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 箱型编码 + */ + private Long boxCode; + + /** + * 箱型排序 + */ + @Excel(name = "箱型排序") + private Long boxSort; + + /** + * 箱型标签 + */ + @Excel(name = "箱型标签") + private String boxLabel; + + /** + * 箱型关键字 + */ + @Excel(name = "箱型关键字") + private String boxKey; + + /** + * 箱型值 + */ + @Excel(name = "箱型值") + private String boxValue; + + /** + * 箱型类型 + */ + @Excel(name = "箱型类型") + private String boxType; + + /** + * 样式属性(其他样式扩展) + */ + @Excel(name = "样式属性", readConverterExp = "其=他样式扩展") + private String cssClass; + + /** + * 表格回显样式 + */ + @Excel(name = "表格回显样式") + private String listClass; + + /** + * 是否默认(Y是 + */ + @Excel(name = "是否默认", readConverterExp = "是否默认(Y是") + private String isDefault; + + /** + * 状态(0正常 + */ + @Excel(name = "状态", readConverterExp = "状态(0正常") + private String status; + + public void setBoxCode(Long boxCode) { + this.boxCode = boxCode; + } + + public Long getBoxCode() { + return boxCode; + } + + public void setBoxSort(Long boxSort) { + this.boxSort = boxSort; + } + + public Long getBoxSort() { + return boxSort; + } + + public void setBoxLabel(String boxLabel) { + this.boxLabel = boxLabel; + } + + public String getBoxLabel() { + return boxLabel; + } + + + public String getBoxKey() { + return boxKey; + } + + public void setBoxKey(String boxKey) { + this.boxKey = boxKey; + } + + public void setBoxValue(String boxValue) { + this.boxValue = boxValue; + } + + public String getBoxValue() { + return boxValue; + } + + public void setBoxType(String boxType) { + this.boxType = boxType; + } + + public String getBoxType() { + return boxType; + } + + public void setCssClass(String cssClass) { + this.cssClass = cssClass; + } + + public String getCssClass() { + return cssClass; + } + + public void setListClass(String listClass) { + this.listClass = listClass; + } + + public String getListClass() { + return listClass; + } + + public void setIsDefault(String isDefault) { + this.isDefault = isDefault; + } + + public String getIsDefault() { + return isDefault; + } + + public void setStatus(String status) { + this.status = status; + } + + public String getStatus() { + return status; + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("boxCode", getBoxCode()) + .append("boxSort", getBoxSort()) + .append("boxLabel", getBoxLabel()) + .append("boxValue", getBoxValue()) + .append("boxType", getBoxType()) + .append("cssClass", getCssClass()) + .append("listClass", getListClass()) + .append("isDefault", getIsDefault()) + .append("status", getStatus()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("remark", getRemark()) + .toString(); + } +} diff --git a/op-modules/op-mes/src/main/java/com/op/mes/mapper/MesBoxDetailMapper.java b/op-modules/op-mes/src/main/java/com/op/mes/mapper/MesBoxDetailMapper.java new file mode 100644 index 00000000..410f2d3c --- /dev/null +++ b/op-modules/op-mes/src/main/java/com/op/mes/mapper/MesBoxDetailMapper.java @@ -0,0 +1,61 @@ +package com.op.mes.mapper; + +import java.util.List; + +import com.op.mes.domain.MesBoxDetail; + +/** + * 字典数据Mapper接口 + * + * @author Open Platform + * @date 2024-08-20 + */ +public interface MesBoxDetailMapper { + /** + * 查询字典数据 + * + * @param boxCode 字典数据主键 + * @return 字典数据 + */ + public MesBoxDetail selectMesBoxDetailByBoxCode(Long boxCode); + + /** + * 查询字典数据列表 + * + * @param mesBoxDetail 字典数据 + * @return 字典数据集合 + */ + public List selectMesBoxDetailList(MesBoxDetail mesBoxDetail); + + /** + * 新增字典数据 + * + * @param mesBoxDetail 字典数据 + * @return 结果 + */ + public int insertMesBoxDetail(MesBoxDetail mesBoxDetail); + + /** + * 修改字典数据 + * + * @param mesBoxDetail 字典数据 + * @return 结果 + */ + public int updateMesBoxDetail(MesBoxDetail mesBoxDetail); + + /** + * 删除字典数据 + * + * @param boxCode 字典数据主键 + * @return 结果 + */ + public int deleteMesBoxDetailByBoxCode(Long boxCode); + + /** + * 批量删除字典数据 + * + * @param boxCodes 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteMesBoxDetailByBoxCodes(Long[] boxCodes); +} diff --git a/op-modules/op-mes/src/main/java/com/op/mes/mapper/MesBoxMapper.java b/op-modules/op-mes/src/main/java/com/op/mes/mapper/MesBoxMapper.java new file mode 100644 index 00000000..46042a6e --- /dev/null +++ b/op-modules/op-mes/src/main/java/com/op/mes/mapper/MesBoxMapper.java @@ -0,0 +1,63 @@ +package com.op.mes.mapper; + +import java.util.List; + +import com.op.mes.domain.MesBox; + +/** + * 箱体类型Mapper接口 + * + * @author Open Platform + * @date 2024-08-20 + */ +public interface MesBoxMapper { + /** + * 查询箱体类型 + * + * @param boxId 箱体类型主键 + * @return 箱体类型 + */ + public MesBox selectMesBoxByBoxId(Long boxId); + + /** + * 查询箱体类型列表 + * + * @param mesBox 箱体类型 + * @return 箱体类型集合 + */ + public List selectMesBoxList(MesBox mesBox); + + /** + * 新增箱体类型 + * + * @param mesBox 箱体类型 + * @return 结果 + */ + public int insertMesBox(MesBox mesBox); + + /** + * 修改箱体类型 + * + * @param mesBox 箱体类型 + * @return 结果 + */ + public int updateMesBox(MesBox mesBox); + + /** + * 删除箱体类型 + * + * @param boxId 箱体类型主键 + * @return 结果 + */ + public int deleteMesBoxByBoxId(Long boxId); + + /** + * 批量删除箱体类型 + * + * @param boxIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteMesBoxByBoxIds(Long[] boxIds); + + List selectDictTypeAll(); +} diff --git a/op-modules/op-mes/src/main/java/com/op/mes/service/IMesBoxDetailService.java b/op-modules/op-mes/src/main/java/com/op/mes/service/IMesBoxDetailService.java new file mode 100644 index 00000000..b1ec2687 --- /dev/null +++ b/op-modules/op-mes/src/main/java/com/op/mes/service/IMesBoxDetailService.java @@ -0,0 +1,64 @@ +package com.op.mes.service; + +import java.util.List; + +import com.op.mes.domain.MesBoxDetail; +import com.op.system.api.domain.SysDictData; + +/** + * 字典数据Service接口 + * + * @author Open Platform + * @date 2024-08-20 + */ +public interface IMesBoxDetailService { + /** + * 查询字典数据 + * + * @param boxCode 字典数据主键 + * @return 字典数据 + */ + public MesBoxDetail selectMesBoxDetailByBoxCode(Long boxCode); + + /** + * 查询字典数据列表 + * + * @param mesBoxDetail 字典数据 + * @return 字典数据集合 + */ + public List selectMesBoxDetailList(MesBoxDetail mesBoxDetail); + + /** + * 新增字典数据 + * + * @param mesBoxDetail 字典数据 + * @return 结果 + */ + public int insertMesBoxDetail(MesBoxDetail mesBoxDetail); + + /** + * 修改字典数据 + * + * @param mesBoxDetail 字典数据 + * @return 结果 + */ + public int updateMesBoxDetail(MesBoxDetail mesBoxDetail); + + /** + * 批量删除字典数据 + * + * @param boxCodes 需要删除的字典数据主键集合 + * @return 结果 + */ + public int deleteMesBoxDetailByBoxCodes(Long[] boxCodes); + + /** + * 删除字典数据信息 + * + * @param boxCode 字典数据主键 + * @return 结果 + */ + public int deleteMesBoxDetailByBoxCode(Long boxCode); + + List selectBoxDataByType(String boxType); +} diff --git a/op-modules/op-mes/src/main/java/com/op/mes/service/IMesBoxService.java b/op-modules/op-mes/src/main/java/com/op/mes/service/IMesBoxService.java new file mode 100644 index 00000000..7425c2f9 --- /dev/null +++ b/op-modules/op-mes/src/main/java/com/op/mes/service/IMesBoxService.java @@ -0,0 +1,63 @@ +package com.op.mes.service; + +import java.util.List; + +import com.op.mes.domain.MesBox; + +/** + * 箱体类型Service接口 + * + * @author Open Platform + * @date 2024-08-20 + */ +public interface IMesBoxService { + /** + * 查询箱体类型 + * + * @param boxId 箱体类型主键 + * @return 箱体类型 + */ + public MesBox selectMesBoxByBoxId(Long boxId); + + /** + * 查询箱体类型列表 + * + * @param mesBox 箱体类型 + * @return 箱体类型集合 + */ + public List selectMesBoxList(MesBox mesBox); + + /** + * 新增箱体类型 + * + * @param mesBox 箱体类型 + * @return 结果 + */ + public int insertMesBox(MesBox mesBox); + + /** + * 修改箱体类型 + * + * @param mesBox 箱体类型 + * @return 结果 + */ + public int updateMesBox(MesBox mesBox); + + /** + * 批量删除箱体类型 + * + * @param boxIds 需要删除的箱体类型主键集合 + * @return 结果 + */ + public int deleteMesBoxByBoxIds(Long[] boxIds); + + /** + * 删除箱体类型信息 + * + * @param boxId 箱体类型主键 + * @return 结果 + */ + public int deleteMesBoxByBoxId(Long boxId); + + List selectDictTypeAll(); +} diff --git a/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesBoxDetailServiceImpl.java b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesBoxDetailServiceImpl.java new file mode 100644 index 00000000..04675f78 --- /dev/null +++ b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesBoxDetailServiceImpl.java @@ -0,0 +1,106 @@ +package com.op.mes.service.impl; + +import java.util.List; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.op.common.core.utils.DateUtils; +import com.op.common.security.utils.SecurityUtils; +import com.op.system.api.domain.SysDictData; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.op.mes.mapper.MesBoxDetailMapper; +import com.op.mes.domain.MesBoxDetail; +import com.op.mes.service.IMesBoxDetailService; + +/** + * 字典数据Service业务层处理 + * + * @author Open Platform + * @date 2024-08-20 + */ +@Service +public class MesBoxDetailServiceImpl implements IMesBoxDetailService { + @Autowired + private MesBoxDetailMapper mesBoxDetailMapper; + + /** + * 查询字典数据 + * + * @param boxCode 字典数据主键 + * @return 字典数据 + */ + @Override + @DS("#header.poolName") + public MesBoxDetail selectMesBoxDetailByBoxCode(Long boxCode) { + return mesBoxDetailMapper.selectMesBoxDetailByBoxCode(boxCode); + } + + /** + * 查询字典数据列表 + * + * @param mesBoxDetail 字典数据 + * @return 字典数据 + */ + @Override + @DS("#header.poolName") + public List selectMesBoxDetailList(MesBoxDetail mesBoxDetail) { + return mesBoxDetailMapper.selectMesBoxDetailList(mesBoxDetail); + } + + /** + * 新增字典数据 + * + * @param mesBoxDetail 字典数据 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int insertMesBoxDetail(MesBoxDetail mesBoxDetail) { + mesBoxDetail.setCreateBy(SecurityUtils.getUsername()); + mesBoxDetail.setCreateTime(DateUtils.getNowDate()); + return mesBoxDetailMapper.insertMesBoxDetail(mesBoxDetail); + } + + /** + * 修改字典数据 + * + * @param mesBoxDetail 字典数据 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int updateMesBoxDetail(MesBoxDetail mesBoxDetail) { + mesBoxDetail.setUpdateBy(SecurityUtils.getUsername()); + mesBoxDetail.setUpdateTime(DateUtils.getNowDate()); + return mesBoxDetailMapper.updateMesBoxDetail(mesBoxDetail); + } + + /** + * 批量删除字典数据 + * + * @param boxCodes 需要删除的字典数据主键 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int deleteMesBoxDetailByBoxCodes(Long[] boxCodes) { + return mesBoxDetailMapper.deleteMesBoxDetailByBoxCodes(boxCodes); + } + + /** + * 删除字典数据信息 + * + * @param boxCode 字典数据主键 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int deleteMesBoxDetailByBoxCode(Long boxCode) { + return mesBoxDetailMapper.deleteMesBoxDetailByBoxCode(boxCode); + } + + @Override + public List selectBoxDataByType(String boxType) { + return null; + } +} diff --git a/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesBoxServiceImpl.java b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesBoxServiceImpl.java new file mode 100644 index 00000000..3f1a05e2 --- /dev/null +++ b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesBoxServiceImpl.java @@ -0,0 +1,106 @@ +package com.op.mes.service.impl; + +import java.util.List; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.op.common.core.utils.DateUtils; +import com.op.common.security.utils.SecurityUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.op.mes.mapper.MesBoxMapper; +import com.op.mes.domain.MesBox; +import com.op.mes.service.IMesBoxService; + +/** + * 箱体类型Service业务层处理 + * + * @author Open Platform + * @date 2024-08-20 + */ +@Service +public class MesBoxServiceImpl implements IMesBoxService { + @Autowired + private MesBoxMapper mesBoxMapper; + + /** + * 查询箱体类型 + * + * @param boxId 箱体类型主键 + * @return 箱体类型 + */ + @Override + @DS("#header.poolName") + public MesBox selectMesBoxByBoxId(Long boxId) { + return mesBoxMapper.selectMesBoxByBoxId(boxId); + } + + /** + * 查询箱体类型列表 + * + * @param mesBox 箱体类型 + * @return 箱体类型 + */ + @Override + @DS("#header.poolName") + public List selectMesBoxList(MesBox mesBox) { + return mesBoxMapper.selectMesBoxList(mesBox); + } + + /** + * 新增箱体类型 + * + * @param mesBox 箱体类型 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int insertMesBox(MesBox mesBox) { + mesBox.setUpdateBy(SecurityUtils.getUsername()); + mesBox.setCreateTime(DateUtils.getNowDate()); + return mesBoxMapper.insertMesBox(mesBox); + } + + /** + * 修改箱体类型 + * + * @param mesBox 箱体类型 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int updateMesBox(MesBox mesBox) { + mesBox.setUpdateBy(SecurityUtils.getUsername()); + mesBox.setUpdateTime(DateUtils.getNowDate()); + return mesBoxMapper.updateMesBox(mesBox); + } + + /** + * 批量删除箱体类型 + * + * @param boxIds 需要删除的箱体类型主键 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int deleteMesBoxByBoxIds(Long[] boxIds) { + return mesBoxMapper.deleteMesBoxByBoxIds(boxIds); + } + + /** + * 删除箱体类型信息 + * + * @param boxId 箱体类型主键 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int deleteMesBoxByBoxId(Long boxId) { + return mesBoxMapper.deleteMesBoxByBoxId(boxId); + } + + @Override + @DS("#header.poolName") + public List selectDictTypeAll() { + return mesBoxMapper.selectDictTypeAll(); + } +} diff --git a/op-modules/op-mes/src/main/resources/mapper/mes/MesBoxDetailMapper.xml b/op-modules/op-mes/src/main/resources/mapper/mes/MesBoxDetailMapper.xml new file mode 100644 index 00000000..91244db2 --- /dev/null +++ b/op-modules/op-mes/src/main/resources/mapper/mes/MesBoxDetailMapper.xml @@ -0,0 +1,196 @@ + + + + + + + + + + + + + + + + + + + + + + + + select box_code, box_sort, box_label, box_key, box_value, box_type, css_class, list_class, is_default, status, create_by, create_time, update_by, update_time, remark from mes_box_detail + + + + + + + + insert into mes_box_detail + + box_code, + + box_sort, + + box_label, + + box_key, + + box_value, + + box_type, + + css_class, + + list_class, + + is_default, + + status, + + create_by, + + create_time, + + update_by, + + update_time, + + remark, + + + + #{boxCode}, + + #{boxSort}, + + #{boxLabel}, + + #{boxKey}, + + #{boxValue}, + + #{boxType}, + + #{cssClass}, + + #{listClass}, + + #{isDefault}, + + #{status}, + + #{createBy}, + + #{createTime}, + + #{updateBy}, + + #{updateTime}, + + #{remark}, + + + + + + update mes_box_detail + + box_sort = + #{boxSort}, + + box_label = + #{boxLabel}, + + box_key = + #{boxKey}, + + box_value = + #{boxValue}, + + box_type = + #{boxType}, + + css_class = + #{cssClass}, + + list_class = + #{listClass}, + + is_default = + #{isDefault}, + + status = + #{status}, + + create_by = + #{createBy}, + + create_time = + #{createTime}, + + update_by = + #{updateBy}, + + update_time = + #{updateTime}, + + remark = + #{remark}, + + + where box_code = #{boxCode} + + + + delete from mes_box_detail where box_code = #{boxCode} + + + + delete from mes_box_detail where box_code in + + #{boxCode} + + + diff --git a/op-modules/op-mes/src/main/resources/mapper/mes/MesBoxMapper.xml b/op-modules/op-mes/src/main/resources/mapper/mes/MesBoxMapper.xml new file mode 100644 index 00000000..6dc55a12 --- /dev/null +++ b/op-modules/op-mes/src/main/resources/mapper/mes/MesBoxMapper.xml @@ -0,0 +1,133 @@ + + + + + + + + + + + + + + + + + + select box_id, box_name, box_type, status, create_by, create_time, update_by, update_time, remark from mes_box + + + + + + + + insert into mes_box + + box_id, + + box_name, + + box_type, + + status, + + create_by, + + create_time, + + update_by, + + update_time, + + remark, + + + + #{boxId}, + + #{boxName}, + + #{boxType}, + + #{status}, + + #{createBy}, + + #{createTime}, + + #{updateBy}, + + #{updateTime}, + + #{remark}, + + + + + + update mes_box + + box_name = + #{boxName}, + + box_type = + #{boxType}, + + status = + #{status}, + + create_by = + #{createBy}, + + create_time = + #{createTime}, + + update_by = + #{updateBy}, + + update_time = + #{updateTime}, + + remark = + #{remark}, + + + where box_id = #{boxId} + + + + + + delete from mes_box where box_id = #{boxId} + + + + delete from mes_box where box_id in + + #{boxId} + + +