价格单据审核相关修改

test
anthonywj 2 years ago
parent c91f10609f
commit ea411c4102

@ -793,69 +793,7 @@ public class IoCodeTempController extends BaseController {
codeTempEntity.setInBatchNo(inBatch); codeTempEntity.setInBatchNo(inBatch);
codeTempService.updateById(codeTempEntity); codeTempService.updateById(codeTempEntity);
} else { } else {
List<IoCodeTempEntity> filteredAndSorted = codeTempEntities.stream() ioAddInoutService.checkPrice(codeTempEntity, bussinessTypeEntity, codeTempEntities);
.filter(person -> IntUtil.value(person.getRelId()) == IntUtil.value(codeTempEntity.getRelId())
&& StrUtil.trimToEmpty(person.getBatchNo()).equals(StrUtil.trimToEmpty(codeTempEntity.getBatchNo()))
)
.sorted(Comparator.comparing(IoCodeTempEntity::getInBatchNo))
.collect(Collectors.toList());
Map<String, List<IoCodeTempEntity>> stringListMap = null;
if (CollUtil.isNotEmpty(filteredAndSorted)) {
stringListMap = filteredAndSorted.stream()
.collect(Collectors.groupingBy(person -> StrUtil.trimToEmpty(person.getInBatchNo()))
);
}
List<IoCodeTempEntity> lastList = null;
if (stringListMap != null) {
lastList = stringListMap.entrySet().stream().findFirst().get().getValue();
}
int exitCount = 0;
int extiReCount = 0;
if (CollUtil.isNotEmpty(lastList)) {
for (IoCodeTempEntity ioCodeTempEntity : lastList) {
exitCount = exitCount + ioCodeTempEntity.getCount();
extiReCount = extiReCount + ioCodeTempEntity.getReCount();
}
}
//出库时填写价格与入库批次
//1.获取出库最新批次
String lastInBatch = null;
if (exitCount > 0) {
lastInBatch = lastList.get(0).getInBatchNo();
} else {
InvProductDetailEntity invProductDetailEntity = invProductDetailService.selectLastInBatch(bussinessTypeEntity, codeTempEntity.getRelId() + "", codeTempEntity.getBatchNo(), codeTempEntity.getInvCode(), codeTempEntity.getMainAction());
if (invProductDetailEntity != null)
lastInBatch = invProductDetailEntity.getInBatchNo();
}
if (lastInBatch == null && exitCount == 0) {
//首次出库,获取入库最早批次
InvProductDetailEntity inProductDetail = invProductDetailService.selectFirstInBatch(bussinessTypeEntity, codeTempEntity.getRelId() + "", codeTempEntity.getBatchNo(), codeTempEntity.getInvCode(), ConstantType.TYPE_PUT);
if (inProductDetail != null) {
codeTempEntity.setPrice(inProductDetail.getPrice());
codeTempEntity.setInBatchNo(inProductDetail.getInBatchNo());
}
} else {
//非首次出库
//1.获取当前批次已出库数量
Integer outCount = IntUtil.value(invProductDetailService.selectCountByInBatch(bussinessTypeEntity, lastInBatch, ConstantType.TYPE_OUT));
//2.获取当前批次入库数量
Integer inCount = IntUtil.value(invProductDetailService.selectCountByInBatch(bussinessTypeEntity, lastInBatch, ConstantType.TYPE_PUT));
//3.若数量还有剩,则此次出库为当前批次
if (inCount >= (outCount + extiReCount + codeTempEntity.getReCount())) {
codeTempEntity.setPrice(lastList.get(0).getPrice());
codeTempEntity.setInBatchNo(lastList.get(0).getInBatchNo());
} else {
// 4.若数量不足,则出下一批次
InvProductDetailEntity nextInvProduct = invProductDetailService.selectNextInBatch(bussinessTypeEntity, codeTempEntity.getRelId() + "", codeTempEntity.getBatchNo(), codeTempEntity.getInvCode(), ConstantType.TYPE_PUT, lastList.get(0).getInBatchNo());
if (nextInvProduct != null) {
codeTempEntity.setPrice(nextInvProduct.getPrice());
codeTempEntity.setInBatchNo(nextInvProduct.getInBatchNo());
}
}
}
} }
} }
} }

@ -355,15 +355,12 @@ public class IoOrderController extends BaseController {
String priceFifo = systemParamConfigService.selectValueByParamKey("price_fifo"); String priceFifo = systemParamConfigService.selectValueByParamKey("price_fifo");
if (IntUtil.value(priceFifo) > 0 && bussinessTypeEntity.getMainAction().equals(ConstantType.TYPE_OUT)) { if (IntUtil.value(priceFifo) > 0 && bussinessTypeEntity.getMainAction().equals(ConstantType.TYPE_OUT)) {
List<IoCodeTempEntity> resultList = ioAddInoutService.checkPrice(bussinessTypeEntity, BeanUtil.copyToList(codeTempEntities, IoCodeTempEntity.class)); List<IoCodeTempEntity> resultList = new ArrayList<>();
for (IoCodeTempEntity codeTempEntity : resultList) { for (IoCodeTempEntity codeTempEntity : codeTempEntities) {
if (codeTempEntity.getId() == null) resultList = ioAddInoutService.checkPrice(codeTempEntity, bussinessTypeEntity, resultList);
// return ResultVOUtils.error(500, "价格发生变动!");
log.error("价格发生变动");
} }
} }
if (checkInoutService.checkManual(addOrderRequest.getBillNo())) { if (checkInoutService.checkManual(addOrderRequest.getBillNo())) {
if (CollUtil.isNotEmpty(orderDetailBizEntities)) { if (CollUtil.isNotEmpty(orderDetailBizEntities)) {

@ -1,6 +1,7 @@
package com.glxp.api.controller.inout; package com.glxp.api.controller.inout;
import com.glxp.api.service.inout.impl.IoCodeService; import com.glxp.api.service.inout.impl.IoCodeService;
import org.eclipse.jdt.internal.compiler.apt.dispatch.HookedJavaFileObject;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.exceptions.ExceptionUtil; import cn.hutool.core.exceptions.ExceptionUtil;
@ -47,10 +48,8 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.ArrayList; import java.util.*;
import java.util.Date; import java.util.stream.Collectors;
import java.util.List;
import java.util.Locale;
//单据验收 //单据验收
@Slf4j @Slf4j
@ -230,16 +229,31 @@ public class IoOrderReviewController extends BaseController {
List<IoOrderDetailResultResponse> orderDetailResultResponses = acceptOrderEntity.getOrderDetailEntities(); List<IoOrderDetailResultResponse> orderDetailResultResponses = acceptOrderEntity.getOrderDetailEntities();
if (StrUtil.isNotEmpty(acceptOrderEntity.getCode()) && CollUtil.isNotEmpty(orderDetailResultResponses)) { if (StrUtil.isNotEmpty(acceptOrderEntity.getCode()) && CollUtil.isNotEmpty(orderDetailResultResponses)) {
boolean isExit = false; boolean isExit = false;
for (IoOrderDetailResultResponse orderDetailResultResponse : orderDetailResultResponses) { Map<String, List<IoOrderDetailResultResponse>> stringListMap = orderDetailResultResponses.stream()
.collect(Collectors.groupingBy(item -> StrUtil.trimToEmpty(item.getBatchNo()) + ":" + item.getBindRlFk())
);
int overflow = 0;
for (String key : stringListMap.keySet()) {
for (IoOrderDetailResultResponse orderDetailResultResponse : stringListMap.get(key)) {
if (orderDetailResultResponse.getBindRlFk().longValue() == codeEntity.getRelId().longValue() && if (orderDetailResultResponse.getBindRlFk().longValue() == codeEntity.getRelId().longValue() &&
StrUtil.trimToEmpty(orderDetailResultResponse.getBatchNo()).equals(StrUtil.trimToEmpty(codeEntity.getBatchNo()))) { StrUtil.trimToEmpty(orderDetailResultResponse.getBatchNo()).equals(StrUtil.trimToEmpty(codeEntity.getBatchNo()))) {
if (orderDetailResultResponse.getAcceptCount() >= orderDetailResultResponse.getCount()) {
overflow = 1;
} else {
overflow = 2;
orderDetailResultResponse.setAcceptCount(orderDetailResultResponse.getAcceptCount() + calCountUtil.getActCount(codeEntity.getNameCode())); orderDetailResultResponse.setAcceptCount(orderDetailResultResponse.getAcceptCount() + calCountUtil.getActCount(codeEntity.getNameCode()));
if (orderDetailResultResponse.getAcceptCount() > orderDetailResultResponse.getCount()) {
return ResultVOUtils.error(500, "数量溢出!");
}
isExit = true; isExit = true;
break; break;
} }
}
}
if (isExit) {
break;
}
}
if (overflow == 1) {
return ResultVOUtils.error(500, "数量溢出!");
} }
if (isExit) { if (isExit) {
redisUtil.set(ConstantStatus.REDIS_BILLNO + acceptOrderEntity.getBillNo(), orderDetailResultResponses); redisUtil.set(ConstantStatus.REDIS_BILLNO + acceptOrderEntity.getBillNo(), orderDetailResultResponses);

@ -501,12 +501,16 @@ public class IoAddInoutService {
String priceFifo = systemParamConfigService.selectValueByParamKey("price_fifo"); String priceFifo = systemParamConfigService.selectValueByParamKey("price_fifo");
if (IntUtil.value(priceFifo) > 0 && bussinessTypeEntity.getMainAction().equals(ConstantType.TYPE_OUT)) { if (IntUtil.value(priceFifo) > 0 && bussinessTypeEntity.getMainAction().equals(ConstantType.TYPE_OUT)) {
List<IoCodeTempEntity> resultList = checkPrice(bussinessTypeEntity, BeanUtil.copyToList(pdaPostOrderRequest.getCodeTempEntities(), IoCodeTempEntity.class)); List<IoCodeTempEntity> codeTempEntities = BeanUtil.copyToList(pdaPostOrderRequest.getCodeTempEntities(), IoCodeTempEntity.class);
for (IoCodeTempEntity codeTempEntity : resultList) { List<IoCodeTempEntity> resultList = new ArrayList<>();
if (codeTempEntity.getId() == null) for (IoCodeTempEntity codeTempEntity : codeTempEntities) {
// return ResultVOUtils.error(500, "价格发生变动!"); resultList = checkPrice(codeTempEntity, bussinessTypeEntity, resultList);
log.error("价格发生变动");
} }
// for (IoCodeTempEntity codeTempEntity : resultList) {
// if (codeTempEntity.getId() == null)
//// return ResultVOUtils.error(500, "价格发生变动!");
// log.error("价格发生变动");
// }
} }
@ -961,135 +965,133 @@ public class IoAddInoutService {
/** /**
* *
*/ */
public List<IoCodeTempEntity> checkPrice(BasicBussinessTypeEntity bussinessTypeEntity, List<IoCodeTempEntity> codeTempEntities) { // public List<IoCodeTempEntity> checkPrice(BasicBussinessTypeEntity bussinessTypeEntity, List<IoCodeTempEntity> codeTempEntities) {
//
Map<String, List<IoCodeTempEntity>> stringListMap = codeTempEntities.stream() // Map<String, List<IoCodeTempEntity>> stringListMap = codeTempEntities.stream()
.collect(Collectors.groupingBy(person -> person.getRelId() + ":" + person.getBatchNo())); // .collect(Collectors.groupingBy(person -> person.getRelId() + ":" + person.getBatchNo()));
List<IoCodeTempEntity> resultList = new ArrayList<>(); // List<IoCodeTempEntity> resultList = new ArrayList<>();
for (String key : stringListMap.keySet()) { // for (String key : stringListMap.keySet()) {
List<IoCodeTempEntity> temps = stringListMap.get(key); // List<IoCodeTempEntity> temps = stringListMap.get(key);
IoCodeTempEntity codeEntity = temps.get(0); // IoCodeTempEntity codeEntity = temps.get(0);
InvProductDetailEntity invProductDetailEntity = invProductDetailService.selectLastInBatch(bussinessTypeEntity, codeEntity.getRelId() + "", codeEntity.getBatchNo(), codeEntity.getInvCode(), codeEntity.getMainAction()); // InvProductDetailEntity invProductDetailEntity = invProductDetailService.selectLastInBatch(bussinessTypeEntity, codeEntity.getRelId() + "", codeEntity.getBatchNo(), codeEntity.getInvCode(), codeEntity.getMainAction());
Map<String, Integer> lastCountMap = new HashMap<>(); // Map<String, Integer> lastCountMap = new HashMap<>();
invProductDetailEntity = invProductDetailService.selectFirstInBatch(bussinessTypeEntity, codeEntity.getRelId() + "", codeEntity.getBatchNo(), codeEntity.getInvCode(), ConstantType.TYPE_PUT); // invProductDetailEntity = invProductDetailService.selectFirstInBatch(bussinessTypeEntity, codeEntity.getRelId() + "", codeEntity.getBatchNo(), codeEntity.getInvCode(), ConstantType.TYPE_PUT);
for (IoCodeTempEntity codeTempEntity : temps) { // for (IoCodeTempEntity codeTempEntity : temps) {
if (invProductDetailEntity == null) { // if (invProductDetailEntity == null) {
//首次出库,获取入库最早批次 // //首次出库,获取入库最早批次
if (invProductDetailEntity != null) { // if (invProductDetailEntity != null) {
int count = IntUtil.value(invProductDetailEntity.getCount()); // int count = IntUtil.value(invProductDetailEntity.getCount());
int reCount = IntUtil.value(invProductDetailEntity.getReCount()); // int reCount = IntUtil.value(invProductDetailEntity.getReCount());
//当数量>0时 // //当数量>0时
if (reCount >= codeTempEntity.getReCount()) { // if (reCount >= codeTempEntity.getReCount()) {
codeTempEntity.setPrice(invProductDetailEntity.getPrice()); // codeTempEntity.setPrice(invProductDetailEntity.getPrice());
codeTempEntity.setInBatchNo(invProductDetailEntity.getInBatchNo()); // codeTempEntity.setInBatchNo(invProductDetailEntity.getInBatchNo());
Integer tt = lastCountMap.get(invProductDetailEntity.getInBatchNo()); // Integer tt = lastCountMap.get(invProductDetailEntity.getInBatchNo());
lastCountMap.put(invProductDetailEntity.getInBatchNo(), IntUtil.value(tt) + codeTempEntity.getReCount()); // lastCountMap.put(invProductDetailEntity.getInBatchNo(), IntUtil.value(tt) + codeTempEntity.getReCount());
} else { // } else {
while (codeTempEntity.getReCount() - reCount > 0) { // while (codeTempEntity.getReCount() - reCount > 0) {
//
IoCodeTempEntity newCodeEntity = new IoCodeTempEntity(); // IoCodeTempEntity newCodeEntity = new IoCodeTempEntity();
BeanUtils.copyProperties(codeTempEntity, newCodeEntity); // BeanUtils.copyProperties(codeTempEntity, newCodeEntity);
newCodeEntity.setId(null); // newCodeEntity.setId(null);
newCodeEntity.setCount(count); // newCodeEntity.setCount(count);
newCodeEntity.setReCount(reCount); // newCodeEntity.setReCount(reCount);
newCodeEntity.setPrice(invProductDetailEntity.getPrice()); // newCodeEntity.setPrice(invProductDetailEntity.getPrice());
newCodeEntity.setInBatchNo(invProductDetailEntity.getInBatchNo()); // newCodeEntity.setInBatchNo(invProductDetailEntity.getInBatchNo());
lastCountMap.put(invProductDetailEntity.getInBatchNo(), IntUtil.value(lastCountMap.get(invProductDetailEntity.getInBatchNo())) + reCount); // lastCountMap.put(invProductDetailEntity.getInBatchNo(), IntUtil.value(lastCountMap.get(invProductDetailEntity.getInBatchNo())) + reCount);
codeTempService.insert(newCodeEntity); // codeTempService.insert(newCodeEntity);
resultList.add(newCodeEntity); // resultList.add(newCodeEntity);
//
codeTempEntity.setCount(codeTempEntity.getCount() - count); // codeTempEntity.setCount(codeTempEntity.getCount() - count);
codeTempEntity.setReCount(codeTempEntity.getReCount() - reCount); // codeTempEntity.setReCount(codeTempEntity.getReCount() - reCount);
codeTempService.updateById(codeTempEntity); // codeTempService.updateById(codeTempEntity);
//
invProductDetailEntity = invProductDetailService.selectNextInBatch(bussinessTypeEntity, codeTempEntity.getRelId() + "", codeTempEntity.getBatchNo(), codeTempEntity.getInvCode(), ConstantType.TYPE_PUT, invProductDetailEntity.getInBatchNo()); // invProductDetailEntity = invProductDetailService.selectNextInBatch(bussinessTypeEntity, codeTempEntity.getRelId() + "", codeTempEntity.getBatchNo(), codeTempEntity.getInvCode(), ConstantType.TYPE_PUT, invProductDetailEntity.getInBatchNo());
//
if (invProductDetailEntity != null) { // if (invProductDetailEntity != null) {
count = IntUtil.value(invProductDetailEntity.getCount()); // count = IntUtil.value(invProductDetailEntity.getCount());
reCount = IntUtil.value(invProductDetailEntity.getReCount()); // reCount = IntUtil.value(invProductDetailEntity.getReCount());
} else { // } else {
break; // break;
} // }
//
} // }
//
codeTempEntity.setPrice(invProductDetailEntity.getPrice()); // codeTempEntity.setPrice(invProductDetailEntity.getPrice());
codeTempEntity.setInBatchNo(invProductDetailEntity.getInBatchNo()); // codeTempEntity.setInBatchNo(invProductDetailEntity.getInBatchNo());
lastCountMap.put(invProductDetailEntity.getInBatchNo(), IntUtil.value(lastCountMap.get(invProductDetailEntity.getInBatchNo())) + reCount); // lastCountMap.put(invProductDetailEntity.getInBatchNo(), IntUtil.value(lastCountMap.get(invProductDetailEntity.getInBatchNo())) + reCount);
} // }
//
//
} // }
} else { // } else {
//非首次出库 // //非首次出库
int lastCount = IntUtil.value(lastCountMap.get(invProductDetailEntity.getInBatchNo())); // int lastCount = IntUtil.value(lastCountMap.get(invProductDetailEntity.getInBatchNo()));
//1.获取当前批次已出库数量 // //1.获取当前批次已出库数量
Integer outCount = IntUtil.value(invProductDetailService.selectCountByInBatch(bussinessTypeEntity, invProductDetailEntity.getInBatchNo(), ConstantType.TYPE_OUT)); // Integer outCount = IntUtil.value(invProductDetailService.selectCountByInBatch(bussinessTypeEntity, invProductDetailEntity.getInBatchNo(), ConstantType.TYPE_OUT));
//2.获取当前批次入库数量 // //2.获取当前批次入库数量
Integer inCount = IntUtil.value(invProductDetailService.selectCountByInBatch(bussinessTypeEntity, invProductDetailEntity.getInBatchNo(), ConstantType.TYPE_PUT)); // Integer inCount = IntUtil.value(invProductDetailService.selectCountByInBatch(bussinessTypeEntity, invProductDetailEntity.getInBatchNo(), ConstantType.TYPE_PUT));
//3.若数量还有剩,则此次出库为当前批次 // //3.若数量还有剩,则此次出库为当前批次
if (IntUtil.value(inCount) >= (IntUtil.value(outCount) + IntUtil.value(lastCount) + codeTempEntity.getReCount())) { // if (IntUtil.value(inCount) >= (IntUtil.value(outCount) + IntUtil.value(lastCount) + codeTempEntity.getReCount())) {
codeTempEntity.setPrice(invProductDetailEntity.getPrice()); // codeTempEntity.setPrice(invProductDetailEntity.getPrice());
codeTempEntity.setInBatchNo(invProductDetailEntity.getInBatchNo()); // codeTempEntity.setInBatchNo(invProductDetailEntity.getInBatchNo());
lastCountMap.put(invProductDetailEntity.getInBatchNo(), IntUtil.value(lastCountMap.get(invProductDetailEntity.getInBatchNo())) + codeTempEntity.getReCount()); // lastCountMap.put(invProductDetailEntity.getInBatchNo(), IntUtil.value(lastCountMap.get(invProductDetailEntity.getInBatchNo())) + codeTempEntity.getReCount());
//
} else { // } else {
// 4.若数量不足,则出下一批次 // // 4.若数量不足,则出下一批次
// InvProductDetailEntity nextInvProduct = invProductDetailService.selectNextInBatch(codeTempEntity.getRelId() + "", codeTempEntity.getBatchNo(), codeTempEntity.getInvCode(), codeTempEntity.getMainAction(), invProductDetailEntity.getInBatchNo()); //// InvProductDetailEntity nextInvProduct = invProductDetailService.selectNextInBatch(codeTempEntity.getRelId() + "", codeTempEntity.getBatchNo(), codeTempEntity.getInvCode(), codeTempEntity.getMainAction(), invProductDetailEntity.getInBatchNo());
// inCount = nextInvProduct.getReCount(); //// inCount = nextInvProduct.getReCount();
int curCount = outCount + lastCount; // int curCount = outCount + lastCount;
while (curCount >= inCount) { // while (curCount >= inCount) {
invProductDetailEntity = invProductDetailService.selectNextInBatch(bussinessTypeEntity, codeTempEntity.getRelId() + "", codeTempEntity.getBatchNo(), codeTempEntity.getInvCode(), codeTempEntity.getMainAction(), invProductDetailEntity.getInBatchNo()); // invProductDetailEntity = invProductDetailService.selectNextInBatch(bussinessTypeEntity, codeTempEntity.getRelId() + "", codeTempEntity.getBatchNo(), codeTempEntity.getInvCode(), codeTempEntity.getMainAction(), invProductDetailEntity.getInBatchNo());
if (invProductDetailEntity != null) { // if (invProductDetailEntity != null) {
if (invProductDetailEntity.getReCount() > codeTempEntity.getReCount()) { // if (invProductDetailEntity.getReCount() > codeTempEntity.getReCount()) {
codeTempEntity.setPrice(invProductDetailEntity.getPrice()); // codeTempEntity.setPrice(invProductDetailEntity.getPrice());
codeTempEntity.setInBatchNo(invProductDetailEntity.getInBatchNo()); // codeTempEntity.setInBatchNo(invProductDetailEntity.getInBatchNo());
lastCountMap.put(invProductDetailEntity.getInBatchNo(), inCount); // lastCountMap.put(invProductDetailEntity.getInBatchNo(), inCount);
} else { // } else {
IoCodeTempEntity newCodeEntity = new IoCodeTempEntity(); // IoCodeTempEntity newCodeEntity = new IoCodeTempEntity();
BeanUtils.copyProperties(codeTempEntity, newCodeEntity); // BeanUtils.copyProperties(codeTempEntity, newCodeEntity);
newCodeEntity.setId(null); // newCodeEntity.setId(null);
newCodeEntity.setReCount(inCount); // newCodeEntity.setReCount(inCount);
newCodeEntity.setPrice(invProductDetailEntity.getPrice()); // newCodeEntity.setPrice(invProductDetailEntity.getPrice());
newCodeEntity.setInBatchNo(invProductDetailEntity.getInBatchNo()); // newCodeEntity.setInBatchNo(invProductDetailEntity.getInBatchNo());
lastCountMap.put(invProductDetailEntity.getInBatchNo(), inCount); // lastCountMap.put(invProductDetailEntity.getInBatchNo(), inCount);
codeTempService.insert(newCodeEntity); // codeTempService.insert(newCodeEntity);
resultList.add(newCodeEntity); // resultList.add(newCodeEntity);
//
codeTempEntity.setReCount(curCount - inCount); // codeTempEntity.setReCount(curCount - inCount);
codeTempService.updateById(codeTempEntity); // codeTempService.updateById(codeTempEntity);
} // }
//
inCount = IntUtil.value(invProductDetailEntity.getReCount()); // inCount = IntUtil.value(invProductDetailEntity.getReCount());
lastCount = IntUtil.value(lastCountMap.get(invProductDetailEntity.getInBatchNo())); // lastCount = IntUtil.value(lastCountMap.get(invProductDetailEntity.getInBatchNo()));
//1.获取当前批次已出库数量 // //1.获取当前批次已出库数量
outCount = IntUtil.value(invProductDetailService.selectCountByInBatch(bussinessTypeEntity, invProductDetailEntity.getInBatchNo(), ConstantType.TYPE_OUT)); // outCount = IntUtil.value(invProductDetailService.selectCountByInBatch(bussinessTypeEntity, invProductDetailEntity.getInBatchNo(), ConstantType.TYPE_OUT));
curCount = outCount + lastCount; // curCount = outCount + lastCount;
} else { // } else {
break; // break;
} // }
//
} // }
if (invProductDetailEntity != null) { // if (invProductDetailEntity != null) {
codeTempEntity.setPrice(invProductDetailEntity.getPrice()); // codeTempEntity.setPrice(invProductDetailEntity.getPrice());
codeTempEntity.setInBatchNo(invProductDetailEntity.getInBatchNo()); // codeTempEntity.setInBatchNo(invProductDetailEntity.getInBatchNo());
lastCountMap.put(invProductDetailEntity.getInBatchNo(), inCount); // lastCountMap.put(invProductDetailEntity.getInBatchNo(), inCount);
} // }
} // }
//
//
if (invProductDetailEntity != null) { // if (invProductDetailEntity != null) {
codeTempEntity.setPrice(invProductDetailEntity.getPrice()); // codeTempEntity.setPrice(invProductDetailEntity.getPrice());
codeTempEntity.setInBatchNo(invProductDetailEntity.getInBatchNo()); // codeTempEntity.setInBatchNo(invProductDetailEntity.getInBatchNo());
} // }
} // }
resultList.add(codeTempEntity); // resultList.add(codeTempEntity);
} // }
} // }
return resultList; // return resultList;
} // }
public List<IoCodeTempEntity> checkPrice(IoCodeTempEntity codeTempEntity, BasicBussinessTypeEntity bussinessTypeEntity, List<IoCodeTempEntity> codeTempEntities) { public List<IoCodeTempEntity> checkPrice(IoCodeTempEntity codeTempEntity, BasicBussinessTypeEntity bussinessTypeEntity, List<IoCodeTempEntity> codeTempEntities) {

@ -451,7 +451,9 @@ public class IoCheckInoutService {
for (IoOrderDetailCodeEntity orderDetailCodeEntity : orderDetailCodeEntities) { for (IoOrderDetailCodeEntity orderDetailCodeEntity : orderDetailCodeEntities) {
if (orderDetailCodeEntity.getBindRlFk().longValue() == codeEnttity.getRelId().longValue() if (orderDetailCodeEntity.getBindRlFk().longValue() == codeEnttity.getRelId().longValue()
&& StrUtil.nullToEmpty(orderDetailCodeEntity.getBatchNo()).equals(StrUtil.nullToEmpty(codeEnttity.getBatchNo()))) { && StrUtil.nullToEmpty(orderDetailCodeEntity.getBatchNo()).equals(StrUtil.nullToEmpty(codeEnttity.getBatchNo()))) {
if (codeEnttity.getPrice() == null) {
codeEnttity.setPrice(orderDetailCodeEntity.getPrice()); codeEnttity.setPrice(orderDetailCodeEntity.getPrice());
}
break; break;
} }
} }

Loading…
Cancel
Save