|
|
@ -1,6 +1,7 @@
|
|
|
|
package com.aucma.api.controller;
|
|
|
|
package com.aucma.api.controller;
|
|
|
|
|
|
|
|
|
|
|
|
import com.aucma.api.domain.dto.CheckInfoDto;
|
|
|
|
import com.aucma.api.domain.dto.CheckInfoDto;
|
|
|
|
|
|
|
|
import com.aucma.api.domain.dto.RepairSubmitInfoDto;
|
|
|
|
import com.aucma.api.service.IPdaBindingService;
|
|
|
|
import com.aucma.api.service.IPdaBindingService;
|
|
|
|
import com.aucma.common.core.domain.AjaxResult;
|
|
|
|
import com.aucma.common.core.domain.AjaxResult;
|
|
|
|
import com.aucma.common.utils.StringUtils;
|
|
|
|
import com.aucma.common.utils.StringUtils;
|
|
|
@ -21,7 +22,7 @@ import static com.aucma.common.core.domain.AjaxResult.success;
|
|
|
|
* @date 2023/11/14 9:28
|
|
|
|
* @date 2023/11/14 9:28
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@RestController
|
|
|
|
@RestController
|
|
|
|
@RequestMapping(("/api"))
|
|
|
|
@RequestMapping("/api")
|
|
|
|
public class PdaApiController {
|
|
|
|
public class PdaApiController {
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
@ -41,31 +42,52 @@ public class PdaApiController {
|
|
|
|
//条码绑定
|
|
|
|
//条码绑定
|
|
|
|
@PostMapping("/barCodeBanding")
|
|
|
|
@PostMapping("/barCodeBanding")
|
|
|
|
public AjaxResult barCodeBanding(String boxCode, String innerCode, String loginName) {
|
|
|
|
public AjaxResult barCodeBanding(String boxCode, String innerCode, String loginName) {
|
|
|
|
// 查询质检缺陷有没有修复 还没做
|
|
|
|
// 查询质检缺陷有没有修复
|
|
|
|
|
|
|
|
int countQa = service.countQualityRecordByCode(boxCode);
|
|
|
|
|
|
|
|
if (countQa > 0) {
|
|
|
|
|
|
|
|
return error("返修中" + countQa + "条未处理,不允许绑定");
|
|
|
|
|
|
|
|
}
|
|
|
|
// 查询插入
|
|
|
|
// 查询插入
|
|
|
|
// Long objid=service.select
|
|
|
|
return toAjax(service.updateCodeBinding(boxCode, innerCode));
|
|
|
|
return success();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@PostMapping("/selectGoodsName")
|
|
|
|
|
|
|
|
public AjaxResult selectGoodsName(String code) {
|
|
|
|
|
|
|
|
String boxName = service.selectBoxNameByCode(code);
|
|
|
|
|
|
|
|
if (boxName == null) {
|
|
|
|
|
|
|
|
return error("查询失败,条码不正确");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return success("操作成功", boxName);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@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();
|
|
|
|
inspection.setBarCode(checkInfo.getCode());
|
|
|
|
inspection.setBarCode(checkInfo.getCode());
|
|
|
|
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;
|
|
|
@ -83,11 +105,22 @@ 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")
|
|
|
|
|
|
|
|
public AjaxResult submitRepair(@RequestBody RepairSubmitInfoDto info) {
|
|
|
|
|
|
|
|
return toAjax(service.submitRepair(info));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private AjaxResult toAjax(int rows) {
|
|
|
|
|
|
|
|
return rows > 0 ? AjaxResult.success() : AjaxResult.error();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|