add - 质检查询

master
wangh 10 months ago
parent 109c8ecccc
commit d382910600

@ -48,7 +48,7 @@ public class PdaApiController {
return error("返修中" + countQa + "条未处理,不允许绑定"); return error("返修中" + countQa + "条未处理,不允许绑定");
} }
// 查询插入 // 查询插入
return toAjax(service.updateCodeBinding(boxCode,innerCode)); return toAjax(service.updateCodeBinding(boxCode, innerCode));
} }
@PostMapping("/selectGoodsName") @PostMapping("/selectGoodsName")
@ -63,14 +63,23 @@ public class PdaApiController {
@Autowired @Autowired
private IReportQualityInspectionService qualityService; 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") @PostMapping("/checkSubmit")
public AjaxResult checkSubmit(@RequestBody CheckInfoDto checkInfo) { public AjaxResult checkSubmit(@RequestBody CheckInfoDto checkInfo) {
List<CheckInfoDto.DefectBeen> list = checkInfo.getList(); 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(); int size = (list == null || list.isEmpty()) ? 1 : list.size();
for (int i = 0; i < size; i++) { for (int i = 0; i < size; i++) {
ReportQualityInspection inspection = new ReportQualityInspection(); ReportQualityInspection inspection = new ReportQualityInspection();
@ -78,7 +87,7 @@ public class PdaApiController {
// inspection.setMaterialName(boxName); // inspection.setMaterialName(boxName);
inspection.setTreatmentMeasure(checkInfo.getMeasure()); inspection.setTreatmentMeasure(checkInfo.getMeasure());
inspection.setProcessResult(checkInfo.getMeasureName()); inspection.setProcessResult(checkInfo.getMeasureName());
inspection.setIsLowerLine(checkInfo.getOffline());
inspection.setInspectorCode(checkInfo.getUserName()); inspection.setInspectorCode(checkInfo.getUserName());
inspection.setInspectorTime(new Date()); inspection.setInspectorTime(new Date());
assert list != null; assert list != null;
@ -96,21 +105,20 @@ public class PdaApiController {
//返修查询质检信息 //返修查询质检信息
@PostMapping("/findCheckInfoByCode") @PostMapping("/findCheckInfoByCode")
public AjaxResult findCheckInfoByCode(String code) { public AjaxResult findCheckInfoByCode(String code) {
List<ReportQualityInspection> list = qualityService.findCheckInfoByCode(code); List<ReportQualityInspection> list = service.findCheckInfoByCode(code);
if (list == null || list.isEmpty()) { if (list == null || list.isEmpty()) {
return error("扫描条码不正确"); return error("扫描条码不正确");
} }
return success(list); return success(list);
} }
//返修提交质检信息 //返修提交质检信息
@PostMapping("/submitRepair") @PostMapping("/submitRepair")
public AjaxResult submitRepair(@RequestBody RepairSubmitInfoDto info) { public AjaxResult submitRepair(@RequestBody RepairSubmitInfoDto info) {
return toAjax(service.submitRepair(info)); return toAjax(service.submitRepair(info));
} }
private AjaxResult toAjax(int rows) { private AjaxResult toAjax(int rows) {
return rows > 0 ? AjaxResult.success() : AjaxResult.error(); return rows > 0 ? AjaxResult.success() : AjaxResult.error();
} }

@ -1,9 +1,12 @@
package com.aucma.api.mapper; package com.aucma.api.mapper;
import com.aucma.api.domain.dto.RepairSubmitInfoDto; import com.aucma.api.domain.dto.RepairSubmitInfoDto;
import com.aucma.report.domain.ReportQualityInspection;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import java.util.List;
/** /**
* @author wanghao * @author wanghao
* @date 2023/11/14 10:16 * @date 2023/11/14 10:16
@ -21,4 +24,8 @@ public interface PdaBindingMapper {
int updateCodeBinding(@Param("boxCode") String boxCode, @Param("innerCode")String innerCode); int updateCodeBinding(@Param("boxCode") String boxCode, @Param("innerCode")String innerCode);
int submitRepair(@Param("info")RepairSubmitInfoDto info); 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; package com.aucma.api.service;
import com.aucma.api.domain.dto.RepairSubmitInfoDto; import com.aucma.api.domain.dto.RepairSubmitInfoDto;
import com.aucma.report.domain.ReportQualityInspection;
import java.util.List;
/** /**
* @author wanghao * @author wanghao
@ -16,4 +19,8 @@ public interface IPdaBindingService {
int updateCodeBinding(String boxCode, String innerCode); int updateCodeBinding(String boxCode, String innerCode);
int submitRepair(RepairSubmitInfoDto info); 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.domain.dto.RepairSubmitInfoDto;
import com.aucma.api.mapper.PdaBindingMapper; import com.aucma.api.mapper.PdaBindingMapper;
import com.aucma.api.service.IPdaBindingService; import com.aucma.api.service.IPdaBindingService;
import com.aucma.report.domain.ReportQualityInspection;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List;
/** /**
* @author wanghao * @author wanghao
* @date 2023/11/14 9:56 * @date 2023/11/14 9:56
@ -40,4 +43,14 @@ public class PdaServiceImpl implements IPdaBindingService {
public int submitRepair(RepairSubmitInfoDto info) { public int submitRepair(RepairSubmitInfoDto info) {
return mapper.submitRepair(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} #{objId}
</foreach> </foreach>
</update> </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> </mapper>

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

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

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

@ -168,14 +168,6 @@
</foreach> </foreach>
</delete> </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> </mapper>
Loading…
Cancel
Save