change - 质检接口

master
yinq 10 months ago
parent b6b5a3a474
commit b221e983d7

@ -3,6 +3,8 @@ 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.domain.dto.RepairSubmitInfoDto;
import com.aucma.api.service.IPdaBindingService; import com.aucma.api.service.IPdaBindingService;
import com.aucma.base.domain.BaseProcessStation;
import com.aucma.base.service.IBaseProcessStationService;
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.domain.ReportQualityInspection;
@ -28,6 +30,9 @@ public class PdaApiController {
@Autowired @Autowired
private IPdaBindingService service; private IPdaBindingService service;
@Autowired
private IBaseProcessStationService baseProcessStationService;
//壳胆绑定-提交 //壳胆绑定-提交
@PostMapping("/boxBanding") @PostMapping("/boxBanding")
public AjaxResult binding(String boxCode, String innerCode, String loginName) { public AjaxResult binding(String boxCode, String innerCode, String loginName) {
@ -84,6 +89,9 @@ public class PdaApiController {
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(checkInfo.getName()); inspection.setMaterialName(checkInfo.getName());
String measure = checkInfo.getMeasure(); String measure = checkInfo.getMeasure();
inspection.setTreatmentMeasure(measure); inspection.setTreatmentMeasure(measure);
@ -93,12 +101,21 @@ public class PdaApiController {
inspection.setInspectorTime(new Date()); inspection.setInspectorTime(new Date());
inspection.setStationCode(checkInfo.getStationCode()); inspection.setStationCode(checkInfo.getStationCode());
inspection.setGroupCode(checkInfo.getTeamCode()); inspection.setGroupCode(checkInfo.getTeamCode());
try {
BaseProcessStation processStation = new BaseProcessStation();
processStation.setParentId(checkInfo.getStationCode());
List<BaseProcessStation> processStations = baseProcessStationService.selectBaseProcessStationList(processStation);
inspection.setProcessCode(processStations.get(0).getProcessCode());
} catch (Exception e) {
e.printStackTrace();
}
assert list != null; assert list != null;
if (!list.isEmpty()) { if (!list.isEmpty()) {
CheckInfoDto.DefectBeen defectBeen = list.get(i); CheckInfoDto.DefectBeen defectBeen = list.get(i);
inspection.setSubmitQualtyId(defectBeen.getObjId()); inspection.setSubmitQualtyId(defectBeen.getObjId());
inspection.setTestItemCode(list.get(i).getStationCode()); inspection.setTestItemCode(list.get(i).getStationCode());
inspection.setQualityDefectCode(list.get(i).getQualityDefectCode()); inspection.setQualityDefectCode(list.get(i).getQualityDefectCode());
inspection.setQualityDefectName(list.get(i).getQualityDefectName()); inspection.setQualityDefectName(list.get(i).getQualityDefectName());
} }

@ -64,9 +64,17 @@
<select id="boxFoamingProductionInterface" resultType="java.util.HashMap" parameterType="java.util.HashMap"> <select id="boxFoamingProductionInterface" resultType="java.util.HashMap" parameterType="java.util.HashMap">
SELECT BD.SORT EQUIPMENT_CODE, SELECT BD.SORT EQUIPMENT_CODE,
VBF.FIXTUREBOXTYPE, VBF.FIXTUREBOXTYPE,
CASE WHEN VBF.FIXTURESTATUS = 1 THEN '生产中' ELSE '停用中' END FIXTURESTATUS, CASE WHEN VBF.FIXTURESTATUS = 1 THEN '正常生产' ELSE '暂停生产' END FIXTURESTATUS,
TO_NUMBER(BCD.CUSTOM_DATA) TARGET, TO_NUMBER(BCD.CUSTOM_DATA) TARGET,
VBF.ORDER_CODE, (CASE
WHEN '20:00' > TO_CHAR(SYSDATE, 'HH24:MI') AND TO_CHAR(SYSDATE, 'HH24:MI') >= '08:00'
THEN round(TO_NUMBER(BCD.CUSTOM_DATA) / 12, 0) * (TO_CHAR(SYSDATE, 'HH24') - 7)
WHEN TO_CHAR(SYSDATE, 'HH24:MI') >= '20:00'
THEN round(TO_NUMBER(BCD.CUSTOM_DATA) / 12, 0) * (TO_CHAR(SYSDATE, 'HH24') - 19)
WHEN '08:00' > TO_CHAR(SYSDATE, 'HH24:MI')
THEN round(TO_NUMBER(BCD.CUSTOM_DATA) / 12, 0) * (TO_CHAR(SYSDATE, 'HH24') + 5)
END
) PLAN_SUM,
VBF.PRODUCTION PRO_SUM, VBF.PRODUCTION PRO_SUM,
VBF.ANHOUR, VBF.ANHOUR,
VBF.TWOHOUR, VBF.TWOHOUR,
@ -84,8 +92,8 @@
TO_CHAR(VBF.UPDATETIME, 'YYYY-MM-DD HH24:MI:SS') UPDATETIME TO_CHAR(VBF.UPDATETIME, 'YYYY-MM-DD HH24:MI:SS') UPDATETIME
FROM VIEW_BOX_FOAMDATA VBF FROM VIEW_BOX_FOAMDATA VBF
LEFT JOIN VIEW_BOX_DEVICEINFO BD ON BD.OBJ_ID = VBF.MAINID LEFT JOIN VIEW_BOX_DEVICEINFO BD ON BD.OBJ_ID = VBF.MAINID
LEFT JOIN BASE_CUSTOM_DATA BCD ON BCD.CUSTOM_CODE = 'XTFP_TARGET' LEFT JOIN BASE_CUSTOM_DATA BCD ON BCD.CUSTOM_CODE = 'XTFP_TARGET_' || #{PRODUCT_LINE_CODE}
WHERE VBF.PRODUCT_LINE_CODE = 'CX_01' WHERE VBF.PRODUCT_LINE_CODE = #{PRODUCT_LINE_CODE}
ORDER BY BD.SORT ORDER BY BD.SORT
</select> </select>

Loading…
Cancel
Save