平潭收费相关修改

dev_kcyj
anthonywj 12 months ago
parent c0bcbe75fc
commit 4ad90672fa

@ -46,6 +46,7 @@ import com.glxp.api.service.inout.IoAddInoutService;
import com.glxp.api.service.inout.IoCheckInoutService; import com.glxp.api.service.inout.IoCheckInoutService;
import com.glxp.api.service.inout.IoOrderDetailBizService; import com.glxp.api.service.inout.IoOrderDetailBizService;
import com.glxp.api.service.inout.IoOrderService; import com.glxp.api.service.inout.IoOrderService;
import com.glxp.api.service.inv.impl.InvProductService;
import com.glxp.api.service.system.SystemParamConfigService; import com.glxp.api.service.system.SystemParamConfigService;
import com.glxp.api.service.thrsys.ThrInvOrderService; import com.glxp.api.service.thrsys.ThrInvOrderService;
import com.glxp.api.service.thrsys.ThrSystemBusApiService; import com.glxp.api.service.thrsys.ThrSystemBusApiService;
@ -61,6 +62,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.math.BigDecimal;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
@ -703,9 +705,10 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
//校验产品是否被供应商关联 //校验产品是否被供应商关联
CompanyProductRelevanceEntity udiRlSupEntity = udiRlSupService.selOneByRlId(relId); CompanyProductRelevanceEntity udiRlSupEntity = udiRlSupService.selOneByRlId(relId);
if (udiRlSupEntity != null) if (udiRlSupEntity != null) {
item.setPrice(udiRlSupEntity.getPrice());
item.setSupId(udiRlSupEntity.getCustomerId()); item.setSupId(udiRlSupEntity.getCustomerId());
else } else
exmsg.append(thrCode + "供应商未关联"); exmsg.append(thrCode + "供应商未关联");
} else { } else {
exmsg.append(thrCode + ","); exmsg.append(thrCode + ",");
@ -870,7 +873,7 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
AtomicInteger fullGen = new AtomicInteger(); AtomicInteger fullGen = new AtomicInteger();
thrInvOrderDetails.forEach(item -> { thrInvOrderDetails.forEach(item -> {
Long relId = item.getRelId(); Long relId = item.getRelId();
if (ObjectUtil.isNull(relId)) { if (ObjectUtil.isNull(relId)) {
String thrCode = item.getThrCode(); String thrCode = item.getThrCode();
Integer count = Integer.valueOf(item.getReCount()); Integer count = Integer.valueOf(item.getReCount());
List<BasicSkProjectDetailEntity> skProjectDetailEntityList = basicDestinyRelService.filterDestinyRelListByPId(thrCode); List<BasicSkProjectDetailEntity> skProjectDetailEntityList = basicDestinyRelService.filterDestinyRelListByPId(thrCode);
@ -995,7 +998,9 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
ioOrderEntity.setCorpOrderId(UUID.randomUUID() + "");//单据号 ioOrderEntity.setCorpOrderId(UUID.randomUUID() + "");//单据号
ioOrderEntity.setThrOrderIdFk(thrInvOrder.getBillNo());//单据号 ioOrderEntity.setThrOrderIdFk(thrInvOrder.getBillNo());//单据号
ioOrderEntity.setUpdateTime(new Date()); ioOrderEntity.setUpdateTime(new Date());
ioOrderEntity.setCreateTime(new Date()); if (thrInvOrder.getStartDate() != null) {
ioOrderEntity.setCreateTime(new Date());
}
ioOrderEntity.setCustomerId("110"); ioOrderEntity.setCustomerId("110");
Long userId = 1l; Long userId = 1l;
// try { // try {
@ -1009,7 +1014,7 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
List<IoOrderDetailBizEntity> newOrderDetailBiz = new ArrayList<>(); List<IoOrderDetailBizEntity> newOrderDetailBiz = new ArrayList<>();
if (entry.getValue().size() > 0) { if (entry.getValue().size() > 0) {
if (!copyOrderDetailBiz(entry.getValue(), newOrderDetailBiz, newBillNo)) { if (!copyOrderDetailBiz(entry.getValue(), newOrderDetailBiz, newBillNo)) {
continue; continue;
} }
} }
String toBillNo = (thrInvOrder.getToBillNo() == null ? "" : thrInvOrder.getToBillNo()) + ("," + newBillNo); String toBillNo = (thrInvOrder.getToBillNo() == null ? "" : thrInvOrder.getToBillNo()) + ("," + newBillNo);
@ -1110,11 +1115,14 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
item.setRelId(relId); item.setRelId(relId);
item.setHandleStatus(1); item.setHandleStatus(1);
item.setToBillNo(newBillNo); item.setToBillNo(newBillNo);
updateThrInvOrderDetails.add(item); updateThrInvOrderDetails.add(item);
//校验产品是否被供应商关联 //校验产品是否被供应商关联
CompanyProductRelevanceEntity udiRlSupEntity = udiRlSupService.selOneByRlId(relId); CompanyProductRelevanceEntity udiRlSupEntity = udiRlSupService.selOneByRlId(relId);
if (udiRlSupEntity != null) if (udiRlSupEntity != null) {
item.setSupId(udiRlSupEntity.getCustomerId()); item.setSupId(udiRlSupEntity.getCustomerId());
}
} else { } else {
} }
} }
@ -1337,6 +1345,7 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
IoOrderDetailBizEntity ioOrderDetailBizEntity = new IoOrderDetailBizEntity(); IoOrderDetailBizEntity ioOrderDetailBizEntity = new IoOrderDetailBizEntity();
parameterPackag(basicProductsEntity, ioOrderDetailBizEntity, thrInvOrderDetail); parameterPackag(basicProductsEntity, ioOrderDetailBizEntity, thrInvOrderDetail);
ioOrderDetailBizEntity.setOrderIdFk(newBillNo); ioOrderDetailBizEntity.setOrderIdFk(newBillNo);
ioOrderDetailBizEntity.setBatchNo("/");
newOrderDetailBiz.add(ioOrderDetailBizEntity); newOrderDetailBiz.add(ioOrderDetailBizEntity);
} }
} }
@ -1451,6 +1460,10 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
} }
@Resource
InvProductService invProductService;
/** /**
* *
* *
@ -1487,15 +1500,31 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
thrInvOrderDetail.setRelId(relId); thrInvOrderDetail.setRelId(relId);
thrInvOrderDetail.setThrCode(thrCode); thrInvOrderDetail.setThrCode(thrCode);
thrInvOrderDetail.setReCount(String.valueOf(count)); thrInvOrderDetail.setReCount(String.valueOf(count));
thrInvOrderDetails.add(thrInvOrderDetail);
if (ObjectUtil.isNull(relId)) { if (ObjectUtil.isNull(relId)) {
exmsg.append(thrCode + ","); exmsg.append(thrCode + ",");
} }
//校验产品是否被供应商关联 //校验产品是否被供应商关联
CompanyProductRelevanceEntity udiRlSupEntity = udiRlSupService.selOneByRlId(relId); List<UdiRlSupEntity> udiRlSupEntitys = udiRlSupService.findByUdiRlId(relId);
if (udiRlSupEntity != null) if (CollUtil.isNotEmpty(udiRlSupEntitys)) {
thrInvOrderDetail.setSupId(udiRlSupEntity.getCustomerId()); for (UdiRlSupEntity udiRlSupEntity : udiRlSupEntitys) {
else Integer count1 = invProductService.selectExitCount("1000000", Long.parseLong(udiRlSupEntity.getCustomerId()), Long.parseLong(udiRlSupEntity.getUdiRlIdFk()));
if (IntUtil.value(count1 > 0)) {
thrInvOrderDetail.setSupId(udiRlSupEntity.getCustomerId());
if (udiRlSupEntity.getPrice() == null)
thrInvOrderDetail.setPrice(BigDecimal.ZERO);
else
thrInvOrderDetail.setPrice(udiRlSupEntity.getPrice());
}
}
if (thrInvOrderDetail.getSupId() == null) {
thrInvOrderDetail.setSupId(udiRlSupEntitys.get(0).getCustomerId());
if (udiRlSupEntitys.get(0).getPrice() == null)
thrInvOrderDetail.setPrice(BigDecimal.ZERO);
else
thrInvOrderDetail.setPrice(udiRlSupEntitys.get(0).getPrice());
}
} else
exmsg.append(thrCode + "供应商未关联"); exmsg.append(thrCode + "供应商未关联");
@ -1518,7 +1547,6 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
} else {//走项目组套 } else {//走项目组套
thrInvOrder.setSkProject(1); thrInvOrder.setSkProject(1);
StringBuilder exmsg = new StringBuilder(""); StringBuilder exmsg = new StringBuilder("");
list.forEach(item -> { list.forEach(item -> {
@ -1537,7 +1565,7 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
Integer finalCount = count; Integer finalCount = count;
if (IntUtil.value(cpMutiFilter) > 0 && IntUtil.value(finalCount) > 1) { if (IntUtil.value(cpMutiFilter) > 0 && IntUtil.value(finalCount) > 1) {
log.error(item.getCpmctymc() + "," + item.getThrCode() + "项目关联多个耗材对照,已过滤!"); log.error(item.getCpmctymc() + "," + item.getThrCode() + "项目关联多个耗材对照,已过滤!");
} else { } else {
skProjectDetailEntityList.forEach(sk -> { skProjectDetailEntityList.forEach(sk -> {
@ -1546,6 +1574,10 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
thrInvOrderDetail.setOrderIdFk(billNo); thrInvOrderDetail.setOrderIdFk(billNo);
thrInvOrderDetail.setRelId(sk.getRelId()); thrInvOrderDetail.setRelId(sk.getRelId());
thrInvOrderDetail.setSupId(sk.getSupId() + ""); thrInvOrderDetail.setSupId(sk.getSupId() + "");
UdiRlSupEntity udiRlSupEntity = udiRlSupService.findByUdiRlIdUnitFk(thrInvOrderDetail.getRelId() + "", thrInvOrderDetail.getSupId());
if (udiRlSupEntity != null && udiRlSupEntity.getPrice() != null) {
thrInvOrderDetail.setPrice(udiRlSupEntity.getPrice());
}
Integer skCount = sk.getCount(); Integer skCount = sk.getCount();
if (skCount != null && skCount > 0) { if (skCount != null && skCount > 0) {
thrInvOrderDetail.setReCount(String.valueOf(skCount * finalCount)); thrInvOrderDetail.setReCount(String.valueOf(skCount * finalCount));

@ -110,59 +110,64 @@ public class SyncThirdSysTask implements SchedulingConfigurer {
List<ThrSystemDetailEntity> list = thrSystemDetailDao.selectAutoExecuteList(); List<ThrSystemDetailEntity> list = thrSystemDetailDao.selectAutoExecuteList();
if (CollUtil.isNotEmpty(list)) { if (CollUtil.isNotEmpty(list)) {
log.info("本次查询到的接口列表数量:{}", list.size()); log.info("本次查询到的接口列表数量:{}", list.size());
list.parallelStream().forEach(thrSystemDetailEntity -> { list.forEach(thrSystemDetailEntity -> {
switch (thrSystemDetailEntity.getKey()) { try {
case ThirdSysConstant.WAREHOUSE_QUERY_URL: switch (thrSystemDetailEntity.getKey()) {
//下载第三方仓库信息 case ThirdSysConstant.WAREHOUSE_QUERY_URL:
downloadThrInv(thrSystemDetailEntity); //下载第三方仓库信息
break; downloadThrInv(thrSystemDetailEntity);
case ThirdSysConstant.CORP_URL: break;
//下载往来单位信息 case ThirdSysConstant.CORP_URL:
downloadThrCorp(thrSystemDetailEntity); //下载往来单位信息
break; downloadThrCorp(thrSystemDetailEntity);
case ThirdSysConstant.PI_QUERY_URL: break;
//下载第三方产品信息 case ThirdSysConstant.PI_QUERY_URL:
downloadThrPi(thrSystemDetailEntity); //下载第三方产品信息
break; downloadThrPi(thrSystemDetailEntity);
case ThirdSysConstant.BUS_TYPE_QUERY_URL: break;
//下载第三方单据类型 case ThirdSysConstant.BUS_TYPE_QUERY_URL:
downloadThrBusType(thrSystemDetailEntity); //下载第三方单据类型
break; downloadThrBusType(thrSystemDetailEntity);
case ThirdSysConstant.ORDER_SUBMIT_URL: break;
//提交单据 case ThirdSysConstant.ORDER_SUBMIT_URL:
submitOrder(thrSystemDetailEntity); //提交单据
break; submitOrder(thrSystemDetailEntity);
case ThirdSysConstant.ORDER_QUERY_URL: break;
downloadThrOrder(thrSystemDetailEntity); case ThirdSysConstant.ORDER_QUERY_URL:
break; downloadThrOrder(thrSystemDetailEntity);
case ThirdSysConstant.PI_SUBMIT_URL: break;
//提交产品信息 case ThirdSysConstant.PI_SUBMIT_URL:
postRelProduct(thrSystemDetailEntity); //提交产品信息
break; postRelProduct(thrSystemDetailEntity);
case ThirdSysConstant.SICKER_QUERY_URL: break;
//下载患者信息 case ThirdSysConstant.SICKER_QUERY_URL:
downloadSicker(thrSystemDetailEntity); //下载患者信息
break; downloadSicker(thrSystemDetailEntity);
case ThirdSysConstant.INV_SF_ORDER_QUERY_URL: break;
//下载出入库明细收费 case ThirdSysConstant.INV_SF_ORDER_QUERY_URL:
downloadInvSfOrder(thrSystemDetailEntity); //下载出入库明细收费
break; downloadInvSfOrder(thrSystemDetailEntity);
case ThirdSysConstant.INV_PH_ORDER_QUERY_URL: break;
//下载出入库明细普耗 case ThirdSysConstant.INV_PH_ORDER_QUERY_URL:
downloadInvPhOrder(thrSystemDetailEntity); //下载出入库明细普耗
break; downloadInvPhOrder(thrSystemDetailEntity);
case ThirdSysConstant.INV_GH_ORDER_QUERY_URL: break;
//下载出入库明细高耗 case ThirdSysConstant.INV_GH_ORDER_QUERY_URL:
downloadInvGhOrder(thrSystemDetailEntity); //下载出入库明细高耗
break; downloadInvGhOrder(thrSystemDetailEntity);
case ThirdSysConstant.SF_PROJECT_DICT_URL: break;
//下载收费项目字典 case ThirdSysConstant.SF_PROJECT_DICT_URL:
downloadSfProject(thrSystemDetailEntity); //下载收费项目字典
break; downloadSfProject(thrSystemDetailEntity);
default: break;
//其他接口暂不处理 default:
break; //其他接口暂不处理
break;
}
} catch (Exception e) {
log.error("执行第三方接口异常:{}", ExceptionUtils.getStackTrace(e));
} }
}); });
} else { } else {
log.info("未配置自动执行的第三方接口列表"); log.info("未配置自动执行的第三方接口列表");

Loading…
Cancel
Save