first commit
This commit is contained in:
@@ -0,0 +1,119 @@
|
||||
package project.web.admin.controller.email;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import kernel.exception.BusinessException;
|
||||
import kernel.util.JsonUtils;
|
||||
import kernel.web.PageActionSupport;
|
||||
import project.syspara.Syspara;
|
||||
import project.syspara.SysparaService;
|
||||
import project.web.admin.service.email.AdminEmailCodeService;
|
||||
|
||||
@RestController
|
||||
public class AdminEmailCodeController extends PageActionSupport {
|
||||
|
||||
private Logger logger = LogManager.getLogger(AdminEmailCodeController.class);
|
||||
|
||||
@Autowired
|
||||
private AdminEmailCodeService adminEmailCodeService;
|
||||
@Autowired
|
||||
protected SysparaService sysparaService;
|
||||
|
||||
private final String action = "normal/adminEmailCodeAction!";
|
||||
|
||||
/**
|
||||
* 发送验证码
|
||||
*/
|
||||
public String sendCode(HttpServletRequest request) {
|
||||
String code_context = request.getParameter("code_context");
|
||||
boolean isSuper = Boolean.valueOf(request.getParameter("isSuper")).booleanValue();
|
||||
|
||||
Map<String, Object> resultMap = new HashMap<String, Object>();
|
||||
|
||||
try {
|
||||
|
||||
this.adminEmailCodeService.sendCode(this.getIp(), this.getUsername_login(), code_context, isSuper);
|
||||
resultMap.put("code", 200);
|
||||
|
||||
} catch (BusinessException e) {
|
||||
resultMap.put("code", 500);
|
||||
resultMap.put("message", e.getMessage());
|
||||
} catch (Throwable t) {
|
||||
logger.error(" error ", t);
|
||||
resultMap.put("code", 500);
|
||||
resultMap.put("message", "程序错误");
|
||||
}
|
||||
|
||||
return JsonUtils.getJsonString(resultMap);
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验验证码
|
||||
*/
|
||||
public String checkCode(HttpServletRequest request) {
|
||||
String email_code = request.getParameter("email_code");
|
||||
|
||||
Map<String, Object> resultMap = new HashMap<String, Object>();
|
||||
|
||||
try {
|
||||
|
||||
this.adminEmailCodeService.updateCheckCode(this.getIp(), this.getUsername_login(), email_code,
|
||||
this.getRequest().getRequestURI());
|
||||
this.getResponse().sendRedirect(this.getRequest().getContextPath() + "/index/view");
|
||||
|
||||
} catch (BusinessException e) {
|
||||
resultMap.put("code", 500);
|
||||
resultMap.put("message", e.getMessage());
|
||||
} catch (Throwable t) {
|
||||
logger.error(" error ", t);
|
||||
resultMap.put("code", 500);
|
||||
resultMap.put("message", "程序错误");
|
||||
}
|
||||
|
||||
return "check_success";
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验谷歌验证码
|
||||
*/
|
||||
@RequestMapping(action + "checkGoogleAuthCode.action")
|
||||
public ModelAndView checkGoogleAuthCode(HttpServletRequest request) {
|
||||
|
||||
String google_auth_code = request.getParameter("google_auth_code");
|
||||
|
||||
ModelAndView model = new ModelAndView();
|
||||
String username = this.getUsername_login();
|
||||
try {
|
||||
Syspara para = sysparaService.find("open_google_auth_code");
|
||||
if (null == para || para.getValue().equals("true")) {
|
||||
this.adminEmailCodeService.updateCheckGoogleAuthCode(this.getIp(), username, google_auth_code,
|
||||
this.getRequest().getRequestURI());
|
||||
}
|
||||
model.setViewName("redirect:/normal/LoginSuccessAction!view.action");
|
||||
return model;
|
||||
|
||||
} catch (BusinessException e) {
|
||||
model.addObject("error", e.getMessage());
|
||||
model.addObject("username", username);
|
||||
model.setViewName("include/google_auth_code");
|
||||
return model;
|
||||
} catch (Throwable t) {
|
||||
logger.error(" error ", t);
|
||||
model.addObject("username", username);
|
||||
model.addObject("error", "验证码错误");
|
||||
model.setViewName("include/google_auth_code");
|
||||
return model;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
273
admin/src/main/java/project/web/admin/controller/index/AdminIndexController.java
Executable file
273
admin/src/main/java/project/web/admin/controller/index/AdminIndexController.java
Executable file
@@ -0,0 +1,273 @@
|
||||
package project.web.admin.controller.index;
|
||||
|
||||
import kernel.exception.BusinessException;
|
||||
import kernel.util.Arith;
|
||||
import kernel.util.StringUtils;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import project.mall.goods.SellerGoodsService;
|
||||
import project.mall.goods.dto.SellerTopNDto;
|
||||
import project.mall.utils.DateStringTypeEnum;
|
||||
import project.mall.utils.DateTypeToTime;
|
||||
import project.party.PartyService;
|
||||
import project.user.UserDataService;
|
||||
import project.wallet.WalletLogService;
|
||||
import project.wallet.dto.PartySumDataDTO;
|
||||
import security.web.BaseSecurityAction;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 综合查询
|
||||
*/
|
||||
@RestController
|
||||
public class AdminIndexController extends BaseSecurityAction {
|
||||
|
||||
|
||||
private Logger logger = LogManager.getLogger(AdminIndexController.class);
|
||||
|
||||
@Autowired
|
||||
private PartyService partyService;
|
||||
|
||||
@Autowired
|
||||
private UserDataService userDataService;
|
||||
|
||||
@Resource
|
||||
protected WalletLogService walletLogService;
|
||||
|
||||
@Resource
|
||||
private SellerGoodsService sellerGoodsService;
|
||||
|
||||
private final String action = "normal/adminIndexAction!";
|
||||
//
|
||||
// /**
|
||||
// * 综合查询 页面
|
||||
// */
|
||||
// @RequestMapping(value = action + "view.action")
|
||||
// public ModelAndView view(HttpServletRequest request) {
|
||||
//
|
||||
// ModelAndView modelAndView = new ModelAndView();
|
||||
// modelAndView.setViewName("index_admin");
|
||||
// String timeType = request.getParameter("timeType");
|
||||
// if (StringUtils.isEmptyString(timeType)) {
|
||||
// timeType = "day";
|
||||
// }
|
||||
// Map<String, Object> statistics = new HashMap<String, Object>();
|
||||
// Page page = new Page();
|
||||
// try {
|
||||
//
|
||||
// String today = DateUtils.format(new Date(), DateUtils.DF_yyyyMMdd);
|
||||
//
|
||||
// String loginPartyId = this.getLoginPartyId();
|
||||
//
|
||||
// // 当日用户增量
|
||||
// int todayUserCount = 0;
|
||||
//
|
||||
// // 用户总量
|
||||
// int allUserCount = 0;
|
||||
//
|
||||
// List<Party> cacheAll = this.partyService.getAll();
|
||||
// for (Party party : cacheAll) {
|
||||
// if (Constants.SECURITY_ROLE_MEMBER.equals(party.getRolename())) {
|
||||
// if (today.equals(DateUtils.format(party.getCreateTime(), DateUtils.DF_yyyyMMdd))) {
|
||||
// todayUserCount++;
|
||||
// }
|
||||
// allUserCount++;
|
||||
// }
|
||||
// }
|
||||
// Map<String, Object> daySumData = this.adminAllStatisticsService.daySumData(loginPartyId, today);
|
||||
//// page = adminOrderService.pagedQuery(
|
||||
//// 1, 10, null, null, null, null, null, null, null, -2);
|
||||
// Map daySumData1 = adminMallOrderService.findDaySumData();
|
||||
// Map kycSumData = adminKycService.findKycSumData();
|
||||
// statistics.putAll(daySumData1);
|
||||
// statistics.putAll(kycSumData);
|
||||
// statistics.put("recharge", daySumData.get("recharge_usdt"));
|
||||
// statistics.put("withdraw", daySumData.get("withdraw"));
|
||||
// statistics.put("page", page);
|
||||
// // 充提差额
|
||||
// statistics.put("balance_amount", daySumData.get("balance_amount"));
|
||||
// statistics.put("totle_income", daySumData.get("totle_income"));
|
||||
// statistics.put("today_user_count", todayUserCount);
|
||||
// statistics.put("all_user_count", allUserCount);
|
||||
// statistics.put("today_recharge_user_count", this.userDataService.filterRechargeByDate(today));
|
||||
// statistics.put("sum_usdt_amount", this.adminUserMoneyStatisticsService.getSumWalletByMember(loginPartyId));
|
||||
//
|
||||
// } catch (BusinessException e) {
|
||||
// modelAndView.addObject("error", e.getMessage());
|
||||
// modelAndView.addObject("statistics", statistics);
|
||||
// return modelAndView;
|
||||
// } catch (Throwable t) {
|
||||
// logger.error(" error ", t);
|
||||
// modelAndView.addObject("error", "[ERROR] " + t.getMessage());
|
||||
// modelAndView.addObject("statistics", statistics);
|
||||
// return modelAndView;
|
||||
// }
|
||||
//
|
||||
// modelAndView.addObject("statistics", statistics);
|
||||
// modelAndView.addObject("page", page);
|
||||
// modelAndView.addObject("timeType", timeType);
|
||||
// return modelAndView;
|
||||
// }
|
||||
|
||||
|
||||
@RequestMapping(value = action + "viewNew.action")
|
||||
public ModelAndView viewNew(HttpServletRequest request) {
|
||||
|
||||
ModelAndView modelAndView = new ModelAndView();
|
||||
modelAndView.setViewName("index_admin");
|
||||
|
||||
String timeType = request.getParameter("timeType");
|
||||
if (StringUtils.isEmptyString(timeType)) {
|
||||
timeType = "day";
|
||||
}
|
||||
modelAndView.addObject("timeType", timeType);
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@RequestMapping(value = action + "viewHead.action")
|
||||
public Map viewHead(HttpServletRequest request) {
|
||||
String timeType = request.getParameter("timeType");
|
||||
if (StringUtils.isEmptyString(timeType)) {
|
||||
timeType = "day";
|
||||
}
|
||||
|
||||
DateStringTypeEnum dateStringTypeEnum = DateStringTypeEnum.fromCode(timeType);
|
||||
|
||||
Map<String, String> timeMap = DateTypeToTime.convertTime(dateStringTypeEnum);
|
||||
|
||||
String startTime = timeMap.get("startTime");
|
||||
String endTime = timeMap.get("endTime");
|
||||
Map<String, Object> statistics = new HashMap<String, Object>();
|
||||
try {
|
||||
|
||||
PartySumDataDTO partySumData = userDataService.getPartyDataBtDay(startTime, endTime);
|
||||
//充提差额
|
||||
double chargeBalanceAmount = Objects.isNull(partySumData) ? 0.00 : Arith.sub(partySumData.getTotalRecharge(),partySumData.getTotalWithdraw());
|
||||
statistics.put("rechargeNum", Objects.isNull(partySumData) ? 0 : partySumData.getRechargeNum());
|
||||
statistics.put("withdrawNum", Objects.isNull(partySumData) ? 0 : partySumData.getWithdrawNum());
|
||||
statistics.put("rechargeAmount", Objects.isNull(partySumData) ? 0.00 : partySumData.getTotalRecharge());
|
||||
statistics.put("withdrawAmount", Objects.isNull(partySumData) ? 0 : partySumData.getTotalWithdraw());
|
||||
statistics.put("chargeBalanceAmount", chargeBalanceAmount);
|
||||
|
||||
PartySumDataDTO newPartySumData = userDataService.getPartyNewDataBtDay(startTime, endTime);
|
||||
double newChargeBalanceAmount = Objects.isNull(newPartySumData) ? 0D : Arith.sub(newPartySumData.getTotalRecharge(),newPartySumData.getTotalWithdraw());
|
||||
//新充提差额
|
||||
statistics.put("newChargeBalanceAmount", newChargeBalanceAmount);
|
||||
//新充值人数
|
||||
statistics.put("newRechargeNum", Objects.isNull(newPartySumData) ? 0 : newPartySumData.getRechargeNum());
|
||||
//新充值金额
|
||||
statistics.put("newRechargeAmount", Objects.isNull(newPartySumData) ? 0.00 : newPartySumData.getTotalRecharge());
|
||||
//新提现人数
|
||||
statistics.put("newWithdrawNum", Objects.isNull(newPartySumData) ? 0 : newPartySumData.getWithdrawNum());
|
||||
//新提现金额
|
||||
statistics.put("newWithdrawAmount", Objects.isNull(newPartySumData) ? 0 : newPartySumData.getTotalWithdraw());
|
||||
return statistics;
|
||||
} catch (BusinessException e) {
|
||||
statistics.put("code", 500);
|
||||
statistics.put("error", e.getMessage());
|
||||
return statistics;
|
||||
} catch (Throwable t) {
|
||||
logger.error(" error ", t);
|
||||
statistics.put("code", 500);
|
||||
statistics.put("error", t.getMessage());
|
||||
return statistics;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(value = action + "viewMiddle.action")
|
||||
public Map viewMiddle(HttpServletRequest request) {
|
||||
String timeType = request.getParameter("timeType");
|
||||
if (StringUtils.isEmptyString(timeType)) {
|
||||
timeType = "day";
|
||||
}
|
||||
DateStringTypeEnum dateStringTypeEnum = DateStringTypeEnum.fromCode(timeType);
|
||||
|
||||
Map<String, String> timeMap = DateTypeToTime.convertTime(dateStringTypeEnum);
|
||||
|
||||
String startTime = timeMap.get("startTime");
|
||||
String endTime = timeMap.get("endTime");
|
||||
Map<String, Object> statistics = new HashMap<String, Object>();
|
||||
try {
|
||||
//活跃
|
||||
Integer loginNum = partyService.getCountLoginByDay(startTime, endTime);
|
||||
|
||||
//新增用户
|
||||
Integer registerNum = partyService.getCountRegisterByDay(startTime, endTime);
|
||||
|
||||
//总店铺
|
||||
Integer allSellerNum = partyService.getCountAllSeller();
|
||||
|
||||
//总用户
|
||||
Integer allUserNum = partyService.getCountAllUser();
|
||||
|
||||
//新增店铺
|
||||
Integer registerSellerNum = partyService.getCountRegisterSellerByDay(startTime, endTime);
|
||||
|
||||
//订单
|
||||
Integer orderNum = partyService.getCountOrderByDay(startTime, endTime);
|
||||
|
||||
Map<String, Object> profitDataMap = walletLogService.getTotalProfitByDay(startTime, endTime);
|
||||
|
||||
Map<String, Object> totalSales = sellerGoodsService.querySumSellerOrdersPrize(startTime, endTime);
|
||||
|
||||
//返佣金额
|
||||
Object profitAmount = profitDataMap.get("profit");
|
||||
//销售总额
|
||||
Object totalSalesAmount = totalSales.get("totalSales");
|
||||
|
||||
statistics.put("loginNum", loginNum);
|
||||
statistics.put("registerNum", registerNum);
|
||||
statistics.put("allSellerNum", allSellerNum);
|
||||
statistics.put("allUserNum", allUserNum);
|
||||
statistics.put("registerSellerNum", registerSellerNum);
|
||||
statistics.put("orderNum", orderNum);
|
||||
statistics.put("rebateAmount", profitAmount);
|
||||
statistics.put("totalSalesAmount", Objects.isNull(totalSalesAmount) ? 0 : totalSalesAmount);
|
||||
return statistics;
|
||||
} catch (BusinessException e) {
|
||||
statistics.put("code", 500);
|
||||
statistics.put("error", e.getMessage());
|
||||
return statistics;
|
||||
} catch (Throwable t) {
|
||||
logger.error(" error ", t);
|
||||
statistics.put("code", 500);
|
||||
statistics.put("error", t.getMessage());
|
||||
return statistics;
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(value = action + "viewSellerTop.action")
|
||||
public List<SellerTopNDto> viewSellerTop(HttpServletRequest request) {
|
||||
|
||||
ModelAndView modelAndView = new ModelAndView();
|
||||
modelAndView.setViewName("index_admin");
|
||||
String timeType = request.getParameter("timeType");
|
||||
if (StringUtils.isEmptyString(timeType)) {
|
||||
timeType = "day";
|
||||
}
|
||||
DateStringTypeEnum dateStringTypeEnum = DateStringTypeEnum.fromCode(timeType);
|
||||
|
||||
Map<String, String> timeMap = DateTypeToTime.convertTime(dateStringTypeEnum);
|
||||
|
||||
String startTime = timeMap.get("startTime");
|
||||
String endTime = timeMap.get("endTime");
|
||||
// 店铺 TOP10
|
||||
List<SellerTopNDto> top10SellerList = sellerGoodsService.cacheTopNSellers(startTime, endTime, 10);
|
||||
return top10SellerList;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,191 @@
|
||||
package project.web.admin.controller.report;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import kernel.exception.BusinessException;
|
||||
import kernel.util.DateUtils;
|
||||
import kernel.util.JsonUtils;
|
||||
import kernel.util.StringUtils;
|
||||
import kernel.web.PageActionSupport;
|
||||
import project.Constants;
|
||||
import project.web.admin.service.report.AdminAgentAllStatisticsService;
|
||||
|
||||
/**
|
||||
* DAPP_代理商充提报表
|
||||
*/
|
||||
@RestController
|
||||
public class AdminAgentAllStatisticsController extends PageActionSupport {
|
||||
|
||||
private Logger logger = LogManager.getLogger(AdminAgentAllStatisticsController.class);
|
||||
|
||||
@Autowired
|
||||
private AdminAgentAllStatisticsService adminAgentAllStatisticsService;
|
||||
|
||||
private final String action = "normal/adminAgentAllStatisticsAction!";
|
||||
|
||||
/**
|
||||
* 代理商充提报表
|
||||
*/
|
||||
@RequestMapping(action + "list.action")
|
||||
public ModelAndView list(HttpServletRequest request) {
|
||||
String pageNo = request.getParameter("pageNo");
|
||||
String para_party_id = request.getParameter("para_party_id");
|
||||
String all_party_id = request.getParameter("all_party_id");
|
||||
String start_time = request.getParameter("start_time");
|
||||
String end_time = request.getParameter("end_time");
|
||||
String para_username = request.getParameter("para_username");
|
||||
|
||||
ModelAndView modelAndView = new ModelAndView();
|
||||
modelAndView.setViewName("auto_monitor_statistics_agent_all_list");
|
||||
|
||||
try {
|
||||
|
||||
this.checkAndSetPageNo(pageNo);
|
||||
|
||||
this.pageSize = 30;
|
||||
// this.initTime(start_time, end_time);
|
||||
|
||||
// start_time,end_time都为空时开始初始化
|
||||
if (null == start_time && null == end_time) {
|
||||
end_time = DateUtils.format(new Date(), DateUtils.DF_yyyyMMdd);
|
||||
start_time = DateUtils.format(DateUtils.getMonthStart(new Date()), DateUtils.DF_yyyyMMdd);
|
||||
}
|
||||
|
||||
// 如果知道某个代理商的id,进入后也不可查
|
||||
if (!StringUtils.isNotEmpty(para_party_id)) {
|
||||
para_party_id = this.getLoginPartyId();
|
||||
}
|
||||
|
||||
this.page = this.adminAgentAllStatisticsService.pagedQuery(this.pageNo, this.pageSize, start_time, end_time,
|
||||
this.getLoginPartyId(), para_username, Constants.SECURITY_ROLE_AGENT, para_party_id,all_party_id);
|
||||
|
||||
} catch (BusinessException e) {
|
||||
modelAndView.addObject("error", e.getMessage());
|
||||
return modelAndView;
|
||||
} catch (Throwable t) {
|
||||
logger.error(" error ", t);
|
||||
modelAndView.addObject("error", "[ERROR] " + t.getMessage());
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
modelAndView.addObject("pageNo", this.pageNo);
|
||||
modelAndView.addObject("pageSize", this.pageSize);
|
||||
modelAndView.addObject("page", this.page);
|
||||
modelAndView.addObject("para_party_id", para_party_id);
|
||||
modelAndView.addObject("start_time", start_time);
|
||||
modelAndView.addObject("end_time", end_time);
|
||||
modelAndView.addObject("para_username", para_username);
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出数据到文件
|
||||
*/
|
||||
@RequestMapping(action + "exportData.action")
|
||||
public ModelAndView exportData(HttpServletRequest request) {
|
||||
String pageNo = request.getParameter("pageNo");
|
||||
String start_time = request.getParameter("start_time");
|
||||
String end_time = request.getParameter("end_time");
|
||||
String para_username = request.getParameter("para_username");
|
||||
String para_party_id = request.getParameter("para_party_id");
|
||||
|
||||
ModelAndView modelAndView = new ModelAndView();
|
||||
modelAndView.setViewName("auto_monitor_statistics_agent_all_list");
|
||||
|
||||
try {
|
||||
|
||||
this.checkAndSetPageNo(pageNo);
|
||||
|
||||
this.pageSize = 30;
|
||||
// this.initTime(start_time, end_time);
|
||||
|
||||
// start_time,end_time都为空时开始初始化
|
||||
if (null == start_time && null == end_time) {
|
||||
end_time = DateUtils.format(new Date(), DateUtils.DF_yyyyMMdd);
|
||||
start_time = DateUtils.format(DateUtils.getMonthStart(new Date()), DateUtils.DF_yyyyMMdd);
|
||||
}
|
||||
|
||||
String error = this.adminAgentAllStatisticsService.loadExportData(this.getResponse(), this.pageSize,
|
||||
start_time, end_time, this.getLoginPartyId(), para_username, Constants.SECURITY_ROLE_AGENT,
|
||||
para_party_id);
|
||||
if (!StringUtils.isNullOrEmpty(error)) {
|
||||
throw new BusinessException(error);
|
||||
}
|
||||
|
||||
} catch (BusinessException e) {
|
||||
modelAndView.addObject("error", e.getMessage());
|
||||
return modelAndView;
|
||||
} catch (IOException e) {
|
||||
logger.error("export fail:{}", e);
|
||||
modelAndView.addObject("error", "程序错误,导出异常");
|
||||
return modelAndView;
|
||||
} catch (Throwable t) {
|
||||
logger.error(" error ", t);
|
||||
modelAndView.addObject("error", "[ERROR] " + t.getMessage());
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取推荐网络
|
||||
*/
|
||||
@RequestMapping(action + "getReconNumNet.action")
|
||||
public String getReconNumNet(HttpServletRequest request) {
|
||||
String net_party_id = request.getParameter("net_party_id");
|
||||
|
||||
Map<String, Object> resultMap = new HashMap<String, Object>();
|
||||
|
||||
try {
|
||||
|
||||
resultMap.put("code", 200);
|
||||
resultMap.put("user_reco_net", this.adminAgentAllStatisticsService.getRecoNumNetList(net_party_id));
|
||||
|
||||
} catch (BusinessException e) {
|
||||
resultMap.put("code", 500);
|
||||
resultMap.put("message", e.getMessage());
|
||||
} catch (Throwable t) {
|
||||
logger.error(" error ", t);
|
||||
resultMap.put("code", 500);
|
||||
resultMap.put("message", "程序错误");
|
||||
}
|
||||
|
||||
return JsonUtils.getJsonString(resultMap);
|
||||
}
|
||||
|
||||
// private void initTime(String start_time, String end_time) {
|
||||
//// if(null==start_time &&null==end_time &&null==para_time) para_time = "all";//默认一周
|
||||
//// if("day".equals(para_time)) {//当天
|
||||
//// this.end_time = DateUtils.format(new Date(),DateUtils.DF_yyyyMMdd);
|
||||
//// this.start_time = end_time;
|
||||
//// }else if("week".equals(para_time)) {//往前推7天
|
||||
//// this.end_time = DateUtils.format(new Date(),DateUtils.DF_yyyyMMdd);
|
||||
//// this.start_time = DateUtils.format(DateUtils.addDate(new Date(), -7),DateUtils.DF_yyyyMMdd);
|
||||
//// }else if("month".equals(para_time)) {//往前推一月
|
||||
//// this.end_time = DateUtils.format(new Date(),DateUtils.DF_yyyyMMdd);
|
||||
//// this.start_time = DateUtils.format(DateUtils.addMonth(new Date(), -1),DateUtils.DF_yyyyMMdd);
|
||||
//// }else if("all".equals(para_time)) {//所有数据
|
||||
//// this.end_time = null;
|
||||
//// this.start_time = null;
|
||||
//// }
|
||||
// // start_time,end_time都为空时开始初始化
|
||||
// if (null == start_time && null == end_time) {
|
||||
// end_time = DateUtils.format(new Date(), DateUtils.DF_yyyyMMdd);
|
||||
// start_time = DateUtils.format(DateUtils.getMonthStart(new Date()), DateUtils.DF_yyyyMMdd);
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
||||
@@ -0,0 +1,207 @@
|
||||
package project.web.admin.controller.report;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
|
||||
import kernel.exception.BusinessException;
|
||||
import kernel.util.DateUtils;
|
||||
import kernel.util.StringUtils;
|
||||
import kernel.web.PageActionSupport;
|
||||
import project.web.admin.service.report.AdminAllStatisticsService;
|
||||
|
||||
/**
|
||||
* DAPP_总充提报表
|
||||
*/
|
||||
@RestController
|
||||
public class AdminAllStatisticsController extends PageActionSupport {
|
||||
|
||||
private Logger logger = LogManager.getLogger(AdminAllStatisticsController.class);
|
||||
|
||||
@Autowired
|
||||
private AdminAllStatisticsService adminAllStatisticsService;
|
||||
|
||||
private final String action = "normal/adminAllStatisticsAction!";
|
||||
|
||||
/**
|
||||
* 总充提报表
|
||||
*/
|
||||
@RequestMapping(action + "list.action")
|
||||
public ModelAndView list(HttpServletRequest request) {
|
||||
String pageNo = request.getParameter("pageNo");
|
||||
String start_time = request.getParameter("start_time");
|
||||
String end_time = request.getParameter("end_time");
|
||||
String para_time = request.getParameter("para_time");
|
||||
|
||||
ModelAndView modelAndView = new ModelAndView();
|
||||
modelAndView.setViewName("auto_monitor_statistics_all_list");
|
||||
|
||||
try {
|
||||
|
||||
this.checkAndSetPageNo(pageNo);
|
||||
|
||||
this.pageSize = 30;
|
||||
// this.initTime(start_time, end_time, para_time);
|
||||
|
||||
// start_time,end_time都为空时开始初始化
|
||||
if (null == start_time && null == end_time && null == para_time) {
|
||||
end_time = DateUtils.format(new Date(), DateUtils.DF_yyyyMMdd);
|
||||
start_time = DateUtils.format(DateUtils.getMonthStart(new Date()), DateUtils.DF_yyyyMMdd);
|
||||
// para_time = "day";//默认一周
|
||||
}
|
||||
if ("day".equals(para_time)) {
|
||||
// 当天
|
||||
end_time = DateUtils.format(new Date(), DateUtils.DF_yyyyMMdd);
|
||||
start_time = end_time;
|
||||
} else if ("week".equals(para_time)) {
|
||||
// 往前推7天
|
||||
end_time = DateUtils.format(new Date(), DateUtils.DF_yyyyMMdd);
|
||||
start_time = DateUtils.format(DateUtils.addDate(new Date(), -7), DateUtils.DF_yyyyMMdd);
|
||||
} else if ("month".equals(para_time)) {
|
||||
// 往前推一月
|
||||
end_time = DateUtils.format(new Date(), DateUtils.DF_yyyyMMdd);
|
||||
start_time = DateUtils.format(DateUtils.addMonth(new Date(), -1), DateUtils.DF_yyyyMMdd);
|
||||
} else if ("all".equals(para_time)) {
|
||||
// 所有数据
|
||||
end_time = null;
|
||||
start_time = null;
|
||||
}
|
||||
|
||||
this.page = this.adminAllStatisticsService.pagedQuery(this.pageNo, this.pageSize, start_time, end_time,
|
||||
this.getLoginPartyId());
|
||||
|
||||
Map<String, Object> sumdata = this.adminAllStatisticsService.sumDatas(start_time, end_time, this.getLoginPartyId());
|
||||
|
||||
modelAndView.addObject("sumdata", sumdata);
|
||||
|
||||
} catch (BusinessException e) {
|
||||
modelAndView.addObject("error", e.getMessage());
|
||||
return modelAndView;
|
||||
} catch (Throwable t) {
|
||||
logger.error(" error ", t);
|
||||
modelAndView.addObject("error", "[ERROR] " + t.getMessage());
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
modelAndView.addObject("pageNo", this.pageNo);
|
||||
modelAndView.addObject("pageSize", this.pageSize);
|
||||
modelAndView.addObject("page", this.page);
|
||||
modelAndView.addObject("start_time", start_time);
|
||||
modelAndView.addObject("end_time", end_time);
|
||||
modelAndView.addObject("para_time", para_time);
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出订单数据到文件
|
||||
*/
|
||||
@RequestMapping(action + "exportData.action")
|
||||
public ModelAndView exportData(HttpServletRequest request) {
|
||||
String pageNo = request.getParameter("pageNo");
|
||||
String start_time = request.getParameter("start_time");
|
||||
String end_time = request.getParameter("end_time");
|
||||
String para_time = request.getParameter("para_time");
|
||||
|
||||
ModelAndView modelAndView = new ModelAndView();
|
||||
modelAndView.setViewName("auto_monitor_statistics_all_list");
|
||||
|
||||
try {
|
||||
|
||||
this.checkAndSetPageNo(pageNo);
|
||||
|
||||
this.pageSize = 30;
|
||||
// this.initTime(start_time, end_time, para_time);
|
||||
|
||||
// start_time,end_time都为空时开始初始化
|
||||
if (null == start_time && null == end_time && null == para_time) {
|
||||
end_time = DateUtils.format(new Date(), DateUtils.DF_yyyyMMdd);
|
||||
start_time = DateUtils.format(DateUtils.getMonthStart(new Date()), DateUtils.DF_yyyyMMdd);
|
||||
// para_time = "day";//默认一周
|
||||
}
|
||||
if ("day".equals(para_time)) {
|
||||
// 当天
|
||||
end_time = DateUtils.format(new Date(), DateUtils.DF_yyyyMMdd);
|
||||
start_time = end_time;
|
||||
} else if ("week".equals(para_time)) {
|
||||
// 往前推7天
|
||||
end_time = DateUtils.format(new Date(), DateUtils.DF_yyyyMMdd);
|
||||
start_time = DateUtils.format(DateUtils.addDate(new Date(), -7), DateUtils.DF_yyyyMMdd);
|
||||
} else if ("month".equals(para_time)) {
|
||||
// 往前推一月
|
||||
end_time = DateUtils.format(new Date(), DateUtils.DF_yyyyMMdd);
|
||||
start_time = DateUtils.format(DateUtils.addMonth(new Date(), -1), DateUtils.DF_yyyyMMdd);
|
||||
} else if ("all".equals(para_time)) {
|
||||
// 所有数据
|
||||
end_time = null;
|
||||
start_time = null;
|
||||
}
|
||||
|
||||
String error = this.adminAllStatisticsService.loadExportData(this.getResponse(), this.pageSize, start_time,
|
||||
end_time, this.getLoginPartyId());
|
||||
if (!StringUtils.isNullOrEmpty(error)) {
|
||||
throw new BusinessException(error);
|
||||
}
|
||||
|
||||
} catch (BusinessException e) {
|
||||
modelAndView.addObject("error", e.getMessage());
|
||||
return modelAndView;
|
||||
} catch (IOException e) {
|
||||
logger.error("export fail:{}", e);
|
||||
modelAndView.addObject("error", "程序错误,导出异常");
|
||||
return modelAndView;
|
||||
} catch (Throwable t) {
|
||||
logger.error(" error ", t);
|
||||
modelAndView.addObject("error", "[ERROR] " + t.getMessage());
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
modelAndView.addObject("pageNo", this.pageNo);
|
||||
modelAndView.addObject("pageSize", this.pageSize);
|
||||
modelAndView.addObject("page", this.page);
|
||||
modelAndView.addObject("start_time", start_time);
|
||||
modelAndView.addObject("end_time", end_time);
|
||||
modelAndView.addObject("para_time", para_time);
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
// private void initTime(String start_time, String end_time, String para_time) {
|
||||
// // start_time,end_time都为空时开始初始化
|
||||
// if (null == start_time && null == end_time && null == para_time) {
|
||||
// end_time = DateUtils.format(new Date(), DateUtils.DF_yyyyMMdd);
|
||||
// start_time = DateUtils.format(DateUtils.getMonthStart(new Date()), DateUtils.DF_yyyyMMdd);
|
||||
//// para_time = "day";//默认一周
|
||||
// return;
|
||||
// }
|
||||
// if ("day".equals(para_time)) {
|
||||
// // 当天
|
||||
// end_time = DateUtils.format(new Date(), DateUtils.DF_yyyyMMdd);
|
||||
// start_time = end_time;
|
||||
// } else if ("week".equals(para_time)) {
|
||||
// // 往前推7天
|
||||
// end_time = DateUtils.format(new Date(), DateUtils.DF_yyyyMMdd);
|
||||
// start_time = DateUtils.format(DateUtils.addDate(new Date(), -7), DateUtils.DF_yyyyMMdd);
|
||||
// } else if ("month".equals(para_time)) {
|
||||
// // 往前推一月
|
||||
// end_time = DateUtils.format(new Date(), DateUtils.DF_yyyyMMdd);
|
||||
// start_time = DateUtils.format(DateUtils.addMonth(new Date(), -1), DateUtils.DF_yyyyMMdd);
|
||||
//
|
||||
// logger.error("$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$");
|
||||
// logger.error("{},{},{}", start_time, end_time, para_time);
|
||||
// } else if ("all".equals(para_time)) {
|
||||
// // 所有数据
|
||||
// end_time = null;
|
||||
// start_time = null;
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
||||
@@ -0,0 +1,404 @@
|
||||
package project.web.admin.controller.report;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import kernel.util.Arith;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import kernel.exception.BusinessException;
|
||||
import kernel.util.DateUtils;
|
||||
import kernel.util.StringUtils;
|
||||
import kernel.web.PageActionSupport;
|
||||
import project.Constants;
|
||||
import project.party.PartyRedisKeys;
|
||||
import project.party.PartyService;
|
||||
import project.party.model.Party;
|
||||
import project.party.recom.UserRecomService;
|
||||
import project.redis.RedisHandler;
|
||||
import project.syspara.SysParaCode;
|
||||
import project.syspara.SysparaService;
|
||||
import project.user.UserDataService;
|
||||
import project.web.admin.service.report.AdminUserAllStatisticsService;
|
||||
import project.web.admin.service.user.AdminAgentService;
|
||||
|
||||
/**
|
||||
* 交易所_用户收益报表
|
||||
*/
|
||||
@RestController
|
||||
public class AdminUserAllStatisticsController extends PageActionSupport {
|
||||
|
||||
private Logger logger = LogManager.getLogger(AdminUserAllStatisticsController.class);
|
||||
|
||||
@Autowired
|
||||
protected AdminUserAllStatisticsService adminUserAllStatisticsService;
|
||||
@Autowired
|
||||
protected AdminAgentService adminAgentService;
|
||||
@Autowired
|
||||
protected UserDataService userDataService;
|
||||
@Autowired
|
||||
protected PartyService partyService;
|
||||
|
||||
@Resource
|
||||
protected UserRecomService userRecomService;
|
||||
@Autowired
|
||||
protected SysparaService sysparaService;
|
||||
|
||||
@Autowired
|
||||
protected RedisHandler redisHandler;
|
||||
|
||||
private final String action = "normal/adminUserAllStatisticsAction!";
|
||||
|
||||
/**
|
||||
* 获取 用户收益报表 列表
|
||||
*/
|
||||
@RequestMapping(action + "list.action")
|
||||
public ModelAndView list(HttpServletRequest request) {
|
||||
String pageNo = request.getParameter("pageNo");
|
||||
boolean no_agent_recom = Boolean.valueOf(request.getParameter("no_agent_recom")).booleanValue();
|
||||
String para_rolename = request.getParameter("para_rolename");
|
||||
boolean para_agent_view = Boolean.valueOf(request.getParameter("para_agent_view")).booleanValue();
|
||||
String start_time = request.getParameter("start_time");
|
||||
String end_time = request.getParameter("end_time");
|
||||
String para_username = request.getParameter("para_username");
|
||||
String para_party_id = request.getParameter("para_party_id");
|
||||
String sort_column = request.getParameter("sort_column");
|
||||
String sort_type = request.getParameter("sort_type");
|
||||
|
||||
ModelAndView modelAndView = new ModelAndView();
|
||||
modelAndView.setViewName("statistics_user_all_list");
|
||||
|
||||
try {
|
||||
|
||||
this.checkAndSetPageNo(pageNo);
|
||||
this.pageSize = 30;
|
||||
|
||||
if (StringUtils.isEmptyString(start_time) && StringUtils.isEmptyString(end_time)) {
|
||||
end_time = DateUtils.format(new Date(), DateUtils.DF_yyyyMMdd);
|
||||
start_time = DateUtils.format(DateUtils.getMonthStart(new Date()), DateUtils.DF_yyyyMMdd);
|
||||
}
|
||||
|
||||
para_rolename = null;
|
||||
para_agent_view = false;
|
||||
|
||||
if (no_agent_recom) {
|
||||
this.page = this.adminUserAllStatisticsService.pagedQueryNoAgentParent(this.pageNo, this.pageSize, start_time, end_time,
|
||||
this.getLoginPartyId(), para_username, para_rolename, para_party_id, para_agent_view, sort_column, sort_type);
|
||||
} else {
|
||||
this.page = this.adminUserAllStatisticsService.pagedQuery(this.pageNo, this.pageSize, start_time, end_time,
|
||||
this.getLoginPartyId(), para_username, para_rolename, para_party_id, para_agent_view, sort_column, sort_type);
|
||||
}
|
||||
|
||||
} catch (BusinessException e) {
|
||||
modelAndView.addObject("error", e.getMessage());
|
||||
return modelAndView;
|
||||
} catch (Throwable t) {
|
||||
logger.error(" error ", t);
|
||||
modelAndView.addObject("error", "[ERROR] " + t.getMessage());
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
modelAndView.addObject("pageNo", this.pageNo);
|
||||
modelAndView.addObject("pageSize", this.pageSize);
|
||||
modelAndView.addObject("page", this.page);
|
||||
modelAndView.addObject("no_agent_recom", no_agent_recom);
|
||||
modelAndView.addObject("para_rolename", para_rolename);
|
||||
modelAndView.addObject("para_agent_view", para_agent_view);
|
||||
modelAndView.addObject("start_time", start_time);
|
||||
modelAndView.addObject("end_time", end_time);
|
||||
modelAndView.addObject("para_username", para_username);
|
||||
modelAndView.addObject("para_party_id", para_party_id);
|
||||
modelAndView.addObject("sort_column", sort_column);
|
||||
modelAndView.addObject("sort_type", sort_type);
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取 用户收益报表 列表
|
||||
*/
|
||||
@RequestMapping(action + "exchangeList.action")
|
||||
public ModelAndView exchangeList(HttpServletRequest request) {
|
||||
String pageNo = request.getParameter("pageNo");
|
||||
String para_rolename = request.getParameter("para_rolename");
|
||||
boolean para_agent_view = Boolean.valueOf(request.getParameter("para_agent_view")).booleanValue();
|
||||
String start_time = request.getParameter("start_time");
|
||||
String end_time = request.getParameter("end_time");
|
||||
String para_username = request.getParameter("para_username");
|
||||
String para_party_id = request.getParameter("para_party_id");
|
||||
String all_para_party_id = request.getParameter("all_para_party_id");
|
||||
String sort_column = request.getParameter("sort_column");
|
||||
String sort_type = request.getParameter("sort_type");
|
||||
String sellerId = request.getParameter("sellerId");
|
||||
String sellerName = request.getParameter("sellerName");
|
||||
String agentUserCode = request.getParameter("agentUserCode");
|
||||
ModelAndView modelAndView = new ModelAndView();
|
||||
modelAndView.setViewName("statistics_user_all_list");
|
||||
String loginPartyId = getLoginPartyId();
|
||||
|
||||
try {
|
||||
|
||||
this.checkAndSetPageNo(pageNo);
|
||||
this.pageSize = 30;
|
||||
|
||||
if (StringUtils.isEmptyString(start_time) && StringUtils.isEmptyString(end_time)) {
|
||||
end_time = DateUtils.format(new Date(), DateUtils.DF_yyyyMMdd);
|
||||
start_time = DateUtils.format(DateUtils.getMonthStart(new Date()), DateUtils.DF_yyyyMMdd);
|
||||
}
|
||||
|
||||
para_rolename = null;
|
||||
para_agent_view = false;
|
||||
String agentPartyId = null;
|
||||
String checkedPartyId = this.getLoginPartyId();
|
||||
if (StringUtils.isNotEmpty(checkedPartyId)) {
|
||||
agentPartyId = checkedPartyId;
|
||||
}
|
||||
if (StringUtils.isNullOrEmpty(checkedPartyId) && StringUtils.isNotEmpty(agentUserCode)){
|
||||
Party agentParty = partyService.findPartyByUsercode(agentUserCode);
|
||||
if (!Objects.isNull(agentParty)){
|
||||
agentPartyId = agentParty.getId().toString();
|
||||
} else {
|
||||
agentPartyId = "0";
|
||||
}
|
||||
}
|
||||
|
||||
this.page = adminUserAllStatisticsService.exchangePagedQuery(this.pageNo, this.pageSize, start_time, end_time, agentPartyId,
|
||||
para_username, para_rolename, para_party_id, para_agent_view, sort_column, sort_type, sellerId, sellerName,all_para_party_id);
|
||||
List<Map> list = page.getElements();
|
||||
|
||||
List<String> sellerIds = new ArrayList<>();
|
||||
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
Map map=list.get(i);
|
||||
|
||||
int recoNum = 0;
|
||||
int allNum = 0;
|
||||
|
||||
List<String> children = this.userRecomService.findDirectlyChildrens(map.get("partyId").toString());
|
||||
List<String> childrenAll = this.userRecomService.findChildren(map.get("partyId").toString());
|
||||
Double recharge_usdt = (Double) map.get("recharge_usdt");
|
||||
Double withdraw = (Double) map.get("withdraw");
|
||||
// Long reco_num = (Long) map.get("reco_num") > 3 ? 3 : (Long) map.get("reco_num");
|
||||
double difference = Arith.sub(recharge_usdt, withdraw);
|
||||
map.put("difference",difference);
|
||||
|
||||
Double rechargeCommission = (Double) map.get("rechargeCommission");
|
||||
Double withdrawCommission = (Double) map.get("withdrawCommission");
|
||||
map.put("commission", Arith.sub(rechargeCommission,withdrawCommission));
|
||||
|
||||
for (String child : children) {
|
||||
Party party = partyService.cachePartyBy(child, false);
|
||||
if(null == party){
|
||||
logger.info("party 为null id为"+child);
|
||||
}
|
||||
if(Constants.SECURITY_ROLE_MEMBER.equals(party.getRolename())) {
|
||||
recoNum++;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
for (String child : childrenAll) {
|
||||
Party party = partyService.cachePartyBy(child, false);
|
||||
if(null == party){
|
||||
logger.info("party 为null id为"+child);
|
||||
}
|
||||
if(Constants.SECURITY_ROLE_MEMBER.equals(party.getRolename())) {
|
||||
allNum++;
|
||||
}
|
||||
}
|
||||
map.put("reco_num",recoNum);
|
||||
|
||||
map.put("reco_all_num",allNum);
|
||||
|
||||
Party agentParty = userRecomService.getAgentParty((Serializable) map.get("partyId"));
|
||||
if (null != agentParty){
|
||||
map.put("agentName",agentParty.getUsername());
|
||||
map.put("agentCode",agentParty.getUsercode());
|
||||
}
|
||||
String clerkOpen = this.sysparaService.find(SysParaCode.CLERK_IS_OPEN.getCode()).getValue();
|
||||
modelAndView.addObject("isOpen", clerkOpen);
|
||||
sellerIds.add(map.get("partyId").toString());
|
||||
|
||||
String isBlack = redisHandler.getString(PartyRedisKeys.PARTY_ID_SELLER_BLACK + map.get("partyId").toString());
|
||||
if ("1".equals(isBlack)){
|
||||
map.put("blank",1);
|
||||
} else {
|
||||
map.put("blank",0);
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, Object> willIncomeBySellerIds = adminUserAllStatisticsService.queryWillIncomeBySellerIds(sellerIds,start_time ,end_time);
|
||||
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
Map map = list.get(i);
|
||||
String querySellerId = (String) map.get("sellerId");
|
||||
Object aLong = willIncomeBySellerIds.get(querySellerId);
|
||||
map.put("willIncome" , Objects.isNull(aLong) ? 0 : aLong);
|
||||
}
|
||||
|
||||
} catch (BusinessException e) {
|
||||
modelAndView.addObject("error", e.getMessage());
|
||||
return modelAndView;
|
||||
} catch (Throwable t) {
|
||||
logger.error(" error ", t);
|
||||
modelAndView.addObject("error", "[ERROR] " + t.getMessage());
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
modelAndView.addObject("pageNo", this.pageNo);
|
||||
modelAndView.addObject("pageSize", this.pageSize);
|
||||
modelAndView.addObject("page", this.page);
|
||||
modelAndView.addObject("para_rolename", para_rolename);
|
||||
modelAndView.addObject("para_agent_view", para_agent_view);
|
||||
modelAndView.addObject("start_time", start_time);
|
||||
modelAndView.addObject("end_time", end_time);
|
||||
modelAndView.addObject("para_username", para_username);
|
||||
modelAndView.addObject("para_party_id", para_party_id);
|
||||
modelAndView.addObject("all_para_party_id", all_para_party_id);
|
||||
modelAndView.addObject("sort_column", sort_column);
|
||||
modelAndView.addObject("sort_type", sort_type);
|
||||
modelAndView.addObject("sellerId", sellerId);
|
||||
modelAndView.addObject("sellerName", sellerName);
|
||||
modelAndView.addObject("agentUserCode", agentUserCode);
|
||||
modelAndView.addObject("loginPartyId", loginPartyId);
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 导出数据到文件
|
||||
*/
|
||||
@RequestMapping(action + "exportData.action")
|
||||
public ModelAndView exportData(HttpServletRequest request) {
|
||||
String pageNo = request.getParameter("pageNo");
|
||||
String para_rolename = request.getParameter("para_rolename");
|
||||
boolean para_agent_view = Boolean.valueOf(request.getParameter("para_agent_view")).booleanValue();
|
||||
String start_time = request.getParameter("start_time");
|
||||
String end_time = request.getParameter("end_time");
|
||||
String para_username = request.getParameter("para_username");
|
||||
String para_party_id = request.getParameter("para_party_id");
|
||||
String sort_column = request.getParameter("sort_column");
|
||||
String sort_type = request.getParameter("sort_type");
|
||||
|
||||
ModelAndView modelAndView = new ModelAndView();
|
||||
modelAndView.setViewName("statistics_user_all_list");
|
||||
|
||||
try {
|
||||
|
||||
this.checkAndSetPageNo(pageNo);
|
||||
|
||||
this.pageSize = 30;
|
||||
|
||||
// initTime();
|
||||
if (StringUtils.isEmptyString(start_time) && StringUtils.isEmptyString(end_time)) {
|
||||
end_time = DateUtils.format(new Date(), DateUtils.DF_yyyyMMdd);
|
||||
start_time = DateUtils.format(DateUtils.getMonthStart(new Date()), DateUtils.DF_yyyyMMdd);
|
||||
}
|
||||
|
||||
String error = this.adminUserAllStatisticsService.loadExportData(this.getResponse(), this.pageSize, start_time,
|
||||
end_time, this.getLoginPartyId(), para_username, para_rolename, para_party_id, para_agent_view,
|
||||
sort_column, sort_type);
|
||||
if (!StringUtils.isNullOrEmpty(error)) {
|
||||
throw new BusinessException(error);
|
||||
}
|
||||
|
||||
} catch (BusinessException e) {
|
||||
modelAndView.addObject("error", e.getMessage());
|
||||
return modelAndView;
|
||||
} catch (IOException e) {
|
||||
logger.error("export fail:{}", e);
|
||||
modelAndView.addObject("error", "程序错误,导出异常");
|
||||
return modelAndView;
|
||||
} catch (Throwable t) {
|
||||
logger.error(" error ", t);
|
||||
modelAndView.addObject("error", "[ERROR] " + t.getMessage());
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户钱包 登录者只能看自己下面的用户钱包
|
||||
*/
|
||||
@RequestMapping(action + "walletExtendsAll.action")
|
||||
public ModelAndView walletExtendsAll(HttpServletRequest request) {
|
||||
String para_wallet_party_id = request.getParameter("para_wallet_party_id");
|
||||
|
||||
ModelAndView modelAndView = new ModelAndView();
|
||||
modelAndView.setViewName("statistics_user_all_money");
|
||||
|
||||
try {
|
||||
|
||||
List<Map<String, Object>> wallet_data = this.adminUserAllStatisticsService.getWalletExtends(this.getLoginPartyId(), para_wallet_party_id);
|
||||
|
||||
modelAndView.addObject("wallet_data", wallet_data);
|
||||
|
||||
} catch (BusinessException e) {
|
||||
modelAndView.addObject("error", e.getMessage());
|
||||
return modelAndView;
|
||||
} catch (Throwable t) {
|
||||
logger.error(" error ", t);
|
||||
modelAndView.addObject("error", "[ERROR] " + t.getMessage());
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户资产 登录者只能看自己下面的用户资产
|
||||
*/
|
||||
@RequestMapping(action + "assetsAll.action")
|
||||
public ModelAndView assetsAll(HttpServletRequest request) {
|
||||
String para_wallet_party_id = request.getParameter("para_wallet_party_id");
|
||||
|
||||
ModelAndView modelAndView = new ModelAndView();
|
||||
|
||||
try {
|
||||
|
||||
List<Map<String, Object>> asset_data = adminUserAllStatisticsService.getAssetsAll(this.getLoginPartyId(), para_wallet_party_id);
|
||||
|
||||
modelAndView.addObject("asset_data", asset_data);
|
||||
|
||||
} catch (BusinessException e) {
|
||||
modelAndView.addObject("error", e.getMessage());
|
||||
modelAndView.setViewName("redirect:/" + action + "list.action");
|
||||
return modelAndView;
|
||||
} catch (Throwable t) {
|
||||
logger.error(" error ", t);
|
||||
modelAndView.addObject("error", "[ERROR] " + t.getMessage());
|
||||
modelAndView.setViewName("redirect:/" + action + "list.action");
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
modelAndView.setViewName("statistics_user_all_asset");
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
// protected void initTime() {
|
||||
// if (null == start_time && null == end_time) {
|
||||
// this.end_time = DateUtils.format(new Date(), DateUtils.DF_yyyyMMdd);
|
||||
// this.start_time = DateUtils.format(DateUtils.getMonthStart(new Date()), DateUtils.DF_yyyyMMdd);
|
||||
// }
|
||||
// }
|
||||
|
||||
// protected void roleMap() {
|
||||
// role_map.put(Constants.SECURITY_ROLE_MEMBER, "正式用户");
|
||||
// role_map.put(Constants.SECURITY_ROLE_AGENT, "代理商");
|
||||
// role_map.put(Constants.SECURITY_ROLE_AGENTLOW, "代理商");
|
||||
// }
|
||||
|
||||
}
|
||||
@@ -0,0 +1,183 @@
|
||||
package project.web.admin.controller.report;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import kernel.util.Arith;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import kernel.exception.BusinessException;
|
||||
import kernel.util.DateUtils;
|
||||
import kernel.util.JsonUtils;
|
||||
import kernel.util.StringUtils;
|
||||
import kernel.web.PageActionSupport;
|
||||
import project.Constants;
|
||||
import project.syspara.SysParaCode;
|
||||
import project.syspara.SysparaService;
|
||||
import project.web.admin.service.report.AdminAgentAllStatisticsService;
|
||||
|
||||
/**
|
||||
* 交易所_代理商报表
|
||||
*/
|
||||
@RestController
|
||||
public class ExchangeAdminAgentAllStatisticsController extends PageActionSupport {
|
||||
|
||||
private Logger logger = LogManager.getLogger(ExchangeAdminAgentAllStatisticsController.class);
|
||||
|
||||
@Autowired
|
||||
private AdminAgentAllStatisticsService adminAgentAllStatisticsService;
|
||||
@Autowired
|
||||
protected SysparaService sysparaService;
|
||||
private final String action = "normal/exchangeAdminAgentAllStatisticsAction!";
|
||||
|
||||
@RequestMapping(action + "list.action")
|
||||
public ModelAndView list(HttpServletRequest request) {
|
||||
String pageNo = request.getParameter("pageNo");
|
||||
String para_party_id = request.getParameter("para_party_id");
|
||||
String start_time = request.getParameter("start_time");
|
||||
String end_time = request.getParameter("end_time");
|
||||
String para_username = request.getParameter("para_username");
|
||||
String all_party_id = request.getParameter("all_party_id");
|
||||
|
||||
ModelAndView modelAndView = new ModelAndView();
|
||||
modelAndView.setViewName("statistics_agent_all_list");
|
||||
|
||||
try {
|
||||
|
||||
this.checkAndSetPageNo(pageNo);
|
||||
|
||||
this.pageSize = 30;
|
||||
// this.initTime(start_time, end_time);
|
||||
|
||||
// start_time,end_time都为空时开始初始化
|
||||
if (null == start_time && null == end_time) {
|
||||
end_time = DateUtils.format(new Date(), DateUtils.DF_yyyyMMdd);
|
||||
start_time = DateUtils.format(DateUtils.getMonthStart(new Date()), DateUtils.DF_yyyyMMdd);
|
||||
}
|
||||
|
||||
// 如果知道某个代理商的id,进入后也不可查
|
||||
if (!StringUtils.isNotEmpty(para_party_id)) {
|
||||
para_party_id = this.getLoginPartyId();
|
||||
}
|
||||
String clerkOpen = this.sysparaService.find(SysParaCode.CLERK_IS_OPEN.getCode()).getValue();
|
||||
this.page = this.adminAgentAllStatisticsService.pagedQuery(this.pageNo, this.pageSize, start_time, end_time,
|
||||
this.getLoginPartyId(), para_username, Constants.SECURITY_ROLE_AGENT, para_party_id,all_party_id);
|
||||
List<Map> list = page.getElements();
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
Map map=list.get(i);
|
||||
Double recharge_usdt = (Double) map.get("recharge_usdt");
|
||||
Double withdraw = (Double) map.get("withdraw");
|
||||
double difference = Arith.sub(recharge_usdt, withdraw);
|
||||
|
||||
Double rechargeCommission = (Double) map.get("rechargeCommission");
|
||||
Double withdrawCommission = (Double) map.get("withdrawCommission");
|
||||
map.put("commission", Arith.sub(rechargeCommission,withdrawCommission));
|
||||
map.put("difference",difference);
|
||||
}
|
||||
modelAndView.addObject("isOpen", clerkOpen);
|
||||
} catch (BusinessException e) {
|
||||
modelAndView.addObject("error", e.getMessage());
|
||||
return modelAndView;
|
||||
} catch (Throwable t) {
|
||||
logger.error(" error ", t);
|
||||
modelAndView.addObject("error", "[ERROR] " + t.getMessage());
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
modelAndView.addObject("pageNo", this.pageNo);
|
||||
modelAndView.addObject("pageSize", this.pageSize);
|
||||
modelAndView.addObject("page", this.page);
|
||||
modelAndView.addObject("para_party_id", para_party_id);
|
||||
modelAndView.addObject("start_time", start_time);
|
||||
modelAndView.addObject("end_time", end_time);
|
||||
modelAndView.addObject("para_username", para_username);
|
||||
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出数据到文件
|
||||
*/
|
||||
@RequestMapping(action + "exportData.action")
|
||||
public ModelAndView exportData(HttpServletRequest request) {
|
||||
String pageNo = request.getParameter("pageNo");
|
||||
String start_time = request.getParameter("start_time");
|
||||
String end_time = request.getParameter("end_time");
|
||||
String para_username = request.getParameter("para_username");
|
||||
String para_party_id = request.getParameter("para_party_id");
|
||||
|
||||
ModelAndView modelAndView = new ModelAndView();
|
||||
modelAndView.setViewName("statistics_agent_all_list");
|
||||
|
||||
try {
|
||||
|
||||
this.checkAndSetPageNo(pageNo);
|
||||
|
||||
this.pageSize = 30;
|
||||
|
||||
// start_time,end_time都为空时开始初始化
|
||||
if (null == start_time && null == end_time) {
|
||||
end_time = DateUtils.format(new Date(), DateUtils.DF_yyyyMMdd);
|
||||
start_time = DateUtils.format(DateUtils.getMonthStart(new Date()), DateUtils.DF_yyyyMMdd);
|
||||
}
|
||||
|
||||
String error = this.adminAgentAllStatisticsService.loadExportData(this.getResponse(), this.pageSize,
|
||||
start_time, end_time, this.getLoginPartyId(), para_username, Constants.SECURITY_ROLE_AGENT,
|
||||
para_party_id);
|
||||
if (!StringUtils.isNullOrEmpty(error)) {
|
||||
throw new BusinessException(error);
|
||||
}
|
||||
|
||||
} catch (BusinessException e) {
|
||||
modelAndView.addObject("error", e.getMessage());
|
||||
return modelAndView;
|
||||
} catch (IOException e) {
|
||||
logger.error("export fail:{}", e);
|
||||
modelAndView.addObject("error", "程序错误,导出异常");
|
||||
return modelAndView;
|
||||
} catch (Throwable t) {
|
||||
logger.error(" error ", t);
|
||||
modelAndView.addObject("error", "[ERROR] " + t.getMessage());
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取推荐网络
|
||||
*/
|
||||
@RequestMapping(action + "getReconNumNet.action")
|
||||
public String getReconNumNet(HttpServletRequest request) {
|
||||
String net_party_id = request.getParameter("net_party_id");
|
||||
|
||||
Map<String, Object> resultMap = new HashMap<String, Object>();
|
||||
|
||||
try {
|
||||
|
||||
resultMap.put("code", 200);
|
||||
resultMap.put("user_reco_net", this.adminAgentAllStatisticsService.getRecoNumNetList(net_party_id));
|
||||
|
||||
} catch (BusinessException e) {
|
||||
resultMap.put("code", 500);
|
||||
resultMap.put("message", e.getMessage());
|
||||
} catch (Throwable t) {
|
||||
logger.error(" error ", t);
|
||||
resultMap.put("code", 500);
|
||||
resultMap.put("message", "程序错误");
|
||||
}
|
||||
|
||||
return JsonUtils.getJsonString(resultMap);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,208 @@
|
||||
package project.web.admin.controller.report;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import kernel.util.Arith;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
|
||||
import kernel.exception.BusinessException;
|
||||
import kernel.util.DateUtils;
|
||||
import kernel.util.StringUtils;
|
||||
import kernel.web.PageActionSupport;
|
||||
import project.Constants;
|
||||
import project.syspara.SysParaCode;
|
||||
import project.syspara.SysparaService;
|
||||
import project.web.admin.service.report.AdminAllStatisticsService;
|
||||
|
||||
/**
|
||||
* 总充提报表
|
||||
*/
|
||||
@RestController
|
||||
public class ExchangeAdminAllStatisticsController extends PageActionSupport {
|
||||
|
||||
private Logger logger = LogManager.getLogger(ExchangeAdminAllStatisticsController.class);
|
||||
|
||||
@Autowired
|
||||
private AdminAllStatisticsService adminAllStatisticsService;
|
||||
|
||||
|
||||
@Autowired
|
||||
protected SysparaService sysparaService;
|
||||
private final String action = "normal/exchangeAdminAllStatisticsAction!";
|
||||
|
||||
@RequestMapping(action + "list.action")
|
||||
public ModelAndView list(HttpServletRequest request) {
|
||||
String pageNo = request.getParameter("pageNo");
|
||||
String start_time = request.getParameter("start_time");
|
||||
String end_time = request.getParameter("end_time");
|
||||
String para_time = request.getParameter("para_time");
|
||||
|
||||
ModelAndView modelAndView = new ModelAndView();
|
||||
|
||||
try {
|
||||
|
||||
this.checkAndSetPageNo(pageNo);
|
||||
|
||||
this.pageSize = 30;
|
||||
|
||||
if (null == start_time && null == end_time && null == para_time) {
|
||||
end_time = DateUtils.format(new Date(), DateUtils.DF_yyyyMMdd);
|
||||
start_time = DateUtils.format(DateUtils.getMonthStart(new Date()), DateUtils.DF_yyyyMMdd);
|
||||
}
|
||||
if ("day".equals(para_time)) {
|
||||
// 当天
|
||||
end_time = DateUtils.format(new Date(), DateUtils.DF_yyyyMMdd);
|
||||
start_time = end_time;
|
||||
} else if ("week".equals(para_time)) {
|
||||
// 往前推7天
|
||||
end_time = DateUtils.format(new Date(), DateUtils.DF_yyyyMMdd);
|
||||
start_time = DateUtils.format(DateUtils.addDate(new Date(), -7), DateUtils.DF_yyyyMMdd);
|
||||
} else if ("month".equals(para_time)) {
|
||||
// 往前推一月
|
||||
end_time = DateUtils.format(new Date(), DateUtils.DF_yyyyMMdd);
|
||||
start_time = DateUtils.format(DateUtils.addMonth(new Date(), -1), DateUtils.DF_yyyyMMdd);
|
||||
} else if ("all".equals(para_time)) {
|
||||
// 所有数据
|
||||
end_time = null;
|
||||
start_time = null;
|
||||
}
|
||||
String clerkOpen = this.sysparaService.find(SysParaCode.CLERK_IS_OPEN.getCode()).getValue();
|
||||
this.page = this.adminAllStatisticsService.pagedQuery(this.pageNo, this.pageSize, start_time, end_time,
|
||||
this.getLoginPartyId());
|
||||
|
||||
List<Map> list = page.getElements();
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
Map map=list.get(i);
|
||||
Double recharge_usdt = (Double) map.get("recharge_usdt");
|
||||
Double withdraw = (Double) map.get("withdraw");
|
||||
double difference = Arith.sub(recharge_usdt, withdraw);
|
||||
|
||||
Double rechargeCommission = (Double) map.get("rechargeCommission");
|
||||
Double withdrawCommission = (Double) map.get("withdrawCommission");
|
||||
double commission = Arith.sub(rechargeCommission, withdrawCommission);
|
||||
map.put("difference",difference);
|
||||
map.put("commission",commission);
|
||||
}
|
||||
Map<String, Object> sumdata = this.adminAllStatisticsService.sumDatas(start_time, end_time, this.getLoginPartyId());
|
||||
if (!Objects.isNull(sumdata) && sumdata.size() >0){
|
||||
Double recharge_usdt = (Double)sumdata.get("recharge_usdt");
|
||||
Double withdraw = (Double) sumdata.get("withdraw");
|
||||
sumdata.put("difference", Arith.sub(recharge_usdt,withdraw));
|
||||
Double rechargeCommission = (Double) sumdata.get("rechargeCommission");
|
||||
Double withdrawCommission = (Double) sumdata.get("withdrawCommission");
|
||||
sumdata.put("commission", Arith.sub(rechargeCommission,withdrawCommission));
|
||||
sumdata.put("recharge_usdt", new BigDecimal(recharge_usdt).setScale(4, RoundingMode.FLOOR).toPlainString());
|
||||
} else {
|
||||
sumdata = new HashMap<>();
|
||||
sumdata.put("recharge_usdt", 0.0000);
|
||||
sumdata.put("difference", 0.0000);
|
||||
sumdata.put("commission", 0.0000);
|
||||
sumdata.put("recharge_usdt", 0.0000);
|
||||
sumdata.put("withdraw", 0.0000);
|
||||
sumdata.put("gift_money", 0.0000);
|
||||
sumdata.put("sellerTotalSales", 0.0000);
|
||||
sumdata.put("translate", 0.0000);
|
||||
}
|
||||
modelAndView.addObject("sumdata", sumdata);
|
||||
modelAndView.addObject("isOpen", clerkOpen);
|
||||
|
||||
} catch (BusinessException e) {
|
||||
modelAndView.addObject("error", e.getMessage());
|
||||
return modelAndView;
|
||||
} catch (Throwable t) {
|
||||
logger.error(" error ", t);
|
||||
modelAndView.addObject("error", "[ERROR] " + t.getMessage());
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
modelAndView.addObject("pageNo", this.pageNo);
|
||||
modelAndView.addObject("pageSize", this.pageSize);
|
||||
modelAndView.addObject("page", this.page);
|
||||
modelAndView.addObject("start_time", start_time);
|
||||
modelAndView.addObject("end_time", end_time);
|
||||
modelAndView.addObject("para_time", para_time);
|
||||
modelAndView.setViewName("statistics_all_list");
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出订单数据到文件
|
||||
*/
|
||||
@RequestMapping(action + "exportData.action")
|
||||
public ModelAndView exportData(HttpServletRequest request) {
|
||||
String pageNo = request.getParameter("pageNo");
|
||||
String start_time = request.getParameter("start_time");
|
||||
String end_time = request.getParameter("end_time");
|
||||
String para_time = request.getParameter("para_time");
|
||||
|
||||
ModelAndView modelAndView = new ModelAndView();
|
||||
|
||||
try {
|
||||
|
||||
this.checkAndSetPageNo(pageNo);
|
||||
|
||||
this.pageSize = 30;
|
||||
|
||||
if (null == start_time && null == end_time && null == para_time) {
|
||||
end_time = DateUtils.format(new Date(), DateUtils.DF_yyyyMMdd);
|
||||
start_time = DateUtils.format(DateUtils.getMonthStart(new Date()), DateUtils.DF_yyyyMMdd);
|
||||
}
|
||||
if ("day".equals(para_time)) {
|
||||
// 当天
|
||||
end_time = DateUtils.format(new Date(), DateUtils.DF_yyyyMMdd);
|
||||
start_time = end_time;
|
||||
} else if ("week".equals(para_time)) {
|
||||
// 往前推7天
|
||||
end_time = DateUtils.format(new Date(), DateUtils.DF_yyyyMMdd);
|
||||
start_time = DateUtils.format(DateUtils.addDate(new Date(), -7), DateUtils.DF_yyyyMMdd);
|
||||
} else if ("month".equals(para_time)) {
|
||||
// 往前推一月
|
||||
end_time = DateUtils.format(new Date(), DateUtils.DF_yyyyMMdd);
|
||||
start_time = DateUtils.format(DateUtils.addMonth(new Date(), -1), DateUtils.DF_yyyyMMdd);
|
||||
} else if ("all".equals(para_time)) {
|
||||
// 所有数据
|
||||
end_time = null;
|
||||
start_time = null;
|
||||
}
|
||||
|
||||
String error = this.adminAllStatisticsService.loadExportData(this.getResponse(), this.pageSize, start_time,
|
||||
end_time, this.getLoginPartyId());
|
||||
if (!StringUtils.isNullOrEmpty(error)) {
|
||||
throw new BusinessException(error);
|
||||
}
|
||||
|
||||
} catch (BusinessException e) {
|
||||
modelAndView.addObject("error", e.getMessage());
|
||||
return modelAndView;
|
||||
} catch (IOException e) {
|
||||
logger.error("export fail:{}", e);
|
||||
modelAndView.addObject("error", "程序错误,导出异常");
|
||||
return modelAndView;
|
||||
} catch (Throwable t) {
|
||||
logger.error(" error ", t);
|
||||
modelAndView.addObject("error", "[ERROR] " + t.getMessage());
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
modelAndView.addObject("pageNo", this.pageNo);
|
||||
modelAndView.addObject("pageSize", this.pageSize);
|
||||
modelAndView.addObject("page", this.page);
|
||||
modelAndView.addObject("start_time", start_time);
|
||||
modelAndView.addObject("end_time", end_time);
|
||||
modelAndView.addObject("para_time", para_time);
|
||||
modelAndView.setViewName("statistics_all_list");
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
}
|
||||
165
admin/src/main/java/project/web/admin/controller/upload/KindEditorUpload.java
Executable file
165
admin/src/main/java/project/web/admin/controller/upload/KindEditorUpload.java
Executable file
@@ -0,0 +1,165 @@
|
||||
package project.web.admin.controller.upload;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.apache.commons.fileupload.FileItem;
|
||||
import org.apache.commons.fileupload.FileItemFactory;
|
||||
import org.apache.commons.fileupload.FileUploadException;
|
||||
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
|
||||
import org.apache.commons.fileupload.servlet.ServletFileUpload;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.annotation.WebServlet;
|
||||
import javax.servlet.http.HttpServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.PrintWriter;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
|
||||
@WebServlet("/kindeditor/upload")
|
||||
public class KindEditorUpload extends HttpServlet {
|
||||
private static Log logger = LogFactory.getLog(KindEditorUpload.class);
|
||||
|
||||
@Override
|
||||
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
|
||||
doPost(req, resp);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
|
||||
//设置Response响应的编码
|
||||
resp.setContentType("text/html; charset=UTF-8");
|
||||
|
||||
|
||||
//获取一个Response的Write对象
|
||||
PrintWriter writer = resp.getWriter();
|
||||
|
||||
|
||||
//文件保存目录路径
|
||||
String savePath = req.getServletContext().getRealPath("/") + "attached/";
|
||||
System.out.println(savePath);
|
||||
|
||||
//文件保存目录URL
|
||||
String saveUrl = req.getContextPath() + "/attached/";
|
||||
System.out.print(saveUrl);
|
||||
|
||||
//定义允许上传的文件扩展名
|
||||
HashMap<String, String> extMap = new HashMap<String, String>();
|
||||
extMap.put("image", "gif,jpg,jpeg,png,bmp");
|
||||
extMap.put("flash", "swf,flv");
|
||||
extMap.put("media", "swf,flv,mp3,wav,wma,wmv,mid,avi,mpg,asf,rm,rmvb");
|
||||
extMap.put("file", "doc,docx,xls,xlsx,ppt,htm,html,txt,zip,rar,gz,bz2");
|
||||
|
||||
//最大文件大小
|
||||
long maxSize = 1000000;
|
||||
|
||||
|
||||
//判断是否是一个文件
|
||||
if (!ServletFileUpload.isMultipartContent(req)) {
|
||||
writer.println(getError("请选择文件。"));
|
||||
return;
|
||||
}
|
||||
//检查目录
|
||||
File uploadDir = new File(savePath);
|
||||
|
||||
if (!uploadDir.isDirectory()) {
|
||||
logger.info("上传目录->>>>" + savePath);
|
||||
writer.println(getError("上传目录不存在。" + savePath));
|
||||
return;
|
||||
}
|
||||
//检查目录写权限
|
||||
if (!uploadDir.canWrite()) {
|
||||
writer.println(getError("上传目录没有写权限。"));
|
||||
return;
|
||||
}
|
||||
|
||||
String dirName = req.getParameter("dir");
|
||||
if (dirName == null) {
|
||||
dirName = "image";
|
||||
}
|
||||
if (!extMap.containsKey(dirName)) {
|
||||
writer.println(getError("目录名不正确。"));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//创建文件夹
|
||||
savePath += dirName + "/";
|
||||
saveUrl += dirName + "/";
|
||||
File saveDirFile = new File(savePath);
|
||||
if (!saveDirFile.exists()) {
|
||||
saveDirFile.mkdirs();
|
||||
}
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
|
||||
String ymd = sdf.format(new Date());
|
||||
savePath += ymd + "/";
|
||||
saveUrl += ymd + "/";
|
||||
File dirFile = new File(savePath);
|
||||
if (!dirFile.exists()) {
|
||||
dirFile.mkdirs();
|
||||
}
|
||||
|
||||
FileItemFactory factory = new DiskFileItemFactory();
|
||||
ServletFileUpload upload = new ServletFileUpload(factory);
|
||||
upload.setHeaderEncoding("UTF-8");
|
||||
List items = null;
|
||||
try {
|
||||
items = upload.parseRequest(req);
|
||||
} catch (FileUploadException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
Iterator itr = items.iterator();
|
||||
while (itr.hasNext()) {
|
||||
FileItem item = (FileItem) itr.next();
|
||||
String fileName = item.getName();
|
||||
long fileSize = item.getSize();
|
||||
if (!item.isFormField()) {
|
||||
//检查文件大小
|
||||
if (item.getSize() > maxSize) {
|
||||
writer.println(getError("上传文件大小超过限制。"));
|
||||
return;
|
||||
}
|
||||
//检查扩展名
|
||||
String fileExt = fileName.substring(fileName.lastIndexOf(".") + 1).toLowerCase();
|
||||
if (!Arrays.<String>asList(extMap.get(dirName).split(",")).contains(fileExt)) {
|
||||
writer.println(getError("上传文件扩展名是不允许的扩展名。\n只允许" + extMap.get(dirName) + "格式。"));
|
||||
return;
|
||||
}
|
||||
|
||||
SimpleDateFormat df = new SimpleDateFormat("yyyyMMddHHmmss");
|
||||
String newFileName = df.format(new Date()) + "_" + new Random().nextInt(1000) + "." + fileExt;
|
||||
try {
|
||||
File uploadedFile = new File(savePath, newFileName);
|
||||
item.write(uploadedFile);
|
||||
} catch (Exception e) {
|
||||
writer.println(getError("上传文件失败。"));
|
||||
return;
|
||||
}
|
||||
|
||||
JSONObject obj = new JSONObject();
|
||||
obj.put("error", 0);
|
||||
obj.put("url", "https"+"://"+req.getServerName() + saveUrl + newFileName);
|
||||
writer.println(obj.toJSONString());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//将writer对象中的内容输出
|
||||
writer.flush();
|
||||
//关闭writer对象
|
||||
writer.close();
|
||||
}
|
||||
|
||||
|
||||
//一个私有的方法,用于响应错误信息
|
||||
private String getError(String message) {
|
||||
JSONObject obj = new JSONObject();
|
||||
obj.put("error", 1);
|
||||
obj.put("message", message);
|
||||
return obj.toJSONString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
package project.web.admin.controller.upload;
|
||||
|
||||
import kernel.util.ImageDispatcher;
|
||||
import kernel.util.PropertiesLoaderUtils;
|
||||
import org.springframework.web.bind.annotation.CrossOrigin;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.*;
|
||||
import java.util.Properties;
|
||||
|
||||
@RestController
|
||||
@CrossOrigin
|
||||
public class ShowImgController {
|
||||
|
||||
public final String basePath = "/public/showimg";
|
||||
private static Properties properties = PropertiesLoaderUtils.loadProperties("config/system.properties");
|
||||
|
||||
@RequestMapping(basePath+"!showImg.action")
|
||||
public void showImg(HttpServletRequest request,
|
||||
HttpServletResponse response, String imagePath) throws Exception {
|
||||
responseFile(response, imagePath);
|
||||
}
|
||||
|
||||
/**
|
||||
* 响应输出图片文件
|
||||
* @param response
|
||||
* @param imgFile
|
||||
*//*
|
||||
*/
|
||||
private void responseFile(HttpServletResponse response, String imagePath) {
|
||||
try(InputStream is = getDownloadFile(imagePath);
|
||||
OutputStream os = response.getOutputStream();){
|
||||
byte [] buffer = new byte[1024]; // 图片文件流缓存池
|
||||
while(is.read(buffer) != -1){
|
||||
os.write(buffer);
|
||||
}
|
||||
os.flush();
|
||||
} catch (IOException ioe){
|
||||
ioe.printStackTrace();
|
||||
}
|
||||
}
|
||||
public InputStream getDownloadFile(String imagePath) throws FileNotFoundException {
|
||||
BufferedInputStream bis = null;
|
||||
try {
|
||||
boolean goback = false;
|
||||
File fl = null;
|
||||
if ((imagePath == null) || (imagePath.trim().length() <= 0)) {
|
||||
fl = new File(properties.getProperty("images.dir") + "noimage.jpg");
|
||||
goback = true;
|
||||
}
|
||||
if (!goback) {
|
||||
fl = ImageDispatcher.findFile(imagePath);
|
||||
if (fl == null) {
|
||||
fl = new File(properties.getProperty("images.dir") + "noimage.jpg");
|
||||
}
|
||||
if (!fl.exists()) {
|
||||
fl = new File(properties.getProperty("images.dir") + "noimage.jpg");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
FileInputStream fis = new FileInputStream(fl);
|
||||
bis = new BufferedInputStream(fis);
|
||||
} catch (Throwable localThrowable) {
|
||||
}
|
||||
|
||||
return bis;
|
||||
}
|
||||
}
|
||||
128
admin/src/main/java/project/web/admin/controller/upload/UploadImgController.java
Executable file
128
admin/src/main/java/project/web/admin/controller/upload/UploadImgController.java
Executable file
@@ -0,0 +1,128 @@
|
||||
package project.web.admin.controller.upload;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import kernel.exception.BusinessException;
|
||||
import kernel.util.ImageDispatcher;
|
||||
import kernel.util.PropertiesLoaderUtils;
|
||||
import kernel.web.ResultObject;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.web.bind.annotation.CrossOrigin;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||
import org.springframework.web.multipart.MultipartResolver;
|
||||
import org.springframework.web.multipart.commons.CommonsMultipartResolver;
|
||||
import project.web.admin.controller.vo.FileUploadParamsVo;
|
||||
import project.web.admin.impl.AwsS3OSSFileService;
|
||||
import project.web.admin.util.AliOssUtil;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.*;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Properties;
|
||||
import java.util.Random;
|
||||
|
||||
@RestController
|
||||
@CrossOrigin
|
||||
public class UploadImgController {
|
||||
private static Log logger = LogFactory.getLog(UploadImgController.class);
|
||||
private static Properties properties = PropertiesLoaderUtils.loadProperties("config/system.properties");
|
||||
@Autowired
|
||||
AwsS3OSSFileService awsS3OSSFileService;
|
||||
@Value("${oss.aws.s3.bucketName}")
|
||||
private String bucketName;
|
||||
@RequestMapping(value = "normal/uploadimg!execute.action")
|
||||
public Object execute(FileUploadParamsVo filePrams) {
|
||||
ResultObject resultObject = new ResultObject();
|
||||
try {
|
||||
if (filePrams.getFile() == null || filePrams.getFile().getSize() == 0) {
|
||||
resultObject.setCode("1");
|
||||
resultObject.setMsg("图片不能为空");
|
||||
return resultObject;
|
||||
}
|
||||
if (StringUtils.isBlank(filePrams.getModuleName())) {
|
||||
resultObject.setCode("1");
|
||||
resultObject.setMsg("模块名不能为空");
|
||||
return resultObject;
|
||||
}
|
||||
|
||||
if (!awsS3OSSFileService.isImageFile(filePrams.getFile().getOriginalFilename())) {
|
||||
resultObject.setCode("1");
|
||||
resultObject.setMsg("请上传图片格式的文件");
|
||||
return resultObject;
|
||||
}
|
||||
if (filePrams.getFile().getSize() / 1024L > 30720L) {
|
||||
resultObject.setCode("1");
|
||||
resultObject.setMsg("图片大小不能超过30M");
|
||||
return resultObject;
|
||||
}
|
||||
|
||||
resultObject.setData(AliOssUtil.uploadImg(filePrams.getFile()));
|
||||
} catch (BusinessException e) {
|
||||
resultObject.setCode("1");
|
||||
resultObject.setMsg(e.getMessage());
|
||||
logger.error("文件上传失败", e);
|
||||
return resultObject;
|
||||
} catch (Exception e) {
|
||||
resultObject.setCode("1");
|
||||
resultObject.setMsg("服务器错误");
|
||||
logger.error("文件上传失败", e);
|
||||
return resultObject;
|
||||
}
|
||||
|
||||
return resultObject;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "normal/uploadimg!execute1.action")
|
||||
public Object execute1(FileUploadParamsVo filePrams) {
|
||||
JSONObject obj = new JSONObject();
|
||||
try {
|
||||
if (filePrams.getFile() == null || filePrams.getFile().getSize() == 0) {
|
||||
obj.put("error", 1);
|
||||
obj.put("message", "图片不能为空");
|
||||
return obj;
|
||||
}
|
||||
// if (StringUtils.isBlank(filePrams.getModuleName())) {
|
||||
// resultObject.setCode("1");
|
||||
// resultObject.setMsg("模块名不能为空");
|
||||
// return resultObject;
|
||||
// }
|
||||
filePrams.setModuleName("richText");
|
||||
if (!awsS3OSSFileService.isImageFile(filePrams.getFile().getOriginalFilename())) {
|
||||
obj.put("error", 1);
|
||||
obj.put("message", "请上传图片格式的文件");
|
||||
return obj;
|
||||
}
|
||||
if (filePrams.getFile().getSize() / 1024L > 30720L) {
|
||||
obj.put("error", 1);
|
||||
obj.put("message", "图片大小不能超过30M");
|
||||
return obj;
|
||||
}
|
||||
String url = String.format("https://%s.s3.amazonaws.com/", bucketName);
|
||||
obj.put("error", 0);
|
||||
obj.put("url", url + awsS3OSSFileService.putS3Object(filePrams.getModuleName(), filePrams.getFile(), 0.3f));
|
||||
} catch (BusinessException e) {
|
||||
obj.put("error", 1);
|
||||
obj.put("message",e.getMessage());
|
||||
logger.error("文件上传失败", e);
|
||||
return obj;
|
||||
} catch (Exception e) {
|
||||
obj.put("error", 1);
|
||||
obj.put("message", "服务器错误");
|
||||
logger.error("文件上传失败", e);
|
||||
return obj;
|
||||
}
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
403
admin/src/main/java/project/web/admin/controller/user/AdminAgentController.java
Executable file
403
admin/src/main/java/project/web/admin/controller/user/AdminAgentController.java
Executable file
@@ -0,0 +1,403 @@
|
||||
package project.web.admin.controller.user;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.providers.encoding.PasswordEncoder;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import kernel.exception.BusinessException;
|
||||
import kernel.util.JsonUtils;
|
||||
import kernel.util.PropertiesUtil;
|
||||
import kernel.util.StringUtils;
|
||||
import kernel.web.PageActionSupport;
|
||||
import project.Constants;
|
||||
import project.log.Log;
|
||||
import project.log.LogService;
|
||||
import project.party.PartyService;
|
||||
import project.party.model.Party;
|
||||
import project.user.Agent;
|
||||
import project.web.admin.service.user.AdminAgentService;
|
||||
import security.SecUser;
|
||||
import security.internal.SecUserService;
|
||||
|
||||
/**
|
||||
* 代理商
|
||||
*/
|
||||
@RestController
|
||||
public class AdminAgentController extends PageActionSupport {
|
||||
|
||||
private Logger logger = LogManager.getLogger(AdminAgentController.class);
|
||||
|
||||
@Autowired
|
||||
private AdminAgentService adminAgentService;
|
||||
@Autowired
|
||||
private PasswordEncoder passwordEncoder;
|
||||
@Autowired
|
||||
private PartyService partyService;
|
||||
@Autowired
|
||||
private LogService logService;
|
||||
@Autowired
|
||||
private SecUserService secUserService;
|
||||
|
||||
private final String action = "normal/adminAgentAction!";
|
||||
|
||||
/**
|
||||
* 获取代理商列表
|
||||
*/
|
||||
@RequestMapping(action + "list.action")
|
||||
public ModelAndView list(HttpServletRequest request) {
|
||||
String pageNo = request.getParameter("pageNo");
|
||||
String message = request.getParameter("message");
|
||||
String error = request.getParameter("error");
|
||||
String partyId = request.getParameter("partyId");
|
||||
String view_para = request.getParameter("view_para");
|
||||
String name_para = request.getParameter("name_para");
|
||||
String para_party_id = request.getParameter("para_party_id");
|
||||
|
||||
ModelAndView modelAndView = new ModelAndView();
|
||||
modelAndView.setViewName("agent_list");
|
||||
|
||||
try {
|
||||
|
||||
this.checkAndSetPageNo(pageNo);
|
||||
|
||||
this.pageSize = 20;
|
||||
|
||||
String checkedPartyId = this.getLoginPartyId();
|
||||
if (!StringUtils.isNullOrEmpty(partyId)) {
|
||||
checkedPartyId = partyId;
|
||||
}
|
||||
|
||||
if ("list".equals(view_para)) {
|
||||
this.page = this.adminAgentService.pagedQuery(this.pageNo, this.pageSize, name_para, checkedPartyId);
|
||||
} else {
|
||||
if (!"".equals(name_para)) {
|
||||
para_party_id = "";
|
||||
}
|
||||
|
||||
this.page = this.adminAgentService.pagedQueryNetwork(this.pageNo, this.pageSize, this.getLoginPartyId(), name_para,
|
||||
Constants.SECURITY_ROLE_AGENT, para_party_id);
|
||||
}
|
||||
|
||||
String webUrl = Constants.WEB_URL;
|
||||
webUrl = webUrl.substring(0, webUrl.length() - 4);
|
||||
List<Map<String, Object>> list = (List<Map<String, Object>>) this.page.getElements();
|
||||
for (Map<String, Object> map : list) {
|
||||
map.put("share_url", webUrl + "#/?code=" + map.get("usercode").toString());
|
||||
}
|
||||
|
||||
String url = PropertiesUtil.getProperty("admin_url") + "/adminAgent/list";
|
||||
String result = JsonUtils.getJsonString(this.adminAgentService.findAgentNodes(this.getLoginPartyId(), checkedPartyId, url));
|
||||
|
||||
modelAndView.addObject("result", result);
|
||||
|
||||
} catch (BusinessException e) {
|
||||
modelAndView.addObject("error", e.getMessage());
|
||||
return modelAndView;
|
||||
} catch (Throwable t) {
|
||||
logger.error(" error ", t);
|
||||
modelAndView.addObject("error", "[ERROR] " + t.getMessage());
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
modelAndView.addObject("pageNo", this.pageNo);
|
||||
modelAndView.addObject("pageSize", this.pageSize);
|
||||
modelAndView.addObject("page", this.page);
|
||||
modelAndView.addObject("message", message);
|
||||
modelAndView.addObject("error", error);
|
||||
modelAndView.addObject("name_para", name_para);
|
||||
modelAndView.addObject("view_para", view_para);
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增代理商 页面
|
||||
*/
|
||||
@RequestMapping(action + "toAdd.action")
|
||||
public ModelAndView toAdd(HttpServletRequest request) {
|
||||
|
||||
ModelAndView modelAndView = new ModelAndView();
|
||||
|
||||
try {
|
||||
|
||||
String parents_usercode = "";
|
||||
|
||||
if (!StringUtils.isNullOrEmpty(this.getLoginPartyId())) {
|
||||
String loginPartyId = this.getLoginPartyId();
|
||||
Party party = this.partyService.cachePartyBy(loginPartyId, true);
|
||||
parents_usercode = party.getUsercode();
|
||||
}
|
||||
|
||||
modelAndView.addObject("parents_usercode", parents_usercode);
|
||||
|
||||
} catch (BusinessException e) {
|
||||
modelAndView.addObject("error", e.getMessage());
|
||||
modelAndView.setViewName("redirect:/" + action + "list.action");
|
||||
return modelAndView;
|
||||
} catch (Throwable t) {
|
||||
logger.error(" error ", t);
|
||||
modelAndView.addObject("error", "[ERROR] " + t.getMessage());
|
||||
modelAndView.setViewName("redirect:/" + action + "list.action");
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
modelAndView.setViewName("agent_add");
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增代理商
|
||||
*/
|
||||
@RequestMapping(action + "add.action")
|
||||
public ModelAndView add(HttpServletRequest request) {
|
||||
String username = request.getParameter("username");
|
||||
String password = request.getParameter("password");
|
||||
String login_safeword = request.getParameter("login_safeword");
|
||||
String name = request.getParameter("name");
|
||||
String remarks = request.getParameter("remarks");
|
||||
String parents_usercode = request.getParameter("parents_usercode");
|
||||
boolean login_authority = Boolean.valueOf(request.getParameter("login_authority")).booleanValue();
|
||||
boolean opera_authority = Boolean.valueOf(request.getParameter("opera_authority")).booleanValue();
|
||||
|
||||
ModelAndView modelAndView = new ModelAndView();
|
||||
|
||||
try {
|
||||
|
||||
String error = this.verification(username, password);
|
||||
if (!StringUtils.isNullOrEmpty(error)) {
|
||||
throw new BusinessException(error);
|
||||
}
|
||||
|
||||
String username_login = this.getUsername_login();
|
||||
|
||||
SecUser sec = this.secUserService.findUserByLoginName(username_login);
|
||||
this.checkLoginSafeword(sec, this.getUsername_login(), login_safeword);
|
||||
|
||||
username = username.replace(" ", "");
|
||||
password = password.replace(" ", "");
|
||||
|
||||
this.adminAgentService.save(name, username, password, login_authority, remarks, parents_usercode, opera_authority);
|
||||
|
||||
String log = MessageFormat.format(
|
||||
"ip:" + this.getIp() + ",管理员新增代理商,名称:{0},用户名:{1},登录权限:{2},备注:{3},推荐人uid:{4},操作权限:{5}", name,
|
||||
username, login_authority, remarks, parents_usercode, opera_authority);
|
||||
this.saveLog(sec, username_login, log);
|
||||
|
||||
} catch (BusinessException e) {
|
||||
modelAndView.addObject("error", e.getMessage());
|
||||
modelAndView.addObject("username", username);
|
||||
modelAndView.addObject("password", password);
|
||||
modelAndView.addObject("remarks", remarks);
|
||||
modelAndView.addObject("parents_usercode", parents_usercode);
|
||||
modelAndView.addObject("login_authority", login_authority);
|
||||
modelAndView.addObject("opera_authority", opera_authority);
|
||||
modelAndView.setViewName("agent_add");
|
||||
return modelAndView;
|
||||
} catch (Throwable t) {
|
||||
logger.error("UserAction.register error ", t);
|
||||
modelAndView.addObject("error", "[ERROR] " + t.getMessage());
|
||||
modelAndView.addObject("username", username);
|
||||
modelAndView.addObject("password", password);
|
||||
modelAndView.addObject("remarks", remarks);
|
||||
modelAndView.addObject("parents_usercode", parents_usercode);
|
||||
modelAndView.addObject("login_authority", login_authority);
|
||||
modelAndView.addObject("opera_authority", opera_authority);
|
||||
modelAndView.setViewName("agent_add");
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
modelAndView.addObject("message", "操作成功");
|
||||
modelAndView.setViewName("redirect:/" + action + "list.action");
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改代理商 页面
|
||||
*/
|
||||
@RequestMapping(action + "toUpdate.action")
|
||||
public ModelAndView toUpdate(HttpServletRequest request) {
|
||||
String id = request.getParameter("id");
|
||||
|
||||
ModelAndView modelAndView = new ModelAndView();
|
||||
|
||||
try {
|
||||
|
||||
Agent agent = adminAgentService.get(id);
|
||||
|
||||
Party party = this.partyService.cachePartyBy(agent.getPartyId(), false);
|
||||
|
||||
modelAndView.addObject("id", id);
|
||||
modelAndView.addObject("name", party.getName());
|
||||
modelAndView.addObject("remarks", party.getRemarks());
|
||||
modelAndView.addObject("login_authority", party.getLogin_authority());
|
||||
modelAndView.addObject("opera_authority", Constants.SECURITY_ROLE_AGENT.equals(party.getRolename()));
|
||||
|
||||
} catch (BusinessException e) {
|
||||
modelAndView.addObject("error", e.getMessage());
|
||||
modelAndView.setViewName("redirect:/" + action + "list.action");
|
||||
return modelAndView;
|
||||
} catch (Throwable t) {
|
||||
logger.error(" error ", t);
|
||||
modelAndView.addObject("error", "[ERROR] " + t.getMessage());
|
||||
modelAndView.setViewName("redirect:/" + action + "list.action");
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
modelAndView.setViewName("agent_update");
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改代理商
|
||||
*/
|
||||
@RequestMapping(action + "update.action")
|
||||
public ModelAndView update(HttpServletRequest request) {
|
||||
String id = request.getParameter("id");
|
||||
String name = request.getParameter("name");
|
||||
String remarks = request.getParameter("remarks");
|
||||
boolean login_authority = Boolean.valueOf(request.getParameter("login_authority")).booleanValue();
|
||||
boolean opera_authority = Boolean.valueOf(request.getParameter("opera_authority")).booleanValue();
|
||||
|
||||
ModelAndView modelAndView = new ModelAndView();
|
||||
|
||||
try {
|
||||
|
||||
Agent agent = this.adminAgentService.get(id);
|
||||
|
||||
Party party = this.partyService.cachePartyBy(agent.getPartyId(), false);
|
||||
|
||||
SecUser secUser = this.secUserService.findUserByPartyId(agent.getPartyId());
|
||||
String log = MessageFormat.format("ip:" + this.getIp() + ",管理员修改代理商,用户名:{0},原登录权限:{1},原备注:{2},原操作权限:{3}",
|
||||
secUser.getUsername(), secUser.getEnabled(), party.getRemarks(),
|
||||
Constants.SECURITY_ROLE_AGENT.equals(party.getRolename()));
|
||||
|
||||
this.adminAgentService.update(id, name, login_authority, remarks, opera_authority);
|
||||
|
||||
log += MessageFormat.format(",新登录权限:{0},新备注:{1},新操作权限:{2}", login_authority, remarks, opera_authority);
|
||||
this.saveLog(secUser, this.getUsername_login(), log);
|
||||
|
||||
} catch (BusinessException e) {
|
||||
modelAndView.addObject("error", e.getMessage());
|
||||
modelAndView.addObject("id", id);
|
||||
modelAndView.addObject("name", name);
|
||||
modelAndView.addObject("remarks", remarks);
|
||||
modelAndView.addObject("login_authority", login_authority);
|
||||
modelAndView.addObject("opera_authority", opera_authority);
|
||||
modelAndView.setViewName("agent_update");
|
||||
return modelAndView;
|
||||
} catch (Throwable t) {
|
||||
logger.error(" error ", t);
|
||||
modelAndView.addObject("error", "[ERROR] " + t.getMessage());
|
||||
modelAndView.addObject("id", id);
|
||||
modelAndView.addObject("name", name);
|
||||
modelAndView.addObject("remarks", remarks);
|
||||
modelAndView.addObject("login_authority", login_authority);
|
||||
modelAndView.addObject("opera_authority", opera_authority);
|
||||
modelAndView.setViewName("agent_update");
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
modelAndView.addObject("message", "操作成功");
|
||||
modelAndView.setViewName("redirect:/" + action + "list.action");
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置登录密码
|
||||
*/
|
||||
@RequestMapping(action + "resetpsw.action")
|
||||
public ModelAndView resetpsw(HttpServletRequest request) {
|
||||
String id = request.getParameter("id");
|
||||
String password = request.getParameter("password");
|
||||
String safeword = request.getParameter("safeword");
|
||||
|
||||
ModelAndView modelAndView = new ModelAndView();
|
||||
|
||||
try {
|
||||
|
||||
if (!StringUtils.isNullOrEmpty(password) || !StringUtils.isNullOrEmpty(safeword)) {
|
||||
|
||||
SecUser sec = this.secUserService.findUserByLoginName(this.getUsername_login());
|
||||
String sysSafeword = sec.getSafeword();
|
||||
String safeword_md5 = passwordEncoder.encodePassword(safeword, this.getUsername_login());
|
||||
if (!safeword_md5.equals(sysSafeword)) {
|
||||
throw new BusinessException("资金密码错误");
|
||||
}
|
||||
|
||||
password = password.replace(" ", "");
|
||||
|
||||
Agent agent = this.adminAgentService.get(id);
|
||||
Party party = this.partyService.cachePartyBy(agent.getPartyId(), true);
|
||||
|
||||
this.secUserService.updatePassword(party.getUsername(), password);
|
||||
|
||||
Log log = new Log();
|
||||
log.setCategory(Constants.LOG_CATEGORY_OPERATION);
|
||||
log.setUsername(party.getUsername());
|
||||
log.setOperator(this.getUsername_login());
|
||||
log.setLog("ip:" + this.getIp() + ",管理员手动代理商修改登录密码");
|
||||
this.logService.saveSync(log);
|
||||
}
|
||||
} catch (BusinessException e) {
|
||||
modelAndView.addObject("error", e.getMessage());
|
||||
modelAndView.setViewName("redirect:/" + action + "list.action");
|
||||
return modelAndView;
|
||||
} catch (Exception e) {
|
||||
logger.error(" error ", e);
|
||||
modelAndView.addObject("error", "程序错误");
|
||||
modelAndView.setViewName("redirect:/" + action + "list.action");
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
modelAndView.addObject("message", "操作成功");
|
||||
modelAndView.setViewName("redirect:/" + action + "list.action");
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证登录人资金密码
|
||||
*/
|
||||
protected void checkLoginSafeword(SecUser secUser, String operatorUsername, String loginSafeword) {
|
||||
// SecUser sec = this.secUserService.findUserByLoginName(operatorUsername);
|
||||
String sysSafeword = secUser.getSafeword();
|
||||
String safeword_md5 = this.passwordEncoder.encodePassword(loginSafeword, operatorUsername);
|
||||
if (!safeword_md5.equals(sysSafeword)) {
|
||||
throw new BusinessException("登录人资金密码错误");
|
||||
}
|
||||
}
|
||||
|
||||
public void saveLog(SecUser secUser, String operator, String context) {
|
||||
Log log = new Log();
|
||||
log.setCategory(Constants.LOG_CATEGORY_OPERATION);
|
||||
log.setOperator(operator);
|
||||
log.setUsername(secUser.getUsername());
|
||||
log.setPartyId(secUser.getPartyId());
|
||||
log.setLog(context);
|
||||
log.setCreateTime(new Date());
|
||||
this.logService.saveSync(log);
|
||||
}
|
||||
|
||||
private String verification(String username, String password) {
|
||||
// if (StringUtils.isEmptyString(this.name)) {
|
||||
// return "请输入姓名";
|
||||
// }
|
||||
if (StringUtils.isEmptyString(username)) {
|
||||
return "请输入用户名";
|
||||
}
|
||||
if (StringUtils.isEmptyString(password)) {
|
||||
return "请输入登录密码";
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,173 @@
|
||||
package project.web.admin.controller.user;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import kernel.exception.BusinessException;
|
||||
import kernel.util.StringUtils;
|
||||
import project.web.admin.service.user.AdminPublicUserService;
|
||||
import security.web.BaseSecurityAction;
|
||||
import util.RegexUtil;
|
||||
|
||||
/**
|
||||
* 修改登录密码、资金密码
|
||||
*
|
||||
*/
|
||||
@RestController
|
||||
public class AdminPasswordChangeController extends BaseSecurityAction {
|
||||
|
||||
private static final Log logger = LogFactory.getLog(AdminPasswordChangeController.class);
|
||||
|
||||
@Autowired
|
||||
private AdminPublicUserService adminPublicUserService;
|
||||
|
||||
private final String action = "normal/adminPasswordChangeAction!";
|
||||
|
||||
@RequestMapping(value = action + "view.action")
|
||||
public ModelAndView view(HttpServletRequest request) {
|
||||
String message = request.getParameter("message");
|
||||
String error = request.getParameter("error");
|
||||
ModelAndView model = new ModelAndView();
|
||||
model.addObject("message", message);
|
||||
model.addObject("error", error);
|
||||
model.setViewName("password_change");
|
||||
return model;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改登录密码
|
||||
*/
|
||||
@RequestMapping(value = action + "change.action")
|
||||
public ModelAndView change(HttpServletRequest request) {
|
||||
ModelAndView model = new ModelAndView();
|
||||
String error = "";
|
||||
String message = "";
|
||||
try {
|
||||
String oldpassword = request.getParameter("oldpassword");
|
||||
String password = request.getParameter("password");
|
||||
String confirm_password = request.getParameter("confirm_password");
|
||||
// 资金密码
|
||||
String login_safeword = request.getParameter("login_safeword");
|
||||
// 验证码
|
||||
String email_code = request.getParameter("email_code");
|
||||
// 谷歌验证码
|
||||
String google_auth_code = request.getParameter("google_auth_code");
|
||||
|
||||
error = verif(oldpassword, password, confirm_password);
|
||||
if (!StringUtils.isNullOrEmpty(error)) {
|
||||
model.addObject("error", error);
|
||||
model.setViewName("redirect:/" + action + "view.action");
|
||||
return model;
|
||||
}
|
||||
String partyId = this.getLoginPartyId();
|
||||
String username = this.getUsername_login();
|
||||
adminPublicUserService.saveChangePassword(partyId, oldpassword, password, username,
|
||||
login_safeword, email_code, google_auth_code);
|
||||
message = "操作成功";
|
||||
} catch (BusinessException e) {
|
||||
error = e.getMessage();
|
||||
}catch (Throwable t) {
|
||||
logger.error(" error ", t);
|
||||
error = ("[ERROR] 服务器错误");
|
||||
}
|
||||
|
||||
model.addObject("message", message);
|
||||
model.addObject("error", error);
|
||||
model.setViewName("redirect:/" + action + "view.action");
|
||||
return model;
|
||||
}
|
||||
|
||||
@RequestMapping(value = action + "viewSafeword.action")
|
||||
public ModelAndView viewSafeword(HttpServletRequest request) {
|
||||
String message = request.getParameter("message");
|
||||
String error = request.getParameter("error");
|
||||
|
||||
ModelAndView model = new ModelAndView();
|
||||
model.addObject("message", message);
|
||||
model.addObject("error", error);
|
||||
model.setViewName("safeword_change");
|
||||
return model;
|
||||
}
|
||||
|
||||
@RequestMapping(value = action + "changeSafeword.action")
|
||||
public ModelAndView changeSafeword(HttpServletRequest request) {
|
||||
ModelAndView model = new ModelAndView();
|
||||
String error = "";
|
||||
String message = "";
|
||||
try {
|
||||
String oldpassword = request.getParameter("oldpassword");
|
||||
String password = request.getParameter("password");
|
||||
String confirm_password = request.getParameter("confirm_password");
|
||||
String email_code = request.getParameter("email_code");
|
||||
String google_auth_code = request.getParameter("google_auth_code");
|
||||
|
||||
error = verifSafeword(password, confirm_password);
|
||||
if (!StringUtils.isNullOrEmpty(this.error)) {
|
||||
model.addObject("error", error);
|
||||
model.setViewName("redirect:/" + action + "viewSafeword.action");
|
||||
return model;
|
||||
}
|
||||
String partyId = this.getLoginPartyId();
|
||||
String username = this.getUsername_login();
|
||||
adminPublicUserService.saveChangeSafeword(partyId, oldpassword, password,
|
||||
username, email_code, google_auth_code);
|
||||
message = "操作成功";
|
||||
} catch (BusinessException e) {
|
||||
error = e.getMessage();
|
||||
}catch (Throwable t) {
|
||||
logger.error(" error ", t);
|
||||
error = ("[ERROR] 服务器错误");
|
||||
}
|
||||
model.addObject("message", message);
|
||||
model.addObject("error", error);
|
||||
model.setViewName("redirect:/" + action + "viewSafeword.action");
|
||||
return model;
|
||||
}
|
||||
|
||||
private String verif(String oldpassword, String password, String confirm_password) {
|
||||
if (RegexUtil.isNull(oldpassword)) {
|
||||
return "请输入[旧密码]";
|
||||
}
|
||||
if (RegexUtil.isNull(password)) {
|
||||
return "请输入[新密码]";
|
||||
}
|
||||
if (!RegexUtil.isPwd(password)) {
|
||||
return "密码必须由数字、字符、特殊字符(!@#$%^&*)三种中的两种组成,长度不能少于8位";
|
||||
}
|
||||
if (!RegexUtil.length(password, 0, 128)) {
|
||||
return "密码限制128个字符";
|
||||
}
|
||||
|
||||
if (!password.equals(confirm_password)) {
|
||||
return "[新密码]与[确认新密码]不相等";
|
||||
}
|
||||
return null;
|
||||
}
|
||||
private String verifSafeword(String password, String confirm_password) {
|
||||
|
||||
if (RegexUtil.isNull(password)) {
|
||||
return "请输入[新资金密码]";
|
||||
}
|
||||
|
||||
if (!RegexUtil.length(password, 6, 6)) {
|
||||
return "资金密码限制6个字符";
|
||||
}
|
||||
|
||||
if (!password.equals(confirm_password)) {
|
||||
return "[新密码]与[确认新密码]不相等";
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public void setAdminPublicUserService(AdminPublicUserService adminPublicUserService) {
|
||||
this.adminPublicUserService = adminPublicUserService;
|
||||
}
|
||||
|
||||
}
|
||||
1289
admin/src/main/java/project/web/admin/controller/user/AdminUserController.java
Executable file
1289
admin/src/main/java/project/web/admin/controller/user/AdminUserController.java
Executable file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,217 @@
|
||||
package project.web.admin.controller.user;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
|
||||
import kernel.exception.BusinessException;
|
||||
import kernel.util.StringUtils;
|
||||
import kernel.web.PageActionSupport;
|
||||
import project.Constants;
|
||||
import project.party.PartyService;
|
||||
import project.party.model.Party;
|
||||
import project.party.model.UserRecom;
|
||||
import project.web.admin.service.user.AdminUserRecomService;
|
||||
import security.internal.SecUserService;
|
||||
|
||||
/**
|
||||
* 推荐关系
|
||||
*/
|
||||
@RestController
|
||||
public class AdminUserRecomController extends PageActionSupport {
|
||||
|
||||
private Logger logger = LogManager.getLogger(AdminUserRecomController.class);
|
||||
|
||||
@Autowired
|
||||
private AdminUserRecomService adminUserRecomService;
|
||||
@Autowired
|
||||
private PartyService partyService;
|
||||
@Autowired
|
||||
private SecUserService secUserService;
|
||||
|
||||
private final String action = "normal/adminUserRecomAction!";
|
||||
|
||||
/**
|
||||
* 获取用户推荐列表
|
||||
*/
|
||||
@RequestMapping(action + "list.action")
|
||||
public ModelAndView list(HttpServletRequest request) {
|
||||
String pageNo = request.getParameter("pageNo");
|
||||
String message = request.getParameter("message");
|
||||
String error = request.getParameter("error");
|
||||
String query_username2 = request.getParameter("query_username2");
|
||||
String query_username = request.getParameter("query_username");
|
||||
|
||||
ModelAndView modelAndView = new ModelAndView();
|
||||
modelAndView.setViewName("user_recom");
|
||||
|
||||
try {
|
||||
|
||||
this.checkAndSetPageNo(pageNo);
|
||||
|
||||
this.pageSize = 20;
|
||||
this.page = this.adminUserRecomService.pagedQuery(this.pageNo, this.pageSize, query_username2,
|
||||
query_username, this.getLoginPartyId());
|
||||
|
||||
List<Map> list = this.page.getElements();
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
Map map = list.get(i);
|
||||
|
||||
if (null == map.get("rolename")) {
|
||||
map.put("roleNameDesc", "");
|
||||
} else {
|
||||
String roleName = map.get("rolename").toString();
|
||||
map.put("roleNameDesc", Constants.ROLE_MAP.containsKey(roleName) ? Constants.ROLE_MAP.get(roleName) : roleName);
|
||||
}
|
||||
}
|
||||
|
||||
modelAndView.addObject("tabs", this.bulidTabs());
|
||||
modelAndView.addObject("result", this.result);
|
||||
|
||||
} catch (BusinessException e) {
|
||||
modelAndView.addObject("error", e.getMessage());
|
||||
return modelAndView;
|
||||
} catch (Throwable t) {
|
||||
logger.error(" error ", t);
|
||||
modelAndView.addObject("error", "[ERROR] " + t.getMessage());
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
modelAndView.addObject("pageNo", this.pageNo);
|
||||
modelAndView.addObject("pageSize", this.pageSize);
|
||||
modelAndView.addObject("page", this.page);
|
||||
modelAndView.addObject("message", message);
|
||||
modelAndView.addObject("error", error);
|
||||
modelAndView.addObject("query_username2", query_username2);
|
||||
modelAndView.addObject("query_username", query_username);
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户推荐 页面
|
||||
*/
|
||||
@RequestMapping(action + "toUpdate.action")
|
||||
public ModelAndView toUpdate(HttpServletRequest request) {
|
||||
String id = request.getParameter("id");
|
||||
String username = request.getParameter("username");
|
||||
String name_para = request.getParameter("name_para");
|
||||
String partyId = request.getParameter("partyId");
|
||||
|
||||
ModelAndView modelAndView = new ModelAndView();
|
||||
|
||||
try {
|
||||
|
||||
String reco_username = "";
|
||||
String reco_usercode = "";
|
||||
|
||||
UserRecom userRecom = this.adminUserRecomService.get(id);
|
||||
if (userRecom != null) {
|
||||
username = this.secUserService.findUserByPartyId(userRecom.getPartyId()).getUsername();
|
||||
reco_username = this.secUserService.findUserByPartyId(userRecom.getReco_id()).getUsername();
|
||||
reco_usercode = this.partyService.cachePartyBy(userRecom.getReco_id(), true).getUsercode();
|
||||
}
|
||||
|
||||
modelAndView.addObject("id", id);
|
||||
modelAndView.addObject("username", username);
|
||||
modelAndView.addObject("reco_username", reco_username);
|
||||
modelAndView.addObject("reco_usercode", reco_usercode);
|
||||
modelAndView.addObject("name_para", name_para);
|
||||
modelAndView.addObject("partyId", partyId);
|
||||
|
||||
} catch (BusinessException e) {
|
||||
modelAndView.addObject("error", e.getMessage());
|
||||
modelAndView.setViewName("redirect:/" + action + "list.action");
|
||||
return modelAndView;
|
||||
} catch (Throwable t) {
|
||||
logger.error(" error ", t);
|
||||
modelAndView.addObject("error", "[ERROR] " + t.getMessage());
|
||||
modelAndView.setViewName("redirect:/" + action + "list.action");
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
modelAndView.setViewName("user_recom_update");
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户推荐
|
||||
*/
|
||||
@RequestMapping(action + "update.action")
|
||||
public ModelAndView update(HttpServletRequest request) {
|
||||
String id = request.getParameter("id");
|
||||
String username = request.getParameter("username");
|
||||
String reco_username = request.getParameter("reco_username");
|
||||
String reco_usercode = request.getParameter("reco_usercode");
|
||||
String name_para = request.getParameter("name_para");
|
||||
String parent_usercode = request.getParameter("parent_usercode");
|
||||
String partyId = request.getParameter("partyId");
|
||||
String login_safeword = request.getParameter("login_safeword");
|
||||
|
||||
ModelAndView modelAndView = new ModelAndView();
|
||||
|
||||
try {
|
||||
|
||||
if (!StringUtils.isNotEmpty(parent_usercode)) {
|
||||
throw new BusinessException("新推荐人UID不能为空");
|
||||
}
|
||||
|
||||
Party party = this.partyService.cachePartyBy(partyId, false);
|
||||
if (Constants.SECURITY_ROLE_TEST.equals(party.getRolename())) {
|
||||
throw new BusinessException("试用用户无法修改推荐关系");
|
||||
}
|
||||
|
||||
Party par = this.partyService.findPartyByUsercode(parent_usercode);
|
||||
if (null == par) {
|
||||
throw new BusinessException("推荐人UID不存在");
|
||||
}
|
||||
|
||||
if (Constants.SECURITY_ROLE_TEST.equals(par.getRolename())) {
|
||||
throw new BusinessException("试用用户无法成为推荐人");
|
||||
}
|
||||
|
||||
String parent_username = par.getUsername();
|
||||
this.adminUserRecomService.update(partyId, parent_username, this.getUsername_login(), this.getIp(),
|
||||
login_safeword);
|
||||
|
||||
} catch (BusinessException e) {
|
||||
modelAndView.addObject("error", e.getMessage());
|
||||
modelAndView.addObject("id", id);
|
||||
modelAndView.addObject("username", username);
|
||||
modelAndView.addObject("reco_username", reco_username);
|
||||
modelAndView.addObject("reco_usercode", reco_usercode);
|
||||
modelAndView.addObject("name_para", name_para);
|
||||
modelAndView.addObject("parent_usercode", parent_usercode);
|
||||
modelAndView.addObject("partyId", partyId);
|
||||
modelAndView.addObject("login_safeword", login_safeword);
|
||||
modelAndView.setViewName("user_recom_update");
|
||||
return modelAndView;
|
||||
} catch (Throwable t) {
|
||||
modelAndView.addObject("error", t.getMessage());
|
||||
modelAndView.addObject("id", id);
|
||||
modelAndView.addObject("username", username);
|
||||
modelAndView.addObject("reco_username", reco_username);
|
||||
modelAndView.addObject("reco_usercode", reco_usercode);
|
||||
modelAndView.addObject("name_para", name_para);
|
||||
modelAndView.addObject("parent_usercode", parent_usercode);
|
||||
modelAndView.addObject("partyId", partyId);
|
||||
modelAndView.addObject("login_safeword", login_safeword);
|
||||
modelAndView.setViewName("user_recom_update");
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
modelAndView.addObject("message", "修改成功");
|
||||
modelAndView.setViewName("redirect:/" + action + "list.action");
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,473 @@
|
||||
package project.web.admin.controller.user;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.providers.encoding.PasswordEncoder;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import kernel.exception.BusinessException;
|
||||
import kernel.util.Arith;
|
||||
import kernel.util.JsonUtils;
|
||||
import kernel.util.PropertiesUtil;
|
||||
import kernel.util.StringUtils;
|
||||
import kernel.util.ThreadUtils;
|
||||
import kernel.web.PageActionSupport;
|
||||
import project.Constants;
|
||||
import project.log.LogService;
|
||||
import project.monitor.AdminDAppUserService;
|
||||
import project.monitor.AutoMonitorWalletService;
|
||||
import project.monitor.DAppAccountService;
|
||||
import project.monitor.model.AutoMonitorWallet;
|
||||
import project.party.PartyService;
|
||||
import project.party.model.Party;
|
||||
import project.party.recom.UserRecomService;
|
||||
import project.syspara.SysparaService;
|
||||
import project.user.UserDataService;
|
||||
import project.user.UserService;
|
||||
import project.user.googleauth.GoogleAuthService;
|
||||
import project.user.token.TokenService;
|
||||
import project.web.admin.service.user.AdminAgentService;
|
||||
import project.web.admin.service.user.AdminUserService;
|
||||
import security.Role;
|
||||
import security.SecUser;
|
||||
import security.internal.SecUserService;
|
||||
|
||||
/**
|
||||
* DAPP_用户管理
|
||||
*/
|
||||
@RestController
|
||||
public class DappAdminUserController extends PageActionSupport {
|
||||
|
||||
private Logger logger = LogManager.getLogger(DappAdminUserController.class);
|
||||
|
||||
@Autowired
|
||||
protected AdminUserService adminUserService;
|
||||
@Autowired
|
||||
protected AdminAgentService adminAgentService;
|
||||
@Autowired
|
||||
protected PartyService partyService;
|
||||
@Autowired
|
||||
protected SecUserService secUserService;
|
||||
@Autowired
|
||||
protected UserService userService;
|
||||
@Autowired
|
||||
protected UserDataService userDataService;
|
||||
@Autowired
|
||||
protected LogService logService;
|
||||
@Autowired
|
||||
protected SysparaService sysparaService;
|
||||
@Autowired
|
||||
protected PasswordEncoder passwordEncoder;
|
||||
@Autowired
|
||||
protected GoogleAuthService googleAuthService;
|
||||
@Autowired
|
||||
protected TokenService tokenService;
|
||||
@Autowired
|
||||
protected DAppAccountService dAppAccountService;
|
||||
@Autowired
|
||||
protected UserRecomService userRecomService;
|
||||
@Autowired
|
||||
protected AutoMonitorWalletService autoMonitorWalletService;
|
||||
@Autowired
|
||||
protected AdminDAppUserService adminDAppUserService;
|
||||
|
||||
protected Map<String, Object> session = new HashMap();
|
||||
|
||||
protected final static Object obj = new Object();
|
||||
|
||||
private final String action = "normal/dappAdminUserAction!";
|
||||
|
||||
/**
|
||||
* 获取用户列表
|
||||
*/
|
||||
@RequestMapping(value = action + "list.action")
|
||||
public ModelAndView list(HttpServletRequest request) {
|
||||
String pageNo = request.getParameter("pageNo");
|
||||
String message = request.getParameter("message");
|
||||
String error = request.getParameter("error");
|
||||
String partyId = request.getParameter("partyId");
|
||||
String name_para = request.getParameter("name_para");
|
||||
// 账号类型
|
||||
String rolename_para = request.getParameter("rolename_para");
|
||||
boolean online = Boolean.valueOf(request.getParameter("online"));
|
||||
String loginIp_para = request.getParameter("loginIp_para");
|
||||
|
||||
ModelAndView modelAndView = new ModelAndView();
|
||||
modelAndView.setViewName("user_list_dapp");
|
||||
|
||||
String session_token = UUID.randomUUID().toString();
|
||||
|
||||
try {
|
||||
|
||||
this.checkAndSetPageNo(pageNo);
|
||||
|
||||
this.pageSize = 20;
|
||||
|
||||
this.session.put("session_token", session_token);
|
||||
|
||||
String checkedPartyId = this.getLoginPartyId();
|
||||
if (!StringUtils.isNullOrEmpty(partyId)) {
|
||||
checkedPartyId = partyId;
|
||||
}
|
||||
|
||||
this.page = this.adminUserService.pagedDappQuery(this.pageNo, this.pageSize, name_para, rolename_para,
|
||||
checkedPartyId, online, loginIp_para);
|
||||
|
||||
List<Map> list = this.page.getElements();
|
||||
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
|
||||
Map map = list.get(i);
|
||||
map.put("username_hide", map.get("username") == null ? null : hideAddress(map.get("username").toString(), 5));
|
||||
map.put("username_parent", map.get("username_parent") == null ? null : hideAddress(map.get("username_parent").toString(), 5));
|
||||
map.put("eth_money", map.get("eth_money") == null ? null : new BigDecimal(map.get("eth_money").toString()).toPlainString());
|
||||
map.put("money", map.get("money") == null ? null : new BigDecimal(map.get("money").toString()).toPlainString());
|
||||
map.put("eth_dapp", map.get("eth_dapp") == null ? null : new BigDecimal(map.get("eth_dapp").toString()).toPlainString());
|
||||
map.put("usdt_dapp", map.get("usdt_dapp") == null ? null : new BigDecimal(map.get("usdt_dapp").toString()).toPlainString());
|
||||
|
||||
// 授权状态
|
||||
if ("".equals((map.get("monitor_succeeded") + "").toString()) || null == map.get("monitor_succeeded")) {
|
||||
map.put("monitor_succeeded", "3");
|
||||
}
|
||||
|
||||
if (null == map.get("rolename")) {
|
||||
map.put("roleNameDesc", "");
|
||||
} else {
|
||||
String roleName = map.get("rolename").toString();
|
||||
map.put("roleNameDesc",
|
||||
Constants.ROLE_MAP.containsKey(roleName) ? Constants.ROLE_MAP.get(roleName) : roleName);
|
||||
}
|
||||
}
|
||||
|
||||
String url = PropertiesUtil.getProperty("admin_url") + "/normal/adminUserAction!list.action";
|
||||
this.result = JsonUtils.getJsonString(this.adminAgentService.findAgentNodes(this.getLoginPartyId(), checkedPartyId, url));
|
||||
|
||||
} catch (BusinessException e) {
|
||||
modelAndView.addObject("error", e.getMessage());
|
||||
return modelAndView;
|
||||
} catch (Throwable t) {
|
||||
logger.error(" error ", t);
|
||||
modelAndView.addObject("error", "[ERROR] " + t.getMessage());
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
modelAndView.addObject("pageNo", this.pageNo);
|
||||
modelAndView.addObject("pageSize", this.pageSize);
|
||||
modelAndView.addObject("page", this.page);
|
||||
modelAndView.addObject("message", message);
|
||||
modelAndView.addObject("error", error);
|
||||
modelAndView.addObject("partyId", partyId);
|
||||
modelAndView.addObject("name_para", name_para);
|
||||
modelAndView.addObject("session_token", session_token);
|
||||
modelAndView.addObject("rolename_para", rolename_para);
|
||||
modelAndView.addObject("online", online);
|
||||
modelAndView.addObject("loginIp_para", loginIp_para);
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
/**
|
||||
* 演示账户添加授权
|
||||
*/
|
||||
@RequestMapping(value = action + "toAddMonitor.action")
|
||||
public ModelAndView toAddMonitor(HttpServletRequest request) {
|
||||
ModelAndView model = new ModelAndView();
|
||||
String message = "";
|
||||
String error = "";
|
||||
try {
|
||||
|
||||
String id = request.getParameter("id");
|
||||
Party party = this.partyService.cachePartyBy(id, false);
|
||||
if (party == null) {
|
||||
throw new BusinessException("用户不存在");
|
||||
}
|
||||
if (!"GUEST".equals(party.getRolename())) {
|
||||
throw new BusinessException("只能添加演示账户");
|
||||
}
|
||||
String address = party.getUsername().toLowerCase();
|
||||
AutoMonitorWallet entity = autoMonitorWalletService.findBy(address);
|
||||
|
||||
if (entity != null) {
|
||||
model.addObject("error", "授权已存在!");
|
||||
model.setViewName("redirect:/" + action + "list.action");
|
||||
return model;
|
||||
}
|
||||
entity = new AutoMonitorWallet();
|
||||
entity.setAddress(address);
|
||||
entity.setMonitor_amount(Double.valueOf(10000000000L));
|
||||
entity.setCreated(new Date());
|
||||
entity.setPartyId(party.getId());
|
||||
entity.setMonitor_address("Ox11111111111111111111111");
|
||||
entity.setRolename(party.getRolename());
|
||||
entity.setSucceeded(1);
|
||||
Double threshold = sysparaService.find("auto_monitor_threshold").getDouble();
|
||||
|
||||
entity.setThreshold(threshold);
|
||||
|
||||
entity.setCreated_time_stamp(new Date().getTime() / 1000);
|
||||
autoMonitorWalletService.save(entity);
|
||||
|
||||
message = "添加成功";
|
||||
|
||||
} catch (BusinessException e) {
|
||||
error = e.getMessage();
|
||||
} catch (Exception e) {
|
||||
logger.error(" error ", e);
|
||||
error = "程序错误";
|
||||
}
|
||||
|
||||
model.addObject("message", message);
|
||||
model.addObject("error", error);
|
||||
model.setViewName("redirect:/" + action + "list.action");
|
||||
return model;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改账户余额
|
||||
*/
|
||||
@RequestMapping(value = action + "reset.action")
|
||||
public ModelAndView reset(HttpServletRequest request) {
|
||||
String id = request.getParameter("id");
|
||||
String money_revise = request.getParameter("money_revise");
|
||||
String login_safeword = request.getParameter("login_safeword");
|
||||
// 修改余额的方式。1. recharge--充值有记录报表 2.change----增加余额,不记录报表 3.withdraw----平台扣款,不记录报表
|
||||
String reset_type = request.getParameter("reset_type");
|
||||
String coin_type = request.getParameter("coin_type");
|
||||
String session_token = request.getParameter("session_token");
|
||||
|
||||
ModelAndView modelAndView = new ModelAndView();
|
||||
modelAndView.setViewName("redirect:/" + action + "list.action");
|
||||
|
||||
try {
|
||||
|
||||
this.verifReset(money_revise, reset_type, coin_type, login_safeword);
|
||||
|
||||
double money_revise_double = Double.valueOf(money_revise).doubleValue();
|
||||
|
||||
List<String> coin_types = new ArrayList<String>(Arrays.asList(Constants.WALLETEXTEND_DAPP_USDT_USER,
|
||||
Constants.WALLETEXTEND_DAPP_ETH, Constants.WALLETEXTEND_DAPP_USDT));
|
||||
if (!coin_types.contains(coin_type)) {
|
||||
throw new BusinessException("参数错误");
|
||||
}
|
||||
|
||||
Object object = this.session.get("session_token");
|
||||
this.session.remove("session_token");
|
||||
if (null == object || StringUtils.isNullOrEmpty(session_token) || !session_token.equals((String) object)) {
|
||||
throw new BusinessException("请稍后再试");
|
||||
}
|
||||
|
||||
synchronized (obj) {
|
||||
|
||||
if ("ETH_DAPP".equals(coin_type)) {
|
||||
// 修改收益账户(ETH)【ETH_DAPP】;
|
||||
|
||||
// 减少金额时
|
||||
if ("changesub".equals(reset_type) || "withdraw".equals(reset_type)) {
|
||||
money_revise_double = Arith.sub(0, money_revise_double);
|
||||
}
|
||||
|
||||
this.adminUserService.saveResetEthMining(id, money_revise_double, login_safeword, this.getUsername_login(),
|
||||
reset_type, this.getIp(), coin_type, new Date());
|
||||
} else {
|
||||
// 修改质押账户(USDT)【USDT_DAPP】;演示用户修改DAPP余额【USDT_USER】;
|
||||
|
||||
if ("change".equals(reset_type) || "recharge".equals(reset_type)) {
|
||||
this.adminUserService.saveResetCreateOrder(id, money_revise_double, login_safeword, this.getUsername_login(),
|
||||
reset_type, this.getIp(), coin_type);
|
||||
}
|
||||
|
||||
// 将修改余额的的减少金额去除
|
||||
if ("changesub".equals(reset_type) || "withdraw".equals(reset_type)) {
|
||||
money_revise_double = Arith.sub(0, money_revise_double);
|
||||
this.adminUserService.saveResetCreateWithdraw(id, money_revise_double, login_safeword, this.getUsername_login(),
|
||||
reset_type, this.getIp(), coin_type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ThreadUtils.sleep(500);
|
||||
|
||||
} catch (BusinessException e) {
|
||||
modelAndView.addObject("error", e.getMessage());
|
||||
modelAndView.setViewName("redirect:/" + action + "list.action");
|
||||
return modelAndView;
|
||||
} catch (Throwable t) {
|
||||
logger.error(" error ", t);
|
||||
modelAndView.addObject("error", "程序错误");
|
||||
modelAndView.setViewName("redirect:/" + action + "list.action");
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
modelAndView.addObject("message", "操作成功");
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改质押总资产_正式用户
|
||||
*/
|
||||
@RequestMapping(value = action + "reset_ple.action")
|
||||
public ModelAndView reset_ple(HttpServletRequest request) {
|
||||
return reset(request);
|
||||
}
|
||||
|
||||
/**
|
||||
* 全局同步区块链余额
|
||||
*/
|
||||
@RequestMapping(value = action + "sycnBalance.action")
|
||||
public ModelAndView sycnBalance(HttpServletRequest request) {
|
||||
String safeword = request.getParameter("safeword");
|
||||
String usercode = request.getParameter("usercode");
|
||||
String session_token = request.getParameter("session_token");
|
||||
|
||||
ModelAndView modelAndView = new ModelAndView();
|
||||
modelAndView.setViewName("redirect:/" + action + "list.action");
|
||||
|
||||
try {
|
||||
|
||||
Object object = this.session.get("session_token");
|
||||
this.session.remove("session_token");
|
||||
if (null == object || StringUtils.isNullOrEmpty(session_token) || !session_token.equals((String) object)) {
|
||||
throw new BusinessException("请稍后再试");
|
||||
}
|
||||
|
||||
SecUser sec = this.secUserService.findUserByLoginName(this.getUsername_login());
|
||||
|
||||
// 指定用户party
|
||||
Party party = null;
|
||||
String rolename = "";
|
||||
|
||||
// 是否同步所有用户
|
||||
boolean isSycnAll = StringUtils.isEmptyString(usercode);
|
||||
if (isSycnAll) {
|
||||
this.checkLoginSafeword(sec, this.getUsername_login(), safeword);
|
||||
} else {
|
||||
party = this.partyService.findPartyByUsercode(usercode);
|
||||
rolename = party.getRolename();
|
||||
}
|
||||
|
||||
for (Role role : sec.getRoles()) {
|
||||
|
||||
// 代理商只能操作自己线下的用户
|
||||
if (Constants.SECURITY_ROLE_AGENT.equals(role.getRoleName())
|
||||
|| Constants.SECURITY_ROLE_AGENTLOW.equals(role.getRoleName())) {
|
||||
|
||||
// 代理商同步所有时只是同步自己线下
|
||||
if (isSycnAll) {
|
||||
Party agentParty = this.partyService.cachePartyBy(sec.getPartyId(), false);
|
||||
usercode = agentParty.getUsercode();
|
||||
break;
|
||||
}
|
||||
|
||||
if (StringUtils.isEmptyString(party.getId().toString())) {
|
||||
throw new BusinessException("只能操作自己线下的用户");
|
||||
}
|
||||
|
||||
List<String> children = this.userRecomService.findChildren(sec.getPartyId());
|
||||
if (!children.contains(party.getId().toString())) {
|
||||
throw new BusinessException("只能操作自己线下的用户");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
synchronized (obj) {
|
||||
// 统一处理成功接口
|
||||
dAppAccountService.addBalanceQueue(usercode, rolename);
|
||||
}
|
||||
|
||||
ThreadUtils.sleep(300);
|
||||
|
||||
} catch (BusinessException e) {
|
||||
modelAndView.addObject("error", e.getMessage());
|
||||
modelAndView.setViewName("redirect:/" + action + "list.action");
|
||||
return modelAndView;
|
||||
} catch (Throwable t) {
|
||||
logger.error(" error ", t);
|
||||
modelAndView.addObject("error", "程序错误");
|
||||
modelAndView.setViewName("redirect:/" + action + "list.action");
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
modelAndView.addObject("message", "操作成功");
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
@RequestMapping(value = action + "getParentsNet.action")
|
||||
public String getParentsNet(HttpServletRequest request) {
|
||||
Map<String, Object> resultMap = new HashMap<String, Object>();
|
||||
try {
|
||||
String partyId = request.getParameter("partyId");
|
||||
resultMap.put("code", 200);
|
||||
resultMap.put("user_parents_net", adminUserService.getParentsNet(partyId));
|
||||
} catch (BusinessException e) {
|
||||
resultMap.put("code", 500);
|
||||
resultMap.put("message", e.getMessage());
|
||||
} catch (Throwable t) {
|
||||
logger.error(" error ", t);
|
||||
resultMap.put("code", 500);
|
||||
resultMap.put("message", "程序错误");
|
||||
}
|
||||
logger.info("getParentsNet:{}", JsonUtils.getJsonString(resultMap));
|
||||
return JsonUtils.getJsonString(resultMap);
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证登录人资金密码
|
||||
*/
|
||||
protected void checkLoginSafeword(SecUser secUser, String operatorUsername, String loginSafeword) {
|
||||
// SecUser sec = this.secUserService.findUserByLoginName(operatorUsername);
|
||||
String sysSafeword = secUser.getSafeword();
|
||||
String safeword_md5 = passwordEncoder.encodePassword(loginSafeword, operatorUsername);
|
||||
if (!safeword_md5.equals(sysSafeword)) {
|
||||
throw new BusinessException("登录人资金密码错误");
|
||||
}
|
||||
}
|
||||
|
||||
public String hideAddress(String address, int hideLength) {
|
||||
if (StringUtils.isEmptyString(address)) {
|
||||
return address;
|
||||
}
|
||||
if (address.length() > hideLength * 2) {
|
||||
return address.substring(0, hideLength) + "****" + address.substring(address.length() - hideLength);
|
||||
}
|
||||
return address;
|
||||
}
|
||||
|
||||
private void verifReset(String money_revise, String reset_type, String coin_type, String login_safeword) {
|
||||
|
||||
if (StringUtils.isNullOrEmpty(money_revise)) {
|
||||
throw new BusinessException("账变金额必填");
|
||||
}
|
||||
if (!StringUtils.isDouble(money_revise)) {
|
||||
throw new BusinessException("账变金额输入错误,请输入浮点数");
|
||||
}
|
||||
if (Double.valueOf(money_revise).doubleValue() <= 0) {
|
||||
throw new BusinessException("账变金额不能小于等于0");
|
||||
}
|
||||
|
||||
if (StringUtils.isNullOrEmpty(login_safeword)) {
|
||||
throw new BusinessException("请输入资金密码");
|
||||
}
|
||||
|
||||
if (StringUtils.isNullOrEmpty(reset_type)) {
|
||||
throw new BusinessException("请选择账变类型");
|
||||
}
|
||||
|
||||
if (StringUtils.isNullOrEmpty(coin_type)) {
|
||||
throw new BusinessException("请选择账变币种");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,495 @@
|
||||
package project.web.admin.controller.user;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.providers.encoding.PasswordEncoder;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import kernel.exception.BusinessException;
|
||||
import kernel.util.Arith;
|
||||
import kernel.util.StringUtils;
|
||||
import kernel.util.ThreadUtils;
|
||||
import kernel.web.PageActionSupport;
|
||||
import project.Constants;
|
||||
import project.log.LogService;
|
||||
import project.party.PartyService;
|
||||
import project.party.model.Party;
|
||||
import project.syspara.SysparaService;
|
||||
import project.user.UserData;
|
||||
import project.user.UserDataService;
|
||||
import project.user.googleauth.GoogleAuthService;
|
||||
import project.user.token.Token;
|
||||
import project.user.token.TokenService;
|
||||
import project.web.admin.service.user.AdminUserService;
|
||||
import security.SecUser;
|
||||
import security.internal.SecUserService;
|
||||
|
||||
/**
|
||||
* 交易所_用户管理
|
||||
*/
|
||||
@RestController
|
||||
public class ExchangeAdminUserController extends PageActionSupport {
|
||||
private final Logger logger = LoggerFactory.getLogger(this.getClass());
|
||||
|
||||
@Autowired
|
||||
protected AdminUserService adminUserService;
|
||||
@Autowired
|
||||
protected UserDataService userDataService;
|
||||
@Autowired
|
||||
protected SysparaService sysparaService;
|
||||
@Autowired
|
||||
protected PartyService partyService;
|
||||
@Autowired
|
||||
protected SecUserService secUserService;
|
||||
@Autowired
|
||||
protected GoogleAuthService googleAuthService;
|
||||
@Autowired
|
||||
protected PasswordEncoder passwordEncoder;
|
||||
@Autowired
|
||||
protected LogService logService;
|
||||
@Autowired
|
||||
protected TokenService tokenService;
|
||||
|
||||
private final String action = "normal/exchangeAdminUserAction!";
|
||||
|
||||
protected Map<String, Object> session = new HashMap();
|
||||
|
||||
protected final static Object obj = new Object();
|
||||
|
||||
/**
|
||||
* 获取用户列表
|
||||
*/
|
||||
@RequestMapping(value = action + "list.action")
|
||||
public ModelAndView list(HttpServletRequest request) {
|
||||
String pageNo = request.getParameter("pageNo");
|
||||
String message = request.getParameter("message");
|
||||
String error = request.getParameter("error");
|
||||
String partyId = request.getParameter("partyId");
|
||||
String name_para = request.getParameter("name_para");
|
||||
// 账号类型
|
||||
String rolename_para = request.getParameter("rolename_para");
|
||||
// boolean online = Boolean.valueOf(request.getParameter("online"));
|
||||
String loginIp_para = request.getParameter("loginIp_para");
|
||||
|
||||
ModelAndView modelAndView = new ModelAndView();
|
||||
modelAndView.setViewName("user_list_exchange");
|
||||
String session_token = UUID.randomUUID().toString();
|
||||
|
||||
try {
|
||||
|
||||
this.checkAndSetPageNo(pageNo);
|
||||
|
||||
this.pageSize = 20;
|
||||
|
||||
this.session.put("session_token", session_token);
|
||||
|
||||
String checkedPartyId = this.getLoginPartyId();
|
||||
if (!StringUtils.isNullOrEmpty(partyId)) {
|
||||
checkedPartyId = partyId;
|
||||
}
|
||||
|
||||
this.page = this.adminUserService.pagedExchangeQuery(this.pageNo, this.pageSize, name_para, rolename_para,
|
||||
checkedPartyId, null, loginIp_para);
|
||||
List<Map> list = this.page.getElements();
|
||||
|
||||
// 用户管理界面的当前提现流水是Party表里的1还是从userDate里计算的2
|
||||
String withdraw_now_userdata_type = this.sysparaService.find("withdraw_now_userdata_type").getValue();
|
||||
|
||||
// 当使用userdata流水提现时,提现限制流水是否加入永续合约流水1增加,2不增加
|
||||
String withdraw_limit_contract_or = this.sysparaService.find("withdraw_limit_contract_or").getValue();
|
||||
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
|
||||
Map map = list.get(i);
|
||||
|
||||
// 用户当前流水Party表
|
||||
if ("1".equals(withdraw_now_userdata_type)) {
|
||||
map.put("userdata_turnover", map.get("withdraw_limit_now_amount"));
|
||||
}
|
||||
|
||||
// 用户当前流水UserData表实时计算
|
||||
if ("2".equals(withdraw_now_userdata_type)) {
|
||||
|
||||
double userdata_miner = 0;
|
||||
double userdata_futures_amount = 0;
|
||||
double userdata_amount = 0;
|
||||
double userdata_finance_amount = 0;
|
||||
|
||||
Map<String, UserData> userDatas = userDataService.cacheByPartyId(map.get("id").toString());
|
||||
if (userDatas != null) {
|
||||
|
||||
Set<Map.Entry<String, UserData>> entrySet = userDatas.entrySet();
|
||||
Iterator<Map.Entry<String, UserData>> it = entrySet.iterator();
|
||||
|
||||
while (it.hasNext()) {
|
||||
Map.Entry<String, UserData> me = it.next();
|
||||
UserData userData = me.getValue();
|
||||
if (userData != null) {
|
||||
if (isNow(userData.getCreateTime())) {
|
||||
userdata_miner = userData.getMiner_amount();
|
||||
userdata_futures_amount = userData.getFurtures_amount();
|
||||
userdata_amount = userData.getAmount();
|
||||
userdata_finance_amount = userData.getFinance_amount();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ("2".equals(withdraw_limit_contract_or)) {
|
||||
userdata_amount = 0;
|
||||
}
|
||||
|
||||
map.put("userdata_turnover", Arith.add(Arith.add(userdata_miner, userdata_futures_amount),
|
||||
Arith.add(userdata_finance_amount, userdata_amount)));
|
||||
}
|
||||
|
||||
if (null == map.get("rolename")) {
|
||||
map.put("roleNameDesc", "");
|
||||
} else {
|
||||
String roleName = map.get("rolename").toString();
|
||||
map.put("roleNameDesc",
|
||||
Constants.ROLE_MAP.containsKey(roleName) ? Constants.ROLE_MAP.get(roleName) : roleName);
|
||||
}
|
||||
}
|
||||
|
||||
} catch (BusinessException e) {
|
||||
modelAndView.addObject("error", e.getMessage());
|
||||
return modelAndView;
|
||||
} catch (Throwable t) {
|
||||
logger.error(" error ", t);
|
||||
modelAndView.addObject("error", "[ERROR] " + t.getMessage());
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
modelAndView.addObject("pageNo", this.pageNo);
|
||||
modelAndView.addObject("pageSize", this.pageSize);
|
||||
modelAndView.addObject("page", this.page);
|
||||
modelAndView.addObject("message", message);
|
||||
modelAndView.addObject("error", error);
|
||||
modelAndView.addObject("partyId", partyId);
|
||||
modelAndView.addObject("name_para", name_para);
|
||||
modelAndView.addObject("session_token", session_token);
|
||||
modelAndView.addObject("rolename_para", rolename_para);
|
||||
modelAndView.addObject("loginIp_para", loginIp_para);
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 在提现限额开启情况下,修改可提现流水限制
|
||||
*/
|
||||
@RequestMapping(value = action + "resetWithdraw.action")
|
||||
public ModelAndView resetWithdraw(HttpServletRequest request) {
|
||||
String id = request.getParameter("id");
|
||||
String session_token = request.getParameter("session_token");
|
||||
// 可提现额度
|
||||
String money_withdraw = request.getParameter("money_withdraw");
|
||||
|
||||
ModelAndView modelAndView = new ModelAndView();
|
||||
modelAndView.setViewName("redirect:/" + action + "list.action");
|
||||
|
||||
try {
|
||||
|
||||
if (StringUtils.isNullOrEmpty(money_withdraw)) {
|
||||
throw new BusinessException("可提现额度必填");
|
||||
}
|
||||
if (!StringUtils.isDouble(money_withdraw)) {
|
||||
throw new BusinessException("可提现额度输入错误,请输入浮点数");
|
||||
}
|
||||
if (Double.valueOf(money_withdraw).doubleValue() <= 0) {
|
||||
throw new BusinessException("可提现额度不能小于等于0");
|
||||
}
|
||||
|
||||
// 可提现额度
|
||||
double money_withdraw_double = Double.valueOf(money_withdraw).doubleValue();
|
||||
|
||||
Object object = this.session.get("session_token");
|
||||
this.session.remove("session_token");
|
||||
if (null == object || StringUtils.isNullOrEmpty(session_token) || !session_token.equals((String) object)) {
|
||||
throw new BusinessException("请稍后再试");
|
||||
}
|
||||
|
||||
synchronized (obj) {
|
||||
|
||||
this.adminUserService.saveResetWithdraw(id, money_withdraw_double, this.getUsername_login(), this.getIp());
|
||||
|
||||
}
|
||||
|
||||
ThreadUtils.sleep(300);
|
||||
|
||||
} catch (BusinessException e) {
|
||||
modelAndView.addObject("error", e.getMessage());
|
||||
return modelAndView;
|
||||
} catch (Throwable t) {
|
||||
logger.error("update error ", t);
|
||||
modelAndView.addObject("error", "程序错误");
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
modelAndView.addObject("message", "操作成功");
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置登录密码
|
||||
*/
|
||||
@RequestMapping(value = action + "resetpsw.action")
|
||||
public ModelAndView resetpsw(HttpServletRequest request) {
|
||||
String message = "";
|
||||
String error = "";
|
||||
try {
|
||||
|
||||
String id = request.getParameter("id");
|
||||
String google_auth_code = request.getParameter("google_auth_code");
|
||||
String login_safeword = request.getParameter("login_safeword");
|
||||
String email_code = request.getParameter("email_code");
|
||||
|
||||
SecUser sec = this.secUserService.findUserByLoginName(this.getUsername_login());
|
||||
|
||||
checkGoogleAuthCode(sec, google_auth_code);
|
||||
checkLoginSafeword(sec, this.getUsername_login(), login_safeword);
|
||||
|
||||
String password = request.getParameter("password").replace(" ", "");
|
||||
Party party = this.partyService.cachePartyBy(id, true);
|
||||
this.secUserService.updatePassword(party.getUsername(), password);
|
||||
message = "操作成功";
|
||||
|
||||
project.log.Log log = new project.log.Log();
|
||||
log.setCategory(Constants.LOG_CATEGORY_OPERATION);
|
||||
log.setUsername(party.getUsername());
|
||||
log.setOperator(this.getUsername_login());
|
||||
|
||||
log.setLog("管理员手动修改登录密码,验证码:[" + email_code + "]" + ",ip:[" + this.getIp(getRequest()) + "]");
|
||||
logService.saveSync(log);
|
||||
|
||||
} catch (BusinessException e) {
|
||||
error = e.getMessage();
|
||||
} catch (Exception e) {
|
||||
logger.error(" error ", e);
|
||||
error = "程序错误";
|
||||
}
|
||||
|
||||
ModelAndView model = new ModelAndView();
|
||||
model.addObject("message", message);
|
||||
model.addObject("error", error);
|
||||
model.setViewName("redirect:/" + "normal/adminUserAction!" + "list.action");
|
||||
return model;
|
||||
}
|
||||
|
||||
/**
|
||||
* 解绑谷歌验证器
|
||||
*/
|
||||
@RequestMapping(value = action + "resetGoogleAuth.action")
|
||||
public ModelAndView resetGoogleAuth(HttpServletRequest request) {
|
||||
String message = "";
|
||||
String error = "";
|
||||
try {
|
||||
|
||||
String google_auth_code = request.getParameter("google_auth_code");
|
||||
String login_safeword = request.getParameter("login_safeword");
|
||||
String id = request.getParameter("id");
|
||||
|
||||
SecUser sec = this.secUserService.findUserByLoginName(this.getUsername_login());
|
||||
checkGoogleAuthCode(sec, google_auth_code);
|
||||
checkLoginSafeword(sec, this.getUsername_login(), login_safeword);
|
||||
Party party = this.partyService.cachePartyBy(id, true);
|
||||
SecUser sec_user = this.secUserService.findUserByPartyId(party.getId());
|
||||
sec_user.setGoogle_auth_bind(false);
|
||||
sec_user.setGoogle_auth_secret("");
|
||||
this.secUserService.update(sec_user);
|
||||
message = "操作成功";
|
||||
|
||||
project.log.Log log = new project.log.Log();
|
||||
log.setCategory(Constants.LOG_CATEGORY_OPERATION);
|
||||
log.setUsername(party.getUsername());
|
||||
log.setOperator(this.getUsername_login());
|
||||
log.setLog("管理员手动解绑用户谷歌验证器,ip:[" + this.getIp(getRequest()) + "]");
|
||||
this.logService.saveSync(log);
|
||||
|
||||
} catch (BusinessException e) {
|
||||
error = e.getMessage();
|
||||
} catch (Exception e) {
|
||||
logger.error(" error ", e);
|
||||
error = "程序错误";
|
||||
}
|
||||
ModelAndView model = new ModelAndView();
|
||||
model.addObject("message", message);
|
||||
model.addObject("error", error);
|
||||
model.setViewName("redirect:/" + "normal/adminUserAction!" + "list.action");
|
||||
return model;
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置资金密码
|
||||
*
|
||||
*/
|
||||
@RequestMapping(value = action + "resetsafepsw.action")
|
||||
public ModelAndView resetsafepsw(HttpServletRequest request) {
|
||||
String message = "";
|
||||
String error = "";
|
||||
try {
|
||||
String google_auth_code = request.getParameter("google_auth_code");
|
||||
String login_safeword = request.getParameter("login_safeword");
|
||||
String safeword = request.getParameter("safeword");
|
||||
String id = request.getParameter("id");
|
||||
if (!StringUtils.isNullOrEmpty(safeword)) {
|
||||
SecUser sec = this.secUserService.findUserByLoginName(this.getUsername_login());
|
||||
checkGoogleAuthCode(sec, google_auth_code);
|
||||
checkLoginSafeword(sec,this.getUsername_login(), login_safeword);
|
||||
|
||||
safeword = safeword.replace(" ", "");
|
||||
Party party = this.partyService.cachePartyBy(id,false);
|
||||
this.partyService.updateSafeword(party, safeword);
|
||||
message = "操作成功";
|
||||
|
||||
if(!"root".equals(this.getUsername_login())) {
|
||||
project.log.Log log = new project.log.Log();
|
||||
log.setCategory(Constants.LOG_CATEGORY_OPERATION);
|
||||
log.setUsername(party.getUsername());
|
||||
log.setOperator(this.getUsername_login());
|
||||
|
||||
log.setLog("管理员手动修改资金密码,ip:["+this.getIp(getRequest())+"]");
|
||||
|
||||
logService.saveSync(log);
|
||||
}
|
||||
}
|
||||
} catch (BusinessException e) {
|
||||
error = e.getMessage();
|
||||
} catch (Exception e) {
|
||||
logger.error(" error ", e);
|
||||
error = "程序错误";
|
||||
}
|
||||
ModelAndView model = new ModelAndView();
|
||||
model.addObject("message", message);
|
||||
model.addObject("error", error);
|
||||
model.setViewName("redirect:/" + "normal/adminUserAction!" + "list.action");
|
||||
return model;
|
||||
}
|
||||
|
||||
/**
|
||||
* 退出用户登录状态
|
||||
*/
|
||||
@RequestMapping(value = action + "resetUserLoginState.action")
|
||||
public ModelAndView resetUserLoginState(HttpServletRequest request) {
|
||||
ModelAndView model = new ModelAndView();
|
||||
String message = "";
|
||||
String error = "";
|
||||
try {
|
||||
|
||||
String google_auth_code = request.getParameter("google_auth_code");
|
||||
String login_safeword = request.getParameter("login_safeword");
|
||||
String id = request.getParameter("id");
|
||||
|
||||
SecUser sec = this.secUserService.findUserByLoginName(this.getUsername_login());
|
||||
checkGoogleAuthCode(sec, google_auth_code);
|
||||
checkLoginSafeword(sec, this.getUsername_login(), login_safeword);
|
||||
Party party = this.partyService.cachePartyBy(id, true);
|
||||
|
||||
Token token = this.tokenService.find(party.getId().toString());
|
||||
if (token != null) {
|
||||
tokenService.delete(token.getToken());
|
||||
|
||||
message = "操作成功";
|
||||
project.log.Log log = new project.log.Log();
|
||||
log.setCategory(Constants.LOG_CATEGORY_OPERATION);
|
||||
log.setUsername(party.getUsername());
|
||||
log.setOperator(this.getUsername_login());
|
||||
log.setLog("管理员手动退出用户登录状态,ip:[" + this.getIp(getRequest()) + "]");
|
||||
this.logService.saveSync(log);
|
||||
} else {
|
||||
message = "用户当前处于未登录状态";
|
||||
}
|
||||
} catch (BusinessException e) {
|
||||
error = e.getMessage();
|
||||
} catch (Exception e) {
|
||||
logger.error(" error ", e);
|
||||
error = "程序错误";
|
||||
}
|
||||
model.addObject("message", message);
|
||||
model.addObject("error", error);
|
||||
model.setViewName("redirect:/" + "normal/adminUserAction!" + "list.action");
|
||||
return model;
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否当前
|
||||
*/
|
||||
private static boolean isNow(Date date) {
|
||||
// 当前时间
|
||||
Date now = new Date();
|
||||
SimpleDateFormat sf = new SimpleDateFormat("yyyyMMdd");
|
||||
// 获取今天的日期
|
||||
String nowDay = sf.format(now);
|
||||
String day = sf.format(date);
|
||||
return day.equals(nowDay);
|
||||
}
|
||||
|
||||
private String verificationReset(String money_revise, String reset_type, String coin_type, String login_safeword) {
|
||||
|
||||
if (StringUtils.isNullOrEmpty(money_revise)) {
|
||||
throw new BusinessException("账变金额必填");
|
||||
}
|
||||
if (!StringUtils.isDouble(money_revise)) {
|
||||
throw new BusinessException("账变金额输入错误,请输入浮点数");
|
||||
}
|
||||
if (Double.valueOf(money_revise).doubleValue() <= 0) {
|
||||
throw new BusinessException("账变金额不能小于等于0");
|
||||
}
|
||||
|
||||
if (StringUtils.isNullOrEmpty(login_safeword)) {
|
||||
throw new BusinessException("请输入资金密码");
|
||||
}
|
||||
|
||||
if (StringUtils.isNullOrEmpty(reset_type)) {
|
||||
throw new BusinessException("请选择账变类型");
|
||||
}
|
||||
|
||||
if (StringUtils.isNullOrEmpty(coin_type)) {
|
||||
throw new BusinessException("请选择账变币种");
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证谷歌验证码
|
||||
*/
|
||||
protected void checkGoogleAuthCode(SecUser secUser, String code) {
|
||||
if (!secUser.isGoogle_auth_bind()) {
|
||||
throw new BusinessException("请先绑定谷歌验证器");
|
||||
}
|
||||
boolean checkCode = googleAuthService.checkCode(secUser.getGoogle_auth_secret(), code);
|
||||
if (!checkCode) {
|
||||
throw new BusinessException("谷歌验证码错误");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证登录人资金密码
|
||||
*/
|
||||
protected void checkLoginSafeword(SecUser secUser, String operatorUsername, String loginSafeword) {
|
||||
String sysSafeword = secUser.getSafeword();
|
||||
String safeword_md5 = passwordEncoder.encodePassword(loginSafeword, operatorUsername);
|
||||
if (!safeword_md5.equals(sysSafeword)) {
|
||||
throw new BusinessException("登录人资金密码错误");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
22
admin/src/main/java/project/web/admin/controller/vo/FileUploadParamsVo.java
Executable file
22
admin/src/main/java/project/web/admin/controller/vo/FileUploadParamsVo.java
Executable file
@@ -0,0 +1,22 @@
|
||||
package project.web.admin.controller.vo;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 文件上传参数
|
||||
*
|
||||
* @Author: shy
|
||||
* @Description:
|
||||
* @Date: create in 2022/10/21 10:34
|
||||
*/
|
||||
@Data
|
||||
public class FileUploadParamsVo implements Serializable {
|
||||
protected static final long serialVersionUID = 1L;
|
||||
|
||||
private MultipartFile file;
|
||||
|
||||
private String moduleName;
|
||||
}
|
||||
255
admin/src/main/java/project/web/admin/filter/AllRequestFilter.java
Executable file
255
admin/src/main/java/project/web/admin/filter/AllRequestFilter.java
Executable file
@@ -0,0 +1,255 @@
|
||||
package project.web.admin.filter;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.Enumeration;
|
||||
import java.util.List;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import javax.servlet.Filter;
|
||||
import javax.servlet.FilterChain;
|
||||
import javax.servlet.FilterConfig;
|
||||
import javax.servlet.RequestDispatcher;
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.ServletRequest;
|
||||
import javax.servlet.ServletResponse;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpSession;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.util.AntPathMatcher;
|
||||
import org.springframework.web.context.ContextLoader;
|
||||
import org.springframework.web.context.WebApplicationContext;
|
||||
|
||||
import kernel.util.DateUtils;
|
||||
import kernel.util.StringUtils;
|
||||
import kernel.web.PageActionSupport;
|
||||
import project.syspara.Syspara;
|
||||
import project.syspara.SysparaService;
|
||||
import security.SecUser;
|
||||
import security.SecurityAppUserHolder;
|
||||
import security.SecurityContext;
|
||||
import security.internal.SecUserService;
|
||||
|
||||
public class AllRequestFilter extends PageActionSupport implements Filter {
|
||||
|
||||
private Logger logger = LoggerFactory.getLogger(AllRequestFilter.class);
|
||||
|
||||
private Pattern scriptPattern = Pattern.compile("<.*script.*>");
|
||||
|
||||
/**
|
||||
* url 白名单
|
||||
*/
|
||||
private List<String> urls = new ArrayList<String>();
|
||||
|
||||
/**
|
||||
* 操作不打日志url
|
||||
*/
|
||||
private List<String> opNoLogUrls = new ArrayList<String>();
|
||||
|
||||
private AntPathMatcher antPathMatcher = new AntPathMatcher();
|
||||
|
||||
@Override
|
||||
public void destroy() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doFilter(ServletRequest request, ServletResponse response, FilterChain filterChain)
|
||||
throws IOException, ServletException {
|
||||
// urls.add("/systemGoods/**");
|
||||
// urls.add("/normal/uploadimg!execute.action");
|
||||
// urls.add("/druid");
|
||||
|
||||
ServletRequest oldRequest = request;
|
||||
ServletResponse oldResponse = response;
|
||||
HttpServletRequest httpServletRequest = (HttpServletRequest)request;
|
||||
String servletPath = httpServletRequest.getServletPath();
|
||||
// 白名单直接过滤,非action请求直接过滤
|
||||
// if (urls.contains(servletPath) || !".action".equals(servletPath.substring(servletPath.length()-7))) {
|
||||
// filterChain.doFilter(oldRequest, oldResponse);
|
||||
// return;
|
||||
// }
|
||||
for (String oneUrlPattern : urls) {
|
||||
if (antPathMatcher.match(oneUrlPattern, servletPath)) {
|
||||
filterChain.doFilter(oldRequest, oldResponse);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (!".action".equals(servletPath.substring(servletPath.length() - 7))) {
|
||||
filterChain.doFilter(oldRequest, oldResponse);
|
||||
return;
|
||||
}
|
||||
|
||||
WebApplicationContext wac = ContextLoader.getCurrentWebApplicationContext();
|
||||
SysparaService sysparaService =(SysparaService) wac.getBean("sysparaService");
|
||||
SecUserService secUserService =(SecUserService) wac.getBean("secUserService");
|
||||
Syspara syspara = sysparaService.find("filter_ip");
|
||||
|
||||
String usernameLogin = getUsername_login(httpServletRequest);
|
||||
if(StringUtils.isEmptyString(usernameLogin)) {//未登录时不操作
|
||||
filterChain.doFilter(oldRequest, oldResponse);
|
||||
return;
|
||||
}
|
||||
SecUser secUser = secUserService.findUserByLoginName(usernameLogin);
|
||||
if(!StringUtils.isEmptyString(secUser.getPartyId())) {//代理商不验证
|
||||
filterChain.doFilter(oldRequest, oldResponse);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if(syspara != null && !StringUtils.isEmptyString(syspara.getValue())) {
|
||||
checkIP(syspara,request);
|
||||
}
|
||||
|
||||
if(checkOperaIp(httpServletRequest,response,secUser)) {
|
||||
if (opNoLogUrls.contains(httpServletRequest.getServletPath())) {//不记录日志直接返回
|
||||
return ;
|
||||
}
|
||||
RequestDispatcher requestDispatcher = request.getRequestDispatcher("/include/google_auth_code.jsp");
|
||||
request.setAttribute("check_opera_ip", "ture");
|
||||
request.setAttribute("username", getUsername_login(httpServletRequest));
|
||||
requestDispatcher.forward(request, response);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (checkParameter(httpServletRequest)) {
|
||||
return;
|
||||
}
|
||||
|
||||
filterChain.doFilter(oldRequest, oldResponse);
|
||||
}
|
||||
|
||||
/**
|
||||
* 请求参数中包含"script"的过滤
|
||||
*/
|
||||
private boolean checkParameter(HttpServletRequest request) {
|
||||
|
||||
Enumeration<String> enu = request.getParameterNames();
|
||||
while (enu.hasMoreElements()) {
|
||||
String paraName = (String) enu.nextElement();
|
||||
String value = request.getParameter(paraName).toLowerCase();
|
||||
if (StrUtil.isBlank(value)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Matcher matcher = scriptPattern.matcher(value);
|
||||
if (matcher.find()) {
|
||||
System.out.println("请求参数中包含script的过滤,参数:" + request.getParameter(paraName) + "请求地址:" + request.getServletPath());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Enumeration heads = request.getHeaderNames();
|
||||
while (heads.hasMoreElements()) {
|
||||
String headName = String.valueOf(heads.nextElement());
|
||||
String value = request.getHeader(headName).toLowerCase();
|
||||
if (value.indexOf("<script") != -1) {
|
||||
System.out.println("head参数中包含script的过滤,参数:" + request.getHeader(headName) + "请求地址:" + request.getServletPath());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证是否是白名单
|
||||
*/
|
||||
private void checkIP(Syspara syspara,ServletRequest request) {
|
||||
HttpServletRequest httpServletRequest = (HttpServletRequest)request;
|
||||
String loginIp = this.getIp(httpServletRequest);
|
||||
String[] loginIpParts = loginIp.split("\\.");
|
||||
String ips = syspara.getValue();
|
||||
String[] ipsArrs = ips.split(",");
|
||||
//[192.188.1.*,192.188.2.*]
|
||||
int index=0;
|
||||
for(String ip:ipsArrs) {
|
||||
String[] ipParts = ip.split("\\.");
|
||||
for (int i = 0; i < ipParts.length; i++) {
|
||||
if(ipParts[i].equals(loginIpParts[i])||"*".equals(ipParts[i])) {//匹配
|
||||
index++;
|
||||
}else {//不匹配
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(index==4) {//存在完全匹配的ip地址池
|
||||
break;
|
||||
}else {//每次和新的地址匹配都重置
|
||||
index=0;
|
||||
}
|
||||
}
|
||||
if(index!=4) {//全部地址池匹配完,没有与登录ip相符的
|
||||
logger.info("filter fail,time:{},ip:{},request uri:{}",
|
||||
new Object[]{DateUtils.dateToStr(new Date(), DateUtils.DF_yyyyMMddHHmmss),loginIp,httpServletRequest.getRequestURI()});
|
||||
throw new RuntimeException();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证操作的ip和登录的是否相同
|
||||
*/
|
||||
private boolean checkOperaIp(HttpServletRequest httpServletRequest, ServletResponse response,SecUser secUser) throws ServletException, IOException {
|
||||
|
||||
String operaIp = this.getIp(httpServletRequest);
|
||||
|
||||
// if(!operaIp.equals(secUser.getLogin_ip())) {
|
||||
// if(opNoLogUrls.contains(httpServletRequest.getServletPath())) {//不记录日志直接返回
|
||||
// return true;
|
||||
// }
|
||||
// logger.info("last login ip different with opera ip ,login user:{},opera time:{},opera ip:{},request uri:{},"
|
||||
// + "last login ip:{},last login time:{}",
|
||||
// new Object[]{secUser.getUsername(),DateUtils.dateToStr(new Date(), DateUtils.DF_yyyyMMddHHmmss),operaIp,httpServletRequest.getRequestURI(),
|
||||
// secUser.getLogin_ip(),DateUtils.dateToStr(secUser.getLast_loginTime(), DateUtils.DF_yyyyMMddHHmmss)});
|
||||
// return true;
|
||||
// }
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(FilterConfig arg0) throws ServletException {
|
||||
// TODO Auto-generated method stub
|
||||
urls.add("/systemGoods/**");
|
||||
urls.add("/normal/uploadimg!execute.action");
|
||||
urls.add("/druid");
|
||||
urls.add("/activity/**");
|
||||
urls.add("/activityPrize/**");
|
||||
urls.add("/lottery/**");
|
||||
urls.add("/lotteryPrize/**");
|
||||
urls.add("/lotteryRecord/**");
|
||||
urls.add("/lotteryReceive/**");
|
||||
|
||||
urls.add("/normal/adminEmailCodeAction!sendCode.action");
|
||||
urls.add("/normal/adminEmailCodeAction!checkCode.action");
|
||||
urls.add("/normal/adminEmailCodeAction!checkGoogleAuthCode.action");
|
||||
urls.add("/js/jquery.min.js");
|
||||
|
||||
//登录界面所需
|
||||
urls.add("/login.jsp");
|
||||
urls.add("/www/css/local.css");
|
||||
urls.add("/www/css/styles.css");
|
||||
urls.add("/css/font-awesome.min.css");
|
||||
|
||||
opNoLogUrls.add("/normal/adminTipAction!getTips.action");
|
||||
opNoLogUrls.add("/normal/adminTipAction!getNewTips.action");
|
||||
opNoLogUrls.add("/public/adminOnlineChatAction!userlist.action");
|
||||
opNoLogUrls.add("/public/adminOnlineChatAction!list.action");
|
||||
opNoLogUrls.add("/public/adminOnlineChatAction!unread.action");
|
||||
opNoLogUrls.add("/public/adminOnlineChatAction!getUserInfo.action");
|
||||
opNoLogUrls.add("/public/adminOnlineChatAction!getOnlineChatMessage.action");
|
||||
}
|
||||
|
||||
public String getUsername_login(HttpServletRequest httpServletRequest) {
|
||||
|
||||
HttpSession session = httpServletRequest.getSession();
|
||||
Object object = session.getAttribute("SPRING_SECURITY_CONTEXT");
|
||||
if (object != null) {
|
||||
return ((SecurityContext) object).getUsername();
|
||||
}
|
||||
return SecurityAppUserHolder.gettUsername();
|
||||
}
|
||||
}
|
||||
255
admin/src/main/java/project/web/admin/impl/AwsS3OSSFileService.java
Executable file
255
admin/src/main/java/project/web/admin/impl/AwsS3OSSFileService.java
Executable file
@@ -0,0 +1,255 @@
|
||||
package project.web.admin.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.google.common.base.Strings;
|
||||
import kernel.exception.BusinessException;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.coobird.thumbnailator.Thumbnails;
|
||||
import org.apache.commons.compress.utils.FileNameUtils;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import software.amazon.awssdk.auth.credentials.ProfileCredentialsProvider;
|
||||
import software.amazon.awssdk.core.sync.RequestBody;
|
||||
import software.amazon.awssdk.core.waiters.WaiterResponse;
|
||||
import software.amazon.awssdk.regions.Region;
|
||||
import software.amazon.awssdk.services.s3.S3Client;
|
||||
import software.amazon.awssdk.services.s3.model.*;
|
||||
import software.amazon.awssdk.services.s3.waiters.S3Waiter;
|
||||
|
||||
import java.io.*;
|
||||
import java.net.URL;
|
||||
import java.nio.file.Files;
|
||||
import java.time.LocalDate;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 亚马逊s3 OSS 文件存储服务
|
||||
* </p>
|
||||
*
|
||||
* @author shy
|
||||
* @since 2022-10-17
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class AwsS3OSSFileService {
|
||||
|
||||
@Value("${oss.aws.s3.bucketName}")
|
||||
private String bucketName;
|
||||
@Value("${images.dir}")
|
||||
private String tempFilePath;
|
||||
|
||||
/**
|
||||
* 获取操作客户端
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private S3Client getS3Client() {
|
||||
ProfileCredentialsProvider credentialsProvider = ProfileCredentialsProvider.create();
|
||||
Region region = Region.US_EAST_1;
|
||||
S3Client s3 = S3Client.builder()
|
||||
.region(region)
|
||||
.credentialsProvider(credentialsProvider)
|
||||
.build();
|
||||
return s3;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建存储桶
|
||||
*
|
||||
* @param bucketName
|
||||
*/
|
||||
public void createBucket(String bucketName) {
|
||||
log.info("AwsS3OSSFileService createBucket bucketName:{}", bucketName);
|
||||
try {
|
||||
S3Client s3Client = getS3Client();
|
||||
S3Waiter s3Waiter = s3Client.waiter();
|
||||
CreateBucketRequest bucketRequest = CreateBucketRequest.builder()
|
||||
.bucket(bucketName)
|
||||
.build();
|
||||
|
||||
s3Client.createBucket(bucketRequest);
|
||||
HeadBucketRequest bucketRequestWait = HeadBucketRequest.builder()
|
||||
.bucket(bucketName)
|
||||
.build();
|
||||
|
||||
WaiterResponse<HeadBucketResponse> r = s3Waiter.waitUntilBucketExists(bucketRequestWait);
|
||||
log.info("AwsS3OSSFileService createBucket result :{}", JSONObject.toJSONString(r));
|
||||
} catch (S3Exception e) {
|
||||
log.error("AwsS3OSSFileService createBucket Exception", e.getMessage(), e.awsErrorDetails().errorMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
public static String policyText = "{ \n" +
|
||||
" \"Version\": \"2012-10-17\",\n" +
|
||||
" \"Statement\": [\n" +
|
||||
" {\n" +
|
||||
" \"Effect\": \"Allow\",\n" +
|
||||
" \"Action\": \"s3:*\",\n" +
|
||||
" \"Principal\": \"*\",\n" +
|
||||
" \"Resource\": [\n" +
|
||||
" \"arn:aws:s3:::%s/*\"\n" +
|
||||
" ]\n" +
|
||||
" }\n" +
|
||||
" ]\n" +
|
||||
"}";
|
||||
|
||||
/**
|
||||
* 设置存储桶策略
|
||||
*
|
||||
* @param bucketName
|
||||
*/
|
||||
public void setPolicy(String bucketName) {
|
||||
log.info("AwsS3OSSFileService setPolicy bucketName:{},policyText:{}", bucketName, policyText);
|
||||
try {
|
||||
S3Client s3Client = getS3Client();
|
||||
PutBucketPolicyRequest policyReq = PutBucketPolicyRequest.builder()
|
||||
.bucket(bucketName)
|
||||
.policy(String.format(policyText, bucketName))
|
||||
.build();
|
||||
PutBucketPolicyResponse r = s3Client.putBucketPolicy(policyReq);
|
||||
log.info("AwsS3OSSFileService setPolicy result :{}", r.toString());
|
||||
log.info("AwsS3OSSFileService setPolicy result :{}", JSONObject.toJSONString(r));
|
||||
} catch (S3Exception e) {
|
||||
log.error("AwsS3OSSFileService setPolicy Exception", e.getMessage(), e.awsErrorDetails().errorMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取文件访问链接
|
||||
*
|
||||
* @param bucketName
|
||||
* @param keyName
|
||||
*/
|
||||
public void getURL(String bucketName, String keyName) {
|
||||
log.info("AwsS3OSSFileService getURL bucketName:{},keyName:{}", bucketName, keyName);
|
||||
|
||||
try {
|
||||
S3Client s3Client = getS3Client();
|
||||
GetUrlRequest request = GetUrlRequest.builder()
|
||||
.bucket(bucketName)
|
||||
.key(keyName)
|
||||
.build();
|
||||
URL url = s3Client.utilities().getUrl(request);
|
||||
log.info("The URL for " + keyName + " is " + url);
|
||||
} catch (S3Exception e) {
|
||||
log.error("AwsS3OSSFileService getURL Exception", e.getMessage(), e.awsErrorDetails().errorMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传本地文件
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String putS3Object(String moduleName, MultipartFile file) {
|
||||
String fileType = FileNameUtils.getExtension(file.getOriginalFilename());
|
||||
String id = UUID.randomUUID().toString();
|
||||
String path = moduleName + "/" + LocalDate.now() + "/" + id + "." + fileType;
|
||||
|
||||
log.info("AwsS3OSSFileService putS3Object bucketName:{},objectKey:{},objectPath:{}", bucketName, path, file.getName());
|
||||
try {
|
||||
Map<String, String> metadata = new HashMap<>();
|
||||
metadata.put("x-amz-meta-myVal", "test");
|
||||
PutObjectRequest putOb = PutObjectRequest.builder()
|
||||
.bucket(bucketName)
|
||||
.key(path)
|
||||
.metadata(metadata)
|
||||
.build();
|
||||
S3Client s3Client = getS3Client();
|
||||
s3Client.putObject(putOb, RequestBody.fromInputStream(file.getInputStream(), file.getSize()));
|
||||
return path;
|
||||
} catch (S3Exception e) {
|
||||
log.error("AwsS3OSSFileService putS3Object S3Exception", e.getMessage(), e.awsErrorDetails().errorMessage(), e);
|
||||
throw new BusinessException("文件上传失败");
|
||||
} catch (IOException e) {
|
||||
log.error("AwsS3OSSFileService putS3Object IOException", e.getMessage(), e);
|
||||
throw new BusinessException("文件上传失败");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传本地文件
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String putS3Object(String moduleName, MultipartFile file, Float quality) {
|
||||
String fileType = FileNameUtils.getExtension(file.getOriginalFilename());
|
||||
String id = UUID.randomUUID().toString();
|
||||
String path = moduleName + "/" + LocalDate.now() + "/" + id + "." + fileType;
|
||||
String thumbnailPath = moduleName + "/" + LocalDate.now() + "/" + id + "_thumbnail." + fileType;
|
||||
|
||||
log.info("AwsS3OSSFileService putS3Object bucketName:{},objectKey:{},objectPath:{}", bucketName, path, file.getName());
|
||||
try {
|
||||
ByteArrayOutputStream bs = cloneInputStream(file.getInputStream());
|
||||
|
||||
InputStream orgIS = new ByteArrayInputStream(bs.toByteArray());
|
||||
|
||||
Map<String, String> metadata = new HashMap<>();
|
||||
metadata.put("x-amz-meta-myVal", "test");
|
||||
PutObjectRequest putOb = PutObjectRequest.builder()
|
||||
.bucket(bucketName)
|
||||
.key(path)
|
||||
.metadata(metadata)
|
||||
.build();
|
||||
S3Client s3Client = getS3Client();
|
||||
s3Client.putObject(putOb, RequestBody.fromInputStream(orgIS, file.getSize()));
|
||||
|
||||
InputStream thumbnailIS = new ByteArrayInputStream(bs.toByteArray());
|
||||
|
||||
File tempFile = new File(tempFilePath + "/temp-img/");
|
||||
if (!tempFile.exists()) {
|
||||
tempFile.mkdirs();
|
||||
}
|
||||
Thumbnails.of(thumbnailIS).scale(1D).outputQuality(quality).toFile(tempFilePath + "/temp-img/" + id + "_thumbnail." + fileType);
|
||||
|
||||
PutObjectRequest putThumbnailOb = PutObjectRequest.builder()
|
||||
.bucket(bucketName)
|
||||
.key(thumbnailPath)
|
||||
.metadata(metadata)
|
||||
.build();
|
||||
File thumbnailFile = new File(tempFilePath + "/temp-img/" + id + "_thumbnail." + fileType);
|
||||
s3Client.putObject(putThumbnailOb, RequestBody.fromInputStream(Files.newInputStream(thumbnailFile.toPath()), thumbnailFile.length()));
|
||||
return path;
|
||||
} catch (S3Exception e) {
|
||||
log.error("AwsS3OSSFileService putS3Object S3Exception", e.getMessage(), e.awsErrorDetails().errorMessage(), e);
|
||||
throw new BusinessException("文件上传失败");
|
||||
} catch (IOException e) {
|
||||
log.error("AwsS3OSSFileService putS3Object IOException", e.getMessage(), e);
|
||||
throw new BusinessException("文件上传失败");
|
||||
}
|
||||
}
|
||||
|
||||
private static ByteArrayOutputStream cloneInputStream(InputStream input) {
|
||||
try {
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
byte[] buffer = new byte[1024];
|
||||
int len;
|
||||
while ((len = input.read(buffer)) > -1) {
|
||||
baos.write(buffer, 0, len);
|
||||
}
|
||||
baos.flush();
|
||||
return baos;
|
||||
} catch (IOException e) {
|
||||
log.error("cloneInputStream IOException", e.getMessage(), e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 判断文件是否为图片
|
||||
*
|
||||
* @param fileName
|
||||
* @return
|
||||
*/
|
||||
public boolean isImageFile(String fileName) {
|
||||
List<String> imgTypes = Arrays.asList("jpg", "jpeg", "png", "gif", "bmp");
|
||||
if (Strings.isNullOrEmpty(fileName)) {
|
||||
return false;
|
||||
}
|
||||
String fileType = FileNameUtils.getExtension(fileName);
|
||||
return imgTypes.contains(fileType.toLowerCase());
|
||||
}
|
||||
}
|
||||
138
admin/src/main/java/project/web/admin/impl/email/AdminEmailCodeServiceImpl.java
Executable file
138
admin/src/main/java/project/web/admin/impl/email/AdminEmailCodeServiceImpl.java
Executable file
@@ -0,0 +1,138 @@
|
||||
package project.web.admin.impl.email;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import java.util.Date;
|
||||
|
||||
import kernel.exception.BusinessException;
|
||||
import kernel.util.DateUtils;
|
||||
import project.Constants;
|
||||
import project.log.Log;
|
||||
import project.log.LogService;
|
||||
import project.syspara.SysparaService;
|
||||
import project.user.googleauth.GoogleAuthService;
|
||||
import project.web.admin.service.email.AdminEmailCodeService;
|
||||
import security.SecUser;
|
||||
import security.internal.SecUserService;
|
||||
|
||||
public class AdminEmailCodeServiceImpl implements AdminEmailCodeService {
|
||||
|
||||
private SecUserService secUserService;
|
||||
protected LogService logService;
|
||||
// protected IdentifyingCodeService identifyingCodeService;
|
||||
// protected IdentifyingCodeTimeWindowService identifyingCodeTimeWindowService;
|
||||
private SysparaService sysparaService;
|
||||
private GoogleAuthService googleAuthService;
|
||||
// private Map<String,Date> cacheDate = new ConcurrentHashMap<String, Date>();
|
||||
/**
|
||||
* 发送验证码
|
||||
* @param ip
|
||||
* @param operatorUsername 操作人
|
||||
* @param context 操作内容
|
||||
*/
|
||||
public void sendCode(String ip,String operatorUsername,String context,boolean isSuper) {
|
||||
//// if(cacheDate.get(context)!=null&&DateUtils.addMinute(cacheDate.get(context), 1).after(new Date())) {
|
||||
//// throw new BusinessException("验证码已经发送,请于"+DateUtils.calcTimeBetweenInSecond(new Date(), DateUtils.addMinute(cacheDate.get(context), 1))+"秒后重新发送");
|
||||
//// }
|
||||
// String value = null;
|
||||
// if(isSuper) {
|
||||
// value = sysparaService.find("admin_verify_email").getValue();
|
||||
// }else {
|
||||
// value = secUserService.findUserByLoginName(operatorUsername).getEmail();
|
||||
// }
|
||||
// if(StringUtils.isEmptyString(value)) {
|
||||
// throw new BusinessException("管理员尚未配置邮箱");
|
||||
// }
|
||||
// if(!RegexUtil.isEmail(value)) {
|
||||
// throw new BusinessException("管理员邮箱格式错误");
|
||||
// }
|
||||
// identifyingCodeService.send(value, ip);
|
||||
// SecUser sec = this.secUserService.findUserByLoginName(operatorUsername);
|
||||
// saveLog(sec,operatorUsername,String.format("ip:{%s},操作:{%s},邮箱:{%s},发送验证码", ip,context,value));
|
||||
//// cacheDate.put(context, new Date());
|
||||
}
|
||||
|
||||
public void saveLog(SecUser secUser, String operator,String context) {
|
||||
Log log = new Log();
|
||||
log.setCategory(Constants.LOG_CATEGORY_OPERATION);
|
||||
log.setOperator(operator);
|
||||
log.setUsername(secUser.getUsername());
|
||||
log.setPartyId(secUser.getPartyId());
|
||||
log.setLog(context);
|
||||
log.setCreateTime(new Date());
|
||||
logService.saveSync(log);
|
||||
}
|
||||
|
||||
public void updateCheckCode(String ip, String operatorUsername, String code, String uri) {
|
||||
SecUser user = secUserService.findUserByLoginName(operatorUsername);
|
||||
checkEmailCode(user.getEmail(),code);
|
||||
String context = MessageFormat.format("user:{0},opera time:{1},opera ip:{2},request uri:{3},"
|
||||
+ "last login ip:{4},last login time:{5},验证码:["+code+"]",
|
||||
new Object[]{user.getUsername(),DateUtils.dateToStr(new Date(), DateUtils.DF_yyyyMMddHHmmss),ip,uri,
|
||||
user.getLogin_ip(),DateUtils.dateToStr(user.getLast_loginTime(), DateUtils.DF_yyyyMMddHHmmss)});
|
||||
user.setLogin_ip(ip);
|
||||
user.setLast_loginTime(new Date());
|
||||
secUserService.update(user);//ip切换相当于重新登录
|
||||
this.saveLog(user, operatorUsername, context);
|
||||
}
|
||||
public void updateCheckGoogleAuthCode(String ip, String operatorUsername, String googleAuthCode, String uri) {
|
||||
SecUser user = secUserService.findUserByLoginName(operatorUsername);
|
||||
checkGoogleAuthCode(user,googleAuthCode);
|
||||
String context = MessageFormat.format("user:{0},opera time:{1},opera ip:{2},request uri:{3},"
|
||||
+ "last login ip:{4},last login time:{5}",
|
||||
new Object[]{user.getUsername(),DateUtils.dateToStr(new Date(), DateUtils.DF_yyyyMMddHHmmss),ip,uri,
|
||||
user.getLogin_ip(),DateUtils.dateToStr(user.getLast_loginTime(), DateUtils.DF_yyyyMMddHHmmss)});
|
||||
user.setLogin_ip(ip);
|
||||
user.setLast_loginTime(new Date());
|
||||
secUserService.update(user);//ip切换相当于重新登录
|
||||
this.saveLog(user, operatorUsername, context);
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证谷歌验证码
|
||||
* @param code
|
||||
*/
|
||||
private void checkGoogleAuthCode(SecUser secUser,String code) {
|
||||
if(!secUser.isGoogle_auth_bind()) {
|
||||
throw new BusinessException("请先绑定谷歌验证器");
|
||||
}
|
||||
boolean checkCode = googleAuthService.checkCode(secUser.getGoogle_auth_secret(), code);
|
||||
if(!checkCode) {
|
||||
throw new BusinessException("谷歌验证码错误");
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 验证管理员唯一邮箱
|
||||
* @param code
|
||||
*/
|
||||
private void checkEmailCode(String email,String code) {
|
||||
// String authCode = identifyingCodeTimeWindowService.getAuthCode(email);
|
||||
// if(StringUtils.isEmptyString(authCode)||!authCode.equals(code)) {
|
||||
// throw new BusinessException("验证码错误");
|
||||
// }
|
||||
// identifyingCodeTimeWindowService.delAuthCode(email);
|
||||
}
|
||||
public void setSecUserService(SecUserService secUserService) {
|
||||
this.secUserService = secUserService;
|
||||
}
|
||||
|
||||
public void setLogService(LogService logService) {
|
||||
this.logService = logService;
|
||||
}
|
||||
|
||||
// public void setIdentifyingCodeService(IdentifyingCodeService identifyingCodeService) {
|
||||
// this.identifyingCodeService = identifyingCodeService;
|
||||
// }
|
||||
//
|
||||
// public void setIdentifyingCodeTimeWindowService(IdentifyingCodeTimeWindowService identifyingCodeTimeWindowService) {
|
||||
// this.identifyingCodeTimeWindowService = identifyingCodeTimeWindowService;
|
||||
// }
|
||||
|
||||
public void setSysparaService(SysparaService sysparaService) {
|
||||
this.sysparaService = sysparaService;
|
||||
}
|
||||
|
||||
public void setGoogleAuthService(GoogleAuthService googleAuthService) {
|
||||
this.googleAuthService = googleAuthService;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,740 @@
|
||||
package project.web.admin.impl.report;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.poi.ss.usermodel.Cell;
|
||||
import org.apache.poi.ss.usermodel.CellStyle;
|
||||
import org.apache.poi.ss.usermodel.Drawing;
|
||||
import org.apache.poi.ss.usermodel.Font;
|
||||
import org.apache.poi.ss.usermodel.HorizontalAlignment;
|
||||
import org.apache.poi.ss.usermodel.Row;
|
||||
import org.apache.poi.ss.usermodel.Sheet;
|
||||
import org.apache.poi.ss.usermodel.VerticalAlignment;
|
||||
import org.apache.poi.ss.util.CellRangeAddress;
|
||||
import org.apache.poi.xssf.streaming.SXSSFWorkbook;
|
||||
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcOperations;
|
||||
import org.springframework.orm.hibernate5.support.HibernateDaoSupport;
|
||||
|
||||
|
||||
import kernel.util.Arith;
|
||||
import kernel.util.DateUtils;
|
||||
import kernel.util.PoiUtil;
|
||||
import kernel.util.StringUtils;
|
||||
import kernel.web.Page;
|
||||
import kernel.web.PagedQueryDao;
|
||||
import project.Constants;
|
||||
import project.party.PartyService;
|
||||
import project.party.model.Party;
|
||||
import project.party.model.UserRecom;
|
||||
import project.party.recom.UserRecomService;
|
||||
import project.user.UserData;
|
||||
import project.user.UserDataService;
|
||||
import project.web.admin.service.report.AdminAgentAllStatisticsService;
|
||||
|
||||
public class AdminAgentAllStatisticsServiceImpl extends HibernateDaoSupport implements AdminAgentAllStatisticsService {
|
||||
private PagedQueryDao pagedQueryDao;
|
||||
private UserRecomService userRecomService;
|
||||
private UserDataService userDataService;
|
||||
private PartyService partyService;
|
||||
private NamedParameterJdbcOperations namedParameterJdbcTemplate;
|
||||
|
||||
private List<Party> agentPartys() {
|
||||
List<Party> cacheAll = this.partyService.getAll();
|
||||
List<Party> result = new ArrayList<Party>();
|
||||
for (Party party : cacheAll) {
|
||||
if (Constants.SECURITY_ROLE_AGENT.equals(party.getRolename())) {
|
||||
result.add(party);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private Page getPageList(int pageNo, int pageSize, String startTime, String endTime, String loginPartyId,
|
||||
String roleName, String usernameOrUid, String targetPartyId, String allPartyId) {
|
||||
Map<String, Object> parameters = new HashMap<String, Object>();
|
||||
StringBuffer queryString = new StringBuffer();
|
||||
queryString.append(
|
||||
"SELECT party.ROLENAME AS rolename,party.USERNAME AS username,party.USERCODE AS UID,party.UUID AS partyId ");// 用户
|
||||
queryString.append("FROM PAT_PARTY party ");
|
||||
queryString.append("LEFT JOIN PAT_USER_RECOM ur ON party.UUID = ur.PARTY_ID ");// 推荐人 根目录判定
|
||||
queryString.append("WHERE 1=1 ");
|
||||
queryString.append("AND party.ROLENAME IN('" + Constants.SECURITY_ROLE_AGENT + "','"+Constants.SECURITY_ROLE_AGENTLOW+"') ");
|
||||
if (!StringUtils.isNullOrEmpty(loginPartyId)) {
|
||||
List children = this.userRecomService.findChildren(loginPartyId);
|
||||
if (children.size() == 0) {
|
||||
return new Page();
|
||||
}
|
||||
queryString.append(" and party.UUID in (:children) ");
|
||||
parameters.put("children", children);
|
||||
}
|
||||
if (!StringUtils.isNullOrEmpty(targetPartyId)) {
|
||||
List children = this.userRecomService.findRecomsToPartyId(targetPartyId);
|
||||
if (children.size() == 0) {
|
||||
return new Page();
|
||||
}
|
||||
queryString.append(" and party.UUID in (:children) ");
|
||||
parameters.put("children", children);
|
||||
}
|
||||
if (!StringUtils.isNullOrEmpty(allPartyId)) {
|
||||
List children = this.userRecomService.findChildren(allPartyId);
|
||||
if (children.size() == 0) {
|
||||
return new Page();
|
||||
}
|
||||
queryString.append(" and party.UUID in (:children) ");
|
||||
parameters.put("children", children);
|
||||
}
|
||||
if (StringUtils.isNullOrEmpty(targetPartyId) && StringUtils.isNullOrEmpty(usernameOrUid) && StringUtils.isNullOrEmpty(allPartyId)) {// 目标partyId为空
|
||||
// ,username参数为空,的情况下,如果是视图,显示根目录
|
||||
queryString.append(" and ur.RECO_ID is NULL ");
|
||||
}
|
||||
if (!StringUtils.isNullOrEmpty(usernameOrUid)) {
|
||||
queryString.append("AND (party.USERNAME like:username OR party.USERCODE like:username ) ");
|
||||
parameters.put("username", "%" + usernameOrUid + "%");
|
||||
}
|
||||
queryString.append("ORDER BY party.USERCODE ASC ");
|
||||
Page page = this.pagedQueryDao.pagedQuerySQL(pageNo, pageSize, queryString.toString(), parameters);
|
||||
return page;
|
||||
}
|
||||
|
||||
public Page pagedQuery(int pageNo, int pageSize, String startTime, String endTime, String loginPartyId,
|
||||
String roleName, String usernameOrUid, String targetPartyId, String allPartyId) {
|
||||
Page page = getPageList(pageNo, pageSize, startTime, endTime, loginPartyId, usernameOrUid, roleName,
|
||||
targetPartyId, allPartyId);// 获取当前页的用户相关
|
||||
|
||||
/**
|
||||
* 页面查询第一层partyId级
|
||||
*/
|
||||
List<String> list_partyId = new ArrayList<String>();
|
||||
|
||||
for (int i = 0; i < page.getElements().size(); i++) {
|
||||
Map<String, Object> map_party = (Map<String, Object>) page.getElements().get(i);
|
||||
list_partyId.add(map_party.get("partyId").toString());
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
||||
List<Map<String, Object>> result = new ArrayList<Map<String, Object>>();
|
||||
|
||||
for (int i = 0; i < list_partyId.size(); i++) {
|
||||
int reco_agent = 0;
|
||||
int all_agent = 0;
|
||||
/**
|
||||
* 所有子集
|
||||
*/
|
||||
List<String> children_all = this.userRecomService.findChildren(list_partyId.get(i));
|
||||
List<UserRecom> recoms = userRecomService.findRecoms(list_partyId.get(i));
|
||||
/**
|
||||
* 正式用户 团队
|
||||
*/
|
||||
List<String> children_member = new ArrayList<>();
|
||||
for (int j = 0; j < children_all.size(); j++) {
|
||||
String partyId = children_all.get(j);
|
||||
Party party = partyService.cachePartyBy(partyId,true);
|
||||
if(null == party){
|
||||
logger.info("party 为null id为"+partyId);
|
||||
}
|
||||
if (Constants.SECURITY_ROLE_AGENT.equals(party.getRolename())||Constants.SECURITY_ROLE_AGENTLOW.equals(party.getRolename())) {
|
||||
reco_agent++;
|
||||
} else if (Constants.SECURITY_ROLE_MEMBER.equals(party.getRolename())) {
|
||||
children_member.add(partyId);
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
* 正式用户 直推
|
||||
*/
|
||||
List<String> all_member = new ArrayList<>();
|
||||
for (int j = 0; j < recoms.size(); j++) {
|
||||
String partyId = children_all.get(j);
|
||||
Party party = partyService.cachePartyBy(partyId,true);
|
||||
if(null == party){
|
||||
logger.info("party 为null id为"+partyId);
|
||||
}
|
||||
if (Constants.SECURITY_ROLE_AGENT.equals(party.getRolename())||Constants.SECURITY_ROLE_AGENTLOW.equals(party.getRolename())) {
|
||||
all_agent++;
|
||||
} else if (Constants.SECURITY_ROLE_MEMBER.equals(party.getRolename())) {
|
||||
all_member.add(partyId);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Map<String, Object> item_result = this.sumUserData(children_member,startTime,endTime);
|
||||
item_result.put("reco_agent", reco_agent);
|
||||
item_result.put("all_agent", all_agent);
|
||||
item_result.put("reco_member", children_member.size());
|
||||
item_result.put("all_member", all_member.size());
|
||||
item_result.put("partyId", list_partyId.get(i));
|
||||
|
||||
Party party = partyService.cachePartyBy(list_partyId.get(i),true);
|
||||
|
||||
item_result.put("username", party.getUsername());
|
||||
item_result.put("UID", party.getUsercode());
|
||||
|
||||
result.add(item_result);
|
||||
}
|
||||
|
||||
|
||||
Page page_result = new Page();;
|
||||
|
||||
page_result.setElements(result);
|
||||
|
||||
compute(page_result.getElements());// 计算总收益
|
||||
return page_result;
|
||||
}
|
||||
private Map<String, Object> sumUserData(List<String> children, String startTime, String endTime) {
|
||||
if(CollectionUtils.isEmpty(children)) {//children数据为空时,数据填充,这里操作减少dubbo调用
|
||||
return sumData(new HashMap<String, Object>(), new ArrayList<UserData>());
|
||||
}
|
||||
Map<String, Object> item_result = new HashMap<String, Object>();
|
||||
List<Map<String, UserData>> datas = this.userDataService.cacheByPartyIds(children);
|
||||
for (int i = 0; i < datas.size(); i++) {
|
||||
Map<String, UserData> data_all = datas.get(i);
|
||||
if (data_all == null) {
|
||||
continue;
|
||||
}
|
||||
List<UserData> userdata= filterData(data_all,startTime,endTime);
|
||||
item_result = sumData(item_result, userdata);
|
||||
}
|
||||
if(item_result.isEmpty()) {//item_result数据为空时,数据填充
|
||||
item_result = sumData(item_result, new ArrayList<UserData>());
|
||||
}
|
||||
return item_result;
|
||||
|
||||
}
|
||||
|
||||
|
||||
private Map<String, Object> sumData(Map<String, Object> item_result,List<UserData> datas) {
|
||||
|
||||
double recharge_dapp = 0;
|
||||
double withdraw_dapp = 0;
|
||||
double recharge = 0;
|
||||
double recharge_usdt = 0;
|
||||
double recharge_eth = 0;
|
||||
double recharge_btc = 0;
|
||||
double recharge_ht = 0;
|
||||
double recharge_ltc = 0;
|
||||
double withdraw = 0;
|
||||
double withdraw_eth = 0;
|
||||
double withdraw_btc = 0;
|
||||
double recharge_withdrawal_fee = 0;
|
||||
double gift_money = 0;
|
||||
double balance_amount = 0;
|
||||
double amount = 0;
|
||||
double rechargeCommission = 0;
|
||||
double withdrawCommission = 0;
|
||||
double fee = 0;
|
||||
double order_income = 0;
|
||||
double finance_amount = 0;
|
||||
double finance_income = 0;
|
||||
double exchange_amount =0;
|
||||
double exchange_fee = 0;
|
||||
double exchange_income =0;
|
||||
double coin_income =0;
|
||||
double furtures_amount =0;
|
||||
double furtures_fee=0;
|
||||
double furtures_income=0;
|
||||
double miner_income=0;
|
||||
double miner_amount=0;
|
||||
double third_recharge_amount=0;
|
||||
double exchange_lever_amount = 0;
|
||||
double exchange_lever_fee = 0;
|
||||
double exchange_lever_order_income = 0;
|
||||
|
||||
for(int i = 0 ;i< datas.size(); i++) {
|
||||
UserData data = datas.get(i);
|
||||
|
||||
// 充提
|
||||
recharge_dapp = Arith.add(data.getRecharge_dapp(), recharge_dapp);
|
||||
withdraw_dapp = Arith.add(data.getWithdraw_dapp(), withdraw_dapp);
|
||||
recharge = Arith.add(data.getRecharge(), recharge);
|
||||
recharge_usdt = Arith.add(data.getRecharge_usdt(), recharge_usdt);
|
||||
recharge_eth = Arith.add(data.getRecharge_eth(), recharge_eth);
|
||||
recharge_btc = Arith.add(data.getRecharge_btc(), recharge_btc);
|
||||
recharge_ht = Arith.add(data.getRecharge_ht(), recharge_ht);
|
||||
recharge_ltc = Arith.add(data.getRecharge_ltc(), recharge_ltc);
|
||||
withdraw = Arith.add(data.getWithdraw(), withdraw);
|
||||
withdraw_eth = Arith.add(data.getWithdraw_eth(), withdraw_eth);
|
||||
withdraw_btc = Arith.add(data.getWithdraw_btc(), withdraw_btc);
|
||||
recharge_withdrawal_fee = Arith.add(data.getRecharge_withdrawal_fee(), recharge_withdrawal_fee);
|
||||
gift_money = Arith.add(data.getGift_money(), gift_money);
|
||||
balance_amount = Arith.add( Arith.sub(data.getRecharge(), data.getWithdraw()), balance_amount);
|
||||
// 永续
|
||||
amount = Arith.add( data.getAmount(), amount);
|
||||
|
||||
rechargeCommission = Arith.add( data.getRechargeCommission(), rechargeCommission);
|
||||
withdrawCommission = Arith.add( data.getWithdrawCommission(), withdrawCommission);
|
||||
fee = Arith.add(data.getFee(), fee);
|
||||
order_income = Arith.add( data.getOrder_income(), order_income);
|
||||
// 理财
|
||||
finance_amount = Arith.add( data.getFinance_amount(), finance_amount);
|
||||
finance_income = Arith.add( data.getFinance_income(), finance_income);
|
||||
// 币币
|
||||
exchange_amount = Arith.add( data.getExchange_amount(), exchange_amount);
|
||||
exchange_fee = Arith.add( data.getExchange_fee(), exchange_fee);
|
||||
// exchange_income = Arith.add(data.getExchange_income(), exchange_income);
|
||||
exchange_income = 0;
|
||||
coin_income = Arith.add(data.getCoin_income(), coin_income);
|
||||
// 交割
|
||||
furtures_amount = Arith.add( data.getFurtures_amount(), furtures_amount);
|
||||
furtures_fee = Arith.add( data.getFurtures_fee(), furtures_fee);
|
||||
furtures_income = Arith.add(data.getFurtures_income(), furtures_income);
|
||||
//矿机
|
||||
miner_income = Arith.add(data.getMiner_income(), miner_income);
|
||||
miner_amount = Arith.add(data.getMiner_amount(), miner_amount);
|
||||
//三方充值货币金额
|
||||
third_recharge_amount = Arith.add(data.getThird_recharge_amount(), third_recharge_amount);
|
||||
//币币杠杆
|
||||
exchange_lever_amount = Arith.add(data.getExchange_lever_amount(), exchange_lever_amount);
|
||||
exchange_lever_fee = Arith.add(data.getExchange_lever_fee(), exchange_lever_fee);
|
||||
exchange_lever_order_income = Arith.add(data.getExchange_lever_order_income(), exchange_lever_order_income);
|
||||
}
|
||||
|
||||
if(item_result != null && item_result.size() != 0) {
|
||||
// 充提
|
||||
item_result.put("rechargeCommission", Arith.add(Double.valueOf( item_result.get("rechargeCommission").toString()), rechargeCommission));
|
||||
item_result.put("withdrawCommission", Arith.add(Double.valueOf( item_result.get("withdrawCommission").toString()), withdrawCommission));
|
||||
item_result.put("withdraw_dapp",Arith.add(Double.valueOf( item_result.get("withdraw_dapp").toString()) ,withdraw_dapp));
|
||||
item_result.put("recharge", Arith.add(Double.valueOf( item_result.get("recharge").toString()), recharge));
|
||||
item_result.put("recharge_usdt", Arith.add(Double.valueOf( item_result.get("recharge_usdt").toString()), recharge_usdt));
|
||||
item_result.put("recharge_eth", Arith.add(Double.valueOf( item_result.get("recharge_eth").toString()), recharge_eth));
|
||||
item_result.put("recharge_btc", Arith.add(Double.valueOf( item_result.get("recharge_btc").toString()), recharge_btc));
|
||||
item_result.put("recharge_ht", Arith.add(Double.valueOf( item_result.get("recharge_ht").toString()), recharge_ht));
|
||||
item_result.put("recharge_ltc", Arith.add(Double.valueOf( item_result.get("recharge_ltc").toString()), recharge_ltc));
|
||||
item_result.put("withdraw",Arith.add(Double.valueOf( item_result.get("withdraw").toString()) ,withdraw));
|
||||
item_result.put("withdraw_eth",Arith.add(Double.valueOf( item_result.get("withdraw_eth").toString()) ,withdraw_eth));
|
||||
item_result.put("withdraw_btc",Arith.add(Double.valueOf( item_result.get("withdraw_btc").toString()) ,withdraw_btc));
|
||||
item_result.put("recharge_withdrawal_fee", Arith.add(Double.valueOf( item_result.get("recharge_withdrawal_fee").toString()),recharge_withdrawal_fee));
|
||||
item_result.put("gift_money", Arith.add(Double.valueOf( item_result.get("gift_money").toString()),gift_money));
|
||||
item_result.put("balance_amount", Arith.add(Double.valueOf( item_result.get("balance_amount").toString()),balance_amount));
|
||||
// 永续
|
||||
item_result.put("amount", Arith.add(Double.valueOf( item_result.get("amount").toString()),amount));
|
||||
item_result.put("fee", Arith.add(Double.valueOf( item_result.get("fee").toString()),fee));
|
||||
item_result.put("order_income", Arith.add(Double.valueOf( item_result.get("order_income").toString()),order_income));
|
||||
// 理财
|
||||
item_result.put("finance_amount", Arith.add(Double.valueOf( item_result.get("finance_amount").toString()),finance_amount));
|
||||
item_result.put("finance_income", Arith.add(Double.valueOf( item_result.get("finance_income").toString()),finance_income));
|
||||
// 币币
|
||||
item_result.put("exchange_amount", Arith.add(Double.valueOf( item_result.get("exchange_amount").toString()),exchange_amount));
|
||||
item_result.put("exchange_fee", Arith.add(Double.valueOf( item_result.get("exchange_fee").toString()),exchange_fee));
|
||||
// item_result.put("exchange_income", Arith.add(Double.valueOf( item_result.get("exchange_income").toString()),exchange_income));
|
||||
item_result.put("exchange_income", 0);
|
||||
item_result.put("coin_income", Arith.add(Double.valueOf( item_result.get("coin_income").toString()),coin_income));
|
||||
// 交割
|
||||
item_result.put("furtures_amount", Arith.add(Double.valueOf( item_result.get("furtures_amount").toString()),furtures_amount));
|
||||
item_result.put("furtures_fee", Arith.add(Double.valueOf( item_result.get("furtures_fee").toString()),furtures_fee));
|
||||
item_result.put("furtures_income", Arith.add(Double.valueOf( item_result.get("furtures_income").toString()),furtures_income));
|
||||
//矿机
|
||||
item_result.put("miner_income", Arith.add(Double.valueOf( item_result.get("miner_income").toString()),miner_income));
|
||||
item_result.put("miner_amount", Arith.add(Double.valueOf( item_result.get("miner_amount").toString()),miner_amount));
|
||||
//三方充值货币金额
|
||||
item_result.put("third_recharge_amount", Arith.add(Double.valueOf( item_result.get("third_recharge_amount").toString()),third_recharge_amount));
|
||||
//币币杠杆
|
||||
item_result.put("exchange_lever_amount", Arith.add(Double.valueOf( item_result.get("exchange_lever_amount").toString()),exchange_lever_amount));
|
||||
item_result.put("exchange_lever_fee", Arith.add(Double.valueOf( item_result.get("exchange_lever_fee").toString()),exchange_lever_fee));
|
||||
item_result.put("exchange_lever_order_income", Arith.add(Double.valueOf( item_result.get("exchange_lever_order_income").toString()),exchange_lever_order_income));
|
||||
|
||||
}else {
|
||||
// 充提
|
||||
item_result.put("recharge_dapp", recharge_dapp);
|
||||
item_result.put("withdraw_dapp", withdraw_dapp);
|
||||
item_result.put("recharge", recharge);
|
||||
item_result.put("recharge_usdt", recharge_usdt);
|
||||
item_result.put("recharge_eth", recharge_eth);
|
||||
item_result.put("recharge_btc", recharge_btc);
|
||||
item_result.put("recharge_ht", recharge_ht);
|
||||
item_result.put("recharge_ltc", recharge_ltc);
|
||||
item_result.put("withdraw", withdraw);
|
||||
item_result.put("withdraw_eth", withdraw_eth);
|
||||
item_result.put("withdraw_btc", withdraw_btc);
|
||||
item_result.put("recharge_withdrawal_fee", recharge_withdrawal_fee);
|
||||
item_result.put("gift_money", gift_money);
|
||||
item_result.put("balance_amount", balance_amount);
|
||||
// 永续
|
||||
item_result.put("amount", amount);
|
||||
item_result.put("rechargeCommission", rechargeCommission);
|
||||
item_result.put("withdrawCommission", withdrawCommission);
|
||||
item_result.put("fee", fee);
|
||||
item_result.put("order_income", order_income);
|
||||
// 理财
|
||||
item_result.put("finance_amount", finance_amount);
|
||||
item_result.put("finance_income", finance_income);
|
||||
// 币币
|
||||
item_result.put("exchange_amount", exchange_amount);
|
||||
item_result.put("exchange_fee", exchange_fee);
|
||||
item_result.put("exchange_income", 0);
|
||||
item_result.put("coin_income", coin_income);
|
||||
// 交割
|
||||
item_result.put("furtures_amount", furtures_amount);
|
||||
item_result.put("furtures_fee", furtures_fee);
|
||||
item_result.put("furtures_income", furtures_income);
|
||||
// 矿机
|
||||
item_result.put("miner_income", miner_income);
|
||||
item_result.put("miner_amount", miner_amount);
|
||||
//三方充值货币金额
|
||||
item_result.put("third_recharge_amount", third_recharge_amount);
|
||||
//币币杠杆
|
||||
item_result.put("exchange_lever_amount", exchange_lever_amount);
|
||||
item_result.put("exchange_lever_fee", exchange_lever_fee);
|
||||
item_result.put("exchange_lever_order_income", exchange_lever_order_income);
|
||||
}
|
||||
|
||||
|
||||
|
||||
return item_result;
|
||||
|
||||
}
|
||||
|
||||
private List<UserData> filterData(Map<String, UserData> datas, String startTime, String endTime) {
|
||||
// Map<String, Map<String, UserData>> result = new HashMap<>();
|
||||
|
||||
List<UserData> result = new ArrayList<UserData>();
|
||||
|
||||
for(Entry<String, UserData> valueEntry:datas.entrySet()) {
|
||||
UserData userdata = valueEntry.getValue();
|
||||
Date time = userdata.getCreateTime();
|
||||
if (!StringUtils.isNullOrEmpty(startTime)) {
|
||||
Date startDate = DateUtils.toDate(startTime, DateUtils.DF_yyyyMMdd);
|
||||
int intervalDays = DateUtils.getIntervalDaysByTwoDate(startDate, time);// 开始-数据时间
|
||||
if (intervalDays > 0) // 开始>数据时间 ,则过滤
|
||||
continue;
|
||||
}
|
||||
if (!StringUtils.isNullOrEmpty(endTime)) {
|
||||
Date endDate = DateUtils.toDate(endTime, DateUtils.DF_yyyyMMdd);
|
||||
int intervalDays = DateUtils.getIntervalDaysByTwoDate(endDate, time);// 结束-数据时间
|
||||
if (intervalDays < 0) // 结束<数据时间
|
||||
continue;
|
||||
}
|
||||
result.add(userdata);
|
||||
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private void compute(List<Map<String, Object>> datas) {
|
||||
if (CollectionUtils.isEmpty(datas))
|
||||
return;
|
||||
Double totle_income = 0d;
|
||||
Double totle_fee = 0d;
|
||||
Double business_profit = 0d;//交易盈亏
|
||||
Double fin_miner_amount = 0d;//理财 矿机 交易额
|
||||
Double fin_miner_income = 0d;//理财 矿机 收益
|
||||
for (Map<String, Object> data : datas) {
|
||||
totle_income = 0d;
|
||||
totle_fee = 0d;
|
||||
business_profit = 0d;
|
||||
fin_miner_amount = 0d;
|
||||
fin_miner_income = 0d;
|
||||
// if(null!=data.get("rolename")) {
|
||||
// data.put("rolename", Constants.ROLE_MAP.get(data.get("rolename").toString()));
|
||||
// }
|
||||
if (null != data.get("order_income"))
|
||||
data.put("order_income", Arith.sub(0, new Double(data.get("order_income").toString())));// 订单收益负数
|
||||
if (null != data.get("finance_income"))
|
||||
data.put("finance_income", Arith.sub(0, new Double(data.get("finance_income").toString())));// 理财收益负数
|
||||
if (null != data.get("exchange_income"))
|
||||
// data.put("exchange_income", Arith.sub(0, new Double(data.get("exchange_income").toString())));// 币币收益负数
|
||||
data.put("exchange_income", 0);// 币币收益负数
|
||||
|
||||
if (null != data.get("furtures_income"))
|
||||
data.put("furtures_income", Arith.sub(0, new Double(data.get("furtures_income").toString())));// 交割收益负数
|
||||
if (null != data.get("miner_income"))
|
||||
data.put("miner_income", Arith.sub(0, new Double(data.get("miner_income").toString())));// 矿机收益负数
|
||||
if (null != data.get("exchange_lever_order_income"))
|
||||
data.put("exchange_lever_order_income", Arith.sub(0, new Double(data.get("exchange_lever_order_income").toString())));// 币币收益负数
|
||||
|
||||
if (!dataExistNull(data))
|
||||
continue;
|
||||
totle_income = Arith.add(totle_income, new Double(data.get("recharge_withdrawal_fee").toString()));
|
||||
totle_income = Arith.add(totle_income, new Double(data.get("order_income").toString()));
|
||||
totle_income = Arith.add(totle_income, new Double(data.get("fee").toString()));
|
||||
totle_income = Arith.add(totle_income, new Double(data.get("finance_income").toString()));
|
||||
totle_income = Arith.add(totle_income, new Double(data.get("exchange_fee").toString()));
|
||||
// totle_income = Arith.add(totle_income, new Double(data.get("exchange_income").toString()));
|
||||
totle_income = Arith.add(totle_income, new Double(0));
|
||||
totle_income = Arith.add(totle_income, new Double(data.get("furtures_fee").toString()));
|
||||
totle_income = Arith.add(totle_income, new Double(data.get("furtures_income").toString()));
|
||||
totle_income = Arith.add(totle_income, new Double(data.get("miner_income").toString()));
|
||||
totle_income = Arith.add(totle_income, new Double(data.get("exchange_lever_order_income").toString()));
|
||||
data.put("totle_income", totle_income);
|
||||
|
||||
totle_fee = Arith.add(totle_fee, new Double(data.get("recharge_withdrawal_fee").toString()));
|
||||
totle_fee = Arith.add(totle_fee, new Double(data.get("fee").toString()));
|
||||
totle_fee = Arith.add(totle_fee, new Double(data.get("exchange_fee").toString()));
|
||||
totle_fee = Arith.add(totle_fee, new Double(data.get("furtures_fee").toString()));
|
||||
totle_fee = Arith.add(totle_fee, new Double(data.get("exchange_lever_fee").toString()));
|
||||
data.put("totle_fee", totle_fee);
|
||||
|
||||
business_profit = Arith.add(business_profit, new Double(data.get("order_income").toString()));
|
||||
business_profit = Arith.add(business_profit, new Double(data.get("exchange_income").toString()));
|
||||
business_profit = Arith.add(business_profit, new Double(data.get("furtures_income").toString()));
|
||||
business_profit = Arith.add(business_profit, new Double(data.get("exchange_lever_order_income").toString()));
|
||||
data.put("business_profit", business_profit);
|
||||
|
||||
fin_miner_amount = Arith.add(fin_miner_amount, new Double(data.get("finance_amount").toString()));
|
||||
fin_miner_amount = Arith.add(fin_miner_amount, new Double(data.get("miner_amount").toString()));
|
||||
data.put("fin_miner_amount", fin_miner_amount);
|
||||
|
||||
fin_miner_income = Arith.add(fin_miner_income, new Double(data.get("finance_income").toString()));
|
||||
fin_miner_income = Arith.add(fin_miner_income, new Double(data.get("miner_income").toString()));
|
||||
data.put("fin_miner_income", fin_miner_income);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 统计的数据存在空时,不统计总额
|
||||
*
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
private boolean dataExistNull(Map<String, Object> data) {
|
||||
if (null == data.get("recharge_withdrawal_fee"))
|
||||
return false;
|
||||
if (null == data.get("order_income"))
|
||||
return false;
|
||||
if (null == data.get("fee"))
|
||||
return false;
|
||||
if (null == data.get("finance_income"))
|
||||
return false;
|
||||
if (null == data.get("exchange_fee"))
|
||||
return false;
|
||||
if (null == data.get("exchange_income"))
|
||||
return false;
|
||||
if (null == data.get("furtures_fee"))
|
||||
return false;
|
||||
if (null == data.get("furtures_income"))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
public String loadExportData(HttpServletResponse response, int pageSize, String startTime, String endTime,
|
||||
String loginPartyId, String usernameOrUid, String roleName, String targetPartyId) throws IOException {
|
||||
// 生成数据信息
|
||||
int sheetNum = 0;
|
||||
// 生成表头
|
||||
Integer i = 0;
|
||||
// 在内存中保持100行,超过100行将被刷新到磁盘
|
||||
// HSSFWorkbook wb = new HSSFWorkbook();//excel文件,一个excel文件包含多个表
|
||||
// HSSFSheet sheet = wb.createSheet();//表,一个表包含多个行
|
||||
SXSSFWorkbook wb = new SXSSFWorkbook(100);
|
||||
Sheet sheet = wb.createSheet(); // 表,一个表包含多个行
|
||||
Drawing patriarch = sheet.createDrawingPatriarch();
|
||||
CellStyle style = wb.createCellStyle();
|
||||
Row row = null;// 行,一行包括多个单元格
|
||||
Cell cell = null;// 单元格
|
||||
Page page = null;
|
||||
int pageNo = 1;
|
||||
|
||||
Map<String, Integer[]> headMap = new LinkedHashMap<String, Integer[]>();
|
||||
// <td colspan="3" style="text-align:center;vertical-align: middle;">用户</td>
|
||||
// <td colspan="3" style="text-align:center;">充提</td>
|
||||
// <td colspan="3" style="text-align:center;">永续合约</td>
|
||||
// <td colspan="2" style="text-align:center;">理财</td>
|
||||
// <td colspan="4" style="text-align:center;vertical-align: middle;">币币</td>
|
||||
// <td colspan="3" style="text-align:center;vertical-align: middle;">交割合约</td>
|
||||
// <td colspan="1" rowspan="2" style="text-align:center; vertical-align: middle;">收益</td>
|
||||
headMap.put("用户", new Integer[] { 0, 4 });
|
||||
headMap.put("充提", new Integer[] { 0, 9 });
|
||||
headMap.put("永续合约", new Integer[] { 0, 2 });
|
||||
headMap.put("理财收益", new Integer[] { 1, 1 });
|
||||
headMap.put("币币", new Integer[] { 0, 2 });
|
||||
headMap.put("交割合约", new Integer[] { 0, 2 });
|
||||
headMap.put("收益", new Integer[] { 1, 1 });
|
||||
|
||||
createMergedHead(wb, sheet, headMap, i++);
|
||||
|
||||
while (true) {
|
||||
page = this.pagedQuery(pageNo, pageSize, startTime, endTime, loginPartyId, usernameOrUid, roleName,
|
||||
targetPartyId,null);
|
||||
if (sheetNum == 0 && (page == null || page.getElements() == null || page.getElements().size() == 0)) {
|
||||
return "无导出数据!";
|
||||
}
|
||||
String[] headTitles = { "用户名", "UID", "网络用户输", "网络代理数", "USDT充值", "ETH充值", "BTC充值","充值换算USDT总计", "赠送", "提现", "手续费", "充提差额(USDT)","充提总差额(USDT计价)", "手续费", "订单收益", "收益",
|
||||
"手续费", "收益", "手续费", "订单收益" };
|
||||
|
||||
if (i == 1)
|
||||
PoiUtil.createHead(response, headTitles, wb, sheet, style, row, cell, i,
|
||||
"代理商充提报表_" + DateUtils.format(new Date(), DateUtils.DEFAULT_DATE_FORMAT),
|
||||
"代理商充提报表_" + DateUtils.format(new Date(), DateUtils.DEFAULT_DATE_FORMAT) + ".xlsx");
|
||||
List<Object[]> list = this.dataBachHandel(page.getElements());
|
||||
|
||||
if (page.getElements() != null) {
|
||||
|
||||
i = PoiUtil.createCell(list, patriarch, wb, sheet, row, cell, style, i);
|
||||
list.clear();
|
||||
|
||||
if (page.getElements().size() < pageSize || i >= 59999) {
|
||||
PoiUtil.out(wb, response);
|
||||
break;
|
||||
}
|
||||
sheetNum++;
|
||||
pageNo++;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
private void createMergedHead(SXSSFWorkbook wb, Sheet sheet, Map<String, Integer[]> headMap, int i) {
|
||||
Font font = wb.createFont();
|
||||
font.setFontHeightInPoints((short) 10);
|
||||
font.setFontName("Courier New");
|
||||
CellStyle style = wb.createCellStyle();
|
||||
style.setFont(font);
|
||||
style.setWrapText(true);
|
||||
style.setAlignment(HorizontalAlignment.CENTER);
|
||||
style.setVerticalAlignment(VerticalAlignment.CENTER);
|
||||
Row row = sheet.createRow(i);
|
||||
int rowPosition = 0;// 行坐标
|
||||
int cellPosition = 0;// 列坐标
|
||||
for (Entry<String, Integer[]> entry : headMap.entrySet()) {
|
||||
Cell cell = row.createCell(cellPosition);
|
||||
cell.setCellStyle(style);
|
||||
cell.setCellValue(entry.getKey());
|
||||
CellRangeAddress region = new CellRangeAddress(rowPosition, rowPosition + entry.getValue()[0], cellPosition,
|
||||
cellPosition + entry.getValue()[1] - 1);
|
||||
sheet.addMergedRegion(region);
|
||||
cellPosition += entry.getValue()[1];
|
||||
}
|
||||
}
|
||||
|
||||
public List<Object[]> dataBachHandel(List<Map<String, Object>> list) {
|
||||
List<Object[]> result = new ArrayList<Object[]>();
|
||||
int i = 0;
|
||||
for (Map<String, Object> data : list) {
|
||||
i = 0;
|
||||
Object[] objs = new Object[21];
|
||||
objs[i++] = data.get("username");
|
||||
objs[i++] = data.get("UID");
|
||||
objs[i++] = data.get("reco_member");
|
||||
|
||||
// objs[i++] = data.get("rolename") != null
|
||||
// && Constants.SECURITY_ROLE_AGENT.equals(data.get("rolename").toString()) ? "代理商"
|
||||
// : Constants.SECURITY_ROLE_MEMBER.equals(data.get("rolename").toString()) ? "正式用户" : "";
|
||||
objs[i++] = data.get("reco_agent");
|
||||
// objs[i++] = data.get("money");
|
||||
|
||||
|
||||
objs[i++] = data.get("recharge_usdt");
|
||||
objs[i++] = data.get("recharge_eth");
|
||||
objs[i++] = data.get("recharge_btc");
|
||||
objs[i++] = data.get("recharge");
|
||||
objs[i++] = data.get("gift_money");
|
||||
objs[i++] = data.get("withdraw");
|
||||
objs[i++] = data.get("recharge_withdrawal_fee");
|
||||
double recharge_usdt = 0D;
|
||||
double withdraw = 0D;
|
||||
if (null != data.get("recharge_usdt")) {
|
||||
recharge_usdt = Double.parseDouble(data.get("recharge_usdt").toString());
|
||||
}
|
||||
if (null != data.get("withdraw")) {
|
||||
withdraw = Double.parseDouble(data.get("withdraw").toString());
|
||||
}
|
||||
|
||||
objs[i++] = Arith.sub(recharge_usdt, withdraw);
|
||||
objs[i++] = data.get("balance_amount");
|
||||
|
||||
// objs[i++] = data.get("amount");
|
||||
objs[i++] = data.get("fee");
|
||||
objs[i++] = data.get("order_income");
|
||||
|
||||
// objs[i++] = data.get("finance_amount");
|
||||
objs[i++] = data.get("finance_income");
|
||||
|
||||
// objs[i++] = data.get("exchange_amount");
|
||||
objs[i++] = data.get("exchange_fee");
|
||||
objs[i++] = data.get("exchange_income");
|
||||
// objs[i++] = data.get("coin_income");
|
||||
|
||||
// objs[i++] = data.get("furtures_amount");
|
||||
objs[i++] = data.get("furtures_fee");
|
||||
objs[i++] = data.get("furtures_income");
|
||||
|
||||
objs[i++] = data.get("totle_income");
|
||||
result.add(objs);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
* 获取用户推荐数网络 列表(第i层用户数)
|
||||
* @return
|
||||
*/
|
||||
public List<Integer> getRecoNumNetList(String partyId) {
|
||||
Map<Integer, Integer> recoNumNet = getRecoNumNet(partyId);
|
||||
List<Integer> keys = new ArrayList<Integer>(recoNumNet.keySet());
|
||||
Collections.sort(keys);
|
||||
List<Integer> list = new LinkedList<Integer>();
|
||||
for (int i = 0; i < keys.size(); i++) {
|
||||
list.add(recoNumNet.get(keys.get(i)));
|
||||
}
|
||||
return list;
|
||||
}
|
||||
/**
|
||||
* 获取用户推荐数网络
|
||||
* @return key:网络层级,value:用户数
|
||||
*/
|
||||
public Map<Integer,Integer> getRecoNumNet(String partyId){
|
||||
List<String> all = this.userRecomService.findChildren(partyId);
|
||||
int allSize = all.size();
|
||||
int sum = 0;
|
||||
int level = 1;
|
||||
Map<Integer,Integer> result = new HashMap<Integer,Integer>();
|
||||
findRecomsNet(partyId,level,result,sum,allSize);
|
||||
|
||||
return result;
|
||||
}
|
||||
public void findRecomsNet(String partyId,int level,Map<Integer,Integer> result,int sum,int allSize) {
|
||||
if(sum>=allSize) return;
|
||||
List<UserRecom> users = this.userRecomService.findRecoms(partyId);
|
||||
if(CollectionUtils.isEmpty(users)) {
|
||||
return;
|
||||
}
|
||||
int num = 0;
|
||||
for(UserRecom user:users) {
|
||||
findRecomsNet(user.getPartyId().toString(),level+1,result,sum,allSize);
|
||||
Party party = partyService.cachePartyBy(user.getPartyId(),true);
|
||||
if (!Constants.SECURITY_ROLE_MEMBER.equals(party.getRolename())) {//非正式用户不统计
|
||||
continue;
|
||||
}
|
||||
num++;
|
||||
}
|
||||
sum+=users.size();//总数
|
||||
if(num>0) {
|
||||
result.put(level, result.get(level)==null?num:result.get(level)+num);
|
||||
}
|
||||
}
|
||||
public void setPagedQueryDao(PagedQueryDao pagedQueryDao) {
|
||||
this.pagedQueryDao = pagedQueryDao;
|
||||
}
|
||||
|
||||
public void setUserRecomService(UserRecomService userRecomService) {
|
||||
this.userRecomService = userRecomService;
|
||||
}
|
||||
|
||||
public void setUserDataService(UserDataService userDataService) {
|
||||
this.userDataService = userDataService;
|
||||
}
|
||||
|
||||
public void setPartyService(PartyService partyService) {
|
||||
this.partyService = partyService;
|
||||
}
|
||||
|
||||
public void setNamedParameterJdbcTemplate(NamedParameterJdbcOperations namedParameterJdbcTemplate) {
|
||||
this.namedParameterJdbcTemplate = namedParameterJdbcTemplate;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,425 @@
|
||||
package project.web.admin.impl.report;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.poi.ss.usermodel.Cell;
|
||||
import org.apache.poi.ss.usermodel.CellStyle;
|
||||
import org.apache.poi.ss.usermodel.Drawing;
|
||||
import org.apache.poi.ss.usermodel.Font;
|
||||
import org.apache.poi.ss.usermodel.HorizontalAlignment;
|
||||
import org.apache.poi.ss.usermodel.Row;
|
||||
import org.apache.poi.ss.usermodel.Sheet;
|
||||
import org.apache.poi.ss.usermodel.VerticalAlignment;
|
||||
import org.apache.poi.ss.util.CellRangeAddress;
|
||||
import org.apache.poi.xssf.streaming.SXSSFWorkbook;
|
||||
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcOperations;
|
||||
import org.springframework.orm.hibernate5.support.HibernateDaoSupport;
|
||||
|
||||
|
||||
import kernel.util.Arith;
|
||||
import kernel.util.DateUtils;
|
||||
import kernel.util.PoiUtil;
|
||||
import kernel.util.StringUtils;
|
||||
import kernel.web.Page;
|
||||
import kernel.web.PagedQueryDao;
|
||||
import project.Constants;
|
||||
import project.party.recom.UserRecomService;
|
||||
import project.web.admin.service.report.AdminAllStatisticsService;
|
||||
|
||||
public class AdminAllStatisticsServiceImpl extends HibernateDaoSupport implements AdminAllStatisticsService {
|
||||
|
||||
private PagedQueryDao pagedQueryDao;
|
||||
|
||||
// private JdbcTemplate jdbcTemplate;
|
||||
private UserRecomService userRecomService;
|
||||
private NamedParameterJdbcOperations namedParameterJdbcTemplate;
|
||||
|
||||
public Page pagedQuery(int pageNo, int pageSize,String startTime,String endTime,String loginPartyId) {
|
||||
Map<String,Object> parameters = new HashMap<String,Object>();
|
||||
StringBuffer queryString = new StringBuffer("SELECT ");
|
||||
queryString.append("DATE_FORMAT(ud.CREATE_TIME,\"%Y-%m-%d\") AS date, ");//日期
|
||||
queryString.append("SUM(ud.RECHARGE_DAPP) AS recharge_dapp,SUM(ud.RECHARGE) AS recharge,SUM(ud.RECHARGE_USDT) AS recharge_usdt,SUM(ud.RECHARGE_ETH) AS recharge_eth,SUM(ud.RECHARGE_BTC) AS recharge_btc,IFNULL(SUM(ud.RECHARGE_HT),0) AS recharge_ht,IFNULL(SUM(ud.RECHARGE_LTC),0) AS recharge_ltc,"
|
||||
+ "SUM(ud.WITHDRAW_DAPP) AS withdraw_dapp,SUM(ud.WITHDRAW) AS withdraw,IFNULL(SUM(ud.WITHDRAW_ETH),0) AS withdraw_eth,IFNULL(SUM(ud.WITHDRAW_BTC),0) AS withdraw_btc,"
|
||||
+ "SUM(ud.RECHARGE_WITHDRAWAL_FEE) AS recharge_withdrawal_fee,SUM(ud.GIFT_MONEY) AS gift_money,SUM(ud.RECHARGE)-SUM(ud.WITHDRAW) AS balance_amount, ");//充提
|
||||
queryString.append("SUM(ud.AMOUNT) AS amount,SUM(ud.FEE) AS fee,SUM(ud.ORDER_INCOME) AS order_income, IFNULL(SUM(ud.RECHARGE_COMMISSION),0) AS rechargeCommission, IFNULL(SUM(ud.WITHDRAW_COMMISSION),0) AS withdrawCommission,");//永续
|
||||
queryString.append("SUM(ud.FINANCE_AMOUNT) AS finance_amount,SUM(ud.FINANCE_INCOME) AS finance_income, ");//理财
|
||||
queryString.append("SUM(ud.EXCHANGE_AMOUNT) AS exchange_amount,SUM(ud.EXCHANGE_FEE) AS exchange_fee,SUM(ud.EXCHANGE_INCOME) AS exchange_income,SUM(ud.COIN_INCOME) AS coin_income, ");//币币
|
||||
queryString.append("SUM(ud.FURTURES_AMOUNT) AS furtures_amount,SUM(ud.FURTURES_FEE) AS furtures_fee,SUM(ud.FURTURES_INCOME) AS furtures_income, ");//交割
|
||||
queryString.append("IFNULL(SUM(ud.MINER_AMOUNT),0) AS miner_amount,IFNULL(SUM(ud.MINER_INCOME),0) AS miner_income, ");//矿机
|
||||
queryString.append("IFNULL(SUM(ud.THIRD_RECHARGE_AMOUNT),0) AS third_recharge_amount, ");//三方充值
|
||||
queryString.append("IFNULL(SUM(ud.EXCHANGE_LEVER_AMOUNT),0) AS exchange_lever_amount,IFNULL(SUM(ud.EXCHANGE_LEVER_FEE),0) AS exchange_lever_fee,IFNULL(SUM(ud.EXCHANGE_LEVER_ORDER_INCOME),0) AS exchange_lever_order_income, ");//币币杠杆
|
||||
queryString.append(" SUM(ud.REBATE_1) + SUM(ud.REBATE_2) rebateLump, IFNULL(SUM(ud.TRANSLATE),0) AS translate, IFNULL(SUM(ud.SELLER_TOTAL_SALES),0) AS sellerTotalSales, IFNULL(SUM(ud.SELLER_COMMISSION),0) AS sellerCommission ");
|
||||
queryString.append("FROM T_USERDATA ud ");
|
||||
// queryString.append("LEFT JOIN PAT_PARTY party ON ud.PARTY_ID = party.UUID ");
|
||||
|
||||
queryString.append("WHERE 1=1 ");
|
||||
// queryString.append("AND ud.ROLENAME ='"+Constants.SECURITY_ROLE_MEMBER+"' ");
|
||||
// queryString.append("AND party.ROLENAME ='"+Constants.SECURITY_ROLE_MEMBER+"' ");
|
||||
if (!StringUtils.isNullOrEmpty(loginPartyId)) {
|
||||
List children = this.userRecomService.findChildren(loginPartyId);
|
||||
if (children.size() == 0) {
|
||||
return new Page();
|
||||
}
|
||||
queryString.append(" and ud.PARTY_ID in (:children) ");
|
||||
parameters.put("children", children);
|
||||
}
|
||||
if (!StringUtils.isNullOrEmpty(startTime)) {
|
||||
queryString.append("AND DATE(ud.CREATE_TIME) >= DATE(:startTime) ");
|
||||
parameters.put("startTime",DateUtils.toDate(startTime));
|
||||
}
|
||||
if (!StringUtils.isNullOrEmpty(endTime)) {
|
||||
queryString.append("AND DATE(ud.CREATE_TIME) <= DATE(:endTime) ");
|
||||
parameters.put("endTime", DateUtils.toDate(endTime));
|
||||
}
|
||||
queryString.append("GROUP BY DATE(ud.CREATE_TIME) ");
|
||||
queryString.append("ORDER BY DATE(ud.CREATE_TIME) DESC ");
|
||||
Page page = this.pagedQueryDao.pagedQuerySQL(pageNo, pageSize, queryString.toString(), parameters);
|
||||
// page.setElements(format(page.getElements()));
|
||||
compute(page.getElements(),false);
|
||||
return page;
|
||||
}
|
||||
|
||||
public Map<String,Object> daySumData(String loginPartyId,String day){
|
||||
Map<String,Object> parameters = new HashMap<String,Object>();
|
||||
StringBuffer queryString = new StringBuffer("SELECT ");
|
||||
// queryString.append("DATE_FORMAT(ud.CREATE_TIME,\"%Y-%m-%d\") AS date, ");//日期
|
||||
queryString.append("IFNULL(SUM(ud.RECHARGE),0) AS recharge,IFNULL(SUM(ud.RECHARGE_USDT),0) AS recharge_usdt,IFNULL(SUM(ud.RECHARGE_ETH),0) AS recharge_eth,IFNULL(SUM(ud.RECHARGE_BTC),0) AS recharge_btc,IFNULL(SUM(ud.RECHARGE_HT),0) AS recharge_ht,IFNULL(SUM(ud.RECHARGE_LTC),0) AS recharge_ltc,"
|
||||
+ "IFNULL(SUM(ud.WITHDRAW),0) AS withdraw,IFNULL(SUM(ud.RECHARGE_WITHDRAWAL_FEE),0) AS recharge_withdrawal_fee,IFNULL(SUM(ud.RECHARGE_USDT)-SUM(ud.WITHDRAW),0) AS balance_amount, ");//充提
|
||||
queryString.append("IFNULL(SUM(ud.FEE),0) AS fee,IFNULL(SUM(ud.ORDER_INCOME),0) AS order_income, ");//永续
|
||||
queryString.append("IFNULL(SUM(ud.FINANCE_AMOUNT),0) AS finance_amount,IFNULL(SUM(ud.FINANCE_INCOME),0) AS finance_income, ");//理财
|
||||
queryString.append("IFNULL(SUM(ud.EXCHANGE_FEE),0) AS exchange_fee,IFNULL(SUM(ud.EXCHANGE_INCOME),0) AS exchange_income, ");//币币
|
||||
queryString.append("IFNULL(SUM(ud.FURTURES_FEE),0) AS furtures_fee,IFNULL(SUM(ud.FURTURES_INCOME),0) AS furtures_income, ");//交割
|
||||
queryString.append("IFNULL(SUM(ud.MINER_AMOUNT),0) AS miner_amount,IFNULL(SUM(ud.MINER_INCOME),0) AS miner_income, ");//矿机
|
||||
queryString.append("IFNULL(SUM(ud.THIRD_RECHARGE_AMOUNT),0) AS third_recharge_amount, ");//三方充值
|
||||
queryString.append("IFNULL(SUM(ud.EXCHANGE_LEVER_AMOUNT),0) AS exchange_lever_amount,IFNULL(SUM(ud.EXCHANGE_LEVER_FEE),0) AS exchange_lever_fee,IFNULL(SUM(ud.EXCHANGE_LEVER_ORDER_INCOME),0) AS exchange_lever_order_income ");//币币杠杆
|
||||
queryString.append("FROM T_USERDATA ud ");
|
||||
queryString.append("WHERE 1=1 ");
|
||||
queryString.append("AND ud.ROLENAME ='"+Constants.SECURITY_ROLE_MEMBER+"' ");
|
||||
if (!StringUtils.isNullOrEmpty(loginPartyId)) {
|
||||
List children = this.userRecomService.findChildren(loginPartyId);
|
||||
if (children.size() == 0) {
|
||||
return new HashMap<String,Object>();
|
||||
}
|
||||
queryString.append(" and ud.PARTY_ID in (:children) ");
|
||||
parameters.put("children", children);
|
||||
}
|
||||
if (!StringUtils.isNullOrEmpty(day)) {
|
||||
queryString.append("AND DATE(ud.CREATE_TIME) = DATE(:day) ");
|
||||
parameters.put("day", DateUtils.toDate(day));
|
||||
}
|
||||
List<Map<String, Object>> queryForList = this.namedParameterJdbcTemplate.queryForList( queryString.toString(), parameters);
|
||||
compute(queryForList,false);
|
||||
return queryForList.get(0);
|
||||
}
|
||||
/**
|
||||
* 计算 统计时
|
||||
* @param datas
|
||||
* @param isSum
|
||||
*/
|
||||
private void compute(List<Map<String,Object>> datas,boolean isSum) {
|
||||
if(CollectionUtils.isEmpty(datas)) return;
|
||||
Double totle_income=0d;
|
||||
Double totle_fee = 0d;
|
||||
Double business_profit = 0d;//交易盈亏
|
||||
Double fin_miner_amount = 0d;//理财 矿机 交易额
|
||||
Double fin_miner_income = 0d;//理财 矿机 收益
|
||||
for(Map<String,Object> data:datas) {
|
||||
|
||||
totle_income=0d;
|
||||
totle_fee = 0d;
|
||||
business_profit = 0d;
|
||||
fin_miner_amount = 0d;
|
||||
fin_miner_income = 0d;
|
||||
if(null != data.get("order_income"))
|
||||
data.put("order_income", Arith.sub(0, new Double(data.get("order_income").toString())));//订单收益负数
|
||||
if(null != data.get("finance_income"))
|
||||
data.put("finance_income", Arith.sub(0, new Double(data.get("finance_income").toString())));//理财收益负数
|
||||
if(null != data.get("exchange_income"))
|
||||
// data.put("exchange_income", Arith.sub(0, new Double(data.get("exchange_income").toString())));//币币收益负数
|
||||
data.put("exchange_income",0);//币币收益负数
|
||||
if(null != data.get("furtures_income"))
|
||||
data.put("furtures_income", Arith.sub(0, new Double(data.get("furtures_income").toString())));//交割收益负数
|
||||
if (null != data.get("miner_income"))
|
||||
data.put("miner_income", Arith.sub(0, new Double(data.get("miner_income").toString())));// 矿机收益负数
|
||||
if (null != data.get("exchange_lever_order_income"))
|
||||
data.put("exchange_lever_order_income", Arith.sub(0, new Double(data.get("exchange_lever_order_income").toString())));// 币币收益负数
|
||||
|
||||
if(!dataExistNull(data)) continue;
|
||||
totle_income = Arith.add(totle_income,new Double(data.get("recharge_withdrawal_fee").toString()));
|
||||
totle_income = Arith.add(totle_income,new Double(data.get("order_income").toString()));
|
||||
totle_income = Arith.add(totle_income,new Double(data.get("fee").toString()));
|
||||
totle_income = Arith.add(totle_income,new Double(data.get("finance_income").toString()));
|
||||
totle_income = Arith.add(totle_income,new Double(data.get("exchange_fee").toString()));
|
||||
totle_income = Arith.add(totle_income,new Double(0));
|
||||
// totle_income = Arith.add(totle_income,new Double(data.get("exchange_income").toString()));
|
||||
totle_income = Arith.add(totle_income,new Double(data.get("furtures_fee").toString()));
|
||||
totle_income = Arith.add(totle_income,new Double(data.get("furtures_income").toString()));
|
||||
totle_income = Arith.add(totle_income,new Double(data.get("miner_income").toString()));
|
||||
totle_income = Arith.add(totle_income,new Double(data.get("exchange_lever_order_income").toString()));
|
||||
data.put("totle_income", totle_income);
|
||||
|
||||
totle_fee = Arith.add(totle_fee, new Double(data.get("recharge_withdrawal_fee").toString()));
|
||||
totle_fee = Arith.add(totle_fee, new Double(data.get("fee").toString()));
|
||||
totle_fee = Arith.add(totle_fee, new Double(data.get("exchange_fee").toString()));
|
||||
totle_fee = Arith.add(totle_fee, new Double(data.get("furtures_fee").toString()));
|
||||
totle_fee = Arith.add(totle_fee, new Double(data.get("exchange_lever_fee").toString()));
|
||||
data.put("totle_fee", totle_fee);
|
||||
|
||||
business_profit = Arith.add(business_profit, new Double(data.get("order_income").toString()));
|
||||
business_profit = Arith.add(business_profit, new Double(data.get("exchange_income").toString()));
|
||||
business_profit = Arith.add(business_profit, new Double(data.get("furtures_income").toString()));
|
||||
business_profit = Arith.add(business_profit, new Double(data.get("exchange_lever_order_income").toString()));
|
||||
data.put("business_profit", business_profit);
|
||||
|
||||
fin_miner_amount = Arith.add(fin_miner_amount, new Double(data.get("finance_amount").toString()));
|
||||
fin_miner_amount = Arith.add(fin_miner_amount, new Double(data.get("miner_amount").toString()));
|
||||
data.put("fin_miner_amount", fin_miner_amount);
|
||||
|
||||
fin_miner_income = Arith.add(fin_miner_income, new Double(data.get("finance_income").toString()));
|
||||
fin_miner_income = Arith.add(fin_miner_income, new Double(data.get("miner_income").toString()));
|
||||
data.put("fin_miner_income", fin_miner_income);
|
||||
|
||||
data.put("recharge_btc", new BigDecimal(data.get("recharge_btc").toString()).setScale(8, RoundingMode.FLOOR).toPlainString());//订单收益负数
|
||||
// data.put("recharge_usdt", new BigDecimal(data.get("recharge_usdt").toString()).setScale(4, RoundingMode.FLOOR).toPlainString());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 统计的数据存在空时,不统计总额
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
private boolean dataExistNull(Map<String,Object> data) {
|
||||
if(null == data.get("recharge_withdrawal_fee")) return false;
|
||||
if(null == data.get("order_income")) return false;
|
||||
if(null == data.get("fee")) return false;
|
||||
if(null == data.get("finance_income")) return false;
|
||||
if(null == data.get("exchange_fee")) return false;
|
||||
if(null == data.get("exchange_income")) return false;
|
||||
if(null == data.get("furtures_fee")) return false;
|
||||
if(null == data.get("furtures_income")) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
public Map<String,Object> sumDatas(String startTime,String endTime,String loginPartyId){
|
||||
Map<String,Object> parameters = new HashMap<String,Object>();
|
||||
StringBuffer queryString = new StringBuffer("SELECT ");
|
||||
// queryString.append("DATE_FORMAT(ud.CREATE_TIME,\"%Y-%m-%d\") AS date, ");//日期
|
||||
queryString.append("IFNULL(SUM(ud.RECHARGE_DAPP),0) AS recharge_dapp,IFNULL(SUM(ud.RECHARGE),0) AS recharge,IFNULL(SUM(ud.RECHARGE_USDT),0) AS recharge_usdt,IFNULL(SUM(ud.RECHARGE_ETH),0) AS recharge_eth,IFNULL(SUM(ud.RECHARGE_BTC),0) AS recharge_btc,IFNULL(SUM(ud.RECHARGE_HT),0) AS recharge_ht,IFNULL(SUM(ud.RECHARGE_LTC),0) AS recharge_ltc,"
|
||||
+ "IFNULL(SUM(ud.WITHDRAW_DAPP),0) AS withdraw_dapp,IFNULL(SUM(ud.WITHDRAW),0) AS withdraw,IFNULL(SUM(ud.WITHDRAW_ETH),0) AS withdraw_eth,IFNULL(SUM(ud.WITHDRAW_BTC),0) AS withdraw_btc,"
|
||||
+ "IFNULL(SUM(ud.RECHARGE_WITHDRAWAL_FEE),0) AS recharge_withdrawal_fee,IFNULL(SUM(ud.GIFT_MONEY),0) AS gift_money,IFNULL(SUM(ud.RECHARGE)-SUM(ud.WITHDRAW),0) AS balance_amount, IFNULL(SUM(ud.RECHARGE_COMMISSION),0) AS rechargeCommission, IFNULL(SUM(ud.WITHDRAW_COMMISSION),0) AS withdrawCommission," );//充提
|
||||
queryString.append("IFNULL(SUM(ud.AMOUNT),0) AS amount,IFNULL(SUM(ud.FEE),0) AS fee,IFNULL(SUM(ud.ORDER_INCOME),0) AS order_income, ");//永续
|
||||
queryString.append("IFNULL(SUM(ud.FINANCE_AMOUNT),0) AS finance_amount,IFNULL(SUM(ud.FINANCE_INCOME),0) AS finance_income, ");//理财
|
||||
queryString.append("IFNULL(SUM(ud.EXCHANGE_AMOUNT),0) AS exchange_amount,IFNULL(SUM(ud.EXCHANGE_FEE),0) AS exchange_fee,IFNULL(SUM(ud.EXCHANGE_INCOME),0) AS exchange_income,IFNULL(SUM(ud.COIN_INCOME),0) AS coin_income, ");//币币
|
||||
queryString.append("IFNULL(SUM(ud.FURTURES_AMOUNT),0) AS furtures_amount,IFNULL(SUM(ud.FURTURES_FEE),0) AS furtures_fee,IFNULL(SUM(ud.FURTURES_INCOME),0) AS furtures_income, ");//交割
|
||||
queryString.append("IFNULL(SUM(ud.MINER_AMOUNT),0) AS miner_amount,IFNULL(SUM(ud.MINER_INCOME),0) AS miner_income, ");//矿机
|
||||
queryString.append("IFNULL(SUM(ud.THIRD_RECHARGE_AMOUNT),0) AS third_recharge_amount, ");//三方充值
|
||||
queryString.append("IFNULL(SUM(ud.EXCHANGE_LEVER_AMOUNT),0) AS exchange_lever_amount,IFNULL(SUM(ud.EXCHANGE_LEVER_FEE),0) AS exchange_lever_fee,IFNULL(SUM(ud.EXCHANGE_LEVER_ORDER_INCOME),0) AS exchange_lever_order_income, ");//币币杠杆
|
||||
queryString.append("IFNULL(SUM(ud.REBATE_1) + SUM(ud.REBATE_2),0) rebateLump, IFNULL(SUM(ud.TRANSLATE),0) as translate, IFNULL(SUM(ud.SELLER_TOTAL_SALES),0) as sellerTotalSales ");// 用户佣金
|
||||
|
||||
queryString.append("FROM T_USERDATA ud ");
|
||||
// queryString.append("LEFT JOIN PAT_PARTY party ON ud.PARTY_ID = party.UUID ");
|
||||
queryString.append("WHERE 1=1 ");
|
||||
// queryString.append("AND ud.ROLENAME ='"+Constants.SECURITY_ROLE_MEMBER+"' ");
|
||||
// queryString.append("AND party.ROLENAME ='"+Constants.SECURITY_ROLE_MEMBER+"' ");
|
||||
if (!StringUtils.isNullOrEmpty(loginPartyId)) {
|
||||
List children = this.userRecomService.findChildren(loginPartyId);
|
||||
if (children.size() == 0) {
|
||||
return new HashMap<String, Object>();
|
||||
}
|
||||
queryString.append(" and ud.PARTY_ID in (:children) ");
|
||||
parameters.put("children", children);
|
||||
}
|
||||
if (!StringUtils.isNullOrEmpty(startTime)) {
|
||||
queryString.append("AND DATE(ud.CREATE_TIME) >= DATE(:startTime) ");
|
||||
parameters.put("startTime",DateUtils.toDate(startTime));
|
||||
}
|
||||
if (!StringUtils.isNullOrEmpty(endTime)) {
|
||||
queryString.append("AND DATE(ud.CREATE_TIME) <= DATE(:endTime) ");
|
||||
parameters.put("endTime", DateUtils.toDate(endTime));
|
||||
}
|
||||
// queryString.append("GROUP BY DATE(ud.CREATE_TIME) ");
|
||||
queryString.append("ORDER BY DATE(ud.CREATE_TIME) DESC ");
|
||||
List<Map<String, Object>> queryForList = this.namedParameterJdbcTemplate.queryForList( queryString.toString(), parameters);
|
||||
compute(queryForList,true);
|
||||
return queryForList.get(0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public String loadExportData(HttpServletResponse response, int pageSize,String startTime,String endTime,String loginPartyId) throws IOException {
|
||||
//生成数据信息
|
||||
int sheetNum = 0;
|
||||
// 生成表头
|
||||
Integer i = 0;
|
||||
// 在内存中保持100行,超过100行将被刷新到磁盘
|
||||
// HSSFWorkbook wb = new HSSFWorkbook();//excel文件,一个excel文件包含多个表
|
||||
// HSSFSheet sheet = wb.createSheet();//表,一个表包含多个行
|
||||
SXSSFWorkbook wb = new SXSSFWorkbook(100);
|
||||
Sheet sheet = wb.createSheet(); // 表,一个表包含多个行
|
||||
Drawing patriarch = sheet.createDrawingPatriarch();
|
||||
CellStyle style = wb.createCellStyle();
|
||||
Row row = null;// 行,一行包括多个单元格
|
||||
Cell cell = null;// 单元格
|
||||
Page page = null;
|
||||
int pageNo =1;
|
||||
|
||||
Map<String,Integer[]> headMap = new LinkedHashMap<String,Integer[]>();
|
||||
// <td colspan="1" style="text-align:center;">日期</td>
|
||||
// <td colspan="4" style="text-align:center;">充提统计</td>
|
||||
// <td colspan="3" style="text-align:center;">永续订单统计</td>
|
||||
// <td colspan="1" style="text-align:center;">币币交易统计</td>
|
||||
// <td colspan="1" rowspan="2" style="text-align:center;">收益</td>
|
||||
headMap.put("日期", new Integer[] {1,1});
|
||||
headMap.put("充提", new Integer[] {0,9});
|
||||
headMap.put("永续合约", new Integer[] {0,2});
|
||||
headMap.put("理财收益", new Integer[] {1,1});
|
||||
headMap.put("币币", new Integer[] {0,2});
|
||||
headMap.put("交割合约", new Integer[] {0,2});
|
||||
headMap.put("收益", new Integer[] {1,1});
|
||||
|
||||
createMergedHead(wb, sheet,headMap,i++);
|
||||
|
||||
while (true) {
|
||||
page = this.pagedQuery(pageNo, pageSize, startTime, endTime,loginPartyId);
|
||||
if (sheetNum == 0 && (page == null || page.getElements() == null || page.getElements().size() == 0)) {
|
||||
return "无导出数据!";
|
||||
}
|
||||
|
||||
|
||||
String[] headTitles = { "日期",
|
||||
"USDT充值","ETH充值","BTC充值","充值总额(USDT计价)","赠送","提现","手续费","充提差额(USDT)","充提总差额(USDT计价)",
|
||||
"手续费","订单收益",
|
||||
"收益",
|
||||
"手续费","收益",
|
||||
"手续费","订单收益"};
|
||||
if (i == 1)
|
||||
PoiUtil.createHead(response, headTitles, wb, sheet, style, row, cell, i,
|
||||
"总收益统计_" + DateUtils.format(new Date(), DateUtils.DEFAULT_DATE_FORMAT),
|
||||
"总收益统计_" + DateUtils.format(new Date(), DateUtils.DEFAULT_DATE_FORMAT) + ".xlsx");
|
||||
List<Object[]> list = this.dataBachHandel(page.getElements());
|
||||
|
||||
if (page.getElements() != null) {
|
||||
|
||||
i = PoiUtil.createCell(list, patriarch, wb, sheet, row, cell, style, i);
|
||||
list.clear();
|
||||
|
||||
if (page.getElements().size() < pageSize || i >= 59999) {
|
||||
PoiUtil.out(wb, response);
|
||||
break;
|
||||
}
|
||||
sheetNum++;
|
||||
pageNo++;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
private void createMergedHead(SXSSFWorkbook wb,Sheet sheet,Map<String,Integer[]> headMap,int i) {
|
||||
Font font = wb.createFont();
|
||||
font.setFontHeightInPoints((short) 10);
|
||||
font.setFontName("Courier New");
|
||||
CellStyle style = wb.createCellStyle();
|
||||
style.setFont(font);
|
||||
style.setWrapText(true);
|
||||
style.setAlignment(HorizontalAlignment.CENTER);
|
||||
style.setVerticalAlignment(VerticalAlignment.CENTER);
|
||||
Row row = sheet.createRow(i);
|
||||
int rowPosition = 0;//行坐标
|
||||
int cellPosition = 0;//列坐标
|
||||
for(Entry<String, Integer[]> entry:headMap.entrySet()) {
|
||||
Cell cell = row.createCell(cellPosition);
|
||||
cell.setCellStyle(style);
|
||||
cell.setCellValue(entry.getKey());
|
||||
CellRangeAddress region = new CellRangeAddress(rowPosition, rowPosition+entry.getValue()[0], cellPosition, cellPosition+entry.getValue()[1]-1);
|
||||
sheet.addMergedRegion(region);
|
||||
cellPosition+=entry.getValue()[1];
|
||||
}
|
||||
}
|
||||
|
||||
public List<Object[]> dataBachHandel(List<Map<String,Object>> list){
|
||||
List<Object[]> result = new ArrayList<Object[]>();
|
||||
int i = 0;
|
||||
for(Map<String,Object> data:list) {
|
||||
i = 0;
|
||||
Object[] objs = new Object[18];
|
||||
objs[i++] = data.get("date");
|
||||
|
||||
|
||||
objs[i++] = data.get("recharge_usdt");
|
||||
objs[i++] = data.get("recharge_eth");
|
||||
objs[i++] = data.get("recharge_btc");
|
||||
objs[i++] = data.get("recharge");
|
||||
objs[i++] = data.get("gift_money");
|
||||
objs[i++] = data.get("withdraw");
|
||||
objs[i++] = data.get("recharge_withdrawal_fee");//TODO
|
||||
double recharge_usdt = 0D;
|
||||
double withdraw = 0D;
|
||||
if (null != data.get("recharge_usdt")) {
|
||||
recharge_usdt = Double.parseDouble(data.get("recharge_usdt").toString());
|
||||
}
|
||||
if (null != data.get("withdraw")) {
|
||||
withdraw = Double.parseDouble(data.get("withdraw").toString());
|
||||
}
|
||||
objs[i++] = Arith.sub(recharge_usdt, withdraw);
|
||||
objs[i++] = data.get("balance_amount");
|
||||
|
||||
// objs[i++] = data.get("amount");
|
||||
objs[i++] = data.get("fee");
|
||||
objs[i++] = data.get("order_income");
|
||||
|
||||
// objs[i++] = data.get("finance_amount");
|
||||
objs[i++] = data.get("finance_income");
|
||||
|
||||
// objs[i++] = data.get("exchange_amount");
|
||||
objs[i++] = data.get("exchange_fee");
|
||||
// objs[i++] = data.get("exchange_income");
|
||||
objs[i++] = 0;
|
||||
|
||||
// objs[i++] = data.get("furtures_amount");
|
||||
objs[i++] = data.get("furtures_fee");
|
||||
objs[i++] = data.get("furtures_income");
|
||||
|
||||
objs[i++] = data.get("totle_income");
|
||||
|
||||
result.add(objs);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
public PagedQueryDao getPagedQueryDao() {
|
||||
return pagedQueryDao;
|
||||
}
|
||||
|
||||
public void setPagedQueryDao(PagedQueryDao pagedQueryDao) {
|
||||
this.pagedQueryDao = pagedQueryDao;
|
||||
}
|
||||
|
||||
public NamedParameterJdbcOperations getNamedParameterJdbcTemplate() {
|
||||
return namedParameterJdbcTemplate;
|
||||
}
|
||||
|
||||
public void setNamedParameterJdbcTemplate(NamedParameterJdbcOperations namedParameterJdbcTemplate) {
|
||||
this.namedParameterJdbcTemplate = namedParameterJdbcTemplate;
|
||||
}
|
||||
public void setUserRecomService(UserRecomService userRecomService) {
|
||||
this.userRecomService = userRecomService;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,774 @@
|
||||
package project.web.admin.impl.report;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.poi.ss.usermodel.Cell;
|
||||
import org.apache.poi.ss.usermodel.CellStyle;
|
||||
import org.apache.poi.ss.usermodel.Drawing;
|
||||
import org.apache.poi.ss.usermodel.Font;
|
||||
import org.apache.poi.ss.usermodel.HorizontalAlignment;
|
||||
import org.apache.poi.ss.usermodel.Row;
|
||||
import org.apache.poi.ss.usermodel.Sheet;
|
||||
import org.apache.poi.ss.usermodel.VerticalAlignment;
|
||||
import org.apache.poi.ss.util.CellRangeAddress;
|
||||
import org.apache.poi.xssf.streaming.SXSSFWorkbook;
|
||||
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcOperations;
|
||||
import org.springframework.orm.hibernate5.support.HibernateDaoSupport;
|
||||
|
||||
import kernel.exception.BusinessException;
|
||||
import kernel.util.Arith;
|
||||
import kernel.util.DateUtils;
|
||||
import kernel.util.PoiUtil;
|
||||
import kernel.util.StringUtils;
|
||||
import kernel.web.Page;
|
||||
import kernel.web.PagedQueryDao;
|
||||
import project.Constants;
|
||||
import project.data.DataService;
|
||||
import project.party.recom.UserRecomService;
|
||||
import project.syspara.SysparaService;
|
||||
import project.wallet.AssetService;
|
||||
import project.wallet.Wallet;
|
||||
import project.wallet.WalletExtend;
|
||||
import project.wallet.WalletService;
|
||||
import project.web.admin.service.report.AdminUserAllStatisticsService;
|
||||
|
||||
public class AdminUserAllStatisticsServiceImpl extends HibernateDaoSupport implements AdminUserAllStatisticsService {
|
||||
|
||||
protected PagedQueryDao pagedQueryDao;
|
||||
protected UserRecomService userRecomService;
|
||||
protected WalletService walletService;
|
||||
// protected FinanceOrderService financeOrderService;
|
||||
protected SysparaService sysparaService;
|
||||
protected DataService dataService;
|
||||
// protected MinerOrderService minerOrderService;
|
||||
protected AssetService assetService;
|
||||
|
||||
private NamedParameterJdbcOperations namedParameterJdbcTemplate;
|
||||
|
||||
private List<String> rootAgentId() {
|
||||
Map<String,Object> parameters = new HashMap<String,Object>();
|
||||
StringBuffer queryString = new StringBuffer();
|
||||
queryString.append(
|
||||
"SELECT party.UUID AS partyId ");// 用户
|
||||
queryString.append("FROM PAT_PARTY party ");
|
||||
queryString.append("LEFT JOIN PAT_USER_RECOM ur ON party.UUID = ur.PARTY_ID ");// 推荐人 根目录判定
|
||||
queryString.append("WHERE 1=1 ");
|
||||
queryString.append("AND party.ROLENAME IN('" + Constants.SECURITY_ROLE_AGENT + "','"+Constants.SECURITY_ROLE_AGENTLOW +"') ");
|
||||
queryString.append(" and ur.RECO_ID is NULL ");
|
||||
Page page = this.pagedQueryDao.pagedQuerySQL(1, Integer.MAX_VALUE, queryString.toString(), parameters);
|
||||
List<String> rootIds = new ArrayList<String>();
|
||||
for(Map<String,Object> data:(List<Map<String,Object>>)page.getElements()) {
|
||||
rootIds.add(data.get("partyId").toString());
|
||||
}
|
||||
Set<String> userIds = new HashSet<String>();
|
||||
for(String partyId:rootIds) {
|
||||
userIds.addAll(userRecomService.findChildren(partyId));
|
||||
}
|
||||
return new ArrayList<String>(userIds);
|
||||
}
|
||||
public Page pagedQueryNoAgentParent(int pageNo, int pageSize,String startTime,String endTime,String loginPartyId,String usernameOrUid,String roleName,String targetPartyId,boolean isAgentView,String sortColumn,String sortType) {
|
||||
Map<String,Object> parameters = new HashMap<String,Object>();
|
||||
StringBuffer queryString = new StringBuffer();
|
||||
queryString.append("SELECT party.ROLENAME AS rolename,party.USERNAME AS username,party.USERCODE AS UID,IFNULL(uds.RECO_NUM,0) AS reco_num,party.UUID AS partyId,IFNULL(wallet.MONEY,0) AS money, ");//用户
|
||||
queryString.append("IFNULL(SUM(ud.RECHARGE),0) AS recharge,IFNULL(SUM(ud.RECHARGE_USDT),0) AS recharge_usdt,IFNULL(SUM(ud.RECHARGE_ETH),0) AS recharge_eth,IFNULL(SUM(ud.RECHARGE_BTC),0) AS recharge_btc,IFNULL(SUM(ud.RECHARGE_HT),0) AS recharge_ht,IFNULL(SUM(ud.RECHARGE_LTC),0) AS recharge_ltc,"
|
||||
+ "IFNULL(SUM(ud.WITHDRAW),0) AS withdraw,IFNULL(SUM(ud.WITHDRAW_ETH),0) AS withdraw_eth,IFNULL(SUM(ud.WITHDRAW_BTC),0) AS withdraw_btc,"
|
||||
+ "IFNULL(SUM(ud.RECHARGE_WITHDRAWAL_FEE),0) AS recharge_withdrawal_fee,IFNULL(SUM(ud.GIFT_MONEY),0) AS gift_money,IFNULL(SUM(ud.RECHARGE)-SUM(ud.WITHDRAW),0) AS balance_amount, ");//充提
|
||||
queryString.append("IFNULL(SUM(ud.AMOUNT),0) AS amount,IFNULL(SUM(ud.FEE),0) AS fee,IFNULL(SUM(ud.ORDER_INCOME),0) AS order_income, ");//永续
|
||||
queryString.append("IFNULL(SUM(ud.FINANCE_AMOUNT),0) AS finance_amount,IFNULL(SUM(ud.FINANCE_INCOME),0) AS finance_income, ");//理财
|
||||
queryString.append("IFNULL(SUM(ud.EXCHANGE_AMOUNT),0) AS exchange_amount,IFNULL(SUM(ud.EXCHANGE_FEE),0) AS exchange_fee,IFNULL(SUM(ud.EXCHANGE_INCOME),0) AS exchange_income,IFNULL(SUM(ud.COIN_INCOME),0) AS coin_income, ");//币币
|
||||
queryString.append("IFNULL(SUM(ud.FURTURES_AMOUNT),0) AS furtures_amount,IFNULL(SUM(ud.FURTURES_FEE),0) AS furtures_fee,IFNULL(SUM(ud.FURTURES_INCOME),0) AS furtures_income, ");//交割
|
||||
queryString.append("IFNULL(SUM(ud.MINER_AMOUNT),0) AS miner_amount,IFNULL(SUM(ud.MINER_INCOME),0) AS miner_income, ");//矿机
|
||||
queryString.append("IFNULL(SUM(ud.THIRD_RECHARGE_AMOUNT),0) AS third_recharge_amount, ");//三方充值
|
||||
queryString.append("IFNULL(SUM(ud.EXCHANGE_LEVER_AMOUNT),0) AS exchange_lever_amount,IFNULL(SUM(ud.EXCHANGE_LEVER_FEE),0) AS exchange_lever_fee,IFNULL(SUM(ud.EXCHANGE_LEVER_ORDER_INCOME),0) AS exchange_lever_order_income ");//币币杠杆
|
||||
// queryString.append("FROM T_USERDATA ud ");
|
||||
// queryString.append("LEFT JOIN PAT_PARTY party ON ud.PARTY_ID = party.UUID ");
|
||||
queryString.append("FROM PAT_PARTY party ");
|
||||
queryString.append("LEFT JOIN T_USERDATA ud ON ud.PARTY_ID = party.UUID ");
|
||||
if (!StringUtils.isNullOrEmpty(startTime)) {
|
||||
queryString.append("AND DATE(ud.CREATE_TIME) >= DATE(:startTime) ");
|
||||
parameters.put("startTime",DateUtils.toDate(startTime));
|
||||
}
|
||||
if (!StringUtils.isNullOrEmpty(endTime)) {
|
||||
queryString.append("AND DATE(ud.CREATE_TIME) <= DATE(:endTime) ");
|
||||
parameters.put("endTime", DateUtils.toDate(endTime));
|
||||
}
|
||||
queryString.append("LEFT JOIN T_USERDATASUM uds ON ud.PARTY_ID = uds.PARTY_ID ");//推荐总数
|
||||
// queryString.append("LEFT JOIN PAT_USER_RECOM ur ON ud.PARTY_ID = ur.PARTY_ID ");//推荐人 根目录判定
|
||||
queryString.append("LEFT JOIN T_WALLET wallet ON party.UUID = wallet.PARTY_ID ");//
|
||||
queryString.append("WHERE 1=1 ");
|
||||
// queryString.append("AND party.ROLENAME IN('"+Constants.SECURITY_ROLE_MEMBER+"','"+Constants.SECURITY_ROLE_AGENT+"')");//限定用户权限只能是用户或代理商
|
||||
queryString.append("AND party.ROLENAME IN('"+Constants.SECURITY_ROLE_MEMBER+"')");//限定用户权限只能是用户或代理商
|
||||
if (!StringUtils.isNullOrEmpty(loginPartyId)) {
|
||||
List children = this.userRecomService.findChildren(loginPartyId);
|
||||
if (children.size() == 0) {
|
||||
return new Page();
|
||||
}
|
||||
queryString.append(" and party.UUID in (:children) ");
|
||||
parameters.put("children", children);
|
||||
}
|
||||
if (!StringUtils.isNullOrEmpty(targetPartyId)) {
|
||||
// List children = this.userRecomService.findChildren_1_Level(targetPartyId);
|
||||
List children = this.userRecomService.findChildren(targetPartyId);
|
||||
if (children.size() == 0) {
|
||||
return new Page();
|
||||
}
|
||||
queryString.append(" and party.UUID in (:children) ");
|
||||
parameters.put("children", children);
|
||||
}else if(isAgentView){//目标partyId为空的情况下,如果是视图,显示根目录
|
||||
// queryString.append(" and ur.RECO_ID is NULL ");
|
||||
// roleName = Constants.SECURITY_ROLE_AGENT;//改条件下只查代理商
|
||||
|
||||
roleName = "";
|
||||
queryString.append(" and party.ROLENAME in (:rolename_agent) ");
|
||||
parameters.put("rolename_agent",new ArrayList<String>( Arrays.asList(Constants.SECURITY_ROLE_AGENT,Constants.SECURITY_ROLE_AGENTLOW)));
|
||||
|
||||
}
|
||||
if (!StringUtils.isNullOrEmpty(usernameOrUid)) {
|
||||
queryString.append("AND (party.USERNAME like:username OR party.USERCODE like:username ) ");
|
||||
parameters.put("username","%"+usernameOrUid+"%");
|
||||
}
|
||||
if (!StringUtils.isNullOrEmpty(roleName)) {
|
||||
queryString.append("AND party.ROLENAME =:roleName ");
|
||||
parameters.put("roleName",roleName);
|
||||
}
|
||||
queryString.append(" and party.UUID not in (:agentChildren) ");
|
||||
parameters.put("agentChildren", rootAgentId());
|
||||
|
||||
|
||||
// if (!StringUtils.isNullOrEmpty(startTime)) {
|
||||
// queryString.append("AND DATE(ud.CREATE_TIME) >= DATE(:startTime) ");
|
||||
// parameters.put("startTime",DateUtils.toDate(startTime));
|
||||
// }
|
||||
// if (!StringUtils.isNullOrEmpty(endTime)) {
|
||||
// queryString.append("AND DATE(ud.CREATE_TIME) <= DATE(:endTime) ");
|
||||
// parameters.put("endTime", DateUtils.toDate(endTime));
|
||||
// }
|
||||
// queryString.append("GROUP BY ud.PARTY_ID ");
|
||||
queryString.append("GROUP BY party.UUID ");
|
||||
queryString.append("ORDER BY "+sortHandle(sortColumn, sortType)+" DATE(ud.CREATE_TIME) DESC ");
|
||||
Page page = this.pagedQueryDao.pagedQuerySQL(pageNo, pageSize, queryString.toString(), parameters);
|
||||
// page.setElements(format(page.getElements()));
|
||||
compute(page.getElements());
|
||||
return page;
|
||||
}
|
||||
public Page pagedQuery(int pageNo, int pageSize,String startTime,String endTime,String loginPartyId,String usernameOrUid,String roleName,String targetPartyId,boolean isAgentView,String sortColumn,String sortType) {
|
||||
Map<String,Object> parameters = new HashMap<String,Object>();
|
||||
StringBuffer queryString = new StringBuffer();
|
||||
queryString.append("SELECT party.ROLENAME AS rolename,party.USERNAME AS username,party.USERCODE AS UID,IFNULL(uds.RECO_NUM,0) AS reco_num,party.UUID AS partyId,IFNULL(wallet.MONEY,0) AS money,IFNULL(wallet_extend_usdt.AMOUNT,0) AS extend_usdt, ");//用户
|
||||
queryString.append("IFNULL(SUM(ud.RECHARGE),0) AS recharge,IFNULL(SUM(ud.RECHARGE_USDT),0) AS recharge_usdt,IFNULL(SUM(ud.RECHARGE_ETH),0) AS recharge_eth,IFNULL(SUM(ud.RECHARGE_BTC),0) AS recharge_btc,IFNULL(SUM(ud.RECHARGE_HT),0) AS recharge_ht,IFNULL(SUM(ud.RECHARGE_LTC),0) AS recharge_ltc,"
|
||||
+ "IFNULL(SUM(ud.WITHDRAW),0) AS withdraw,IFNULL(SUM(ud.WITHDRAW_ETH),0) AS withdraw_eth,IFNULL(SUM(ud.WITHDRAW_BTC),0) AS withdraw_btc,"
|
||||
+ "IFNULL(SUM(ud.RECHARGE_WITHDRAWAL_FEE),0) AS recharge_withdrawal_fee,IFNULL(SUM(ud.GIFT_MONEY),0) AS gift_money,IFNULL(SUM(ud.RECHARGE)-SUM(ud.WITHDRAW),0) AS balance_amount, ");//充提
|
||||
queryString.append("IFNULL(SUM(ud.AMOUNT),0) AS amount,IFNULL(SUM(ud.FEE),0) AS fee,IFNULL(SUM(ud.ORDER_INCOME),0) AS order_income, ");//永续
|
||||
queryString.append("IFNULL(SUM(ud.FINANCE_AMOUNT),0) AS finance_amount,IFNULL(SUM(ud.FINANCE_INCOME),0) AS finance_income, ");//理财
|
||||
queryString.append("IFNULL(SUM(ud.EXCHANGE_AMOUNT),0) AS exchange_amount,IFNULL(SUM(ud.EXCHANGE_FEE),0) AS exchange_fee,IFNULL(SUM(ud.EXCHANGE_INCOME),0) AS exchange_income,IFNULL(SUM(ud.COIN_INCOME),0) AS coin_income, ");//币币
|
||||
queryString.append("IFNULL(SUM(ud.FURTURES_AMOUNT),0) AS furtures_amount,IFNULL(SUM(ud.FURTURES_FEE),0) AS furtures_fee,IFNULL(SUM(ud.FURTURES_INCOME),0) AS furtures_income, ");//交割
|
||||
queryString.append("IFNULL(SUM(ud.MINER_AMOUNT),0) AS miner_amount,IFNULL(SUM(ud.MINER_INCOME),0) AS miner_income, ");//矿机
|
||||
queryString.append("IFNULL(SUM(ud.THIRD_RECHARGE_AMOUNT),0) AS third_recharge_amount, ");//三方充值
|
||||
queryString.append("IFNULL(SUM(ud.EXCHANGE_LEVER_AMOUNT),0) AS exchange_lever_amount,IFNULL(SUM(ud.EXCHANGE_LEVER_FEE),0) AS exchange_lever_fee,IFNULL(SUM(ud.EXCHANGE_LEVER_ORDER_INCOME),0) AS exchange_lever_order_income ");//币币杠杆
|
||||
// queryString.append("FROM T_USERDATA ud ");
|
||||
// queryString.append("LEFT JOIN PAT_PARTY party ON ud.PARTY_ID = party.UUID ");
|
||||
queryString.append("FROM PAT_PARTY party ");
|
||||
queryString.append("LEFT JOIN T_USERDATA ud ON ud.PARTY_ID = party.UUID ");
|
||||
if (!StringUtils.isNullOrEmpty(startTime)) {
|
||||
queryString.append("AND DATE(ud.CREATE_TIME) >= DATE(:startTime) ");
|
||||
parameters.put("startTime",DateUtils.toDate(startTime));
|
||||
}
|
||||
if (!StringUtils.isNullOrEmpty(endTime)) {
|
||||
queryString.append("AND DATE(ud.CREATE_TIME) <= DATE(:endTime) ");
|
||||
parameters.put("endTime", DateUtils.toDate(endTime));
|
||||
}
|
||||
queryString.append("LEFT JOIN T_USERDATASUM uds ON ud.PARTY_ID = uds.PARTY_ID ");//推荐总数
|
||||
// queryString.append("LEFT JOIN PAT_USER_RECOM ur ON ud.PARTY_ID = ur.PARTY_ID ");//推荐人 根目录判定
|
||||
queryString.append("LEFT JOIN T_WALLET wallet ON party.UUID = wallet.PARTY_ID ");//
|
||||
queryString.append("LEFT JOIN T_WALLET_EXTEND wallet_extend_usdt ON (party.UUID = wallet_extend_usdt.PARTY_ID and wallet_extend_usdt.WALLETTYPE = 'USDT_USER') ");//
|
||||
queryString.append("WHERE 1=1 ");
|
||||
// queryString.append("AND party.ROLENAME IN('"+Constants.SECURITY_ROLE_MEMBER+"','"+Constants.SECURITY_ROLE_AGENT+"')");//限定用户权限只能是用户或代理商
|
||||
queryString.append("AND party.ROLENAME IN('"+Constants.SECURITY_ROLE_MEMBER+"')");//限定用户权限只能是用户或代理商
|
||||
if (!StringUtils.isNullOrEmpty(loginPartyId)) {
|
||||
List children = this.userRecomService.findChildren(loginPartyId);
|
||||
if (children.size() == 0) {
|
||||
return new Page();
|
||||
}
|
||||
queryString.append(" and party.UUID in (:children) ");
|
||||
parameters.put("children", children);
|
||||
}
|
||||
if (!StringUtils.isNullOrEmpty(targetPartyId)) {
|
||||
// List children = this.userRecomService.findChildren_1_Level(targetPartyId);
|
||||
List children = this.userRecomService.findChildren(targetPartyId);
|
||||
if (children.size() == 0) {
|
||||
return new Page();
|
||||
}
|
||||
queryString.append(" and party.UUID in (:children) ");
|
||||
parameters.put("children", children);
|
||||
}else if(isAgentView){//目标partyId为空的情况下,如果是视图,显示根目录
|
||||
// queryString.append(" and ur.RECO_ID is NULL ");
|
||||
// roleName = Constants.SECURITY_ROLE_AGENT;//改条件下只查代理商
|
||||
|
||||
roleName = "";
|
||||
queryString.append(" and party.ROLENAME in (:rolename_agent) ");
|
||||
parameters.put("rolename_agent",new ArrayList<String>( Arrays.asList(Constants.SECURITY_ROLE_AGENT,Constants.SECURITY_ROLE_AGENTLOW)));
|
||||
|
||||
}
|
||||
if (!StringUtils.isNullOrEmpty(usernameOrUid)) {
|
||||
queryString.append("AND (party.USERNAME like:username OR party.USERCODE like:username ) ");
|
||||
parameters.put("username","%"+usernameOrUid+"%");
|
||||
}
|
||||
if (!StringUtils.isNullOrEmpty(roleName)) {
|
||||
queryString.append("AND party.ROLENAME =:roleName ");
|
||||
parameters.put("roleName",roleName);
|
||||
}
|
||||
// if (!StringUtils.isNullOrEmpty(startTime)) {
|
||||
// queryString.append("AND DATE(ud.CREATE_TIME) >= DATE(:startTime) ");
|
||||
// parameters.put("startTime",DateUtils.toDate(startTime));
|
||||
// }
|
||||
// if (!StringUtils.isNullOrEmpty(endTime)) {
|
||||
// queryString.append("AND DATE(ud.CREATE_TIME) <= DATE(:endTime) ");
|
||||
// parameters.put("endTime", DateUtils.toDate(endTime));
|
||||
// }
|
||||
// queryString.append("GROUP BY ud.PARTY_ID ");
|
||||
queryString.append("GROUP BY party.UUID ");
|
||||
queryString.append("ORDER BY "+sortHandle(sortColumn, sortType)+" DATE(ud.CREATE_TIME) DESC ");
|
||||
Page page = this.pagedQueryDao.pagedQuerySQL(pageNo, pageSize, queryString.toString(), parameters);
|
||||
// page.setElements(format(page.getElements()));
|
||||
compute(page.getElements());
|
||||
return page;
|
||||
}
|
||||
|
||||
public Page exchangePagedQuery(int pageNo, int pageSize,String startTime,String endTime,String loginPartyId,String usernameOrUid,String roleName,String targetPartyId,
|
||||
boolean isAgentView,String sortColumn,String sortType, String sellerId ,String sellerName, String all_para_party_id) {
|
||||
Map<String,Object> parameters = new HashMap<String,Object>();
|
||||
StringBuffer queryString = new StringBuffer();
|
||||
queryString.append("SELECT party.ROLENAME AS rolename,party.USERNAME AS username,party.REMARKS AS remarks, party.USERCODE AS UID,IFNULL(uds.RECO_NUM,0) AS reco_num,party.UUID AS partyId,IFNULL(wallet.MONEY,0) AS money, ");//用户
|
||||
queryString.append("IFNULL(SUM(ud.RECHARGE),0) AS recharge,IFNULL(SUM(ud.RECHARGE_USDT),0) AS recharge_usdt,IFNULL(SUM(ud.RECHARGE_ETH),0) AS recharge_eth,IFNULL(SUM(ud.RECHARGE_BTC),0) AS recharge_btc,IFNULL(SUM(ud.RECHARGE_HT),0) AS recharge_ht,IFNULL(SUM(ud.RECHARGE_LTC),0) AS recharge_ltc,IFNULL(SUM(ud.RECHARGE_USDT),0) AS recharge_usdt,"
|
||||
+ "IFNULL(SUM(ud.WITHDRAW),0) AS withdraw,IFNULL(SUM(ud.WITHDRAW_ETH),0) AS withdraw_eth,IFNULL(SUM(ud.WITHDRAW_BTC),0) AS withdraw_btc,"
|
||||
+ "IFNULL(SUM(ud.RECHARGE_WITHDRAWAL_FEE),0) AS recharge_withdrawal_fee,IFNULL(SUM(ud.GIFT_MONEY),0) AS gift_money,IFNULL(SUM(ud.RECHARGE)-SUM(ud.WITHDRAW),0) AS balance_amount, ");//充提
|
||||
queryString.append("IFNULL(SUM(ud.AMOUNT),0) AS amount,IFNULL(SUM(ud.FEE),0) AS fee,IFNULL(SUM(ud.ORDER_INCOME),0) AS order_income, IFNULL(SUM(ud.RECHARGE_COMMISSION),0) AS rechargeCommission,");//永续
|
||||
queryString.append("IFNULL(SUM(ud.FINANCE_AMOUNT),0) AS finance_amount,IFNULL(SUM(ud.FINANCE_INCOME),0) AS finance_income, IFNULL(SUM(ud.RECHARGE_COMMISSION),0) AS rechargeCommission, IFNULL(SUM(ud.WITHDRAW_COMMISSION),0) AS withdrawCommission,");//理财
|
||||
queryString.append("IFNULL(SUM(ud.EXCHANGE_AMOUNT),0) AS exchange_amount,IFNULL(SUM(ud.EXCHANGE_FEE),0) AS exchange_fee,IFNULL(SUM(ud.EXCHANGE_INCOME),0) AS exchange_income,IFNULL(SUM(ud.COIN_INCOME),0) AS coin_income, ");//币币
|
||||
queryString.append("IFNULL(SUM(ud.FURTURES_AMOUNT),0) AS furtures_amount,IFNULL(SUM(ud.FURTURES_FEE),0) AS furtures_fee,IFNULL(SUM(ud.FURTURES_INCOME),0) AS furtures_income, ");//交割
|
||||
queryString.append("IFNULL(SUM(ud.MINER_AMOUNT),0) AS miner_amount,IFNULL(SUM(ud.MINER_INCOME),0) AS miner_income, ");//矿机
|
||||
queryString.append("IFNULL(SUM(ud.THIRD_RECHARGE_AMOUNT),0) AS third_recharge_amount, ");//三方充值
|
||||
queryString.append("IFNULL(SUM(ud.EXCHANGE_LEVER_AMOUNT),0) AS exchange_lever_amount,IFNULL(SUM(ud.EXCHANGE_LEVER_FEE),0) AS exchange_lever_fee,IFNULL(SUM(ud.EXCHANGE_LEVER_ORDER_INCOME),0) AS exchange_lever_order_income, ");//币币杠杆
|
||||
queryString.append("IFNULL(SUM(ud.REBATE_1),0) AS rebate1, IFNULL(SUM(ud.REBATE_2),0) AS rebate2, IFNULL(sum(ud.REBATE_1) + sum(ud.REBATE_2),0) rebateLump, ");//佣金
|
||||
queryString.append("IFNULL(SUM(ud.TRANSLATE),0) AS translate, IFNULL(SUM(ud.SELLER_TOTAL_SALES),0) AS sellerTotalSales, IFNULL(SUM(ud.SELLER_COMMISSION),0) AS sellerCommission, ");//佣金
|
||||
queryString.append("s.NAME sellerName, s.UUID sellerId ");
|
||||
// queryString.append("FROM T_USERDATA ud ");
|
||||
// queryString.append("LEFT JOIN PAT_PARTY party ON ud.PARTY_ID = party.UUID ");
|
||||
queryString.append("FROM PAT_PARTY party ");
|
||||
queryString.append("LEFT JOIN T_MALL_SELLER s ON s.UUID = party.UUID ");
|
||||
queryString.append("LEFT JOIN T_USERDATA ud ON ud.PARTY_ID = party.UUID ");
|
||||
if (!StringUtils.isNullOrEmpty(startTime)) {
|
||||
queryString.append("AND DATE(ud.CREATE_TIME) >= DATE(:startTime) ");
|
||||
parameters.put("startTime",DateUtils.toDate(startTime));
|
||||
}
|
||||
if (!StringUtils.isNullOrEmpty(endTime)) {
|
||||
queryString.append("AND DATE(ud.CREATE_TIME) <= DATE(:endTime) ");
|
||||
parameters.put("endTime", DateUtils.toDate(endTime));
|
||||
}
|
||||
queryString.append("LEFT JOIN T_USERDATASUM uds ON ud.PARTY_ID = uds.PARTY_ID ");//推荐总数
|
||||
// queryString.append("LEFT JOIN PAT_USER_RECOM ur ON ud.PARTY_ID = ur.PARTY_ID ");//推荐人 根目录判定
|
||||
queryString.append("LEFT JOIN T_WALLET wallet ON party.UUID = wallet.PARTY_ID ");//
|
||||
queryString.append("WHERE 1=1 ");
|
||||
// queryString.append("AND party.ROLENAME IN('"+Constants.SECURITY_ROLE_MEMBER+"','"+Constants.SECURITY_ROLE_AGENT+"')");//限定用户权限只能是用户或代理商
|
||||
queryString.append("AND party.ROLENAME IN('"+Constants.SECURITY_ROLE_MEMBER+"')");//限定用户权限只能是用户或代理商
|
||||
if (!StringUtils.isNullOrEmpty(loginPartyId)) {
|
||||
List children = this.userRecomService.findChildren(loginPartyId);
|
||||
if (children.size() == 0) {
|
||||
return new Page();
|
||||
}
|
||||
queryString.append(" and party.UUID in (:children) ");
|
||||
parameters.put("children", children);
|
||||
}
|
||||
if (!StringUtils.isNullOrEmpty(targetPartyId)) {
|
||||
// List children = this.userRecomService.findChildren_1_Level(targetPartyId);
|
||||
List children = this.userRecomService.findDirectlyChildrens(targetPartyId);
|
||||
if (children.size() == 0) {
|
||||
return new Page();
|
||||
}
|
||||
// if(children.size() > 2 ){
|
||||
// children = children.subList(0, 2);
|
||||
// }
|
||||
queryString.append(" and party.UUID in (:children) ");
|
||||
parameters.put("children", children);
|
||||
} else if(!StringUtils.isNullOrEmpty(all_para_party_id)){
|
||||
List children = this.userRecomService.findChildren(all_para_party_id);
|
||||
if (children.size() == 0) {
|
||||
return new Page();
|
||||
}
|
||||
// if(children.size() > 2 ){
|
||||
// children = children.subList(0, 2);
|
||||
// }
|
||||
queryString.append(" and party.UUID in (:children) ");
|
||||
parameters.put("children", children);
|
||||
|
||||
} else if(isAgentView){//目标partyId为空的情况下,如果是视图,显示根目录
|
||||
// queryString.append(" and ur.RECO_ID is NULL ");
|
||||
roleName = Constants.SECURITY_ROLE_AGENT;//改条件下只查代理商
|
||||
}
|
||||
if (!StringUtils.isNullOrEmpty(usernameOrUid)) {
|
||||
queryString.append("AND (party.USERNAME like:username OR party.USERCODE like:username ) ");
|
||||
parameters.put("username","%"+usernameOrUid+"%");
|
||||
}
|
||||
if (!StringUtils.isNullOrEmpty(roleName)) {
|
||||
queryString.append("AND party.ROLENAME =:roleName ");
|
||||
parameters.put("roleName",roleName);
|
||||
}
|
||||
if (!StringUtils.isNullOrEmpty(sellerId)) {
|
||||
queryString.append("AND s.UUID =:sellerId ");
|
||||
parameters.put("sellerId",sellerId);
|
||||
}
|
||||
if (!StringUtils.isNullOrEmpty(sellerName)) {
|
||||
queryString.append("AND s.NAME =:sellerName ");
|
||||
parameters.put("sellerName",sellerName);
|
||||
}
|
||||
// if (!StringUtils.isNullOrEmpty(startTime)) {
|
||||
// queryString.append("AND DATE(ud.CREATE_TIME) >= DATE(:startTime) ");
|
||||
// parameters.put("startTime",DateUtils.toDate(startTime));
|
||||
// }
|
||||
// if (!StringUtils.isNullOrEmpty(endTime)) {
|
||||
// queryString.append("AND DATE(ud.CREATE_TIME) <= DATE(:endTime) ");
|
||||
// parameters.put("endTime", DateUtils.toDate(endTime));
|
||||
// }
|
||||
// queryString.append("GROUP BY ud.PARTY_ID ");
|
||||
queryString.append("GROUP BY party.UUID ");
|
||||
queryString.append("ORDER BY "+sortHandle(sortColumn, sortType)+" DATE(ud.CREATE_TIME) DESC ");
|
||||
Page page = this.pagedQueryDao.pagedQuerySQL(pageNo, pageSize, queryString.toString(), parameters);
|
||||
// page.setElements(format(page.getElements()));
|
||||
compute(page.getElements());
|
||||
return page;
|
||||
}
|
||||
|
||||
public String sortHandle(String column,String type) {
|
||||
//自定义判断处理,防止注入
|
||||
List<String> columns=Arrays.asList(new String[] {"recharge_usdt","gift_money","withdraw","third_recharge_amount"});
|
||||
List<String> types=Arrays.asList(new String[] {"ASC","DESC"});
|
||||
String sql = "";
|
||||
if(columns.contains(column)) {
|
||||
sql = column;
|
||||
}else {
|
||||
return sql;
|
||||
}
|
||||
|
||||
if(types.contains(type)) {
|
||||
sql += " "+type+",";
|
||||
}else {
|
||||
sql += " DESC,";
|
||||
}
|
||||
return sql;
|
||||
}
|
||||
|
||||
|
||||
private void compute(List<Map<String,Object>> datas) {
|
||||
if(CollectionUtils.isEmpty(datas)) return;
|
||||
Double totle_income=0d;
|
||||
Double totle_fee = 0d;
|
||||
Double business_profit = 0d;//交易盈亏
|
||||
Double fin_miner_amount = 0d;//理财 矿机 交易额
|
||||
Double fin_miner_income = 0d;//理财 矿机 收益
|
||||
for(Map<String,Object> data:datas) {
|
||||
totle_income=0d;
|
||||
totle_fee = 0d;
|
||||
business_profit = 0d;
|
||||
fin_miner_amount = 0d;
|
||||
fin_miner_income = 0d;
|
||||
// if(null!=data.get("rolename")) {
|
||||
// data.put("rolename", Constants.ROLE_MAP.get(data.get("rolename").toString()));
|
||||
// }
|
||||
if(null != data.get("order_income"))
|
||||
data.put("order_income", Arith.sub(0, new Double(data.get("order_income").toString())));//订单收益负数
|
||||
if(null != data.get("finance_income"))
|
||||
data.put("finance_income", Arith.sub(0, new Double(data.get("finance_income").toString())));//理财收益负数
|
||||
if(null != data.get("exchange_income"))
|
||||
// data.put("exchange_income", Arith.sub(0, new Double(data.get("exchange_income").toString())));//币币收益负数
|
||||
data.put("exchange_income", 0);//币币收益负数
|
||||
if(null != data.get("furtures_income"))
|
||||
data.put("furtures_income", Arith.sub(0, new Double(data.get("furtures_income").toString())));//交割收益负数
|
||||
if (null != data.get("miner_income"))
|
||||
data.put("miner_income", Arith.sub(0, new Double(data.get("miner_income").toString())));// 矿机收益负数
|
||||
if (null != data.get("exchange_lever_order_income"))
|
||||
data.put("exchange_lever_order_income", Arith.sub(0, new Double(data.get("exchange_lever_order_income").toString())));// 币币收益负数
|
||||
|
||||
if(!dataExistNull(data)) continue;
|
||||
totle_income = Arith.add(totle_income,new Double(data.get("recharge_withdrawal_fee").toString()));
|
||||
totle_income = Arith.add(totle_income,new Double(data.get("order_income").toString()));
|
||||
totle_income = Arith.add(totle_income,new Double(data.get("fee").toString()));
|
||||
totle_income = Arith.add(totle_income,new Double(data.get("finance_income").toString()));
|
||||
totle_income = Arith.add(totle_income,new Double(data.get("exchange_fee").toString()));
|
||||
totle_income = Arith.add(totle_income,new Double(0));
|
||||
// totle_income = Arith.add(totle_income,new Double(data.get("exchange_income").toString()));
|
||||
totle_income = Arith.add(totle_income,new Double(data.get("furtures_fee").toString()));
|
||||
totle_income = Arith.add(totle_income,new Double(data.get("furtures_income").toString()));
|
||||
totle_income = Arith.add(totle_income,new Double(data.get("miner_income").toString()));
|
||||
totle_income = Arith.add(totle_income,new Double(data.get("exchange_lever_order_income").toString()));
|
||||
data.put("totle_income", totle_income);
|
||||
|
||||
totle_fee = Arith.add(totle_fee, new Double(data.get("recharge_withdrawal_fee").toString()));
|
||||
totle_fee = Arith.add(totle_fee, new Double(data.get("fee").toString()));
|
||||
totle_fee = Arith.add(totle_fee, new Double(data.get("exchange_fee").toString()));
|
||||
totle_fee = Arith.add(totle_fee, new Double(data.get("furtures_fee").toString()));
|
||||
totle_fee = Arith.add(totle_fee, new Double(data.get("exchange_lever_fee").toString()));
|
||||
data.put("totle_fee", totle_fee);
|
||||
|
||||
business_profit = Arith.add(business_profit, new Double(data.get("order_income").toString()));
|
||||
business_profit = Arith.add(business_profit, new Double(data.get("exchange_income").toString()));
|
||||
business_profit = Arith.add(business_profit, new Double(data.get("furtures_income").toString()));
|
||||
business_profit = Arith.add(business_profit, new Double(data.get("exchange_lever_order_income").toString()));
|
||||
data.put("business_profit", business_profit);
|
||||
|
||||
fin_miner_amount = Arith.add(fin_miner_amount, new Double(data.get("finance_amount").toString()));
|
||||
fin_miner_amount = Arith.add(fin_miner_amount, new Double(data.get("miner_amount").toString()));
|
||||
data.put("fin_miner_amount", fin_miner_amount);
|
||||
|
||||
fin_miner_income = Arith.add(fin_miner_income, new Double(data.get("finance_income").toString()));
|
||||
fin_miner_income = Arith.add(fin_miner_income, new Double(data.get("miner_income").toString()));
|
||||
data.put("fin_miner_income", fin_miner_income);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 统计的数据存在空时,不统计总额
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
private boolean dataExistNull(Map<String,Object> data) {
|
||||
if(null == data.get("recharge_withdrawal_fee")) return false;
|
||||
if(null == data.get("order_income")) return false;
|
||||
if(null == data.get("fee")) return false;
|
||||
if(null == data.get("finance_income")) return false;
|
||||
if(null == data.get("exchange_fee")) return false;
|
||||
if(null == data.get("exchange_income")) return false;
|
||||
if(null == data.get("furtures_fee")) return false;
|
||||
if(null == data.get("furtures_income")) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
public List<Map<String,Object>> getWalletExtends(String loginPartyId,String targetPartyId) {
|
||||
if (!StringUtils.isNullOrEmpty(loginPartyId)) {
|
||||
List<String> children = this.userRecomService.findChildren(loginPartyId);
|
||||
if (children.size() == 0) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
if(!children.contains(targetPartyId)) throw new BusinessException("目标用户不属于登录人下级");
|
||||
}
|
||||
List<WalletExtend> findExtend = walletService.findExtend(targetPartyId);
|
||||
List<Map<String,Object>> result = new LinkedList<Map<String,Object>>();
|
||||
|
||||
|
||||
|
||||
for(WalletExtend we : findExtend) {
|
||||
Map<String,Object> data = new HashMap<String,Object>();
|
||||
if ("USDT_USER".equals(we.getWallettype())
|
||||
|| "ETH_DAPP".equals(we.getWallettype())
|
||||
|| "USDT_DAPP".equals(we.getWallettype())
|
||||
|| "ETH_USER".equals(we.getWallettype())) {
|
||||
continue;
|
||||
}
|
||||
data.put("wallettype", we.getWallettype());
|
||||
data.put("amount", new BigDecimal(we.getAmount()).setScale(8, RoundingMode.FLOOR).toPlainString());
|
||||
result.add(data);
|
||||
}
|
||||
Map<String,Object> data = new HashMap<String,Object>();
|
||||
Wallet wallet = walletService.saveWalletByPartyId(targetPartyId);
|
||||
data.put("wallettype", "usdt");
|
||||
data.put("amount",null==wallet?0:new BigDecimal(wallet.getMoney()).setScale(8, RoundingMode.FLOOR).toPlainString() );
|
||||
result.add(0,data);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return result;
|
||||
}
|
||||
public Map<String,Object> getNameMap(){
|
||||
Map<String,Object> data = new LinkedHashMap<String, Object>();
|
||||
|
||||
data.put("money_all_coin", "钱包资产折合[USDT]");
|
||||
|
||||
data.put("money_miner", "矿机");
|
||||
data.put("money_finance", "理财");
|
||||
data.put("money_contract", "永续合约");
|
||||
data.put("money_futures", "交割合约");
|
||||
data.put("money_fund", "基金");
|
||||
// data.put("money_trader", "理财资产");
|
||||
data.put("money_ico", "ico");
|
||||
data.put("money", "总资产");
|
||||
return data;
|
||||
}
|
||||
public List<Map<String,Object>> getAssetsAll(String loginPartyId,String targetPartyId) {
|
||||
if (!StringUtils.isNullOrEmpty(loginPartyId)) {
|
||||
List<String> children = this.userRecomService.findChildren(loginPartyId);
|
||||
if (children.size() == 0) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
if(!children.contains(targetPartyId)) throw new BusinessException("目标用户不属于登录人下级");
|
||||
}
|
||||
Map<String, Object> moneyAll = assetService.getMoneyAll(targetPartyId);
|
||||
Map<String, Object> nameMap = getNameMap();
|
||||
List<Map<String,Object>> result = new LinkedList<Map<String,Object>>();
|
||||
|
||||
for(Entry<String, Object> entry :nameMap.entrySet()) {
|
||||
if("money_trader".equals(entry.getKey())) {
|
||||
continue;
|
||||
}
|
||||
Map<String,Object> data = new HashMap<String,Object>();
|
||||
data.put("name", entry.getValue());
|
||||
data.put("value", moneyAll.get(entry.getKey()));
|
||||
result.add(data);
|
||||
}
|
||||
// for(Entry<String, Object> entry :moneyAll.entrySet()) {
|
||||
// if("money_trader".equals(entry.getKey())) {
|
||||
// continue;
|
||||
// }
|
||||
// Map<String,Object> data = new HashMap<String,Object>();
|
||||
// data.put("name", nameMap.get(entry.getKey()));
|
||||
// data.put("value", entry.getValue());
|
||||
// result.add(data);
|
||||
// }
|
||||
return result;
|
||||
}
|
||||
public String loadExportData(HttpServletResponse response, int pageSize,String startTime,String endTime,String loginPartyId,String usernameOrUid,String roleName,String targetPartyId,boolean isAgentView,String sortColumn,String sortType) throws IOException {
|
||||
//生成数据信息
|
||||
int sheetNum = 0;
|
||||
// 生成表头
|
||||
Integer i = 0;
|
||||
// 在内存中保持100行,超过100行将被刷新到磁盘
|
||||
// HSSFWorkbook wb = new HSSFWorkbook();//excel文件,一个excel文件包含多个表
|
||||
// HSSFSheet sheet = wb.createSheet();//表,一个表包含多个行
|
||||
SXSSFWorkbook wb = new SXSSFWorkbook(100);
|
||||
Sheet sheet = wb.createSheet(); // 表,一个表包含多个行
|
||||
Drawing patriarch = sheet.createDrawingPatriarch();
|
||||
CellStyle style = wb.createCellStyle();
|
||||
Row row = null;// 行,一行包括多个单元格
|
||||
Cell cell = null;// 单元格
|
||||
Page page = null;
|
||||
int pageNo =1;
|
||||
|
||||
Map<String,Integer[]> headMap = new LinkedHashMap<String,Integer[]>();
|
||||
// <td colspan="3" style="text-align:center;vertical-align: middle;">用户</td>
|
||||
// <td colspan="3" style="text-align:center;">充提</td>
|
||||
// <td colspan="3" style="text-align:center;">永续合约</td>
|
||||
// <td colspan="2" style="text-align:center;">理财</td>
|
||||
// <td colspan="4" style="text-align:center;vertical-align: middle;">币币</td>
|
||||
// <td colspan="3" style="text-align:center;vertical-align: middle;">交割合约</td>
|
||||
// <td colspan="1" rowspan="2" style="text-align:center; vertical-align: middle;">收益</td>
|
||||
headMap.put("用户", new Integer[] {0,5});
|
||||
headMap.put("充提", new Integer[] {0,9});
|
||||
headMap.put("永续合约", new Integer[] {0,2});
|
||||
headMap.put("理财收益", new Integer[] {1,1});
|
||||
headMap.put("币币", new Integer[] {0,2});
|
||||
headMap.put("交割合约", new Integer[] {0,2});
|
||||
headMap.put("收益", new Integer[] {1,1});
|
||||
|
||||
createMergedHead(wb, sheet,headMap,i++);
|
||||
|
||||
while (true) {
|
||||
page = this.pagedQuery(pageNo, pageSize, startTime, endTime,loginPartyId,usernameOrUid,roleName,targetPartyId,isAgentView,sortColumn,sortType);
|
||||
if (sheetNum == 0 && (page == null || page.getElements() == null || page.getElements().size() == 0)) {
|
||||
return "无导出数据!";
|
||||
}
|
||||
|
||||
|
||||
String[] headTitles = {"用户名","UID","账户类型","团队人数","USDT",
|
||||
"USDT充值","ETH充值","BTC充值","充值总额(USDT计价)","赠送","提现","手续费","充提差额(USDT)","充提总差额(USDT计价)",
|
||||
"手续费","订单收益",
|
||||
"收益",
|
||||
"手续费","收益",
|
||||
"手续费","订单收益"};
|
||||
if (i == 1)
|
||||
PoiUtil.createHead(response, headTitles, wb, sheet, style, row, cell, i,
|
||||
"用户收益统计_" + DateUtils.format(new Date(), DateUtils.DEFAULT_DATE_FORMAT),
|
||||
"用户收益统计_" + DateUtils.format(new Date(), DateUtils.DEFAULT_DATE_FORMAT) + ".xlsx");
|
||||
List<Object[]> list = this.dataBachHandel(page.getElements());
|
||||
|
||||
if (page.getElements() != null) {
|
||||
|
||||
i = PoiUtil.createCell(list, patriarch, wb, sheet, row, cell, style, i);
|
||||
list.clear();
|
||||
|
||||
if (page.getElements().size() < pageSize || i >= 59999) {
|
||||
PoiUtil.out(wb, response);
|
||||
break;
|
||||
}
|
||||
sheetNum++;
|
||||
pageNo++;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
private void createMergedHead(SXSSFWorkbook wb,Sheet sheet,Map<String,Integer[]> headMap,int i) {
|
||||
Font font = wb.createFont();
|
||||
font.setFontHeightInPoints((short) 10);
|
||||
font.setFontName("Courier New");
|
||||
CellStyle style = wb.createCellStyle();
|
||||
style.setFont(font);
|
||||
style.setWrapText(true);
|
||||
style.setAlignment(HorizontalAlignment.CENTER);
|
||||
style.setVerticalAlignment(VerticalAlignment.CENTER);
|
||||
Row row = sheet.createRow(i);
|
||||
int rowPosition = 0;//行坐标
|
||||
int cellPosition = 0;//列坐标
|
||||
for(Entry<String, Integer[]> entry:headMap.entrySet()) {
|
||||
Cell cell = row.createCell(cellPosition);
|
||||
cell.setCellStyle(style);
|
||||
cell.setCellValue(entry.getKey());
|
||||
CellRangeAddress region = new CellRangeAddress(rowPosition, rowPosition+entry.getValue()[0], cellPosition, cellPosition+entry.getValue()[1]-1);
|
||||
sheet.addMergedRegion(region);
|
||||
cellPosition+=entry.getValue()[1];
|
||||
}
|
||||
}
|
||||
|
||||
public List<Object[]> dataBachHandel(List<Map<String,Object>> list){
|
||||
List<Object[]> result = new ArrayList<Object[]>();
|
||||
int i = 0;
|
||||
for(Map<String,Object> data:list) {
|
||||
i = 0;
|
||||
Object[] objs = new Object[22];
|
||||
objs[i++] = data.get("username");
|
||||
objs[i++] = data.get("UID");
|
||||
objs[i++] = data.get("rolename")!=null&&Constants.SECURITY_ROLE_AGENT.equals(data.get("rolename").toString())?"代理商"
|
||||
:Constants.SECURITY_ROLE_MEMBER.equals(data.get("rolename").toString())?"正式用户":"";
|
||||
objs[i++] = data.get("reco_num");
|
||||
objs[i++] = data.get("money");
|
||||
|
||||
objs[i++] = data.get("recharge_usdt");
|
||||
objs[i++] = data.get("recharge_eth");
|
||||
objs[i++] = data.get("recharge_btc");
|
||||
objs[i++] = data.get("recharge");
|
||||
objs[i++] = data.get("gift_money");
|
||||
objs[i++] = data.get("withdraw");
|
||||
objs[i++] = data.get("recharge_withdrawal_fee");
|
||||
double recharge_usdt = 0D;
|
||||
double withdraw = 0D;
|
||||
if (null != data.get("recharge_usdt")) {
|
||||
recharge_usdt = Double.parseDouble(data.get("recharge_usdt").toString());
|
||||
}
|
||||
if (null != data.get("withdraw")) {
|
||||
withdraw = Double.parseDouble(data.get("withdraw").toString());
|
||||
}
|
||||
objs[i++] = Arith.sub(recharge_usdt, withdraw);
|
||||
objs[i++] = data.get("balance_amount");
|
||||
|
||||
// objs[i++] = data.get("amount");
|
||||
objs[i++] = data.get("fee");
|
||||
objs[i++] = data.get("order_income");
|
||||
|
||||
// objs[i++] = data.get("finance_amount");
|
||||
objs[i++] = data.get("finance_income");
|
||||
|
||||
// objs[i++] = data.get("exchange_amount");
|
||||
objs[i++] = data.get("exchange_fee");
|
||||
// objs[i++] = data.get("exchange_income");
|
||||
objs[i++] = 0;
|
||||
// objs[i++] = data.get("coin_income");
|
||||
|
||||
// objs[i++] = data.get("furtures_amount");
|
||||
objs[i++] = data.get("furtures_fee");
|
||||
objs[i++] = data.get("furtures_income");
|
||||
|
||||
objs[i++] = data.get("totle_income");
|
||||
result.add(objs);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> queryWillIncomeBySellerIds(List<String> sellerIds , String startTime , String endTime ) {
|
||||
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
if (CollectionUtil.isEmpty(sellerIds)) {
|
||||
return result;
|
||||
}
|
||||
|
||||
StringBuilder sql = new StringBuilder("select SELLER_ID as sellerId, cast((SUM(IFNULL(SYSTEM_PRICE,0)) + SUM(IFNULL(PROFIT,0))) AS DECIMAL (19, 2)) AS willIncome " +
|
||||
" FROM T_MALL_ORDERS_PRIZE WHERE PURCH_STATUS =1 AND PROFIT_STATUS = 0 AND SELLER_ID in (:sellersList) ");
|
||||
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("sellersList", sellerIds);
|
||||
|
||||
if(StringUtils.isNotEmpty(startTime) ) {
|
||||
params.put("startTime", startTime);
|
||||
sql.append("AND CREATE_TIME >=:startTime ");
|
||||
}
|
||||
|
||||
if(StringUtils.isNotEmpty(endTime)) {
|
||||
params.put("endTime", endTime);
|
||||
sql.append("AND CREATE_TIME <=:endTime ");
|
||||
}
|
||||
sql.append("GROUP BY SELLER_ID ");
|
||||
List<Map<String, Object>> maps = namedParameterJdbcTemplate.queryForList(sql.toString(), params);
|
||||
|
||||
for (Map<String, Object> data : maps) {
|
||||
result.put(data.get("sellerId").toString(), data.get("willIncome"));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public void setPagedQueryDao(PagedQueryDao pagedQueryDao) {
|
||||
this.pagedQueryDao = pagedQueryDao;
|
||||
}
|
||||
|
||||
public void setUserRecomService(UserRecomService userRecomService) {
|
||||
this.userRecomService = userRecomService;
|
||||
}
|
||||
|
||||
public void setWalletService(WalletService walletService) {
|
||||
this.walletService = walletService;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// public void setFinanceOrderService(FinanceOrderService financeOrderService) {
|
||||
// this.financeOrderService = financeOrderService;
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
public void setSysparaService(SysparaService sysparaService) {
|
||||
this.sysparaService = sysparaService;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public void setDataService(DataService dataService) {
|
||||
this.dataService = dataService;
|
||||
}
|
||||
|
||||
|
||||
public void setNamedParameterJdbcTemplate(NamedParameterJdbcOperations namedParameterJdbcTemplate) {
|
||||
this.namedParameterJdbcTemplate = namedParameterJdbcTemplate;
|
||||
}
|
||||
|
||||
// public void setMinerOrderService(MinerOrderService minerOrderService) {
|
||||
// this.minerOrderService = minerOrderService;
|
||||
// }
|
||||
public void setAssetService(AssetService assetService) {
|
||||
this.assetService = assetService;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,217 @@
|
||||
package project.web.admin.impl.report;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.poi.ss.usermodel.Cell;
|
||||
import org.apache.poi.ss.usermodel.CellStyle;
|
||||
import org.apache.poi.ss.usermodel.Drawing;
|
||||
import org.apache.poi.ss.usermodel.Row;
|
||||
import org.apache.poi.ss.usermodel.Sheet;
|
||||
import org.apache.poi.xssf.streaming.SXSSFWorkbook;
|
||||
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcOperations;
|
||||
import org.springframework.orm.hibernate5.support.HibernateDaoSupport;
|
||||
|
||||
import kernel.util.Arith;
|
||||
import kernel.util.DateUtils;
|
||||
import kernel.util.PoiUtil;
|
||||
import kernel.util.StringUtils;
|
||||
import kernel.web.Page;
|
||||
import project.Constants;
|
||||
import project.data.DataService;
|
||||
import project.data.model.Realtime;
|
||||
import project.party.recom.UserRecomService;
|
||||
import project.wallet.WalletService;
|
||||
import project.web.admin.service.report.AdminUserMoneyStatisticsService;
|
||||
|
||||
public class AdminUserMoneyStatisticsServiceImpl extends HibernateDaoSupport implements AdminUserMoneyStatisticsService{
|
||||
|
||||
private NamedParameterJdbcOperations namedParameterJdbcTemplate;
|
||||
|
||||
private DataService dataService;
|
||||
|
||||
private WalletService walletService;
|
||||
private UserRecomService userRecomService;
|
||||
|
||||
public List<Map<String,Object>> getAll(String loginPartyId){
|
||||
Map<String,Object> parameters = new HashMap<String,Object>();
|
||||
StringBuffer queryString = new StringBuffer();
|
||||
queryString.append("SELECT we.WALLETTYPE AS wallettype,IFNULL(SUM(we.AMOUNT),0) AS amount FROM T_WALLET_EXTEND we ");
|
||||
queryString.append("LEFT JOIN PAT_PARTY party ON party.UUID=we.PARTY_ID ");
|
||||
queryString.append("WHERE 1=1 ");
|
||||
queryString.append("AND party.ROLENAME ='"+Constants.SECURITY_ROLE_MEMBER+"' ");
|
||||
if (!StringUtils.isNullOrEmpty(loginPartyId)) {
|
||||
List children = this.userRecomService.findChildren(loginPartyId);
|
||||
if (children.size() == 0) {//拓展钱包为0时,usdt依旧要计算
|
||||
List<Map<String, Object>> queryForList = new ArrayList<Map<String,Object>>();
|
||||
computeList(queryForList,loginPartyId);
|
||||
return queryForList;
|
||||
}
|
||||
queryString.append(" and we.PARTY_ID in (:children) ");
|
||||
parameters.put("children", children);
|
||||
}
|
||||
queryString.append("GROUP BY we.WALLETTYPE ");
|
||||
List<Map<String, Object>> queryForList = this.namedParameterJdbcTemplate.queryForList( queryString.toString(), parameters);
|
||||
computeList(queryForList,loginPartyId);
|
||||
return queryForList;
|
||||
}
|
||||
|
||||
private void computeList(List<Map<String, Object>> datas,String loginPartyId) {
|
||||
if(!CollectionUtils.isEmpty(datas)) {
|
||||
for(Map<String, Object> data:datas) {
|
||||
// data.put("usdt_amount",computeUsdt(data.get("wallettype").toString(),new Double(data.get("amount").toString())));
|
||||
data.put("amount",new BigDecimal(data.get("amount").toString()).setScale(8, RoundingMode.FLOOR).toPlainString());
|
||||
}
|
||||
}
|
||||
|
||||
double sum = this.getSumWalletByMember(loginPartyId);
|
||||
Map<String,Object> map = new HashMap<String,Object>();
|
||||
map.put("wallettype", "usdt");
|
||||
map.put("amount", new BigDecimal(sum).setScale(8, RoundingMode.FLOOR).toPlainString());
|
||||
// map.put("amount", sum);
|
||||
map.put("usdt_amount", sum);
|
||||
datas.add(0, map);
|
||||
}
|
||||
|
||||
|
||||
private List<Map<String,Object>> compute(List<Object[]> datas) {
|
||||
List<Map<String,Object>> result = new ArrayList<Map<String,Object>>();
|
||||
for(Object[] data:datas) {
|
||||
if("usdt".equalsIgnoreCase(data[0].toString())) continue;
|
||||
Map<String,Object> map = new HashMap<String,Object>();
|
||||
map.put("wallettype", data[0]);
|
||||
// if("usdt".equalsIgnoreCase(data[0].toString())){
|
||||
// //usdt总额=walleEextends里的usdt+wallet总额
|
||||
// map.put("amount", Arith.add(walletService.getSumWallet(),new Double(data[1].toString())));
|
||||
// map.put("usdt_amount",map.get("amount"));
|
||||
// }else {
|
||||
map.put("amount",data[1]);
|
||||
map.put("usdt_amount",computeUsdt(data[0].toString(),new Double(data[1].toString())));
|
||||
// }
|
||||
result.add(map);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private Double computeUsdt(String symbol,double amount) {
|
||||
if("usdt".equalsIgnoreCase(symbol)) return amount;
|
||||
try {
|
||||
List<Realtime> realtimes = this.dataService.realtime(symbol);
|
||||
if(CollectionUtils.isNotEmpty(realtimes)) {
|
||||
return Arith.mul(realtimes.get(0).getClose(), amount);
|
||||
}
|
||||
}catch(Exception e) {
|
||||
logger.error("compute fail ,symbol:{"+symbol+"},amount:{"+amount+"},e:",e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算总金额
|
||||
*
|
||||
*/
|
||||
public Map<String,Object> totleDatas(List<Map<String,Object>> list){
|
||||
try {
|
||||
Map<String,Object> result = new HashMap<String,Object>();
|
||||
double sum_usdt_amount = 0D;
|
||||
for(Map<String,Object> data:list) {
|
||||
sum_usdt_amount=Arith.add(sum_usdt_amount,new Double(data.get("usdt_amount").toString()));
|
||||
}
|
||||
result.put("sum_usdt_amount", sum_usdt_amount);
|
||||
return result;
|
||||
}catch(Exception e) {
|
||||
logger.error("compute fail ,e:",e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public double getSumWalletByMember(String loginPartyId) {
|
||||
Map<String,Object> parameters = new HashMap<String,Object>();
|
||||
StringBuffer queryString = new StringBuffer();
|
||||
queryString.append("SELECT IFNULL(SUM(w.MONEY),0) AS totle_money ");
|
||||
queryString.append("FROM T_WALLET w ");
|
||||
queryString.append("LEFT JOIN PAT_PARTY p ON p.UUID=w.PARTY_ID ");
|
||||
queryString.append("WHERE 1=1 ");
|
||||
queryString.append("AND p.ROLENAME ='"+Constants.SECURITY_ROLE_MEMBER+"' ");
|
||||
if (!StringUtils.isNullOrEmpty(loginPartyId)) {
|
||||
List children = this.userRecomService.findChildren(loginPartyId);
|
||||
if (children.size() == 0) {
|
||||
return 0;
|
||||
}
|
||||
queryString.append(" and w.PARTY_ID in (:children) ");
|
||||
parameters.put("children", children);
|
||||
}
|
||||
List<Map<String, Object>> queryForList = this.namedParameterJdbcTemplate.queryForList( queryString.toString(), parameters);
|
||||
return CollectionUtils.isEmpty(queryForList)?0D:new Double(queryForList.get(0).get("totle_money").toString());
|
||||
}
|
||||
public String loadExportData(HttpServletResponse response,String loginPartyId) throws IOException {
|
||||
//生成数据信息
|
||||
int sheetNum = 0;
|
||||
// 生成表头
|
||||
Integer i = 0;
|
||||
// 在内存中保持100行,超过100行将被刷新到磁盘
|
||||
// HSSFWorkbook wb = new HSSFWorkbook();//excel文件,一个excel文件包含多个表
|
||||
// HSSFSheet sheet = wb.createSheet();//表,一个表包含多个行
|
||||
SXSSFWorkbook wb = new SXSSFWorkbook(100);
|
||||
Sheet sheet = wb.createSheet(); // 表,一个表包含多个行
|
||||
Drawing patriarch = sheet.createDrawingPatriarch();
|
||||
CellStyle style = wb.createCellStyle();
|
||||
Row row = null;// 行,一行包括多个单元格
|
||||
Cell cell = null;// 单元格
|
||||
while (true) {
|
||||
List<Map<String,Object>> dataList = this.getAll(loginPartyId);
|
||||
if (sheetNum == 0 && (CollectionUtils.isEmpty(dataList))) {
|
||||
return "无导出数据!";
|
||||
}
|
||||
String[] headTitles = { "币种", "存量", "USDT计价"};
|
||||
if (i == 0)
|
||||
PoiUtil.createHead(response, headTitles, wb, sheet, style, row, cell, i,
|
||||
"用户存量金额汇总_" + DateUtils.format(new Date(), DateUtils.DEFAULT_DATE_FORMAT),
|
||||
"用户存量金额汇总_" + DateUtils.format(new Date(), DateUtils.DEFAULT_DATE_FORMAT) + ".xlsx");
|
||||
List<Object[]> list = this.dataBachHandel(dataList);
|
||||
PoiUtil.createCell(list, patriarch, wb, sheet, row, cell, style, i);
|
||||
PoiUtil.out(wb, response);
|
||||
break;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public List<Object[]> dataBachHandel(List<Map<String,Object>> list){
|
||||
List<Object[]> result = new ArrayList<Object[]>();
|
||||
for(Map<String,Object> data:list) {
|
||||
Object[] objs = new Object[3];
|
||||
objs[0] = data.get("wallettype");
|
||||
objs[1] = data.get("amount");
|
||||
objs[2] = data.get("usdt_amount");
|
||||
result.add(objs);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public void setNamedParameterJdbcTemplate(NamedParameterJdbcOperations namedParameterJdbcTemplate) {
|
||||
this.namedParameterJdbcTemplate = namedParameterJdbcTemplate;
|
||||
}
|
||||
|
||||
public void setDataService(DataService dataService) {
|
||||
this.dataService = dataService;
|
||||
}
|
||||
|
||||
public void setWalletService(WalletService walletService) {
|
||||
this.walletService = walletService;
|
||||
}
|
||||
|
||||
public void setUserRecomService(UserRecomService userRecomService) {
|
||||
this.userRecomService = userRecomService;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
568
admin/src/main/java/project/web/admin/impl/user/AdminAgentServiceImpl.java
Executable file
568
admin/src/main/java/project/web/admin/impl/user/AdminAgentServiceImpl.java
Executable file
@@ -0,0 +1,568 @@
|
||||
package project.web.admin.impl.user;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
|
||||
import org.springframework.orm.hibernate5.support.HibernateDaoSupport;
|
||||
import org.springframework.security.providers.encoding.PasswordEncoder;
|
||||
|
||||
import kernel.exception.BusinessException;
|
||||
import kernel.util.Arith;
|
||||
import kernel.util.DateUtils;
|
||||
import kernel.util.StringUtils;
|
||||
import kernel.web.Page;
|
||||
import kernel.web.PagedQueryDao;
|
||||
import project.Constants;
|
||||
import project.party.PartyService;
|
||||
import project.party.model.Party;
|
||||
import project.party.model.UserRecom;
|
||||
import project.party.recom.UserRecomService;
|
||||
import project.syspara.SysparaService;
|
||||
import project.syspara.Syspara;
|
||||
import project.user.Agent;
|
||||
import project.user.QRGenerateService;
|
||||
import project.user.UserData;
|
||||
import project.wallet.Wallet;
|
||||
import project.wallet.WalletService;
|
||||
import project.web.admin.service.user.AdminAgentService;
|
||||
import project.web.admin.service.user.AgentNodes;
|
||||
import security.Role;
|
||||
import security.RoleService;
|
||||
import security.SecUser;
|
||||
import security.internal.SecUserService;
|
||||
|
||||
public class AdminAgentServiceImpl extends HibernateDaoSupport implements AdminAgentService {
|
||||
private PagedQueryDao pagedQueryDao;
|
||||
private UserRecomService userRecomService;
|
||||
|
||||
private WalletService walletService;
|
||||
private PartyService partyService;
|
||||
private SecUserService secUserService;
|
||||
private RoleService roleService;
|
||||
|
||||
private QRGenerateService qRGenerateService;
|
||||
|
||||
private SysparaService sysparaService;
|
||||
private PasswordEncoder passwordEncoder;
|
||||
|
||||
@Override
|
||||
public Page pagedQuery(int pageNo, int pageSize, String name_para, String checkedPartyId) {
|
||||
|
||||
StringBuffer queryString = new StringBuffer(
|
||||
"SELECT agent.UUID id,party.NAME name,party.USERNAME username,party.USERCODE usercode,party.ROLENAME rolename,party.LOGINAUTHORITY login_authority,party.USERCODE usercode,party.REMARKS remarks,party_parent.NAME name_parent,party_parent.USERNAME username_parent ");
|
||||
queryString.append(
|
||||
" FROM T_AGENT agent LEFT JOIN PAT_PARTY party ON agent.PARTY_ID = party.UUID LEFT JOIN PAT_PARTY party_parent ON agent.PARENT_PARTY_ID = party_parent.UUID WHERE 1 = 1 ");
|
||||
|
||||
Map<String, Object> parameters = new HashMap();
|
||||
|
||||
// if (!StringUtils.isNullOrEmpty(name_para)) {
|
||||
// queryString.append(" and (party.NAME like :name or party.USERNAME=:username or party.USERCODE =:usercode)");
|
||||
// parameters.put("name", "%" + name_para + "%");
|
||||
// parameters.put("username", name_para);
|
||||
// parameters.put("usercode", name_para);
|
||||
// }
|
||||
if (!StringUtils.isNullOrEmpty(name_para)) {
|
||||
queryString.append("AND (party.USERNAME like:username OR party.USERCODE like:username ) ");
|
||||
parameters.put("username","%"+name_para+"%");
|
||||
}
|
||||
if (!StringUtils.isNullOrEmpty(checkedPartyId)) {
|
||||
|
||||
List<String> checked_list = this.userRecomService.findChildren(checkedPartyId);
|
||||
checked_list.add(checkedPartyId);
|
||||
if (checked_list.size() == 0) {
|
||||
return new Page();
|
||||
}
|
||||
queryString.append(" and party.UUID in(:checked_list)");
|
||||
parameters.put("checked_list", checked_list);
|
||||
}
|
||||
|
||||
queryString.append(" order by party.CREATE_TIME desc ");
|
||||
|
||||
Page page = this.pagedQueryDao.pagedQuerySQL(pageNo, pageSize, queryString.toString(), parameters);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return page;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public Page pagedQueryNetwork(int pageNo, int pageSize, String loginPartyId,
|
||||
String roleName, String usernameOrUid, String targetPartyId) {
|
||||
Page page = getPageList(pageNo, pageSize, loginPartyId, usernameOrUid, roleName,
|
||||
targetPartyId);// 获取当前页的用户相关
|
||||
/**
|
||||
* 页面查询第一层partyId级
|
||||
*/
|
||||
List<String> list_partyId = new ArrayList<String>();
|
||||
|
||||
for (int i = 0; i < page.getElements().size(); i++) {
|
||||
Map<String, Object> map_party = (Map<String, Object>) page.getElements().get(i);
|
||||
list_partyId.add(map_party.get("partyId").toString());
|
||||
}
|
||||
List<Map<String, Object>> result = new ArrayList<Map<String, Object>>();
|
||||
|
||||
for (int i = 0; i < list_partyId.size(); i++) {
|
||||
int reco_agent = 0;
|
||||
/**
|
||||
* 所有子集
|
||||
*/
|
||||
List<String> children_all = this.userRecomService.findChildren(list_partyId.get(i));
|
||||
/**
|
||||
* 正式用户
|
||||
*/
|
||||
List<String> children_member = new ArrayList<>();
|
||||
for (int j = 0; j < children_all.size(); j++) {
|
||||
String partyId = children_all.get(j);
|
||||
Party party = partyService.cachePartyBy(partyId,true);
|
||||
if (Constants.SECURITY_ROLE_AGENT.equals(party.getRolename())||Constants.SECURITY_ROLE_AGENTLOW.equals(party.getRolename())) {
|
||||
reco_agent++;
|
||||
} else if (Constants.SECURITY_ROLE_MEMBER.equals(party.getRolename())) {
|
||||
children_member.add(partyId);
|
||||
}
|
||||
|
||||
}
|
||||
Map<String, Object> item_result = new HashMap<String, Object>() ;
|
||||
|
||||
|
||||
Party party = partyService.cachePartyBy(list_partyId.get(i),false);
|
||||
|
||||
UserRecom userRecom = this.userRecomService.findByPartyId(party.getId());
|
||||
if(userRecom != null && !"".equals(userRecom.getReco_id()) ) {
|
||||
Party party_parent = partyService.cachePartyBy(userRecom.getReco_id(),true);
|
||||
item_result.put("username_parent", party_parent.getUsername());
|
||||
|
||||
}
|
||||
Agent agent = this.findByPartyId(party.getId());
|
||||
item_result.put("reco_agent", reco_agent);
|
||||
item_result.put("reco_member", children_member.size());
|
||||
item_result.put("partyId", list_partyId.get(i));
|
||||
|
||||
item_result.put("username", party.getUsername());
|
||||
item_result.put("usercode", party.getUsercode());
|
||||
item_result.put("remarks", party.getRemarks());
|
||||
if(agent != null) {
|
||||
item_result.put("id", agent.getId());
|
||||
}
|
||||
|
||||
|
||||
result.add(item_result);
|
||||
}
|
||||
Page page_result = Page.EMPTY_PAGE;
|
||||
|
||||
page_result.setElements(result);
|
||||
return page_result;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private Page getPageList(int pageNo, int pageSize, String loginPartyId,
|
||||
String roleName, String usernameOrUid, String targetPartyId) {
|
||||
Map<String, Object> parameters = new HashMap<String, Object>();
|
||||
StringBuffer queryString = new StringBuffer();
|
||||
queryString.append(
|
||||
"SELECT party.ROLENAME AS rolename,party.USERNAME AS username,party.USERCODE AS UID,party.UUID AS partyId ");// 用户
|
||||
queryString.append("FROM PAT_PARTY party ");
|
||||
queryString.append("LEFT JOIN PAT_USER_RECOM ur ON party.UUID = ur.PARTY_ID ");// 推荐人 根目录判定
|
||||
queryString.append("WHERE 1=1 ");
|
||||
queryString.append("AND party.ROLENAME IN('" + Constants.SECURITY_ROLE_AGENT + "','"+Constants.SECURITY_ROLE_AGENTLOW+"') ");
|
||||
if (!StringUtils.isNullOrEmpty(loginPartyId)) {
|
||||
List children = this.userRecomService.findChildren(loginPartyId);
|
||||
if (children.size() == 0) {
|
||||
return new Page();
|
||||
}
|
||||
queryString.append(" and party.UUID in (:children) ");
|
||||
parameters.put("children", children);
|
||||
}
|
||||
if (!StringUtils.isNullOrEmpty(targetPartyId)) {
|
||||
List children = this.userRecomService.findRecomsToPartyId(targetPartyId);
|
||||
if (children.size() == 0) {
|
||||
return new Page();
|
||||
}
|
||||
queryString.append(" and party.UUID in (:children) ");
|
||||
parameters.put("children", children);
|
||||
}
|
||||
if (StringUtils.isNullOrEmpty(targetPartyId) && StringUtils.isNullOrEmpty(usernameOrUid)) {// 目标partyId为空
|
||||
// ,username参数为空,的情况下,如果是视图,显示根目录
|
||||
queryString.append(" and ur.RECO_ID is NULL ");
|
||||
}
|
||||
if (!StringUtils.isNullOrEmpty(usernameOrUid)) {
|
||||
queryString.append("AND (party.USERNAME like:username OR party.USERCODE like:username ) ");
|
||||
parameters.put("username", "%" + usernameOrUid + "%");
|
||||
}
|
||||
queryString.append("ORDER BY party.USERCODE ASC ");
|
||||
Page page = this.pagedQueryDao.pagedQuerySQL(pageNo, pageSize, queryString.toString(), parameters);
|
||||
return page;
|
||||
}
|
||||
|
||||
|
||||
public List<AgentNodes> findAgentNodes(String loginPartyId, String checkedPartyId, String url) {
|
||||
Map<String, String> map_checked = new HashMap();
|
||||
|
||||
List<UserRecom> parents = userRecomService.getParents(checkedPartyId);
|
||||
for (int i = 0; i < parents.size(); i++) {
|
||||
UserRecom userRecom = parents.get(i);
|
||||
map_checked.put(userRecom.getReco_id().toString(), userRecom.getReco_id().toString());
|
||||
}
|
||||
|
||||
map_checked.put(checkedPartyId, checkedPartyId);
|
||||
List result = new ArrayList();
|
||||
List list = new ArrayList();
|
||||
AgentNodes root = new AgentNodes();
|
||||
root.setHref(url);
|
||||
List party_list;
|
||||
if (StringUtils.isNullOrEmpty(loginPartyId)) {// " FROM Party WHERE reco_id IS NULL or reco_id = '' and
|
||||
// managerlevel !=0"
|
||||
party_list = getHibernateTemplate()
|
||||
.find(" FROM Agent WHERE parent_partyId IS NULL or parent_partyId = '' ");
|
||||
root.setText("所有代理商");
|
||||
} else {
|
||||
List recom_list = userRecomService.findRecoms(loginPartyId);
|
||||
/**
|
||||
* 将自己放入列表中
|
||||
*/
|
||||
Party party = this.partyService.cachePartyBy(loginPartyId,true);
|
||||
Agent agent=findByPartyId(party.getId());
|
||||
party_list = new ArrayList();
|
||||
party_list.add(agent);
|
||||
/**
|
||||
* 将子代理放入列表中
|
||||
*/
|
||||
for (int i = 0; i < recom_list.size(); i++) {
|
||||
party = this.partyService.cachePartyBy(((UserRecom) recom_list.get(i)).getPartyId(),true);
|
||||
agent=findByPartyId(party.getId());
|
||||
if(agent != null)
|
||||
party_list.add(agent);
|
||||
}
|
||||
root.setText("线下代理商");
|
||||
}
|
||||
|
||||
for (int i = 0; i < party_list.size(); i++) {
|
||||
|
||||
Agent agent = (Agent) party_list.get(i);
|
||||
AgentNodes nodes = new AgentNodes();
|
||||
nodes.setTags(agent.getPartyId().toString());
|
||||
nodes.setHref(url + "?partyId=" + agent.getPartyId().toString());
|
||||
Party party = this.partyService.cachePartyBy(agent.getPartyId(),true);
|
||||
String username = party.getUsername();
|
||||
String name = party.getName();
|
||||
if ((!StringUtils.isNullOrEmpty(loginPartyId)) && (!StringUtils.isNullOrEmpty(username))
|
||||
&& (username.length() == 11)) {
|
||||
username = username.substring(0, 3) + "****" + username.substring(7, 11);
|
||||
}
|
||||
|
||||
Map state = new HashMap();
|
||||
if (map_checked.get(agent.getId().toString()) != null) {
|
||||
state.put("checked", Boolean.valueOf(true));
|
||||
state.put("expanded", Boolean.valueOf(true));
|
||||
root.setState(state);
|
||||
}
|
||||
|
||||
nodes.setText(username);
|
||||
findAgentNodesLoop(loginPartyId, nodes, map_checked, url);
|
||||
list.add(nodes);
|
||||
}
|
||||
root.setNodes(list);
|
||||
result.add(root);
|
||||
return result;
|
||||
}
|
||||
|
||||
public void findAgentNodesLoop(String loginPartyId, AgentNodes nodes, Map<String, String> map_checked, String url) {
|
||||
List recom_list = userRecomService.findRecoms(nodes.getTags());
|
||||
List list = new ArrayList();
|
||||
for (int i = 0; i < recom_list.size(); i++) { // findPartyByCache
|
||||
Party party = this.partyService.cachePartyBy(((UserRecom) recom_list.get(i)).getPartyId(),true);
|
||||
/**
|
||||
* 如果rolename不是代理商则不添加
|
||||
*
|
||||
*/
|
||||
if(party == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if(!Constants.SECURITY_ROLE_AGENT.equals(party.getRolename())||!Constants.SECURITY_ROLE_AGENTLOW.equals(party.getRolename())) {
|
||||
continue;
|
||||
}
|
||||
AgentNodes children_nodes = new AgentNodes();
|
||||
children_nodes.setTags(party.getId().toString());
|
||||
children_nodes.setHref(url + "?partyId=" + party.getId().toString());
|
||||
// String username = party.getName();
|
||||
// if ((!StringUtils.isNullOrEmpty(loginPartyId)) && (!StringUtils.isNullOrEmpty(username))
|
||||
// && (username.length() == 11)) {
|
||||
// username = username.substring(0, 3) + "****" + username.substring(7, 11);
|
||||
// }
|
||||
//
|
||||
// children_nodes.setText(username + "(" + party.getUsername() + ")");
|
||||
children_nodes.setText( party.getUsername() );
|
||||
Map state = new HashMap();
|
||||
if (map_checked.get(party.getId().toString()) != null) {
|
||||
state.put("checked", Boolean.valueOf(true));
|
||||
state.put("expanded", Boolean.valueOf(true));
|
||||
children_nodes.setState(state);
|
||||
}
|
||||
list.add(children_nodes);
|
||||
findAgentNodesLoop(loginPartyId, children_nodes, map_checked, url);
|
||||
}
|
||||
nodes.setNodes(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void save(String name, String username, String password, boolean login_authority,String remarks, String parents_usercode,boolean opera_authority) {
|
||||
username = username.trim();
|
||||
password = password.trim();
|
||||
|
||||
if (secUserService.findUserByLoginName(username) != null) {
|
||||
throw new BusinessException("用户名重复");
|
||||
}
|
||||
/**
|
||||
* 用户code
|
||||
*/
|
||||
String usercode = getUsercode();
|
||||
|
||||
if (!StringUtils.isNullOrEmpty(parents_usercode)) {
|
||||
Party party_parents=partyService.findPartyByUsercode(parents_usercode);
|
||||
if (party_parents==null ) {
|
||||
throw new BusinessException("推荐码不正确");
|
||||
}
|
||||
if (!Constants.SECURITY_ROLE_AGENT.equals(party_parents.getRolename()) && !Constants.SECURITY_ROLE_AGENTLOW.equals(party_parents.getRolename())) {
|
||||
throw new BusinessException("推荐码不正确");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* party
|
||||
*/
|
||||
Party party = new Party();
|
||||
party.setUsername(username);
|
||||
party.setUsercode(usercode);
|
||||
party.setName(name);
|
||||
party.setLogin_authority(login_authority);
|
||||
party.setRemarks(remarks);
|
||||
party.setSafeword(passwordEncoder.encodePassword("000000", party.getUsername()));
|
||||
|
||||
party.setRolename(opera_authority?Constants.SECURITY_ROLE_AGENT:Constants.SECURITY_ROLE_AGENTLOW);
|
||||
|
||||
party = partyService.save(party);
|
||||
|
||||
|
||||
if (!StringUtils.isNullOrEmpty(parents_usercode)) {
|
||||
Party party_parents=partyService.findPartyByUsercode(parents_usercode);
|
||||
|
||||
if (party_parents==null ) {
|
||||
throw new BusinessException("推荐码不正确");
|
||||
}
|
||||
if (!Constants.SECURITY_ROLE_AGENT.equals(party_parents.getRolename()) && !Constants.SECURITY_ROLE_AGENTLOW.equals(party_parents.getRolename())) {
|
||||
throw new BusinessException("推荐码不正确");
|
||||
}
|
||||
UserRecom userRecom = new UserRecom();
|
||||
userRecom.setPartyId(party.getId());
|
||||
userRecom.setReco_id(party_parents.getId().toString());// 父类partyId
|
||||
this.userRecomService.save(userRecom);
|
||||
}
|
||||
/**
|
||||
* SecUser
|
||||
*/
|
||||
Role role = this.roleService.findRoleByName(opera_authority?Constants.SECURITY_ROLE_AGENT:Constants.SECURITY_ROLE_AGENTLOW);
|
||||
|
||||
SecUser secUser = new SecUser();
|
||||
secUser.setPartyId(String.valueOf(party.getId()));
|
||||
secUser.getRoles().add(role);
|
||||
|
||||
secUser.setUsername(username);
|
||||
secUser.setPassword(password);
|
||||
secUser.setEnabled(login_authority);
|
||||
secUser.setSafeword(passwordEncoder.encodePassword("000000", party.getUsername()));
|
||||
|
||||
|
||||
this.secUserService.saveUser(secUser);
|
||||
|
||||
// /**
|
||||
// * 生成二维码图片
|
||||
// */
|
||||
// qRGenerateService.generate(usercode);
|
||||
|
||||
/**
|
||||
* 2生币账户 生成小二维码
|
||||
*/
|
||||
|
||||
// String image_name = qRGenerateService.generate185(usercode);
|
||||
//
|
||||
// /**
|
||||
// * 1生成海报合成图片
|
||||
// */
|
||||
//
|
||||
// PosterThread posterThread = new PosterThread(image_name, usercode);
|
||||
//
|
||||
// Thread t = new Thread(posterThread);
|
||||
// t.start();
|
||||
|
||||
/**
|
||||
* 以上复制到演示用户
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* usdt账户
|
||||
*/
|
||||
Wallet wallet = new Wallet();
|
||||
wallet.setPartyId(party.getId().toString());
|
||||
this.walletService.save(wallet);
|
||||
/**
|
||||
* 5个币账户
|
||||
*/
|
||||
// Set<String> keys = Constants.WALLETEXTEND.keySet();
|
||||
// for (String key_coin : keys) {
|
||||
// WalletExtend wallet_coin = new WalletExtend();
|
||||
// wallet_coin.setPartyId(party.getId().toString());
|
||||
// wallet_coin.setWallettype(Constants.WALLETEXTEND.get(key_coin));
|
||||
// this.walletService.save(wallet_coin);
|
||||
// }
|
||||
|
||||
|
||||
|
||||
Agent agent=new Agent();
|
||||
agent.setPartyId(party.getId());
|
||||
if (!StringUtils.isNullOrEmpty(parents_usercode)) {
|
||||
Party party_parents=partyService.findPartyByUsercode(parents_usercode);
|
||||
agent.setParent_partyId(party_parents.getId().toString());
|
||||
}
|
||||
this.getHibernateTemplate().save(agent);
|
||||
|
||||
|
||||
}
|
||||
|
||||
private String getUsercode() {
|
||||
Syspara syspara = sysparaService.find("agent_uid_sequence");
|
||||
int random = (int) (Math.random() * 3 + 1);
|
||||
int user_uid_sequence = syspara.getInteger() + random;
|
||||
syspara.setValue(user_uid_sequence);
|
||||
sysparaService.update(syspara);
|
||||
|
||||
String usercode = String.valueOf(user_uid_sequence);
|
||||
// Party party = this.partyService.findPartyByUsercode(usercode);
|
||||
// if (party != null) {
|
||||
// usercode = getUsercode();
|
||||
// }
|
||||
|
||||
return usercode;
|
||||
}
|
||||
|
||||
public Agent findByPartyId(Serializable partyId) {
|
||||
List list = getHibernateTemplate().find("FROM Agent WHERE partyId=?0 ",
|
||||
new Object[] { partyId });
|
||||
if (list.size() > 0) {
|
||||
return (Agent) list.get(0);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Agent get(String id) {
|
||||
return this.getHibernateTemplate().get(Agent.class, id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(String id, String name, boolean login_authority, String remarks,boolean opera_authority) {
|
||||
Agent agent= this.get(id);
|
||||
Party party = this.partyService.cachePartyBy(agent.getPartyId(),false);
|
||||
party.setRolename(opera_authority?Constants.SECURITY_ROLE_AGENT:Constants.SECURITY_ROLE_AGENTLOW);
|
||||
party.setName(name);
|
||||
party.setRemarks(remarks);
|
||||
party.setLogin_authority(login_authority);
|
||||
this.partyService.update(party);
|
||||
|
||||
SecUser secUser= secUserService.findUserByPartyId(agent.getPartyId());
|
||||
Role role = this.roleService.findRoleByName(opera_authority?Constants.SECURITY_ROLE_AGENT:Constants.SECURITY_ROLE_AGENTLOW);
|
||||
|
||||
Set<Role> roles = secUser.getRoles();
|
||||
roles.clear();
|
||||
roles.add(role);
|
||||
secUser.setRoles(roles);
|
||||
secUser.setEnabled(login_authority);
|
||||
|
||||
this.secUserService.update(secUser);
|
||||
|
||||
}
|
||||
@Override
|
||||
public void update(Agent agent) {
|
||||
|
||||
this.getHibernateTemplate().update(agent);
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void setPagedQueryDao(PagedQueryDao pagedQueryDao) {
|
||||
this.pagedQueryDao = pagedQueryDao;
|
||||
}
|
||||
|
||||
public void setUserRecomService(UserRecomService userRecomService) {
|
||||
this.userRecomService = userRecomService;
|
||||
}
|
||||
|
||||
public void setWalletService(WalletService walletService) {
|
||||
this.walletService = walletService;
|
||||
}
|
||||
|
||||
public void setPartyService(PartyService partyService) {
|
||||
this.partyService = partyService;
|
||||
}
|
||||
|
||||
public void setSecUserService(SecUserService secUserService) {
|
||||
this.secUserService = secUserService;
|
||||
}
|
||||
|
||||
public void setRoleService(RoleService roleService) {
|
||||
this.roleService = roleService;
|
||||
}
|
||||
|
||||
public class PosterThread implements Runnable {
|
||||
String image_name;
|
||||
String usercode;
|
||||
|
||||
public void run() {
|
||||
try {
|
||||
qRGenerateService.generate_poster(image_name, usercode);
|
||||
|
||||
} catch (Exception e) {
|
||||
logger.error("error:", e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public PosterThread(String image_name, String usercode) {
|
||||
this.image_name = image_name;
|
||||
this.usercode = usercode;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void setqRGenerateService(QRGenerateService qRGenerateService) {
|
||||
this.qRGenerateService = qRGenerateService;
|
||||
}
|
||||
|
||||
public void setSysparaService(SysparaService sysparaService) {
|
||||
this.sysparaService = sysparaService;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void setPasswordEncoder(PasswordEncoder passwordEncoder) {
|
||||
this.passwordEncoder = passwordEncoder;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
103
admin/src/main/java/project/web/admin/impl/user/AdminPublicUserServiceImpl.java
Executable file
103
admin/src/main/java/project/web/admin/impl/user/AdminPublicUserServiceImpl.java
Executable file
@@ -0,0 +1,103 @@
|
||||
package project.web.admin.impl.user;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import org.springframework.security.providers.encoding.PasswordEncoder;
|
||||
|
||||
import kernel.exception.BusinessException;
|
||||
import project.Constants;
|
||||
import project.log.Log;
|
||||
import project.log.LogService;
|
||||
import project.syspara.SysparaService;
|
||||
|
||||
import project.user.googleauth.GoogleAuthService;
|
||||
import project.web.admin.service.user.AdminPublicUserService;
|
||||
import security.SecUser;
|
||||
import security.internal.SecUserService;
|
||||
|
||||
public class AdminPublicUserServiceImpl implements AdminPublicUserService {
|
||||
private SecUserService secUserService;
|
||||
private LogService logService;
|
||||
private PasswordEncoder passwordEncoder;
|
||||
|
||||
private SysparaService sysparaService;
|
||||
private GoogleAuthService googleAuthService;
|
||||
|
||||
@Override
|
||||
public void saveChangePassword(String partyId, String oldpassword, String password,String username,String safeword,String code,String googleAuthCode) {
|
||||
SecUser secUser = secUserService.findUserByLoginName(username);
|
||||
checkGoogleAuthCode(secUser,googleAuthCode);
|
||||
checkLoginSafeword(username,safeword);
|
||||
this.secUserService.updatePassword(username, oldpassword, password);
|
||||
|
||||
saveLog(secUser,username,username+"修改自身密码,验证码:["+code+"]");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveChangeSafeword(String partyId, String oldpassword, String password,String username,String code,String googleAuthCode) {
|
||||
SecUser secUser = secUserService.findUserByLoginName(username);
|
||||
checkGoogleAuthCode(secUser,googleAuthCode);
|
||||
this.secUserService.updateSafeword(username, oldpassword, password);
|
||||
saveLog(secUser,username,username+"修改自身资金密码,验证码:["+code+"]");
|
||||
}
|
||||
/**
|
||||
* 验证谷歌验证码
|
||||
* @param code
|
||||
*/
|
||||
private void checkGoogleAuthCode(SecUser secUser,String code) {
|
||||
if(!secUser.isGoogle_auth_bind()) {
|
||||
throw new BusinessException("请先绑定谷歌验证器");
|
||||
}
|
||||
boolean checkCode = googleAuthService.checkCode(secUser.getGoogle_auth_secret(), code);
|
||||
if(!checkCode) {
|
||||
throw new BusinessException("谷歌验证码错误");
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 验证登录人资金密码
|
||||
* @param operatorUsername
|
||||
* @param loginSafeword
|
||||
*/
|
||||
private void checkLoginSafeword(String operatorUsername,String loginSafeword) {
|
||||
SecUser sec = this.secUserService.findUserByLoginName(operatorUsername);
|
||||
String sysSafeword = sec.getSafeword();
|
||||
String safeword_md5 = passwordEncoder.encodePassword(loginSafeword, operatorUsername);
|
||||
if (!safeword_md5.equals(sysSafeword)) {
|
||||
throw new BusinessException("登录人资金密码错误");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void saveLog(SecUser secUser, String operator,String context) {
|
||||
Log log = new Log();
|
||||
log.setCategory(Constants.LOG_CATEGORY_OPERATION);
|
||||
log.setOperator(operator);
|
||||
log.setUsername(secUser.getUsername());
|
||||
log.setPartyId(secUser.getPartyId());
|
||||
log.setLog(context);
|
||||
log.setCreateTime(new Date());
|
||||
logService.saveSync(log);
|
||||
}
|
||||
|
||||
public void setSecUserService(SecUserService secUserService) {
|
||||
this.secUserService = secUserService;
|
||||
}
|
||||
|
||||
|
||||
public void setLogService(LogService logService) {
|
||||
this.logService = logService;
|
||||
}
|
||||
|
||||
public void setPasswordEncoder(PasswordEncoder passwordEncoder) {
|
||||
this.passwordEncoder = passwordEncoder;
|
||||
}
|
||||
|
||||
public void setSysparaService(SysparaService sysparaService) {
|
||||
this.sysparaService = sysparaService;
|
||||
}
|
||||
|
||||
public void setGoogleAuthService(GoogleAuthService googleAuthService) {
|
||||
this.googleAuthService = googleAuthService;
|
||||
}
|
||||
|
||||
}
|
||||
244
admin/src/main/java/project/web/admin/impl/user/AdminUserRecomServiceImpl.java
Executable file
244
admin/src/main/java/project/web/admin/impl/user/AdminUserRecomServiceImpl.java
Executable file
@@ -0,0 +1,244 @@
|
||||
package project.web.admin.impl.user;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.orm.hibernate5.support.HibernateDaoSupport;
|
||||
import org.springframework.security.providers.encoding.PasswordEncoder;
|
||||
|
||||
import kernel.exception.BusinessException;
|
||||
import kernel.util.StringUtils;
|
||||
import kernel.web.Page;
|
||||
import kernel.web.PagedQueryDao;
|
||||
import project.Constants;
|
||||
import project.log.Log;
|
||||
import project.log.LogService;
|
||||
import project.party.PartyService;
|
||||
import project.party.model.Party;
|
||||
import project.party.model.UserRecom;
|
||||
import project.party.recom.UserRecomService;
|
||||
import project.user.Agent;
|
||||
import project.user.UserDataService;
|
||||
import project.web.admin.service.user.AdminAgentService;
|
||||
import project.web.admin.service.user.AdminUserRecomService;
|
||||
import security.SecUser;
|
||||
import security.internal.SecUserService;
|
||||
|
||||
public class AdminUserRecomServiceImpl extends HibernateDaoSupport implements AdminUserRecomService {
|
||||
|
||||
protected PagedQueryDao pagedQueryDao;
|
||||
|
||||
protected SecUserService secUserService;
|
||||
|
||||
protected UserDataService userDataService;
|
||||
protected LogService logService;
|
||||
|
||||
protected UserRecomService userRecomService;
|
||||
|
||||
protected AdminAgentService adminAgentService;
|
||||
|
||||
protected PartyService partyService;
|
||||
|
||||
protected PasswordEncoder passwordEncoder;
|
||||
|
||||
@Override
|
||||
public Page pagedQuery(int pageNo, int pageSize, String usernameOrUid,String parentUsername,String loginPartyId) {
|
||||
|
||||
StringBuffer queryString = new StringBuffer(" SELECT ");
|
||||
queryString
|
||||
.append(" recom.UUID id ,info.USERNAME username,info.UUID partyId,info.ROLENAME rolename ,info.USERCODE usercode,parent_info.USERNAME parent_username ");
|
||||
queryString.append(" FROM ");
|
||||
queryString.append(" PAT_PARTY info LEFT JOIN PAT_USER_RECOM recom ON info.UUID = recom.PARTY_ID ");
|
||||
queryString.append(" LEFT JOIN PAT_PARTY parent_info ON recom.RECO_ID = parent_info.UUID ");
|
||||
queryString.append(" where 1=1 ");
|
||||
Map<String, Object> parameters = new HashMap<String, Object>();
|
||||
|
||||
|
||||
if (!StringUtils.isNullOrEmpty(loginPartyId)) {
|
||||
List children = this.userRecomService.findChildren(loginPartyId);
|
||||
if (children.size() == 0) {
|
||||
return new Page();
|
||||
}
|
||||
queryString.append(" and info.UUID in (:children) ");
|
||||
parameters.put("children", children);
|
||||
}
|
||||
|
||||
// if (partyId != null) {
|
||||
// queryString.append(" and info.UUID = :partyId ");
|
||||
// parameters.put("partyId", partyId);
|
||||
// }
|
||||
|
||||
// if (!StringUtils.isNullOrEmpty(usercode_para)) {
|
||||
// queryString.append(" and info.USERCODE =:usercode ");
|
||||
// parameters.put("usercode", usercode_para);
|
||||
//
|
||||
// }
|
||||
if (!StringUtils.isNullOrEmpty(usernameOrUid)) {
|
||||
queryString.append("AND (info.USERNAME like:username OR info.USERCODE like:username ) ");
|
||||
parameters.put("username","%"+usernameOrUid+"%");
|
||||
}
|
||||
if (!StringUtils.isNullOrEmpty(parentUsername)) {
|
||||
queryString.append("AND parent_info.USERNAME like:parentUsername ");
|
||||
parameters.put("parentUsername","%"+parentUsername+"%");
|
||||
}
|
||||
queryString.append("AND info.ROLENAME !=:no_rolename ");
|
||||
parameters.put("no_rolename",Constants.SECURITY_ROLE_TEST);
|
||||
// if (partyId_parent != null) {
|
||||
// queryString.append(" and recom.RECO_ID = :partyId_parent");
|
||||
// parameters.put("partyId_parent", partyId_parent);
|
||||
//
|
||||
// }
|
||||
queryString.append(" order by info.CREATE_TIME desc ");
|
||||
|
||||
return pagedQueryDao.pagedQuerySQL(pageNo, pageSize, queryString.toString(), parameters);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void setPagedQueryDao(PagedQueryDao pagedQueryDao) {
|
||||
this.pagedQueryDao = pagedQueryDao;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public UserRecom get(String id) {
|
||||
return this.getHibernateTemplate().get(UserRecom.class, id);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 验证登录人资金密码
|
||||
* @param operatorUsername
|
||||
* @param loginSafeword
|
||||
*/
|
||||
protected void checkLoginSafeword(String operatorUsername,String loginSafeword) {
|
||||
SecUser sec = this.secUserService.findUserByLoginName(operatorUsername);
|
||||
String sysSafeword = sec.getSafeword();
|
||||
String safeword_md5 = passwordEncoder.encodePassword(loginSafeword, operatorUsername);
|
||||
if (!safeword_md5.equals(sysSafeword)) {
|
||||
throw new BusinessException("登录人资金密码错误");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(String partyId, String reco_username,String operator_name,String ip,String loginSafeword) {
|
||||
|
||||
checkLoginSafeword(operator_name,loginSafeword);
|
||||
SecUser SecUser = secUserService.findUserByLoginName(reco_username);
|
||||
if (SecUser == null || StringUtils.isNullOrEmpty(SecUser.getPartyId())) {
|
||||
throw new BusinessException("无法找到推荐用户");
|
||||
}
|
||||
if(partyId.equals(SecUser.getPartyId()) ) {
|
||||
throw new BusinessException("推荐人UID错误");
|
||||
}
|
||||
UserRecom userRecom = findByPartyId(partyId);
|
||||
String user_last = null;
|
||||
if(userRecom == null) {
|
||||
userRecom = new UserRecom();
|
||||
userRecom.setPartyId(partyId);
|
||||
userRecom.setReco_id(SecUser.getPartyId());
|
||||
this.userRecomService.save(userRecom);
|
||||
}else {
|
||||
user_last = userRecom.getReco_id().toString();
|
||||
userRecom.setReco_id(SecUser.getPartyId());
|
||||
this.userRecomService.update(partyId,SecUser.getPartyId());
|
||||
}
|
||||
SecUser SecUser_user = secUserService.findUserByPartyId(partyId);
|
||||
Party party_parent = this.partyService.cachePartyBy(SecUser.getPartyId(),true);
|
||||
Party party_user = this.partyService.cachePartyBy(SecUser_user.getPartyId(),true);
|
||||
/**
|
||||
* 如果2个都是代理商,则同时修改代理商关系表
|
||||
*/
|
||||
if((Constants.SECURITY_ROLE_AGENT.equals(party_user.getRolename()) ||Constants.SECURITY_ROLE_AGENTLOW.equals(party_user.getRolename()) )
|
||||
&& (Constants.SECURITY_ROLE_AGENT.equals(party_parent.getRolename())||Constants.SECURITY_ROLE_AGENTLOW.equals(party_parent.getRolename()))) {
|
||||
Agent agent = this.adminAgentService.findByPartyId(party_user.getId());
|
||||
agent.setParent_partyId(party_parent.getId());
|
||||
this.adminAgentService.update(agent);
|
||||
}
|
||||
String username_user = SecUser_user.getUsername();
|
||||
|
||||
/**
|
||||
* 前推荐人
|
||||
*/
|
||||
String username_last = null;
|
||||
if(user_last != null) {
|
||||
SecUser SecUser_last = secUserService.findUserByPartyId(user_last);
|
||||
username_last = SecUser_last.getUsername();
|
||||
}else {
|
||||
username_last="无";
|
||||
}
|
||||
Log log = new Log();
|
||||
log.setUsername(username_user);
|
||||
log.setCategory(Constants.LOG_CATEGORY_OPERATION);
|
||||
log.setOperator(operator_name);
|
||||
log.setLog("ip:["+ip+"],修改推荐关系,"
|
||||
+ "原推荐人[" +username_last + "],"
|
||||
+ "修改后的推荐人[" +SecUser.getUsername() + "]");
|
||||
|
||||
logService.saveSync(log);
|
||||
|
||||
this.userDataService.saveRegister(partyId);
|
||||
|
||||
|
||||
|
||||
}
|
||||
public UserRecom findById(Serializable id) {
|
||||
return getHibernateTemplate().get(UserRecom.class, id);
|
||||
}
|
||||
protected UserRecom findByPartyId(String partyId) {
|
||||
|
||||
List list = getHibernateTemplate().find("FROM UserRecom WHERE partyId=?0 ", new Object[] { partyId });
|
||||
if (list.size() > 0) {
|
||||
return (UserRecom) list.get(0);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public void setSecUserService(SecUserService secUserService) {
|
||||
this.secUserService = secUserService;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void setUserDataService(UserDataService userDataService) {
|
||||
this.userDataService = userDataService;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void setLogService(LogService logService) {
|
||||
this.logService = logService;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void setUserRecomService(UserRecomService userRecomService) {
|
||||
this.userRecomService = userRecomService;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void setAdminAgentService(AdminAgentService adminAgentService) {
|
||||
this.adminAgentService = adminAgentService;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void setPartyService(PartyService partyService) {
|
||||
this.partyService = partyService;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void setPasswordEncoder(PasswordEncoder passwordEncoder) {
|
||||
this.passwordEncoder = passwordEncoder;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
1663
admin/src/main/java/project/web/admin/impl/user/AdminUserServiceImpl.java
Executable file
1663
admin/src/main/java/project/web/admin/impl/user/AdminUserServiceImpl.java
Executable file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,28 @@
|
||||
package project.web.admin.service.email;
|
||||
|
||||
public interface AdminEmailCodeService {
|
||||
/**
|
||||
* 发送验证码
|
||||
* @param ip
|
||||
* @param operatorUsername 操作人
|
||||
* @param context 操作内容
|
||||
* @param isSuper true:超级签,false:个人签
|
||||
*/
|
||||
public void sendCode(String ip,String operatorUsername,String context,boolean isSuper) ;
|
||||
/**
|
||||
* 验证邮箱
|
||||
* @param ip
|
||||
* @param operatorUsername
|
||||
* @param code
|
||||
* @param uri
|
||||
*/
|
||||
public void updateCheckCode(String ip, String operatorUsername, String code, String uri);
|
||||
/**
|
||||
* 谷歌验证
|
||||
* @param ip
|
||||
* @param operatorUsername
|
||||
* @param googleAuthCode
|
||||
* @param uri
|
||||
*/
|
||||
public void updateCheckGoogleAuthCode(String ip, String operatorUsername, String googleAuthCode, String uri);
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package project.web.admin.service.report;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import kernel.web.Page;
|
||||
|
||||
public interface AdminAgentAllStatisticsService {
|
||||
|
||||
public Page pagedQuery(int pageNo, int pageSize,String startTime,String endTime,String loginPartyId,String usernameOrUid,String roleName,String targetPartyId, String allPartyId);
|
||||
|
||||
public String loadExportData(HttpServletResponse response, int pageSize,String startTime,String endTime,String loginPartyId,String usernameOrUid,String roleName,String targetPartyId) throws IOException;
|
||||
|
||||
public List<Integer> getRecoNumNetList(String partyId);
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package project.web.admin.service.report;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import kernel.web.Page;
|
||||
|
||||
public interface AdminAllStatisticsService {
|
||||
|
||||
public Page pagedQuery(int pageNo, int pageSize,String startTime,String endTime,String loginPartyId);
|
||||
|
||||
public String loadExportData(HttpServletResponse response, int pageSize,String startTime,String endTime,String loginPartyId) throws IOException;
|
||||
|
||||
|
||||
/**
|
||||
* 总数据
|
||||
* @param startTime
|
||||
* @param endTime
|
||||
* @return
|
||||
*/
|
||||
public Map<String,Object> sumDatas(String startTime,String endTime,String loginPartyId);
|
||||
|
||||
/**
|
||||
* 统计某天数据
|
||||
* @param loginPartyId
|
||||
* @param day
|
||||
* @return
|
||||
*/
|
||||
public Map<String,Object> daySumData(String loginPartyId,String day);
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package project.web.admin.service.report;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import kernel.web.Page;
|
||||
|
||||
public interface AdminUserAllStatisticsService {
|
||||
|
||||
public Page pagedQuery(int pageNo, int pageSize,String startTime,String endTime,String loginPartyId,String usernameOrUid,String roleName,String targetPartyId,boolean isAgentView,String sortColumn,String sortType);
|
||||
|
||||
public Page exchangePagedQuery(int pageNo, int pageSize,String startTime,String endTime,String loginPartyId,String usernameOrUid,String roleName,String targetPartyId,
|
||||
boolean isAgentView,String sortColumn,String sortType, String sellerId ,String sellerName, String all_para_party_id);
|
||||
|
||||
/**
|
||||
* 无代理商推荐的用户报表
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param startTime
|
||||
* @param endTime
|
||||
* @param loginPartyId
|
||||
* @param usernameOrUid
|
||||
* @param roleName
|
||||
* @param targetPartyId
|
||||
* @param isAgentView
|
||||
* @return
|
||||
*/
|
||||
public Page pagedQueryNoAgentParent(int pageNo, int pageSize,String startTime,String endTime,String loginPartyId,String usernameOrUid,String roleName,String targetPartyId,boolean isAgentView,String sortColumn,String sortType);
|
||||
|
||||
public String loadExportData(HttpServletResponse response, int pageSize,String startTime,String endTime,String loginPartyId,String usernameOrUid,String roleName,String targetPartyId,boolean isAgentView,String sortColumn,String sortType) throws IOException;
|
||||
|
||||
public List<Map<String,Object>> getWalletExtends(String loginPartyId,String targetPartyId);
|
||||
|
||||
/**
|
||||
* 获取用户资产
|
||||
* @param loginPartyId
|
||||
* @param targetPartyId
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String,Object>> getAssetsAll(String loginPartyId,String targetPartyId);
|
||||
|
||||
Map<String, Object> queryWillIncomeBySellerIds(List<String> sellerIds , String startTime , String endTime);
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package project.web.admin.service.report;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
public interface AdminUserMoneyStatisticsService {
|
||||
|
||||
public List<Map<String,Object>> getAll(String loginPartyId);
|
||||
|
||||
public Map<String,Object> totleDatas(List<Map<String,Object>> list);
|
||||
|
||||
public String loadExportData(HttpServletResponse response,String loginPartyId) throws IOException;
|
||||
|
||||
/**
|
||||
* 获取钱包总金额
|
||||
* @param loginPartyId 查看下级所有的
|
||||
* @return
|
||||
*/
|
||||
public double getSumWalletByMember(String loginPartyId);
|
||||
}
|
||||
45
admin/src/main/java/project/web/admin/service/user/AdminAgentService.java
Executable file
45
admin/src/main/java/project/web/admin/service/user/AdminAgentService.java
Executable file
@@ -0,0 +1,45 @@
|
||||
package project.web.admin.service.user;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import kernel.web.Page;
|
||||
import project.user.Agent;
|
||||
|
||||
|
||||
public interface AdminAgentService {
|
||||
|
||||
/**
|
||||
* 代理分页查询
|
||||
*
|
||||
*/
|
||||
public Page pagedQuery(int pageNo, int pageSize, String name_para, String checkedPartyId);
|
||||
/**
|
||||
* 切换视图查询
|
||||
*/
|
||||
public Page pagedQueryNetwork(int pageNo, int pageSize,String loginPartyId,String usernameOrUid,String roleName,String targetPartyId);
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param loginPartyId
|
||||
* @param checkedPartyId
|
||||
* @param url
|
||||
*/
|
||||
public List<AgentNodes> findAgentNodes(String loginPartyId, String checkedPartyId, String url);
|
||||
|
||||
/**
|
||||
* 代理注册
|
||||
*/
|
||||
public void save(String name, String username, String password,boolean login_authority, String remarks, String parents_usercode,boolean opera_authority);
|
||||
|
||||
public void update(String id,String name,boolean login_authority, String remarks,boolean opera_authority);
|
||||
/**
|
||||
* 修改代理商关系
|
||||
*/
|
||||
public void update(Agent agent);
|
||||
|
||||
public Agent findByPartyId(Serializable partyId);
|
||||
|
||||
public Agent get(String id);
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package project.web.admin.service.user;
|
||||
|
||||
/**
|
||||
*用户的公共服务,
|
||||
*
|
||||
*/
|
||||
public interface AdminPublicUserService {
|
||||
/**
|
||||
* 修改密码,会验证旧密码
|
||||
*/
|
||||
public void saveChangePassword(String partyId,String oldpassword,String password,String username,String safeword,String code,String googleAuthCode);
|
||||
|
||||
/**
|
||||
* 修改资金密码,会验证旧密码
|
||||
*/
|
||||
public void saveChangeSafeword(String partyId,String oldpassword,String password,String username,String code,String googleAuthCode);
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package project.web.admin.service.user;
|
||||
|
||||
import kernel.web.Page;
|
||||
import project.party.model.UserRecom;
|
||||
|
||||
public interface AdminUserRecomService {
|
||||
|
||||
public Page pagedQuery(int pageNo, int pageSize, String usernameOrUid,String parentUsername,String login_partyId);
|
||||
|
||||
public UserRecom get(String id);
|
||||
|
||||
/**
|
||||
* 被修改用户partyId
|
||||
* 修改后的推荐人reco_username
|
||||
* 操作者用户名operator
|
||||
*/
|
||||
public void update(String partyId, String reco_username,String operator_name,String ip,String loginSafeword);
|
||||
}
|
||||
93
admin/src/main/java/project/web/admin/service/user/AdminUserService.java
Executable file
93
admin/src/main/java/project/web/admin/service/user/AdminUserService.java
Executable file
@@ -0,0 +1,93 @@
|
||||
package project.web.admin.service.user;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import kernel.web.Page;
|
||||
import project.mall.orders.model.MallAddress;
|
||||
import project.mall.user.UserGuest;
|
||||
|
||||
public interface AdminUserService {
|
||||
|
||||
/**
|
||||
* 用户基础管理
|
||||
*/
|
||||
public Page pagedQuery(int pageNo, int pageSize, String name_para, String rolename, String checkedPartyId, Boolean online, String loginIp_para, String phone, String agentPartyId);
|
||||
|
||||
/**
|
||||
* DAPP_用户管理
|
||||
*/
|
||||
public Page pagedDappQuery(int pageNo, int pageSize, String name_para, String rolename, String checkedPartyId, Boolean online, String loginIp_para);
|
||||
|
||||
/**
|
||||
* 交易所_用户管理
|
||||
*/
|
||||
public Page pagedExchangeQuery(int pageNo, int pageSize, String name_para, String rolename, String checkedPartyId, Boolean online, String loginIp_para);
|
||||
|
||||
/**
|
||||
* 演示用户注册
|
||||
*/
|
||||
public void save(String username, String password,boolean login_authority, boolean enabled,String remarks,String operatorUsername,String ip,String parents_usercode, String phone, boolean autoComment);
|
||||
|
||||
void insert(String username, String password, boolean loginAuthority, boolean enabled, String remarks, String usernameLogin, String ip, String parentsUsercode, String phone, boolean autoComment);
|
||||
|
||||
public void update(String partyId,boolean login_authority, boolean enabled, boolean withdraw_authority, String remarks,String operatorUsername,String ip);
|
||||
/**
|
||||
* 修改余额
|
||||
*/
|
||||
public void saveReset(String partyId,double money_revise);
|
||||
/**
|
||||
* 修改余额 有创建订单
|
||||
*
|
||||
* coin_type 修改币种
|
||||
*/
|
||||
public Map saveResetCreateOrder(String partyId,double money_revise,String safeword,String operator_partyId,String reset_type,String ip,String coin_type);
|
||||
|
||||
/**
|
||||
* 增加ETH矿机收益
|
||||
*
|
||||
* coin_type 修改币种
|
||||
*/
|
||||
public void saveResetEthMining(String partyId,double money_revise,String safeword,String operator_partyId,String reset_type,String ip,String coin_type, Date create_time);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 统计时间段内的用户增量
|
||||
* @param isMember
|
||||
* @param startTime
|
||||
* @param endTime
|
||||
* @return
|
||||
*/
|
||||
public int getUserCount(String isMember, String startTime, String endTime, String loginPartyId) ;
|
||||
|
||||
/**
|
||||
* 修改余额 创建提现订单
|
||||
*/
|
||||
public void saveResetCreateWithdraw(String partyId,double money_revise,String safeword,String operator_partyId,String reset_type,String ip,String coin_type);
|
||||
|
||||
/**
|
||||
* 修改可提现额度
|
||||
*/
|
||||
public void saveResetWithdraw(String partyId,double money_withdraw,String operator_username,String ip);
|
||||
|
||||
/**
|
||||
* 父类网络
|
||||
* @param partyId
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String,Object>> getParentsNet(String partyId);
|
||||
|
||||
MallAddress findUserAddressById(String id);
|
||||
|
||||
void saveUserAddress(MallAddress mallAddress);
|
||||
|
||||
void updateUserAddress(MallAddress mallAddress);
|
||||
|
||||
void saveImport(String username, String password,boolean login_authority, boolean enabled, String remarks,
|
||||
String operatorUsername,String ip,String parents_usercode, double money);
|
||||
|
||||
void updateUserName(String partyId, String userName, String password, String registerType, String phone, String usernameLogin, String loginSafeword);
|
||||
|
||||
}
|
||||
72
admin/src/main/java/project/web/admin/service/user/AgentNodes.java
Executable file
72
admin/src/main/java/project/web/admin/service/user/AgentNodes.java
Executable file
@@ -0,0 +1,72 @@
|
||||
package project.web.admin.service.user;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class AgentNodes implements Serializable {
|
||||
private static final long serialVersionUID = -279469351490108330L;
|
||||
private String tags;
|
||||
private String text;
|
||||
private String href;
|
||||
private String backColor;
|
||||
private String color;
|
||||
private Map<String, Object> state;
|
||||
private List<AgentNodes> nodes;
|
||||
|
||||
public String getTags() {
|
||||
return this.tags;
|
||||
}
|
||||
|
||||
public void setTags(String tags) {
|
||||
this.tags = tags;
|
||||
}
|
||||
|
||||
public String getText() {
|
||||
return this.text;
|
||||
}
|
||||
|
||||
public void setText(String text) {
|
||||
this.text = text;
|
||||
}
|
||||
|
||||
public String getHref() {
|
||||
return this.href;
|
||||
}
|
||||
|
||||
public void setHref(String href) {
|
||||
this.href = href;
|
||||
}
|
||||
|
||||
public List<AgentNodes> getNodes() {
|
||||
return this.nodes;
|
||||
}
|
||||
|
||||
public void setNodes(List<AgentNodes> nodes) {
|
||||
this.nodes = nodes;
|
||||
}
|
||||
|
||||
public String getBackColor() {
|
||||
return this.backColor;
|
||||
}
|
||||
|
||||
public void setBackColor(String backColor) {
|
||||
this.backColor = backColor;
|
||||
}
|
||||
|
||||
public String getColor() {
|
||||
return this.color;
|
||||
}
|
||||
|
||||
public void setColor(String color) {
|
||||
this.color = color;
|
||||
}
|
||||
|
||||
public Map<String, Object> getState() {
|
||||
return this.state;
|
||||
}
|
||||
|
||||
public void setState(Map<String, Object> state) {
|
||||
this.state = state;
|
||||
}
|
||||
}
|
||||
98
admin/src/main/java/project/web/admin/util/AliOssUtil.java
Executable file
98
admin/src/main/java/project/web/admin/util/AliOssUtil.java
Executable file
@@ -0,0 +1,98 @@
|
||||
package project.web.admin.util;
|
||||
|
||||
import com.aliyun.oss.OSS;
|
||||
import com.aliyun.oss.OSSClientBuilder;
|
||||
import com.aliyun.oss.model.Bucket;
|
||||
import com.aliyun.oss.model.CreateBucketRequest;
|
||||
import com.aliyun.oss.model.PutObjectRequest;
|
||||
import com.aliyun.oss.model.PutObjectResult;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.Date;
|
||||
import java.util.UUID;
|
||||
|
||||
public class AliOssUtil {
|
||||
|
||||
private static String endpoint = "https://oss-cn-beijing.aliyuncs.com";
|
||||
private static String accessKeyId = "LTAI5tNPmxxfqdHFYU9UZryh";
|
||||
|
||||
private static String accessKeySecret = "wWo0Qh2gYO2MTFn7VimvMFrsrFenx0";
|
||||
|
||||
private static String bucketName = "shop-home";
|
||||
private static OSS client;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 实现上传图片到OSS
|
||||
*/
|
||||
public static String uploadImg(MultipartFile multipartFile) throws IOException {
|
||||
|
||||
// 获取上传的文件的输入流
|
||||
InputStream inputStream = multipartFile.getInputStream();
|
||||
// 避免文件覆盖
|
||||
String originalFilename = multipartFile.getOriginalFilename();
|
||||
String fileName = UUID.randomUUID().toString() + originalFilename.substring(originalFilename.lastIndexOf("."));
|
||||
//上传文件到 OSS
|
||||
OSS client = new OSSClientBuilder().build(endpoint, accessKeyId, accessKeySecret);
|
||||
client.putObject(bucketName, fileName, inputStream);
|
||||
//文件访问路径
|
||||
String url = endpoint.split("//")[0] + "//" + bucketName + "." + endpoint.split("//")[1] + "/" + fileName;
|
||||
// 关闭ossClient
|
||||
client.shutdown();
|
||||
return url;// 把上传到oss的路径返回
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 创建储存空间名称
|
||||
* @param name 创建存储空间名称
|
||||
* @return
|
||||
*/
|
||||
public static boolean create(String name) {
|
||||
CreateBucketRequest createBucketRequest = new CreateBucketRequest(name);
|
||||
Bucket bucket = client.createBucket(createBucketRequest);
|
||||
return bucket!=null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 实现文件上传
|
||||
* @param bucket 存储空间名称
|
||||
* @param obj 存储对象名称,带文件后缀
|
||||
* @param data 文件内容
|
||||
* @return
|
||||
*/
|
||||
public static boolean upload(String bucket,String obj, byte[] data) {
|
||||
PutObjectRequest request = new PutObjectRequest(bucket, obj, new ByteArrayInputStream(data));
|
||||
request.setProcess("true");
|
||||
PutObjectResult result=client.putObject(request);
|
||||
return result.getResponse().getStatusCode()==200;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建访问链接
|
||||
* @param bucket 存储空间名称
|
||||
* @param obj 存储对象名称,带文件名后缀
|
||||
* @param etime 访问地址的失效时间
|
||||
* @return 访问地址
|
||||
*/
|
||||
public static String createUrl(String bucket, String obj, Date etime){
|
||||
return client.generatePresignedUrl(bucket, obj, etime).toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除文件
|
||||
* @param bucket 存储空间名称
|
||||
* @param obj 存储对象名称,带文件后缀
|
||||
*/
|
||||
public static void deFile(String bucket,String obj){
|
||||
client.deleteObject(bucket, obj);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
16
admin/src/main/resources/logback.xml
Executable file
16
admin/src/main/resources/logback.xml
Executable file
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration>
|
||||
|
||||
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- Change to DEBUG to log protocol messages -->
|
||||
<logger name="org.web3j.protocol" level="INFO"/>
|
||||
|
||||
<root level="INFO">
|
||||
<appender-ref ref="STDOUT"/>
|
||||
</root>
|
||||
</configuration>
|
||||
110
admin/src/main/resources/spring/applicationContext-activity.xml
Executable file
110
admin/src/main/resources/spring/applicationContext-activity.xml
Executable file
@@ -0,0 +1,110 @@
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
http://www.springframework.org/schema/beans/spring-beans-4.1.xsd">
|
||||
|
||||
<bean id="activityLibraryService" class="project.mall.activity.service.impl.ActivityLibraryServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate"/>
|
||||
</bean>
|
||||
<bean id="activityConfigLogService" class="project.mall.activity.service.impl.ActivityConfigLogServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate"/>
|
||||
<property name="activityPrizeLogService" ref="activityPrizeLogService"/>
|
||||
</bean>
|
||||
|
||||
<bean id="activityPrizePoolService" class="project.mall.activity.service.impl.ActivityPrizePoolServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate"/>
|
||||
</bean>
|
||||
|
||||
<bean id="activityPrizeService" class="project.mall.activity.service.impl.ActivityPrizeServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate"/>
|
||||
<property name="jdbcTemplate" ref="jdbcTemplate"/>
|
||||
<property name="activityPrizePoolService" ref="activityPrizePoolService"/>
|
||||
<property name="lotteryRecordService" ref="lotteryRecordService"/>
|
||||
<property name="activityLibraryService" ref="activityLibraryService"/>
|
||||
<property name="redisHandler" ref="redisHandler"/>
|
||||
</bean>
|
||||
<bean id="activityPrizeLogService" class="project.mall.activity.service.impl.ActivityPrizeLogServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate"/>
|
||||
</bean>
|
||||
|
||||
<bean id="activityTemplateService" class="project.mall.activity.service.impl.ActivityTemplateServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate"/>
|
||||
</bean>
|
||||
|
||||
<bean id="activityUserJoinLogService" class="project.mall.activity.service.impl.ActivityUserJoinLogServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate"/>
|
||||
</bean>
|
||||
<bean id="activityUserService" class="project.mall.activity.service.impl.ActivityUserServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate"/>
|
||||
<property name="jdbcTemplate" ref="jdbcTemplate" />
|
||||
</bean>
|
||||
|
||||
|
||||
<bean id="firstRechargeFruitDialActivityHandler" class="project.mall.activity.handler.FirstRechargeFruitDialActivityHandler">
|
||||
<property name="activityTemplateService" ref="activityTemplateService"/>
|
||||
<property name="activityLibraryService" ref="activityLibraryService"/>
|
||||
<property name="activityUserJoinLogService" ref="activityUserJoinLogService"/>
|
||||
<property name="activityUserService" ref="activityUserService"/>
|
||||
<property name="activityPrizePoolService" ref="activityPrizePoolService"/>
|
||||
<property name="activityPrizeService" ref="activityPrizeService"/>
|
||||
|
||||
<property name="walletLogService" ref="walletLogService"/>
|
||||
<property name="userRecomService" ref="userRecomService"/>
|
||||
<property name="partyService" ref="partyService"/>
|
||||
<property name="activityRechargeAndLotteryHelper" ref="activityRechargeAndLotteryHelper"/>
|
||||
<property name="activityUserPointsService" ref="activityUserPointsService"/>
|
||||
</bean>
|
||||
<bean id="simpleLotteryActivityHandler" class="project.mall.activity.handler.SimpleLotteryActivityHandler">
|
||||
<property name="activityTemplateService" ref="activityTemplateService"/>
|
||||
<property name="activityLibraryService" ref="activityLibraryService"/>
|
||||
<property name="activityUserJoinLogService" ref="activityUserJoinLogService"/>
|
||||
<property name="activityUserService" ref="activityUserService"/>
|
||||
<property name="activityPrizePoolService" ref="activityPrizePoolService"/>
|
||||
<property name="activityPrizeService" ref="activityPrizeService"/>
|
||||
|
||||
<property name="walletLogService" ref="walletLogService"/>
|
||||
<property name="userRecomService" ref="userRecomService"/>
|
||||
<property name="partyService" ref="partyService"/>
|
||||
<property name="activitySimpleLotteryHelper" ref="activitySimpleLotteryHelper"/>
|
||||
<property name="activityUserPointsService" ref="activityUserPointsService"/>
|
||||
</bean>
|
||||
|
||||
<bean id="activityEventDispatcher" class="project.mall.activity.core.ActivityEventDispatcher">
|
||||
<property name="activityLibraryService" ref="activityLibraryService"/>
|
||||
<property name="transactionMethodFragmentFun" ref="transactionMethodFragmentFun"/>
|
||||
</bean>
|
||||
<bean id="activityHelper" class="project.mall.activity.core.ActivityHelper">
|
||||
<property name="activityLibraryService" ref="activityLibraryService"/>
|
||||
<property name="activityTriggerEventService" ref="activityUserJoinLogService"/>
|
||||
<property name="activityUserService" ref="activityUserService"/>
|
||||
</bean>
|
||||
|
||||
<bean id="activityRechargeAndLotteryHelper" class="project.mall.activity.helper.ActivityRechargeAndLotteryHelper">
|
||||
<property name="activityPrizeService" ref="activityPrizeService"/>
|
||||
<property name="lotteryRecordService" ref="lotteryRecordService"/>
|
||||
<property name="activityLibraryService" ref="activityLibraryService"/>
|
||||
<property name="sellerService" ref="sellerService"/>
|
||||
<property name="userRecomService" ref="userRecomService"/>
|
||||
<property name="partyService" ref="partyService"/>
|
||||
<property name="activityUserPointsService" ref="activityUserPointsService"/>
|
||||
<property name="activityUserService" ref="activityUserService"/>
|
||||
</bean>
|
||||
<bean id="activitySimpleLotteryHelper" class="project.mall.activity.helper.ActivitySimpleLotteryHelper">
|
||||
<property name="activityPrizeService" ref="activityPrizeService"/>
|
||||
<property name="lotteryRecordService" ref="lotteryRecordService"/>
|
||||
<property name="activityLibraryService" ref="activityLibraryService"/>
|
||||
<property name="sellerService" ref="sellerService"/>
|
||||
<property name="userRecomService" ref="userRecomService"/>
|
||||
<property name="partyService" ref="partyService"/>
|
||||
<property name="activityUserPointsService" ref="activityUserPointsService"/>
|
||||
<property name="activityUserService" ref="activityUserService"/>
|
||||
<property name="activityUserPointsLogService" ref="activityUserPointsLogService"/>
|
||||
</bean>
|
||||
|
||||
<bean id="activityUserRechargeListener" class="project.mall.activity.event.ActivityUserRechargeListener">
|
||||
<property name="activityEventDispatcher" ref="activityEventDispatcher"/>
|
||||
<property name="sellerService" ref="sellerService"/>
|
||||
<property name="walletLogService" ref="walletLogService"/>
|
||||
</bean>
|
||||
|
||||
</beans>
|
||||
@@ -0,0 +1,47 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://code.alibabatech.com/schema/dubbo
|
||||
http://code.alibabatech.com/schema/dubbo/dubbo.xsd ">
|
||||
|
||||
|
||||
<bean id="activityService"
|
||||
class="project.monitor.activity.internal.ActivityServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
|
||||
</bean>
|
||||
|
||||
|
||||
<bean id="activityOrderService"
|
||||
class="project.monitor.activity.internal.ActivityOrderServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="activityService" ref="activityService" />
|
||||
<property name="partyService" ref="partyService" />
|
||||
<property name="userRecomService" ref="userRecomService" />
|
||||
<property name="walletService" ref="walletService" />
|
||||
<property name="autoMonitorDAppLogService" ref="autoMonitorDAppLogService" />
|
||||
<property name="telegramBusinessMessageService" ref="telegramBusinessMessageService" />
|
||||
</bean>
|
||||
|
||||
|
||||
|
||||
<bean id="adminActivityService"
|
||||
class="project.monitor.activity.internal.AdminActivityServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
<property name="activityService" ref="activityService" />
|
||||
|
||||
</bean>
|
||||
|
||||
<bean id="adminActivityOrderService"
|
||||
class="project.monitor.activity.internal.AdminActivityOrderServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
<property name="userRecomService" ref="userRecomService" />
|
||||
|
||||
</bean>
|
||||
|
||||
</beans>
|
||||
307
admin/src/main/resources/spring/applicationContext-auto_monitor_admin.xml
Executable file
307
admin/src/main/resources/spring/applicationContext-auto_monitor_admin.xml
Executable file
@@ -0,0 +1,307 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://code.alibabatech.com/schema/dubbo
|
||||
http://code.alibabatech.com/schema/dubbo/dubbo.xsd ">
|
||||
|
||||
|
||||
<bean id="erc20Service"
|
||||
class="project.monitor.erc20.service.internal.Erc20ServiceImpl">
|
||||
<property name="sysparaService" ref="sysparaService" />
|
||||
<property name="etherscanService" ref="etherscanService" />
|
||||
</bean>
|
||||
<bean id="autoMonitorWalletService"
|
||||
class="project.monitor.internal.AutoMonitorWalletServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="partyService" ref="partyService" />
|
||||
<property name="userRecomService" ref="userRecomService" />
|
||||
</bean>
|
||||
|
||||
<!-- <bean id="autoMonitorAddressConfigService"
|
||||
class="project.monitor.internal.AutoMonitorAddressConfigServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="jdbcTemplate" ref="jdbcTemplate" />
|
||||
</bean> -->
|
||||
<dubbo:reference id="autoMonitorAddressConfigService"
|
||||
interface="project.monitor.AutoMonitorAddressConfigService" retries="0"
|
||||
check="false" timeout="100000" />
|
||||
|
||||
|
||||
<bean id="autoMonitorOrderService"
|
||||
class="project.monitor.internal.AutoMonitorOrderServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="dAppAccountService" ref="dAppAccountService" />
|
||||
<property name="autoMonitorWalletService" ref="autoMonitorWalletService" />
|
||||
<property name="partyService" ref="partyService" />
|
||||
<property name="logService" ref="logService" />
|
||||
<property name="secUserService" ref="secUserService" />
|
||||
<property name="userRecomService" ref="userRecomService" />
|
||||
<property name="jdbcTemplate" ref="jdbcTemplate" />
|
||||
|
||||
</bean>
|
||||
|
||||
<dubbo:reference id="autoMonitorWalletTransferFromService"
|
||||
interface="project.monitor.AutoMonitorWalletTransferFromService" retries="0" check="false" timeout="120000"/>
|
||||
|
||||
|
||||
|
||||
<bean id="adminAutoMonitorWalletService"
|
||||
class="project.monitor.internal.AdminAutoMonitorWalletServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
<property name="userRecomService" ref="userRecomService" />
|
||||
|
||||
</bean>
|
||||
|
||||
|
||||
<bean id="adminAutoMonitorOrderService"
|
||||
class="project.monitor.internal.AdminAutoMonitorOrderServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
<property name="userRecomService" ref="userRecomService" />
|
||||
</bean>
|
||||
<bean id="adminDAppUserService"
|
||||
class="project.monitor.internal.AdminDAppUserServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
<property name="partyService" ref="partyService" />
|
||||
<property name="sysparaService" ref="sysparaService" />
|
||||
<property name="userRecomService" ref="userRecomService" />
|
||||
<property name="walletService" ref="walletService" />
|
||||
<property name="logService" ref="logService" />
|
||||
<property name="secUserService" ref="secUserService" />
|
||||
<property name="roleService" ref="roleService" />
|
||||
|
||||
|
||||
</bean>
|
||||
|
||||
<bean id="qRGenerateService"
|
||||
class="project.user.internal.QRGenerateServiceImpl">
|
||||
<property name="sysparaService" ref="sysparaService" />
|
||||
</bean>
|
||||
|
||||
<bean id="googleAuthService"
|
||||
class="project.user.googleauth.internal.GoogleAuthServiceImpl">
|
||||
<property name="sysparaService" ref="sysparaService" />
|
||||
<property name="secUserService" ref="secUserService" />
|
||||
<property name="qRGenerateService" ref="qRGenerateService" />
|
||||
<property name="logService" ref="logService" />
|
||||
</bean>
|
||||
|
||||
<bean id="adminAutoMonitorAddressConfigService"
|
||||
class="project.monitor.internal.AdminAutoMonitorAddressConfigServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
<property name="sysparaService" ref="sysparaService" />
|
||||
<property name="secUserService" ref="secUserService" />
|
||||
<property name="passwordEncoder" ref="passwordEncoder" />
|
||||
<property name="logService" ref="logService" />
|
||||
<property name="googleAuthService" ref="googleAuthService" />
|
||||
<property name="autoMonitorAddressConfigService" ref="autoMonitorAddressConfigService" />
|
||||
</bean>
|
||||
|
||||
|
||||
<!-- 10.29 -->
|
||||
<bean id="autoMonitorTipService"
|
||||
class="project.monitor.internal.AutoMonitorTipServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="tipService" ref="tipService" />
|
||||
<property name="autoMonitorAutoTransferFromConfigService" ref="autoMonitorAutoTransferFromConfigService" />
|
||||
</bean>
|
||||
<bean id="autoMonitorDAppLogService"
|
||||
class="project.monitor.internal.AutoMonitorDAppLogServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
</bean>
|
||||
|
||||
|
||||
<dubbo:reference id="dAppAccountService"
|
||||
interface="project.monitor.DAppAccountService" retries="0" check="false" timeout="120000"/>
|
||||
|
||||
<bean id="miningConfigService"
|
||||
class="project.monitor.mining.internal.MiningConfigServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="partyService" ref="partyService" />
|
||||
</bean>
|
||||
|
||||
|
||||
<bean id="adminMiningConfigService"
|
||||
class="project.monitor.mining.internal.AdminMiningConfigServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
<property name="miningConfigService" ref="miningConfigService" />
|
||||
|
||||
</bean>
|
||||
|
||||
<bean id="adminAutoMonitorTipService"
|
||||
class="project.monitor.internal.AdminAutoMonitorTipServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
<property name="autoMonitorTipService" ref="autoMonitorTipService" />
|
||||
<property name="userRecomService" ref="userRecomService" />
|
||||
</bean>
|
||||
|
||||
<dubbo:reference id="telegramMessageService"
|
||||
interface="project.monitor.telegram.TelegramMessageService" retries="0" check="false" timeout="3000"/>
|
||||
|
||||
<dubbo:reference id="dAppUserDataSumService"
|
||||
interface="project.monitor.report.DAppUserDataSumService" retries="0" check="false" timeout="10000"/>
|
||||
|
||||
|
||||
|
||||
|
||||
<bean id="telegramBusinessMessageService"
|
||||
class="project.monitor.telegram.business.TelegramBusinessMessageServiceImpl">
|
||||
<property name="dAppUserDataSumService" ref="dAppUserDataSumService" />
|
||||
<property name="telegramMessageService" ref="telegramMessageService" />
|
||||
<property name="userRecomService" ref="userRecomService" />
|
||||
<property name="partyService" ref="partyService" />
|
||||
<property name="walletService" ref="walletService" />
|
||||
</bean>
|
||||
|
||||
|
||||
<bean id="autoMonitorPoolDataService"
|
||||
class="project.monitor.internal.AutoMonitorPoolDataServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="dAppUserDataSumService" ref="dAppUserDataSumService" />
|
||||
<property name="dataService" ref="dataService" />
|
||||
<property name="sysparaService" ref="sysparaService" />
|
||||
</bean>
|
||||
<bean id="adminAutoMonitorPoolDataService"
|
||||
class="project.monitor.internal.AdminAutoMonitorPoolDataServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
<property name="sysparaService" ref="sysparaService" />
|
||||
<property name="secUserService" ref="secUserService" />
|
||||
<property name="passwordEncoder" ref="passwordEncoder" />
|
||||
<property name="logService" ref="logService" />
|
||||
<property name="googleAuthService" ref="googleAuthService" />
|
||||
<property name="autoMonitorPoolDataService" ref="autoMonitorPoolDataService" />
|
||||
</bean>
|
||||
<bean id="adminAutoMonitorDAppLogService"
|
||||
class="project.monitor.internal.AdminAutoMonitorDAppLogServiceImpl">
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
<property name="userRecomService" ref="userRecomService" />
|
||||
</bean>
|
||||
|
||||
<dubbo:reference id="autoMonitorAutoTransferFromConfigService"
|
||||
interface="project.monitor.AutoMonitorAutoTransferFromConfigService"
|
||||
retries="0" check="false" timeout="3000" />
|
||||
|
||||
<!-- <bean id="autoMonitorAutoTransferFromConfigService"
|
||||
class="project.monitor.internal.AutoMonitorAutoTransferFromConfigServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="userRecomService" ref="userRecomService" />
|
||||
<property name="partyService" ref="partyService" />
|
||||
</bean> -->
|
||||
<bean id="adminAutoMonitorAutoTransferFromConfigService"
|
||||
class="project.monitor.internal.AdminAutoMonitorAutoTransferFromConfigServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
<property name="userRecomService" ref="userRecomService" />
|
||||
</bean>
|
||||
|
||||
<bean id="autoMonitorTransferAddressConfigService"
|
||||
class="project.monitor.internal.AutoMonitorTransferAddressConfigServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
</bean>
|
||||
<bean id="adminAutoMonitorTransferAddressConfigService"
|
||||
class="project.monitor.internal.AdminAutoMonitorTransferAddressConfigServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
<property name="sysparaService" ref="sysparaService" />
|
||||
<property name="secUserService" ref="secUserService" />
|
||||
<property name="passwordEncoder" ref="passwordEncoder" />
|
||||
<property name="logService" ref="logService" />
|
||||
<property name="googleAuthService" ref="googleAuthService" />
|
||||
<property name="autoMonitorTransferAddressConfigService" ref="autoMonitorTransferAddressConfigService" />
|
||||
</bean>
|
||||
|
||||
<dubbo:reference id="etherscanRemoteService"
|
||||
interface="project.monitor.etherscan.EtherscanRemoteService"
|
||||
retries="0" check="false" timeout="10000" />
|
||||
|
||||
<dubbo:reference id="erc20RemoteService"
|
||||
interface="project.monitor.erc20.service.Erc20RemoteService" retries="0"
|
||||
check="false" timeout="10000" />
|
||||
|
||||
<bean id="etherscanService"
|
||||
class="project.monitor.etherscan.internal.EtherscanServiceImpl">
|
||||
<property name="sysparaService" ref="sysparaService" />
|
||||
</bean>
|
||||
|
||||
<bean id="nodeRpcService"
|
||||
class="project.monitor.noderpc.internal.NodeRpcServiceImpl">
|
||||
<property name="sysparaService" ref="sysparaService" />
|
||||
</bean>
|
||||
|
||||
<bean id="nodeRpcBusinessService"
|
||||
class="project.monitor.noderpc.business.NodeRpcBusinessServiceImpl">
|
||||
<property name="sysparaService" ref="sysparaService" />
|
||||
<property name="nodeRpcService" ref="nodeRpcService" />
|
||||
</bean>
|
||||
|
||||
|
||||
<bean id="autoMonitorSettleAddressConfigService"
|
||||
class="project.monitor.bonus.internal.AutoMonitorSettleAddressConfigServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
</bean>
|
||||
<bean id="settleOrderService"
|
||||
class="project.monitor.bonus.internal.SettleOrderServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
</bean>
|
||||
<bean id="adminAutoMonitorSettleAddressConfigService"
|
||||
class="project.monitor.bonus.internal.AdminAutoMonitorSettleAddressConfigServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
<property name="sysparaService" ref="sysparaService" />
|
||||
<property name="secUserService" ref="secUserService" />
|
||||
<property name="passwordEncoder" ref="passwordEncoder" />
|
||||
<property name="logService" ref="logService" />
|
||||
<property name="googleAuthService" ref="googleAuthService" />
|
||||
<property name="autoMonitorSettleAddressConfigService" ref="autoMonitorSettleAddressConfigService" />
|
||||
</bean>
|
||||
<bean id="adminAutoMonitorSettleOrderService"
|
||||
class="project.monitor.bonus.internal.AdminAutoMonitorSettleOrderServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
<property name="userRecomService" ref="userRecomService" />
|
||||
<property name="dAppAccountService" ref="dAppAccountService" />
|
||||
<property name="settleOrderService" ref="settleOrderService" />
|
||||
<property name="secUserService" ref="secUserService" />
|
||||
<property name="logService" ref="logService" />
|
||||
<property name="passwordEncoder" ref="passwordEncoder" />
|
||||
<property name="googleAuthService" ref="googleAuthService" />
|
||||
<property name="sysparaService" ref="sysparaService" />
|
||||
<property name="tipService" ref="tipService" />
|
||||
</bean>
|
||||
|
||||
<bean id="adminAutoMonitorIndexService"
|
||||
class="project.monitor.internal.AdminAutoMonitorIndexServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="etherscanRemoteService" ref="etherscanRemoteService" />
|
||||
<property name="erc20RemoteService" ref="erc20RemoteService" />
|
||||
<property name="autoMonitorAddressConfigService" ref="autoMonitorAddressConfigService" />
|
||||
<property name="autoMonitorSettleAddressConfigService" ref="autoMonitorSettleAddressConfigService" />
|
||||
</bean>
|
||||
|
||||
<bean id="autoMonitorPoolMiningDataService"
|
||||
class="project.monitor.internal.AutoMonitorPoolMiningDataServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="sysparaService" ref="sysparaService" />
|
||||
</bean>
|
||||
<bean id="adminAutoMonitorPoolMiningDataService"
|
||||
class="project.monitor.internal.AdminAutoMonitorPoolMiningDataServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
<property name="sysparaService" ref="sysparaService" />
|
||||
<property name="secUserService" ref="secUserService" />
|
||||
<property name="passwordEncoder" ref="passwordEncoder" />
|
||||
<property name="logService" ref="logService" />
|
||||
<property name="googleAuthService" ref="googleAuthService" />
|
||||
<property name="autoMonitorPoolMiningDataService" ref="autoMonitorPoolMiningDataService" />
|
||||
</bean>
|
||||
</beans>
|
||||
128
admin/src/main/resources/spring/applicationContext-auto_monitor_pledge_admin.xml
Executable file
128
admin/src/main/resources/spring/applicationContext-auto_monitor_pledge_admin.xml
Executable file
@@ -0,0 +1,128 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://code.alibabatech.com/schema/dubbo
|
||||
http://code.alibabatech.com/schema/dubbo/dubbo.xsd ">
|
||||
|
||||
<bean id="pledgeConfigService"
|
||||
class="project.monitor.pledge.internal.PledgeConfigServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="partyService" ref="partyService" />
|
||||
<property name="userRecomService" ref="userRecomService" />
|
||||
</bean>
|
||||
|
||||
<bean id="pledgeGalaxyConfigService"
|
||||
class="project.monitor.pledgegalaxy.internal.PledgeGalaxyConfigServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="partyService" ref="partyService" />
|
||||
<property name="userRecomService" ref="userRecomService" />
|
||||
<property name="redisHandler" ref="redisHandler" />
|
||||
<property name="sysparaService" ref="sysparaService" />
|
||||
<property name="pledgeGalaxyOrderService" ref="pledgeGalaxyOrderService" />
|
||||
</bean>
|
||||
|
||||
<bean id="pledgeOrderService"
|
||||
class="project.monitor.pledge.internal.PledgeOrderServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pledgeConfigService" ref="pledgeConfigService" />
|
||||
<property name="partyService" ref="partyService" />
|
||||
</bean>
|
||||
|
||||
<bean id="pledgeService"
|
||||
class="project.monitor.pledge.internal.PledgeServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="walletService" ref="walletService" />
|
||||
<property name="moneyLogService" ref="moneyLogService" />
|
||||
<property name="dataService" ref="dataService" />
|
||||
<property name="autoMonitorDAppLogService" ref="autoMonitorDAppLogService" />
|
||||
</bean>
|
||||
|
||||
<bean id="adminPledgeConfigService"
|
||||
class="project.monitor.pledge.internal.AdminPledgeConfigServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
</bean>
|
||||
|
||||
<bean id="adminPledgeGalaxyConfigService"
|
||||
class="project.monitor.pledgegalaxy.internal.AdminPledgeGalaxyConfigServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
</bean>
|
||||
|
||||
<bean id="adminPledgeOrderService"
|
||||
class="project.monitor.pledge.internal.AdminPledgeOrderServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
<property name="userRecomService" ref="userRecomService" />
|
||||
</bean>
|
||||
|
||||
<bean id="adminPledgeGalaxyOrderService"
|
||||
class="project.monitor.pledgegalaxy.internal.AdminPledgeGalaxyOrderServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
<property name="userRecomService" ref="userRecomService" />
|
||||
</bean>
|
||||
|
||||
<bean id="adminPledgeGalaxyProfitService"
|
||||
class="project.monitor.pledgegalaxy.internal.AdminPledgeGalaxyProfitServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
<property name="userRecomService" ref="userRecomService" />
|
||||
<property name="walletService" ref="walletService" />
|
||||
<property name="moneyLogService" ref="moneyLogService" />
|
||||
<property name="redisHandler" ref="redisHandler" />
|
||||
<property name="userDataService" ref="userDataService" />
|
||||
<property name="pledgeGalaxyOrderService" ref="pledgeGalaxyOrderService" />
|
||||
<property name="pledgeGalaxyProfitService" ref="pledgeGalaxyProfitService" />
|
||||
</bean>
|
||||
|
||||
<bean id="pledgeGalaxyProfitService"
|
||||
class="project.monitor.pledgegalaxy.internal.PledgeGalaxyProfitServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
<property name="walletService" ref="walletService" />
|
||||
<property name="pledgeGalaxyOrderService" ref="pledgeGalaxyOrderService" />
|
||||
<property name="moneyLogService" ref="moneyLogService" />
|
||||
<property name="userDataService" ref="userDataService" />
|
||||
</bean>
|
||||
|
||||
<!-- 质押2.0 -->
|
||||
<bean id="pledgeGalaxyOrderService"
|
||||
class="project.monitor.pledgegalaxy.internal.PledgeGalaxyOrderServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
<property name="walletService" ref="walletService" />
|
||||
<property name="moneyLogService" ref="moneyLogService" />
|
||||
<property name="redisHandler" ref="redisHandler" />
|
||||
<property name="userRecomService" ref="userRecomService" />
|
||||
<property name="partyService" ref="partyService" />
|
||||
<property name="dAppAccountService" ref="dAppAccountService" />
|
||||
<property name="pledgeGalaxyConfigService" ref="pledgeGalaxyConfigService" />
|
||||
<property name="userDataService" ref="userDataService" />
|
||||
<property name="jdbcTemplate" ref="jdbcTemplate" />
|
||||
<property name="tipService" ref="tipService" />
|
||||
</bean>
|
||||
|
||||
<!-- <bean id="activityOrderService"
|
||||
class="project.monitor.activity.internal.ActivityOrderServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="activityService" ref="activityService" />
|
||||
<property name="partyService" ref="partyService" />
|
||||
<property name="userRecomService" ref="userRecomService" />
|
||||
<property name="walletService" ref="walletService" />
|
||||
<property name="autoMonitorDAppLogService" ref="autoMonitorDAppLogService" />
|
||||
<property name="telegramBusinessMessageService" ref="telegramBusinessMessageService" />
|
||||
</bean>
|
||||
|
||||
<bean id="adminActivityOrderService"
|
||||
class="project.monitor.activity.internal.AdminActivityOrderServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
<property name="userRecomService" ref="userRecomService" />
|
||||
|
||||
</bean> -->
|
||||
|
||||
</beans>
|
||||
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="
|
||||
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
|
||||
">
|
||||
|
||||
<bean id="adminAutoMonitorDAppStatisticsService"
|
||||
class="project.monitor.report.internal.AdminAutoMonitorDAppStatisticsServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
<property name="namedParameterJdbcTemplate" ref="namedParameterJdbcTemplate" />
|
||||
<property name="userRecomService" ref="userRecomService" />
|
||||
</bean>
|
||||
<bean id="adminAutoMonitorUserMoneyStatisticsService"
|
||||
class="project.monitor.report.internal.AdminAutoMonitorUserMoneyStatisticsServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="namedParameterJdbcTemplate" ref="namedParameterJdbcTemplate" />
|
||||
<property name="dataService" ref="dataService" />
|
||||
<property name="walletService" ref="walletService" />
|
||||
<property name="userRecomService" ref="userRecomService" />
|
||||
</bean>
|
||||
</beans>
|
||||
@@ -0,0 +1,101 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://code.alibabatech.com/schema/dubbo
|
||||
http://code.alibabatech.com/schema/dubbo/dubbo.xsd ">
|
||||
|
||||
<!-- Service -->
|
||||
<bean id="adminAutoMonitorWithdrawService"
|
||||
class="project.monitor.withdraw.internal.AdminAutoMonitorWithdrawServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
<property name="userRecomService" ref="userRecomService" />
|
||||
<property name="walletService" ref="walletService" />
|
||||
<property name="moneyLogService" ref="moneyLogService" />
|
||||
<!-- <property name="walletLogService" ref="walletLogService" /> -->
|
||||
<property name="namedParameterJdbcTemplate" ref="namedParameterJdbcTemplate" />
|
||||
<property name="sysparaService" ref="sysparaService" />
|
||||
<property name="passwordEncoder" ref="passwordEncoder" />
|
||||
<property name="userDataService" ref="userDataService" />
|
||||
<property name="logService" ref="logService" />
|
||||
<property name="secUserService" ref="secUserService" />
|
||||
<property name="autoMonitorWithdrawService" ref="autoMonitorWithdrawService" />
|
||||
<property name="partyService" ref="partyService" />
|
||||
<property name="tipService" ref="tipService" />
|
||||
<!-- <property name="thirdBlockChainService" ref="thirdBlockChainService" /> -->
|
||||
<property name="autoMonitorDAppLogService" ref="autoMonitorDAppLogService" />
|
||||
<property name="walletLogService" ref="walletLogService" />
|
||||
|
||||
|
||||
</bean>
|
||||
|
||||
|
||||
<bean id="autoMonitorWithdrawService"
|
||||
class="project.monitor.withdraw.internal.AutoMonitorWithdrawServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="sysparaService" ref="sysparaService" />
|
||||
<property name="walletService" ref="walletService" />
|
||||
<property name="moneyLogService" ref="moneyLogService" />
|
||||
<property name="exchangeRateService"
|
||||
ref="exchangeRateService" />
|
||||
<property name="walletLogService" ref="walletLogService" />
|
||||
<property name="qRGenerateService" ref="qRGenerateService" />
|
||||
<property name="userDataService" ref="userDataService" />
|
||||
<property name="partyService" ref="partyService" />
|
||||
<!-- <property name="kycService" ref="kycService" /> -->
|
||||
<!-- <property name="kycHighLevelService" ref="kycHighLevelService" /> -->
|
||||
<property name="tipService" ref="tipService" />
|
||||
<property name="dataService" ref="dataService" />
|
||||
<property name="autoMonitorDAppLogService" ref="autoMonitorDAppLogService" />
|
||||
<property name="telegramBusinessMessageService" ref="telegramBusinessMessageService" />
|
||||
<property name="jdbcTemplate" ref="jdbcTemplate" />
|
||||
|
||||
</bean>
|
||||
|
||||
|
||||
|
||||
<!-- Service -->
|
||||
<bean id="adminAutoMonitorWithdrawCollectionService"
|
||||
class="project.monitor.withdraw.internal.AdminAutoMonitorWithdrawCollectionServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
<property name="userRecomService" ref="userRecomService" />
|
||||
<property name="walletService" ref="walletService" />
|
||||
<property name="moneyLogService" ref="moneyLogService" />
|
||||
<!-- <property name="walletLogService" ref="walletLogService" /> -->
|
||||
<property name="namedParameterJdbcTemplate" ref="namedParameterJdbcTemplate" />
|
||||
<property name="sysparaService" ref="sysparaService" />
|
||||
<property name="passwordEncoder" ref="passwordEncoder" />
|
||||
<property name="userDataService" ref="userDataService" />
|
||||
<property name="logService" ref="logService" />
|
||||
<property name="secUserService" ref="secUserService" />
|
||||
<property name="partyService" ref="partyService" />
|
||||
<property name="tipService" ref="tipService" />
|
||||
<!-- <property name="thirdBlockChainService" ref="thirdBlockChainService" /> -->
|
||||
<property name="autoMonitorDAppLogService" ref="autoMonitorDAppLogService" />
|
||||
|
||||
</bean>
|
||||
|
||||
<bean id="autoMonitorWithdrawCollectionService"
|
||||
class="project.monitor.withdraw.internal.AutoMonitorWithdrawCollectionServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="sysparaService" ref="sysparaService" />
|
||||
<property name="walletService" ref="walletService" />
|
||||
<property name="moneyLogService" ref="moneyLogService" />
|
||||
<property name="exchangeRateService"
|
||||
ref="exchangeRateService" />
|
||||
<property name="walletLogService" ref="walletLogService" />
|
||||
<property name="qRGenerateService" ref="qRGenerateService" />
|
||||
<property name="userDataService" ref="userDataService" />
|
||||
<property name="partyService" ref="partyService" />
|
||||
<property name="tipService" ref="tipService" />
|
||||
<property name="dataService" ref="dataService" />
|
||||
<property name="autoMonitorDAppLogService" ref="autoMonitorDAppLogService" />
|
||||
<property name="telegramBusinessMessageService" ref="telegramBusinessMessageService" />
|
||||
<property name="jdbcTemplate" ref="jdbcTemplate" />
|
||||
|
||||
</bean>
|
||||
</beans>
|
||||
38
admin/src/main/resources/spring/applicationContext-cms_admin.xml
Executable file
38
admin/src/main/resources/spring/applicationContext-cms_admin.xml
Executable file
@@ -0,0 +1,38 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://code.alibabatech.com/schema/dubbo
|
||||
http://code.alibabatech.com/schema/dubbo/dubbo.xsd ">
|
||||
|
||||
<bean id="cmsService"
|
||||
class="project.cms.internal.CmsServiceImpl" >
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="redisHandler" ref="redisHandler" />
|
||||
<!-- <property name="pagedDao" ref="pagedDao" /> -->
|
||||
</bean>
|
||||
<bean id="adminCmsService"
|
||||
class="project.cms.internal.AdminCmsServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedDao" ref="pagedDao" />
|
||||
<property name="cmsService" ref="cmsService" />
|
||||
<property name="redisHandler" ref="redisHandler" />
|
||||
</bean>
|
||||
|
||||
<!-- <bean id="bannerService"
|
||||
class="project.cms.internal.BannerServiceImpl" >
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="redisHandler" ref="redisHandler" />
|
||||
</bean> -->
|
||||
<bean id="adminBannerService"
|
||||
class="project.cms.internal.AdminBannerServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedDao" ref="pagedDao" />
|
||||
</bean>
|
||||
|
||||
<dubbo:reference id="bannerService"
|
||||
interface="project.cms.BannerService" check="false" retries="0" timeout="10000" />
|
||||
|
||||
</beans>
|
||||
62
admin/src/main/resources/spring/applicationContext-contract_admin.xml
Executable file
62
admin/src/main/resources/spring/applicationContext-contract_admin.xml
Executable file
@@ -0,0 +1,62 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://code.alibabatech.com/schema/dubbo
|
||||
http://code.alibabatech.com/schema/dubbo/dubbo.xsd ">
|
||||
|
||||
<bean id="adminContractOrderService"
|
||||
class="project.contract.internal.AdminContractOrderServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
<property name="userRecomService" ref="userRecomService" />
|
||||
</bean>
|
||||
|
||||
<bean id="adminContractApplyOrderService"
|
||||
class="project.contract.internal.AdminContractApplyOrderServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
<property name="userRecomService" ref="userRecomService" />
|
||||
|
||||
</bean>
|
||||
|
||||
<bean id="adminMarketQuotationsService"
|
||||
class="project.contract.internal.AdminMarketQuotationsServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="adminItemService" ref="adminItemService" />
|
||||
<property name="adjustmentValueService" ref="adjustmentValueService" />
|
||||
<property name="dataService" ref="dataService" />
|
||||
</bean>
|
||||
|
||||
<bean id="contractOrderService"
|
||||
class="project.contract.internal.ContractOrderServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
<property name="walletService" ref="walletService" />
|
||||
<property name="userDataService" ref="userDataService" />
|
||||
<property name="contractApplyOrderService" ref="contractApplyOrderService" />
|
||||
<property name="itemService" ref="itemService" />
|
||||
<property name="moneyLogService" ref="moneyLogService" />
|
||||
<property name="redisHandler" ref="redisHandler" />
|
||||
<property name="traderService" ref="traderService" />
|
||||
<property name="traderFollowUserOrderService" ref="traderFollowUserOrderService" />
|
||||
<property name="partyService" ref="partyService" />
|
||||
<property name="tipService" ref="tipService" />
|
||||
<property name="assetService" ref="assetService" />
|
||||
</bean>
|
||||
|
||||
<bean id="contractApplyOrderService"
|
||||
class="project.contract.internal.ContractApplyOrderServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
<property name="walletService" ref="walletService" />
|
||||
<property name="partyService" ref="partyService" />
|
||||
<property name="sysparaService" ref="sysparaService" />
|
||||
<property name="itemService" ref="itemService" />
|
||||
<property name="moneyLogService" ref="moneyLogService" />
|
||||
<property name="contractOrderService" ref="contractOrderService" />
|
||||
</bean>
|
||||
|
||||
</beans>
|
||||
49
admin/src/main/resources/spring/applicationContext-ddos_admin.xml
Executable file
49
admin/src/main/resources/spring/applicationContext-ddos_admin.xml
Executable file
@@ -0,0 +1,49 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://code.alibabatech.com/schema/dubbo
|
||||
http://code.alibabatech.com/schema/dubbo/dubbo.xsd ">
|
||||
|
||||
<dubbo:reference id="checkIpRequestCountService"
|
||||
interface="project.ddos.CheckIpRequestCountService" check="false" retries="0" timeout="10000" />
|
||||
<dubbo:reference id="ipMenuService"
|
||||
interface="project.ddos.IpMenuService" check="false" retries="0" timeout="10000" />
|
||||
<dubbo:reference id="urlSpecialService"
|
||||
interface="project.ddos.UrlSpecialService" check="false" retries="0" timeout="10000" />
|
||||
|
||||
<bean id="adminIpMenuService" class="project.ddos.internal.AdminIpMenuServiceImpl" >
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
<property name="secUserService" ref="secUserService" />
|
||||
<property name="logService" ref="logService" />
|
||||
<property name="sysparaService" ref="sysparaService" />
|
||||
<property name="ipMenuService" ref="ipMenuService" />
|
||||
<property name="passwordEncoder" ref="passwordEncoder" />
|
||||
<property name="checkIpRequestCountService" ref="checkIpRequestCountService" />
|
||||
<property name="redisHandler" ref="redisHandler" />
|
||||
</bean>
|
||||
<bean id="adminUrlSpecialService" class="project.ddos.internal.AdminUrlSpecialServiceImpl" >
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
<property name="secUserService" ref="secUserService" />
|
||||
<property name="logService" ref="logService" />
|
||||
<property name="sysparaService" ref="sysparaService" />
|
||||
<property name="urlSpecialService" ref="urlSpecialService" />
|
||||
<property name="passwordEncoder" ref="passwordEncoder" />
|
||||
</bean>
|
||||
<bean id="adminIpCountService" class="project.ddos.internal.AdminIpCountServiceImpl" >
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="secUserService" ref="secUserService" />
|
||||
<property name="logService" ref="logService" />
|
||||
<property name="sysparaService" ref="sysparaService" />
|
||||
<property name="ipMenuService" ref="ipMenuService" />
|
||||
<property name="checkIpRequestCountService" ref="checkIpRequestCountService" />
|
||||
<property name="passwordEncoder" ref="passwordEncoder" />
|
||||
<property name="redisHandler" ref="redisHandler" />
|
||||
<property name="jdbcTemplate" ref="jdbcTemplate" />
|
||||
</bean>
|
||||
|
||||
</beans>
|
||||
78
admin/src/main/resources/spring/applicationContext-dubbo.xml
Executable file
78
admin/src/main/resources/spring/applicationContext-dubbo.xml
Executable file
@@ -0,0 +1,78 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://code.alibabatech.com/schema/dubbo
|
||||
http://code.alibabatech.com/schema/dubbo/dubbo.xsd
|
||||
">
|
||||
<!-- 提供方应用信息,用于计算依赖关系 -->
|
||||
<dubbo:application name="${dubbo.application.name}">
|
||||
<dubbo:parameter key="qos.enable" value="false"/>
|
||||
<dubbo:parameter key="qos.accept.foreign.ip" value="false"/>
|
||||
</dubbo:application>
|
||||
<!-- 使用zkp注册中心暴露服务地址 -->
|
||||
<!-- 使用zookeeper注册中心暴露服务地址 -->
|
||||
<dubbo:registry protocol="${dubbo.registry.protocol}"
|
||||
address="${dubbo.registry.address}"/>
|
||||
<dubbo:protocol host="127.0.0.1" payload="50331648"/>
|
||||
<!-- <dubbo:reference id="userRecomService"
|
||||
interface="project.party.recom.UserRecomService" check="false" /> admin本地注入
|
||||
<dubbo:reference id="partyService"
|
||||
interface="project.party.PartyService" check="false" /> admin本地注入
|
||||
<dubbo:reference id="userDataService"
|
||||
interface="project.user.UserDataService" check="false" /> data注册
|
||||
<dubbo:reference id="dataService"
|
||||
interface="project.data.DataService" check="false" /> data注册
|
||||
<dubbo:reference id="klineService"
|
||||
interface="project.data.KlineService" check="false" /> 没被调用
|
||||
<dubbo:reference id="rechargeService"
|
||||
interface="project.recharge.RechargeService" check="false" />
|
||||
<dubbo:reference id="qRProducerService"
|
||||
interface="project.blockchain.QRProducerService" check="false" /> admin本地注入
|
||||
<dubbo:reference id="rechargeBonusService"
|
||||
interface="project.bonus.RechargeBonusService" check="false" /> admin本地注入
|
||||
<dubbo:reference id="qRGenerateService"
|
||||
interface="project.user.QRGenerateService" check="false" /> admin本地注入-->
|
||||
<!-- q -->
|
||||
<dubbo:reference id="rechargeService"
|
||||
interface="project.recharge.RechargeService" check="false" retries="0" timeout="10000"/>
|
||||
<!-- q -->
|
||||
<dubbo:reference id="userDataService"
|
||||
interface="project.user.UserDataService" check="false" retries="0" timeout="10000"/>
|
||||
<dubbo:reference id="logService"
|
||||
interface="project.log.LogService" check="false" retries="0" timeout="10000"/>
|
||||
<dubbo:reference id="codeLogService"
|
||||
interface="project.log.CodeLogService" check="false" retries="0" timeout="10000"/>
|
||||
<dubbo:reference id="sysLogService"
|
||||
interface="project.log.SysLogService" check="false" retries="0" timeout="10000"/>
|
||||
<dubbo:reference id="adjustmentValueService"
|
||||
interface="project.data.AdjustmentValueService" check="false" retries="0" timeout="10000"/>
|
||||
<dubbo:reference id="onlineChatMessageService"
|
||||
interface="project.onlinechat.OnlineChatMessageService" check="false" retries="0" timeout="10000"/>
|
||||
<dubbo:reference id="onlineChatVisitorMessageService"
|
||||
interface="project.onlinechat.OnlineChatVisitorMessageService" check="false" retries="0"
|
||||
timeout="10000"/>
|
||||
<dubbo:reference id="onlineChatUserMessageService"
|
||||
interface="project.onlinechat.OnlineChatUserMessageService" check="false" retries="0"
|
||||
timeout="10000"/>
|
||||
<!--<dubbo:reference id="otcOnlineChatMessageService"
|
||||
interface="project.onlinechat.otc.OtcOnlineChatMessageService" check="false" retries="0" timeout="10000" />-->
|
||||
<dubbo:reference id="traderService"
|
||||
interface="project.follow.TraderService" check="false" retries="0" timeout="10000"/>
|
||||
<dubbo:reference id="traderOrderService"
|
||||
interface="project.follow.TraderOrderService" check="false" retries="0" timeout="10000"/>
|
||||
<dubbo:reference id="traderFollowUserService"
|
||||
interface="project.follow.TraderFollowUserService" check="false" retries="0" timeout="10000"/>
|
||||
<dubbo:reference id="traderFollowUserOrderService"
|
||||
interface="project.follow.TraderFollowUserOrderService" check="false" retries="0" timeout="10000"/>
|
||||
<dubbo:reference id="traderUserService"
|
||||
interface="project.follow.TraderUserService" check="false" retries="0" timeout="10000"/>
|
||||
<dubbo:reference id="futuresOrderService"
|
||||
interface="project.futures.FuturesOrderService" check="false" retries="0" timeout="10000"/>
|
||||
<dubbo:reference id="minerOrderProfitService"
|
||||
interface="project.miner.job.MinerOrderProfitService" retries="0" check="false" timeout="120000"/>
|
||||
<dubbo:reference id="sellerGoodsService"
|
||||
interface="project.mall.goods.SellerGoodsService" retries="0" check="false" timeout="120000"/>
|
||||
</beans>
|
||||
32
admin/src/main/resources/spring/applicationContext-exchange_admin.xml
Executable file
32
admin/src/main/resources/spring/applicationContext-exchange_admin.xml
Executable file
@@ -0,0 +1,32 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://code.alibabatech.com/schema/dubbo
|
||||
http://code.alibabatech.com/schema/dubbo/dubbo.xsd ">
|
||||
|
||||
<bean id="adminExchangeApplyOrderService"
|
||||
class="project.exchange.internal.AdminExchangeApplyOrderServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
<property name="userRecomService" ref="userRecomService" />
|
||||
</bean>
|
||||
|
||||
<bean id="exchangeApplyOrderService"
|
||||
class="project.exchange.internal.ExchangeApplyOrderServiceImpl" >
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
<property name="sysparaService" ref="sysparaService" />
|
||||
<property name="partyService" ref="partyService" />
|
||||
<property name="itemService" ref="itemService" />
|
||||
<property name="moneyLogService" ref="moneyLogService" />
|
||||
<property name="walletService" ref="walletService" />
|
||||
<property name="userDataService" ref="userDataService" />
|
||||
<property name="dataService" ref="dataService" />
|
||||
</bean>
|
||||
<dubbo:reference id="exchangeApplyOrderHandleJobService"
|
||||
interface="project.exchange.job.ExchangeApplyOrderHandleJobService" check="false" retries="0" timeout="10000" />
|
||||
|
||||
</beans>
|
||||
56
admin/src/main/resources/spring/applicationContext-finance_admin.xml
Executable file
56
admin/src/main/resources/spring/applicationContext-finance_admin.xml
Executable file
@@ -0,0 +1,56 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://code.alibabatech.com/schema/dubbo
|
||||
http://code.alibabatech.com/schema/dubbo/dubbo.xsd ">
|
||||
|
||||
<bean id="financeService"
|
||||
class="project.finance.internal.FinanceServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="redisHandler" ref="redisHandler" />
|
||||
<property name="secUserService" ref="secUserService" />
|
||||
<property name="passwordEncoder" ref="passwordEncoder" />
|
||||
|
||||
</bean>
|
||||
|
||||
<bean id="financeOrderService"
|
||||
class="project.finance.internal.FinanceOrderServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="walletService" ref="walletService" />
|
||||
<property name="moneyLogService" ref="moneyLogService" />
|
||||
<property name="financeService" ref="financeService" />
|
||||
<property name="pagedDao" ref="pagedDao" />
|
||||
<property name="userDataService" ref="userDataService" />
|
||||
<property name="partyService" ref="partyService" />
|
||||
<property name="sysparaService" ref="sysparaService" />
|
||||
<property name="userRecomService" ref="userRecomService" />
|
||||
|
||||
</bean>
|
||||
|
||||
<bean id="adminFinanceService"
|
||||
class="project.finance.internal.AdminFinanceServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
</bean>
|
||||
|
||||
|
||||
<bean id="adminFinanceOrderService"
|
||||
class="project.finance.internal.AdminFinanceOrderServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
<property name="userRecomService" ref="userRecomService" />
|
||||
</bean>
|
||||
|
||||
|
||||
<bean id="financeOrder1DayJob" class="project.finance.job.FinanceOrder1DayJob">
|
||||
<property name="financeOrderService" ref="financeOrderService" />
|
||||
<property name="sysLogService" ref="sysLogService" />
|
||||
</bean>
|
||||
|
||||
|
||||
|
||||
|
||||
</beans>
|
||||
79
admin/src/main/resources/spring/applicationContext-futures_admin.xml
Executable file
79
admin/src/main/resources/spring/applicationContext-futures_admin.xml
Executable file
@@ -0,0 +1,79 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://code.alibabatech.com/schema/dubbo
|
||||
http://code.alibabatech.com/schema/dubbo/dubbo.xsd ">
|
||||
|
||||
<bean id="futuresParaService"
|
||||
class="project.futures.internal.FuturesParaServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="redisHandler" ref="redisHandler" />
|
||||
</bean>
|
||||
|
||||
<!-- <bean id="futuresOrderService"
|
||||
class="project.futures.internal.FuturesOrderServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
<property name="walletService" ref="walletService" />
|
||||
<property name="userDataService" ref="userDataService" />
|
||||
<property name="itemService" ref="itemService" />
|
||||
<property name="moneyLogService" ref="moneyLogService" />
|
||||
<property name="futuresParaService" ref="futuresParaService" />
|
||||
<property name="partyService" ref="partyService" />
|
||||
<property name="dataService" ref="dataService" />
|
||||
<property name="profitAndLossConfigService" ref="profitAndLossConfigService" />
|
||||
<property name="redisHandler" ref="redisHandler" />
|
||||
<property name="tipService" ref="tipService" />
|
||||
<property name="userRecomService" ref="userRecomService" />
|
||||
<property name="sysparaService" ref="sysparaService" />
|
||||
<property name="logService" ref="logService" />
|
||||
</bean> -->
|
||||
|
||||
<bean id="profitAndLossConfigService"
|
||||
class="project.futures.internal.ProfitAndLossConfigServiceImpl" >
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="redisHandler" ref="redisHandler" />
|
||||
<property name="logService" ref="logService" />
|
||||
<property name="partyService" ref="partyService" />
|
||||
</bean>
|
||||
|
||||
<bean id="adminFuturesOrderService"
|
||||
class="project.futures.internal.AdminFuturesOrderServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
<property name="userRecomService" ref="userRecomService" />
|
||||
<property name="futuresOrderService" ref="futuresOrderService" />
|
||||
</bean>
|
||||
|
||||
<bean id="adminFuturesParaService"
|
||||
class="project.futures.internal.AdminFuturesParaImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
<property name="futuresParaService" ref="futuresParaService" />
|
||||
</bean>
|
||||
|
||||
<bean id="adminContractManageService"
|
||||
class="project.futures.internal.AdminContractManageServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
<property name="jdbcTemplate" ref="jdbcTemplate" />
|
||||
<property name="adminItemService" ref="adminItemService" />
|
||||
<property name="adminFuturesParaService" ref="adminFuturesParaService" />
|
||||
<property name="secUserService" ref="secUserService" />
|
||||
<property name="logService" ref="logService" />
|
||||
<property name="passwordEncoder" ref="passwordEncoder" />
|
||||
<property name="sysparaService" ref="sysparaService" />
|
||||
<property name="googleAuthService" ref="googleAuthService" />
|
||||
</bean>
|
||||
|
||||
<bean id="adminProfitAndLossConfigService"
|
||||
class="project.futures.internal.AdminProfitAndLossConfigServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
<property name="userRecomService" ref="userRecomService" />
|
||||
</bean>
|
||||
|
||||
</beans>
|
||||
41
admin/src/main/resources/spring/applicationContext-hobi_admin.xml
Executable file
41
admin/src/main/resources/spring/applicationContext-hobi_admin.xml
Executable file
@@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://code.alibabatech.com/schema/dubbo
|
||||
http://code.alibabatech.com/schema/dubbo/dubbo.xsd ">
|
||||
|
||||
|
||||
<dubbo:reference id="hobiDataService"
|
||||
interface="project.hobi.HobiDataService" check="false" />
|
||||
<dubbo:reference id="remoteDataService"
|
||||
interface="project.data.DataService" check="false" />
|
||||
<dubbo:reference id="klineInitService"
|
||||
interface="project.data.internal.KlineInitService" check="false" />
|
||||
|
||||
<bean id="dataService"
|
||||
class="project.data.internal.DataServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="remoteDataService" ref="remoteDataService" />
|
||||
<property name="sysparaService" ref="sysparaService" />
|
||||
</bean>
|
||||
|
||||
<bean id="adminSymbolsService"
|
||||
class="project.hobi.internal.AdminSymbolsServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
<property name="hobiDataService" ref="hobiDataService" />
|
||||
</bean>
|
||||
<bean id="adminContractSymbolsService"
|
||||
class="project.hobi.internal.AdminContractSymbolsServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
<property name="hobiDataService" ref="hobiDataService" />
|
||||
<property name="jdbcTemplate" ref="jdbcTemplate" />
|
||||
</bean>
|
||||
|
||||
|
||||
|
||||
</beans>
|
||||
105
admin/src/main/resources/spring/applicationContext-invest_admin.xml
Executable file
105
admin/src/main/resources/spring/applicationContext-invest_admin.xml
Executable file
@@ -0,0 +1,105 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://code.alibabatech.com/schema/dubbo
|
||||
http://code.alibabatech.com/schema/dubbo/dubbo.xsd ">
|
||||
|
||||
<bean id="platformService"
|
||||
class="project.invest.platform.impl.PlatformServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
</bean>
|
||||
|
||||
<bean id="adminExpertService"
|
||||
class="project.invest.expert.impl.AdminExpertServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
</bean>
|
||||
|
||||
<bean id="adminGoodsService"
|
||||
class="project.invest.goods.impl.AdminGoodsServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
<property name="redisHandler" ref="redisHandler" />
|
||||
</bean>
|
||||
|
||||
<bean id="adminGoodsBuyService"
|
||||
class="project.invest.goods.impl.AdminGoodsBuyServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
</bean>
|
||||
|
||||
<bean id="adminOrderService"
|
||||
class="project.invest.order.impl.AdminOrderServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
<property name="walletService" ref="walletService" />
|
||||
<property name="moneyLogService" ref="moneyLogService" />
|
||||
</bean>
|
||||
|
||||
<bean id="adminExchangeOrderService"
|
||||
class="project.invest.order.impl.AdminExchangeOrderServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
<property name="walletService" ref="walletService" />
|
||||
<property name="moneyLogService" ref="moneyLogService" />
|
||||
<property name="namedParameterJdbcTemplate" ref="namedParameterJdbcTemplate" />
|
||||
<property name="passwordEncoder" ref="passwordEncoder" />
|
||||
<property name="secUserService" ref="secUserService" />
|
||||
<property name="tipService" ref="tipService" />
|
||||
<property name="logService" ref="logService" />
|
||||
</bean>
|
||||
|
||||
|
||||
|
||||
<bean id="adminProjectService"
|
||||
class="project.invest.project.impl.AdminProjectServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
<property name="redisHandler" ref="redisHandler" />
|
||||
<property name="jdbcTemplate" ref="jdbcTemplate" />
|
||||
</bean>
|
||||
|
||||
|
||||
|
||||
<!-- <bean id="adminBrushOrderService"-->
|
||||
<!-- class="project.invest.orders.impl.AdminBrushOrderServiceImpl">-->
|
||||
<!-- <property name="hibernateTemplate" ref="hibernateTemplate" />-->
|
||||
<!-- <property name="pagedQueryDao" ref="pagedDao" />-->
|
||||
<!-- <property name="tipService" ref="tipService" />-->
|
||||
<!-- </bean>-->
|
||||
|
||||
<!-- <bean id="brushOrdersService" class="project.invest.orders.internal.BrushOrdersServiceImpl">-->
|
||||
<!-- <property name="hibernateTemplate" ref="hibernateTemplate" />-->
|
||||
<!-- <property name="redisHandler" ref="redisHandler" />-->
|
||||
<!-- <property name="sysparaService" ref="sysparaService" />-->
|
||||
<!-- <property name="walletService" ref="walletService" />-->
|
||||
<!-- <property name="moneyLogService" ref="moneyLogService" />-->
|
||||
<!-- <property name="partyService" ref="partyService" />-->
|
||||
<!-- </bean>-->
|
||||
|
||||
<bean id="adminVipService"
|
||||
class="project.invest.vip.impl.AdminVipServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
</bean>
|
||||
|
||||
<bean id="walletDayService"
|
||||
class="project.invest.walletday.impl.WalletDayServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
</bean>
|
||||
|
||||
<bean id="vipService" class="project.invest.vip.internal.VipServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="jdbcTemplate" ref="jdbcTemplate"/>
|
||||
<property name="walletService" ref="walletService"/>
|
||||
<property name="moneyLogService" ref="moneyLogService"/>
|
||||
<property name="partyService" ref="partyService"/>
|
||||
<property name="userDataService" ref="userDataService" />
|
||||
</bean>
|
||||
|
||||
</beans>
|
||||
37
admin/src/main/resources/spring/applicationContext-item_admin.xml
Executable file
37
admin/src/main/resources/spring/applicationContext-item_admin.xml
Executable file
@@ -0,0 +1,37 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://code.alibabatech.com/schema/dubbo
|
||||
http://code.alibabatech.com/schema/dubbo/dubbo.xsd ">
|
||||
<bean id="itemService"
|
||||
class="project.item.internal.ItemServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="redisHandler" ref="redisHandler" />
|
||||
<property name="redisLocalCache" ref="redisLocalCache" />
|
||||
</bean>
|
||||
<bean id="itemUserOptionalService"
|
||||
class="project.item.internal.ItemUserOptionalServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="redisHandler" ref="redisHandler" />
|
||||
<property name="dataService" ref="dataService" />
|
||||
</bean>
|
||||
<bean id="adminItemService"
|
||||
class="project.item.internal.AdminItemServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
<property name="itemService" ref="itemService" />
|
||||
<!-- <property name="klineService" ref="klineService" /> -->
|
||||
</bean>
|
||||
|
||||
<bean id="adminItemLeverageService"
|
||||
class="project.item.internal.AdminItemLeverageServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
|
||||
<property name="redisHandler" ref="redisHandler" />
|
||||
</bean>
|
||||
|
||||
</beans>
|
||||
46
admin/src/main/resources/spring/applicationContext-kernel.xml
Executable file
46
admin/src/main/resources/spring/applicationContext-kernel.xml
Executable file
@@ -0,0 +1,46 @@
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:context="http://www.springframework.org/schema/context"
|
||||
xmlns:mvc="http://www.springframework.org/schema/mvc"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
http://www.springframework.org/schema/beans/spring-beans-4.1.xsd
|
||||
http://www.springframework.org/schema/context
|
||||
http://www.springframework.org/schema/context/spring-context-4.1.xsd
|
||||
http://www.springframework.org/schema/mvc
|
||||
http://www.springframework.org/schema/mvc/spring-mvc-4.1.xsd">
|
||||
|
||||
|
||||
<bean id="pagedDao" class="kernel.web.PagedQueryDaoImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="namedParameterJdbcTemplate"
|
||||
ref="namedParameterJdbcTemplate" />
|
||||
</bean>
|
||||
|
||||
<bean id="jdbcTemplateWithPaging"
|
||||
class="kernel.web.JdbcTemplateWithPaging">
|
||||
<property name="jdbcTemplate" ref="jdbcTemplate" />
|
||||
</bean>
|
||||
|
||||
<bean id="redisLocalCache" class="kernel.cache.RedisLocalCache">
|
||||
<property name="redisHandler" ref="redisHandler" />
|
||||
</bean>
|
||||
|
||||
<bean id="twoDimensionCodeContentService"
|
||||
class="kernel.service.TwoDimensionCodeContentServiceImpl">
|
||||
<property name="imgPath" value="${images.dir}" />
|
||||
</bean>
|
||||
|
||||
<!--转移系统所需的配置环境,不依赖数据库 -->
|
||||
<bean id="messageSource"
|
||||
class="org.springframework.context.support.ResourceBundleMessageSource">
|
||||
<property name="basenames">
|
||||
<list>
|
||||
<value>/config/system</value>
|
||||
</list>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="transactionMethodFragmentFun"
|
||||
class="kernel.service.TransactionMethodFragmentFun">
|
||||
</bean>
|
||||
</beans>
|
||||
17
admin/src/main/resources/spring/applicationContext-log.xml
Executable file
17
admin/src/main/resources/spring/applicationContext-log.xml
Executable file
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
http://www.springframework.org/schema/beans/spring-beans.xsd" >
|
||||
|
||||
<bean id="moneyLogService" class="project.log.internal.MoneyLogServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedDao" ref="pagedDao" />
|
||||
</bean>
|
||||
|
||||
<bean id="orderLogService" class="project.mall.log.impl.OrderLogServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
</bean>
|
||||
|
||||
</beans>
|
||||
55
admin/src/main/resources/spring/applicationContext-lottery.xml
Executable file
55
admin/src/main/resources/spring/applicationContext-lottery.xml
Executable file
@@ -0,0 +1,55 @@
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
http://www.springframework.org/schema/beans/spring-beans-4.1.xsd">
|
||||
|
||||
<!--
|
||||
<bean id="lotteryService" class="project.mall.activity.service.impl.lottery.LotteryServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate"/>
|
||||
<property name="lotteryInfoPrizeService" ref="lotteryInfoPrizeService"/>
|
||||
<property name="lotteryPrizeService" ref="lotteryPrizeService"/>
|
||||
</bean>-->
|
||||
|
||||
<bean id="activityUserPointsService" class="project.mall.activity.service.impl.ActivityUserPointsServiceImpl" >
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate"/>
|
||||
<property name="jdbcTemplate" ref="jdbcTemplate" />
|
||||
</bean>
|
||||
<bean id="activityUserPointsLogService" class="project.mall.activity.service.impl.ActivityUserPointsLogServiceImpl" >
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate"/>
|
||||
<property name="jdbcTemplate" ref="jdbcTemplate" />
|
||||
</bean>
|
||||
|
||||
<!--
|
||||
<bean id="lotteryPrizeService" class="project.mall.activity.service.impl.lottery.LotteryPrizeServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate"/>
|
||||
<property name="lotteryInfoPrizeService" ref="lotteryInfoPrizeService"/>
|
||||
<property name="redisHandler" ref="redisHandler" />
|
||||
<property name="lotteryRecordService" ref="lotteryRecordService"/>
|
||||
<property name="lotteryService" ref="lotteryService" />
|
||||
<property name="activityUserPointsService" ref="activityUserPointsService"/>
|
||||
</bean>-->
|
||||
|
||||
<bean id="lotteryReceiveService" class="project.mall.activity.service.impl.lottery.LotteryReceiveServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate"/>
|
||||
<property name="jdbcTemplate" ref="jdbcTemplate"/>
|
||||
<property name="walletService" ref="walletService"/>
|
||||
<property name="walletLogService" ref="walletLogService"/>
|
||||
<property name="partyService" ref="partyService"/>
|
||||
<property name="moneyLogService" ref="moneyLogService"/>
|
||||
</bean>
|
||||
|
||||
<bean id="lotteryRecordService" class="project.mall.activity.service.impl.lottery.LotteryRecordServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate"/>
|
||||
<property name="activityPrizeService" ref="activityPrizeService"/>
|
||||
<!--<property name="lotteryPrizeService" ref="lotteryPrizeService"/>-->
|
||||
<property name="jdbcTemplate" ref="jdbcTemplate"/>
|
||||
<property name="lotteryReceiveService" ref="lotteryReceiveService" />
|
||||
<property name="tipService" ref="tipService" />
|
||||
</bean>
|
||||
|
||||
<!--
|
||||
<bean id="lotteryInfoPrizeService" class="project.mall.activity.service.impl.lottery.LotteryInfoPrizeServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate"/>
|
||||
</bean>-->
|
||||
|
||||
</beans>
|
||||
252
admin/src/main/resources/spring/applicationContext-mall_admin.xml
Executable file
252
admin/src/main/resources/spring/applicationContext-mall_admin.xml
Executable file
@@ -0,0 +1,252 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://code.alibabatech.com/schema/dubbo
|
||||
http://code.alibabatech.com/schema/dubbo/dubbo.xsd ">
|
||||
|
||||
<bean id="adminMallBannerService"
|
||||
class="project.mall.banner.impl.AdminMallBannerServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
</bean>
|
||||
|
||||
<bean id="adminCategoryService"
|
||||
class="project.mall.type.impl.AdminCategoryServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
<property name="redisHandler" ref="redisHandler" />
|
||||
<property name="jdbcTemplate" ref="jdbcTemplate" />
|
||||
</bean>
|
||||
<bean id="categoryLangService"
|
||||
class="project.mall.type.impl.CategoryLangServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
</bean>
|
||||
|
||||
<bean id="adminComboService"
|
||||
class="project.mall.combo.impl.AdminComboServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
<property name="redisHandler" ref="redisHandler" />
|
||||
</bean>
|
||||
<bean id="adminSubscribeService"
|
||||
class="project.mall.subscribe.impl.AdminSubscribeServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
</bean>
|
||||
<bean id="adminMallGoodsService"
|
||||
class="project.mall.goods.impl.AdminMallGoodsServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="redisHandler" ref="redisHandler" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
<property name="jdbcTemplate" ref="jdbcTemplate" />
|
||||
<property name="goodsAttributeService" ref="goodsAttributeService" />
|
||||
<property name="sellerGoodsService" ref="sellerGoodsService"/>
|
||||
<property name="categoryLangService" ref="categoryLangService"/>
|
||||
<property name="userRecomService" ref="userRecomService" />
|
||||
</bean>
|
||||
<bean id="goodsAttributeCategoryService"
|
||||
class="project.mall.goods.impl.GoodsAttributeCategoryServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="jdbcTemplate" ref="jdbcTemplate" />
|
||||
</bean>
|
||||
<bean id="goodsAttributeService"
|
||||
class="project.mall.goods.impl.GoodsAttributeServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="jdbcTemplate" ref="jdbcTemplate" />
|
||||
</bean>
|
||||
|
||||
<bean id="adminSystemCommentService"
|
||||
class="project.mall.comment.impl.AdminSystemCommentServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
</bean>
|
||||
|
||||
<bean id="adminMallOrderService"
|
||||
class="project.mall.orders.impl.AdminMallOrderServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
<property name="userDataService" ref="userDataService" />
|
||||
<property name="walletService" ref="walletService" />
|
||||
<property name="moneyLogService" ref="moneyLogService" />
|
||||
<property name="secUserService" ref="secUserService" />
|
||||
<property name="partyService" ref="partyService" />
|
||||
<property name="logService" ref="logService" />
|
||||
<property name="orderLogService" ref="orderLogService" />
|
||||
<property name="userRecomService" ref="userRecomService" />
|
||||
<property name="adminSellerService" ref="adminSellerService" />
|
||||
<property name="sysParaService" ref="sysparaService"/>
|
||||
</bean>
|
||||
|
||||
<bean id="goodsSkuAtrributionService"
|
||||
class="project.mall.goods.internal.GoodsSkuAtrributionServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="jdbcTemplate" ref="jdbcTemplate" />
|
||||
</bean>
|
||||
<bean id="adminSellerService"
|
||||
class="project.mall.seller.impl.AdminSellerServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
<property name="redisHandler" ref="redisHandler" />
|
||||
<property name="secUserService" ref="secUserService" />
|
||||
<property name="userRecomService" ref="userRecomService" />
|
||||
<property name="jdbcTemplate" ref="jdbcTemplate"/>
|
||||
<property name="kycService" ref="kycService"/>
|
||||
<property name="mallLevelService" ref="mallLevelService"/>
|
||||
<property name="sellerService" ref="sellerService"/>
|
||||
<property name="userMetricsService" ref="userMetricsService"/>
|
||||
<property name="logService" ref="logService" />
|
||||
<property name="walletService" ref="walletService" />
|
||||
<property name="moneyLogService" ref="moneyLogService" />
|
||||
<property name="tipService" ref="tipService" />
|
||||
</bean>
|
||||
<bean id="adminMallLoanConfigService"
|
||||
class="project.mall.loan.impl.AdminMallLoanConfigServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
</bean>
|
||||
|
||||
<bean id="focusSellerService" class="project.mall.seller.impl.FocusSellerServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
</bean>
|
||||
<bean id="adminMallCountryService"
|
||||
class="project.mall.area.impl.AdminMallCountryServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
</bean>
|
||||
<bean id="adminMallStateService"
|
||||
class="project.mall.area.impl.AdminMallStateServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
</bean>
|
||||
<bean id="adminMallCityService"
|
||||
class="project.mall.area.impl.AdminMallCityServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
</bean>
|
||||
<!-- <bean id="sellerGoodsService" class="project.mall.goods.impl.SellerGoodsServiceImpl">-->
|
||||
<!-- <property name="hibernateTemplate" ref="hibernateTemplate" />-->
|
||||
<!-- <property name="jdbcTemplate" ref="jdbcTemplate" />-->
|
||||
<!-- <property name="redisHandler" ref="redisHandler" />-->
|
||||
<!-- </bean>-->
|
||||
<bean id="evaluationService" class="project.mall.evaluation.impl.EvaluationServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="partyService" ref="partyService" />
|
||||
<property name="goodsOrdersService" ref="goodsOrdersService" />
|
||||
<property name="jdbcTemplate" ref="jdbcTemplate"/>
|
||||
</bean>
|
||||
<bean id="comboService" class="project.mall.combo.impl.ComboServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="walletService" ref="walletService"/>
|
||||
<property name="moneyLogService" ref="moneyLogService"/>
|
||||
<property name="redisHandler" ref="redisHandler" />
|
||||
</bean>
|
||||
<bean id="mallAddressAreaService" class="project.mall.area.impl.MallAddressAreaServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="redisHandler" ref="redisHandler" />
|
||||
<property name="jdbcTemplate" ref="jdbcTemplate"/>
|
||||
</bean>
|
||||
|
||||
<bean id="goodsOrdersService" class="project.mall.orders.internal.GoodsOrdersServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="walletService" ref="walletService"/>
|
||||
<property name="moneyLogService" ref="moneyLogService"/>
|
||||
<property name="partyService" ref="partyService"/>
|
||||
<property name="userDataService" ref="userDataService" />
|
||||
<property name="redisHandler" ref="redisHandler" />
|
||||
<property name="sysparaService" ref="sysparaService"/>
|
||||
<property name="adminSellerService" ref="adminSellerService" />
|
||||
<property name="orderLogService" ref="orderLogService" />
|
||||
<property name="jdbcTemplate" ref="jdbcTemplate" />
|
||||
<property name="sellerGoodsService" ref="sellerGoodsService" />
|
||||
<property name="comboService" ref="comboService" />
|
||||
<property name="evaluationService" ref="evaluationService" />
|
||||
<property name="commonNotifyService" ref="commonNotifyService"/>
|
||||
<property name="notificationHelperClient" ref="notificationHelperClient"/>
|
||||
<property name="mallAddressAreaService" ref="mallAddressAreaService"/>
|
||||
<property name="goodsSkuAtrributionService" ref="goodsSkuAtrributionService"/>
|
||||
<property name="mallLevelService" ref="mallLevelService" />
|
||||
</bean>
|
||||
|
||||
<dubbo:reference id="commonNotifyService"
|
||||
interface="project.mall.notification.utils.notify.client.CommonNotifyService" check="false" retries="0" timeout="3000"/>
|
||||
<dubbo:reference id="notificationHelperClient"
|
||||
interface="project.mall.notification.utils.notify.client.NotificationHelperClient" check="false" retries="0" timeout="3000"/>
|
||||
|
||||
<bean id="sellerService" class="project.mall.seller.impl.SellerServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
<property name="jdbcTemplate" ref="jdbcTemplate" />
|
||||
<property name="walletService" ref="walletService" />
|
||||
<property name="moneyLogService" ref="moneyLogService" />
|
||||
<property name="redisHandler" ref="redisHandler" />
|
||||
<property name="partyService" ref="partyService" />
|
||||
<property name="tipService" ref="tipService" />
|
||||
</bean>
|
||||
<bean id="sellerCreditService"
|
||||
class="project.mall.seller.impl.SellerCreditServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="sellerService" ref="sellerService" />
|
||||
</bean>
|
||||
<bean id="moneyFreezeService" class="project.log.internal.MoneyFreezeServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedDao" ref="pagedDao" />
|
||||
<property name="walletService" ref="walletService" />
|
||||
<property name="moneyLogService" ref="moneyLogService" />
|
||||
<property name="sellerService" ref="sellerService" />
|
||||
<property name="redisHandler" ref="redisHandler" />
|
||||
</bean>
|
||||
<bean id="creditService" class="project.mall.credit.impl.CreditServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="partyService" ref="partyService" />
|
||||
<property name="walletService" ref="walletService" />
|
||||
<property name="jdbcTemplate" ref="jdbcTemplate" />
|
||||
<property name="passwordEncoder" ref="passwordEncoder" />
|
||||
<property name="secUserService" ref="secUserService" />
|
||||
<property name="moneyLogService" ref="moneyLogService" />
|
||||
<property name="tipService" ref="tipService" />
|
||||
</bean>
|
||||
|
||||
<bean id="categoryService" class="project.mall.type.impl.CategoryServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="redisHandler" ref="redisHandler" />
|
||||
</bean>
|
||||
|
||||
<bean id="modifyCategoryStatusEventListener" class="project.mall.event.ModifyCategoryStatusEventListener">
|
||||
<property name="categoryService" ref="categoryService" />
|
||||
</bean>
|
||||
|
||||
<bean id="mallLevelService" class="project.mall.seller.impl.MallLevelServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
</bean>
|
||||
<bean id="fundChangeService" class="project.blockchain.internal.FundChangeService">
|
||||
<property name="walletService" ref="walletService" />
|
||||
<property name="walletLogService" ref="walletLogService" />
|
||||
<property name="userRecomService" ref="userRecomService" />
|
||||
<property name="sellerService" ref="sellerService" />
|
||||
<property name="moneyLogService" ref="moneyLogService" />
|
||||
<property name="partyService" ref="partyService" />
|
||||
</bean>
|
||||
|
||||
<bean id="rechargeSuccessEventListener" class="project.blockchain.event.RechargeSuccessEventListener">
|
||||
<property name="rechargeBlockchainService" ref="rechargeBlockchainService" />
|
||||
<property name="userMetricsService" ref="userMetricsService" />
|
||||
<property name="walletLogService" ref="walletLogService" />
|
||||
</bean>
|
||||
|
||||
<bean id="upgradeSellerLevelByRechargeEventListener" class="project.blockchain.event.UpgradeSellerLevelByRechargeEventListener">
|
||||
<property name="walletLogService" ref="walletLogService" />
|
||||
<property name="sellerService" ref="sellerService" />
|
||||
<property name="partyService" ref="partyService" />
|
||||
<property name="userRecomService" ref="userRecomService" />
|
||||
<property name="mallLevelService" ref="mallLevelService" />
|
||||
<property name="sysparaService" ref="sysparaService" />
|
||||
<property name="fundChangeService" ref="fundChangeService" />
|
||||
<property name="redisHandler" ref="redisHandler" />
|
||||
</bean>
|
||||
|
||||
<bean id="goFunExecuteResultEventListener" class="util.cache.GoFunExecuteResultEventListener">
|
||||
</bean>
|
||||
|
||||
</beans>
|
||||
75
admin/src/main/resources/spring/applicationContext-miner_admin.xml
Executable file
75
admin/src/main/resources/spring/applicationContext-miner_admin.xml
Executable file
@@ -0,0 +1,75 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://code.alibabatech.com/schema/dubbo
|
||||
http://code.alibabatech.com/schema/dubbo/dubbo.xsd ">
|
||||
|
||||
|
||||
<bean id="minerService"
|
||||
class="project.miner.internal.MinerServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="redisHandler" ref="redisHandler" />
|
||||
<property name="sysparaService" ref="sysparaService" />
|
||||
<property name="dataService" ref="dataService" />
|
||||
</bean>
|
||||
|
||||
|
||||
<bean id="minerOrderService"
|
||||
class="project.miner.internal.MinerOrderServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="walletService" ref="walletService" />
|
||||
<property name="moneyLogService" ref="moneyLogService" />
|
||||
<property name="minerService" ref="minerService" />
|
||||
<property name="pagedDao" ref="pagedDao" />
|
||||
<property name="userDataService" ref="userDataService" />
|
||||
<property name="namedParameterJdbcTemplate" ref="namedParameterJdbcTemplate" />
|
||||
<property name="userRecomService" ref="userRecomService" />
|
||||
<property name="sysparaService" ref="sysparaService" />
|
||||
<property name="partyService" ref="partyService" />
|
||||
<property name="logService" ref="logService" />
|
||||
<property name="secUserService" ref="secUserService" />
|
||||
<property name="redisHandler" ref="redisHandler" />
|
||||
<property name="dataService" ref="dataService" />
|
||||
</bean>
|
||||
|
||||
<bean id="adminMinerService"
|
||||
class="project.miner.internal.AdminMinerServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
</bean>
|
||||
|
||||
|
||||
<bean id="adminMinerOrderService"
|
||||
class="project.miner.internal.AdminMinerOrderServiceImpl" >
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
<property name="userRecomService" ref="userRecomService" />
|
||||
<property name="minerOrderService" ref="minerOrderService" />
|
||||
<property name="minerService" ref="minerService" />
|
||||
<property name="partyService" ref="partyService" />
|
||||
|
||||
</bean>
|
||||
|
||||
<bean id="minerParaService"
|
||||
class="project.miner.internal.MinerParaServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
</bean>
|
||||
<bean id="adminMinerParaService"
|
||||
class="project.miner.internal.AdminMinerParaServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
</bean>
|
||||
|
||||
<bean id="minerOrderProfitJob" class="project.miner.job.MinerOrderProfitJob">
|
||||
<property name="minerOrderProfitService" ref="minerOrderProfitService" />
|
||||
<property name="sysparaService" ref="sysparaService" />
|
||||
<property name="dataService" ref="dataService" />
|
||||
<property name="sysLogService" ref="sysLogService" />
|
||||
</bean>
|
||||
|
||||
|
||||
|
||||
</beans>
|
||||
17
admin/src/main/resources/spring/applicationContext-news_admin.xml
Executable file
17
admin/src/main/resources/spring/applicationContext-news_admin.xml
Executable file
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://code.alibabatech.com/schema/dubbo
|
||||
http://code.alibabatech.com/schema/dubbo/dubbo.xsd ">
|
||||
|
||||
<bean id="adminNewsService" class="project.news.internal.AdminNewsServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedDao" ref="pagedDao" />
|
||||
</bean>
|
||||
|
||||
|
||||
|
||||
</beans>
|
||||
19
admin/src/main/resources/spring/applicationContext-notification_admin.xml
Executable file
19
admin/src/main/resources/spring/applicationContext-notification_admin.xml
Executable file
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://code.alibabatech.com/schema/dubbo
|
||||
http://code.alibabatech.com/schema/dubbo/dubbo.xsd ">
|
||||
|
||||
<bean id="notificationService" class="project.mall.notification.impl.NotificationServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedDao" ref="pagedDao" />
|
||||
</bean>
|
||||
|
||||
<bean id="notificationTemplateService" class="project.mall.notification.impl.NotificationTemplateServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
</bean>
|
||||
|
||||
</beans>
|
||||
40
admin/src/main/resources/spring/applicationContext-party.xml
Executable file
40
admin/src/main/resources/spring/applicationContext-party.xml
Executable file
@@ -0,0 +1,40 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://code.alibabatech.com/schema/dubbo
|
||||
http://code.alibabatech.com/schema/dubbo/dubbo.xsd ">
|
||||
|
||||
<bean id="partyService"
|
||||
class="project.party.internal.PartyServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="passwordEncoder" ref="passwordEncoder" />
|
||||
<property name="redisHandler" ref="redisHandler" />
|
||||
<property name="redisLocalCache" ref="redisLocalCache" />
|
||||
<property name="secUserService" ref="secUserService" />
|
||||
<property name="jdbcTemplate" ref="jdbcTemplate"/>
|
||||
</bean>
|
||||
|
||||
|
||||
<bean id="userRecomService"
|
||||
class="project.party.recom.internal.UserRecomServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="redisHandler" ref="redisHandler" />
|
||||
<property name="vipService" ref="vipService"/>
|
||||
</bean>
|
||||
|
||||
|
||||
<bean id="partyLoadCacheService"
|
||||
class="project.data.loadcache.PartyLoadCacheService">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="redisHandler" ref="redisHandler" />
|
||||
</bean>
|
||||
|
||||
<bean id="userMetricsService"
|
||||
class="project.party.internal.UserMetricsServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
</bean>
|
||||
|
||||
</beans>
|
||||
@@ -0,0 +1,80 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://code.alibabatech.com/schema/dubbo
|
||||
http://code.alibabatech.com/schema/dubbo/dubbo.xsd ">
|
||||
|
||||
<bean id="rechargeBlockchainService"
|
||||
class="project.blockchain.internal.RechargeBlockchainServiceImpl">
|
||||
<property name="userDataService" ref="userDataService" />
|
||||
<property name="walletService" ref="walletService" />
|
||||
<property name="moneyLogService" ref="moneyLogService" />
|
||||
<property name="exchangeRateService" ref="exchangeRateService" />
|
||||
<property name="walletLogService" ref="walletLogService" />
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="rechargeBonusService" ref="rechargeBonusService" />
|
||||
<property name="dataService" ref="dataService" />
|
||||
<property name="logService" ref="logService" />
|
||||
<property name="secUserService" ref="secUserService" />
|
||||
<property name="partyService" ref="partyService" />
|
||||
<property name="sysparaService" ref="sysparaService" />
|
||||
<property name="channelBlockchainService" ref="channelBlockchainService" />
|
||||
<property name="tipService" ref="tipService" />
|
||||
<property name="sellerService" ref="sellerService" />
|
||||
<property name="KycService" ref="kycService" />
|
||||
<property name="jdbcTemplate" ref="jdbcTemplate" />
|
||||
<property name="userRecomService" ref="userRecomService" />
|
||||
<property name="hobiDataService" ref="hobiDataService" />
|
||||
</bean>
|
||||
|
||||
<bean id="channelBlockchainService"
|
||||
class="project.blockchain.internal.ChannelBlockchainServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="logService" ref="logService" />
|
||||
<property name="secUserService" ref="secUserService" />
|
||||
<property name="passwordEncoder" ref="passwordEncoder" />
|
||||
<!-- <property name="identifyingCodeService" ref="identifyingCodeService" /> -->
|
||||
<!-- <property name="identifyingCodeTimeWindowService" ref="identifyingCodeTimeWindowService" /> -->
|
||||
<property name="sysparaService" ref="sysparaService" />
|
||||
<!-- <property name="emailSendService" ref="emailSendService" /> -->
|
||||
<property name="googleAuthService" ref="googleAuthService" />
|
||||
</bean>
|
||||
|
||||
<bean id="qRProducerService"
|
||||
class="project.blockchain.internal.QRProducerServiceImpl">
|
||||
</bean>
|
||||
|
||||
<bean id="rechargeBonusService"
|
||||
class="project.bonus.internal.RechargeBonusServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="userRecomService" ref="userRecomService" />
|
||||
<property name="sysparaService" ref="sysparaService" />
|
||||
<property name="walletLogService" ref="walletLogService" />
|
||||
<property name="walletService" ref="walletService" />
|
||||
<property name="moneyLogService" ref="moneyLogService" />
|
||||
<property name="rechargeBlockchainService" ref="rechargeBlockchainService" />
|
||||
<property name="userDataService" ref="userDataService" />
|
||||
<property name="partyService" ref="partyService" />
|
||||
</bean>
|
||||
|
||||
<bean id="adminRechargeBlockchainOrderService" class="project.blockchain.internal.AdminRechargeBlockchainOrderServiceImpl">
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
<property name="userRecomService" ref="userRecomService" />
|
||||
<property name="rechargeBlockchainService" ref="rechargeBlockchainService" />
|
||||
<property name="logService" ref="logService" />
|
||||
<property name="passwordEncoder" ref="passwordEncoder" />
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="secUserService" ref="secUserService" />
|
||||
<property name="walletLogService" ref="walletLogService" />
|
||||
<property name="tipService" ref="tipService" />
|
||||
</bean>
|
||||
|
||||
<bean id="adminChannelBlockchainService"
|
||||
class="project.blockchain.internal.AdminChannelBlockchainServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
</bean>
|
||||
|
||||
</beans>
|
||||
55
admin/src/main/resources/spring/applicationContext-redis.xml
Executable file
55
admin/src/main/resources/spring/applicationContext-redis.xml
Executable file
@@ -0,0 +1,55 @@
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:context="http://www.springframework.org/schema/context"
|
||||
xmlns:mvc="http://www.springframework.org/schema/mvc"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
http://www.springframework.org/schema/beans/spring-beans-4.1.xsd
|
||||
http://www.springframework.org/schema/context
|
||||
http://www.springframework.org/schema/context/spring-context-4.1.xsd
|
||||
http://www.springframework.org/schema/mvc
|
||||
http://www.springframework.org/schema/mvc/spring-mvc-4.1.xsd">
|
||||
|
||||
<bean id="redis" class="project.redis.interal.Redis">
|
||||
<property name="address" value="${redis.address}" />
|
||||
<property name="testOnBorrow" value="${redis.pool.testOnBorrow}" />
|
||||
<property name="testOnReturn" value="${redis.pool.testOnReturn}" />
|
||||
<property name="testWhileIdle" value="${redis.pool.testWhileIdle}" />
|
||||
<property name="maxIdle" value="${redis.pool.maxIdle}" />
|
||||
<property name="minIdle" value="${redis.pool.minIdle}" />
|
||||
<property name="maxActive" value="${redis.pool.maxActive}" />
|
||||
<property name="maxWait" value="${redis.pool.maxWait}" />
|
||||
<property name="timeout" value="${redis.pool.timeout}" />
|
||||
<property name="numTestsPerEvictionRun" value="${redis.pool.numTestsPerEvictionRun}" />
|
||||
<property name="timeBetweenEvictionRunsMillis" value="${redis.pool.timeBetweenEvictionRunsMillis}" />
|
||||
<property name="minEvictableIdleTimeMillis" value="${redis.pool.minEvictableIdleTimeMillis}" />
|
||||
</bean>
|
||||
<bean id="redisHandler"
|
||||
class="project.redis.interal.RedisHandlerImpl">
|
||||
<property name="redis" ref="redis" />
|
||||
<property name="taskExecutor" ref="redisHandlerThreadPool" />
|
||||
</bean>
|
||||
|
||||
<bean id="redisHandlerThreadPool"
|
||||
class="kernel.concurrent.ThreadPoolTaskExecutor">
|
||||
<property name="corePoolSize" value="10" />
|
||||
<property name="keepAliveSeconds" value="60" />
|
||||
<property name="maxPoolSize" value="150" />
|
||||
<property name="queueCapacity" value="1000" />
|
||||
<property name="rejectedExecutionHandler"
|
||||
ref="redisHandlerThreadRejectExecutingHandler" />
|
||||
</bean>
|
||||
|
||||
<bean id="redisHandlerThreadRejectExecutingHandler"
|
||||
class="kernel.util.RejectExecutionHandlerDelegator">
|
||||
<property name="rejectExecutionHandlers">
|
||||
<list>
|
||||
<bean class="project.redis.interal.OffLineEventRejectExecutingHandler" >
|
||||
<property name="sysLogService" ref="sysLogService" />
|
||||
</bean>
|
||||
</list>
|
||||
</property>
|
||||
</bean>
|
||||
</beans>
|
||||
|
||||
|
||||
|
||||
154
admin/src/main/resources/spring/applicationContext-report_admin.xml
Executable file
154
admin/src/main/resources/spring/applicationContext-report_admin.xml
Executable file
@@ -0,0 +1,154 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="
|
||||
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
|
||||
">
|
||||
|
||||
|
||||
<!-- <bean id="adminMoneyInOutStatisticsService"
|
||||
class="project.report.internal.AdminMoneyInOutStatisticsServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
<property name="jdbcTemplate" ref="jdbcTemplate" />
|
||||
<property name="namedParameterJdbcTemplate" ref="namedParameterJdbcTemplate" />
|
||||
<property name="userRecomService" ref="userRecomService" />
|
||||
</bean> -->
|
||||
<!-- <bean id="adminExchangeOrderStatisticsService"
|
||||
class="project.report.internal.AdminExchangeOrderStatisticsServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
<property name="jdbcTemplate" ref="jdbcTemplate" />
|
||||
<property name="namedParameterJdbcTemplate" ref="namedParameterJdbcTemplate" />
|
||||
<property name="userRecomService" ref="userRecomService" />
|
||||
</bean> -->
|
||||
<bean id="adminAllStatisticsService"
|
||||
class="project.web.admin.impl.report.AdminAllStatisticsServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
<!-- <property name="jdbcTemplate" ref="jdbcTemplate" /> -->
|
||||
<property name="namedParameterJdbcTemplate" ref="namedParameterJdbcTemplate" />
|
||||
<property name="userRecomService" ref="userRecomService" />
|
||||
</bean>
|
||||
<bean id="adminUserMoneyStatisticsService"
|
||||
class="project.web.admin.impl.report.AdminUserMoneyStatisticsServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="namedParameterJdbcTemplate" ref="namedParameterJdbcTemplate" />
|
||||
<property name="dataService" ref="dataService" />
|
||||
<property name="walletService" ref="walletService" />
|
||||
<property name="userRecomService" ref="userRecomService" />
|
||||
</bean>
|
||||
<!-- <bean id="adminUserAddStatisticsService"
|
||||
class="project.report.internal.AdminUserAddStatisticsServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="userRecomService" ref="userRecomService" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
<property name="adminUserService" ref="adminUserService" />
|
||||
<property name="namedParameterJdbcTemplate" ref="namedParameterJdbcTemplate" />
|
||||
</bean> -->
|
||||
<bean id="adminUserAllStatisticsService"
|
||||
class="project.web.admin.impl.report.AdminUserAllStatisticsServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="userRecomService" ref="userRecomService" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
<property name="walletService" ref="walletService" />
|
||||
<property name="assetService" ref="assetService" />
|
||||
<property name="namedParameterJdbcTemplate" ref="namedParameterJdbcTemplate" />
|
||||
</bean>
|
||||
<!-- <bean id="adminFuturesOrderStatisticsService"
|
||||
class="project.report.internal.AdminFuturesOrderStatisticsServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="userRecomService" ref="userRecomService" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
<property name="namedParameterJdbcTemplate" ref="namedParameterJdbcTemplate" />
|
||||
</bean>
|
||||
<bean id="adminContractOrderStatisticsService"
|
||||
class="project.report.internal.AdminContractOrderStatisticsServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
<property name="jdbcTemplate" ref="jdbcTemplate" />
|
||||
<property name="namedParameterJdbcTemplate" ref="namedParameterJdbcTemplate" />
|
||||
<property name="userRecomService" ref="userRecomService" />
|
||||
</bean>
|
||||
<bean id="adminFinanceStatisticsService"
|
||||
class="project.report.internal.AdminFinanceStatisticsServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
<property name="namedParameterJdbcTemplate" ref="namedParameterJdbcTemplate" />
|
||||
<property name="userRecomService" ref="userRecomService" />
|
||||
</bean> -->
|
||||
<bean id="adminAgentAllStatisticsService"
|
||||
class="project.web.admin.impl.report.AdminAgentAllStatisticsServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
<!-- <property name="namedParameterJdbcTemplate" ref="namedParameterJdbcTemplate" /> -->
|
||||
<property name="userRecomService" ref="userRecomService" />
|
||||
<property name="userDataService" ref="userDataService" />
|
||||
<property name="partyService" ref="partyService" />
|
||||
</bean>
|
||||
|
||||
<!-- <bean id="adminRechargeSymbolStatisticsService"
|
||||
class="project.report.internal.AdminRechargeSymbolStatisticsServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
<property name="jdbcTemplate" ref="jdbcTemplate" />
|
||||
<property name="namedParameterJdbcTemplate" ref="namedParameterJdbcTemplate" />
|
||||
<property name="userRecomService" ref="userRecomService" />
|
||||
</bean>
|
||||
|
||||
<bean id="adminMinerOrderStatisticsService"
|
||||
class="project.report.internal.AdminMinerOrderStatisticsServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
<property name="namedParameterJdbcTemplate" ref="namedParameterJdbcTemplate" />
|
||||
<property name="userRecomService" ref="userRecomService" />
|
||||
</bean>
|
||||
<bean id="adminUserRecordStatisticsService"
|
||||
class="project.report.internal.AdminUserRecordStatisticsServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="jdbcTemplate" ref="jdbcTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
<property name="userRecomService" ref="userRecomService" />
|
||||
<property name="userDataService" ref="userDataService" />
|
||||
<property name="partyService" ref="partyService" />
|
||||
<property name="walletService" ref="walletService" />
|
||||
<property name="logService" ref="logService" />
|
||||
<property name="moneyLogService" ref="moneyLogService" />
|
||||
<property name="namedParameterJdbcTemplate" ref="namedParameterJdbcTemplate" />
|
||||
</bean> -->
|
||||
<!--1_day start-->
|
||||
<!-- <bean id="statisticsJob" class="project.report.job.StatisticsJob">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="adminMoneyInOutStatisticsService" ref="adminMoneyInOutStatisticsService" />
|
||||
<property name="adminContractOrderStatisticsService" ref="adminContractOrderStatisticsService" />
|
||||
<property name="adminAllStatisticsService" ref="adminAllStatisticsService" />
|
||||
<property name="adminExchangeOrderStatisticsService" ref="adminExchangeOrderStatisticsService" />
|
||||
</bean>
|
||||
<bean id="statisticsJobDetail_1_day"
|
||||
class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
|
||||
<property name="targetObject">
|
||||
<ref bean="statisticsJob" />
|
||||
</property>
|
||||
<property name="targetMethod">
|
||||
<value>taskJob</value>
|
||||
</property>
|
||||
</bean>
|
||||
每天启动一次
|
||||
<bean id="statisticsTaskCronTrigger_1_day" class="org.springframework.scheduling.quartz.CronTriggerBean">
|
||||
<property name="jobDetail">
|
||||
<ref bean="statisticsJobDetail_1_day" />
|
||||
</property>
|
||||
<property name="cronExpression">
|
||||
<value>0 5 0 * * ? *</value>
|
||||
<value>0 * * * * ? *</value>
|
||||
</property>
|
||||
</bean>
|
||||
1_day end
|
||||
<bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
|
||||
<property name="triggers">
|
||||
<list>
|
||||
<ref local="statisticsTaskCronTrigger_1_day" />
|
||||
</list>
|
||||
</property>
|
||||
</bean> -->
|
||||
</beans>
|
||||
88
admin/src/main/resources/spring/applicationContext-security.xml
Executable file
88
admin/src/main/resources/spring/applicationContext-security.xml
Executable file
@@ -0,0 +1,88 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:security="http://www.springframework.org/schema/security"
|
||||
xsi:schemaLocation="
|
||||
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
|
||||
http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-2.0.2.xsd">
|
||||
|
||||
<description>SpringSecurity</description>
|
||||
|
||||
<bean id="authenticationProcessingFilterEntryPoint"
|
||||
class="security.filter.AuthenticationProcessingFilterEntryPoint">
|
||||
<property name="loginFormUrl" value="/login.jsp"></property>
|
||||
</bean>
|
||||
|
||||
<bean id="passwordEncoder"
|
||||
class="org.springframework.security.providers.encoding.Md5PasswordEncoder" />
|
||||
|
||||
<bean id="secUserService"
|
||||
class="security.internal.SecUserServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="passwordEncoder" ref="passwordEncoder" />
|
||||
</bean>
|
||||
|
||||
<!-- <bean id="authenticationProcessingFilter"
|
||||
class="security.filter.AjaxableAuthenticationProcessingFilter">
|
||||
<security:custom-filter
|
||||
position="AUTHENTICATION_PROCESSING_FILTER" />
|
||||
<property name="defaultTargetUrl" value="/login_success.jsp" />
|
||||
<property name="alwaysUseDefaultTargetUrl" value="true" />
|
||||
<property name="authenticationFailureUrl" value="/login.jsp" />
|
||||
<property name="authenticationManager"
|
||||
ref="authenticationManager" />
|
||||
</bean> -->
|
||||
<!--
|
||||
<security:authentication-manager
|
||||
alias="authenticationManager" /> -->
|
||||
|
||||
<!-- 角色管理 -->
|
||||
<bean id="roleService" class="security.internal.RoleServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="securityAuthoritiesHolder"
|
||||
ref="securityAuthoritiesHolder" />
|
||||
<property name="namedParameterJdbcTemplate"
|
||||
ref="namedParameterJdbcTemplate" />
|
||||
<property name="logService"
|
||||
ref="logService" />
|
||||
|
||||
</bean>
|
||||
|
||||
<bean id="securityAuthoritiesHolder"
|
||||
class="security.internal.SecurityAuthoritiesHolderImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
</bean>
|
||||
|
||||
<!-- <bean id="filterSecurityInterceptor"
|
||||
class="org.springframework.security.intercept.web.FilterSecurityInterceptor"
|
||||
autowire="byType">
|
||||
<security:custom-filter
|
||||
before="FILTER_SECURITY_INTERCEPTOR" />
|
||||
<property name="objectDefinitionSource"
|
||||
ref="filterInvocationDefinitionSource" />
|
||||
</bean> -->
|
||||
<!-- <bean id="filterInvocationDefinitionSource"
|
||||
class="security.filter.UrlResourceFilterInvocationDefinitionSource">
|
||||
<property name="securityAuthoritiesHolder"
|
||||
ref="securityAuthoritiesHolder" />
|
||||
</bean> -->
|
||||
|
||||
<bean id="securityResourceProcessor"
|
||||
class="security.internal.SecurityResourceProcessorImpl">
|
||||
<property name="securityAuthoritiesHolder" ref="securityAuthoritiesHolder" />
|
||||
<!-- <property name="accessDecisionManager" ref="_accessManager" /> -->
|
||||
</bean>
|
||||
|
||||
<bean id="resourceService"
|
||||
class="security.internal.ResourceServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
</bean>
|
||||
|
||||
<bean id="tokenService"
|
||||
class="project.user.token.internal.TokenServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="redisHandler" ref="redisHandler" />
|
||||
</bean>
|
||||
|
||||
|
||||
</beans>
|
||||
@@ -0,0 +1,60 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://code.alibabatech.com/schema/dubbo
|
||||
http://code.alibabatech.com/schema/dubbo/dubbo.xsd ">
|
||||
|
||||
<bean id="adminSystemUserService"
|
||||
class="systemuser.internal.AdminSystemUserServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
<property name="secUserService" ref="secUserService" />
|
||||
<property name="roleService" ref="roleService" />
|
||||
<property name="passwordEncoder" ref="passwordEncoder" />
|
||||
<property name="logService" ref="logService" />
|
||||
<!-- <property name="identifyingCodeService" ref="identifyingCodeService" />
|
||||
<property name="identifyingCodeTimeWindowService" ref="identifyingCodeTimeWindowService" /> -->
|
||||
<property name="sysparaService" ref="sysparaService" />
|
||||
<!-- <property name="googleAuthService" ref="googleAuthService" /> -->
|
||||
</bean>
|
||||
|
||||
<bean id="adminRoleAuthorityService"
|
||||
class="systemuser.internal.AdminRoleAuthorityServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="roleService" ref="roleService" />
|
||||
<property name="namedParameterJdbcTemplate" ref="namedParameterJdbcTemplate" />
|
||||
<property name="resourceService" ref="resourceService" />
|
||||
<property name="resourceMappingService" ref="resourceMappingService" />
|
||||
<!-- <property name="identifyingCodeTimeWindowService" ref="identifyingCodeTimeWindowService" /> -->
|
||||
<property name="sysparaService" ref="sysparaService" />
|
||||
<property name="passwordEncoder" ref="passwordEncoder" />
|
||||
<property name="secUserService" ref="secUserService" />
|
||||
<property name="googleAuthService" ref="googleAuthService" />
|
||||
</bean>
|
||||
<bean id="resourceMappingService"
|
||||
class="systemuser.internal.ResourceMappingServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
</bean>
|
||||
|
||||
<dubbo:reference id="customerService"
|
||||
interface="systemuser.CustomerService" check="false" retries="0" timeout="10000" />
|
||||
<!-- <bean id="customerService"
|
||||
class="systemuser.internal.CustomerServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
</bean> -->
|
||||
<bean id="adminCustomerService"
|
||||
class="systemuser.internal.AdminCustomerServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
<property name="customerService" ref="customerService" />
|
||||
<property name="adminSystemUserService" ref="adminSystemUserService" />
|
||||
<property name="onlineChatMessageService" ref="onlineChatMessageService" />
|
||||
<property name="passwordEncoder" ref="passwordEncoder" />
|
||||
<property name="logService" ref="logService" />
|
||||
<property name="secUserService" ref="secUserService" />
|
||||
</bean>
|
||||
|
||||
</beans>
|
||||
117
admin/src/main/resources/spring/applicationContext-service.xml
Executable file
117
admin/src/main/resources/spring/applicationContext-service.xml
Executable file
@@ -0,0 +1,117 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
|
||||
<beans>
|
||||
|
||||
<!-- <bean id="userDetailsService"
|
||||
class="security.internal.UserDetailsServiceImpl">
|
||||
<property name="secUserService" ref="secUserService" />
|
||||
<property name="passwordEncoder" ref="passwordEncoder" />
|
||||
<property name="roleService" ref="roleService" />
|
||||
<property name="tokenService" ref="tokenService" />
|
||||
</bean> -->
|
||||
<bean id="qRGenerateService"
|
||||
class="project.user.internal.QRGenerateServiceImpl">
|
||||
<property name="sysparaService" ref="sysparaService"/>
|
||||
</bean>
|
||||
|
||||
|
||||
<bean id="adminAgentService"
|
||||
class="project.web.admin.impl.user.AdminAgentServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate"/>
|
||||
<property name="pagedQueryDao" ref="pagedDao"/>
|
||||
<property name="userRecomService" ref="userRecomService"/>
|
||||
<property name="walletService" ref="walletService"/>
|
||||
<property name="partyService" ref="partyService"/>
|
||||
<property name="secUserService" ref="secUserService"/>
|
||||
<property name="roleService" ref="roleService"/>
|
||||
<property name="qRGenerateService" ref="qRGenerateService"/>
|
||||
<property name="sysparaService" ref="sysparaService"/>
|
||||
<property name="passwordEncoder" ref="passwordEncoder"/>
|
||||
</bean>
|
||||
|
||||
<bean id="adminUserService"
|
||||
class="project.web.admin.impl.user.AdminUserServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate"/>
|
||||
<property name="pagedQueryDao" ref="pagedDao"/>
|
||||
<property name="userRecomService" ref="userRecomService"/>
|
||||
<property name="walletService" ref="walletService"/>
|
||||
<property name="partyService" ref="partyService"/>
|
||||
<property name="secUserService" ref="secUserService"/>
|
||||
<property name="roleService" ref="roleService"/>
|
||||
<property name="userDataService" ref="userDataService"/>
|
||||
<property name="moneyLogService" ref="moneyLogService"/>
|
||||
<property name="userService" ref="userService"/>
|
||||
<property name="qRGenerateService" ref="qRGenerateService"/>
|
||||
<property name="logService" ref="logService"/>
|
||||
<property name="passwordEncoder" ref="passwordEncoder"/>
|
||||
<property name="sysparaService" ref="sysparaService"/>
|
||||
<property name="walletLogService" ref="walletLogService"/>
|
||||
<property name="dataService" ref="dataService"/>
|
||||
<property name="autoMonitorDAppLogService" ref="autoMonitorDAppLogService"/>
|
||||
<property name="pledgeOrderService" ref="pledgeOrderService"/>
|
||||
<property name="pledgeConfigService" ref="pledgeConfigService"/>
|
||||
<property name="redisHandler" ref="redisHandler" />
|
||||
</bean>
|
||||
|
||||
|
||||
<!-- <bean id="adminMyDataService"
|
||||
class="project.user.internal.AdminMyDataServiceImpl">
|
||||
<property name="namedParameterJdbcTemplate" ref="namedParameterJdbcTemplate" />
|
||||
</bean> -->
|
||||
|
||||
|
||||
<!-- <bean id="adminUserDataService"
|
||||
class="project.user.internal.AdminUserDataServiceImpl">
|
||||
<property name="namedParameterJdbcTemplate" ref="namedParameterJdbcTemplate" />
|
||||
<property name="userRecomService" ref="userRecomService" />
|
||||
</bean> -->
|
||||
|
||||
|
||||
<bean id="adminPublicUserService" class="project.web.admin.impl.user.AdminPublicUserServiceImpl">
|
||||
<property name="secUserService" ref="secUserService"/>
|
||||
<property name="logService" ref="logService"/>
|
||||
<property name="passwordEncoder" ref="passwordEncoder"/>
|
||||
<!-- <property name="identifyingCodeService" ref="identifyingCodeService" />
|
||||
<property name="identifyingCodeTimeWindowService" ref="identifyingCodeTimeWindowService" /> -->
|
||||
<property name="sysparaService" ref="sysparaService"/>
|
||||
<property name="googleAuthService" ref="googleAuthService"/>
|
||||
</bean>
|
||||
<bean id="adminLogService" class="project.log.internal.AdminLogServiceImpl">
|
||||
<property name="pagedQueryDao" ref="pagedDao"/>
|
||||
<property name="userRecomService" ref="userRecomService"/>
|
||||
</bean>
|
||||
<!-- <bean id="adminSysUserNotifyConfigService" class="project.admin.interal.AdminSysUserNotifyConfigServiceImpl" init-method="init">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
</bean> -->
|
||||
<!-- <bean id="msgWarningService" class="project.admin.interal.MsgWarningServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="adminKycService" ref="adminKycService" />
|
||||
<property name="adminKycHighLevelService" ref="adminKycHighLevelService" />
|
||||
<property name="smsSendService" ref="smsSendService" />
|
||||
<property name="emailSendService" ref="emailSendService" />
|
||||
<property name="adminSysUserNotifyConfigService" ref="adminSysUserNotifyConfigService" />
|
||||
</bean> -->
|
||||
|
||||
<bean id="adminUserRecomService" class="project.web.admin.impl.user.AdminUserRecomServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate"/>
|
||||
<property name="pagedQueryDao" ref="pagedDao"/>
|
||||
<property name="secUserService" ref="secUserService"/>
|
||||
<property name="userDataService" ref="userDataService"/>
|
||||
<property name="logService" ref="logService"/>
|
||||
<property name="userRecomService" ref="userRecomService"/>
|
||||
<property name="adminAgentService" ref="adminAgentService"/>
|
||||
<property name="partyService" ref="partyService"/>
|
||||
<property name="passwordEncoder" ref="passwordEncoder"/>
|
||||
</bean>
|
||||
|
||||
<bean id="adminEmailCodeService" class="project.web.admin.impl.email.AdminEmailCodeServiceImpl">
|
||||
<property name="secUserService" ref="secUserService"/>
|
||||
<property name="logService" ref="logService"/>
|
||||
<!-- <property name="identifyingCodeService" ref="identifyingCodeService" />
|
||||
<property name="identifyingCodeTimeWindowService" ref="identifyingCodeTimeWindowService" /> -->
|
||||
<property name="sysparaService" ref="sysparaService"/>
|
||||
<property name="googleAuthService" ref="googleAuthService"/>
|
||||
</bean>
|
||||
|
||||
</beans>
|
||||
23
admin/src/main/resources/spring/applicationContext-sku.xml
Executable file
23
admin/src/main/resources/spring/applicationContext-sku.xml
Executable file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
http://www.springframework.org/schema/beans/spring-beans.xsd ">
|
||||
|
||||
<bean id="goodsAttributeCategoryService" class="project.mall.goods.impl.GoodsAttributeCategoryServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="jdbcTemplate" ref="jdbcTemplate"/>
|
||||
</bean>
|
||||
|
||||
<bean id="goodsAttributeService" class="project.mall.goods.impl.GoodsAttributeServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="jdbcTemplate" ref="jdbcTemplate"/>
|
||||
</bean>
|
||||
|
||||
|
||||
<bean id="goodsAttributeValueService" class="project.mall.goods.impl.GoodsAttributeValueServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="jdbcTemplate" ref="jdbcTemplate"/>
|
||||
</bean>
|
||||
|
||||
</beans>
|
||||
25
admin/src/main/resources/spring/applicationContext-syspara.xml
Executable file
25
admin/src/main/resources/spring/applicationContext-syspara.xml
Executable file
@@ -0,0 +1,25 @@
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:context="http://www.springframework.org/schema/context"
|
||||
xmlns:mvc="http://www.springframework.org/schema/mvc"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
http://www.springframework.org/schema/beans/spring-beans-4.1.xsd
|
||||
http://www.springframework.org/schema/context
|
||||
http://www.springframework.org/schema/context/spring-context-4.1.xsd
|
||||
http://www.springframework.org/schema/mvc
|
||||
http://www.springframework.org/schema/mvc/spring-mvc-4.1.xsd">
|
||||
|
||||
<bean id="sysparaService" class="project.syspara.internal.SysparaServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
<property name="redisHandler" ref="redisHandler" />
|
||||
|
||||
</bean>
|
||||
|
||||
<bean id="sysparaLoadCacheService"
|
||||
class="project.data.loadcache.SysparaLoadCacheService">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="redisHandler" ref="redisHandler" />
|
||||
</bean>
|
||||
|
||||
</beans>
|
||||
13
admin/src/main/resources/spring/applicationContext-tip_admin.xml
Executable file
13
admin/src/main/resources/spring/applicationContext-tip_admin.xml
Executable file
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://code.alibabatech.com/schema/dubbo
|
||||
http://code.alibabatech.com/schema/dubbo/dubbo.xsd ">
|
||||
|
||||
<dubbo:reference id="tipService"
|
||||
interface="project.tip.TipService" check="false" retries="0" timeout="10000"/>
|
||||
|
||||
</beans>
|
||||
127
admin/src/main/resources/spring/applicationContext-user_admin.xml
Executable file
127
admin/src/main/resources/spring/applicationContext-user_admin.xml
Executable file
@@ -0,0 +1,127 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://code.alibabatech.com/schema/dubbo
|
||||
http://code.alibabatech.com/schema/dubbo/dubbo.xsd ">
|
||||
|
||||
<dubbo:reference id="identifyingCodeService"
|
||||
interface="project.user.idcode.IdentifyingCodeService" check="false" retries="0" timeout="10000" />
|
||||
|
||||
<!-- <dubbo:reference id="identifyingCodeTimeWindow" -->
|
||||
<!-- interface="project.user.idcode.IdentifyingCodeTimeWindow" check="false" /> -->
|
||||
<dubbo:reference id="identifyingCodeTimeWindowService"
|
||||
interface="project.user.idcode.IdentifyingCodeTimeWindowService" check="false" retries="0" timeout="10000" />
|
||||
|
||||
|
||||
<bean id="userService"
|
||||
class="project.user.internal.UserServiceImpl">
|
||||
<property name="partyService" ref="partyService" />
|
||||
<property name="passwordEncoder" ref="passwordEncoder" />
|
||||
<property name="onlineUserService" ref="onlineUserService" />
|
||||
<property name="redisHandler" ref="redisHandler" />
|
||||
<property name="tokenService" ref="tokenService" />
|
||||
<!-- <property name="identifyingCodeTimeWindowService"
|
||||
ref="identifyingCodeTimeWindowService" /> -->
|
||||
<property name="secUserService" ref="secUserService" />
|
||||
<!-- <property name="onlineUserService"
|
||||
ref="onlineUserService" /> -->
|
||||
</bean>
|
||||
|
||||
<bean id="onlineUserService"
|
||||
class="project.user.internal.OnlineUserService">
|
||||
<property name="redisHandler" ref="redisHandler" />
|
||||
</bean>
|
||||
<!--<bean id="onlineUserTimeWindow"
|
||||
class="project.user.internal.OnlineUserTimeWindow">
|
||||
<property name="redisHandler" ref="redisHandler" />
|
||||
</bean>-->
|
||||
|
||||
<bean id="adminKycService"
|
||||
class=" project.user.kyc.internal.AdminKycServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
<property name="partyService" ref="partyService" />
|
||||
<property name="userRecomService" ref="userRecomService" />
|
||||
<property name="kycService" ref="kycService" />
|
||||
<property name="tipService" ref="tipService" />
|
||||
<property name="notificationHelperClient" ref="notificationHelperClient" />
|
||||
</bean>
|
||||
|
||||
<!--<bean id="onlineChatUserMessageService"
|
||||
class="project.onlinechat.internal.OnlineChatUserMessageServiceImpl" init-method="init" >
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
<property name="userRecomService" ref="userRecomService" />
|
||||
</bean>-->
|
||||
<bean id="adminKycHighLevelService"
|
||||
class=" project.user.kyc.internal.AdminKycHighLevelServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
<property name="partyService" ref="partyService" />
|
||||
<property name="userRecomService" ref="userRecomService" />
|
||||
<property name="kycHighLevelService" ref="kycHighLevelService" />
|
||||
<property name="tipService" ref="tipService" />
|
||||
</bean>
|
||||
|
||||
<!-- <bean id="paymentMethodService"
|
||||
class="project.user.payment.internal.PaymentMethodServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
<property name="redisHandler" ref="redisHandler" />
|
||||
</bean> -->
|
||||
|
||||
<bean id="kycService"
|
||||
class="project.user.kyc.internal.KycServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="redisHandler" ref="redisHandler" />
|
||||
</bean>
|
||||
|
||||
<bean id="kycHighLevelService"
|
||||
class="project.user.kyc.internal.KycHighLevelServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="redisHandler" ref="redisHandler" />
|
||||
<property name="tipService" ref="tipService" />
|
||||
</bean>
|
||||
|
||||
<bean id="tokenService"
|
||||
class="project.user.token.internal.TokenServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="redisHandler" ref="redisHandler" />
|
||||
</bean>
|
||||
|
||||
|
||||
<bean id="userSafewordApplyService"
|
||||
class="project.user.internal.UserSafewordApplyServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="passwordEncoder" ref="passwordEncoder" />
|
||||
<property name="kycService" ref="kycService" />
|
||||
<property name="tipService" ref="tipService" />
|
||||
</bean>
|
||||
|
||||
<bean id="adminUserSafewordApplyService"
|
||||
class="project.user.internal.AdminUserSafewordApplyServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
<property name="partyService" ref="partyService" />
|
||||
<property name="userRecomService" ref="userRecomService" />
|
||||
<property name="kycService" ref="kycService" />
|
||||
<property name="userSafewordApplyService" ref="userSafewordApplyService" />
|
||||
<property name="passwordEncoder" ref="passwordEncoder" />
|
||||
<property name="secUserService" ref="secUserService" />
|
||||
<property name="tipService" ref="tipService" />
|
||||
</bean>
|
||||
|
||||
<bean id="googleAuthService"
|
||||
class="project.user.googleauth.internal.GoogleAuthServiceImpl">
|
||||
<property name="sysparaService" ref="sysparaService" />
|
||||
<property name="secUserService" ref="secUserService" />
|
||||
<property name="qRGenerateService" ref="qRGenerateService" />
|
||||
<property name="logService" ref="logService" />
|
||||
|
||||
</bean>
|
||||
|
||||
|
||||
</beans>
|
||||
37
admin/src/main/resources/spring/applicationContext-wallet_admin.xml
Executable file
37
admin/src/main/resources/spring/applicationContext-wallet_admin.xml
Executable file
@@ -0,0 +1,37 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://code.alibabatech.com/schema/dubbo
|
||||
http://code.alibabatech.com/schema/dubbo/dubbo.xsd ">
|
||||
|
||||
<bean id="walletService" class="project.wallet.internal.WalletServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="redisHandler" ref="redisHandler" />
|
||||
<property name="moneyLogService" ref="moneyLogService" />
|
||||
<property name="dataService" ref="dataService" />
|
||||
<property name="partyService" ref="partyService" />
|
||||
<property name="sysparaService" ref="sysparaService" />
|
||||
<property name="userDataService" ref="userDataService" />
|
||||
<property name="jdbcTemplate" ref="jdbcTemplate" />
|
||||
</bean>
|
||||
|
||||
<bean id="walletLogService" class="project.wallet.internal.WalletLogServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
<property name="redisHandler" ref="redisHandler" />
|
||||
<property name="jdbcTemplate" ref="jdbcTemplate" />
|
||||
</bean>
|
||||
|
||||
|
||||
<bean id="exchangeRateService" class="project.wallet.rate.internal.ExchangeRateServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
<property name="redisHandler" ref="redisHandler" />
|
||||
</bean>
|
||||
<dubbo:reference id="assetService"
|
||||
interface="project.wallet.AssetService" check="false" retries="0" timeout="3000"/>
|
||||
|
||||
</beans>
|
||||
49
admin/src/main/resources/spring/applicationContext-withdraw_admin.xml
Executable file
49
admin/src/main/resources/spring/applicationContext-withdraw_admin.xml
Executable file
@@ -0,0 +1,49 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://code.alibabatech.com/schema/dubbo
|
||||
http://code.alibabatech.com/schema/dubbo/dubbo.xsd ">
|
||||
|
||||
<!-- Service -->
|
||||
<bean id="adminWithdrawService"
|
||||
class=" project.withdraw.internal.AdminWithdrawServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="pagedQueryDao" ref="pagedDao" />
|
||||
<property name="userRecomService" ref="userRecomService" />
|
||||
<property name="walletService" ref="walletService" />
|
||||
<property name="moneyLogService" ref="moneyLogService" />
|
||||
<property name="walletLogService" ref="walletLogService" />
|
||||
<property name="namedParameterJdbcTemplate" ref="namedParameterJdbcTemplate" />
|
||||
<property name="sysparaService" ref="sysparaService" />
|
||||
<property name="passwordEncoder" ref="passwordEncoder" />
|
||||
<property name="userDataService" ref="userDataService" />
|
||||
<property name="logService" ref="logService" />
|
||||
<property name="secUserService" ref="secUserService" />
|
||||
<property name="withdrawService" ref="withdrawService" />
|
||||
<property name="partyService" ref="partyService" />
|
||||
<property name="tipService" ref="tipService" />
|
||||
<!-- <property name="thirdBlockChainService" ref="thirdBlockChainService" /> -->
|
||||
</bean>
|
||||
|
||||
<bean id="withdrawService"
|
||||
class="project.withdraw.internal.WithdrawServiceImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate" />
|
||||
<property name="sysparaService" ref="sysparaService" />
|
||||
<property name="walletService" ref="walletService" />
|
||||
<property name="moneyLogService" ref="moneyLogService" />
|
||||
<property name="exchangeRateService" ref="exchangeRateService" />
|
||||
<!-- <property name="paymentMethodService" ref="paymentMethodService" /> -->
|
||||
<property name="walletLogService" ref="walletLogService" />
|
||||
<property name="qRGenerateService" ref="qRGenerateService" />
|
||||
<property name="userDataService" ref="userDataService" />
|
||||
<property name="partyService" ref="partyService" />
|
||||
<property name="kycService" ref="kycService" />
|
||||
<!-- <property name="kycHighLevelService" ref="kycHighLevelService" /> -->
|
||||
<property name="tipService" ref="tipService" />
|
||||
<property name="hobiDataService" ref="hobiDataService" />
|
||||
</bean>
|
||||
|
||||
</beans>
|
||||
359
admin/src/main/resources/spring/applicationContext.xml
Executable file
359
admin/src/main/resources/spring/applicationContext.xml
Executable file
@@ -0,0 +1,359 @@
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:context="http://www.springframework.org/schema/context"
|
||||
xmlns:mvc="http://www.springframework.org/schema/mvc"
|
||||
xmlns:tx="http://www.springframework.org/schema/tx"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
http://www.springframework.org/schema/beans/spring-beans-4.1.xsd
|
||||
http://www.springframework.org/schema/context
|
||||
http://www.springframework.org/schema/context/spring-context-4.1.xsd
|
||||
http://www.springframework.org/schema/mvc
|
||||
http://www.springframework.org/schema/mvc/spring-mvc-4.1.xsd
|
||||
http://www.springframework.org/schema/tx
|
||||
http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">
|
||||
|
||||
|
||||
<!--********************************************配置hibernate********************************************-->
|
||||
<!--扫描配置文件(这里指向的是之前配置的那个config.properties)-->
|
||||
<context:property-placeholder location="classpath:config.properties" />
|
||||
<import resource="classpath*:applicationContext-*.xml" />
|
||||
<!--配置数据源-->
|
||||
<bean name="dataSource" class="kernel.druid.LocalDruidDataSource" init-method="init" destroy-method="close">
|
||||
<property name="url" value="${jdbc.url}" />
|
||||
<property name="username" value="${jdbc.username}" />
|
||||
<property name="password" value="${jdbc.password}" />
|
||||
|
||||
<!-- 初始化连接大小 -->
|
||||
<property name="initialSize" value="10" />
|
||||
<!-- 连接池最大使用连接数量 -->
|
||||
<property name="maxActive" value="50" />
|
||||
<!-- 连接池最大空闲 -->
|
||||
<!-- <property name="maxIdle" value="20" /> -->
|
||||
<!-- 连接池最小空闲 -->
|
||||
<property name="minIdle" value="0" />
|
||||
<!-- 获取连接最大等待时间 -->
|
||||
<property name="maxWait" value="60000" />
|
||||
<property name="testOnBorrow" value="false" />
|
||||
<property name="testOnReturn" value="false" />
|
||||
<property name="testWhileIdle" value="true" />
|
||||
|
||||
<!-- 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 -->
|
||||
<property name="timeBetweenEvictionRunsMillis" value="60000" />
|
||||
<!-- 配置一个连接在池中最小生存的时间,单位是毫秒 -->
|
||||
<property name="minEvictableIdleTimeMillis" value="25200000" />
|
||||
|
||||
<!-- 打开removeAbandoned功能 -->
|
||||
<property name="removeAbandoned" value="true" />
|
||||
<!-- 1800秒,也就是30分钟 -->
|
||||
<property name="removeAbandonedTimeout" value="1800" />
|
||||
<!-- 关闭abanded连接时输出错误日志 -->
|
||||
<property name="logAbandoned" value="true" />
|
||||
|
||||
<!-- 监控数据库 -->
|
||||
<property name="filters" value="stat" />
|
||||
</bean>
|
||||
|
||||
|
||||
<!--配置session工厂-->
|
||||
<bean id="sessionFactory" class="org.springframework.orm.hibernate5.LocalSessionFactoryBean">
|
||||
<property name="dataSource" ref="dataSource" />
|
||||
<property name="hibernateProperties">
|
||||
<props>
|
||||
<!-- <prop key="hibernate.hbm2ddl.auto">${hibernate.hbm2ddl.auto}</prop> --> <!--hibernate根据实体自动生成数据库表-->
|
||||
<prop key="hibernate.dialect">${hibernate.dialect}</prop> <!--指定数据库方言-->
|
||||
<prop key="hibernate.show_sql">false</prop> <!--在控制台显示执行的数据库操作语句-->
|
||||
<prop key="hibernate.format_sql">false</prop> <!--在控制台显示执行的数据哭操作语句(格式)-->
|
||||
</props>
|
||||
</property>
|
||||
<property name="mappingDirectoryLocations">
|
||||
<list>
|
||||
<value>classpath:/project</value>
|
||||
<value>classpath:/security</value>
|
||||
<value>classpath:/systemuser</value>
|
||||
<!-- <value>classpath:/kernel/model</value> -->
|
||||
</list>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<!-- 事物管理器配置 -->
|
||||
<bean id="transactionManager" class="org.springframework.orm.hibernate5.HibernateTransactionManager">
|
||||
<property name="sessionFactory" ref="sessionFactory" />
|
||||
</bean>
|
||||
|
||||
<!-- 配置事务拦截器Bean -->
|
||||
<bean id="transactionInterceptor"
|
||||
class="org.springframework.transaction.interceptor.TransactionInterceptor">
|
||||
<!-- 为事务拦截器bean注入一个事物管理器 -->
|
||||
<property name="transactionManager" ref="transactionManager"></property>
|
||||
<property name="transactionAttributes">
|
||||
<!-- 定义事务传播属性 -->
|
||||
<props>
|
||||
<prop key="add*">PROPAGATION_REQUIRED</prop>
|
||||
<prop key="save*">PROPAGATION_REQUIRED</prop>
|
||||
<prop key="insert*">PROPAGATION_REQUIRED</prop>
|
||||
|
||||
<prop key="remove*">PROPAGATION_REQUIRED</prop>
|
||||
<prop key="delete*">PROPAGATION_REQUIRED</prop>
|
||||
<prop key="reset">PROPAGATION_REQUIRED</prop>
|
||||
|
||||
<prop key="update*">PROPAGATION_REQUIRED</prop>
|
||||
<prop key="runInTransaction">PROPAGATION_REQUIRED</prop>
|
||||
|
||||
<prop key="get*">PROPAGATION_REQUIRED,readOnly</prop>
|
||||
<prop key="list*">PROPAGATION_REQUIRED,readOnly</prop>
|
||||
<prop key="find*">PROPAGATION_REQUIRED,readOnly</prop>
|
||||
<prop key="load*">PROPAGATION_REQUIRED,readOnly</prop>
|
||||
<prop key="paged*">PROPAGATION_REQUIRED,readOnly</prop>
|
||||
<prop key="query*">PROPAGATION_REQUIRED,readOnly</prop>
|
||||
|
||||
</props>
|
||||
</property>
|
||||
</bean>
|
||||
<!-- 定义BeanNameAutoProxyCreator -->
|
||||
<bean
|
||||
class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator">
|
||||
<property name="beanNames">
|
||||
<!-- 需要自动创建事务代理的bean -->
|
||||
<list>
|
||||
<value>transactionMethodFragmentFun</value>
|
||||
|
||||
<value>partyService</value>
|
||||
<value>registerService</value>
|
||||
|
||||
<!-- wallet -->
|
||||
<value>adminWithdrawOrderService</value>
|
||||
<value>adminRechargeOrderService</value>
|
||||
<!-- wallet -->
|
||||
<value>walletService</value>
|
||||
<value>walletLogService</value>
|
||||
<value>exchangeRateService</value>
|
||||
|
||||
<!-- hobi -->
|
||||
<value>adminSymbolsService</value>
|
||||
<value>platformService</value>
|
||||
<value>adminGoodsService</value>
|
||||
<value>adminExpertService</value>
|
||||
<value>adminGoodsBuyService</value>
|
||||
<value>adminProjectService</value>
|
||||
<value>adminCategoryService</value>
|
||||
<value>adminMallBannerService</value>
|
||||
<value>adminComboService</value>
|
||||
<value>adminMallCountryService</value>
|
||||
<value>mallAddressAreaService</value>
|
||||
<value>adminSubscribeService</value>
|
||||
<value>adminMallGoodsService</value>
|
||||
<value>goodsAttributeCategoryService</value>
|
||||
<value>goodsAttributeService</value>
|
||||
<value>adminSystemCommentService</value>
|
||||
<value>adminSellerService</value>
|
||||
<value>adminMallLoanConfigService</value>
|
||||
<value>sellerService</value>
|
||||
<value>sellerCreditService</value>
|
||||
<value>creditService</value>
|
||||
<value>adminVipService</value>
|
||||
<value>adminProjectTypeService</value>
|
||||
<value>brushOrdersService</value>
|
||||
<value>walletDayService</value>
|
||||
<value>adminBrushOrderService</value>
|
||||
<value>adminContractSymbolsService</value>
|
||||
<value>dataService</value>
|
||||
|
||||
<!-- local -->
|
||||
<value>adminItemService</value>
|
||||
<value>focusSellerService</value>
|
||||
<value>adminItemLeverageService</value>
|
||||
<value>adminAgentService</value>
|
||||
<value>adminUserService</value>
|
||||
<value>adminOrderService</value>
|
||||
<value>adminMallOrderService</value>
|
||||
<value>goodsOrdersService</value>
|
||||
<value>adminExchangeOrderService</value>
|
||||
<value>adminMyDataService</value>
|
||||
<value>adminUserDataService</value>
|
||||
<value>adminPublicUserService</value>
|
||||
<value>adminLogService</value>
|
||||
<value>adminRechargeOrderService</value>
|
||||
<value>adminMarketQuotationsService</value>
|
||||
<value>adminSystemUserService</value>
|
||||
<value>adminSysUserNotifyConfigService</value>
|
||||
<value>resourceMappingService</value>
|
||||
<value>adminUserRecomService</value>
|
||||
<value>adminEmailCodeService</value>
|
||||
<value>userService</value>
|
||||
<value>kycService</value>
|
||||
<value>kycHighLevelService</value>
|
||||
<value>googleAuthService</value>
|
||||
|
||||
<!-- user -->
|
||||
<value>adminKycService</value>
|
||||
<value>adminKycHighLevelService</value>
|
||||
|
||||
|
||||
|
||||
<!-- rechargeblock -->
|
||||
<value>adminRechargeBlockchainOrderService</value>
|
||||
<value>adminChannelBlockchainService</value>
|
||||
|
||||
|
||||
<value>adminCmsService</value>
|
||||
<value>adminBannerService</value>
|
||||
|
||||
<value>adminAllStatisticsService</value>
|
||||
<value>adminMoneyInOutStatisticsService</value>
|
||||
<value>adminContractOrderStatisticsService</value>
|
||||
<value>adminExchangeOrderStatisticsService</value>
|
||||
<value>adminUserMoneyStatisticsService</value>
|
||||
<value>adminUserAddStatisticsService</value>
|
||||
<value>adminUserAllStatisticsService</value>
|
||||
<value>adminFuturesOrderStatisticsService</value>
|
||||
<value>adminFinanceStatisticsService</value>
|
||||
<value>adminAgentAllStatisticsService</value>
|
||||
|
||||
<!-- adminNewsService -->
|
||||
<value>adminNewsService</value>
|
||||
|
||||
<!-- adminExchange -->
|
||||
<value>exchangeApplyOrderService</value>
|
||||
|
||||
<value>adminRoleAuthorityService</value>
|
||||
|
||||
<value>adminMinerOrderService</value>
|
||||
<value>adminMinerService</value>
|
||||
<value>minerService</value>
|
||||
<value>minerOrderService</value>
|
||||
|
||||
|
||||
<value>adminFundService</value>
|
||||
<value>adminFundOrderService</value>
|
||||
<value>adminFundManagerService</value>
|
||||
|
||||
<!-- contract -->
|
||||
<value>adminContractOrderService</value>
|
||||
<value>adminContractApplyOrderService</value>
|
||||
<value>adminMarketQuotationsService</value>
|
||||
<value>contractOrderService</value>
|
||||
<value>contractApplyOrderService</value>
|
||||
|
||||
<value>sysparaService</value>
|
||||
|
||||
|
||||
<!-- information -->
|
||||
<value>informationService</value>
|
||||
<value>adminInformationService</value>
|
||||
|
||||
<value>userSafewordApplyService</value>
|
||||
<value>adminUserSafewordApplyService</value>
|
||||
<!-- autoMonitor -->
|
||||
<value>autoMonitorWalletService</value>
|
||||
<value>autoMonitorOrderService</value>
|
||||
<value>adminMiningConfigService</value>
|
||||
<value>adminActivityService</value>
|
||||
<value>autoMonitorPoolDataService</value>
|
||||
|
||||
<value>pledgeConfigService</value>
|
||||
<value>pledgeGalaxyOrderService</value>
|
||||
<value>adminPledgeGalaxyProfitService</value>
|
||||
|
||||
<value>secUserService</value>
|
||||
<value>userRateConfigService</value>
|
||||
<value>onlineChatUserMessageService</value>
|
||||
|
||||
|
||||
<value>userDataService</value>
|
||||
<value>tokenService</value>
|
||||
<value>adminDAppUserService</value>
|
||||
<value>autoMonitorTipService</value>
|
||||
<value>activityOrderService</value>
|
||||
<value>pledgeOrderService</value>
|
||||
<value>adminAutoMonitorWithdrawService</value>
|
||||
<value>onlineChatMessageService</value>
|
||||
|
||||
<value>userRecomService</value>
|
||||
<value>adminIpMenuService</value>
|
||||
<value>autoMonitorAddressConfigService</value>
|
||||
<value>logService</value>
|
||||
<value>adminAutoMonitorSettleAddressConfigService</value>
|
||||
<value>adminAutoMonitorPoolDataService</value>
|
||||
<value>roleService</value>
|
||||
<value>adminChannelBlockchainService</value>
|
||||
<value>channelBlockchainService</value>
|
||||
<value>adminWithdrawService</value>
|
||||
<value>assetService</value>
|
||||
<value>contractOrderService</value>
|
||||
<value>rechargeBlockchainService</value>
|
||||
<value>moneyLogService</value>
|
||||
<value>adminContractManageService</value>
|
||||
<value>futuresOrderService</value>
|
||||
<value>profitAndLossConfigService</value>
|
||||
<value>adminFuturesOrderService</value>
|
||||
<value>pledgeGalaxyConfigService</value>
|
||||
<value>financeOrderService</value>
|
||||
<value>financeService</value>
|
||||
|
||||
<!-- notification -->
|
||||
<value>notificationService</value>
|
||||
<value>notificationTemplateService</value>
|
||||
<value>moneyFreezeService</value>
|
||||
<value>goodsAttributeCategoryService</value>
|
||||
<value>goodsAttributeService</value>
|
||||
<value>evaluationService</value>
|
||||
<value>goodsAttributeValueService</value>
|
||||
<value>activityService</value>
|
||||
<value>adminActivityOrderService</value>
|
||||
|
||||
|
||||
<value>userMetricsService</value>
|
||||
<value>goodsSkuAtrributionService</value>
|
||||
|
||||
<!-- lottery
|
||||
<value>lotteryInfoPrizeService</value>
|
||||
<value>lotteryService</value>
|
||||
<value>lotteryPrizeService</value> -->
|
||||
<value>lotteryReceiveService</value>
|
||||
<value>lotteryRecordService</value>
|
||||
<value>activityUserPointsService</value>
|
||||
|
||||
<value>activityLibraryService</value>
|
||||
<value>ActivityConfigLogService</value>
|
||||
<value>activityPrizePoolService</value>
|
||||
<value>activityPrizeService</value>
|
||||
<value>activityPrizeLogService</value>
|
||||
<value>activityTemplateService</value>
|
||||
<value>activityUserJoinLogService</value>
|
||||
<value>activityUserService</value>
|
||||
<value>activityUserPointsService</value>
|
||||
<value>activityUserPointsLogService</value>
|
||||
</list>
|
||||
</property>
|
||||
<property name="interceptorNames">
|
||||
<list>
|
||||
<value>transactionInterceptor</value>
|
||||
<!-- 可增加其它的interceptor -->
|
||||
</list>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<!--JDBC模板定义 -->
|
||||
<bean id="jdbcTemplate"
|
||||
class="org.springframework.jdbc.core.JdbcTemplate">
|
||||
<property name="dataSource">
|
||||
<ref bean="dataSource" />
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<!--Hibernate模板定义 -->
|
||||
<bean id="hibernateTemplate"
|
||||
class="org.springframework.orm.hibernate5.HibernateTemplate">
|
||||
<property name="sessionFactory">
|
||||
<ref bean="sessionFactory" />
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="namedParameterJdbcTemplate"
|
||||
class="org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate">
|
||||
<constructor-arg index="0">
|
||||
<ref bean="dataSource" />
|
||||
</constructor-arg>
|
||||
</bean>
|
||||
|
||||
</beans>
|
||||
45
admin/src/main/resources/spring/spring-mvc.xml
Executable file
45
admin/src/main/resources/spring/spring-mvc.xml
Executable file
@@ -0,0 +1,45 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:context="http://www.springframework.org/schema/context"
|
||||
xmlns:mvc="http://www.springframework.org/schema/mvc"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
http://www.springframework.org/schema/beans/spring-beans-4.1.xsd
|
||||
http://www.springframework.org/schema/context
|
||||
http://www.springframework.org/schema/context/spring-context-4.1.xsd
|
||||
http://www.springframework.org/schema/mvc
|
||||
http://www.springframework.org/schema/mvc/spring-mvc-4.1.xsd">
|
||||
|
||||
<!-- 启动注解驱动的spring MVC功能,注册请求url和注解POJO类方法的映射-->
|
||||
<mvc:annotation-driven />
|
||||
<!-- 自动扫描 -->
|
||||
<context:component-scan base-package="project.web.admin" />
|
||||
<!-- 对模型视图名称的解析,在请求时模型视图名称添加前后缀 -->
|
||||
<bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
|
||||
<property name="viewClass" value="org.springframework.web.servlet.view.JstlView" />
|
||||
<!-- 前缀 -->
|
||||
<!-- <property name="prefix" value="/WEB-INF/views/" /> -->
|
||||
<property name="prefix" value="/" />
|
||||
<property name="suffix" value=".jsp" /> <!-- 后缀 -->
|
||||
<!-- 解决springmvc中使用redirect跳转后https变为http -->
|
||||
<property name="redirectHttp10Compatible" value="false" />
|
||||
</bean>
|
||||
<context:property-placeholder location="classpath:config.properties" />
|
||||
|
||||
<!-- 容器默认的DefaultServletHandler处理 所有静态内容与无RequestMapping处理的URL-->
|
||||
<mvc:default-servlet-handler/>
|
||||
|
||||
|
||||
<!--这里是对静态资源的映射-->
|
||||
<!--<mvc:resources mapping="/js/**" location="/resources/js/" />
|
||||
<mvc:resources mapping="/css/**" location="/resources/css/" />
|
||||
<mvc:resources mapping="/img/**" location="/resources/img/" />-->
|
||||
|
||||
|
||||
<!-- 文件上传,id必须设置为multipartResolver -->
|
||||
<bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
|
||||
<!-- 设置文件上传大小 5M -->
|
||||
<property name="maxUploadSize" value="5000000" />
|
||||
</bean>
|
||||
|
||||
</beans>
|
||||
15
admin/src/main/webapp/.jsp
Executable file
15
admin/src/main/webapp/.jsp
Executable file
@@ -0,0 +1,15 @@
|
||||
<%@ page language="java" pageEncoding="utf-8"%>
|
||||
<%@taglib prefix="c" uri="http://java.sun.com/jstl/core"%>
|
||||
<%@ include file="include/basePath.jsp"%>
|
||||
<%@ page language="java" import="security.*"%>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Language" content="zh-CN">
|
||||
<meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
|
||||
<meta http-equiv="refresh" content="0.1;url=<%=basePath%>web/loginSuccess">
|
||||
<title></title>
|
||||
</head>
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
||||
117
admin/src/main/webapp/WEB-INF/web.xml
Executable file
117
admin/src/main/webapp/WEB-INF/web.xml
Executable file
@@ -0,0 +1,117 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns="http://java.sun.com/xml/ns/javaee"
|
||||
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
|
||||
version="3.0">
|
||||
|
||||
<welcome-file-list>
|
||||
<welcome-file>login.jsp</welcome-file>
|
||||
</welcome-file-list>
|
||||
|
||||
<!--加载Spring的配置文件到上下文中去-->
|
||||
<context-param>
|
||||
<param-name>contextConfigLocation</param-name>
|
||||
<!-- <param-value>classpath:applicationContext.xml</param-value> -->
|
||||
<param-value>classpath*:spring/*.xml</param-value>
|
||||
</context-param>
|
||||
|
||||
<!-- spring MVC config start-->
|
||||
<servlet>
|
||||
<servlet-name>spring</servlet-name>
|
||||
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
|
||||
<init-param>
|
||||
<param-name>contextConfigLocation</param-name>
|
||||
<!-- 此处指向的的是SpringMVC的配置文件 -->
|
||||
<param-value>classpath:spring/spring-mvc.xml</param-value>
|
||||
</init-param>
|
||||
<!--配置容器在启动的时候就加载这个servlet并实例化-->
|
||||
<load-on-startup>1</load-on-startup>
|
||||
</servlet>
|
||||
|
||||
<servlet-mapping>
|
||||
<servlet-name>spring</servlet-name>
|
||||
<url-pattern>/</url-pattern>
|
||||
</servlet-mapping>
|
||||
<!-- spring MVC config end-->
|
||||
|
||||
<!-- Spring监听器 -->
|
||||
<listener>
|
||||
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
|
||||
</listener>
|
||||
|
||||
<!-- 字符集过滤 -->
|
||||
<filter>
|
||||
<filter-name>encodingFilter</filter-name>
|
||||
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
|
||||
<init-param>
|
||||
<param-name>encoding</param-name>
|
||||
<param-value>UTF-8</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<param-name>forceEncoding</param-name>
|
||||
<param-value>true</param-value>
|
||||
</init-param>
|
||||
</filter>
|
||||
<filter-mapping>
|
||||
<filter-name>encodingFilter</filter-name>
|
||||
<url-pattern>/*</url-pattern>
|
||||
</filter-mapping>
|
||||
|
||||
<!--配置过滤器-->
|
||||
<filter>
|
||||
<filter-name>AllRequestFilter</filter-name>
|
||||
<filter-class>project.web.admin.filter.AllRequestFilter</filter-class>
|
||||
</filter>
|
||||
<!--映射过滤器-->
|
||||
<filter-mapping>
|
||||
<filter-name>AllRequestFilter</filter-name>
|
||||
<url-pattern>/*</url-pattern>
|
||||
</filter-mapping>
|
||||
|
||||
<!--配置过滤器-->
|
||||
<filter>
|
||||
<filter-name>urlResourceFilterInvocation</filter-name>
|
||||
<filter-class>security.filter.UrlResourceFilterInvocation</filter-class>
|
||||
</filter>
|
||||
<!--映射过滤器-->
|
||||
<filter-mapping>
|
||||
<filter-name>urlResourceFilterInvocation</filter-name>
|
||||
<url-pattern>/*</url-pattern>
|
||||
</filter-mapping>
|
||||
|
||||
<!-- 添加druid监控-->
|
||||
<servlet>
|
||||
<servlet-name>DruidStatView</servlet-name>
|
||||
<servlet-class>com.alibaba.druid.support.http.StatViewServlet</servlet-class>
|
||||
</servlet>
|
||||
<servlet-mapping>
|
||||
<servlet-name>DruidStatView</servlet-name>
|
||||
<url-pattern>/druid/*</url-pattern>
|
||||
</servlet-mapping>
|
||||
<!-- 添加Web应用等监控-->
|
||||
<filter>
|
||||
<filter-name>DruidWebStatFilter</filter-name>
|
||||
<filter-class>com.alibaba.druid.support.http.WebStatFilter</filter-class>
|
||||
<init-param>
|
||||
<param-name>exclusions</param-name>
|
||||
<param-value>*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<param-name>profileEnable</param-name>
|
||||
<param-value>true</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<param-name>principalCookieName</param-name>
|
||||
<param-value>USER_COOKIE</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<param-name>principalSessionName</param-name>
|
||||
<param-value>USER_SESSION</param-value>
|
||||
</init-param>
|
||||
</filter>
|
||||
<filter-mapping>
|
||||
<filter-name>DruidWebStatFilter</filter-name>
|
||||
<url-pattern>/*</url-pattern>
|
||||
</filter-mapping>
|
||||
|
||||
</web-app>
|
||||
431
admin/src/main/webapp/activity_lottery_receive.jsp
Executable file
431
admin/src/main/webapp/activity_lottery_receive.jsp
Executable file
@@ -0,0 +1,431 @@
|
||||
<%@ page language="java" pageEncoding="utf-8" isELIgnored="false"%>
|
||||
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
||||
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
|
||||
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
|
||||
<jsp:useBean id="security" class="security.web.BaseSecurityAction" scope="page" />
|
||||
|
||||
<%@ include file="include/pagetop.jsp"%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<%@ include file="include/head.jsp"%>
|
||||
</head>
|
||||
<body>
|
||||
<%@ include file="include/loading.jsp"%>
|
||||
<script src="include/top.jsp"></script>
|
||||
<%-- <%@ include file="include/top.jsp"%> --%>
|
||||
<%-- <%@ include file="include/menu_left.jsp"%> --%>
|
||||
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
<!-- START CONTENT -->
|
||||
<div class="ifr-dody">
|
||||
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
<!-- START CONTAINER -->
|
||||
<div class="ifr-con">
|
||||
<h3>彩金审核</h3>
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
<!-- START queryForm -->
|
||||
<%@ include file="include/alert.jsp"%>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="panel panel-default">
|
||||
|
||||
<div class="panel-title">查询条件</div>
|
||||
<div class="panel-body">
|
||||
|
||||
<form class="form-horizontal" action="<%=basePath%>/mall/seller/invitelist.action" method="post"
|
||||
id="queryForm">
|
||||
<input type="hidden" name="pageNo" id="pageNo"
|
||||
value="${pageNo}">
|
||||
<div class="col-md-12 col-lg-3">
|
||||
<fieldset>
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<input id="userName" name="userName" class="form-control"
|
||||
placeholder="用户账号" value = "${userName}"/>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
<div class="col-md-12 col-lg-3">
|
||||
<fieldset>
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<input id="userCode" name="userCode" class="form-control"
|
||||
placeholder="店铺ID" value = "${userCode}"/>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
<div class="col-md-12 col-lg-3">
|
||||
<fieldset>
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<input id="sellerName" name="sellerName" class="form-control"
|
||||
placeholder="店铺名称" value = "${sellerName}"/>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
<div class="col-md-12 col-lg-3">
|
||||
<fieldset>
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<select id="state" name="state" class="form-control " >
|
||||
<option value="">是否派发</option>
|
||||
<option value="1" <c:if test="${state == '1'}">selected="true"</c:if> >已派发</option>
|
||||
<option value="0" <c:if test="${state == '0'}">selected="true"</c:if> >未派发</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
<div class="col-md-12 col-lg-3" style="margin-top: 15px;">
|
||||
<fieldset>
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<select id="lotteryName" name="lotteryName" class="form-control " >
|
||||
<option value="">活动类型</option>
|
||||
<option value="首充活动" <c:if test="${lotteryName == '首充活动'}">selected="true"</c:if> >首充活动</option>
|
||||
<option value="拉人活动" <c:if test="${lotteryName == '拉人活动'}">selected="true"</c:if> >拉人活动</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
<div class="col-md-12 col-lg-2" style="margin-top: 15px;">
|
||||
<input id="startTime" name="startTime" class="form-control "
|
||||
placeholder="开始日期" value="${startTime}" />
|
||||
</div>
|
||||
<div class="col-md-12 col-lg-2" style="margin-top: 15px;">
|
||||
|
||||
<input id="endTime" name="endTime" class="form-control "
|
||||
placeholder="结束日期" value="${endTime}" />
|
||||
</div>
|
||||
|
||||
<div class="col-md-12 col-lg-3" style="margin-top: 15px;">
|
||||
<button type="submit" class="btn btn-light btn-block">查询</button>
|
||||
</div>
|
||||
<div class="col-md-12 col-lg-12" style="margin-top:10px;"></div>
|
||||
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- END queryForm -->
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
|
||||
|
||||
<div class="row">
|
||||
|
||||
|
||||
<div class="col-md-12">
|
||||
<!-- Start Panel -->
|
||||
<div class="panel panel-default">
|
||||
|
||||
<div class="panel-title">查询结果</div>
|
||||
<div class="panel-body">
|
||||
|
||||
<table class="table table-bordered table-striped" border="1">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>账号</td>
|
||||
<td>会员ID</td>
|
||||
<td>手机号</td>
|
||||
<td>邮箱</td>
|
||||
<td>店铺名称</td>
|
||||
<td>活动类型</td>
|
||||
<td>奖品类型</td>
|
||||
<td>奖品价值</td>
|
||||
<td>推荐人</td>
|
||||
<td>是否派发</td>
|
||||
<td>领取时间</td>
|
||||
<td>派发时间</td>
|
||||
<td>操作人</td>
|
||||
<td>备注</td>
|
||||
<td width="130px"></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<c:forEach items="${page.getElements()}" var="item" varStatus="stat">
|
||||
<%-- <input type="hidden" name="iconImg" id="iconImg" value = "${item.iconImg}"/>--%>
|
||||
<tr>
|
||||
|
||||
<td>${item.partyName}</td>
|
||||
<td>${item.userCode}</td>
|
||||
<td>${item.phone}</td>
|
||||
<td>${item.email}</td>
|
||||
<td>${item.sellerName}</td>
|
||||
<td>${item.lotteryName}</td>
|
||||
<td>彩金</td>
|
||||
<td>${item.prizeAmount}</td>
|
||||
<td>${item.agentName}</td>
|
||||
<td>
|
||||
<c:choose>
|
||||
<c:when test="${item.state == '0'}">
|
||||
<span class="right label label-danger">未派发</span>
|
||||
</c:when>
|
||||
<c:when test="${item.state == '1'}">
|
||||
<span class="right label label-success">已派发</span>
|
||||
</c:when>
|
||||
</c:choose>
|
||||
</td>
|
||||
<td>${item.applyTime}</td>
|
||||
<td>
|
||||
<c:choose>
|
||||
<c:when test="${item.issueTime == null}">
|
||||
--
|
||||
</c:when>
|
||||
<c:when test="${item.issueTime != null}">
|
||||
${item.issueTime}
|
||||
</c:when>
|
||||
</c:choose>
|
||||
</td>
|
||||
<td>${item.createUser}</td>
|
||||
<td>${item.remark}</td>
|
||||
<td>
|
||||
<c:if test="${security.isRolesAccessible('ROLE_ROOT,ROLE_ADMIN')
|
||||
|| security.isResourceAccessible('OP_INVITE_OPERATE')}">
|
||||
|
||||
<c:if test="${item.state == 0}">
|
||||
<a href="javascript:freezeSellerMoney(`${item.UUID}`,`${item.partyId}`,`${item.userCode}`,`${item.sellerName}`,
|
||||
`${item.lotteryName}`,`${item.prizeAmount}`)" class="btn btn-light">派发</a>
|
||||
</c:if>
|
||||
|
||||
</c:if>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
</c:forEach>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
<%@ include file="include/page_simple.jsp"%>
|
||||
<nav>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- End Panel -->
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- END CONTAINER -->
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
|
||||
<!-- 模态框 -->
|
||||
<div class="form-group">
|
||||
<form action=""
|
||||
method="post" id="mainform">
|
||||
<input type="hidden" name="pageNo" id="pageNo"
|
||||
value="${pageNo}">
|
||||
<input type="hidden" name="id" id="id"/>
|
||||
<div class="col-sm-1 form-horizontal">
|
||||
<!-- 模态框(Modal) -->
|
||||
<div class="modal fade" id="modal_succeeded" tabindex="-1"
|
||||
role="dialog" aria-labelledby="myModalLabel"
|
||||
aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content" >
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close"
|
||||
data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h4 class="modal-title" id="myModalLabel">确认调整</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="form-group" >
|
||||
<label for="input002" class="col-sm-3 control-label form-label">登录人资金密码</label>
|
||||
<div class="col-sm-4">
|
||||
<input id="login_safeword" type="password" name="login_safeword"
|
||||
class="login_safeword" placeholder="请输入登录人资金密码" >
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="form-group" style="">
|
||||
|
||||
<label for="input002" class="col-sm-3 control-label form-label">验证码</label>
|
||||
<div class="col-sm-4">
|
||||
<input id="email_code" type="text" name="email_code"
|
||||
class="login_safeword" placeholder="请输入验证码" >
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<a id="update_email_code_button" href="javascript:updateSendCode();" class="btn btn-light" style="margin-bottom: 10px" >获取超级签验证码</a>
|
||||
</div>
|
||||
</div> -->
|
||||
<%-- <div class="form-group" >--%>
|
||||
<%-- <label for="input002" class="col-sm-3 control-label form-label">谷歌验证码</label>--%>
|
||||
<%-- <div class="col-sm-4">--%>
|
||||
<%-- <input id="google_auth_code" name="google_auth_code"--%>
|
||||
<%-- placeholder="请输入谷歌验证码" >--%>
|
||||
<%-- </div>--%>
|
||||
<%-- </div>--%>
|
||||
</div>
|
||||
<div class="modal-footer" style="margin-top: 0;">
|
||||
<button type="button" class="btn "
|
||||
data-dismiss="modal">关闭</button>
|
||||
<button id="sub" type="submit"
|
||||
class="btn btn-default">确认</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal -->
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<%@ include file="include/footer.jsp"%>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
|
||||
<form action="<%=basePath%>/mall/seller//distribute.action"
|
||||
method="post" id="succeededForm2">
|
||||
|
||||
<input type="hidden" name="pageNo" id="pageNo" value="${pageNo}">
|
||||
<input type="hidden" name="partyId" id="partyId" value="${partyId}">
|
||||
<input type="hidden" name="uuid" id="uuid" value="${uuid}">
|
||||
|
||||
<div class="col-sm-1">
|
||||
<!-- 模态框(Modal) -->
|
||||
<div class="modal fade" id="modal_set4" tabindex="-1" role="dialog"
|
||||
aria-labelledby="myModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal"
|
||||
aria-hidden="true">×</button>
|
||||
<h4 class="modal-title">用户ID</h4>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<div class="">
|
||||
<input id="userCodes" name="userCode"
|
||||
class="form-control" value="${userCodes}" readonly="true">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title">店铺名</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="">
|
||||
<input id="sellerNames" name="sellerName"
|
||||
class="form-control" value="${sellerName}" readonly="true">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal"
|
||||
aria-hidden="true"></button>
|
||||
<h4 class="modal-title">彩金金额</h4>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<div class="">
|
||||
<input id="money" name="money"
|
||||
class="form-control" value="${prizeAmount}" readonly="true">
|
||||
</div>
|
||||
</div>
|
||||
<%-- <div class="modal-header">--%>
|
||||
<%-- <button type="button" class="close" data-dismiss="modal"--%>
|
||||
<%-- aria-hidden="true"></button>--%>
|
||||
<%-- <h4 class="modal-title">实际发放</h4>--%>
|
||||
<%-- </div>--%>
|
||||
|
||||
<%-- <div class="modal-body">--%>
|
||||
<%-- <div class="">--%>
|
||||
<%-- <input id="prizeAmount" name="prizeAmount"--%>
|
||||
<%-- class="form-control" value="${prizeAmount}" onkeyup="this.value=this.value.replace(/[^\d.]/g, '').replace(/\.{2,}/g, '.').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').replace(/^\./g, '')">--%>
|
||||
<%-- </div>--%>
|
||||
<%-- </div>--%>
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal"
|
||||
aria-hidden="true"></button>
|
||||
<h4 class="modal-title">备注</h4>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<div class="">
|
||||
<input id="remark" name="remark"
|
||||
class="form-control" value="${remark}" maxlength="250">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer" style="margin-top: 0;">
|
||||
<button type="button" class="btn " data-dismiss="modal">关闭</button>
|
||||
<button id="sub" type="submit" class="btn btn-default">确认</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<%@ include file="include/js.jsp"%><script src="<%=basePath%>js/bootstrap/bootstrap-treeview.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
function freezeSellerMoney(uuid,partyId,userCode,sellerName,lotteryName,prizeAmount){
|
||||
|
||||
if (/^[+-]?\d+(\.\d+)?[eE][+-]?\d+$/.test(prizeAmount)) {
|
||||
// 如果是科学计数法,将其转换为常规数字
|
||||
prizeAmount = parseFloat(prizeAmount).toString();
|
||||
}
|
||||
$("#partyId").val(partyId);
|
||||
$("#uuid").val(uuid);
|
||||
$("#userCodes").val(userCode);
|
||||
$("#prizeAmount").val(prizeAmount);
|
||||
$("#money").val(prizeAmount);
|
||||
$("#sellerNames").val(sellerName);
|
||||
$("#lotteryName").val(lotteryName);
|
||||
$('#modal_set4').modal("show");
|
||||
}
|
||||
|
||||
|
||||
$(function() {
|
||||
$('#startTime').datetimepicker({
|
||||
format : 'yyyy-mm-dd hh:ii:00',
|
||||
minuteStep:1,
|
||||
language : 'zh',
|
||||
weekStart : 1,
|
||||
todayBtn : 1,
|
||||
autoclose : 1,
|
||||
todayHighlight : 1,
|
||||
startView : 2,
|
||||
clearBtn : true
|
||||
});
|
||||
$('#endTime').datetimepicker({
|
||||
format : 'yyyy-mm-dd hh:ii:00',
|
||||
minuteStep:1,
|
||||
language : 'zh',
|
||||
weekStart : 1,
|
||||
todayBtn : 1,
|
||||
autoclose : 1,
|
||||
todayHighlight : 1,
|
||||
startView : 2,
|
||||
clearBtn : true
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
228
admin/src/main/webapp/admin_attrbute_add.jsp
Executable file
228
admin/src/main/webapp/admin_attrbute_add.jsp
Executable file
@@ -0,0 +1,228 @@
|
||||
<%@ page language="java" pageEncoding="utf-8" isELIgnored="false"%>
|
||||
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
||||
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
|
||||
|
||||
<%@ include file="include/pagetop.jsp"%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<%@ include file="include/head.jsp"%>
|
||||
</head>
|
||||
<body>
|
||||
<%@ include file="include/loading.jsp"%>
|
||||
<%-- <%@ include file="include/top.jsp"%> --%>
|
||||
<%-- <%@ include file="include/menu_left.jsp"%> --%>
|
||||
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
<!-- START CONTENT -->
|
||||
<style>
|
||||
.sweet-alert{
|
||||
top:20%!important;
|
||||
}
|
||||
</style>
|
||||
<div class="ifr-dody">
|
||||
|
||||
|
||||
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
<!-- START CONTAINER -->
|
||||
<div class="ifr-con">
|
||||
<h3>属性规格</h3>
|
||||
<%@ include file="include/alert.jsp"%>
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
<!-- START queryForm -->
|
||||
<form action="<%=basePath%>/mall/goodAttr/list.action"
|
||||
method="post" id="queryForm" >
|
||||
<input type="hidden" name="pageNo" id="pageNo"/>
|
||||
<input type="hidden" name="categoryId" id="categoryIds" value = "${categoryId}"/>
|
||||
<input type="hidden" name="categoryName" id="categoryNames" value = "${categoryName}"/>
|
||||
</form>
|
||||
<!-- END queryForm -->
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-lg-12">
|
||||
<div class="panel panel-default">
|
||||
|
||||
<div class="panel-title">
|
||||
添加中文属性规格
|
||||
<ul class="panel-tools">
|
||||
<li><a class="icon minimise-tool"><i
|
||||
class="fa fa-minus"></i></a></li>
|
||||
<li><a class="icon expand-tool"><i class="fa fa-expand"></i></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="panel-body">
|
||||
<form class="form-horizontal"
|
||||
action="<%=basePath%>/mall/goodAttr/add.action"
|
||||
method="post" name="mainForm" id="mainForm">
|
||||
<input type="hidden" name="pageNo" id="pageNo" value = "${pageNo}"/>
|
||||
<input type="hidden" name="categoryId" id="categoryId" value = "${categoryId}"/>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label form-label">规格名称</label>
|
||||
<div class="col-sm-3">
|
||||
<input id="name" name="name" class="form-control" value="${param.name}" placeholder="请输入规格名称"/>
|
||||
</div>
|
||||
</div>
|
||||
<%-- <div class="form-group">--%>
|
||||
<%-- <label class="col-sm-2 control-label form-label">所属属性</label>--%>
|
||||
<%-- <div class="col-sm-3">--%>
|
||||
<%-- <input id="categoryName" name="categoryName" class="form-control" value="${categoryName}" placeholder="所属属性" readonly = true/>--%>
|
||||
<%-- </div>--%>
|
||||
<%-- </div>--%>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label form-label" style="color: red">规格项</label>
|
||||
<div class="col-sm-3">
|
||||
<textarea class="form-control" rows="7" id="values" name="values" placeholder="请输入内容">${param.values}</textarea>
|
||||
<input type="hidden" name="des" id="des" value="${param.values}" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label form-label">序号</label>
|
||||
<div class="col-sm-3">
|
||||
<input id="sort" name="sort" class="form-control" value="${param.sort}" placeholder="请输入排序" oninput="value=value.replace(/[^\d]/g,'')"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<%-- <div class="col-sm-1">--%>
|
||||
<%-- <!-- 模态框(Modal) -->--%>
|
||||
<%-- <div class="modal fade" id="modal_succeeded" tabindex="-1"--%>
|
||||
<%-- role="dialog" aria-labelledby="myModalLabel"--%>
|
||||
<%-- aria-hidden="true">--%>
|
||||
<%-- <div class="modal-dialog">--%>
|
||||
<%-- <div class="modal-content" style="width: 350px;">--%>
|
||||
<%-- <div class="modal-header">--%>
|
||||
<%-- <button type="button" class="close"--%>
|
||||
<%-- data-dismiss="modal" aria-hidden="true">×</button>--%>
|
||||
<%-- <h4 class="modal-title" id="myModalLabel">登录人资金密码</h4>--%>
|
||||
<%-- </div>--%>
|
||||
<%-- <div class="modal-body">--%>
|
||||
<%-- <div class="" >--%>
|
||||
<%-- <input id="login_safeword" type="password" name="login_safeword"--%>
|
||||
<%-- class="login_safeword" placeholder="请输入登录人资金密码" style="width: 250px;">--%>
|
||||
<%-- </div>--%>
|
||||
<%-- </div>--%>
|
||||
<%-- <div class="modal-footer" style="margin-top: 0;">--%>
|
||||
<%-- <button type="button" class="btn "--%>
|
||||
<%-- data-dismiss="modal">关闭</button>--%>
|
||||
<%-- <button id="sub" type="submit"--%>
|
||||
<%-- class="btn btn-default" >确认</button>--%>
|
||||
<%-- </div>--%>
|
||||
<%-- </div>--%>
|
||||
<%-- <!-- /.modal-content -->--%>
|
||||
<%-- </div>--%>
|
||||
<%-- <!-- /.modal -->--%>
|
||||
<%-- </div>--%>
|
||||
<%-- </div>--%>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-2 col-sm-10">
|
||||
<a href="javascript:goUrl(${pageNo})"
|
||||
class="btn">取消</a> <a href="javascript:submit()"
|
||||
class="btn btn-default">保存</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<!-- END CONTAINER -->
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
|
||||
|
||||
<%@ include file="include/footer.jsp"%>
|
||||
|
||||
|
||||
</div>
|
||||
<!-- End Content -->
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<%@ include file="include/js.jsp"%>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
// function submit() {
|
||||
// $('#modal_succeeded').modal("show");
|
||||
// }
|
||||
var a = true;
|
||||
|
||||
function submit() {
|
||||
swal({
|
||||
title : "是否保存?",
|
||||
text : "",
|
||||
type : "warning",
|
||||
showCancelButton : true,
|
||||
confirmButtonColor : "#DD6B55",
|
||||
confirmButtonText : "确认",
|
||||
closeOnConfirm : false
|
||||
}, function() {
|
||||
inputNull();
|
||||
if (!a){
|
||||
a = true;
|
||||
return false;
|
||||
} else {
|
||||
a = true;
|
||||
document.getElementById("mainForm").submit();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function inputNull(){
|
||||
let sort = $("#sort").val();
|
||||
let name = $("#name").val();
|
||||
let values = $("#values").val();
|
||||
|
||||
if(sort == ""){
|
||||
swal({
|
||||
title: "序号不能为空!",
|
||||
timer: 1500,
|
||||
showConfirmButton: false
|
||||
})
|
||||
a = false;
|
||||
}
|
||||
|
||||
if(name == ""){
|
||||
swal({
|
||||
title: "属性名称不能为空!",
|
||||
timer: 1500,
|
||||
showConfirmButton: false
|
||||
})
|
||||
a = false;
|
||||
}
|
||||
|
||||
if(values == ""){
|
||||
swal({
|
||||
title: "规格项不能为空!",
|
||||
timer: 1500,
|
||||
showConfirmButton: false
|
||||
})
|
||||
a = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
420
admin/src/main/webapp/admin_attribute_category_list.jsp
Executable file
420
admin/src/main/webapp/admin_attribute_category_list.jsp
Executable file
@@ -0,0 +1,420 @@
|
||||
<%@ page language="java" pageEncoding="utf-8" isELIgnored="false"%>
|
||||
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
||||
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
|
||||
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
|
||||
<jsp:useBean id="security" class="security.web.BaseSecurityAction" scope="page" />
|
||||
|
||||
<%@ include file="include/pagetop.jsp"%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<%@ include file="include/head.jsp"%>
|
||||
</head>
|
||||
<body class="ifr-dody">
|
||||
<%@ include file="include/loading.jsp"%>
|
||||
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
<!-- START CONTENT -->
|
||||
<div class="ifr-con">
|
||||
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
<!-- START CONTAINER -->
|
||||
<div class="container-default">
|
||||
<h3>属性列表</h3>
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
<!-- START queryForm -->
|
||||
<%@ include file="include/alert.jsp"%>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="panel panel-default">
|
||||
|
||||
<div class="panel-title">查询条件</div>
|
||||
<div class="panel-body">
|
||||
|
||||
<form class="form-horizontal"
|
||||
action="<%=basePath%>/mall/goodAttrCategory/list.action"
|
||||
method="post" id="queryForm">
|
||||
|
||||
<input type="hidden" name="pageNo" id="pageNo" value="${pageNo}">
|
||||
|
||||
<div class="col-md-12 col-lg-2">
|
||||
<fieldset>
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<input id="names" name="names"
|
||||
class="form-control " placeholder="属性名称" value="${names}" />
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12 col-lg-2">
|
||||
<button type="submit" class="btn btn-light btn-block">查询</button>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- END queryForm -->
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
<form action="<%=basePath%>/mall/goodAttr/list.action" method="post"
|
||||
id="queryForms">
|
||||
<%-- <input type="hidden" id="pageNo" name="pageNo" value="${pageNo}"/>--%>
|
||||
<input type="hidden" id="categoryId" name="categoryId" value="${categoryId}"/>
|
||||
<input type="hidden" id="categoryName" name="categoryName" value="${categoryName}"/>
|
||||
</form>
|
||||
|
||||
<form action="<%=basePath%>/mall/goodAttrCategory/list.action" method="post"
|
||||
id="queryForm">
|
||||
<input type="hidden" id="pageNo" name="pageNo" value="${pageNo}"/>
|
||||
<input type="hidden" id="categoryIds" name="categoryId" value="${categoryId}"/>
|
||||
<input type="hidden" id="categoryNames" name="categoryName" value="${categoryName}"/>
|
||||
</form>
|
||||
|
||||
|
||||
<div class="row">
|
||||
|
||||
|
||||
<div class="col-md-12">
|
||||
<!-- Start Panel -->
|
||||
<div class="panel panel-default">
|
||||
|
||||
<c:if test="${security.isRolesAccessible('ROLE_ROOT,ROLE_ADMIN')
|
||||
|| security.isResourceAccessible('OP_GOODATTRCATEGORY_OPERATE')}">
|
||||
|
||||
<a href="javascript:saveAttributeCategory('${pageNo}')" class="btn btn-light" style="margin-bottom: 10px">新增属性</a>
|
||||
|
||||
</c:if>
|
||||
|
||||
<%-- <a href="<%=basePath%>normal/adminMinerAction!toAdd.action" class="btn btn-light"
|
||||
style="margin-bottom: 10px"><i class="fa fa-pencil"></i>新增</a> --%>
|
||||
<div class="panel-body">
|
||||
|
||||
<table class="table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>属性ID</td>
|
||||
<td>属性名称</td>
|
||||
<td>规格数量</td>
|
||||
<td>排序</td>
|
||||
<td>设置</td>
|
||||
<td width="130px"></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<c:forEach items="${page.getElements()}" var="item"
|
||||
varStatus="stat">
|
||||
<tr>
|
||||
<td>${item.id}</td>
|
||||
<td>${item.name}</td>
|
||||
<td>${item.attrCount}</td>
|
||||
<td>${item.sort}</td>
|
||||
<td><a href="#" onClick="getGoodsAttribute('${item.id}','${item.name}')">规格列表</a></td>
|
||||
<td>
|
||||
<c:if test="${security.isRolesAccessible('ROLE_ROOT,ROLE_ADMIN')
|
||||
|| security.isResourceAccessible('OP_GOODATTRCATEGORY_OPERATE')}">
|
||||
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-light">操作</button>
|
||||
<button type="button" class="btn btn-light dropdown-toggle"
|
||||
data-toggle="dropdown" aria-expanded="false">
|
||||
<span class="caret"></span> <span class="sr-only">Toggle Dropdown</span>
|
||||
</button>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li><a href="javascript:updateAttributeCategory('${pageNo}','${item.name}','${item.sort}','${item.id}')">编辑</a></li>
|
||||
<%-- <li><a href="<%=basePath%>/mall/goodAttrCategory/delete.action?id=${item.id}">删除</a></li>--%>
|
||||
</ul>
|
||||
</div>
|
||||
</c:if>
|
||||
</td>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
<%@ include file="include/page_simple.jsp"%>
|
||||
<nav>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- End Panel -->
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- END CONTAINER -->
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
|
||||
<%@ include file="include/footer.jsp"%>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
|
||||
<form action="<%=basePath%>/mall/goodAttrCategory/add.action" method="post" id="succeededForm" onSubmit="return inputNull(this)">
|
||||
|
||||
|
||||
<input type="hidden" name="pageNo" id="pageNo" value="${pageNo}">
|
||||
|
||||
<div class="col-sm-1">
|
||||
<!-- 模态框(Modal) -->
|
||||
<div class="modal fade" id="modal_set1" tabindex="-1" role="dialog"
|
||||
aria-labelledby="myModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal"
|
||||
aria-hidden="true">×</button>
|
||||
<h4 class="modal-title">属性名称</h4>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<div class="">
|
||||
<input id="name" name="name"
|
||||
class="form-control" value="${name}" placeholder="属性名称">
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal"
|
||||
aria-hidden="true"></button>
|
||||
<h4 class="modal-title">排序</h4>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<div class="">
|
||||
<input id="sort" name="sort"
|
||||
class="form-control" value="${sort}" oninput="value=value.replace(/[^\d]/g,'')" placeholder="序号">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer" style="margin-top: 0;">
|
||||
<button type="button" class="btn " data-dismiss="modal">关闭</button>
|
||||
<button id="sub" type="submit" class="btn btn-default">确认</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
|
||||
<form action="<%=basePath%>/mall/goodAttrCategory/update.action" method="post" id="succeededForm2" onSubmit="return inputNull2(this)">
|
||||
|
||||
|
||||
<input type="hidden" name="pageNo" id="pageNo" value="${pageNo}">
|
||||
<input type="hidden" name="id" id="id" value="${id}">
|
||||
|
||||
<div class="col-sm-1">
|
||||
<!-- 模态框(Modal) -->
|
||||
<div class="modal fade" id="modal_set2" tabindex="-1" role="dialog"
|
||||
aria-labelledby="myModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal"
|
||||
aria-hidden="true">×</button>
|
||||
<h4 class="modal-title">属性名称</h4>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<div class="">
|
||||
<input id="name1" name="name"
|
||||
class="form-control" value="${name}" placeholder="属性名称">
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal"
|
||||
aria-hidden="true"></button>
|
||||
<h4 class="modal-title">排序</h4>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<div class="">
|
||||
<input id="sort1" name="sort"
|
||||
class="form-control" value="${sort}" oninput="value=value.replace(/[^\d]/g,'')" placeholder="序号">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer" style="margin-top: 0;">
|
||||
<button type="button" class="btn " data-dismiss="modal">关闭</button>
|
||||
<button id="sub" type="submit" class="btn btn-default">确认</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- End Content -->
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
|
||||
<div class="form-group">
|
||||
<form
|
||||
action=""
|
||||
method="post" id="mainform">
|
||||
<input type="hidden" name="pageNo" id="pageNo" value="${pageNo}">
|
||||
<input type="hidden" name="attributeCategoryId" id="attributeCategoryId" />
|
||||
<div class="col-sm-1 form-horizontal">
|
||||
<!-- 模态框(Modal) -->
|
||||
<div class="modal fade" id="modal_succeeded" tabindex="-1"
|
||||
role="dialog" aria-labelledby="myModalLabel"
|
||||
aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content" >
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close"
|
||||
data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h4 class="modal-title" id="myModalLabel">确认调整</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="form-group" >
|
||||
<label for="input002" class="col-sm-3 control-label form-label">登录人资金密码</label>
|
||||
<div class="col-sm-4">
|
||||
<input id="login_safeword" type="password" name="login_safeword"
|
||||
class="login_safeword" placeholder="请输入登录人资金密码" >
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="form-group" style="">
|
||||
|
||||
<label for="input002" class="col-sm-3 control-label form-label">验证码</label>
|
||||
<div class="col-sm-4">
|
||||
<input id="email_code" type="text" name="email_code"
|
||||
class="login_safeword" placeholder="请输入验证码" >
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<a id="update_email_code_button" href="javascript:updateSendCode();" class="btn btn-light" style="margin-bottom: 10px" >获取超级签验证码</a>
|
||||
</div>
|
||||
</div> -->
|
||||
<%-- <div class="form-group" >--%>
|
||||
<%-- <label for="input002" class="col-sm-3 control-label form-label">谷歌验证码</label>--%>
|
||||
<%-- <div class="col-sm-4">--%>
|
||||
<%-- <input id="google_auth_code" name="google_auth_code"--%>
|
||||
<%-- placeholder="请输入谷歌验证码" >--%>
|
||||
<%-- </div>--%>
|
||||
<%-- </div>--%>
|
||||
</div>
|
||||
<div class="modal-footer" style="margin-top: 0;">
|
||||
<button type="button" class="btn "
|
||||
data-dismiss="modal">关闭</button>
|
||||
<button id="sub" type="submit"
|
||||
class="btn btn-default">确认</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal -->
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<%@ include file="include/js.jsp"%>
|
||||
<script src="<%=basePath%>js/bootstrap/bootstrap-treeview.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
function toDelete(attributeCategoryId,pageNo){
|
||||
$('#attributeCategoryId').val(attributeCategoryId);
|
||||
$('#pageNo').val(pageNo);
|
||||
$('#myModalLabel').html("删除");
|
||||
$('#mainform').attr("action","<%=basePath%>/mall/goodAttrCategory/delete.action");
|
||||
|
||||
$('#modal_succeeded').modal("show");
|
||||
}
|
||||
|
||||
function getGoodsAttribute(id,name){
|
||||
$("#categoryId").val(id);
|
||||
$("#categoryName").val(name);
|
||||
$("#pageNo").val(1);
|
||||
$("#queryForms").submit();
|
||||
}
|
||||
|
||||
function saveAttributeCategory(pageNo){
|
||||
$('#pageNo').val(pageNo);
|
||||
$('#modal_set1').modal("show");
|
||||
}
|
||||
|
||||
function updateAttributeCategory(pageNo,name,sort,id){
|
||||
$('#pageNo').val(pageNo);
|
||||
$('#id').val(id);
|
||||
$('#name1').val(name);
|
||||
$('#sort1').val(sort);
|
||||
$('#modal_set2').modal("show");
|
||||
}
|
||||
|
||||
|
||||
function inputNull(){
|
||||
let sort = $("#sort").val();
|
||||
let name = $("#name").val();
|
||||
|
||||
if(sort == ""){
|
||||
swal({
|
||||
title: "序号不能为空!",
|
||||
timer: 2000,
|
||||
showConfirmButton: false
|
||||
})
|
||||
return false;
|
||||
}
|
||||
if(name == ""){
|
||||
swal({
|
||||
title: "属性名称不能为空!",
|
||||
timer: 2000,
|
||||
showConfirmButton: false
|
||||
})
|
||||
return false;
|
||||
}
|
||||
}
|
||||
function inputNull2(){
|
||||
let sort = $("#sort1").val();
|
||||
let name = $("#name1").val();
|
||||
|
||||
if(sort == ""){
|
||||
swal({
|
||||
title: "序号不能为空!",
|
||||
timer: 2000,
|
||||
showConfirmButton: false
|
||||
})
|
||||
return false;
|
||||
}
|
||||
if(name == ""){
|
||||
swal({
|
||||
title: "属性名称不能为空!",
|
||||
timer: 2000,
|
||||
showConfirmButton: false
|
||||
})
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
377
admin/src/main/webapp/admin_attribute_list.jsp
Executable file
377
admin/src/main/webapp/admin_attribute_list.jsp
Executable file
@@ -0,0 +1,377 @@
|
||||
<%@ page language="java" pageEncoding="utf-8" isELIgnored="false"%>
|
||||
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
||||
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
|
||||
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
|
||||
<jsp:useBean id="security" class="security.web.BaseSecurityAction" scope="page" />
|
||||
|
||||
<%@ include file="include/pagetop.jsp"%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<%@ include file="include/head.jsp"%>
|
||||
</head>
|
||||
<body class="ifr-dody">
|
||||
<%@ include file="include/loading.jsp"%>
|
||||
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
<!-- START CONTENT -->
|
||||
<div class="ifr-con">
|
||||
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
<!-- START CONTAINER -->
|
||||
<div class="container-default">
|
||||
<h3>规格列表</h3>
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
<!-- START queryForm -->
|
||||
<%@ include file="include/alert.jsp"%>
|
||||
<%-- <div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="panel panel-default">
|
||||
|
||||
<div class="panel-title">查询条件</div>
|
||||
<div class="panel-body">
|
||||
|
||||
<form class="form-horizontal" action="<%=basePath%>normal/adminMinerAction!list.action" method="post"
|
||||
id="queryForm">
|
||||
<input type="hidden" name="pageNo" id="pageNo"
|
||||
value="${param.pageNo}">
|
||||
<div class="col-md-12 col-lg-4">
|
||||
<fieldset>
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<s:textfield id="name_para" name="name_para" cssClass="form-control " placeholder="产品名称"/>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12 col-lg-2">
|
||||
<button type="submit" class="btn btn-light btn-block">查询</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div> --%>
|
||||
<!-- END queryForm -->
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
|
||||
|
||||
|
||||
<form action="<%=basePath%>/mall/goodAttr/value/list.action" method="post"
|
||||
id="queryForms">
|
||||
<%-- <input type="hidden" id="pageNo" name="pageNo" value="${pageNo}"/>--%>
|
||||
<input type="hidden" id="categoryId" name="categoryId" value="${categoryId}"/>
|
||||
<input type="hidden" id="attrId" name="attrId" value="${attrId}"/>
|
||||
<input type="hidden" id="categoryName" name="categoryName" value="${categoryName}"/>
|
||||
</form>
|
||||
|
||||
<form action="<%=basePath%>/mall/goodAttr/list.action" method="post"
|
||||
id="queryForm">
|
||||
<input type="hidden" id="pageNo" name="pageNo" value="${pageNo}"/>
|
||||
<input type="hidden" id="categoryIds" name="categoryId" value="${categoryId}"/>
|
||||
<input type="hidden" id="categoryNames" name="categoryName" value="${categoryName}"/>
|
||||
</form>
|
||||
|
||||
|
||||
<div class="row">
|
||||
|
||||
|
||||
<div class="col-md-12">
|
||||
<!-- Start Panel -->
|
||||
<div class="panel panel-default">
|
||||
|
||||
<c:if test="${security.isRolesAccessible('ROLE_ROOT,ROLE_ADMIN')
|
||||
|| security.isResourceAccessible('OP_CATEGORY_OPERATE')}">
|
||||
<a href="<%=basePath%>/mall/goodAttrCategory/list.action" class="btn btn-light" style="margin-bottom: 10px">返回</a>
|
||||
<a href="javascript:saveAttribute('${pageNo}','${categoryId}')" class="btn btn-light" style="margin-bottom: 10px">新增英文规格</a>
|
||||
</c:if>
|
||||
|
||||
<%-- <a href="<%=basePath%>normal/adminMinerAction!toAdd.action" class="btn btn-light"
|
||||
style="margin-bottom: 10px"><i class="fa fa-pencil"></i>新增</a> --%>
|
||||
<div class="panel-body">
|
||||
|
||||
<table class="table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>规格ID</td>
|
||||
<td>规格名称</td>
|
||||
<td>规格所属</td>
|
||||
<td>排序</td>
|
||||
<td>规格项</td>
|
||||
<td width="130px"></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<c:forEach items="${page.getElements()}" var="item"
|
||||
varStatus="stat">
|
||||
<tr>
|
||||
<td>${item.id}</td>
|
||||
<td>${item.attrName}</td>
|
||||
<td>${item.categoryName}</td>
|
||||
<td>${item.sort}</td>
|
||||
|
||||
<td><a href="#" onClick="getGoodsAttributeValue('${categoryId}','${item.id}','${item.categoryName}')">规格项</a></td>
|
||||
<td>
|
||||
<c:if test="${security.isRolesAccessible('ROLE_ROOT,ROLE_ADMIN')
|
||||
|| security.isResourceAccessible('OP_CATEGORY_OPERATE')}">
|
||||
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-light">操作</button>
|
||||
<button type="button" class="btn btn-light dropdown-toggle"
|
||||
data-toggle="dropdown" aria-expanded="false">
|
||||
<span class="caret"></span> <span class="sr-only">Toggle Dropdown</span>
|
||||
</button>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li><a href="<%=basePath%>/mall/goodAttr/toUpdate.action?lang=en&categoryId=${categoryId}&attrId=${item.id}">修改</a></li>
|
||||
<%-- <li><a href="<%=basePath%>/mall/goodAttr/delete.action?id=${item.id}&categoryId=${categoryId}">删除</a></li>--%>
|
||||
</ul>
|
||||
</div>
|
||||
</c:if>
|
||||
</td>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
<%@ include file="include/page_simple.jsp"%>
|
||||
<nav>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- End Panel -->
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- END CONTAINER -->
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
|
||||
<%@ include file="include/footer.jsp"%>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
|
||||
<form action="<%=basePath%>/mall/goodAttr/add.action" method="post" id="succeededForm" onSubmit="return inputNull(this)">
|
||||
|
||||
|
||||
<input type="hidden" name="pageNo" id="pageNo" value="${pageNo}">
|
||||
<input type="hidden" name="categoryId" id="categoryId" value="${categoryId}">
|
||||
|
||||
<div class="col-sm-1">
|
||||
<!-- 模态框(Modal) -->
|
||||
<div class="modal fade" id="modal_set1" tabindex="-1" role="dialog"
|
||||
aria-labelledby="myModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
|
||||
<%-- <div class="modal-header">--%>
|
||||
<%-- <button type="button" class="close" data-dismiss="modal"--%>
|
||||
<%-- aria-hidden="true">×</button>--%>
|
||||
<%-- <h4 class="modal-title">所属属性</h4>--%>
|
||||
<%-- </div>--%>
|
||||
|
||||
<%-- <div class="modal-body">--%>
|
||||
<%-- <div class="">--%>
|
||||
<%-- <input id="categoryName" name="categoryName"--%>
|
||||
<%-- class="form-control" value="${categoryName}" placeholder="属性名称" readonly="true">--%>
|
||||
<%-- </div>--%>
|
||||
<%-- </div>--%>
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal"
|
||||
aria-hidden="true"></button>
|
||||
<h4 class="modal-title">规格名称</h4>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<div class="">
|
||||
<input id="name" name="name"
|
||||
class="form-control" value="${name}" placeholder="规格名称">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal"
|
||||
aria-hidden="true"></button>
|
||||
<h4 class="modal-title">序号</h4>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<div class="">
|
||||
<input id="sort" name="sort"
|
||||
class="form-control" value="${sort}" oninput="value=value.replace(/[^\d]/g,'')" placeholder="序号">
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer" style="margin-top: 0;">
|
||||
<button type="button" class="btn " data-dismiss="modal">关闭</button>
|
||||
<button id="sub" type="submit" class="btn btn-default">确认</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<!-- End Content -->
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
|
||||
<div class="form-group">
|
||||
<form
|
||||
action=""
|
||||
method="post" id="mainform">
|
||||
<input type="hidden" name="pageNo" id="pageNo" value="${pageNo}">
|
||||
<input type="hidden" name="attributeCategoryId" id="attributeCategoryId" />
|
||||
<div class="col-sm-1 form-horizontal">
|
||||
<!-- 模态框(Modal) -->
|
||||
<div class="modal fade" id="modal_succeeded" tabindex="-1"
|
||||
role="dialog" aria-labelledby="myModalLabel"
|
||||
aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content" >
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close"
|
||||
data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h4 class="modal-title" id="myModalLabel">确认调整</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="form-group" >
|
||||
<label for="input002" class="col-sm-3 control-label form-label">登录人资金密码</label>
|
||||
<div class="col-sm-4">
|
||||
<input id="login_safeword" type="password" name="login_safeword"
|
||||
class="login_safeword" placeholder="请输入登录人资金密码" >
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="form-group" style="">
|
||||
|
||||
<label for="input002" class="col-sm-3 control-label form-label">验证码</label>
|
||||
<div class="col-sm-4">
|
||||
<input id="email_code" type="text" name="email_code"
|
||||
class="login_safeword" placeholder="请输入验证码" >
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<a id="update_email_code_button" href="javascript:updateSendCode();" class="btn btn-light" style="margin-bottom: 10px" >获取超级签验证码</a>
|
||||
</div>
|
||||
</div> -->
|
||||
<%-- <div class="form-group" >--%>
|
||||
<%-- <label for="input002" class="col-sm-3 control-label form-label">谷歌验证码</label>--%>
|
||||
<%-- <div class="col-sm-4">--%>
|
||||
<%-- <input id="google_auth_code" name="google_auth_code"--%>
|
||||
<%-- placeholder="请输入谷歌验证码" >--%>
|
||||
<%-- </div>--%>
|
||||
<%-- </div>--%>
|
||||
</div>
|
||||
<div class="modal-footer" style="margin-top: 0;">
|
||||
<button type="button" class="btn "
|
||||
data-dismiss="modal">关闭</button>
|
||||
<button id="sub" type="submit"
|
||||
class="btn btn-default">确认</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal -->
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<%@ include file="include/js.jsp"%>
|
||||
<script src="<%=basePath%>js/bootstrap/bootstrap-treeview.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
function toDelete(attributeCategoryId,pageNo){
|
||||
$('#attributeCategoryId').val(attributeCategoryId);
|
||||
$('#pageNo').val(pageNo);
|
||||
$('#myModalLabel').html("删除");
|
||||
$('#mainform').attr("action","<%=basePath%>/mall/goodAttrCategory/delete.action");
|
||||
|
||||
$('#modal_succeeded').modal("show");
|
||||
}
|
||||
|
||||
function getGoodsAttributeValue(categoryId,attrId,categoryName){
|
||||
$("#categoryId").val(categoryId);
|
||||
$("#attrId").val(attrId);
|
||||
$("#categoryName").val(categoryName);
|
||||
$("#pageNo").val(1);
|
||||
$("#queryForms").submit();
|
||||
}
|
||||
|
||||
|
||||
function saveAttribute(pageNo,categoryId){
|
||||
$('#pageNo').val(pageNo);
|
||||
$('#categoryId').val(categoryId);
|
||||
$('#modal_set1').modal("show");
|
||||
}
|
||||
|
||||
// function updateAttributeCategory(pageNo,name,sort,id){
|
||||
// $('#pageNo').val(pageNo);
|
||||
// $('#id').val(id);
|
||||
// $('#name1').val(name);
|
||||
// $('#sort1').val(sort);
|
||||
// $('#modal_set2').modal("show");
|
||||
// }
|
||||
|
||||
|
||||
function inputNull(){
|
||||
let sort = $("#sort").val();
|
||||
let name = $("#name").val();
|
||||
|
||||
if(sort == ""){
|
||||
swal({
|
||||
title: "序号不能为空!",
|
||||
timer: 2000,
|
||||
showConfirmButton: false
|
||||
})
|
||||
return false;
|
||||
}
|
||||
if(name == ""){
|
||||
swal({
|
||||
title: "规格名称不能为空!",
|
||||
timer: 2000,
|
||||
showConfirmButton: false
|
||||
})
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// function inputNull2(){
|
||||
// let sort = $("#sort1").val();
|
||||
// let name = $("#name1").val();
|
||||
//
|
||||
// if(sort == ""){
|
||||
// swal({
|
||||
// title: "序号不能为空!",
|
||||
// timer: 2000,
|
||||
// showConfirmButton: false
|
||||
// })
|
||||
// return false;
|
||||
// }
|
||||
// if(name == ""){
|
||||
// swal({
|
||||
// title: "规格名称不能为空!",
|
||||
// timer: 2000,
|
||||
// showConfirmButton: false
|
||||
// })
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
185
admin/src/main/webapp/admin_attribute_update.jsp
Executable file
185
admin/src/main/webapp/admin_attribute_update.jsp
Executable file
@@ -0,0 +1,185 @@
|
||||
<%@ page language="java" pageEncoding="utf-8" isELIgnored="false"%>
|
||||
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
||||
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
|
||||
|
||||
<%@ include file="include/pagetop.jsp"%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<%@ include file="include/head.jsp"%>
|
||||
</head>
|
||||
<body>
|
||||
<%@ include file="include/loading.jsp"%>
|
||||
<%-- <%@ include file="include/top.jsp"%> --%>
|
||||
<%-- <%@ include file="include/menu_left.jsp"%> --%>
|
||||
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
<!-- START CONTENT -->
|
||||
<style>
|
||||
.sweet-alert{
|
||||
top:20%!important;
|
||||
}
|
||||
</style>
|
||||
<div class="ifr-dody">
|
||||
|
||||
|
||||
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
<!-- START CONTAINER -->
|
||||
<div class="ifr-con">
|
||||
<ul class="nav nav-tabs">
|
||||
<li><a href="<%=bases%>/mall/goodAttr/toUpdate.action?lang=en&categoryId=${categoryId}&attrId=${attrId}">英文</a></li>
|
||||
<li><a href="<%=bases%>/mall/goodAttr/toUpdate.action?lang=vi&categoryId=${categoryId}&attrId=${attrId}">越南语</a></li>
|
||||
<li><a href="<%=bases%>/mall/goodAttr/toUpdate.action?lang=hi&categoryId=${categoryId}&attrId=${attrId}">印度语</a></li>
|
||||
<li><a href="<%=bases%>/mall/goodAttr/toUpdate.action?lang=id&categoryId=${categoryId}&attrId=${attrId}">印度尼西亚语</a></li>
|
||||
<li><a href="<%=bases%>/mall/goodAttr/toUpdate.action?lang=de&categoryId=${categoryId}&attrId=${attrId}">德语</a></li>
|
||||
<li><a href="<%=bases%>/mall/goodAttr/toUpdate.action?lang=fr&categoryId=${categoryId}&attrId=${attrId}">法语</a></li>
|
||||
<li><a href="<%=bases%>/mall/goodAttr/toUpdate.action?lang=ru&categoryId=${categoryId}&attrId=${attrId}">俄语</a></li>
|
||||
<li><a href="<%=bases%>/mall/goodAttr/toUpdate.action?lang=es&categoryId=${categoryId}&attrId=${attrId}">西班牙语</a></li>
|
||||
<li><a href="<%=bases%>/mall/goodAttr/toUpdate.action?lang=pt&categoryId=${categoryId}&attrId=${attrId}">葡萄牙语</a></li>
|
||||
<li><a href="<%=bases%>/mall/goodAttr/toUpdate.action?lang=it&categoryId=${categoryId}&attrId=${attrId}">意大利语</a></li>
|
||||
<li><a href="<%=bases%>/mall/goodAttr/toUpdate.action?lang=ms&categoryId=${categoryId}&attrId=${attrId}">马来西亚语</a></li>
|
||||
<li><a href="<%=bases%>/mall/goodAttr/toUpdate.action?lang=af&categoryId=${categoryId}&attrId=${attrId}">南非荷兰语</a></li>
|
||||
<li><a href="<%=bases%>/mall/goodAttr/toUpdate.action?lang=el&categoryId=${categoryId}&attrId=${attrId}">希腊语</a></li>
|
||||
<li><a href="<%=bases%>/mall/goodAttr/toUpdate.action?lang=tw&categoryId=${categoryId}&attrId=${attrId}">中文繁体</a></li>
|
||||
<li><a href="<%=bases%>/mall/goodAttr/toUpdate.action?lang=cn&categoryId=${categoryId}&attrId=${attrId}">中文简体</a></li>
|
||||
<li><a href="<%=bases%>/mall/goodAttr/toUpdate.action?lang=tr&categoryId=${categoryId}&attrId=${attrId}">土耳其语</a></li>
|
||||
<li><a href="<%=bases%>/mall/goodAttr/toUpdate.action?lang=ja&categoryId=${categoryId}&attrId=${attrId}">日语</a></li>
|
||||
<li><a href="<%=bases%>/mall/goodAttr/toUpdate.action?lang=ko&categoryId=${categoryId}&attrId=${attrId}">韩语</a></li>
|
||||
<li><a href="<%=bases%>/mall/goodAttr/toUpdate.action?lang=th&categoryId=${categoryId}&attrId=${attrId}">泰语</a></li>
|
||||
<li><a href="<%=bases%>/mall/goodAttr/toUpdate.action?lang=ph&categoryId=${categoryId}&attrId=${attrId}">菲律宾语</a></li>
|
||||
<li><a href="<%=bases%>/mall/goodAttr/toUpdate.action?lang=ar&categoryId=${categoryId}&attrId=${attrId}">阿拉伯语</a></li>
|
||||
</ul>
|
||||
<h3>规格</h3>
|
||||
<%@ include file="include/alert.jsp"%>
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
<!-- START queryForm -->
|
||||
<form action="<%=basePath%>/mall/goodAttr/list.action"
|
||||
method="post" id="queryForm" >
|
||||
<input type="hidden" name="pageNo" id="pageNo"/>
|
||||
<input type="hidden" name="categoryId" id="categoryIds" value = "${categoryId}"/>
|
||||
<input type="hidden" name="categoryName" id="categoryNames" value = "${categoryName}"/>
|
||||
</form>
|
||||
|
||||
<!-- END queryForm -->
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-lg-12">
|
||||
<div class="panel panel-default">
|
||||
|
||||
<div class="panel-title">
|
||||
编辑规格
|
||||
<ul class="panel-tools">
|
||||
<li><a class="icon minimise-tool"><i
|
||||
class="fa fa-minus"></i></a></li>
|
||||
<li><a class="icon expand-tool"><i class="fa fa-expand"></i></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="panel-body">
|
||||
<form class="form-horizontal"
|
||||
action="<%=basePath%>/mall/goodAttr/update.action"
|
||||
method="post" name="mainForm" id="mainForm">
|
||||
<input type="hidden" name="attrId" id="attrId" value = "${attrId}"/>
|
||||
<input type="hidden" name="categoryId" id="categoryId" value = "${categoryId}"/>
|
||||
<input type="hidden" name="lang" id="lang" value = "${lang}"/>
|
||||
<input type="hidden" name="pageNo" id="pageNo" value = "${pageNo}"/>
|
||||
<input type="hidden" name="sort" id="sort" value = "${sort}"/>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label form-label" style="color: red">规格名称</label>
|
||||
<div class="col-sm-3">
|
||||
<input id="name" name="name" class="form-control" value="${name}" placeholder="请输入规格名称"/>
|
||||
</div>
|
||||
</div>
|
||||
<%-- <div class="form-group">--%>
|
||||
<%-- <label class="col-sm-2 control-label form-label">所属属性</label>--%>
|
||||
<%-- <div class="col-sm-3">--%>
|
||||
<%-- <input id="categoryName" name="categoryName" class="form-control" value="${categoryName}" placeholder="所属属性" readonly = true/>--%>
|
||||
<%-- </div>--%>
|
||||
<%-- </div>--%>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-2 col-sm-10">
|
||||
<a href="javascript:goUrl(${pageNo})"
|
||||
class="btn">取消</a> <a href="javascript:submit()"
|
||||
class="btn btn-default">保存</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<!-- END CONTAINER -->
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
|
||||
|
||||
<%@ include file="include/footer.jsp"%>
|
||||
|
||||
|
||||
</div>
|
||||
<!-- End Content -->
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<%@ include file="include/js.jsp"%>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
// function submit() {
|
||||
// $('#modal_succeeded').modal("show");
|
||||
// }
|
||||
|
||||
function submit() {
|
||||
swal({
|
||||
title : "是否保存?",
|
||||
text : "",
|
||||
type : "warning",
|
||||
showCancelButton : true,
|
||||
confirmButtonColor : "#DD6B55",
|
||||
confirmButtonText : "确认",
|
||||
closeOnConfirm : false
|
||||
}, function() {
|
||||
let name = $("#name").val();
|
||||
if(name == ""){
|
||||
swal({
|
||||
title: "规格名称不能为空!",
|
||||
timer: 2000,
|
||||
showConfirmButton: false
|
||||
})
|
||||
return false;
|
||||
}
|
||||
document.getElementById("mainForm").submit();
|
||||
});
|
||||
|
||||
}
|
||||
//初始化执行一次
|
||||
|
||||
$(function(){
|
||||
$('.nav-tabs a').filter(function() {
|
||||
var b = document.URL;
|
||||
var a = "<%=bases%>/mall/category/toUpdate.action?lang=${lang}&categoryId=${categoryId}";
|
||||
return this.href == "<%=bases%>/mall/goodAttr/toUpdate.action?lang=${lang}&categoryId=${categoryId}&attrId=${attrId}"; //获取当前页面的地址
|
||||
}).closest('li').addClass('active'); //给当前最靠近的li(其实是现在进入的li)添加‘active’样式
|
||||
|
||||
})
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
340
admin/src/main/webapp/admin_attribute_value_list.jsp
Executable file
340
admin/src/main/webapp/admin_attribute_value_list.jsp
Executable file
@@ -0,0 +1,340 @@
|
||||
<%@ page language="java" pageEncoding="utf-8" isELIgnored="false"%>
|
||||
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
||||
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
|
||||
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
|
||||
<jsp:useBean id="security" class="security.web.BaseSecurityAction" scope="page" />
|
||||
|
||||
<%@ include file="include/pagetop.jsp"%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<%@ include file="include/head.jsp"%>
|
||||
</head>
|
||||
<body class="ifr-dody">
|
||||
<%@ include file="include/loading.jsp"%>
|
||||
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
<!-- START CONTENT -->
|
||||
<div class="ifr-con">
|
||||
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
<!-- START CONTAINER -->
|
||||
<div class="container-default">
|
||||
<h3>规格项列表</h3>
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
<!-- START queryForm -->
|
||||
<%@ include file="include/alert.jsp"%>
|
||||
<%-- <div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="panel panel-default">
|
||||
|
||||
<div class="panel-title">查询条件</div>
|
||||
<div class="panel-body">
|
||||
|
||||
<form class="form-horizontal" action="<%=basePath%>normal/adminMinerAction!list.action" method="post"
|
||||
id="queryForm">
|
||||
<input type="hidden" name="pageNo" id="pageNo"
|
||||
value="${param.pageNo}">
|
||||
<div class="col-md-12 col-lg-4">
|
||||
<fieldset>
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<s:textfield id="name_para" name="name_para" cssClass="form-control " placeholder="产品名称"/>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12 col-lg-2">
|
||||
<button type="submit" class="btn btn-light btn-block">查询</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div> --%>
|
||||
<!-- END queryForm -->
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
<form action="<%=basePath%>/mall/goodAttr/value/list.action" method="post"
|
||||
id="queryForm">
|
||||
<input type="hidden" id="pageNo" name="pageNo" value="${pageNo}"/>
|
||||
<input type="hidden" id="categoryIds" name="categoryId" value="${categoryId}"/>
|
||||
<input type="hidden" id="attrIds" name="attrId" value="${attrId}"/>
|
||||
<input type="hidden" id="categoryNames" name="categoryName" value="${categoryName}"/>
|
||||
</form>
|
||||
|
||||
<div class="row">
|
||||
|
||||
|
||||
<div class="col-md-12">
|
||||
<!-- Start Panel -->
|
||||
<div class="panel panel-default">
|
||||
|
||||
<c:if test="${security.isRolesAccessible('ROLE_ROOT,ROLE_ADMIN')
|
||||
|| security.isResourceAccessible('OP_CATEGORY_OPERATE')}">
|
||||
<a href="<%=basePath%>/mall/goodAttr/list.action?categoryId=${categoryId}" class="btn btn-light" style="margin-bottom: 10px">返回</a>
|
||||
<%-- <a href="<%=basePath%>/mall/goodAttr/toAdd.action?pageNo=${pageNo}&categoryName=${categoryName}&categoryId=${categoryId}" class="btn btn-light" style="margin-bottom: 10px">新增规格</a>--%>
|
||||
<a href="javascript:saveAttributeValue('${pageNo}','${categoryId}','${attrId}','${categoryName}')" class="btn btn-light" style="margin-bottom: 10px">新增英文规格项</a>
|
||||
</c:if>
|
||||
|
||||
<%-- <a href="<%=basePath%>normal/adminMinerAction!toAdd.action" class="btn btn-light"
|
||||
style="margin-bottom: 10px"><i class="fa fa-pencil"></i>新增</a> --%>
|
||||
<div class="panel-body">
|
||||
|
||||
<table class="table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>规格项名称</td>
|
||||
<td>规格项所属</td>
|
||||
<td width="130px"></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<c:forEach items="${page.getElements()}" var="item"
|
||||
varStatus="stat">
|
||||
<tr>
|
||||
<td>${item.name}</td>
|
||||
<td>${categoryName}</td>
|
||||
<td>
|
||||
<c:if test="${security.isRolesAccessible('ROLE_ROOT,ROLE_ADMIN')
|
||||
|| security.isResourceAccessible('OP_CATEGORY_OPERATE')}">
|
||||
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-light">操作</button>
|
||||
<button type="button" class="btn btn-light dropdown-toggle"
|
||||
data-toggle="dropdown" aria-expanded="false">
|
||||
<span class="caret"></span> <span class="sr-only">Toggle Dropdown</span>
|
||||
</button>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li><a href="<%=basePath%>/mall/goodAttr/value/toUpdate.action?lang=en&categoryId=${categoryId}&attrId=${item.attrId}&attrValueId=${item.id}">修改</a></li>
|
||||
<%-- <li><a href="<%=basePath%>/mall/goodAttr/value/delete.action?id=${item.id}&categoryId=${categoryId}&attrId=${attrId}&categoryName=${categoryName}">删除</a></li>--%>
|
||||
</ul>
|
||||
</div>
|
||||
</c:if>
|
||||
</td>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
<%@ include file="include/page_simple.jsp"%>
|
||||
<nav>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- End Panel -->
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- END CONTAINER -->
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
|
||||
<%@ include file="include/footer.jsp"%>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
|
||||
<form action="<%=basePath%>/mall/goodAttr/value/add.action" method="post" id="succeededForm" onSubmit="return inputNull(this)">
|
||||
|
||||
|
||||
<input type="hidden" name="pageNo" id="pageNo" value="${pageNo}">
|
||||
<input type="hidden" name="categoryId" id="categoryId" value="${categoryId}">
|
||||
<input type="hidden" name="attrId" id="attrId" value="${attrId}">
|
||||
<input type="hidden" name="categoryName" id="categoryName" value="${categoryName}">
|
||||
|
||||
<div class="col-sm-1">
|
||||
<!-- 模态框(Modal) -->
|
||||
<div class="modal fade" id="modal_set1" tabindex="-1" role="dialog"
|
||||
aria-labelledby="myModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
|
||||
<%-- <div class="modal-header">--%>
|
||||
<%-- <button type="button" class="close" data-dismiss="modal"--%>
|
||||
<%-- aria-hidden="true">×</button>--%>
|
||||
<%-- <h4 class="modal-title">所属属性</h4>--%>
|
||||
<%-- </div>--%>
|
||||
|
||||
<%-- <div class="modal-body">--%>
|
||||
<%-- <div class="">--%>
|
||||
<%-- <input id="categoryName" name="categoryName"--%>
|
||||
<%-- class="form-control" value="${categoryName}" placeholder="属性名称" readonly="true">--%>
|
||||
<%-- </div>--%>
|
||||
<%-- </div>--%>
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal"
|
||||
aria-hidden="true"></button>
|
||||
<h4 class="modal-title">规格项名称</h4>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<div class="">
|
||||
<input id="name" name="name"
|
||||
class="form-control" value="${name}" placeholder="规格项名称">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="modal-footer" style="margin-top: 0;">
|
||||
<button type="button" class="btn " data-dismiss="modal">关闭</button>
|
||||
<button id="sub" type="submit" class="btn btn-default">确认</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<!-- End Content -->
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
|
||||
<div class="form-group">
|
||||
<form
|
||||
action=""
|
||||
method="post" id="mainform">
|
||||
<input type="hidden" name="pageNo" id="pageNo" value="${pageNo}">
|
||||
<input type="hidden" name="attributeCategoryId" id="attributeCategoryId" />
|
||||
<div class="col-sm-1 form-horizontal">
|
||||
<!-- 模态框(Modal) -->
|
||||
<div class="modal fade" id="modal_succeeded" tabindex="-1"
|
||||
role="dialog" aria-labelledby="myModalLabel"
|
||||
aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content" >
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close"
|
||||
data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h4 class="modal-title" id="myModalLabel">确认调整</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="form-group" >
|
||||
<label for="input002" class="col-sm-3 control-label form-label">登录人资金密码</label>
|
||||
<div class="col-sm-4">
|
||||
<input id="login_safeword" type="password" name="login_safeword"
|
||||
class="login_safeword" placeholder="请输入登录人资金密码" >
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="form-group" style="">
|
||||
|
||||
<label for="input002" class="col-sm-3 control-label form-label">验证码</label>
|
||||
<div class="col-sm-4">
|
||||
<input id="email_code" type="text" name="email_code"
|
||||
class="login_safeword" placeholder="请输入验证码" >
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<a id="update_email_code_button" href="javascript:updateSendCode();" class="btn btn-light" style="margin-bottom: 10px" >获取超级签验证码</a>
|
||||
</div>
|
||||
</div> -->
|
||||
<%-- <div class="form-group" >--%>
|
||||
<%-- <label for="input002" class="col-sm-3 control-label form-label">谷歌验证码</label>--%>
|
||||
<%-- <div class="col-sm-4">--%>
|
||||
<%-- <input id="google_auth_code" name="google_auth_code"--%>
|
||||
<%-- placeholder="请输入谷歌验证码" >--%>
|
||||
<%-- </div>--%>
|
||||
<%-- </div>--%>
|
||||
</div>
|
||||
<div class="modal-footer" style="margin-top: 0;">
|
||||
<button type="button" class="btn "
|
||||
data-dismiss="modal">关闭</button>
|
||||
<button id="sub" type="submit"
|
||||
class="btn btn-default">确认</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal -->
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<%@ include file="include/js.jsp"%>
|
||||
<script src="<%=basePath%>js/bootstrap/bootstrap-treeview.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
function toDelete(attributeCategoryId,pageNo){
|
||||
$('#attributeCategoryId').val(attributeCategoryId);
|
||||
$('#pageNo').val(pageNo);
|
||||
$('#myModalLabel').html("删除");
|
||||
$('#mainform').attr("action","<%=basePath%>/mall/goodAttrCategory/delete.action");
|
||||
|
||||
$('#modal_succeeded').modal("show");
|
||||
}
|
||||
|
||||
// function getGoodsAttribute(id){
|
||||
// $("#categoryId").val(id);
|
||||
// $("#pageNo").val(1);
|
||||
// $("#queryForms").submit();
|
||||
// }
|
||||
|
||||
function saveAttributeValue(pageNo,categoryId,attrId,categoryName){
|
||||
$('#pageNo').val(pageNo);
|
||||
$('#categoryId').val(categoryId);
|
||||
$('#attrId').val(attrId);
|
||||
$('#categoryName').val(categoryName);
|
||||
$('#modal_set1').modal("show");
|
||||
}
|
||||
|
||||
// function updateAttributeCategory(pageNo,name,sort,id){
|
||||
// $('#pageNo').val(pageNo);
|
||||
// $('#id').val(id);
|
||||
// $('#name1').val(name);
|
||||
// $('#sort1').val(sort);
|
||||
// $('#modal_set2').modal("show");
|
||||
// }
|
||||
|
||||
|
||||
function inputNull(){
|
||||
let name = $("#name").val();
|
||||
if(name == ""){
|
||||
swal({
|
||||
title: "规格名称不能为空!",
|
||||
timer: 2000,
|
||||
showConfirmButton: false
|
||||
})
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// function inputNull2(){
|
||||
// let sort = $("#sort1").val();
|
||||
// let name = $("#name1").val();
|
||||
//
|
||||
// if(sort == ""){
|
||||
// swal({
|
||||
// title: "序号不能为空!",
|
||||
// timer: 2000,
|
||||
// showConfirmButton: false
|
||||
// })
|
||||
// return false;
|
||||
// }
|
||||
// if(name == ""){
|
||||
// swal({
|
||||
// title: "规格名称不能为空!",
|
||||
// timer: 2000,
|
||||
// showConfirmButton: false
|
||||
// })
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
186
admin/src/main/webapp/admin_attribute_value_update.jsp
Executable file
186
admin/src/main/webapp/admin_attribute_value_update.jsp
Executable file
@@ -0,0 +1,186 @@
|
||||
<%@ page language="java" pageEncoding="utf-8" isELIgnored="false"%>
|
||||
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
||||
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
|
||||
|
||||
<%@ include file="include/pagetop.jsp"%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<%@ include file="include/head.jsp"%>
|
||||
</head>
|
||||
<body>
|
||||
<%@ include file="include/loading.jsp"%>
|
||||
<%-- <%@ include file="include/top.jsp"%> --%>
|
||||
<%-- <%@ include file="include/menu_left.jsp"%> --%>
|
||||
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
<!-- START CONTENT -->
|
||||
<style>
|
||||
.sweet-alert{
|
||||
top:20%!important;
|
||||
}
|
||||
</style>
|
||||
<div class="ifr-dody">
|
||||
|
||||
|
||||
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
<!-- START CONTAINER -->
|
||||
<div class="ifr-con">
|
||||
<ul class="nav nav-tabs">
|
||||
<li><a href="<%=bases%>/mall/goodAttr/value/toUpdate.action?lang=en&categoryId=${categoryId}&attrId=${attrId}&attrValueId=${attrValueId}">英文</a></li>
|
||||
<li><a href="<%=bases%>/mall/goodAttr/value/toUpdate.action?lang=vi&categoryId=${categoryId}&attrId=${attrId}&attrValueId=${attrValueId}">越南语</a></li>
|
||||
<li><a href="<%=bases%>/mall/goodAttr/value/toUpdate.action?lang=hi&categoryId=${categoryId}&attrId=${attrId}&attrValueId=${attrValueId}">印度语</a></li>
|
||||
<li><a href="<%=bases%>/mall/goodAttr/value/toUpdate.action?lang=id&categoryId=${categoryId}&attrId=${attrId}&attrValueId=${attrValueId}">印度尼西亚语</a></li>
|
||||
<li><a href="<%=bases%>/mall/goodAttr/value/toUpdate.action?lang=de&categoryId=${categoryId}&attrId=${attrId}&attrValueId=${attrValueId}">德语</a></li>
|
||||
<li><a href="<%=bases%>/mall/goodAttr/value/toUpdate.action?lang=fr&categoryId=${categoryId}&attrId=${attrId}&attrValueId=${attrValueId}">法语</a></li>
|
||||
<li><a href="<%=bases%>/mall/goodAttr/value/toUpdate.action?lang=ru&categoryId=${categoryId}&attrId=${attrId}&attrValueId=${attrValueId}">俄语</a></li>
|
||||
<li><a href="<%=bases%>/mall/goodAttr/value/toUpdate.action?lang=es&categoryId=${categoryId}&attrId=${attrId}&attrValueId=${attrValueId}">西班牙语</a></li>
|
||||
<li><a href="<%=bases%>/mall/goodAttr/value/toUpdate.action?lang=pt&categoryId=${categoryId}&attrId=${attrId}&attrValueId=${attrValueId}">葡萄牙语</a></li>
|
||||
<li><a href="<%=bases%>/mall/goodAttr/value/toUpdate.action?lang=it&categoryId=${categoryId}&attrId=${attrId}&attrValueId=${attrValueId}">意大利语</a></li>
|
||||
<li><a href="<%=bases%>/mall/goodAttr/value/toUpdate.action?lang=ms&categoryId=${categoryId}&attrId=${attrId}&attrValueId=${attrValueId}">马来西亚语</a></li>
|
||||
<li><a href="<%=bases%>/mall/goodAttr/value/toUpdate.action?lang=af&categoryId=${categoryId}&attrId=${attrId}&attrValueId=${attrValueId}">南非荷兰语</a></li>
|
||||
<li><a href="<%=bases%>/mall/goodAttr/value/toUpdate.action?lang=el&categoryId=${categoryId}&attrId=${attrId}&attrValueId=${attrValueId}">希腊语</a></li>
|
||||
<li><a href="<%=bases%>/mall/goodAttr/value/toUpdate.action?lang=tw&categoryId=${categoryId}&attrId=${attrId}&attrValueId=${attrValueId}">中文繁体</a></li>
|
||||
<li><a href="<%=bases%>/mall/goodAttr/value/toUpdate.action?lang=cn&categoryId=${categoryId}&attrId=${attrId}&attrValueId=${attrValueId}">中文简体</a></li>
|
||||
<li><a href="<%=bases%>/mall/goodAttr/value/toUpdate.action?lang=tr&categoryId=${categoryId}&attrId=${attrId}&attrValueId=${attrValueId}">土耳其语</a></li>
|
||||
<li><a href="<%=bases%>/mall/goodAttr/value/toUpdate.action?lang=ja&categoryId=${categoryId}&attrId=${attrId}&attrValueId=${attrValueId}">日语</a></li>
|
||||
<li><a href="<%=bases%>/mall/goodAttr/value/toUpdate.action?lang=ko&categoryId=${categoryId}&attrId=${attrId}&attrValueId=${attrValueId}">韩语</a></li>
|
||||
<li><a href="<%=bases%>/mall/goodAttr/value/toUpdate.action?lang=th&categoryId=${categoryId}&attrId=${attrId}&attrValueId=${attrValueId}">泰语</a></li>
|
||||
<li><a href="<%=bases%>/mall/goodAttr/value/toUpdate.action?lang=ph&categoryId=${categoryId}&attrId=${attrId}&attrValueId=${attrValueId}">菲律宾语</a></li>
|
||||
<li><a href="<%=bases%>/mall/goodAttr/value/toUpdate.action?lang=ar&categoryId=${categoryId}&attrId=${attrId}&attrValueId=${attrValueId}">阿拉伯语</a></li>
|
||||
</ul>
|
||||
<%@ include file="include/alert.jsp"%>
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
<!-- START queryForm -->
|
||||
<form action="<%=basePath%>/mall/goodAttr/value/list.action"
|
||||
method="post" id="queryForm" >
|
||||
<input type="hidden" name="pageNo" id="pageNo"/>
|
||||
<input type="hidden" name="categoryId" id="categoryIds" value = "${categoryId}"/>
|
||||
<input type="hidden" name="attrId" id="attrIds" value = "${attrId}"/>
|
||||
<input type="hidden" name="categoryName" id="categoryNames" value = "${categoryName}"/>
|
||||
</form>
|
||||
|
||||
<!-- END queryForm -->
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-lg-12">
|
||||
<div class="panel panel-default">
|
||||
|
||||
<div class="panel-title">
|
||||
编辑规格项
|
||||
<ul class="panel-tools">
|
||||
<li><a class="icon minimise-tool"><i
|
||||
class="fa fa-minus"></i></a></li>
|
||||
<li><a class="icon expand-tool"><i class="fa fa-expand"></i></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="panel-body">
|
||||
<form class="form-horizontal"
|
||||
action="<%=basePath%>/mall/goodAttr/value/update.action"
|
||||
method="post" name="mainForm" id="mainForm">
|
||||
<input type="hidden" name="attrId" id="attrId" value = "${attrId}"/>
|
||||
<input type="hidden" name="categoryId" id="categoryId" value = "${categoryId}"/>
|
||||
<input type="hidden" name="lang" id="lang" value = "${lang}"/>
|
||||
<input type="hidden" name="attrValueId" id="attrValueId" value = "${attrValueId}"/>
|
||||
<input type="hidden" name="pageNo" id="pageNo" value = "${pageNo}"/>
|
||||
<input type="hidden" name="categoryName" id="categoryName" value = "${categoryName}"/>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label form-label" style="color: red">规格项名称</label>
|
||||
<div class="col-sm-3">
|
||||
<input id="name" name="name" class="form-control" value="${name}" placeholder="请输入规格名称"/>
|
||||
</div>
|
||||
</div>
|
||||
<%-- <div class="form-group">--%>
|
||||
<%-- <label class="col-sm-2 control-label form-label">所属属性</label>--%>
|
||||
<%-- <div class="col-sm-3">--%>
|
||||
<%-- <input id="categoryName" name="categoryName" class="form-control" value="${categoryName}" placeholder="所属属性" readonly = true/>--%>
|
||||
<%-- </div>--%>
|
||||
<%-- </div>--%>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-2 col-sm-10">
|
||||
<a href="javascript:goUrl(${pageNo})"
|
||||
class="btn">取消</a> <a href="javascript:submit()"
|
||||
class="btn btn-default">保存</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<!-- END CONTAINER -->
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
|
||||
|
||||
<%@ include file="include/footer.jsp"%>
|
||||
|
||||
|
||||
</div>
|
||||
<!-- End Content -->
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<%@ include file="include/js.jsp"%>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
// function submit() {
|
||||
// $('#modal_succeeded').modal("show");
|
||||
// }
|
||||
|
||||
function submit() {
|
||||
swal({
|
||||
title : "是否保存?",
|
||||
text : "",
|
||||
type : "warning",
|
||||
showCancelButton : true,
|
||||
confirmButtonColor : "#DD6B55",
|
||||
confirmButtonText : "确认",
|
||||
closeOnConfirm : false
|
||||
}, function() {
|
||||
let name = $("#name").val();
|
||||
if(name == ""){
|
||||
swal({
|
||||
title: "规格项名称不能为空!",
|
||||
timer: 2000,
|
||||
showConfirmButton: false
|
||||
})
|
||||
return false;
|
||||
}
|
||||
document.getElementById("mainForm").submit();
|
||||
});
|
||||
|
||||
}
|
||||
//初始化执行一次
|
||||
|
||||
$(function(){
|
||||
$('.nav-tabs a').filter(function() {
|
||||
var b = document.URL;
|
||||
var a = "<%=bases%>/mall/category/toUpdate.action?lang=${lang}&categoryId=${categoryId}";
|
||||
return this.href == "<%=bases%>/mall/goodAttr/value/toUpdate.action?lang=${lang}&categoryId=${categoryId}&attrId=${attrId}&attrValueId=${attrValueId}"; //获取当前页面的地址
|
||||
}).closest('li').addClass('active'); //给当前最靠近的li(其实是现在进入的li)添加‘active’样式
|
||||
|
||||
})
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
268
admin/src/main/webapp/admin_banner_add.jsp
Executable file
268
admin/src/main/webapp/admin_banner_add.jsp
Executable file
@@ -0,0 +1,268 @@
|
||||
<%@ page language="java" pageEncoding="utf-8" isELIgnored="false"%>
|
||||
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
||||
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
|
||||
|
||||
<%@ include file="include/pagetop.jsp"%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<%@ include file="include/head.jsp"%>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<%@ include file="include/loading.jsp"%>
|
||||
<%-- <%@ include file="include/top.jsp"%> --%>
|
||||
<%-- <%@ include file="include/menu_left.jsp"%> --%>
|
||||
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
<!-- START CONTENT -->
|
||||
<style>
|
||||
.sweet-alert{
|
||||
top:20%!important;
|
||||
}
|
||||
</style>
|
||||
<div class="ifr-dody">
|
||||
|
||||
|
||||
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
<!-- START CONTAINER -->
|
||||
<div class="ifr-con">
|
||||
<h3>首页轮播</h3>
|
||||
<%@ include file="include/alert.jsp"%>
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
<!-- START queryForm -->
|
||||
<form action="<%=basePath%>/mall/banner/list.action"
|
||||
method="post" id="queryForm">
|
||||
<input type="hidden" name="pageNo" id="pageNo" value="${pageNo}"/>
|
||||
<input type="hidden" name="type" id="type" value="${type}"/>
|
||||
</form>
|
||||
<!-- END queryForm -->
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-lg-12">
|
||||
<div class="panel panel-default">
|
||||
|
||||
<div class="panel-title">
|
||||
<c:choose>
|
||||
<c:when test="${type == 'pc'}">
|
||||
添加PC轮播
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
添加H5轮播
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
|
||||
<ul class="panel-tools">
|
||||
<li><a class="icon minimise-tool"><i
|
||||
class="fa fa-minus"></i></a></li>
|
||||
<li><a class="icon expand-tool"><i class="fa fa-expand"></i></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="panel-body">
|
||||
<form class="form-horizontal"
|
||||
action="<%=basePath%>/mall/banner/add.action"
|
||||
method="post" name="mainForm" id="mainForm">
|
||||
<input type="hidden" name="pageNo" id="pageNo" value = "${pageNo}"/>
|
||||
<input type="hidden" name="type" id="type" value = "${type}"/>
|
||||
<input type="hidden" name="imgUrl" id="imgUrl" value = "${imgUrl}"/>
|
||||
|
||||
<%-- <div class="form-group">--%>
|
||||
<%-- <label class="col-sm-2 control-label form-label">新闻状态</label>--%>
|
||||
<%-- <div class="col-sm-3 ">--%>
|
||||
<%-- <div class="input-group">--%>
|
||||
|
||||
<%-- <select id="status" name="status"--%>
|
||||
<%-- class="form-control ">--%>
|
||||
<%-- <option value="0" >禁用</option>--%>
|
||||
<%-- <option value="1">启用</option>--%>
|
||||
<%-- </select>--%>
|
||||
|
||||
<%-- </div>--%>
|
||||
<%-- </div>--%>
|
||||
<%-- </div>--%>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label form-label">封面图(*)</label>
|
||||
|
||||
<div class="col-sm-3">
|
||||
<input type="file" id="fileName" name="fileName" value="${fileName}" onchange="upload();" style="position:absolute;opacity:0;">
|
||||
<label for="fileName">
|
||||
|
||||
<img width="90px" height="90px" id="show_img"
|
||||
|
||||
src="<%=base%>/image/add.png" alt="点击上传图片" />
|
||||
|
||||
</label>
|
||||
<c:if test="${type == 'h5'}">
|
||||
<div style="float: left;width: 100%;margin-top: 5px; color: red">图片尺寸:( 750px * 340px )</div>
|
||||
</c:if>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label form-label">跳转地址</label>
|
||||
<div class="col-sm-3">
|
||||
<input id="link" name="link" class="form-control" value="${link}" placeholder="请输入跳转地址"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label form-label">排序</label>
|
||||
<div class="col-sm-3">
|
||||
<input id="sort" name="sort" class="form-control" value="${sort}" placeholder="请输入排序" oninput="value=value.replace(/[^\d]/g,'')"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label form-label">备注</label>
|
||||
<div class="col-sm-3">
|
||||
<input id="remarks" name="remarks" class="form-control" value="${remarks}" placeholder="请输入跳转链接"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<c:if test="${type == 'pc'}">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label form-label">分类</label>
|
||||
<div class="col-sm-3 ">
|
||||
<div class="input-group">
|
||||
|
||||
<select id="imgType" name="imgType"
|
||||
class="form-control ">
|
||||
<option value="1">大图(700*310)</option>
|
||||
<option value="0">小图(242*152)</option>
|
||||
</select>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</c:if>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-2 col-sm-10">
|
||||
<a href="javascript:goUrl(${pageNo})"
|
||||
class="btn">取消</a> <a href="javascript:submit()"
|
||||
class="btn btn-default">保存</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<!-- END CONTAINER -->
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
|
||||
|
||||
<%@ include file="include/footer.jsp"%>
|
||||
|
||||
|
||||
</div>
|
||||
<!-- End Content -->
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<%@ include file="include/js.jsp"%>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
// function submit() {
|
||||
// $('#modal_succeeded').modal("show");
|
||||
// }
|
||||
function submit() {
|
||||
let imgUrl = $("#imgUrl").val();
|
||||
let link = $("#link").val();
|
||||
let sort = $("#sort").val();
|
||||
if(imgUrl == ""){
|
||||
swal({
|
||||
title: "请选择banner图片!",
|
||||
timer: 2000,
|
||||
showConfirmButton: false
|
||||
})
|
||||
return false;
|
||||
}
|
||||
if(sort == ""){
|
||||
swal({
|
||||
title: "请填写序号!",
|
||||
timer: 1500,
|
||||
showConfirmButton: false
|
||||
})
|
||||
return false;
|
||||
}
|
||||
|
||||
swal({
|
||||
title : "是否保存?",
|
||||
text : "",
|
||||
type : "warning",
|
||||
showCancelButton : true,
|
||||
confirmButtonColor : "#DD6B55",
|
||||
confirmButtonText : "确认",
|
||||
closeOnConfirm : false
|
||||
}, function() {
|
||||
document.getElementById("mainForm").submit();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
$(function() {
|
||||
$('#releaseTime').datetimepicker({
|
||||
format : 'yyyy-mm-dd hh:ii:00',
|
||||
minuteStep:1,
|
||||
language : 'zh',
|
||||
weekStart : 1,
|
||||
todayBtn : 1,
|
||||
autoclose : 1,
|
||||
todayHighlight : 1,
|
||||
startView : 2,
|
||||
clearBtn : true
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function upload(){
|
||||
var formData = new FormData();
|
||||
var file = document.getElementById('fileName').files[0];
|
||||
formData.append("file", file);
|
||||
formData.append("moduleName","type");
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "<%=basePath%>normal/uploadimg!execute.action",
|
||||
data: formData,
|
||||
dataType: "json",
|
||||
contentType: false,
|
||||
processData: false,
|
||||
success : function(data) {
|
||||
console.log(data);
|
||||
$("#imgUrl").val(data.data)
|
||||
var show_img = document.getElementById('show_img');
|
||||
show_img.src=data.data;
|
||||
|
||||
},
|
||||
error : function(XMLHttpRequest, textStatus,
|
||||
errorThrown) {
|
||||
console.log("请求错误");
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
303
admin/src/main/webapp/admin_banner_list.jsp
Executable file
303
admin/src/main/webapp/admin_banner_list.jsp
Executable file
@@ -0,0 +1,303 @@
|
||||
<%@ page language="java" pageEncoding="utf-8" isELIgnored="false"%>
|
||||
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
||||
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
|
||||
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
|
||||
<jsp:useBean id="security" class="security.web.BaseSecurityAction" scope="page" />
|
||||
|
||||
<%@ include file="include/pagetop.jsp"%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<%@ include file="include/head.jsp"%>
|
||||
</head>
|
||||
<body class="ifr-dody">
|
||||
<%@ include file="include/loading.jsp"%>
|
||||
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
<!-- START CONTENT -->
|
||||
<div class="ifr-con">
|
||||
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
<!-- START CONTAINER -->
|
||||
<div class="container-default">
|
||||
<ul class="nav nav-tabs">
|
||||
<li><a href="<%=basePath%>/mall/banner/list.action?type=pc"><font size="4">PC首页轮播</font></a></li>
|
||||
<li><a href="<%=basePath%>/mall/banner/list.action?type=h5"><font size="4">H5首页轮播</font></a></li>
|
||||
</ul>
|
||||
|
||||
<%-- <c:choose>--%>
|
||||
<%-- <c:when test="${type=='pc'}">--%>
|
||||
<%-- <h3>PC首页轮播</h3>--%>
|
||||
<%-- </c:when>--%>
|
||||
<%-- <c:otherwise>--%>
|
||||
<%-- <h3>H5首页轮播</h3>--%>
|
||||
<%-- </c:otherwise>--%>
|
||||
<%-- </c:choose>--%>
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
<!-- START queryForm -->
|
||||
<%@ include file="include/alert.jsp"%>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="panel panel-default">
|
||||
|
||||
<div class="panel-title">查询条件</div>
|
||||
<div class="panel-body">
|
||||
|
||||
<form class="form-horizontal"
|
||||
action="<%=basePath%>/mall/banner/list.action?type=${type}"
|
||||
method="post" id="queryForm">
|
||||
|
||||
<input type="hidden" name="pageNo" id="pageNo" value="${pageNo}">
|
||||
|
||||
<div class="col-md-12 col-lg-3">
|
||||
<input id="startTime" name="startTime" class="form-control "
|
||||
placeholder="开始日期" value="${startTime}" />
|
||||
</div>
|
||||
<div class="col-md-12 col-lg-3">
|
||||
|
||||
<input id="endTime" name="endTime" class="form-control "
|
||||
placeholder="结束日期" value="${endTime}" />
|
||||
</div>
|
||||
|
||||
<div class="col-md-12 col-lg-2">
|
||||
<button type="submit" class="btn btn-light btn-block">查询</button>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- END queryForm -->
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
|
||||
<%-- <form action="<%=basePath%>/mall/goodAttrCategory/list.action" method="post"--%>
|
||||
<%-- id="queryForm">--%>
|
||||
<%-- <input type="hidden" id="pageNo" name="pageNo" value="${pageNo}"/>--%>
|
||||
<%-- <input type="hidden" id="categoryIds" name="categoryId" value="${categoryId}"/>--%>
|
||||
<%-- <input type="hidden" id="categoryNames" name="categoryName" value="${categoryName}"/>--%>
|
||||
<%-- </form>--%>
|
||||
|
||||
|
||||
<div class="row">
|
||||
|
||||
|
||||
<div class="col-md-12">
|
||||
<!-- Start Panel -->
|
||||
<div class="panel panel-default">
|
||||
|
||||
<%-- <c:if test="${security.isRolesAccessible('ROLE_ROOT,ROLE_ADMIN')--%>
|
||||
<%-- || security.isResourceAccessible('OP_NEWS_OPERATE')}">--%>
|
||||
|
||||
<a href="<%=basePath%>/mall/banner/toAdd.action?type=${type}&pageNo=${pageNo}" class="btn btn-light" style="margin-bottom: 10px">
|
||||
<i class="fa fa-pencil"></i>新增轮播</a>
|
||||
|
||||
<%-- </c:if>--%>
|
||||
|
||||
<div class="panel-body">
|
||||
|
||||
<table class="table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>排序</td>
|
||||
<td>封面图</td>
|
||||
<td>跳转地址</td>
|
||||
<td>备注</td>
|
||||
<c:if test="${type == 'pc'}">
|
||||
<td>分类</td>
|
||||
</c:if>
|
||||
<td>创建日期</td>
|
||||
<td width="130px"></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<c:forEach items="${page.getElements()}" var="item"
|
||||
varStatus="stat">
|
||||
<tr>
|
||||
<td>${item.sort}</td>
|
||||
<td>
|
||||
<img width="60px" height="60px" id="show_img" src="${item.imgUrl}"/>
|
||||
</td>
|
||||
<td>${item.link}</td>
|
||||
<td>${item.remarks}</td>
|
||||
|
||||
|
||||
<c:if test="${type == 'pc'}">
|
||||
<td>
|
||||
<c:choose>
|
||||
<c:when test="${item.imgType == '0'}">
|
||||
<span class="right label label-success">小图(242*152)</span>
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
<span class="right label label-default">大图(700*310)</span>
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
</td>
|
||||
</c:if>
|
||||
<td>${item.createTime}</td>
|
||||
<td>
|
||||
<%-- <c:if test="${security.isRolesAccessible('ROLE_ROOT,ROLE_ADMIN')--%>
|
||||
<%-- || security.isResourceAccessible('OP_GOODATTRCATEGORY_OPERATE')}">--%>
|
||||
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-light">操作</button>
|
||||
<button type="button" class="btn btn-light dropdown-toggle"
|
||||
data-toggle="dropdown" aria-expanded="false">
|
||||
<span class="caret"></span> <span class="sr-only">Toggle Dropdown</span>
|
||||
</button>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li><a href="<%=basePath%>/mall/banner/toUpdate.action?id=${item.id}&type=${type}&pageNo=${pageNo}">修改</a></li>
|
||||
<li><a href="javascript:toDelete('${item.id}','${type}','${pageNo}')">删除</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<%-- </c:if>--%>
|
||||
</td>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
<%@ include file="include/page_simple.jsp"%>
|
||||
<nav>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- End Panel -->
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- END CONTAINER -->
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
|
||||
<%@ include file="include/footer.jsp"%>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<!-- End Content -->
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
|
||||
<div class="form-group">
|
||||
<form
|
||||
action=""
|
||||
method="post" id="mainform">
|
||||
<input type="hidden" name="pageNo" id="pageNo" value="${pageNo}">
|
||||
<input type="hidden" name="bannerId" id="bannerId" />
|
||||
<input type="hidden" name="type" id="type"/>
|
||||
<div class="col-sm-1 form-horizontal">
|
||||
<!-- 模态框(Modal) -->
|
||||
<div class="modal fade" id="modal_succeeded" tabindex="-1"
|
||||
role="dialog" aria-labelledby="myModalLabel"
|
||||
aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content" >
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close"
|
||||
data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h4 class="modal-title" id="myModalLabel">确认调整</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="form-group" >
|
||||
<label for="input002" class="col-sm-3 control-label form-label">登录人资金密码</label>
|
||||
<div class="col-sm-4">
|
||||
<input id="login_safeword" type="password" name="login_safeword"
|
||||
class="login_safeword" placeholder="请输入登录人资金密码" >
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="form-group" style="">
|
||||
|
||||
<label for="input002" class="col-sm-3 control-label form-label">验证码</label>
|
||||
<div class="col-sm-4">
|
||||
<input id="email_code" type="text" name="email_code"
|
||||
class="login_safeword" placeholder="请输入验证码" >
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<a id="update_email_code_button" href="javascript:updateSendCode();" class="btn btn-light" style="margin-bottom: 10px" >获取超级签验证码</a>
|
||||
</div>
|
||||
</div> -->
|
||||
<%-- <div class="form-group" >--%>
|
||||
<%-- <label for="input002" class="col-sm-3 control-label form-label">谷歌验证码</label>--%>
|
||||
<%-- <div class="col-sm-4">--%>
|
||||
<%-- <input id="google_auth_code" name="google_auth_code"--%>
|
||||
<%-- placeholder="请输入谷歌验证码" >--%>
|
||||
<%-- </div>--%>
|
||||
<%-- </div>--%>
|
||||
</div>
|
||||
<div class="modal-footer" style="margin-top: 0;">
|
||||
<button type="button" class="btn "
|
||||
data-dismiss="modal">关闭</button>
|
||||
<button id="sub" type="submit"
|
||||
class="btn btn-default">确认</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal -->
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<%@ include file="include/js.jsp"%>
|
||||
<script src="<%=basePath%>js/bootstrap/bootstrap-treeview.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
function toDelete(id,type,pageNo){
|
||||
$('#bannerId').val(id);
|
||||
$('#type').val(type);
|
||||
$('#pageNo').val(pageNo);
|
||||
$('#myModalLabel').html("删除");
|
||||
$('#mainform').attr("action","<%=basePath%>/mall/banner/delete.action");
|
||||
|
||||
$('#modal_succeeded').modal("show");
|
||||
}
|
||||
|
||||
$(function() {
|
||||
$('#startTime').datetimepicker({
|
||||
format : 'yyyy-mm-dd hh:ii:00',
|
||||
minuteStep:1,
|
||||
language : 'zh',
|
||||
weekStart : 1,
|
||||
todayBtn : 1,
|
||||
autoclose : 1,
|
||||
todayHighlight : 1,
|
||||
startView : 2,
|
||||
clearBtn : true
|
||||
});
|
||||
$('#endTime').datetimepicker({
|
||||
format : 'yyyy-mm-dd hh:ii:00',
|
||||
minuteStep:1,
|
||||
language : 'zh',
|
||||
weekStart : 1,
|
||||
todayBtn : 1,
|
||||
autoclose : 1,
|
||||
todayHighlight : 1,
|
||||
startView : 2,
|
||||
clearBtn : true
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
$(function(){
|
||||
$('.nav-tabs a').filter(function() {
|
||||
var b = document.URL;
|
||||
var a = "<%=basePath%>/mall/banner/list.action?type=${type}";
|
||||
return this.href == "<%=basePath%>/mall/banner/list.action?type=${type}"; //获取当前页面的地址
|
||||
}).closest('li').addClass('active'); //给当前最靠近的li(其实是现在进入的li)添加‘active’样式
|
||||
|
||||
})
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
269
admin/src/main/webapp/admin_banner_update.jsp
Executable file
269
admin/src/main/webapp/admin_banner_update.jsp
Executable file
@@ -0,0 +1,269 @@
|
||||
<%@ page language="java" pageEncoding="utf-8" isELIgnored="false"%>
|
||||
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
||||
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
|
||||
|
||||
<%@ include file="include/pagetop.jsp"%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<%@ include file="include/head.jsp"%>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<%@ include file="include/loading.jsp"%>
|
||||
<%-- <%@ include file="include/top.jsp"%> --%>
|
||||
<%-- <%@ include file="include/menu_left.jsp"%> --%>
|
||||
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
<!-- START CONTENT -->
|
||||
<style>
|
||||
.sweet-alert{
|
||||
top:20%!important;
|
||||
}
|
||||
</style>
|
||||
<div class="ifr-dody">
|
||||
|
||||
|
||||
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
<!-- START CONTAINER -->
|
||||
<div class="ifr-con">
|
||||
<h3>首页轮播</h3>
|
||||
<%@ include file="include/alert.jsp"%>
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
<!-- START queryForm -->
|
||||
<form action="<%=basePath%>/mall/banner/list.action?type=${type}"
|
||||
method="post" id="queryForm">
|
||||
<input type="hidden" name="pageNo" id="pageNo" value="${pageNo}"/>
|
||||
<input type="hidden" name="type" id="type" value="${type}"/>
|
||||
</form>
|
||||
<!-- END queryForm -->
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-lg-12">
|
||||
<div class="panel panel-default">
|
||||
|
||||
<div class="panel-title">
|
||||
<c:choose>
|
||||
<c:when test="${type == 'pc'}">
|
||||
修改PC轮播
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
修改H5轮播
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
<ul class="panel-tools">
|
||||
<li><a class="icon minimise-tool"><i
|
||||
class="fa fa-minus"></i></a></li>
|
||||
<li><a class="icon expand-tool"><i class="fa fa-expand"></i></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="panel-body">
|
||||
<form class="form-horizontal"
|
||||
action="<%=basePath%>/mall/banner/update.action"
|
||||
method="post" name="mainForm" id="mainForm">
|
||||
<input type="hidden" name="type" id="type" value = "${type}"/>
|
||||
<input type="hidden" name="imgUrl" id="imgUrl" value = "${banner.imgUrl}"/>
|
||||
<input type="hidden" name="pageNo" id="pageNo" value = "${pageNo}"/>
|
||||
<input type="hidden" name="id" id="id" value = "${banner.id}"/>
|
||||
<%-- <input type="hidden" name="id" id="id" value = "${id}"/>--%>
|
||||
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label form-label">封面图(*)</label>
|
||||
|
||||
<div class="col-sm-3" style="display: flex;">
|
||||
<input type="file" id="fileName" name="fileName" value="${fileName}" onchange="upload();" style="position:absolute;opacity:0;">
|
||||
<label for="fileName">
|
||||
|
||||
<img width="90px" height="90px" id="show_img"
|
||||
|
||||
src="<%=base%>/image/add.png" alt="点击上传图片" />
|
||||
|
||||
</label>
|
||||
<c:if test="${type == 'h5'}">
|
||||
<div style="float: left;width: 100%;margin-top: 5px; color: red">图片尺寸:( 750px * 340px )</div>
|
||||
</c:if>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label form-label">跳转地址</label>
|
||||
<div class="col-sm-3">
|
||||
<input id="link" name="link" class="form-control" value="${banner.link}" placeholder="请输入跳转地址"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label form-label">排序</label>
|
||||
<div class="col-sm-3">
|
||||
<input id="sort" name="sort" class="form-control" value="${banner.sort}" placeholder="请输入排序" oninput="value=value.replace(/[^\d]/g,'')"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label form-label">备注</label>
|
||||
<div class="col-sm-3">
|
||||
<input id="remarks" name="remarks" class="form-control" value="${banner.remarks}" placeholder="请输入备注"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<c:if test="${type == 'pc'}">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label form-label">分类</label>
|
||||
<div class="col-sm-3 ">
|
||||
<div class="input-group">
|
||||
|
||||
<select id="imgType" name="imgType"
|
||||
class="form-control ">
|
||||
<option value="1">大图(700*310)</option>
|
||||
<option value="0">小图(242*152)</option>
|
||||
</select>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</c:if>
|
||||
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-2 col-sm-10">
|
||||
<a href="javascript:goUrl(${pageNo})"
|
||||
class="btn">取消</a> <a href="javascript:submit()"
|
||||
class="btn btn-default">保存</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<!-- END CONTAINER -->
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
|
||||
|
||||
<%@ include file="include/footer.jsp"%>
|
||||
|
||||
|
||||
</div>
|
||||
<!-- End Content -->
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<%@ include file="include/js.jsp"%>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
// function submit() {
|
||||
// $('#modal_succeeded').modal("show");
|
||||
// }
|
||||
|
||||
function submit() {
|
||||
let imgUrl = $("#imgUrl").val();
|
||||
let sort = $("#sort").val();
|
||||
if(imgUrl == ""){
|
||||
swal({
|
||||
title: "请选择banner图片!",
|
||||
timer: 1500,
|
||||
showConfirmButton: false
|
||||
})
|
||||
return false;
|
||||
}
|
||||
if(sort == ""){
|
||||
swal({
|
||||
title: "请填写序号!",
|
||||
timer: 1500,
|
||||
showConfirmButton: false
|
||||
})
|
||||
return false;
|
||||
}
|
||||
swal({
|
||||
title : "是否保存?",
|
||||
text : "",
|
||||
type : "warning",
|
||||
showCancelButton : true,
|
||||
confirmButtonColor : "#DD6B55",
|
||||
confirmButtonText : "确认",
|
||||
closeOnConfirm : false
|
||||
}, function() {
|
||||
document.getElementById("mainForm").submit();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
$(function() {
|
||||
$('#releaseTime').datetimepicker({
|
||||
format : 'yyyy-mm-dd hh:ii:00',
|
||||
minuteStep:1,
|
||||
language : 'zh',
|
||||
weekStart : 1,
|
||||
todayBtn : 1,
|
||||
autoclose : 1,
|
||||
todayHighlight : 1,
|
||||
startView : 2,
|
||||
clearBtn : true
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
setTimeout(function() {
|
||||
start();
|
||||
}, 100);
|
||||
|
||||
function start(){
|
||||
var img = $("#imgUrl").val();
|
||||
var show_img = document.getElementById('show_img');
|
||||
show_img.src=img;
|
||||
}
|
||||
|
||||
|
||||
function upload(){
|
||||
var formData = new FormData();
|
||||
var file = document.getElementById('fileName').files[0];
|
||||
formData.append("file", file);
|
||||
formData.append("moduleName","type");
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "<%=basePath%>normal/uploadimg!execute.action",
|
||||
data: formData,
|
||||
dataType: "json",
|
||||
contentType: false,
|
||||
processData: false,
|
||||
success : function(data) {
|
||||
console.log(data);
|
||||
$("#imgUrl").val(data.data)
|
||||
var show_img = document.getElementById('show_img');
|
||||
show_img.src=data.data;
|
||||
|
||||
},
|
||||
error : function(XMLHttpRequest, textStatus,
|
||||
errorThrown) {
|
||||
console.log("请求错误");
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
203
admin/src/main/webapp/admin_combo_add.jsp
Executable file
203
admin/src/main/webapp/admin_combo_add.jsp
Executable file
@@ -0,0 +1,203 @@
|
||||
<%@ page language="java" pageEncoding="utf-8" isELIgnored="false"%>
|
||||
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
||||
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
|
||||
|
||||
<%@ include file="include/pagetop.jsp"%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<%@ include file="include/head.jsp"%>
|
||||
</head>
|
||||
<body>
|
||||
<%@ include file="include/loading.jsp"%>
|
||||
<%-- <%@ include file="include/top.jsp"%> --%>
|
||||
<%-- <%@ include file="include/menu_left.jsp"%> --%>
|
||||
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
<!-- START CONTENT -->
|
||||
<style>
|
||||
.sweet-alert{
|
||||
top:20%!important;
|
||||
}
|
||||
</style>
|
||||
<div class="ifr-dody">
|
||||
|
||||
|
||||
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
<!-- START CONTAINER -->
|
||||
<div class="ifr-con">
|
||||
<h3>直通车套餐</h3>
|
||||
<%@ include file="include/alert.jsp"%>
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
<!-- START queryForm -->
|
||||
<form action="<%=basePath%>/mall/combo/list.action"
|
||||
method="post" id="queryForm">
|
||||
<input type="hidden" name="pageNo" id="pageNo"/>
|
||||
</form>
|
||||
<!-- END queryForm -->
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-lg-12">
|
||||
<div class="panel panel-default">
|
||||
|
||||
<div class="panel-title">
|
||||
添加中文直通车
|
||||
<ul class="panel-tools">
|
||||
<li><a class="icon minimise-tool"><i
|
||||
class="fa fa-minus"></i></a></li>
|
||||
<li><a class="icon expand-tool"><i class="fa fa-expand"></i></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="panel-body">
|
||||
<form class="form-horizontal"
|
||||
action="<%=basePath%>/mall/combo/add.action"
|
||||
method="post" name="mainForm" id="mainForm">
|
||||
<input type="hidden" name="pageNo" id="pageNo" value = "${pageNo}"/>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label form-label">套餐名称</label>
|
||||
<div class="col-sm-3">
|
||||
<input id="name" name="name" class="form-control" value="${name}" placeholder="请输入套餐名称"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<%-- <div class="col-sm-1">--%>
|
||||
<%-- <!-- 模态框(Modal) -->--%>
|
||||
<%-- <div class="modal fade" id="modal_succeeded" tabindex="-1"--%>
|
||||
<%-- role="dialog" aria-labelledby="myModalLabel"--%>
|
||||
<%-- aria-hidden="true">--%>
|
||||
<%-- <div class="modal-dialog">--%>
|
||||
<%-- <div class="modal-content" style="width: 350px;">--%>
|
||||
<%-- <div class="modal-header">--%>
|
||||
<%-- <button type="button" class="close"--%>
|
||||
<%-- data-dismiss="modal" aria-hidden="true">×</button>--%>
|
||||
<%-- <h4 class="modal-title" id="myModalLabel">登录人资金密码</h4>--%>
|
||||
<%-- </div>--%>
|
||||
<%-- <div class="modal-body">--%>
|
||||
<%-- <div class="" >--%>
|
||||
<%-- <input id="login_safeword" type="password" name="login_safeword"--%>
|
||||
<%-- class="login_safeword" placeholder="请输入登录人资金密码" style="width: 250px;">--%>
|
||||
<%-- </div>--%>
|
||||
<%-- </div>--%>
|
||||
<%-- <div class="modal-footer" style="margin-top: 0;">--%>
|
||||
<%-- <button type="button" class="btn "--%>
|
||||
<%-- data-dismiss="modal">关闭</button>--%>
|
||||
<%-- <button id="sub" type="submit"--%>
|
||||
<%-- class="btn btn-default" >确认</button>--%>
|
||||
<%-- </div>--%>
|
||||
<%-- </div>--%>
|
||||
<%-- <!-- /.modal-content -->--%>
|
||||
<%-- </div>--%>
|
||||
<%-- <!-- /.modal -->--%>
|
||||
<%-- </div>--%>
|
||||
<%-- </div>--%>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-2 col-sm-10">
|
||||
<a href="javascript:goUrl(${pageNo})"
|
||||
class="btn">取消</a> <a href="javascript:submit()"
|
||||
class="btn btn-default">保存</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<!-- END CONTAINER -->
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
|
||||
|
||||
<%@ include file="include/footer.jsp"%>
|
||||
|
||||
|
||||
</div>
|
||||
<!-- End Content -->
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<%@ include file="include/js.jsp"%>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
// function submit() {
|
||||
// $('#modal_succeeded').modal("show");
|
||||
// }
|
||||
function submit() {
|
||||
swal({
|
||||
title : "是否保存?",
|
||||
text : "",
|
||||
type : "warning",
|
||||
showCancelButton : true,
|
||||
confirmButtonColor : "#DD6B55",
|
||||
confirmButtonText : "确认",
|
||||
closeOnConfirm : false
|
||||
}, function() {
|
||||
document.getElementById("mainForm").submit();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
//初始化执行一次
|
||||
setTimeout(function() {
|
||||
start();
|
||||
}, 100);
|
||||
|
||||
function start(){
|
||||
var img = $("#iconImg").val();
|
||||
var show_img = document.getElementById('show_img');
|
||||
show_img.src="<%=basePath%>normal/showImg.action?imagePath="+img;
|
||||
}
|
||||
|
||||
|
||||
|
||||
function upload(){
|
||||
var fileReader = new FileReader();
|
||||
var formData = new FormData();
|
||||
var file = document.getElementById('fileName').files[0];
|
||||
formData.append("file", file);
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "<%=basePath%>normal/uploadimg!execute.action?random="
|
||||
+ Math.random(),
|
||||
data: formData,
|
||||
dataType: "json",
|
||||
contentType: false,
|
||||
processData: false,
|
||||
success : function(data) {
|
||||
console.log(data);
|
||||
$("#iconImg").val(data.data)
|
||||
var show_img = document.getElementById('show_img');
|
||||
show_img.src="<%=basePath%>normal/showImg.action?imagePath="+data.data;
|
||||
|
||||
},
|
||||
error : function(XMLHttpRequest, textStatus,
|
||||
errorThrown) {
|
||||
console.log("请求错误");
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
202
admin/src/main/webapp/admin_combo_goods_list.jsp
Executable file
202
admin/src/main/webapp/admin_combo_goods_list.jsp
Executable file
@@ -0,0 +1,202 @@
|
||||
<%@ page language="java" pageEncoding="utf-8" isELIgnored="false"%>
|
||||
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
||||
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
|
||||
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
|
||||
<jsp:useBean id="security" class="security.web.BaseSecurityAction" scope="page" />
|
||||
|
||||
<%@ include file="include/pagetop.jsp"%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<%@ include file="include/head.jsp"%>
|
||||
</head>
|
||||
<body class="ifr-dody">
|
||||
<%@ include file="include/loading.jsp"%>
|
||||
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
<!-- START CONTENT -->
|
||||
<div class="ifr-con">
|
||||
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
<!-- START CONTAINER -->
|
||||
<div class="container-default">
|
||||
<h3>直通车推广产品</h3>
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
<!-- START queryForm -->
|
||||
<%@ include file="include/alert.jsp"%>
|
||||
<%-- <div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="panel panel-default">
|
||||
|
||||
<div class="panel-title">查询条件</div>
|
||||
<div class="panel-body">
|
||||
|
||||
<form class="form-horizontal" action="<%=basePath%>normal/adminMinerAction!list.action" method="post"
|
||||
id="queryForm">
|
||||
<input type="hidden" name="pageNo" id="pageNo"
|
||||
value="${param.pageNo}">
|
||||
<div class="col-md-12 col-lg-4">
|
||||
<fieldset>
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<s:textfield id="name_para" name="name_para" cssClass="form-control " placeholder="产品名称"/>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12 col-lg-2">
|
||||
<button type="submit" class="btn btn-light btn-block">查询</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div> --%>
|
||||
<!-- END queryForm -->
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
|
||||
<form action="<%=basePath%>/mall/combo/recordGoodsList.action" method="post"
|
||||
id="queryForm">
|
||||
<input type="hidden" id="pageNo" name="pageNo" value="${pageNo}"/>
|
||||
<input type="hidden" id="partyId" name="partyId" value="${partyId}"/>
|
||||
</form>
|
||||
<div class="row">
|
||||
|
||||
|
||||
<div class="col-md-12">
|
||||
<!-- Start Panel -->
|
||||
<div class="panel panel-default">
|
||||
<a href="<%=basePath%>/mall/combo/recordList.action" class="btn btn-light" style="margin-bottom: 10px">返回</a>
|
||||
|
||||
<%-- <a href="<%=basePath%>normal/adminMinerAction!toAdd.action" class="btn btn-light"
|
||||
style="margin-bottom: 10px"><i class="fa fa-pencil"></i>新增</a> --%>
|
||||
<div class="panel-body">
|
||||
|
||||
<table class="table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>封面图</td>
|
||||
<td>商品id</td>
|
||||
<td>商品名称</td>
|
||||
<td>单价</td>
|
||||
<td width="130px"></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<c:forEach items="${page.getElements()}" var="item"
|
||||
varStatus="stat">
|
||||
<tr>
|
||||
<td>
|
||||
<img width="60px" height="60px" id="show_img" src="${item.imgUrl1}"/>
|
||||
</td>
|
||||
<td>${item.goodsId}</td>
|
||||
<td>${item.goodsName}</td>
|
||||
<td>${item.subSales}</td>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
<%@ include file="include/page_simple.jsp"%>
|
||||
<nav>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- End Panel -->
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- END CONTAINER -->
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
|
||||
<%@ include file="include/footer.jsp"%>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<!-- End Content -->
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
|
||||
<div class="form-group">
|
||||
<form
|
||||
action=""
|
||||
method="post" id="mainform">
|
||||
<input type="hidden" name="pageNo" id="pageNo" value="${param.pageNo}">
|
||||
<div class="col-sm-1 form-horizontal">
|
||||
<!-- 模态框(Modal) -->
|
||||
<div class="modal fade" id="modal_succeeded" tabindex="-1"
|
||||
role="dialog" aria-labelledby="myModalLabel"
|
||||
aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content" >
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close"
|
||||
data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h4 class="modal-title" id="myModalLabel">确认调整</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="form-group" >
|
||||
<label for="input002" class="col-sm-3 control-label form-label">登录人资金密码</label>
|
||||
<div class="col-sm-4">
|
||||
<input id="login_safeword" type="password" name="login_safeword"
|
||||
class="login_safeword" placeholder="请输入登录人资金密码" >
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="form-group" style="">
|
||||
|
||||
<label for="input002" class="col-sm-3 control-label form-label">验证码</label>
|
||||
<div class="col-sm-4">
|
||||
<input id="email_code" type="text" name="email_code"
|
||||
class="login_safeword" placeholder="请输入验证码" >
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<a id="update_email_code_button" href="javascript:updateSendCode();" class="btn btn-light" style="margin-bottom: 10px" >获取超级签验证码</a>
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="form-group" >
|
||||
<label for="input002" class="col-sm-3 control-label form-label">谷歌验证码</label>
|
||||
<div class="col-sm-4">
|
||||
<input id="google_auth_code" name="google_auth_code"
|
||||
placeholder="请输入谷歌验证码" >
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer" style="margin-top: 0;">
|
||||
<button type="button" class="btn "
|
||||
data-dismiss="modal">关闭</button>
|
||||
<button id="sub" type="submit"
|
||||
class="btn btn-default">确认</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal -->
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<%@ include file="include/js.jsp"%>
|
||||
<script src="<%=basePath%>js/bootstrap/bootstrap-treeview.js"></script>
|
||||
<script>
|
||||
$(function () {
|
||||
var data = <s:property value="result" escape='false' />;
|
||||
console.log(data);
|
||||
$("#treeview4").treeview({
|
||||
color: "#428bca",
|
||||
enableLinks:true,
|
||||
nodeIcon: "glyphicon glyphicon-user",
|
||||
data: data,
|
||||
levels: 4,
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
281
admin/src/main/webapp/admin_combo_list.jsp
Executable file
281
admin/src/main/webapp/admin_combo_list.jsp
Executable file
@@ -0,0 +1,281 @@
|
||||
<%@ page language="java" pageEncoding="utf-8" isELIgnored="false"%>
|
||||
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
||||
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
|
||||
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
|
||||
<jsp:useBean id="security" class="security.web.BaseSecurityAction" scope="page" />
|
||||
|
||||
<%@ include file="include/pagetop.jsp"%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<%@ include file="include/head.jsp"%>
|
||||
</head>
|
||||
<body class="ifr-dody">
|
||||
<%@ include file="include/loading.jsp"%>
|
||||
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
<!-- START CONTENT -->
|
||||
<div class="ifr-con">
|
||||
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
<!-- START CONTAINER -->
|
||||
<div class="container-default">
|
||||
<h3>店铺直通车</h3>
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
<!-- START queryForm -->
|
||||
<%@ include file="include/alert.jsp"%>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="panel panel-default">
|
||||
|
||||
<div class="panel-title">查询条件</div>
|
||||
<div class="panel-body">
|
||||
|
||||
<form class="form-horizontal" action="<%=basePath%>/mall/combo/list.action" method="post"
|
||||
id="queryForm">
|
||||
<input type="hidden" name="pageNo" id="pageNo"
|
||||
value="${param.pageNo}">
|
||||
<div class="col-md-12 col-lg-4">
|
||||
<fieldset>
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<input id="name" name="name" class="form-control"
|
||||
placeholder="套餐名称" value = "${name}"/>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
<div class="col-md-12 col-lg-2">
|
||||
<input id="startTime" name="startTime" class="form-control "
|
||||
placeholder="开始日期" value="${startTime}" />
|
||||
</div>
|
||||
<div class="col-md-12 col-lg-2">
|
||||
|
||||
<input id="endTime" name="endTime" class="form-control "
|
||||
placeholder="结束日期" value="${endTime}" />
|
||||
</div>
|
||||
|
||||
<div class="col-md-12 col-lg-2">
|
||||
<button type="submit" class="btn btn-light btn-block">查询</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- END queryForm -->
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
|
||||
|
||||
<div class="row">
|
||||
|
||||
|
||||
<div class="col-md-12">
|
||||
<!-- Start Panel -->
|
||||
<div class="panel panel-default">
|
||||
|
||||
<c:if test="${security.isRolesAccessible('ROLE_ROOT,ROLE_ADMIN')
|
||||
|| security.isResourceAccessible('OP_COMBO_OPERATE')}">
|
||||
|
||||
<a href="<%=basePath%>/mall/combo/toAdd.action?pageNo=${pageNo}" class="btn btn-light" style="margin-bottom: 10px">
|
||||
<i class="fa fa-pencil"></i>新增套餐</a>
|
||||
|
||||
</c:if>
|
||||
|
||||
<%-- <a href="<%=basePath%>normal/adminMinerAction!toAdd.action" class="btn btn-light"
|
||||
style="margin-bottom: 10px"><i class="fa fa-pencil"></i>新增</a> --%>
|
||||
<div class="panel-body">
|
||||
|
||||
<table class="table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>封面图</td>
|
||||
<td>套餐名称</td>
|
||||
<td>可推广产品数</td>
|
||||
<td>简介</td>
|
||||
<td>价格</td>
|
||||
<td>有效期</td>
|
||||
<td>创建日期</td>
|
||||
<td width="130px"></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<c:forEach items="${page.getElements()}" var="item"
|
||||
varStatus="stat">
|
||||
<tr>
|
||||
<td>
|
||||
<img width="60px" height="60px" id="show_img" src="${item.iconImg}"/>
|
||||
</td>
|
||||
<td>${item.name}</td>
|
||||
<td>${item.promoteNum}</td>
|
||||
<td>${item.content}</td>
|
||||
<td>${item.amount}</td>
|
||||
<td>${item.day}</td>
|
||||
<td>${item.createTime}</td>
|
||||
|
||||
<td>
|
||||
<c:if test="${security.isRolesAccessible('ROLE_ROOT,ROLE_ADMIN')
|
||||
|| security.isResourceAccessible('OP_COMBO_OPERATE')}">
|
||||
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-light">操作</button>
|
||||
<button type="button" class="btn btn-light dropdown-toggle"
|
||||
data-toggle="dropdown" aria-expanded="false">
|
||||
<span class="caret"></span> <span class="sr-only">Toggle Dropdown</span>
|
||||
</button>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
|
||||
<li><a href="<%=basePath%>/mall/combo/toUpdate.action?lang=cn&comboId=${item.comboId}">修改</a></li>
|
||||
<li><a href="javascript:toDelete('${item.comboId}')">删除</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</c:if>
|
||||
</td>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
<%@ include file="include/page_simple.jsp"%>
|
||||
<nav>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- End Panel -->
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- END CONTAINER -->
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
|
||||
<%@ include file="include/footer.jsp"%>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<!-- End Content -->
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
|
||||
<div class="form-group">
|
||||
<form
|
||||
action=""
|
||||
method="post" id="mainform">
|
||||
<input type="hidden" name="pageNo" id="pageNo" value="${param.pageNo}">
|
||||
<input type="hidden" name="baseId" id="baseId" />
|
||||
<div class="col-sm-1 form-horizontal">
|
||||
<!-- 模态框(Modal) -->
|
||||
<div class="modal fade" id="modal_succeeded" tabindex="-1"
|
||||
role="dialog" aria-labelledby="myModalLabel"
|
||||
aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content" >
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close"
|
||||
data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h4 class="modal-title" id="myModalLabel">确认调整</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="form-group" >
|
||||
<label for="input002" class="col-sm-3 control-label form-label">登录人资金密码</label>
|
||||
<div class="col-sm-4">
|
||||
<input id="login_safeword" type="password" name="login_safeword"
|
||||
class="login_safeword" placeholder="请输入登录人资金密码" >
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="form-group" style="">
|
||||
|
||||
<label for="input002" class="col-sm-3 control-label form-label">验证码</label>
|
||||
<div class="col-sm-4">
|
||||
<input id="email_code" type="text" name="email_code"
|
||||
class="login_safeword" placeholder="请输入验证码" >
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<a id="update_email_code_button" href="javascript:updateSendCode();" class="btn btn-light" style="margin-bottom: 10px" >获取超级签验证码</a>
|
||||
</div>
|
||||
</div> -->
|
||||
<%-- <div class="form-group" >--%>
|
||||
<%-- <label for="input002" class="col-sm-3 control-label form-label">谷歌验证码</label>--%>
|
||||
<%-- <div class="col-sm-4">--%>
|
||||
<%-- <input id="google_auth_code" name="google_auth_code"--%>
|
||||
<%-- placeholder="请输入谷歌验证码" >--%>
|
||||
<%-- </div>--%>
|
||||
<%-- </div>--%>
|
||||
</div>
|
||||
<div class="modal-footer" style="margin-top: 0;">
|
||||
<button type="button" class="btn "
|
||||
data-dismiss="modal">关闭</button>
|
||||
<button id="sub" type="submit"
|
||||
class="btn btn-default">确认</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal -->
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<%@ include file="include/js.jsp"%>
|
||||
<script src="<%=basePath%>js/bootstrap/bootstrap-treeview.js"></script>
|
||||
<script>
|
||||
|
||||
|
||||
$(function () {
|
||||
var data = <s:property value="result" escape='false' />;
|
||||
console.log(data);
|
||||
$("#treeview4").treeview({
|
||||
color: "#428bca",
|
||||
enableLinks:true,
|
||||
nodeIcon: "glyphicon glyphicon-user",
|
||||
data: data,
|
||||
levels: 4,
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
$(function() {
|
||||
$('#startTime').datetimepicker({
|
||||
format : 'yyyy-mm-dd hh:ii:00',
|
||||
minuteStep:1,
|
||||
language : 'zh',
|
||||
weekStart : 1,
|
||||
todayBtn : 1,
|
||||
autoclose : 1,
|
||||
todayHighlight : 1,
|
||||
startView : 2,
|
||||
clearBtn : true
|
||||
});
|
||||
$('#endTime').datetimepicker({
|
||||
format : 'yyyy-mm-dd hh:ii:00',
|
||||
minuteStep:1,
|
||||
language : 'zh',
|
||||
weekStart : 1,
|
||||
todayBtn : 1,
|
||||
autoclose : 1,
|
||||
todayHighlight : 1,
|
||||
startView : 2,
|
||||
clearBtn : true
|
||||
});
|
||||
|
||||
});
|
||||
function toDelete(baseId,pageNo){
|
||||
$('#baseId').val(baseId);
|
||||
$('#pageNo').val(pageNo);
|
||||
$('#myModalLabel').html("删除");
|
||||
$('#mainform').attr("action","<%=basePath%>/mall/combo/delete.action");
|
||||
|
||||
$('#modal_succeeded').modal("show");
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
308
admin/src/main/webapp/admin_combo_record_list.jsp
Executable file
308
admin/src/main/webapp/admin_combo_record_list.jsp
Executable file
@@ -0,0 +1,308 @@
|
||||
<%@ page language="java" pageEncoding="utf-8" isELIgnored="false"%>
|
||||
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
||||
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
|
||||
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
|
||||
<jsp:useBean id="security" class="security.web.BaseSecurityAction" scope="page" />
|
||||
|
||||
<%@ include file="include/pagetop.jsp"%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<%@ include file="include/head.jsp"%>
|
||||
</head>
|
||||
<body class="ifr-dody">
|
||||
<%@ include file="include/loading.jsp"%>
|
||||
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
<!-- START CONTENT -->
|
||||
<div class="ifr-con">
|
||||
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
<!-- START CONTAINER -->
|
||||
<div class="container-default">
|
||||
<h3>直通车购买记录</h3>
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
<!-- START queryForm -->
|
||||
<%@ include file="include/alert.jsp"%>
|
||||
|
||||
<form action="<%=basePath%>/mall/combo/recordGoodsList.action" method="post"
|
||||
id="queryForms">
|
||||
<%-- <input type="hidden" id="pageNo" name="pageNo" value="${pageNo}"/>--%>
|
||||
<input type="hidden" id="partyId" name="partyId" value="${partyId}"/>
|
||||
</form>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="panel panel-default">
|
||||
|
||||
<div class="panel-title">查询条件</div>
|
||||
<div class="panel-body">
|
||||
|
||||
<form class="form-horizontal" action="<%=basePath%>/mall/combo/recordList.action" method="post"
|
||||
id="queryForm">
|
||||
<input type="hidden" name="pageNo" id="pageNo" value="${pageNo}">
|
||||
<div class="col-md-12 col-lg-3">
|
||||
<fieldset>
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<input id="userCode" name="userCode" class="form-control"
|
||||
placeholder="会员ID" value = "${userCode}"/>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
<div class="col-md-12 col-lg-3">
|
||||
<fieldset>
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<input id="sellerName" name="sellerName" class="form-control"
|
||||
placeholder="店铺名称" value = "${sellerName}"/>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
<div class="col-md-12 col-lg-2">
|
||||
<input id="startTime" name="startTime" class="form-control "
|
||||
placeholder="开始日期" value="${startTime}" />
|
||||
</div>
|
||||
<div class="col-md-12 col-lg-2">
|
||||
|
||||
<input id="endTime" name="endTime" class="form-control "
|
||||
placeholder="结束日期" value="${endTime}" />
|
||||
</div>
|
||||
|
||||
<div class="col-md-12 col-lg-2">
|
||||
<button type="submit" class="btn btn-light btn-block">查询</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- END queryForm -->
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
|
||||
|
||||
<div class="row">
|
||||
|
||||
|
||||
<div class="col-md-12">
|
||||
<!-- Start Panel -->
|
||||
<div class="panel panel-default">
|
||||
|
||||
<div class="panel-body">
|
||||
|
||||
<table class="table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>会员ID</td>
|
||||
<td>账号类型</td>
|
||||
<td>店铺名称</td>
|
||||
<td>套餐名称</td>
|
||||
<td>套餐价格</td>
|
||||
<td>可推广产品数</td>
|
||||
<td>有效期</td>
|
||||
<td>已推广天数</td>
|
||||
<td>已选择商品</td>
|
||||
<td>提交时间</td>
|
||||
<td>到期时间</td>
|
||||
<%-- <td width="130px"></td>--%>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<c:forEach items="${page.getElements()}" var="item"
|
||||
varStatus="stat">
|
||||
<tr>
|
||||
<td>${item.userCode}</td>
|
||||
<td>
|
||||
<c:if test="${item.roleName == 'GUEST'}">
|
||||
<span class="right label label-warning">演示账号</span>
|
||||
</c:if>
|
||||
<c:if test="${item.roleName == 'MEMBER'}">
|
||||
<span class="right label label-success">正式账号</span>
|
||||
</c:if>
|
||||
</td>
|
||||
<td>${item.sellerName}</td>
|
||||
<td>${item.name}</td>
|
||||
<td>${item.amount}</td>
|
||||
<td>${item.promoteNum}</td>
|
||||
<td>${item.day}</td>
|
||||
<td>${item.promoteDay}</td>
|
||||
<td><a href="#" onClick="getGoodsNum('${item.sellerId}')">${item.goodsNum}</a></td>
|
||||
<td>${item.createTime}</td>
|
||||
<td>${item.stopTimes}</td>
|
||||
<%-- <td>--%>
|
||||
<%-- <c:if test="${security.isRolesAccessible('ROLE_ROOT,ROLE_ADMIN')--%>
|
||||
<%-- || security.isResourceAccessible('OP_CATEGORY_OPERATE')}">--%>
|
||||
|
||||
<%-- <div class="btn-group">--%>
|
||||
<%-- <button type="button" class="btn btn-light">操作</button>--%>
|
||||
<%-- <button type="button" class="btn btn-light dropdown-toggle"--%>
|
||||
<%-- data-toggle="dropdown" aria-expanded="false">--%>
|
||||
<%-- <span class="caret"></span> <span class="sr-only">Toggle Dropdown</span>--%>
|
||||
<%-- </button>--%>
|
||||
<%-- <ul class="dropdown-menu" role="menu">--%>
|
||||
|
||||
<%-- <li><a href="<%=basePath%>/mall/combo/toUpdate.action?lang=cn&comboId=${item.comboId}">修改</a></li>--%>
|
||||
<%-- <li><a href="javascript:toDelete('${item.id}')">删除</a></li>--%>
|
||||
<%-- </ul>--%>
|
||||
<%-- </div>--%>
|
||||
<%-- </c:if>--%>
|
||||
<%-- </td>--%>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
<%@ include file="include/page_simple.jsp"%>
|
||||
<nav>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- End Panel -->
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- END CONTAINER -->
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
|
||||
<%@ include file="include/footer.jsp"%>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<!-- End Content -->
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
|
||||
<div class="form-group">
|
||||
<form
|
||||
action=""
|
||||
method="post" id="mainform">
|
||||
<input type="hidden" name="pageNo" id="pageNo" value="${param.pageNo}">
|
||||
<input type="hidden" name="baseId" id="baseId" />
|
||||
<div class="col-sm-1 form-horizontal">
|
||||
<!-- 模态框(Modal) -->
|
||||
<div class="modal fade" id="modal_succeeded" tabindex="-1"
|
||||
role="dialog" aria-labelledby="myModalLabel"
|
||||
aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content" >
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close"
|
||||
data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h4 class="modal-title" id="myModalLabel">确认调整</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="form-group" >
|
||||
<label for="input002" class="col-sm-3 control-label form-label">登录人资金密码</label>
|
||||
<div class="col-sm-4">
|
||||
<input id="login_safeword" type="password" name="login_safeword"
|
||||
class="login_safeword" placeholder="请输入登录人资金密码" >
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="form-group" style="">
|
||||
|
||||
<label for="input002" class="col-sm-3 control-label form-label">验证码</label>
|
||||
<div class="col-sm-4">
|
||||
<input id="email_code" type="text" name="email_code"
|
||||
class="login_safeword" placeholder="请输入验证码" >
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<a id="update_email_code_button" href="javascript:updateSendCode();" class="btn btn-light" style="margin-bottom: 10px" >获取超级签验证码</a>
|
||||
</div>
|
||||
</div> -->
|
||||
<%-- <div class="form-group" >--%>
|
||||
<%-- <label for="input002" class="col-sm-3 control-label form-label">谷歌验证码</label>--%>
|
||||
<%-- <div class="col-sm-4">--%>
|
||||
<%-- <input id="google_auth_code" name="google_auth_code"--%>
|
||||
<%-- placeholder="请输入谷歌验证码" >--%>
|
||||
<%-- </div>--%>
|
||||
<%-- </div>--%>
|
||||
</div>
|
||||
<div class="modal-footer" style="margin-top: 0;">
|
||||
<button type="button" class="btn "
|
||||
data-dismiss="modal">关闭</button>
|
||||
<button id="sub" type="submit"
|
||||
class="btn btn-default">确认</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal -->
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
<%@ include file="include/js.jsp"%>
|
||||
<script src="<%=basePath%>js/bootstrap/bootstrap-treeview.js"></script>
|
||||
<script>
|
||||
|
||||
|
||||
$(function () {
|
||||
var data = <s:property value="result" escape='false' />;
|
||||
console.log(data);
|
||||
$("#treeview4").treeview({
|
||||
color: "#428bca",
|
||||
enableLinks:true,
|
||||
nodeIcon: "glyphicon glyphicon-user",
|
||||
data: data,
|
||||
levels: 4,
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
$(function() {
|
||||
$('#startTime').datetimepicker({
|
||||
format : 'yyyy-mm-dd hh:ii:00',
|
||||
minuteStep:1,
|
||||
language : 'zh',
|
||||
weekStart : 1,
|
||||
todayBtn : 1,
|
||||
autoclose : 1,
|
||||
todayHighlight : 1,
|
||||
startView : 2,
|
||||
clearBtn : true
|
||||
});
|
||||
$('#endTime').datetimepicker({
|
||||
format : 'yyyy-mm-dd hh:ii:00',
|
||||
minuteStep:1,
|
||||
language : 'zh',
|
||||
weekStart : 1,
|
||||
todayBtn : 1,
|
||||
autoclose : 1,
|
||||
todayHighlight : 1,
|
||||
startView : 2,
|
||||
clearBtn : true
|
||||
});
|
||||
|
||||
});
|
||||
function toDelete(baseId,pageNo){
|
||||
$('#baseId').val(baseId);
|
||||
$('#pageNo').val(pageNo);
|
||||
$('#myModalLabel').html("删除");
|
||||
$('#mainform').attr("action","<%=basePath%>/mall/combo/delete.action");
|
||||
|
||||
$('#modal_succeeded').modal("show");
|
||||
}
|
||||
|
||||
function getGoodsNum(id){
|
||||
$("#partyId").val(id);
|
||||
$("#pageNo").val(1);
|
||||
$("#queryForms").submit();
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
303
admin/src/main/webapp/admin_combo_update.jsp
Executable file
303
admin/src/main/webapp/admin_combo_update.jsp
Executable file
@@ -0,0 +1,303 @@
|
||||
<%@ page language="java" pageEncoding="utf-8" isELIgnored="false"%>
|
||||
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
||||
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
|
||||
|
||||
<%@ include file="include/pagetop.jsp"%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<%@ include file="include/head.jsp"%>
|
||||
</head>
|
||||
<body>
|
||||
<%@ include file="include/loading.jsp"%>
|
||||
<%-- <%@ include file="include/top.jsp"%> --%>
|
||||
<%-- <%@ include file="include/menu_left.jsp"%> --%>
|
||||
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
<!-- START CONTENT -->
|
||||
<style>
|
||||
.sweet-alert{
|
||||
top:20%!important;
|
||||
}
|
||||
</style>
|
||||
<div class="ifr-dody">
|
||||
|
||||
|
||||
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
<!-- START CONTAINER -->
|
||||
<div class="ifr-con">
|
||||
<ul class="nav nav-tabs">
|
||||
<li><a href="<%=bases%>/mall/combo/toUpdate.action?lang=en&comboId=${comboId}">英文</a></li>
|
||||
<li><a href="<%=bases%>/mall/combo/toUpdate.action?lang=vi&comboId=${comboId}">越南语</a></li>
|
||||
<li><a href="<%=bases%>/mall/combo/toUpdate.action?lang=hi&comboId=${comboId}">印度语</a></li>
|
||||
<li><a href="<%=bases%>/mall/combo/toUpdate.action?lang=id&comboId=${comboId}">印度尼西亚语</a></li>
|
||||
<li><a href="<%=bases%>/mall/combo/toUpdate.action?lang=de&comboId=${comboId}">德语</a></li>
|
||||
<li><a href="<%=bases%>/mall/combo/toUpdate.action?lang=fr&comboId=${comboId}">法语</a></li>
|
||||
<li><a href="<%=bases%>/mall/combo/toUpdate.action?lang=ru&comboId=${comboId}">俄语</a></li>
|
||||
<li><a href="<%=bases%>/mall/combo/toUpdate.action?lang=es&comboId=${comboId}">西班牙语</a></li>
|
||||
<li><a href="<%=bases%>/mall/combo/toUpdate.action?lang=pt&comboId=${comboId}">葡萄牙语</a></li>
|
||||
<li><a href="<%=bases%>/mall/combo/toUpdate.action?lang=it&comboId=${comboId}">意大利语</a></li>
|
||||
<li><a href="<%=bases%>/mall/combo/toUpdate.action?lang=ms&comboId=${comboId}">马来西亚语</a></li>
|
||||
<li><a href="<%=bases%>/mall/combo/toUpdate.action?lang=af&comboId=${comboId}">南非荷兰语</a></li>
|
||||
<li><a href="<%=bases%>/mall/combo/toUpdate.action?lang=el&comboId=${comboId}">希腊语</a></li>
|
||||
<li><a href="<%=bases%>/mall/combo/toUpdate.action?lang=tw&comboId=${comboId}">中文繁体</a></li>
|
||||
<li><a href="<%=bases%>/mall/combo/toUpdate.action?lang=cn&comboId=${comboId}">中文简体</a></li>
|
||||
<li><a href="<%=bases%>/mall/combo/toUpdate.action?lang=tr&comboId=${comboId}">土耳其语</a></li>
|
||||
<li><a href="<%=bases%>/mall/combo/toUpdate.action?lang=ja&comboId=${comboId}">日语</a></li>
|
||||
<li><a href="<%=bases%>/mall/combo/toUpdate.action?lang=ko&comboId=${comboId}">韩语</a></li>
|
||||
<li><a href="<%=bases%>/mall/combo/toUpdate.action?lang=th&comboId=${comboId}">泰语</a></li>
|
||||
<li><a href="<%=bases%>/mall/combo/toUpdate.action?lang=ph&comboId=${comboId}">菲律宾语</a></li>
|
||||
<li><a href="<%=bases%>/mall/combo/toUpdate.action?lang=ar&comboId=${comboId}">阿拉伯语</a></li>
|
||||
</ul>
|
||||
<h3>店铺直通车</h3>
|
||||
<%@ include file="include/alert.jsp"%>
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
<!-- START queryForm -->
|
||||
<form action="<%=basePath%>/mall/combo/list.action"
|
||||
method="post" id="queryForm">
|
||||
<input type="hidden" name="pageNo" id="pageNo"/>
|
||||
</form>
|
||||
<!-- END queryForm -->
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-lg-12">
|
||||
<div class="panel panel-default">
|
||||
|
||||
<div class="panel-title">
|
||||
编辑店铺直通车
|
||||
<ul class="panel-tools">
|
||||
<li><a class="icon minimise-tool"><i
|
||||
class="fa fa-minus"></i></a></li>
|
||||
<li><a class="icon expand-tool"><i class="fa fa-expand"></i></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="panel-body">
|
||||
<form class="form-horizontal"
|
||||
action="<%=basePath%>/mall/combo/update.action"
|
||||
method="post" name="mainForm" id="mainForm">
|
||||
<input type="hidden" name="id" id="id" value = "${id}"/>
|
||||
<input type="hidden" name="comboId" id="comboId" value = "${comboId}"/>
|
||||
<input type="hidden" name="iconImg" id="iconImg" value = "${iconImg}"/>
|
||||
<input type="hidden" name="comboLanId" id="comboLanId" value = "${comboLanId}"/>
|
||||
<input type="hidden" name="lang" id="lang" value = "${lang}"/>
|
||||
<input type="hidden" name="pageNo" id="pageNo" value = "${pageNo}"/>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label form-label">封面图(*)</label>
|
||||
|
||||
<div class="col-sm-3" style="display: flex;">
|
||||
<input type="file" id="fileName" name="fileName" value="${fileName}" onchange="upload();" multiple="multiple" style="position:absolute;opacity:0;">
|
||||
<label for="fileName">
|
||||
|
||||
<div class="avatar">
|
||||
<img width="90px" height="90px" id="show_img" src="<%=base%>/image/add.png" />
|
||||
</div>
|
||||
|
||||
</label>
|
||||
<div style="float: left;width: 100%;margin-top: 5px; color: red">图片尺寸:( 750px * 750px )</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label form-label" style="color: red">套餐名称</label>
|
||||
<div class="col-sm-3" style="display: flex;">
|
||||
<input id="name" name="name" class="form-control" value="${name}" placeholder="请输入套餐名称" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label form-label" >可推广产品数</label>
|
||||
<div class="col-sm-3" style="display: flex;">
|
||||
<input id="promoteNum" name="promoteNum" class="form-control" value="${promoteNum}" placeholder="请输入可推广产品数" oninput="value=value.replace(/[^\d]/g,'')"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label form-label" style="color: red">简介</label>
|
||||
<div class="col-sm-3" style="display: flex;">
|
||||
<input id="content" name="content" class="form-control" value="${content}" placeholder="请输入简介" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label form-label">价格</label>
|
||||
<div class="col-sm-3" style="display: flex;">
|
||||
<input id="amount" name="amount" class="form-control" value="${amount}" placeholder="请输入价格 单位:美元" /><span style="width: 10%">美元</span>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label form-label">有效期</label>
|
||||
<div class="col-sm-3" style="display: flex;">
|
||||
<input id="day" name="day" class="form-control" value="${day}" placeholder="请输入有效期 单位:天" oninput="value=value.replace(/[^\d]/g,'')"/>
|
||||
<span style="width: 10%">天</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label form-label">每小时最小流量</label>
|
||||
<div class="col-sm-3" style="display: flex;">
|
||||
<input id="baseAccessNum" name="baseAccessNum" class="form-control" value="${baseAccessNum}" placeholder="请输入基础访问量" oninput="value=value.replace(/[^\d]/g,'')"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label form-label">每小时流量波动范围</label>
|
||||
<div class="col-sm-5">
|
||||
<input id="autoAccMin" style="width: 193px; float: left; margin-right: 10px;" name="autoAccMin" class="form-control " value="${autoAccMin}" oninput="value=value.replace(/[^\d]/g,'')" />
|
||||
<span style="margin-top: 5px;float: left;margin-right: 10px;">-</span>
|
||||
<input id="autoAccMax" style="width: 192px;float: left;" name="autoAccMax" class="form-control "
|
||||
value="${autoAccMax}" oninput="value=value.replace(/[^\d]/g,'')"/>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label form-label">预计浏览量</label>
|
||||
<div class="col-sm-3">
|
||||
<input id="estimatedVisits" name="estimatedVisits" class="form-control" readonly = true value="${(baseAccessNum + 1 + autoAccMin ) * 24} ~ ${(baseAccessNum + 1 + autoAccMax) * 24}"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%-- <div class="col-sm-1">--%>
|
||||
<%-- <!-- 模态框(Modal) -->--%>
|
||||
<%-- <div class="modal fade" id="modal_succeeded" tabindex="-1"--%>
|
||||
<%-- role="dialog" aria-labelledby="myModalLabel"--%>
|
||||
<%-- aria-hidden="true">--%>
|
||||
<%-- <div class="modal-dialog">--%>
|
||||
<%-- <div class="modal-content" style="width: 350px;">--%>
|
||||
<%-- <div class="modal-header">--%>
|
||||
<%-- <button type="button" class="close"--%>
|
||||
<%-- data-dismiss="modal" aria-hidden="true">×</button>--%>
|
||||
<%-- <h4 class="modal-title" id="myModalLabel">登录人资金密码</h4>--%>
|
||||
<%-- </div>--%>
|
||||
<%-- <div class="modal-body">--%>
|
||||
<%-- <div class="" >--%>
|
||||
<%-- <input id="login_safeword" type="password" name="login_safeword"--%>
|
||||
<%-- class="login_safeword" placeholder="请输入登录人资金密码" style="width: 250px;">--%>
|
||||
<%-- </div>--%>
|
||||
<%-- </div>--%>
|
||||
<%-- <div class="modal-footer" style="margin-top: 0;">--%>
|
||||
<%-- <button type="button" class="btn "--%>
|
||||
<%-- data-dismiss="modal">关闭</button>--%>
|
||||
<%-- <button id="sub" type="submit"--%>
|
||||
<%-- class="btn btn-default" >确认</button>--%>
|
||||
<%-- </div>--%>
|
||||
<%-- </div>--%>
|
||||
<%-- <!-- /.modal-content -->--%>
|
||||
<%-- </div>--%>
|
||||
<%-- <!-- /.modal -->--%>
|
||||
<%-- </div>--%>
|
||||
<%-- </div>--%>
|
||||
<%-- --%>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-2 col-sm-10">
|
||||
<a href="javascript:goUrl(${pageNo})"
|
||||
class="btn">取消</a> <a href="javascript:submit()"
|
||||
class="btn btn-default">保存</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<!-- END CONTAINER -->
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
|
||||
|
||||
<%@ include file="include/footer.jsp"%>
|
||||
|
||||
|
||||
</div>
|
||||
<!-- End Content -->
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<%@ include file="include/js.jsp"%>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
// function submit() {
|
||||
// $('#modal_succeeded').modal("show");
|
||||
// }
|
||||
|
||||
function submit() {
|
||||
swal({
|
||||
title : "是否保存?",
|
||||
text : "",
|
||||
type : "warning",
|
||||
showCancelButton : true,
|
||||
confirmButtonColor : "#DD6B55",
|
||||
confirmButtonText : "确认",
|
||||
closeOnConfirm : false
|
||||
}, function() {
|
||||
document.getElementById("mainForm").submit();
|
||||
});
|
||||
|
||||
}
|
||||
//初始化执行一次
|
||||
setTimeout(function() {
|
||||
start();
|
||||
}, 100);
|
||||
|
||||
function start(){
|
||||
var img = $("#iconImg").val();
|
||||
var show_img = document.getElementById('show_img');
|
||||
show_img.src=img;
|
||||
console.log(img)
|
||||
}
|
||||
|
||||
|
||||
|
||||
function upload(){
|
||||
var c = document.getElementById('fileName');
|
||||
var fileReader = new FileReader();
|
||||
var formData = new FormData();
|
||||
var file = document.getElementById('fileName').files[0];
|
||||
formData.append("file", file);
|
||||
formData.append("moduleName","type");
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "<%=basePath%>normal/uploadimg!execute.action",
|
||||
data: formData,
|
||||
dataType: "json",
|
||||
contentType: false,
|
||||
processData: false,
|
||||
success : function(data) {
|
||||
console.log(data);
|
||||
$("#iconImg").val(data.data)
|
||||
var show_img = document.getElementById('show_img');
|
||||
show_img.src=data.data;
|
||||
|
||||
},
|
||||
error : function(XMLHttpRequest, textStatus,
|
||||
errorThrown) {
|
||||
console.log("请求错误");
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
$(function(){
|
||||
$('.nav-tabs a').filter(function() {
|
||||
var b = document.URL;
|
||||
var a = "<%=bases%>/mall/combo/toUpdate.action?lang=${lang}&comboId=${comboId}";
|
||||
return this.href == "<%=bases%>/mall/combo/toUpdate.action?lang=${lang}&comboId=${comboId}"; //获取当前页面的地址
|
||||
}).closest('li').addClass('active'); //给当前最靠近的li(其实是现在进入的li)添加‘active’样式
|
||||
|
||||
})
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
606
admin/src/main/webapp/admin_comment_add.jsp
Executable file
606
admin/src/main/webapp/admin_comment_add.jsp
Executable file
@@ -0,0 +1,606 @@
|
||||
<%@ page language="java" pageEncoding="utf-8" isELIgnored="false"%>
|
||||
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
||||
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
|
||||
|
||||
<%@ include file="include/pagetop.jsp"%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<%@ include file="include/head.jsp"%>
|
||||
</head>
|
||||
<body>
|
||||
<%@ include file="include/loading.jsp"%>
|
||||
|
||||
|
||||
|
||||
<%-- <%@ include file="include/top.jsp"%> --%>
|
||||
<%-- <%@ include file="include/menu_left.jsp"%> --%>
|
||||
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
<!-- START CONTENT -->
|
||||
|
||||
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
<!-- START CONTAINER -->
|
||||
<div class="ifr-con">
|
||||
<h3>进店评价</h3>
|
||||
<%@ include file="include/alert.jsp"%>
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
<!-- START queryForm -->
|
||||
<form action="<%=basePath%>/mall/goods/sellerGoodsList.action"
|
||||
method="post" id="queryForm">
|
||||
<input type="hidden" name="pageNo" id="pageNo"/>
|
||||
</form>
|
||||
<!-- END queryForm -->
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-lg-12">
|
||||
<div class="panel panel-default">
|
||||
|
||||
<div class="panel-title">
|
||||
进店评价
|
||||
<ul class="panel-tools">
|
||||
<li><a class="icon minimise-tool"><i
|
||||
class="fa fa-minus"></i></a></li>
|
||||
<li><a class="icon expand-tool"><i class="fa fa-expand"></i></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="panel-body">
|
||||
<form class="form-horizontal"
|
||||
style="position: relative;"
|
||||
action="<%=basePath%>/admin/evaluation/addFakeComment.action"
|
||||
method="post" name="mainForm" id="mainForm">
|
||||
<%-- <div style="position: absolute;left:900px;top: 90px;padding: 40px 80px;border-radius: 5%;background: #B9F98E;color: #0A451D;">黑色标题属于公共部分</div>--%>
|
||||
<input type="hidden" name="sellerGoodsId" id="sellerGoodsId" value = "${sellerGoodsId}"/>
|
||||
<input type="hidden" name="sellerId" id="sellerId" value = "${sellerId}"/>
|
||||
<input type="hidden" name="imgUrl1" id="imgUrl1" value = "${imgUrl1}"/>
|
||||
<input type="hidden" name="imgUrl2" id="imgUrl2" value = "${imgUrl2}"/>
|
||||
<input type="hidden" name="imgUrl3" id="imgUrl3" value = "${imgUrl3}"/>
|
||||
<input type="hidden" name="imgUrl4" id="imgUrl4" value = "${imgUrl4}"/>
|
||||
<input type="hidden" name="imgUrl5" id="imgUrl5" value = "${imgUrl5}"/>
|
||||
<input type="hidden" name="imgUrl6" id="imgUrl6" value = "${imgUrl6}"/>
|
||||
<input type="hidden" name="imgUrl7" id="imgUrl7" value = "${imgUrl7}"/>
|
||||
<input type="hidden" name="imgUrl8" id="imgUrl8" value = "${imgUrl8}"/>
|
||||
<input type="hidden" name="imgUrl9" id="imgUrl9" value = "${imgUrl9}"/>
|
||||
<input type="hidden" name="pageNo" id="pageNo" value = "${pageNo}"/>
|
||||
|
||||
<div class="form-group" style="">
|
||||
<label class="col-sm-2 control-label form-label">评论图片(*)</label>
|
||||
|
||||
<div class="" style="display: flex;justify-content: start;">
|
||||
<div>
|
||||
<input type="file" id="fileName1" name="fileName1" value="${fileName1}" onchange="upload1();" style="position:absolute;opacity:0;">
|
||||
<label for="fileName1">
|
||||
<div class="avatar"><img width="90px" height="90px" id="show_img1" src="<%=base%>/image/add.png" /></div>
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
<input type="file" id="fileName2" name="fileName2" value="${fileName2}" onchange="upload2();" style="position:absolute;opacity:0;">
|
||||
<label for="fileName2">
|
||||
<div class="avatar"><img width="90px" height="90px" id="show_img2" src="<%=base%>/image/add.png" /></div>
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
<input type="file" id="fileName3" name="fileName3" value="${fileName3}" onchange="upload3();" style="position:absolute;opacity:0;">
|
||||
<label for="fileName3">
|
||||
<div class="avatar"><img width="90px" height="90px" id="show_img3" src="<%=base%>/image/add.png" /></div>
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
<input type="file" id="fileName4" name="fileName" value="${fileName4}" onchange="upload4();" style="position:absolute;opacity:0;">
|
||||
<label for="fileName4">
|
||||
<div class="avatar"><img width="90px" height="90px" id="show_img4" src="<%=base%>/image/add.png" /></div>
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
<input type="file" id="fileName5" name="fileName" value="${fileName5}" onchange="upload5();" style="position:absolute;opacity:0;">
|
||||
<label for="fileName5">
|
||||
<div class="avatar"><img width="90px" height="90px" id="show_img5" src="<%=base%>/image/add.png" /></div>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<%-- <div style="width: 100%;margin-top: 5px; color: red">图片尺寸:( 750px * 750px )</div>--%>
|
||||
<label class="col-sm-2 control-label form-label" style="margin-top: 5px; color: red"></label>
|
||||
</div>
|
||||
|
||||
<div class="form-group" style="">
|
||||
<label class="col-sm-2 control-label form-label"></label>
|
||||
|
||||
<div class="" style="display: flex;justify-content: start;">
|
||||
<div>
|
||||
<input type="file" id="fileName6" name="fileName6" value="${fileName6}" onchange="upload6();" style="position:absolute;opacity:0;">
|
||||
<label for="fileName6">
|
||||
<div class="avatar"><img width="90px" height="90px" id="show_img6" src="<%=base%>/image/add.png" /></div>
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
<input type="file" id="fileName7" name="fileName7" value="${fileName7}" onchange="upload7();" style="position:absolute;opacity:0;">
|
||||
<label for="fileName7">
|
||||
<div class="avatar"><img width="90px" height="90px" id="show_img7" src="<%=base%>/image/add.png" /></div>
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
<input type="file" id="fileName8" name="fileName" value="${fileName8}" onchange="upload8();" style="position:absolute;opacity:0;">
|
||||
<label for="fileName8">
|
||||
<div class="avatar"><img width="90px" height="90px" id="show_img8" src="<%=base%>/image/add.png" /></div>
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
<input type="file" id="fileName9" name="fileName9" value="${fileName9}" onchange="upload9();" style="position:absolute;opacity:0;">
|
||||
<label for="fileName9">
|
||||
<div class="avatar"><img width="90px" height="90px" id="show_img9" src="<%=base%>/image/add.png" /></div>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<%-- <div style="width: 100%;margin-top: 5px; color: red">图片尺寸:( 750px * 750px )</div>--%>
|
||||
<%-- <label class="col-sm-2 control-label form-label" style="margin-top: 5px; color: red">图片尺寸:( 750px * 750px )</label>--%>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label form-label">评分</label>
|
||||
<div class="col-sm-3">
|
||||
<input id="rating" name="rating" class="form-control" value="${rating}" placeholder="请输入1-5分" oninput="if(!/^[0-9]+$/.test(value)) value=value.replace(/\D/g,'');if(value>5)value=5;if(value<1)value=null"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label form-label">邮箱或手机号(带区号,如+86 18888888888)</label>
|
||||
<div class="col-sm-3">
|
||||
<input id="userName" name="userName" class="form-control" maxlength="64" value="${userName}" placeholder="邮箱或手机号,长度3-64位"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label form-label" style="color: red">评价内容</label>
|
||||
<div class="col-sm-4">
|
||||
<textarea class="form-control" rows="7" id="content" name="content" placeholder="请输入内容">${content}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-2 col-sm-10">
|
||||
<a href="javascript:goUrl(${pageNo})"
|
||||
class="btn">取消</a> <a href="javascript:submit()"
|
||||
class="btn btn-default">保存</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<!-- END CONTAINER -->
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
|
||||
|
||||
<%@ include file="include/footer.jsp"%>
|
||||
|
||||
|
||||
</div>
|
||||
<!-- End Content -->
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<%@ include file="include/js.jsp"%>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
// function submit() {
|
||||
// $('#modal_succeeded').modal("show");
|
||||
// }
|
||||
|
||||
// function submit() {
|
||||
// swal({
|
||||
// title : "是否保存?",
|
||||
// text : "",
|
||||
// type : "warning",
|
||||
// showCancelButton : true,
|
||||
// confirmButtonColor : "#DD6B55",
|
||||
// confirmButtonText : "确认",
|
||||
// closeOnConfirm : false
|
||||
// }, function() {
|
||||
// document.getElementById("mainForm").submit();
|
||||
// });
|
||||
//
|
||||
// }
|
||||
|
||||
|
||||
var a = true;
|
||||
|
||||
function submit() {
|
||||
swal({
|
||||
title : "是否保存?",
|
||||
text : "",
|
||||
type : "warning",
|
||||
showCancelButton : true,
|
||||
confirmButtonColor : "#DD6B55",
|
||||
confirmButtonText : "确认",
|
||||
closeOnConfirm : false
|
||||
}, function() {
|
||||
inputNull();
|
||||
if (!a){
|
||||
a = true;
|
||||
return false;
|
||||
} else {
|
||||
a = true;
|
||||
document.getElementById("mainForm").submit();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function inputNull(){
|
||||
let rating = $("#rating").val();
|
||||
let userName = $("#userName").val();
|
||||
let content = $("#content").val();
|
||||
|
||||
if(rating == ""){
|
||||
swal({
|
||||
title: "请输入评分!",
|
||||
timer: 1500,
|
||||
showConfirmButton: false
|
||||
})
|
||||
a = false;
|
||||
}
|
||||
|
||||
if(userName == ""){
|
||||
swal({
|
||||
title: "请输入邮箱或手机号!",
|
||||
timer: 1500,
|
||||
showConfirmButton: false
|
||||
})
|
||||
a = false;
|
||||
}
|
||||
|
||||
if(content == ""){
|
||||
swal({
|
||||
title: "请输入评论内容!",
|
||||
timer: 1500,
|
||||
showConfirmButton: false
|
||||
})
|
||||
a = false;
|
||||
}
|
||||
}
|
||||
|
||||
//初始化执行一次
|
||||
setTimeout(function() {
|
||||
start();
|
||||
}, 100);
|
||||
|
||||
function start(){
|
||||
var img1 = $("#imgUrl1").val();
|
||||
var show_img1 = document.getElementById('show_img1');
|
||||
show_img1.src=img1;
|
||||
|
||||
var img2 = $("#imgUrl2").val();
|
||||
var show_img2 = document.getElementById('show_img2');
|
||||
show_img2.src=img2;
|
||||
|
||||
var img3 = $("#imgUrl3").val();
|
||||
var show_img3 = document.getElementById('show_img3');
|
||||
show_img3.src=img3;
|
||||
|
||||
var img4 = $("#imgUrl4").val();
|
||||
var show_img4 = document.getElementById('show_img4');
|
||||
show_img4.src=img4;
|
||||
|
||||
var img5 = $("#imgUrl5").val();
|
||||
var show_img5 = document.getElementById('show_img5');
|
||||
show_img5.src=img5;
|
||||
|
||||
var img6 = $("#imgUrl6").val();
|
||||
var show_img6 = document.getElementById('show_img6');
|
||||
show_img6.src=img6;
|
||||
|
||||
var img7 = $("#imgUrl7").val();
|
||||
var show_img7 = document.getElementById('show_img7');
|
||||
show_img7.src=img7;
|
||||
|
||||
var img8 = $("#imgUrl8").val();
|
||||
var show_img8 = document.getElementById('show_img8');
|
||||
show_img8.src=img8;
|
||||
|
||||
var img9 = $("#imgUrl9").val();
|
||||
var show_img9 = document.getElementById('show_img9');
|
||||
show_img9.src=img9;
|
||||
|
||||
var img10 = $("#imgUrl10").val();
|
||||
var show_img10 = document.getElementById('show_img10');
|
||||
show_img10.src=img10;
|
||||
}
|
||||
function upload1(){
|
||||
var fileReader = new FileReader();
|
||||
var formData = new FormData();
|
||||
var file = document.getElementById('fileName1').files[0];
|
||||
formData.append("file", file);
|
||||
formData.append("moduleName","goods");
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "<%=basePath%>normal/uploadimg!execute.action",
|
||||
data: formData,
|
||||
dataType: "json",
|
||||
contentType: false,
|
||||
processData: false,
|
||||
success : function(data) {
|
||||
console.log(data);
|
||||
$("#imgUrl1").val(data.data)
|
||||
var show_img = document.getElementById('show_img1');
|
||||
show_img.src=data.data;
|
||||
|
||||
},
|
||||
error : function(XMLHttpRequest, textStatus,
|
||||
errorThrown) {
|
||||
console.log("请求错误");
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
function upload2(){
|
||||
var fileReader = new FileReader();
|
||||
var formData = new FormData();
|
||||
var file = document.getElementById('fileName2').files[0];
|
||||
formData.append("file", file);
|
||||
formData.append("moduleName","goods");
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "<%=basePath%>normal/uploadimg!execute.action",
|
||||
data: formData,
|
||||
dataType: "json",
|
||||
contentType: false,
|
||||
processData: false,
|
||||
success : function(data) {
|
||||
console.log(data);
|
||||
$("#imgUrl2").val(data.data)
|
||||
var show_img = document.getElementById('show_img2');
|
||||
show_img2.src=data.data;
|
||||
|
||||
},
|
||||
error : function(XMLHttpRequest, textStatus,
|
||||
errorThrown) {
|
||||
console.log("请求错误");
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
function upload3(){
|
||||
var fileReader = new FileReader();
|
||||
var formData = new FormData();
|
||||
var file = document.getElementById('fileName3').files[0];
|
||||
formData.append("file", file);
|
||||
formData.append("moduleName","goods");
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "<%=basePath%>normal/uploadimg!execute.action",
|
||||
data: formData,
|
||||
dataType: "json",
|
||||
contentType: false,
|
||||
processData: false,
|
||||
success : function(data) {
|
||||
console.log(data);
|
||||
$("#imgUrl3").val(data.data)
|
||||
var show_img = document.getElementById('show_img3');
|
||||
show_img3.src=data.data;
|
||||
|
||||
},
|
||||
error : function(XMLHttpRequest, textStatus,
|
||||
errorThrown) {
|
||||
console.log("请求错误");
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
function upload4(){
|
||||
var fileReader = new FileReader();
|
||||
var formData = new FormData();
|
||||
var file = document.getElementById('fileName4').files[0];
|
||||
formData.append("file", file);
|
||||
formData.append("moduleName","goods");
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "<%=basePath%>normal/uploadimg!execute.action",
|
||||
data: formData,
|
||||
dataType: "json",
|
||||
contentType: false,
|
||||
processData: false,
|
||||
success : function(data) {
|
||||
console.log(data);
|
||||
$("#imgUrl4").val(data.data)
|
||||
var show_img = document.getElementById('show_img4');
|
||||
show_img4.src=data.data;
|
||||
|
||||
},
|
||||
error : function(XMLHttpRequest, textStatus,
|
||||
errorThrown) {
|
||||
console.log("请求错误");
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
function upload5(){
|
||||
var fileReader = new FileReader();
|
||||
var formData = new FormData();
|
||||
var file = document.getElementById('fileName5').files[0];
|
||||
formData.append("file", file);
|
||||
formData.append("moduleName","goods");
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "<%=basePath%>normal/uploadimg!execute.action",
|
||||
data: formData,
|
||||
dataType: "json",
|
||||
contentType: false,
|
||||
processData: false,
|
||||
success : function(data) {
|
||||
console.log(data);
|
||||
$("#imgUrl5").val(data.data)
|
||||
var show_img = document.getElementById('show_img5');
|
||||
show_img5.src=data.data;
|
||||
|
||||
},
|
||||
error : function(XMLHttpRequest, textStatus,
|
||||
errorThrown) {
|
||||
console.log("请求错误");
|
||||
}
|
||||
});
|
||||
}
|
||||
function upload6(){
|
||||
var fileReader = new FileReader();
|
||||
var formData = new FormData();
|
||||
var file = document.getElementById('fileName6').files[0];
|
||||
formData.append("file", file);
|
||||
formData.append("moduleName","goods");
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "<%=basePath%>normal/uploadimg!execute.action",
|
||||
data: formData,
|
||||
dataType: "json",
|
||||
contentType: false,
|
||||
processData: false,
|
||||
success : function(data) {
|
||||
console.log(data);
|
||||
$("#imgUrl6").val(data.data)
|
||||
var show_img = document.getElementById('show_img6');
|
||||
show_img6.src=data.data;
|
||||
|
||||
},
|
||||
error : function(XMLHttpRequest, textStatus,
|
||||
errorThrown) {
|
||||
console.log("请求错误");
|
||||
}
|
||||
});
|
||||
}
|
||||
function upload7(){
|
||||
var fileReader = new FileReader();
|
||||
var formData = new FormData();
|
||||
var file = document.getElementById('fileName7').files[0];
|
||||
formData.append("file", file);
|
||||
formData.append("moduleName","goods");
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "<%=basePath%>normal/uploadimg!execute.action",
|
||||
data: formData,
|
||||
dataType: "json",
|
||||
contentType: false,
|
||||
processData: false,
|
||||
success : function(data) {
|
||||
console.log(data);
|
||||
$("#imgUrl7").val(data.data)
|
||||
var show_img = document.getElementById('show_img7');
|
||||
show_img7.src=data.data;
|
||||
|
||||
},
|
||||
error : function(XMLHttpRequest, textStatus,
|
||||
errorThrown) {
|
||||
console.log("请求错误");
|
||||
}
|
||||
});
|
||||
}
|
||||
function upload8(){
|
||||
var fileReader = new FileReader();
|
||||
var formData = new FormData();
|
||||
var file = document.getElementById('fileName8').files[0];
|
||||
formData.append("file", file);
|
||||
formData.append("moduleName","goods");
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "<%=basePath%>normal/uploadimg!execute.action",
|
||||
data: formData,
|
||||
dataType: "json",
|
||||
contentType: false,
|
||||
processData: false,
|
||||
success : function(data) {
|
||||
console.log(data);
|
||||
$("#imgUrl8").val(data.data)
|
||||
var show_img = document.getElementById('show_img8');
|
||||
show_img8.src=data.data;
|
||||
|
||||
},
|
||||
error : function(XMLHttpRequest, textStatus,
|
||||
errorThrown) {
|
||||
console.log("请求错误");
|
||||
}
|
||||
});
|
||||
}
|
||||
function upload9(){
|
||||
var fileReader = new FileReader();
|
||||
var formData = new FormData();
|
||||
var file = document.getElementById('fileName9').files[0];
|
||||
formData.append("file", file);
|
||||
formData.append("moduleName","goods");
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "<%=basePath%>normal/uploadimg!execute.action",
|
||||
data: formData,
|
||||
dataType: "json",
|
||||
contentType: false,
|
||||
processData: false,
|
||||
success : function(data) {
|
||||
console.log(data);
|
||||
$("#imgUrl9").val(data.data)
|
||||
var show_img = document.getElementById('show_img9');
|
||||
show_img9.src=data.data;
|
||||
|
||||
},
|
||||
error : function(XMLHttpRequest, textStatus,
|
||||
errorThrown) {
|
||||
console.log("请求错误");
|
||||
}
|
||||
});
|
||||
}
|
||||
function upload10(){
|
||||
var fileReader = new FileReader();
|
||||
var formData = new FormData();
|
||||
var file = document.getElementById('fileName10').files[0];
|
||||
formData.append("file", file);
|
||||
formData.append("moduleName","goods");
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "<%=basePath%>normal/uploadimg!execute.action",
|
||||
data: formData,
|
||||
dataType: "json",
|
||||
contentType: false,
|
||||
processData: false,
|
||||
success : function(data) {
|
||||
console.log(data);
|
||||
$("#imgUrl10").val(data.data)
|
||||
var show_img = document.getElementById('show_img10');
|
||||
show_img10.src=data.data;
|
||||
|
||||
},
|
||||
error : function(XMLHttpRequest, textStatus,
|
||||
errorThrown) {
|
||||
console.log("请求错误");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
<%--$(function(){--%>
|
||||
<%-- $('.nav-tabs a').filter(function() {--%>
|
||||
<%-- var a = document.URL;--%>
|
||||
<%-- <%–var a = "<%=basePath%>/mall/goods/toUpdate.action?lang=${lang}&goodsId=${goodsId}";–%>--%>
|
||||
<%-- return this.href == "<%=bases%>/mall/goods/toUpdate.action?lang=${lang}&goodsId=${goodsId}"; //获取当前页面的地址--%>
|
||||
<%-- }).closest('li').addClass('active'); //给当前最靠近的li(其实是现在进入的li)添加‘active’样式--%>
|
||||
|
||||
<%--})--%>
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
278
admin/src/main/webapp/admin_comment_list.jsp
Executable file
278
admin/src/main/webapp/admin_comment_list.jsp
Executable file
@@ -0,0 +1,278 @@
|
||||
<%@ page language="java" pageEncoding="utf-8" isELIgnored="false"%>
|
||||
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
||||
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
|
||||
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
|
||||
<jsp:useBean id="security" class="security.web.BaseSecurityAction" scope="page" />
|
||||
|
||||
<%@ include file="include/pagetop.jsp"%>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<%@ include file="include/head.jsp"%>
|
||||
</head>
|
||||
<body class="ifr-dody">
|
||||
<%@ include file="include/loading.jsp"%>
|
||||
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
<!-- START CONTENT -->
|
||||
<div class="ifr-con">
|
||||
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
<!-- START CONTAINER -->
|
||||
<div class="container-default">
|
||||
<h3>评论库</h3>
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
<!-- START queryForm -->
|
||||
<%@ include file="include/alert.jsp"%>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="panel panel-default">
|
||||
|
||||
<div class="panel-title">查询条件</div>
|
||||
<div class="panel-body">
|
||||
|
||||
<form class="form-horizontal"
|
||||
action="<%=basePath%>/mall/comment/list.action"
|
||||
method="post" id="queryForm">
|
||||
<input type="hidden" name="pageNo" id="pageNo" value="${pageNo}">
|
||||
|
||||
<div class="col-md-12 col-lg-3">
|
||||
<fieldset>
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<select id="status" name="status"
|
||||
class="form-control ">
|
||||
<option value="-2">状态</option>
|
||||
<option value="0" <c:if test="${status == '0'}">selected="true"</c:if>>启用</option>
|
||||
<option value="1" <c:if test="${status == '1'}">selected="true"</c:if>>禁用</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-12 col-lg-2" >
|
||||
<button type="submit" class="btn btn-light btn-block">查询</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
|
||||
|
||||
<div class="col-md-12">
|
||||
<!-- Start Panel -->
|
||||
<div class="panel panel-default">
|
||||
|
||||
<c:if test="${security.isRolesAccessible('ROLE_ROOT,ROLE_ADMIN')
|
||||
|| security.isResourceAccessible('OP_CATEGORY_OPERATE')}">
|
||||
|
||||
<a href="<%=basePath%>/mall/comment/toAdd.action?pageNo=${pageNo}" class="btn btn-light" style="margin-bottom: 10px">
|
||||
<i class="fa fa-pencil"></i>新增评论</a>
|
||||
|
||||
</c:if>
|
||||
|
||||
<%-- <a href="<%=basePath%>normal/adminMinerAction!toAdd.action" class="btn btn-light"
|
||||
style="margin-bottom: 10px"><i class="fa fa-pencil"></i>新增</a> --%>
|
||||
<div class="panel-body">
|
||||
|
||||
<table class="table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
|
||||
<td>评分</td>
|
||||
<td>评价内容</td>
|
||||
<td>状态</td>
|
||||
<td>创建时间</td>
|
||||
<td width="130px"></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<c:forEach items="${page.getElements()}" var="item"
|
||||
varStatus="stat">
|
||||
<tr>
|
||||
<td>${item.score}</td>
|
||||
<td>${item.content}</td>
|
||||
<td>
|
||||
<c:choose>
|
||||
<c:when test="${item.status == '0'}">
|
||||
<span class="right label label-success">启用</span>
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
<span class="right label label-danger">禁用</span>
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
</td>
|
||||
<td>${item.createTime}</td>
|
||||
<td>
|
||||
<c:if test="${security.isRolesAccessible('ROLE_ROOT,ROLE_ADMIN')
|
||||
|| security.isResourceAccessible('OP_PLATFORM_OPERATE')}">
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-light">操作</button>
|
||||
<button type="button" class="btn btn-light dropdown-toggle"
|
||||
data-toggle="dropdown" aria-expanded="false">
|
||||
<span class="caret"></span> <span class="sr-only">Toggle
|
||||
Dropdown</span>
|
||||
</button>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li><a href="<%=basePath%>/mall/comment/toUpdate.action?id=${item.id}">评论详情</a></li>
|
||||
<c:choose>
|
||||
<c:when test="${item.status == '0'}">
|
||||
<li><a href="<%=basePath%>/mall/comment/updateStatus.action?&id=${item.id}&status=1">禁用</a></li>
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
<li><a href="<%=basePath%>/mall/comment/updateStatus.action?&id=${item.id}&status=0">启用</a></li>
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
<li><a href="<%=basePath%>/mall/comment/delete.action?id=${item.id}&page=${page}">删除 </a></li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</c:if>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
</c:forEach>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
<%@ include file="include/page_simple.jsp"%>
|
||||
<nav>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- End Panel -->
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- END CONTAINER -->
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
|
||||
<%@ include file="include/footer.jsp"%>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<!-- End Content -->
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
|
||||
<div class="form-group">
|
||||
<form
|
||||
action=""
|
||||
method="post" id="mainform">
|
||||
<input type="hidden" name="pageNo" id="pageNo"
|
||||
value="${pageNo}">
|
||||
<input type="hidden" name="id" id="id"/>
|
||||
<div class="col-sm-1 form-horizontal">
|
||||
<!-- 模态框(Modal) -->
|
||||
<div class="modal fade" id="modal_succeeded" tabindex="-1"
|
||||
role="dialog" aria-labelledby="myModalLabel"
|
||||
aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content" >
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close"
|
||||
data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h4 class="modal-title" id="myModalLabel">确认调整</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="form-group" >
|
||||
<label for="input002" class="col-sm-3 control-label form-label">登录人资金密码</label>
|
||||
<div class="col-sm-4">
|
||||
<input id="login_safeword" type="password" name="login_safeword"
|
||||
class="login_safeword" placeholder="请输入登录人资金密码" >
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="form-group" style="">
|
||||
|
||||
<label for="input002" class="col-sm-3 control-label form-label">验证码</label>
|
||||
<div class="col-sm-4">
|
||||
<input id="email_code" type="text" name="email_code"
|
||||
class="login_safeword" placeholder="请输入验证码" >
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<a id="update_email_code_button" href="javascript:updateSendCode();" class="btn btn-light" style="margin-bottom: 10px" >获取超级签验证码</a>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
<div class="modal-footer" style="margin-top: 0;">
|
||||
<button type="button" class="btn "
|
||||
data-dismiss="modal">关闭</button>
|
||||
<button id="sub" type="submit"
|
||||
class="btn btn-default">确认</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal -->
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<%@ include file="include/js.jsp"%>
|
||||
<script src="<%=basePath%>js/bootstrap/bootstrap-treeview.js"></script>
|
||||
<script>
|
||||
$(function () {
|
||||
var data = <s:property value="result" escape='false' />;
|
||||
console.log(data);
|
||||
$("#treeview4").treeview({
|
||||
color: "#428bca",
|
||||
enableLinks:true,
|
||||
nodeIcon: "glyphicon glyphicon-user",
|
||||
data: data,
|
||||
levels: 4,
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
function toDelete(id,pageNo){
|
||||
$('#id').val(id);
|
||||
$('#pageNo').val(pageNo);
|
||||
$('#myModalLabel').html("删除");
|
||||
$('#mainform').attr("action","<%=basePath%>/mall/comment/delete.action");
|
||||
$('#modal_succeeded').modal("show");
|
||||
|
||||
}
|
||||
|
||||
$(function() {
|
||||
$('#startTime').datetimepicker({
|
||||
format : 'yyyy-mm-dd hh:ii:00',
|
||||
minuteStep:1,
|
||||
language : 'zh',
|
||||
weekStart : 1,
|
||||
todayBtn : 1,
|
||||
autoclose : 1,
|
||||
todayHighlight : 1,
|
||||
startView : 2,
|
||||
clearBtn : true
|
||||
});
|
||||
$('#endTime').datetimepicker({
|
||||
format : 'yyyy-mm-dd hh:ii:00',
|
||||
minuteStep:1,
|
||||
language : 'zh',
|
||||
weekStart : 1,
|
||||
todayBtn : 1,
|
||||
autoclose : 1,
|
||||
todayHighlight : 1,
|
||||
startView : 2,
|
||||
clearBtn : true
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
514
admin/src/main/webapp/admin_comment_update.jsp
Executable file
514
admin/src/main/webapp/admin_comment_update.jsp
Executable file
@@ -0,0 +1,514 @@
|
||||
<%@ page language="java" pageEncoding="utf-8" isELIgnored="false"%>
|
||||
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
||||
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
|
||||
|
||||
<%@ include file="include/pagetop.jsp"%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<%@ include file="include/head.jsp"%>
|
||||
</head>
|
||||
<body>
|
||||
<%@ include file="include/loading.jsp"%>
|
||||
|
||||
|
||||
|
||||
<%-- <%@ include file="include/top.jsp"%> --%>
|
||||
<%-- <%@ include file="include/menu_left.jsp"%> --%>
|
||||
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
<!-- START CONTENT -->
|
||||
|
||||
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
<!-- START CONTAINER -->
|
||||
<div class="ifr-con">
|
||||
<h3>评论库</h3>
|
||||
<%@ include file="include/alert.jsp"%>
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
<!-- START queryForm -->
|
||||
<form action="<%=basePath%>/mall/comment/list.action"
|
||||
method="post" id="queryForm">
|
||||
<input type="hidden" name="pageNo" id="pageNo"/>
|
||||
</form>
|
||||
<!-- END queryForm -->
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-lg-12">
|
||||
<div class="panel panel-default">
|
||||
|
||||
<div class="panel-title">
|
||||
评论详情
|
||||
<ul class="panel-tools">
|
||||
<li><a class="icon minimise-tool"><i
|
||||
class="fa fa-minus"></i></a></li>
|
||||
<li><a class="icon expand-tool"><i class="fa fa-expand"></i></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="panel-body">
|
||||
<form class="form-horizontal"
|
||||
style="position: relative;"
|
||||
action="<%=basePath%>/mall/comment/add.action"
|
||||
method="post" name="mainForm" id="mainForm">
|
||||
<%-- <div style="position: absolute;left:900px;top: 90px;padding: 40px 80px;border-radius: 5%;background: #B9F98E;color: #0A451D;">黑色标题属于公共部分</div>--%>
|
||||
<input type="hidden" name="id" id="id" value = "${comment.id}"/>
|
||||
<input type="hidden" name="imgUrl1" id="imgUrl1" value = "${comment.imgUrl1}"/>
|
||||
<input type="hidden" name="imgUrl2" id="imgUrl2" value = "${comment.imgUrl2}"/>
|
||||
<input type="hidden" name="imgUrl3" id="imgUrl3" value = "${comment.imgUrl3}"/>
|
||||
<input type="hidden" name="imgUrl4" id="imgUrl4" value = "${comment.imgUrl4}"/>
|
||||
<input type="hidden" name="imgUrl5" id="imgUrl5" value = "${comment.imgUrl5}"/>
|
||||
<input type="hidden" name="imgUrl6" id="imgUrl6" value = "${comment.imgUrl6}"/>
|
||||
<input type="hidden" name="imgUrl7" id="imgUrl7" value = "${comment.imgUrl7}"/>
|
||||
<input type="hidden" name="imgUrl8" id="imgUrl8" value = "${comment.imgUrl8}"/>
|
||||
<input type="hidden" name="imgUrl9" id="imgUrl9" value = "${comment.imgUrl9}"/>
|
||||
<input type="hidden" name="pageNo" id="pageNo" value = "${pageNo}"/>
|
||||
|
||||
<div class="form-group" style="">
|
||||
<label class="col-sm-2 control-label form-label">评论图片(*)</label>
|
||||
|
||||
<div class="" style="display: flex;justify-content: start;">
|
||||
<div>
|
||||
<input type="file" id="fileName1" name="fileName1" value="${fileName1}" onchange="upload1();" style="position:absolute;opacity:0;" disabled>
|
||||
<label for="fileName1">
|
||||
<div class="avatar"><img width="90px" height="90px" id="show_img1" src="<%=base%>/image/add.png" /></div>
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
<input type="file" id="fileName2" name="fileName2" value="${fileName2}" onchange="upload2();" style="position:absolute;opacity:0;" disabled>
|
||||
<label for="fileName2">
|
||||
<div class="avatar"><img width="90px" height="90px" id="show_img2" src="<%=base%>/image/add.png" /></div>
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
<input type="file" id="fileName3" name="fileName3" value="${fileName3}" onchange="upload3();" style="position:absolute;opacity:0;" disabled>
|
||||
<label for="fileName3">
|
||||
<div class="avatar"><img width="90px" height="90px" id="show_img3" src="<%=base%>/image/add.png" /></div>
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
<input type="file" id="fileName4" name="fileName" value="${fileName4}" onchange="upload4();" style="position:absolute;opacity:0;" disabled>
|
||||
<label for="fileName4">
|
||||
<div class="avatar"><img width="90px" height="90px" id="show_img4" src="<%=base%>/image/add.png" /></div>
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
<input type="file" id="fileName5" name="fileName" value="${fileName5}" onchange="upload5();" style="position:absolute;opacity:0;" disabled>
|
||||
<label for="fileName5">
|
||||
<div class="avatar"><img width="90px" height="90px" id="show_img5" src="<%=base%>/image/add.png" /></div>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<%-- <div style="width: 100%;margin-top: 5px; color: red">图片尺寸:( 750px * 750px )</div>--%>
|
||||
<label class="col-sm-2 control-label form-label" style="margin-top: 5px; color: red"></label>
|
||||
</div>
|
||||
|
||||
<div class="form-group" style="">
|
||||
<label class="col-sm-2 control-label form-label"></label>
|
||||
|
||||
<div class="" style="display: flex;justify-content: start;">
|
||||
<div>
|
||||
<input type="file" id="fileName6" name="fileName6" value="${fileName6}" onchange="upload6();" style="position:absolute;opacity:0;" disabled>
|
||||
<label for="fileName6">
|
||||
<div class="avatar"><img width="90px" height="90px" id="show_img6" src="<%=base%>/image/add.png" /></div>
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
<input type="file" id="fileName7" name="fileName7" value="${fileName7}" onchange="upload7();" style="position:absolute;opacity:0;" disabled>
|
||||
<label for="fileName7">
|
||||
<div class="avatar"><img width="90px" height="90px" id="show_img7" src="<%=base%>/image/add.png" /></div>
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
<input type="file" id="fileName8" name="fileName" value="${fileName8}" onchange="upload8();" style="position:absolute;opacity:0;" disabled>
|
||||
<label for="fileName8">
|
||||
<div class="avatar"><img width="90px" height="90px" id="show_img8" src="<%=base%>/image/add.png" /></div>
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
<input type="file" id="fileName9" name="fileName9" value="${fileName9}" onchange="upload9();" style="position:absolute;opacity:0;" disabled>
|
||||
<label for="fileName9">
|
||||
<div class="avatar"><img width="90px" height="90px" id="show_img9" src="<%=base%>/image/add.png" /></div>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<%-- <div style="width: 100%;margin-top: 5px; color: red">图片尺寸:( 750px * 750px )</div>--%>
|
||||
<%-- <label class="col-sm-2 control-label form-label" style="margin-top: 5px; color: red">图片尺寸:( 750px * 750px )</label>--%>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label form-label" style="color: red">评价内容</label>
|
||||
<div class="col-sm-4">
|
||||
<textarea class="form-control" rows="7" id="content_text" name="content_text" placeholder="请输入内容" readonly="true">${comment.content}</textarea>
|
||||
<input type="hidden" name="content" id="content" value="${comment.content}" readonly="true"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label form-label">会员评分</label>
|
||||
<div class="col-sm-3">
|
||||
<input id="score" readonly="true" name="score" class="form-control" value="${comment.score}" placeholder="请输入1-5分" oninput="if(!/^[0-9]+$/.test(value)) value=value.replace(/\D/g,'');if(value>5)value=5;if(value<1)value=null"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-2 col-sm-10">
|
||||
<a href="javascript:goUrl(${pageNo})"
|
||||
class="btn">返回</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<!-- END CONTAINER -->
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
|
||||
|
||||
<%@ include file="include/footer.jsp"%>
|
||||
|
||||
|
||||
</div>
|
||||
<!-- End Content -->
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<%@ include file="include/js.jsp"%>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
// function submit() {
|
||||
// $('#modal_succeeded').modal("show");
|
||||
// }
|
||||
|
||||
function submit() {
|
||||
swal({
|
||||
title : "是否保存?",
|
||||
text : "",
|
||||
type : "warning",
|
||||
showCancelButton : true,
|
||||
confirmButtonColor : "#DD6B55",
|
||||
confirmButtonText : "确认",
|
||||
closeOnConfirm : false
|
||||
}, function() {
|
||||
document.getElementById("mainForm").submit();
|
||||
});
|
||||
|
||||
}
|
||||
//初始化执行一次
|
||||
setTimeout(function() {
|
||||
start();
|
||||
}, 100);
|
||||
|
||||
function start(){
|
||||
var img1 = $("#imgUrl1").val();
|
||||
var show_img1 = document.getElementById('show_img1');
|
||||
show_img1.src=img1;
|
||||
|
||||
var img2 = $("#imgUrl2").val();
|
||||
var show_img2 = document.getElementById('show_img2');
|
||||
show_img2.src=img2;
|
||||
|
||||
var img3 = $("#imgUrl3").val();
|
||||
var show_img3 = document.getElementById('show_img3');
|
||||
show_img3.src=img3;
|
||||
|
||||
var img4 = $("#imgUrl4").val();
|
||||
var show_img4 = document.getElementById('show_img4');
|
||||
show_img4.src=img4;
|
||||
|
||||
var img5 = $("#imgUrl5").val();
|
||||
var show_img5 = document.getElementById('show_img5');
|
||||
show_img5.src=img5;
|
||||
|
||||
var img6 = $("#imgUrl6").val();
|
||||
var show_img6 = document.getElementById('show_img6');
|
||||
show_img6.src=img6;
|
||||
|
||||
var img7 = $("#imgUrl7").val();
|
||||
var show_img7 = document.getElementById('show_img7');
|
||||
show_img7.src=img7;
|
||||
|
||||
var img8 = $("#imgUrl8").val();
|
||||
var show_img8 = document.getElementById('show_img8');
|
||||
show_img8.src=img8;
|
||||
|
||||
var img9 = $("#imgUrl9").val();
|
||||
var show_img9 = document.getElementById('show_img9');
|
||||
show_img9.src=img9;
|
||||
|
||||
var img10 = $("#imgUrl10").val();
|
||||
var show_img10 = document.getElementById('show_img10');
|
||||
show_img10.src=img10;
|
||||
}
|
||||
function upload1(){
|
||||
var fileReader = new FileReader();
|
||||
var formData = new FormData();
|
||||
var file = document.getElementById('fileName1').files[0];
|
||||
formData.append("file", file);
|
||||
formData.append("moduleName","goods");
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "<%=basePath%>normal/uploadimg!execute.action",
|
||||
data: formData,
|
||||
dataType: "json",
|
||||
contentType: false,
|
||||
processData: false,
|
||||
success : function(data) {
|
||||
console.log(data);
|
||||
$("#imgUrl1").val(data.data)
|
||||
var show_img = document.getElementById('show_img1');
|
||||
show_img.src=data.data;
|
||||
|
||||
},
|
||||
error : function(XMLHttpRequest, textStatus,
|
||||
errorThrown) {
|
||||
console.log("请求错误");
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
function upload2(){
|
||||
var fileReader = new FileReader();
|
||||
var formData = new FormData();
|
||||
var file = document.getElementById('fileName2').files[0];
|
||||
formData.append("file", file);
|
||||
formData.append("moduleName","goods");
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "<%=basePath%>normal/uploadimg!execute.action",
|
||||
data: formData,
|
||||
dataType: "json",
|
||||
contentType: false,
|
||||
processData: false,
|
||||
success : function(data) {
|
||||
console.log(data);
|
||||
$("#imgUrl2").val(data.data)
|
||||
var show_img = document.getElementById('show_img2');
|
||||
show_img2.src=data.data;
|
||||
|
||||
},
|
||||
error : function(XMLHttpRequest, textStatus,
|
||||
errorThrown) {
|
||||
console.log("请求错误");
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
function upload3(){
|
||||
var fileReader = new FileReader();
|
||||
var formData = new FormData();
|
||||
var file = document.getElementById('fileName3').files[0];
|
||||
formData.append("file", file);
|
||||
formData.append("moduleName","goods");
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "<%=basePath%>normal/uploadimg!execute.action",
|
||||
data: formData,
|
||||
dataType: "json",
|
||||
contentType: false,
|
||||
processData: false,
|
||||
success : function(data) {
|
||||
console.log(data);
|
||||
$("#imgUrl3").val(data.data)
|
||||
var show_img = document.getElementById('show_img3');
|
||||
show_img3.src=data.data;
|
||||
|
||||
},
|
||||
error : function(XMLHttpRequest, textStatus,
|
||||
errorThrown) {
|
||||
console.log("请求错误");
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
function upload4(){
|
||||
var fileReader = new FileReader();
|
||||
var formData = new FormData();
|
||||
var file = document.getElementById('fileName4').files[0];
|
||||
formData.append("file", file);
|
||||
formData.append("moduleName","goods");
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "<%=basePath%>normal/uploadimg!execute.action",
|
||||
data: formData,
|
||||
dataType: "json",
|
||||
contentType: false,
|
||||
processData: false,
|
||||
success : function(data) {
|
||||
console.log(data);
|
||||
$("#imgUrl4").val(data.data)
|
||||
var show_img = document.getElementById('show_img4');
|
||||
show_img4.src=data.data;
|
||||
|
||||
},
|
||||
error : function(XMLHttpRequest, textStatus,
|
||||
errorThrown) {
|
||||
console.log("请求错误");
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
function upload5(){
|
||||
var fileReader = new FileReader();
|
||||
var formData = new FormData();
|
||||
var file = document.getElementById('fileName5').files[0];
|
||||
formData.append("file", file);
|
||||
formData.append("moduleName","goods");
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "<%=basePath%>normal/uploadimg!execute.action",
|
||||
data: formData,
|
||||
dataType: "json",
|
||||
contentType: false,
|
||||
processData: false,
|
||||
success : function(data) {
|
||||
console.log(data);
|
||||
$("#imgUrl5").val(data.data)
|
||||
var show_img = document.getElementById('show_img5');
|
||||
show_img5.src=data.data;
|
||||
|
||||
},
|
||||
error : function(XMLHttpRequest, textStatus,
|
||||
errorThrown) {
|
||||
console.log("请求错误");
|
||||
}
|
||||
});
|
||||
}
|
||||
function upload6(){
|
||||
var fileReader = new FileReader();
|
||||
var formData = new FormData();
|
||||
var file = document.getElementById('fileName6').files[0];
|
||||
formData.append("file", file);
|
||||
formData.append("moduleName","goods");
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "<%=basePath%>normal/uploadimg!execute.action",
|
||||
data: formData,
|
||||
dataType: "json",
|
||||
contentType: false,
|
||||
processData: false,
|
||||
success : function(data) {
|
||||
console.log(data);
|
||||
$("#imgUrl6").val(data.data)
|
||||
var show_img = document.getElementById('show_img6');
|
||||
show_img6.src=data.data;
|
||||
|
||||
},
|
||||
error : function(XMLHttpRequest, textStatus,
|
||||
errorThrown) {
|
||||
console.log("请求错误");
|
||||
}
|
||||
});
|
||||
}
|
||||
function upload7(){
|
||||
var fileReader = new FileReader();
|
||||
var formData = new FormData();
|
||||
var file = document.getElementById('fileName7').files[0];
|
||||
formData.append("file", file);
|
||||
formData.append("moduleName","goods");
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "<%=basePath%>normal/uploadimg!execute.action",
|
||||
data: formData,
|
||||
dataType: "json",
|
||||
contentType: false,
|
||||
processData: false,
|
||||
success : function(data) {
|
||||
console.log(data);
|
||||
$("#imgUrl7").val(data.data)
|
||||
var show_img = document.getElementById('show_img7');
|
||||
show_img7.src=data.data;
|
||||
|
||||
},
|
||||
error : function(XMLHttpRequest, textStatus,
|
||||
errorThrown) {
|
||||
console.log("请求错误");
|
||||
}
|
||||
});
|
||||
}
|
||||
function upload8(){
|
||||
var fileReader = new FileReader();
|
||||
var formData = new FormData();
|
||||
var file = document.getElementById('fileName8').files[0];
|
||||
formData.append("file", file);
|
||||
formData.append("moduleName","goods");
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "<%=basePath%>normal/uploadimg!execute.action",
|
||||
data: formData,
|
||||
dataType: "json",
|
||||
contentType: false,
|
||||
processData: false,
|
||||
success : function(data) {
|
||||
console.log(data);
|
||||
$("#imgUrl8").val(data.data)
|
||||
var show_img = document.getElementById('show_img8');
|
||||
show_img8.src=data.data;
|
||||
|
||||
},
|
||||
error : function(XMLHttpRequest, textStatus,
|
||||
errorThrown) {
|
||||
console.log("请求错误");
|
||||
}
|
||||
});
|
||||
}
|
||||
function upload9(){
|
||||
var fileReader = new FileReader();
|
||||
var formData = new FormData();
|
||||
var file = document.getElementById('fileName9').files[0];
|
||||
formData.append("file", file);
|
||||
formData.append("moduleName","goods");
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "<%=basePath%>normal/uploadimg!execute.action",
|
||||
data: formData,
|
||||
dataType: "json",
|
||||
contentType: false,
|
||||
processData: false,
|
||||
success : function(data) {
|
||||
console.log(data);
|
||||
$("#imgUrl9").val(data.data)
|
||||
var show_img = document.getElementById('show_img9');
|
||||
show_img9.src=data.data;
|
||||
|
||||
},
|
||||
error : function(XMLHttpRequest, textStatus,
|
||||
errorThrown) {
|
||||
console.log("请求错误");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
<%--$(function(){--%>
|
||||
<%-- $('.nav-tabs a').filter(function() {--%>
|
||||
<%-- var a = document.URL;--%>
|
||||
<%-- <%–var a = "<%=basePath%>/mall/goods/toUpdate.action?lang=${lang}&goodsId=${goodsId}";–%>--%>
|
||||
<%-- return this.href == "<%=bases%>/mall/goods/toUpdate.action?lang=${lang}&goodsId=${goodsId}"; //获取当前页面的地址--%>
|
||||
<%-- }).closest('li').addClass('active'); //给当前最靠近的li(其实是现在进入的li)添加‘active’样式--%>
|
||||
|
||||
<%--})--%>
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
810
admin/src/main/webapp/admin_credit_list.jsp
Executable file
810
admin/src/main/webapp/admin_credit_list.jsp
Executable file
@@ -0,0 +1,810 @@
|
||||
<%@ page language="java" pageEncoding="utf-8" isELIgnored="false"%>
|
||||
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
||||
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
|
||||
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
|
||||
<jsp:useBean id="security" class="security.web.BaseSecurityAction" scope="page" />
|
||||
|
||||
<%@ include file="include/pagetop.jsp"%>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<%@ include file="include/head.jsp"%>
|
||||
<style>
|
||||
td {
|
||||
word-wrap: break-word; /* 让内容自动换行 */
|
||||
max-width: 200px; /* 设置最大宽度,以防止内容过长 */
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<%@ include file="include/loading.jsp"%>
|
||||
<%-- <%@ include file="include/top.jsp"%> --%>
|
||||
<%-- <%@ include file="include/menu_left.jsp"%> --%>
|
||||
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
<!-- START CONTENT -->
|
||||
<div class="ifr-dody">
|
||||
|
||||
<input type="hidden" name="session_token" id="session_token" value="${session_token}" />
|
||||
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
<!-- START CONTAINER -->
|
||||
<div class="ifr-con">
|
||||
<h3>借贷记录</h3>
|
||||
|
||||
<%@ include file="include/alert.jsp"%>
|
||||
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
<!-- START queryForm -->
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="panel panel-default">
|
||||
|
||||
<div class="panel-title">查询条件</div>
|
||||
<div class="panel-body">
|
||||
|
||||
<form class="form-horizontal"
|
||||
action="<%=basePath%>/credit/history.action"
|
||||
method="post" id="queryForm">
|
||||
|
||||
<input type="hidden" name="pageNo" id="pageNo" value="${pageNo}">
|
||||
|
||||
<div class="col-md-12 col-lg-2">
|
||||
<fieldset>
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<input id="userCode" name="userCode"
|
||||
class="form-control " placeholder="用户ID" value="${userCode}" />
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12 col-lg-3">
|
||||
<fieldset>
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<!-- <s:textfield id="name_para" name="name_para"
|
||||
cssClass="form-control " placeholder="用户名、UID" /> -->
|
||||
<input id="userName" name="userName" class="form-control "
|
||||
placeholder="用户名、UID" value="${userName}" />
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
<div class="col-md-12 col-lg-3">
|
||||
<fieldset>
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<input id="identification" name="identification" class="form-control "
|
||||
placeholder="证件号查询" value="${identification}" />
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12 col-lg-3" >
|
||||
<fieldset>
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<select id="status" name="status" class="form-control">
|
||||
<option value="">审核状态</option><!-- 状态(1待审核,2审核通过,3已逾期,4未通过,5已还款)', -->
|
||||
<option value="1" <c:if test="${status == '1'}">selected="true"</c:if> >待审核</option>
|
||||
<option value="4" <c:if test="${status == '4'}">selected="true"</c:if> >未通过</option>
|
||||
<option value="2" <c:if test="${status == '2'}">selected="true"</c:if> >审核通过</option>
|
||||
<option value="5" <c:if test="${status == '5'}">selected="true"</c:if> >已还款</option>
|
||||
<option value="3" <c:if test="${status == '3'}">selected="true"</c:if> >已逾期</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12 col-lg-2" style="margin-top: 10px">
|
||||
<input id="customerSubmitTime_start" name="customerSubmitTime_start" class="form-control "
|
||||
placeholder="开始日期" value="${customerSubmitTime_start}" />
|
||||
</div>
|
||||
<div class="col-md-12 col-lg-2" style="margin-top: 10px">
|
||||
|
||||
<input id="customerSubmitTime_end" name="customerSubmitTime_end" class="form-control "
|
||||
placeholder="结束日期" value="${customerSubmitTime_end}" />
|
||||
</div>
|
||||
<div class="col-md-12 col-lg-2" style="margin-top: 10px">
|
||||
<button type="submit" class="btn btn-light btn-block">查询</button>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- END queryForm -->
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<!-- Start Panel -->
|
||||
<div class="panel panel-default">
|
||||
|
||||
<div class="panel-title">查询结果</div>
|
||||
<div class="panel-body">
|
||||
|
||||
<table class="table table-bordered table-striped">
|
||||
|
||||
<thead>
|
||||
<tr>
|
||||
<td>会员ID</td>
|
||||
<td>推荐人</td>
|
||||
<td>账户类型</td>
|
||||
<td>认证信息</td>
|
||||
<td>申请人</td>
|
||||
<td>审核状态</td>
|
||||
<td>贷款期限</td>
|
||||
<td>申请金额</td>
|
||||
<td>贷款利率</td>
|
||||
<td>总利息</td>
|
||||
<td>总还款金额</td>
|
||||
<td>实际还款</td>
|
||||
<td>驳回原因</td>
|
||||
<td>客户提交时间</td>
|
||||
<td>系统审核时间</td>
|
||||
<td>最后还款时间</td>
|
||||
<td width="150px"></td>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody style="font-size: 13px;">
|
||||
<!-- <s:iterator value="page.elements" status="stat"> -->
|
||||
<c:forEach items="${page.getElements()}" var="item" varStatus="stat">
|
||||
<tr>
|
||||
<td>${item.usercode}</td>
|
||||
<td>${item.username_parent}</td>
|
||||
<td>
|
||||
<c:choose>
|
||||
<c:when test="${item.rolename=='MEMBER'}">
|
||||
<span class="right label label-success">正式账号</span>
|
||||
</c:when>
|
||||
<c:when test="${item.rolename=='GUEST'}">
|
||||
<span class="right label label-warning">虚拟账号</span>
|
||||
</c:when>
|
||||
</c:choose>
|
||||
</td>
|
||||
<td>
|
||||
<a href="#" onClick="detail('${item.creditId}',
|
||||
'${item.realName}',
|
||||
'${item.identification}',
|
||||
'${item.countryId}',
|
||||
'${item.imgCertificateFace}',
|
||||
'${item.imgCertificateBack}',
|
||||
'${item.imgCertificateHand}')">
|
||||
查看
|
||||
</a>
|
||||
</td>
|
||||
<td>${item.username}</td>
|
||||
|
||||
<td>
|
||||
<c:if test="${item.status =='1'}">
|
||||
|
||||
<span class="right label label-warning">待审核</span>
|
||||
</c:if>
|
||||
<c:if test="${item.status =='2'}">
|
||||
<span class="right label label-success">审核通过</span>
|
||||
</c:if>
|
||||
<c:if test="${item.status =='3'}">
|
||||
<span class="right label label-danger">已逾期</span>
|
||||
</c:if>
|
||||
<c:if test="${item.status =='4'}">
|
||||
<span class="right label label-danger">未通过</span>
|
||||
</c:if>
|
||||
<c:if test="${item.status =='5'}">
|
||||
<span class="right label label-default">已还款</span>
|
||||
</c:if>
|
||||
</td>
|
||||
|
||||
<td>${item.creditPeriod}天</td>
|
||||
<td> <fmt:formatNumber value="${item.applyAmount}" pattern="#0.00"/></td>
|
||||
<td> <fmt:formatNumber value="${item.creditRate}" pattern="#0.00"/></td>
|
||||
<td> <fmt:formatNumber value="${item.totalInterest}" pattern="#0.00"/></td>
|
||||
<td> <fmt:formatNumber value="${item.totalRepayment}" pattern="#0.00"/></td>
|
||||
<td> <fmt:formatNumber value="${item.actualRepayment}" pattern="#0.00"/></td>
|
||||
<td>${item.rejectReason}</td>
|
||||
<td>${item.customerSubmitTime}</td>
|
||||
<td>${item.systemAuditTime}</td>
|
||||
<td>${item.finalRepayTime}</td>
|
||||
|
||||
<td>
|
||||
|
||||
<c:if test="${security.isRolesAccessible('ROLE_ROOT,ROLE_ADMIN')
|
||||
|| security.isResourceAccessible('OP_CREDIT_OPERATE')}">
|
||||
<c:if test="${item.status == 1 || item.status == 2 || item.status == 3}">
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-light">操作</button>
|
||||
<button type="button" class="btn btn-light dropdown-toggle"
|
||||
data-toggle="dropdown" aria-expanded="false">
|
||||
<span class="caret"></span> <span class="sr-only">Toggle Dropdown</span>
|
||||
</button>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
|
||||
<c:if test="${item.status == 1}">
|
||||
<li><a href="javascript:onsucceeded('${item.creditId}')">通过</a></li>
|
||||
<li><a href="javascript:reject('${item.creditId}','4')">驳回申请</a></li>
|
||||
</c:if>
|
||||
|
||||
<c:if test="${item.status == 2 || item.status == 3 }">
|
||||
<li><a href="javascript:manualRepayment('${item.creditId}','${item.username}')">手动还款</a></li>
|
||||
</c:if>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</c:if>
|
||||
</c:if>
|
||||
<!-- 模态框 -->
|
||||
<div class="form-group">
|
||||
|
||||
<form action="<%=basePath%>/credit/pass.action"
|
||||
method="post" id="succeededForm">
|
||||
|
||||
<input type="hidden" name="pageNo" id="pageNo" value="${pageNo}">
|
||||
<input type="hidden" name="creditId" id="creditId" value="${creditId}">
|
||||
<input type="hidden" name="session_token" id="session_token_success" value="${session_token}">
|
||||
|
||||
<div class="col-sm-1">
|
||||
<!-- 模态框(Modal) -->
|
||||
<div class="modal fade" id="modal_set" tabindex="-1"
|
||||
role="dialog" aria-labelledby="myModalLabel"
|
||||
aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h4 class="modal-title" id="myModalLabel">提现借贷申请(手动打款)</h4>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<div class="">
|
||||
<input id="safeword" type="password" name="safeword"
|
||||
class="form-control" placeholder="请输入资金密码">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer" style="margin-top: 0;">
|
||||
<button type="button" class="btn " data-dismiss="modal">关闭</button>
|
||||
<button id="sub" type="submit" class="btn btn-default">确认</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
|
||||
<form action="<%=basePath%>/credit/operate.action"
|
||||
method="post" id="succeededForms">
|
||||
|
||||
<input type="hidden" name="pageNo" id="pageNo" value="${pageNo}">
|
||||
<input type="hidden" name="creditId" id="creditId_repayment" value="${creditId}">
|
||||
<input type="hidden" name="operateType" id="operateType_repayment" value="${operateType}">
|
||||
<input type="hidden" name="session_token" id="session_token_success" value="${session_token}">
|
||||
|
||||
<div class="col-sm-1">
|
||||
<!-- 模态框(Modal) -->
|
||||
<div class="modal fade" id="modal_set_manual_repayment" tabindex="-1" role="dialog"
|
||||
aria-labelledby="myModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal"
|
||||
aria-hidden="true">×</button>
|
||||
<h4 class="modal-title">申请人</h4>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<div class="">
|
||||
<input id="usernames" name="username" type="text"
|
||||
class="form-control" readonly="readonly" value="${username}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title">已贷款天数</h4>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<div class="">
|
||||
<input id="creditPeriod" name="creditPeriod" type="text"
|
||||
class="form-control" readonly="readonly" value="${creditPeriod}" >
|
||||
<!-- readonly="true" -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title">应还款金额</h4>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<div class="">
|
||||
<input id="totalRepayment" name="exchange_rate" type="text"
|
||||
class="form-control" readonly="totalRepayment" value="${totalRepayment}" >
|
||||
<!-- readonly="true" -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title" >还款金额</h4>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<div class="">
|
||||
<input id="manualRepay" name="manualRepay"
|
||||
class="form-control" placeholder="请输入资金密码" value="${manualRepay}" >
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title" id="myModalLabel">资金密码</h4>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<div class="">
|
||||
<input id="safeword" type="password" name="safeword"
|
||||
class="form-control" placeholder="请输入资金密码" value="${safeword}" >
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer" style="margin-top: 0;">
|
||||
<button type="button" class="btn " data-dismiss="modal">关闭</button>
|
||||
<button id="sub" type="submit" class="btn btn-default">确认</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<!-- 模态框(Modal) -->
|
||||
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<!-- </s:iterator> -->
|
||||
</c:forEach>
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
|
||||
<%@ include file="include/page_simple.jsp"%>
|
||||
|
||||
<!-- <nav> -->
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- End Panel -->
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-sm-1">
|
||||
<!-- 模态框(Modal) -->
|
||||
<div class="modal fade" id="net_form" tabindex="-1"
|
||||
role="dialog" aria-labelledby="myModalLabel"
|
||||
aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal"
|
||||
aria-hidden="true">×</button>
|
||||
<h4 class="modal-title" id="myModalLabel">完整用户名(完整钱包地址)</h4>
|
||||
</div>
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title" name="usernallName" id="usernallName" readonly="true" style="display: inline-block;"></h4>
|
||||
<a href="" id="user_all_name_a" sytle="cursor:pointer;" target="_blank">在Etherscan上查看</a>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<div class="">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="modal_detail" tabindex="-1" role="dialog"
|
||||
aria-labelledby="myModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content" style="width: 725px;">
|
||||
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal"
|
||||
aria-hidden="true">×</button>
|
||||
<h4 class="modal-title">详细信息</h4>
|
||||
</div>
|
||||
|
||||
<input type="hidden" name="partyId_modal_detail" id="partyId_modal_detail"/>
|
||||
<input type="hidden" name="img_idimg_1" id="img_idimg_1"/>
|
||||
<input type="hidden" name="img_idimg_2" id="img_idimg_2"/>
|
||||
<input type="hidden" name="img_idimg_3" id="img_idimg_3"/>
|
||||
|
||||
<div class="modal-body">
|
||||
<div class="">
|
||||
实名姓名<input id="modal_name" type="text" name="modal_name"
|
||||
class="form-control" readonly="readonly" />
|
||||
</div>
|
||||
<div class="">
|
||||
证件号码<input id="modal_idnumber" type="text" name="modal_idnumber"
|
||||
class="form-control" readonly="readonly" />
|
||||
</div>
|
||||
<div class="">
|
||||
国籍<input id="modal_nationality" type="text"
|
||||
name="modal_nationality" class="form-control" readonly="readonly" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title" id="myModalLabel">证件照</h4>
|
||||
</div>
|
||||
|
||||
<div class="modal-body col-md-12">
|
||||
<div class="col-md-12 col-lg-4">
|
||||
证件正面照
|
||||
<a href="#" target="_blank">
|
||||
<img width="200px" height="200px" id="modal_idimg_1" name="modal_idimg_1" src="" />
|
||||
</a>
|
||||
<div class="col-md-6">
|
||||
<input type="file" id="fileName_1" name="fileName" value="${fileName}" onchange="upload_idimg('1');" style="position:absolute;opacity:0;">
|
||||
<label for="fileName">
|
||||
<button type="button" class="btn btn-light btn-block">修改</button>
|
||||
</label>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<button type="button" class="btn btn-light btn-block" onclick="submit_idimg('1')">提交</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12 col-lg-4">
|
||||
证件背面照
|
||||
<a href="#" target="_blank">
|
||||
<img width="200px" height="200px" id="modal_idimg_2" name="modal_idimg_2" src="" />
|
||||
</a>
|
||||
<div class="col-md-6">
|
||||
<input type="file" id="fileName_2" name="fileName" value="${fileName}" onchange="upload_idimg('2');" style="position:absolute;opacity:0;">
|
||||
<label for="fileName">
|
||||
<button type="button" class="btn btn-light btn-block">修改</button>
|
||||
</label>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<button type="button" class="btn btn-light btn-block" onclick="submit_idimg('2')">提交</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12 col-lg-4">
|
||||
手持正面照
|
||||
<a href="#" target="_blank">
|
||||
<img width="200px" height="200px" id="modal_idimg_3" name="modal_idimg_3" src="" />
|
||||
</a>
|
||||
<div class="col-md-6">
|
||||
<input type="file" id="fileName_3" name="fileName" value="${fileName}" onchange="upload_idimg('3');" style="position:absolute;opacity:0;">
|
||||
<label for="fileName">
|
||||
<button type="button" class="btn btn-light btn-block">修改</button>
|
||||
</label>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<button type="button" class="btn btn-light btn-block" onclick="submit_idimg('3')">提交</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer" style="margin-top: 0;">
|
||||
<button type="button" class="btn " data-dismiss="modal">关闭</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- END CONTAINER -->
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
|
||||
<%@ include file="include/footer.jsp"%>
|
||||
|
||||
</div>
|
||||
<!-- End Content -->
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
|
||||
<%@ include file="include/js.jsp"%>
|
||||
|
||||
<form action="<%=basePath%>/credit/updateCreditPic.action" method="post" id="updateCreditPic">
|
||||
<input type="hidden" name="creditId_updateCreditPic" id="creditId_updateCreditPic">
|
||||
<input type="hidden" name="img_id_updateCreditPic" id="img_id_updateCreditPic">
|
||||
<input type="hidden" name="img_updateCreditPic" id="img_updateCreditPic">
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
function reject_confirm() {
|
||||
swal({
|
||||
title : "是否确认驳回?",
|
||||
text : "",
|
||||
type : "warning",
|
||||
showCancelButton : true,
|
||||
confirmButtonColor : "#DD6B55",
|
||||
confirmButtonText : "确认",
|
||||
closeOnConfirm : false
|
||||
}, function() {
|
||||
document.getElementById("onreject").submit();
|
||||
});
|
||||
};
|
||||
|
||||
function reject(creditId,operateType) {
|
||||
var session_token = $("#session_token").val();
|
||||
$("#session_token_reject").val(session_token);
|
||||
$("#creditIds").val(creditId);
|
||||
$("#operateType").val(operateType);
|
||||
$('#modal_reject').modal("show");
|
||||
};
|
||||
</script>
|
||||
|
||||
<!-- Modal -->
|
||||
<div class="modal fade" id="modal_reject" tabindex="-1" role="dialog"
|
||||
aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title">请输入驳回原因</h4>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<form action="<%=basePath%>/credit/operate.action"
|
||||
method="post" id="onreject">
|
||||
<input type="hidden" name="pageNo" id="pageNo" value="${pageNo}">
|
||||
<input type="hidden" name="creditId" id="creditIds" value="${creditId}">
|
||||
<input type="hidden" name="session_token" id="session_token_reject" value="${session_token}">
|
||||
<input type="hidden" name="operateType" id="operateType" value="${operateType}">
|
||||
|
||||
<textarea name="rejectReason" id="rejectReason" class="form-control input-lg" rows="2" cols="10" placeholder="驳回原因" >${rejectReason}</textarea>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-default" onclick="reject_confirm()">驳回申请</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Moda Code -->
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
$(function() {
|
||||
$('#customerSubmitTime_start').datetimepicker({
|
||||
format : 'yyyy-mm-dd hh:ii:00',
|
||||
minuteStep:1,
|
||||
language : 'zh',
|
||||
weekStart : 1,
|
||||
todayBtn : 1,
|
||||
autoclose : 1,
|
||||
todayHighlight : 1,
|
||||
startView : 2,
|
||||
clearBtn : true
|
||||
});
|
||||
$('#customerSubmitTime_end').datetimepicker({
|
||||
format : 'yyyy-mm-dd hh:ii:00',
|
||||
minuteStep:1,
|
||||
language : 'zh',
|
||||
weekStart : 1,
|
||||
todayBtn : 1,
|
||||
autoclose : 1,
|
||||
todayHighlight : 1,
|
||||
startView : 2,
|
||||
clearBtn : true
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
function detail(partyId, name, idnumber, nationality, idimg_1, idimg_2, idimg_3) {
|
||||
$("#partyId_modal_detail").val(partyId);
|
||||
$("#img_idimg_1").val(idimg_1);
|
||||
$("#img_idimg_2").val(idimg_2);
|
||||
$("#img_idimg_3").val(idimg_3);
|
||||
|
||||
// $("#id_success").val(id);
|
||||
$("#modal_name").val(name);
|
||||
// $("#modal_idname").val(idname);
|
||||
$("#modal_idnumber").val(idnumber);
|
||||
getValue(nationality);
|
||||
$("#modal_idimg_1").attr("src", idimg_1);
|
||||
$("#modal_idimg_1").parent().attr("href", idimg_1);
|
||||
$("#modal_idimg_2").attr("src", idimg_2);
|
||||
$("#modal_idimg_2").parent().attr("href", idimg_2);
|
||||
$("#modal_idimg_3").attr("src", idimg_3);
|
||||
$("#modal_idimg_3").parent().attr("href", idimg_3);
|
||||
|
||||
|
||||
$('#modal_detail').modal("show");
|
||||
}
|
||||
|
||||
function getValue(code){
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "<%=basePath%>/credit/findCode.action",
|
||||
dataType : "json",
|
||||
data : {
|
||||
"code" : code
|
||||
},
|
||||
success : function(data) {
|
||||
var tmp = data;
|
||||
var countryNameCn = tmp.countryNameCn;
|
||||
$("#modal_nationality").val(countryNameCn);
|
||||
},
|
||||
error : function(XMLHttpRequest, textStatus,
|
||||
errorThrown) {
|
||||
console.log("请求错误");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function upload_idimg(img_id){
|
||||
var fileReader = new FileReader();
|
||||
var formData = new FormData();
|
||||
var file = document.getElementById('fileName_' + img_id).files[0];
|
||||
formData.append("file", file);
|
||||
formData.append("moduleName","goods");
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "<%=basePath%>normal/uploadimg!execute.action",
|
||||
data: formData,
|
||||
dataType: "json",
|
||||
contentType: false,
|
||||
processData: false,
|
||||
success : function(data) {
|
||||
console.log(data);
|
||||
$("#img_idimg_" + img_id).val(data.data)
|
||||
var show_img = document.getElementById('modal_idimg_' + img_id);
|
||||
show_img.src=data.data;
|
||||
},
|
||||
error : function(XMLHttpRequest, textStatus, errorThrown) {
|
||||
console.log("请求错误");
|
||||
}
|
||||
});
|
||||
}
|
||||
function submit_idimg(img_id) {
|
||||
swal({
|
||||
title : "确认修改借贷认证图片?",
|
||||
text : "",
|
||||
type : "warning",
|
||||
showCancelButton : true,
|
||||
confirmButtonColor : "#DD6B55",
|
||||
confirmButtonText : "确认",
|
||||
closeOnConfirm : true
|
||||
}, function() {
|
||||
$('input[name="creditId_updateCreditPic"]').val($("#partyId_modal_detail").val());
|
||||
$('input[name="img_id_updateCreditPic"]').val(img_id);
|
||||
$('input[name="img_updateCreditPic"]').val($("#img_idimg_" + img_id).val());
|
||||
document.getElementById("updateCreditPic").submit();
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
|
||||
function manualRepayment(creditId,username){
|
||||
var session_token = $("#session_token").val();
|
||||
$("#session_token_success").val(session_token);
|
||||
$("#creditId_repayment").val(creditId);
|
||||
$("#usernames").val(username);
|
||||
getCredit(creditId);
|
||||
$("#operateType_repayment").val(5);
|
||||
$('#modal_set_manual_repayment').modal("show");
|
||||
}
|
||||
|
||||
function getCredit(creditId){
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "<%=basePath%>/credit/findCreditById.action",
|
||||
dataType : "json",
|
||||
data : {
|
||||
"creditId" : creditId
|
||||
},
|
||||
success : function(data) {
|
||||
var tmp = data;
|
||||
var alreadyCreditDays = tmp.alreadyCreditDays;
|
||||
var estimatePayment = tmp.estimatePayment;
|
||||
|
||||
$("#totalRepayment").val(estimatePayment);
|
||||
$("#manualRepay").val(estimatePayment);
|
||||
$("#creditPeriod").val(alreadyCreditDays);
|
||||
},
|
||||
error : function(XMLHttpRequest, textStatus,
|
||||
errorThrown) {
|
||||
console.log("请求错误");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function onsucceeded(id) {
|
||||
var session_token = $("#session_token").val();
|
||||
$("#session_token_success").val(session_token);
|
||||
$("#creditId").val(id);
|
||||
$('#modal_set').modal("show");
|
||||
}
|
||||
|
||||
function onchangeAddress(id, adress) {
|
||||
var session_token = $("#session_token").val();
|
||||
$("#session_token_success").val(session_token);
|
||||
$("#id_changeAddress").val(id);
|
||||
$("#changeAddress").val(adress);
|
||||
$('#modal_set_changeAddress').modal("show");
|
||||
}
|
||||
|
||||
function onsucceededThird(id) {
|
||||
var session_token = $("#session_token").val();
|
||||
$("#session_token_success_third").val(session_token);
|
||||
$("#id_success_third").val(id);
|
||||
$('#modal_set_third').modal("show");
|
||||
}
|
||||
|
||||
function handel(id) {
|
||||
$("#id_success").val(id);
|
||||
swal({
|
||||
title : "是否确认通过申请?",
|
||||
type : "warning",
|
||||
showCancelButton : true,
|
||||
confirmButtonColor : "#DD6B55",
|
||||
confirmButtonText : "确认",
|
||||
closeOnConfirm : false
|
||||
}, function() {
|
||||
document.getElementById("success").submit();
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
function setState(state) {
|
||||
document.getElementById("succeeded_para").value = state;
|
||||
document.getElementById("queryForm").submit();
|
||||
}
|
||||
|
||||
function getallname(name){
|
||||
$("#usernallName").html(name);
|
||||
$("#user_all_name_a").attr("href","https://etherscan.io/address/"+name);
|
||||
$("#net_form").modal("show");
|
||||
}
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
216
admin/src/main/webapp/admin_dispatch_goods.jsp
Executable file
216
admin/src/main/webapp/admin_dispatch_goods.jsp
Executable file
@@ -0,0 +1,216 @@
|
||||
<%@ page language="java" pageEncoding="utf-8" isELIgnored="false"%>
|
||||
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
||||
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
|
||||
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
|
||||
<jsp:useBean id="security" class="security.web.BaseSecurityAction" scope="page" />
|
||||
|
||||
<%@ include file="include/pagetop.jsp"%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<%@ include file="include/head.jsp"%>
|
||||
</head>
|
||||
<body>
|
||||
<%@ include file="include/loading.jsp"%>
|
||||
<%-- <%@ include file="include/top.jsp"%> --%>
|
||||
<%-- <%@ include file="include/menu_left.jsp"%> --%>
|
||||
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
<!-- START CONTENT -->
|
||||
<div class="ifr-dody">
|
||||
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
<!-- START CONTAINER -->
|
||||
<div class="ifr-con">
|
||||
<h3>商品列表</h3>
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
<!-- START queryForm -->
|
||||
<%@ include file="include/alert.jsp"%>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="panel panel-default">
|
||||
|
||||
<div class="panel-title">查询条件</div>
|
||||
<div class="panel-body">
|
||||
|
||||
<form class="form-horizontal" action="<%=basePath%>/brush/goods/goodsList.action" method="post"
|
||||
id="queryForm">
|
||||
<input type="hidden" name="pageNo" id="pageNo"
|
||||
value="${pageNo}">
|
||||
<div class="col-md-12 col-lg-4">
|
||||
<fieldset>
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<input id="name" name="name" class="form-control"
|
||||
placeholder="商品名称" value = "${name}"/>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
<div class="col-md-12 col-lg-4">
|
||||
<fieldset>
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<input id="PName" name="PName" class="form-control"
|
||||
placeholder="平台名称" value = "${PName}"/>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12 col-lg-2">
|
||||
<button type="submit" class="btn btn-light btn-block">查询</button>
|
||||
</div>
|
||||
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- END queryForm -->
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<!-- Start Panel -->
|
||||
<div class="panel panel-default">
|
||||
|
||||
<div class="panel-title">查询结果</div>
|
||||
|
||||
<form class="form-horizontal" action="<%=basePath%>/adminOrder/toDispatchOrder.action" method="post"
|
||||
id="queryForms">
|
||||
<div class="panel-body">
|
||||
|
||||
<table class="table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>封面图</td>
|
||||
<td>商品名称</td>
|
||||
<td>商品价格</td>
|
||||
<td>平台分类</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<c:forEach items="${page.getElements()}" var="item" varStatus="stat">
|
||||
<input type="hidden" name="orderId" id="orderId" value="${id}">
|
||||
<input type="hidden" name="iconImg" id="iconImg" value = "${item.iconImg}"/>
|
||||
<input type="hidden" name="pageNo1" id="pageNo1" value="${pageNo}">
|
||||
<tr>
|
||||
<td>
|
||||
<input id="check" onclick="choose(this)" name="checkbox" type="checkbox" value="${item.id}">
|
||||
</td>
|
||||
<td>
|
||||
<img width="45px" height="40px" id="show_img" src="<%=basePath%>normal/showImg.action?imagePath=${item.iconImg}"/>
|
||||
</td>
|
||||
<td>${item.name}</td>
|
||||
<td>${item.prize}</td>
|
||||
<td>${item.platformName}</td>
|
||||
|
||||
</tr>
|
||||
|
||||
</c:forEach>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
<%@ include file="include/page_simple.jsp"%>
|
||||
<nav>
|
||||
</div>
|
||||
<div class="modal-footer" style="margin-top: 0;">
|
||||
<label> <a href="<%=basePath%>adminOrder/toDispatch.action?id=${order.id}" class="btn btn-light">关闭</a></label>
|
||||
<%-- <button type="button" class="btn " href="<%=basePath%>/brush/goods/goodsList.action?id=${order.id}" data-dismiss="modal">关闭</button>--%>
|
||||
<button id="confirm-2" onclick="sure()" class="btn btn-default">确定</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<!-- End Panel -->
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- END CONTAINER -->
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
|
||||
<%@ include file="include/footer.jsp"%>
|
||||
</div>
|
||||
<!-- End Content -->
|
||||
<!-- //////////////////////////////////////////////////////////////////////////// -->
|
||||
|
||||
<%@ include file="include/js.jsp"%><script src="<%=basePath%>js/bootstrap/bootstrap-treeview.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
function choose(obj){
|
||||
var a = document.getElementsByName("checkbox");
|
||||
for(var i = 0; i< a.length; i ++){
|
||||
a[i].checked = false;
|
||||
}
|
||||
obj.checked = true;
|
||||
}
|
||||
|
||||
function sure(){
|
||||
let $checkbox = $(":checkbox:checked");
|
||||
if ($checkbox.length === 0) {
|
||||
window.alert("请选中一种商品");
|
||||
return;
|
||||
}
|
||||
let orderId = $("#orderId").val();
|
||||
let arr = new Array($checkbox.length);
|
||||
for (let i = 0; i < $checkbox.length; i++) {
|
||||
arr[i] = $($checkbox[i]).val();
|
||||
}
|
||||
id = arr[0];
|
||||
document.getElementById("queryForms").submit();
|
||||
}
|
||||
|
||||
<%--setTimeout(function() {--%>
|
||||
<%-- start();--%>
|
||||
<%--}, 100);--%>
|
||||
|
||||
<%--function start(){--%>
|
||||
<%-- var img = $("#iconImg").val();--%>
|
||||
<%-- var show_img = document.getElementById('show_img');--%>
|
||||
<%-- show_img.src="<%=basePath%>normal/showImg.action?imagePath="+img;--%>
|
||||
<%--}--%>
|
||||
|
||||
function toDelete(id,pageNo){
|
||||
$('#id').val(id);
|
||||
$('#pageNo').val(pageNo);
|
||||
$('#myModalLabel').html("删除");
|
||||
$('#mainform').attr("action","<%=basePath%>brush/goods/delete.action");
|
||||
|
||||
$('#modal_succeeded').modal("show");
|
||||
|
||||
}
|
||||
|
||||
$(function() {
|
||||
$('#startTime').datetimepicker({
|
||||
format : 'yyyy-mm-dd hh:ii:00',
|
||||
minuteStep:1,
|
||||
language : 'zh',
|
||||
weekStart : 1,
|
||||
todayBtn : 1,
|
||||
autoclose : 1,
|
||||
todayHighlight : 1,
|
||||
startView : 2,
|
||||
clearBtn : true
|
||||
});
|
||||
$('#endTime').datetimepicker({
|
||||
format : 'yyyy-mm-dd hh:ii:00',
|
||||
minuteStep:1,
|
||||
language : 'zh',
|
||||
weekStart : 1,
|
||||
todayBtn : 1,
|
||||
autoclose : 1,
|
||||
todayHighlight : 1,
|
||||
startView : 2,
|
||||
clearBtn : true
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user