From be0e664a90fea7c02bcb33b0e64d65cc45dcc215 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E6=81=92=E6=9D=B0?= <2658502433@qq.com> Date: Thu, 27 Mar 2025 17:20:32 +0800 Subject: [PATCH] =?UTF-8?q?=E6=88=90=E5=9E=8B=E6=9C=BA=E4=BA=A7=E9=87=8F?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E6=8A=A5=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/MesCxjProductedController.java | 105 ++++++++++++++ .../com/op/mes/domain/MesCxjProducted.java | 136 ++++++++++++++++++ .../op/mes/mapper/MesCxjProductedMapper.java | 61 ++++++++ .../mes/service/IMesCxjProductedService.java | 61 ++++++++ .../impl/MesCxjProductedServiceImpl.java | 103 +++++++++++++ .../mapper/mes/MesCxjProductedMapper.xml | 98 +++++++++++++ 6 files changed, 564 insertions(+) create mode 100644 op-modules/op-mes/src/main/java/com/op/mes/controller/MesCxjProductedController.java create mode 100644 op-modules/op-mes/src/main/java/com/op/mes/domain/MesCxjProducted.java create mode 100644 op-modules/op-mes/src/main/java/com/op/mes/mapper/MesCxjProductedMapper.java create mode 100644 op-modules/op-mes/src/main/java/com/op/mes/service/IMesCxjProductedService.java create mode 100644 op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesCxjProductedServiceImpl.java create mode 100644 op-modules/op-mes/src/main/resources/mapper/mes/MesCxjProductedMapper.xml diff --git a/op-modules/op-mes/src/main/java/com/op/mes/controller/MesCxjProductedController.java b/op-modules/op-mes/src/main/java/com/op/mes/controller/MesCxjProductedController.java new file mode 100644 index 000000000..93dfc672b --- /dev/null +++ b/op-modules/op-mes/src/main/java/com/op/mes/controller/MesCxjProductedController.java @@ -0,0 +1,105 @@ +package com.op.mes.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +import com.op.common.security.annotation.RequiresPermissions; +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.core.web.controller.BaseController; +import com.op.common.core.web.domain.AjaxResult; +import com.op.common.log.enums.BusinessType; +import com.op.mes.domain.MesCxjProducted; +import com.op.mes.service.IMesCxjProductedService; +import com.op.common.core.utils.poi.ExcelUtil; +import com.op.common.core.web.page.TableDataInfo; + +/** + * 成型机产量Controller + * + * @author ruoyi + * @date 2025-03-20 + */ +@RestController +@RequestMapping("/producted") +public class MesCxjProductedController extends BaseController +{ + @Autowired + private IMesCxjProductedService mesCxjProductedService; + + /** + * 查询成型机产量列表 + */ +// @RequiresPermissions("@ss.hasPermi('system:producted:list')") + @GetMapping("/list") + public TableDataInfo list(MesCxjProducted mesCxjProducted) + { + startPage(); + List list = mesCxjProductedService.selectMesCxjProductedList(mesCxjProducted); + return getDataTable(list); + } + + /** + * 导出成型机产量列表 + */ +// @PreAuthorize("@ss.hasPermi('system:producted:export')") + @Log(title = "成型机产量", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, MesCxjProducted mesCxjProducted) + { + List list = mesCxjProductedService.selectMesCxjProductedList(mesCxjProducted); + ExcelUtil util = new ExcelUtil(MesCxjProducted.class); + util.exportExcel(response, list, "成型机产量数据"); + } + + /** + * 获取成型机产量详细信息 + */ +// @PreAuthorize("@ss.hasPermi('system:producted:query')") + @GetMapping(value = "/{workorderCode}") + public AjaxResult getInfo(@PathVariable("workorderCode") String workorderCode) + { + return success(mesCxjProductedService.selectMesCxjProductedByWorkorderCode(workorderCode)); + } + + /** + * 新增成型机产量 + */ +// @PreAuthorize("@ss.hasPermi('system:producted:add')") + @Log(title = "成型机产量", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody MesCxjProducted mesCxjProducted) + { + return toAjax(mesCxjProductedService.insertMesCxjProducted(mesCxjProducted)); + } + + /** + * 修改成型机产量 + */ +// @PreAuthorize("@ss.hasPermi('system:producted:edit')") + @Log(title = "成型机产量", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody MesCxjProducted mesCxjProducted) + { + return toAjax(mesCxjProductedService.updateMesCxjProducted(mesCxjProducted)); + } + + /** + * 删除成型机产量 + */ +// @PreAuthorize("@ss.hasPermi('system:producted:remove')") + @Log(title = "成型机产量", businessType = BusinessType.DELETE) + @DeleteMapping("/{workorderCodes}") + public AjaxResult remove(@PathVariable String[] workorderCodes) + { + return toAjax(mesCxjProductedService.deleteMesCxjProductedByWorkorderCodes(workorderCodes)); + } +} diff --git a/op-modules/op-mes/src/main/java/com/op/mes/domain/MesCxjProducted.java b/op-modules/op-mes/src/main/java/com/op/mes/domain/MesCxjProducted.java new file mode 100644 index 000000000..60746998e --- /dev/null +++ b/op-modules/op-mes/src/main/java/com/op/mes/domain/MesCxjProducted.java @@ -0,0 +1,136 @@ +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; +import org.springframework.format.annotation.DateTimeFormat; + +import java.time.LocalDateTime; + +/** + * 成型机产量对象 mes_cxj_producted + * + * @author chj + * @date 2025-03-20 + */ +public class MesCxjProducted extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** + * 产品编码 + */ + private String productCode; + + /* + 产品名称 + */ + private String productName; + + /** + *班次 + */ + private String ShiftId; + + /** 工单号 */ + @Excel(name = "工单号") + private String workorderCode; + + /** 机台编码 */ + @Excel(name = "机台编码") + private String workorderName; + + /** + * 开始结束日期 + */ + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime beginTime; + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime endTime; + + public LocalDateTime getBeginTime() { + return beginTime; + } + + public void setBeginTime(LocalDateTime beginTime) { + this.beginTime = beginTime; + } + + public LocalDateTime getEndTime() { + return endTime; + } + + public void setEndTime(LocalDateTime endTime) { + this.endTime = endTime; + } + + /** 备用1 */ + @Excel(name = "备用1") + private String attr1; + + /** 备用2 */ + @Excel(name = "备用2") + private String attr2; + + /** 备用2 */ + @Excel(name = "备用2") + private String attr3; + + + public String getProductCode() { + return productCode; + } + + public void setProductCode(String productCode) { + this.productCode = productCode; + } + + public String getProductName() { + return productName; + } + + public void setProductName(String productName) { + this.productName = productName; + } + + public String getShiftId() { + return ShiftId; + } + + public void setShiftId(String shiftId) { + ShiftId = shiftId; + } + + public String getWorkorderCode() { + return workorderCode; + } + + public void setWorkorderCode(String workorderCode) { + this.workorderCode = workorderCode; + } + + public String getWorkorderName() { + return workorderName; + } + + public void setWorkorderName(String workorderName) { + this.workorderName = workorderName; + } + + @Override + public String toString() { + return "MesCxjProducted{" + + "productCode='" + productCode + '\'' + + ", productName='" + productName + '\'' + + ", ShiftId='" + ShiftId + '\'' + + ", workorderCode='" + workorderCode + '\'' + + ", workorderName='" + workorderName + '\'' + + ", beginTime='" + beginTime + '\'' + + ", endTime='" + endTime + '\'' + + ", attr1='" + attr1 + '\'' + + ", attr2='" + attr2 + '\'' + + ", attr3='" + attr3 + '\'' + + '}'; + } +} diff --git a/op-modules/op-mes/src/main/java/com/op/mes/mapper/MesCxjProductedMapper.java b/op-modules/op-mes/src/main/java/com/op/mes/mapper/MesCxjProductedMapper.java new file mode 100644 index 000000000..48a6ed750 --- /dev/null +++ b/op-modules/op-mes/src/main/java/com/op/mes/mapper/MesCxjProductedMapper.java @@ -0,0 +1,61 @@ +package com.op.mes.mapper; + +import java.util.List; +import com.op.mes.domain.MesCxjProducted; + +/** + * 成型机产量Mapper接口 + * + * @author ruoyi + * @date 2025-03-20 + */ +public interface MesCxjProductedMapper +{ + /** + * 查询成型机产量 + * + * @param workorderCode 成型机产量主键 + * @return 成型机产量 + */ + public MesCxjProducted selectMesCxjProductedByWorkorderCode(String workorderCode); + + /** + * 查询成型机产量列表 + * + * @param mesCxjProducted 成型机产量 + * @return 成型机产量集合 + */ + public List selectMesCxjProductedList(MesCxjProducted mesCxjProducted); + + /** + * 新增成型机产量 + * + * @param mesCxjProducted 成型机产量 + * @return 结果 + */ + public int insertMesCxjProducted(MesCxjProducted mesCxjProducted); + + /** + * 修改成型机产量 + * + * @param mesCxjProducted 成型机产量 + * @return 结果 + */ + public int updateMesCxjProducted(MesCxjProducted mesCxjProducted); + + /** + * 删除成型机产量 + * + * @param workorderCode 成型机产量主键 + * @return 结果 + */ + public int deleteMesCxjProductedByWorkorderCode(String workorderCode); + + /** + * 批量删除成型机产量 + * + * @param workorderCodes 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteMesCxjProductedByWorkorderCodes(String[] workorderCodes); +} diff --git a/op-modules/op-mes/src/main/java/com/op/mes/service/IMesCxjProductedService.java b/op-modules/op-mes/src/main/java/com/op/mes/service/IMesCxjProductedService.java new file mode 100644 index 000000000..8667a276a --- /dev/null +++ b/op-modules/op-mes/src/main/java/com/op/mes/service/IMesCxjProductedService.java @@ -0,0 +1,61 @@ +package com.op.mes.service; + +import java.util.List; +import com.op.mes.domain.MesCxjProducted; + +/** + * 成型机产量Service接口 + * + * @author ruoyi + * @date 2025-03-20 + */ +public interface IMesCxjProductedService +{ + /** + * 查询成型机产量 + * + * @param workorderCode 成型机产量主键 + * @return 成型机产量 + */ + public MesCxjProducted selectMesCxjProductedByWorkorderCode(String workorderCode); + + /** + * 查询成型机产量列表 + * + * @param mesCxjProducted 成型机产量 + * @return 成型机产量集合 + */ + public List selectMesCxjProductedList(MesCxjProducted mesCxjProducted); + + /** + * 新增成型机产量 + * + * @param mesCxjProducted 成型机产量 + * @return 结果 + */ + public int insertMesCxjProducted(MesCxjProducted mesCxjProducted); + + /** + * 修改成型机产量 + * + * @param mesCxjProducted 成型机产量 + * @return 结果 + */ + public int updateMesCxjProducted(MesCxjProducted mesCxjProducted); + + /** + * 批量删除成型机产量 + * + * @param workorderCodes 需要删除的成型机产量主键集合 + * @return 结果 + */ + public int deleteMesCxjProductedByWorkorderCodes(String[] workorderCodes); + + /** + * 删除成型机产量信息 + * + * @param workorderCode 成型机产量主键 + * @return 结果 + */ + public int deleteMesCxjProductedByWorkorderCode(String workorderCode); +} diff --git a/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesCxjProductedServiceImpl.java b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesCxjProductedServiceImpl.java new file mode 100644 index 000000000..502591f05 --- /dev/null +++ b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesCxjProductedServiceImpl.java @@ -0,0 +1,103 @@ +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 org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.op.mes.mapper.MesCxjProductedMapper; +import com.op.mes.domain.MesCxjProducted; +import com.op.mes.service.IMesCxjProductedService; + +/** + * 成型机产量Service业务层处理 + * + * @author ruoyi + * @date 2025-03-20 + */ +@Service +public class MesCxjProductedServiceImpl implements IMesCxjProductedService +{ + @Autowired + private MesCxjProductedMapper mesCxjProductedMapper; + + /** + * 查询成型机产量 + * + * @param workorderCode 成型机产量主键 + * @return 成型机产量 + */ + @Override + @DS("#header.poolName") + public MesCxjProducted selectMesCxjProductedByWorkorderCode(String workorderCode) + { + return mesCxjProductedMapper.selectMesCxjProductedByWorkorderCode(workorderCode); + } + + /** + * 查询成型机产量列表 + * + * @param mesCxjProducted 成型机产量 + * @return 成型机产量 + */ + @Override + @DS("#header.poolName") + public List selectMesCxjProductedList(MesCxjProducted mesCxjProducted) + { + return mesCxjProductedMapper.selectMesCxjProductedList(mesCxjProducted); + } + + /** + * 新增成型机产量 + * + * @param mesCxjProducted 成型机产量 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int insertMesCxjProducted(MesCxjProducted mesCxjProducted) + { + mesCxjProducted.setCreateTime(DateUtils.getNowDate()); + return mesCxjProductedMapper.insertMesCxjProducted(mesCxjProducted); + } + + /** + * 修改成型机产量 + * + * @param mesCxjProducted 成型机产量 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int updateMesCxjProducted(MesCxjProducted mesCxjProducted) + { + return mesCxjProductedMapper.updateMesCxjProducted(mesCxjProducted); + } + + /** + * 批量删除成型机产量 + * + * @param workorderCodes 需要删除的成型机产量主键 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int deleteMesCxjProductedByWorkorderCodes(String[] workorderCodes) + { + return mesCxjProductedMapper.deleteMesCxjProductedByWorkorderCodes(workorderCodes); + } + + /** + * 删除成型机产量信息 + * + * @param workorderCode 成型机产量主键 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int deleteMesCxjProductedByWorkorderCode(String workorderCode) + { + return mesCxjProductedMapper.deleteMesCxjProductedByWorkorderCode(workorderCode); + } +} diff --git a/op-modules/op-mes/src/main/resources/mapper/mes/MesCxjProductedMapper.xml b/op-modules/op-mes/src/main/resources/mapper/mes/MesCxjProductedMapper.xml new file mode 100644 index 000000000..a068632e3 --- /dev/null +++ b/op-modules/op-mes/src/main/resources/mapper/mes/MesCxjProductedMapper.xml @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + + + + + SELECT + pro_order_workorder.workorder_code, + pro_order_workorder.product_code, + pro_order_workorder.product_name, + mes_cxj_producted.workorder_name, + mes_cxj_producted.create_time, + pro_order_workorder.shift_id + FROM + mes_cxj_producted LEFT JOIN + pro_order_workorder on mes_cxj_producted.workorder_code = pro_order_workorder.workorder_id + + + + + + + + insert into mes_cxj_producted + + workorder_code, + workorder_name, + create_time, + attr1, + attr2, + attr3, + + + #{workorderCode}, + #{workorderName}, + #{createTime}, + #{attr1}, + #{attr2}, + #{attr3}, + + + + + update mes_cxj_producted + + workorder_name = #{workorderName}, + create_time = #{createTime}, + attr1 = #{attr1}, + attr2 = #{attr2}, + attr3 = #{attr3}, + + where workorder_code = #{workorderCode} + + + + delete from mes_cxj_producted where workorder_code = #{workorderCode} + + + + delete from mes_cxj_producted where workorder_code in + + #{workorderCode} + + + \ No newline at end of file