add - pda返修提交

master
wangh 11 months ago
parent 21c840b62a
commit 109c8ecccc

@ -1,6 +1,7 @@
package com.aucma.api.controller;
import com.aucma.api.domain.dto.CheckInfoDto;
import com.aucma.api.domain.dto.RepairSubmitInfoDto;
import com.aucma.api.service.IPdaBindingService;
import com.aucma.common.core.domain.AjaxResult;
import com.aucma.common.utils.StringUtils;
@ -41,10 +42,13 @@ public class PdaApiController {
//条码绑定
@PostMapping("/barCodeBanding")
public AjaxResult barCodeBanding(String boxCode, String innerCode, String loginName) {
// 查询质检缺陷有没有修复 还没做
// 查询质检缺陷有没有修复
int countQa = service.countQualityRecordByCode(boxCode);
if (countQa > 0) {
return error("返修中" + countQa + "条未处理,不允许绑定");
}
// 查询插入
// Long objid=service.select
return success();
return toAjax(service.updateCodeBinding(boxCode,innerCode));
}
@PostMapping("/selectGoodsName")
@ -63,10 +67,10 @@ public class PdaApiController {
@PostMapping("/checkSubmit")
public AjaxResult checkSubmit(@RequestBody CheckInfoDto checkInfo) {
List<CheckInfoDto.DefectBeen> list = checkInfo.getList();
// String boxName = service.selectBoxNameByCode(checkInfo.getCode());
// if (boxName==null) {
// return error("箱壳条码扫描错误");
// }
String boxName = service.selectBoxNameByCode(checkInfo.getCode());
if (boxName==null) {
return error("箱壳条码扫描错误");
}
int size = (list == null || list.isEmpty()) ? 1 : list.size();
for (int i = 0; i < size; i++) {
ReportQualityInspection inspection = new ReportQualityInspection();
@ -99,4 +103,16 @@ public class PdaApiController {
return success(list);
}
//返修提交质检信息
@PostMapping("/submitRepair")
public AjaxResult submitRepair(@RequestBody RepairSubmitInfoDto info) {
return toAjax(service.submitRepair(info));
}
private AjaxResult toAjax(int rows) {
return rows > 0 ? AjaxResult.success() : AjaxResult.error();
}
}

@ -0,0 +1,48 @@
package com.aucma.api.domain.dto;
import java.util.List;
/**
* @author wanghao
* @date 2023/12/4 15:05
*/
public class RepairSubmitInfoDto {
private List<Integer> list;
private String loginName;
private String repairName;
private int isFlag;
public List<Integer> getList() {
return list;
}
public void setList(List<Integer> list) {
this.list = list;
}
public String getLoginName() {
return loginName;
}
public void setLoginName(String loginName) {
this.loginName = loginName;
}
public String getRepairName() {
return repairName;
}
public void setRepairName(String repairName) {
this.repairName = repairName;
}
public int getIsFlag() {
return isFlag;
}
public void setIsFlag(int isFlag) {
this.isFlag = isFlag;
}
}

@ -1,5 +1,6 @@
package com.aucma.api.mapper;
import com.aucma.api.domain.dto.RepairSubmitInfoDto;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
@ -14,4 +15,10 @@ public interface PdaBindingMapper {
int insertBindingInfo(@Param("boxCode") String boxCode,
@Param("boxName") String boxName,
@Param("innerCode")String innerCode);
int countQualityRecordByCode(String code);
int updateCodeBinding(@Param("boxCode") String boxCode, @Param("innerCode")String innerCode);
int submitRepair(@Param("info")RepairSubmitInfoDto info);
}

@ -1,5 +1,7 @@
package com.aucma.api.service;
import com.aucma.api.domain.dto.RepairSubmitInfoDto;
/**
* @author wanghao
* @date 2023/11/14 9:56
@ -8,4 +10,10 @@ public interface IPdaBindingService {
String selectBoxNameByCode(String boxCode);
int insertBindingInfo(String boxCode, String boxName, String innerCode);
int countQualityRecordByCode(String code);
int updateCodeBinding(String boxCode, String innerCode);
int submitRepair(RepairSubmitInfoDto info);
}

@ -1,5 +1,6 @@
package com.aucma.api.service.impl;
import com.aucma.api.domain.dto.RepairSubmitInfoDto;
import com.aucma.api.mapper.PdaBindingMapper;
import com.aucma.api.service.IPdaBindingService;
import org.springframework.beans.factory.annotation.Autowired;
@ -25,5 +26,18 @@ public class PdaServiceImpl implements IPdaBindingService {
return mapper.insertBindingInfo(boxCode,boxName,innerCode);
}
@Override
public int countQualityRecordByCode(String code) {
return mapper.countQualityRecordByCode(code);
}
@Override
public int updateCodeBinding(String boxCode, String innerCode) {
return mapper.updateCodeBinding(boxCode,innerCode);
}
@Override
public int submitRepair(RepairSubmitInfoDto info) {
return mapper.submitRepair(info);
}
}

@ -10,9 +10,32 @@
</select>
<insert id="insertBindingInfo">
INSERT INTO AUCMA_SCADA.CODE_BINDING
(OBJ_ID, BOX_CODE, BOX_NAME, LINER_CODE, BINDING_RESULT, RECORD_TIME1)
INSERT INTO AUCMA_SCADA.CODE_BINDING(OBJ_ID, BOX_CODE, BOX_NAME, LINER_CODE, BINDING_RESULT, RECORD_TIME1)
VALUES (AUCMA_SCADA.SEQ_CODE_BINDING.nextval, #{boxCode}, #{boxName}, #{innerCode}, '成功', SYSDATE)
</insert>
<update id="updateCodeBinding">
UPDATE AUCMA_SCADA.CODE_BINDING
SET PRODUCT_CODE = #{innerCode}, BINDING_RESULT = '成功',RECORD_TIME2 = SYSDATE,IS_PASS= 1
where BOX_CODE = #{boxCode}
</update>
<select id="countQualityRecordByCode" resultType="int">
select count(OBJ_ID)
from AUCMA_MES.REPORT_QUALITY_INSPECTION
where BAR_CODE = #{code} and IS_FLAG !=1
</select>
<update id="submitRepair" parameterType="com.aucma.api.domain.dto.RepairSubmitInfoDto">
UPDATE AUCMA_MES.REPORT_QUALITY_INSPECTION
SET PROCESS_RESULT = #{info.repairName},
REWORK_NUMBER = 1,
FINISH_TIME = sysdate,
IS_FLAG = #{info.isFlag},
UPDATED_BY = #{info.loginName},
UPDATED_TIME = sysdate
WHERE OBJ_ID in
<foreach item="objId" collection="info.list" open="(" separator="," close=")">
#{objId}
</foreach>
</update>
</mapper>

@ -170,10 +170,12 @@
<select id="findCheckInfoByCode" resultMap="ReportQualityInspectionResult">
select OBJ_ID,
MATERIAL_NAME,
QUALITY_DEFECT_CODE,
QUALITY_DEFECT_NAME
from AUCMA_MES.REPORT_QUALITY_INSPECTION
where BAR_CODE = #{code}
and PROCESS_RESULT is null
and IS_FLAG is null
</select>
</mapper>
Loading…
Cancel
Save