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

master
yinq 2 years 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.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;
import com.aucma.report.service.IMaterialCompletionService;
import com.aucma.report.service.IReportQualityInspectionService; 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.Date;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
@ -33,6 +35,12 @@ public class PdaApiController {
@Autowired @Autowired
private IBaseProcessStationService baseProcessStationService; private IBaseProcessStationService baseProcessStationService;
@Autowired
private IMaterialCompletionService completionService;
@Autowired
private IReportQualityInspectionService qualityService;
//壳胆绑定-提交 //壳胆绑定-提交
@PostMapping("/boxBanding") @PostMapping("/boxBanding")
public AjaxResult binding(String boxCode, String innerCode, String loginName) { public AjaxResult binding(String boxCode, String innerCode, String loginName) {
@ -65,8 +73,6 @@ public class PdaApiController {
return success("操作成功", boxName); return success("操作成功", boxName);
} }
@Autowired
private IReportQualityInspectionService qualityService;
// 质检查询名称、前工位返修数据 // 质检查询名称、前工位返修数据
@PostMapping("/check/select") @PostMapping("/check/select")
@ -74,7 +80,7 @@ public class PdaApiController {
String boxName = service.selectBoxNameByCode(code); String boxName = service.selectBoxNameByCode(code);
if (boxName == null) { if (boxName == null) {
// boxName = "固定数据"; // boxName = "固定数据";
return error("箱壳条码扫描错误"); return error("箱壳条码扫描错误");
} }
List<ReportQualityInspection> list = service.checkSelectRepairInfo(code); List<ReportQualityInspection> list = service.checkSelectRepairInfo(code);
return success(boxName, list); return success(boxName, list);
@ -95,14 +101,18 @@ public class PdaApiController {
inspection.setMaterialName(checkInfo.getName()); inspection.setMaterialName(checkInfo.getName());
String measure = checkInfo.getMeasure(); String measure = checkInfo.getMeasure();
inspection.setTreatmentMeasure(measure); inspection.setTreatmentMeasure(measure);
if (measure.equals("3")){ inspection.setIsFlag(1L);} if (measure.equals("3")) {
inspection.setIsFlag(1L);
}
//检测人 //检测人
inspection.setInspectorCode(checkInfo.getUserName()); inspection.setInspectorCode(checkInfo.getUserName());
// inspection.setInspectorCode(SecurityUtils.getUsername());
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 { try {
// 查质检工序
BaseProcessStation processStation = new BaseProcessStation(); BaseProcessStation processStation = new BaseProcessStation();
processStation.setParentId(checkInfo.getStationCode()); processStation.setParentId(checkInfo.getStationCode());
List<BaseProcessStation> processStations = baseProcessStationService.selectBaseProcessStationList(processStation); List<BaseProcessStation> processStations = baseProcessStationService.selectBaseProcessStationList(processStation);
@ -120,6 +130,14 @@ public class PdaApiController {
inspection.setQualityDefectName(list.get(i).getQualityDefectName()); inspection.setQualityDefectName(list.get(i).getQualityDefectName());
} }
qualityService.insertReportQualityInspection(inspection); qualityService.insertReportQualityInspection(inspection);
//质检处理措施3=合格,1=返修)
if (inspection.getTreatmentMeasure().equals("3")) {
try {
completionService.inspectionProcessing(inspection);
} catch (Exception e) {
e.printStackTrace();
}
}
} }
return success(); return success();
@ -146,4 +164,15 @@ public class PdaApiController {
return rows > 0 ? AjaxResult.success() : AjaxResult.error(); 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"))); 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.setWorkCenterCode(map.get("ARBPL"));
baseOrderInfo.setRoutingCode(map.get("AUFPL")); baseOrderInfo.setRoutingCode(map.get("AUFPL"));
baseOrderInfo.setBeginDate(new SimpleDateFormat("yyyy-MM-dd").parse(map.get("GSTRP"))); 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, "/report/repairMeasures/getRepairMeasures").permitAll()
.antMatchers(HttpMethod.GET, "/base/teamMembers/**").permitAll() .antMatchers(HttpMethod.GET, "/base/teamMembers/**").permitAll()
.antMatchers(HttpMethod.POST, "/webApi/electricalInspection").permitAll() .antMatchers(HttpMethod.POST, "/webApi/electricalInspection").permitAll()
.antMatchers(HttpMethod.POST, "/api/**").permitAll()
.antMatchers(HttpMethod.POST, "/**/**/**").permitAll() .antMatchers(HttpMethod.POST, "/**/**/**").permitAll()
.antMatchers(HttpMethod.GET, "/**/**/**").permitAll() .antMatchers(HttpMethod.GET, "/**/**/**").permitAll()
// 除上面外的所有请求全部需要鉴权认证 // 除上面外的所有请求全部需要鉴权认证

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

@ -1,19 +1,20 @@
package com.aucma.report.service; package com.aucma.report.service;
import java.util.HashMap;
import java.util.List; import java.util.List;
import com.aucma.report.domain.ReportQualityInspection; import com.aucma.report.domain.ReportQualityInspection;
/** /**
* Service * Service
* *
* @author Yinq * @author Yinq
* @date 2023-11-21 * @date 2023-11-21
*/ */
public interface IReportQualityInspectionService public interface IReportQualityInspectionService {
{
/** /**
* *
* *
* @param objId * @param objId
* @return * @return
*/ */
@ -21,7 +22,7 @@ public interface IReportQualityInspectionService
/** /**
* *
* *
* @param reportQualityInspection * @param reportQualityInspection
* @return * @return
*/ */
@ -29,7 +30,7 @@ public interface IReportQualityInspectionService
/** /**
* *
* *
* @param reportQualityInspection * @param reportQualityInspection
* @return * @return
*/ */
@ -37,7 +38,7 @@ public interface IReportQualityInspectionService
/** /**
* *
* *
* @param reportQualityInspection * @param reportQualityInspection
* @return * @return
*/ */
@ -45,7 +46,7 @@ public interface IReportQualityInspectionService
/** /**
* *
* *
* @param objIds * @param objIds
* @return * @return
*/ */
@ -53,11 +54,17 @@ public interface IReportQualityInspectionService
/** /**
* *
* *
* @param objId * @param objId
* @return * @return
*/ */
public int deleteReportQualityInspectionByObjId(Long objId); 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; package com.aucma.report.service.impl;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
import com.aucma.common.utils.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.aucma.report.mapper.ReportQualityInspectionMapper; import com.aucma.report.mapper.ReportQualityInspectionMapper;
@ -9,88 +13,94 @@ import com.aucma.report.service.IReportQualityInspectionService;
/** /**
* Service * Service
* *
* @author Yinq * @author Yinq
* @date 2023-11-21 * @date 2023-11-21
*/ */
@Service @Service
public class ReportQualityInspectionServiceImpl implements IReportQualityInspectionService public class ReportQualityInspectionServiceImpl implements IReportQualityInspectionService {
{
@Autowired @Autowired
private ReportQualityInspectionMapper reportQualityInspectionMapper; private ReportQualityInspectionMapper reportQualityInspectionMapper;
/** /**
* *
* *
* @param objId * @param objId
* @return * @return
*/ */
@Override @Override
public ReportQualityInspection selectReportQualityInspectionByObjId(Long objId) public ReportQualityInspection selectReportQualityInspectionByObjId(Long objId) {
{
return reportQualityInspectionMapper.selectReportQualityInspectionByObjId(objId); return reportQualityInspectionMapper.selectReportQualityInspectionByObjId(objId);
} }
/** /**
* *
* *
* @param reportQualityInspection * @param reportQualityInspection
* @return * @return
*/ */
@Override @Override
public List<ReportQualityInspection> selectReportQualityInspectionList(ReportQualityInspection reportQualityInspection) public List<ReportQualityInspection> selectReportQualityInspectionList(ReportQualityInspection reportQualityInspection) {
{
return reportQualityInspectionMapper.selectReportQualityInspectionList(reportQualityInspection); return reportQualityInspectionMapper.selectReportQualityInspectionList(reportQualityInspection);
} }
/** /**
* *
* *
* @param reportQualityInspection * @param reportQualityInspection
* @return * @return
*/ */
@Override @Override
public int insertReportQualityInspection(ReportQualityInspection reportQualityInspection) public int insertReportQualityInspection(ReportQualityInspection reportQualityInspection) {
{
return reportQualityInspectionMapper.insertReportQualityInspection(reportQualityInspection); return reportQualityInspectionMapper.insertReportQualityInspection(reportQualityInspection);
} }
/** /**
* *
* *
* @param reportQualityInspection * @param reportQualityInspection
* @return * @return
*/ */
@Override @Override
public int updateReportQualityInspection(ReportQualityInspection reportQualityInspection) public int updateReportQualityInspection(ReportQualityInspection reportQualityInspection) {
{
return reportQualityInspectionMapper.updateReportQualityInspection(reportQualityInspection); return reportQualityInspectionMapper.updateReportQualityInspection(reportQualityInspection);
} }
/** /**
* *
* *
* @param objIds * @param objIds
* @return * @return
*/ */
@Override @Override
public int deleteReportQualityInspectionByObjIds(Long[] objIds) public int deleteReportQualityInspectionByObjIds(Long[] objIds) {
{
return reportQualityInspectionMapper.deleteReportQualityInspectionByObjIds(objIds); return reportQualityInspectionMapper.deleteReportQualityInspectionByObjIds(objIds);
} }
/** /**
* *
* *
* @param objId * @param objId
* @return * @return
*/ */
@Override @Override
public int deleteReportQualityInspectionByObjId(Long objId) public int deleteReportQualityInspectionByObjId(Long objId) {
{
return reportQualityInspectionMapper.deleteReportQualityInspectionByObjId(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"/> <include refid="selectReportQualityInspectionVo"/>
where rqi.obj_id = #{objId} where rqi.obj_id = #{objId}
</select> </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"> <insert id="insertReportQualityInspection" parameterType="ReportQualityInspection">
<selectKey keyProperty="objId" resultType="long" order="BEFORE"> <selectKey keyProperty="objId" resultType="long" order="BEFORE">

Loading…
Cancel
Save