|
|
|
@ -6,28 +6,38 @@ import cn.hutool.http.HttpUtil;
|
|
|
|
|
import cn.hutool.json.JSONUtil;
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
import com.alibaba.fastjson.TypeReference;
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
|
|
import com.glxp.api.annotation.Log;
|
|
|
|
|
import com.glxp.api.common.res.BaseResponse;
|
|
|
|
|
import com.glxp.api.common.util.ResultVOUtils;
|
|
|
|
|
import com.glxp.api.constant.BusinessType;
|
|
|
|
|
import com.glxp.api.controller.BaseController;
|
|
|
|
|
import com.glxp.api.dao.inout.IoCodeDao;
|
|
|
|
|
import com.glxp.api.entity.alihealth.AliYljgBillDetail;
|
|
|
|
|
import com.glxp.api.entity.alihealth.AliYljgSearchbill;
|
|
|
|
|
import com.glxp.api.entity.collect.IoCollectCodeBackup;
|
|
|
|
|
import com.glxp.api.entity.inout.IoCodeEntity;
|
|
|
|
|
import com.glxp.api.entity.inout.IoOrderEntity;
|
|
|
|
|
import com.glxp.api.entity.thrsys.CodeRel;
|
|
|
|
|
import com.glxp.api.entity.thrsys.ThirdAliDrug;
|
|
|
|
|
import com.glxp.api.entity.thrsys.YbDrug;
|
|
|
|
|
import com.glxp.api.req.alihealth.AliYljgSearchbillReqeust;
|
|
|
|
|
import com.glxp.api.req.alihealth.AlihealthKytDrugrescodeReqeust;
|
|
|
|
|
import com.glxp.api.req.alihealth.AlihealthKytGetentinfoReqeust;
|
|
|
|
|
import com.glxp.api.req.alihealth.AlihealthYljgUploadinoutbillReqeust;
|
|
|
|
|
import com.glxp.api.req.alihealth.local.AlihealthGetRelCodeReqeust;
|
|
|
|
|
import com.glxp.api.req.alihealth.local.AlihealthRelCodeInsertReqeust;
|
|
|
|
|
import com.glxp.api.req.alihealth.local.AlihealthThirdAliDrugInsertReqeust;
|
|
|
|
|
import com.glxp.api.req.thrsys.ThirdAliDrugRequest;
|
|
|
|
|
import com.glxp.api.res.PageSimpleResponse;
|
|
|
|
|
import com.glxp.api.res.alihealth.AlihealthKytGetentinfoResponse;
|
|
|
|
|
import com.glxp.api.service.alihealth.AlihealthBusService;
|
|
|
|
|
import com.glxp.api.service.collect.RelCodeBatchService;
|
|
|
|
|
import com.glxp.api.service.inout.IoOrderService;
|
|
|
|
|
import com.glxp.api.util.DateUtil;
|
|
|
|
|
import com.glxp.api.util.alihealth.AlihealthUtils;
|
|
|
|
|
import com.glxp.api.util.alihealth.AlihealthYljgUtils;
|
|
|
|
|
import com.glxp.api.util.alihealth.PaginationUtil;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
@ -224,6 +234,67 @@ public class AlihealthBusController extends BaseController {
|
|
|
|
|
AliYljgBillDetail aliYljgBillDetail = alihealthBusService.aliYljgBillDetail(aliYljgSearchbillReqeust);
|
|
|
|
|
return ResultVOUtils.success(aliYljgBillDetail);
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* 阿里手动拉取完成单大级码没有关联关系的接口
|
|
|
|
|
*
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@Resource
|
|
|
|
|
private RelCodeBatchService relCodeBatchService;
|
|
|
|
|
@PostMapping("/spms/alihealth/getAliCode")
|
|
|
|
|
@Log(title = "阿里手动拉取完成单大级码没有关联关系的接口", businessType = BusinessType.OTHER)
|
|
|
|
|
public BaseResponse getAliCode(@RequestBody AlihealthGetRelCodeReqeust alihealthGetRelCodeReqeust) {
|
|
|
|
|
|
|
|
|
|
for (IoCollectCodeBackup ioCollectCodeBackup : alihealthGetRelCodeReqeust.getIoCollectCodeBackupList()) {
|
|
|
|
|
relCodeBatchService.addRelCodeAli(ioCollectCodeBackup.getCode(), ioCollectCodeBackup.getOperUser());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return ResultVOUtils.success("成功");
|
|
|
|
|
}
|
|
|
|
|
@Resource
|
|
|
|
|
private IoCodeDao ioCodeDao;
|
|
|
|
|
@Resource
|
|
|
|
|
private AlihealthYljgUtils alihealthYljgUtils;
|
|
|
|
|
@PostMapping("/spms/alihealth/yljgUploadinoutbill")
|
|
|
|
|
@Log(title = "获取阿里药品的采购单码明细", businessType = BusinessType.OTHER)
|
|
|
|
|
public BaseResponse yljgUploadinoutbill(@RequestBody AlihealthGetRelCodeReqeust alihealthGetRelCodeReqeust) {
|
|
|
|
|
|
|
|
|
|
List<String> list = new ArrayList<>();
|
|
|
|
|
list.add("ZS202502170071");
|
|
|
|
|
list.add("ZS202502180035");
|
|
|
|
|
list.add("ZS202502180034");
|
|
|
|
|
list.add("ZS202502180024");
|
|
|
|
|
list.add("ZS202502180013");
|
|
|
|
|
list.add("ZS202502170148");
|
|
|
|
|
list.add("ZS202502180040");
|
|
|
|
|
list.add("ZS202501180311");
|
|
|
|
|
for (String s : list) {
|
|
|
|
|
IoOrderEntity orderEntity = orderService.findByBillNo(s);
|
|
|
|
|
//1.上传入库单
|
|
|
|
|
AlihealthYljgUploadinoutbillReqeust alihealthYljgUploadinoutbillReqeust = new AlihealthYljgUploadinoutbillReqeust();
|
|
|
|
|
alihealthYljgUploadinoutbillReqeust.setBill_code(orderEntity.getBillNo());
|
|
|
|
|
alihealthYljgUploadinoutbillReqeust.setBill_time(DateUtil.formatDateTime(orderEntity.getAuditTime()));
|
|
|
|
|
alihealthYljgUploadinoutbillReqeust.setBill_type(102);
|
|
|
|
|
// 先写死 到时候以阿里的为准
|
|
|
|
|
alihealthYljgUploadinoutbillReqeust.setPhysic_type(3);
|
|
|
|
|
alihealthYljgUploadinoutbillReqeust.setClient_type("2");
|
|
|
|
|
// 查询改单据传的码
|
|
|
|
|
List<IoCodeEntity> ioCodeEntityList = ioCodeDao.selectList(new QueryWrapper<IoCodeEntity>().eq("orderId", orderEntity.getBillNo()));
|
|
|
|
|
if (ioCodeEntityList != null && ioCodeEntityList.size() > 0) {
|
|
|
|
|
List<String> codeList = new ArrayList<>();
|
|
|
|
|
for (IoCodeEntity ioCodeEntity : ioCodeEntityList) {
|
|
|
|
|
codeList.add(ioCodeEntity.getCode());
|
|
|
|
|
}
|
|
|
|
|
Set<String> set = new HashSet<>(codeList);
|
|
|
|
|
alihealthYljgUploadinoutbillReqeust.setTrace_codes(String.join(",", codeList));
|
|
|
|
|
// 单据上传先注释了
|
|
|
|
|
BaseResponse baseResponseUploadinoutbill = alihealthYljgUtils.yljgUploadinoutbill(alihealthYljgUploadinoutbillReqeust, orderEntity.getFromCorp());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return ResultVOUtils.success("成功");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|