diff --git a/aucma-report/src/main/java/com/aucma/report/controller/RecordExceptionController.java b/aucma-report/src/main/java/com/aucma/report/controller/RecordExceptionController.java new file mode 100644 index 0000000..edb9d6c --- /dev/null +++ b/aucma-report/src/main/java/com/aucma/report/controller/RecordExceptionController.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.RecordException; +import com.aucma.report.service.IRecordExceptionService; +import com.aucma.common.utils.poi.ExcelUtil; +import com.aucma.common.core.page.TableDataInfo; + +/** + * 成品下线异常记录Controller + * + * @author Yinq + * @date 2024-04-01 + */ +@RestController +@RequestMapping("/report/recordException") +public class RecordExceptionController extends BaseController { + @Autowired + private IRecordExceptionService recordExceptionService; + + /** + * 查询成品下线异常记录列表 + */ + @PreAuthorize("@ss.hasPermi('report:recordException:list')") + @GetMapping("/list") + public TableDataInfo list(RecordException recordException) { + startPage(); + List list = recordExceptionService.selectRecordExceptionList(recordException); + return getDataTable(list); + } + + /** + * 导出成品下线异常记录列表 + */ + @PreAuthorize("@ss.hasPermi('report:recordException:export')") + @Log(title = "成品下线异常记录", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, RecordException recordException) { + List list = recordExceptionService.selectRecordExceptionList(recordException); + ExcelUtil util = new ExcelUtil(RecordException.class); + util.exportExcel(response, list, "成品下线异常记录数据"); + } + + /** + * 获取成品下线异常记录详细信息 + */ + @PreAuthorize("@ss.hasPermi('report:recordException:query')") + @GetMapping(value = "/{objId}") + public AjaxResult getInfo(@PathVariable("objId") Long objId) { + return success(recordExceptionService.selectRecordExceptionByObjId(objId)); + } + + /** + * 新增成品下线异常记录 + */ + @PreAuthorize("@ss.hasPermi('report:recordException:add')") + @Log(title = "成品下线异常记录", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody RecordException recordException) { + return toAjax(recordExceptionService.insertRecordException(recordException)); + } + + /** + * 修改成品下线异常记录 + */ + @PreAuthorize("@ss.hasPermi('report:recordException:edit')") + @Log(title = "成品下线异常记录", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody RecordException recordException) { + return toAjax(recordExceptionService.updateRecordException(recordException)); + } + + /** + * 删除成品下线异常记录 + */ + @PreAuthorize("@ss.hasPermi('report:recordException:remove')") + @Log(title = "成品下线异常记录", businessType = BusinessType.DELETE) + @DeleteMapping("/{objIds}") + public AjaxResult remove(@PathVariable Long[] objIds) { + return toAjax(recordExceptionService.deleteRecordExceptionByObjIds(objIds)); + } +} diff --git a/aucma-report/src/main/java/com/aucma/report/domain/RecordException.java b/aucma-report/src/main/java/com/aucma/report/domain/RecordException.java new file mode 100644 index 0000000..5838354 --- /dev/null +++ b/aucma-report/src/main/java/com/aucma/report/domain/RecordException.java @@ -0,0 +1,130 @@ +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; + +/** + * 成品下线异常记录对象 record_exception + * + * @author Yinq + * @date 2024-04-01 + */ +public class RecordException extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 主键标识 + */ + private Long objId; + + /** + * 产品条码 + */ + @Excel(name = "产品条码") + private String productSncode; + + /** + * 异常信息 + */ + @Excel(name = "异常信息") + private String exceptionMsg; + + /** + * 扫描时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "扫描时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date productScantime; + + /** + * 产线编号 + */ + @Excel(name = "产线编号") + private String productLineCode; + + /** + * 异常类型(1=69码校验;2=重复扫描;3=未绑条码;4=未终检) + */ + @Excel(name = "异常类型", readConverterExp = "1==69码校验;2=重复扫描;3=未绑条码;4=未终检") + private Long exceptionType; + + /** + * MES条码 + */ + @Excel(name = "MES条码") + private String boxCode; + + public void setObjId(Long objId) { + this.objId = objId; + } + + public Long getObjId() { + return objId; + } + + public void setProductSncode(String productSncode) { + this.productSncode = productSncode; + } + + public String getProductSncode() { + return productSncode; + } + + public void setExceptionMsg(String exceptionMsg) { + this.exceptionMsg = exceptionMsg; + } + + public String getExceptionMsg() { + return exceptionMsg; + } + + public void setProductScantime(Date productScantime) { + this.productScantime = productScantime; + } + + public Date getProductScantime() { + return productScantime; + } + + public void setProductLineCode(String productLineCode) { + this.productLineCode = productLineCode; + } + + public String getProductLineCode() { + return productLineCode; + } + + public void setExceptionType(Long exceptionType) { + this.exceptionType = exceptionType; + } + + public Long getExceptionType() { + return exceptionType; + } + + public void setBoxCode(String boxCode) { + this.boxCode = boxCode; + } + + public String getBoxCode() { + return boxCode; + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("objId", getObjId()) + .append("productSncode", getProductSncode()) + .append("exceptionMsg", getExceptionMsg()) + .append("productScantime", getProductScantime()) + .append("productLineCode", getProductLineCode()) + .append("exceptionType", getExceptionType()) + .append("boxCode", getBoxCode()) + .toString(); + } +} diff --git a/aucma-report/src/main/java/com/aucma/report/mapper/RecordExceptionMapper.java b/aucma-report/src/main/java/com/aucma/report/mapper/RecordExceptionMapper.java new file mode 100644 index 0000000..99e9809 --- /dev/null +++ b/aucma-report/src/main/java/com/aucma/report/mapper/RecordExceptionMapper.java @@ -0,0 +1,61 @@ +package com.aucma.report.mapper; + +import java.util.List; +import com.aucma.report.domain.RecordException; + +/** + * 成品下线异常记录Mapper接口 + * + * @author Yinq + * @date 2024-04-01 + */ +public interface RecordExceptionMapper +{ + /** + * 查询成品下线异常记录 + * + * @param objId 成品下线异常记录主键 + * @return 成品下线异常记录 + */ + public RecordException selectRecordExceptionByObjId(Long objId); + + /** + * 查询成品下线异常记录列表 + * + * @param recordException 成品下线异常记录 + * @return 成品下线异常记录集合 + */ + public List selectRecordExceptionList(RecordException recordException); + + /** + * 新增成品下线异常记录 + * + * @param recordException 成品下线异常记录 + * @return 结果 + */ + public int insertRecordException(RecordException recordException); + + /** + * 修改成品下线异常记录 + * + * @param recordException 成品下线异常记录 + * @return 结果 + */ + public int updateRecordException(RecordException recordException); + + /** + * 删除成品下线异常记录 + * + * @param objId 成品下线异常记录主键 + * @return 结果 + */ + public int deleteRecordExceptionByObjId(Long objId); + + /** + * 批量删除成品下线异常记录 + * + * @param objIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteRecordExceptionByObjIds(Long[] objIds); +} diff --git a/aucma-report/src/main/java/com/aucma/report/service/IRecordExceptionService.java b/aucma-report/src/main/java/com/aucma/report/service/IRecordExceptionService.java new file mode 100644 index 0000000..95177e1 --- /dev/null +++ b/aucma-report/src/main/java/com/aucma/report/service/IRecordExceptionService.java @@ -0,0 +1,61 @@ +package com.aucma.report.service; + +import java.util.List; +import com.aucma.report.domain.RecordException; + +/** + * 成品下线异常记录Service接口 + * + * @author Yinq + * @date 2024-04-01 + */ +public interface IRecordExceptionService +{ + /** + * 查询成品下线异常记录 + * + * @param objId 成品下线异常记录主键 + * @return 成品下线异常记录 + */ + public RecordException selectRecordExceptionByObjId(Long objId); + + /** + * 查询成品下线异常记录列表 + * + * @param recordException 成品下线异常记录 + * @return 成品下线异常记录集合 + */ + public List selectRecordExceptionList(RecordException recordException); + + /** + * 新增成品下线异常记录 + * + * @param recordException 成品下线异常记录 + * @return 结果 + */ + public int insertRecordException(RecordException recordException); + + /** + * 修改成品下线异常记录 + * + * @param recordException 成品下线异常记录 + * @return 结果 + */ + public int updateRecordException(RecordException recordException); + + /** + * 批量删除成品下线异常记录 + * + * @param objIds 需要删除的成品下线异常记录主键集合 + * @return 结果 + */ + public int deleteRecordExceptionByObjIds(Long[] objIds); + + /** + * 删除成品下线异常记录信息 + * + * @param objId 成品下线异常记录主键 + * @return 结果 + */ + public int deleteRecordExceptionByObjId(Long objId); +} diff --git a/aucma-report/src/main/java/com/aucma/report/service/impl/RecordExceptionServiceImpl.java b/aucma-report/src/main/java/com/aucma/report/service/impl/RecordExceptionServiceImpl.java new file mode 100644 index 0000000..0e3c3b2 --- /dev/null +++ b/aucma-report/src/main/java/com/aucma/report/service/impl/RecordExceptionServiceImpl.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.RecordExceptionMapper; +import com.aucma.report.domain.RecordException; +import com.aucma.report.service.IRecordExceptionService; + +/** + * 成品下线异常记录Service业务层处理 + * + * @author Yinq + * @date 2024-04-01 + */ +@Service +public class RecordExceptionServiceImpl implements IRecordExceptionService { + @Autowired + private RecordExceptionMapper recordExceptionMapper; + + /** + * 查询成品下线异常记录 + * + * @param objId 成品下线异常记录主键 + * @return 成品下线异常记录 + */ + @Override + public RecordException selectRecordExceptionByObjId(Long objId) { + return recordExceptionMapper.selectRecordExceptionByObjId(objId); + } + + /** + * 查询成品下线异常记录列表 + * + * @param recordException 成品下线异常记录 + * @return 成品下线异常记录 + */ + @Override + public List selectRecordExceptionList(RecordException recordException) { + return recordExceptionMapper.selectRecordExceptionList(recordException); + } + + /** + * 新增成品下线异常记录 + * + * @param recordException 成品下线异常记录 + * @return 结果 + */ + @Override + public int insertRecordException(RecordException recordException) { + return recordExceptionMapper.insertRecordException(recordException); + } + + /** + * 修改成品下线异常记录 + * + * @param recordException 成品下线异常记录 + * @return 结果 + */ + @Override + public int updateRecordException(RecordException recordException) { + return recordExceptionMapper.updateRecordException(recordException); + } + + /** + * 批量删除成品下线异常记录 + * + * @param objIds 需要删除的成品下线异常记录主键 + * @return 结果 + */ + @Override + public int deleteRecordExceptionByObjIds(Long[] objIds) { + return recordExceptionMapper.deleteRecordExceptionByObjIds(objIds); + } + + /** + * 删除成品下线异常记录信息 + * + * @param objId 成品下线异常记录主键 + * @return 结果 + */ + @Override + public int deleteRecordExceptionByObjId(Long objId) { + return recordExceptionMapper.deleteRecordExceptionByObjId(objId); + } +} diff --git a/aucma-report/src/main/resources/mapper/report/RecordExceptionMapper.xml b/aucma-report/src/main/resources/mapper/report/RecordExceptionMapper.xml new file mode 100644 index 0000000..296cc34 --- /dev/null +++ b/aucma-report/src/main/resources/mapper/report/RecordExceptionMapper.xml @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + + select re.obj_id, + re.product_sncode, + re.exception_msg, + re.product_scantime, + re.product_line_code, + re.exception_type, + cb.box_code + from C##AUCMA_SCADA.record_exception re + left join C##AUCMA_SCADA.CODE_BINDING cb on cb.PRODUCT_CODE = re.product_sncode + + + + + + + + + SELECT seq_record_exception.NEXTVAL as objId FROM DUAL + + insert into record_exception + + obj_id, + product_sncode, + exception_msg, + product_scantime, + product_line_code, + exception_type, + box_code, + + + #{objId}, + #{productSncode}, + #{exceptionMsg}, + #{productScantime}, + #{productLineCode}, + #{exceptionType}, + #{boxCode}, + + + + + update record_exception + + product_sncode = #{productSncode}, + exception_msg = #{exceptionMsg}, + product_scantime = #{productScantime}, + product_line_code = #{productLineCode}, + exception_type = #{exceptionType}, + box_code = #{boxCode}, + + where obj_id = #{objId} + + + + delete + from record_exception + where obj_id = #{objId} + + + + delete from record_exception where obj_id in + + #{objId} + + + \ No newline at end of file diff --git a/aucma-report/src/main/resources/mapper/report/RecordQualityMaterialMapper.xml b/aucma-report/src/main/resources/mapper/report/RecordQualityMaterialMapper.xml index 21c4d75..862b9a2 100644 --- a/aucma-report/src/main/resources/mapper/report/RecordQualityMaterialMapper.xml +++ b/aucma-report/src/main/resources/mapper/report/RecordQualityMaterialMapper.xml @@ -91,6 +91,7 @@ and updated_by = #{updatedBy} and updated_time = #{updatedTime} + order by rqm.created_time desc