修改 - 绑定插入字段

master
wangh 12 months ago
parent 8d5876a155
commit b97e72db72

@ -41,6 +41,9 @@ 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) {
// 查询质检缺陷有没有修复 还没做
// 查询插入
// Long objid=service.select
return success(); return success();
} }
@ -51,11 +54,17 @@ public class PdaApiController {
@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.setTreatmentMeasure(checkInfo.getMeasure()); inspection.setTreatmentMeasure(checkInfo.getMeasure());
inspection.setProcessResult(checkInfo.getMeasureName());
inspection.setIsLowerLine(checkInfo.getOffline()); inspection.setIsLowerLine(checkInfo.getOffline());
inspection.setInspectorCode(checkInfo.getUserName()); inspection.setInspectorCode(checkInfo.getUserName());
inspection.setInspectorTime(new Date()); inspection.setInspectorTime(new Date());

@ -11,6 +11,7 @@ public class CheckInfoDto {
private List<DefectBeen> list;//缺陷列表 private List<DefectBeen> list;//缺陷列表
private String measure;//处理措施TREATMENT_MEASURE private String measure;//处理措施TREATMENT_MEASURE
private String measureName;//处理措施TREATMENT_MEASURE
private String offline; private String offline;
private String processCode; private String processCode;
private String userName; private String userName;
@ -39,7 +40,13 @@ public class CheckInfoDto {
this.code = code; this.code = code;
} }
public String getMeasureName() {
return measureName;
}
public void setMeasureName(String measureName) {
this.measureName = measureName;
}
public List<DefectBeen> getList() { public List<DefectBeen> getList() {
return list; return list;

@ -16,7 +16,8 @@ public class PdaServiceImpl implements IPdaBindingService {
@Override @Override
public String selectBoxNameByCode(String boxCode) { public String selectBoxNameByCode(String boxCode) {
return mapper.selectBoxNameByCode(boxCode);
return mapper.selectBoxNameByCode(boxCode.substring(2,12));
} }
@Override @Override

@ -6,15 +6,13 @@
<select id="selectBoxNameByCode" resultType="string"> <select id="selectBoxNameByCode" resultType="string">
SELECT MATERIAL_NAME select MATERIAL_NAME from AUCMA_MES.BASE_MATERIALINFO where MATERIAL_CODE = #{boxCode}
FROM AUCMA_MES.BASE_BOMINFO
WHERE MATERIAL_CODE = #{boxCode}
</select> </select>
<insert id="insertBindingInfo"> <insert id="insertBindingInfo">
INSERT INTO AUCMA_SCADA.CODE_BINDING (OBJ_ID, BOX_CODE, BOX_NAME, PRODUCT_CODE, BINDING_RESULT, RECORD_TIME1, INSERT INTO AUCMA_SCADA.CODE_BINDING
RECORD_TIME2) (OBJ_ID, BOX_CODE, BOX_NAME, LINER_CODE, BINDING_RESULT, RECORD_TIME1)
VALUES (AUCMA_SCADA.SEQ_CODE_BINDING.nextval, #{boxCode}, #{boxName}, #{innerCode}, '成功', SYSDATE, SYSDATE) VALUES (AUCMA_SCADA.SEQ_CODE_BINDING.nextval, #{boxCode}, #{boxName}, #{innerCode}, '成功', SYSDATE)
</insert> </insert>
</mapper> </mapper>
Loading…
Cancel
Save