|
|
@@ -94,10 +94,17 @@ public class ProjectPaySettingServiceImpl extends SuperService implements Projec
|
|
|
return ResultContent.buildFail(String.format("%s 结构不属于项目类型", projectOrg.getName()));
|
|
|
}
|
|
|
WxPayConfig wxPayConfig = wxPayConfigDao.findTopByProjectOid(param.getProjectOid());
|
|
|
+ WxPayConfig temp = wxPayConfigDao.findTopByAppId(param.getAppid());
|
|
|
if (ObjectUtils.isEmpty(wxPayConfig)) {
|
|
|
wxPayConfig = new WxPayConfig();
|
|
|
initEntity(wxPayConfig);
|
|
|
+ } else {
|
|
|
+ // 编辑
|
|
|
+ if (ObjectUtils.isNotEmpty(temp) && !temp.getId().equals(wxPayConfig.getId())) {
|
|
|
+ return ResultContent.buildFail(String.format("appId已存在:%s", wxPayConfig.getAppid()));
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
BeanUtils.copyProperties(param, wxPayConfig);
|
|
|
wxPayConfigDao.save(wxPayConfig);
|
|
|
return ResultContent.buildSuccess();
|
|
|
@@ -145,9 +152,13 @@ public class ProjectPaySettingServiceImpl extends SuperService implements Projec
|
|
|
*/
|
|
|
@Override
|
|
|
public ResultContent<WxPayConfigModel> getProjectWxPayConfig(ProjectWxPayParam param) {
|
|
|
-
|
|
|
-
|
|
|
- return null;
|
|
|
+ String appId = param.getAppId();
|
|
|
+ WxPayConfigModel model = null;
|
|
|
+ WxPayConfig wxPayConfig = wxPayConfigDao.findTopByAppId(appId);
|
|
|
+ if (ObjectUtils.isNotEmpty(wxPayConfig)) {
|
|
|
+ model = toModel(wxPayConfig);
|
|
|
+ }
|
|
|
+ return ResultContent.buildSuccess(model);
|
|
|
}
|
|
|
|
|
|
}
|