|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
package com.glxp.api.service.inout;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
|
import com.glxp.api.constant.Constant;
|
|
|
|
|
import com.glxp.api.constant.ConstantStatus;
|
|
|
|
@ -15,6 +16,7 @@ import com.glxp.api.req.basic.FilterCompanyProductRelevanceRequest;
|
|
|
|
|
import com.glxp.api.req.inout.PdaCodeEntity;
|
|
|
|
|
import com.glxp.api.req.inout.PostOrderRequest;
|
|
|
|
|
import com.glxp.api.res.basic.UdiRelevanceResponse;
|
|
|
|
|
import com.glxp.api.service.basic.UdiRelevanceService;
|
|
|
|
|
import com.glxp.api.service.basic.UdiRlSupService;
|
|
|
|
|
import com.glxp.api.service.basic.IBasicBussinessTypeService;
|
|
|
|
|
import com.glxp.api.util.CustomUtil;
|
|
|
|
@ -26,6 +28,7 @@ import org.springframework.beans.BeanUtils;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
import java.util.List;
|
|
|
|
@ -43,6 +46,10 @@ public class IoTransInoutService {
|
|
|
|
|
IoCodeService codeService;
|
|
|
|
|
@Resource
|
|
|
|
|
UdiRlSupService udiRlSupService;
|
|
|
|
|
@Resource
|
|
|
|
|
IoOrderDetailCodeService orderDetailCodeService;
|
|
|
|
|
@Resource
|
|
|
|
|
UdiRelevanceService udiRelevanceService;
|
|
|
|
|
|
|
|
|
|
//手持终端上传生成扫码单据
|
|
|
|
|
public void creatOrderByPda(PostOrderRequest postOrderRequest) {
|
|
|
|
@ -197,9 +204,45 @@ public class IoTransInoutService {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//生成扫码单据详情
|
|
|
|
|
public void transInout(IoOrderEntity orderEntity, IoCodeTempEntity codeTempEntity) {
|
|
|
|
|
|
|
|
|
|
public void genOrderDetailCode(IoOrderEntity orderEntity, IoCodeTempEntity codeTempEntity) {
|
|
|
|
|
|
|
|
|
|
List<IoOrderDetailCodeEntity> ioOrderDetailCodeEntities = orderDetailCodeService.findByOrderId(orderEntity.getBillNo());
|
|
|
|
|
UdiRelevanceResponse udiRelevanceResponse = udiRelevanceService.selectGroupById(codeTempEntity.getRelId());
|
|
|
|
|
if (CollUtil.isEmpty(ioOrderDetailCodeEntities)) {
|
|
|
|
|
orderDetailCodeService.insert(buildEntity(orderEntity, codeTempEntity, udiRelevanceResponse));
|
|
|
|
|
} else {
|
|
|
|
|
ioOrderDetailCodeEntities.forEach(orderDetailCodeEntity ->
|
|
|
|
|
{
|
|
|
|
|
if (orderDetailCodeEntity.getBindRlFk() == udiRelevanceResponse.getId() && orderDetailCodeEntity.getBatchNo().equals(codeTempEntity.getBatchNo())) {
|
|
|
|
|
orderDetailCodeEntity.setCount(orderDetailCodeEntity.getCount() + codeTempEntity.getCount());
|
|
|
|
|
orderDetailCodeEntity.setReCount(orderDetailCodeEntity.getReCount() + codeTempEntity.getReCount());
|
|
|
|
|
orderDetailCodeService.update(orderDetailCodeEntity);
|
|
|
|
|
} else {
|
|
|
|
|
orderDetailCodeService.insert(buildEntity(orderEntity, codeTempEntity, udiRelevanceResponse));
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
IoOrderDetailCodeEntity buildEntity(IoOrderEntity orderEntity, IoCodeTempEntity codeTempEntity, UdiRelevanceResponse udiRelevanceResponse) {
|
|
|
|
|
IoOrderDetailCodeEntity ioOrderDetailCodeEntity = new IoOrderDetailCodeEntity();
|
|
|
|
|
ioOrderDetailCodeEntity.setOrderIdFk(orderEntity.getBillNo());
|
|
|
|
|
ioOrderDetailCodeEntity.setBindRlFk(udiRelevanceResponse.getId());
|
|
|
|
|
ioOrderDetailCodeEntity.setUuidFk(udiRelevanceResponse.getUuid());
|
|
|
|
|
ioOrderDetailCodeEntity.setBatchNo(codeTempEntity.getBatchNo());
|
|
|
|
|
ioOrderDetailCodeEntity.setNameCode(codeTempEntity.getNameCode());
|
|
|
|
|
ioOrderDetailCodeEntity.setProductDate(codeTempEntity.getProduceDate());
|
|
|
|
|
ioOrderDetailCodeEntity.setExpireDate(codeTempEntity.getExpireDate());
|
|
|
|
|
ioOrderDetailCodeEntity.setCoName(udiRelevanceResponse.getCpmctymc());
|
|
|
|
|
ioOrderDetailCodeEntity.setCertCode(udiRelevanceResponse.getZczbhhzbapzbh());
|
|
|
|
|
ioOrderDetailCodeEntity.setYlqxzcrbarmc(udiRelevanceResponse.getYlqxzcrbarmc());
|
|
|
|
|
ioOrderDetailCodeEntity.setManufacturer(udiRelevanceResponse.getManufactory());
|
|
|
|
|
ioOrderDetailCodeEntity.setMeasname(udiRelevanceResponse.getMeasname());
|
|
|
|
|
ioOrderDetailCodeEntity.setSpec(udiRelevanceResponse.getGgxh());
|
|
|
|
|
ioOrderDetailCodeEntity.setPrice(udiRelevanceResponse.getPrice());
|
|
|
|
|
ioOrderDetailCodeEntity.setCount(codeTempEntity.getCount());
|
|
|
|
|
ioOrderDetailCodeEntity.setReCount(codeTempEntity.getReCount());
|
|
|
|
|
return ioOrderDetailCodeEntity;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|