wangning 7 years ago
commit 9ea8134c24

@ -94,7 +94,7 @@ public interface RetailAppService {
void drawDeposits(JSONObject device, BigDecimal draw_amount, String client_id); void drawDeposits(JSONObject device, BigDecimal draw_amount, String client_id);
JSONObject getCashbackCleanInfo(JSONObject device); JSONObject getCashbackCleanInfo(JSONObject device,String client_id);
void sendMassageByCode(JSONObject params); void sendMassageByCode(JSONObject params);
@ -105,4 +105,6 @@ public interface RetailAppService {
JSONObject getCouponById(JSONObject device, String coupon_log_id); JSONObject getCouponById(JSONObject device, String coupon_log_id);
void useCoupon(JSONObject device, String coupon_log_id); void useCoupon(JSONObject device, String coupon_log_id);
JSONObject getAd(JSONObject device);
} }

@ -43,6 +43,7 @@ import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList; import com.github.miemiedev.mybatis.paginator.domain.PageList;
import com.notnoop.apns.APNS; import com.notnoop.apns.APNS;
import com.notnoop.apns.ApnsService; import com.notnoop.apns.ApnsService;
import org.apache.commons.lang3.RandomUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateFormatUtils; import org.apache.commons.lang3.time.DateFormatUtils;
import org.apache.commons.lang3.time.DateUtils; import org.apache.commons.lang3.time.DateUtils;
@ -1049,13 +1050,17 @@ public class RetailAppServiceImp implements RetailAppService {
} }
@Override @Override
public JSONObject getCashbackCleanInfo(JSONObject device) { public JSONObject getCashbackCleanInfo(JSONObject device,String client_id) {
String clientType = device.getString("client_type"); String clientType = device.getString("client_type");
deviceSupport.findRegister(clientType); deviceSupport.findRegister(clientType);
JSONObject res = clientManager.getBankAccountByClientId(device.getIntValue("client_id")); JSONArray clientIds = clientManager.getAllClientIds(device.getIntValue("client_id"));
JSONObject rate = merchantInfoProvider.clientCurrentRate(device.getIntValue("client_id"), new Date(), "Wechat"); if (!clientIds.contains(client_id)) {
throw new ForbiddenException("partner has no permission");
}
JSONObject res = clientManager.getBankAccountByClientId(Integer.parseInt(client_id));
JSONObject rate = merchantInfoProvider.clientCurrentRate(Integer.parseInt(client_id), new Date(), "Wechat");
if (rate.getInteger("clean_days") == null) { if (rate.getInteger("clean_days") == null) {
JSONObject client = clientManager.getClientInfo(device.getIntValue("client_id")); JSONObject client = clientManager.getClientInfo(Integer.parseInt(client_id));
rate.put("clean_days", client.getIntValue("clean_days")); rate.put("clean_days", client.getIntValue("clean_days"));
} }
res.put("clean_days", rate.getIntValue("clean_days")); res.put("clean_days", rate.getIntValue("clean_days"));
@ -1168,6 +1173,20 @@ public class RetailAppServiceImp implements RetailAppService {
couponVerificationService.useCoupon(coupon_log_id); couponVerificationService.useCoupon(coupon_log_id);
} }
@Override
public JSONObject getAd(JSONObject device) {
String clientType = device.getString("client_type");
deviceSupport.findRegister(clientType);
JSONObject res = royalPayCMSSupport.listArticles("app_ad", false, true, 1, 10);
JSONArray acts = res.getJSONArray("data");
if (acts.size()>0){
int selectNo = RandomUtils.nextInt(0,acts.size());
return acts.getJSONObject(selectNo);
}
return null;
}
private static boolean mathchLetterorNum(String str) { private static boolean mathchLetterorNum(String str) {
String regex = "[A-Za-z0-9]{8}"; String regex = "[A-Za-z0-9]{8}";
return str.matches(regex); return str.matches(regex);

@ -236,8 +236,11 @@ public class RetailAppController {
} }
@RequestMapping(value = "/cash_back/clean_info", method = RequestMethod.GET) @RequestMapping(value = "/cash_back/clean_info", method = RequestMethod.GET)
public JSONObject getCashbackCleanInfo(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) { public JSONObject getCashbackCleanInfo(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device,@RequestParam(value = "client_id",required = false) String client_id) {
return retailAppService.getCashbackCleanInfo(device); if (client_id==null){
client_id=device.getString("client_id");
}
return retailAppService.getCashbackCleanInfo(device,client_id);
} }
@RequestMapping(value = "/partner_signin_app_qrcode/{codeId}", method = RequestMethod.GET) @RequestMapping(value = "/partner_signin_app_qrcode/{codeId}", method = RequestMethod.GET)
@ -264,4 +267,12 @@ public class RetailAppController {
} }
/*优惠券End*/ /*优惠券End*/
/**
* 广
*/
@RequestMapping(value = "/ads", method = RequestMethod.GET)
public JSONObject getActivities(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) {
return retailAppService.getAd(device);
}
} }

@ -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>

@ -20,20 +20,24 @@
<label class="col-md-2 control-label" for="kw-input">HTML Keywords</label> <label class="col-md-2 control-label" for="kw-input">HTML Keywords</label>
<div class="col-md-10"> <div class="col-md-10">
<input ng-model="article.page_keywords" type="text" name="title" id="kw-input" class="form-control"> <input ng-model="article.page_keywords" type="text" name="title" id="kw-input" class="form-control">
<p ng-if="catId=='app_ad'"class="small text-warning">(0不允许跳转 1允许跳转)</p>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label ng-if="catId!='app_activity'" class="col-md-2 control-label" for="desc-input">HTML Description</label> <label ng-if="catId!='app_activity' and catId!='app_ad" class="col-md-2 control-label" for="desc-input">HTML Description</label>
<label ng-if="catId=='app_activity'" class="col-md-2 control-label" for="desc-input">HomePage AD</label> <label ng-if="catId=='app_activity'" class="col-md-2 control-label" for="desc-input">HomePage AD</label>
<label ng-if="catId=='app_ad'" class="col-md-2 control-label" for="desc-input">App Launch AD</label>
<div class="col-md-10"> <div class="col-md-10">
<textarea ng-model="article.page_desc" name="desc" id="desc-input" class="form-control"></textarea> <textarea ng-model="article.page_desc" name="desc" id="desc-input" class="form-control"></textarea>
<p ng-if="catId=='app_activity'"class="small text-warning">(需要展示在首页时填写反之请输0)</p> <p ng-if="catId=='app_activity'"class="small text-warning">(需要展示在首页时填写反之请输0)</p>
<p ng-if="catId=='app_ad'"class="small text-warning">(图片尽量要小控制在500k以内否则会影响APP页面加载速度)</p>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-md-2 control-label" for="summery-input">Summary</label> <label class="col-md-2 control-label" for="summery-input">Summary</label>
<div class="col-md-10"> <div class="col-md-10">
<textarea id="summery-input" ng-model="article.summery" name="summery" class="form-control"></textarea> <textarea id="summery-input" ng-model="article.summery" name="summery" class="form-control"></textarea>
<p ng-if="catId=='app_ad'"class="small text-warning">(若有外链则填否则留空。在Content为空的时若有外链则点击图片进行跳转)</p>
</div> </div>
</div> </div>

@ -23,6 +23,9 @@
<div class="btn-group"> <div class="btn-group">
<a class="btn btn-default" ui-sref=".category({catId:'app_activity'})">App活动页</a> <a class="btn btn-default" ui-sref=".category({catId:'app_activity'})">App活动页</a>
</div> </div>
<div class="btn-group">
<a class="btn btn-default" ui-sref=".category({catId:'app_ad'})">App广告页</a>
</div>
</div> </div>
</div> </div>
</section> </section>

@ -16,6 +16,7 @@
<tr> <tr>
<th>Username</th> <th>Username</th>
<th>Display Name</th> <th>Display Name</th>
<th>OpenId</th>
<th>Role</th> <th>Role</th>
<th>Create Time</th> <th>Create Time</th>
<th>Operation</th> <th>Operation</th>
@ -25,6 +26,10 @@
<tr ng-repeat="account in accounts"> <tr ng-repeat="account in accounts">
<td ng-bind="account.username"></td> <td ng-bind="account.username"></td>
<td ng-bind="account.display_name"></td> <td ng-bind="account.display_name"></td>
<td>
<img ng-src="{{account.wechat_headimg}}" style="height: 30px;width:30px;" class="img-circle" ng-if="account.wechat_headimg">
{{account.wechat_openid}}
</td>
<td> <td>
<select ng-change="updateAccountRole(account)" ng-model="account.role" ng-options="role.code as role.label for role in partnerRoles" title="Account Role"></select> <select ng-change="updateAccountRole(account)" ng-model="account.role" ng-options="role.code as role.label for role in partnerRoles" title="Account Role"></select>
</td> </td>

@ -28,9 +28,6 @@ $(document).ready(function () {
method: 'GET', method: 'GET',
dataType: 'json', dataType: 'json',
success: function (pay) { success: function (pay) {
if (window.client_moniker=='PINE'){
alert('pay json:'+JSON.stringify(pay));
}
if (pay.direct_paid) { if (pay.direct_paid) {
location.href = window.redirect; location.href = window.redirect;
return; return;
@ -48,9 +45,6 @@ $(document).ready(function () {
tradeNO: pay.trade_no tradeNO: pay.trade_no
}, function (res) { }, function (res) {
dataCache.paying = false; dataCache.paying = false;
if (window.client_moniker=='PINE'){
alert('callback:'+JSON.stringify(res));
}
if (res.resultCode == '9000') { if (res.resultCode == '9000') {
AlipayJSBridge.call('startApp', { AlipayJSBridge.call('startApp', {
appId: '20000056', appId: '20000056',

Loading…
Cancel
Save