add - 质检插入

master
wangh 1 year ago
parent cf3148223f
commit 7251da7f05

@ -4,9 +4,13 @@ import com.aucma.api.domain.dto.CheckInfoDto;
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;
import com.aucma.report.domain.ReportQualityInspection;
import com.aucma.report.service.IReportQualityInspectionService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.Date;
import java.util.List;
import java.util.Optional; import java.util.Optional;
import static com.aucma.common.core.domain.AjaxResult.error; import static com.aucma.common.core.domain.AjaxResult.error;
@ -35,14 +39,31 @@ public class PdaBindingController {
} }
//条码绑定 //条码绑定
@Autowired
private IReportQualityInspectionService qualityService;
// 质检提交 // 质检提交
@PostMapping("/checkSubmit") @PostMapping("/checkSubmit")
public AjaxResult checkSubmit(@RequestBody CheckInfoDto checkInfo/*, public AjaxResult checkSubmit(@RequestBody CheckInfoDto checkInfo) {
@RequestParam("processCode") String processCode, List<CheckInfoDto.DefectBeen> list = checkInfo.getList();
@RequestParam("userName") String userName*/) { int size = (list == null || list.isEmpty()) ? 1 : list.size();
System.out.println(checkInfo.toString()); for (int i = 0; i < size; i++) {
// System.out.println(processCode); ReportQualityInspection inspection = new ReportQualityInspection();
// System.out.println(userName); inspection.setBarCode(checkInfo.getCode());
inspection.setProcessResult(checkInfo.getMeasure());
inspection.setIsLowerLine(checkInfo.getOffline());
inspection.setInspectorCode(checkInfo.getUserName());
inspection.setInspectorTime(new Date());
assert list != null;
if (!list.isEmpty()) {
inspection.setTestItemCode(list.get(i).getStationCode());
inspection.setQualityDefectCode(list.get(i).getQualityDefectCode());
inspection.setQualityDefectName(list.get(i).getQualityDefectName());
}
qualityService.insertReportQualityInspection(inspection);
}
return success(); return success();
} }

@ -8,12 +8,28 @@ import java.util.List;
*/ */
public class CheckInfoDto { public class CheckInfoDto {
private String code;//产品条码 private String code;//产品条码
private String defect;
private List<DefectBeen> list;//缺陷列表 private List<DefectBeen> list;//缺陷列表
private String measure;//处理措施TREATMENT_MEASURE private String measure;//处理措施TREATMENT_MEASURE
private String offline; private String offline;
private String processCode;
private String userName;
public String getProcessCode() {
return processCode;
}
public void setProcessCode(String processCode) {
this.processCode = processCode;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getCode() { public String getCode() {
return code; return code;
@ -23,13 +39,7 @@ public class CheckInfoDto {
this.code = code; this.code = code;
} }
public String getDefect() {
return defect;
}
public void setDefect(String defect) {
this.defect = defect;
}
public List<DefectBeen> getList() { public List<DefectBeen> getList() {
return list; return list;
@ -55,16 +65,12 @@ public class CheckInfoDto {
this.offline = offline; this.offline = offline;
} }
@Override
public String toString() {
return "CheckInfoDto{" + "code='" + code + '\'' + ", defect='" + defect + '\'' + ", list=" + list + ", measure='" + measure + '\'' + ", offline='" + offline + '\'' + '}';
}
public static class DefectBeen { public static class DefectBeen {
private String qualityDefectCode; private String qualityDefectCode;
private String qualityDefectName; private String qualityDefectName;
private String itemCode; private String stationCode;
public DefectBeen() { public DefectBeen() {
} }
@ -85,17 +91,14 @@ public class CheckInfoDto {
this.qualityDefectName = qualityDefectName; this.qualityDefectName = qualityDefectName;
} }
public String getItemCode() { public String getStationCode() {
return itemCode; return stationCode;
} }
public void setItemCode(String itemCode) { public void setItemCode(String stationCode) {
this.itemCode = itemCode; this.stationCode = stationCode;
} }
@Override
public String toString() {
return "DefectBeen{" + "qualityDefectCode='" + qualityDefectCode + '\'' + ", qualityDefectName='" + qualityDefectName + '\'' + ", itemCode='" + itemCode + '\'' + '}';
}
} }
} }

Loading…
Cancel
Save