|
|
|
@ -3,6 +3,7 @@ package com.glxp.api.controller.inout;
|
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
|
|
import com.glxp.api.annotation.AuthRuleAnnotation;
|
|
|
|
|
import com.glxp.api.common.enums.ResultEnum;
|
|
|
|
@ -10,22 +11,24 @@ import com.glxp.api.common.res.BaseResponse;
|
|
|
|
|
import com.glxp.api.common.util.ResultVOUtils;
|
|
|
|
|
import com.glxp.api.constant.ConstantType;
|
|
|
|
|
import com.glxp.api.controller.BaseController;
|
|
|
|
|
import com.glxp.api.entity.auth.AuthCompany;
|
|
|
|
|
import com.glxp.api.entity.basic.BasicBussinessTypeEntity;
|
|
|
|
|
import com.glxp.api.entity.inout.IoOrderDetailBizEntity;
|
|
|
|
|
import com.glxp.api.entity.inout.IoOrderDetailCodeEntity;
|
|
|
|
|
import com.glxp.api.entity.inout.IoOrderEntity;
|
|
|
|
|
import com.glxp.api.entity.system.SysPdfTemplateRelevanceStatemenEntity;
|
|
|
|
|
import com.glxp.api.entity.system.SystemPDFTemplateEntity;
|
|
|
|
|
import com.glxp.api.req.inout.FilterCodeRequest;
|
|
|
|
|
import com.glxp.api.req.inout.FilterOrderDetailResultRequest;
|
|
|
|
|
import com.glxp.api.req.inout.FilterOrderRequest;
|
|
|
|
|
import com.glxp.api.req.inout.InspectionPDFTemplateRequest;
|
|
|
|
|
import com.glxp.api.req.inout.*;
|
|
|
|
|
import com.glxp.api.res.inout.CptTraceOrderResponse;
|
|
|
|
|
import com.glxp.api.res.inout.CptTraceResultResponse;
|
|
|
|
|
import com.glxp.api.res.inout.IoCodeResponse;
|
|
|
|
|
import com.glxp.api.res.inout.IoOrderDetailResultResponse;
|
|
|
|
|
import com.glxp.api.service.auth.AuthCompanyService;
|
|
|
|
|
import com.glxp.api.service.basic.IBasicBussinessTypeService;
|
|
|
|
|
import com.glxp.api.service.inout.*;
|
|
|
|
|
import com.glxp.api.service.system.SystemPDFModuleService;
|
|
|
|
|
import com.glxp.api.service.system.SystemPDFTemplateService;
|
|
|
|
|
import com.glxp.api.util.DateUtil;
|
|
|
|
|
import com.glxp.api.util.JasperUtils;
|
|
|
|
|
import net.sf.jasperreports.engine.JRException;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
|
@ -40,10 +43,7 @@ import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
import java.io.IOException;
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 单据扫码明细查询接口
|
|
|
|
@ -64,6 +64,8 @@ public class IoOrderDetailResultController extends BaseController {
|
|
|
|
|
private SystemPDFModuleService systemPDFModuleService;
|
|
|
|
|
@Value("${file_path}")
|
|
|
|
|
private String filePath;
|
|
|
|
|
@Resource
|
|
|
|
|
AuthCompanyService authCompanyService;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 查询单据扫码明细列表
|
|
|
|
@ -183,7 +185,6 @@ public class IoOrderDetailResultController extends BaseController {
|
|
|
|
|
return ResultVOUtils.success(sysPdfTemplateRelevanceStatemenEntity.getTemplateId());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 出入库明细打印
|
|
|
|
|
*
|
|
|
|
@ -256,4 +257,50 @@ public class IoOrderDetailResultController extends BaseController {
|
|
|
|
|
return ResultVOUtils.success();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 提供UDI协调调用单据明细
|
|
|
|
|
*/
|
|
|
|
|
@PostMapping("/udiCpt/inout/trace/search")
|
|
|
|
|
public BaseResponse cptTraceOrder(@RequestBody CptTraceRequest cptTraceRequest) {
|
|
|
|
|
if (StrUtil.isEmpty(cptTraceRequest.getBatchNo()) || CollUtil.isEmpty(cptTraceRequest.getDiList())) {
|
|
|
|
|
return ResultVOUtils.error(500, "参数有误!");
|
|
|
|
|
}
|
|
|
|
|
AuthCompany authCompany = authCompanyService.getOne(new QueryWrapper<>());
|
|
|
|
|
List<CptTraceOrderResponse> cptTraceOrderResponses = orderDetailResultService.cptTrace(cptTraceRequest);
|
|
|
|
|
List<CptTraceResultResponse> cptTraceResultResponses = new ArrayList<>();
|
|
|
|
|
if (CollUtil.isNotEmpty(cptTraceOrderResponses)) {
|
|
|
|
|
for (CptTraceOrderResponse cptTraceOrderResponse : cptTraceOrderResponses) {
|
|
|
|
|
|
|
|
|
|
CptTraceResultResponse cptTraceResultResponse = new CptTraceResultResponse();
|
|
|
|
|
cptTraceResultResponse.setBillNo(cptTraceOrderResponse.getBillNo());
|
|
|
|
|
cptTraceResultResponse.setBillDate(DateUtil.formatDate(cptTraceOrderResponse.getCreateTime()));
|
|
|
|
|
cptTraceResultResponse.setBillType(cptTraceOrderResponse.getBillType());
|
|
|
|
|
|
|
|
|
|
if (cptTraceOrderResponse.getMainAction().equals(ConstantType.TYPE_OUT)) {
|
|
|
|
|
if (StrUtil.isNotEmpty(cptTraceOrderResponse.getFromInvCode()))
|
|
|
|
|
continue;
|
|
|
|
|
cptTraceResultResponse.setInOutType(2);
|
|
|
|
|
cptTraceResultResponse.setFromCorp(authCompany.getName());
|
|
|
|
|
cptTraceResultResponse.setFromCorpCreditNum(authCompany.getCreditCode());
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
cptTraceResultResponse.setInOutType(1);
|
|
|
|
|
cptTraceResultResponse.setFromCorp(cptTraceOrderResponse.getFromCorpName());
|
|
|
|
|
cptTraceResultResponse.setFromCorpCreditNum(cptTraceOrderResponse.getCreditNo());
|
|
|
|
|
cptTraceResultResponse.setToCorp(authCompany.getName());
|
|
|
|
|
cptTraceResultResponse.setToCorpCreditNum(authCompany.getCreditCode());
|
|
|
|
|
}
|
|
|
|
|
if (StrUtil.isEmpty(cptTraceOrderResponse.getFromCorpName()) && cptTraceOrderResponse.getMainAction().equals(ConstantType.TYPE_OUT)) {
|
|
|
|
|
cptTraceResultResponse.setBillType("使用出库");
|
|
|
|
|
cptTraceResultResponse.setToUserInfo("患者使用出库");
|
|
|
|
|
}
|
|
|
|
|
cptTraceResultResponses.add(cptTraceResultResponse);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return ResultVOUtils.success(cptTraceResultResponses);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|