|
|
|
@ -9,6 +9,7 @@ import com.glxp.api.admin.dao.inventory.DeviceMaOrderDetailDao;
|
|
|
|
|
import com.glxp.api.admin.entity.inventory.DeviceCollectOrderDetailEntity;
|
|
|
|
|
import com.glxp.api.admin.entity.inventory.DeviceMAOrderDetailEntity;
|
|
|
|
|
import com.glxp.api.admin.entity.inventory.DeviceMAOrderEntity;
|
|
|
|
|
import com.glxp.api.admin.req.inventory.AddDeviceMAOrderRequest;
|
|
|
|
|
import com.glxp.api.admin.req.inventory.FilterDeviceMAOrderRequest;
|
|
|
|
|
import com.glxp.api.admin.service.auth.CustomerService;
|
|
|
|
|
import com.glxp.api.admin.service.inventory.DeviceMAOrderService;
|
|
|
|
@ -98,7 +99,7 @@ public class DeviceMAOrderServiceImpl implements DeviceMAOrderService {
|
|
|
|
|
}
|
|
|
|
|
if (deviceMAOrderEntity.getStatus() == 1) {
|
|
|
|
|
//完成养护记录更新,查询此条养护记录详情中是否存在未养护完成设备
|
|
|
|
|
List<DeviceMAOrderDetailEntity> detailList = deviceMaOrderDetailDao.selectByOrderId(deviceMAOrderEntity.getOrderId());
|
|
|
|
|
List<DeviceMAOrderDetailEntity> detailList = deviceMaOrderDetailDao.selectByOrderId(deviceMAOrderEntity.getOrderId());
|
|
|
|
|
for (DeviceMAOrderDetailEntity deviceMAOrderDetailEntity : detailList) {
|
|
|
|
|
if (deviceMAOrderDetailEntity.getMaintenanceStatus() == 0) {
|
|
|
|
|
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, "存在未养护设备,请完成该设备养护!");
|
|
|
|
@ -124,4 +125,42 @@ public class DeviceMAOrderServiceImpl implements DeviceMAOrderService {
|
|
|
|
|
return ResultVOUtils.success("删除成功!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public BaseResponse addDeviceMAOrder(AddDeviceMAOrderRequest addDeviceMAOrderRequest) {
|
|
|
|
|
if (null == addDeviceMAOrderRequest) {
|
|
|
|
|
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
|
|
|
|
}
|
|
|
|
|
if (StrUtil.isBlank(addDeviceMAOrderRequest.getCode())) {
|
|
|
|
|
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
|
|
|
|
}
|
|
|
|
|
//生成设备养护记录和详情
|
|
|
|
|
DeviceMAOrderEntity deviceMAOrderEntity = new DeviceMAOrderEntity();
|
|
|
|
|
deviceMAOrderEntity.setOrderId(gennerOrderUtils.createStOrderNo(new OrderNoTypeBean(Constant.DEVICE_MA_ORDER, "yyyyMMdd")));
|
|
|
|
|
deviceMAOrderEntity.setCreateUser(addDeviceMAOrderRequest.getCreateUser());
|
|
|
|
|
deviceMAOrderEntity.setCreateTime(addDeviceMAOrderRequest.getCreateTime());
|
|
|
|
|
deviceMAOrderEntity.setUpdateTime(DateUtil.getDateTime());
|
|
|
|
|
deviceMAOrderEntity.setStatus(1);
|
|
|
|
|
|
|
|
|
|
//查询领用详情表中此条码的数据
|
|
|
|
|
DeviceCollectOrderDetailEntity deviceCollectOrderDetail = deviceCollectOrderDetailDao.findOneByCode(addDeviceMAOrderRequest.getCode());
|
|
|
|
|
//详情
|
|
|
|
|
DeviceMAOrderDetailEntity detailEntity = new DeviceMAOrderDetailEntity();
|
|
|
|
|
detailEntity.setCreateTime(addDeviceMAOrderRequest.getCreateTime());
|
|
|
|
|
detailEntity.setOrderIdFk(deviceMAOrderEntity.getOrderId());
|
|
|
|
|
detailEntity.setCreateUser(detailEntity.getCreateUser());
|
|
|
|
|
detailEntity.setCode(addDeviceMAOrderRequest.getCode());
|
|
|
|
|
detailEntity.setNameCode(deviceCollectOrderDetail.getNameCode());
|
|
|
|
|
detailEntity.setBatchNo(deviceCollectOrderDetail.getBatchNo());
|
|
|
|
|
detailEntity.setProductId(deviceCollectOrderDetail.getProductId());
|
|
|
|
|
detailEntity.setProduceDate(deviceCollectOrderDetail.getProduceDate());
|
|
|
|
|
detailEntity.setExpireDate(deviceCollectOrderDetail.getExpireDate());
|
|
|
|
|
detailEntity.setSerialNo(deviceCollectOrderDetail.getSerialNo());
|
|
|
|
|
detailEntity.setMaintenanceStatus(addDeviceMAOrderRequest.getMaintenanceStatus());
|
|
|
|
|
detailEntity.setDeviceStatus(addDeviceMAOrderRequest.getDeviceStatus());
|
|
|
|
|
|
|
|
|
|
deviceMAOrderDao.insert(deviceMAOrderEntity);
|
|
|
|
|
deviceMaOrderDetailDao.insert(detailEntity);
|
|
|
|
|
return ResultVOUtils.success();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|