Merge remote-tracking branch 'origin/master'

This commit is contained in:
mashuai 2024-12-27 09:32:13 +08:00
commit badc7cd064
1 changed files with 72 additions and 71 deletions

View File

@ -33,11 +33,13 @@ import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.math.BigDecimal;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.util.*;
import java.util.stream.Collectors;
/**
* @Author ma_sh
* @author ma_sh
* @create 2024/12/10 17:26
*/
@Service
@ -61,7 +63,7 @@ public class BmQrBoxServiceImpl implements BmQrBoxService {
*/
@Override
public List<BmQrBoxInfo> selectBmQrBoxInfoList(BmQrBoxInfo bmQrBoxInfo) {
if (bmQrBoxInfo.getStatus() != null) {
if (null != bmQrBoxInfo.getStatus()) {
bmQrBoxInfo.setStatusList(Arrays.asList(bmQrBoxInfo.getStatus().split(",")));
}
return bmQrBoxMapper.find(bmQrBoxInfo);
@ -73,12 +75,12 @@ public class BmQrBoxServiceImpl implements BmQrBoxService {
@Override
public AjaxResult insertBmQrcodeInfo(BmQrBoxInfo bmQrBoxInfo) {
//生成二维码
String code = "BOX-" + DateTimeHelper.getNowTimeFomart();
final String code = "BOX-" + DateTimeHelper.getNowTimeFomart();
bmQrBoxInfo.setBoxCode(code);
bmQrBoxInfo.setCreateBy(SecurityUtils.getUsername());
bmQrBoxInfo.setCreateTime(DateUtils.getNowDate());
int result = bmQrBoxMapper.insertBmQrcodeInfo(bmQrBoxInfo);
return result > 0 ? AjaxResult.success(HttpCodeEnum.SUCCESS.getMsg()) : AjaxResult.error(HttpCodeEnum.FAIL.getCode(), HttpCodeEnum.FAIL.getMsg());
final int result = bmQrBoxMapper.insertBmQrcodeInfo(bmQrBoxInfo);
return 0 < result ? AjaxResult.success(HttpCodeEnum.SUCCESS.getMsg()) : AjaxResult.error(HttpCodeEnum.FAIL.getCode(), HttpCodeEnum.FAIL.getMsg());
}
/**
@ -88,17 +90,17 @@ public class BmQrBoxServiceImpl implements BmQrBoxService {
*/
@Override
public AjaxResult getBoxInfoBindListByCode(BmQrBoxInfo bmQrBoxInfo) {
if (bmQrBoxInfo.getBoxCode() == null) {
if (null == bmQrBoxInfo.getBoxCode()) {
return AjaxResult.error(HttpCodeEnum.FAIL.getCode(), "请输入标准箱编码");
}
BoxInfoBindVo boxInfoBindVo = new BoxInfoBindVo();
final BoxInfoBindVo boxInfoBindVo = new BoxInfoBindVo();
List<BmQrBoxInfo> boxInfos = bmQrBoxMapper.findBoxInfoByKey(bmQrBoxInfo);
final List<BmQrBoxInfo> boxInfos = bmQrBoxMapper.findBoxInfoByKey(bmQrBoxInfo);
boxInfos.removeIf(Objects::isNull);
if (boxInfos.isEmpty()) {
return AjaxResult.error(HttpCodeEnum.FAIL.getCode(), "标准箱编码不存在");
} else if (boxInfos.size() == 1) {
if (boxInfos.get(0).getBoxId() == null || boxInfos.get(0).getBoxCode() == null) {
} else if (1 == boxInfos.size()) {
if (null == boxInfos.get(0).getBoxId() || null == boxInfos.get(0).getBoxCode()) {
return AjaxResult.error(HttpCodeEnum.FAIL.getCode(), "标准箱信息异常,请联系运维人员处理");
}
boxInfoBindVo.setBoxId(boxInfos.get(0).getBoxId());
@ -107,13 +109,13 @@ public class BmQrBoxServiceImpl implements BmQrBoxService {
return AjaxResult.warn("该二维码已绑定多个标准箱,请联系运维人员处理");
}
List<BmQrBoxInfo> boxBindList = bmQrBoxMapper.getBoxBindList(boxInfoBindVo.getBoxId());
final List<BmQrBoxInfo> boxBindList = bmQrBoxMapper.getBoxBindList(boxInfoBindVo.getBoxId());
boxBindList.removeIf(Objects::isNull);
boxInfoBindVo.setBindMaTotal(boxBindList.size());
boxBindList.removeIf(item -> item.getMaStatus() == null);
boxBindList.removeIf(item -> null == item.getMaStatus());
boxBindList.removeIf(item -> !item.getMaStatus().equals(MaMachineStatusEnum.NEW_PURCHASE.getStatusName()));
if (Objects.nonNull(bmQrBoxInfo.getMaTypeId())) {
boxBindList.removeIf(item -> item.getMaTypeId() == null || !Objects.equals(item.getMaTypeId(), bmQrBoxInfo.getMaTypeId()));
boxBindList.removeIf(item -> null == item.getMaTypeId() || !Objects.equals(item.getMaTypeId(), bmQrBoxInfo.getMaTypeId()));
}
boxInfoBindVo.setSuccessMaTotal(boxBindList.size());
return AjaxResult.success(boxInfoBindVo);
@ -127,18 +129,18 @@ public class BmQrBoxServiceImpl implements BmQrBoxService {
@Override
public AjaxResult appWarehouse(BoxBindWarehouseDto boxBindWarehouseDto) {
// -------------- 标准箱状态校验 -------------------------
if (boxBindWarehouseDto.getBoxCode() == null) {
if (null == boxBindWarehouseDto.getBoxCode()) {
return AjaxResult.error(HttpCodeEnum.FAIL.getCode(), "请输入标准箱编码");
}
if (boxBindWarehouseDto.getTaskId() == null || boxBindWarehouseDto.getMaTypeId() == null) {
if (null == boxBindWarehouseDto.getTaskId() || null == boxBindWarehouseDto.getMaTypeId()) {
return AjaxResult.error(HttpCodeEnum.FAIL.getCode(), "请输入任务ID和入库的物资类型ID");
}
List<BmQrBoxInfo> boxInfos = bmQrBoxMapper.findBoxInfoByKey(new BmQrBoxInfo().setBoxCode(boxBindWarehouseDto.getBoxCode()));
final List<BmQrBoxInfo> boxInfos = bmQrBoxMapper.findBoxInfoByKey(new BmQrBoxInfo().setBoxCode(boxBindWarehouseDto.getBoxCode()));
boxInfos.removeIf(Objects::isNull);
if (boxInfos.isEmpty()) {
return AjaxResult.error(HttpCodeEnum.FAIL.getCode(), "标准箱编码不存在");
} else if (boxInfos.size() == 1) {
if (boxInfos.get(0).getBoxId() == null || boxInfos.get(0).getBoxCode() == null) {
} else if (1 == boxInfos.size()) {
if (null == boxInfos.get(0).getBoxId() || null == boxInfos.get(0).getBoxCode()) {
boxBindWarehouseDto.setBoxId(boxInfos.get(0).getBoxId());
return AjaxResult.error(HttpCodeEnum.FAIL.getCode(), "标准箱信息异常,请联系运维人员处理");
}
@ -147,20 +149,20 @@ public class BmQrBoxServiceImpl implements BmQrBoxService {
}
// -------------- 标准箱绑定的机具明细校验 -------------------------
List<BmQrBoxInfo> boxBindList = bmQrBoxMapper.getBoxBindList(boxBindWarehouseDto.getBoxId());
final List<BmQrBoxInfo> boxBindList = bmQrBoxMapper.getBoxBindList(boxBindWarehouseDto.getBoxId());
boxBindList.removeIf(Objects::isNull);
boxBindList.removeIf(item -> item.getMaStatus() == null);
boxBindList.removeIf(item -> null == item.getMaStatus());
boxBindList.removeIf(item ->
!item.getMaStatus().equals(MaMachineStatusEnum.NEW_PURCHASE.getStatusName()) &&
!item.getMaStatus().equals(MaMachineStatusEnum.REPAIR_TO_STORE.getStatusName()) &&
!item.getMaStatus().equals(MaMachineStatusEnum.BACK_TO_STORE.getStatusName())
);
boxBindList.removeIf(item -> item.getMaTypeId() == null || !Objects.equals(item.getMaTypeId(), boxBindWarehouseDto.getMaTypeId()));
boxBindList.removeIf(item -> null == item.getMaTypeId() || !Objects.equals(item.getMaTypeId(), boxBindWarehouseDto.getMaTypeId()));
// ----------------- 进行入库操作 -------------------------------
Long purchaseDetailId = purchaseStorageMapper.selectIdByTaskId(boxBindWarehouseDto.getTaskId(), boxBindWarehouseDto.getMaTypeId());
if (purchaseDetailId == null || purchaseDetailId == 0) {
final Long purchaseDetailId = purchaseStorageMapper.selectIdByTaskId(boxBindWarehouseDto.getTaskId(), boxBindWarehouseDto.getMaTypeId());
if (null == purchaseDetailId || 0 == purchaseDetailId) {
return AjaxResult.error(HttpCodeEnum.FAIL.getCode(), "新购任务不存在此物资类型,请确认录入是否正确");
}
// 更新入库数量
@ -187,20 +189,20 @@ public class BmQrBoxServiceImpl implements BmQrBoxService {
@Override
public void download(BmQrBoxInfo bmQrBoxInfo, HttpServletResponse response) {
try {
List<BmQrBoxInfo> list = bmQrBoxMapper.find(bmQrBoxInfo);
final List<BmQrBoxInfo> list = bmQrBoxMapper.find(bmQrBoxInfo);
String code = "无编码";
if (list.size() > 0) {
if (!list.isEmpty()) {
code = list.get(0).getBoxCode();
}
// 新购管理-二维码打印-新增
String url = BackstageApplication.getUrl() + "backstage/machine/qrCodePage?qrcode=" + code;
final String url = BackstageApplication.getUrl() + "backstage/machine/qrCodePage?qrcode=" + code;
// 二维码的图片格式
String format = "jpg";
final String format = "jpg";
//设置路径
String mkdirsName = "images";
final String mkdirsName = "images";
// linux 系统路径
String saveDirectory = "/data/imw/" + mkdirsName + "/";
String os = System.getProperty("os.name");
final String os = System.getProperty("os.name");
if (os.toLowerCase().startsWith("win")) {
//本地路径
saveDirectory = "D://files/" + mkdirsName + "/";
@ -214,22 +216,22 @@ public class BmQrBoxServiceImpl implements BmQrBoxService {
String qrUrl = saveDirectory + code + ".jpg";
String path = qrUrl.replace("filePath", "/data/imw");
// 判断照片是否存在
File imageFile = new File(path);
final File imageFile = new File(path);
if (!imageFile.exists()) {
log.warn("图片不存在");
}
//设置MIME类型
response.setContentType("application/octet-stream");
response.addHeader("Content-disposition", "attachment;filename=" + new String(path.getBytes(), "ISO-8859-1"));
InputStream inputStream = new FileInputStream(imageFile);
ServletOutputStream outputStream = response.getOutputStream();
byte[] bs = new byte[1024];
while ((inputStream.read(bs) > 0)) {
response.addHeader("Content-disposition", "attachment;filename=" + new String(path.getBytes(), StandardCharsets.ISO_8859_1));
final InputStream inputStream = Files.newInputStream(imageFile.toPath());
final ServletOutputStream outputStream = response.getOutputStream();
final byte[] bs = new byte[1024];
while ((0 < inputStream.read(bs))) {
outputStream.write(bs);
}
outputStream.close();
inputStream.close();
} catch (Exception e) {
} catch (final Exception e) {
log.error(e.getMessage());
}
}
@ -241,8 +243,8 @@ public class BmQrBoxServiceImpl implements BmQrBoxService {
public AjaxResult updateBmQrcodeInfo(BmQrBoxInfo bmQrBoxInfo) {
bmQrBoxInfo.setUpdateBy(SecurityUtils.getUsername());
bmQrBoxInfo.setUpdateTime(DateUtils.getNowDate());
int result = bmQrBoxMapper.updateBmQrcodeInfoById(bmQrBoxInfo);
return result > 0 ? AjaxResult.success(HttpCodeEnum.SUCCESS.getMsg()) : AjaxResult.error(HttpCodeEnum.FAIL.getCode(), HttpCodeEnum.FAIL.getMsg());
final int result = bmQrBoxMapper.updateBmQrcodeInfoById(bmQrBoxInfo);
return 0 < result ? AjaxResult.success(HttpCodeEnum.SUCCESS.getMsg()) : AjaxResult.error(HttpCodeEnum.FAIL.getCode(), HttpCodeEnum.FAIL.getMsg());
}
/**
@ -252,11 +254,11 @@ public class BmQrBoxServiceImpl implements BmQrBoxService {
*/
@Override
public AjaxResult appTransfer(BmQrBoxInfo bmQrBoxInfo) {
if (bmQrBoxInfo.getTransferUser() == null || bmQrBoxInfo.getTransferUser() <= 0) {
if (null == bmQrBoxInfo.getTransferUser() || 0 >= bmQrBoxInfo.getTransferUser()) {
return AjaxResult.error(HttpCodeEnum.FAIL.getCode(), "请选择移交人");
}
bmQrBoxInfo.setBoxCode(null).setBoxName(null).setBoxType(null).setStatus(QrBoxStatusEnum.QR_BOX_STATUS_WAIT_RECEIVE.getStatus().toString());
return bmQrBoxMapper.updateBmQrcodeInfoById(bmQrBoxInfo) > 0 ? AjaxResult.success(HttpCodeEnum.SUCCESS.getMsg()) :
return 0 < bmQrBoxMapper.updateBmQrcodeInfoById(bmQrBoxInfo) ? AjaxResult.success(HttpCodeEnum.SUCCESS.getMsg()) :
AjaxResult.error(HttpCodeEnum.FAIL.getCode(), HttpCodeEnum.FAIL.getMsg());
}
@ -267,17 +269,17 @@ public class BmQrBoxServiceImpl implements BmQrBoxService {
*/
@Override
public AjaxResult appTransferReject(BmQrBoxInfo bmQrBoxInfo) {
List<BmQrBoxInfo> bmQrBoxInfos = bmQrBoxMapper.find(new BmQrBoxInfo().setBoxId(bmQrBoxInfo.getBoxId()));
final List<BmQrBoxInfo> bmQrBoxInfos = bmQrBoxMapper.find(new BmQrBoxInfo().setBoxId(bmQrBoxInfo.getBoxId()));
if (!bmQrBoxInfos.isEmpty()) {
BmQrBoxInfo item = bmQrBoxInfos.get(0);
if (item.getTransferUser() == null || !Objects.equals(item.getTransferUser(), SecurityUtils.getUserId())) {
final BmQrBoxInfo item = bmQrBoxInfos.get(0);
if (null == item.getTransferUser() || !Objects.equals(item.getTransferUser(), SecurityUtils.getUserId())) {
return AjaxResult.error(HttpCodeEnum.FAIL.getCode(), "驳回失败,您并非接收人,无法操作驳回!");
}
} else {
return AjaxResult.error(HttpCodeEnum.FAIL.getCode(), "驳回失败,无此标准箱信息!");
}
bmQrBoxInfo.setBoxCode(null).setBoxName(null).setBoxType(null).setStatus(QrBoxStatusEnum.QR_BOX_STATUS_REJECT.getStatus().toString());
return bmQrBoxMapper.updateBmQrcodeInfoById(bmQrBoxInfo) > 0 ?
return 0 < bmQrBoxMapper.updateBmQrcodeInfoById(bmQrBoxInfo) ?
AjaxResult.success(HttpCodeEnum.SUCCESS.getMsg()) :
AjaxResult.error(HttpCodeEnum.FAIL.getCode(), HttpCodeEnum.FAIL.getMsg());
}
@ -289,10 +291,10 @@ public class BmQrBoxServiceImpl implements BmQrBoxService {
*/
@Override
public AjaxResult appReceive(BmQrBoxInfo bmQrBoxInfo) {
List<BmQrBoxInfo> bmQrBoxInfos = bmQrBoxMapper.find(new BmQrBoxInfo().setBoxId(bmQrBoxInfo.getBoxId()));
final List<BmQrBoxInfo> bmQrBoxInfos = bmQrBoxMapper.find(new BmQrBoxInfo().setBoxId(bmQrBoxInfo.getBoxId()));
if (!bmQrBoxInfos.isEmpty()) {
BmQrBoxInfo item = bmQrBoxInfos.get(0);
if (item.getTransferUser() == null || !Objects.equals(item.getTransferUser(), SecurityUtils.getUserId())) {
final BmQrBoxInfo item = bmQrBoxInfos.get(0);
if (null == item.getTransferUser() || !Objects.equals(item.getTransferUser(), SecurityUtils.getUserId())) {
return AjaxResult.error(HttpCodeEnum.FAIL.getCode(), "接收失败,当前操作非移交人,无法接收!");
}
} else {
@ -301,7 +303,7 @@ public class BmQrBoxServiceImpl implements BmQrBoxService {
bmQrBoxInfo.setBoxCode(null).setBoxName(null).setBoxType(null)
.setInputUser(SecurityUtils.getUserId())
.setStatus(QrBoxStatusEnum.QR_BOX_STATUS_ON_RECEIVE.getStatus().toString());
return bmQrBoxMapper.updateBmQrcodeInfoById(bmQrBoxInfo) > 0 ?
return 0 < bmQrBoxMapper.updateBmQrcodeInfoById(bmQrBoxInfo) ?
AjaxResult.success(HttpCodeEnum.SUCCESS.getMsg()) :
AjaxResult.error(HttpCodeEnum.FAIL.getCode(), HttpCodeEnum.FAIL.getMsg());
}
@ -316,8 +318,8 @@ public class BmQrBoxServiceImpl implements BmQrBoxService {
bmQrBoxInfo.setUpdateBy(SecurityUtils.getUsername());
bmQrBoxInfo.setUpdateTime(DateUtils.getNowDate());
bmQrBoxInfo.setStatus(QrBoxStatusEnum.QR_BOX_STATUS_WAIT_BIND.getStatus().toString());
int result = bmQrBoxMapper.updateBmQrcodeInfoByCode(bmQrBoxInfo);
return result > 0 ? AjaxResult.success(HttpCodeEnum.SUCCESS.getMsg()) : AjaxResult.error(HttpCodeEnum.FAIL.getCode(), HttpCodeEnum.FAIL.getMsg());
final int result = bmQrBoxMapper.updateBmQrcodeInfoByCode(bmQrBoxInfo);
return 0 < result ? AjaxResult.success(HttpCodeEnum.SUCCESS.getMsg()) : AjaxResult.error(HttpCodeEnum.FAIL.getCode(), HttpCodeEnum.FAIL.getMsg());
}
/**
@ -340,16 +342,16 @@ public class BmQrBoxServiceImpl implements BmQrBoxService {
*/
@Override
public AjaxResult addQrcodeBoxBind(BmQrBoxInfo bmQrBoxInfo) {
if (bmQrBoxInfo.getBoxId() == null) {return AjaxResult.error("标准箱ID为空请完善后重试!");}
if (bmQrBoxInfo.getQrCode() == null) {return AjaxResult.error("QR编码为空请完善后重试!");}
if (null == bmQrBoxInfo.getBoxId()) {return AjaxResult.error("标准箱ID为空请完善后重试!");}
if (null == bmQrBoxInfo.getQrCode()) {return AjaxResult.error("QR编码为空请完善后重试!");}
try {
// 物资状态要求是待入库在库状态
MachineVo machineVo = machineMapper.selectMachineByMaCode(bmQrBoxInfo.getQrCode());
if (machineVo == null || machineVo.getMaId() == null) {
final MachineVo machineVo = machineMapper.selectMachineByMaCode(bmQrBoxInfo.getQrCode());
if (null == machineVo || null == machineVo.getMaId()) {
return AjaxResult.error("物资信息不存在!");
}
if (machineVo.getMaStatus() == null) {
if (null == machineVo.getMaStatus()) {
return AjaxResult.error("物资状态异常,请完善后重试!");
}
if (!Objects.equals(machineVo.getMaStatus(), MaMachineStatusEnum.NEW_PURCHASE.getStatus().toString()) &&
@ -364,9 +366,9 @@ public class BmQrBoxServiceImpl implements BmQrBoxService {
}
// 一个标准型只有1种类型
List<Long> boxMaTypeList = bmQrBoxMapper.getBoxMaTypeList(bmQrBoxInfo.getBoxId());
final List<Long> boxMaTypeList = bmQrBoxMapper.getBoxMaTypeList(bmQrBoxInfo.getBoxId());
if (!boxMaTypeList.isEmpty()) {
if (boxMaTypeList.size() > 1) {
if (1 < boxMaTypeList.size()) {
return AjaxResult.error("该标准箱已绑定多种物资,无法进行操作,请联系运维人员处理!");
}
if (!Objects.equals(boxMaTypeList.get(0), machineVo.getTypeId())) {
@ -378,14 +380,14 @@ public class BmQrBoxServiceImpl implements BmQrBoxService {
bmQrBoxInfo.setMaId(machineVo.getMaId());
bmQrBoxInfo.setCreateBy(SecurityUtils.getUsername());
bmQrBoxInfo.setCreateTime(DateUtils.getNowDate());
if (bmQrBoxMapper.addQrcodeBoxBind(bmQrBoxInfo) > 0) {
if (0 < bmQrBoxMapper.addQrcodeBoxBind(bmQrBoxInfo)) {
// 修改标准箱状态为已完成
bmQrBoxInfo.setStatus(QrBoxStatusEnum.QR_BOX_STATUS_WAIT_TRANSFER.getStatus().toString());
bmQrBoxMapper.updateBmQrcodeStatus(bmQrBoxInfo);
return AjaxResult.success(HttpCodeEnum.SUCCESS.getMsg());
}
return AjaxResult.error("绑定失败:成功绑定0条");
} catch (Exception e) {
} catch (final Exception e) {
System.err.println("绑定失败,SQL执行异常:" + e.getMessage());
return AjaxResult.error("绑定失败,SQL执行异常:" + e.getMessage());
}
@ -408,11 +410,11 @@ public class BmQrBoxServiceImpl implements BmQrBoxService {
@Override
public AjaxResult deleteById(BmQrBoxInfo bmQrBoxInfo) {
//根据id查看标准箱是否绑定绑定不能删除
if (bmQrBoxMapper.countBmQrcodeInfoByBoxId(bmQrBoxInfo.getBoxId()) > 0) {
if (0 < bmQrBoxMapper.countBmQrcodeInfoByBoxId(bmQrBoxInfo.getBoxId())) {
return AjaxResult.error(HttpCodeEnum.FAIL.getCode(), "该标准箱还绑定设备,无法删除");
}
int result = bmQrBoxMapper.deleteById(bmQrBoxInfo);
return result > 0 ? AjaxResult.success(HttpCodeEnum.SUCCESS.getMsg()) : AjaxResult.error(HttpCodeEnum.FAIL.getCode(), HttpCodeEnum.FAIL.getMsg());
final int result = bmQrBoxMapper.deleteById(bmQrBoxInfo);
return 0 < result ? AjaxResult.success(HttpCodeEnum.SUCCESS.getMsg()) : AjaxResult.error(HttpCodeEnum.FAIL.getCode(), HttpCodeEnum.FAIL.getMsg());
}
/**
@ -422,8 +424,8 @@ public class BmQrBoxServiceImpl implements BmQrBoxService {
*/
@Override
public AjaxResult unBindQrcodeBox(BmQrBoxInfo bmQrBoxInfo) {
boolean unResult = bmQrBoxMapper.unBindQrcodeBox(bmQrBoxInfo) > 0;
if (bmQrBoxMapper.countBmQrcodeInfoByBoxId(bmQrBoxInfo.getBoxId()) == 0) {
final boolean unResult = 0 < bmQrBoxMapper.unBindQrcodeBox(bmQrBoxInfo);
if (0 == bmQrBoxMapper.countBmQrcodeInfoByBoxId(bmQrBoxInfo.getBoxId())) {
bmQrBoxInfo.setBoxCode(null).setBoxName(null).setBoxType(null).setStatus(QrBoxStatusEnum.QR_BOX_STATUS_WAIT_BIND.getStatus().toString());
bmQrBoxMapper.updateBmQrcodeInfoById(bmQrBoxInfo);
}
@ -447,25 +449,24 @@ public class BmQrBoxServiceImpl implements BmQrBoxService {
*/
@Override
public AjaxResult getBoxBindListByCode(BmQrBoxInfo bmQrBoxInfo) {
if (bmQrBoxInfo.getBoxCode() == null || bmQrBoxInfo.getMaTypeId() == null) {
if (null == bmQrBoxInfo.getBoxCode() || null == bmQrBoxInfo.getMaTypeId()) {
return AjaxResult.error(HttpCodeEnum.FAIL.getCode(), "标准箱编码或机具类型id不能为空");
}
List<BmQrBoxInfo> recordList = bmQrBoxMapper.getBoxBindListByCode(bmQrBoxInfo);
final List<BmQrBoxInfo> recordList = bmQrBoxMapper.getBoxBindListByCode(bmQrBoxInfo);
int num = 0;
String msg = "";
String msg;
if (CollectionUtil.isNotEmpty(recordList)) {
for (BmQrBoxInfo qrBoxInfo : recordList) {
for (final BmQrBoxInfo qrBoxInfo : recordList) {
if (qrBoxInfo.getMaStatus().equals(MaMachineStatusEnum.IN_STORE.getStatus().toString())) {
num ++;
}
}
msg = "监测到" + bmQrBoxInfo.getBoxCode() + "标准箱中有" + recordList.size()
+ "台设备,符合出库条件设备" + num + "台,请确认是否出库!";
msg = "监测到" + bmQrBoxInfo.getBoxCode() + "标准箱中有" + recordList.size() + "台设备,符合出库条件设备" + num + "台,请确认是否出库!";
} else {
msg = "监测到" + bmQrBoxInfo.getBoxCode() + "标准箱中无符合出库条件的设备,请检查后重新提交!";
}
// 返回包含设备列表和消息的结果
Map<String, Object> result = new HashMap<>(2);
final Map<String, Object> result = new HashMap<>(2);
result.put("recordList", recordList);
result.put("msg", msg);
return AjaxResult.success(result);