add - 质检查询

master
wangh 10 months ago
parent 109c8ecccc
commit d382910600

@ -63,14 +63,23 @@ public class PdaApiController {
@Autowired
private IReportQualityInspectionService qualityService;
// 质检查询名称、前工位返修数据
@PostMapping("/check/select")
public AjaxResult checkSelect(String code) {
String boxName = service.selectBoxNameByCode(code);
if (boxName == null) {
boxName = "固定数据";
// return error("箱壳条码扫描错误");
}
List<ReportQualityInspection> list = service.checkSelectRepairInfo(code);
return success(boxName, list);
}
// 质检提交
@PostMapping("/checkSubmit")
public AjaxResult checkSubmit(@RequestBody CheckInfoDto checkInfo) {
List<CheckInfoDto.DefectBeen> list = checkInfo.getList();
String boxName = service.selectBoxNameByCode(checkInfo.getCode());
if (boxName==null) {
return error("箱壳条码扫描错误");
}
int size = (list == null || list.isEmpty()) ? 1 : list.size();
for (int i = 0; i < size; i++) {
ReportQualityInspection inspection = new ReportQualityInspection();
@ -78,7 +87,7 @@ public class PdaApiController {
// inspection.setMaterialName(boxName);
inspection.setTreatmentMeasure(checkInfo.getMeasure());
inspection.setProcessResult(checkInfo.getMeasureName());
inspection.setIsLowerLine(checkInfo.getOffline());
inspection.setInspectorCode(checkInfo.getUserName());
inspection.setInspectorTime(new Date());
assert list != null;
@ -96,7 +105,7 @@ public class PdaApiController {
//返修查询质检信息
@PostMapping("/findCheckInfoByCode")
public AjaxResult findCheckInfoByCode(String code) {
List<ReportQualityInspection> list = qualityService.findCheckInfoByCode(code);
List<ReportQualityInspection> list = service.findCheckInfoByCode(code);
if (list == null || list.isEmpty()) {
return error("扫描条码不正确");
}
@ -110,7 +119,6 @@ public class PdaApiController {
}
private AjaxResult toAjax(int rows) {
return rows > 0 ? AjaxResult.success() : AjaxResult.error();
}

@ -1,9 +1,12 @@
package com.aucma.api.mapper;
import com.aucma.api.domain.dto.RepairSubmitInfoDto;
import com.aucma.report.domain.ReportQualityInspection;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* @author wanghao
* @date 2023/11/14 10:16
@ -21,4 +24,8 @@ public interface PdaBindingMapper {
int updateCodeBinding(@Param("boxCode") String boxCode, @Param("innerCode")String innerCode);
int submitRepair(@Param("info")RepairSubmitInfoDto info);
List<ReportQualityInspection> findCheckInfoByCode(String code);
List<ReportQualityInspection> checkSelectRepairInfo(String code);
}

@ -1,6 +1,9 @@
package com.aucma.api.service;
import com.aucma.api.domain.dto.RepairSubmitInfoDto;
import com.aucma.report.domain.ReportQualityInspection;
import java.util.List;
/**
* @author wanghao
@ -16,4 +19,8 @@ public interface IPdaBindingService {
int updateCodeBinding(String boxCode, String innerCode);
int submitRepair(RepairSubmitInfoDto info);
List<ReportQualityInspection> findCheckInfoByCode(String code);
List<ReportQualityInspection> checkSelectRepairInfo(String code);
}

@ -3,9 +3,12 @@ package com.aucma.api.service.impl;
import com.aucma.api.domain.dto.RepairSubmitInfoDto;
import com.aucma.api.mapper.PdaBindingMapper;
import com.aucma.api.service.IPdaBindingService;
import com.aucma.report.domain.ReportQualityInspection;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @author wanghao
* @date 2023/11/14 9:56
@ -40,4 +43,14 @@ public class PdaServiceImpl implements IPdaBindingService {
public int submitRepair(RepairSubmitInfoDto info) {
return mapper.submitRepair(info);
}
@Override
public List<ReportQualityInspection> findCheckInfoByCode(String code) {
return mapper.findCheckInfoByCode(code);
}
@Override
public List<ReportQualityInspection> checkSelectRepairInfo(String code) {
return mapper.checkSelectRepairInfo(code);
}
}

@ -38,4 +38,24 @@
#{objId}
</foreach>
</update>
<select id="findCheckInfoByCode" resultMap="com.aucma.report.mapper.ReportQualityInspectionMapper.ReportQualityInspectionResult">
select OBJ_ID,
MATERIAL_NAME,
QUALITY_DEFECT_CODE,
QUALITY_DEFECT_NAME
from AUCMA_MES.REPORT_QUALITY_INSPECTION
where BAR_CODE = #{code}
and IS_FLAG is null
</select>
<select id="checkSelectRepairInfo" resultMap="com.aucma.report.mapper.ReportQualityInspectionMapper.ReportQualityInspectionResult">
select OBJ_ID,
MATERIAL_NAME,
QUALITY_DEFECT_CODE,
QUALITY_DEFECT_NAME
from AUCMA_MES.REPORT_QUALITY_INSPECTION
where BAR_CODE = #{code}
and IS_FLAG = 1
</select>
</mapper>

@ -59,5 +59,5 @@ public interface ReportQualityInspectionMapper
*/
public int deleteReportQualityInspectionByObjIds(Long[] objIds);
List<ReportQualityInspection> findCheckInfoByCode(String code);
}

@ -59,5 +59,5 @@ public interface IReportQualityInspectionService
*/
public int deleteReportQualityInspectionByObjId(Long objId);
List<ReportQualityInspection> findCheckInfoByCode(String code);
}

@ -91,10 +91,6 @@ public class ReportQualityInspectionServiceImpl implements IReportQualityInspect
return reportQualityInspectionMapper.deleteReportQualityInspectionByObjId(objId);
}
@Override
public List<ReportQualityInspection> findCheckInfoByCode(String code) {
return reportQualityInspectionMapper.findCheckInfoByCode(code);
}
}

@ -168,14 +168,6 @@
</foreach>
</delete>
<select id="findCheckInfoByCode" resultMap="ReportQualityInspectionResult">
select OBJ_ID,
MATERIAL_NAME,
QUALITY_DEFECT_CODE,
QUALITY_DEFECT_NAME
from AUCMA_MES.REPORT_QUALITY_INSPECTION
where BAR_CODE = #{code}
and IS_FLAG is null
</select>
</mapper>
Loading…
Cancel
Save