change - 添加PDA质检工位顺序校验逻辑

master
yinq 6 months ago
parent e80756dadd
commit 90ca04f122

@ -15,9 +15,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Optional;
import static com.aucma.common.core.domain.AjaxResult.error;
import static com.aucma.common.core.domain.AjaxResult.success;
@ -98,10 +96,15 @@ public class PdaApiController {
String boxName = service.selectBoxNameByCode(code);
if (boxName == null) {
// boxName = "固定数据";
return error("箱壳条码扫描错误");
return error("条码信息扫描错误");
}
//检验前一工位是否已完成质检
System.out.println(code + ":" + station);
if (StringUtils.isNotEmpty(station)){
String result = qualityService.checkBeforeStationInspection(code, station);
if (StringUtils.isNotNull(result)){
return error(result);
}
}
List<ReportQualityInspection> list = service.checkSelectRepairInfo(code);
return success(boxName, list);

@ -58,4 +58,11 @@ public interface BaseProductLineMapper
* @return
*/
public int deleteBaseProductLineByObjIds(Long[] objIds);
/**
*
* @param baseProductLine
* @return
*/
public List<BaseProductLine> selectReportQualityStationCode(BaseProductLine baseProductLine);
}

@ -58,4 +58,11 @@ public interface IBaseProductLineService
* @return
*/
public int deleteBaseProductLineByObjId(Long objId);
/**
*
* @param baseProductLine
* @return
*/
List<BaseProductLine> selectReportQualityStationCode(BaseProductLine baseProductLine);
}

@ -90,4 +90,16 @@ public class BaseProductLineServiceImpl implements IBaseProductLineService
{
return baseProductLineMapper.deleteBaseProductLineByObjId(objId);
}
/**
*
*
* @param baseProductLine 线
* @return 线
*/
@Override
public List<BaseProductLine> selectReportQualityStationCode(BaseProductLine baseProductLine)
{
return baseProductLineMapper.selectReportQualityStationCode(baseProductLine);
}
}

@ -160,4 +160,15 @@
#{objId}
</foreach>
</delete>
<select id="selectReportQualityStationCode" parameterType="com.aucma.base.domain.BaseProductLine" resultType="com.aucma.base.domain.BaseProductLine">
SELECT PRODUCT_LINE_CODE productLineCode, PRODUCT_LINE_NAME productLineName, EXECUTION_SORT executionSort
FROM BASE_PRODUCTLINE
WHERE PRODUCT_LINE_TYPE = 2
AND STATION_TYPE = 2
AND EXECUTION_SORT IS NOT NULL
AND PARENT_ID = 'CX_02'
AND PRODUCT_LINE_CODE NOT IN ('2015', '2005', '2009')
ORDER BY EXECUTION_SORT
</select>
</mapper>

@ -65,7 +65,7 @@ public class ReportQualityInspection extends BaseEntity {
private String qualityDefectName;
/**
*
* 3=,1=
*/
@Excel(name = "处理措施")
private String treatmentMeasure;

@ -75,4 +75,12 @@ public interface IReportQualityInspectionService {
* @return
*/
public ReportQualityInspection selectReportQualityInspectionByBarcode(String barcode);
/**
*
* @param boxCode
* @param stationCode
* @return
*/
String checkBeforeStationInspection(String boxCode, String stationCode);
}

@ -4,6 +4,8 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import com.aucma.base.domain.BaseProductLine;
import com.aucma.base.service.IBaseProductLineService;
import com.aucma.common.utils.StringUtils;
import com.aucma.report.domain.BoxTemperatureHistory;
import org.springframework.beans.factory.annotation.Autowired;
@ -23,6 +25,9 @@ public class ReportQualityInspectionServiceImpl implements IReportQualityInspect
@Autowired
private ReportQualityInspectionMapper reportQualityInspectionMapper;
@Autowired
private IBaseProductLineService productLineService;
/**
*
*
@ -116,5 +121,37 @@ public class ReportQualityInspectionServiceImpl implements IReportQualityInspect
return reportQualityInspectionMapper.selectReportQualityInspectionByBarcode(barcode);
}
/**
*
* @param boxCode
* @param stationCode
* @return
*/
@Override
public String checkBeforeStationInspection(String boxCode, String stationCode) {
String result = null;
List<BaseProductLine> productLineList = productLineService.selectReportQualityStationCode(new BaseProductLine());
int markLocation = 0;
for (int i = 0; i < productLineList.size(); i++) {
if (productLineList.get(i).getProductLineCode().equals(stationCode)){
markLocation = i;
}
}
if (markLocation <= 1){
return null;
}
BaseProductLine productLineInfo = productLineList.get(markLocation - 1);
ReportQualityInspection inspection = new ReportQualityInspection();
inspection.setBarCode(boxCode);
inspection.setStationCode(productLineInfo.getProductLineCode());
inspection.setTreatmentMeasure("3");
List<ReportQualityInspection> qualityInspections = this.selectReportQualityInspectionList(inspection);
if (qualityInspections.size() == 0){
result = productLineInfo.getProductLineName() + "工位未完成质检!";
}
System.out.println("检验前一工位是否已完成质检:" + boxCode + "-" + stationCode + "-" + result);
return result;
}
}

Loading…
Cancel
Save