增加customer调用接口,获取manager列表

master
yuan 7 years ago
parent c983035613
commit 6253447003

@ -13,4 +13,6 @@ public interface CouponValidateService {
//使用后核销券 //使用后核销券
boolean useCoupon(String couponLogId); boolean useCoupon(String couponLogId);
JSONObject getPaymentManager();
} }

@ -1,6 +1,7 @@
package au.com.royalpay.payment.manage.customers.core.impls; package au.com.royalpay.payment.manage.customers.core.impls;
import au.com.royalpay.payment.manage.customers.core.CouponValidateService; import au.com.royalpay.payment.manage.customers.core.CouponValidateService;
import au.com.royalpay.payment.manage.mappers.customers.CustomerMembershipMapper;
import au.com.royalpay.payment.tools.exceptions.BadRequestException; import au.com.royalpay.payment.tools.exceptions.BadRequestException;
import cn.yixblog.platform.http.HttpRequestGenerator; import cn.yixblog.platform.http.HttpRequestGenerator;
import cn.yixblog.platform.http.HttpRequestResult; import cn.yixblog.platform.http.HttpRequestResult;
@ -14,6 +15,7 @@ import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.util.UriComponentsBuilder; import org.springframework.web.util.UriComponentsBuilder;
import javax.annotation.Resource;
import java.util.Date; import java.util.Date;
@ -34,6 +36,9 @@ public class CouponValidateServiceImpl implements CouponValidateService {
@Value("${customer.app.auth-code}") @Value("${customer.app.auth-code}")
private String CUSTOMER_AUTH_CODE; private String CUSTOMER_AUTH_CODE;
@Resource
private CustomerMembershipMapper customerMembershipMapper;
@Override @Override
public JSONObject getCoupon(JSONObject partner,int page,int limit) { public JSONObject getCoupon(JSONObject partner,int page,int limit) {
String timestamp = System.currentTimeMillis() + ""; String timestamp = System.currentTimeMillis() + "";
@ -133,4 +138,11 @@ public class CouponValidateServiceImpl implements CouponValidateService {
} }
return false; return false;
} }
@Override
public JSONObject getPaymentManager() {
JSONObject object = new JSONObject();
object.put("managers",customerMembershipMapper.listPaymentManagerByCus());
return object;
}
} }

@ -0,0 +1,28 @@
package au.com.royalpay.payment.manage.customers.web;
import au.com.royalpay.payment.manage.apps.AppController;
import au.com.royalpay.payment.manage.customers.core.CouponValidateService;
import com.alibaba.fastjson.JSONObject;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.annotation.Resource;
/**
* Created by yuan on 2017/12/27.
*/
@RequestMapping(value = "/manager")
@AppController
public class PaymentManagerController {
@Resource
private CouponValidateService couponVerificationService;
@GetMapping(value = "/get_payment_manage")
public JSONObject getPaymentManager(){
JSONObject json = couponVerificationService.getPaymentManager();
return json;
}
}

@ -35,4 +35,6 @@ public interface CustomerMembershipMapper {
List<JSONObject> listEncourageBalanceHistory(@Param("fromDate") Date fromDate, @Param("toDate") Date toDate, @Param("memberId") String memberId); List<JSONObject> listEncourageBalanceHistory(@Param("fromDate") Date fromDate, @Param("toDate") Date toDate, @Param("memberId") String memberId);
BigDecimal sumEncourageBalance(); BigDecimal sumEncourageBalance();
List<String> listPaymentManagerByCus();
} }

@ -49,4 +49,11 @@
<select id="sumEncourageBalance" resultType="java.math.BigDecimal"> <select id="sumEncourageBalance" resultType="java.math.BigDecimal">
SELECT sum(encourage_balance) FROM cus_membership WHERE is_valid=1 SELECT sum(encourage_balance) FROM cus_membership WHERE is_valid=1
</select> </select>
<select id="listPaymentManagerByCus" resultType="java.lang.String">
<![CDATA[
SELECT c.kanga_openid
from cus_membership c, sys_managers s where c.payment_openid = s.wx_openid AND s.role & 1 >0
]]>
</select>
</mapper> </mapper>
Loading…
Cancel
Save