Browse Source

Merge remote-tracking branch 'origin/dev_analysis' into dev_analysis

dev
yinzuomei 6 years ago
parent
commit
4be1de56df
  1. 3
      esua-epdc/epdc-admin/epdc-admin-server/pom.xml
  2. 1
      esua-epdc/epdc-gateway/src/main/resources/application.yml
  3. 2
      esua-epdc/epdc-module/epdc-analysis/epdc-analysis-client/pom.xml
  4. 18
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/epidemic/controller/EpidemicSentryPostController.java
  5. 14
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/epidemic/service/EpidemicSentryPostService.java
  6. 44
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/epidemic/service/impl/EpidemicSentryPostServiceImpl.java

3
esua-epdc/epdc-admin/epdc-admin-server/pom.xml

@ -185,6 +185,7 @@
<!-- nacos -->
<nacos.register-enabled>true</nacos.register-enabled>
<nacos.server-addr>10.5.34.164:8848</nacos.server-addr>
<nacos.ip></nacos.ip>
<spring.zipkin.base-url>http://172.31.171.61:9411</spring.zipkin.base-url>
<!--小程序配置-->
@ -215,6 +216,7 @@
<!-- nacos -->
<nacos.register-enabled>true</nacos.register-enabled>
<nacos.server-addr>172.16.1.238:8848</nacos.server-addr>
<nacos.ip></nacos.ip>
<spring.zipkin.base-url>http://172.31.171.61:9411</spring.zipkin.base-url>
<!--居民端小程序配置-->
@ -257,6 +259,7 @@
<!-- nacos -->
<nacos.register-enabled>true</nacos.register-enabled>
<nacos.server-addr>172.16.0.52:8848</nacos.server-addr>
<nacos.ip></nacos.ip>
<spring.zipkin.base-url>http://172.31.171.61:9411</spring.zipkin.base-url>

1
esua-epdc/epdc-gateway/src/main/resources/application.yml

@ -225,6 +225,7 @@ renren:
- /heart/**
- /oss/file/download
- /ws/**
- /custom/epidemicSentryPost/downloadQRCode/**
workLoginUrls:
- /api/work/user/getToken #工作端-获取token
- /api/work/user/login #工作端-登录

2
esua-epdc/epdc-module/epdc-analysis/epdc-analysis-client/pom.xml

@ -24,4 +24,4 @@
<finalName>${project.artifactId}</finalName>
</build>
</project>
</project>

18
esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/epidemic/controller/EpidemicSentryPostController.java

File diff suppressed because one or more lines are too long

14
esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/epidemic/service/EpidemicSentryPostService.java

@ -25,6 +25,7 @@ import com.elink.esua.epdc.dto.form.CreateCodeFormDTO;
import com.elink.esua.epdc.modules.epidemic.entity.EpidemicSentryPostEntity;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
@ -108,7 +109,7 @@ public interface EpidemicSentryPostService extends BaseService<EpidemicSentryPos
/**
* @Description: 哨卡名称查询(未绑定网格id的)
* @Param: []
* @return: com.elink.esua.epdc.commons.tools.utils.Result<java.util.List < java.util.Map < java.lang.String, java.lang.String>>>
* @return: com.elink.esua.epdc.commons.tools.utils.Result<java.util.List < java.util.Map < java.lang.String , java.lang.String>>>
* @Author: zy
* @Date: 2020-02-14
*/
@ -163,4 +164,15 @@ public interface EpidemicSentryPostService extends BaseService<EpidemicSentryPos
* @date 2020/2/16 17:03
*/
EpidemicSentryPostDTO selectOneByThirdSentryPostid(String thirdSentryPostid);
/**
* 下载图片
*
* @param postId
* @param response
* @return com.elink.esua.epdc.dto.EpidemicSentryPostDTO
* @author rongchao
* @date 2020/2/16 17:03
*/
void downloadQRCode(String postId, HttpServletResponse response);
}

44
esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/epidemic/service/impl/EpidemicSentryPostServiceImpl.java

@ -47,9 +47,11 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@ -147,6 +149,39 @@ public class EpidemicSentryPostServiceImpl extends BaseServiceImpl<EpidemicSentr
return ConvertUtils.sourceToTarget(baseDao.selectOne(wrapper), EpidemicSentryPostDTO.class);
}
@Override
public void downloadQRCode(String postId, HttpServletResponse response) {
EpidemicSentryPostDTO dto = selectOneByThirdSentryPostid(postId);
URL url;
try {
String fileUrl = dto.getMaCodeUrl();
url = new URL(fileUrl);
DataInputStream dataInputStream = new DataInputStream(url.openStream());
if (null != dataInputStream) {
response.setHeader("Cache-Control", "No-Cache");
response.setContentType("image/jpeg");
byte[] buf = new byte[1024];
int L;
OutputStream toClient = new BufferedOutputStream(response.getOutputStream());
while ((L = dataInputStream.read(buf)) != NumConstant.ONE_NEG) {
toClient.write(buf, NumConstant.ZERO, L);
}
dataInputStream.close();
toClient.flush();
toClient.close();
}
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
@Override
public List<Map<String, String>> listSentryPostName() {
return baseDao.selectListSentryPostName();
@ -181,6 +216,9 @@ public class EpidemicSentryPostServiceImpl extends BaseServiceImpl<EpidemicSentr
if (StringUtils.isNotBlank(item.getThirdSentryPostId())) {
item.setThirdSentryPostId(item.getThirdSentryPostId().trim());
}
if (StringUtils.isNotBlank(item.getSentryPostName())) {
item.setSentryPostName(item.getSentryPostName().trim());
}
for (EpidemicSentryPostEntity oldItem : oldEntityList) {
if (StringUtils.isNotBlank(item.getThirdSentryPostId()) && item.getThirdSentryPostId().equals(oldItem.getThirdSentryPostId())) {
//三方哨卡Id相同时 更新

Loading…
Cancel
Save