标准箱修试入库接口开发
This commit is contained in:
parent
e51cbaf4bc
commit
2a17bb2201
|
|
@ -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;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue