|
|
|
@ -16,7 +16,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
|
|
import com.glxp.mipsdl.client.CommonHttpClient;
|
|
|
|
|
|
|
|
|
|
import com.glxp.mipsdl.client.hlfyyy.entity.InvCodeResultEntity;
|
|
|
|
@ -186,6 +185,10 @@ public class HlfyyyClient extends CommonHttpClient {
|
|
|
|
|
@Resource
|
|
|
|
|
private VA003Mapper va003Mapper;
|
|
|
|
|
@Resource
|
|
|
|
|
private VA006Mapper va006Mapper;
|
|
|
|
|
@Resource
|
|
|
|
|
private VA006MxMapper va006MxMapper;
|
|
|
|
|
@Resource
|
|
|
|
|
private VA010Mapper va010Mapper;
|
|
|
|
|
@Resource
|
|
|
|
|
private VA010MxMapper va010MxMapper;
|
|
|
|
@ -193,6 +196,10 @@ public class HlfyyyClient extends CommonHttpClient {
|
|
|
|
|
private VA011Mapper va011Mapper;
|
|
|
|
|
@Resource
|
|
|
|
|
private VA011MxMapper va011MxMapper;
|
|
|
|
|
@Resource
|
|
|
|
|
private VA015Mapper va015Mapper;
|
|
|
|
|
@Resource
|
|
|
|
|
private VA015MxMapper va015MxMapper;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 拼接xml请求头
|
|
|
|
@ -230,7 +237,6 @@ public class HlfyyyClient extends CommonHttpClient {
|
|
|
|
|
udiwmsUnitRequest.setDatabaseProductName(getDataSourceType());
|
|
|
|
|
IPage<VA001> iPage = va001Service.filterList(udiwmsUnitRequest);
|
|
|
|
|
log.info("解析湖里妇幼返回往来单位,返回结果:{}", iPage.getRecords());
|
|
|
|
|
PageInfo<VA001> pageInfo = new PageInfo<>(iPage.getRecords());
|
|
|
|
|
PageSimpleResponse<VA001> pageSimpleResponse = new PageSimpleResponse<>();
|
|
|
|
|
pageSimpleResponse.setTotal(iPage.getTotal());
|
|
|
|
|
pageSimpleResponse.setList(iPage.getRecords());
|
|
|
|
@ -1471,6 +1477,19 @@ public class HlfyyyClient extends CommonHttpClient {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
public BaseResponse getPrescribesQx(UdiwmsBasicSkPrescribeRequest udiwmsBasicSkPrescribeRequest) {
|
|
|
|
|
if (IntUtil.value(udiwmsBasicSkPrescribeRequest.getInOutType()) == 0) {
|
|
|
|
|
udiwmsBasicSkPrescribeRequest.setDatabaseProductName(getDataSourceType());
|
|
|
|
|
IPage<VA006> iPage = va006Service.getList(new Page<VA006>(udiwmsBasicSkPrescribeRequest.getPage(), udiwmsBasicSkPrescribeRequest.getLimit()), udiwmsBasicSkPrescribeRequest);
|
|
|
|
|
return this.covertSellOrderQx(udiwmsBasicSkPrescribeRequest, iPage);
|
|
|
|
|
} else {
|
|
|
|
|
udiwmsBasicSkPrescribeRequest.setDatabaseProductName(getDataSourceType());
|
|
|
|
|
IPage<VA015> iPage = va015Service.getList(new Page<VA015>(udiwmsBasicSkPrescribeRequest.getPage(), udiwmsBasicSkPrescribeRequest.getLimit()), udiwmsBasicSkPrescribeRequest);
|
|
|
|
|
return this.covertReturnOrderQx(udiwmsBasicSkPrescribeRequest, iPage);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -1752,6 +1771,8 @@ public class HlfyyyClient extends CommonHttpClient {
|
|
|
|
|
if (CollUtil.isNotEmpty(itemDetails)) {
|
|
|
|
|
itemDetails.forEach(entity -> {
|
|
|
|
|
IoCollectOrderBiz collectOrderBiz = new IoCollectOrderBiz();
|
|
|
|
|
BeanUtils.copyProperties(entity,collectOrderBiz);
|
|
|
|
|
|
|
|
|
|
List<BasicUdirelEntity> basicUdirelEntities = basicUdirelDao.selectList(new LambdaQueryWrapper<BasicUdirelEntity>().eq(BasicUdirelEntity::getMainId, entity.getItemcode()));
|
|
|
|
|
if (CollUtil.isNotEmpty(basicUdirelEntities)) {
|
|
|
|
|
BasicUdirelEntity basicUdirelEntity = basicUdirelEntities.get(0);
|
|
|
|
@ -1762,12 +1783,12 @@ public class HlfyyyClient extends CommonHttpClient {
|
|
|
|
|
|
|
|
|
|
collectOrderBiz.setGgxh(entity.getBzgg());
|
|
|
|
|
collectOrderBiz.setMeasureUnit(entity.getMeasureunit());
|
|
|
|
|
collectOrderBiz.setCount(IntUtil.value(entity.getCount()));
|
|
|
|
|
collectOrderBiz.setCount(IntUtil.value(entity.getMeasurecount()));
|
|
|
|
|
collectOrderBiz.setThrCode(entity.getItemcode());
|
|
|
|
|
collectOrderBiz.setCpmctymc(entity.getItemname());
|
|
|
|
|
collectOrderBiz.setOrderIdFk(ioCollectOrder.getBillNo());
|
|
|
|
|
|
|
|
|
|
collectOrderBiz.setRemark1(entity.getRemark());
|
|
|
|
|
// collectOrderBiz.setRemark1(entity.getRemark());
|
|
|
|
|
collectOrderBiz.setNameCode(entity.getItemcode());
|
|
|
|
|
collectOrderBiz.setTagStatus(1);
|
|
|
|
|
collectOrderBiz.setUnTagCount(0);
|
|
|
|
@ -1865,6 +1886,7 @@ public class HlfyyyClient extends CommonHttpClient {
|
|
|
|
|
if (CollUtil.isNotEmpty(itemDetails)) {
|
|
|
|
|
itemDetails.forEach(entity -> {
|
|
|
|
|
IoCollectOrderBiz collectOrderBiz = new IoCollectOrderBiz();
|
|
|
|
|
BeanUtils.copyProperties(entity,collectOrderBiz);
|
|
|
|
|
List<BasicUdirelEntity> basicUdirelEntities = basicUdirelDao.selectList(new LambdaQueryWrapper<BasicUdirelEntity>().eq(BasicUdirelEntity::getMainId, entity.getItemcode()));
|
|
|
|
|
if (CollUtil.isNotEmpty(basicUdirelEntities)) {
|
|
|
|
|
BasicUdirelEntity basicUdirelEntity = basicUdirelEntities.get(0);
|
|
|
|
@ -1875,12 +1897,12 @@ public class HlfyyyClient extends CommonHttpClient {
|
|
|
|
|
|
|
|
|
|
collectOrderBiz.setGgxh(entity.getBzgg());
|
|
|
|
|
collectOrderBiz.setMeasureUnit(entity.getMeasureunit());
|
|
|
|
|
collectOrderBiz.setCount(IntUtil.value(entity.getCount()));
|
|
|
|
|
collectOrderBiz.setCount(IntUtil.value(entity.getMeasurecount()));
|
|
|
|
|
collectOrderBiz.setThrCode(entity.getItemcode());
|
|
|
|
|
collectOrderBiz.setCpmctymc(entity.getItemname());
|
|
|
|
|
collectOrderBiz.setOrderIdFk(ioCollectOrder.getBillNo());
|
|
|
|
|
|
|
|
|
|
collectOrderBiz.setRemark1(entity.getRemark());
|
|
|
|
|
// collectOrderBiz.setRemark1(entity.getRemark());
|
|
|
|
|
collectOrderBiz.setNameCode(entity.getItemcode());
|
|
|
|
|
collectOrderBiz.setTagStatus(1);
|
|
|
|
|
collectOrderBiz.setUnTagCount(0);
|
|
|
|
@ -2207,4 +2229,204 @@ public class HlfyyyClient extends CommonHttpClient {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 单据
|
|
|
|
|
*
|
|
|
|
|
* @param udiwmsBasicSkPrescribeRequest
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
private BaseResponse covertSellOrderQx(UdiwmsBasicSkPrescribeRequest udiwmsBasicSkPrescribeRequest, IPage<VA006> iPage) {
|
|
|
|
|
List<VA006> headList = iPage.getRecords();
|
|
|
|
|
// log.info("udiwmsBasicSkPrescribeRequest=="+udiwmsBasicSkPrescribeRequest+"====="+headList);
|
|
|
|
|
if (CollUtil.isNotEmpty(headList)) {
|
|
|
|
|
List<String> codefks = headList.stream().map(VA006::getCode).collect(Collectors.toList());
|
|
|
|
|
LambdaQueryWrapper<VA006Mx> wrapper1 = new LambdaQueryWrapper<>();
|
|
|
|
|
wrapper1.in(VA006Mx::getCodefk, codefks);
|
|
|
|
|
|
|
|
|
|
List<VA006Mx> va006MxList = va006MxMapper.selectList(wrapper1);
|
|
|
|
|
Map<String, List<VA006Mx>> detailsMap = new HashMap<>();
|
|
|
|
|
if (CollUtil.isNotEmpty(va006MxList)) {
|
|
|
|
|
detailsMap = va006MxList.stream()
|
|
|
|
|
.collect(Collectors.groupingBy(VA006Mx::getCodefk));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<IoCollectOrder> ioCollectOrders = new ArrayList<>();
|
|
|
|
|
Map<String, List<VA006Mx>> finalDetailsMap = detailsMap;
|
|
|
|
|
headList.forEach(item -> {
|
|
|
|
|
|
|
|
|
|
StringBuilder errorMsg = new StringBuilder();
|
|
|
|
|
IoCollectOrder ioCollectOrder = new IoCollectOrder();
|
|
|
|
|
ioCollectOrder.setBillNo(item.getCode());
|
|
|
|
|
ioCollectOrder.setFromType("HIS系统");
|
|
|
|
|
ioCollectOrder.setFromCorp(item.getDeptcode());
|
|
|
|
|
ioCollectOrder.setWorkPlaceCode(udiwmsBasicSkPrescribeRequest.getWorkPlaceCode());
|
|
|
|
|
ioCollectOrder.setFromCorpName(item.getSickname());
|
|
|
|
|
ioCollectOrder.setShipperName(item.getDeptname());
|
|
|
|
|
if (item.getRemark().equals("门诊")) {
|
|
|
|
|
ioCollectOrder.setBusType("YPCF002");
|
|
|
|
|
} else {
|
|
|
|
|
ioCollectOrder.setBusType("YPCF003");
|
|
|
|
|
}
|
|
|
|
|
Date date = null;
|
|
|
|
|
try {
|
|
|
|
|
date = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(item.getPrescribedate());
|
|
|
|
|
} catch (ParseException e) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
ioCollectOrder.setBillTime(date);
|
|
|
|
|
ioCollectOrder.setCreateTime(new Date());
|
|
|
|
|
ioCollectOrder.setCreateUser(udiwmsBasicSkPrescribeRequest.getCreateUser());
|
|
|
|
|
// ioCollectOrder.setBusType(udiwmsBasicSkPrescribeRequest.getBusType());
|
|
|
|
|
ioCollectOrder.setBackupOrderRemark1(item.getCode());
|
|
|
|
|
|
|
|
|
|
// ioCollectOrder.setBackupOrderRemark2(presInfoEntity.getSICK_ID());
|
|
|
|
|
// ioCollectOrder.setBackupOrderRemark3(presInfoEntity.getPSN_NAME());
|
|
|
|
|
// ioCollectOrder.setBackupOrderRemark4(presInfoEntity.getPSN_NO());
|
|
|
|
|
ioCollectOrder.setUpdateTime(new Date());
|
|
|
|
|
ioCollectOrder.setSplitStatus(0);
|
|
|
|
|
ioCollectOrder.setTagStatus(0);
|
|
|
|
|
List<VA006Mx> itemDetails = finalDetailsMap.get(item.getCode());
|
|
|
|
|
List<IoCollectOrderBiz> bizList = new ArrayList<>();
|
|
|
|
|
if (CollUtil.isNotEmpty(itemDetails)) {
|
|
|
|
|
itemDetails.forEach(entity -> {
|
|
|
|
|
IoCollectOrderBiz collectOrderBiz = new IoCollectOrderBiz();
|
|
|
|
|
BeanUtils.copyProperties(entity,collectOrderBiz);
|
|
|
|
|
|
|
|
|
|
List<BasicUdirelEntity> basicUdirelEntities = basicUdirelDao.selectList(new LambdaQueryWrapper<BasicUdirelEntity>().eq(BasicUdirelEntity::getMainId, entity.getItemcode()));
|
|
|
|
|
if (CollUtil.isNotEmpty(basicUdirelEntities)) {
|
|
|
|
|
BasicUdirelEntity basicUdirelEntity = basicUdirelEntities.get(0);
|
|
|
|
|
collectOrderBiz.setRelId(basicUdirelEntity.getId());
|
|
|
|
|
} else {
|
|
|
|
|
errorMsg.append(entity.getItemname()).append("字典未对照").append(";");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
collectOrderBiz.setGgxh(entity.getGgxh());
|
|
|
|
|
collectOrderBiz.setMeasureUnit(entity.getMeasureunit());
|
|
|
|
|
collectOrderBiz.setCount(IntUtil.value(entity.getMeasurecount()));
|
|
|
|
|
collectOrderBiz.setThrCode(entity.getItemcode());
|
|
|
|
|
collectOrderBiz.setCpmctymc(entity.getItemname());
|
|
|
|
|
collectOrderBiz.setOrderIdFk(ioCollectOrder.getBillNo());
|
|
|
|
|
|
|
|
|
|
// collectOrderBiz.setRemark1(entity.getRemark());
|
|
|
|
|
collectOrderBiz.setNameCode(entity.getItemcode());
|
|
|
|
|
collectOrderBiz.setTagStatus(1);
|
|
|
|
|
collectOrderBiz.setUnTagCount(0);
|
|
|
|
|
bizList.add(collectOrderBiz);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
if (StrUtil.isNotBlank(errorMsg)) {
|
|
|
|
|
ioCollectOrder.setErrorMsg(errorMsg.toString());
|
|
|
|
|
ioCollectOrder.setTagStatus(4);
|
|
|
|
|
}
|
|
|
|
|
ioCollectOrder.setBizList(summarizeByCode(bizList));
|
|
|
|
|
ioCollectOrders.add(ioCollectOrder);
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
PageSimpleResponse<IoCollectOrder> pageSimpleResponse = new PageSimpleResponse<>();
|
|
|
|
|
pageSimpleResponse.setTotal(iPage.getTotal());
|
|
|
|
|
pageSimpleResponse.setList(ioCollectOrders);
|
|
|
|
|
return ResultVOUtils.success(pageSimpleResponse);
|
|
|
|
|
} else {
|
|
|
|
|
return ResultVOUtils.error(500, "未查询到数据!");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
private BaseResponse covertReturnOrderQx(UdiwmsBasicSkPrescribeRequest udiwmsBasicSkPrescribeRequest, IPage<VA015> iPage) {
|
|
|
|
|
List<VA015> headList = iPage.getRecords();
|
|
|
|
|
// log.info("udiwmsBasicSkPrescribeRequest=="+udiwmsBasicSkPrescribeRequest+"====="+headList);
|
|
|
|
|
if (CollUtil.isNotEmpty(headList)) {
|
|
|
|
|
List<String> codefks = headList.stream().map(VA015::getCode).collect(Collectors.toList());
|
|
|
|
|
LambdaQueryWrapper<VA015Mx> wrapper1 = new LambdaQueryWrapper<>();
|
|
|
|
|
wrapper1.in(VA015Mx::getCodefk, codefks);
|
|
|
|
|
|
|
|
|
|
List<VA015Mx> va015MxList = va015MxMapper.selectList(wrapper1);
|
|
|
|
|
Map<String, List<VA015Mx>> detailsMap = new HashMap<>();
|
|
|
|
|
if (CollUtil.isNotEmpty(va015MxList)) {
|
|
|
|
|
detailsMap = va015MxList.stream()
|
|
|
|
|
.collect(Collectors.groupingBy(VA015Mx::getCodefk));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<IoCollectOrder> ioCollectOrders = new ArrayList<>();
|
|
|
|
|
Map<String, List<VA015Mx>> finalDetailsMap = detailsMap;
|
|
|
|
|
headList.forEach(item -> {
|
|
|
|
|
|
|
|
|
|
StringBuilder errorMsg = new StringBuilder();
|
|
|
|
|
IoCollectOrder ioCollectOrder = new IoCollectOrder();
|
|
|
|
|
ioCollectOrder.setBillNo(item.getCode());
|
|
|
|
|
ioCollectOrder.setFromType("HIS系统");
|
|
|
|
|
ioCollectOrder.setFromCorp(item.getDeptcode());
|
|
|
|
|
ioCollectOrder.setWorkPlaceCode(udiwmsBasicSkPrescribeRequest.getWorkPlaceCode());
|
|
|
|
|
ioCollectOrder.setFromCorpName(item.getSickname());
|
|
|
|
|
ioCollectOrder.setShipperName(item.getDeptname());
|
|
|
|
|
if (item.getRemark().equals("门诊")) {
|
|
|
|
|
ioCollectOrder.setBusType("YPCF002");
|
|
|
|
|
} else {
|
|
|
|
|
ioCollectOrder.setBusType("YPCF003");
|
|
|
|
|
}
|
|
|
|
|
Date date = null;
|
|
|
|
|
try {
|
|
|
|
|
date = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(item.getPrescribedate());
|
|
|
|
|
} catch (ParseException e) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
ioCollectOrder.setBillTime(date);
|
|
|
|
|
ioCollectOrder.setCreateTime(new Date());
|
|
|
|
|
ioCollectOrder.setCreateUser(udiwmsBasicSkPrescribeRequest.getCreateUser());
|
|
|
|
|
// ioCollectOrder.setBusType(udiwmsBasicSkPrescribeRequest.getBusType());
|
|
|
|
|
ioCollectOrder.setBackupOrderRemark1(item.getCode());
|
|
|
|
|
|
|
|
|
|
// ioCollectOrder.setBackupOrderRemark2(presInfoEntity.getSICK_ID());
|
|
|
|
|
// ioCollectOrder.setBackupOrderRemark3(presInfoEntity.getPSN_NAME());
|
|
|
|
|
// ioCollectOrder.setBackupOrderRemark4(presInfoEntity.getPSN_NO());
|
|
|
|
|
ioCollectOrder.setUpdateTime(new Date());
|
|
|
|
|
ioCollectOrder.setSplitStatus(0);
|
|
|
|
|
ioCollectOrder.setTagStatus(0);
|
|
|
|
|
List<VA015Mx> itemDetails = finalDetailsMap.get(item.getCode());
|
|
|
|
|
List<IoCollectOrderBiz> bizList = new ArrayList<>();
|
|
|
|
|
if (CollUtil.isNotEmpty(itemDetails)) {
|
|
|
|
|
itemDetails.forEach(entity -> {
|
|
|
|
|
IoCollectOrderBiz collectOrderBiz = new IoCollectOrderBiz();
|
|
|
|
|
BeanUtils.copyProperties(entity,collectOrderBiz);
|
|
|
|
|
List<BasicUdirelEntity> basicUdirelEntities = basicUdirelDao.selectList(new LambdaQueryWrapper<BasicUdirelEntity>().eq(BasicUdirelEntity::getMainId, entity.getItemcode()));
|
|
|
|
|
if (CollUtil.isNotEmpty(basicUdirelEntities)) {
|
|
|
|
|
BasicUdirelEntity basicUdirelEntity = basicUdirelEntities.get(0);
|
|
|
|
|
collectOrderBiz.setRelId(basicUdirelEntity.getId());
|
|
|
|
|
} else {
|
|
|
|
|
errorMsg.append(entity.getItemname()).append("字典未对照").append(";");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
collectOrderBiz.setGgxh(entity.getGgxh());
|
|
|
|
|
collectOrderBiz.setMeasureUnit(entity.getMeasureunit());
|
|
|
|
|
collectOrderBiz.setCount(IntUtil.value(entity.getMeasurecount()));
|
|
|
|
|
collectOrderBiz.setThrCode(entity.getItemcode());
|
|
|
|
|
collectOrderBiz.setCpmctymc(entity.getItemname());
|
|
|
|
|
collectOrderBiz.setOrderIdFk(ioCollectOrder.getBillNo());
|
|
|
|
|
|
|
|
|
|
// collectOrderBiz.setRemark1(entity.getRemark());
|
|
|
|
|
collectOrderBiz.setNameCode(entity.getItemcode());
|
|
|
|
|
collectOrderBiz.setTagStatus(1);
|
|
|
|
|
collectOrderBiz.setUnTagCount(0);
|
|
|
|
|
bizList.add(collectOrderBiz);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
if (StrUtil.isNotBlank(errorMsg)) {
|
|
|
|
|
ioCollectOrder.setErrorMsg(errorMsg.toString());
|
|
|
|
|
ioCollectOrder.setTagStatus(4);
|
|
|
|
|
}
|
|
|
|
|
ioCollectOrder.setBizList(summarizeByCode(bizList));
|
|
|
|
|
ioCollectOrders.add(ioCollectOrder);
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
PageSimpleResponse<IoCollectOrder> pageSimpleResponse = new PageSimpleResponse<>();
|
|
|
|
|
pageSimpleResponse.setTotal(iPage.getTotal());
|
|
|
|
|
pageSimpleResponse.setList(ioCollectOrders);
|
|
|
|
|
return ResultVOUtils.success(pageSimpleResponse);
|
|
|
|
|
} else {
|
|
|
|
|
return ResultVOUtils.error(500, "未查询到数据!");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|