|
|
|
@ -1,11 +1,13 @@
|
|
|
|
|
package com.glxp.api.admin.service.inventory.impl;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
|
|
import com.glxp.api.admin.constant.Constant;
|
|
|
|
|
import com.glxp.api.admin.dao.inventory.DeviceCollectOrderDao;
|
|
|
|
|
import com.glxp.api.admin.dao.inventory.DeviceCollectOrderDetailDao;
|
|
|
|
|
import com.glxp.api.admin.entity.inout.WarehouseEntity;
|
|
|
|
|
import com.glxp.api.admin.entity.inventory.DeviceCollectOrderDetailEntity;
|
|
|
|
|
import com.glxp.api.admin.entity.inventory.DeviceCollectOrderEntity;
|
|
|
|
|
import com.glxp.api.admin.req.inventory.FilterDeviceCollectOrderRequest;
|
|
|
|
@ -13,6 +15,7 @@ import com.glxp.api.admin.res.inventory.DeviceCollectOrderResponse;
|
|
|
|
|
import com.glxp.api.admin.service.auth.CustomerService;
|
|
|
|
|
import com.glxp.api.admin.service.inventory.DeviceCollectOrderService;
|
|
|
|
|
import com.glxp.api.admin.util.DateUtil;
|
|
|
|
|
import com.glxp.api.admin.util.FilterUdiUtils;
|
|
|
|
|
import com.glxp.api.admin.util.GennerOrderUtils;
|
|
|
|
|
import com.glxp.api.admin.util.OrderNoTypeBean;
|
|
|
|
|
import com.glxp.api.common.enums.ResultEnum;
|
|
|
|
@ -85,22 +88,54 @@ public class DeviceCollectOrderServiceImpl implements DeviceCollectOrderService
|
|
|
|
|
}
|
|
|
|
|
//查询设备领用记录详情,判断是否每个设备都可以分辨唯一,如果不能,则无法提交审核
|
|
|
|
|
String orderId = deviceCollectOrderDao.selectOrderIdById(id);
|
|
|
|
|
if (StrUtil.isBlank(orderId)) {
|
|
|
|
|
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, "领用记录不存在!");
|
|
|
|
|
}
|
|
|
|
|
List<DeviceCollectOrderDetailEntity> detailList = deviceCollectOrderDetailDao.selectByOrderId(orderId);
|
|
|
|
|
if (CollUtil.isEmpty(detailList)) {
|
|
|
|
|
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, "请添加领用设备!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (DeviceCollectOrderDetailEntity deviceCollectOrderDetailEntity : detailList) {
|
|
|
|
|
if (StrUtil.isBlank(deviceCollectOrderDetailEntity.getSerialNo())) {
|
|
|
|
|
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, "领用设备中存在无序列号设备,无法提交审核,请完善设备信息!");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//更新领用记录状态为待审核
|
|
|
|
|
deviceCollectOrderDao.updateStatusById(1, id);
|
|
|
|
|
return ResultVOUtils.success("提交成功!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public BaseResponse updateStatus(Integer id, Integer status) {
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
if (null == id || null == status) {
|
|
|
|
|
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, "");
|
|
|
|
|
}
|
|
|
|
|
DeviceCollectOrderEntity deviceCollectOrderEntity = deviceCollectOrderDao.selectByPrimaryKey(id);
|
|
|
|
|
if (null == deviceCollectOrderEntity) {
|
|
|
|
|
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, "领用记录不出存在!");
|
|
|
|
|
}
|
|
|
|
|
//查询此领用记录详情中定义序列号的记录,重新生成码
|
|
|
|
|
List<DeviceCollectOrderDetailEntity> detailEntityList = deviceCollectOrderDetailDao.selectByOrderId(deviceCollectOrderEntity.getOrderId());
|
|
|
|
|
detailEntityList.forEach(detailEntity -> {
|
|
|
|
|
if (StrUtil.isBlank(detailEntity.getCode())) {
|
|
|
|
|
WarehouseEntity warehouseEntity = new WarehouseEntity();
|
|
|
|
|
BeanUtil.copyProperties(detailEntity, warehouseEntity);
|
|
|
|
|
String code = FilterUdiUtils.transGlxpHasSerStr(warehouseEntity);
|
|
|
|
|
detailEntity.setCode(code);
|
|
|
|
|
//更新详情的条码信息
|
|
|
|
|
deviceCollectOrderDetailDao.updateByPrimaryKey(detailEntity);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
deviceCollectOrderDao.updateStatusById(status, id);
|
|
|
|
|
return ResultVOUtils.success("更新成功!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public BaseResponse deleteDeviceCollectOrder(Integer id) {
|
|
|
|
|
return null;
|
|
|
|
|
if (null == id) {
|
|
|
|
|
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
|
|
|
|
}
|
|
|
|
|
deviceCollectOrderDao.deleteByPrimaryKey(id);
|
|
|
|
|
return ResultVOUtils.success("删除成功!");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|