|
|
@ -8,18 +8,15 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
|
import com.glxp.api.common.enums.ResultEnum;
|
|
|
|
|
|
|
|
import com.glxp.api.common.res.BaseResponse;
|
|
|
|
import com.glxp.api.common.res.BaseResponse;
|
|
|
|
import com.glxp.api.common.util.ResultVOUtils;
|
|
|
|
import com.glxp.api.common.util.ResultVOUtils;
|
|
|
|
import com.glxp.api.constant.Constant;
|
|
|
|
import com.glxp.api.constant.Constant;
|
|
|
|
import com.glxp.api.constant.ConstantStatus;
|
|
|
|
import com.glxp.api.constant.ConstantStatus;
|
|
|
|
import com.glxp.api.controller.collect.IoCollectCodeBackupController;
|
|
|
|
|
|
|
|
import com.glxp.api.dao.collect.IoCollectOrderBackupMapper;
|
|
|
|
import com.glxp.api.dao.collect.IoCollectOrderBackupMapper;
|
|
|
|
import com.glxp.api.dao.inout.IoCodeTempDao;
|
|
|
|
import com.glxp.api.dao.inout.IoCodeTempDao;
|
|
|
|
import com.glxp.api.entity.auth.AuthAdmin;
|
|
|
|
import com.glxp.api.entity.auth.AuthAdmin;
|
|
|
|
import com.glxp.api.entity.basic.BasicBussinessTypeEntity;
|
|
|
|
import com.glxp.api.entity.basic.BasicBussinessTypeEntity;
|
|
|
|
import com.glxp.api.entity.basic.CompanyProductRelevanceEntity;
|
|
|
|
import com.glxp.api.entity.basic.CompanyProductRelevanceEntity;
|
|
|
|
import com.glxp.api.entity.basic.EntrustReceEntity;
|
|
|
|
|
|
|
|
import com.glxp.api.entity.basic.SysWorkplaceDocumentEntity;
|
|
|
|
import com.glxp.api.entity.basic.SysWorkplaceDocumentEntity;
|
|
|
|
import com.glxp.api.entity.collect.*;
|
|
|
|
import com.glxp.api.entity.collect.*;
|
|
|
|
import com.glxp.api.entity.inout.IoCodeTempEntity;
|
|
|
|
import com.glxp.api.entity.inout.IoCodeTempEntity;
|
|
|
@ -35,7 +32,6 @@ import com.glxp.api.req.inout.ReviewFinishRequest;
|
|
|
|
import com.glxp.api.res.basic.BasicSkPrescribeResponse;
|
|
|
|
import com.glxp.api.res.basic.BasicSkPrescribeResponse;
|
|
|
|
import com.glxp.api.res.collect.CollectOrderBizResponse;
|
|
|
|
import com.glxp.api.res.collect.CollectOrderBizResponse;
|
|
|
|
import com.glxp.api.res.collect.IoCollectOrderResponse;
|
|
|
|
import com.glxp.api.res.collect.IoCollectOrderResponse;
|
|
|
|
import com.glxp.api.service.auth.impl.AuthAdminServiceImpl;
|
|
|
|
|
|
|
|
import com.glxp.api.service.basic.IBasicBussinessTypeService;
|
|
|
|
import com.glxp.api.service.basic.IBasicBussinessTypeService;
|
|
|
|
import com.glxp.api.service.basic.SysWorkplaceDocumentService;
|
|
|
|
import com.glxp.api.service.basic.SysWorkplaceDocumentService;
|
|
|
|
import com.glxp.api.service.basic.UdiRlSupService;
|
|
|
|
import com.glxp.api.service.basic.UdiRlSupService;
|
|
|
@ -104,7 +100,10 @@ public class IoCollectOrderBackupService extends ServiceImpl<IoCollectOrderBacku
|
|
|
|
@Value("${WEB_TITLE}")
|
|
|
|
@Value("${WEB_TITLE}")
|
|
|
|
private String WEB_TITLE;
|
|
|
|
private String WEB_TITLE;
|
|
|
|
@Resource
|
|
|
|
@Resource
|
|
|
|
SystemParamConfigService systemParamConfigService;
|
|
|
|
private SystemParamConfigService systemParamConfigService;
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
|
|
private RelCodeDetailService relCodeDetailService;
|
|
|
|
|
|
|
|
|
|
|
|
public List<IoCollectOrderResponse> filterList(CollectOrderRequest collectOrderRequest) {
|
|
|
|
public List<IoCollectOrderResponse> filterList(CollectOrderRequest collectOrderRequest) {
|
|
|
|
if (collectOrderRequest == null) {
|
|
|
|
if (collectOrderRequest == null) {
|
|
|
|
return Collections.emptyList();
|
|
|
|
return Collections.emptyList();
|
|
|
@ -163,7 +162,7 @@ public class IoCollectOrderBackupService extends ServiceImpl<IoCollectOrderBacku
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
public void generateOrder(String billNo,AuthAdmin authAdmin) {
|
|
|
|
public void generateOrder(String billNo, AuthAdmin authAdmin) {
|
|
|
|
|
|
|
|
|
|
|
|
IoCollectOrderBackup collectOrder = getByBillNo(billNo);
|
|
|
|
IoCollectOrderBackup collectOrder = getByBillNo(billNo);
|
|
|
|
|
|
|
|
|
|
|
@ -227,7 +226,7 @@ public class IoCollectOrderBackupService extends ServiceImpl<IoCollectOrderBacku
|
|
|
|
BaseResponse<String> stringBaseResponse = spGetHttp.reviewOrder(reviewFinishRequest, authAdmin.getId() + "");
|
|
|
|
BaseResponse<String> stringBaseResponse = spGetHttp.reviewOrder(reviewFinishRequest, authAdmin.getId() + "");
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
updateReview(authAdmin,orderEntity);
|
|
|
|
updateReview(authAdmin, orderEntity);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if (IntUtil.value(sysWorkplaceDocumentEntity.getIsMatching()) == 0) {
|
|
|
|
} else if (IntUtil.value(sysWorkplaceDocumentEntity.getIsMatching()) == 0) {
|
|
|
|
//todo 根据单据类型上传医保或者第三方系统
|
|
|
|
//todo 根据单据类型上传医保或者第三方系统
|
|
|
@ -244,6 +243,40 @@ public class IoCollectOrderBackupService extends ServiceImpl<IoCollectOrderBacku
|
|
|
|
collectOrderList.add(collectOrder);
|
|
|
|
collectOrderList.add(collectOrder);
|
|
|
|
orderRequest.setCollectOrderList(collectOrderList);
|
|
|
|
orderRequest.setCollectOrderList(collectOrderList);
|
|
|
|
BaseResponse<BasicSkPrescribeResponse> baseResponse = erpBasicClient.postOrder(orderRequest);
|
|
|
|
BaseResponse<BasicSkPrescribeResponse> baseResponse = erpBasicClient.postOrder(orderRequest);
|
|
|
|
|
|
|
|
// 判断此单据 有没有码已经上传过了一个有上传就进行错误返回
|
|
|
|
|
|
|
|
String paramValue = systemParamConfigService.selectValueByParamKey("checkCodeUploading");
|
|
|
|
|
|
|
|
if (StrUtil.isNotEmpty(paramValue) && paramValue.equals("0")) {
|
|
|
|
|
|
|
|
List<String> codeList = new ArrayList<>();
|
|
|
|
|
|
|
|
for (CollectOrderBizResponse collectOrderBizResponse : collectOrderBizResponses) {
|
|
|
|
|
|
|
|
String[] codes = collectOrderBizResponse.getFinishUdiCode().split(",");
|
|
|
|
|
|
|
|
// 遍历fruits数组
|
|
|
|
|
|
|
|
for (String code : codes) {
|
|
|
|
|
|
|
|
if (StrUtil.isNotBlank(code)) {
|
|
|
|
|
|
|
|
List<RelCodeDetail> relCodeDetailList = relCodeDetailService.getAllNext(code);
|
|
|
|
|
|
|
|
if (relCodeDetailList != null && relCodeDetailList.size() > 0) {
|
|
|
|
|
|
|
|
for (RelCodeDetail relCodeDetail : relCodeDetailList) {
|
|
|
|
|
|
|
|
codeList.add(relCodeDetail.getCurCode());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
BaseResponse<List> baseResponseCheckCode = erpBasicClient.collectOrderCheckCodeUploading(codeList);
|
|
|
|
|
|
|
|
if (baseResponseCheckCode.getCode() == 20000) {
|
|
|
|
|
|
|
|
List listCheckCode = baseResponseCheckCode.getData();
|
|
|
|
|
|
|
|
if (listCheckCode == null || listCheckCode.size() > 0) {
|
|
|
|
|
|
|
|
log.error("单据的所有码有已经传输过医保的,请核实");
|
|
|
|
|
|
|
|
throw new JsonException("此单据的所有码有已经传输过医保的,请核实" + baseResponse.getMessage());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
throw new JsonException("查询码关联关系服务出差," + baseResponse.getMessage());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
log.debug("单据返回=========" + baseResponse);
|
|
|
|
log.debug("单据返回=========" + baseResponse);
|
|
|
|
if (baseResponse.getCode() == 20000) {
|
|
|
|
if (baseResponse.getCode() == 20000) {
|
|
|
|
// 触发上传 转发至中继服务 到外网 再到国家同步库
|
|
|
|
// 触发上传 转发至中继服务 到外网 再到国家同步库
|
|
|
@ -251,7 +284,7 @@ public class IoCollectOrderBackupService extends ServiceImpl<IoCollectOrderBacku
|
|
|
|
BaseResponse<String> stringBaseResponse = new BaseResponse<>();
|
|
|
|
BaseResponse<String> stringBaseResponse = new BaseResponse<>();
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
stringBaseResponse = erpBasicClient.collectOrderUpload(orderRequest);
|
|
|
|
stringBaseResponse = erpBasicClient.collectOrderUpload(orderRequest);
|
|
|
|
}catch (Exception e){
|
|
|
|
} catch (Exception e) {
|
|
|
|
throw new JsonException("触发上传 转发至中继服务 到外网 再到国家同步库 接口服务出错:" + stringBaseResponse.getMessage());
|
|
|
|
throw new JsonException("触发上传 转发至中继服务 到外网 再到国家同步库 接口服务出错:" + stringBaseResponse.getMessage());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
@ -307,11 +340,11 @@ public class IoCollectOrderBackupService extends ServiceImpl<IoCollectOrderBacku
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
public Boolean orderUpload(String billNo,AuthAdmin authAdmin) {
|
|
|
|
public Boolean orderUpload(String billNo, AuthAdmin authAdmin) {
|
|
|
|
IoCollectOrderBackup updateOrder = new IoCollectOrderBackup();
|
|
|
|
IoCollectOrderBackup updateOrder = new IoCollectOrderBackup();
|
|
|
|
updateOrder.setBillNo(billNo);
|
|
|
|
updateOrder.setBillNo(billNo);
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
this.generateOrder(billNo,authAdmin);
|
|
|
|
this.generateOrder(billNo, authAdmin);
|
|
|
|
updateOrder.setUploadStatus(2);
|
|
|
|
updateOrder.setUploadStatus(2);
|
|
|
|
} catch (Exception e) {
|
|
|
|
} catch (Exception e) {
|
|
|
|
updateOrder.setUploadStatus(3);
|
|
|
|
updateOrder.setUploadStatus(3);
|
|
|
@ -328,19 +361,19 @@ public class IoCollectOrderBackupService extends ServiceImpl<IoCollectOrderBacku
|
|
|
|
public List<IoCollectOrderCodeMan> codeDetail(Integer bizIdFk) {
|
|
|
|
public List<IoCollectOrderCodeMan> codeDetail(Integer bizIdFk) {
|
|
|
|
List<IoCollectOrderCodeMan> reList = new ArrayList<>();
|
|
|
|
List<IoCollectOrderCodeMan> reList = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
|
|
List<IoCollectOrderCodeAuto> splitCodes = collectOrderCodeAutoService.list(new LambdaQueryWrapper<IoCollectOrderCodeAuto>().eq(IoCollectOrderCodeAuto::getBizIdFk,bizIdFk));
|
|
|
|
List<IoCollectOrderCodeAuto> splitCodes = collectOrderCodeAutoService.list(new LambdaQueryWrapper<IoCollectOrderCodeAuto>().eq(IoCollectOrderCodeAuto::getBizIdFk, bizIdFk));
|
|
|
|
List<IoCollectOrderCodeMan> manList = collectOrderCodeManService.list(new LambdaQueryWrapper<IoCollectOrderCodeMan>().eq(IoCollectOrderCodeMan::getBizIdFk,bizIdFk));
|
|
|
|
List<IoCollectOrderCodeMan> manList = collectOrderCodeManService.list(new LambdaQueryWrapper<IoCollectOrderCodeMan>().eq(IoCollectOrderCodeMan::getBizIdFk, bizIdFk));
|
|
|
|
|
|
|
|
|
|
|
|
if (CollUtil.isNotEmpty(splitCodes)){
|
|
|
|
if (CollUtil.isNotEmpty(splitCodes)) {
|
|
|
|
splitCodes.forEach( item -> {
|
|
|
|
splitCodes.forEach(item -> {
|
|
|
|
IoCollectOrderCodeMan ioCollectOrderCodeMan = new IoCollectOrderCodeMan();
|
|
|
|
IoCollectOrderCodeMan ioCollectOrderCodeMan = new IoCollectOrderCodeMan();
|
|
|
|
BeanUtils.copyProperties(item,ioCollectOrderCodeMan);
|
|
|
|
BeanUtils.copyProperties(item, ioCollectOrderCodeMan);
|
|
|
|
reList.add(ioCollectOrderCodeMan);
|
|
|
|
reList.add(ioCollectOrderCodeMan);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (CollUtil.isNotEmpty(manList)){
|
|
|
|
if (CollUtil.isNotEmpty(manList)) {
|
|
|
|
manList.forEach( item -> {
|
|
|
|
manList.forEach(item -> {
|
|
|
|
reList.add(item);
|
|
|
|
reList.add(item);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|