Browse Source

Ext_Json修改

master
zhaoqifeng 5 years ago
parent
commit
c5640fa902
  1. 16
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeServiceImpl.java
  2. 16
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/param/WxExtJson.java

16
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.*;
import com.epmet.dto.form.*; import com.epmet.dto.form.*;
import com.epmet.dto.result.*; import com.epmet.dto.result.*;
import com.epmet.feign.OperCrmOpenFeignClient;
import com.epmet.feign.OssFeignClient; import com.epmet.feign.OssFeignClient;
import com.epmet.service.*; import com.epmet.service.*;
import com.epmet.wxapi.param.*; import com.epmet.wxapi.param.*;
@ -68,6 +69,8 @@ public class CodeServiceImpl implements CodeService {
private PaCustomerService paCustomerService; private PaCustomerService paCustomerService;
@Autowired @Autowired
private MiniInfoDao miniInfoDao; private MiniInfoDao miniInfoDao;
@Autowired
private OperCrmOpenFeignClient operCrmOpenFeignClient;
@Override @Override
public List<TemplateListResultDTO> templateList() { public List<TemplateListResultDTO> templateList() {
@ -97,11 +100,7 @@ public class CodeServiceImpl implements CodeService {
@Override @Override
public String getExtJson(CodeUploadFormDTO formDTO) { public String getExtJson(CodeUploadFormDTO formDTO) {
CodeExtDTO codeExtDTO = codeExtService.getExtByCustomer(formDTO.getCustomerId(), formDTO.getClientType()); return codeExtService.getExtTemplate(formDTO.getClientType());
if (null == codeExtDTO) {
return codeExtService.getExtTemplate(formDTO.getClientType());
}
return codeExtDTO.getExtJson();
} }
@ -118,6 +117,12 @@ public class CodeServiceImpl implements CodeService {
if (null == authInfo) { if (null == authInfo) {
throw new RenException("未授权"); throw new RenException("未授权");
} }
CustomerDTO customerFormDTO = new CustomerDTO();
customerFormDTO.setId(formDTO.getCustomerId());
Result<CustomerDTO> result = operCrmOpenFeignClient.getCustomerInfo(customerFormDTO);
if (!result.success()) {
throw new RenException(result.getCode(), result.getMsg());
}
//获取小程序居民端与工作端名称 //获取小程序居民端与工作端名称
String resiName = miniInfoDao.getNickName(formDTO.getCustomerId(), "resi"); String resiName = miniInfoDao.getNickName(formDTO.getCustomerId(), "resi");
String workName = miniInfoDao.getNickName(formDTO.getCustomerId(), "work"); String workName = miniInfoDao.getNickName(formDTO.getCustomerId(), "work");
@ -127,6 +132,7 @@ public class CodeServiceImpl implements CodeService {
wxExtJson.getExt().setExtAppid(authInfo.getAuthorizerAppid()); wxExtJson.getExt().setExtAppid(authInfo.getAuthorizerAppid());
wxExtJson.getExt().setResiName(resiName); wxExtJson.getExt().setResiName(resiName);
wxExtJson.getExt().setWorkName(workName); wxExtJson.getExt().setWorkName(workName);
wxExtJson.getExt().setCustomerName(null == result.getData().getCustomerName()?"":result.getData().getCustomerName());
extJson = JSON.toJSONString(wxExtJson); extJson = JSON.toJSONString(wxExtJson);
CodeExtDTO codeExtDTO = codeExtService.getExtByCustomer(formDTO.getCustomerId(), formDTO.getClientType()); CodeExtDTO codeExtDTO = codeExtService.getExtByCustomer(formDTO.getCustomerId(), formDTO.getClientType());
if (null == codeExtDTO) { if (null == codeExtDTO) {

16
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; private boolean directCommit;
@JSONField(ordinal = 4) @JSONField(ordinal = 4)
private ExtBean ext; private ExtBean ext;
@JSONField(ordinal = 5)
private WindowBean window;
@NoArgsConstructor @NoArgsConstructor
@Data @Data
@ -31,10 +33,12 @@ public class WxExtJson implements Serializable {
@JSONField(ordinal = 1) @JSONField(ordinal = 1)
private String extAppid; private String extAppid;
@JSONField(ordinal = 2) @JSONField(ordinal = 2)
private String resiName; private String customerName;
@JSONField(ordinal = 3) @JSONField(ordinal = 3)
private String workName; private String resiName;
@JSONField(ordinal = 4) @JSONField(ordinal = 4)
private String workName;
@JSONField(ordinal = 5)
private FootbarBean footbar; private FootbarBean footbar;
@NoArgsConstructor @NoArgsConstructor
@Data @Data
@ -119,4 +123,12 @@ public class WxExtJson implements Serializable {
} }
} }
} }
@NoArgsConstructor
@Data
public static class WindowBean {
@JSONField(ordinal = 1)
private String navigationBarTitleText;
}
} }

Loading…
Cancel
Save