From a90def03d63d307eafd4640abd6ad59f37b48566 Mon Sep 17 00:00:00 2001 From: "15881625488@163.com" <15881625488@163.com> Date: Sun, 18 Jan 2026 16:44:30 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9A[=E8=B5=84=E6=BA=90=E5=BA=93?= =?UTF-8?q?=E7=AE=A1=E7=90=86]=E7=BB=99=E8=8D=AF=E5=88=B6=E5=89=82=20?= =?UTF-8?q?=E8=AF=A6=E6=83=85=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hxhq/business/controller/GyzjController.java | 3 +- .../service/impl/GyzjFfjlJcgjServiceImpl.java | 4 +- .../business/service/impl/GyzjJcgjServiceImpl.java | 6 +- .../business/service/impl/GyzjServiceImpl.java | 14 +- .../business/service/impl/GyzjTzServiceImpl.java | 4 +- .../service/impl/MjyFfjlJcgjServiceImpl.java | 4 +- .../business/service/impl/MjyJcgjServiceImpl.java | 6 +- .../hxhq/business/service/impl/MjyServiceImpl.java | 11 +- .../business/service/impl/MjyTzServiceImpl.java | 4 +- .../java/com/hxhq/business/utils/GyzjJcnrUtil.java | 181 ++++++++++++--------- .../java/com/hxhq/business/utils/MjyJcnrUtil.java | 140 ++++++++-------- .../com/hxhq/business/utils/pdf/PdfBaseUtil.java | 2 - .../hxhq/business/utils/pdf/resource/Dosage.java | 101 ++++++++---- 13 files changed, 281 insertions(+), 199 deletions(-) diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/GyzjController.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/GyzjController.java index 7ac46b0..9efe5b3 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/GyzjController.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/GyzjController.java @@ -113,7 +113,7 @@ public class GyzjController extends BaseController */ @RequiresPermissions("business:resource:gyzj:xq") @GetMapping(value = "/exportDetail") - public AjaxResult exportDetail(Long id) { + public AjaxResult exportDetail(Long id,String lang) { GyzjJcgj gyzjJcgj = new GyzjJcgj(); gyzjJcgj.setGyzjId(id); List gyzjJcgjList = gyzjJcgjService.queryList(gyzjJcgj); @@ -126,6 +126,7 @@ public class GyzjController extends BaseController gyzjService.queryInfo(id), gyzjTzList, gyzjJcgjList, + lang, localFilePath)); } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GyzjFfjlJcgjServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GyzjFfjlJcgjServiceImpl.java index 1f62d47..09515a0 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GyzjFfjlJcgjServiceImpl.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GyzjFfjlJcgjServiceImpl.java @@ -67,7 +67,7 @@ public class GyzjFfjlJcgjServiceImpl extends ServiceImpl i gyzjJcgj.setGyzjId(gyzjId); gyzjJcgj.setJcgjlx(jcgjlx); gyzjJcgj.setJcmc(jcmc); - gyzjJcgj.setJcmcEn(GyzjJcnrUtil.getQmyyEn(jcmc)); + gyzjJcgj.setJcmcEn(GyzjJcnrUtil.getEn(jcmc)); gyzjJcgj.setJcmcys(jcmcys); if(jcnr!=null){ gyzjJcgj.setJcnr(JctUtil.formatStr(jcnr)); @@ -99,7 +99,7 @@ public class GyzjJcgjServiceImpl extends ServiceImpl i gyzjJcgj.setGyzjId(gyzjId); gyzjJcgj.setJcgjlx(jcgjlx); gyzjJcgj.setJcmc(jcmc); - gyzjJcgj.setJcmcEn(GyzjJcnrUtil.getQmyyEn(jcmc)); + gyzjJcgj.setJcmcEn(GyzjJcnrUtil.getEn(jcmc)); gyzjJcgj.setJcmcys(jcmcys); if(jcnr!=null){ gyzjJcgj.setJcnr(JctUtil.formatStr(jcnr)); @@ -131,7 +131,7 @@ public class GyzjJcgjServiceImpl extends ServiceImpl i gyzjJcgj.setGyzjId(gyzjId); gyzjJcgj.setJcgjlx(jcgjlx); gyzjJcgj.setJcmc(jcmc); - gyzjJcgj.setJcmcEn(GyzjJcnrUtil.getQmyyEn(jcmc)); + gyzjJcgj.setJcmcEn(GyzjJcnrUtil.getEn(jcmc)); gyzjJcgj.setJcmcys(jcmcys); gyzjJcgj.setJcnr(jcnr); gyzjJcgj.setJcnrEn(jcnrEn); diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GyzjServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GyzjServiceImpl.java index bbbba0f..199b639 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GyzjServiceImpl.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GyzjServiceImpl.java @@ -1215,7 +1215,11 @@ public class GyzjServiceImpl extends ServiceImpl implements IG Map formData = new LinkedHashMap<>(); formData.put("存储位置", form.getCcwz()); formData.put("存储条件", form.getCctj()); - gyzjJcgjService.saveJcgj(gyzjOld.getId(), JcgjlxEnum.lc.getValue(), "存储", JcmcysEnum.green.getValue(), formData, qmr, form.getRemark()); + formData.put("签名人1", qmr.getNickName()); + formData.put("签名人2", qmr.getNickName()); + gyzjJcgjService.saveJcgj(gyzjOld.getId(), JcgjlxEnum.lc.getValue(), "存储", JcmcysEnum.green.getValue(), formData, null, form.getRemark()); + //台账 + gyzjTzService.saveTz(gyzjOld.getId(),null,null,qmr,qmr2,null,null,null,null,null,"存储",gyzjOld.getKc(),gyzjOld.getKcdw(),form.getRemark()); } @@ -1244,8 +1248,12 @@ public class GyzjServiceImpl extends ServiceImpl implements IG gyzjOld.setCczt(CcztEnum.Qc.getValue()); this.updateById(gyzjOld); //稽查轨迹 - gyzjJcgjService.saveJcgj(gyzjOld.getId(), JcgjlxEnum.lc.getValue(), "取出", JcmcysEnum.green.getValue(), null, qmr, form.getRemark()); - + Map formData = new LinkedHashMap<>(); + formData.put("签名人1", qmr.getNickName()); + formData.put("签名人2", qmr.getNickName()); + gyzjJcgjService.saveJcgj(gyzjOld.getId(), JcgjlxEnum.lc.getValue(), "取出", JcmcysEnum.green.getValue(), formData, null, form.getRemark()); + //台账 + gyzjTzService.saveTz(gyzjOld.getId(),null,null,qmr,qmr2,null,null,null,null,null,"取出",gyzjOld.getKc(),gyzjOld.getKcdw(),form.getRemark()); } /** diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GyzjTzServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GyzjTzServiceImpl.java index a2adcc1..829aac1 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GyzjTzServiceImpl.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GyzjTzServiceImpl.java @@ -83,7 +83,7 @@ public class GyzjTzServiceImpl extends ServiceImpl impleme gyzjTz.setQmrMcEn(qmr.getUserName()); } gyzjTz.setQmyy(qmyy); - gyzjTz.setQmyyEn(GyzjJcnrUtil.getQmyyEn(qmyy)); + gyzjTz.setQmyyEn(GyzjJcnrUtil.getEn(qmyy)); gyzjTz.setCzldw(czldw); gyzjTz.setCzl(czl); gyzjTz.setRemark(remark); @@ -133,7 +133,7 @@ public class GyzjTzServiceImpl extends ServiceImpl impleme gyzjTz.setQmrMcEn(qmr.getUserName()); } gyzjTz.setQmyy(qmyy); - gyzjTz.setQmyyEn(GyzjJcnrUtil.getQmyyEn(qmyy)); + gyzjTz.setQmyyEn(GyzjJcnrUtil.getEn(qmyy)); gyzjTz.setCzldw(czldw); gyzjTz.setCzl(czl); gyzjTz.setRemark(remark); diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/MjyFfjlJcgjServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/MjyFfjlJcgjServiceImpl.java index cc3e254..d71b7ce 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/MjyFfjlJcgjServiceImpl.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/MjyFfjlJcgjServiceImpl.java @@ -67,7 +67,7 @@ public class MjyFfjlJcgjServiceImpl extends ServiceImpl impl mjyJcgj.setMjyId(mjyId); mjyJcgj.setJcgjlx(jcgjlx); mjyJcgj.setJcmc(jcmc); - mjyJcgj.setJcmcEn(MjyJcnrUtil.getQmyyEn(jcmc)); + mjyJcgj.setJcmcEn(MjyJcnrUtil.getEn(jcmc)); mjyJcgj.setJcmcys(jcmcys); if(jcnr!=null){ mjyJcgj.setJcnr(JctUtil.formatStr(jcnr)); @@ -97,7 +97,7 @@ public class MjyJcgjServiceImpl extends ServiceImpl impl mjyJcgj.setMjyId(mjyId); mjyJcgj.setJcgjlx(jcgjlx); mjyJcgj.setJcmc(jcmc); - mjyJcgj.setJcmcEn(MjyJcnrUtil.getQmyyEn(jcmc)); + mjyJcgj.setJcmcEn(MjyJcnrUtil.getEn(jcmc)); mjyJcgj.setJcmcys(jcmcys); if(jcnr!=null){ mjyJcgj.setJcnr(JctUtil.formatStr(jcnr)); @@ -129,7 +129,7 @@ public class MjyJcgjServiceImpl extends ServiceImpl impl mjyJcgj.setMjyId(mjyId); mjyJcgj.setJcgjlx(jcgjlx); mjyJcgj.setJcmc(jcmc); - mjyJcgj.setJcmcEn(MjyJcnrUtil.getQmyyEn(jcmc)); + mjyJcgj.setJcmcEn(MjyJcnrUtil.getEn(jcmc)); mjyJcgj.setJcmcys(jcmcys); mjyJcgj.setJcnr(jcnr); mjyJcgj.setJcnrEn(jcnrEn); diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/MjyServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/MjyServiceImpl.java index e9a65aa..66dfdfc 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/MjyServiceImpl.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/MjyServiceImpl.java @@ -1108,7 +1108,8 @@ public class MjyServiceImpl extends ServiceImpl implements IMjyS formData.put("存储位置", form.getCcwz()); formData.put("存储条件", form.getCctj()); mjyJcgjService.saveJcgj(mjyOld.getId(), JcgjlxEnum.lc.getValue(), "存储", JcmcysEnum.green.getValue(), formData, qmr, form.getRemark()); - + //台账 + mjyTzService.saveTz(mjyOld.getId(),null,null,qmr,qmr2,null,null,null,null,qmr,"存储",mjyOld.getKc(),mjyOld.getKcdw(),form.getRemark()); } /** @@ -1136,8 +1137,12 @@ public class MjyServiceImpl extends ServiceImpl implements IMjyS mjyOld.setCczt(CcztEnum.Qc.getValue()); this.updateById(mjyOld); //稽查轨迹 - mjyJcgjService.saveJcgj(mjyOld.getId(), JcgjlxEnum.lc.getValue(), "取出", JcmcysEnum.green.getValue(), null, qmr, form.getRemark()); - + Map formData = new LinkedHashMap<>(); + formData.put("签名人1", qmr.getNickName()); + formData.put("签名人2", qmr.getNickName()); + mjyJcgjService.saveJcgj(mjyOld.getId(), JcgjlxEnum.lc.getValue(), "取出", JcmcysEnum.green.getValue(), formData, null, form.getRemark()); + //台账 + mjyTzService.saveTz(mjyOld.getId(),null,null,qmr,qmr2,null,null,null,null,null,"取出",mjyOld.getKc(),mjyOld.getKcdw(),form.getRemark()); } /** diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/MjyTzServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/MjyTzServiceImpl.java index 0439249..5b1f466 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/MjyTzServiceImpl.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/MjyTzServiceImpl.java @@ -82,7 +82,7 @@ public class MjyTzServiceImpl extends ServiceImpl implements mjyTz.setQmrMcEn(qmr.getUserName()); } mjyTz.setQmyy(qmyy); - mjyTz.setQmyyEn(MjyJcnrUtil.getQmyyEn(qmyy)); + mjyTz.setQmyyEn(MjyJcnrUtil.getEn(qmyy)); mjyTz.setCzldw(czldw); mjyTz.setCzl(czl); mjyTz.setRemark(remark); @@ -132,7 +132,7 @@ public class MjyTzServiceImpl extends ServiceImpl implements mjyTz.setQmrMcEn(qmr.getUserName()); } mjyTz.setQmyy(qmyy); - mjyTz.setQmyyEn(MjyJcnrUtil.getQmyyEn(qmyy)); + mjyTz.setQmyyEn(MjyJcnrUtil.getEn(qmyy)); mjyTz.setCzldw(czldw); mjyTz.setCzl(czl); mjyTz.setRemark(remark); diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/GyzjJcnrUtil.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/GyzjJcnrUtil.java index f31ddba..a49a9e4 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/GyzjJcnrUtil.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/GyzjJcnrUtil.java @@ -12,80 +12,101 @@ import java.util.Map; */ public class GyzjJcnrUtil { private static final Logger logger = LoggerFactory.getLogger(GyzjJcnrUtil.class.getName()); - private static HashMap mapJcnr=new HashMap<>(); - private static HashMap mapQmyy=new HashMap<>(); + private static HashMap mapLang=new HashMap<>(); static { - //region 稽查内容 + mapLang.put("入库","In Storage"); + mapLang.put("未入库","'未入库'"); + mapLang.put("已发放","In Use"); + mapLang.put("已锁定","'Locked'"); + mapLang.put("待归档","Pending Archiving"); + mapLang.put("归档","'Archived'"); + mapLang.put("待解档","Pending De-archiving"); + mapLang.put("借阅开始时间","Checkout Start Date"); + mapLang.put("借阅结束时间","Checkout End Date"); + mapLang.put("处置方式","Dispose Method"); + mapLang.put("处置原因","Reason"); + mapLang.put("处置量","Amount"); + mapLang.put("处置人","Operator"); + mapLang.put("复核人","Reviewer"); + mapLang.put("监督人","Supervisor"); + mapLang.put("钥匙1领取人","Key 1 User"); + mapLang.put("钥匙2领取人","Key 2 User"); + mapLang.put("出库量","Out Amount"); + mapLang.put("转移条件","Transfer Condition"); + mapLang.put("出库毛重","Check-out Gross Weight"); + mapLang.put("入库毛重","Check-in Gross Weight"); + mapLang.put("使用量","Usage Amount"); + mapLang.put("归还人1","Returner 1"); + mapLang.put("归还人2","Returner 2"); + mapLang.put("库管员1","Warehouse Keeper 1"); + mapLang.put("库管员2","Warehouse Keeper 2"); + mapLang.put("签名人1","Signed By 1"); + mapLang.put("签名人2","Signed By 2"); + mapLang.put("入库位置","Check-in Location"); + mapLang.put("入库条件","Check-in Condition"); + mapLang.put("入库净重","Check-in Net Weight"); + mapLang.put("入库量","Total Amount"); + mapLang.put("申请备注","Apply Comment"); + mapLang.put("审核备注","Approve Comment"); + mapLang.put("领取人","Recipient"); + mapLang.put("领取人2","Recipient 2"); + mapLang.put("发放人","Issuer"); + mapLang.put("发放人2","Issuer 2"); + mapLang.put("存储条件","Storage Condition"); + mapLang.put("存储位置","Storage Location"); + mapLang.put("使用人","User"); + mapLang.put("领取/归还人","Recipient/Returner"); + mapLang.put("发放/接收人","Issuer/Receiver"); + mapLang.put("操作类型","Action"); + mapLang.put("操作量","Amount"); + mapLang.put("备注/原因","Comment/Reason"); + mapLang.put("操作时间","Datetime"); + mapLang.put("名称","Name"); + mapLang.put("编号","ID"); + mapLang.put("浓度","Concentration"); + mapLang.put("库存量","Amount"); + mapLang.put("失效日期","Expiration"); + mapLang.put("制剂状态","Status"); + mapLang.put("所属表单","In Record"); + mapLang.put("所属试验信息","From Study"); + mapLang.put("表单所属人","By User"); + mapLang.put("基本信息","Information"); + mapLang.put("表单信息","Record Information"); + mapLang.put("稽查轨迹","Track Record"); + mapLang.put("给药制剂台账","Dose Table"); + mapLang.put("备注","Comment"); + mapLang.put("签名人","Signed By"); - mapJcnr.put("借阅开始时间","Checkout Start Date"); - mapJcnr.put("借阅结束时间","Checkout End Date"); - mapJcnr.put("处置方式","Dispose Method"); - mapJcnr.put("处置原因","Reason"); - mapJcnr.put("处置量","Amount"); - mapJcnr.put("处置人","Operator"); - mapJcnr.put("复核人","Reviewer"); - mapJcnr.put("监督人","Supervisor"); - mapJcnr.put("钥匙1领取人","Key 1 User"); - mapJcnr.put("钥匙2领取人","Key 2 User"); - mapJcnr.put("出库量","Out Amount"); - mapJcnr.put("转移条件","Transfer Condition"); - mapJcnr.put("出库毛重","Check-out Gross Weight"); - mapJcnr.put("入库毛重","Check-in Gross Weight"); - mapJcnr.put("使用量","Usage Amount"); - mapJcnr.put("归还人1","Returner 1"); - mapJcnr.put("归还人2","Returner 2"); - mapJcnr.put("库管员1","Warehouse Keeper 1"); - mapJcnr.put("库管员2","Warehouse Keeper 2"); - mapJcnr.put("签名人1","Signed By 1"); - mapJcnr.put("签名人2","Signed By 2"); - mapJcnr.put("入库位置","Check-in Location"); - mapJcnr.put("入库条件","Check-in Condition"); - mapJcnr.put("入库净重","Check-in Net Weight"); - mapJcnr.put("入库量","Total Amount"); - mapJcnr.put("申请备注","Apply Comment"); - mapJcnr.put("审核备注","Approve Comment"); - mapJcnr.put("领取人","Recipient"); - mapJcnr.put("领取人2","Recipient 2"); - mapJcnr.put("发放人","Issuer"); - mapJcnr.put("发放人2","Issuer 2"); + mapLang.put("申请解档","Apply for De-archiving"); + mapLang.put("申请借阅","Apply for Check-out"); + mapLang.put("申请归档","Apply for Archiving"); + mapLang.put("锁定给药制剂","Lock Drug"); + mapLang.put("解锁给药制剂","Unlock Drug"); + mapLang.put("处置药剂","Dispose Substance"); + mapLang.put("处置容器","Dispose Container"); + mapLang.put("钥匙发放","Issue Key"); + mapLang.put("申请编辑","Apply Edit"); + mapLang.put("同意编辑","Approve Edit"); + mapLang.put("拒绝编辑","Reject Edit"); + mapLang.put("修改库存申请","Apply Edit Inventory"); + mapLang.put("同意修改库存","Approve Edit Inventory"); + mapLang.put("拒绝修改库存","Reject Edit Inventory"); + mapLang.put("归还","Return"); + mapLang.put("确认归还","Confirm Check-in"); + mapLang.put("领取发放","Distribution"); + mapLang.put("存储","Storage"); + mapLang.put("取出","Take Out"); - mapJcnr.put("目的","目的"); - //endregion - - //region 稽查名称 - - mapQmyy.put("申请解档","Apply for De-archiving"); - mapQmyy.put("申请借阅","Apply for Check-out"); - mapQmyy.put("申请归档","Apply for Archiving"); - mapQmyy.put("锁定给药制剂","Lock Drug"); - mapQmyy.put("解锁给药制剂","Unlock Drug"); - mapQmyy.put("处置药剂","Dispose Substance"); - mapQmyy.put("处置容器","Dispose Container"); - mapQmyy.put("钥匙发放","Issue Key"); - mapQmyy.put("申请编辑","Apply Edit"); - mapQmyy.put("同意编辑","Approve Edit"); - mapQmyy.put("拒绝编辑","Reject Edit"); - mapQmyy.put("修改库存申请","Apply Edit Inventory"); - mapQmyy.put("同意修改库存","Approve Edit Inventory"); - mapQmyy.put("拒绝修改库存","Reject Edit Inventory"); - mapQmyy.put("归还","Return"); - mapQmyy.put("确认归还","Confirm Check-in"); - mapQmyy.put("领取发放","Distribution"); - mapQmyy.put("存储","Storage"); - mapQmyy.put("取出","Take Out"); - - mapQmyy.put("锁定发放记录","锁定发放记录"); - mapQmyy.put("解锁发放记录","解锁发放记录"); - mapQmyy.put("给药制剂入库","给药制剂入库"); - mapQmyy.put("同意入库","同意入库"); - mapQmyy.put("拒绝入库","拒绝入库"); - - //endregion + mapLang.put("锁定发放记录","锁定发放记录"); + mapLang.put("解锁发放记录","解锁发放记录"); + mapLang.put("给药制剂入库","给药制剂入库"); + mapLang.put("同意入库","同意入库"); + mapLang.put("拒绝入库","拒绝入库"); + mapLang.put("目的","目的"); } - public static void main(String[] args) { Map formData = new LinkedHashMap<>(); formData.put("申请备注", "1111"); @@ -93,25 +114,39 @@ public class GyzjJcnrUtil { logger.info(getJcnrEn(formData)); } /** - * 获取签名意义英文 - * @param qmyy + * 获取英文 + * @param name * @return */ - public static String getQmyyEn(String qmyy) { - return mapQmyy.get(qmyy); + public static String getEn(String name) { + return mapLang.get(name); } + /** * 稽查名称英文 * @param map * @return */ public static String getJcnrEn(Map map) { - Map result =new HashMap<>(); + Map result =new LinkedHashMap<>(); for (Map.Entry entry : map.entrySet()) { - result.put(mapJcnr.get(entry.getKey()),entry.getValue()); + result.put(mapLang.get(entry.getKey()),entry.getValue()); } return JctUtil.formatStr(result); } + /** + * 稽查名称英文 + * @param map + * @return + */ + public static Map getMapEn(Map map) { + Map result =new LinkedHashMap<>(); + for (Map.Entry entry : map.entrySet()) { + result.put(mapLang.get(entry.getKey()),entry.getValue()); + } + return result; + } + } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/MjyJcnrUtil.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/MjyJcnrUtil.java index c42d15f..0eadf61 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/MjyJcnrUtil.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/MjyJcnrUtil.java @@ -13,71 +13,64 @@ import java.util.Map; */ public class MjyJcnrUtil { private static final Logger logger = LoggerFactory.getLogger(MjyJcnrUtil.class.getName()); - private static HashMap mapJcnr=new HashMap<>(); - private static HashMap mapQmyy=new HashMap<>(); + private static HashMap mapLang=new HashMap<>(); static { - //region 稽查内容 - mapJcnr.put("借阅开始时间","Checkout Start Date"); - mapJcnr.put("借阅结束时间","Checkout End Date"); - mapJcnr.put("处置方式","Dispose Method"); - mapJcnr.put("处置原因","Reason"); - mapJcnr.put("处置量","Amount"); - mapJcnr.put("处置人","Operator"); - mapJcnr.put("复核人","Reviewer"); - mapJcnr.put("监督人","Supervisor"); - mapJcnr.put("钥匙1领取人","Key 1 User"); - mapJcnr.put("钥匙2领取人","Key 2 User"); - mapJcnr.put("发放人","Issuer"); - mapJcnr.put("出库量","Out Amount"); - mapJcnr.put("转移条件","Transfer Condition"); - mapJcnr.put("出库毛重","Check-out Gross Weight"); - mapJcnr.put("入库毛重","Check-in Gross Weight"); - mapJcnr.put("使用量","Usage Amount"); - mapJcnr.put("归还人1","Returner 1"); - mapJcnr.put("归还人2","Returner 2"); - mapJcnr.put("库管员1","Warehouse Keeper 1"); - mapJcnr.put("库管员2","Warehouse Keeper 2"); - mapJcnr.put("签名人1","Signed By 1"); - mapJcnr.put("签名人2","Signed By 2"); - mapJcnr.put("申请备注","Apply Comment"); - mapJcnr.put("审核备注","Approve Comment"); - - mapJcnr.put("目的","目的"); - mapJcnr.put("入库位置","入库位置"); - mapJcnr.put("入库条件","入库条件"); - mapJcnr.put("减少量","减少量"); - - //endregion - - //region 稽查名称 - - mapQmyy.put("申请解档","Apply for De-archiving"); - mapQmyy.put("申请借阅","Apply for Check-out"); - mapQmyy.put("申请归档","Apply for Archiving"); - mapQmyy.put("锁定麻精药","Lock Drug"); - mapQmyy.put("解锁麻精药","Unlock Drug"); - mapQmyy.put("处置药剂","Dispose Substance"); - mapQmyy.put("处置容器","Dispose Container"); - mapQmyy.put("钥匙发放","Issue Key"); - mapQmyy.put("申请编辑","Apply Edit"); - mapQmyy.put("同意编辑","Approve Edit"); - mapQmyy.put("拒绝编辑","Reject Edit"); - mapQmyy.put("修改库存申请","Apply Change Inventory"); - mapQmyy.put("同意修改库存","Approve Change Inventory"); - mapQmyy.put("拒绝修改库存","Reject Change Inventory"); - mapQmyy.put("归还","Return"); - mapQmyy.put("领取发放","Distribution"); - mapQmyy.put("存储","Storage"); - mapQmyy.put("取出","Take Out"); - - mapQmyy.put("锁定发放记录","锁定发放记录"); - mapQmyy.put("解锁发放记录","解锁发放记录"); - mapQmyy.put("麻精药入库","麻精药入库"); - - - - //endregion + mapLang.put("借阅开始时间","Checkout Start Date"); + mapLang.put("借阅结束时间","Checkout End Date"); + mapLang.put("处置方式","Dispose Method"); + mapLang.put("处置原因","Reason"); + mapLang.put("处置量","Amount"); + mapLang.put("处置人","Operator"); + mapLang.put("复核人","Reviewer"); + mapLang.put("监督人","Supervisor"); + mapLang.put("钥匙1领取人","Key 1 User"); + mapLang.put("钥匙2领取人","Key 2 User"); + mapLang.put("发放人","Issuer"); + mapLang.put("出库量","Out Amount"); + mapLang.put("转移条件","Transfer Condition"); + mapLang.put("出库毛重","Check-out Gross Weight"); + mapLang.put("入库毛重","Check-in Gross Weight"); + mapLang.put("使用量","Usage Amount"); + mapLang.put("归还人1","Returner 1"); + mapLang.put("归还人2","Returner 2"); + mapLang.put("库管员1","Warehouse Keeper 1"); + mapLang.put("库管员2","Warehouse Keeper 2"); + mapLang.put("签名人1","Signed By 1"); + mapLang.put("签名人2","Signed By 2"); + mapLang.put("申请备注","Apply Comment"); + mapLang.put("审核备注","Approve Comment"); + mapLang.put("存储条件","Storage Condition"); + mapLang.put("存储位置","Storage Location"); + + mapLang.put("目的","目的"); + mapLang.put("入库位置","入库位置"); + mapLang.put("入库条件","入库条件"); + mapLang.put("减少量","减少量"); + + + mapLang.put("申请解档","Apply for De-archiving"); + mapLang.put("申请借阅","Apply for Check-out"); + mapLang.put("申请归档","Apply for Archiving"); + mapLang.put("锁定麻精药","Lock Drug"); + mapLang.put("解锁麻精药","Unlock Drug"); + mapLang.put("处置药剂","Dispose Substance"); + mapLang.put("处置容器","Dispose Container"); + mapLang.put("钥匙发放","Issue Key"); + mapLang.put("申请编辑","Apply Edit"); + mapLang.put("同意编辑","Approve Edit"); + mapLang.put("拒绝编辑","Reject Edit"); + mapLang.put("修改库存申请","Apply Change Inventory"); + mapLang.put("同意修改库存","Approve Change Inventory"); + mapLang.put("拒绝修改库存","Reject Change Inventory"); + mapLang.put("归还","Return"); + mapLang.put("领取发放","Distribution"); + mapLang.put("存储","Storage"); + mapLang.put("取出","Take Out"); + + mapLang.put("锁定发放记录","锁定发放记录"); + mapLang.put("解锁发放记录","解锁发放记录"); + mapLang.put("麻精药入库","麻精药入库"); } @@ -94,8 +87,8 @@ public class MjyJcnrUtil { * @param qmyy * @return */ - public static String getQmyyEn(String qmyy) { - return mapQmyy.get(qmyy); + public static String getEn(String qmyy) { + return mapLang.get(qmyy); } /** @@ -104,11 +97,24 @@ public class MjyJcnrUtil { * @return */ public static String getJcnrEn(Map map) { - Map result =new HashMap<>(); + Map result =new LinkedHashMap<>(); for (Map.Entry entry : map.entrySet()) { - result.put(mapJcnr.get(entry.getKey()),entry.getValue()); + result.put(mapLang.get(entry.getKey()),entry.getValue()); } return JctUtil.formatStr(result); } + /** + * 稽查名称英文 + * @param map + * @return + */ + public static Map getMapEn(Map map) { + Map result =new LinkedHashMap<>(); + for (Map.Entry entry : map.entrySet()) { + result.put(mapLang.get(entry.getKey()),entry.getValue()); + } + return result; + } + } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/pdf/PdfBaseUtil.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/pdf/PdfBaseUtil.java index 3731c60..0cea8e3 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/pdf/PdfBaseUtil.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/pdf/PdfBaseUtil.java @@ -96,8 +96,6 @@ public class PdfBaseUtil { underline.setAlignment(Element.ALIGN_LEFT); // 添加到文档 document.add(underline); - // 添加一些间距 - document.add(new Paragraph(titleText)); } } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/pdf/resource/Dosage.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/pdf/resource/Dosage.java index d0eb1ae..0243025 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/pdf/resource/Dosage.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/pdf/resource/Dosage.java @@ -5,6 +5,8 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.hxhq.business.domain.GyzjJcgj; import com.hxhq.business.domain.GyzjTz; import com.hxhq.business.dto.gyzj.DetailDto; +import com.hxhq.business.enums.zykgl.ZjztEnum; +import com.hxhq.business.utils.GyzjJcnrUtil; import com.hxhq.business.utils.pdf.PdfBaseUtil; import com.hxhq.common.core.utils.StringUtils; import com.hxhq.common.security.utils.SecurityUtils; @@ -36,20 +38,20 @@ public class Dosage { * @param gyzj * @return */ - public String exportDetail(DetailDto gyzj, List gyzjTzList, List gyzjJcgjList, String localFilePath) { + public String exportDetail(DetailDto gyzj, List gyzjTzList, List gyzjJcgjList, String lang, String localFilePath) { Document document = null; FileOutputStream fos = null; SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String filePath = PdfBaseUtil.getFilePath(localFilePath); try { - String sign="华西海圻"; - LoginUser loginUser=SecurityUtils.getLoginUser(); - if(loginUser!=null){ - sign=loginUser.getSysUser().getNickName(); + String sign = "en".equals(lang) ? "hxhq" : "华西海圻"; + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (loginUser != null) { + sign = loginUser.getSysUser().getNickName(); } - document = PdfBaseUtil.init(document, fos, filePath, sign+sdf.format(new Date()), null); + document = PdfBaseUtil.init(document, fos, filePath, sign + sdf.format(new Date()), null); // 基本信息 - PdfBaseUtil.addUnderlinedTitle(document, "基本信息", 10,true); + PdfBaseUtil.addUnderlinedTitle(document, "en".equals(lang) ? GyzjJcnrUtil.getEn("基本信息") : "基本信息", 10, true); Map formData1 = new LinkedHashMap<>(); formData1.put("名称", gyzj.getMc()); formData1.put("编号", gyzj.getBh()); @@ -58,20 +60,21 @@ public class Dosage { formData1.put("失效日期", sdf.format(gyzj.getSxrq())); formData1.put("存储条件", gyzj.getCctj()); formData1.put("存储位置", gyzj.getCcwz()); - PdfBaseUtil.addFormTableColumns(document, formData1, 2); + formData1.put("制剂状态", "en".equals(lang) ? (GyzjJcnrUtil.getEn(ZjztEnum.getEnumByValue(gyzj.getZjzt()).getText())) : ZjztEnum.getEnumByValue(gyzj.getZjzt()).getText()); + PdfBaseUtil.addFormTableColumns(document, "en".equals(lang) ? GyzjJcnrUtil.getMapEn(formData1) : formData1, 2); // 表单信息 - PdfBaseUtil.addUnderlinedTitle(document, "表单信息", 10,true); + PdfBaseUtil.addUnderlinedTitle(document, "en".equals(lang) ? GyzjJcnrUtil.getEn("表单信息") : "表单信息", 10, true); Map formData3 = new LinkedHashMap<>(); - formData3.put("所属表单", gyzj.getBdMc()); formData3.put("所属试验信息", gyzj.getStudyMc()); + formData3.put("所属表单", gyzj.getBdMc()); formData3.put("表单所属人", gyzj.getBdgsrMc()); - PdfBaseUtil.addFormTableColumns(document, formData3, 2); - PdfBaseUtil.addUnderlinedTitle(document, "麻精药台账", 10,true); + PdfBaseUtil.addFormTableColumns(document, "en".equals(lang) ? GyzjJcnrUtil.getMapEn(formData3) : formData3, 2); + PdfBaseUtil.addUnderlinedTitle(document, "en".equals(lang) ? GyzjJcnrUtil.getEn("给药制剂台账") : "给药制剂台账", 10, true); // 台账 - addTz(document,gyzjTzList); - PdfBaseUtil.addUnderlinedTitle(document, "稽查轨迹", 10,true); + addTz(document, gyzjTzList, lang); + PdfBaseUtil.addUnderlinedTitle(document, "en".equals(lang) ? GyzjJcnrUtil.getEn("稽查轨迹") : "稽查轨迹", 10, true); //稽查轨迹 - addJcgj(document,gyzjJcgjList); + addJcgj(document, gyzjJcgjList, lang); logger.info("生成成功:{}", filePath); } catch (Exception e) { logger.error("生成失败", e); @@ -93,21 +96,30 @@ public class Dosage { /** * 台账 + * * @param document * @param gyzjTzList * @throws IOException * @throws DocumentException */ - public void addTz(Document document,List gyzjTzList) throws IOException, DocumentException { + public void addTz(Document document, List gyzjTzList, String lang) throws IOException, DocumentException { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); // 9. 表头 BaseFont bfChinese = BaseFont.createFont("STSong-Light", "UniGB-UCS2-H", BaseFont.NOT_EMBEDDED); - Font headerFont = new Font(bfChinese, 10, Font.NORMAL); - Font contentFont = new Font(bfChinese, 10, Font.NORMAL); + Font headerFont = new Font(bfChinese, 8, Font.NORMAL); + Font contentFont = new Font(bfChinese, 8, Font.NORMAL); // 8. 创建表格 PdfPTable table = new PdfPTable(7); table.setWidthPercentage(100); - String[] headers = {"使用人", "领取/归还人", "发放/接收人", "操作类型", "操作量", "备注/原因", "操作时间"}; + String[] headers = { + "en".equals(lang) ? GyzjJcnrUtil.getEn("使用人") : "使用人", + "en".equals(lang) ? GyzjJcnrUtil.getEn("领取/归还人") : "领取/归还人", + "en".equals(lang) ? GyzjJcnrUtil.getEn("发放/接收人") : "发放/接收人", + "en".equals(lang) ? GyzjJcnrUtil.getEn("操作类型") : "操作类型", + "en".equals(lang) ? GyzjJcnrUtil.getEn("操作量") : "操作量", + "en".equals(lang) ? GyzjJcnrUtil.getEn("备注/原因") : "备注/原因", + "en".equals(lang) ? GyzjJcnrUtil.getEn("操作时间") : "操作时间" + }; for (String header : headers) { PdfPCell cell = new PdfPCell(new Phrase(header, headerFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); @@ -124,10 +136,10 @@ public class Dosage { table.getDefaultCell().setBackgroundColor(BaseColor.WHITE); } table.addCell(PdfBaseUtil.createCell(gyzjTz.getQmrMc(), contentFont)); - table.addCell(PdfBaseUtil.createCell(StringUtils.isNoneBlank(gyzjTz.getLqrMc())?gyzjTz.getLqrMc():""+(StringUtils.isNoneBlank(gyzjTz.getGhrMc())?gyzjTz.getGhrMc():""), contentFont)); - table.addCell(PdfBaseUtil.createCell(StringUtils.isNoneBlank(gyzjTz.getFfrMc())?gyzjTz.getFfrMc():""+(StringUtils.isNoneBlank(gyzjTz.getJsrMc())?gyzjTz.getJsrMc():""), contentFont)); + table.addCell(PdfBaseUtil.createCell(StringUtils.isNoneBlank(gyzjTz.getLqrMc()) ? gyzjTz.getLqrMc() : "" + (StringUtils.isNoneBlank(gyzjTz.getGhrMc()) ? gyzjTz.getGhrMc() : ""), contentFont)); + table.addCell(PdfBaseUtil.createCell(StringUtils.isNoneBlank(gyzjTz.getFfrMc()) ? gyzjTz.getFfrMc() : "" + (StringUtils.isNoneBlank(gyzjTz.getJsrMc()) ? gyzjTz.getJsrMc() : ""), contentFont)); table.addCell(PdfBaseUtil.createCell(gyzjTz.getQmyy(), contentFont)); - table.addCell(PdfBaseUtil.createCell(gyzjTz.getCzl()+gyzjTz.getCzldw(), contentFont)); + table.addCell(PdfBaseUtil.createCell(gyzjTz.getCzl() + gyzjTz.getCzldw(), contentFont)); table.addCell(PdfBaseUtil.createCell(gyzjTz.getRemark(), contentFont)); table.addCell(PdfBaseUtil.createCell(sdf.format(gyzjTz.getCreateTime()), contentFont)); rowNum++; @@ -137,32 +149,49 @@ public class Dosage { /** * 稽查轨迹 + * * @param document * @param gyzjJcgjList * @throws IOException * @throws DocumentException */ - public void addJcgj(Document document,List gyzjJcgjList) throws IOException, DocumentException { + public void addJcgj(Document document, List gyzjJcgjList, String lang) throws IOException, DocumentException { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); for (GyzjJcgj jcgj : gyzjJcgjList) { - PdfBaseUtil.addUnderlinedTitle(document, sdf.format(jcgj.getCreateTime())+" "+jcgj.getJcmc() , 10,false); + PdfBaseUtil.addUnderlinedTitle(document, sdf.format(jcgj.getCreateTime()) + " " + ("en".equals(lang) ? GyzjJcnrUtil.getEn(jcgj.getJcmc()) : jcgj.getJcmc()), 10, false); StringJoiner result = new StringJoiner(", "); - if(StringUtils.isNoneBlank(jcgj.getJcnr())){ - ObjectMapper mapper = new ObjectMapper(); - JsonNode jsonArray = mapper.readTree(jcgj.getJcnr()); - for (JsonNode node : jsonArray) { - String name = node.get("name").asText(); - String value = node.get("value").asText(); - result.add(name + ":" + value); + if ("en".equals(lang)) { + if (StringUtils.isNoneBlank(jcgj.getJcnrEn())) { + ObjectMapper mapper = new ObjectMapper(); + JsonNode jsonArray = mapper.readTree(jcgj.getJcnrEn()); + for (JsonNode node : jsonArray) { + if (node.get("name") != null) { + String name = node.get("name").asText(); + String value = node.get("value").asText(); + result.add(name + ":" + value); + } + } + } + } else { + if (StringUtils.isNoneBlank(jcgj.getJcnr())) { + ObjectMapper mapper = new ObjectMapper(); + JsonNode jsonArray = mapper.readTree(jcgj.getJcnr()); + for (JsonNode node : jsonArray) { + if (node.get("name") != null) { + String name = node.get("name").asText(); + String value = node.get("value").asText(); + result.add(name + ":" + value); + } + } } } - if(StringUtils.isNoneBlank(jcgj.getRemark())){ - result.add("备注:"+jcgj.getRemark()); + if (StringUtils.isNoneBlank(jcgj.getRemark())) { + result.add(("en".equals(lang) ? GyzjJcnrUtil.getEn("备注") + ":" : "备注:") + jcgj.getRemark()); } - if(StringUtils.isNoneBlank(jcgj.getRemark())){ - result.add("签名人:"+jcgj.getQmrMc()); + if (StringUtils.isNoneBlank(jcgj.getRemark())) { + result.add(("en".equals(lang) ? GyzjJcnrUtil.getEn("签名人") + ":" : "签名人:") + jcgj.getQmrMc()); } - PdfBaseUtil.addUnderlinedTitle(document, result.toString(), 10,false); + PdfBaseUtil.addUnderlinedTitle(document, result.toString(), 10, false); } }