住院条码修改

This commit is contained in:
jiangs 2026-01-05 11:58:56 +08:00
parent d8f0869cd3
commit 85209f51ad
4 changed files with 72 additions and 28 deletions

View File

@ -125,7 +125,8 @@ public class ReportUtil {
public Result printToPdf(String templatename, ReportParam reportParam, String pdfName, boolean base64) { public Result printToPdf(String templatename, ReportParam reportParam, String pdfName, boolean base64) {
String staticpath=ImageUtils.getStaticPath()+ File.separator; String staticpath=ImageUtils.getStaticPath()+ File.separator;
String outputPath = staticpath+ File.separator + "printPDF"+ File.separator + UUID.randomUUID() + ".pdf"; // PDF输出路径(多级目录会自动创建) String pdfName1 = UUID.randomUUID().toString();
String outputPath = staticpath+ File.separator + "printPDF"+ File.separator + pdfName1 + ".pdf"; // PDF输出路径(多级目录会自动创建)
Map<String, Object> stringObjectMap = BeanUtil.beanToMap(reportParam); Map<String, Object> stringObjectMap = BeanUtil.beanToMap(reportParam);
try { try {
Connection connection = dataSource.getConnection(); Connection connection = dataSource.getConnection();
@ -134,7 +135,7 @@ public class ReportUtil {
e.printStackTrace(); e.printStackTrace();
log.error("打印条码失败,参数{}", reportParam, e); log.error("打印条码失败,参数{}", reportParam, e);
} }
String httpPath = getPrintURL(pdfName); String httpPath = getPrintURL(pdfName1);
log.info("传给前端的pdf地址:{}", httpPath); log.info("传给前端的pdf地址:{}", httpPath);
if (base64) { if (base64) {
//删除图片文件 //删除图片文件

View File

@ -0,0 +1,67 @@
/****** Object: UserDefinedFunction [dbo].[GetAge] Script Date: 01/04/2026 17:30:01 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE FUNCTION [dbo].[GetAge]
(
@BirthDay nvarchar(20) --生日
)
RETURNS varchar(20)
AS
BEGIN
if(@BirthDay is NUlL or @BirthDay='')
return '';
-- Declare the return variable here
DECLARE @age varchar(20)
DECLARE @years int
DECLARE @months int
DECLARE @days int
-- Add the T-SQL statements to compute the return value here
set @age = ''
set @years = year(GETDATE()) - year(@birthday)
set @months = month(GETDATE()) - month(@birthday)
if day(@birthday)<=day(GETDATE())
set @days = day(GETDATE()) - day(@birthday)
else
begin
set @months = @months - 1
if MONTH(@birthday) in (1,3,5,7,8,10,12)
set @days = 31-day(@birthday)+day(GETDATE())
else if MONTH(@birthday) in (4,6,9,11)
set @days = 30-day(@birthday)+day(GETDATE())
else if MONTH(@birthday) = 2
if (year(@birthday)%4 = 0 and year(@birthday)%100 <> 0) or year(@birthday)%400 = 0
set @days = 29-day(@birthday)+day(GETDATE())
else
set @days = 28-day(@birthday)+day(GETDATE())
end
if @months < 0
begin
set @years = @years - 1
set @months = @months + 12
end
if @years = 0 and @months = 0
begin
return convert(varchar,@days+1) + '天'
end
if @years > 0
set @age = cast(@years as varchar(5)) + '岁'
if @years < 3 and @months > 0 and @years>-1
begin
set @age = @age + cast(@months as varchar(5)) + '月'
end
if @years<0
set @age=''
RETURN @age
END
GO

View File

@ -170,33 +170,9 @@ public class ZycxServiceImpl implements ZycxService {
} }
public Result printBarCode(String sqh){ public Result printBarCode(String sqh){
LabReqmain labReqmainOne = commonUtil.getLabReqmainOne(sqh);
//List<LabReqdetail> labReqdetailList = commonUtil.getLabReqdetailList(sqh);
if(labReqmainOne == null) return new Result("-1","未查到条码号:"+sqh+"的申请单数据!");
ReportParam reportParam = new ReportParam(); ReportParam reportParam = new ReportParam();
reportParam.setSqh(sqh); reportParam.setSqh(sqh);
Map<String, String> ageFromBirthDay = LisUtil.getAgeFromBirthDay(DateUtil.format(labReqmainOne.getBrsr(), "yyyy-MM-dd HH:mm:ss")); return reportUtil.printToPdf("barcode_zy",reportParam, sqh,false);
String age = ageFromBirthDay.get("age");
String unit = ageFromBirthDay.get("unit");
reportParam.setNl(age + unit);
reportParam.setBrxm(labReqmainOne.getBrxm());
String brxb = labReqmainOne.getBrxb();
switch (brxb) {
case "1":
brxb = "男";
break;
case "2":
brxb = "女";
break;
default:
brxb = "";
}
reportParam.setBrxb(brxb);
reportParam.setSfxmmc(labReqmainOne.getJymd());
log.info("传给打印的数据为:{},{}", reportParam,sqh);
return reportUtil.printToPdf(reportParam, sqh);
} }

View File

@ -13,7 +13,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
(select yhxm from com_usr where yhdh = a.jsys) as jsysname, (select yhxm from com_usr where yhdh = a.jsys) as jsysname,
(select zdmc from com_dict where zdlb = 'DP' AND zddh = a.ksdh) as ksname, (select zdmc from com_dict where zdlb = 'DP' AND zddh = a.ksdh) as ksname,
c.confirmdt as confirmdt c.confirmdt as confirmdt
from lab_reqmain a,lab_feeitemclass b,lab_pat c where a.bgddh = b.sflbdh and a.sqh = c.sqh from lab_reqmain a left join lab_feeitemclass b on (a.bgddh = b.sflbdh),lab_pat c where a.sqh = c.sqh
</sql> </sql>
<select id="getSQDInfo" parameterType="com.czlis.zycx.pojo.Web_getBarcode" resultType="com.czlis.zycx.pojo.Web_getBarcode"> <select id="getSQDInfo" parameterType="com.czlis.zycx.pojo.Web_getBarcode" resultType="com.czlis.zycx.pojo.Web_getBarcode">