|
@@ -106,6 +106,32 @@ public class SchoolBingShopServiceImpl extends SuperService implements SchoolBin
|
|
|
return ResultContent.buildSuccess();
|
|
return ResultContent.buildSuccess();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 得到学校商户信息
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param shopOid
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
|
|
+ public ResultContent<ShopToSchoolModel> getSchoolBingShop(String shopOid) {
|
|
|
|
|
+ String oid = getCurrentOid();
|
|
|
|
|
+ Organization mainOrganization = organizationDao.findTopByOid(oid);
|
|
|
|
|
+ if (mainOrganization.getAuthType() != AuthType.School) {
|
|
|
|
|
+ return ResultContent.buildFail(String.format("当前机构不属于学校类型"));
|
|
|
|
|
+ }
|
|
|
|
|
+ // 商户信息
|
|
|
|
|
+ Organization relOrganization = organizationDao.findTopByOid(shopOid);
|
|
|
|
|
+ if (ObjectUtils.isEmpty(relOrganization)) {
|
|
|
|
|
+ return ResultContent.buildFail(String.format("商户oid不存在:%s", shopOid));
|
|
|
|
|
+ }
|
|
|
|
|
+ OrganizationRelation relation = organizationRelationDao.findTopByMainOrganizationAndRelOrganizationAndRelationType(
|
|
|
|
|
+ mainOrganization, relOrganization, OrganizationRelationType.ShopToSchool);
|
|
|
|
|
+ if (ObjectUtils.isEmpty(relation)) {
|
|
|
|
|
+ return ResultContent.buildFail(String.format("未找到对应数据:%s", shopOid));
|
|
|
|
|
+ }
|
|
|
|
|
+ ShopToSchoolModel model = toModel(relation);
|
|
|
|
|
+ return ResultContent.buildSuccess(model);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
public ResultContent<Page<ShopToSchoolModel>> page(OrganizationRelationSearch param, Pageable pageable) {
|
|
public ResultContent<Page<ShopToSchoolModel>> page(OrganizationRelationSearch param, Pageable pageable) {
|
|
|
String oid = getCurrentOid();
|
|
String oid = getCurrentOid();
|