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 debd9f6..bacac69 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 @@ -8,11 +8,13 @@ import com.aucma.base.service.IBaseProcessStationService; import com.aucma.common.core.domain.AjaxResult; import com.aucma.common.utils.StringUtils; import com.aucma.report.domain.ReportQualityInspection; +import com.aucma.report.service.IMaterialCompletionService; import com.aucma.report.service.IReportQualityInspectionService; 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; @@ -33,6 +35,12 @@ public class PdaApiController { @Autowired private IBaseProcessStationService baseProcessStationService; + @Autowired + private IMaterialCompletionService completionService; + + @Autowired + private IReportQualityInspectionService qualityService; + //壳胆绑定-提交 @PostMapping("/boxBanding") public AjaxResult binding(String boxCode, String innerCode, String loginName) { @@ -65,8 +73,6 @@ public class PdaApiController { return success("操作成功", boxName); } - @Autowired - private IReportQualityInspectionService qualityService; // 质检查询名称、前工位返修数据 @PostMapping("/check/select") @@ -74,7 +80,7 @@ public class PdaApiController { String boxName = service.selectBoxNameByCode(code); if (boxName == null) { // boxName = "固定数据"; - return error("箱壳条码扫描错误"); + return error("箱壳条码扫描错误"); } List list = service.checkSelectRepairInfo(code); return success(boxName, list); @@ -95,14 +101,18 @@ public class PdaApiController { inspection.setMaterialName(checkInfo.getName()); String measure = checkInfo.getMeasure(); inspection.setTreatmentMeasure(measure); - if (measure.equals("3")){ inspection.setIsFlag(1L);} + if (measure.equals("3")) { + inspection.setIsFlag(1L); + } //检测人 inspection.setInspectorCode(checkInfo.getUserName()); +// inspection.setInspectorCode(SecurityUtils.getUsername()); inspection.setInspectorTime(new Date()); inspection.setStationCode(checkInfo.getStationCode()); inspection.setGroupCode(checkInfo.getTeamCode()); try { + // 查质检工序 BaseProcessStation processStation = new BaseProcessStation(); processStation.setParentId(checkInfo.getStationCode()); List processStations = baseProcessStationService.selectBaseProcessStationList(processStation); @@ -120,6 +130,14 @@ public class PdaApiController { inspection.setQualityDefectName(list.get(i).getQualityDefectName()); } qualityService.insertReportQualityInspection(inspection); + //质检处理措施(3=合格,1=返修) + if (inspection.getTreatmentMeasure().equals("3")) { + try { + completionService.inspectionProcessing(inspection); + } catch (Exception e) { + e.printStackTrace(); + } + } } return success(); @@ -146,4 +164,15 @@ public class PdaApiController { return rows > 0 ? AjaxResult.success() : AjaxResult.error(); } + /** + * PDA查询当班质检数量 + * + * @param stationCode 质检记录管理 + * @return 质检记录管理集合 + */ + @PostMapping("/pdaQueryQuantityNumber") + public AjaxResult pdaQueryQuantityNumber(String stationCode) { + return success(qualityService.pdaQueryQuantityNumber(stationCode)); + } + } diff --git a/aucma-api/src/main/java/com/aucma/api/service/impl/SAPPutStorageServiceImpl.java b/aucma-api/src/main/java/com/aucma/api/service/impl/SAPPutStorageServiceImpl.java index 901bacc..a045e55 100644 --- a/aucma-api/src/main/java/com/aucma/api/service/impl/SAPPutStorageServiceImpl.java +++ b/aucma-api/src/main/java/com/aucma/api/service/impl/SAPPutStorageServiceImpl.java @@ -213,6 +213,12 @@ public class SAPPutStorageServiceImpl implements ISAPPutStorageService { baseOrderInfo.setOrderAmount(new BigDecimal(map.get("GAMNG"))); } } + //产线变动 重新生成生成计划 + if (StringUtils.isNotEmpty(map.get("ARBPL")) && + StringUtils.isNotEmpty(baseOrderInfos.get(0).getWorkCenterCode()) && + !map.get("ARBPL").equals(baseOrderInfos.get(0).getWorkCenterCode())){ + baseOrderInfo.setIsRelease(1L); + } baseOrderInfo.setWorkCenterCode(map.get("ARBPL")); baseOrderInfo.setRoutingCode(map.get("AUFPL")); baseOrderInfo.setBeginDate(new SimpleDateFormat("yyyy-MM-dd").parse(map.get("GSTRP"))); diff --git a/aucma-framework/src/main/java/com/aucma/framework/config/SecurityConfig.java b/aucma-framework/src/main/java/com/aucma/framework/config/SecurityConfig.java index 283d32d..bb1e76d 100644 --- a/aucma-framework/src/main/java/com/aucma/framework/config/SecurityConfig.java +++ b/aucma-framework/src/main/java/com/aucma/framework/config/SecurityConfig.java @@ -126,6 +126,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter .antMatchers(HttpMethod.GET, "/report/repairMeasures/getRepairMeasures").permitAll() .antMatchers(HttpMethod.GET, "/base/teamMembers/**").permitAll() .antMatchers(HttpMethod.POST, "/webApi/electricalInspection").permitAll() + .antMatchers(HttpMethod.POST, "/api/**").permitAll() .antMatchers(HttpMethod.POST, "/**/**/**").permitAll() .antMatchers(HttpMethod.GET, "/**/**/**").permitAll() // 除上面外的所有请求全部需要鉴权认证 diff --git a/aucma-report/src/main/java/com/aucma/report/mapper/ReportQualityInspectionMapper.java b/aucma-report/src/main/java/com/aucma/report/mapper/ReportQualityInspectionMapper.java index 5acf567..6267a24 100644 --- a/aucma-report/src/main/java/com/aucma/report/mapper/ReportQualityInspectionMapper.java +++ b/aucma-report/src/main/java/com/aucma/report/mapper/ReportQualityInspectionMapper.java @@ -1,5 +1,6 @@ package com.aucma.report.mapper; +import java.util.HashMap; import java.util.List; import com.aucma.report.domain.ReportQualityInspection; @@ -60,4 +61,6 @@ public interface ReportQualityInspectionMapper public int deleteReportQualityInspectionByObjIds(Long[] objIds); + public HashMap pdaQueryQuantityNumber(String stationCode); + } 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 fb272e6..92619d0 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 @@ -1,19 +1,20 @@ package com.aucma.report.service; +import java.util.HashMap; import java.util.List; + import com.aucma.report.domain.ReportQualityInspection; /** * 质检记录管理Service接口 - * + * * @author Yinq * @date 2023-11-21 */ -public interface IReportQualityInspectionService -{ +public interface IReportQualityInspectionService { /** * 查询质检记录管理 - * + * * @param objId 质检记录管理主键 * @return 质检记录管理 */ @@ -21,7 +22,7 @@ public interface IReportQualityInspectionService /** * 查询质检记录管理列表 - * + * * @param reportQualityInspection 质检记录管理 * @return 质检记录管理集合 */ @@ -29,7 +30,7 @@ public interface IReportQualityInspectionService /** * 新增质检记录管理 - * + * * @param reportQualityInspection 质检记录管理 * @return 结果 */ @@ -37,7 +38,7 @@ public interface IReportQualityInspectionService /** * 修改质检记录管理 - * + * * @param reportQualityInspection 质检记录管理 * @return 结果 */ @@ -45,7 +46,7 @@ public interface IReportQualityInspectionService /** * 批量删除质检记录管理 - * + * * @param objIds 需要删除的质检记录管理主键集合 * @return 结果 */ @@ -53,11 +54,17 @@ public interface IReportQualityInspectionService /** * 删除质检记录管理信息 - * + * * @param objId 质检记录管理主键 * @return 结果 */ public int deleteReportQualityInspectionByObjId(Long objId); - + /** + * PDA查询当班质检数量 + * + * @param reportQualityInspection 质检记录管理 + * @return 质检记录管理集合 + */ + public HashMap pdaQueryQuantityNumber(String reportQualityInspection); } 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 67937cf..2c51c02 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 @@ -1,6 +1,10 @@ package com.aucma.report.service.impl; +import java.util.ArrayList; +import java.util.HashMap; import java.util.List; + +import com.aucma.common.utils.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.aucma.report.mapper.ReportQualityInspectionMapper; @@ -9,88 +13,94 @@ import com.aucma.report.service.IReportQualityInspectionService; /** * 质检记录管理Service业务层处理 - * + * * @author Yinq * @date 2023-11-21 */ @Service -public class ReportQualityInspectionServiceImpl implements IReportQualityInspectionService -{ +public class ReportQualityInspectionServiceImpl implements IReportQualityInspectionService { @Autowired private ReportQualityInspectionMapper reportQualityInspectionMapper; /** * 查询质检记录管理 - * + * * @param objId 质检记录管理主键 * @return 质检记录管理 */ @Override - public ReportQualityInspection selectReportQualityInspectionByObjId(Long objId) - { + public ReportQualityInspection selectReportQualityInspectionByObjId(Long objId) { return reportQualityInspectionMapper.selectReportQualityInspectionByObjId(objId); } /** * 查询质检记录管理列表 - * + * * @param reportQualityInspection 质检记录管理 * @return 质检记录管理 */ @Override - public List selectReportQualityInspectionList(ReportQualityInspection reportQualityInspection) - { + public List selectReportQualityInspectionList(ReportQualityInspection reportQualityInspection) { return reportQualityInspectionMapper.selectReportQualityInspectionList(reportQualityInspection); } /** * 新增质检记录管理 - * + * * @param reportQualityInspection 质检记录管理 * @return 结果 */ @Override - public int insertReportQualityInspection(ReportQualityInspection reportQualityInspection) - { + public int insertReportQualityInspection(ReportQualityInspection reportQualityInspection) { return reportQualityInspectionMapper.insertReportQualityInspection(reportQualityInspection); } /** * 修改质检记录管理 - * + * * @param reportQualityInspection 质检记录管理 * @return 结果 */ @Override - public int updateReportQualityInspection(ReportQualityInspection reportQualityInspection) - { + public int updateReportQualityInspection(ReportQualityInspection reportQualityInspection) { return reportQualityInspectionMapper.updateReportQualityInspection(reportQualityInspection); } /** * 批量删除质检记录管理 - * + * * @param objIds 需要删除的质检记录管理主键 * @return 结果 */ @Override - public int deleteReportQualityInspectionByObjIds(Long[] objIds) - { + public int deleteReportQualityInspectionByObjIds(Long[] objIds) { return reportQualityInspectionMapper.deleteReportQualityInspectionByObjIds(objIds); } /** * 删除质检记录管理信息 - * + * * @param objId 质检记录管理主键 * @return 结果 */ @Override - public int deleteReportQualityInspectionByObjId(Long objId) - { + public int deleteReportQualityInspectionByObjId(Long objId) { return reportQualityInspectionMapper.deleteReportQualityInspectionByObjId(objId); } + /** + * PDA查询当班质检数量 + * + * @param stationCode + * @return + */ + @Override + public HashMap pdaQueryQuantityNumber(String stationCode) { + if (StringUtils.isEmpty(stationCode)){ + return new HashMap<>(); + } + return reportQualityInspectionMapper.pdaQueryQuantityNumber(stationCode); + } } diff --git a/aucma-report/src/main/resources/mapper/report/ReportQualityInspectionMapper.xml b/aucma-report/src/main/resources/mapper/report/ReportQualityInspectionMapper.xml index 53f09ab..aa5d45f 100644 --- a/aucma-report/src/main/resources/mapper/report/ReportQualityInspectionMapper.xml +++ b/aucma-report/src/main/resources/mapper/report/ReportQualityInspectionMapper.xml @@ -98,6 +98,22 @@ where rqi.obj_id = #{objId} +