|
@@ -18,6 +18,7 @@ import com.ruoyi.gljt.mapper.GljtJkzkMapper;
|
|
import com.ruoyi.gljt.mapper.GljtSqLrExportMapper;
|
|
import com.ruoyi.gljt.mapper.GljtSqLrExportMapper;
|
|
import com.ruoyi.gljt.mapper.GljtSqLrMapper;
|
|
import com.ruoyi.gljt.mapper.GljtSqLrMapper;
|
|
import com.ruoyi.gljt.service.IGljtSqLrService;
|
|
import com.ruoyi.gljt.service.IGljtSqLrService;
|
|
|
|
+import com.ruoyi.gljt.utils.ExcelTemplateUtils;
|
|
import com.ruoyi.gljt.utils.GljtSqUtils;
|
|
import com.ruoyi.gljt.utils.GljtSqUtils;
|
|
import com.ruoyi.system.api.domain.SysDictData;
|
|
import com.ruoyi.system.api.domain.SysDictData;
|
|
import com.ruoyi.system.api.enums.GljtLrStatus;
|
|
import com.ruoyi.system.api.enums.GljtLrStatus;
|
|
@@ -28,6 +29,7 @@ import org.apache.commons.lang3.ObjectUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
+import java.io.File;
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
import java.math.RoundingMode;
|
|
import java.math.RoundingMode;
|
|
import java.text.SimpleDateFormat;
|
|
import java.text.SimpleDateFormat;
|
|
@@ -159,19 +161,17 @@ public class GljtSqLrServiceImpl implements IGljtSqLrService
|
|
.likeRight(GljtSqLrExport::getXzqh, SubCodeUtil.code2Short(filter)).in(GljtSqLrExport::getStatus, lrStatus)
|
|
.likeRight(GljtSqLrExport::getXzqh, SubCodeUtil.code2Short(filter)).in(GljtSqLrExport::getStatus, lrStatus)
|
|
.orderByDesc(GljtSqLrExport::getCreateTimeStr);
|
|
.orderByDesc(GljtSqLrExport::getCreateTimeStr);
|
|
List<GljtSqLrExport> res = gljtSqLrExportMapper.selectList(lqw);
|
|
List<GljtSqLrExport> res = gljtSqLrExportMapper.selectList(lqw);
|
|
- String en = SecurityUtils.sm4encrypt_ECB("33555573BDFADC45", "张福䘵");
|
|
|
|
- System.out.println("33555573BDFADC45");
|
|
|
|
- System.out.println(en);
|
|
|
|
- System.out.println(SecurityUtils.sm4decrypt_ECB("33555573BDFADC45", en));
|
|
|
|
List<SysDictData> mzList = DictUtils.getDictCache("C0009");
|
|
List<SysDictData> mzList = DictUtils.getDictCache("C0009");
|
|
List<SysDictData> jkzkList = DictUtils.getDictCache("GL021");
|
|
List<SysDictData> jkzkList = DictUtils.getDictCache("GL021");
|
|
if (CollectionUtils.isEmpty(mzList) || CollectionUtils.isEmpty(jkzkList)) {
|
|
if (CollectionUtils.isEmpty(mzList) || CollectionUtils.isEmpty(jkzkList)) {
|
|
throw new ServiceException("请尝试刷新缓存,当前缓存内未取到相应字典");
|
|
throw new ServiceException("请尝试刷新缓存,当前缓存内未取到相应字典");
|
|
}
|
|
}
|
|
GljtXmpz xmpz = gljtSqUtils.getXmpz();
|
|
GljtXmpz xmpz = gljtSqUtils.getXmpz();
|
|
|
|
+ int xh = 1;
|
|
for (GljtSqLrExport r: res) {
|
|
for (GljtSqLrExport r: res) {
|
|
EncryptionUtils.decryptForPlaintext(r);
|
|
EncryptionUtils.decryptForPlaintext(r);
|
|
try {
|
|
try {
|
|
|
|
+ r.setXh(String.valueOf(xh));
|
|
r.setDjsj(parseStr2Str(DateUtils.YYYY_MM_DD, StringUtils.isNotEmpty(r.getCreateTimeStr()) ? r.getCreateTimeStr().substring(0, 8) : "20200101"));
|
|
r.setDjsj(parseStr2Str(DateUtils.YYYY_MM_DD, StringUtils.isNotEmpty(r.getCreateTimeStr()) ? r.getCreateTimeStr().substring(0, 8) : "20200101"));
|
|
if (StringUtils.equals(r.getXb(), "1")) {
|
|
if (StringUtils.equals(r.getXb(), "1")) {
|
|
r.setXb("1|男");
|
|
r.setXb("1|男");
|
|
@@ -185,11 +185,23 @@ public class GljtSqLrServiceImpl implements IGljtSqLrService
|
|
r.setXsbtlb("1|高龄津贴");
|
|
r.setXsbtlb("1|高龄津贴");
|
|
r.setSndj(r.getSndj() + "|" + jkzkList.stream().filter(j -> StringUtils.equals(j.getDictValue(), r.getSndj())).findFirst().orElse(new SysDictData()).getDictLabel());
|
|
r.setSndj(r.getSndj() + "|" + jkzkList.stream().filter(j -> StringUtils.equals(j.getDictValue(), r.getSndj())).findFirst().orElse(new SysDictData()).getDictLabel());
|
|
r.setYbzje(setYbzje(xmpz, r.getPc()));
|
|
r.setYbzje(setYbzje(xmpz, r.getPc()));
|
|
|
|
+ xh ++;
|
|
} catch (Exception ignored) {}
|
|
} catch (Exception ignored) {}
|
|
}
|
|
}
|
|
return res;
|
|
return res;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
+ public byte[] exportExcelData(GljtSqLr gljtSqLr) {
|
|
|
|
+ String userDir = System.getProperty("user.dir");
|
|
|
|
+ File templateFile = new File(userDir + "/templates/exportGljtLr.xlsx");
|
|
|
|
+ if (!templateFile.exists()) {
|
|
|
|
+ throw new ServiceException("模板文件不存在");
|
|
|
|
+ }
|
|
|
|
+ List<GljtSqLrExport> exportList = exportGljtLr(gljtSqLr);
|
|
|
|
+ return ExcelTemplateUtils.exportExcel(exportList, templateFile);
|
|
|
|
+ }
|
|
|
|
+
|
|
private String setYbzje(GljtXmpz pz, String pc) {
|
|
private String setYbzje(GljtXmpz pz, String pc) {
|
|
String res = "";
|
|
String res = "";
|
|
if (StringUtils.equals(pc, "0")) res = pz.getBtzjE();
|
|
if (StringUtils.equals(pc, "0")) res = pz.getBtzjE();
|