标准箱修试入库接口开发

This commit is contained in:
bonus 2025-06-15 14:00:10 +08:00
parent e51cbaf4bc
commit 2a17bb2201
6 changed files with 86 additions and 9 deletions

View File

@ -181,4 +181,8 @@ public class RepairInputDetails extends BaseEntity {
@ApiModelProperty(value = "app维修任务状态1 进行中 1已审核包含通过和驳回") @ApiModelProperty(value = "app维修任务状态1 进行中 1已审核包含通过和驳回")
private Integer appTaskStatus; private Integer appTaskStatus;
private String boxCode;
private String boxId;
} }

View File

@ -190,5 +190,18 @@ public class RepairInputDetailsController extends BaseController {
} }
} }
/**
* 修试入库二维码标准箱扫描
*/
@ApiOperation(value = "修试入库二维码标准箱扫描")
@PreventRepeatSubmit
@SysLog(title = "修试入库二维码标准箱扫描", businessType = OperaType.UPDATE, logType = 1,module = "修试入库->增加库存")
@PostMapping("/sanQrBoxInput")
public AjaxResult sanQrBoxInput(@RequestBody RepairInputDetails repairInputDetails) {
try {
return toAjax(repairInputDetailsService.sanQrBoxInput(repairInputDetails));
} catch (Exception e) {
return error("系统错误, " + e.getMessage());
}
}
} }

View File

@ -141,4 +141,8 @@ public interface RepairInputDetailsMapper {
int updateTaskStatus(RepairInputDetails inputApplyDetails); int updateTaskStatus(RepairInputDetails inputApplyDetails);
List<RepairInputDetails> selectInputTaskStatus(RepairInputDetails inputApplyDetails); List<RepairInputDetails> selectInputTaskStatus(RepairInputDetails inputApplyDetails);
List<RepairInputDetails> selectRepairListByBoxId(String qrCode);
int updateBoxStatus(String qrCode, int i);
} }

View File

@ -92,4 +92,6 @@ public interface IRepairInputDetailsService {
AjaxResult getInfoByQrcode(BmQrcodeInfo bmQrcodeInfo); AjaxResult getInfoByQrcode(BmQrcodeInfo bmQrcodeInfo);
int sanInput(RepairInputDetails repairInputDetails); int sanInput(RepairInputDetails repairInputDetails);
int sanQrBoxInput(RepairInputDetails repairInputDetails);
} }

View File

@ -757,6 +757,53 @@ public class RepairInputDetailsServiceImpl implements IRepairInputDetailsService
return result; return result;
} }
@Override
@Transactional(rollbackFor = Exception.class)
public int sanQrBoxInput(RepairInputDetails repairInputDetails) {
int result = 0;
try {
//0查询二维码标准箱绑定的机具
List<RepairInputDetails> boxList = repairInputDetailsMapper.selectRepairListByBoxId(repairInputDetails.getQrCode());
//1查询入参设备是否为待入库设备
for(RepairInputDetails box : boxList){
RepairInputDetails inputInfo = checkMachineStatus(box.getQrCode());
if(inputInfo ==null){
throw new ServiceException("设备不是修试后待入库状态");
}
//2更新入库设备数量
result = updateInputNum(inputInfo);
if(result <= 0){
throw new ServiceException("更新入库数量失败");
}
//3更新库存数量
result = updateStorageNum(inputInfo);
if(result <= 0){
throw new ServiceException("更新库存数量失败");
}
//4更新任务状态
result = updateRTaskStatus(inputInfo);
if(result <= 0){
throw new ServiceException("更新任务状态失败");
}
}
//5修改标准箱状态
result = updateBoxStatus(repairInputDetails.getQrCode());
} catch (Exception e) {
throw new ServiceException("系统错误, " + e.getMessage());
}
return result;
}
private int updateBoxStatus(String qrCode) {
int result = 0;
result = repairInputDetailsMapper.updateBoxStatus(qrCode, 6);
return result;
}
private int updateRTaskStatus(RepairInputDetails inputApplyDetails) { private int updateRTaskStatus(RepairInputDetails inputApplyDetails) {
int result = 0; int result = 0;

View File

@ -464,13 +464,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select> </select>
<select id="selectRepairListByBoxId" resultMap="RepairInputDetailsResult">
SELECT
bbb.box_id AS boxId,
bbb.ma_id as maId,
mm.qr_code as qrCode
FROM
bm_qrcode_box bqb
LEFT JOIN bm_qrcode_box_bind bbb on bqb.box_id = bbb.box_id
LEFT JOIN ma_machine mm on bbb.ma_id = mm.ma_id
WHERE bqb.box_code = #{boxCode}
</select>
<update id="updateBoxStatus">
update bm_qrcode_box set box_status = 6
where box_code = #{boxCode}
</update>
</mapper> </mapper>