|
@@ -2,11 +2,13 @@ package com.zhongzheng.modules.base.service.impl;
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
import cn.hutool.core.convert.Convert;
|
|
|
+import cn.hutool.core.date.DateUtil;
|
|
|
import cn.hutool.core.io.FileUtil;
|
|
|
|
|
|
import cn.hutool.extra.template.TemplateException;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
|
import com.fasterxml.jackson.databind.exc.InvalidFormatException;
|
|
|
import com.openhtmltopdf.swing.Java2DRenderer;
|
|
|
import com.openhtmltopdf.util.FSImageWriter;
|
|
@@ -18,6 +20,9 @@ import com.zhongzheng.modules.alioss.bo.OssRequest;
|
|
|
import com.zhongzheng.modules.alioss.service.impl.OssServiceImpl;
|
|
|
import com.zhongzheng.modules.alisms.service.IAliSmsService;
|
|
|
import com.zhongzheng.modules.base.bo.UserProfileFit;
|
|
|
+import com.zhongzheng.modules.base.vo.JsonBean;
|
|
|
+import com.zhongzheng.modules.base.vo.UserProfileExportGaiVo;
|
|
|
+import com.zhongzheng.modules.base.vo.UserProfileExportVo;
|
|
|
import com.zhongzheng.modules.goods.service.IGoodsService;
|
|
|
import com.zhongzheng.modules.goods.vo.GoodsVo;
|
|
|
import com.zhongzheng.modules.inform.bo.InformUserAddBo;
|
|
@@ -464,6 +469,159 @@ public class UserProfileServiceImpl extends ServiceImpl<UserProfileMapper, UserP
|
|
|
return baseMapper.listRecord(bo);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public List<UserProfileExportVo> export(UserProfileQueryBo bo) {
|
|
|
+ List<UserProfileVo> userProfileVos = baseMapper.selectUserProfile(bo);
|
|
|
+ List<UserProfileExportVo> userProfileExportVos = new ArrayList<>();
|
|
|
+ for (UserProfileVo userProfileVo : userProfileVos) {
|
|
|
+ UserProfileExportVo userProfileExportVo = new UserProfileExportVo();
|
|
|
+ //将keyvlue转成对象
|
|
|
+ JsonBean jsonBean = JSON.parseObject(userProfileVo.getKeyValue(), JsonBean.class);
|
|
|
+
|
|
|
+ //赋值
|
|
|
+ userProfileExportVo.setGoodsName(userProfileVo.getGoodsName());
|
|
|
+ if (userProfileVo.getStatus().equals(1)) {
|
|
|
+ userProfileExportVo.setStatus("通过");
|
|
|
+ }
|
|
|
+ if (userProfileVo.getStatus().equals(2)) {
|
|
|
+ userProfileExportVo.setStatus("待审");
|
|
|
+ }
|
|
|
+ if (userProfileVo.getStatus().equals(3)) {
|
|
|
+ userProfileExportVo.setStatus("不通过");
|
|
|
+ }
|
|
|
+ userProfileExportVo.setUserAccount(userProfileVo.getUserAccount());
|
|
|
+ userProfileExportVo.setName(jsonBean.getName().getValue());
|
|
|
+ userProfileExportVo.setSex(jsonBean.getSex().getValue());
|
|
|
+ userProfileExportVo.setIdcard(jsonBean.getIdcard().getValue());
|
|
|
+ userProfileExportVo.setTelphone(jsonBean.getTelphone().getValue());
|
|
|
+ userProfileExportVo.setEducation(jsonBean.getEducation().getValue());
|
|
|
+ userProfileExportVo.setSchool(jsonBean.getSchool().getValue());
|
|
|
+ userProfileExportVo.setGraduation_time(DateUtil.formatDate(jsonBean.getGraduation_time().getValue()));
|
|
|
+ userProfileExportVo.setWork_unit(jsonBean.getWork_unit().getValue());
|
|
|
+ userProfileExportVo.setUnit_contact(jsonBean.getUnit_contact().getValue());
|
|
|
+ userProfileExportVo.setUnit_tel(jsonBean.getUnit_tel().getValue());
|
|
|
+ userProfileExportVo.setApply_post(jsonBean.getApply_post().getValue());
|
|
|
+ userProfileExportVo.setMajor(jsonBean.getMajor().getValue());
|
|
|
+ userProfileExportVo.setWorking_years(jsonBean.getWorking_years().getValue());
|
|
|
+ if (StringUtils.isNotBlank(jsonBean.getRecent_photos().getValue())) {
|
|
|
+ userProfileExportVo.setRecent_photos(ALIYUN_OSS_ENDPOINT + "/" + jsonBean.getRecent_photos().getValue());
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isNotBlank(jsonBean.getIdcard_face_photo().getValue())) {
|
|
|
+ userProfileExportVo.setIdcard_face_photo(ALIYUN_OSS_ENDPOINT + "/" + jsonBean.getIdcard_face_photo().getValue());
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isNotBlank(jsonBean.getIdcard_national_photo().getValue())) {
|
|
|
+ userProfileExportVo.setIdcard_national_photo(ALIYUN_OSS_ENDPOINT + "/" + jsonBean.getIdcard_national_photo().getValue());
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isNotBlank(jsonBean.getCommitment_electr_signature().getValue())) {
|
|
|
+ userProfileExportVo.setCommitment_electr_signature(ALIYUN_OSS_ENDPOINT + "/" + jsonBean.getCommitment_electr_signature().getValue());
|
|
|
+ }
|
|
|
+ //查找盖章得记录
|
|
|
+ UserProfileQueryBo userProfileQueryBo = new UserProfileQueryBo();
|
|
|
+ userProfileQueryBo.setTypeStatus(2L);
|
|
|
+ userProfileQueryBo.setGoodsId(userProfileVo.getGoodsId());
|
|
|
+ userProfileQueryBo.setUserId(userProfileVo.getUserId());
|
|
|
+ List<UserProfileVo> userProfile = baseMapper.selectUserProfile(userProfileQueryBo);
|
|
|
+ if (CollectionUtils.isNotEmpty(userProfile)){
|
|
|
+ UserProfileVo userProfileVo1 = userProfile.get(0);
|
|
|
+ JsonBean jsonBean1 = JSON.parseObject(userProfileVo1.getKeyValue(), JsonBean.class);
|
|
|
+ if (!StringUtils.isEmpty(jsonBean1.getCommitment_seal().getValue())) {
|
|
|
+ if (StringUtils.isNotBlank(jsonBean1.getCommitment_seal().getValue())) {
|
|
|
+ userProfileExportVo.setCommitment_seal(ALIYUN_OSS_ENDPOINT + "/" + jsonBean1.getCommitment_seal().getValue());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ userProfileExportVo.setOneTime(DateUtil.formatDate(new Date(userProfileVo.getOneTime()*1000)));
|
|
|
+ userProfileExportVo.setLastTime(DateUtil.formatDate(new Date(userProfileVo.getLastTime()*1000)));
|
|
|
+ userProfileExportVo.setCreateByName(userProfileVo.getCreateByName());
|
|
|
+ if (userProfileVo.getAuditTime() != null) {
|
|
|
+ userProfileExportVo.setAuditTime(DateUtil.formatDate(new Date(userProfileVo.getAuditTime() * 1000)));
|
|
|
+ }
|
|
|
+ userProfileExportVos.add(userProfileExportVo);
|
|
|
+ }
|
|
|
+ return userProfileExportVos;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<UserProfileExportGaiVo> exportPo(UserProfileQueryBo bo) {
|
|
|
+ List<UserProfileVo> userProfileVos = baseMapper.selectUserProfile(bo);
|
|
|
+ List<UserProfileExportGaiVo> userProfileExportVos = new ArrayList<>();
|
|
|
+ for (UserProfileVo userProfileVo : userProfileVos) {
|
|
|
+ UserProfileExportGaiVo userProfileExportVo = new UserProfileExportGaiVo();
|
|
|
+ //将keyvlue转成对象
|
|
|
+ JsonBean jsonBean1 = JSON.parseObject(userProfileVo.getKeyValue(), JsonBean.class);
|
|
|
+
|
|
|
+ //赋值
|
|
|
+
|
|
|
+ if (!StringUtils.isEmpty(jsonBean1.getCommitment_seal().getValue())) {
|
|
|
+ if (StringUtils.isNotBlank(jsonBean1.getCommitment_seal().getValue())) {
|
|
|
+ userProfileExportVo.setCommitment_seal(ALIYUN_OSS_ENDPOINT + "/" + jsonBean1.getCommitment_seal().getValue());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ userProfileExportVo.setGoodsName(userProfileVo.getGoodsName());
|
|
|
+ if (userProfileVo.getStatus().equals(1)) {
|
|
|
+ userProfileExportVo.setStatus("通过");
|
|
|
+ }
|
|
|
+ if (userProfileVo.getStatus().equals(2)) {
|
|
|
+ userProfileExportVo.setStatus("待审");
|
|
|
+ }
|
|
|
+ if (userProfileVo.getStatus().equals(3)) {
|
|
|
+ userProfileExportVo.setStatus("不通过");
|
|
|
+ }
|
|
|
+ userProfileExportVo.setUserAccount(userProfileVo.getUserAccount());
|
|
|
+
|
|
|
+ //查找盖章得记录
|
|
|
+ UserProfileQueryBo userProfileQueryBo = new UserProfileQueryBo();
|
|
|
+ userProfileQueryBo.setTypeStatus(1L);
|
|
|
+ userProfileQueryBo.setGoodsId(userProfileVo.getGoodsId());
|
|
|
+ userProfileQueryBo.setUserId(userProfileVo.getUserId());
|
|
|
+ List<UserProfileVo> userProfile = baseMapper.selectUserProfile(userProfileQueryBo);
|
|
|
+ if (CollectionUtils.isNotEmpty(userProfile)){
|
|
|
+ UserProfileVo userProfileVo1 = userProfile.get(0);
|
|
|
+ JsonBean jsonBean = JSON.parseObject(userProfileVo1.getKeyValue(), JsonBean.class);
|
|
|
+ userProfileExportVo.setName(jsonBean.getName().getValue());
|
|
|
+ userProfileExportVo.setSex(jsonBean.getSex().getValue());
|
|
|
+ userProfileExportVo.setIdcard(jsonBean.getIdcard().getValue());
|
|
|
+ userProfileExportVo.setTelphone(jsonBean.getTelphone().getValue());
|
|
|
+ userProfileExportVo.setEducation(jsonBean.getEducation().getValue());
|
|
|
+ userProfileExportVo.setSchool(jsonBean.getSchool().getValue());
|
|
|
+ userProfileExportVo.setGraduation_time(DateUtil.formatDate(jsonBean.getGraduation_time().getValue()));
|
|
|
+ userProfileExportVo.setWork_unit(jsonBean.getWork_unit().getValue());
|
|
|
+ userProfileExportVo.setUnit_contact(jsonBean.getUnit_contact().getValue());
|
|
|
+ userProfileExportVo.setUnit_tel(jsonBean.getUnit_tel().getValue());
|
|
|
+ userProfileExportVo.setApply_post(jsonBean.getApply_post().getValue());
|
|
|
+ userProfileExportVo.setMajor(jsonBean.getMajor().getValue());
|
|
|
+ userProfileExportVo.setWorking_years(jsonBean.getWorking_years().getValue());
|
|
|
+ if (StringUtils.isNotBlank(jsonBean.getRecent_photos().getValue())) {
|
|
|
+ userProfileExportVo.setRecent_photos(ALIYUN_OSS_ENDPOINT + "/" + jsonBean.getRecent_photos().getValue());
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isNotBlank(jsonBean.getIdcard_face_photo().getValue())) {
|
|
|
+ userProfileExportVo.setIdcard_face_photo(ALIYUN_OSS_ENDPOINT + "/" + jsonBean.getIdcard_face_photo().getValue());
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isNotBlank(jsonBean.getIdcard_national_photo().getValue())) {
|
|
|
+ userProfileExportVo.setIdcard_national_photo(ALIYUN_OSS_ENDPOINT + "/" + jsonBean.getIdcard_national_photo().getValue());
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isNotBlank(jsonBean.getCommitment_electr_signature().getValue())) {
|
|
|
+ userProfileExportVo.setCommitment_electr_signature(ALIYUN_OSS_ENDPOINT + "/" + jsonBean.getCommitment_electr_signature().getValue());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ userProfileExportVo.setOneTime(DateUtil.formatDate(new Date(userProfileVo.getOneTime()*1000)));
|
|
|
+ userProfileExportVo.setLastTime(DateUtil.formatDate(new Date(userProfileVo.getLastTime()*1000)));
|
|
|
+ userProfileExportVo.setCreateByName(userProfileVo.getCreateByName());
|
|
|
+ if (userProfileVo.getAuditTime() != null) {
|
|
|
+ userProfileExportVo.setAuditTime(DateUtil.formatDate(new Date(userProfileVo.getAuditTime() * 1000)));
|
|
|
+ }
|
|
|
+ userProfileExportVos.add(userProfileExportVo);
|
|
|
+ }
|
|
|
+ return userProfileExportVos;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* url读取image转换为Base64字符串
|
|
|
*
|