diff --git a/aucma-api/src/main/java/com/aucma/api/controller/PdaApiController.java b/aucma-api/src/main/java/com/aucma/api/controller/PdaApiController.java index 5da445b..94fa6d4 100644 --- a/aucma-api/src/main/java/com/aucma/api/controller/PdaApiController.java +++ b/aucma-api/src/main/java/com/aucma/api/controller/PdaApiController.java @@ -15,9 +15,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import java.util.Date; -import java.util.HashMap; import java.util.List; -import java.util.Optional; import static com.aucma.common.core.domain.AjaxResult.error; import static com.aucma.common.core.domain.AjaxResult.success; @@ -98,10 +96,15 @@ public class PdaApiController { String boxName = service.selectBoxNameByCode(code); if (boxName == null) { // boxName = "固定数据"; - return error("箱壳条码扫描错误"); + return error("条码信息扫描错误!"); } //检验前一工位是否已完成质检 - System.out.println(code + ":" + station); + if (StringUtils.isNotEmpty(station)){ + String result = qualityService.checkBeforeStationInspection(code, station); + if (StringUtils.isNotNull(result)){ + return error(result); + } + } List list = service.checkSelectRepairInfo(code); return success(boxName, list); diff --git a/aucma-base/src/main/java/com/aucma/base/mapper/BaseProductLineMapper.java b/aucma-base/src/main/java/com/aucma/base/mapper/BaseProductLineMapper.java index cec0c17..b3f88ab 100644 --- a/aucma-base/src/main/java/com/aucma/base/mapper/BaseProductLineMapper.java +++ b/aucma-base/src/main/java/com/aucma/base/mapper/BaseProductLineMapper.java @@ -58,4 +58,11 @@ public interface BaseProductLineMapper * @return 结果 */ public int deleteBaseProductLineByObjIds(Long[] objIds); + + /** + * 查询质检工位顺序 + * @param baseProductLine + * @return + */ + public List selectReportQualityStationCode(BaseProductLine baseProductLine); } diff --git a/aucma-base/src/main/java/com/aucma/base/service/IBaseProductLineService.java b/aucma-base/src/main/java/com/aucma/base/service/IBaseProductLineService.java index f86e2e6..8269a45 100644 --- a/aucma-base/src/main/java/com/aucma/base/service/IBaseProductLineService.java +++ b/aucma-base/src/main/java/com/aucma/base/service/IBaseProductLineService.java @@ -58,4 +58,11 @@ public interface IBaseProductLineService * @return 结果 */ public int deleteBaseProductLineByObjId(Long objId); + + /** + * 查询质检工位顺序 + * @param baseProductLine + * @return + */ + List selectReportQualityStationCode(BaseProductLine baseProductLine); } diff --git a/aucma-base/src/main/java/com/aucma/base/service/impl/BaseProductLineServiceImpl.java b/aucma-base/src/main/java/com/aucma/base/service/impl/BaseProductLineServiceImpl.java index db4e72d..982f8e7 100644 --- a/aucma-base/src/main/java/com/aucma/base/service/impl/BaseProductLineServiceImpl.java +++ b/aucma-base/src/main/java/com/aucma/base/service/impl/BaseProductLineServiceImpl.java @@ -90,4 +90,16 @@ public class BaseProductLineServiceImpl implements IBaseProductLineService { return baseProductLineMapper.deleteBaseProductLineByObjId(objId); } + + /** + * 查询质检工位顺序 + * + * @param baseProductLine 产线信息 + * @return 产线信息 + */ + @Override + public List selectReportQualityStationCode(BaseProductLine baseProductLine) + { + return baseProductLineMapper.selectReportQualityStationCode(baseProductLine); + } } diff --git a/aucma-base/src/main/resources/mapper/base/BaseProductLineMapper.xml b/aucma-base/src/main/resources/mapper/base/BaseProductLineMapper.xml index 689c428..92c65a7 100644 --- a/aucma-base/src/main/resources/mapper/base/BaseProductLineMapper.xml +++ b/aucma-base/src/main/resources/mapper/base/BaseProductLineMapper.xml @@ -160,4 +160,15 @@ #{objId} + + \ No newline at end of file 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 9acf003..8d4adb7 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 @@ -65,7 +65,7 @@ public class ReportQualityInspection extends BaseEntity { private String qualityDefectName; /** - * 处理措施 + * 处理措施(3=合格,1=返修) */ @Excel(name = "处理措施") private String treatmentMeasure; diff --git a/aucma-report/src/main/java/com/aucma/report/service/IReportQualityInspectionService.java b/aucma-report/src/main/java/com/aucma/report/service/IReportQualityInspectionService.java index f7b790e..7fc59b7 100644 --- a/aucma-report/src/main/java/com/aucma/report/service/IReportQualityInspectionService.java +++ b/aucma-report/src/main/java/com/aucma/report/service/IReportQualityInspectionService.java @@ -75,4 +75,12 @@ public interface IReportQualityInspectionService { * @return */ public ReportQualityInspection selectReportQualityInspectionByBarcode(String barcode); + + /** + * 检验前一工位是否已完成质检 + * @param boxCode + * @param stationCode + * @return + */ + String checkBeforeStationInspection(String boxCode, String stationCode); } diff --git a/aucma-report/src/main/java/com/aucma/report/service/impl/ReportQualityInspectionServiceImpl.java b/aucma-report/src/main/java/com/aucma/report/service/impl/ReportQualityInspectionServiceImpl.java index 3662011..5a6fe5b 100644 --- a/aucma-report/src/main/java/com/aucma/report/service/impl/ReportQualityInspectionServiceImpl.java +++ b/aucma-report/src/main/java/com/aucma/report/service/impl/ReportQualityInspectionServiceImpl.java @@ -4,6 +4,8 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; +import com.aucma.base.domain.BaseProductLine; +import com.aucma.base.service.IBaseProductLineService; import com.aucma.common.utils.StringUtils; import com.aucma.report.domain.BoxTemperatureHistory; import org.springframework.beans.factory.annotation.Autowired; @@ -23,6 +25,9 @@ public class ReportQualityInspectionServiceImpl implements IReportQualityInspect @Autowired private ReportQualityInspectionMapper reportQualityInspectionMapper; + @Autowired + private IBaseProductLineService productLineService; + /** * 查询质检记录管理 * @@ -116,5 +121,37 @@ public class ReportQualityInspectionServiceImpl implements IReportQualityInspect return reportQualityInspectionMapper.selectReportQualityInspectionByBarcode(barcode); } + /** + * 检验前一工位是否已完成质检 + * @param boxCode + * @param stationCode + * @return + */ + @Override + public String checkBeforeStationInspection(String boxCode, String stationCode) { + String result = null; + List productLineList = productLineService.selectReportQualityStationCode(new BaseProductLine()); + int markLocation = 0; + for (int i = 0; i < productLineList.size(); i++) { + if (productLineList.get(i).getProductLineCode().equals(stationCode)){ + markLocation = i; + } + } + if (markLocation <= 1){ + return null; + } + BaseProductLine productLineInfo = productLineList.get(markLocation - 1); + ReportQualityInspection inspection = new ReportQualityInspection(); + inspection.setBarCode(boxCode); + inspection.setStationCode(productLineInfo.getProductLineCode()); + inspection.setTreatmentMeasure("3"); + List qualityInspections = this.selectReportQualityInspectionList(inspection); + if (qualityInspections.size() == 0){ + result = productLineInfo.getProductLineName() + "工位未完成质检!"; + } + System.out.println("检验前一工位是否已完成质检:" + boxCode + "-" + stationCode + "-" + result); + return result; + } + }