|
|
|
@ -7,11 +7,13 @@ import com.glxp.api.common.enums.ResultEnum;
|
|
|
|
|
import com.glxp.api.common.res.BaseResponse;
|
|
|
|
|
import com.glxp.api.common.util.ResultVOUtils;
|
|
|
|
|
import com.glxp.api.constant.ConstantType;
|
|
|
|
|
import com.glxp.api.dao.inv.DeptDeviceDetailDao;
|
|
|
|
|
import com.glxp.api.dao.inv.DeviceReceiveOrderDetailDao;
|
|
|
|
|
import com.glxp.api.dao.inv.InvProductDao;
|
|
|
|
|
import com.glxp.api.dao.inv.InvProductDetailDao;
|
|
|
|
|
import com.glxp.api.entity.basic.UdiEntity;
|
|
|
|
|
import com.glxp.api.entity.basic.UdiProductEntity;
|
|
|
|
|
import com.glxp.api.entity.inv.DeptDeviceDetailEntity;
|
|
|
|
|
import com.glxp.api.entity.inv.DeviceReceiveOrderDetailEntity;
|
|
|
|
|
import com.glxp.api.entity.inv.InvProductDetailEntity;
|
|
|
|
|
import com.glxp.api.entity.inv.InvProductEntity;
|
|
|
|
@ -22,6 +24,7 @@ import com.glxp.api.req.inv.FilterInvProductDetailRequest;
|
|
|
|
|
import com.glxp.api.res.basic.UdiRelevanceResponse;
|
|
|
|
|
import com.glxp.api.res.inv.DeviceReceiveOrderDetailResponse;
|
|
|
|
|
import com.glxp.api.service.basic.UdiProductService;
|
|
|
|
|
import com.glxp.api.service.inv.DeptDeviceDetailService;
|
|
|
|
|
import com.glxp.api.service.inv.DeviceReceiveOrderDetailService;
|
|
|
|
|
import com.glxp.api.service.system.SystemParamConfigService;
|
|
|
|
|
import com.glxp.api.util.udi.FilterUdiUtils;
|
|
|
|
@ -48,6 +51,8 @@ public class DeviceReceiveOrderDetailServiceImpl implements DeviceReceiveOrderDe
|
|
|
|
|
private SystemParamConfigService systemParamConfigService;
|
|
|
|
|
@Resource
|
|
|
|
|
private UdiProductService udiProductService;
|
|
|
|
|
@Resource
|
|
|
|
|
private DeptDeviceDetailDao deptDeviceDetailDao;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<DeviceReceiveOrderDetailResponse> filterList(FilterDeviceReceiveOrderDetailRequest detailRequest) {
|
|
|
|
@ -106,7 +111,7 @@ public class DeviceReceiveOrderDetailServiceImpl implements DeviceReceiveOrderDe
|
|
|
|
|
deviceReceiveOrderDetailDao.insert(orderDetail);
|
|
|
|
|
} else {
|
|
|
|
|
SystemParamConfigEntity systemParamConfigEntity = systemParamConfigService.selectByParamKey("device_product");
|
|
|
|
|
if(systemParamConfigEntity.getParamValue().equals("0")){
|
|
|
|
|
if(systemParamConfigEntity.getParamValue().equals("0") || addDetailRequest.getType() == 1){
|
|
|
|
|
//通过选库存添加
|
|
|
|
|
//查询选中的库存信息
|
|
|
|
|
for (String invProductId : addDetailRequest.getInvProductIds()) {
|
|
|
|
@ -116,7 +121,7 @@ public class DeviceReceiveOrderDetailServiceImpl implements DeviceReceiveOrderDe
|
|
|
|
|
//插入设备领用记录详情
|
|
|
|
|
deviceReceiveOrderDetailDao.insert(orderDetail);
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
}else if(systemParamConfigEntity.getParamValue().equals("1") || addDetailRequest.getType() == 3 ){
|
|
|
|
|
for (String invProductId : addDetailRequest.getInvProductIds()) {
|
|
|
|
|
DeviceReceiveOrderDetailEntity deviceReceiveOrderDetailEntity = new DeviceReceiveOrderDetailEntity();
|
|
|
|
|
|
|
|
|
@ -131,6 +136,27 @@ public class DeviceReceiveOrderDetailServiceImpl implements DeviceReceiveOrderDe
|
|
|
|
|
deviceReceiveOrderDetailDao.insert(deviceReceiveOrderDetailEntity);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}else if(addDetailRequest.getType() == 2){
|
|
|
|
|
for (String invProductId : addDetailRequest.getInvProductIds()) {
|
|
|
|
|
DeviceReceiveOrderDetailEntity deviceReceiveOrderDetailEntity = new DeviceReceiveOrderDetailEntity();
|
|
|
|
|
|
|
|
|
|
DeptDeviceDetailEntity deptDeviceDetailEntity= deptDeviceDetailDao.selectById(invProductId);
|
|
|
|
|
//查询库存详情
|
|
|
|
|
deviceReceiveOrderDetailEntity.setNameCode(deptDeviceDetailEntity.getNameCode());
|
|
|
|
|
deviceReceiveOrderDetailEntity.setRelId(Long.valueOf(deptDeviceDetailEntity.getRelId()));
|
|
|
|
|
deviceReceiveOrderDetailEntity.setOriginCode(deptDeviceDetailEntity.getOriginCode());
|
|
|
|
|
deviceReceiveOrderDetailEntity.setCode(deptDeviceDetailEntity.getCode());
|
|
|
|
|
deviceReceiveOrderDetailEntity.setOrderIdFk(addDetailRequest.getOrderIdFk());
|
|
|
|
|
deviceReceiveOrderDetailEntity.setSupId(deptDeviceDetailEntity.getSupId());
|
|
|
|
|
deviceReceiveOrderDetailEntity.setBatchNo(deptDeviceDetailEntity.getBatchNo());
|
|
|
|
|
deviceReceiveOrderDetailEntity.setProductionDate(deptDeviceDetailEntity.getProductionDate());
|
|
|
|
|
deviceReceiveOrderDetailEntity.setExpireDate(deptDeviceDetailEntity.getExpireDate());
|
|
|
|
|
deviceReceiveOrderDetailEntity.setSerialNo(deptDeviceDetailEntity.getSerialNo());
|
|
|
|
|
deviceReceiveOrderDetailEntity.setCreateTime(new Date());
|
|
|
|
|
deviceReceiveOrderDetailEntity.setUpdateTime(new Date());
|
|
|
|
|
deviceReceiveOrderDetailDao.insert(deviceReceiveOrderDetailEntity);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return ResultVOUtils.success("添加成功!");
|
|
|
|
|