From 915d86885fa1cd81570ff6e802359639a271b370 Mon Sep 17 00:00:00 2001 From: yinq Date: Wed, 17 Apr 2024 16:33:06 +0800 Subject: [PATCH] =?UTF-8?q?change=20-=20add=E8=A1=A5=E6=89=93=E6=9D=A1?= =?UTF-8?q?=E7=A0=81=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PrintSupplementBarCodeController.java | 99 +++++++++++ .../report/domain/PrintSupplementBarCode.java | 160 ++++++++++++++++++ .../mapper/PrintSupplementBarCodeMapper.java | 61 +++++++ .../IPrintSupplementBarCodeService.java | 61 +++++++ .../PrintSupplementBarCodeServiceImpl.java | 87 ++++++++++ .../report/PrintSupplementBarCodeMapper.xml | 115 +++++++++++++ 6 files changed, 583 insertions(+) create mode 100644 aucma-report/src/main/java/com/aucma/report/controller/PrintSupplementBarCodeController.java create mode 100644 aucma-report/src/main/java/com/aucma/report/domain/PrintSupplementBarCode.java create mode 100644 aucma-report/src/main/java/com/aucma/report/mapper/PrintSupplementBarCodeMapper.java create mode 100644 aucma-report/src/main/java/com/aucma/report/service/IPrintSupplementBarCodeService.java create mode 100644 aucma-report/src/main/java/com/aucma/report/service/impl/PrintSupplementBarCodeServiceImpl.java create mode 100644 aucma-report/src/main/resources/mapper/report/PrintSupplementBarCodeMapper.xml diff --git a/aucma-report/src/main/java/com/aucma/report/controller/PrintSupplementBarCodeController.java b/aucma-report/src/main/java/com/aucma/report/controller/PrintSupplementBarCodeController.java new file mode 100644 index 0000000..94b9b31 --- /dev/null +++ b/aucma-report/src/main/java/com/aucma/report/controller/PrintSupplementBarCodeController.java @@ -0,0 +1,99 @@ +package com.aucma.report.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +import com.aucma.common.utils.DateUtils; +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.aucma.common.annotation.Log; +import com.aucma.common.core.controller.BaseController; +import com.aucma.common.core.domain.AjaxResult; +import com.aucma.common.enums.BusinessType; +import com.aucma.report.domain.PrintSupplementBarCode; +import com.aucma.report.service.IPrintSupplementBarCodeService; +import com.aucma.common.utils.poi.ExcelUtil; +import com.aucma.common.core.page.TableDataInfo; + +/** + * 补打条码记录Controller + * + * @author Yinq + * @date 2024-04-17 + */ +@RestController +@RequestMapping("/report/supplementBarCode") +public class PrintSupplementBarCodeController extends BaseController { + @Autowired + private IPrintSupplementBarCodeService printSupplementBarCodeService; + + /** + * 查询补打条码记录列表 + */ + @PreAuthorize("@ss.hasPermi('report:supplementBarCode:list')") + @GetMapping("/list") + public TableDataInfo list(PrintSupplementBarCode printSupplementBarCode) { + startPage(); + List list = printSupplementBarCodeService.selectPrintSupplementBarCodeList(printSupplementBarCode); + return getDataTable(list); + } + + /** + * 导出补打条码记录列表 + */ + @PreAuthorize("@ss.hasPermi('report:supplementBarCode:export')") + @Log(title = "补打条码记录", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, PrintSupplementBarCode printSupplementBarCode) { + List list = printSupplementBarCodeService.selectPrintSupplementBarCodeList(printSupplementBarCode); + ExcelUtil util = new ExcelUtil(PrintSupplementBarCode.class); + util.exportExcel(response, list, "补打条码记录数据"); + } + + /** + * 获取补打条码记录详细信息 + */ + @PreAuthorize("@ss.hasPermi('report:supplementBarCode:query')") + @GetMapping(value = "/{objId}") + public AjaxResult getInfo(@PathVariable("objId") Long objId) { + return success(printSupplementBarCodeService.selectPrintSupplementBarCodeByObjId(objId)); + } + + /** + * 新增补打条码记录 + */ + @PreAuthorize("@ss.hasPermi('report:supplementBarCode:add')") + @Log(title = "补打条码记录", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PrintSupplementBarCode printSupplementBarCode) { + return toAjax(printSupplementBarCodeService.insertPrintSupplementBarCode(printSupplementBarCode)); + } + + /** + * 修改补打条码记录 + */ + @PreAuthorize("@ss.hasPermi('report:supplementBarCode:edit')") + @Log(title = "补打条码记录", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PrintSupplementBarCode printSupplementBarCode) { + return toAjax(printSupplementBarCodeService.updatePrintSupplementBarCode(printSupplementBarCode)); + } + + /** + * 删除补打条码记录 + */ + @PreAuthorize("@ss.hasPermi('report:supplementBarCode:remove')") + @Log(title = "补打条码记录", businessType = BusinessType.DELETE) + @DeleteMapping("/{objIds}") + public AjaxResult remove(@PathVariable Long[] objIds) { + return toAjax(printSupplementBarCodeService.deletePrintSupplementBarCodeByObjIds(objIds)); + } +} diff --git a/aucma-report/src/main/java/com/aucma/report/domain/PrintSupplementBarCode.java b/aucma-report/src/main/java/com/aucma/report/domain/PrintSupplementBarCode.java new file mode 100644 index 0000000..324e2f6 --- /dev/null +++ b/aucma-report/src/main/java/com/aucma/report/domain/PrintSupplementBarCode.java @@ -0,0 +1,160 @@ +package com.aucma.report.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.aucma.common.annotation.Excel; +import com.aucma.common.core.domain.BaseEntity; + +/** + * 补打条码记录对象 print_supplementbarcode + * + * @author Yinq + * @date 2024-04-17 + */ +public class PrintSupplementBarCode extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private Long objId; + + /** + * SAP计划编号 + */ + @Excel(name = "SAP计划编号") + private String orderCode; + + /** + * 物料编码 + */ + @Excel(name = "物料编码") + private String materialCode; + + /** + * 物料名称 + */ + @Excel(name = "物料名称") + private String materialName; + + /** + * 打印条码 + */ + @Excel(name = "打印条码") + private String materialBarcode; + + /** + * 打印时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "打印时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date printTime; + + /** + * 打印类型 + */ + @Excel(name = "打印类型") + private String printBartype; + + /** + * 打印名称 + */ + @Excel(name = "打印名称") + private String printName; + + /** + * 是否打印 1=已打印,0=未打印 + */ + @Excel(name = "是否打印 1=已打印,0=未打印") + private String isPrint; + + public void setObjId(Long objId) { + this.objId = objId; + } + + public Long getObjId() { + return objId; + } + + public void setOrderCode(String orderCode) { + this.orderCode = orderCode; + } + + public String getOrderCode() { + return orderCode; + } + + public void setMaterialCode(String materialCode) { + this.materialCode = materialCode; + } + + public String getMaterialCode() { + return materialCode; + } + + public void setMaterialName(String materialName) { + this.materialName = materialName; + } + + public String getMaterialName() { + return materialName; + } + + public void setMaterialBarcode(String materialBarcode) { + this.materialBarcode = materialBarcode; + } + + public String getMaterialBarcode() { + return materialBarcode; + } + + public void setPrintTime(Date printTime) { + this.printTime = printTime; + } + + public Date getPrintTime() { + return printTime; + } + + public void setPrintBartype(String printBartype) { + this.printBartype = printBartype; + } + + public String getPrintBartype() { + return printBartype; + } + + public void setPrintName(String printName) { + this.printName = printName; + } + + public String getPrintName() { + return printName; + } + + public void setIsPrint(String isPrint) { + this.isPrint = isPrint; + } + + public String getIsPrint() { + return isPrint; + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("objId", getObjId()) + .append("orderCode", getOrderCode()) + .append("materialCode", getMaterialCode()) + .append("materialName", getMaterialName()) + .append("materialBarcode", getMaterialBarcode()) + .append("printTime", getPrintTime()) + .append("printBartype", getPrintBartype()) + .append("printName", getPrintName()) + .append("isPrint", getIsPrint()) + .toString(); + } +} diff --git a/aucma-report/src/main/java/com/aucma/report/mapper/PrintSupplementBarCodeMapper.java b/aucma-report/src/main/java/com/aucma/report/mapper/PrintSupplementBarCodeMapper.java new file mode 100644 index 0000000..2968196 --- /dev/null +++ b/aucma-report/src/main/java/com/aucma/report/mapper/PrintSupplementBarCodeMapper.java @@ -0,0 +1,61 @@ +package com.aucma.report.mapper; + +import java.util.List; + +import com.aucma.report.domain.PrintSupplementBarCode; + +/** + * 补打条码记录Mapper接口 + * + * @author Yinq + * @date 2024-04-17 + */ +public interface PrintSupplementBarCodeMapper { + /** + * 查询补打条码记录 + * + * @param objId 补打条码记录主键 + * @return 补打条码记录 + */ + public PrintSupplementBarCode selectPrintSupplementBarCodeByObjId(Long objId); + + /** + * 查询补打条码记录列表 + * + * @param printSupplementBarCode 补打条码记录 + * @return 补打条码记录集合 + */ + public List selectPrintSupplementBarCodeList(PrintSupplementBarCode printSupplementBarCode); + + /** + * 新增补打条码记录 + * + * @param printSupplementBarCode 补打条码记录 + * @return 结果 + */ + public int insertPrintSupplementBarCode(PrintSupplementBarCode printSupplementBarCode); + + /** + * 修改补打条码记录 + * + * @param printSupplementBarCode 补打条码记录 + * @return 结果 + */ + public int updatePrintSupplementBarCode(PrintSupplementBarCode printSupplementBarCode); + + /** + * 删除补打条码记录 + * + * @param objId 补打条码记录主键 + * @return 结果 + */ + public int deletePrintSupplementBarCodeByObjId(Long objId); + + /** + * 批量删除补打条码记录 + * + * @param objIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deletePrintSupplementBarCodeByObjIds(Long[] objIds); +} diff --git a/aucma-report/src/main/java/com/aucma/report/service/IPrintSupplementBarCodeService.java b/aucma-report/src/main/java/com/aucma/report/service/IPrintSupplementBarCodeService.java new file mode 100644 index 0000000..7029f00 --- /dev/null +++ b/aucma-report/src/main/java/com/aucma/report/service/IPrintSupplementBarCodeService.java @@ -0,0 +1,61 @@ +package com.aucma.report.service; + +import java.util.List; + +import com.aucma.report.domain.PrintSupplementBarCode; + +/** + * 补打条码记录Service接口 + * + * @author Yinq + * @date 2024-04-17 + */ +public interface IPrintSupplementBarCodeService { + /** + * 查询补打条码记录 + * + * @param objId 补打条码记录主键 + * @return 补打条码记录 + */ + public PrintSupplementBarCode selectPrintSupplementBarCodeByObjId(Long objId); + + /** + * 查询补打条码记录列表 + * + * @param printSupplementBarCode 补打条码记录 + * @return 补打条码记录集合 + */ + public List selectPrintSupplementBarCodeList(PrintSupplementBarCode printSupplementBarCode); + + /** + * 新增补打条码记录 + * + * @param printSupplementBarCode 补打条码记录 + * @return 结果 + */ + public int insertPrintSupplementBarCode(PrintSupplementBarCode printSupplementBarCode); + + /** + * 修改补打条码记录 + * + * @param printSupplementBarCode 补打条码记录 + * @return 结果 + */ + public int updatePrintSupplementBarCode(PrintSupplementBarCode printSupplementBarCode); + + /** + * 批量删除补打条码记录 + * + * @param objIds 需要删除的补打条码记录主键集合 + * @return 结果 + */ + public int deletePrintSupplementBarCodeByObjIds(Long[] objIds); + + /** + * 删除补打条码记录信息 + * + * @param objId 补打条码记录主键 + * @return 结果 + */ + public int deletePrintSupplementBarCodeByObjId(Long objId); +} diff --git a/aucma-report/src/main/java/com/aucma/report/service/impl/PrintSupplementBarCodeServiceImpl.java b/aucma-report/src/main/java/com/aucma/report/service/impl/PrintSupplementBarCodeServiceImpl.java new file mode 100644 index 0000000..2c22494 --- /dev/null +++ b/aucma-report/src/main/java/com/aucma/report/service/impl/PrintSupplementBarCodeServiceImpl.java @@ -0,0 +1,87 @@ +package com.aucma.report.service.impl; + +import java.util.List; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.aucma.report.mapper.PrintSupplementBarCodeMapper; +import com.aucma.report.domain.PrintSupplementBarCode; +import com.aucma.report.service.IPrintSupplementBarCodeService; + +/** + * 补打条码记录Service业务层处理 + * + * @author Yinq + * @date 2024-04-17 + */ +@Service +public class PrintSupplementBarCodeServiceImpl implements IPrintSupplementBarCodeService { + @Autowired + private PrintSupplementBarCodeMapper printSupplementBarCodeMapper; + + /** + * 查询补打条码记录 + * + * @param objId 补打条码记录主键 + * @return 补打条码记录 + */ + @Override + public PrintSupplementBarCode selectPrintSupplementBarCodeByObjId(Long objId) { + return printSupplementBarCodeMapper.selectPrintSupplementBarCodeByObjId(objId); + } + + /** + * 查询补打条码记录列表 + * + * @param printSupplementBarCode 补打条码记录 + * @return 补打条码记录 + */ + @Override + public List selectPrintSupplementBarCodeList(PrintSupplementBarCode printSupplementBarCode) { + return printSupplementBarCodeMapper.selectPrintSupplementBarCodeList(printSupplementBarCode); + } + + /** + * 新增补打条码记录 + * + * @param printSupplementBarCode 补打条码记录 + * @return 结果 + */ + @Override + public int insertPrintSupplementBarCode(PrintSupplementBarCode printSupplementBarCode) { + return printSupplementBarCodeMapper.insertPrintSupplementBarCode(printSupplementBarCode); + } + + /** + * 修改补打条码记录 + * + * @param printSupplementBarCode 补打条码记录 + * @return 结果 + */ + @Override + public int updatePrintSupplementBarCode(PrintSupplementBarCode printSupplementBarCode) { + return printSupplementBarCodeMapper.updatePrintSupplementBarCode(printSupplementBarCode); + } + + /** + * 批量删除补打条码记录 + * + * @param objIds 需要删除的补打条码记录主键 + * @return 结果 + */ + @Override + public int deletePrintSupplementBarCodeByObjIds(Long[] objIds) { + return printSupplementBarCodeMapper.deletePrintSupplementBarCodeByObjIds(objIds); + } + + /** + * 删除补打条码记录信息 + * + * @param objId 补打条码记录主键 + * @return 结果 + */ + @Override + public int deletePrintSupplementBarCodeByObjId(Long objId) { + return printSupplementBarCodeMapper.deletePrintSupplementBarCodeByObjId(objId); + } +} diff --git a/aucma-report/src/main/resources/mapper/report/PrintSupplementBarCodeMapper.xml b/aucma-report/src/main/resources/mapper/report/PrintSupplementBarCodeMapper.xml new file mode 100644 index 0000000..aa4a9ad --- /dev/null +++ b/aucma-report/src/main/resources/mapper/report/PrintSupplementBarCodeMapper.xml @@ -0,0 +1,115 @@ + + + + + + + + + + + + + + + + + + SELECT PS.ORDER_CODE, + PS.MATERIAL_CODE, + BM.MATERIAL_NAME, + PS.MATERIAL_BARCODE, + PS.PRINT_TIME, + CASE WHEN PS.PRINT_BARTYPE = '1' THEN '箱体' ELSE '内胆' END PRINT_BARTYPE, + PS.PRINT_NAME, + CASE WHEN PS.IS_PRINT = '1' THEN '已打印' ELSE '未打印' END IS_PRINT + FROM C##AUCMA_SCADA.PRINT_SUPPLEMENTBARCODE PS + LEFT JOIN C##AUCMA_MES.BASE_MATERIALINFO BM ON BM.MATERIAL_CODE = PS.MATERIAL_CODE + + + + + + + + + SELECT seq_print_supplementbarcode.NEXTVAL as objId FROM DUAL + + insert into print_supplementbarcode + + obj_id, + order_code, + material_code, + material_name, + material_barcode, + print_time, + print_bartype, + print_name, + is_print, + + + #{objId}, + #{orderCode}, + #{materialCode}, + #{materialName}, + #{materialBarcode}, + #{printTime}, + #{printBartype}, + #{printName}, + #{isPrint}, + + + + + update print_supplementbarcode + + order_code = #{orderCode}, + material_code = #{materialCode}, + material_name = #{materialName}, + material_barcode = #{materialBarcode}, + print_time = #{printTime}, + print_bartype = #{printBartype}, + print_name = #{printName}, + is_print = #{isPrint}, + + where obj_id = #{objId} + + + + delete + from print_supplementbarcode + where obj_id = #{objId} + + + + delete from print_supplementbarcode where obj_id in + + #{objId} + + + \ No newline at end of file