|
|
|
@ -2,6 +2,7 @@ package com.glxp.api.service.thrsys.impl;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
|
|
import cn.hutool.core.util.IdUtil;
|
|
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
@ -17,6 +18,7 @@ import com.glxp.api.dao.thrsys.ThrInvOrderMapper;
|
|
|
|
|
import com.glxp.api.entity.basic.BasicProductsEntity;
|
|
|
|
|
import com.glxp.api.entity.basic.BasicSkProjectDetailEntity;
|
|
|
|
|
import com.glxp.api.entity.basic.UdiEntity;
|
|
|
|
|
import com.glxp.api.entity.basic.UdiRelevanceEntity;
|
|
|
|
|
import com.glxp.api.entity.inout.IoOrderDetailBizEntity;
|
|
|
|
|
import com.glxp.api.entity.inout.IoOrderEntity;
|
|
|
|
|
import com.glxp.api.entity.system.SystemParamConfigEntity;
|
|
|
|
@ -45,6 +47,7 @@ import com.glxp.api.util.GennerOrderUtils;
|
|
|
|
|
import com.glxp.api.util.OrderNoTypeBean;
|
|
|
|
|
import com.glxp.api.util.udi.FilterUdiUtils;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.apache.poi.ss.formula.functions.T;
|
|
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
@ -101,11 +104,11 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
|
|
|
|
|
ThrInvOrder thrInvOrder = new ThrInvOrder();
|
|
|
|
|
List<ThrInvOrderDetail> thrInvOrderDetails = new ArrayList<>();
|
|
|
|
|
String thirdSys = filterInvProductRequest.getThirdSys();
|
|
|
|
|
handleExternalConvertThrInvOrderDetail(list, thrInvOrderDetails, billNo, thirdSys,thrInvOrder);
|
|
|
|
|
handleExternalConvertThrInvOrderDetail(list, thrInvOrderDetails, billNo, thirdSys, thrInvOrder);
|
|
|
|
|
|
|
|
|
|
if (CollectionUtil.isNotEmpty(thrInvOrderDetails)) {
|
|
|
|
|
|
|
|
|
|
handleExternalConvertThrInvOrder(billNo, filterInvProductRequest, thrInvOrder, list.get(0),Constant.THR_INV_SF_ORDER_TYPE);
|
|
|
|
|
handleExternalConvertThrInvOrder(billNo, filterInvProductRequest, thrInvOrder, list.get(0), Constant.THR_INV_SF_ORDER_TYPE);
|
|
|
|
|
|
|
|
|
|
//保存数据
|
|
|
|
|
thrInvOrderMapper.insert(thrInvOrder);
|
|
|
|
@ -126,10 +129,10 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
|
|
|
|
|
ThrInvOrder thrInvOrder = new ThrInvOrder();
|
|
|
|
|
List<ThrInvOrderDetail> thrInvOrderDetails = new ArrayList<>();
|
|
|
|
|
String thirdSys = filterInvProductRequest.getThirdSys();
|
|
|
|
|
handleExternalConvertThrInvOrderDetail(list, thrInvOrderDetails, billNo, thirdSys,thrInvOrder);
|
|
|
|
|
handleExternalConvertThrInvOrderDetail(list, thrInvOrderDetails, billNo, thirdSys, thrInvOrder);
|
|
|
|
|
|
|
|
|
|
if (CollectionUtil.isNotEmpty(thrInvOrderDetails)) {
|
|
|
|
|
handleExternalConvertThrInvOrder(billNo, filterInvProductRequest, thrInvOrder, list.get(0),Constant.THR_INV_PH_ORDER_TYPE);
|
|
|
|
|
handleExternalConvertThrInvOrder(billNo, filterInvProductRequest, thrInvOrder, list.get(0), Constant.THR_INV_PH_ORDER_TYPE);
|
|
|
|
|
|
|
|
|
|
//保存数据
|
|
|
|
|
thrInvOrderMapper.insert(thrInvOrder);
|
|
|
|
@ -150,10 +153,10 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
|
|
|
|
|
ThrInvOrder thrInvOrder = new ThrInvOrder();
|
|
|
|
|
List<ThrInvOrderDetail> thrInvOrderDetails = new ArrayList<>();
|
|
|
|
|
String thirdSys = filterInvProductRequest.getThirdSys();
|
|
|
|
|
handleExternalConvertThrInvGhOrderDetail(list, thrInvOrderDetails, billNo, thirdSys,thrInvOrder);
|
|
|
|
|
handleExternalConvertThrInvGhOrderDetail(list, thrInvOrderDetails, billNo, thirdSys, thrInvOrder);
|
|
|
|
|
|
|
|
|
|
if (CollectionUtil.isNotEmpty(thrInvOrderDetails)) {
|
|
|
|
|
handleExternalConvertThrInvOrder(billNo, filterInvProductRequest, thrInvOrder, list.get(0),Constant.THR_INV_PH_ORDER_TYPE);
|
|
|
|
|
handleExternalConvertThrInvOrder(billNo, filterInvProductRequest, thrInvOrder, list.get(0), Constant.THR_INV_GH_ORDER_TYPE);
|
|
|
|
|
|
|
|
|
|
//保存数据
|
|
|
|
|
thrInvOrderMapper.insert(thrInvOrder);
|
|
|
|
@ -165,6 +168,7 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 处理高耗
|
|
|
|
|
*
|
|
|
|
|
* @param list
|
|
|
|
|
* @param thrInvOrderDetails
|
|
|
|
|
* @param billNo
|
|
|
|
@ -172,24 +176,49 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
|
|
|
|
|
* @param thrInvOrder
|
|
|
|
|
*/
|
|
|
|
|
private void handleExternalConvertThrInvGhOrderDetail(List<ThrInvResultResponse> list, List<ThrInvOrderDetail> thrInvOrderDetails, String billNo, String thirdSys, ThrInvOrder thrInvOrder) {
|
|
|
|
|
list.forEach( item -> {
|
|
|
|
|
String udiCode = item.getUdiCode();
|
|
|
|
|
UdiEntity udi = FilterUdiUtils.getUdi(udiCode);
|
|
|
|
|
/**
|
|
|
|
|
* udi 的 产品编号 获取产品信息 包装
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
// TODO: 2024/3/4
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
StringBuilder exmsg = new StringBuilder("");
|
|
|
|
|
list.forEach(item -> {
|
|
|
|
|
ThrInvOrderDetail thrInvOrderDetail = new ThrInvOrderDetail();
|
|
|
|
|
String udiCode = item.getUdiCode();
|
|
|
|
|
UdiEntity udiEntity = FilterUdiUtils.getUdi(udiCode);
|
|
|
|
|
String nameCode = udiEntity.getUdi();
|
|
|
|
|
List<BasicProductsEntity> productsEntities = udiRelevanceDao.getProductsEntitiesByNameCode(nameCode);
|
|
|
|
|
if (CollectionUtil.isNotEmpty(productsEntities)) {
|
|
|
|
|
BasicProductsEntity basicProductsEntity = productsEntities.get(0);
|
|
|
|
|
String mainAction = item.getMainAction();
|
|
|
|
|
String thrCode = item.getThrCode();
|
|
|
|
|
Long relId = basicProductsEntity.getId();
|
|
|
|
|
Integer count;
|
|
|
|
|
if (ConstantType.TYPE_PUT.equals(mainAction)) {
|
|
|
|
|
count = Integer.valueOf(item.getInCount());
|
|
|
|
|
} else {
|
|
|
|
|
count = Integer.valueOf(item.getOutCount());
|
|
|
|
|
}
|
|
|
|
|
BeanUtils.copyProperties(item, thrInvOrderDetail);
|
|
|
|
|
thrInvOrderDetail.setOrderIdFk(billNo);
|
|
|
|
|
thrInvOrderDetail.setNameCode(nameCode);
|
|
|
|
|
thrInvOrderDetail.setRelId(relId);
|
|
|
|
|
thrInvOrderDetail.setUdiCode(udiCode);
|
|
|
|
|
thrInvOrderDetail.setThrCode(thrCode);
|
|
|
|
|
thrInvOrderDetail.setReCount(String.valueOf(count));
|
|
|
|
|
thrInvOrderDetail.setBatchNo(udiEntity.getBatchNo());
|
|
|
|
|
thrInvOrderDetail.setProductionDate(udiEntity.getProduceDate());
|
|
|
|
|
thrInvOrderDetail.setExpireDate(udiEntity.getExpireDate());
|
|
|
|
|
thrInvOrderDetail.setSerialNo(udiEntity.getSerialNo());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
thrInvOrderDetails.add(thrInvOrderDetail);
|
|
|
|
|
} else {
|
|
|
|
|
exmsg.append(udiCode + ",");
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (exmsg.length() > 0) {
|
|
|
|
|
exmsg.deleteCharAt(exmsg.length() - 1);
|
|
|
|
|
exmsg.insert(0, "以下UDI码未匹配成功:");
|
|
|
|
|
thrInvOrder.setExMsg(String.valueOf(exmsg));
|
|
|
|
|
}else {
|
|
|
|
|
thrInvOrder.setExMsg("");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -301,7 +330,7 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
|
|
|
|
|
ioOrderEntity.setOrderType(ConstantStatus.ORDER_TYPE_NORMAL);//正常单据处理
|
|
|
|
|
|
|
|
|
|
List<IoOrderDetailBizEntity> newOrderDetailBiz = new ArrayList<>(thrInvOrderDetails.size());
|
|
|
|
|
if (!copyOrderDetailBiz(thrInvOrderDetails, newOrderDetailBiz,newBillNo)) {
|
|
|
|
|
if (!copyOrderDetailBiz(thrInvOrderDetails, newOrderDetailBiz, newBillNo)) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -318,6 +347,13 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public boolean generateGhOrder(GenerateOrderRequest generateOrderRequest) {
|
|
|
|
|
String billNo = generateOrderRequest.getBillNo();
|
|
|
|
|
// TODO: 2024/3/5
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
public boolean refreshOrder(RefreshOrderRequest refreshOrderRequest) {
|
|
|
|
|
String billNo = refreshOrderRequest.getBillNo();
|
|
|
|
@ -339,10 +375,10 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
|
|
|
|
|
StringBuilder exmsg = new StringBuilder("");
|
|
|
|
|
|
|
|
|
|
Integer skProject = thrInvOrder.getSkProject();
|
|
|
|
|
if (skProject == 1){//走组套
|
|
|
|
|
if (skProject == 1) {//走组套
|
|
|
|
|
thrInvOrderDetails.forEach(item -> {
|
|
|
|
|
Long relId = item.getRelId();
|
|
|
|
|
if (ObjectUtil.isNull(relId)){
|
|
|
|
|
if (ObjectUtil.isNull(relId)) {
|
|
|
|
|
//通过thrCode获取到项目组套
|
|
|
|
|
String thrCode = item.getThrCode();
|
|
|
|
|
Integer count = Integer.valueOf(item.getReCount());
|
|
|
|
@ -361,48 +397,48 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
|
|
|
|
|
addThrInvOrderDetails.add(thrInvOrderDetail);
|
|
|
|
|
delThrCodes.add(thrCode);
|
|
|
|
|
});
|
|
|
|
|
}else {
|
|
|
|
|
exmsg.append(thrCode+",");
|
|
|
|
|
} else {
|
|
|
|
|
exmsg.append(thrCode + ",");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
if (exmsg.length() > 0){
|
|
|
|
|
exmsg.deleteCharAt(exmsg.length()-1);
|
|
|
|
|
exmsg.insert(0,"以下第三方项目编码未匹配成功:");
|
|
|
|
|
if (exmsg.length() > 0) {
|
|
|
|
|
exmsg.deleteCharAt(exmsg.length() - 1);
|
|
|
|
|
exmsg.insert(0, "以下第三方项目编码未匹配成功:");
|
|
|
|
|
thrInvOrder.setExMsg(String.valueOf(exmsg));
|
|
|
|
|
}else {
|
|
|
|
|
} else {
|
|
|
|
|
thrInvOrder.setExMsg("");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}else {//不走组套
|
|
|
|
|
} else {//不走组套
|
|
|
|
|
|
|
|
|
|
String thirdSysFk = thrInvOrder.getThirdSysFk();
|
|
|
|
|
List<String> thrCodes = thrInvOrderDetails.stream().filter(x->ObjectUtil.isNull(x.getRelId()))
|
|
|
|
|
List<String> thrCodes = thrInvOrderDetails.stream().filter(x -> ObjectUtil.isNull(x.getRelId()))
|
|
|
|
|
.map(ThrInvOrderDetail::getThrCode).collect(Collectors.toList());
|
|
|
|
|
if (CollectionUtil.isNotEmpty(thrCodes)) {
|
|
|
|
|
MainIdRelIdAndProductResponse map = udiRelevanceService.selectMainIdRelIdAndProductMap(thrCodes, thirdSysFk);
|
|
|
|
|
Map<String, Long> mainIdRelIdMap = map.getMainIdRelIdMap();
|
|
|
|
|
|
|
|
|
|
thrInvOrderDetails.forEach(item -> {
|
|
|
|
|
if (ObjectUtil.isNull(item.getRelId())){
|
|
|
|
|
if (ObjectUtil.isNull(item.getRelId())) {
|
|
|
|
|
String thrCode = item.getThrCode();
|
|
|
|
|
Long relId = mainIdRelIdMap.get(thrCode);
|
|
|
|
|
if (ObjectUtil.isNotNull(relId)){
|
|
|
|
|
if (ObjectUtil.isNotNull(relId)) {
|
|
|
|
|
item.setRelId(relId);
|
|
|
|
|
updateThrInvOrderDetails.add(item);
|
|
|
|
|
}else {
|
|
|
|
|
exmsg.append(thrCode+",");
|
|
|
|
|
} else {
|
|
|
|
|
exmsg.append(thrCode + ",");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (exmsg.length() > 0){
|
|
|
|
|
exmsg.deleteCharAt(exmsg.length()-1);
|
|
|
|
|
exmsg.insert(0,"以下第三方耗材字典未匹配成功:");
|
|
|
|
|
if (exmsg.length() > 0) {
|
|
|
|
|
exmsg.deleteCharAt(exmsg.length() - 1);
|
|
|
|
|
exmsg.insert(0, "以下第三方耗材字典未匹配成功:");
|
|
|
|
|
thrInvOrder.setExMsg(String.valueOf(exmsg));
|
|
|
|
|
}else {
|
|
|
|
|
} else {
|
|
|
|
|
thrInvOrder.setExMsg("");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -410,25 +446,73 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
|
|
|
|
|
//更新单据信息
|
|
|
|
|
thrInvOrderMapper.updateById(thrInvOrder);
|
|
|
|
|
//删除原来的明细
|
|
|
|
|
if (CollectionUtil.isNotEmpty(delThrInvOrderDetailIds)){
|
|
|
|
|
if (CollectionUtil.isNotEmpty(delThrInvOrderDetailIds)) {
|
|
|
|
|
thrInvOrderDetailMapper.deleteBatchIds(delThrInvOrderDetailIds);
|
|
|
|
|
}
|
|
|
|
|
//删除原来的明细
|
|
|
|
|
if (CollectionUtil.isNotEmpty(delThrCodes)){
|
|
|
|
|
if (CollectionUtil.isNotEmpty(delThrCodes)) {
|
|
|
|
|
thrInvOrderDetailMapper.deleteBatchByThrCodeIds(delThrCodes);
|
|
|
|
|
}
|
|
|
|
|
//新增明细
|
|
|
|
|
if (CollectionUtil.isNotEmpty(addThrInvOrderDetails)){
|
|
|
|
|
if (CollectionUtil.isNotEmpty(addThrInvOrderDetails)) {
|
|
|
|
|
thrInvOrderDetailMapper.insertBatch(addThrInvOrderDetails);
|
|
|
|
|
}
|
|
|
|
|
//更新明细
|
|
|
|
|
if (CollectionUtil.isNotEmpty(updateThrInvOrderDetails)){
|
|
|
|
|
if (CollectionUtil.isNotEmpty(updateThrInvOrderDetails)) {
|
|
|
|
|
thrInvOrderDetailMapper.updateBatchById(updateThrInvOrderDetails);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public boolean refreshGhOrder(RefreshOrderRequest refreshOrderRequest) {
|
|
|
|
|
String billNo = refreshOrderRequest.getBillNo();
|
|
|
|
|
//通过单号获取单据信息
|
|
|
|
|
QueryWrapper<ThrInvOrder> qw = new QueryWrapper<>();
|
|
|
|
|
qw.eq("billNo", billNo);
|
|
|
|
|
ThrInvOrder thrInvOrder = thrInvOrderMapper.selectOne(qw);
|
|
|
|
|
if (Objects.isNull(thrInvOrder)) return false;
|
|
|
|
|
|
|
|
|
|
//通过单号获取单据明细信息
|
|
|
|
|
QueryWrapper<ThrInvOrderDetail> qwd = new QueryWrapper<>();
|
|
|
|
|
qwd.eq("orderIdFk", billNo);
|
|
|
|
|
List<ThrInvOrderDetail> thrInvOrderDetails = thrInvOrderDetailMapper.selectList(qwd);
|
|
|
|
|
if (CollectionUtil.isEmpty(thrInvOrderDetails)) return false;
|
|
|
|
|
List<ThrInvOrderDetail> updateThrInvOrderDetails = new ArrayList<>();
|
|
|
|
|
StringBuilder exmsg = new StringBuilder("");
|
|
|
|
|
|
|
|
|
|
thrInvOrderDetails.forEach(item -> {
|
|
|
|
|
Long relId = item.getRelId();
|
|
|
|
|
if (ObjectUtil.isNull(relId)) {
|
|
|
|
|
String nameCode = item.getNameCode();
|
|
|
|
|
List<BasicProductsEntity> productsEntities = udiRelevanceDao.getProductsEntitiesByNameCode(nameCode);
|
|
|
|
|
if (CollectionUtil.isNotEmpty(productsEntities)) {
|
|
|
|
|
BasicProductsEntity basicProductsEntity = productsEntities.get(0);
|
|
|
|
|
item.setRelId(basicProductsEntity.getId());
|
|
|
|
|
updateThrInvOrderDetails.add(item);
|
|
|
|
|
} else {
|
|
|
|
|
exmsg.append(nameCode + ",");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
if (exmsg.length() > 0) {
|
|
|
|
|
exmsg.deleteCharAt(exmsg.length() - 1);
|
|
|
|
|
exmsg.insert(0, "以下UDI码未匹配成功:");
|
|
|
|
|
thrInvOrder.setExMsg(String.valueOf(exmsg));
|
|
|
|
|
}else {
|
|
|
|
|
thrInvOrder.setExMsg("");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//更新单据信息
|
|
|
|
|
thrInvOrderMapper.updateById(thrInvOrder);
|
|
|
|
|
//更新明细
|
|
|
|
|
if (CollectionUtil.isNotEmpty(updateThrInvOrderDetails)) {
|
|
|
|
|
thrInvOrderDetailMapper.updateBatchById(updateThrInvOrderDetails);
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 校验relId字段有空返回false
|
|
|
|
|
*
|
|
|
|
@ -450,7 +534,7 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
|
|
|
|
|
* @param newOrderDetailBiz
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
private boolean copyOrderDetailBiz(List<ThrInvOrderDetail> thrInvOrderDetails, List<IoOrderDetailBizEntity> newOrderDetailBiz,String newBillNo) {
|
|
|
|
|
private boolean copyOrderDetailBiz(List<ThrInvOrderDetail> thrInvOrderDetails, List<IoOrderDetailBizEntity> newOrderDetailBiz, String newBillNo) {
|
|
|
|
|
List<Long> relIds = thrInvOrderDetails.stream().filter(x -> ObjectUtil.isNotNull(x.getRelId()))
|
|
|
|
|
.map(ThrInvOrderDetail::getRelId).collect(Collectors.toList());
|
|
|
|
|
List<BasicProductsEntity> basicProductsEntities = udiRelevanceDao.selectProductByRelIds(relIds);
|
|
|
|
@ -462,7 +546,7 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
|
|
|
|
|
Long relId = thrInvOrderDetail.getRelId();
|
|
|
|
|
BasicProductsEntity basicProductsEntity = relIdBasicProductsEntityMap.get(relId);
|
|
|
|
|
IoOrderDetailBizEntity ioOrderDetailBizEntity = new IoOrderDetailBizEntity();
|
|
|
|
|
parameterPackag(basicProductsEntity,ioOrderDetailBizEntity,thrInvOrderDetail);
|
|
|
|
|
parameterPackag(basicProductsEntity, ioOrderDetailBizEntity, thrInvOrderDetail);
|
|
|
|
|
ioOrderDetailBizEntity.setOrderIdFk(newBillNo);
|
|
|
|
|
newOrderDetailBiz.add(ioOrderDetailBizEntity);
|
|
|
|
|
}
|
|
|
|
@ -475,7 +559,7 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
|
|
|
|
|
* @param basicProductsEntity
|
|
|
|
|
* @param ioOrderDetailBizEntity
|
|
|
|
|
*/
|
|
|
|
|
private void parameterPackag(BasicProductsEntity basicProductsEntity, IoOrderDetailBizEntity ioOrderDetailBizEntity,ThrInvOrderDetail thrInvOrderDetail) {
|
|
|
|
|
private void parameterPackag(BasicProductsEntity basicProductsEntity, IoOrderDetailBizEntity ioOrderDetailBizEntity, ThrInvOrderDetail thrInvOrderDetail) {
|
|
|
|
|
ioOrderDetailBizEntity.setId(IdUtil.getSnowflakeNextId());
|
|
|
|
|
if (ObjectUtil.isNotNull(basicProductsEntity)) {
|
|
|
|
|
BeanUtils.copyProperties(basicProductsEntity, ioOrderDetailBizEntity);
|
|
|
|
@ -514,7 +598,7 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
|
|
|
|
|
* @param thrInvOrder
|
|
|
|
|
* @param thrInvResultResponse
|
|
|
|
|
*/
|
|
|
|
|
private void handleExternalConvertThrInvOrder(String billNo, FilterInvProductRequest filterInvProductRequest, ThrInvOrder thrInvOrder, ThrInvResultResponse thrInvResultResponse,Integer SourceType) {
|
|
|
|
|
private void handleExternalConvertThrInvOrder(String billNo, FilterInvProductRequest filterInvProductRequest, ThrInvOrder thrInvOrder, ThrInvResultResponse thrInvResultResponse, Integer SourceType) {
|
|
|
|
|
|
|
|
|
|
Date newDate = new Date();
|
|
|
|
|
thrInvOrder.setBillNo(billNo);//单据号
|
|
|
|
@ -541,7 +625,7 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
|
|
|
|
|
* @param thrInvOrderDetails
|
|
|
|
|
* @param billNo
|
|
|
|
|
*/
|
|
|
|
|
private void handleExternalConvertThrInvOrderDetail(List<ThrInvResultResponse> list, List<ThrInvOrderDetail> thrInvOrderDetails, String billNo, String thirdSys,ThrInvOrder thrInvOrder) {
|
|
|
|
|
private void handleExternalConvertThrInvOrderDetail(List<ThrInvResultResponse> list, List<ThrInvOrderDetail> thrInvOrderDetails, String billNo, String thirdSys, ThrInvOrder thrInvOrder) {
|
|
|
|
|
Integer inv_set_enable = Integer.valueOf(systemParamConfigService.selectValueByParamKey("inv_set_enable"));
|
|
|
|
|
if (inv_set_enable == null || inv_set_enable == 0) {//直接明细 不走项目组套
|
|
|
|
|
thrInvOrder.setSkProject(0);
|
|
|
|
@ -567,13 +651,13 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
|
|
|
|
|
thrInvOrderDetail.setThrCode(thrCode);
|
|
|
|
|
thrInvOrderDetail.setReCount(String.valueOf(count));
|
|
|
|
|
thrInvOrderDetails.add(thrInvOrderDetail);
|
|
|
|
|
if (ObjectUtil.isNull(relId)){
|
|
|
|
|
exmsg.append(thrCode+",");
|
|
|
|
|
if (ObjectUtil.isNull(relId)) {
|
|
|
|
|
exmsg.append(thrCode + ",");
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
if (exmsg.length() > 0){
|
|
|
|
|
exmsg.deleteCharAt(exmsg.length()-1);
|
|
|
|
|
exmsg.insert(0,"以下第三方耗材字典未匹配成功:");
|
|
|
|
|
if (exmsg.length() > 0) {
|
|
|
|
|
exmsg.deleteCharAt(exmsg.length() - 1);
|
|
|
|
|
exmsg.insert(0, "以下第三方耗材字典未匹配成功:");
|
|
|
|
|
thrInvOrder.setExMsg(String.valueOf(exmsg));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -604,8 +688,8 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
|
|
|
|
|
}
|
|
|
|
|
thrInvOrderDetails.add(thrInvOrderDetail);
|
|
|
|
|
});
|
|
|
|
|
}else {
|
|
|
|
|
exmsg.append(thrCode+",");
|
|
|
|
|
} else {
|
|
|
|
|
exmsg.append(thrCode + ",");
|
|
|
|
|
|
|
|
|
|
ThrInvOrderDetail thrInvOrderDetail = new ThrInvOrderDetail();
|
|
|
|
|
BeanUtils.copyProperties(item, thrInvOrderDetail);
|
|
|
|
@ -614,9 +698,9 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
|
|
|
|
|
thrInvOrderDetails.add(thrInvOrderDetail);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
if (exmsg.length() > 0){
|
|
|
|
|
exmsg.deleteCharAt(exmsg.length()-1);
|
|
|
|
|
exmsg.insert(0,"以下第三方项目编码未匹配成功:");
|
|
|
|
|
if (exmsg.length() > 0) {
|
|
|
|
|
exmsg.deleteCharAt(exmsg.length() - 1);
|
|
|
|
|
exmsg.insert(0, "以下第三方项目编码未匹配成功:");
|
|
|
|
|
thrInvOrder.setExMsg(String.valueOf(exmsg));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|