1.添加设备养护记录详情接口

feature-order-fix
x_z 2 years ago
parent 889cd671f6
commit b11e8fdd57

@ -47,6 +47,20 @@ public class DeviceCollectDetailController {
return ResultVOUtils.success(pageSimpleResponse);
}
/**
*
*
* @param code
* @return
*/
@GetMapping("/device/collect/order/detail/checkCode")
public BaseResponse checkCode(String code) {
if (StrUtil.isBlank(code)) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
}
return detailService.checkCode(code);
}
/**
*
*

@ -3,6 +3,7 @@ package com.glxp.api.admin.dao.inventory;
import com.glxp.api.admin.entity.inventory.DeviceCollectOrderDetailEntity;
import com.glxp.api.admin.req.inventory.FilterDeviceCollectOrderDetailRequest;
import com.glxp.api.admin.res.inventory.DeviceCollectOrderDetailResponse;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@ -28,4 +29,11 @@ public interface DeviceCollectOrderDetailDao {
* @return
*/
List<DeviceCollectOrderDetailResponse> filterList(FilterDeviceCollectOrderDetailRequest detailRequest);
/**
*
*
* @param orderIdFk
*/
void deleteByOrderId(@Param("orderIdFk") String orderIdFk);
}

@ -2,6 +2,8 @@ package com.glxp.api.admin.req.inventory;
import lombok.Data;
import java.util.List;
/**
*
*/
@ -13,4 +15,14 @@ public class AddDeviceCollectOrderDetailRequest {
*/
private String orderIdFk;
/**
*
*/
private String code;
/**
* ID
*/
private List<String> invProductIds;
}

@ -45,4 +45,11 @@ public interface DeviceCollectOrderDetailService {
*/
BaseResponse deleteOrderDetail(FilterDeviceCollectOrderDetailRequest detailRequest);
/**
*
*
* @param code
* @return
*/
BaseResponse checkCode(String code);
}

@ -1,13 +1,19 @@
package com.glxp.api.admin.service.inventory.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import com.github.pagehelper.PageHelper;
import com.glxp.api.admin.dao.inventory.DeviceCollectOrderDetailDao;
import com.glxp.api.admin.dao.inventory.InvProductDetailDao;
import com.glxp.api.admin.entity.basic.UdiEntity;
import com.glxp.api.admin.entity.inventory.DeviceCollectOrderDetailEntity;
import com.glxp.api.admin.entity.inventory.InvProductDetailEntity;
import com.glxp.api.admin.req.inventory.AddDeviceCollectOrderDetailRequest;
import com.glxp.api.admin.req.inventory.FilterDeviceCollectOrderDetailRequest;
import com.glxp.api.admin.req.inventory.FilterInvProductDetailRequest;
import com.glxp.api.admin.res.inventory.DeviceCollectOrderDetailResponse;
import com.glxp.api.admin.service.inventory.DeviceCollectOrderDetailService;
import com.glxp.api.admin.util.FilterUdiUtils;
import com.glxp.api.common.enums.ResultEnum;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
@ -22,10 +28,12 @@ import java.util.List;
@Slf4j
@Service
@Transactional(rollbackFor = Exception.class)
public class DeviceCollectOrderDetailServiceImpl implements DeviceCollectOrderDetailService{
public class DeviceCollectOrderDetailServiceImpl implements DeviceCollectOrderDetailService {
@Resource
private DeviceCollectOrderDetailDao deviceCollectOrderDetailDao;
@Resource
private InvProductDetailDao invProductDetailDao;
@Override
public List<DeviceCollectOrderDetailResponse> filterList(FilterDeviceCollectOrderDetailRequest detailRequest) {
@ -40,13 +48,30 @@ public class DeviceCollectOrderDetailServiceImpl implements DeviceCollectOrderDe
@Override
public BaseResponse addOrderDetail(AddDeviceCollectOrderDetailRequest addDetailRequest) {
if (null == addDetailRequest || StrUtil.isBlank(addDetailRequest.getOrderIdFk())) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
}
if (StrUtil.isBlank(addDetailRequest.getCode()) || CollUtil.isEmpty(addDetailRequest.getInvProductIds())) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, "请添加领用设备!");
}
if (StrUtil.isNotBlank(addDetailRequest.getCode())) {
//解析条码
UdiEntity udi = FilterUdiUtils.getUdi(addDetailRequest.getCode());
DeviceCollectOrderDetailEntity orderDetail = new DeviceCollectOrderDetailEntity();
}
return null;
}
@Override
public BaseResponse updateOrderDetail(DeviceCollectOrderDetailEntity detailEntity) {
return null;
if (null == detailEntity || null == detailEntity.getId()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
}
deviceCollectOrderDetailDao.updateByPrimaryKey(detailEntity);
return ResultVOUtils.success("更新成功!");
}
@Override
@ -54,7 +79,28 @@ public class DeviceCollectOrderDetailServiceImpl implements DeviceCollectOrderDe
if (null == detailRequest.getId() && StrUtil.isBlank(detailRequest.getOrderIdFk())) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
}
if (null == detailRequest.getId()) {
deviceCollectOrderDetailDao.deleteByPrimaryKey(detailRequest.getId());
} else if (null == detailRequest.getOrderIdFk()) {
deviceCollectOrderDetailDao.deleteByOrderId(detailRequest.getOrderIdFk());
}
return ResultVOUtils.success("删除成功!");
}
return null;
@Override
public BaseResponse checkCode(String code) {
//校验码在库存中是否存在
//查询此条码是否在库存中存在
FilterInvProductDetailRequest filterInvProductDetailRequest = new FilterInvProductDetailRequest();
filterInvProductDetailRequest.setOriginCode(code);
List<InvProductDetailEntity> invProductDetailEntities = invProductDetailDao.filterInvProductDetail(filterInvProductDetailRequest);
if (CollUtil.isNotEmpty(invProductDetailEntities)) {
if (invProductDetailEntities.size() > 1) {
return ResultVOUtils.error(ResultEnum.DATA_REPEAT,"此设备记录存在于多个仓库,请选择此设备当前所处仓库!");
} else {
return ResultVOUtils.success("校验成功!");
}
}
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, "此条码在库存中不存在,无法领用!");
}
}

@ -282,4 +282,10 @@
</if>
</where>
</select>
<delete id="deleteByOrderId">
delete
from device_collect_order_detail
where orderIdFk = #{orderIdFk}
</delete>
</mapper>
Loading…
Cancel
Save