diff --git a/aucma-report/src/main/java/com/aucma/report/controller/MaterialCompletionController.java b/aucma-report/src/main/java/com/aucma/report/controller/MaterialCompletionController.java new file mode 100644 index 0000000..616e930 --- /dev/null +++ b/aucma-report/src/main/java/com/aucma/report/controller/MaterialCompletionController.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.MaterialCompletion; +import com.aucma.report.service.IMaterialCompletionService; +import com.aucma.common.utils.poi.ExcelUtil; +import com.aucma.common.core.page.TableDataInfo; + +/** + * 物料过点记录Controller + * + * @author Yinq + * @date 2024-03-14 + */ +@RestController +@RequestMapping("/report/materialCompletion") +public class MaterialCompletionController extends BaseController { + @Autowired + private IMaterialCompletionService materialCompletionService; + + /** + * 查询物料过点记录列表 + */ + @PreAuthorize("@ss.hasPermi('report:materialCompletion:list')") + @GetMapping("/list") + public TableDataInfo list(MaterialCompletion materialCompletion) { + startPage(); + List list = materialCompletionService.selectMaterialCompletionList(materialCompletion); + return getDataTable(list); + } + + /** + * 导出物料过点记录列表 + */ + @PreAuthorize("@ss.hasPermi('report:materialCompletion:export')") + @Log(title = "物料过点记录", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, MaterialCompletion materialCompletion) { + List list = materialCompletionService.selectMaterialCompletionList(materialCompletion); + ExcelUtil util = new ExcelUtil(MaterialCompletion.class); + util.exportExcel(response, list, "物料过点记录数据"); + } + + /** + * 获取物料过点记录详细信息 + */ + @PreAuthorize("@ss.hasPermi('report:materialCompletion:query')") + @GetMapping(value = "/{objId}") + public AjaxResult getInfo(@PathVariable("objId") Long objId) { + return success(materialCompletionService.selectMaterialCompletionByObjId(objId)); + } + + /** + * 新增物料过点记录 + */ + @PreAuthorize("@ss.hasPermi('report:materialCompletion:add')") + @Log(title = "物料过点记录", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody MaterialCompletion materialCompletion) { + return toAjax(materialCompletionService.insertMaterialCompletion(materialCompletion)); + } + + /** + * 修改物料过点记录 + */ + @PreAuthorize("@ss.hasPermi('report:materialCompletion:edit')") + @Log(title = "物料过点记录", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody MaterialCompletion materialCompletion) { + return toAjax(materialCompletionService.updateMaterialCompletion(materialCompletion)); + } + + /** + * 删除物料过点记录 + */ + @PreAuthorize("@ss.hasPermi('report:materialCompletion:remove')") + @Log(title = "物料过点记录", businessType = BusinessType.DELETE) + @DeleteMapping("/{objIds}") + public AjaxResult remove(@PathVariable Long[] objIds) { + return toAjax(materialCompletionService.deleteMaterialCompletionByObjIds(objIds)); + } +} diff --git a/aucma-report/src/main/java/com/aucma/report/domain/MaterialCompletion.java b/aucma-report/src/main/java/com/aucma/report/domain/MaterialCompletion.java new file mode 100644 index 0000000..fd175f6 --- /dev/null +++ b/aucma-report/src/main/java/com/aucma/report/domain/MaterialCompletion.java @@ -0,0 +1,190 @@ +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; + +/** + * 物料过点记录对象 material_completion + * + * @author Yinq + * @date 2024-03-14 + */ +public class MaterialCompletion extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private Long objId; + + /** + * SAP订单计划编号 + */ + @Excel(name = "SAP订单计划编号") + private String orderCode; + + /** + * 物料条码(箱体码) + */ + @Excel(name = "物料条码", readConverterExp = "箱=体码") + private String materialBarcode; + + /** + * 物料编码 + */ + @Excel(name = "物料编码") + private String materialCode; + + /** + * 物料名称 + */ + @Excel(name = "物料名称") + private String materialName; + + /** + * 过点工位编号 + */ + @Excel(name = "过点工位编号") + private String stationName; + + /** + * 完成时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "完成时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date completeDate; + + /** + * MES工单编号 + */ + @Excel(name = "MES工单编号") + private String planCode; + + /** + * 产线编号 + */ + @Excel(name = "产线编号") + private String productLineCode; + + /** + * 是否成品下线(0-否;1-是) + */ + @Excel(name = "是否成品下线(0-否;1-是)") + private Long isDownLine; + + /** + * 成品SN码 + */ + @Excel(name = "成品SN码") + private String productionCode; + + 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 setMaterialBarcode(String materialBarcode) { + this.materialBarcode = materialBarcode; + } + + public String getMaterialBarcode() { + return materialBarcode; + } + + 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 setStationName(String stationName) { + this.stationName = stationName; + } + + public String getStationName() { + return stationName; + } + + public void setCompleteDate(Date completeDate) { + this.completeDate = completeDate; + } + + public Date getCompleteDate() { + return completeDate; + } + + public void setPlanCode(String planCode) { + this.planCode = planCode; + } + + public String getPlanCode() { + return planCode; + } + + public void setProductLineCode(String productLineCode) { + this.productLineCode = productLineCode; + } + + public String getProductLineCode() { + return productLineCode; + } + + public void setIsDownLine(Long isDownLine) { + this.isDownLine = isDownLine; + } + + public Long getIsDownLine() { + return isDownLine; + } + + public void setProductionCode(String productionCode) { + this.productionCode = productionCode; + } + + public String getProductionCode() { + return productionCode; + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("objId", getObjId()) + .append("orderCode", getOrderCode()) + .append("materialBarcode", getMaterialBarcode()) + .append("materialCode", getMaterialCode()) + .append("materialName", getMaterialName()) + .append("stationName", getStationName()) + .append("completeDate", getCompleteDate()) + .append("planCode", getPlanCode()) + .append("productLineCode", getProductLineCode()) + .append("isDownLine", getIsDownLine()) + .append("productionCode", getProductionCode()) + .toString(); + } +} diff --git a/aucma-report/src/main/java/com/aucma/report/domain/ReportQualityInspection.java b/aucma-report/src/main/java/com/aucma/report/domain/ReportQualityInspection.java index 36973ab..7da2dbc 100644 --- a/aucma-report/src/main/java/com/aucma/report/domain/ReportQualityInspection.java +++ b/aucma-report/src/main/java/com/aucma/report/domain/ReportQualityInspection.java @@ -127,9 +127,9 @@ public class ReportQualityInspection extends BaseEntity { private Date finishTime; /** - * 是否标识 + * 返修结果(1=正常,2=异常) */ - @Excel(name = "是否标识") + @Excel(name = "返修结果") private Long isFlag; /** @@ -141,6 +141,16 @@ public class ReportQualityInspection extends BaseEntity { private String stationCode; private int submitQualtyId; private String productLineName;//pda 工位名称 + + /** + * SAP计划编号 + */ + private String orderCode; + + /** + * MES工单编号 + */ + private String planCode; /** * 更新时间 */ @@ -148,6 +158,22 @@ public class ReportQualityInspection extends BaseEntity { @Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") private Date updatedTime; + public String getOrderCode() { + return orderCode; + } + + public void setOrderCode(String orderCode) { + this.orderCode = orderCode; + } + + public String getPlanCode() { + return planCode; + } + + public void setPlanCode(String planCode) { + this.planCode = planCode; + } + public String getProcessName() { return processName; } diff --git a/aucma-report/src/main/java/com/aucma/report/mapper/MaterialCompletionMapper.java b/aucma-report/src/main/java/com/aucma/report/mapper/MaterialCompletionMapper.java new file mode 100644 index 0000000..697a3e2 --- /dev/null +++ b/aucma-report/src/main/java/com/aucma/report/mapper/MaterialCompletionMapper.java @@ -0,0 +1,65 @@ +package com.aucma.report.mapper; + +import java.util.List; + +import com.aucma.common.annotation.DataSource; +import com.aucma.common.enums.DataSourceType; +import com.aucma.report.domain.MaterialCompletion; + +/** + * 物料过点记录Mapper接口 + * + * @author Yinq + * @date 2024-03-14 + */ +@DataSource(value = DataSourceType.SLAVE) +public interface MaterialCompletionMapper +{ + /** + * 查询物料过点记录 + * + * @param objId 物料过点记录主键 + * @return 物料过点记录 + */ + public MaterialCompletion selectMaterialCompletionByObjId(Long objId); + + /** + * 查询物料过点记录列表 + * + * @param materialCompletion 物料过点记录 + * @return 物料过点记录集合 + */ + public List selectMaterialCompletionList(MaterialCompletion materialCompletion); + + /** + * 新增物料过点记录 + * + * @param materialCompletion 物料过点记录 + * @return 结果 + */ + public int insertMaterialCompletion(MaterialCompletion materialCompletion); + + /** + * 修改物料过点记录 + * + * @param materialCompletion 物料过点记录 + * @return 结果 + */ + public int updateMaterialCompletion(MaterialCompletion materialCompletion); + + /** + * 删除物料过点记录 + * + * @param objId 物料过点记录主键 + * @return 结果 + */ + public int deleteMaterialCompletionByObjId(Long objId); + + /** + * 批量删除物料过点记录 + * + * @param objIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteMaterialCompletionByObjIds(Long[] objIds); +} diff --git a/aucma-report/src/main/java/com/aucma/report/service/IMaterialCompletionService.java b/aucma-report/src/main/java/com/aucma/report/service/IMaterialCompletionService.java new file mode 100644 index 0000000..749736b --- /dev/null +++ b/aucma-report/src/main/java/com/aucma/report/service/IMaterialCompletionService.java @@ -0,0 +1,68 @@ +package com.aucma.report.service; + +import java.util.List; +import com.aucma.report.domain.MaterialCompletion; +import com.aucma.report.domain.ReportQualityInspection; + +/** + * 物料过点记录Service接口 + * + * @author Yinq + * @date 2024-03-14 + */ +public interface IMaterialCompletionService +{ + /** + * 查询物料过点记录 + * + * @param objId 物料过点记录主键 + * @return 物料过点记录 + */ + public MaterialCompletion selectMaterialCompletionByObjId(Long objId); + + /** + * 查询物料过点记录列表 + * + * @param materialCompletion 物料过点记录 + * @return 物料过点记录集合 + */ + public List selectMaterialCompletionList(MaterialCompletion materialCompletion); + + /** + * 新增物料过点记录 + * + * @param materialCompletion 物料过点记录 + * @return 结果 + */ + public int insertMaterialCompletion(MaterialCompletion materialCompletion); + + /** + * 修改物料过点记录 + * + * @param materialCompletion 物料过点记录 + * @return 结果 + */ + public int updateMaterialCompletion(MaterialCompletion materialCompletion); + + /** + * 批量删除物料过点记录 + * + * @param objIds 需要删除的物料过点记录主键集合 + * @return 结果 + */ + public int deleteMaterialCompletionByObjIds(Long[] objIds); + + /** + * 删除物料过点记录信息 + * + * @param objId 物料过点记录主键 + * @return 结果 + */ + public int deleteMaterialCompletionByObjId(Long objId); + + /** + * 二线质检存入过点数据 + * @param inspection + */ + void inspectionProcessing(ReportQualityInspection inspection); +} diff --git a/aucma-report/src/main/java/com/aucma/report/service/impl/MaterialCompletionServiceImpl.java b/aucma-report/src/main/java/com/aucma/report/service/impl/MaterialCompletionServiceImpl.java new file mode 100644 index 0000000..7a772b6 --- /dev/null +++ b/aucma-report/src/main/java/com/aucma/report/service/impl/MaterialCompletionServiceImpl.java @@ -0,0 +1,110 @@ +package com.aucma.report.service.impl; + +import java.util.List; + +import com.aucma.report.domain.ReportQualityInspection; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.aucma.report.mapper.MaterialCompletionMapper; +import com.aucma.report.domain.MaterialCompletion; +import com.aucma.report.service.IMaterialCompletionService; + +/** + * 物料过点记录Service业务层处理 + * + * @author Yinq + * @date 2024-03-14 + */ +@Service +public class MaterialCompletionServiceImpl implements IMaterialCompletionService { + @Autowired + private MaterialCompletionMapper materialCompletionMapper; + + /** + * 查询物料过点记录 + * + * @param objId 物料过点记录主键 + * @return 物料过点记录 + */ + @Override + public MaterialCompletion selectMaterialCompletionByObjId(Long objId) { + return materialCompletionMapper.selectMaterialCompletionByObjId(objId); + } + + /** + * 查询物料过点记录列表 + * + * @param materialCompletion 物料过点记录 + * @return 物料过点记录 + */ + @Override + public List selectMaterialCompletionList(MaterialCompletion materialCompletion) { + return materialCompletionMapper.selectMaterialCompletionList(materialCompletion); + } + + /** + * 新增物料过点记录 + * + * @param materialCompletion 物料过点记录 + * @return 结果 + */ + @Override + public int insertMaterialCompletion(MaterialCompletion materialCompletion) { + return materialCompletionMapper.insertMaterialCompletion(materialCompletion); + } + + /** + * 修改物料过点记录 + * + * @param materialCompletion 物料过点记录 + * @return 结果 + */ + @Override + public int updateMaterialCompletion(MaterialCompletion materialCompletion) { + return materialCompletionMapper.updateMaterialCompletion(materialCompletion); + } + + /** + * 批量删除物料过点记录 + * + * @param objIds 需要删除的物料过点记录主键 + * @return 结果 + */ + @Override + public int deleteMaterialCompletionByObjIds(Long[] objIds) { + return materialCompletionMapper.deleteMaterialCompletionByObjIds(objIds); + } + + /** + * 删除物料过点记录信息 + * + * @param objId 物料过点记录主键 + * @return 结果 + */ + @Override + public int deleteMaterialCompletionByObjId(Long objId) { + return materialCompletionMapper.deleteMaterialCompletionByObjId(objId); + } + + /** + * 二线质检存入过点数据 + * @param inspection + */ + @Override + public void inspectionProcessing(ReportQualityInspection inspection) { + MaterialCompletion materialCompletion = new MaterialCompletion(); + //质检转过点数据 +// if (StringUtils.isNotEmpty(inspection.getBarCode())){ +// //1001 +// } +// materialCompletion.setOrderCode(); +// materialCompletion.setPlanCode(); + materialCompletion.setMaterialBarcode(inspection.getBarCode()); + materialCompletion.setMaterialName(inspection.getMaterialName()); + materialCompletion.setStationName(inspection.getStationCode()); + materialCompletion.setCompleteDate(inspection.getInspectorTime()); + materialCompletion.setProductLineCode("CX_02"); + materialCompletionMapper.insertMaterialCompletion(materialCompletion); + } + +} diff --git a/aucma-report/src/main/resources/mapper/report/MaterialCompletionMapper.xml b/aucma-report/src/main/resources/mapper/report/MaterialCompletionMapper.xml new file mode 100644 index 0000000..0bd62d0 --- /dev/null +++ b/aucma-report/src/main/resources/mapper/report/MaterialCompletionMapper.xml @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + select obj_id, + order_code, + material_barcode, + material_code, + material_name, + station_name, + complete_date, + plan_code, + product_line_code, + is_down_line, + production_code + from material_completion + + + + + + + + + SELECT seq_material_completion.NEXTVAL as objId FROM DUAL + + insert into material_completion + + obj_id, + order_code, + material_barcode, + material_code, + material_name, + station_name, + complete_date, + plan_code, + product_line_code, + is_down_line, + production_code, + + + #{objId}, + #{orderCode}, + #{materialBarcode}, + #{materialCode}, + #{materialName,jdbcType=NVARCHAR}, + #{stationName}, + #{completeDate}, + #{planCode}, + #{productLineCode}, + #{isDownLine}, + #{productionCode}, + + + + + update material_completion + + order_code = #{orderCode}, + material_barcode = #{materialBarcode}, + material_code = #{materialCode}, + material_name = #{materialName}, + station_name = #{stationName}, + complete_date = #{completeDate}, + plan_code = #{planCode}, + product_line_code = #{productLineCode}, + is_down_line = #{isDownLine}, + production_code = #{productionCode}, + + where obj_id = #{objId} + + + + delete + from material_completion + where obj_id = #{objId} + + + + delete from material_completion where obj_id in + + #{objId} + + + \ No newline at end of file diff --git a/aucma-report/src/main/resources/mapper/report/ReportQualityInspectionMapper.xml b/aucma-report/src/main/resources/mapper/report/ReportQualityInspectionMapper.xml index 9e756d4..53f09ab 100644 --- a/aucma-report/src/main/resources/mapper/report/ReportQualityInspectionMapper.xml +++ b/aucma-report/src/main/resources/mapper/report/ReportQualityInspectionMapper.xml @@ -91,6 +91,7 @@ and rqi.updated_by = #{updatedBy} and rqi.updated_time = #{updatedTime} + order by rqi.inspector_time desc