Browse Source

导出场所码

master
yinzuomei 3 years ago
parent
commit
b26072e40a
  1. 35
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcEnterpriseServiceImpl.java

35
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcEnterpriseServiceImpl.java

@ -14,6 +14,7 @@ import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.enums.CommonOperateTypeEnum;
import com.epmet.commons.tools.enums.CoveragePlaceTypeEnum;
import com.epmet.commons.tools.enums.DictTypeEnum;
import com.epmet.commons.tools.enums.EnvEnum;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.ExceptionUtils;
@ -69,7 +70,6 @@ import java.util.stream.Collectors;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
import static com.epmet.constant.CustomerAgencyConstant.JUMP_URL;
import static com.epmet.service.impl.HouseServiceImpl.bufferedImageToInputStream;
/**
@ -590,12 +590,21 @@ public class IcEnterpriseServiceImpl extends BaseServiceImpl<IcEnterpriseDao, Ic
/**
* @Description 登记码导出
* 开发环境45687aa479955f9d06204d415238f7cc
* 微笑崂山3fdd0380deff5b30f45376cdf995d1c1
* 烟台1535072605621841922
* 目前只给烟台用为了测试生产微笑崂山也放开
* @param formDTO
* @Author zxc
* @Date 2022/10/26 15:55
*/
@Override
public void qrCodeExport(EnterprisePageFormDTO formDTO, HttpServletResponse response) throws IOException {
if (!"45687aa479955f9d06204d415238f7cc".equals(formDTO.getCustomerId())
&& !"3fdd0380deff5b30f45376cdf995d1c1".equals(formDTO.getCustomerId())
&& !"1535072605621841922".equals(formDTO.getCustomerId())) {
return;
}
List<EnterpriseDetailDTO> list = list(formDTO).getList();
if (CollectionUtils.isEmpty(list)){
log.error("根据条件未查询到企事业单位信息,登记码压缩包不能导出!");
@ -611,9 +620,31 @@ public class IcEnterpriseServiceImpl extends BaseServiceImpl<IcEnterpriseDao, Ic
//设置下载格式和名称
response.setHeader("Content-Disposition", "attachment;filename=" + downloadFilename);
ZipOutputStream zip = new ZipOutputStream(response.getOutputStream());
//不同环境的码,访问的地址不一样
String jumpUrl="";
EnvEnum currentEnv = EnvEnum.getCurrentEnv();
if (EnvEnum.PROD.getCode().equals(currentEnv.getCode())) {
if ("1535072605621841922".equals(formDTO.getCustomerId())) {
// 烟台的客户id
jumpUrl = "https://epmet-yantai.elinkservice.cn";
} else if ("3fdd0380deff5b30f45376cdf995d1c1".equals(formDTO.getCustomerId())) {
// 微笑崂山
jumpUrl = "https://epmet-cloud.elinkservice.cn";
}
} else if (EnvEnum.TEST.getCode().equals(currentEnv.getCode())) {
// 最美琴岛
jumpUrl = "https://epmet-dev.elinkservice.cn/";
} else {
// 其余统一走开发环境
jumpUrl = "http://192.168.1.140";
}
for (EnterpriseDetailDTO l : list) {
try {
String content = JUMP_URL + "enterpriseId=" + l.getEnterpriseId() + "&customerId=" + formDTO.getCustomerId() + "&placeOrgName=" + l.getPlaceOrgName();
// CustomerAgencyConstant.JUMP_URL = "http://192.168.1.140/epmet-oper-gov/#/staffRegister?";
// String content = JUMP_URL + "enterpriseId=" + l.getEnterpriseId() + "&customerId=" + formDTO.getCustomerId() + "&placeOrgName=" + l.getPlaceOrgName();
String content = jumpUrl.concat("/epmet-oper-gov/#/staffRegister?") + "enterpriseId=" + l.getEnterpriseId() + "&customerId=" + formDTO.getCustomerId() + "&placeOrgName=" + l.getPlaceOrgName();
BufferedImage image = HouseQRcodeUtils.drawHouseQRImage(l.getPlaceOrgName(), content);
byte[] buf = new byte[8192];
int len;

Loading…
Cancel
Save