|
|
|
@ -22,6 +22,7 @@ import com.glxp.api.entity.basic.UdiEntity;
|
|
|
|
|
import com.glxp.api.entity.basic.UdiProductEntity;
|
|
|
|
|
import com.glxp.api.entity.inout.*;
|
|
|
|
|
import com.glxp.api.entity.inv.InvPreInProductDetailEntity;
|
|
|
|
|
import com.glxp.api.entity.inv.InvPreProductDetailEntity;
|
|
|
|
|
import com.glxp.api.entity.inv.InvPreinDetailEntity;
|
|
|
|
|
import com.glxp.api.entity.system.SystemParamConfigEntity;
|
|
|
|
|
import com.glxp.api.req.basic.CompanyProductRelevanceRequest;
|
|
|
|
@ -36,6 +37,7 @@ import com.glxp.api.res.inout.IoCodeTempResponse;
|
|
|
|
|
import com.glxp.api.service.auth.InvWarehouseService;
|
|
|
|
|
import com.glxp.api.service.basic.*;
|
|
|
|
|
import com.glxp.api.service.inout.*;
|
|
|
|
|
import com.glxp.api.service.inv.InvPreProductDetailService;
|
|
|
|
|
import com.glxp.api.service.inv.InvPreinDetailService;
|
|
|
|
|
import com.glxp.api.service.inv.InvPreinProductDetailService;
|
|
|
|
|
import com.glxp.api.service.inv.InvProductDetailService;
|
|
|
|
@ -90,6 +92,8 @@ public class IoCodeTempController extends BaseController {
|
|
|
|
|
@Resource
|
|
|
|
|
InvPreinProductDetailService invPreinProductDetailService;
|
|
|
|
|
@Resource
|
|
|
|
|
InvPreProductDetailService invPreProductDetailService;
|
|
|
|
|
@Resource
|
|
|
|
|
InvProductDetailService invProductDetailService;
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
@ -437,7 +441,7 @@ public class IoCodeTempController extends BaseController {
|
|
|
|
|
//失效期提醒
|
|
|
|
|
SystemParamConfigEntity recentParamConfigEntity = systemParamConfigService.selectByParamKey("recent_date_tip");
|
|
|
|
|
long recent = Long.parseLong(recentParamConfigEntity.getParamValue());
|
|
|
|
|
if (bussinessTypeEntity.getCheckVailDate()==1 && recent > 0 && !addOrderRequest.isIgnoreRecentExpire()) {
|
|
|
|
|
if (bussinessTypeEntity.getCheckVailDate() == 1 && recent > 0 && !addOrderRequest.isIgnoreRecentExpire()) {
|
|
|
|
|
if (StrUtil.isNotEmpty(udiEntity.getExpireDate())) {
|
|
|
|
|
String expireDate = "20" + udiEntity.getExpireDate();
|
|
|
|
|
long expireTime = DateUtil.parseDateExpire(expireDate);
|
|
|
|
@ -527,9 +531,34 @@ public class IoCodeTempController extends BaseController {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 是否检验寄售库存
|
|
|
|
|
|
|
|
|
|
if (bussinessTypeEntity.isAdvancePreIn()) {
|
|
|
|
|
int preInCount = invPreProductDetailService.findCountByCode(code);
|
|
|
|
|
InvPreProductDetailEntity invPreinDetailEntity = invPreProductDetailService.findUseOneByCode(code);
|
|
|
|
|
if (preInCount <= 0) {
|
|
|
|
|
return ResultVOUtils.error(500, "寄售库存数量不足!");
|
|
|
|
|
} else {
|
|
|
|
|
if (StrUtil.isNotEmpty(invPreinDetailEntity.getBatchNo()) && StrUtil.isNotEmpty(addOrderRequest.getBatchNo())
|
|
|
|
|
&& !invPreinDetailEntity.getBatchNo().equals(addOrderRequest.getBatchNo())) {
|
|
|
|
|
return ResultVOUtils.error(500, "当前批次号与预验收录入批次号不匹配!");
|
|
|
|
|
}
|
|
|
|
|
if (StrUtil.isNotEmpty(orderId)) {//非首次添加
|
|
|
|
|
if (StrUtil.isEmpty(udiEntity.getSerialNo())) {//该单据已有该产品
|
|
|
|
|
//无序列号,则可能存在多个预验收入库单
|
|
|
|
|
IoCodeTempEntity codeTempEntity = codeTempService.findByUnique(orderId, code);
|
|
|
|
|
if (codeTempEntity != null) {
|
|
|
|
|
if (preInCount < (codeTempEntity.getMyCount() + 1)) {
|
|
|
|
|
return ResultVOUtils.error(500, "超出寄售存数量");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if (preInCount < 1) {
|
|
|
|
|
return ResultVOUtils.error(500, "寄售库存数量不足");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (addOrderRequest.getFromCorp() == null) {
|
|
|
|
|