package com.xunpay.money.controller;
import java.math.BigDecimal;
import java.net.URLEncoder;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import com.alibaba.fastjson.JSONObject;
import com.google.common.base.Charsets;
import com.google.common.collect.Maps;
import com.google.common.collect.Ordering;
import com.google.common.hash.Hashing;
import com.jfinal.plugin.activerecord.Db;
import com.jfinal.plugin.activerecord.Record;
import com.xunpay.money.core.BaseController;
import com.xunpay.money.model.AlipayAgentBill;
import com.xunpay.money.model.Coke;
import com.xunpay.money.model.CompanyApiInfo;
import com.xunpay.money.model.CompanyApiOrder;
import com.xunpay.money.model.CompanyBill;
import com.xunpay.money.model.CompanyChannel;
import com.xunpay.money.model.CompanyInfo;
import com.xunpay.money.model.CompanyOrder;
import com.xunpay.money.model.CompanyOrderSettle;
import com.xunpay.money.model.CompanySettleItem;
import com.xunpay.money.utils.Constant;
import com.xunpay.money.utils.DateUtils;
import com.xunpay.money.utils.EncryptUtils;
import com.xunpay.money.utils.HttpClientFactory;
import com.xunpay.money.utils.HttpClientHelper;
import com.xunpay.money.utils.HttpsClientHelper;
import com.xunpay.money.utils.ShiroUtils;
@RequiresPermissions("订单中心")
public class OrderController extends BaseController {
@RequiresPermissions("order")
public void listOrder() {
String pay_type = getPara("pay_type");
String trade_no = getPara("trade_no");
String select = "select *";
String except = "from company_order where is_del = 'N' ";
List<Object> args = new ArrayList<Object>();
except += getParaSqlLikeWithOr(args, "orderNo", "order_no", "out_order_no", "trade_no", "alipay_name");
except += getParaSql(args, "status", "status");
except += getParaSql(args, "notice", "notice");
except += getParaSql(args, "company_id", "company_id");
except += getParaSql(args, "trade_no", "trade_no");
//按照通道类型查询
except += getParaSql(args, "pay_type", "pay_type");
String startTime = getPara("startTime");
String endTime = getPara("endTime");
if (startTime != null && endTime != null) {
except += getParaDateCompare(startTime, endTime, "addtime");
}
except += " order by id desc";
keepPara();
String companyId = getPara("company_id");
Calendar c = Calendar.getInstance();
c.add(Calendar.HOUR, -7);
setAttr("hourList", Db.find("select date_format(addtime, '%H 点') as h, sum(order_money) as m from company_order where status = '已支付' and addtime > '" + DateUtils.get(c.getTime(), "yyyy-MM-dd HH") + "' group by date_format(addtime, '%H')"));
setAttr("page", CompanyOrder.dao.paginate(getParaToInt("page", 1), 20, select, except, args.toArray()));
setAttr("companys", CompanyInfo.dao.find("select * from company_info where is_del = 'N'"));
setAttr("startTime", startTime);
setAttr("endTime", endTime);
setAttr("companyId", companyId);
setAttr("payType", pay_type);
Date date = new Date();
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
String currentDay = format.format(date);
String startDate = currentDay + " 00:00:00";
String endDate = currentDay + " 23:59:59";
//System.out.println(ShiroUtils.getUser().getId());
//默认统计当天所有商户的流水金额
BigDecimal orderMoney = null;
//当查询条件不存在的时候
if ((args.size() == 0 || args.isEmpty()) && (startTime == null && endTime == null)) {
String sql = "select sum(order_money) from company_order where addtime>='" + startDate + "' and addtime<='" + endDate + "' and status='已支付' ";
orderMoney = Db.queryBigDecimal(sql);
setAttr("orderMoney", orderMoney == null ? 0 : orderMoney.intValue());
setAttr("day", "当天");
} else {
StringBuffer sb = new StringBuffer();
String sql = "select sum(order_money) from company_order where is_del = 'N' and status='已支付' ";
sb.append(sql);
//String status=getPara("status");
//String notice= getPara("notice");
String company_id = getPara("company_id");
String startTime1 = getPara("startTime");
String endTime1 = getPara("endTime");
String pay_type1 = getPara("pay_type");
if (company_id != null && !"".equals(company_id)) {
sb.append(" and company_id='" + company_id + "' ");
}
if (startTime1 != null && endTime1 != null) {
String str = getParaDateCompare(startTime1, endTime1, "addtime");
sb.append(str);
}
if (pay_type1 != null && !"".equals(pay_type1)) {
sb.append(" and pay_type='" + pay_type1 + "' ");
}
orderMoney = Db.queryBigDecimal(sb.toString());
setAttr("orderMoney", orderMoney == null ? BigDecimal.ZERO : orderMoney.intValue());
setAttr("day", "查询");
}
}
@RequiresPermissions("order")
public void listApiOrder() {
String pay_type = getPara("pay_type");
String trade_no = getPara("trade_no");
String select = "select *";
String except = "from company_apiorder where is_del = 'N' ";
List<Object> args = new ArrayList<Object>();
except += getParaSqlLikeWithOr(args, "orderNo", "order_no", "out_order_no", "trade_no");
except += getParaSql(args, "status", "status");
except += getParaSql(args, "notice", "notice");
except += getParaSql(args, "company_id", "company_id");
except += getParaSql(args, "trade_no", "trade_no");
except += getParaSql(args, "appid", "appid");
//按照通道类型查询
except += getParaSql(args, "pay_type", "pay_type");
String startTime = getPara("startTime");
String endTime = getPara("endTime");
if (startTime != null && endTime != null) {
except += getParaDateCompare(startTime, endTime, "addtime");
}
except += " order by id desc";
keepPara();
String companyId = getPara("company_id");
Calendar c = Calendar.getInstance();
c.add(Calendar.HOUR, -7);
setAttr("hourList", Db.find("select date_format(addtime, '%H 点') as h, sum(order_money) as m from company_apiorder where status = '已支付' and addtime > '" + DateUtils.get(c.getTime(), "yyyy-MM-dd HH") + "' group by date_format(addtime, '%H')"));
setAttr("page", CompanyOrder.dao.paginate(getParaToInt("page", 1), 20, select, except, args.toArray()));
setAttr("companys", CompanyInfo.dao.find("select * from company_info where is_del = 'N'"));
setAttr("startTime", startTime);
setAttr("endTime", endTime);
setAttr("companyId", companyId);
setAttr("payType", pay_type);
Date date = new Date();
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
String currentDay = format.format(date);
String startDate = currentDay + " 00:00:00";
String endDate = currentDay + " 23:59:59";
//System.out.println(ShiroUtils.getUser().getId());
//默认统计当天所有商户的流水金额
BigDecimal orderMoney = null;
//当查�
没有合适的资源?快使用搜索试试~ 我知道了~
话费充值系统。。。。。
共2000个文件
gif:1518个
class:776个
js:336个
需积分: 5 5 下载量 124 浏览量
2022-04-08
23:44:09
上传
评论 1
收藏 175.03MB ZIP 举报
温馨提示
2020-11-27 11:26:11|localhost-startStop-1|INFO |com.mchange.v2.log.MLog,80,<clinit>|-> MLog clients using log4j logging. 2020-11-27 11:26:11|localhost-startStop-1|INFO |com.mchange.v2.c3p0.C3P0Registry,204,banner|-> Initializing c3p0-0.9.1.2 [built 21-May-2007 15:04:56; debug? true; trace: 10] 2020-11-27 11:26:11|localhost-startStop-1|INFO |com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource,462,getPoolManager|-> Initializing c3p0 pool... com.mchange.v2.c3p0.ComboPooledDataSource [ acquireIn
资源详情
资源评论
资源推荐
收起资源包目录
话费充值系统。。。。。 (2000个子文件)
alipay.log.2020-08-06 7KB
access_log.2020-08-28 0B
access_log.2020-09-26 0B
access_log.2020-10-12 5KB
access_log.2020-10-13 0B
access_log.2020-11-13 260B
access_log.2020-11-19 0B
access_log.2020-11-21 12KB
alipay.log.2020-11-21 2KB
alipay.log.2020-11-23 3KB
access_log.2020-11-23 0B
access_log.2020-11-27 1KB
OrderController.class 28KB
OrderController.class 28KB
HttpsClientHelper.class 25KB
HttpsClientHelper.class 25KB
OrderController.class 24KB
OrderController.class 24KB
AbstractAlipayClient.class 24KB
AbstractAlipayClient.class 24KB
HttpClientHelperCtcc.class 22KB
HttpClientHelperCtcc.class 22KB
PayService.class 22KB
PayService.class 22KB
TencentCrawler.class 22KB
TencentCrawler.class 22KB
Http.class 20KB
Http.class 20KB
CompanyController.class 18KB
CompanyController.class 18KB
OrderController.class 18KB
OrderController.class 18KB
Notice_______Controller.class 18KB
Notice_______Controller.class 18KB
HttpCucc.class 17KB
HttpCucc.class 17KB
HttpCucc3.class 15KB
HttpCucc3.class 15KB
Cmcc.class 14KB
Cmcc.class 14KB
HttpClientHelperCmcc.class 13KB
HttpClientHelperCmcc.class 13KB
CuccTest2.class 13KB
CuccTest2.class 13KB
RSAUtilV2.class 13KB
RSAUtilV2.class 13KB
CuccTest3.class 13KB
CuccTest3.class 13KB
CmccHttp.class 12KB
CmccHttp.class 12KB
CtccTest2.class 12KB
CtccTest2.class 12KB
HttpCtccTest.class 12KB
HttpCtccTest.class 12KB
HttpCtccTest03.class 12KB
HttpCtccTest03.class 12KB
HttpClientHelperCucc.class 12KB
HttpClientHelperCucc.class 12KB
CuccTest.class 11KB
CuccTest.class 11KB
HttpClient4.class 11KB
HttpClient4.class 11KB
HttpClientFactory.class 11KB
HttpClientFactory.class 11KB
AgentOrderController.class 11KB
AgentOrderController.class 11KB
HttpClientHelperCuccCard.class 10KB
HttpClientHelperCuccCard.class 10KB
FinanceController.class 10KB
FinanceController.class 10KB
CuccJob2.class 10KB
CuccJob2.class 10KB
CuccJob.class 10KB
CuccJob.class 10KB
CuccCard.class 10KB
CuccCard.class 10KB
HttpClientFactory.class 10KB
HttpClientFactory.class 10KB
CompanyApiOrder.class 9KB
CompanyApiOrder.class 9KB
CompanyApiOrder.class 9KB
CompanyApiOrder.class 9KB
CompanyApiOrder.class 9KB
CompanyApiOrder.class 9KB
CompanyOrder.class 9KB
CompanyOrder.class 9KB
CompanyOrder.class 9KB
CompanyOrder.class 9KB
CompanyOrder.class 9KB
CompanyOrder.class 9KB
SystemInfo.class 9KB
SystemInfo.class 9KB
SystemInfo.class 9KB
SystemInfo.class 9KB
SystemInfo.class 9KB
SystemInfo.class 9KB
CtccTest.class 9KB
CtccTest.class 9KB
HttpClient.class 8KB
HttpClient.class 8KB
共 2000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
天都要
- 粉丝: 1
- 资源: 5
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0