change - PDA查询当班质检数量、产线变动重新生成生成计划

master
yinq 8 months ago
parent 7c7ac577bf
commit 1c4663e7a8

@ -8,11 +8,13 @@ import com.aucma.base.service.IBaseProcessStationService;
import com.aucma.common.core.domain.AjaxResult;
import com.aucma.common.utils.StringUtils;
import com.aucma.report.domain.ReportQualityInspection;
import com.aucma.report.service.IMaterialCompletionService;
import com.aucma.report.service.IReportQualityInspectionService;
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;
@ -33,6 +35,12 @@ public class PdaApiController {
@Autowired
private IBaseProcessStationService baseProcessStationService;
@Autowired
private IMaterialCompletionService completionService;
@Autowired
private IReportQualityInspectionService qualityService;
//壳胆绑定-提交
@PostMapping("/boxBanding")
public AjaxResult binding(String boxCode, String innerCode, String loginName) {
@ -65,8 +73,6 @@ public class PdaApiController {
return success("操作成功", boxName);
}
@Autowired
private IReportQualityInspectionService qualityService;
// 质检查询名称、前工位返修数据
@PostMapping("/check/select")
@ -74,7 +80,7 @@ public class PdaApiController {
String boxName = service.selectBoxNameByCode(code);
if (boxName == null) {
// boxName = "固定数据";
return error("箱壳条码扫描错误");
return error("箱壳条码扫描错误");
}
List<ReportQualityInspection> list = service.checkSelectRepairInfo(code);
return success(boxName, list);
@ -95,14 +101,18 @@ public class PdaApiController {
inspection.setMaterialName(checkInfo.getName());
String measure = checkInfo.getMeasure();
inspection.setTreatmentMeasure(measure);
if (measure.equals("3")){ inspection.setIsFlag(1L);}
if (measure.equals("3")) {
inspection.setIsFlag(1L);
}
//检测人
inspection.setInspectorCode(checkInfo.getUserName());
// inspection.setInspectorCode(SecurityUtils.getUsername());
inspection.setInspectorTime(new Date());
inspection.setStationCode(checkInfo.getStationCode());
inspection.setGroupCode(checkInfo.getTeamCode());
try {
// 查质检工序
BaseProcessStation processStation = new BaseProcessStation();
processStation.setParentId(checkInfo.getStationCode());
List<BaseProcessStation> processStations = baseProcessStationService.selectBaseProcessStationList(processStation);
@ -120,6 +130,14 @@ public class PdaApiController {
inspection.setQualityDefectName(list.get(i).getQualityDefectName());
}
qualityService.insertReportQualityInspection(inspection);
//质检处理措施3=合格,1=返修)
if (inspection.getTreatmentMeasure().equals("3")) {
try {
completionService.inspectionProcessing(inspection);
} catch (Exception e) {
e.printStackTrace();
}
}
}
return success();
@ -146,4 +164,15 @@ public class PdaApiController {
return rows > 0 ? AjaxResult.success() : AjaxResult.error();
}
/**
* PDA
*
* @param stationCode
* @return
*/
@PostMapping("/pdaQueryQuantityNumber")
public AjaxResult pdaQueryQuantityNumber(String stationCode) {
return success(qualityService.pdaQueryQuantityNumber(stationCode));
}
}

@ -213,6 +213,12 @@ public class SAPPutStorageServiceImpl implements ISAPPutStorageService {
baseOrderInfo.setOrderAmount(new BigDecimal(map.get("GAMNG")));
}
}
//产线变动 重新生成生成计划
if (StringUtils.isNotEmpty(map.get("ARBPL")) &&
StringUtils.isNotEmpty(baseOrderInfos.get(0).getWorkCenterCode()) &&
!map.get("ARBPL").equals(baseOrderInfos.get(0).getWorkCenterCode())){
baseOrderInfo.setIsRelease(1L);
}
baseOrderInfo.setWorkCenterCode(map.get("ARBPL"));
baseOrderInfo.setRoutingCode(map.get("AUFPL"));
baseOrderInfo.setBeginDate(new SimpleDateFormat("yyyy-MM-dd").parse(map.get("GSTRP")));

@ -126,6 +126,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
.antMatchers(HttpMethod.GET, "/report/repairMeasures/getRepairMeasures").permitAll()
.antMatchers(HttpMethod.GET, "/base/teamMembers/**").permitAll()
.antMatchers(HttpMethod.POST, "/webApi/electricalInspection").permitAll()
.antMatchers(HttpMethod.POST, "/api/**").permitAll()
.antMatchers(HttpMethod.POST, "/**/**/**").permitAll()
.antMatchers(HttpMethod.GET, "/**/**/**").permitAll()
// 除上面外的所有请求全部需要鉴权认证

@ -1,5 +1,6 @@
package com.aucma.report.mapper;
import java.util.HashMap;
import java.util.List;
import com.aucma.report.domain.ReportQualityInspection;
@ -60,4 +61,6 @@ public interface ReportQualityInspectionMapper
public int deleteReportQualityInspectionByObjIds(Long[] objIds);
public HashMap<String, Integer> pdaQueryQuantityNumber(String stationCode);
}

@ -1,19 +1,20 @@
package com.aucma.report.service;
import java.util.HashMap;
import java.util.List;
import com.aucma.report.domain.ReportQualityInspection;
/**
* Service
*
*
* @author Yinq
* @date 2023-11-21
*/
public interface IReportQualityInspectionService
{
public interface IReportQualityInspectionService {
/**
*
*
*
* @param objId
* @return
*/
@ -21,7 +22,7 @@ public interface IReportQualityInspectionService
/**
*
*
*
* @param reportQualityInspection
* @return
*/
@ -29,7 +30,7 @@ public interface IReportQualityInspectionService
/**
*
*
*
* @param reportQualityInspection
* @return
*/
@ -37,7 +38,7 @@ public interface IReportQualityInspectionService
/**
*
*
*
* @param reportQualityInspection
* @return
*/
@ -45,7 +46,7 @@ public interface IReportQualityInspectionService
/**
*
*
*
* @param objIds
* @return
*/
@ -53,11 +54,17 @@ public interface IReportQualityInspectionService
/**
*
*
*
* @param objId
* @return
*/
public int deleteReportQualityInspectionByObjId(Long objId);
/**
* PDA
*
* @param reportQualityInspection
* @return
*/
public HashMap<String, Integer> pdaQueryQuantityNumber(String reportQualityInspection);
}

@ -1,6 +1,10 @@
package com.aucma.report.service.impl;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import com.aucma.common.utils.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.aucma.report.mapper.ReportQualityInspectionMapper;
@ -9,88 +13,94 @@ import com.aucma.report.service.IReportQualityInspectionService;
/**
* Service
*
*
* @author Yinq
* @date 2023-11-21
*/
@Service
public class ReportQualityInspectionServiceImpl implements IReportQualityInspectionService
{
public class ReportQualityInspectionServiceImpl implements IReportQualityInspectionService {
@Autowired
private ReportQualityInspectionMapper reportQualityInspectionMapper;
/**
*
*
*
* @param objId
* @return
*/
@Override
public ReportQualityInspection selectReportQualityInspectionByObjId(Long objId)
{
public ReportQualityInspection selectReportQualityInspectionByObjId(Long objId) {
return reportQualityInspectionMapper.selectReportQualityInspectionByObjId(objId);
}
/**
*
*
*
* @param reportQualityInspection
* @return
*/
@Override
public List<ReportQualityInspection> selectReportQualityInspectionList(ReportQualityInspection reportQualityInspection)
{
public List<ReportQualityInspection> selectReportQualityInspectionList(ReportQualityInspection reportQualityInspection) {
return reportQualityInspectionMapper.selectReportQualityInspectionList(reportQualityInspection);
}
/**
*
*
*
* @param reportQualityInspection
* @return
*/
@Override
public int insertReportQualityInspection(ReportQualityInspection reportQualityInspection)
{
public int insertReportQualityInspection(ReportQualityInspection reportQualityInspection) {
return reportQualityInspectionMapper.insertReportQualityInspection(reportQualityInspection);
}
/**
*
*
*
* @param reportQualityInspection
* @return
*/
@Override
public int updateReportQualityInspection(ReportQualityInspection reportQualityInspection)
{
public int updateReportQualityInspection(ReportQualityInspection reportQualityInspection) {
return reportQualityInspectionMapper.updateReportQualityInspection(reportQualityInspection);
}
/**
*
*
*
* @param objIds
* @return
*/
@Override
public int deleteReportQualityInspectionByObjIds(Long[] objIds)
{
public int deleteReportQualityInspectionByObjIds(Long[] objIds) {
return reportQualityInspectionMapper.deleteReportQualityInspectionByObjIds(objIds);
}
/**
*
*
*
* @param objId
* @return
*/
@Override
public int deleteReportQualityInspectionByObjId(Long objId)
{
public int deleteReportQualityInspectionByObjId(Long objId) {
return reportQualityInspectionMapper.deleteReportQualityInspectionByObjId(objId);
}
/**
* PDA
*
* @param stationCode
* @return
*/
@Override
public HashMap<String, Integer> pdaQueryQuantityNumber(String stationCode) {
if (StringUtils.isEmpty(stationCode)){
return new HashMap<>();
}
return reportQualityInspectionMapper.pdaQueryQuantityNumber(stationCode);
}
}

@ -98,6 +98,22 @@
<include refid="selectReportQualityInspectionVo"/>
where rqi.obj_id = #{objId}
</select>
<select id="pdaQueryQuantityNumber" resultType="java.util.HashMap" parameterType="String">
SELECT COUNT(*) QUANTITY_SUM, NVL(SUM(REPAIR_SUM),0) REPAIR_SUM
FROM (
WITH CTT AS (
SELECT MIN(START_TIME) START_TIME, MAX(END_TIME) END_TIME
FROM VIEW_CURRENT_TEAM_TIME
)
SELECT STATION_CODE, BAR_CODE, MAX(CASE WHEN TREATMENT_MEASURE = '1' THEN 1 ELSE 0 END) REPAIR_SUM
FROM REPORT_QUALITY_INSPECTION VPO
CROSS JOIN CTT
WHERE VPO.INSPECTOR_TIME >= CTT.START_TIME
AND VPO.INSPECTOR_TIME &lt; CTT.END_TIME
AND STATION_CODE = #{stationCode}
GROUP BY STATION_CODE, BAR_CODE
)
</select>
<insert id="insertReportQualityInspection" parameterType="ReportQualityInspection">
<selectKey keyProperty="objId" resultType="long" order="BEFORE">

Loading…
Cancel
Save