diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeServiceImpl.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeServiceImpl.java index 9a5640f22d..781a8a40d4 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeServiceImpl.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeServiceImpl.java @@ -15,6 +15,7 @@ import com.epmet.dao.MiniInfoDao; import com.epmet.dto.*; import com.epmet.dto.form.*; import com.epmet.dto.result.*; +import com.epmet.feign.OperCrmOpenFeignClient; import com.epmet.feign.OssFeignClient; import com.epmet.service.*; import com.epmet.wxapi.param.*; @@ -68,6 +69,8 @@ public class CodeServiceImpl implements CodeService { private PaCustomerService paCustomerService; @Autowired private MiniInfoDao miniInfoDao; + @Autowired + private OperCrmOpenFeignClient operCrmOpenFeignClient; @Override public List templateList() { @@ -97,11 +100,7 @@ public class CodeServiceImpl implements CodeService { @Override public String getExtJson(CodeUploadFormDTO formDTO) { - CodeExtDTO codeExtDTO = codeExtService.getExtByCustomer(formDTO.getCustomerId(), formDTO.getClientType()); - if (null == codeExtDTO) { - return codeExtService.getExtTemplate(formDTO.getClientType()); - } - return codeExtDTO.getExtJson(); + return codeExtService.getExtTemplate(formDTO.getClientType()); } @@ -118,6 +117,12 @@ public class CodeServiceImpl implements CodeService { if (null == authInfo) { throw new RenException("未授权"); } + CustomerDTO customerFormDTO = new CustomerDTO(); + customerFormDTO.setId(formDTO.getCustomerId()); + Result result = operCrmOpenFeignClient.getCustomerInfo(customerFormDTO); + if (!result.success()) { + throw new RenException(result.getCode(), result.getMsg()); + } //获取小程序居民端与工作端名称 String resiName = miniInfoDao.getNickName(formDTO.getCustomerId(), "resi"); String workName = miniInfoDao.getNickName(formDTO.getCustomerId(), "work"); @@ -127,6 +132,7 @@ public class CodeServiceImpl implements CodeService { wxExtJson.getExt().setExtAppid(authInfo.getAuthorizerAppid()); wxExtJson.getExt().setResiName(resiName); wxExtJson.getExt().setWorkName(workName); + wxExtJson.getExt().setCustomerName(null == result.getData().getCustomerName()?"":result.getData().getCustomerName()); extJson = JSON.toJSONString(wxExtJson); CodeExtDTO codeExtDTO = codeExtService.getExtByCustomer(formDTO.getCustomerId(), formDTO.getClientType()); if (null == codeExtDTO) { diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/param/WxExtJson.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/param/WxExtJson.java index 4ba45e37cf..6a22908d9b 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/param/WxExtJson.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/param/WxExtJson.java @@ -24,6 +24,8 @@ public class WxExtJson implements Serializable { private boolean directCommit; @JSONField(ordinal = 4) private ExtBean ext; + @JSONField(ordinal = 5) + private WindowBean window; @NoArgsConstructor @Data @@ -31,10 +33,12 @@ public class WxExtJson implements Serializable { @JSONField(ordinal = 1) private String extAppid; @JSONField(ordinal = 2) - private String resiName; + private String customerName; @JSONField(ordinal = 3) - private String workName; + private String resiName; @JSONField(ordinal = 4) + private String workName; + @JSONField(ordinal = 5) private FootbarBean footbar; @NoArgsConstructor @Data @@ -119,4 +123,12 @@ public class WxExtJson implements Serializable { } } } + + @NoArgsConstructor + @Data + public static class WindowBean { + @JSONField(ordinal = 1) + private String navigationBarTitleText; + } + }