commit
95c379892f
@ -0,0 +1,133 @@
|
|||||||
|
package au.com.royalpay.payment.manage.activities.app_index.beans;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by yuan on 2018/3/14.
|
||||||
|
*/
|
||||||
|
public class AppActBean {
|
||||||
|
private String act_name;
|
||||||
|
private String act_url;
|
||||||
|
private String parms_json;
|
||||||
|
private Boolean is_valid = true;
|
||||||
|
private String desc;
|
||||||
|
private String act_content;
|
||||||
|
private String show_type;
|
||||||
|
private Boolean is_show_window;
|
||||||
|
private String act_img;
|
||||||
|
private String window_img;
|
||||||
|
|
||||||
|
|
||||||
|
public JSONObject toJsonParam(){
|
||||||
|
JSONObject params = new JSONObject();
|
||||||
|
if(StringUtils.isNotEmpty(act_name)){
|
||||||
|
params.put("act_name",act_name);
|
||||||
|
}
|
||||||
|
if(StringUtils.isNotEmpty(act_url)){
|
||||||
|
params.put("act_url",act_url);
|
||||||
|
}
|
||||||
|
if(StringUtils.isNotEmpty(parms_json)){
|
||||||
|
params.put("parms_json",parms_json);
|
||||||
|
}
|
||||||
|
if(StringUtils.isNotEmpty(desc)){
|
||||||
|
params.put("desc",desc);
|
||||||
|
}
|
||||||
|
if(StringUtils.isNotEmpty(act_content)){
|
||||||
|
params.put("act_content",act_content);
|
||||||
|
}
|
||||||
|
if(StringUtils.isNotEmpty(show_type)){
|
||||||
|
params.put("show_type",show_type);
|
||||||
|
}
|
||||||
|
if(StringUtils.isNotEmpty(act_img)){
|
||||||
|
params.put("act_img",act_img);
|
||||||
|
}
|
||||||
|
if(StringUtils.isNotEmpty(window_img)){
|
||||||
|
params.put("window_img",window_img);
|
||||||
|
}
|
||||||
|
params.put("is_show_window",is_show_window);
|
||||||
|
params.put("is_valid",is_valid);
|
||||||
|
return params;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAct_name() {
|
||||||
|
return act_name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAct_name(String act_name) {
|
||||||
|
this.act_name = act_name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAct_url() {
|
||||||
|
return act_url;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAct_url(String act_url) {
|
||||||
|
this.act_url = act_url;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getParms_json() {
|
||||||
|
return parms_json;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setParms_json(String parms_json) {
|
||||||
|
this.parms_json = parms_json;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDesc() {
|
||||||
|
return desc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDesc(String desc) {
|
||||||
|
this.desc = desc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAct_content() {
|
||||||
|
return act_content;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAct_content(String act_content) {
|
||||||
|
this.act_content = act_content;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAct_img() {
|
||||||
|
return act_img;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAct_img(String act_img) {
|
||||||
|
this.act_img = act_img;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getWindow_img() {
|
||||||
|
return window_img;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setWindow_img(String window_img) {
|
||||||
|
this.window_img = window_img;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getShow_type() {
|
||||||
|
return show_type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setShow_type(String show_type) {
|
||||||
|
this.show_type = show_type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean getIs_show_window() {
|
||||||
|
return is_show_window;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIs_show_window(Boolean is_show_window) {
|
||||||
|
this.is_show_window = is_show_window;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean getIs_valid() {
|
||||||
|
return is_valid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIs_valid(Boolean is_valid) {
|
||||||
|
this.is_valid = is_valid;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,45 @@
|
|||||||
|
package au.com.royalpay.payment.manage.activities.app_index.beans;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by yuan on 2018/3/15.
|
||||||
|
*/
|
||||||
|
public class AppActQueryBean {
|
||||||
|
private boolean is_valid;
|
||||||
|
private int page = 1;
|
||||||
|
private int limit = 10;
|
||||||
|
|
||||||
|
public JSONObject toJsonParam(){
|
||||||
|
JSONObject params = new JSONObject();
|
||||||
|
if(is_valid){
|
||||||
|
params.put("is_valid",is_valid);
|
||||||
|
}
|
||||||
|
return params;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isIs_valid() {
|
||||||
|
return is_valid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIs_valid(boolean is_valid) {
|
||||||
|
this.is_valid = is_valid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getPage() {
|
||||||
|
return page;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPage(int page) {
|
||||||
|
this.page = page;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getLimit() {
|
||||||
|
return limit;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLimit(int limit) {
|
||||||
|
this.limit = limit;
|
||||||
|
}
|
||||||
|
}
|
@ -1,9 +1,21 @@
|
|||||||
package au.com.royalpay.payment.manage.activities.app_index.core;
|
package au.com.royalpay.payment.manage.activities.app_index.core;
|
||||||
|
|
||||||
|
import au.com.royalpay.payment.manage.activities.app_index.beans.AppActBean;
|
||||||
|
import au.com.royalpay.payment.manage.activities.app_index.beans.AppActQueryBean;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.github.miemiedev.mybatis.paginator.domain.PageList;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public interface AppActService {
|
public interface AppActService {
|
||||||
|
|
||||||
List<JSONObject> listAppActs();
|
List<JSONObject> listAppActs();
|
||||||
|
|
||||||
|
JSONObject newAppAct(JSONObject manager, AppActBean appActBean);
|
||||||
|
|
||||||
|
PageList<JSONObject> listAppActs(JSONObject manager, AppActQueryBean appActQueryBean);
|
||||||
|
|
||||||
|
JSONObject getActDetail(JSONObject manager,String act_id);
|
||||||
|
|
||||||
|
void updateAct(JSONObject manager,String act_id,AppActBean appActBean);
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,42 @@
|
|||||||
package au.com.royalpay.payment.manage.activities.app_index.web;
|
package au.com.royalpay.payment.manage.activities.app_index.web;
|
||||||
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import au.com.royalpay.payment.manage.activities.app_index.beans.AppActBean;
|
||||||
|
import au.com.royalpay.payment.manage.activities.app_index.beans.AppActQueryBean;
|
||||||
|
import au.com.royalpay.payment.manage.activities.app_index.core.AppActService;
|
||||||
|
import au.com.royalpay.payment.manage.activities.monsettledelay.beans.MonDelayBean;
|
||||||
|
import au.com.royalpay.payment.manage.permission.manager.ManagerMapping;
|
||||||
|
import au.com.royalpay.payment.tools.CommonConsts;
|
||||||
|
import au.com.royalpay.payment.tools.permission.enums.ManagerRole;
|
||||||
|
import au.com.royalpay.payment.tools.utils.PageListUtils;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.github.miemiedev.mybatis.paginator.domain.PageList;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
|
@RequestMapping("/manager/app/act")
|
||||||
public class AppActController {
|
public class AppActController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private AppActService appActService;
|
||||||
|
|
||||||
|
@ManagerMapping(value = "/list",method = RequestMethod.GET,role = ManagerRole.SITE_MANAGER)
|
||||||
|
public JSONObject getAppActList(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, AppActQueryBean appActQueryBean){
|
||||||
|
PageList<JSONObject> appActList = appActService.listAppActs(manager,appActQueryBean);
|
||||||
|
return PageListUtils.buildPageListResult(appActList);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ManagerMapping(value = "/{act_id}/act_detail",method = RequestMethod.GET,role = ManagerRole.SITE_MANAGER)
|
||||||
|
public JSONObject getAppActDetail(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String act_id){
|
||||||
|
return appActService.getActDetail(manager,act_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ManagerMapping(value = "/new",method = RequestMethod.PUT,role = ManagerRole.SITE_MANAGER)
|
||||||
|
public JSONObject newAppAct(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @RequestBody AppActBean appActBean){
|
||||||
|
return appActService.newAppAct(manager,appActBean);
|
||||||
|
}
|
||||||
|
@ManagerMapping(value = "/{act_id}",method = RequestMethod.PUT,role = ManagerRole.SITE_MANAGER)
|
||||||
|
public void updateAppAct(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String act_id,@RequestBody AppActBean appActBean){
|
||||||
|
appActService.updateAct(manager,act_id,appActBean);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,85 @@
|
|||||||
|
package au.com.royalpay.payment.manage.activities.monsettledelay.beans;
|
||||||
|
|
||||||
|
import au.com.royalpay.payment.core.exceptions.ParamInvalidException;
|
||||||
|
import au.com.royalpay.payment.tools.exceptions.BadRequestException;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.apache.commons.lang3.time.DateUtils;
|
||||||
|
|
||||||
|
import java.text.ParseException;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by yuan on 2018/3/13.
|
||||||
|
*/
|
||||||
|
public class MonDelayBean {
|
||||||
|
private static final String[] DATE_PATTERNS = {"yyyyMMdd", "yyyy-MM-dd"};
|
||||||
|
private String client_moniker;
|
||||||
|
private String begin;
|
||||||
|
private String end;
|
||||||
|
private int page = 1;
|
||||||
|
private int limit = 10;
|
||||||
|
|
||||||
|
public JSONObject toJsonParam() {
|
||||||
|
JSONObject param = new JSONObject();
|
||||||
|
if (StringUtils.isNotBlank(client_moniker)) {
|
||||||
|
param.put("client_moniker", client_moniker);
|
||||||
|
}
|
||||||
|
if (begin != null) {
|
||||||
|
try {
|
||||||
|
Date fromDate = DateUtils.parseDate(begin, DATE_PATTERNS);
|
||||||
|
param.put("begin", fromDate);
|
||||||
|
} catch (ParseException e) {
|
||||||
|
throw new ParamInvalidException("begin", "error.payment.valid.invalid_date_format");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (end != null) {
|
||||||
|
try {
|
||||||
|
Date fromDate = DateUtils.addDays(DateUtils.parseDate(end, DATE_PATTERNS), 1);
|
||||||
|
param.put("end", fromDate);
|
||||||
|
} catch (ParseException e) {
|
||||||
|
throw new ParamInvalidException("end", "error.payment.valid.invalid_date_format");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return param;
|
||||||
|
}
|
||||||
|
public String getClient_moniker() {
|
||||||
|
return client_moniker;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setClient_moniker(String client_moniker) {
|
||||||
|
this.client_moniker = client_moniker;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBegin() {
|
||||||
|
return begin;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBegin(String begin) {
|
||||||
|
this.begin = begin;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEnd() {
|
||||||
|
return end;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEnd(String end) {
|
||||||
|
this.end = end;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getPage() {
|
||||||
|
return page;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPage(int page) {
|
||||||
|
this.page = page;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getLimit() {
|
||||||
|
return limit;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLimit(int limit) {
|
||||||
|
this.limit = limit;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,24 @@
|
|||||||
|
package au.com.royalpay.payment.manage.activities.monsettledelay.core;
|
||||||
|
|
||||||
|
import au.com.royalpay.payment.manage.activities.monsettledelay.beans.MonDelayBean;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.github.miemiedev.mybatis.paginator.domain.PageList;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by yuan on 2018/3/13.
|
||||||
|
*/
|
||||||
|
public interface ActMonDelaySettleManagerService {
|
||||||
|
JSONObject listAttendingClients(JSONObject manager, MonDelayBean monDelayBean);
|
||||||
|
|
||||||
|
//void disableClient(String clientMoniker);
|
||||||
|
|
||||||
|
PageList<JSONObject> getMonDelayClientRank(JSONObject manager,MonDelayBean monDelayBean);
|
||||||
|
|
||||||
|
List<JSONObject> getWeekendAnalysis(JSONObject manager,MonDelayBean monDelayBea);
|
||||||
|
|
||||||
|
JSONObject analysisCashback(JSONObject manager,MonDelayBean monDelayBean);
|
||||||
|
|
||||||
|
PageList<JSONObject> clientRedPackList(JSONObject manager,MonDelayBean monDelayBean,String clientMoniker);
|
||||||
|
}
|
@ -0,0 +1,79 @@
|
|||||||
|
package au.com.royalpay.payment.manage.activities.monsettledelay.core.impls;
|
||||||
|
|
||||||
|
import au.com.royalpay.payment.manage.activities.monsettledelay.beans.MonDelayBean;
|
||||||
|
import au.com.royalpay.payment.manage.activities.monsettledelay.core.ActMonDelaySettleManagerService;
|
||||||
|
import au.com.royalpay.payment.manage.mappers.act.ActMonDelaySettleMapper;
|
||||||
|
import au.com.royalpay.payment.manage.mappers.act.ActMonDelaySettleRedPackMapper;
|
||||||
|
import au.com.royalpay.payment.manage.mappers.system.ClientMapper;
|
||||||
|
import au.com.royalpay.payment.tools.exceptions.BadRequestException;
|
||||||
|
import au.com.royalpay.payment.tools.utils.PageListUtils;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.github.miemiedev.mybatis.paginator.domain.Order;
|
||||||
|
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
|
||||||
|
import com.github.miemiedev.mybatis.paginator.domain.PageList;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by yuan on 2018/3/13.
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class ActMonDelaySettleManagerServiceImpl implements ActMonDelaySettleManagerService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ActMonDelaySettleMapper actMonDelaySettleMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ClientMapper clientMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ActMonDelaySettleRedPackMapper actMonDelaySettleRedPackMapper;
|
||||||
|
@Override
|
||||||
|
public JSONObject listAttendingClients(JSONObject manager,MonDelayBean monDelayBean) {
|
||||||
|
JSONObject params = monDelayBean.toJsonParam();
|
||||||
|
PageList<JSONObject> clients = actMonDelaySettleMapper.listAttendClients(params, new PageBounds(monDelayBean.getPage(), monDelayBean.getLimit(), Order.formString("create_time.desc")));
|
||||||
|
return PageListUtils.buildPageListResult(clients);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* @Override
|
||||||
|
public void disableClient(String clientMoniker) {
|
||||||
|
JSONObject client = clientMapper.findClientByMoniker(clientMoniker);
|
||||||
|
List<JSONObject> clientLogs = actMonDelaySettleMapper.clientLog(client.getInteger("client_id"));
|
||||||
|
if (clientLogs.isEmpty() || clientLogs.size()==0){
|
||||||
|
throw new BadRequestException("您未参加活动,不可取消");
|
||||||
|
}
|
||||||
|
JSONObject clientLog = clientLogs.get(0);
|
||||||
|
clientLog.put("is_valid",0);
|
||||||
|
clientLog.put("expire_time",new Date());
|
||||||
|
actMonDelaySettleMapper.update(clientLog);
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public PageList<JSONObject> getMonDelayClientRank(JSONObject manager,MonDelayBean monDelayBean) {
|
||||||
|
JSONObject params = monDelayBean.toJsonParam();
|
||||||
|
return actMonDelaySettleRedPackMapper.getMonDelayRank(params,new PageBounds(monDelayBean.getPage(),monDelayBean.getLimit()));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<JSONObject> getWeekendAnalysis(JSONObject manager,MonDelayBean monDelayBean) {
|
||||||
|
JSONObject params = monDelayBean.toJsonParam();
|
||||||
|
return actMonDelaySettleRedPackMapper.getMondayAmount(params);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public JSONObject analysisCashback(JSONObject manager,MonDelayBean monDelayBean) {
|
||||||
|
JSONObject params = monDelayBean.toJsonParam();
|
||||||
|
return actMonDelaySettleRedPackMapper.analysisCashback(params);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageList<JSONObject> clientRedPackList(JSONObject manager, MonDelayBean monDelayBean,String clientMoniker) {
|
||||||
|
JSONObject client = clientMapper.findClientByMoniker(clientMoniker);
|
||||||
|
PageList<JSONObject> list = actMonDelaySettleRedPackMapper.listRedpacks(client.getInteger("client_id"),new PageBounds(Order.formString("create_time.desc")));
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,65 @@
|
|||||||
|
package au.com.royalpay.payment.manage.activities.monsettledelay.web;
|
||||||
|
|
||||||
|
import au.com.royalpay.payment.manage.activities.monsettledelay.beans.MonDelayBean;
|
||||||
|
import au.com.royalpay.payment.manage.activities.monsettledelay.core.ActMonDelaySettleManagerService;
|
||||||
|
import au.com.royalpay.payment.manage.permission.manager.ManagerMapping;
|
||||||
|
import au.com.royalpay.payment.tools.CommonConsts;
|
||||||
|
import au.com.royalpay.payment.tools.permission.enums.ManagerRole;
|
||||||
|
import au.com.royalpay.payment.tools.utils.PageListUtils;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.github.miemiedev.mybatis.paginator.domain.PageList;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by yuan on 2018/3/13.
|
||||||
|
*/
|
||||||
|
@RequestMapping(value = "/manage/mon_delay")
|
||||||
|
@RestController
|
||||||
|
public class ActMonDelayManagerController {
|
||||||
|
@Resource
|
||||||
|
private ActMonDelaySettleManagerService monDelayManagerService;
|
||||||
|
|
||||||
|
@ManagerMapping(value = "/clients", method = RequestMethod.GET, role = { ManagerRole.ADMIN })
|
||||||
|
public JSONObject listAttendingClients(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, MonDelayBean monDelayBean) {
|
||||||
|
return monDelayManagerService.listAttendingClients(manager,monDelayBean);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*@ManagerMapping(value = "/clients/{clientMoniker}", method = RequestMethod.DELETE, role = { ManagerRole.ADMIN })
|
||||||
|
public void disableClient(@PathVariable String clientMoniker) {
|
||||||
|
monDelayManagerService.disableClient(clientMoniker);
|
||||||
|
}*/
|
||||||
|
|
||||||
|
@ManagerMapping(value = "/{clientMoniker}/clients", method = RequestMethod.GET, role = { ManagerRole.ADMIN })
|
||||||
|
public JSONObject clientRedPackList(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager,MonDelayBean monDelayBean,@PathVariable String clientMoniker) {
|
||||||
|
PageList<JSONObject> redPackList = monDelayManagerService.clientRedPackList(manager,monDelayBean,clientMoniker);
|
||||||
|
if(redPackList==null){
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return PageListUtils.buildPageListResult(redPackList);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ManagerMapping(value = "/traAnalysis", method = RequestMethod.GET, role = { ManagerRole.ADMIN })
|
||||||
|
public List<JSONObject> traAnalysis(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, MonDelayBean monDelayBean) {
|
||||||
|
return monDelayManagerService.getWeekendAnalysis(manager,monDelayBean);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ManagerMapping(value = "/ranking", method = RequestMethod.GET, role = { ManagerRole.ADMIN })
|
||||||
|
public JSONObject getRanking(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, MonDelayBean monDelayBean) {
|
||||||
|
PageList<JSONObject> clientRank = monDelayManagerService.getMonDelayClientRank(manager,monDelayBean);
|
||||||
|
if(clientRank==null){
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return PageListUtils.buildPageListResult(clientRank);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ManagerMapping(value = "/total", method = RequestMethod.GET, role = { ManagerRole.ADMIN })
|
||||||
|
public JSONObject getTotal(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, MonDelayBean monDelayBean) {
|
||||||
|
return monDelayManagerService.analysisCashback(manager,monDelayBean);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,19 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||||
|
<mapper namespace="au.com.royalpay.payment.manage.mappers.act.ActMonDelaySettleMapper">
|
||||||
|
<select id="listAttendClients" resultType="com.alibaba.fastjson.JSONObject">
|
||||||
|
select act.account_name,act.create_time,act.client_id,c.client_moniker
|
||||||
|
FROM act_mon_delay_settle act
|
||||||
|
LEFT JOIN sys_clients c ON act.client_id = c.client_id
|
||||||
|
<where>
|
||||||
|
act.is_valid = 1 and c.is_valid = 1
|
||||||
|
<if test="client_moniker!=null">and c.client_moniker = #{client_moniker}</if>
|
||||||
|
<if test="begin != null">
|
||||||
|
and act.create_time >= #{begin}
|
||||||
|
</if>
|
||||||
|
<if test="end != null">
|
||||||
|
and act.create_time <= #{end}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
</mapper>
|
@ -0,0 +1,80 @@
|
|||||||
|
define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootSwitch', 'ngFileUpload', 'uiSelect'], function (angular) {
|
||||||
|
'use strict';
|
||||||
|
var app = angular.module('appAct', ['ui.bootstrap', 'ui.router', 'frapontillo.bootstrap-switch', 'ngFileUpload', 'ui.select']);
|
||||||
|
app.config(['$stateProvider', function ($stateProvider) {
|
||||||
|
$stateProvider.state('appAct', {
|
||||||
|
url: '/appAct/list',
|
||||||
|
templateUrl: '/static/actapp/templates/act_app_list.html',
|
||||||
|
controller: 'appActListCtrl'
|
||||||
|
}).state('appAct.new', {
|
||||||
|
url: '/appAct/new',
|
||||||
|
templateUrl: '/static/actapp/templates/act_app_detail.html',
|
||||||
|
controller: 'appActNewCtrl'
|
||||||
|
}).state('appAct.detail', {
|
||||||
|
url: '/{act_id}/detail',
|
||||||
|
templateUrl: '/static/actapp/templates/act_app_detail.html',
|
||||||
|
controller: 'appActDetailCtrl',
|
||||||
|
resolve: {
|
||||||
|
actDetail: ['$http', '$stateParams', function ($http, $stateParams) {
|
||||||
|
return $http.get('/manager/app/act/'+ $stateParams.act_id+'/act_detail');
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}]);
|
||||||
|
app.controller('appActListCtrl', ['$scope', '$state', '$http','commonDialog', function ($scope, $state, $http,commonDialog) {
|
||||||
|
$scope.pagination = {};
|
||||||
|
$scope.params = {};
|
||||||
|
$scope.loadActAppList = function (page) {
|
||||||
|
var params = angular.copy($scope.params);
|
||||||
|
params.page = page || $scope.pagination.page || 1;
|
||||||
|
$http.get('/manager/app/act/list', {params: params}).then(function (resp) {
|
||||||
|
$scope.app_acts = resp.data.data;
|
||||||
|
$scope.pagination = resp.data.pagination;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
$scope.publishedOrIsValid = function (act) {
|
||||||
|
$scope.act = angular.copy(act);
|
||||||
|
$scope.act.is_valid = !act.is_valid;
|
||||||
|
$http.put('/manager/app/act/' + $scope.act.act_id, $scope.act).then(function (resp) {
|
||||||
|
commonDialog.alert({title: 'Success', content: '修改成功', type: 'success'});
|
||||||
|
$scope.loadActAppList(1);
|
||||||
|
}, function (resp) {
|
||||||
|
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'});
|
||||||
|
})
|
||||||
|
};
|
||||||
|
$scope.loadActAppList(1);
|
||||||
|
|
||||||
|
}]);
|
||||||
|
app.controller('appActNewCtrl', ['$rootScope', '$scope', '$http', 'commonDialog','$state', function ($rootScope, $scope, $http, commonDialog,$state) {
|
||||||
|
$scope.actDetail = {};
|
||||||
|
$scope.submit = function (form) {
|
||||||
|
$scope.errmsg = null;
|
||||||
|
if (form.$invalid) {
|
||||||
|
angular.forEach(form, function (item, key) {
|
||||||
|
if (key.indexOf('$') < 0) {
|
||||||
|
item.$dirty = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$http.put('/manager/app/act/new', $scope.actDetail).then(function (resp) {
|
||||||
|
commonDialog.alert({title: 'Success', content: '新增成功', type: 'success'});
|
||||||
|
$state.go('^.detail',{act_id:resp.data.act_id},{reload:true});
|
||||||
|
}, function (resp) {
|
||||||
|
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'});
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}]);
|
||||||
|
app.controller('appActDetailCtrl', ['$rootScope', '$scope', '$http', 'commonDialog', 'actDetail','$state', function ($rootScope, $scope, $http, commonDialog,actDetail,$state) {
|
||||||
|
$scope.actDetail = actDetail.data;
|
||||||
|
$scope.submit = function () {
|
||||||
|
$http.put('/manager/app/act/' + $scope.actDetail.act_id, $scope.actDetail).then(function (resp) {
|
||||||
|
commonDialog.alert({title: 'Success', content: '修改成功', type: 'success'});
|
||||||
|
$state.reload();
|
||||||
|
}, function (resp) {
|
||||||
|
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'});
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}]);
|
||||||
|
return app;
|
||||||
|
});
|
@ -0,0 +1,127 @@
|
|||||||
|
<div ui-view>
|
||||||
|
<section class="content-header">
|
||||||
|
<h1>APP_ACTIVITY</h1>
|
||||||
|
<ol class="breadcrumb">
|
||||||
|
<li>
|
||||||
|
<i class="fa fa-sitemap"></i> 网站管理
|
||||||
|
</li>
|
||||||
|
<li class="active">Category - APP_ACTIVITY</li>
|
||||||
|
</ol>
|
||||||
|
</section>
|
||||||
|
<div class="content">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-12">
|
||||||
|
<div class="box-solid">
|
||||||
|
<div class="box box-warning">
|
||||||
|
<div class="box-header">
|
||||||
|
Edit Article
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-xs-12">
|
||||||
|
<form novalidate class="form-horizontal" name="appActForm">
|
||||||
|
<div class="form-group"
|
||||||
|
ng-class="{'has-error':appActForm.act_name.$invalid && appActForm.act_name.$dirty}">
|
||||||
|
<label class="control-label col-xs-4 col-sm-2"
|
||||||
|
for="actDetail.act_name">Title *</label>
|
||||||
|
<div class="col-xs-8 col-sm-4">
|
||||||
|
<input type="text" class="form-control" id="actDetail.act_name" name="act_name"
|
||||||
|
ng-model="actDetail.act_name" required>
|
||||||
|
<div ng-messages="appActForm.act_name.$error" ng-if="appActForm.act_name.$dirty">
|
||||||
|
<p class="small text-danger" ng-message="required">Title is required</p>
|
||||||
|
</div>
|
||||||
|
<div class="alert alert-danger" ng-if="errmsg" ng-bind="errmsg"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group"
|
||||||
|
ng-class="{'has-error':appActForm.desc.$invalid && appActForm.desc.$dirty}">
|
||||||
|
<label class="control-label col-xs-4 col-sm-2" for="actDetail.desc">ACT Desc *</label>
|
||||||
|
<div class="col-xs-8 col-sm-4">
|
||||||
|
<textarea class="form-control" id="actDetail.desc" name="desc"
|
||||||
|
ng-model="actDetail.desc" required></textarea>
|
||||||
|
<div ng-messages="appActForm.desc.$error" ng-if="appActForm.desc.$dirty">
|
||||||
|
<p class="small text-danger" ng-message="required">Desc is required</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-4 col-sm-2" for="actDetail.parms_json">Parms
|
||||||
|
Json</label>
|
||||||
|
<div class="col-xs-8 col-sm-4">
|
||||||
|
<textarea class="form-control" id="actDetail.parms_json"
|
||||||
|
ng-model="actDetail.parms_json"></textarea>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-4 col-sm-2">Show Window</label>
|
||||||
|
<div class="col-xs-8 col-sm-4">
|
||||||
|
<input type="checkbox" class="checkbox-inline checkbox" ng-model="actDetail.is_show_window">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group" ng-if="actDetail.is_show_window">
|
||||||
|
<label class="control-label col-xs-4 col-sm-2" for="actDetail.window_img">Window
|
||||||
|
Img</label>
|
||||||
|
<div class="col-xs-8 col-sm-4">
|
||||||
|
<input type="text" class="form-control" id="actDetail.window_img"
|
||||||
|
ng-model="actDetail.window_img">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-4 col-sm-2" for="actDetail.act_img">Act
|
||||||
|
Img</label>
|
||||||
|
<div class="col-xs-8 col-sm-4">
|
||||||
|
<input type="text" class="form-control" id="actDetail.act_img"
|
||||||
|
ng-model="actDetail.act_img">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-4 col-sm-2">Show
|
||||||
|
Type</label>
|
||||||
|
<div class="col-xs-8 col-sm-4">
|
||||||
|
<label class="radio-inline">
|
||||||
|
<input type="radio" name="optionsRadiosinline" id="optionsRadios3" value="0" checked
|
||||||
|
ng-model="actDetail.show_type"> Url
|
||||||
|
</label>
|
||||||
|
<label class="radio-inline">
|
||||||
|
<input type="radio" name="optionsRadiosinline" id="optionsRadios4" value="1"
|
||||||
|
ng-model="actDetail.show_type"> Content
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group" ng-if="actDetail.show_type == 0">
|
||||||
|
<label class="control-label col-xs-4 col-sm-2" for="actDetail.act_url">Act
|
||||||
|
Url</label>
|
||||||
|
<div class="col-xs-8 col-sm-4">
|
||||||
|
<input type="text" class="form-control" id="actDetail.act_url"
|
||||||
|
ng-model="actDetail.act_url">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group" ng-if="actDetail.show_type == 1">
|
||||||
|
<label class="control-label col-xs-4 col-sm-2" for="actDetail.act_content">Act
|
||||||
|
Content</label>
|
||||||
|
<div class="col-xs-8 col-sm-4">
|
||||||
|
<input type="text" class="form-control" id="actDetail.act_content"
|
||||||
|
ng-model="actDetail.act_content">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-xs-12">
|
||||||
|
<div class="btn-group">
|
||||||
|
<button class="btn btn-success" type="button" ng-click="submit(appActForm)">
|
||||||
|
Submit
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div class="btn-group">
|
||||||
|
<button class="btn btn-danger" type="button" ui-sref="appAct">
|
||||||
|
Cancel
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
@ -0,0 +1,89 @@
|
|||||||
|
<div ui-view>
|
||||||
|
<section class="content-header">
|
||||||
|
<h1>APP_ACTIVITY</h1>
|
||||||
|
<ol class="breadcrumb">
|
||||||
|
<li>
|
||||||
|
<i class="fa fa-sitemap"></i> 网站管理
|
||||||
|
</li>
|
||||||
|
<li class="active">Category - APP_ACTIVITY</li>
|
||||||
|
</ol>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<div class="content">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-12">
|
||||||
|
<div class="box-solid">
|
||||||
|
<div class="box box-warning">
|
||||||
|
<div class="box-header">
|
||||||
|
<div class="form-inline">
|
||||||
|
<div class="form-group">
|
||||||
|
<button class="btn btn-success" type="button" ui-sref=".new"><i class="fa fa-plus"></i> New ACT</button>
|
||||||
|
<div class="checkbox">
|
||||||
|
<label>
|
||||||
|
<input type="checkbox" ng-click="loadActAppList(1)" ng-model="params.is_valid">Published
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="box">
|
||||||
|
<div class="box-header">
|
||||||
|
<h3 class="box-title">ACT List</h3>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="box-body no-padding table-responsive">
|
||||||
|
<table class="table table-striped">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
|
||||||
|
<th>Title</th>
|
||||||
|
<th>Add Time</th>
|
||||||
|
<th>Published</th>
|
||||||
|
<th>Operation</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr ng-repeat="act in app_acts">
|
||||||
|
<td ng-bind="act.act_name"></td>
|
||||||
|
<td ng-bind="act.create_time"></td>
|
||||||
|
<td>
|
||||||
|
<span ng-click="publishedOrIsValid(act)">
|
||||||
|
<i class="text-success fa fa-check" ng-if="act.is_valid"></i>
|
||||||
|
<i class="text-danger fa fa-close" ng-if="!act.is_valid"></i>
|
||||||
|
</span>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a class="text-primary" role="button" title="Detail"
|
||||||
|
ui-sref=".detail({act_id:act.act_id})">
|
||||||
|
<i class="fa fa-edit"></i> Edit
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="box-footer" ng-if="app_acts.length">
|
||||||
|
<uib-pagination class="pagination"
|
||||||
|
total-items="pagination.totalCount"
|
||||||
|
boundary-links="true"
|
||||||
|
ng-model="pagination.page"
|
||||||
|
items-per-page="pagination.limit"
|
||||||
|
max-size="10"
|
||||||
|
ng-change="loadActAppList()"
|
||||||
|
previous-text="‹"
|
||||||
|
next-text="›"
|
||||||
|
first-text="«"
|
||||||
|
last-text="»"></uib-pagination>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-xs-12">Total Records:{{pagination.totalCount}};Total Pages:{{pagination.totalPages}}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
@ -0,0 +1,224 @@
|
|||||||
|
define(['angular', 'uiBootstrap', 'uiRouter', 'angularEcharts'], function (angular) {
|
||||||
|
'use strict';
|
||||||
|
var colors = ['#00c0ef', '#00a65a', '#ff851b'];
|
||||||
|
var app = angular.module('monDelay', ['ui.bootstrap', 'ui.router', 'ngEcharts']);
|
||||||
|
|
||||||
|
app.config(['$stateProvider', function ($stateProvider) {
|
||||||
|
$stateProvider.state('mon_delay', {
|
||||||
|
url: '/mon_delay',
|
||||||
|
templateUrl: '/static/analysis/mondelay/templates/mon_delay_merchants.html',
|
||||||
|
controller: 'monDelayDialogCtrl'
|
||||||
|
}).state('mon_delay.analysis',{
|
||||||
|
url:'/mon_delay/analysis',
|
||||||
|
templateUrl: '/static/analysis/mondelay/templates/mon_delay_analysis.html',
|
||||||
|
controller: 'monDelayAnalysisDialogCtrl'
|
||||||
|
})
|
||||||
|
}]);
|
||||||
|
app.controller('monDelayDialogCtrl', ['$scope', '$http', '$filter','$uibModal', function ($scope, $http, $filter,$uibModal) {
|
||||||
|
$scope.pagination = {};
|
||||||
|
$scope.params = {};
|
||||||
|
$scope.loadClients = function (page) {
|
||||||
|
var params = angular.copy($scope.params);
|
||||||
|
if(params.begin){
|
||||||
|
params.begin = $filter('date')($scope.params.begin, 'yyyy-MM-dd')
|
||||||
|
}
|
||||||
|
if(params.end){
|
||||||
|
params.end = $filter('date')($scope.params.end, 'yyyy-MM-dd')
|
||||||
|
}
|
||||||
|
params.page = page || $scope.pagination.page || 1;
|
||||||
|
$http.get('/manage/mon_delay/clients', {params: params}).then(function (resp) {
|
||||||
|
$scope.clients = resp.data.data;
|
||||||
|
$scope.pagination = resp.data.pagination;
|
||||||
|
})
|
||||||
|
};
|
||||||
|
$scope.loadClients();
|
||||||
|
$scope.ctrl = {dateInput: false};
|
||||||
|
|
||||||
|
$scope.clientRedPackList = function (client) {
|
||||||
|
$uibModal.open({
|
||||||
|
templateUrl: '/static/analysis/mondelay/templates/mon_delay_merchants_detail.html',
|
||||||
|
controller: 'monDelayMerchantsDetailDialogCtrl',
|
||||||
|
size: 'lg',
|
||||||
|
resolve: {
|
||||||
|
clientMoniker: function () {
|
||||||
|
return client.client_moniker;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).result.then(function () {
|
||||||
|
});
|
||||||
|
};
|
||||||
|
/* $scope.disableClient = function (client) {
|
||||||
|
$http.delete('/manage/mon_delay/clients/' + client.client_moniker).then(function () {
|
||||||
|
$scope.loadClients();
|
||||||
|
});
|
||||||
|
};*/
|
||||||
|
}]);
|
||||||
|
|
||||||
|
app.controller('monDelayMerchantsDetailDialogCtrl', ['$scope', '$http', '$filter', 'clientMoniker',function ($scope, $http, $filter,clientMoniker) {
|
||||||
|
$scope.pagination = {};
|
||||||
|
$scope.params = {};
|
||||||
|
$scope.loadRepackList = function (page) {
|
||||||
|
var params = angular.copy($scope.params);
|
||||||
|
params.page = page || $scope.pagination.page || 1;
|
||||||
|
$http.get('/manage/mon_delay/'+ clientMoniker + '/clients', {params: params}).then(function (resp) {
|
||||||
|
$scope.redPackList = resp.data.data;
|
||||||
|
$scope.pagination = resp.data.pagination;
|
||||||
|
})
|
||||||
|
};
|
||||||
|
$scope.loadRepackList();
|
||||||
|
}]);
|
||||||
|
|
||||||
|
app.controller('monDelayAnalysisDialogCtrl', ['$scope', '$http', '$filter','$state', function ($scope, $http, $filter,$state) {
|
||||||
|
$scope.params = {};
|
||||||
|
$scope.today = new Date();
|
||||||
|
$scope.params.end = new Date();
|
||||||
|
var date = new Date();
|
||||||
|
date.setDate(date.getDate()-30);
|
||||||
|
$scope.params.begin = date;
|
||||||
|
$scope.thisMonth = function () {
|
||||||
|
$scope.params.end = new Date();
|
||||||
|
var monthBegin = new Date();
|
||||||
|
monthBegin.setDate(1);
|
||||||
|
$scope.params.begin = monthBegin;
|
||||||
|
$scope.doAnalysis(1);
|
||||||
|
};
|
||||||
|
$scope.lastMonth = function () {
|
||||||
|
var monthFinish = new Date();
|
||||||
|
monthFinish.setDate(0);
|
||||||
|
$scope.params.end = monthFinish;
|
||||||
|
var monthBegin = new Date();
|
||||||
|
monthBegin.setDate(0);
|
||||||
|
monthBegin.setDate(1);
|
||||||
|
$scope.params.begin = monthBegin;
|
||||||
|
$scope.doAnalysis(1);
|
||||||
|
};
|
||||||
|
|
||||||
|
$scope.doPartnerTotalRanking = function (page) {
|
||||||
|
var params = {};
|
||||||
|
params.page = page||$scope.total_ranking_pagination.page || 1;
|
||||||
|
params.limit = 20;
|
||||||
|
$http.get('/manage/mon_delay/ranking', {params: params}).then(function (resp) {
|
||||||
|
$scope.redPackPartnersRanking = resp.data.data;
|
||||||
|
$scope.total_ranking_pagination = resp.data.pagination;
|
||||||
|
})
|
||||||
|
};
|
||||||
|
|
||||||
|
$scope.getTotalCashBack = function(){
|
||||||
|
$http.get('/manage/mon_delay/total').then(function (resp) {
|
||||||
|
$scope.totalCashBack = resp.data.redpack_amount;
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$scope.getClientsCashbackRankingByDate = function (date,page) {
|
||||||
|
$scope.event_date = date;
|
||||||
|
var params = {};
|
||||||
|
params.begin = date;
|
||||||
|
var event_date_format=date.replace(/^(\d{4})(\d{2})(\d{2})$/, "$1-$2-$3");
|
||||||
|
var endDate = new Date(event_date_format);
|
||||||
|
endDate.setDate(endDate.getDate());
|
||||||
|
params.end =$filter('date')(endDate,'yyyyMMdd');
|
||||||
|
params.page = page||$scope.day_ranking_pagination.page || 1;
|
||||||
|
params.limit = 20;
|
||||||
|
$http.get('/manage/mon_delay/ranking', {params: params}).then(function (resp) {
|
||||||
|
$scope.cashbackPartnersRankingByDate = resp.data.data;
|
||||||
|
if(resp.data.data != null){
|
||||||
|
$scope.event_date = $filter('date')(new Date($scope.cashbackPartnersRankingByDate[0].send_time),'yyyy-MM-dd');
|
||||||
|
}
|
||||||
|
$scope.day_ranking_pagination = resp.data.pagination;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
$scope.doAnalysis = function () {
|
||||||
|
var params = angular.copy($scope.params);
|
||||||
|
if (params.begin) {
|
||||||
|
params.begin = $filter('date')(params.begin, 'yyyyMMdd');
|
||||||
|
} else {
|
||||||
|
params.begin = $filter('date')(new Date(), 'yyyyMMdd');
|
||||||
|
}
|
||||||
|
if (params.end) {
|
||||||
|
params.end = $filter('date')(params.end, 'yyyyMMdd');
|
||||||
|
} else {
|
||||||
|
params.end = $filter('date')(new Date(), 'yyyyMMdd');
|
||||||
|
}
|
||||||
|
$http.get('/manage/mon_delay/traAnalysis', {params: params}).then(function (resp) {
|
||||||
|
$scope.cashbackDaily = angular.copy(resp.data);
|
||||||
|
if($scope.cashbackDaily.length != 0){
|
||||||
|
var params ={};
|
||||||
|
params.dataIndex = 0;
|
||||||
|
$scope.monDelay(params);
|
||||||
|
}
|
||||||
|
var dates = [];
|
||||||
|
var mon_net_amount = [];
|
||||||
|
var cashback = [];
|
||||||
|
resp.data.forEach(function (e) {
|
||||||
|
dates.push(e.send_time);
|
||||||
|
cashback.push(e.redpack_amount);
|
||||||
|
mon_net_amount.push(e.settle_amount);
|
||||||
|
});
|
||||||
|
var cashbackHistoryConfig = function (dates,mon_net_amount, cashback) {
|
||||||
|
return {
|
||||||
|
color: colors,
|
||||||
|
tooltip: {
|
||||||
|
trigger: 'axis',
|
||||||
|
axisPointer: { // 坐标轴指示器,坐标轴触发有效
|
||||||
|
type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
legend: {
|
||||||
|
data: ['周一清算额','返现']
|
||||||
|
},
|
||||||
|
grid: {
|
||||||
|
left: '3%',
|
||||||
|
right: '4%',
|
||||||
|
bottom: '3%',
|
||||||
|
containLabel: true
|
||||||
|
},
|
||||||
|
xAxis: [
|
||||||
|
{
|
||||||
|
type: 'category',
|
||||||
|
data: dates
|
||||||
|
}
|
||||||
|
],
|
||||||
|
yAxis: [
|
||||||
|
{
|
||||||
|
type: 'value',
|
||||||
|
name: 'Amount(AUD)'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
series: [{
|
||||||
|
name: '周一清算额',
|
||||||
|
type: 'bar',
|
||||||
|
data: mon_net_amount
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '返现',
|
||||||
|
type: 'bar',
|
||||||
|
data: cashback
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
||||||
|
};
|
||||||
|
$scope.settleDelayHistory = cashbackHistoryConfig(dates,mon_net_amount, cashback);
|
||||||
|
});
|
||||||
|
$scope.doPartnerTotalRanking(1);
|
||||||
|
$scope.getTotalCashBack(1);
|
||||||
|
};
|
||||||
|
$scope.doAnalysis(1);
|
||||||
|
$scope.settleDelayEchart = function (chart) {
|
||||||
|
chart.on('click', function (params) {
|
||||||
|
$scope.monDelay(params);
|
||||||
|
})
|
||||||
|
};
|
||||||
|
$scope.monDelay = function (params) {
|
||||||
|
$scope.cashBack_total_daily = $scope.cashbackDaily[params.dataIndex].redpack_amount;
|
||||||
|
var event_date = $scope.cashbackDaily[params.dataIndex].send_time;
|
||||||
|
if (event_date) {
|
||||||
|
event_date+="";
|
||||||
|
var event_date_format=event_date.replace(/^(\d{4})(\d{2})(\d{2})$/, "$1-$2-$3");
|
||||||
|
var date = new Date(event_date_format);
|
||||||
|
$scope.getClientsCashbackRankingByDate($filter('date')(date,'yyyyMMdd'),1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}]);
|
||||||
|
return app;
|
||||||
|
});
|
@ -0,0 +1,130 @@
|
|||||||
|
<div class="box box-warning">
|
||||||
|
<div class="box-header">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-12">
|
||||||
|
<div class="form-horizontal">
|
||||||
|
<div class="form-group col-xs-12 col-sm-12">
|
||||||
|
<label class="control-label col-xs-4 col-sm-2">Date Range</label>
|
||||||
|
<div class="col-sm-10">
|
||||||
|
<div class="form-control-static form-inline">
|
||||||
|
<div style="display: inline-block">
|
||||||
|
<input class="form-control" id="date-from-input"
|
||||||
|
ng-model="params.begin"
|
||||||
|
uib-datepicker-popup size="10" placeholder="From"
|
||||||
|
is-open="dateBegin.open" ng-click="dateBegin.open=true"
|
||||||
|
datepicker-options="{maxDate:params.end||today}">
|
||||||
|
</div>
|
||||||
|
~
|
||||||
|
<div style="display: inline-block">
|
||||||
|
<input class="form-control" id="date-to-input" ng-model="params.end"
|
||||||
|
uib-datepicker-popup size="10" placeholder="To"
|
||||||
|
is-open="dateTo.open" ng-click="dateTo.open=true"
|
||||||
|
datepicker-options="{minDate:params.begin,maxDate:today}">
|
||||||
|
</div>
|
||||||
|
<div class="btn-group">
|
||||||
|
<a role="button" class="btn btn-default btn-sm"
|
||||||
|
ng-click="thisMonth()">This Month</a>
|
||||||
|
</div>
|
||||||
|
<div class="btn-group">
|
||||||
|
<a role="button" class="btn btn-default btn-sm" ng-click="lastMonth()">Last Month</a>
|
||||||
|
</div>
|
||||||
|
<button class="btn btn-success" type="button"
|
||||||
|
ng-click="doAnalysis()">
|
||||||
|
<i class="fa fa-search"></i>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="box">
|
||||||
|
<!--<div class="box-header with-border">Trading customer quantity trends</div>-->
|
||||||
|
<div class="box-body">
|
||||||
|
<div class="chart col-md-12" echarts="settleDelayHistory" style="height: 300px"
|
||||||
|
chart-setter="settleDelayEchart($chart)"
|
||||||
|
ng-class="{nodata:settleDelayHistory.nodata}"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="box">
|
||||||
|
<div class="box-header">
|
||||||
|
<h3 class="box-title">Settle Delay Ranking</h3>
|
||||||
|
</div>
|
||||||
|
<div class="box-body">
|
||||||
|
<div class="row cen col-sm-12">
|
||||||
|
<div class="col-md-6">
|
||||||
|
<p class="text-center">到目前为止红包总额排名<span ng-if="totalCashBack!=null">(总额:{{totalCashBack}})</span></p>
|
||||||
|
<div class="table-responsive">
|
||||||
|
<table class="table table-bordered table-hover table-striped">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Partner Name</th>
|
||||||
|
<th>Cashback Amount</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr ng-repeat="client in redPackPartnersRanking">
|
||||||
|
<!--<td style="text-align: center;font-style: italic;font-size: larger"-->
|
||||||
|
<!--ng-bind="$index+1+'.'"></td>-->
|
||||||
|
<td ng-bind="client.client_moniker"></td>
|
||||||
|
<td ng-bind="client.redpack_amount"></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<uib-pagination ng-if="cashbackPartnersRanking.length"
|
||||||
|
class="pagination"
|
||||||
|
total-items="total_ranking_pagination.totalCount"
|
||||||
|
boundary-links="true"
|
||||||
|
ng-model="total_ranking_pagination.page"
|
||||||
|
items-per-page="total_ranking_pagination.limit"
|
||||||
|
max-size="10"
|
||||||
|
ng-change="doPartnerTotalRanking()"
|
||||||
|
previous-text="‹"
|
||||||
|
next-text="›"
|
||||||
|
first-text="«"
|
||||||
|
last-text="»"></uib-pagination>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-xs-12">Total Records:{{total_ranking_pagination.totalCount}};Total Pages:{{total_ranking_pagination.totalPages}}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<p class="text-center"><span style="color: red">{{event_date}}</span> 商户延迟清算总排名 <span
|
||||||
|
style="font-size: smaller;color: grey">(选择上图相应的日期获取当日排名)</span><span ng-if="cashBack_total_daily!=null">当日总额:{{cashBack_total_daily}}</span></p>
|
||||||
|
<div class="table-responsive">
|
||||||
|
<table class="table table-bordered table-hover table-striped">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Partner Name</th>
|
||||||
|
<th>Cashback Amount</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr ng-repeat="client in cashbackPartnersRankingByDate">
|
||||||
|
<td ng-bind="client.client_moniker"></td>
|
||||||
|
<td ng-bind="client.redpack_amount"></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<uib-pagination ng-if="cashbackPartnersRankingByDate.length"
|
||||||
|
class="pagination"
|
||||||
|
total-items="day_ranking_pagination.totalCount"
|
||||||
|
boundary-links="true"
|
||||||
|
ng-model="day_ranking_pagination.page"
|
||||||
|
items-per-page="day_ranking_pagination.limit"
|
||||||
|
max-size="10"
|
||||||
|
ng-change="getClientsCashbackRankingByDate(event_date)"
|
||||||
|
previous-text="‹"
|
||||||
|
next-text="›"
|
||||||
|
first-text="«"
|
||||||
|
last-text="»"></uib-pagination>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-xs-12">Total Records:{{day_ranking_pagination.totalCount}};Total Pages:{{day_ranking_pagination.totalPages}}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
@ -0,0 +1,105 @@
|
|||||||
|
<section class="content-header">
|
||||||
|
<h4>周一返现</h4>
|
||||||
|
<ol class="breadcrumb">
|
||||||
|
<li>
|
||||||
|
<i class="fa fa-users"></i> Payment
|
||||||
|
</li>
|
||||||
|
<li class="active">
|
||||||
|
MonDelay
|
||||||
|
</li>
|
||||||
|
</ol>
|
||||||
|
</section>
|
||||||
|
<div class="content">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-12">
|
||||||
|
<div class="nav-tabs-custom">
|
||||||
|
<ul class="nav nav-tabs">
|
||||||
|
<li ui-sref-active-eq="active">
|
||||||
|
<a ui-sref="mon_delay">Merchants</a>
|
||||||
|
</li>
|
||||||
|
<li ui-sref-active="active">
|
||||||
|
<a ui-sref="mon_delay.analysis">Analysis</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<div class="tab-content" ui-view>
|
||||||
|
<div class="modal-body">
|
||||||
|
<div class="alert alert-danger" ng-if="errmsg" ng-bind="errmsg"></div>
|
||||||
|
<div class="form-inline">
|
||||||
|
<div class="form-group">
|
||||||
|
<input class="form-control" placeholder="Client Moniker" ng-model="params.client_moniker">
|
||||||
|
</div>
|
||||||
|
<div style="display: inline-block">
|
||||||
|
<input class="form-control" id="date-from-input"
|
||||||
|
ng-model="params.begin"
|
||||||
|
uib-datepicker-popup size="10" placeholder="From"
|
||||||
|
is-open="dateBegin.open" ng-click="dateBegin.open=true"
|
||||||
|
datepicker-options="{maxDate:params.end||today}">
|
||||||
|
</div>
|
||||||
|
~
|
||||||
|
<div style="display: inline-block">
|
||||||
|
<input class="form-control" id="date-to-input" ng-model="params.end"
|
||||||
|
uib-datepicker-popup size="10" placeholder="To"
|
||||||
|
is-open="dateTo.open" ng-click="dateTo.open=true"
|
||||||
|
datepicker-options="{minDate:params.begin,maxDate:today}">
|
||||||
|
</div>
|
||||||
|
<button class="btn btn-success" ng-click="loadClients()"><i
|
||||||
|
class="fa fa-search"></i> Search</button>
|
||||||
|
</div>
|
||||||
|
<div class="row" ng-if="clients.length">
|
||||||
|
<div class="col-xs-12 table-responsive">
|
||||||
|
<table class="table table-hover table-striped">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Client Moniker</th>
|
||||||
|
<th>Attend Date</th>
|
||||||
|
<th>Account Name</th>
|
||||||
|
<th>Operation</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr ng-repeat="client in clients">
|
||||||
|
<td ng-bind="client.client_moniker"></td>
|
||||||
|
<td ng-bind="client.create_time"></td>
|
||||||
|
<td ng-bind="client.account_name"></td>
|
||||||
|
<td>
|
||||||
|
<!--<a role="button" class="text-danger" ng-click="disableClient(client)"><i class="fa fa-ban"></i></a>-->
|
||||||
|
<a class="text-primary" role="button" title="Detail"
|
||||||
|
ng-click="clientRedPackList(client)">
|
||||||
|
<i class="fa fa-search"></i> Detail
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<uib-pagination ng-if="clients.length"
|
||||||
|
class="pagination"
|
||||||
|
total-items="pagination.totalCount"
|
||||||
|
boundary-links="true"
|
||||||
|
ng-model="pagination.page"
|
||||||
|
items-per-page="pagination.limit"
|
||||||
|
max-size="10"
|
||||||
|
ng-change="loadClients()"
|
||||||
|
previous-text="‹"
|
||||||
|
next-text="›"
|
||||||
|
first-text="«"
|
||||||
|
last-text="»"></uib-pagination>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-xs-12">Total Records:{{pagination.totalCount}};Total Pages:{{pagination.totalPages}}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,54 @@
|
|||||||
|
<div class="content">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-12">
|
||||||
|
<div class="modal-body">
|
||||||
|
<div class="alert alert-danger" ng-if="errmsg" ng-bind="errmsg"></div>
|
||||||
|
<div class="row" ng-if="redPackList.length">
|
||||||
|
<div class="col-xs-12 table-responsive">
|
||||||
|
<table class="table table-hover table-striped">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Send Time</th>
|
||||||
|
<th>Redpack Amount</th>
|
||||||
|
<th>Settle Amount</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr ng-repeat="redPack in redPackList">
|
||||||
|
<td ng-bind="redPack.send_time"></td>
|
||||||
|
<td ng-bind="redPack.redpack_amount"></td>
|
||||||
|
<td ng-bind="redPack.settle_amount"></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<uib-pagination ng-if="redPackList.length"
|
||||||
|
class="pagination"
|
||||||
|
total-items="pagination.totalCount"
|
||||||
|
boundary-links="true"
|
||||||
|
ng-model="pagination.page"
|
||||||
|
items-per-page="pagination.limit"
|
||||||
|
max-size="10"
|
||||||
|
ng-change="loadRepackList()"
|
||||||
|
previous-text="‹"
|
||||||
|
next-text="›"
|
||||||
|
first-text="«"
|
||||||
|
last-text="»"></uib-pagination>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-xs-12">Total Records:{{pagination.totalCount}};Total Pages:{{pagination.totalPages}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in new issue