Browse Source

修改五证明办事业务逻辑;

dev
luyan 2 years ago
parent
commit
66e3b72fc6
  1. 4
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/ActWithoutProofController.java
  2. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/ActWithoutProofService.java
  3. 23
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/ActWithoutProofServiceImpl.java

4
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/ActWithoutProofController.java

@ -1,6 +1,7 @@
package com.epmet.controller; package com.epmet.controller;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.result.WzmDocumentRsultDTO;
import com.epmet.service.ActWithoutProofService; import com.epmet.service.ActWithoutProofService;
import com.epmet.util.ActWithoutProofUtils; import com.epmet.util.ActWithoutProofUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
@ -11,6 +12,7 @@ import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.io.IOException; import java.io.IOException;
import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
@ -50,7 +52,7 @@ public class ActWithoutProofController {
* @throws IOException * @throws IOException
*/ */
@GetMapping("getWzmProject") @GetMapping("getWzmProject")
public Result getWzmProject(@RequestParam Map<String, Object> params) throws IOException { public Result<List<WzmDocumentRsultDTO>> getWzmProject(@RequestParam Map<String, Object> params) throws IOException {
String idCard = "", certType = "", qrcode = "", xm = "", zmtaskguid = ""; String idCard = "", certType = "", qrcode = "", xm = "", zmtaskguid = "";
String token = ActWithoutProofUtils.getToken(); String token = ActWithoutProofUtils.getToken();
if (StringUtils.isEmpty(token)) { if (StringUtils.isEmpty(token)) {

2
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/ActWithoutProofService.java

@ -34,7 +34,7 @@ public interface ActWithoutProofService {
* @param xm 残疾人证和不动产权属状况证明必填 * @param xm 残疾人证和不动产权属状况证明必填
* @param zmtaskguid 证明guid * @param zmtaskguid 证明guid
*/ */
WzmDocumentRsultDTO getWzmProject(String token, String idCard, String certType, String qrcode, String xm, String zmtaskguid) throws IOException; List<WzmDocumentRsultDTO> getWzmProject(String token, String idCard, String certType, String qrcode, String xm, String zmtaskguid) throws IOException;
/** /**
* 重新开具证明 * 重新开具证明

23
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/ActWithoutProofServiceImpl.java

@ -102,7 +102,7 @@ public class ActWithoutProofServiceImpl implements ActWithoutProofService {
} }
@Override @Override
public WzmDocumentRsultDTO getWzmProject(String token, String idCard, String certType, String qrcode, String xm, String zmtaskguid) throws IOException { public List<WzmDocumentRsultDTO> getWzmProject(String token, String idCard, String certType, String qrcode, String xm, String zmtaskguid) throws IOException {
CloseableHttpClient client = null; CloseableHttpClient client = null;
CloseableHttpResponse response = null; CloseableHttpResponse response = null;
try { try {
@ -144,22 +144,31 @@ public class ActWithoutProofServiceImpl implements ActWithoutProofService {
//返回 //返回
JSONObject result = JSONObject.parseObject(EntityUtils.toString(response.getEntity())); JSONObject result = JSONObject.parseObject(EntityUtils.toString(response.getEntity()));
WzmDocumentRsultDTO dto = null; WzmDocumentRsultDTO dto = null;
List<WzmDocumentRsultDTO> dtoList= new ArrayList<>();
if (result.getString("code").equals("200")) { if (result.getString("code").equals("200")) {
JSONArray jsonArray = JSONObject.parseObject(result.getJSONObject("data").getString("custom")).getJSONArray("result"); JSONArray jsonArray = JSONObject.parseObject(result.getJSONObject("data").getString("custom")).getJSONArray("resultlist");
if (null != jsonArray && jsonArray.size() > 0) { if (null != jsonArray && jsonArray.size() > 0) {
JSONObject j = JSONObject.parseObject(jsonArray.get(0).toString()); JSONObject j = JSONObject.parseObject(jsonArray.get(0).toString());
dto = new WzmDocumentRsultDTO(); dto = new WzmDocumentRsultDTO();
dto.setZmresultname(j.getString("zmresultname")); dto.setZmresultname(j.getString("zmresultname"));
dto.setDownloadurl(j.getString("downloadurl")); if(StringUtils.isNotEmpty(j.getString("downloadurl"))){
String url = j.getString("downloadurl");
if (url.startsWith("http://172.20.84.138/")) {
url = url.replaceAll("http://172.20.84.138/", "https://rzzhsq.shuzirizhao.cn/");
}
dto.setDownloadurl(url);
}
dto.setTimeqrcode(j.getString("timeqrcode")); dto.setTimeqrcode(j.getString("timeqrcode"));
dto.setBase64str(j.getString("base64str")); if(StringUtils.isNotEmpty(j.getString("base64str"))){
dto.setBase64str("data:image/jpeg;base64," + j.getString("base64str"));
} }
log.info(result.toString()); dtoList.add(dto);
return dto; }
return dtoList;
} else { } else {
String erro = JSONObject.parseObject(result.getJSONObject("data").getString("custom")).getString("text"); String erro = JSONObject.parseObject(result.getJSONObject("data").getString("custom")).getString("text");
log.error(erro, result.toString()); log.error(erro, result.toString());
return new WzmDocumentRsultDTO(); throw new EpmetException(erro);
} }
} catch (Exception e) { } catch (Exception e) {
throw new EpmetException("获取失败,请联系管理员!"); throw new EpmetException("获取失败,请联系管理员!");

Loading…
Cancel
Save