Browse Source

feat:[资源库管理]麻精药 详情导出

master
15881625488@163.com 3 months ago
parent
commit
5e95664309
15 changed files with 141 additions and 110 deletions
  1. +2
    -1
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/MjyController.java
  2. +0
    -2
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/StudyGyzjMapper.java
  3. +0
    -1
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/StudyMjyMapper.java
  4. +0
    -6
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyGyzjService.java
  5. +0
    -7
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyMjyService.java
  6. +0
    -3
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GyzjFfjlServiceImpl.java
  7. +21
    -13
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/MjyFfjlServiceImpl.java
  8. +16
    -5
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/MjyServiceImpl.java
  9. +1
    -9
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyGyzjServiceImpl.java
  10. +0
    -10
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyMjyServiceImpl.java
  11. +1
    -1
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/GyzjJcnrUtil.java
  12. +34
    -6
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/MjyJcnrUtil.java
  13. +66
    -40
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/pdf/resource/Drug.java
  14. +0
    -3
      hxhq-modules/hxhq-system/src/main/resources/mapper/business/StudyGyzjMapper.xml
  15. +0
    -3
      hxhq-modules/hxhq-system/src/main/resources/mapper/business/StudyMjyMapper.xml

+ 2
- 1
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/MjyController.java View File

@ -104,7 +104,7 @@ public class MjyController extends BaseController {
*/
@RequiresPermissions("business:resource:mjy:xq")
@GetMapping(value = "/exportDetail")
public AjaxResult exportDetail(Long id) {
public AjaxResult exportDetail(Long id,String lang) {
MjyJcgj mjyJcgj = new MjyJcgj();
mjyJcgj.setMjyId(id);
List<MjyJcgj> mjyJcgjList = mjyJcgjService.queryList(mjyJcgj);
@ -117,6 +117,7 @@ public class MjyController extends BaseController {
mjyService.queryInfo(id),
mjyTzList,
mjyJcgjList,
lang,
localFilePath));
}

+ 0
- 2
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/StudyGyzjMapper.java View File

@ -16,6 +16,4 @@ public interface StudyGyzjMapper extends BaseMapper
{
void insertBatch(@Param("list") List<StudyGyzj> list);
void returnBatch(@Param("resourceId") Long resourceId);
}

+ 0
- 1
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/StudyMjyMapper.java View File

@ -18,6 +18,5 @@ public interface StudyMjyMapper extends BaseMapper
void insertBatch(@Param("list") List<StudyMjy> list);
void returnBatch(@Param("resourceId") Long resourceId);
}

+ 0
- 6
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyGyzjService.java View File

@ -21,10 +21,4 @@ public interface IStudyGyzjService extends IService {
*/
public void insertBatch(List<StudyGyzj> list);
/**
* 批量归还
*
* @param resourceId
*/
public void returnBatch(Long resourceId);
}

+ 0
- 7
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyMjyService.java View File

@ -20,11 +20,4 @@ public interface IStudyMjyService extends IService
* @param list
*/
public void insertBatch(List<StudyMjy> list);
/**
* 批量归还
*
* @param resourceId
*/
public void returnBatch(Long resourceId);
}

+ 0
- 3
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GyzjFfjlServiceImpl.java View File

@ -397,9 +397,6 @@ public class GyzjFfjlServiceImpl extends ServiceImpl i
gyzjFfjl.setGhbz(form.getRemark());
this.updateById(gyzjFfjl);
// 归还试验物资
studyGyzjService.returnBatch(gyzj.getId());
// 稽查轨迹
Map<String, String> formData = new LinkedHashMap<>();
formData.put("入库位置", form.getRkwz());

+ 21
- 13
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/MjyFfjlServiceImpl.java View File

@ -1,6 +1,7 @@
package com.hxhq.business.service.impl;
import java.util.*;
import java.util.stream.Collectors;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
@ -11,7 +12,7 @@ import com.hxhq.business.enums.zykgl.*;
import com.hxhq.business.enums.zykgl.JlztEnum;
import com.hxhq.business.form.mjy.*;
import com.hxhq.business.service.IMjyFfjlJcgjService;
import com.hxhq.business.service.IStudyGyzjService;
import com.hxhq.business.service.IStudyMjyService;
import com.hxhq.business.service.IStudyMjyService;
import com.hxhq.business.utils.JctUtil;
import com.hxhq.common.core.exception.ServiceException;
@ -397,10 +398,6 @@ public class MjyFfjlServiceImpl extends ServiceImpl impl
this.updateById(mjyFfjl);
//endregion
//region 归还试验物资
studyMjyService.returnBatch(mjy.getId());
//endregion
//稽查轨迹
Map<String, String> formData = new LinkedHashMap<>();
formData.put("入库位置", form.getRkwz());
@ -458,14 +455,27 @@ public class MjyFfjlServiceImpl extends ServiceImpl impl
mjyFfjl.setMdOther(form.getMdOther());
// 新增试验物资
List<StudyMjy> studyMjies=new ArrayList<>();
if(StringUtils.isNoneBlank(form.getMdIds())){
QueryWrapper<StudyMjy> queryWrapper = Wrappers.query();
queryWrapper.in("study_id", form.getMdIds());
queryWrapper.in("resource_id", mjy.getId());
List<StudyMjy> studyMjysOld = studyMjyService.list(queryWrapper);
List<StudyMjy> studyMjies=new ArrayList<>();
String [] tmp=form.getMdIds().split(",");
for(String s :tmp){
StudyMjy studyMjy=new StudyMjy();
studyMjy.setStudyId(Long.parseLong(s));
studyMjy.setResourceId(mjy.getId());
studyMjies.add(studyMjy);
List<StudyMjy> existList = studyMjysOld.stream()
.filter(p -> p.getStudyId().equals(Long.parseLong(s)))
.collect(Collectors.toList());
if (existList.size() == 0) {
StudyMjy studyMjy = new StudyMjy();
studyMjy.setStudyId(Long.parseLong(s));
studyMjy.setResourceId(mjy.getId());
studyMjies.add(studyMjy);
}
}
if(studyMjies.size()>0){
studyMjyService.insertBatch(studyMjies);
}
}
@ -478,9 +488,7 @@ public class MjyFfjlServiceImpl extends ServiceImpl impl
this.save(mjyFfjl);
mjyFfjlJcgjService.saveJcgj(mjyFfjl.getId(), JcgjlxEnum.lc.getValue(), "领取发放", JcmcysEnum.green.getValue(), formData, SecurityUtils.getLoginUser().getSysUser(),form.getRemark());
if(studyMjies.size()>0){
studyMjyService.insertBatch(studyMjies);
}
}

+ 16
- 5
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/MjyServiceImpl.java View File

@ -669,7 +669,11 @@ public class MjyServiceImpl extends ServiceImpl implements IMjyS
formData.put("出库量", mjyOld.getKc() + mjyOld.getKcdw());
formData.put("转移条件", form.getZytj());
formData.put("出库毛重", form.getCkmz() + mjyOld.getKcdw());
formData.put("目的", form.getMdIds());
formData.put("目的", form.getMdMcs());
formData.put("领取人", lqr1.getNickName());
formData.put("领取人2", lqr2.getNickName());
formData.put("发放人", ffr1.getNickName());
formData.put("发放人2", ffr2.getNickName());
mjyJcgjService.saveJcgj(mjyOld.getId(), JcgjlxEnum.lc.getValue(), "领取发放", JcmcysEnum.green.getValue(), formData, ffr1,form.getRemark());
//台账
mjyTzService.saveTz(mjyOld.getId(),lqr1,lqr2,null,null,ffr1,ffr2,null,null,null,"领取发放",mjyOld.getKc(),mjyOld.getKcdw(),form.getRemark());
@ -744,7 +748,11 @@ public class MjyServiceImpl extends ServiceImpl implements IMjyS
formData.put("出库量", mjy.getKc() + mjy.getKcdw());
formData.put("转移条件", plffItemFilter.get(0).getZytj());
formData.put("出库毛重", plffItemFilter.get(0).getCkmz() + mjy.getKcdw());
formData.put("目的", plffItemFilter.get(0).getMdIds());
formData.put("目的", plffItemFilter.get(0).getMdMcs());
formData.put("领取人", lqr1.getNickName());
formData.put("领取人2", lqr2.getNickName());
formData.put("发放人", ffr1.getNickName());
formData.put("发放人2", ffr2.getNickName());
mjyJcgjList.add(mjyJcgjService.getJcgj(mjy.getId(), JcgjlxEnum.lc.getValue(), "领取发放", JcmcysEnum.green.getValue(), formData, ffr1,plffItemFilter.get(0).getRemark()));
//台账
mjyTzList.add(mjyTzService.getTz(mjy.getId(),lqr1,lqr2,null,null,ffr1,ffr2,null,null,null,"领取发放",mjy.getKc(),mjy.getKcdw(),plffItemFilter.get(0).getRemark()));
@ -765,6 +773,7 @@ public class MjyServiceImpl extends ServiceImpl implements IMjyS
mjy.setFfrq(now);
mjy.setFfbz(plffItemFilter.get(0).getRemark());
mjy.setMdIds(plffItemFilter.get(0).getMdIds());
mjy.setMdOther(plffItemFilter.get(0).getMdOther());
mjy.setZjzt(ZjztEnum.yff.getValue());
} else {
throw new ServiceException("麻精药【" + mjy.getMc() + "】不存在或已删除");
@ -961,7 +970,7 @@ public class MjyServiceImpl extends ServiceImpl implements IMjyS
mjyJcgjService.saveJcgj(mjyOld.getId(), JcgjlxEnum.lc.getValue(), "拒绝修改库存", JcmcysEnum.red.getValue(), formData, qmr,null);
}
//台账
mjyTzService.getTz(mjyOld.getId(),null,null,null,null,null,null,null,null,null,"修改库存",mjyOld.getKcbj(),mjyOld.getKcdw(),mjyOld.getKcbjbz());
mjyTzService.saveTz(mjyOld.getId(),null,null,null,null,null,null,null,null,qmr,"修改库存",mjyOld.getKcbj(),mjyOld.getKcdw(),mjyOld.getKcbjbz());
mjyOld.setKcbj(null);
mjyOld.setKcdwbj(null);
@ -1107,9 +1116,11 @@ public class MjyServiceImpl extends ServiceImpl implements IMjyS
Map<String, String> formData = new LinkedHashMap<>();
formData.put("存储位置", form.getCcwz());
formData.put("存储条件", form.getCctj());
mjyJcgjService.saveJcgj(mjyOld.getId(), JcgjlxEnum.lc.getValue(), "存储", JcmcysEnum.green.getValue(), formData, qmr, form.getRemark());
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,qmr,"存储",mjyOld.getKc(),mjyOld.getKcdw(),form.getRemark());
mjyTzService.saveTz(mjyOld.getId(),null,null,qmr,qmr2,null,null,null,null,null,"存储",mjyOld.getKc(),mjyOld.getKcdw(),form.getRemark());
}
/**

+ 1
- 9
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyGyzjServiceImpl.java View File

@ -31,13 +31,5 @@ public class StudyGyzjServiceImpl extends ServiceImpl
}
/**
* 批量归还
*
* @param resourceId
*/
@Override
public void returnBatch(Long resourceId){
baseMapper.returnBatch(resourceId);
}
}

+ 0
- 10
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyMjyServiceImpl.java View File

@ -31,14 +31,4 @@ public class StudyMjyServiceImpl extends ServiceImpl i
}
/**
* 批量归还
*
* @param resourceId
*/
@Override
public void returnBatch(Long resourceId) {
baseMapper.returnBatch(resourceId);
}
}

+ 1
- 1
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/GyzjJcnrUtil.java View File

@ -15,7 +15,7 @@ public class GyzjJcnrUtil {
private static HashMap<String,String> mapLang=new HashMap<>();
static {
mapLang.put("入库","In Storage");
mapLang.put("未入库","'未入库'");
mapLang.put("未入库","未入库");
mapLang.put("已发放","In Use");
mapLang.put("已锁定","'Locked'");
mapLang.put("待归档","Pending Archiving");

+ 34
- 6
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/MjyJcnrUtil.java View File

@ -15,7 +15,13 @@ public class MjyJcnrUtil {
private static final Logger logger = LoggerFactory.getLogger(MjyJcnrUtil.class.getName());
private static HashMap<String,String> mapLang=new HashMap<>();
static {
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");
@ -27,6 +33,7 @@ public class MjyJcnrUtil {
mapLang.put("钥匙1领取人","Key 1 User");
mapLang.put("钥匙2领取人","Key 2 User");
mapLang.put("发放人","Issuer");
mapLang.put("发放人2","Issuer 2");
mapLang.put("出库量","Out Amount");
mapLang.put("转移条件","Transfer Condition");
mapLang.put("出库毛重","Check-out Gross Weight");
@ -42,11 +49,29 @@ public class MjyJcnrUtil {
mapLang.put("审核备注","Approve Comment");
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");
mapLang.put("目的","目的");
mapLang.put("入库位置","入库位置");
mapLang.put("入库条件","入库条件");
mapLang.put("减少量","减少量");
mapLang.put("申请解档","Apply for De-archiving");
@ -71,7 +96,10 @@ public class MjyJcnrUtil {
mapLang.put("锁定发放记录","锁定发放记录");
mapLang.put("解锁发放记录","解锁发放记录");
mapLang.put("麻精药入库","麻精药入库");
mapLang.put("目的","目的");
mapLang.put("入库位置","入库位置");
mapLang.put("入库条件","入库条件");
mapLang.put("减少量","减少量");
}

+ 66
- 40
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/pdf/resource/Drug.java View File

@ -3,11 +3,10 @@ package com.hxhq.business.utils.pdf.resource;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.hxhq.business.domain.Mjy;
import com.hxhq.business.domain.MjyJcgj;
import com.hxhq.business.domain.MjyTz;
import com.hxhq.business.domain.StudyFormFillJcgj;
import com.hxhq.business.domain.*;
import com.hxhq.business.dto.mjy.DetailDto;
import com.hxhq.business.enums.zykgl.ZjztEnum;
import com.hxhq.business.utils.MjyJcnrUtil;
import com.hxhq.business.utils.pdf.PdfBaseUtil;
import com.hxhq.common.core.utils.StringUtils;
import com.hxhq.common.security.utils.SecurityUtils;
@ -39,20 +38,20 @@ public class Drug {
* @param mjy
* @return
*/
public String exportDetail(DetailDto mjy, List<MjyTz> mjyTzList, List<MjyJcgj> mjyJcgjList, String localFilePath) {
public String exportDetail(DetailDto mjy, List<MjyTz> mjyTzList, List<MjyJcgj> mjyJcgjList, 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) ? MjyJcnrUtil.getEn("基本信息") : "基本信息", 10, true);
Map<String, String> formData1 = new LinkedHashMap<>();
formData1.put("名称", mjy.getMc());
formData1.put("编号", mjy.getBh());
@ -61,20 +60,21 @@ public class Drug {
formData1.put("失效日期", sdf.format(mjy.getSxrq()));
formData1.put("存储条件", mjy.getCctj());
formData1.put("存储位置", mjy.getCcwz());
PdfBaseUtil.addFormTableColumns(document, formData1, 2);
formData1.put("制剂状态", "en".equals(lang) ? (MjyJcnrUtil.getEn(ZjztEnum.getEnumByValue(mjy.getZjzt()).getText())) : ZjztEnum.getEnumByValue(mjy.getZjzt()).getText());
PdfBaseUtil.addFormTableColumns(document, "en".equals(lang) ? MjyJcnrUtil.getMapEn(formData1) : formData1, 2);
// 表单信息
PdfBaseUtil.addUnderlinedTitle(document, "表单信息", 10,true);
PdfBaseUtil.addUnderlinedTitle(document, "en".equals(lang) ? MjyJcnrUtil.getEn("表单信息") : "表单信息", 10, true);
Map<String, String> formData3 = new LinkedHashMap<>();
formData3.put("所属表单", mjy.getBdMc());
formData3.put("所属试验信息", mjy.getStudyMc());
formData3.put("所属表单", mjy.getBdMc());
formData3.put("表单所属人", mjy.getBdgsrMc());
PdfBaseUtil.addFormTableColumns(document, formData3, 2);
PdfBaseUtil.addUnderlinedTitle(document, "麻精药台账", 10,true);
PdfBaseUtil.addFormTableColumns(document, "en".equals(lang) ? MjyJcnrUtil.getMapEn(formData3) : formData3, 2);
PdfBaseUtil.addUnderlinedTitle(document, "en".equals(lang) ? MjyJcnrUtil.getEn("给药制剂台账") : "给药制剂台账", 10, true);
// 台账
addTz(document,mjyTzList);
PdfBaseUtil.addUnderlinedTitle(document, "稽查轨迹", 10,true);
addTz(document, mjyTzList, lang);
PdfBaseUtil.addUnderlinedTitle(document, "en".equals(lang) ? MjyJcnrUtil.getEn("稽查轨迹") : "稽查轨迹", 10, true);
//稽查轨迹
addJcgj(document,mjyJcgjList);
addJcgj(document, mjyJcgjList, lang);
logger.info("生成成功:{}", filePath);
} catch (Exception e) {
logger.error("生成失败", e);
@ -96,21 +96,30 @@ public class Drug {
/**
* 台账
*
* @param document
* @param mjyTzList
* @throws IOException
* @throws DocumentException
*/
public void addTz(Document document,List<MjyTz> mjyTzList) throws IOException, DocumentException {
public void addTz(Document document, List<MjyTz> mjyTzList, 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) ? MjyJcnrUtil.getEn("使用人") : "使用人",
"en".equals(lang) ? MjyJcnrUtil.getEn("领取/归还人") : "领取/归还人",
"en".equals(lang) ? MjyJcnrUtil.getEn("发放/接收人") : "发放/接收人",
"en".equals(lang) ? MjyJcnrUtil.getEn("操作类型") : "操作类型",
"en".equals(lang) ? MjyJcnrUtil.getEn("操作量") : "操作量",
"en".equals(lang) ? MjyJcnrUtil.getEn("备注/原因") : "备注/原因",
"en".equals(lang) ? MjyJcnrUtil.getEn("操作时间") : "操作时间"
};
for (String header : headers) {
PdfPCell cell = new PdfPCell(new Phrase(header, headerFont));
cell.setHorizontalAlignment(Element.ALIGN_CENTER);
@ -127,10 +136,10 @@ public class Drug {
table.getDefaultCell().setBackgroundColor(BaseColor.WHITE);
}
table.addCell(PdfBaseUtil.createCell(mjyTz.getQmrMc(), contentFont));
table.addCell(PdfBaseUtil.createCell(StringUtils.isNoneBlank(mjyTz.getLqrMc())?mjyTz.getLqrMc():""+(StringUtils.isNoneBlank(mjyTz.getGhrMc())?mjyTz.getGhrMc():""), contentFont));
table.addCell(PdfBaseUtil.createCell(StringUtils.isNoneBlank(mjyTz.getFfrMc())?mjyTz.getFfrMc():""+(StringUtils.isNoneBlank(mjyTz.getJsrMc())?mjyTz.getJsrMc():""), contentFont));
table.addCell(PdfBaseUtil.createCell(StringUtils.isNoneBlank(mjyTz.getLqrMc()) ? mjyTz.getLqrMc() : "" + (StringUtils.isNoneBlank(mjyTz.getGhrMc()) ? mjyTz.getGhrMc() : ""), contentFont));
table.addCell(PdfBaseUtil.createCell(StringUtils.isNoneBlank(mjyTz.getFfrMc()) ? mjyTz.getFfrMc() : "" + (StringUtils.isNoneBlank(mjyTz.getJsrMc()) ? mjyTz.getJsrMc() : ""), contentFont));
table.addCell(PdfBaseUtil.createCell(mjyTz.getQmyy(), contentFont));
table.addCell(PdfBaseUtil.createCell(mjyTz.getCzl()+mjyTz.getCzldw(), contentFont));
table.addCell(PdfBaseUtil.createCell(mjyTz.getCzl() + mjyTz.getCzldw(), contentFont));
table.addCell(PdfBaseUtil.createCell(mjyTz.getRemark(), contentFont));
table.addCell(PdfBaseUtil.createCell(sdf.format(mjyTz.getCreateTime()), contentFont));
rowNum++;
@ -140,32 +149,49 @@ public class Drug {
/**
* 稽查轨迹
*
* @param document
* @param mjyJcgjList
* @throws IOException
* @throws DocumentException
*/
public void addJcgj(Document document,List<MjyJcgj> mjyJcgjList) throws IOException, DocumentException {
public void addJcgj(Document document, List<MjyJcgj> mjyJcgjList, String lang) throws IOException, DocumentException {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
for (MjyJcgj jcgj : mjyJcgjList) {
PdfBaseUtil.addUnderlinedTitle(document, sdf.format(jcgj.getCreateTime())+" "+jcgj.getJcmc() , 10,false);
PdfBaseUtil.addUnderlinedTitle(document, sdf.format(jcgj.getCreateTime()) + " " + ("en".equals(lang) ? MjyJcnrUtil.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) ? MjyJcnrUtil.getEn("备注") + ":" : "备注:") + jcgj.getRemark());
}
if(StringUtils.isNoneBlank(jcgj.getRemark())){
result.add("签名人:"+jcgj.getQmrMc());
if (StringUtils.isNoneBlank(jcgj.getRemark())) {
result.add(("en".equals(lang) ? MjyJcnrUtil.getEn("签名人") + ":" : "签名人:") + jcgj.getQmrMc());
}
PdfBaseUtil.addUnderlinedTitle(document, result.toString(), 10,false);
PdfBaseUtil.addUnderlinedTitle(document, result.toString(), 10, false);
}
}

+ 0
- 3
hxhq-modules/hxhq-system/src/main/resources/mapper/business/StudyGyzjMapper.xml View File

@ -14,8 +14,5 @@
</foreach>
</insert>
<update id="returnBatch" >
update t_study_gyzj set syghzt=10 where resource_id=#{resourceId};
</update>
</mapper>

+ 0
- 3
hxhq-modules/hxhq-system/src/main/resources/mapper/business/StudyMjyMapper.xml View File

@ -13,7 +13,4 @@
</foreach>
</insert>
<update id="returnBatch" >
update t_study_mjy set syghzt=10 where resource_id=#{resourceId};
</update>
</mapper>

Loading…
Cancel
Save